@linktr.ee/messaging-react 3.9.1 → 3.9.2-rc-1783582192
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-D3QNullZ.js → Card-B83PIVO4.js} +2 -2
- package/dist/{Card-D3QNullZ.js.map → Card-B83PIVO4.js.map} +1 -1
- package/dist/{Card-BMau-mI5.cjs → Card-BcTjQXjg.cjs} +2 -2
- package/dist/{Card-BMau-mI5.cjs.map → Card-BcTjQXjg.cjs.map} +1 -1
- package/dist/{Card-MJ0x2roP.cjs → Card-CVxFApFQ.cjs} +2 -2
- package/dist/{Card-MJ0x2roP.cjs.map → Card-CVxFApFQ.cjs.map} +1 -1
- package/dist/{Card-BLLADEC_.js → Card-Cblg_OP2.js} +3 -3
- package/dist/{Card-BLLADEC_.js.map → Card-Cblg_OP2.js.map} +1 -1
- package/dist/{Card-C3rbCPM7.cjs → Card-DyFTYx54.cjs} +2 -2
- package/dist/{Card-C3rbCPM7.cjs.map → Card-DyFTYx54.cjs.map} +1 -1
- package/dist/{Card-Dau41drB.js → Card-ckN-pJAf.js} +2 -2
- package/dist/{Card-Dau41drB.js.map → Card-ckN-pJAf.js.map} +1 -1
- package/dist/{LockedThumbnail-a03GYGJz.cjs → LockedThumbnail-C-MNksZm.cjs} +2 -2
- package/dist/{LockedThumbnail-a03GYGJz.cjs.map → LockedThumbnail-C-MNksZm.cjs.map} +1 -1
- package/dist/{LockedThumbnail-Bq54AT8J.js → LockedThumbnail-CZ8hj3VY.js} +2 -2
- package/dist/{LockedThumbnail-Bq54AT8J.js.map → LockedThumbnail-CZ8hj3VY.js.map} +1 -1
- package/dist/index-C2hIrXzf.cjs +2 -0
- package/dist/index-C2hIrXzf.cjs.map +1 -0
- package/dist/{index-CBm9au-T.js → index-CPbf44kW.js} +74 -74
- package/dist/index-CPbf44kW.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +51 -11
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +39 -25
- package/dist/index-CBm9au-T.js.map +0 -1
- package/dist/index-CWopIWxB.cjs +0 -2
- package/dist/index-CWopIWxB.cjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as s, jsxs as u, Fragment as te } from "react/jsx-runtime";
|
|
2
|
-
import V, { createContext as lt, useContext as Ie, useCallback as Z, useState as U, useRef as G, useEffect as J, useId as Gs, useMemo as
|
|
2
|
+
import V, { createContext as lt, useContext as Ie, useCallback as Z, useState as U, useRef as G, useEffect as J, useId as Gs, useMemo as ae, Suspense as ot } from "react";
|
|
3
3
|
import { StreamChatService as Hs } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as Ys, LinkPreviewsManager as Wt } from "stream-chat";
|
|
5
|
-
import { Chat as qs, useChannelStateContext as le, useChatContext as
|
|
5
|
+
import { Chat as qs, useChannelStateContext as le, useChatContext as me, DateSeparator as Ws, MessageStatus as Xs, useMessageContext as _e, MessageErrorIcon as et, MessageText as tt, areMessageUIPropsEqual as Ks, useMessageReminder as Js, useComponentContext as is, Attachment as Zs, EditMessageModal as Qs, MessageBlocked as en, MessageBouncePrompt as tn, MessageDeleted as sn, MessageIsThreadReplyInChannelButtonIndicator as nn, MessageRepliesCountButton as an, ReminderNotification as rn, StreamedMessageText as ln, messageHasAttachments as on, messageHasReactions as cn, isDateSeparatorMessage as dn, isMessageBlocked as un, isMessageBounced as mn, MessageBounceModal as hn, Poll as fn, useMessageComposer as gn, useStateStore as pn, MessageInput as bn, useMessageInputContext as vn, useMessageComposerHasSendableData as xn, AttachmentPreviewList as wn, QuotedMessagePreview as _n, TextareaComposer as Nn, MessageTimestamp as Ye, AIStates as qe, useTypingContext as yn, useAIState as kn, Channel as Cn, WithComponents as Sn, Window as En, MessageList as In, ChannelList as Tn, InfiniteScroll as An } from "stream-chat-react";
|
|
6
6
|
import { StarIcon as Ee, DotsThreeIcon as Mn, SpinnerGapIcon as ze, SignOutIcon as Rn, ProhibitInsetIcon as Xt, FlagIcon as ls, ArrowLeftIcon as st, CurrencyDollarIcon as Dn, CaretRightIcon as ve, SparkleIcon as xe, FileIcon as os, ImageIcon as Ln, SpeakerHighIcon as zn, VideoCameraIcon as cs, FileMdIcon as Pn, FileTextIcon as Fn, FileZipIcon as On, FilePptIcon as $n, FileCsvIcon as Bn, FileXlsIcon as Un, FileDocIcon as jn, FilePdfIcon as Vn, CircleNotchIcon as Ce, PlayIcon as nt, PauseIcon as Gn, LinkIcon as Hn, DownloadSimpleIcon as Se, XIcon as Ue, CaretLeftIcon as Yn, GiftIcon as qn, ThumbsUpIcon as Wn, ThumbsDownIcon as Xn, ChecksIcon as Kn, PencilSimpleIcon as Jn, TrashSimpleIcon as Zn, ArrowUpIcon as Qn, ProhibitIcon as ea } from "@phosphor-icons/react";
|
|
7
7
|
import k from "classnames";
|
|
8
8
|
import { MessageActions as ta, DefaultDropdownActionButton as ds } from "stream-chat-react/experimental";
|
|
@@ -321,7 +321,7 @@ function oa(e) {
|
|
|
321
321
|
function ca(e) {
|
|
322
322
|
return ms(e).bgColor;
|
|
323
323
|
}
|
|
324
|
-
const
|
|
324
|
+
const se = ({
|
|
325
325
|
id: e,
|
|
326
326
|
image: t,
|
|
327
327
|
size: n = 40,
|
|
@@ -644,7 +644,7 @@ const ne = ({
|
|
|
644
644
|
onParticipantNameClick: v
|
|
645
645
|
}) => {
|
|
646
646
|
var F, L, y;
|
|
647
|
-
const { channel: f } = le(), { client: N } =
|
|
647
|
+
const { channel: f } = le(), { client: N } = me(), w = V.useMemo(
|
|
648
648
|
() => {
|
|
649
649
|
var E;
|
|
650
650
|
return je(
|
|
@@ -695,7 +695,7 @@ const ne = ({
|
|
|
695
695
|
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",
|
|
696
696
|
children: [
|
|
697
697
|
/* @__PURE__ */ s(
|
|
698
|
-
|
|
698
|
+
se,
|
|
699
699
|
{
|
|
700
700
|
id: ((y = w == null ? void 0 : w.user) == null ? void 0 : y.id) || f.id || "unknown",
|
|
701
701
|
name: C,
|
|
@@ -791,7 +791,7 @@ function va(e) {
|
|
|
791
791
|
return e != null && e.length ? e.some((t) => t.type === it) ? "down" : e.some((t) => t.type === rt) ? "up" : null : null;
|
|
792
792
|
}
|
|
793
793
|
function xa(e) {
|
|
794
|
-
const { channel: t } = le(), { client: n } =
|
|
794
|
+
const { channel: t } = le(), { client: n } = me("useMessageVote"), a = ae(
|
|
795
795
|
() => va(e.own_reactions),
|
|
796
796
|
[e.own_reactions]
|
|
797
797
|
), r = Z(async () => {
|
|
@@ -828,7 +828,7 @@ function hs({
|
|
|
828
828
|
const n = e == null ? void 0 : e.text, a = wa(t);
|
|
829
829
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
830
830
|
}
|
|
831
|
-
const _a = V.lazy(() => import("./Card-
|
|
831
|
+
const _a = V.lazy(() => import("./Card-B83PIVO4.js")), Na = V.lazy(() => import("./Card-ckN-pJAf.js")), ya = V.lazy(() => import("./Card-Cblg_OP2.js")), mt = () => /* @__PURE__ */ s(
|
|
832
832
|
"div",
|
|
833
833
|
{
|
|
834
834
|
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)]",
|
|
@@ -844,7 +844,7 @@ const _a = V.lazy(() => import("./Card-D3QNullZ.js")), Na = V.lazy(() => import(
|
|
|
844
844
|
[/plain|rtf/, "text"],
|
|
845
845
|
[/markdown/, "markdown"]
|
|
846
846
|
];
|
|
847
|
-
function
|
|
847
|
+
function oe(e) {
|
|
848
848
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
849
849
|
}
|
|
850
850
|
function ps(e) {
|
|
@@ -870,7 +870,7 @@ const Ia = {
|
|
|
870
870
|
generic: os
|
|
871
871
|
};
|
|
872
872
|
function Aa(e) {
|
|
873
|
-
const t =
|
|
873
|
+
const t = oe(e);
|
|
874
874
|
return t !== "document" ? Ia[t] : Ta[ps(e)];
|
|
875
875
|
}
|
|
876
876
|
function we(e, t) {
|
|
@@ -891,7 +891,7 @@ const Ma = (e) => {
|
|
|
891
891
|
muted: d = !1,
|
|
892
892
|
onContainerClick: m
|
|
893
893
|
}) => {
|
|
894
|
-
const p =
|
|
894
|
+
const p = oe(t), h = G(null), g = G(null), c = G(null), b = G(r), [x, v] = U(a), [f, N] = U(0), [w, C] = U(!1), [R, S] = U(!1), [D, $] = U(!1), [F, L] = U(!1), [y, E] = U(!0), [I, M] = U(null), T = Z(() => {
|
|
895
895
|
$(!1), v(!0);
|
|
896
896
|
}, []), z = Z((_) => {
|
|
897
897
|
const A = g.current;
|
|
@@ -1136,7 +1136,7 @@ const Ma = (e) => {
|
|
|
1136
1136
|
mediaPlayerProps: i,
|
|
1137
1137
|
containedImage: o = !1
|
|
1138
1138
|
}) => {
|
|
1139
|
-
const l =
|
|
1139
|
+
const l = oe(e), [d, m] = U(!1);
|
|
1140
1140
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
|
|
1141
1141
|
Ra,
|
|
1142
1142
|
{
|
|
@@ -1420,7 +1420,7 @@ const _s = ({
|
|
|
1420
1420
|
fileSize: a,
|
|
1421
1421
|
thumbnailUrl: r
|
|
1422
1422
|
}) => {
|
|
1423
|
-
const i =
|
|
1423
|
+
const i = oe(t), o = a !== void 0 ? xs(a) : void 0;
|
|
1424
1424
|
return /* @__PURE__ */ s(
|
|
1425
1425
|
vs,
|
|
1426
1426
|
{
|
|
@@ -1449,7 +1449,7 @@ const _s = ({
|
|
|
1449
1449
|
const n = gt(e), a = pt(e);
|
|
1450
1450
|
return !n && !a ? null : /* @__PURE__ */ u("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: [
|
|
1451
1451
|
!t && e.user && /* @__PURE__ */ s(
|
|
1452
|
-
|
|
1452
|
+
se,
|
|
1453
1453
|
{
|
|
1454
1454
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1455
1455
|
id: e.user.id,
|
|
@@ -1670,7 +1670,7 @@ function ar(e, t) {
|
|
|
1670
1670
|
}
|
|
1671
1671
|
}
|
|
1672
1672
|
if (!e) return;
|
|
1673
|
-
if (
|
|
1673
|
+
if (oe(e) === "document") {
|
|
1674
1674
|
const r = ps(e), i = nr[r];
|
|
1675
1675
|
if (i) return i;
|
|
1676
1676
|
if (e === "application/octet-stream") return;
|
|
@@ -2101,7 +2101,7 @@ const cr = ({
|
|
|
2101
2101
|
length: t.length,
|
|
2102
2102
|
initialIndex: n,
|
|
2103
2103
|
open: e
|
|
2104
|
-
}), l = t[r], d =
|
|
2104
|
+
}), l = t[r], d = ae(
|
|
2105
2105
|
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "image"),
|
|
2106
2106
|
[l]
|
|
2107
2107
|
);
|
|
@@ -2338,10 +2338,10 @@ const cr = ({
|
|
|
2338
2338
|
length: t.length,
|
|
2339
2339
|
initialIndex: n,
|
|
2340
2340
|
open: e
|
|
2341
|
-
}), l = t[r], d =
|
|
2341
|
+
}), l = t[r], d = ae(
|
|
2342
2342
|
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "document"),
|
|
2343
2343
|
[l]
|
|
2344
|
-
), m =
|
|
2344
|
+
), m = ae(
|
|
2345
2345
|
() => l ? kr(l.src) : void 0,
|
|
2346
2346
|
[l]
|
|
2347
2347
|
);
|
|
@@ -2484,7 +2484,7 @@ const cr = ({
|
|
|
2484
2484
|
length: t.length,
|
|
2485
2485
|
initialIndex: n,
|
|
2486
2486
|
open: e
|
|
2487
|
-
}), l = t[r], d =
|
|
2487
|
+
}), l = t[r], d = ae(
|
|
2488
2488
|
() => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "video"),
|
|
2489
2489
|
[l]
|
|
2490
2490
|
);
|
|
@@ -2754,15 +2754,15 @@ const jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
|
2754
2754
|
}
|
|
2755
2755
|
)
|
|
2756
2756
|
] }), Je = () => {
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
}
|
|
2765
|
-
return e.id !==
|
|
2757
|
+
const { message: e } = _e("SentMessageDeliveryStatus"), { messages: t } = le("SentMessageDeliveryStatus"), n = (() => {
|
|
2758
|
+
if (t)
|
|
2759
|
+
for (let a = t.length - 1; a >= 0; a -= 1) {
|
|
2760
|
+
const r = t[a];
|
|
2761
|
+
if (!(r.type === "system" || r.type === "ephemeral" || r.type === "deleted"))
|
|
2762
|
+
return r.id;
|
|
2763
|
+
}
|
|
2764
|
+
})();
|
|
2765
|
+
return e.id !== n ? null : /* @__PURE__ */ u(te, { children: [
|
|
2766
2766
|
/* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
|
|
2767
2767
|
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2768
2768
|
] });
|
|
@@ -2933,9 +2933,9 @@ const Zr = {
|
|
|
2933
2933
|
}, ri = {
|
|
2934
2934
|
dark: "size-16 text-white/25",
|
|
2935
2935
|
light: "size-16 text-black/25"
|
|
2936
|
-
}, Ve = (e, t) => !!t && !!e &&
|
|
2936
|
+
}, Ve = (e, t) => !!t && !!e && oe(e) === "audio", Ct = (e, t) => {
|
|
2937
2937
|
if (!t || !e) return !1;
|
|
2938
|
-
const n =
|
|
2938
|
+
const n = oe(e);
|
|
2939
2939
|
return n === "video" || n === "audio";
|
|
2940
2940
|
}, St = "bg-[#F2F3F4]", $e = ({
|
|
2941
2941
|
variant: e,
|
|
@@ -2946,7 +2946,7 @@ const Zr = {
|
|
|
2946
2946
|
topLeft: i,
|
|
2947
2947
|
topRight: o
|
|
2948
2948
|
}) => {
|
|
2949
|
-
const l =
|
|
2949
|
+
const l = oe(r), d = !!n && l === "video";
|
|
2950
2950
|
return Ve(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
|
|
2951
2951
|
"audio",
|
|
2952
2952
|
{
|
|
@@ -3461,7 +3461,7 @@ const pi = ({
|
|
|
3461
3461
|
renderText: b,
|
|
3462
3462
|
threadList: x,
|
|
3463
3463
|
viewerLanguage: v
|
|
3464
|
-
} = e, { client: f } =
|
|
3464
|
+
} = e, { client: f } = me("CustomMessage"), { channel: N } = le("CustomMessage"), { isUnlocking: w, onUnlockClick: C, onFetchSource: R, onDownloadClick: S } = Ur("LockedAttachment"), [D, $] = U(!1), F = Js(c.id), { selected: L, voteUp: y, voteDown: E } = xa(c), {
|
|
3465
3465
|
Attachment: I = Zs,
|
|
3466
3466
|
EditMessageModal: M = Qs,
|
|
3467
3467
|
MessageActions: T,
|
|
@@ -3473,22 +3473,22 @@ const pi = ({
|
|
|
3473
3473
|
ReminderNotification: K = rn,
|
|
3474
3474
|
StreamedMessageText: _ = ln,
|
|
3475
3475
|
PinIndicator: A
|
|
3476
|
-
} = is("CustomMessage"), H = on(c), q = cn(c), Y =
|
|
3476
|
+
} = is("CustomMessage"), H = on(c), q = cn(c), Y = ae(
|
|
3477
3477
|
() => h == null ? void 0 : h(c),
|
|
3478
3478
|
[h, c]
|
|
3479
|
-
), B =
|
|
3480
|
-
const
|
|
3479
|
+
), B = ae(() => {
|
|
3480
|
+
const ue = c.attachments ?? [], pe = c.shared_location ? [c.shared_location, ...ue] : ue;
|
|
3481
3481
|
if (!Fe(c)) return pe;
|
|
3482
3482
|
const Yt = pe.filter((qt) => !("type" in qt) || !ws(qt));
|
|
3483
3483
|
return Yt.length === pe.length ? pe : Yt;
|
|
3484
|
-
}, [c]), W =
|
|
3484
|
+
}, [c]), W = ae(
|
|
3485
3485
|
() => Fs(B),
|
|
3486
3486
|
[B]
|
|
3487
|
-
), Q =
|
|
3488
|
-
const
|
|
3489
|
-
return
|
|
3490
|
-
}, [c, v]),
|
|
3491
|
-
(
|
|
3487
|
+
), Q = ae(() => {
|
|
3488
|
+
const ue = hs({ message: c, viewerLanguage: v });
|
|
3489
|
+
return ue === c.text ? c : { ...c, text: ue };
|
|
3490
|
+
}, [c, v]), ce = W.length > 0, De = W.reduce(
|
|
3491
|
+
(ue, pe) => ue + pe.attachments.length,
|
|
3492
3492
|
0
|
|
3493
3493
|
) === ((B == null ? void 0 : B.length) ?? 0), Le = Xa(
|
|
3494
3494
|
{
|
|
@@ -3503,7 +3503,7 @@ const pi = ({
|
|
|
3503
3503
|
return /* @__PURE__ */ s(j, { message: c });
|
|
3504
3504
|
if (un(c))
|
|
3505
3505
|
return /* @__PURE__ */ s(z, {});
|
|
3506
|
-
const
|
|
3506
|
+
const ne = !x && !!c.reply_count, de = !x && c.show_in_channel && c.parent_id, ie = c.status === "failed" && ((Rt = c.error) == null ? void 0 : Rt.status) !== 403, It = mn(c);
|
|
3507
3507
|
let he;
|
|
3508
3508
|
ie ? he = () => m(c) : It && (he = () => $(!0));
|
|
3509
3509
|
const fe = g(), js = k(
|
|
@@ -3518,12 +3518,12 @@ const pi = ({
|
|
|
3518
3518
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3519
3519
|
"str-chat__message--with-reactions": q,
|
|
3520
3520
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((Dt = c == null ? void 0 : c.error) == null ? void 0 : Dt.status) !== 403,
|
|
3521
|
-
"str-chat__message-with-thread-link":
|
|
3521
|
+
"str-chat__message-with-thread-link": ne || de,
|
|
3522
3522
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3523
3523
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3524
3524
|
"str-chat__virtual-message__wrapper--group": o
|
|
3525
3525
|
}
|
|
3526
|
-
), Ge = c.poll_id && f.polls.fromState(c.poll_id), Tt = Yr(c), ge = Fe(c), At = Hr(c), He = !!(B != null && B.length && !c.quoted_message), Mt = ge && fe && He, Vs =
|
|
3526
|
+
), Ge = c.poll_id && f.polls.fromState(c.poll_id), Tt = Yr(c), ge = Fe(c), At = Hr(c), He = !!(B != null && B.length && !c.quoted_message), Mt = ge && fe && He, Vs = ce && De && !c.quoted_message && !Ge && !Y && !ge;
|
|
3527
3527
|
return /* @__PURE__ */ u(te, { children: [
|
|
3528
3528
|
a && /* @__PURE__ */ s(
|
|
3529
3529
|
M,
|
|
@@ -3549,7 +3549,7 @@ const pi = ({
|
|
|
3549
3549
|
A && /* @__PURE__ */ s(A, {}),
|
|
3550
3550
|
!!F && /* @__PURE__ */ s(K, { reminder: F }),
|
|
3551
3551
|
c.user && /* @__PURE__ */ s(
|
|
3552
|
-
|
|
3552
|
+
se,
|
|
3553
3553
|
{
|
|
3554
3554
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3555
3555
|
id: c.user.id,
|
|
@@ -3689,14 +3689,14 @@ const pi = ({
|
|
|
3689
3689
|
)
|
|
3690
3690
|
] }),
|
|
3691
3691
|
/* @__PURE__ */ s(Xr, {}),
|
|
3692
|
-
|
|
3692
|
+
ne && /* @__PURE__ */ s(
|
|
3693
3693
|
ee,
|
|
3694
3694
|
{
|
|
3695
3695
|
onClick: d,
|
|
3696
3696
|
reply_count: c.reply_count
|
|
3697
3697
|
}
|
|
3698
3698
|
),
|
|
3699
|
-
|
|
3699
|
+
de && /* @__PURE__ */ s(X, {})
|
|
3700
3700
|
]
|
|
3701
3701
|
},
|
|
3702
3702
|
c.id
|
|
@@ -4026,7 +4026,7 @@ const pi = ({
|
|
|
4026
4026
|
qe.ExternalSources
|
|
4027
4027
|
]), $i = ({ threadList: e }) => {
|
|
4028
4028
|
var b, x;
|
|
4029
|
-
const { channel: t, channelConfig: n, thread: a } = le(), { client: r } =
|
|
4029
|
+
const { channel: t, channelConfig: n, thread: a } = le(), { client: r } = me(), { typing: i = {} } = yn(), { aiState: o } = kn(t), l = Ie(Os);
|
|
4030
4030
|
if (!e && l && Oi.has(o)) {
|
|
4031
4031
|
const v = Bi(t, (b = r.user) == null ? void 0 : b.id);
|
|
4032
4032
|
return /* @__PURE__ */ s(
|
|
@@ -4079,7 +4079,7 @@ const pi = ({
|
|
|
4079
4079
|
},
|
|
4080
4080
|
children: /* @__PURE__ */ u("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: [
|
|
4081
4081
|
/* @__PURE__ */ s(
|
|
4082
|
-
|
|
4082
|
+
se,
|
|
4083
4083
|
{
|
|
4084
4084
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
4085
4085
|
id: e,
|
|
@@ -4185,7 +4185,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4185
4185
|
renderHeaderTitleBadges: v
|
|
4186
4186
|
}) => {
|
|
4187
4187
|
var E, I, M, T, z, O;
|
|
4188
|
-
const { channel: f } = le(), { client: N } =
|
|
4188
|
+
const { channel: f } = le(), { client: N } = me(), w = V.useMemo(
|
|
4189
4189
|
() => {
|
|
4190
4190
|
var j;
|
|
4191
4191
|
return je(
|
|
@@ -4244,7 +4244,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4244
4244
|
),
|
|
4245
4245
|
children: [
|
|
4246
4246
|
/* @__PURE__ */ s(
|
|
4247
|
-
|
|
4247
|
+
se,
|
|
4248
4248
|
{
|
|
4249
4249
|
id: ((M = w == null ? void 0 : w.user) == null ? void 0 : M.id) || f.id || "unknown",
|
|
4250
4250
|
name: C,
|
|
@@ -4266,7 +4266,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4266
4266
|
}
|
|
4267
4267
|
) : /* @__PURE__ */ u("div", { className: $, children: [
|
|
4268
4268
|
/* @__PURE__ */ s(
|
|
4269
|
-
|
|
4269
|
+
se,
|
|
4270
4270
|
{
|
|
4271
4271
|
id: ((T = w == null ? void 0 : w.user) == null ? void 0 : T.id) || f.id || "unknown",
|
|
4272
4272
|
name: C,
|
|
@@ -4359,7 +4359,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4359
4359
|
),
|
|
4360
4360
|
children: [
|
|
4361
4361
|
/* @__PURE__ */ s(
|
|
4362
|
-
|
|
4362
|
+
se,
|
|
4363
4363
|
{
|
|
4364
4364
|
id: ((z = w == null ? void 0 : w.user) == null ? void 0 : z.id) || f.id || "unknown",
|
|
4365
4365
|
name: C,
|
|
@@ -4383,7 +4383,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4383
4383
|
}
|
|
4384
4384
|
) : /* @__PURE__ */ u("div", { className: F, children: [
|
|
4385
4385
|
/* @__PURE__ */ s(
|
|
4386
|
-
|
|
4386
|
+
se,
|
|
4387
4387
|
{
|
|
4388
4388
|
id: ((O = w == null ? void 0 : w.user) == null ? void 0 : O.id) || f.id || "unknown",
|
|
4389
4389
|
name: C,
|
|
@@ -4481,7 +4481,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4481
4481
|
composerInput: L
|
|
4482
4482
|
}) => {
|
|
4483
4483
|
var _, A, H, q;
|
|
4484
|
-
const { channel: y } = le(), { client: E } =
|
|
4484
|
+
const { channel: y } = le(), { client: E } = me(), I = V.useMemo(
|
|
4485
4485
|
() => {
|
|
4486
4486
|
var Y;
|
|
4487
4487
|
return je(
|
|
@@ -4495,8 +4495,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4495
4495
|
var W;
|
|
4496
4496
|
const Y = E == null ? void 0 : E.userID;
|
|
4497
4497
|
return Y ? Object.values(((W = y.state) == null ? void 0 : W.members) || {}).find((Q) => {
|
|
4498
|
-
var
|
|
4499
|
-
return ((
|
|
4498
|
+
var ce;
|
|
4499
|
+
return ((ce = Q.user) == null ? void 0 : ce.id) === Y;
|
|
4500
4500
|
}) : void 0;
|
|
4501
4501
|
}, [E == null ? void 0 : E.userID, (A = y.state) == null ? void 0 : A.members]), T = ((H = M == null ? void 0 : M.user) == null ? void 0 : H.is_account) ?? (M == null ? void 0 : M.is_account), z = ((q = I == null ? void 0 : I.user) == null ? void 0 : q.is_account) ?? (I == null ? void 0 : I.is_account), O = S && T === !1 && z === !0, j = y.state.messages.some(
|
|
4502
4502
|
(Y) => Y.type !== "deleted"
|
|
@@ -4673,7 +4673,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4673
4673
|
const _ = (A) => {
|
|
4674
4674
|
const H = A.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
|
|
4675
4675
|
if (!Y) return;
|
|
4676
|
-
const B = q == null ? void 0 : q.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), Q = W ? e.state.messages.find((
|
|
4676
|
+
const B = q == null ? void 0 : q.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), Q = W ? e.state.messages.find((ce) => ce.id === W) : void 0;
|
|
4677
4677
|
E(Y, Q);
|
|
4678
4678
|
};
|
|
4679
4679
|
return K.addEventListener("click", _), () => K.removeEventListener("click", _);
|
|
@@ -4809,7 +4809,7 @@ const ul = ({
|
|
|
4809
4809
|
"[MessagingShell] Loading initial conversation with:",
|
|
4810
4810
|
i
|
|
4811
4811
|
);
|
|
4812
|
-
const
|
|
4812
|
+
const ne = await D.queryChannels(
|
|
4813
4813
|
{
|
|
4814
4814
|
type: "messaging",
|
|
4815
4815
|
members: { $eq: [B, i] }
|
|
@@ -4817,15 +4817,15 @@ const ul = ({
|
|
|
4817
4817
|
{},
|
|
4818
4818
|
{ limit: 1 }
|
|
4819
4819
|
);
|
|
4820
|
-
if (
|
|
4821
|
-
T(
|
|
4820
|
+
if (ne.length > 0) {
|
|
4821
|
+
T(ne[0]), O(null), (De = _.current) == null || De.call(_, ne[0]), I && console.log(
|
|
4822
4822
|
"[MessagingShell] Initial conversation loaded:",
|
|
4823
|
-
|
|
4823
|
+
ne[0].id
|
|
4824
4824
|
);
|
|
4825
4825
|
return;
|
|
4826
4826
|
}
|
|
4827
|
-
const
|
|
4828
|
-
if (!
|
|
4827
|
+
const de = K.current;
|
|
4828
|
+
if (!de || !E) {
|
|
4829
4829
|
Q(), O("No conversation found with this account"), I && console.log(
|
|
4830
4830
|
"[MessagingShell] No conversation found for:",
|
|
4831
4831
|
i
|
|
@@ -4834,9 +4834,9 @@ const ul = ({
|
|
|
4834
4834
|
}
|
|
4835
4835
|
try {
|
|
4836
4836
|
const ie = await E.startChannelWithParticipant({
|
|
4837
|
-
id:
|
|
4838
|
-
name:
|
|
4839
|
-
phone:
|
|
4837
|
+
id: de.id,
|
|
4838
|
+
name: de.name,
|
|
4839
|
+
phone: de.phone
|
|
4840
4840
|
});
|
|
4841
4841
|
T(ie), O(null), (Le = _.current) == null || Le.call(_, ie), I && console.log(
|
|
4842
4842
|
"[MessagingShell] Channel created and loaded:",
|
|
@@ -4848,10 +4848,10 @@ const ul = ({
|
|
|
4848
4848
|
ie
|
|
4849
4849
|
), Q(), O("Failed to create conversation");
|
|
4850
4850
|
}
|
|
4851
|
-
} catch (
|
|
4851
|
+
} catch (ne) {
|
|
4852
4852
|
console.error(
|
|
4853
4853
|
"[MessagingShell] Failed to load initial conversation:",
|
|
4854
|
-
|
|
4854
|
+
ne
|
|
4855
4855
|
), Q(), H.current || O("Failed to load conversation");
|
|
4856
4856
|
}
|
|
4857
4857
|
})();
|
|
@@ -4942,7 +4942,7 @@ const Bs = V.createContext({
|
|
|
4942
4942
|
channelPreview: o,
|
|
4943
4943
|
renderMessagePreview: l,
|
|
4944
4944
|
viewerLanguage: d
|
|
4945
|
-
} = qi(), { client: m } =
|
|
4945
|
+
} = qi(), { client: m } = me(), p = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = dt(t);
|
|
4946
4946
|
if (o)
|
|
4947
4947
|
return /* @__PURE__ */ s(
|
|
4948
4948
|
o,
|
|
@@ -5007,7 +5007,7 @@ const Bs = V.createContext({
|
|
|
5007
5007
|
"data-dd-privacy": "mask",
|
|
5008
5008
|
children: /* @__PURE__ */ u("div", { className: "flex items-start gap-4", children: [
|
|
5009
5009
|
/* @__PURE__ */ s(
|
|
5010
|
-
|
|
5010
|
+
se,
|
|
5011
5011
|
{
|
|
5012
5012
|
id: ((L = b == null ? void 0 : b.user) == null ? void 0 : L.id) || t.id || "unknown",
|
|
5013
5013
|
name: x,
|
|
@@ -5151,7 +5151,7 @@ const Zi = ({
|
|
|
5151
5151
|
const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
5152
5152
|
return l.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ u("div", { className: "flex gap-3 items-end", children: [
|
|
5153
5153
|
(i || o) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
|
|
5154
|
-
|
|
5154
|
+
se,
|
|
5155
5155
|
{
|
|
5156
5156
|
id: o || "account",
|
|
5157
5157
|
name: o || "Account",
|
|
@@ -5192,12 +5192,12 @@ export {
|
|
|
5192
5192
|
es as L,
|
|
5193
5193
|
ol as M,
|
|
5194
5194
|
Ne as a,
|
|
5195
|
-
|
|
5195
|
+
se as b,
|
|
5196
5196
|
Ji as c,
|
|
5197
5197
|
$s as d,
|
|
5198
5198
|
cl as e,
|
|
5199
5199
|
Zi as f,
|
|
5200
|
-
|
|
5200
|
+
oe as g,
|
|
5201
5201
|
Zt as h,
|
|
5202
5202
|
ye as i,
|
|
5203
5203
|
qr as j,
|
|
@@ -5218,4 +5218,4 @@ export {
|
|
|
5218
5218
|
pt as y,
|
|
5219
5219
|
ut as z
|
|
5220
5220
|
};
|
|
5221
|
-
//# sourceMappingURL=index-
|
|
5221
|
+
//# sourceMappingURL=index-CPbf44kW.js.map
|