@linktr.ee/messaging-react 4.0.0-rc-1786390369 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Card-DlOQrDhW.js → Card-DNfF_nfR.js} +2 -2
- package/dist/{Card-DlOQrDhW.js.map → Card-DNfF_nfR.js.map} +1 -1
- package/dist/index-B0CZqFER.cjs.map +1 -1
- package/dist/{index-CB548cbP.js → index-Dyxu8r07.js} +104 -104
- package/dist/index-Dyxu8r07.js.map +1 -0
- package/dist/index.d.ts +9 -7
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +2 -2
- package/package.json +2 -2
- package/src/components/ChannelView.outbound-resolution.integration.test.tsx +1 -1
- package/src/components/ChannelView.tsx +3 -3
- package/src/components/CustomMessage/CustomMessage.stories.tsx +4 -4
- package/src/components/CustomMessage/OutboundContext.test.ts +17 -14
- package/src/components/CustomMessage/OutboundContext.ts +22 -22
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +2 -2
- package/src/components/CustomMessage/index.tsx +5 -3
- package/src/stream-custom-data.ts +2 -2
- package/src/types.ts +7 -5
- package/dist/index-CB548cbP.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { jsx as n, jsxs as f, Fragment as J } from "react/jsx-runtime";
|
|
|
2
2
|
import z, { createContext as je, useContext as ve, useCallback as Z, useState as B, useRef as j, useEffect as Y, useId as as, Suspense as rs, useMemo as le } from "react";
|
|
3
3
|
import { StreamChatService as is } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as ls, LinkPreviewsManager as tt } from "stream-chat";
|
|
5
|
-
import { Chat as os, useChannelStateContext as xe, useChatContext as He, DateSeparator as cs, useMessageContext as he, MessageStatus as ds, MessageErrorIcon as nt, MessageText as ze, areMessageUIPropsEqual as us, useMessageReminder as ms, useComponentContext as dn, Attachment as hs, EditMessageModal as fs, MessageBlocked as gs, MessageBouncePrompt as ps, MessageDeleted as bs, MessageIsThreadReplyInChannelButtonIndicator as vs, MessageRepliesCountButton as xs, ReminderNotification as ws, StreamedMessageText as _s, messageHasAttachments as ys, messageHasReactions as Ns, isDateSeparatorMessage as ks, isMessageBlocked as Cs, isMessageBounced as Ss, MessageBounceModal as Es, Poll as Is, useMessageComposer as Ts, useStateStore as As, MessageInput as Ht, useMessageInputContext as
|
|
5
|
+
import { Chat as os, useChannelStateContext as xe, useChatContext as He, DateSeparator as cs, useMessageContext as he, MessageStatus as ds, MessageErrorIcon as nt, MessageText as ze, areMessageUIPropsEqual as us, useMessageReminder as ms, useComponentContext as dn, Attachment as hs, EditMessageModal as fs, MessageBlocked as gs, MessageBouncePrompt as ps, MessageDeleted as bs, MessageIsThreadReplyInChannelButtonIndicator as vs, MessageRepliesCountButton as xs, ReminderNotification as ws, StreamedMessageText as _s, messageHasAttachments as ys, messageHasReactions as Ns, isDateSeparatorMessage as ks, isMessageBlocked as Cs, isMessageBounced as Ss, MessageBounceModal as Es, Poll as Is, useMessageComposer as Ts, useStateStore as As, MessageInput as Ht, useMessageInputContext as Rs, useMessageComposerHasSendableData as Ls, AttachmentPreviewList as Ms, QuotedMessagePreview as Ds, TextareaComposer as Os, MessageTimestamp as We, AIStates as Xe, useTypingContext as Ps, useAIState as zs, Channel as Fs, WithComponents as $s, Window as Bs, MessageList as Vt, ChannelList as Us, InfiniteScroll as js } from "stream-chat-react";
|
|
6
6
|
import k from "classnames";
|
|
7
7
|
import { StarIcon as st, DotsThreeIcon as Hs, SpinnerGapIcon as Oe, SignOutIcon as Vs, ProhibitInsetIcon as Gt, FlagIcon as un, CurrencyDollarIcon as Gs, CaretRightIcon as mn, ArrowLeftIcon as Ys, FileIcon as hn, ImageIcon as Ws, SpeakerHighIcon as Xs, VideoCameraIcon as fn, FileMdIcon as qs, FileTextIcon as Ks, FileZipIcon as Zs, FilePptIcon as Js, FileCsvIcon as Qs, FileXlsIcon as ea, FileDocIcon as ta, FilePdfIcon as na, CircleNotchIcon as pe, PlayIcon as at, PauseIcon as sa, LinkIcon as aa, DownloadSimpleIcon as Ce, GiftIcon as ra, WarningCircleIcon as ia, MegaphoneIcon as la, ChecksIcon as oa, XIcon as it, PencilSimpleIcon as ca, CaretLeftIcon as da, TrashSimpleIcon as ua, ArrowUpIcon as ma, SparkleIcon as ha, ProhibitIcon as fa } from "@phosphor-icons/react";
|
|
8
8
|
import { isOfficialChannel as ga, OFFICIAL_SENDER_USER_ID as pa, MESSAGE_CUSTOM_TYPE as oe, isDmAgentSystemType as Yt, isAgeSafetySystemType as ba, resolveRichCardImagePresentation as va, selectEnabledFaqs as xa } from "@linktr.ee/messaging-taxonomy";
|
|
@@ -43,7 +43,7 @@ const pn = je({
|
|
|
43
43
|
_.current = s;
|
|
44
44
|
const T = j(i);
|
|
45
45
|
T.current = i;
|
|
46
|
-
const
|
|
46
|
+
const L = j({
|
|
47
47
|
userId: t == null ? void 0 : t.id,
|
|
48
48
|
apiKey: a,
|
|
49
49
|
serviceConfig: s,
|
|
@@ -53,12 +53,12 @@ const pn = je({
|
|
|
53
53
|
renderCount: E.current,
|
|
54
54
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
55
55
|
propChanges: {
|
|
56
|
-
userChanged:
|
|
57
|
-
apiKeyChanged:
|
|
58
|
-
serviceConfigChanged:
|
|
59
|
-
capabilitiesChanged:
|
|
56
|
+
userChanged: L.current.userId !== (t == null ? void 0 : t.id),
|
|
57
|
+
apiKeyChanged: L.current.apiKey !== a,
|
|
58
|
+
serviceConfigChanged: L.current.serviceConfig !== s,
|
|
59
|
+
capabilitiesChanged: L.current.capabilities !== r
|
|
60
60
|
}
|
|
61
|
-
}),
|
|
61
|
+
}), L.current = {
|
|
62
62
|
userId: t == null ? void 0 : t.id,
|
|
63
63
|
apiKey: a,
|
|
64
64
|
serviceConfig: s,
|
|
@@ -95,7 +95,7 @@ const pn = je({
|
|
|
95
95
|
serviceInstance: !!U
|
|
96
96
|
});
|
|
97
97
|
}, [a, F, o]);
|
|
98
|
-
const
|
|
98
|
+
const R = j(null);
|
|
99
99
|
Y(() => {
|
|
100
100
|
var P, U;
|
|
101
101
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
@@ -115,7 +115,7 @@ const pn = je({
|
|
|
115
115
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
if (((P =
|
|
118
|
+
if (((P = R.current) == null ? void 0 : P.serviceId) === d && ((U = R.current) == null ? void 0 : U.userId) === t.id) {
|
|
119
119
|
l(
|
|
120
120
|
"⚠️ USER CONNECTION SKIPPED",
|
|
121
121
|
"Already connected this user with this service"
|
|
@@ -127,7 +127,7 @@ const pn = je({
|
|
|
127
127
|
try {
|
|
128
128
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
129
129
|
const H = await d.connectUser(t);
|
|
130
|
-
m(H), c(!0),
|
|
130
|
+
m(H), c(!0), R.current = { serviceId: d, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
131
131
|
userId: t.id,
|
|
132
132
|
clientId: H.userID
|
|
133
133
|
});
|
|
@@ -148,7 +148,7 @@ const pn = je({
|
|
|
148
148
|
const A = F;
|
|
149
149
|
return () => {
|
|
150
150
|
var P;
|
|
151
|
-
A && (
|
|
151
|
+
A && (R.current = null, (P = N.current) == null || P.disconnectUser().catch(console.error));
|
|
152
152
|
};
|
|
153
153
|
}, [F]);
|
|
154
154
|
const I = Z(async () => {
|
|
@@ -396,7 +396,7 @@ const we = ({
|
|
|
396
396
|
logLabel: h = "useChannelModerationActions"
|
|
397
397
|
}) => {
|
|
398
398
|
var M;
|
|
399
|
-
const { service: m, debug: g } = lt(), c = (M = t == null ? void 0 : t.user) == null ? void 0 : M.id, p = !!(a && s && m && c), [w, v] = B(!1), [x, b] = B(null), [N, _] = B(!1), [T,
|
|
399
|
+
const { service: m, debug: g } = lt(), c = (M = t == null ? void 0 : t.user) == null ? void 0 : M.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);
|
|
@@ -442,26 +442,26 @@ const we = ({
|
|
|
442
442
|
handleBlockUser: async () => {
|
|
443
443
|
var S, C, A;
|
|
444
444
|
if (!(T || !m)) {
|
|
445
|
-
l == null || l(), g && console.log(`[${h}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id),
|
|
445
|
+
l == null || l(), g && console.log(`[${h}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
|
|
446
446
|
try {
|
|
447
447
|
await m.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), u == null || u();
|
|
448
448
|
} catch (P) {
|
|
449
449
|
console.error(`[${h}] Failed to block member`, P);
|
|
450
450
|
} finally {
|
|
451
|
-
|
|
451
|
+
L(!1);
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
454
|
},
|
|
455
455
|
handleUnblockUser: async () => {
|
|
456
456
|
var S, C, A;
|
|
457
457
|
if (!(T || !m)) {
|
|
458
|
-
l == null || l(), g && console.log(`[${h}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id),
|
|
458
|
+
l == null || l(), g && console.log(`[${h}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
|
|
459
459
|
try {
|
|
460
460
|
await m.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), u == null || u();
|
|
461
461
|
} catch (P) {
|
|
462
462
|
console.error(`[${h}] Failed to unblock member`, P);
|
|
463
463
|
} finally {
|
|
464
|
-
|
|
464
|
+
L(!1);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
},
|
|
@@ -506,7 +506,7 @@ const we = ({
|
|
|
506
506
|
isLeaving: N,
|
|
507
507
|
isUpdatingBlockStatus: _,
|
|
508
508
|
handleLeaveConversation: T,
|
|
509
|
-
handleBlockUser:
|
|
509
|
+
handleBlockUser: L,
|
|
510
510
|
handleUnblockUser: E,
|
|
511
511
|
handleReportUser: $
|
|
512
512
|
} = Ia({
|
|
@@ -524,13 +524,13 @@ const we = ({
|
|
|
524
524
|
});
|
|
525
525
|
return Y(() => {
|
|
526
526
|
if (!g) return;
|
|
527
|
-
const
|
|
527
|
+
const R = (M) => {
|
|
528
528
|
p.current && !p.current.contains(M.target) && c(!1);
|
|
529
529
|
}, I = (M) => {
|
|
530
530
|
M.key === "Escape" && c(!1);
|
|
531
531
|
};
|
|
532
|
-
return document.addEventListener("mousedown",
|
|
533
|
-
document.removeEventListener("mousedown",
|
|
532
|
+
return document.addEventListener("mousedown", R), document.addEventListener("keydown", I), () => {
|
|
533
|
+
document.removeEventListener("mousedown", R), document.removeEventListener("keydown", I);
|
|
534
534
|
};
|
|
535
535
|
}, [g]), !t || !(s || a || r || !!h) ? null : /* @__PURE__ */ f("div", { ref: p, className: "relative", children: [
|
|
536
536
|
/* @__PURE__ */ f(
|
|
@@ -541,7 +541,7 @@ const we = ({
|
|
|
541
541
|
"aria-haspopup": "true",
|
|
542
542
|
"aria-expanded": g,
|
|
543
543
|
"aria-controls": g ? w : void 0,
|
|
544
|
-
onClick: () => c((
|
|
544
|
+
onClick: () => c((R) => !R),
|
|
545
545
|
children: [
|
|
546
546
|
/* @__PURE__ */ n(Hs, { className: "size-5 text-black/90" }),
|
|
547
547
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
@@ -591,7 +591,7 @@ const we = ({
|
|
|
591
591
|
) : /* @__PURE__ */ f(
|
|
592
592
|
ye,
|
|
593
593
|
{
|
|
594
|
-
onClick:
|
|
594
|
+
onClick: L,
|
|
595
595
|
disabled: _,
|
|
596
596
|
"aria-busy": _,
|
|
597
597
|
children: [
|
|
@@ -609,7 +609,7 @@ const we = ({
|
|
|
609
609
|
}
|
|
610
610
|
)
|
|
611
611
|
] });
|
|
612
|
-
}, qe = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Aa = "CUSTOMER_PAID",
|
|
612
|
+
}, qe = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Aa = "CUSTOMER_PAID", Ra = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Aa, La = ({
|
|
613
613
|
className: e,
|
|
614
614
|
onBack: t,
|
|
615
615
|
showBackButton: s,
|
|
@@ -638,7 +638,7 @@ const we = ({
|
|
|
638
638
|
);
|
|
639
639
|
},
|
|
640
640
|
[(I = v.state) == null ? void 0 : I.members, x == null ? void 0 : x.userID, v.type]
|
|
641
|
-
), N = xn(b == null ? void 0 : b.user), _ = (M = b == null ? void 0 : b.user) == null ? void 0 : M.image, T = bn(v),
|
|
641
|
+
), N = xn(b == null ? void 0 : b.user), _ = (M = b == null ? void 0 : b.user) == null ? void 0 : M.image, T = bn(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,7 +647,7 @@ const we = ({
|
|
|
647
647
|
A
|
|
648
648
|
);
|
|
649
649
|
}
|
|
650
|
-
},
|
|
650
|
+
}, R = /* @__PURE__ */ f(J, { children: [
|
|
651
651
|
/* @__PURE__ */ n(
|
|
652
652
|
we,
|
|
653
653
|
{
|
|
@@ -669,7 +669,7 @@ const we = ({
|
|
|
669
669
|
children: /* @__PURE__ */ f("span", { className: "flex max-w-full items-center justify-center", children: [
|
|
670
670
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: N }),
|
|
671
671
|
$ && /* @__PURE__ */ f("span", { className: "ml-2 flex gap-1", children: [
|
|
672
|
-
|
|
672
|
+
L && /* @__PURE__ */ n(
|
|
673
673
|
"span",
|
|
674
674
|
{
|
|
675
675
|
"aria-label": "Paid customer",
|
|
@@ -727,9 +727,9 @@ const we = ({
|
|
|
727
727
|
onClick: w,
|
|
728
728
|
"aria-label": `View details for ${N}`,
|
|
729
729
|
className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
|
|
730
|
-
children:
|
|
730
|
+
children: R
|
|
731
731
|
}
|
|
732
|
-
) : /* @__PURE__ */ n("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children:
|
|
732
|
+
) : /* @__PURE__ */ n("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children: R }) }),
|
|
733
733
|
/* @__PURE__ */ f("div", { className: "flex items-start justify-end gap-2", children: [
|
|
734
734
|
a && /* @__PURE__ */ n(
|
|
735
735
|
"button",
|
|
@@ -862,7 +862,7 @@ const ja = (e) => {
|
|
|
862
862
|
muted: d = !1,
|
|
863
863
|
onContainerClick: u
|
|
864
864
|
}) => {
|
|
865
|
-
const h = de(t), m = j(null), g = j(null), c = j(null), p = j(r), [w, v] = B(a), [x, b] = B(0), [N, _] = B(!1), [T,
|
|
865
|
+
const h = de(t), m = j(null), g = j(null), c = j(null), p = j(r), [w, v] = B(a), [x, b] = B(0), [N, _] = B(!1), [T, L] = B(!1), [E, $] = B(!1), [F, R] = B(!1), [I, M] = B(!0), [S, C] = B(null), A = Z(() => {
|
|
866
866
|
$(!1), v(!0);
|
|
867
867
|
}, []), P = Z((y) => {
|
|
868
868
|
const D = g.current;
|
|
@@ -953,11 +953,11 @@ const ja = (e) => {
|
|
|
953
953
|
loop: i,
|
|
954
954
|
muted: d,
|
|
955
955
|
style: { width: "100%", height: "100%" },
|
|
956
|
-
onLoadStart: () =>
|
|
956
|
+
onLoadStart: () => R(!0),
|
|
957
957
|
onCanPlay: () => {
|
|
958
|
-
|
|
958
|
+
R(!1), M(!1);
|
|
959
959
|
},
|
|
960
|
-
onWaiting: () =>
|
|
960
|
+
onWaiting: () => R(!0),
|
|
961
961
|
onPlay: () => $(!1),
|
|
962
962
|
onEnded: () => {
|
|
963
963
|
i || (v(!1), b(0));
|
|
@@ -973,11 +973,11 @@ const ja = (e) => {
|
|
|
973
973
|
muted: d,
|
|
974
974
|
playsInline: !0,
|
|
975
975
|
style: { width: "100%", height: "100%" },
|
|
976
|
-
onLoadStart: () =>
|
|
976
|
+
onLoadStart: () => R(!0),
|
|
977
977
|
onCanPlay: () => {
|
|
978
|
-
|
|
978
|
+
R(!1), M(!1);
|
|
979
979
|
},
|
|
980
|
-
onWaiting: () =>
|
|
980
|
+
onWaiting: () => R(!0),
|
|
981
981
|
onPlay: () => $(!1),
|
|
982
982
|
onLoadedMetadata: () => {
|
|
983
983
|
const y = m.current;
|
|
@@ -1065,8 +1065,8 @@ const ja = (e) => {
|
|
|
1065
1065
|
onMouseDown: H,
|
|
1066
1066
|
onTouchStart: H,
|
|
1067
1067
|
onClick: (y) => y.stopPropagation(),
|
|
1068
|
-
onMouseEnter: () =>
|
|
1069
|
-
onMouseLeave: () =>
|
|
1068
|
+
onMouseEnter: () => L(!0),
|
|
1069
|
+
onMouseLeave: () => L(!1),
|
|
1070
1070
|
onKeyDown: (y) => {
|
|
1071
1071
|
y.key === "ArrowRight" && U(Math.min(1, x + 0.05)), y.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
|
|
1072
1072
|
},
|
|
@@ -1516,7 +1516,7 @@ const En = ({
|
|
|
1516
1516
|
function sr(e) {
|
|
1517
1517
|
return ve(Tn)[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-DNfF_nfR.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)]",
|
|
@@ -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
|
+
}, Rn = (e) => or(e) || An(e), ur = (e) => {
|
|
1561
1561
|
var t;
|
|
1562
|
-
return
|
|
1562
|
+
return Rn(e) && !((t = e.text) != null && t.trim());
|
|
1563
1563
|
}, Ke = ({
|
|
1564
1564
|
message: e,
|
|
1565
1565
|
standalone: t = !1,
|
|
@@ -1567,7 +1567,7 @@ 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 = Rn(e), i = Fe(e);
|
|
1571
1571
|
if (!r && !i)
|
|
1572
1572
|
return null;
|
|
1573
1573
|
if (r) {
|
|
@@ -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
|
+
), Ln = je(
|
|
1616
1616
|
void 0
|
|
1617
1617
|
), hr = (e) => {
|
|
1618
1618
|
var s;
|
|
@@ -1827,7 +1827,7 @@ const Nr = {
|
|
|
1827
1827
|
), T = k(
|
|
1828
1828
|
"truncate text-[12px] leading-4 tracking-[0.24px]",
|
|
1829
1829
|
s == null && Jt[e]
|
|
1830
|
-
),
|
|
1830
|
+
), L = k(
|
|
1831
1831
|
"text-[12px] leading-4 tracking-[0.24px]",
|
|
1832
1832
|
o <= 1 && "truncate",
|
|
1833
1833
|
s == null && Jt[e]
|
|
@@ -1863,7 +1863,7 @@ const Nr = {
|
|
|
1863
1863
|
}
|
|
1864
1864
|
)
|
|
1865
1865
|
] }),
|
|
1866
|
-
w && /* @__PURE__ */ n("p", { className:
|
|
1866
|
+
w && /* @__PURE__ */ n("p", { className: L, style: $, children: i }),
|
|
1867
1867
|
!b && x && /* @__PURE__ */ n("p", { className: T, style: E, children: v })
|
|
1868
1868
|
] }),
|
|
1869
1869
|
h && /* @__PURE__ */ n("div", { className: "shrink-0", children: h })
|
|
@@ -2075,8 +2075,8 @@ const Nr = {
|
|
|
2075
2075
|
]
|
|
2076
2076
|
}
|
|
2077
2077
|
);
|
|
2078
|
-
},
|
|
2079
|
-
function
|
|
2078
|
+
}, Rr = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2079
|
+
function Lr(e) {
|
|
2080
2080
|
const t = e.trim();
|
|
2081
2081
|
return t.startsWith("#") ? t : `#${t}`;
|
|
2082
2082
|
}
|
|
@@ -2099,7 +2099,7 @@ function Ve({
|
|
|
2099
2099
|
}, [r]);
|
|
2100
2100
|
const u = z.useCallback(() => {
|
|
2101
2101
|
d(!0);
|
|
2102
|
-
}, []), h = Ie(i, o), c = a === "featured" && !!r && !h && !l && s === "ready" && t != null &&
|
|
2102
|
+
}, []), h = Ie(i, o), c = a === "featured" && !!r && !h && !l && s === "ready" && t != null && Rr.test(t.trim()) ? Lr(t) : void 0, p = h ? Dn : Dr[e];
|
|
2103
2103
|
return {
|
|
2104
2104
|
thumbnailUrl: l ? void 0 : r,
|
|
2105
2105
|
accentHex: c,
|
|
@@ -2509,7 +2509,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2509
2509
|
),
|
|
2510
2510
|
children: /* @__PURE__ */ n(it, { className: "size-3", weight: "bold" })
|
|
2511
2511
|
}
|
|
2512
|
-
),
|
|
2512
|
+
), Re = (e) => e === "received" ? "light" : "dark", so = ({
|
|
2513
2513
|
firstOfGroup: e,
|
|
2514
2514
|
endOfGroup: t,
|
|
2515
2515
|
groupedByUser: s
|
|
@@ -2541,7 +2541,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
|
|
|
2541
2541
|
preload: l,
|
|
2542
2542
|
onDismiss: d
|
|
2543
2543
|
}) => {
|
|
2544
|
-
const u =
|
|
2544
|
+
const u = Re(e), h = e === "composer" && !!d, m = Gr({ src: t, mimeType: s, filename: a, items: r });
|
|
2545
2545
|
if (m.length === 0)
|
|
2546
2546
|
return null;
|
|
2547
2547
|
const g = l ?? (m.length > 1 ? "none" : "metadata");
|
|
@@ -2738,7 +2738,7 @@ const ai = ({
|
|
|
2738
2738
|
onClick: u,
|
|
2739
2739
|
onDismiss: h
|
|
2740
2740
|
}) => {
|
|
2741
|
-
const m =
|
|
2741
|
+
const m = Re(e), g = e === "composer" && !!h, c = ai({
|
|
2742
2742
|
src: t,
|
|
2743
2743
|
filename: s,
|
|
2744
2744
|
fileSize: a,
|
|
@@ -3181,7 +3181,7 @@ const ai = ({
|
|
|
3181
3181
|
})
|
|
3182
3182
|
}
|
|
3183
3183
|
);
|
|
3184
|
-
},
|
|
3184
|
+
}, Le = (e) => {
|
|
3185
3185
|
const [t, s] = B(!1), [a, r] = B(0), i = Z(
|
|
3186
3186
|
(l) => {
|
|
3187
3187
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
@@ -3226,7 +3226,7 @@ const ai = ({
|
|
|
3226
3226
|
alt: s.alt,
|
|
3227
3227
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
3228
3228
|
})), bi = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
3229
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } =
|
|
3229
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } = Le(r);
|
|
3230
3230
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
3231
3231
|
/* @__PURE__ */ n(
|
|
3232
3232
|
"button",
|
|
@@ -3289,7 +3289,7 @@ const ai = ({
|
|
|
3289
3289
|
loading: l = "lazy",
|
|
3290
3290
|
onClick: d
|
|
3291
3291
|
}) => {
|
|
3292
|
-
const u = pi({ src: t, alt: s, items: r }), h =
|
|
3292
|
+
const u = pi({ src: t, alt: s, items: r }), h = Re(e), { viewerOpen: m, viewerIndex: g, handleActivate: c, closeViewer: p } = Le(d), w = u.length === 1, v = xi(w ? u[0] : void 0);
|
|
3293
3293
|
if (u.length === 0)
|
|
3294
3294
|
return null;
|
|
3295
3295
|
const x = u.map(
|
|
@@ -3428,7 +3428,7 @@ const ai = ({
|
|
|
3428
3428
|
onClick: d,
|
|
3429
3429
|
onDismiss: u
|
|
3430
3430
|
}) => {
|
|
3431
|
-
const h =
|
|
3431
|
+
const h = Re(e), m = Si({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = Le(d), v = e === "composer" && !!u;
|
|
3432
3432
|
if (m.length === 0)
|
|
3433
3433
|
return null;
|
|
3434
3434
|
const x = m.map((b) => ({
|
|
@@ -3478,7 +3478,7 @@ const ai = ({
|
|
|
3478
3478
|
]
|
|
3479
3479
|
}
|
|
3480
3480
|
);
|
|
3481
|
-
}, Ii = (e) => /* @__PURE__ */ n(kt, { ...e, state: "composer" }), Ti = (e) => /* @__PURE__ */ n(kt, { ...e, state: "sent" }), Ai = (e) => /* @__PURE__ */ n(kt, { ...e, state: "received" }),
|
|
3481
|
+
}, Ii = (e) => /* @__PURE__ */ n(kt, { ...e, state: "composer" }), Ti = (e) => /* @__PURE__ */ n(kt, { ...e, state: "sent" }), Ai = (e) => /* @__PURE__ */ n(kt, { ...e, state: "received" }), Ri = {
|
|
3482
3482
|
Composer: Ii,
|
|
3483
3483
|
Sent: Ti,
|
|
3484
3484
|
Received: Ai
|
|
@@ -3532,7 +3532,7 @@ const ai = ({
|
|
|
3532
3532
|
]
|
|
3533
3533
|
}
|
|
3534
3534
|
) : null;
|
|
3535
|
-
},
|
|
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 }) }) }), Vn = ({
|
|
3536
3536
|
item: e,
|
|
3537
3537
|
index: t
|
|
3538
3538
|
}) => /* @__PURE__ */ f("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -3554,7 +3554,7 @@ const ai = ({
|
|
|
3554
3554
|
"aria-hidden": !0
|
|
3555
3555
|
}
|
|
3556
3556
|
) }),
|
|
3557
|
-
/* @__PURE__ */ n(
|
|
3557
|
+
/* @__PURE__ */ n(Li, {})
|
|
3558
3558
|
] }), Mi = (e, t, s) => ({
|
|
3559
3559
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
3560
3560
|
content: /* @__PURE__ */ n(Vn, { item: e, index: t })
|
|
@@ -3571,7 +3571,7 @@ const ai = ({
|
|
|
3571
3571
|
preload: s.preload,
|
|
3572
3572
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
3573
3573
|
})), 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 } =
|
|
3574
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: h } = Le(i);
|
|
3575
3575
|
return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
|
|
3576
3576
|
/* @__PURE__ */ n(
|
|
3577
3577
|
"button",
|
|
@@ -3606,7 +3606,7 @@ const ai = ({
|
|
|
3606
3606
|
preload: d,
|
|
3607
3607
|
onClick: u
|
|
3608
3608
|
}) => {
|
|
3609
|
-
const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m =
|
|
3609
|
+
const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Re(e), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = Le(u);
|
|
3610
3610
|
if (h.length === 0)
|
|
3611
3611
|
return null;
|
|
3612
3612
|
const v = h.map(
|
|
@@ -3641,7 +3641,7 @@ const ai = ({
|
|
|
3641
3641
|
Image: Ni,
|
|
3642
3642
|
Video: $i,
|
|
3643
3643
|
Audio: Kr,
|
|
3644
|
-
Pdf:
|
|
3644
|
+
Pdf: Ri,
|
|
3645
3645
|
File: ci
|
|
3646
3646
|
};
|
|
3647
3647
|
function O(e) {
|
|
@@ -3923,7 +3923,7 @@ const Wi = ({
|
|
|
3923
3923
|
) : null
|
|
3924
3924
|
] });
|
|
3925
3925
|
}, Xi = (e) => {
|
|
3926
|
-
var
|
|
3926
|
+
var Rt, Lt, Mt, Dt, Ot, Pt, zt, Ft, $t, Bt;
|
|
3927
3927
|
const {
|
|
3928
3928
|
additionalMessageInputProps: t,
|
|
3929
3929
|
editing: s,
|
|
@@ -3943,7 +3943,7 @@ const Wi = ({
|
|
|
3943
3943
|
viewerLanguage: v,
|
|
3944
3944
|
onOutboundClick: x,
|
|
3945
3945
|
resolvedOutbound: b
|
|
3946
|
-
} = e, { client: N } = He("CustomMessage"), { channel: _ } = xe("CustomMessage"), { isUnlocking: T, onUnlockClick:
|
|
3946
|
+
} = e, { client: N } = He("CustomMessage"), { channel: _ } = xe("CustomMessage"), { isUnlocking: T, onUnlockClick: L, onFetchSource: E, onDownloadClick: $ } = sr("LockedAttachment"), [F, R] = B(!1), I = ms(c.id), {
|
|
3947
3947
|
Attachment: M = hs,
|
|
3948
3948
|
EditMessageModal: S = fs,
|
|
3949
3949
|
MessageActions: C,
|
|
@@ -3979,9 +3979,9 @@ const Wi = ({
|
|
|
3979
3979
|
return /* @__PURE__ */ n(U, { message: c });
|
|
3980
3980
|
if (Cs(c))
|
|
3981
3981
|
return /* @__PURE__ */ n(A, {});
|
|
3982
|
-
const ue = !w && !!c.reply_count, ie = !w && c.show_in_channel && c.parent_id, Ct = c.status === "failed" && ((
|
|
3982
|
+
const ue = !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 = Ss(c);
|
|
3983
3983
|
let fe;
|
|
3984
|
-
Ct ? fe = () => u(c) : St && (fe = () =>
|
|
3984
|
+
Ct ? fe = () => u(c) : St && (fe = () => R(!0));
|
|
3985
3985
|
const ee = g(), ts = k(
|
|
3986
3986
|
"str-chat__message str-chat__message-simple",
|
|
3987
3987
|
`str-chat__message--${c.type}`,
|
|
@@ -3993,7 +3993,7 @@ const Wi = ({
|
|
|
3993
3993
|
"str-chat__message--highlighted": h,
|
|
3994
3994
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3995
3995
|
"str-chat__message--with-reactions": W,
|
|
3996
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
3996
|
+
"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
3997
|
"str-chat__message-with-thread-link": ue || ie,
|
|
3998
3998
|
"str-chat__virtual-message__wrapper--end": a,
|
|
3999
3999
|
"str-chat__virtual-message__wrapper--first": r,
|
|
@@ -4025,7 +4025,7 @@ const Wi = ({
|
|
|
4025
4025
|
Es,
|
|
4026
4026
|
{
|
|
4027
4027
|
MessageBouncePrompt: P,
|
|
4028
|
-
onClose: () =>
|
|
4028
|
+
onClose: () => R(!1),
|
|
4029
4029
|
open: F
|
|
4030
4030
|
}
|
|
4031
4031
|
),
|
|
@@ -4075,7 +4075,7 @@ const Wi = ({
|
|
|
4075
4075
|
...Tt,
|
|
4076
4076
|
isMine: !1,
|
|
4077
4077
|
isUnlocking: T(c.id),
|
|
4078
|
-
onUnlockClick: () =>
|
|
4078
|
+
onUnlockClick: () => L == null ? void 0 : L(c, _)
|
|
4079
4079
|
}
|
|
4080
4080
|
),
|
|
4081
4081
|
!ee && C && /* @__PURE__ */ n(C, {})
|
|
@@ -4087,7 +4087,7 @@ const Wi = ({
|
|
|
4087
4087
|
{
|
|
4088
4088
|
...At,
|
|
4089
4089
|
isMine: !0,
|
|
4090
|
-
onPreviewClick: () =>
|
|
4090
|
+
onPreviewClick: () => L ? L(c, _) : void 0
|
|
4091
4091
|
}
|
|
4092
4092
|
) : /* @__PURE__ */ n(
|
|
4093
4093
|
Pe,
|
|
@@ -4095,7 +4095,7 @@ const Wi = ({
|
|
|
4095
4095
|
...At,
|
|
4096
4096
|
isMine: !1,
|
|
4097
4097
|
isUnlocking: T(c.id),
|
|
4098
|
-
onUnlockClick: () =>
|
|
4098
|
+
onUnlockClick: () => L ? L(c, _) : void 0,
|
|
4099
4099
|
onDownloadClick: () => $ ? $(c, _) : void 0
|
|
4100
4100
|
}
|
|
4101
4101
|
),
|
|
@@ -4213,7 +4213,7 @@ const Wi = ({
|
|
|
4213
4213
|
}
|
|
4214
4214
|
), Ki = (e) => {
|
|
4215
4215
|
var i;
|
|
4216
|
-
const t = he("CustomMessage"), s = ve(
|
|
4216
|
+
const t = he("CustomMessage"), s = ve(Ln), a = (i = t.message.metadata) == null ? void 0 : i.outbound_id, r = typeof a == "string" ? s == null ? void 0 : s[a] : void 0;
|
|
4217
4217
|
return /* @__PURE__ */ n(
|
|
4218
4218
|
qi,
|
|
4219
4219
|
{
|
|
@@ -4342,7 +4342,7 @@ const Wi = ({
|
|
|
4342
4342
|
children: /* @__PURE__ */ n(ma, { weight: "bold", className: "size-4" })
|
|
4343
4343
|
}
|
|
4344
4344
|
), an = () => {
|
|
4345
|
-
const e = ve(Be), { handleSubmit: t } =
|
|
4345
|
+
const e = ve(Be), { handleSubmit: t } = Rs(), s = Ls(), a = e || !s, {
|
|
4346
4346
|
SendButton: r = sl,
|
|
4347
4347
|
AttachmentPreviewList: i = Ms
|
|
4348
4348
|
} = dn("CustomMessageInput"), o = z.useRef(null);
|
|
@@ -4845,22 +4845,22 @@ const vl = ({
|
|
|
4845
4845
|
renderMessage: N,
|
|
4846
4846
|
viewerLanguage: _,
|
|
4847
4847
|
showChannelInfo: T = !0,
|
|
4848
|
-
onParticipantNameClick:
|
|
4848
|
+
onParticipantNameClick: L,
|
|
4849
4849
|
onOutboundClick: E,
|
|
4850
4850
|
resolveOutbound: $,
|
|
4851
4851
|
composerInput: F
|
|
4852
4852
|
}) => {
|
|
4853
|
-
const { channel:
|
|
4853
|
+
const { channel: R, messages: I } = xe(), M = j(E);
|
|
4854
4854
|
Y(() => {
|
|
4855
4855
|
M.current = E;
|
|
4856
4856
|
}, [E]);
|
|
4857
4857
|
const S = Z((Q) => {
|
|
4858
4858
|
var V;
|
|
4859
4859
|
(V = M.current) == null || V.call(M, Q);
|
|
4860
|
-
}, []), C = E ? S : void 0, A = pr(I, $), P =
|
|
4860
|
+
}, []), C = E ? S : void 0, A = pr(I, $), P = R.state.messages.some(
|
|
4861
4861
|
(Q) => Q.type !== "deleted"
|
|
4862
4862
|
), U = v ? /* @__PURE__ */ n(z.Fragment, { children: v() }, "lt-channel-banner") : null, H = /* @__PURE__ */ n(
|
|
4863
|
-
|
|
4863
|
+
La,
|
|
4864
4864
|
{
|
|
4865
4865
|
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%)]",
|
|
4866
4866
|
onBack: e,
|
|
@@ -4877,7 +4877,7 @@ const vl = ({
|
|
|
4877
4877
|
onReportParticipantClick: h,
|
|
4878
4878
|
customChannelActions: x,
|
|
4879
4879
|
renderChannelActions: b,
|
|
4880
|
-
onParticipantNameClick:
|
|
4880
|
+
onParticipantNameClick: L
|
|
4881
4881
|
}
|
|
4882
4882
|
), te = Z(
|
|
4883
4883
|
(Q) => {
|
|
@@ -4893,7 +4893,7 @@ const vl = ({
|
|
|
4893
4893
|
},
|
|
4894
4894
|
[C, N, _]
|
|
4895
4895
|
);
|
|
4896
|
-
return /* @__PURE__ */ n(
|
|
4896
|
+
return /* @__PURE__ */ n(Ln.Provider, { value: A, children: /* @__PURE__ */ n(
|
|
4897
4897
|
$s,
|
|
4898
4898
|
{
|
|
4899
4899
|
overrides: {
|
|
@@ -4931,12 +4931,12 @@ const vl = ({
|
|
|
4931
4931
|
rn,
|
|
4932
4932
|
{
|
|
4933
4933
|
...s && {
|
|
4934
|
-
renderActions: () => s == null ? void 0 : s(
|
|
4934
|
+
renderActions: () => s == null ? void 0 : s(R)
|
|
4935
4935
|
},
|
|
4936
4936
|
...r && {
|
|
4937
|
-
renderHeader: () => r(
|
|
4937
|
+
renderHeader: () => r(R)
|
|
4938
4938
|
},
|
|
4939
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4939
|
+
renderFooter: () => a == null ? void 0 : a(R),
|
|
4940
4940
|
disabled: c,
|
|
4941
4941
|
disabledReason: p,
|
|
4942
4942
|
composerInput: F
|
|
@@ -4968,14 +4968,14 @@ const vl = ({
|
|
|
4968
4968
|
},
|
|
4969
4969
|
"lt-channel-message-list"
|
|
4970
4970
|
),
|
|
4971
|
-
r ? /* @__PURE__ */ n(z.Fragment, { children: r(
|
|
4971
|
+
r ? /* @__PURE__ */ n(z.Fragment, { children: r(R) }, "lt-channel-conversation-footer") : null,
|
|
4972
4972
|
/* @__PURE__ */ n(
|
|
4973
4973
|
rn,
|
|
4974
4974
|
{
|
|
4975
4975
|
...s && {
|
|
4976
|
-
renderActions: () => s == null ? void 0 : s(
|
|
4976
|
+
renderActions: () => s == null ? void 0 : s(R)
|
|
4977
4977
|
},
|
|
4978
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4978
|
+
renderFooter: () => a == null ? void 0 : a(R),
|
|
4979
4979
|
disabled: c,
|
|
4980
4980
|
disabledReason: p,
|
|
4981
4981
|
composerInput: F
|
|
@@ -5009,11 +5009,11 @@ const vl = ({
|
|
|
5009
5009
|
messageMetadata: N,
|
|
5010
5010
|
onMessageSent: _,
|
|
5011
5011
|
showStarButton: T = !1,
|
|
5012
|
-
renderChannelBanner:
|
|
5012
|
+
renderChannelBanner: L,
|
|
5013
5013
|
customChannelActions: E,
|
|
5014
5014
|
renderChannelActions: $,
|
|
5015
5015
|
renderMessage: F,
|
|
5016
|
-
onMessageLinkClick:
|
|
5016
|
+
onMessageLinkClick: R,
|
|
5017
5017
|
sendButton: I,
|
|
5018
5018
|
attachmentPreviewList: M,
|
|
5019
5019
|
viewerLanguage: S,
|
|
@@ -5044,17 +5044,17 @@ const vl = ({
|
|
|
5044
5044
|
[e, b, N, _]
|
|
5045
5045
|
), Q = j(null);
|
|
5046
5046
|
return Y(() => {
|
|
5047
|
-
if (!
|
|
5047
|
+
if (!R) return;
|
|
5048
5048
|
const V = Q.current;
|
|
5049
5049
|
if (!V) return;
|
|
5050
5050
|
const y = (D) => {
|
|
5051
5051
|
const W = D.target, X = W == null ? void 0 : W.closest("a[href]"), G = X == null ? void 0 : X.getAttribute("href");
|
|
5052
5052
|
if (!G) return;
|
|
5053
5053
|
const q = X == null ? void 0 : X.closest("[data-message-id]"), K = q == null ? void 0 : q.getAttribute("data-message-id"), se = K ? e.state.messages.find((Me) => Me.id === K) : void 0;
|
|
5054
|
-
|
|
5054
|
+
R(G, se);
|
|
5055
5055
|
};
|
|
5056
5056
|
return V.addEventListener("click", y), () => V.removeEventListener("click", y);
|
|
5057
|
-
}, [
|
|
5057
|
+
}, [R, e]), /* @__PURE__ */ n(
|
|
5058
5058
|
"div",
|
|
5059
5059
|
{
|
|
5060
5060
|
ref: Q,
|
|
@@ -5094,7 +5094,7 @@ const vl = ({
|
|
|
5094
5094
|
composerDisabled: v,
|
|
5095
5095
|
composerDisabledReason: x,
|
|
5096
5096
|
showStarButton: T,
|
|
5097
|
-
renderChannelBanner:
|
|
5097
|
+
renderChannelBanner: L,
|
|
5098
5098
|
customChannelActions: E,
|
|
5099
5099
|
renderChannelActions: $,
|
|
5100
5100
|
renderMessage: F,
|
|
@@ -5151,13 +5151,13 @@ const ro = ({
|
|
|
5151
5151
|
renderMessage: N,
|
|
5152
5152
|
onMessageLinkClick: _,
|
|
5153
5153
|
showChannelInfo: T,
|
|
5154
|
-
composerInput:
|
|
5154
|
+
composerInput: L
|
|
5155
5155
|
}) => {
|
|
5156
5156
|
const {
|
|
5157
5157
|
client: E,
|
|
5158
5158
|
isConnected: $,
|
|
5159
5159
|
isLoading: F,
|
|
5160
|
-
error:
|
|
5160
|
+
error: R,
|
|
5161
5161
|
refreshConnection: I,
|
|
5162
5162
|
service: M,
|
|
5163
5163
|
debug: S
|
|
@@ -5238,7 +5238,7 @@ const ro = ({
|
|
|
5238
5238
|
var q;
|
|
5239
5239
|
A(null), te(!0), (q = X.current) == null || q.call(X);
|
|
5240
5240
|
}, []);
|
|
5241
|
-
return F ? /* @__PURE__ */ n(Ue, {}) :
|
|
5241
|
+
return F ? /* @__PURE__ */ n(Ue, {}) : R ? /* @__PURE__ */ n(ke, { message: R, onBack: I }) : !$ || !E ? /* @__PURE__ */ n(
|
|
5242
5242
|
ke,
|
|
5243
5243
|
{
|
|
5244
5244
|
message: "Not connected to messaging service",
|
|
@@ -5268,7 +5268,7 @@ const ro = ({
|
|
|
5268
5268
|
renderMessage: N,
|
|
5269
5269
|
onMessageLinkClick: _,
|
|
5270
5270
|
showChannelInfo: T,
|
|
5271
|
-
composerInput:
|
|
5271
|
+
composerInput: L
|
|
5272
5272
|
},
|
|
5273
5273
|
C.id
|
|
5274
5274
|
) }) }) : /* @__PURE__ */ n(Ue, {});
|
|
@@ -5309,7 +5309,7 @@ const Zn = z.createContext({
|
|
|
5309
5309
|
});
|
|
5310
5310
|
}, Jn = z.memo(
|
|
5311
5311
|
(e) => {
|
|
5312
|
-
var $, F,
|
|
5312
|
+
var $, F, R;
|
|
5313
5313
|
const { channel: t, unread: s } = e, {
|
|
5314
5314
|
selectedChannel: a,
|
|
5315
5315
|
onChannelSelect: r,
|
|
@@ -5364,7 +5364,7 @@ const Zn = z.createContext({
|
|
|
5364
5364
|
if (I) return I;
|
|
5365
5365
|
const C = (A = x == null ? void 0 : x.attachments) == null ? void 0 : A[0];
|
|
5366
5366
|
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
5367
|
-
})(), _ = x != null && x.created_at ? Nl(new Date(x.created_at)) : "", T = x ? Fe(x) : !1,
|
|
5367
|
+
})(), _ = x != null && x.created_at ? Nl(new Date(x.created_at)) : "", T = x ? Fe(x) : !1, L = l ? l(x, N) : `${T ? "✨ " : ""}${N}`, E = s ?? 0;
|
|
5368
5368
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
5369
5369
|
channelId: t == null ? void 0 : t.id,
|
|
5370
5370
|
isSelected: h,
|
|
@@ -5390,7 +5390,7 @@ const Zn = z.createContext({
|
|
|
5390
5390
|
/* @__PURE__ */ n(
|
|
5391
5391
|
we,
|
|
5392
5392
|
{
|
|
5393
|
-
id: ((
|
|
5393
|
+
id: ((R = p == null ? void 0 : p.user) == null ? void 0 : R.id) || t.id || "unknown",
|
|
5394
5394
|
name: w,
|
|
5395
5395
|
image: v,
|
|
5396
5396
|
size: 48,
|
|
@@ -5414,7 +5414,7 @@ const Zn = z.createContext({
|
|
|
5414
5414
|
_ && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: _ })
|
|
5415
5415
|
] }),
|
|
5416
5416
|
/* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
5417
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
5417
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: L }),
|
|
5418
5418
|
E > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: E > 99 ? "99+" : E })
|
|
5419
5419
|
] })
|
|
5420
5420
|
] })
|
|
@@ -5448,10 +5448,10 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
|
|
|
5448
5448
|
const b = z.useRef(0);
|
|
5449
5449
|
b.current++;
|
|
5450
5450
|
const { debug: N = !1 } = lt(), _ = z.useCallback(
|
|
5451
|
-
(
|
|
5452
|
-
for (const E of
|
|
5451
|
+
(L) => {
|
|
5452
|
+
for (const E of L)
|
|
5453
5453
|
xl(E);
|
|
5454
|
-
return r ? r(
|
|
5454
|
+
return r ? r(L) : L;
|
|
5455
5455
|
},
|
|
5456
5456
|
[r]
|
|
5457
5457
|
);
|
|
@@ -5599,11 +5599,11 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", E
|
|
|
5599
5599
|
1: [0],
|
|
5600
5600
|
2: [-10, 10],
|
|
5601
5601
|
3: [-13, 0, 13]
|
|
5602
|
-
},
|
|
5602
|
+
}, Rl = {
|
|
5603
5603
|
1: [0],
|
|
5604
5604
|
2: [-30, 30],
|
|
5605
5605
|
3: [-44, 0, 44]
|
|
5606
|
-
},
|
|
5606
|
+
}, Ll = {
|
|
5607
5607
|
1: [0],
|
|
5608
5608
|
2: [0, 1],
|
|
5609
5609
|
3: [1, 3, 2]
|
|
@@ -5615,7 +5615,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", E
|
|
|
5615
5615
|
const [s, a] = z.useState({}), r = t.join(`
|
|
5616
5616
|
`), [i, o] = z.useState(r);
|
|
5617
5617
|
r !== i && (o(r), a({}));
|
|
5618
|
-
const l = t.slice(0, 3).map((c, p) => ({ src: c, index: p })).filter(({ index: c }) => !s[c]), d = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, u = Al[d], h =
|
|
5618
|
+
const l = t.slice(0, 3).map((c, p) => ({ src: c, index: p })).filter(({ index: c }) => !s[c]), d = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, u = Al[d], h = Rl[d], m = Ll[d], g = Ml[d];
|
|
5619
5619
|
return /* @__PURE__ */ n(
|
|
5620
5620
|
"div",
|
|
5621
5621
|
{
|
|
@@ -5900,4 +5900,4 @@ export {
|
|
|
5900
5900
|
dt as y,
|
|
5901
5901
|
ut as z
|
|
5902
5902
|
};
|
|
5903
|
-
//# sourceMappingURL=index-
|
|
5903
|
+
//# sourceMappingURL=index-Dyxu8r07.js.map
|