@epam/statgpt-conversation-list 0.3.1 → 0.3.3

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 +839 -814
  3. package/package.json +4 -4
package/index.mjs CHANGED
@@ -1,110 +1,110 @@
1
- import { jsxs as y, jsx as m, Fragment as q } from "react/jsx-runtime";
2
- import k from "classnames";
3
- import x, { useState as T, useMemo as J, useEffect as ee, useCallback as B, useRef as ze } from "react";
4
- import { cloneDeep as $e, uniqBy as _e, omit as He } from "lodash";
1
+ import { jsxs as y, jsx as h, Fragment as q } from "react/jsx-runtime";
2
+ import B from "classnames";
3
+ import x, { useState as O, useMemo as J, useEffect as ee, useCallback as L, useRef as ze } from "react";
4
+ import { cloneDeep as _e, uniqBy as $e, omit as He } from "lodash";
5
5
  import { Popup as ae, PopUpSize as le, Button as Q, Loader as we, InputWithIcon as Ne, Input as Ye, PopUpState as z, Dropdown as Re, HighlightText as Qe, IconButton as Ge } from "@epam/statgpt-ui-components";
6
6
  import { IconCheck as je, IconCopy as We, IconDotsVertical as Ve, IconCaretRightFilled as Xe, IconX as Ke, IconSearch as Ze } from "@tabler/icons-react";
7
7
  import Je from "jszip";
8
- import { getConversationAttachments as qe, SHARE_CONVERSATION_ROUTE as ve, getClearedConversationName as fe, ONBOARDING_MODEL_POSTFIX as et, cleanConversationNames as K } from "@epam/statgpt-shared-toolkit";
8
+ import { getConversationAttachments as qe, SHARE_CONVERSATION_ROUTE as ve, getClearedConversationName as me, ONBOARDING_MODEL_POSTFIX as et, cleanConversationNames as K } from "@epam/statgpt-shared-toolkit";
9
9
  import { InvitationType as tt, getSharedConversationsRequest as re, ShareTarget as se } from "@epam/statgpt-dial-toolkit";
10
- var U = /* @__PURE__ */ ((o) => (o.DELETE = "delete", o.EXPORT = "export", o.SHARE = "share", o.RENAME = "rename", o))(U || {}), F = /* @__PURE__ */ ((o) => (o.SHARED = "shared", o.TODAY = "today", o.YESTERDAY = "yesterday", o.WEEK = "week", o.EARLIER = "earlier", o))(F || {});
11
- const ue = (o, s) => o?.resources?.filter((r) => r?.parentPath === s)?.map((r) => {
12
- const l = `${r?.bucket}/${s}`, c = r?.url?.split("/")?.slice(1)?.join("/");
10
+ var U = /* @__PURE__ */ ((n) => (n.DELETE = "delete", n.EXPORT = "export", n.SHARE = "share", n.RENAME = "rename", n))(U || {}), F = /* @__PURE__ */ ((n) => (n.SHARED = "shared", n.TODAY = "today", n.YESTERDAY = "yesterday", n.WEEK = "week", n.EARLIER = "earlier", n))(F || {});
11
+ const ue = (n, r) => n?.resources?.filter((s) => s?.parentPath === r)?.map((s) => {
12
+ const a = `${s?.bucket}/${r}`, d = s?.url?.split("/")?.slice(1)?.join("/");
13
13
  return {
14
- ...r,
15
- folderId: l,
16
- id: c,
14
+ ...s,
15
+ folderId: a,
16
+ id: d,
17
17
  isShared: !0
18
18
  };
19
- }) || [], nt = (o) => ({
20
- [F.SHARED]: o
19
+ }) || [], nt = (n) => ({
20
+ [F.SHARED]: n
21
21
  }), ot = {
22
22
  [F.TODAY]: [],
23
23
  [F.YESTERDAY]: [],
24
24
  [F.WEEK]: [],
25
25
  [F.EARLIER]: []
26
- }, Me = (o, s) => o.toDateString() === s.toDateString(), rt = (o, s) => {
27
- const r = new Date(
28
- o.getFullYear(),
29
- o.getMonth(),
30
- o.getDate() - 1
26
+ }, Me = (n, r) => n.toDateString() === r.toDateString(), rt = (n, r) => {
27
+ const s = new Date(
28
+ n.getFullYear(),
29
+ n.getMonth(),
30
+ n.getDate() - 1
31
31
  );
32
- return Me(s, r);
33
- }, st = (o, s) => {
34
- const r = o.getTime() - s.getTime();
35
- return Math.floor(r / (1e3 * 60 * 60 * 24));
36
- }, Ce = (o) => o.updatedAt || Number(o.id?.split("-").pop()), it = (o) => {
37
- const s = /* @__PURE__ */ new Date(), r = $e(ot);
38
- for (const l of o)
39
- if (l.updatedAt) {
40
- const c = new Date(l.updatedAt);
41
- let d;
42
- Me(s, c) ? d = r[F.TODAY] : rt(s, c) ? d = r[F.YESTERDAY] : st(s, c) <= 7 ? d = r[F.WEEK] : d = r[F.EARLIER], d?.some(
43
- (f) => f.id === l.id
44
- ) || d.push(l);
32
+ return Me(r, s);
33
+ }, st = (n, r) => {
34
+ const s = n.getTime() - r.getTime();
35
+ return Math.floor(s / (1e3 * 60 * 60 * 24));
36
+ }, Ce = (n) => n.updatedAt || Number(n.id?.split("-").pop()), it = (n) => {
37
+ const r = /* @__PURE__ */ new Date(), s = _e(ot);
38
+ for (const a of n)
39
+ if (a.updatedAt) {
40
+ const d = new Date(a.updatedAt);
41
+ let c;
42
+ Me(r, d) ? c = s[F.TODAY] : rt(r, d) ? c = s[F.YESTERDAY] : st(r, d) <= 7 ? c = s[F.WEEK] : c = s[F.EARLIER], c?.some(
43
+ (m) => m.id === a.id
44
+ ) || c.push(a);
45
45
  }
46
- return r;
47
- }, ye = (o) => o?.sort(
48
- (s, r) => (Ce(r) || 0) - (Ce(s) || 0)
49
- ), at = (o, s) => o === F.SHARED ? s?.shared || "Shared" : o === F.TODAY ? s?.today || "Today" : o === F.YESTERDAY ? s?.yesterday || "Yesterday" : o === F.WEEK ? s?.lastWeek || "Last week" : s?.earlier || "Earlier", lt = ({
50
- onCloseModal: o,
51
- disableModalDividers: s,
52
- deleteConversation: r,
53
- isSmallButton: l,
54
- titles: c,
55
- locale: d
46
+ return s;
47
+ }, ye = (n) => n?.sort(
48
+ (r, s) => (Ce(s) || 0) - (Ce(r) || 0)
49
+ ), at = (n, r) => n === F.SHARED ? r?.shared || "Shared" : n === F.TODAY ? r?.today || "Today" : n === F.YESTERDAY ? r?.yesterday || "Yesterday" : n === F.WEEK ? r?.lastWeek || "Last week" : r?.earlier || "Earlier", lt = ({
50
+ onCloseModal: n,
51
+ disableModalDividers: r,
52
+ deleteConversation: s,
53
+ isSmallButton: a,
54
+ titles: d,
55
+ locale: c
56
56
  }) => /* @__PURE__ */ y(
57
57
  ae,
58
58
  {
59
- heading: c?.deleteTitle ?? "Delete conversation",
59
+ heading: d?.deleteTitle ?? "Delete conversation",
60
60
  portalId: "delete-conversation",
61
61
  containerClassName: "delete-conversation-popup",
62
62
  size: le.SM,
63
- dividers: !s,
64
- onClose: o,
65
- closeButtonTitle: c?.close ?? "Cancel",
63
+ dividers: !r,
64
+ onClose: n,
65
+ closeButtonTitle: d?.close ?? "Cancel",
66
66
  children: [
67
- /* @__PURE__ */ m("div", { className: "py-4 px-6 sm:px-0", lang: d, children: c?.deleteMessage ?? "Are you sure you want to delete this conversation? This action cannot be undone." }),
67
+ /* @__PURE__ */ h("div", { className: "py-4 px-6 sm:px-0", lang: c, children: d?.deleteMessage ?? "Are you sure you want to delete this conversation? This action cannot be undone." }),
68
68
  /* @__PURE__ */ y("div", { className: "flex justify-end gap-x-2 py-3 px-6 delete-conversation-popup-footer", children: [
69
- /* @__PURE__ */ m(
69
+ /* @__PURE__ */ h(
70
70
  Q,
71
71
  {
72
72
  buttonClassName: "cancel-button",
73
- title: c?.cancel ?? "Cancel",
74
- isSmallButton: l,
75
- onClick: (f) => {
76
- f.stopPropagation(), o();
73
+ title: d?.cancel ?? "Cancel",
74
+ isSmallButton: a,
75
+ onClick: (m) => {
76
+ m.stopPropagation(), n();
77
77
  }
78
78
  }
79
79
  ),
80
- /* @__PURE__ */ m(
80
+ /* @__PURE__ */ h(
81
81
  Q,
82
82
  {
83
83
  buttonClassName: "text-button-primary text-button-primary-error",
84
- title: c?.delete ?? "Delete",
85
- isSmallButton: l,
86
- onClick: (f) => {
87
- f.stopPropagation(), r();
84
+ title: d?.delete ?? "Delete",
85
+ isSmallButton: a,
86
+ onClick: (m) => {
87
+ m.stopPropagation(), s();
88
88
  }
89
89
  }
90
90
  )
91
91
  ] })
92
92
  ]
93
93
  }
94
- ), ct = (o) => {
95
- const s = mt(
96
- qe(o)
97
- ).map((r) => ({
98
- ...r,
94
+ ), ct = (n) => {
95
+ const r = pt(
96
+ qe(n)
97
+ ).map((s) => ({
98
+ ...s,
99
99
  relativePath: "",
100
100
  contentLength: 0
101
101
  }));
102
- return _e(
103
- s,
104
- (r) => te(r.relativePath, r.name)
102
+ return $e(
103
+ r,
104
+ (s) => te(s.relativePath, s.name)
105
105
  );
106
- }, dt = (o) => o.endsWith("/"), ut = (o) => {
107
- const s = o.toLowerCase();
106
+ }, dt = (n) => n.endsWith("/"), ut = (n) => {
107
+ const r = n.toLowerCase();
108
108
  return [
109
109
  "data:",
110
110
  "//",
@@ -115,86 +115,86 @@ const ue = (o, s) => o?.resources?.filter((r) => r?.parentPath === s)?.map((r) =
115
115
  "mailto:",
116
116
  "telnet://",
117
117
  "api/files"
118
- ].some((r) => s.startsWith(r));
119
- }, ht = (o) => {
120
- const s = te(
121
- ...o.split("/").map((l) => decodeURIComponent(l))
122
- ), r = s.lastIndexOf("/");
118
+ ].some((s) => r.startsWith(s));
119
+ }, ht = (n) => {
120
+ const r = te(
121
+ ...n.split("/").map((a) => decodeURIComponent(a))
122
+ ), s = r.lastIndexOf("/");
123
123
  return {
124
- absolutePath: s.slice(0, r),
125
- name: s.slice(r + 1)
124
+ absolutePath: r.slice(0, s),
125
+ name: r.slice(s + 1)
126
126
  };
127
- }, mt = (o) => o ? o.map((s) => {
128
- if (!s.url || ut(s.url) || dt(s.url))
127
+ }, pt = (n) => n ? n.map((r) => {
128
+ if (!r.url || ut(r.url) || dt(r.url))
129
129
  return null;
130
- const { absolutePath: r, name: l } = ht(s.url);
130
+ const { absolutePath: s, name: a } = ht(r.url);
131
131
  return {
132
- id: s.url,
133
- name: l,
134
- contentType: s.type,
135
- folderId: r,
136
- absolutePath: r
132
+ id: r.url,
133
+ name: a,
134
+ contentType: r.type,
135
+ folderId: s,
136
+ absolutePath: s
137
137
  };
138
138
  }).filter(Boolean) : [];
139
- async function ft(o, s) {
140
- const r = ct(o), l = new Je();
141
- r.forEach((p) => {
142
- const e = encodeURI(te(p.absolutePath, p.name)), n = s(`${e}`.replace("files/", "")), t = pt(p.folderId), i = te("res", t, p.name);
143
- l.file(i, n);
139
+ async function mt(n, r) {
140
+ const s = ct(n), a = new Je();
141
+ s.forEach((f) => {
142
+ const e = encodeURI(te(f.absolutePath, f.name)), o = r(`${e}`.replace("files/", "")), t = ft(f.folderId), i = te("res", t, f.name);
143
+ a.file(i, o);
144
144
  });
145
- const c = {
145
+ const d = {
146
146
  version: 5,
147
- history: [o].map(gt) || [],
147
+ history: [n].map(gt) || [],
148
148
  folders: []
149
- }, d = JSON.stringify(c, null, 2);
150
- return l.file("conversations/conversations_history.json", d), await l.generateAsync({ type: "base64" });
149
+ }, c = JSON.stringify(d, null, 2);
150
+ return a.file("conversations/conversations_history.json", c), await a.generateAsync({ type: "base64" });
151
151
  }
152
- const pt = (o) => {
153
- const s = o.split("/");
154
- return s.length > 2 ? te(...s.slice(2)) : void 0;
155
- }, gt = (o) => He(o, ["publicationInfo"]), te = (...o) => o.filter(Boolean).join("/");
156
- function Ct(o, s) {
157
- const r = document.createElement("a");
158
- r.download = s, r.href = o, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(o);
152
+ const ft = (n) => {
153
+ const r = n.split("/");
154
+ return r.length > 2 ? te(...r.slice(2)) : void 0;
155
+ }, gt = (n) => He(n, ["publicationInfo"]), te = (...n) => n.filter(Boolean).join("/");
156
+ function Ct(n, r) {
157
+ const s = document.createElement("a");
158
+ s.download = r, s.href = n, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(n);
159
159
  }
160
- var Et = Object.defineProperty, ie = Object.getOwnPropertySymbols, Ae = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable, Ee = (o, s, r) => s in o ? Et(o, s, { enumerable: !0, configurable: !0, writable: !0, value: r }) : o[s] = r, he = (o, s) => {
161
- for (var r in s || (s = {}))
162
- Ae.call(s, r) && Ee(o, r, s[r]);
160
+ var Et = Object.defineProperty, ie = Object.getOwnPropertySymbols, be = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable, Ee = (n, r, s) => r in n ? Et(n, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[r] = s, he = (n, r) => {
161
+ for (var s in r || (r = {}))
162
+ be.call(r, s) && Ee(n, s, r[s]);
163
163
  if (ie)
164
- for (var r of ie(s))
165
- Ie.call(s, r) && Ee(o, r, s[r]);
166
- return o;
167
- }, me = (o, s) => {
168
- var r = {};
169
- for (var l in o)
170
- Ae.call(o, l) && s.indexOf(l) < 0 && (r[l] = o[l]);
171
- if (o != null && ie)
172
- for (var l of ie(o))
173
- s.indexOf(l) < 0 && Ie.call(o, l) && (r[l] = o[l]);
174
- return r;
164
+ for (var s of ie(r))
165
+ Ie.call(r, s) && Ee(n, s, r[s]);
166
+ return n;
167
+ }, pe = (n, r) => {
168
+ var s = {};
169
+ for (var a in n)
170
+ be.call(n, a) && r.indexOf(a) < 0 && (s[a] = n[a]);
171
+ if (n != null && ie)
172
+ for (var a of ie(n))
173
+ r.indexOf(a) < 0 && Ie.call(n, a) && (s[a] = n[a]);
174
+ return s;
175
175
  };
176
176
  var X;
177
- ((o) => {
178
- const s = class w {
177
+ ((n) => {
178
+ const r = class w {
179
179
  /*-- Constructor (low level) and fields --*/
180
180
  // Creates a new QR Code with the given version number,
181
181
  // error correction level, data codeword bytes, and mask number.
182
182
  // This is a low-level API that most users should not use directly.
183
183
  // A mid-level API is the encodeSegments() function.
184
- constructor(e, n, t, i) {
185
- if (this.version = e, this.errorCorrectionLevel = n, this.modules = [], this.isFunction = [], e < w.MIN_VERSION || e > w.MAX_VERSION)
184
+ constructor(e, o, t, i) {
185
+ if (this.version = e, this.errorCorrectionLevel = o, this.modules = [], this.isFunction = [], e < w.MIN_VERSION || e > w.MAX_VERSION)
186
186
  throw new RangeError("Version value out of range");
187
187
  if (i < -1 || i > 7)
188
188
  throw new RangeError("Mask value out of range");
189
189
  this.size = e * 4 + 17;
190
- let a = [];
190
+ let l = [];
191
191
  for (let u = 0; u < this.size; u++)
192
- a.push(!1);
192
+ l.push(!1);
193
193
  for (let u = 0; u < this.size; u++)
194
- this.modules.push(a.slice()), this.isFunction.push(a.slice());
194
+ this.modules.push(l.slice()), this.isFunction.push(l.slice());
195
195
  this.drawFunctionPatterns();
196
- const h = this.addEccAndInterleave(t);
197
- if (this.drawCodewords(h), i == -1) {
196
+ const p = this.addEccAndInterleave(t);
197
+ if (this.drawCodewords(p), i == -1) {
198
198
  let u = 1e9;
199
199
  for (let E = 0; E < 8; E++) {
200
200
  this.applyMask(E), this.drawFormatBits(E);
@@ -202,7 +202,7 @@ var X;
202
202
  g < u && (i = E, u = g), this.applyMask(E);
203
203
  }
204
204
  }
205
- c(0 <= i && i <= 7), this.mask = i, this.applyMask(i), this.drawFormatBits(i), this.isFunction = [];
205
+ d(0 <= i && i <= 7), this.mask = i, this.applyMask(i), this.drawFormatBits(i), this.isFunction = [];
206
206
  }
207
207
  /*-- Static factory functions (high level) --*/
208
208
  // Returns a QR Code representing the given Unicode text string at the given error correction level.
@@ -210,17 +210,17 @@ var X;
210
210
  // Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
211
211
  // QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
212
212
  // ecl argument if it can be done without increasing the version.
213
- static encodeText(e, n) {
214
- const t = o.QrSegment.makeSegments(e);
215
- return w.encodeSegments(t, n);
213
+ static encodeText(e, o) {
214
+ const t = n.QrSegment.makeSegments(e);
215
+ return w.encodeSegments(t, o);
216
216
  }
217
217
  // Returns a QR Code representing the given binary data at the given error correction level.
218
218
  // This function always encodes using the binary segment mode, not any text mode. The maximum number of
219
219
  // bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
220
220
  // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
221
- static encodeBinary(e, n) {
222
- const t = o.QrSegment.makeBytes(e);
223
- return w.encodeSegments([t], n);
221
+ static encodeBinary(e, o) {
222
+ const t = n.QrSegment.makeBytes(e);
223
+ return w.encodeSegments([t], o);
224
224
  }
225
225
  /*-- Static factory functions (mid level) --*/
226
226
  // Returns a QR Code representing the given segments with the given encoding parameters.
@@ -232,12 +232,12 @@ var X;
232
232
  // This function allows the user to create a custom sequence of segments that switches
233
233
  // between modes (such as alphanumeric and byte) to encode text in less space.
234
234
  // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
235
- static encodeSegments(e, n, t = 1, i = 40, a = -1, h = !0) {
236
- if (!(w.MIN_VERSION <= t && t <= i && i <= w.MAX_VERSION) || a < -1 || a > 7)
235
+ static encodeSegments(e, o, t = 1, i = 40, l = -1, p = !0) {
236
+ if (!(w.MIN_VERSION <= t && t <= i && i <= w.MAX_VERSION) || l < -1 || l > 7)
237
237
  throw new RangeError("Invalid value");
238
238
  let u, E;
239
239
  for (u = t; ; u++) {
240
- const C = w.getNumDataCodewords(u, n) * 8, R = f.getTotalBits(e, u);
240
+ const C = w.getNumDataCodewords(u, o) * 8, R = m.getTotalBits(e, u);
241
241
  if (R <= C) {
242
242
  E = R;
243
243
  break;
@@ -246,29 +246,29 @@ var X;
246
246
  throw new RangeError("Data too long");
247
247
  }
248
248
  for (const C of [w.Ecc.MEDIUM, w.Ecc.QUARTILE, w.Ecc.HIGH])
249
- h && E <= w.getNumDataCodewords(u, C) * 8 && (n = C);
249
+ p && E <= w.getNumDataCodewords(u, C) * 8 && (o = C);
250
250
  let g = [];
251
251
  for (const C of e) {
252
- r(C.mode.modeBits, 4, g), r(C.numChars, C.mode.numCharCountBits(u), g);
252
+ s(C.mode.modeBits, 4, g), s(C.numChars, C.mode.numCharCountBits(u), g);
253
253
  for (const R of C.getData())
254
254
  g.push(R);
255
255
  }
256
- c(g.length == E);
257
- const v = w.getNumDataCodewords(u, n) * 8;
258
- c(g.length <= v), r(0, Math.min(4, v - g.length), g), r(0, (8 - g.length % 8) % 8, g), c(g.length % 8 == 0);
256
+ d(g.length == E);
257
+ const v = w.getNumDataCodewords(u, o) * 8;
258
+ d(g.length <= v), s(0, Math.min(4, v - g.length), g), s(0, (8 - g.length % 8) % 8, g), d(g.length % 8 == 0);
259
259
  for (let C = 236; g.length < v; C ^= 253)
260
- r(C, 8, g);
260
+ s(C, 8, g);
261
261
  let N = [];
262
262
  for (; N.length * 8 < g.length; )
263
263
  N.push(0);
264
- return g.forEach((C, R) => N[R >>> 3] |= C << 7 - (R & 7)), new w(u, n, N, a);
264
+ return g.forEach((C, R) => N[R >>> 3] |= C << 7 - (R & 7)), new w(u, o, N, l);
265
265
  }
266
266
  /*-- Accessor methods --*/
267
267
  // Returns the color of the module (pixel) at the given coordinates, which is false
268
268
  // for light or true for dark. The top left corner has the coordinates (x=0, y=0).
269
269
  // If the given coordinates are out of bounds, then false (light) is returned.
270
- getModule(e, n) {
271
- return 0 <= e && e < this.size && 0 <= n && n < this.size && this.modules[n][e];
270
+ getModule(e, o) {
271
+ return 0 <= e && e < this.size && 0 <= o && o < this.size && this.modules[o][e];
272
272
  }
273
273
  // Modified to expose modules for easy access
274
274
  getModules() {
@@ -280,30 +280,30 @@ var X;
280
280
  for (let t = 0; t < this.size; t++)
281
281
  this.setFunctionModule(6, t, t % 2 == 0), this.setFunctionModule(t, 6, t % 2 == 0);
282
282
  this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
283
- const e = this.getAlignmentPatternPositions(), n = e.length;
284
- for (let t = 0; t < n; t++)
285
- for (let i = 0; i < n; i++)
286
- t == 0 && i == 0 || t == 0 && i == n - 1 || t == n - 1 && i == 0 || this.drawAlignmentPattern(e[t], e[i]);
283
+ const e = this.getAlignmentPatternPositions(), o = e.length;
284
+ for (let t = 0; t < o; t++)
285
+ for (let i = 0; i < o; i++)
286
+ t == 0 && i == 0 || t == 0 && i == o - 1 || t == o - 1 && i == 0 || this.drawAlignmentPattern(e[t], e[i]);
287
287
  this.drawFormatBits(0), this.drawVersion();
288
288
  }
289
289
  // Draws two copies of the format bits (with its own error correction code)
290
290
  // based on the given mask and this object's error correction level field.
291
291
  drawFormatBits(e) {
292
- const n = this.errorCorrectionLevel.formatBits << 3 | e;
293
- let t = n;
294
- for (let a = 0; a < 10; a++)
292
+ const o = this.errorCorrectionLevel.formatBits << 3 | e;
293
+ let t = o;
294
+ for (let l = 0; l < 10; l++)
295
295
  t = t << 1 ^ (t >>> 9) * 1335;
296
- const i = (n << 10 | t) ^ 21522;
297
- c(i >>> 15 == 0);
298
- for (let a = 0; a <= 5; a++)
299
- this.setFunctionModule(8, a, l(i, a));
300
- this.setFunctionModule(8, 7, l(i, 6)), this.setFunctionModule(8, 8, l(i, 7)), this.setFunctionModule(7, 8, l(i, 8));
301
- for (let a = 9; a < 15; a++)
302
- this.setFunctionModule(14 - a, 8, l(i, a));
303
- for (let a = 0; a < 8; a++)
304
- this.setFunctionModule(this.size - 1 - a, 8, l(i, a));
305
- for (let a = 8; a < 15; a++)
306
- this.setFunctionModule(8, this.size - 15 + a, l(i, a));
296
+ const i = (o << 10 | t) ^ 21522;
297
+ d(i >>> 15 == 0);
298
+ for (let l = 0; l <= 5; l++)
299
+ this.setFunctionModule(8, l, a(i, l));
300
+ this.setFunctionModule(8, 7, a(i, 6)), this.setFunctionModule(8, 8, a(i, 7)), this.setFunctionModule(7, 8, a(i, 8));
301
+ for (let l = 9; l < 15; l++)
302
+ this.setFunctionModule(14 - l, 8, a(i, l));
303
+ for (let l = 0; l < 8; l++)
304
+ this.setFunctionModule(this.size - 1 - l, 8, a(i, l));
305
+ for (let l = 8; l < 15; l++)
306
+ this.setFunctionModule(8, this.size - 15 + l, a(i, l));
307
307
  this.setFunctionModule(8, this.size - 8, !0);
308
308
  }
309
309
  // Draws two copies of the version bits (with its own error correction code),
@@ -314,46 +314,46 @@ var X;
314
314
  let e = this.version;
315
315
  for (let t = 0; t < 12; t++)
316
316
  e = e << 1 ^ (e >>> 11) * 7973;
317
- const n = this.version << 12 | e;
318
- c(n >>> 18 == 0);
317
+ const o = this.version << 12 | e;
318
+ d(o >>> 18 == 0);
319
319
  for (let t = 0; t < 18; t++) {
320
- const i = l(n, t), a = this.size - 11 + t % 3, h = Math.floor(t / 3);
321
- this.setFunctionModule(a, h, i), this.setFunctionModule(h, a, i);
320
+ const i = a(o, t), l = this.size - 11 + t % 3, p = Math.floor(t / 3);
321
+ this.setFunctionModule(l, p, i), this.setFunctionModule(p, l, i);
322
322
  }
323
323
  }
324
324
  // Draws a 9*9 finder pattern including the border separator,
325
325
  // with the center module at (x, y). Modules can be out of bounds.
326
- drawFinderPattern(e, n) {
326
+ drawFinderPattern(e, o) {
327
327
  for (let t = -4; t <= 4; t++)
328
328
  for (let i = -4; i <= 4; i++) {
329
- const a = Math.max(Math.abs(i), Math.abs(t)), h = e + i, u = n + t;
330
- 0 <= h && h < this.size && 0 <= u && u < this.size && this.setFunctionModule(h, u, a != 2 && a != 4);
329
+ const l = Math.max(Math.abs(i), Math.abs(t)), p = e + i, u = o + t;
330
+ 0 <= p && p < this.size && 0 <= u && u < this.size && this.setFunctionModule(p, u, l != 2 && l != 4);
331
331
  }
332
332
  }
333
333
  // Draws a 5*5 alignment pattern, with the center module
334
334
  // at (x, y). All modules must be in bounds.
335
- drawAlignmentPattern(e, n) {
335
+ drawAlignmentPattern(e, o) {
336
336
  for (let t = -2; t <= 2; t++)
337
337
  for (let i = -2; i <= 2; i++)
338
- this.setFunctionModule(e + i, n + t, Math.max(Math.abs(i), Math.abs(t)) != 1);
338
+ this.setFunctionModule(e + i, o + t, Math.max(Math.abs(i), Math.abs(t)) != 1);
339
339
  }
340
340
  // Sets the color of a module and marks it as a function module.
341
341
  // Only used by the constructor. Coordinates must be in bounds.
342
- setFunctionModule(e, n, t) {
343
- this.modules[n][e] = t, this.isFunction[n][e] = !0;
342
+ setFunctionModule(e, o, t) {
343
+ this.modules[o][e] = t, this.isFunction[o][e] = !0;
344
344
  }
345
345
  /*-- Private helper methods for constructor: Codewords and masking --*/
346
346
  // Returns a new byte string representing the given data with the appropriate error correction
347
347
  // codewords appended to it, based on this object's version and error correction level.
348
348
  addEccAndInterleave(e) {
349
- const n = this.version, t = this.errorCorrectionLevel;
350
- if (e.length != w.getNumDataCodewords(n, t))
349
+ const o = this.version, t = this.errorCorrectionLevel;
350
+ if (e.length != w.getNumDataCodewords(o, t))
351
351
  throw new RangeError("Invalid argument");
352
- const i = w.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][n], a = w.ECC_CODEWORDS_PER_BLOCK[t.ordinal][n], h = Math.floor(w.getNumRawDataModules(n) / 8), u = i - h % i, E = Math.floor(h / i);
352
+ const i = w.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][o], l = w.ECC_CODEWORDS_PER_BLOCK[t.ordinal][o], p = Math.floor(w.getNumRawDataModules(o) / 8), u = i - p % i, E = Math.floor(p / i);
353
353
  let g = [];
354
- const v = w.reedSolomonComputeDivisor(a);
354
+ const v = w.reedSolomonComputeDivisor(l);
355
355
  for (let C = 0, R = 0; C < i; C++) {
356
- let S = e.slice(R, R + E - a + (C < u ? 0 : 1));
356
+ let S = e.slice(R, R + E - l + (C < u ? 0 : 1));
357
357
  R += S.length;
358
358
  const D = w.reedSolomonComputeRemainder(S, v);
359
359
  C < u && S.push(0), g.push(S.concat(D));
@@ -361,25 +361,25 @@ var X;
361
361
  let N = [];
362
362
  for (let C = 0; C < g[0].length; C++)
363
363
  g.forEach((R, S) => {
364
- (C != E - a || S >= u) && N.push(R[C]);
364
+ (C != E - l || S >= u) && N.push(R[C]);
365
365
  });
366
- return c(N.length == h), N;
366
+ return d(N.length == p), N;
367
367
  }
368
368
  // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
369
369
  // data area of this QR Code. Function modules need to be marked off before this is called.
370
370
  drawCodewords(e) {
371
371
  if (e.length != Math.floor(w.getNumRawDataModules(this.version) / 8))
372
372
  throw new RangeError("Invalid argument");
373
- let n = 0;
373
+ let o = 0;
374
374
  for (let t = this.size - 1; t >= 1; t -= 2) {
375
375
  t == 6 && (t = 5);
376
376
  for (let i = 0; i < this.size; i++)
377
- for (let a = 0; a < 2; a++) {
378
- const h = t - a, E = (t + 1 & 2) == 0 ? this.size - 1 - i : i;
379
- !this.isFunction[E][h] && n < e.length * 8 && (this.modules[E][h] = l(e[n >>> 3], 7 - (n & 7)), n++);
377
+ for (let l = 0; l < 2; l++) {
378
+ const p = t - l, E = (t + 1 & 2) == 0 ? this.size - 1 - i : i;
379
+ !this.isFunction[E][p] && o < e.length * 8 && (this.modules[E][p] = a(e[o >>> 3], 7 - (o & 7)), o++);
380
380
  }
381
381
  }
382
- c(n == e.length * 8);
382
+ d(o == e.length * 8);
383
383
  }
384
384
  // XORs the codeword modules in this QR Code with the given mask pattern.
385
385
  // The function modules must be marked and the codeword bits must be drawn
@@ -389,66 +389,66 @@ var X;
389
389
  applyMask(e) {
390
390
  if (e < 0 || e > 7)
391
391
  throw new RangeError("Mask value out of range");
392
- for (let n = 0; n < this.size; n++)
392
+ for (let o = 0; o < this.size; o++)
393
393
  for (let t = 0; t < this.size; t++) {
394
394
  let i;
395
395
  switch (e) {
396
396
  case 0:
397
- i = (t + n) % 2 == 0;
397
+ i = (t + o) % 2 == 0;
398
398
  break;
399
399
  case 1:
400
- i = n % 2 == 0;
400
+ i = o % 2 == 0;
401
401
  break;
402
402
  case 2:
403
403
  i = t % 3 == 0;
404
404
  break;
405
405
  case 3:
406
- i = (t + n) % 3 == 0;
406
+ i = (t + o) % 3 == 0;
407
407
  break;
408
408
  case 4:
409
- i = (Math.floor(t / 3) + Math.floor(n / 2)) % 2 == 0;
409
+ i = (Math.floor(t / 3) + Math.floor(o / 2)) % 2 == 0;
410
410
  break;
411
411
  case 5:
412
- i = t * n % 2 + t * n % 3 == 0;
412
+ i = t * o % 2 + t * o % 3 == 0;
413
413
  break;
414
414
  case 6:
415
- i = (t * n % 2 + t * n % 3) % 2 == 0;
415
+ i = (t * o % 2 + t * o % 3) % 2 == 0;
416
416
  break;
417
417
  case 7:
418
- i = ((t + n) % 2 + t * n % 3) % 2 == 0;
418
+ i = ((t + o) % 2 + t * o % 3) % 2 == 0;
419
419
  break;
420
420
  default:
421
421
  throw new Error("Unreachable");
422
422
  }
423
- !this.isFunction[n][t] && i && (this.modules[n][t] = !this.modules[n][t]);
423
+ !this.isFunction[o][t] && i && (this.modules[o][t] = !this.modules[o][t]);
424
424
  }
425
425
  }
426
426
  // Calculates and returns the penalty score based on state of this QR Code's current modules.
427
427
  // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.
428
428
  getPenaltyScore() {
429
429
  let e = 0;
430
- for (let a = 0; a < this.size; a++) {
431
- let h = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
430
+ for (let l = 0; l < this.size; l++) {
431
+ let p = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
432
432
  for (let g = 0; g < this.size; g++)
433
- this.modules[a][g] == h ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), h || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), h = this.modules[a][g], u = 1);
434
- e += this.finderPenaltyTerminateAndCount(h, u, E) * w.PENALTY_N3;
433
+ this.modules[l][g] == p ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), p || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), p = this.modules[l][g], u = 1);
434
+ e += this.finderPenaltyTerminateAndCount(p, u, E) * w.PENALTY_N3;
435
435
  }
436
- for (let a = 0; a < this.size; a++) {
437
- let h = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
436
+ for (let l = 0; l < this.size; l++) {
437
+ let p = !1, u = 0, E = [0, 0, 0, 0, 0, 0, 0];
438
438
  for (let g = 0; g < this.size; g++)
439
- this.modules[g][a] == h ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), h || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), h = this.modules[g][a], u = 1);
440
- e += this.finderPenaltyTerminateAndCount(h, u, E) * w.PENALTY_N3;
439
+ this.modules[g][l] == p ? (u++, u == 5 ? e += w.PENALTY_N1 : u > 5 && e++) : (this.finderPenaltyAddHistory(u, E), p || (e += this.finderPenaltyCountPatterns(E) * w.PENALTY_N3), p = this.modules[g][l], u = 1);
440
+ e += this.finderPenaltyTerminateAndCount(p, u, E) * w.PENALTY_N3;
441
441
  }
442
- for (let a = 0; a < this.size - 1; a++)
443
- for (let h = 0; h < this.size - 1; h++) {
444
- const u = this.modules[a][h];
445
- u == this.modules[a][h + 1] && u == this.modules[a + 1][h] && u == this.modules[a + 1][h + 1] && (e += w.PENALTY_N2);
442
+ for (let l = 0; l < this.size - 1; l++)
443
+ for (let p = 0; p < this.size - 1; p++) {
444
+ const u = this.modules[l][p];
445
+ u == this.modules[l][p + 1] && u == this.modules[l + 1][p] && u == this.modules[l + 1][p + 1] && (e += w.PENALTY_N2);
446
446
  }
447
- let n = 0;
448
- for (const a of this.modules)
449
- n = a.reduce((h, u) => h + (u ? 1 : 0), n);
450
- const t = this.size * this.size, i = Math.ceil(Math.abs(n * 20 - t * 10) / t) - 1;
451
- return c(0 <= i && i <= 9), e += i * w.PENALTY_N4, c(0 <= e && e <= 2568888), e;
447
+ let o = 0;
448
+ for (const l of this.modules)
449
+ o = l.reduce((p, u) => p + (u ? 1 : 0), o);
450
+ const t = this.size * this.size, i = Math.ceil(Math.abs(o * 20 - t * 10) / t) - 1;
451
+ return d(0 <= i && i <= 9), e += i * w.PENALTY_N4, d(0 <= e && e <= 2568888), e;
452
452
  }
453
453
  /*-- Private helper functions --*/
454
454
  // Returns an ascending list of positions of alignment patterns for this version number.
@@ -458,9 +458,9 @@ var X;
458
458
  if (this.version == 1)
459
459
  return [];
460
460
  {
461
- const e = Math.floor(this.version / 7) + 2, n = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (e * 2 - 2)) * 2;
461
+ const e = Math.floor(this.version / 7) + 2, o = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (e * 2 - 2)) * 2;
462
462
  let t = [6];
463
- for (let i = this.size - 7; t.length < e; i -= n)
463
+ for (let i = this.size - 7; t.length < e; i -= o)
464
464
  t.splice(1, 0, i);
465
465
  return t;
466
466
  }
@@ -471,73 +471,73 @@ var X;
471
471
  static getNumRawDataModules(e) {
472
472
  if (e < w.MIN_VERSION || e > w.MAX_VERSION)
473
473
  throw new RangeError("Version number out of range");
474
- let n = (16 * e + 128) * e + 64;
474
+ let o = (16 * e + 128) * e + 64;
475
475
  if (e >= 2) {
476
476
  const t = Math.floor(e / 7) + 2;
477
- n -= (25 * t - 10) * t - 55, e >= 7 && (n -= 36);
477
+ o -= (25 * t - 10) * t - 55, e >= 7 && (o -= 36);
478
478
  }
479
- return c(208 <= n && n <= 29648), n;
479
+ return d(208 <= o && o <= 29648), o;
480
480
  }
481
481
  // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
482
482
  // QR Code of the given version number and error correction level, with remainder bits discarded.
483
483
  // This stateless pure function could be implemented as a (40*4)-cell lookup table.
484
- static getNumDataCodewords(e, n) {
485
- return Math.floor(w.getNumRawDataModules(e) / 8) - w.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e] * w.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e];
484
+ static getNumDataCodewords(e, o) {
485
+ return Math.floor(w.getNumRawDataModules(e) / 8) - w.ECC_CODEWORDS_PER_BLOCK[o.ordinal][e] * w.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][e];
486
486
  }
487
487
  // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
488
488
  // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
489
489
  static reedSolomonComputeDivisor(e) {
490
490
  if (e < 1 || e > 255)
491
491
  throw new RangeError("Degree out of range");
492
- let n = [];
492
+ let o = [];
493
493
  for (let i = 0; i < e - 1; i++)
494
- n.push(0);
495
- n.push(1);
494
+ o.push(0);
495
+ o.push(1);
496
496
  let t = 1;
497
497
  for (let i = 0; i < e; i++) {
498
- for (let a = 0; a < n.length; a++)
499
- n[a] = w.reedSolomonMultiply(n[a], t), a + 1 < n.length && (n[a] ^= n[a + 1]);
498
+ for (let l = 0; l < o.length; l++)
499
+ o[l] = w.reedSolomonMultiply(o[l], t), l + 1 < o.length && (o[l] ^= o[l + 1]);
500
500
  t = w.reedSolomonMultiply(t, 2);
501
501
  }
502
- return n;
502
+ return o;
503
503
  }
504
504
  // Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
505
- static reedSolomonComputeRemainder(e, n) {
506
- let t = n.map((i) => 0);
505
+ static reedSolomonComputeRemainder(e, o) {
506
+ let t = o.map((i) => 0);
507
507
  for (const i of e) {
508
- const a = i ^ t.shift();
509
- t.push(0), n.forEach((h, u) => t[u] ^= w.reedSolomonMultiply(h, a));
508
+ const l = i ^ t.shift();
509
+ t.push(0), o.forEach((p, u) => t[u] ^= w.reedSolomonMultiply(p, l));
510
510
  }
511
511
  return t;
512
512
  }
513
513
  // Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
514
514
  // are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
515
- static reedSolomonMultiply(e, n) {
516
- if (e >>> 8 || n >>> 8)
515
+ static reedSolomonMultiply(e, o) {
516
+ if (e >>> 8 || o >>> 8)
517
517
  throw new RangeError("Byte out of range");
518
518
  let t = 0;
519
519
  for (let i = 7; i >= 0; i--)
520
- t = t << 1 ^ (t >>> 7) * 285, t ^= (n >>> i & 1) * e;
521
- return c(t >>> 8 == 0), t;
520
+ t = t << 1 ^ (t >>> 7) * 285, t ^= (o >>> i & 1) * e;
521
+ return d(t >>> 8 == 0), t;
522
522
  }
523
523
  // Can only be called immediately after a light run is added, and
524
524
  // returns either 0, 1, or 2. A helper function for getPenaltyScore().
525
525
  finderPenaltyCountPatterns(e) {
526
- const n = e[1];
527
- c(n <= this.size * 3);
528
- const t = n > 0 && e[2] == n && e[3] == n * 3 && e[4] == n && e[5] == n;
529
- return (t && e[0] >= n * 4 && e[6] >= n ? 1 : 0) + (t && e[6] >= n * 4 && e[0] >= n ? 1 : 0);
526
+ const o = e[1];
527
+ d(o <= this.size * 3);
528
+ const t = o > 0 && e[2] == o && e[3] == o * 3 && e[4] == o && e[5] == o;
529
+ return (t && e[0] >= o * 4 && e[6] >= o ? 1 : 0) + (t && e[6] >= o * 4 && e[0] >= o ? 1 : 0);
530
530
  }
531
531
  // Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
532
- finderPenaltyTerminateAndCount(e, n, t) {
533
- return e && (this.finderPenaltyAddHistory(n, t), n = 0), n += this.size, this.finderPenaltyAddHistory(n, t), this.finderPenaltyCountPatterns(t);
532
+ finderPenaltyTerminateAndCount(e, o, t) {
533
+ return e && (this.finderPenaltyAddHistory(o, t), o = 0), o += this.size, this.finderPenaltyAddHistory(o, t), this.finderPenaltyCountPatterns(t);
534
534
  }
535
535
  // Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
536
- finderPenaltyAddHistory(e, n) {
537
- n[0] == 0 && (e += this.size), n.pop(), n.unshift(e);
536
+ finderPenaltyAddHistory(e, o) {
537
+ o[0] == 0 && (e += this.size), o.pop(), o.unshift(e);
538
538
  }
539
539
  };
540
- s.MIN_VERSION = 1, s.MAX_VERSION = 40, s.PENALTY_N1 = 3, s.PENALTY_N2 = 3, s.PENALTY_N3 = 40, s.PENALTY_N4 = 10, s.ECC_CODEWORDS_PER_BLOCK = [
540
+ r.MIN_VERSION = 1, r.MAX_VERSION = 40, r.PENALTY_N1 = 3, r.PENALTY_N2 = 3, r.PENALTY_N3 = 40, r.PENALTY_N4 = 10, r.ECC_CODEWORDS_PER_BLOCK = [
541
541
  // Version: (note that index 0 is for padding, and is set to an illegal value)
542
542
  //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
543
543
  [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
@@ -548,7 +548,7 @@ var X;
548
548
  // Quartile
549
549
  [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
550
550
  // High
551
- ], s.NUM_ERROR_CORRECTION_BLOCKS = [
551
+ ], r.NUM_ERROR_CORRECTION_BLOCKS = [
552
552
  // Version: (note that index 0 is for padding, and is set to an illegal value)
553
553
  //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
554
554
  [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
@@ -559,27 +559,27 @@ var X;
559
559
  // Quartile
560
560
  [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
561
561
  // High
562
- ], o.QrCode = s;
563
- function r(p, e, n) {
564
- if (e < 0 || e > 31 || p >>> e)
562
+ ], n.QrCode = r;
563
+ function s(f, e, o) {
564
+ if (e < 0 || e > 31 || f >>> e)
565
565
  throw new RangeError("Value out of range");
566
566
  for (let t = e - 1; t >= 0; t--)
567
- n.push(p >>> t & 1);
567
+ o.push(f >>> t & 1);
568
568
  }
569
- function l(p, e) {
570
- return (p >>> e & 1) != 0;
569
+ function a(f, e) {
570
+ return (f >>> e & 1) != 0;
571
571
  }
572
- function c(p) {
573
- if (!p)
572
+ function d(f) {
573
+ if (!f)
574
574
  throw new Error("Assertion error");
575
575
  }
576
- const d = class I {
576
+ const c = class I {
577
577
  /*-- Constructor (low level) and fields --*/
578
578
  // Creates a new QR Code segment with the given attributes and data.
579
579
  // The character count (numChars) must agree with the mode and the bit buffer length,
580
580
  // but the constraint isn't checked. The given bit buffer is cloned and stored.
581
- constructor(e, n, t) {
582
- if (this.mode = e, this.numChars = n, this.bitData = t, n < 0)
581
+ constructor(e, o, t) {
582
+ if (this.mode = e, this.numChars = o, this.bitData = t, o < 0)
583
583
  throw new RangeError("Invalid argument");
584
584
  this.bitData = t.slice();
585
585
  }
@@ -588,21 +588,21 @@ var X;
588
588
  // byte mode. All input byte arrays are acceptable. Any text string
589
589
  // can be converted to UTF-8 bytes and encoded as a byte mode segment.
590
590
  static makeBytes(e) {
591
- let n = [];
591
+ let o = [];
592
592
  for (const t of e)
593
- r(t, 8, n);
594
- return new I(I.Mode.BYTE, e.length, n);
593
+ s(t, 8, o);
594
+ return new I(I.Mode.BYTE, e.length, o);
595
595
  }
596
596
  // Returns a segment representing the given string of decimal digits encoded in numeric mode.
597
597
  static makeNumeric(e) {
598
598
  if (!I.isNumeric(e))
599
599
  throw new RangeError("String contains non-numeric characters");
600
- let n = [];
600
+ let o = [];
601
601
  for (let t = 0; t < e.length; ) {
602
602
  const i = Math.min(e.length - t, 3);
603
- r(parseInt(e.substring(t, t + i), 10), i * 3 + 1, n), t += i;
603
+ s(parseInt(e.substring(t, t + i), 10), i * 3 + 1, o), t += i;
604
604
  }
605
- return new I(I.Mode.NUMERIC, e.length, n);
605
+ return new I(I.Mode.NUMERIC, e.length, o);
606
606
  }
607
607
  // Returns a segment representing the given text string encoded in alphanumeric mode.
608
608
  // The characters allowed are: 0 to 9, A to Z (uppercase only), space,
@@ -610,12 +610,12 @@ var X;
610
610
  static makeAlphanumeric(e) {
611
611
  if (!I.isAlphanumeric(e))
612
612
  throw new RangeError("String contains unencodable characters in alphanumeric mode");
613
- let n = [], t;
613
+ let o = [], t;
614
614
  for (t = 0; t + 2 <= e.length; t += 2) {
615
615
  let i = I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)) * 45;
616
- i += I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t + 1)), r(i, 11, n);
616
+ i += I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t + 1)), s(i, 11, o);
617
617
  }
618
- return t < e.length && r(I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)), 6, n), new I(I.Mode.ALPHANUMERIC, e.length, n);
618
+ return t < e.length && s(I.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)), 6, o), new I(I.Mode.ALPHANUMERIC, e.length, o);
619
619
  }
620
620
  // Returns a new mutable list of zero or more segments to represent the given Unicode text string.
621
621
  // The result may use various segment modes and switch modes to optimize the length of the bit stream.
@@ -625,18 +625,18 @@ var X;
625
625
  // Returns a segment representing an Extended Channel Interpretation
626
626
  // (ECI) designator with the given assignment value.
627
627
  static makeEci(e) {
628
- let n = [];
628
+ let o = [];
629
629
  if (e < 0)
630
630
  throw new RangeError("ECI assignment value out of range");
631
631
  if (e < 128)
632
- r(e, 8, n);
632
+ s(e, 8, o);
633
633
  else if (e < 16384)
634
- r(2, 2, n), r(e, 14, n);
634
+ s(2, 2, o), s(e, 14, o);
635
635
  else if (e < 1e6)
636
- r(6, 3, n), r(e, 21, n);
636
+ s(6, 3, o), s(e, 21, o);
637
637
  else
638
638
  throw new RangeError("ECI assignment value out of range");
639
- return new I(I.Mode.ECI, 0, n);
639
+ return new I(I.Mode.ECI, 0, o);
640
640
  }
641
641
  // Tests whether the given string can be encoded as a segment in numeric mode.
642
642
  // A string is encodable iff each character is in the range 0 to 9.
@@ -656,57 +656,57 @@ var X;
656
656
  }
657
657
  // (Package-private) Calculates and returns the number of bits needed to encode the given segments at
658
658
  // the given version. The result is infinity if a segment has too many characters to fit its length field.
659
- static getTotalBits(e, n) {
659
+ static getTotalBits(e, o) {
660
660
  let t = 0;
661
661
  for (const i of e) {
662
- const a = i.mode.numCharCountBits(n);
663
- if (i.numChars >= 1 << a)
662
+ const l = i.mode.numCharCountBits(o);
663
+ if (i.numChars >= 1 << l)
664
664
  return 1 / 0;
665
- t += 4 + a + i.bitData.length;
665
+ t += 4 + l + i.bitData.length;
666
666
  }
667
667
  return t;
668
668
  }
669
669
  // Returns a new array of bytes representing the given string encoded in UTF-8.
670
670
  static toUtf8ByteArray(e) {
671
671
  e = encodeURI(e);
672
- let n = [];
672
+ let o = [];
673
673
  for (let t = 0; t < e.length; t++)
674
- e.charAt(t) != "%" ? n.push(e.charCodeAt(t)) : (n.push(parseInt(e.substring(t + 1, t + 3), 16)), t += 2);
675
- return n;
674
+ e.charAt(t) != "%" ? o.push(e.charCodeAt(t)) : (o.push(parseInt(e.substring(t + 1, t + 3), 16)), t += 2);
675
+ return o;
676
676
  }
677
677
  };
678
- d.NUMERIC_REGEX = /^[0-9]*$/, d.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, d.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
679
- let f = d;
680
- o.QrSegment = d;
678
+ c.NUMERIC_REGEX = /^[0-9]*$/, c.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, c.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
679
+ let m = c;
680
+ n.QrSegment = c;
681
681
  })(X || (X = {}));
682
- ((o) => {
683
- ((s) => {
684
- const r = class {
682
+ ((n) => {
683
+ ((r) => {
684
+ const s = class {
685
685
  // The QR Code can tolerate about 30% erroneous codewords
686
686
  /*-- Constructor and fields --*/
687
- constructor(c, d) {
688
- this.ordinal = c, this.formatBits = d;
687
+ constructor(d, c) {
688
+ this.ordinal = d, this.formatBits = c;
689
689
  }
690
690
  };
691
- 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;
692
- })(o.QrCode || (o.QrCode = {}));
691
+ s.LOW = new s(0, 1), s.MEDIUM = new s(1, 0), s.QUARTILE = new s(2, 3), s.HIGH = new s(3, 2), r.Ecc = s;
692
+ })(n.QrCode || (n.QrCode = {}));
693
693
  })(X || (X = {}));
694
- ((o) => {
695
- ((s) => {
696
- const r = class {
694
+ ((n) => {
695
+ ((r) => {
696
+ const s = class {
697
697
  /*-- Constructor and fields --*/
698
- constructor(c, d) {
699
- this.modeBits = c, this.numBitsCharCount = d;
698
+ constructor(d, c) {
699
+ this.modeBits = d, this.numBitsCharCount = c;
700
700
  }
701
701
  /*-- Method --*/
702
702
  // (Package-private) Returns the bit width of the character count field for a segment in
703
703
  // this mode in a QR Code at the given version number. The result is in the range [0, 16].
704
- numCharCountBits(c) {
705
- return this.numBitsCharCount[Math.floor((c + 7) / 17)];
704
+ numCharCountBits(d) {
705
+ return this.numBitsCharCount[Math.floor((d + 7) / 17)];
706
706
  }
707
707
  };
708
- 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;
709
- })(o.QrSegment || (o.QrSegment = {}));
708
+ s.NUMERIC = new s(1, [10, 12, 14]), s.ALPHANUMERIC = new s(2, [9, 11, 13]), s.BYTE = new s(4, [8, 16, 16]), s.KANJI = new s(8, [8, 10, 12]), s.ECI = new s(7, [0, 0, 0]), r.Mode = s;
709
+ })(n.QrSegment || (n.QrSegment = {}));
710
710
  })(X || (X = {}));
711
711
  var Z = X;
712
712
  var wt = {
@@ -714,93 +714,93 @@ var wt = {
714
714
  M: Z.QrCode.Ecc.MEDIUM,
715
715
  Q: Z.QrCode.Ecc.QUARTILE,
716
716
  H: Z.QrCode.Ecc.HIGH
717
- }, be = 128, Se = "L", xe = "#FFFFFF", Pe = "#000000", De = !1, Oe = 1, Nt = 4, Rt = 0, vt = 0.1;
718
- function Te(o, s = 0) {
719
- const r = [];
720
- return o.forEach(function(l, c) {
721
- let d = null;
722
- l.forEach(function(f, p) {
723
- if (!f && d !== null) {
724
- r.push(
725
- `M${d + s} ${c + s}h${p - d}v1H${d + s}z`
726
- ), d = null;
717
+ }, Ae = 128, Se = "L", xe = "#FFFFFF", Pe = "#000000", De = !1, Te = 1, Nt = 4, Rt = 0, vt = 0.1;
718
+ function Oe(n, r = 0) {
719
+ const s = [];
720
+ return n.forEach(function(a, d) {
721
+ let c = null;
722
+ a.forEach(function(m, f) {
723
+ if (!m && c !== null) {
724
+ s.push(
725
+ `M${c + r} ${d + r}h${f - c}v1H${c + r}z`
726
+ ), c = null;
727
727
  return;
728
728
  }
729
- if (p === l.length - 1) {
730
- if (!f)
729
+ if (f === a.length - 1) {
730
+ if (!m)
731
731
  return;
732
- d === null ? r.push(`M${p + s},${c + s} h1v1H${p + s}z`) : r.push(
733
- `M${d + s},${c + s} h${p + 1 - d}v1H${d + s}z`
732
+ c === null ? s.push(`M${f + r},${d + r} h1v1H${f + r}z`) : s.push(
733
+ `M${c + r},${d + r} h${f + 1 - c}v1H${c + r}z`
734
734
  );
735
735
  return;
736
736
  }
737
- f && d === null && (d = p);
737
+ m && c === null && (c = f);
738
738
  });
739
- }), r.join("");
739
+ }), s.join("");
740
740
  }
741
- function Le(o, s) {
742
- return o.slice().map((r, l) => l < s.y || l >= s.y + s.h ? r : r.map((c, d) => d < s.x || d >= s.x + s.w ? c : !1));
741
+ function Le(n, r) {
742
+ return n.slice().map((s, a) => a < r.y || a >= r.y + r.h ? s : s.map((d, c) => c < r.x || c >= r.x + r.w ? d : !1));
743
743
  }
744
- function Mt(o, s, r, l) {
745
- if (l == null)
744
+ function Mt(n, r, s, a) {
745
+ if (a == null)
746
746
  return null;
747
- const c = o.length + r * 2, d = Math.floor(s * vt), f = c / s, p = (l.width || d) * f, e = (l.height || d) * f, n = l.x == null ? o.length / 2 - p / 2 : l.x * f, t = l.y == null ? o.length / 2 - e / 2 : l.y * f, i = l.opacity == null ? 1 : l.opacity;
748
- let a = null;
749
- if (l.excavate) {
750
- let u = Math.floor(n), E = Math.floor(t), g = Math.ceil(p + n - u), v = Math.ceil(e + t - E);
751
- a = { x: u, y: E, w: g, h: v };
747
+ const d = n.length + s * 2, c = Math.floor(r * vt), m = d / r, f = (a.width || c) * m, e = (a.height || c) * m, o = a.x == null ? n.length / 2 - f / 2 : a.x * m, t = a.y == null ? n.length / 2 - e / 2 : a.y * m, i = a.opacity == null ? 1 : a.opacity;
748
+ let l = null;
749
+ if (a.excavate) {
750
+ let u = Math.floor(o), E = Math.floor(t), g = Math.ceil(f + o - u), v = Math.ceil(e + t - E);
751
+ l = { x: u, y: E, w: g, h: v };
752
752
  }
753
- const h = l.crossOrigin;
754
- return { x: n, y: t, h: e, w: p, excavation: a, opacity: i, crossOrigin: h };
753
+ const p = a.crossOrigin;
754
+ return { x: o, y: t, h: e, w: f, excavation: l, opacity: i, crossOrigin: p };
755
755
  }
756
- function yt(o, s) {
757
- return s != null ? Math.max(Math.floor(s), 0) : o ? Nt : Rt;
756
+ function yt(n, r) {
757
+ return r != null ? Math.max(Math.floor(r), 0) : n ? Nt : Rt;
758
758
  }
759
- function Be({
760
- value: o,
761
- level: s,
762
- minVersion: r,
763
- includeMargin: l,
764
- marginSize: c,
765
- imageSettings: d,
766
- size: f,
767
- boostLevel: p
759
+ function ke({
760
+ value: n,
761
+ level: r,
762
+ minVersion: s,
763
+ includeMargin: a,
764
+ marginSize: d,
765
+ imageSettings: c,
766
+ size: m,
767
+ boostLevel: f
768
768
  }) {
769
769
  let e = x.useMemo(() => {
770
- const u = (Array.isArray(o) ? o : [o]).reduce((E, g) => (E.push(...Z.QrSegment.makeSegments(g)), E), []);
770
+ const u = (Array.isArray(n) ? n : [n]).reduce((E, g) => (E.push(...Z.QrSegment.makeSegments(g)), E), []);
771
771
  return Z.QrCode.encodeSegments(
772
772
  u,
773
- wt[s],
774
- r,
773
+ wt[r],
774
+ s,
775
775
  void 0,
776
776
  void 0,
777
- p
777
+ f
778
778
  );
779
- }, [o, s, r, p]);
780
- const { cells: n, margin: t, numCells: i, calculatedImageSettings: a } = x.useMemo(() => {
781
- let h = e.getModules();
782
- const u = yt(l, c), E = h.length + u * 2, g = Mt(
783
- h,
784
- f,
779
+ }, [n, r, s, f]);
780
+ const { cells: o, margin: t, numCells: i, calculatedImageSettings: l } = x.useMemo(() => {
781
+ let p = e.getModules();
782
+ const u = yt(a, d), E = p.length + u * 2, g = Mt(
783
+ p,
784
+ m,
785
785
  u,
786
- d
786
+ c
787
787
  );
788
788
  return {
789
- cells: h,
789
+ cells: p,
790
790
  margin: u,
791
791
  numCells: E,
792
792
  calculatedImageSettings: g
793
793
  };
794
- }, [e, f, d, l, c]);
794
+ }, [e, m, c, a, d]);
795
795
  return {
796
796
  qrcode: e,
797
797
  margin: t,
798
- cells: n,
798
+ cells: o,
799
799
  numCells: i,
800
- calculatedImageSettings: a
800
+ calculatedImageSettings: l
801
801
  };
802
802
  }
803
- var At = (function() {
803
+ var bt = (function() {
804
804
  try {
805
805
  new Path2D().addPath(new Path2D());
806
806
  } catch {
@@ -808,19 +808,19 @@ var At = (function() {
808
808
  }
809
809
  return !0;
810
810
  })(), It = x.forwardRef(
811
- function(s, r) {
812
- const l = s, {
813
- value: c,
814
- size: d = be,
815
- level: f = Se,
816
- bgColor: p = xe,
811
+ function(r, s) {
812
+ const a = r, {
813
+ value: d,
814
+ size: c = Ae,
815
+ level: m = Se,
816
+ bgColor: f = xe,
817
817
  fgColor: e = Pe,
818
- includeMargin: n = De,
819
- minVersion: t = Oe,
818
+ includeMargin: o = De,
819
+ minVersion: t = Te,
820
820
  boostLevel: i,
821
- marginSize: a,
822
- imageSettings: h
823
- } = l, E = me(l, [
821
+ marginSize: l,
822
+ imageSettings: p
823
+ } = a, E = pe(a, [
824
824
  "value",
825
825
  "size",
826
826
  "level",
@@ -831,51 +831,51 @@ var At = (function() {
831
831
  "boostLevel",
832
832
  "marginSize",
833
833
  "imageSettings"
834
- ]), { style: g } = E, v = me(E, ["style"]), N = h?.src, C = x.useRef(null), R = x.useRef(null), S = x.useCallback(
835
- ($) => {
836
- C.current = $, typeof r == "function" ? r($) : r && (r.current = $);
834
+ ]), { style: g } = E, v = pe(E, ["style"]), N = p?.src, C = x.useRef(null), R = x.useRef(null), S = x.useCallback(
835
+ (_) => {
836
+ C.current = _, typeof s == "function" ? s(_) : s && (s.current = _);
837
837
  },
838
- [r]
839
- ), [D, A] = x.useState(!1), { margin: O, cells: _, numCells: H, calculatedImageSettings: P } = Be({
840
- value: c,
841
- level: f,
838
+ [s]
839
+ ), [D, b] = x.useState(!1), { margin: T, cells: $, numCells: H, calculatedImageSettings: P } = ke({
840
+ value: d,
841
+ level: m,
842
842
  minVersion: t,
843
843
  boostLevel: i,
844
- includeMargin: n,
845
- marginSize: a,
846
- imageSettings: h,
847
- size: d
844
+ includeMargin: o,
845
+ marginSize: l,
846
+ imageSettings: p,
847
+ size: c
848
848
  });
849
849
  x.useEffect(() => {
850
850
  if (C.current != null) {
851
- const $ = C.current, M = $.getContext("2d");
851
+ const _ = C.current, M = _.getContext("2d");
852
852
  if (!M)
853
853
  return;
854
- let b = _;
855
- const L = R.current, W = P != null && L !== null && L.complete && L.naturalHeight !== 0 && L.naturalWidth !== 0;
856
- W && P.excavation != null && (b = Le(
857
- _,
854
+ let A = $;
855
+ const k = R.current, W = P != null && k !== null && k.complete && k.naturalHeight !== 0 && k.naturalWidth !== 0;
856
+ W && P.excavation != null && (A = Le(
857
+ $,
858
858
  P.excavation
859
859
  ));
860
860
  const ne = window.devicePixelRatio || 1;
861
- $.height = $.width = d * ne;
862
- const oe = d / H * ne;
863
- M.scale(oe, oe), M.fillStyle = p, M.fillRect(0, 0, H, H), M.fillStyle = e, At ? M.fill(new Path2D(Te(b, O))) : _.forEach(function(V, G) {
861
+ _.height = _.width = c * ne;
862
+ const oe = c / H * ne;
863
+ M.scale(oe, oe), M.fillStyle = f, M.fillRect(0, 0, H, H), M.fillStyle = e, bt ? M.fill(new Path2D(Oe(A, T))) : $.forEach(function(V, G) {
864
864
  V.forEach(function(ce, de) {
865
- ce && M.fillRect(de + O, G + O, 1, 1);
865
+ ce && M.fillRect(de + T, G + T, 1, 1);
866
866
  });
867
867
  }), P && (M.globalAlpha = P.opacity), W && M.drawImage(
868
- L,
869
- P.x + O,
870
- P.y + O,
868
+ k,
869
+ P.x + T,
870
+ P.y + T,
871
871
  P.w,
872
872
  P.h
873
873
  );
874
874
  }
875
875
  }), x.useEffect(() => {
876
- A(!1);
876
+ b(!1);
877
877
  }, [N]);
878
- const Y = he({ height: d, width: d }, g);
878
+ const Y = he({ height: c, width: c }, g);
879
879
  let j = null;
880
880
  return N != null && (j = /* @__PURE__ */ x.createElement(
881
881
  "img",
@@ -884,7 +884,7 @@ var At = (function() {
884
884
  key: N,
885
885
  style: { display: "none" },
886
886
  onLoad: () => {
887
- A(!0);
887
+ b(!0);
888
888
  },
889
889
  ref: R,
890
890
  crossOrigin: P?.crossOrigin
@@ -893,8 +893,8 @@ var At = (function() {
893
893
  "canvas",
894
894
  he({
895
895
  style: Y,
896
- height: d,
897
- width: d,
896
+ height: c,
897
+ width: c,
898
898
  ref: S,
899
899
  role: "img"
900
900
  }, v)
@@ -902,21 +902,21 @@ var At = (function() {
902
902
  }
903
903
  );
904
904
  It.displayName = "QRCodeCanvas";
905
- var ke = x.forwardRef(
906
- function(s, r) {
907
- const l = s, {
908
- value: c,
909
- size: d = be,
910
- level: f = Se,
911
- bgColor: p = xe,
905
+ var Be = x.forwardRef(
906
+ function(r, s) {
907
+ const a = r, {
908
+ value: d,
909
+ size: c = Ae,
910
+ level: m = Se,
911
+ bgColor: f = xe,
912
912
  fgColor: e = Pe,
913
- includeMargin: n = De,
914
- minVersion: t = Oe,
913
+ includeMargin: o = De,
914
+ minVersion: t = Te,
915
915
  boostLevel: i,
916
- title: a,
917
- marginSize: h,
916
+ title: l,
917
+ marginSize: p,
918
918
  imageSettings: u
919
- } = l, E = me(l, [
919
+ } = a, E = pe(a, [
920
920
  "value",
921
921
  "size",
922
922
  "level",
@@ -928,15 +928,15 @@ var ke = x.forwardRef(
928
928
  "title",
929
929
  "marginSize",
930
930
  "imageSettings"
931
- ]), { margin: g, cells: v, numCells: N, calculatedImageSettings: C } = Be({
932
- value: c,
933
- level: f,
931
+ ]), { margin: g, cells: v, numCells: N, calculatedImageSettings: C } = ke({
932
+ value: d,
933
+ level: m,
934
934
  minVersion: t,
935
935
  boostLevel: i,
936
- includeMargin: n,
937
- marginSize: h,
936
+ includeMargin: o,
937
+ marginSize: p,
938
938
  imageSettings: u,
939
- size: d
939
+ size: c
940
940
  });
941
941
  let R = v, S = null;
942
942
  u != null && C != null && (C.excavation != null && (R = Le(
@@ -955,21 +955,21 @@ var ke = x.forwardRef(
955
955
  crossOrigin: C.crossOrigin
956
956
  }
957
957
  ));
958
- const D = Te(R, g);
958
+ const D = Oe(R, g);
959
959
  return /* @__PURE__ */ x.createElement(
960
960
  "svg",
961
961
  he({
962
- height: d,
963
- width: d,
962
+ height: c,
963
+ width: c,
964
964
  viewBox: `0 0 ${N} ${N}`,
965
- ref: r,
965
+ ref: s,
966
966
  role: "img"
967
967
  }, E),
968
- !!a && /* @__PURE__ */ x.createElement("title", null, a),
968
+ !!l && /* @__PURE__ */ x.createElement("title", null, l),
969
969
  /* @__PURE__ */ x.createElement(
970
970
  "path",
971
971
  {
972
- fill: p,
972
+ fill: f,
973
973
  d: `M0,0 h${N}v${N}H0z`,
974
974
  shapeRendering: "crispEdges"
975
975
  }
@@ -979,40 +979,40 @@ var ke = x.forwardRef(
979
979
  );
980
980
  }
981
981
  );
982
- ke.displayName = "QRCodeSVG";
983
- const bt = (o, s) => ({
982
+ Be.displayName = "QRCodeSVG";
983
+ const At = (n, r) => ({
984
984
  invitationType: tt.LINK,
985
985
  resources: [
986
986
  {
987
- url: `conversations/${encodeURI(o)}`
987
+ url: `conversations/${encodeURI(n)}`
988
988
  },
989
- ...s
989
+ ...r
990
990
  ]
991
- }), St = (o) => {
992
- const s = o?.invitationLink?.split("/").at(-1) || "";
993
- return `/${ve}/${s}`;
994
- }, xt = (o, s) => s?.find((r) => {
995
- const l = o?.id?.split("/")?.pop(), c = r?.url?.split("/")?.pop() || "";
996
- return c === l || decodeURI(c) === l;
997
- }), Pt = (o) => o?.messages?.filter(
998
- (r) => !!r?.custom_content?.attachments
999
- )?.flatMap((r) => r?.custom_content?.attachments?.map((l) => ({
1000
- url: l?.url || ""
1001
- })) || [])?.filter((r) => !!r?.url) || [], Dt = ({
1002
- conversation: o,
1003
- locale: s,
1004
- onCloseModal: r,
1005
- modalDividers: l,
1006
- getConversation: c,
1007
- generateConversationLink: d,
1008
- chatExpiration: f,
1009
- chatExpirationDays: p,
991
+ }), St = (n) => {
992
+ const r = n?.invitationLink?.split("/").at(-1) || "";
993
+ return `/${ve}/${r}`;
994
+ }, xt = (n, r) => r?.find((s) => {
995
+ const a = n?.id?.split("/")?.pop(), d = s?.url?.split("/")?.pop() || "";
996
+ return d === a || decodeURI(d) === a;
997
+ }), Pt = (n) => n?.messages?.filter(
998
+ (s) => !!s?.custom_content?.attachments
999
+ )?.flatMap((s) => s?.custom_content?.attachments?.map((a) => ({
1000
+ url: a?.url || ""
1001
+ })) || [])?.filter((s) => !!s?.url) || [], Dt = ({
1002
+ conversation: n,
1003
+ locale: r,
1004
+ onCloseModal: s,
1005
+ modalDividers: a,
1006
+ getConversation: d,
1007
+ generateConversationLink: c,
1008
+ chatExpiration: m,
1009
+ chatExpirationDays: f,
1010
1010
  close: e,
1011
- chatWarning: n,
1011
+ chatWarning: o,
1012
1012
  shareLink: t,
1013
1013
  shareCopyLink: i,
1014
- shareCopiedLink: a,
1015
- shareDescription: h,
1014
+ shareCopiedLink: l,
1015
+ shareDescription: p,
1016
1016
  shareRemoveAccessToUsers: u,
1017
1017
  chatName: E,
1018
1018
  getSharedConversations: g,
@@ -1022,26 +1022,26 @@ const bt = (o, s) => ({
1022
1022
  clientSharedPage: R,
1023
1023
  clientSharedProp: S
1024
1024
  }) => {
1025
- const [D, A] = T(null), [O, _] = T(), [H, P] = T(!1), [Y, j] = T(!1), [$, M] = T(), b = J(() => {
1025
+ const [D, b] = O(null), [T, $] = O(), [H, P] = O(!1), [Y, j] = O(!1), [_, M] = O(), A = J(() => {
1026
1026
  const V = N || window.location.origin;
1027
1027
  if (N && N !== window.location.origin && R && S) {
1028
1028
  const G = D?.split(`/${ve}/`)?.[1];
1029
1029
  return `${V}/${R}?${S}=${G}`;
1030
1030
  }
1031
- return `${V}/${s}${D}`;
1032
- }, [N, D, s, R, S]);
1031
+ return `${V}/${r}${D}`;
1032
+ }, [N, D, r, R, S]);
1033
1033
  ee(() => {
1034
1034
  (async () => {
1035
1035
  try {
1036
- const G = decodeURI(o ? o?.id : `${C?.[0]}/${s}/${C?.[1]}`), ce = `${decodeURI(G)}`, de = await c?.(ce), Ue = bt(
1036
+ const G = decodeURI(n ? n?.id : `${C?.[0]}/${r}/${C?.[1]}`), ce = `${decodeURI(G)}`, de = await d?.(ce), Ue = At(
1037
1037
  G,
1038
1038
  Pt(de)
1039
- ), pe = await d?.(Ue), ge = await g?.(
1039
+ ), fe = await c?.(Ue), ge = await g?.(
1040
1040
  re(se.OTHERS)
1041
1041
  );
1042
- pe && ge && (P(!0), A(St(pe)), _(
1042
+ fe && ge && (P(!0), b(St(fe)), $(
1043
1043
  xt(
1044
- o,
1044
+ n,
1045
1045
  ge?.resources
1046
1046
  )
1047
1047
  ));
@@ -1050,154 +1050,154 @@ const bt = (o, s) => ({
1050
1050
  }
1051
1051
  })();
1052
1052
  }, [
1053
- o,
1054
- d,
1053
+ n,
1055
1054
  c,
1055
+ d,
1056
1056
  g,
1057
1057
  C,
1058
- s
1058
+ r
1059
1059
  ]);
1060
- const L = B(() => {
1061
- r(), A(null), P(!1), j(!1);
1062
- }, [r]), W = B(() => {
1063
- j(!0), navigator.clipboard.writeText(b || "");
1064
- }, [b]), ne = async () => {
1060
+ const k = L(() => {
1061
+ s(), b(null), P(!1), j(!1);
1062
+ }, [s]), W = L(() => {
1063
+ j(!0), navigator.clipboard.writeText(A || "");
1064
+ }, [A]), ne = async () => {
1065
1065
  try {
1066
- M(!0), O && await v?.({ resources: [O] });
1066
+ M(!0), T && await v?.({ resources: [T] });
1067
1067
  } catch (V) {
1068
1068
  M(!1), console.error("Error revoking shared conversation", V);
1069
1069
  }
1070
- }, oe = B(() => /* @__PURE__ */ m(
1070
+ }, oe = L(() => /* @__PURE__ */ h(
1071
1071
  Q,
1072
1072
  {
1073
1073
  buttonClassName: Y ? "text-button-secondary" : "text-button-primary",
1074
- iconBefore: Y ? /* @__PURE__ */ m(je, { width: 20, height: 20 }) : /* @__PURE__ */ m(We, { width: 20, height: 20 }),
1075
- title: Y ? a ?? "Copied" : i ?? "Copy link",
1074
+ iconBefore: Y ? /* @__PURE__ */ h(je, { width: 20, height: 20 }) : /* @__PURE__ */ h(We, { width: 20, height: 20 }),
1075
+ title: Y ? l ?? "Copied" : i ?? "Copy link",
1076
1076
  disabled: Y,
1077
1077
  onClick: W
1078
1078
  }
1079
- ), [Y, W, a, i]);
1079
+ ), [Y, W, l, i]);
1080
1080
  return /* @__PURE__ */ y(
1081
1081
  ae,
1082
1082
  {
1083
1083
  heading: t ?? "Share link",
1084
1084
  portalId: "share",
1085
1085
  size: le.SM,
1086
- dividers: l,
1087
- onClose: L,
1086
+ dividers: a,
1087
+ onClose: k,
1088
1088
  closeButtonTitle: e ?? "Close",
1089
1089
  children: [
1090
1090
  H ? /* @__PURE__ */ y("div", { className: "share flex flex-col gap-y-4 px-6 pb-6 overflow-auto sm:p-0", children: [
1091
- o?.name ? /* @__PURE__ */ y("div", { className: "flex share-info w-full", children: [
1092
- /* @__PURE__ */ m("p", { className: "share-info-title text-neutrals-800 mr-1 body-1", children: E ?? "Chat name:" }),
1093
- /* @__PURE__ */ m(
1091
+ n?.name ? /* @__PURE__ */ y("div", { className: "flex share-info w-full", children: [
1092
+ /* @__PURE__ */ h("p", { className: "share-info-title text-neutrals-800 mr-1 body-1", children: E ?? "Chat name:" }),
1093
+ /* @__PURE__ */ h(
1094
1094
  "h3",
1095
1095
  {
1096
1096
  className: "flex-1 min-w-0 truncate",
1097
- title: o?.name,
1098
- children: o?.name
1097
+ title: n?.name,
1098
+ children: n?.name
1099
1099
  }
1100
1100
  )
1101
1101
  ] }) : null,
1102
1102
  /* @__PURE__ */ y("div", { className: "flex share-info", children: [
1103
- /* @__PURE__ */ m("p", { className: "share-info-title text-neutrals-800 mr-1 body-1", children: f ?? "Link expiration date:" }),
1103
+ /* @__PURE__ */ h("p", { className: "share-info-title text-neutrals-800 mr-1 body-1", children: m ?? "Link expiration date:" }),
1104
1104
  /* @__PURE__ */ y("h3", { children: [
1105
1105
  "3 ",
1106
- p ?? "days"
1106
+ f ?? "days"
1107
1107
  ] })
1108
1108
  ] }),
1109
- /* @__PURE__ */ m(
1110
- ke,
1109
+ /* @__PURE__ */ h(
1110
+ Be,
1111
1111
  {
1112
1112
  className: "self-center border border-neutrals-600 p-2 rounded min-h-[200px]",
1113
- value: b,
1113
+ value: A,
1114
1114
  size: 200
1115
1115
  }
1116
1116
  ),
1117
- /* @__PURE__ */ m("p", { className: "body-2 text-neutrals-1000", children: h ?? "Your name, special instructions, and any messages you add after sharing remain confidential." }),
1118
- /* @__PURE__ */ m(
1117
+ /* @__PURE__ */ h("p", { className: "body-2 text-neutrals-1000", children: p ?? "Your name, special instructions, and any messages you add after sharing remain confidential." }),
1118
+ /* @__PURE__ */ h(
1119
1119
  Ne,
1120
1120
  {
1121
1121
  containerClasses: "share-input-container",
1122
1122
  cssClass: "share-input",
1123
1123
  readonly: !0,
1124
- placeholder: b,
1125
- value: b,
1124
+ placeholder: A,
1125
+ value: A,
1126
1126
  inputId: "conversationLink",
1127
1127
  iconAfterInput: oe()
1128
1128
  }
1129
1129
  )
1130
- ] }) : /* @__PURE__ */ m("div", { className: "flex justify-center items-center py-6 px-6", children: /* @__PURE__ */ m(we, {}) }),
1131
- H ? o && O ? /* @__PURE__ */ m("div", { className: "remove-access", children: /* @__PURE__ */ m(
1130
+ ] }) : /* @__PURE__ */ h("div", { className: "flex justify-center items-center py-6 px-6", children: /* @__PURE__ */ h(we, {}) }),
1131
+ H ? n && T ? /* @__PURE__ */ h("div", { className: "remove-access", children: /* @__PURE__ */ h(
1132
1132
  Q,
1133
1133
  {
1134
1134
  title: u ?? "Remove access to all users",
1135
1135
  buttonClassName: "remove-access-button py-3 px-4",
1136
1136
  isSmallButton: !0,
1137
- disabled: $,
1137
+ disabled: _,
1138
1138
  onClick: ne
1139
1139
  }
1140
- ) }) : /* @__PURE__ */ m("p", { className: "body-2 text-neutrals-800 share-footer", children: n ?? "This chat has not been shared with anyone yet." }) : /* @__PURE__ */ m("div", {})
1140
+ ) }) : /* @__PURE__ */ h("p", { className: "body-2 text-neutrals-800 share-footer", children: o ?? "This chat has not been shared with anyone yet." }) : /* @__PURE__ */ h("div", {})
1141
1141
  ]
1142
1142
  }
1143
1143
  );
1144
- }, Ot = ({
1145
- conversation: o,
1146
- onCloseModal: s,
1147
- renameConversation: r,
1148
- locale: l,
1149
- disableModalDividers: c,
1150
- titles: d,
1151
- isSmallButton: f
1144
+ }, Tt = ({
1145
+ conversation: n,
1146
+ onCloseModal: r,
1147
+ renameConversation: s,
1148
+ locale: a,
1149
+ disableModalDividers: d,
1150
+ titles: c,
1151
+ isSmallButton: m
1152
1152
  }) => {
1153
- const [p, e] = T(o?.name || ""), n = (i) => {
1153
+ const [f, e] = O(n?.name || ""), o = (i) => {
1154
1154
  e(i);
1155
1155
  }, t = () => {
1156
- const i = `${o?.folderId}/${encodeURIComponent(fe(p))}-${(/* @__PURE__ */ new Date()).getTime()}`;
1157
- r(
1158
- `conversations/${o.id}`,
1156
+ const i = `${n?.folderId}/${encodeURIComponent(me(f))}-${(/* @__PURE__ */ new Date()).getTime()}`;
1157
+ s(
1158
+ `conversations/${n.id}`,
1159
1159
  `conversations/${i}`
1160
1160
  );
1161
1161
  };
1162
1162
  return /* @__PURE__ */ y(
1163
1163
  ae,
1164
1164
  {
1165
- heading: d?.renameTitle ?? "Rename conversation",
1165
+ heading: c?.renameTitle ?? "Rename conversation",
1166
1166
  portalId: "rename-conversation",
1167
1167
  containerClassName: "rename-conversation-popup",
1168
1168
  size: le.SM,
1169
- dividers: !c,
1170
- onClose: s,
1171
- closeButtonTitle: d?.close ?? "Cancel",
1169
+ dividers: !d,
1170
+ onClose: r,
1171
+ closeButtonTitle: c?.close ?? "Cancel",
1172
1172
  children: [
1173
- /* @__PURE__ */ m("div", { className: "py-4 px-6 sm:px-0", lang: l, children: /* @__PURE__ */ m(
1173
+ /* @__PURE__ */ h("div", { className: "py-4 px-6 sm:px-0", lang: a, children: /* @__PURE__ */ h(
1174
1174
  Ye,
1175
1175
  {
1176
1176
  inputId: "rename",
1177
- value: p,
1178
- onChange: n,
1177
+ value: f,
1178
+ onChange: o,
1179
1179
  cssClass: "w-full"
1180
1180
  }
1181
1181
  ) }),
1182
1182
  /* @__PURE__ */ y("div", { className: "flex justify-end gap-x-2 py-3 px-6 delete-conversation-popup-footer", children: [
1183
- /* @__PURE__ */ m(
1183
+ /* @__PURE__ */ h(
1184
1184
  Q,
1185
1185
  {
1186
1186
  buttonClassName: "cancel-button",
1187
- title: d?.cancel ?? "Cancel",
1188
- isSmallButton: f,
1187
+ title: c?.cancel ?? "Cancel",
1188
+ isSmallButton: m,
1189
1189
  onClick: (i) => {
1190
- i.stopPropagation(), s();
1190
+ i.stopPropagation(), r();
1191
1191
  }
1192
1192
  }
1193
1193
  ),
1194
- /* @__PURE__ */ m(
1194
+ /* @__PURE__ */ h(
1195
1195
  Q,
1196
1196
  {
1197
1197
  buttonClassName: "text-button-primary text-button-primary",
1198
- title: d?.save ?? "Rename",
1199
- isSmallButton: f,
1200
- disabled: !p,
1198
+ title: c?.save ?? "Rename",
1199
+ isSmallButton: m,
1200
+ disabled: !f,
1201
1201
  onClick: (i) => {
1202
1202
  i.stopPropagation(), t();
1203
1203
  }
@@ -1207,127 +1207,127 @@ const bt = (o, s) => ({
1207
1207
  ]
1208
1208
  }
1209
1209
  );
1210
- }, Tt = ({
1211
- conversation: o,
1212
- conversationStyles: s,
1213
- shareConversationProps: r,
1214
- onConversationDelete: l,
1215
- getConversation: c,
1216
- getFileBlob: d,
1217
- renameConversation: f,
1218
- triggerButton: p,
1210
+ }, Ot = ({
1211
+ conversation: n,
1212
+ conversationStyles: r,
1213
+ shareConversationProps: s,
1214
+ onConversationDelete: a,
1215
+ getConversation: d,
1216
+ getFileBlob: c,
1217
+ renameConversation: m,
1218
+ triggerButton: f,
1219
1219
  locale: e,
1220
- isDisabled: n
1220
+ isDisabled: o
1221
1221
  }) => {
1222
1222
  const t = J(() => {
1223
- const A = [
1223
+ const b = [
1224
1224
  {
1225
1225
  key: U.DELETE,
1226
- title: s?.titles?.delete ?? "Delete",
1227
- icon: s.actionsIcons?.[U.DELETE]
1226
+ title: r?.titles?.delete ?? "Delete",
1227
+ icon: r.actionsIcons?.[U.DELETE]
1228
1228
  }
1229
1229
  ];
1230
- return o?.model?.id?.endsWith(et) ? A : [
1231
- ...o.isShared ? [] : [
1230
+ return n?.model?.id?.endsWith(et) ? b : [
1231
+ ...n.isShared ? [] : [
1232
1232
  {
1233
1233
  key: U.SHARE,
1234
- title: s?.titles?.share ?? "Share",
1235
- icon: s.actionsIcons?.[U.SHARE]
1234
+ title: r?.titles?.share ?? "Share",
1235
+ icon: r.actionsIcons?.[U.SHARE]
1236
1236
  },
1237
1237
  {
1238
1238
  key: U.RENAME,
1239
- title: s?.titles?.rename ?? "Rename",
1240
- icon: s.actionsIcons?.[U.RENAME]
1239
+ title: r?.titles?.rename ?? "Rename",
1240
+ icon: r.actionsIcons?.[U.RENAME]
1241
1241
  }
1242
1242
  ],
1243
1243
  {
1244
1244
  key: U.EXPORT,
1245
- title: s?.titles?.export ?? "Export",
1246
- icon: s.actionsIcons?.[U.EXPORT]
1245
+ title: r?.titles?.export ?? "Export",
1246
+ icon: r.actionsIcons?.[U.EXPORT]
1247
1247
  },
1248
- ...A
1248
+ ...b
1249
1249
  ];
1250
1250
  }, [
1251
- o.isShared,
1252
- o?.model?.id,
1253
- s.titles,
1254
- s.actionsIcons
1255
- ]), [i, a] = T(z.Closed), [h, u] = T(z.Closed), [E, g] = T(z.Closed), v = B(() => {
1256
- a(z.Closed);
1257
- }, [a]), N = B(() => {
1251
+ n.isShared,
1252
+ n?.model?.id,
1253
+ r.titles,
1254
+ r.actionsIcons
1255
+ ]), [i, l] = O(z.Closed), [p, u] = O(z.Closed), [E, g] = O(z.Closed), v = L(() => {
1256
+ l(z.Closed);
1257
+ }, [l]), N = L(() => {
1258
1258
  u(z.Closed);
1259
- }, [u]), C = B(() => {
1259
+ }, [u]), C = L(() => {
1260
1260
  g(z.Closed);
1261
- }, [g]), R = B(() => {
1262
- l(o), v();
1263
- }, [o, l, v]), S = B(
1264
- (A, O) => {
1265
- f(A, O), C();
1261
+ }, [g]), R = L(() => {
1262
+ a(n), v();
1263
+ }, [n, a, v]), S = L(
1264
+ (b, T) => {
1265
+ m(b, T), C();
1266
1266
  },
1267
- [f, C]
1267
+ [m, C]
1268
1268
  );
1269
1269
  return /* @__PURE__ */ y(q, { children: [
1270
- /* @__PURE__ */ m(
1270
+ /* @__PURE__ */ h(
1271
1271
  Re,
1272
1272
  {
1273
1273
  containerClassName: "ml-3 group-hover:visible invisible",
1274
- triggerButton: p ?? /* @__PURE__ */ m(Lt, { disabled: n }),
1274
+ triggerButton: f ?? /* @__PURE__ */ h(Lt, { disabled: o }),
1275
1275
  options: t,
1276
1276
  openedClassName: "action-menu-opened",
1277
- onOptionSelect: (A) => {
1278
- A === U.DELETE && a(z.Opened), A === U.SHARE && u(z.Opened), A === U.RENAME && g(z.Opened), A === U.EXPORT && c(decodeURI(o.id)).then((O) => {
1279
- ft(O, d).then((_) => {
1277
+ onOptionSelect: (b) => {
1278
+ b === U.DELETE && l(z.Opened), b === U.SHARE && u(z.Opened), b === U.RENAME && g(z.Opened), b === U.EXPORT && d(decodeURI(n.id)).then((T) => {
1279
+ mt(T, c).then(($) => {
1280
1280
  Ct(
1281
- `data:application/zip;base64,${_}`,
1281
+ `data:application/zip;base64,${$}`,
1282
1282
  `chat_with_attachments_${(/* @__PURE__ */ new Date()).toLocaleDateString()}.dial`
1283
1283
  );
1284
1284
  });
1285
1285
  });
1286
1286
  },
1287
- disabled: n
1287
+ disabled: o
1288
1288
  }
1289
1289
  ),
1290
- i === z.Opened && /* @__PURE__ */ m(
1290
+ i === z.Opened && /* @__PURE__ */ h(
1291
1291
  lt,
1292
1292
  {
1293
- titles: s.titles,
1293
+ titles: r.titles,
1294
1294
  locale: e,
1295
- disableModalDividers: s.disableModalDividers,
1296
- isSmallButton: s.isSmallModalButton,
1295
+ disableModalDividers: r.disableModalDividers,
1296
+ isSmallButton: r.isSmallModalButton,
1297
1297
  deleteConversation: R,
1298
1298
  onCloseModal: v
1299
1299
  }
1300
1300
  ),
1301
- h === z.Opened && /* @__PURE__ */ m(
1301
+ p === z.Opened && /* @__PURE__ */ h(
1302
1302
  Dt,
1303
1303
  {
1304
- conversation: o,
1304
+ conversation: n,
1305
1305
  locale: e,
1306
1306
  onCloseModal: N,
1307
- ...r
1307
+ ...s
1308
1308
  }
1309
1309
  ),
1310
- E === z.Opened && /* @__PURE__ */ m(
1311
- Ot,
1310
+ E === z.Opened && /* @__PURE__ */ h(
1311
+ Tt,
1312
1312
  {
1313
- conversation: o,
1313
+ conversation: n,
1314
1314
  locale: e,
1315
- titles: s.titles,
1315
+ titles: r.titles,
1316
1316
  renameConversation: S,
1317
1317
  onCloseModal: C,
1318
- disableModalDividers: s.disableModalDividers,
1319
- isSmallButton: s.isSmallModalButton
1318
+ disableModalDividers: r.disableModalDividers,
1319
+ isSmallButton: r.isSmallModalButton
1320
1320
  }
1321
1321
  )
1322
1322
  ] });
1323
- }, Lt = ({ disabled: o }) => /* @__PURE__ */ m(
1323
+ }, Lt = ({ disabled: n }) => /* @__PURE__ */ h(
1324
1324
  "div",
1325
1325
  {
1326
- className: k(
1326
+ className: B(
1327
1327
  "flex items-center justify-center w-[24px]",
1328
- o ? "cursor-not-allowed" : "cursor-pointer"
1328
+ n ? "cursor-not-allowed" : "cursor-pointer"
1329
1329
  ),
1330
- children: /* @__PURE__ */ m(
1330
+ children: /* @__PURE__ */ h(
1331
1331
  Ve,
1332
1332
  {
1333
1333
  width: 20,
@@ -1338,92 +1338,92 @@ const bt = (o, s) => ({
1338
1338
  )
1339
1339
  }
1340
1340
  ), Fe = ({
1341
- conversation: o,
1342
- selectedConversationId: s,
1343
- searchQuery: r,
1344
- onConversationClick: l,
1345
- actions: c,
1346
- locale: d,
1347
- isDisabled: f,
1348
- conversationStyles: p,
1341
+ conversation: n,
1342
+ selectedConversationId: r,
1343
+ searchQuery: s,
1344
+ onConversationClick: a,
1345
+ actions: d,
1346
+ locale: c,
1347
+ isDisabled: m,
1348
+ conversationStyles: f,
1349
1349
  shareConversationProps: e
1350
1350
  }) => {
1351
- const n = ze(null), t = fe(o?.name);
1351
+ const o = ze(null), t = me(n?.name);
1352
1352
  return ee(() => {
1353
- if (o?.id === s && n?.current) {
1354
- const i = n.current.parentElement?.parentElement?.parentElement;
1353
+ if (n?.id === r && o?.current) {
1354
+ const i = o.current.parentElement?.parentElement?.parentElement;
1355
1355
  if (i) {
1356
- const a = n.current.getBoundingClientRect(), h = i.getBoundingClientRect(), u = a.height, E = h.height, v = a.top - h.top + i.scrollTop - (E / 2 - u / 2);
1356
+ const l = o.current.getBoundingClientRect(), p = i.getBoundingClientRect(), u = l.height, E = p.height, v = l.top - p.top + i.scrollTop - (E / 2 - u / 2);
1357
1357
  i.scrollTo({
1358
1358
  top: v,
1359
1359
  behavior: "smooth"
1360
1360
  });
1361
1361
  }
1362
1362
  }
1363
- }, [o, s]), /* @__PURE__ */ y(
1363
+ }, [n, r]), /* @__PURE__ */ y(
1364
1364
  "div",
1365
1365
  {
1366
- ref: n,
1367
- className: k(
1366
+ ref: o,
1367
+ className: B(
1368
1368
  "flex justify-between items-center py-2 px-3 border-transparent relative group border",
1369
1369
  "conversation-item",
1370
- s === o?.id && "bg-hues-100 conversation-item-active",
1371
- f ? "cursor-not-allowed" : "cursor-pointer hover:border-hues-600"
1370
+ r === n?.id && "bg-hues-100 conversation-item-active",
1371
+ m ? "cursor-not-allowed" : "cursor-pointer hover:border-hues-600"
1372
1372
  ),
1373
- onClick: () => !f && l(o.folderId, o?.id),
1374
- title: f ? p?.titles?.noActionsAllowed : t,
1373
+ onClick: () => !m && a(n.folderId, n?.id),
1374
+ title: m ? f?.titles?.noActionsAllowed : t,
1375
1375
  children: [
1376
1376
  /* @__PURE__ */ y("div", { className: "flex flex-1 min-w-0 items-center", children: [
1377
- p.conversationItemIcon ? p.conversationItemIcon : null,
1378
- /* @__PURE__ */ m(
1377
+ f.conversationItemIcon ? f.conversationItemIcon : null,
1378
+ /* @__PURE__ */ h(
1379
1379
  "h3",
1380
1380
  {
1381
- className: k(
1381
+ className: B(
1382
1382
  "truncate font-semibold text-neutrals-1000 sm:body-2",
1383
1383
  "conversation-item-text",
1384
- s === o?.id ? "conversation-item-text-active" : ""
1384
+ r === n?.id ? "conversation-item-text-active" : ""
1385
1385
  ),
1386
- title: f ? p?.titles?.noActionsAllowed : t,
1387
- children: r?.length ? /* @__PURE__ */ m(
1386
+ title: m ? f?.titles?.noActionsAllowed : t,
1387
+ children: s?.length ? /* @__PURE__ */ h(
1388
1388
  Qe,
1389
1389
  {
1390
1390
  text: t,
1391
- highlightText: r
1391
+ highlightText: s
1392
1392
  }
1393
1393
  ) : t
1394
1394
  }
1395
1395
  )
1396
1396
  ] }),
1397
- /* @__PURE__ */ m(
1398
- Tt,
1397
+ /* @__PURE__ */ h(
1398
+ Ot,
1399
1399
  {
1400
- locale: d,
1401
- conversationStyles: p,
1402
- conversation: o,
1403
- onConversationDelete: c.deleteConversation,
1404
- getConversation: c.getConversation,
1405
- getFileBlob: c.getFileBlob,
1406
- renameConversation: c.renameConversation,
1400
+ locale: c,
1401
+ conversationStyles: f,
1402
+ conversation: n,
1403
+ onConversationDelete: d.deleteConversation,
1404
+ getConversation: d.getConversation,
1405
+ getFileBlob: d.getFileBlob,
1406
+ renameConversation: d.renameConversation,
1407
1407
  shareConversationProps: e,
1408
- isDisabled: f
1408
+ isDisabled: m
1409
1409
  }
1410
1410
  )
1411
1411
  ]
1412
1412
  }
1413
1413
  );
1414
- }, Bt = ({
1415
- handleConversationClick: o,
1416
- actions: s,
1417
- selectedConversationId: r,
1418
- groupLabel: l,
1419
- conversationStyles: c,
1420
- groupedConversations: d,
1421
- shareConversationProps: f,
1422
- locale: p,
1414
+ }, kt = ({
1415
+ handleConversationClick: n,
1416
+ actions: r,
1417
+ selectedConversationId: s,
1418
+ groupLabel: a,
1419
+ conversationStyles: d,
1420
+ groupedConversations: c,
1421
+ shareConversationProps: m,
1422
+ locale: f,
1423
1423
  isDisabled: e
1424
1424
  }) => {
1425
- const [n, t] = T(!1), i = B(() => {
1426
- t((a) => !a);
1425
+ const [o, t] = O(!1), i = L(() => {
1426
+ t((l) => !l);
1427
1427
  }, [t]);
1428
1428
  return /* @__PURE__ */ y("div", { children: [
1429
1429
  /* @__PURE__ */ y(
@@ -1432,156 +1432,158 @@ const bt = (o, s) => ({
1432
1432
  className: "inline-flex gap-1 items-center text-neutrals-700 mb-3 cursor-pointer conversation-group-items-title",
1433
1433
  onClick: i,
1434
1434
  children: [
1435
- /* @__PURE__ */ m(
1435
+ /* @__PURE__ */ h(
1436
1436
  Xe,
1437
1437
  {
1438
- className: k(
1438
+ className: B(
1439
1439
  "w-3 h-3 conversation-group-items-arrow",
1440
- n ? "rotate-[90deg]" : "rotate-0"
1440
+ o ? "rotate-[90deg]" : "rotate-0"
1441
1441
  )
1442
1442
  }
1443
1443
  ),
1444
- /* @__PURE__ */ m("span", { className: "body-3 conversation-group-items-title-text", children: at(l, c?.titles) })
1444
+ /* @__PURE__ */ h("span", { className: "body-3 conversation-group-items-title-text", children: at(a, d?.titles) })
1445
1445
  ]
1446
1446
  }
1447
1447
  ),
1448
- !n && /* @__PURE__ */ m(
1448
+ !o && /* @__PURE__ */ h(
1449
1449
  "div",
1450
1450
  {
1451
- className: k(
1451
+ className: B(
1452
1452
  "flex flex-col gap-y-3",
1453
1453
  "conversation-group-items"
1454
1454
  ),
1455
- children: ye(d).map(
1456
- (a) => /* @__PURE__ */ m(
1455
+ children: ye(c).map(
1456
+ (l) => /* @__PURE__ */ h(
1457
1457
  Fe,
1458
1458
  {
1459
- locale: p,
1459
+ locale: f,
1460
1460
  isDisabled: e,
1461
- conversationStyles: c,
1462
- conversation: a,
1463
- selectedConversationId: r,
1464
- onConversationClick: o,
1465
- actions: s,
1466
- shareConversationProps: f
1461
+ conversationStyles: d,
1462
+ conversation: l,
1463
+ selectedConversationId: s,
1464
+ onConversationClick: n,
1465
+ actions: r,
1466
+ shareConversationProps: m
1467
1467
  },
1468
- a.id || a.name
1468
+ l.id || l.name
1469
1469
  )
1470
1470
  )
1471
1471
  }
1472
1472
  )
1473
- ] }, l);
1474
- }, kt = ({
1475
- searchQuery: o,
1476
- isExpandedSearch: s,
1477
- titles: r,
1478
- searchIcon: l,
1479
- onSearchConversations: c,
1480
- toggleSearchField: d
1481
- }) => /* @__PURE__ */ m(q, { children: s ? /* @__PURE__ */ m(
1473
+ ] }, a);
1474
+ }, Bt = ({
1475
+ searchQuery: n,
1476
+ isExpandedSearch: r,
1477
+ titles: s,
1478
+ searchIcon: a,
1479
+ onSearchConversations: d,
1480
+ toggleSearchField: c
1481
+ }) => /* @__PURE__ */ h(q, { children: r ? /* @__PURE__ */ h(
1482
1482
  Ne,
1483
1483
  {
1484
1484
  inputId: "conversations-search",
1485
- placeholder: r?.searchPlaceholder ?? "Search",
1485
+ placeholder: s?.searchPlaceholder ?? "Search",
1486
1486
  containerClasses: "conversation-list-search-input h-[40px] bg-transparent px-4 py-2 rounded-full border-neutrals-400 shadow-none",
1487
1487
  cssClass: "h-auto",
1488
- value: o,
1489
- iconAfterInput: /* @__PURE__ */ m(
1488
+ value: n,
1489
+ iconAfterInput: /* @__PURE__ */ h(
1490
1490
  Ge,
1491
1491
  {
1492
1492
  buttonClassName: "text-button-tertiary items-center p-0 ml-4 border-0 w-5 h-5",
1493
- onClick: d,
1494
- icon: /* @__PURE__ */ m(Ke, {})
1493
+ onClick: c,
1494
+ icon: /* @__PURE__ */ h(Ke, {})
1495
1495
  }
1496
1496
  ),
1497
- onChange: c
1497
+ onChange: d
1498
1498
  }
1499
- ) : /* @__PURE__ */ m(
1499
+ ) : /* @__PURE__ */ h(
1500
1500
  Q,
1501
1501
  {
1502
1502
  buttonClassName: "text-button-tertiary p-0 search-button",
1503
- iconBefore: l || /* @__PURE__ */ m(Ze, { className: "w-5 h-5" }),
1504
- onClick: d
1503
+ iconBefore: a || /* @__PURE__ */ h(Ze, { className: "w-5 h-5" }),
1504
+ onClick: c
1505
1505
  }
1506
1506
  ) }), Ft = ({
1507
- conversations: o,
1508
- selectedConversationId: s,
1509
- searchQuery: r,
1510
- conversationStyles: l,
1511
- handleConversationClick: c,
1512
- actions: d,
1513
- locale: f,
1514
- shareConversationProps: p
1507
+ conversations: n,
1508
+ selectedConversationId: r,
1509
+ searchQuery: s,
1510
+ conversationStyles: a,
1511
+ handleConversationClick: d,
1512
+ actions: c,
1513
+ locale: m,
1514
+ shareConversationProps: f,
1515
+ isDisabled: e
1515
1516
  }) => {
1516
- const [e, n] = T([]);
1517
+ const [o, t] = O([]);
1517
1518
  return ee(() => {
1518
- n(
1519
+ t(
1519
1520
  ye(
1520
- o?.filter(
1521
- (t) => fe(t?.name)?.includes(
1522
- r || ""
1521
+ n?.filter(
1522
+ (i) => me(i?.name)?.includes(
1523
+ s || ""
1523
1524
  )
1524
1525
  )
1525
1526
  )
1526
1527
  );
1527
- }, [o, r]), /* @__PURE__ */ m(q, { children: e?.length ? e.map((t) => /* @__PURE__ */ m(
1528
+ }, [n, s]), /* @__PURE__ */ h(q, { children: o?.length ? o.map((i) => /* @__PURE__ */ h(
1528
1529
  Fe,
1529
1530
  {
1530
- locale: f,
1531
- conversationStyles: l,
1532
- conversation: t,
1533
- searchQuery: r,
1534
- selectedConversationId: s,
1535
- onConversationClick: c,
1536
- actions: d,
1537
- shareConversationProps: p
1531
+ locale: m,
1532
+ conversationStyles: a,
1533
+ conversation: i,
1534
+ searchQuery: s,
1535
+ selectedConversationId: r,
1536
+ onConversationClick: d,
1537
+ actions: c,
1538
+ shareConversationProps: f,
1539
+ isDisabled: e
1538
1540
  },
1539
- t.id
1540
- )) : /* @__PURE__ */ m("h3", { className: "text-neutrals-800", children: l?.titles?.noConversation ?? "No conversations yet" }) });
1541
- }, Ut = ({ titles: o }) => /* @__PURE__ */ y("div", { className: "p-8 text-center flex flex-col", children: [
1542
- /* @__PURE__ */ m("p", { className: "text-neutrals-800", children: o?.noConversation ?? "No conversations yet" }),
1543
- /* @__PURE__ */ m("p", { className: "text-sm text-neutrals-800 mt-2", children: o?.clickNewChat ?? 'Click "New Chat" to start a conversation' })
1541
+ i.id
1542
+ )) : /* @__PURE__ */ h("h3", { className: "text-neutrals-800", children: a?.titles?.noConversation ?? "No conversations yet" }) });
1543
+ }, Ut = ({ titles: n }) => /* @__PURE__ */ y("div", { className: "p-8 text-center flex flex-col", children: [
1544
+ /* @__PURE__ */ h("p", { className: "text-neutrals-800", children: n?.noConversation ?? "No conversations yet" }),
1545
+ /* @__PURE__ */ h("p", { className: "text-sm text-neutrals-800 mt-2", children: n?.clickNewChat ?? 'Click "New Chat" to start a conversation' })
1544
1546
  ] }), Zt = ({
1545
- handleConversationClick: o,
1546
- selectedConversationId: s,
1547
- actions: r,
1548
- children: l,
1549
- isCollapsed: c,
1550
- isStreaming: d,
1551
- conversationStyles: f,
1552
- conversations: p,
1547
+ handleConversationClick: n,
1548
+ selectedConversationId: r,
1549
+ actions: s,
1550
+ children: a,
1551
+ isCollapsed: d,
1552
+ isStreaming: c,
1553
+ conversationStyles: m,
1554
+ conversations: f,
1553
1555
  locale: e,
1554
- sharedConversations: n,
1556
+ sharedConversations: o,
1555
1557
  setConversations: t,
1556
1558
  setSharedConversations: i,
1557
- shareConversationProps: a,
1558
- handleSelectedConversationRemove: h
1559
+ shareConversationProps: l,
1560
+ handleSelectedConversationRemove: p
1559
1561
  }) => {
1560
- const [u, E] = T({}), [g, v] = T(!0), [N, C] = T(""), [R, S] = T(!1), {
1562
+ const [u, E] = O({}), [g, v] = O(!0), [N, C] = O(""), [R, S] = O(!1), {
1561
1563
  getConversations: D,
1562
- getSharedConversations: A,
1563
- deleteConversation: O,
1564
- renameConversation: _
1565
- } = r, H = J(() => !!N?.length, [N]);
1564
+ getSharedConversations: b,
1565
+ deleteConversation: T,
1566
+ renameConversation: $
1567
+ } = s, H = J(() => !!N?.length, [N]);
1566
1568
  ee(() => {
1567
1569
  E({
1568
- ...nt(n),
1569
- ...it(p)
1570
+ ...nt(o),
1571
+ ...it(f)
1570
1572
  });
1571
- }, [p, n]), ee(() => {
1573
+ }, [f, o]), ee(() => {
1572
1574
  async function M() {
1573
1575
  try {
1574
1576
  v(!0);
1575
- const b = await D(e), L = await A(
1577
+ const A = await D(e), k = await b(
1576
1578
  re(se.ME)
1577
1579
  );
1578
- t(K(b)), i(
1580
+ t(K(A)), i(
1579
1581
  K(
1580
- ue(L, e)
1582
+ ue(k, e)
1581
1583
  )
1582
1584
  );
1583
- } catch (b) {
1584
- console.error("Error loading conversation", b);
1585
+ } catch (A) {
1586
+ console.error("Error loading conversation", A);
1585
1587
  } finally {
1586
1588
  v(!1);
1587
1589
  }
@@ -1591,49 +1593,49 @@ const bt = (o, s) => ({
1591
1593
  D,
1592
1594
  t,
1593
1595
  e,
1594
- A,
1596
+ b,
1595
1597
  i
1596
1598
  ]);
1597
- const P = B(
1599
+ const P = L(
1598
1600
  async (M) => {
1599
1601
  try {
1600
- await O(M);
1601
- const b = await D(e), L = await A(
1602
+ await T(M);
1603
+ const A = await D(e), k = await b(
1602
1604
  re(se.ME)
1603
1605
  );
1604
- t(K(b)), i(
1606
+ t(K(A)), i(
1605
1607
  K(
1606
- ue(L, e)
1608
+ ue(k, e)
1607
1609
  )
1608
- ), s === M?.id && h();
1609
- } catch (b) {
1610
- console.error("Error deleting conversation", b);
1610
+ ), r === M?.id && p();
1611
+ } catch (A) {
1612
+ console.error("Error deleting conversation", A);
1611
1613
  }
1612
1614
  },
1613
1615
  [
1614
- O,
1616
+ T,
1615
1617
  D,
1616
1618
  e,
1617
- A,
1619
+ b,
1618
1620
  t,
1619
1621
  i,
1620
- s,
1621
- h
1622
+ r,
1623
+ p
1622
1624
  ]
1623
- ), Y = B(
1624
- async (M, b) => {
1625
+ ), Y = L(
1626
+ async (M, A) => {
1625
1627
  try {
1626
- v(!0), await _(M, b);
1627
- const L = await D(e), W = await A(
1628
+ v(!0), await $(M, A);
1629
+ const k = await D(e), W = await b(
1628
1630
  re(se.ME)
1629
1631
  );
1630
- t(K(L)), i(
1632
+ t(K(k)), i(
1631
1633
  K(
1632
1634
  ue(W, e)
1633
1635
  )
1634
1636
  );
1635
- } catch (L) {
1636
- console.error("Error renaming conversation", L);
1637
+ } catch (k) {
1638
+ console.error("Error renaming conversation", k);
1637
1639
  } finally {
1638
1640
  v(!1);
1639
1641
  }
@@ -1641,129 +1643,130 @@ const bt = (o, s) => ({
1641
1643
  [
1642
1644
  D,
1643
1645
  e,
1644
- A,
1646
+ b,
1645
1647
  t,
1646
1648
  i,
1647
- _
1649
+ $
1648
1650
  ]
1649
- ), j = B(
1651
+ ), j = L(
1650
1652
  (M) => {
1651
1653
  C(M);
1652
1654
  },
1653
1655
  [C]
1654
- ), $ = B(() => {
1656
+ ), _ = L(() => {
1655
1657
  S((M) => !M), C("");
1656
1658
  }, [S]);
1657
- return g ? /* @__PURE__ */ m(we, {}) : /* @__PURE__ */ y(q, { children: [
1658
- !c && /* @__PURE__ */ y(
1659
+ return g ? /* @__PURE__ */ h(we, {}) : /* @__PURE__ */ y(q, { children: [
1660
+ !d && /* @__PURE__ */ y(
1659
1661
  "div",
1660
1662
  {
1661
- className: k(
1663
+ className: B(
1662
1664
  "flex justify-between items-center",
1663
1665
  R ? " pt-4 pb-0 sm:pt-10" : " pt-6 pb-2 sm:pt-10"
1664
1666
  ),
1665
1667
  children: [
1666
- !R && /* @__PURE__ */ m("h3", { className: "text-neutrals-700 sm:body-2", children: f?.titles?.allChats ?? "All Chats" }),
1667
- /* @__PURE__ */ m(
1668
- kt,
1668
+ !R && /* @__PURE__ */ h("h3", { className: "text-neutrals-700 sm:body-2", children: m?.titles?.allChats ?? "All Chats" }),
1669
+ /* @__PURE__ */ h(
1670
+ Bt,
1669
1671
  {
1670
1672
  searchQuery: N,
1671
- searchIcon: f.searchIcon,
1672
- titles: f.titles,
1673
+ searchIcon: m.searchIcon,
1674
+ titles: m.titles,
1673
1675
  isExpandedSearch: R,
1674
1676
  onSearchConversations: j,
1675
- toggleSearchField: $
1677
+ toggleSearchField: _
1676
1678
  }
1677
1679
  )
1678
1680
  ]
1679
1681
  }
1680
1682
  ),
1681
- /* @__PURE__ */ m(
1683
+ /* @__PURE__ */ h(
1682
1684
  "div",
1683
1685
  {
1684
- className: k(
1686
+ className: B(
1685
1687
  "scroll-hidden-container flex flex-col mt-4 flex-1 min-h-0 pr-2",
1686
1688
  H ? "gap-y-1" : "gap-y-6"
1687
1689
  ),
1688
- children: c ? null : /* @__PURE__ */ m(q, { children: p?.length === 0 && n?.length === 0 ? /* @__PURE__ */ m(Ut, { titles: f.titles }) : H ? /* @__PURE__ */ m(
1690
+ children: d ? null : /* @__PURE__ */ h(q, { children: f?.length === 0 && o?.length === 0 ? /* @__PURE__ */ h(Ut, { titles: m.titles }) : H ? /* @__PURE__ */ h(
1689
1691
  Ft,
1690
1692
  {
1691
1693
  locale: e,
1692
- conversationStyles: f,
1693
- conversations: [...n, ...p],
1694
+ conversationStyles: m,
1695
+ conversations: [...o, ...f],
1694
1696
  searchQuery: N,
1695
- selectedConversationId: s,
1696
- handleConversationClick: o,
1697
- shareConversationProps: a,
1697
+ selectedConversationId: r,
1698
+ handleConversationClick: n,
1699
+ shareConversationProps: l,
1700
+ isDisabled: c,
1698
1701
  actions: {
1699
- ...r,
1702
+ ...s,
1700
1703
  deleteConversation: P
1701
1704
  }
1702
1705
  }
1703
1706
  ) : Object.entries(u).map(
1704
- ([M, b]) => b?.length > 0 && /* @__PURE__ */ m(
1705
- Bt,
1707
+ ([M, A]) => A?.length > 0 && /* @__PURE__ */ h(
1708
+ kt,
1706
1709
  {
1707
1710
  locale: e,
1708
- isDisabled: d,
1711
+ isDisabled: c,
1709
1712
  groupLabel: M,
1710
- conversationStyles: f,
1711
- groupedConversations: b,
1712
- handleConversationClick: o,
1713
+ conversationStyles: m,
1714
+ groupedConversations: A,
1715
+ handleConversationClick: n,
1713
1716
  actions: {
1714
- ...r,
1717
+ ...s,
1715
1718
  deleteConversation: P,
1716
1719
  renameConversation: Y
1717
1720
  },
1718
- shareConversationProps: a,
1719
- selectedConversationId: s
1721
+ shareConversationProps: l,
1722
+ selectedConversationId: r
1720
1723
  },
1721
1724
  M
1722
1725
  )
1723
1726
  ) })
1724
1727
  }
1725
1728
  ),
1726
- l
1729
+ a
1727
1730
  ] });
1728
1731
  }, zt = ({
1729
- onCloseModal: o,
1730
- disableModalDividers: s,
1731
- signOut: r,
1732
- isSmallButton: l,
1733
- locale: c,
1734
- titles: d
1732
+ onCloseModal: n,
1733
+ disableModalDividers: r,
1734
+ signOut: s,
1735
+ isSmallButton: a,
1736
+ locale: d,
1737
+ titles: c
1735
1738
  }) => /* @__PURE__ */ y(
1736
1739
  ae,
1737
1740
  {
1738
- heading: d?.popupTitle || "Log out?",
1741
+ heading: c?.popupTitle || "Log out?",
1739
1742
  portalId: "sign-out",
1740
1743
  containerClassName: "sign-out-popup",
1741
1744
  size: le.SM,
1742
- dividers: !s,
1743
- onClose: o,
1745
+ dividers: !r,
1746
+ onClose: n,
1744
1747
  closeButtonTitle: "Cancel",
1745
1748
  children: [
1746
- /* @__PURE__ */ m("div", { className: "py-4 px-6 sm:px-0", lang: c, children: d?.popupText }),
1749
+ /* @__PURE__ */ h("div", { className: "py-4 px-6 sm:px-0", lang: d, children: c?.popupText }),
1747
1750
  /* @__PURE__ */ y("div", { className: "flex justify-end gap-x-2 py-3 px-6 delete-conversation-popup-footer", children: [
1748
- /* @__PURE__ */ m(
1751
+ /* @__PURE__ */ h(
1749
1752
  Q,
1750
1753
  {
1751
1754
  buttonClassName: "cancel-button",
1752
- title: d?.popupCancel || "Cancel",
1753
- isSmallButton: l,
1754
- onClick: (f) => {
1755
- f.stopPropagation(), o();
1755
+ title: c?.popupCancel || "Cancel",
1756
+ isSmallButton: a,
1757
+ onClick: (m) => {
1758
+ m.stopPropagation(), n();
1756
1759
  }
1757
1760
  }
1758
1761
  ),
1759
- /* @__PURE__ */ m(
1762
+ /* @__PURE__ */ h(
1760
1763
  Q,
1761
1764
  {
1762
1765
  buttonClassName: "text-button-primary",
1763
- title: d?.popupApply || "Sign Out",
1764
- isSmallButton: l,
1765
- onClick: (f) => {
1766
- f.stopPropagation(), r?.();
1766
+ title: c?.popupApply || "Sign Out",
1767
+ isSmallButton: a,
1768
+ onClick: (m) => {
1769
+ m.stopPropagation(), s?.();
1767
1770
  }
1768
1771
  }
1769
1772
  )
@@ -1771,83 +1774,104 @@ const bt = (o, s) => ({
1771
1774
  ]
1772
1775
  }
1773
1776
  ), Jt = ({
1774
- userInfo: o,
1775
- signOutAction: s,
1776
- styles: r,
1777
- locale: l,
1777
+ userInfo: n,
1778
+ signOutAction: r,
1779
+ contactSupportUrl: s,
1780
+ styles: a,
1781
+ locale: d,
1778
1782
  titles: c
1779
1783
  }) => {
1780
- const d = (E) => E?.split(" ")?.map((g, v) => v < 2 ? g[0].toUpperCase() : "")?.join("") ?? "", f = J(
1781
- () => o?.name ? d(o?.name) : o?.email?.[0].toUpperCase() ?? "",
1782
- [o]
1783
- ), [p, e] = T(!1), n = o?.name?.split(" "), t = n ? `${n?.[0] ?? ""} ${n?.[1]?.[0] ? n?.[1]?.[0] + "." : ""}` : o?.email ?? "", i = B(() => {
1784
- e(!0);
1785
- }, []), a = B(() => {
1786
- e(!1);
1787
- }, []), h = J(() => /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
1788
- /* @__PURE__ */ m(
1784
+ const m = (v) => v?.split(" ")?.map((N, C) => C < 2 ? N[0].toUpperCase() : "")?.join("") ?? "", f = J(
1785
+ () => n?.name ? m(n?.name) : n?.email?.[0].toUpperCase() ?? "",
1786
+ [n]
1787
+ ), [e, o] = O(!1), t = n?.name?.split(" "), i = t ? `${t?.[0] ?? ""} ${t?.[1]?.[0] ? t?.[1]?.[0] + "." : ""}` : n?.email ?? "", l = L(() => {
1788
+ o(!0);
1789
+ }, []), p = L(() => {
1790
+ o(!1);
1791
+ }, []), u = L(() => {
1792
+ window.open(s || "#", "_blank", "noopener,noreferrer");
1793
+ }, [s]), E = J(() => /* @__PURE__ */ y("div", { className: "flex items-center gap-2", children: [
1794
+ /* @__PURE__ */ h(
1789
1795
  "div",
1790
1796
  {
1791
- className: k(
1797
+ className: B(
1792
1798
  "cursor-pointer flex items-center justify-center size-11 rounded-[100px] p-[10px] sm:h-[32px] sm:w-[32px] flex-shrink-0",
1793
- r?.initialStyles
1799
+ a?.initialStyles
1794
1800
  ),
1795
1801
  children: f
1796
1802
  }
1797
1803
  ),
1798
- /* @__PURE__ */ m(
1804
+ /* @__PURE__ */ h(
1799
1805
  "p",
1800
1806
  {
1801
- className: k(
1807
+ className: B(
1802
1808
  "h3 cursor-pointer overflow-hidden text-ellipsis",
1803
- r?.userNameStyles
1809
+ a?.userNameStyles
1804
1810
  ),
1805
- children: (r?.showShortName ? t : o?.name) ?? o?.email ?? ""
1811
+ children: (a?.showShortName ? i : n?.name) ?? n?.email ?? ""
1806
1812
  }
1807
1813
  )
1808
- ] }), [f, t, r, o]), u = J(() => /* @__PURE__ */ y("div", { className: k("py-1", r?.dropDownStyles), children: [
1809
- r?.settingsIcon && /* @__PURE__ */ y(
1814
+ ] }), [f, i, a, n]), g = J(() => /* @__PURE__ */ y("div", { className: B("py-1", a?.dropDownStyles), children: [
1815
+ a?.settingsIcon && /* @__PURE__ */ y(
1810
1816
  "button",
1811
1817
  {
1812
- className: k(
1813
- "p-2 items-center flex gap-1 text-primary fill-primary body-1",
1814
- r?.dropdownButtonStyles
1818
+ className: B(
1819
+ "p-2 items-center flex gap-1 text-primary fill-primary",
1820
+ a?.dropdownButtonTypographyStyles || "body-1",
1821
+ a?.dropdownButtonStyles
1815
1822
  ),
1816
1823
  title: c?.settings,
1817
1824
  children: [
1818
- r?.settingsIcon,
1819
- c?.settings || "Settings"
1825
+ /* @__PURE__ */ h("span", { className: "shrink-0", children: a?.settingsIcon }),
1826
+ /* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.settings || "Settings" })
1827
+ ]
1828
+ }
1829
+ ),
1830
+ a?.contactSupportIcon && /* @__PURE__ */ y(
1831
+ "button",
1832
+ {
1833
+ className: B(
1834
+ "p-2 items-center flex gap-1 text-primary fill-primary",
1835
+ a?.dropdownButtonTypographyStyles || "body-1",
1836
+ a?.dropdownButtonStyles
1837
+ ),
1838
+ title: c?.contactSupport,
1839
+ onClick: u,
1840
+ children: [
1841
+ /* @__PURE__ */ h("span", { className: "shrink-0", children: a?.contactSupportIcon }),
1842
+ /* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.contactSupport || "Contact support" })
1820
1843
  ]
1821
1844
  }
1822
1845
  ),
1823
- /* @__PURE__ */ m(
1846
+ /* @__PURE__ */ h(
1824
1847
  "div",
1825
1848
  {
1826
- className: k(
1849
+ className: B(
1827
1850
  "h-0 border-t border-neutrals-600 my-2",
1828
- r?.showSeparator ? "block" : "hidden"
1851
+ a?.showSeparator ? "block" : "hidden"
1829
1852
  )
1830
1853
  }
1831
1854
  ),
1832
1855
  /* @__PURE__ */ y(
1833
1856
  "button",
1834
1857
  {
1835
- className: k(
1836
- "p-2 items-center flex gap-1 text-primary fill-primary body-1",
1837
- r?.dropdownButtonStyles
1858
+ className: B(
1859
+ "p-2 items-center flex gap-1 text-primary fill-primary",
1860
+ a?.dropdownButtonTypographyStyles || "body-1",
1861
+ a?.dropdownButtonStyles
1838
1862
  ),
1839
1863
  title: c?.signOut,
1840
- onClick: i,
1864
+ onClick: l,
1841
1865
  children: [
1842
- r?.signOutIcon,
1843
- c?.signOut || "Sign out",
1844
- p && /* @__PURE__ */ m(
1866
+ /* @__PURE__ */ h("span", { className: "shrink-0", children: a?.signOutIcon }),
1867
+ /* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.signOut || "Sign out" }),
1868
+ e && /* @__PURE__ */ h(
1845
1869
  zt,
1846
1870
  {
1847
- onCloseModal: a,
1848
- signOut: () => s?.(),
1849
- locale: l,
1850
- disableModalDividers: r?.disableModalDividers,
1871
+ onCloseModal: p,
1872
+ signOut: () => r?.(),
1873
+ locale: d,
1874
+ disableModalDividers: a?.disableModalDividers,
1851
1875
  titles: c
1852
1876
  }
1853
1877
  )
@@ -1855,30 +1879,31 @@ const bt = (o, s) => ({
1855
1879
  }
1856
1880
  )
1857
1881
  ] }), [
1858
- r,
1859
- c,
1860
- i,
1861
- p,
1862
1882
  a,
1883
+ c,
1863
1884
  l,
1864
- s
1885
+ u,
1886
+ e,
1887
+ p,
1888
+ d,
1889
+ r
1865
1890
  ]);
1866
- if (o)
1867
- return /* @__PURE__ */ m(
1891
+ if (n)
1892
+ return /* @__PURE__ */ h(
1868
1893
  Re,
1869
1894
  {
1870
- containerClassName: k(
1895
+ containerClassName: B(
1871
1896
  "transition-opacity group-hover:opacity-100 shrink w-full",
1872
- r?.dropdownContainerClassName
1897
+ a?.dropdownContainerClassName
1873
1898
  ),
1874
- triggerButton: h,
1875
- content: u,
1899
+ triggerButton: E,
1900
+ content: g,
1876
1901
  openedClassName: "action-menu-opened"
1877
1902
  }
1878
1903
  );
1879
1904
  };
1880
1905
  export {
1881
- Tt as ActionMenu,
1906
+ Ot as ActionMenu,
1882
1907
  U as ActionMenuItem,
1883
1908
  Zt as ConversationList,
1884
1909
  Jt as User,