@linktr.ee/messaging-react 3.4.3-rc-1782553894 → 3.4.4-rc-1782716645
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-Cj686l88.js → Card-B3chRicI.js} +2 -2
- package/dist/{Card-Cj686l88.js.map → Card-B3chRicI.js.map} +1 -1
- package/dist/{Card-ffFBtGq1.cjs → Card-BFpVUA1p.cjs} +2 -2
- package/dist/{Card-ffFBtGq1.cjs.map → Card-BFpVUA1p.cjs.map} +1 -1
- package/dist/{Card-COb-KQ3x.js → Card-Cgh2ZQ1o.js} +2 -2
- package/dist/{Card-COb-KQ3x.js.map → Card-Cgh2ZQ1o.js.map} +1 -1
- package/dist/{Card-BVo5bHm8.cjs → Card-D9HR_DMh.cjs} +2 -2
- package/dist/{Card-BVo5bHm8.cjs.map → Card-D9HR_DMh.cjs.map} +1 -1
- package/dist/{Card-ChLOPFzW.cjs → Card-DNkyaI4C.cjs} +2 -2
- package/dist/{Card-ChLOPFzW.cjs.map → Card-DNkyaI4C.cjs.map} +1 -1
- package/dist/{Card-DAiwq638.js → Card-iPCZ4iFO.js} +3 -3
- package/dist/{Card-DAiwq638.js.map → Card-iPCZ4iFO.js.map} +1 -1
- package/dist/{LockedThumbnail-DzTY1vH1.cjs → LockedThumbnail-CFLBByiw.cjs} +2 -2
- package/dist/{LockedThumbnail-DzTY1vH1.cjs.map → LockedThumbnail-CFLBByiw.cjs.map} +1 -1
- package/dist/{LockedThumbnail-Bmw7e0iZ.js → LockedThumbnail-CtGTlb4k.js} +2 -2
- package/dist/{LockedThumbnail-Bmw7e0iZ.js.map → LockedThumbnail-CtGTlb4k.js.map} +1 -1
- package/dist/{index-D_U3aScH.js → index-BZRzouKv.js} +612 -595
- package/dist/index-BZRzouKv.js.map +1 -0
- package/dist/index-By3QMonF.cjs +2 -0
- package/dist/index-By3QMonF.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelList/CustomChannelPreview.tsx +7 -4
- package/src/components/ChannelView.tsx +8 -3
- package/src/components/CustomMessage/index.tsx +1 -0
- package/src/components/CustomMessageInput/index.tsx +4 -1
- package/src/components/MediaMessage/index.tsx +13 -5
- package/dist/index-DXBga91I.cjs +0 -2
- package/dist/index-DXBga91I.cjs.map +0 -1
- package/dist/index-D_U3aScH.js.map +0 -1
|
@@ -2,8 +2,8 @@ import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
|
|
|
2
2
|
import j, { createContext as We, useContext as _e, useCallback as J, useState as F, useRef as Y, useEffect as K, useId as In, useMemo as re, Suspense as Xe } from "react";
|
|
3
3
|
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as Tn, LinkPreviewsManager as Lt } from "stream-chat";
|
|
5
|
-
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as Gt, Attachment as Dn, EditMessageModal as Pn, MessageBlocked as zn, MessageBouncePrompt as On, MessageDeleted as $n, MessageIsThreadReplyInChannelButtonIndicator as Fn, MessageRepliesCountButton as Bn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Dt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as ye, useMessageComposer as Jn, useStateStore as Zn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, AttachmentPreviewList as ns, QuotedMessagePreview as ss, TextareaComposer as as, MessageTimestamp as $e, AIStates as Fe, useTypingContext as rs, useAIState as is, Channel as
|
|
6
|
-
import { StarIcon as Ge, DotsThreeIcon as hs, SpinnerGapIcon as Te, SignOutIcon as fs, ProhibitInsetIcon as Pt, FlagIcon as Ht, FileIcon as Yt, ImageIcon as gs, SpeakerHighIcon as
|
|
5
|
+
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as Gt, Attachment as Dn, EditMessageModal as Pn, MessageBlocked as zn, MessageBouncePrompt as On, MessageDeleted as $n, MessageIsThreadReplyInChannelButtonIndicator as Fn, MessageRepliesCountButton as Bn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Dt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as ye, useMessageComposer as Jn, useStateStore as Zn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, AttachmentPreviewList as ns, QuotedMessagePreview as ss, TextareaComposer as as, MessageTimestamp as $e, AIStates as Fe, useTypingContext as rs, useAIState as is, Channel as ls, WithComponents as os, Window as cs, MessageList as ds, ChannelList as us, InfiniteScroll as ms } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ge, DotsThreeIcon as hs, SpinnerGapIcon as Te, SignOutIcon as fs, ProhibitInsetIcon as Pt, FlagIcon as Ht, FileIcon as Yt, ImageIcon as gs, SpeakerHighIcon as ps, VideoCameraIcon as qt, FileMdIcon as bs, FileTextIcon as vs, FileZipIcon as xs, FilePptIcon as ws, FileCsvIcon as Ns, FileXlsIcon as _s, FileDocIcon as ys, FilePdfIcon as ks, CircleNotchIcon as we, PlayIcon as He, PauseIcon as Cs, LinkIcon as Es, DownloadSimpleIcon as Ne, GiftIcon as Is, ThumbsUpIcon as Ss, ThumbsDownIcon as Ts, TrashSimpleIcon as As, XIcon as Pe, ArrowUpIcon as Ms, SparkleIcon as be, ProhibitIcon as Rs, ArrowLeftIcon as zt, CaretRightIcon as ve, PencilSimpleIcon as Ls, CaretLeftIcon as Ds } from "@phosphor-icons/react";
|
|
7
7
|
import _ from "classnames";
|
|
8
8
|
import { MessageActions as Ps, DefaultDropdownActionButton as Wt } from "stream-chat-react/experimental";
|
|
9
9
|
const Xt = We({
|
|
@@ -24,20 +24,20 @@ const Xt = We({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var D,
|
|
28
|
-
const
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
var D, k;
|
|
28
|
+
const o = J(
|
|
29
|
+
(C, ...S) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${C}`, ...S);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
34
|
-
|
|
34
|
+
o("🔄 RENDER START", {
|
|
35
35
|
userId: t == null ? void 0 : t.id,
|
|
36
36
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [
|
|
40
|
+
const [l, d] = F(null), [m, g] = F(null), [u, f] = F(!1), [c, p] = F(!1), [N, w] = F(null), b = Y(!1), v = Y(null), M = Y(s);
|
|
41
41
|
M.current = s;
|
|
42
42
|
const T = Y(i);
|
|
43
43
|
T.current = i;
|
|
@@ -47,7 +47,7 @@ const Xt = We({
|
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
49
|
}), O = Y(0);
|
|
50
|
-
O.current++,
|
|
50
|
+
O.current++, o("📊 RENDER INFO", {
|
|
51
51
|
renderCount: O.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
@@ -64,18 +64,18 @@ const Xt = We({
|
|
|
64
64
|
};
|
|
65
65
|
const P = Y(null);
|
|
66
66
|
a && ((D = P.current) == null ? void 0 : D.apiKey) !== a && (P.current = { apiKey: a, client: new Tn(a) });
|
|
67
|
-
const L = a ? ((
|
|
67
|
+
const L = a ? ((k = P.current) == null ? void 0 : k.client) ?? null : null;
|
|
68
68
|
K(() => {
|
|
69
|
-
const
|
|
69
|
+
const C = O.current, S = M.current;
|
|
70
70
|
if (!a || !L || !S) {
|
|
71
|
-
|
|
72
|
-
renderCount:
|
|
71
|
+
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
+
renderCount: C,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
renderCount:
|
|
77
|
+
o("🚀 CREATING SERVICE", {
|
|
78
|
+
renderCount: C,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
81
|
const $ = new Sn({
|
|
@@ -84,96 +84,96 @@ const Xt = We({
|
|
|
84
84
|
debug: T.current,
|
|
85
85
|
client: L
|
|
86
86
|
});
|
|
87
|
-
v.current = $, d($),
|
|
88
|
-
renderCount:
|
|
87
|
+
v.current = $, d($), o("✅ SERVICE SET", {
|
|
88
|
+
renderCount: C,
|
|
89
89
|
serviceInstance: !!$
|
|
90
90
|
});
|
|
91
91
|
}, [a, L]);
|
|
92
92
|
const E = Y(null);
|
|
93
93
|
K(() => {
|
|
94
94
|
var S, $;
|
|
95
|
-
if (
|
|
96
|
-
hasService: !!
|
|
95
|
+
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
|
+
hasService: !!l,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: b.current,
|
|
100
100
|
isConnected: u,
|
|
101
|
-
dependencies: { service: !!
|
|
102
|
-
}), !
|
|
103
|
-
|
|
101
|
+
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
102
|
+
}), !l || !t) {
|
|
103
|
+
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
107
|
-
|
|
106
|
+
if (b.current) {
|
|
107
|
+
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((S = E.current) == null ? void 0 : S.serviceId) ===
|
|
111
|
-
|
|
110
|
+
if (((S = E.current) == null ? void 0 : S.serviceId) === l && (($ = E.current) == null ? void 0 : $.userId) === t.id) {
|
|
111
|
+
o(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
114
114
|
);
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
|
|
118
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), b.current = !0, p(!0), w(null);
|
|
119
119
|
try {
|
|
120
|
-
|
|
121
|
-
const z = await
|
|
122
|
-
g(z), f(!0), E.current = { serviceId:
|
|
120
|
+
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
+
const z = await l.connectUser(t);
|
|
122
|
+
g(z), f(!0), E.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
124
|
clientId: z.userID
|
|
125
125
|
});
|
|
126
126
|
} catch (z) {
|
|
127
127
|
const V = z instanceof Error ? z.message : "Connection failed";
|
|
128
|
-
w(V),
|
|
128
|
+
w(V), o("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
130
|
error: V
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
p(!1), b.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [
|
|
140
|
-
const
|
|
139
|
+
}, [l, t, o, u]), K(() => {
|
|
140
|
+
const C = L;
|
|
141
141
|
return () => {
|
|
142
142
|
var S;
|
|
143
|
-
|
|
143
|
+
C && (E.current = null, (S = v.current) == null || S.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
145
|
}, [L]);
|
|
146
146
|
const R = J(async () => {
|
|
147
|
-
if (
|
|
148
|
-
hasService: !!
|
|
147
|
+
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
148
|
+
hasService: !!l,
|
|
149
149
|
hasUser: !!t
|
|
150
|
-
}), !
|
|
151
|
-
|
|
150
|
+
}), !l || !t) {
|
|
151
|
+
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), p(!0);
|
|
155
155
|
try {
|
|
156
|
-
|
|
157
|
-
const
|
|
158
|
-
g(
|
|
159
|
-
} catch (
|
|
160
|
-
const S =
|
|
161
|
-
w(S),
|
|
156
|
+
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
157
|
+
const C = await l.connectUser(t);
|
|
158
|
+
g(C), f(!0), w(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (C) {
|
|
160
|
+
const S = C instanceof Error ? C.message : "Refresh failed";
|
|
161
|
+
w(S), o("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
163
|
error: S
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
p(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [
|
|
169
|
-
hasService: !!
|
|
168
|
+
}, [l, t, o]), A = j.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
|
+
hasService: !!l,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
172
172
|
isLoading: c,
|
|
173
173
|
hasError: !!N,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
|
-
service:
|
|
176
|
+
service: l,
|
|
177
177
|
client: m,
|
|
178
178
|
isConnected: u,
|
|
179
179
|
isLoading: c,
|
|
@@ -182,7 +182,7 @@ const Xt = We({
|
|
|
182
182
|
refreshConnection: R,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
|
-
|
|
185
|
+
l,
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
@@ -190,9 +190,9 @@ const Xt = We({
|
|
|
190
190
|
r,
|
|
191
191
|
R,
|
|
192
192
|
i,
|
|
193
|
-
|
|
193
|
+
o
|
|
194
194
|
]);
|
|
195
|
-
return
|
|
195
|
+
return o("🔄 RENDER END", {
|
|
196
196
|
renderCount: O.current,
|
|
197
197
|
willRenderChat: !!L,
|
|
198
198
|
contextValueReady: !!A
|
|
@@ -212,16 +212,16 @@ const Xt = We({
|
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
214
|
return K(() => {
|
|
215
|
-
var
|
|
215
|
+
var o;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
s(!!((
|
|
221
|
-
const i = (
|
|
220
|
+
s(!!((o = e.state.membership) != null && o.pinned_at));
|
|
221
|
+
const i = (l) => {
|
|
222
222
|
var d;
|
|
223
223
|
s(
|
|
224
|
-
|
|
224
|
+
l != null && l.member ? !!l.member.pinned_at : !!((d = e.state.membership) != null && d.pinned_at)
|
|
225
225
|
);
|
|
226
226
|
};
|
|
227
227
|
return e.on("member.updated", i), () => {
|
|
@@ -286,9 +286,9 @@ const ne = ({
|
|
|
286
286
|
className: a,
|
|
287
287
|
starred: r = !1,
|
|
288
288
|
shape: i = "squircle",
|
|
289
|
-
dmAgentEnabled:
|
|
289
|
+
dmAgentEnabled: o = !1
|
|
290
290
|
}) => {
|
|
291
|
-
const
|
|
291
|
+
const l = Bs(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
292
292
|
"img",
|
|
293
293
|
{
|
|
294
294
|
src: t,
|
|
@@ -303,7 +303,7 @@ const ne = ({
|
|
|
303
303
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
304
304
|
m
|
|
305
305
|
),
|
|
306
|
-
children:
|
|
306
|
+
children: l
|
|
307
307
|
}
|
|
308
308
|
) });
|
|
309
309
|
return /* @__PURE__ */ h(
|
|
@@ -337,7 +337,7 @@ const ne = ({
|
|
|
337
337
|
),
|
|
338
338
|
style: {
|
|
339
339
|
...u,
|
|
340
|
-
...
|
|
340
|
+
...o && {
|
|
341
341
|
borderWidth: `${g}px`,
|
|
342
342
|
borderStyle: "solid",
|
|
343
343
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
@@ -357,62 +357,62 @@ const ne = ({
|
|
|
357
357
|
enabled: a = !0,
|
|
358
358
|
onLeaveConversation: r,
|
|
359
359
|
onBlockParticipant: i,
|
|
360
|
-
onDeleteConversationClick:
|
|
361
|
-
onBlockParticipantClick:
|
|
360
|
+
onDeleteConversationClick: o,
|
|
361
|
+
onBlockParticipantClick: l,
|
|
362
362
|
onReportParticipantClick: d,
|
|
363
363
|
onActionComplete: m,
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
366
|
var D;
|
|
367
|
-
const { service: u, debug: f } = Je(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id,
|
|
367
|
+
const { service: u, debug: f } = Je(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, p = !!(a && s && u && c), [N, w] = F(!1), [b, v] = F(null), [M, T] = F(!1), [y, O] = F(!1), P = p && ((b == null ? void 0 : b.participantId) !== c || (b == null ? void 0 : b.service) !== u);
|
|
368
368
|
return K(() => {
|
|
369
|
-
if (!
|
|
369
|
+
if (!p || !u || !c) {
|
|
370
370
|
w(!1), v(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
let
|
|
373
|
+
let k = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
376
|
+
const C = await u.getBlockedUsers();
|
|
377
|
+
if (k) return;
|
|
378
378
|
w(
|
|
379
|
-
|
|
379
|
+
C.some(
|
|
380
380
|
(S) => S.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
|
-
} catch (
|
|
384
|
-
|
|
383
|
+
} catch (C) {
|
|
384
|
+
k || console.error(`[${g}] Failed to check blocked status:`, C);
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
k || v({ participantId: c, service: u });
|
|
387
387
|
}
|
|
388
388
|
})(), () => {
|
|
389
|
-
|
|
389
|
+
k = !0;
|
|
390
390
|
};
|
|
391
|
-
}, [
|
|
391
|
+
}, [p, u, c, g]), {
|
|
392
392
|
isParticipantBlocked: N,
|
|
393
393
|
isCheckingBlockedStatus: P,
|
|
394
394
|
isLeaving: M,
|
|
395
395
|
isUpdatingBlockStatus: y,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
397
|
+
var k;
|
|
398
398
|
if (!M) {
|
|
399
|
-
|
|
399
|
+
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), T(!0);
|
|
400
400
|
try {
|
|
401
|
-
const
|
|
402
|
-
await e.hide(
|
|
403
|
-
} catch (
|
|
404
|
-
console.error(`[${g}] Failed to leave conversation`,
|
|
401
|
+
const C = ((k = e._client) == null ? void 0 : k.userID) ?? null;
|
|
402
|
+
await e.hide(C, !1), r && await r(e), m == null || m();
|
|
403
|
+
} catch (C) {
|
|
404
|
+
console.error(`[${g}] Failed to leave conversation`, C);
|
|
405
405
|
} finally {
|
|
406
406
|
T(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
411
|
+
var k, C, S;
|
|
412
412
|
if (!(y || !u)) {
|
|
413
|
-
|
|
413
|
+
l == null || l(), f && console.log(`[${g}] Block member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), O(!0);
|
|
414
414
|
try {
|
|
415
|
-
await u.blockUser((
|
|
415
|
+
await u.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
|
|
416
416
|
} catch ($) {
|
|
417
417
|
console.error(`[${g}] Failed to block member`, $);
|
|
418
418
|
} finally {
|
|
@@ -421,11 +421,11 @@ const ne = ({
|
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
424
|
+
var k, C, S;
|
|
425
425
|
if (!(y || !u)) {
|
|
426
|
-
|
|
426
|
+
l == null || l(), f && console.log(`[${g}] Unblock member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), O(!0);
|
|
427
427
|
try {
|
|
428
|
-
await u.unBlockUser((
|
|
428
|
+
await u.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
|
|
429
429
|
} catch ($) {
|
|
430
430
|
console.error(`[${g}] Failed to unblock member`, $);
|
|
431
431
|
} finally {
|
|
@@ -437,7 +437,7 @@ const ne = ({
|
|
|
437
437
|
d == null || d(), m == null || m(), window.open(Us, "_blank", "noopener,noreferrer");
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
},
|
|
440
|
+
}, pe = ({
|
|
441
441
|
variant: e = "default",
|
|
442
442
|
className: t,
|
|
443
443
|
children: s,
|
|
@@ -461,15 +461,15 @@ const ne = ({
|
|
|
461
461
|
showBlockParticipant: a = !0,
|
|
462
462
|
showReportParticipant: r = !0,
|
|
463
463
|
onLeaveConversation: i,
|
|
464
|
-
onBlockParticipant:
|
|
465
|
-
onDeleteConversationClick:
|
|
464
|
+
onBlockParticipant: o,
|
|
465
|
+
onDeleteConversationClick: l,
|
|
466
466
|
onBlockParticipantClick: d,
|
|
467
467
|
onReportParticipantClick: m,
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] = F(!1),
|
|
472
|
-
isParticipantBlocked:
|
|
471
|
+
const [f, c] = F(!1), p = Y(null), N = In(), w = J(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: b,
|
|
473
473
|
isCheckingBlockedStatus: v,
|
|
474
474
|
isLeaving: M,
|
|
475
475
|
isUpdatingBlockStatus: T,
|
|
@@ -483,8 +483,8 @@ const ne = ({
|
|
|
483
483
|
showBlockParticipant: a,
|
|
484
484
|
enabled: f,
|
|
485
485
|
onLeaveConversation: i,
|
|
486
|
-
onBlockParticipant:
|
|
487
|
-
onDeleteConversationClick:
|
|
486
|
+
onBlockParticipant: o,
|
|
487
|
+
onDeleteConversationClick: l,
|
|
488
488
|
onBlockParticipantClick: d,
|
|
489
489
|
onReportParticipantClick: m,
|
|
490
490
|
onActionComplete: w,
|
|
@@ -493,14 +493,14 @@ const ne = ({
|
|
|
493
493
|
return K(() => {
|
|
494
494
|
if (!f) return;
|
|
495
495
|
const R = (D) => {
|
|
496
|
-
|
|
496
|
+
p.current && !p.current.contains(D.target) && c(!1);
|
|
497
497
|
}, A = (D) => {
|
|
498
498
|
D.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
500
|
return document.addEventListener("mousedown", R), document.addEventListener("keydown", A), () => {
|
|
501
501
|
document.removeEventListener("mousedown", R), document.removeEventListener("keydown", A);
|
|
502
502
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
503
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: p, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
@@ -527,7 +527,7 @@ const ne = ({
|
|
|
527
527
|
),
|
|
528
528
|
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
|
-
|
|
530
|
+
pe,
|
|
531
531
|
{
|
|
532
532
|
onClick: y,
|
|
533
533
|
disabled: M,
|
|
@@ -541,12 +541,12 @@ const ne = ({
|
|
|
541
541
|
a && /* @__PURE__ */ n("li", { children: v ? (
|
|
542
542
|
// Block status not yet resolved — show a disabled placeholder
|
|
543
543
|
// so a premature click can't act on a stale block state.
|
|
544
|
-
/* @__PURE__ */ h(
|
|
544
|
+
/* @__PURE__ */ h(pe, { disabled: !0, "aria-busy": !0, children: [
|
|
545
545
|
/* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
549
|
-
|
|
548
|
+
) : b ? /* @__PURE__ */ h(
|
|
549
|
+
pe,
|
|
550
550
|
{
|
|
551
551
|
onClick: P,
|
|
552
552
|
disabled: T,
|
|
@@ -557,7 +557,7 @@ const ne = ({
|
|
|
557
557
|
]
|
|
558
558
|
}
|
|
559
559
|
) : /* @__PURE__ */ h(
|
|
560
|
-
|
|
560
|
+
pe,
|
|
561
561
|
{
|
|
562
562
|
onClick: O,
|
|
563
563
|
disabled: T,
|
|
@@ -568,7 +568,7 @@ const ne = ({
|
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }),
|
|
571
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
571
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(pe, { variant: "danger", onClick: L, children: [
|
|
572
572
|
/* @__PURE__ */ n(Ht, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
@@ -619,7 +619,7 @@ function Zt({
|
|
|
619
619
|
const s = e == null ? void 0 : e.text, a = Ys(t);
|
|
620
620
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
621
|
}
|
|
622
|
-
const qs = j.lazy(() => import("./Card-
|
|
622
|
+
const qs = j.lazy(() => import("./Card-B3chRicI.js")), Ws = j.lazy(() => import("./Card-Cgh2ZQ1o.js")), Xs = j.lazy(() => import("./Card-iPCZ4iFO.js")), Ze = () => /* @__PURE__ */ n(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
625
|
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)]",
|
|
@@ -646,18 +646,18 @@ function tn(e) {
|
|
|
646
646
|
}
|
|
647
647
|
const ea = {
|
|
648
648
|
video: qt,
|
|
649
|
-
audio:
|
|
649
|
+
audio: ps,
|
|
650
650
|
image: gs,
|
|
651
651
|
document: Yt
|
|
652
652
|
}, ta = {
|
|
653
|
-
pdf:
|
|
653
|
+
pdf: ks,
|
|
654
654
|
doc: ys,
|
|
655
655
|
xls: _s,
|
|
656
656
|
csv: Ns,
|
|
657
657
|
ppt: ws,
|
|
658
658
|
zip: xs,
|
|
659
659
|
text: vs,
|
|
660
|
-
markdown:
|
|
660
|
+
markdown: bs,
|
|
661
661
|
generic: Yt
|
|
662
662
|
};
|
|
663
663
|
function na(e) {
|
|
@@ -677,12 +677,12 @@ const sa = (e) => {
|
|
|
677
677
|
autoPlay: a = !1,
|
|
678
678
|
playing: r,
|
|
679
679
|
loop: i = !1,
|
|
680
|
-
controls:
|
|
681
|
-
showProgress:
|
|
680
|
+
controls: o = !0,
|
|
681
|
+
showProgress: l = !1,
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: m
|
|
684
684
|
}) => {
|
|
685
|
-
const g = ie(t), u = Y(null), f = Y(null), c = Y(null),
|
|
685
|
+
const g = ie(t), u = Y(null), f = Y(null), c = Y(null), p = Y(r), [N, w] = F(a), [b, v] = F(0), [M, T] = F(!1), [y, O] = F(!1), [P, L] = F(!1), [E, R] = F(!1), [A, D] = F(!0), [k, C] = F(null), S = J(() => {
|
|
686
686
|
L(!1), w(!0);
|
|
687
687
|
}, []), $ = J((x) => {
|
|
688
688
|
const I = f.current;
|
|
@@ -701,7 +701,7 @@ const sa = (e) => {
|
|
|
701
701
|
v(I), z(I);
|
|
702
702
|
};
|
|
703
703
|
K(() => {
|
|
704
|
-
r !== void 0 && r !==
|
|
704
|
+
r !== void 0 && r !== p.current && (p.current = r, w(r));
|
|
705
705
|
}, [r]), K(() => {
|
|
706
706
|
if (!N) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
@@ -728,7 +728,7 @@ const sa = (e) => {
|
|
|
728
728
|
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", I);
|
|
729
729
|
};
|
|
730
730
|
}, [M, $, z]);
|
|
731
|
-
const ee =
|
|
731
|
+
const ee = k ? { aspectRatio: String(k) } : void 0, Z = k ? "" : " aspect-video", G = Math.round(b * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
@@ -741,7 +741,7 @@ const sa = (e) => {
|
|
|
741
741
|
m(x);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
P ||
|
|
744
|
+
P || o && w((I) => !I);
|
|
745
745
|
},
|
|
746
746
|
onKeyDown: (x) => {
|
|
747
747
|
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
@@ -749,7 +749,7 @@ const sa = (e) => {
|
|
|
749
749
|
m(x);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
P ||
|
|
752
|
+
P || o && w((I) => !I);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
@@ -801,7 +801,7 @@ const sa = (e) => {
|
|
|
801
801
|
onPlay: () => L(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
803
|
const x = u.current;
|
|
804
|
-
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight &&
|
|
804
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && C(x.videoWidth / x.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
807
|
i || (w(!1), v(0));
|
|
@@ -816,7 +816,7 @@ const sa = (e) => {
|
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
P && !
|
|
819
|
+
P && !o && /* @__PURE__ */ n(
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
822
822
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -832,7 +832,7 @@ const sa = (e) => {
|
|
|
832
832
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(He, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
|
-
|
|
835
|
+
l && !o && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
|
|
836
836
|
"div",
|
|
837
837
|
{
|
|
838
838
|
role: "slider",
|
|
@@ -847,7 +847,7 @@ const sa = (e) => {
|
|
|
847
847
|
onTouchStart: V,
|
|
848
848
|
onClick: (x) => x.stopPropagation(),
|
|
849
849
|
onKeyDown: (x) => {
|
|
850
|
-
x.key === "ArrowRight" && z(Math.min(1,
|
|
850
|
+
x.key === "ArrowRight" && z(Math.min(1, b + 0.05)), x.key === "ArrowLeft" && z(Math.max(0, b - 0.05));
|
|
851
851
|
},
|
|
852
852
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
853
|
"div",
|
|
@@ -858,7 +858,7 @@ const sa = (e) => {
|
|
|
858
858
|
) })
|
|
859
859
|
}
|
|
860
860
|
) }),
|
|
861
|
-
|
|
861
|
+
o && /* @__PURE__ */ h("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
862
862
|
/* @__PURE__ */ n(
|
|
863
863
|
"button",
|
|
864
864
|
{
|
|
@@ -868,7 +868,7 @@ const sa = (e) => {
|
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
870
|
"aria-label": N ? "Pause" : "Play",
|
|
871
|
-
children: N ? /* @__PURE__ */ n(
|
|
871
|
+
children: N ? /* @__PURE__ */ n(Cs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(He, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -888,7 +888,7 @@ const sa = (e) => {
|
|
|
888
888
|
onMouseEnter: () => O(!0),
|
|
889
889
|
onMouseLeave: () => O(!1),
|
|
890
890
|
onKeyDown: (x) => {
|
|
891
|
-
x.key === "ArrowRight" && z(Math.min(1,
|
|
891
|
+
x.key === "ArrowRight" && z(Math.min(1, b + 0.05)), x.key === "ArrowLeft" && z(Math.max(0, b - 0.05));
|
|
892
892
|
},
|
|
893
893
|
children: [
|
|
894
894
|
/* @__PURE__ */ n(
|
|
@@ -925,10 +925,10 @@ const sa = (e) => {
|
|
|
925
925
|
title: a,
|
|
926
926
|
variant: r,
|
|
927
927
|
mediaPlayerProps: i,
|
|
928
|
-
containedImage:
|
|
928
|
+
containedImage: o = !1
|
|
929
929
|
}) => {
|
|
930
|
-
const
|
|
931
|
-
return t && (
|
|
930
|
+
const l = ie(e), [d, m] = F(!1);
|
|
931
|
+
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
932
932
|
aa,
|
|
933
933
|
{
|
|
934
934
|
source: t,
|
|
@@ -937,7 +937,7 @@ const sa = (e) => {
|
|
|
937
937
|
controls: !0,
|
|
938
938
|
...i
|
|
939
939
|
}
|
|
940
|
-
) : t &&
|
|
940
|
+
) : t && l === "image" ? o ? /* @__PURE__ */ n("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ n(
|
|
941
941
|
"img",
|
|
942
942
|
{
|
|
943
943
|
src: t,
|
|
@@ -954,7 +954,7 @@ const sa = (e) => {
|
|
|
954
954
|
className: "block w-full",
|
|
955
955
|
draggable: !1
|
|
956
956
|
}
|
|
957
|
-
) : t &&
|
|
957
|
+
) : t && l === "document" ? s ? o ? /* @__PURE__ */ n("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ n(
|
|
958
958
|
"img",
|
|
959
959
|
{
|
|
960
960
|
src: s,
|
|
@@ -1005,14 +1005,14 @@ const sa = (e) => {
|
|
|
1005
1005
|
placeholderTitle: a = "Attachment title",
|
|
1006
1006
|
mimeType: r,
|
|
1007
1007
|
detail: i,
|
|
1008
|
-
statusBadge:
|
|
1009
|
-
action:
|
|
1008
|
+
statusBadge: o,
|
|
1009
|
+
action: l,
|
|
1010
1010
|
topLeft: d,
|
|
1011
1011
|
topRight: m,
|
|
1012
1012
|
rootRef: g,
|
|
1013
1013
|
"data-testid": u
|
|
1014
1014
|
}) => {
|
|
1015
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1015
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", p = f && !s;
|
|
1016
1016
|
return /* @__PURE__ */ h(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
@@ -1032,8 +1032,8 @@ const sa = (e) => {
|
|
|
1032
1032
|
{
|
|
1033
1033
|
className: _("mb-0.5 truncate text-base font-medium", {
|
|
1034
1034
|
"text-black": !f,
|
|
1035
|
-
"text-white/30": f &&
|
|
1036
|
-
"text-white": f && !
|
|
1035
|
+
"text-white/30": f && p,
|
|
1036
|
+
"text-white": f && !p
|
|
1037
1037
|
}),
|
|
1038
1038
|
children: c
|
|
1039
1039
|
}
|
|
@@ -1056,9 +1056,9 @@ const sa = (e) => {
|
|
|
1056
1056
|
children: i
|
|
1057
1057
|
}
|
|
1058
1058
|
),
|
|
1059
|
-
|
|
1059
|
+
o
|
|
1060
1060
|
] }),
|
|
1061
|
-
|
|
1061
|
+
l
|
|
1062
1062
|
] })
|
|
1063
1063
|
]
|
|
1064
1064
|
}
|
|
@@ -1073,10 +1073,10 @@ function Qe(e) {
|
|
|
1073
1073
|
function ia(e) {
|
|
1074
1074
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function la(e) {
|
|
1077
1077
|
return e ? "text-white" : "text-black";
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function oa(e) {
|
|
1080
1080
|
return e ? "text-white/55" : "text-black/55";
|
|
1081
1081
|
}
|
|
1082
1082
|
function ca(e) {
|
|
@@ -1086,7 +1086,7 @@ function da(e) {
|
|
|
1086
1086
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1087
|
}
|
|
1088
1088
|
const et = ({ attachment: e, isMyMessage: t }) => {
|
|
1089
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link:
|
|
1089
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(j.Fragment, { children: [
|
|
1090
1090
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1091
|
"img",
|
|
1092
1092
|
{
|
|
@@ -1102,8 +1102,8 @@ const et = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1102
1102
|
}
|
|
1103
1103
|
) }),
|
|
1104
1104
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1105
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1106
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1105
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${la(t)}`, children: s }),
|
|
1106
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${oa(t)}`, children: a }),
|
|
1107
1107
|
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ca(t)}`, children: d })
|
|
1108
1108
|
] })
|
|
1109
1109
|
] });
|
|
@@ -1125,8 +1125,8 @@ async function ua(e, t) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
const a = await fetch(e, { mode: "cors" });
|
|
1127
1127
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
1128
|
-
const r = await a.blob(), i = URL.createObjectURL(r),
|
|
1129
|
-
|
|
1128
|
+
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1129
|
+
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1130
1130
|
}
|
|
1131
1131
|
const ma = ({
|
|
1132
1132
|
url: e,
|
|
@@ -1139,11 +1139,11 @@ const ma = ({
|
|
|
1139
1139
|
type: "button",
|
|
1140
1140
|
onClick: (i) => {
|
|
1141
1141
|
i.stopPropagation();
|
|
1142
|
-
const
|
|
1142
|
+
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1143
1143
|
a(!0), ua(e, t).then(() => {
|
|
1144
|
-
|
|
1144
|
+
o == null || o.close();
|
|
1145
1145
|
}).catch(() => {
|
|
1146
|
-
|
|
1146
|
+
o && (o.location.href = e);
|
|
1147
1147
|
}).finally(() => a(!1));
|
|
1148
1148
|
},
|
|
1149
1149
|
disabled: s,
|
|
@@ -1156,27 +1156,27 @@ const ma = ({
|
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
1158
|
function nt(e) {
|
|
1159
|
-
var u, f, c,
|
|
1159
|
+
var u, f, c, p;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
1161
|
(N) => N.type === "video" && N.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
1163
|
(N) => N.type === "image" && N.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
1165
|
(N) => N.type === "audio" && N.asset_url
|
|
1166
|
-
), r = (
|
|
1166
|
+
), r = (p = e.attachments) == null ? void 0 : p.find(
|
|
1167
1167
|
(N) => N.type === "file" && N.asset_url
|
|
1168
|
-
), i = t ?? s ?? a ?? r,
|
|
1169
|
-
if (!
|
|
1170
|
-
const
|
|
1168
|
+
), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
|
+
if (!o) return null;
|
|
1170
|
+
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
1171
1171
|
return {
|
|
1172
|
-
resolvedUrl:
|
|
1173
|
-
resolvedType:
|
|
1172
|
+
resolvedUrl: o,
|
|
1173
|
+
resolvedType: l,
|
|
1174
1174
|
title: d,
|
|
1175
1175
|
fileSize: m,
|
|
1176
1176
|
thumbnailUrl: g
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
1179
|
-
const
|
|
1179
|
+
const ln = ({
|
|
1180
1180
|
resolvedUrl: e,
|
|
1181
1181
|
resolvedType: t,
|
|
1182
1182
|
title: s,
|
|
@@ -1204,21 +1204,21 @@ const on = ({
|
|
|
1204
1204
|
)
|
|
1205
1205
|
}
|
|
1206
1206
|
);
|
|
1207
|
-
},
|
|
1207
|
+
}, on = ({
|
|
1208
1208
|
resolvedUrl: e,
|
|
1209
1209
|
resolvedType: t,
|
|
1210
1210
|
title: s,
|
|
1211
1211
|
fileSize: a,
|
|
1212
1212
|
thumbnailUrl: r
|
|
1213
1213
|
}) => {
|
|
1214
|
-
const i = ie(t),
|
|
1214
|
+
const i = ie(t), o = a !== void 0 ? an(a) : void 0;
|
|
1215
1215
|
return /* @__PURE__ */ n(
|
|
1216
1216
|
sn,
|
|
1217
1217
|
{
|
|
1218
1218
|
variant: "light",
|
|
1219
1219
|
title: s,
|
|
1220
1220
|
mimeType: t,
|
|
1221
|
-
detail:
|
|
1221
|
+
detail: o,
|
|
1222
1222
|
thumbnail: /* @__PURE__ */ n(
|
|
1223
1223
|
nn,
|
|
1224
1224
|
{
|
|
@@ -1238,7 +1238,7 @@ const on = ({
|
|
|
1238
1238
|
isMyMessage: t = !1
|
|
1239
1239
|
}) => {
|
|
1240
1240
|
const s = tt(e), a = nt(e);
|
|
1241
|
-
return !s && !a ? null : /* @__PURE__ */ h("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", children: [
|
|
1241
|
+
return !s && !a ? null : /* @__PURE__ */ h("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: [
|
|
1242
1242
|
!t && e.user && /* @__PURE__ */ n(
|
|
1243
1243
|
ne,
|
|
1244
1244
|
{
|
|
@@ -1258,7 +1258,7 @@ const on = ({
|
|
|
1258
1258
|
{
|
|
1259
1259
|
className: "str-chat__message-bubble",
|
|
1260
1260
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1261
|
-
children: s ? /* @__PURE__ */ n("div", { className: Qe(t), children: /* @__PURE__ */ n(et, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(
|
|
1261
|
+
children: s ? /* @__PURE__ */ n("div", { className: Qe(t), children: /* @__PURE__ */ n(et, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(ln, { ...a }) : /* @__PURE__ */ n(on, { ...a })
|
|
1262
1262
|
}
|
|
1263
1263
|
) })
|
|
1264
1264
|
}
|
|
@@ -1269,27 +1269,27 @@ const on = ({
|
|
|
1269
1269
|
}) => {
|
|
1270
1270
|
const t = tt(e);
|
|
1271
1271
|
if (t)
|
|
1272
|
-
return /* @__PURE__ */ n("div", { className: Qe(!0), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !0 }) });
|
|
1272
|
+
return /* @__PURE__ */ n("div", { className: Qe(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !0 }) });
|
|
1273
1273
|
const s = nt(e);
|
|
1274
|
-
return s ? /* @__PURE__ */ n(
|
|
1274
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(ln, { ...s }) }) : null;
|
|
1275
1275
|
}, ga = ({
|
|
1276
1276
|
message: e
|
|
1277
1277
|
}) => {
|
|
1278
1278
|
const t = tt(e);
|
|
1279
1279
|
if (t)
|
|
1280
|
-
return /* @__PURE__ */ n("div", { className: Qe(!1), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !1 }) });
|
|
1280
|
+
return /* @__PURE__ */ n("div", { className: Qe(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !1 }) });
|
|
1281
1281
|
const s = nt(e);
|
|
1282
|
-
return s ? /* @__PURE__ */ n(
|
|
1282
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(on, { ...s }) }) : null;
|
|
1283
1283
|
}, yi = Object.assign(ha, {
|
|
1284
1284
|
Creator: fa,
|
|
1285
1285
|
Visitor: ga
|
|
1286
|
-
}),
|
|
1286
|
+
}), pa = {
|
|
1287
1287
|
isUnlocking: () => !1
|
|
1288
|
-
},
|
|
1289
|
-
LockedAttachment:
|
|
1290
|
-
}, cn = We({}),
|
|
1288
|
+
}, ba = {
|
|
1289
|
+
LockedAttachment: pa
|
|
1290
|
+
}, cn = We({}), ki = cn.Provider;
|
|
1291
1291
|
function va(e) {
|
|
1292
|
-
return _e(cn)[e] ??
|
|
1292
|
+
return _e(cn)[e] ?? ba[e];
|
|
1293
1293
|
}
|
|
1294
1294
|
const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1295
|
"svg",
|
|
@@ -1336,25 +1336,25 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1336
1336
|
if (r) {
|
|
1337
1337
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1338
1338
|
if (!f) return null;
|
|
1339
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1339
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", p = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1340
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
1341
|
/* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1342
|
+
/* @__PURE__ */ n("span", { children: p })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
1345
|
-
const
|
|
1345
|
+
const o = s && a, l = o ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
1346
1346
|
"message-chatbot-indicator",
|
|
1347
1347
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
|
-
|
|
1349
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children:
|
|
1350
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !
|
|
1348
|
+
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(xa, { size: o ? 12 : 15 }) });
|
|
1350
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(se, { children: [
|
|
1351
1351
|
m,
|
|
1352
1352
|
g
|
|
1353
1353
|
] }) : /* @__PURE__ */ h(se, { children: [
|
|
1354
1354
|
g,
|
|
1355
1355
|
m
|
|
1356
1356
|
] }) });
|
|
1357
|
-
},
|
|
1357
|
+
}, ka = ({
|
|
1358
1358
|
selected: e,
|
|
1359
1359
|
onVoteUp: t,
|
|
1360
1360
|
onVoteDown: s
|
|
@@ -1387,28 +1387,28 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1387
1387
|
children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
1390
|
-
] }),
|
|
1391
|
-
var
|
|
1390
|
+
] }), Ca = (e) => {
|
|
1391
|
+
var bt, vt, xt, wt, Nt, _t, yt, kt, Ct, Et, It, St, Tt, At;
|
|
1392
1392
|
const {
|
|
1393
1393
|
additionalMessageInputProps: t,
|
|
1394
1394
|
chatbotVotingEnabled: s,
|
|
1395
1395
|
editing: a,
|
|
1396
1396
|
endOfGroup: r,
|
|
1397
1397
|
firstOfGroup: i,
|
|
1398
|
-
groupedByUser:
|
|
1399
|
-
handleAction:
|
|
1398
|
+
groupedByUser: o,
|
|
1399
|
+
handleAction: l,
|
|
1400
1400
|
handleOpenThread: d,
|
|
1401
1401
|
handleRetry: m,
|
|
1402
1402
|
highlighted: g,
|
|
1403
1403
|
isMessageAIGenerated: u,
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
|
-
renderText:
|
|
1406
|
+
renderText: p,
|
|
1407
1407
|
threadList: N,
|
|
1408
1408
|
viewerLanguage: w
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1411
|
-
EditMessageModal:
|
|
1409
|
+
} = e, { client: b } = Ke("CustomMessage"), { channel: v } = de("CustomMessage"), { isUnlocking: M, onUnlockClick: T, onFetchSource: y, onDownloadClick: O } = va("LockedAttachment"), [P, L] = F(!1), E = Ln(c.id), { selected: R, voteUp: A, voteDown: D } = Hs(c), {
|
|
1410
|
+
Attachment: k = Dn,
|
|
1411
|
+
EditMessageModal: C = Pn,
|
|
1412
1412
|
MessageActions: S,
|
|
1413
1413
|
MessageBlocked: $ = zn,
|
|
1414
1414
|
MessageBouncePrompt: z = On,
|
|
@@ -1436,10 +1436,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1436
1436
|
return /* @__PURE__ */ n(V, { message: c });
|
|
1437
1437
|
if (Yn(c))
|
|
1438
1438
|
return /* @__PURE__ */ n($, {});
|
|
1439
|
-
const X = !N && !!c.reply_count, ue = !N && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((
|
|
1439
|
+
const X = !N && !!c.reply_count, ue = !N && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((bt = c.error) == null ? void 0 : bt.status) !== 403, he = qn(c);
|
|
1440
1440
|
let Q;
|
|
1441
1441
|
me ? Q = () => m(c) : he && (Q = () => L(!0));
|
|
1442
|
-
const te = f(),
|
|
1442
|
+
const te = f(), le = _(
|
|
1443
1443
|
"str-chat__message str-chat__message-simple",
|
|
1444
1444
|
`str-chat__message--${c.type}`,
|
|
1445
1445
|
`str-chat__message--${c.status}`,
|
|
@@ -1454,12 +1454,12 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1454
1454
|
"str-chat__message-with-thread-link": X || ue,
|
|
1455
1455
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1456
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
|
-
"str-chat__virtual-message__wrapper--group":
|
|
1457
|
+
"str-chat__virtual-message__wrapper--group": o
|
|
1458
1458
|
}
|
|
1459
|
-
), ht = c.poll_id &&
|
|
1459
|
+
), ht = c.poll_id && b.polls.fromState(c.poll_id), ft = ya(c), fe = Me(c), gt = _a(c), Oe = !!(B != null && B.length && !c.quoted_message), pt = fe && te && Oe;
|
|
1460
1460
|
return /* @__PURE__ */ h(se, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1462
|
+
C,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
@@ -1475,8 +1475,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
1476
1476
|
"div",
|
|
1477
1477
|
{
|
|
1478
|
-
className:
|
|
1478
|
+
className: le,
|
|
1479
1479
|
"data-message-id": c.id,
|
|
1480
|
+
"data-dd-privacy": "mask",
|
|
1480
1481
|
children: [
|
|
1481
1482
|
I && /* @__PURE__ */ n(I, {}),
|
|
1482
1483
|
!!E && /* @__PURE__ */ n(G, { reminder: E }),
|
|
@@ -1520,7 +1521,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1520
1521
|
thumbnailUrl: (Nt = c.metadata) == null ? void 0 : Nt.attachment_thumbnail,
|
|
1521
1522
|
amountText: (_t = c.metadata) == null ? void 0 : _t.amount_text,
|
|
1522
1523
|
detail: (yt = c.metadata) == null ? void 0 : yt.attachment_detail,
|
|
1523
|
-
paymentStatus: (
|
|
1524
|
+
paymentStatus: (kt = c.metadata) == null ? void 0 : kt.payment_status,
|
|
1524
1525
|
onPreviewClick: () => T == null ? void 0 : T(c, v),
|
|
1525
1526
|
onFetchSource: async () => await (y == null ? void 0 : y(c, v))
|
|
1526
1527
|
}
|
|
@@ -1529,7 +1530,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1529
1530
|
/* @__PURE__ */ n(
|
|
1530
1531
|
Bt.Received,
|
|
1531
1532
|
{
|
|
1532
|
-
title: (
|
|
1533
|
+
title: (Ct = c.metadata) == null ? void 0 : Ct.attachment_title,
|
|
1533
1534
|
mimeType: (Et = c.metadata) == null ? void 0 : Et.attachment_mime_type,
|
|
1534
1535
|
thumbnailUrl: (It = c.metadata) == null ? void 0 : It.attachment_thumbnail,
|
|
1535
1536
|
amountText: (St = c.metadata) == null ? void 0 : St.amount_text,
|
|
@@ -1547,14 +1548,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1547
1548
|
Dt,
|
|
1548
1549
|
{
|
|
1549
1550
|
message: W,
|
|
1550
|
-
renderText:
|
|
1551
|
+
renderText: p
|
|
1551
1552
|
}
|
|
1552
1553
|
) })
|
|
1553
1554
|
] }) : ft ? (
|
|
1554
1555
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
1556
|
/* @__PURE__ */ n(Be, { message: c, standalone: !0 })
|
|
1556
1557
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1557
|
-
fe && !
|
|
1558
|
+
fe && !pt && /* @__PURE__ */ n(
|
|
1558
1559
|
Be,
|
|
1559
1560
|
{
|
|
1560
1561
|
message: c,
|
|
@@ -1564,9 +1565,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1564
1565
|
),
|
|
1565
1566
|
ht && /* @__PURE__ */ n(Xn, { poll: ht }),
|
|
1566
1567
|
B != null && B.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1567
|
-
|
|
1568
|
+
k,
|
|
1568
1569
|
{
|
|
1569
|
-
actionHandler:
|
|
1570
|
+
actionHandler: l,
|
|
1570
1571
|
attachments: B
|
|
1571
1572
|
}
|
|
1572
1573
|
) : null,
|
|
@@ -1574,13 +1575,13 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1574
1575
|
x,
|
|
1575
1576
|
{
|
|
1576
1577
|
message: W,
|
|
1577
|
-
renderText:
|
|
1578
|
+
renderText: p
|
|
1578
1579
|
}
|
|
1579
1580
|
) : /* @__PURE__ */ n(
|
|
1580
1581
|
Dt,
|
|
1581
1582
|
{
|
|
1582
1583
|
message: W,
|
|
1583
|
-
renderText:
|
|
1584
|
+
renderText: p
|
|
1584
1585
|
}
|
|
1585
1586
|
),
|
|
1586
1587
|
/* @__PURE__ */ n(Kn, {})
|
|
@@ -1588,7 +1589,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1588
1589
|
}
|
|
1589
1590
|
),
|
|
1590
1591
|
!gt && !ft && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1591
|
-
(!fe ||
|
|
1592
|
+
(!fe || pt) && /* @__PURE__ */ n(
|
|
1592
1593
|
Be,
|
|
1593
1594
|
{
|
|
1594
1595
|
message: c,
|
|
@@ -1597,7 +1598,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1597
1598
|
}
|
|
1598
1599
|
),
|
|
1599
1600
|
s && fe && /* @__PURE__ */ n(
|
|
1600
|
-
|
|
1601
|
+
ka,
|
|
1601
1602
|
{
|
|
1602
1603
|
selected: R,
|
|
1603
1604
|
onVoteUp: A,
|
|
@@ -1619,7 +1620,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1619
1620
|
)
|
|
1620
1621
|
] });
|
|
1621
1622
|
}, Ea = j.memo(
|
|
1622
|
-
|
|
1623
|
+
Ca,
|
|
1623
1624
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Rn(e, t)
|
|
1624
1625
|
), Ia = (e) => {
|
|
1625
1626
|
const t = ye("CustomMessage");
|
|
@@ -1686,8 +1687,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1686
1687
|
"button",
|
|
1687
1688
|
{
|
|
1688
1689
|
type: "button",
|
|
1689
|
-
onClick: (
|
|
1690
|
-
|
|
1690
|
+
onClick: (o) => {
|
|
1691
|
+
o.preventDefault(), t(s);
|
|
1691
1692
|
},
|
|
1692
1693
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1693
1694
|
"aria-label": "Close link preview",
|
|
@@ -1720,7 +1721,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1720
1721
|
},
|
|
1721
1722
|
r.og_scrape_url
|
|
1722
1723
|
)) }) : null;
|
|
1723
|
-
}, st = j.createContext(!1),
|
|
1724
|
+
}, st = j.createContext(!1), Ci = () => _e(st), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1725
|
"button",
|
|
1725
1726
|
{
|
|
1726
1727
|
...s,
|
|
@@ -1735,35 +1736,42 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1735
1736
|
SendButton: r = Da,
|
|
1736
1737
|
AttachmentPreviewList: i = ns
|
|
1737
1738
|
} = Gt("CustomMessageInput");
|
|
1738
|
-
return /* @__PURE__ */ h(
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
{
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1739
|
+
return /* @__PURE__ */ h(
|
|
1740
|
+
"div",
|
|
1741
|
+
{
|
|
1742
|
+
className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
1743
|
+
"data-dd-privacy": "mask",
|
|
1744
|
+
children: [
|
|
1745
|
+
/* @__PURE__ */ n(ss, {}),
|
|
1746
|
+
/* @__PURE__ */ n(La, {}),
|
|
1747
|
+
/* @__PURE__ */ n(i, {}),
|
|
1748
|
+
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1749
|
+
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1750
|
+
as,
|
|
1751
|
+
{
|
|
1752
|
+
"aria-disabled": e || void 0,
|
|
1753
|
+
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
1754
|
+
autoFocus: !e,
|
|
1755
|
+
maxRows: 4,
|
|
1756
|
+
readOnly: e,
|
|
1757
|
+
tabIndex: e ? -1 : void 0
|
|
1758
|
+
}
|
|
1759
|
+
) }),
|
|
1760
|
+
/* @__PURE__ */ n(
|
|
1761
|
+
r,
|
|
1762
|
+
{
|
|
1763
|
+
sendMessage: t,
|
|
1764
|
+
"aria-label": "Send",
|
|
1765
|
+
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1766
|
+
"data-testid": "send-button",
|
|
1767
|
+
disabled: a,
|
|
1768
|
+
type: "button"
|
|
1769
|
+
}
|
|
1770
|
+
)
|
|
1771
|
+
] })
|
|
1772
|
+
]
|
|
1773
|
+
}
|
|
1774
|
+
);
|
|
1767
1775
|
}, za = ({
|
|
1768
1776
|
renderActions: e,
|
|
1769
1777
|
renderFooter: t,
|
|
@@ -1771,8 +1779,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1771
1779
|
disabledReason: a,
|
|
1772
1780
|
composerInput: r
|
|
1773
1781
|
}) => {
|
|
1774
|
-
var
|
|
1775
|
-
const { channel: i } = de(),
|
|
1782
|
+
var l;
|
|
1783
|
+
const { channel: i } = de(), o = ((l = i == null ? void 0 : i.data) == null ? void 0 : l.frozen) === !0;
|
|
1776
1784
|
return s ? /* @__PURE__ */ h(se, { children: [
|
|
1777
1785
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
1778
1786
|
t == null ? void 0 : t()
|
|
@@ -1780,12 +1788,12 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1780
1788
|
/* @__PURE__ */ h(
|
|
1781
1789
|
"div",
|
|
1782
1790
|
{
|
|
1783
|
-
inert:
|
|
1784
|
-
"aria-disabled":
|
|
1791
|
+
inert: o ? "" : void 0,
|
|
1792
|
+
"aria-disabled": o || void 0,
|
|
1785
1793
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1786
1794
|
children: [
|
|
1787
1795
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1788
|
-
/* @__PURE__ */ n(st.Provider, { value:
|
|
1796
|
+
/* @__PURE__ */ n(st.Provider, { value: o, children: /* @__PURE__ */ n(Qn, { Input: r ?? Pa }) })
|
|
1789
1797
|
]
|
|
1790
1798
|
}
|
|
1791
1799
|
),
|
|
@@ -1855,7 +1863,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1855
1863
|
"data-dm-agent-system-type": s.type,
|
|
1856
1864
|
children: [
|
|
1857
1865
|
/* @__PURE__ */ n(
|
|
1858
|
-
|
|
1866
|
+
be,
|
|
1859
1867
|
{
|
|
1860
1868
|
size: 16,
|
|
1861
1869
|
weight: "regular",
|
|
@@ -1920,10 +1928,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1920
1928
|
Fe.Generating,
|
|
1921
1929
|
Fe.ExternalSources
|
|
1922
1930
|
]), qa = ({ threadList: e }) => {
|
|
1923
|
-
var
|
|
1924
|
-
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = rs(), { aiState:
|
|
1925
|
-
if (!e &&
|
|
1926
|
-
const w = Wa(t, (
|
|
1931
|
+
var p, N;
|
|
1932
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = rs(), { aiState: o } = is(t), l = _e(un);
|
|
1933
|
+
if (!e && l && Ya.has(o)) {
|
|
1934
|
+
const w = Wa(t, (p = r.user) == null ? void 0 : p.id);
|
|
1927
1935
|
return /* @__PURE__ */ n(
|
|
1928
1936
|
Vt,
|
|
1929
1937
|
{
|
|
@@ -1937,14 +1945,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1937
1945
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1938
1946
|
return null;
|
|
1939
1947
|
const m = e ? [] : Object.values(i).filter(
|
|
1940
|
-
({ parent_id: w, user:
|
|
1948
|
+
({ parent_id: w, user: b }) => {
|
|
1941
1949
|
var v;
|
|
1942
|
-
return (
|
|
1950
|
+
return (b == null ? void 0 : b.id) !== ((v = r.user) == null ? void 0 : v.id) && !w;
|
|
1943
1951
|
}
|
|
1944
1952
|
), g = e ? Object.values(i).filter(
|
|
1945
|
-
({ parent_id: w, user:
|
|
1953
|
+
({ parent_id: w, user: b }) => {
|
|
1946
1954
|
var v;
|
|
1947
|
-
return (
|
|
1955
|
+
return (b == null ? void 0 : b.id) !== ((v = r.user) == null ? void 0 : v.id) && w === (a == null ? void 0 : a.id);
|
|
1948
1956
|
}
|
|
1949
1957
|
) : [], u = e ? g : m;
|
|
1950
1958
|
if (!u.length)
|
|
@@ -2060,44 +2068,44 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2060
2068
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2061
2069
|
] }) }));
|
|
2062
2070
|
Re.displayName = "LoadingState";
|
|
2063
|
-
const
|
|
2071
|
+
const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ae = "Replies instantly with AI assistant", Ja = ({
|
|
2064
2072
|
onBack: e,
|
|
2065
2073
|
showBackButton: t,
|
|
2066
2074
|
showStarButton: s = !1,
|
|
2067
2075
|
dmAgentEnabled: a = !1,
|
|
2068
2076
|
onLeaveConversation: r,
|
|
2069
2077
|
onBlockParticipant: i,
|
|
2070
|
-
showDeleteConversation:
|
|
2071
|
-
showBlockParticipant:
|
|
2078
|
+
showDeleteConversation: o = !0,
|
|
2079
|
+
showBlockParticipant: l = !0,
|
|
2072
2080
|
showReportParticipant: d = !0,
|
|
2073
2081
|
onDeleteConversationClick: m,
|
|
2074
2082
|
onBlockParticipantClick: g,
|
|
2075
2083
|
onReportParticipantClick: u,
|
|
2076
2084
|
customChannelActions: f,
|
|
2077
2085
|
renderChannelActions: c,
|
|
2078
|
-
showChannelInfo:
|
|
2086
|
+
showChannelInfo: p = !0,
|
|
2079
2087
|
onParticipantNameClick: N,
|
|
2080
2088
|
renderHeaderTitleBadges: w
|
|
2081
2089
|
}) => {
|
|
2082
|
-
var A, D,
|
|
2083
|
-
const { channel:
|
|
2090
|
+
var A, D, k, C, S, $, z;
|
|
2091
|
+
const { channel: b } = de(), v = j.useMemo(() => {
|
|
2084
2092
|
var Z, G;
|
|
2085
|
-
const V = (Z =
|
|
2086
|
-
return V ? Object.values(((G =
|
|
2093
|
+
const V = (Z = b._client) == null ? void 0 : Z.userID;
|
|
2094
|
+
return V ? Object.values(((G = b.state) == null ? void 0 : G.members) || {}).find(
|
|
2087
2095
|
(x) => {
|
|
2088
2096
|
var I;
|
|
2089
2097
|
return ((I = x.user) == null ? void 0 : I.id) && x.user.id !== V;
|
|
2090
2098
|
}
|
|
2091
2099
|
) : void 0;
|
|
2092
|
-
}, [(A =
|
|
2093
|
-
channel:
|
|
2100
|
+
}, [(A = b._client) == null ? void 0 : A.userID, (D = b.state) == null ? void 0 : D.members]), M = Jt(v == null ? void 0 : v.user), T = (k = v == null ? void 0 : v.user) == null ? void 0 : k.image, y = Kt(b), O = w == null ? void 0 : w({
|
|
2101
|
+
channel: b,
|
|
2094
2102
|
participant: v
|
|
2095
2103
|
}), P = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", L = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", E = /* @__PURE__ */ h(se, { children: [
|
|
2096
2104
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: M }),
|
|
2097
2105
|
O && /* @__PURE__ */ n("span", { className: "shrink-0", children: O })
|
|
2098
2106
|
] }), R = async () => {
|
|
2099
2107
|
try {
|
|
2100
|
-
y ? await
|
|
2108
|
+
y ? await b.unpin() : await b.pin();
|
|
2101
2109
|
} catch (V) {
|
|
2102
2110
|
console.error(
|
|
2103
2111
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -2111,7 +2119,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2111
2119
|
"button",
|
|
2112
2120
|
{
|
|
2113
2121
|
className: _(
|
|
2114
|
-
|
|
2122
|
+
oe,
|
|
2115
2123
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2116
2124
|
),
|
|
2117
2125
|
onClick: e || (() => {
|
|
@@ -2121,21 +2129,48 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2121
2129
|
children: /* @__PURE__ */ n(zt, { className: "size-5 text-black/90" })
|
|
2122
2130
|
}
|
|
2123
2131
|
) }),
|
|
2124
|
-
/* @__PURE__ */ n(
|
|
2125
|
-
"
|
|
2132
|
+
/* @__PURE__ */ n(
|
|
2133
|
+
"div",
|
|
2126
2134
|
{
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
+
className: "flex flex-col gap-1 items-center",
|
|
2136
|
+
"data-dd-privacy": "mask",
|
|
2137
|
+
children: N ? /* @__PURE__ */ h(
|
|
2138
|
+
"button",
|
|
2139
|
+
{
|
|
2140
|
+
type: "button",
|
|
2141
|
+
onClick: N,
|
|
2142
|
+
"aria-label": `View details for ${M}`,
|
|
2143
|
+
className: _(
|
|
2144
|
+
P,
|
|
2145
|
+
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2146
|
+
),
|
|
2147
|
+
children: [
|
|
2148
|
+
/* @__PURE__ */ n(
|
|
2149
|
+
ne,
|
|
2150
|
+
{
|
|
2151
|
+
id: ((C = v == null ? void 0 : v.user) == null ? void 0 : C.id) || b.id || "unknown",
|
|
2152
|
+
name: M,
|
|
2153
|
+
image: T,
|
|
2154
|
+
starred: s && y,
|
|
2155
|
+
dmAgentEnabled: a,
|
|
2156
|
+
size: 48
|
|
2157
|
+
}
|
|
2158
|
+
),
|
|
2159
|
+
/* @__PURE__ */ h("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
2160
|
+
E,
|
|
2161
|
+
/* @__PURE__ */ n(ve, { className: "size-3 shrink-0", weight: "bold" })
|
|
2162
|
+
] }),
|
|
2163
|
+
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2164
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2165
|
+
/* @__PURE__ */ n("span", { children: Ae })
|
|
2166
|
+
] })
|
|
2167
|
+
]
|
|
2168
|
+
}
|
|
2169
|
+
) : /* @__PURE__ */ h("div", { className: P, children: [
|
|
2135
2170
|
/* @__PURE__ */ n(
|
|
2136
2171
|
ne,
|
|
2137
2172
|
{
|
|
2138
|
-
id: ((
|
|
2173
|
+
id: ((S = v == null ? void 0 : v.user) == null ? void 0 : S.id) || b.id || "unknown",
|
|
2139
2174
|
name: M,
|
|
2140
2175
|
image: T,
|
|
2141
2176
|
starred: s && y,
|
|
@@ -2143,48 +2178,28 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2143
2178
|
size: 48
|
|
2144
2179
|
}
|
|
2145
2180
|
),
|
|
2146
|
-
/* @__PURE__ */ h("
|
|
2181
|
+
/* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
2147
2182
|
E,
|
|
2148
|
-
/* @__PURE__ */ n(
|
|
2183
|
+
/* @__PURE__ */ n(
|
|
2184
|
+
ve,
|
|
2185
|
+
{
|
|
2186
|
+
className: "invisible size-3 shrink-0",
|
|
2187
|
+
weight: "bold"
|
|
2188
|
+
}
|
|
2189
|
+
)
|
|
2149
2190
|
] }),
|
|
2150
2191
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2151
|
-
/* @__PURE__ */ n(
|
|
2192
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2152
2193
|
/* @__PURE__ */ n("span", { children: Ae })
|
|
2153
2194
|
] })
|
|
2154
|
-
]
|
|
2195
|
+
] })
|
|
2155
2196
|
}
|
|
2156
|
-
)
|
|
2157
|
-
/* @__PURE__ */ n(
|
|
2158
|
-
ne,
|
|
2159
|
-
{
|
|
2160
|
-
id: ((S = v == null ? void 0 : v.user) == null ? void 0 : S.id) || p.id || "unknown",
|
|
2161
|
-
name: M,
|
|
2162
|
-
image: T,
|
|
2163
|
-
starred: s && y,
|
|
2164
|
-
dmAgentEnabled: a,
|
|
2165
|
-
size: 48
|
|
2166
|
-
}
|
|
2167
|
-
),
|
|
2168
|
-
/* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
2169
|
-
E,
|
|
2170
|
-
/* @__PURE__ */ n(
|
|
2171
|
-
ve,
|
|
2172
|
-
{
|
|
2173
|
-
className: "invisible size-3 shrink-0",
|
|
2174
|
-
weight: "bold"
|
|
2175
|
-
}
|
|
2176
|
-
)
|
|
2177
|
-
] }),
|
|
2178
|
-
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2179
|
-
/* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
|
|
2180
|
-
/* @__PURE__ */ n("span", { children: Ae })
|
|
2181
|
-
] })
|
|
2182
|
-
] }) }),
|
|
2197
|
+
),
|
|
2183
2198
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
2184
2199
|
s && /* @__PURE__ */ n(
|
|
2185
2200
|
"button",
|
|
2186
2201
|
{
|
|
2187
|
-
className:
|
|
2202
|
+
className: oe,
|
|
2188
2203
|
onClick: R,
|
|
2189
2204
|
type: "button",
|
|
2190
2205
|
"aria-label": y ? "Unstar conversation" : "Star conversation",
|
|
@@ -2200,13 +2215,13 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2200
2215
|
)
|
|
2201
2216
|
}
|
|
2202
2217
|
),
|
|
2203
|
-
|
|
2218
|
+
p && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2204
2219
|
Ft,
|
|
2205
2220
|
{
|
|
2206
|
-
channel:
|
|
2221
|
+
channel: b,
|
|
2207
2222
|
participant: v,
|
|
2208
|
-
showDeleteConversation:
|
|
2209
|
-
showBlockParticipant:
|
|
2223
|
+
showDeleteConversation: o,
|
|
2224
|
+
showBlockParticipant: l,
|
|
2210
2225
|
showReportParticipant: d,
|
|
2211
2226
|
onLeaveConversation: r,
|
|
2212
2227
|
onBlockParticipant: i,
|
|
@@ -2214,18 +2229,18 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2214
2229
|
onBlockParticipantClick: g,
|
|
2215
2230
|
onReportParticipantClick: u,
|
|
2216
2231
|
customChannelActions: f,
|
|
2217
|
-
triggerClassName: _(
|
|
2232
|
+
triggerClassName: _(oe, "bg-[#F1F0EE]")
|
|
2218
2233
|
}
|
|
2219
2234
|
))
|
|
2220
2235
|
] })
|
|
2221
2236
|
] }),
|
|
2222
2237
|
/* @__PURE__ */ h("div", { className: "px-6 py-3 hidden @lg:flex items-center justify-between gap-3 min-h-12 border-b border-b-black/[0.08]", children: [
|
|
2223
|
-
/* @__PURE__ */ h("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
2238
|
+
/* @__PURE__ */ h("div", { className: "flex items-center gap-4 min-w-0", "data-dd-privacy": "mask", children: [
|
|
2224
2239
|
t && e && /* @__PURE__ */ n(
|
|
2225
2240
|
"button",
|
|
2226
2241
|
{
|
|
2227
2242
|
className: _(
|
|
2228
|
-
|
|
2243
|
+
oe,
|
|
2229
2244
|
"messaging-channel-view-back-button-desktop"
|
|
2230
2245
|
),
|
|
2231
2246
|
type: "button",
|
|
@@ -2248,7 +2263,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2248
2263
|
/* @__PURE__ */ n(
|
|
2249
2264
|
ne,
|
|
2250
2265
|
{
|
|
2251
|
-
id: (($ = v == null ? void 0 : v.user) == null ? void 0 : $.id) ||
|
|
2266
|
+
id: (($ = v == null ? void 0 : v.user) == null ? void 0 : $.id) || b.id || "unknown",
|
|
2252
2267
|
name: M,
|
|
2253
2268
|
image: T,
|
|
2254
2269
|
starred: s && y,
|
|
@@ -2262,7 +2277,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2262
2277
|
/* @__PURE__ */ n(ve, { className: "size-4 shrink-0", weight: "bold" })
|
|
2263
2278
|
] }),
|
|
2264
2279
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2265
|
-
/* @__PURE__ */ n(
|
|
2280
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2266
2281
|
/* @__PURE__ */ n("span", { className: "truncate", children: Ae })
|
|
2267
2282
|
] })
|
|
2268
2283
|
] })
|
|
@@ -2272,7 +2287,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2272
2287
|
/* @__PURE__ */ n(
|
|
2273
2288
|
ne,
|
|
2274
2289
|
{
|
|
2275
|
-
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) ||
|
|
2290
|
+
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) || b.id || "unknown",
|
|
2276
2291
|
name: M,
|
|
2277
2292
|
image: T,
|
|
2278
2293
|
starred: s && y,
|
|
@@ -2292,7 +2307,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2292
2307
|
)
|
|
2293
2308
|
] }),
|
|
2294
2309
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2295
|
-
/* @__PURE__ */ n(
|
|
2310
|
+
/* @__PURE__ */ n(be, { className: "size-3 shrink-0 text-black/55" }),
|
|
2296
2311
|
/* @__PURE__ */ n("span", { className: "truncate", children: Ae })
|
|
2297
2312
|
] })
|
|
2298
2313
|
] })
|
|
@@ -2302,7 +2317,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2302
2317
|
s && /* @__PURE__ */ n(
|
|
2303
2318
|
"button",
|
|
2304
2319
|
{
|
|
2305
|
-
className:
|
|
2320
|
+
className: oe,
|
|
2306
2321
|
onClick: R,
|
|
2307
2322
|
type: "button",
|
|
2308
2323
|
"aria-label": y ? "Unstar conversation" : "Star conversation",
|
|
@@ -2318,13 +2333,13 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2318
2333
|
)
|
|
2319
2334
|
}
|
|
2320
2335
|
),
|
|
2321
|
-
|
|
2336
|
+
p && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2322
2337
|
Ft,
|
|
2323
2338
|
{
|
|
2324
|
-
channel:
|
|
2339
|
+
channel: b,
|
|
2325
2340
|
participant: v,
|
|
2326
|
-
showDeleteConversation:
|
|
2327
|
-
showBlockParticipant:
|
|
2341
|
+
showDeleteConversation: o,
|
|
2342
|
+
showBlockParticipant: l,
|
|
2328
2343
|
showReportParticipant: d,
|
|
2329
2344
|
onLeaveConversation: r,
|
|
2330
2345
|
onBlockParticipant: i,
|
|
@@ -2332,7 +2347,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2332
2347
|
onBlockParticipantClick: g,
|
|
2333
2348
|
onReportParticipantClick: u,
|
|
2334
2349
|
customChannelActions: f,
|
|
2335
|
-
triggerClassName:
|
|
2350
|
+
triggerClassName: oe
|
|
2336
2351
|
}
|
|
2337
2352
|
))
|
|
2338
2353
|
] })
|
|
@@ -2345,18 +2360,18 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2345
2360
|
renderMessageInputFooter: a,
|
|
2346
2361
|
renderConversationFooter: r,
|
|
2347
2362
|
onLeaveConversation: i,
|
|
2348
|
-
onBlockParticipant:
|
|
2349
|
-
showDeleteConversation:
|
|
2363
|
+
onBlockParticipant: o,
|
|
2364
|
+
showDeleteConversation: l = !0,
|
|
2350
2365
|
onDeleteConversationClick: d,
|
|
2351
2366
|
onBlockParticipantClick: m,
|
|
2352
2367
|
onReportParticipantClick: g,
|
|
2353
2368
|
showBlockParticipant: u = !0,
|
|
2354
2369
|
showReportParticipant: f = !0,
|
|
2355
2370
|
composerDisabled: c = !1,
|
|
2356
|
-
composerDisabledReason:
|
|
2371
|
+
composerDisabledReason: p,
|
|
2357
2372
|
showStarButton: N = !1,
|
|
2358
2373
|
chatbotVotingEnabled: w = !1,
|
|
2359
|
-
renderChannelBanner:
|
|
2374
|
+
renderChannelBanner: b,
|
|
2360
2375
|
renderHeaderTitleBadges: v,
|
|
2361
2376
|
customChannelActions: M,
|
|
2362
2377
|
renderChannelActions: T,
|
|
@@ -2377,14 +2392,14 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2377
2392
|
return ((X = W.user) == null ? void 0 : X.id) && W.user.id !== U;
|
|
2378
2393
|
}
|
|
2379
2394
|
) : void 0;
|
|
2380
|
-
}, [(V = A._client) == null ? void 0 : V.userID, (ee = A.state) == null ? void 0 : ee.members]),
|
|
2395
|
+
}, [(V = A._client) == null ? void 0 : V.userID, (ee = A.state) == null ? void 0 : ee.members]), k = j.useMemo(() => {
|
|
2381
2396
|
var q, B;
|
|
2382
2397
|
const U = (q = A._client) == null ? void 0 : q.userID;
|
|
2383
2398
|
return U ? Object.values(((B = A.state) == null ? void 0 : B.members) || {}).find((W) => {
|
|
2384
2399
|
var X;
|
|
2385
2400
|
return ((X = W.user) == null ? void 0 : X.id) === U;
|
|
2386
2401
|
}) : void 0;
|
|
2387
|
-
}, [(Z = A._client) == null ? void 0 : Z.userID, (G = A.state) == null ? void 0 : G.members]),
|
|
2402
|
+
}, [(Z = A._client) == null ? void 0 : Z.userID, (G = A.state) == null ? void 0 : G.members]), C = ((x = k == null ? void 0 : k.user) == null ? void 0 : x.is_account) ?? (k == null ? void 0 : k.is_account), S = ((I = D == null ? void 0 : D.user) == null ? void 0 : I.is_account) ?? (D == null ? void 0 : D.is_account), $ = O && C === !1 && S === !0, z = J(
|
|
2388
2403
|
(U) => {
|
|
2389
2404
|
const { message: H } = ye("ChannelView"), q = /* @__PURE__ */ n(
|
|
2390
2405
|
Ia,
|
|
@@ -2399,7 +2414,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2399
2414
|
[w, y, P]
|
|
2400
2415
|
);
|
|
2401
2416
|
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
2402
|
-
|
|
2417
|
+
os,
|
|
2403
2418
|
{
|
|
2404
2419
|
overrides: {
|
|
2405
2420
|
Message: z,
|
|
@@ -2415,8 +2430,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2415
2430
|
showStarButton: N,
|
|
2416
2431
|
dmAgentEnabled: $,
|
|
2417
2432
|
onLeaveConversation: i,
|
|
2418
|
-
onBlockParticipant:
|
|
2419
|
-
showDeleteConversation:
|
|
2433
|
+
onBlockParticipant: o,
|
|
2434
|
+
showDeleteConversation: l,
|
|
2420
2435
|
showBlockParticipant: u,
|
|
2421
2436
|
showReportParticipant: f,
|
|
2422
2437
|
onDeleteConversationClick: d,
|
|
@@ -2428,7 +2443,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2428
2443
|
renderHeaderTitleBadges: v
|
|
2429
2444
|
}
|
|
2430
2445
|
) }, "lt-channel-header"),
|
|
2431
|
-
|
|
2446
|
+
b ? /* @__PURE__ */ n(j.Fragment, { children: b() }, "lt-channel-banner") : null,
|
|
2432
2447
|
/* @__PURE__ */ n(
|
|
2433
2448
|
"div",
|
|
2434
2449
|
{
|
|
@@ -2446,7 +2461,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2446
2461
|
},
|
|
2447
2462
|
renderFooter: () => a == null ? void 0 : a(A),
|
|
2448
2463
|
disabled: c,
|
|
2449
|
-
disabledReason:
|
|
2464
|
+
disabledReason: p,
|
|
2450
2465
|
composerInput: R
|
|
2451
2466
|
},
|
|
2452
2467
|
"lt-channel-message-input"
|
|
@@ -2462,18 +2477,18 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2462
2477
|
renderMessageInputActions: a,
|
|
2463
2478
|
renderMessageInputFooter: r,
|
|
2464
2479
|
renderConversationFooter: i,
|
|
2465
|
-
onLeaveConversation:
|
|
2466
|
-
onBlockParticipant:
|
|
2480
|
+
onLeaveConversation: o,
|
|
2481
|
+
onBlockParticipant: l,
|
|
2467
2482
|
className: d,
|
|
2468
2483
|
CustomChannelEmptyState: m = Xa,
|
|
2469
2484
|
showDeleteConversation: g = !0,
|
|
2470
2485
|
onDeleteConversationClick: u,
|
|
2471
2486
|
onBlockParticipantClick: f,
|
|
2472
2487
|
onReportParticipantClick: c,
|
|
2473
|
-
showBlockParticipant:
|
|
2488
|
+
showBlockParticipant: p = !0,
|
|
2474
2489
|
showReportParticipant: N = !0,
|
|
2475
2490
|
composerDisabled: w = !1,
|
|
2476
|
-
composerDisabledReason:
|
|
2491
|
+
composerDisabledReason: b,
|
|
2477
2492
|
dmAgentEnabled: v,
|
|
2478
2493
|
messageMetadata: M,
|
|
2479
2494
|
onMessageSent: T,
|
|
@@ -2485,8 +2500,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2485
2500
|
renderChannelActions: R,
|
|
2486
2501
|
renderMessage: A,
|
|
2487
2502
|
onMessageLinkClick: D,
|
|
2488
|
-
sendButton:
|
|
2489
|
-
attachmentPreviewList:
|
|
2503
|
+
sendButton: k,
|
|
2504
|
+
attachmentPreviewList: C,
|
|
2490
2505
|
viewerLanguage: S,
|
|
2491
2506
|
showChannelInfo: $ = !0,
|
|
2492
2507
|
onParticipantNameClick: z,
|
|
@@ -2532,7 +2547,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2532
2547
|
d
|
|
2533
2548
|
),
|
|
2534
2549
|
children: /* @__PURE__ */ n(un.Provider, { value: v ?? !1, children: /* @__PURE__ */ n(
|
|
2535
|
-
|
|
2550
|
+
ls,
|
|
2536
2551
|
{
|
|
2537
2552
|
channel: e,
|
|
2538
2553
|
MessageSystem: Ha,
|
|
@@ -2541,8 +2556,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2541
2556
|
DateSeparator: Vs,
|
|
2542
2557
|
TypingIndicator: qa,
|
|
2543
2558
|
doSendMessageRequest: ee,
|
|
2544
|
-
...
|
|
2545
|
-
...
|
|
2559
|
+
...k ? { SendButton: k } : {},
|
|
2560
|
+
...C ? { AttachmentPreviewList: C } : {},
|
|
2546
2561
|
children: /* @__PURE__ */ n(
|
|
2547
2562
|
Za,
|
|
2548
2563
|
{
|
|
@@ -2551,17 +2566,17 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2551
2566
|
renderMessageInputActions: a,
|
|
2552
2567
|
renderMessageInputFooter: r,
|
|
2553
2568
|
renderConversationFooter: i,
|
|
2554
|
-
onLeaveConversation:
|
|
2555
|
-
onBlockParticipant:
|
|
2569
|
+
onLeaveConversation: o,
|
|
2570
|
+
onBlockParticipant: l,
|
|
2556
2571
|
CustomChannelEmptyState: m,
|
|
2557
2572
|
showDeleteConversation: g,
|
|
2558
2573
|
onDeleteConversationClick: u,
|
|
2559
2574
|
onBlockParticipantClick: f,
|
|
2560
2575
|
onReportParticipantClick: c,
|
|
2561
|
-
showBlockParticipant:
|
|
2576
|
+
showBlockParticipant: p,
|
|
2562
2577
|
showReportParticipant: N,
|
|
2563
2578
|
composerDisabled: w,
|
|
2564
|
-
composerDisabledReason:
|
|
2579
|
+
composerDisabledReason: b,
|
|
2565
2580
|
showStarButton: y,
|
|
2566
2581
|
dmAgentEnabled: v,
|
|
2567
2582
|
chatbotVotingEnabled: O,
|
|
@@ -2605,18 +2620,18 @@ const Ei = ({
|
|
|
2605
2620
|
onChannelSelect: a,
|
|
2606
2621
|
onExitConversation: r,
|
|
2607
2622
|
initialParticipantFilter: i,
|
|
2608
|
-
initialParticipantData:
|
|
2609
|
-
CustomChannelEmptyState:
|
|
2623
|
+
initialParticipantData: o,
|
|
2624
|
+
CustomChannelEmptyState: l,
|
|
2610
2625
|
onBlockParticipantClick: d,
|
|
2611
2626
|
onReportParticipantClick: m,
|
|
2612
2627
|
dmAgentEnabled: g,
|
|
2613
2628
|
onMessageSent: u,
|
|
2614
2629
|
chatbotVotingEnabled: f = !1,
|
|
2615
2630
|
viewerLanguage: c,
|
|
2616
|
-
renderHeaderTitleBadges:
|
|
2631
|
+
renderHeaderTitleBadges: p,
|
|
2617
2632
|
renderChannelBanner: N,
|
|
2618
2633
|
customChannelActions: w,
|
|
2619
|
-
renderChannelActions:
|
|
2634
|
+
renderChannelActions: b,
|
|
2620
2635
|
onParticipantNameClick: v,
|
|
2621
2636
|
renderMessage: M,
|
|
2622
2637
|
onMessageLinkClick: T,
|
|
@@ -2630,15 +2645,15 @@ const Ei = ({
|
|
|
2630
2645
|
error: R,
|
|
2631
2646
|
refreshConnection: A,
|
|
2632
2647
|
service: D,
|
|
2633
|
-
debug:
|
|
2634
|
-
} = zs(), [
|
|
2635
|
-
G.current =
|
|
2648
|
+
debug: k
|
|
2649
|
+
} = zs(), [C, S] = F(null), [$, z] = F(null), [V, ee] = F(!1), { showDeleteConversation: Z = !0 } = e, G = Y(o);
|
|
2650
|
+
G.current = o;
|
|
2636
2651
|
const x = Y(a);
|
|
2637
2652
|
x.current = a;
|
|
2638
2653
|
const I = Y(null), U = Y(null);
|
|
2639
2654
|
K(() => {
|
|
2640
|
-
U.current =
|
|
2641
|
-
}, [
|
|
2655
|
+
U.current = C;
|
|
2656
|
+
}, [C]), K(() => {
|
|
2642
2657
|
if (!P || !L) return;
|
|
2643
2658
|
const B = P.userID;
|
|
2644
2659
|
if (!B) return;
|
|
@@ -2651,7 +2666,7 @@ const Ei = ({
|
|
|
2651
2666
|
(async () => {
|
|
2652
2667
|
var me, he;
|
|
2653
2668
|
try {
|
|
2654
|
-
|
|
2669
|
+
k && console.log(
|
|
2655
2670
|
"[MessagingShell] Loading initial conversation with:",
|
|
2656
2671
|
i
|
|
2657
2672
|
);
|
|
@@ -2664,7 +2679,7 @@ const Ei = ({
|
|
|
2664
2679
|
{ limit: 1 }
|
|
2665
2680
|
);
|
|
2666
2681
|
if (Q.length > 0) {
|
|
2667
|
-
S(Q[0]), z(null), (me = x.current) == null || me.call(x, Q[0]),
|
|
2682
|
+
S(Q[0]), z(null), (me = x.current) == null || me.call(x, Q[0]), k && console.log(
|
|
2668
2683
|
"[MessagingShell] Initial conversation loaded:",
|
|
2669
2684
|
Q[0].id
|
|
2670
2685
|
);
|
|
@@ -2672,26 +2687,26 @@ const Ei = ({
|
|
|
2672
2687
|
}
|
|
2673
2688
|
const te = G.current;
|
|
2674
2689
|
if (!te || !D) {
|
|
2675
|
-
X(), z("No conversation found with this account"),
|
|
2690
|
+
X(), z("No conversation found with this account"), k && console.log(
|
|
2676
2691
|
"[MessagingShell] No conversation found for:",
|
|
2677
2692
|
i
|
|
2678
2693
|
);
|
|
2679
2694
|
return;
|
|
2680
2695
|
}
|
|
2681
2696
|
try {
|
|
2682
|
-
const
|
|
2697
|
+
const le = await D.startChannelWithParticipant({
|
|
2683
2698
|
id: te.id,
|
|
2684
2699
|
name: te.name,
|
|
2685
2700
|
phone: te.phone
|
|
2686
2701
|
});
|
|
2687
|
-
S(
|
|
2702
|
+
S(le), z(null), (he = x.current) == null || he.call(x, le), k && console.log(
|
|
2688
2703
|
"[MessagingShell] Channel created and loaded:",
|
|
2689
|
-
|
|
2704
|
+
le.id
|
|
2690
2705
|
);
|
|
2691
|
-
} catch (
|
|
2706
|
+
} catch (le) {
|
|
2692
2707
|
console.error(
|
|
2693
2708
|
"[MessagingShell] Failed to create conversation:",
|
|
2694
|
-
|
|
2709
|
+
le
|
|
2695
2710
|
), X(), z("Failed to create conversation");
|
|
2696
2711
|
}
|
|
2697
2712
|
} catch (Q) {
|
|
@@ -2701,7 +2716,7 @@ const Ei = ({
|
|
|
2701
2716
|
), X(), U.current || z("Failed to load conversation");
|
|
2702
2717
|
}
|
|
2703
2718
|
})();
|
|
2704
|
-
}, [i, P, L, D,
|
|
2719
|
+
}, [i, P, L, D, k]);
|
|
2705
2720
|
const H = Y(r);
|
|
2706
2721
|
H.current = r;
|
|
2707
2722
|
const q = J(() => {
|
|
@@ -2714,16 +2729,16 @@ const Ei = ({
|
|
|
2714
2729
|
message: "Not connected to messaging service",
|
|
2715
2730
|
onBack: A
|
|
2716
2731
|
}
|
|
2717
|
-
) : $ ? /* @__PURE__ */ n(xe, { message: $ }) : V && !
|
|
2732
|
+
) : $ ? /* @__PURE__ */ n(xe, { message: $ }) : V && !C ? /* @__PURE__ */ n(xe, { message: "Conversation ended" }) : C ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2718
2733
|
mn,
|
|
2719
2734
|
{
|
|
2720
|
-
channel:
|
|
2735
|
+
channel: C,
|
|
2721
2736
|
renderMessageInputActions: t,
|
|
2722
2737
|
renderConversationFooter: s,
|
|
2723
2738
|
renderChannelBanner: N,
|
|
2724
2739
|
onLeaveConversation: q,
|
|
2725
2740
|
onBlockParticipant: q,
|
|
2726
|
-
CustomChannelEmptyState:
|
|
2741
|
+
CustomChannelEmptyState: l,
|
|
2727
2742
|
showDeleteConversation: Z,
|
|
2728
2743
|
onBlockParticipantClick: d,
|
|
2729
2744
|
onReportParticipantClick: m,
|
|
@@ -2731,16 +2746,16 @@ const Ei = ({
|
|
|
2731
2746
|
onMessageSent: u,
|
|
2732
2747
|
chatbotVotingEnabled: f,
|
|
2733
2748
|
viewerLanguage: c,
|
|
2734
|
-
renderHeaderTitleBadges:
|
|
2749
|
+
renderHeaderTitleBadges: p,
|
|
2735
2750
|
customChannelActions: w,
|
|
2736
|
-
renderChannelActions:
|
|
2751
|
+
renderChannelActions: b,
|
|
2737
2752
|
onParticipantNameClick: v,
|
|
2738
2753
|
renderMessage: M,
|
|
2739
2754
|
onMessageLinkClick: T,
|
|
2740
2755
|
showChannelInfo: y,
|
|
2741
2756
|
composerInput: O
|
|
2742
2757
|
},
|
|
2743
|
-
|
|
2758
|
+
C.id
|
|
2744
2759
|
) }) }) : /* @__PURE__ */ n(Re, {});
|
|
2745
2760
|
};
|
|
2746
2761
|
function Qa(e) {
|
|
@@ -2785,8 +2800,8 @@ const hn = j.createContext({
|
|
|
2785
2800
|
onChannelSelect: a,
|
|
2786
2801
|
debug: r,
|
|
2787
2802
|
renderMessagePreview: i,
|
|
2788
|
-
viewerLanguage:
|
|
2789
|
-
} = tr(),
|
|
2803
|
+
viewerLanguage: o
|
|
2804
|
+
} = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2790
2805
|
e && a(e);
|
|
2791
2806
|
}, m = (E) => {
|
|
2792
2807
|
const R = E.key === "Enter" || E.key === " ", A = E.repeat;
|
|
@@ -2796,7 +2811,7 @@ const hn = j.createContext({
|
|
|
2796
2811
|
var R, A;
|
|
2797
2812
|
return ((R = E.user) == null ? void 0 : R.id) && E.user.id !== ((A = e == null ? void 0 : e._client) == null ? void 0 : A.userID);
|
|
2798
2813
|
}
|
|
2799
|
-
), f = Jt(u == null ? void 0 : u.user), c = (P = u == null ? void 0 : u.user) == null ? void 0 : P.image,
|
|
2814
|
+
), f = Jt(u == null ? void 0 : u.user), c = (P = u == null ? void 0 : u.user) == null ? void 0 : P.image, p = (() => {
|
|
2800
2815
|
var R;
|
|
2801
2816
|
const E = (R = e == null ? void 0 : e.state) == null ? void 0 : R.messages;
|
|
2802
2817
|
if (E != null && E.length) {
|
|
@@ -2804,24 +2819,25 @@ const hn = j.createContext({
|
|
|
2804
2819
|
if (E[A].type !== "system") return E[A];
|
|
2805
2820
|
}
|
|
2806
2821
|
})(), w = (() => {
|
|
2807
|
-
var
|
|
2822
|
+
var C, S, $, z;
|
|
2808
2823
|
const E = Zt({
|
|
2809
|
-
message:
|
|
2810
|
-
viewerLanguage:
|
|
2824
|
+
message: p,
|
|
2825
|
+
viewerLanguage: o
|
|
2811
2826
|
});
|
|
2812
|
-
if (((
|
|
2813
|
-
if (((S =
|
|
2814
|
-
if ((($ =
|
|
2827
|
+
if (((C = p == null ? void 0 : p.metadata) == null ? void 0 : C.custom_type) === "MESSAGE_TIP") return E ? `💵 ${E}` : "💵 Sent a tip";
|
|
2828
|
+
if (((S = p == null ? void 0 : p.metadata) == null ? void 0 : S.custom_type) === "MESSAGE_PAID") return E ? `💰 ${E}` : "💰 Sent a message";
|
|
2829
|
+
if ((($ = p == null ? void 0 : p.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_ATTACHMENT")
|
|
2830
|
+
return E ? `📎 ${E}` : "📎 Sent an attachment";
|
|
2815
2831
|
if (E) return E;
|
|
2816
|
-
const
|
|
2817
|
-
return
|
|
2818
|
-
})(),
|
|
2832
|
+
const k = (z = p == null ? void 0 : p.attachments) == null ? void 0 : z[0];
|
|
2833
|
+
return k ? k.og_scrape_url ? k.og_scrape_url : k.type === "image" ? "📷 Sent an image" : k.type === "video" ? "🎥 Sent a video" : k.type === "audio" ? "🎵 Sent audio" : k.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2834
|
+
})(), b = p != null && p.created_at ? sr(new Date(p.created_at)) : "", v = p ? Me(p) : !1, M = i ? i(p, w) : `${v ? "✨ " : ""}${w}`, T = Kt(e), y = t ?? 0;
|
|
2819
2835
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2820
2836
|
channelId: e == null ? void 0 : e.id,
|
|
2821
|
-
isSelected:
|
|
2837
|
+
isSelected: l,
|
|
2822
2838
|
participantName: f,
|
|
2823
2839
|
unreadCount: y,
|
|
2824
|
-
hasTimestamp: !!
|
|
2840
|
+
hasTimestamp: !!b
|
|
2825
2841
|
}), /* @__PURE__ */ n(
|
|
2826
2842
|
"div",
|
|
2827
2843
|
{
|
|
@@ -2832,10 +2848,11 @@ const hn = j.createContext({
|
|
|
2832
2848
|
className: _(
|
|
2833
2849
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2834
2850
|
{
|
|
2835
|
-
"bg-black/[0.04]":
|
|
2836
|
-
"hover:bg-black/[0.02]": !
|
|
2851
|
+
"bg-black/[0.04]": l,
|
|
2852
|
+
"hover:bg-black/[0.02]": !l
|
|
2837
2853
|
}
|
|
2838
2854
|
),
|
|
2855
|
+
"data-dd-privacy": "mask",
|
|
2839
2856
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2840
2857
|
/* @__PURE__ */ n(
|
|
2841
2858
|
ne,
|
|
@@ -2861,7 +2878,7 @@ const hn = j.createContext({
|
|
|
2861
2878
|
]
|
|
2862
2879
|
}
|
|
2863
2880
|
),
|
|
2864
|
-
|
|
2881
|
+
b && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: b })
|
|
2865
2882
|
] }),
|
|
2866
2883
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2867
2884
|
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
@@ -2882,18 +2899,18 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2882
2899
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2883
2900
|
channelRenderFilterFn: r,
|
|
2884
2901
|
sort: i = ar,
|
|
2885
|
-
className:
|
|
2886
|
-
customEmptyStateIndicator:
|
|
2902
|
+
className: o,
|
|
2903
|
+
customEmptyStateIndicator: l,
|
|
2887
2904
|
renderMessagePreview: d,
|
|
2888
2905
|
viewerLanguage: m
|
|
2889
2906
|
}) => {
|
|
2890
2907
|
const g = j.useRef(0);
|
|
2891
2908
|
g.current++;
|
|
2892
2909
|
const { debug: u = !1 } = Je(), f = j.useCallback(
|
|
2893
|
-
(
|
|
2894
|
-
for (const N of
|
|
2910
|
+
(p) => {
|
|
2911
|
+
for (const N of p)
|
|
2895
2912
|
Qa(N);
|
|
2896
|
-
return r ? r(
|
|
2913
|
+
return r ? r(p) : p;
|
|
2897
2914
|
},
|
|
2898
2915
|
[r]
|
|
2899
2916
|
);
|
|
@@ -2923,7 +2940,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2923
2940
|
{
|
|
2924
2941
|
className: _(
|
|
2925
2942
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2926
|
-
|
|
2943
|
+
o
|
|
2927
2944
|
),
|
|
2928
2945
|
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(er, { value: c, children: /* @__PURE__ */ n(
|
|
2929
2946
|
us,
|
|
@@ -2935,7 +2952,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2935
2952
|
channelRenderFilterFn: f,
|
|
2936
2953
|
Paginator: ms,
|
|
2937
2954
|
Preview: fn,
|
|
2938
|
-
EmptyStateIndicator:
|
|
2955
|
+
EmptyStateIndicator: l
|
|
2939
2956
|
},
|
|
2940
2957
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
2941
2958
|
) }) })
|
|
@@ -2944,7 +2961,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2944
2961
|
}
|
|
2945
2962
|
);
|
|
2946
2963
|
rr.displayName = "ChannelList";
|
|
2947
|
-
const ir = /^([a-z][a-z0-9+.-]*):/i,
|
|
2964
|
+
const ir = /^([a-z][a-z0-9+.-]*):/i, lr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2948
2965
|
function at(e) {
|
|
2949
2966
|
if (typeof e != "string") return;
|
|
2950
2967
|
const t = e.trim();
|
|
@@ -2952,17 +2969,17 @@ function at(e) {
|
|
|
2952
2969
|
const s = ir.exec(t);
|
|
2953
2970
|
if (s) {
|
|
2954
2971
|
const a = s[1].toLowerCase();
|
|
2955
|
-
return
|
|
2972
|
+
return lr.has(a) ? t : void 0;
|
|
2956
2973
|
}
|
|
2957
2974
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2958
2975
|
}
|
|
2959
|
-
const
|
|
2976
|
+
const or = {
|
|
2960
2977
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2961
2978
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2962
2979
|
}, cr = ({ variant: e, cta: t }) => {
|
|
2963
2980
|
const s = _(
|
|
2964
2981
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2965
|
-
|
|
2982
|
+
or[e]
|
|
2966
2983
|
), a = at(t.href);
|
|
2967
2984
|
return a ? /* @__PURE__ */ n(
|
|
2968
2985
|
"a",
|
|
@@ -3002,15 +3019,15 @@ const lr = {
|
|
|
3002
3019
|
description: a,
|
|
3003
3020
|
url: r,
|
|
3004
3021
|
appIcon: i,
|
|
3005
|
-
cta:
|
|
3006
|
-
trailingAction:
|
|
3022
|
+
cta: o,
|
|
3023
|
+
trailingAction: l
|
|
3007
3024
|
}) => {
|
|
3008
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
3009
|
-
if (!g && !u && !c && !
|
|
3025
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", p = o != null;
|
|
3026
|
+
if (!g && !u && !c && !p) return null;
|
|
3010
3027
|
const w = _(
|
|
3011
3028
|
"truncate text-base font-medium leading-6",
|
|
3012
3029
|
d && !t ? ur : dr[e]
|
|
3013
|
-
),
|
|
3030
|
+
), b = _(
|
|
3014
3031
|
"truncate text-xs leading-4",
|
|
3015
3032
|
mr[e]
|
|
3016
3033
|
);
|
|
@@ -3022,13 +3039,13 @@ const lr = {
|
|
|
3022
3039
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
3023
3040
|
/* @__PURE__ */ n("p", { className: _("min-w-0", w), children: m })
|
|
3024
3041
|
] }),
|
|
3025
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
3042
|
+
u && /* @__PURE__ */ n("p", { className: b, children: a })
|
|
3026
3043
|
] }),
|
|
3027
|
-
!
|
|
3044
|
+
!p && c && /* @__PURE__ */ n("p", { className: b, children: f })
|
|
3028
3045
|
] }),
|
|
3029
|
-
|
|
3046
|
+
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
3030
3047
|
] }),
|
|
3031
|
-
|
|
3048
|
+
o && /* @__PURE__ */ n(cr, { variant: e, cta: o })
|
|
3032
3049
|
] });
|
|
3033
3050
|
}, hr = _(
|
|
3034
3051
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
@@ -3044,18 +3061,18 @@ const lr = {
|
|
|
3044
3061
|
onClick: a,
|
|
3045
3062
|
ariaLabel: r,
|
|
3046
3063
|
rootRef: i,
|
|
3047
|
-
topRight:
|
|
3048
|
-
bgClassName:
|
|
3064
|
+
topRight: o,
|
|
3065
|
+
bgClassName: l,
|
|
3049
3066
|
"data-testid": d
|
|
3050
3067
|
}) => {
|
|
3051
3068
|
const m = s != null || a != null, g = _(
|
|
3052
3069
|
hr,
|
|
3053
|
-
|
|
3070
|
+
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3054
3071
|
// `focus-ring` is a design-system utility from the component-library
|
|
3055
3072
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
3056
3073
|
// with offset, so keyboard users can see the focused card.
|
|
3057
3074
|
m ? "cursor-pointer no-underline focus-ring" : null
|
|
3058
|
-
), u =
|
|
3075
|
+
), u = o ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: o }) : null;
|
|
3059
3076
|
return s ? /* @__PURE__ */ h(
|
|
3060
3077
|
"a",
|
|
3061
3078
|
{
|
|
@@ -3114,9 +3131,9 @@ const lr = {
|
|
|
3114
3131
|
title: a,
|
|
3115
3132
|
mimeType: r = "image/*",
|
|
3116
3133
|
topLeft: i,
|
|
3117
|
-
topRight:
|
|
3134
|
+
topRight: o
|
|
3118
3135
|
}) => {
|
|
3119
|
-
const
|
|
3136
|
+
const l = ie(r), d = !!s && l === "video";
|
|
3120
3137
|
return ze(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3121
3138
|
"audio",
|
|
3122
3139
|
{
|
|
@@ -3167,25 +3184,25 @@ const lr = {
|
|
|
3167
3184
|
}
|
|
3168
3185
|
),
|
|
3169
3186
|
i ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute left-3 top-3 z-10", children: i }) : null,
|
|
3170
|
-
|
|
3187
|
+
o ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: o }) : null
|
|
3171
3188
|
]
|
|
3172
3189
|
}
|
|
3173
3190
|
);
|
|
3174
|
-
},
|
|
3191
|
+
}, pr = ({
|
|
3175
3192
|
title: e,
|
|
3176
3193
|
placeholderTitle: t,
|
|
3177
3194
|
description: s,
|
|
3178
3195
|
url: a,
|
|
3179
3196
|
mimeType: r,
|
|
3180
3197
|
thumbnailUrl: i,
|
|
3181
|
-
sourceUrl:
|
|
3182
|
-
layout:
|
|
3198
|
+
sourceUrl: o,
|
|
3199
|
+
layout: l = "featured",
|
|
3183
3200
|
appIcon: d,
|
|
3184
3201
|
cta: m,
|
|
3185
3202
|
onDismiss: g,
|
|
3186
3203
|
onEditClick: u
|
|
3187
3204
|
}) => {
|
|
3188
|
-
const f =
|
|
3205
|
+
const f = l === "classic", c = ze(r, o), p = g ? /* @__PURE__ */ n(
|
|
3189
3206
|
"button",
|
|
3190
3207
|
{
|
|
3191
3208
|
type: "button",
|
|
@@ -3209,27 +3226,27 @@ const lr = {
|
|
|
3209
3226
|
De,
|
|
3210
3227
|
{
|
|
3211
3228
|
variant: "dark",
|
|
3212
|
-
sourceUrl:
|
|
3229
|
+
sourceUrl: o,
|
|
3213
3230
|
title: e,
|
|
3214
3231
|
mimeType: r
|
|
3215
3232
|
}
|
|
3216
3233
|
) }),
|
|
3217
|
-
|
|
3234
|
+
p && /* @__PURE__ */ n("div", { className: "shrink-0", children: p })
|
|
3218
3235
|
] }) }) : /* @__PURE__ */ h(
|
|
3219
3236
|
Le,
|
|
3220
3237
|
{
|
|
3221
3238
|
variant: "dark",
|
|
3222
|
-
topRight: f ?
|
|
3239
|
+
topRight: f ? p : void 0,
|
|
3223
3240
|
children: [
|
|
3224
3241
|
!f && /* @__PURE__ */ n(
|
|
3225
3242
|
De,
|
|
3226
3243
|
{
|
|
3227
3244
|
variant: "dark",
|
|
3228
3245
|
thumbnailUrl: i,
|
|
3229
|
-
sourceUrl:
|
|
3246
|
+
sourceUrl: o,
|
|
3230
3247
|
title: e,
|
|
3231
3248
|
mimeType: r,
|
|
3232
|
-
topRight:
|
|
3249
|
+
topRight: p
|
|
3233
3250
|
}
|
|
3234
3251
|
),
|
|
3235
3252
|
/* @__PURE__ */ n(
|
|
@@ -3248,19 +3265,19 @@ const lr = {
|
|
|
3248
3265
|
]
|
|
3249
3266
|
}
|
|
3250
3267
|
);
|
|
3251
|
-
},
|
|
3268
|
+
}, br = ({
|
|
3252
3269
|
title: e,
|
|
3253
3270
|
description: t,
|
|
3254
3271
|
url: s,
|
|
3255
3272
|
mimeType: a,
|
|
3256
3273
|
thumbnailUrl: r,
|
|
3257
3274
|
sourceUrl: i,
|
|
3258
|
-
layout:
|
|
3259
|
-
appIcon:
|
|
3275
|
+
layout: o = "featured",
|
|
3276
|
+
appIcon: l,
|
|
3260
3277
|
cta: d,
|
|
3261
3278
|
onClick: m
|
|
3262
3279
|
}) => {
|
|
3263
|
-
const g = gn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0,
|
|
3280
|
+
const g = gn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, p = ze(a, i) ? it : void 0, N = d && m ? {
|
|
3264
3281
|
...d,
|
|
3265
3282
|
onClick: () => {
|
|
3266
3283
|
var w;
|
|
@@ -3274,10 +3291,10 @@ const lr = {
|
|
|
3274
3291
|
href: f,
|
|
3275
3292
|
onClick: c,
|
|
3276
3293
|
ariaLabel: e ?? "Open attachment preview",
|
|
3277
|
-
bgClassName:
|
|
3294
|
+
bgClassName: p,
|
|
3278
3295
|
"data-testid": "link-attachment",
|
|
3279
3296
|
children: [
|
|
3280
|
-
|
|
3297
|
+
o === "featured" && /* @__PURE__ */ n(
|
|
3281
3298
|
De,
|
|
3282
3299
|
{
|
|
3283
3300
|
variant: "light",
|
|
@@ -3294,7 +3311,7 @@ const lr = {
|
|
|
3294
3311
|
title: e,
|
|
3295
3312
|
description: t,
|
|
3296
3313
|
url: s,
|
|
3297
|
-
appIcon:
|
|
3314
|
+
appIcon: l,
|
|
3298
3315
|
cta: N
|
|
3299
3316
|
}
|
|
3300
3317
|
)
|
|
@@ -3308,27 +3325,27 @@ const lr = {
|
|
|
3308
3325
|
url: a,
|
|
3309
3326
|
mimeType: r,
|
|
3310
3327
|
thumbnailUrl: i,
|
|
3311
|
-
sourceUrl:
|
|
3312
|
-
layout:
|
|
3328
|
+
sourceUrl: o,
|
|
3329
|
+
layout: l = "featured",
|
|
3313
3330
|
appIcon: d,
|
|
3314
3331
|
cta: m,
|
|
3315
3332
|
onClick: g
|
|
3316
3333
|
}) => {
|
|
3317
|
-
const u = gn(r,
|
|
3334
|
+
const u = gn(r, o), f = at(a), c = m == null && f != null && !u ? f : void 0, p = m == null && !u && c != null ? g : void 0;
|
|
3318
3335
|
return /* @__PURE__ */ h(
|
|
3319
3336
|
Le,
|
|
3320
3337
|
{
|
|
3321
3338
|
variant: "dark",
|
|
3322
3339
|
href: c,
|
|
3323
|
-
onClick:
|
|
3324
|
-
bgClassName: ze(r,
|
|
3340
|
+
onClick: p,
|
|
3341
|
+
bgClassName: ze(r, o) ? it : void 0,
|
|
3325
3342
|
children: [
|
|
3326
|
-
|
|
3343
|
+
l === "featured" && /* @__PURE__ */ n(
|
|
3327
3344
|
De,
|
|
3328
3345
|
{
|
|
3329
3346
|
variant: "dark",
|
|
3330
3347
|
thumbnailUrl: i,
|
|
3331
|
-
sourceUrl:
|
|
3348
|
+
sourceUrl: o,
|
|
3332
3349
|
title: e,
|
|
3333
3350
|
mimeType: r
|
|
3334
3351
|
}
|
|
@@ -3349,9 +3366,9 @@ const lr = {
|
|
|
3349
3366
|
}
|
|
3350
3367
|
);
|
|
3351
3368
|
}, Ii = {
|
|
3352
|
-
Composer:
|
|
3369
|
+
Composer: pr,
|
|
3353
3370
|
Sent: vr,
|
|
3354
|
-
Received:
|
|
3371
|
+
Received: br
|
|
3355
3372
|
}, xr = {
|
|
3356
3373
|
dark: "bg-[#121110]",
|
|
3357
3374
|
light: "bg-[#e9eaed]"
|
|
@@ -3374,20 +3391,20 @@ const lr = {
|
|
|
3374
3391
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3375
3392
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3376
3393
|
}
|
|
3377
|
-
},
|
|
3394
|
+
}, ke = ({
|
|
3378
3395
|
variant: e,
|
|
3379
3396
|
text: t,
|
|
3380
3397
|
bordered: s = !0,
|
|
3381
3398
|
groupPosition: a = "single",
|
|
3382
3399
|
className: r,
|
|
3383
3400
|
children: i,
|
|
3384
|
-
"data-testid":
|
|
3401
|
+
"data-testid": o
|
|
3385
3402
|
}) => {
|
|
3386
|
-
const
|
|
3403
|
+
const l = t != null && t !== "", d = yr[_r(e)][a];
|
|
3387
3404
|
return /* @__PURE__ */ h(
|
|
3388
3405
|
"div",
|
|
3389
3406
|
{
|
|
3390
|
-
"data-testid":
|
|
3407
|
+
"data-testid": o,
|
|
3391
3408
|
"data-group-position": a,
|
|
3392
3409
|
className: _(
|
|
3393
3410
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
@@ -3406,7 +3423,7 @@ const lr = {
|
|
|
3406
3423
|
),
|
|
3407
3424
|
children: [
|
|
3408
3425
|
i,
|
|
3409
|
-
|
|
3426
|
+
l ? /* @__PURE__ */ n(
|
|
3410
3427
|
"p",
|
|
3411
3428
|
{
|
|
3412
3429
|
className: _(
|
|
@@ -3426,7 +3443,7 @@ const lr = {
|
|
|
3426
3443
|
]
|
|
3427
3444
|
}
|
|
3428
3445
|
);
|
|
3429
|
-
},
|
|
3446
|
+
}, Ce = ({
|
|
3430
3447
|
onClick: e,
|
|
3431
3448
|
variant: t = "overlay",
|
|
3432
3449
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3448,12 +3465,12 @@ const lr = {
|
|
|
3448
3465
|
firstOfGroup: e,
|
|
3449
3466
|
endOfGroup: t,
|
|
3450
3467
|
groupedByUser: s
|
|
3451
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3468
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", kr = ({
|
|
3452
3469
|
src: e,
|
|
3453
3470
|
mimeType: t,
|
|
3454
3471
|
filename: s,
|
|
3455
3472
|
items: a
|
|
3456
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3473
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Cr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3457
3474
|
/* @__PURE__ */ n(
|
|
3458
3475
|
"audio",
|
|
3459
3476
|
{
|
|
@@ -3465,44 +3482,44 @@ const lr = {
|
|
|
3465
3482
|
}
|
|
3466
3483
|
),
|
|
3467
3484
|
s ?? null
|
|
3468
|
-
] }),
|
|
3485
|
+
] }), lt = ({
|
|
3469
3486
|
state: e,
|
|
3470
3487
|
src: t,
|
|
3471
3488
|
mimeType: s,
|
|
3472
3489
|
filename: a,
|
|
3473
3490
|
items: r,
|
|
3474
3491
|
text: i,
|
|
3475
|
-
groupPosition:
|
|
3476
|
-
preload:
|
|
3492
|
+
groupPosition: o,
|
|
3493
|
+
preload: l,
|
|
3477
3494
|
onDismiss: d
|
|
3478
3495
|
}) => {
|
|
3479
|
-
const m = Ee(e), g = e === "composer" && !!d, u =
|
|
3496
|
+
const m = Ee(e), g = e === "composer" && !!d, u = kr({ src: t, mimeType: s, filename: a, items: r });
|
|
3480
3497
|
if (u.length === 0)
|
|
3481
3498
|
return null;
|
|
3482
|
-
const f =
|
|
3499
|
+
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
3483
3500
|
return /* @__PURE__ */ n(
|
|
3484
|
-
|
|
3501
|
+
ke,
|
|
3485
3502
|
{
|
|
3486
3503
|
variant: m,
|
|
3487
3504
|
text: i,
|
|
3488
|
-
groupPosition:
|
|
3505
|
+
groupPosition: o,
|
|
3489
3506
|
"data-testid": "audio-attachment",
|
|
3490
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3491
|
-
|
|
3507
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, p) => /* @__PURE__ */ n(
|
|
3508
|
+
Cr,
|
|
3492
3509
|
{
|
|
3493
3510
|
item: c,
|
|
3494
3511
|
preload: f,
|
|
3495
3512
|
trailingAction: (
|
|
3496
3513
|
// Composer only supports a single attachment, so the
|
|
3497
3514
|
// dismiss control sits on the only player.
|
|
3498
|
-
g &&
|
|
3515
|
+
g && p === 0 ? /* @__PURE__ */ n(Ce, { onClick: d, variant: "inline" }) : void 0
|
|
3499
3516
|
)
|
|
3500
3517
|
},
|
|
3501
|
-
`${c.src}-${
|
|
3518
|
+
`${c.src}-${p}`
|
|
3502
3519
|
)) })
|
|
3503
3520
|
}
|
|
3504
3521
|
);
|
|
3505
|
-
}, Er = (e) => /* @__PURE__ */ n(
|
|
3522
|
+
}, Er = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Ir = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), Tr = {
|
|
3506
3523
|
Composer: Er,
|
|
3507
3524
|
Sent: Ir,
|
|
3508
3525
|
Received: Sr
|
|
@@ -3559,15 +3576,15 @@ const Dr = {
|
|
|
3559
3576
|
}, zr = {
|
|
3560
3577
|
dark: "text-white/85",
|
|
3561
3578
|
light: "text-black/85"
|
|
3562
|
-
},
|
|
3579
|
+
}, pn = ({
|
|
3563
3580
|
variant: e,
|
|
3564
3581
|
filename: t,
|
|
3565
3582
|
title: s,
|
|
3566
3583
|
mimeType: a = "application/octet-stream",
|
|
3567
3584
|
fileSize: r,
|
|
3568
3585
|
onActivate: i,
|
|
3569
|
-
activateLabel:
|
|
3570
|
-
trailingAction:
|
|
3586
|
+
activateLabel: o,
|
|
3587
|
+
trailingAction: l
|
|
3571
3588
|
}) => {
|
|
3572
3589
|
const d = s ?? t ?? "File", m = Lr(a, t, r), g = /* @__PURE__ */ n(
|
|
3573
3590
|
"div",
|
|
@@ -3599,7 +3616,7 @@ const Dr = {
|
|
|
3599
3616
|
{
|
|
3600
3617
|
type: "button",
|
|
3601
3618
|
onClick: i,
|
|
3602
|
-
"aria-label":
|
|
3619
|
+
"aria-label": o,
|
|
3603
3620
|
className: _(
|
|
3604
3621
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3605
3622
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
@@ -3615,16 +3632,16 @@ const Dr = {
|
|
|
3615
3632
|
] });
|
|
3616
3633
|
return /* @__PURE__ */ h("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
3617
3634
|
f,
|
|
3618
|
-
|
|
3635
|
+
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
3619
3636
|
] });
|
|
3620
3637
|
};
|
|
3621
|
-
async function
|
|
3638
|
+
async function bn(e, t) {
|
|
3622
3639
|
const s = t ?? ae(e);
|
|
3623
3640
|
try {
|
|
3624
3641
|
const a = await fetch(e, { mode: "cors" });
|
|
3625
3642
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
3626
|
-
const r = await a.blob(), i = URL.createObjectURL(r),
|
|
3627
|
-
|
|
3643
|
+
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
3644
|
+
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
3628
3645
|
} catch {
|
|
3629
3646
|
if (!window.open(e, "_blank", "noopener,noreferrer")) {
|
|
3630
3647
|
const r = document.createElement("a");
|
|
@@ -3648,7 +3665,7 @@ const Or = ({
|
|
|
3648
3665
|
}) => {
|
|
3649
3666
|
const i = t.filename ?? ae(t.src);
|
|
3650
3667
|
return /* @__PURE__ */ n(
|
|
3651
|
-
|
|
3668
|
+
pn,
|
|
3652
3669
|
{
|
|
3653
3670
|
variant: e,
|
|
3654
3671
|
filename: i,
|
|
@@ -3660,15 +3677,15 @@ const Or = ({
|
|
|
3660
3677
|
trailingAction: r
|
|
3661
3678
|
}
|
|
3662
3679
|
);
|
|
3663
|
-
},
|
|
3680
|
+
}, ot = ({
|
|
3664
3681
|
state: e,
|
|
3665
3682
|
src: t,
|
|
3666
3683
|
filename: s,
|
|
3667
3684
|
fileSize: a,
|
|
3668
3685
|
mimeType: r,
|
|
3669
3686
|
title: i,
|
|
3670
|
-
items:
|
|
3671
|
-
text:
|
|
3687
|
+
items: o,
|
|
3688
|
+
text: l,
|
|
3672
3689
|
groupPosition: d,
|
|
3673
3690
|
onClick: m,
|
|
3674
3691
|
onDismiss: g
|
|
@@ -3679,13 +3696,13 @@ const Or = ({
|
|
|
3679
3696
|
fileSize: a,
|
|
3680
3697
|
mimeType: r,
|
|
3681
3698
|
title: i,
|
|
3682
|
-
items:
|
|
3683
|
-
}),
|
|
3699
|
+
items: o
|
|
3700
|
+
}), p = (w) => {
|
|
3684
3701
|
if ((m == null ? void 0 : m(w)) === !1) return;
|
|
3685
|
-
const
|
|
3686
|
-
if (!
|
|
3687
|
-
const v =
|
|
3688
|
-
|
|
3702
|
+
const b = c[w];
|
|
3703
|
+
if (!b) return;
|
|
3704
|
+
const v = b.filename ?? ae(b.src);
|
|
3705
|
+
bn(b.src, v);
|
|
3689
3706
|
};
|
|
3690
3707
|
if (c.length === 0)
|
|
3691
3708
|
return null;
|
|
@@ -3701,26 +3718,26 @@ const Or = ({
|
|
|
3701
3718
|
}
|
|
3702
3719
|
);
|
|
3703
3720
|
return /* @__PURE__ */ n(
|
|
3704
|
-
|
|
3721
|
+
ke,
|
|
3705
3722
|
{
|
|
3706
3723
|
variant: u,
|
|
3707
|
-
text:
|
|
3724
|
+
text: l,
|
|
3708
3725
|
groupPosition: d,
|
|
3709
3726
|
"data-testid": "file-attachment",
|
|
3710
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((w,
|
|
3727
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((w, b) => /* @__PURE__ */ n(
|
|
3711
3728
|
$r,
|
|
3712
3729
|
{
|
|
3713
3730
|
variant: u,
|
|
3714
3731
|
item: w,
|
|
3715
|
-
index:
|
|
3716
|
-
onActivate:
|
|
3717
|
-
trailingAction: f &&
|
|
3732
|
+
index: b,
|
|
3733
|
+
onActivate: p,
|
|
3734
|
+
trailingAction: f && b === 0 ? /* @__PURE__ */ n(Ce, { onClick: g, variant: "inline" }) : N
|
|
3718
3735
|
},
|
|
3719
|
-
`${w.src}-${
|
|
3736
|
+
`${w.src}-${b}`
|
|
3720
3737
|
)) })
|
|
3721
3738
|
}
|
|
3722
3739
|
);
|
|
3723
|
-
}, Fr = (e) => /* @__PURE__ */ n(
|
|
3740
|
+
}, Fr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), Br = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), Ur = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), jr = {
|
|
3724
3741
|
Composer: Fr,
|
|
3725
3742
|
Sent: Br,
|
|
3726
3743
|
Received: Ur
|
|
@@ -3757,16 +3774,16 @@ const Or = ({
|
|
|
3757
3774
|
label: a = "Download",
|
|
3758
3775
|
iconOnly: r,
|
|
3759
3776
|
tone: i = "dark",
|
|
3760
|
-
onTriggered:
|
|
3777
|
+
onTriggered: o
|
|
3761
3778
|
}) => {
|
|
3762
|
-
const [
|
|
3779
|
+
const [l, d] = F(!1), m = J(
|
|
3763
3780
|
(c) => {
|
|
3764
|
-
c.stopPropagation(), !
|
|
3781
|
+
c.stopPropagation(), !l && (d(!0), bn(e, t).catch(() => {
|
|
3765
3782
|
}).finally(() => {
|
|
3766
|
-
d(!1),
|
|
3783
|
+
d(!1), o == null || o();
|
|
3767
3784
|
}));
|
|
3768
3785
|
},
|
|
3769
|
-
[
|
|
3786
|
+
[l, e, t, o]
|
|
3770
3787
|
), g = r ?? s !== "pill", f = { className: _(
|
|
3771
3788
|
s === "pill" ? "size-4" : "size-5",
|
|
3772
3789
|
"shrink-0"
|
|
@@ -3776,7 +3793,7 @@ const Or = ({
|
|
|
3776
3793
|
{
|
|
3777
3794
|
type: "button",
|
|
3778
3795
|
onClick: m,
|
|
3779
|
-
disabled:
|
|
3796
|
+
disabled: l,
|
|
3780
3797
|
"aria-label": a,
|
|
3781
3798
|
className: _(
|
|
3782
3799
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
@@ -3785,7 +3802,7 @@ const Or = ({
|
|
|
3785
3802
|
light: "text-black/70 hover:bg-black/[0.08] hover:text-black"
|
|
3786
3803
|
}[i]
|
|
3787
3804
|
),
|
|
3788
|
-
children:
|
|
3805
|
+
children: l ? /* @__PURE__ */ n(
|
|
3789
3806
|
we,
|
|
3790
3807
|
{
|
|
3791
3808
|
className: "size-4 animate-spin",
|
|
@@ -3806,24 +3823,24 @@ const Or = ({
|
|
|
3806
3823
|
{
|
|
3807
3824
|
type: "button",
|
|
3808
3825
|
onClick: m,
|
|
3809
|
-
disabled:
|
|
3826
|
+
disabled: l,
|
|
3810
3827
|
"aria-label": a,
|
|
3811
3828
|
className: "mes-media-viewer__action",
|
|
3812
|
-
children:
|
|
3829
|
+
children: l ? /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(Ne, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3813
3830
|
}
|
|
3814
3831
|
) : /* @__PURE__ */ h(
|
|
3815
3832
|
"button",
|
|
3816
3833
|
{
|
|
3817
3834
|
type: "button",
|
|
3818
3835
|
onClick: m,
|
|
3819
|
-
disabled:
|
|
3836
|
+
disabled: l,
|
|
3820
3837
|
"aria-label": g ? a : void 0,
|
|
3821
3838
|
className: _(
|
|
3822
3839
|
"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
|
|
3823
3840
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3824
3841
|
),
|
|
3825
3842
|
children: [
|
|
3826
|
-
|
|
3843
|
+
l ? /* @__PURE__ */ n(
|
|
3827
3844
|
we,
|
|
3828
3845
|
{
|
|
3829
3846
|
className: "size-4 animate-spin",
|
|
@@ -3846,9 +3863,9 @@ const Or = ({
|
|
|
3846
3863
|
}, [s, t, e]), K(() => {
|
|
3847
3864
|
i((d) => Ve(d, 0, Math.max(e - 1, 0)));
|
|
3848
3865
|
}, [e]);
|
|
3849
|
-
const
|
|
3866
|
+
const o = J(() => {
|
|
3850
3867
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3851
|
-
}, [e]),
|
|
3868
|
+
}, [e]), l = J(() => {
|
|
3852
3869
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3853
3870
|
}, [e]);
|
|
3854
3871
|
return K(() => {
|
|
@@ -3856,10 +3873,10 @@ const Or = ({
|
|
|
3856
3873
|
const d = (m) => {
|
|
3857
3874
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
3858
3875
|
const g = document.activeElement;
|
|
3859
|
-
g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ?
|
|
3876
|
+
g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
|
|
3860
3877
|
};
|
|
3861
3878
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3862
|
-
}, [s, e,
|
|
3879
|
+
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
3863
3880
|
}, ut = ({
|
|
3864
3881
|
open: e,
|
|
3865
3882
|
onClose: t,
|
|
@@ -3867,12 +3884,12 @@ const Or = ({
|
|
|
3867
3884
|
counter: a,
|
|
3868
3885
|
actions: r,
|
|
3869
3886
|
children: i,
|
|
3870
|
-
"data-testid":
|
|
3887
|
+
"data-testid": o
|
|
3871
3888
|
}) => {
|
|
3872
|
-
const
|
|
3889
|
+
const l = Y(null), d = Y(null);
|
|
3873
3890
|
return K(() => {
|
|
3874
3891
|
var f;
|
|
3875
|
-
const u =
|
|
3892
|
+
const u = l.current;
|
|
3876
3893
|
if (u) {
|
|
3877
3894
|
if (e) {
|
|
3878
3895
|
if (!u.open)
|
|
@@ -3918,15 +3935,15 @@ const Or = ({
|
|
|
3918
3935
|
/* @__PURE__ */ h(
|
|
3919
3936
|
"dialog",
|
|
3920
3937
|
{
|
|
3921
|
-
ref:
|
|
3938
|
+
ref: l,
|
|
3922
3939
|
className: "mes-media-viewer",
|
|
3923
3940
|
"aria-label": s ?? "Attachment viewer",
|
|
3924
|
-
"data-testid":
|
|
3941
|
+
"data-testid": o,
|
|
3925
3942
|
onClose: () => {
|
|
3926
3943
|
t();
|
|
3927
3944
|
},
|
|
3928
3945
|
onClick: (u) => {
|
|
3929
|
-
u.target ===
|
|
3946
|
+
u.target === l.current && t();
|
|
3930
3947
|
},
|
|
3931
3948
|
children: [
|
|
3932
3949
|
/* @__PURE__ */ h("div", { className: "mes-media-viewer__chrome", children: [
|
|
@@ -3956,15 +3973,15 @@ const Or = ({
|
|
|
3956
3973
|
initialIndex: s = 0,
|
|
3957
3974
|
onClose: a
|
|
3958
3975
|
}) => {
|
|
3959
|
-
const { index: r, prev: i, next:
|
|
3976
|
+
const { index: r, prev: i, next: o } = dt({
|
|
3960
3977
|
length: t.length,
|
|
3961
3978
|
initialIndex: s,
|
|
3962
3979
|
open: e
|
|
3963
|
-
}),
|
|
3964
|
-
() => (
|
|
3965
|
-
[
|
|
3980
|
+
}), l = t[r], d = re(
|
|
3981
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "image"),
|
|
3982
|
+
[l]
|
|
3966
3983
|
);
|
|
3967
|
-
return
|
|
3984
|
+
return l ? /* @__PURE__ */ h(
|
|
3968
3985
|
ut,
|
|
3969
3986
|
{
|
|
3970
3987
|
open: e,
|
|
@@ -3974,7 +3991,7 @@ const Or = ({
|
|
|
3974
3991
|
actions: /* @__PURE__ */ n(
|
|
3975
3992
|
vn,
|
|
3976
3993
|
{
|
|
3977
|
-
url:
|
|
3994
|
+
url: l.src,
|
|
3978
3995
|
filename: d,
|
|
3979
3996
|
variant: "viewer",
|
|
3980
3997
|
label: `Download ${d}`
|
|
@@ -3985,20 +4002,20 @@ const Or = ({
|
|
|
3985
4002
|
/* @__PURE__ */ n(
|
|
3986
4003
|
"img",
|
|
3987
4004
|
{
|
|
3988
|
-
src:
|
|
3989
|
-
alt:
|
|
4005
|
+
src: l.src,
|
|
4006
|
+
alt: l.alt ?? d,
|
|
3990
4007
|
draggable: !1,
|
|
3991
4008
|
loading: "eager",
|
|
3992
4009
|
decoding: "async",
|
|
3993
4010
|
className: "mes-media-viewer__image"
|
|
3994
4011
|
},
|
|
3995
|
-
`${r}:${
|
|
4012
|
+
`${r}:${l.src}`
|
|
3996
4013
|
),
|
|
3997
4014
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3998
4015
|
ct,
|
|
3999
4016
|
{
|
|
4000
4017
|
onPrev: i,
|
|
4001
|
-
onNext:
|
|
4018
|
+
onNext: o,
|
|
4002
4019
|
prevLabel: "Previous image",
|
|
4003
4020
|
nextLabel: "Next image"
|
|
4004
4021
|
}
|
|
@@ -4014,7 +4031,7 @@ const Or = ({
|
|
|
4014
4031
|
}) => {
|
|
4015
4032
|
const r = e.length;
|
|
4016
4033
|
if (r === 0) return null;
|
|
4017
|
-
const i = e.slice(0, Math.min(r, s)),
|
|
4034
|
+
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
|
|
4018
4035
|
const u = _(Vr, "h-full w-full");
|
|
4019
4036
|
return t ? /* @__PURE__ */ h(
|
|
4020
4037
|
"button",
|
|
@@ -4034,14 +4051,14 @@ const Or = ({
|
|
|
4034
4051
|
g
|
|
4035
4052
|
] }, m);
|
|
4036
4053
|
};
|
|
4037
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className: _("aspect-square w-full", a), children:
|
|
4054
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: _("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
4038
4055
|
"div",
|
|
4039
4056
|
{
|
|
4040
4057
|
className: _(
|
|
4041
4058
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
4042
4059
|
a
|
|
4043
4060
|
),
|
|
4044
|
-
children: i.map((d, m) =>
|
|
4061
|
+
children: i.map((d, m) => l(d, m))
|
|
4045
4062
|
}
|
|
4046
4063
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
4047
4064
|
"div",
|
|
@@ -4051,9 +4068,9 @@ const Or = ({
|
|
|
4051
4068
|
a
|
|
4052
4069
|
),
|
|
4053
4070
|
children: [
|
|
4054
|
-
/* @__PURE__ */ n("div", { className: "row-span-2", children:
|
|
4055
|
-
|
|
4056
|
-
|
|
4071
|
+
/* @__PURE__ */ n("div", { className: "row-span-2", children: l(i[0], 0) }),
|
|
4072
|
+
l(i[1], 1),
|
|
4073
|
+
l(i[2], 2)
|
|
4057
4074
|
]
|
|
4058
4075
|
}
|
|
4059
4076
|
) : /* @__PURE__ */ n(
|
|
@@ -4064,13 +4081,13 @@ const Or = ({
|
|
|
4064
4081
|
a
|
|
4065
4082
|
),
|
|
4066
4083
|
children: i.map((d, m) => {
|
|
4067
|
-
const g =
|
|
4068
|
-
return
|
|
4084
|
+
const g = o > 0 && m === i.length - 1;
|
|
4085
|
+
return l(
|
|
4069
4086
|
d,
|
|
4070
4087
|
m,
|
|
4071
4088
|
g ? /* @__PURE__ */ h("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
4072
4089
|
"+",
|
|
4073
|
-
|
|
4090
|
+
o
|
|
4074
4091
|
] }) : null
|
|
4075
4092
|
);
|
|
4076
4093
|
})
|
|
@@ -4078,12 +4095,12 @@ const Or = ({
|
|
|
4078
4095
|
);
|
|
4079
4096
|
}, Ie = (e) => {
|
|
4080
4097
|
const [t, s] = F(!1), [a, r] = F(0), i = J(
|
|
4081
|
-
(
|
|
4082
|
-
(e == null ? void 0 : e(
|
|
4098
|
+
(l) => {
|
|
4099
|
+
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
4083
4100
|
},
|
|
4084
4101
|
[e]
|
|
4085
|
-
),
|
|
4086
|
-
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer:
|
|
4102
|
+
), o = J(() => s(!1), []);
|
|
4103
|
+
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
4087
4104
|
}, Gr = (e, t, s, a) => ({
|
|
4088
4105
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4089
4106
|
content: /* @__PURE__ */ n(
|
|
@@ -4108,7 +4125,7 @@ const Or = ({
|
|
|
4108
4125
|
alt: s.alt,
|
|
4109
4126
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4110
4127
|
})), Yr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4111
|
-
const { viewerOpen:
|
|
4128
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Ie(
|
|
4112
4129
|
r
|
|
4113
4130
|
);
|
|
4114
4131
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4132,13 +4149,13 @@ const Or = ({
|
|
|
4132
4149
|
)
|
|
4133
4150
|
}
|
|
4134
4151
|
),
|
|
4135
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4152
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: i }) }) : null,
|
|
4136
4153
|
/* @__PURE__ */ n(
|
|
4137
4154
|
xn,
|
|
4138
4155
|
{
|
|
4139
|
-
open:
|
|
4156
|
+
open: o,
|
|
4140
4157
|
items: Nn([{ src: e, alt: t }], s),
|
|
4141
|
-
initialIndex:
|
|
4158
|
+
initialIndex: l,
|
|
4142
4159
|
onClose: m
|
|
4143
4160
|
}
|
|
4144
4161
|
)
|
|
@@ -4150,24 +4167,24 @@ const Or = ({
|
|
|
4150
4167
|
filename: a,
|
|
4151
4168
|
items: r,
|
|
4152
4169
|
text: i,
|
|
4153
|
-
groupPosition:
|
|
4154
|
-
loading:
|
|
4170
|
+
groupPosition: o,
|
|
4171
|
+
loading: l = "lazy",
|
|
4155
4172
|
onClick: d
|
|
4156
4173
|
}) => {
|
|
4157
|
-
const m = Hr({ src: t, alt: s, items: r }), g = Ee(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer:
|
|
4174
|
+
const m = Hr({ src: t, alt: s, items: r }), g = Ee(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: p } = Ie(
|
|
4158
4175
|
d
|
|
4159
4176
|
);
|
|
4160
4177
|
if (m.length === 0)
|
|
4161
4178
|
return null;
|
|
4162
4179
|
const N = m.map(
|
|
4163
|
-
(w,
|
|
4180
|
+
(w, b) => Gr(w, b, m.length, l)
|
|
4164
4181
|
);
|
|
4165
4182
|
return /* @__PURE__ */ h(
|
|
4166
|
-
|
|
4183
|
+
ke,
|
|
4167
4184
|
{
|
|
4168
4185
|
variant: g,
|
|
4169
4186
|
text: i,
|
|
4170
|
-
groupPosition:
|
|
4187
|
+
groupPosition: o,
|
|
4171
4188
|
"data-testid": "image-attachment",
|
|
4172
4189
|
children: [
|
|
4173
4190
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles: N, onTileActivate: c }) }),
|
|
@@ -4177,7 +4194,7 @@ const Or = ({
|
|
|
4177
4194
|
open: u,
|
|
4178
4195
|
items: Nn(m, a),
|
|
4179
4196
|
initialIndex: f,
|
|
4180
|
-
onClose:
|
|
4197
|
+
onClose: p
|
|
4181
4198
|
}
|
|
4182
4199
|
)
|
|
4183
4200
|
]
|
|
@@ -4193,18 +4210,18 @@ const Or = ({
|
|
|
4193
4210
|
initialIndex: s = 0,
|
|
4194
4211
|
onClose: a
|
|
4195
4212
|
}) => {
|
|
4196
|
-
const { index: r, prev: i, next:
|
|
4213
|
+
const { index: r, prev: i, next: o } = dt({
|
|
4197
4214
|
length: t.length,
|
|
4198
4215
|
initialIndex: s,
|
|
4199
4216
|
open: e
|
|
4200
|
-
}),
|
|
4201
|
-
() => (
|
|
4202
|
-
[
|
|
4217
|
+
}), l = t[r], d = re(
|
|
4218
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "document"),
|
|
4219
|
+
[l]
|
|
4203
4220
|
), m = re(
|
|
4204
|
-
() =>
|
|
4205
|
-
[
|
|
4221
|
+
() => l ? Zr(l.src) : void 0,
|
|
4222
|
+
[l]
|
|
4206
4223
|
);
|
|
4207
|
-
return !
|
|
4224
|
+
return !l || !m ? null : /* @__PURE__ */ h(
|
|
4208
4225
|
ut,
|
|
4209
4226
|
{
|
|
4210
4227
|
open: e,
|
|
@@ -4221,13 +4238,13 @@ const Or = ({
|
|
|
4221
4238
|
className: "mes-media-viewer__iframe",
|
|
4222
4239
|
sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
|
|
4223
4240
|
},
|
|
4224
|
-
`${r}:${
|
|
4241
|
+
`${r}:${l.src}`
|
|
4225
4242
|
),
|
|
4226
4243
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4227
4244
|
ct,
|
|
4228
4245
|
{
|
|
4229
4246
|
onPrev: i,
|
|
4230
|
-
onNext:
|
|
4247
|
+
onNext: o,
|
|
4231
4248
|
prevLabel: "Previous document",
|
|
4232
4249
|
nextLabel: "Next document"
|
|
4233
4250
|
}
|
|
@@ -4253,7 +4270,7 @@ const Or = ({
|
|
|
4253
4270
|
}) => {
|
|
4254
4271
|
const i = t.filename ?? ae(t.src);
|
|
4255
4272
|
return /* @__PURE__ */ n(
|
|
4256
|
-
|
|
4273
|
+
pn,
|
|
4257
4274
|
{
|
|
4258
4275
|
variant: e,
|
|
4259
4276
|
filename: i,
|
|
@@ -4272,30 +4289,30 @@ const Or = ({
|
|
|
4272
4289
|
fileSize: a,
|
|
4273
4290
|
title: r,
|
|
4274
4291
|
items: i,
|
|
4275
|
-
text:
|
|
4276
|
-
groupPosition:
|
|
4292
|
+
text: o,
|
|
4293
|
+
groupPosition: l,
|
|
4277
4294
|
onClick: d,
|
|
4278
4295
|
onDismiss: m
|
|
4279
4296
|
}) => {
|
|
4280
|
-
const g = Ee(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate:
|
|
4297
|
+
const g = Ee(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: p, closeViewer: N } = Ie(
|
|
4281
4298
|
d
|
|
4282
4299
|
), w = e === "composer" && !!m;
|
|
4283
4300
|
if (u.length === 0)
|
|
4284
4301
|
return null;
|
|
4285
|
-
const
|
|
4302
|
+
const b = u.map((v) => ({
|
|
4286
4303
|
src: v.src,
|
|
4287
4304
|
filename: v.filename ?? ae(v.src)
|
|
4288
4305
|
}));
|
|
4289
4306
|
return /* @__PURE__ */ h(
|
|
4290
|
-
|
|
4307
|
+
ke,
|
|
4291
4308
|
{
|
|
4292
4309
|
variant: g,
|
|
4293
|
-
text:
|
|
4294
|
-
groupPosition:
|
|
4310
|
+
text: o,
|
|
4311
|
+
groupPosition: l,
|
|
4295
4312
|
"data-testid": "pdf-attachment",
|
|
4296
4313
|
children: [
|
|
4297
4314
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((v, M) => {
|
|
4298
|
-
const T = v.filename ?? ae(v.src), y = w && M === 0 ? /* @__PURE__ */ n(
|
|
4315
|
+
const T = v.filename ?? ae(v.src), y = w && M === 0 ? /* @__PURE__ */ n(Ce, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4299
4316
|
vn,
|
|
4300
4317
|
{
|
|
4301
4318
|
url: v.src,
|
|
@@ -4311,7 +4328,7 @@ const Or = ({
|
|
|
4311
4328
|
variant: g,
|
|
4312
4329
|
item: v,
|
|
4313
4330
|
index: M,
|
|
4314
|
-
onActivate:
|
|
4331
|
+
onActivate: p,
|
|
4315
4332
|
trailingAction: y
|
|
4316
4333
|
},
|
|
4317
4334
|
`${v.src}-${M}`
|
|
@@ -4321,7 +4338,7 @@ const Or = ({
|
|
|
4321
4338
|
Jr,
|
|
4322
4339
|
{
|
|
4323
4340
|
open: f,
|
|
4324
|
-
items:
|
|
4341
|
+
items: b,
|
|
4325
4342
|
initialIndex: c,
|
|
4326
4343
|
onClose: N
|
|
4327
4344
|
}
|
|
@@ -4339,15 +4356,15 @@ const Or = ({
|
|
|
4339
4356
|
initialIndex: s = 0,
|
|
4340
4357
|
onClose: a
|
|
4341
4358
|
}) => {
|
|
4342
|
-
const { index: r, prev: i, next:
|
|
4359
|
+
const { index: r, prev: i, next: o } = dt({
|
|
4343
4360
|
length: t.length,
|
|
4344
4361
|
initialIndex: s,
|
|
4345
4362
|
open: e
|
|
4346
|
-
}),
|
|
4347
|
-
() => (
|
|
4348
|
-
[
|
|
4363
|
+
}), l = t[r], d = re(
|
|
4364
|
+
() => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "video"),
|
|
4365
|
+
[l]
|
|
4349
4366
|
);
|
|
4350
|
-
return
|
|
4367
|
+
return l ? /* @__PURE__ */ h(
|
|
4351
4368
|
ut,
|
|
4352
4369
|
{
|
|
4353
4370
|
open: e,
|
|
@@ -4359,23 +4376,23 @@ const Or = ({
|
|
|
4359
4376
|
/* @__PURE__ */ n(
|
|
4360
4377
|
"video",
|
|
4361
4378
|
{
|
|
4362
|
-
src:
|
|
4363
|
-
poster:
|
|
4379
|
+
src: l.src,
|
|
4380
|
+
poster: l.poster,
|
|
4364
4381
|
controls: !0,
|
|
4365
4382
|
autoPlay: !0,
|
|
4366
4383
|
muted: !0,
|
|
4367
4384
|
playsInline: !0,
|
|
4368
|
-
preload:
|
|
4385
|
+
preload: l.preload ?? "metadata",
|
|
4369
4386
|
className: "mes-media-viewer__video",
|
|
4370
|
-
children:
|
|
4387
|
+
children: l.mimeType ? /* @__PURE__ */ n("source", { src: l.src, type: l.mimeType }) : null
|
|
4371
4388
|
},
|
|
4372
|
-
`${r}:${
|
|
4389
|
+
`${r}:${l.src}`
|
|
4373
4390
|
),
|
|
4374
4391
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4375
4392
|
ct,
|
|
4376
4393
|
{
|
|
4377
4394
|
onPrev: i,
|
|
4378
|
-
onNext:
|
|
4395
|
+
onNext: o,
|
|
4379
4396
|
prevLabel: "Previous video",
|
|
4380
4397
|
nextLabel: "Next video"
|
|
4381
4398
|
}
|
|
@@ -4383,7 +4400,7 @@ const Or = ({
|
|
|
4383
4400
|
]
|
|
4384
4401
|
}
|
|
4385
4402
|
) : null;
|
|
4386
|
-
}, ri = () => /* @__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(He, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }),
|
|
4403
|
+
}, ri = () => /* @__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(He, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), kn = ({
|
|
4387
4404
|
item: e,
|
|
4388
4405
|
index: t
|
|
4389
4406
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4408,21 +4425,21 @@ const Or = ({
|
|
|
4408
4425
|
/* @__PURE__ */ n(ri, {})
|
|
4409
4426
|
] }), ii = (e, t, s) => ({
|
|
4410
4427
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4411
|
-
content: /* @__PURE__ */ n(
|
|
4412
|
-
}),
|
|
4428
|
+
content: /* @__PURE__ */ n(kn, { item: e, index: t })
|
|
4429
|
+
}), li = ({
|
|
4413
4430
|
src: e,
|
|
4414
4431
|
poster: t,
|
|
4415
4432
|
mimeType: s,
|
|
4416
4433
|
preload: a,
|
|
4417
4434
|
items: r
|
|
4418
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
4435
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], Cn = (e, t) => e.map((s, a) => ({
|
|
4419
4436
|
src: s.src,
|
|
4420
4437
|
poster: s.poster,
|
|
4421
4438
|
mimeType: s.mimeType,
|
|
4422
4439
|
preload: s.preload,
|
|
4423
4440
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4424
|
-
})),
|
|
4425
|
-
const { viewerOpen:
|
|
4441
|
+
})), oi = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4442
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = Ie(
|
|
4426
4443
|
i
|
|
4427
4444
|
);
|
|
4428
4445
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4433,15 +4450,15 @@ const Or = ({
|
|
|
4433
4450
|
onClick: () => m(0),
|
|
4434
4451
|
"aria-label": "Play video",
|
|
4435
4452
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
4436
|
-
children: /* @__PURE__ */ n(
|
|
4453
|
+
children: /* @__PURE__ */ n(kn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4437
4454
|
}
|
|
4438
4455
|
),
|
|
4439
|
-
|
|
4456
|
+
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: o }) }) : null,
|
|
4440
4457
|
/* @__PURE__ */ n(
|
|
4441
4458
|
yn,
|
|
4442
4459
|
{
|
|
4443
|
-
open:
|
|
4444
|
-
items:
|
|
4460
|
+
open: l,
|
|
4461
|
+
items: Cn(
|
|
4445
4462
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4446
4463
|
a
|
|
4447
4464
|
),
|
|
@@ -4457,32 +4474,32 @@ const Or = ({
|
|
|
4457
4474
|
mimeType: a,
|
|
4458
4475
|
filename: r,
|
|
4459
4476
|
items: i,
|
|
4460
|
-
text:
|
|
4461
|
-
groupPosition:
|
|
4477
|
+
text: o,
|
|
4478
|
+
groupPosition: l,
|
|
4462
4479
|
preload: d,
|
|
4463
4480
|
onClick: m
|
|
4464
4481
|
}) => {
|
|
4465
|
-
const g =
|
|
4482
|
+
const g = li({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate: p, closeViewer: N } = Ie(
|
|
4466
4483
|
m
|
|
4467
4484
|
);
|
|
4468
4485
|
if (g.length === 0)
|
|
4469
4486
|
return null;
|
|
4470
4487
|
const w = g.map(
|
|
4471
|
-
(
|
|
4488
|
+
(b, v) => ii(b, v, g.length)
|
|
4472
4489
|
);
|
|
4473
4490
|
return /* @__PURE__ */ h(
|
|
4474
|
-
|
|
4491
|
+
ke,
|
|
4475
4492
|
{
|
|
4476
4493
|
variant: u,
|
|
4477
|
-
text:
|
|
4478
|
-
groupPosition:
|
|
4494
|
+
text: o,
|
|
4495
|
+
groupPosition: l,
|
|
4479
4496
|
"data-testid": "video-attachment",
|
|
4480
4497
|
children: [
|
|
4481
4498
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4482
4499
|
wn,
|
|
4483
4500
|
{
|
|
4484
4501
|
tiles: w,
|
|
4485
|
-
onTileActivate:
|
|
4502
|
+
onTileActivate: p,
|
|
4486
4503
|
className: "overflow-hidden rounded-md"
|
|
4487
4504
|
}
|
|
4488
4505
|
) }),
|
|
@@ -4490,7 +4507,7 @@ const Or = ({
|
|
|
4490
4507
|
yn,
|
|
4491
4508
|
{
|
|
4492
4509
|
open: f,
|
|
4493
|
-
items:
|
|
4510
|
+
items: Cn(g, r),
|
|
4494
4511
|
initialIndex: c,
|
|
4495
4512
|
onClose: N
|
|
4496
4513
|
}
|
|
@@ -4498,7 +4515,7 @@ const Or = ({
|
|
|
4498
4515
|
]
|
|
4499
4516
|
}
|
|
4500
4517
|
);
|
|
4501
|
-
}, ci = (e) => /* @__PURE__ */ n(
|
|
4518
|
+
}, ci = (e) => /* @__PURE__ */ n(oi, { ...e }), di = (e) => /* @__PURE__ */ n(En, { ...e, state: "sent" }), ui = (e) => /* @__PURE__ */ n(En, { ...e, state: "received" }), mi = {
|
|
4502
4519
|
Composer: ci,
|
|
4503
4520
|
Sent: di,
|
|
4504
4521
|
Received: ui
|
|
@@ -4537,15 +4554,15 @@ const Or = ({
|
|
|
4537
4554
|
headerText: a,
|
|
4538
4555
|
className: r,
|
|
4539
4556
|
avatarImage: i,
|
|
4540
|
-
avatarName:
|
|
4557
|
+
avatarName: o
|
|
4541
4558
|
}) => {
|
|
4542
|
-
const
|
|
4543
|
-
return
|
|
4544
|
-
(i ||
|
|
4559
|
+
const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4560
|
+
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4561
|
+
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4545
4562
|
ne,
|
|
4546
4563
|
{
|
|
4547
|
-
id:
|
|
4548
|
-
name:
|
|
4564
|
+
id: o || "account",
|
|
4565
|
+
name: o || "Account",
|
|
4549
4566
|
image: i,
|
|
4550
4567
|
size: 24,
|
|
4551
4568
|
shape: "circle"
|
|
@@ -4558,7 +4575,7 @@ const Or = ({
|
|
|
4558
4575
|
style: { backgroundColor: "#F1F0EE" },
|
|
4559
4576
|
children: [
|
|
4560
4577
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4561
|
-
|
|
4578
|
+
l.map((d) => /* @__PURE__ */ n(
|
|
4562
4579
|
hi,
|
|
4563
4580
|
{
|
|
4564
4581
|
question: d.question,
|
|
@@ -4581,16 +4598,16 @@ export {
|
|
|
4581
4598
|
Ai as F,
|
|
4582
4599
|
Ii as L,
|
|
4583
4600
|
yi as M,
|
|
4584
|
-
|
|
4601
|
+
pe as a,
|
|
4585
4602
|
ne as b,
|
|
4586
4603
|
rr as c,
|
|
4587
4604
|
mn as d,
|
|
4588
|
-
|
|
4605
|
+
ki as e,
|
|
4589
4606
|
hi as f,
|
|
4590
4607
|
ie as g,
|
|
4591
4608
|
Bt as h,
|
|
4592
4609
|
Ti as i,
|
|
4593
|
-
|
|
4610
|
+
ka as j,
|
|
4594
4611
|
_i as k,
|
|
4595
4612
|
Ei as l,
|
|
4596
4613
|
Lr as m,
|
|
@@ -4606,6 +4623,6 @@ export {
|
|
|
4606
4623
|
tt as w,
|
|
4607
4624
|
nt as x,
|
|
4608
4625
|
Jt as y,
|
|
4609
|
-
|
|
4626
|
+
Ci as z
|
|
4610
4627
|
};
|
|
4611
|
-
//# sourceMappingURL=index-
|
|
4628
|
+
//# sourceMappingURL=index-BZRzouKv.js.map
|