@linktr.ee/messaging-react 1.40.0 → 1.40.2
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-CuiPAb_A.js → Card-A0lkei-S.js} +2 -2
- package/dist/{Card-CuiPAb_A.js.map → Card-A0lkei-S.js.map} +1 -1
- package/dist/{Card-RBVM8Gy3.js → Card-DXoAKkv0.js} +2 -2
- package/dist/{Card-RBVM8Gy3.js.map → Card-DXoAKkv0.js.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-DY-3-rt4.js → index-B_PLgcDi.js} +2069 -2061
- package/dist/index-B_PLgcDi.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +14 -13
- package/package.json +1 -1
- package/src/components/Avatar/index.tsx +3 -2
- package/src/components/CustomMessage/CustomMessage.stories.tsx +28 -0
- package/src/components/CustomMessage/index.tsx +15 -9
- package/src/components/MediaMessage/index.tsx +5 -3
- package/src/index.ts +1 -0
- package/src/styles.css +2 -5
- package/dist/index-DY-3-rt4.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import D from "classnames";
|
|
3
|
-
import O, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
3
|
+
import O, { createContext as ut, useContext as mt, useCallback as G, useState as A, useRef as K, useEffect as J, useMemo as Se, Suspense as ht } from "react";
|
|
4
|
+
import { StreamChatService as Ft } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Ot, ChannelList as Pt, DateSeparator as Ut, useChannelStateContext as oe, useChatContext as De, areMessageUIPropsEqual as zt, useMessageReminder as Bt, useComponentContext as ft, Attachment as $t, EditMessageModal as jt, MessageBlocked as Gt, MessageBouncePrompt as Vt, MessageDeleted as Ht, MessageIsThreadReplyInChannelButtonIndicator as Yt, MessageRepliesCountButton as Wt, ReminderNotification as qt, StreamedMessageText as Xt, messageHasAttachments as Zt, messageHasReactions as Jt, isDateSeparatorMessage as Kt, isMessageBlocked as Qt, isMessageBounced as es, MessageBounceModal as ts, MessageText as Qe, Poll as ss, MessageErrorIcon as ns, useMessageContext as gt, useMessageComposer as as, useStateStore as rs, MessageInput as is, useMessageInputContext as os, useMessageComposerHasSendableData as ls, SimpleAttachmentSelector as cs, QuotedMessagePreview as ds, AttachmentPreviewList as us, TextareaComposer as ms, MessageTimestamp as _e, useTypingContext as hs, Channel as fs, WithComponents as gs, Window as bs, MessageList as ps } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ie, GiftIcon as xs, XIcon as bt, SpinnerGapIcon as ye, SignOutIcon as vs, ProhibitInsetIcon as et, FlagIcon as ws, FileIcon as pt, ImageIcon as _s, SpeakerHighIcon as ys, VideoCameraIcon as Ns, FileMdIcon as Cs, FileTextIcon as Es, FileZipIcon as Ss, FilePptIcon as Is, FileCsvIcon as ks, FileXlsIcon as Ms, FileDocIcon as Ts, FilePdfIcon as Ds, CircleNotchIcon as xt, PlayIcon as tt, PauseIcon as Rs, LinkIcon as Ls, DownloadSimpleIcon as As, ThumbsUpIcon as Fs, ThumbsDownIcon as Os, ArrowUpIcon as Ps, SparkleIcon as ke, ProhibitIcon as Us, ArrowLeftIcon as st, CaretRightIcon as nt, DotsThreeIcon as at } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as rt } from "stream-chat";
|
|
8
|
+
const vt = ut({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const gt = ot({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
18
|
+
}), Re = () => mt(vt), da = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -35,12 +35,12 @@ const gt = ot({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(o)
|
|
37
37
|
});
|
|
38
|
-
const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, N] = A(!1), [b, C] = A(null), x =
|
|
38
|
+
const [c, m] = A(null), [u, h] = A(null), [f, v] = A(!1), [a, N] = A(!1), [b, C] = A(null), x = K(!1), I = K({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: o
|
|
43
|
-
}), w =
|
|
43
|
+
}), w = K(0);
|
|
44
44
|
w.current++, i("📊 RENDER INFO", {
|
|
45
45
|
renderCount: w.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
@@ -55,7 +55,7 @@ const gt = ot({
|
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: o
|
|
58
|
-
},
|
|
58
|
+
}, J(() => {
|
|
59
59
|
const k = w.current;
|
|
60
60
|
if (i("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: k,
|
|
@@ -79,7 +79,7 @@ const gt = ot({
|
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: I.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const T = new
|
|
82
|
+
const T = new Ft({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
85
|
debug: l
|
|
@@ -94,8 +94,8 @@ const gt = ot({
|
|
|
94
94
|
}), T.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [r, n, l, i]);
|
|
97
|
-
const E =
|
|
98
|
-
|
|
97
|
+
const E = K(null);
|
|
98
|
+
J(() => {
|
|
99
99
|
var T, M;
|
|
100
100
|
if (i("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
@@ -141,7 +141,7 @@ const gt = ot({
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, i, f]),
|
|
144
|
+
}, [c, s, i, f]), J(() => (i("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
146
|
isConnected: f
|
|
147
147
|
}), () => {
|
|
@@ -206,8 +206,8 @@ const gt = ot({
|
|
|
206
206
|
renderCount: w.current,
|
|
207
207
|
willRenderChat: !!(u && f),
|
|
208
208
|
contextValueReady: !!U
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e(vt.Provider, { value: U, children: u && f ? /* @__PURE__ */ e(
|
|
210
|
+
Ot,
|
|
211
211
|
{
|
|
212
212
|
client: u,
|
|
213
213
|
customClasses: {
|
|
@@ -216,25 +216,25 @@ const gt = ot({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
220
|
-
function
|
|
219
|
+
}, zs = () => Re();
|
|
220
|
+
function Bs(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
224
224
|
t.state.addMessageSorted(n.message);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const wt = O.createContext({
|
|
227
227
|
selectedChannel: void 0,
|
|
228
228
|
onChannelSelect: () => {
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
232
|
+
}), $s = wt.Provider, js = () => O.useContext(wt), _t = (t) => {
|
|
233
233
|
var r, o;
|
|
234
234
|
const [s, n] = A(
|
|
235
235
|
!!((o = (r = t == null ? void 0 : t.state) == null ? void 0 : r.membership) != null && o.pinned_at)
|
|
236
236
|
);
|
|
237
|
-
return
|
|
237
|
+
return J(() => {
|
|
238
238
|
var i;
|
|
239
239
|
if (!t) {
|
|
240
240
|
n(!1);
|
|
@@ -251,18 +251,18 @@ const bt = O.createContext({
|
|
|
251
251
|
t.off("member.updated", l);
|
|
252
252
|
};
|
|
253
253
|
}, [t]), s;
|
|
254
|
-
},
|
|
254
|
+
}, Gs = (t, s) => {
|
|
255
255
|
const n = new Date(
|
|
256
256
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
257
|
), o = new Date(
|
|
258
258
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
259
|
).getTime() - n.getTime();
|
|
260
260
|
return Math.floor(o / (1e3 * 60 * 60 * 24));
|
|
261
|
-
},
|
|
261
|
+
}, Vs = (t) => {
|
|
262
262
|
const s = /* @__PURE__ */ new Date();
|
|
263
263
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
264
|
return "Just now";
|
|
265
|
-
const r =
|
|
265
|
+
const r = Gs(t, s);
|
|
266
266
|
return r === 0 ? t.toLocaleTimeString([], {
|
|
267
267
|
hour: "numeric",
|
|
268
268
|
minute: "2-digit",
|
|
@@ -272,7 +272,7 @@ const bt = O.createContext({
|
|
|
272
272
|
day: "numeric",
|
|
273
273
|
year: "2-digit"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, it = [
|
|
276
276
|
"🍎",
|
|
277
277
|
// Apple
|
|
278
278
|
"🍌",
|
|
@@ -300,7 +300,7 @@ const bt = O.createContext({
|
|
|
300
300
|
"🍈"
|
|
301
301
|
// Melon
|
|
302
302
|
];
|
|
303
|
-
function
|
|
303
|
+
function Hs(t) {
|
|
304
304
|
let s = 0;
|
|
305
305
|
for (let n = 0; n < t.length; n++) {
|
|
306
306
|
const r = t.charCodeAt(n);
|
|
@@ -308,9 +308,9 @@ function Bs(t) {
|
|
|
308
308
|
}
|
|
309
309
|
return Math.abs(s);
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const n =
|
|
313
|
-
return
|
|
311
|
+
function Ys(t) {
|
|
312
|
+
const n = Hs(t) % it.length;
|
|
313
|
+
return it[n];
|
|
314
314
|
}
|
|
315
315
|
const ne = ({
|
|
316
316
|
id: t,
|
|
@@ -321,7 +321,7 @@ const ne = ({
|
|
|
321
321
|
shape: l = "squircle",
|
|
322
322
|
dmAgentEnabled: i = !1
|
|
323
323
|
}) => {
|
|
324
|
-
const c =
|
|
324
|
+
const c = Ys(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = n >= 40 ? 2 : 1, f = l === "circle" ? { borderRadius: "50%" } : {
|
|
325
325
|
borderRadius: "33%",
|
|
326
326
|
cornerShape: "superellipse(1.3)"
|
|
327
327
|
}, v = /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: f, children: s ? /* @__PURE__ */ e(
|
|
@@ -329,7 +329,7 @@ const ne = ({
|
|
|
329
329
|
{
|
|
330
330
|
src: s,
|
|
331
331
|
alt: "",
|
|
332
|
-
className: "
|
|
332
|
+
className: "h-full w-full object-cover"
|
|
333
333
|
}
|
|
334
334
|
) : /* @__PURE__ */ e(
|
|
335
335
|
"div",
|
|
@@ -350,6 +350,7 @@ const ne = ({
|
|
|
350
350
|
r
|
|
351
351
|
),
|
|
352
352
|
style: {
|
|
353
|
+
"--str-chat__avatar-size": `${n}px`,
|
|
353
354
|
width: `${n}px`,
|
|
354
355
|
height: `${n}px`
|
|
355
356
|
},
|
|
@@ -359,7 +360,7 @@ const ne = ({
|
|
|
359
360
|
{
|
|
360
361
|
"aria-hidden": "true",
|
|
361
362
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
362
|
-
children: /* @__PURE__ */ e(
|
|
363
|
+
children: /* @__PURE__ */ e(Ie, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
363
364
|
}
|
|
364
365
|
),
|
|
365
366
|
/* @__PURE__ */ e(
|
|
@@ -385,7 +386,7 @@ const ne = ({
|
|
|
385
386
|
]
|
|
386
387
|
}
|
|
387
388
|
);
|
|
388
|
-
},
|
|
389
|
+
}, Ws = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
389
390
|
"svg",
|
|
390
391
|
{
|
|
391
392
|
width: t,
|
|
@@ -402,29 +403,29 @@ const ne = ({
|
|
|
402
403
|
}
|
|
403
404
|
)
|
|
404
405
|
}
|
|
405
|
-
),
|
|
406
|
+
), qs = (t) => {
|
|
406
407
|
var s;
|
|
407
408
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
408
|
-
},
|
|
409
|
+
}, Xs = (t) => {
|
|
409
410
|
var s;
|
|
410
411
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
411
|
-
},
|
|
412
|
+
}, ge = (t) => {
|
|
412
413
|
var s;
|
|
413
414
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
414
|
-
},
|
|
415
|
+
}, Zs = (t) => {
|
|
415
416
|
var s;
|
|
416
417
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
417
|
-
},
|
|
418
|
+
}, yt = (t) => qs(t) || Xs(t), Js = (t) => {
|
|
418
419
|
var s;
|
|
419
|
-
return
|
|
420
|
-
},
|
|
420
|
+
return yt(t) && !((s = t.text) != null && s.trim());
|
|
421
|
+
}, Ne = ({
|
|
421
422
|
message: t,
|
|
422
423
|
standalone: s = !1,
|
|
423
424
|
isMyMessage: n = !1,
|
|
424
425
|
hasAttachment: r = !1
|
|
425
426
|
}) => {
|
|
426
427
|
var f;
|
|
427
|
-
const o =
|
|
428
|
+
const o = yt(t), l = ge(t);
|
|
428
429
|
if (!o && !l)
|
|
429
430
|
return null;
|
|
430
431
|
if (o) {
|
|
@@ -432,7 +433,7 @@ const ne = ({
|
|
|
432
433
|
if (!v) return null;
|
|
433
434
|
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", N = s ? `${v} tip` : `Delivered with ${v} tip`;
|
|
434
435
|
return /* @__PURE__ */ d("div", { className: a, children: [
|
|
435
|
-
/* @__PURE__ */ e(
|
|
436
|
+
/* @__PURE__ */ e(xs, { size: s ? 14 : 12 }),
|
|
436
437
|
/* @__PURE__ */ e("span", { children: N })
|
|
437
438
|
] });
|
|
438
439
|
}
|
|
@@ -440,7 +441,7 @@ const ne = ({
|
|
|
440
441
|
"message-chatbot-indicator",
|
|
441
442
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
442
443
|
i ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
443
|
-
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(
|
|
444
|
+
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(Ws, { size: i ? 12 : 15 }) });
|
|
444
445
|
return /* @__PURE__ */ e("div", { className: m, "data-testid": "message-chatbot-indicator", children: n && !i ? /* @__PURE__ */ d(ce, { children: [
|
|
445
446
|
u,
|
|
446
447
|
h
|
|
@@ -448,10 +449,10 @@ const ne = ({
|
|
|
448
449
|
h,
|
|
449
450
|
u
|
|
450
451
|
] }) });
|
|
451
|
-
},
|
|
452
|
+
}, Nt = O.memo(
|
|
452
453
|
({ channel: t, unread: s }) => {
|
|
453
454
|
var P, U, k, T;
|
|
454
|
-
const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } =
|
|
455
|
+
const { selectedChannel: n, onChannelSelect: r, debug: o, renderMessagePreview: l } = js(), i = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
455
456
|
t && r(t);
|
|
456
457
|
}, m = (M) => {
|
|
457
458
|
const y = M.key === "Enter" || M.key === " ", _ = M.repeat;
|
|
@@ -474,7 +475,7 @@ const ne = ({
|
|
|
474
475
|
if (((_ = a == null ? void 0 : a.metadata) == null ? void 0 : _.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
475
476
|
const y = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
|
|
476
477
|
return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
477
|
-
})(), C = a != null && a.created_at ?
|
|
478
|
+
})(), C = a != null && a.created_at ? Vs(new Date(a.created_at)) : "", x = a ? ge(a) : !1, I = l ? l(a, b) : `${x ? "✨ " : ""}${b}`, w = _t(t), E = s ?? 0;
|
|
478
479
|
return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
479
480
|
channelId: t == null ? void 0 : t.id,
|
|
480
481
|
isSelected: i,
|
|
@@ -534,8 +535,8 @@ const ne = ({
|
|
|
534
535
|
);
|
|
535
536
|
}
|
|
536
537
|
);
|
|
537
|
-
|
|
538
|
-
const
|
|
538
|
+
Nt.displayName = "CustomChannelPreview";
|
|
539
|
+
const Ks = { last_message_at: -1 }, Ct = O.memo(
|
|
539
540
|
({
|
|
540
541
|
onChannelSelect: t,
|
|
541
542
|
selectedChannel: s,
|
|
@@ -544,17 +545,17 @@ const qs = { last_message_at: -1 }, wt = O.memo(
|
|
|
544
545
|
onMessageNew: o,
|
|
545
546
|
onAddedToChannel: l,
|
|
546
547
|
channelRenderFilterFn: i,
|
|
547
|
-
sort: c =
|
|
548
|
+
sort: c = Ks,
|
|
548
549
|
className: m,
|
|
549
550
|
customEmptyStateIndicator: u,
|
|
550
551
|
renderMessagePreview: h
|
|
551
552
|
}) => {
|
|
552
553
|
const f = O.useRef(0);
|
|
553
554
|
f.current++;
|
|
554
|
-
const { debug: v = !1 } =
|
|
555
|
+
const { debug: v = !1 } = Re(), a = O.useCallback(
|
|
555
556
|
(b) => {
|
|
556
557
|
for (const C of b)
|
|
557
|
-
|
|
558
|
+
Bs(C);
|
|
558
559
|
return i ? i(b) : b;
|
|
559
560
|
},
|
|
560
561
|
[i]
|
|
@@ -580,8 +581,8 @@ const qs = { last_message_at: -1 }, wt = O.memo(
|
|
|
580
581
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
581
582
|
m
|
|
582
583
|
),
|
|
583
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
584
|
-
|
|
584
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e($s, { value: N, children: /* @__PURE__ */ e(
|
|
585
|
+
Pt,
|
|
585
586
|
{
|
|
586
587
|
filters: n,
|
|
587
588
|
sort: c,
|
|
@@ -590,7 +591,7 @@ const qs = { last_message_at: -1 }, wt = O.memo(
|
|
|
590
591
|
onMessageNew: o,
|
|
591
592
|
onAddedToChannel: l,
|
|
592
593
|
channelRenderFilterFn: a,
|
|
593
|
-
Preview:
|
|
594
|
+
Preview: Nt,
|
|
594
595
|
EmptyStateIndicator: u
|
|
595
596
|
},
|
|
596
597
|
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
@@ -599,8 +600,8 @@ const qs = { last_message_at: -1 }, wt = O.memo(
|
|
|
599
600
|
);
|
|
600
601
|
}
|
|
601
602
|
);
|
|
602
|
-
|
|
603
|
-
const
|
|
603
|
+
Ct.displayName = "ChannelList";
|
|
604
|
+
const he = ({
|
|
604
605
|
variant: t = "default",
|
|
605
606
|
className: s,
|
|
606
607
|
children: n,
|
|
@@ -618,7 +619,7 @@ const me = ({
|
|
|
618
619
|
children: n
|
|
619
620
|
}
|
|
620
621
|
);
|
|
621
|
-
function
|
|
622
|
+
function Qs({ label: t, className: s, children: n, ...r }) {
|
|
622
623
|
return /* @__PURE__ */ d(
|
|
623
624
|
"button",
|
|
624
625
|
{
|
|
@@ -639,10 +640,10 @@ function Ws({ label: t, className: s, children: n, ...r }) {
|
|
|
639
640
|
}
|
|
640
641
|
);
|
|
641
642
|
}
|
|
642
|
-
function
|
|
643
|
-
return /* @__PURE__ */ e(
|
|
643
|
+
function en({ onClick: t }) {
|
|
644
|
+
return /* @__PURE__ */ e(Qs, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(bt, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
644
645
|
}
|
|
645
|
-
const
|
|
646
|
+
const tn = ({
|
|
646
647
|
dialogRef: t,
|
|
647
648
|
onClose: s,
|
|
648
649
|
participant: n,
|
|
@@ -657,8 +658,8 @@ const Zs = ({
|
|
|
657
658
|
customProfileContent: f,
|
|
658
659
|
customChannelActions: v
|
|
659
660
|
}) => {
|
|
660
|
-
var S, $, V, ee, te,
|
|
661
|
-
const { service: a, debug: N } =
|
|
661
|
+
var S, $, V, ee, te, W, g;
|
|
662
|
+
const { service: a, debug: N } = Re(), [b, C] = A(!1), [x, I] = A(!1), [w, E] = A(!1), P = G(async () => {
|
|
662
663
|
var p;
|
|
663
664
|
if (!(!a || !((p = n == null ? void 0 : n.user) != null && p.id)))
|
|
664
665
|
try {
|
|
@@ -676,7 +677,7 @@ const Zs = ({
|
|
|
676
677
|
);
|
|
677
678
|
}
|
|
678
679
|
}, [a, (S = n == null ? void 0 : n.user) == null ? void 0 : S.id]);
|
|
679
|
-
|
|
680
|
+
J(() => {
|
|
680
681
|
P();
|
|
681
682
|
}, [P]);
|
|
682
683
|
const U = async () => {
|
|
@@ -724,7 +725,7 @@ const Zs = ({
|
|
|
724
725
|
);
|
|
725
726
|
};
|
|
726
727
|
if (!n) return null;
|
|
727
|
-
const y = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", _ = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (
|
|
728
|
+
const y = (($ = n.user) == null ? void 0 : $.name) || ((V = n.user) == null ? void 0 : V.id) || "Unknown member", _ = (ee = n.user) == null ? void 0 : ee.image, F = (te = n.user) == null ? void 0 : te.email, H = (W = n.user) == null ? void 0 : W.username, R = F || (H ? `linktr.ee/${H}` : void 0), z = ((g = n.user) == null ? void 0 : g.id) || "unknown";
|
|
728
729
|
return (
|
|
729
730
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
730
731
|
/* @__PURE__ */ e(
|
|
@@ -739,7 +740,7 @@ const Zs = ({
|
|
|
739
740
|
children: /* @__PURE__ */ d("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
740
741
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
741
742
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
742
|
-
/* @__PURE__ */ e(
|
|
743
|
+
/* @__PURE__ */ e(en, { onClick: s })
|
|
743
744
|
] }),
|
|
744
745
|
/* @__PURE__ */ d("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
745
746
|
/* @__PURE__ */ d(
|
|
@@ -784,42 +785,42 @@ const Zs = ({
|
|
|
784
785
|
),
|
|
785
786
|
/* @__PURE__ */ d("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
786
787
|
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
787
|
-
|
|
788
|
+
he,
|
|
788
789
|
{
|
|
789
790
|
onClick: U,
|
|
790
791
|
disabled: x,
|
|
791
792
|
"aria-busy": x,
|
|
792
793
|
children: [
|
|
793
|
-
x ? /* @__PURE__ */ e(
|
|
794
|
+
x ? /* @__PURE__ */ e(ye, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(vs, { className: "h-5 w-5" }),
|
|
794
795
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
795
796
|
]
|
|
796
797
|
}
|
|
797
798
|
) }),
|
|
798
799
|
/* @__PURE__ */ e("li", { children: b ? /* @__PURE__ */ d(
|
|
799
|
-
|
|
800
|
+
he,
|
|
800
801
|
{
|
|
801
802
|
onClick: T,
|
|
802
803
|
disabled: w,
|
|
803
804
|
"aria-busy": w,
|
|
804
805
|
children: [
|
|
805
|
-
w ? /* @__PURE__ */ e(
|
|
806
|
+
w ? /* @__PURE__ */ e(ye, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-5 w-5" }),
|
|
806
807
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
807
808
|
]
|
|
808
809
|
}
|
|
809
810
|
) : /* @__PURE__ */ d(
|
|
810
|
-
|
|
811
|
+
he,
|
|
811
812
|
{
|
|
812
813
|
onClick: k,
|
|
813
814
|
disabled: w,
|
|
814
815
|
"aria-busy": w,
|
|
815
816
|
children: [
|
|
816
|
-
w ? /* @__PURE__ */ e(
|
|
817
|
+
w ? /* @__PURE__ */ e(ye, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(et, { className: "h-5 w-5" }),
|
|
817
818
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
818
819
|
]
|
|
819
820
|
}
|
|
820
821
|
) }),
|
|
821
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
822
|
-
/* @__PURE__ */ e(
|
|
822
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(he, { variant: "danger", onClick: M, children: [
|
|
823
|
+
/* @__PURE__ */ e(ws, { className: "h-5 w-5" }),
|
|
823
824
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
824
825
|
] }) }),
|
|
825
826
|
v
|
|
@@ -829,20 +830,20 @@ const Zs = ({
|
|
|
829
830
|
}
|
|
830
831
|
)
|
|
831
832
|
);
|
|
832
|
-
},
|
|
833
|
-
function
|
|
834
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
833
|
+
}, sn = (t) => /* @__PURE__ */ e(Ut, { ...t, position: "center" }), Me = "vote_up", Te = "vote_down";
|
|
834
|
+
function nn(t) {
|
|
835
|
+
return t != null && t.length ? t.some((s) => s.type === Te) ? "down" : t.some((s) => s.type === Me) ? "up" : null : null;
|
|
835
836
|
}
|
|
836
|
-
function
|
|
837
|
-
const { channel: s } = oe(), { client: n } =
|
|
838
|
-
() =>
|
|
837
|
+
function an(t) {
|
|
838
|
+
const { channel: s } = oe(), { client: n } = De("useMessageVote"), r = Se(
|
|
839
|
+
() => nn(t.own_reactions),
|
|
839
840
|
[t.own_reactions]
|
|
840
841
|
), o = G(async () => {
|
|
841
842
|
if (n != null && n.userID)
|
|
842
843
|
try {
|
|
843
|
-
r === "up" ? await s.deleteReaction(t.id,
|
|
844
|
+
r === "up" ? await s.deleteReaction(t.id, Me) : await s.sendReaction(
|
|
844
845
|
t.id,
|
|
845
|
-
{ type:
|
|
846
|
+
{ type: Me },
|
|
846
847
|
{ enforce_unique: !0, skip_push: !0 }
|
|
847
848
|
);
|
|
848
849
|
} catch {
|
|
@@ -850,9 +851,9 @@ function Qs(t) {
|
|
|
850
851
|
}, [s, n == null ? void 0 : n.userID, t.id, r]), l = G(async () => {
|
|
851
852
|
if (n != null && n.userID)
|
|
852
853
|
try {
|
|
853
|
-
r === "down" ? await s.deleteReaction(t.id,
|
|
854
|
+
r === "down" ? await s.deleteReaction(t.id, Te) : await s.sendReaction(
|
|
854
855
|
t.id,
|
|
855
|
-
{ type:
|
|
856
|
+
{ type: Te },
|
|
856
857
|
{ enforce_unique: !0, skip_push: !0 }
|
|
857
858
|
);
|
|
858
859
|
} catch {
|
|
@@ -860,2127 +861,2134 @@ function Qs(t) {
|
|
|
860
861
|
}, [s, n == null ? void 0 : n.userID, t.id, r]);
|
|
861
862
|
return { selected: r, voteUp: o, voteDown: l };
|
|
862
863
|
}
|
|
863
|
-
const
|
|
864
|
+
const rn = O.lazy(() => import("./Card-A0lkei-S.js")), on = O.lazy(() => import("./Card-DXoAKkv0.js")), Et = () => /* @__PURE__ */ e(
|
|
864
865
|
"div",
|
|
865
866
|
{
|
|
866
867
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
867
868
|
"aria-hidden": !0
|
|
868
869
|
}
|
|
869
|
-
),
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
870
|
+
), ln = (t) => /* @__PURE__ */ e(ht, { fallback: /* @__PURE__ */ e(Et, {}), children: /* @__PURE__ */ e(rn, { ...t }) }), cn = (t) => /* @__PURE__ */ e(ht, { fallback: /* @__PURE__ */ e(Et, {}), children: /* @__PURE__ */ e(on, { ...t }) }), ot = { Creator: ln, Visitor: cn }, dn = [
|
|
871
|
+
[/pdf/, "pdf"],
|
|
872
|
+
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
873
|
+
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
874
|
+
[/csv/, "csv"],
|
|
875
|
+
[/presentationml|ms-powerpoint|\.ppt/, "ppt"],
|
|
876
|
+
[/zip|x-rar|x-7z|x-tar|x-gzip/, "zip"],
|
|
877
|
+
[/plain|rtf/, "text"],
|
|
878
|
+
[/markdown/, "markdown"]
|
|
879
|
+
];
|
|
880
|
+
function xe(t) {
|
|
881
|
+
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
876
882
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
onVoteDown: n
|
|
881
|
-
}) => /* @__PURE__ */ d("div", { className: "message-vote-buttons", children: [
|
|
882
|
-
/* @__PURE__ */ e(
|
|
883
|
-
"button",
|
|
884
|
-
{
|
|
885
|
-
type: "button",
|
|
886
|
-
className: D("message-vote-button focus-ring", {
|
|
887
|
-
"message-vote-button--selected": t === "up"
|
|
888
|
-
}),
|
|
889
|
-
onClick: s,
|
|
890
|
-
"aria-label": "Good response",
|
|
891
|
-
"aria-pressed": t === "up",
|
|
892
|
-
"data-tooltip": "Good response",
|
|
893
|
-
children: /* @__PURE__ */ e(bs, { size: 16, weight: t === "up" ? "fill" : "regular" })
|
|
894
|
-
}
|
|
895
|
-
),
|
|
896
|
-
/* @__PURE__ */ e(
|
|
897
|
-
"button",
|
|
898
|
-
{
|
|
899
|
-
type: "button",
|
|
900
|
-
className: D("message-vote-button focus-ring", {
|
|
901
|
-
"message-vote-button--selected": t === "down"
|
|
902
|
-
}),
|
|
903
|
-
onClick: n,
|
|
904
|
-
"aria-label": "Bad response",
|
|
905
|
-
"aria-pressed": t === "down",
|
|
906
|
-
"data-tooltip": "Bad response",
|
|
907
|
-
children: /* @__PURE__ */ e(ps, { size: 16, weight: t === "down" ? "fill" : "regular" })
|
|
908
|
-
}
|
|
909
|
-
)
|
|
910
|
-
] }), cn = (t) => {
|
|
911
|
-
var se, Oe, Pe, Ue, ze, Be, $e, je, Ge, Ve, He, Ye, qe, We;
|
|
912
|
-
const {
|
|
913
|
-
additionalMessageInputProps: s,
|
|
914
|
-
chatbotVotingEnabled: n,
|
|
915
|
-
editing: r,
|
|
916
|
-
endOfGroup: o,
|
|
917
|
-
firstOfGroup: l,
|
|
918
|
-
groupedByUser: i,
|
|
919
|
-
handleAction: c,
|
|
920
|
-
handleOpenThread: m,
|
|
921
|
-
handleRetry: u,
|
|
922
|
-
highlighted: h,
|
|
923
|
-
isMessageAIGenerated: f,
|
|
924
|
-
isMyMessage: v,
|
|
925
|
-
message: a,
|
|
926
|
-
renderText: N,
|
|
927
|
-
threadList: b
|
|
928
|
-
} = t, { client: C } = Me("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = on("LockedAttachment"), [U, k] = A(!1), T = Ft(a.id), { selected: M, voteUp: y, voteDown: _ } = Qs(a), {
|
|
929
|
-
Attachment: F = Ot,
|
|
930
|
-
EditMessageModal: H = Pt,
|
|
931
|
-
MessageBlocked: R = Ut,
|
|
932
|
-
MessageBouncePrompt: z = zt,
|
|
933
|
-
MessageDeleted: S = Bt,
|
|
934
|
-
MessageIsThreadReplyInChannelButtonIndicator: $ = $t,
|
|
935
|
-
MessageRepliesCountButton: V = jt,
|
|
936
|
-
ReminderNotification: ee = Gt,
|
|
937
|
-
StreamedMessageText: te = Vt,
|
|
938
|
-
PinIndicator: q
|
|
939
|
-
} = dt("CustomMessage"), g = Ht(a), p = Yt(a), L = Ce(
|
|
940
|
-
() => f == null ? void 0 : f(a),
|
|
941
|
-
[f, a]
|
|
942
|
-
), j = Ce(
|
|
943
|
-
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
944
|
-
[a]
|
|
883
|
+
function un(t) {
|
|
884
|
+
const s = dn.find(
|
|
885
|
+
([n]) => n.test(t)
|
|
945
886
|
);
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
return
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
open: U
|
|
986
|
-
}
|
|
987
|
-
),
|
|
988
|
-
/* @__PURE__ */ d("div", { className: pe, children: [
|
|
989
|
-
q && /* @__PURE__ */ e(q, {}),
|
|
990
|
-
!!T && /* @__PURE__ */ e(ee, { reminder: T }),
|
|
991
|
-
a.user && /* @__PURE__ */ e(
|
|
992
|
-
ne,
|
|
993
|
-
{
|
|
994
|
-
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
995
|
-
id: a.user.id,
|
|
996
|
-
image: a.user.image,
|
|
997
|
-
name: a.user.name || a.user.id
|
|
998
|
-
}
|
|
999
|
-
),
|
|
1000
|
-
/* @__PURE__ */ e(
|
|
1001
|
-
"div",
|
|
1002
|
-
{
|
|
1003
|
-
className: D("str-chat__message-inner", {
|
|
1004
|
-
"str-chat__simple-message--error-failed": de || re
|
|
1005
|
-
}),
|
|
1006
|
-
"data-testid": "message-inner",
|
|
1007
|
-
onClick: W,
|
|
1008
|
-
onKeyDown: W,
|
|
1009
|
-
role: W ? "button" : void 0,
|
|
1010
|
-
tabIndex: W ? 0 : void 0,
|
|
1011
|
-
style: {
|
|
1012
|
-
// Force margins to 0 to prevent hover layout shift
|
|
1013
|
-
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1014
|
-
marginInlineEnd: 0,
|
|
1015
|
-
marginInlineStart: 0
|
|
1016
|
-
},
|
|
1017
|
-
children: B ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1018
|
-
ie ? /* @__PURE__ */ e(
|
|
1019
|
-
nt.Creator,
|
|
1020
|
-
{
|
|
1021
|
-
title: (Pe = a.metadata) == null ? void 0 : Pe.attachment_title,
|
|
1022
|
-
mimeType: (Ue = a.metadata) == null ? void 0 : Ue.attachment_mime_type,
|
|
1023
|
-
thumbnailUrl: (ze = a.metadata) == null ? void 0 : ze.attachment_thumbnail,
|
|
1024
|
-
amountText: (Be = a.metadata) == null ? void 0 : Be.amount_text,
|
|
1025
|
-
detail: ($e = a.metadata) == null ? void 0 : $e.attachment_detail,
|
|
1026
|
-
paymentStatus: (je = a.metadata) == null ? void 0 : je.payment_status,
|
|
1027
|
-
isUnlocking: I(a.id),
|
|
1028
|
-
onPreviewClick: () => w == null ? void 0 : w(a, x),
|
|
1029
|
-
onFetchSource: async () => await (E == null ? void 0 : E(a, x))
|
|
1030
|
-
}
|
|
1031
|
-
) : /* @__PURE__ */ e(
|
|
1032
|
-
nt.Visitor,
|
|
1033
|
-
{
|
|
1034
|
-
title: (Ge = a.metadata) == null ? void 0 : Ge.attachment_title,
|
|
1035
|
-
mimeType: (Ve = a.metadata) == null ? void 0 : Ve.attachment_mime_type,
|
|
1036
|
-
thumbnailUrl: (He = a.metadata) == null ? void 0 : He.attachment_thumbnail,
|
|
1037
|
-
amountText: (Ye = a.metadata) == null ? void 0 : Ye.amount_text,
|
|
1038
|
-
detail: (qe = a.metadata) == null ? void 0 : qe.attachment_detail,
|
|
1039
|
-
paymentStatus: (We = a.metadata) == null ? void 0 : We.payment_status,
|
|
1040
|
-
isUnlocking: I(a.id),
|
|
1041
|
-
onUnlockClick: () => w == null ? void 0 : w(a, x),
|
|
1042
|
-
onFetchSource: async () => await (E == null ? void 0 : E(a, x)),
|
|
1043
|
-
onDownloadClick: () => P == null ? void 0 : P(a, x)
|
|
1044
|
-
}
|
|
1045
|
-
),
|
|
1046
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Xe, { message: a, renderText: N }) })
|
|
1047
|
-
] }) : xe ? (
|
|
1048
|
-
/* Tip-only messages render as a standalone bubble */
|
|
1049
|
-
/* @__PURE__ */ e(_e, { message: a, standalone: !0 })
|
|
1050
|
-
) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1051
|
-
/* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
|
|
1052
|
-
K && !Q && /* @__PURE__ */ e(
|
|
1053
|
-
_e,
|
|
1054
|
-
{
|
|
1055
|
-
message: a,
|
|
1056
|
-
hasAttachment: X,
|
|
1057
|
-
isMyMessage: ie
|
|
1058
|
-
}
|
|
1059
|
-
),
|
|
1060
|
-
ue && /* @__PURE__ */ e(Jt, { poll: ue }),
|
|
1061
|
-
j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1062
|
-
F,
|
|
1063
|
-
{
|
|
1064
|
-
actionHandler: c,
|
|
1065
|
-
attachments: j
|
|
1066
|
-
}
|
|
1067
|
-
) : null,
|
|
1068
|
-
L ? /* @__PURE__ */ e(
|
|
1069
|
-
te,
|
|
1070
|
-
{
|
|
1071
|
-
message: a,
|
|
1072
|
-
renderText: N
|
|
1073
|
-
}
|
|
1074
|
-
) : /* @__PURE__ */ e(Xe, { message: a, renderText: N }),
|
|
1075
|
-
/* @__PURE__ */ e(Kt, {})
|
|
1076
|
-
] }),
|
|
1077
|
-
(!K || Q) && /* @__PURE__ */ e(
|
|
1078
|
-
_e,
|
|
1079
|
-
{
|
|
1080
|
-
message: a,
|
|
1081
|
-
hasAttachment: X,
|
|
1082
|
-
isMyMessage: ie
|
|
1083
|
-
}
|
|
1084
|
-
),
|
|
1085
|
-
n && K && /* @__PURE__ */ e(
|
|
1086
|
-
ln,
|
|
1087
|
-
{
|
|
1088
|
-
selected: M,
|
|
1089
|
-
onVoteUp: y,
|
|
1090
|
-
onVoteDown: _
|
|
1091
|
-
}
|
|
1092
|
-
)
|
|
1093
|
-
] })
|
|
1094
|
-
}
|
|
1095
|
-
),
|
|
1096
|
-
Y && /* @__PURE__ */ e(
|
|
1097
|
-
V,
|
|
1098
|
-
{
|
|
1099
|
-
onClick: m,
|
|
1100
|
-
reply_count: a.reply_count
|
|
1101
|
-
}
|
|
1102
|
-
),
|
|
1103
|
-
ae && /* @__PURE__ */ e($, {})
|
|
1104
|
-
] }, a.id)
|
|
1105
|
-
] });
|
|
1106
|
-
}, dn = O.memo(
|
|
1107
|
-
cn,
|
|
1108
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : At(t, s)
|
|
1109
|
-
), un = (t) => {
|
|
1110
|
-
const s = ut("CustomMessage");
|
|
1111
|
-
return /* @__PURE__ */ e(dn, { ...s, ...t });
|
|
1112
|
-
}, mn = (t) => ({
|
|
1113
|
-
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1114
|
-
(s) => tt.previewIsLoaded(s) || tt.previewIsLoading(s)
|
|
1115
|
-
)
|
|
1116
|
-
}), hn = ({
|
|
1117
|
-
link: t,
|
|
1118
|
-
onDismiss: s
|
|
887
|
+
return s ? s[1] : "generic";
|
|
888
|
+
}
|
|
889
|
+
const mn = {
|
|
890
|
+
video: Ns,
|
|
891
|
+
audio: ys,
|
|
892
|
+
image: _s,
|
|
893
|
+
document: pt
|
|
894
|
+
}, hn = {
|
|
895
|
+
pdf: Ds,
|
|
896
|
+
doc: Ts,
|
|
897
|
+
xls: Ms,
|
|
898
|
+
csv: ks,
|
|
899
|
+
ppt: Is,
|
|
900
|
+
zip: Ss,
|
|
901
|
+
text: Es,
|
|
902
|
+
markdown: Cs,
|
|
903
|
+
generic: pt
|
|
904
|
+
};
|
|
905
|
+
function fn(t) {
|
|
906
|
+
const s = xe(t);
|
|
907
|
+
return s !== "document" ? mn[s] : hn[un(t)];
|
|
908
|
+
}
|
|
909
|
+
function be(t, s) {
|
|
910
|
+
return O.createElement(fn(t), s);
|
|
911
|
+
}
|
|
912
|
+
const gn = (t) => {
|
|
913
|
+
var s, n;
|
|
914
|
+
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
915
|
+
}, bn = ({
|
|
916
|
+
source: t,
|
|
917
|
+
mimeType: s,
|
|
918
|
+
poster: n,
|
|
919
|
+
autoPlay: r = !1,
|
|
920
|
+
playing: o,
|
|
921
|
+
loop: l = !1,
|
|
922
|
+
controls: i = !0,
|
|
923
|
+
showProgress: c = !1,
|
|
924
|
+
muted: m = !1,
|
|
925
|
+
onContainerClick: u
|
|
1119
926
|
}) => {
|
|
1120
|
-
const
|
|
927
|
+
const h = xe(s), f = K(null), v = K(null), a = K(null), N = K(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, y] = A(!1), [_, F] = A(!0), [H, R] = A(null), z = G(() => {
|
|
928
|
+
T(!1), C(!0);
|
|
929
|
+
}, []), S = G((g) => {
|
|
930
|
+
const p = v.current;
|
|
931
|
+
if (!p) return 0;
|
|
932
|
+
const L = p.getBoundingClientRect();
|
|
933
|
+
return Math.max(
|
|
934
|
+
0,
|
|
935
|
+
Math.min(1, (gn(g) - L.left) / L.width)
|
|
936
|
+
);
|
|
937
|
+
}, []), $ = G((g) => {
|
|
938
|
+
const p = f.current;
|
|
939
|
+
p && p.duration && (p.currentTime = g * p.duration);
|
|
940
|
+
}, []), V = (g) => {
|
|
941
|
+
g.stopPropagation(), E(!0);
|
|
942
|
+
const p = S(g);
|
|
943
|
+
I(p), $(p);
|
|
944
|
+
};
|
|
945
|
+
J(() => {
|
|
946
|
+
o !== void 0 && o !== N.current && (N.current = o, C(o));
|
|
947
|
+
}, [o]), J(() => {
|
|
948
|
+
if (!b) {
|
|
949
|
+
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
const g = () => {
|
|
953
|
+
const p = f.current;
|
|
954
|
+
p && p.duration && !w && I(p.currentTime / p.duration), a.current = requestAnimationFrame(g);
|
|
955
|
+
};
|
|
956
|
+
return a.current = requestAnimationFrame(g), () => {
|
|
957
|
+
a.current !== null && cancelAnimationFrame(a.current);
|
|
958
|
+
};
|
|
959
|
+
}, [b, w]), J(() => {
|
|
960
|
+
const g = f.current;
|
|
961
|
+
g && (b ? g.play().catch((p) => {
|
|
962
|
+
C(!1), T(!0);
|
|
963
|
+
}) : g.pause());
|
|
964
|
+
}, [b]), J(() => {
|
|
965
|
+
if (!w) return;
|
|
966
|
+
const g = (L) => I(S(L)), p = (L) => {
|
|
967
|
+
E(!1), $(S(L));
|
|
968
|
+
};
|
|
969
|
+
return window.addEventListener("mousemove", g), window.addEventListener("mouseup", p), window.addEventListener("touchmove", g, { passive: !0 }), window.addEventListener("touchend", p), () => {
|
|
970
|
+
window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", p), window.removeEventListener("touchmove", g), window.removeEventListener("touchend", p);
|
|
971
|
+
};
|
|
972
|
+
}, [w, S, $]);
|
|
973
|
+
const ee = H ? { aspectRatio: String(H) } : void 0, te = H ? "" : " aspect-video", W = Math.round(x * 100);
|
|
1121
974
|
return /* @__PURE__ */ d(
|
|
1122
|
-
"
|
|
975
|
+
"div",
|
|
1123
976
|
{
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
977
|
+
role: "button",
|
|
978
|
+
tabIndex: 0,
|
|
979
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${te}`,
|
|
980
|
+
style: ee,
|
|
981
|
+
onClick: (g) => {
|
|
982
|
+
if (u) {
|
|
983
|
+
u(g);
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
k || i && C((p) => !p);
|
|
987
|
+
},
|
|
988
|
+
onKeyDown: (g) => {
|
|
989
|
+
if (!(g.key !== "Enter" && g.key !== " ")) {
|
|
990
|
+
if (g.preventDefault(), u) {
|
|
991
|
+
u(g);
|
|
992
|
+
return;
|
|
993
|
+
}
|
|
994
|
+
k || i && C((p) => !p);
|
|
995
|
+
}
|
|
996
|
+
},
|
|
997
|
+
children: [
|
|
998
|
+
n && (h === "audio" || _) && /* @__PURE__ */ e(
|
|
999
|
+
"img",
|
|
1000
|
+
{
|
|
1001
|
+
src: n,
|
|
1002
|
+
alt: "",
|
|
1003
|
+
className: "absolute inset-0 h-full w-full object-cover"
|
|
1135
1004
|
}
|
|
1136
1005
|
),
|
|
1137
|
-
/* @__PURE__ */ e(
|
|
1138
|
-
"
|
|
1006
|
+
!n && (h === "audio" || _) && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: be(s, {
|
|
1007
|
+
className: "size-12 text-black/20",
|
|
1008
|
+
weight: "regular"
|
|
1009
|
+
}) }),
|
|
1010
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: h === "audio" ? /* @__PURE__ */ e(
|
|
1011
|
+
"audio",
|
|
1139
1012
|
{
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1013
|
+
ref: f,
|
|
1014
|
+
src: t,
|
|
1015
|
+
loop: l,
|
|
1016
|
+
muted: m,
|
|
1017
|
+
style: { width: "100%", height: "100%" },
|
|
1018
|
+
onLoadStart: () => y(!0),
|
|
1019
|
+
onCanPlay: () => {
|
|
1020
|
+
y(!1), F(!1);
|
|
1143
1021
|
},
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1022
|
+
onWaiting: () => y(!0),
|
|
1023
|
+
onPlay: () => T(!1),
|
|
1024
|
+
onEnded: () => {
|
|
1025
|
+
l || (C(!1), I(0));
|
|
1026
|
+
},
|
|
1027
|
+
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
1147
1028
|
}
|
|
1148
|
-
)
|
|
1149
|
-
|
|
1150
|
-
r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
|
|
1151
|
-
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1152
|
-
] })
|
|
1153
|
-
]
|
|
1154
|
-
}
|
|
1155
|
-
);
|
|
1156
|
-
}, fn = () => {
|
|
1157
|
-
const { linkPreviewsManager: t } = Qt(), { linkPreviews: s } = es(
|
|
1158
|
-
t.state,
|
|
1159
|
-
mn
|
|
1160
|
-
), n = (o) => {
|
|
1161
|
-
t.dismissPreview(o);
|
|
1162
|
-
};
|
|
1163
|
-
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
|
|
1164
|
-
hn,
|
|
1165
|
-
{
|
|
1166
|
-
link: o,
|
|
1167
|
-
onDismiss: n
|
|
1168
|
-
},
|
|
1169
|
-
o.og_scrape_url
|
|
1170
|
-
)) }) : null;
|
|
1171
|
-
}, gn = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
|
|
1172
|
-
"button",
|
|
1173
|
-
{
|
|
1174
|
-
...n,
|
|
1175
|
-
type: "button",
|
|
1176
|
-
"aria-label": "Send",
|
|
1177
|
-
disabled: s,
|
|
1178
|
-
onClick: t,
|
|
1179
|
-
children: /* @__PURE__ */ e(xs, { weight: "bold", className: "size-4" })
|
|
1180
|
-
}
|
|
1181
|
-
), bn = () => {
|
|
1182
|
-
var c;
|
|
1183
|
-
const { channel: t } = oe(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = ss(), { SendButton: r } = dt(
|
|
1184
|
-
"CustomMessageInput"
|
|
1185
|
-
), o = r ?? gn, l = ns();
|
|
1186
|
-
return /* @__PURE__ */ d(ce, { children: [
|
|
1187
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(as, {}) }),
|
|
1188
|
-
/* @__PURE__ */ d("div", { className: "central-container min-w-0 w-full 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)]", children: [
|
|
1189
|
-
/* @__PURE__ */ e(rs, {}),
|
|
1190
|
-
/* @__PURE__ */ e(fn, {}),
|
|
1191
|
-
/* @__PURE__ */ e(is, {}),
|
|
1192
|
-
/* @__PURE__ */ d("div", { className: "flex", children: [
|
|
1193
|
-
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1194
|
-
os,
|
|
1029
|
+
) : /* @__PURE__ */ e(
|
|
1030
|
+
"video",
|
|
1195
1031
|
{
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1032
|
+
ref: f,
|
|
1033
|
+
src: t,
|
|
1034
|
+
loop: l,
|
|
1035
|
+
muted: m,
|
|
1036
|
+
playsInline: !0,
|
|
1037
|
+
style: { width: "100%", height: "100%" },
|
|
1038
|
+
onLoadStart: () => y(!0),
|
|
1039
|
+
onCanPlay: () => {
|
|
1040
|
+
y(!1), F(!1);
|
|
1041
|
+
},
|
|
1042
|
+
onWaiting: () => y(!0),
|
|
1043
|
+
onPlay: () => T(!1),
|
|
1044
|
+
onLoadedMetadata: () => {
|
|
1045
|
+
const g = f.current;
|
|
1046
|
+
g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && R(g.videoWidth / g.videoHeight);
|
|
1047
|
+
},
|
|
1048
|
+
onEnded: () => {
|
|
1049
|
+
l || (C(!1), I(0));
|
|
1050
|
+
},
|
|
1051
|
+
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
1202
1052
|
}
|
|
1203
1053
|
) }),
|
|
1204
|
-
/* @__PURE__ */ e(
|
|
1205
|
-
|
|
1054
|
+
M && !k && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ e(
|
|
1055
|
+
xt,
|
|
1206
1056
|
{
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1210
|
-
"data-testid": "send-button",
|
|
1211
|
-
disabled: s || !l,
|
|
1212
|
-
type: "button"
|
|
1057
|
+
className: "size-8 animate-spin text-white/80",
|
|
1058
|
+
weight: "bold"
|
|
1213
1059
|
}
|
|
1214
|
-
)
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
/* @__PURE__ */ e(
|
|
1060
|
+
) }),
|
|
1061
|
+
k && !i && /* @__PURE__ */ e(
|
|
1062
|
+
"div",
|
|
1063
|
+
{
|
|
1064
|
+
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
1065
|
+
role: "button",
|
|
1066
|
+
tabIndex: 0,
|
|
1067
|
+
"aria-label": "Play preview",
|
|
1068
|
+
onClick: (g) => {
|
|
1069
|
+
g.stopPropagation(), z();
|
|
1070
|
+
},
|
|
1071
|
+
onKeyDown: (g) => {
|
|
1072
|
+
g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), z());
|
|
1073
|
+
},
|
|
1074
|
+
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(tt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1075
|
+
}
|
|
1076
|
+
),
|
|
1077
|
+
c && !i && /* @__PURE__ */ e("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__ */ e(
|
|
1078
|
+
"div",
|
|
1079
|
+
{
|
|
1080
|
+
role: "slider",
|
|
1081
|
+
"aria-label": "Playback position",
|
|
1082
|
+
"aria-valuenow": W,
|
|
1083
|
+
"aria-valuemin": 0,
|
|
1084
|
+
"aria-valuemax": 100,
|
|
1085
|
+
tabIndex: 0,
|
|
1086
|
+
ref: v,
|
|
1087
|
+
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1088
|
+
onMouseDown: V,
|
|
1089
|
+
onTouchStart: V,
|
|
1090
|
+
onClick: (g) => g.stopPropagation(),
|
|
1091
|
+
onKeyDown: (g) => {
|
|
1092
|
+
g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
|
|
1093
|
+
},
|
|
1094
|
+
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
1095
|
+
"div",
|
|
1096
|
+
{
|
|
1097
|
+
className: "h-full rounded-full bg-white",
|
|
1098
|
+
style: { width: `${W}%` }
|
|
1099
|
+
}
|
|
1100
|
+
) })
|
|
1101
|
+
}
|
|
1102
|
+
) }),
|
|
1103
|
+
i && /* @__PURE__ */ d("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
1104
|
+
/* @__PURE__ */ e(
|
|
1105
|
+
"button",
|
|
1106
|
+
{
|
|
1107
|
+
type: "button",
|
|
1108
|
+
onClick: (g) => {
|
|
1109
|
+
g.stopPropagation(), C((p) => !p);
|
|
1110
|
+
},
|
|
1111
|
+
className: "shrink-0 text-white",
|
|
1112
|
+
"aria-label": b ? "Pause" : "Play",
|
|
1113
|
+
children: b ? /* @__PURE__ */ e(Rs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(tt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1114
|
+
}
|
|
1115
|
+
),
|
|
1116
|
+
/* @__PURE__ */ d(
|
|
1117
|
+
"div",
|
|
1118
|
+
{
|
|
1119
|
+
role: "slider",
|
|
1120
|
+
"aria-label": "Playback position",
|
|
1121
|
+
"aria-valuenow": W,
|
|
1122
|
+
"aria-valuemin": 0,
|
|
1123
|
+
"aria-valuemax": 100,
|
|
1124
|
+
tabIndex: 0,
|
|
1125
|
+
ref: v,
|
|
1126
|
+
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1127
|
+
onMouseDown: V,
|
|
1128
|
+
onTouchStart: V,
|
|
1129
|
+
onClick: (g) => g.stopPropagation(),
|
|
1130
|
+
onMouseEnter: () => U(!0),
|
|
1131
|
+
onMouseLeave: () => U(!1),
|
|
1132
|
+
onKeyDown: (g) => {
|
|
1133
|
+
g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
|
|
1134
|
+
},
|
|
1135
|
+
children: [
|
|
1136
|
+
/* @__PURE__ */ e(
|
|
1137
|
+
"div",
|
|
1138
|
+
{
|
|
1139
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || w ? "h-1.5" : "h-1"}`,
|
|
1140
|
+
children: /* @__PURE__ */ e(
|
|
1141
|
+
"div",
|
|
1142
|
+
{
|
|
1143
|
+
className: "h-full rounded-full bg-white",
|
|
1144
|
+
style: { width: `${W}%` }
|
|
1145
|
+
}
|
|
1146
|
+
)
|
|
1147
|
+
}
|
|
1148
|
+
),
|
|
1149
|
+
/* @__PURE__ */ e(
|
|
1150
|
+
"div",
|
|
1151
|
+
{
|
|
1152
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1153
|
+
style: { left: `${W}%` }
|
|
1154
|
+
}
|
|
1155
|
+
)
|
|
1156
|
+
]
|
|
1157
|
+
}
|
|
1158
|
+
)
|
|
1159
|
+
] })
|
|
1232
1160
|
]
|
|
1233
1161
|
}
|
|
1234
1162
|
);
|
|
1235
|
-
},
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
if (Nn(s))
|
|
1254
|
-
return {
|
|
1255
|
-
kind: "age-safety",
|
|
1256
|
-
type: s
|
|
1257
|
-
};
|
|
1258
|
-
const n = t.dm_agent_system_type;
|
|
1259
|
-
if (at(n))
|
|
1260
|
-
return {
|
|
1261
|
-
kind: "dm-agent",
|
|
1262
|
-
type: n
|
|
1263
|
-
};
|
|
1264
|
-
}, En = (t) => {
|
|
1265
|
-
const s = t.indexOf(ye);
|
|
1266
|
-
if (s === -1)
|
|
1267
|
-
return t;
|
|
1268
|
-
const n = s + ye.length;
|
|
1269
|
-
return /* @__PURE__ */ d(ce, { children: [
|
|
1270
|
-
t.slice(0, s),
|
|
1271
|
-
/* @__PURE__ */ e(
|
|
1272
|
-
"a",
|
|
1273
|
-
{
|
|
1274
|
-
href: yn,
|
|
1275
|
-
target: "_blank",
|
|
1276
|
-
rel: "noopener noreferrer",
|
|
1277
|
-
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1278
|
-
children: ye
|
|
1279
|
-
}
|
|
1280
|
-
),
|
|
1281
|
-
t.slice(n)
|
|
1282
|
-
] });
|
|
1283
|
-
}, Sn = (t) => {
|
|
1284
|
-
var r, o;
|
|
1285
|
-
const s = t.message.hide_date === !0, n = Cn(
|
|
1286
|
-
t.message
|
|
1287
|
-
);
|
|
1288
|
-
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1289
|
-
const l = ((r = t.message.text) == null ? void 0 : r.trim()) || vn[n.type];
|
|
1290
|
-
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1291
|
-
/* @__PURE__ */ d(
|
|
1292
|
-
"div",
|
|
1293
|
-
{
|
|
1294
|
-
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
1295
|
-
"data-testid": "dm-agent-system-message",
|
|
1296
|
-
"data-dm-agent-system-type": n.type,
|
|
1297
|
-
children: [
|
|
1298
|
-
/* @__PURE__ */ e(
|
|
1299
|
-
Se,
|
|
1300
|
-
{
|
|
1301
|
-
size: 16,
|
|
1302
|
-
weight: "regular",
|
|
1303
|
-
"aria-hidden": !0,
|
|
1304
|
-
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1305
|
-
}
|
|
1306
|
-
),
|
|
1307
|
-
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: l })
|
|
1308
|
-
]
|
|
1309
|
-
}
|
|
1310
|
-
),
|
|
1311
|
-
!s && /* @__PURE__ */ e(ve, { message: t.message })
|
|
1312
|
-
] });
|
|
1313
|
-
}
|
|
1314
|
-
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1315
|
-
const l = ((o = t.message.text) == null ? void 0 : o.trim()) || _n[n.type];
|
|
1316
|
-
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1317
|
-
/* @__PURE__ */ d(
|
|
1318
|
-
"div",
|
|
1319
|
-
{
|
|
1320
|
-
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1321
|
-
"data-testid": "age-safety-system-message",
|
|
1322
|
-
"data-age-safety-system-type": n.type,
|
|
1323
|
-
children: [
|
|
1324
|
-
/* @__PURE__ */ e(
|
|
1325
|
-
vs,
|
|
1326
|
-
{
|
|
1327
|
-
size: 24,
|
|
1328
|
-
weight: "duotone",
|
|
1329
|
-
"aria-hidden": !0,
|
|
1330
|
-
className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1331
|
-
"data-testid": "age-safety-system-message-icon"
|
|
1332
|
-
}
|
|
1333
|
-
),
|
|
1334
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("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: En(l) }) })
|
|
1335
|
-
]
|
|
1336
|
-
}
|
|
1337
|
-
),
|
|
1338
|
-
!s && /* @__PURE__ */ e(ve, { message: t.message })
|
|
1339
|
-
] });
|
|
1340
|
-
}
|
|
1341
|
-
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1342
|
-
/* @__PURE__ */ d("div", { className: "str-chat__message--system__text", children: [
|
|
1343
|
-
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
1344
|
-
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1345
|
-
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1346
|
-
] }),
|
|
1347
|
-
!s && /* @__PURE__ */ e(ve, { message: t.message })
|
|
1348
|
-
] });
|
|
1349
|
-
}, Ne = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
|
|
1350
|
-
"animateTransform",
|
|
1351
|
-
{
|
|
1352
|
-
attributeName: "transform",
|
|
1353
|
-
type: "translate",
|
|
1354
|
-
values: "0 0; 0 -2.25; 0 0;",
|
|
1355
|
-
dur: "900ms",
|
|
1356
|
-
begin: `${120 * s}ms`,
|
|
1357
|
-
repeatCount: "indefinite"
|
|
1358
|
-
}
|
|
1359
|
-
) }), In = ({ threadList: t }) => {
|
|
1360
|
-
var N;
|
|
1361
|
-
const { channel: s, channelConfig: n, thread: r } = oe(), { client: o } = Me(), { typing: l = {} } = ls();
|
|
1362
|
-
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
1363
|
-
return null;
|
|
1364
|
-
const i = t ? [] : Object.values(l).filter(
|
|
1365
|
-
({ parent_id: b, user: C }) => {
|
|
1366
|
-
var x;
|
|
1367
|
-
return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && !b;
|
|
1163
|
+
}, lt = (t) => t === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", pn = (t) => t === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", St = ({
|
|
1164
|
+
mimeType: t,
|
|
1165
|
+
sourceUrl: s,
|
|
1166
|
+
thumbnailUrl: n,
|
|
1167
|
+
title: r,
|
|
1168
|
+
variant: o,
|
|
1169
|
+
mediaPlayerProps: l,
|
|
1170
|
+
containedImage: i = !1
|
|
1171
|
+
}) => {
|
|
1172
|
+
const c = xe(t), [m, u] = A(!1);
|
|
1173
|
+
return s && (c === "video" || c === "audio") ? /* @__PURE__ */ e(
|
|
1174
|
+
bn,
|
|
1175
|
+
{
|
|
1176
|
+
source: s,
|
|
1177
|
+
mimeType: t,
|
|
1178
|
+
poster: n,
|
|
1179
|
+
controls: !0,
|
|
1180
|
+
...l
|
|
1368
1181
|
}
|
|
1369
|
-
)
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1182
|
+
) : s && c === "image" ? i ? /* @__PURE__ */ e("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ e(
|
|
1183
|
+
"img",
|
|
1184
|
+
{
|
|
1185
|
+
src: s,
|
|
1186
|
+
alt: r ?? "",
|
|
1187
|
+
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
|
|
1188
|
+
draggable: !1,
|
|
1189
|
+
onLoad: () => u(!0)
|
|
1373
1190
|
}
|
|
1374
|
-
) :
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1191
|
+
) }) : /* @__PURE__ */ e(
|
|
1192
|
+
"img",
|
|
1193
|
+
{
|
|
1194
|
+
src: s,
|
|
1195
|
+
alt: r ?? "",
|
|
1196
|
+
className: "block w-full",
|
|
1197
|
+
draggable: !1
|
|
1198
|
+
}
|
|
1199
|
+
) : s && c === "document" ? n ? i ? /* @__PURE__ */ e("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ e(
|
|
1200
|
+
"img",
|
|
1201
|
+
{
|
|
1202
|
+
src: n,
|
|
1203
|
+
alt: r ?? "",
|
|
1204
|
+
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
|
|
1205
|
+
draggable: !1,
|
|
1206
|
+
onLoad: () => u(!0)
|
|
1207
|
+
}
|
|
1208
|
+
) }) : /* @__PURE__ */ e(
|
|
1209
|
+
"img",
|
|
1210
|
+
{
|
|
1211
|
+
src: n,
|
|
1212
|
+
alt: "",
|
|
1213
|
+
className: "block w-full",
|
|
1214
|
+
draggable: !1
|
|
1215
|
+
}
|
|
1216
|
+
) : /* @__PURE__ */ e(
|
|
1217
|
+
"div",
|
|
1218
|
+
{
|
|
1219
|
+
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1220
|
+
children: be(t, {
|
|
1221
|
+
className: lt(o),
|
|
1222
|
+
weight: "regular"
|
|
1223
|
+
})
|
|
1224
|
+
}
|
|
1225
|
+
) : n ? /* @__PURE__ */ e("div", { className: `relative ${pn(o)}`, children: /* @__PURE__ */ e(
|
|
1226
|
+
"img",
|
|
1227
|
+
{
|
|
1228
|
+
src: n,
|
|
1229
|
+
alt: r ?? "",
|
|
1230
|
+
draggable: !1,
|
|
1231
|
+
className: "absolute inset-0 h-full w-full object-cover"
|
|
1232
|
+
}
|
|
1233
|
+
) }) : /* @__PURE__ */ e(
|
|
1234
|
+
"div",
|
|
1235
|
+
{
|
|
1236
|
+
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1237
|
+
children: be(t, {
|
|
1238
|
+
className: lt(o),
|
|
1239
|
+
weight: "regular"
|
|
1240
|
+
})
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
}, It = ({
|
|
1244
|
+
variant: t,
|
|
1245
|
+
thumbnail: s,
|
|
1246
|
+
title: n,
|
|
1247
|
+
placeholderTitle: r = "Attachment title",
|
|
1248
|
+
mimeType: o,
|
|
1249
|
+
detail: l,
|
|
1250
|
+
statusBadge: i,
|
|
1251
|
+
action: c,
|
|
1252
|
+
topLeft: m,
|
|
1253
|
+
topRight: u,
|
|
1254
|
+
rootRef: h,
|
|
1255
|
+
"data-testid": f
|
|
1256
|
+
}) => {
|
|
1257
|
+
const v = t === "dark", a = v ? n ?? r : n ?? "", N = v && !n;
|
|
1378
1258
|
return /* @__PURE__ */ d(
|
|
1379
1259
|
"div",
|
|
1380
1260
|
{
|
|
1381
|
-
|
|
1382
|
-
"data-testid":
|
|
1383
|
-
|
|
1261
|
+
ref: h,
|
|
1262
|
+
"data-testid": f,
|
|
1263
|
+
className: D(
|
|
1264
|
+
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
1265
|
+
v ? "bg-[#121110]" : "bg-white"
|
|
1266
|
+
),
|
|
1384
1267
|
children: [
|
|
1385
|
-
/* @__PURE__ */ e("div", { className: "
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1268
|
+
m ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: m }) : null,
|
|
1269
|
+
u ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: u }) : null,
|
|
1270
|
+
s,
|
|
1271
|
+
/* @__PURE__ */ d("div", { className: "px-4 pb-3 pt-3", children: [
|
|
1272
|
+
a.trim() !== "" && /* @__PURE__ */ e(
|
|
1273
|
+
"p",
|
|
1274
|
+
{
|
|
1275
|
+
className: D("mb-0.5 truncate text-base font-medium", {
|
|
1276
|
+
"text-black": !v,
|
|
1277
|
+
"text-white/30": v && N,
|
|
1278
|
+
"text-white": v && !N
|
|
1279
|
+
}),
|
|
1280
|
+
children: a
|
|
1281
|
+
}
|
|
1282
|
+
),
|
|
1283
|
+
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1284
|
+
be(o, {
|
|
1285
|
+
className: D(
|
|
1286
|
+
"size-5 shrink-0",
|
|
1287
|
+
v ? "text-white/55" : "text-black/55"
|
|
1288
|
+
),
|
|
1289
|
+
weight: "regular"
|
|
1290
|
+
}),
|
|
1291
|
+
l != null && l !== "" && /* @__PURE__ */ e(
|
|
1292
|
+
"span",
|
|
1293
|
+
{
|
|
1294
|
+
className: D(
|
|
1295
|
+
"text-xs font-medium",
|
|
1296
|
+
v ? "text-white/55" : "text-black/55"
|
|
1297
|
+
),
|
|
1298
|
+
children: l
|
|
1299
|
+
}
|
|
1300
|
+
),
|
|
1301
|
+
i
|
|
1302
|
+
] }),
|
|
1303
|
+
c
|
|
1304
|
+
] })
|
|
1411
1305
|
]
|
|
1412
1306
|
}
|
|
1413
1307
|
);
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
{
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
] }),
|
|
1454
|
-
|
|
1455
|
-
|
|
1308
|
+
};
|
|
1309
|
+
function kt(t) {
|
|
1310
|
+
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
1311
|
+
}
|
|
1312
|
+
function Le(t) {
|
|
1313
|
+
return `w-[280px] select-none overflow-hidden rounded-[24px] ${t ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1314
|
+
}
|
|
1315
|
+
function xn(t) {
|
|
1316
|
+
return t ? "bg-white/10" : "bg-black/5";
|
|
1317
|
+
}
|
|
1318
|
+
function vn(t) {
|
|
1319
|
+
return t ? "text-white" : "text-black";
|
|
1320
|
+
}
|
|
1321
|
+
function wn(t) {
|
|
1322
|
+
return t ? "text-white/55" : "text-black/55";
|
|
1323
|
+
}
|
|
1324
|
+
function _n(t) {
|
|
1325
|
+
return t ? "text-white/40" : "text-black/40";
|
|
1326
|
+
}
|
|
1327
|
+
function yn(t) {
|
|
1328
|
+
return t ? "text-white/20" : "text-black/20";
|
|
1329
|
+
}
|
|
1330
|
+
const Ae = ({ attachment: t, isMyMessage: s }) => {
|
|
1331
|
+
const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i, m = typeof c == "string" && c.trim() !== "" ? c : void 0, u = /* @__PURE__ */ d(O.Fragment, { children: [
|
|
1332
|
+
/* @__PURE__ */ e("div", { className: "p-2", children: o ? /* @__PURE__ */ e(
|
|
1333
|
+
"img",
|
|
1334
|
+
{
|
|
1335
|
+
src: o,
|
|
1336
|
+
alt: n ?? "",
|
|
1337
|
+
className: "aspect-video w-full rounded-[20px] object-cover"
|
|
1338
|
+
}
|
|
1339
|
+
) : /* @__PURE__ */ e(
|
|
1340
|
+
"div",
|
|
1341
|
+
{
|
|
1342
|
+
className: `aspect-video w-full rounded-[20px] ${xn(s)} flex items-center justify-center`,
|
|
1343
|
+
children: /* @__PURE__ */ e(Ls, { className: `size-12 ${yn(s)}` })
|
|
1344
|
+
}
|
|
1345
|
+
) }),
|
|
1346
|
+
/* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
|
|
1347
|
+
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${vn(s)}`, children: n }),
|
|
1348
|
+
r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${wn(s)}`, children: r }),
|
|
1349
|
+
m && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${_n(s)}`, children: m })
|
|
1350
|
+
] })
|
|
1351
|
+
] });
|
|
1352
|
+
return m ? /* @__PURE__ */ e("a", { href: m, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ e("div", { className: "block", children: u });
|
|
1353
|
+
};
|
|
1354
|
+
function Mt(t) {
|
|
1355
|
+
return t.type === "link" || !!t.og_scrape_url && !t.asset_url;
|
|
1356
|
+
}
|
|
1357
|
+
function Fe(t) {
|
|
1358
|
+
var s;
|
|
1359
|
+
return (s = t.attachments) == null ? void 0 : s.find(Mt);
|
|
1360
|
+
}
|
|
1361
|
+
async function Nn(t, s) {
|
|
1362
|
+
let n;
|
|
1363
|
+
try {
|
|
1364
|
+
n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
|
|
1365
|
+
} catch {
|
|
1366
|
+
n = s ?? "download";
|
|
1456
1367
|
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
onShowInfo: n,
|
|
1466
|
-
canShowInfo: r,
|
|
1467
|
-
showStarButton: o = !1,
|
|
1468
|
-
dmAgentEnabled: l = !1
|
|
1368
|
+
const r = await fetch(t, { mode: "cors" });
|
|
1369
|
+
if (!r.ok) throw new Error(`HTTP ${r.status}`);
|
|
1370
|
+
const o = await r.blob(), l = URL.createObjectURL(o), i = document.createElement("a");
|
|
1371
|
+
i.href = l, i.download = n, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(l);
|
|
1372
|
+
}
|
|
1373
|
+
const Cn = ({
|
|
1374
|
+
url: t,
|
|
1375
|
+
filename: s
|
|
1469
1376
|
}) => {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1377
|
+
const [n, r] = A(!1);
|
|
1378
|
+
return /* @__PURE__ */ e(
|
|
1379
|
+
"button",
|
|
1380
|
+
{
|
|
1381
|
+
type: "button",
|
|
1382
|
+
onClick: (l) => {
|
|
1383
|
+
l.stopPropagation();
|
|
1384
|
+
const i = window.open("", "_blank", "noopener,noreferrer");
|
|
1385
|
+
r(!0), Nn(t, s).then(() => {
|
|
1386
|
+
i == null || i.close();
|
|
1387
|
+
}).catch(() => {
|
|
1388
|
+
i && (i.location.href = t);
|
|
1389
|
+
}).finally(() => r(!1));
|
|
1390
|
+
},
|
|
1391
|
+
disabled: n,
|
|
1392
|
+
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",
|
|
1393
|
+
children: n ? /* @__PURE__ */ e(xt, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(O.Fragment, { children: [
|
|
1394
|
+
/* @__PURE__ */ e(As, { className: "size-4 text-white", weight: "bold" }),
|
|
1395
|
+
"Download"
|
|
1396
|
+
] })
|
|
1484
1397
|
}
|
|
1398
|
+
);
|
|
1399
|
+
};
|
|
1400
|
+
function Oe(t) {
|
|
1401
|
+
var f, v, a, N;
|
|
1402
|
+
const s = (f = t.attachments) == null ? void 0 : f.find(
|
|
1403
|
+
(b) => b.type === "video" && b.asset_url
|
|
1404
|
+
), n = (v = t.attachments) == null ? void 0 : v.find(
|
|
1405
|
+
(b) => b.type === "image" && b.image_url
|
|
1406
|
+
), r = (a = t.attachments) == null ? void 0 : a.find(
|
|
1407
|
+
(b) => b.type === "audio" && b.asset_url
|
|
1408
|
+
), o = (N = t.attachments) == null ? void 0 : N.find(
|
|
1409
|
+
(b) => b.type === "file" && b.asset_url
|
|
1410
|
+
), l = s ?? n ?? r ?? o, i = (s == null ? void 0 : s.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (r == null ? void 0 : r.asset_url) ?? (o == null ? void 0 : o.asset_url);
|
|
1411
|
+
if (!i) return null;
|
|
1412
|
+
const c = (l == null ? void 0 : l.mime_type) ?? ((l == null ? void 0 : l.type) === "image" ? "image/jpeg" : (l == null ? void 0 : l.type) === "video" ? "video/mp4" : (l == null ? void 0 : l.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), m = l == null ? void 0 : l.title, u = l == null ? void 0 : l.file_size, h = s == null ? void 0 : s.thumb_url;
|
|
1413
|
+
return {
|
|
1414
|
+
resolvedUrl: i,
|
|
1415
|
+
resolvedType: c,
|
|
1416
|
+
title: m,
|
|
1417
|
+
fileSize: u,
|
|
1418
|
+
thumbnailUrl: h
|
|
1485
1419
|
};
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1420
|
+
}
|
|
1421
|
+
const Tt = ({
|
|
1422
|
+
resolvedUrl: t,
|
|
1423
|
+
resolvedType: s,
|
|
1424
|
+
title: n,
|
|
1425
|
+
fileSize: r,
|
|
1426
|
+
thumbnailUrl: o
|
|
1427
|
+
}) => {
|
|
1428
|
+
const l = r !== void 0 ? kt(r) : void 0;
|
|
1429
|
+
return /* @__PURE__ */ e(
|
|
1430
|
+
It,
|
|
1431
|
+
{
|
|
1432
|
+
variant: "dark",
|
|
1433
|
+
title: n,
|
|
1434
|
+
placeholderTitle: "",
|
|
1435
|
+
mimeType: s,
|
|
1436
|
+
detail: l,
|
|
1437
|
+
thumbnail: /* @__PURE__ */ e(
|
|
1438
|
+
St,
|
|
1490
1439
|
{
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
children: /* @__PURE__ */ e(Je, { className: "size-5 text-black/90" })
|
|
1440
|
+
mimeType: s,
|
|
1441
|
+
sourceUrl: t,
|
|
1442
|
+
thumbnailUrl: o,
|
|
1443
|
+
title: n,
|
|
1444
|
+
variant: "dark"
|
|
1497
1445
|
}
|
|
1498
|
-
)
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1446
|
+
)
|
|
1447
|
+
}
|
|
1448
|
+
);
|
|
1449
|
+
}, Dt = ({
|
|
1450
|
+
resolvedUrl: t,
|
|
1451
|
+
resolvedType: s,
|
|
1452
|
+
title: n,
|
|
1453
|
+
fileSize: r,
|
|
1454
|
+
thumbnailUrl: o
|
|
1455
|
+
}) => {
|
|
1456
|
+
const l = xe(s), i = r !== void 0 ? kt(r) : void 0;
|
|
1457
|
+
return /* @__PURE__ */ e(
|
|
1458
|
+
It,
|
|
1459
|
+
{
|
|
1460
|
+
variant: "light",
|
|
1461
|
+
title: n,
|
|
1462
|
+
mimeType: s,
|
|
1463
|
+
detail: i,
|
|
1464
|
+
thumbnail: /* @__PURE__ */ e(
|
|
1465
|
+
St,
|
|
1466
|
+
{
|
|
1467
|
+
mimeType: s,
|
|
1468
|
+
sourceUrl: t,
|
|
1469
|
+
thumbnailUrl: o,
|
|
1470
|
+
title: n,
|
|
1471
|
+
variant: "light",
|
|
1472
|
+
containedImage: l === "image" || l === "document"
|
|
1473
|
+
}
|
|
1474
|
+
),
|
|
1475
|
+
action: /* @__PURE__ */ e(Cn, { url: t, filename: n })
|
|
1476
|
+
}
|
|
1477
|
+
);
|
|
1478
|
+
}, En = ({
|
|
1479
|
+
message: t,
|
|
1480
|
+
isMyMessage: s = !1
|
|
1481
|
+
}) => {
|
|
1482
|
+
const n = Fe(t), r = Oe(t);
|
|
1483
|
+
return !n && !r ? null : /* @__PURE__ */ d("div", { className: s ? "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", children: [
|
|
1484
|
+
!s && t.user && /* @__PURE__ */ e(
|
|
1485
|
+
ne,
|
|
1486
|
+
{
|
|
1487
|
+
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1488
|
+
id: t.user.id,
|
|
1489
|
+
image: t.user.image,
|
|
1490
|
+
name: t.user.name ?? t.user.id
|
|
1491
|
+
}
|
|
1492
|
+
),
|
|
1493
|
+
/* @__PURE__ */ e(
|
|
1494
|
+
"div",
|
|
1495
|
+
{
|
|
1496
|
+
className: "str-chat__message-inner",
|
|
1497
|
+
style: { marginInlineEnd: 0, marginInlineStart: 0 },
|
|
1498
|
+
children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e(
|
|
1499
|
+
"div",
|
|
1513
1500
|
{
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
"aria-label": `View info for ${m}`,
|
|
1518
|
-
children: [
|
|
1519
|
-
m,
|
|
1520
|
-
/* @__PURE__ */ e(Ke, { className: "size-3 shrink-0" })
|
|
1521
|
-
]
|
|
1501
|
+
className: "str-chat__message-bubble",
|
|
1502
|
+
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1503
|
+
children: n ? /* @__PURE__ */ e("div", { className: Le(s), children: /* @__PURE__ */ e(Ae, { attachment: n, isMyMessage: s }) }) : s ? /* @__PURE__ */ e(Tt, { ...r }) : /* @__PURE__ */ e(Dt, { ...r })
|
|
1522
1504
|
}
|
|
1523
|
-
)
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1505
|
+
) })
|
|
1506
|
+
}
|
|
1507
|
+
)
|
|
1508
|
+
] });
|
|
1509
|
+
}, Sn = ({
|
|
1510
|
+
message: t
|
|
1511
|
+
}) => {
|
|
1512
|
+
const s = Fe(t);
|
|
1513
|
+
if (s)
|
|
1514
|
+
return /* @__PURE__ */ e("div", { className: Le(!0), children: /* @__PURE__ */ e(Ae, { attachment: s, isMyMessage: !0 }) });
|
|
1515
|
+
const n = Oe(t);
|
|
1516
|
+
return n ? /* @__PURE__ */ e(Tt, { ...n }) : null;
|
|
1517
|
+
}, In = ({
|
|
1518
|
+
message: t
|
|
1519
|
+
}) => {
|
|
1520
|
+
const s = Fe(t);
|
|
1521
|
+
if (s)
|
|
1522
|
+
return /* @__PURE__ */ e("div", { className: Le(!1), children: /* @__PURE__ */ e(Ae, { attachment: s, isMyMessage: !1 }) });
|
|
1523
|
+
const n = Oe(t);
|
|
1524
|
+
return n ? /* @__PURE__ */ e(Dt, { ...n }) : null;
|
|
1525
|
+
}, ua = Object.assign(En, {
|
|
1526
|
+
Creator: Sn,
|
|
1527
|
+
Visitor: In
|
|
1528
|
+
}), kn = {
|
|
1529
|
+
isUnlocking: () => !1
|
|
1530
|
+
}, Mn = {
|
|
1531
|
+
LockedAttachment: kn
|
|
1532
|
+
}, Rt = ut({}), ma = Rt.Provider;
|
|
1533
|
+
function Tn(t) {
|
|
1534
|
+
return mt(Rt)[t] ?? Mn[t];
|
|
1535
|
+
}
|
|
1536
|
+
const Dn = ({
|
|
1537
|
+
selected: t,
|
|
1538
|
+
onVoteUp: s,
|
|
1539
|
+
onVoteDown: n
|
|
1540
|
+
}) => /* @__PURE__ */ d("div", { className: "message-vote-buttons", children: [
|
|
1541
|
+
/* @__PURE__ */ e(
|
|
1542
|
+
"button",
|
|
1543
|
+
{
|
|
1544
|
+
type: "button",
|
|
1545
|
+
className: D("message-vote-button focus-ring", {
|
|
1546
|
+
"message-vote-button--selected": t === "up"
|
|
1547
|
+
}),
|
|
1548
|
+
onClick: s,
|
|
1549
|
+
"aria-label": "Good response",
|
|
1550
|
+
"aria-pressed": t === "up",
|
|
1551
|
+
"data-tooltip": "Good response",
|
|
1552
|
+
children: /* @__PURE__ */ e(Fs, { size: 16, weight: t === "up" ? "fill" : "regular" })
|
|
1553
|
+
}
|
|
1554
|
+
),
|
|
1555
|
+
/* @__PURE__ */ e(
|
|
1556
|
+
"button",
|
|
1557
|
+
{
|
|
1558
|
+
type: "button",
|
|
1559
|
+
className: D("message-vote-button focus-ring", {
|
|
1560
|
+
"message-vote-button--selected": t === "down"
|
|
1561
|
+
}),
|
|
1562
|
+
onClick: n,
|
|
1563
|
+
"aria-label": "Bad response",
|
|
1564
|
+
"aria-pressed": t === "down",
|
|
1565
|
+
"data-tooltip": "Bad response",
|
|
1566
|
+
children: /* @__PURE__ */ e(Os, { size: 16, weight: t === "down" ? "fill" : "regular" })
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1569
|
+
] }), Rn = (t) => {
|
|
1570
|
+
var se, Pe, Ue, ze, Be, $e, je, Ge, Ve, He, Ye, We, qe, Xe;
|
|
1571
|
+
const {
|
|
1572
|
+
additionalMessageInputProps: s,
|
|
1573
|
+
chatbotVotingEnabled: n,
|
|
1574
|
+
editing: r,
|
|
1575
|
+
endOfGroup: o,
|
|
1576
|
+
firstOfGroup: l,
|
|
1577
|
+
groupedByUser: i,
|
|
1578
|
+
handleAction: c,
|
|
1579
|
+
handleOpenThread: m,
|
|
1580
|
+
handleRetry: u,
|
|
1581
|
+
highlighted: h,
|
|
1582
|
+
isMessageAIGenerated: f,
|
|
1583
|
+
isMyMessage: v,
|
|
1584
|
+
message: a,
|
|
1585
|
+
renderText: N,
|
|
1586
|
+
threadList: b
|
|
1587
|
+
} = t, { client: C } = De("CustomMessage"), { channel: x } = oe("CustomMessage"), { isUnlocking: I, onUnlockClick: w, onFetchSource: E, onDownloadClick: P } = Tn("LockedAttachment"), [U, k] = A(!1), T = Bt(a.id), { selected: M, voteUp: y, voteDown: _ } = an(a), {
|
|
1588
|
+
Attachment: F = $t,
|
|
1589
|
+
EditMessageModal: H = jt,
|
|
1590
|
+
MessageBlocked: R = Gt,
|
|
1591
|
+
MessageBouncePrompt: z = Vt,
|
|
1592
|
+
MessageDeleted: S = Ht,
|
|
1593
|
+
MessageIsThreadReplyInChannelButtonIndicator: $ = Yt,
|
|
1594
|
+
MessageRepliesCountButton: V = Wt,
|
|
1595
|
+
ReminderNotification: ee = qt,
|
|
1596
|
+
StreamedMessageText: te = Xt,
|
|
1597
|
+
PinIndicator: W
|
|
1598
|
+
} = ft("CustomMessage"), g = Zt(a), p = Jt(a), L = Se(
|
|
1599
|
+
() => f == null ? void 0 : f(a),
|
|
1600
|
+
[f, a]
|
|
1601
|
+
), j = Se(() => {
|
|
1602
|
+
const Ze = a.attachments ?? [], me = a.shared_location ? [a.shared_location, ...Ze] : Ze;
|
|
1603
|
+
if (!ge(a)) return me;
|
|
1604
|
+
const Je = me.filter((Ke) => !("type" in Ke) || !Mt(Ke));
|
|
1605
|
+
return Je.length === me.length ? me : Je;
|
|
1606
|
+
}, [a]);
|
|
1607
|
+
if (Kt(a))
|
|
1608
|
+
return null;
|
|
1609
|
+
if (a.deleted_at || a.type === "deleted")
|
|
1610
|
+
return /* @__PURE__ */ e(S, { message: a });
|
|
1611
|
+
if (Qt(a))
|
|
1612
|
+
return /* @__PURE__ */ e(R, {});
|
|
1613
|
+
const Y = !b && !!a.reply_count, ae = !b && a.show_in_channel && a.parent_id, de = a.status === "failed" && ((se = a.error) == null ? void 0 : se.status) !== 403, re = es(a);
|
|
1614
|
+
let q;
|
|
1615
|
+
de ? q = () => u(a) : re && (q = () => k(!0));
|
|
1616
|
+
const ie = v(), ve = D(
|
|
1617
|
+
"str-chat__message str-chat__message-simple",
|
|
1618
|
+
`str-chat__message--${a.type}`,
|
|
1619
|
+
`str-chat__message--${a.status}`,
|
|
1620
|
+
ie ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1621
|
+
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1622
|
+
{
|
|
1623
|
+
"str-chat__message--has-attachment": g,
|
|
1624
|
+
"str-chat__message--highlighted": h,
|
|
1625
|
+
"str-chat__message--pinned pinned-message": a.pinned,
|
|
1626
|
+
"str-chat__message--with-reactions": p,
|
|
1627
|
+
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((Pe = a == null ? void 0 : a.error) == null ? void 0 : Pe.status) !== 403,
|
|
1628
|
+
"str-chat__message-with-thread-link": Y || ae,
|
|
1629
|
+
"str-chat__virtual-message__wrapper--end": o,
|
|
1630
|
+
"str-chat__virtual-message__wrapper--first": l,
|
|
1631
|
+
"str-chat__virtual-message__wrapper--group": i
|
|
1632
|
+
}
|
|
1633
|
+
), ue = a.poll_id && C.polls.fromState(a.poll_id), we = Js(a), Z = ge(a), B = Zs(a), X = !!(j != null && j.length && !a.quoted_message), Q = Z && ie && X;
|
|
1634
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
1635
|
+
r && /* @__PURE__ */ e(
|
|
1636
|
+
H,
|
|
1637
|
+
{
|
|
1638
|
+
additionalMessageInputProps: s
|
|
1639
|
+
}
|
|
1640
|
+
),
|
|
1641
|
+
U && /* @__PURE__ */ e(
|
|
1642
|
+
ts,
|
|
1643
|
+
{
|
|
1644
|
+
MessageBouncePrompt: z,
|
|
1645
|
+
onClose: () => k(!1),
|
|
1646
|
+
open: U
|
|
1647
|
+
}
|
|
1648
|
+
),
|
|
1649
|
+
/* @__PURE__ */ d("div", { className: ve, children: [
|
|
1650
|
+
W && /* @__PURE__ */ e(W, {}),
|
|
1651
|
+
!!T && /* @__PURE__ */ e(ee, { reminder: T }),
|
|
1652
|
+
a.user && /* @__PURE__ */ e(
|
|
1653
|
+
ne,
|
|
1654
|
+
{
|
|
1655
|
+
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1656
|
+
id: a.user.id,
|
|
1657
|
+
image: a.user.image,
|
|
1658
|
+
name: a.user.name || a.user.id,
|
|
1659
|
+
size: Z ? 24 : 28,
|
|
1660
|
+
shape: "circle",
|
|
1661
|
+
dmAgentEnabled: Z
|
|
1662
|
+
}
|
|
1663
|
+
),
|
|
1664
|
+
/* @__PURE__ */ e(
|
|
1665
|
+
"div",
|
|
1666
|
+
{
|
|
1667
|
+
className: D("str-chat__message-inner", {
|
|
1668
|
+
"str-chat__simple-message--error-failed": de || re
|
|
1669
|
+
}),
|
|
1670
|
+
"data-testid": "message-inner",
|
|
1671
|
+
onClick: q,
|
|
1672
|
+
onKeyDown: q,
|
|
1673
|
+
role: q ? "button" : void 0,
|
|
1674
|
+
tabIndex: q ? 0 : void 0,
|
|
1675
|
+
style: {
|
|
1676
|
+
// Force margins to 0 to prevent hover layout shift
|
|
1677
|
+
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1678
|
+
marginInlineEnd: 0,
|
|
1679
|
+
marginInlineStart: 0
|
|
1680
|
+
},
|
|
1681
|
+
children: B ? /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1682
|
+
ie ? /* @__PURE__ */ e(
|
|
1683
|
+
ot.Creator,
|
|
1684
|
+
{
|
|
1685
|
+
title: (Ue = a.metadata) == null ? void 0 : Ue.attachment_title,
|
|
1686
|
+
mimeType: (ze = a.metadata) == null ? void 0 : ze.attachment_mime_type,
|
|
1687
|
+
thumbnailUrl: (Be = a.metadata) == null ? void 0 : Be.attachment_thumbnail,
|
|
1688
|
+
amountText: ($e = a.metadata) == null ? void 0 : $e.amount_text,
|
|
1689
|
+
detail: (je = a.metadata) == null ? void 0 : je.attachment_detail,
|
|
1690
|
+
paymentStatus: (Ge = a.metadata) == null ? void 0 : Ge.payment_status,
|
|
1691
|
+
isUnlocking: I(a.id),
|
|
1692
|
+
onPreviewClick: () => w == null ? void 0 : w(a, x),
|
|
1693
|
+
onFetchSource: async () => await (E == null ? void 0 : E(a, x))
|
|
1694
|
+
}
|
|
1695
|
+
) : /* @__PURE__ */ e(
|
|
1696
|
+
ot.Visitor,
|
|
1697
|
+
{
|
|
1698
|
+
title: (Ve = a.metadata) == null ? void 0 : Ve.attachment_title,
|
|
1699
|
+
mimeType: (He = a.metadata) == null ? void 0 : He.attachment_mime_type,
|
|
1700
|
+
thumbnailUrl: (Ye = a.metadata) == null ? void 0 : Ye.attachment_thumbnail,
|
|
1701
|
+
amountText: (We = a.metadata) == null ? void 0 : We.amount_text,
|
|
1702
|
+
detail: (qe = a.metadata) == null ? void 0 : qe.attachment_detail,
|
|
1703
|
+
paymentStatus: (Xe = a.metadata) == null ? void 0 : Xe.payment_status,
|
|
1704
|
+
isUnlocking: I(a.id),
|
|
1705
|
+
onUnlockClick: () => w == null ? void 0 : w(a, x),
|
|
1706
|
+
onFetchSource: async () => await (E == null ? void 0 : E(a, x)),
|
|
1707
|
+
onDownloadClick: () => P == null ? void 0 : P(a, x)
|
|
1708
|
+
}
|
|
1709
|
+
),
|
|
1710
|
+
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Qe, { message: a, renderText: N }) })
|
|
1711
|
+
] }) : we ? (
|
|
1712
|
+
/* Tip-only messages render as a standalone bubble */
|
|
1713
|
+
/* @__PURE__ */ e(Ne, { message: a, standalone: !0 })
|
|
1714
|
+
) : /* @__PURE__ */ d("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1715
|
+
/* @__PURE__ */ d("div", { className: "str-chat__message-bubble", children: [
|
|
1716
|
+
Z && !Q && /* @__PURE__ */ e(
|
|
1717
|
+
Ne,
|
|
1718
|
+
{
|
|
1719
|
+
message: a,
|
|
1720
|
+
hasAttachment: X,
|
|
1721
|
+
isMyMessage: ie
|
|
1722
|
+
}
|
|
1723
|
+
),
|
|
1724
|
+
ue && /* @__PURE__ */ e(ss, { poll: ue }),
|
|
1725
|
+
j != null && j.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1726
|
+
F,
|
|
1727
|
+
{
|
|
1728
|
+
actionHandler: c,
|
|
1729
|
+
attachments: j
|
|
1730
|
+
}
|
|
1731
|
+
) : null,
|
|
1732
|
+
L ? /* @__PURE__ */ e(
|
|
1733
|
+
te,
|
|
1734
|
+
{
|
|
1735
|
+
message: a,
|
|
1736
|
+
renderText: N
|
|
1737
|
+
}
|
|
1738
|
+
) : /* @__PURE__ */ e(Qe, { message: a, renderText: N }),
|
|
1739
|
+
/* @__PURE__ */ e(ns, {})
|
|
1740
|
+
] }),
|
|
1741
|
+
(!Z || Q) && /* @__PURE__ */ e(
|
|
1742
|
+
Ne,
|
|
1743
|
+
{
|
|
1744
|
+
message: a,
|
|
1745
|
+
hasAttachment: X,
|
|
1746
|
+
isMyMessage: ie
|
|
1747
|
+
}
|
|
1748
|
+
),
|
|
1749
|
+
n && Z && /* @__PURE__ */ e(
|
|
1750
|
+
Dn,
|
|
1751
|
+
{
|
|
1752
|
+
selected: M,
|
|
1753
|
+
onVoteUp: y,
|
|
1754
|
+
onVoteDown: _
|
|
1545
1755
|
}
|
|
1546
1756
|
)
|
|
1757
|
+
] })
|
|
1758
|
+
}
|
|
1759
|
+
),
|
|
1760
|
+
Y && /* @__PURE__ */ e(
|
|
1761
|
+
V,
|
|
1762
|
+
{
|
|
1763
|
+
onClick: m,
|
|
1764
|
+
reply_count: a.reply_count
|
|
1765
|
+
}
|
|
1766
|
+
),
|
|
1767
|
+
ae && /* @__PURE__ */ e($, {})
|
|
1768
|
+
] }, a.id)
|
|
1769
|
+
] });
|
|
1770
|
+
}, Ln = O.memo(
|
|
1771
|
+
Rn,
|
|
1772
|
+
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : zt(t, s)
|
|
1773
|
+
), An = (t) => {
|
|
1774
|
+
const s = gt("CustomMessage");
|
|
1775
|
+
return /* @__PURE__ */ e(Ln, { ...s, ...t });
|
|
1776
|
+
}, Fn = (t) => ({
|
|
1777
|
+
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1778
|
+
(s) => rt.previewIsLoaded(s) || rt.previewIsLoading(s)
|
|
1779
|
+
)
|
|
1780
|
+
}), On = ({
|
|
1781
|
+
link: t,
|
|
1782
|
+
onDismiss: s
|
|
1783
|
+
}) => {
|
|
1784
|
+
const { og_scrape_url: n, title: r, image_url: o } = t;
|
|
1785
|
+
return /* @__PURE__ */ d(
|
|
1786
|
+
"a",
|
|
1787
|
+
{
|
|
1788
|
+
href: n,
|
|
1789
|
+
target: "_blank",
|
|
1790
|
+
rel: "noopener noreferrer",
|
|
1791
|
+
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
1792
|
+
children: [
|
|
1793
|
+
o && /* @__PURE__ */ e(
|
|
1794
|
+
"img",
|
|
1795
|
+
{
|
|
1796
|
+
src: o,
|
|
1797
|
+
alt: r || "",
|
|
1798
|
+
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1547
1799
|
}
|
|
1548
1800
|
),
|
|
1549
1801
|
/* @__PURE__ */ e(
|
|
1550
|
-
"button",
|
|
1551
|
-
{
|
|
1552
|
-
className: le,
|
|
1553
|
-
onClick: n,
|
|
1554
|
-
type: "button",
|
|
1555
|
-
"aria-label": "Show info",
|
|
1556
|
-
children: /* @__PURE__ */ e(Qe, { className: "size-5 text-black/90" })
|
|
1557
|
-
}
|
|
1558
|
-
)
|
|
1559
|
-
] })
|
|
1560
|
-
] }),
|
|
1561
|
-
/* @__PURE__ */ d("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1562
|
-
/* @__PURE__ */ d("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1563
|
-
s && t && /* @__PURE__ */ e(
|
|
1564
1802
|
"button",
|
|
1565
1803
|
{
|
|
1566
1804
|
type: "button",
|
|
1567
|
-
onClick:
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
/* @__PURE__ */ e(
|
|
1574
|
-
ne,
|
|
1575
|
-
{
|
|
1576
|
-
id: ((C = c == null ? void 0 : c.user) == null ? void 0 : C.id) || i.id || "unknown",
|
|
1577
|
-
name: m,
|
|
1578
|
-
image: u,
|
|
1579
|
-
starred: o && h,
|
|
1580
|
-
dmAgentEnabled: l,
|
|
1581
|
-
size: 40
|
|
1805
|
+
onClick: (i) => {
|
|
1806
|
+
i.preventDefault(), s(n);
|
|
1807
|
+
},
|
|
1808
|
+
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1809
|
+
"aria-label": "Close link preview",
|
|
1810
|
+
children: /* @__PURE__ */ e(bt, { className: "size-4 text-black/90" })
|
|
1582
1811
|
}
|
|
1583
1812
|
),
|
|
1584
|
-
/* @__PURE__ */ d("div", { className: "
|
|
1585
|
-
r
|
|
1586
|
-
|
|
1587
|
-
{
|
|
1588
|
-
type: "button",
|
|
1589
|
-
onClick: n,
|
|
1590
|
-
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
1591
|
-
"aria-label": `View info for ${m}`,
|
|
1592
|
-
children: [
|
|
1593
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: m }),
|
|
1594
|
-
/* @__PURE__ */ e(Ke, { className: "size-4 shrink-0" })
|
|
1595
|
-
]
|
|
1596
|
-
}
|
|
1597
|
-
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: m }),
|
|
1598
|
-
l && /* @__PURE__ */ d("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
1599
|
-
/* @__PURE__ */ e(Se, { className: "size-3 shrink-0 text-black/55" }),
|
|
1600
|
-
/* @__PURE__ */ e("span", { className: "truncate", children: rt })
|
|
1601
|
-
] })
|
|
1813
|
+
/* @__PURE__ */ d("div", { className: "p-2", children: [
|
|
1814
|
+
r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
|
|
1815
|
+
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1602
1816
|
] })
|
|
1603
|
-
]
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1817
|
+
]
|
|
1818
|
+
}
|
|
1819
|
+
);
|
|
1820
|
+
}, Pn = () => {
|
|
1821
|
+
const { linkPreviewsManager: t } = as(), { linkPreviews: s } = rs(
|
|
1822
|
+
t.state,
|
|
1823
|
+
Fn
|
|
1824
|
+
), n = (o) => {
|
|
1825
|
+
t.dismissPreview(o);
|
|
1826
|
+
};
|
|
1827
|
+
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
|
|
1828
|
+
On,
|
|
1829
|
+
{
|
|
1830
|
+
link: o,
|
|
1831
|
+
onDismiss: n
|
|
1832
|
+
},
|
|
1833
|
+
o.og_scrape_url
|
|
1834
|
+
)) }) : null;
|
|
1835
|
+
}, Un = ({ sendMessage: t, disabled: s, ...n }) => /* @__PURE__ */ e(
|
|
1836
|
+
"button",
|
|
1837
|
+
{
|
|
1838
|
+
...n,
|
|
1839
|
+
type: "button",
|
|
1840
|
+
"aria-label": "Send",
|
|
1841
|
+
disabled: s,
|
|
1842
|
+
onClick: t,
|
|
1843
|
+
children: /* @__PURE__ */ e(Ps, { weight: "bold", className: "size-4" })
|
|
1844
|
+
}
|
|
1845
|
+
), zn = () => {
|
|
1846
|
+
var c;
|
|
1847
|
+
const { channel: t } = oe(), s = ((c = t == null ? void 0 : t.data) == null ? void 0 : c.frozen) === !0, { handleSubmit: n } = os(), { SendButton: r } = ft(
|
|
1848
|
+
"CustomMessageInput"
|
|
1849
|
+
), o = r ?? Un, l = ls();
|
|
1850
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
1851
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(cs, {}) }),
|
|
1852
|
+
/* @__PURE__ */ d("div", { className: "central-container min-w-0 w-full 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)]", children: [
|
|
1853
|
+
/* @__PURE__ */ e(ds, {}),
|
|
1854
|
+
/* @__PURE__ */ e(Pn, {}),
|
|
1855
|
+
/* @__PURE__ */ e(us, {}),
|
|
1856
|
+
/* @__PURE__ */ d("div", { className: "flex", children: [
|
|
1857
|
+
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1858
|
+
ms,
|
|
1859
|
+
{
|
|
1860
|
+
"aria-disabled": s || void 0,
|
|
1861
|
+
className: "w-full resize-none outline-none leading-6",
|
|
1862
|
+
autoFocus: !s,
|
|
1863
|
+
maxRows: 4,
|
|
1864
|
+
readOnly: s,
|
|
1865
|
+
tabIndex: s ? -1 : void 0
|
|
1622
1866
|
}
|
|
1623
|
-
),
|
|
1624
|
-
|
|
1625
|
-
|
|
1867
|
+
) }),
|
|
1868
|
+
/* @__PURE__ */ e(
|
|
1869
|
+
o,
|
|
1626
1870
|
{
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
"
|
|
1631
|
-
|
|
1871
|
+
sendMessage: n,
|
|
1872
|
+
"aria-label": "Send",
|
|
1873
|
+
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1874
|
+
"data-testid": "send-button",
|
|
1875
|
+
disabled: s || !l,
|
|
1876
|
+
type: "button"
|
|
1632
1877
|
}
|
|
1633
1878
|
)
|
|
1634
1879
|
] })
|
|
1635
1880
|
] })
|
|
1636
1881
|
] });
|
|
1637
|
-
},
|
|
1638
|
-
|
|
1639
|
-
showBackButton: s,
|
|
1640
|
-
renderMessageInputActions: n,
|
|
1641
|
-
renderConversationFooter: r,
|
|
1642
|
-
onLeaveConversation: o,
|
|
1643
|
-
onBlockParticipant: l,
|
|
1644
|
-
showDeleteConversation: i = !0,
|
|
1645
|
-
onDeleteConversationClick: c,
|
|
1646
|
-
onBlockParticipantClick: m,
|
|
1647
|
-
onReportParticipantClick: u,
|
|
1648
|
-
showStarButton: h = !1,
|
|
1649
|
-
chatbotVotingEnabled: f = !1,
|
|
1650
|
-
renderChannelBanner: v,
|
|
1651
|
-
customProfileContent: a,
|
|
1652
|
-
customChannelActions: N,
|
|
1653
|
-
renderMessage: b,
|
|
1654
|
-
dmAgentEnabled: C = !1
|
|
1882
|
+
}, Bn = ({
|
|
1883
|
+
renderActions: t
|
|
1655
1884
|
}) => {
|
|
1656
|
-
var
|
|
1657
|
-
const { channel:
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1885
|
+
var r;
|
|
1886
|
+
const { channel: s } = oe(), n = ((r = s == null ? void 0 : s.data) == null ? void 0 : r.frozen) === !0;
|
|
1887
|
+
return /* @__PURE__ */ d(
|
|
1888
|
+
"div",
|
|
1889
|
+
{
|
|
1890
|
+
inert: n ? "" : void 0,
|
|
1891
|
+
"aria-disabled": n || void 0,
|
|
1892
|
+
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1893
|
+
children: [
|
|
1894
|
+
t == null ? void 0 : t(),
|
|
1895
|
+
/* @__PURE__ */ e(is, { Input: zn })
|
|
1896
|
+
]
|
|
1661
1897
|
}
|
|
1662
|
-
), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((z) => {
|
|
1663
|
-
var S;
|
|
1664
|
-
return ((S = z.user) == null ? void 0 : S.id) === x._client.userID;
|
|
1665
|
-
}), [x._client.userID, x.state.members]), P = ((F = E == null ? void 0 : E.user) == null ? void 0 : F.is_account) ?? (E == null ? void 0 : E.is_account), U = ((H = w == null ? void 0 : w.user) == null ? void 0 : H.is_account) ?? (w == null ? void 0 : w.is_account), k = C && P === !1 && U === !0, T = O.useMemo(() => {
|
|
1666
|
-
const R = x.data ?? {};
|
|
1667
|
-
if (R.followerStatus)
|
|
1668
|
-
return String(R.followerStatus);
|
|
1669
|
-
if (R.isFollower !== void 0)
|
|
1670
|
-
return R.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1671
|
-
}, [x.data]), M = G(() => {
|
|
1672
|
-
var R;
|
|
1673
|
-
(R = I.current) == null || R.showModal();
|
|
1674
|
-
}, []), y = G(() => {
|
|
1675
|
-
var R;
|
|
1676
|
-
(R = I.current) == null || R.close();
|
|
1677
|
-
}, []), _ = G(
|
|
1678
|
-
(R) => {
|
|
1679
|
-
const { message: z } = ut("ChannelView"), S = /* @__PURE__ */ e(un, { ...R, chatbotVotingEnabled: f });
|
|
1680
|
-
return !b || !z ? S : b(S, z);
|
|
1681
|
-
},
|
|
1682
|
-
[f, b]
|
|
1683
1898
|
);
|
|
1899
|
+
}, $n = [
|
|
1900
|
+
"SYSTEM_DM_AGENT_PAUSED",
|
|
1901
|
+
"SYSTEM_DM_AGENT_RESUMED"
|
|
1902
|
+
], jn = {
|
|
1903
|
+
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1904
|
+
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1905
|
+
}, Gn = [
|
|
1906
|
+
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1907
|
+
], Vn = {
|
|
1908
|
+
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1909
|
+
}, Ce = "age safety guidelines.", Hn = "https://linktr.ee/s/about/contact", ct = (t) => $n.includes(t), Yn = (t) => Gn.includes(t), Wn = (t) => {
|
|
1910
|
+
var r;
|
|
1911
|
+
const s = (r = t.metadata) == null ? void 0 : r.custom_type;
|
|
1912
|
+
if (ct(s))
|
|
1913
|
+
return {
|
|
1914
|
+
kind: "dm-agent",
|
|
1915
|
+
type: s
|
|
1916
|
+
};
|
|
1917
|
+
if (Yn(s))
|
|
1918
|
+
return {
|
|
1919
|
+
kind: "age-safety",
|
|
1920
|
+
type: s
|
|
1921
|
+
};
|
|
1922
|
+
const n = t.dm_agent_system_type;
|
|
1923
|
+
if (ct(n))
|
|
1924
|
+
return {
|
|
1925
|
+
kind: "dm-agent",
|
|
1926
|
+
type: n
|
|
1927
|
+
};
|
|
1928
|
+
}, qn = (t) => {
|
|
1929
|
+
const s = t.indexOf(Ce);
|
|
1930
|
+
if (s === -1)
|
|
1931
|
+
return t;
|
|
1932
|
+
const n = s + Ce.length;
|
|
1684
1933
|
return /* @__PURE__ */ d(ce, { children: [
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1934
|
+
t.slice(0, s),
|
|
1935
|
+
/* @__PURE__ */ e(
|
|
1936
|
+
"a",
|
|
1937
|
+
{
|
|
1938
|
+
href: Hn,
|
|
1939
|
+
target: "_blank",
|
|
1940
|
+
rel: "noopener noreferrer",
|
|
1941
|
+
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1942
|
+
children: Ce
|
|
1943
|
+
}
|
|
1944
|
+
),
|
|
1945
|
+
t.slice(n)
|
|
1946
|
+
] });
|
|
1947
|
+
}, Xn = (t) => {
|
|
1948
|
+
var r, o;
|
|
1949
|
+
const s = t.message.hide_date === !0, n = Wn(
|
|
1950
|
+
t.message
|
|
1951
|
+
);
|
|
1952
|
+
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1953
|
+
const l = ((r = t.message.text) == null ? void 0 : r.trim()) || jn[n.type];
|
|
1954
|
+
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1955
|
+
/* @__PURE__ */ d(
|
|
1956
|
+
"div",
|
|
1700
1957
|
{
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1958
|
+
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
1959
|
+
"data-testid": "dm-agent-system-message",
|
|
1960
|
+
"data-dm-agent-system-type": n.type,
|
|
1961
|
+
children: [
|
|
1962
|
+
/* @__PURE__ */ e(
|
|
1963
|
+
ke,
|
|
1964
|
+
{
|
|
1965
|
+
size: 16,
|
|
1966
|
+
weight: "regular",
|
|
1967
|
+
"aria-hidden": !0,
|
|
1968
|
+
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1969
|
+
}
|
|
1970
|
+
),
|
|
1971
|
+
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: l })
|
|
1972
|
+
]
|
|
1704
1973
|
}
|
|
1705
|
-
)
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1974
|
+
),
|
|
1975
|
+
!s && /* @__PURE__ */ e(_e, { message: t.message })
|
|
1976
|
+
] });
|
|
1977
|
+
}
|
|
1978
|
+
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1979
|
+
const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Vn[n.type];
|
|
1980
|
+
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1981
|
+
/* @__PURE__ */ d(
|
|
1982
|
+
"div",
|
|
1709
1983
|
{
|
|
1710
|
-
|
|
1984
|
+
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1985
|
+
"data-testid": "age-safety-system-message",
|
|
1986
|
+
"data-age-safety-system-type": n.type,
|
|
1987
|
+
children: [
|
|
1988
|
+
/* @__PURE__ */ e(
|
|
1989
|
+
Us,
|
|
1990
|
+
{
|
|
1991
|
+
size: 24,
|
|
1992
|
+
weight: "duotone",
|
|
1993
|
+
"aria-hidden": !0,
|
|
1994
|
+
className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1995
|
+
"data-testid": "age-safety-system-message-icon"
|
|
1996
|
+
}
|
|
1997
|
+
),
|
|
1998
|
+
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("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: qn(l) }) })
|
|
1999
|
+
]
|
|
1711
2000
|
}
|
|
1712
|
-
)
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
onBlockParticipant: l,
|
|
1724
|
-
showDeleteConversation: i,
|
|
1725
|
-
onDeleteConversationClick: c,
|
|
1726
|
-
onBlockParticipantClick: m,
|
|
1727
|
-
onReportParticipantClick: u,
|
|
1728
|
-
customProfileContent: a,
|
|
1729
|
-
customChannelActions: N
|
|
1730
|
-
}
|
|
1731
|
-
)
|
|
2001
|
+
),
|
|
2002
|
+
!s && /* @__PURE__ */ e(_e, { message: t.message })
|
|
2003
|
+
] });
|
|
2004
|
+
}
|
|
2005
|
+
return /* @__PURE__ */ d("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
2006
|
+
/* @__PURE__ */ d("div", { className: "str-chat__message--system__text", children: [
|
|
2007
|
+
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
2008
|
+
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
2009
|
+
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
2010
|
+
] }),
|
|
2011
|
+
!s && /* @__PURE__ */ e(_e, { message: t.message })
|
|
1732
2012
|
] });
|
|
1733
|
-
},
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
2013
|
+
}, Ee = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
|
|
2014
|
+
"animateTransform",
|
|
2015
|
+
{
|
|
2016
|
+
attributeName: "transform",
|
|
2017
|
+
type: "translate",
|
|
2018
|
+
values: "0 0; 0 -2.25; 0 0;",
|
|
2019
|
+
dur: "900ms",
|
|
2020
|
+
begin: `${120 * s}ms`,
|
|
2021
|
+
repeatCount: "indefinite"
|
|
2022
|
+
}
|
|
2023
|
+
) }), Zn = ({ threadList: t }) => {
|
|
2024
|
+
var N;
|
|
2025
|
+
const { channel: s, channelConfig: n, thread: r } = oe(), { client: o } = De(), { typing: l = {} } = hs();
|
|
2026
|
+
if ((n == null ? void 0 : n.typing_events) === !1)
|
|
2027
|
+
return null;
|
|
2028
|
+
const i = t ? [] : Object.values(l).filter(
|
|
2029
|
+
({ parent_id: b, user: C }) => {
|
|
2030
|
+
var x;
|
|
2031
|
+
return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && !b;
|
|
2032
|
+
}
|
|
2033
|
+
), c = t ? Object.values(l).filter(
|
|
2034
|
+
({ parent_id: b, user: C }) => {
|
|
2035
|
+
var x;
|
|
2036
|
+
return (C == null ? void 0 : C.id) !== ((x = o.user) == null ? void 0 : x.id) && b === (r == null ? void 0 : r.id);
|
|
2037
|
+
}
|
|
2038
|
+
) : [], m = t ? c : i;
|
|
2039
|
+
if (!m.length)
|
|
2040
|
+
return null;
|
|
2041
|
+
const u = (N = m[0]) == null ? void 0 : N.user, h = u != null && u.id && s.state.members[u.id] ? s.state.members[u.id].user : void 0, f = (u == null ? void 0 : u.id) ?? (h == null ? void 0 : h.id) ?? "typing-user", v = (u == null ? void 0 : u.name) ?? (h == null ? void 0 : h.name) ?? (u == null ? void 0 : u.id) ?? "Typing user", a = (u == null ? void 0 : u.image) ?? (h == null ? void 0 : h.image);
|
|
2042
|
+
return /* @__PURE__ */ d(
|
|
2043
|
+
"div",
|
|
2044
|
+
{
|
|
2045
|
+
className: "str-chat__typing-indicator !items-end !bg-transparent",
|
|
2046
|
+
"data-testid": "typing-indicator",
|
|
2047
|
+
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
2048
|
+
children: [
|
|
2049
|
+
/* @__PURE__ */ e("div", { className: "shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
2050
|
+
ne,
|
|
2051
|
+
{
|
|
2052
|
+
id: f,
|
|
2053
|
+
name: v,
|
|
2054
|
+
image: a,
|
|
2055
|
+
size: 24,
|
|
2056
|
+
shape: "circle"
|
|
1770
2057
|
}
|
|
1771
|
-
},
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
}, z = await t.sendMessage(H, R);
|
|
1775
|
-
return b == null || b(z), z;
|
|
1776
|
-
},
|
|
1777
|
-
[t, a, N, b]
|
|
1778
|
-
);
|
|
1779
|
-
return /* @__PURE__ */ e(
|
|
1780
|
-
"div",
|
|
1781
|
-
{
|
|
1782
|
-
className: D(
|
|
1783
|
-
"messaging-channel-view h-full flex flex-col",
|
|
1784
|
-
c
|
|
1785
|
-
),
|
|
1786
|
-
children: /* @__PURE__ */ e(
|
|
1787
|
-
cs,
|
|
2058
|
+
) }),
|
|
2059
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 rounded-lg bg-[#E9EAED] h-12 flex flex-col justify-end", children: /* @__PURE__ */ d(
|
|
2060
|
+
"svg",
|
|
1788
2061
|
{
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
onBack: s,
|
|
1801
|
-
showBackButton: n,
|
|
1802
|
-
renderMessageInputActions: r,
|
|
1803
|
-
renderConversationFooter: o,
|
|
1804
|
-
onLeaveConversation: l,
|
|
1805
|
-
onBlockParticipant: i,
|
|
1806
|
-
CustomChannelEmptyState: m,
|
|
1807
|
-
showDeleteConversation: u,
|
|
1808
|
-
onDeleteConversationClick: h,
|
|
1809
|
-
onBlockParticipantClick: f,
|
|
1810
|
-
onReportParticipantClick: v,
|
|
1811
|
-
showStarButton: C,
|
|
1812
|
-
dmAgentEnabled: a,
|
|
1813
|
-
chatbotVotingEnabled: x,
|
|
1814
|
-
renderChannelBanner: I,
|
|
1815
|
-
customProfileContent: w,
|
|
1816
|
-
customChannelActions: E,
|
|
1817
|
-
renderMessage: P
|
|
1818
|
-
}
|
|
1819
|
-
)
|
|
2062
|
+
"aria-hidden": "true",
|
|
2063
|
+
className: "block overflow-visible mb-[0.2rem]",
|
|
2064
|
+
viewBox: "0 0 32 8",
|
|
2065
|
+
width: "32",
|
|
2066
|
+
height: "8",
|
|
2067
|
+
overflow: "visible",
|
|
2068
|
+
children: [
|
|
2069
|
+
/* @__PURE__ */ e(Ee, { cx: "4", index: 0 }),
|
|
2070
|
+
/* @__PURE__ */ e(Ee, { cx: "16", index: 1 }),
|
|
2071
|
+
/* @__PURE__ */ e(Ee, { cx: "28", index: 2 })
|
|
2072
|
+
]
|
|
1820
2073
|
}
|
|
1821
|
-
)
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
)
|
|
1826
|
-
|
|
1827
|
-
const Rn = ({ className: t }) => /* @__PURE__ */ d(
|
|
1828
|
-
"svg",
|
|
2074
|
+
) })
|
|
2075
|
+
]
|
|
2076
|
+
}
|
|
2077
|
+
);
|
|
2078
|
+
}, Jn = () => null, Kn = ({ className: t, message: s }) => /* @__PURE__ */ d(
|
|
2079
|
+
"div",
|
|
1829
2080
|
{
|
|
1830
|
-
|
|
1831
|
-
height: "120",
|
|
1832
|
-
viewBox: "44 -2 144 126",
|
|
1833
|
-
fill: "none",
|
|
1834
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1835
|
-
className: t,
|
|
2081
|
+
className: D("flex items-center justify-center h-full", t),
|
|
1836
2082
|
children: [
|
|
1837
|
-
/* @__PURE__ */ d("
|
|
1838
|
-
/* @__PURE__ */ e(
|
|
1839
|
-
"
|
|
2083
|
+
/* @__PURE__ */ d("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2084
|
+
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
2085
|
+
"animateTransform",
|
|
1840
2086
|
{
|
|
1841
|
-
|
|
1842
|
-
|
|
2087
|
+
attributeName: "transform",
|
|
2088
|
+
dur: "1s",
|
|
2089
|
+
type: "translate",
|
|
2090
|
+
values: "0 15 ; 0 -15; 0 15",
|
|
2091
|
+
repeatCount: "indefinite",
|
|
2092
|
+
begin: "0.1"
|
|
1843
2093
|
}
|
|
1844
|
-
),
|
|
1845
|
-
/* @__PURE__ */ e(
|
|
1846
|
-
"
|
|
2094
|
+
) }),
|
|
2095
|
+
/* @__PURE__ */ e("circle", { cx: "30", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
2096
|
+
"animateTransform",
|
|
1847
2097
|
{
|
|
1848
|
-
|
|
1849
|
-
|
|
2098
|
+
attributeName: "transform",
|
|
2099
|
+
dur: "1s",
|
|
2100
|
+
type: "translate",
|
|
2101
|
+
values: "0 10 ; 0 -10; 0 10",
|
|
2102
|
+
repeatCount: "indefinite",
|
|
2103
|
+
begin: "0.2"
|
|
1850
2104
|
}
|
|
1851
|
-
),
|
|
1852
|
-
/* @__PURE__ */ e(
|
|
1853
|
-
"
|
|
2105
|
+
) }),
|
|
2106
|
+
/* @__PURE__ */ e("circle", { cx: "54", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
2107
|
+
"animateTransform",
|
|
1854
2108
|
{
|
|
1855
|
-
|
|
1856
|
-
|
|
2109
|
+
attributeName: "transform",
|
|
2110
|
+
dur: "1s",
|
|
2111
|
+
type: "translate",
|
|
2112
|
+
values: "0 5 ; 0 -5; 0 5",
|
|
2113
|
+
repeatCount: "indefinite",
|
|
2114
|
+
begin: "0.3"
|
|
1857
2115
|
}
|
|
1858
|
-
)
|
|
2116
|
+
) })
|
|
2117
|
+
] }),
|
|
2118
|
+
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
2119
|
+
]
|
|
2120
|
+
}
|
|
2121
|
+
), pe = O.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ d("div", { className: "flex items-center", children: [
|
|
2122
|
+
/* @__PURE__ */ e(Kn, { className: "w-6 h-6" }),
|
|
2123
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2124
|
+
] }) }));
|
|
2125
|
+
pe.displayName = "LoadingState";
|
|
2126
|
+
const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", dt = "Replies instantly with AI assistant", Qn = ({
|
|
2127
|
+
onBack: t,
|
|
2128
|
+
showBackButton: s,
|
|
2129
|
+
onShowInfo: n,
|
|
2130
|
+
canShowInfo: r,
|
|
2131
|
+
showStarButton: o = !1,
|
|
2132
|
+
dmAgentEnabled: l = !1
|
|
2133
|
+
}) => {
|
|
2134
|
+
var v, a, N, b, C;
|
|
2135
|
+
const { channel: i } = oe(), c = O.useMemo(() => Object.values(i.state.members || {}).find(
|
|
2136
|
+
(I) => {
|
|
2137
|
+
var w;
|
|
2138
|
+
return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== i._client.userID;
|
|
2139
|
+
}
|
|
2140
|
+
), [i._client.userID, i.state.members]), m = ((v = c == null ? void 0 : c.user) == null ? void 0 : v.name) || ((a = c == null ? void 0 : c.user) == null ? void 0 : a.id) || "Unknown member", u = (N = c == null ? void 0 : c.user) == null ? void 0 : N.image, h = _t(i), f = async () => {
|
|
2141
|
+
try {
|
|
2142
|
+
h ? await i.unpin() : await i.pin();
|
|
2143
|
+
} catch (x) {
|
|
2144
|
+
console.error(
|
|
2145
|
+
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2146
|
+
x
|
|
2147
|
+
);
|
|
2148
|
+
}
|
|
2149
|
+
};
|
|
2150
|
+
return /* @__PURE__ */ d("div", { className: "@container", children: [
|
|
2151
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
2152
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
2153
|
+
"button",
|
|
2154
|
+
{
|
|
2155
|
+
className: le,
|
|
2156
|
+
onClick: t || (() => {
|
|
2157
|
+
}),
|
|
2158
|
+
type: "button",
|
|
2159
|
+
"aria-label": "Back to conversations",
|
|
2160
|
+
children: /* @__PURE__ */ e(st, { className: "size-5 text-black/90" })
|
|
2161
|
+
}
|
|
2162
|
+
) }),
|
|
2163
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1859
2164
|
/* @__PURE__ */ e(
|
|
1860
|
-
|
|
2165
|
+
ne,
|
|
1861
2166
|
{
|
|
1862
|
-
|
|
1863
|
-
|
|
2167
|
+
id: ((b = c == null ? void 0 : c.user) == null ? void 0 : b.id) || i.id || "unknown",
|
|
2168
|
+
name: m,
|
|
2169
|
+
image: u,
|
|
2170
|
+
starred: o && h,
|
|
2171
|
+
dmAgentEnabled: l,
|
|
2172
|
+
size: 40
|
|
1864
2173
|
}
|
|
1865
2174
|
),
|
|
1866
|
-
/* @__PURE__ */ d(
|
|
1867
|
-
|
|
1868
|
-
"path",
|
|
1869
|
-
{
|
|
1870
|
-
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
1871
|
-
fill: "white"
|
|
1872
|
-
}
|
|
1873
|
-
),
|
|
1874
|
-
/* @__PURE__ */ e(
|
|
1875
|
-
"path",
|
|
1876
|
-
{
|
|
1877
|
-
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
1878
|
-
stroke: "#D7D4CE",
|
|
1879
|
-
strokeWidth: "2",
|
|
1880
|
-
strokeMiterlimit: "10"
|
|
1881
|
-
}
|
|
1882
|
-
)
|
|
1883
|
-
] }),
|
|
1884
|
-
/* @__PURE__ */ e(
|
|
1885
|
-
"path",
|
|
2175
|
+
/* @__PURE__ */ d(
|
|
2176
|
+
"button",
|
|
1886
2177
|
{
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
2178
|
+
type: "button",
|
|
2179
|
+
onClick: n,
|
|
2180
|
+
className: "flex items-center gap-0.5 rounded-full bg-black/[0.05] px-3 py-1 text-xs font-medium text-black/90 hover:bg-black/[0.08] transition-colors",
|
|
2181
|
+
"aria-label": `View info for ${m}`,
|
|
2182
|
+
children: [
|
|
2183
|
+
m,
|
|
2184
|
+
/* @__PURE__ */ e(nt, { className: "size-3 shrink-0" })
|
|
2185
|
+
]
|
|
2186
|
+
}
|
|
2187
|
+
),
|
|
2188
|
+
l && /* @__PURE__ */ d("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2189
|
+
/* @__PURE__ */ e(ke, { className: "size-3 shrink-0 text-black/55" }),
|
|
2190
|
+
/* @__PURE__ */ e("span", { children: dt })
|
|
2191
|
+
] })
|
|
2192
|
+
] }),
|
|
2193
|
+
/* @__PURE__ */ d("div", { className: "flex justify-end items-center gap-2", children: [
|
|
2194
|
+
o && /* @__PURE__ */ e(
|
|
2195
|
+
"button",
|
|
1893
2196
|
{
|
|
1894
|
-
|
|
1895
|
-
|
|
2197
|
+
className: le,
|
|
2198
|
+
onClick: f,
|
|
2199
|
+
type: "button",
|
|
2200
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
2201
|
+
children: /* @__PURE__ */ e(
|
|
2202
|
+
Ie,
|
|
2203
|
+
{
|
|
2204
|
+
className: D("size-5", {
|
|
2205
|
+
"text-yellow-600": h,
|
|
2206
|
+
"text-black/90": !h
|
|
2207
|
+
}),
|
|
2208
|
+
weight: h ? "duotone" : "regular"
|
|
2209
|
+
}
|
|
2210
|
+
)
|
|
1896
2211
|
}
|
|
1897
2212
|
),
|
|
1898
2213
|
/* @__PURE__ */ e(
|
|
1899
|
-
"
|
|
2214
|
+
"button",
|
|
1900
2215
|
{
|
|
1901
|
-
|
|
1902
|
-
|
|
2216
|
+
className: le,
|
|
2217
|
+
onClick: n,
|
|
2218
|
+
type: "button",
|
|
2219
|
+
"aria-label": "Show info",
|
|
2220
|
+
children: /* @__PURE__ */ e(at, { className: "size-5 text-black/90" })
|
|
1903
2221
|
}
|
|
1904
2222
|
)
|
|
2223
|
+
] })
|
|
2224
|
+
] }),
|
|
2225
|
+
/* @__PURE__ */ d("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
2226
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
2227
|
+
s && t && /* @__PURE__ */ e(
|
|
2228
|
+
"button",
|
|
2229
|
+
{
|
|
2230
|
+
type: "button",
|
|
2231
|
+
onClick: t,
|
|
2232
|
+
className: le,
|
|
2233
|
+
"aria-label": "Back to conversations",
|
|
2234
|
+
children: /* @__PURE__ */ e(st, { className: "size-5 text-black/90" })
|
|
2235
|
+
}
|
|
2236
|
+
),
|
|
2237
|
+
/* @__PURE__ */ e(
|
|
2238
|
+
ne,
|
|
2239
|
+
{
|
|
2240
|
+
id: ((C = c == null ? void 0 : c.user) == null ? void 0 : C.id) || i.id || "unknown",
|
|
2241
|
+
name: m,
|
|
2242
|
+
image: u,
|
|
2243
|
+
starred: o && h,
|
|
2244
|
+
dmAgentEnabled: l,
|
|
2245
|
+
size: 40
|
|
2246
|
+
}
|
|
2247
|
+
),
|
|
2248
|
+
/* @__PURE__ */ d("div", { className: "min-w-0", children: [
|
|
2249
|
+
r ? /* @__PURE__ */ d(
|
|
2250
|
+
"button",
|
|
2251
|
+
{
|
|
2252
|
+
type: "button",
|
|
2253
|
+
onClick: n,
|
|
2254
|
+
className: "flex items-center gap-1 font-medium text-black/90 truncate hover:text-black/70 transition-colors",
|
|
2255
|
+
"aria-label": `View info for ${m}`,
|
|
2256
|
+
children: [
|
|
2257
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: m }),
|
|
2258
|
+
/* @__PURE__ */ e(nt, { className: "size-4 shrink-0" })
|
|
2259
|
+
]
|
|
2260
|
+
}
|
|
2261
|
+
) : /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: m }),
|
|
2262
|
+
l && /* @__PURE__ */ d("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2263
|
+
/* @__PURE__ */ e(ke, { className: "size-3 shrink-0 text-black/55" }),
|
|
2264
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: dt })
|
|
2265
|
+
] })
|
|
2266
|
+
] })
|
|
1905
2267
|
] }),
|
|
1906
|
-
/* @__PURE__ */ d("
|
|
1907
|
-
/* @__PURE__ */
|
|
1908
|
-
"
|
|
2268
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
2269
|
+
o && /* @__PURE__ */ e(
|
|
2270
|
+
"button",
|
|
1909
2271
|
{
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
1925
|
-
result: "hardAlpha"
|
|
1926
|
-
}
|
|
1927
|
-
),
|
|
1928
|
-
/* @__PURE__ */ e("feOffset", { dx: "4", dy: "4" }),
|
|
1929
|
-
/* @__PURE__ */ e("feComposite", { in2: "hardAlpha", operator: "out" }),
|
|
1930
|
-
/* @__PURE__ */ e(
|
|
1931
|
-
"feColorMatrix",
|
|
1932
|
-
{
|
|
1933
|
-
type: "matrix",
|
|
1934
|
-
values: "0 0 0 0 0.8428 0 0 0 0 0.830064 0 0 0 0 0.8095 0 0 0 1 0"
|
|
1935
|
-
}
|
|
1936
|
-
),
|
|
1937
|
-
/* @__PURE__ */ e(
|
|
1938
|
-
"feBlend",
|
|
1939
|
-
{
|
|
1940
|
-
mode: "normal",
|
|
1941
|
-
in2: "BackgroundImageFix",
|
|
1942
|
-
result: "effect1_dropShadow"
|
|
1943
|
-
}
|
|
1944
|
-
),
|
|
1945
|
-
/* @__PURE__ */ e(
|
|
1946
|
-
"feBlend",
|
|
1947
|
-
{
|
|
1948
|
-
mode: "normal",
|
|
1949
|
-
in: "SourceGraphic",
|
|
1950
|
-
in2: "effect1_dropShadow",
|
|
1951
|
-
result: "shape"
|
|
1952
|
-
}
|
|
1953
|
-
)
|
|
1954
|
-
]
|
|
2272
|
+
className: le,
|
|
2273
|
+
onClick: f,
|
|
2274
|
+
type: "button",
|
|
2275
|
+
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
2276
|
+
children: /* @__PURE__ */ e(
|
|
2277
|
+
Ie,
|
|
2278
|
+
{
|
|
2279
|
+
className: D("size-5", {
|
|
2280
|
+
"text-yellow-600": h,
|
|
2281
|
+
"text-black/90": !h
|
|
2282
|
+
}),
|
|
2283
|
+
weight: h ? "duotone" : "regular"
|
|
2284
|
+
}
|
|
2285
|
+
)
|
|
1955
2286
|
}
|
|
1956
2287
|
),
|
|
1957
|
-
|
|
2288
|
+
r && n && /* @__PURE__ */ e(
|
|
2289
|
+
"button",
|
|
2290
|
+
{
|
|
2291
|
+
className: le,
|
|
2292
|
+
onClick: n,
|
|
2293
|
+
type: "button",
|
|
2294
|
+
"aria-label": "Show info",
|
|
2295
|
+
children: /* @__PURE__ */ e(at, { className: "size-5 text-black/90" })
|
|
2296
|
+
}
|
|
2297
|
+
)
|
|
1958
2298
|
] })
|
|
1959
|
-
]
|
|
1960
|
-
}
|
|
1961
|
-
), Ct = O.memo(
|
|
1962
|
-
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
1963
|
-
/* @__PURE__ */ e(Rn, {}),
|
|
1964
|
-
s && !t && /* @__PURE__ */ d("div", { className: "mt-8", children: [
|
|
1965
|
-
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1966
|
-
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1967
2299
|
] })
|
|
1968
|
-
] })
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
1973
|
-
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1974
|
-
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
1975
|
-
s && /* @__PURE__ */ e(
|
|
1976
|
-
"button",
|
|
1977
|
-
{
|
|
1978
|
-
type: "button",
|
|
1979
|
-
onClick: s,
|
|
1980
|
-
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[#7f22fe] hover:bg-primary-alt rounded-lg transition-colors focus-ring",
|
|
1981
|
-
children: "Go Back"
|
|
1982
|
-
}
|
|
1983
|
-
)
|
|
1984
|
-
] }) }));
|
|
1985
|
-
he.displayName = "ErrorState";
|
|
1986
|
-
const oa = ({
|
|
1987
|
-
capabilities: t = {},
|
|
1988
|
-
className: s,
|
|
2300
|
+
] });
|
|
2301
|
+
}, ea = ({
|
|
2302
|
+
onBack: t,
|
|
2303
|
+
showBackButton: s,
|
|
1989
2304
|
renderMessageInputActions: n,
|
|
1990
2305
|
renderConversationFooter: r,
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
onMessageSent: x,
|
|
2005
|
-
showStarButton: I = !1,
|
|
2006
|
-
chatbotVotingEnabled: w = !1,
|
|
2007
|
-
renderMessagePreview: E,
|
|
2008
|
-
renderChannelBanner: P,
|
|
2009
|
-
customProfileContent: U,
|
|
2010
|
-
customChannelActions: k,
|
|
2011
|
-
renderMessage: T,
|
|
2012
|
-
sendButton: M
|
|
2306
|
+
onLeaveConversation: o,
|
|
2307
|
+
onBlockParticipant: l,
|
|
2308
|
+
showDeleteConversation: i = !0,
|
|
2309
|
+
onDeleteConversationClick: c,
|
|
2310
|
+
onBlockParticipantClick: m,
|
|
2311
|
+
onReportParticipantClick: u,
|
|
2312
|
+
showStarButton: h = !1,
|
|
2313
|
+
chatbotVotingEnabled: f = !1,
|
|
2314
|
+
renderChannelBanner: v,
|
|
2315
|
+
customProfileContent: a,
|
|
2316
|
+
customChannelActions: N,
|
|
2317
|
+
renderMessage: b,
|
|
2318
|
+
dmAgentEnabled: C = !1
|
|
2013
2319
|
}) => {
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
error: R,
|
|
2020
|
-
refreshConnection: z,
|
|
2021
|
-
debug: S
|
|
2022
|
-
} = As(), [$, V] = A(null), [ee, te] = A(!1), [q, g] = A(!1), [p, L] = A(!1), [j, Y] = A(null), {
|
|
2023
|
-
showDeleteConversation: ae = !0
|
|
2024
|
-
} = t, de = O.useMemo(() => {
|
|
2025
|
-
const B = _ == null ? void 0 : _.userID;
|
|
2026
|
-
return {
|
|
2027
|
-
...{
|
|
2028
|
-
type: "messaging",
|
|
2029
|
-
last_message_at: { $exists: !0 },
|
|
2030
|
-
...B && {
|
|
2031
|
-
members: { $in: [B] },
|
|
2032
|
-
hidden: !1
|
|
2033
|
-
}
|
|
2034
|
-
},
|
|
2035
|
-
...u
|
|
2036
|
-
};
|
|
2037
|
-
}, [u, _ == null ? void 0 : _.userID]), re = J(null), W = G(async () => {
|
|
2038
|
-
if (!_ || !F) return;
|
|
2039
|
-
const B = _.userID;
|
|
2040
|
-
if (B)
|
|
2041
|
-
try {
|
|
2042
|
-
S && console.log("[MessagingShell] Syncing channels for user:", B);
|
|
2043
|
-
const X = await _.queryChannels(
|
|
2044
|
-
{
|
|
2045
|
-
type: "messaging",
|
|
2046
|
-
members: { $in: [B] }
|
|
2047
|
-
},
|
|
2048
|
-
{},
|
|
2049
|
-
{ limit: 100 }
|
|
2050
|
-
);
|
|
2051
|
-
te(X.length > 0), g(!0), re.current = B, S && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2052
|
-
channelCount: X.length
|
|
2053
|
-
});
|
|
2054
|
-
} catch (X) {
|
|
2055
|
-
console.error("[MessagingShell] Failed to sync channels:", X);
|
|
2056
|
-
}
|
|
2057
|
-
}, [_, F, S]);
|
|
2058
|
-
Z(() => {
|
|
2059
|
-
if (!_ || !F) return;
|
|
2060
|
-
const B = _.userID;
|
|
2061
|
-
B && re.current !== B && W();
|
|
2062
|
-
}, [_, F, W]), Z(() => {
|
|
2063
|
-
if (!l || !_ || !F) return;
|
|
2064
|
-
(async () => {
|
|
2065
|
-
const X = _.userID;
|
|
2066
|
-
if (X)
|
|
2067
|
-
try {
|
|
2068
|
-
S && console.log(
|
|
2069
|
-
"[MessagingShell] Loading initial conversation with:",
|
|
2070
|
-
l
|
|
2071
|
-
);
|
|
2072
|
-
const Q = await _.queryChannels(
|
|
2073
|
-
{
|
|
2074
|
-
type: "messaging",
|
|
2075
|
-
members: { $eq: [X, l] }
|
|
2076
|
-
},
|
|
2077
|
-
{},
|
|
2078
|
-
{ limit: 1 }
|
|
2079
|
-
);
|
|
2080
|
-
if (Q.length > 0)
|
|
2081
|
-
V(Q[0]), L(!0), Y(null), o && o(Q[0]), S && console.log(
|
|
2082
|
-
"[MessagingShell] Initial conversation loaded:",
|
|
2083
|
-
Q[0].id
|
|
2084
|
-
);
|
|
2085
|
-
else if (i && y) {
|
|
2086
|
-
S && console.log(
|
|
2087
|
-
"[MessagingShell] No conversation found, creating one for:",
|
|
2088
|
-
i
|
|
2089
|
-
);
|
|
2090
|
-
try {
|
|
2091
|
-
const se = await y.startChannelWithParticipant({
|
|
2092
|
-
id: i.id,
|
|
2093
|
-
name: i.name,
|
|
2094
|
-
email: i.email,
|
|
2095
|
-
phone: i.phone
|
|
2096
|
-
});
|
|
2097
|
-
V(se), L(!0), Y(null), o && o(se), S && console.log(
|
|
2098
|
-
"[MessagingShell] Channel created and loaded:",
|
|
2099
|
-
se.id
|
|
2100
|
-
);
|
|
2101
|
-
} catch (se) {
|
|
2102
|
-
console.error(
|
|
2103
|
-
"[MessagingShell] Failed to create conversation:",
|
|
2104
|
-
se
|
|
2105
|
-
), Y("Failed to create conversation");
|
|
2106
|
-
}
|
|
2107
|
-
} else
|
|
2108
|
-
Y(
|
|
2109
|
-
"No conversation found with this account"
|
|
2110
|
-
), S && console.log(
|
|
2111
|
-
"[MessagingShell] No conversation found for:",
|
|
2112
|
-
l
|
|
2113
|
-
);
|
|
2114
|
-
} catch (Q) {
|
|
2115
|
-
console.error(
|
|
2116
|
-
"[MessagingShell] Failed to load initial conversation:",
|
|
2117
|
-
Q
|
|
2118
|
-
), Y("Failed to load conversation");
|
|
2119
|
-
}
|
|
2120
|
-
})();
|
|
2121
|
-
}, [
|
|
2122
|
-
l,
|
|
2123
|
-
i,
|
|
2124
|
-
_,
|
|
2125
|
-
F,
|
|
2126
|
-
y,
|
|
2127
|
-
S,
|
|
2128
|
-
o
|
|
2129
|
-
]);
|
|
2130
|
-
const ie = G(
|
|
2131
|
-
(B) => {
|
|
2132
|
-
V(B), o == null || o(B);
|
|
2133
|
-
},
|
|
2134
|
-
[o]
|
|
2135
|
-
), pe = G(() => {
|
|
2136
|
-
p || V(null);
|
|
2137
|
-
}, [p]), ue = G(
|
|
2138
|
-
async (B) => {
|
|
2139
|
-
S && console.log("[MessagingShell] Leaving conversation:", B.id), V(null), L(!1), re.current = null, await W();
|
|
2140
|
-
},
|
|
2141
|
-
[W, S]
|
|
2142
|
-
), xe = G(
|
|
2143
|
-
async (B) => {
|
|
2144
|
-
S && console.log("[MessagingShell] Blocking participant:", B), V(null), L(!1), re.current = null, await W();
|
|
2145
|
-
},
|
|
2146
|
-
[W, S]
|
|
2147
|
-
), K = !!$;
|
|
2148
|
-
return H ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(fe, {}) }) : R ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: R, onBack: z }) }) : !F || !_ ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
2149
|
-
he,
|
|
2150
|
-
{
|
|
2151
|
-
message: "Not connected to messaging service",
|
|
2152
|
-
onBack: z
|
|
2153
|
-
}
|
|
2154
|
-
) }) : j ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, { message: j }) }) : /* @__PURE__ */ e(
|
|
2155
|
-
"div",
|
|
2156
|
-
{
|
|
2157
|
-
className: D(
|
|
2158
|
-
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2159
|
-
s
|
|
2160
|
-
),
|
|
2161
|
-
children: /* @__PURE__ */ d("div", { className: "flex h-full min-h-0", children: [
|
|
2162
|
-
/* @__PURE__ */ e(
|
|
2163
|
-
"div",
|
|
2164
|
-
{
|
|
2165
|
-
className: D(
|
|
2166
|
-
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2167
|
-
{
|
|
2168
|
-
"!hidden": m === !1 || p,
|
|
2169
|
-
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2170
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": m !== !1 && !p && K,
|
|
2171
|
-
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2172
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !p && !K
|
|
2173
|
-
}
|
|
2174
|
-
),
|
|
2175
|
-
children: /* @__PURE__ */ e(
|
|
2176
|
-
wt,
|
|
2177
|
-
{
|
|
2178
|
-
onChannelSelect: ie,
|
|
2179
|
-
selectedChannel: $ || void 0,
|
|
2180
|
-
filters: de,
|
|
2181
|
-
channelRenderFilterFn: h,
|
|
2182
|
-
customEmptyStateIndicator: f,
|
|
2183
|
-
renderMessagePreview: E
|
|
2184
|
-
}
|
|
2185
|
-
)
|
|
2186
|
-
}
|
|
2187
|
-
),
|
|
2188
|
-
/* @__PURE__ */ e(
|
|
2189
|
-
"div",
|
|
2190
|
-
{
|
|
2191
|
-
className: D(
|
|
2192
|
-
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2193
|
-
{
|
|
2194
|
-
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2195
|
-
flex: p || K || l,
|
|
2196
|
-
// Normal mode: hide on mobile when no channel selected
|
|
2197
|
-
"hidden lg:flex": !p && !K && !l
|
|
2198
|
-
}
|
|
2199
|
-
),
|
|
2200
|
-
children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2201
|
-
Nt,
|
|
2202
|
-
{
|
|
2203
|
-
channel: $,
|
|
2204
|
-
onBack: pe,
|
|
2205
|
-
showBackButton: !p,
|
|
2206
|
-
renderMessageInputActions: n,
|
|
2207
|
-
renderConversationFooter: r,
|
|
2208
|
-
renderChannelBanner: P,
|
|
2209
|
-
onLeaveConversation: ue,
|
|
2210
|
-
onBlockParticipant: xe,
|
|
2211
|
-
CustomChannelEmptyState: c,
|
|
2212
|
-
showDeleteConversation: ae,
|
|
2213
|
-
onDeleteConversationClick: v,
|
|
2214
|
-
onBlockParticipantClick: a,
|
|
2215
|
-
onReportParticipantClick: N,
|
|
2216
|
-
dmAgentEnabled: b,
|
|
2217
|
-
messageMetadata: C,
|
|
2218
|
-
onMessageSent: x,
|
|
2219
|
-
showStarButton: I,
|
|
2220
|
-
chatbotVotingEnabled: w,
|
|
2221
|
-
customProfileContent: U,
|
|
2222
|
-
customChannelActions: k,
|
|
2223
|
-
renderMessage: T,
|
|
2224
|
-
sendButton: M
|
|
2225
|
-
},
|
|
2226
|
-
$.id
|
|
2227
|
-
) }) : l ? (
|
|
2228
|
-
// Show loading while creating/loading direct conversation channel
|
|
2229
|
-
/* @__PURE__ */ e(fe, {})
|
|
2230
|
-
) : /* @__PURE__ */ e(
|
|
2231
|
-
Ct,
|
|
2232
|
-
{
|
|
2233
|
-
hasChannels: ee,
|
|
2234
|
-
channelsLoaded: q
|
|
2235
|
-
}
|
|
2236
|
-
)
|
|
2237
|
-
}
|
|
2238
|
-
)
|
|
2239
|
-
] })
|
|
2240
|
-
}
|
|
2241
|
-
);
|
|
2242
|
-
}, Ln = ({
|
|
2243
|
-
question: t,
|
|
2244
|
-
onClick: s,
|
|
2245
|
-
loading: n = !1,
|
|
2246
|
-
className: r
|
|
2247
|
-
}) => /* @__PURE__ */ e(
|
|
2248
|
-
"button",
|
|
2249
|
-
{
|
|
2250
|
-
type: "button",
|
|
2251
|
-
onClick: s,
|
|
2252
|
-
disabled: n,
|
|
2253
|
-
style: { backgroundColor: "#E6E5E3" },
|
|
2254
|
-
className: D(
|
|
2255
|
-
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2256
|
-
{
|
|
2257
|
-
"hover:brightness-95 active:brightness-90": !n,
|
|
2258
|
-
"opacity-50 cursor-not-allowed": n
|
|
2259
|
-
},
|
|
2260
|
-
r
|
|
2261
|
-
),
|
|
2262
|
-
children: t
|
|
2263
|
-
}
|
|
2264
|
-
), la = ({
|
|
2265
|
-
faqs: t,
|
|
2266
|
-
onFaqClick: s,
|
|
2267
|
-
loadingFaqId: n,
|
|
2268
|
-
headerText: r,
|
|
2269
|
-
className: o,
|
|
2270
|
-
avatarImage: l,
|
|
2271
|
-
avatarName: i
|
|
2272
|
-
}) => {
|
|
2273
|
-
const c = t.filter((m) => m.enabled).sort((m, u) => (m.order ?? 0) - (u.order ?? 0));
|
|
2274
|
-
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ d("div", { className: "flex gap-3 items-end", children: [
|
|
2275
|
-
(l || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2276
|
-
ne,
|
|
2277
|
-
{
|
|
2278
|
-
id: i || "account",
|
|
2279
|
-
name: i || "Account",
|
|
2280
|
-
image: l,
|
|
2281
|
-
size: 24,
|
|
2282
|
-
shape: "circle"
|
|
2283
|
-
}
|
|
2284
|
-
) }),
|
|
2285
|
-
/* @__PURE__ */ d(
|
|
2286
|
-
"div",
|
|
2287
|
-
{
|
|
2288
|
-
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2289
|
-
style: { backgroundColor: "#F1F0EE" },
|
|
2290
|
-
children: [
|
|
2291
|
-
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2292
|
-
c.map((m) => /* @__PURE__ */ e(
|
|
2293
|
-
Ln,
|
|
2294
|
-
{
|
|
2295
|
-
question: m.question,
|
|
2296
|
-
onClick: () => s(m.id),
|
|
2297
|
-
loading: n === m.id
|
|
2298
|
-
},
|
|
2299
|
-
m.id
|
|
2300
|
-
))
|
|
2301
|
-
]
|
|
2302
|
-
}
|
|
2303
|
-
)
|
|
2304
|
-
] }) });
|
|
2305
|
-
}, An = [
|
|
2306
|
-
[/pdf/, "pdf"],
|
|
2307
|
-
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
2308
|
-
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
2309
|
-
[/csv/, "csv"],
|
|
2310
|
-
[/presentationml|ms-powerpoint|\.ppt/, "ppt"],
|
|
2311
|
-
[/zip|x-rar|x-7z|x-tar|x-gzip/, "zip"],
|
|
2312
|
-
[/plain|rtf/, "text"],
|
|
2313
|
-
[/markdown/, "markdown"]
|
|
2314
|
-
];
|
|
2315
|
-
function be(t) {
|
|
2316
|
-
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
2317
|
-
}
|
|
2318
|
-
function Fn(t) {
|
|
2319
|
-
const s = An.find(
|
|
2320
|
-
([n]) => n.test(t)
|
|
2321
|
-
);
|
|
2322
|
-
return s ? s[1] : "generic";
|
|
2323
|
-
}
|
|
2324
|
-
const On = {
|
|
2325
|
-
video: ys,
|
|
2326
|
-
audio: _s,
|
|
2327
|
-
image: ws,
|
|
2328
|
-
document: ht
|
|
2329
|
-
}, Pn = {
|
|
2330
|
-
pdf: Ts,
|
|
2331
|
-
doc: Ms,
|
|
2332
|
-
xls: ks,
|
|
2333
|
-
csv: Is,
|
|
2334
|
-
ppt: Ss,
|
|
2335
|
-
zip: Es,
|
|
2336
|
-
text: Cs,
|
|
2337
|
-
markdown: Ns,
|
|
2338
|
-
generic: ht
|
|
2339
|
-
};
|
|
2340
|
-
function Un(t) {
|
|
2341
|
-
const s = be(t);
|
|
2342
|
-
return s !== "document" ? On[s] : Pn[Fn(t)];
|
|
2343
|
-
}
|
|
2344
|
-
function ge(t, s) {
|
|
2345
|
-
return O.createElement(Un(t), s);
|
|
2346
|
-
}
|
|
2347
|
-
const zn = (t) => {
|
|
2348
|
-
var s, n;
|
|
2349
|
-
return "touches" in t ? ((s = t.touches[0]) == null ? void 0 : s.clientX) ?? ((n = t.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : t.clientX;
|
|
2350
|
-
}, Bn = ({
|
|
2351
|
-
source: t,
|
|
2352
|
-
mimeType: s,
|
|
2353
|
-
poster: n,
|
|
2354
|
-
autoPlay: r = !1,
|
|
2355
|
-
playing: o,
|
|
2356
|
-
loop: l = !1,
|
|
2357
|
-
controls: i = !0,
|
|
2358
|
-
showProgress: c = !1,
|
|
2359
|
-
muted: m = !1,
|
|
2360
|
-
onContainerClick: u
|
|
2361
|
-
}) => {
|
|
2362
|
-
const h = be(s), f = J(null), v = J(null), a = J(null), N = J(o), [b, C] = A(r), [x, I] = A(0), [w, E] = A(!1), [P, U] = A(!1), [k, T] = A(!1), [M, y] = A(!1), [_, F] = A(!0), [H, R] = A(null), z = G(() => {
|
|
2363
|
-
T(!1), C(!0);
|
|
2364
|
-
}, []), S = G((g) => {
|
|
2365
|
-
const p = v.current;
|
|
2366
|
-
if (!p) return 0;
|
|
2367
|
-
const L = p.getBoundingClientRect();
|
|
2368
|
-
return Math.max(
|
|
2369
|
-
0,
|
|
2370
|
-
Math.min(1, (zn(g) - L.left) / L.width)
|
|
2371
|
-
);
|
|
2372
|
-
}, []), $ = G((g) => {
|
|
2373
|
-
const p = f.current;
|
|
2374
|
-
p && p.duration && (p.currentTime = g * p.duration);
|
|
2375
|
-
}, []), V = (g) => {
|
|
2376
|
-
g.stopPropagation(), E(!0);
|
|
2377
|
-
const p = S(g);
|
|
2378
|
-
I(p), $(p);
|
|
2379
|
-
};
|
|
2380
|
-
Z(() => {
|
|
2381
|
-
o !== void 0 && o !== N.current && (N.current = o, C(o));
|
|
2382
|
-
}, [o]), Z(() => {
|
|
2383
|
-
if (!b) {
|
|
2384
|
-
a.current !== null && (cancelAnimationFrame(a.current), a.current = null);
|
|
2385
|
-
return;
|
|
2320
|
+
var F, H;
|
|
2321
|
+
const { channel: x } = oe(), I = K(null), w = O.useMemo(() => Object.values(x.state.members || {}).find(
|
|
2322
|
+
(z) => {
|
|
2323
|
+
var S;
|
|
2324
|
+
return ((S = z.user) == null ? void 0 : S.id) && z.user.id !== x._client.userID;
|
|
2386
2325
|
}
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
}, [
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
}
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
return /* @__PURE__ */ d(
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2326
|
+
), [x._client.userID, x.state.members]), E = O.useMemo(() => Object.values(x.state.members || {}).find((z) => {
|
|
2327
|
+
var S;
|
|
2328
|
+
return ((S = z.user) == null ? void 0 : S.id) === x._client.userID;
|
|
2329
|
+
}), [x._client.userID, x.state.members]), P = ((F = E == null ? void 0 : E.user) == null ? void 0 : F.is_account) ?? (E == null ? void 0 : E.is_account), U = ((H = w == null ? void 0 : w.user) == null ? void 0 : H.is_account) ?? (w == null ? void 0 : w.is_account), k = C && P === !1 && U === !0, T = O.useMemo(() => {
|
|
2330
|
+
const R = x.data ?? {};
|
|
2331
|
+
if (R.followerStatus)
|
|
2332
|
+
return String(R.followerStatus);
|
|
2333
|
+
if (R.isFollower !== void 0)
|
|
2334
|
+
return R.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2335
|
+
}, [x.data]), M = G(() => {
|
|
2336
|
+
var R;
|
|
2337
|
+
(R = I.current) == null || R.showModal();
|
|
2338
|
+
}, []), y = G(() => {
|
|
2339
|
+
var R;
|
|
2340
|
+
(R = I.current) == null || R.close();
|
|
2341
|
+
}, []), _ = G(
|
|
2342
|
+
(R) => {
|
|
2343
|
+
const { message: z } = gt("ChannelView"), S = /* @__PURE__ */ e(An, { ...R, chatbotVotingEnabled: f });
|
|
2344
|
+
return !b || !z ? S : b(S, z);
|
|
2345
|
+
},
|
|
2346
|
+
[f, b]
|
|
2347
|
+
);
|
|
2348
|
+
return /* @__PURE__ */ d(ce, { children: [
|
|
2349
|
+
/* @__PURE__ */ e(gs, { overrides: { Message: _ }, children: /* @__PURE__ */ d(bs, { children: [
|
|
2350
|
+
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
2351
|
+
Qn,
|
|
2352
|
+
{
|
|
2353
|
+
onBack: t,
|
|
2354
|
+
showBackButton: s,
|
|
2355
|
+
onShowInfo: M,
|
|
2356
|
+
canShowInfo: !!w,
|
|
2357
|
+
showStarButton: h,
|
|
2358
|
+
dmAgentEnabled: k
|
|
2420
2359
|
}
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
k || i && C((p) => !p);
|
|
2360
|
+
) }),
|
|
2361
|
+
v == null ? void 0 : v(),
|
|
2362
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
2363
|
+
ps,
|
|
2364
|
+
{
|
|
2365
|
+
hideDeletedMessages: !0,
|
|
2366
|
+
hideNewMessageSeparator: !1,
|
|
2367
|
+
messageActions: void 0
|
|
2430
2368
|
}
|
|
2431
|
-
},
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2369
|
+
) }),
|
|
2370
|
+
r == null ? void 0 : r(x),
|
|
2371
|
+
/* @__PURE__ */ e(
|
|
2372
|
+
Bn,
|
|
2373
|
+
{
|
|
2374
|
+
renderActions: () => n == null ? void 0 : n(x)
|
|
2375
|
+
}
|
|
2376
|
+
)
|
|
2377
|
+
] }) }),
|
|
2378
|
+
/* @__PURE__ */ e(
|
|
2379
|
+
tn,
|
|
2380
|
+
{
|
|
2381
|
+
dialogRef: I,
|
|
2382
|
+
onClose: y,
|
|
2383
|
+
participant: w,
|
|
2384
|
+
channel: x,
|
|
2385
|
+
followerStatusLabel: T,
|
|
2386
|
+
onLeaveConversation: o,
|
|
2387
|
+
onBlockParticipant: l,
|
|
2388
|
+
showDeleteConversation: i,
|
|
2389
|
+
onDeleteConversationClick: c,
|
|
2390
|
+
onBlockParticipantClick: m,
|
|
2391
|
+
onReportParticipantClick: u,
|
|
2392
|
+
customProfileContent: a,
|
|
2393
|
+
customChannelActions: N
|
|
2394
|
+
}
|
|
2395
|
+
)
|
|
2396
|
+
] });
|
|
2397
|
+
}, Lt = O.memo(
|
|
2398
|
+
({
|
|
2399
|
+
channel: t,
|
|
2400
|
+
onBack: s,
|
|
2401
|
+
showBackButton: n = !1,
|
|
2402
|
+
renderMessageInputActions: r,
|
|
2403
|
+
renderConversationFooter: o,
|
|
2404
|
+
onLeaveConversation: l,
|
|
2405
|
+
onBlockParticipant: i,
|
|
2406
|
+
className: c,
|
|
2407
|
+
CustomChannelEmptyState: m = Jn,
|
|
2408
|
+
showDeleteConversation: u = !0,
|
|
2409
|
+
onDeleteConversationClick: h,
|
|
2410
|
+
onBlockParticipantClick: f,
|
|
2411
|
+
onReportParticipantClick: v,
|
|
2412
|
+
dmAgentEnabled: a,
|
|
2413
|
+
messageMetadata: N,
|
|
2414
|
+
onMessageSent: b,
|
|
2415
|
+
showStarButton: C = !1,
|
|
2416
|
+
chatbotVotingEnabled: x = !1,
|
|
2417
|
+
renderChannelBanner: I,
|
|
2418
|
+
customProfileContent: w,
|
|
2419
|
+
customChannelActions: E,
|
|
2420
|
+
renderMessage: P,
|
|
2421
|
+
sendButton: U
|
|
2422
|
+
}) => {
|
|
2423
|
+
const k = G(
|
|
2424
|
+
async (T, M, y) => {
|
|
2425
|
+
var S;
|
|
2426
|
+
const _ = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, F = a && !_, H = {
|
|
2427
|
+
...M,
|
|
2428
|
+
...F && { silent: !0 },
|
|
2429
|
+
...N && {
|
|
2430
|
+
metadata: {
|
|
2431
|
+
...M.metadata ?? {},
|
|
2432
|
+
...N
|
|
2433
|
+
}
|
|
2439
2434
|
}
|
|
2435
|
+
}, R = {
|
|
2436
|
+
...y,
|
|
2437
|
+
...F && { skip_push: !0 }
|
|
2438
|
+
}, z = await t.sendMessage(H, R);
|
|
2439
|
+
return b == null || b(z), z;
|
|
2440
|
+
},
|
|
2441
|
+
[t, a, N, b]
|
|
2442
|
+
);
|
|
2443
|
+
return /* @__PURE__ */ e(
|
|
2444
|
+
"div",
|
|
2445
|
+
{
|
|
2446
|
+
className: D(
|
|
2447
|
+
"messaging-channel-view h-full flex flex-col",
|
|
2448
|
+
c
|
|
2440
2449
|
),
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
weight: "regular"
|
|
2444
|
-
}) }),
|
|
2445
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0", children: h === "audio" ? /* @__PURE__ */ e(
|
|
2446
|
-
"audio",
|
|
2450
|
+
children: /* @__PURE__ */ e(
|
|
2451
|
+
fs,
|
|
2447
2452
|
{
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2453
|
+
channel: t,
|
|
2454
|
+
MessageSystem: Xn,
|
|
2455
|
+
EmptyStateIndicator: m,
|
|
2456
|
+
LoadingIndicator: pe,
|
|
2457
|
+
DateSeparator: sn,
|
|
2458
|
+
TypingIndicator: Zn,
|
|
2459
|
+
doSendMessageRequest: k,
|
|
2460
|
+
...U ? { SendButton: U } : {},
|
|
2461
|
+
children: /* @__PURE__ */ e(
|
|
2462
|
+
ea,
|
|
2463
|
+
{
|
|
2464
|
+
onBack: s,
|
|
2465
|
+
showBackButton: n,
|
|
2466
|
+
renderMessageInputActions: r,
|
|
2467
|
+
renderConversationFooter: o,
|
|
2468
|
+
onLeaveConversation: l,
|
|
2469
|
+
onBlockParticipant: i,
|
|
2470
|
+
CustomChannelEmptyState: m,
|
|
2471
|
+
showDeleteConversation: u,
|
|
2472
|
+
onDeleteConversationClick: h,
|
|
2473
|
+
onBlockParticipantClick: f,
|
|
2474
|
+
onReportParticipantClick: v,
|
|
2475
|
+
showStarButton: C,
|
|
2476
|
+
dmAgentEnabled: a,
|
|
2477
|
+
chatbotVotingEnabled: x,
|
|
2478
|
+
renderChannelBanner: I,
|
|
2479
|
+
customProfileContent: w,
|
|
2480
|
+
customChannelActions: E,
|
|
2481
|
+
renderMessage: P
|
|
2482
|
+
}
|
|
2483
|
+
)
|
|
2463
2484
|
}
|
|
2464
|
-
)
|
|
2465
|
-
|
|
2485
|
+
)
|
|
2486
|
+
}
|
|
2487
|
+
);
|
|
2488
|
+
}
|
|
2489
|
+
);
|
|
2490
|
+
Lt.displayName = "ChannelView";
|
|
2491
|
+
const ta = ({ className: t }) => /* @__PURE__ */ d(
|
|
2492
|
+
"svg",
|
|
2493
|
+
{
|
|
2494
|
+
width: "140",
|
|
2495
|
+
height: "120",
|
|
2496
|
+
viewBox: "44 -2 144 126",
|
|
2497
|
+
fill: "none",
|
|
2498
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2499
|
+
className: t,
|
|
2500
|
+
children: [
|
|
2501
|
+
/* @__PURE__ */ d("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
2502
|
+
/* @__PURE__ */ e(
|
|
2503
|
+
"path",
|
|
2466
2504
|
{
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
loop: l,
|
|
2470
|
-
muted: m,
|
|
2471
|
-
playsInline: !0,
|
|
2472
|
-
style: { width: "100%", height: "100%" },
|
|
2473
|
-
onLoadStart: () => y(!0),
|
|
2474
|
-
onCanPlay: () => {
|
|
2475
|
-
y(!1), F(!1);
|
|
2476
|
-
},
|
|
2477
|
-
onWaiting: () => y(!0),
|
|
2478
|
-
onPlay: () => T(!1),
|
|
2479
|
-
onLoadedMetadata: () => {
|
|
2480
|
-
const g = f.current;
|
|
2481
|
-
g instanceof HTMLVideoElement && g.videoWidth && g.videoHeight && R(g.videoWidth / g.videoHeight);
|
|
2482
|
-
},
|
|
2483
|
-
onEnded: () => {
|
|
2484
|
-
l || (C(!1), I(0));
|
|
2485
|
-
},
|
|
2486
|
-
children: /* @__PURE__ */ e("track", { kind: "captions" })
|
|
2505
|
+
d: "M123.68 82.1932C123.383 103.675 105.839 121 84.2417 121C77.4724 121 71.0986 119.297 65.5327 116.299L52.5873 119.687L53.8036 106.673C48.1776 99.8701 44.7994 91.1453 44.7994 81.6356C44.7994 59.8965 62.4554 42.2754 84.2374 42.2754C89.1328 42.2754 93.8175 43.1633 98.1413 44.789",
|
|
2506
|
+
fill: "#D7D4CE"
|
|
2487
2507
|
}
|
|
2488
|
-
)
|
|
2489
|
-
|
|
2490
|
-
|
|
2508
|
+
),
|
|
2509
|
+
/* @__PURE__ */ e(
|
|
2510
|
+
"path",
|
|
2491
2511
|
{
|
|
2492
|
-
|
|
2493
|
-
|
|
2512
|
+
d: "M84.2458 86.0364C82.2851 86.0364 80.6957 84.4501 80.6957 82.4933C80.6957 80.5365 82.2851 78.9502 84.2458 78.9502C86.2065 78.9502 87.7959 80.5365 87.7959 82.4933C87.7959 84.4501 86.2065 86.0364 84.2458 86.0364Z",
|
|
2513
|
+
fill: "white"
|
|
2494
2514
|
}
|
|
2495
|
-
)
|
|
2496
|
-
|
|
2497
|
-
"
|
|
2515
|
+
),
|
|
2516
|
+
/* @__PURE__ */ e(
|
|
2517
|
+
"path",
|
|
2498
2518
|
{
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
tabIndex: 0,
|
|
2502
|
-
"aria-label": "Play preview",
|
|
2503
|
-
onClick: (g) => {
|
|
2504
|
-
g.stopPropagation(), z();
|
|
2505
|
-
},
|
|
2506
|
-
onKeyDown: (g) => {
|
|
2507
|
-
g.key !== "Enter" && g.key !== " " || (g.preventDefault(), g.stopPropagation(), z());
|
|
2508
|
-
},
|
|
2509
|
-
children: /* @__PURE__ */ e("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ e(et, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
2519
|
+
d: "M68.3044 86.0364C66.3437 86.0364 64.7543 84.4501 64.7543 82.4933C64.7543 80.5365 66.3437 78.9502 68.3044 78.9502C70.2651 78.9502 71.8545 80.5365 71.8545 82.4933C71.8545 84.4501 70.2651 86.0364 68.3044 86.0364Z",
|
|
2520
|
+
fill: "white"
|
|
2510
2521
|
}
|
|
2511
2522
|
),
|
|
2512
|
-
|
|
2513
|
-
"
|
|
2523
|
+
/* @__PURE__ */ e(
|
|
2524
|
+
"path",
|
|
2514
2525
|
{
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
"aria-valuenow": q,
|
|
2518
|
-
"aria-valuemin": 0,
|
|
2519
|
-
"aria-valuemax": 100,
|
|
2520
|
-
tabIndex: 0,
|
|
2521
|
-
ref: v,
|
|
2522
|
-
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2523
|
-
onMouseDown: V,
|
|
2524
|
-
onTouchStart: V,
|
|
2525
|
-
onClick: (g) => g.stopPropagation(),
|
|
2526
|
-
onKeyDown: (g) => {
|
|
2527
|
-
g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
|
|
2528
|
-
},
|
|
2529
|
-
children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
|
|
2530
|
-
"div",
|
|
2531
|
-
{
|
|
2532
|
-
className: "h-full rounded-full bg-white",
|
|
2533
|
-
style: { width: `${q}%` }
|
|
2534
|
-
}
|
|
2535
|
-
) })
|
|
2526
|
+
d: "M100.183 86.0364C98.2226 86.0364 96.6332 84.4501 96.6332 82.4933C96.6332 80.5365 98.2226 78.9502 100.183 78.9502C102.144 78.9502 103.733 80.5365 103.733 82.4933C103.733 84.4501 102.144 86.0364 100.183 86.0364Z",
|
|
2527
|
+
fill: "white"
|
|
2536
2528
|
}
|
|
2537
|
-
)
|
|
2538
|
-
|
|
2529
|
+
),
|
|
2530
|
+
/* @__PURE__ */ d("g", { filter: "url(#filter0_empty_state)", children: [
|
|
2539
2531
|
/* @__PURE__ */ e(
|
|
2540
|
-
"
|
|
2532
|
+
"path",
|
|
2541
2533
|
{
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
g.stopPropagation(), C((p) => !p);
|
|
2545
|
-
},
|
|
2546
|
-
className: "shrink-0 text-white",
|
|
2547
|
-
"aria-label": b ? "Pause" : "Play",
|
|
2548
|
-
children: b ? /* @__PURE__ */ e(Ds, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ e(et, { className: "size-5 translate-x-px", weight: "fill" })
|
|
2534
|
+
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
2535
|
+
fill: "white"
|
|
2549
2536
|
}
|
|
2550
2537
|
),
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
"
|
|
2538
|
+
/* @__PURE__ */ e(
|
|
2539
|
+
"path",
|
|
2553
2540
|
{
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
"
|
|
2557
|
-
"
|
|
2558
|
-
"aria-valuemax": 100,
|
|
2559
|
-
tabIndex: 0,
|
|
2560
|
-
ref: v,
|
|
2561
|
-
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
2562
|
-
onMouseDown: V,
|
|
2563
|
-
onTouchStart: V,
|
|
2564
|
-
onClick: (g) => g.stopPropagation(),
|
|
2565
|
-
onMouseEnter: () => U(!0),
|
|
2566
|
-
onMouseLeave: () => U(!1),
|
|
2567
|
-
onKeyDown: (g) => {
|
|
2568
|
-
g.key === "ArrowRight" && $(Math.min(1, x + 0.05)), g.key === "ArrowLeft" && $(Math.max(0, x - 0.05));
|
|
2569
|
-
},
|
|
2570
|
-
children: [
|
|
2571
|
-
/* @__PURE__ */ e(
|
|
2572
|
-
"div",
|
|
2573
|
-
{
|
|
2574
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || w ? "h-1.5" : "h-1"}`,
|
|
2575
|
-
children: /* @__PURE__ */ e(
|
|
2576
|
-
"div",
|
|
2577
|
-
{
|
|
2578
|
-
className: "h-full rounded-full bg-white",
|
|
2579
|
-
style: { width: `${q}%` }
|
|
2580
|
-
}
|
|
2581
|
-
)
|
|
2582
|
-
}
|
|
2583
|
-
),
|
|
2584
|
-
/* @__PURE__ */ e(
|
|
2585
|
-
"div",
|
|
2586
|
-
{
|
|
2587
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
2588
|
-
style: { left: `${q}%` }
|
|
2589
|
-
}
|
|
2590
|
-
)
|
|
2591
|
-
]
|
|
2541
|
+
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
2542
|
+
stroke: "#D7D4CE",
|
|
2543
|
+
strokeWidth: "2",
|
|
2544
|
+
strokeMiterlimit: "10"
|
|
2592
2545
|
}
|
|
2593
2546
|
)
|
|
2594
|
-
] })
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
alt: r ?? "",
|
|
2639
|
-
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${m ? "opacity-100" : "opacity-0"}`,
|
|
2640
|
-
draggable: !1,
|
|
2641
|
-
onLoad: () => u(!0)
|
|
2642
|
-
}
|
|
2643
|
-
) }) : /* @__PURE__ */ e(
|
|
2644
|
-
"img",
|
|
2645
|
-
{
|
|
2646
|
-
src: n,
|
|
2647
|
-
alt: "",
|
|
2648
|
-
className: "block w-full",
|
|
2649
|
-
draggable: !1
|
|
2650
|
-
}
|
|
2651
|
-
) : /* @__PURE__ */ e(
|
|
2652
|
-
"div",
|
|
2653
|
-
{
|
|
2654
|
-
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
2655
|
-
children: ge(t, {
|
|
2656
|
-
className: it(o),
|
|
2657
|
-
weight: "regular"
|
|
2658
|
-
})
|
|
2659
|
-
}
|
|
2660
|
-
) : n ? /* @__PURE__ */ e("div", { className: `relative ${$n(o)}`, children: /* @__PURE__ */ e(
|
|
2661
|
-
"img",
|
|
2662
|
-
{
|
|
2663
|
-
src: n,
|
|
2664
|
-
alt: r ?? "",
|
|
2665
|
-
draggable: !1,
|
|
2666
|
-
className: "absolute inset-0 h-full w-full object-cover"
|
|
2667
|
-
}
|
|
2668
|
-
) }) : /* @__PURE__ */ e(
|
|
2669
|
-
"div",
|
|
2670
|
-
{
|
|
2671
|
-
className: `flex aspect-video w-full items-center justify-center ${o === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
2672
|
-
children: ge(t, {
|
|
2673
|
-
className: it(o),
|
|
2674
|
-
weight: "regular"
|
|
2675
|
-
})
|
|
2676
|
-
}
|
|
2677
|
-
);
|
|
2678
|
-
}, St = ({
|
|
2679
|
-
variant: t,
|
|
2680
|
-
thumbnail: s,
|
|
2681
|
-
title: n,
|
|
2682
|
-
placeholderTitle: r = "Attachment title",
|
|
2683
|
-
mimeType: o,
|
|
2684
|
-
detail: l,
|
|
2685
|
-
statusBadge: i,
|
|
2686
|
-
action: c,
|
|
2687
|
-
topLeft: m,
|
|
2688
|
-
topRight: u,
|
|
2689
|
-
rootRef: h,
|
|
2690
|
-
"data-testid": f
|
|
2691
|
-
}) => {
|
|
2692
|
-
const v = t === "dark", a = v ? n ?? r : n ?? "", N = v && !n;
|
|
2693
|
-
return /* @__PURE__ */ d(
|
|
2694
|
-
"div",
|
|
2695
|
-
{
|
|
2696
|
-
ref: h,
|
|
2697
|
-
"data-testid": f,
|
|
2698
|
-
className: D(
|
|
2699
|
-
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
2700
|
-
v ? "bg-[#121110]" : "bg-white"
|
|
2701
|
-
),
|
|
2702
|
-
children: [
|
|
2703
|
-
m ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: m }) : null,
|
|
2704
|
-
u ? /* @__PURE__ */ e("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: u }) : null,
|
|
2705
|
-
s,
|
|
2706
|
-
/* @__PURE__ */ d("div", { className: "px-4 pb-3 pt-3", children: [
|
|
2707
|
-
a.trim() !== "" && /* @__PURE__ */ e(
|
|
2708
|
-
"p",
|
|
2709
|
-
{
|
|
2710
|
-
className: D("mb-0.5 truncate text-base font-medium", {
|
|
2711
|
-
"text-black": !v,
|
|
2712
|
-
"text-white/30": v && N,
|
|
2713
|
-
"text-white": v && !N
|
|
2714
|
-
}),
|
|
2715
|
-
children: a
|
|
2716
|
-
}
|
|
2717
|
-
),
|
|
2718
|
-
/* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
2719
|
-
ge(o, {
|
|
2720
|
-
className: D(
|
|
2721
|
-
"size-5 shrink-0",
|
|
2722
|
-
v ? "text-white/55" : "text-black/55"
|
|
2547
|
+
] }),
|
|
2548
|
+
/* @__PURE__ */ e(
|
|
2549
|
+
"path",
|
|
2550
|
+
{
|
|
2551
|
+
d: "M139.502 45.5431C137.541 45.5431 135.952 43.9568 135.952 42C135.952 40.0432 137.541 38.4569 139.502 38.4569C141.462 38.4569 143.052 40.0432 143.052 42C143.052 43.9568 141.462 45.5431 139.502 45.5431Z",
|
|
2552
|
+
fill: "#D7D4CE"
|
|
2553
|
+
}
|
|
2554
|
+
),
|
|
2555
|
+
/* @__PURE__ */ e(
|
|
2556
|
+
"path",
|
|
2557
|
+
{
|
|
2558
|
+
d: "M123.561 45.5431C121.601 45.5431 120.011 43.9568 120.011 42C120.011 40.0432 121.601 38.4569 123.561 38.4569C125.522 38.4569 127.111 40.0432 127.111 42C127.111 43.9568 125.522 45.5431 123.561 45.5431Z",
|
|
2559
|
+
fill: "#D7D4CE"
|
|
2560
|
+
}
|
|
2561
|
+
),
|
|
2562
|
+
/* @__PURE__ */ e(
|
|
2563
|
+
"path",
|
|
2564
|
+
{
|
|
2565
|
+
d: "M155.439 45.5431C153.478 45.5431 151.889 43.9568 151.889 42C151.889 40.0432 153.478 38.4569 155.439 38.4569C157.4 38.4569 158.989 40.0432 158.989 42C158.989 43.9568 157.4 45.5431 155.439 45.5431Z",
|
|
2566
|
+
fill: "#D7D4CE"
|
|
2567
|
+
}
|
|
2568
|
+
)
|
|
2569
|
+
] }),
|
|
2570
|
+
/* @__PURE__ */ d("defs", { children: [
|
|
2571
|
+
/* @__PURE__ */ d(
|
|
2572
|
+
"filter",
|
|
2573
|
+
{
|
|
2574
|
+
id: "filter0_empty_state",
|
|
2575
|
+
x: "97",
|
|
2576
|
+
y: "-1",
|
|
2577
|
+
width: "89",
|
|
2578
|
+
height: "90",
|
|
2579
|
+
filterUnits: "userSpaceOnUse",
|
|
2580
|
+
colorInterpolationFilters: "sRGB",
|
|
2581
|
+
children: [
|
|
2582
|
+
/* @__PURE__ */ e("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
2583
|
+
/* @__PURE__ */ e(
|
|
2584
|
+
"feColorMatrix",
|
|
2585
|
+
{
|
|
2586
|
+
in: "SourceAlpha",
|
|
2587
|
+
type: "matrix",
|
|
2588
|
+
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
2589
|
+
result: "hardAlpha"
|
|
2590
|
+
}
|
|
2723
2591
|
),
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
"
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
function Vn(t) {
|
|
2757
|
-
return t ? "text-white/55" : "text-black/55";
|
|
2758
|
-
}
|
|
2759
|
-
function Hn(t) {
|
|
2760
|
-
return t ? "text-white/40" : "text-black/40";
|
|
2761
|
-
}
|
|
2762
|
-
function Yn(t) {
|
|
2763
|
-
return t ? "text-white/20" : "text-black/20";
|
|
2764
|
-
}
|
|
2765
|
-
const Le = ({ attachment: t, isMyMessage: s }) => {
|
|
2766
|
-
const { title: n, text: r, image_url: o, og_scrape_url: l, title_link: i } = t, c = l ?? i, m = typeof c == "string" && c.trim() !== "" ? c : void 0, u = /* @__PURE__ */ d(O.Fragment, { children: [
|
|
2767
|
-
/* @__PURE__ */ e("div", { className: "p-2", children: o ? /* @__PURE__ */ e(
|
|
2768
|
-
"img",
|
|
2769
|
-
{
|
|
2770
|
-
src: o,
|
|
2771
|
-
alt: n ?? "",
|
|
2772
|
-
className: "aspect-video w-full rounded-[20px] object-cover"
|
|
2773
|
-
}
|
|
2774
|
-
) : /* @__PURE__ */ e(
|
|
2775
|
-
"div",
|
|
2776
|
-
{
|
|
2777
|
-
className: `aspect-video w-full rounded-[20px] ${jn(s)} flex items-center justify-center`,
|
|
2778
|
-
children: /* @__PURE__ */ e(Rs, { className: `size-12 ${Yn(s)}` })
|
|
2779
|
-
}
|
|
2780
|
-
) }),
|
|
2781
|
-
/* @__PURE__ */ d("div", { className: "px-3 pb-3", children: [
|
|
2782
|
-
n && /* @__PURE__ */ e("p", { className: `truncate text-[14px] font-medium leading-5 ${Gn(s)}`, children: n }),
|
|
2783
|
-
r && /* @__PURE__ */ e("p", { className: `truncate text-[12px] leading-4 ${Vn(s)}`, children: r }),
|
|
2784
|
-
m && /* @__PURE__ */ e("p", { className: `mt-1 truncate text-[12px] leading-4 ${Hn(s)}`, children: m })
|
|
2785
|
-
] })
|
|
2786
|
-
] });
|
|
2787
|
-
return m ? /* @__PURE__ */ e("a", { href: m, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ e("div", { className: "block", children: u });
|
|
2788
|
-
};
|
|
2789
|
-
function Ae(t) {
|
|
2790
|
-
var s;
|
|
2791
|
-
return (s = t.attachments) == null ? void 0 : s.find(
|
|
2792
|
-
(n) => n.type === "link" || !!n.og_scrape_url && !n.asset_url
|
|
2793
|
-
);
|
|
2794
|
-
}
|
|
2795
|
-
async function qn(t, s) {
|
|
2796
|
-
let n;
|
|
2797
|
-
try {
|
|
2798
|
-
n = s ?? new URL(t).pathname.split("/").pop() ?? "download";
|
|
2799
|
-
} catch {
|
|
2800
|
-
n = s ?? "download";
|
|
2592
|
+
/* @__PURE__ */ e("feOffset", { dx: "4", dy: "4" }),
|
|
2593
|
+
/* @__PURE__ */ e("feComposite", { in2: "hardAlpha", operator: "out" }),
|
|
2594
|
+
/* @__PURE__ */ e(
|
|
2595
|
+
"feColorMatrix",
|
|
2596
|
+
{
|
|
2597
|
+
type: "matrix",
|
|
2598
|
+
values: "0 0 0 0 0.8428 0 0 0 0 0.830064 0 0 0 0 0.8095 0 0 0 1 0"
|
|
2599
|
+
}
|
|
2600
|
+
),
|
|
2601
|
+
/* @__PURE__ */ e(
|
|
2602
|
+
"feBlend",
|
|
2603
|
+
{
|
|
2604
|
+
mode: "normal",
|
|
2605
|
+
in2: "BackgroundImageFix",
|
|
2606
|
+
result: "effect1_dropShadow"
|
|
2607
|
+
}
|
|
2608
|
+
),
|
|
2609
|
+
/* @__PURE__ */ e(
|
|
2610
|
+
"feBlend",
|
|
2611
|
+
{
|
|
2612
|
+
mode: "normal",
|
|
2613
|
+
in: "SourceGraphic",
|
|
2614
|
+
in2: "effect1_dropShadow",
|
|
2615
|
+
result: "shape"
|
|
2616
|
+
}
|
|
2617
|
+
)
|
|
2618
|
+
]
|
|
2619
|
+
}
|
|
2620
|
+
),
|
|
2621
|
+
/* @__PURE__ */ e("clipPath", { id: "clip0_empty_state", children: /* @__PURE__ */ e("rect", { width: "233", height: "233", fill: "white" }) })
|
|
2622
|
+
] })
|
|
2623
|
+
]
|
|
2801
2624
|
}
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
}
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2625
|
+
), At = O.memo(
|
|
2626
|
+
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2627
|
+
/* @__PURE__ */ e(ta, {}),
|
|
2628
|
+
s && !t && /* @__PURE__ */ d("div", { className: "mt-8", children: [
|
|
2629
|
+
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2630
|
+
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2631
|
+
] })
|
|
2632
|
+
] }) })
|
|
2633
|
+
);
|
|
2634
|
+
At.displayName = "EmptyState";
|
|
2635
|
+
const fe = O.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ d("div", { className: "text-center max-w-sm", children: [
|
|
2636
|
+
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2637
|
+
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2638
|
+
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
2639
|
+
s && /* @__PURE__ */ e(
|
|
2813
2640
|
"button",
|
|
2814
2641
|
{
|
|
2815
2642
|
type: "button",
|
|
2816
|
-
onClick:
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
r(!0), qn(t, s).then(() => {
|
|
2820
|
-
i == null || i.close();
|
|
2821
|
-
}).catch(() => {
|
|
2822
|
-
i && (i.location.href = t);
|
|
2823
|
-
}).finally(() => r(!1));
|
|
2824
|
-
},
|
|
2825
|
-
disabled: n,
|
|
2826
|
-
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",
|
|
2827
|
-
children: n ? /* @__PURE__ */ e(ft, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ d(O.Fragment, { children: [
|
|
2828
|
-
/* @__PURE__ */ e(Ls, { className: "size-4 text-white", weight: "bold" }),
|
|
2829
|
-
"Download"
|
|
2830
|
-
] })
|
|
2643
|
+
onClick: s,
|
|
2644
|
+
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[#7f22fe] hover:bg-primary-alt rounded-lg transition-colors focus-ring",
|
|
2645
|
+
children: "Go Back"
|
|
2831
2646
|
}
|
|
2832
|
-
)
|
|
2833
|
-
};
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2647
|
+
)
|
|
2648
|
+
] }) }));
|
|
2649
|
+
fe.displayName = "ErrorState";
|
|
2650
|
+
const ha = ({
|
|
2651
|
+
capabilities: t = {},
|
|
2652
|
+
className: s,
|
|
2653
|
+
renderMessageInputActions: n,
|
|
2654
|
+
renderConversationFooter: r,
|
|
2655
|
+
onChannelSelect: o,
|
|
2656
|
+
initialParticipantFilter: l,
|
|
2657
|
+
initialParticipantData: i,
|
|
2658
|
+
CustomChannelEmptyState: c,
|
|
2659
|
+
showChannelList: m = !0,
|
|
2660
|
+
filters: u,
|
|
2661
|
+
channelRenderFilterFn: h,
|
|
2662
|
+
channelListCustomEmptyStateIndicator: f,
|
|
2663
|
+
onDeleteConversationClick: v,
|
|
2664
|
+
onBlockParticipantClick: a,
|
|
2665
|
+
onReportParticipantClick: N,
|
|
2666
|
+
dmAgentEnabled: b,
|
|
2667
|
+
messageMetadata: C,
|
|
2668
|
+
onMessageSent: x,
|
|
2669
|
+
showStarButton: I = !1,
|
|
2670
|
+
chatbotVotingEnabled: w = !1,
|
|
2671
|
+
renderMessagePreview: E,
|
|
2672
|
+
renderChannelBanner: P,
|
|
2673
|
+
customProfileContent: U,
|
|
2674
|
+
customChannelActions: k,
|
|
2675
|
+
renderMessage: T,
|
|
2676
|
+
sendButton: M
|
|
2861
2677
|
}) => {
|
|
2862
|
-
const
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2678
|
+
const {
|
|
2679
|
+
service: y,
|
|
2680
|
+
client: _,
|
|
2681
|
+
isConnected: F,
|
|
2682
|
+
isLoading: H,
|
|
2683
|
+
error: R,
|
|
2684
|
+
refreshConnection: z,
|
|
2685
|
+
debug: S
|
|
2686
|
+
} = zs(), [$, V] = A(null), [ee, te] = A(!1), [W, g] = A(!1), [p, L] = A(!1), [j, Y] = A(null), {
|
|
2687
|
+
showDeleteConversation: ae = !0
|
|
2688
|
+
} = t, de = O.useMemo(() => {
|
|
2689
|
+
const B = _ == null ? void 0 : _.userID;
|
|
2690
|
+
return {
|
|
2691
|
+
...{
|
|
2692
|
+
type: "messaging",
|
|
2693
|
+
last_message_at: { $exists: !0 },
|
|
2694
|
+
...B && {
|
|
2695
|
+
members: { $in: [B] },
|
|
2696
|
+
hidden: !1
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
...u
|
|
2700
|
+
};
|
|
2701
|
+
}, [u, _ == null ? void 0 : _.userID]), re = K(null), q = G(async () => {
|
|
2702
|
+
if (!_ || !F) return;
|
|
2703
|
+
const B = _.userID;
|
|
2704
|
+
if (B)
|
|
2705
|
+
try {
|
|
2706
|
+
S && console.log("[MessagingShell] Syncing channels for user:", B);
|
|
2707
|
+
const X = await _.queryChannels(
|
|
2708
|
+
{
|
|
2709
|
+
type: "messaging",
|
|
2710
|
+
members: { $in: [B] }
|
|
2711
|
+
},
|
|
2712
|
+
{},
|
|
2713
|
+
{ limit: 100 }
|
|
2714
|
+
);
|
|
2715
|
+
te(X.length > 0), g(!0), re.current = B, S && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2716
|
+
channelCount: X.length
|
|
2717
|
+
});
|
|
2718
|
+
} catch (X) {
|
|
2719
|
+
console.error("[MessagingShell] Failed to sync channels:", X);
|
|
2720
|
+
}
|
|
2721
|
+
}, [_, F, S]);
|
|
2722
|
+
J(() => {
|
|
2723
|
+
if (!_ || !F) return;
|
|
2724
|
+
const B = _.userID;
|
|
2725
|
+
B && re.current !== B && q();
|
|
2726
|
+
}, [_, F, q]), J(() => {
|
|
2727
|
+
if (!l || !_ || !F) return;
|
|
2728
|
+
(async () => {
|
|
2729
|
+
const X = _.userID;
|
|
2730
|
+
if (X)
|
|
2731
|
+
try {
|
|
2732
|
+
S && console.log(
|
|
2733
|
+
"[MessagingShell] Loading initial conversation with:",
|
|
2734
|
+
l
|
|
2735
|
+
);
|
|
2736
|
+
const Q = await _.queryChannels(
|
|
2737
|
+
{
|
|
2738
|
+
type: "messaging",
|
|
2739
|
+
members: { $eq: [X, l] }
|
|
2740
|
+
},
|
|
2741
|
+
{},
|
|
2742
|
+
{ limit: 1 }
|
|
2743
|
+
);
|
|
2744
|
+
if (Q.length > 0)
|
|
2745
|
+
V(Q[0]), L(!0), Y(null), o && o(Q[0]), S && console.log(
|
|
2746
|
+
"[MessagingShell] Initial conversation loaded:",
|
|
2747
|
+
Q[0].id
|
|
2748
|
+
);
|
|
2749
|
+
else if (i && y) {
|
|
2750
|
+
S && console.log(
|
|
2751
|
+
"[MessagingShell] No conversation found, creating one for:",
|
|
2752
|
+
i
|
|
2753
|
+
);
|
|
2754
|
+
try {
|
|
2755
|
+
const se = await y.startChannelWithParticipant({
|
|
2756
|
+
id: i.id,
|
|
2757
|
+
name: i.name,
|
|
2758
|
+
email: i.email,
|
|
2759
|
+
phone: i.phone
|
|
2760
|
+
});
|
|
2761
|
+
V(se), L(!0), Y(null), o && o(se), S && console.log(
|
|
2762
|
+
"[MessagingShell] Channel created and loaded:",
|
|
2763
|
+
se.id
|
|
2764
|
+
);
|
|
2765
|
+
} catch (se) {
|
|
2766
|
+
console.error(
|
|
2767
|
+
"[MessagingShell] Failed to create conversation:",
|
|
2768
|
+
se
|
|
2769
|
+
), Y("Failed to create conversation");
|
|
2770
|
+
}
|
|
2771
|
+
} else
|
|
2772
|
+
Y(
|
|
2773
|
+
"No conversation found with this account"
|
|
2774
|
+
), S && console.log(
|
|
2775
|
+
"[MessagingShell] No conversation found for:",
|
|
2776
|
+
l
|
|
2777
|
+
);
|
|
2778
|
+
} catch (Q) {
|
|
2779
|
+
console.error(
|
|
2780
|
+
"[MessagingShell] Failed to load initial conversation:",
|
|
2781
|
+
Q
|
|
2782
|
+
), Y("Failed to load conversation");
|
|
2879
2783
|
}
|
|
2880
|
-
|
|
2784
|
+
})();
|
|
2785
|
+
}, [
|
|
2786
|
+
l,
|
|
2787
|
+
i,
|
|
2788
|
+
_,
|
|
2789
|
+
F,
|
|
2790
|
+
y,
|
|
2791
|
+
S,
|
|
2792
|
+
o
|
|
2793
|
+
]);
|
|
2794
|
+
const ie = G(
|
|
2795
|
+
(B) => {
|
|
2796
|
+
V(B), o == null || o(B);
|
|
2797
|
+
},
|
|
2798
|
+
[o]
|
|
2799
|
+
), ve = G(() => {
|
|
2800
|
+
p || V(null);
|
|
2801
|
+
}, [p]), ue = G(
|
|
2802
|
+
async (B) => {
|
|
2803
|
+
S && console.log("[MessagingShell] Leaving conversation:", B.id), V(null), L(!1), re.current = null, await q();
|
|
2804
|
+
},
|
|
2805
|
+
[q, S]
|
|
2806
|
+
), we = G(
|
|
2807
|
+
async (B) => {
|
|
2808
|
+
S && console.log("[MessagingShell] Blocking participant:", B), V(null), L(!1), re.current = null, await q();
|
|
2809
|
+
},
|
|
2810
|
+
[q, S]
|
|
2811
|
+
), Z = !!$;
|
|
2812
|
+
return H ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(pe, {}) }) : R ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(fe, { message: R, onBack: z }) }) : !F || !_ ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
|
|
2813
|
+
fe,
|
|
2814
|
+
{
|
|
2815
|
+
message: "Not connected to messaging service",
|
|
2816
|
+
onBack: z
|
|
2881
2817
|
}
|
|
2882
|
-
)
|
|
2883
|
-
|
|
2884
|
-
resolvedUrl: t,
|
|
2885
|
-
resolvedType: s,
|
|
2886
|
-
title: n,
|
|
2887
|
-
fileSize: r,
|
|
2888
|
-
thumbnailUrl: o
|
|
2889
|
-
}) => {
|
|
2890
|
-
const l = be(s), i = r !== void 0 ? It(r) : void 0;
|
|
2891
|
-
return /* @__PURE__ */ e(
|
|
2892
|
-
St,
|
|
2818
|
+
) }) : j ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(fe, { message: j }) }) : /* @__PURE__ */ e(
|
|
2819
|
+
"div",
|
|
2893
2820
|
{
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
detail: i,
|
|
2898
|
-
thumbnail: /* @__PURE__ */ e(
|
|
2899
|
-
Et,
|
|
2900
|
-
{
|
|
2901
|
-
mimeType: s,
|
|
2902
|
-
sourceUrl: t,
|
|
2903
|
-
thumbnailUrl: o,
|
|
2904
|
-
title: n,
|
|
2905
|
-
variant: "light",
|
|
2906
|
-
containedImage: l === "image" || l === "document"
|
|
2907
|
-
}
|
|
2821
|
+
className: D(
|
|
2822
|
+
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2823
|
+
s
|
|
2908
2824
|
),
|
|
2909
|
-
|
|
2825
|
+
children: /* @__PURE__ */ d("div", { className: "flex h-full min-h-0", children: [
|
|
2826
|
+
/* @__PURE__ */ e(
|
|
2827
|
+
"div",
|
|
2828
|
+
{
|
|
2829
|
+
className: D(
|
|
2830
|
+
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2831
|
+
{
|
|
2832
|
+
"!hidden": m === !1 || p,
|
|
2833
|
+
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2834
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": m !== !1 && !p && Z,
|
|
2835
|
+
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2836
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !p && !Z
|
|
2837
|
+
}
|
|
2838
|
+
),
|
|
2839
|
+
children: /* @__PURE__ */ e(
|
|
2840
|
+
Ct,
|
|
2841
|
+
{
|
|
2842
|
+
onChannelSelect: ie,
|
|
2843
|
+
selectedChannel: $ || void 0,
|
|
2844
|
+
filters: de,
|
|
2845
|
+
channelRenderFilterFn: h,
|
|
2846
|
+
customEmptyStateIndicator: f,
|
|
2847
|
+
renderMessagePreview: E
|
|
2848
|
+
}
|
|
2849
|
+
)
|
|
2850
|
+
}
|
|
2851
|
+
),
|
|
2852
|
+
/* @__PURE__ */ e(
|
|
2853
|
+
"div",
|
|
2854
|
+
{
|
|
2855
|
+
className: D(
|
|
2856
|
+
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2857
|
+
{
|
|
2858
|
+
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2859
|
+
flex: p || Z || l,
|
|
2860
|
+
// Normal mode: hide on mobile when no channel selected
|
|
2861
|
+
"hidden lg:flex": !p && !Z && !l
|
|
2862
|
+
}
|
|
2863
|
+
),
|
|
2864
|
+
children: $ ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2865
|
+
Lt,
|
|
2866
|
+
{
|
|
2867
|
+
channel: $,
|
|
2868
|
+
onBack: ve,
|
|
2869
|
+
showBackButton: !p,
|
|
2870
|
+
renderMessageInputActions: n,
|
|
2871
|
+
renderConversationFooter: r,
|
|
2872
|
+
renderChannelBanner: P,
|
|
2873
|
+
onLeaveConversation: ue,
|
|
2874
|
+
onBlockParticipant: we,
|
|
2875
|
+
CustomChannelEmptyState: c,
|
|
2876
|
+
showDeleteConversation: ae,
|
|
2877
|
+
onDeleteConversationClick: v,
|
|
2878
|
+
onBlockParticipantClick: a,
|
|
2879
|
+
onReportParticipantClick: N,
|
|
2880
|
+
dmAgentEnabled: b,
|
|
2881
|
+
messageMetadata: C,
|
|
2882
|
+
onMessageSent: x,
|
|
2883
|
+
showStarButton: I,
|
|
2884
|
+
chatbotVotingEnabled: w,
|
|
2885
|
+
customProfileContent: U,
|
|
2886
|
+
customChannelActions: k,
|
|
2887
|
+
renderMessage: T,
|
|
2888
|
+
sendButton: M
|
|
2889
|
+
},
|
|
2890
|
+
$.id
|
|
2891
|
+
) }) : l ? (
|
|
2892
|
+
// Show loading while creating/loading direct conversation channel
|
|
2893
|
+
/* @__PURE__ */ e(pe, {})
|
|
2894
|
+
) : /* @__PURE__ */ e(
|
|
2895
|
+
At,
|
|
2896
|
+
{
|
|
2897
|
+
hasChannels: ee,
|
|
2898
|
+
channelsLoaded: W
|
|
2899
|
+
}
|
|
2900
|
+
)
|
|
2901
|
+
}
|
|
2902
|
+
)
|
|
2903
|
+
] })
|
|
2910
2904
|
}
|
|
2911
2905
|
);
|
|
2912
|
-
},
|
|
2913
|
-
|
|
2914
|
-
|
|
2906
|
+
}, sa = ({
|
|
2907
|
+
question: t,
|
|
2908
|
+
onClick: s,
|
|
2909
|
+
loading: n = !1,
|
|
2910
|
+
className: r
|
|
2911
|
+
}) => /* @__PURE__ */ e(
|
|
2912
|
+
"button",
|
|
2913
|
+
{
|
|
2914
|
+
type: "button",
|
|
2915
|
+
onClick: s,
|
|
2916
|
+
disabled: n,
|
|
2917
|
+
style: { backgroundColor: "#E6E5E3" },
|
|
2918
|
+
className: D(
|
|
2919
|
+
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2920
|
+
{
|
|
2921
|
+
"hover:brightness-95 active:brightness-90": !n,
|
|
2922
|
+
"opacity-50 cursor-not-allowed": n
|
|
2923
|
+
},
|
|
2924
|
+
r
|
|
2925
|
+
),
|
|
2926
|
+
children: t
|
|
2927
|
+
}
|
|
2928
|
+
), fa = ({
|
|
2929
|
+
faqs: t,
|
|
2930
|
+
onFaqClick: s,
|
|
2931
|
+
loadingFaqId: n,
|
|
2932
|
+
headerText: r,
|
|
2933
|
+
className: o,
|
|
2934
|
+
avatarImage: l,
|
|
2935
|
+
avatarName: i
|
|
2915
2936
|
}) => {
|
|
2916
|
-
const
|
|
2917
|
-
return
|
|
2918
|
-
|
|
2937
|
+
const c = t.filter((m) => m.enabled).sort((m, u) => (m.order ?? 0) - (u.order ?? 0));
|
|
2938
|
+
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ d("div", { className: "flex gap-3 items-end", children: [
|
|
2939
|
+
(l || i) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2919
2940
|
ne,
|
|
2920
2941
|
{
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
image:
|
|
2924
|
-
|
|
2942
|
+
id: i || "account",
|
|
2943
|
+
name: i || "Account",
|
|
2944
|
+
image: l,
|
|
2945
|
+
size: 24,
|
|
2946
|
+
shape: "circle"
|
|
2925
2947
|
}
|
|
2926
|
-
),
|
|
2927
|
-
/* @__PURE__ */
|
|
2948
|
+
) }),
|
|
2949
|
+
/* @__PURE__ */ d(
|
|
2928
2950
|
"div",
|
|
2929
2951
|
{
|
|
2930
|
-
className: "
|
|
2931
|
-
style: {
|
|
2932
|
-
children:
|
|
2933
|
-
"
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2952
|
+
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2953
|
+
style: { backgroundColor: "#F1F0EE" },
|
|
2954
|
+
children: [
|
|
2955
|
+
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2956
|
+
c.map((m) => /* @__PURE__ */ e(
|
|
2957
|
+
sa,
|
|
2958
|
+
{
|
|
2959
|
+
question: m.question,
|
|
2960
|
+
onClick: () => s(m.id),
|
|
2961
|
+
loading: n === m.id
|
|
2962
|
+
},
|
|
2963
|
+
m.id
|
|
2964
|
+
))
|
|
2965
|
+
]
|
|
2940
2966
|
}
|
|
2941
2967
|
)
|
|
2942
|
-
] });
|
|
2943
|
-
}
|
|
2944
|
-
message: t
|
|
2945
|
-
}) => {
|
|
2946
|
-
const s = Ae(t);
|
|
2947
|
-
if (s)
|
|
2948
|
-
return /* @__PURE__ */ e("div", { className: Re(!0), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !0 }) });
|
|
2949
|
-
const n = Fe(t);
|
|
2950
|
-
return n ? /* @__PURE__ */ e(kt, { ...n }) : null;
|
|
2951
|
-
}, Jn = ({
|
|
2952
|
-
message: t
|
|
2953
|
-
}) => {
|
|
2954
|
-
const s = Ae(t);
|
|
2955
|
-
if (s)
|
|
2956
|
-
return /* @__PURE__ */ e("div", { className: Re(!1), children: /* @__PURE__ */ e(Le, { attachment: s, isMyMessage: !1 }) });
|
|
2957
|
-
const n = Fe(t);
|
|
2958
|
-
return n ? /* @__PURE__ */ e(Mt, { ...n }) : null;
|
|
2959
|
-
}, ca = Object.assign(Xn, {
|
|
2960
|
-
Creator: Zn,
|
|
2961
|
-
Visitor: Jn
|
|
2962
|
-
});
|
|
2968
|
+
] }) });
|
|
2969
|
+
};
|
|
2963
2970
|
export {
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
+
It as A,
|
|
2972
|
+
Jn as C,
|
|
2973
|
+
fa as F,
|
|
2974
|
+
ot as L,
|
|
2975
|
+
ua as M,
|
|
2976
|
+
St as a,
|
|
2977
|
+
he as b,
|
|
2971
2978
|
ne as c,
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2979
|
+
Ct as d,
|
|
2980
|
+
Lt as e,
|
|
2981
|
+
ma as f,
|
|
2982
|
+
sa as g,
|
|
2983
|
+
Dn as h,
|
|
2984
|
+
da as i,
|
|
2985
|
+
ha as j,
|
|
2986
|
+
Vs as k,
|
|
2987
|
+
Mt as l,
|
|
2988
|
+
Oe as m,
|
|
2989
|
+
an as n,
|
|
2990
|
+
zs as o,
|
|
2991
|
+
Fe as r,
|
|
2992
|
+
Tn as u
|
|
2985
2993
|
};
|
|
2986
|
-
//# sourceMappingURL=index-
|
|
2994
|
+
//# sourceMappingURL=index-B_PLgcDi.js.map
|