@epam/statgpt-conversation-list 0.4.0-rc.8 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/index.mjs +915 -869
- package/package.json +4 -4
package/index.mjs
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { cloneDeep as
|
|
5
|
-
import { Popup as
|
|
6
|
-
import { IconCheck as
|
|
7
|
-
import
|
|
8
|
-
import { getConversationAttachments as
|
|
9
|
-
import { InvitationType as
|
|
10
|
-
var
|
|
11
|
-
const
|
|
12
|
-
const
|
|
1
|
+
import { jsxs as M, jsx as h, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import B from "classnames";
|
|
3
|
+
import D, { useState as k, useRef as me, useMemo as X, useCallback as O, useEffect as ne } from "react";
|
|
4
|
+
import { cloneDeep as Ye, uniqBy as Qe, omit as Ge } from "lodash";
|
|
5
|
+
import { Popup as le, PopUpSize as ce, Button as j, Loader as Re, InputWithIcon as ye, Input as je, PopUpState as $, Dropdown as Me, HighlightText as We, IconButton as Ve } from "@epam/statgpt-ui-components";
|
|
6
|
+
import { IconCheck as Xe, IconCopy as Ke, IconDotsVertical as Ze, IconCaretRightFilled as Je, IconX as qe, IconSearch as et } from "@tabler/icons-react";
|
|
7
|
+
import tt from "jszip";
|
|
8
|
+
import { getConversationAttachments as nt, SHARE_CONVERSATION_ROUTE as be, getClearedConversationName as Ee, ONBOARDING_MODEL_POSTFIX as ot, cleanConversationNames as J } from "@epam/statgpt-shared-toolkit";
|
|
9
|
+
import { InvitationType as rt, getSharedConversationsRequest as se, ShareTarget as ie } from "@epam/statgpt-dial-toolkit";
|
|
10
|
+
var _ = /* @__PURE__ */ ((o) => (o.DELETE = "delete", o.EXPORT = "export", o.SHARE = "share", o.RENAME = "rename", o))(_ || {}), U = /* @__PURE__ */ ((o) => (o.SHARED = "shared", o.TODAY = "today", o.YESTERDAY = "yesterday", o.WEEK = "week", o.EARLIER = "earlier", o))(U || {});
|
|
11
|
+
const fe = (o, r) => o?.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
|
-
...
|
|
15
|
-
folderId:
|
|
16
|
-
id:
|
|
14
|
+
...s,
|
|
15
|
+
folderId: a,
|
|
16
|
+
id: d,
|
|
17
17
|
isShared: !0
|
|
18
18
|
};
|
|
19
|
-
}) || [],
|
|
20
|
-
[
|
|
21
|
-
}),
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
},
|
|
27
|
-
const
|
|
19
|
+
}) || [], st = (o) => ({
|
|
20
|
+
[U.SHARED]: o
|
|
21
|
+
}), it = {
|
|
22
|
+
[U.TODAY]: [],
|
|
23
|
+
[U.YESTERDAY]: [],
|
|
24
|
+
[U.WEEK]: [],
|
|
25
|
+
[U.EARLIER]: []
|
|
26
|
+
}, Ae = (o, r) => o.toDateString() === r.toDateString(), at = (o, r) => {
|
|
27
|
+
const s = new Date(
|
|
28
28
|
o.getFullYear(),
|
|
29
29
|
o.getMonth(),
|
|
30
30
|
o.getDate() - 1
|
|
31
31
|
);
|
|
32
|
-
return
|
|
33
|
-
},
|
|
34
|
-
const
|
|
35
|
-
return Math.floor(
|
|
36
|
-
},
|
|
37
|
-
const
|
|
38
|
-
for (const
|
|
39
|
-
if (
|
|
40
|
-
const
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
(f) => f.id ===
|
|
44
|
-
) ||
|
|
32
|
+
return Ae(r, s);
|
|
33
|
+
}, lt = (o, r) => {
|
|
34
|
+
const s = o.getTime() - r.getTime();
|
|
35
|
+
return Math.floor(s / (1e3 * 60 * 60 * 24));
|
|
36
|
+
}, Ne = (o) => o.updatedAt || Number(o.id?.split("-").pop()), ct = (o) => {
|
|
37
|
+
const r = /* @__PURE__ */ new Date(), s = Ye(it);
|
|
38
|
+
for (const a of o)
|
|
39
|
+
if (a.updatedAt) {
|
|
40
|
+
const d = new Date(a.updatedAt);
|
|
41
|
+
let c;
|
|
42
|
+
Ae(r, d) ? c = s[U.TODAY] : at(r, d) ? c = s[U.YESTERDAY] : lt(r, d) <= 7 ? c = s[U.WEEK] : c = s[U.EARLIER], c?.some(
|
|
43
|
+
(f) => f.id === a.id
|
|
44
|
+
) || c.push(a);
|
|
45
45
|
}
|
|
46
|
-
return
|
|
47
|
-
},
|
|
48
|
-
(
|
|
49
|
-
),
|
|
46
|
+
return s;
|
|
47
|
+
}, Ie = (o) => o?.sort(
|
|
48
|
+
(r, s) => (Ne(s) || 0) - (Ne(r) || 0)
|
|
49
|
+
), dt = (o, r) => o === U.SHARED ? r?.shared || "Shared" : o === U.TODAY ? r?.today || "Today" : o === U.YESTERDAY ? r?.yesterday || "Yesterday" : o === U.WEEK ? r?.lastWeek || "Last week" : r?.earlier || "Earlier", ut = ({
|
|
50
50
|
onCloseModal: o,
|
|
51
|
-
disableModalDividers:
|
|
52
|
-
deleteConversation:
|
|
53
|
-
isSmallButton:
|
|
54
|
-
titles:
|
|
55
|
-
locale:
|
|
56
|
-
}) => /* @__PURE__ */
|
|
57
|
-
|
|
51
|
+
disableModalDividers: r,
|
|
52
|
+
deleteConversation: s,
|
|
53
|
+
isSmallButton: a,
|
|
54
|
+
titles: d,
|
|
55
|
+
locale: c
|
|
56
|
+
}) => /* @__PURE__ */ M(
|
|
57
|
+
le,
|
|
58
58
|
{
|
|
59
|
-
heading:
|
|
59
|
+
heading: d?.deleteTitle ?? "Delete conversation",
|
|
60
60
|
portalId: "delete-conversation",
|
|
61
61
|
containerClassName: "delete-conversation-popup",
|
|
62
|
-
size:
|
|
63
|
-
dividers: !
|
|
62
|
+
size: ce.SM,
|
|
63
|
+
dividers: !r,
|
|
64
64
|
onClose: o,
|
|
65
|
-
closeButtonTitle:
|
|
65
|
+
closeButtonTitle: d?.close ?? "Cancel",
|
|
66
66
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
67
|
+
/* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: c, children: d?.deleteMessage ?? "Are you sure you want to delete this conversation? This action cannot be undone." }),
|
|
68
|
+
/* @__PURE__ */ M("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
|
|
69
|
+
/* @__PURE__ */ h(
|
|
70
|
+
j,
|
|
71
71
|
{
|
|
72
72
|
buttonClassName: "cancel-button",
|
|
73
|
-
title:
|
|
74
|
-
isSmallButton:
|
|
73
|
+
title: d?.cancel ?? "Cancel",
|
|
74
|
+
isSmallButton: a,
|
|
75
75
|
onClick: (f) => {
|
|
76
76
|
f.stopPropagation(), o();
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
80
|
+
/* @__PURE__ */ h(
|
|
81
|
+
j,
|
|
82
82
|
{
|
|
83
83
|
buttonClassName: "text-button-primary text-button-primary-error",
|
|
84
|
-
title:
|
|
85
|
-
isSmallButton:
|
|
84
|
+
title: d?.delete ?? "Delete",
|
|
85
|
+
isSmallButton: a,
|
|
86
86
|
onClick: (f) => {
|
|
87
|
-
f.stopPropagation(),
|
|
87
|
+
f.stopPropagation(), s();
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
)
|
|
91
91
|
] })
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
|
-
),
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
).map((
|
|
98
|
-
...
|
|
94
|
+
), ht = (o) => {
|
|
95
|
+
const r = gt(
|
|
96
|
+
nt(o)
|
|
97
|
+
).map((s) => ({
|
|
98
|
+
...s,
|
|
99
99
|
relativePath: "",
|
|
100
100
|
contentLength: 0
|
|
101
101
|
}));
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
(
|
|
102
|
+
return Qe(
|
|
103
|
+
r,
|
|
104
|
+
(s) => oe(s.relativePath, s.name)
|
|
105
105
|
);
|
|
106
|
-
},
|
|
107
|
-
const
|
|
106
|
+
}, pt = (o) => o.endsWith("/"), ft = (o) => {
|
|
107
|
+
const r = o.toLowerCase();
|
|
108
108
|
return [
|
|
109
109
|
"data:",
|
|
110
110
|
"//",
|
|
@@ -115,67 +115,67 @@ 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((
|
|
119
|
-
},
|
|
120
|
-
const
|
|
121
|
-
...o.split("/").map((
|
|
122
|
-
),
|
|
118
|
+
].some((s) => r.startsWith(s));
|
|
119
|
+
}, mt = (o) => {
|
|
120
|
+
const r = oe(
|
|
121
|
+
...o.split("/").map((a) => decodeURIComponent(a))
|
|
122
|
+
), s = r.lastIndexOf("/");
|
|
123
123
|
return {
|
|
124
|
-
absolutePath:
|
|
125
|
-
name:
|
|
124
|
+
absolutePath: r.slice(0, s),
|
|
125
|
+
name: r.slice(s + 1)
|
|
126
126
|
};
|
|
127
|
-
},
|
|
128
|
-
if (!
|
|
127
|
+
}, gt = (o) => o ? o.map((r) => {
|
|
128
|
+
if (!r.url || ft(r.url) || pt(r.url))
|
|
129
129
|
return null;
|
|
130
|
-
const { absolutePath:
|
|
130
|
+
const { absolutePath: s, name: a } = mt(r.url);
|
|
131
131
|
return {
|
|
132
|
-
id:
|
|
133
|
-
name:
|
|
134
|
-
contentType:
|
|
135
|
-
folderId:
|
|
136
|
-
absolutePath:
|
|
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
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const e = encodeURI(
|
|
143
|
-
|
|
139
|
+
async function Ct(o, r) {
|
|
140
|
+
const s = ht(o), a = new tt();
|
|
141
|
+
s.forEach((m) => {
|
|
142
|
+
const e = encodeURI(oe(m.absolutePath, m.name)), n = r(`${e}`.replace("files/", "")), t = Et(m.folderId), i = oe("res", t, m.name);
|
|
143
|
+
a.file(i, n);
|
|
144
144
|
});
|
|
145
|
-
const
|
|
145
|
+
const d = {
|
|
146
146
|
version: 5,
|
|
147
|
-
history: [o].map(
|
|
147
|
+
history: [o].map(wt) || [],
|
|
148
148
|
folders: []
|
|
149
|
-
},
|
|
150
|
-
return
|
|
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
|
|
153
|
-
const
|
|
154
|
-
return
|
|
155
|
-
},
|
|
156
|
-
function
|
|
157
|
-
const
|
|
158
|
-
|
|
152
|
+
const Et = (o) => {
|
|
153
|
+
const r = o.split("/");
|
|
154
|
+
return r.length > 2 ? oe(...r.slice(2)) : void 0;
|
|
155
|
+
}, wt = (o) => Ge(o, ["publicationInfo"]), oe = (...o) => o.filter(Boolean).join("/");
|
|
156
|
+
function Nt(o, r) {
|
|
157
|
+
const s = document.createElement("a");
|
|
158
|
+
s.download = r, s.href = o, s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(o);
|
|
159
159
|
}
|
|
160
|
-
var
|
|
161
|
-
for (var
|
|
162
|
-
|
|
163
|
-
if (
|
|
164
|
-
for (var
|
|
165
|
-
|
|
160
|
+
var vt = Object.defineProperty, ae = Object.getOwnPropertySymbols, Se = Object.prototype.hasOwnProperty, xe = Object.prototype.propertyIsEnumerable, ve = (o, r, s) => r in o ? vt(o, r, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[r] = s, ge = (o, r) => {
|
|
161
|
+
for (var s in r || (r = {}))
|
|
162
|
+
Se.call(r, s) && ve(o, s, r[s]);
|
|
163
|
+
if (ae)
|
|
164
|
+
for (var s of ae(r))
|
|
165
|
+
xe.call(r, s) && ve(o, s, r[s]);
|
|
166
166
|
return o;
|
|
167
|
-
},
|
|
168
|
-
var
|
|
169
|
-
for (var
|
|
170
|
-
|
|
171
|
-
if (o != null &&
|
|
172
|
-
for (var
|
|
173
|
-
|
|
174
|
-
return
|
|
167
|
+
}, Ce = (o, r) => {
|
|
168
|
+
var s = {};
|
|
169
|
+
for (var a in o)
|
|
170
|
+
Se.call(o, a) && r.indexOf(a) < 0 && (s[a] = o[a]);
|
|
171
|
+
if (o != null && ae)
|
|
172
|
+
for (var a of ae(o))
|
|
173
|
+
r.indexOf(a) < 0 && xe.call(o, a) && (s[a] = o[a]);
|
|
174
|
+
return s;
|
|
175
175
|
};
|
|
176
|
-
var
|
|
176
|
+
var K;
|
|
177
177
|
((o) => {
|
|
178
|
-
const
|
|
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.
|
|
@@ -187,14 +187,14 @@ var X;
|
|
|
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
|
|
190
|
+
let l = [];
|
|
191
191
|
for (let u = 0; u < this.size; u++)
|
|
192
|
-
|
|
192
|
+
l.push(!1);
|
|
193
193
|
for (let u = 0; u < this.size; u++)
|
|
194
|
-
this.modules.push(
|
|
194
|
+
this.modules.push(l.slice()), this.isFunction.push(l.slice());
|
|
195
195
|
this.drawFunctionPatterns();
|
|
196
|
-
const
|
|
197
|
-
if (this.drawCodewords(
|
|
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
|
-
|
|
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.
|
|
@@ -232,36 +232,36 @@ 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,
|
|
236
|
-
if (!(w.MIN_VERSION <= t && t <= i && i <= w.MAX_VERSION) ||
|
|
235
|
+
static encodeSegments(e, n, 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,
|
|
241
|
-
if (
|
|
242
|
-
E =
|
|
240
|
+
const C = w.getNumDataCodewords(u, n) * 8, v = f.getTotalBits(e, u);
|
|
241
|
+
if (v <= C) {
|
|
242
|
+
E = v;
|
|
243
243
|
break;
|
|
244
244
|
}
|
|
245
245
|
if (u >= i)
|
|
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
|
-
|
|
249
|
+
p && E <= w.getNumDataCodewords(u, C) * 8 && (n = C);
|
|
250
250
|
let g = [];
|
|
251
251
|
for (const C of e) {
|
|
252
|
-
|
|
253
|
-
for (const
|
|
254
|
-
g.push(
|
|
252
|
+
s(C.mode.modeBits, 4, g), s(C.numChars, C.mode.numCharCountBits(u), g);
|
|
253
|
+
for (const v of C.getData())
|
|
254
|
+
g.push(v);
|
|
255
255
|
}
|
|
256
|
-
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
for (let C = 236; g.length <
|
|
260
|
-
|
|
256
|
+
d(g.length == E);
|
|
257
|
+
const R = w.getNumDataCodewords(u, n) * 8;
|
|
258
|
+
d(g.length <= R), s(0, Math.min(4, R - g.length), g), s(0, (8 - g.length % 8) % 8, g), d(g.length % 8 == 0);
|
|
259
|
+
for (let C = 236; g.length < R; C ^= 253)
|
|
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,
|
|
264
|
+
return g.forEach((C, v) => N[v >>> 3] |= C << 7 - (v & 7)), new w(u, n, N, l);
|
|
265
265
|
}
|
|
266
266
|
/*-- Accessor methods --*/
|
|
267
267
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
@@ -291,19 +291,19 @@ var X;
|
|
|
291
291
|
drawFormatBits(e) {
|
|
292
292
|
const n = this.errorCorrectionLevel.formatBits << 3 | e;
|
|
293
293
|
let t = n;
|
|
294
|
-
for (let
|
|
294
|
+
for (let l = 0; l < 10; l++)
|
|
295
295
|
t = t << 1 ^ (t >>> 9) * 1335;
|
|
296
296
|
const i = (n << 10 | t) ^ 21522;
|
|
297
|
-
|
|
298
|
-
for (let
|
|
299
|
-
this.setFunctionModule(8,
|
|
300
|
-
this.setFunctionModule(8, 7,
|
|
301
|
-
for (let
|
|
302
|
-
this.setFunctionModule(14 -
|
|
303
|
-
for (let
|
|
304
|
-
this.setFunctionModule(this.size - 1 -
|
|
305
|
-
for (let
|
|
306
|
-
this.setFunctionModule(8, this.size - 15 +
|
|
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),
|
|
@@ -315,10 +315,10 @@ var X;
|
|
|
315
315
|
for (let t = 0; t < 12; t++)
|
|
316
316
|
e = e << 1 ^ (e >>> 11) * 7973;
|
|
317
317
|
const n = this.version << 12 | e;
|
|
318
|
-
|
|
318
|
+
d(n >>> 18 == 0);
|
|
319
319
|
for (let t = 0; t < 18; t++) {
|
|
320
|
-
const i =
|
|
321
|
-
this.setFunctionModule(
|
|
320
|
+
const i = a(n, 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,
|
|
@@ -326,8 +326,8 @@ var X;
|
|
|
326
326
|
drawFinderPattern(e, n) {
|
|
327
327
|
for (let t = -4; t <= 4; t++)
|
|
328
328
|
for (let i = -4; i <= 4; i++) {
|
|
329
|
-
const
|
|
330
|
-
0 <=
|
|
329
|
+
const l = Math.max(Math.abs(i), Math.abs(t)), p = e + i, u = n + 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
|
|
@@ -349,21 +349,21 @@ var X;
|
|
|
349
349
|
const n = this.version, t = this.errorCorrectionLevel;
|
|
350
350
|
if (e.length != w.getNumDataCodewords(n, t))
|
|
351
351
|
throw new RangeError("Invalid argument");
|
|
352
|
-
const i = w.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][n],
|
|
352
|
+
const i = w.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][n], l = w.ECC_CODEWORDS_PER_BLOCK[t.ordinal][n], p = Math.floor(w.getNumRawDataModules(n) / 8), u = i - p % i, E = Math.floor(p / i);
|
|
353
353
|
let g = [];
|
|
354
|
-
const
|
|
355
|
-
for (let C = 0,
|
|
356
|
-
let
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
C < u &&
|
|
354
|
+
const R = w.reedSolomonComputeDivisor(l);
|
|
355
|
+
for (let C = 0, v = 0; C < i; C++) {
|
|
356
|
+
let I = e.slice(v, v + E - l + (C < u ? 0 : 1));
|
|
357
|
+
v += I.length;
|
|
358
|
+
const T = w.reedSolomonComputeRemainder(I, R);
|
|
359
|
+
C < u && I.push(0), g.push(I.concat(T));
|
|
360
360
|
}
|
|
361
361
|
let N = [];
|
|
362
362
|
for (let C = 0; C < g[0].length; C++)
|
|
363
|
-
g.forEach((
|
|
364
|
-
(C != E -
|
|
363
|
+
g.forEach((v, I) => {
|
|
364
|
+
(C != E - l || I >= u) && N.push(v[C]);
|
|
365
365
|
});
|
|
366
|
-
return
|
|
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.
|
|
@@ -374,12 +374,12 @@ var X;
|
|
|
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
|
|
378
|
-
const
|
|
379
|
-
!this.isFunction[E][
|
|
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] && n < e.length * 8 && (this.modules[E][p] = a(e[n >>> 3], 7 - (n & 7)), n++);
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
|
-
|
|
382
|
+
d(n == 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
|
|
@@ -427,28 +427,28 @@ var X;
|
|
|
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
|
|
431
|
-
let
|
|
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[
|
|
434
|
-
e += this.finderPenaltyTerminateAndCount(
|
|
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
|
|
437
|
-
let
|
|
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][
|
|
440
|
-
e += this.finderPenaltyTerminateAndCount(
|
|
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
|
|
443
|
-
for (let
|
|
444
|
-
const u = this.modules[
|
|
445
|
-
u == this.modules[
|
|
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
447
|
let n = 0;
|
|
448
|
-
for (const
|
|
449
|
-
n =
|
|
448
|
+
for (const l of this.modules)
|
|
449
|
+
n = l.reduce((p, u) => p + (u ? 1 : 0), n);
|
|
450
450
|
const t = this.size * this.size, i = Math.ceil(Math.abs(n * 20 - t * 10) / t) - 1;
|
|
451
|
-
return
|
|
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.
|
|
@@ -476,7 +476,7 @@ var X;
|
|
|
476
476
|
const t = Math.floor(e / 7) + 2;
|
|
477
477
|
n -= (25 * t - 10) * t - 55, e >= 7 && (n -= 36);
|
|
478
478
|
}
|
|
479
|
-
return
|
|
479
|
+
return d(208 <= n && n <= 29648), n;
|
|
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.
|
|
@@ -495,8 +495,8 @@ var X;
|
|
|
495
495
|
n.push(1);
|
|
496
496
|
let t = 1;
|
|
497
497
|
for (let i = 0; i < e; i++) {
|
|
498
|
-
for (let
|
|
499
|
-
n[
|
|
498
|
+
for (let l = 0; l < n.length; l++)
|
|
499
|
+
n[l] = w.reedSolomonMultiply(n[l], t), l + 1 < n.length && (n[l] ^= n[l + 1]);
|
|
500
500
|
t = w.reedSolomonMultiply(t, 2);
|
|
501
501
|
}
|
|
502
502
|
return n;
|
|
@@ -505,8 +505,8 @@ var X;
|
|
|
505
505
|
static reedSolomonComputeRemainder(e, n) {
|
|
506
506
|
let t = n.map((i) => 0);
|
|
507
507
|
for (const i of e) {
|
|
508
|
-
const
|
|
509
|
-
t.push(0), n.forEach((
|
|
508
|
+
const l = i ^ t.shift();
|
|
509
|
+
t.push(0), n.forEach((p, u) => t[u] ^= w.reedSolomonMultiply(p, l));
|
|
510
510
|
}
|
|
511
511
|
return t;
|
|
512
512
|
}
|
|
@@ -518,13 +518,13 @@ var X;
|
|
|
518
518
|
let t = 0;
|
|
519
519
|
for (let i = 7; i >= 0; i--)
|
|
520
520
|
t = t << 1 ^ (t >>> 7) * 285, t ^= (n >>> i & 1) * e;
|
|
521
|
-
return
|
|
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
526
|
const n = e[1];
|
|
527
|
-
|
|
527
|
+
d(n <= this.size * 3);
|
|
528
528
|
const t = n > 0 && e[2] == n && e[3] == n * 3 && e[4] == n && e[5] == n;
|
|
529
529
|
return (t && e[0] >= n * 4 && e[6] >= n ? 1 : 0) + (t && e[6] >= n * 4 && e[0] >= n ? 1 : 0);
|
|
530
530
|
}
|
|
@@ -537,7 +537,7 @@ var X;
|
|
|
537
537
|
n[0] == 0 && (e += this.size), n.pop(), n.unshift(e);
|
|
538
538
|
}
|
|
539
539
|
};
|
|
540
|
-
|
|
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
|
-
],
|
|
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,21 +559,21 @@ 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 =
|
|
563
|
-
function
|
|
564
|
-
if (e < 0 || e > 31 ||
|
|
562
|
+
], o.QrCode = r;
|
|
563
|
+
function s(m, e, n) {
|
|
564
|
+
if (e < 0 || e > 31 || m >>> e)
|
|
565
565
|
throw new RangeError("Value out of range");
|
|
566
566
|
for (let t = e - 1; t >= 0; t--)
|
|
567
|
-
n.push(
|
|
567
|
+
n.push(m >>> t & 1);
|
|
568
568
|
}
|
|
569
|
-
function
|
|
570
|
-
return (
|
|
569
|
+
function a(m, e) {
|
|
570
|
+
return (m >>> e & 1) != 0;
|
|
571
571
|
}
|
|
572
|
-
function
|
|
573
|
-
if (!
|
|
572
|
+
function d(m) {
|
|
573
|
+
if (!m)
|
|
574
574
|
throw new Error("Assertion error");
|
|
575
575
|
}
|
|
576
|
-
const
|
|
576
|
+
const c = class A {
|
|
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,
|
|
@@ -590,37 +590,37 @@ var X;
|
|
|
590
590
|
static makeBytes(e) {
|
|
591
591
|
let n = [];
|
|
592
592
|
for (const t of e)
|
|
593
|
-
|
|
594
|
-
return new
|
|
593
|
+
s(t, 8, n);
|
|
594
|
+
return new A(A.Mode.BYTE, e.length, n);
|
|
595
595
|
}
|
|
596
596
|
// Returns a segment representing the given string of decimal digits encoded in numeric mode.
|
|
597
597
|
static makeNumeric(e) {
|
|
598
|
-
if (!
|
|
598
|
+
if (!A.isNumeric(e))
|
|
599
599
|
throw new RangeError("String contains non-numeric characters");
|
|
600
600
|
let n = [];
|
|
601
601
|
for (let t = 0; t < e.length; ) {
|
|
602
602
|
const i = Math.min(e.length - t, 3);
|
|
603
|
-
|
|
603
|
+
s(parseInt(e.substring(t, t + i), 10), i * 3 + 1, n), t += i;
|
|
604
604
|
}
|
|
605
|
-
return new
|
|
605
|
+
return new A(A.Mode.NUMERIC, e.length, n);
|
|
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,
|
|
609
609
|
// dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
610
610
|
static makeAlphanumeric(e) {
|
|
611
|
-
if (!
|
|
611
|
+
if (!A.isAlphanumeric(e))
|
|
612
612
|
throw new RangeError("String contains unencodable characters in alphanumeric mode");
|
|
613
613
|
let n = [], t;
|
|
614
614
|
for (t = 0; t + 2 <= e.length; t += 2) {
|
|
615
|
-
let i =
|
|
616
|
-
i +=
|
|
615
|
+
let i = A.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)) * 45;
|
|
616
|
+
i += A.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t + 1)), s(i, 11, n);
|
|
617
617
|
}
|
|
618
|
-
return t < e.length &&
|
|
618
|
+
return t < e.length && s(A.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)), 6, n), new A(A.Mode.ALPHANUMERIC, e.length, n);
|
|
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.
|
|
622
622
|
static makeSegments(e) {
|
|
623
|
-
return e == "" ? [] :
|
|
623
|
+
return e == "" ? [] : A.isNumeric(e) ? [A.makeNumeric(e)] : A.isAlphanumeric(e) ? [A.makeAlphanumeric(e)] : [A.makeBytes(A.toUtf8ByteArray(e))];
|
|
624
624
|
}
|
|
625
625
|
// Returns a segment representing an Extended Channel Interpretation
|
|
626
626
|
// (ECI) designator with the given assignment value.
|
|
@@ -629,25 +629,25 @@ var X;
|
|
|
629
629
|
if (e < 0)
|
|
630
630
|
throw new RangeError("ECI assignment value out of range");
|
|
631
631
|
if (e < 128)
|
|
632
|
-
|
|
632
|
+
s(e, 8, n);
|
|
633
633
|
else if (e < 16384)
|
|
634
|
-
|
|
634
|
+
s(2, 2, n), s(e, 14, n);
|
|
635
635
|
else if (e < 1e6)
|
|
636
|
-
|
|
636
|
+
s(6, 3, n), s(e, 21, n);
|
|
637
637
|
else
|
|
638
638
|
throw new RangeError("ECI assignment value out of range");
|
|
639
|
-
return new
|
|
639
|
+
return new A(A.Mode.ECI, 0, n);
|
|
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.
|
|
643
643
|
static isNumeric(e) {
|
|
644
|
-
return
|
|
644
|
+
return A.NUMERIC_REGEX.test(e);
|
|
645
645
|
}
|
|
646
646
|
// Tests whether the given string can be encoded as a segment in alphanumeric mode.
|
|
647
647
|
// A string is encodable iff each character is in the following set: 0 to 9, A to Z
|
|
648
648
|
// (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
649
649
|
static isAlphanumeric(e) {
|
|
650
|
-
return
|
|
650
|
+
return A.ALPHANUMERIC_REGEX.test(e);
|
|
651
651
|
}
|
|
652
652
|
/*-- Methods --*/
|
|
653
653
|
// Returns a new copy of the data bits of this segment.
|
|
@@ -659,10 +659,10 @@ var X;
|
|
|
659
659
|
static getTotalBits(e, n) {
|
|
660
660
|
let t = 0;
|
|
661
661
|
for (const i of e) {
|
|
662
|
-
const
|
|
663
|
-
if (i.numChars >= 1 <<
|
|
662
|
+
const l = i.mode.numCharCountBits(n);
|
|
663
|
+
if (i.numChars >= 1 << l)
|
|
664
664
|
return 1 / 0;
|
|
665
|
-
t += 4 +
|
|
665
|
+
t += 4 + l + i.bitData.length;
|
|
666
666
|
}
|
|
667
667
|
return t;
|
|
668
668
|
}
|
|
@@ -675,152 +675,152 @@ var X;
|
|
|
675
675
|
return n;
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
|
|
679
|
-
let f =
|
|
680
|
-
o.QrSegment =
|
|
681
|
-
})(
|
|
678
|
+
c.NUMERIC_REGEX = /^[0-9]*$/, c.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, c.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
679
|
+
let f = c;
|
|
680
|
+
o.QrSegment = c;
|
|
681
|
+
})(K || (K = {}));
|
|
682
682
|
((o) => {
|
|
683
|
-
((
|
|
684
|
-
const
|
|
683
|
+
((r) => {
|
|
684
|
+
const s = class {
|
|
685
685
|
// The QR Code can tolerate about 30% erroneous codewords
|
|
686
686
|
/*-- Constructor and fields --*/
|
|
687
|
-
constructor(
|
|
688
|
-
this.ordinal =
|
|
687
|
+
constructor(d, c) {
|
|
688
|
+
this.ordinal = d, this.formatBits = c;
|
|
689
689
|
}
|
|
690
690
|
};
|
|
691
|
-
|
|
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
692
|
})(o.QrCode || (o.QrCode = {}));
|
|
693
|
-
})(
|
|
693
|
+
})(K || (K = {}));
|
|
694
694
|
((o) => {
|
|
695
|
-
((
|
|
696
|
-
const
|
|
695
|
+
((r) => {
|
|
696
|
+
const s = class {
|
|
697
697
|
/*-- Constructor and fields --*/
|
|
698
|
-
constructor(
|
|
699
|
-
this.modeBits =
|
|
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(
|
|
705
|
-
return this.numBitsCharCount[Math.floor((
|
|
704
|
+
numCharCountBits(d) {
|
|
705
|
+
return this.numBitsCharCount[Math.floor((d + 7) / 17)];
|
|
706
706
|
}
|
|
707
707
|
};
|
|
708
|
-
|
|
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
709
|
})(o.QrSegment || (o.QrSegment = {}));
|
|
710
|
-
})(
|
|
711
|
-
var
|
|
712
|
-
var
|
|
713
|
-
L:
|
|
714
|
-
M:
|
|
715
|
-
Q:
|
|
716
|
-
H:
|
|
717
|
-
},
|
|
718
|
-
function
|
|
719
|
-
const
|
|
720
|
-
return o.forEach(function(
|
|
721
|
-
let
|
|
722
|
-
|
|
723
|
-
if (!f &&
|
|
724
|
-
|
|
725
|
-
`M${
|
|
726
|
-
),
|
|
710
|
+
})(K || (K = {}));
|
|
711
|
+
var q = K;
|
|
712
|
+
var Rt = {
|
|
713
|
+
L: q.QrCode.Ecc.LOW,
|
|
714
|
+
M: q.QrCode.Ecc.MEDIUM,
|
|
715
|
+
Q: q.QrCode.Ecc.QUARTILE,
|
|
716
|
+
H: q.QrCode.Ecc.HIGH
|
|
717
|
+
}, Pe = 128, De = "L", Te = "#FFFFFF", Oe = "#000000", Le = !1, ke = 1, yt = 4, Mt = 0, bt = 0.1;
|
|
718
|
+
function Be(o, r = 0) {
|
|
719
|
+
const s = [];
|
|
720
|
+
return o.forEach(function(a, d) {
|
|
721
|
+
let c = null;
|
|
722
|
+
a.forEach(function(f, m) {
|
|
723
|
+
if (!f && c !== null) {
|
|
724
|
+
s.push(
|
|
725
|
+
`M${c + r} ${d + r}h${m - c}v1H${c + r}z`
|
|
726
|
+
), c = null;
|
|
727
727
|
return;
|
|
728
728
|
}
|
|
729
|
-
if (
|
|
729
|
+
if (m === a.length - 1) {
|
|
730
730
|
if (!f)
|
|
731
731
|
return;
|
|
732
|
-
|
|
733
|
-
`M${
|
|
732
|
+
c === null ? s.push(`M${m + r},${d + r} h1v1H${m + r}z`) : s.push(
|
|
733
|
+
`M${c + r},${d + r} h${m + 1 - c}v1H${c + r}z`
|
|
734
734
|
);
|
|
735
735
|
return;
|
|
736
736
|
}
|
|
737
|
-
f &&
|
|
737
|
+
f && c === null && (c = m);
|
|
738
738
|
});
|
|
739
|
-
}),
|
|
739
|
+
}), s.join("");
|
|
740
740
|
}
|
|
741
|
-
function
|
|
742
|
-
return o.slice().map((
|
|
741
|
+
function Fe(o, r) {
|
|
742
|
+
return o.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
|
|
745
|
-
if (
|
|
744
|
+
function At(o, r, s, a) {
|
|
745
|
+
if (a == null)
|
|
746
746
|
return null;
|
|
747
|
-
const
|
|
748
|
-
let
|
|
749
|
-
if (
|
|
750
|
-
let u = Math.floor(n), E = Math.floor(t), g = Math.ceil(
|
|
751
|
-
|
|
747
|
+
const d = o.length + s * 2, c = Math.floor(r * bt), f = d / r, m = (a.width || c) * f, e = (a.height || c) * f, n = a.x == null ? o.length / 2 - m / 2 : a.x * f, t = a.y == null ? o.length / 2 - e / 2 : a.y * f, i = a.opacity == null ? 1 : a.opacity;
|
|
748
|
+
let l = null;
|
|
749
|
+
if (a.excavate) {
|
|
750
|
+
let u = Math.floor(n), E = Math.floor(t), g = Math.ceil(m + n - u), R = Math.ceil(e + t - E);
|
|
751
|
+
l = { x: u, y: E, w: g, h: R };
|
|
752
752
|
}
|
|
753
|
-
const
|
|
754
|
-
return { x: n, y: t, h: e, w:
|
|
753
|
+
const p = a.crossOrigin;
|
|
754
|
+
return { x: n, y: t, h: e, w: m, excavation: l, opacity: i, crossOrigin: p };
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
return
|
|
756
|
+
function It(o, r) {
|
|
757
|
+
return r != null ? Math.max(Math.floor(r), 0) : o ? yt : Mt;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function Ue({
|
|
760
760
|
value: o,
|
|
761
|
-
level:
|
|
762
|
-
minVersion:
|
|
763
|
-
includeMargin:
|
|
764
|
-
marginSize:
|
|
765
|
-
imageSettings:
|
|
761
|
+
level: r,
|
|
762
|
+
minVersion: s,
|
|
763
|
+
includeMargin: a,
|
|
764
|
+
marginSize: d,
|
|
765
|
+
imageSettings: c,
|
|
766
766
|
size: f,
|
|
767
|
-
boostLevel:
|
|
767
|
+
boostLevel: m
|
|
768
768
|
}) {
|
|
769
|
-
let e =
|
|
770
|
-
const u = (Array.isArray(o) ? o : [o]).reduce((E, g) => (E.push(...
|
|
771
|
-
return
|
|
769
|
+
let e = D.useMemo(() => {
|
|
770
|
+
const u = (Array.isArray(o) ? o : [o]).reduce((E, g) => (E.push(...q.QrSegment.makeSegments(g)), E), []);
|
|
771
|
+
return q.QrCode.encodeSegments(
|
|
772
772
|
u,
|
|
773
|
-
|
|
774
|
-
|
|
773
|
+
Rt[r],
|
|
774
|
+
s,
|
|
775
775
|
void 0,
|
|
776
776
|
void 0,
|
|
777
|
-
|
|
777
|
+
m
|
|
778
778
|
);
|
|
779
|
-
}, [o,
|
|
780
|
-
const { cells: n, margin: t, numCells: i, calculatedImageSettings:
|
|
781
|
-
let
|
|
782
|
-
const u =
|
|
783
|
-
|
|
779
|
+
}, [o, r, s, m]);
|
|
780
|
+
const { cells: n, margin: t, numCells: i, calculatedImageSettings: l } = D.useMemo(() => {
|
|
781
|
+
let p = e.getModules();
|
|
782
|
+
const u = It(a, d), E = p.length + u * 2, g = At(
|
|
783
|
+
p,
|
|
784
784
|
f,
|
|
785
785
|
u,
|
|
786
|
-
|
|
786
|
+
c
|
|
787
787
|
);
|
|
788
788
|
return {
|
|
789
|
-
cells:
|
|
789
|
+
cells: p,
|
|
790
790
|
margin: u,
|
|
791
791
|
numCells: E,
|
|
792
792
|
calculatedImageSettings: g
|
|
793
793
|
};
|
|
794
|
-
}, [e, f,
|
|
794
|
+
}, [e, f, c, a, d]);
|
|
795
795
|
return {
|
|
796
796
|
qrcode: e,
|
|
797
797
|
margin: t,
|
|
798
798
|
cells: n,
|
|
799
799
|
numCells: i,
|
|
800
|
-
calculatedImageSettings:
|
|
800
|
+
calculatedImageSettings: l
|
|
801
801
|
};
|
|
802
802
|
}
|
|
803
|
-
var
|
|
803
|
+
var St = (function() {
|
|
804
804
|
try {
|
|
805
805
|
new Path2D().addPath(new Path2D());
|
|
806
806
|
} catch {
|
|
807
807
|
return !1;
|
|
808
808
|
}
|
|
809
809
|
return !0;
|
|
810
|
-
})(),
|
|
811
|
-
function(
|
|
812
|
-
const
|
|
813
|
-
value:
|
|
814
|
-
size:
|
|
815
|
-
level: f =
|
|
816
|
-
bgColor:
|
|
817
|
-
fgColor: e =
|
|
818
|
-
includeMargin: n =
|
|
819
|
-
minVersion: t =
|
|
810
|
+
})(), xt = D.forwardRef(
|
|
811
|
+
function(r, s) {
|
|
812
|
+
const a = r, {
|
|
813
|
+
value: d,
|
|
814
|
+
size: c = Pe,
|
|
815
|
+
level: f = De,
|
|
816
|
+
bgColor: m = Te,
|
|
817
|
+
fgColor: e = Oe,
|
|
818
|
+
includeMargin: n = Le,
|
|
819
|
+
minVersion: t = ke,
|
|
820
820
|
boostLevel: i,
|
|
821
|
-
marginSize:
|
|
822
|
-
imageSettings:
|
|
823
|
-
} =
|
|
821
|
+
marginSize: l,
|
|
822
|
+
imageSettings: p
|
|
823
|
+
} = a, E = Ce(a, [
|
|
824
824
|
"value",
|
|
825
825
|
"size",
|
|
826
826
|
"level",
|
|
@@ -831,92 +831,92 @@ var At = (function() {
|
|
|
831
831
|
"boostLevel",
|
|
832
832
|
"marginSize",
|
|
833
833
|
"imageSettings"
|
|
834
|
-
]), { style: g } = E,
|
|
835
|
-
(
|
|
836
|
-
C.current =
|
|
834
|
+
]), { style: g } = E, R = Ce(E, ["style"]), N = p?.src, C = D.useRef(null), v = D.useRef(null), I = D.useCallback(
|
|
835
|
+
(Y) => {
|
|
836
|
+
C.current = Y, typeof s == "function" ? s(Y) : s && (s.current = Y);
|
|
837
837
|
},
|
|
838
|
-
[
|
|
839
|
-
), [
|
|
840
|
-
value:
|
|
838
|
+
[s]
|
|
839
|
+
), [T, b] = D.useState(!1), { margin: L, cells: H, numCells: Q, calculatedImageSettings: x } = Ue({
|
|
840
|
+
value: d,
|
|
841
841
|
level: f,
|
|
842
842
|
minVersion: t,
|
|
843
843
|
boostLevel: i,
|
|
844
844
|
includeMargin: n,
|
|
845
|
-
marginSize:
|
|
846
|
-
imageSettings:
|
|
847
|
-
size:
|
|
845
|
+
marginSize: l,
|
|
846
|
+
imageSettings: p,
|
|
847
|
+
size: c
|
|
848
848
|
});
|
|
849
|
-
|
|
849
|
+
D.useEffect(() => {
|
|
850
850
|
if (C.current != null) {
|
|
851
|
-
const
|
|
852
|
-
if (!
|
|
851
|
+
const Y = C.current, y = Y.getContext("2d");
|
|
852
|
+
if (!y)
|
|
853
853
|
return;
|
|
854
|
-
let
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
854
|
+
let S = H;
|
|
855
|
+
const P = v.current, F = x != null && P !== null && P.complete && P.naturalHeight !== 0 && P.naturalWidth !== 0;
|
|
856
|
+
F && x.excavation != null && (S = Fe(
|
|
857
|
+
H,
|
|
858
|
+
x.excavation
|
|
859
859
|
));
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
860
|
+
const W = window.devicePixelRatio || 1;
|
|
861
|
+
Y.height = Y.width = c * W;
|
|
862
|
+
const Z = c / Q * W;
|
|
863
|
+
y.scale(Z, Z), y.fillStyle = m, y.fillRect(0, 0, Q, Q), y.fillStyle = e, St ? y.fill(new Path2D(Be(S, L))) : H.forEach(function(de, re) {
|
|
864
|
+
de.forEach(function(ue, he) {
|
|
865
|
+
ue && y.fillRect(he + L, re + L, 1, 1);
|
|
866
866
|
});
|
|
867
|
-
}),
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
867
|
+
}), x && (y.globalAlpha = x.opacity), F && y.drawImage(
|
|
868
|
+
P,
|
|
869
|
+
x.x + L,
|
|
870
|
+
x.y + L,
|
|
871
|
+
x.w,
|
|
872
|
+
x.h
|
|
873
873
|
);
|
|
874
874
|
}
|
|
875
|
-
}),
|
|
876
|
-
|
|
875
|
+
}), D.useEffect(() => {
|
|
876
|
+
b(!1);
|
|
877
877
|
}, [N]);
|
|
878
|
-
const
|
|
879
|
-
let
|
|
880
|
-
return N != null && (
|
|
878
|
+
const G = ge({ height: c, width: c }, g);
|
|
879
|
+
let V = null;
|
|
880
|
+
return N != null && (V = /* @__PURE__ */ D.createElement(
|
|
881
881
|
"img",
|
|
882
882
|
{
|
|
883
883
|
src: N,
|
|
884
884
|
key: N,
|
|
885
885
|
style: { display: "none" },
|
|
886
886
|
onLoad: () => {
|
|
887
|
-
|
|
887
|
+
b(!0);
|
|
888
888
|
},
|
|
889
|
-
ref:
|
|
890
|
-
crossOrigin:
|
|
889
|
+
ref: v,
|
|
890
|
+
crossOrigin: x?.crossOrigin
|
|
891
891
|
}
|
|
892
|
-
)), /* @__PURE__ */
|
|
892
|
+
)), /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement(
|
|
893
893
|
"canvas",
|
|
894
|
-
|
|
895
|
-
style:
|
|
896
|
-
height:
|
|
897
|
-
width:
|
|
898
|
-
ref:
|
|
894
|
+
ge({
|
|
895
|
+
style: G,
|
|
896
|
+
height: c,
|
|
897
|
+
width: c,
|
|
898
|
+
ref: I,
|
|
899
899
|
role: "img"
|
|
900
|
-
},
|
|
901
|
-
),
|
|
900
|
+
}, R)
|
|
901
|
+
), V);
|
|
902
902
|
}
|
|
903
903
|
);
|
|
904
|
-
|
|
905
|
-
var
|
|
906
|
-
function(
|
|
907
|
-
const
|
|
908
|
-
value:
|
|
909
|
-
size:
|
|
910
|
-
level: f =
|
|
911
|
-
bgColor:
|
|
912
|
-
fgColor: e =
|
|
913
|
-
includeMargin: n =
|
|
914
|
-
minVersion: t =
|
|
904
|
+
xt.displayName = "QRCodeCanvas";
|
|
905
|
+
var ze = D.forwardRef(
|
|
906
|
+
function(r, s) {
|
|
907
|
+
const a = r, {
|
|
908
|
+
value: d,
|
|
909
|
+
size: c = Pe,
|
|
910
|
+
level: f = De,
|
|
911
|
+
bgColor: m = Te,
|
|
912
|
+
fgColor: e = Oe,
|
|
913
|
+
includeMargin: n = Le,
|
|
914
|
+
minVersion: t = ke,
|
|
915
915
|
boostLevel: i,
|
|
916
|
-
title:
|
|
917
|
-
marginSize:
|
|
916
|
+
title: l,
|
|
917
|
+
marginSize: p,
|
|
918
918
|
imageSettings: u
|
|
919
|
-
} =
|
|
919
|
+
} = a, E = Ce(a, [
|
|
920
920
|
"value",
|
|
921
921
|
"size",
|
|
922
922
|
"level",
|
|
@@ -928,21 +928,21 @@ var ke = x.forwardRef(
|
|
|
928
928
|
"title",
|
|
929
929
|
"marginSize",
|
|
930
930
|
"imageSettings"
|
|
931
|
-
]), { margin: g, cells:
|
|
932
|
-
value:
|
|
931
|
+
]), { margin: g, cells: R, numCells: N, calculatedImageSettings: C } = Ue({
|
|
932
|
+
value: d,
|
|
933
933
|
level: f,
|
|
934
934
|
minVersion: t,
|
|
935
935
|
boostLevel: i,
|
|
936
936
|
includeMargin: n,
|
|
937
|
-
marginSize:
|
|
937
|
+
marginSize: p,
|
|
938
938
|
imageSettings: u,
|
|
939
|
-
size:
|
|
939
|
+
size: c
|
|
940
940
|
});
|
|
941
|
-
let
|
|
942
|
-
u != null && C != null && (C.excavation != null && (
|
|
943
|
-
|
|
941
|
+
let v = R, I = null;
|
|
942
|
+
u != null && C != null && (C.excavation != null && (v = Fe(
|
|
943
|
+
R,
|
|
944
944
|
C.excavation
|
|
945
|
-
)),
|
|
945
|
+
)), I = /* @__PURE__ */ D.createElement(
|
|
946
946
|
"image",
|
|
947
947
|
{
|
|
948
948
|
href: u.src,
|
|
@@ -955,249 +955,273 @@ var ke = x.forwardRef(
|
|
|
955
955
|
crossOrigin: C.crossOrigin
|
|
956
956
|
}
|
|
957
957
|
));
|
|
958
|
-
const
|
|
959
|
-
return /* @__PURE__ */
|
|
958
|
+
const T = Be(v, g);
|
|
959
|
+
return /* @__PURE__ */ D.createElement(
|
|
960
960
|
"svg",
|
|
961
|
-
|
|
962
|
-
height:
|
|
963
|
-
width:
|
|
961
|
+
ge({
|
|
962
|
+
height: c,
|
|
963
|
+
width: c,
|
|
964
964
|
viewBox: `0 0 ${N} ${N}`,
|
|
965
|
-
ref:
|
|
965
|
+
ref: s,
|
|
966
966
|
role: "img"
|
|
967
967
|
}, E),
|
|
968
|
-
!!
|
|
969
|
-
/* @__PURE__ */
|
|
968
|
+
!!l && /* @__PURE__ */ D.createElement("title", null, l),
|
|
969
|
+
/* @__PURE__ */ D.createElement(
|
|
970
970
|
"path",
|
|
971
971
|
{
|
|
972
|
-
fill:
|
|
972
|
+
fill: m,
|
|
973
973
|
d: `M0,0 h${N}v${N}H0z`,
|
|
974
974
|
shapeRendering: "crispEdges"
|
|
975
975
|
}
|
|
976
976
|
),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
|
|
977
|
+
/* @__PURE__ */ D.createElement("path", { fill: e, d: T, shapeRendering: "crispEdges" }),
|
|
978
|
+
I
|
|
979
979
|
);
|
|
980
980
|
}
|
|
981
981
|
);
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
invitationType:
|
|
982
|
+
ze.displayName = "QRCodeSVG";
|
|
983
|
+
const Pt = (o, r) => ({
|
|
984
|
+
invitationType: rt.LINK,
|
|
985
985
|
resources: [
|
|
986
986
|
{
|
|
987
987
|
url: `conversations/${encodeURI(o)}`
|
|
988
988
|
},
|
|
989
|
-
...
|
|
989
|
+
...r
|
|
990
990
|
]
|
|
991
|
-
}),
|
|
992
|
-
const
|
|
993
|
-
return `/${
|
|
994
|
-
},
|
|
995
|
-
const
|
|
996
|
-
return
|
|
997
|
-
}),
|
|
998
|
-
(
|
|
999
|
-
)?.flatMap((
|
|
1000
|
-
url:
|
|
1001
|
-
})) || [])?.filter((
|
|
991
|
+
}), Dt = (o) => {
|
|
992
|
+
const r = o?.invitationLink?.split("/").at(-1) || "";
|
|
993
|
+
return `/${be}/${r}`;
|
|
994
|
+
}, Tt = (o, r) => r?.find((s) => {
|
|
995
|
+
const a = o?.id?.split("/")?.pop(), d = s?.url?.split("/")?.pop() || "";
|
|
996
|
+
return d === a || decodeURI(d) === a;
|
|
997
|
+
}), Ot = (o) => o?.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) || [], Lt = ({
|
|
1002
1002
|
conversation: o,
|
|
1003
|
-
locale:
|
|
1004
|
-
onCloseModal:
|
|
1005
|
-
modalDividers:
|
|
1006
|
-
getConversation:
|
|
1007
|
-
generateConversationLink:
|
|
1003
|
+
locale: r,
|
|
1004
|
+
onCloseModal: s,
|
|
1005
|
+
modalDividers: a,
|
|
1006
|
+
getConversation: d,
|
|
1007
|
+
generateConversationLink: c,
|
|
1008
1008
|
chatExpiration: f,
|
|
1009
|
-
chatExpirationDays:
|
|
1009
|
+
chatExpirationDays: m,
|
|
1010
1010
|
close: e,
|
|
1011
1011
|
chatWarning: n,
|
|
1012
1012
|
shareLink: t,
|
|
1013
1013
|
shareCopyLink: i,
|
|
1014
|
-
shareCopiedLink:
|
|
1015
|
-
shareDescription:
|
|
1014
|
+
shareCopiedLink: l,
|
|
1015
|
+
shareDescription: p,
|
|
1016
1016
|
shareRemoveAccessToUsers: u,
|
|
1017
1017
|
chatName: E,
|
|
1018
1018
|
getSharedConversations: g,
|
|
1019
|
-
revokeSharedConversations:
|
|
1019
|
+
revokeSharedConversations: R,
|
|
1020
1020
|
baseUrl: N,
|
|
1021
1021
|
id: C,
|
|
1022
|
-
clientSharedPage:
|
|
1023
|
-
clientSharedProp:
|
|
1022
|
+
clientSharedPage: v,
|
|
1023
|
+
clientSharedProp: I
|
|
1024
1024
|
}) => {
|
|
1025
|
-
const [
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1025
|
+
const [T, b] = k(null), [L, H] = k(), [Q, x] = k(!1), [G, V] = k(!1), [Y, y] = k(), S = me(null), P = me(null), F = X(() => o?.id ? decodeURI(o.id) : C?.[0] && C?.[1] && r ? decodeURI(`${C[0]}/${r}/${C[1]}`) : null, [o?.id, C, r]), W = X(() => {
|
|
1026
|
+
if (!T)
|
|
1027
|
+
return "";
|
|
1028
|
+
const z = N || window.location.origin;
|
|
1029
|
+
if (N && N !== window.location.origin && v && I) {
|
|
1030
|
+
const ee = T.split(
|
|
1031
|
+
`/${be}/`
|
|
1032
|
+
)?.[1];
|
|
1033
|
+
return `${z}/${v}?${I}=${ee}`;
|
|
1030
1034
|
}
|
|
1031
|
-
return `${
|
|
1032
|
-
}, [N,
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1035
|
+
return `${z}/${r}${T}`;
|
|
1036
|
+
}, [N, T, r, v, I]), Z = O(
|
|
1037
|
+
async (z) => {
|
|
1038
|
+
const ee = await g?.(
|
|
1039
|
+
se(ie.OTHERS)
|
|
1040
|
+
);
|
|
1041
|
+
if (ee)
|
|
1042
|
+
return Tt(
|
|
1043
|
+
{ id: z },
|
|
1044
|
+
ee.resources
|
|
1041
1045
|
);
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1046
|
+
},
|
|
1047
|
+
[g]
|
|
1048
|
+
);
|
|
1049
|
+
ne(() => {
|
|
1050
|
+
if (!F || S.current === F)
|
|
1051
|
+
return;
|
|
1052
|
+
S.current = F, x(!1), P.current?.abort();
|
|
1053
|
+
const z = new AbortController();
|
|
1054
|
+
return P.current = z, (async () => {
|
|
1055
|
+
try {
|
|
1056
|
+
const pe = await d?.(F), $e = Pt(
|
|
1057
|
+
F,
|
|
1058
|
+
Ot(pe)
|
|
1059
|
+
), we = await c?.($e), He = await Z(F);
|
|
1060
|
+
if (z.signal.aborted || !we)
|
|
1061
|
+
return;
|
|
1062
|
+
b(Dt(we)), H(He), x(!0);
|
|
1063
|
+
} catch (pe) {
|
|
1064
|
+
if (z.signal.aborted)
|
|
1065
|
+
return;
|
|
1066
|
+
x(!1), console.error("Error sharing conversation", pe);
|
|
1050
1067
|
}
|
|
1051
|
-
})()
|
|
1068
|
+
})(), () => {
|
|
1069
|
+
z.abort(), S.current = null;
|
|
1070
|
+
};
|
|
1052
1071
|
}, [
|
|
1053
|
-
|
|
1054
|
-
d,
|
|
1072
|
+
F,
|
|
1055
1073
|
c,
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
s
|
|
1074
|
+
d,
|
|
1075
|
+
Z
|
|
1059
1076
|
]);
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
}, [
|
|
1063
|
-
|
|
1064
|
-
}, [
|
|
1077
|
+
const de = O(() => {
|
|
1078
|
+
P.current?.abort(), S.current = null, s(), b(null), x(!1), V(!1);
|
|
1079
|
+
}, [s]), re = O(() => {
|
|
1080
|
+
V(!0), navigator.clipboard.writeText(W || "");
|
|
1081
|
+
}, [W]), ue = async () => {
|
|
1065
1082
|
try {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1083
|
+
if (y(!0), L && await R?.({
|
|
1084
|
+
resources: [L]
|
|
1085
|
+
}), F) {
|
|
1086
|
+
const z = await Z(F);
|
|
1087
|
+
P.current?.signal.aborted || H(z);
|
|
1088
|
+
}
|
|
1089
|
+
} catch (z) {
|
|
1090
|
+
console.error("Error revoking shared conversation", z);
|
|
1091
|
+
} finally {
|
|
1092
|
+
P.current?.signal.aborted || y(!1);
|
|
1069
1093
|
}
|
|
1070
|
-
},
|
|
1071
|
-
|
|
1094
|
+
}, he = O(() => /* @__PURE__ */ h(
|
|
1095
|
+
j,
|
|
1072
1096
|
{
|
|
1073
|
-
buttonClassName:
|
|
1074
|
-
iconBefore:
|
|
1075
|
-
title:
|
|
1076
|
-
disabled:
|
|
1077
|
-
onClick:
|
|
1097
|
+
buttonClassName: G ? "text-button-secondary" : "text-button-primary",
|
|
1098
|
+
iconBefore: G ? /* @__PURE__ */ h(Xe, { width: 20, height: 20 }) : /* @__PURE__ */ h(Ke, { width: 20, height: 20 }),
|
|
1099
|
+
title: G ? l ?? "Copied" : i ?? "Copy link",
|
|
1100
|
+
disabled: G,
|
|
1101
|
+
onClick: re
|
|
1078
1102
|
}
|
|
1079
|
-
), [
|
|
1080
|
-
return /* @__PURE__ */
|
|
1081
|
-
|
|
1103
|
+
), [G, re, l, i]);
|
|
1104
|
+
return /* @__PURE__ */ M(
|
|
1105
|
+
le,
|
|
1082
1106
|
{
|
|
1083
1107
|
heading: t ?? "Share link",
|
|
1084
1108
|
portalId: "share",
|
|
1085
|
-
size:
|
|
1086
|
-
dividers:
|
|
1087
|
-
onClose:
|
|
1109
|
+
size: ce.SM,
|
|
1110
|
+
dividers: a,
|
|
1111
|
+
onClose: de,
|
|
1088
1112
|
closeButtonTitle: e ?? "Close",
|
|
1089
1113
|
children: [
|
|
1090
|
-
|
|
1091
|
-
o?.name ? /* @__PURE__ */
|
|
1092
|
-
/* @__PURE__ */
|
|
1093
|
-
/* @__PURE__ */
|
|
1114
|
+
Q ? /* @__PURE__ */ M("div", { className: "share flex flex-col gap-y-4 overflow-auto px-6 pb-6 sm:p-0", children: [
|
|
1115
|
+
o?.name ? /* @__PURE__ */ M("div", { className: "share-info flex w-full", children: [
|
|
1116
|
+
/* @__PURE__ */ h("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: E ?? "Chat name:" }),
|
|
1117
|
+
/* @__PURE__ */ h(
|
|
1094
1118
|
"h3",
|
|
1095
1119
|
{
|
|
1096
|
-
className: "
|
|
1120
|
+
className: "min-w-0 flex-1 truncate",
|
|
1097
1121
|
title: o?.name,
|
|
1098
1122
|
children: o?.name
|
|
1099
1123
|
}
|
|
1100
1124
|
)
|
|
1101
1125
|
] }) : null,
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ M("div", { className: "share-info flex", children: [
|
|
1127
|
+
/* @__PURE__ */ h("p", { className: "share-info-title body-1 mr-1 text-neutrals-800", children: f ?? "Link expiration date:" }),
|
|
1128
|
+
/* @__PURE__ */ M("h3", { children: [
|
|
1105
1129
|
"3 ",
|
|
1106
|
-
|
|
1130
|
+
m ?? "days"
|
|
1107
1131
|
] })
|
|
1108
1132
|
] }),
|
|
1109
|
-
/* @__PURE__ */
|
|
1110
|
-
|
|
1133
|
+
/* @__PURE__ */ h(
|
|
1134
|
+
ze,
|
|
1111
1135
|
{
|
|
1112
|
-
className: "self-center border border-neutrals-600 p-2
|
|
1113
|
-
value:
|
|
1136
|
+
className: "min-h-[200px] self-center rounded border border-neutrals-600 p-2",
|
|
1137
|
+
value: W,
|
|
1114
1138
|
size: 200
|
|
1115
1139
|
}
|
|
1116
1140
|
),
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
|
|
1141
|
+
/* @__PURE__ */ h("p", { className: "body-2 text-neutrals-1000", children: p ?? "Your name, special instructions, and any messages you add after sharing remain confidential." }),
|
|
1142
|
+
/* @__PURE__ */ h(
|
|
1143
|
+
ye,
|
|
1120
1144
|
{
|
|
1121
1145
|
containerClasses: "share-input-container",
|
|
1122
1146
|
cssClass: "share-input",
|
|
1123
1147
|
readonly: !0,
|
|
1124
|
-
placeholder:
|
|
1125
|
-
value:
|
|
1148
|
+
placeholder: W,
|
|
1149
|
+
value: W,
|
|
1126
1150
|
inputId: "conversationLink",
|
|
1127
|
-
iconAfterInput:
|
|
1151
|
+
iconAfterInput: he()
|
|
1128
1152
|
}
|
|
1129
1153
|
)
|
|
1130
|
-
] }) : /* @__PURE__ */
|
|
1131
|
-
|
|
1132
|
-
|
|
1154
|
+
] }) : /* @__PURE__ */ h("div", { className: "flex items-center justify-center p-6", children: /* @__PURE__ */ h(Re, {}) }),
|
|
1155
|
+
Q ? o && L ? /* @__PURE__ */ h("div", { className: "remove-access", children: /* @__PURE__ */ h(
|
|
1156
|
+
j,
|
|
1133
1157
|
{
|
|
1134
1158
|
title: u ?? "Remove access to all users",
|
|
1135
1159
|
buttonClassName: "remove-access-button py-3 px-4",
|
|
1136
1160
|
isSmallButton: !0,
|
|
1137
|
-
disabled:
|
|
1138
|
-
onClick:
|
|
1161
|
+
disabled: Y,
|
|
1162
|
+
onClick: ue
|
|
1139
1163
|
}
|
|
1140
|
-
) }) : /* @__PURE__ */
|
|
1164
|
+
) }) : /* @__PURE__ */ h("p", { className: "body-2 share-footer text-neutrals-800", children: n ?? "This chat has not been shared with anyone yet." }) : /* @__PURE__ */ h("div", {})
|
|
1141
1165
|
]
|
|
1142
1166
|
}
|
|
1143
1167
|
);
|
|
1144
|
-
},
|
|
1168
|
+
}, kt = ({
|
|
1145
1169
|
conversation: o,
|
|
1146
|
-
onCloseModal:
|
|
1147
|
-
renameConversation:
|
|
1148
|
-
locale:
|
|
1149
|
-
disableModalDividers:
|
|
1150
|
-
titles:
|
|
1170
|
+
onCloseModal: r,
|
|
1171
|
+
renameConversation: s,
|
|
1172
|
+
locale: a,
|
|
1173
|
+
disableModalDividers: d,
|
|
1174
|
+
titles: c,
|
|
1151
1175
|
isSmallButton: f
|
|
1152
1176
|
}) => {
|
|
1153
|
-
const [
|
|
1177
|
+
const [m, e] = k(o?.name || ""), n = (i) => {
|
|
1154
1178
|
e(i);
|
|
1155
1179
|
}, t = () => {
|
|
1156
|
-
const i = `${o?.folderId}/${encodeURIComponent(
|
|
1157
|
-
|
|
1180
|
+
const i = `${o?.folderId}/${encodeURIComponent(Ee(m))}-${(/* @__PURE__ */ new Date()).getTime()}`;
|
|
1181
|
+
s(
|
|
1158
1182
|
`conversations/${o.id}`,
|
|
1159
1183
|
`conversations/${i}`
|
|
1160
1184
|
);
|
|
1161
1185
|
};
|
|
1162
|
-
return /* @__PURE__ */
|
|
1163
|
-
|
|
1186
|
+
return /* @__PURE__ */ M(
|
|
1187
|
+
le,
|
|
1164
1188
|
{
|
|
1165
|
-
heading:
|
|
1189
|
+
heading: c?.renameTitle ?? "Rename conversation",
|
|
1166
1190
|
portalId: "rename-conversation",
|
|
1167
1191
|
containerClassName: "rename-conversation-popup",
|
|
1168
|
-
size:
|
|
1169
|
-
dividers: !
|
|
1170
|
-
onClose:
|
|
1171
|
-
closeButtonTitle:
|
|
1192
|
+
size: ce.SM,
|
|
1193
|
+
dividers: !d,
|
|
1194
|
+
onClose: r,
|
|
1195
|
+
closeButtonTitle: c?.close ?? "Cancel",
|
|
1172
1196
|
children: [
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
|
|
1197
|
+
/* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: a, children: /* @__PURE__ */ h(
|
|
1198
|
+
je,
|
|
1175
1199
|
{
|
|
1176
1200
|
inputId: "rename",
|
|
1177
|
-
value:
|
|
1201
|
+
value: m,
|
|
1178
1202
|
onChange: n,
|
|
1179
1203
|
cssClass: "w-full"
|
|
1180
1204
|
}
|
|
1181
1205
|
) }),
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
|
|
1206
|
+
/* @__PURE__ */ M("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
|
|
1207
|
+
/* @__PURE__ */ h(
|
|
1208
|
+
j,
|
|
1185
1209
|
{
|
|
1186
1210
|
buttonClassName: "cancel-button",
|
|
1187
|
-
title:
|
|
1211
|
+
title: c?.cancel ?? "Cancel",
|
|
1188
1212
|
isSmallButton: f,
|
|
1189
1213
|
onClick: (i) => {
|
|
1190
|
-
i.stopPropagation(),
|
|
1214
|
+
i.stopPropagation(), r();
|
|
1191
1215
|
}
|
|
1192
1216
|
}
|
|
1193
1217
|
),
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
|
|
1218
|
+
/* @__PURE__ */ h(
|
|
1219
|
+
j,
|
|
1196
1220
|
{
|
|
1197
1221
|
buttonClassName: "text-button-primary text-button-primary",
|
|
1198
|
-
title:
|
|
1222
|
+
title: c?.save ?? "Rename",
|
|
1199
1223
|
isSmallButton: f,
|
|
1200
|
-
disabled: !
|
|
1224
|
+
disabled: !m,
|
|
1201
1225
|
onClick: (i) => {
|
|
1202
1226
|
i.stopPropagation(), t();
|
|
1203
1227
|
}
|
|
@@ -1207,78 +1231,78 @@ const bt = (o, s) => ({
|
|
|
1207
1231
|
]
|
|
1208
1232
|
}
|
|
1209
1233
|
);
|
|
1210
|
-
},
|
|
1234
|
+
}, Bt = ({
|
|
1211
1235
|
conversation: o,
|
|
1212
|
-
conversationStyles:
|
|
1213
|
-
shareConversationProps:
|
|
1214
|
-
onConversationDelete:
|
|
1215
|
-
getConversation:
|
|
1216
|
-
getFileBlob:
|
|
1236
|
+
conversationStyles: r,
|
|
1237
|
+
shareConversationProps: s,
|
|
1238
|
+
onConversationDelete: a,
|
|
1239
|
+
getConversation: d,
|
|
1240
|
+
getFileBlob: c,
|
|
1217
1241
|
renameConversation: f,
|
|
1218
|
-
triggerButton:
|
|
1242
|
+
triggerButton: m,
|
|
1219
1243
|
locale: e,
|
|
1220
1244
|
isDisabled: n
|
|
1221
1245
|
}) => {
|
|
1222
|
-
const t =
|
|
1223
|
-
const
|
|
1246
|
+
const t = X(() => {
|
|
1247
|
+
const b = [
|
|
1224
1248
|
{
|
|
1225
|
-
key:
|
|
1226
|
-
title:
|
|
1227
|
-
icon:
|
|
1249
|
+
key: _.DELETE,
|
|
1250
|
+
title: r?.titles?.delete ?? "Delete",
|
|
1251
|
+
icon: r.actionsIcons?.[_.DELETE]
|
|
1228
1252
|
}
|
|
1229
1253
|
];
|
|
1230
|
-
return o?.model?.id?.endsWith(
|
|
1254
|
+
return o?.model?.id?.endsWith(ot) ? b : [
|
|
1231
1255
|
...o.isShared ? [] : [
|
|
1232
1256
|
{
|
|
1233
|
-
key:
|
|
1234
|
-
title:
|
|
1235
|
-
icon:
|
|
1257
|
+
key: _.SHARE,
|
|
1258
|
+
title: r?.titles?.share ?? "Share",
|
|
1259
|
+
icon: r.actionsIcons?.[_.SHARE]
|
|
1236
1260
|
},
|
|
1237
1261
|
{
|
|
1238
|
-
key:
|
|
1239
|
-
title:
|
|
1240
|
-
icon:
|
|
1262
|
+
key: _.RENAME,
|
|
1263
|
+
title: r?.titles?.rename ?? "Rename",
|
|
1264
|
+
icon: r.actionsIcons?.[_.RENAME]
|
|
1241
1265
|
}
|
|
1242
1266
|
],
|
|
1243
1267
|
{
|
|
1244
|
-
key:
|
|
1245
|
-
title:
|
|
1246
|
-
icon:
|
|
1268
|
+
key: _.EXPORT,
|
|
1269
|
+
title: r?.titles?.export ?? "Export",
|
|
1270
|
+
icon: r.actionsIcons?.[_.EXPORT]
|
|
1247
1271
|
},
|
|
1248
|
-
...
|
|
1272
|
+
...b
|
|
1249
1273
|
];
|
|
1250
1274
|
}, [
|
|
1251
1275
|
o.isShared,
|
|
1252
1276
|
o?.model?.id,
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
]), [i,
|
|
1256
|
-
|
|
1257
|
-
}, [
|
|
1258
|
-
u(
|
|
1259
|
-
}, [u]), C =
|
|
1260
|
-
g(
|
|
1261
|
-
}, [g]),
|
|
1262
|
-
|
|
1263
|
-
}, [o,
|
|
1264
|
-
(
|
|
1265
|
-
f(
|
|
1277
|
+
r.titles,
|
|
1278
|
+
r.actionsIcons
|
|
1279
|
+
]), [i, l] = k($.Closed), [p, u] = k($.Closed), [E, g] = k($.Closed), R = O(() => {
|
|
1280
|
+
l($.Closed);
|
|
1281
|
+
}, [l]), N = O(() => {
|
|
1282
|
+
u($.Closed);
|
|
1283
|
+
}, [u]), C = O(() => {
|
|
1284
|
+
g($.Closed);
|
|
1285
|
+
}, [g]), v = O(() => {
|
|
1286
|
+
a(o), R();
|
|
1287
|
+
}, [o, a, R]), I = O(
|
|
1288
|
+
(b, L) => {
|
|
1289
|
+
f(b, L), C();
|
|
1266
1290
|
},
|
|
1267
1291
|
[f, C]
|
|
1268
1292
|
);
|
|
1269
|
-
return /* @__PURE__ */
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
-
|
|
1293
|
+
return /* @__PURE__ */ M(te, { children: [
|
|
1294
|
+
/* @__PURE__ */ h(
|
|
1295
|
+
Me,
|
|
1272
1296
|
{
|
|
1273
1297
|
containerClassName: "ml-3 group-hover:visible invisible",
|
|
1274
|
-
triggerButton:
|
|
1298
|
+
triggerButton: m ?? /* @__PURE__ */ h(Ft, { disabled: n }),
|
|
1275
1299
|
options: t,
|
|
1276
1300
|
openedClassName: "action-menu-opened",
|
|
1277
|
-
onOptionSelect: (
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
`data:application/zip;base64,${
|
|
1301
|
+
onOptionSelect: (b) => {
|
|
1302
|
+
b === _.DELETE && l($.Opened), b === _.SHARE && u($.Opened), b === _.RENAME && g($.Opened), b === _.EXPORT && d(decodeURI(o.id)).then((L) => {
|
|
1303
|
+
Ct(L, c).then((H) => {
|
|
1304
|
+
Nt(
|
|
1305
|
+
`data:application/zip;base64,${H}`,
|
|
1282
1306
|
`chat_with_attachments_${(/* @__PURE__ */ new Date()).toLocaleDateString()}.dial`
|
|
1283
1307
|
);
|
|
1284
1308
|
});
|
|
@@ -1287,48 +1311,48 @@ const bt = (o, s) => ({
|
|
|
1287
1311
|
disabled: n
|
|
1288
1312
|
}
|
|
1289
1313
|
),
|
|
1290
|
-
i ===
|
|
1291
|
-
|
|
1314
|
+
i === $.Opened && /* @__PURE__ */ h(
|
|
1315
|
+
ut,
|
|
1292
1316
|
{
|
|
1293
|
-
titles:
|
|
1317
|
+
titles: r.titles,
|
|
1294
1318
|
locale: e,
|
|
1295
|
-
disableModalDividers:
|
|
1296
|
-
isSmallButton:
|
|
1297
|
-
deleteConversation:
|
|
1298
|
-
onCloseModal:
|
|
1319
|
+
disableModalDividers: r.disableModalDividers,
|
|
1320
|
+
isSmallButton: r.isSmallModalButton,
|
|
1321
|
+
deleteConversation: v,
|
|
1322
|
+
onCloseModal: R
|
|
1299
1323
|
}
|
|
1300
1324
|
),
|
|
1301
|
-
|
|
1302
|
-
|
|
1325
|
+
p === $.Opened && /* @__PURE__ */ h(
|
|
1326
|
+
Lt,
|
|
1303
1327
|
{
|
|
1304
1328
|
conversation: o,
|
|
1305
1329
|
locale: e,
|
|
1306
1330
|
onCloseModal: N,
|
|
1307
|
-
...
|
|
1331
|
+
...s
|
|
1308
1332
|
}
|
|
1309
1333
|
),
|
|
1310
|
-
E ===
|
|
1311
|
-
|
|
1334
|
+
E === $.Opened && /* @__PURE__ */ h(
|
|
1335
|
+
kt,
|
|
1312
1336
|
{
|
|
1313
1337
|
conversation: o,
|
|
1314
1338
|
locale: e,
|
|
1315
|
-
titles:
|
|
1316
|
-
renameConversation:
|
|
1339
|
+
titles: r.titles,
|
|
1340
|
+
renameConversation: I,
|
|
1317
1341
|
onCloseModal: C,
|
|
1318
|
-
disableModalDividers:
|
|
1319
|
-
isSmallButton:
|
|
1342
|
+
disableModalDividers: r.disableModalDividers,
|
|
1343
|
+
isSmallButton: r.isSmallModalButton
|
|
1320
1344
|
}
|
|
1321
1345
|
)
|
|
1322
1346
|
] });
|
|
1323
|
-
},
|
|
1347
|
+
}, Ft = ({ disabled: o }) => /* @__PURE__ */ h(
|
|
1324
1348
|
"div",
|
|
1325
1349
|
{
|
|
1326
|
-
className:
|
|
1350
|
+
className: B(
|
|
1327
1351
|
"flex items-center justify-center w-[24px]",
|
|
1328
1352
|
o ? "cursor-not-allowed" : "cursor-pointer"
|
|
1329
1353
|
),
|
|
1330
|
-
children: /* @__PURE__ */
|
|
1331
|
-
|
|
1354
|
+
children: /* @__PURE__ */ h(
|
|
1355
|
+
Ze,
|
|
1332
1356
|
{
|
|
1333
1357
|
width: 20,
|
|
1334
1358
|
height: 20,
|
|
@@ -1337,73 +1361,73 @@ const bt = (o, s) => ({
|
|
|
1337
1361
|
}
|
|
1338
1362
|
)
|
|
1339
1363
|
}
|
|
1340
|
-
),
|
|
1364
|
+
), _e = ({
|
|
1341
1365
|
conversation: o,
|
|
1342
|
-
selectedConversationId:
|
|
1343
|
-
searchQuery:
|
|
1344
|
-
onConversationClick:
|
|
1345
|
-
actions:
|
|
1346
|
-
locale:
|
|
1366
|
+
selectedConversationId: r,
|
|
1367
|
+
searchQuery: s,
|
|
1368
|
+
onConversationClick: a,
|
|
1369
|
+
actions: d,
|
|
1370
|
+
locale: c,
|
|
1347
1371
|
isDisabled: f,
|
|
1348
|
-
conversationStyles:
|
|
1372
|
+
conversationStyles: m,
|
|
1349
1373
|
shareConversationProps: e
|
|
1350
1374
|
}) => {
|
|
1351
|
-
const n =
|
|
1352
|
-
return
|
|
1353
|
-
if (o?.id ===
|
|
1375
|
+
const n = me(null), t = Ee(o?.name);
|
|
1376
|
+
return ne(() => {
|
|
1377
|
+
if (o?.id === r && n?.current) {
|
|
1354
1378
|
const i = n.current.parentElement?.parentElement?.parentElement;
|
|
1355
1379
|
if (i) {
|
|
1356
|
-
const
|
|
1380
|
+
const l = n.current.getBoundingClientRect(), p = i.getBoundingClientRect(), u = l.height, E = p.height, R = l.top - p.top + i.scrollTop - (E / 2 - u / 2);
|
|
1357
1381
|
i.scrollTo({
|
|
1358
|
-
top:
|
|
1382
|
+
top: R,
|
|
1359
1383
|
behavior: "smooth"
|
|
1360
1384
|
});
|
|
1361
1385
|
}
|
|
1362
1386
|
}
|
|
1363
|
-
}, [o,
|
|
1387
|
+
}, [o, r]), /* @__PURE__ */ M(
|
|
1364
1388
|
"div",
|
|
1365
1389
|
{
|
|
1366
1390
|
ref: n,
|
|
1367
|
-
className:
|
|
1391
|
+
className: B(
|
|
1368
1392
|
"flex justify-between items-center py-2 px-3 border-transparent relative group border",
|
|
1369
1393
|
"conversation-item",
|
|
1370
|
-
|
|
1394
|
+
r === o?.id && "bg-hues-100 conversation-item-active",
|
|
1371
1395
|
f ? "cursor-not-allowed" : "cursor-pointer hover:border-hues-600"
|
|
1372
1396
|
),
|
|
1373
|
-
onClick: () => !f &&
|
|
1374
|
-
title: f ?
|
|
1397
|
+
onClick: () => !f && a(o.folderId, o?.id),
|
|
1398
|
+
title: f ? m?.titles?.noActionsAllowed : t,
|
|
1375
1399
|
children: [
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
|
|
1378
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ M("div", { className: "flex min-w-0 flex-1 items-center", children: [
|
|
1401
|
+
m.conversationItemIcon ? m.conversationItemIcon : null,
|
|
1402
|
+
/* @__PURE__ */ h(
|
|
1379
1403
|
"h3",
|
|
1380
1404
|
{
|
|
1381
|
-
className:
|
|
1405
|
+
className: B(
|
|
1382
1406
|
"truncate font-semibold text-neutrals-1000 sm:body-2",
|
|
1383
1407
|
"conversation-item-text",
|
|
1384
|
-
|
|
1408
|
+
r === o?.id ? "conversation-item-text-active" : ""
|
|
1385
1409
|
),
|
|
1386
|
-
title: f ?
|
|
1387
|
-
children:
|
|
1388
|
-
|
|
1410
|
+
title: f ? m?.titles?.noActionsAllowed : t,
|
|
1411
|
+
children: s?.length ? /* @__PURE__ */ h(
|
|
1412
|
+
We,
|
|
1389
1413
|
{
|
|
1390
1414
|
text: t,
|
|
1391
|
-
highlightText:
|
|
1415
|
+
highlightText: s
|
|
1392
1416
|
}
|
|
1393
1417
|
) : t
|
|
1394
1418
|
}
|
|
1395
1419
|
)
|
|
1396
1420
|
] }),
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
|
|
1421
|
+
/* @__PURE__ */ h(
|
|
1422
|
+
Bt,
|
|
1399
1423
|
{
|
|
1400
|
-
locale:
|
|
1401
|
-
conversationStyles:
|
|
1424
|
+
locale: c,
|
|
1425
|
+
conversationStyles: m,
|
|
1402
1426
|
conversation: o,
|
|
1403
|
-
onConversationDelete:
|
|
1404
|
-
getConversation:
|
|
1405
|
-
getFileBlob:
|
|
1406
|
-
renameConversation:
|
|
1427
|
+
onConversationDelete: d.deleteConversation,
|
|
1428
|
+
getConversation: d.getConversation,
|
|
1429
|
+
getFileBlob: d.getFileBlob,
|
|
1430
|
+
renameConversation: d.renameConversation,
|
|
1407
1431
|
shareConversationProps: e,
|
|
1408
1432
|
isDisabled: f
|
|
1409
1433
|
}
|
|
@@ -1411,446 +1435,467 @@ const bt = (o, s) => ({
|
|
|
1411
1435
|
]
|
|
1412
1436
|
}
|
|
1413
1437
|
);
|
|
1414
|
-
},
|
|
1438
|
+
}, Ut = ({
|
|
1415
1439
|
handleConversationClick: o,
|
|
1416
|
-
actions:
|
|
1417
|
-
selectedConversationId:
|
|
1418
|
-
groupLabel:
|
|
1419
|
-
conversationStyles:
|
|
1420
|
-
groupedConversations:
|
|
1440
|
+
actions: r,
|
|
1441
|
+
selectedConversationId: s,
|
|
1442
|
+
groupLabel: a,
|
|
1443
|
+
conversationStyles: d,
|
|
1444
|
+
groupedConversations: c,
|
|
1421
1445
|
shareConversationProps: f,
|
|
1422
|
-
locale:
|
|
1446
|
+
locale: m,
|
|
1423
1447
|
isDisabled: e
|
|
1424
1448
|
}) => {
|
|
1425
|
-
const [n, t] =
|
|
1426
|
-
t((
|
|
1449
|
+
const [n, t] = k(!1), i = O(() => {
|
|
1450
|
+
t((l) => !l);
|
|
1427
1451
|
}, [t]);
|
|
1428
|
-
return /* @__PURE__ */
|
|
1429
|
-
/* @__PURE__ */
|
|
1452
|
+
return /* @__PURE__ */ M("div", { children: [
|
|
1453
|
+
/* @__PURE__ */ M(
|
|
1430
1454
|
"div",
|
|
1431
1455
|
{
|
|
1432
|
-
className: "
|
|
1456
|
+
className: "conversation-group-items-title mb-3 inline-flex cursor-pointer items-center gap-1 text-neutrals-700",
|
|
1433
1457
|
onClick: i,
|
|
1434
1458
|
children: [
|
|
1435
|
-
/* @__PURE__ */
|
|
1436
|
-
|
|
1459
|
+
/* @__PURE__ */ h(
|
|
1460
|
+
Je,
|
|
1437
1461
|
{
|
|
1438
|
-
className:
|
|
1462
|
+
className: B(
|
|
1439
1463
|
"w-3 h-3 conversation-group-items-arrow",
|
|
1440
1464
|
n ? "rotate-[90deg]" : "rotate-0"
|
|
1441
1465
|
)
|
|
1442
1466
|
}
|
|
1443
1467
|
),
|
|
1444
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ h("span", { className: "body-3 conversation-group-items-title-text", children: dt(a, d?.titles) })
|
|
1445
1469
|
]
|
|
1446
1470
|
}
|
|
1447
1471
|
),
|
|
1448
|
-
!n && /* @__PURE__ */
|
|
1472
|
+
!n && /* @__PURE__ */ h(
|
|
1449
1473
|
"div",
|
|
1450
1474
|
{
|
|
1451
|
-
className:
|
|
1475
|
+
className: B(
|
|
1452
1476
|
"flex flex-col gap-y-3",
|
|
1453
1477
|
"conversation-group-items"
|
|
1454
1478
|
),
|
|
1455
|
-
children:
|
|
1456
|
-
(
|
|
1457
|
-
|
|
1479
|
+
children: Ie(c).map(
|
|
1480
|
+
(l) => /* @__PURE__ */ h(
|
|
1481
|
+
_e,
|
|
1458
1482
|
{
|
|
1459
|
-
locale:
|
|
1483
|
+
locale: m,
|
|
1460
1484
|
isDisabled: e,
|
|
1461
|
-
conversationStyles:
|
|
1462
|
-
conversation:
|
|
1463
|
-
selectedConversationId:
|
|
1485
|
+
conversationStyles: d,
|
|
1486
|
+
conversation: l,
|
|
1487
|
+
selectedConversationId: s,
|
|
1464
1488
|
onConversationClick: o,
|
|
1465
|
-
actions:
|
|
1489
|
+
actions: r,
|
|
1466
1490
|
shareConversationProps: f
|
|
1467
1491
|
},
|
|
1468
|
-
|
|
1492
|
+
l.id || l.name
|
|
1469
1493
|
)
|
|
1470
1494
|
)
|
|
1471
1495
|
}
|
|
1472
1496
|
)
|
|
1473
|
-
] },
|
|
1474
|
-
},
|
|
1497
|
+
] }, a);
|
|
1498
|
+
}, zt = ({
|
|
1475
1499
|
searchQuery: o,
|
|
1476
|
-
isExpandedSearch:
|
|
1477
|
-
titles:
|
|
1478
|
-
searchIcon:
|
|
1479
|
-
onSearchConversations:
|
|
1480
|
-
toggleSearchField:
|
|
1481
|
-
}) => /* @__PURE__ */
|
|
1482
|
-
|
|
1500
|
+
isExpandedSearch: r,
|
|
1501
|
+
titles: s,
|
|
1502
|
+
searchIcon: a,
|
|
1503
|
+
onSearchConversations: d,
|
|
1504
|
+
toggleSearchField: c
|
|
1505
|
+
}) => /* @__PURE__ */ h(te, { children: r ? /* @__PURE__ */ h(
|
|
1506
|
+
ye,
|
|
1483
1507
|
{
|
|
1484
1508
|
inputId: "conversations-search",
|
|
1485
|
-
placeholder:
|
|
1509
|
+
placeholder: s?.searchPlaceholder ?? "Search",
|
|
1486
1510
|
containerClasses: "conversation-list-search-input h-[40px] bg-transparent px-4 py-2 rounded-full border-neutrals-400 shadow-none",
|
|
1487
1511
|
cssClass: "h-auto",
|
|
1488
1512
|
value: o,
|
|
1489
|
-
iconAfterInput: /* @__PURE__ */
|
|
1490
|
-
|
|
1513
|
+
iconAfterInput: /* @__PURE__ */ h(
|
|
1514
|
+
Ve,
|
|
1491
1515
|
{
|
|
1492
1516
|
buttonClassName: "text-button-tertiary items-center p-0 ml-4 border-0 w-5 h-5",
|
|
1493
|
-
onClick:
|
|
1494
|
-
icon: /* @__PURE__ */
|
|
1517
|
+
onClick: c,
|
|
1518
|
+
icon: /* @__PURE__ */ h(qe, {})
|
|
1495
1519
|
}
|
|
1496
1520
|
),
|
|
1497
|
-
onChange:
|
|
1521
|
+
onChange: d
|
|
1498
1522
|
}
|
|
1499
|
-
) : /* @__PURE__ */
|
|
1500
|
-
|
|
1523
|
+
) : /* @__PURE__ */ h(
|
|
1524
|
+
j,
|
|
1501
1525
|
{
|
|
1502
1526
|
buttonClassName: "text-button-tertiary p-0 search-button",
|
|
1503
|
-
iconBefore:
|
|
1504
|
-
onClick:
|
|
1527
|
+
iconBefore: a || /* @__PURE__ */ h(et, { className: "size-5" }),
|
|
1528
|
+
onClick: c
|
|
1505
1529
|
}
|
|
1506
|
-
) }),
|
|
1530
|
+
) }), _t = ({
|
|
1507
1531
|
conversations: o,
|
|
1508
|
-
selectedConversationId:
|
|
1509
|
-
searchQuery:
|
|
1510
|
-
conversationStyles:
|
|
1511
|
-
handleConversationClick:
|
|
1512
|
-
actions:
|
|
1532
|
+
selectedConversationId: r,
|
|
1533
|
+
searchQuery: s,
|
|
1534
|
+
conversationStyles: a,
|
|
1535
|
+
handleConversationClick: d,
|
|
1536
|
+
actions: c,
|
|
1513
1537
|
locale: f,
|
|
1514
|
-
shareConversationProps:
|
|
1538
|
+
shareConversationProps: m,
|
|
1515
1539
|
isDisabled: e
|
|
1516
1540
|
}) => {
|
|
1517
|
-
const [n, t] =
|
|
1518
|
-
return
|
|
1541
|
+
const [n, t] = k([]);
|
|
1542
|
+
return ne(() => {
|
|
1519
1543
|
t(
|
|
1520
|
-
|
|
1544
|
+
Ie(
|
|
1521
1545
|
o?.filter(
|
|
1522
|
-
(i) =>
|
|
1523
|
-
|
|
1546
|
+
(i) => Ee(i?.name)?.includes(
|
|
1547
|
+
s || ""
|
|
1524
1548
|
)
|
|
1525
1549
|
)
|
|
1526
1550
|
)
|
|
1527
1551
|
);
|
|
1528
|
-
}, [o,
|
|
1529
|
-
|
|
1552
|
+
}, [o, s]), /* @__PURE__ */ h(te, { children: n?.length ? n.map((i) => /* @__PURE__ */ h(
|
|
1553
|
+
_e,
|
|
1530
1554
|
{
|
|
1531
1555
|
locale: f,
|
|
1532
|
-
conversationStyles:
|
|
1556
|
+
conversationStyles: a,
|
|
1533
1557
|
conversation: i,
|
|
1534
|
-
searchQuery:
|
|
1535
|
-
selectedConversationId:
|
|
1536
|
-
onConversationClick:
|
|
1537
|
-
actions:
|
|
1538
|
-
shareConversationProps:
|
|
1558
|
+
searchQuery: s,
|
|
1559
|
+
selectedConversationId: r,
|
|
1560
|
+
onConversationClick: d,
|
|
1561
|
+
actions: c,
|
|
1562
|
+
shareConversationProps: m,
|
|
1539
1563
|
isDisabled: e
|
|
1540
1564
|
},
|
|
1541
1565
|
i.id
|
|
1542
|
-
)) : /* @__PURE__ */
|
|
1543
|
-
},
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
] }),
|
|
1566
|
+
)) : /* @__PURE__ */ h("h3", { className: "text-neutrals-800", children: a?.titles?.noConversation ?? "No conversations yet" }) });
|
|
1567
|
+
}, $t = ({ titles: o }) => /* @__PURE__ */ M("div", { className: "flex flex-col p-8 text-center", children: [
|
|
1568
|
+
/* @__PURE__ */ h("p", { className: "text-neutrals-800", children: o?.noConversation ?? "No conversations yet" }),
|
|
1569
|
+
/* @__PURE__ */ h("p", { className: "mt-2 text-sm text-neutrals-800", children: o?.clickNewChat ?? 'Click "New Chat" to start a conversation' })
|
|
1570
|
+
] }), en = ({
|
|
1547
1571
|
handleConversationClick: o,
|
|
1548
|
-
selectedConversationId:
|
|
1549
|
-
actions:
|
|
1550
|
-
children:
|
|
1551
|
-
isCollapsed:
|
|
1552
|
-
isStreaming:
|
|
1572
|
+
selectedConversationId: r,
|
|
1573
|
+
actions: s,
|
|
1574
|
+
children: a,
|
|
1575
|
+
isCollapsed: d,
|
|
1576
|
+
isStreaming: c,
|
|
1553
1577
|
conversationStyles: f,
|
|
1554
|
-
conversations:
|
|
1578
|
+
conversations: m,
|
|
1555
1579
|
locale: e,
|
|
1556
1580
|
sharedConversations: n,
|
|
1557
1581
|
setConversations: t,
|
|
1558
1582
|
setSharedConversations: i,
|
|
1559
|
-
shareConversationProps:
|
|
1560
|
-
handleSelectedConversationRemove:
|
|
1583
|
+
shareConversationProps: l,
|
|
1584
|
+
handleSelectedConversationRemove: p
|
|
1561
1585
|
}) => {
|
|
1562
|
-
const [u, E] =
|
|
1563
|
-
getConversations:
|
|
1564
|
-
getSharedConversations:
|
|
1565
|
-
deleteConversation:
|
|
1566
|
-
renameConversation:
|
|
1567
|
-
} =
|
|
1568
|
-
|
|
1586
|
+
const [u, E] = k({}), [g, R] = k(!0), [N, C] = k(""), [v, I] = k(!1), {
|
|
1587
|
+
getConversations: T,
|
|
1588
|
+
getSharedConversations: b,
|
|
1589
|
+
deleteConversation: L,
|
|
1590
|
+
renameConversation: H
|
|
1591
|
+
} = s, Q = X(() => !!N?.length, [N]);
|
|
1592
|
+
ne(() => {
|
|
1569
1593
|
E({
|
|
1570
|
-
...
|
|
1571
|
-
...
|
|
1594
|
+
...st(n),
|
|
1595
|
+
...ct(m)
|
|
1572
1596
|
});
|
|
1573
|
-
}, [
|
|
1574
|
-
async function
|
|
1597
|
+
}, [m, n]), ne(() => {
|
|
1598
|
+
async function y() {
|
|
1575
1599
|
try {
|
|
1576
|
-
|
|
1577
|
-
const
|
|
1578
|
-
|
|
1600
|
+
R(!0);
|
|
1601
|
+
const S = await T(e), P = await b(
|
|
1602
|
+
se(ie.ME)
|
|
1579
1603
|
);
|
|
1580
|
-
t(
|
|
1581
|
-
|
|
1582
|
-
|
|
1604
|
+
t(J(S)), i(
|
|
1605
|
+
J(
|
|
1606
|
+
fe(P, e)
|
|
1583
1607
|
)
|
|
1584
1608
|
);
|
|
1585
|
-
} catch (
|
|
1586
|
-
console.error("Error loading conversation",
|
|
1609
|
+
} catch (S) {
|
|
1610
|
+
console.error("Error loading conversation", S);
|
|
1587
1611
|
} finally {
|
|
1588
|
-
|
|
1612
|
+
R(!1);
|
|
1589
1613
|
}
|
|
1590
1614
|
}
|
|
1591
|
-
|
|
1615
|
+
y();
|
|
1592
1616
|
}, [
|
|
1593
|
-
|
|
1617
|
+
T,
|
|
1594
1618
|
t,
|
|
1595
1619
|
e,
|
|
1596
|
-
|
|
1620
|
+
b,
|
|
1597
1621
|
i
|
|
1598
1622
|
]);
|
|
1599
|
-
const
|
|
1600
|
-
async (
|
|
1623
|
+
const x = O(
|
|
1624
|
+
async (y) => {
|
|
1601
1625
|
try {
|
|
1602
|
-
await
|
|
1603
|
-
const
|
|
1604
|
-
|
|
1626
|
+
await L(y);
|
|
1627
|
+
const S = await T(e), P = await b(
|
|
1628
|
+
se(ie.ME)
|
|
1605
1629
|
);
|
|
1606
|
-
t(
|
|
1607
|
-
|
|
1608
|
-
|
|
1630
|
+
t(J(S)), i(
|
|
1631
|
+
J(
|
|
1632
|
+
fe(P, e)
|
|
1609
1633
|
)
|
|
1610
|
-
),
|
|
1611
|
-
} catch (
|
|
1612
|
-
console.error("Error deleting conversation",
|
|
1634
|
+
), r === y?.id && p();
|
|
1635
|
+
} catch (S) {
|
|
1636
|
+
console.error("Error deleting conversation", S);
|
|
1613
1637
|
}
|
|
1614
1638
|
},
|
|
1615
1639
|
[
|
|
1616
|
-
|
|
1617
|
-
|
|
1640
|
+
L,
|
|
1641
|
+
T,
|
|
1618
1642
|
e,
|
|
1619
|
-
|
|
1643
|
+
b,
|
|
1620
1644
|
t,
|
|
1621
1645
|
i,
|
|
1622
|
-
|
|
1623
|
-
|
|
1646
|
+
r,
|
|
1647
|
+
p
|
|
1624
1648
|
]
|
|
1625
|
-
),
|
|
1626
|
-
async (
|
|
1649
|
+
), G = O(
|
|
1650
|
+
async (y, S) => {
|
|
1627
1651
|
try {
|
|
1628
|
-
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1652
|
+
R(!0), await H(y, S);
|
|
1653
|
+
const P = await T(e), F = await b(
|
|
1654
|
+
se(ie.ME)
|
|
1631
1655
|
);
|
|
1632
|
-
t(
|
|
1633
|
-
|
|
1634
|
-
|
|
1656
|
+
t(J(P)), i(
|
|
1657
|
+
J(
|
|
1658
|
+
fe(F, e)
|
|
1635
1659
|
)
|
|
1636
1660
|
);
|
|
1637
|
-
} catch (
|
|
1638
|
-
console.error("Error renaming conversation",
|
|
1661
|
+
} catch (P) {
|
|
1662
|
+
console.error("Error renaming conversation", P);
|
|
1639
1663
|
} finally {
|
|
1640
|
-
|
|
1664
|
+
R(!1);
|
|
1641
1665
|
}
|
|
1642
1666
|
},
|
|
1643
1667
|
[
|
|
1644
|
-
|
|
1668
|
+
T,
|
|
1645
1669
|
e,
|
|
1646
|
-
|
|
1670
|
+
b,
|
|
1647
1671
|
t,
|
|
1648
1672
|
i,
|
|
1649
|
-
|
|
1673
|
+
H
|
|
1650
1674
|
]
|
|
1651
|
-
),
|
|
1652
|
-
(
|
|
1653
|
-
C(
|
|
1675
|
+
), V = O(
|
|
1676
|
+
(y) => {
|
|
1677
|
+
C(y);
|
|
1654
1678
|
},
|
|
1655
1679
|
[C]
|
|
1656
|
-
),
|
|
1657
|
-
|
|
1658
|
-
}, [
|
|
1659
|
-
return g ? /* @__PURE__ */
|
|
1660
|
-
!
|
|
1680
|
+
), Y = O(() => {
|
|
1681
|
+
I((y) => !y), C("");
|
|
1682
|
+
}, [I]);
|
|
1683
|
+
return g ? /* @__PURE__ */ h(Re, {}) : /* @__PURE__ */ M(te, { children: [
|
|
1684
|
+
!d && /* @__PURE__ */ M(
|
|
1661
1685
|
"div",
|
|
1662
1686
|
{
|
|
1663
|
-
className:
|
|
1687
|
+
className: B(
|
|
1664
1688
|
"flex justify-between items-center",
|
|
1665
|
-
|
|
1689
|
+
v ? " pt-4 pb-0 sm:pt-10" : " pt-6 pb-2 sm:pt-10"
|
|
1666
1690
|
),
|
|
1667
1691
|
children: [
|
|
1668
|
-
!
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
|
|
1692
|
+
!v && /* @__PURE__ */ h("h3", { className: "sm:body-2 text-neutrals-700", children: f?.titles?.allChats ?? "All Chats" }),
|
|
1693
|
+
/* @__PURE__ */ h(
|
|
1694
|
+
zt,
|
|
1671
1695
|
{
|
|
1672
1696
|
searchQuery: N,
|
|
1673
1697
|
searchIcon: f.searchIcon,
|
|
1674
1698
|
titles: f.titles,
|
|
1675
|
-
isExpandedSearch:
|
|
1676
|
-
onSearchConversations:
|
|
1677
|
-
toggleSearchField:
|
|
1699
|
+
isExpandedSearch: v,
|
|
1700
|
+
onSearchConversations: V,
|
|
1701
|
+
toggleSearchField: Y
|
|
1678
1702
|
}
|
|
1679
1703
|
)
|
|
1680
1704
|
]
|
|
1681
1705
|
}
|
|
1682
1706
|
),
|
|
1683
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ h(
|
|
1684
1708
|
"div",
|
|
1685
1709
|
{
|
|
1686
|
-
className:
|
|
1710
|
+
className: B(
|
|
1687
1711
|
"scroll-hidden-container flex flex-col mt-4 flex-1 min-h-0 pr-2",
|
|
1688
|
-
|
|
1712
|
+
Q ? "gap-y-1" : "gap-y-6"
|
|
1689
1713
|
),
|
|
1690
|
-
children:
|
|
1691
|
-
|
|
1714
|
+
children: d ? null : /* @__PURE__ */ h(te, { children: m?.length === 0 && n?.length === 0 ? /* @__PURE__ */ h($t, { titles: f.titles }) : Q ? /* @__PURE__ */ h(
|
|
1715
|
+
_t,
|
|
1692
1716
|
{
|
|
1693
1717
|
locale: e,
|
|
1694
1718
|
conversationStyles: f,
|
|
1695
|
-
conversations: [...n, ...
|
|
1719
|
+
conversations: [...n, ...m],
|
|
1696
1720
|
searchQuery: N,
|
|
1697
|
-
selectedConversationId:
|
|
1721
|
+
selectedConversationId: r,
|
|
1698
1722
|
handleConversationClick: o,
|
|
1699
|
-
shareConversationProps:
|
|
1700
|
-
isDisabled:
|
|
1723
|
+
shareConversationProps: l,
|
|
1724
|
+
isDisabled: c,
|
|
1701
1725
|
actions: {
|
|
1702
|
-
...
|
|
1703
|
-
deleteConversation:
|
|
1726
|
+
...s,
|
|
1727
|
+
deleteConversation: x
|
|
1704
1728
|
}
|
|
1705
1729
|
}
|
|
1706
1730
|
) : Object.entries(u).map(
|
|
1707
|
-
([
|
|
1708
|
-
|
|
1731
|
+
([y, S]) => S?.length > 0 && /* @__PURE__ */ h(
|
|
1732
|
+
Ut,
|
|
1709
1733
|
{
|
|
1710
1734
|
locale: e,
|
|
1711
|
-
isDisabled:
|
|
1712
|
-
groupLabel:
|
|
1735
|
+
isDisabled: c,
|
|
1736
|
+
groupLabel: y,
|
|
1713
1737
|
conversationStyles: f,
|
|
1714
|
-
groupedConversations:
|
|
1738
|
+
groupedConversations: S,
|
|
1715
1739
|
handleConversationClick: o,
|
|
1716
1740
|
actions: {
|
|
1717
|
-
...
|
|
1718
|
-
deleteConversation:
|
|
1719
|
-
renameConversation:
|
|
1741
|
+
...s,
|
|
1742
|
+
deleteConversation: x,
|
|
1743
|
+
renameConversation: G
|
|
1720
1744
|
},
|
|
1721
|
-
shareConversationProps:
|
|
1722
|
-
selectedConversationId:
|
|
1745
|
+
shareConversationProps: l,
|
|
1746
|
+
selectedConversationId: r
|
|
1723
1747
|
},
|
|
1724
|
-
|
|
1748
|
+
y
|
|
1725
1749
|
)
|
|
1726
1750
|
) })
|
|
1727
1751
|
}
|
|
1728
1752
|
),
|
|
1729
|
-
|
|
1753
|
+
a
|
|
1730
1754
|
] });
|
|
1731
|
-
},
|
|
1755
|
+
}, Ht = ({
|
|
1732
1756
|
onCloseModal: o,
|
|
1733
|
-
disableModalDividers:
|
|
1734
|
-
signOut:
|
|
1735
|
-
isSmallButton:
|
|
1736
|
-
locale:
|
|
1737
|
-
titles:
|
|
1738
|
-
}) => /* @__PURE__ */
|
|
1739
|
-
|
|
1757
|
+
disableModalDividers: r,
|
|
1758
|
+
signOut: s,
|
|
1759
|
+
isSmallButton: a,
|
|
1760
|
+
locale: d,
|
|
1761
|
+
titles: c
|
|
1762
|
+
}) => /* @__PURE__ */ M(
|
|
1763
|
+
le,
|
|
1740
1764
|
{
|
|
1741
|
-
heading:
|
|
1765
|
+
heading: c?.popupTitle || "Log out?",
|
|
1742
1766
|
portalId: "sign-out",
|
|
1743
1767
|
containerClassName: "sign-out-popup",
|
|
1744
|
-
size:
|
|
1745
|
-
dividers: !
|
|
1768
|
+
size: ce.SM,
|
|
1769
|
+
dividers: !r,
|
|
1746
1770
|
onClose: o,
|
|
1747
1771
|
closeButtonTitle: "Cancel",
|
|
1748
1772
|
children: [
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1752
|
-
|
|
1773
|
+
/* @__PURE__ */ h("div", { className: "px-6 py-4 sm:px-0", lang: d, children: c?.popupText }),
|
|
1774
|
+
/* @__PURE__ */ M("div", { className: "delete-conversation-popup-footer flex justify-end gap-x-2 px-6 py-3", children: [
|
|
1775
|
+
/* @__PURE__ */ h(
|
|
1776
|
+
j,
|
|
1753
1777
|
{
|
|
1754
1778
|
buttonClassName: "cancel-button",
|
|
1755
|
-
title:
|
|
1756
|
-
isSmallButton:
|
|
1779
|
+
title: c?.popupCancel || "Cancel",
|
|
1780
|
+
isSmallButton: a,
|
|
1757
1781
|
onClick: (f) => {
|
|
1758
1782
|
f.stopPropagation(), o();
|
|
1759
1783
|
}
|
|
1760
1784
|
}
|
|
1761
1785
|
),
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
|
|
1786
|
+
/* @__PURE__ */ h(
|
|
1787
|
+
j,
|
|
1764
1788
|
{
|
|
1765
1789
|
buttonClassName: "text-button-primary",
|
|
1766
|
-
title:
|
|
1767
|
-
isSmallButton:
|
|
1790
|
+
title: c?.popupApply || "Sign Out",
|
|
1791
|
+
isSmallButton: a,
|
|
1768
1792
|
onClick: (f) => {
|
|
1769
|
-
f.stopPropagation(),
|
|
1793
|
+
f.stopPropagation(), s?.();
|
|
1770
1794
|
}
|
|
1771
1795
|
}
|
|
1772
1796
|
)
|
|
1773
1797
|
] })
|
|
1774
1798
|
]
|
|
1775
1799
|
}
|
|
1776
|
-
),
|
|
1800
|
+
), tn = ({
|
|
1777
1801
|
userInfo: o,
|
|
1778
|
-
signOutAction:
|
|
1779
|
-
|
|
1780
|
-
|
|
1802
|
+
signOutAction: r,
|
|
1803
|
+
contactSupportUrl: s,
|
|
1804
|
+
styles: a,
|
|
1805
|
+
locale: d,
|
|
1781
1806
|
titles: c
|
|
1782
1807
|
}) => {
|
|
1783
|
-
const
|
|
1784
|
-
() => o?.name ?
|
|
1808
|
+
const f = (R) => R?.split(" ")?.map((N, C) => C < 2 ? N[0].toUpperCase() : "")?.join("") ?? "", m = X(
|
|
1809
|
+
() => o?.name ? f(o?.name) : o?.email?.[0].toUpperCase() ?? "",
|
|
1785
1810
|
[o]
|
|
1786
|
-
), [
|
|
1787
|
-
|
|
1788
|
-
}, []),
|
|
1789
|
-
|
|
1790
|
-
}, []),
|
|
1791
|
-
|
|
1811
|
+
), [e, n] = k(!1), t = o?.name?.split(" "), i = t ? `${t?.[0] ?? ""} ${t?.[1]?.[0] ? t?.[1]?.[0] + "." : ""}` : o?.email ?? "", l = O(() => {
|
|
1812
|
+
n(!0);
|
|
1813
|
+
}, []), p = O(() => {
|
|
1814
|
+
n(!1);
|
|
1815
|
+
}, []), u = O(() => {
|
|
1816
|
+
window.open(s || "#", "_blank", "noopener,noreferrer");
|
|
1817
|
+
}, [s]), E = X(() => /* @__PURE__ */ M("div", { className: "flex items-center gap-2", children: [
|
|
1818
|
+
/* @__PURE__ */ h(
|
|
1792
1819
|
"div",
|
|
1793
1820
|
{
|
|
1794
|
-
className:
|
|
1821
|
+
className: B(
|
|
1795
1822
|
"cursor-pointer flex items-center justify-center size-11 rounded-[100px] p-[10px] sm:h-[32px] sm:w-[32px] flex-shrink-0",
|
|
1796
|
-
|
|
1823
|
+
a?.initialStyles
|
|
1797
1824
|
),
|
|
1798
|
-
children:
|
|
1825
|
+
children: m
|
|
1799
1826
|
}
|
|
1800
1827
|
),
|
|
1801
|
-
/* @__PURE__ */
|
|
1828
|
+
/* @__PURE__ */ h(
|
|
1802
1829
|
"p",
|
|
1803
1830
|
{
|
|
1804
|
-
className:
|
|
1831
|
+
className: B(
|
|
1805
1832
|
"h3 cursor-pointer overflow-hidden text-ellipsis",
|
|
1806
|
-
|
|
1833
|
+
a?.userNameStyles
|
|
1807
1834
|
),
|
|
1808
|
-
children: (
|
|
1835
|
+
children: (a?.showShortName ? i : o?.name) ?? o?.email ?? ""
|
|
1809
1836
|
}
|
|
1810
1837
|
)
|
|
1811
|
-
] }), [
|
|
1812
|
-
|
|
1838
|
+
] }), [m, i, a, o]), g = X(() => /* @__PURE__ */ M("div", { className: B("py-1", a?.dropDownStyles), children: [
|
|
1839
|
+
a?.settingsIcon && /* @__PURE__ */ M(
|
|
1813
1840
|
"button",
|
|
1814
1841
|
{
|
|
1815
|
-
className:
|
|
1816
|
-
"p-2 items-center flex gap-1 text-primary fill-primary
|
|
1817
|
-
|
|
1842
|
+
className: B(
|
|
1843
|
+
"p-2 items-center flex gap-1 text-primary fill-primary",
|
|
1844
|
+
a?.dropdownButtonTypographyStyles || "body-1",
|
|
1845
|
+
a?.dropdownButtonStyles
|
|
1818
1846
|
),
|
|
1819
1847
|
title: c?.settings,
|
|
1820
1848
|
children: [
|
|
1821
|
-
|
|
1822
|
-
c?.settings || "Settings"
|
|
1849
|
+
/* @__PURE__ */ h("span", { className: "shrink-0", children: a?.settingsIcon }),
|
|
1850
|
+
/* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.settings || "Settings" })
|
|
1851
|
+
]
|
|
1852
|
+
}
|
|
1853
|
+
),
|
|
1854
|
+
a?.contactSupportIcon && /* @__PURE__ */ M(
|
|
1855
|
+
"button",
|
|
1856
|
+
{
|
|
1857
|
+
className: B(
|
|
1858
|
+
"p-2 items-center flex gap-1 text-primary fill-primary",
|
|
1859
|
+
a?.dropdownButtonTypographyStyles || "body-1",
|
|
1860
|
+
a?.dropdownButtonStyles
|
|
1861
|
+
),
|
|
1862
|
+
title: c?.contactSupport,
|
|
1863
|
+
onClick: u,
|
|
1864
|
+
children: [
|
|
1865
|
+
/* @__PURE__ */ h("span", { className: "shrink-0", children: a?.contactSupportIcon }),
|
|
1866
|
+
/* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.contactSupport || "Contact support" })
|
|
1823
1867
|
]
|
|
1824
1868
|
}
|
|
1825
1869
|
),
|
|
1826
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ h(
|
|
1827
1871
|
"div",
|
|
1828
1872
|
{
|
|
1829
|
-
className:
|
|
1873
|
+
className: B(
|
|
1830
1874
|
"h-0 border-t border-neutrals-600 my-2",
|
|
1831
|
-
|
|
1875
|
+
a?.showSeparator ? "block" : "hidden"
|
|
1832
1876
|
)
|
|
1833
1877
|
}
|
|
1834
1878
|
),
|
|
1835
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ M(
|
|
1836
1880
|
"button",
|
|
1837
1881
|
{
|
|
1838
|
-
className:
|
|
1839
|
-
"p-2 items-center flex gap-1 text-primary fill-primary
|
|
1840
|
-
|
|
1882
|
+
className: B(
|
|
1883
|
+
"p-2 items-center flex gap-1 text-primary fill-primary",
|
|
1884
|
+
a?.dropdownButtonTypographyStyles || "body-1",
|
|
1885
|
+
a?.dropdownButtonStyles
|
|
1841
1886
|
),
|
|
1842
1887
|
title: c?.signOut,
|
|
1843
|
-
onClick:
|
|
1888
|
+
onClick: l,
|
|
1844
1889
|
children: [
|
|
1845
|
-
|
|
1846
|
-
c?.signOut || "Sign out",
|
|
1847
|
-
|
|
1848
|
-
|
|
1890
|
+
/* @__PURE__ */ h("span", { className: "shrink-0", children: a?.signOutIcon }),
|
|
1891
|
+
/* @__PURE__ */ h("span", { className: "min-w-0 break-words", children: c?.signOut || "Sign out" }),
|
|
1892
|
+
e && /* @__PURE__ */ h(
|
|
1893
|
+
Ht,
|
|
1849
1894
|
{
|
|
1850
|
-
onCloseModal:
|
|
1851
|
-
signOut: () =>
|
|
1852
|
-
locale:
|
|
1853
|
-
disableModalDividers:
|
|
1895
|
+
onCloseModal: p,
|
|
1896
|
+
signOut: () => r?.(),
|
|
1897
|
+
locale: d,
|
|
1898
|
+
disableModalDividers: a?.disableModalDividers,
|
|
1854
1899
|
titles: c
|
|
1855
1900
|
}
|
|
1856
1901
|
)
|
|
@@ -1858,33 +1903,34 @@ const bt = (o, s) => ({
|
|
|
1858
1903
|
}
|
|
1859
1904
|
)
|
|
1860
1905
|
] }), [
|
|
1861
|
-
r,
|
|
1862
|
-
c,
|
|
1863
|
-
i,
|
|
1864
|
-
p,
|
|
1865
1906
|
a,
|
|
1907
|
+
c,
|
|
1866
1908
|
l,
|
|
1867
|
-
|
|
1909
|
+
u,
|
|
1910
|
+
e,
|
|
1911
|
+
p,
|
|
1912
|
+
d,
|
|
1913
|
+
r
|
|
1868
1914
|
]);
|
|
1869
1915
|
if (o)
|
|
1870
|
-
return /* @__PURE__ */
|
|
1871
|
-
|
|
1916
|
+
return /* @__PURE__ */ h(
|
|
1917
|
+
Me,
|
|
1872
1918
|
{
|
|
1873
|
-
containerClassName:
|
|
1919
|
+
containerClassName: B(
|
|
1874
1920
|
"transition-opacity group-hover:opacity-100 shrink w-full",
|
|
1875
|
-
|
|
1921
|
+
a?.dropdownContainerClassName
|
|
1876
1922
|
),
|
|
1877
|
-
triggerButton:
|
|
1878
|
-
content:
|
|
1923
|
+
triggerButton: E,
|
|
1924
|
+
content: g,
|
|
1879
1925
|
openedClassName: "action-menu-opened"
|
|
1880
1926
|
}
|
|
1881
1927
|
);
|
|
1882
1928
|
};
|
|
1883
1929
|
export {
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1930
|
+
Bt as ActionMenu,
|
|
1931
|
+
_ as ActionMenuItem,
|
|
1932
|
+
en as ConversationList,
|
|
1933
|
+
tn as User,
|
|
1934
|
+
st as getSharedConversationsGroup,
|
|
1935
|
+
fe as transformSharedConversations
|
|
1890
1936
|
};
|