@linktr.ee/messaging-react 3.7.0-rc-1783338119 → 3.7.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/dist/{Card-Dm-jfetA.js → Card-BB_Vd9Gj.js} +3 -3
- package/dist/{Card-Dm-jfetA.js.map → Card-BB_Vd9Gj.js.map} +1 -1
- package/dist/{Card-BDzTCHou.cjs → Card-BbYTw4R8.cjs} +2 -2
- package/dist/{Card-BDzTCHou.cjs.map → Card-BbYTw4R8.cjs.map} +1 -1
- package/dist/{Card-DvZ0INEN.cjs → Card-CeWvHxmQ.cjs} +2 -2
- package/dist/{Card-DvZ0INEN.cjs.map → Card-CeWvHxmQ.cjs.map} +1 -1
- package/dist/{Card-VcM0VofY.js → Card-DJm5sWmC.js} +2 -2
- package/dist/{Card-VcM0VofY.js.map → Card-DJm5sWmC.js.map} +1 -1
- package/dist/{Card-B34_3dxf.cjs → Card-DOMWuevV.cjs} +2 -2
- package/dist/{Card-B34_3dxf.cjs.map → Card-DOMWuevV.cjs.map} +1 -1
- package/dist/{Card-BJ1ttS3d.js → Card-b_mGrfMp.js} +2 -2
- package/dist/{Card-BJ1ttS3d.js.map → Card-b_mGrfMp.js.map} +1 -1
- package/dist/{LockedThumbnail-DYz11nhd.cjs → LockedThumbnail-AH9EZwQ1.cjs} +2 -2
- package/dist/{LockedThumbnail-DYz11nhd.cjs.map → LockedThumbnail-AH9EZwQ1.cjs.map} +1 -1
- package/dist/{LockedThumbnail-BDf9eBov.js → LockedThumbnail-C0LOfIvF.js} +2 -2
- package/dist/{LockedThumbnail-BDf9eBov.js.map → LockedThumbnail-C0LOfIvF.js.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-27SEkKTJ.js → index-C-2O97qw.js} +761 -783
- package/dist/index-C-2O97qw.js.map +1 -0
- package/dist/index-DdN7z-9Y.cjs +2 -0
- package/dist/index-DdN7z-9Y.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessage/CustomMessage.stories.tsx +0 -35
- package/src/components/CustomMessage/index.tsx +0 -2
- package/src/styles.css +1 -34
- package/dist/index-27SEkKTJ.js.map +0 -1
- package/dist/index-DupFGSXr.cjs +0 -2
- package/dist/index-DupFGSXr.cjs.map +0 -1
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +0 -107
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +0 -86
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as s, jsxs as m, Fragment as
|
|
2
|
-
import V, { createContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ee, DotsThreeIcon as
|
|
1
|
+
import { jsx as s, jsxs as m, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import V, { createContext as at, useContext as Se, useCallback as Z, useState as U, useRef as G, useEffect as J, useId as Vs, useMemo as ae, Suspense as rt } from "react";
|
|
3
|
+
import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Hs, LinkPreviewsManager as Ht } from "stream-chat";
|
|
5
|
+
import { Chat as Ys, useChannelStateContext as ue, useChatContext as me, DateSeparator as qs, areMessageUIPropsEqual as Ws, useMessageReminder as Xs, useComponentContext as rs, Attachment as Ks, EditMessageModal as Js, MessageBlocked as Zs, MessageBouncePrompt as Qs, MessageDeleted as en, MessageIsThreadReplyInChannelButtonIndicator as tn, MessageRepliesCountButton as sn, ReminderNotification as nn, StreamedMessageText as an, messageHasAttachments as rn, messageHasReactions as ln, isDateSeparatorMessage as on, isMessageBlocked as cn, isMessageBounced as dn, MessageBounceModal as un, MessageText as Yt, MessageErrorIcon as qt, Poll as mn, useMessageContext as Ie, useMessageComposer as hn, useStateStore as fn, MessageInput as gn, useMessageInputContext as pn, useMessageComposerHasSendableData as bn, AttachmentPreviewList as vn, QuotedMessagePreview as xn, TextareaComposer as wn, MessageTimestamp as Ye, AIStates as qe, useTypingContext as _n, useAIState as Nn, Channel as yn, WithComponents as kn, Window as Cn, MessageList as En, ChannelList as Sn, InfiniteScroll as In } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ee, DotsThreeIcon as Tn, SpinnerGapIcon as ze, SignOutIcon as An, ProhibitInsetIcon as Wt, FlagIcon as is, ArrowLeftIcon as Qe, CurrencyDollarIcon as Mn, CaretRightIcon as ve, SparkleIcon as xe, FileIcon as ls, ImageIcon as Rn, SpeakerHighIcon as Ln, VideoCameraIcon as os, FileMdIcon as Dn, FileTextIcon as zn, FileZipIcon as Pn, FilePptIcon as Fn, FileCsvIcon as On, FileXlsIcon as $n, FileDocIcon as Bn, FilePdfIcon as Un, CircleNotchIcon as ke, PlayIcon as et, PauseIcon as jn, LinkIcon as Vn, DownloadSimpleIcon as Ce, XIcon as Ue, CaretLeftIcon as Gn, GiftIcon as Hn, ThumbsUpIcon as Yn, ThumbsDownIcon as qn, PencilSimpleIcon as Wn, TrashSimpleIcon as Xn, ArrowUpIcon as Kn, ProhibitIcon as Jn } from "@phosphor-icons/react";
|
|
7
7
|
import k from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as Zn, DefaultDropdownActionButton as cs } from "stream-chat-react/experimental";
|
|
9
|
+
const ds = at({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const us = rt({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), it = () => Se(ds), rl = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -25,10 +25,10 @@ const us = rt({
|
|
|
25
25
|
debug: i = !1,
|
|
26
26
|
client: o
|
|
27
27
|
}) => {
|
|
28
|
-
var
|
|
28
|
+
var E, R;
|
|
29
29
|
const l = Z(
|
|
30
|
-
(
|
|
31
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
30
|
+
(S, ...z) => {
|
|
31
|
+
i && console.log(`🔥 [MessagingProvider] ${S}`, ...z);
|
|
32
32
|
},
|
|
33
33
|
[i]
|
|
34
34
|
);
|
|
@@ -47,9 +47,9 @@ const us = rt({
|
|
|
47
47
|
apiKey: a,
|
|
48
48
|
serviceConfig: n,
|
|
49
49
|
capabilities: r
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
renderCount:
|
|
50
|
+
}), L = G(0);
|
|
51
|
+
L.current++, l("📊 RENDER INFO", {
|
|
52
|
+
renderCount: L.current,
|
|
53
53
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
54
54
|
propChanges: {
|
|
55
55
|
userChanged: A.current.userId !== (t == null ? void 0 : t.id),
|
|
@@ -64,37 +64,37 @@ const us = rt({
|
|
|
64
64
|
capabilities: r
|
|
65
65
|
};
|
|
66
66
|
const $ = G(null);
|
|
67
|
-
!o && a && ((
|
|
67
|
+
!o && a && ((E = $.current) == null ? void 0 : E.apiKey) !== a && ($.current = { apiKey: a, client: new Hs(a) });
|
|
68
68
|
const F = o || (a ? ((R = $.current) == null ? void 0 : R.client) ?? null : null);
|
|
69
69
|
J(() => {
|
|
70
|
-
const
|
|
70
|
+
const S = L.current, z = C.current;
|
|
71
71
|
if (o) {
|
|
72
72
|
N.current = null, u(null), h(null), c(!1), g(null), w(!1);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
if (!a || !F || !z) {
|
|
76
76
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
77
|
-
renderCount:
|
|
77
|
+
renderCount: S,
|
|
78
78
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
79
79
|
});
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
l("🚀 CREATING SERVICE", {
|
|
83
|
-
renderCount:
|
|
83
|
+
renderCount: S,
|
|
84
84
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
85
85
|
});
|
|
86
|
-
const O = new
|
|
86
|
+
const O = new Gs({
|
|
87
87
|
...z,
|
|
88
88
|
apiKey: a,
|
|
89
89
|
debug: T.current,
|
|
90
90
|
client: F
|
|
91
91
|
});
|
|
92
92
|
N.current = O, u(O), l("✅ SERVICE SET", {
|
|
93
|
-
renderCount:
|
|
93
|
+
renderCount: S,
|
|
94
94
|
serviceInstance: !!O
|
|
95
95
|
});
|
|
96
96
|
}, [a, F, o]);
|
|
97
|
-
const
|
|
97
|
+
const D = G(null);
|
|
98
98
|
J(() => {
|
|
99
99
|
var z, O;
|
|
100
100
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
@@ -114,7 +114,7 @@ const us = rt({
|
|
|
114
114
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
if (((z =
|
|
117
|
+
if (((z = D.current) == null ? void 0 : z.serviceId) === d && ((O = D.current) == null ? void 0 : O.userId) === t.id) {
|
|
118
118
|
l(
|
|
119
119
|
"⚠️ USER CONNECTION SKIPPED",
|
|
120
120
|
"Already connected this user with this service"
|
|
@@ -126,7 +126,7 @@ const us = rt({
|
|
|
126
126
|
try {
|
|
127
127
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
128
128
|
const j = await d.connectUser(t);
|
|
129
|
-
h(j), c(!0),
|
|
129
|
+
h(j), c(!0), D.current = { serviceId: d, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
130
130
|
userId: t.id,
|
|
131
131
|
clientId: j.userID
|
|
132
132
|
});
|
|
@@ -144,10 +144,10 @@ const us = rt({
|
|
|
144
144
|
}
|
|
145
145
|
})();
|
|
146
146
|
}, [d, t, l, f, o]), J(() => {
|
|
147
|
-
const
|
|
147
|
+
const S = F;
|
|
148
148
|
return () => {
|
|
149
149
|
var z;
|
|
150
|
-
|
|
150
|
+
S && (D.current = null, (z = N.current) == null || z.disconnectUser().catch(console.error));
|
|
151
151
|
};
|
|
152
152
|
}, [F]);
|
|
153
153
|
const y = Z(async () => {
|
|
@@ -162,10 +162,10 @@ const us = rt({
|
|
|
162
162
|
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), w(!0);
|
|
163
163
|
try {
|
|
164
164
|
l("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
165
|
-
const
|
|
166
|
-
h(
|
|
167
|
-
} catch (
|
|
168
|
-
const z =
|
|
165
|
+
const S = await d.connectUser(t);
|
|
166
|
+
h(S), c(!0), g(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
167
|
+
} catch (S) {
|
|
168
|
+
const z = S instanceof Error ? S.message : "Refresh failed";
|
|
169
169
|
g(z), l("❌ CONNECTION REFRESH ERROR", {
|
|
170
170
|
userId: t.id,
|
|
171
171
|
error: z
|
|
@@ -211,11 +211,11 @@ const us = rt({
|
|
|
211
211
|
l
|
|
212
212
|
]);
|
|
213
213
|
return l("🔄 RENDER END", {
|
|
214
|
-
renderCount:
|
|
214
|
+
renderCount: L.current,
|
|
215
215
|
willRenderChat: !!F,
|
|
216
216
|
contextValueReady: !!I
|
|
217
|
-
}), /* @__PURE__ */ s(
|
|
218
|
-
|
|
217
|
+
}), /* @__PURE__ */ s(ds.Provider, { value: I, children: F ? /* @__PURE__ */ s(
|
|
218
|
+
Ys,
|
|
219
219
|
{
|
|
220
220
|
client: F,
|
|
221
221
|
customClasses: {
|
|
@@ -224,7 +224,7 @@ const us = rt({
|
|
|
224
224
|
children: e
|
|
225
225
|
}
|
|
226
226
|
) : e });
|
|
227
|
-
},
|
|
227
|
+
}, Qn = () => it(), lt = (e) => {
|
|
228
228
|
var a, r;
|
|
229
229
|
const [t, n] = U(
|
|
230
230
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -246,14 +246,14 @@ const us = rt({
|
|
|
246
246
|
e.off("member.updated", i);
|
|
247
247
|
};
|
|
248
248
|
}, [e]), t;
|
|
249
|
-
},
|
|
249
|
+
}, ea = "linktree-official", ta = "linktree-official-sender";
|
|
250
250
|
function je(e, t, n) {
|
|
251
251
|
const a = Object.values(e || {});
|
|
252
|
-
if (n ===
|
|
252
|
+
if (n === ea) {
|
|
253
253
|
const r = a.find(
|
|
254
254
|
(i) => {
|
|
255
255
|
var o;
|
|
256
|
-
return ((o = i.user) == null ? void 0 : o.id) ===
|
|
256
|
+
return ((o = i.user) == null ? void 0 : o.id) === ta;
|
|
257
257
|
}
|
|
258
258
|
);
|
|
259
259
|
if (r) return r;
|
|
@@ -265,18 +265,18 @@ function je(e, t, n) {
|
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
|
-
const
|
|
269
|
-
function
|
|
270
|
-
return
|
|
268
|
+
const sa = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
269
|
+
function na(e) {
|
|
270
|
+
return sa.test(e.trim());
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Xt(e, t) {
|
|
273
273
|
const n = e == null ? void 0 : e.trim();
|
|
274
|
-
return !n || t && n === t ? !1 : !
|
|
274
|
+
return !n || t && n === t ? !1 : !na(n);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
return
|
|
276
|
+
function ot(e) {
|
|
277
|
+
return Xt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Xt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const Kt = [
|
|
280
280
|
{ emoji: "🍎", bgColor: "#FFD1DD" },
|
|
281
281
|
// Apple
|
|
282
282
|
{ emoji: "🍌", bgColor: "#FFF1C9" },
|
|
@@ -304,7 +304,7 @@ const Jt = [
|
|
|
304
304
|
{ emoji: "🍈", bgColor: "#D9F7E1" }
|
|
305
305
|
// Melon
|
|
306
306
|
];
|
|
307
|
-
function
|
|
307
|
+
function aa(e) {
|
|
308
308
|
let t = 0;
|
|
309
309
|
for (let n = 0; n < e.length; n++) {
|
|
310
310
|
const a = e.charCodeAt(n);
|
|
@@ -312,16 +312,16 @@ function la(e) {
|
|
|
312
312
|
}
|
|
313
313
|
return Math.abs(t);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
315
|
+
function us(e) {
|
|
316
|
+
return Kt[aa(e) % Kt.length];
|
|
317
317
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
318
|
+
function ra(e) {
|
|
319
|
+
return us(e).emoji;
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
return
|
|
321
|
+
function ia(e) {
|
|
322
|
+
return us(e).bgColor;
|
|
323
323
|
}
|
|
324
|
-
const
|
|
324
|
+
const se = ({
|
|
325
325
|
id: e,
|
|
326
326
|
image: t,
|
|
327
327
|
size: n = 40,
|
|
@@ -330,7 +330,7 @@ const ne = ({
|
|
|
330
330
|
shape: i = "squircle",
|
|
331
331
|
dmAgentEnabled: o = !1
|
|
332
332
|
}) => {
|
|
333
|
-
const l =
|
|
333
|
+
const l = ra(e), d = ia(e), u = 0.45, h = n < 32 ? Math.round(n * u) : n < 56 ? 14 : n < 120 ? 18 : 36, f = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
|
|
334
334
|
"img",
|
|
335
335
|
{
|
|
336
336
|
src: t,
|
|
@@ -394,7 +394,7 @@ const ne = ({
|
|
|
394
394
|
]
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
|
-
},
|
|
397
|
+
}, la = "https://linktr.ee/s/about/trust-center/report", oa = ({
|
|
398
398
|
channel: e,
|
|
399
399
|
participant: t,
|
|
400
400
|
showBlockParticipant: n = !0,
|
|
@@ -408,41 +408,41 @@ const ne = ({
|
|
|
408
408
|
logLabel: p = "useChannelModerationActions"
|
|
409
409
|
}) => {
|
|
410
410
|
var I;
|
|
411
|
-
const { service: h, debug: f } =
|
|
411
|
+
const { service: h, debug: f } = it(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, v = !!(a && n && h && c), [w, b] = U(!1), [g, x] = U(null), [N, C] = U(!1), [T, A] = U(!1), L = v && ((g == null ? void 0 : g.participantId) !== c || (g == null ? void 0 : g.service) !== h);
|
|
412
412
|
return J(() => {
|
|
413
413
|
if (!v || !h || !c) {
|
|
414
414
|
b(!1), x(null);
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
let
|
|
417
|
+
let E = !1;
|
|
418
418
|
return (async () => {
|
|
419
419
|
try {
|
|
420
420
|
const R = await h.getBlockedUsers();
|
|
421
|
-
if (
|
|
421
|
+
if (E) return;
|
|
422
422
|
b(
|
|
423
423
|
R.some(
|
|
424
|
-
(
|
|
424
|
+
(S) => S.blocked_user_id === c
|
|
425
425
|
)
|
|
426
426
|
);
|
|
427
427
|
} catch (R) {
|
|
428
|
-
|
|
428
|
+
E || console.error(`[${p}] Failed to check blocked status:`, R);
|
|
429
429
|
} finally {
|
|
430
|
-
|
|
430
|
+
E || x({ participantId: c, service: h });
|
|
431
431
|
}
|
|
432
432
|
})(), () => {
|
|
433
|
-
|
|
433
|
+
E = !0;
|
|
434
434
|
};
|
|
435
435
|
}, [v, h, c, p]), {
|
|
436
436
|
isParticipantBlocked: w,
|
|
437
|
-
isCheckingBlockedStatus:
|
|
437
|
+
isCheckingBlockedStatus: L,
|
|
438
438
|
isLeaving: N,
|
|
439
439
|
isUpdatingBlockStatus: T,
|
|
440
440
|
handleLeaveConversation: async () => {
|
|
441
|
-
var
|
|
441
|
+
var E;
|
|
442
442
|
if (!N) {
|
|
443
443
|
o == null || o(), f && console.log(`[${p}] Leave conversation`, e.cid), C(!0);
|
|
444
444
|
try {
|
|
445
|
-
const R = ((
|
|
445
|
+
const R = ((E = e._client) == null ? void 0 : E.userID) ?? null;
|
|
446
446
|
await e.hide(R, !1), r && await r(e), u == null || u();
|
|
447
447
|
} catch (R) {
|
|
448
448
|
console.error(`[${p}] Failed to leave conversation`, R);
|
|
@@ -452,11 +452,11 @@ const ne = ({
|
|
|
452
452
|
}
|
|
453
453
|
},
|
|
454
454
|
handleBlockUser: async () => {
|
|
455
|
-
var
|
|
455
|
+
var E, R, S;
|
|
456
456
|
if (!(T || !h)) {
|
|
457
|
-
l == null || l(), f && console.log(`[${p}] Block member`, (
|
|
457
|
+
l == null || l(), f && console.log(`[${p}] Block member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), A(!0);
|
|
458
458
|
try {
|
|
459
|
-
await h.blockUser((R = t == null ? void 0 : t.user) == null ? void 0 : R.id), i && await i((
|
|
459
|
+
await h.blockUser((R = t == null ? void 0 : t.user) == null ? void 0 : R.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
|
|
460
460
|
} catch (z) {
|
|
461
461
|
console.error(`[${p}] Failed to block member`, z);
|
|
462
462
|
} finally {
|
|
@@ -465,11 +465,11 @@ const ne = ({
|
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
handleUnblockUser: async () => {
|
|
468
|
-
var
|
|
468
|
+
var E, R, S;
|
|
469
469
|
if (!(T || !h)) {
|
|
470
|
-
l == null || l(), f && console.log(`[${p}] Unblock member`, (
|
|
470
|
+
l == null || l(), f && console.log(`[${p}] Unblock member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), A(!0);
|
|
471
471
|
try {
|
|
472
|
-
await h.unBlockUser((R = t == null ? void 0 : t.user) == null ? void 0 : R.id), i && await i((
|
|
472
|
+
await h.unBlockUser((R = t == null ? void 0 : t.user) == null ? void 0 : R.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
|
|
473
473
|
} catch (z) {
|
|
474
474
|
console.error(`[${p}] Failed to unblock member`, z);
|
|
475
475
|
} finally {
|
|
@@ -478,10 +478,10 @@ const ne = ({
|
|
|
478
478
|
}
|
|
479
479
|
},
|
|
480
480
|
handleReportUser: () => {
|
|
481
|
-
d == null || d(), u == null || u(), window.open(
|
|
481
|
+
d == null || d(), u == null || u(), window.open(la, "_blank", "noopener,noreferrer");
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
|
-
},
|
|
484
|
+
}, _e = ({
|
|
485
485
|
variant: e = "default",
|
|
486
486
|
className: t,
|
|
487
487
|
children: n,
|
|
@@ -498,7 +498,7 @@ const ne = ({
|
|
|
498
498
|
...a,
|
|
499
499
|
children: n
|
|
500
500
|
}
|
|
501
|
-
),
|
|
501
|
+
), tt = ({
|
|
502
502
|
channel: e,
|
|
503
503
|
participant: t,
|
|
504
504
|
showDeleteConversation: n = !0,
|
|
@@ -512,16 +512,16 @@ const ne = ({
|
|
|
512
512
|
customChannelActions: p,
|
|
513
513
|
triggerClassName: h
|
|
514
514
|
}) => {
|
|
515
|
-
const [f, c] = U(!1), v = G(null), w =
|
|
515
|
+
const [f, c] = U(!1), v = G(null), w = Vs(), b = Z(() => c(!1), []), {
|
|
516
516
|
isParticipantBlocked: g,
|
|
517
517
|
isCheckingBlockedStatus: x,
|
|
518
518
|
isLeaving: N,
|
|
519
519
|
isUpdatingBlockStatus: C,
|
|
520
520
|
handleLeaveConversation: T,
|
|
521
521
|
handleBlockUser: A,
|
|
522
|
-
handleUnblockUser:
|
|
522
|
+
handleUnblockUser: L,
|
|
523
523
|
handleReportUser: $
|
|
524
|
-
} =
|
|
524
|
+
} = oa({
|
|
525
525
|
channel: e,
|
|
526
526
|
participant: t,
|
|
527
527
|
showBlockParticipant: a,
|
|
@@ -536,13 +536,13 @@ const ne = ({
|
|
|
536
536
|
});
|
|
537
537
|
return J(() => {
|
|
538
538
|
if (!f) return;
|
|
539
|
-
const
|
|
539
|
+
const D = (I) => {
|
|
540
540
|
v.current && !v.current.contains(I.target) && c(!1);
|
|
541
541
|
}, y = (I) => {
|
|
542
542
|
I.key === "Escape" && c(!1);
|
|
543
543
|
};
|
|
544
|
-
return document.addEventListener("mousedown",
|
|
545
|
-
document.removeEventListener("mousedown",
|
|
544
|
+
return document.addEventListener("mousedown", D), document.addEventListener("keydown", y), () => {
|
|
545
|
+
document.removeEventListener("mousedown", D), document.removeEventListener("keydown", y);
|
|
546
546
|
};
|
|
547
547
|
}, [f]), !t || !(n || a || r || !!p) ? null : /* @__PURE__ */ m("div", { ref: v, className: "relative", children: [
|
|
548
548
|
/* @__PURE__ */ m(
|
|
@@ -553,9 +553,9 @@ const ne = ({
|
|
|
553
553
|
"aria-haspopup": "true",
|
|
554
554
|
"aria-expanded": f,
|
|
555
555
|
"aria-controls": f ? w : void 0,
|
|
556
|
-
onClick: () => c((
|
|
556
|
+
onClick: () => c((D) => !D),
|
|
557
557
|
children: [
|
|
558
|
-
/* @__PURE__ */ s(
|
|
558
|
+
/* @__PURE__ */ s(Tn, { className: "size-5 text-black/90" }),
|
|
559
559
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
|
|
560
560
|
]
|
|
561
561
|
}
|
|
@@ -571,13 +571,13 @@ const ne = ({
|
|
|
571
571
|
),
|
|
572
572
|
children: /* @__PURE__ */ m("ul", { className: "flex flex-col gap-1", children: [
|
|
573
573
|
n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
574
|
-
|
|
574
|
+
_e,
|
|
575
575
|
{
|
|
576
576
|
onClick: T,
|
|
577
577
|
disabled: N,
|
|
578
578
|
"aria-busy": N,
|
|
579
579
|
children: [
|
|
580
|
-
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
580
|
+
N ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(An, { className: "h-5 w-5" }),
|
|
581
581
|
/* @__PURE__ */ s("span", { children: "Delete Conversation" })
|
|
582
582
|
]
|
|
583
583
|
}
|
|
@@ -585,35 +585,35 @@ const ne = ({
|
|
|
585
585
|
a && /* @__PURE__ */ s("li", { children: x ? (
|
|
586
586
|
// Block status not yet resolved — show a disabled placeholder
|
|
587
587
|
// so a premature click can't act on a stale block state.
|
|
588
|
-
/* @__PURE__ */ m(
|
|
588
|
+
/* @__PURE__ */ m(_e, { disabled: !0, "aria-busy": !0, children: [
|
|
589
589
|
/* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }),
|
|
590
590
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
591
591
|
] })
|
|
592
592
|
) : g ? /* @__PURE__ */ m(
|
|
593
|
-
|
|
593
|
+
_e,
|
|
594
594
|
{
|
|
595
|
-
onClick:
|
|
595
|
+
onClick: L,
|
|
596
596
|
disabled: C,
|
|
597
597
|
"aria-busy": C,
|
|
598
598
|
children: [
|
|
599
|
-
C ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
599
|
+
C ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Wt, { className: "h-5 w-5" }),
|
|
600
600
|
/* @__PURE__ */ s("span", { children: "Unblock" })
|
|
601
601
|
]
|
|
602
602
|
}
|
|
603
603
|
) : /* @__PURE__ */ m(
|
|
604
|
-
|
|
604
|
+
_e,
|
|
605
605
|
{
|
|
606
606
|
onClick: A,
|
|
607
607
|
disabled: C,
|
|
608
608
|
"aria-busy": C,
|
|
609
609
|
children: [
|
|
610
|
-
C ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(
|
|
610
|
+
C ? /* @__PURE__ */ s(ze, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Wt, { className: "h-5 w-5" }),
|
|
611
611
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
612
612
|
]
|
|
613
613
|
}
|
|
614
614
|
) }),
|
|
615
|
-
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(
|
|
616
|
-
/* @__PURE__ */ s(
|
|
615
|
+
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ m(_e, { variant: "danger", onClick: $, children: [
|
|
616
|
+
/* @__PURE__ */ s(is, { className: "h-5 w-5" }),
|
|
617
617
|
/* @__PURE__ */ s("span", { children: "Report" })
|
|
618
618
|
] }) }),
|
|
619
619
|
p
|
|
@@ -621,10 +621,10 @@ const ne = ({
|
|
|
621
621
|
}
|
|
622
622
|
)
|
|
623
623
|
] });
|
|
624
|
-
}, We = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring",
|
|
624
|
+
}, We = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", ca = "CUSTOMER_PAID", da = "Replies instantly with AI assistant", ua = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ca, ma = (e) => {
|
|
625
625
|
const t = e;
|
|
626
|
-
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(
|
|
627
|
-
},
|
|
626
|
+
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(ua);
|
|
627
|
+
}, ha = ({
|
|
628
628
|
onBack: e,
|
|
629
629
|
showBackButton: t,
|
|
630
630
|
showStarButton: n = !1,
|
|
@@ -642,8 +642,8 @@ const ne = ({
|
|
|
642
642
|
showChannelInfo: v = !0,
|
|
643
643
|
onParticipantNameClick: w
|
|
644
644
|
}) => {
|
|
645
|
-
var $, F,
|
|
646
|
-
const { channel: b } =
|
|
645
|
+
var $, F, D;
|
|
646
|
+
const { channel: b } = ue(), { client: g } = me(), x = V.useMemo(
|
|
647
647
|
() => {
|
|
648
648
|
var y;
|
|
649
649
|
return je(
|
|
@@ -653,7 +653,7 @@ const ne = ({
|
|
|
653
653
|
);
|
|
654
654
|
},
|
|
655
655
|
[($ = b.state) == null ? void 0 : $.members, g == null ? void 0 : g.userID, b.type]
|
|
656
|
-
), N =
|
|
656
|
+
), N = ot(x == null ? void 0 : x.user), C = (F = x == null ? void 0 : x.user) == null ? void 0 : F.image, T = lt(b), A = ma(x), L = async () => {
|
|
657
657
|
try {
|
|
658
658
|
T ? await b.unpin() : await b.pin();
|
|
659
659
|
} catch (y) {
|
|
@@ -675,7 +675,7 @@ const ne = ({
|
|
|
675
675
|
}),
|
|
676
676
|
type: "button",
|
|
677
677
|
"aria-label": "Back to conversations",
|
|
678
|
-
children: /* @__PURE__ */ s(
|
|
678
|
+
children: /* @__PURE__ */ s(Qe, { className: "size-5 text-black/90" })
|
|
679
679
|
}
|
|
680
680
|
) }),
|
|
681
681
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: /* @__PURE__ */ m(
|
|
@@ -687,9 +687,9 @@ const ne = ({
|
|
|
687
687
|
className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
|
|
688
688
|
children: [
|
|
689
689
|
/* @__PURE__ */ s(
|
|
690
|
-
|
|
690
|
+
se,
|
|
691
691
|
{
|
|
692
|
-
id: ((
|
|
692
|
+
id: ((D = x == null ? void 0 : x.user) == null ? void 0 : D.id) || b.id || "unknown",
|
|
693
693
|
name: N,
|
|
694
694
|
image: C,
|
|
695
695
|
dmAgentEnabled: a,
|
|
@@ -707,7 +707,7 @@ const ne = ({
|
|
|
707
707
|
{
|
|
708
708
|
"aria-label": "Paid customer",
|
|
709
709
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
710
|
-
children: /* @__PURE__ */ s(
|
|
710
|
+
children: /* @__PURE__ */ s(Mn, { className: "size-2.5", weight: "bold" })
|
|
711
711
|
}
|
|
712
712
|
),
|
|
713
713
|
n && T && /* @__PURE__ */ s(
|
|
@@ -730,7 +730,7 @@ const ne = ({
|
|
|
730
730
|
] }),
|
|
731
731
|
a && /* @__PURE__ */ m("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
|
|
732
732
|
/* @__PURE__ */ s(xe, { className: "size-3 shrink-0 text-black/55" }),
|
|
733
|
-
/* @__PURE__ */ s("span", { children:
|
|
733
|
+
/* @__PURE__ */ s("span", { children: da })
|
|
734
734
|
] })
|
|
735
735
|
] })
|
|
736
736
|
]
|
|
@@ -741,7 +741,7 @@ const ne = ({
|
|
|
741
741
|
"button",
|
|
742
742
|
{
|
|
743
743
|
className: We,
|
|
744
|
-
onClick:
|
|
744
|
+
onClick: L,
|
|
745
745
|
type: "button",
|
|
746
746
|
"aria-pressed": T,
|
|
747
747
|
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
@@ -758,7 +758,7 @@ const ne = ({
|
|
|
758
758
|
}
|
|
759
759
|
),
|
|
760
760
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
761
|
-
|
|
761
|
+
tt,
|
|
762
762
|
{
|
|
763
763
|
channel: b,
|
|
764
764
|
participant: x,
|
|
@@ -776,20 +776,20 @@ const ne = ({
|
|
|
776
776
|
))
|
|
777
777
|
] })
|
|
778
778
|
] }) });
|
|
779
|
-
},
|
|
780
|
-
function
|
|
781
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
779
|
+
}, fa = (e) => /* @__PURE__ */ s(qs, { ...e, position: "center" }), st = "vote_up", nt = "vote_down";
|
|
780
|
+
function ga(e) {
|
|
781
|
+
return e != null && e.length ? e.some((t) => t.type === nt) ? "down" : e.some((t) => t.type === st) ? "up" : null : null;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
const { channel: t } =
|
|
785
|
-
() =>
|
|
783
|
+
function pa(e) {
|
|
784
|
+
const { channel: t } = ue(), { client: n } = me("useMessageVote"), a = ae(
|
|
785
|
+
() => ga(e.own_reactions),
|
|
786
786
|
[e.own_reactions]
|
|
787
787
|
), r = Z(async () => {
|
|
788
788
|
if (n != null && n.userID)
|
|
789
789
|
try {
|
|
790
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
790
|
+
a === "up" ? await t.deleteReaction(e.id, st) : await t.sendReaction(
|
|
791
791
|
e.id,
|
|
792
|
-
{ type:
|
|
792
|
+
{ type: st },
|
|
793
793
|
{ enforce_unique: !0, skip_push: !0 }
|
|
794
794
|
);
|
|
795
795
|
} catch {
|
|
@@ -797,9 +797,9 @@ function xa(e) {
|
|
|
797
797
|
}, [t, n == null ? void 0 : n.userID, e.id, a]), i = Z(async () => {
|
|
798
798
|
if (n != null && n.userID)
|
|
799
799
|
try {
|
|
800
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
800
|
+
a === "down" ? await t.deleteReaction(e.id, nt) : await t.sendReaction(
|
|
801
801
|
e.id,
|
|
802
|
-
{ type:
|
|
802
|
+
{ type: nt },
|
|
803
803
|
{ enforce_unique: !0, skip_push: !0 }
|
|
804
804
|
);
|
|
805
805
|
} catch {
|
|
@@ -807,24 +807,24 @@ function xa(e) {
|
|
|
807
807
|
}, [t, n == null ? void 0 : n.userID, e.id, a]);
|
|
808
808
|
return { selected: a, voteUp: r, voteDown: i };
|
|
809
809
|
}
|
|
810
|
-
function
|
|
810
|
+
function ba(e) {
|
|
811
811
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function ms({
|
|
814
814
|
message: e,
|
|
815
815
|
viewerLanguage: t
|
|
816
816
|
}) {
|
|
817
817
|
var r;
|
|
818
|
-
const n = e == null ? void 0 : e.text, a =
|
|
818
|
+
const n = e == null ? void 0 : e.text, a = ba(t);
|
|
819
819
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
820
820
|
}
|
|
821
|
-
const
|
|
821
|
+
const va = V.lazy(() => import("./Card-b_mGrfMp.js")), xa = V.lazy(() => import("./Card-DJm5sWmC.js")), wa = V.lazy(() => import("./Card-BB_Vd9Gj.js")), ct = () => /* @__PURE__ */ s(
|
|
822
822
|
"div",
|
|
823
823
|
{
|
|
824
824
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
825
825
|
"aria-hidden": !0
|
|
826
826
|
}
|
|
827
|
-
),
|
|
827
|
+
), _a = (e) => /* @__PURE__ */ s(rt, { fallback: /* @__PURE__ */ s(ct, {}), children: /* @__PURE__ */ s(va, { ...e }) }), hs = (e) => /* @__PURE__ */ s(rt, { fallback: /* @__PURE__ */ s(ct, {}), children: /* @__PURE__ */ s(xa, { ...e }) }), fs = (e) => /* @__PURE__ */ s(rt, { fallback: /* @__PURE__ */ s(ct, {}), children: /* @__PURE__ */ s(wa, { ...e }) }), Na = hs, ya = fs, Jt = { Composer: _a, Sent: hs, Received: fs, Creator: Na, Visitor: ya }, ka = [
|
|
828
828
|
[/pdf/, "pdf"],
|
|
829
829
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
830
830
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -834,42 +834,42 @@ const _a = V.lazy(() => import("./Card-BJ1ttS3d.js")), Na = V.lazy(() => import(
|
|
|
834
834
|
[/plain|rtf/, "text"],
|
|
835
835
|
[/markdown/, "markdown"]
|
|
836
836
|
];
|
|
837
|
-
function
|
|
837
|
+
function le(e) {
|
|
838
838
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
839
839
|
}
|
|
840
|
-
function
|
|
841
|
-
const t =
|
|
840
|
+
function gs(e) {
|
|
841
|
+
const t = ka.find(
|
|
842
842
|
([n]) => n.test(e)
|
|
843
843
|
);
|
|
844
844
|
return t ? t[1] : "generic";
|
|
845
845
|
}
|
|
846
|
-
const
|
|
847
|
-
video:
|
|
848
|
-
audio:
|
|
849
|
-
image:
|
|
850
|
-
document:
|
|
851
|
-
},
|
|
852
|
-
pdf:
|
|
853
|
-
doc:
|
|
854
|
-
xls:
|
|
855
|
-
csv:
|
|
856
|
-
ppt:
|
|
857
|
-
zip:
|
|
858
|
-
text:
|
|
859
|
-
markdown:
|
|
860
|
-
generic:
|
|
846
|
+
const Ca = {
|
|
847
|
+
video: os,
|
|
848
|
+
audio: Ln,
|
|
849
|
+
image: Rn,
|
|
850
|
+
document: ls
|
|
851
|
+
}, Ea = {
|
|
852
|
+
pdf: Un,
|
|
853
|
+
doc: Bn,
|
|
854
|
+
xls: $n,
|
|
855
|
+
csv: On,
|
|
856
|
+
ppt: Fn,
|
|
857
|
+
zip: Pn,
|
|
858
|
+
text: zn,
|
|
859
|
+
markdown: Dn,
|
|
860
|
+
generic: ls
|
|
861
861
|
};
|
|
862
|
-
function
|
|
863
|
-
const t =
|
|
864
|
-
return t !== "document" ?
|
|
862
|
+
function Sa(e) {
|
|
863
|
+
const t = le(e);
|
|
864
|
+
return t !== "document" ? Ca[t] : Ea[gs(e)];
|
|
865
865
|
}
|
|
866
866
|
function we(e, t) {
|
|
867
|
-
return V.createElement(
|
|
867
|
+
return V.createElement(Sa(e), t);
|
|
868
868
|
}
|
|
869
|
-
const
|
|
869
|
+
const Ia = (e) => {
|
|
870
870
|
var t, n;
|
|
871
871
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
|
|
872
|
-
},
|
|
872
|
+
}, Ta = ({
|
|
873
873
|
source: e,
|
|
874
874
|
mimeType: t,
|
|
875
875
|
poster: n,
|
|
@@ -881,7 +881,7 @@ const Ma = (e) => {
|
|
|
881
881
|
muted: d = !1,
|
|
882
882
|
onContainerClick: u
|
|
883
883
|
}) => {
|
|
884
|
-
const p =
|
|
884
|
+
const p = le(t), h = G(null), f = G(null), c = G(null), v = G(r), [w, b] = U(a), [g, x] = U(0), [N, C] = U(!1), [T, A] = U(!1), [L, $] = U(!1), [F, D] = U(!1), [y, I] = U(!0), [E, R] = U(null), S = Z(() => {
|
|
885
885
|
$(!1), b(!0);
|
|
886
886
|
}, []), z = Z((_) => {
|
|
887
887
|
const M = f.current;
|
|
@@ -889,7 +889,7 @@ const Ma = (e) => {
|
|
|
889
889
|
const H = M.getBoundingClientRect();
|
|
890
890
|
return Math.max(
|
|
891
891
|
0,
|
|
892
|
-
Math.min(1, (
|
|
892
|
+
Math.min(1, (Ia(_) - H.left) / H.width)
|
|
893
893
|
);
|
|
894
894
|
}, []), O = Z((_) => {
|
|
895
895
|
const M = h.current;
|
|
@@ -927,20 +927,20 @@ const Ma = (e) => {
|
|
|
927
927
|
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", M), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", M);
|
|
928
928
|
};
|
|
929
929
|
}, [N, z, O]);
|
|
930
|
-
const X =
|
|
930
|
+
const X = E ? { aspectRatio: String(E) } : void 0, ee = E ? "" : " aspect-video", K = Math.round(g * 100);
|
|
931
931
|
return /* @__PURE__ */ m(
|
|
932
932
|
"div",
|
|
933
933
|
{
|
|
934
934
|
role: "button",
|
|
935
935
|
tabIndex: 0,
|
|
936
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
936
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${ee}`,
|
|
937
937
|
style: X,
|
|
938
938
|
onClick: (_) => {
|
|
939
939
|
if (u) {
|
|
940
940
|
u(_);
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
|
-
|
|
943
|
+
L || o && b((M) => !M);
|
|
944
944
|
},
|
|
945
945
|
onKeyDown: (_) => {
|
|
946
946
|
if (!(_.key !== "Enter" && _.key !== " ")) {
|
|
@@ -948,7 +948,7 @@ const Ma = (e) => {
|
|
|
948
948
|
u(_);
|
|
949
949
|
return;
|
|
950
950
|
}
|
|
951
|
-
|
|
951
|
+
L || o && b((M) => !M);
|
|
952
952
|
}
|
|
953
953
|
},
|
|
954
954
|
children: [
|
|
@@ -972,11 +972,11 @@ const Ma = (e) => {
|
|
|
972
972
|
loop: i,
|
|
973
973
|
muted: d,
|
|
974
974
|
style: { width: "100%", height: "100%" },
|
|
975
|
-
onLoadStart: () =>
|
|
975
|
+
onLoadStart: () => D(!0),
|
|
976
976
|
onCanPlay: () => {
|
|
977
|
-
|
|
977
|
+
D(!1), I(!1);
|
|
978
978
|
},
|
|
979
|
-
onWaiting: () =>
|
|
979
|
+
onWaiting: () => D(!0),
|
|
980
980
|
onPlay: () => $(!1),
|
|
981
981
|
onEnded: () => {
|
|
982
982
|
i || (b(!1), x(0));
|
|
@@ -992,11 +992,11 @@ const Ma = (e) => {
|
|
|
992
992
|
muted: d,
|
|
993
993
|
playsInline: !0,
|
|
994
994
|
style: { width: "100%", height: "100%" },
|
|
995
|
-
onLoadStart: () =>
|
|
995
|
+
onLoadStart: () => D(!0),
|
|
996
996
|
onCanPlay: () => {
|
|
997
|
-
|
|
997
|
+
D(!1), I(!1);
|
|
998
998
|
},
|
|
999
|
-
onWaiting: () =>
|
|
999
|
+
onWaiting: () => D(!0),
|
|
1000
1000
|
onPlay: () => $(!1),
|
|
1001
1001
|
onLoadedMetadata: () => {
|
|
1002
1002
|
const _ = h.current;
|
|
@@ -1008,14 +1008,14 @@ const Ma = (e) => {
|
|
|
1008
1008
|
children: /* @__PURE__ */ s("track", { kind: "captions" })
|
|
1009
1009
|
}
|
|
1010
1010
|
) }),
|
|
1011
|
-
F && !
|
|
1012
|
-
|
|
1011
|
+
F && !L && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
1012
|
+
ke,
|
|
1013
1013
|
{
|
|
1014
1014
|
className: "size-8 animate-spin text-white/80",
|
|
1015
1015
|
weight: "bold"
|
|
1016
1016
|
}
|
|
1017
1017
|
) }),
|
|
1018
|
-
|
|
1018
|
+
L && !o && /* @__PURE__ */ s(
|
|
1019
1019
|
"div",
|
|
1020
1020
|
{
|
|
1021
1021
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1023,12 +1023,12 @@ const Ma = (e) => {
|
|
|
1023
1023
|
tabIndex: 0,
|
|
1024
1024
|
"aria-label": "Play preview",
|
|
1025
1025
|
onClick: (_) => {
|
|
1026
|
-
_.stopPropagation(),
|
|
1026
|
+
_.stopPropagation(), S();
|
|
1027
1027
|
},
|
|
1028
1028
|
onKeyDown: (_) => {
|
|
1029
|
-
_.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(),
|
|
1029
|
+
_.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(), S());
|
|
1030
1030
|
},
|
|
1031
|
-
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(
|
|
1031
|
+
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1032
1032
|
}
|
|
1033
1033
|
),
|
|
1034
1034
|
l && !o && /* @__PURE__ */ s("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ s(
|
|
@@ -1067,7 +1067,7 @@ const Ma = (e) => {
|
|
|
1067
1067
|
},
|
|
1068
1068
|
className: "shrink-0 text-white",
|
|
1069
1069
|
"aria-label": w ? "Pause" : "Play",
|
|
1070
|
-
children: w ? /* @__PURE__ */ s(
|
|
1070
|
+
children: w ? /* @__PURE__ */ s(jn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(et, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1071
1071
|
}
|
|
1072
1072
|
),
|
|
1073
1073
|
/* @__PURE__ */ m(
|
|
@@ -1117,7 +1117,7 @@ const Ma = (e) => {
|
|
|
1117
1117
|
]
|
|
1118
1118
|
}
|
|
1119
1119
|
);
|
|
1120
|
-
},
|
|
1120
|
+
}, Zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Aa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", ps = ({
|
|
1121
1121
|
mimeType: e,
|
|
1122
1122
|
sourceUrl: t,
|
|
1123
1123
|
thumbnailUrl: n,
|
|
@@ -1126,9 +1126,9 @@ const Ma = (e) => {
|
|
|
1126
1126
|
mediaPlayerProps: i,
|
|
1127
1127
|
containedImage: o = !1
|
|
1128
1128
|
}) => {
|
|
1129
|
-
const l =
|
|
1129
|
+
const l = le(e), [d, u] = U(!1);
|
|
1130
1130
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
|
|
1131
|
-
|
|
1131
|
+
Ta,
|
|
1132
1132
|
{
|
|
1133
1133
|
source: t,
|
|
1134
1134
|
mimeType: e,
|
|
@@ -1175,11 +1175,11 @@ const Ma = (e) => {
|
|
|
1175
1175
|
{
|
|
1176
1176
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1177
1177
|
children: we(e, {
|
|
1178
|
-
className:
|
|
1178
|
+
className: Zt(r),
|
|
1179
1179
|
weight: "regular"
|
|
1180
1180
|
})
|
|
1181
1181
|
}
|
|
1182
|
-
) : n ? /* @__PURE__ */ s("div", { className: `relative ${
|
|
1182
|
+
) : n ? /* @__PURE__ */ s("div", { className: `relative ${Aa(r)}`, children: /* @__PURE__ */ s(
|
|
1183
1183
|
"img",
|
|
1184
1184
|
{
|
|
1185
1185
|
src: n,
|
|
@@ -1192,12 +1192,12 @@ const Ma = (e) => {
|
|
|
1192
1192
|
{
|
|
1193
1193
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1194
1194
|
children: we(e, {
|
|
1195
|
-
className:
|
|
1195
|
+
className: Zt(r),
|
|
1196
1196
|
weight: "regular"
|
|
1197
1197
|
})
|
|
1198
1198
|
}
|
|
1199
1199
|
);
|
|
1200
|
-
},
|
|
1200
|
+
}, bs = ({
|
|
1201
1201
|
variant: e,
|
|
1202
1202
|
thumbnail: t,
|
|
1203
1203
|
title: n,
|
|
@@ -1263,28 +1263,28 @@ const Ma = (e) => {
|
|
|
1263
1263
|
}
|
|
1264
1264
|
);
|
|
1265
1265
|
};
|
|
1266
|
-
function
|
|
1266
|
+
function vs(e) {
|
|
1267
1267
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1269
|
+
function dt(e) {
|
|
1270
1270
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1272
|
+
function Ma(e) {
|
|
1273
1273
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1275
|
+
function Ra(e) {
|
|
1276
1276
|
return e ? "text-white" : "text-black";
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1278
|
+
function La(e) {
|
|
1279
1279
|
return e ? "text-white/55" : "text-black/55";
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function Da(e) {
|
|
1282
1282
|
return e ? "text-white/40" : "text-black/40";
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function za(e) {
|
|
1285
1285
|
return e ? "text-white/20" : "text-black/20";
|
|
1286
1286
|
}
|
|
1287
|
-
const
|
|
1287
|
+
const ut = ({ attachment: e, isMyMessage: t }) => {
|
|
1288
1288
|
const { title: n, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, u = /* @__PURE__ */ m(V.Fragment, { children: [
|
|
1289
1289
|
/* @__PURE__ */ s("div", { className: "p-2", children: r ? /* @__PURE__ */ s(
|
|
1290
1290
|
"img",
|
|
@@ -1296,26 +1296,26 @@ const mt = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1296
1296
|
) : /* @__PURE__ */ s(
|
|
1297
1297
|
"div",
|
|
1298
1298
|
{
|
|
1299
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1300
|
-
children: /* @__PURE__ */ s(
|
|
1299
|
+
className: `aspect-video w-full rounded-[20px] ${Ma(t)} flex items-center justify-center`,
|
|
1300
|
+
children: /* @__PURE__ */ s(Vn, { className: `size-12 ${za(t)}` })
|
|
1301
1301
|
}
|
|
1302
1302
|
) }),
|
|
1303
1303
|
/* @__PURE__ */ m("div", { className: "px-3 pb-3", children: [
|
|
1304
|
-
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1305
|
-
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${
|
|
1306
|
-
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1304
|
+
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Ra(t)}`, children: n }),
|
|
1305
|
+
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${La(t)}`, children: a }),
|
|
1306
|
+
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Da(t)}`, children: d })
|
|
1307
1307
|
] })
|
|
1308
1308
|
] });
|
|
1309
1309
|
return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ s("div", { className: "block", children: u });
|
|
1310
1310
|
};
|
|
1311
|
-
function
|
|
1311
|
+
function xs(e) {
|
|
1312
1312
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function mt(e) {
|
|
1315
1315
|
var t;
|
|
1316
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1316
|
+
return (t = e.attachments) == null ? void 0 : t.find(xs);
|
|
1317
1317
|
}
|
|
1318
|
-
async function
|
|
1318
|
+
async function Pa(e, t) {
|
|
1319
1319
|
let n;
|
|
1320
1320
|
try {
|
|
1321
1321
|
n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1327,7 +1327,7 @@ async function $a(e, t) {
|
|
|
1327
1327
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1328
1328
|
o.href = i, o.download = n, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1329
1329
|
}
|
|
1330
|
-
const
|
|
1330
|
+
const Fa = ({
|
|
1331
1331
|
url: e,
|
|
1332
1332
|
filename: t
|
|
1333
1333
|
}) => {
|
|
@@ -1339,7 +1339,7 @@ const Ba = ({
|
|
|
1339
1339
|
onClick: (i) => {
|
|
1340
1340
|
i.stopPropagation();
|
|
1341
1341
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1342
|
-
a(!0),
|
|
1342
|
+
a(!0), Pa(e, t).then(() => {
|
|
1343
1343
|
o == null || o.close();
|
|
1344
1344
|
}).catch(() => {
|
|
1345
1345
|
o && (o.location.href = e);
|
|
@@ -1347,14 +1347,14 @@ const Ba = ({
|
|
|
1347
1347
|
},
|
|
1348
1348
|
disabled: n,
|
|
1349
1349
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1350
|
-
children: n ? /* @__PURE__ */ s(
|
|
1351
|
-
/* @__PURE__ */ s(
|
|
1350
|
+
children: n ? /* @__PURE__ */ s(ke, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(V.Fragment, { children: [
|
|
1351
|
+
/* @__PURE__ */ s(Ce, { className: "size-4 text-white", weight: "bold" }),
|
|
1352
1352
|
"Download"
|
|
1353
1353
|
] })
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
};
|
|
1357
|
-
function
|
|
1357
|
+
function ht(e) {
|
|
1358
1358
|
var h, f, c, v;
|
|
1359
1359
|
const t = (h = e.attachments) == null ? void 0 : h.find(
|
|
1360
1360
|
(w) => w.type === "video" && w.asset_url
|
|
@@ -1375,16 +1375,16 @@ function ft(e) {
|
|
|
1375
1375
|
thumbnailUrl: p
|
|
1376
1376
|
};
|
|
1377
1377
|
}
|
|
1378
|
-
const
|
|
1378
|
+
const ws = ({
|
|
1379
1379
|
resolvedUrl: e,
|
|
1380
1380
|
resolvedType: t,
|
|
1381
1381
|
title: n,
|
|
1382
1382
|
fileSize: a,
|
|
1383
1383
|
thumbnailUrl: r
|
|
1384
1384
|
}) => {
|
|
1385
|
-
const i = a !== void 0 ?
|
|
1385
|
+
const i = a !== void 0 ? vs(a) : void 0;
|
|
1386
1386
|
return /* @__PURE__ */ s(
|
|
1387
|
-
|
|
1387
|
+
bs,
|
|
1388
1388
|
{
|
|
1389
1389
|
variant: "dark",
|
|
1390
1390
|
title: n,
|
|
@@ -1392,7 +1392,7 @@ const _s = ({
|
|
|
1392
1392
|
mimeType: t,
|
|
1393
1393
|
detail: i,
|
|
1394
1394
|
thumbnail: /* @__PURE__ */ s(
|
|
1395
|
-
|
|
1395
|
+
ps,
|
|
1396
1396
|
{
|
|
1397
1397
|
mimeType: t,
|
|
1398
1398
|
sourceUrl: e,
|
|
@@ -1403,23 +1403,23 @@ const _s = ({
|
|
|
1403
1403
|
)
|
|
1404
1404
|
}
|
|
1405
1405
|
);
|
|
1406
|
-
},
|
|
1406
|
+
}, _s = ({
|
|
1407
1407
|
resolvedUrl: e,
|
|
1408
1408
|
resolvedType: t,
|
|
1409
1409
|
title: n,
|
|
1410
1410
|
fileSize: a,
|
|
1411
1411
|
thumbnailUrl: r
|
|
1412
1412
|
}) => {
|
|
1413
|
-
const i =
|
|
1413
|
+
const i = le(t), o = a !== void 0 ? vs(a) : void 0;
|
|
1414
1414
|
return /* @__PURE__ */ s(
|
|
1415
|
-
|
|
1415
|
+
bs,
|
|
1416
1416
|
{
|
|
1417
1417
|
variant: "light",
|
|
1418
1418
|
title: n,
|
|
1419
1419
|
mimeType: t,
|
|
1420
1420
|
detail: o,
|
|
1421
1421
|
thumbnail: /* @__PURE__ */ s(
|
|
1422
|
-
|
|
1422
|
+
ps,
|
|
1423
1423
|
{
|
|
1424
1424
|
mimeType: t,
|
|
1425
1425
|
sourceUrl: e,
|
|
@@ -1429,17 +1429,17 @@ const _s = ({
|
|
|
1429
1429
|
containedImage: i === "image" || i === "document"
|
|
1430
1430
|
}
|
|
1431
1431
|
),
|
|
1432
|
-
action: /* @__PURE__ */ s(
|
|
1432
|
+
action: /* @__PURE__ */ s(Fa, { url: e, filename: n })
|
|
1433
1433
|
}
|
|
1434
1434
|
);
|
|
1435
|
-
},
|
|
1435
|
+
}, Oa = ({
|
|
1436
1436
|
message: e,
|
|
1437
1437
|
isMyMessage: t = !1
|
|
1438
1438
|
}) => {
|
|
1439
|
-
const n =
|
|
1439
|
+
const n = mt(e), a = ht(e);
|
|
1440
1440
|
return !n && !a ? null : /* @__PURE__ */ m("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1441
1441
|
!t && e.user && /* @__PURE__ */ s(
|
|
1442
|
-
|
|
1442
|
+
se,
|
|
1443
1443
|
{
|
|
1444
1444
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1445
1445
|
id: e.user.id,
|
|
@@ -1457,41 +1457,41 @@ const _s = ({
|
|
|
1457
1457
|
{
|
|
1458
1458
|
className: "str-chat__message-bubble",
|
|
1459
1459
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1460
|
-
children: n ? /* @__PURE__ */ s("div", { className:
|
|
1460
|
+
children: n ? /* @__PURE__ */ s("div", { className: dt(t), children: /* @__PURE__ */ s(ut, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(ws, { ...a }) : /* @__PURE__ */ s(_s, { ...a })
|
|
1461
1461
|
}
|
|
1462
1462
|
) })
|
|
1463
1463
|
}
|
|
1464
1464
|
)
|
|
1465
1465
|
] });
|
|
1466
|
-
},
|
|
1466
|
+
}, $a = ({
|
|
1467
1467
|
message: e
|
|
1468
1468
|
}) => {
|
|
1469
|
-
const t =
|
|
1469
|
+
const t = mt(e);
|
|
1470
1470
|
if (t)
|
|
1471
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1472
|
-
const n =
|
|
1473
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1474
|
-
},
|
|
1471
|
+
return /* @__PURE__ */ s("div", { className: dt(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ut, { attachment: t, isMyMessage: !0 }) });
|
|
1472
|
+
const n = ht(e);
|
|
1473
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ws, { ...n }) }) : null;
|
|
1474
|
+
}, Ba = ({
|
|
1475
1475
|
message: e
|
|
1476
1476
|
}) => {
|
|
1477
|
-
const t =
|
|
1477
|
+
const t = mt(e);
|
|
1478
1478
|
if (t)
|
|
1479
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1480
|
-
const n =
|
|
1481
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1482
|
-
},
|
|
1483
|
-
Creator:
|
|
1484
|
-
Visitor:
|
|
1485
|
-
}),
|
|
1479
|
+
return /* @__PURE__ */ s("div", { className: dt(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ut, { attachment: t, isMyMessage: !1 }) });
|
|
1480
|
+
const n = ht(e);
|
|
1481
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(_s, { ...n }) }) : null;
|
|
1482
|
+
}, il = Object.assign(Oa, {
|
|
1483
|
+
Creator: $a,
|
|
1484
|
+
Visitor: Ba
|
|
1485
|
+
}), Ua = {
|
|
1486
1486
|
dark: "bg-[#121110]",
|
|
1487
1487
|
light: "bg-[#e9eaed]"
|
|
1488
|
-
},
|
|
1488
|
+
}, ja = {
|
|
1489
1489
|
dark: "text-white",
|
|
1490
1490
|
light: "text-[#080707]"
|
|
1491
|
-
},
|
|
1491
|
+
}, Va = {
|
|
1492
1492
|
dark: "border-white/[0.08]",
|
|
1493
1493
|
light: "border-black/[0.08]"
|
|
1494
|
-
},
|
|
1494
|
+
}, Ga = (e) => e === "dark" ? "sender" : "receiver", Ha = {
|
|
1495
1495
|
sender: {
|
|
1496
1496
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1497
1497
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1513,7 +1513,7 @@ const _s = ({
|
|
|
1513
1513
|
children: i,
|
|
1514
1514
|
"data-testid": o
|
|
1515
1515
|
}) => {
|
|
1516
|
-
const l = t != null && t !== "", d =
|
|
1516
|
+
const l = t != null && t !== "", d = Ha[Ga(e)][a];
|
|
1517
1517
|
return /* @__PURE__ */ m(
|
|
1518
1518
|
"div",
|
|
1519
1519
|
{
|
|
@@ -1528,10 +1528,10 @@ const _s = ({
|
|
|
1528
1528
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1529
1529
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1530
1530
|
d,
|
|
1531
|
-
|
|
1532
|
-
|
|
1531
|
+
Ua[e],
|
|
1532
|
+
ja[e],
|
|
1533
1533
|
n && "border",
|
|
1534
|
-
n &&
|
|
1534
|
+
n && Va[e],
|
|
1535
1535
|
r
|
|
1536
1536
|
),
|
|
1537
1537
|
children: [
|
|
@@ -1574,16 +1574,16 @@ const _s = ({
|
|
|
1574
1574
|
),
|
|
1575
1575
|
children: /* @__PURE__ */ s(Ue, { className: "size-3", weight: "bold" })
|
|
1576
1576
|
}
|
|
1577
|
-
), Me = (e) => e === "received" ? "light" : "dark",
|
|
1577
|
+
), Me = (e) => e === "received" ? "light" : "dark", Ya = ({
|
|
1578
1578
|
firstOfGroup: e,
|
|
1579
1579
|
endOfGroup: t,
|
|
1580
1580
|
groupedByUser: n
|
|
1581
|
-
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
1581
|
+
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", qa = ({
|
|
1582
1582
|
src: e,
|
|
1583
1583
|
mimeType: t,
|
|
1584
1584
|
filename: n,
|
|
1585
1585
|
items: a
|
|
1586
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [],
|
|
1586
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], Wa = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1587
1587
|
/* @__PURE__ */ s(
|
|
1588
1588
|
"audio",
|
|
1589
1589
|
{
|
|
@@ -1595,7 +1595,7 @@ const _s = ({
|
|
|
1595
1595
|
}
|
|
1596
1596
|
),
|
|
1597
1597
|
n ?? null
|
|
1598
|
-
] }),
|
|
1598
|
+
] }), ft = ({
|
|
1599
1599
|
state: e,
|
|
1600
1600
|
src: t,
|
|
1601
1601
|
mimeType: n,
|
|
@@ -1606,7 +1606,7 @@ const _s = ({
|
|
|
1606
1606
|
preload: l,
|
|
1607
1607
|
onDismiss: d
|
|
1608
1608
|
}) => {
|
|
1609
|
-
const u = Me(e), p = e === "composer" && !!d, h =
|
|
1609
|
+
const u = Me(e), p = e === "composer" && !!d, h = qa({ src: t, mimeType: n, filename: a, items: r });
|
|
1610
1610
|
if (h.length === 0)
|
|
1611
1611
|
return null;
|
|
1612
1612
|
const f = l ?? (h.length > 1 ? "none" : "metadata");
|
|
@@ -1618,7 +1618,7 @@ const _s = ({
|
|
|
1618
1618
|
groupPosition: o,
|
|
1619
1619
|
"data-testid": "audio-attachment",
|
|
1620
1620
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((c, v) => /* @__PURE__ */ s(
|
|
1621
|
-
|
|
1621
|
+
Wa,
|
|
1622
1622
|
{
|
|
1623
1623
|
item: c,
|
|
1624
1624
|
preload: f,
|
|
@@ -1632,15 +1632,15 @@ const _s = ({
|
|
|
1632
1632
|
)) })
|
|
1633
1633
|
}
|
|
1634
1634
|
);
|
|
1635
|
-
},
|
|
1636
|
-
Composer:
|
|
1637
|
-
Sent:
|
|
1638
|
-
Received:
|
|
1635
|
+
}, Xa = (e) => /* @__PURE__ */ s(ft, { ...e, state: "composer" }), Ka = (e) => /* @__PURE__ */ s(ft, { ...e, state: "sent" }), Ja = (e) => /* @__PURE__ */ s(ft, { ...e, state: "received" }), Za = {
|
|
1636
|
+
Composer: Xa,
|
|
1637
|
+
Sent: Ka,
|
|
1638
|
+
Received: Ja
|
|
1639
1639
|
};
|
|
1640
|
-
function
|
|
1640
|
+
function Qa(e) {
|
|
1641
1641
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
1642
1642
|
}
|
|
1643
|
-
const
|
|
1643
|
+
const er = {
|
|
1644
1644
|
pdf: "PDF",
|
|
1645
1645
|
doc: "DOC",
|
|
1646
1646
|
xls: "XLS",
|
|
@@ -1650,7 +1650,7 @@ const nr = {
|
|
|
1650
1650
|
text: "TXT",
|
|
1651
1651
|
markdown: "MD"
|
|
1652
1652
|
};
|
|
1653
|
-
function
|
|
1653
|
+
function tr(e, t) {
|
|
1654
1654
|
if (t) {
|
|
1655
1655
|
const r = t.lastIndexOf(".");
|
|
1656
1656
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -1659,8 +1659,8 @@ function ar(e, t) {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
}
|
|
1661
1661
|
if (!e) return;
|
|
1662
|
-
if (
|
|
1663
|
-
const r =
|
|
1662
|
+
if (le(e) === "document") {
|
|
1663
|
+
const r = gs(e), i = er[r];
|
|
1664
1664
|
if (i) return i;
|
|
1665
1665
|
if (e === "application/octet-stream") return;
|
|
1666
1666
|
}
|
|
@@ -1668,8 +1668,8 @@ function ar(e, t) {
|
|
|
1668
1668
|
if (!(!a || a === "*"))
|
|
1669
1669
|
return a.toUpperCase();
|
|
1670
1670
|
}
|
|
1671
|
-
function
|
|
1672
|
-
const a =
|
|
1671
|
+
function sr(e, t, n) {
|
|
1672
|
+
const a = tr(e, t), r = typeof n == "number" && n > 0 ? Qa(n) : void 0;
|
|
1673
1673
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1674
1674
|
}
|
|
1675
1675
|
function re(e) {
|
|
@@ -1680,16 +1680,16 @@ function re(e) {
|
|
|
1680
1680
|
return "download";
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const
|
|
1683
|
+
const nr = {
|
|
1684
1684
|
dark: "text-white/55",
|
|
1685
1685
|
light: "text-black/65"
|
|
1686
|
-
},
|
|
1686
|
+
}, ar = {
|
|
1687
1687
|
dark: "bg-white/10",
|
|
1688
1688
|
light: "bg-black/5"
|
|
1689
|
-
},
|
|
1689
|
+
}, rr = {
|
|
1690
1690
|
dark: "text-white/85",
|
|
1691
1691
|
light: "text-black/85"
|
|
1692
|
-
},
|
|
1692
|
+
}, Ns = ({
|
|
1693
1693
|
variant: e,
|
|
1694
1694
|
filename: t,
|
|
1695
1695
|
title: n,
|
|
@@ -1699,16 +1699,16 @@ const ir = {
|
|
|
1699
1699
|
activateLabel: o,
|
|
1700
1700
|
trailingAction: l
|
|
1701
1701
|
}) => {
|
|
1702
|
-
const d = n ?? t ?? "File", u =
|
|
1702
|
+
const d = n ?? t ?? "File", u = sr(a, t, r), p = /* @__PURE__ */ s(
|
|
1703
1703
|
"div",
|
|
1704
1704
|
{
|
|
1705
1705
|
className: k(
|
|
1706
1706
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1707
|
-
|
|
1707
|
+
ar[e]
|
|
1708
1708
|
),
|
|
1709
1709
|
"aria-hidden": !0,
|
|
1710
1710
|
children: we(a, {
|
|
1711
|
-
className: k("size-6",
|
|
1711
|
+
className: k("size-6", rr[e]),
|
|
1712
1712
|
weight: "regular"
|
|
1713
1713
|
})
|
|
1714
1714
|
}
|
|
@@ -1719,7 +1719,7 @@ const ir = {
|
|
|
1719
1719
|
{
|
|
1720
1720
|
className: k(
|
|
1721
1721
|
"truncate text-xs leading-4",
|
|
1722
|
-
|
|
1722
|
+
nr[e]
|
|
1723
1723
|
),
|
|
1724
1724
|
children: u
|
|
1725
1725
|
}
|
|
@@ -1739,7 +1739,7 @@ const ir = {
|
|
|
1739
1739
|
h
|
|
1740
1740
|
]
|
|
1741
1741
|
}
|
|
1742
|
-
) : /* @__PURE__ */ m(
|
|
1742
|
+
) : /* @__PURE__ */ m(te, { children: [
|
|
1743
1743
|
p,
|
|
1744
1744
|
h
|
|
1745
1745
|
] });
|
|
@@ -1748,7 +1748,7 @@ const ir = {
|
|
|
1748
1748
|
l ? /* @__PURE__ */ s("div", { className: "shrink-0", children: l }) : null
|
|
1749
1749
|
] });
|
|
1750
1750
|
};
|
|
1751
|
-
async function
|
|
1751
|
+
async function ys(e, t) {
|
|
1752
1752
|
const n = t ?? re(e);
|
|
1753
1753
|
try {
|
|
1754
1754
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -1762,14 +1762,14 @@ async function ks(e, t) {
|
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
1765
|
-
const
|
|
1765
|
+
const ir = ({
|
|
1766
1766
|
src: e,
|
|
1767
1767
|
filename: t,
|
|
1768
1768
|
fileSize: n,
|
|
1769
1769
|
mimeType: a,
|
|
1770
1770
|
title: r,
|
|
1771
1771
|
items: i
|
|
1772
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [],
|
|
1772
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], lr = ({
|
|
1773
1773
|
variant: e,
|
|
1774
1774
|
item: t,
|
|
1775
1775
|
index: n,
|
|
@@ -1778,7 +1778,7 @@ const cr = ({
|
|
|
1778
1778
|
}) => {
|
|
1779
1779
|
const i = t.filename ?? re(t.src);
|
|
1780
1780
|
return /* @__PURE__ */ s(
|
|
1781
|
-
|
|
1781
|
+
Ns,
|
|
1782
1782
|
{
|
|
1783
1783
|
variant: e,
|
|
1784
1784
|
filename: i,
|
|
@@ -1790,7 +1790,7 @@ const cr = ({
|
|
|
1790
1790
|
trailingAction: r
|
|
1791
1791
|
}
|
|
1792
1792
|
);
|
|
1793
|
-
},
|
|
1793
|
+
}, gt = ({
|
|
1794
1794
|
state: e,
|
|
1795
1795
|
src: t,
|
|
1796
1796
|
filename: n,
|
|
@@ -1803,7 +1803,7 @@ const cr = ({
|
|
|
1803
1803
|
onClick: u,
|
|
1804
1804
|
onDismiss: p
|
|
1805
1805
|
}) => {
|
|
1806
|
-
const h = Me(e), f = e === "composer" && !!p, c =
|
|
1806
|
+
const h = Me(e), f = e === "composer" && !!p, c = ir({
|
|
1807
1807
|
src: t,
|
|
1808
1808
|
filename: n,
|
|
1809
1809
|
fileSize: a,
|
|
@@ -1815,7 +1815,7 @@ const cr = ({
|
|
|
1815
1815
|
const g = c[b];
|
|
1816
1816
|
if (!g) return;
|
|
1817
1817
|
const x = g.filename ?? re(g.src);
|
|
1818
|
-
|
|
1818
|
+
ys(g.src, x);
|
|
1819
1819
|
};
|
|
1820
1820
|
if (c.length === 0)
|
|
1821
1821
|
return null;
|
|
@@ -1827,7 +1827,7 @@ const cr = ({
|
|
|
1827
1827
|
h === "dark" ? "text-white/70" : "text-black/70"
|
|
1828
1828
|
),
|
|
1829
1829
|
"aria-hidden": !0,
|
|
1830
|
-
children: /* @__PURE__ */ s(
|
|
1830
|
+
children: /* @__PURE__ */ s(Ce, { className: "size-5", weight: "bold" })
|
|
1831
1831
|
}
|
|
1832
1832
|
);
|
|
1833
1833
|
return /* @__PURE__ */ s(
|
|
@@ -1838,7 +1838,7 @@ const cr = ({
|
|
|
1838
1838
|
groupPosition: d,
|
|
1839
1839
|
"data-testid": "file-attachment",
|
|
1840
1840
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((b, g) => /* @__PURE__ */ s(
|
|
1841
|
-
|
|
1841
|
+
lr,
|
|
1842
1842
|
{
|
|
1843
1843
|
variant: h,
|
|
1844
1844
|
item: b,
|
|
@@ -1850,16 +1850,16 @@ const cr = ({
|
|
|
1850
1850
|
)) })
|
|
1851
1851
|
}
|
|
1852
1852
|
);
|
|
1853
|
-
},
|
|
1854
|
-
Composer:
|
|
1855
|
-
Sent:
|
|
1856
|
-
Received:
|
|
1857
|
-
},
|
|
1853
|
+
}, or = (e) => /* @__PURE__ */ s(gt, { ...e, state: "composer" }), cr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "sent" }), dr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "received" }), ur = {
|
|
1854
|
+
Composer: or,
|
|
1855
|
+
Sent: cr,
|
|
1856
|
+
Received: dr
|
|
1857
|
+
}, pt = ({
|
|
1858
1858
|
onPrev: e,
|
|
1859
1859
|
onNext: t,
|
|
1860
1860
|
prevLabel: n = "Previous",
|
|
1861
1861
|
nextLabel: a = "Next"
|
|
1862
|
-
}) => /* @__PURE__ */ m(
|
|
1862
|
+
}) => /* @__PURE__ */ m(te, { children: [
|
|
1863
1863
|
/* @__PURE__ */ s(
|
|
1864
1864
|
"button",
|
|
1865
1865
|
{
|
|
@@ -1867,7 +1867,7 @@ const cr = ({
|
|
|
1867
1867
|
onClick: e,
|
|
1868
1868
|
"aria-label": n,
|
|
1869
1869
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
1870
|
-
children: /* @__PURE__ */ s(
|
|
1870
|
+
children: /* @__PURE__ */ s(Gn, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1871
1871
|
}
|
|
1872
1872
|
),
|
|
1873
1873
|
/* @__PURE__ */ s(
|
|
@@ -1880,7 +1880,7 @@ const cr = ({
|
|
|
1880
1880
|
children: /* @__PURE__ */ s(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1881
1881
|
}
|
|
1882
1882
|
)
|
|
1883
|
-
] }),
|
|
1883
|
+
] }), ks = ({
|
|
1884
1884
|
url: e,
|
|
1885
1885
|
filename: t,
|
|
1886
1886
|
variant: n = "pill",
|
|
@@ -1891,7 +1891,7 @@ const cr = ({
|
|
|
1891
1891
|
}) => {
|
|
1892
1892
|
const [l, d] = U(!1), u = Z(
|
|
1893
1893
|
(c) => {
|
|
1894
|
-
c.stopPropagation(), !l && (d(!0),
|
|
1894
|
+
c.stopPropagation(), !l && (d(!0), ys(e, t).catch(() => {
|
|
1895
1895
|
}).finally(() => {
|
|
1896
1896
|
d(!1), o == null || o();
|
|
1897
1897
|
}));
|
|
@@ -1916,14 +1916,14 @@ const cr = ({
|
|
|
1916
1916
|
}[i]
|
|
1917
1917
|
),
|
|
1918
1918
|
children: l ? /* @__PURE__ */ s(
|
|
1919
|
-
|
|
1919
|
+
ke,
|
|
1920
1920
|
{
|
|
1921
1921
|
className: "size-4 animate-spin",
|
|
1922
1922
|
weight: "bold",
|
|
1923
1923
|
"aria-hidden": !0
|
|
1924
1924
|
}
|
|
1925
1925
|
) : /* @__PURE__ */ s(
|
|
1926
|
-
|
|
1926
|
+
Ce,
|
|
1927
1927
|
{
|
|
1928
1928
|
className: "size-5 shrink-0",
|
|
1929
1929
|
weight: "bold",
|
|
@@ -1939,7 +1939,7 @@ const cr = ({
|
|
|
1939
1939
|
disabled: l,
|
|
1940
1940
|
"aria-label": a,
|
|
1941
1941
|
className: "mes-media-viewer__action",
|
|
1942
|
-
children: l ? /* @__PURE__ */ s(
|
|
1942
|
+
children: l ? /* @__PURE__ */ s(ke, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ s(Ce, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1943
1943
|
}
|
|
1944
1944
|
) : /* @__PURE__ */ m(
|
|
1945
1945
|
"button",
|
|
@@ -1954,18 +1954,18 @@ const cr = ({
|
|
|
1954
1954
|
),
|
|
1955
1955
|
children: [
|
|
1956
1956
|
l ? /* @__PURE__ */ s(
|
|
1957
|
-
|
|
1957
|
+
ke,
|
|
1958
1958
|
{
|
|
1959
1959
|
className: "size-4 animate-spin",
|
|
1960
1960
|
weight: "bold",
|
|
1961
1961
|
"aria-hidden": !0
|
|
1962
1962
|
}
|
|
1963
|
-
) : /* @__PURE__ */ s(
|
|
1963
|
+
) : /* @__PURE__ */ s(Ce, { ...f, "aria-hidden": !0 }),
|
|
1964
1964
|
p ? null : a
|
|
1965
1965
|
]
|
|
1966
1966
|
}
|
|
1967
1967
|
);
|
|
1968
|
-
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n),
|
|
1968
|
+
}, Xe = (e, t, n) => Math.min(Math.max(e, t), n), bt = ({
|
|
1969
1969
|
length: e,
|
|
1970
1970
|
initialIndex: t,
|
|
1971
1971
|
open: n
|
|
@@ -1990,7 +1990,7 @@ const cr = ({
|
|
|
1990
1990
|
};
|
|
1991
1991
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
1992
1992
|
}, [n, e, o, l]), { index: r, prev: o, next: l };
|
|
1993
|
-
},
|
|
1993
|
+
}, vt = ({
|
|
1994
1994
|
open: e,
|
|
1995
1995
|
onClose: t,
|
|
1996
1996
|
ariaLabel: n,
|
|
@@ -2080,29 +2080,29 @@ const cr = ({
|
|
|
2080
2080
|
]
|
|
2081
2081
|
}
|
|
2082
2082
|
);
|
|
2083
|
-
},
|
|
2083
|
+
}, Cs = ({
|
|
2084
2084
|
open: e,
|
|
2085
2085
|
items: t,
|
|
2086
2086
|
initialIndex: n = 0,
|
|
2087
2087
|
onClose: a
|
|
2088
2088
|
}) => {
|
|
2089
|
-
const { index: r, prev: i, next: o } =
|
|
2089
|
+
const { index: r, prev: i, next: o } = bt({
|
|
2090
2090
|
length: t.length,
|
|
2091
2091
|
initialIndex: n,
|
|
2092
2092
|
open: e
|
|
2093
|
-
}), l = t[r], d =
|
|
2093
|
+
}), l = t[r], d = ae(
|
|
2094
2094
|
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "image"),
|
|
2095
2095
|
[l]
|
|
2096
2096
|
);
|
|
2097
2097
|
return l ? /* @__PURE__ */ m(
|
|
2098
|
-
|
|
2098
|
+
vt,
|
|
2099
2099
|
{
|
|
2100
2100
|
open: e,
|
|
2101
2101
|
onClose: a,
|
|
2102
2102
|
ariaLabel: d,
|
|
2103
2103
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
2104
2104
|
actions: /* @__PURE__ */ s(
|
|
2105
|
-
|
|
2105
|
+
ks,
|
|
2106
2106
|
{
|
|
2107
2107
|
url: l.src,
|
|
2108
2108
|
filename: d,
|
|
@@ -2125,7 +2125,7 @@ const cr = ({
|
|
|
2125
2125
|
`${r}:${l.src}`
|
|
2126
2126
|
),
|
|
2127
2127
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2128
|
-
|
|
2128
|
+
pt,
|
|
2129
2129
|
{
|
|
2130
2130
|
onPrev: i,
|
|
2131
2131
|
onNext: o,
|
|
@@ -2136,7 +2136,7 @@ const cr = ({
|
|
|
2136
2136
|
]
|
|
2137
2137
|
}
|
|
2138
2138
|
) : null;
|
|
2139
|
-
},
|
|
2139
|
+
}, mr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", Es = ({
|
|
2140
2140
|
tiles: e,
|
|
2141
2141
|
onTileActivate: t,
|
|
2142
2142
|
maxVisible: n = 4,
|
|
@@ -2145,7 +2145,7 @@ const cr = ({
|
|
|
2145
2145
|
const r = e.length;
|
|
2146
2146
|
if (r === 0) return null;
|
|
2147
2147
|
const i = e.slice(0, Math.min(r, n)), o = r - i.length, l = (d, u, p) => {
|
|
2148
|
-
const h = k(
|
|
2148
|
+
const h = k(mr, "h-full w-full");
|
|
2149
2149
|
return t ? /* @__PURE__ */ m(
|
|
2150
2150
|
"button",
|
|
2151
2151
|
{
|
|
@@ -2214,7 +2214,7 @@ const cr = ({
|
|
|
2214
2214
|
[e]
|
|
2215
2215
|
), o = Z(() => n(!1), []);
|
|
2216
2216
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
2217
|
-
},
|
|
2217
|
+
}, hr = (e, t, n, a) => ({
|
|
2218
2218
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
2219
2219
|
content: /* @__PURE__ */ s(
|
|
2220
2220
|
"img",
|
|
@@ -2229,15 +2229,15 @@ const cr = ({
|
|
|
2229
2229
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2230
2230
|
}
|
|
2231
2231
|
)
|
|
2232
|
-
}),
|
|
2232
|
+
}), fr = ({
|
|
2233
2233
|
src: e,
|
|
2234
2234
|
alt: t,
|
|
2235
2235
|
items: n
|
|
2236
|
-
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [],
|
|
2236
|
+
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Ss = (e, t) => e.map((n, a) => ({
|
|
2237
2237
|
src: n.src,
|
|
2238
2238
|
alt: n.alt,
|
|
2239
2239
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2240
|
-
})),
|
|
2240
|
+
})), gr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2241
2241
|
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } = Re(
|
|
2242
2242
|
r
|
|
2243
2243
|
);
|
|
@@ -2264,16 +2264,16 @@ const cr = ({
|
|
|
2264
2264
|
),
|
|
2265
2265
|
i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: i }) }) : null,
|
|
2266
2266
|
/* @__PURE__ */ s(
|
|
2267
|
-
|
|
2267
|
+
Cs,
|
|
2268
2268
|
{
|
|
2269
2269
|
open: o,
|
|
2270
|
-
items:
|
|
2270
|
+
items: Ss([{ src: e, alt: t }], n),
|
|
2271
2271
|
initialIndex: l,
|
|
2272
2272
|
onClose: u
|
|
2273
2273
|
}
|
|
2274
2274
|
)
|
|
2275
2275
|
] });
|
|
2276
|
-
},
|
|
2276
|
+
}, Is = ({
|
|
2277
2277
|
state: e,
|
|
2278
2278
|
src: t,
|
|
2279
2279
|
alt: n,
|
|
@@ -2284,13 +2284,13 @@ const cr = ({
|
|
|
2284
2284
|
loading: l = "lazy",
|
|
2285
2285
|
onClick: d
|
|
2286
2286
|
}) => {
|
|
2287
|
-
const u =
|
|
2287
|
+
const u = fr({ src: t, alt: n, items: r }), p = Me(e), { viewerOpen: h, viewerIndex: f, handleActivate: c, closeViewer: v } = Re(
|
|
2288
2288
|
d
|
|
2289
2289
|
);
|
|
2290
2290
|
if (u.length === 0)
|
|
2291
2291
|
return null;
|
|
2292
2292
|
const w = u.map(
|
|
2293
|
-
(b, g) =>
|
|
2293
|
+
(b, g) => hr(b, g, u.length, l)
|
|
2294
2294
|
);
|
|
2295
2295
|
return /* @__PURE__ */ m(
|
|
2296
2296
|
Te,
|
|
@@ -2302,10 +2302,10 @@ const cr = ({
|
|
|
2302
2302
|
children: [
|
|
2303
2303
|
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Es, { tiles: w, onTileActivate: c }) }),
|
|
2304
2304
|
/* @__PURE__ */ s(
|
|
2305
|
-
|
|
2305
|
+
Cs,
|
|
2306
2306
|
{
|
|
2307
2307
|
open: h,
|
|
2308
|
-
items:
|
|
2308
|
+
items: Ss(u, a),
|
|
2309
2309
|
initialIndex: f,
|
|
2310
2310
|
onClose: v
|
|
2311
2311
|
}
|
|
@@ -2313,29 +2313,29 @@ const cr = ({
|
|
|
2313
2313
|
]
|
|
2314
2314
|
}
|
|
2315
2315
|
);
|
|
2316
|
-
},
|
|
2317
|
-
Composer:
|
|
2318
|
-
Sent:
|
|
2319
|
-
Received:
|
|
2320
|
-
},
|
|
2316
|
+
}, pr = (e) => /* @__PURE__ */ s(gr, { ...e }), br = (e) => /* @__PURE__ */ s(Is, { ...e, state: "sent" }), vr = (e) => /* @__PURE__ */ s(Is, { ...e, state: "received" }), xr = {
|
|
2317
|
+
Composer: pr,
|
|
2318
|
+
Sent: br,
|
|
2319
|
+
Received: vr
|
|
2320
|
+
}, wr = ({
|
|
2321
2321
|
open: e,
|
|
2322
2322
|
items: t,
|
|
2323
2323
|
initialIndex: n = 0,
|
|
2324
2324
|
onClose: a
|
|
2325
2325
|
}) => {
|
|
2326
|
-
const { index: r, prev: i, next: o } =
|
|
2326
|
+
const { index: r, prev: i, next: o } = bt({
|
|
2327
2327
|
length: t.length,
|
|
2328
2328
|
initialIndex: n,
|
|
2329
2329
|
open: e
|
|
2330
|
-
}), l = t[r], d =
|
|
2330
|
+
}), l = t[r], d = ae(
|
|
2331
2331
|
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "document"),
|
|
2332
2332
|
[l]
|
|
2333
|
-
), u =
|
|
2334
|
-
() => l ?
|
|
2333
|
+
), u = ae(
|
|
2334
|
+
() => l ? _r(l.src) : void 0,
|
|
2335
2335
|
[l]
|
|
2336
2336
|
);
|
|
2337
2337
|
return !l || !u ? null : /* @__PURE__ */ m(
|
|
2338
|
-
|
|
2338
|
+
vt,
|
|
2339
2339
|
{
|
|
2340
2340
|
open: e,
|
|
2341
2341
|
onClose: a,
|
|
@@ -2354,7 +2354,7 @@ const cr = ({
|
|
|
2354
2354
|
`${r}:${l.src}`
|
|
2355
2355
|
),
|
|
2356
2356
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2357
|
-
|
|
2357
|
+
pt,
|
|
2358
2358
|
{
|
|
2359
2359
|
onPrev: i,
|
|
2360
2360
|
onNext: o,
|
|
@@ -2365,16 +2365,16 @@ const cr = ({
|
|
|
2365
2365
|
]
|
|
2366
2366
|
}
|
|
2367
2367
|
);
|
|
2368
|
-
},
|
|
2368
|
+
}, _r = (e) => {
|
|
2369
2369
|
const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
2370
2370
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
|
|
2371
|
-
},
|
|
2371
|
+
}, Nr = ({
|
|
2372
2372
|
src: e,
|
|
2373
2373
|
filename: t,
|
|
2374
2374
|
fileSize: n,
|
|
2375
2375
|
title: a,
|
|
2376
2376
|
items: r
|
|
2377
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [],
|
|
2377
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], yr = ({
|
|
2378
2378
|
variant: e,
|
|
2379
2379
|
item: t,
|
|
2380
2380
|
index: n,
|
|
@@ -2383,7 +2383,7 @@ const cr = ({
|
|
|
2383
2383
|
}) => {
|
|
2384
2384
|
const i = t.filename ?? re(t.src);
|
|
2385
2385
|
return /* @__PURE__ */ s(
|
|
2386
|
-
|
|
2386
|
+
Ns,
|
|
2387
2387
|
{
|
|
2388
2388
|
variant: e,
|
|
2389
2389
|
filename: i,
|
|
@@ -2395,7 +2395,7 @@ const cr = ({
|
|
|
2395
2395
|
trailingAction: r
|
|
2396
2396
|
}
|
|
2397
2397
|
);
|
|
2398
|
-
},
|
|
2398
|
+
}, xt = ({
|
|
2399
2399
|
state: e,
|
|
2400
2400
|
src: t,
|
|
2401
2401
|
filename: n,
|
|
@@ -2407,7 +2407,7 @@ const cr = ({
|
|
|
2407
2407
|
onClick: d,
|
|
2408
2408
|
onDismiss: u
|
|
2409
2409
|
}) => {
|
|
2410
|
-
const p = Me(e), h =
|
|
2410
|
+
const p = Me(e), h = Nr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2411
2411
|
d
|
|
2412
2412
|
), b = e === "composer" && !!u;
|
|
2413
2413
|
if (h.length === 0)
|
|
@@ -2426,7 +2426,7 @@ const cr = ({
|
|
|
2426
2426
|
children: [
|
|
2427
2427
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((x, N) => {
|
|
2428
2428
|
const C = x.filename ?? re(x.src), T = b && N === 0 ? /* @__PURE__ */ s(Ae, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2429
|
-
|
|
2429
|
+
ks,
|
|
2430
2430
|
{
|
|
2431
2431
|
url: x.src,
|
|
2432
2432
|
filename: C,
|
|
@@ -2436,7 +2436,7 @@ const cr = ({
|
|
|
2436
2436
|
}
|
|
2437
2437
|
);
|
|
2438
2438
|
return /* @__PURE__ */ s(
|
|
2439
|
-
|
|
2439
|
+
yr,
|
|
2440
2440
|
{
|
|
2441
2441
|
variant: p,
|
|
2442
2442
|
item: x,
|
|
@@ -2448,7 +2448,7 @@ const cr = ({
|
|
|
2448
2448
|
);
|
|
2449
2449
|
}) }),
|
|
2450
2450
|
/* @__PURE__ */ s(
|
|
2451
|
-
|
|
2451
|
+
wr,
|
|
2452
2452
|
{
|
|
2453
2453
|
open: f,
|
|
2454
2454
|
items: g,
|
|
@@ -2459,26 +2459,26 @@ const cr = ({
|
|
|
2459
2459
|
]
|
|
2460
2460
|
}
|
|
2461
2461
|
);
|
|
2462
|
-
},
|
|
2463
|
-
Composer:
|
|
2464
|
-
Sent:
|
|
2465
|
-
Received:
|
|
2466
|
-
},
|
|
2462
|
+
}, kr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "composer" }), Cr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "sent" }), Er = (e) => /* @__PURE__ */ s(xt, { ...e, state: "received" }), Sr = {
|
|
2463
|
+
Composer: kr,
|
|
2464
|
+
Sent: Cr,
|
|
2465
|
+
Received: Er
|
|
2466
|
+
}, Ts = ({
|
|
2467
2467
|
open: e,
|
|
2468
2468
|
items: t,
|
|
2469
2469
|
initialIndex: n = 0,
|
|
2470
2470
|
onClose: a
|
|
2471
2471
|
}) => {
|
|
2472
|
-
const { index: r, prev: i, next: o } =
|
|
2472
|
+
const { index: r, prev: i, next: o } = bt({
|
|
2473
2473
|
length: t.length,
|
|
2474
2474
|
initialIndex: n,
|
|
2475
2475
|
open: e
|
|
2476
|
-
}), l = t[r], d =
|
|
2476
|
+
}), l = t[r], d = ae(
|
|
2477
2477
|
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "video"),
|
|
2478
2478
|
[l]
|
|
2479
2479
|
);
|
|
2480
2480
|
return l ? /* @__PURE__ */ m(
|
|
2481
|
-
|
|
2481
|
+
vt,
|
|
2482
2482
|
{
|
|
2483
2483
|
open: e,
|
|
2484
2484
|
onClose: a,
|
|
@@ -2502,7 +2502,7 @@ const cr = ({
|
|
|
2502
2502
|
`${r}:${l.src}`
|
|
2503
2503
|
),
|
|
2504
2504
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2505
|
-
|
|
2505
|
+
pt,
|
|
2506
2506
|
{
|
|
2507
2507
|
onPrev: i,
|
|
2508
2508
|
onNext: o,
|
|
@@ -2513,7 +2513,7 @@ const cr = ({
|
|
|
2513
2513
|
]
|
|
2514
2514
|
}
|
|
2515
2515
|
) : null;
|
|
2516
|
-
},
|
|
2516
|
+
}, Ir = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(et, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), As = ({
|
|
2517
2517
|
item: e,
|
|
2518
2518
|
index: t
|
|
2519
2519
|
}) => /* @__PURE__ */ m("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2528,30 +2528,30 @@ const cr = ({
|
|
|
2528
2528
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2529
2529
|
}
|
|
2530
2530
|
) : /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
2531
|
-
|
|
2531
|
+
os,
|
|
2532
2532
|
{
|
|
2533
2533
|
className: "size-16 rounded-md text-white/30",
|
|
2534
2534
|
weight: "regular",
|
|
2535
2535
|
"aria-hidden": !0
|
|
2536
2536
|
}
|
|
2537
2537
|
) }),
|
|
2538
|
-
/* @__PURE__ */ s(
|
|
2539
|
-
] }),
|
|
2538
|
+
/* @__PURE__ */ s(Ir, {})
|
|
2539
|
+
] }), Tr = (e, t, n) => ({
|
|
2540
2540
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2541
|
-
content: /* @__PURE__ */ s(
|
|
2542
|
-
}),
|
|
2541
|
+
content: /* @__PURE__ */ s(As, { item: e, index: t })
|
|
2542
|
+
}), Ar = ({
|
|
2543
2543
|
src: e,
|
|
2544
2544
|
poster: t,
|
|
2545
2545
|
mimeType: n,
|
|
2546
2546
|
preload: a,
|
|
2547
2547
|
items: r
|
|
2548
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [],
|
|
2548
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Ms = (e, t) => e.map((n, a) => ({
|
|
2549
2549
|
src: n.src,
|
|
2550
2550
|
poster: n.poster,
|
|
2551
2551
|
mimeType: n.mimeType,
|
|
2552
2552
|
preload: n.preload,
|
|
2553
2553
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2554
|
-
})),
|
|
2554
|
+
})), Mr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
2555
2555
|
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: p } = Re(
|
|
2556
2556
|
i
|
|
2557
2557
|
);
|
|
@@ -2563,15 +2563,15 @@ const cr = ({
|
|
|
2563
2563
|
onClick: () => u(0),
|
|
2564
2564
|
"aria-label": "Play video",
|
|
2565
2565
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2566
|
-
children: /* @__PURE__ */ s(
|
|
2566
|
+
children: /* @__PURE__ */ s(As, { item: { src: e, poster: t, mimeType: n }, index: 0 })
|
|
2567
2567
|
}
|
|
2568
2568
|
),
|
|
2569
2569
|
o ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: o }) }) : null,
|
|
2570
2570
|
/* @__PURE__ */ s(
|
|
2571
|
-
|
|
2571
|
+
Ts,
|
|
2572
2572
|
{
|
|
2573
2573
|
open: l,
|
|
2574
|
-
items:
|
|
2574
|
+
items: Ms(
|
|
2575
2575
|
[{ src: e, poster: t, mimeType: n, preload: r }],
|
|
2576
2576
|
a
|
|
2577
2577
|
),
|
|
@@ -2580,7 +2580,7 @@ const cr = ({
|
|
|
2580
2580
|
}
|
|
2581
2581
|
)
|
|
2582
2582
|
] });
|
|
2583
|
-
},
|
|
2583
|
+
}, Rs = ({
|
|
2584
2584
|
state: e,
|
|
2585
2585
|
src: t,
|
|
2586
2586
|
poster: n,
|
|
@@ -2592,13 +2592,13 @@ const cr = ({
|
|
|
2592
2592
|
preload: d,
|
|
2593
2593
|
onClick: u
|
|
2594
2594
|
}) => {
|
|
2595
|
-
const p =
|
|
2595
|
+
const p = Ar({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Me(e), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: w } = Re(
|
|
2596
2596
|
u
|
|
2597
2597
|
);
|
|
2598
2598
|
if (p.length === 0)
|
|
2599
2599
|
return null;
|
|
2600
2600
|
const b = p.map(
|
|
2601
|
-
(g, x) =>
|
|
2601
|
+
(g, x) => Tr(g, x, p.length)
|
|
2602
2602
|
);
|
|
2603
2603
|
return /* @__PURE__ */ m(
|
|
2604
2604
|
Te,
|
|
@@ -2617,10 +2617,10 @@ const cr = ({
|
|
|
2617
2617
|
}
|
|
2618
2618
|
) }),
|
|
2619
2619
|
/* @__PURE__ */ s(
|
|
2620
|
-
|
|
2620
|
+
Ts,
|
|
2621
2621
|
{
|
|
2622
2622
|
open: f,
|
|
2623
|
-
items:
|
|
2623
|
+
items: Ms(p, r),
|
|
2624
2624
|
initialIndex: c,
|
|
2625
2625
|
onClose: w
|
|
2626
2626
|
}
|
|
@@ -2628,25 +2628,25 @@ const cr = ({
|
|
|
2628
2628
|
]
|
|
2629
2629
|
}
|
|
2630
2630
|
);
|
|
2631
|
-
},
|
|
2632
|
-
Composer:
|
|
2633
|
-
Sent:
|
|
2634
|
-
Received:
|
|
2635
|
-
},
|
|
2636
|
-
Image:
|
|
2637
|
-
Video:
|
|
2638
|
-
Audio:
|
|
2639
|
-
Pdf:
|
|
2640
|
-
File:
|
|
2641
|
-
},
|
|
2631
|
+
}, Rr = (e) => /* @__PURE__ */ s(Mr, { ...e }), Lr = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "sent" }), Dr = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "received" }), zr = {
|
|
2632
|
+
Composer: Rr,
|
|
2633
|
+
Sent: Lr,
|
|
2634
|
+
Received: Dr
|
|
2635
|
+
}, Ne = {
|
|
2636
|
+
Image: xr,
|
|
2637
|
+
Video: zr,
|
|
2638
|
+
Audio: Za,
|
|
2639
|
+
Pdf: Sr,
|
|
2640
|
+
File: ur
|
|
2641
|
+
}, Pr = {
|
|
2642
2642
|
isUnlocking: () => !1
|
|
2643
|
-
},
|
|
2644
|
-
LockedAttachment:
|
|
2645
|
-
}, Ls =
|
|
2646
|
-
function
|
|
2647
|
-
return
|
|
2643
|
+
}, Fr = {
|
|
2644
|
+
LockedAttachment: Pr
|
|
2645
|
+
}, Ls = at({}), ll = Ls.Provider;
|
|
2646
|
+
function Or(e) {
|
|
2647
|
+
return Se(Ls)[e] ?? Fr[e];
|
|
2648
2648
|
}
|
|
2649
|
-
const
|
|
2649
|
+
const $r = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2650
2650
|
"svg",
|
|
2651
2651
|
{
|
|
2652
2652
|
width: e,
|
|
@@ -2663,21 +2663,21 @@ const jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2663
2663
|
}
|
|
2664
2664
|
)
|
|
2665
2665
|
}
|
|
2666
|
-
),
|
|
2666
|
+
), Br = (e) => {
|
|
2667
2667
|
var t;
|
|
2668
2668
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
2669
|
-
},
|
|
2669
|
+
}, Ur = (e) => {
|
|
2670
2670
|
var t;
|
|
2671
2671
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2672
2672
|
}, Fe = (e) => {
|
|
2673
2673
|
var t;
|
|
2674
2674
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
2675
|
-
},
|
|
2675
|
+
}, jr = (e) => {
|
|
2676
2676
|
var t;
|
|
2677
2677
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
2678
|
-
},
|
|
2678
|
+
}, Ds = (e) => Br(e) || Ur(e), Vr = (e) => {
|
|
2679
2679
|
var t;
|
|
2680
|
-
return
|
|
2680
|
+
return Ds(e) && !((t = e.text) != null && t.trim());
|
|
2681
2681
|
}, Ke = ({
|
|
2682
2682
|
message: e,
|
|
2683
2683
|
standalone: t = !1,
|
|
@@ -2685,7 +2685,7 @@ const jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2685
2685
|
hasAttachment: a = !1
|
|
2686
2686
|
}) => {
|
|
2687
2687
|
var h;
|
|
2688
|
-
const r =
|
|
2688
|
+
const r = Ds(e), i = Fe(e);
|
|
2689
2689
|
if (!r && !i)
|
|
2690
2690
|
return null;
|
|
2691
2691
|
if (r) {
|
|
@@ -2693,7 +2693,7 @@ const jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2693
2693
|
if (!f) return null;
|
|
2694
2694
|
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", v = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
2695
2695
|
return /* @__PURE__ */ m("div", { className: c, children: [
|
|
2696
|
-
/* @__PURE__ */ s(
|
|
2696
|
+
/* @__PURE__ */ s(Hn, { size: t ? 14 : 12 }),
|
|
2697
2697
|
/* @__PURE__ */ s("span", { children: v })
|
|
2698
2698
|
] });
|
|
2699
2699
|
}
|
|
@@ -2701,15 +2701,15 @@ const jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2701
2701
|
"message-chatbot-indicator",
|
|
2702
2702
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2703
2703
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2704
|
-
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(
|
|
2705
|
-
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ m(
|
|
2704
|
+
].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }), p = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s($r, { size: o ? 12 : 15 }) });
|
|
2705
|
+
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ m(te, { children: [
|
|
2706
2706
|
u,
|
|
2707
2707
|
p
|
|
2708
|
-
] }) : /* @__PURE__ */ m(
|
|
2708
|
+
] }) : /* @__PURE__ */ m(te, { children: [
|
|
2709
2709
|
p,
|
|
2710
2710
|
u
|
|
2711
2711
|
] }) });
|
|
2712
|
-
},
|
|
2712
|
+
}, Gr = ({
|
|
2713
2713
|
selected: e,
|
|
2714
2714
|
onVoteUp: t,
|
|
2715
2715
|
onVoteDown: n
|
|
@@ -2725,7 +2725,7 @@ const jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2725
2725
|
"aria-label": "Good response",
|
|
2726
2726
|
"aria-pressed": e === "up",
|
|
2727
2727
|
"data-tooltip": "Good response",
|
|
2728
|
-
children: /* @__PURE__ */ s(
|
|
2728
|
+
children: /* @__PURE__ */ s(Yn, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
2729
2729
|
}
|
|
2730
2730
|
),
|
|
2731
2731
|
/* @__PURE__ */ s(
|
|
@@ -2739,50 +2739,29 @@ const jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2739
2739
|
"aria-label": "Bad response",
|
|
2740
2740
|
"aria-pressed": e === "down",
|
|
2741
2741
|
"data-tooltip": "Bad response",
|
|
2742
|
-
children: /* @__PURE__ */ s(
|
|
2742
|
+
children: /* @__PURE__ */ s(qn, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
2743
2743
|
}
|
|
2744
2744
|
)
|
|
2745
|
-
] }),
|
|
2746
|
-
|
|
2747
|
-
const { message: e } = _e("SentMessageDeliveryStatus"), { messages: t } = le("SentMessageDeliveryStatus"), { client: n } = oe("SentMessageDeliveryStatus"), a = (i = n.user) == null ? void 0 : i.id, r = se(() => {
|
|
2748
|
-
var o;
|
|
2749
|
-
if (!(!a || !t)) {
|
|
2750
|
-
for (let l = t.length - 1; l >= 0; l -= 1)
|
|
2751
|
-
if (((o = t[l].user) == null ? void 0 : o.id) === a) return t[l].id;
|
|
2752
|
-
}
|
|
2753
|
-
}, [t, a]);
|
|
2754
|
-
return e.id !== r ? null : /* @__PURE__ */ m(ee, { children: [
|
|
2755
|
-
/* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
|
|
2756
|
-
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2757
|
-
] });
|
|
2758
|
-
}, Wr = () => null, Xr = () => /* @__PURE__ */ s(
|
|
2759
|
-
Xs,
|
|
2760
|
-
{
|
|
2761
|
-
MessageSentStatus: Je,
|
|
2762
|
-
MessageDeliveredStatus: Je,
|
|
2763
|
-
MessageReadStatus: Je,
|
|
2764
|
-
MessageSendingStatus: Wr
|
|
2765
|
-
}
|
|
2766
|
-
), Kr = /^([a-z][a-z0-9+.-]*):/i, Jr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2767
|
-
function _t(e) {
|
|
2745
|
+
] }), Hr = /^([a-z][a-z0-9+.-]*):/i, Yr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2746
|
+
function wt(e) {
|
|
2768
2747
|
if (typeof e != "string") return;
|
|
2769
2748
|
const t = e.trim();
|
|
2770
2749
|
if (t === "") return;
|
|
2771
|
-
const n =
|
|
2750
|
+
const n = Hr.exec(t);
|
|
2772
2751
|
if (n) {
|
|
2773
2752
|
const a = n[1].toLowerCase();
|
|
2774
|
-
return
|
|
2753
|
+
return Yr.has(a) ? t : void 0;
|
|
2775
2754
|
}
|
|
2776
2755
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2777
2756
|
}
|
|
2778
|
-
const
|
|
2757
|
+
const qr = {
|
|
2779
2758
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2780
2759
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2781
|
-
},
|
|
2760
|
+
}, Wr = ({ variant: e, cta: t }) => {
|
|
2782
2761
|
const n = k(
|
|
2783
2762
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2784
|
-
|
|
2785
|
-
), a =
|
|
2763
|
+
qr[e]
|
|
2764
|
+
), a = wt(t.href);
|
|
2786
2765
|
return a ? /* @__PURE__ */ s(
|
|
2787
2766
|
"a",
|
|
2788
2767
|
{
|
|
@@ -2808,13 +2787,13 @@ const Zr = {
|
|
|
2808
2787
|
children: t.label
|
|
2809
2788
|
}
|
|
2810
2789
|
);
|
|
2811
|
-
},
|
|
2790
|
+
}, Xr = {
|
|
2812
2791
|
dark: "text-white",
|
|
2813
2792
|
light: "text-black/90"
|
|
2814
|
-
},
|
|
2793
|
+
}, Kr = "text-white/30", Jr = {
|
|
2815
2794
|
dark: "text-white/55",
|
|
2816
2795
|
light: "text-black/55"
|
|
2817
|
-
},
|
|
2796
|
+
}, _t = ({
|
|
2818
2797
|
variant: e,
|
|
2819
2798
|
title: t,
|
|
2820
2799
|
placeholderTitle: n,
|
|
@@ -2828,10 +2807,10 @@ const Zr = {
|
|
|
2828
2807
|
if (!p && !h && !c && !v) return null;
|
|
2829
2808
|
const b = k(
|
|
2830
2809
|
"truncate text-base font-medium leading-6",
|
|
2831
|
-
d && !t ?
|
|
2810
|
+
d && !t ? Kr : Xr[e]
|
|
2832
2811
|
), g = k(
|
|
2833
2812
|
"truncate text-xs leading-4",
|
|
2834
|
-
|
|
2813
|
+
Jr[e]
|
|
2835
2814
|
);
|
|
2836
2815
|
return /* @__PURE__ */ m("div", { className: "px-4 py-3", children: [
|
|
2837
2816
|
/* @__PURE__ */ m("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2847,9 +2826,9 @@ const Zr = {
|
|
|
2847
2826
|
] }),
|
|
2848
2827
|
l && /* @__PURE__ */ s("div", { className: "shrink-0", children: l })
|
|
2849
2828
|
] }),
|
|
2850
|
-
o && /* @__PURE__ */ s(
|
|
2829
|
+
o && /* @__PURE__ */ s(Wr, { variant: e, cta: o })
|
|
2851
2830
|
] });
|
|
2852
|
-
},
|
|
2831
|
+
}, Zr = k(
|
|
2853
2832
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2854
2833
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2855
2834
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2868,7 +2847,7 @@ const Zr = {
|
|
|
2868
2847
|
"data-testid": d
|
|
2869
2848
|
}) => {
|
|
2870
2849
|
const u = n != null || a != null, p = k(
|
|
2871
|
-
|
|
2850
|
+
Zr,
|
|
2872
2851
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2873
2852
|
// `focus-ring` is a design-system utility from the component-library
|
|
2874
2853
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2916,17 +2895,17 @@ const Zr = {
|
|
|
2916
2895
|
]
|
|
2917
2896
|
}
|
|
2918
2897
|
);
|
|
2919
|
-
},
|
|
2898
|
+
}, Qr = {
|
|
2920
2899
|
dark: "bg-white/10",
|
|
2921
2900
|
light: "bg-black/5"
|
|
2922
|
-
},
|
|
2901
|
+
}, ei = {
|
|
2923
2902
|
dark: "size-16 text-white/25",
|
|
2924
2903
|
light: "size-16 text-black/25"
|
|
2925
|
-
}, Ve = (e, t) => !!t && !!e &&
|
|
2904
|
+
}, Ve = (e, t) => !!t && !!e && le(e) === "audio", Nt = (e, t) => {
|
|
2926
2905
|
if (!t || !e) return !1;
|
|
2927
|
-
const n =
|
|
2906
|
+
const n = le(e);
|
|
2928
2907
|
return n === "video" || n === "audio";
|
|
2929
|
-
},
|
|
2908
|
+
}, yt = "bg-[#F2F3F4]", $e = ({
|
|
2930
2909
|
variant: e,
|
|
2931
2910
|
thumbnailUrl: t,
|
|
2932
2911
|
sourceUrl: n,
|
|
@@ -2935,7 +2914,7 @@ const Zr = {
|
|
|
2935
2914
|
topLeft: i,
|
|
2936
2915
|
topRight: o
|
|
2937
2916
|
}) => {
|
|
2938
|
-
const l =
|
|
2917
|
+
const l = le(r), d = !!n && l === "video";
|
|
2939
2918
|
return Ve(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
|
|
2940
2919
|
"audio",
|
|
2941
2920
|
{
|
|
@@ -2977,10 +2956,10 @@ const Zr = {
|
|
|
2977
2956
|
{
|
|
2978
2957
|
className: k(
|
|
2979
2958
|
"flex h-full w-full items-center justify-center",
|
|
2980
|
-
|
|
2959
|
+
Qr[e]
|
|
2981
2960
|
),
|
|
2982
2961
|
children: we(r, {
|
|
2983
|
-
className:
|
|
2962
|
+
className: ei[e],
|
|
2984
2963
|
weight: "regular"
|
|
2985
2964
|
})
|
|
2986
2965
|
}
|
|
@@ -2990,7 +2969,7 @@ const Zr = {
|
|
|
2990
2969
|
]
|
|
2991
2970
|
}
|
|
2992
2971
|
);
|
|
2993
|
-
},
|
|
2972
|
+
}, ti = ({
|
|
2994
2973
|
title: e,
|
|
2995
2974
|
placeholderTitle: t,
|
|
2996
2975
|
description: n,
|
|
@@ -3020,10 +2999,10 @@ const Zr = {
|
|
|
3020
2999
|
onClick: h,
|
|
3021
3000
|
"aria-label": "Edit attachment",
|
|
3022
3001
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3023
|
-
children: /* @__PURE__ */ s(
|
|
3002
|
+
children: /* @__PURE__ */ s(Wn, { className: "size-5", weight: "regular" })
|
|
3024
3003
|
}
|
|
3025
3004
|
) : void 0;
|
|
3026
|
-
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName:
|
|
3005
|
+
return c ? /* @__PURE__ */ s(Oe, { variant: "dark", bgClassName: yt, children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3027
3006
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
3028
3007
|
$e,
|
|
3029
3008
|
{
|
|
@@ -3052,7 +3031,7 @@ const Zr = {
|
|
|
3052
3031
|
}
|
|
3053
3032
|
),
|
|
3054
3033
|
/* @__PURE__ */ s(
|
|
3055
|
-
|
|
3034
|
+
_t,
|
|
3056
3035
|
{
|
|
3057
3036
|
variant: "dark",
|
|
3058
3037
|
title: e,
|
|
@@ -3067,7 +3046,7 @@ const Zr = {
|
|
|
3067
3046
|
]
|
|
3068
3047
|
}
|
|
3069
3048
|
);
|
|
3070
|
-
},
|
|
3049
|
+
}, si = ({
|
|
3071
3050
|
title: e,
|
|
3072
3051
|
description: t,
|
|
3073
3052
|
url: n,
|
|
@@ -3079,7 +3058,7 @@ const Zr = {
|
|
|
3079
3058
|
cta: d,
|
|
3080
3059
|
onClick: u
|
|
3081
3060
|
}) => {
|
|
3082
|
-
const p =
|
|
3061
|
+
const p = Nt(a, i), h = wt(n), f = d == null && h != null && !p ? h : void 0, c = d == null && !p ? u : void 0, v = Ve(a, i) ? yt : void 0, w = d && u ? {
|
|
3083
3062
|
...d,
|
|
3084
3063
|
onClick: () => {
|
|
3085
3064
|
var b;
|
|
@@ -3107,7 +3086,7 @@ const Zr = {
|
|
|
3107
3086
|
}
|
|
3108
3087
|
),
|
|
3109
3088
|
/* @__PURE__ */ s(
|
|
3110
|
-
|
|
3089
|
+
_t,
|
|
3111
3090
|
{
|
|
3112
3091
|
variant: "light",
|
|
3113
3092
|
title: e,
|
|
@@ -3120,7 +3099,7 @@ const Zr = {
|
|
|
3120
3099
|
]
|
|
3121
3100
|
}
|
|
3122
3101
|
);
|
|
3123
|
-
},
|
|
3102
|
+
}, ni = ({
|
|
3124
3103
|
title: e,
|
|
3125
3104
|
placeholderTitle: t,
|
|
3126
3105
|
description: n,
|
|
@@ -3133,14 +3112,14 @@ const Zr = {
|
|
|
3133
3112
|
cta: u,
|
|
3134
3113
|
onClick: p
|
|
3135
3114
|
}) => {
|
|
3136
|
-
const h =
|
|
3115
|
+
const h = Nt(r, o), f = wt(a), c = u == null && f != null && !h ? f : void 0, v = u == null && !h && c != null ? p : void 0;
|
|
3137
3116
|
return /* @__PURE__ */ m(
|
|
3138
3117
|
Oe,
|
|
3139
3118
|
{
|
|
3140
3119
|
variant: "dark",
|
|
3141
3120
|
href: c,
|
|
3142
3121
|
onClick: v,
|
|
3143
|
-
bgClassName: Ve(r, o) ?
|
|
3122
|
+
bgClassName: Ve(r, o) ? yt : void 0,
|
|
3144
3123
|
children: [
|
|
3145
3124
|
l === "featured" && /* @__PURE__ */ s(
|
|
3146
3125
|
$e,
|
|
@@ -3153,7 +3132,7 @@ const Zr = {
|
|
|
3153
3132
|
}
|
|
3154
3133
|
),
|
|
3155
3134
|
/* @__PURE__ */ s(
|
|
3156
|
-
|
|
3135
|
+
_t,
|
|
3157
3136
|
{
|
|
3158
3137
|
variant: "dark",
|
|
3159
3138
|
title: e,
|
|
@@ -3167,22 +3146,22 @@ const Zr = {
|
|
|
3167
3146
|
]
|
|
3168
3147
|
}
|
|
3169
3148
|
);
|
|
3170
|
-
},
|
|
3171
|
-
Composer:
|
|
3172
|
-
Sent:
|
|
3173
|
-
Received:
|
|
3174
|
-
},
|
|
3149
|
+
}, Qt = {
|
|
3150
|
+
Composer: ti,
|
|
3151
|
+
Sent: ni,
|
|
3152
|
+
Received: si
|
|
3153
|
+
}, ai = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#121110] px-4 py-2 text-white", ri = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#e9eaed] px-4 py-2 text-[#080707]";
|
|
3175
3154
|
function P(e) {
|
|
3176
3155
|
const t = e == null ? void 0 : e.trim();
|
|
3177
3156
|
return t || void 0;
|
|
3178
3157
|
}
|
|
3179
|
-
function
|
|
3158
|
+
function es(e) {
|
|
3180
3159
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
3181
3160
|
}
|
|
3182
|
-
function
|
|
3161
|
+
function ii(e, t) {
|
|
3183
3162
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
3184
3163
|
return !1;
|
|
3185
|
-
const n =
|
|
3164
|
+
const n = es(e), a = es(t);
|
|
3186
3165
|
if (n === a)
|
|
3187
3166
|
return !0;
|
|
3188
3167
|
if (!n.includes(a))
|
|
@@ -3190,7 +3169,7 @@ function ui(e, t) {
|
|
|
3190
3169
|
const r = n.split(a).join("");
|
|
3191
3170
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
3192
3171
|
}
|
|
3193
|
-
function
|
|
3172
|
+
function ts(e) {
|
|
3194
3173
|
const t = P(e.og_scrape_url) ?? P(e.title_link), n = P(e.image_url) ?? P(e.thumb_url), a = P(e.asset_url), r = P(e.mime_type);
|
|
3195
3174
|
return {
|
|
3196
3175
|
title: P(e.title),
|
|
@@ -3200,19 +3179,19 @@ function ss(e) {
|
|
|
3200
3179
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
3201
3180
|
// native video/audio player in the hero instead of a static thumbnail.
|
|
3202
3181
|
sourceUrl: a,
|
|
3203
|
-
layout: n ||
|
|
3182
|
+
layout: n || Nt(r, a) ? "featured" : "classic",
|
|
3204
3183
|
mimeType: r
|
|
3205
3184
|
};
|
|
3206
3185
|
}
|
|
3207
|
-
function
|
|
3186
|
+
function li(e) {
|
|
3208
3187
|
var t;
|
|
3209
|
-
return
|
|
3188
|
+
return zs(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3210
3189
|
}
|
|
3211
|
-
function
|
|
3190
|
+
function zs(e) {
|
|
3212
3191
|
const t = P(e.og_scrape_url);
|
|
3213
3192
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3214
3193
|
}
|
|
3215
|
-
function
|
|
3194
|
+
function Ps(e) {
|
|
3216
3195
|
if (!(e != null && e.length)) return [];
|
|
3217
3196
|
const t = [], n = (r, i) => {
|
|
3218
3197
|
const o = t[t.length - 1];
|
|
@@ -3230,51 +3209,51 @@ function Fs(e) {
|
|
|
3230
3209
|
t.push({ type: "link", attachments: [r] });
|
|
3231
3210
|
};
|
|
3232
3211
|
for (const r of e) {
|
|
3233
|
-
if (
|
|
3212
|
+
if (zs(r)) {
|
|
3234
3213
|
a(r);
|
|
3235
3214
|
continue;
|
|
3236
3215
|
}
|
|
3237
|
-
const i =
|
|
3216
|
+
const i = li(r);
|
|
3238
3217
|
i && n(i, r);
|
|
3239
3218
|
}
|
|
3240
3219
|
return t;
|
|
3241
3220
|
}
|
|
3242
|
-
function
|
|
3221
|
+
function oi(e) {
|
|
3243
3222
|
let t = 0;
|
|
3244
3223
|
for (const n of e)
|
|
3245
3224
|
t += n.type === "link" ? n.attachments.length : 1;
|
|
3246
3225
|
return t;
|
|
3247
3226
|
}
|
|
3248
|
-
function
|
|
3227
|
+
function ci(e) {
|
|
3249
3228
|
return e.filter((t) => t.type === "media").length;
|
|
3250
3229
|
}
|
|
3251
|
-
function
|
|
3230
|
+
function di(e, t, n) {
|
|
3252
3231
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3253
3232
|
}
|
|
3254
|
-
function
|
|
3233
|
+
function ss(e) {
|
|
3255
3234
|
return P(e.image_url) ?? P(e.asset_url) ?? "";
|
|
3256
3235
|
}
|
|
3257
|
-
function
|
|
3236
|
+
function ui(e) {
|
|
3258
3237
|
switch (e) {
|
|
3259
3238
|
case "image":
|
|
3260
|
-
return
|
|
3239
|
+
return Ne.Image;
|
|
3261
3240
|
case "video":
|
|
3262
|
-
return
|
|
3241
|
+
return Ne.Video;
|
|
3263
3242
|
case "audio":
|
|
3264
|
-
return
|
|
3243
|
+
return Ne.Audio;
|
|
3265
3244
|
case "pdf":
|
|
3266
|
-
return
|
|
3245
|
+
return Ne.Pdf;
|
|
3267
3246
|
default:
|
|
3268
|
-
return
|
|
3247
|
+
return Ne.File;
|
|
3269
3248
|
}
|
|
3270
3249
|
}
|
|
3271
|
-
function
|
|
3250
|
+
function mi(e, t) {
|
|
3272
3251
|
if (t.length > 1)
|
|
3273
3252
|
switch (e) {
|
|
3274
3253
|
case "image":
|
|
3275
3254
|
return {
|
|
3276
3255
|
items: t.map((a) => ({
|
|
3277
|
-
src:
|
|
3256
|
+
src: ss(a),
|
|
3278
3257
|
alt: P(a.title)
|
|
3279
3258
|
}))
|
|
3280
3259
|
};
|
|
@@ -3325,7 +3304,7 @@ function bi(e, t) {
|
|
|
3325
3304
|
switch (e) {
|
|
3326
3305
|
case "image":
|
|
3327
3306
|
return {
|
|
3328
|
-
src:
|
|
3307
|
+
src: ss(n),
|
|
3329
3308
|
alt: P(n.title)
|
|
3330
3309
|
};
|
|
3331
3310
|
case "video":
|
|
@@ -3355,48 +3334,48 @@ function bi(e, t) {
|
|
|
3355
3334
|
};
|
|
3356
3335
|
}
|
|
3357
3336
|
}
|
|
3358
|
-
function
|
|
3337
|
+
function hi({
|
|
3359
3338
|
groupPosition: e,
|
|
3360
3339
|
isMyMessage: t,
|
|
3361
3340
|
segment: n,
|
|
3362
3341
|
text: a
|
|
3363
3342
|
}) {
|
|
3364
|
-
const r =
|
|
3365
|
-
...
|
|
3343
|
+
const r = ui(n.kind), i = {
|
|
3344
|
+
...mi(n.kind, n.attachments),
|
|
3366
3345
|
groupPosition: e,
|
|
3367
3346
|
...a ? { text: a } : {}
|
|
3368
3347
|
};
|
|
3369
3348
|
return t ? /* @__PURE__ */ s(r.Sent, { ...i }) : /* @__PURE__ */ s(r.Received, { ...i });
|
|
3370
3349
|
}
|
|
3371
|
-
const
|
|
3350
|
+
const fi = ({
|
|
3372
3351
|
groupPosition: e,
|
|
3373
3352
|
isMyMessage: t,
|
|
3374
3353
|
message: n
|
|
3375
3354
|
}) => {
|
|
3376
3355
|
var w;
|
|
3377
|
-
const a =
|
|
3356
|
+
const a = Ps(n.attachments);
|
|
3378
3357
|
if (a.length === 0) return null;
|
|
3379
|
-
const r =
|
|
3358
|
+
const r = oi(a), i = ci(a), o = (w = n.text) == null ? void 0 : w.trim(), l = a.find((b) => b.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? ts(l.attachments[0] ?? {}).url : void 0, u = o && ii(o, d) ? void 0 : o;
|
|
3380
3359
|
let p = 0, h = 0;
|
|
3381
3360
|
const f = [], c = (b, g) => {
|
|
3382
3361
|
const x = p === r - 1;
|
|
3383
3362
|
p += 1;
|
|
3384
|
-
const N = t ?
|
|
3363
|
+
const N = t ? Qt.Sent : Qt.Received;
|
|
3385
3364
|
f.push(
|
|
3386
3365
|
/* @__PURE__ */ m(V.Fragment, { children: [
|
|
3387
|
-
/* @__PURE__ */ s(N, { ...
|
|
3388
|
-
x && u ? /* @__PURE__ */ s("div", { className: t ?
|
|
3366
|
+
/* @__PURE__ */ s(N, { ...ts(b) }),
|
|
3367
|
+
x && u ? /* @__PURE__ */ s("div", { className: t ? ai : ri, children: u }) : null
|
|
3389
3368
|
] }, g)
|
|
3390
3369
|
);
|
|
3391
3370
|
}, v = (b, g) => {
|
|
3392
|
-
const x = p === r - 1, N =
|
|
3371
|
+
const x = p === r - 1, N = di(
|
|
3393
3372
|
h,
|
|
3394
3373
|
i,
|
|
3395
3374
|
e
|
|
3396
3375
|
);
|
|
3397
3376
|
p += 1, h += 1, f.push(
|
|
3398
3377
|
/* @__PURE__ */ s(
|
|
3399
|
-
|
|
3378
|
+
hi,
|
|
3400
3379
|
{
|
|
3401
3380
|
groupPosition: N,
|
|
3402
3381
|
isMyMessage: t,
|
|
@@ -3415,9 +3394,9 @@ const xi = ({
|
|
|
3415
3394
|
return;
|
|
3416
3395
|
}
|
|
3417
3396
|
v(b, `media-${g}`);
|
|
3418
|
-
}), /* @__PURE__ */ s(
|
|
3419
|
-
},
|
|
3420
|
-
var At, Mt, Rt,
|
|
3397
|
+
}), /* @__PURE__ */ s(te, { children: f });
|
|
3398
|
+
}, gi = (e) => {
|
|
3399
|
+
var Tt, At, Mt, Rt, Lt, Dt, zt, Pt, Ft, Ot, $t, Bt, Ut, jt;
|
|
3421
3400
|
const {
|
|
3422
3401
|
additionalMessageInputProps: t,
|
|
3423
3402
|
chatbotVotingEnabled: n,
|
|
@@ -3435,52 +3414,52 @@ const xi = ({
|
|
|
3435
3414
|
renderText: v,
|
|
3436
3415
|
threadList: w,
|
|
3437
3416
|
viewerLanguage: b
|
|
3438
|
-
} = e, { client: g } =
|
|
3439
|
-
Attachment:
|
|
3440
|
-
EditMessageModal: R =
|
|
3441
|
-
MessageActions:
|
|
3442
|
-
MessageBlocked: z =
|
|
3443
|
-
MessageBouncePrompt: O =
|
|
3444
|
-
MessageDeleted: j =
|
|
3445
|
-
MessageIsThreadReplyInChannelButtonIndicator: X =
|
|
3446
|
-
MessageRepliesCountButton:
|
|
3447
|
-
ReminderNotification: K =
|
|
3448
|
-
StreamedMessageText: _ =
|
|
3417
|
+
} = e, { client: g } = me("CustomMessage"), { channel: x } = ue("CustomMessage"), { isUnlocking: N, onUnlockClick: C, onFetchSource: T, onDownloadClick: A } = Or("LockedAttachment"), [L, $] = U(!1), F = Xs(c.id), { selected: D, voteUp: y, voteDown: I } = pa(c), {
|
|
3418
|
+
Attachment: E = Ks,
|
|
3419
|
+
EditMessageModal: R = Js,
|
|
3420
|
+
MessageActions: S,
|
|
3421
|
+
MessageBlocked: z = Zs,
|
|
3422
|
+
MessageBouncePrompt: O = Qs,
|
|
3423
|
+
MessageDeleted: j = en,
|
|
3424
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = tn,
|
|
3425
|
+
MessageRepliesCountButton: ee = sn,
|
|
3426
|
+
ReminderNotification: K = nn,
|
|
3427
|
+
StreamedMessageText: _ = an,
|
|
3449
3428
|
PinIndicator: M
|
|
3450
|
-
} =
|
|
3429
|
+
} = rs("CustomMessage"), H = rn(c), q = ln(c), Y = ae(
|
|
3451
3430
|
() => h == null ? void 0 : h(c),
|
|
3452
3431
|
[h, c]
|
|
3453
|
-
), B =
|
|
3454
|
-
const
|
|
3432
|
+
), B = ae(() => {
|
|
3433
|
+
const de = c.attachments ?? [], pe = c.shared_location ? [c.shared_location, ...de] : de;
|
|
3455
3434
|
if (!Fe(c)) return pe;
|
|
3456
|
-
const
|
|
3457
|
-
return
|
|
3458
|
-
}, [c]), W =
|
|
3459
|
-
() =>
|
|
3435
|
+
const Vt = pe.filter((Gt) => !("type" in Gt) || !xs(Gt));
|
|
3436
|
+
return Vt.length === pe.length ? pe : Vt;
|
|
3437
|
+
}, [c]), W = ae(
|
|
3438
|
+
() => Ps(B),
|
|
3460
3439
|
[B]
|
|
3461
|
-
), Q =
|
|
3462
|
-
const
|
|
3463
|
-
return
|
|
3464
|
-
}, [c, b]),
|
|
3465
|
-
(
|
|
3440
|
+
), Q = ae(() => {
|
|
3441
|
+
const de = ms({ message: c, viewerLanguage: b });
|
|
3442
|
+
return de === c.text ? c : { ...c, text: de };
|
|
3443
|
+
}, [c, b]), oe = W.length > 0, Le = W.reduce(
|
|
3444
|
+
(de, pe) => de + pe.attachments.length,
|
|
3466
3445
|
0
|
|
3467
|
-
) === ((B == null ? void 0 : B.length) ?? 0),
|
|
3446
|
+
) === ((B == null ? void 0 : B.length) ?? 0), De = Ya(
|
|
3468
3447
|
{
|
|
3469
3448
|
endOfGroup: r,
|
|
3470
3449
|
firstOfGroup: i,
|
|
3471
3450
|
groupedByUser: o
|
|
3472
3451
|
}
|
|
3473
3452
|
);
|
|
3474
|
-
if (
|
|
3453
|
+
if (on(c))
|
|
3475
3454
|
return null;
|
|
3476
3455
|
if (c.deleted_at || c.type === "deleted")
|
|
3477
3456
|
return /* @__PURE__ */ s(j, { message: c });
|
|
3478
|
-
if (
|
|
3457
|
+
if (cn(c))
|
|
3479
3458
|
return /* @__PURE__ */ s(z, {});
|
|
3480
|
-
const
|
|
3459
|
+
const ne = !w && !!c.reply_count, ce = !w && c.show_in_channel && c.parent_id, ie = c.status === "failed" && ((Tt = c.error) == null ? void 0 : Tt.status) !== 403, Ct = dn(c);
|
|
3481
3460
|
let he;
|
|
3482
|
-
ie ? he = () => u(c) :
|
|
3483
|
-
const fe = f(),
|
|
3461
|
+
ie ? he = () => u(c) : Ct && (he = () => $(!0));
|
|
3462
|
+
const fe = f(), Us = k(
|
|
3484
3463
|
"str-chat__message str-chat__message-simple",
|
|
3485
3464
|
`str-chat__message--${c.type}`,
|
|
3486
3465
|
`str-chat__message--${c.status}`,
|
|
@@ -3491,39 +3470,39 @@ const xi = ({
|
|
|
3491
3470
|
"str-chat__message--highlighted": p,
|
|
3492
3471
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3493
3472
|
"str-chat__message--with-reactions": q,
|
|
3494
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
3495
|
-
"str-chat__message-with-thread-link":
|
|
3473
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((At = c == null ? void 0 : c.error) == null ? void 0 : At.status) !== 403,
|
|
3474
|
+
"str-chat__message-with-thread-link": ne || ce,
|
|
3496
3475
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3497
3476
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3498
3477
|
"str-chat__virtual-message__wrapper--group": o
|
|
3499
3478
|
}
|
|
3500
|
-
), Ge = c.poll_id && g.polls.fromState(c.poll_id), Et =
|
|
3501
|
-
return /* @__PURE__ */ m(
|
|
3479
|
+
), Ge = c.poll_id && g.polls.fromState(c.poll_id), Et = Vr(c), ge = Fe(c), St = jr(c), He = !!(B != null && B.length && !c.quoted_message), It = ge && fe && He, js = oe && Le && !c.quoted_message && !Ge && !Y && !ge;
|
|
3480
|
+
return /* @__PURE__ */ m(te, { children: [
|
|
3502
3481
|
a && /* @__PURE__ */ s(
|
|
3503
3482
|
R,
|
|
3504
3483
|
{
|
|
3505
3484
|
additionalMessageInputProps: t
|
|
3506
3485
|
}
|
|
3507
3486
|
),
|
|
3508
|
-
|
|
3509
|
-
|
|
3487
|
+
L && /* @__PURE__ */ s(
|
|
3488
|
+
un,
|
|
3510
3489
|
{
|
|
3511
3490
|
MessageBouncePrompt: O,
|
|
3512
3491
|
onClose: () => $(!1),
|
|
3513
|
-
open:
|
|
3492
|
+
open: L
|
|
3514
3493
|
}
|
|
3515
3494
|
),
|
|
3516
3495
|
/* @__PURE__ */ m(
|
|
3517
3496
|
"div",
|
|
3518
3497
|
{
|
|
3519
|
-
className:
|
|
3498
|
+
className: Us,
|
|
3520
3499
|
"data-message-id": c.id,
|
|
3521
3500
|
"data-dd-privacy": "mask",
|
|
3522
3501
|
children: [
|
|
3523
3502
|
M && /* @__PURE__ */ s(M, {}),
|
|
3524
3503
|
!!F && /* @__PURE__ */ s(K, { reminder: F }),
|
|
3525
3504
|
c.user && /* @__PURE__ */ s(
|
|
3526
|
-
|
|
3505
|
+
se,
|
|
3527
3506
|
{
|
|
3528
3507
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3529
3508
|
id: c.user.id,
|
|
@@ -3538,7 +3517,7 @@ const xi = ({
|
|
|
3538
3517
|
"div",
|
|
3539
3518
|
{
|
|
3540
3519
|
className: k("str-chat__message-inner", {
|
|
3541
|
-
"str-chat__simple-message--error-failed": ie ||
|
|
3520
|
+
"str-chat__simple-message--error-failed": ie || Ct
|
|
3542
3521
|
}),
|
|
3543
3522
|
"data-testid": "message-inner",
|
|
3544
3523
|
onClick: he,
|
|
@@ -3551,42 +3530,42 @@ const xi = ({
|
|
|
3551
3530
|
marginInlineEnd: 0,
|
|
3552
3531
|
marginInlineStart: 0
|
|
3553
3532
|
},
|
|
3554
|
-
children:
|
|
3533
|
+
children: St ? /* @__PURE__ */ m("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3555
3534
|
fe ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3556
|
-
|
|
3535
|
+
S && /* @__PURE__ */ s(S, {}),
|
|
3557
3536
|
/* @__PURE__ */ s(
|
|
3558
|
-
|
|
3537
|
+
Jt.Sent,
|
|
3559
3538
|
{
|
|
3560
|
-
title: (
|
|
3561
|
-
mimeType: (
|
|
3539
|
+
title: (Mt = c.metadata) == null ? void 0 : Mt.attachment_title,
|
|
3540
|
+
mimeType: (Rt = c.metadata) == null ? void 0 : Rt.attachment_mime_type,
|
|
3562
3541
|
thumbnailUrl: (Lt = c.metadata) == null ? void 0 : Lt.attachment_thumbnail,
|
|
3563
|
-
amountText: (
|
|
3564
|
-
detail: (
|
|
3565
|
-
paymentStatus: (
|
|
3542
|
+
amountText: (Dt = c.metadata) == null ? void 0 : Dt.amount_text,
|
|
3543
|
+
detail: (zt = c.metadata) == null ? void 0 : zt.attachment_detail,
|
|
3544
|
+
paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
|
|
3566
3545
|
onPreviewClick: () => C == null ? void 0 : C(c, x),
|
|
3567
3546
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x))
|
|
3568
3547
|
}
|
|
3569
3548
|
)
|
|
3570
3549
|
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3571
3550
|
/* @__PURE__ */ s(
|
|
3572
|
-
|
|
3551
|
+
Jt.Received,
|
|
3573
3552
|
{
|
|
3574
|
-
title: (
|
|
3575
|
-
mimeType: (
|
|
3576
|
-
thumbnailUrl: (
|
|
3577
|
-
amountText: (
|
|
3578
|
-
detail: (
|
|
3579
|
-
paymentStatus: (
|
|
3553
|
+
title: (Ft = c.metadata) == null ? void 0 : Ft.attachment_title,
|
|
3554
|
+
mimeType: (Ot = c.metadata) == null ? void 0 : Ot.attachment_mime_type,
|
|
3555
|
+
thumbnailUrl: ($t = c.metadata) == null ? void 0 : $t.attachment_thumbnail,
|
|
3556
|
+
amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
|
|
3557
|
+
detail: (Ut = c.metadata) == null ? void 0 : Ut.attachment_detail,
|
|
3558
|
+
paymentStatus: (jt = c.metadata) == null ? void 0 : jt.payment_status,
|
|
3580
3559
|
isUnlocking: N(c.id),
|
|
3581
3560
|
onUnlockClick: () => C == null ? void 0 : C(c, x),
|
|
3582
3561
|
onFetchSource: async () => await (T == null ? void 0 : T(c, x)),
|
|
3583
3562
|
onDownloadClick: () => A == null ? void 0 : A(c, x)
|
|
3584
3563
|
}
|
|
3585
3564
|
),
|
|
3586
|
-
|
|
3565
|
+
S && /* @__PURE__ */ s(S, {})
|
|
3587
3566
|
] }),
|
|
3588
3567
|
c.text && /* @__PURE__ */ s("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ s(
|
|
3589
|
-
|
|
3568
|
+
Yt,
|
|
3590
3569
|
{
|
|
3591
3570
|
message: Q,
|
|
3592
3571
|
renderText: v
|
|
@@ -3595,7 +3574,7 @@ const xi = ({
|
|
|
3595
3574
|
] }) : Et ? (
|
|
3596
3575
|
/* Tip-only messages render as a standalone bubble */
|
|
3597
3576
|
/* @__PURE__ */ s(Ke, { message: c, standalone: !0 })
|
|
3598
|
-
) :
|
|
3577
|
+
) : js ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m(
|
|
3599
3578
|
"div",
|
|
3600
3579
|
{
|
|
3601
3580
|
className: "str-chat__message-bubble",
|
|
@@ -3607,9 +3586,9 @@ const xi = ({
|
|
|
3607
3586
|
},
|
|
3608
3587
|
children: [
|
|
3609
3588
|
/* @__PURE__ */ s(
|
|
3610
|
-
|
|
3589
|
+
fi,
|
|
3611
3590
|
{
|
|
3612
|
-
groupPosition:
|
|
3591
|
+
groupPosition: De,
|
|
3613
3592
|
isMyMessage: fe,
|
|
3614
3593
|
message: {
|
|
3615
3594
|
attachments: B,
|
|
@@ -3617,11 +3596,11 @@ const xi = ({
|
|
|
3617
3596
|
}
|
|
3618
3597
|
}
|
|
3619
3598
|
),
|
|
3620
|
-
/* @__PURE__ */ s(
|
|
3599
|
+
/* @__PURE__ */ s(qt, {})
|
|
3621
3600
|
]
|
|
3622
3601
|
}
|
|
3623
3602
|
) }) : /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m("div", { className: "str-chat__message-bubble", children: [
|
|
3624
|
-
ge && !
|
|
3603
|
+
ge && !It && /* @__PURE__ */ s(
|
|
3625
3604
|
Ke,
|
|
3626
3605
|
{
|
|
3627
3606
|
message: c,
|
|
@@ -3629,9 +3608,9 @@ const xi = ({
|
|
|
3629
3608
|
isMyMessage: fe
|
|
3630
3609
|
}
|
|
3631
3610
|
),
|
|
3632
|
-
Ge && /* @__PURE__ */ s(
|
|
3611
|
+
Ge && /* @__PURE__ */ s(mn, { poll: Ge }),
|
|
3633
3612
|
B != null && B.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
3634
|
-
|
|
3613
|
+
E,
|
|
3635
3614
|
{
|
|
3636
3615
|
actionHandler: l,
|
|
3637
3616
|
attachments: B
|
|
@@ -3644,18 +3623,18 @@ const xi = ({
|
|
|
3644
3623
|
renderText: v
|
|
3645
3624
|
}
|
|
3646
3625
|
) : /* @__PURE__ */ s(
|
|
3647
|
-
|
|
3626
|
+
Yt,
|
|
3648
3627
|
{
|
|
3649
3628
|
message: Q,
|
|
3650
3629
|
renderText: v
|
|
3651
3630
|
}
|
|
3652
3631
|
),
|
|
3653
|
-
/* @__PURE__ */ s(
|
|
3632
|
+
/* @__PURE__ */ s(qt, {})
|
|
3654
3633
|
] }) })
|
|
3655
3634
|
}
|
|
3656
3635
|
),
|
|
3657
|
-
!
|
|
3658
|
-
(!ge ||
|
|
3636
|
+
!St && !Et && /* @__PURE__ */ m("div", { className: "str-chat__message-footer", children: [
|
|
3637
|
+
(!ge || It) && /* @__PURE__ */ s(
|
|
3659
3638
|
Ke,
|
|
3660
3639
|
{
|
|
3661
3640
|
message: c,
|
|
@@ -3664,72 +3643,71 @@ const xi = ({
|
|
|
3664
3643
|
}
|
|
3665
3644
|
),
|
|
3666
3645
|
n && ge && /* @__PURE__ */ s(
|
|
3667
|
-
|
|
3646
|
+
Gr,
|
|
3668
3647
|
{
|
|
3669
|
-
selected:
|
|
3648
|
+
selected: D,
|
|
3670
3649
|
onVoteUp: y,
|
|
3671
3650
|
onVoteDown: I
|
|
3672
3651
|
}
|
|
3673
3652
|
)
|
|
3674
3653
|
] }),
|
|
3675
|
-
/* @__PURE__ */ s(
|
|
3676
|
-
|
|
3677
|
-
te,
|
|
3654
|
+
ne && /* @__PURE__ */ s(
|
|
3655
|
+
ee,
|
|
3678
3656
|
{
|
|
3679
3657
|
onClick: d,
|
|
3680
3658
|
reply_count: c.reply_count
|
|
3681
3659
|
}
|
|
3682
3660
|
),
|
|
3683
|
-
|
|
3661
|
+
ce && /* @__PURE__ */ s(X, {})
|
|
3684
3662
|
]
|
|
3685
3663
|
},
|
|
3686
3664
|
c.id
|
|
3687
3665
|
)
|
|
3688
3666
|
] });
|
|
3689
|
-
},
|
|
3690
|
-
|
|
3691
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
3692
|
-
),
|
|
3693
|
-
const t =
|
|
3694
|
-
return /* @__PURE__ */ s(
|
|
3695
|
-
},
|
|
3667
|
+
}, pi = V.memo(
|
|
3668
|
+
gi,
|
|
3669
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ws(e, t)
|
|
3670
|
+
), bi = (e) => {
|
|
3671
|
+
const t = Ie("CustomMessage");
|
|
3672
|
+
return /* @__PURE__ */ s(pi, { ...t, ...e });
|
|
3673
|
+
}, vi = () => {
|
|
3696
3674
|
var n;
|
|
3697
|
-
const { handleDelete: e, message: t } =
|
|
3675
|
+
const { handleDelete: e, message: t } = Ie("CustomMessageActions");
|
|
3698
3676
|
return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
|
|
3699
|
-
|
|
3677
|
+
cs,
|
|
3700
3678
|
{
|
|
3701
3679
|
onClick: e,
|
|
3702
3680
|
"aria-label": "Delete",
|
|
3703
3681
|
title: "Delete",
|
|
3704
3682
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3705
|
-
children: /* @__PURE__ */ s(
|
|
3683
|
+
children: /* @__PURE__ */ s(Xn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3706
3684
|
}
|
|
3707
3685
|
);
|
|
3708
|
-
},
|
|
3709
|
-
const { handleFlag: e } =
|
|
3686
|
+
}, xi = () => {
|
|
3687
|
+
const { handleFlag: e } = Ie("CustomMessageActions");
|
|
3710
3688
|
return /* @__PURE__ */ s(
|
|
3711
|
-
|
|
3689
|
+
cs,
|
|
3712
3690
|
{
|
|
3713
3691
|
onClick: e,
|
|
3714
3692
|
"aria-label": "Report",
|
|
3715
3693
|
title: "Report",
|
|
3716
3694
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3717
|
-
children: /* @__PURE__ */ s(
|
|
3695
|
+
children: /* @__PURE__ */ s(is, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3718
3696
|
}
|
|
3719
3697
|
);
|
|
3720
|
-
},
|
|
3698
|
+
}, wi = () => {
|
|
3721
3699
|
var t;
|
|
3722
|
-
const { message: e } =
|
|
3700
|
+
const { message: e } = Ie("CustomMessageActions");
|
|
3723
3701
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
|
|
3724
|
-
|
|
3702
|
+
Zn,
|
|
3725
3703
|
{
|
|
3726
3704
|
messageActionSet: [
|
|
3727
|
-
{ Component:
|
|
3728
|
-
{ Component:
|
|
3705
|
+
{ Component: vi, placement: "quick", type: "delete" },
|
|
3706
|
+
{ Component: xi, placement: "quick", type: "flag" }
|
|
3729
3707
|
]
|
|
3730
3708
|
}
|
|
3731
3709
|
);
|
|
3732
|
-
},
|
|
3710
|
+
}, _i = ({
|
|
3733
3711
|
link: e,
|
|
3734
3712
|
onDismiss: t
|
|
3735
3713
|
}) => {
|
|
@@ -3769,14 +3747,14 @@ const xi = ({
|
|
|
3769
3747
|
]
|
|
3770
3748
|
}
|
|
3771
3749
|
);
|
|
3772
|
-
},
|
|
3750
|
+
}, Ni = (e) => ({
|
|
3773
3751
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3774
|
-
(t) =>
|
|
3752
|
+
(t) => Ht.previewIsLoaded(t) || Ht.previewIsLoading(t)
|
|
3775
3753
|
)
|
|
3776
|
-
}),
|
|
3777
|
-
const { linkPreviewsManager: e } =
|
|
3754
|
+
}), yi = () => {
|
|
3755
|
+
const { linkPreviewsManager: e } = hn(), { linkPreviews: t } = fn(
|
|
3778
3756
|
e.state,
|
|
3779
|
-
|
|
3757
|
+
Ni
|
|
3780
3758
|
), n = (r) => {
|
|
3781
3759
|
e.dismissPreview(r);
|
|
3782
3760
|
};
|
|
@@ -3789,9 +3767,9 @@ const xi = ({
|
|
|
3789
3767
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3790
3768
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3791
3769
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3792
|
-
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(
|
|
3770
|
+
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(_i, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3793
3771
|
) : null;
|
|
3794
|
-
},
|
|
3772
|
+
}, kt = V.createContext(!1), ol = () => Se(kt), ki = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3795
3773
|
"button",
|
|
3796
3774
|
{
|
|
3797
3775
|
...n,
|
|
@@ -3799,13 +3777,13 @@ const xi = ({
|
|
|
3799
3777
|
"aria-label": "Send",
|
|
3800
3778
|
disabled: t,
|
|
3801
3779
|
onClick: e,
|
|
3802
|
-
children: /* @__PURE__ */ s(
|
|
3780
|
+
children: /* @__PURE__ */ s(Kn, { weight: "bold", className: "size-4" })
|
|
3803
3781
|
}
|
|
3804
|
-
),
|
|
3805
|
-
const e =
|
|
3806
|
-
SendButton: r =
|
|
3807
|
-
AttachmentPreviewList: i =
|
|
3808
|
-
} =
|
|
3782
|
+
), Ci = () => {
|
|
3783
|
+
const e = Se(kt), { handleSubmit: t } = pn(), n = bn(), a = e || !n, {
|
|
3784
|
+
SendButton: r = ki,
|
|
3785
|
+
AttachmentPreviewList: i = vn
|
|
3786
|
+
} = rs("CustomMessageInput");
|
|
3809
3787
|
return (
|
|
3810
3788
|
// min-h-0 lets the composer shrink under keyboard squeeze (the link
|
|
3811
3789
|
// preview list inside is the scrollable region); the textarea + send row
|
|
@@ -3821,12 +3799,12 @@ const xi = ({
|
|
|
3821
3799
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
3822
3800
|
"data-dd-privacy": "mask",
|
|
3823
3801
|
children: [
|
|
3824
|
-
/* @__PURE__ */ s(
|
|
3825
|
-
/* @__PURE__ */ s(
|
|
3802
|
+
/* @__PURE__ */ s(xn, {}),
|
|
3803
|
+
/* @__PURE__ */ s(yi, {}),
|
|
3826
3804
|
/* @__PURE__ */ s(i, {}),
|
|
3827
3805
|
/* @__PURE__ */ m("div", { className: "flex shrink-0", children: [
|
|
3828
3806
|
/* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
|
|
3829
|
-
|
|
3807
|
+
wn,
|
|
3830
3808
|
{
|
|
3831
3809
|
"aria-disabled": e || void 0,
|
|
3832
3810
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -3852,7 +3830,7 @@ const xi = ({
|
|
|
3852
3830
|
}
|
|
3853
3831
|
)
|
|
3854
3832
|
);
|
|
3855
|
-
},
|
|
3833
|
+
}, Ei = ({
|
|
3856
3834
|
renderActions: e,
|
|
3857
3835
|
renderFooter: t,
|
|
3858
3836
|
disabled: n = !1,
|
|
@@ -3860,8 +3838,8 @@ const xi = ({
|
|
|
3860
3838
|
composerInput: r
|
|
3861
3839
|
}) => {
|
|
3862
3840
|
var l;
|
|
3863
|
-
const { channel: i } =
|
|
3864
|
-
return n ? /* @__PURE__ */ m(
|
|
3841
|
+
const { channel: i } = ue(), o = ((l = i == null ? void 0 : i.data) == null ? void 0 : l.frozen) === !0;
|
|
3842
|
+
return n ? /* @__PURE__ */ m(te, { children: [
|
|
3865
3843
|
/* @__PURE__ */ s("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ s("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
3866
3844
|
t == null ? void 0 : t()
|
|
3867
3845
|
] }) : /* @__PURE__ */ m("div", { className: "flex min-h-0 flex-col gap-4 p-4", children: [
|
|
@@ -3873,67 +3851,67 @@ const xi = ({
|
|
|
3873
3851
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3874
3852
|
children: [
|
|
3875
3853
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3876
|
-
/* @__PURE__ */ s(
|
|
3854
|
+
/* @__PURE__ */ s(kt.Provider, { value: o, children: /* @__PURE__ */ s(gn, { Input: r ?? Ci }) })
|
|
3877
3855
|
]
|
|
3878
3856
|
}
|
|
3879
3857
|
),
|
|
3880
3858
|
t == null ? void 0 : t()
|
|
3881
3859
|
] });
|
|
3882
|
-
},
|
|
3860
|
+
}, Si = [
|
|
3883
3861
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
3884
3862
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
3885
|
-
],
|
|
3863
|
+
], Ii = {
|
|
3886
3864
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
3887
3865
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
3888
|
-
},
|
|
3866
|
+
}, Ti = [
|
|
3889
3867
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3890
|
-
],
|
|
3868
|
+
], Ai = {
|
|
3891
3869
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3892
|
-
},
|
|
3870
|
+
}, Je = "age safety guidelines.", Mi = "https://linktr.ee/s/about/contact", ns = (e) => Si.includes(e), Ri = (e) => Ti.includes(e), Li = (e) => {
|
|
3893
3871
|
var a;
|
|
3894
3872
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3895
|
-
if (
|
|
3873
|
+
if (ns(t))
|
|
3896
3874
|
return {
|
|
3897
3875
|
kind: "dm-agent",
|
|
3898
3876
|
type: t
|
|
3899
3877
|
};
|
|
3900
|
-
if (
|
|
3878
|
+
if (Ri(t))
|
|
3901
3879
|
return {
|
|
3902
3880
|
kind: "age-safety",
|
|
3903
3881
|
type: t
|
|
3904
3882
|
};
|
|
3905
3883
|
const n = e.dm_agent_system_type;
|
|
3906
|
-
if (
|
|
3884
|
+
if (ns(n))
|
|
3907
3885
|
return {
|
|
3908
3886
|
kind: "dm-agent",
|
|
3909
3887
|
type: n
|
|
3910
3888
|
};
|
|
3911
|
-
},
|
|
3912
|
-
const t = e.indexOf(
|
|
3889
|
+
}, Di = (e) => {
|
|
3890
|
+
const t = e.indexOf(Je);
|
|
3913
3891
|
if (t === -1)
|
|
3914
3892
|
return e;
|
|
3915
|
-
const n = t +
|
|
3916
|
-
return /* @__PURE__ */ m(
|
|
3893
|
+
const n = t + Je.length;
|
|
3894
|
+
return /* @__PURE__ */ m(te, { children: [
|
|
3917
3895
|
e.slice(0, t),
|
|
3918
3896
|
/* @__PURE__ */ s(
|
|
3919
3897
|
"a",
|
|
3920
3898
|
{
|
|
3921
|
-
href:
|
|
3899
|
+
href: Mi,
|
|
3922
3900
|
target: "_blank",
|
|
3923
3901
|
rel: "noopener noreferrer",
|
|
3924
3902
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
3925
|
-
children:
|
|
3903
|
+
children: Je
|
|
3926
3904
|
}
|
|
3927
3905
|
),
|
|
3928
3906
|
e.slice(n)
|
|
3929
3907
|
] });
|
|
3930
|
-
},
|
|
3908
|
+
}, zi = (e) => {
|
|
3931
3909
|
var a, r;
|
|
3932
|
-
const t = e.message.hide_date === !0, n =
|
|
3910
|
+
const t = e.message.hide_date === !0, n = Li(
|
|
3933
3911
|
e.message
|
|
3934
3912
|
);
|
|
3935
3913
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
3936
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
3914
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ii[n.type];
|
|
3937
3915
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3938
3916
|
/* @__PURE__ */ m(
|
|
3939
3917
|
"div",
|
|
@@ -3959,7 +3937,7 @@ const xi = ({
|
|
|
3959
3937
|
] });
|
|
3960
3938
|
}
|
|
3961
3939
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
3962
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
3940
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ai[n.type];
|
|
3963
3941
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3964
3942
|
/* @__PURE__ */ m(
|
|
3965
3943
|
"div",
|
|
@@ -3969,7 +3947,7 @@ const xi = ({
|
|
|
3969
3947
|
"data-age-safety-system-type": n.type,
|
|
3970
3948
|
children: [
|
|
3971
3949
|
/* @__PURE__ */ s(
|
|
3972
|
-
|
|
3950
|
+
Jn,
|
|
3973
3951
|
{
|
|
3974
3952
|
size: 24,
|
|
3975
3953
|
weight: "duotone",
|
|
@@ -3978,7 +3956,7 @@ const xi = ({
|
|
|
3978
3956
|
"data-testid": "age-safety-system-message-icon"
|
|
3979
3957
|
}
|
|
3980
3958
|
),
|
|
3981
|
-
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
3959
|
+
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Di(i) }) })
|
|
3982
3960
|
]
|
|
3983
3961
|
}
|
|
3984
3962
|
),
|
|
@@ -3993,7 +3971,7 @@ const xi = ({
|
|
|
3993
3971
|
] }),
|
|
3994
3972
|
!t && /* @__PURE__ */ s(Ye, { message: e.message })
|
|
3995
3973
|
] });
|
|
3996
|
-
},
|
|
3974
|
+
}, Fs = at(!1), Ze = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
|
|
3997
3975
|
"animateTransform",
|
|
3998
3976
|
{
|
|
3999
3977
|
attributeName: "transform",
|
|
@@ -4003,17 +3981,17 @@ const xi = ({
|
|
|
4003
3981
|
begin: `${120 * t}ms`,
|
|
4004
3982
|
repeatCount: "indefinite"
|
|
4005
3983
|
}
|
|
4006
|
-
) }),
|
|
3984
|
+
) }), Pi = /* @__PURE__ */ new Set([
|
|
4007
3985
|
qe.Thinking,
|
|
4008
3986
|
qe.Generating,
|
|
4009
3987
|
qe.ExternalSources
|
|
4010
|
-
]),
|
|
3988
|
+
]), Fi = ({ threadList: e }) => {
|
|
4011
3989
|
var v, w;
|
|
4012
|
-
const { channel: t, channelConfig: n, thread: a } =
|
|
4013
|
-
if (!e && l &&
|
|
4014
|
-
const b =
|
|
3990
|
+
const { channel: t, channelConfig: n, thread: a } = ue(), { client: r } = me(), { typing: i = {} } = _n(), { aiState: o } = Nn(t), l = Se(Fs);
|
|
3991
|
+
if (!e && l && Pi.has(o)) {
|
|
3992
|
+
const b = Oi(t, (v = r.user) == null ? void 0 : v.id);
|
|
4015
3993
|
return /* @__PURE__ */ s(
|
|
4016
|
-
|
|
3994
|
+
as,
|
|
4017
3995
|
{
|
|
4018
3996
|
avatarId: (b == null ? void 0 : b.id) ?? "ai-agent",
|
|
4019
3997
|
avatarName: (b == null ? void 0 : b.name) ?? (b == null ? void 0 : b.id) ?? "Agent",
|
|
@@ -4039,7 +4017,7 @@ const xi = ({
|
|
|
4039
4017
|
return null;
|
|
4040
4018
|
const f = (w = h[0]) == null ? void 0 : w.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
4041
4019
|
return /* @__PURE__ */ s(
|
|
4042
|
-
|
|
4020
|
+
as,
|
|
4043
4021
|
{
|
|
4044
4022
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
4045
4023
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -4047,7 +4025,7 @@ const xi = ({
|
|
|
4047
4025
|
testId: "typing-indicator"
|
|
4048
4026
|
}
|
|
4049
4027
|
);
|
|
4050
|
-
},
|
|
4028
|
+
}, as = ({
|
|
4051
4029
|
avatarId: e,
|
|
4052
4030
|
avatarName: t,
|
|
4053
4031
|
avatarImage: n,
|
|
@@ -4062,7 +4040,7 @@ const xi = ({
|
|
|
4062
4040
|
},
|
|
4063
4041
|
children: /* @__PURE__ */ m("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
4064
4042
|
/* @__PURE__ */ s(
|
|
4065
|
-
|
|
4043
|
+
se,
|
|
4066
4044
|
{
|
|
4067
4045
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4068
4046
|
id: e,
|
|
@@ -4082,16 +4060,16 @@ const xi = ({
|
|
|
4082
4060
|
height: "13",
|
|
4083
4061
|
overflow: "visible",
|
|
4084
4062
|
children: [
|
|
4085
|
-
/* @__PURE__ */ s(
|
|
4086
|
-
/* @__PURE__ */ s(
|
|
4087
|
-
/* @__PURE__ */ s(
|
|
4063
|
+
/* @__PURE__ */ s(Ze, { cx: "4", index: 0 }),
|
|
4064
|
+
/* @__PURE__ */ s(Ze, { cx: "16", index: 1 }),
|
|
4065
|
+
/* @__PURE__ */ s(Ze, { cx: "28", index: 2 })
|
|
4088
4066
|
]
|
|
4089
4067
|
}
|
|
4090
4068
|
) }) }) }) }) })
|
|
4091
4069
|
] })
|
|
4092
4070
|
}
|
|
4093
4071
|
);
|
|
4094
|
-
function
|
|
4072
|
+
function Oi(e, t) {
|
|
4095
4073
|
var a;
|
|
4096
4074
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4097
4075
|
for (const r of Object.values(n)) {
|
|
@@ -4100,7 +4078,7 @@ function Vi(e, t) {
|
|
|
4100
4078
|
return i;
|
|
4101
4079
|
}
|
|
4102
4080
|
}
|
|
4103
|
-
const
|
|
4081
|
+
const $i = () => null, Bi = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
4104
4082
|
"div",
|
|
4105
4083
|
{
|
|
4106
4084
|
className: k("flex items-center justify-center h-full", e),
|
|
@@ -4144,11 +4122,11 @@ const Gi = () => null, Hi = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
|
4144
4122
|
]
|
|
4145
4123
|
}
|
|
4146
4124
|
), Be = V.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ m("div", { className: "flex items-center", children: [
|
|
4147
|
-
/* @__PURE__ */ s(
|
|
4125
|
+
/* @__PURE__ */ s(Bi, { className: "w-6 h-6" }),
|
|
4148
4126
|
/* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4149
4127
|
] }) }));
|
|
4150
4128
|
Be.displayName = "LoadingState";
|
|
4151
|
-
const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Pe = "Replies instantly with AI assistant",
|
|
4129
|
+
const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Pe = "Replies instantly with AI assistant", Ui = ({
|
|
4152
4130
|
onBack: e,
|
|
4153
4131
|
showBackButton: t,
|
|
4154
4132
|
showStarButton: n = !1,
|
|
@@ -4167,8 +4145,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4167
4145
|
onParticipantNameClick: w,
|
|
4168
4146
|
renderHeaderTitleBadges: b
|
|
4169
4147
|
}) => {
|
|
4170
|
-
var I,
|
|
4171
|
-
const { channel: g } =
|
|
4148
|
+
var I, E, R, S, z, O;
|
|
4149
|
+
const { channel: g } = ue(), { client: x } = me(), N = V.useMemo(
|
|
4172
4150
|
() => {
|
|
4173
4151
|
var j;
|
|
4174
4152
|
return je(
|
|
@@ -4178,12 +4156,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4178
4156
|
);
|
|
4179
4157
|
},
|
|
4180
4158
|
[(I = g.state) == null ? void 0 : I.members, x == null ? void 0 : x.userID, g.type]
|
|
4181
|
-
), C =
|
|
4159
|
+
), C = ot(N == null ? void 0 : N.user), T = (E = N == null ? void 0 : N.user) == null ? void 0 : E.image, A = lt(g), L = b == null ? void 0 : b({
|
|
4182
4160
|
channel: g,
|
|
4183
4161
|
participant: N
|
|
4184
|
-
}), $ = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", F = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90",
|
|
4162
|
+
}), $ = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", F = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", D = /* @__PURE__ */ m(te, { children: [
|
|
4185
4163
|
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: C }),
|
|
4186
|
-
|
|
4164
|
+
L && /* @__PURE__ */ s("span", { className: "shrink-0", children: L })
|
|
4187
4165
|
] }), y = async () => {
|
|
4188
4166
|
try {
|
|
4189
4167
|
A ? await g.unpin() : await g.pin();
|
|
@@ -4207,7 +4185,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4207
4185
|
}),
|
|
4208
4186
|
type: "button",
|
|
4209
4187
|
"aria-label": "Back to conversations",
|
|
4210
|
-
children: /* @__PURE__ */ s(
|
|
4188
|
+
children: /* @__PURE__ */ s(Qe, { className: "size-5 text-black/90" })
|
|
4211
4189
|
}
|
|
4212
4190
|
) }),
|
|
4213
4191
|
/* @__PURE__ */ s(
|
|
@@ -4227,7 +4205,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4227
4205
|
),
|
|
4228
4206
|
children: [
|
|
4229
4207
|
/* @__PURE__ */ s(
|
|
4230
|
-
|
|
4208
|
+
se,
|
|
4231
4209
|
{
|
|
4232
4210
|
id: ((R = N == null ? void 0 : N.user) == null ? void 0 : R.id) || g.id || "unknown",
|
|
4233
4211
|
name: C,
|
|
@@ -4238,7 +4216,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4238
4216
|
}
|
|
4239
4217
|
),
|
|
4240
4218
|
/* @__PURE__ */ m("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
4241
|
-
|
|
4219
|
+
D,
|
|
4242
4220
|
/* @__PURE__ */ s(ve, { className: "size-3 shrink-0", weight: "bold" })
|
|
4243
4221
|
] }),
|
|
4244
4222
|
a && /* @__PURE__ */ m("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
@@ -4249,9 +4227,9 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4249
4227
|
}
|
|
4250
4228
|
) : /* @__PURE__ */ m("div", { className: $, children: [
|
|
4251
4229
|
/* @__PURE__ */ s(
|
|
4252
|
-
|
|
4230
|
+
se,
|
|
4253
4231
|
{
|
|
4254
|
-
id: ((
|
|
4232
|
+
id: ((S = N == null ? void 0 : N.user) == null ? void 0 : S.id) || g.id || "unknown",
|
|
4255
4233
|
name: C,
|
|
4256
4234
|
image: T,
|
|
4257
4235
|
starred: n && A,
|
|
@@ -4260,7 +4238,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4260
4238
|
}
|
|
4261
4239
|
),
|
|
4262
4240
|
/* @__PURE__ */ m("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
4263
|
-
|
|
4241
|
+
D,
|
|
4264
4242
|
/* @__PURE__ */ s(
|
|
4265
4243
|
ve,
|
|
4266
4244
|
{
|
|
@@ -4297,7 +4275,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4297
4275
|
}
|
|
4298
4276
|
),
|
|
4299
4277
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4300
|
-
|
|
4278
|
+
tt,
|
|
4301
4279
|
{
|
|
4302
4280
|
channel: g,
|
|
4303
4281
|
participant: N,
|
|
@@ -4327,7 +4305,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4327
4305
|
type: "button",
|
|
4328
4306
|
onClick: e,
|
|
4329
4307
|
"aria-label": "Back to conversations",
|
|
4330
|
-
children: /* @__PURE__ */ s(
|
|
4308
|
+
children: /* @__PURE__ */ s(Qe, { className: "size-5 text-black/90" })
|
|
4331
4309
|
}
|
|
4332
4310
|
),
|
|
4333
4311
|
w ? /* @__PURE__ */ m(
|
|
@@ -4342,7 +4320,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4342
4320
|
),
|
|
4343
4321
|
children: [
|
|
4344
4322
|
/* @__PURE__ */ s(
|
|
4345
|
-
|
|
4323
|
+
se,
|
|
4346
4324
|
{
|
|
4347
4325
|
id: ((z = N == null ? void 0 : N.user) == null ? void 0 : z.id) || g.id || "unknown",
|
|
4348
4326
|
name: C,
|
|
@@ -4354,7 +4332,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4354
4332
|
),
|
|
4355
4333
|
/* @__PURE__ */ m("div", { className: "min-w-0", children: [
|
|
4356
4334
|
/* @__PURE__ */ m("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4357
|
-
|
|
4335
|
+
D,
|
|
4358
4336
|
/* @__PURE__ */ s(ve, { className: "size-4 shrink-0", weight: "bold" })
|
|
4359
4337
|
] }),
|
|
4360
4338
|
a && /* @__PURE__ */ m("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
@@ -4366,7 +4344,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4366
4344
|
}
|
|
4367
4345
|
) : /* @__PURE__ */ m("div", { className: F, children: [
|
|
4368
4346
|
/* @__PURE__ */ s(
|
|
4369
|
-
|
|
4347
|
+
se,
|
|
4370
4348
|
{
|
|
4371
4349
|
id: ((O = N == null ? void 0 : N.user) == null ? void 0 : O.id) || g.id || "unknown",
|
|
4372
4350
|
name: C,
|
|
@@ -4378,7 +4356,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4378
4356
|
),
|
|
4379
4357
|
/* @__PURE__ */ m("div", { className: "min-w-0", children: [
|
|
4380
4358
|
/* @__PURE__ */ m("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4381
|
-
|
|
4359
|
+
D,
|
|
4382
4360
|
/* @__PURE__ */ s(
|
|
4383
4361
|
ve,
|
|
4384
4362
|
{
|
|
@@ -4415,7 +4393,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4415
4393
|
}
|
|
4416
4394
|
),
|
|
4417
4395
|
v && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4418
|
-
|
|
4396
|
+
tt,
|
|
4419
4397
|
{
|
|
4420
4398
|
channel: g,
|
|
4421
4399
|
participant: N,
|
|
@@ -4434,7 +4412,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4434
4412
|
] })
|
|
4435
4413
|
] })
|
|
4436
4414
|
] });
|
|
4437
|
-
},
|
|
4415
|
+
}, ji = ({
|
|
4438
4416
|
onBack: e,
|
|
4439
4417
|
showBackButton: t,
|
|
4440
4418
|
renderMessageInputActions: n,
|
|
@@ -4458,13 +4436,13 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4458
4436
|
renderChannelActions: C,
|
|
4459
4437
|
renderMessage: T,
|
|
4460
4438
|
dmAgentEnabled: A = !1,
|
|
4461
|
-
viewerLanguage:
|
|
4439
|
+
viewerLanguage: L,
|
|
4462
4440
|
showChannelInfo: $ = !0,
|
|
4463
4441
|
onParticipantNameClick: F,
|
|
4464
|
-
composerInput:
|
|
4442
|
+
composerInput: D
|
|
4465
4443
|
}) => {
|
|
4466
4444
|
var _, M, H, q;
|
|
4467
|
-
const { channel: y } =
|
|
4445
|
+
const { channel: y } = ue(), { client: I } = me(), E = V.useMemo(
|
|
4468
4446
|
() => {
|
|
4469
4447
|
var Y;
|
|
4470
4448
|
return je(
|
|
@@ -4478,13 +4456,13 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4478
4456
|
var W;
|
|
4479
4457
|
const Y = I == null ? void 0 : I.userID;
|
|
4480
4458
|
return Y ? Object.values(((W = y.state) == null ? void 0 : W.members) || {}).find((Q) => {
|
|
4481
|
-
var
|
|
4482
|
-
return ((
|
|
4459
|
+
var oe;
|
|
4460
|
+
return ((oe = Q.user) == null ? void 0 : oe.id) === Y;
|
|
4483
4461
|
}) : void 0;
|
|
4484
|
-
}, [I == null ? void 0 : I.userID, (M = y.state) == null ? void 0 : M.members]),
|
|
4462
|
+
}, [I == null ? void 0 : I.userID, (M = y.state) == null ? void 0 : M.members]), S = ((H = R == null ? void 0 : R.user) == null ? void 0 : H.is_account) ?? (R == null ? void 0 : R.is_account), z = ((q = E == null ? void 0 : E.user) == null ? void 0 : q.is_account) ?? (E == null ? void 0 : E.is_account), O = A && S === !1 && z === !0, j = y.state.messages.some(
|
|
4485
4463
|
(Y) => Y.type !== "deleted"
|
|
4486
|
-
), X = g ? /* @__PURE__ */ s(V.Fragment, { children: g() }, "lt-channel-banner") : null,
|
|
4487
|
-
|
|
4464
|
+
), X = g ? /* @__PURE__ */ s(V.Fragment, { children: g() }, "lt-channel-banner") : null, ee = F ? /* @__PURE__ */ s(
|
|
4465
|
+
ha,
|
|
4488
4466
|
{
|
|
4489
4467
|
onBack: e,
|
|
4490
4468
|
showBackButton: t,
|
|
@@ -4505,29 +4483,29 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4505
4483
|
}
|
|
4506
4484
|
) : null, K = Z(
|
|
4507
4485
|
(Y) => {
|
|
4508
|
-
const { message: B } =
|
|
4509
|
-
|
|
4486
|
+
const { message: B } = Ie("ChannelView"), W = /* @__PURE__ */ s(
|
|
4487
|
+
bi,
|
|
4510
4488
|
{
|
|
4511
4489
|
...Y,
|
|
4512
4490
|
chatbotVotingEnabled: b,
|
|
4513
|
-
viewerLanguage:
|
|
4491
|
+
viewerLanguage: L
|
|
4514
4492
|
}
|
|
4515
4493
|
);
|
|
4516
4494
|
return !T || !B ? W : T(W, B);
|
|
4517
4495
|
},
|
|
4518
|
-
[b, T,
|
|
4496
|
+
[b, T, L]
|
|
4519
4497
|
);
|
|
4520
|
-
return /* @__PURE__ */ s(
|
|
4521
|
-
|
|
4498
|
+
return /* @__PURE__ */ s(te, { children: /* @__PURE__ */ s(
|
|
4499
|
+
kn,
|
|
4522
4500
|
{
|
|
4523
4501
|
overrides: {
|
|
4524
4502
|
Message: K,
|
|
4525
|
-
MessageActions:
|
|
4503
|
+
MessageActions: wi
|
|
4526
4504
|
},
|
|
4527
|
-
children: /* @__PURE__ */ m(
|
|
4528
|
-
!F && /* @__PURE__ */ m(
|
|
4505
|
+
children: /* @__PURE__ */ m(Cn, { children: [
|
|
4506
|
+
!F && /* @__PURE__ */ m(te, { children: [
|
|
4529
4507
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
4530
|
-
|
|
4508
|
+
Ui,
|
|
4531
4509
|
{
|
|
4532
4510
|
onBack: e,
|
|
4533
4511
|
showBackButton: t,
|
|
@@ -4550,7 +4528,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4550
4528
|
X
|
|
4551
4529
|
] }),
|
|
4552
4530
|
F && !j && /* @__PURE__ */ m("div", { className: "px-4 @lg:px-6", children: [
|
|
4553
|
-
|
|
4531
|
+
ee,
|
|
4554
4532
|
X
|
|
4555
4533
|
] }),
|
|
4556
4534
|
/* @__PURE__ */ s(
|
|
@@ -4558,10 +4536,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4558
4536
|
{
|
|
4559
4537
|
className: "flex-1 overflow-hidden relative",
|
|
4560
4538
|
children: /* @__PURE__ */ s(
|
|
4561
|
-
|
|
4539
|
+
En,
|
|
4562
4540
|
{
|
|
4563
4541
|
head: F && j ? /* @__PURE__ */ m("div", { className: "sticky top-0 z-10", children: [
|
|
4564
|
-
|
|
4542
|
+
ee,
|
|
4565
4543
|
X
|
|
4566
4544
|
] }) : void 0,
|
|
4567
4545
|
hideDeletedMessages: !0,
|
|
@@ -4573,7 +4551,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4573
4551
|
),
|
|
4574
4552
|
r ? /* @__PURE__ */ s(V.Fragment, { children: r(y) }, "lt-channel-conversation-footer") : null,
|
|
4575
4553
|
/* @__PURE__ */ s(
|
|
4576
|
-
|
|
4554
|
+
Ei,
|
|
4577
4555
|
{
|
|
4578
4556
|
...n && {
|
|
4579
4557
|
renderActions: () => n == null ? void 0 : n(y)
|
|
@@ -4581,14 +4559,14 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4581
4559
|
renderFooter: () => a == null ? void 0 : a(y),
|
|
4582
4560
|
disabled: c,
|
|
4583
4561
|
disabledReason: v,
|
|
4584
|
-
composerInput:
|
|
4562
|
+
composerInput: D
|
|
4585
4563
|
},
|
|
4586
4564
|
"lt-channel-message-input"
|
|
4587
4565
|
)
|
|
4588
4566
|
] })
|
|
4589
4567
|
}
|
|
4590
4568
|
) });
|
|
4591
|
-
},
|
|
4569
|
+
}, Os = V.memo(
|
|
4592
4570
|
({
|
|
4593
4571
|
channel: e,
|
|
4594
4572
|
onBack: t,
|
|
@@ -4599,7 +4577,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4599
4577
|
onLeaveConversation: o,
|
|
4600
4578
|
onBlockParticipant: l,
|
|
4601
4579
|
className: d,
|
|
4602
|
-
CustomChannelEmptyState: u =
|
|
4580
|
+
CustomChannelEmptyState: u = $i,
|
|
4603
4581
|
showDeleteConversation: p = !0,
|
|
4604
4582
|
onDeleteConversationClick: h,
|
|
4605
4583
|
onBlockParticipantClick: f,
|
|
@@ -4613,15 +4591,15 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4613
4591
|
onMessageSent: C,
|
|
4614
4592
|
showStarButton: T = !1,
|
|
4615
4593
|
chatbotVotingEnabled: A = !1,
|
|
4616
|
-
renderChannelBanner:
|
|
4594
|
+
renderChannelBanner: L,
|
|
4617
4595
|
renderHeaderTitleBadges: $,
|
|
4618
4596
|
customChannelActions: F,
|
|
4619
|
-
renderChannelActions:
|
|
4597
|
+
renderChannelActions: D,
|
|
4620
4598
|
renderMessage: y,
|
|
4621
4599
|
onMessageLinkClick: I,
|
|
4622
|
-
sendButton:
|
|
4600
|
+
sendButton: E,
|
|
4623
4601
|
attachmentPreviewList: R,
|
|
4624
|
-
viewerLanguage:
|
|
4602
|
+
viewerLanguage: S,
|
|
4625
4603
|
showChannelInfo: z = !0,
|
|
4626
4604
|
onParticipantNameClick: O,
|
|
4627
4605
|
composerInput: j
|
|
@@ -4645,40 +4623,40 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4645
4623
|
return C == null || C(W), W;
|
|
4646
4624
|
},
|
|
4647
4625
|
[e, x, N, C]
|
|
4648
|
-
),
|
|
4626
|
+
), ee = G(null);
|
|
4649
4627
|
return J(() => {
|
|
4650
4628
|
if (!I) return;
|
|
4651
|
-
const K =
|
|
4629
|
+
const K = ee.current;
|
|
4652
4630
|
if (!K) return;
|
|
4653
4631
|
const _ = (M) => {
|
|
4654
4632
|
const H = M.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
|
|
4655
4633
|
if (!Y) return;
|
|
4656
|
-
const B = q == null ? void 0 : q.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), Q = W ? e.state.messages.find((
|
|
4634
|
+
const B = q == null ? void 0 : q.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), Q = W ? e.state.messages.find((oe) => oe.id === W) : void 0;
|
|
4657
4635
|
I(Y, Q);
|
|
4658
4636
|
};
|
|
4659
4637
|
return K.addEventListener("click", _), () => K.removeEventListener("click", _);
|
|
4660
4638
|
}, [I, e]), /* @__PURE__ */ s(
|
|
4661
4639
|
"div",
|
|
4662
4640
|
{
|
|
4663
|
-
ref:
|
|
4641
|
+
ref: ee,
|
|
4664
4642
|
className: k(
|
|
4665
4643
|
"messaging-channel-view h-full flex flex-col",
|
|
4666
4644
|
d
|
|
4667
4645
|
),
|
|
4668
|
-
children: /* @__PURE__ */ s(
|
|
4669
|
-
|
|
4646
|
+
children: /* @__PURE__ */ s(Fs.Provider, { value: x ?? !1, children: /* @__PURE__ */ s(
|
|
4647
|
+
yn,
|
|
4670
4648
|
{
|
|
4671
4649
|
channel: e,
|
|
4672
|
-
MessageSystem:
|
|
4650
|
+
MessageSystem: zi,
|
|
4673
4651
|
EmptyStateIndicator: u,
|
|
4674
4652
|
LoadingIndicator: Be,
|
|
4675
|
-
DateSeparator:
|
|
4676
|
-
TypingIndicator:
|
|
4653
|
+
DateSeparator: fa,
|
|
4654
|
+
TypingIndicator: Fi,
|
|
4677
4655
|
doSendMessageRequest: X,
|
|
4678
|
-
...
|
|
4656
|
+
...E ? { SendButton: E } : {},
|
|
4679
4657
|
...R ? { AttachmentPreviewList: R } : {},
|
|
4680
4658
|
children: /* @__PURE__ */ s(
|
|
4681
|
-
|
|
4659
|
+
ji,
|
|
4682
4660
|
{
|
|
4683
4661
|
onBack: t,
|
|
4684
4662
|
showBackButton: n,
|
|
@@ -4699,12 +4677,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4699
4677
|
showStarButton: T,
|
|
4700
4678
|
dmAgentEnabled: x,
|
|
4701
4679
|
chatbotVotingEnabled: A,
|
|
4702
|
-
renderChannelBanner:
|
|
4680
|
+
renderChannelBanner: L,
|
|
4703
4681
|
renderHeaderTitleBadges: $,
|
|
4704
4682
|
customChannelActions: F,
|
|
4705
|
-
renderChannelActions:
|
|
4683
|
+
renderChannelActions: D,
|
|
4706
4684
|
renderMessage: y,
|
|
4707
|
-
viewerLanguage:
|
|
4685
|
+
viewerLanguage: S,
|
|
4708
4686
|
showChannelInfo: z,
|
|
4709
4687
|
onParticipantNameClick: O,
|
|
4710
4688
|
composerInput: j
|
|
@@ -4716,8 +4694,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4716
4694
|
);
|
|
4717
4695
|
}
|
|
4718
4696
|
);
|
|
4719
|
-
|
|
4720
|
-
const
|
|
4697
|
+
Os.displayName = "ChannelView";
|
|
4698
|
+
const ye = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ m("div", { className: "text-center max-w-sm", children: [
|
|
4721
4699
|
/* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
4722
4700
|
/* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
4723
4701
|
/* @__PURE__ */ s("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -4731,8 +4709,8 @@ const ke = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4731
4709
|
}
|
|
4732
4710
|
)
|
|
4733
4711
|
] }) }));
|
|
4734
|
-
|
|
4735
|
-
const
|
|
4712
|
+
ye.displayName = "ErrorState";
|
|
4713
|
+
const cl = ({
|
|
4736
4714
|
capabilities: e = {},
|
|
4737
4715
|
renderMessageInputActions: t,
|
|
4738
4716
|
renderConversationFooter: n,
|
|
@@ -4758,14 +4736,14 @@ const fl = ({
|
|
|
4758
4736
|
composerInput: A
|
|
4759
4737
|
}) => {
|
|
4760
4738
|
const {
|
|
4761
|
-
client:
|
|
4739
|
+
client: L,
|
|
4762
4740
|
isConnected: $,
|
|
4763
4741
|
isLoading: F,
|
|
4764
|
-
error:
|
|
4742
|
+
error: D,
|
|
4765
4743
|
refreshConnection: y,
|
|
4766
4744
|
service: I,
|
|
4767
|
-
debug:
|
|
4768
|
-
} =
|
|
4745
|
+
debug: E
|
|
4746
|
+
} = Qn(), [R, S] = U(null), [z, O] = U(null), [j, X] = U(!1), { showDeleteConversation: ee = !0 } = e, K = G(o);
|
|
4769
4747
|
K.current = o;
|
|
4770
4748
|
const _ = G(a);
|
|
4771
4749
|
_.current = a;
|
|
@@ -4773,8 +4751,8 @@ const fl = ({
|
|
|
4773
4751
|
J(() => {
|
|
4774
4752
|
H.current = R;
|
|
4775
4753
|
}, [R]), J(() => {
|
|
4776
|
-
if (!
|
|
4777
|
-
const B =
|
|
4754
|
+
if (!L || !$) return;
|
|
4755
|
+
const B = L.userID;
|
|
4778
4756
|
if (!B) return;
|
|
4779
4757
|
const W = `${B}::${i}`;
|
|
4780
4758
|
if (M.current === W) return;
|
|
@@ -4783,13 +4761,13 @@ const fl = ({
|
|
|
4783
4761
|
M.current === W && (M.current = null);
|
|
4784
4762
|
};
|
|
4785
4763
|
(async () => {
|
|
4786
|
-
var
|
|
4764
|
+
var Le, De;
|
|
4787
4765
|
try {
|
|
4788
|
-
|
|
4766
|
+
E && console.log(
|
|
4789
4767
|
"[MessagingShell] Loading initial conversation with:",
|
|
4790
4768
|
i
|
|
4791
4769
|
);
|
|
4792
|
-
const
|
|
4770
|
+
const ne = await L.queryChannels(
|
|
4793
4771
|
{
|
|
4794
4772
|
type: "messaging",
|
|
4795
4773
|
members: { $eq: [B, i] }
|
|
@@ -4797,16 +4775,16 @@ const fl = ({
|
|
|
4797
4775
|
{},
|
|
4798
4776
|
{ limit: 1 }
|
|
4799
4777
|
);
|
|
4800
|
-
if (
|
|
4801
|
-
|
|
4778
|
+
if (ne.length > 0) {
|
|
4779
|
+
S(ne[0]), O(null), (Le = _.current) == null || Le.call(_, ne[0]), E && console.log(
|
|
4802
4780
|
"[MessagingShell] Initial conversation loaded:",
|
|
4803
|
-
|
|
4781
|
+
ne[0].id
|
|
4804
4782
|
);
|
|
4805
4783
|
return;
|
|
4806
4784
|
}
|
|
4807
|
-
const
|
|
4808
|
-
if (!
|
|
4809
|
-
Q(), O("No conversation found with this account"),
|
|
4785
|
+
const ce = K.current;
|
|
4786
|
+
if (!ce || !I) {
|
|
4787
|
+
Q(), O("No conversation found with this account"), E && console.log(
|
|
4810
4788
|
"[MessagingShell] No conversation found for:",
|
|
4811
4789
|
i
|
|
4812
4790
|
);
|
|
@@ -4814,11 +4792,11 @@ const fl = ({
|
|
|
4814
4792
|
}
|
|
4815
4793
|
try {
|
|
4816
4794
|
const ie = await I.startChannelWithParticipant({
|
|
4817
|
-
id:
|
|
4818
|
-
name:
|
|
4819
|
-
phone:
|
|
4795
|
+
id: ce.id,
|
|
4796
|
+
name: ce.name,
|
|
4797
|
+
phone: ce.phone
|
|
4820
4798
|
});
|
|
4821
|
-
|
|
4799
|
+
S(ie), O(null), (De = _.current) == null || De.call(_, ie), E && console.log(
|
|
4822
4800
|
"[MessagingShell] Channel created and loaded:",
|
|
4823
4801
|
ie.id
|
|
4824
4802
|
);
|
|
@@ -4828,28 +4806,28 @@ const fl = ({
|
|
|
4828
4806
|
ie
|
|
4829
4807
|
), Q(), O("Failed to create conversation");
|
|
4830
4808
|
}
|
|
4831
|
-
} catch (
|
|
4809
|
+
} catch (ne) {
|
|
4832
4810
|
console.error(
|
|
4833
4811
|
"[MessagingShell] Failed to load initial conversation:",
|
|
4834
|
-
|
|
4812
|
+
ne
|
|
4835
4813
|
), Q(), H.current || O("Failed to load conversation");
|
|
4836
4814
|
}
|
|
4837
4815
|
})();
|
|
4838
|
-
}, [i,
|
|
4816
|
+
}, [i, L, $, I, E]);
|
|
4839
4817
|
const q = G(r);
|
|
4840
4818
|
q.current = r;
|
|
4841
4819
|
const Y = Z(() => {
|
|
4842
4820
|
var B;
|
|
4843
|
-
|
|
4821
|
+
S(null), X(!0), (B = q.current) == null || B.call(q);
|
|
4844
4822
|
}, []);
|
|
4845
|
-
return F ? /* @__PURE__ */ s(Be, {}) :
|
|
4846
|
-
|
|
4823
|
+
return F ? /* @__PURE__ */ s(Be, {}) : D ? /* @__PURE__ */ s(ye, { message: D, onBack: y }) : !$ || !L ? /* @__PURE__ */ s(
|
|
4824
|
+
ye,
|
|
4847
4825
|
{
|
|
4848
4826
|
message: "Not connected to messaging service",
|
|
4849
4827
|
onBack: y
|
|
4850
4828
|
}
|
|
4851
|
-
) : z ? /* @__PURE__ */ s(
|
|
4852
|
-
|
|
4829
|
+
) : z ? /* @__PURE__ */ s(ye, { message: z }) : j && !R ? /* @__PURE__ */ s(ye, { message: "Conversation ended" }) : R ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
|
|
4830
|
+
Os,
|
|
4853
4831
|
{
|
|
4854
4832
|
channel: R,
|
|
4855
4833
|
renderMessageInputActions: t,
|
|
@@ -4858,7 +4836,7 @@ const fl = ({
|
|
|
4858
4836
|
onLeaveConversation: Y,
|
|
4859
4837
|
onBlockParticipant: Y,
|
|
4860
4838
|
CustomChannelEmptyState: l,
|
|
4861
|
-
showDeleteConversation:
|
|
4839
|
+
showDeleteConversation: ee,
|
|
4862
4840
|
onBlockParticipantClick: d,
|
|
4863
4841
|
onReportParticipantClick: u,
|
|
4864
4842
|
dmAgentEnabled: p,
|
|
@@ -4877,13 +4855,13 @@ const fl = ({
|
|
|
4877
4855
|
R.id
|
|
4878
4856
|
) }) }) : /* @__PURE__ */ s(Be, {});
|
|
4879
4857
|
};
|
|
4880
|
-
function
|
|
4858
|
+
function Vi(e) {
|
|
4881
4859
|
const t = e.state.pending_messages;
|
|
4882
4860
|
if (t != null && t.length)
|
|
4883
4861
|
for (const n of t)
|
|
4884
4862
|
e.state.addMessageSorted(n.message);
|
|
4885
4863
|
}
|
|
4886
|
-
const
|
|
4864
|
+
const $s = V.createContext({
|
|
4887
4865
|
selectedChannel: void 0,
|
|
4888
4866
|
onChannelSelect: () => {
|
|
4889
4867
|
},
|
|
@@ -4891,18 +4869,18 @@ const Bs = V.createContext({
|
|
|
4891
4869
|
renderMessagePreview: void 0,
|
|
4892
4870
|
channelPreview: void 0,
|
|
4893
4871
|
viewerLanguage: void 0
|
|
4894
|
-
}),
|
|
4872
|
+
}), Gi = $s.Provider, Hi = () => V.useContext($s), Yi = (e, t) => {
|
|
4895
4873
|
const n = new Date(
|
|
4896
4874
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4897
4875
|
), r = new Date(
|
|
4898
4876
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4899
4877
|
).getTime() - n.getTime();
|
|
4900
4878
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4901
|
-
},
|
|
4879
|
+
}, qi = (e) => {
|
|
4902
4880
|
const t = /* @__PURE__ */ new Date();
|
|
4903
4881
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4904
4882
|
return "Just now";
|
|
4905
|
-
const a =
|
|
4883
|
+
const a = Yi(e, t);
|
|
4906
4884
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4907
4885
|
hour: "numeric",
|
|
4908
4886
|
minute: "2-digit",
|
|
@@ -4912,9 +4890,9 @@ const Bs = V.createContext({
|
|
|
4912
4890
|
day: "numeric",
|
|
4913
4891
|
year: "2-digit"
|
|
4914
4892
|
});
|
|
4915
|
-
},
|
|
4893
|
+
}, Bs = V.memo(
|
|
4916
4894
|
(e) => {
|
|
4917
|
-
var $, F,
|
|
4895
|
+
var $, F, D;
|
|
4918
4896
|
const { channel: t, unread: n } = e, {
|
|
4919
4897
|
selectedChannel: a,
|
|
4920
4898
|
onChannelSelect: r,
|
|
@@ -4922,7 +4900,7 @@ const Bs = V.createContext({
|
|
|
4922
4900
|
channelPreview: o,
|
|
4923
4901
|
renderMessagePreview: l,
|
|
4924
4902
|
viewerLanguage: d
|
|
4925
|
-
} =
|
|
4903
|
+
} = Hi(), { client: u } = me(), p = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = lt(t);
|
|
4926
4904
|
if (o)
|
|
4927
4905
|
return /* @__PURE__ */ s(
|
|
4928
4906
|
o,
|
|
@@ -4937,22 +4915,22 @@ const Bs = V.createContext({
|
|
|
4937
4915
|
const f = () => {
|
|
4938
4916
|
t && r(t);
|
|
4939
4917
|
}, c = (y) => {
|
|
4940
|
-
const I = y.key === "Enter" || y.key === " ",
|
|
4941
|
-
!I ||
|
|
4918
|
+
const I = y.key === "Enter" || y.key === " ", E = y.repeat;
|
|
4919
|
+
!I || E || (y.preventDefault(), f());
|
|
4942
4920
|
}, v = je(
|
|
4943
4921
|
($ = t == null ? void 0 : t.state) == null ? void 0 : $.members,
|
|
4944
4922
|
u == null ? void 0 : u.userID,
|
|
4945
4923
|
t == null ? void 0 : t.type
|
|
4946
|
-
), w =
|
|
4924
|
+
), w = ot(v == null ? void 0 : v.user), b = (F = v == null ? void 0 : v.user) == null ? void 0 : F.image, g = (() => {
|
|
4947
4925
|
var I;
|
|
4948
4926
|
const y = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
|
|
4949
4927
|
if (y != null && y.length) {
|
|
4950
|
-
for (let
|
|
4951
|
-
if (y[
|
|
4928
|
+
for (let E = y.length - 1; E >= 0; E--)
|
|
4929
|
+
if (y[E].type !== "system") return y[E];
|
|
4952
4930
|
}
|
|
4953
4931
|
})(), N = (() => {
|
|
4954
4932
|
var z, O, j, X;
|
|
4955
|
-
const y =
|
|
4933
|
+
const y = ms({
|
|
4956
4934
|
message: g,
|
|
4957
4935
|
viewerLanguage: d
|
|
4958
4936
|
});
|
|
@@ -4961,14 +4939,14 @@ const Bs = V.createContext({
|
|
|
4961
4939
|
if (((j = g == null ? void 0 : g.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_ATTACHMENT")
|
|
4962
4940
|
return y ? `📎 ${y}` : "📎 Sent an attachment";
|
|
4963
4941
|
if (y) return y;
|
|
4964
|
-
const
|
|
4965
|
-
return
|
|
4966
|
-
})(), C = g != null && g.created_at ?
|
|
4942
|
+
const S = (X = g == null ? void 0 : g.attachments) == null ? void 0 : X[0];
|
|
4943
|
+
return S ? S.og_scrape_url ? S.og_scrape_url : S.type === "image" ? "📷 Sent an image" : S.type === "video" ? "🎥 Sent a video" : S.type === "audio" ? "🎵 Sent audio" : S.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4944
|
+
})(), C = g != null && g.created_at ? qi(new Date(g.created_at)) : "", T = g ? Fe(g) : !1, A = l ? l(g, N) : `${T ? "✨ " : ""}${N}`, L = n ?? 0;
|
|
4967
4945
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4968
4946
|
channelId: t == null ? void 0 : t.id,
|
|
4969
4947
|
isSelected: p,
|
|
4970
4948
|
participantName: w,
|
|
4971
|
-
unreadCount:
|
|
4949
|
+
unreadCount: L,
|
|
4972
4950
|
hasTimestamp: !!C
|
|
4973
4951
|
}), /* @__PURE__ */ s(
|
|
4974
4952
|
"div",
|
|
@@ -4987,9 +4965,9 @@ const Bs = V.createContext({
|
|
|
4987
4965
|
"data-dd-privacy": "mask",
|
|
4988
4966
|
children: /* @__PURE__ */ m("div", { className: "flex items-start gap-4", children: [
|
|
4989
4967
|
/* @__PURE__ */ s(
|
|
4990
|
-
|
|
4968
|
+
se,
|
|
4991
4969
|
{
|
|
4992
|
-
id: ((
|
|
4970
|
+
id: ((D = v == null ? void 0 : v.user) == null ? void 0 : D.id) || t.id || "unknown",
|
|
4993
4971
|
name: w,
|
|
4994
4972
|
image: b,
|
|
4995
4973
|
size: 48,
|
|
@@ -5014,7 +4992,7 @@ const Bs = V.createContext({
|
|
|
5014
4992
|
] }),
|
|
5015
4993
|
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
5016
4994
|
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
|
|
5017
|
-
|
|
4995
|
+
L > 0 && /* @__PURE__ */ s("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: L > 99 ? "99+" : L })
|
|
5018
4996
|
] })
|
|
5019
4997
|
] })
|
|
5020
4998
|
] })
|
|
@@ -5022,28 +5000,28 @@ const Bs = V.createContext({
|
|
|
5022
5000
|
);
|
|
5023
5001
|
}
|
|
5024
5002
|
);
|
|
5025
|
-
|
|
5026
|
-
const
|
|
5003
|
+
Bs.displayName = "CustomChannelPreview";
|
|
5004
|
+
const Wi = { last_message_at: -1 }, Xi = V.memo(
|
|
5027
5005
|
({
|
|
5028
5006
|
onChannelSelect: e,
|
|
5029
5007
|
selectedChannel: t,
|
|
5030
5008
|
filters: n,
|
|
5031
5009
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
5032
5010
|
channelRenderFilterFn: r,
|
|
5033
|
-
sort: i =
|
|
5011
|
+
sort: i = Wi,
|
|
5034
5012
|
className: o,
|
|
5035
5013
|
customEmptyStateIndicator: l,
|
|
5036
|
-
channelListPaginator: d =
|
|
5014
|
+
channelListPaginator: d = In,
|
|
5037
5015
|
channelPreview: u,
|
|
5038
5016
|
renderMessagePreview: p,
|
|
5039
5017
|
viewerLanguage: h
|
|
5040
5018
|
}) => {
|
|
5041
5019
|
const f = V.useRef(0);
|
|
5042
5020
|
f.current++;
|
|
5043
|
-
const { debug: c = !1 } =
|
|
5021
|
+
const { debug: c = !1 } = it(), v = V.useCallback(
|
|
5044
5022
|
(b) => {
|
|
5045
5023
|
for (const g of b)
|
|
5046
|
-
|
|
5024
|
+
Vi(g);
|
|
5047
5025
|
return r ? r(b) : b;
|
|
5048
5026
|
},
|
|
5049
5027
|
[r]
|
|
@@ -5078,8 +5056,8 @@ const Qi = { last_message_at: -1 }, el = V.memo(
|
|
|
5078
5056
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
5079
5057
|
o
|
|
5080
5058
|
),
|
|
5081
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(
|
|
5082
|
-
|
|
5059
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Gi, { value: w, children: /* @__PURE__ */ s(
|
|
5060
|
+
Sn,
|
|
5083
5061
|
{
|
|
5084
5062
|
filters: n,
|
|
5085
5063
|
sort: i,
|
|
@@ -5087,7 +5065,7 @@ const Qi = { last_message_at: -1 }, el = V.memo(
|
|
|
5087
5065
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
5088
5066
|
channelRenderFilterFn: v,
|
|
5089
5067
|
Paginator: d,
|
|
5090
|
-
Preview:
|
|
5068
|
+
Preview: Bs,
|
|
5091
5069
|
EmptyStateIndicator: l
|
|
5092
5070
|
},
|
|
5093
5071
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -5096,8 +5074,8 @@ const Qi = { last_message_at: -1 }, el = V.memo(
|
|
|
5096
5074
|
);
|
|
5097
5075
|
}
|
|
5098
5076
|
);
|
|
5099
|
-
|
|
5100
|
-
const
|
|
5077
|
+
Xi.displayName = "ChannelList";
|
|
5078
|
+
const Ki = ({
|
|
5101
5079
|
question: e,
|
|
5102
5080
|
onClick: t,
|
|
5103
5081
|
loading: n = !1,
|
|
@@ -5119,7 +5097,7 @@ const tl = ({
|
|
|
5119
5097
|
),
|
|
5120
5098
|
children: e
|
|
5121
5099
|
}
|
|
5122
|
-
),
|
|
5100
|
+
), dl = ({
|
|
5123
5101
|
faqs: e,
|
|
5124
5102
|
onFaqClick: t,
|
|
5125
5103
|
loadingFaqId: n,
|
|
@@ -5131,7 +5109,7 @@ const tl = ({
|
|
|
5131
5109
|
const l = e.filter((d) => d.enabled).sort((d, u) => (d.order ?? 0) - (u.order ?? 0));
|
|
5132
5110
|
return l.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ m("div", { className: "flex gap-3 items-end", children: [
|
|
5133
5111
|
(i || o) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
|
|
5134
|
-
|
|
5112
|
+
se,
|
|
5135
5113
|
{
|
|
5136
5114
|
id: o || "account",
|
|
5137
5115
|
name: o || "Account",
|
|
@@ -5148,7 +5126,7 @@ const tl = ({
|
|
|
5148
5126
|
children: [
|
|
5149
5127
|
a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
5150
5128
|
l.map((d) => /* @__PURE__ */ s(
|
|
5151
|
-
|
|
5129
|
+
Ki,
|
|
5152
5130
|
{
|
|
5153
5131
|
question: d.question,
|
|
5154
5132
|
onClick: () => t(d.id),
|
|
@@ -5162,40 +5140,40 @@ const tl = ({
|
|
|
5162
5140
|
] }) });
|
|
5163
5141
|
};
|
|
5164
5142
|
export {
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5143
|
+
ps as A,
|
|
5144
|
+
ol as B,
|
|
5145
|
+
$i as C,
|
|
5146
|
+
Or as D,
|
|
5147
|
+
pa as E,
|
|
5148
|
+
dl as F,
|
|
5149
|
+
Qn as G,
|
|
5150
|
+
Qt as L,
|
|
5151
|
+
il as M,
|
|
5152
|
+
_e as a,
|
|
5153
|
+
se as b,
|
|
5154
|
+
Xi as c,
|
|
5155
|
+
Os as d,
|
|
5156
|
+
ll as e,
|
|
5157
|
+
Ki as f,
|
|
5158
|
+
le as g,
|
|
5159
|
+
Jt as h,
|
|
5160
|
+
Ne as i,
|
|
5161
|
+
Gr as j,
|
|
5162
|
+
rl as k,
|
|
5163
|
+
cl as l,
|
|
5164
|
+
sr as m,
|
|
5165
|
+
Qa as n,
|
|
5166
|
+
qi as o,
|
|
5167
|
+
tr as p,
|
|
5168
|
+
ms as q,
|
|
5191
5169
|
we as r,
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5170
|
+
xs as s,
|
|
5171
|
+
na as t,
|
|
5172
|
+
Ya as u,
|
|
5173
|
+
ba as v,
|
|
5196
5174
|
je as w,
|
|
5197
|
-
|
|
5198
|
-
|
|
5199
|
-
|
|
5175
|
+
mt as x,
|
|
5176
|
+
ht as y,
|
|
5177
|
+
ot as z
|
|
5200
5178
|
};
|
|
5201
|
-
//# sourceMappingURL=index-
|
|
5179
|
+
//# sourceMappingURL=index-C-2O97qw.js.map
|