@linktr.ee/messaging-react 3.4.3-rc-1782553325 → 3.4.3-rc-1782553894
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-9BtSxGC1.cjs → Card-BVo5bHm8.cjs} +2 -2
- package/dist/{Card-9BtSxGC1.cjs.map → Card-BVo5bHm8.cjs.map} +1 -1
- package/dist/{Card-B_tMXmN_.js → Card-COb-KQ3x.js} +2 -2
- package/dist/{Card-B_tMXmN_.js.map → Card-COb-KQ3x.js.map} +1 -1
- package/dist/{Card-Rg9QOS9o.cjs → Card-ChLOPFzW.cjs} +2 -2
- package/dist/{Card-Rg9QOS9o.cjs.map → Card-ChLOPFzW.cjs.map} +1 -1
- package/dist/{Card-CGjd8b1K.js → Card-Cj686l88.js} +2 -2
- package/dist/{Card-CGjd8b1K.js.map → Card-Cj686l88.js.map} +1 -1
- package/dist/{Card-CeiUwix2.js → Card-DAiwq638.js} +3 -3
- package/dist/{Card-CeiUwix2.js.map → Card-DAiwq638.js.map} +1 -1
- package/dist/{Card-BTPEZadJ.cjs → Card-ffFBtGq1.cjs} +2 -2
- package/dist/{Card-BTPEZadJ.cjs.map → Card-ffFBtGq1.cjs.map} +1 -1
- package/dist/{LockedThumbnail-4_S1w5SO.js → LockedThumbnail-Bmw7e0iZ.js} +2 -2
- package/dist/{LockedThumbnail-4_S1w5SO.js.map → LockedThumbnail-Bmw7e0iZ.js.map} +1 -1
- package/dist/{LockedThumbnail-BIcI8zTC.cjs → LockedThumbnail-DzTY1vH1.cjs} +2 -2
- package/dist/{LockedThumbnail-BIcI8zTC.cjs.map → LockedThumbnail-DzTY1vH1.cjs.map} +1 -1
- package/dist/index-DXBga91I.cjs +2 -0
- package/dist/index-DXBga91I.cjs.map +1 -0
- package/dist/{index-D9JJLtJg.js → index-D_U3aScH.js} +796 -772
- package/dist/index-D_U3aScH.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.test.tsx +8 -0
- package/src/components/ChannelView.tsx +25 -8
- package/dist/index-D9JJLtJg.js.map +0 -1
- package/dist/index-DOw3VaHR.cjs +0 -2
- package/dist/index-DOw3VaHR.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import j, { createContext as We, useContext as _e, useCallback as J, useState as F, useRef as
|
|
3
|
-
import { StreamChatService as
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import j, { createContext as We, useContext as _e, useCallback as J, useState as F, useRef as Y, useEffect as K, useId as In, useMemo as re, Suspense as Xe } from "react";
|
|
3
|
+
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as Tn, LinkPreviewsManager as Lt } from "stream-chat";
|
|
5
|
-
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as Gt, Attachment as Dn, EditMessageModal as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import
|
|
8
|
-
import { MessageActions as
|
|
5
|
+
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as Gt, Attachment as Dn, EditMessageModal as Pn, MessageBlocked as zn, MessageBouncePrompt as On, MessageDeleted as $n, MessageIsThreadReplyInChannelButtonIndicator as Fn, MessageRepliesCountButton as Bn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Dt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as ye, useMessageComposer as Jn, useStateStore as Zn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, AttachmentPreviewList as ns, QuotedMessagePreview as ss, TextareaComposer as as, MessageTimestamp as $e, AIStates as Fe, useTypingContext as rs, useAIState as is, Channel as os, WithComponents as ls, Window as cs, MessageList as ds, ChannelList as us, InfiniteScroll as ms } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ge, DotsThreeIcon as hs, SpinnerGapIcon as Te, SignOutIcon as fs, ProhibitInsetIcon as Pt, FlagIcon as Ht, FileIcon as Yt, ImageIcon as gs, SpeakerHighIcon as bs, VideoCameraIcon as qt, FileMdIcon as ps, FileTextIcon as vs, FileZipIcon as xs, FilePptIcon as ws, FileCsvIcon as Ns, FileXlsIcon as _s, FileDocIcon as ys, FilePdfIcon as Cs, CircleNotchIcon as we, PlayIcon as He, PauseIcon as ks, LinkIcon as Es, DownloadSimpleIcon as Ne, GiftIcon as Is, ThumbsUpIcon as Ss, ThumbsDownIcon as Ts, TrashSimpleIcon as As, XIcon as Pe, ArrowUpIcon as Ms, SparkleIcon as pe, ProhibitIcon as Rs, ArrowLeftIcon as zt, CaretRightIcon as ve, PencilSimpleIcon as Ls, CaretLeftIcon as Ds } from "@phosphor-icons/react";
|
|
7
|
+
import _ from "classnames";
|
|
8
|
+
import { MessageActions as Ps, DefaultDropdownActionButton as Wt } from "stream-chat-react/experimental";
|
|
9
9
|
const Xt = We({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
@@ -16,7 +16,7 @@ const Xt = We({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), Je = () => _e(Xt),
|
|
19
|
+
}), Je = () => _e(Xt), _i = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,7 +24,7 @@ const Xt = We({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
27
|
+
var D, C;
|
|
28
28
|
const l = J(
|
|
29
29
|
(k, ...S) => {
|
|
30
30
|
i && console.log(`🔥 [MessagingProvider] ${k}`, ...S);
|
|
@@ -37,37 +37,37 @@ const Xt = We({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [o, d] = F(null), [m, g] = F(null), [u, f] = F(!1), [c,
|
|
40
|
+
const [o, d] = F(null), [m, g] = F(null), [u, f] = F(!1), [c, b] = F(!1), [N, w] = F(null), p = Y(!1), v = Y(null), M = Y(s);
|
|
41
41
|
M.current = s;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
42
|
+
const T = Y(i);
|
|
43
|
+
T.current = i;
|
|
44
|
+
const y = Y({
|
|
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
|
+
}), O = Y(0);
|
|
50
|
+
O.current++, l("📊 RENDER INFO", {
|
|
51
|
+
renderCount: O.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
54
|
-
userChanged:
|
|
55
|
-
apiKeyChanged:
|
|
56
|
-
serviceConfigChanged:
|
|
57
|
-
capabilitiesChanged:
|
|
54
|
+
userChanged: y.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: y.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: y.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: y.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), y.current = {
|
|
60
60
|
userId: t == null ? void 0 : t.id,
|
|
61
61
|
apiKey: a,
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((
|
|
67
|
-
const
|
|
65
|
+
const P = Y(null);
|
|
66
|
+
a && ((D = P.current) == null ? void 0 : D.apiKey) !== a && (P.current = { apiKey: a, client: new Tn(a) });
|
|
67
|
+
const L = a ? ((C = P.current) == null ? void 0 : C.client) ?? null : null;
|
|
68
68
|
K(() => {
|
|
69
|
-
const k =
|
|
70
|
-
if (!a || !
|
|
69
|
+
const k = O.current, S = M.current;
|
|
70
|
+
if (!a || !L || !S) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
72
|
renderCount: k,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
@@ -78,36 +78,36 @@ const Xt = We({
|
|
|
78
78
|
renderCount: k,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
81
|
+
const $ = new Sn({
|
|
82
82
|
...S,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
84
|
+
debug: T.current,
|
|
85
|
+
client: L
|
|
86
86
|
});
|
|
87
|
-
v.current =
|
|
87
|
+
v.current = $, d($), l("✅ SERVICE SET", {
|
|
88
88
|
renderCount: k,
|
|
89
|
-
serviceInstance:
|
|
89
|
+
serviceInstance: !!$
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
92
|
-
const E =
|
|
91
|
+
}, [a, L]);
|
|
92
|
+
const E = Y(null);
|
|
93
93
|
K(() => {
|
|
94
|
-
var S,
|
|
94
|
+
var S, $;
|
|
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: p.current,
|
|
100
100
|
isConnected: u,
|
|
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 (p.current) {
|
|
107
107
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((S = E.current) == null ? void 0 : S.serviceId) === o && ((
|
|
110
|
+
if (((S = E.current) == null ? void 0 : S.serviceId) === o && (($ = E.current) == null ? void 0 : $.userId) === t.id) {
|
|
111
111
|
l(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,34 +115,34 @@ 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 }), p.current = !0, b(!0), w(null);
|
|
119
119
|
try {
|
|
120
120
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const z = await o.connectUser(t);
|
|
122
|
+
g(z), f(!0), E.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: z.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
} catch (z) {
|
|
127
|
+
const V = z instanceof Error ? z.message : "Connection failed";
|
|
128
|
+
w(V), l("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: V
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
b(!1), p.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
139
|
}, [o, t, l, u]), K(() => {
|
|
140
|
-
const k =
|
|
140
|
+
const k = L;
|
|
141
141
|
return () => {
|
|
142
142
|
var S;
|
|
143
143
|
k && (E.current = null, (S = v.current) == null || S.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
145
|
+
}, [L]);
|
|
146
146
|
const R = J(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
@@ -151,33 +151,33 @@ 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 }), b(!0);
|
|
155
155
|
try {
|
|
156
156
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
157
157
|
const k = await o.connectUser(t);
|
|
158
|
-
g(k), f(!0),
|
|
158
|
+
g(k), f(!0), w(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
159
|
} catch (k) {
|
|
160
160
|
const S = k instanceof Error ? k.message : "Refresh failed";
|
|
161
|
-
|
|
161
|
+
w(S), l("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
163
|
error: S
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
b(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [o, t, l]),
|
|
168
|
+
}, [o, t, l]), A = j.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!o,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
172
172
|
isLoading: c,
|
|
173
|
-
hasError: !!
|
|
173
|
+
hasError: !!N,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
176
|
service: o,
|
|
177
177
|
client: m,
|
|
178
178
|
isConnected: u,
|
|
179
179
|
isLoading: c,
|
|
180
|
-
error:
|
|
180
|
+
error: N,
|
|
181
181
|
capabilities: r,
|
|
182
182
|
refreshConnection: R,
|
|
183
183
|
debug: i
|
|
@@ -186,27 +186,27 @@ const Xt = We({
|
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
N,
|
|
190
190
|
r,
|
|
191
191
|
R,
|
|
192
192
|
i,
|
|
193
193
|
l
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
197
|
-
willRenderChat: !!
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(Xt.Provider, { value:
|
|
196
|
+
renderCount: O.current,
|
|
197
|
+
willRenderChat: !!L,
|
|
198
|
+
contextValueReady: !!A
|
|
199
|
+
}), /* @__PURE__ */ n(Xt.Provider, { value: A, children: L ? /* @__PURE__ */ n(
|
|
200
200
|
An,
|
|
201
201
|
{
|
|
202
|
-
client:
|
|
202
|
+
client: L,
|
|
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
|
+
}, zs = () => Je(), Kt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
211
|
const [t, s] = F(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -228,16 +228,16 @@ const Xt = We({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
231
|
+
}, Os = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
232
232
|
function $s(e) {
|
|
233
|
-
return
|
|
233
|
+
return Os.test(e.trim());
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Ot(e, t) {
|
|
236
236
|
const s = e == null ? void 0 : e.trim();
|
|
237
237
|
return !s || t && s === t ? !1 : !$s(s);
|
|
238
238
|
}
|
|
239
239
|
function Jt(e) {
|
|
240
|
-
return
|
|
240
|
+
return Ot(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Ot(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
241
241
|
}
|
|
242
242
|
const $t = [
|
|
243
243
|
"🍎",
|
|
@@ -279,7 +279,7 @@ function Bs(e) {
|
|
|
279
279
|
const s = Fs(e) % $t.length;
|
|
280
280
|
return $t[s];
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const ne = ({
|
|
283
283
|
id: e,
|
|
284
284
|
image: t,
|
|
285
285
|
size: s = 40,
|
|
@@ -299,7 +299,7 @@ const se = ({
|
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
"aria-hidden": "true",
|
|
302
|
-
className:
|
|
302
|
+
className: _(
|
|
303
303
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
304
304
|
m
|
|
305
305
|
),
|
|
@@ -309,7 +309,7 @@ const se = ({
|
|
|
309
309
|
return /* @__PURE__ */ h(
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
|
-
className:
|
|
312
|
+
className: _(
|
|
313
313
|
"relative flex-shrink-0 !bg-transparent",
|
|
314
314
|
a
|
|
315
315
|
),
|
|
@@ -324,14 +324,14 @@ const se = ({
|
|
|
324
324
|
{
|
|
325
325
|
"aria-hidden": "true",
|
|
326
326
|
className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
327
|
-
children: /* @__PURE__ */ n(
|
|
327
|
+
children: /* @__PURE__ */ n(Ge, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
330
|
/* @__PURE__ */ n(
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
333
|
"data-testid": "avatar-ring",
|
|
334
|
-
className:
|
|
334
|
+
className: _(
|
|
335
335
|
"h-full w-full",
|
|
336
336
|
"bg-transparent"
|
|
337
337
|
),
|
|
@@ -363,11 +363,11 @@ const se = ({
|
|
|
363
363
|
onActionComplete: m,
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
const { service: u, debug: f } = Je(), c = (
|
|
366
|
+
var D;
|
|
367
|
+
const { service: u, debug: f } = Je(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, b = !!(a && s && u && c), [N, w] = F(!1), [p, v] = F(null), [M, T] = F(!1), [y, O] = F(!1), P = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
|
|
368
368
|
return K(() => {
|
|
369
|
-
if (!
|
|
370
|
-
|
|
369
|
+
if (!b || !u || !c) {
|
|
370
|
+
w(!1), v(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
373
|
let C = !1;
|
|
@@ -375,7 +375,7 @@ const se = ({
|
|
|
375
375
|
try {
|
|
376
376
|
const k = await u.getBlockedUsers();
|
|
377
377
|
if (C) return;
|
|
378
|
-
|
|
378
|
+
w(
|
|
379
379
|
k.some(
|
|
380
380
|
(S) => S.blocked_user_id === c
|
|
381
381
|
)
|
|
@@ -388,48 +388,48 @@ const se = ({
|
|
|
388
388
|
})(), () => {
|
|
389
389
|
C = !0;
|
|
390
390
|
};
|
|
391
|
-
}, [
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
391
|
+
}, [b, u, c, g]), {
|
|
392
|
+
isParticipantBlocked: N,
|
|
393
|
+
isCheckingBlockedStatus: P,
|
|
394
394
|
isLeaving: M,
|
|
395
|
-
isUpdatingBlockStatus:
|
|
395
|
+
isUpdatingBlockStatus: y,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
397
|
var C;
|
|
398
398
|
if (!M) {
|
|
399
|
-
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
399
|
+
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), T(!0);
|
|
400
400
|
try {
|
|
401
401
|
const k = ((C = e._client) == null ? void 0 : C.userID) ?? null;
|
|
402
402
|
await e.hide(k, !1), r && await r(e), m == null || m();
|
|
403
403
|
} catch (k) {
|
|
404
404
|
console.error(`[${g}] Failed to leave conversation`, k);
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
T(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
411
|
var C, k, S;
|
|
412
|
-
if (!(
|
|
413
|
-
o == null || o(), f && console.log(`[${g}] Block member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id),
|
|
412
|
+
if (!(y || !u)) {
|
|
413
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), O(!0);
|
|
414
414
|
try {
|
|
415
415
|
await u.blockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${g}] Failed to block member`,
|
|
416
|
+
} catch ($) {
|
|
417
|
+
console.error(`[${g}] Failed to block member`, $);
|
|
418
418
|
} finally {
|
|
419
|
-
|
|
419
|
+
O(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
424
|
var C, k, S;
|
|
425
|
-
if (!(
|
|
426
|
-
o == null || o(), f && console.log(`[${g}] Unblock member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id),
|
|
425
|
+
if (!(y || !u)) {
|
|
426
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), O(!0);
|
|
427
427
|
try {
|
|
428
428
|
await u.unBlockUser((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
429
|
+
} catch ($) {
|
|
430
|
+
console.error(`[${g}] Failed to unblock member`, $);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
O(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
@@ -437,7 +437,7 @@ const se = ({
|
|
|
437
437
|
d == null || d(), m == null || m(), window.open(Us, "_blank", "noopener,noreferrer");
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
|
-
},
|
|
440
|
+
}, be = ({
|
|
441
441
|
variant: e = "default",
|
|
442
442
|
className: t,
|
|
443
443
|
children: s,
|
|
@@ -446,7 +446,7 @@ const se = ({
|
|
|
446
446
|
"button",
|
|
447
447
|
{
|
|
448
448
|
type: "button",
|
|
449
|
-
className:
|
|
449
|
+
className: _(
|
|
450
450
|
"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
451
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
452
452
|
t
|
|
@@ -468,15 +468,15 @@ const se = ({
|
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] = F(!1),
|
|
472
|
-
isParticipantBlocked:
|
|
471
|
+
const [f, c] = F(!1), b = Y(null), N = In(), w = J(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: p,
|
|
473
473
|
isCheckingBlockedStatus: v,
|
|
474
474
|
isLeaving: M,
|
|
475
|
-
isUpdatingBlockStatus:
|
|
476
|
-
handleLeaveConversation:
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
479
|
-
handleReportUser:
|
|
475
|
+
isUpdatingBlockStatus: T,
|
|
476
|
+
handleLeaveConversation: y,
|
|
477
|
+
handleBlockUser: O,
|
|
478
|
+
handleUnblockUser: P,
|
|
479
|
+
handleReportUser: L
|
|
480
480
|
} = js({
|
|
481
481
|
channel: e,
|
|
482
482
|
participant: t,
|
|
@@ -487,20 +487,20 @@ const se = ({
|
|
|
487
487
|
onDeleteConversationClick: o,
|
|
488
488
|
onBlockParticipantClick: d,
|
|
489
489
|
onReportParticipantClick: m,
|
|
490
|
-
onActionComplete:
|
|
490
|
+
onActionComplete: w,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
493
|
return K(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const R = (
|
|
496
|
-
|
|
497
|
-
},
|
|
498
|
-
|
|
495
|
+
const R = (D) => {
|
|
496
|
+
b.current && !b.current.contains(D.target) && c(!1);
|
|
497
|
+
}, A = (D) => {
|
|
498
|
+
D.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown", R), document.addEventListener("keydown",
|
|
501
|
-
document.removeEventListener("mousedown", R), document.removeEventListener("keydown",
|
|
500
|
+
return document.addEventListener("mousedown", R), document.addEventListener("keydown", A), () => {
|
|
501
|
+
document.removeEventListener("mousedown", R), document.removeEventListener("keydown", A);
|
|
502
502
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
503
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
@@ -508,7 +508,7 @@ const se = ({
|
|
|
508
508
|
type: "button",
|
|
509
509
|
"aria-haspopup": "true",
|
|
510
510
|
"aria-expanded": f,
|
|
511
|
-
"aria-controls": f ?
|
|
511
|
+
"aria-controls": f ? N : void 0,
|
|
512
512
|
onClick: () => c((R) => !R),
|
|
513
513
|
children: [
|
|
514
514
|
/* @__PURE__ */ n(hs, { className: "size-5 text-black/90" }),
|
|
@@ -519,21 +519,21 @@ const se = ({
|
|
|
519
519
|
f && /* @__PURE__ */ n(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
|
-
id:
|
|
522
|
+
id: N,
|
|
523
523
|
"aria-label": "Conversation options",
|
|
524
|
-
className:
|
|
524
|
+
className: _(
|
|
525
525
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
526
526
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
527
527
|
),
|
|
528
528
|
children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
|
-
|
|
530
|
+
be,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
532
|
+
onClick: y,
|
|
533
533
|
disabled: M,
|
|
534
534
|
"aria-busy": M,
|
|
535
535
|
children: [
|
|
536
|
-
M ? /* @__PURE__ */ n(
|
|
536
|
+
M ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(fs, { className: "h-5 w-5" }),
|
|
537
537
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
538
538
|
]
|
|
539
539
|
}
|
|
@@ -541,34 +541,34 @@ const se = ({
|
|
|
541
541
|
a && /* @__PURE__ */ n("li", { children: v ? (
|
|
542
542
|
// Block status not yet resolved — show a disabled placeholder
|
|
543
543
|
// so a premature click can't act on a stale block state.
|
|
544
|
-
/* @__PURE__ */ h(
|
|
545
|
-
/* @__PURE__ */ n(
|
|
544
|
+
/* @__PURE__ */ h(be, { disabled: !0, "aria-busy": !0, children: [
|
|
545
|
+
/* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
549
|
-
|
|
548
|
+
) : p ? /* @__PURE__ */ h(
|
|
549
|
+
be,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
552
|
-
disabled:
|
|
553
|
-
"aria-busy":
|
|
551
|
+
onClick: P,
|
|
552
|
+
disabled: T,
|
|
553
|
+
"aria-busy": T,
|
|
554
554
|
children: [
|
|
555
|
-
|
|
555
|
+
T ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Pt, { className: "h-5 w-5" }),
|
|
556
556
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
557
|
]
|
|
558
558
|
}
|
|
559
559
|
) : /* @__PURE__ */ h(
|
|
560
|
-
|
|
560
|
+
be,
|
|
561
561
|
{
|
|
562
|
-
onClick:
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
562
|
+
onClick: O,
|
|
563
|
+
disabled: T,
|
|
564
|
+
"aria-busy": T,
|
|
565
565
|
children: [
|
|
566
|
-
|
|
566
|
+
T ? /* @__PURE__ */ n(Te, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Pt, { className: "h-5 w-5" }),
|
|
567
567
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }),
|
|
571
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
571
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(be, { variant: "danger", onClick: L, children: [
|
|
572
572
|
/* @__PURE__ */ n(Ht, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
@@ -619,7 +619,7 @@ function Zt({
|
|
|
619
619
|
const s = e == null ? void 0 : e.text, a = Ys(t);
|
|
620
620
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
621
|
}
|
|
622
|
-
const qs = j.lazy(() => import("./Card-
|
|
622
|
+
const qs = j.lazy(() => import("./Card-Cj686l88.js")), Ws = j.lazy(() => import("./Card-COb-KQ3x.js")), Xs = j.lazy(() => import("./Card-DAiwq638.js")), Ze = () => /* @__PURE__ */ n(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
625
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
@@ -646,18 +646,18 @@ function tn(e) {
|
|
|
646
646
|
}
|
|
647
647
|
const ea = {
|
|
648
648
|
video: qt,
|
|
649
|
-
audio:
|
|
649
|
+
audio: bs,
|
|
650
650
|
image: gs,
|
|
651
651
|
document: Yt
|
|
652
652
|
}, ta = {
|
|
653
653
|
pdf: Cs,
|
|
654
654
|
doc: ys,
|
|
655
|
-
xls:
|
|
656
|
-
csv:
|
|
655
|
+
xls: _s,
|
|
656
|
+
csv: Ns,
|
|
657
657
|
ppt: ws,
|
|
658
658
|
zip: xs,
|
|
659
659
|
text: vs,
|
|
660
|
-
markdown:
|
|
660
|
+
markdown: ps,
|
|
661
661
|
generic: Yt
|
|
662
662
|
};
|
|
663
663
|
function na(e) {
|
|
@@ -682,78 +682,78 @@ const sa = (e) => {
|
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: m
|
|
684
684
|
}) => {
|
|
685
|
-
const g = ie(t), u =
|
|
686
|
-
|
|
687
|
-
}, []),
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const U =
|
|
685
|
+
const g = ie(t), u = Y(null), f = Y(null), c = Y(null), b = Y(r), [N, w] = F(a), [p, v] = F(0), [M, T] = F(!1), [y, O] = F(!1), [P, L] = F(!1), [E, R] = F(!1), [A, D] = F(!0), [C, k] = F(null), S = J(() => {
|
|
686
|
+
L(!1), w(!0);
|
|
687
|
+
}, []), $ = J((x) => {
|
|
688
|
+
const I = f.current;
|
|
689
|
+
if (!I) return 0;
|
|
690
|
+
const U = I.getBoundingClientRect();
|
|
691
691
|
return Math.max(
|
|
692
692
|
0,
|
|
693
|
-
Math.min(1, (sa(
|
|
693
|
+
Math.min(1, (sa(x) - U.left) / U.width)
|
|
694
694
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
699
|
-
|
|
700
|
-
const
|
|
701
|
-
v(
|
|
695
|
+
}, []), z = J((x) => {
|
|
696
|
+
const I = u.current;
|
|
697
|
+
I && I.duration && (I.currentTime = x * I.duration);
|
|
698
|
+
}, []), V = (x) => {
|
|
699
|
+
x.stopPropagation(), T(!0);
|
|
700
|
+
const I = $(x);
|
|
701
|
+
v(I), z(I);
|
|
702
702
|
};
|
|
703
703
|
K(() => {
|
|
704
|
-
r !== void 0 && r !==
|
|
704
|
+
r !== void 0 && r !== b.current && (b.current = r, w(r));
|
|
705
705
|
}, [r]), K(() => {
|
|
706
|
-
if (!
|
|
706
|
+
if (!N) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
711
|
-
const
|
|
712
|
-
|
|
710
|
+
const x = () => {
|
|
711
|
+
const I = u.current;
|
|
712
|
+
I && I.duration && !M && v(I.currentTime / I.duration), c.current = requestAnimationFrame(x);
|
|
713
713
|
};
|
|
714
|
-
return c.current = requestAnimationFrame(
|
|
714
|
+
return c.current = requestAnimationFrame(x), () => {
|
|
715
715
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
716
|
};
|
|
717
|
-
}, [
|
|
718
|
-
const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}) :
|
|
722
|
-
}, [
|
|
717
|
+
}, [N, M]), K(() => {
|
|
718
|
+
const x = u.current;
|
|
719
|
+
x && (N ? x.play().catch((I) => {
|
|
720
|
+
w(!1), L(!0);
|
|
721
|
+
}) : x.pause());
|
|
722
|
+
}, [N]), K(() => {
|
|
723
723
|
if (!M) return;
|
|
724
|
-
const
|
|
725
|
-
|
|
724
|
+
const x = (U) => v($(U)), I = (U) => {
|
|
725
|
+
T(!1), z($(U));
|
|
726
726
|
};
|
|
727
|
-
return window.addEventListener("mousemove",
|
|
728
|
-
window.removeEventListener("mousemove",
|
|
727
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", I), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", I), () => {
|
|
728
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", I), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", I);
|
|
729
729
|
};
|
|
730
|
-
}, [M,
|
|
731
|
-
const
|
|
730
|
+
}, [M, $, z]);
|
|
731
|
+
const ee = C ? { aspectRatio: String(C) } : void 0, Z = C ? "" : " aspect-video", G = Math.round(p * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
735
735
|
role: "button",
|
|
736
736
|
tabIndex: 0,
|
|
737
737
|
className: `relative cursor-pointer overflow-hidden bg-black ${Z}`,
|
|
738
|
-
style:
|
|
739
|
-
onClick: (
|
|
738
|
+
style: ee,
|
|
739
|
+
onClick: (x) => {
|
|
740
740
|
if (m) {
|
|
741
|
-
m(
|
|
741
|
+
m(x);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
P || l && w((I) => !I);
|
|
745
745
|
},
|
|
746
|
-
onKeyDown: (
|
|
747
|
-
if (!(
|
|
748
|
-
if (
|
|
749
|
-
m(
|
|
746
|
+
onKeyDown: (x) => {
|
|
747
|
+
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
748
|
+
if (x.preventDefault(), m) {
|
|
749
|
+
m(x);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
P || l && w((I) => !I);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
756
|
+
s && (g === "audio" || A) && /* @__PURE__ */ n(
|
|
757
757
|
"img",
|
|
758
758
|
{
|
|
759
759
|
src: s,
|
|
@@ -761,7 +761,7 @@ const sa = (e) => {
|
|
|
761
761
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
|
-
!s && (g === "audio" ||
|
|
764
|
+
!s && (g === "audio" || A) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
|
|
765
765
|
className: "size-12 text-black/20",
|
|
766
766
|
weight: "regular"
|
|
767
767
|
}) }),
|
|
@@ -775,12 +775,12 @@ const sa = (e) => {
|
|
|
775
775
|
style: { width: "100%", height: "100%" },
|
|
776
776
|
onLoadStart: () => R(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
R(!1),
|
|
778
|
+
R(!1), D(!1);
|
|
779
779
|
},
|
|
780
780
|
onWaiting: () => R(!0),
|
|
781
|
-
onPlay: () =>
|
|
781
|
+
onPlay: () => L(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
783
|
+
i || (w(!1), v(0));
|
|
784
784
|
},
|
|
785
785
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
786
786
|
}
|
|
@@ -795,41 +795,41 @@ const sa = (e) => {
|
|
|
795
795
|
style: { width: "100%", height: "100%" },
|
|
796
796
|
onLoadStart: () => R(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
R(!1),
|
|
798
|
+
R(!1), D(!1);
|
|
799
799
|
},
|
|
800
800
|
onWaiting: () => R(!0),
|
|
801
|
-
onPlay: () =>
|
|
801
|
+
onPlay: () => L(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const x = u.current;
|
|
804
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && k(x.videoWidth / x.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
807
|
+
i || (w(!1), v(0));
|
|
808
808
|
},
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
E && !
|
|
813
|
-
|
|
812
|
+
E && !P && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
|
+
we,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
P && !l && /* @__PURE__ */ n(
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
822
822
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
823
823
|
role: "button",
|
|
824
824
|
tabIndex: 0,
|
|
825
825
|
"aria-label": "Play preview",
|
|
826
|
-
onClick: (
|
|
827
|
-
|
|
826
|
+
onClick: (x) => {
|
|
827
|
+
x.stopPropagation(), S();
|
|
828
828
|
},
|
|
829
|
-
onKeyDown: (
|
|
830
|
-
|
|
829
|
+
onKeyDown: (x) => {
|
|
830
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), S());
|
|
831
831
|
},
|
|
832
|
-
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(
|
|
832
|
+
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(He, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
835
|
o && !l && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
|
|
@@ -837,23 +837,23 @@ const sa = (e) => {
|
|
|
837
837
|
{
|
|
838
838
|
role: "slider",
|
|
839
839
|
"aria-label": "Playback position",
|
|
840
|
-
"aria-valuenow":
|
|
840
|
+
"aria-valuenow": G,
|
|
841
841
|
"aria-valuemin": 0,
|
|
842
842
|
"aria-valuemax": 100,
|
|
843
843
|
tabIndex: 0,
|
|
844
844
|
ref: f,
|
|
845
845
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
|
-
onMouseDown:
|
|
847
|
-
onTouchStart:
|
|
848
|
-
onClick: (
|
|
849
|
-
onKeyDown: (
|
|
850
|
-
|
|
846
|
+
onMouseDown: V,
|
|
847
|
+
onTouchStart: V,
|
|
848
|
+
onClick: (x) => x.stopPropagation(),
|
|
849
|
+
onKeyDown: (x) => {
|
|
850
|
+
x.key === "ArrowRight" && z(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && z(Math.max(0, p - 0.05));
|
|
851
851
|
},
|
|
852
852
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
853
|
"div",
|
|
854
854
|
{
|
|
855
855
|
className: "h-full rounded-full bg-white",
|
|
856
|
-
style: { width: `${
|
|
856
|
+
style: { width: `${G}%` }
|
|
857
857
|
}
|
|
858
858
|
) })
|
|
859
859
|
}
|
|
@@ -863,12 +863,12 @@ const sa = (e) => {
|
|
|
863
863
|
"button",
|
|
864
864
|
{
|
|
865
865
|
type: "button",
|
|
866
|
-
onClick: (
|
|
867
|
-
|
|
866
|
+
onClick: (x) => {
|
|
867
|
+
x.stopPropagation(), w((I) => !I);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
870
|
+
"aria-label": N ? "Pause" : "Play",
|
|
871
|
+
children: N ? /* @__PURE__ */ n(ks, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(He, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -876,30 +876,30 @@ const sa = (e) => {
|
|
|
876
876
|
{
|
|
877
877
|
role: "slider",
|
|
878
878
|
"aria-label": "Playback position",
|
|
879
|
-
"aria-valuenow":
|
|
879
|
+
"aria-valuenow": G,
|
|
880
880
|
"aria-valuemin": 0,
|
|
881
881
|
"aria-valuemax": 100,
|
|
882
882
|
tabIndex: 0,
|
|
883
883
|
ref: f,
|
|
884
884
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
|
-
onMouseDown:
|
|
886
|
-
onTouchStart:
|
|
887
|
-
onClick: (
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
890
|
-
onKeyDown: (
|
|
891
|
-
|
|
885
|
+
onMouseDown: V,
|
|
886
|
+
onTouchStart: V,
|
|
887
|
+
onClick: (x) => x.stopPropagation(),
|
|
888
|
+
onMouseEnter: () => O(!0),
|
|
889
|
+
onMouseLeave: () => O(!1),
|
|
890
|
+
onKeyDown: (x) => {
|
|
891
|
+
x.key === "ArrowRight" && z(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && z(Math.max(0, p - 0.05));
|
|
892
892
|
},
|
|
893
893
|
children: [
|
|
894
894
|
/* @__PURE__ */ n(
|
|
895
895
|
"div",
|
|
896
896
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
897
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${y || M ? "h-1.5" : "h-1"}`,
|
|
898
898
|
children: /* @__PURE__ */ n(
|
|
899
899
|
"div",
|
|
900
900
|
{
|
|
901
901
|
className: "h-full rounded-full bg-white",
|
|
902
|
-
style: { width: `${
|
|
902
|
+
style: { width: `${G}%` }
|
|
903
903
|
}
|
|
904
904
|
)
|
|
905
905
|
}
|
|
@@ -907,8 +907,8 @@ const sa = (e) => {
|
|
|
907
907
|
/* @__PURE__ */ n(
|
|
908
908
|
"div",
|
|
909
909
|
{
|
|
910
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
911
|
-
style: { left: `${
|
|
910
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${y || M ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
|
+
style: { left: `${G}%` }
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
]
|
|
@@ -1012,13 +1012,13 @@ const sa = (e) => {
|
|
|
1012
1012
|
rootRef: g,
|
|
1013
1013
|
"data-testid": u
|
|
1014
1014
|
}) => {
|
|
1015
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1015
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
|
|
1016
1016
|
return /* @__PURE__ */ h(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
ref: g,
|
|
1020
1020
|
"data-testid": u,
|
|
1021
|
-
className:
|
|
1021
|
+
className: _(
|
|
1022
1022
|
"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
1023
|
f ? "bg-[#121110]" : "bg-white"
|
|
1024
1024
|
),
|
|
@@ -1030,17 +1030,17 @@ const sa = (e) => {
|
|
|
1030
1030
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1031
1031
|
"p",
|
|
1032
1032
|
{
|
|
1033
|
-
className:
|
|
1033
|
+
className: _("mb-0.5 truncate text-base font-medium", {
|
|
1034
1034
|
"text-black": !f,
|
|
1035
|
-
"text-white/30": f &&
|
|
1036
|
-
"text-white": f && !
|
|
1035
|
+
"text-white/30": f && b,
|
|
1036
|
+
"text-white": f && !b
|
|
1037
1037
|
}),
|
|
1038
1038
|
children: c
|
|
1039
1039
|
}
|
|
1040
1040
|
),
|
|
1041
1041
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
1042
|
ce(r, {
|
|
1043
|
-
className:
|
|
1043
|
+
className: _(
|
|
1044
1044
|
"size-5 shrink-0",
|
|
1045
1045
|
f ? "text-white/55" : "text-black/55"
|
|
1046
1046
|
),
|
|
@@ -1049,7 +1049,7 @@ const sa = (e) => {
|
|
|
1049
1049
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1050
1050
|
"span",
|
|
1051
1051
|
{
|
|
1052
|
-
className:
|
|
1052
|
+
className: _(
|
|
1053
1053
|
"text-xs font-medium",
|
|
1054
1054
|
f ? "text-white/55" : "text-black/55"
|
|
1055
1055
|
),
|
|
@@ -1148,23 +1148,23 @@ const ma = ({
|
|
|
1148
1148
|
},
|
|
1149
1149
|
disabled: s,
|
|
1150
1150
|
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(
|
|
1152
|
-
/* @__PURE__ */ n(
|
|
1151
|
+
children: s ? /* @__PURE__ */ n(we, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
|
|
1152
|
+
/* @__PURE__ */ n(Ne, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
1158
|
function nt(e) {
|
|
1159
|
-
var u, f, c,
|
|
1159
|
+
var u, f, c, b;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
|
-
(
|
|
1161
|
+
(N) => N.type === "video" && N.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1163
|
+
(N) => N.type === "image" && N.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1166
|
-
), r = (
|
|
1167
|
-
(
|
|
1165
|
+
(N) => N.type === "audio" && N.asset_url
|
|
1166
|
+
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1167
|
+
(N) => N.type === "file" && N.asset_url
|
|
1168
1168
|
), 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
1169
|
if (!l) return null;
|
|
1170
1170
|
const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -1240,7 +1240,7 @@ const on = ({
|
|
|
1240
1240
|
const s = tt(e), a = nt(e);
|
|
1241
1241
|
return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
|
|
1242
1242
|
!t && e.user && /* @__PURE__ */ n(
|
|
1243
|
-
|
|
1243
|
+
ne,
|
|
1244
1244
|
{
|
|
1245
1245
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1246
1246
|
id: e.user.id,
|
|
@@ -1283,13 +1283,13 @@ const on = ({
|
|
|
1283
1283
|
}, yi = Object.assign(ha, {
|
|
1284
1284
|
Creator: fa,
|
|
1285
1285
|
Visitor: ga
|
|
1286
|
-
}),
|
|
1286
|
+
}), ba = {
|
|
1287
1287
|
isUnlocking: () => !1
|
|
1288
|
-
},
|
|
1289
|
-
LockedAttachment:
|
|
1288
|
+
}, pa = {
|
|
1289
|
+
LockedAttachment: ba
|
|
1290
1290
|
}, cn = We({}), Ci = cn.Provider;
|
|
1291
1291
|
function va(e) {
|
|
1292
|
-
return _e(cn)[e] ??
|
|
1292
|
+
return _e(cn)[e] ?? pa[e];
|
|
1293
1293
|
}
|
|
1294
1294
|
const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1295
|
"svg",
|
|
@@ -1311,35 +1311,35 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1311
1311
|
), wa = (e) => {
|
|
1312
1312
|
var t;
|
|
1313
1313
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1314
|
-
},
|
|
1314
|
+
}, Na = (e) => {
|
|
1315
1315
|
var t;
|
|
1316
1316
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1317
|
-
},
|
|
1317
|
+
}, Me = (e) => {
|
|
1318
1318
|
var t;
|
|
1319
1319
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1320
|
-
},
|
|
1320
|
+
}, _a = (e) => {
|
|
1321
1321
|
var t;
|
|
1322
1322
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1323
|
-
}, dn = (e) => wa(e) ||
|
|
1323
|
+
}, dn = (e) => wa(e) || Na(e), ya = (e) => {
|
|
1324
1324
|
var t;
|
|
1325
1325
|
return dn(e) && !((t = e.text) != null && t.trim());
|
|
1326
|
-
},
|
|
1326
|
+
}, Be = ({
|
|
1327
1327
|
message: e,
|
|
1328
1328
|
standalone: t = !1,
|
|
1329
1329
|
isMyMessage: s = !1,
|
|
1330
1330
|
hasAttachment: a = !1
|
|
1331
1331
|
}) => {
|
|
1332
1332
|
var u;
|
|
1333
|
-
const r = dn(e), i =
|
|
1333
|
+
const r = dn(e), i = Me(e);
|
|
1334
1334
|
if (!r && !i)
|
|
1335
1335
|
return null;
|
|
1336
1336
|
if (r) {
|
|
1337
1337
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1338
1338
|
if (!f) return null;
|
|
1339
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1339
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1340
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
|
-
/* @__PURE__ */ n(
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1341
|
+
/* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
|
|
1342
|
+
/* @__PURE__ */ n("span", { children: b })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
1345
1345
|
const l = s && a, o = l ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
@@ -1347,10 +1347,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1347
1347
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
1348
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
1349
|
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(xa, { size: l ? 12 : 15 }) });
|
|
1350
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(
|
|
1350
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(se, { children: [
|
|
1351
1351
|
m,
|
|
1352
1352
|
g
|
|
1353
|
-
] }) : /* @__PURE__ */ h(
|
|
1353
|
+
] }) : /* @__PURE__ */ h(se, { children: [
|
|
1354
1354
|
g,
|
|
1355
1355
|
m
|
|
1356
1356
|
] }) });
|
|
@@ -1363,21 +1363,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1363
1363
|
"button",
|
|
1364
1364
|
{
|
|
1365
1365
|
type: "button",
|
|
1366
|
-
className:
|
|
1366
|
+
className: _("message-vote-button focus-ring", {
|
|
1367
1367
|
"message-vote-button--selected": e === "up"
|
|
1368
1368
|
}),
|
|
1369
1369
|
onClick: t,
|
|
1370
1370
|
"aria-label": "Good response",
|
|
1371
1371
|
"aria-pressed": e === "up",
|
|
1372
1372
|
"data-tooltip": "Good response",
|
|
1373
|
-
children: /* @__PURE__ */ n(
|
|
1373
|
+
children: /* @__PURE__ */ n(Ss, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1374
1374
|
}
|
|
1375
1375
|
),
|
|
1376
1376
|
/* @__PURE__ */ n(
|
|
1377
1377
|
"button",
|
|
1378
1378
|
{
|
|
1379
1379
|
type: "button",
|
|
1380
|
-
className:
|
|
1380
|
+
className: _("message-vote-button focus-ring", {
|
|
1381
1381
|
"message-vote-button--selected": e === "down"
|
|
1382
1382
|
}),
|
|
1383
1383
|
onClick: s,
|
|
@@ -1388,7 +1388,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
1390
1390
|
] }), ka = (e) => {
|
|
1391
|
-
var
|
|
1391
|
+
var pt, vt, xt, wt, Nt, _t, yt, Ct, kt, Et, It, St, Tt, At;
|
|
1392
1392
|
const {
|
|
1393
1393
|
additionalMessageInputProps: t,
|
|
1394
1394
|
chatbotVotingEnabled: s,
|
|
@@ -1403,73 +1403,73 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1403
1403
|
isMessageAIGenerated: u,
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
|
-
renderText:
|
|
1407
|
-
threadList:
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client:
|
|
1406
|
+
renderText: b,
|
|
1407
|
+
threadList: N,
|
|
1408
|
+
viewerLanguage: w
|
|
1409
|
+
} = e, { client: p } = Ke("CustomMessage"), { channel: v } = de("CustomMessage"), { isUnlocking: M, onUnlockClick: T, onFetchSource: y, onDownloadClick: O } = va("LockedAttachment"), [P, L] = F(!1), E = Ln(c.id), { selected: R, voteUp: A, voteDown: D } = Hs(c), {
|
|
1410
1410
|
Attachment: C = Dn,
|
|
1411
|
-
EditMessageModal: k =
|
|
1411
|
+
EditMessageModal: k = Pn,
|
|
1412
1412
|
MessageActions: S,
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt:
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1413
|
+
MessageBlocked: $ = zn,
|
|
1414
|
+
MessageBouncePrompt: z = On,
|
|
1415
|
+
MessageDeleted: V = $n,
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: ee = Fn,
|
|
1417
1417
|
MessageRepliesCountButton: Z = Bn,
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText:
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} = Gt("CustomMessage"), U = Vn(c),
|
|
1418
|
+
ReminderNotification: G = Un,
|
|
1419
|
+
StreamedMessageText: x = jn,
|
|
1420
|
+
PinIndicator: I
|
|
1421
|
+
} = Gt("CustomMessage"), U = Vn(c), H = Gn(c), q = re(
|
|
1422
1422
|
() => u == null ? void 0 : u(c),
|
|
1423
1423
|
[u, c]
|
|
1424
1424
|
), B = re(() => {
|
|
1425
1425
|
const ge = c.attachments ?? [], Se = c.shared_location ? [c.shared_location, ...ge] : ge;
|
|
1426
|
-
if (!
|
|
1426
|
+
if (!Me(c)) return Se;
|
|
1427
1427
|
const Mt = Se.filter((Rt) => !("type" in Rt) || !rn(Rt));
|
|
1428
1428
|
return Mt.length === Se.length ? Se : Mt;
|
|
1429
1429
|
}, [c]), W = re(() => {
|
|
1430
|
-
const ge = Zt({ message: c, viewerLanguage:
|
|
1430
|
+
const ge = Zt({ message: c, viewerLanguage: w });
|
|
1431
1431
|
return ge === c.text ? c : { ...c, text: ge };
|
|
1432
|
-
}, [c,
|
|
1432
|
+
}, [c, w]);
|
|
1433
1433
|
if (Hn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1436
|
+
return /* @__PURE__ */ n(V, { message: c });
|
|
1437
1437
|
if (Yn(c))
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1439
|
-
const X = !
|
|
1440
|
-
let
|
|
1441
|
-
me ?
|
|
1442
|
-
const
|
|
1438
|
+
return /* @__PURE__ */ n($, {});
|
|
1439
|
+
const X = !N && !!c.reply_count, ue = !N && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((pt = c.error) == null ? void 0 : pt.status) !== 403, he = qn(c);
|
|
1440
|
+
let Q;
|
|
1441
|
+
me ? Q = () => m(c) : he && (Q = () => L(!0));
|
|
1442
|
+
const te = f(), oe = _(
|
|
1443
1443
|
"str-chat__message str-chat__message-simple",
|
|
1444
1444
|
`str-chat__message--${c.type}`,
|
|
1445
1445
|
`str-chat__message--${c.status}`,
|
|
1446
|
-
|
|
1446
|
+
te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1447
1447
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1448
1448
|
{
|
|
1449
1449
|
"str-chat__message--has-attachment": U,
|
|
1450
1450
|
"str-chat__message--highlighted": g,
|
|
1451
1451
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
|
-
"str-chat__message--with-reactions":
|
|
1452
|
+
"str-chat__message--with-reactions": H,
|
|
1453
1453
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((vt = c == null ? void 0 : c.error) == null ? void 0 : vt.status) !== 403,
|
|
1454
1454
|
"str-chat__message-with-thread-link": X || ue,
|
|
1455
1455
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1456
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1457
|
"str-chat__virtual-message__wrapper--group": l
|
|
1458
1458
|
}
|
|
1459
|
-
), ht = c.poll_id &&
|
|
1460
|
-
return /* @__PURE__ */ h(
|
|
1459
|
+
), ht = c.poll_id && p.polls.fromState(c.poll_id), ft = ya(c), fe = Me(c), gt = _a(c), Oe = !!(B != null && B.length && !c.quoted_message), bt = fe && te && Oe;
|
|
1460
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
1462
|
k,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1467
|
+
P && /* @__PURE__ */ n(
|
|
1468
1468
|
Wn,
|
|
1469
1469
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1471
|
-
onClose: () =>
|
|
1472
|
-
open:
|
|
1470
|
+
MessageBouncePrompt: z,
|
|
1471
|
+
onClose: () => L(!1),
|
|
1472
|
+
open: P
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
@@ -1478,10 +1478,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1478
1478
|
className: oe,
|
|
1479
1479
|
"data-message-id": c.id,
|
|
1480
1480
|
children: [
|
|
1481
|
-
|
|
1482
|
-
!!E && /* @__PURE__ */ n(
|
|
1481
|
+
I && /* @__PURE__ */ n(I, {}),
|
|
1482
|
+
!!E && /* @__PURE__ */ n(G, { reminder: E }),
|
|
1483
1483
|
c.user && /* @__PURE__ */ n(
|
|
1484
|
-
|
|
1484
|
+
ne,
|
|
1485
1485
|
{
|
|
1486
1486
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1487
1487
|
id: c.user.id,
|
|
@@ -1495,14 +1495,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1495
1495
|
/* @__PURE__ */ n(
|
|
1496
1496
|
"div",
|
|
1497
1497
|
{
|
|
1498
|
-
className:
|
|
1498
|
+
className: _("str-chat__message-inner", {
|
|
1499
1499
|
"str-chat__simple-message--error-failed": me || he
|
|
1500
1500
|
}),
|
|
1501
1501
|
"data-testid": "message-inner",
|
|
1502
|
-
onClick:
|
|
1503
|
-
onKeyDown:
|
|
1504
|
-
role:
|
|
1505
|
-
tabIndex:
|
|
1502
|
+
onClick: Q,
|
|
1503
|
+
onKeyDown: Q,
|
|
1504
|
+
role: Q ? "button" : void 0,
|
|
1505
|
+
tabIndex: Q ? 0 : void 0,
|
|
1506
1506
|
style: {
|
|
1507
1507
|
// Force margins to 0 to prevent hover layout shift
|
|
1508
1508
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
@@ -1510,19 +1510,19 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1510
1510
|
marginInlineStart: 0
|
|
1511
1511
|
},
|
|
1512
1512
|
children: gt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1513
|
-
|
|
1513
|
+
te ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1514
1514
|
S && /* @__PURE__ */ n(S, {}),
|
|
1515
1515
|
/* @__PURE__ */ n(
|
|
1516
1516
|
Bt.Sent,
|
|
1517
1517
|
{
|
|
1518
1518
|
title: (xt = c.metadata) == null ? void 0 : xt.attachment_title,
|
|
1519
1519
|
mimeType: (wt = c.metadata) == null ? void 0 : wt.attachment_mime_type,
|
|
1520
|
-
thumbnailUrl: (
|
|
1521
|
-
amountText: (
|
|
1520
|
+
thumbnailUrl: (Nt = c.metadata) == null ? void 0 : Nt.attachment_thumbnail,
|
|
1521
|
+
amountText: (_t = c.metadata) == null ? void 0 : _t.amount_text,
|
|
1522
1522
|
detail: (yt = c.metadata) == null ? void 0 : yt.attachment_detail,
|
|
1523
1523
|
paymentStatus: (Ct = c.metadata) == null ? void 0 : Ct.payment_status,
|
|
1524
|
-
onPreviewClick: () =>
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1524
|
+
onPreviewClick: () => T == null ? void 0 : T(c, v),
|
|
1525
|
+
onFetchSource: async () => await (y == null ? void 0 : y(c, v))
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
1528
1528
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1531,14 +1531,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1531
1531
|
{
|
|
1532
1532
|
title: (kt = c.metadata) == null ? void 0 : kt.attachment_title,
|
|
1533
1533
|
mimeType: (Et = c.metadata) == null ? void 0 : Et.attachment_mime_type,
|
|
1534
|
-
thumbnailUrl: (
|
|
1535
|
-
amountText: (
|
|
1534
|
+
thumbnailUrl: (It = c.metadata) == null ? void 0 : It.attachment_thumbnail,
|
|
1535
|
+
amountText: (St = c.metadata) == null ? void 0 : St.amount_text,
|
|
1536
1536
|
detail: (Tt = c.metadata) == null ? void 0 : Tt.attachment_detail,
|
|
1537
1537
|
paymentStatus: (At = c.metadata) == null ? void 0 : At.payment_status,
|
|
1538
1538
|
isUnlocking: M(c.id),
|
|
1539
|
-
onUnlockClick: () =>
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1541
|
-
onDownloadClick: () =>
|
|
1539
|
+
onUnlockClick: () => T == null ? void 0 : T(c, v),
|
|
1540
|
+
onFetchSource: async () => await (y == null ? void 0 : y(c, v)),
|
|
1541
|
+
onDownloadClick: () => O == null ? void 0 : O(c, v)
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
1544
|
S && /* @__PURE__ */ n(S, {})
|
|
@@ -1547,19 +1547,19 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1547
1547
|
Dt,
|
|
1548
1548
|
{
|
|
1549
1549
|
message: W,
|
|
1550
|
-
renderText:
|
|
1550
|
+
renderText: b
|
|
1551
1551
|
}
|
|
1552
1552
|
) })
|
|
1553
1553
|
] }) : ft ? (
|
|
1554
1554
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
|
-
/* @__PURE__ */ n(
|
|
1555
|
+
/* @__PURE__ */ n(Be, { message: c, standalone: !0 })
|
|
1556
1556
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1557
|
-
fe && !
|
|
1558
|
-
|
|
1557
|
+
fe && !bt && /* @__PURE__ */ n(
|
|
1558
|
+
Be,
|
|
1559
1559
|
{
|
|
1560
1560
|
message: c,
|
|
1561
|
-
hasAttachment:
|
|
1562
|
-
isMyMessage:
|
|
1561
|
+
hasAttachment: Oe,
|
|
1562
|
+
isMyMessage: te
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
1565
|
ht && /* @__PURE__ */ n(Xn, { poll: ht }),
|
|
@@ -1571,16 +1571,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1571
1571
|
}
|
|
1572
1572
|
) : null,
|
|
1573
1573
|
q ? /* @__PURE__ */ n(
|
|
1574
|
-
|
|
1574
|
+
x,
|
|
1575
1575
|
{
|
|
1576
1576
|
message: W,
|
|
1577
|
-
renderText:
|
|
1577
|
+
renderText: b
|
|
1578
1578
|
}
|
|
1579
1579
|
) : /* @__PURE__ */ n(
|
|
1580
1580
|
Dt,
|
|
1581
1581
|
{
|
|
1582
1582
|
message: W,
|
|
1583
|
-
renderText:
|
|
1583
|
+
renderText: b
|
|
1584
1584
|
}
|
|
1585
1585
|
),
|
|
1586
1586
|
/* @__PURE__ */ n(Kn, {})
|
|
@@ -1588,20 +1588,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1588
1588
|
}
|
|
1589
1589
|
),
|
|
1590
1590
|
!gt && !ft && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1591
|
-
(!fe ||
|
|
1592
|
-
|
|
1591
|
+
(!fe || bt) && /* @__PURE__ */ n(
|
|
1592
|
+
Be,
|
|
1593
1593
|
{
|
|
1594
1594
|
message: c,
|
|
1595
|
-
hasAttachment:
|
|
1596
|
-
isMyMessage:
|
|
1595
|
+
hasAttachment: Oe,
|
|
1596
|
+
isMyMessage: te
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
1599
|
s && fe && /* @__PURE__ */ n(
|
|
1600
1600
|
Ca,
|
|
1601
1601
|
{
|
|
1602
1602
|
selected: R,
|
|
1603
|
-
onVoteUp:
|
|
1604
|
-
onVoteDown:
|
|
1603
|
+
onVoteUp: A,
|
|
1604
|
+
onVoteDown: D
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] }),
|
|
@@ -1612,7 +1612,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1612
1612
|
reply_count: c.reply_count
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
ue && /* @__PURE__ */ n(
|
|
1615
|
+
ue && /* @__PURE__ */ n(ee, {})
|
|
1616
1616
|
]
|
|
1617
1617
|
},
|
|
1618
1618
|
c.id
|
|
@@ -1621,12 +1621,12 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1621
1621
|
}, Ea = j.memo(
|
|
1622
1622
|
ka,
|
|
1623
1623
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Rn(e, t)
|
|
1624
|
-
),
|
|
1625
|
-
const t =
|
|
1624
|
+
), Ia = (e) => {
|
|
1625
|
+
const t = ye("CustomMessage");
|
|
1626
1626
|
return /* @__PURE__ */ n(Ea, { ...t, ...e });
|
|
1627
|
-
},
|
|
1627
|
+
}, Sa = () => {
|
|
1628
1628
|
var s;
|
|
1629
|
-
const { handleDelete: e, message: t } =
|
|
1629
|
+
const { handleDelete: e, message: t } = ye("CustomMessageActions");
|
|
1630
1630
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1631
1631
|
Wt,
|
|
1632
1632
|
{
|
|
@@ -1638,7 +1638,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1638
1638
|
}
|
|
1639
1639
|
);
|
|
1640
1640
|
}, Ta = () => {
|
|
1641
|
-
const { handleFlag: e } =
|
|
1641
|
+
const { handleFlag: e } = ye("CustomMessageActions");
|
|
1642
1642
|
return /* @__PURE__ */ n(
|
|
1643
1643
|
Wt,
|
|
1644
1644
|
{
|
|
@@ -1651,12 +1651,12 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1651
1651
|
);
|
|
1652
1652
|
}, Aa = () => {
|
|
1653
1653
|
var t;
|
|
1654
|
-
const { message: e } =
|
|
1654
|
+
const { message: e } = ye("CustomMessageActions");
|
|
1655
1655
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1656
|
-
|
|
1656
|
+
Ps,
|
|
1657
1657
|
{
|
|
1658
1658
|
messageActionSet: [
|
|
1659
|
-
{ Component:
|
|
1659
|
+
{ Component: Sa, placement: "quick", type: "delete" },
|
|
1660
1660
|
{ Component: Ta, placement: "quick", type: "flag" }
|
|
1661
1661
|
]
|
|
1662
1662
|
}
|
|
@@ -1691,7 +1691,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1691
1691
|
},
|
|
1692
1692
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1693
1693
|
"aria-label": "Close link preview",
|
|
1694
|
-
children: /* @__PURE__ */ n(
|
|
1694
|
+
children: /* @__PURE__ */ n(Pe, { className: "size-4 text-black/90" })
|
|
1695
1695
|
}
|
|
1696
1696
|
),
|
|
1697
1697
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1730,7 +1730,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1730
1730
|
onClick: e,
|
|
1731
1731
|
children: /* @__PURE__ */ n(Ms, { weight: "bold", className: "size-4" })
|
|
1732
1732
|
}
|
|
1733
|
-
),
|
|
1733
|
+
), Pa = () => {
|
|
1734
1734
|
const e = _e(st), { handleSubmit: t } = es(), s = ts(), a = e || !s, {
|
|
1735
1735
|
SendButton: r = Da,
|
|
1736
1736
|
AttachmentPreviewList: i = ns
|
|
@@ -1764,7 +1764,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1764
1764
|
)
|
|
1765
1765
|
] })
|
|
1766
1766
|
] });
|
|
1767
|
-
},
|
|
1767
|
+
}, za = ({
|
|
1768
1768
|
renderActions: e,
|
|
1769
1769
|
renderFooter: t,
|
|
1770
1770
|
disabled: s = !1,
|
|
@@ -1773,7 +1773,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1773
1773
|
}) => {
|
|
1774
1774
|
var o;
|
|
1775
1775
|
const { channel: i } = de(), l = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
|
|
1776
|
-
return s ? /* @__PURE__ */ h(
|
|
1776
|
+
return s ? /* @__PURE__ */ h(se, { children: [
|
|
1777
1777
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
1778
1778
|
t == null ? void 0 : t()
|
|
1779
1779
|
] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
@@ -1785,13 +1785,13 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1785
1785
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1786
1786
|
children: [
|
|
1787
1787
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1788
|
-
/* @__PURE__ */ n(st.Provider, { value: l, children: /* @__PURE__ */ n(Qn, { Input: r ??
|
|
1788
|
+
/* @__PURE__ */ n(st.Provider, { value: l, children: /* @__PURE__ */ n(Qn, { Input: r ?? Pa }) })
|
|
1789
1789
|
]
|
|
1790
1790
|
}
|
|
1791
1791
|
),
|
|
1792
1792
|
t == null ? void 0 : t()
|
|
1793
1793
|
] });
|
|
1794
|
-
},
|
|
1794
|
+
}, Oa = [
|
|
1795
1795
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1796
1796
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1797
1797
|
], $a = {
|
|
@@ -1801,7 +1801,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1801
1801
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1802
1802
|
], Ba = {
|
|
1803
1803
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1804
|
-
},
|
|
1804
|
+
}, Ue = "age safety guidelines.", Ua = "https://linktr.ee/s/about/contact", jt = (e) => Oa.includes(e), ja = (e) => Fa.includes(e), Va = (e) => {
|
|
1805
1805
|
var a;
|
|
1806
1806
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1807
1807
|
if (jt(t))
|
|
@@ -1821,11 +1821,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1821
1821
|
type: s
|
|
1822
1822
|
};
|
|
1823
1823
|
}, Ga = (e) => {
|
|
1824
|
-
const t = e.indexOf(
|
|
1824
|
+
const t = e.indexOf(Ue);
|
|
1825
1825
|
if (t === -1)
|
|
1826
1826
|
return e;
|
|
1827
|
-
const s = t +
|
|
1828
|
-
return /* @__PURE__ */ h(
|
|
1827
|
+
const s = t + Ue.length;
|
|
1828
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
1829
1829
|
e.slice(0, t),
|
|
1830
1830
|
/* @__PURE__ */ n(
|
|
1831
1831
|
"a",
|
|
@@ -1834,7 +1834,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1834
1834
|
target: "_blank",
|
|
1835
1835
|
rel: "noopener noreferrer",
|
|
1836
1836
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1837
|
-
children:
|
|
1837
|
+
children: Ue
|
|
1838
1838
|
}
|
|
1839
1839
|
),
|
|
1840
1840
|
e.slice(s)
|
|
@@ -1855,7 +1855,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1855
1855
|
"data-dm-agent-system-type": s.type,
|
|
1856
1856
|
children: [
|
|
1857
1857
|
/* @__PURE__ */ n(
|
|
1858
|
-
|
|
1858
|
+
pe,
|
|
1859
1859
|
{
|
|
1860
1860
|
size: 16,
|
|
1861
1861
|
weight: "regular",
|
|
@@ -1867,7 +1867,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1867
1867
|
]
|
|
1868
1868
|
}
|
|
1869
1869
|
),
|
|
1870
|
-
!t && /* @__PURE__ */ n(
|
|
1870
|
+
!t && /* @__PURE__ */ n($e, { message: e.message })
|
|
1871
1871
|
] });
|
|
1872
1872
|
}
|
|
1873
1873
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
@@ -1894,7 +1894,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1894
1894
|
]
|
|
1895
1895
|
}
|
|
1896
1896
|
),
|
|
1897
|
-
!t && /* @__PURE__ */ n(
|
|
1897
|
+
!t && /* @__PURE__ */ n($e, { message: e.message })
|
|
1898
1898
|
] });
|
|
1899
1899
|
}
|
|
1900
1900
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1903,9 +1903,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1903
1903
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
1904
1904
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
1905
1905
|
] }),
|
|
1906
|
-
!t && /* @__PURE__ */ n(
|
|
1906
|
+
!t && /* @__PURE__ */ n($e, { message: e.message })
|
|
1907
1907
|
] });
|
|
1908
|
-
}, un = We(!1),
|
|
1908
|
+
}, un = We(!1), je = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1909
1909
|
"animateTransform",
|
|
1910
1910
|
{
|
|
1911
1911
|
attributeName: "transform",
|
|
@@ -1916,20 +1916,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1916
1916
|
repeatCount: "indefinite"
|
|
1917
1917
|
}
|
|
1918
1918
|
) }), Ya = /* @__PURE__ */ new Set([
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1919
|
+
Fe.Thinking,
|
|
1920
|
+
Fe.Generating,
|
|
1921
|
+
Fe.ExternalSources
|
|
1922
1922
|
]), qa = ({ threadList: e }) => {
|
|
1923
|
-
var
|
|
1923
|
+
var b, N;
|
|
1924
1924
|
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = rs(), { aiState: l } = is(t), o = _e(un);
|
|
1925
1925
|
if (!e && o && Ya.has(l)) {
|
|
1926
|
-
const
|
|
1926
|
+
const w = Wa(t, (b = r.user) == null ? void 0 : b.id);
|
|
1927
1927
|
return /* @__PURE__ */ n(
|
|
1928
1928
|
Vt,
|
|
1929
1929
|
{
|
|
1930
|
-
avatarId: (
|
|
1931
|
-
avatarName: (
|
|
1932
|
-
avatarImage:
|
|
1930
|
+
avatarId: (w == null ? void 0 : w.id) ?? "ai-agent",
|
|
1931
|
+
avatarName: (w == null ? void 0 : w.name) ?? (w == null ? void 0 : w.id) ?? "Agent",
|
|
1932
|
+
avatarImage: w == null ? void 0 : w.image,
|
|
1933
1933
|
testId: "typing-indicator-ai"
|
|
1934
1934
|
}
|
|
1935
1935
|
);
|
|
@@ -1937,19 +1937,19 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1937
1937
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1938
1938
|
return null;
|
|
1939
1939
|
const m = e ? [] : Object.values(i).filter(
|
|
1940
|
-
({ parent_id:
|
|
1940
|
+
({ parent_id: w, user: p }) => {
|
|
1941
1941
|
var v;
|
|
1942
|
-
return (
|
|
1942
|
+
return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && !w;
|
|
1943
1943
|
}
|
|
1944
1944
|
), g = e ? Object.values(i).filter(
|
|
1945
|
-
({ parent_id:
|
|
1945
|
+
({ parent_id: w, user: p }) => {
|
|
1946
1946
|
var v;
|
|
1947
|
-
return (
|
|
1947
|
+
return (p == null ? void 0 : p.id) !== ((v = r.user) == null ? void 0 : v.id) && w === (a == null ? void 0 : a.id);
|
|
1948
1948
|
}
|
|
1949
1949
|
) : [], u = e ? g : m;
|
|
1950
1950
|
if (!u.length)
|
|
1951
1951
|
return null;
|
|
1952
|
-
const f = (
|
|
1952
|
+
const f = (N = u[0]) == null ? void 0 : N.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1953
1953
|
return /* @__PURE__ */ n(
|
|
1954
1954
|
Vt,
|
|
1955
1955
|
{
|
|
@@ -1974,7 +1974,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1974
1974
|
},
|
|
1975
1975
|
children: /* @__PURE__ */ h("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
1976
1976
|
/* @__PURE__ */ n(
|
|
1977
|
-
|
|
1977
|
+
ne,
|
|
1978
1978
|
{
|
|
1979
1979
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1980
1980
|
id: e,
|
|
@@ -1994,9 +1994,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1994
1994
|
height: "13",
|
|
1995
1995
|
overflow: "visible",
|
|
1996
1996
|
children: [
|
|
1997
|
-
/* @__PURE__ */ n(
|
|
1998
|
-
/* @__PURE__ */ n(
|
|
1999
|
-
/* @__PURE__ */ n(
|
|
1997
|
+
/* @__PURE__ */ n(je, { cx: "4", index: 0 }),
|
|
1998
|
+
/* @__PURE__ */ n(je, { cx: "16", index: 1 }),
|
|
1999
|
+
/* @__PURE__ */ n(je, { cx: "28", index: 2 })
|
|
2000
2000
|
]
|
|
2001
2001
|
}
|
|
2002
2002
|
) }) }) }) }) })
|
|
@@ -2015,7 +2015,7 @@ function Wa(e, t) {
|
|
|
2015
2015
|
const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2016
2016
|
"div",
|
|
2017
2017
|
{
|
|
2018
|
-
className:
|
|
2018
|
+
className: _("flex items-center justify-center h-full", e),
|
|
2019
2019
|
children: [
|
|
2020
2020
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2021
2021
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2055,12 +2055,12 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2055
2055
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2056
2056
|
]
|
|
2057
2057
|
}
|
|
2058
|
-
),
|
|
2058
|
+
), 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: [
|
|
2059
2059
|
/* @__PURE__ */ n(Ka, { className: "w-6 h-6" }),
|
|
2060
2060
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2061
2061
|
] }) }));
|
|
2062
|
-
|
|
2063
|
-
const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
2062
|
+
Re.displayName = "LoadingState";
|
|
2063
|
+
const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ae = "Replies instantly with AI assistant", Ja = ({
|
|
2064
2064
|
onBack: e,
|
|
2065
2065
|
showBackButton: t,
|
|
2066
2066
|
showStarButton: s = !1,
|
|
@@ -2075,33 +2075,33 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2075
2075
|
onReportParticipantClick: u,
|
|
2076
2076
|
customChannelActions: f,
|
|
2077
2077
|
renderChannelActions: c,
|
|
2078
|
-
showChannelInfo:
|
|
2079
|
-
onParticipantNameClick:
|
|
2080
|
-
renderHeaderTitleBadges:
|
|
2078
|
+
showChannelInfo: b = !0,
|
|
2079
|
+
onParticipantNameClick: N,
|
|
2080
|
+
renderHeaderTitleBadges: w
|
|
2081
2081
|
}) => {
|
|
2082
|
-
var
|
|
2083
|
-
const { channel:
|
|
2084
|
-
var
|
|
2085
|
-
const
|
|
2086
|
-
return
|
|
2087
|
-
(
|
|
2088
|
-
var
|
|
2089
|
-
return ((
|
|
2082
|
+
var A, D, C, k, S, $, z;
|
|
2083
|
+
const { channel: p } = de(), v = j.useMemo(() => {
|
|
2084
|
+
var Z, G;
|
|
2085
|
+
const V = (Z = p._client) == null ? void 0 : Z.userID;
|
|
2086
|
+
return V ? Object.values(((G = p.state) == null ? void 0 : G.members) || {}).find(
|
|
2087
|
+
(x) => {
|
|
2088
|
+
var I;
|
|
2089
|
+
return ((I = x.user) == null ? void 0 : I.id) && x.user.id !== V;
|
|
2090
2090
|
}
|
|
2091
2091
|
) : void 0;
|
|
2092
|
-
}, [(
|
|
2093
|
-
channel:
|
|
2092
|
+
}, [(A = p._client) == null ? void 0 : A.userID, (D = p.state) == null ? void 0 : D.members]), M = Jt(v == null ? void 0 : v.user), T = (C = v == null ? void 0 : v.user) == null ? void 0 : C.image, y = Kt(p), O = w == null ? void 0 : w({
|
|
2093
|
+
channel: p,
|
|
2094
2094
|
participant: v
|
|
2095
|
-
}), L = /* @__PURE__ */ h(
|
|
2095
|
+
}), P = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", L = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", E = /* @__PURE__ */ h(se, { children: [
|
|
2096
2096
|
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: M }),
|
|
2097
|
-
|
|
2098
|
-
] }),
|
|
2097
|
+
O && /* @__PURE__ */ n("span", { className: "shrink-0", children: O })
|
|
2098
|
+
] }), R = async () => {
|
|
2099
2099
|
try {
|
|
2100
|
-
|
|
2101
|
-
} catch (
|
|
2100
|
+
y ? await p.unpin() : await p.pin();
|
|
2101
|
+
} catch (V) {
|
|
2102
2102
|
console.error(
|
|
2103
2103
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2104
|
-
|
|
2104
|
+
V
|
|
2105
2105
|
);
|
|
2106
2106
|
}
|
|
2107
2107
|
};
|
|
@@ -2110,7 +2110,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2110
2110
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2111
2111
|
"button",
|
|
2112
2112
|
{
|
|
2113
|
-
className:
|
|
2113
|
+
className: _(
|
|
2114
2114
|
le,
|
|
2115
2115
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2116
2116
|
),
|
|
@@ -2118,54 +2118,66 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2118
2118
|
}),
|
|
2119
2119
|
type: "button",
|
|
2120
2120
|
"aria-label": "Back to conversations",
|
|
2121
|
-
children: /* @__PURE__ */ n(
|
|
2121
|
+
children: /* @__PURE__ */ n(zt, { className: "size-5 text-black/90" })
|
|
2122
2122
|
}
|
|
2123
2123
|
) }),
|
|
2124
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1 items-center", children:
|
|
2124
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-1 items-center", children: N ? /* @__PURE__ */ h(
|
|
2125
2125
|
"button",
|
|
2126
2126
|
{
|
|
2127
2127
|
type: "button",
|
|
2128
|
-
onClick:
|
|
2128
|
+
onClick: N,
|
|
2129
2129
|
"aria-label": `View details for ${M}`,
|
|
2130
|
-
className:
|
|
2130
|
+
className: _(
|
|
2131
|
+
P,
|
|
2132
|
+
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2133
|
+
),
|
|
2131
2134
|
children: [
|
|
2132
2135
|
/* @__PURE__ */ n(
|
|
2133
|
-
|
|
2136
|
+
ne,
|
|
2134
2137
|
{
|
|
2135
|
-
id: ((
|
|
2138
|
+
id: ((k = v == null ? void 0 : v.user) == null ? void 0 : k.id) || p.id || "unknown",
|
|
2136
2139
|
name: M,
|
|
2137
|
-
image:
|
|
2138
|
-
starred: s &&
|
|
2140
|
+
image: T,
|
|
2141
|
+
starred: s && y,
|
|
2139
2142
|
dmAgentEnabled: a,
|
|
2140
2143
|
size: 48
|
|
2141
2144
|
}
|
|
2142
2145
|
),
|
|
2143
2146
|
/* @__PURE__ */ h("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
2144
|
-
|
|
2145
|
-
/* @__PURE__ */ n(
|
|
2147
|
+
E,
|
|
2148
|
+
/* @__PURE__ */ n(ve, { className: "size-3 shrink-0", weight: "bold" })
|
|
2146
2149
|
] }),
|
|
2147
2150
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2148
|
-
/* @__PURE__ */ n(
|
|
2149
|
-
/* @__PURE__ */ n("span", { children:
|
|
2151
|
+
/* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
|
|
2152
|
+
/* @__PURE__ */ n("span", { children: Ae })
|
|
2150
2153
|
] })
|
|
2151
2154
|
]
|
|
2152
2155
|
}
|
|
2153
|
-
) : /* @__PURE__ */ h(
|
|
2156
|
+
) : /* @__PURE__ */ h("div", { className: P, children: [
|
|
2154
2157
|
/* @__PURE__ */ n(
|
|
2155
|
-
|
|
2158
|
+
ne,
|
|
2156
2159
|
{
|
|
2157
|
-
id: ((
|
|
2160
|
+
id: ((S = v == null ? void 0 : v.user) == null ? void 0 : S.id) || p.id || "unknown",
|
|
2158
2161
|
name: M,
|
|
2159
|
-
image:
|
|
2160
|
-
starred: s &&
|
|
2162
|
+
image: T,
|
|
2163
|
+
starred: s && y,
|
|
2161
2164
|
dmAgentEnabled: a,
|
|
2162
2165
|
size: 48
|
|
2163
2166
|
}
|
|
2164
2167
|
),
|
|
2165
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
2169
|
+
E,
|
|
2170
|
+
/* @__PURE__ */ n(
|
|
2171
|
+
ve,
|
|
2172
|
+
{
|
|
2173
|
+
className: "invisible size-3 shrink-0",
|
|
2174
|
+
weight: "bold"
|
|
2175
|
+
}
|
|
2176
|
+
)
|
|
2177
|
+
] }),
|
|
2166
2178
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2167
|
-
/* @__PURE__ */ n(
|
|
2168
|
-
/* @__PURE__ */ n("span", { children:
|
|
2179
|
+
/* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
|
|
2180
|
+
/* @__PURE__ */ n("span", { children: Ae })
|
|
2169
2181
|
] })
|
|
2170
2182
|
] }) }),
|
|
2171
2183
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
@@ -2173,25 +2185,25 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2173
2185
|
"button",
|
|
2174
2186
|
{
|
|
2175
2187
|
className: le,
|
|
2176
|
-
onClick:
|
|
2188
|
+
onClick: R,
|
|
2177
2189
|
type: "button",
|
|
2178
|
-
"aria-label":
|
|
2190
|
+
"aria-label": y ? "Unstar conversation" : "Star conversation",
|
|
2179
2191
|
children: /* @__PURE__ */ n(
|
|
2180
|
-
|
|
2192
|
+
Ge,
|
|
2181
2193
|
{
|
|
2182
|
-
className:
|
|
2183
|
-
"text-yellow-600":
|
|
2184
|
-
"text-black/90": !
|
|
2194
|
+
className: _("size-5", {
|
|
2195
|
+
"text-yellow-600": y,
|
|
2196
|
+
"text-black/90": !y
|
|
2185
2197
|
}),
|
|
2186
|
-
weight:
|
|
2198
|
+
weight: y ? "duotone" : "regular"
|
|
2187
2199
|
}
|
|
2188
2200
|
)
|
|
2189
2201
|
}
|
|
2190
2202
|
),
|
|
2191
|
-
|
|
2203
|
+
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2192
2204
|
Ft,
|
|
2193
2205
|
{
|
|
2194
|
-
channel:
|
|
2206
|
+
channel: p,
|
|
2195
2207
|
participant: v,
|
|
2196
2208
|
showDeleteConversation: l,
|
|
2197
2209
|
showBlockParticipant: o,
|
|
@@ -2202,7 +2214,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2202
2214
|
onBlockParticipantClick: g,
|
|
2203
2215
|
onReportParticipantClick: u,
|
|
2204
2216
|
customChannelActions: f,
|
|
2205
|
-
triggerClassName:
|
|
2217
|
+
triggerClassName: _(le, "bg-[#F1F0EE]")
|
|
2206
2218
|
}
|
|
2207
2219
|
))
|
|
2208
2220
|
] })
|
|
@@ -2212,64 +2224,76 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2212
2224
|
t && e && /* @__PURE__ */ n(
|
|
2213
2225
|
"button",
|
|
2214
2226
|
{
|
|
2215
|
-
className:
|
|
2227
|
+
className: _(
|
|
2216
2228
|
le,
|
|
2217
2229
|
"messaging-channel-view-back-button-desktop"
|
|
2218
2230
|
),
|
|
2219
2231
|
type: "button",
|
|
2220
2232
|
onClick: e,
|
|
2221
2233
|
"aria-label": "Back to conversations",
|
|
2222
|
-
children: /* @__PURE__ */ n(
|
|
2234
|
+
children: /* @__PURE__ */ n(zt, { className: "size-5 text-black/90" })
|
|
2223
2235
|
}
|
|
2224
2236
|
),
|
|
2225
|
-
|
|
2237
|
+
N ? /* @__PURE__ */ h(
|
|
2226
2238
|
"button",
|
|
2227
2239
|
{
|
|
2228
2240
|
type: "button",
|
|
2229
|
-
onClick:
|
|
2241
|
+
onClick: N,
|
|
2230
2242
|
"aria-label": `View details for ${M}`,
|
|
2231
|
-
className:
|
|
2243
|
+
className: _(
|
|
2244
|
+
L,
|
|
2245
|
+
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2246
|
+
),
|
|
2232
2247
|
children: [
|
|
2233
2248
|
/* @__PURE__ */ n(
|
|
2234
|
-
|
|
2249
|
+
ne,
|
|
2235
2250
|
{
|
|
2236
|
-
id: ((
|
|
2251
|
+
id: (($ = v == null ? void 0 : v.user) == null ? void 0 : $.id) || p.id || "unknown",
|
|
2237
2252
|
name: M,
|
|
2238
|
-
image:
|
|
2239
|
-
starred: s &&
|
|
2253
|
+
image: T,
|
|
2254
|
+
starred: s && y,
|
|
2240
2255
|
dmAgentEnabled: a,
|
|
2241
2256
|
size: 48
|
|
2242
2257
|
}
|
|
2243
2258
|
),
|
|
2244
2259
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2245
2260
|
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2246
|
-
|
|
2247
|
-
/* @__PURE__ */ n(
|
|
2261
|
+
E,
|
|
2262
|
+
/* @__PURE__ */ n(ve, { className: "size-4 shrink-0", weight: "bold" })
|
|
2248
2263
|
] }),
|
|
2249
2264
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2250
|
-
/* @__PURE__ */ n(
|
|
2251
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
2265
|
+
/* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
|
|
2266
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Ae })
|
|
2252
2267
|
] })
|
|
2253
2268
|
] })
|
|
2254
2269
|
]
|
|
2255
2270
|
}
|
|
2256
|
-
) : /* @__PURE__ */ h(
|
|
2271
|
+
) : /* @__PURE__ */ h("div", { className: L, children: [
|
|
2257
2272
|
/* @__PURE__ */ n(
|
|
2258
|
-
|
|
2273
|
+
ne,
|
|
2259
2274
|
{
|
|
2260
|
-
id: ((
|
|
2275
|
+
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) || p.id || "unknown",
|
|
2261
2276
|
name: M,
|
|
2262
|
-
image:
|
|
2263
|
-
starred: s &&
|
|
2277
|
+
image: T,
|
|
2278
|
+
starred: s && y,
|
|
2264
2279
|
dmAgentEnabled: a,
|
|
2265
2280
|
size: 48
|
|
2266
2281
|
}
|
|
2267
2282
|
),
|
|
2268
2283
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2269
|
-
/* @__PURE__ */
|
|
2284
|
+
/* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2285
|
+
E,
|
|
2286
|
+
/* @__PURE__ */ n(
|
|
2287
|
+
ve,
|
|
2288
|
+
{
|
|
2289
|
+
className: "invisible size-4 shrink-0",
|
|
2290
|
+
weight: "bold"
|
|
2291
|
+
}
|
|
2292
|
+
)
|
|
2293
|
+
] }),
|
|
2270
2294
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2271
|
-
/* @__PURE__ */ n(
|
|
2272
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
2295
|
+
/* @__PURE__ */ n(pe, { className: "size-3 shrink-0 text-black/55" }),
|
|
2296
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Ae })
|
|
2273
2297
|
] })
|
|
2274
2298
|
] })
|
|
2275
2299
|
] })
|
|
@@ -2279,25 +2303,25 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2279
2303
|
"button",
|
|
2280
2304
|
{
|
|
2281
2305
|
className: le,
|
|
2282
|
-
onClick:
|
|
2306
|
+
onClick: R,
|
|
2283
2307
|
type: "button",
|
|
2284
|
-
"aria-label":
|
|
2308
|
+
"aria-label": y ? "Unstar conversation" : "Star conversation",
|
|
2285
2309
|
children: /* @__PURE__ */ n(
|
|
2286
|
-
|
|
2310
|
+
Ge,
|
|
2287
2311
|
{
|
|
2288
|
-
className:
|
|
2289
|
-
"text-yellow-600":
|
|
2290
|
-
"text-black/90": !
|
|
2312
|
+
className: _("size-6", {
|
|
2313
|
+
"text-yellow-600": y,
|
|
2314
|
+
"text-black/90": !y
|
|
2291
2315
|
}),
|
|
2292
|
-
weight:
|
|
2316
|
+
weight: y ? "duotone" : "regular"
|
|
2293
2317
|
}
|
|
2294
2318
|
)
|
|
2295
2319
|
}
|
|
2296
2320
|
),
|
|
2297
|
-
|
|
2321
|
+
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2298
2322
|
Ft,
|
|
2299
2323
|
{
|
|
2300
|
-
channel:
|
|
2324
|
+
channel: p,
|
|
2301
2325
|
participant: v,
|
|
2302
2326
|
showDeleteConversation: l,
|
|
2303
2327
|
showBlockParticipant: o,
|
|
@@ -2329,56 +2353,56 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2329
2353
|
showBlockParticipant: u = !0,
|
|
2330
2354
|
showReportParticipant: f = !0,
|
|
2331
2355
|
composerDisabled: c = !1,
|
|
2332
|
-
composerDisabledReason:
|
|
2333
|
-
showStarButton:
|
|
2334
|
-
chatbotVotingEnabled:
|
|
2335
|
-
renderChannelBanner:
|
|
2356
|
+
composerDisabledReason: b,
|
|
2357
|
+
showStarButton: N = !1,
|
|
2358
|
+
chatbotVotingEnabled: w = !1,
|
|
2359
|
+
renderChannelBanner: p,
|
|
2336
2360
|
renderHeaderTitleBadges: v,
|
|
2337
2361
|
customChannelActions: M,
|
|
2338
|
-
renderChannelActions:
|
|
2339
|
-
renderMessage:
|
|
2340
|
-
dmAgentEnabled:
|
|
2341
|
-
viewerLanguage:
|
|
2342
|
-
showChannelInfo:
|
|
2362
|
+
renderChannelActions: T,
|
|
2363
|
+
renderMessage: y,
|
|
2364
|
+
dmAgentEnabled: O = !1,
|
|
2365
|
+
viewerLanguage: P,
|
|
2366
|
+
showChannelInfo: L = !0,
|
|
2343
2367
|
onParticipantNameClick: E,
|
|
2344
2368
|
composerInput: R
|
|
2345
2369
|
}) => {
|
|
2346
|
-
var
|
|
2347
|
-
const { channel:
|
|
2370
|
+
var V, ee, Z, G, x, I;
|
|
2371
|
+
const { channel: A } = de(), D = j.useMemo(() => {
|
|
2348
2372
|
var q, B;
|
|
2349
|
-
const U = (q =
|
|
2350
|
-
return U ? Object.values(((B =
|
|
2373
|
+
const U = (q = A._client) == null ? void 0 : q.userID;
|
|
2374
|
+
return U ? Object.values(((B = A.state) == null ? void 0 : B.members) || {}).find(
|
|
2351
2375
|
(W) => {
|
|
2352
2376
|
var X;
|
|
2353
2377
|
return ((X = W.user) == null ? void 0 : X.id) && W.user.id !== U;
|
|
2354
2378
|
}
|
|
2355
2379
|
) : void 0;
|
|
2356
|
-
}, [(
|
|
2380
|
+
}, [(V = A._client) == null ? void 0 : V.userID, (ee = A.state) == null ? void 0 : ee.members]), C = j.useMemo(() => {
|
|
2357
2381
|
var q, B;
|
|
2358
|
-
const U = (q =
|
|
2359
|
-
return U ? Object.values(((B =
|
|
2382
|
+
const U = (q = A._client) == null ? void 0 : q.userID;
|
|
2383
|
+
return U ? Object.values(((B = A.state) == null ? void 0 : B.members) || {}).find((W) => {
|
|
2360
2384
|
var X;
|
|
2361
2385
|
return ((X = W.user) == null ? void 0 : X.id) === U;
|
|
2362
2386
|
}) : void 0;
|
|
2363
|
-
}, [(Z =
|
|
2387
|
+
}, [(Z = A._client) == null ? void 0 : Z.userID, (G = A.state) == null ? void 0 : G.members]), k = ((x = C == null ? void 0 : C.user) == null ? void 0 : x.is_account) ?? (C == null ? void 0 : C.is_account), S = ((I = D == null ? void 0 : D.user) == null ? void 0 : I.is_account) ?? (D == null ? void 0 : D.is_account), $ = O && k === !1 && S === !0, z = J(
|
|
2364
2388
|
(U) => {
|
|
2365
|
-
const { message:
|
|
2366
|
-
|
|
2389
|
+
const { message: H } = ye("ChannelView"), q = /* @__PURE__ */ n(
|
|
2390
|
+
Ia,
|
|
2367
2391
|
{
|
|
2368
2392
|
...U,
|
|
2369
|
-
chatbotVotingEnabled:
|
|
2370
|
-
viewerLanguage:
|
|
2393
|
+
chatbotVotingEnabled: w,
|
|
2394
|
+
viewerLanguage: P
|
|
2371
2395
|
}
|
|
2372
2396
|
);
|
|
2373
|
-
return !
|
|
2397
|
+
return !y || !H ? q : y(q, H);
|
|
2374
2398
|
},
|
|
2375
|
-
[
|
|
2399
|
+
[w, y, P]
|
|
2376
2400
|
);
|
|
2377
|
-
return /* @__PURE__ */ n(
|
|
2401
|
+
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
2378
2402
|
ls,
|
|
2379
2403
|
{
|
|
2380
2404
|
overrides: {
|
|
2381
|
-
Message:
|
|
2405
|
+
Message: z,
|
|
2382
2406
|
MessageActions: Aa
|
|
2383
2407
|
},
|
|
2384
2408
|
children: /* @__PURE__ */ h(cs, { children: [
|
|
@@ -2387,9 +2411,9 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2387
2411
|
{
|
|
2388
2412
|
onBack: e,
|
|
2389
2413
|
showBackButton: t,
|
|
2390
|
-
showChannelInfo:
|
|
2391
|
-
showStarButton:
|
|
2392
|
-
dmAgentEnabled:
|
|
2414
|
+
showChannelInfo: L,
|
|
2415
|
+
showStarButton: N,
|
|
2416
|
+
dmAgentEnabled: $,
|
|
2393
2417
|
onLeaveConversation: i,
|
|
2394
2418
|
onBlockParticipant: l,
|
|
2395
2419
|
showDeleteConversation: o,
|
|
@@ -2399,12 +2423,12 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2399
2423
|
onBlockParticipantClick: m,
|
|
2400
2424
|
onReportParticipantClick: g,
|
|
2401
2425
|
customChannelActions: M,
|
|
2402
|
-
renderChannelActions:
|
|
2426
|
+
renderChannelActions: T,
|
|
2403
2427
|
onParticipantNameClick: E,
|
|
2404
2428
|
renderHeaderTitleBadges: v
|
|
2405
2429
|
}
|
|
2406
2430
|
) }, "lt-channel-header"),
|
|
2407
|
-
|
|
2431
|
+
p ? /* @__PURE__ */ n(j.Fragment, { children: p() }, "lt-channel-banner") : null,
|
|
2408
2432
|
/* @__PURE__ */ n(
|
|
2409
2433
|
"div",
|
|
2410
2434
|
{
|
|
@@ -2413,16 +2437,16 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2413
2437
|
},
|
|
2414
2438
|
"lt-channel-message-list"
|
|
2415
2439
|
),
|
|
2416
|
-
r ? /* @__PURE__ */ n(j.Fragment, { children: r(
|
|
2440
|
+
r ? /* @__PURE__ */ n(j.Fragment, { children: r(A) }, "lt-channel-conversation-footer") : null,
|
|
2417
2441
|
/* @__PURE__ */ n(
|
|
2418
|
-
|
|
2442
|
+
za,
|
|
2419
2443
|
{
|
|
2420
2444
|
...s && {
|
|
2421
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2445
|
+
renderActions: () => s == null ? void 0 : s(A)
|
|
2422
2446
|
},
|
|
2423
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2447
|
+
renderFooter: () => a == null ? void 0 : a(A),
|
|
2424
2448
|
disabled: c,
|
|
2425
|
-
disabledReason:
|
|
2449
|
+
disabledReason: b,
|
|
2426
2450
|
composerInput: R
|
|
2427
2451
|
},
|
|
2428
2452
|
"lt-channel-message-input"
|
|
@@ -2446,64 +2470,64 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2446
2470
|
onDeleteConversationClick: u,
|
|
2447
2471
|
onBlockParticipantClick: f,
|
|
2448
2472
|
onReportParticipantClick: c,
|
|
2449
|
-
showBlockParticipant:
|
|
2450
|
-
showReportParticipant:
|
|
2451
|
-
composerDisabled:
|
|
2452
|
-
composerDisabledReason:
|
|
2473
|
+
showBlockParticipant: b = !0,
|
|
2474
|
+
showReportParticipant: N = !0,
|
|
2475
|
+
composerDisabled: w = !1,
|
|
2476
|
+
composerDisabledReason: p,
|
|
2453
2477
|
dmAgentEnabled: v,
|
|
2454
2478
|
messageMetadata: M,
|
|
2455
|
-
onMessageSent:
|
|
2456
|
-
showStarButton:
|
|
2457
|
-
chatbotVotingEnabled:
|
|
2458
|
-
renderChannelBanner:
|
|
2459
|
-
renderHeaderTitleBadges:
|
|
2479
|
+
onMessageSent: T,
|
|
2480
|
+
showStarButton: y = !1,
|
|
2481
|
+
chatbotVotingEnabled: O = !1,
|
|
2482
|
+
renderChannelBanner: P,
|
|
2483
|
+
renderHeaderTitleBadges: L,
|
|
2460
2484
|
customChannelActions: E,
|
|
2461
2485
|
renderChannelActions: R,
|
|
2462
|
-
renderMessage:
|
|
2463
|
-
onMessageLinkClick:
|
|
2486
|
+
renderMessage: A,
|
|
2487
|
+
onMessageLinkClick: D,
|
|
2464
2488
|
sendButton: C,
|
|
2465
2489
|
attachmentPreviewList: k,
|
|
2466
2490
|
viewerLanguage: S,
|
|
2467
|
-
showChannelInfo:
|
|
2468
|
-
onParticipantNameClick:
|
|
2469
|
-
composerInput:
|
|
2491
|
+
showChannelInfo: $ = !0,
|
|
2492
|
+
onParticipantNameClick: z,
|
|
2493
|
+
composerInput: V
|
|
2470
2494
|
}) => {
|
|
2471
|
-
const
|
|
2472
|
-
async (
|
|
2495
|
+
const ee = J(
|
|
2496
|
+
async (G, x, I) => {
|
|
2473
2497
|
var X;
|
|
2474
|
-
const U = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0,
|
|
2475
|
-
...
|
|
2476
|
-
...
|
|
2498
|
+
const U = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0, H = v && !U, q = {
|
|
2499
|
+
...x,
|
|
2500
|
+
...H && { silent: !0 },
|
|
2477
2501
|
...M && {
|
|
2478
2502
|
metadata: {
|
|
2479
|
-
...
|
|
2503
|
+
...x.metadata ?? {},
|
|
2480
2504
|
...M
|
|
2481
2505
|
}
|
|
2482
2506
|
}
|
|
2483
2507
|
}, B = {
|
|
2484
|
-
...
|
|
2485
|
-
...
|
|
2508
|
+
...I,
|
|
2509
|
+
...H && { skip_push: !0 }
|
|
2486
2510
|
}, W = await e.sendMessage(q, B);
|
|
2487
|
-
return
|
|
2511
|
+
return T == null || T(W), W;
|
|
2488
2512
|
},
|
|
2489
|
-
[e, v, M,
|
|
2490
|
-
), Z =
|
|
2513
|
+
[e, v, M, T]
|
|
2514
|
+
), Z = Y(null);
|
|
2491
2515
|
return K(() => {
|
|
2492
|
-
if (!
|
|
2493
|
-
const
|
|
2494
|
-
if (!
|
|
2495
|
-
const
|
|
2496
|
-
const U =
|
|
2516
|
+
if (!D) return;
|
|
2517
|
+
const G = Z.current;
|
|
2518
|
+
if (!G) return;
|
|
2519
|
+
const x = (I) => {
|
|
2520
|
+
const U = I.target, H = U == null ? void 0 : U.closest("a[href]"), q = H == null ? void 0 : H.getAttribute("href");
|
|
2497
2521
|
if (!q) return;
|
|
2498
|
-
const B =
|
|
2499
|
-
|
|
2522
|
+
const B = H == null ? void 0 : H.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), X = W ? e.state.messages.find((ue) => ue.id === W) : void 0;
|
|
2523
|
+
D(q, X);
|
|
2500
2524
|
};
|
|
2501
|
-
return
|
|
2502
|
-
}, [
|
|
2525
|
+
return G.addEventListener("click", x), () => G.removeEventListener("click", x);
|
|
2526
|
+
}, [D, e]), /* @__PURE__ */ n(
|
|
2503
2527
|
"div",
|
|
2504
2528
|
{
|
|
2505
2529
|
ref: Z,
|
|
2506
|
-
className:
|
|
2530
|
+
className: _(
|
|
2507
2531
|
"messaging-channel-view h-full flex flex-col",
|
|
2508
2532
|
d
|
|
2509
2533
|
),
|
|
@@ -2513,10 +2537,10 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2513
2537
|
channel: e,
|
|
2514
2538
|
MessageSystem: Ha,
|
|
2515
2539
|
EmptyStateIndicator: m,
|
|
2516
|
-
LoadingIndicator:
|
|
2540
|
+
LoadingIndicator: Re,
|
|
2517
2541
|
DateSeparator: Vs,
|
|
2518
2542
|
TypingIndicator: qa,
|
|
2519
|
-
doSendMessageRequest:
|
|
2543
|
+
doSendMessageRequest: ee,
|
|
2520
2544
|
...C ? { SendButton: C } : {},
|
|
2521
2545
|
...k ? { AttachmentPreviewList: k } : {},
|
|
2522
2546
|
children: /* @__PURE__ */ n(
|
|
@@ -2534,22 +2558,22 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2534
2558
|
onDeleteConversationClick: u,
|
|
2535
2559
|
onBlockParticipantClick: f,
|
|
2536
2560
|
onReportParticipantClick: c,
|
|
2537
|
-
showBlockParticipant:
|
|
2538
|
-
showReportParticipant:
|
|
2539
|
-
composerDisabled:
|
|
2540
|
-
composerDisabledReason:
|
|
2541
|
-
showStarButton:
|
|
2561
|
+
showBlockParticipant: b,
|
|
2562
|
+
showReportParticipant: N,
|
|
2563
|
+
composerDisabled: w,
|
|
2564
|
+
composerDisabledReason: p,
|
|
2565
|
+
showStarButton: y,
|
|
2542
2566
|
dmAgentEnabled: v,
|
|
2543
|
-
chatbotVotingEnabled:
|
|
2544
|
-
renderChannelBanner:
|
|
2545
|
-
renderHeaderTitleBadges:
|
|
2567
|
+
chatbotVotingEnabled: O,
|
|
2568
|
+
renderChannelBanner: P,
|
|
2569
|
+
renderHeaderTitleBadges: L,
|
|
2546
2570
|
customChannelActions: E,
|
|
2547
2571
|
renderChannelActions: R,
|
|
2548
|
-
renderMessage:
|
|
2572
|
+
renderMessage: A,
|
|
2549
2573
|
viewerLanguage: S,
|
|
2550
|
-
showChannelInfo:
|
|
2551
|
-
onParticipantNameClick:
|
|
2552
|
-
composerInput:
|
|
2574
|
+
showChannelInfo: $,
|
|
2575
|
+
onParticipantNameClick: z,
|
|
2576
|
+
composerInput: V
|
|
2553
2577
|
}
|
|
2554
2578
|
)
|
|
2555
2579
|
}
|
|
@@ -2559,7 +2583,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2559
2583
|
}
|
|
2560
2584
|
);
|
|
2561
2585
|
mn.displayName = "ChannelView";
|
|
2562
|
-
const
|
|
2586
|
+
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: [
|
|
2563
2587
|
/* @__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: "⚠️" }) }),
|
|
2564
2588
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2565
2589
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2573,7 +2597,7 @@ const ve = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2573
2597
|
}
|
|
2574
2598
|
)
|
|
2575
2599
|
] }) }));
|
|
2576
|
-
|
|
2600
|
+
xe.displayName = "ErrorState";
|
|
2577
2601
|
const Ei = ({
|
|
2578
2602
|
capabilities: e = {},
|
|
2579
2603
|
renderMessageInputActions: t,
|
|
@@ -2589,40 +2613,40 @@ const Ei = ({
|
|
|
2589
2613
|
onMessageSent: u,
|
|
2590
2614
|
chatbotVotingEnabled: f = !1,
|
|
2591
2615
|
viewerLanguage: c,
|
|
2592
|
-
renderHeaderTitleBadges:
|
|
2593
|
-
renderChannelBanner:
|
|
2594
|
-
customChannelActions:
|
|
2595
|
-
renderChannelActions:
|
|
2616
|
+
renderHeaderTitleBadges: b,
|
|
2617
|
+
renderChannelBanner: N,
|
|
2618
|
+
customChannelActions: w,
|
|
2619
|
+
renderChannelActions: p,
|
|
2596
2620
|
onParticipantNameClick: v,
|
|
2597
2621
|
renderMessage: M,
|
|
2598
|
-
onMessageLinkClick:
|
|
2599
|
-
showChannelInfo:
|
|
2600
|
-
composerInput:
|
|
2622
|
+
onMessageLinkClick: T,
|
|
2623
|
+
showChannelInfo: y,
|
|
2624
|
+
composerInput: O
|
|
2601
2625
|
}) => {
|
|
2602
2626
|
const {
|
|
2603
|
-
client:
|
|
2604
|
-
isConnected:
|
|
2627
|
+
client: P,
|
|
2628
|
+
isConnected: L,
|
|
2605
2629
|
isLoading: E,
|
|
2606
2630
|
error: R,
|
|
2607
|
-
refreshConnection:
|
|
2608
|
-
service:
|
|
2631
|
+
refreshConnection: A,
|
|
2632
|
+
service: D,
|
|
2609
2633
|
debug: C
|
|
2610
|
-
} =
|
|
2611
|
-
|
|
2612
|
-
const
|
|
2613
|
-
|
|
2614
|
-
const
|
|
2634
|
+
} = zs(), [k, S] = F(null), [$, z] = F(null), [V, ee] = F(!1), { showDeleteConversation: Z = !0 } = e, G = Y(l);
|
|
2635
|
+
G.current = l;
|
|
2636
|
+
const x = Y(a);
|
|
2637
|
+
x.current = a;
|
|
2638
|
+
const I = Y(null), U = Y(null);
|
|
2615
2639
|
K(() => {
|
|
2616
2640
|
U.current = k;
|
|
2617
2641
|
}, [k]), K(() => {
|
|
2618
|
-
if (!
|
|
2619
|
-
const B =
|
|
2642
|
+
if (!P || !L) return;
|
|
2643
|
+
const B = P.userID;
|
|
2620
2644
|
if (!B) return;
|
|
2621
2645
|
const W = `${B}::${i}`;
|
|
2622
|
-
if (
|
|
2623
|
-
|
|
2646
|
+
if (I.current === W) return;
|
|
2647
|
+
I.current = W;
|
|
2624
2648
|
const X = () => {
|
|
2625
|
-
|
|
2649
|
+
I.current === W && (I.current = null);
|
|
2626
2650
|
};
|
|
2627
2651
|
(async () => {
|
|
2628
2652
|
var me, he;
|
|
@@ -2631,7 +2655,7 @@ const Ei = ({
|
|
|
2631
2655
|
"[MessagingShell] Loading initial conversation with:",
|
|
2632
2656
|
i
|
|
2633
2657
|
);
|
|
2634
|
-
const
|
|
2658
|
+
const Q = await P.queryChannels(
|
|
2635
2659
|
{
|
|
2636
2660
|
type: "messaging",
|
|
2637
2661
|
members: { $eq: [B, i] }
|
|
@@ -2639,28 +2663,28 @@ const Ei = ({
|
|
|
2639
2663
|
{},
|
|
2640
2664
|
{ limit: 1 }
|
|
2641
2665
|
);
|
|
2642
|
-
if (
|
|
2643
|
-
S(
|
|
2666
|
+
if (Q.length > 0) {
|
|
2667
|
+
S(Q[0]), z(null), (me = x.current) == null || me.call(x, Q[0]), C && console.log(
|
|
2644
2668
|
"[MessagingShell] Initial conversation loaded:",
|
|
2645
|
-
|
|
2669
|
+
Q[0].id
|
|
2646
2670
|
);
|
|
2647
2671
|
return;
|
|
2648
2672
|
}
|
|
2649
|
-
const
|
|
2650
|
-
if (!
|
|
2651
|
-
X(),
|
|
2673
|
+
const te = G.current;
|
|
2674
|
+
if (!te || !D) {
|
|
2675
|
+
X(), z("No conversation found with this account"), C && console.log(
|
|
2652
2676
|
"[MessagingShell] No conversation found for:",
|
|
2653
2677
|
i
|
|
2654
2678
|
);
|
|
2655
2679
|
return;
|
|
2656
2680
|
}
|
|
2657
2681
|
try {
|
|
2658
|
-
const oe = await
|
|
2659
|
-
id:
|
|
2660
|
-
name:
|
|
2661
|
-
phone:
|
|
2682
|
+
const oe = await D.startChannelWithParticipant({
|
|
2683
|
+
id: te.id,
|
|
2684
|
+
name: te.name,
|
|
2685
|
+
phone: te.phone
|
|
2662
2686
|
});
|
|
2663
|
-
S(oe),
|
|
2687
|
+
S(oe), z(null), (he = x.current) == null || he.call(x, oe), C && console.log(
|
|
2664
2688
|
"[MessagingShell] Channel created and loaded:",
|
|
2665
2689
|
oe.id
|
|
2666
2690
|
);
|
|
@@ -2668,35 +2692,35 @@ const Ei = ({
|
|
|
2668
2692
|
console.error(
|
|
2669
2693
|
"[MessagingShell] Failed to create conversation:",
|
|
2670
2694
|
oe
|
|
2671
|
-
), X(),
|
|
2695
|
+
), X(), z("Failed to create conversation");
|
|
2672
2696
|
}
|
|
2673
|
-
} catch (
|
|
2697
|
+
} catch (Q) {
|
|
2674
2698
|
console.error(
|
|
2675
2699
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2676
|
-
|
|
2677
|
-
), X(), U.current ||
|
|
2700
|
+
Q
|
|
2701
|
+
), X(), U.current || z("Failed to load conversation");
|
|
2678
2702
|
}
|
|
2679
2703
|
})();
|
|
2680
|
-
}, [i, L, D,
|
|
2681
|
-
const
|
|
2682
|
-
|
|
2704
|
+
}, [i, P, L, D, C]);
|
|
2705
|
+
const H = Y(r);
|
|
2706
|
+
H.current = r;
|
|
2683
2707
|
const q = J(() => {
|
|
2684
2708
|
var B;
|
|
2685
|
-
S(null),
|
|
2709
|
+
S(null), ee(!0), (B = H.current) == null || B.call(H);
|
|
2686
2710
|
}, []);
|
|
2687
|
-
return E ? /* @__PURE__ */ n(
|
|
2688
|
-
|
|
2711
|
+
return E ? /* @__PURE__ */ n(Re, {}) : R ? /* @__PURE__ */ n(xe, { message: R, onBack: A }) : !L || !P ? /* @__PURE__ */ n(
|
|
2712
|
+
xe,
|
|
2689
2713
|
{
|
|
2690
2714
|
message: "Not connected to messaging service",
|
|
2691
|
-
onBack:
|
|
2715
|
+
onBack: A
|
|
2692
2716
|
}
|
|
2693
|
-
) :
|
|
2717
|
+
) : $ ? /* @__PURE__ */ n(xe, { message: $ }) : V && !k ? /* @__PURE__ */ n(xe, { message: "Conversation ended" }) : k ? /* @__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(
|
|
2694
2718
|
mn,
|
|
2695
2719
|
{
|
|
2696
2720
|
channel: k,
|
|
2697
2721
|
renderMessageInputActions: t,
|
|
2698
2722
|
renderConversationFooter: s,
|
|
2699
|
-
renderChannelBanner:
|
|
2723
|
+
renderChannelBanner: N,
|
|
2700
2724
|
onLeaveConversation: q,
|
|
2701
2725
|
onBlockParticipant: q,
|
|
2702
2726
|
CustomChannelEmptyState: o,
|
|
@@ -2707,17 +2731,17 @@ const Ei = ({
|
|
|
2707
2731
|
onMessageSent: u,
|
|
2708
2732
|
chatbotVotingEnabled: f,
|
|
2709
2733
|
viewerLanguage: c,
|
|
2710
|
-
renderHeaderTitleBadges:
|
|
2711
|
-
customChannelActions:
|
|
2712
|
-
renderChannelActions:
|
|
2734
|
+
renderHeaderTitleBadges: b,
|
|
2735
|
+
customChannelActions: w,
|
|
2736
|
+
renderChannelActions: p,
|
|
2713
2737
|
onParticipantNameClick: v,
|
|
2714
2738
|
renderMessage: M,
|
|
2715
|
-
onMessageLinkClick:
|
|
2716
|
-
showChannelInfo:
|
|
2717
|
-
composerInput:
|
|
2739
|
+
onMessageLinkClick: T,
|
|
2740
|
+
showChannelInfo: y,
|
|
2741
|
+
composerInput: O
|
|
2718
2742
|
},
|
|
2719
2743
|
k.id
|
|
2720
|
-
) }) }) : /* @__PURE__ */ n(
|
|
2744
|
+
) }) }) : /* @__PURE__ */ n(Re, {});
|
|
2721
2745
|
};
|
|
2722
2746
|
function Qa(e) {
|
|
2723
2747
|
const t = e.state.pending_messages;
|
|
@@ -2755,7 +2779,7 @@ const hn = j.createContext({
|
|
|
2755
2779
|
});
|
|
2756
2780
|
}, fn = j.memo(
|
|
2757
2781
|
({ channel: e, unread: t }) => {
|
|
2758
|
-
var
|
|
2782
|
+
var O, P, L;
|
|
2759
2783
|
const {
|
|
2760
2784
|
selectedChannel: s,
|
|
2761
2785
|
onChannelSelect: a,
|
|
@@ -2765,39 +2789,39 @@ const hn = j.createContext({
|
|
|
2765
2789
|
} = tr(), o = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2766
2790
|
e && a(e);
|
|
2767
2791
|
}, m = (E) => {
|
|
2768
|
-
const R = E.key === "Enter" || E.key === " ",
|
|
2769
|
-
!R ||
|
|
2770
|
-
}, u = Object.values(((
|
|
2792
|
+
const R = E.key === "Enter" || E.key === " ", A = E.repeat;
|
|
2793
|
+
!R || A || (E.preventDefault(), d());
|
|
2794
|
+
}, u = Object.values(((O = e == null ? void 0 : e.state) == null ? void 0 : O.members) || {}).find(
|
|
2771
2795
|
(E) => {
|
|
2772
|
-
var R,
|
|
2773
|
-
return ((R = E.user) == null ? void 0 : R.id) && E.user.id !== ((
|
|
2796
|
+
var R, A;
|
|
2797
|
+
return ((R = E.user) == null ? void 0 : R.id) && E.user.id !== ((A = e == null ? void 0 : e._client) == null ? void 0 : A.userID);
|
|
2774
2798
|
}
|
|
2775
|
-
), f = Jt(u == null ? void 0 : u.user), c = (
|
|
2799
|
+
), f = Jt(u == null ? void 0 : u.user), c = (P = u == null ? void 0 : u.user) == null ? void 0 : P.image, b = (() => {
|
|
2776
2800
|
var R;
|
|
2777
2801
|
const E = (R = e == null ? void 0 : e.state) == null ? void 0 : R.messages;
|
|
2778
2802
|
if (E != null && E.length) {
|
|
2779
|
-
for (let
|
|
2780
|
-
if (E[
|
|
2803
|
+
for (let A = E.length - 1; A >= 0; A--)
|
|
2804
|
+
if (E[A].type !== "system") return E[A];
|
|
2781
2805
|
}
|
|
2782
|
-
})(),
|
|
2783
|
-
var k, S,
|
|
2806
|
+
})(), w = (() => {
|
|
2807
|
+
var k, S, $, z;
|
|
2784
2808
|
const E = Zt({
|
|
2785
|
-
message:
|
|
2809
|
+
message: b,
|
|
2786
2810
|
viewerLanguage: l
|
|
2787
2811
|
});
|
|
2788
|
-
if (((k =
|
|
2789
|
-
if (((S =
|
|
2790
|
-
if (((
|
|
2812
|
+
if (((k = b == null ? void 0 : b.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return E ? `💵 ${E}` : "💵 Sent a tip";
|
|
2813
|
+
if (((S = b == null ? void 0 : b.metadata) == null ? void 0 : S.custom_type) === "MESSAGE_PAID") return E ? `💰 ${E}` : "💰 Sent a message";
|
|
2814
|
+
if ((($ = b == null ? void 0 : b.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_ATTACHMENT") return E ? `📎 ${E}` : "📎 Sent an attachment";
|
|
2791
2815
|
if (E) return E;
|
|
2792
|
-
const C = (
|
|
2816
|
+
const C = (z = b == null ? void 0 : b.attachments) == null ? void 0 : z[0];
|
|
2793
2817
|
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";
|
|
2794
|
-
})(),
|
|
2818
|
+
})(), p = b != null && b.created_at ? sr(new Date(b.created_at)) : "", v = b ? Me(b) : !1, M = i ? i(b, w) : `${v ? "✨ " : ""}${w}`, T = Kt(e), y = t ?? 0;
|
|
2795
2819
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2796
2820
|
channelId: e == null ? void 0 : e.id,
|
|
2797
2821
|
isSelected: o,
|
|
2798
2822
|
participantName: f,
|
|
2799
|
-
unreadCount:
|
|
2800
|
-
hasTimestamp: !!
|
|
2823
|
+
unreadCount: y,
|
|
2824
|
+
hasTimestamp: !!p
|
|
2801
2825
|
}), /* @__PURE__ */ n(
|
|
2802
2826
|
"div",
|
|
2803
2827
|
{
|
|
@@ -2805,7 +2829,7 @@ const hn = j.createContext({
|
|
|
2805
2829
|
tabIndex: 0,
|
|
2806
2830
|
onClick: d,
|
|
2807
2831
|
onKeyDown: m,
|
|
2808
|
-
className:
|
|
2832
|
+
className: _(
|
|
2809
2833
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2810
2834
|
{
|
|
2811
2835
|
"bg-black/[0.04]": o,
|
|
@@ -2814,13 +2838,13 @@ const hn = j.createContext({
|
|
|
2814
2838
|
),
|
|
2815
2839
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2816
2840
|
/* @__PURE__ */ n(
|
|
2817
|
-
|
|
2841
|
+
ne,
|
|
2818
2842
|
{
|
|
2819
|
-
id: ((
|
|
2843
|
+
id: ((L = u == null ? void 0 : u.user) == null ? void 0 : L.id) || e.id || "unknown",
|
|
2820
2844
|
name: f,
|
|
2821
2845
|
image: c,
|
|
2822
2846
|
size: 48,
|
|
2823
|
-
starred:
|
|
2847
|
+
starred: T
|
|
2824
2848
|
}
|
|
2825
2849
|
),
|
|
2826
2850
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2828,20 +2852,20 @@ const hn = j.createContext({
|
|
|
2828
2852
|
/* @__PURE__ */ h(
|
|
2829
2853
|
"h3",
|
|
2830
2854
|
{
|
|
2831
|
-
className:
|
|
2855
|
+
className: _(
|
|
2832
2856
|
"text-sm font-medium truncate text-[#191918]"
|
|
2833
2857
|
),
|
|
2834
2858
|
children: [
|
|
2835
|
-
|
|
2859
|
+
T && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2836
2860
|
f
|
|
2837
2861
|
]
|
|
2838
2862
|
}
|
|
2839
2863
|
),
|
|
2840
|
-
|
|
2864
|
+
p && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: p })
|
|
2841
2865
|
] }),
|
|
2842
2866
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2843
2867
|
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
2844
|
-
|
|
2868
|
+
y > 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: y > 99 ? "99+" : y })
|
|
2845
2869
|
] })
|
|
2846
2870
|
] })
|
|
2847
2871
|
] })
|
|
@@ -2866,10 +2890,10 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2866
2890
|
const g = j.useRef(0);
|
|
2867
2891
|
g.current++;
|
|
2868
2892
|
const { debug: u = !1 } = Je(), f = j.useCallback(
|
|
2869
|
-
(
|
|
2870
|
-
for (const
|
|
2871
|
-
Qa(
|
|
2872
|
-
return r ? r(
|
|
2893
|
+
(b) => {
|
|
2894
|
+
for (const N of b)
|
|
2895
|
+
Qa(N);
|
|
2896
|
+
return r ? r(b) : b;
|
|
2873
2897
|
},
|
|
2874
2898
|
[r]
|
|
2875
2899
|
);
|
|
@@ -2897,7 +2921,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2897
2921
|
return /* @__PURE__ */ n(
|
|
2898
2922
|
"div",
|
|
2899
2923
|
{
|
|
2900
|
-
className:
|
|
2924
|
+
className: _(
|
|
2901
2925
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2902
2926
|
l
|
|
2903
2927
|
),
|
|
@@ -2936,7 +2960,7 @@ const lr = {
|
|
|
2936
2960
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2937
2961
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2938
2962
|
}, cr = ({ variant: e, cta: t }) => {
|
|
2939
|
-
const s =
|
|
2963
|
+
const s = _(
|
|
2940
2964
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2941
2965
|
lr[e]
|
|
2942
2966
|
), a = at(t.href);
|
|
@@ -2981,12 +3005,12 @@ const lr = {
|
|
|
2981
3005
|
cta: l,
|
|
2982
3006
|
trailingAction: o
|
|
2983
3007
|
}) => {
|
|
2984
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
2985
|
-
if (!g && !u && !c && !
|
|
2986
|
-
const
|
|
3008
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = l != null;
|
|
3009
|
+
if (!g && !u && !c && !b) return null;
|
|
3010
|
+
const w = _(
|
|
2987
3011
|
"truncate text-base font-medium leading-6",
|
|
2988
3012
|
d && !t ? ur : dr[e]
|
|
2989
|
-
),
|
|
3013
|
+
), p = _(
|
|
2990
3014
|
"truncate text-xs leading-4",
|
|
2991
3015
|
mr[e]
|
|
2992
3016
|
);
|
|
@@ -2996,24 +3020,24 @@ const lr = {
|
|
|
2996
3020
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2997
3021
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2998
3022
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2999
|
-
/* @__PURE__ */ n("p", { className:
|
|
3023
|
+
/* @__PURE__ */ n("p", { className: _("min-w-0", w), children: m })
|
|
3000
3024
|
] }),
|
|
3001
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
3025
|
+
u && /* @__PURE__ */ n("p", { className: p, children: a })
|
|
3002
3026
|
] }),
|
|
3003
|
-
!
|
|
3027
|
+
!b && c && /* @__PURE__ */ n("p", { className: p, children: f })
|
|
3004
3028
|
] }),
|
|
3005
3029
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
3006
3030
|
] }),
|
|
3007
3031
|
l && /* @__PURE__ */ n(cr, { variant: e, cta: l })
|
|
3008
3032
|
] });
|
|
3009
|
-
}, hr =
|
|
3033
|
+
}, hr = _(
|
|
3010
3034
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
3011
3035
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
3012
3036
|
// the messaging design system's "small border around link attachments"
|
|
3013
3037
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
3014
3038
|
"border border-black/[0.08]",
|
|
3015
3039
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
3016
|
-
),
|
|
3040
|
+
), Le = ({
|
|
3017
3041
|
variant: e,
|
|
3018
3042
|
children: t,
|
|
3019
3043
|
href: s,
|
|
@@ -3024,7 +3048,7 @@ const lr = {
|
|
|
3024
3048
|
bgClassName: o,
|
|
3025
3049
|
"data-testid": d
|
|
3026
3050
|
}) => {
|
|
3027
|
-
const m = s != null || a != null, g =
|
|
3051
|
+
const m = s != null || a != null, g = _(
|
|
3028
3052
|
hr,
|
|
3029
3053
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3030
3054
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -3055,7 +3079,7 @@ const lr = {
|
|
|
3055
3079
|
onClick: a,
|
|
3056
3080
|
"aria-label": r,
|
|
3057
3081
|
"data-testid": d,
|
|
3058
|
-
className:
|
|
3082
|
+
className: _(g, "text-left"),
|
|
3059
3083
|
children: [
|
|
3060
3084
|
t,
|
|
3061
3085
|
u
|
|
@@ -3079,11 +3103,11 @@ const lr = {
|
|
|
3079
3103
|
}, gr = {
|
|
3080
3104
|
dark: "size-16 text-white/25",
|
|
3081
3105
|
light: "size-16 text-black/25"
|
|
3082
|
-
},
|
|
3106
|
+
}, ze = (e, t) => !!t && !!e && ie(e) === "audio", gn = (e, t) => {
|
|
3083
3107
|
if (!t || !e) return !1;
|
|
3084
3108
|
const s = ie(e);
|
|
3085
3109
|
return s === "video" || s === "audio";
|
|
3086
|
-
}, it = "bg-[#F2F3F4]",
|
|
3110
|
+
}, it = "bg-[#F2F3F4]", De = ({
|
|
3087
3111
|
variant: e,
|
|
3088
3112
|
thumbnailUrl: t,
|
|
3089
3113
|
sourceUrl: s,
|
|
@@ -3093,7 +3117,7 @@ const lr = {
|
|
|
3093
3117
|
topRight: l
|
|
3094
3118
|
}) => {
|
|
3095
3119
|
const o = ie(r), d = !!s && o === "video";
|
|
3096
|
-
return
|
|
3120
|
+
return ze(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3097
3121
|
"audio",
|
|
3098
3122
|
{
|
|
3099
3123
|
src: s,
|
|
@@ -3105,7 +3129,7 @@ const lr = {
|
|
|
3105
3129
|
) }) : /* @__PURE__ */ h(
|
|
3106
3130
|
"div",
|
|
3107
3131
|
{
|
|
3108
|
-
className:
|
|
3132
|
+
className: _(
|
|
3109
3133
|
"relative h-[180px] w-full overflow-hidden",
|
|
3110
3134
|
d && "bg-black"
|
|
3111
3135
|
),
|
|
@@ -3132,7 +3156,7 @@ const lr = {
|
|
|
3132
3156
|
) : /* @__PURE__ */ n(
|
|
3133
3157
|
"div",
|
|
3134
3158
|
{
|
|
3135
|
-
className:
|
|
3159
|
+
className: _(
|
|
3136
3160
|
"flex h-full w-full items-center justify-center",
|
|
3137
3161
|
fr[e]
|
|
3138
3162
|
),
|
|
@@ -3147,7 +3171,7 @@ const lr = {
|
|
|
3147
3171
|
]
|
|
3148
3172
|
}
|
|
3149
3173
|
);
|
|
3150
|
-
},
|
|
3174
|
+
}, br = ({
|
|
3151
3175
|
title: e,
|
|
3152
3176
|
placeholderTitle: t,
|
|
3153
3177
|
description: s,
|
|
@@ -3161,16 +3185,16 @@ const lr = {
|
|
|
3161
3185
|
onDismiss: g,
|
|
3162
3186
|
onEditClick: u
|
|
3163
3187
|
}) => {
|
|
3164
|
-
const f = o === "classic", c =
|
|
3188
|
+
const f = o === "classic", c = ze(r, l), b = g ? /* @__PURE__ */ n(
|
|
3165
3189
|
"button",
|
|
3166
3190
|
{
|
|
3167
3191
|
type: "button",
|
|
3168
3192
|
onClick: g,
|
|
3169
3193
|
"aria-label": "Dismiss attachment",
|
|
3170
3194
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3171
|
-
children: /* @__PURE__ */ n(
|
|
3195
|
+
children: /* @__PURE__ */ n(Pe, { className: "size-3", weight: "bold" })
|
|
3172
3196
|
}
|
|
3173
|
-
) : void 0,
|
|
3197
|
+
) : void 0, N = u ? /* @__PURE__ */ n(
|
|
3174
3198
|
"button",
|
|
3175
3199
|
{
|
|
3176
3200
|
type: "button",
|
|
@@ -3180,9 +3204,9 @@ const lr = {
|
|
|
3180
3204
|
children: /* @__PURE__ */ n(Ls, { className: "size-5", weight: "regular" })
|
|
3181
3205
|
}
|
|
3182
3206
|
) : void 0;
|
|
3183
|
-
return c ? /* @__PURE__ */ n(
|
|
3207
|
+
return c ? /* @__PURE__ */ n(Le, { variant: "dark", bgClassName: it, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3184
3208
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3185
|
-
|
|
3209
|
+
De,
|
|
3186
3210
|
{
|
|
3187
3211
|
variant: "dark",
|
|
3188
3212
|
sourceUrl: l,
|
|
@@ -3190,22 +3214,22 @@ const lr = {
|
|
|
3190
3214
|
mimeType: r
|
|
3191
3215
|
}
|
|
3192
3216
|
) }),
|
|
3193
|
-
|
|
3217
|
+
b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
|
|
3194
3218
|
] }) }) : /* @__PURE__ */ h(
|
|
3195
|
-
|
|
3219
|
+
Le,
|
|
3196
3220
|
{
|
|
3197
3221
|
variant: "dark",
|
|
3198
|
-
topRight: f ?
|
|
3222
|
+
topRight: f ? b : void 0,
|
|
3199
3223
|
children: [
|
|
3200
3224
|
!f && /* @__PURE__ */ n(
|
|
3201
|
-
|
|
3225
|
+
De,
|
|
3202
3226
|
{
|
|
3203
3227
|
variant: "dark",
|
|
3204
3228
|
thumbnailUrl: i,
|
|
3205
3229
|
sourceUrl: l,
|
|
3206
3230
|
title: e,
|
|
3207
3231
|
mimeType: r,
|
|
3208
|
-
topRight:
|
|
3232
|
+
topRight: b
|
|
3209
3233
|
}
|
|
3210
3234
|
),
|
|
3211
3235
|
/* @__PURE__ */ n(
|
|
@@ -3218,13 +3242,13 @@ const lr = {
|
|
|
3218
3242
|
url: a,
|
|
3219
3243
|
appIcon: d,
|
|
3220
3244
|
cta: m,
|
|
3221
|
-
trailingAction:
|
|
3245
|
+
trailingAction: N
|
|
3222
3246
|
}
|
|
3223
3247
|
)
|
|
3224
3248
|
]
|
|
3225
3249
|
}
|
|
3226
3250
|
);
|
|
3227
|
-
},
|
|
3251
|
+
}, pr = ({
|
|
3228
3252
|
title: e,
|
|
3229
3253
|
description: t,
|
|
3230
3254
|
url: s,
|
|
@@ -3236,25 +3260,25 @@ const lr = {
|
|
|
3236
3260
|
cta: d,
|
|
3237
3261
|
onClick: m
|
|
3238
3262
|
}) => {
|
|
3239
|
-
const g = gn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0,
|
|
3263
|
+
const g = gn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = ze(a, i) ? it : void 0, N = d && m ? {
|
|
3240
3264
|
...d,
|
|
3241
3265
|
onClick: () => {
|
|
3242
|
-
var
|
|
3243
|
-
m(), (
|
|
3266
|
+
var w;
|
|
3267
|
+
m(), (w = d.onClick) == null || w.call(d);
|
|
3244
3268
|
}
|
|
3245
3269
|
} : d;
|
|
3246
3270
|
return /* @__PURE__ */ h(
|
|
3247
|
-
|
|
3271
|
+
Le,
|
|
3248
3272
|
{
|
|
3249
3273
|
variant: "light",
|
|
3250
3274
|
href: f,
|
|
3251
3275
|
onClick: c,
|
|
3252
3276
|
ariaLabel: e ?? "Open attachment preview",
|
|
3253
|
-
bgClassName:
|
|
3277
|
+
bgClassName: b,
|
|
3254
3278
|
"data-testid": "link-attachment",
|
|
3255
3279
|
children: [
|
|
3256
3280
|
l === "featured" && /* @__PURE__ */ n(
|
|
3257
|
-
|
|
3281
|
+
De,
|
|
3258
3282
|
{
|
|
3259
3283
|
variant: "light",
|
|
3260
3284
|
thumbnailUrl: r,
|
|
@@ -3271,7 +3295,7 @@ const lr = {
|
|
|
3271
3295
|
description: t,
|
|
3272
3296
|
url: s,
|
|
3273
3297
|
appIcon: o,
|
|
3274
|
-
cta:
|
|
3298
|
+
cta: N
|
|
3275
3299
|
}
|
|
3276
3300
|
)
|
|
3277
3301
|
]
|
|
@@ -3290,17 +3314,17 @@ const lr = {
|
|
|
3290
3314
|
cta: m,
|
|
3291
3315
|
onClick: g
|
|
3292
3316
|
}) => {
|
|
3293
|
-
const u = gn(r, l), f = at(a), c = m == null && f != null && !u ? f : void 0,
|
|
3317
|
+
const u = gn(r, l), f = at(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
|
|
3294
3318
|
return /* @__PURE__ */ h(
|
|
3295
|
-
|
|
3319
|
+
Le,
|
|
3296
3320
|
{
|
|
3297
3321
|
variant: "dark",
|
|
3298
3322
|
href: c,
|
|
3299
|
-
onClick:
|
|
3300
|
-
bgClassName:
|
|
3323
|
+
onClick: b,
|
|
3324
|
+
bgClassName: ze(r, l) ? it : void 0,
|
|
3301
3325
|
children: [
|
|
3302
3326
|
o === "featured" && /* @__PURE__ */ n(
|
|
3303
|
-
|
|
3327
|
+
De,
|
|
3304
3328
|
{
|
|
3305
3329
|
variant: "dark",
|
|
3306
3330
|
thumbnailUrl: i,
|
|
@@ -3324,20 +3348,20 @@ const lr = {
|
|
|
3324
3348
|
]
|
|
3325
3349
|
}
|
|
3326
3350
|
);
|
|
3327
|
-
},
|
|
3328
|
-
Composer:
|
|
3351
|
+
}, Ii = {
|
|
3352
|
+
Composer: br,
|
|
3329
3353
|
Sent: vr,
|
|
3330
|
-
Received:
|
|
3354
|
+
Received: pr
|
|
3331
3355
|
}, xr = {
|
|
3332
3356
|
dark: "bg-[#121110]",
|
|
3333
3357
|
light: "bg-[#e9eaed]"
|
|
3334
3358
|
}, wr = {
|
|
3335
3359
|
dark: "text-white",
|
|
3336
3360
|
light: "text-[#080707]"
|
|
3337
|
-
},
|
|
3361
|
+
}, Nr = {
|
|
3338
3362
|
dark: "border-white/[0.08]",
|
|
3339
3363
|
light: "border-black/[0.08]"
|
|
3340
|
-
},
|
|
3364
|
+
}, _r = (e) => e === "dark" ? "sender" : "receiver", yr = {
|
|
3341
3365
|
sender: {
|
|
3342
3366
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3343
3367
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3350,7 +3374,7 @@ const lr = {
|
|
|
3350
3374
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3351
3375
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3352
3376
|
}
|
|
3353
|
-
},
|
|
3377
|
+
}, Ce = ({
|
|
3354
3378
|
variant: e,
|
|
3355
3379
|
text: t,
|
|
3356
3380
|
bordered: s = !0,
|
|
@@ -3359,13 +3383,13 @@ const lr = {
|
|
|
3359
3383
|
children: i,
|
|
3360
3384
|
"data-testid": l
|
|
3361
3385
|
}) => {
|
|
3362
|
-
const o = t != null && t !== "", d = yr[
|
|
3386
|
+
const o = t != null && t !== "", d = yr[_r(e)][a];
|
|
3363
3387
|
return /* @__PURE__ */ h(
|
|
3364
3388
|
"div",
|
|
3365
3389
|
{
|
|
3366
3390
|
"data-testid": l,
|
|
3367
3391
|
"data-group-position": a,
|
|
3368
|
-
className:
|
|
3392
|
+
className: _(
|
|
3369
3393
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3370
3394
|
// and keeps the document / image / audio bubbles visually
|
|
3371
3395
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3377,7 +3401,7 @@ const lr = {
|
|
|
3377
3401
|
xr[e],
|
|
3378
3402
|
wr[e],
|
|
3379
3403
|
s && "border",
|
|
3380
|
-
s &&
|
|
3404
|
+
s && Nr[e],
|
|
3381
3405
|
r
|
|
3382
3406
|
),
|
|
3383
3407
|
children: [
|
|
@@ -3385,7 +3409,7 @@ const lr = {
|
|
|
3385
3409
|
o ? /* @__PURE__ */ n(
|
|
3386
3410
|
"p",
|
|
3387
3411
|
{
|
|
3388
|
-
className:
|
|
3412
|
+
className: _(
|
|
3389
3413
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3390
3414
|
// the same font family + size as `.str-chat__message-text`
|
|
3391
3415
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3402,7 +3426,7 @@ const lr = {
|
|
|
3402
3426
|
]
|
|
3403
3427
|
}
|
|
3404
3428
|
);
|
|
3405
|
-
},
|
|
3429
|
+
}, ke = ({
|
|
3406
3430
|
onClick: e,
|
|
3407
3431
|
variant: t = "overlay",
|
|
3408
3432
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3414,13 +3438,13 @@ const lr = {
|
|
|
3414
3438
|
a.stopPropagation(), e();
|
|
3415
3439
|
},
|
|
3416
3440
|
"aria-label": s,
|
|
3417
|
-
className:
|
|
3441
|
+
className: _(
|
|
3418
3442
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3419
3443
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3420
3444
|
),
|
|
3421
|
-
children: /* @__PURE__ */ n(
|
|
3445
|
+
children: /* @__PURE__ */ n(Pe, { className: "size-3", weight: "bold" })
|
|
3422
3446
|
}
|
|
3423
|
-
),
|
|
3447
|
+
), Ee = (e) => e === "received" ? "light" : "dark", Si = ({
|
|
3424
3448
|
firstOfGroup: e,
|
|
3425
3449
|
endOfGroup: t,
|
|
3426
3450
|
groupedByUser: s
|
|
@@ -3452,18 +3476,18 @@ const lr = {
|
|
|
3452
3476
|
preload: o,
|
|
3453
3477
|
onDismiss: d
|
|
3454
3478
|
}) => {
|
|
3455
|
-
const m =
|
|
3479
|
+
const m = Ee(e), g = e === "composer" && !!d, u = Cr({ src: t, mimeType: s, filename: a, items: r });
|
|
3456
3480
|
if (u.length === 0)
|
|
3457
3481
|
return null;
|
|
3458
3482
|
const f = o ?? (u.length > 1 ? "none" : "metadata");
|
|
3459
3483
|
return /* @__PURE__ */ n(
|
|
3460
|
-
|
|
3484
|
+
Ce,
|
|
3461
3485
|
{
|
|
3462
3486
|
variant: m,
|
|
3463
3487
|
text: i,
|
|
3464
3488
|
groupPosition: l,
|
|
3465
3489
|
"data-testid": "audio-attachment",
|
|
3466
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3490
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
|
|
3467
3491
|
kr,
|
|
3468
3492
|
{
|
|
3469
3493
|
item: c,
|
|
@@ -3471,17 +3495,17 @@ const lr = {
|
|
|
3471
3495
|
trailingAction: (
|
|
3472
3496
|
// Composer only supports a single attachment, so the
|
|
3473
3497
|
// dismiss control sits on the only player.
|
|
3474
|
-
g &&
|
|
3498
|
+
g && b === 0 ? /* @__PURE__ */ n(ke, { onClick: d, variant: "inline" }) : void 0
|
|
3475
3499
|
)
|
|
3476
3500
|
},
|
|
3477
|
-
`${c.src}-${
|
|
3501
|
+
`${c.src}-${b}`
|
|
3478
3502
|
)) })
|
|
3479
3503
|
}
|
|
3480
3504
|
);
|
|
3481
|
-
}, Er = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }),
|
|
3505
|
+
}, Er = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), Ir = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), Tr = {
|
|
3482
3506
|
Composer: Er,
|
|
3483
|
-
Sent:
|
|
3484
|
-
Received:
|
|
3507
|
+
Sent: Ir,
|
|
3508
|
+
Received: Sr
|
|
3485
3509
|
};
|
|
3486
3510
|
function Ar(e) {
|
|
3487
3511
|
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`;
|
|
@@ -3529,13 +3553,13 @@ function ae(e) {
|
|
|
3529
3553
|
const Dr = {
|
|
3530
3554
|
dark: "text-white/55",
|
|
3531
3555
|
light: "text-black/65"
|
|
3532
|
-
},
|
|
3556
|
+
}, Pr = {
|
|
3533
3557
|
dark: "bg-white/10",
|
|
3534
3558
|
light: "bg-black/5"
|
|
3535
|
-
},
|
|
3559
|
+
}, zr = {
|
|
3536
3560
|
dark: "text-white/85",
|
|
3537
3561
|
light: "text-black/85"
|
|
3538
|
-
},
|
|
3562
|
+
}, bn = ({
|
|
3539
3563
|
variant: e,
|
|
3540
3564
|
filename: t,
|
|
3541
3565
|
title: s,
|
|
@@ -3548,13 +3572,13 @@ const Dr = {
|
|
|
3548
3572
|
const d = s ?? t ?? "File", m = Lr(a, t, r), g = /* @__PURE__ */ n(
|
|
3549
3573
|
"div",
|
|
3550
3574
|
{
|
|
3551
|
-
className:
|
|
3575
|
+
className: _(
|
|
3552
3576
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3553
|
-
|
|
3577
|
+
Pr[e]
|
|
3554
3578
|
),
|
|
3555
3579
|
"aria-hidden": !0,
|
|
3556
3580
|
children: ce(a, {
|
|
3557
|
-
className:
|
|
3581
|
+
className: _("size-6", zr[e]),
|
|
3558
3582
|
weight: "regular"
|
|
3559
3583
|
})
|
|
3560
3584
|
}
|
|
@@ -3563,7 +3587,7 @@ const Dr = {
|
|
|
3563
3587
|
m ? /* @__PURE__ */ n(
|
|
3564
3588
|
"p",
|
|
3565
3589
|
{
|
|
3566
|
-
className:
|
|
3590
|
+
className: _(
|
|
3567
3591
|
"truncate text-xs leading-4",
|
|
3568
3592
|
Dr[e]
|
|
3569
3593
|
),
|
|
@@ -3576,7 +3600,7 @@ const Dr = {
|
|
|
3576
3600
|
type: "button",
|
|
3577
3601
|
onClick: i,
|
|
3578
3602
|
"aria-label": l,
|
|
3579
|
-
className:
|
|
3603
|
+
className: _(
|
|
3580
3604
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3581
3605
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3582
3606
|
),
|
|
@@ -3585,7 +3609,7 @@ const Dr = {
|
|
|
3585
3609
|
u
|
|
3586
3610
|
]
|
|
3587
3611
|
}
|
|
3588
|
-
) : /* @__PURE__ */ h(
|
|
3612
|
+
) : /* @__PURE__ */ h(se, { children: [
|
|
3589
3613
|
g,
|
|
3590
3614
|
u
|
|
3591
3615
|
] });
|
|
@@ -3594,7 +3618,7 @@ const Dr = {
|
|
|
3594
3618
|
o ? /* @__PURE__ */ n("div", { className: "shrink-0", children: o }) : null
|
|
3595
3619
|
] });
|
|
3596
3620
|
};
|
|
3597
|
-
async function
|
|
3621
|
+
async function pn(e, t) {
|
|
3598
3622
|
const s = t ?? ae(e);
|
|
3599
3623
|
try {
|
|
3600
3624
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -3608,7 +3632,7 @@ async function bn(e, t) {
|
|
|
3608
3632
|
}
|
|
3609
3633
|
}
|
|
3610
3634
|
}
|
|
3611
|
-
const
|
|
3635
|
+
const Or = ({
|
|
3612
3636
|
src: e,
|
|
3613
3637
|
filename: t,
|
|
3614
3638
|
fileSize: s,
|
|
@@ -3624,7 +3648,7 @@ const zr = ({
|
|
|
3624
3648
|
}) => {
|
|
3625
3649
|
const i = t.filename ?? ae(t.src);
|
|
3626
3650
|
return /* @__PURE__ */ n(
|
|
3627
|
-
|
|
3651
|
+
bn,
|
|
3628
3652
|
{
|
|
3629
3653
|
variant: e,
|
|
3630
3654
|
filename: i,
|
|
@@ -3649,50 +3673,50 @@ const zr = ({
|
|
|
3649
3673
|
onClick: m,
|
|
3650
3674
|
onDismiss: g
|
|
3651
3675
|
}) => {
|
|
3652
|
-
const u =
|
|
3676
|
+
const u = Ee(e), f = e === "composer" && !!g, c = Or({
|
|
3653
3677
|
src: t,
|
|
3654
3678
|
filename: s,
|
|
3655
3679
|
fileSize: a,
|
|
3656
3680
|
mimeType: r,
|
|
3657
3681
|
title: i,
|
|
3658
3682
|
items: l
|
|
3659
|
-
}),
|
|
3660
|
-
if ((m == null ? void 0 : m(
|
|
3661
|
-
const
|
|
3662
|
-
if (!
|
|
3663
|
-
const v =
|
|
3664
|
-
|
|
3683
|
+
}), b = (w) => {
|
|
3684
|
+
if ((m == null ? void 0 : m(w)) === !1) return;
|
|
3685
|
+
const p = c[w];
|
|
3686
|
+
if (!p) return;
|
|
3687
|
+
const v = p.filename ?? ae(p.src);
|
|
3688
|
+
pn(p.src, v);
|
|
3665
3689
|
};
|
|
3666
3690
|
if (c.length === 0)
|
|
3667
3691
|
return null;
|
|
3668
|
-
const
|
|
3692
|
+
const N = /* @__PURE__ */ n(
|
|
3669
3693
|
"span",
|
|
3670
3694
|
{
|
|
3671
|
-
className:
|
|
3695
|
+
className: _(
|
|
3672
3696
|
"flex size-8 items-center justify-center rounded-full",
|
|
3673
3697
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3674
3698
|
),
|
|
3675
3699
|
"aria-hidden": !0,
|
|
3676
|
-
children: /* @__PURE__ */ n(
|
|
3700
|
+
children: /* @__PURE__ */ n(Ne, { className: "size-5", weight: "bold" })
|
|
3677
3701
|
}
|
|
3678
3702
|
);
|
|
3679
3703
|
return /* @__PURE__ */ n(
|
|
3680
|
-
|
|
3704
|
+
Ce,
|
|
3681
3705
|
{
|
|
3682
3706
|
variant: u,
|
|
3683
3707
|
text: o,
|
|
3684
3708
|
groupPosition: d,
|
|
3685
3709
|
"data-testid": "file-attachment",
|
|
3686
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3710
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((w, p) => /* @__PURE__ */ n(
|
|
3687
3711
|
$r,
|
|
3688
3712
|
{
|
|
3689
3713
|
variant: u,
|
|
3690
|
-
item:
|
|
3691
|
-
index:
|
|
3692
|
-
onActivate:
|
|
3693
|
-
trailingAction: f &&
|
|
3714
|
+
item: w,
|
|
3715
|
+
index: p,
|
|
3716
|
+
onActivate: b,
|
|
3717
|
+
trailingAction: f && p === 0 ? /* @__PURE__ */ n(ke, { onClick: g, variant: "inline" }) : N
|
|
3694
3718
|
},
|
|
3695
|
-
`${
|
|
3719
|
+
`${w.src}-${p}`
|
|
3696
3720
|
)) })
|
|
3697
3721
|
}
|
|
3698
3722
|
);
|
|
@@ -3705,7 +3729,7 @@ const zr = ({
|
|
|
3705
3729
|
onNext: t,
|
|
3706
3730
|
prevLabel: s = "Previous",
|
|
3707
3731
|
nextLabel: a = "Next"
|
|
3708
|
-
}) => /* @__PURE__ */ h(
|
|
3732
|
+
}) => /* @__PURE__ */ h(se, { children: [
|
|
3709
3733
|
/* @__PURE__ */ n(
|
|
3710
3734
|
"button",
|
|
3711
3735
|
{
|
|
@@ -3723,7 +3747,7 @@ const zr = ({
|
|
|
3723
3747
|
onClick: t,
|
|
3724
3748
|
"aria-label": a,
|
|
3725
3749
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3726
|
-
children: /* @__PURE__ */ n(
|
|
3750
|
+
children: /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3727
3751
|
}
|
|
3728
3752
|
)
|
|
3729
3753
|
] }), vn = ({
|
|
@@ -3737,13 +3761,13 @@ const zr = ({
|
|
|
3737
3761
|
}) => {
|
|
3738
3762
|
const [o, d] = F(!1), m = J(
|
|
3739
3763
|
(c) => {
|
|
3740
|
-
c.stopPropagation(), !o && (d(!0),
|
|
3764
|
+
c.stopPropagation(), !o && (d(!0), pn(e, t).catch(() => {
|
|
3741
3765
|
}).finally(() => {
|
|
3742
3766
|
d(!1), l == null || l();
|
|
3743
3767
|
}));
|
|
3744
3768
|
},
|
|
3745
3769
|
[o, e, t, l]
|
|
3746
|
-
), g = r ?? s !== "pill", f = { className:
|
|
3770
|
+
), g = r ?? s !== "pill", f = { className: _(
|
|
3747
3771
|
s === "pill" ? "size-4" : "size-5",
|
|
3748
3772
|
"shrink-0"
|
|
3749
3773
|
), weight: "bold" };
|
|
@@ -3754,7 +3778,7 @@ const zr = ({
|
|
|
3754
3778
|
onClick: m,
|
|
3755
3779
|
disabled: o,
|
|
3756
3780
|
"aria-label": a,
|
|
3757
|
-
className:
|
|
3781
|
+
className: _(
|
|
3758
3782
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3759
3783
|
{
|
|
3760
3784
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3762,14 +3786,14 @@ const zr = ({
|
|
|
3762
3786
|
}[i]
|
|
3763
3787
|
),
|
|
3764
3788
|
children: o ? /* @__PURE__ */ n(
|
|
3765
|
-
|
|
3789
|
+
we,
|
|
3766
3790
|
{
|
|
3767
3791
|
className: "size-4 animate-spin",
|
|
3768
3792
|
weight: "bold",
|
|
3769
3793
|
"aria-hidden": !0
|
|
3770
3794
|
}
|
|
3771
3795
|
) : /* @__PURE__ */ n(
|
|
3772
|
-
|
|
3796
|
+
Ne,
|
|
3773
3797
|
{
|
|
3774
3798
|
className: "size-5 shrink-0",
|
|
3775
3799
|
weight: "bold",
|
|
@@ -3785,7 +3809,7 @@ const zr = ({
|
|
|
3785
3809
|
disabled: o,
|
|
3786
3810
|
"aria-label": a,
|
|
3787
3811
|
className: "mes-media-viewer__action",
|
|
3788
|
-
children: o ? /* @__PURE__ */ n(
|
|
3812
|
+
children: o ? /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(Ne, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3789
3813
|
}
|
|
3790
3814
|
) : /* @__PURE__ */ h(
|
|
3791
3815
|
"button",
|
|
@@ -3794,33 +3818,33 @@ const zr = ({
|
|
|
3794
3818
|
onClick: m,
|
|
3795
3819
|
disabled: o,
|
|
3796
3820
|
"aria-label": g ? a : void 0,
|
|
3797
|
-
className:
|
|
3821
|
+
className: _(
|
|
3798
3822
|
"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",
|
|
3799
3823
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3800
3824
|
),
|
|
3801
3825
|
children: [
|
|
3802
3826
|
o ? /* @__PURE__ */ n(
|
|
3803
|
-
|
|
3827
|
+
we,
|
|
3804
3828
|
{
|
|
3805
3829
|
className: "size-4 animate-spin",
|
|
3806
3830
|
weight: "bold",
|
|
3807
3831
|
"aria-hidden": !0
|
|
3808
3832
|
}
|
|
3809
|
-
) : /* @__PURE__ */ n(
|
|
3833
|
+
) : /* @__PURE__ */ n(Ne, { ...f, "aria-hidden": !0 }),
|
|
3810
3834
|
g ? null : a
|
|
3811
3835
|
]
|
|
3812
3836
|
}
|
|
3813
3837
|
);
|
|
3814
|
-
},
|
|
3838
|
+
}, Ve = (e, t, s) => Math.min(Math.max(e, t), s), dt = ({
|
|
3815
3839
|
length: e,
|
|
3816
3840
|
initialIndex: t,
|
|
3817
3841
|
open: s
|
|
3818
3842
|
}) => {
|
|
3819
|
-
const a =
|
|
3843
|
+
const a = Ve(t, 0, Math.max(e - 1, 0)), [r, i] = F(a);
|
|
3820
3844
|
K(() => {
|
|
3821
|
-
s && i(
|
|
3845
|
+
s && i(Ve(t, 0, Math.max(e - 1, 0)));
|
|
3822
3846
|
}, [s, t, e]), K(() => {
|
|
3823
|
-
i((d) =>
|
|
3847
|
+
i((d) => Ve(d, 0, Math.max(e - 1, 0)));
|
|
3824
3848
|
}, [e]);
|
|
3825
3849
|
const l = J(() => {
|
|
3826
3850
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
@@ -3845,7 +3869,7 @@ const zr = ({
|
|
|
3845
3869
|
children: i,
|
|
3846
3870
|
"data-testid": l
|
|
3847
3871
|
}) => {
|
|
3848
|
-
const o =
|
|
3872
|
+
const o = Y(null), d = Y(null);
|
|
3849
3873
|
return K(() => {
|
|
3850
3874
|
var f;
|
|
3851
3875
|
const u = o.current;
|
|
@@ -3917,7 +3941,7 @@ const zr = ({
|
|
|
3917
3941
|
onClick: t,
|
|
3918
3942
|
"aria-label": "Close viewer",
|
|
3919
3943
|
className: "mes-media-viewer__action",
|
|
3920
|
-
children: /* @__PURE__ */ n(
|
|
3944
|
+
children: /* @__PURE__ */ n(Pe, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3921
3945
|
}
|
|
3922
3946
|
)
|
|
3923
3947
|
] })
|
|
@@ -3991,14 +4015,14 @@ const zr = ({
|
|
|
3991
4015
|
const r = e.length;
|
|
3992
4016
|
if (r === 0) return null;
|
|
3993
4017
|
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, m, g) => {
|
|
3994
|
-
const u =
|
|
4018
|
+
const u = _(Vr, "h-full w-full");
|
|
3995
4019
|
return t ? /* @__PURE__ */ h(
|
|
3996
4020
|
"button",
|
|
3997
4021
|
{
|
|
3998
4022
|
type: "button",
|
|
3999
4023
|
onClick: () => t(m),
|
|
4000
4024
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
4001
|
-
className:
|
|
4025
|
+
className: _(u, "cursor-zoom-in"),
|
|
4002
4026
|
children: [
|
|
4003
4027
|
d.content,
|
|
4004
4028
|
g
|
|
@@ -4010,10 +4034,10 @@ const zr = ({
|
|
|
4010
4034
|
g
|
|
4011
4035
|
] }, m);
|
|
4012
4036
|
};
|
|
4013
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
4037
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: _("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
4014
4038
|
"div",
|
|
4015
4039
|
{
|
|
4016
|
-
className:
|
|
4040
|
+
className: _(
|
|
4017
4041
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
4018
4042
|
a
|
|
4019
4043
|
),
|
|
@@ -4022,7 +4046,7 @@ const zr = ({
|
|
|
4022
4046
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
4023
4047
|
"div",
|
|
4024
4048
|
{
|
|
4025
|
-
className:
|
|
4049
|
+
className: _(
|
|
4026
4050
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4027
4051
|
a
|
|
4028
4052
|
),
|
|
@@ -4035,7 +4059,7 @@ const zr = ({
|
|
|
4035
4059
|
) : /* @__PURE__ */ n(
|
|
4036
4060
|
"div",
|
|
4037
4061
|
{
|
|
4038
|
-
className:
|
|
4062
|
+
className: _(
|
|
4039
4063
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4040
4064
|
a
|
|
4041
4065
|
),
|
|
@@ -4052,7 +4076,7 @@ const zr = ({
|
|
|
4052
4076
|
})
|
|
4053
4077
|
}
|
|
4054
4078
|
);
|
|
4055
|
-
},
|
|
4079
|
+
}, Ie = (e) => {
|
|
4056
4080
|
const [t, s] = F(!1), [a, r] = F(0), i = J(
|
|
4057
4081
|
(o) => {
|
|
4058
4082
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
@@ -4079,12 +4103,12 @@ const zr = ({
|
|
|
4079
4103
|
src: e,
|
|
4080
4104
|
alt: t,
|
|
4081
4105
|
items: s
|
|
4082
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4106
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], Nn = (e, t) => e.map((s, a) => ({
|
|
4083
4107
|
src: s.src,
|
|
4084
4108
|
alt: s.alt,
|
|
4085
4109
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4086
4110
|
})), Yr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4087
|
-
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } =
|
|
4111
|
+
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Ie(
|
|
4088
4112
|
r
|
|
4089
4113
|
);
|
|
4090
4114
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4108,18 +4132,18 @@ const zr = ({
|
|
|
4108
4132
|
)
|
|
4109
4133
|
}
|
|
4110
4134
|
),
|
|
4111
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4135
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(ke, { onClick: i }) }) : null,
|
|
4112
4136
|
/* @__PURE__ */ n(
|
|
4113
4137
|
xn,
|
|
4114
4138
|
{
|
|
4115
4139
|
open: l,
|
|
4116
|
-
items:
|
|
4140
|
+
items: Nn([{ src: e, alt: t }], s),
|
|
4117
4141
|
initialIndex: o,
|
|
4118
4142
|
onClose: m
|
|
4119
4143
|
}
|
|
4120
4144
|
)
|
|
4121
4145
|
] });
|
|
4122
|
-
},
|
|
4146
|
+
}, _n = ({
|
|
4123
4147
|
state: e,
|
|
4124
4148
|
src: t,
|
|
4125
4149
|
alt: s,
|
|
@@ -4130,36 +4154,36 @@ const zr = ({
|
|
|
4130
4154
|
loading: o = "lazy",
|
|
4131
4155
|
onClick: d
|
|
4132
4156
|
}) => {
|
|
4133
|
-
const m = Hr({ src: t, alt: s, items: r }), g =
|
|
4157
|
+
const m = Hr({ src: t, alt: s, items: r }), g = Ee(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = Ie(
|
|
4134
4158
|
d
|
|
4135
4159
|
);
|
|
4136
4160
|
if (m.length === 0)
|
|
4137
4161
|
return null;
|
|
4138
|
-
const
|
|
4139
|
-
(
|
|
4162
|
+
const N = m.map(
|
|
4163
|
+
(w, p) => Gr(w, p, m.length, o)
|
|
4140
4164
|
);
|
|
4141
4165
|
return /* @__PURE__ */ h(
|
|
4142
|
-
|
|
4166
|
+
Ce,
|
|
4143
4167
|
{
|
|
4144
4168
|
variant: g,
|
|
4145
4169
|
text: i,
|
|
4146
4170
|
groupPosition: l,
|
|
4147
4171
|
"data-testid": "image-attachment",
|
|
4148
4172
|
children: [
|
|
4149
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles:
|
|
4173
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles: N, onTileActivate: c }) }),
|
|
4150
4174
|
/* @__PURE__ */ n(
|
|
4151
4175
|
xn,
|
|
4152
4176
|
{
|
|
4153
4177
|
open: u,
|
|
4154
|
-
items:
|
|
4178
|
+
items: Nn(m, a),
|
|
4155
4179
|
initialIndex: f,
|
|
4156
|
-
onClose:
|
|
4180
|
+
onClose: b
|
|
4157
4181
|
}
|
|
4158
4182
|
)
|
|
4159
4183
|
]
|
|
4160
4184
|
}
|
|
4161
4185
|
);
|
|
4162
|
-
}, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(
|
|
4186
|
+
}, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "sent" }), Xr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "received" }), Kr = {
|
|
4163
4187
|
Composer: qr,
|
|
4164
4188
|
Sent: Wr,
|
|
4165
4189
|
Received: Xr
|
|
@@ -4229,7 +4253,7 @@ const zr = ({
|
|
|
4229
4253
|
}) => {
|
|
4230
4254
|
const i = t.filename ?? ae(t.src);
|
|
4231
4255
|
return /* @__PURE__ */ n(
|
|
4232
|
-
|
|
4256
|
+
bn,
|
|
4233
4257
|
{
|
|
4234
4258
|
variant: e,
|
|
4235
4259
|
filename: i,
|
|
@@ -4253,17 +4277,17 @@ const zr = ({
|
|
|
4253
4277
|
onClick: d,
|
|
4254
4278
|
onDismiss: m
|
|
4255
4279
|
}) => {
|
|
4256
|
-
const g =
|
|
4280
|
+
const g = Ee(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ie(
|
|
4257
4281
|
d
|
|
4258
|
-
),
|
|
4282
|
+
), w = e === "composer" && !!m;
|
|
4259
4283
|
if (u.length === 0)
|
|
4260
4284
|
return null;
|
|
4261
|
-
const
|
|
4285
|
+
const p = u.map((v) => ({
|
|
4262
4286
|
src: v.src,
|
|
4263
4287
|
filename: v.filename ?? ae(v.src)
|
|
4264
4288
|
}));
|
|
4265
4289
|
return /* @__PURE__ */ h(
|
|
4266
|
-
|
|
4290
|
+
Ce,
|
|
4267
4291
|
{
|
|
4268
4292
|
variant: g,
|
|
4269
4293
|
text: l,
|
|
@@ -4271,13 +4295,13 @@ const zr = ({
|
|
|
4271
4295
|
"data-testid": "pdf-attachment",
|
|
4272
4296
|
children: [
|
|
4273
4297
|
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((v, M) => {
|
|
4274
|
-
const
|
|
4298
|
+
const T = v.filename ?? ae(v.src), y = w && M === 0 ? /* @__PURE__ */ n(ke, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4275
4299
|
vn,
|
|
4276
4300
|
{
|
|
4277
4301
|
url: v.src,
|
|
4278
|
-
filename:
|
|
4302
|
+
filename: T,
|
|
4279
4303
|
variant: "inline",
|
|
4280
|
-
label: `Download ${
|
|
4304
|
+
label: `Download ${T}`,
|
|
4281
4305
|
tone: g
|
|
4282
4306
|
}
|
|
4283
4307
|
);
|
|
@@ -4287,8 +4311,8 @@ const zr = ({
|
|
|
4287
4311
|
variant: g,
|
|
4288
4312
|
item: v,
|
|
4289
4313
|
index: M,
|
|
4290
|
-
onActivate:
|
|
4291
|
-
trailingAction:
|
|
4314
|
+
onActivate: b,
|
|
4315
|
+
trailingAction: y
|
|
4292
4316
|
},
|
|
4293
4317
|
`${v.src}-${M}`
|
|
4294
4318
|
);
|
|
@@ -4297,9 +4321,9 @@ const zr = ({
|
|
|
4297
4321
|
Jr,
|
|
4298
4322
|
{
|
|
4299
4323
|
open: f,
|
|
4300
|
-
items:
|
|
4324
|
+
items: p,
|
|
4301
4325
|
initialIndex: c,
|
|
4302
|
-
onClose:
|
|
4326
|
+
onClose: N
|
|
4303
4327
|
}
|
|
4304
4328
|
)
|
|
4305
4329
|
]
|
|
@@ -4359,7 +4383,7 @@ const zr = ({
|
|
|
4359
4383
|
]
|
|
4360
4384
|
}
|
|
4361
4385
|
) : null;
|
|
4362
|
-
}, ri = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(
|
|
4386
|
+
}, ri = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(He, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Cn = ({
|
|
4363
4387
|
item: e,
|
|
4364
4388
|
index: t
|
|
4365
4389
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4398,7 +4422,7 @@ const zr = ({
|
|
|
4398
4422
|
preload: s.preload,
|
|
4399
4423
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4400
4424
|
})), li = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
4401
|
-
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } =
|
|
4425
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } = Ie(
|
|
4402
4426
|
i
|
|
4403
4427
|
);
|
|
4404
4428
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4412,7 +4436,7 @@ const zr = ({
|
|
|
4412
4436
|
children: /* @__PURE__ */ n(Cn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4413
4437
|
}
|
|
4414
4438
|
),
|
|
4415
|
-
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4439
|
+
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(ke, { onClick: l }) }) : null,
|
|
4416
4440
|
/* @__PURE__ */ n(
|
|
4417
4441
|
yn,
|
|
4418
4442
|
{
|
|
@@ -4438,16 +4462,16 @@ const zr = ({
|
|
|
4438
4462
|
preload: d,
|
|
4439
4463
|
onClick: m
|
|
4440
4464
|
}) => {
|
|
4441
|
-
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u =
|
|
4465
|
+
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: N } = Ie(
|
|
4442
4466
|
m
|
|
4443
4467
|
);
|
|
4444
4468
|
if (g.length === 0)
|
|
4445
4469
|
return null;
|
|
4446
|
-
const
|
|
4447
|
-
(
|
|
4470
|
+
const w = g.map(
|
|
4471
|
+
(p, v) => ii(p, v, g.length)
|
|
4448
4472
|
);
|
|
4449
4473
|
return /* @__PURE__ */ h(
|
|
4450
|
-
|
|
4474
|
+
Ce,
|
|
4451
4475
|
{
|
|
4452
4476
|
variant: u,
|
|
4453
4477
|
text: l,
|
|
@@ -4457,8 +4481,8 @@ const zr = ({
|
|
|
4457
4481
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4458
4482
|
wn,
|
|
4459
4483
|
{
|
|
4460
|
-
tiles:
|
|
4461
|
-
onTileActivate:
|
|
4484
|
+
tiles: w,
|
|
4485
|
+
onTileActivate: b,
|
|
4462
4486
|
className: "overflow-hidden rounded-md"
|
|
4463
4487
|
}
|
|
4464
4488
|
) }),
|
|
@@ -4468,7 +4492,7 @@ const zr = ({
|
|
|
4468
4492
|
open: f,
|
|
4469
4493
|
items: kn(g, r),
|
|
4470
4494
|
initialIndex: c,
|
|
4471
|
-
onClose:
|
|
4495
|
+
onClose: N
|
|
4472
4496
|
}
|
|
4473
4497
|
)
|
|
4474
4498
|
]
|
|
@@ -4496,7 +4520,7 @@ const zr = ({
|
|
|
4496
4520
|
onClick: t,
|
|
4497
4521
|
disabled: s,
|
|
4498
4522
|
style: { backgroundColor: "#E6E5E3" },
|
|
4499
|
-
className:
|
|
4523
|
+
className: _(
|
|
4500
4524
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4501
4525
|
{
|
|
4502
4526
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4518,7 +4542,7 @@ const zr = ({
|
|
|
4518
4542
|
const o = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4519
4543
|
return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4520
4544
|
(i || l) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4521
|
-
|
|
4545
|
+
ne,
|
|
4522
4546
|
{
|
|
4523
4547
|
id: l || "account",
|
|
4524
4548
|
name: l || "Account",
|
|
@@ -4553,12 +4577,12 @@ export {
|
|
|
4553
4577
|
va as B,
|
|
4554
4578
|
Xa as C,
|
|
4555
4579
|
Hs as D,
|
|
4556
|
-
|
|
4580
|
+
zs as E,
|
|
4557
4581
|
Ai as F,
|
|
4558
|
-
|
|
4582
|
+
Ii as L,
|
|
4559
4583
|
yi as M,
|
|
4560
|
-
|
|
4561
|
-
|
|
4584
|
+
be as a,
|
|
4585
|
+
ne as b,
|
|
4562
4586
|
rr as c,
|
|
4563
4587
|
mn as d,
|
|
4564
4588
|
Ci as e,
|
|
@@ -4567,7 +4591,7 @@ export {
|
|
|
4567
4591
|
Bt as h,
|
|
4568
4592
|
Ti as i,
|
|
4569
4593
|
Ca as j,
|
|
4570
|
-
|
|
4594
|
+
_i as k,
|
|
4571
4595
|
Ei as l,
|
|
4572
4596
|
Lr as m,
|
|
4573
4597
|
Ar as n,
|
|
@@ -4577,11 +4601,11 @@ export {
|
|
|
4577
4601
|
ce as r,
|
|
4578
4602
|
rn as s,
|
|
4579
4603
|
$s as t,
|
|
4580
|
-
|
|
4604
|
+
Si as u,
|
|
4581
4605
|
Ys as v,
|
|
4582
4606
|
tt as w,
|
|
4583
4607
|
nt as x,
|
|
4584
4608
|
Jt as y,
|
|
4585
4609
|
ki as z
|
|
4586
4610
|
};
|
|
4587
|
-
//# sourceMappingURL=index-
|
|
4611
|
+
//# sourceMappingURL=index-D_U3aScH.js.map
|