@linktr.ee/messaging-react 3.5.0 → 3.5.1-rc-1782841580
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-BGF3hZJD.js → Card-AXCr2OyY.js} +3 -3
- package/dist/{Card-BGF3hZJD.js.map → Card-AXCr2OyY.js.map} +1 -1
- package/dist/{Card-BA3RGlVC.cjs → Card-B7P0iKC9.cjs} +2 -2
- package/dist/{Card-BA3RGlVC.cjs.map → Card-B7P0iKC9.cjs.map} +1 -1
- package/dist/{Card-DwuckVx8.cjs → Card-BStyE2rc.cjs} +2 -2
- package/dist/{Card-DwuckVx8.cjs.map → Card-BStyE2rc.cjs.map} +1 -1
- package/dist/{Card-BvekIUnZ.cjs → Card-BU4Hprn2.cjs} +2 -2
- package/dist/{Card-BvekIUnZ.cjs.map → Card-BU4Hprn2.cjs.map} +1 -1
- package/dist/{Card-DBi3Jd7-.js → Card-C818abGJ.js} +2 -2
- package/dist/{Card-DBi3Jd7-.js.map → Card-C818abGJ.js.map} +1 -1
- package/dist/{Card-yaDKMDYI.js → Card-CVeWxBVL.js} +2 -2
- package/dist/{Card-yaDKMDYI.js.map → Card-CVeWxBVL.js.map} +1 -1
- package/dist/{LockedThumbnail-CdfkygLY.js → LockedThumbnail-BV-WJC4T.js} +2 -2
- package/dist/{LockedThumbnail-CdfkygLY.js.map → LockedThumbnail-BV-WJC4T.js.map} +1 -1
- package/dist/{LockedThumbnail-anhR2WjV.cjs → LockedThumbnail-DmFoeTUr.cjs} +2 -2
- package/dist/{LockedThumbnail-anhR2WjV.cjs.map → LockedThumbnail-DmFoeTUr.cjs.map} +1 -1
- package/dist/index-CVgrxxOA.cjs +2 -0
- package/dist/index-CVgrxxOA.cjs.map +1 -0
- package/dist/{index-DmFR1zuQ.js → index-oHV1Drpu.js} +1077 -1057
- package/dist/index-oHV1Drpu.js.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 +5 -3
- package/src/components/ChannelView.tsx +19 -16
- package/src/utils/resolveConversationParticipant.test.ts +61 -0
- package/src/utils/resolveConversationParticipant.ts +41 -0
- package/dist/index-BEQeC48N.cjs +0 -2
- package/dist/index-BEQeC48N.cjs.map +0 -1
- package/dist/index-DmFR1zuQ.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ge, DotsThreeIcon as
|
|
7
|
-
import
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
2
|
+
import j, { createContext as We, useContext as _e, useCallback as X, useState as $, useRef as H, useEffect as q, useId as Sn, useMemo as re, Suspense as Xe } from "react";
|
|
3
|
+
import { StreamChatService as Tn } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as An, LinkPreviewsManager as Dt } from "stream-chat";
|
|
5
|
+
import { Chat as Mn, DateSeparator as Rn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Ln, useMessageReminder as Dn, useComponentContext as Ht, Attachment as Pn, EditMessageModal as zn, MessageBlocked as On, MessageBouncePrompt as $n, MessageDeleted as Fn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as Un, ReminderNotification as jn, StreamedMessageText as Vn, messageHasAttachments as Gn, messageHasReactions as Hn, isDateSeparatorMessage as Yn, isMessageBlocked as qn, isMessageBounced as Wn, MessageBounceModal as Xn, MessageText as Pt, Poll as Kn, MessageErrorIcon as Jn, useMessageContext as ye, useMessageComposer as Zn, useStateStore as Qn, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ns, AttachmentPreviewList as ss, QuotedMessagePreview as as, TextareaComposer as rs, MessageTimestamp as $e, AIStates as Fe, useTypingContext as is, useAIState as ls, Channel as os, WithComponents as cs, Window as ds, MessageList as us, ChannelList as ms, InfiniteScroll as hs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ge, DotsThreeIcon as fs, SpinnerGapIcon as Te, SignOutIcon as gs, ProhibitInsetIcon as zt, FlagIcon as Yt, FileIcon as qt, ImageIcon as ps, SpeakerHighIcon as bs, VideoCameraIcon as Wt, FileMdIcon as vs, FileTextIcon as xs, FileZipIcon as ws, FilePptIcon as Ns, FileCsvIcon as _s, FileXlsIcon as ys, FileDocIcon as ks, FilePdfIcon as Cs, CircleNotchIcon as we, PlayIcon as He, PauseIcon as Es, LinkIcon as Is, DownloadSimpleIcon as Ne, GiftIcon as Ss, ThumbsUpIcon as Ts, ThumbsDownIcon as As, TrashSimpleIcon as Ms, XIcon as Pe, ArrowUpIcon as Rs, SparkleIcon as be, ProhibitIcon as Ls, ArrowLeftIcon as Ot, CaretRightIcon as ve, PencilSimpleIcon as Ds, CaretLeftIcon as Ps } from "@phosphor-icons/react";
|
|
7
|
+
import y from "classnames";
|
|
8
|
+
import { MessageActions as zs, DefaultDropdownActionButton as Xt } from "stream-chat-react/experimental";
|
|
9
|
+
const Kt = We({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const Xt = We({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), Je = () => _e(
|
|
19
|
+
}), Je = () => _e(Kt), Ci = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,8 +24,8 @@ const Xt = We({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var M,
|
|
28
|
-
const l =
|
|
27
|
+
var M, k;
|
|
28
|
+
const l = X(
|
|
29
29
|
(I, ...C) => {
|
|
30
30
|
i && console.log(`🔥 [MessagingProvider] ${I}`, ...C);
|
|
31
31
|
},
|
|
@@ -37,18 +37,18 @@ const Xt = We({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [o, d] = $(null), [u, g] = $(null), [m, f] = $(!1), [c,
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const E =
|
|
40
|
+
const [o, d] = $(null), [u, g] = $(null), [m, f] = $(!1), [c, w] = $(!1), [N, p] = $(null), v = H(!1), b = H(null), S = H(s);
|
|
41
|
+
S.current = s;
|
|
42
|
+
const A = H(i);
|
|
43
|
+
A.current = i;
|
|
44
|
+
const E = H({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
49
|
+
}), L = H(0);
|
|
50
|
+
L.current++, l("📊 RENDER INFO", {
|
|
51
|
+
renderCount: L.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
54
54
|
userChanged: E.current.userId !== (t == null ? void 0 : t.id),
|
|
@@ -62,12 +62,12 @@ const Xt = We({
|
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((M =
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
const I =
|
|
70
|
-
if (!a || !
|
|
65
|
+
const D = H(null);
|
|
66
|
+
a && ((M = D.current) == null ? void 0 : M.apiKey) !== a && (D.current = { apiKey: a, client: new An(a) });
|
|
67
|
+
const R = a ? ((k = D.current) == null ? void 0 : k.client) ?? null : null;
|
|
68
|
+
q(() => {
|
|
69
|
+
const I = L.current, C = S.current;
|
|
70
|
+
if (!a || !R || !C) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: I,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -78,36 +78,36 @@ const Xt = We({
|
|
|
78
78
|
renderCount: I,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
81
|
+
const O = new Tn({
|
|
82
82
|
...C,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
84
|
+
debug: A.current,
|
|
85
|
+
client: R
|
|
86
86
|
});
|
|
87
|
-
|
|
87
|
+
b.current = O, d(O), l("✅ SERVICE SET", {
|
|
88
88
|
renderCount: I,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!O
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
var C,
|
|
91
|
+
}, [a, R]);
|
|
92
|
+
const F = H(null);
|
|
93
|
+
q(() => {
|
|
94
|
+
var C, O;
|
|
95
95
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!o,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: v.current,
|
|
100
100
|
isConnected: m,
|
|
101
101
|
dependencies: { service: !!o, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !o || !t) {
|
|
103
103
|
l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (v.current) {
|
|
107
107
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((C =
|
|
110
|
+
if (((C = F.current) == null ? void 0 : C.serviceId) === o && ((O = F.current) == null ? void 0 : O.userId) === t.id) {
|
|
111
111
|
l(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,35 +115,35 @@ const Xt = We({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
l("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
l("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, w(!0), p(null);
|
|
119
119
|
try {
|
|
120
120
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const P = await o.connectUser(t);
|
|
122
|
+
g(P), f(!0), F.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: P.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
} catch (P) {
|
|
127
|
+
const U = P instanceof Error ? P.message : "Connection failed";
|
|
128
|
+
p(U), l("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: U
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
w(!1), v.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: m
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [o, t, l, m]),
|
|
140
|
-
const I =
|
|
139
|
+
}, [o, t, l, m]), q(() => {
|
|
140
|
+
const I = R;
|
|
141
141
|
return () => {
|
|
142
142
|
var C;
|
|
143
|
-
I && (
|
|
143
|
+
I && (F.current = null, (C = b.current) == null || C.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
146
|
-
const
|
|
145
|
+
}, [R]);
|
|
146
|
+
const z = X(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,21 +151,21 @@ const Xt = We({
|
|
|
151
151
|
l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
154
|
+
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), w(!0);
|
|
155
155
|
try {
|
|
156
156
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
157
157
|
const I = await o.connectUser(t);
|
|
158
|
-
g(I), f(!0),
|
|
158
|
+
g(I), f(!0), p(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
159
|
} catch (I) {
|
|
160
160
|
const C = I instanceof Error ? I.message : "Refresh failed";
|
|
161
|
-
|
|
161
|
+
p(C), l("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
163
|
error: C
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
w(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [o, t, l]), _ =
|
|
168
|
+
}, [o, t, l]), _ = j.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!o,
|
|
170
170
|
hasClient: !!u,
|
|
171
171
|
isConnected: m,
|
|
@@ -179,7 +179,7 @@ const Xt = We({
|
|
|
179
179
|
isLoading: c,
|
|
180
180
|
error: N,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: z,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
o,
|
|
@@ -188,30 +188,30 @@ const Xt = We({
|
|
|
188
188
|
c,
|
|
189
189
|
N,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
z,
|
|
192
192
|
i,
|
|
193
193
|
l
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
197
|
-
willRenderChat: !!
|
|
196
|
+
renderCount: L.current,
|
|
197
|
+
willRenderChat: !!R,
|
|
198
198
|
contextValueReady: !!_
|
|
199
|
-
}), /* @__PURE__ */ n(
|
|
200
|
-
|
|
199
|
+
}), /* @__PURE__ */ n(Kt.Provider, { value: _, children: R ? /* @__PURE__ */ n(
|
|
200
|
+
Mn,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: R,
|
|
203
203
|
customClasses: {
|
|
204
204
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
205
205
|
},
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, Os = () => Je(), Jt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
211
|
const [t, s] = $(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
214
|
+
return q(() => {
|
|
215
215
|
var l;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
@@ -228,18 +228,37 @@ const Xt = We({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
232
|
-
function
|
|
233
|
-
|
|
231
|
+
}, $s = "linktree-official", Fs = "linktree-official-sender";
|
|
232
|
+
function Ze(e, t, s) {
|
|
233
|
+
const a = Object.values(e || {});
|
|
234
|
+
if (s === $s) {
|
|
235
|
+
const r = a.find(
|
|
236
|
+
(i) => {
|
|
237
|
+
var l;
|
|
238
|
+
return ((l = i.user) == null ? void 0 : l.id) === Fs;
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
if (r) return r;
|
|
242
|
+
}
|
|
243
|
+
return a.find(
|
|
244
|
+
(r) => {
|
|
245
|
+
var i;
|
|
246
|
+
return ((i = r.user) == null ? void 0 : i.id) && r.user.id !== t;
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
const Bs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
251
|
+
function Us(e) {
|
|
252
|
+
return Bs.test(e.trim());
|
|
234
253
|
}
|
|
235
|
-
function
|
|
254
|
+
function $t(e, t) {
|
|
236
255
|
const s = e == null ? void 0 : e.trim();
|
|
237
|
-
return !s || t && s === t ? !1 :
|
|
256
|
+
return !s || t && s === t ? !1 : !Us(s);
|
|
238
257
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
258
|
+
function Zt(e) {
|
|
259
|
+
return $t(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : $t(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
241
260
|
}
|
|
242
|
-
const
|
|
261
|
+
const Ft = [
|
|
243
262
|
"🍎",
|
|
244
263
|
// Apple
|
|
245
264
|
"🍌",
|
|
@@ -267,7 +286,7 @@ const $t = [
|
|
|
267
286
|
"🍈"
|
|
268
287
|
// Melon
|
|
269
288
|
];
|
|
270
|
-
function
|
|
289
|
+
function js(e) {
|
|
271
290
|
let t = 0;
|
|
272
291
|
for (let s = 0; s < e.length; s++) {
|
|
273
292
|
const a = e.charCodeAt(s);
|
|
@@ -275,9 +294,9 @@ function Fs(e) {
|
|
|
275
294
|
}
|
|
276
295
|
return Math.abs(t);
|
|
277
296
|
}
|
|
278
|
-
function
|
|
279
|
-
const s =
|
|
280
|
-
return
|
|
297
|
+
function Vs(e) {
|
|
298
|
+
const s = js(e) % Ft.length;
|
|
299
|
+
return Ft[s];
|
|
281
300
|
}
|
|
282
301
|
const ne = ({
|
|
283
302
|
id: e,
|
|
@@ -288,7 +307,7 @@ const ne = ({
|
|
|
288
307
|
shape: i = "squircle",
|
|
289
308
|
dmAgentEnabled: l = !1
|
|
290
309
|
}) => {
|
|
291
|
-
const o =
|
|
310
|
+
const o = Vs(e), u = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, m = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: m, children: t ? /* @__PURE__ */ n(
|
|
292
311
|
"img",
|
|
293
312
|
{
|
|
294
313
|
src: t,
|
|
@@ -299,7 +318,7 @@ const ne = ({
|
|
|
299
318
|
"div",
|
|
300
319
|
{
|
|
301
320
|
"aria-hidden": "true",
|
|
302
|
-
className:
|
|
321
|
+
className: y(
|
|
303
322
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
304
323
|
u
|
|
305
324
|
),
|
|
@@ -309,7 +328,7 @@ const ne = ({
|
|
|
309
328
|
return /* @__PURE__ */ h(
|
|
310
329
|
"div",
|
|
311
330
|
{
|
|
312
|
-
className:
|
|
331
|
+
className: y(
|
|
313
332
|
"relative flex-shrink-0 !bg-transparent",
|
|
314
333
|
a
|
|
315
334
|
),
|
|
@@ -331,7 +350,7 @@ const ne = ({
|
|
|
331
350
|
"div",
|
|
332
351
|
{
|
|
333
352
|
"data-testid": "avatar-ring",
|
|
334
|
-
className:
|
|
353
|
+
className: y(
|
|
335
354
|
"h-full w-full",
|
|
336
355
|
"bg-transparent"
|
|
337
356
|
),
|
|
@@ -350,7 +369,7 @@ const ne = ({
|
|
|
350
369
|
]
|
|
351
370
|
}
|
|
352
371
|
);
|
|
353
|
-
},
|
|
372
|
+
}, Gs = "https://linktr.ee/s/about/trust-center/report", Hs = ({
|
|
354
373
|
channel: e,
|
|
355
374
|
participant: t,
|
|
356
375
|
showBlockParticipant: s = !0,
|
|
@@ -364,77 +383,77 @@ const ne = ({
|
|
|
364
383
|
logLabel: g = "useChannelModerationActions"
|
|
365
384
|
}) => {
|
|
366
385
|
var M;
|
|
367
|
-
const { service: m, debug: f } = Je(), c = (M = t == null ? void 0 : t.user) == null ? void 0 : M.id,
|
|
368
|
-
return
|
|
369
|
-
if (!
|
|
370
|
-
|
|
386
|
+
const { service: m, debug: f } = Je(), c = (M = t == null ? void 0 : t.user) == null ? void 0 : M.id, w = !!(a && s && m && c), [N, p] = $(!1), [v, b] = $(null), [S, A] = $(!1), [E, L] = $(!1), D = w && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== m);
|
|
387
|
+
return q(() => {
|
|
388
|
+
if (!w || !m || !c) {
|
|
389
|
+
p(!1), b(null);
|
|
371
390
|
return;
|
|
372
391
|
}
|
|
373
|
-
let
|
|
392
|
+
let k = !1;
|
|
374
393
|
return (async () => {
|
|
375
394
|
try {
|
|
376
395
|
const I = await m.getBlockedUsers();
|
|
377
|
-
if (
|
|
378
|
-
|
|
396
|
+
if (k) return;
|
|
397
|
+
p(
|
|
379
398
|
I.some(
|
|
380
399
|
(C) => C.blocked_user_id === c
|
|
381
400
|
)
|
|
382
401
|
);
|
|
383
402
|
} catch (I) {
|
|
384
|
-
|
|
403
|
+
k || console.error(`[${g}] Failed to check blocked status:`, I);
|
|
385
404
|
} finally {
|
|
386
|
-
|
|
405
|
+
k || b({ participantId: c, service: m });
|
|
387
406
|
}
|
|
388
407
|
})(), () => {
|
|
389
|
-
|
|
408
|
+
k = !0;
|
|
390
409
|
};
|
|
391
|
-
}, [
|
|
410
|
+
}, [w, m, c, g]), {
|
|
392
411
|
isParticipantBlocked: N,
|
|
393
|
-
isCheckingBlockedStatus:
|
|
394
|
-
isLeaving:
|
|
412
|
+
isCheckingBlockedStatus: D,
|
|
413
|
+
isLeaving: S,
|
|
395
414
|
isUpdatingBlockStatus: E,
|
|
396
415
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
398
|
-
if (!
|
|
399
|
-
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
416
|
+
var k;
|
|
417
|
+
if (!S) {
|
|
418
|
+
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), A(!0);
|
|
400
419
|
try {
|
|
401
|
-
const I = ((
|
|
420
|
+
const I = ((k = e._client) == null ? void 0 : k.userID) ?? null;
|
|
402
421
|
await e.hide(I, !1), r && await r(e), u == null || u();
|
|
403
422
|
} catch (I) {
|
|
404
423
|
console.error(`[${g}] Failed to leave conversation`, I);
|
|
405
424
|
} finally {
|
|
406
|
-
|
|
425
|
+
A(!1);
|
|
407
426
|
}
|
|
408
427
|
}
|
|
409
428
|
},
|
|
410
429
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
430
|
+
var k, I, C;
|
|
412
431
|
if (!(E || !m)) {
|
|
413
|
-
o == null || o(), f && console.log(`[${g}] Block member`, (
|
|
432
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), L(!0);
|
|
414
433
|
try {
|
|
415
434
|
await m.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), u == null || u();
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${g}] Failed to block member`,
|
|
435
|
+
} catch (O) {
|
|
436
|
+
console.error(`[${g}] Failed to block member`, O);
|
|
418
437
|
} finally {
|
|
419
|
-
|
|
438
|
+
L(!1);
|
|
420
439
|
}
|
|
421
440
|
}
|
|
422
441
|
},
|
|
423
442
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
443
|
+
var k, I, C;
|
|
425
444
|
if (!(E || !m)) {
|
|
426
|
-
o == null || o(), f && console.log(`[${g}] Unblock member`, (
|
|
445
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), L(!0);
|
|
427
446
|
try {
|
|
428
447
|
await m.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), u == null || u();
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
448
|
+
} catch (O) {
|
|
449
|
+
console.error(`[${g}] Failed to unblock member`, O);
|
|
431
450
|
} finally {
|
|
432
|
-
|
|
451
|
+
L(!1);
|
|
433
452
|
}
|
|
434
453
|
}
|
|
435
454
|
},
|
|
436
455
|
handleReportUser: () => {
|
|
437
|
-
d == null || d(), u == null || u(), window.open(
|
|
456
|
+
d == null || d(), u == null || u(), window.open(Gs, "_blank", "noopener,noreferrer");
|
|
438
457
|
}
|
|
439
458
|
};
|
|
440
459
|
}, pe = ({
|
|
@@ -446,7 +465,7 @@ const ne = ({
|
|
|
446
465
|
"button",
|
|
447
466
|
{
|
|
448
467
|
type: "button",
|
|
449
|
-
className:
|
|
468
|
+
className: y(
|
|
450
469
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
451
470
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
452
471
|
t
|
|
@@ -454,7 +473,7 @@ const ne = ({
|
|
|
454
473
|
...a,
|
|
455
474
|
children: s
|
|
456
475
|
}
|
|
457
|
-
),
|
|
476
|
+
), Bt = ({
|
|
458
477
|
channel: e,
|
|
459
478
|
participant: t,
|
|
460
479
|
showDeleteConversation: s = !0,
|
|
@@ -468,16 +487,16 @@ const ne = ({
|
|
|
468
487
|
customChannelActions: g,
|
|
469
488
|
triggerClassName: m
|
|
470
489
|
}) => {
|
|
471
|
-
const [f, c] = $(!1),
|
|
472
|
-
isParticipantBlocked:
|
|
473
|
-
isCheckingBlockedStatus:
|
|
474
|
-
isLeaving:
|
|
475
|
-
isUpdatingBlockStatus:
|
|
490
|
+
const [f, c] = $(!1), w = H(null), N = Sn(), p = X(() => c(!1), []), {
|
|
491
|
+
isParticipantBlocked: v,
|
|
492
|
+
isCheckingBlockedStatus: b,
|
|
493
|
+
isLeaving: S,
|
|
494
|
+
isUpdatingBlockStatus: A,
|
|
476
495
|
handleLeaveConversation: E,
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
479
|
-
handleReportUser:
|
|
480
|
-
} =
|
|
496
|
+
handleBlockUser: L,
|
|
497
|
+
handleUnblockUser: D,
|
|
498
|
+
handleReportUser: R
|
|
499
|
+
} = Hs({
|
|
481
500
|
channel: e,
|
|
482
501
|
participant: t,
|
|
483
502
|
showBlockParticipant: a,
|
|
@@ -487,20 +506,20 @@ const ne = ({
|
|
|
487
506
|
onDeleteConversationClick: o,
|
|
488
507
|
onBlockParticipantClick: d,
|
|
489
508
|
onReportParticipantClick: u,
|
|
490
|
-
onActionComplete:
|
|
509
|
+
onActionComplete: p,
|
|
491
510
|
logLabel: "ChannelActionsMenu"
|
|
492
511
|
});
|
|
493
|
-
return
|
|
512
|
+
return q(() => {
|
|
494
513
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
|
|
514
|
+
const z = (M) => {
|
|
515
|
+
w.current && !w.current.contains(M.target) && c(!1);
|
|
497
516
|
}, _ = (M) => {
|
|
498
517
|
M.key === "Escape" && c(!1);
|
|
499
518
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
519
|
+
return document.addEventListener("mousedown", z), document.addEventListener("keydown", _), () => {
|
|
520
|
+
document.removeEventListener("mousedown", z), document.removeEventListener("keydown", _);
|
|
502
521
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
522
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: w, className: "relative", children: [
|
|
504
523
|
/* @__PURE__ */ h(
|
|
505
524
|
"button",
|
|
506
525
|
{
|
|
@@ -509,9 +528,9 @@ const ne = ({
|
|
|
509
528
|
"aria-haspopup": "true",
|
|
510
529
|
"aria-expanded": f,
|
|
511
530
|
"aria-controls": f ? N : void 0,
|
|
512
|
-
onClick: () => c((
|
|
531
|
+
onClick: () => c((z) => !z),
|
|
513
532
|
children: [
|
|
514
|
-
/* @__PURE__ */ n(
|
|
533
|
+
/* @__PURE__ */ n(fs, { className: "size-5 text-black/90" }),
|
|
515
534
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
516
535
|
]
|
|
517
536
|
}
|
|
@@ -521,7 +540,7 @@ const ne = ({
|
|
|
521
540
|
{
|
|
522
541
|
id: N,
|
|
523
542
|
"aria-label": "Conversation options",
|
|
524
|
-
className:
|
|
543
|
+
className: y(
|
|
525
544
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
526
545
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
527
546
|
),
|
|
@@ -530,46 +549,46 @@ const ne = ({
|
|
|
530
549
|
pe,
|
|
531
550
|
{
|
|
532
551
|
onClick: E,
|
|
533
|
-
disabled:
|
|
534
|
-
"aria-busy":
|
|
552
|
+
disabled: S,
|
|
553
|
+
"aria-busy": S,
|
|
535
554
|
children: [
|
|
536
|
-
|
|
555
|
+
S ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(gs, { className: "h-5 w-5" }),
|
|
537
556
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
538
557
|
]
|
|
539
558
|
}
|
|
540
559
|
) }),
|
|
541
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
560
|
+
a && /* @__PURE__ */ n("li", { children: b ? (
|
|
542
561
|
// Block status not yet resolved — show a disabled placeholder
|
|
543
562
|
// so a premature click can't act on a stale block state.
|
|
544
563
|
/* @__PURE__ */ h(pe, { disabled: !0, "aria-busy": !0, children: [
|
|
545
564
|
/* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }),
|
|
546
565
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
566
|
] })
|
|
548
|
-
) :
|
|
567
|
+
) : v ? /* @__PURE__ */ h(
|
|
549
568
|
pe,
|
|
550
569
|
{
|
|
551
|
-
onClick:
|
|
552
|
-
disabled:
|
|
553
|
-
"aria-busy":
|
|
570
|
+
onClick: D,
|
|
571
|
+
disabled: A,
|
|
572
|
+
"aria-busy": A,
|
|
554
573
|
children: [
|
|
555
|
-
|
|
574
|
+
A ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(zt, { className: "h-5 w-5" }),
|
|
556
575
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
576
|
]
|
|
558
577
|
}
|
|
559
578
|
) : /* @__PURE__ */ h(
|
|
560
579
|
pe,
|
|
561
580
|
{
|
|
562
|
-
onClick:
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
581
|
+
onClick: L,
|
|
582
|
+
disabled: A,
|
|
583
|
+
"aria-busy": A,
|
|
565
584
|
children: [
|
|
566
|
-
|
|
585
|
+
A ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(zt, { className: "h-5 w-5" }),
|
|
567
586
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
568
587
|
]
|
|
569
588
|
}
|
|
570
589
|
) }),
|
|
571
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(pe, { variant: "danger", onClick:
|
|
572
|
-
/* @__PURE__ */ n(
|
|
590
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(pe, { variant: "danger", onClick: R, children: [
|
|
591
|
+
/* @__PURE__ */ n(Yt, { className: "h-5 w-5" }),
|
|
573
592
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
593
|
] }) }),
|
|
575
594
|
g
|
|
@@ -577,15 +596,15 @@ const ne = ({
|
|
|
577
596
|
}
|
|
578
597
|
)
|
|
579
598
|
] });
|
|
580
|
-
},
|
|
581
|
-
function
|
|
599
|
+
}, Ys = (e) => /* @__PURE__ */ n(Rn, { ...e, position: "center" }), Ye = "vote_up", qe = "vote_down";
|
|
600
|
+
function qs(e) {
|
|
582
601
|
return e != null && e.length ? e.some((t) => t.type === qe) ? "down" : e.some((t) => t.type === Ye) ? "up" : null : null;
|
|
583
602
|
}
|
|
584
|
-
function
|
|
603
|
+
function Ws(e) {
|
|
585
604
|
const { channel: t } = de(), { client: s } = Ke("useMessageVote"), a = re(
|
|
586
|
-
() =>
|
|
605
|
+
() => qs(e.own_reactions),
|
|
587
606
|
[e.own_reactions]
|
|
588
|
-
), r =
|
|
607
|
+
), r = X(async () => {
|
|
589
608
|
if (s != null && s.userID)
|
|
590
609
|
try {
|
|
591
610
|
a === "up" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
|
|
@@ -595,7 +614,7 @@ function Hs(e) {
|
|
|
595
614
|
);
|
|
596
615
|
} catch {
|
|
597
616
|
}
|
|
598
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
617
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = X(async () => {
|
|
599
618
|
if (s != null && s.userID)
|
|
600
619
|
try {
|
|
601
620
|
a === "down" ? await t.deleteReaction(e.id, qe) : await t.sendReaction(
|
|
@@ -608,24 +627,24 @@ function Hs(e) {
|
|
|
608
627
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
609
628
|
return { selected: a, voteUp: r, voteDown: i };
|
|
610
629
|
}
|
|
611
|
-
function
|
|
630
|
+
function Xs(e) {
|
|
612
631
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
613
632
|
}
|
|
614
|
-
function
|
|
633
|
+
function Qt({
|
|
615
634
|
message: e,
|
|
616
635
|
viewerLanguage: t
|
|
617
636
|
}) {
|
|
618
637
|
var r;
|
|
619
|
-
const s = e == null ? void 0 : e.text, a =
|
|
638
|
+
const s = e == null ? void 0 : e.text, a = Xs(t);
|
|
620
639
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
640
|
}
|
|
622
|
-
const
|
|
641
|
+
const Ks = j.lazy(() => import("./Card-C818abGJ.js")), Js = j.lazy(() => import("./Card-CVeWxBVL.js")), Zs = j.lazy(() => import("./Card-AXCr2OyY.js")), Qe = () => /* @__PURE__ */ n(
|
|
623
642
|
"div",
|
|
624
643
|
{
|
|
625
644
|
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)]",
|
|
626
645
|
"aria-hidden": !0
|
|
627
646
|
}
|
|
628
|
-
),
|
|
647
|
+
), Qs = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Qe, {}), children: /* @__PURE__ */ n(Ks, { ...e }) }), en = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Qe, {}), children: /* @__PURE__ */ n(Js, { ...e }) }), tn = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Qe, {}), children: /* @__PURE__ */ n(Zs, { ...e }) }), ea = en, ta = tn, Ut = { Composer: Qs, Sent: en, Received: tn, Creator: ea, Visitor: ta }, na = [
|
|
629
648
|
[/pdf/, "pdf"],
|
|
630
649
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
631
650
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -638,39 +657,39 @@ const qs = V.lazy(() => import("./Card-DBi3Jd7-.js")), Ws = V.lazy(() => import(
|
|
|
638
657
|
function ie(e) {
|
|
639
658
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
640
659
|
}
|
|
641
|
-
function
|
|
642
|
-
const t =
|
|
660
|
+
function nn(e) {
|
|
661
|
+
const t = na.find(
|
|
643
662
|
([s]) => s.test(e)
|
|
644
663
|
);
|
|
645
664
|
return t ? t[1] : "generic";
|
|
646
665
|
}
|
|
647
|
-
const
|
|
648
|
-
video:
|
|
649
|
-
audio:
|
|
650
|
-
image:
|
|
651
|
-
document:
|
|
652
|
-
},
|
|
653
|
-
pdf:
|
|
654
|
-
doc:
|
|
655
|
-
xls:
|
|
656
|
-
csv:
|
|
657
|
-
ppt:
|
|
658
|
-
zip:
|
|
659
|
-
text:
|
|
660
|
-
markdown:
|
|
661
|
-
generic:
|
|
666
|
+
const sa = {
|
|
667
|
+
video: Wt,
|
|
668
|
+
audio: bs,
|
|
669
|
+
image: ps,
|
|
670
|
+
document: qt
|
|
671
|
+
}, aa = {
|
|
672
|
+
pdf: Cs,
|
|
673
|
+
doc: ks,
|
|
674
|
+
xls: ys,
|
|
675
|
+
csv: _s,
|
|
676
|
+
ppt: Ns,
|
|
677
|
+
zip: ws,
|
|
678
|
+
text: xs,
|
|
679
|
+
markdown: vs,
|
|
680
|
+
generic: qt
|
|
662
681
|
};
|
|
663
|
-
function
|
|
682
|
+
function ra(e) {
|
|
664
683
|
const t = ie(e);
|
|
665
|
-
return t !== "document" ?
|
|
684
|
+
return t !== "document" ? sa[t] : aa[nn(e)];
|
|
666
685
|
}
|
|
667
686
|
function ce(e, t) {
|
|
668
|
-
return
|
|
687
|
+
return j.createElement(ra(e), t);
|
|
669
688
|
}
|
|
670
|
-
const
|
|
689
|
+
const ia = (e) => {
|
|
671
690
|
var t, s;
|
|
672
691
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
|
|
673
|
-
},
|
|
692
|
+
}, la = ({
|
|
674
693
|
source: e,
|
|
675
694
|
mimeType: t,
|
|
676
695
|
poster: s,
|
|
@@ -682,66 +701,66 @@ const sa = (e) => {
|
|
|
682
701
|
muted: d = !1,
|
|
683
702
|
onContainerClick: u
|
|
684
703
|
}) => {
|
|
685
|
-
const g = ie(t), m =
|
|
686
|
-
|
|
687
|
-
}, []),
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const
|
|
704
|
+
const g = ie(t), m = H(null), f = H(null), c = H(null), w = H(r), [N, p] = $(a), [v, b] = $(0), [S, A] = $(!1), [E, L] = $(!1), [D, R] = $(!1), [F, z] = $(!1), [_, M] = $(!0), [k, I] = $(null), C = X(() => {
|
|
705
|
+
R(!1), p(!0);
|
|
706
|
+
}, []), O = X((x) => {
|
|
707
|
+
const T = f.current;
|
|
708
|
+
if (!T) return 0;
|
|
709
|
+
const B = T.getBoundingClientRect();
|
|
691
710
|
return Math.max(
|
|
692
711
|
0,
|
|
693
|
-
Math.min(1, (
|
|
712
|
+
Math.min(1, (ia(x) - B.left) / B.width)
|
|
694
713
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
699
|
-
x.stopPropagation(),
|
|
700
|
-
const
|
|
701
|
-
|
|
714
|
+
}, []), P = X((x) => {
|
|
715
|
+
const T = m.current;
|
|
716
|
+
T && T.duration && (T.currentTime = x * T.duration);
|
|
717
|
+
}, []), U = (x) => {
|
|
718
|
+
x.stopPropagation(), A(!0);
|
|
719
|
+
const T = O(x);
|
|
720
|
+
b(T), P(T);
|
|
702
721
|
};
|
|
703
|
-
|
|
704
|
-
r !== void 0 && r !==
|
|
705
|
-
}, [r]),
|
|
722
|
+
q(() => {
|
|
723
|
+
r !== void 0 && r !== w.current && (w.current = r, p(r));
|
|
724
|
+
}, [r]), q(() => {
|
|
706
725
|
if (!N) {
|
|
707
726
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
727
|
return;
|
|
709
728
|
}
|
|
710
729
|
const x = () => {
|
|
711
|
-
const
|
|
712
|
-
|
|
730
|
+
const T = m.current;
|
|
731
|
+
T && T.duration && !S && b(T.currentTime / T.duration), c.current = requestAnimationFrame(x);
|
|
713
732
|
};
|
|
714
733
|
return c.current = requestAnimationFrame(x), () => {
|
|
715
734
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
735
|
};
|
|
717
|
-
}, [N,
|
|
736
|
+
}, [N, S]), q(() => {
|
|
718
737
|
const x = m.current;
|
|
719
|
-
x && (N ? x.play().catch((
|
|
720
|
-
|
|
738
|
+
x && (N ? x.play().catch((T) => {
|
|
739
|
+
p(!1), R(!0);
|
|
721
740
|
}) : x.pause());
|
|
722
|
-
}, [N]),
|
|
723
|
-
if (!
|
|
724
|
-
const x = (
|
|
725
|
-
|
|
741
|
+
}, [N]), q(() => {
|
|
742
|
+
if (!S) return;
|
|
743
|
+
const x = (B) => b(O(B)), T = (B) => {
|
|
744
|
+
A(!1), P(O(B));
|
|
726
745
|
};
|
|
727
|
-
return window.addEventListener("mousemove", x), window.addEventListener("mouseup",
|
|
728
|
-
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup",
|
|
746
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", T), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", T), () => {
|
|
747
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", T), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", T);
|
|
729
748
|
};
|
|
730
|
-
}, [
|
|
731
|
-
const
|
|
749
|
+
}, [S, O, P]);
|
|
750
|
+
const W = k ? { aspectRatio: String(k) } : void 0, ee = k ? "" : " aspect-video", Y = Math.round(v * 100);
|
|
732
751
|
return /* @__PURE__ */ h(
|
|
733
752
|
"div",
|
|
734
753
|
{
|
|
735
754
|
role: "button",
|
|
736
755
|
tabIndex: 0,
|
|
737
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
738
|
-
style:
|
|
756
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${ee}`,
|
|
757
|
+
style: W,
|
|
739
758
|
onClick: (x) => {
|
|
740
759
|
if (u) {
|
|
741
760
|
u(x);
|
|
742
761
|
return;
|
|
743
762
|
}
|
|
744
|
-
|
|
763
|
+
D || l && p((T) => !T);
|
|
745
764
|
},
|
|
746
765
|
onKeyDown: (x) => {
|
|
747
766
|
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
@@ -749,7 +768,7 @@ const sa = (e) => {
|
|
|
749
768
|
u(x);
|
|
750
769
|
return;
|
|
751
770
|
}
|
|
752
|
-
|
|
771
|
+
D || l && p((T) => !T);
|
|
753
772
|
}
|
|
754
773
|
},
|
|
755
774
|
children: [
|
|
@@ -773,14 +792,14 @@ const sa = (e) => {
|
|
|
773
792
|
loop: i,
|
|
774
793
|
muted: d,
|
|
775
794
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
795
|
+
onLoadStart: () => z(!0),
|
|
777
796
|
onCanPlay: () => {
|
|
778
|
-
|
|
797
|
+
z(!1), M(!1);
|
|
779
798
|
},
|
|
780
|
-
onWaiting: () =>
|
|
781
|
-
onPlay: () =>
|
|
799
|
+
onWaiting: () => z(!0),
|
|
800
|
+
onPlay: () => R(!1),
|
|
782
801
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
802
|
+
i || (p(!1), b(0));
|
|
784
803
|
},
|
|
785
804
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
786
805
|
}
|
|
@@ -793,30 +812,30 @@ const sa = (e) => {
|
|
|
793
812
|
muted: d,
|
|
794
813
|
playsInline: !0,
|
|
795
814
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
815
|
+
onLoadStart: () => z(!0),
|
|
797
816
|
onCanPlay: () => {
|
|
798
|
-
|
|
817
|
+
z(!1), M(!1);
|
|
799
818
|
},
|
|
800
|
-
onWaiting: () =>
|
|
801
|
-
onPlay: () =>
|
|
819
|
+
onWaiting: () => z(!0),
|
|
820
|
+
onPlay: () => R(!1),
|
|
802
821
|
onLoadedMetadata: () => {
|
|
803
822
|
const x = m.current;
|
|
804
823
|
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && I(x.videoWidth / x.videoHeight);
|
|
805
824
|
},
|
|
806
825
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
826
|
+
i || (p(!1), b(0));
|
|
808
827
|
},
|
|
809
828
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
829
|
}
|
|
811
830
|
) }),
|
|
812
|
-
|
|
831
|
+
F && !D && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
832
|
we,
|
|
814
833
|
{
|
|
815
834
|
className: "size-8 animate-spin text-white/80",
|
|
816
835
|
weight: "bold"
|
|
817
836
|
}
|
|
818
837
|
) }),
|
|
819
|
-
|
|
838
|
+
D && !l && /* @__PURE__ */ n(
|
|
820
839
|
"div",
|
|
821
840
|
{
|
|
822
841
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -837,23 +856,23 @@ const sa = (e) => {
|
|
|
837
856
|
{
|
|
838
857
|
role: "slider",
|
|
839
858
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
859
|
+
"aria-valuenow": Y,
|
|
841
860
|
"aria-valuemin": 0,
|
|
842
861
|
"aria-valuemax": 100,
|
|
843
862
|
tabIndex: 0,
|
|
844
863
|
ref: f,
|
|
845
864
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
|
-
onMouseDown:
|
|
847
|
-
onTouchStart:
|
|
865
|
+
onMouseDown: U,
|
|
866
|
+
onTouchStart: U,
|
|
848
867
|
onClick: (x) => x.stopPropagation(),
|
|
849
868
|
onKeyDown: (x) => {
|
|
850
|
-
x.key === "ArrowRight" &&
|
|
869
|
+
x.key === "ArrowRight" && P(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, v - 0.05));
|
|
851
870
|
},
|
|
852
871
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
872
|
"div",
|
|
854
873
|
{
|
|
855
874
|
className: "h-full rounded-full bg-white",
|
|
856
|
-
style: { width: `${
|
|
875
|
+
style: { width: `${Y}%` }
|
|
857
876
|
}
|
|
858
877
|
) })
|
|
859
878
|
}
|
|
@@ -864,11 +883,11 @@ const sa = (e) => {
|
|
|
864
883
|
{
|
|
865
884
|
type: "button",
|
|
866
885
|
onClick: (x) => {
|
|
867
|
-
x.stopPropagation(),
|
|
886
|
+
x.stopPropagation(), p((T) => !T);
|
|
868
887
|
},
|
|
869
888
|
className: "shrink-0 text-white",
|
|
870
889
|
"aria-label": N ? "Pause" : "Play",
|
|
871
|
-
children: N ? /* @__PURE__ */ n(
|
|
890
|
+
children: N ? /* @__PURE__ */ n(Es, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(He, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
891
|
}
|
|
873
892
|
),
|
|
874
893
|
/* @__PURE__ */ h(
|
|
@@ -876,30 +895,30 @@ const sa = (e) => {
|
|
|
876
895
|
{
|
|
877
896
|
role: "slider",
|
|
878
897
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
898
|
+
"aria-valuenow": Y,
|
|
880
899
|
"aria-valuemin": 0,
|
|
881
900
|
"aria-valuemax": 100,
|
|
882
901
|
tabIndex: 0,
|
|
883
902
|
ref: f,
|
|
884
903
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
|
-
onMouseDown:
|
|
886
|
-
onTouchStart:
|
|
904
|
+
onMouseDown: U,
|
|
905
|
+
onTouchStart: U,
|
|
887
906
|
onClick: (x) => x.stopPropagation(),
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
907
|
+
onMouseEnter: () => L(!0),
|
|
908
|
+
onMouseLeave: () => L(!1),
|
|
890
909
|
onKeyDown: (x) => {
|
|
891
|
-
x.key === "ArrowRight" &&
|
|
910
|
+
x.key === "ArrowRight" && P(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, v - 0.05));
|
|
892
911
|
},
|
|
893
912
|
children: [
|
|
894
913
|
/* @__PURE__ */ n(
|
|
895
914
|
"div",
|
|
896
915
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${E ||
|
|
916
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${E || S ? "h-1.5" : "h-1"}`,
|
|
898
917
|
children: /* @__PURE__ */ n(
|
|
899
918
|
"div",
|
|
900
919
|
{
|
|
901
920
|
className: "h-full rounded-full bg-white",
|
|
902
|
-
style: { width: `${
|
|
921
|
+
style: { width: `${Y}%` }
|
|
903
922
|
}
|
|
904
923
|
)
|
|
905
924
|
}
|
|
@@ -907,8 +926,8 @@ const sa = (e) => {
|
|
|
907
926
|
/* @__PURE__ */ n(
|
|
908
927
|
"div",
|
|
909
928
|
{
|
|
910
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${E ||
|
|
911
|
-
style: { left: `${
|
|
929
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${E || S ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
930
|
+
style: { left: `${Y}%` }
|
|
912
931
|
}
|
|
913
932
|
)
|
|
914
933
|
]
|
|
@@ -918,7 +937,7 @@ const sa = (e) => {
|
|
|
918
937
|
]
|
|
919
938
|
}
|
|
920
939
|
);
|
|
921
|
-
},
|
|
940
|
+
}, jt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", oa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", sn = ({
|
|
922
941
|
mimeType: e,
|
|
923
942
|
sourceUrl: t,
|
|
924
943
|
thumbnailUrl: s,
|
|
@@ -929,7 +948,7 @@ const sa = (e) => {
|
|
|
929
948
|
}) => {
|
|
930
949
|
const o = ie(e), [d, u] = $(!1);
|
|
931
950
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
|
|
932
|
-
|
|
951
|
+
la,
|
|
933
952
|
{
|
|
934
953
|
source: t,
|
|
935
954
|
mimeType: e,
|
|
@@ -976,11 +995,11 @@ const sa = (e) => {
|
|
|
976
995
|
{
|
|
977
996
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
978
997
|
children: ce(e, {
|
|
979
|
-
className:
|
|
998
|
+
className: jt(r),
|
|
980
999
|
weight: "regular"
|
|
981
1000
|
})
|
|
982
1001
|
}
|
|
983
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
1002
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${oa(r)}`, children: /* @__PURE__ */ n(
|
|
984
1003
|
"img",
|
|
985
1004
|
{
|
|
986
1005
|
src: s,
|
|
@@ -993,12 +1012,12 @@ const sa = (e) => {
|
|
|
993
1012
|
{
|
|
994
1013
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
1014
|
children: ce(e, {
|
|
996
|
-
className:
|
|
1015
|
+
className: jt(r),
|
|
997
1016
|
weight: "regular"
|
|
998
1017
|
})
|
|
999
1018
|
}
|
|
1000
1019
|
);
|
|
1001
|
-
},
|
|
1020
|
+
}, an = ({
|
|
1002
1021
|
variant: e,
|
|
1003
1022
|
thumbnail: t,
|
|
1004
1023
|
title: s,
|
|
@@ -1012,13 +1031,13 @@ const sa = (e) => {
|
|
|
1012
1031
|
rootRef: g,
|
|
1013
1032
|
"data-testid": m
|
|
1014
1033
|
}) => {
|
|
1015
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1034
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", w = f && !s;
|
|
1016
1035
|
return /* @__PURE__ */ h(
|
|
1017
1036
|
"div",
|
|
1018
1037
|
{
|
|
1019
1038
|
ref: g,
|
|
1020
1039
|
"data-testid": m,
|
|
1021
|
-
className:
|
|
1040
|
+
className: y(
|
|
1022
1041
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
1023
1042
|
f ? "bg-[#121110]" : "bg-white"
|
|
1024
1043
|
),
|
|
@@ -1030,17 +1049,17 @@ const sa = (e) => {
|
|
|
1030
1049
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1031
1050
|
"p",
|
|
1032
1051
|
{
|
|
1033
|
-
className:
|
|
1052
|
+
className: y("mb-0.5 truncate text-base font-medium", {
|
|
1034
1053
|
"text-black": !f,
|
|
1035
|
-
"text-white/30": f &&
|
|
1036
|
-
"text-white": f && !
|
|
1054
|
+
"text-white/30": f && w,
|
|
1055
|
+
"text-white": f && !w
|
|
1037
1056
|
}),
|
|
1038
1057
|
children: c
|
|
1039
1058
|
}
|
|
1040
1059
|
),
|
|
1041
1060
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
1061
|
ce(r, {
|
|
1043
|
-
className:
|
|
1062
|
+
className: y(
|
|
1044
1063
|
"size-5 shrink-0",
|
|
1045
1064
|
f ? "text-white/55" : "text-black/55"
|
|
1046
1065
|
),
|
|
@@ -1049,7 +1068,7 @@ const sa = (e) => {
|
|
|
1049
1068
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1050
1069
|
"span",
|
|
1051
1070
|
{
|
|
1052
|
-
className:
|
|
1071
|
+
className: y(
|
|
1053
1072
|
"text-xs font-medium",
|
|
1054
1073
|
f ? "text-white/55" : "text-black/55"
|
|
1055
1074
|
),
|
|
@@ -1064,29 +1083,29 @@ const sa = (e) => {
|
|
|
1064
1083
|
}
|
|
1065
1084
|
);
|
|
1066
1085
|
};
|
|
1067
|
-
function
|
|
1086
|
+
function rn(e) {
|
|
1068
1087
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1069
1088
|
}
|
|
1070
|
-
function
|
|
1089
|
+
function et(e) {
|
|
1071
1090
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1072
1091
|
}
|
|
1073
|
-
function
|
|
1092
|
+
function ca(e) {
|
|
1074
1093
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1075
1094
|
}
|
|
1076
|
-
function
|
|
1095
|
+
function da(e) {
|
|
1077
1096
|
return e ? "text-white" : "text-black";
|
|
1078
1097
|
}
|
|
1079
|
-
function
|
|
1098
|
+
function ua(e) {
|
|
1080
1099
|
return e ? "text-white/55" : "text-black/55";
|
|
1081
1100
|
}
|
|
1082
|
-
function
|
|
1101
|
+
function ma(e) {
|
|
1083
1102
|
return e ? "text-white/40" : "text-black/40";
|
|
1084
1103
|
}
|
|
1085
|
-
function
|
|
1104
|
+
function ha(e) {
|
|
1086
1105
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1106
|
}
|
|
1088
|
-
const
|
|
1089
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ h(
|
|
1107
|
+
const tt = ({ attachment: e, isMyMessage: t }) => {
|
|
1108
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ h(j.Fragment, { children: [
|
|
1090
1109
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1110
|
"img",
|
|
1092
1111
|
{
|
|
@@ -1097,26 +1116,26 @@ const et = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1097
1116
|
) : /* @__PURE__ */ n(
|
|
1098
1117
|
"div",
|
|
1099
1118
|
{
|
|
1100
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1101
|
-
children: /* @__PURE__ */ n(
|
|
1119
|
+
className: `aspect-video w-full rounded-[20px] ${ca(t)} flex items-center justify-center`,
|
|
1120
|
+
children: /* @__PURE__ */ n(Is, { className: `size-12 ${ha(t)}` })
|
|
1102
1121
|
}
|
|
1103
1122
|
) }),
|
|
1104
1123
|
/* @__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 ${
|
|
1107
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1124
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${da(t)}`, children: s }),
|
|
1125
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${ua(t)}`, children: a }),
|
|
1126
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ma(t)}`, children: d })
|
|
1108
1127
|
] })
|
|
1109
1128
|
] });
|
|
1110
1129
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ n("div", { className: "block", children: u });
|
|
1111
1130
|
};
|
|
1112
|
-
function
|
|
1131
|
+
function ln(e) {
|
|
1113
1132
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1114
1133
|
}
|
|
1115
|
-
function
|
|
1134
|
+
function nt(e) {
|
|
1116
1135
|
var t;
|
|
1117
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1136
|
+
return (t = e.attachments) == null ? void 0 : t.find(ln);
|
|
1118
1137
|
}
|
|
1119
|
-
async function
|
|
1138
|
+
async function fa(e, t) {
|
|
1120
1139
|
let s;
|
|
1121
1140
|
try {
|
|
1122
1141
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1128,7 +1147,7 @@ async function ua(e, t) {
|
|
|
1128
1147
|
const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
|
|
1129
1148
|
l.href = i, l.download = s, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
1130
1149
|
}
|
|
1131
|
-
const
|
|
1150
|
+
const ga = ({
|
|
1132
1151
|
url: e,
|
|
1133
1152
|
filename: t
|
|
1134
1153
|
}) => {
|
|
@@ -1140,7 +1159,7 @@ const ma = ({
|
|
|
1140
1159
|
onClick: (i) => {
|
|
1141
1160
|
i.stopPropagation();
|
|
1142
1161
|
const l = window.open("", "_blank", "noopener,noreferrer");
|
|
1143
|
-
a(!0),
|
|
1162
|
+
a(!0), fa(e, t).then(() => {
|
|
1144
1163
|
l == null || l.close();
|
|
1145
1164
|
}).catch(() => {
|
|
1146
1165
|
l && (l.location.href = e);
|
|
@@ -1148,22 +1167,22 @@ const ma = ({
|
|
|
1148
1167
|
},
|
|
1149
1168
|
disabled: s,
|
|
1150
1169
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1151
|
-
children: s ? /* @__PURE__ */ n(we, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(
|
|
1170
|
+
children: s ? /* @__PURE__ */ n(we, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
|
|
1152
1171
|
/* @__PURE__ */ n(Ne, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1172
|
"Download"
|
|
1154
1173
|
] })
|
|
1155
1174
|
}
|
|
1156
1175
|
);
|
|
1157
1176
|
};
|
|
1158
|
-
function
|
|
1159
|
-
var m, f, c,
|
|
1177
|
+
function st(e) {
|
|
1178
|
+
var m, f, c, w;
|
|
1160
1179
|
const t = (m = e.attachments) == null ? void 0 : m.find(
|
|
1161
1180
|
(N) => N.type === "video" && N.asset_url
|
|
1162
1181
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
1182
|
(N) => N.type === "image" && N.image_url
|
|
1164
1183
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
1184
|
(N) => N.type === "audio" && N.asset_url
|
|
1166
|
-
), r = (
|
|
1185
|
+
), r = (w = e.attachments) == null ? void 0 : w.find(
|
|
1167
1186
|
(N) => N.type === "file" && N.asset_url
|
|
1168
1187
|
), i = t ?? s ?? a ?? r, l = (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
1188
|
if (!l) return null;
|
|
@@ -1176,16 +1195,16 @@ function nt(e) {
|
|
|
1176
1195
|
thumbnailUrl: g
|
|
1177
1196
|
};
|
|
1178
1197
|
}
|
|
1179
|
-
const
|
|
1198
|
+
const on = ({
|
|
1180
1199
|
resolvedUrl: e,
|
|
1181
1200
|
resolvedType: t,
|
|
1182
1201
|
title: s,
|
|
1183
1202
|
fileSize: a,
|
|
1184
1203
|
thumbnailUrl: r
|
|
1185
1204
|
}) => {
|
|
1186
|
-
const i = a !== void 0 ?
|
|
1205
|
+
const i = a !== void 0 ? rn(a) : void 0;
|
|
1187
1206
|
return /* @__PURE__ */ n(
|
|
1188
|
-
|
|
1207
|
+
an,
|
|
1189
1208
|
{
|
|
1190
1209
|
variant: "dark",
|
|
1191
1210
|
title: s,
|
|
@@ -1193,7 +1212,7 @@ const ln = ({
|
|
|
1193
1212
|
mimeType: t,
|
|
1194
1213
|
detail: i,
|
|
1195
1214
|
thumbnail: /* @__PURE__ */ n(
|
|
1196
|
-
|
|
1215
|
+
sn,
|
|
1197
1216
|
{
|
|
1198
1217
|
mimeType: t,
|
|
1199
1218
|
sourceUrl: e,
|
|
@@ -1204,23 +1223,23 @@ const ln = ({
|
|
|
1204
1223
|
)
|
|
1205
1224
|
}
|
|
1206
1225
|
);
|
|
1207
|
-
},
|
|
1226
|
+
}, cn = ({
|
|
1208
1227
|
resolvedUrl: e,
|
|
1209
1228
|
resolvedType: t,
|
|
1210
1229
|
title: s,
|
|
1211
1230
|
fileSize: a,
|
|
1212
1231
|
thumbnailUrl: r
|
|
1213
1232
|
}) => {
|
|
1214
|
-
const i = ie(t), l = a !== void 0 ?
|
|
1233
|
+
const i = ie(t), l = a !== void 0 ? rn(a) : void 0;
|
|
1215
1234
|
return /* @__PURE__ */ n(
|
|
1216
|
-
|
|
1235
|
+
an,
|
|
1217
1236
|
{
|
|
1218
1237
|
variant: "light",
|
|
1219
1238
|
title: s,
|
|
1220
1239
|
mimeType: t,
|
|
1221
1240
|
detail: l,
|
|
1222
1241
|
thumbnail: /* @__PURE__ */ n(
|
|
1223
|
-
|
|
1242
|
+
sn,
|
|
1224
1243
|
{
|
|
1225
1244
|
mimeType: t,
|
|
1226
1245
|
sourceUrl: e,
|
|
@@ -1230,14 +1249,14 @@ const ln = ({
|
|
|
1230
1249
|
containedImage: i === "image" || i === "document"
|
|
1231
1250
|
}
|
|
1232
1251
|
),
|
|
1233
|
-
action: /* @__PURE__ */ n(
|
|
1252
|
+
action: /* @__PURE__ */ n(ga, { url: e, filename: s })
|
|
1234
1253
|
}
|
|
1235
1254
|
);
|
|
1236
|
-
},
|
|
1255
|
+
}, pa = ({
|
|
1237
1256
|
message: e,
|
|
1238
1257
|
isMyMessage: t = !1
|
|
1239
1258
|
}) => {
|
|
1240
|
-
const s =
|
|
1259
|
+
const s = nt(e), a = st(e);
|
|
1241
1260
|
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
1261
|
!t && e.user && /* @__PURE__ */ n(
|
|
1243
1262
|
ne,
|
|
@@ -1258,40 +1277,40 @@ const ln = ({
|
|
|
1258
1277
|
{
|
|
1259
1278
|
className: "str-chat__message-bubble",
|
|
1260
1279
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1261
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1280
|
+
children: s ? /* @__PURE__ */ n("div", { className: et(t), children: /* @__PURE__ */ n(tt, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(on, { ...a }) : /* @__PURE__ */ n(cn, { ...a })
|
|
1262
1281
|
}
|
|
1263
1282
|
) })
|
|
1264
1283
|
}
|
|
1265
1284
|
)
|
|
1266
1285
|
] });
|
|
1267
|
-
},
|
|
1286
|
+
}, ba = ({
|
|
1268
1287
|
message: e
|
|
1269
1288
|
}) => {
|
|
1270
|
-
const t =
|
|
1289
|
+
const t = nt(e);
|
|
1271
1290
|
if (t)
|
|
1272
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1273
|
-
const s =
|
|
1274
|
-
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(
|
|
1275
|
-
},
|
|
1291
|
+
return /* @__PURE__ */ n("div", { className: et(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(tt, { attachment: t, isMyMessage: !0 }) });
|
|
1292
|
+
const s = st(e);
|
|
1293
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(on, { ...s }) }) : null;
|
|
1294
|
+
}, va = ({
|
|
1276
1295
|
message: e
|
|
1277
1296
|
}) => {
|
|
1278
|
-
const t =
|
|
1297
|
+
const t = nt(e);
|
|
1279
1298
|
if (t)
|
|
1280
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1281
|
-
const s =
|
|
1282
|
-
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(
|
|
1283
|
-
},
|
|
1284
|
-
Creator:
|
|
1285
|
-
Visitor:
|
|
1286
|
-
}),
|
|
1299
|
+
return /* @__PURE__ */ n("div", { className: et(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(tt, { attachment: t, isMyMessage: !1 }) });
|
|
1300
|
+
const s = st(e);
|
|
1301
|
+
return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(cn, { ...s }) }) : null;
|
|
1302
|
+
}, Ei = Object.assign(pa, {
|
|
1303
|
+
Creator: ba,
|
|
1304
|
+
Visitor: va
|
|
1305
|
+
}), xa = {
|
|
1287
1306
|
isUnlocking: () => !1
|
|
1288
|
-
},
|
|
1289
|
-
LockedAttachment:
|
|
1290
|
-
},
|
|
1291
|
-
function
|
|
1292
|
-
return _e(
|
|
1307
|
+
}, wa = {
|
|
1308
|
+
LockedAttachment: xa
|
|
1309
|
+
}, dn = We({}), Ii = dn.Provider;
|
|
1310
|
+
function Na(e) {
|
|
1311
|
+
return _e(dn)[e] ?? wa[e];
|
|
1293
1312
|
}
|
|
1294
|
-
const
|
|
1313
|
+
const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1314
|
"svg",
|
|
1296
1315
|
{
|
|
1297
1316
|
width: e,
|
|
@@ -1308,21 +1327,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1308
1327
|
}
|
|
1309
1328
|
)
|
|
1310
1329
|
}
|
|
1311
|
-
),
|
|
1330
|
+
), ya = (e) => {
|
|
1312
1331
|
var t;
|
|
1313
1332
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1314
|
-
},
|
|
1333
|
+
}, ka = (e) => {
|
|
1315
1334
|
var t;
|
|
1316
1335
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1317
1336
|
}, Me = (e) => {
|
|
1318
1337
|
var t;
|
|
1319
1338
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1320
|
-
},
|
|
1339
|
+
}, Ca = (e) => {
|
|
1321
1340
|
var t;
|
|
1322
1341
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1323
|
-
},
|
|
1342
|
+
}, un = (e) => ya(e) || ka(e), Ea = (e) => {
|
|
1324
1343
|
var t;
|
|
1325
|
-
return
|
|
1344
|
+
return un(e) && !((t = e.text) != null && t.trim());
|
|
1326
1345
|
}, Be = ({
|
|
1327
1346
|
message: e,
|
|
1328
1347
|
standalone: t = !1,
|
|
@@ -1330,23 +1349,23 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1330
1349
|
hasAttachment: a = !1
|
|
1331
1350
|
}) => {
|
|
1332
1351
|
var m;
|
|
1333
|
-
const r =
|
|
1352
|
+
const r = un(e), i = Me(e);
|
|
1334
1353
|
if (!r && !i)
|
|
1335
1354
|
return null;
|
|
1336
1355
|
if (r) {
|
|
1337
1356
|
const f = (m = e.metadata) == null ? void 0 : m.amount_text;
|
|
1338
1357
|
if (!f) return null;
|
|
1339
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1358
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", w = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1359
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
|
-
/* @__PURE__ */ n(
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1360
|
+
/* @__PURE__ */ n(Ss, { size: t ? 14 : 12 }),
|
|
1361
|
+
/* @__PURE__ */ n("span", { children: w })
|
|
1343
1362
|
] });
|
|
1344
1363
|
}
|
|
1345
1364
|
const l = s && a, o = l ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
1346
1365
|
"message-chatbot-indicator",
|
|
1347
1366
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
1367
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
|
-
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(
|
|
1368
|
+
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(_a, { size: l ? 12 : 15 }) });
|
|
1350
1369
|
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(se, { children: [
|
|
1351
1370
|
u,
|
|
1352
1371
|
g
|
|
@@ -1354,7 +1373,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1354
1373
|
g,
|
|
1355
1374
|
u
|
|
1356
1375
|
] }) });
|
|
1357
|
-
},
|
|
1376
|
+
}, Ia = ({
|
|
1358
1377
|
selected: e,
|
|
1359
1378
|
onVoteUp: t,
|
|
1360
1379
|
onVoteDown: s
|
|
@@ -1363,32 +1382,32 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1363
1382
|
"button",
|
|
1364
1383
|
{
|
|
1365
1384
|
type: "button",
|
|
1366
|
-
className:
|
|
1385
|
+
className: y("message-vote-button focus-ring", {
|
|
1367
1386
|
"message-vote-button--selected": e === "up"
|
|
1368
1387
|
}),
|
|
1369
1388
|
onClick: t,
|
|
1370
1389
|
"aria-label": "Good response",
|
|
1371
1390
|
"aria-pressed": e === "up",
|
|
1372
1391
|
"data-tooltip": "Good response",
|
|
1373
|
-
children: /* @__PURE__ */ n(
|
|
1392
|
+
children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1374
1393
|
}
|
|
1375
1394
|
),
|
|
1376
1395
|
/* @__PURE__ */ n(
|
|
1377
1396
|
"button",
|
|
1378
1397
|
{
|
|
1379
1398
|
type: "button",
|
|
1380
|
-
className:
|
|
1399
|
+
className: y("message-vote-button focus-ring", {
|
|
1381
1400
|
"message-vote-button--selected": e === "down"
|
|
1382
1401
|
}),
|
|
1383
1402
|
onClick: s,
|
|
1384
1403
|
"aria-label": "Bad response",
|
|
1385
1404
|
"aria-pressed": e === "down",
|
|
1386
1405
|
"data-tooltip": "Bad response",
|
|
1387
|
-
children: /* @__PURE__ */ n(
|
|
1406
|
+
children: /* @__PURE__ */ n(As, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1388
1407
|
}
|
|
1389
1408
|
)
|
|
1390
|
-
] }),
|
|
1391
|
-
var
|
|
1409
|
+
] }), Sa = (e) => {
|
|
1410
|
+
var vt, xt, wt, Nt, _t, yt, kt, Ct, Et, It, St, Tt, At, Mt;
|
|
1392
1411
|
const {
|
|
1393
1412
|
additionalMessageInputProps: t,
|
|
1394
1413
|
chatbotVotingEnabled: s,
|
|
@@ -1403,60 +1422,60 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1403
1422
|
isMessageAIGenerated: m,
|
|
1404
1423
|
isMyMessage: f,
|
|
1405
1424
|
message: c,
|
|
1406
|
-
renderText:
|
|
1425
|
+
renderText: w,
|
|
1407
1426
|
threadList: N,
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1411
|
-
EditMessageModal: I =
|
|
1427
|
+
viewerLanguage: p
|
|
1428
|
+
} = e, { client: v } = Ke("CustomMessage"), { channel: b } = de("CustomMessage"), { isUnlocking: S, onUnlockClick: A, onFetchSource: E, onDownloadClick: L } = Na("LockedAttachment"), [D, R] = $(!1), F = Dn(c.id), { selected: z, voteUp: _, voteDown: M } = Ws(c), {
|
|
1429
|
+
Attachment: k = Pn,
|
|
1430
|
+
EditMessageModal: I = zn,
|
|
1412
1431
|
MessageActions: C,
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt:
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText: x =
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} =
|
|
1432
|
+
MessageBlocked: O = On,
|
|
1433
|
+
MessageBouncePrompt: P = $n,
|
|
1434
|
+
MessageDeleted: U = Fn,
|
|
1435
|
+
MessageIsThreadReplyInChannelButtonIndicator: W = Bn,
|
|
1436
|
+
MessageRepliesCountButton: ee = Un,
|
|
1437
|
+
ReminderNotification: Y = jn,
|
|
1438
|
+
StreamedMessageText: x = Vn,
|
|
1439
|
+
PinIndicator: T
|
|
1440
|
+
} = Ht("CustomMessage"), B = Gn(c), V = Hn(c), K = re(
|
|
1422
1441
|
() => m == null ? void 0 : m(c),
|
|
1423
1442
|
[m, c]
|
|
1424
|
-
),
|
|
1443
|
+
), G = re(() => {
|
|
1425
1444
|
const ge = c.attachments ?? [], Se = c.shared_location ? [c.shared_location, ...ge] : ge;
|
|
1426
1445
|
if (!Me(c)) return Se;
|
|
1427
|
-
const
|
|
1428
|
-
return
|
|
1429
|
-
}, [c]),
|
|
1430
|
-
const ge =
|
|
1446
|
+
const Rt = Se.filter((Lt) => !("type" in Lt) || !ln(Lt));
|
|
1447
|
+
return Rt.length === Se.length ? Se : Rt;
|
|
1448
|
+
}, [c]), J = re(() => {
|
|
1449
|
+
const ge = Qt({ message: c, viewerLanguage: p });
|
|
1431
1450
|
return ge === c.text ? c : { ...c, text: ge };
|
|
1432
|
-
}, [c,
|
|
1433
|
-
if (
|
|
1451
|
+
}, [c, p]);
|
|
1452
|
+
if (Yn(c))
|
|
1434
1453
|
return null;
|
|
1435
1454
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1437
|
-
if (
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1439
|
-
const
|
|
1440
|
-
let
|
|
1441
|
-
me ?
|
|
1442
|
-
const te = f(), le =
|
|
1455
|
+
return /* @__PURE__ */ n(U, { message: c });
|
|
1456
|
+
if (qn(c))
|
|
1457
|
+
return /* @__PURE__ */ n(O, {});
|
|
1458
|
+
const Z = !N && !!c.reply_count, ue = !N && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((vt = c.error) == null ? void 0 : vt.status) !== 403, he = Wn(c);
|
|
1459
|
+
let Q;
|
|
1460
|
+
me ? Q = () => u(c) : he && (Q = () => R(!0));
|
|
1461
|
+
const te = f(), le = y(
|
|
1443
1462
|
"str-chat__message str-chat__message-simple",
|
|
1444
1463
|
`str-chat__message--${c.type}`,
|
|
1445
1464
|
`str-chat__message--${c.status}`,
|
|
1446
1465
|
te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1447
1466
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1448
1467
|
{
|
|
1449
|
-
"str-chat__message--has-attachment":
|
|
1468
|
+
"str-chat__message--has-attachment": B,
|
|
1450
1469
|
"str-chat__message--highlighted": g,
|
|
1451
1470
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
|
-
"str-chat__message--with-reactions":
|
|
1453
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1454
|
-
"str-chat__message-with-thread-link":
|
|
1471
|
+
"str-chat__message--with-reactions": V,
|
|
1472
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((xt = c == null ? void 0 : c.error) == null ? void 0 : xt.status) !== 403,
|
|
1473
|
+
"str-chat__message-with-thread-link": Z || ue,
|
|
1455
1474
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1475
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1476
|
"str-chat__virtual-message__wrapper--group": l
|
|
1458
1477
|
}
|
|
1459
|
-
),
|
|
1478
|
+
), ft = c.poll_id && v.polls.fromState(c.poll_id), gt = Ea(c), fe = Me(c), pt = Ca(c), Oe = !!(G != null && G.length && !c.quoted_message), bt = fe && te && Oe;
|
|
1460
1479
|
return /* @__PURE__ */ h(se, { children: [
|
|
1461
1480
|
a && /* @__PURE__ */ n(
|
|
1462
1481
|
I,
|
|
@@ -1464,12 +1483,12 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1464
1483
|
additionalMessageInputProps: t
|
|
1465
1484
|
}
|
|
1466
1485
|
),
|
|
1467
|
-
|
|
1468
|
-
|
|
1486
|
+
D && /* @__PURE__ */ n(
|
|
1487
|
+
Xn,
|
|
1469
1488
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1471
|
-
onClose: () =>
|
|
1472
|
-
open:
|
|
1489
|
+
MessageBouncePrompt: P,
|
|
1490
|
+
onClose: () => R(!1),
|
|
1491
|
+
open: D
|
|
1473
1492
|
}
|
|
1474
1493
|
),
|
|
1475
1494
|
/* @__PURE__ */ h(
|
|
@@ -1479,8 +1498,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1479
1498
|
"data-message-id": c.id,
|
|
1480
1499
|
"data-dd-privacy": "mask",
|
|
1481
1500
|
children: [
|
|
1482
|
-
|
|
1483
|
-
!!
|
|
1501
|
+
T && /* @__PURE__ */ n(T, {}),
|
|
1502
|
+
!!F && /* @__PURE__ */ n(Y, { reminder: F }),
|
|
1484
1503
|
c.user && /* @__PURE__ */ n(
|
|
1485
1504
|
ne,
|
|
1486
1505
|
{
|
|
@@ -1496,66 +1515,66 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1496
1515
|
/* @__PURE__ */ n(
|
|
1497
1516
|
"div",
|
|
1498
1517
|
{
|
|
1499
|
-
className:
|
|
1518
|
+
className: y("str-chat__message-inner", {
|
|
1500
1519
|
"str-chat__simple-message--error-failed": me || he
|
|
1501
1520
|
}),
|
|
1502
1521
|
"data-testid": "message-inner",
|
|
1503
|
-
onClick:
|
|
1504
|
-
onKeyDown:
|
|
1505
|
-
role:
|
|
1506
|
-
tabIndex:
|
|
1522
|
+
onClick: Q,
|
|
1523
|
+
onKeyDown: Q,
|
|
1524
|
+
role: Q ? "button" : void 0,
|
|
1525
|
+
tabIndex: Q ? 0 : void 0,
|
|
1507
1526
|
style: {
|
|
1508
1527
|
// Force margins to 0 to prevent hover layout shift
|
|
1509
1528
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1510
1529
|
marginInlineEnd: 0,
|
|
1511
1530
|
marginInlineStart: 0
|
|
1512
1531
|
},
|
|
1513
|
-
children:
|
|
1532
|
+
children: pt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1514
1533
|
te ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1515
1534
|
C && /* @__PURE__ */ n(C, {}),
|
|
1516
1535
|
/* @__PURE__ */ n(
|
|
1517
|
-
|
|
1536
|
+
Ut.Sent,
|
|
1518
1537
|
{
|
|
1519
|
-
title: (
|
|
1520
|
-
mimeType: (
|
|
1521
|
-
thumbnailUrl: (
|
|
1522
|
-
amountText: (
|
|
1523
|
-
detail: (
|
|
1524
|
-
paymentStatus: (
|
|
1525
|
-
onPreviewClick: () =>
|
|
1526
|
-
onFetchSource: async () => await (E == null ? void 0 : E(c,
|
|
1538
|
+
title: (wt = c.metadata) == null ? void 0 : wt.attachment_title,
|
|
1539
|
+
mimeType: (Nt = c.metadata) == null ? void 0 : Nt.attachment_mime_type,
|
|
1540
|
+
thumbnailUrl: (_t = c.metadata) == null ? void 0 : _t.attachment_thumbnail,
|
|
1541
|
+
amountText: (yt = c.metadata) == null ? void 0 : yt.amount_text,
|
|
1542
|
+
detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
|
|
1543
|
+
paymentStatus: (Ct = c.metadata) == null ? void 0 : Ct.payment_status,
|
|
1544
|
+
onPreviewClick: () => A == null ? void 0 : A(c, b),
|
|
1545
|
+
onFetchSource: async () => await (E == null ? void 0 : E(c, b))
|
|
1527
1546
|
}
|
|
1528
1547
|
)
|
|
1529
1548
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1530
1549
|
/* @__PURE__ */ n(
|
|
1531
|
-
|
|
1550
|
+
Ut.Received,
|
|
1532
1551
|
{
|
|
1533
|
-
title: (
|
|
1534
|
-
mimeType: (
|
|
1535
|
-
thumbnailUrl: (
|
|
1536
|
-
amountText: (
|
|
1537
|
-
detail: (
|
|
1538
|
-
paymentStatus: (
|
|
1539
|
-
isUnlocking:
|
|
1540
|
-
onUnlockClick: () =>
|
|
1541
|
-
onFetchSource: async () => await (E == null ? void 0 : E(c,
|
|
1542
|
-
onDownloadClick: () =>
|
|
1552
|
+
title: (Et = c.metadata) == null ? void 0 : Et.attachment_title,
|
|
1553
|
+
mimeType: (It = c.metadata) == null ? void 0 : It.attachment_mime_type,
|
|
1554
|
+
thumbnailUrl: (St = c.metadata) == null ? void 0 : St.attachment_thumbnail,
|
|
1555
|
+
amountText: (Tt = c.metadata) == null ? void 0 : Tt.amount_text,
|
|
1556
|
+
detail: (At = c.metadata) == null ? void 0 : At.attachment_detail,
|
|
1557
|
+
paymentStatus: (Mt = c.metadata) == null ? void 0 : Mt.payment_status,
|
|
1558
|
+
isUnlocking: S(c.id),
|
|
1559
|
+
onUnlockClick: () => A == null ? void 0 : A(c, b),
|
|
1560
|
+
onFetchSource: async () => await (E == null ? void 0 : E(c, b)),
|
|
1561
|
+
onDownloadClick: () => L == null ? void 0 : L(c, b)
|
|
1543
1562
|
}
|
|
1544
1563
|
),
|
|
1545
1564
|
C && /* @__PURE__ */ n(C, {})
|
|
1546
1565
|
] }),
|
|
1547
1566
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1548
|
-
|
|
1567
|
+
Pt,
|
|
1549
1568
|
{
|
|
1550
|
-
message:
|
|
1551
|
-
renderText:
|
|
1569
|
+
message: J,
|
|
1570
|
+
renderText: w
|
|
1552
1571
|
}
|
|
1553
1572
|
) })
|
|
1554
|
-
] }) :
|
|
1573
|
+
] }) : gt ? (
|
|
1555
1574
|
/* Tip-only messages render as a standalone bubble */
|
|
1556
1575
|
/* @__PURE__ */ n(Be, { message: c, standalone: !0 })
|
|
1557
1576
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1558
|
-
fe && !
|
|
1577
|
+
fe && !bt && /* @__PURE__ */ n(
|
|
1559
1578
|
Be,
|
|
1560
1579
|
{
|
|
1561
1580
|
message: c,
|
|
@@ -1563,33 +1582,33 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1563
1582
|
isMyMessage: te
|
|
1564
1583
|
}
|
|
1565
1584
|
),
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1585
|
+
ft && /* @__PURE__ */ n(Kn, { poll: ft }),
|
|
1586
|
+
G != null && G.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1587
|
+
k,
|
|
1569
1588
|
{
|
|
1570
1589
|
actionHandler: o,
|
|
1571
|
-
attachments:
|
|
1590
|
+
attachments: G
|
|
1572
1591
|
}
|
|
1573
1592
|
) : null,
|
|
1574
|
-
|
|
1593
|
+
K ? /* @__PURE__ */ n(
|
|
1575
1594
|
x,
|
|
1576
1595
|
{
|
|
1577
|
-
message:
|
|
1578
|
-
renderText:
|
|
1596
|
+
message: J,
|
|
1597
|
+
renderText: w
|
|
1579
1598
|
}
|
|
1580
1599
|
) : /* @__PURE__ */ n(
|
|
1581
|
-
|
|
1600
|
+
Pt,
|
|
1582
1601
|
{
|
|
1583
|
-
message:
|
|
1584
|
-
renderText:
|
|
1602
|
+
message: J,
|
|
1603
|
+
renderText: w
|
|
1585
1604
|
}
|
|
1586
1605
|
),
|
|
1587
|
-
/* @__PURE__ */ n(
|
|
1606
|
+
/* @__PURE__ */ n(Jn, {})
|
|
1588
1607
|
] }) })
|
|
1589
1608
|
}
|
|
1590
1609
|
),
|
|
1591
|
-
!
|
|
1592
|
-
(!fe ||
|
|
1610
|
+
!pt && !gt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1611
|
+
(!fe || bt) && /* @__PURE__ */ n(
|
|
1593
1612
|
Be,
|
|
1594
1613
|
{
|
|
1595
1614
|
message: c,
|
|
@@ -1598,71 +1617,71 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1598
1617
|
}
|
|
1599
1618
|
),
|
|
1600
1619
|
s && fe && /* @__PURE__ */ n(
|
|
1601
|
-
|
|
1620
|
+
Ia,
|
|
1602
1621
|
{
|
|
1603
|
-
selected:
|
|
1622
|
+
selected: z,
|
|
1604
1623
|
onVoteUp: _,
|
|
1605
1624
|
onVoteDown: M
|
|
1606
1625
|
}
|
|
1607
1626
|
)
|
|
1608
1627
|
] }),
|
|
1609
|
-
|
|
1610
|
-
|
|
1628
|
+
Z && /* @__PURE__ */ n(
|
|
1629
|
+
ee,
|
|
1611
1630
|
{
|
|
1612
1631
|
onClick: d,
|
|
1613
1632
|
reply_count: c.reply_count
|
|
1614
1633
|
}
|
|
1615
1634
|
),
|
|
1616
|
-
ue && /* @__PURE__ */ n(
|
|
1635
|
+
ue && /* @__PURE__ */ n(W, {})
|
|
1617
1636
|
]
|
|
1618
1637
|
},
|
|
1619
1638
|
c.id
|
|
1620
1639
|
)
|
|
1621
1640
|
] });
|
|
1622
|
-
},
|
|
1623
|
-
|
|
1624
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1625
|
-
),
|
|
1641
|
+
}, Ta = j.memo(
|
|
1642
|
+
Sa,
|
|
1643
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ln(e, t)
|
|
1644
|
+
), Aa = (e) => {
|
|
1626
1645
|
const t = ye("CustomMessage");
|
|
1627
|
-
return /* @__PURE__ */ n(
|
|
1628
|
-
},
|
|
1646
|
+
return /* @__PURE__ */ n(Ta, { ...t, ...e });
|
|
1647
|
+
}, Ma = () => {
|
|
1629
1648
|
var s;
|
|
1630
1649
|
const { handleDelete: e, message: t } = ye("CustomMessageActions");
|
|
1631
1650
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1632
|
-
|
|
1651
|
+
Xt,
|
|
1633
1652
|
{
|
|
1634
1653
|
onClick: e,
|
|
1635
1654
|
"aria-label": "Delete",
|
|
1636
1655
|
title: "Delete",
|
|
1637
1656
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1638
|
-
children: /* @__PURE__ */ n(
|
|
1657
|
+
children: /* @__PURE__ */ n(Ms, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1639
1658
|
}
|
|
1640
1659
|
);
|
|
1641
|
-
},
|
|
1660
|
+
}, Ra = () => {
|
|
1642
1661
|
const { handleFlag: e } = ye("CustomMessageActions");
|
|
1643
1662
|
return /* @__PURE__ */ n(
|
|
1644
|
-
|
|
1663
|
+
Xt,
|
|
1645
1664
|
{
|
|
1646
1665
|
onClick: e,
|
|
1647
1666
|
"aria-label": "Report",
|
|
1648
1667
|
title: "Report",
|
|
1649
1668
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1650
|
-
children: /* @__PURE__ */ n(
|
|
1669
|
+
children: /* @__PURE__ */ n(Yt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1651
1670
|
}
|
|
1652
1671
|
);
|
|
1653
|
-
},
|
|
1672
|
+
}, La = () => {
|
|
1654
1673
|
var t;
|
|
1655
1674
|
const { message: e } = ye("CustomMessageActions");
|
|
1656
1675
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1657
|
-
|
|
1676
|
+
zs,
|
|
1658
1677
|
{
|
|
1659
1678
|
messageActionSet: [
|
|
1660
|
-
{ Component:
|
|
1661
|
-
{ Component:
|
|
1679
|
+
{ Component: Ma, placement: "quick", type: "delete" },
|
|
1680
|
+
{ Component: Ra, placement: "quick", type: "flag" }
|
|
1662
1681
|
]
|
|
1663
1682
|
}
|
|
1664
1683
|
);
|
|
1665
|
-
},
|
|
1684
|
+
}, Da = ({
|
|
1666
1685
|
link: e,
|
|
1667
1686
|
onDismiss: t
|
|
1668
1687
|
}) => {
|
|
@@ -1702,26 +1721,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1702
1721
|
]
|
|
1703
1722
|
}
|
|
1704
1723
|
);
|
|
1705
|
-
},
|
|
1724
|
+
}, Pa = (e) => ({
|
|
1706
1725
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1707
|
-
(t) =>
|
|
1726
|
+
(t) => Dt.previewIsLoaded(t) || Dt.previewIsLoading(t)
|
|
1708
1727
|
)
|
|
1709
|
-
}),
|
|
1710
|
-
const { linkPreviewsManager: e } =
|
|
1728
|
+
}), za = () => {
|
|
1729
|
+
const { linkPreviewsManager: e } = Zn(), { linkPreviews: t } = Qn(
|
|
1711
1730
|
e.state,
|
|
1712
|
-
|
|
1731
|
+
Pa
|
|
1713
1732
|
), s = (r) => {
|
|
1714
1733
|
e.dismissPreview(r);
|
|
1715
1734
|
};
|
|
1716
1735
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-stretch w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1717
|
-
|
|
1736
|
+
Da,
|
|
1718
1737
|
{
|
|
1719
1738
|
link: r,
|
|
1720
1739
|
onDismiss: s
|
|
1721
1740
|
},
|
|
1722
1741
|
r.og_scrape_url
|
|
1723
1742
|
)) }) : null;
|
|
1724
|
-
},
|
|
1743
|
+
}, at = j.createContext(!1), Si = () => _e(at), Oa = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1725
1744
|
"button",
|
|
1726
1745
|
{
|
|
1727
1746
|
...s,
|
|
@@ -1729,25 +1748,25 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1729
1748
|
"aria-label": "Send",
|
|
1730
1749
|
disabled: t,
|
|
1731
1750
|
onClick: e,
|
|
1732
|
-
children: /* @__PURE__ */ n(
|
|
1751
|
+
children: /* @__PURE__ */ n(Rs, { weight: "bold", className: "size-4" })
|
|
1733
1752
|
}
|
|
1734
|
-
),
|
|
1735
|
-
const e = _e(
|
|
1736
|
-
SendButton: r =
|
|
1737
|
-
AttachmentPreviewList: i =
|
|
1738
|
-
} =
|
|
1753
|
+
), $a = () => {
|
|
1754
|
+
const e = _e(at), { handleSubmit: t } = ts(), s = ns(), a = e || !s, {
|
|
1755
|
+
SendButton: r = Oa,
|
|
1756
|
+
AttachmentPreviewList: i = ss
|
|
1757
|
+
} = Ht("CustomMessageInput");
|
|
1739
1758
|
return /* @__PURE__ */ h(
|
|
1740
1759
|
"div",
|
|
1741
1760
|
{
|
|
1742
1761
|
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
1762
|
"data-dd-privacy": "mask",
|
|
1744
1763
|
children: [
|
|
1745
|
-
/* @__PURE__ */ n(
|
|
1746
|
-
/* @__PURE__ */ n(
|
|
1764
|
+
/* @__PURE__ */ n(as, {}),
|
|
1765
|
+
/* @__PURE__ */ n(za, {}),
|
|
1747
1766
|
/* @__PURE__ */ n(i, {}),
|
|
1748
1767
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1749
1768
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1750
|
-
|
|
1769
|
+
rs,
|
|
1751
1770
|
{
|
|
1752
1771
|
"aria-disabled": e || void 0,
|
|
1753
1772
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1772,7 +1791,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1772
1791
|
]
|
|
1773
1792
|
}
|
|
1774
1793
|
);
|
|
1775
|
-
},
|
|
1794
|
+
}, Fa = ({
|
|
1776
1795
|
renderActions: e,
|
|
1777
1796
|
renderFooter: t,
|
|
1778
1797
|
disabled: s = !1,
|
|
@@ -1793,42 +1812,42 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1793
1812
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1794
1813
|
children: [
|
|
1795
1814
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1796
|
-
/* @__PURE__ */ n(
|
|
1815
|
+
/* @__PURE__ */ n(at.Provider, { value: l, children: /* @__PURE__ */ n(es, { Input: r ?? $a }) })
|
|
1797
1816
|
]
|
|
1798
1817
|
}
|
|
1799
1818
|
),
|
|
1800
1819
|
t == null ? void 0 : t()
|
|
1801
1820
|
] });
|
|
1802
|
-
},
|
|
1821
|
+
}, Ba = [
|
|
1803
1822
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1804
1823
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1805
|
-
],
|
|
1824
|
+
], Ua = {
|
|
1806
1825
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1807
1826
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1808
|
-
},
|
|
1827
|
+
}, ja = [
|
|
1809
1828
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1810
|
-
],
|
|
1829
|
+
], Va = {
|
|
1811
1830
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1812
|
-
}, Ue = "age safety guidelines.",
|
|
1831
|
+
}, Ue = "age safety guidelines.", Ga = "https://linktr.ee/s/about/contact", Vt = (e) => Ba.includes(e), Ha = (e) => ja.includes(e), Ya = (e) => {
|
|
1813
1832
|
var a;
|
|
1814
1833
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1815
|
-
if (
|
|
1834
|
+
if (Vt(t))
|
|
1816
1835
|
return {
|
|
1817
1836
|
kind: "dm-agent",
|
|
1818
1837
|
type: t
|
|
1819
1838
|
};
|
|
1820
|
-
if (
|
|
1839
|
+
if (Ha(t))
|
|
1821
1840
|
return {
|
|
1822
1841
|
kind: "age-safety",
|
|
1823
1842
|
type: t
|
|
1824
1843
|
};
|
|
1825
1844
|
const s = e.dm_agent_system_type;
|
|
1826
|
-
if (
|
|
1845
|
+
if (Vt(s))
|
|
1827
1846
|
return {
|
|
1828
1847
|
kind: "dm-agent",
|
|
1829
1848
|
type: s
|
|
1830
1849
|
};
|
|
1831
|
-
},
|
|
1850
|
+
}, qa = (e) => {
|
|
1832
1851
|
const t = e.indexOf(Ue);
|
|
1833
1852
|
if (t === -1)
|
|
1834
1853
|
return e;
|
|
@@ -1838,7 +1857,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1838
1857
|
/* @__PURE__ */ n(
|
|
1839
1858
|
"a",
|
|
1840
1859
|
{
|
|
1841
|
-
href:
|
|
1860
|
+
href: Ga,
|
|
1842
1861
|
target: "_blank",
|
|
1843
1862
|
rel: "noopener noreferrer",
|
|
1844
1863
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1847,13 +1866,13 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1847
1866
|
),
|
|
1848
1867
|
e.slice(s)
|
|
1849
1868
|
] });
|
|
1850
|
-
},
|
|
1869
|
+
}, Wa = (e) => {
|
|
1851
1870
|
var a, r;
|
|
1852
|
-
const t = e.message.hide_date === !0, s =
|
|
1871
|
+
const t = e.message.hide_date === !0, s = Ya(
|
|
1853
1872
|
e.message
|
|
1854
1873
|
);
|
|
1855
1874
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
1856
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1875
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ua[s.type];
|
|
1857
1876
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1858
1877
|
/* @__PURE__ */ h(
|
|
1859
1878
|
"div",
|
|
@@ -1879,7 +1898,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1879
1898
|
] });
|
|
1880
1899
|
}
|
|
1881
1900
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1882
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1901
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Va[s.type];
|
|
1883
1902
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1884
1903
|
/* @__PURE__ */ h(
|
|
1885
1904
|
"div",
|
|
@@ -1889,7 +1908,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1889
1908
|
"data-age-safety-system-type": s.type,
|
|
1890
1909
|
children: [
|
|
1891
1910
|
/* @__PURE__ */ n(
|
|
1892
|
-
|
|
1911
|
+
Ls,
|
|
1893
1912
|
{
|
|
1894
1913
|
size: 24,
|
|
1895
1914
|
weight: "duotone",
|
|
@@ -1898,7 +1917,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1898
1917
|
"data-testid": "age-safety-system-message-icon"
|
|
1899
1918
|
}
|
|
1900
1919
|
),
|
|
1901
|
-
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1920
|
+
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: qa(i) }) })
|
|
1902
1921
|
]
|
|
1903
1922
|
}
|
|
1904
1923
|
),
|
|
@@ -1913,7 +1932,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1913
1932
|
] }),
|
|
1914
1933
|
!t && /* @__PURE__ */ n($e, { message: e.message })
|
|
1915
1934
|
] });
|
|
1916
|
-
},
|
|
1935
|
+
}, mn = We(!1), je = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1917
1936
|
"animateTransform",
|
|
1918
1937
|
{
|
|
1919
1938
|
attributeName: "transform",
|
|
@@ -1923,21 +1942,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1923
1942
|
begin: `${120 * t}ms`,
|
|
1924
1943
|
repeatCount: "indefinite"
|
|
1925
1944
|
}
|
|
1926
|
-
) }),
|
|
1945
|
+
) }), Xa = /* @__PURE__ */ new Set([
|
|
1927
1946
|
Fe.Thinking,
|
|
1928
1947
|
Fe.Generating,
|
|
1929
1948
|
Fe.ExternalSources
|
|
1930
|
-
]),
|
|
1931
|
-
var
|
|
1932
|
-
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } =
|
|
1933
|
-
if (!e && o &&
|
|
1934
|
-
const
|
|
1949
|
+
]), Ka = ({ threadList: e }) => {
|
|
1950
|
+
var w, N;
|
|
1951
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = is(), { aiState: l } = ls(t), o = _e(mn);
|
|
1952
|
+
if (!e && o && Xa.has(l)) {
|
|
1953
|
+
const p = Ja(t, (w = r.user) == null ? void 0 : w.id);
|
|
1935
1954
|
return /* @__PURE__ */ n(
|
|
1936
|
-
|
|
1955
|
+
Gt,
|
|
1937
1956
|
{
|
|
1938
|
-
avatarId: (
|
|
1939
|
-
avatarName: (
|
|
1940
|
-
avatarImage:
|
|
1957
|
+
avatarId: (p == null ? void 0 : p.id) ?? "ai-agent",
|
|
1958
|
+
avatarName: (p == null ? void 0 : p.name) ?? (p == null ? void 0 : p.id) ?? "Agent",
|
|
1959
|
+
avatarImage: p == null ? void 0 : p.image,
|
|
1941
1960
|
testId: "typing-indicator-ai"
|
|
1942
1961
|
}
|
|
1943
1962
|
);
|
|
@@ -1945,21 +1964,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1945
1964
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1946
1965
|
return null;
|
|
1947
1966
|
const u = e ? [] : Object.values(i).filter(
|
|
1948
|
-
({ parent_id:
|
|
1949
|
-
var
|
|
1950
|
-
return (
|
|
1967
|
+
({ parent_id: p, user: v }) => {
|
|
1968
|
+
var b;
|
|
1969
|
+
return (v == null ? void 0 : v.id) !== ((b = r.user) == null ? void 0 : b.id) && !p;
|
|
1951
1970
|
}
|
|
1952
1971
|
), g = e ? Object.values(i).filter(
|
|
1953
|
-
({ parent_id:
|
|
1954
|
-
var
|
|
1955
|
-
return (
|
|
1972
|
+
({ parent_id: p, user: v }) => {
|
|
1973
|
+
var b;
|
|
1974
|
+
return (v == null ? void 0 : v.id) !== ((b = r.user) == null ? void 0 : b.id) && p === (a == null ? void 0 : a.id);
|
|
1956
1975
|
}
|
|
1957
1976
|
) : [], m = e ? g : u;
|
|
1958
1977
|
if (!m.length)
|
|
1959
1978
|
return null;
|
|
1960
1979
|
const f = (N = m[0]) == null ? void 0 : N.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1961
1980
|
return /* @__PURE__ */ n(
|
|
1962
|
-
|
|
1981
|
+
Gt,
|
|
1963
1982
|
{
|
|
1964
1983
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1965
1984
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1967,7 +1986,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1967
1986
|
testId: "typing-indicator"
|
|
1968
1987
|
}
|
|
1969
1988
|
);
|
|
1970
|
-
},
|
|
1989
|
+
}, Gt = ({
|
|
1971
1990
|
avatarId: e,
|
|
1972
1991
|
avatarName: t,
|
|
1973
1992
|
avatarImage: s,
|
|
@@ -2011,7 +2030,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2011
2030
|
] })
|
|
2012
2031
|
}
|
|
2013
2032
|
);
|
|
2014
|
-
function
|
|
2033
|
+
function Ja(e, t) {
|
|
2015
2034
|
var a;
|
|
2016
2035
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2017
2036
|
for (const r of Object.values(s)) {
|
|
@@ -2020,10 +2039,10 @@ function Wa(e, t) {
|
|
|
2020
2039
|
return i;
|
|
2021
2040
|
}
|
|
2022
2041
|
}
|
|
2023
|
-
const
|
|
2042
|
+
const Za = () => null, Qa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2024
2043
|
"div",
|
|
2025
2044
|
{
|
|
2026
|
-
className:
|
|
2045
|
+
className: y("flex items-center justify-center h-full", e),
|
|
2027
2046
|
children: [
|
|
2028
2047
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2029
2048
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2063,12 +2082,12 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2063
2082
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2064
2083
|
]
|
|
2065
2084
|
}
|
|
2066
|
-
), Re =
|
|
2067
|
-
/* @__PURE__ */ n(
|
|
2085
|
+
), Re = j.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2086
|
+
/* @__PURE__ */ n(Qa, { className: "w-6 h-6" }),
|
|
2068
2087
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2069
2088
|
] }) }));
|
|
2070
2089
|
Re.displayName = "LoadingState";
|
|
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",
|
|
2090
|
+
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", er = ({
|
|
2072
2091
|
onBack: e,
|
|
2073
2092
|
showBackButton: t,
|
|
2074
2093
|
showStarButton: s = !1,
|
|
@@ -2083,33 +2102,34 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2083
2102
|
onReportParticipantClick: m,
|
|
2084
2103
|
customChannelActions: f,
|
|
2085
2104
|
renderChannelActions: c,
|
|
2086
|
-
showChannelInfo:
|
|
2105
|
+
showChannelInfo: w = !0,
|
|
2087
2106
|
onParticipantNameClick: N,
|
|
2088
|
-
renderHeaderTitleBadges:
|
|
2107
|
+
renderHeaderTitleBadges: p
|
|
2089
2108
|
}) => {
|
|
2090
|
-
var _, M,
|
|
2091
|
-
const { channel:
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2109
|
+
var _, M, k, I, C, O, P;
|
|
2110
|
+
const { channel: v } = de(), b = j.useMemo(
|
|
2111
|
+
() => {
|
|
2112
|
+
var U, W;
|
|
2113
|
+
return Ze(
|
|
2114
|
+
(U = v.state) == null ? void 0 : U.members,
|
|
2115
|
+
(W = v._client) == null ? void 0 : W.userID,
|
|
2116
|
+
v.type
|
|
2117
|
+
);
|
|
2118
|
+
},
|
|
2119
|
+
[(_ = v.state) == null ? void 0 : _.members, (M = v._client) == null ? void 0 : M.userID, v.type]
|
|
2120
|
+
), S = Zt(b == null ? void 0 : b.user), A = (k = b == null ? void 0 : b.user) == null ? void 0 : k.image, E = Jt(v), L = p == null ? void 0 : p({
|
|
2121
|
+
channel: v,
|
|
2122
|
+
participant: b
|
|
2123
|
+
}), D = "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", R = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", F = /* @__PURE__ */ h(se, { children: [
|
|
2124
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: S }),
|
|
2125
|
+
L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
|
|
2126
|
+
] }), z = async () => {
|
|
2107
2127
|
try {
|
|
2108
|
-
E ? await
|
|
2109
|
-
} catch (
|
|
2128
|
+
E ? await v.unpin() : await v.pin();
|
|
2129
|
+
} catch (U) {
|
|
2110
2130
|
console.error(
|
|
2111
2131
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2112
|
-
|
|
2132
|
+
U
|
|
2113
2133
|
);
|
|
2114
2134
|
}
|
|
2115
2135
|
};
|
|
@@ -2118,7 +2138,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2118
2138
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2119
2139
|
"button",
|
|
2120
2140
|
{
|
|
2121
|
-
className:
|
|
2141
|
+
className: y(
|
|
2122
2142
|
oe,
|
|
2123
2143
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2124
2144
|
),
|
|
@@ -2126,7 +2146,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2126
2146
|
}),
|
|
2127
2147
|
type: "button",
|
|
2128
2148
|
"aria-label": "Back to conversations",
|
|
2129
|
-
children: /* @__PURE__ */ n(
|
|
2149
|
+
children: /* @__PURE__ */ n(Ot, { className: "size-5 text-black/90" })
|
|
2130
2150
|
}
|
|
2131
2151
|
) }),
|
|
2132
2152
|
/* @__PURE__ */ n(
|
|
@@ -2139,25 +2159,25 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2139
2159
|
{
|
|
2140
2160
|
type: "button",
|
|
2141
2161
|
onClick: N,
|
|
2142
|
-
"aria-label": `View details for ${
|
|
2143
|
-
className:
|
|
2144
|
-
|
|
2162
|
+
"aria-label": `View details for ${S}`,
|
|
2163
|
+
className: y(
|
|
2164
|
+
D,
|
|
2145
2165
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2146
2166
|
),
|
|
2147
2167
|
children: [
|
|
2148
2168
|
/* @__PURE__ */ n(
|
|
2149
2169
|
ne,
|
|
2150
2170
|
{
|
|
2151
|
-
id: ((I =
|
|
2152
|
-
name:
|
|
2153
|
-
image:
|
|
2171
|
+
id: ((I = b == null ? void 0 : b.user) == null ? void 0 : I.id) || v.id || "unknown",
|
|
2172
|
+
name: S,
|
|
2173
|
+
image: A,
|
|
2154
2174
|
starred: s && E,
|
|
2155
2175
|
dmAgentEnabled: a,
|
|
2156
2176
|
size: 48
|
|
2157
2177
|
}
|
|
2158
2178
|
),
|
|
2159
2179
|
/* @__PURE__ */ h("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
2160
|
-
|
|
2180
|
+
F,
|
|
2161
2181
|
/* @__PURE__ */ n(ve, { className: "size-3 shrink-0", weight: "bold" })
|
|
2162
2182
|
] }),
|
|
2163
2183
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
@@ -2166,20 +2186,20 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2166
2186
|
] })
|
|
2167
2187
|
]
|
|
2168
2188
|
}
|
|
2169
|
-
) : /* @__PURE__ */ h("div", { className:
|
|
2189
|
+
) : /* @__PURE__ */ h("div", { className: D, children: [
|
|
2170
2190
|
/* @__PURE__ */ n(
|
|
2171
2191
|
ne,
|
|
2172
2192
|
{
|
|
2173
|
-
id: ((C =
|
|
2174
|
-
name:
|
|
2175
|
-
image:
|
|
2193
|
+
id: ((C = b == null ? void 0 : b.user) == null ? void 0 : C.id) || v.id || "unknown",
|
|
2194
|
+
name: S,
|
|
2195
|
+
image: A,
|
|
2176
2196
|
starred: s && E,
|
|
2177
2197
|
dmAgentEnabled: a,
|
|
2178
2198
|
size: 48
|
|
2179
2199
|
}
|
|
2180
2200
|
),
|
|
2181
2201
|
/* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
2182
|
-
|
|
2202
|
+
F,
|
|
2183
2203
|
/* @__PURE__ */ n(
|
|
2184
2204
|
ve,
|
|
2185
2205
|
{
|
|
@@ -2200,13 +2220,13 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2200
2220
|
"button",
|
|
2201
2221
|
{
|
|
2202
2222
|
className: oe,
|
|
2203
|
-
onClick:
|
|
2223
|
+
onClick: z,
|
|
2204
2224
|
type: "button",
|
|
2205
2225
|
"aria-label": E ? "Unstar conversation" : "Star conversation",
|
|
2206
2226
|
children: /* @__PURE__ */ n(
|
|
2207
2227
|
Ge,
|
|
2208
2228
|
{
|
|
2209
|
-
className:
|
|
2229
|
+
className: y("size-5", {
|
|
2210
2230
|
"text-yellow-600": E,
|
|
2211
2231
|
"text-black/90": !E
|
|
2212
2232
|
}),
|
|
@@ -2215,11 +2235,11 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2215
2235
|
)
|
|
2216
2236
|
}
|
|
2217
2237
|
),
|
|
2218
|
-
|
|
2219
|
-
|
|
2238
|
+
w && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2239
|
+
Bt,
|
|
2220
2240
|
{
|
|
2221
|
-
channel:
|
|
2222
|
-
participant:
|
|
2241
|
+
channel: v,
|
|
2242
|
+
participant: b,
|
|
2223
2243
|
showDeleteConversation: l,
|
|
2224
2244
|
showBlockParticipant: o,
|
|
2225
2245
|
showReportParticipant: d,
|
|
@@ -2229,7 +2249,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2229
2249
|
onBlockParticipantClick: g,
|
|
2230
2250
|
onReportParticipantClick: m,
|
|
2231
2251
|
customChannelActions: f,
|
|
2232
|
-
triggerClassName:
|
|
2252
|
+
triggerClassName: y(oe, "bg-[#F1F0EE]")
|
|
2233
2253
|
}
|
|
2234
2254
|
))
|
|
2235
2255
|
] })
|
|
@@ -2239,14 +2259,14 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2239
2259
|
t && e && /* @__PURE__ */ n(
|
|
2240
2260
|
"button",
|
|
2241
2261
|
{
|
|
2242
|
-
className:
|
|
2262
|
+
className: y(
|
|
2243
2263
|
oe,
|
|
2244
2264
|
"messaging-channel-view-back-button-desktop"
|
|
2245
2265
|
),
|
|
2246
2266
|
type: "button",
|
|
2247
2267
|
onClick: e,
|
|
2248
2268
|
"aria-label": "Back to conversations",
|
|
2249
|
-
children: /* @__PURE__ */ n(
|
|
2269
|
+
children: /* @__PURE__ */ n(Ot, { className: "size-5 text-black/90" })
|
|
2250
2270
|
}
|
|
2251
2271
|
),
|
|
2252
2272
|
N ? /* @__PURE__ */ h(
|
|
@@ -2254,18 +2274,18 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2254
2274
|
{
|
|
2255
2275
|
type: "button",
|
|
2256
2276
|
onClick: N,
|
|
2257
|
-
"aria-label": `View details for ${
|
|
2258
|
-
className:
|
|
2259
|
-
|
|
2277
|
+
"aria-label": `View details for ${S}`,
|
|
2278
|
+
className: y(
|
|
2279
|
+
R,
|
|
2260
2280
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2261
2281
|
),
|
|
2262
2282
|
children: [
|
|
2263
2283
|
/* @__PURE__ */ n(
|
|
2264
2284
|
ne,
|
|
2265
2285
|
{
|
|
2266
|
-
id: ((
|
|
2267
|
-
name:
|
|
2268
|
-
image:
|
|
2286
|
+
id: ((O = b == null ? void 0 : b.user) == null ? void 0 : O.id) || v.id || "unknown",
|
|
2287
|
+
name: S,
|
|
2288
|
+
image: A,
|
|
2269
2289
|
starred: s && E,
|
|
2270
2290
|
dmAgentEnabled: a,
|
|
2271
2291
|
size: 48
|
|
@@ -2273,7 +2293,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2273
2293
|
),
|
|
2274
2294
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2275
2295
|
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2276
|
-
|
|
2296
|
+
F,
|
|
2277
2297
|
/* @__PURE__ */ n(ve, { className: "size-4 shrink-0", weight: "bold" })
|
|
2278
2298
|
] }),
|
|
2279
2299
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
@@ -2283,13 +2303,13 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2283
2303
|
] })
|
|
2284
2304
|
]
|
|
2285
2305
|
}
|
|
2286
|
-
) : /* @__PURE__ */ h("div", { className:
|
|
2306
|
+
) : /* @__PURE__ */ h("div", { className: R, children: [
|
|
2287
2307
|
/* @__PURE__ */ n(
|
|
2288
2308
|
ne,
|
|
2289
2309
|
{
|
|
2290
|
-
id: ((
|
|
2291
|
-
name:
|
|
2292
|
-
image:
|
|
2310
|
+
id: ((P = b == null ? void 0 : b.user) == null ? void 0 : P.id) || v.id || "unknown",
|
|
2311
|
+
name: S,
|
|
2312
|
+
image: A,
|
|
2293
2313
|
starred: s && E,
|
|
2294
2314
|
dmAgentEnabled: a,
|
|
2295
2315
|
size: 48
|
|
@@ -2297,7 +2317,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2297
2317
|
),
|
|
2298
2318
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2299
2319
|
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2300
|
-
|
|
2320
|
+
F,
|
|
2301
2321
|
/* @__PURE__ */ n(
|
|
2302
2322
|
ve,
|
|
2303
2323
|
{
|
|
@@ -2318,13 +2338,13 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2318
2338
|
"button",
|
|
2319
2339
|
{
|
|
2320
2340
|
className: oe,
|
|
2321
|
-
onClick:
|
|
2341
|
+
onClick: z,
|
|
2322
2342
|
type: "button",
|
|
2323
2343
|
"aria-label": E ? "Unstar conversation" : "Star conversation",
|
|
2324
2344
|
children: /* @__PURE__ */ n(
|
|
2325
2345
|
Ge,
|
|
2326
2346
|
{
|
|
2327
|
-
className:
|
|
2347
|
+
className: y("size-6", {
|
|
2328
2348
|
"text-yellow-600": E,
|
|
2329
2349
|
"text-black/90": !E
|
|
2330
2350
|
}),
|
|
@@ -2333,11 +2353,11 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2333
2353
|
)
|
|
2334
2354
|
}
|
|
2335
2355
|
),
|
|
2336
|
-
|
|
2337
|
-
|
|
2356
|
+
w && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2357
|
+
Bt,
|
|
2338
2358
|
{
|
|
2339
|
-
channel:
|
|
2340
|
-
participant:
|
|
2359
|
+
channel: v,
|
|
2360
|
+
participant: b,
|
|
2341
2361
|
showDeleteConversation: l,
|
|
2342
2362
|
showBlockParticipant: o,
|
|
2343
2363
|
showReportParticipant: d,
|
|
@@ -2353,7 +2373,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2353
2373
|
] })
|
|
2354
2374
|
] })
|
|
2355
2375
|
] });
|
|
2356
|
-
},
|
|
2376
|
+
}, tr = ({
|
|
2357
2377
|
onBack: e,
|
|
2358
2378
|
showBackButton: t,
|
|
2359
2379
|
renderMessageInputActions: s,
|
|
@@ -2368,67 +2388,68 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2368
2388
|
showBlockParticipant: m = !0,
|
|
2369
2389
|
showReportParticipant: f = !0,
|
|
2370
2390
|
composerDisabled: c = !1,
|
|
2371
|
-
composerDisabledReason:
|
|
2391
|
+
composerDisabledReason: w,
|
|
2372
2392
|
showStarButton: N = !1,
|
|
2373
|
-
chatbotVotingEnabled:
|
|
2374
|
-
renderChannelBanner:
|
|
2375
|
-
renderHeaderTitleBadges:
|
|
2376
|
-
customChannelActions:
|
|
2377
|
-
renderChannelActions:
|
|
2393
|
+
chatbotVotingEnabled: p = !1,
|
|
2394
|
+
renderChannelBanner: v,
|
|
2395
|
+
renderHeaderTitleBadges: b,
|
|
2396
|
+
customChannelActions: S,
|
|
2397
|
+
renderChannelActions: A,
|
|
2378
2398
|
renderMessage: E,
|
|
2379
|
-
dmAgentEnabled:
|
|
2380
|
-
viewerLanguage:
|
|
2381
|
-
showChannelInfo:
|
|
2382
|
-
onParticipantNameClick:
|
|
2383
|
-
composerInput:
|
|
2399
|
+
dmAgentEnabled: L = !1,
|
|
2400
|
+
viewerLanguage: D,
|
|
2401
|
+
showChannelInfo: R = !0,
|
|
2402
|
+
onParticipantNameClick: F,
|
|
2403
|
+
composerInput: z
|
|
2384
2404
|
}) => {
|
|
2385
|
-
var
|
|
2386
|
-
const { channel: _ } = de(), M =
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2405
|
+
var U, W, ee, Y, x, T;
|
|
2406
|
+
const { channel: _ } = de(), M = j.useMemo(
|
|
2407
|
+
() => {
|
|
2408
|
+
var B, V;
|
|
2409
|
+
return Ze(
|
|
2410
|
+
(B = _.state) == null ? void 0 : B.members,
|
|
2411
|
+
(V = _._client) == null ? void 0 : V.userID,
|
|
2412
|
+
_.type
|
|
2413
|
+
);
|
|
2414
|
+
},
|
|
2415
|
+
[(U = _.state) == null ? void 0 : U.members, (W = _._client) == null ? void 0 : W.userID, _.type]
|
|
2416
|
+
), k = j.useMemo(() => {
|
|
2417
|
+
var K, G;
|
|
2418
|
+
const B = (K = _._client) == null ? void 0 : K.userID;
|
|
2419
|
+
return B ? Object.values(((G = _.state) == null ? void 0 : G.members) || {}).find((J) => {
|
|
2420
|
+
var Z;
|
|
2421
|
+
return ((Z = J.user) == null ? void 0 : Z.id) === B;
|
|
2401
2422
|
}) : void 0;
|
|
2402
|
-
}, [(
|
|
2403
|
-
(
|
|
2404
|
-
const { message:
|
|
2405
|
-
|
|
2423
|
+
}, [(ee = _._client) == null ? void 0 : ee.userID, (Y = _.state) == null ? void 0 : Y.members]), I = ((x = k == null ? void 0 : k.user) == null ? void 0 : x.is_account) ?? (k == null ? void 0 : k.is_account), C = ((T = M == null ? void 0 : M.user) == null ? void 0 : T.is_account) ?? (M == null ? void 0 : M.is_account), O = L && I === !1 && C === !0, P = X(
|
|
2424
|
+
(B) => {
|
|
2425
|
+
const { message: V } = ye("ChannelView"), K = /* @__PURE__ */ n(
|
|
2426
|
+
Aa,
|
|
2406
2427
|
{
|
|
2407
|
-
...
|
|
2408
|
-
chatbotVotingEnabled:
|
|
2409
|
-
viewerLanguage:
|
|
2428
|
+
...B,
|
|
2429
|
+
chatbotVotingEnabled: p,
|
|
2430
|
+
viewerLanguage: D
|
|
2410
2431
|
}
|
|
2411
2432
|
);
|
|
2412
|
-
return !E || !
|
|
2433
|
+
return !E || !V ? K : E(K, V);
|
|
2413
2434
|
},
|
|
2414
|
-
[
|
|
2435
|
+
[p, E, D]
|
|
2415
2436
|
);
|
|
2416
2437
|
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
2417
|
-
|
|
2438
|
+
cs,
|
|
2418
2439
|
{
|
|
2419
2440
|
overrides: {
|
|
2420
|
-
Message:
|
|
2421
|
-
MessageActions:
|
|
2441
|
+
Message: P,
|
|
2442
|
+
MessageActions: La
|
|
2422
2443
|
},
|
|
2423
|
-
children: /* @__PURE__ */ h(
|
|
2444
|
+
children: /* @__PURE__ */ h(ds, { children: [
|
|
2424
2445
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2425
|
-
|
|
2446
|
+
er,
|
|
2426
2447
|
{
|
|
2427
2448
|
onBack: e,
|
|
2428
2449
|
showBackButton: t,
|
|
2429
|
-
showChannelInfo:
|
|
2450
|
+
showChannelInfo: R,
|
|
2430
2451
|
showStarButton: N,
|
|
2431
|
-
dmAgentEnabled:
|
|
2452
|
+
dmAgentEnabled: O,
|
|
2432
2453
|
onLeaveConversation: i,
|
|
2433
2454
|
onBlockParticipant: l,
|
|
2434
2455
|
showDeleteConversation: o,
|
|
@@ -2437,39 +2458,39 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2437
2458
|
onDeleteConversationClick: d,
|
|
2438
2459
|
onBlockParticipantClick: u,
|
|
2439
2460
|
onReportParticipantClick: g,
|
|
2440
|
-
customChannelActions:
|
|
2441
|
-
renderChannelActions:
|
|
2442
|
-
onParticipantNameClick:
|
|
2443
|
-
renderHeaderTitleBadges:
|
|
2461
|
+
customChannelActions: S,
|
|
2462
|
+
renderChannelActions: A,
|
|
2463
|
+
onParticipantNameClick: F,
|
|
2464
|
+
renderHeaderTitleBadges: b
|
|
2444
2465
|
}
|
|
2445
2466
|
) }, "lt-channel-header"),
|
|
2446
|
-
|
|
2467
|
+
v ? /* @__PURE__ */ n(j.Fragment, { children: v() }, "lt-channel-banner") : null,
|
|
2447
2468
|
/* @__PURE__ */ n(
|
|
2448
2469
|
"div",
|
|
2449
2470
|
{
|
|
2450
2471
|
className: "flex-1 overflow-hidden relative",
|
|
2451
|
-
children: /* @__PURE__ */ n(
|
|
2472
|
+
children: /* @__PURE__ */ n(us, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2452
2473
|
},
|
|
2453
2474
|
"lt-channel-message-list"
|
|
2454
2475
|
),
|
|
2455
|
-
r ? /* @__PURE__ */ n(
|
|
2476
|
+
r ? /* @__PURE__ */ n(j.Fragment, { children: r(_) }, "lt-channel-conversation-footer") : null,
|
|
2456
2477
|
/* @__PURE__ */ n(
|
|
2457
|
-
|
|
2478
|
+
Fa,
|
|
2458
2479
|
{
|
|
2459
2480
|
...s && {
|
|
2460
2481
|
renderActions: () => s == null ? void 0 : s(_)
|
|
2461
2482
|
},
|
|
2462
2483
|
renderFooter: () => a == null ? void 0 : a(_),
|
|
2463
2484
|
disabled: c,
|
|
2464
|
-
disabledReason:
|
|
2465
|
-
composerInput:
|
|
2485
|
+
disabledReason: w,
|
|
2486
|
+
composerInput: z
|
|
2466
2487
|
},
|
|
2467
2488
|
"lt-channel-message-input"
|
|
2468
2489
|
)
|
|
2469
2490
|
] })
|
|
2470
2491
|
}
|
|
2471
2492
|
) });
|
|
2472
|
-
},
|
|
2493
|
+
}, hn = j.memo(
|
|
2473
2494
|
({
|
|
2474
2495
|
channel: e,
|
|
2475
2496
|
onBack: t,
|
|
@@ -2480,86 +2501,86 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2480
2501
|
onLeaveConversation: l,
|
|
2481
2502
|
onBlockParticipant: o,
|
|
2482
2503
|
className: d,
|
|
2483
|
-
CustomChannelEmptyState: u =
|
|
2504
|
+
CustomChannelEmptyState: u = Za,
|
|
2484
2505
|
showDeleteConversation: g = !0,
|
|
2485
2506
|
onDeleteConversationClick: m,
|
|
2486
2507
|
onBlockParticipantClick: f,
|
|
2487
2508
|
onReportParticipantClick: c,
|
|
2488
|
-
showBlockParticipant:
|
|
2509
|
+
showBlockParticipant: w = !0,
|
|
2489
2510
|
showReportParticipant: N = !0,
|
|
2490
|
-
composerDisabled:
|
|
2491
|
-
composerDisabledReason:
|
|
2492
|
-
dmAgentEnabled:
|
|
2493
|
-
messageMetadata:
|
|
2494
|
-
onMessageSent:
|
|
2511
|
+
composerDisabled: p = !1,
|
|
2512
|
+
composerDisabledReason: v,
|
|
2513
|
+
dmAgentEnabled: b,
|
|
2514
|
+
messageMetadata: S,
|
|
2515
|
+
onMessageSent: A,
|
|
2495
2516
|
showStarButton: E = !1,
|
|
2496
|
-
chatbotVotingEnabled:
|
|
2497
|
-
renderChannelBanner:
|
|
2498
|
-
renderHeaderTitleBadges:
|
|
2499
|
-
customChannelActions:
|
|
2500
|
-
renderChannelActions:
|
|
2517
|
+
chatbotVotingEnabled: L = !1,
|
|
2518
|
+
renderChannelBanner: D,
|
|
2519
|
+
renderHeaderTitleBadges: R,
|
|
2520
|
+
customChannelActions: F,
|
|
2521
|
+
renderChannelActions: z,
|
|
2501
2522
|
renderMessage: _,
|
|
2502
2523
|
onMessageLinkClick: M,
|
|
2503
|
-
sendButton:
|
|
2524
|
+
sendButton: k,
|
|
2504
2525
|
attachmentPreviewList: I,
|
|
2505
2526
|
viewerLanguage: C,
|
|
2506
|
-
showChannelInfo:
|
|
2507
|
-
onParticipantNameClick:
|
|
2508
|
-
composerInput:
|
|
2527
|
+
showChannelInfo: O = !0,
|
|
2528
|
+
onParticipantNameClick: P,
|
|
2529
|
+
composerInput: U
|
|
2509
2530
|
}) => {
|
|
2510
|
-
const
|
|
2511
|
-
async (
|
|
2512
|
-
var
|
|
2513
|
-
const
|
|
2531
|
+
const W = X(
|
|
2532
|
+
async (Y, x, T) => {
|
|
2533
|
+
var Z;
|
|
2534
|
+
const B = ((Z = e.data) == null ? void 0 : Z.chatbot_paused) === !0, V = b && !B, K = {
|
|
2514
2535
|
...x,
|
|
2515
|
-
...
|
|
2516
|
-
...
|
|
2536
|
+
...V && { silent: !0 },
|
|
2537
|
+
...S && {
|
|
2517
2538
|
metadata: {
|
|
2518
2539
|
...x.metadata ?? {},
|
|
2519
|
-
...
|
|
2540
|
+
...S
|
|
2520
2541
|
}
|
|
2521
2542
|
}
|
|
2522
|
-
},
|
|
2523
|
-
...
|
|
2524
|
-
...
|
|
2525
|
-
},
|
|
2526
|
-
return
|
|
2543
|
+
}, G = {
|
|
2544
|
+
...T,
|
|
2545
|
+
...V && { skip_push: !0 }
|
|
2546
|
+
}, J = await e.sendMessage(K, G);
|
|
2547
|
+
return A == null || A(J), J;
|
|
2527
2548
|
},
|
|
2528
|
-
[e,
|
|
2529
|
-
),
|
|
2530
|
-
return
|
|
2549
|
+
[e, b, S, A]
|
|
2550
|
+
), ee = H(null);
|
|
2551
|
+
return q(() => {
|
|
2531
2552
|
if (!M) return;
|
|
2532
|
-
const
|
|
2533
|
-
if (!
|
|
2534
|
-
const x = (
|
|
2535
|
-
const
|
|
2536
|
-
if (!
|
|
2537
|
-
const
|
|
2538
|
-
M(
|
|
2553
|
+
const Y = ee.current;
|
|
2554
|
+
if (!Y) return;
|
|
2555
|
+
const x = (T) => {
|
|
2556
|
+
const B = T.target, V = B == null ? void 0 : B.closest("a[href]"), K = V == null ? void 0 : V.getAttribute("href");
|
|
2557
|
+
if (!K) return;
|
|
2558
|
+
const G = V == null ? void 0 : V.closest("[data-message-id]"), J = G == null ? void 0 : G.getAttribute("data-message-id"), Z = J ? e.state.messages.find((ue) => ue.id === J) : void 0;
|
|
2559
|
+
M(K, Z);
|
|
2539
2560
|
};
|
|
2540
|
-
return
|
|
2561
|
+
return Y.addEventListener("click", x), () => Y.removeEventListener("click", x);
|
|
2541
2562
|
}, [M, e]), /* @__PURE__ */ n(
|
|
2542
2563
|
"div",
|
|
2543
2564
|
{
|
|
2544
|
-
ref:
|
|
2545
|
-
className:
|
|
2565
|
+
ref: ee,
|
|
2566
|
+
className: y(
|
|
2546
2567
|
"messaging-channel-view h-full flex flex-col",
|
|
2547
2568
|
d
|
|
2548
2569
|
),
|
|
2549
|
-
children: /* @__PURE__ */ n(
|
|
2550
|
-
|
|
2570
|
+
children: /* @__PURE__ */ n(mn.Provider, { value: b ?? !1, children: /* @__PURE__ */ n(
|
|
2571
|
+
os,
|
|
2551
2572
|
{
|
|
2552
2573
|
channel: e,
|
|
2553
|
-
MessageSystem:
|
|
2574
|
+
MessageSystem: Wa,
|
|
2554
2575
|
EmptyStateIndicator: u,
|
|
2555
2576
|
LoadingIndicator: Re,
|
|
2556
|
-
DateSeparator:
|
|
2557
|
-
TypingIndicator:
|
|
2558
|
-
doSendMessageRequest:
|
|
2559
|
-
...
|
|
2577
|
+
DateSeparator: Ys,
|
|
2578
|
+
TypingIndicator: Ka,
|
|
2579
|
+
doSendMessageRequest: W,
|
|
2580
|
+
...k ? { SendButton: k } : {},
|
|
2560
2581
|
...I ? { AttachmentPreviewList: I } : {},
|
|
2561
2582
|
children: /* @__PURE__ */ n(
|
|
2562
|
-
|
|
2583
|
+
tr,
|
|
2563
2584
|
{
|
|
2564
2585
|
onBack: t,
|
|
2565
2586
|
showBackButton: s,
|
|
@@ -2573,22 +2594,22 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2573
2594
|
onDeleteConversationClick: m,
|
|
2574
2595
|
onBlockParticipantClick: f,
|
|
2575
2596
|
onReportParticipantClick: c,
|
|
2576
|
-
showBlockParticipant:
|
|
2597
|
+
showBlockParticipant: w,
|
|
2577
2598
|
showReportParticipant: N,
|
|
2578
|
-
composerDisabled:
|
|
2579
|
-
composerDisabledReason:
|
|
2599
|
+
composerDisabled: p,
|
|
2600
|
+
composerDisabledReason: v,
|
|
2580
2601
|
showStarButton: E,
|
|
2581
|
-
dmAgentEnabled:
|
|
2582
|
-
chatbotVotingEnabled:
|
|
2583
|
-
renderChannelBanner:
|
|
2584
|
-
renderHeaderTitleBadges:
|
|
2585
|
-
customChannelActions:
|
|
2586
|
-
renderChannelActions:
|
|
2602
|
+
dmAgentEnabled: b,
|
|
2603
|
+
chatbotVotingEnabled: L,
|
|
2604
|
+
renderChannelBanner: D,
|
|
2605
|
+
renderHeaderTitleBadges: R,
|
|
2606
|
+
customChannelActions: F,
|
|
2607
|
+
renderChannelActions: z,
|
|
2587
2608
|
renderMessage: _,
|
|
2588
2609
|
viewerLanguage: C,
|
|
2589
|
-
showChannelInfo:
|
|
2590
|
-
onParticipantNameClick:
|
|
2591
|
-
composerInput:
|
|
2610
|
+
showChannelInfo: O,
|
|
2611
|
+
onParticipantNameClick: P,
|
|
2612
|
+
composerInput: U
|
|
2592
2613
|
}
|
|
2593
2614
|
)
|
|
2594
2615
|
}
|
|
@@ -2597,8 +2618,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2597
2618
|
);
|
|
2598
2619
|
}
|
|
2599
2620
|
);
|
|
2600
|
-
|
|
2601
|
-
const xe =
|
|
2621
|
+
hn.displayName = "ChannelView";
|
|
2622
|
+
const xe = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
|
|
2602
2623
|
/* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2603
2624
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2604
2625
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2613,7 +2634,7 @@ const xe = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2613
2634
|
)
|
|
2614
2635
|
] }) }));
|
|
2615
2636
|
xe.displayName = "ErrorState";
|
|
2616
|
-
const
|
|
2637
|
+
const Ti = ({
|
|
2617
2638
|
capabilities: e = {},
|
|
2618
2639
|
renderMessageInputActions: t,
|
|
2619
2640
|
renderConversationFooter: s,
|
|
@@ -2628,66 +2649,66 @@ const Ei = ({
|
|
|
2628
2649
|
onMessageSent: m,
|
|
2629
2650
|
chatbotVotingEnabled: f = !1,
|
|
2630
2651
|
viewerLanguage: c,
|
|
2631
|
-
renderHeaderTitleBadges:
|
|
2652
|
+
renderHeaderTitleBadges: w,
|
|
2632
2653
|
renderChannelBanner: N,
|
|
2633
|
-
customChannelActions:
|
|
2634
|
-
renderChannelActions:
|
|
2635
|
-
onParticipantNameClick:
|
|
2636
|
-
renderMessage:
|
|
2637
|
-
onMessageLinkClick:
|
|
2654
|
+
customChannelActions: p,
|
|
2655
|
+
renderChannelActions: v,
|
|
2656
|
+
onParticipantNameClick: b,
|
|
2657
|
+
renderMessage: S,
|
|
2658
|
+
onMessageLinkClick: A,
|
|
2638
2659
|
showChannelInfo: E,
|
|
2639
|
-
composerInput:
|
|
2660
|
+
composerInput: L
|
|
2640
2661
|
}) => {
|
|
2641
2662
|
const {
|
|
2642
|
-
client:
|
|
2643
|
-
isConnected:
|
|
2644
|
-
isLoading:
|
|
2645
|
-
error:
|
|
2663
|
+
client: D,
|
|
2664
|
+
isConnected: R,
|
|
2665
|
+
isLoading: F,
|
|
2666
|
+
error: z,
|
|
2646
2667
|
refreshConnection: _,
|
|
2647
2668
|
service: M,
|
|
2648
|
-
debug:
|
|
2649
|
-
} =
|
|
2650
|
-
|
|
2651
|
-
const x =
|
|
2669
|
+
debug: k
|
|
2670
|
+
} = Os(), [I, C] = $(null), [O, P] = $(null), [U, W] = $(!1), { showDeleteConversation: ee = !0 } = e, Y = H(l);
|
|
2671
|
+
Y.current = l;
|
|
2672
|
+
const x = H(a);
|
|
2652
2673
|
x.current = a;
|
|
2653
|
-
const
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
}, [I]),
|
|
2657
|
-
if (!
|
|
2658
|
-
const
|
|
2659
|
-
if (!
|
|
2660
|
-
const
|
|
2661
|
-
if (
|
|
2662
|
-
|
|
2663
|
-
const
|
|
2664
|
-
|
|
2674
|
+
const T = H(null), B = H(null);
|
|
2675
|
+
q(() => {
|
|
2676
|
+
B.current = I;
|
|
2677
|
+
}, [I]), q(() => {
|
|
2678
|
+
if (!D || !R) return;
|
|
2679
|
+
const G = D.userID;
|
|
2680
|
+
if (!G) return;
|
|
2681
|
+
const J = `${G}::${i}`;
|
|
2682
|
+
if (T.current === J) return;
|
|
2683
|
+
T.current = J;
|
|
2684
|
+
const Z = () => {
|
|
2685
|
+
T.current === J && (T.current = null);
|
|
2665
2686
|
};
|
|
2666
2687
|
(async () => {
|
|
2667
2688
|
var me, he;
|
|
2668
2689
|
try {
|
|
2669
|
-
|
|
2690
|
+
k && console.log(
|
|
2670
2691
|
"[MessagingShell] Loading initial conversation with:",
|
|
2671
2692
|
i
|
|
2672
2693
|
);
|
|
2673
|
-
const
|
|
2694
|
+
const Q = await D.queryChannels(
|
|
2674
2695
|
{
|
|
2675
2696
|
type: "messaging",
|
|
2676
|
-
members: { $eq: [
|
|
2697
|
+
members: { $eq: [G, i] }
|
|
2677
2698
|
},
|
|
2678
2699
|
{},
|
|
2679
2700
|
{ limit: 1 }
|
|
2680
2701
|
);
|
|
2681
|
-
if (
|
|
2682
|
-
C(
|
|
2702
|
+
if (Q.length > 0) {
|
|
2703
|
+
C(Q[0]), P(null), (me = x.current) == null || me.call(x, Q[0]), k && console.log(
|
|
2683
2704
|
"[MessagingShell] Initial conversation loaded:",
|
|
2684
|
-
|
|
2705
|
+
Q[0].id
|
|
2685
2706
|
);
|
|
2686
2707
|
return;
|
|
2687
2708
|
}
|
|
2688
|
-
const te =
|
|
2709
|
+
const te = Y.current;
|
|
2689
2710
|
if (!te || !M) {
|
|
2690
|
-
|
|
2711
|
+
Z(), P("No conversation found with this account"), k && console.log(
|
|
2691
2712
|
"[MessagingShell] No conversation found for:",
|
|
2692
2713
|
i
|
|
2693
2714
|
);
|
|
@@ -2699,7 +2720,7 @@ const Ei = ({
|
|
|
2699
2720
|
name: te.name,
|
|
2700
2721
|
phone: te.phone
|
|
2701
2722
|
});
|
|
2702
|
-
C(le),
|
|
2723
|
+
C(le), P(null), (he = x.current) == null || he.call(x, le), k && console.log(
|
|
2703
2724
|
"[MessagingShell] Channel created and loaded:",
|
|
2704
2725
|
le.id
|
|
2705
2726
|
);
|
|
@@ -2707,64 +2728,64 @@ const Ei = ({
|
|
|
2707
2728
|
console.error(
|
|
2708
2729
|
"[MessagingShell] Failed to create conversation:",
|
|
2709
2730
|
le
|
|
2710
|
-
),
|
|
2731
|
+
), Z(), P("Failed to create conversation");
|
|
2711
2732
|
}
|
|
2712
|
-
} catch (
|
|
2733
|
+
} catch (Q) {
|
|
2713
2734
|
console.error(
|
|
2714
2735
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2715
|
-
|
|
2716
|
-
),
|
|
2736
|
+
Q
|
|
2737
|
+
), Z(), B.current || P("Failed to load conversation");
|
|
2717
2738
|
}
|
|
2718
2739
|
})();
|
|
2719
|
-
}, [i,
|
|
2720
|
-
const
|
|
2721
|
-
|
|
2722
|
-
const
|
|
2723
|
-
var
|
|
2724
|
-
C(null),
|
|
2740
|
+
}, [i, D, R, M, k]);
|
|
2741
|
+
const V = H(r);
|
|
2742
|
+
V.current = r;
|
|
2743
|
+
const K = X(() => {
|
|
2744
|
+
var G;
|
|
2745
|
+
C(null), W(!0), (G = V.current) == null || G.call(V);
|
|
2725
2746
|
}, []);
|
|
2726
|
-
return
|
|
2747
|
+
return F ? /* @__PURE__ */ n(Re, {}) : z ? /* @__PURE__ */ n(xe, { message: z, onBack: _ }) : !R || !D ? /* @__PURE__ */ n(
|
|
2727
2748
|
xe,
|
|
2728
2749
|
{
|
|
2729
2750
|
message: "Not connected to messaging service",
|
|
2730
2751
|
onBack: _
|
|
2731
2752
|
}
|
|
2732
|
-
) :
|
|
2733
|
-
|
|
2753
|
+
) : O ? /* @__PURE__ */ n(xe, { message: O }) : U && !I ? /* @__PURE__ */ n(xe, { message: "Conversation ended" }) : I ? /* @__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(
|
|
2754
|
+
hn,
|
|
2734
2755
|
{
|
|
2735
2756
|
channel: I,
|
|
2736
2757
|
renderMessageInputActions: t,
|
|
2737
2758
|
renderConversationFooter: s,
|
|
2738
2759
|
renderChannelBanner: N,
|
|
2739
|
-
onLeaveConversation:
|
|
2740
|
-
onBlockParticipant:
|
|
2760
|
+
onLeaveConversation: K,
|
|
2761
|
+
onBlockParticipant: K,
|
|
2741
2762
|
CustomChannelEmptyState: o,
|
|
2742
|
-
showDeleteConversation:
|
|
2763
|
+
showDeleteConversation: ee,
|
|
2743
2764
|
onBlockParticipantClick: d,
|
|
2744
2765
|
onReportParticipantClick: u,
|
|
2745
2766
|
dmAgentEnabled: g,
|
|
2746
2767
|
onMessageSent: m,
|
|
2747
2768
|
chatbotVotingEnabled: f,
|
|
2748
2769
|
viewerLanguage: c,
|
|
2749
|
-
renderHeaderTitleBadges:
|
|
2750
|
-
customChannelActions:
|
|
2751
|
-
renderChannelActions:
|
|
2752
|
-
onParticipantNameClick:
|
|
2753
|
-
renderMessage:
|
|
2754
|
-
onMessageLinkClick:
|
|
2770
|
+
renderHeaderTitleBadges: w,
|
|
2771
|
+
customChannelActions: p,
|
|
2772
|
+
renderChannelActions: v,
|
|
2773
|
+
onParticipantNameClick: b,
|
|
2774
|
+
renderMessage: S,
|
|
2775
|
+
onMessageLinkClick: A,
|
|
2755
2776
|
showChannelInfo: E,
|
|
2756
|
-
composerInput:
|
|
2777
|
+
composerInput: L
|
|
2757
2778
|
},
|
|
2758
2779
|
I.id
|
|
2759
2780
|
) }) }) : /* @__PURE__ */ n(Re, {});
|
|
2760
2781
|
};
|
|
2761
|
-
function
|
|
2782
|
+
function nr(e) {
|
|
2762
2783
|
const t = e.state.pending_messages;
|
|
2763
2784
|
if (t != null && t.length)
|
|
2764
2785
|
for (const s of t)
|
|
2765
2786
|
e.state.addMessageSorted(s.message);
|
|
2766
2787
|
}
|
|
2767
|
-
const
|
|
2788
|
+
const fn = j.createContext({
|
|
2768
2789
|
selectedChannel: void 0,
|
|
2769
2790
|
onChannelSelect: () => {
|
|
2770
2791
|
},
|
|
@@ -2772,18 +2793,18 @@ const hn = V.createContext({
|
|
|
2772
2793
|
renderMessagePreview: void 0,
|
|
2773
2794
|
channelPreview: void 0,
|
|
2774
2795
|
viewerLanguage: void 0
|
|
2775
|
-
}),
|
|
2796
|
+
}), sr = fn.Provider, ar = () => j.useContext(fn), rr = (e, t) => {
|
|
2776
2797
|
const s = new Date(
|
|
2777
2798
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2778
2799
|
), r = new Date(
|
|
2779
2800
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
2780
2801
|
).getTime() - s.getTime();
|
|
2781
2802
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2782
|
-
},
|
|
2803
|
+
}, ir = (e) => {
|
|
2783
2804
|
const t = /* @__PURE__ */ new Date();
|
|
2784
2805
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
2785
2806
|
return "Just now";
|
|
2786
|
-
const a =
|
|
2807
|
+
const a = rr(e, t);
|
|
2787
2808
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
2788
2809
|
hour: "numeric",
|
|
2789
2810
|
minute: "2-digit",
|
|
@@ -2793,9 +2814,9 @@ const hn = V.createContext({
|
|
|
2793
2814
|
day: "numeric",
|
|
2794
2815
|
year: "2-digit"
|
|
2795
2816
|
});
|
|
2796
|
-
},
|
|
2817
|
+
}, gn = j.memo(
|
|
2797
2818
|
(e) => {
|
|
2798
|
-
var
|
|
2819
|
+
var D, R, F, z;
|
|
2799
2820
|
const { channel: t, unread: s } = e, {
|
|
2800
2821
|
selectedChannel: a,
|
|
2801
2822
|
onChannelSelect: r,
|
|
@@ -2803,7 +2824,7 @@ const hn = V.createContext({
|
|
|
2803
2824
|
channelPreview: l,
|
|
2804
2825
|
renderMessagePreview: o,
|
|
2805
2826
|
viewerLanguage: d
|
|
2806
|
-
} =
|
|
2827
|
+
} = ar(), u = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), g = Jt(t);
|
|
2807
2828
|
if (l)
|
|
2808
2829
|
return /* @__PURE__ */ n(
|
|
2809
2830
|
l,
|
|
@@ -2818,40 +2839,39 @@ const hn = V.createContext({
|
|
|
2818
2839
|
const m = () => {
|
|
2819
2840
|
t && r(t);
|
|
2820
2841
|
}, f = (_) => {
|
|
2821
|
-
const M = _.key === "Enter" || _.key === " ",
|
|
2822
|
-
!M ||
|
|
2823
|
-
},
|
|
2824
|
-
(
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
), N = Jt(b == null ? void 0 : b.user), w = (B = b == null ? void 0 : b.user) == null ? void 0 : B.image, p = (() => {
|
|
2842
|
+
const M = _.key === "Enter" || _.key === " ", k = _.repeat;
|
|
2843
|
+
!M || k || (_.preventDefault(), m());
|
|
2844
|
+
}, c = Ze(
|
|
2845
|
+
(D = t == null ? void 0 : t.state) == null ? void 0 : D.members,
|
|
2846
|
+
(R = t == null ? void 0 : t._client) == null ? void 0 : R.userID,
|
|
2847
|
+
t == null ? void 0 : t.type
|
|
2848
|
+
), w = Zt(c == null ? void 0 : c.user), N = (F = c == null ? void 0 : c.user) == null ? void 0 : F.image, p = (() => {
|
|
2829
2849
|
var M;
|
|
2830
2850
|
const _ = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
|
|
2831
2851
|
if (_ != null && _.length) {
|
|
2832
|
-
for (let
|
|
2833
|
-
if (_[
|
|
2852
|
+
for (let k = _.length - 1; k >= 0; k--)
|
|
2853
|
+
if (_[k].type !== "system") return _[k];
|
|
2834
2854
|
}
|
|
2835
|
-
})(),
|
|
2836
|
-
var
|
|
2837
|
-
const _ =
|
|
2855
|
+
})(), b = (() => {
|
|
2856
|
+
var O, P, U, W;
|
|
2857
|
+
const _ = Qt({
|
|
2838
2858
|
message: p,
|
|
2839
2859
|
viewerLanguage: d
|
|
2840
2860
|
});
|
|
2841
|
-
if (((
|
|
2842
|
-
if (((
|
|
2843
|
-
if (((
|
|
2861
|
+
if (((O = p == null ? void 0 : p.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_TIP") return _ ? `💵 ${_}` : "💵 Sent a tip";
|
|
2862
|
+
if (((P = p == null ? void 0 : p.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_PAID") return _ ? `💰 ${_}` : "💰 Sent a message";
|
|
2863
|
+
if (((U = p == null ? void 0 : p.metadata) == null ? void 0 : U.custom_type) === "MESSAGE_ATTACHMENT")
|
|
2844
2864
|
return _ ? `📎 ${_}` : "📎 Sent an attachment";
|
|
2845
2865
|
if (_) return _;
|
|
2846
|
-
const C = (
|
|
2866
|
+
const C = (W = p == null ? void 0 : p.attachments) == null ? void 0 : W[0];
|
|
2847
2867
|
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2848
|
-
})(),
|
|
2868
|
+
})(), S = p != null && p.created_at ? ir(new Date(p.created_at)) : "", A = p ? Me(p) : !1, E = o ? o(p, b) : `${A ? "✨ " : ""}${b}`, L = s ?? 0;
|
|
2849
2869
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2850
2870
|
channelId: t == null ? void 0 : t.id,
|
|
2851
2871
|
isSelected: u,
|
|
2852
|
-
participantName:
|
|
2853
|
-
unreadCount:
|
|
2854
|
-
hasTimestamp: !!
|
|
2872
|
+
participantName: w,
|
|
2873
|
+
unreadCount: L,
|
|
2874
|
+
hasTimestamp: !!S
|
|
2855
2875
|
}), /* @__PURE__ */ n(
|
|
2856
2876
|
"div",
|
|
2857
2877
|
{
|
|
@@ -2859,7 +2879,7 @@ const hn = V.createContext({
|
|
|
2859
2879
|
tabIndex: 0,
|
|
2860
2880
|
onClick: m,
|
|
2861
2881
|
onKeyDown: f,
|
|
2862
|
-
className:
|
|
2882
|
+
className: y(
|
|
2863
2883
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2864
2884
|
{
|
|
2865
2885
|
"bg-black/[0.04]": u,
|
|
@@ -2871,9 +2891,9 @@ const hn = V.createContext({
|
|
|
2871
2891
|
/* @__PURE__ */ n(
|
|
2872
2892
|
ne,
|
|
2873
2893
|
{
|
|
2874
|
-
id: ((
|
|
2875
|
-
name:
|
|
2876
|
-
image:
|
|
2894
|
+
id: ((z = c == null ? void 0 : c.user) == null ? void 0 : z.id) || t.id || "unknown",
|
|
2895
|
+
name: w,
|
|
2896
|
+
image: N,
|
|
2877
2897
|
size: 48,
|
|
2878
2898
|
starred: g
|
|
2879
2899
|
}
|
|
@@ -2883,20 +2903,20 @@ const hn = V.createContext({
|
|
|
2883
2903
|
/* @__PURE__ */ h(
|
|
2884
2904
|
"h3",
|
|
2885
2905
|
{
|
|
2886
|
-
className:
|
|
2906
|
+
className: y(
|
|
2887
2907
|
"text-sm font-medium truncate text-[#191918]"
|
|
2888
2908
|
),
|
|
2889
2909
|
children: [
|
|
2890
2910
|
g && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2891
|
-
|
|
2911
|
+
w
|
|
2892
2912
|
]
|
|
2893
2913
|
}
|
|
2894
2914
|
),
|
|
2895
|
-
|
|
2915
|
+
S && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: S })
|
|
2896
2916
|
] }),
|
|
2897
2917
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2898
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2899
|
-
|
|
2918
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: E }),
|
|
2919
|
+
L > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: L > 99 ? "99+" : L })
|
|
2900
2920
|
] })
|
|
2901
2921
|
] })
|
|
2902
2922
|
] })
|
|
@@ -2904,27 +2924,27 @@ const hn = V.createContext({
|
|
|
2904
2924
|
);
|
|
2905
2925
|
}
|
|
2906
2926
|
);
|
|
2907
|
-
|
|
2908
|
-
const
|
|
2927
|
+
gn.displayName = "CustomChannelPreview";
|
|
2928
|
+
const lr = { last_message_at: -1 }, or = j.memo(
|
|
2909
2929
|
({
|
|
2910
2930
|
onChannelSelect: e,
|
|
2911
2931
|
selectedChannel: t,
|
|
2912
2932
|
filters: s,
|
|
2913
2933
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2914
2934
|
channelRenderFilterFn: r,
|
|
2915
|
-
sort: i =
|
|
2935
|
+
sort: i = lr,
|
|
2916
2936
|
className: l,
|
|
2917
2937
|
customEmptyStateIndicator: o,
|
|
2918
2938
|
channelPreview: d,
|
|
2919
2939
|
renderMessagePreview: u,
|
|
2920
2940
|
viewerLanguage: g
|
|
2921
2941
|
}) => {
|
|
2922
|
-
const m =
|
|
2942
|
+
const m = j.useRef(0);
|
|
2923
2943
|
m.current++;
|
|
2924
|
-
const { debug: f = !1 } = Je(), c =
|
|
2944
|
+
const { debug: f = !1 } = Je(), c = j.useCallback(
|
|
2925
2945
|
(N) => {
|
|
2926
|
-
for (const
|
|
2927
|
-
|
|
2946
|
+
for (const p of N)
|
|
2947
|
+
nr(p);
|
|
2928
2948
|
return r ? r(N) : N;
|
|
2929
2949
|
},
|
|
2930
2950
|
[r]
|
|
@@ -2934,7 +2954,7 @@ const ar = { last_message_at: -1 }, rr = V.memo(
|
|
|
2934
2954
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2935
2955
|
filters: s
|
|
2936
2956
|
});
|
|
2937
|
-
const
|
|
2957
|
+
const w = j.useMemo(
|
|
2938
2958
|
() => ({
|
|
2939
2959
|
selectedChannel: t,
|
|
2940
2960
|
onChannelSelect: e,
|
|
@@ -2955,20 +2975,20 @@ const ar = { last_message_at: -1 }, rr = V.memo(
|
|
|
2955
2975
|
return /* @__PURE__ */ n(
|
|
2956
2976
|
"div",
|
|
2957
2977
|
{
|
|
2958
|
-
className:
|
|
2978
|
+
className: y(
|
|
2959
2979
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2960
2980
|
l
|
|
2961
2981
|
),
|
|
2962
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
2963
|
-
|
|
2982
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(sr, { value: w, children: /* @__PURE__ */ n(
|
|
2983
|
+
ms,
|
|
2964
2984
|
{
|
|
2965
2985
|
filters: s,
|
|
2966
2986
|
sort: i,
|
|
2967
2987
|
options: { limit: 30 },
|
|
2968
2988
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2969
2989
|
channelRenderFilterFn: c,
|
|
2970
|
-
Paginator:
|
|
2971
|
-
Preview:
|
|
2990
|
+
Paginator: hs,
|
|
2991
|
+
Preview: gn,
|
|
2972
2992
|
EmptyStateIndicator: o
|
|
2973
2993
|
},
|
|
2974
2994
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
@@ -2977,27 +2997,27 @@ const ar = { last_message_at: -1 }, rr = V.memo(
|
|
|
2977
2997
|
);
|
|
2978
2998
|
}
|
|
2979
2999
|
);
|
|
2980
|
-
|
|
2981
|
-
const
|
|
2982
|
-
function
|
|
3000
|
+
or.displayName = "ChannelList";
|
|
3001
|
+
const cr = /^([a-z][a-z0-9+.-]*):/i, dr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
3002
|
+
function rt(e) {
|
|
2983
3003
|
if (typeof e != "string") return;
|
|
2984
3004
|
const t = e.trim();
|
|
2985
3005
|
if (t === "") return;
|
|
2986
|
-
const s =
|
|
3006
|
+
const s = cr.exec(t);
|
|
2987
3007
|
if (s) {
|
|
2988
3008
|
const a = s[1].toLowerCase();
|
|
2989
|
-
return
|
|
3009
|
+
return dr.has(a) ? t : void 0;
|
|
2990
3010
|
}
|
|
2991
3011
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2992
3012
|
}
|
|
2993
|
-
const
|
|
3013
|
+
const ur = {
|
|
2994
3014
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2995
3015
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2996
|
-
},
|
|
2997
|
-
const s =
|
|
3016
|
+
}, mr = ({ variant: e, cta: t }) => {
|
|
3017
|
+
const s = y(
|
|
2998
3018
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2999
|
-
|
|
3000
|
-
), a =
|
|
3019
|
+
ur[e]
|
|
3020
|
+
), a = rt(t.href);
|
|
3001
3021
|
return a ? /* @__PURE__ */ n(
|
|
3002
3022
|
"a",
|
|
3003
3023
|
{
|
|
@@ -3023,13 +3043,13 @@ const or = {
|
|
|
3023
3043
|
children: t.label
|
|
3024
3044
|
}
|
|
3025
3045
|
);
|
|
3026
|
-
},
|
|
3046
|
+
}, hr = {
|
|
3027
3047
|
dark: "text-white",
|
|
3028
3048
|
light: "text-black/90"
|
|
3029
|
-
},
|
|
3049
|
+
}, fr = "text-white/30", gr = {
|
|
3030
3050
|
dark: "text-white/55",
|
|
3031
3051
|
light: "text-black/55"
|
|
3032
|
-
},
|
|
3052
|
+
}, it = ({
|
|
3033
3053
|
variant: e,
|
|
3034
3054
|
title: t,
|
|
3035
3055
|
placeholderTitle: s,
|
|
@@ -3039,14 +3059,14 @@ const or = {
|
|
|
3039
3059
|
cta: l,
|
|
3040
3060
|
trailingAction: o
|
|
3041
3061
|
}) => {
|
|
3042
|
-
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", m = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
3043
|
-
if (!g && !m && !c && !
|
|
3044
|
-
const
|
|
3062
|
+
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", m = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", w = l != null;
|
|
3063
|
+
if (!g && !m && !c && !w) return null;
|
|
3064
|
+
const p = y(
|
|
3045
3065
|
"truncate text-base font-medium leading-6",
|
|
3046
|
-
d && !t ?
|
|
3047
|
-
),
|
|
3066
|
+
d && !t ? fr : hr[e]
|
|
3067
|
+
), v = y(
|
|
3048
3068
|
"truncate text-xs leading-4",
|
|
3049
|
-
|
|
3069
|
+
gr[e]
|
|
3050
3070
|
);
|
|
3051
3071
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
3052
3072
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
@@ -3054,17 +3074,17 @@ const or = {
|
|
|
3054
3074
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
3055
3075
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3056
3076
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
3057
|
-
/* @__PURE__ */ n("p", { className:
|
|
3077
|
+
/* @__PURE__ */ n("p", { className: y("min-w-0", p), children: u })
|
|
3058
3078
|
] }),
|
|
3059
|
-
m && /* @__PURE__ */ n("p", { className:
|
|
3079
|
+
m && /* @__PURE__ */ n("p", { className: v, children: a })
|
|
3060
3080
|
] }),
|
|
3061
|
-
!
|
|
3081
|
+
!w && c && /* @__PURE__ */ n("p", { className: v, children: f })
|
|
3062
3082
|
] }),
|
|
3063
3083
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
3064
3084
|
] }),
|
|
3065
|
-
l && /* @__PURE__ */ n(
|
|
3085
|
+
l && /* @__PURE__ */ n(mr, { variant: e, cta: l })
|
|
3066
3086
|
] });
|
|
3067
|
-
},
|
|
3087
|
+
}, pr = y(
|
|
3068
3088
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
3069
3089
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
3070
3090
|
// the messaging design system's "small border around link attachments"
|
|
@@ -3082,8 +3102,8 @@ const or = {
|
|
|
3082
3102
|
bgClassName: o,
|
|
3083
3103
|
"data-testid": d
|
|
3084
3104
|
}) => {
|
|
3085
|
-
const u = s != null || a != null, g =
|
|
3086
|
-
|
|
3105
|
+
const u = s != null || a != null, g = y(
|
|
3106
|
+
pr,
|
|
3087
3107
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3088
3108
|
// `focus-ring` is a design-system utility from the component-library
|
|
3089
3109
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -3113,7 +3133,7 @@ const or = {
|
|
|
3113
3133
|
onClick: a,
|
|
3114
3134
|
"aria-label": r,
|
|
3115
3135
|
"data-testid": d,
|
|
3116
|
-
className:
|
|
3136
|
+
className: y(g, "text-left"),
|
|
3117
3137
|
children: [
|
|
3118
3138
|
t,
|
|
3119
3139
|
m
|
|
@@ -3131,17 +3151,17 @@ const or = {
|
|
|
3131
3151
|
]
|
|
3132
3152
|
}
|
|
3133
3153
|
);
|
|
3134
|
-
},
|
|
3154
|
+
}, br = {
|
|
3135
3155
|
dark: "bg-white/10",
|
|
3136
3156
|
light: "bg-black/5"
|
|
3137
|
-
},
|
|
3157
|
+
}, vr = {
|
|
3138
3158
|
dark: "size-16 text-white/25",
|
|
3139
3159
|
light: "size-16 text-black/25"
|
|
3140
|
-
}, ze = (e, t) => !!t && !!e && ie(e) === "audio",
|
|
3160
|
+
}, ze = (e, t) => !!t && !!e && ie(e) === "audio", pn = (e, t) => {
|
|
3141
3161
|
if (!t || !e) return !1;
|
|
3142
3162
|
const s = ie(e);
|
|
3143
3163
|
return s === "video" || s === "audio";
|
|
3144
|
-
},
|
|
3164
|
+
}, lt = "bg-[#F2F3F4]", De = ({
|
|
3145
3165
|
variant: e,
|
|
3146
3166
|
thumbnailUrl: t,
|
|
3147
3167
|
sourceUrl: s,
|
|
@@ -3163,7 +3183,7 @@ const or = {
|
|
|
3163
3183
|
) }) : /* @__PURE__ */ h(
|
|
3164
3184
|
"div",
|
|
3165
3185
|
{
|
|
3166
|
-
className:
|
|
3186
|
+
className: y(
|
|
3167
3187
|
"relative h-[180px] w-full overflow-hidden",
|
|
3168
3188
|
d && "bg-black"
|
|
3169
3189
|
),
|
|
@@ -3190,12 +3210,12 @@ const or = {
|
|
|
3190
3210
|
) : /* @__PURE__ */ n(
|
|
3191
3211
|
"div",
|
|
3192
3212
|
{
|
|
3193
|
-
className:
|
|
3213
|
+
className: y(
|
|
3194
3214
|
"flex h-full w-full items-center justify-center",
|
|
3195
|
-
|
|
3215
|
+
br[e]
|
|
3196
3216
|
),
|
|
3197
3217
|
children: ce(r, {
|
|
3198
|
-
className:
|
|
3218
|
+
className: vr[e],
|
|
3199
3219
|
weight: "regular"
|
|
3200
3220
|
})
|
|
3201
3221
|
}
|
|
@@ -3205,7 +3225,7 @@ const or = {
|
|
|
3205
3225
|
]
|
|
3206
3226
|
}
|
|
3207
3227
|
);
|
|
3208
|
-
},
|
|
3228
|
+
}, xr = ({
|
|
3209
3229
|
title: e,
|
|
3210
3230
|
placeholderTitle: t,
|
|
3211
3231
|
description: s,
|
|
@@ -3219,7 +3239,7 @@ const or = {
|
|
|
3219
3239
|
onDismiss: g,
|
|
3220
3240
|
onEditClick: m
|
|
3221
3241
|
}) => {
|
|
3222
|
-
const f = o === "classic", c = ze(r, l),
|
|
3242
|
+
const f = o === "classic", c = ze(r, l), w = g ? /* @__PURE__ */ n(
|
|
3223
3243
|
"button",
|
|
3224
3244
|
{
|
|
3225
3245
|
type: "button",
|
|
@@ -3235,10 +3255,10 @@ const or = {
|
|
|
3235
3255
|
onClick: m,
|
|
3236
3256
|
"aria-label": "Edit attachment",
|
|
3237
3257
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3238
|
-
children: /* @__PURE__ */ n(
|
|
3258
|
+
children: /* @__PURE__ */ n(Ds, { className: "size-5", weight: "regular" })
|
|
3239
3259
|
}
|
|
3240
3260
|
) : void 0;
|
|
3241
|
-
return c ? /* @__PURE__ */ n(Le, { variant: "dark", bgClassName:
|
|
3261
|
+
return c ? /* @__PURE__ */ n(Le, { variant: "dark", bgClassName: lt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3242
3262
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3243
3263
|
De,
|
|
3244
3264
|
{
|
|
@@ -3248,12 +3268,12 @@ const or = {
|
|
|
3248
3268
|
mimeType: r
|
|
3249
3269
|
}
|
|
3250
3270
|
) }),
|
|
3251
|
-
|
|
3271
|
+
w && /* @__PURE__ */ n("div", { className: "shrink-0", children: w })
|
|
3252
3272
|
] }) }) : /* @__PURE__ */ h(
|
|
3253
3273
|
Le,
|
|
3254
3274
|
{
|
|
3255
3275
|
variant: "dark",
|
|
3256
|
-
topRight: f ?
|
|
3276
|
+
topRight: f ? w : void 0,
|
|
3257
3277
|
children: [
|
|
3258
3278
|
!f && /* @__PURE__ */ n(
|
|
3259
3279
|
De,
|
|
@@ -3263,11 +3283,11 @@ const or = {
|
|
|
3263
3283
|
sourceUrl: l,
|
|
3264
3284
|
title: e,
|
|
3265
3285
|
mimeType: r,
|
|
3266
|
-
topRight:
|
|
3286
|
+
topRight: w
|
|
3267
3287
|
}
|
|
3268
3288
|
),
|
|
3269
3289
|
/* @__PURE__ */ n(
|
|
3270
|
-
|
|
3290
|
+
it,
|
|
3271
3291
|
{
|
|
3272
3292
|
variant: "dark",
|
|
3273
3293
|
title: e,
|
|
@@ -3282,7 +3302,7 @@ const or = {
|
|
|
3282
3302
|
]
|
|
3283
3303
|
}
|
|
3284
3304
|
);
|
|
3285
|
-
},
|
|
3305
|
+
}, wr = ({
|
|
3286
3306
|
title: e,
|
|
3287
3307
|
description: t,
|
|
3288
3308
|
url: s,
|
|
@@ -3294,11 +3314,11 @@ const or = {
|
|
|
3294
3314
|
cta: d,
|
|
3295
3315
|
onClick: u
|
|
3296
3316
|
}) => {
|
|
3297
|
-
const g =
|
|
3317
|
+
const g = pn(a, i), m = rt(s), f = d == null && m != null && !g ? m : void 0, c = d == null && !g ? u : void 0, w = ze(a, i) ? lt : void 0, N = d && u ? {
|
|
3298
3318
|
...d,
|
|
3299
3319
|
onClick: () => {
|
|
3300
|
-
var
|
|
3301
|
-
u(), (
|
|
3320
|
+
var p;
|
|
3321
|
+
u(), (p = d.onClick) == null || p.call(d);
|
|
3302
3322
|
}
|
|
3303
3323
|
} : d;
|
|
3304
3324
|
return /* @__PURE__ */ h(
|
|
@@ -3308,7 +3328,7 @@ const or = {
|
|
|
3308
3328
|
href: f,
|
|
3309
3329
|
onClick: c,
|
|
3310
3330
|
ariaLabel: e ?? "Open attachment preview",
|
|
3311
|
-
bgClassName:
|
|
3331
|
+
bgClassName: w,
|
|
3312
3332
|
"data-testid": "link-attachment",
|
|
3313
3333
|
children: [
|
|
3314
3334
|
l === "featured" && /* @__PURE__ */ n(
|
|
@@ -3322,7 +3342,7 @@ const or = {
|
|
|
3322
3342
|
}
|
|
3323
3343
|
),
|
|
3324
3344
|
/* @__PURE__ */ n(
|
|
3325
|
-
|
|
3345
|
+
it,
|
|
3326
3346
|
{
|
|
3327
3347
|
variant: "light",
|
|
3328
3348
|
title: e,
|
|
@@ -3335,7 +3355,7 @@ const or = {
|
|
|
3335
3355
|
]
|
|
3336
3356
|
}
|
|
3337
3357
|
);
|
|
3338
|
-
},
|
|
3358
|
+
}, Nr = ({
|
|
3339
3359
|
title: e,
|
|
3340
3360
|
placeholderTitle: t,
|
|
3341
3361
|
description: s,
|
|
@@ -3348,14 +3368,14 @@ const or = {
|
|
|
3348
3368
|
cta: u,
|
|
3349
3369
|
onClick: g
|
|
3350
3370
|
}) => {
|
|
3351
|
-
const m =
|
|
3371
|
+
const m = pn(r, l), f = rt(a), c = u == null && f != null && !m ? f : void 0, w = u == null && !m && c != null ? g : void 0;
|
|
3352
3372
|
return /* @__PURE__ */ h(
|
|
3353
3373
|
Le,
|
|
3354
3374
|
{
|
|
3355
3375
|
variant: "dark",
|
|
3356
3376
|
href: c,
|
|
3357
|
-
onClick:
|
|
3358
|
-
bgClassName: ze(r, l) ?
|
|
3377
|
+
onClick: w,
|
|
3378
|
+
bgClassName: ze(r, l) ? lt : void 0,
|
|
3359
3379
|
children: [
|
|
3360
3380
|
o === "featured" && /* @__PURE__ */ n(
|
|
3361
3381
|
De,
|
|
@@ -3368,7 +3388,7 @@ const or = {
|
|
|
3368
3388
|
}
|
|
3369
3389
|
),
|
|
3370
3390
|
/* @__PURE__ */ n(
|
|
3371
|
-
|
|
3391
|
+
it,
|
|
3372
3392
|
{
|
|
3373
3393
|
variant: "dark",
|
|
3374
3394
|
title: e,
|
|
@@ -3382,20 +3402,20 @@ const or = {
|
|
|
3382
3402
|
]
|
|
3383
3403
|
}
|
|
3384
3404
|
);
|
|
3385
|
-
},
|
|
3386
|
-
Composer:
|
|
3387
|
-
Sent:
|
|
3388
|
-
Received:
|
|
3389
|
-
},
|
|
3405
|
+
}, Ai = {
|
|
3406
|
+
Composer: xr,
|
|
3407
|
+
Sent: Nr,
|
|
3408
|
+
Received: wr
|
|
3409
|
+
}, _r = {
|
|
3390
3410
|
dark: "bg-[#121110]",
|
|
3391
3411
|
light: "bg-[#e9eaed]"
|
|
3392
|
-
},
|
|
3412
|
+
}, yr = {
|
|
3393
3413
|
dark: "text-white",
|
|
3394
3414
|
light: "text-[#080707]"
|
|
3395
|
-
},
|
|
3415
|
+
}, kr = {
|
|
3396
3416
|
dark: "border-white/[0.08]",
|
|
3397
3417
|
light: "border-black/[0.08]"
|
|
3398
|
-
},
|
|
3418
|
+
}, Cr = (e) => e === "dark" ? "sender" : "receiver", Er = {
|
|
3399
3419
|
sender: {
|
|
3400
3420
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3401
3421
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3417,13 +3437,13 @@ const or = {
|
|
|
3417
3437
|
children: i,
|
|
3418
3438
|
"data-testid": l
|
|
3419
3439
|
}) => {
|
|
3420
|
-
const o = t != null && t !== "", d =
|
|
3440
|
+
const o = t != null && t !== "", d = Er[Cr(e)][a];
|
|
3421
3441
|
return /* @__PURE__ */ h(
|
|
3422
3442
|
"div",
|
|
3423
3443
|
{
|
|
3424
3444
|
"data-testid": l,
|
|
3425
3445
|
"data-group-position": a,
|
|
3426
|
-
className:
|
|
3446
|
+
className: y(
|
|
3427
3447
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3428
3448
|
// and keeps the document / image / audio bubbles visually
|
|
3429
3449
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3432,10 +3452,10 @@ const or = {
|
|
|
3432
3452
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3433
3453
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3434
3454
|
d,
|
|
3435
|
-
|
|
3436
|
-
|
|
3455
|
+
_r[e],
|
|
3456
|
+
yr[e],
|
|
3437
3457
|
s && "border",
|
|
3438
|
-
s &&
|
|
3458
|
+
s && kr[e],
|
|
3439
3459
|
r
|
|
3440
3460
|
),
|
|
3441
3461
|
children: [
|
|
@@ -3443,7 +3463,7 @@ const or = {
|
|
|
3443
3463
|
o ? /* @__PURE__ */ n(
|
|
3444
3464
|
"p",
|
|
3445
3465
|
{
|
|
3446
|
-
className:
|
|
3466
|
+
className: y(
|
|
3447
3467
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3448
3468
|
// the same font family + size as `.str-chat__message-text`
|
|
3449
3469
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3472,22 +3492,22 @@ const or = {
|
|
|
3472
3492
|
a.stopPropagation(), e();
|
|
3473
3493
|
},
|
|
3474
3494
|
"aria-label": s,
|
|
3475
|
-
className:
|
|
3495
|
+
className: y(
|
|
3476
3496
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3477
3497
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3478
3498
|
),
|
|
3479
3499
|
children: /* @__PURE__ */ n(Pe, { className: "size-3", weight: "bold" })
|
|
3480
3500
|
}
|
|
3481
|
-
), Ee = (e) => e === "received" ? "light" : "dark",
|
|
3501
|
+
), Ee = (e) => e === "received" ? "light" : "dark", Mi = ({
|
|
3482
3502
|
firstOfGroup: e,
|
|
3483
3503
|
endOfGroup: t,
|
|
3484
3504
|
groupedByUser: s
|
|
3485
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3505
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Ir = ({
|
|
3486
3506
|
src: e,
|
|
3487
3507
|
mimeType: t,
|
|
3488
3508
|
filename: s,
|
|
3489
3509
|
items: a
|
|
3490
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3510
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Sr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3491
3511
|
/* @__PURE__ */ n(
|
|
3492
3512
|
"audio",
|
|
3493
3513
|
{
|
|
@@ -3499,7 +3519,7 @@ const or = {
|
|
|
3499
3519
|
}
|
|
3500
3520
|
),
|
|
3501
3521
|
s ?? null
|
|
3502
|
-
] }),
|
|
3522
|
+
] }), ot = ({
|
|
3503
3523
|
state: e,
|
|
3504
3524
|
src: t,
|
|
3505
3525
|
mimeType: s,
|
|
@@ -3510,7 +3530,7 @@ const or = {
|
|
|
3510
3530
|
preload: o,
|
|
3511
3531
|
onDismiss: d
|
|
3512
3532
|
}) => {
|
|
3513
|
-
const u = Ee(e), g = e === "composer" && !!d, m =
|
|
3533
|
+
const u = Ee(e), g = e === "composer" && !!d, m = Ir({ src: t, mimeType: s, filename: a, items: r });
|
|
3514
3534
|
if (m.length === 0)
|
|
3515
3535
|
return null;
|
|
3516
3536
|
const f = o ?? (m.length > 1 ? "none" : "metadata");
|
|
@@ -3521,30 +3541,30 @@ const or = {
|
|
|
3521
3541
|
text: i,
|
|
3522
3542
|
groupPosition: l,
|
|
3523
3543
|
"data-testid": "audio-attachment",
|
|
3524
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((c,
|
|
3525
|
-
|
|
3544
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((c, w) => /* @__PURE__ */ n(
|
|
3545
|
+
Sr,
|
|
3526
3546
|
{
|
|
3527
3547
|
item: c,
|
|
3528
3548
|
preload: f,
|
|
3529
3549
|
trailingAction: (
|
|
3530
3550
|
// Composer only supports a single attachment, so the
|
|
3531
3551
|
// dismiss control sits on the only player.
|
|
3532
|
-
g &&
|
|
3552
|
+
g && w === 0 ? /* @__PURE__ */ n(Ce, { onClick: d, variant: "inline" }) : void 0
|
|
3533
3553
|
)
|
|
3534
3554
|
},
|
|
3535
|
-
`${c.src}-${
|
|
3555
|
+
`${c.src}-${w}`
|
|
3536
3556
|
)) })
|
|
3537
3557
|
}
|
|
3538
3558
|
);
|
|
3539
|
-
},
|
|
3540
|
-
Composer:
|
|
3541
|
-
Sent:
|
|
3542
|
-
Received:
|
|
3559
|
+
}, Tr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), Ar = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), Mr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), Rr = {
|
|
3560
|
+
Composer: Tr,
|
|
3561
|
+
Sent: Ar,
|
|
3562
|
+
Received: Mr
|
|
3543
3563
|
};
|
|
3544
|
-
function
|
|
3564
|
+
function Lr(e) {
|
|
3545
3565
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
3546
3566
|
}
|
|
3547
|
-
const
|
|
3567
|
+
const Dr = {
|
|
3548
3568
|
pdf: "PDF",
|
|
3549
3569
|
doc: "DOC",
|
|
3550
3570
|
xls: "XLS",
|
|
@@ -3554,7 +3574,7 @@ const Mr = {
|
|
|
3554
3574
|
text: "TXT",
|
|
3555
3575
|
markdown: "MD"
|
|
3556
3576
|
};
|
|
3557
|
-
function
|
|
3577
|
+
function Pr(e, t) {
|
|
3558
3578
|
if (t) {
|
|
3559
3579
|
const r = t.lastIndexOf(".");
|
|
3560
3580
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3564,7 +3584,7 @@ function Rr(e, t) {
|
|
|
3564
3584
|
}
|
|
3565
3585
|
if (!e) return;
|
|
3566
3586
|
if (ie(e) === "document") {
|
|
3567
|
-
const r =
|
|
3587
|
+
const r = nn(e), i = Dr[r];
|
|
3568
3588
|
if (i) return i;
|
|
3569
3589
|
if (e === "application/octet-stream") return;
|
|
3570
3590
|
}
|
|
@@ -3572,8 +3592,8 @@ function Rr(e, t) {
|
|
|
3572
3592
|
if (!(!a || a === "*"))
|
|
3573
3593
|
return a.toUpperCase();
|
|
3574
3594
|
}
|
|
3575
|
-
function
|
|
3576
|
-
const a =
|
|
3595
|
+
function zr(e, t, s) {
|
|
3596
|
+
const a = Pr(e, t), r = typeof s == "number" && s > 0 ? Lr(s) : void 0;
|
|
3577
3597
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3578
3598
|
}
|
|
3579
3599
|
function ae(e) {
|
|
@@ -3584,16 +3604,16 @@ function ae(e) {
|
|
|
3584
3604
|
return "download";
|
|
3585
3605
|
}
|
|
3586
3606
|
}
|
|
3587
|
-
const
|
|
3607
|
+
const Or = {
|
|
3588
3608
|
dark: "text-white/55",
|
|
3589
3609
|
light: "text-black/65"
|
|
3590
|
-
},
|
|
3610
|
+
}, $r = {
|
|
3591
3611
|
dark: "bg-white/10",
|
|
3592
3612
|
light: "bg-black/5"
|
|
3593
|
-
},
|
|
3613
|
+
}, Fr = {
|
|
3594
3614
|
dark: "text-white/85",
|
|
3595
3615
|
light: "text-black/85"
|
|
3596
|
-
},
|
|
3616
|
+
}, bn = ({
|
|
3597
3617
|
variant: e,
|
|
3598
3618
|
filename: t,
|
|
3599
3619
|
title: s,
|
|
@@ -3603,16 +3623,16 @@ const Dr = {
|
|
|
3603
3623
|
activateLabel: l,
|
|
3604
3624
|
trailingAction: o
|
|
3605
3625
|
}) => {
|
|
3606
|
-
const d = s ?? t ?? "File", u =
|
|
3626
|
+
const d = s ?? t ?? "File", u = zr(a, t, r), g = /* @__PURE__ */ n(
|
|
3607
3627
|
"div",
|
|
3608
3628
|
{
|
|
3609
|
-
className:
|
|
3629
|
+
className: y(
|
|
3610
3630
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3611
|
-
|
|
3631
|
+
$r[e]
|
|
3612
3632
|
),
|
|
3613
3633
|
"aria-hidden": !0,
|
|
3614
3634
|
children: ce(a, {
|
|
3615
|
-
className:
|
|
3635
|
+
className: y("size-6", Fr[e]),
|
|
3616
3636
|
weight: "regular"
|
|
3617
3637
|
})
|
|
3618
3638
|
}
|
|
@@ -3621,9 +3641,9 @@ const Dr = {
|
|
|
3621
3641
|
u ? /* @__PURE__ */ n(
|
|
3622
3642
|
"p",
|
|
3623
3643
|
{
|
|
3624
|
-
className:
|
|
3644
|
+
className: y(
|
|
3625
3645
|
"truncate text-xs leading-4",
|
|
3626
|
-
|
|
3646
|
+
Or[e]
|
|
3627
3647
|
),
|
|
3628
3648
|
children: u
|
|
3629
3649
|
}
|
|
@@ -3634,7 +3654,7 @@ const Dr = {
|
|
|
3634
3654
|
type: "button",
|
|
3635
3655
|
onClick: i,
|
|
3636
3656
|
"aria-label": l,
|
|
3637
|
-
className:
|
|
3657
|
+
className: y(
|
|
3638
3658
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3639
3659
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3640
3660
|
),
|
|
@@ -3652,7 +3672,7 @@ const Dr = {
|
|
|
3652
3672
|
o ? /* @__PURE__ */ n("div", { className: "shrink-0", children: o }) : null
|
|
3653
3673
|
] });
|
|
3654
3674
|
};
|
|
3655
|
-
async function
|
|
3675
|
+
async function vn(e, t) {
|
|
3656
3676
|
const s = t ?? ae(e);
|
|
3657
3677
|
try {
|
|
3658
3678
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -3666,14 +3686,14 @@ async function bn(e, t) {
|
|
|
3666
3686
|
}
|
|
3667
3687
|
}
|
|
3668
3688
|
}
|
|
3669
|
-
const
|
|
3689
|
+
const Br = ({
|
|
3670
3690
|
src: e,
|
|
3671
3691
|
filename: t,
|
|
3672
3692
|
fileSize: s,
|
|
3673
3693
|
mimeType: a,
|
|
3674
3694
|
title: r,
|
|
3675
3695
|
items: i
|
|
3676
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3696
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Ur = ({
|
|
3677
3697
|
variant: e,
|
|
3678
3698
|
item: t,
|
|
3679
3699
|
index: s,
|
|
@@ -3682,7 +3702,7 @@ const Or = ({
|
|
|
3682
3702
|
}) => {
|
|
3683
3703
|
const i = t.filename ?? ae(t.src);
|
|
3684
3704
|
return /* @__PURE__ */ n(
|
|
3685
|
-
|
|
3705
|
+
bn,
|
|
3686
3706
|
{
|
|
3687
3707
|
variant: e,
|
|
3688
3708
|
filename: i,
|
|
@@ -3694,7 +3714,7 @@ const Or = ({
|
|
|
3694
3714
|
trailingAction: r
|
|
3695
3715
|
}
|
|
3696
3716
|
);
|
|
3697
|
-
},
|
|
3717
|
+
}, ct = ({
|
|
3698
3718
|
state: e,
|
|
3699
3719
|
src: t,
|
|
3700
3720
|
filename: s,
|
|
@@ -3707,26 +3727,26 @@ const Or = ({
|
|
|
3707
3727
|
onClick: u,
|
|
3708
3728
|
onDismiss: g
|
|
3709
3729
|
}) => {
|
|
3710
|
-
const m = Ee(e), f = e === "composer" && !!g, c =
|
|
3730
|
+
const m = Ee(e), f = e === "composer" && !!g, c = Br({
|
|
3711
3731
|
src: t,
|
|
3712
3732
|
filename: s,
|
|
3713
3733
|
fileSize: a,
|
|
3714
3734
|
mimeType: r,
|
|
3715
3735
|
title: i,
|
|
3716
3736
|
items: l
|
|
3717
|
-
}),
|
|
3718
|
-
if ((u == null ? void 0 : u(
|
|
3719
|
-
const
|
|
3720
|
-
if (!
|
|
3721
|
-
const
|
|
3722
|
-
|
|
3737
|
+
}), w = (p) => {
|
|
3738
|
+
if ((u == null ? void 0 : u(p)) === !1) return;
|
|
3739
|
+
const v = c[p];
|
|
3740
|
+
if (!v) return;
|
|
3741
|
+
const b = v.filename ?? ae(v.src);
|
|
3742
|
+
vn(v.src, b);
|
|
3723
3743
|
};
|
|
3724
3744
|
if (c.length === 0)
|
|
3725
3745
|
return null;
|
|
3726
3746
|
const N = /* @__PURE__ */ n(
|
|
3727
3747
|
"span",
|
|
3728
3748
|
{
|
|
3729
|
-
className:
|
|
3749
|
+
className: y(
|
|
3730
3750
|
"flex size-8 items-center justify-center rounded-full",
|
|
3731
3751
|
m === "dark" ? "text-white/70" : "text-black/70"
|
|
3732
3752
|
),
|
|
@@ -3741,24 +3761,24 @@ const Or = ({
|
|
|
3741
3761
|
text: o,
|
|
3742
3762
|
groupPosition: d,
|
|
3743
3763
|
"data-testid": "file-attachment",
|
|
3744
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3745
|
-
|
|
3764
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, v) => /* @__PURE__ */ n(
|
|
3765
|
+
Ur,
|
|
3746
3766
|
{
|
|
3747
3767
|
variant: m,
|
|
3748
|
-
item:
|
|
3749
|
-
index:
|
|
3750
|
-
onActivate:
|
|
3751
|
-
trailingAction: f &&
|
|
3768
|
+
item: p,
|
|
3769
|
+
index: v,
|
|
3770
|
+
onActivate: w,
|
|
3771
|
+
trailingAction: f && v === 0 ? /* @__PURE__ */ n(Ce, { onClick: g, variant: "inline" }) : N
|
|
3752
3772
|
},
|
|
3753
|
-
`${
|
|
3773
|
+
`${p.src}-${v}`
|
|
3754
3774
|
)) })
|
|
3755
3775
|
}
|
|
3756
3776
|
);
|
|
3757
|
-
},
|
|
3758
|
-
Composer:
|
|
3759
|
-
Sent:
|
|
3760
|
-
Received:
|
|
3761
|
-
},
|
|
3777
|
+
}, jr = (e) => /* @__PURE__ */ n(ct, { ...e, state: "composer" }), Vr = (e) => /* @__PURE__ */ n(ct, { ...e, state: "sent" }), Gr = (e) => /* @__PURE__ */ n(ct, { ...e, state: "received" }), Hr = {
|
|
3778
|
+
Composer: jr,
|
|
3779
|
+
Sent: Vr,
|
|
3780
|
+
Received: Gr
|
|
3781
|
+
}, dt = ({
|
|
3762
3782
|
onPrev: e,
|
|
3763
3783
|
onNext: t,
|
|
3764
3784
|
prevLabel: s = "Previous",
|
|
@@ -3771,7 +3791,7 @@ const Or = ({
|
|
|
3771
3791
|
onClick: e,
|
|
3772
3792
|
"aria-label": s,
|
|
3773
3793
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3774
|
-
children: /* @__PURE__ */ n(
|
|
3794
|
+
children: /* @__PURE__ */ n(Ps, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3775
3795
|
}
|
|
3776
3796
|
),
|
|
3777
3797
|
/* @__PURE__ */ n(
|
|
@@ -3784,7 +3804,7 @@ const Or = ({
|
|
|
3784
3804
|
children: /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3785
3805
|
}
|
|
3786
3806
|
)
|
|
3787
|
-
] }),
|
|
3807
|
+
] }), xn = ({
|
|
3788
3808
|
url: e,
|
|
3789
3809
|
filename: t,
|
|
3790
3810
|
variant: s = "pill",
|
|
@@ -3793,15 +3813,15 @@ const Or = ({
|
|
|
3793
3813
|
tone: i = "dark",
|
|
3794
3814
|
onTriggered: l
|
|
3795
3815
|
}) => {
|
|
3796
|
-
const [o, d] = $(!1), u =
|
|
3816
|
+
const [o, d] = $(!1), u = X(
|
|
3797
3817
|
(c) => {
|
|
3798
|
-
c.stopPropagation(), !o && (d(!0),
|
|
3818
|
+
c.stopPropagation(), !o && (d(!0), vn(e, t).catch(() => {
|
|
3799
3819
|
}).finally(() => {
|
|
3800
3820
|
d(!1), l == null || l();
|
|
3801
3821
|
}));
|
|
3802
3822
|
},
|
|
3803
3823
|
[o, e, t, l]
|
|
3804
|
-
), g = r ?? s !== "pill", f = { className:
|
|
3824
|
+
), g = r ?? s !== "pill", f = { className: y(
|
|
3805
3825
|
s === "pill" ? "size-4" : "size-5",
|
|
3806
3826
|
"shrink-0"
|
|
3807
3827
|
), weight: "bold" };
|
|
@@ -3812,7 +3832,7 @@ const Or = ({
|
|
|
3812
3832
|
onClick: u,
|
|
3813
3833
|
disabled: o,
|
|
3814
3834
|
"aria-label": a,
|
|
3815
|
-
className:
|
|
3835
|
+
className: y(
|
|
3816
3836
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3817
3837
|
{
|
|
3818
3838
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3852,7 +3872,7 @@ const Or = ({
|
|
|
3852
3872
|
onClick: u,
|
|
3853
3873
|
disabled: o,
|
|
3854
3874
|
"aria-label": g ? a : void 0,
|
|
3855
|
-
className:
|
|
3875
|
+
className: y(
|
|
3856
3876
|
"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",
|
|
3857
3877
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3858
3878
|
),
|
|
@@ -3869,23 +3889,23 @@ const Or = ({
|
|
|
3869
3889
|
]
|
|
3870
3890
|
}
|
|
3871
3891
|
);
|
|
3872
|
-
}, Ve = (e, t, s) => Math.min(Math.max(e, t), s),
|
|
3892
|
+
}, Ve = (e, t, s) => Math.min(Math.max(e, t), s), ut = ({
|
|
3873
3893
|
length: e,
|
|
3874
3894
|
initialIndex: t,
|
|
3875
3895
|
open: s
|
|
3876
3896
|
}) => {
|
|
3877
3897
|
const a = Ve(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
|
|
3878
|
-
|
|
3898
|
+
q(() => {
|
|
3879
3899
|
s && i(Ve(t, 0, Math.max(e - 1, 0)));
|
|
3880
|
-
}, [s, t, e]),
|
|
3900
|
+
}, [s, t, e]), q(() => {
|
|
3881
3901
|
i((d) => Ve(d, 0, Math.max(e - 1, 0)));
|
|
3882
3902
|
}, [e]);
|
|
3883
|
-
const l =
|
|
3903
|
+
const l = X(() => {
|
|
3884
3904
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3885
|
-
}, [e]), o =
|
|
3905
|
+
}, [e]), o = X(() => {
|
|
3886
3906
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3887
3907
|
}, [e]);
|
|
3888
|
-
return
|
|
3908
|
+
return q(() => {
|
|
3889
3909
|
if (!s || e <= 1) return;
|
|
3890
3910
|
const d = (u) => {
|
|
3891
3911
|
if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
|
|
@@ -3894,7 +3914,7 @@ const Or = ({
|
|
|
3894
3914
|
};
|
|
3895
3915
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3896
3916
|
}, [s, e, l, o]), { index: r, prev: l, next: o };
|
|
3897
|
-
},
|
|
3917
|
+
}, mt = ({
|
|
3898
3918
|
open: e,
|
|
3899
3919
|
onClose: t,
|
|
3900
3920
|
ariaLabel: s,
|
|
@@ -3903,8 +3923,8 @@ const Or = ({
|
|
|
3903
3923
|
children: i,
|
|
3904
3924
|
"data-testid": l
|
|
3905
3925
|
}) => {
|
|
3906
|
-
const o =
|
|
3907
|
-
return
|
|
3926
|
+
const o = H(null), d = H(null);
|
|
3927
|
+
return q(() => {
|
|
3908
3928
|
var f;
|
|
3909
3929
|
const m = o.current;
|
|
3910
3930
|
if (m) {
|
|
@@ -3984,13 +4004,13 @@ const Or = ({
|
|
|
3984
4004
|
]
|
|
3985
4005
|
}
|
|
3986
4006
|
);
|
|
3987
|
-
},
|
|
4007
|
+
}, wn = ({
|
|
3988
4008
|
open: e,
|
|
3989
4009
|
items: t,
|
|
3990
4010
|
initialIndex: s = 0,
|
|
3991
4011
|
onClose: a
|
|
3992
4012
|
}) => {
|
|
3993
|
-
const { index: r, prev: i, next: l } =
|
|
4013
|
+
const { index: r, prev: i, next: l } = ut({
|
|
3994
4014
|
length: t.length,
|
|
3995
4015
|
initialIndex: s,
|
|
3996
4016
|
open: e
|
|
@@ -3999,14 +4019,14 @@ const Or = ({
|
|
|
3999
4019
|
[o]
|
|
4000
4020
|
);
|
|
4001
4021
|
return o ? /* @__PURE__ */ h(
|
|
4002
|
-
|
|
4022
|
+
mt,
|
|
4003
4023
|
{
|
|
4004
4024
|
open: e,
|
|
4005
4025
|
onClose: a,
|
|
4006
4026
|
ariaLabel: d,
|
|
4007
4027
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
4008
4028
|
actions: /* @__PURE__ */ n(
|
|
4009
|
-
|
|
4029
|
+
xn,
|
|
4010
4030
|
{
|
|
4011
4031
|
url: o.src,
|
|
4012
4032
|
filename: d,
|
|
@@ -4029,7 +4049,7 @@ const Or = ({
|
|
|
4029
4049
|
`${r}:${o.src}`
|
|
4030
4050
|
),
|
|
4031
4051
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4032
|
-
|
|
4052
|
+
dt,
|
|
4033
4053
|
{
|
|
4034
4054
|
onPrev: i,
|
|
4035
4055
|
onNext: l,
|
|
@@ -4040,7 +4060,7 @@ const Or = ({
|
|
|
4040
4060
|
]
|
|
4041
4061
|
}
|
|
4042
4062
|
) : null;
|
|
4043
|
-
},
|
|
4063
|
+
}, Yr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", Nn = ({
|
|
4044
4064
|
tiles: e,
|
|
4045
4065
|
onTileActivate: t,
|
|
4046
4066
|
maxVisible: s = 4,
|
|
@@ -4049,14 +4069,14 @@ const Or = ({
|
|
|
4049
4069
|
const r = e.length;
|
|
4050
4070
|
if (r === 0) return null;
|
|
4051
4071
|
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, u, g) => {
|
|
4052
|
-
const m =
|
|
4072
|
+
const m = y(Yr, "h-full w-full");
|
|
4053
4073
|
return t ? /* @__PURE__ */ h(
|
|
4054
4074
|
"button",
|
|
4055
4075
|
{
|
|
4056
4076
|
type: "button",
|
|
4057
4077
|
onClick: () => t(u),
|
|
4058
4078
|
"aria-label": d.ariaLabel ?? `Open media ${u + 1}`,
|
|
4059
|
-
className:
|
|
4079
|
+
className: y(m, "cursor-zoom-in"),
|
|
4060
4080
|
children: [
|
|
4061
4081
|
d.content,
|
|
4062
4082
|
g
|
|
@@ -4068,10 +4088,10 @@ const Or = ({
|
|
|
4068
4088
|
g
|
|
4069
4089
|
] }, u);
|
|
4070
4090
|
};
|
|
4071
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
4091
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
4072
4092
|
"div",
|
|
4073
4093
|
{
|
|
4074
|
-
className:
|
|
4094
|
+
className: y(
|
|
4075
4095
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
4076
4096
|
a
|
|
4077
4097
|
),
|
|
@@ -4080,7 +4100,7 @@ const Or = ({
|
|
|
4080
4100
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
4081
4101
|
"div",
|
|
4082
4102
|
{
|
|
4083
|
-
className:
|
|
4103
|
+
className: y(
|
|
4084
4104
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4085
4105
|
a
|
|
4086
4106
|
),
|
|
@@ -4093,7 +4113,7 @@ const Or = ({
|
|
|
4093
4113
|
) : /* @__PURE__ */ n(
|
|
4094
4114
|
"div",
|
|
4095
4115
|
{
|
|
4096
|
-
className:
|
|
4116
|
+
className: y(
|
|
4097
4117
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4098
4118
|
a
|
|
4099
4119
|
),
|
|
@@ -4111,14 +4131,14 @@ const Or = ({
|
|
|
4111
4131
|
}
|
|
4112
4132
|
);
|
|
4113
4133
|
}, Ie = (e) => {
|
|
4114
|
-
const [t, s] = $(!1), [a, r] = $(0), i =
|
|
4134
|
+
const [t, s] = $(!1), [a, r] = $(0), i = X(
|
|
4115
4135
|
(o) => {
|
|
4116
4136
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
4117
4137
|
},
|
|
4118
4138
|
[e]
|
|
4119
|
-
), l =
|
|
4139
|
+
), l = X(() => s(!1), []);
|
|
4120
4140
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
4121
|
-
},
|
|
4141
|
+
}, qr = (e, t, s, a) => ({
|
|
4122
4142
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4123
4143
|
content: /* @__PURE__ */ n(
|
|
4124
4144
|
"img",
|
|
@@ -4133,15 +4153,15 @@ const Or = ({
|
|
|
4133
4153
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4134
4154
|
}
|
|
4135
4155
|
)
|
|
4136
|
-
}),
|
|
4156
|
+
}), Wr = ({
|
|
4137
4157
|
src: e,
|
|
4138
4158
|
alt: t,
|
|
4139
4159
|
items: s
|
|
4140
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4160
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], _n = (e, t) => e.map((s, a) => ({
|
|
4141
4161
|
src: s.src,
|
|
4142
4162
|
alt: s.alt,
|
|
4143
4163
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4144
|
-
})),
|
|
4164
|
+
})), Xr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4145
4165
|
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: u } = Ie(
|
|
4146
4166
|
r
|
|
4147
4167
|
);
|
|
@@ -4168,16 +4188,16 @@ const Or = ({
|
|
|
4168
4188
|
),
|
|
4169
4189
|
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: i }) }) : null,
|
|
4170
4190
|
/* @__PURE__ */ n(
|
|
4171
|
-
|
|
4191
|
+
wn,
|
|
4172
4192
|
{
|
|
4173
4193
|
open: l,
|
|
4174
|
-
items:
|
|
4194
|
+
items: _n([{ src: e, alt: t }], s),
|
|
4175
4195
|
initialIndex: o,
|
|
4176
4196
|
onClose: u
|
|
4177
4197
|
}
|
|
4178
4198
|
)
|
|
4179
4199
|
] });
|
|
4180
|
-
},
|
|
4200
|
+
}, yn = ({
|
|
4181
4201
|
state: e,
|
|
4182
4202
|
src: t,
|
|
4183
4203
|
alt: s,
|
|
@@ -4188,13 +4208,13 @@ const Or = ({
|
|
|
4188
4208
|
loading: o = "lazy",
|
|
4189
4209
|
onClick: d
|
|
4190
4210
|
}) => {
|
|
4191
|
-
const u =
|
|
4211
|
+
const u = Wr({ src: t, alt: s, items: r }), g = Ee(e), { viewerOpen: m, viewerIndex: f, handleActivate: c, closeViewer: w } = Ie(
|
|
4192
4212
|
d
|
|
4193
4213
|
);
|
|
4194
4214
|
if (u.length === 0)
|
|
4195
4215
|
return null;
|
|
4196
4216
|
const N = u.map(
|
|
4197
|
-
(
|
|
4217
|
+
(p, v) => qr(p, v, u.length, o)
|
|
4198
4218
|
);
|
|
4199
4219
|
return /* @__PURE__ */ h(
|
|
4200
4220
|
ke,
|
|
@@ -4204,30 +4224,30 @@ const Or = ({
|
|
|
4204
4224
|
groupPosition: l,
|
|
4205
4225
|
"data-testid": "image-attachment",
|
|
4206
4226
|
children: [
|
|
4207
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4227
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(Nn, { tiles: N, onTileActivate: c }) }),
|
|
4208
4228
|
/* @__PURE__ */ n(
|
|
4209
|
-
|
|
4229
|
+
wn,
|
|
4210
4230
|
{
|
|
4211
4231
|
open: m,
|
|
4212
|
-
items:
|
|
4232
|
+
items: _n(u, a),
|
|
4213
4233
|
initialIndex: f,
|
|
4214
|
-
onClose:
|
|
4234
|
+
onClose: w
|
|
4215
4235
|
}
|
|
4216
4236
|
)
|
|
4217
4237
|
]
|
|
4218
4238
|
}
|
|
4219
4239
|
);
|
|
4220
|
-
},
|
|
4221
|
-
Composer:
|
|
4222
|
-
Sent:
|
|
4223
|
-
Received:
|
|
4224
|
-
},
|
|
4240
|
+
}, Kr = (e) => /* @__PURE__ */ n(Xr, { ...e }), Jr = (e) => /* @__PURE__ */ n(yn, { ...e, state: "sent" }), Zr = (e) => /* @__PURE__ */ n(yn, { ...e, state: "received" }), Qr = {
|
|
4241
|
+
Composer: Kr,
|
|
4242
|
+
Sent: Jr,
|
|
4243
|
+
Received: Zr
|
|
4244
|
+
}, ei = ({
|
|
4225
4245
|
open: e,
|
|
4226
4246
|
items: t,
|
|
4227
4247
|
initialIndex: s = 0,
|
|
4228
4248
|
onClose: a
|
|
4229
4249
|
}) => {
|
|
4230
|
-
const { index: r, prev: i, next: l } =
|
|
4250
|
+
const { index: r, prev: i, next: l } = ut({
|
|
4231
4251
|
length: t.length,
|
|
4232
4252
|
initialIndex: s,
|
|
4233
4253
|
open: e
|
|
@@ -4235,11 +4255,11 @@ const Or = ({
|
|
|
4235
4255
|
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "document"),
|
|
4236
4256
|
[o]
|
|
4237
4257
|
), u = re(
|
|
4238
|
-
() => o ?
|
|
4258
|
+
() => o ? ti(o.src) : void 0,
|
|
4239
4259
|
[o]
|
|
4240
4260
|
);
|
|
4241
4261
|
return !o || !u ? null : /* @__PURE__ */ h(
|
|
4242
|
-
|
|
4262
|
+
mt,
|
|
4243
4263
|
{
|
|
4244
4264
|
open: e,
|
|
4245
4265
|
onClose: a,
|
|
@@ -4258,7 +4278,7 @@ const Or = ({
|
|
|
4258
4278
|
`${r}:${o.src}`
|
|
4259
4279
|
),
|
|
4260
4280
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4261
|
-
|
|
4281
|
+
dt,
|
|
4262
4282
|
{
|
|
4263
4283
|
onPrev: i,
|
|
4264
4284
|
onNext: l,
|
|
@@ -4269,16 +4289,16 @@ const Or = ({
|
|
|
4269
4289
|
]
|
|
4270
4290
|
}
|
|
4271
4291
|
);
|
|
4272
|
-
},
|
|
4292
|
+
}, ti = (e) => {
|
|
4273
4293
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4274
4294
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4275
|
-
},
|
|
4295
|
+
}, ni = ({
|
|
4276
4296
|
src: e,
|
|
4277
4297
|
filename: t,
|
|
4278
4298
|
fileSize: s,
|
|
4279
4299
|
title: a,
|
|
4280
4300
|
items: r
|
|
4281
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4301
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], si = ({
|
|
4282
4302
|
variant: e,
|
|
4283
4303
|
item: t,
|
|
4284
4304
|
index: s,
|
|
@@ -4287,7 +4307,7 @@ const Or = ({
|
|
|
4287
4307
|
}) => {
|
|
4288
4308
|
const i = t.filename ?? ae(t.src);
|
|
4289
4309
|
return /* @__PURE__ */ n(
|
|
4290
|
-
|
|
4310
|
+
bn,
|
|
4291
4311
|
{
|
|
4292
4312
|
variant: e,
|
|
4293
4313
|
filename: i,
|
|
@@ -4299,7 +4319,7 @@ const Or = ({
|
|
|
4299
4319
|
trailingAction: r
|
|
4300
4320
|
}
|
|
4301
4321
|
);
|
|
4302
|
-
},
|
|
4322
|
+
}, ht = ({
|
|
4303
4323
|
state: e,
|
|
4304
4324
|
src: t,
|
|
4305
4325
|
filename: s,
|
|
@@ -4311,14 +4331,14 @@ const Or = ({
|
|
|
4311
4331
|
onClick: d,
|
|
4312
4332
|
onDismiss: u
|
|
4313
4333
|
}) => {
|
|
4314
|
-
const g = Ee(e), m =
|
|
4334
|
+
const g = Ee(e), m = ni({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: w, closeViewer: N } = Ie(
|
|
4315
4335
|
d
|
|
4316
|
-
),
|
|
4336
|
+
), p = e === "composer" && !!u;
|
|
4317
4337
|
if (m.length === 0)
|
|
4318
4338
|
return null;
|
|
4319
|
-
const
|
|
4320
|
-
src:
|
|
4321
|
-
filename:
|
|
4339
|
+
const v = m.map((b) => ({
|
|
4340
|
+
src: b.src,
|
|
4341
|
+
filename: b.filename ?? ae(b.src)
|
|
4322
4342
|
}));
|
|
4323
4343
|
return /* @__PURE__ */ h(
|
|
4324
4344
|
ke,
|
|
@@ -4328,34 +4348,34 @@ const Or = ({
|
|
|
4328
4348
|
groupPosition: o,
|
|
4329
4349
|
"data-testid": "pdf-attachment",
|
|
4330
4350
|
children: [
|
|
4331
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((
|
|
4332
|
-
const
|
|
4333
|
-
|
|
4351
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((b, S) => {
|
|
4352
|
+
const A = b.filename ?? ae(b.src), E = p && S === 0 ? /* @__PURE__ */ n(Ce, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4353
|
+
xn,
|
|
4334
4354
|
{
|
|
4335
|
-
url:
|
|
4336
|
-
filename:
|
|
4355
|
+
url: b.src,
|
|
4356
|
+
filename: A,
|
|
4337
4357
|
variant: "inline",
|
|
4338
|
-
label: `Download ${
|
|
4358
|
+
label: `Download ${A}`,
|
|
4339
4359
|
tone: g
|
|
4340
4360
|
}
|
|
4341
4361
|
);
|
|
4342
4362
|
return /* @__PURE__ */ n(
|
|
4343
|
-
|
|
4363
|
+
si,
|
|
4344
4364
|
{
|
|
4345
4365
|
variant: g,
|
|
4346
|
-
item:
|
|
4347
|
-
index:
|
|
4348
|
-
onActivate:
|
|
4366
|
+
item: b,
|
|
4367
|
+
index: S,
|
|
4368
|
+
onActivate: w,
|
|
4349
4369
|
trailingAction: E
|
|
4350
4370
|
},
|
|
4351
|
-
`${
|
|
4371
|
+
`${b.src}-${S}`
|
|
4352
4372
|
);
|
|
4353
4373
|
}) }),
|
|
4354
4374
|
/* @__PURE__ */ n(
|
|
4355
|
-
|
|
4375
|
+
ei,
|
|
4356
4376
|
{
|
|
4357
4377
|
open: f,
|
|
4358
|
-
items:
|
|
4378
|
+
items: v,
|
|
4359
4379
|
initialIndex: c,
|
|
4360
4380
|
onClose: N
|
|
4361
4381
|
}
|
|
@@ -4363,17 +4383,17 @@ const Or = ({
|
|
|
4363
4383
|
]
|
|
4364
4384
|
}
|
|
4365
4385
|
);
|
|
4366
|
-
},
|
|
4367
|
-
Composer:
|
|
4368
|
-
Sent:
|
|
4369
|
-
Received:
|
|
4370
|
-
},
|
|
4386
|
+
}, ai = (e) => /* @__PURE__ */ n(ht, { ...e, state: "composer" }), ri = (e) => /* @__PURE__ */ n(ht, { ...e, state: "sent" }), ii = (e) => /* @__PURE__ */ n(ht, { ...e, state: "received" }), li = {
|
|
4387
|
+
Composer: ai,
|
|
4388
|
+
Sent: ri,
|
|
4389
|
+
Received: ii
|
|
4390
|
+
}, kn = ({
|
|
4371
4391
|
open: e,
|
|
4372
4392
|
items: t,
|
|
4373
4393
|
initialIndex: s = 0,
|
|
4374
4394
|
onClose: a
|
|
4375
4395
|
}) => {
|
|
4376
|
-
const { index: r, prev: i, next: l } =
|
|
4396
|
+
const { index: r, prev: i, next: l } = ut({
|
|
4377
4397
|
length: t.length,
|
|
4378
4398
|
initialIndex: s,
|
|
4379
4399
|
open: e
|
|
@@ -4382,7 +4402,7 @@ const Or = ({
|
|
|
4382
4402
|
[o]
|
|
4383
4403
|
);
|
|
4384
4404
|
return o ? /* @__PURE__ */ h(
|
|
4385
|
-
|
|
4405
|
+
mt,
|
|
4386
4406
|
{
|
|
4387
4407
|
open: e,
|
|
4388
4408
|
onClose: a,
|
|
@@ -4406,7 +4426,7 @@ const Or = ({
|
|
|
4406
4426
|
`${r}:${o.src}`
|
|
4407
4427
|
),
|
|
4408
4428
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4409
|
-
|
|
4429
|
+
dt,
|
|
4410
4430
|
{
|
|
4411
4431
|
onPrev: i,
|
|
4412
4432
|
onNext: l,
|
|
@@ -4417,7 +4437,7 @@ const Or = ({
|
|
|
4417
4437
|
]
|
|
4418
4438
|
}
|
|
4419
4439
|
) : null;
|
|
4420
|
-
},
|
|
4440
|
+
}, oi = () => /* @__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 }) }) }), Cn = ({
|
|
4421
4441
|
item: e,
|
|
4422
4442
|
index: t
|
|
4423
4443
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4432,30 +4452,30 @@ const Or = ({
|
|
|
4432
4452
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4433
4453
|
}
|
|
4434
4454
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4435
|
-
|
|
4455
|
+
Wt,
|
|
4436
4456
|
{
|
|
4437
4457
|
className: "size-16 rounded-md text-white/30",
|
|
4438
4458
|
weight: "regular",
|
|
4439
4459
|
"aria-hidden": !0
|
|
4440
4460
|
}
|
|
4441
4461
|
) }),
|
|
4442
|
-
/* @__PURE__ */ n(
|
|
4443
|
-
] }),
|
|
4462
|
+
/* @__PURE__ */ n(oi, {})
|
|
4463
|
+
] }), ci = (e, t, s) => ({
|
|
4444
4464
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4445
|
-
content: /* @__PURE__ */ n(
|
|
4446
|
-
}),
|
|
4465
|
+
content: /* @__PURE__ */ n(Cn, { item: e, index: t })
|
|
4466
|
+
}), di = ({
|
|
4447
4467
|
src: e,
|
|
4448
4468
|
poster: t,
|
|
4449
4469
|
mimeType: s,
|
|
4450
4470
|
preload: a,
|
|
4451
4471
|
items: r
|
|
4452
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
4472
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], En = (e, t) => e.map((s, a) => ({
|
|
4453
4473
|
src: s.src,
|
|
4454
4474
|
poster: s.poster,
|
|
4455
4475
|
mimeType: s.mimeType,
|
|
4456
4476
|
preload: s.preload,
|
|
4457
4477
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4458
|
-
})),
|
|
4478
|
+
})), ui = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
4459
4479
|
const { viewerOpen: o, viewerIndex: d, handleActivate: u, closeViewer: g } = Ie(
|
|
4460
4480
|
i
|
|
4461
4481
|
);
|
|
@@ -4467,15 +4487,15 @@ const Or = ({
|
|
|
4467
4487
|
onClick: () => u(0),
|
|
4468
4488
|
"aria-label": "Play video",
|
|
4469
4489
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
4470
|
-
children: /* @__PURE__ */ n(
|
|
4490
|
+
children: /* @__PURE__ */ n(Cn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4471
4491
|
}
|
|
4472
4492
|
),
|
|
4473
4493
|
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: l }) }) : null,
|
|
4474
4494
|
/* @__PURE__ */ n(
|
|
4475
|
-
|
|
4495
|
+
kn,
|
|
4476
4496
|
{
|
|
4477
4497
|
open: o,
|
|
4478
|
-
items:
|
|
4498
|
+
items: En(
|
|
4479
4499
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4480
4500
|
a
|
|
4481
4501
|
),
|
|
@@ -4484,7 +4504,7 @@ const Or = ({
|
|
|
4484
4504
|
}
|
|
4485
4505
|
)
|
|
4486
4506
|
] });
|
|
4487
|
-
},
|
|
4507
|
+
}, In = ({
|
|
4488
4508
|
state: e,
|
|
4489
4509
|
src: t,
|
|
4490
4510
|
poster: s,
|
|
@@ -4496,13 +4516,13 @@ const Or = ({
|
|
|
4496
4516
|
preload: d,
|
|
4497
4517
|
onClick: u
|
|
4498
4518
|
}) => {
|
|
4499
|
-
const g =
|
|
4519
|
+
const g = di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate: w, closeViewer: N } = Ie(
|
|
4500
4520
|
u
|
|
4501
4521
|
);
|
|
4502
4522
|
if (g.length === 0)
|
|
4503
4523
|
return null;
|
|
4504
|
-
const
|
|
4505
|
-
(
|
|
4524
|
+
const p = g.map(
|
|
4525
|
+
(v, b) => ci(v, b, g.length)
|
|
4506
4526
|
);
|
|
4507
4527
|
return /* @__PURE__ */ h(
|
|
4508
4528
|
ke,
|
|
@@ -4513,18 +4533,18 @@ const Or = ({
|
|
|
4513
4533
|
"data-testid": "video-attachment",
|
|
4514
4534
|
children: [
|
|
4515
4535
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4516
|
-
|
|
4536
|
+
Nn,
|
|
4517
4537
|
{
|
|
4518
|
-
tiles:
|
|
4519
|
-
onTileActivate:
|
|
4538
|
+
tiles: p,
|
|
4539
|
+
onTileActivate: w,
|
|
4520
4540
|
className: "overflow-hidden rounded-md"
|
|
4521
4541
|
}
|
|
4522
4542
|
) }),
|
|
4523
4543
|
/* @__PURE__ */ n(
|
|
4524
|
-
|
|
4544
|
+
kn,
|
|
4525
4545
|
{
|
|
4526
4546
|
open: f,
|
|
4527
|
-
items:
|
|
4547
|
+
items: En(g, r),
|
|
4528
4548
|
initialIndex: c,
|
|
4529
4549
|
onClose: N
|
|
4530
4550
|
}
|
|
@@ -4532,17 +4552,17 @@ const Or = ({
|
|
|
4532
4552
|
]
|
|
4533
4553
|
}
|
|
4534
4554
|
);
|
|
4535
|
-
},
|
|
4536
|
-
Composer:
|
|
4537
|
-
Sent:
|
|
4538
|
-
Received:
|
|
4539
|
-
},
|
|
4540
|
-
Image:
|
|
4541
|
-
Video:
|
|
4542
|
-
Audio:
|
|
4543
|
-
Pdf:
|
|
4544
|
-
File:
|
|
4545
|
-
},
|
|
4555
|
+
}, mi = (e) => /* @__PURE__ */ n(ui, { ...e }), hi = (e) => /* @__PURE__ */ n(In, { ...e, state: "sent" }), fi = (e) => /* @__PURE__ */ n(In, { ...e, state: "received" }), gi = {
|
|
4556
|
+
Composer: mi,
|
|
4557
|
+
Sent: hi,
|
|
4558
|
+
Received: fi
|
|
4559
|
+
}, Ri = {
|
|
4560
|
+
Image: Qr,
|
|
4561
|
+
Video: gi,
|
|
4562
|
+
Audio: Rr,
|
|
4563
|
+
Pdf: li,
|
|
4564
|
+
File: Hr
|
|
4565
|
+
}, pi = ({
|
|
4546
4566
|
question: e,
|
|
4547
4567
|
onClick: t,
|
|
4548
4568
|
loading: s = !1,
|
|
@@ -4554,7 +4574,7 @@ const Or = ({
|
|
|
4554
4574
|
onClick: t,
|
|
4555
4575
|
disabled: s,
|
|
4556
4576
|
style: { backgroundColor: "#E6E5E3" },
|
|
4557
|
-
className:
|
|
4577
|
+
className: y(
|
|
4558
4578
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4559
4579
|
{
|
|
4560
4580
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4564,7 +4584,7 @@ const Or = ({
|
|
|
4564
4584
|
),
|
|
4565
4585
|
children: e
|
|
4566
4586
|
}
|
|
4567
|
-
),
|
|
4587
|
+
), Li = ({
|
|
4568
4588
|
faqs: e,
|
|
4569
4589
|
onFaqClick: t,
|
|
4570
4590
|
loadingFaqId: s,
|
|
@@ -4593,7 +4613,7 @@ const Or = ({
|
|
|
4593
4613
|
children: [
|
|
4594
4614
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4595
4615
|
o.map((d) => /* @__PURE__ */ n(
|
|
4596
|
-
|
|
4616
|
+
pi,
|
|
4597
4617
|
{
|
|
4598
4618
|
question: d.question,
|
|
4599
4619
|
onClick: () => t(d.id),
|
|
@@ -4607,39 +4627,39 @@ const Or = ({
|
|
|
4607
4627
|
] }) });
|
|
4608
4628
|
};
|
|
4609
4629
|
export {
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4630
|
+
sn as A,
|
|
4631
|
+
Na as B,
|
|
4632
|
+
Za as C,
|
|
4633
|
+
Ws as D,
|
|
4634
|
+
Os as E,
|
|
4635
|
+
Li as F,
|
|
4636
|
+
Ai as L,
|
|
4637
|
+
Ei as M,
|
|
4618
4638
|
pe as a,
|
|
4619
4639
|
ne as b,
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4640
|
+
or as c,
|
|
4641
|
+
hn as d,
|
|
4642
|
+
Ii as e,
|
|
4643
|
+
pi as f,
|
|
4624
4644
|
ie as g,
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4645
|
+
Ut as h,
|
|
4646
|
+
Ri as i,
|
|
4647
|
+
Ia as j,
|
|
4648
|
+
Ci as k,
|
|
4649
|
+
Ti as l,
|
|
4650
|
+
zr as m,
|
|
4651
|
+
Lr as n,
|
|
4652
|
+
ir as o,
|
|
4653
|
+
Pr as p,
|
|
4654
|
+
Qt as q,
|
|
4635
4655
|
ce as r,
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4656
|
+
ln as s,
|
|
4657
|
+
Us as t,
|
|
4658
|
+
Mi as u,
|
|
4659
|
+
Xs as v,
|
|
4660
|
+
nt as w,
|
|
4661
|
+
st as x,
|
|
4662
|
+
Zt as y,
|
|
4663
|
+
Si as z
|
|
4644
4664
|
};
|
|
4645
|
-
//# sourceMappingURL=index-
|
|
4665
|
+
//# sourceMappingURL=index-oHV1Drpu.js.map
|