@linktr.ee/messaging-react 4.0.5 → 4.1.0-rc-1786707283
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-AOwlWMKb.cjs → Card-B5ZGxDcH.cjs} +2 -2
- package/dist/{Card-AOwlWMKb.cjs.map → Card-B5ZGxDcH.cjs.map} +1 -1
- package/dist/{Card-ywEqVYy5.js → Card-LPAZ4FjL.js} +2 -2
- package/dist/{Card-ywEqVYy5.js.map → Card-LPAZ4FjL.js.map} +1 -1
- package/dist/index-B88BeZjY.cjs +3 -0
- package/dist/index-B88BeZjY.cjs.map +1 -0
- package/dist/{index-qmB9uCbU.js → index-Cxj0F8aQ.js} +523 -515
- package/dist/index-Cxj0F8aQ.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.test.tsx +22 -0
- package/src/components/ChannelView.tsx +10 -0
- package/src/components/LinkAttachment/components/_shared/CardShell.tsx +6 -1
- package/dist/index-C_RafNmD.cjs +0 -3
- package/dist/index-C_RafNmD.cjs.map +0 -1
- package/dist/index-qmB9uCbU.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as n, jsxs as f, Fragment as
|
|
2
|
-
import z, { createContext as je, useContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
1
|
+
import { jsx as n, jsxs as f, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import z, { createContext as je, useContext as xe, useCallback as q, useState as B, useRef as H, useEffect as Y, useId as rs, Suspense as is, useMemo as le } from "react";
|
|
3
|
+
import { StreamChatService as ls } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as os, LinkPreviewsManager as tt } from "stream-chat";
|
|
5
|
+
import { Chat as cs, useChannelStateContext as we, useChatContext as He, DateSeparator as ds, useMessageContext as fe, MessageStatus as us, MessageErrorIcon as nt, MessageText as ze, areMessageUIPropsEqual as ms, useMessageReminder as hs, useComponentContext as dn, Attachment as fs, EditMessageModal as gs, MessageBlocked as ps, MessageBouncePrompt as bs, MessageDeleted as vs, MessageIsThreadReplyInChannelButtonIndicator as xs, MessageRepliesCountButton as ws, ReminderNotification as _s, StreamedMessageText as ys, messageHasAttachments as Ns, messageHasReactions as ks, isDateSeparatorMessage as Cs, isMessageBlocked as Ss, isMessageBounced as Es, MessageBounceModal as Is, Poll as Ts, useMessageComposer as As, useStateStore as Rs, MessageInput as Ht, useMessageInputContext as Ls, useMessageComposerHasSendableData as Ms, AttachmentPreviewList as Ds, QuotedMessagePreview as Os, TextareaComposer as Ps, MessageTimestamp as We, AIStates as Xe, useTypingContext as zs, useAIState as Fs, Channel as $s, WithComponents as Bs, Window as Us, MessageList as Vt, ChannelList as js, InfiniteScroll as Hs } from "stream-chat-react";
|
|
6
|
+
import { isOfficialChannel as un, OFFICIAL_SENDER_USER_ID as Vs, MESSAGE_CUSTOM_TYPE as oe, isDmAgentSystemType as Gt, isAgeSafetySystemType as Gs, resolveRichCardImagePresentation as Ys, selectEnabledFaqs as Ws } from "@linktr.ee/messaging-taxonomy";
|
|
6
7
|
import k from "classnames";
|
|
7
|
-
import { StarIcon as st, DotsThreeIcon as
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const pn = je({
|
|
8
|
+
import { StarIcon as st, DotsThreeIcon as Xs, SpinnerGapIcon as Oe, SignOutIcon as qs, ProhibitInsetIcon as Yt, FlagIcon as mn, CurrencyDollarIcon as Ks, CaretRightIcon as hn, ArrowLeftIcon as Zs, FileIcon as fn, ImageIcon as Js, SpeakerHighIcon as Qs, VideoCameraIcon as gn, FileMdIcon as ea, FileTextIcon as ta, FileZipIcon as na, FilePptIcon as sa, FileCsvIcon as aa, FileXlsIcon as ra, FileDocIcon as ia, FilePdfIcon as la, CircleNotchIcon as be, PlayIcon as at, PauseIcon as oa, LinkIcon as ca, DownloadSimpleIcon as Se, GiftIcon as da, WarningCircleIcon as ua, MegaphoneIcon as ma, ChecksIcon as ha, XIcon as it, PencilSimpleIcon as fa, CaretLeftIcon as ga, TrashSimpleIcon as pa, ArrowUpIcon as ba, SparkleIcon as va, ProhibitIcon as xa } from "@phosphor-icons/react";
|
|
9
|
+
import { MessageActions as wa, DefaultDropdownActionButton as pn } from "stream-chat-react/experimental";
|
|
10
|
+
const bn = je({
|
|
11
11
|
service: null,
|
|
12
12
|
client: null,
|
|
13
13
|
isConnected: !1,
|
|
@@ -17,7 +17,7 @@ const pn = je({
|
|
|
17
17
|
refreshConnection: async () => {
|
|
18
18
|
},
|
|
19
19
|
debug: !1
|
|
20
|
-
}), lt = () =>
|
|
20
|
+
}), lt = () => xe(bn), eo = ({
|
|
21
21
|
children: e,
|
|
22
22
|
user: t,
|
|
23
23
|
serviceConfig: s,
|
|
@@ -27,7 +27,7 @@ const pn = je({
|
|
|
27
27
|
client: o
|
|
28
28
|
}) => {
|
|
29
29
|
var S, C;
|
|
30
|
-
const l =
|
|
30
|
+
const l = q(
|
|
31
31
|
(A, ...P) => {
|
|
32
32
|
i && console.log(`🔥 [MessagingProvider] ${A}`, ...P);
|
|
33
33
|
},
|
|
@@ -39,16 +39,16 @@ const pn = je({
|
|
|
39
39
|
serviceConfig: !!s,
|
|
40
40
|
capabilities: Object.keys(r)
|
|
41
41
|
});
|
|
42
|
-
const [d, u] = B(null), [h, m] = B(null), [g, c] = B(!1), [p, w] = B(!1), [v, x] = B(null), b =
|
|
42
|
+
const [d, u] = B(null), [h, m] = B(null), [g, c] = B(!1), [p, w] = B(!1), [v, x] = B(null), b = H(!1), N = H(null), _ = H(s);
|
|
43
43
|
_.current = s;
|
|
44
|
-
const T =
|
|
44
|
+
const T = H(i);
|
|
45
45
|
T.current = i;
|
|
46
|
-
const L =
|
|
46
|
+
const L = H({
|
|
47
47
|
userId: t == null ? void 0 : t.id,
|
|
48
48
|
apiKey: a,
|
|
49
49
|
serviceConfig: s,
|
|
50
50
|
capabilities: r
|
|
51
|
-
}), E =
|
|
51
|
+
}), E = H(0);
|
|
52
52
|
E.current++, l("📊 RENDER INFO", {
|
|
53
53
|
renderCount: E.current,
|
|
54
54
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
@@ -64,8 +64,8 @@ const pn = je({
|
|
|
64
64
|
serviceConfig: s,
|
|
65
65
|
capabilities: r
|
|
66
66
|
};
|
|
67
|
-
const $ =
|
|
68
|
-
!o && a && ((S = $.current) == null ? void 0 : S.apiKey) !== a && ($.current = { apiKey: a, client: new
|
|
67
|
+
const $ = H(null);
|
|
68
|
+
!o && a && ((S = $.current) == null ? void 0 : S.apiKey) !== a && ($.current = { apiKey: a, client: new os(a) });
|
|
69
69
|
const F = o || (a ? ((C = $.current) == null ? void 0 : C.client) ?? null : null);
|
|
70
70
|
Y(() => {
|
|
71
71
|
const A = E.current, P = _.current;
|
|
@@ -84,7 +84,7 @@ const pn = je({
|
|
|
84
84
|
renderCount: A,
|
|
85
85
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
86
86
|
});
|
|
87
|
-
const U = new
|
|
87
|
+
const U = new ls({
|
|
88
88
|
...P,
|
|
89
89
|
apiKey: a,
|
|
90
90
|
debug: T.current,
|
|
@@ -95,7 +95,7 @@ const pn = je({
|
|
|
95
95
|
serviceInstance: !!U
|
|
96
96
|
});
|
|
97
97
|
}, [a, F, o]);
|
|
98
|
-
const R =
|
|
98
|
+
const R = H(null);
|
|
99
99
|
Y(() => {
|
|
100
100
|
var P, U;
|
|
101
101
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
@@ -126,13 +126,13 @@ const pn = je({
|
|
|
126
126
|
l("🚀 STARTING USER CONNECTION", { userId: t.id }), b.current = !0, w(!0), x(null);
|
|
127
127
|
try {
|
|
128
128
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
129
|
-
const
|
|
130
|
-
m(
|
|
129
|
+
const V = await d.connectUser(t);
|
|
130
|
+
m(V), c(!0), R.current = { serviceId: d, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
131
131
|
userId: t.id,
|
|
132
|
-
clientId:
|
|
132
|
+
clientId: V.userID
|
|
133
133
|
});
|
|
134
|
-
} catch (
|
|
135
|
-
const te =
|
|
134
|
+
} catch (V) {
|
|
135
|
+
const te = V instanceof Error ? V.message : "Connection failed";
|
|
136
136
|
x(te), l("❌ USER CONNECTION ERROR", {
|
|
137
137
|
userId: t.id,
|
|
138
138
|
error: te
|
|
@@ -151,7 +151,7 @@ const pn = je({
|
|
|
151
151
|
A && (R.current = null, (P = N.current) == null || P.disconnectUser().catch(console.error));
|
|
152
152
|
};
|
|
153
153
|
}, [F]);
|
|
154
|
-
const I =
|
|
154
|
+
const I = q(async () => {
|
|
155
155
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
156
156
|
hasService: !!d,
|
|
157
157
|
hasUser: !!t
|
|
@@ -175,7 +175,7 @@ const pn = je({
|
|
|
175
175
|
w(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
}, [d, t, l, o]),
|
|
178
|
+
}, [d, t, l, o]), D = z.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!d,
|
|
180
180
|
hasClient: !!h,
|
|
181
181
|
isConnected: g,
|
|
@@ -214,9 +214,9 @@ const pn = je({
|
|
|
214
214
|
return l("🔄 RENDER END", {
|
|
215
215
|
renderCount: E.current,
|
|
216
216
|
willRenderChat: !!F,
|
|
217
|
-
contextValueReady: !!
|
|
218
|
-
}), /* @__PURE__ */ n(
|
|
219
|
-
|
|
217
|
+
contextValueReady: !!D
|
|
218
|
+
}), /* @__PURE__ */ n(bn.Provider, { value: D, children: F ? /* @__PURE__ */ n(
|
|
219
|
+
cs,
|
|
220
220
|
{
|
|
221
221
|
client: F,
|
|
222
222
|
customClasses: {
|
|
@@ -225,7 +225,7 @@ const pn = je({
|
|
|
225
225
|
children: e
|
|
226
226
|
}
|
|
227
227
|
) : e });
|
|
228
|
-
}, _a = () => lt(),
|
|
228
|
+
}, _a = () => lt(), vn = (e) => {
|
|
229
229
|
var a, r;
|
|
230
230
|
const [t, s] = B(
|
|
231
231
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -248,13 +248,13 @@ const pn = je({
|
|
|
248
248
|
};
|
|
249
249
|
}, [e]), t;
|
|
250
250
|
};
|
|
251
|
-
function
|
|
251
|
+
function xn(e, t, s) {
|
|
252
252
|
const a = Object.values(e || {});
|
|
253
|
-
if (
|
|
253
|
+
if (un(s)) {
|
|
254
254
|
const r = a.find(
|
|
255
255
|
(i) => {
|
|
256
256
|
var o;
|
|
257
|
-
return ((o = i.user) == null ? void 0 : o.id) ===
|
|
257
|
+
return ((o = i.user) == null ? void 0 : o.id) === Vs;
|
|
258
258
|
}
|
|
259
259
|
);
|
|
260
260
|
if (r) return r;
|
|
@@ -274,7 +274,7 @@ function Wt(e, t) {
|
|
|
274
274
|
const s = e == null ? void 0 : e.trim();
|
|
275
275
|
return !s || t && s === t || t && s === `Follower ${t}` ? !1 : !Na(s);
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function wn(e) {
|
|
278
278
|
return Wt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Wt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
279
279
|
}
|
|
280
280
|
const Xt = [
|
|
@@ -313,16 +313,16 @@ function ka(e) {
|
|
|
313
313
|
}
|
|
314
314
|
return Math.abs(t);
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function _n(e) {
|
|
317
317
|
return Xt[ka(e) % Xt.length];
|
|
318
318
|
}
|
|
319
319
|
function Ca(e) {
|
|
320
|
-
return
|
|
320
|
+
return _n(e).emoji;
|
|
321
321
|
}
|
|
322
322
|
function Sa(e) {
|
|
323
|
-
return
|
|
323
|
+
return _n(e).bgColor;
|
|
324
324
|
}
|
|
325
|
-
const
|
|
325
|
+
const _e = ({
|
|
326
326
|
id: e,
|
|
327
327
|
image: t,
|
|
328
328
|
size: s = 40,
|
|
@@ -395,8 +395,8 @@ const we = ({
|
|
|
395
395
|
onActionComplete: u,
|
|
396
396
|
logLabel: h = "useChannelModerationActions"
|
|
397
397
|
}) => {
|
|
398
|
-
var
|
|
399
|
-
const { service: m, debug: g } = lt(), c = (
|
|
398
|
+
var D;
|
|
399
|
+
const { service: m, debug: g } = lt(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, p = !!(a && s && m && c), [w, v] = B(!1), [x, b] = B(null), [N, _] = B(!1), [T, L] = B(!1), E = p && ((x == null ? void 0 : x.participantId) !== c || (x == null ? void 0 : x.service) !== m);
|
|
400
400
|
return Y(() => {
|
|
401
401
|
if (!p || !m || !c) {
|
|
402
402
|
v(!1), b(null);
|
|
@@ -469,7 +469,7 @@ const we = ({
|
|
|
469
469
|
d == null || d(), u == null || u(), window.open(Ea, "_blank", "noopener,noreferrer");
|
|
470
470
|
}
|
|
471
471
|
};
|
|
472
|
-
},
|
|
472
|
+
}, Ne = ({
|
|
473
473
|
variant: e = "default",
|
|
474
474
|
className: t,
|
|
475
475
|
children: s,
|
|
@@ -500,7 +500,7 @@ const we = ({
|
|
|
500
500
|
customChannelActions: h,
|
|
501
501
|
triggerClassName: m
|
|
502
502
|
}) => {
|
|
503
|
-
const [g, c] = B(!1), p =
|
|
503
|
+
const [g, c] = B(!1), p = H(null), w = rs(), v = q(() => c(!1), []), {
|
|
504
504
|
isParticipantBlocked: x,
|
|
505
505
|
isCheckingBlockedStatus: b,
|
|
506
506
|
isLeaving: N,
|
|
@@ -524,10 +524,10 @@ const we = ({
|
|
|
524
524
|
});
|
|
525
525
|
return Y(() => {
|
|
526
526
|
if (!g) return;
|
|
527
|
-
const R = (
|
|
528
|
-
p.current && !p.current.contains(
|
|
529
|
-
}, I = (
|
|
530
|
-
|
|
527
|
+
const R = (D) => {
|
|
528
|
+
p.current && !p.current.contains(D.target) && c(!1);
|
|
529
|
+
}, I = (D) => {
|
|
530
|
+
D.key === "Escape" && c(!1);
|
|
531
531
|
};
|
|
532
532
|
return document.addEventListener("mousedown", R), document.addEventListener("keydown", I), () => {
|
|
533
533
|
document.removeEventListener("mousedown", R), document.removeEventListener("keydown", I);
|
|
@@ -543,7 +543,7 @@ const we = ({
|
|
|
543
543
|
"aria-controls": g ? w : void 0,
|
|
544
544
|
onClick: () => c((R) => !R),
|
|
545
545
|
children: [
|
|
546
|
-
/* @__PURE__ */ n(
|
|
546
|
+
/* @__PURE__ */ n(Xs, { className: "size-5 text-black/90" }),
|
|
547
547
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
548
548
|
]
|
|
549
549
|
}
|
|
@@ -559,13 +559,13 @@ const we = ({
|
|
|
559
559
|
),
|
|
560
560
|
children: /* @__PURE__ */ f("ul", { className: "flex flex-col gap-1", children: [
|
|
561
561
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
|
|
562
|
-
|
|
562
|
+
Ne,
|
|
563
563
|
{
|
|
564
564
|
onClick: T,
|
|
565
565
|
disabled: N,
|
|
566
566
|
"aria-busy": N,
|
|
567
567
|
children: [
|
|
568
|
-
N ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(
|
|
568
|
+
N ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(qs, { className: "h-5 w-5" }),
|
|
569
569
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
570
570
|
]
|
|
571
571
|
}
|
|
@@ -573,35 +573,35 @@ const we = ({
|
|
|
573
573
|
a && /* @__PURE__ */ n("li", { children: b ? (
|
|
574
574
|
// Block status not yet resolved — show a disabled placeholder
|
|
575
575
|
// so a premature click can't act on a stale block state.
|
|
576
|
-
/* @__PURE__ */ f(
|
|
576
|
+
/* @__PURE__ */ f(Ne, { disabled: !0, "aria-busy": !0, children: [
|
|
577
577
|
/* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }),
|
|
578
578
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
579
579
|
] })
|
|
580
580
|
) : x ? /* @__PURE__ */ f(
|
|
581
|
-
|
|
581
|
+
Ne,
|
|
582
582
|
{
|
|
583
583
|
onClick: E,
|
|
584
584
|
disabled: _,
|
|
585
585
|
"aria-busy": _,
|
|
586
586
|
children: [
|
|
587
|
-
_ ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(
|
|
587
|
+
_ ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Yt, { className: "h-5 w-5" }),
|
|
588
588
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
589
589
|
]
|
|
590
590
|
}
|
|
591
591
|
) : /* @__PURE__ */ f(
|
|
592
|
-
|
|
592
|
+
Ne,
|
|
593
593
|
{
|
|
594
594
|
onClick: L,
|
|
595
595
|
disabled: _,
|
|
596
596
|
"aria-busy": _,
|
|
597
597
|
children: [
|
|
598
|
-
_ ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(
|
|
598
|
+
_ ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Yt, { className: "h-5 w-5" }),
|
|
599
599
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
600
600
|
]
|
|
601
601
|
}
|
|
602
602
|
) }),
|
|
603
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
|
|
604
|
-
/* @__PURE__ */ n(
|
|
603
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(Ne, { variant: "danger", onClick: $, children: [
|
|
604
|
+
/* @__PURE__ */ n(mn, { className: "h-5 w-5" }),
|
|
605
605
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
606
606
|
] }) }),
|
|
607
607
|
h
|
|
@@ -627,18 +627,18 @@ const we = ({
|
|
|
627
627
|
showChannelInfo: p = !0,
|
|
628
628
|
onParticipantNameClick: w
|
|
629
629
|
}) => {
|
|
630
|
-
var I,
|
|
631
|
-
const { channel: v } =
|
|
630
|
+
var I, D, S, C;
|
|
631
|
+
const { channel: v } = we(), { client: x } = He(), b = z.useMemo(
|
|
632
632
|
() => {
|
|
633
633
|
var A;
|
|
634
|
-
return
|
|
634
|
+
return xn(
|
|
635
635
|
(A = v.state) == null ? void 0 : A.members,
|
|
636
636
|
x == null ? void 0 : x.userID,
|
|
637
637
|
v.type
|
|
638
638
|
);
|
|
639
639
|
},
|
|
640
640
|
[(I = v.state) == null ? void 0 : I.members, x == null ? void 0 : x.userID, v.type]
|
|
641
|
-
), N =
|
|
641
|
+
), N = wn(b == null ? void 0 : b.user), _ = (D = b == null ? void 0 : b.user) == null ? void 0 : D.image, T = vn(v), L = Ra((S = v.data) == null ? void 0 : S.customer_tag) && (b == null ? void 0 : b.is_follower) === !0, E = a && T, $ = L || E || !!w, F = async () => {
|
|
642
642
|
try {
|
|
643
643
|
T ? await v.unpin() : await v.pin();
|
|
644
644
|
} catch (A) {
|
|
@@ -647,9 +647,9 @@ const we = ({
|
|
|
647
647
|
A
|
|
648
648
|
);
|
|
649
649
|
}
|
|
650
|
-
}, R = /* @__PURE__ */ f(
|
|
650
|
+
}, R = /* @__PURE__ */ f(K, { children: [
|
|
651
651
|
/* @__PURE__ */ n(
|
|
652
|
-
|
|
652
|
+
_e,
|
|
653
653
|
{
|
|
654
654
|
id: ((C = b == null ? void 0 : b.user) == null ? void 0 : C.id) || v.id || "unknown",
|
|
655
655
|
name: N,
|
|
@@ -674,7 +674,7 @@ const we = ({
|
|
|
674
674
|
{
|
|
675
675
|
"aria-label": "Paid customer",
|
|
676
676
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
677
|
-
children: /* @__PURE__ */ n(
|
|
677
|
+
children: /* @__PURE__ */ n(Ks, { className: "size-2.5", weight: "bold" })
|
|
678
678
|
}
|
|
679
679
|
),
|
|
680
680
|
E && /* @__PURE__ */ n("span", { className: "messaging-header-star-badge flex overflow-hidden", children: /* @__PURE__ */ n(
|
|
@@ -686,7 +686,7 @@ const we = ({
|
|
|
686
686
|
}
|
|
687
687
|
) }),
|
|
688
688
|
w && /* @__PURE__ */ n(
|
|
689
|
-
|
|
689
|
+
hn,
|
|
690
690
|
{
|
|
691
691
|
"aria-hidden": "true",
|
|
692
692
|
className: "size-4 shrink-0 text-black/65",
|
|
@@ -717,7 +717,7 @@ const we = ({
|
|
|
717
717
|
}),
|
|
718
718
|
type: "button",
|
|
719
719
|
"aria-label": "Back to conversations",
|
|
720
|
-
children: /* @__PURE__ */ n(
|
|
720
|
+
children: /* @__PURE__ */ n(Zs, { className: "size-5 text-black/90" })
|
|
721
721
|
}
|
|
722
722
|
) }),
|
|
723
723
|
/* @__PURE__ */ n("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: w ? /* @__PURE__ */ n(
|
|
@@ -772,11 +772,11 @@ const we = ({
|
|
|
772
772
|
] })
|
|
773
773
|
}
|
|
774
774
|
);
|
|
775
|
-
}, Ma = (e) => /* @__PURE__ */ n(
|
|
775
|
+
}, Ma = (e) => /* @__PURE__ */ n(ds, { ...e, position: "center" });
|
|
776
776
|
function Da(e) {
|
|
777
777
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
778
778
|
}
|
|
779
|
-
function
|
|
779
|
+
function yn({
|
|
780
780
|
message: e,
|
|
781
781
|
viewerLanguage: t
|
|
782
782
|
}) {
|
|
@@ -818,33 +818,33 @@ const Fa = [
|
|
|
818
818
|
function de(e) {
|
|
819
819
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
820
820
|
}
|
|
821
|
-
function
|
|
821
|
+
function Nn(e) {
|
|
822
822
|
const t = Fa.find(
|
|
823
823
|
([s]) => s.test(e)
|
|
824
824
|
);
|
|
825
825
|
return t ? t[1] : "generic";
|
|
826
826
|
}
|
|
827
827
|
const $a = {
|
|
828
|
-
video:
|
|
829
|
-
audio:
|
|
830
|
-
image:
|
|
831
|
-
document:
|
|
828
|
+
video: gn,
|
|
829
|
+
audio: Qs,
|
|
830
|
+
image: Js,
|
|
831
|
+
document: fn
|
|
832
832
|
}, Ba = {
|
|
833
|
-
pdf:
|
|
834
|
-
doc:
|
|
835
|
-
xls:
|
|
836
|
-
csv:
|
|
837
|
-
ppt:
|
|
838
|
-
zip:
|
|
839
|
-
text:
|
|
840
|
-
markdown:
|
|
841
|
-
generic:
|
|
833
|
+
pdf: la,
|
|
834
|
+
doc: ia,
|
|
835
|
+
xls: ra,
|
|
836
|
+
csv: aa,
|
|
837
|
+
ppt: sa,
|
|
838
|
+
zip: na,
|
|
839
|
+
text: ta,
|
|
840
|
+
markdown: ea,
|
|
841
|
+
generic: fn
|
|
842
842
|
};
|
|
843
843
|
function Ua(e) {
|
|
844
844
|
const t = de(e);
|
|
845
|
-
return t !== "document" ? $a[t] : Ba[
|
|
845
|
+
return t !== "document" ? $a[t] : Ba[Nn(e)];
|
|
846
846
|
}
|
|
847
|
-
function
|
|
847
|
+
function ve(e, t) {
|
|
848
848
|
return z.createElement(Ua(e), t);
|
|
849
849
|
}
|
|
850
850
|
const ja = (e) => {
|
|
@@ -862,23 +862,23 @@ const ja = (e) => {
|
|
|
862
862
|
muted: d = !1,
|
|
863
863
|
onContainerClick: u
|
|
864
864
|
}) => {
|
|
865
|
-
const h = de(t), m =
|
|
865
|
+
const h = de(t), m = H(null), g = H(null), c = H(null), p = H(r), [w, v] = B(a), [x, b] = B(0), [N, _] = B(!1), [T, L] = B(!1), [E, $] = B(!1), [F, R] = B(!1), [I, D] = B(!0), [S, C] = B(null), A = q(() => {
|
|
866
866
|
$(!1), v(!0);
|
|
867
|
-
}, []), P =
|
|
868
|
-
const
|
|
869
|
-
if (!
|
|
870
|
-
const W =
|
|
867
|
+
}, []), P = q((y) => {
|
|
868
|
+
const M = g.current;
|
|
869
|
+
if (!M) return 0;
|
|
870
|
+
const W = M.getBoundingClientRect();
|
|
871
871
|
return Math.max(
|
|
872
872
|
0,
|
|
873
873
|
Math.min(1, (ja(y) - W.left) / W.width)
|
|
874
874
|
);
|
|
875
|
-
}, []), U =
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
}, []),
|
|
875
|
+
}, []), U = q((y) => {
|
|
876
|
+
const M = m.current;
|
|
877
|
+
M && M.duration && (M.currentTime = y * M.duration);
|
|
878
|
+
}, []), V = (y) => {
|
|
879
879
|
y.stopPropagation(), _(!0);
|
|
880
|
-
const
|
|
881
|
-
b(
|
|
880
|
+
const M = P(y);
|
|
881
|
+
b(M), U(M);
|
|
882
882
|
};
|
|
883
883
|
Y(() => {
|
|
884
884
|
r !== void 0 && r !== p.current && (p.current = r, v(r));
|
|
@@ -888,40 +888,40 @@ const ja = (e) => {
|
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
890
|
const y = () => {
|
|
891
|
-
const
|
|
892
|
-
|
|
891
|
+
const M = m.current;
|
|
892
|
+
M && M.duration && !N && b(M.currentTime / M.duration), c.current = requestAnimationFrame(y);
|
|
893
893
|
};
|
|
894
894
|
return c.current = requestAnimationFrame(y), () => {
|
|
895
895
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
896
896
|
};
|
|
897
897
|
}, [w, N]), Y(() => {
|
|
898
898
|
const y = m.current;
|
|
899
|
-
y && (w ? y.play().catch((
|
|
899
|
+
y && (w ? y.play().catch((M) => {
|
|
900
900
|
v(!1), $(!0);
|
|
901
901
|
}) : y.pause());
|
|
902
902
|
}, [w]), Y(() => {
|
|
903
903
|
if (!N) return;
|
|
904
|
-
const y = (W) => b(P(W)),
|
|
904
|
+
const y = (W) => b(P(W)), M = (W) => {
|
|
905
905
|
_(!1), U(P(W));
|
|
906
906
|
};
|
|
907
|
-
return window.addEventListener("mousemove", y), window.addEventListener("mouseup",
|
|
908
|
-
window.removeEventListener("mousemove", y), window.removeEventListener("mouseup",
|
|
907
|
+
return window.addEventListener("mousemove", y), window.addEventListener("mouseup", M), window.addEventListener("touchmove", y, { passive: !0 }), window.addEventListener("touchend", M), () => {
|
|
908
|
+
window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", M), window.removeEventListener("touchmove", y), window.removeEventListener("touchend", M);
|
|
909
909
|
};
|
|
910
910
|
}, [N, P, U]);
|
|
911
|
-
const te = S ? { aspectRatio: String(S) } : void 0,
|
|
911
|
+
const te = S ? { aspectRatio: String(S) } : void 0, Z = S ? "" : " aspect-video", G = Math.round(x * 100);
|
|
912
912
|
return /* @__PURE__ */ f(
|
|
913
913
|
"div",
|
|
914
914
|
{
|
|
915
915
|
role: "button",
|
|
916
916
|
tabIndex: 0,
|
|
917
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
917
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${Z}`,
|
|
918
918
|
style: te,
|
|
919
919
|
onClick: (y) => {
|
|
920
920
|
if (u) {
|
|
921
921
|
u(y);
|
|
922
922
|
return;
|
|
923
923
|
}
|
|
924
|
-
E || o && v((
|
|
924
|
+
E || o && v((M) => !M);
|
|
925
925
|
},
|
|
926
926
|
onKeyDown: (y) => {
|
|
927
927
|
if (!(y.key !== "Enter" && y.key !== " ")) {
|
|
@@ -929,7 +929,7 @@ const ja = (e) => {
|
|
|
929
929
|
u(y);
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
E || o && v((
|
|
932
|
+
E || o && v((M) => !M);
|
|
933
933
|
}
|
|
934
934
|
},
|
|
935
935
|
children: [
|
|
@@ -941,7 +941,7 @@ const ja = (e) => {
|
|
|
941
941
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
942
942
|
}
|
|
943
943
|
),
|
|
944
|
-
!s && (h === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children:
|
|
944
|
+
!s && (h === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ve(t, {
|
|
945
945
|
className: "size-12 text-black/20",
|
|
946
946
|
weight: "regular"
|
|
947
947
|
}) }),
|
|
@@ -955,7 +955,7 @@ const ja = (e) => {
|
|
|
955
955
|
style: { width: "100%", height: "100%" },
|
|
956
956
|
onLoadStart: () => R(!0),
|
|
957
957
|
onCanPlay: () => {
|
|
958
|
-
R(!1),
|
|
958
|
+
R(!1), D(!1);
|
|
959
959
|
},
|
|
960
960
|
onWaiting: () => R(!0),
|
|
961
961
|
onPlay: () => $(!1),
|
|
@@ -975,7 +975,7 @@ const ja = (e) => {
|
|
|
975
975
|
style: { width: "100%", height: "100%" },
|
|
976
976
|
onLoadStart: () => R(!0),
|
|
977
977
|
onCanPlay: () => {
|
|
978
|
-
R(!1),
|
|
978
|
+
R(!1), D(!1);
|
|
979
979
|
},
|
|
980
980
|
onWaiting: () => R(!0),
|
|
981
981
|
onPlay: () => $(!1),
|
|
@@ -990,7 +990,7 @@ const ja = (e) => {
|
|
|
990
990
|
}
|
|
991
991
|
) }),
|
|
992
992
|
F && !E && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
993
|
-
|
|
993
|
+
be,
|
|
994
994
|
{
|
|
995
995
|
className: "size-8 animate-spin text-white/80",
|
|
996
996
|
weight: "bold"
|
|
@@ -1017,14 +1017,14 @@ const ja = (e) => {
|
|
|
1017
1017
|
{
|
|
1018
1018
|
role: "slider",
|
|
1019
1019
|
"aria-label": "Playback position",
|
|
1020
|
-
"aria-valuenow":
|
|
1020
|
+
"aria-valuenow": G,
|
|
1021
1021
|
"aria-valuemin": 0,
|
|
1022
1022
|
"aria-valuemax": 100,
|
|
1023
1023
|
tabIndex: 0,
|
|
1024
1024
|
ref: g,
|
|
1025
1025
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1026
|
-
onMouseDown:
|
|
1027
|
-
onTouchStart:
|
|
1026
|
+
onMouseDown: V,
|
|
1027
|
+
onTouchStart: V,
|
|
1028
1028
|
onClick: (y) => y.stopPropagation(),
|
|
1029
1029
|
onKeyDown: (y) => {
|
|
1030
1030
|
y.key === "ArrowRight" && U(Math.min(1, x + 0.05)), y.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
|
|
@@ -1033,7 +1033,7 @@ const ja = (e) => {
|
|
|
1033
1033
|
"div",
|
|
1034
1034
|
{
|
|
1035
1035
|
className: "h-full rounded-full bg-white",
|
|
1036
|
-
style: { width: `${
|
|
1036
|
+
style: { width: `${G}%` }
|
|
1037
1037
|
}
|
|
1038
1038
|
) })
|
|
1039
1039
|
}
|
|
@@ -1044,11 +1044,11 @@ const ja = (e) => {
|
|
|
1044
1044
|
{
|
|
1045
1045
|
type: "button",
|
|
1046
1046
|
onClick: (y) => {
|
|
1047
|
-
y.stopPropagation(), v((
|
|
1047
|
+
y.stopPropagation(), v((M) => !M);
|
|
1048
1048
|
},
|
|
1049
1049
|
className: "shrink-0 text-white",
|
|
1050
1050
|
"aria-label": w ? "Pause" : "Play",
|
|
1051
|
-
children: w ? /* @__PURE__ */ n(
|
|
1051
|
+
children: w ? /* @__PURE__ */ n(oa, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(at, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1052
1052
|
}
|
|
1053
1053
|
),
|
|
1054
1054
|
/* @__PURE__ */ f(
|
|
@@ -1056,14 +1056,14 @@ const ja = (e) => {
|
|
|
1056
1056
|
{
|
|
1057
1057
|
role: "slider",
|
|
1058
1058
|
"aria-label": "Playback position",
|
|
1059
|
-
"aria-valuenow":
|
|
1059
|
+
"aria-valuenow": G,
|
|
1060
1060
|
"aria-valuemin": 0,
|
|
1061
1061
|
"aria-valuemax": 100,
|
|
1062
1062
|
tabIndex: 0,
|
|
1063
1063
|
ref: g,
|
|
1064
1064
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1065
|
-
onMouseDown:
|
|
1066
|
-
onTouchStart:
|
|
1065
|
+
onMouseDown: V,
|
|
1066
|
+
onTouchStart: V,
|
|
1067
1067
|
onClick: (y) => y.stopPropagation(),
|
|
1068
1068
|
onMouseEnter: () => L(!0),
|
|
1069
1069
|
onMouseLeave: () => L(!1),
|
|
@@ -1079,7 +1079,7 @@ const ja = (e) => {
|
|
|
1079
1079
|
"div",
|
|
1080
1080
|
{
|
|
1081
1081
|
className: "h-full rounded-full bg-white",
|
|
1082
|
-
style: { width: `${
|
|
1082
|
+
style: { width: `${G}%` }
|
|
1083
1083
|
}
|
|
1084
1084
|
)
|
|
1085
1085
|
}
|
|
@@ -1088,7 +1088,7 @@ const ja = (e) => {
|
|
|
1088
1088
|
"div",
|
|
1089
1089
|
{
|
|
1090
1090
|
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || N ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1091
|
-
style: { left: `${
|
|
1091
|
+
style: { left: `${G}%` }
|
|
1092
1092
|
}
|
|
1093
1093
|
)
|
|
1094
1094
|
]
|
|
@@ -1098,7 +1098,7 @@ const ja = (e) => {
|
|
|
1098
1098
|
]
|
|
1099
1099
|
}
|
|
1100
1100
|
);
|
|
1101
|
-
}, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Va = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5",
|
|
1101
|
+
}, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Va = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", kn = ({
|
|
1102
1102
|
mimeType: e,
|
|
1103
1103
|
sourceUrl: t,
|
|
1104
1104
|
thumbnailUrl: s,
|
|
@@ -1155,7 +1155,7 @@ const ja = (e) => {
|
|
|
1155
1155
|
"div",
|
|
1156
1156
|
{
|
|
1157
1157
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1158
|
-
children:
|
|
1158
|
+
children: ve(e, {
|
|
1159
1159
|
className: Kt(r),
|
|
1160
1160
|
weight: "regular"
|
|
1161
1161
|
})
|
|
@@ -1172,13 +1172,13 @@ const ja = (e) => {
|
|
|
1172
1172
|
"div",
|
|
1173
1173
|
{
|
|
1174
1174
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1175
|
-
children:
|
|
1175
|
+
children: ve(e, {
|
|
1176
1176
|
className: Kt(r),
|
|
1177
1177
|
weight: "regular"
|
|
1178
1178
|
})
|
|
1179
1179
|
}
|
|
1180
1180
|
);
|
|
1181
|
-
},
|
|
1181
|
+
}, Cn = ({
|
|
1182
1182
|
variant: e,
|
|
1183
1183
|
thumbnail: t,
|
|
1184
1184
|
title: s,
|
|
@@ -1219,7 +1219,7 @@ const ja = (e) => {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
),
|
|
1221
1221
|
/* @__PURE__ */ f("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1222
|
-
|
|
1222
|
+
ve(r, {
|
|
1223
1223
|
className: k(
|
|
1224
1224
|
"size-5 shrink-0",
|
|
1225
1225
|
g ? "text-white/55" : "text-black/55"
|
|
@@ -1244,7 +1244,7 @@ const ja = (e) => {
|
|
|
1244
1244
|
}
|
|
1245
1245
|
);
|
|
1246
1246
|
};
|
|
1247
|
-
function
|
|
1247
|
+
function Sn(e) {
|
|
1248
1248
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1249
1249
|
}
|
|
1250
1250
|
function ot(e) {
|
|
@@ -1278,7 +1278,7 @@ const ct = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1278
1278
|
"div",
|
|
1279
1279
|
{
|
|
1280
1280
|
className: `aspect-video w-full rounded-[20px] ${Ga(t)} flex items-center justify-center`,
|
|
1281
|
-
children: /* @__PURE__ */ n(
|
|
1281
|
+
children: /* @__PURE__ */ n(ca, { className: `size-12 ${qa(t)}` })
|
|
1282
1282
|
}
|
|
1283
1283
|
) }),
|
|
1284
1284
|
/* @__PURE__ */ f("div", { className: "px-3 pb-3", children: [
|
|
@@ -1316,12 +1316,12 @@ const ct = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1316
1316
|
}
|
|
1317
1317
|
) : /* @__PURE__ */ n("div", { className: "block", children: u });
|
|
1318
1318
|
};
|
|
1319
|
-
function
|
|
1319
|
+
function En(e) {
|
|
1320
1320
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1321
1321
|
}
|
|
1322
1322
|
function dt(e) {
|
|
1323
1323
|
var t;
|
|
1324
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1324
|
+
return (t = e.attachments) == null ? void 0 : t.find(En);
|
|
1325
1325
|
}
|
|
1326
1326
|
async function Ka(e, t) {
|
|
1327
1327
|
let s;
|
|
@@ -1356,13 +1356,13 @@ const Za = ({
|
|
|
1356
1356
|
disabled: s,
|
|
1357
1357
|
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",
|
|
1358
1358
|
children: s ? /* @__PURE__ */ n(
|
|
1359
|
-
|
|
1359
|
+
be,
|
|
1360
1360
|
{
|
|
1361
1361
|
className: "size-4 animate-spin text-white",
|
|
1362
1362
|
weight: "bold"
|
|
1363
1363
|
}
|
|
1364
1364
|
) : /* @__PURE__ */ f(z.Fragment, { children: [
|
|
1365
|
-
/* @__PURE__ */ n(
|
|
1365
|
+
/* @__PURE__ */ n(Se, { className: "size-4 text-white", weight: "bold" }),
|
|
1366
1366
|
"Download"
|
|
1367
1367
|
] })
|
|
1368
1368
|
}
|
|
@@ -1389,16 +1389,16 @@ function ut(e) {
|
|
|
1389
1389
|
thumbnailUrl: h
|
|
1390
1390
|
};
|
|
1391
1391
|
}
|
|
1392
|
-
const
|
|
1392
|
+
const In = ({
|
|
1393
1393
|
resolvedUrl: e,
|
|
1394
1394
|
resolvedType: t,
|
|
1395
1395
|
title: s,
|
|
1396
1396
|
fileSize: a,
|
|
1397
1397
|
thumbnailUrl: r
|
|
1398
1398
|
}) => {
|
|
1399
|
-
const i = a !== void 0 ?
|
|
1399
|
+
const i = a !== void 0 ? Sn(a) : void 0;
|
|
1400
1400
|
return /* @__PURE__ */ n(
|
|
1401
|
-
|
|
1401
|
+
Cn,
|
|
1402
1402
|
{
|
|
1403
1403
|
variant: "dark",
|
|
1404
1404
|
title: s,
|
|
@@ -1406,7 +1406,7 @@ const En = ({
|
|
|
1406
1406
|
mimeType: t,
|
|
1407
1407
|
detail: i,
|
|
1408
1408
|
thumbnail: /* @__PURE__ */ n(
|
|
1409
|
-
|
|
1409
|
+
kn,
|
|
1410
1410
|
{
|
|
1411
1411
|
mimeType: t,
|
|
1412
1412
|
sourceUrl: e,
|
|
@@ -1417,23 +1417,23 @@ const En = ({
|
|
|
1417
1417
|
)
|
|
1418
1418
|
}
|
|
1419
1419
|
);
|
|
1420
|
-
},
|
|
1420
|
+
}, Tn = ({
|
|
1421
1421
|
resolvedUrl: e,
|
|
1422
1422
|
resolvedType: t,
|
|
1423
1423
|
title: s,
|
|
1424
1424
|
fileSize: a,
|
|
1425
1425
|
thumbnailUrl: r
|
|
1426
1426
|
}) => {
|
|
1427
|
-
const i = de(t), o = a !== void 0 ?
|
|
1427
|
+
const i = de(t), o = a !== void 0 ? Sn(a) : void 0;
|
|
1428
1428
|
return /* @__PURE__ */ n(
|
|
1429
|
-
|
|
1429
|
+
Cn,
|
|
1430
1430
|
{
|
|
1431
1431
|
variant: "light",
|
|
1432
1432
|
title: s,
|
|
1433
1433
|
mimeType: t,
|
|
1434
1434
|
detail: o,
|
|
1435
1435
|
thumbnail: /* @__PURE__ */ n(
|
|
1436
|
-
|
|
1436
|
+
kn,
|
|
1437
1437
|
{
|
|
1438
1438
|
mimeType: t,
|
|
1439
1439
|
sourceUrl: e,
|
|
@@ -1453,7 +1453,7 @@ const En = ({
|
|
|
1453
1453
|
const s = dt(e), a = ut(e);
|
|
1454
1454
|
return !s && !a ? null : /* @__PURE__ */ f("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1455
1455
|
!t && e.user && /* @__PURE__ */ n(
|
|
1456
|
-
|
|
1456
|
+
_e,
|
|
1457
1457
|
{
|
|
1458
1458
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1459
1459
|
id: e.user.id,
|
|
@@ -1483,7 +1483,7 @@ const En = ({
|
|
|
1483
1483
|
attachment: s,
|
|
1484
1484
|
isMyMessage: t
|
|
1485
1485
|
}
|
|
1486
|
-
) }) : t ? /* @__PURE__ */ n(
|
|
1486
|
+
) }) : t ? /* @__PURE__ */ n(In, { ...a }) : /* @__PURE__ */ n(Tn, { ...a })
|
|
1487
1487
|
}
|
|
1488
1488
|
) })
|
|
1489
1489
|
}
|
|
@@ -1496,7 +1496,7 @@ const En = ({
|
|
|
1496
1496
|
if (t)
|
|
1497
1497
|
return /* @__PURE__ */ n("div", { className: ot(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(ct, { attachment: t, isMyMessage: !0 }) });
|
|
1498
1498
|
const s = ut(e);
|
|
1499
|
-
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(
|
|
1499
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(In, { ...s }) }) : null;
|
|
1500
1500
|
}, er = ({
|
|
1501
1501
|
message: e
|
|
1502
1502
|
}) => {
|
|
@@ -1504,7 +1504,7 @@ const En = ({
|
|
|
1504
1504
|
if (t)
|
|
1505
1505
|
return /* @__PURE__ */ n("div", { className: ot(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(ct, { attachment: t, isMyMessage: !1 }) });
|
|
1506
1506
|
const s = ut(e);
|
|
1507
|
-
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(
|
|
1507
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(Tn, { ...s }) }) : null;
|
|
1508
1508
|
}, to = Object.assign(Ja, {
|
|
1509
1509
|
Creator: Qa,
|
|
1510
1510
|
Visitor: er
|
|
@@ -1512,17 +1512,17 @@ const En = ({
|
|
|
1512
1512
|
isUnlocking: () => !1
|
|
1513
1513
|
}, nr = {
|
|
1514
1514
|
LockedAttachment: tr
|
|
1515
|
-
},
|
|
1515
|
+
}, An = je({}), no = An.Provider;
|
|
1516
1516
|
function sr(e) {
|
|
1517
|
-
return
|
|
1517
|
+
return xe(An)[e] ?? nr[e];
|
|
1518
1518
|
}
|
|
1519
|
-
const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import("./Card-
|
|
1519
|
+
const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import("./Card-LPAZ4FjL.js")), ir = () => /* @__PURE__ */ n(
|
|
1520
1520
|
"div",
|
|
1521
1521
|
{
|
|
1522
1522
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
1523
1523
|
"aria-hidden": !0
|
|
1524
1524
|
}
|
|
1525
|
-
), Pe = (e) => /* @__PURE__ */ n(
|
|
1525
|
+
), Pe = (e) => /* @__PURE__ */ n(is, { fallback: /* @__PURE__ */ n(ir, {}), children: e.contentType === "text" ? /* @__PURE__ */ n(ar, { ...e }) : /* @__PURE__ */ n(rr, { ...e }) }), lr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1526
1526
|
"svg",
|
|
1527
1527
|
{
|
|
1528
1528
|
width: e,
|
|
@@ -1542,7 +1542,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1542
1542
|
), or = (e) => {
|
|
1543
1543
|
var t;
|
|
1544
1544
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.TIP;
|
|
1545
|
-
},
|
|
1545
|
+
}, Rn = (e) => {
|
|
1546
1546
|
var t;
|
|
1547
1547
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.PAID;
|
|
1548
1548
|
}, Fe = (e) => {
|
|
@@ -1557,9 +1557,9 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1557
1557
|
}, dr = (e) => {
|
|
1558
1558
|
var t;
|
|
1559
1559
|
return mt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
|
|
1560
|
-
},
|
|
1560
|
+
}, Ln = (e) => or(e) || Rn(e), ur = (e) => {
|
|
1561
1561
|
var t;
|
|
1562
|
-
return
|
|
1562
|
+
return Ln(e) && !((t = e.text) != null && t.trim());
|
|
1563
1563
|
}, Ke = ({
|
|
1564
1564
|
message: e,
|
|
1565
1565
|
standalone: t = !1,
|
|
@@ -1567,15 +1567,15 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1567
1567
|
hasAttachment: a = !1
|
|
1568
1568
|
}) => {
|
|
1569
1569
|
var g;
|
|
1570
|
-
const r =
|
|
1570
|
+
const r = Ln(e), i = Fe(e);
|
|
1571
1571
|
if (!r && !i)
|
|
1572
1572
|
return null;
|
|
1573
1573
|
if (r) {
|
|
1574
1574
|
const c = (g = e.metadata) == null ? void 0 : g.amount_text;
|
|
1575
1575
|
if (!c) return null;
|
|
1576
|
-
const p = t ? "message-tip-standalone inline-flex items-center gap-1.5 px-3.5 py-2.5 rounded-[18px] text-[14px] font-medium text-[#016e1a] bg-[#dbf0e0]" : "message-tag--tip inline-flex items-center gap-1 text-[12px] leading-[2] font-medium text-[#016630]", w =
|
|
1576
|
+
const p = t ? "message-tip-standalone inline-flex items-center gap-1.5 px-3.5 py-2.5 rounded-[18px] text-[14px] font-medium text-[#016e1a] bg-[#dbf0e0]" : "message-tag--tip inline-flex items-center gap-1 text-[12px] leading-[2] font-medium text-[#016630]", w = Rn(e) ? "message" : "tip", v = t ? `${c} ${w}` : `Delivered with ${c} ${w}`;
|
|
1577
1577
|
return /* @__PURE__ */ f("div", { className: p, children: [
|
|
1578
|
-
/* @__PURE__ */ n(
|
|
1578
|
+
/* @__PURE__ */ n(da, { size: t ? 14 : 12 }),
|
|
1579
1579
|
/* @__PURE__ */ n("span", { children: v })
|
|
1580
1580
|
] });
|
|
1581
1581
|
}
|
|
@@ -1585,10 +1585,10 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1585
1585
|
{
|
|
1586
1586
|
className: `${d} ${u}`,
|
|
1587
1587
|
"data-testid": "message-chatbot-indicator",
|
|
1588
|
-
children: s && !o ? /* @__PURE__ */ f(
|
|
1588
|
+
children: s && !o ? /* @__PURE__ */ f(K, { children: [
|
|
1589
1589
|
h,
|
|
1590
1590
|
m
|
|
1591
|
-
] }) : /* @__PURE__ */ f(
|
|
1591
|
+
] }) : /* @__PURE__ */ f(K, { children: [
|
|
1592
1592
|
m,
|
|
1593
1593
|
h
|
|
1594
1594
|
] })
|
|
@@ -1612,7 +1612,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1612
1612
|
mask: Zt
|
|
1613
1613
|
}
|
|
1614
1614
|
}
|
|
1615
|
-
),
|
|
1615
|
+
), Mn = je(
|
|
1616
1616
|
void 0
|
|
1617
1617
|
), hr = (e) => {
|
|
1618
1618
|
var s;
|
|
@@ -1651,7 +1651,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1651
1651
|
const s = fr(e, t), [a, r] = B(s);
|
|
1652
1652
|
return gr(a, s) ? a : (r(s), s);
|
|
1653
1653
|
}, ht = () => {
|
|
1654
|
-
const { message: e } =
|
|
1654
|
+
const { message: e } = fe("SentMessageDeliveryStatus"), { messages: t } = we("SentMessageDeliveryStatus"), s = (() => {
|
|
1655
1655
|
if (t)
|
|
1656
1656
|
for (let a = t.length - 1; a >= 0; a -= 1) {
|
|
1657
1657
|
const r = t[a];
|
|
@@ -1660,12 +1660,12 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1660
1660
|
}
|
|
1661
1661
|
})();
|
|
1662
1662
|
return e.id === s;
|
|
1663
|
-
}, Ze = () => ht() ? /* @__PURE__ */ f(
|
|
1664
|
-
/* @__PURE__ */ n(
|
|
1663
|
+
}, Ze = () => ht() ? /* @__PURE__ */ f(K, { children: [
|
|
1664
|
+
/* @__PURE__ */ n(ha, { weight: "bold", "aria-hidden": "true" }),
|
|
1665
1665
|
/* @__PURE__ */ n("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
1666
|
-
] }) : null, br = () => ht() ? /* @__PURE__ */ f(
|
|
1666
|
+
] }) : null, br = () => ht() ? /* @__PURE__ */ f(K, { children: [
|
|
1667
1667
|
/* @__PURE__ */ n(
|
|
1668
|
-
|
|
1668
|
+
be,
|
|
1669
1669
|
{
|
|
1670
1670
|
className: "sent-message-status__spinner animate-spin",
|
|
1671
1671
|
weight: "bold",
|
|
@@ -1677,8 +1677,8 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1677
1677
|
outbound: e,
|
|
1678
1678
|
onOutboundClick: t
|
|
1679
1679
|
}) => {
|
|
1680
|
-
const s = e.name || "Broadcast", r = /* @__PURE__ */ f(
|
|
1681
|
-
/* @__PURE__ */ n("span", { className: "sent-message-outbound-badge", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1680
|
+
const s = e.name || "Broadcast", r = /* @__PURE__ */ f(K, { children: [
|
|
1681
|
+
/* @__PURE__ */ n("span", { className: "sent-message-outbound-badge", "aria-hidden": "true", children: /* @__PURE__ */ n(ma, { weight: "fill" }) }),
|
|
1682
1682
|
/* @__PURE__ */ n(
|
|
1683
1683
|
"span",
|
|
1684
1684
|
{
|
|
@@ -1701,14 +1701,14 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1701
1701
|
}
|
|
1702
1702
|
) : r;
|
|
1703
1703
|
}, xr = () => /* @__PURE__ */ f("span", { className: "str-chat__message-status sent-message-status--failed", children: [
|
|
1704
|
-
/* @__PURE__ */ n(
|
|
1704
|
+
/* @__PURE__ */ n(ua, { weight: "bold", "aria-hidden": "true" }),
|
|
1705
1705
|
/* @__PURE__ */ n("span", { "data-testid": "sent-message-failed-status", children: "Failed to send" })
|
|
1706
1706
|
] }), wr = ({
|
|
1707
1707
|
onOutboundClick: e,
|
|
1708
1708
|
resolvedOutbound: t
|
|
1709
1709
|
}) => {
|
|
1710
1710
|
var h;
|
|
1711
|
-
const { isMyMessage: s, message: a, threadList: r } =
|
|
1711
|
+
const { isMyMessage: s, message: a, threadList: r } = fe(
|
|
1712
1712
|
"SentMessageDeliveryStatus"
|
|
1713
1713
|
), i = s(), o = ht();
|
|
1714
1714
|
if (r)
|
|
@@ -1724,7 +1724,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
|
|
|
1724
1724
|
onOutboundClick: e
|
|
1725
1725
|
}
|
|
1726
1726
|
) : null, u = /* @__PURE__ */ n(
|
|
1727
|
-
|
|
1727
|
+
us,
|
|
1728
1728
|
{
|
|
1729
1729
|
MessageSentStatus: Ze,
|
|
1730
1730
|
MessageDeliveredStatus: Ze,
|
|
@@ -1758,7 +1758,7 @@ const Nr = {
|
|
|
1758
1758
|
primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
|
|
1759
1759
|
secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
|
|
1760
1760
|
}
|
|
1761
|
-
},
|
|
1761
|
+
}, Dn = ({
|
|
1762
1762
|
variant: e,
|
|
1763
1763
|
cta: t,
|
|
1764
1764
|
fullWidth: s = !0,
|
|
@@ -1868,14 +1868,19 @@ const Nr = {
|
|
|
1868
1868
|
] }),
|
|
1869
1869
|
h && /* @__PURE__ */ n("div", { className: "shrink-0", children: h })
|
|
1870
1870
|
] }),
|
|
1871
|
-
u && /* @__PURE__ */ n(
|
|
1871
|
+
u && /* @__PURE__ */ n(Dn, { variant: t ?? e, cta: u })
|
|
1872
1872
|
] });
|
|
1873
1873
|
}, Er = "Loading link preview", Ir = k(
|
|
1874
|
-
|
|
1874
|
+
// Width is a channel-scoped token: default 290px, but a read-only surface with no
|
|
1875
|
+
// composer (the official channel) sets `--lt-msg-card-width` on its root to widen the
|
|
1876
|
+
// content column (see ChannelView). Consumers that don't set the var keep 290px.
|
|
1877
|
+
// `max-w-full` caps the card to its container so a widened value can never overflow
|
|
1878
|
+
// horizontally on a narrow (sub-393px) viewport — it shrinks to fit instead.
|
|
1879
|
+
"relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden",
|
|
1875
1880
|
// 20px corners — no token exists for it in the component-library preset,
|
|
1876
1881
|
// whose radius scale is sm .5rem / md 1rem / lg 1.5rem / xl 4rem.
|
|
1877
1882
|
"rounded-[20px]"
|
|
1878
|
-
), Tr = "flex h-[250px] flex-col",
|
|
1883
|
+
), Tr = "flex h-[250px] flex-col", Ee = ({
|
|
1879
1884
|
variant: e,
|
|
1880
1885
|
children: t,
|
|
1881
1886
|
href: s,
|
|
@@ -1971,11 +1976,11 @@ const Nr = {
|
|
|
1971
1976
|
}, Ar = {
|
|
1972
1977
|
dark: "size-16 text-white/25",
|
|
1973
1978
|
light: "size-16 text-black/25"
|
|
1974
|
-
},
|
|
1979
|
+
}, Te = (e, t) => !!t && !!e && de(e) === "audio", pt = (e, t) => {
|
|
1975
1980
|
if (!t || !e) return !1;
|
|
1976
1981
|
const s = de(e);
|
|
1977
1982
|
return s === "video" || s === "audio";
|
|
1978
|
-
}, bt = "bg-[#F2F3F4]",
|
|
1983
|
+
}, bt = "bg-[#F2F3F4]", Ie = ({
|
|
1979
1984
|
variant: e,
|
|
1980
1985
|
thumbnailUrl: t,
|
|
1981
1986
|
sourceUrl: s,
|
|
@@ -1987,7 +1992,7 @@ const Nr = {
|
|
|
1987
1992
|
onImageError: d
|
|
1988
1993
|
}) => {
|
|
1989
1994
|
const u = de(r), h = !!s && u === "video", m = ce(t);
|
|
1990
|
-
return !l &&
|
|
1995
|
+
return !l && Te(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
1991
1996
|
"audio",
|
|
1992
1997
|
{
|
|
1993
1998
|
src: s,
|
|
@@ -2023,7 +2028,7 @@ const Nr = {
|
|
|
2023
2028
|
"aria-hidden": !0
|
|
2024
2029
|
}
|
|
2025
2030
|
)
|
|
2026
|
-
) : h ? /* @__PURE__ */ f(
|
|
2031
|
+
) : h ? /* @__PURE__ */ f(K, { children: [
|
|
2027
2032
|
/* @__PURE__ */ n(
|
|
2028
2033
|
"video",
|
|
2029
2034
|
{
|
|
@@ -2064,7 +2069,7 @@ const Nr = {
|
|
|
2064
2069
|
"flex h-full w-full items-center justify-center",
|
|
2065
2070
|
Qt[e]
|
|
2066
2071
|
),
|
|
2067
|
-
children:
|
|
2072
|
+
children: ve(r, {
|
|
2068
2073
|
className: Ar[e],
|
|
2069
2074
|
weight: "regular"
|
|
2070
2075
|
})
|
|
@@ -2080,9 +2085,9 @@ function Lr(e) {
|
|
|
2080
2085
|
const t = e.trim();
|
|
2081
2086
|
return t.startsWith("#") ? t : `#${t}`;
|
|
2082
2087
|
}
|
|
2083
|
-
const Mr = "#FFFFFF",
|
|
2088
|
+
const Mr = "#FFFFFF", On = "#040403", Dr = {
|
|
2084
2089
|
dark: Mr,
|
|
2085
|
-
light:
|
|
2090
|
+
light: On
|
|
2086
2091
|
};
|
|
2087
2092
|
function Ve({
|
|
2088
2093
|
variant: e,
|
|
@@ -2099,7 +2104,7 @@ function Ve({
|
|
|
2099
2104
|
}, [r]);
|
|
2100
2105
|
const u = z.useCallback(() => {
|
|
2101
2106
|
d(!0);
|
|
2102
|
-
}, []), h =
|
|
2107
|
+
}, []), h = Te(i, o), c = a === "featured" && !!r && !h && !l && s === "ready" && t != null && Rr.test(t.trim()) ? Lr(t) : void 0, p = h ? On : Dr[e];
|
|
2103
2108
|
return {
|
|
2104
2109
|
thumbnailUrl: l ? void 0 : r,
|
|
2105
2110
|
accentHex: c,
|
|
@@ -2127,7 +2132,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2127
2132
|
onEditClick: p,
|
|
2128
2133
|
dismissLabel: w = "Dismiss attachment"
|
|
2129
2134
|
}) => {
|
|
2130
|
-
const v = d === "classic", x =
|
|
2135
|
+
const v = d === "classic", x = Te(i, l), b = Ve({
|
|
2131
2136
|
variant: "dark",
|
|
2132
2137
|
accentColor: m,
|
|
2133
2138
|
status: g,
|
|
@@ -2154,12 +2159,12 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2154
2159
|
onClick: p,
|
|
2155
2160
|
"aria-label": "Edit attachment",
|
|
2156
2161
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
2157
|
-
children: /* @__PURE__ */ n(
|
|
2162
|
+
children: /* @__PURE__ */ n(fa, { className: "size-5", weight: "regular" })
|
|
2158
2163
|
}
|
|
2159
2164
|
) : void 0;
|
|
2160
|
-
return x && !b.isLoading ? /* @__PURE__ */ n(
|
|
2165
|
+
return x && !b.isLoading ? /* @__PURE__ */ n(Ee, { variant: "dark", bgClassName: bt, children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
2161
2166
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
2162
|
-
|
|
2167
|
+
Ie,
|
|
2163
2168
|
{
|
|
2164
2169
|
variant: "dark",
|
|
2165
2170
|
sourceUrl: l,
|
|
@@ -2169,7 +2174,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2169
2174
|
) }),
|
|
2170
2175
|
N && /* @__PURE__ */ n("div", { className: "shrink-0", children: N })
|
|
2171
2176
|
] }) }) : /* @__PURE__ */ f(
|
|
2172
|
-
|
|
2177
|
+
Ee,
|
|
2173
2178
|
{
|
|
2174
2179
|
variant: "dark",
|
|
2175
2180
|
fixedHeight: !v,
|
|
@@ -2178,7 +2183,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2178
2183
|
topRight: v ? N : void 0,
|
|
2179
2184
|
children: [
|
|
2180
2185
|
!v && /* @__PURE__ */ n(
|
|
2181
|
-
|
|
2186
|
+
Ie,
|
|
2182
2187
|
{
|
|
2183
2188
|
variant: "dark",
|
|
2184
2189
|
thumbnailUrl: b.thumbnailUrl,
|
|
@@ -2235,7 +2240,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2235
2240
|
}
|
|
2236
2241
|
)
|
|
2237
2242
|
] })
|
|
2238
|
-
) : /* @__PURE__ */ n(
|
|
2243
|
+
) : /* @__PURE__ */ n(K, { children: a }), Fr = ({
|
|
2239
2244
|
title: e,
|
|
2240
2245
|
description: t,
|
|
2241
2246
|
descriptionLines: s,
|
|
@@ -2251,7 +2256,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2251
2256
|
onClick: g,
|
|
2252
2257
|
groupPosition: c = "single"
|
|
2253
2258
|
}) => {
|
|
2254
|
-
const p = pt(r, o), w = ft(a), v = u == null && w != null && !p ? w : void 0, x = u == null && !p ? g : void 0, b = m !== "loading" &&
|
|
2259
|
+
const p = pt(r, o), w = ft(a), v = u == null && w != null && !p ? w : void 0, x = u == null && !p ? g : void 0, b = m !== "loading" && Te(r, o) ? bt : void 0, N = u && g ? {
|
|
2255
2260
|
...u,
|
|
2256
2261
|
onClick: () => {
|
|
2257
2262
|
var T;
|
|
@@ -2273,7 +2278,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2273
2278
|
side: "receiver",
|
|
2274
2279
|
visible: b == null && (c === "single" || c === "end"),
|
|
2275
2280
|
children: /* @__PURE__ */ f(
|
|
2276
|
-
|
|
2281
|
+
Ee,
|
|
2277
2282
|
{
|
|
2278
2283
|
variant: "light",
|
|
2279
2284
|
href: v,
|
|
@@ -2286,7 +2291,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2286
2291
|
"data-testid": "link-attachment",
|
|
2287
2292
|
children: [
|
|
2288
2293
|
l === "featured" && /* @__PURE__ */ n(
|
|
2289
|
-
|
|
2294
|
+
Ie,
|
|
2290
2295
|
{
|
|
2291
2296
|
variant: "light",
|
|
2292
2297
|
thumbnailUrl: _.thumbnailUrl,
|
|
@@ -2334,7 +2339,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2334
2339
|
onClick: c,
|
|
2335
2340
|
groupPosition: p = "single"
|
|
2336
2341
|
}) => {
|
|
2337
|
-
const w = pt(i, l), v = ft(r), x = h == null && v != null && !w ? v : void 0, b = h == null && !w && x != null ? c : void 0, N = g !== "loading" &&
|
|
2342
|
+
const w = pt(i, l), v = ft(r), x = h == null && v != null && !w ? v : void 0, b = h == null && !w && x != null ? c : void 0, N = g !== "loading" && Te(i, l), _ = Ve({
|
|
2338
2343
|
variant: "dark",
|
|
2339
2344
|
accentColor: m,
|
|
2340
2345
|
status: g,
|
|
@@ -2350,7 +2355,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2350
2355
|
side: "sender",
|
|
2351
2356
|
visible: !N && (p === "single" || p === "end"),
|
|
2352
2357
|
children: /* @__PURE__ */ f(
|
|
2353
|
-
|
|
2358
|
+
Ee,
|
|
2354
2359
|
{
|
|
2355
2360
|
variant: "dark",
|
|
2356
2361
|
href: x,
|
|
@@ -2361,7 +2366,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2361
2366
|
bgClassName: N ? bt : void 0,
|
|
2362
2367
|
children: [
|
|
2363
2368
|
d === "featured" && /* @__PURE__ */ n(
|
|
2364
|
-
|
|
2369
|
+
Ie,
|
|
2365
2370
|
{
|
|
2366
2371
|
variant: "dark",
|
|
2367
2372
|
thumbnailUrl: _.thumbnailUrl,
|
|
@@ -2419,7 +2424,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2419
2424
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
2420
2425
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
2421
2426
|
}
|
|
2422
|
-
},
|
|
2427
|
+
}, Ae = ({
|
|
2423
2428
|
variant: e,
|
|
2424
2429
|
text: t,
|
|
2425
2430
|
bordered: s = !0,
|
|
@@ -2491,7 +2496,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2491
2496
|
]
|
|
2492
2497
|
}
|
|
2493
2498
|
);
|
|
2494
|
-
},
|
|
2499
|
+
}, Re = ({
|
|
2495
2500
|
onClick: e,
|
|
2496
2501
|
variant: t = "overlay",
|
|
2497
2502
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -2509,7 +2514,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2509
2514
|
),
|
|
2510
2515
|
children: /* @__PURE__ */ n(it, { className: "size-3", weight: "bold" })
|
|
2511
2516
|
}
|
|
2512
|
-
),
|
|
2517
|
+
), Le = (e) => e === "received" ? "light" : "dark", so = ({
|
|
2513
2518
|
firstOfGroup: e,
|
|
2514
2519
|
endOfGroup: t,
|
|
2515
2520
|
groupedByUser: s
|
|
@@ -2541,12 +2546,12 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2541
2546
|
preload: l,
|
|
2542
2547
|
onDismiss: d
|
|
2543
2548
|
}) => {
|
|
2544
|
-
const u =
|
|
2549
|
+
const u = Le(e), h = e === "composer" && !!d, m = Gr({ src: t, mimeType: s, filename: a, items: r });
|
|
2545
2550
|
if (m.length === 0)
|
|
2546
2551
|
return null;
|
|
2547
2552
|
const g = l ?? (m.length > 1 ? "none" : "metadata");
|
|
2548
2553
|
return /* @__PURE__ */ n(
|
|
2549
|
-
|
|
2554
|
+
Ae,
|
|
2550
2555
|
{
|
|
2551
2556
|
variant: u,
|
|
2552
2557
|
text: i,
|
|
@@ -2560,7 +2565,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2560
2565
|
trailingAction: (
|
|
2561
2566
|
// Composer only supports a single attachment, so the
|
|
2562
2567
|
// dismiss control sits on the only player.
|
|
2563
|
-
h && p === 0 ? /* @__PURE__ */ n(
|
|
2568
|
+
h && p === 0 ? /* @__PURE__ */ n(Re, { onClick: d, variant: "inline" }) : void 0
|
|
2564
2569
|
)
|
|
2565
2570
|
},
|
|
2566
2571
|
`${c.src}-${p}`
|
|
@@ -2595,7 +2600,7 @@ function Qr(e, t) {
|
|
|
2595
2600
|
}
|
|
2596
2601
|
if (!e) return;
|
|
2597
2602
|
if (de(e) === "document") {
|
|
2598
|
-
const r =
|
|
2603
|
+
const r = Nn(e), i = Jr[r];
|
|
2599
2604
|
if (i) return i;
|
|
2600
2605
|
if (e === "application/octet-stream") return;
|
|
2601
2606
|
}
|
|
@@ -2607,7 +2612,7 @@ function ei(e, t, s) {
|
|
|
2607
2612
|
const a = Qr(e, t), r = typeof s == "number" && s > 0 ? Zr(s) : void 0;
|
|
2608
2613
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
2609
2614
|
}
|
|
2610
|
-
function
|
|
2615
|
+
function re(e) {
|
|
2611
2616
|
try {
|
|
2612
2617
|
const s = new URL(e).pathname.split("/").pop();
|
|
2613
2618
|
return s && s.length > 0 ? decodeURIComponent(s) : "download";
|
|
@@ -2624,7 +2629,7 @@ const ti = {
|
|
|
2624
2629
|
}, si = {
|
|
2625
2630
|
dark: "text-white/85",
|
|
2626
2631
|
light: "text-black/85"
|
|
2627
|
-
},
|
|
2632
|
+
}, Pn = ({
|
|
2628
2633
|
variant: e,
|
|
2629
2634
|
filename: t,
|
|
2630
2635
|
title: s,
|
|
@@ -2642,7 +2647,7 @@ const ti = {
|
|
|
2642
2647
|
ni[e]
|
|
2643
2648
|
),
|
|
2644
2649
|
"aria-hidden": !0,
|
|
2645
|
-
children:
|
|
2650
|
+
children: ve(a, {
|
|
2646
2651
|
className: k("size-6", si[e]),
|
|
2647
2652
|
weight: "regular"
|
|
2648
2653
|
})
|
|
@@ -2674,7 +2679,7 @@ const ti = {
|
|
|
2674
2679
|
m
|
|
2675
2680
|
]
|
|
2676
2681
|
}
|
|
2677
|
-
) : /* @__PURE__ */ f(
|
|
2682
|
+
) : /* @__PURE__ */ f(K, { children: [
|
|
2678
2683
|
h,
|
|
2679
2684
|
m
|
|
2680
2685
|
] });
|
|
@@ -2683,8 +2688,8 @@ const ti = {
|
|
|
2683
2688
|
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
2684
2689
|
] });
|
|
2685
2690
|
};
|
|
2686
|
-
async function
|
|
2687
|
-
const s = t ??
|
|
2691
|
+
async function zn(e, t) {
|
|
2692
|
+
const s = t ?? re(e);
|
|
2688
2693
|
try {
|
|
2689
2694
|
const a = await fetch(e, { mode: "cors" });
|
|
2690
2695
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
@@ -2711,9 +2716,9 @@ const ai = ({
|
|
|
2711
2716
|
onActivate: a,
|
|
2712
2717
|
trailingAction: r
|
|
2713
2718
|
}) => {
|
|
2714
|
-
const i = t.filename ??
|
|
2719
|
+
const i = t.filename ?? re(t.src);
|
|
2715
2720
|
return /* @__PURE__ */ n(
|
|
2716
|
-
|
|
2721
|
+
Pn,
|
|
2717
2722
|
{
|
|
2718
2723
|
variant: e,
|
|
2719
2724
|
filename: i,
|
|
@@ -2738,7 +2743,7 @@ const ai = ({
|
|
|
2738
2743
|
onClick: u,
|
|
2739
2744
|
onDismiss: h
|
|
2740
2745
|
}) => {
|
|
2741
|
-
const m =
|
|
2746
|
+
const m = Le(e), g = e === "composer" && !!h, c = ai({
|
|
2742
2747
|
src: t,
|
|
2743
2748
|
filename: s,
|
|
2744
2749
|
fileSize: a,
|
|
@@ -2749,8 +2754,8 @@ const ai = ({
|
|
|
2749
2754
|
if ((u == null ? void 0 : u(v)) === !1) return;
|
|
2750
2755
|
const x = c[v];
|
|
2751
2756
|
if (!x) return;
|
|
2752
|
-
const b = x.filename ??
|
|
2753
|
-
|
|
2757
|
+
const b = x.filename ?? re(x.src);
|
|
2758
|
+
zn(x.src, b);
|
|
2754
2759
|
};
|
|
2755
2760
|
if (c.length === 0)
|
|
2756
2761
|
return null;
|
|
@@ -2762,11 +2767,11 @@ const ai = ({
|
|
|
2762
2767
|
m === "dark" ? "text-white/70" : "text-black/70"
|
|
2763
2768
|
),
|
|
2764
2769
|
"aria-hidden": !0,
|
|
2765
|
-
children: /* @__PURE__ */ n(
|
|
2770
|
+
children: /* @__PURE__ */ n(Se, { className: "size-5", weight: "bold" })
|
|
2766
2771
|
}
|
|
2767
2772
|
);
|
|
2768
2773
|
return /* @__PURE__ */ n(
|
|
2769
|
-
|
|
2774
|
+
Ae,
|
|
2770
2775
|
{
|
|
2771
2776
|
variant: m,
|
|
2772
2777
|
text: l,
|
|
@@ -2779,7 +2784,7 @@ const ai = ({
|
|
|
2779
2784
|
item: v,
|
|
2780
2785
|
index: x,
|
|
2781
2786
|
onActivate: p,
|
|
2782
|
-
trailingAction: g && x === 0 ? /* @__PURE__ */ n(
|
|
2787
|
+
trailingAction: g && x === 0 ? /* @__PURE__ */ n(Re, { onClick: h, variant: "inline" }) : w
|
|
2783
2788
|
},
|
|
2784
2789
|
`${v.src}-${x}`
|
|
2785
2790
|
)) })
|
|
@@ -2789,12 +2794,12 @@ const ai = ({
|
|
|
2789
2794
|
Composer: ii,
|
|
2790
2795
|
Sent: li,
|
|
2791
2796
|
Received: oi
|
|
2792
|
-
},
|
|
2797
|
+
}, Fn = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", en = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", _t = ({
|
|
2793
2798
|
onPrev: e,
|
|
2794
2799
|
onNext: t,
|
|
2795
2800
|
prevLabel: s = "Previous",
|
|
2796
2801
|
nextLabel: a = "Next"
|
|
2797
|
-
}) => /* @__PURE__ */ f(
|
|
2802
|
+
}) => /* @__PURE__ */ f(K, { children: [
|
|
2798
2803
|
/* @__PURE__ */ n(
|
|
2799
2804
|
"button",
|
|
2800
2805
|
{
|
|
@@ -2802,7 +2807,7 @@ const ai = ({
|
|
|
2802
2807
|
onClick: e,
|
|
2803
2808
|
"aria-label": s,
|
|
2804
2809
|
className: `${en} left-4`,
|
|
2805
|
-
children: /* @__PURE__ */ n(
|
|
2810
|
+
children: /* @__PURE__ */ n(ga, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
2806
2811
|
}
|
|
2807
2812
|
),
|
|
2808
2813
|
/* @__PURE__ */ n(
|
|
@@ -2812,10 +2817,10 @@ const ai = ({
|
|
|
2812
2817
|
onClick: t,
|
|
2813
2818
|
"aria-label": a,
|
|
2814
2819
|
className: `${en} right-4`,
|
|
2815
|
-
children: /* @__PURE__ */ n(
|
|
2820
|
+
children: /* @__PURE__ */ n(hn, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
2816
2821
|
}
|
|
2817
2822
|
)
|
|
2818
|
-
] }),
|
|
2823
|
+
] }), $n = ({
|
|
2819
2824
|
url: e,
|
|
2820
2825
|
filename: t,
|
|
2821
2826
|
variant: s = "pill",
|
|
@@ -2824,9 +2829,9 @@ const ai = ({
|
|
|
2824
2829
|
tone: i = "dark",
|
|
2825
2830
|
onTriggered: o
|
|
2826
2831
|
}) => {
|
|
2827
|
-
const [l, d] = B(!1), u =
|
|
2832
|
+
const [l, d] = B(!1), u = q(
|
|
2828
2833
|
(c) => {
|
|
2829
|
-
c.stopPropagation(), !l && (d(!0),
|
|
2834
|
+
c.stopPropagation(), !l && (d(!0), zn(e, t).catch(() => {
|
|
2830
2835
|
}).finally(() => {
|
|
2831
2836
|
d(!1), o == null || o();
|
|
2832
2837
|
}));
|
|
@@ -2851,14 +2856,14 @@ const ai = ({
|
|
|
2851
2856
|
}[i]
|
|
2852
2857
|
),
|
|
2853
2858
|
children: l ? /* @__PURE__ */ n(
|
|
2854
|
-
|
|
2859
|
+
be,
|
|
2855
2860
|
{
|
|
2856
2861
|
className: "size-4 animate-spin",
|
|
2857
2862
|
weight: "bold",
|
|
2858
2863
|
"aria-hidden": !0
|
|
2859
2864
|
}
|
|
2860
2865
|
) : /* @__PURE__ */ n(
|
|
2861
|
-
|
|
2866
|
+
Se,
|
|
2862
2867
|
{
|
|
2863
2868
|
className: "size-5 shrink-0",
|
|
2864
2869
|
weight: "bold",
|
|
@@ -2873,8 +2878,8 @@ const ai = ({
|
|
|
2873
2878
|
onClick: u,
|
|
2874
2879
|
disabled: l,
|
|
2875
2880
|
"aria-label": a,
|
|
2876
|
-
className:
|
|
2877
|
-
children: l ? /* @__PURE__ */ n(
|
|
2881
|
+
className: Fn,
|
|
2882
|
+
children: l ? /* @__PURE__ */ n(be, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(Se, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
2878
2883
|
}
|
|
2879
2884
|
) : /* @__PURE__ */ f(
|
|
2880
2885
|
"button",
|
|
@@ -2889,13 +2894,13 @@ const ai = ({
|
|
|
2889
2894
|
),
|
|
2890
2895
|
children: [
|
|
2891
2896
|
l ? /* @__PURE__ */ n(
|
|
2892
|
-
|
|
2897
|
+
be,
|
|
2893
2898
|
{
|
|
2894
2899
|
className: "size-4 animate-spin",
|
|
2895
2900
|
weight: "bold",
|
|
2896
2901
|
"aria-hidden": !0
|
|
2897
2902
|
}
|
|
2898
|
-
) : /* @__PURE__ */ n(
|
|
2903
|
+
) : /* @__PURE__ */ n(Se, { ...g, "aria-hidden": !0 }),
|
|
2899
2904
|
h ? null : a
|
|
2900
2905
|
]
|
|
2901
2906
|
}
|
|
@@ -2911,9 +2916,9 @@ const ai = ({
|
|
|
2911
2916
|
}, [s, t, e]), Y(() => {
|
|
2912
2917
|
i((d) => Je(d, 0, Math.max(e - 1, 0)));
|
|
2913
2918
|
}, [e]);
|
|
2914
|
-
const o =
|
|
2919
|
+
const o = q(() => {
|
|
2915
2920
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
2916
|
-
}, [e]), l =
|
|
2921
|
+
}, [e]), l = q(() => {
|
|
2917
2922
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
2918
2923
|
}, [e]);
|
|
2919
2924
|
return Y(() => {
|
|
@@ -2934,7 +2939,7 @@ const ai = ({
|
|
|
2934
2939
|
children: i,
|
|
2935
2940
|
"data-testid": o
|
|
2936
2941
|
}) => {
|
|
2937
|
-
const l =
|
|
2942
|
+
const l = H(null), d = H(null);
|
|
2938
2943
|
return Y(() => {
|
|
2939
2944
|
var g;
|
|
2940
2945
|
const m = l.current;
|
|
@@ -3005,7 +3010,7 @@ const ai = ({
|
|
|
3005
3010
|
type: "button",
|
|
3006
3011
|
onClick: t,
|
|
3007
3012
|
"aria-label": "Close viewer",
|
|
3008
|
-
className:
|
|
3013
|
+
className: Fn,
|
|
3009
3014
|
children: /* @__PURE__ */ n(it, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3010
3015
|
}
|
|
3011
3016
|
)
|
|
@@ -3015,7 +3020,7 @@ const ai = ({
|
|
|
3015
3020
|
]
|
|
3016
3021
|
}
|
|
3017
3022
|
);
|
|
3018
|
-
},
|
|
3023
|
+
}, Bn = ({
|
|
3019
3024
|
open: e,
|
|
3020
3025
|
items: t,
|
|
3021
3026
|
initialIndex: s = 0,
|
|
@@ -3026,7 +3031,7 @@ const ai = ({
|
|
|
3026
3031
|
initialIndex: s,
|
|
3027
3032
|
open: e
|
|
3028
3033
|
}), l = t[r], d = le(
|
|
3029
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3034
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "image"),
|
|
3030
3035
|
[l]
|
|
3031
3036
|
);
|
|
3032
3037
|
return l ? /* @__PURE__ */ f(
|
|
@@ -3037,7 +3042,7 @@ const ai = ({
|
|
|
3037
3042
|
ariaLabel: d,
|
|
3038
3043
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
3039
3044
|
actions: /* @__PURE__ */ n(
|
|
3040
|
-
|
|
3045
|
+
$n,
|
|
3041
3046
|
{
|
|
3042
3047
|
url: l.src,
|
|
3043
3048
|
filename: d,
|
|
@@ -3080,7 +3085,7 @@ const ai = ({
|
|
|
3080
3085
|
"rounded-bl-[18px]",
|
|
3081
3086
|
"rounded-br-[18px]"
|
|
3082
3087
|
]
|
|
3083
|
-
}, mi = "--mes-single-width-cap", hi = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", fi = 436,
|
|
3088
|
+
}, mi = "--mes-single-width-cap", hi = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", fi = 436, Un = ({
|
|
3084
3089
|
tiles: e,
|
|
3085
3090
|
onTileActivate: t,
|
|
3086
3091
|
maxVisible: s = 4,
|
|
@@ -3181,13 +3186,13 @@ const ai = ({
|
|
|
3181
3186
|
})
|
|
3182
3187
|
}
|
|
3183
3188
|
);
|
|
3184
|
-
},
|
|
3185
|
-
const [t, s] = B(!1), [a, r] = B(0), i =
|
|
3189
|
+
}, Me = (e) => {
|
|
3190
|
+
const [t, s] = B(!1), [a, r] = B(0), i = q(
|
|
3186
3191
|
(l) => {
|
|
3187
3192
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3188
3193
|
},
|
|
3189
3194
|
[e]
|
|
3190
|
-
), o =
|
|
3195
|
+
), o = q(() => s(!1), []);
|
|
3191
3196
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
3192
3197
|
}, gi = ({
|
|
3193
3198
|
item: e,
|
|
@@ -3221,12 +3226,12 @@ const ai = ({
|
|
|
3221
3226
|
src: e,
|
|
3222
3227
|
alt: t,
|
|
3223
3228
|
items: s
|
|
3224
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
3229
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], jn = (e, t) => e.map((s, a) => ({
|
|
3225
3230
|
src: s.src,
|
|
3226
3231
|
alt: s.alt,
|
|
3227
3232
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
3228
3233
|
})), bi = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
3229
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } =
|
|
3234
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } = Me(r);
|
|
3230
3235
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
3231
3236
|
/* @__PURE__ */ n(
|
|
3232
3237
|
"button",
|
|
@@ -3248,12 +3253,12 @@ const ai = ({
|
|
|
3248
3253
|
)
|
|
3249
3254
|
}
|
|
3250
3255
|
),
|
|
3251
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
3256
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Re, { onClick: i }) }) : null,
|
|
3252
3257
|
/* @__PURE__ */ n(
|
|
3253
|
-
|
|
3258
|
+
Bn,
|
|
3254
3259
|
{
|
|
3255
3260
|
open: o,
|
|
3256
|
-
items:
|
|
3261
|
+
items: jn([{ src: e, alt: t }], s),
|
|
3257
3262
|
initialIndex: l,
|
|
3258
3263
|
onClose: u
|
|
3259
3264
|
}
|
|
@@ -3278,7 +3283,7 @@ const ai = ({
|
|
|
3278
3283
|
imgRef: r,
|
|
3279
3284
|
onLoad: i
|
|
3280
3285
|
};
|
|
3281
|
-
},
|
|
3286
|
+
}, Hn = ({
|
|
3282
3287
|
state: e,
|
|
3283
3288
|
src: t,
|
|
3284
3289
|
alt: s,
|
|
@@ -3289,7 +3294,7 @@ const ai = ({
|
|
|
3289
3294
|
loading: l = "lazy",
|
|
3290
3295
|
onClick: d
|
|
3291
3296
|
}) => {
|
|
3292
|
-
const u = pi({ src: t, alt: s, items: r }), h =
|
|
3297
|
+
const u = pi({ src: t, alt: s, items: r }), h = Le(e), { viewerOpen: m, viewerIndex: g, handleActivate: c, closeViewer: p } = Me(d), w = u.length === 1, v = xi(w ? u[0] : void 0);
|
|
3293
3298
|
if (u.length === 0)
|
|
3294
3299
|
return null;
|
|
3295
3300
|
const x = u.map(
|
|
@@ -3303,7 +3308,7 @@ const ai = ({
|
|
|
3303
3308
|
})
|
|
3304
3309
|
);
|
|
3305
3310
|
return /* @__PURE__ */ f(
|
|
3306
|
-
|
|
3311
|
+
Ae,
|
|
3307
3312
|
{
|
|
3308
3313
|
variant: h,
|
|
3309
3314
|
text: i,
|
|
@@ -3315,7 +3320,7 @@ const ai = ({
|
|
|
3315
3320
|
"data-testid": "image-attachment",
|
|
3316
3321
|
children: [
|
|
3317
3322
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
3318
|
-
|
|
3323
|
+
Un,
|
|
3319
3324
|
{
|
|
3320
3325
|
tiles: x,
|
|
3321
3326
|
onTileActivate: c,
|
|
@@ -3323,10 +3328,10 @@ const ai = ({
|
|
|
3323
3328
|
}
|
|
3324
3329
|
) }),
|
|
3325
3330
|
/* @__PURE__ */ n(
|
|
3326
|
-
|
|
3331
|
+
Bn,
|
|
3327
3332
|
{
|
|
3328
3333
|
open: m,
|
|
3329
|
-
items:
|
|
3334
|
+
items: jn(u, a),
|
|
3330
3335
|
initialIndex: g,
|
|
3331
3336
|
onClose: p
|
|
3332
3337
|
}
|
|
@@ -3334,7 +3339,7 @@ const ai = ({
|
|
|
3334
3339
|
]
|
|
3335
3340
|
}
|
|
3336
3341
|
);
|
|
3337
|
-
}, wi = (e) => /* @__PURE__ */ n(bi, { ...e }), _i = (e) => /* @__PURE__ */ n(
|
|
3342
|
+
}, wi = (e) => /* @__PURE__ */ n(bi, { ...e }), _i = (e) => /* @__PURE__ */ n(Hn, { ...e, state: "sent" }), yi = (e) => /* @__PURE__ */ n(Hn, { ...e, state: "received" }), Ni = {
|
|
3338
3343
|
Composer: wi,
|
|
3339
3344
|
Sent: _i,
|
|
3340
3345
|
Received: yi
|
|
@@ -3349,7 +3354,7 @@ const ai = ({
|
|
|
3349
3354
|
initialIndex: s,
|
|
3350
3355
|
open: e
|
|
3351
3356
|
}), l = t[r], d = le(
|
|
3352
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3357
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "document"),
|
|
3353
3358
|
[l]
|
|
3354
3359
|
), u = le(
|
|
3355
3360
|
() => l ? Ci(l.src) : void 0,
|
|
@@ -3402,9 +3407,9 @@ const ai = ({
|
|
|
3402
3407
|
onActivate: a,
|
|
3403
3408
|
trailingAction: r
|
|
3404
3409
|
}) => {
|
|
3405
|
-
const i = t.filename ??
|
|
3410
|
+
const i = t.filename ?? re(t.src);
|
|
3406
3411
|
return /* @__PURE__ */ n(
|
|
3407
|
-
|
|
3412
|
+
Pn,
|
|
3408
3413
|
{
|
|
3409
3414
|
variant: e,
|
|
3410
3415
|
filename: i,
|
|
@@ -3428,15 +3433,15 @@ const ai = ({
|
|
|
3428
3433
|
onClick: d,
|
|
3429
3434
|
onDismiss: u
|
|
3430
3435
|
}) => {
|
|
3431
|
-
const h =
|
|
3436
|
+
const h = Le(e), m = Si({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = Me(d), v = e === "composer" && !!u;
|
|
3432
3437
|
if (m.length === 0)
|
|
3433
3438
|
return null;
|
|
3434
3439
|
const x = m.map((b) => ({
|
|
3435
3440
|
src: b.src,
|
|
3436
|
-
filename: b.filename ??
|
|
3441
|
+
filename: b.filename ?? re(b.src)
|
|
3437
3442
|
}));
|
|
3438
3443
|
return /* @__PURE__ */ f(
|
|
3439
|
-
|
|
3444
|
+
Ae,
|
|
3440
3445
|
{
|
|
3441
3446
|
variant: h,
|
|
3442
3447
|
text: o,
|
|
@@ -3444,8 +3449,8 @@ const ai = ({
|
|
|
3444
3449
|
"data-testid": "pdf-attachment",
|
|
3445
3450
|
children: [
|
|
3446
3451
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((b, N) => {
|
|
3447
|
-
const _ = b.filename ??
|
|
3448
|
-
|
|
3452
|
+
const _ = b.filename ?? re(b.src), T = v && N === 0 ? /* @__PURE__ */ n(Re, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
3453
|
+
$n,
|
|
3449
3454
|
{
|
|
3450
3455
|
url: b.src,
|
|
3451
3456
|
filename: _,
|
|
@@ -3482,7 +3487,7 @@ const ai = ({
|
|
|
3482
3487
|
Composer: Ii,
|
|
3483
3488
|
Sent: Ti,
|
|
3484
3489
|
Received: Ai
|
|
3485
|
-
},
|
|
3490
|
+
}, Vn = ({
|
|
3486
3491
|
open: e,
|
|
3487
3492
|
items: t,
|
|
3488
3493
|
initialIndex: s = 0,
|
|
@@ -3493,7 +3498,7 @@ const ai = ({
|
|
|
3493
3498
|
initialIndex: s,
|
|
3494
3499
|
open: e
|
|
3495
3500
|
}), l = t[r], d = le(
|
|
3496
|
-
() => (l == null ? void 0 : l.filename) ?? (l ?
|
|
3501
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "video"),
|
|
3497
3502
|
[l]
|
|
3498
3503
|
);
|
|
3499
3504
|
return l ? /* @__PURE__ */ f(
|
|
@@ -3532,7 +3537,7 @@ const ai = ({
|
|
|
3532
3537
|
]
|
|
3533
3538
|
}
|
|
3534
3539
|
) : null;
|
|
3535
|
-
}, Li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(at, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }),
|
|
3540
|
+
}, Li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(at, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Gn = ({
|
|
3536
3541
|
item: e,
|
|
3537
3542
|
index: t
|
|
3538
3543
|
}) => /* @__PURE__ */ f("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -3547,7 +3552,7 @@ const ai = ({
|
|
|
3547
3552
|
className: "absolute inset-0 size-full object-cover"
|
|
3548
3553
|
}
|
|
3549
3554
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
3550
|
-
|
|
3555
|
+
gn,
|
|
3551
3556
|
{
|
|
3552
3557
|
className: "size-16 text-white/30",
|
|
3553
3558
|
weight: "regular",
|
|
@@ -3557,21 +3562,21 @@ const ai = ({
|
|
|
3557
3562
|
/* @__PURE__ */ n(Li, {})
|
|
3558
3563
|
] }), Mi = (e, t, s) => ({
|
|
3559
3564
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
3560
|
-
content: /* @__PURE__ */ n(
|
|
3565
|
+
content: /* @__PURE__ */ n(Gn, { item: e, index: t })
|
|
3561
3566
|
}), Di = ({
|
|
3562
3567
|
src: e,
|
|
3563
3568
|
poster: t,
|
|
3564
3569
|
mimeType: s,
|
|
3565
3570
|
preload: a,
|
|
3566
3571
|
items: r
|
|
3567
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
3572
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], Yn = (e, t) => e.map((s, a) => ({
|
|
3568
3573
|
src: s.src,
|
|
3569
3574
|
poster: s.poster,
|
|
3570
3575
|
mimeType: s.mimeType,
|
|
3571
3576
|
preload: s.preload,
|
|
3572
3577
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
3573
3578
|
})), Oi = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
3574
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: h } =
|
|
3579
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: h } = Me(i);
|
|
3575
3580
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
3576
3581
|
/* @__PURE__ */ n(
|
|
3577
3582
|
"button",
|
|
@@ -3580,21 +3585,21 @@ const ai = ({
|
|
|
3580
3585
|
onClick: () => u(0),
|
|
3581
3586
|
"aria-label": "Play video",
|
|
3582
3587
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
3583
|
-
children: /* @__PURE__ */ n(
|
|
3588
|
+
children: /* @__PURE__ */ n(Gn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
3584
3589
|
}
|
|
3585
3590
|
),
|
|
3586
|
-
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
3591
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Re, { onClick: o }) }) : null,
|
|
3587
3592
|
/* @__PURE__ */ n(
|
|
3588
|
-
|
|
3593
|
+
Vn,
|
|
3589
3594
|
{
|
|
3590
3595
|
open: l,
|
|
3591
|
-
items:
|
|
3596
|
+
items: Yn([{ src: e, poster: t, mimeType: s, preload: r }], a),
|
|
3592
3597
|
initialIndex: d,
|
|
3593
3598
|
onClose: h
|
|
3594
3599
|
}
|
|
3595
3600
|
)
|
|
3596
3601
|
] });
|
|
3597
|
-
},
|
|
3602
|
+
}, Wn = ({
|
|
3598
3603
|
state: e,
|
|
3599
3604
|
src: t,
|
|
3600
3605
|
poster: s,
|
|
@@ -3606,26 +3611,26 @@ const ai = ({
|
|
|
3606
3611
|
preload: d,
|
|
3607
3612
|
onClick: u
|
|
3608
3613
|
}) => {
|
|
3609
|
-
const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m =
|
|
3614
|
+
const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Le(e), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = Me(u);
|
|
3610
3615
|
if (h.length === 0)
|
|
3611
3616
|
return null;
|
|
3612
3617
|
const v = h.map(
|
|
3613
3618
|
(x, b) => Mi(x, b, h.length)
|
|
3614
3619
|
);
|
|
3615
3620
|
return /* @__PURE__ */ f(
|
|
3616
|
-
|
|
3621
|
+
Ae,
|
|
3617
3622
|
{
|
|
3618
3623
|
variant: m,
|
|
3619
3624
|
text: o,
|
|
3620
3625
|
groupPosition: l,
|
|
3621
3626
|
"data-testid": "video-attachment",
|
|
3622
3627
|
children: [
|
|
3623
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
3628
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(Un, { tiles: v, onTileActivate: p }) }),
|
|
3624
3629
|
/* @__PURE__ */ n(
|
|
3625
|
-
|
|
3630
|
+
Vn,
|
|
3626
3631
|
{
|
|
3627
3632
|
open: g,
|
|
3628
|
-
items:
|
|
3633
|
+
items: Yn(h, r),
|
|
3629
3634
|
initialIndex: c,
|
|
3630
3635
|
onClose: w
|
|
3631
3636
|
}
|
|
@@ -3633,11 +3638,11 @@ const ai = ({
|
|
|
3633
3638
|
]
|
|
3634
3639
|
}
|
|
3635
3640
|
);
|
|
3636
|
-
}, Pi = (e) => /* @__PURE__ */ n(Oi, { ...e }), zi = (e) => /* @__PURE__ */ n(
|
|
3641
|
+
}, Pi = (e) => /* @__PURE__ */ n(Oi, { ...e }), zi = (e) => /* @__PURE__ */ n(Wn, { ...e, state: "sent" }), Fi = (e) => /* @__PURE__ */ n(Wn, { ...e, state: "received" }), $i = {
|
|
3637
3642
|
Composer: Pi,
|
|
3638
3643
|
Sent: zi,
|
|
3639
3644
|
Received: Fi
|
|
3640
|
-
},
|
|
3645
|
+
}, ke = {
|
|
3641
3646
|
Image: Ni,
|
|
3642
3647
|
Video: $i,
|
|
3643
3648
|
Audio: Kr,
|
|
@@ -3686,13 +3691,13 @@ function nn(e) {
|
|
|
3686
3691
|
}
|
|
3687
3692
|
function Ui(e) {
|
|
3688
3693
|
var t;
|
|
3689
|
-
return
|
|
3694
|
+
return Xn(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3690
3695
|
}
|
|
3691
|
-
function
|
|
3696
|
+
function Xn(e) {
|
|
3692
3697
|
const t = O(e.og_scrape_url);
|
|
3693
3698
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3694
3699
|
}
|
|
3695
|
-
function
|
|
3700
|
+
function qn(e) {
|
|
3696
3701
|
if (!(e != null && e.length)) return [];
|
|
3697
3702
|
const t = [], s = (r, i) => {
|
|
3698
3703
|
const o = t[t.length - 1];
|
|
@@ -3710,7 +3715,7 @@ function Xn(e) {
|
|
|
3710
3715
|
t.push({ type: "link", attachments: [r] });
|
|
3711
3716
|
};
|
|
3712
3717
|
for (const r of e) {
|
|
3713
|
-
if (
|
|
3718
|
+
if (Xn(r)) {
|
|
3714
3719
|
a(r);
|
|
3715
3720
|
continue;
|
|
3716
3721
|
}
|
|
@@ -3731,15 +3736,15 @@ function sn(e) {
|
|
|
3731
3736
|
function Vi(e) {
|
|
3732
3737
|
switch (e) {
|
|
3733
3738
|
case "image":
|
|
3734
|
-
return
|
|
3739
|
+
return ke.Image;
|
|
3735
3740
|
case "video":
|
|
3736
|
-
return
|
|
3741
|
+
return ke.Video;
|
|
3737
3742
|
case "audio":
|
|
3738
|
-
return
|
|
3743
|
+
return ke.Audio;
|
|
3739
3744
|
case "pdf":
|
|
3740
|
-
return
|
|
3745
|
+
return ke.Pdf;
|
|
3741
3746
|
default:
|
|
3742
|
-
return
|
|
3747
|
+
return ke.File;
|
|
3743
3748
|
}
|
|
3744
3749
|
}
|
|
3745
3750
|
function Gi(e, t) {
|
|
@@ -3843,7 +3848,7 @@ const Wi = ({
|
|
|
3843
3848
|
renderText: a
|
|
3844
3849
|
}) => {
|
|
3845
3850
|
var v;
|
|
3846
|
-
const r =
|
|
3851
|
+
const r = qn(s.attachments);
|
|
3847
3852
|
if (r.length === 0) return null;
|
|
3848
3853
|
const i = ji(r), o = (v = s.text) == null ? void 0 : v.trim(), l = r.find((x) => x.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? nn(l.attachments[0] ?? {}).url : void 0, u = o && Bi(o, d) ? void 0 : o;
|
|
3849
3854
|
let h = 0;
|
|
@@ -3943,67 +3948,67 @@ const Wi = ({
|
|
|
3943
3948
|
viewerLanguage: v,
|
|
3944
3949
|
onOutboundClick: x,
|
|
3945
3950
|
resolvedOutbound: b
|
|
3946
|
-
} = e, { client: N } = He("CustomMessage"), { channel: _ } =
|
|
3947
|
-
Attachment:
|
|
3948
|
-
EditMessageModal: S =
|
|
3951
|
+
} = e, { client: N } = He("CustomMessage"), { channel: _ } = we("CustomMessage"), { isUnlocking: T, onUnlockClick: L, onFetchSource: E, onDownloadClick: $ } = sr("LockedAttachment"), [F, R] = B(!1), I = hs(c.id), {
|
|
3952
|
+
Attachment: D = fs,
|
|
3953
|
+
EditMessageModal: S = gs,
|
|
3949
3954
|
MessageActions: C,
|
|
3950
|
-
MessageBlocked: A =
|
|
3951
|
-
MessageBouncePrompt: P =
|
|
3952
|
-
MessageDeleted: U =
|
|
3953
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
3954
|
-
MessageRepliesCountButton: te =
|
|
3955
|
-
ReminderNotification:
|
|
3956
|
-
StreamedMessageText:
|
|
3955
|
+
MessageBlocked: A = ps,
|
|
3956
|
+
MessageBouncePrompt: P = bs,
|
|
3957
|
+
MessageDeleted: U = vs,
|
|
3958
|
+
MessageIsThreadReplyInChannelButtonIndicator: V = xs,
|
|
3959
|
+
MessageRepliesCountButton: te = ws,
|
|
3960
|
+
ReminderNotification: Z = _s,
|
|
3961
|
+
StreamedMessageText: G = ys,
|
|
3957
3962
|
PinIndicator: y
|
|
3958
|
-
} = dn("CustomMessage"),
|
|
3963
|
+
} = dn("CustomMessage"), M = Ns(c), W = ks(c), Q = le(
|
|
3959
3964
|
() => m == null ? void 0 : m(c),
|
|
3960
3965
|
[m, c]
|
|
3961
|
-
),
|
|
3962
|
-
const
|
|
3963
|
-
if (!Fe(c)) return
|
|
3964
|
-
const Ut =
|
|
3965
|
-
return Ut.length ===
|
|
3966
|
-
}, [c]),
|
|
3967
|
-
() =>
|
|
3968
|
-
[
|
|
3969
|
-
),
|
|
3970
|
-
const
|
|
3971
|
-
return
|
|
3972
|
-
}, [c, v]),
|
|
3973
|
-
(
|
|
3966
|
+
), j = le(() => {
|
|
3967
|
+
const he = c.attachments ?? [], pe = c.shared_location ? [c.shared_location, ...he] : he;
|
|
3968
|
+
if (!Fe(c)) return pe;
|
|
3969
|
+
const Ut = pe.filter((jt) => !("type" in jt) || !En(jt));
|
|
3970
|
+
return Ut.length === pe.length ? pe : Ut;
|
|
3971
|
+
}, [c]), J = le(
|
|
3972
|
+
() => qn(j),
|
|
3973
|
+
[j]
|
|
3974
|
+
), X = le(() => {
|
|
3975
|
+
const he = yn({ message: c, viewerLanguage: v });
|
|
3976
|
+
return he === c.text ? c : { ...c, text: he };
|
|
3977
|
+
}, [c, v]), ne = J.length > 0, ue = J.reduce(
|
|
3978
|
+
(he, pe) => he + pe.attachments.length,
|
|
3974
3979
|
0
|
|
3975
|
-
) === ((
|
|
3976
|
-
if (
|
|
3980
|
+
) === ((j == null ? void 0 : j.length) ?? 0), ae = (i == null ? void 0 : i[0]) ?? "", De = ae === "top" ? "first" : ae === "middle" ? "middle" : ae === "bottom" ? "end" : "single", se = ae === "single" || ae === "bottom";
|
|
3981
|
+
if (Cs(c))
|
|
3977
3982
|
return null;
|
|
3978
3983
|
if (c.deleted_at || c.type === "deleted")
|
|
3979
3984
|
return /* @__PURE__ */ n(U, { message: c });
|
|
3980
|
-
if (
|
|
3985
|
+
if (Ss(c))
|
|
3981
3986
|
return /* @__PURE__ */ n(A, {});
|
|
3982
|
-
const
|
|
3983
|
-
let
|
|
3984
|
-
Ct ?
|
|
3985
|
-
const ee = g(),
|
|
3987
|
+
const me = !w && !!c.reply_count, ie = !w && c.show_in_channel && c.parent_id, Ct = c.status === "failed" && ((Rt = c.error) == null ? void 0 : Rt.status) !== 403, St = Es(c);
|
|
3988
|
+
let ge;
|
|
3989
|
+
Ct ? ge = () => u(c) : St && (ge = () => R(!0));
|
|
3990
|
+
const ee = g(), ns = k(
|
|
3986
3991
|
"str-chat__message str-chat__message-simple",
|
|
3987
3992
|
`str-chat__message--${c.type}`,
|
|
3988
3993
|
`str-chat__message--${c.status}`,
|
|
3989
3994
|
ee ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
3990
3995
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
3991
3996
|
{
|
|
3992
|
-
"str-chat__message--has-attachment":
|
|
3997
|
+
"str-chat__message--has-attachment": M,
|
|
3993
3998
|
"str-chat__message--highlighted": h,
|
|
3994
3999
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3995
4000
|
"str-chat__message--with-reactions": W,
|
|
3996
4001
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((Lt = c == null ? void 0 : c.error) == null ? void 0 : Lt.status) !== 403,
|
|
3997
|
-
"str-chat__message-with-thread-link":
|
|
4002
|
+
"str-chat__message-with-thread-link": me || ie,
|
|
3998
4003
|
"str-chat__virtual-message__wrapper--end": a,
|
|
3999
4004
|
"str-chat__virtual-message__wrapper--first": r,
|
|
4000
4005
|
"str-chat__virtual-message__wrapper--group": o
|
|
4001
4006
|
}
|
|
4002
|
-
), Ge = c.poll_id && N.polls.fromState(c.poll_id), Et = ur(c),
|
|
4007
|
+
), Ge = c.poll_id && N.polls.fromState(c.poll_id), Et = ur(c), ye = Fe(c), ss = mt(c), Ye = !!(j != null && j.length && !c.quoted_message), It = ye && ee && Ye, as = ne && ue && !c.quoted_message && !Ge && !Q && !ye, Tt = {
|
|
4003
4008
|
contentType: "text",
|
|
4004
4009
|
amountText: (Mt = c.metadata) == null ? void 0 : Mt.amount_text,
|
|
4005
4010
|
paymentStatus: (Dt = c.metadata) == null ? void 0 : Dt.payment_status,
|
|
4006
|
-
renderedText: c.text && /* @__PURE__ */ n(ze, { message:
|
|
4011
|
+
renderedText: c.text && /* @__PURE__ */ n(ze, { message: X, renderText: p })
|
|
4007
4012
|
}, At = {
|
|
4008
4013
|
contentType: "media",
|
|
4009
4014
|
title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
|
|
@@ -4014,7 +4019,7 @@ const Wi = ({
|
|
|
4014
4019
|
paymentStatus: (Bt = c.metadata) == null ? void 0 : Bt.payment_status,
|
|
4015
4020
|
onFetchSource: E ? () => E(c, _) : void 0
|
|
4016
4021
|
};
|
|
4017
|
-
return /* @__PURE__ */ f(
|
|
4022
|
+
return /* @__PURE__ */ f(K, { children: [
|
|
4018
4023
|
s && /* @__PURE__ */ n(
|
|
4019
4024
|
S,
|
|
4020
4025
|
{
|
|
@@ -4022,7 +4027,7 @@ const Wi = ({
|
|
|
4022
4027
|
}
|
|
4023
4028
|
),
|
|
4024
4029
|
F && /* @__PURE__ */ n(
|
|
4025
|
-
|
|
4030
|
+
Is,
|
|
4026
4031
|
{
|
|
4027
4032
|
MessageBouncePrompt: P,
|
|
4028
4033
|
onClose: () => R(!1),
|
|
@@ -4032,14 +4037,14 @@ const Wi = ({
|
|
|
4032
4037
|
/* @__PURE__ */ f(
|
|
4033
4038
|
"div",
|
|
4034
4039
|
{
|
|
4035
|
-
className:
|
|
4040
|
+
className: ns,
|
|
4036
4041
|
"data-message-id": c.id,
|
|
4037
4042
|
"data-dd-privacy": "mask",
|
|
4038
4043
|
children: [
|
|
4039
4044
|
y && /* @__PURE__ */ n(y, {}),
|
|
4040
|
-
!!I && /* @__PURE__ */ n(
|
|
4045
|
+
!!I && /* @__PURE__ */ n(Z, { reminder: I }),
|
|
4041
4046
|
c.user && /* @__PURE__ */ n(
|
|
4042
|
-
|
|
4047
|
+
_e,
|
|
4043
4048
|
{
|
|
4044
4049
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4045
4050
|
id: c.user.id,
|
|
@@ -4047,7 +4052,7 @@ const Wi = ({
|
|
|
4047
4052
|
name: c.user.name || c.user.id,
|
|
4048
4053
|
size: 24,
|
|
4049
4054
|
shape: "circle",
|
|
4050
|
-
dmAgentEnabled:
|
|
4055
|
+
dmAgentEnabled: ye
|
|
4051
4056
|
}
|
|
4052
4057
|
),
|
|
4053
4058
|
/* @__PURE__ */ n(
|
|
@@ -4057,10 +4062,10 @@ const Wi = ({
|
|
|
4057
4062
|
"str-chat__simple-message--error-failed": Ct || St
|
|
4058
4063
|
}),
|
|
4059
4064
|
"data-testid": "message-inner",
|
|
4060
|
-
onClick:
|
|
4061
|
-
onKeyDown:
|
|
4062
|
-
role:
|
|
4063
|
-
tabIndex:
|
|
4065
|
+
onClick: ge,
|
|
4066
|
+
onKeyDown: ge,
|
|
4067
|
+
role: ge ? "button" : void 0,
|
|
4068
|
+
tabIndex: ge ? 0 : void 0,
|
|
4064
4069
|
style: {
|
|
4065
4070
|
// Force margins to 0 to prevent hover layout shift
|
|
4066
4071
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
@@ -4105,28 +4110,28 @@ const Wi = ({
|
|
|
4105
4110
|
"div",
|
|
4106
4111
|
{
|
|
4107
4112
|
className: k("str-chat__message-bubble", {
|
|
4108
|
-
"relative isolate":
|
|
4113
|
+
"relative isolate": se
|
|
4109
4114
|
}),
|
|
4110
4115
|
children: [
|
|
4111
4116
|
/* @__PURE__ */ n(
|
|
4112
4117
|
ze,
|
|
4113
4118
|
{
|
|
4114
|
-
message:
|
|
4119
|
+
message: X,
|
|
4115
4120
|
renderText: p
|
|
4116
4121
|
}
|
|
4117
4122
|
),
|
|
4118
|
-
|
|
4123
|
+
se && /* @__PURE__ */ n($e, { side: ee ? "me" : "other" })
|
|
4119
4124
|
]
|
|
4120
4125
|
}
|
|
4121
4126
|
)
|
|
4122
|
-
] }) :
|
|
4127
|
+
] }) : as ? /* @__PURE__ */ n(
|
|
4123
4128
|
Wi,
|
|
4124
4129
|
{
|
|
4125
4130
|
groupPosition: De,
|
|
4126
4131
|
isMyMessage: ee,
|
|
4127
4132
|
message: {
|
|
4128
|
-
...
|
|
4129
|
-
attachments:
|
|
4133
|
+
...X,
|
|
4134
|
+
attachments: j,
|
|
4130
4135
|
// MessageText prefers message.i18n[userLanguage_text] from
|
|
4131
4136
|
// Stream's TranslationContext over message.text. Drop i18n so
|
|
4132
4137
|
// the caption uses displayMessage.text from viewerLanguage.
|
|
@@ -4138,10 +4143,10 @@ const Wi = ({
|
|
|
4138
4143
|
"div",
|
|
4139
4144
|
{
|
|
4140
4145
|
className: k("str-chat__message-bubble", {
|
|
4141
|
-
"relative isolate":
|
|
4146
|
+
"relative isolate": se
|
|
4142
4147
|
}),
|
|
4143
4148
|
children: [
|
|
4144
|
-
|
|
4149
|
+
ye && !It && /* @__PURE__ */ n(
|
|
4145
4150
|
Ke,
|
|
4146
4151
|
{
|
|
4147
4152
|
message: c,
|
|
@@ -4149,35 +4154,35 @@ const Wi = ({
|
|
|
4149
4154
|
isMyMessage: ee
|
|
4150
4155
|
}
|
|
4151
4156
|
),
|
|
4152
|
-
Ge && /* @__PURE__ */ n(
|
|
4153
|
-
|
|
4154
|
-
|
|
4157
|
+
Ge && /* @__PURE__ */ n(Ts, { poll: Ge }),
|
|
4158
|
+
j != null && j.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
4159
|
+
D,
|
|
4155
4160
|
{
|
|
4156
4161
|
actionHandler: l,
|
|
4157
|
-
attachments:
|
|
4162
|
+
attachments: j
|
|
4158
4163
|
}
|
|
4159
4164
|
) : null,
|
|
4160
|
-
|
|
4161
|
-
|
|
4165
|
+
Q ? /* @__PURE__ */ n(
|
|
4166
|
+
G,
|
|
4162
4167
|
{
|
|
4163
|
-
message:
|
|
4168
|
+
message: X,
|
|
4164
4169
|
renderText: p
|
|
4165
4170
|
}
|
|
4166
4171
|
) : /* @__PURE__ */ n(
|
|
4167
4172
|
ze,
|
|
4168
4173
|
{
|
|
4169
|
-
message:
|
|
4174
|
+
message: X,
|
|
4170
4175
|
renderText: p
|
|
4171
4176
|
}
|
|
4172
4177
|
),
|
|
4173
4178
|
/* @__PURE__ */ n(nt, {}),
|
|
4174
|
-
|
|
4179
|
+
se && /* @__PURE__ */ n($e, { side: ee ? "me" : "other" })
|
|
4175
4180
|
]
|
|
4176
4181
|
}
|
|
4177
4182
|
) })
|
|
4178
4183
|
}
|
|
4179
4184
|
),
|
|
4180
|
-
!
|
|
4185
|
+
!ss && !Et && /* @__PURE__ */ n("div", { className: "str-chat__message-footer", children: (!ye || It) && /* @__PURE__ */ n(
|
|
4181
4186
|
Ke,
|
|
4182
4187
|
{
|
|
4183
4188
|
message: c,
|
|
@@ -4192,14 +4197,14 @@ const Wi = ({
|
|
|
4192
4197
|
resolvedOutbound: b
|
|
4193
4198
|
}
|
|
4194
4199
|
),
|
|
4195
|
-
|
|
4200
|
+
me && /* @__PURE__ */ n(
|
|
4196
4201
|
te,
|
|
4197
4202
|
{
|
|
4198
4203
|
onClick: d,
|
|
4199
4204
|
reply_count: c.reply_count
|
|
4200
4205
|
}
|
|
4201
4206
|
),
|
|
4202
|
-
ie && /* @__PURE__ */ n(
|
|
4207
|
+
ie && /* @__PURE__ */ n(V, {})
|
|
4203
4208
|
]
|
|
4204
4209
|
},
|
|
4205
4210
|
c.id
|
|
@@ -4209,11 +4214,11 @@ const Wi = ({
|
|
|
4209
4214
|
Xi,
|
|
4210
4215
|
(e, t) => {
|
|
4211
4216
|
var s, a, r, i;
|
|
4212
|
-
return e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || ((s = e.resolvedOutbound) == null ? void 0 : s.id) !== ((a = t.resolvedOutbound) == null ? void 0 : a.id) || ((r = e.resolvedOutbound) == null ? void 0 : r.name) !== ((i = t.resolvedOutbound) == null ? void 0 : i.name) ? !1 :
|
|
4217
|
+
return e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || ((s = e.resolvedOutbound) == null ? void 0 : s.id) !== ((a = t.resolvedOutbound) == null ? void 0 : a.id) || ((r = e.resolvedOutbound) == null ? void 0 : r.name) !== ((i = t.resolvedOutbound) == null ? void 0 : i.name) ? !1 : ms(e, t);
|
|
4213
4218
|
}
|
|
4214
4219
|
), Ki = (e) => {
|
|
4215
4220
|
var i;
|
|
4216
|
-
const t =
|
|
4221
|
+
const t = fe("CustomMessage"), s = xe(Mn), a = (i = t.message.metadata) == null ? void 0 : i.outbound_id, r = typeof a == "string" ? s == null ? void 0 : s[a] : void 0;
|
|
4217
4222
|
return /* @__PURE__ */ n(
|
|
4218
4223
|
qi,
|
|
4219
4224
|
{
|
|
@@ -4224,32 +4229,32 @@ const Wi = ({
|
|
|
4224
4229
|
);
|
|
4225
4230
|
}, Zi = () => {
|
|
4226
4231
|
var s;
|
|
4227
|
-
const { handleDelete: e, message: t } =
|
|
4232
|
+
const { handleDelete: e, message: t } = fe("CustomMessageActions");
|
|
4228
4233
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
4229
|
-
|
|
4234
|
+
pn,
|
|
4230
4235
|
{
|
|
4231
4236
|
onClick: e,
|
|
4232
4237
|
"aria-label": "Delete",
|
|
4233
4238
|
title: "Delete",
|
|
4234
4239
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
4235
|
-
children: /* @__PURE__ */ n(
|
|
4240
|
+
children: /* @__PURE__ */ n(pa, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
4236
4241
|
}
|
|
4237
4242
|
);
|
|
4238
4243
|
}, Ji = () => {
|
|
4239
|
-
const { handleFlag: e } =
|
|
4244
|
+
const { handleFlag: e } = fe("CustomMessageActions");
|
|
4240
4245
|
return /* @__PURE__ */ n(
|
|
4241
|
-
|
|
4246
|
+
pn,
|
|
4242
4247
|
{
|
|
4243
4248
|
onClick: e,
|
|
4244
4249
|
"aria-label": "Report",
|
|
4245
4250
|
title: "Report",
|
|
4246
4251
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
4247
|
-
children: /* @__PURE__ */ n(
|
|
4252
|
+
children: /* @__PURE__ */ n(mn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
4248
4253
|
}
|
|
4249
4254
|
);
|
|
4250
4255
|
}, Qi = () => {
|
|
4251
4256
|
var t;
|
|
4252
|
-
const { message: e } =
|
|
4257
|
+
const { message: e } = fe("CustomMessageActions");
|
|
4253
4258
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== oe.ATTACHMENT ? null : /* @__PURE__ */ n(
|
|
4254
4259
|
wa,
|
|
4255
4260
|
{
|
|
@@ -4264,7 +4269,7 @@ const Wi = ({
|
|
|
4264
4269
|
(t) => tt.previewIsLoaded(t) || tt.previewIsLoading(t)
|
|
4265
4270
|
)
|
|
4266
4271
|
}), tl = () => {
|
|
4267
|
-
const { linkPreviewsManager: e } =
|
|
4272
|
+
const { linkPreviewsManager: e } = As(), { linkPreviews: t } = Rs(
|
|
4268
4273
|
e.state,
|
|
4269
4274
|
el
|
|
4270
4275
|
), s = (r) => {
|
|
@@ -4330,7 +4335,7 @@ const Wi = ({
|
|
|
4330
4335
|
);
|
|
4331
4336
|
}) })
|
|
4332
4337
|
) : null;
|
|
4333
|
-
}, Be = z.createContext(!1), nl = 200, ao = () =>
|
|
4338
|
+
}, Be = z.createContext(!1), nl = 200, ao = () => xe(Be), sl = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
4334
4339
|
"button",
|
|
4335
4340
|
{
|
|
4336
4341
|
...s,
|
|
@@ -4339,12 +4344,12 @@ const Wi = ({
|
|
|
4339
4344
|
disabled: t,
|
|
4340
4345
|
onPointerDown: (a) => a.preventDefault(),
|
|
4341
4346
|
onClick: e,
|
|
4342
|
-
children: /* @__PURE__ */ n(
|
|
4347
|
+
children: /* @__PURE__ */ n(ba, { weight: "bold", className: "size-4" })
|
|
4343
4348
|
}
|
|
4344
4349
|
), an = () => {
|
|
4345
|
-
const e =
|
|
4350
|
+
const e = xe(Be), { handleSubmit: t } = Ls(), s = Ms(), a = e || !s, {
|
|
4346
4351
|
SendButton: r = sl,
|
|
4347
|
-
AttachmentPreviewList: i =
|
|
4352
|
+
AttachmentPreviewList: i = Ds
|
|
4348
4353
|
} = dn("CustomMessageInput"), o = z.useRef(null);
|
|
4349
4354
|
return z.useEffect(() => {
|
|
4350
4355
|
const l = o.current;
|
|
@@ -4408,13 +4413,13 @@ const Wi = ({
|
|
|
4408
4413
|
"data-dd-privacy": "mask",
|
|
4409
4414
|
children: [
|
|
4410
4415
|
/* @__PURE__ */ f("div", { className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2", children: [
|
|
4411
|
-
/* @__PURE__ */ n(
|
|
4416
|
+
/* @__PURE__ */ n(Os, {}),
|
|
4412
4417
|
/* @__PURE__ */ n(tl, {}),
|
|
4413
4418
|
/* @__PURE__ */ n(i, {})
|
|
4414
4419
|
] }),
|
|
4415
4420
|
/* @__PURE__ */ f("div", { className: "messaging-composer-row flex items-start", children: [
|
|
4416
4421
|
/* @__PURE__ */ n(
|
|
4417
|
-
|
|
4422
|
+
Ps,
|
|
4418
4423
|
{
|
|
4419
4424
|
"aria-disabled": e || void 0,
|
|
4420
4425
|
containerClassName: "min-w-0 flex-1 leading-[0]",
|
|
@@ -4450,7 +4455,7 @@ const Wi = ({
|
|
|
4450
4455
|
composerInput: i
|
|
4451
4456
|
}) => {
|
|
4452
4457
|
var h;
|
|
4453
|
-
const { channel: o } =
|
|
4458
|
+
const { channel: o } = we(), l = ((h = o == null ? void 0 : o.data) == null ? void 0 : h.frozen) === !0, d = !!i, u = z.useRef(null);
|
|
4454
4459
|
return z.useEffect(() => {
|
|
4455
4460
|
if (!d)
|
|
4456
4461
|
return;
|
|
@@ -4496,7 +4501,7 @@ const Wi = ({
|
|
|
4496
4501
|
] })
|
|
4497
4502
|
]
|
|
4498
4503
|
}
|
|
4499
|
-
) : /* @__PURE__ */ f(
|
|
4504
|
+
) : /* @__PURE__ */ f(K, { children: [
|
|
4500
4505
|
t == null ? void 0 : t(),
|
|
4501
4506
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: r ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: r }) : null }),
|
|
4502
4507
|
s == null ? void 0 : s()
|
|
@@ -4563,18 +4568,18 @@ const Wi = ({
|
|
|
4563
4568
|
}, dl = (e) => {
|
|
4564
4569
|
var a;
|
|
4565
4570
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
4566
|
-
if (
|
|
4571
|
+
if (Gt(t))
|
|
4567
4572
|
return {
|
|
4568
4573
|
kind: "dm-agent",
|
|
4569
4574
|
type: t
|
|
4570
4575
|
};
|
|
4571
|
-
if (
|
|
4576
|
+
if (Gs(t))
|
|
4572
4577
|
return {
|
|
4573
4578
|
kind: "age-safety",
|
|
4574
4579
|
type: t
|
|
4575
4580
|
};
|
|
4576
4581
|
const s = e.dm_agent_system_type;
|
|
4577
|
-
if (
|
|
4582
|
+
if (Gt(s))
|
|
4578
4583
|
return {
|
|
4579
4584
|
kind: "dm-agent",
|
|
4580
4585
|
type: s
|
|
@@ -4584,7 +4589,7 @@ const Wi = ({
|
|
|
4584
4589
|
if (t === -1)
|
|
4585
4590
|
return e;
|
|
4586
4591
|
const s = t + Qe.length;
|
|
4587
|
-
return /* @__PURE__ */ f(
|
|
4592
|
+
return /* @__PURE__ */ f(K, { children: [
|
|
4588
4593
|
e.slice(0, t),
|
|
4589
4594
|
/* @__PURE__ */ n(
|
|
4590
4595
|
"a",
|
|
@@ -4614,7 +4619,7 @@ const Wi = ({
|
|
|
4614
4619
|
"data-dm-agent-system-type": s.type,
|
|
4615
4620
|
children: [
|
|
4616
4621
|
/* @__PURE__ */ n(
|
|
4617
|
-
|
|
4622
|
+
va,
|
|
4618
4623
|
{
|
|
4619
4624
|
size: 16,
|
|
4620
4625
|
weight: "regular",
|
|
@@ -4640,7 +4645,7 @@ const Wi = ({
|
|
|
4640
4645
|
"data-age-safety-system-type": s.type,
|
|
4641
4646
|
children: [
|
|
4642
4647
|
/* @__PURE__ */ n(
|
|
4643
|
-
|
|
4648
|
+
xa,
|
|
4644
4649
|
{
|
|
4645
4650
|
size: 24,
|
|
4646
4651
|
weight: "duotone",
|
|
@@ -4664,7 +4669,7 @@ const Wi = ({
|
|
|
4664
4669
|
] }),
|
|
4665
4670
|
!t && /* @__PURE__ */ n(We, { message: e.message })
|
|
4666
4671
|
] });
|
|
4667
|
-
},
|
|
4672
|
+
}, Kn = je(!1), et = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
4668
4673
|
"animateTransform",
|
|
4669
4674
|
{
|
|
4670
4675
|
attributeName: "transform",
|
|
@@ -4680,7 +4685,7 @@ const Wi = ({
|
|
|
4680
4685
|
Xe.ExternalSources
|
|
4681
4686
|
]), fl = ({ threadList: e }) => {
|
|
4682
4687
|
var p, w;
|
|
4683
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
4688
|
+
const { channel: t, channelConfig: s, thread: a } = we(), { client: r } = He(), { typing: i = {} } = zs(), { aiState: o } = Fs(t), l = xe(Kn);
|
|
4684
4689
|
if (!e && l && hl.has(o)) {
|
|
4685
4690
|
const v = gl(t, (p = r.user) == null ? void 0 : p.id);
|
|
4686
4691
|
return /* @__PURE__ */ n(
|
|
@@ -4733,7 +4738,7 @@ const Wi = ({
|
|
|
4733
4738
|
},
|
|
4734
4739
|
children: /* @__PURE__ */ f("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
4735
4740
|
/* @__PURE__ */ n(
|
|
4736
|
-
|
|
4741
|
+
_e,
|
|
4737
4742
|
{
|
|
4738
4743
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4739
4744
|
id: e,
|
|
@@ -4850,16 +4855,16 @@ const vl = ({
|
|
|
4850
4855
|
resolveOutbound: $,
|
|
4851
4856
|
composerInput: F
|
|
4852
4857
|
}) => {
|
|
4853
|
-
const { channel: R, messages: I } =
|
|
4858
|
+
const { channel: R, messages: I } = we(), D = H(E);
|
|
4854
4859
|
Y(() => {
|
|
4855
|
-
|
|
4860
|
+
D.current = E;
|
|
4856
4861
|
}, [E]);
|
|
4857
|
-
const S =
|
|
4858
|
-
var
|
|
4859
|
-
(
|
|
4862
|
+
const S = q((Z) => {
|
|
4863
|
+
var G;
|
|
4864
|
+
(G = D.current) == null || G.call(D, Z);
|
|
4860
4865
|
}, []), C = E ? S : void 0, A = pr(I, $), P = R.state.messages.some(
|
|
4861
|
-
(
|
|
4862
|
-
), U = v ? /* @__PURE__ */ n(z.Fragment, { children: v() }, "lt-channel-banner") : null,
|
|
4866
|
+
(Z) => Z.type !== "deleted"
|
|
4867
|
+
), U = v ? /* @__PURE__ */ n(z.Fragment, { children: v() }, "lt-channel-banner") : null, V = /* @__PURE__ */ n(
|
|
4863
4868
|
La,
|
|
4864
4869
|
{
|
|
4865
4870
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
@@ -4879,22 +4884,22 @@ const vl = ({
|
|
|
4879
4884
|
renderChannelActions: b,
|
|
4880
4885
|
onParticipantNameClick: L
|
|
4881
4886
|
}
|
|
4882
|
-
), te =
|
|
4883
|
-
(
|
|
4884
|
-
const { message:
|
|
4887
|
+
), te = q(
|
|
4888
|
+
(Z) => {
|
|
4889
|
+
const { message: G } = fe("ChannelView"), y = /* @__PURE__ */ n(
|
|
4885
4890
|
Ki,
|
|
4886
4891
|
{
|
|
4887
|
-
...
|
|
4892
|
+
...Z,
|
|
4888
4893
|
viewerLanguage: _,
|
|
4889
4894
|
onOutboundClick: C
|
|
4890
4895
|
}
|
|
4891
4896
|
);
|
|
4892
|
-
return !N || !
|
|
4897
|
+
return !N || !G ? y : N(y, G);
|
|
4893
4898
|
},
|
|
4894
4899
|
[C, N, _]
|
|
4895
4900
|
);
|
|
4896
|
-
return /* @__PURE__ */ n(
|
|
4897
|
-
|
|
4901
|
+
return /* @__PURE__ */ n(Mn.Provider, { value: A, children: /* @__PURE__ */ n(
|
|
4902
|
+
Bs,
|
|
4898
4903
|
{
|
|
4899
4904
|
overrides: {
|
|
4900
4905
|
Message: te,
|
|
@@ -4902,21 +4907,21 @@ const vl = ({
|
|
|
4902
4907
|
UnreadMessagesNotification: () => null,
|
|
4903
4908
|
UnreadMessagesSeparator: () => null
|
|
4904
4909
|
},
|
|
4905
|
-
children: /* @__PURE__ */ n(
|
|
4910
|
+
children: /* @__PURE__ */ n(Us, { children: F ? /* @__PURE__ */ f("div", { className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col", children: [
|
|
4906
4911
|
/* @__PURE__ */ f(
|
|
4907
4912
|
"div",
|
|
4908
4913
|
{
|
|
4909
4914
|
className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
|
|
4910
4915
|
children: [
|
|
4911
4916
|
!P && /* @__PURE__ */ n("div", { className: "str-chat__list", children: /* @__PURE__ */ f("div", { className: "str-chat__message-list-scroll", children: [
|
|
4912
|
-
|
|
4917
|
+
V,
|
|
4913
4918
|
U
|
|
4914
4919
|
] }) }),
|
|
4915
4920
|
/* @__PURE__ */ n(
|
|
4916
4921
|
Vt,
|
|
4917
4922
|
{
|
|
4918
4923
|
head: P ? /* @__PURE__ */ f("div", { className: "sticky top-0 z-10", children: [
|
|
4919
|
-
|
|
4924
|
+
V,
|
|
4920
4925
|
U
|
|
4921
4926
|
] }) : void 0,
|
|
4922
4927
|
hideDeletedMessages: !0,
|
|
@@ -4943,21 +4948,21 @@ const vl = ({
|
|
|
4943
4948
|
},
|
|
4944
4949
|
"lt-channel-message-input"
|
|
4945
4950
|
)
|
|
4946
|
-
] }) : /* @__PURE__ */ f(
|
|
4951
|
+
] }) : /* @__PURE__ */ f(K, { children: [
|
|
4947
4952
|
/* @__PURE__ */ f(
|
|
4948
4953
|
"div",
|
|
4949
4954
|
{
|
|
4950
4955
|
className: "flex-1 overflow-hidden relative",
|
|
4951
4956
|
children: [
|
|
4952
4957
|
!P && /* @__PURE__ */ n("div", { className: "str-chat__list", children: /* @__PURE__ */ f("div", { className: "str-chat__message-list-scroll", children: [
|
|
4953
|
-
|
|
4958
|
+
V,
|
|
4954
4959
|
U
|
|
4955
4960
|
] }) }),
|
|
4956
4961
|
/* @__PURE__ */ n(
|
|
4957
4962
|
Vt,
|
|
4958
4963
|
{
|
|
4959
4964
|
head: P ? /* @__PURE__ */ f("div", { className: "sticky top-0 z-10", children: [
|
|
4960
|
-
|
|
4965
|
+
V,
|
|
4961
4966
|
U
|
|
4962
4967
|
] }) : void 0,
|
|
4963
4968
|
hideDeletedMessages: !0,
|
|
@@ -4985,7 +4990,7 @@ const vl = ({
|
|
|
4985
4990
|
] }) })
|
|
4986
4991
|
}
|
|
4987
4992
|
) });
|
|
4988
|
-
},
|
|
4993
|
+
}, Zn = z.memo(
|
|
4989
4994
|
({
|
|
4990
4995
|
channel: e,
|
|
4991
4996
|
onBack: t,
|
|
@@ -5015,55 +5020,58 @@ const vl = ({
|
|
|
5015
5020
|
renderMessage: F,
|
|
5016
5021
|
onMessageLinkClick: R,
|
|
5017
5022
|
sendButton: I,
|
|
5018
|
-
attachmentPreviewList:
|
|
5023
|
+
attachmentPreviewList: D,
|
|
5019
5024
|
viewerLanguage: S,
|
|
5020
5025
|
showChannelInfo: C = !0,
|
|
5021
5026
|
onParticipantNameClick: A,
|
|
5022
5027
|
onOutboundClick: P,
|
|
5023
5028
|
resolveOutbound: U,
|
|
5024
|
-
composerInput:
|
|
5029
|
+
composerInput: V
|
|
5025
5030
|
}) => {
|
|
5026
|
-
const te =
|
|
5027
|
-
async (
|
|
5028
|
-
var
|
|
5029
|
-
const
|
|
5030
|
-
...
|
|
5031
|
-
...
|
|
5031
|
+
const te = q(
|
|
5032
|
+
async (y, M, W) => {
|
|
5033
|
+
var ue;
|
|
5034
|
+
const Q = ((ue = e.data) == null ? void 0 : ue.chatbot_paused) === !0, j = b && !Q, J = {
|
|
5035
|
+
...M,
|
|
5036
|
+
...j && { silent: !0 },
|
|
5032
5037
|
...N && {
|
|
5033
5038
|
metadata: {
|
|
5034
|
-
...
|
|
5039
|
+
...M.metadata ?? {},
|
|
5035
5040
|
...N
|
|
5036
5041
|
}
|
|
5037
5042
|
}
|
|
5038
|
-
},
|
|
5039
|
-
...
|
|
5040
|
-
...
|
|
5041
|
-
},
|
|
5042
|
-
return _ == null || _(
|
|
5043
|
+
}, X = {
|
|
5044
|
+
...W,
|
|
5045
|
+
...j && { skip_push: !0 }
|
|
5046
|
+
}, ne = await e.sendMessage(J, X);
|
|
5047
|
+
return _ == null || _(ne), ne;
|
|
5043
5048
|
},
|
|
5044
5049
|
[e, b, N, _]
|
|
5045
|
-
),
|
|
5046
|
-
|
|
5050
|
+
), Z = H(null);
|
|
5051
|
+
Y(() => {
|
|
5047
5052
|
if (!R) return;
|
|
5048
|
-
const
|
|
5049
|
-
if (!
|
|
5050
|
-
const
|
|
5051
|
-
const
|
|
5052
|
-
if (!
|
|
5053
|
-
const
|
|
5054
|
-
R(
|
|
5053
|
+
const y = Z.current;
|
|
5054
|
+
if (!y) return;
|
|
5055
|
+
const M = (W) => {
|
|
5056
|
+
const Q = W.target, j = Q == null ? void 0 : Q.closest("a[href]"), J = j == null ? void 0 : j.getAttribute("href");
|
|
5057
|
+
if (!J) return;
|
|
5058
|
+
const X = j == null ? void 0 : j.closest("[data-message-id]"), ne = X == null ? void 0 : X.getAttribute("data-message-id"), ue = ne ? e.state.messages.find((ae) => ae.id === ne) : void 0;
|
|
5059
|
+
R(J, ue);
|
|
5055
5060
|
};
|
|
5056
|
-
return
|
|
5057
|
-
}, [R, e])
|
|
5061
|
+
return y.addEventListener("click", M), () => y.removeEventListener("click", M);
|
|
5062
|
+
}, [R, e]);
|
|
5063
|
+
const G = un(e.type) ? { "--lt-msg-card-width": "368px" } : void 0;
|
|
5064
|
+
return /* @__PURE__ */ n(
|
|
5058
5065
|
"div",
|
|
5059
5066
|
{
|
|
5060
|
-
ref:
|
|
5067
|
+
ref: Z,
|
|
5061
5068
|
className: k(
|
|
5062
5069
|
"messaging-channel-view h-full flex flex-col",
|
|
5063
5070
|
d
|
|
5064
5071
|
),
|
|
5065
|
-
|
|
5066
|
-
|
|
5072
|
+
style: G,
|
|
5073
|
+
children: /* @__PURE__ */ n(Kn.Provider, { value: b ?? !1, children: /* @__PURE__ */ n(
|
|
5074
|
+
$s,
|
|
5067
5075
|
{
|
|
5068
5076
|
channel: e,
|
|
5069
5077
|
MessageSystem: ml,
|
|
@@ -5073,7 +5081,7 @@ const vl = ({
|
|
|
5073
5081
|
TypingIndicator: fl,
|
|
5074
5082
|
doSendMessageRequest: te,
|
|
5075
5083
|
...I ? { SendButton: I } : {},
|
|
5076
|
-
...
|
|
5084
|
+
...D ? { AttachmentPreviewList: D } : {},
|
|
5077
5085
|
children: /* @__PURE__ */ n(
|
|
5078
5086
|
vl,
|
|
5079
5087
|
{
|
|
@@ -5103,7 +5111,7 @@ const vl = ({
|
|
|
5103
5111
|
onParticipantNameClick: A,
|
|
5104
5112
|
onOutboundClick: P,
|
|
5105
5113
|
resolveOutbound: U,
|
|
5106
|
-
composerInput:
|
|
5114
|
+
composerInput: V
|
|
5107
5115
|
}
|
|
5108
5116
|
)
|
|
5109
5117
|
}
|
|
@@ -5112,8 +5120,8 @@ const vl = ({
|
|
|
5112
5120
|
);
|
|
5113
5121
|
}
|
|
5114
5122
|
);
|
|
5115
|
-
|
|
5116
|
-
const
|
|
5123
|
+
Zn.displayName = "ChannelView";
|
|
5124
|
+
const Ce = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ f("div", { className: "text-center max-w-sm", children: [
|
|
5117
5125
|
/* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
5118
5126
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
5119
5127
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -5127,7 +5135,7 @@ const ke = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
5127
5135
|
}
|
|
5128
5136
|
)
|
|
5129
5137
|
] }) }));
|
|
5130
|
-
|
|
5138
|
+
Ce.displayName = "ErrorState";
|
|
5131
5139
|
const ro = ({
|
|
5132
5140
|
capabilities: e = {},
|
|
5133
5141
|
renderMessageInputActions: t,
|
|
@@ -5159,60 +5167,60 @@ const ro = ({
|
|
|
5159
5167
|
isLoading: F,
|
|
5160
5168
|
error: R,
|
|
5161
5169
|
refreshConnection: I,
|
|
5162
|
-
service:
|
|
5170
|
+
service: D,
|
|
5163
5171
|
debug: S
|
|
5164
|
-
} = _a(), [C, A] = B(null), [P, U] = B(null), [
|
|
5165
|
-
|
|
5166
|
-
const y =
|
|
5172
|
+
} = _a(), [C, A] = B(null), [P, U] = B(null), [V, te] = B(!1), { showDeleteConversation: Z = !0 } = e, G = H(o);
|
|
5173
|
+
G.current = o;
|
|
5174
|
+
const y = H(a);
|
|
5167
5175
|
y.current = a;
|
|
5168
|
-
const
|
|
5176
|
+
const M = H(null), W = H(null);
|
|
5169
5177
|
Y(() => {
|
|
5170
5178
|
W.current = C;
|
|
5171
5179
|
}, [C]), Y(() => {
|
|
5172
5180
|
if (!E || !$) return;
|
|
5173
|
-
const
|
|
5174
|
-
if (!
|
|
5175
|
-
const
|
|
5176
|
-
if (
|
|
5177
|
-
|
|
5178
|
-
const
|
|
5179
|
-
|
|
5181
|
+
const J = E.userID;
|
|
5182
|
+
if (!J) return;
|
|
5183
|
+
const X = `${J}::${i}`;
|
|
5184
|
+
if (M.current === X) return;
|
|
5185
|
+
M.current = X;
|
|
5186
|
+
const ne = () => {
|
|
5187
|
+
M.current === X && (M.current = null);
|
|
5180
5188
|
};
|
|
5181
5189
|
(async () => {
|
|
5182
|
-
var
|
|
5190
|
+
var ae, De;
|
|
5183
5191
|
try {
|
|
5184
5192
|
S && console.log(
|
|
5185
5193
|
"[MessagingShell] Loading initial conversation with:",
|
|
5186
5194
|
i
|
|
5187
5195
|
);
|
|
5188
|
-
const
|
|
5196
|
+
const se = await E.queryChannels(
|
|
5189
5197
|
{
|
|
5190
5198
|
type: "messaging",
|
|
5191
|
-
members: { $eq: [
|
|
5199
|
+
members: { $eq: [J, i] }
|
|
5192
5200
|
},
|
|
5193
5201
|
{},
|
|
5194
5202
|
{ limit: 1 }
|
|
5195
5203
|
);
|
|
5196
|
-
if (
|
|
5197
|
-
A(
|
|
5204
|
+
if (se.length > 0) {
|
|
5205
|
+
A(se[0]), U(null), (ae = y.current) == null || ae.call(y, se[0]), S && console.log(
|
|
5198
5206
|
"[MessagingShell] Initial conversation loaded:",
|
|
5199
|
-
|
|
5207
|
+
se[0].id
|
|
5200
5208
|
);
|
|
5201
5209
|
return;
|
|
5202
5210
|
}
|
|
5203
|
-
const
|
|
5204
|
-
if (!
|
|
5205
|
-
|
|
5211
|
+
const me = G.current;
|
|
5212
|
+
if (!me || !D) {
|
|
5213
|
+
ne(), U("No conversation found with this account"), S && console.log(
|
|
5206
5214
|
"[MessagingShell] No conversation found for:",
|
|
5207
5215
|
i
|
|
5208
5216
|
);
|
|
5209
5217
|
return;
|
|
5210
5218
|
}
|
|
5211
5219
|
try {
|
|
5212
|
-
const ie = await
|
|
5213
|
-
id:
|
|
5214
|
-
name:
|
|
5215
|
-
phone:
|
|
5220
|
+
const ie = await D.startChannelWithParticipant({
|
|
5221
|
+
id: me.id,
|
|
5222
|
+
name: me.name,
|
|
5223
|
+
phone: me.phone
|
|
5216
5224
|
});
|
|
5217
5225
|
A(ie), U(null), (De = y.current) == null || De.call(y, ie), S && console.log(
|
|
5218
5226
|
"[MessagingShell] Channel created and loaded:",
|
|
@@ -5222,39 +5230,39 @@ const ro = ({
|
|
|
5222
5230
|
console.error(
|
|
5223
5231
|
"[MessagingShell] Failed to create conversation:",
|
|
5224
5232
|
ie
|
|
5225
|
-
),
|
|
5233
|
+
), ne(), U("Failed to create conversation");
|
|
5226
5234
|
}
|
|
5227
|
-
} catch (
|
|
5235
|
+
} catch (se) {
|
|
5228
5236
|
console.error(
|
|
5229
5237
|
"[MessagingShell] Failed to load initial conversation:",
|
|
5230
|
-
|
|
5231
|
-
),
|
|
5238
|
+
se
|
|
5239
|
+
), ne(), W.current || U("Failed to load conversation");
|
|
5232
5240
|
}
|
|
5233
5241
|
})();
|
|
5234
|
-
}, [i, E, $,
|
|
5235
|
-
const
|
|
5236
|
-
|
|
5237
|
-
const
|
|
5238
|
-
var
|
|
5239
|
-
A(null), te(!0), (
|
|
5242
|
+
}, [i, E, $, D, S]);
|
|
5243
|
+
const Q = H(r);
|
|
5244
|
+
Q.current = r;
|
|
5245
|
+
const j = q(() => {
|
|
5246
|
+
var J;
|
|
5247
|
+
A(null), te(!0), (J = Q.current) == null || J.call(Q);
|
|
5240
5248
|
}, []);
|
|
5241
|
-
return F ? /* @__PURE__ */ n(Ue, {}) : R ? /* @__PURE__ */ n(
|
|
5242
|
-
|
|
5249
|
+
return F ? /* @__PURE__ */ n(Ue, {}) : R ? /* @__PURE__ */ n(Ce, { message: R, onBack: I }) : !$ || !E ? /* @__PURE__ */ n(
|
|
5250
|
+
Ce,
|
|
5243
5251
|
{
|
|
5244
5252
|
message: "Not connected to messaging service",
|
|
5245
5253
|
onBack: I
|
|
5246
5254
|
}
|
|
5247
|
-
) : P ? /* @__PURE__ */ n(
|
|
5248
|
-
|
|
5255
|
+
) : P ? /* @__PURE__ */ n(Ce, { message: P }) : V && !C ? /* @__PURE__ */ n(Ce, { message: "Conversation ended" }) : C ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
5256
|
+
Zn,
|
|
5249
5257
|
{
|
|
5250
5258
|
channel: C,
|
|
5251
5259
|
renderMessageInputActions: t,
|
|
5252
5260
|
renderConversationFooter: s,
|
|
5253
5261
|
renderChannelBanner: c,
|
|
5254
|
-
onLeaveConversation:
|
|
5255
|
-
onBlockParticipant:
|
|
5262
|
+
onLeaveConversation: j,
|
|
5263
|
+
onBlockParticipant: j,
|
|
5256
5264
|
CustomChannelEmptyState: l,
|
|
5257
|
-
showDeleteConversation:
|
|
5265
|
+
showDeleteConversation: Z,
|
|
5258
5266
|
onBlockParticipantClick: d,
|
|
5259
5267
|
onReportParticipantClick: u,
|
|
5260
5268
|
dmAgentEnabled: h,
|
|
@@ -5279,7 +5287,7 @@ function xl(e) {
|
|
|
5279
5287
|
for (const s of t)
|
|
5280
5288
|
e.state.addMessageSorted(s.message);
|
|
5281
5289
|
}
|
|
5282
|
-
const
|
|
5290
|
+
const Jn = z.createContext({
|
|
5283
5291
|
selectedChannel: void 0,
|
|
5284
5292
|
onChannelSelect: () => {
|
|
5285
5293
|
},
|
|
@@ -5287,7 +5295,7 @@ const Zn = z.createContext({
|
|
|
5287
5295
|
renderMessagePreview: void 0,
|
|
5288
5296
|
channelPreview: void 0,
|
|
5289
5297
|
viewerLanguage: void 0
|
|
5290
|
-
}), wl =
|
|
5298
|
+
}), wl = Jn.Provider, _l = () => z.useContext(Jn), yl = (e, t) => {
|
|
5291
5299
|
const s = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), a = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
5292
5300
|
return Math.floor((a - s) / (1e3 * 60 * 60 * 24));
|
|
5293
5301
|
}, Nl = (e) => {
|
|
@@ -5307,7 +5315,7 @@ const Zn = z.createContext({
|
|
|
5307
5315
|
day: "numeric",
|
|
5308
5316
|
year: "numeric"
|
|
5309
5317
|
});
|
|
5310
|
-
},
|
|
5318
|
+
}, Qn = z.memo(
|
|
5311
5319
|
(e) => {
|
|
5312
5320
|
var $, F, R;
|
|
5313
5321
|
const { channel: t, unread: s } = e, {
|
|
@@ -5317,7 +5325,7 @@ const Zn = z.createContext({
|
|
|
5317
5325
|
channelPreview: o,
|
|
5318
5326
|
renderMessagePreview: l,
|
|
5319
5327
|
viewerLanguage: d
|
|
5320
|
-
} = _l(), { client: u } = He(), h = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m =
|
|
5328
|
+
} = _l(), { client: u } = He(), h = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = vn(t);
|
|
5321
5329
|
if (o)
|
|
5322
5330
|
return /* @__PURE__ */ n(
|
|
5323
5331
|
o,
|
|
@@ -5332,30 +5340,30 @@ const Zn = z.createContext({
|
|
|
5332
5340
|
const g = () => {
|
|
5333
5341
|
t && r(t);
|
|
5334
5342
|
}, c = (I) => {
|
|
5335
|
-
const
|
|
5336
|
-
!
|
|
5337
|
-
}, p =
|
|
5343
|
+
const D = I.key === "Enter" || I.key === " ", S = I.repeat;
|
|
5344
|
+
!D || S || (I.preventDefault(), g());
|
|
5345
|
+
}, p = xn(
|
|
5338
5346
|
($ = t == null ? void 0 : t.state) == null ? void 0 : $.members,
|
|
5339
5347
|
u == null ? void 0 : u.userID,
|
|
5340
5348
|
t == null ? void 0 : t.type
|
|
5341
|
-
), w =
|
|
5342
|
-
var
|
|
5343
|
-
const I = (
|
|
5349
|
+
), w = wn(p == null ? void 0 : p.user), v = (F = p == null ? void 0 : p.user) == null ? void 0 : F.image, x = (() => {
|
|
5350
|
+
var D;
|
|
5351
|
+
const I = (D = t == null ? void 0 : t.state) == null ? void 0 : D.messages;
|
|
5344
5352
|
if (I != null && I.length) {
|
|
5345
5353
|
for (let S = I.length - 1; S >= 0; S--)
|
|
5346
5354
|
if (I[S].type !== "system") return I[S];
|
|
5347
5355
|
}
|
|
5348
5356
|
})(), N = (() => {
|
|
5349
5357
|
var A;
|
|
5350
|
-
const I =
|
|
5358
|
+
const I = yn({
|
|
5351
5359
|
message: x,
|
|
5352
5360
|
viewerLanguage: d
|
|
5353
|
-
}), { custom_type:
|
|
5354
|
-
if (
|
|
5361
|
+
}), { custom_type: D, attachment_content_type: S } = (x == null ? void 0 : x.metadata) || {};
|
|
5362
|
+
if (D === oe.TIP)
|
|
5355
5363
|
return I || "Sent a tip";
|
|
5356
|
-
if (
|
|
5364
|
+
if (D === oe.PAID)
|
|
5357
5365
|
return I || "Sent a message";
|
|
5358
|
-
if (
|
|
5366
|
+
if (D === oe.ATTACHMENT) {
|
|
5359
5367
|
if (S === "text")
|
|
5360
5368
|
return "🔒 Sent a locked message";
|
|
5361
5369
|
if (S === "media")
|
|
@@ -5388,7 +5396,7 @@ const Zn = z.createContext({
|
|
|
5388
5396
|
"data-dd-privacy": "mask",
|
|
5389
5397
|
children: /* @__PURE__ */ f("div", { className: "flex items-start gap-4", children: [
|
|
5390
5398
|
/* @__PURE__ */ n(
|
|
5391
|
-
|
|
5399
|
+
_e,
|
|
5392
5400
|
{
|
|
5393
5401
|
id: ((R = p == null ? void 0 : p.user) == null ? void 0 : R.id) || t.id || "unknown",
|
|
5394
5402
|
name: w,
|
|
@@ -5423,7 +5431,7 @@ const Zn = z.createContext({
|
|
|
5423
5431
|
);
|
|
5424
5432
|
}
|
|
5425
5433
|
);
|
|
5426
|
-
|
|
5434
|
+
Qn.displayName = "CustomChannelPreview";
|
|
5427
5435
|
const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
5428
5436
|
({
|
|
5429
5437
|
onChannelSelect: e,
|
|
@@ -5434,7 +5442,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
|
5434
5442
|
sort: i = kl,
|
|
5435
5443
|
className: o,
|
|
5436
5444
|
customEmptyStateIndicator: l,
|
|
5437
|
-
channelListPaginator: d =
|
|
5445
|
+
channelListPaginator: d = Hs,
|
|
5438
5446
|
channelPreview: u,
|
|
5439
5447
|
renderMessagePreview: h,
|
|
5440
5448
|
viewerLanguage: m,
|
|
@@ -5486,7 +5494,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
|
5486
5494
|
o
|
|
5487
5495
|
),
|
|
5488
5496
|
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(wl, { value: T, children: /* @__PURE__ */ n(
|
|
5489
|
-
|
|
5497
|
+
js,
|
|
5490
5498
|
{
|
|
5491
5499
|
filters: s,
|
|
5492
5500
|
sort: i,
|
|
@@ -5500,7 +5508,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
|
5500
5508
|
onAddedToChannel: v,
|
|
5501
5509
|
onChannelUpdated: x,
|
|
5502
5510
|
Paginator: d,
|
|
5503
|
-
Preview:
|
|
5511
|
+
Preview: Qn,
|
|
5504
5512
|
EmptyStateIndicator: l
|
|
5505
5513
|
},
|
|
5506
5514
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
@@ -5525,7 +5533,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5525
5533
|
a ? "mt-3 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"
|
|
5526
5534
|
),
|
|
5527
5535
|
children: t.map((r, i) => /* @__PURE__ */ n(
|
|
5528
|
-
|
|
5536
|
+
Dn,
|
|
5529
5537
|
{
|
|
5530
5538
|
variant: e,
|
|
5531
5539
|
cta: r,
|
|
@@ -5582,7 +5590,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5582
5590
|
return /* @__PURE__ */ n("div", { className: "shrink-0 px-4 py-3", children: g ? /* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-3", children: [
|
|
5583
5591
|
c,
|
|
5584
5592
|
/* @__PURE__ */ n(on, { surface: e, actions: o, layout: "row" })
|
|
5585
|
-
] }) : /* @__PURE__ */ f(
|
|
5593
|
+
] }) : /* @__PURE__ */ f(K, { children: [
|
|
5586
5594
|
c,
|
|
5587
5595
|
/* @__PURE__ */ n(
|
|
5588
5596
|
on,
|
|
@@ -5655,7 +5663,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5655
5663
|
// hero image errors, so `CardThumbnail` falls through to its placeholder.
|
|
5656
5664
|
// Do NOT `?? images[0]` here — that would re-instate the failed URL.
|
|
5657
5665
|
/* @__PURE__ */ n(
|
|
5658
|
-
|
|
5666
|
+
Ie,
|
|
5659
5667
|
{
|
|
5660
5668
|
variant: e,
|
|
5661
5669
|
thumbnailUrl: r,
|
|
@@ -5664,7 +5672,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5664
5672
|
onImageError: i
|
|
5665
5673
|
}
|
|
5666
5674
|
)
|
|
5667
|
-
) }),
|
|
5675
|
+
) }), es = ({
|
|
5668
5676
|
variant: e,
|
|
5669
5677
|
title: t,
|
|
5670
5678
|
subtitle: s,
|
|
@@ -5676,7 +5684,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5676
5684
|
accentColor: d,
|
|
5677
5685
|
groupPosition: u = "single"
|
|
5678
5686
|
}) => {
|
|
5679
|
-
const h =
|
|
5687
|
+
const h = Ys({
|
|
5680
5688
|
imagePresentation: i,
|
|
5681
5689
|
images: r
|
|
5682
5690
|
}), m = r.length > 0, g = m && h === "hero", c = Ve({
|
|
@@ -5692,7 +5700,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5692
5700
|
side: e === "dark" ? "sender" : "receiver",
|
|
5693
5701
|
visible: p,
|
|
5694
5702
|
children: /* @__PURE__ */ f(
|
|
5695
|
-
|
|
5703
|
+
Ee,
|
|
5696
5704
|
{
|
|
5697
5705
|
variant: e,
|
|
5698
5706
|
accentHex: c.accentHex,
|
|
@@ -5726,7 +5734,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5726
5734
|
)
|
|
5727
5735
|
}
|
|
5728
5736
|
);
|
|
5729
|
-
}, zl = (e) => /* @__PURE__ */ n(
|
|
5737
|
+
}, zl = (e) => /* @__PURE__ */ n(es, { ...e, variant: "dark" }), Fl = (e) => /* @__PURE__ */ n(es, { ...e, variant: "light" }), io = {
|
|
5730
5738
|
Sent: zl,
|
|
5731
5739
|
Received: Fl
|
|
5732
5740
|
}, cn = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, $l = {
|
|
@@ -5756,7 +5764,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5756
5764
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
5757
5765
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
5758
5766
|
}
|
|
5759
|
-
},
|
|
5767
|
+
}, ts = ({
|
|
5760
5768
|
variant: e,
|
|
5761
5769
|
text: t,
|
|
5762
5770
|
tail: s = !0,
|
|
@@ -5788,7 +5796,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5788
5796
|
header: s,
|
|
5789
5797
|
className: a
|
|
5790
5798
|
}) => /* @__PURE__ */ n(
|
|
5791
|
-
|
|
5799
|
+
ts,
|
|
5792
5800
|
{
|
|
5793
5801
|
variant: "received",
|
|
5794
5802
|
text: e,
|
|
@@ -5796,7 +5804,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5796
5804
|
header: s,
|
|
5797
5805
|
className: a
|
|
5798
5806
|
}
|
|
5799
|
-
), Hl = ({ text: e, tail: t, className: s }) => /* @__PURE__ */ n(
|
|
5807
|
+
), Hl = ({ text: e, tail: t, className: s }) => /* @__PURE__ */ n(ts, { variant: "sent", text: e, tail: t, className: s }), lo = {
|
|
5800
5808
|
Sent: Hl,
|
|
5801
5809
|
Received: jl
|
|
5802
5810
|
}, Vl = ({
|
|
@@ -5830,10 +5838,10 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5830
5838
|
avatarImage: i,
|
|
5831
5839
|
avatarName: o
|
|
5832
5840
|
}) => {
|
|
5833
|
-
const l =
|
|
5841
|
+
const l = Ws(e);
|
|
5834
5842
|
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ f("div", { className: "flex gap-3 items-end", children: [
|
|
5835
5843
|
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
5836
|
-
|
|
5844
|
+
_e,
|
|
5837
5845
|
{
|
|
5838
5846
|
id: o || "account",
|
|
5839
5847
|
name: o || "Account",
|
|
@@ -5864,8 +5872,8 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
|
|
|
5864
5872
|
] }) });
|
|
5865
5873
|
};
|
|
5866
5874
|
export {
|
|
5867
|
-
|
|
5868
|
-
|
|
5875
|
+
kn as A,
|
|
5876
|
+
wn as B,
|
|
5869
5877
|
pl as C,
|
|
5870
5878
|
ao as D,
|
|
5871
5879
|
sr as E,
|
|
@@ -5874,15 +5882,15 @@ export {
|
|
|
5874
5882
|
rt as L,
|
|
5875
5883
|
to as M,
|
|
5876
5884
|
io as R,
|
|
5877
|
-
|
|
5878
|
-
|
|
5885
|
+
Ne as a,
|
|
5886
|
+
_e as b,
|
|
5879
5887
|
Cl as c,
|
|
5880
|
-
|
|
5888
|
+
Zn as d,
|
|
5881
5889
|
no as e,
|
|
5882
5890
|
Vl as f,
|
|
5883
5891
|
de as g,
|
|
5884
5892
|
Pe as h,
|
|
5885
|
-
|
|
5893
|
+
ke as i,
|
|
5886
5894
|
lo as j,
|
|
5887
5895
|
eo as k,
|
|
5888
5896
|
ro as l,
|
|
@@ -5891,14 +5899,14 @@ export {
|
|
|
5891
5899
|
ce as o,
|
|
5892
5900
|
Nl as p,
|
|
5893
5901
|
Qr as q,
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5902
|
+
ve as r,
|
|
5903
|
+
yn as s,
|
|
5904
|
+
En as t,
|
|
5897
5905
|
Na as u,
|
|
5898
5906
|
so as v,
|
|
5899
5907
|
Da as w,
|
|
5900
|
-
|
|
5908
|
+
xn as x,
|
|
5901
5909
|
dt as y,
|
|
5902
5910
|
ut as z
|
|
5903
5911
|
};
|
|
5904
|
-
//# sourceMappingURL=index-
|
|
5912
|
+
//# sourceMappingURL=index-Cxj0F8aQ.js.map
|