@linktr.ee/messaging-react 3.15.1-rc-1784866707 → 3.15.1
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-BZ5QF2gm.cjs → Card-BPPe6RVF.cjs} +2 -2
- package/dist/{Card-BZ5QF2gm.cjs.map → Card-BPPe6RVF.cjs.map} +1 -1
- package/dist/{Card-DldMwIcO.js → Card-opmIFszT.js} +2 -2
- package/dist/{Card-DldMwIcO.js.map → Card-opmIFszT.js.map} +1 -1
- package/dist/{index-BOThiuy9.js → index-BdRJRNr3.js} +158 -161
- package/dist/index-BdRJRNr3.js.map +1 -0
- package/dist/{index-stv1fd7v.cjs → index-ftxF5ams.cjs} +2 -2
- package/dist/index-ftxF5ams.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +47 -6
- package/src/components/CustomMessageInput/index.tsx +11 -11
- package/dist/index-BOThiuy9.js.map +0 -1
- package/dist/index-stv1fd7v.cjs.map +0 -1
- package/src/utils/isIOS.test.ts +0 -54
- package/src/utils/isIOS.ts +0 -19
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as s, jsxs as h, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import j, { createContext as st, useContext as ye, useCallback as W, useState as F, useRef as G, useEffect as Y, useId as js, useMemo as se, Suspense as Vs } from "react";
|
|
3
3
|
import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
|
|
4
|
-
import { StreamChat as Hs, LinkPreviewsManager as
|
|
4
|
+
import { StreamChat as Hs, LinkPreviewsManager as Ot } from "stream-chat";
|
|
5
5
|
import { Chat as Ys, useChannelStateContext as ue, useChatContext as ke, DateSeparator as qs, MessageStatus as Ws, useMessageContext as pe, MessageErrorIcon as Ze, MessageText as Le, areMessageUIPropsEqual as Xs, useMessageReminder as Ks, useComponentContext as es, Attachment as Zs, EditMessageModal as Js, MessageBlocked as Qs, MessageBouncePrompt as en, MessageDeleted as tn, MessageIsThreadReplyInChannelButtonIndicator as sn, MessageRepliesCountButton as nn, ReminderNotification as an, StreamedMessageText as rn, messageHasAttachments as on, messageHasReactions as ln, isDateSeparatorMessage as cn, isMessageBlocked as dn, isMessageBounced as un, MessageBounceModal as mn, Poll as hn, useMessageComposer as fn, useStateStore as gn, MessageInput as Ft, useMessageInputContext as pn, useMessageComposerHasSendableData as bn, AttachmentPreviewList as vn, QuotedMessagePreview as xn, TextareaComposer as wn, MessageTimestamp as Ve, AIStates as Ge, useTypingContext as _n, useAIState as Nn, Channel as yn, WithComponents as kn, Window as Cn, MessageList as Bt, ChannelList as Sn, InfiniteScroll as En } from "stream-chat-react";
|
|
6
6
|
import y from "classnames";
|
|
7
|
-
import { StarIcon as Je, DotsThreeIcon as In, SpinnerGapIcon as Ae, SignOutIcon as Tn, ProhibitInsetIcon as $t, FlagIcon as ts, CurrencyDollarIcon as Mn, CaretRightIcon as ss, ArrowLeftIcon as An, FileIcon as ns, ImageIcon as Rn, SpeakerHighIcon as Ln, VideoCameraIcon as as, FileMdIcon as Dn, FileTextIcon as Pn, FileZipIcon as
|
|
7
|
+
import { StarIcon as Je, DotsThreeIcon as In, SpinnerGapIcon as Ae, SignOutIcon as Tn, ProhibitInsetIcon as $t, FlagIcon as ts, CurrencyDollarIcon as Mn, CaretRightIcon as ss, ArrowLeftIcon as An, FileIcon as ns, ImageIcon as Rn, SpeakerHighIcon as Ln, VideoCameraIcon as as, FileMdIcon as Dn, FileTextIcon as Pn, FileZipIcon as zn, FilePptIcon as On, FileCsvIcon as Fn, FileXlsIcon as Bn, FileDocIcon as $n, FilePdfIcon as Un, CircleNotchIcon as _e, PlayIcon as Qe, PauseIcon as jn, LinkIcon as Vn, DownloadSimpleIcon as Ne, XIcon as Be, CaretLeftIcon as Gn, GiftIcon as Hn, ThumbsUpIcon as Yn, ThumbsDownIcon as qn, ChecksIcon as Wn, PencilSimpleIcon as Xn, TrashSimpleIcon as Kn, ArrowUpIcon as Zn, SparkleIcon as Jn, ProhibitIcon as Qn } from "@phosphor-icons/react";
|
|
8
8
|
import { MessageActions as ea, DefaultDropdownActionButton as rs } from "stream-chat-react/experimental";
|
|
9
9
|
const is = st({
|
|
10
10
|
service: null,
|
|
@@ -16,7 +16,7 @@ const is = st({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), nt = () => ye(is),
|
|
19
|
+
}), nt = () => ye(is), ho = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -47,9 +47,9 @@ const is = st({
|
|
|
47
47
|
apiKey: a,
|
|
48
48
|
serviceConfig: n,
|
|
49
49
|
capabilities: r
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
renderCount:
|
|
50
|
+
}), O = G(0);
|
|
51
|
+
O.current++, o("📊 RENDER INFO", {
|
|
52
|
+
renderCount: O.current,
|
|
53
53
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
54
54
|
propChanges: {
|
|
55
55
|
userChanged: A.current.userId !== (t == null ? void 0 : t.id),
|
|
@@ -65,14 +65,14 @@ const is = st({
|
|
|
65
65
|
};
|
|
66
66
|
const B = G(null);
|
|
67
67
|
!l && a && ((N = B.current) == null ? void 0 : N.apiKey) !== a && (B.current = { apiKey: a, client: new Hs(a) });
|
|
68
|
-
const
|
|
68
|
+
const z = l || (a ? ((M = B.current) == null ? void 0 : M.client) ?? null : null);
|
|
69
69
|
Y(() => {
|
|
70
|
-
const E =
|
|
70
|
+
const E = O.current, D = k.current;
|
|
71
71
|
if (l) {
|
|
72
72
|
S.current = null, u(null), m(null), c(!1), b(null), w(!1);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
|
-
if (!a || !
|
|
75
|
+
if (!a || !z || !D) {
|
|
76
76
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
77
77
|
renderCount: E,
|
|
78
78
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -87,13 +87,13 @@ const is = st({
|
|
|
87
87
|
...D,
|
|
88
88
|
apiKey: a,
|
|
89
89
|
debug: R.current,
|
|
90
|
-
client:
|
|
90
|
+
client: z
|
|
91
91
|
});
|
|
92
92
|
S.current = H, u(H), o("✅ SERVICE SET", {
|
|
93
93
|
renderCount: E,
|
|
94
94
|
serviceInstance: !!H
|
|
95
95
|
});
|
|
96
|
-
}, [a,
|
|
96
|
+
}, [a, z, l]);
|
|
97
97
|
const L = G(null);
|
|
98
98
|
Y(() => {
|
|
99
99
|
var D, H;
|
|
@@ -144,12 +144,12 @@ const is = st({
|
|
|
144
144
|
}
|
|
145
145
|
})();
|
|
146
146
|
}, [d, t, o, f, l]), Y(() => {
|
|
147
|
-
const E =
|
|
147
|
+
const E = z;
|
|
148
148
|
return () => {
|
|
149
149
|
var D;
|
|
150
150
|
E && (L.current = null, (D = S.current) == null || D.disconnectUser().catch(console.error));
|
|
151
151
|
};
|
|
152
|
-
}, [
|
|
152
|
+
}, [z]);
|
|
153
153
|
const C = W(async () => {
|
|
154
154
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
155
155
|
hasService: !!d,
|
|
@@ -211,13 +211,13 @@ const is = st({
|
|
|
211
211
|
o
|
|
212
212
|
]);
|
|
213
213
|
return o("🔄 RENDER END", {
|
|
214
|
-
renderCount:
|
|
215
|
-
willRenderChat: !!
|
|
214
|
+
renderCount: O.current,
|
|
215
|
+
willRenderChat: !!z,
|
|
216
216
|
contextValueReady: !!I
|
|
217
|
-
}), /* @__PURE__ */ s(is.Provider, { value: I, children:
|
|
217
|
+
}), /* @__PURE__ */ s(is.Provider, { value: I, children: z ? /* @__PURE__ */ s(
|
|
218
218
|
Ys,
|
|
219
219
|
{
|
|
220
|
-
client:
|
|
220
|
+
client: z,
|
|
221
221
|
customClasses: {
|
|
222
222
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
223
223
|
},
|
|
@@ -408,7 +408,7 @@ const be = ({
|
|
|
408
408
|
logLabel: g = "useChannelModerationActions"
|
|
409
409
|
}) => {
|
|
410
410
|
var I;
|
|
411
|
-
const { service: m, debug: f } = nt(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, v = !!(a && n && m && c), [w, p] = F(!1), [b, x] = F(null), [S, k] = F(!1), [R, A] = F(!1),
|
|
411
|
+
const { service: m, debug: f } = nt(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, v = !!(a && n && m && c), [w, p] = F(!1), [b, x] = F(null), [S, k] = F(!1), [R, A] = F(!1), O = v && ((b == null ? void 0 : b.participantId) !== c || (b == null ? void 0 : b.service) !== m);
|
|
412
412
|
return Y(() => {
|
|
413
413
|
if (!v || !m || !c) {
|
|
414
414
|
p(!1), x(null);
|
|
@@ -434,7 +434,7 @@ const be = ({
|
|
|
434
434
|
};
|
|
435
435
|
}, [v, m, c, g]), {
|
|
436
436
|
isParticipantBlocked: w,
|
|
437
|
-
isCheckingBlockedStatus:
|
|
437
|
+
isCheckingBlockedStatus: O,
|
|
438
438
|
isLeaving: S,
|
|
439
439
|
isUpdatingBlockStatus: R,
|
|
440
440
|
handleLeaveConversation: async () => {
|
|
@@ -519,7 +519,7 @@ const be = ({
|
|
|
519
519
|
isUpdatingBlockStatus: k,
|
|
520
520
|
handleLeaveConversation: R,
|
|
521
521
|
handleBlockUser: A,
|
|
522
|
-
handleUnblockUser:
|
|
522
|
+
handleUnblockUser: O,
|
|
523
523
|
handleReportUser: B
|
|
524
524
|
} = da({
|
|
525
525
|
channel: e,
|
|
@@ -592,7 +592,7 @@ const be = ({
|
|
|
592
592
|
) : b ? /* @__PURE__ */ h(
|
|
593
593
|
ve,
|
|
594
594
|
{
|
|
595
|
-
onClick:
|
|
595
|
+
onClick: O,
|
|
596
596
|
disabled: k,
|
|
597
597
|
"aria-busy": k,
|
|
598
598
|
children: [
|
|
@@ -639,7 +639,7 @@ const be = ({
|
|
|
639
639
|
showChannelInfo: v = !0,
|
|
640
640
|
onParticipantNameClick: w
|
|
641
641
|
}) => {
|
|
642
|
-
var
|
|
642
|
+
var z, L, C, I;
|
|
643
643
|
const { channel: p } = ue(), { client: b } = ke(), x = j.useMemo(
|
|
644
644
|
() => {
|
|
645
645
|
var N;
|
|
@@ -649,8 +649,8 @@ const be = ({
|
|
|
649
649
|
p.type
|
|
650
650
|
);
|
|
651
651
|
},
|
|
652
|
-
[(
|
|
653
|
-
), S = cs(x == null ? void 0 : x.user), k = (L = x == null ? void 0 : x.user) == null ? void 0 : L.image, R = os(p), A = ha((C = p.data) == null ? void 0 : C.customer_tag) && (x == null ? void 0 : x.is_follower) === !0,
|
|
652
|
+
[(z = p.state) == null ? void 0 : z.members, b == null ? void 0 : b.userID, p.type]
|
|
653
|
+
), S = cs(x == null ? void 0 : x.user), k = (L = x == null ? void 0 : x.user) == null ? void 0 : L.image, R = os(p), A = ha((C = p.data) == null ? void 0 : C.customer_tag) && (x == null ? void 0 : x.is_follower) === !0, O = async () => {
|
|
654
654
|
try {
|
|
655
655
|
R ? await p.unpin() : await p.pin();
|
|
656
656
|
} catch (N) {
|
|
@@ -738,7 +738,7 @@ const be = ({
|
|
|
738
738
|
"button",
|
|
739
739
|
{
|
|
740
740
|
className: He,
|
|
741
|
-
onClick:
|
|
741
|
+
onClick: O,
|
|
742
742
|
type: "button",
|
|
743
743
|
"aria-pressed": R,
|
|
744
744
|
"aria-label": R ? "Unstar conversation" : "Star conversation",
|
|
@@ -867,8 +867,8 @@ const ya = {
|
|
|
867
867
|
doc: $n,
|
|
868
868
|
xls: Bn,
|
|
869
869
|
csv: Fn,
|
|
870
|
-
ppt:
|
|
871
|
-
zip:
|
|
870
|
+
ppt: On,
|
|
871
|
+
zip: zn,
|
|
872
872
|
text: Pn,
|
|
873
873
|
markdown: Dn,
|
|
874
874
|
generic: ns
|
|
@@ -895,7 +895,7 @@ const Sa = (e) => {
|
|
|
895
895
|
muted: d = !1,
|
|
896
896
|
onContainerClick: u
|
|
897
897
|
}) => {
|
|
898
|
-
const g = oe(t), m = G(null), f = G(null), c = G(null), v = G(r), [w, p] = F(a), [b, x] = F(0), [S, k] = F(!1), [R, A] = F(!1), [
|
|
898
|
+
const g = oe(t), m = G(null), f = G(null), c = G(null), v = G(r), [w, p] = F(a), [b, x] = F(0), [S, k] = F(!1), [R, A] = F(!1), [O, B] = F(!1), [z, L] = F(!1), [C, I] = F(!0), [N, M] = F(null), E = W(() => {
|
|
899
899
|
B(!1), p(!0);
|
|
900
900
|
}, []), D = W((_) => {
|
|
901
901
|
const T = f.current;
|
|
@@ -954,7 +954,7 @@ const Sa = (e) => {
|
|
|
954
954
|
u(_);
|
|
955
955
|
return;
|
|
956
956
|
}
|
|
957
|
-
|
|
957
|
+
O || l && p((T) => !T);
|
|
958
958
|
},
|
|
959
959
|
onKeyDown: (_) => {
|
|
960
960
|
if (!(_.key !== "Enter" && _.key !== " ")) {
|
|
@@ -962,7 +962,7 @@ const Sa = (e) => {
|
|
|
962
962
|
u(_);
|
|
963
963
|
return;
|
|
964
964
|
}
|
|
965
|
-
|
|
965
|
+
O || l && p((T) => !T);
|
|
966
966
|
}
|
|
967
967
|
},
|
|
968
968
|
children: [
|
|
@@ -1022,14 +1022,14 @@ const Sa = (e) => {
|
|
|
1022
1022
|
children: /* @__PURE__ */ s("track", { kind: "captions" })
|
|
1023
1023
|
}
|
|
1024
1024
|
) }),
|
|
1025
|
-
|
|
1025
|
+
z && !O && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
1026
1026
|
_e,
|
|
1027
1027
|
{
|
|
1028
1028
|
className: "size-8 animate-spin text-white/80",
|
|
1029
1029
|
weight: "bold"
|
|
1030
1030
|
}
|
|
1031
1031
|
) }),
|
|
1032
|
-
|
|
1032
|
+
O && !l && /* @__PURE__ */ s(
|
|
1033
1033
|
"div",
|
|
1034
1034
|
{
|
|
1035
1035
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1446,7 +1446,7 @@ const bs = ({
|
|
|
1446
1446
|
action: /* @__PURE__ */ s(Pa, { url: e, filename: n })
|
|
1447
1447
|
}
|
|
1448
1448
|
);
|
|
1449
|
-
},
|
|
1449
|
+
}, za = ({
|
|
1450
1450
|
message: e,
|
|
1451
1451
|
isMyMessage: t = !1
|
|
1452
1452
|
}) => {
|
|
@@ -1478,7 +1478,7 @@ const bs = ({
|
|
|
1478
1478
|
}
|
|
1479
1479
|
)
|
|
1480
1480
|
] });
|
|
1481
|
-
},
|
|
1481
|
+
}, Oa = ({
|
|
1482
1482
|
message: e
|
|
1483
1483
|
}) => {
|
|
1484
1484
|
const t = it(e);
|
|
@@ -1494,8 +1494,8 @@ const bs = ({
|
|
|
1494
1494
|
return /* @__PURE__ */ s("div", { className: at(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(rt, { attachment: t, isMyMessage: !1 }) });
|
|
1495
1495
|
const n = ot(e);
|
|
1496
1496
|
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
|
|
1497
|
-
},
|
|
1498
|
-
Creator:
|
|
1497
|
+
}, fo = Object.assign(za, {
|
|
1498
|
+
Creator: Oa,
|
|
1499
1499
|
Visitor: Fa
|
|
1500
1500
|
}), Ba = {
|
|
1501
1501
|
dark: "bg-[#1e2330]",
|
|
@@ -2657,17 +2657,17 @@ const ar = ({
|
|
|
2657
2657
|
isUnlocking: () => !1
|
|
2658
2658
|
}, Pr = {
|
|
2659
2659
|
LockedAttachment: Dr
|
|
2660
|
-
}, Ms = st({}),
|
|
2661
|
-
function
|
|
2660
|
+
}, Ms = st({}), go = Ms.Provider;
|
|
2661
|
+
function zr(e) {
|
|
2662
2662
|
return ye(Ms)[e] ?? Pr[e];
|
|
2663
2663
|
}
|
|
2664
|
-
const
|
|
2664
|
+
const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import("./Card-opmIFszT.js")), Br = () => /* @__PURE__ */ s(
|
|
2665
2665
|
"div",
|
|
2666
2666
|
{
|
|
2667
2667
|
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)]",
|
|
2668
2668
|
"aria-hidden": !0
|
|
2669
2669
|
}
|
|
2670
|
-
), Re = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Br, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(
|
|
2670
|
+
), Re = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Br, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(Or, { ...e }) : /* @__PURE__ */ s(Fr, { ...e }) }), $r = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2671
2671
|
"svg",
|
|
2672
2672
|
{
|
|
2673
2673
|
width: e,
|
|
@@ -2953,7 +2953,7 @@ const Zr = {
|
|
|
2953
2953
|
if (!t || !e) return !1;
|
|
2954
2954
|
const n = oe(e);
|
|
2955
2955
|
return n === "video" || n === "audio";
|
|
2956
|
-
}, vt = "bg-[#F2F3F4]",
|
|
2956
|
+
}, vt = "bg-[#F2F3F4]", ze = ({
|
|
2957
2957
|
variant: e,
|
|
2958
2958
|
thumbnailUrl: t,
|
|
2959
2959
|
sourceUrl: n,
|
|
@@ -3052,7 +3052,7 @@ const Zr = {
|
|
|
3052
3052
|
) : void 0;
|
|
3053
3053
|
return c ? /* @__PURE__ */ s(Pe, { variant: "dark", bgClassName: vt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3054
3054
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
3055
|
-
|
|
3055
|
+
ze,
|
|
3056
3056
|
{
|
|
3057
3057
|
variant: "dark",
|
|
3058
3058
|
sourceUrl: l,
|
|
@@ -3068,7 +3068,7 @@ const Zr = {
|
|
|
3068
3068
|
topRight: f ? v : void 0,
|
|
3069
3069
|
children: [
|
|
3070
3070
|
!f && /* @__PURE__ */ s(
|
|
3071
|
-
|
|
3071
|
+
ze,
|
|
3072
3072
|
{
|
|
3073
3073
|
variant: "dark",
|
|
3074
3074
|
thumbnailUrl: i,
|
|
@@ -3124,7 +3124,7 @@ const Zr = {
|
|
|
3124
3124
|
"data-testid": "link-attachment",
|
|
3125
3125
|
children: [
|
|
3126
3126
|
l === "featured" && /* @__PURE__ */ s(
|
|
3127
|
-
|
|
3127
|
+
ze,
|
|
3128
3128
|
{
|
|
3129
3129
|
variant: "light",
|
|
3130
3130
|
thumbnailUrl: r,
|
|
@@ -3170,7 +3170,7 @@ const Zr = {
|
|
|
3170
3170
|
bgClassName: $e(r, l) ? vt : void 0,
|
|
3171
3171
|
children: [
|
|
3172
3172
|
o === "featured" && /* @__PURE__ */ s(
|
|
3173
|
-
|
|
3173
|
+
ze,
|
|
3174
3174
|
{
|
|
3175
3175
|
variant: "dark",
|
|
3176
3176
|
thumbnailUrl: i,
|
|
@@ -3477,7 +3477,7 @@ const gi = ({
|
|
|
3477
3477
|
renderText: v,
|
|
3478
3478
|
threadList: w,
|
|
3479
3479
|
viewerLanguage: p
|
|
3480
|
-
} = e, { client: b } = ke("CustomMessage"), { channel: x } = ue("CustomMessage"), { isUnlocking: S, onUnlockClick: k, onFetchSource: R, onDownloadClick: A } =
|
|
3480
|
+
} = e, { client: b } = ke("CustomMessage"), { channel: x } = ue("CustomMessage"), { isUnlocking: S, onUnlockClick: k, onFetchSource: R, onDownloadClick: A } = zr("LockedAttachment"), [O, B] = F(!1), z = Ks(c.id), { selected: L, voteUp: C, voteDown: I } = ba(c), {
|
|
3481
3481
|
Attachment: N = Zs,
|
|
3482
3482
|
EditMessageModal: M = Js,
|
|
3483
3483
|
MessageActions: E,
|
|
@@ -3495,7 +3495,7 @@ const gi = ({
|
|
|
3495
3495
|
), U = se(() => {
|
|
3496
3496
|
const ce = c.attachments ?? [], fe = c.shared_location ? [c.shared_location, ...ce] : ce;
|
|
3497
3497
|
if (!De(c)) return fe;
|
|
3498
|
-
const Pt = fe.filter((
|
|
3498
|
+
const Pt = fe.filter((zt) => !("type" in zt) || !ps(zt));
|
|
3499
3499
|
return Pt.length === fe.length ? fe : Pt;
|
|
3500
3500
|
}, [c]), J = se(
|
|
3501
3501
|
() => Ls(U),
|
|
@@ -3559,12 +3559,12 @@ const gi = ({
|
|
|
3559
3559
|
additionalMessageInputProps: t
|
|
3560
3560
|
}
|
|
3561
3561
|
),
|
|
3562
|
-
|
|
3562
|
+
O && /* @__PURE__ */ s(
|
|
3563
3563
|
mn,
|
|
3564
3564
|
{
|
|
3565
3565
|
MessageBouncePrompt: H,
|
|
3566
3566
|
onClose: () => B(!1),
|
|
3567
|
-
open:
|
|
3567
|
+
open: O
|
|
3568
3568
|
}
|
|
3569
3569
|
),
|
|
3570
3570
|
/* @__PURE__ */ h(
|
|
@@ -3575,7 +3575,7 @@ const gi = ({
|
|
|
3575
3575
|
"data-dd-privacy": "mask",
|
|
3576
3576
|
children: [
|
|
3577
3577
|
T && /* @__PURE__ */ s(T, {}),
|
|
3578
|
-
!!
|
|
3578
|
+
!!z && /* @__PURE__ */ s(V, { reminder: z }),
|
|
3579
3579
|
c.user && /* @__PURE__ */ s(
|
|
3580
3580
|
be,
|
|
3581
3581
|
{
|
|
@@ -3776,11 +3776,7 @@ const gi = ({
|
|
|
3776
3776
|
]
|
|
3777
3777
|
}
|
|
3778
3778
|
);
|
|
3779
|
-
}
|
|
3780
|
-
function Ni() {
|
|
3781
|
-
return typeof navigator > "u" ? !1 : /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
3782
|
-
}
|
|
3783
|
-
const yi = ({
|
|
3779
|
+
}, Ni = ({
|
|
3784
3780
|
link: e,
|
|
3785
3781
|
onDismiss: t
|
|
3786
3782
|
}) => {
|
|
@@ -3820,14 +3816,14 @@ const yi = ({
|
|
|
3820
3816
|
]
|
|
3821
3817
|
}
|
|
3822
3818
|
);
|
|
3823
|
-
},
|
|
3819
|
+
}, yi = (e) => ({
|
|
3824
3820
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3825
|
-
(t) =>
|
|
3821
|
+
(t) => Ot.previewIsLoaded(t) || Ot.previewIsLoading(t)
|
|
3826
3822
|
)
|
|
3827
|
-
}),
|
|
3823
|
+
}), ki = () => {
|
|
3828
3824
|
const { linkPreviewsManager: e } = fn(), { linkPreviews: t } = gn(
|
|
3829
3825
|
e.state,
|
|
3830
|
-
|
|
3826
|
+
yi
|
|
3831
3827
|
), n = (r) => {
|
|
3832
3828
|
e.dismissPreview(r);
|
|
3833
3829
|
};
|
|
@@ -3840,21 +3836,22 @@ const yi = ({
|
|
|
3840
3836
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3841
3837
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3842
3838
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3843
|
-
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(
|
|
3839
|
+
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(Ni, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3844
3840
|
) : null;
|
|
3845
|
-
},
|
|
3841
|
+
}, Oe = j.createContext(!1), Ci = 200, po = () => ye(Oe), Si = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3846
3842
|
"button",
|
|
3847
3843
|
{
|
|
3848
3844
|
...n,
|
|
3849
3845
|
type: "button",
|
|
3850
3846
|
"aria-label": "Send",
|
|
3851
3847
|
disabled: t,
|
|
3848
|
+
onPointerDown: (a) => a.preventDefault(),
|
|
3852
3849
|
onClick: e,
|
|
3853
3850
|
children: /* @__PURE__ */ s(Zn, { weight: "bold", className: "size-4" })
|
|
3854
3851
|
}
|
|
3855
3852
|
), Xt = () => {
|
|
3856
|
-
const e = ye(
|
|
3857
|
-
SendButton: r =
|
|
3853
|
+
const e = ye(Oe), { handleSubmit: t } = pn(), n = bn(), a = e || !n, {
|
|
3854
|
+
SendButton: r = Si,
|
|
3858
3855
|
AttachmentPreviewList: i = vn
|
|
3859
3856
|
} = es("CustomMessageInput");
|
|
3860
3857
|
return (
|
|
@@ -3887,7 +3884,7 @@ const yi = ({
|
|
|
3887
3884
|
children: [
|
|
3888
3885
|
/* @__PURE__ */ h("div", { className: "messaging-composer-previews empty:hidden flex min-h-0 flex-col gap-2 px-2 pt-2", children: [
|
|
3889
3886
|
/* @__PURE__ */ s(xn, {}),
|
|
3890
|
-
/* @__PURE__ */ s(
|
|
3887
|
+
/* @__PURE__ */ s(ki, {}),
|
|
3891
3888
|
/* @__PURE__ */ s(i, {})
|
|
3892
3889
|
] }),
|
|
3893
3890
|
/* @__PURE__ */ h("div", { className: "messaging-composer-row flex shrink-0 items-start", children: [
|
|
@@ -3897,7 +3894,7 @@ const yi = ({
|
|
|
3897
3894
|
"aria-disabled": e || void 0,
|
|
3898
3895
|
containerClassName: "min-w-0 flex-1 leading-[0]",
|
|
3899
3896
|
className: "w-full resize-none bg-transparent py-3.5 pl-4 pr-4 outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
3900
|
-
autoFocus: !e
|
|
3897
|
+
autoFocus: !e,
|
|
3901
3898
|
enterKeyHint: "send",
|
|
3902
3899
|
maxRows: 4,
|
|
3903
3900
|
readOnly: e,
|
|
@@ -3942,7 +3939,7 @@ const yi = ({
|
|
|
3942
3939
|
c = p;
|
|
3943
3940
|
const x = Array.from(
|
|
3944
3941
|
f.querySelectorAll(".str-chat__list")
|
|
3945
|
-
).find((k) => k.scrollHeight > k.clientHeight) ?? null, S = x ? x.scrollHeight - x.scrollTop - x.clientHeight <
|
|
3942
|
+
).find((k) => k.scrollHeight > k.clientHeight) ?? null, S = x ? x.scrollHeight - x.scrollTop - x.clientHeight < Ci : !1;
|
|
3946
3943
|
f.style.setProperty(
|
|
3947
3944
|
"--messaging-composer-height",
|
|
3948
3945
|
`${p}px`
|
|
@@ -4004,7 +4001,7 @@ const yi = ({
|
|
|
4004
4001
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
4005
4002
|
children: [
|
|
4006
4003
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
4007
|
-
/* @__PURE__ */ s(
|
|
4004
|
+
/* @__PURE__ */ s(Oe.Provider, { value: o, children: /* @__PURE__ */ s(Ft, { Input: i ?? Xt }) })
|
|
4008
4005
|
]
|
|
4009
4006
|
}
|
|
4010
4007
|
),
|
|
@@ -4023,28 +4020,28 @@ const yi = ({
|
|
|
4023
4020
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
4024
4021
|
children: [
|
|
4025
4022
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
4026
|
-
/* @__PURE__ */ s(
|
|
4023
|
+
/* @__PURE__ */ s(Oe.Provider, { value: o, children: /* @__PURE__ */ s(Ft, { Input: Xt }) })
|
|
4027
4024
|
]
|
|
4028
4025
|
}
|
|
4029
4026
|
),
|
|
4030
4027
|
n == null ? void 0 : n()
|
|
4031
4028
|
] });
|
|
4032
|
-
},
|
|
4029
|
+
}, Ei = [
|
|
4033
4030
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
4034
4031
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
4035
|
-
],
|
|
4032
|
+
], Ii = {
|
|
4036
4033
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
4037
4034
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
4038
|
-
},
|
|
4035
|
+
}, Ti = [
|
|
4039
4036
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
4040
|
-
],
|
|
4037
|
+
], Mi = ["SYSTEM_AGE_SAFETY_BLOCKED"], Ai = {
|
|
4041
4038
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
4042
|
-
}, Xe = "age safety guidelines.",
|
|
4039
|
+
}, Xe = "age safety guidelines.", Ri = "https://linktr.ee/s/about/contact", Zt = (e) => Ei.includes(e), Li = (e) => Ti.includes(e), Di = (e) => Mi.includes(
|
|
4043
4040
|
e
|
|
4044
|
-
),
|
|
4041
|
+
), Pi = (e) => {
|
|
4045
4042
|
var t;
|
|
4046
|
-
return
|
|
4047
|
-
},
|
|
4043
|
+
return Di((t = e.metadata) == null ? void 0 : t.custom_type);
|
|
4044
|
+
}, zi = (e) => {
|
|
4048
4045
|
var a;
|
|
4049
4046
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
4050
4047
|
if (Zt(t))
|
|
@@ -4052,7 +4049,7 @@ const yi = ({
|
|
|
4052
4049
|
kind: "dm-agent",
|
|
4053
4050
|
type: t
|
|
4054
4051
|
};
|
|
4055
|
-
if (
|
|
4052
|
+
if (Li(t))
|
|
4056
4053
|
return {
|
|
4057
4054
|
kind: "age-safety",
|
|
4058
4055
|
type: t
|
|
@@ -4063,7 +4060,7 @@ const yi = ({
|
|
|
4063
4060
|
kind: "dm-agent",
|
|
4064
4061
|
type: n
|
|
4065
4062
|
};
|
|
4066
|
-
},
|
|
4063
|
+
}, Oi = (e) => {
|
|
4067
4064
|
const t = e.indexOf(Xe);
|
|
4068
4065
|
if (t === -1)
|
|
4069
4066
|
return e;
|
|
@@ -4073,7 +4070,7 @@ const yi = ({
|
|
|
4073
4070
|
/* @__PURE__ */ s(
|
|
4074
4071
|
"a",
|
|
4075
4072
|
{
|
|
4076
|
-
href:
|
|
4073
|
+
href: Ri,
|
|
4077
4074
|
target: "_blank",
|
|
4078
4075
|
rel: "noopener noreferrer",
|
|
4079
4076
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -4082,13 +4079,13 @@ const yi = ({
|
|
|
4082
4079
|
),
|
|
4083
4080
|
e.slice(n)
|
|
4084
4081
|
] });
|
|
4085
|
-
},
|
|
4082
|
+
}, Fi = (e) => {
|
|
4086
4083
|
var a, r;
|
|
4087
|
-
const t = !
|
|
4084
|
+
const t = !Pi(e.message), n = zi(
|
|
4088
4085
|
e.message
|
|
4089
4086
|
);
|
|
4090
4087
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
4091
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
4088
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ii[n.type];
|
|
4092
4089
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
4093
4090
|
/* @__PURE__ */ h(
|
|
4094
4091
|
"div",
|
|
@@ -4114,7 +4111,7 @@ const yi = ({
|
|
|
4114
4111
|
] });
|
|
4115
4112
|
}
|
|
4116
4113
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
4117
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
4114
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ai[n.type];
|
|
4118
4115
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
4119
4116
|
/* @__PURE__ */ h(
|
|
4120
4117
|
"div",
|
|
@@ -4133,7 +4130,7 @@ const yi = ({
|
|
|
4133
4130
|
"data-testid": "age-safety-system-message-icon"
|
|
4134
4131
|
}
|
|
4135
4132
|
),
|
|
4136
|
-
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
4133
|
+
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Oi(i) }) })
|
|
4137
4134
|
]
|
|
4138
4135
|
}
|
|
4139
4136
|
),
|
|
@@ -4158,15 +4155,15 @@ const yi = ({
|
|
|
4158
4155
|
begin: `${120 * t}ms`,
|
|
4159
4156
|
repeatCount: "indefinite"
|
|
4160
4157
|
}
|
|
4161
|
-
) }),
|
|
4158
|
+
) }), Bi = /* @__PURE__ */ new Set([
|
|
4162
4159
|
Ge.Thinking,
|
|
4163
4160
|
Ge.Generating,
|
|
4164
4161
|
Ge.ExternalSources
|
|
4165
|
-
]),
|
|
4162
|
+
]), $i = ({ threadList: e }) => {
|
|
4166
4163
|
var v, w;
|
|
4167
4164
|
const { channel: t, channelConfig: n, thread: a } = ue(), { client: r } = ke(), { typing: i = {} } = _n(), { aiState: l } = Nn(t), o = ye(Ds);
|
|
4168
|
-
if (!e && o &&
|
|
4169
|
-
const p =
|
|
4165
|
+
if (!e && o && Bi.has(l)) {
|
|
4166
|
+
const p = Ui(t, (v = r.user) == null ? void 0 : v.id);
|
|
4170
4167
|
return /* @__PURE__ */ s(
|
|
4171
4168
|
Jt,
|
|
4172
4169
|
{
|
|
@@ -4246,7 +4243,7 @@ const yi = ({
|
|
|
4246
4243
|
] })
|
|
4247
4244
|
}
|
|
4248
4245
|
);
|
|
4249
|
-
function
|
|
4246
|
+
function Ui(e, t) {
|
|
4250
4247
|
var a;
|
|
4251
4248
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4252
4249
|
for (const r of Object.values(n)) {
|
|
@@ -4255,7 +4252,7 @@ function Vi(e, t) {
|
|
|
4255
4252
|
return i;
|
|
4256
4253
|
}
|
|
4257
4254
|
}
|
|
4258
|
-
const
|
|
4255
|
+
const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
4259
4256
|
"div",
|
|
4260
4257
|
{
|
|
4261
4258
|
className: y("flex items-center justify-center h-full", e),
|
|
@@ -4299,11 +4296,11 @@ const Gi = () => null, Hi = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
4299
4296
|
]
|
|
4300
4297
|
}
|
|
4301
4298
|
), Fe = j.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
4302
|
-
/* @__PURE__ */ s(
|
|
4299
|
+
/* @__PURE__ */ s(Vi, { className: "w-6 h-6" }),
|
|
4303
4300
|
/* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4304
4301
|
] }) }));
|
|
4305
4302
|
Fe.displayName = "LoadingState";
|
|
4306
|
-
const
|
|
4303
|
+
const Gi = ({
|
|
4307
4304
|
onBack: e,
|
|
4308
4305
|
showBackButton: t,
|
|
4309
4306
|
renderMessageInputActions: n,
|
|
@@ -4327,10 +4324,10 @@ const Yi = ({
|
|
|
4327
4324
|
renderMessage: k,
|
|
4328
4325
|
viewerLanguage: R,
|
|
4329
4326
|
showChannelInfo: A = !0,
|
|
4330
|
-
onParticipantNameClick:
|
|
4327
|
+
onParticipantNameClick: O,
|
|
4331
4328
|
composerInput: B
|
|
4332
4329
|
}) => {
|
|
4333
|
-
const { channel:
|
|
4330
|
+
const { channel: z } = ue(), L = z.state.messages.some(
|
|
4334
4331
|
(M) => M.type !== "deleted"
|
|
4335
4332
|
), C = b ? /* @__PURE__ */ s(j.Fragment, { children: b() }, "lt-channel-banner") : null, I = /* @__PURE__ */ s(
|
|
4336
4333
|
fa,
|
|
@@ -4350,7 +4347,7 @@ const Yi = ({
|
|
|
4350
4347
|
onReportParticipantClick: g,
|
|
4351
4348
|
customChannelActions: x,
|
|
4352
4349
|
renderChannelActions: S,
|
|
4353
|
-
onParticipantNameClick:
|
|
4350
|
+
onParticipantNameClick: O
|
|
4354
4351
|
}
|
|
4355
4352
|
), N = W(
|
|
4356
4353
|
(M) => {
|
|
@@ -4404,12 +4401,12 @@ const Yi = ({
|
|
|
4404
4401
|
Kt,
|
|
4405
4402
|
{
|
|
4406
4403
|
...n && {
|
|
4407
|
-
renderActions: () => n == null ? void 0 : n(
|
|
4404
|
+
renderActions: () => n == null ? void 0 : n(z)
|
|
4408
4405
|
},
|
|
4409
4406
|
...r && {
|
|
4410
|
-
renderHeader: () => r(
|
|
4407
|
+
renderHeader: () => r(z)
|
|
4411
4408
|
},
|
|
4412
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4409
|
+
renderFooter: () => a == null ? void 0 : a(z),
|
|
4413
4410
|
disabled: c,
|
|
4414
4411
|
disabledReason: v,
|
|
4415
4412
|
composerInput: B
|
|
@@ -4441,14 +4438,14 @@ const Yi = ({
|
|
|
4441
4438
|
},
|
|
4442
4439
|
"lt-channel-message-list"
|
|
4443
4440
|
),
|
|
4444
|
-
r ? /* @__PURE__ */ s(j.Fragment, { children: r(
|
|
4441
|
+
r ? /* @__PURE__ */ s(j.Fragment, { children: r(z) }, "lt-channel-conversation-footer") : null,
|
|
4445
4442
|
/* @__PURE__ */ s(
|
|
4446
4443
|
Kt,
|
|
4447
4444
|
{
|
|
4448
4445
|
...n && {
|
|
4449
|
-
renderActions: () => n == null ? void 0 : n(
|
|
4446
|
+
renderActions: () => n == null ? void 0 : n(z)
|
|
4450
4447
|
},
|
|
4451
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
4448
|
+
renderFooter: () => a == null ? void 0 : a(z),
|
|
4452
4449
|
disabled: c,
|
|
4453
4450
|
disabledReason: v,
|
|
4454
4451
|
composerInput: B
|
|
@@ -4469,7 +4466,7 @@ const Yi = ({
|
|
|
4469
4466
|
onLeaveConversation: l,
|
|
4470
4467
|
onBlockParticipant: o,
|
|
4471
4468
|
className: d,
|
|
4472
|
-
CustomChannelEmptyState: u =
|
|
4469
|
+
CustomChannelEmptyState: u = ji,
|
|
4473
4470
|
showDeleteConversation: g = !0,
|
|
4474
4471
|
onDeleteConversationClick: m,
|
|
4475
4472
|
onBlockParticipantClick: f,
|
|
@@ -4483,9 +4480,9 @@ const Yi = ({
|
|
|
4483
4480
|
onMessageSent: k,
|
|
4484
4481
|
showStarButton: R = !1,
|
|
4485
4482
|
chatbotVotingEnabled: A = !1,
|
|
4486
|
-
renderChannelBanner:
|
|
4483
|
+
renderChannelBanner: O,
|
|
4487
4484
|
customChannelActions: B,
|
|
4488
|
-
renderChannelActions:
|
|
4485
|
+
renderChannelActions: z,
|
|
4489
4486
|
renderMessage: L,
|
|
4490
4487
|
onMessageLinkClick: C,
|
|
4491
4488
|
sendButton: I,
|
|
@@ -4538,16 +4535,16 @@ const Yi = ({
|
|
|
4538
4535
|
yn,
|
|
4539
4536
|
{
|
|
4540
4537
|
channel: e,
|
|
4541
|
-
MessageSystem:
|
|
4538
|
+
MessageSystem: Fi,
|
|
4542
4539
|
EmptyStateIndicator: u,
|
|
4543
4540
|
LoadingIndicator: Fe,
|
|
4544
4541
|
DateSeparator: ga,
|
|
4545
|
-
TypingIndicator:
|
|
4542
|
+
TypingIndicator: $i,
|
|
4546
4543
|
doSendMessageRequest: q,
|
|
4547
4544
|
...I ? { SendButton: I } : {},
|
|
4548
4545
|
...N ? { AttachmentPreviewList: N } : {},
|
|
4549
4546
|
children: /* @__PURE__ */ s(
|
|
4550
|
-
|
|
4547
|
+
Gi,
|
|
4551
4548
|
{
|
|
4552
4549
|
onBack: t,
|
|
4553
4550
|
showBackButton: n,
|
|
@@ -4567,9 +4564,9 @@ const Yi = ({
|
|
|
4567
4564
|
composerDisabledReason: b,
|
|
4568
4565
|
showStarButton: R,
|
|
4569
4566
|
chatbotVotingEnabled: A,
|
|
4570
|
-
renderChannelBanner:
|
|
4567
|
+
renderChannelBanner: O,
|
|
4571
4568
|
customChannelActions: B,
|
|
4572
|
-
renderChannelActions:
|
|
4569
|
+
renderChannelActions: z,
|
|
4573
4570
|
renderMessage: L,
|
|
4574
4571
|
viewerLanguage: M,
|
|
4575
4572
|
showChannelInfo: E,
|
|
@@ -4599,7 +4596,7 @@ const we = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4599
4596
|
)
|
|
4600
4597
|
] }) }));
|
|
4601
4598
|
we.displayName = "ErrorState";
|
|
4602
|
-
const
|
|
4599
|
+
const bo = ({
|
|
4603
4600
|
capabilities: e = {},
|
|
4604
4601
|
renderMessageInputActions: t,
|
|
4605
4602
|
renderConversationFooter: n,
|
|
@@ -4625,9 +4622,9 @@ const xo = ({
|
|
|
4625
4622
|
}) => {
|
|
4626
4623
|
const {
|
|
4627
4624
|
client: A,
|
|
4628
|
-
isConnected:
|
|
4625
|
+
isConnected: O,
|
|
4629
4626
|
isLoading: B,
|
|
4630
|
-
error:
|
|
4627
|
+
error: z,
|
|
4631
4628
|
refreshConnection: L,
|
|
4632
4629
|
service: C,
|
|
4633
4630
|
debug: I
|
|
@@ -4639,7 +4636,7 @@ const xo = ({
|
|
|
4639
4636
|
Y(() => {
|
|
4640
4637
|
T.current = N;
|
|
4641
4638
|
}, [N]), Y(() => {
|
|
4642
|
-
if (!A || !
|
|
4639
|
+
if (!A || !O) return;
|
|
4643
4640
|
const X = A.userID;
|
|
4644
4641
|
if (!X) return;
|
|
4645
4642
|
const U = `${X}::${i}`;
|
|
@@ -4701,14 +4698,14 @@ const xo = ({
|
|
|
4701
4698
|
), J(), T.current || D("Failed to load conversation");
|
|
4702
4699
|
}
|
|
4703
4700
|
})();
|
|
4704
|
-
}, [i, A,
|
|
4701
|
+
}, [i, A, O, C, I]);
|
|
4705
4702
|
const $ = G(r);
|
|
4706
4703
|
$.current = r;
|
|
4707
4704
|
const te = W(() => {
|
|
4708
4705
|
var X;
|
|
4709
4706
|
M(null), q(!0), (X = $.current) == null || X.call($);
|
|
4710
4707
|
}, []);
|
|
4711
|
-
return B ? /* @__PURE__ */ s(Fe, {}) :
|
|
4708
|
+
return B ? /* @__PURE__ */ s(Fe, {}) : z ? /* @__PURE__ */ s(we, { message: z, onBack: L }) : !O || !A ? /* @__PURE__ */ s(
|
|
4712
4709
|
we,
|
|
4713
4710
|
{
|
|
4714
4711
|
message: "Not connected to messaging service",
|
|
@@ -4742,13 +4739,13 @@ const xo = ({
|
|
|
4742
4739
|
N.id
|
|
4743
4740
|
) }) }) : /* @__PURE__ */ s(Fe, {});
|
|
4744
4741
|
};
|
|
4745
|
-
function
|
|
4742
|
+
function Hi(e) {
|
|
4746
4743
|
const t = e.state.pending_messages;
|
|
4747
4744
|
if (t != null && t.length)
|
|
4748
4745
|
for (const n of t)
|
|
4749
4746
|
e.state.addMessageSorted(n.message);
|
|
4750
4747
|
}
|
|
4751
|
-
const
|
|
4748
|
+
const zs = j.createContext({
|
|
4752
4749
|
selectedChannel: void 0,
|
|
4753
4750
|
onChannelSelect: () => {
|
|
4754
4751
|
},
|
|
@@ -4756,18 +4753,18 @@ const Os = j.createContext({
|
|
|
4756
4753
|
renderMessagePreview: void 0,
|
|
4757
4754
|
channelPreview: void 0,
|
|
4758
4755
|
viewerLanguage: void 0
|
|
4759
|
-
}),
|
|
4756
|
+
}), Yi = zs.Provider, qi = () => j.useContext(zs), Wi = (e, t) => {
|
|
4760
4757
|
const n = new Date(
|
|
4761
4758
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4762
4759
|
), r = new Date(
|
|
4763
4760
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4764
4761
|
).getTime() - n.getTime();
|
|
4765
4762
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4766
|
-
},
|
|
4763
|
+
}, Xi = (e) => {
|
|
4767
4764
|
const t = /* @__PURE__ */ new Date();
|
|
4768
4765
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4769
4766
|
return "Just now";
|
|
4770
|
-
const a =
|
|
4767
|
+
const a = Wi(e, t);
|
|
4771
4768
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4772
4769
|
hour: "numeric",
|
|
4773
4770
|
minute: "2-digit",
|
|
@@ -4777,9 +4774,9 @@ const Os = j.createContext({
|
|
|
4777
4774
|
month: "short",
|
|
4778
4775
|
year: "2-digit"
|
|
4779
4776
|
});
|
|
4780
|
-
},
|
|
4777
|
+
}, Os = j.memo(
|
|
4781
4778
|
(e) => {
|
|
4782
|
-
var B,
|
|
4779
|
+
var B, z, L;
|
|
4783
4780
|
const { channel: t, unread: n } = e, {
|
|
4784
4781
|
selectedChannel: a,
|
|
4785
4782
|
onChannelSelect: r,
|
|
@@ -4787,7 +4784,7 @@ const Os = j.createContext({
|
|
|
4787
4784
|
channelPreview: l,
|
|
4788
4785
|
renderMessagePreview: o,
|
|
4789
4786
|
viewerLanguage: d
|
|
4790
|
-
} =
|
|
4787
|
+
} = qi(), { client: u } = ke(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = os(t);
|
|
4791
4788
|
if (l)
|
|
4792
4789
|
return /* @__PURE__ */ s(
|
|
4793
4790
|
l,
|
|
@@ -4808,7 +4805,7 @@ const Os = j.createContext({
|
|
|
4808
4805
|
(B = t == null ? void 0 : t.state) == null ? void 0 : B.members,
|
|
4809
4806
|
u == null ? void 0 : u.userID,
|
|
4810
4807
|
t == null ? void 0 : t.type
|
|
4811
|
-
), w = cs(v == null ? void 0 : v.user), p = (
|
|
4808
|
+
), w = cs(v == null ? void 0 : v.user), p = (z = v == null ? void 0 : v.user) == null ? void 0 : z.image, b = (() => {
|
|
4812
4809
|
var I;
|
|
4813
4810
|
const C = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
|
|
4814
4811
|
if (C != null && C.length) {
|
|
@@ -4834,12 +4831,12 @@ const Os = j.createContext({
|
|
|
4834
4831
|
if (C) return C;
|
|
4835
4832
|
const M = (E = b == null ? void 0 : b.attachments) == null ? void 0 : E[0];
|
|
4836
4833
|
return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4837
|
-
})(), k = b != null && b.created_at ?
|
|
4834
|
+
})(), k = b != null && b.created_at ? Xi(new Date(b.created_at)) : "", R = b ? De(b) : !1, A = o ? o(b, S) : `${R ? "✨ " : ""}${S}`, O = n ?? 0;
|
|
4838
4835
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4839
4836
|
channelId: t == null ? void 0 : t.id,
|
|
4840
4837
|
isSelected: g,
|
|
4841
4838
|
participantName: w,
|
|
4842
|
-
unreadCount:
|
|
4839
|
+
unreadCount: O,
|
|
4843
4840
|
hasTimestamp: !!k
|
|
4844
4841
|
}), /* @__PURE__ */ s(
|
|
4845
4842
|
"div",
|
|
@@ -4885,7 +4882,7 @@ const Os = j.createContext({
|
|
|
4885
4882
|
] }),
|
|
4886
4883
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
4887
4884
|
/* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
|
|
4888
|
-
|
|
4885
|
+
O > 0 && /* @__PURE__ */ s("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: O > 99 ? "99+" : O })
|
|
4889
4886
|
] })
|
|
4890
4887
|
] })
|
|
4891
4888
|
] })
|
|
@@ -4893,15 +4890,15 @@ const Os = j.createContext({
|
|
|
4893
4890
|
);
|
|
4894
4891
|
}
|
|
4895
4892
|
);
|
|
4896
|
-
|
|
4897
|
-
const
|
|
4893
|
+
Os.displayName = "CustomChannelPreview";
|
|
4894
|
+
const Ki = { last_message_at: -1 }, Zi = j.memo(
|
|
4898
4895
|
({
|
|
4899
4896
|
onChannelSelect: e,
|
|
4900
4897
|
selectedChannel: t,
|
|
4901
4898
|
filters: n,
|
|
4902
4899
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
4903
4900
|
channelRenderFilterFn: r,
|
|
4904
|
-
sort: i =
|
|
4901
|
+
sort: i = Ki,
|
|
4905
4902
|
className: l,
|
|
4906
4903
|
customEmptyStateIndicator: o,
|
|
4907
4904
|
channelListPaginator: d = En,
|
|
@@ -4919,8 +4916,8 @@ const Ji = { last_message_at: -1 }, Qi = j.memo(
|
|
|
4919
4916
|
x.current++;
|
|
4920
4917
|
const { debug: S = !1 } = nt(), k = j.useCallback(
|
|
4921
4918
|
(A) => {
|
|
4922
|
-
for (const
|
|
4923
|
-
|
|
4919
|
+
for (const O of A)
|
|
4920
|
+
Hi(O);
|
|
4924
4921
|
return r ? r(A) : A;
|
|
4925
4922
|
},
|
|
4926
4923
|
[r]
|
|
@@ -4955,7 +4952,7 @@ const Ji = { last_message_at: -1 }, Qi = j.memo(
|
|
|
4955
4952
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
4956
4953
|
l
|
|
4957
4954
|
),
|
|
4958
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(
|
|
4955
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Yi, { value: R, children: /* @__PURE__ */ s(
|
|
4959
4956
|
Sn,
|
|
4960
4957
|
{
|
|
4961
4958
|
filters: n,
|
|
@@ -4970,7 +4967,7 @@ const Ji = { last_message_at: -1 }, Qi = j.memo(
|
|
|
4970
4967
|
onAddedToChannel: p,
|
|
4971
4968
|
onChannelUpdated: b,
|
|
4972
4969
|
Paginator: d,
|
|
4973
|
-
Preview:
|
|
4970
|
+
Preview: Os,
|
|
4974
4971
|
EmptyStateIndicator: o
|
|
4975
4972
|
},
|
|
4976
4973
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -4979,11 +4976,11 @@ const Ji = { last_message_at: -1 }, Qi = j.memo(
|
|
|
4979
4976
|
);
|
|
4980
4977
|
}
|
|
4981
4978
|
);
|
|
4982
|
-
|
|
4983
|
-
const Qt = `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%`,
|
|
4979
|
+
Zi.displayName = "ChannelList";
|
|
4980
|
+
const Qt = `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%`, Ji = {
|
|
4984
4981
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
4985
4982
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
4986
|
-
},
|
|
4983
|
+
}, Qi = ({ variant: e }) => /* @__PURE__ */ s(
|
|
4987
4984
|
"span",
|
|
4988
4985
|
{
|
|
4989
4986
|
"aria-hidden": "true",
|
|
@@ -4993,12 +4990,12 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
4993
4990
|
insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
|
|
4994
4991
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
4995
4992
|
transformOrigin: "center",
|
|
4996
|
-
backgroundColor:
|
|
4993
|
+
backgroundColor: Ji[e],
|
|
4997
4994
|
WebkitMask: Qt,
|
|
4998
4995
|
mask: Qt
|
|
4999
4996
|
}
|
|
5000
4997
|
}
|
|
5001
|
-
),
|
|
4998
|
+
), eo = {
|
|
5002
4999
|
sent: {
|
|
5003
5000
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
5004
5001
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -5023,17 +5020,17 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5023
5020
|
r
|
|
5024
5021
|
),
|
|
5025
5022
|
style: {
|
|
5026
|
-
...
|
|
5023
|
+
...eo[e],
|
|
5027
5024
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
5028
5025
|
isolation: "isolate"
|
|
5029
5026
|
},
|
|
5030
5027
|
children: [
|
|
5031
5028
|
a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
|
|
5032
5029
|
/* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
|
|
5033
|
-
n && /* @__PURE__ */ s(
|
|
5030
|
+
n && /* @__PURE__ */ s(Qi, { variant: e })
|
|
5034
5031
|
]
|
|
5035
5032
|
}
|
|
5036
|
-
),
|
|
5033
|
+
), to = ({
|
|
5037
5034
|
text: e,
|
|
5038
5035
|
tail: t,
|
|
5039
5036
|
header: n,
|
|
@@ -5047,10 +5044,10 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5047
5044
|
header: n,
|
|
5048
5045
|
className: a
|
|
5049
5046
|
}
|
|
5050
|
-
),
|
|
5051
|
-
Sent:
|
|
5052
|
-
Received:
|
|
5053
|
-
},
|
|
5047
|
+
), so = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Fs, { variant: "sent", text: e, tail: t, className: n }), vo = {
|
|
5048
|
+
Sent: so,
|
|
5049
|
+
Received: to
|
|
5050
|
+
}, no = ({
|
|
5054
5051
|
question: e,
|
|
5055
5052
|
onClick: t,
|
|
5056
5053
|
loading: n = !1,
|
|
@@ -5072,7 +5069,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5072
5069
|
),
|
|
5073
5070
|
children: e
|
|
5074
5071
|
}
|
|
5075
|
-
),
|
|
5072
|
+
), xo = ({
|
|
5076
5073
|
faqs: e,
|
|
5077
5074
|
onFaqClick: t,
|
|
5078
5075
|
loadingFaqId: n,
|
|
@@ -5101,7 +5098,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5101
5098
|
children: [
|
|
5102
5099
|
a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
5103
5100
|
o.map((d) => /* @__PURE__ */ s(
|
|
5104
|
-
|
|
5101
|
+
no,
|
|
5105
5102
|
{
|
|
5106
5103
|
question: d.question,
|
|
5107
5104
|
onClick: () => t(d.id),
|
|
@@ -5117,32 +5114,32 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5117
5114
|
export {
|
|
5118
5115
|
hs as A,
|
|
5119
5116
|
ot as B,
|
|
5120
|
-
|
|
5117
|
+
ji as C,
|
|
5121
5118
|
cs as D,
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5119
|
+
po as E,
|
|
5120
|
+
xo as F,
|
|
5121
|
+
zr as G,
|
|
5125
5122
|
ba as H,
|
|
5126
5123
|
ta as I,
|
|
5127
5124
|
Ht as L,
|
|
5128
|
-
|
|
5125
|
+
fo as M,
|
|
5129
5126
|
ve as a,
|
|
5130
5127
|
be as b,
|
|
5131
|
-
|
|
5128
|
+
Zi as c,
|
|
5132
5129
|
Ps as d,
|
|
5133
|
-
|
|
5134
|
-
|
|
5130
|
+
go as e,
|
|
5131
|
+
no as f,
|
|
5135
5132
|
oe as g,
|
|
5136
5133
|
Re as h,
|
|
5137
5134
|
xe as i,
|
|
5138
|
-
|
|
5135
|
+
vo as j,
|
|
5139
5136
|
Yr as k,
|
|
5140
|
-
|
|
5141
|
-
|
|
5137
|
+
ho as l,
|
|
5138
|
+
bo as m,
|
|
5142
5139
|
er as n,
|
|
5143
5140
|
de as o,
|
|
5144
5141
|
Za as p,
|
|
5145
|
-
|
|
5142
|
+
Xi as q,
|
|
5146
5143
|
ge as r,
|
|
5147
5144
|
Qa as s,
|
|
5148
5145
|
us as t,
|
|
@@ -5153,4 +5150,4 @@ export {
|
|
|
5153
5150
|
ls as y,
|
|
5154
5151
|
it as z
|
|
5155
5152
|
};
|
|
5156
|
-
//# sourceMappingURL=index-
|
|
5153
|
+
//# sourceMappingURL=index-BdRJRNr3.js.map
|