@linktr.ee/messaging-react 3.3.13 → 3.4.0-rc-1782373728
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-p74GBYEd.cjs → Card-B9Z659Y-.cjs} +2 -2
- package/dist/{Card-p74GBYEd.cjs.map → Card-B9Z659Y-.cjs.map} +1 -1
- package/dist/{Card-BSIZi_Cu.cjs → Card-C3icBnXT.cjs} +2 -2
- package/dist/{Card-BSIZi_Cu.cjs.map → Card-C3icBnXT.cjs.map} +1 -1
- package/dist/{Card-CI6Trmpw.js → Card-DGkh6_ti.js} +2 -2
- package/dist/{Card-CI6Trmpw.js.map → Card-DGkh6_ti.js.map} +1 -1
- package/dist/{Card-BCFhuR1g.cjs → Card-DVo2e4rF.cjs} +2 -2
- package/dist/{Card-BCFhuR1g.cjs.map → Card-DVo2e4rF.cjs.map} +1 -1
- package/dist/{Card-jmfDlxVY.js → Card-TNeK_nFK.js} +2 -2
- package/dist/{Card-jmfDlxVY.js.map → Card-TNeK_nFK.js.map} +1 -1
- package/dist/{Card-Bl0tPvn7.js → Card-h43tRi_a.js} +3 -3
- package/dist/{Card-Bl0tPvn7.js.map → Card-h43tRi_a.js.map} +1 -1
- package/dist/{LockedThumbnail-qhUBSijq.js → LockedThumbnail-DE3KLtk1.js} +2 -2
- package/dist/{LockedThumbnail-qhUBSijq.js.map → LockedThumbnail-DE3KLtk1.js.map} +1 -1
- package/dist/{LockedThumbnail-yoFQqnl6.cjs → LockedThumbnail-DjFuOEgv.cjs} +2 -2
- package/dist/{LockedThumbnail-yoFQqnl6.cjs.map → LockedThumbnail-DjFuOEgv.cjs.map} +1 -1
- package/dist/index--bjxhW3D.cjs +2 -0
- package/dist/index--bjxhW3D.cjs.map +1 -0
- package/dist/{index-BHFdqj7Z.js → index-DKq7HA0h.js} +874 -845
- package/dist/index-DKq7HA0h.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelView.test.tsx +20 -0
- package/src/components/ChannelView.tsx +43 -7
- package/src/types.ts +11 -0
- package/dist/index-BHFdqj7Z.js.map +0 -1
- package/dist/index-D31aF4s2.cjs +0 -2
- package/dist/index-D31aF4s2.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as n, jsxs as h, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Be, DotsThreeIcon as
|
|
7
|
-
import
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
1
|
+
import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import U, { createContext as Ye, useContext as Ae, useCallback as J, useState as z, useRef as j, useEffect as X, useId as Sn, useMemo as ne, Suspense as qe } from "react";
|
|
3
|
+
import { StreamChatService as In } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Tn, LinkPreviewsManager as At } from "stream-chat";
|
|
5
|
+
import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as We, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as jt, Attachment as Dn, EditMessageModal as On, MessageBlocked as Pn, MessageBouncePrompt as zn, 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 Mt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as xe, 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 De, AIStates as Oe, 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 Be, DotsThreeIcon as hs, SpinnerGapIcon as ke, SignOutIcon as fs, ProhibitInsetIcon as Rt, FlagIcon as Vt, FileIcon as Gt, ImageIcon as gs, SpeakerHighIcon as bs, VideoCameraIcon as Ht, FileMdIcon as ps, FileTextIcon as vs, FileZipIcon as xs, FilePptIcon as ws, FileCsvIcon as _s, FileXlsIcon as Ns, FileDocIcon as ys, FilePdfIcon as Cs, CircleNotchIcon as pe, PlayIcon as Ue, PauseIcon as ks, LinkIcon as Es, DownloadSimpleIcon as ve, GiftIcon as Ss, ThumbsUpIcon as Is, ThumbsDownIcon as Ts, TrashSimpleIcon as As, XIcon as Me, ArrowUpIcon as Ms, SparkleIcon as je, ProhibitIcon as Rs, ArrowLeftIcon as Lt, CaretRightIcon as Ve, PencilSimpleIcon as Ls, CaretLeftIcon as Ds } from "@phosphor-icons/react";
|
|
7
|
+
import C from "classnames";
|
|
8
|
+
import { MessageActions as Os, DefaultDropdownActionButton as Yt } from "stream-chat-react/experimental";
|
|
9
|
+
const qt = Ye({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const Yt = He({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), Xe = () => Ae(qt), Ni = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,10 +24,10 @@ const Yt = He({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const o =
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
var F, T;
|
|
28
|
+
const o = J(
|
|
29
|
+
(E, ...A) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${E}`, ...A);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,77 +37,77 @@ const Yt = He({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [l, d] =
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
40
|
+
const [l, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, b] = z(!1), [w, p] = z(null), v = j(!1), _ = j(null), R = j(s);
|
|
41
|
+
R.current = s;
|
|
42
|
+
const y = j(i);
|
|
43
|
+
y.current = i;
|
|
44
|
+
const M = j({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}), D =
|
|
49
|
+
}), D = j(0);
|
|
50
50
|
D.current++, o("📊 RENDER INFO", {
|
|
51
51
|
renderCount: D.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: M.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: M.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: M.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: M.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), M.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
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
if (!a || !
|
|
65
|
+
const $ = j(null);
|
|
66
|
+
a && ((F = $.current) == null ? void 0 : F.apiKey) !== a && ($.current = { apiKey: a, client: new Tn(a) });
|
|
67
|
+
const L = a ? ((T = $.current) == null ? void 0 : T.client) ?? null : null;
|
|
68
|
+
X(() => {
|
|
69
|
+
const E = D.current, A = R.current;
|
|
70
|
+
if (!a || !L || !A) {
|
|
71
71
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: E,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
o("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: E,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
81
|
+
const O = new In({
|
|
82
82
|
...A,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
84
|
+
debug: y.current,
|
|
85
|
+
client: L
|
|
86
86
|
});
|
|
87
|
-
_.current =
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance:
|
|
87
|
+
_.current = O, d(O), o("✅ SERVICE SET", {
|
|
88
|
+
renderCount: E,
|
|
89
|
+
serviceInstance: !!O
|
|
90
90
|
});
|
|
91
|
-
}, [a,
|
|
92
|
-
const N =
|
|
93
|
-
|
|
94
|
-
var A,
|
|
91
|
+
}, [a, L]);
|
|
92
|
+
const N = j(null);
|
|
93
|
+
X(() => {
|
|
94
|
+
var A, O;
|
|
95
95
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!l,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: v.current,
|
|
100
100
|
isConnected: u,
|
|
101
101
|
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !l || !t) {
|
|
103
103
|
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (v.current) {
|
|
107
107
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((A = N.current) == null ? void 0 : A.serviceId) === l && ((
|
|
110
|
+
if (((A = N.current) == null ? void 0 : A.serviceId) === l && ((O = N.current) == null ? void 0 : O.userId) === t.id) {
|
|
111
111
|
o(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,7 +115,7 @@ const Yt = He({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, b(!0), p(null);
|
|
119
119
|
try {
|
|
120
120
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
121
|
const B = await l.connectUser(t);
|
|
@@ -124,26 +124,26 @@ const Yt = He({
|
|
|
124
124
|
clientId: B.userID
|
|
125
125
|
});
|
|
126
126
|
} catch (B) {
|
|
127
|
-
const
|
|
128
|
-
p(
|
|
127
|
+
const H = B instanceof Error ? B.message : "Connection failed";
|
|
128
|
+
p(H), o("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: H
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
b(!1),
|
|
133
|
+
b(!1), v.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [l, t, o, u]),
|
|
140
|
-
const
|
|
139
|
+
}, [l, t, o, u]), X(() => {
|
|
140
|
+
const E = L;
|
|
141
141
|
return () => {
|
|
142
142
|
var A;
|
|
143
|
-
|
|
143
|
+
E && (N.current = null, (A = _.current) == null || A.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
|
-
}, [
|
|
146
|
-
const
|
|
145
|
+
}, [L]);
|
|
146
|
+
const I = J(async () => {
|
|
147
147
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!l,
|
|
149
149
|
hasUser: !!t
|
|
@@ -154,10 +154,10 @@ const Yt = He({
|
|
|
154
154
|
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
|
|
155
155
|
try {
|
|
156
156
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
157
|
-
const
|
|
158
|
-
g(
|
|
159
|
-
} catch (
|
|
160
|
-
const A =
|
|
157
|
+
const E = await l.connectUser(t);
|
|
158
|
+
g(E), f(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (E) {
|
|
160
|
+
const A = E instanceof Error ? E.message : "Refresh failed";
|
|
161
161
|
p(A), o("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
163
|
error: A
|
|
@@ -165,53 +165,53 @@ const Yt = He({
|
|
|
165
165
|
} finally {
|
|
166
166
|
b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [l, t, o]),
|
|
168
|
+
}, [l, t, o]), S = U.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!l,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
172
172
|
isLoading: c,
|
|
173
|
-
hasError: !!
|
|
173
|
+
hasError: !!w,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
176
|
service: l,
|
|
177
177
|
client: m,
|
|
178
178
|
isConnected: u,
|
|
179
179
|
isLoading: c,
|
|
180
|
-
error:
|
|
180
|
+
error: w,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: I,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
l,
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
w,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
I,
|
|
192
192
|
i,
|
|
193
193
|
o
|
|
194
194
|
]);
|
|
195
195
|
return o("🔄 RENDER END", {
|
|
196
196
|
renderCount: D.current,
|
|
197
|
-
willRenderChat: !!
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(
|
|
200
|
-
|
|
197
|
+
willRenderChat: !!L,
|
|
198
|
+
contextValueReady: !!S
|
|
199
|
+
}), /* @__PURE__ */ n(qt.Provider, { value: S, children: L ? /* @__PURE__ */ n(
|
|
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
|
+
}, Ps = () => Xe(), Wt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = z(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
214
|
+
return X(() => {
|
|
215
215
|
var o;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
@@ -232,14 +232,14 @@ const Yt = He({
|
|
|
232
232
|
function $s(e) {
|
|
233
233
|
return zs.test(e.trim());
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Dt(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
|
-
function
|
|
240
|
-
return
|
|
239
|
+
function Xt(e) {
|
|
240
|
+
return Dt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Dt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
241
241
|
}
|
|
242
|
-
const
|
|
242
|
+
const Ot = [
|
|
243
243
|
"🍎",
|
|
244
244
|
// Apple
|
|
245
245
|
"🍌",
|
|
@@ -276,10 +276,10 @@ function Fs(e) {
|
|
|
276
276
|
return Math.abs(t);
|
|
277
277
|
}
|
|
278
278
|
function Bs(e) {
|
|
279
|
-
const s = Fs(e) %
|
|
280
|
-
return
|
|
279
|
+
const s = Fs(e) % Ot.length;
|
|
280
|
+
return Ot[s];
|
|
281
281
|
}
|
|
282
|
-
const
|
|
282
|
+
const ie = ({
|
|
283
283
|
id: e,
|
|
284
284
|
image: t,
|
|
285
285
|
size: s = 40,
|
|
@@ -299,7 +299,7 @@ const re = ({
|
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
"aria-hidden": "true",
|
|
302
|
-
className:
|
|
302
|
+
className: C(
|
|
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 re = ({
|
|
|
309
309
|
return /* @__PURE__ */ h(
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
|
-
className:
|
|
312
|
+
className: C(
|
|
313
313
|
"relative flex-shrink-0 !bg-transparent",
|
|
314
314
|
a
|
|
315
315
|
),
|
|
@@ -331,7 +331,7 @@ const re = ({
|
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
333
|
"data-testid": "avatar-ring",
|
|
334
|
-
className:
|
|
334
|
+
className: C(
|
|
335
335
|
"h-full w-full",
|
|
336
336
|
"bg-transparent"
|
|
337
337
|
),
|
|
@@ -363,71 +363,71 @@ const re = ({
|
|
|
363
363
|
onActionComplete: m,
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
const { service: u, debug: f } =
|
|
368
|
-
return
|
|
366
|
+
var F;
|
|
367
|
+
const { service: u, debug: f } = Xe(), c = (F = t == null ? void 0 : t.user) == null ? void 0 : F.id, b = !!(a && s && u && c), [w, p] = z(!1), [v, _] = z(null), [R, y] = z(!1), [M, D] = z(!1), $ = b && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== u);
|
|
368
|
+
return X(() => {
|
|
369
369
|
if (!b || !u || !c) {
|
|
370
370
|
p(!1), _(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
let
|
|
373
|
+
let T = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
376
|
+
const E = await u.getBlockedUsers();
|
|
377
|
+
if (T) return;
|
|
378
378
|
p(
|
|
379
|
-
|
|
379
|
+
E.some(
|
|
380
380
|
(A) => A.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
|
-
} catch (
|
|
384
|
-
|
|
383
|
+
} catch (E) {
|
|
384
|
+
T || console.error(`[${g}] Failed to check blocked status:`, E);
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
T || _({ participantId: c, service: u });
|
|
387
387
|
}
|
|
388
388
|
})(), () => {
|
|
389
|
-
|
|
389
|
+
T = !0;
|
|
390
390
|
};
|
|
391
391
|
}, [b, u, c, g]), {
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
394
|
-
isLeaving:
|
|
395
|
-
isUpdatingBlockStatus:
|
|
392
|
+
isParticipantBlocked: w,
|
|
393
|
+
isCheckingBlockedStatus: $,
|
|
394
|
+
isLeaving: R,
|
|
395
|
+
isUpdatingBlockStatus: M,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
398
|
-
if (!
|
|
399
|
-
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid),
|
|
397
|
+
var T;
|
|
398
|
+
if (!R) {
|
|
399
|
+
o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), y(!0);
|
|
400
400
|
try {
|
|
401
|
-
const
|
|
402
|
-
await e.hide(
|
|
403
|
-
} catch (
|
|
404
|
-
console.error(`[${g}] Failed to leave conversation`,
|
|
401
|
+
const E = ((T = e._client) == null ? void 0 : T.userID) ?? null;
|
|
402
|
+
await e.hide(E, !1), r && await r(e), m == null || m();
|
|
403
|
+
} catch (E) {
|
|
404
|
+
console.error(`[${g}] Failed to leave conversation`, E);
|
|
405
405
|
} finally {
|
|
406
|
-
|
|
406
|
+
y(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
412
|
-
if (!(
|
|
413
|
-
l == null || l(), f && console.log(`[${g}] Block member`, (
|
|
411
|
+
var T, E, A;
|
|
412
|
+
if (!(M || !u)) {
|
|
413
|
+
l == null || l(), f && console.log(`[${g}] Block member`, (T = t == null ? void 0 : t.user) == null ? void 0 : T.id), D(!0);
|
|
414
414
|
try {
|
|
415
|
-
await u.blockUser((
|
|
416
|
-
} catch (
|
|
417
|
-
console.error(`[${g}] Failed to block member`,
|
|
415
|
+
await u.blockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), m == null || m();
|
|
416
|
+
} catch (O) {
|
|
417
|
+
console.error(`[${g}] Failed to block member`, O);
|
|
418
418
|
} finally {
|
|
419
419
|
D(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
l == null || l(), f && console.log(`[${g}] Unblock member`, (
|
|
424
|
+
var T, E, A;
|
|
425
|
+
if (!(M || !u)) {
|
|
426
|
+
l == null || l(), f && console.log(`[${g}] Unblock member`, (T = t == null ? void 0 : t.user) == null ? void 0 : T.id), D(!0);
|
|
427
427
|
try {
|
|
428
|
-
await u.unBlockUser((
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
428
|
+
await u.unBlockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), m == null || m();
|
|
429
|
+
} catch (O) {
|
|
430
|
+
console.error(`[${g}] Failed to unblock member`, O);
|
|
431
431
|
} finally {
|
|
432
432
|
D(!1);
|
|
433
433
|
}
|
|
@@ -446,7 +446,7 @@ const re = ({
|
|
|
446
446
|
"button",
|
|
447
447
|
{
|
|
448
448
|
type: "button",
|
|
449
|
-
className:
|
|
449
|
+
className: C(
|
|
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 re = ({
|
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] =
|
|
472
|
-
isParticipantBlocked:
|
|
471
|
+
const [f, c] = z(!1), b = j(null), w = Sn(), p = J(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: v,
|
|
473
473
|
isCheckingBlockedStatus: _,
|
|
474
|
-
isLeaving:
|
|
475
|
-
isUpdatingBlockStatus:
|
|
476
|
-
handleLeaveConversation:
|
|
474
|
+
isLeaving: R,
|
|
475
|
+
isUpdatingBlockStatus: y,
|
|
476
|
+
handleLeaveConversation: M,
|
|
477
477
|
handleBlockUser: D,
|
|
478
|
-
handleUnblockUser:
|
|
479
|
-
handleReportUser:
|
|
478
|
+
handleUnblockUser: $,
|
|
479
|
+
handleReportUser: L
|
|
480
480
|
} = js({
|
|
481
481
|
channel: e,
|
|
482
482
|
participant: t,
|
|
@@ -490,15 +490,15 @@ const re = ({
|
|
|
490
490
|
onActionComplete: p,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
|
-
return
|
|
493
|
+
return X(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
b.current && !b.current.contains(
|
|
497
|
-
},
|
|
498
|
-
|
|
495
|
+
const I = (F) => {
|
|
496
|
+
b.current && !b.current.contains(F.target) && c(!1);
|
|
497
|
+
}, S = (F) => {
|
|
498
|
+
F.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
500
|
+
return document.addEventListener("mousedown", I), document.addEventListener("keydown", S), () => {
|
|
501
|
+
document.removeEventListener("mousedown", I), document.removeEventListener("keydown", S);
|
|
502
502
|
};
|
|
503
503
|
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
@@ -508,10 +508,10 @@ const re = ({
|
|
|
508
508
|
type: "button",
|
|
509
509
|
"aria-haspopup": "true",
|
|
510
510
|
"aria-expanded": f,
|
|
511
|
-
"aria-controls": f ?
|
|
512
|
-
onClick: () => c((
|
|
511
|
+
"aria-controls": f ? w : void 0,
|
|
512
|
+
onClick: () => c((I) => !I),
|
|
513
513
|
children: [
|
|
514
|
-
/* @__PURE__ */ n(
|
|
514
|
+
/* @__PURE__ */ n(hs, { className: "size-5 text-black/90" }),
|
|
515
515
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
516
516
|
]
|
|
517
517
|
}
|
|
@@ -519,9 +519,9 @@ const re = ({
|
|
|
519
519
|
f && /* @__PURE__ */ n(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
|
-
id:
|
|
522
|
+
id: w,
|
|
523
523
|
"aria-label": "Conversation options",
|
|
524
|
-
className:
|
|
524
|
+
className: C(
|
|
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
|
),
|
|
@@ -529,11 +529,11 @@ const re = ({
|
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
530
|
ge,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
534
|
-
"aria-busy":
|
|
532
|
+
onClick: M,
|
|
533
|
+
disabled: R,
|
|
534
|
+
"aria-busy": R,
|
|
535
535
|
children: [
|
|
536
|
-
|
|
536
|
+
R ? /* @__PURE__ */ n(ke, { 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
|
}
|
|
@@ -545,14 +545,14 @@ const re = ({
|
|
|
545
545
|
/* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
548
|
+
) : v ? /* @__PURE__ */ h(
|
|
549
549
|
ge,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
552
|
-
disabled:
|
|
553
|
-
"aria-busy":
|
|
551
|
+
onClick: $,
|
|
552
|
+
disabled: y,
|
|
553
|
+
"aria-busy": y,
|
|
554
554
|
children: [
|
|
555
|
-
|
|
555
|
+
y ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
|
|
556
556
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
557
|
]
|
|
558
558
|
}
|
|
@@ -560,16 +560,16 @@ const re = ({
|
|
|
560
560
|
ge,
|
|
561
561
|
{
|
|
562
562
|
onClick: D,
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
563
|
+
disabled: y,
|
|
564
|
+
"aria-busy": y,
|
|
565
565
|
children: [
|
|
566
|
-
|
|
566
|
+
y ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { 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(ge, { variant: "danger", onClick:
|
|
572
|
-
/* @__PURE__ */ n(
|
|
571
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick: L, children: [
|
|
572
|
+
/* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
575
575
|
g
|
|
@@ -577,30 +577,30 @@ const re = ({
|
|
|
577
577
|
}
|
|
578
578
|
)
|
|
579
579
|
] });
|
|
580
|
-
}, Vs = (e) => /* @__PURE__ */ n(
|
|
580
|
+
}, Vs = (e) => /* @__PURE__ */ n(Mn, { ...e, position: "center" }), Ge = "vote_up", He = "vote_down";
|
|
581
581
|
function Gs(e) {
|
|
582
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
582
|
+
return e != null && e.length ? e.some((t) => t.type === He) ? "down" : e.some((t) => t.type === Ge) ? "up" : null : null;
|
|
583
583
|
}
|
|
584
584
|
function Hs(e) {
|
|
585
|
-
const { channel: t } = de(), { client: s } =
|
|
585
|
+
const { channel: t } = de(), { client: s } = We("useMessageVote"), a = ne(
|
|
586
586
|
() => Gs(e.own_reactions),
|
|
587
587
|
[e.own_reactions]
|
|
588
|
-
), r =
|
|
588
|
+
), r = J(async () => {
|
|
589
589
|
if (s != null && s.userID)
|
|
590
590
|
try {
|
|
591
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
591
|
+
a === "up" ? await t.deleteReaction(e.id, Ge) : await t.sendReaction(
|
|
592
592
|
e.id,
|
|
593
|
-
{ type:
|
|
593
|
+
{ type: Ge },
|
|
594
594
|
{ enforce_unique: !0, skip_push: !0 }
|
|
595
595
|
);
|
|
596
596
|
} catch {
|
|
597
597
|
}
|
|
598
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
598
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = J(async () => {
|
|
599
599
|
if (s != null && s.userID)
|
|
600
600
|
try {
|
|
601
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
601
|
+
a === "down" ? await t.deleteReaction(e.id, He) : await t.sendReaction(
|
|
602
602
|
e.id,
|
|
603
|
-
{ type:
|
|
603
|
+
{ type: He },
|
|
604
604
|
{ enforce_unique: !0, skip_push: !0 }
|
|
605
605
|
);
|
|
606
606
|
} catch {
|
|
@@ -611,7 +611,7 @@ function Hs(e) {
|
|
|
611
611
|
function Ys(e) {
|
|
612
612
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Kt({
|
|
615
615
|
message: e,
|
|
616
616
|
viewerLanguage: t
|
|
617
617
|
}) {
|
|
@@ -619,13 +619,13 @@ function Xt({
|
|
|
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 =
|
|
622
|
+
const qs = U.lazy(() => import("./Card-DGkh6_ti.js")), Ws = U.lazy(() => import("./Card-TNeK_nFK.js")), Xs = U.lazy(() => import("./Card-h43tRi_a.js")), Ke = () => /* @__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)]",
|
|
626
626
|
"aria-hidden": !0
|
|
627
627
|
}
|
|
628
|
-
), Ks = (e) => /* @__PURE__ */ n(
|
|
628
|
+
), Ks = (e) => /* @__PURE__ */ n(qe, { fallback: /* @__PURE__ */ n(Ke, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(qe, { fallback: /* @__PURE__ */ n(Ke, {}), children: /* @__PURE__ */ n(Ws, { ...e }) }), Zt = (e) => /* @__PURE__ */ n(qe, { fallback: /* @__PURE__ */ n(Ke, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Js = Jt, Zs = Zt, zt = { Composer: Ks, Sent: Jt, Received: Zt, Creator: Js, Visitor: Zs }, Qs = [
|
|
629
629
|
[/pdf/, "pdf"],
|
|
630
630
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
631
631
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -635,37 +635,37 @@ const qs = j.lazy(() => import("./Card-CI6Trmpw.js")), Ws = j.lazy(() => import(
|
|
|
635
635
|
[/plain|rtf/, "text"],
|
|
636
636
|
[/markdown/, "markdown"]
|
|
637
637
|
];
|
|
638
|
-
function
|
|
638
|
+
function ae(e) {
|
|
639
639
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Qt(e) {
|
|
642
642
|
const t = Qs.find(
|
|
643
643
|
([s]) => s.test(e)
|
|
644
644
|
);
|
|
645
645
|
return t ? t[1] : "generic";
|
|
646
646
|
}
|
|
647
647
|
const ea = {
|
|
648
|
-
video:
|
|
649
|
-
audio:
|
|
650
|
-
image:
|
|
651
|
-
document:
|
|
648
|
+
video: Ht,
|
|
649
|
+
audio: bs,
|
|
650
|
+
image: gs,
|
|
651
|
+
document: Gt
|
|
652
652
|
}, ta = {
|
|
653
|
-
pdf:
|
|
654
|
-
doc:
|
|
655
|
-
xls:
|
|
656
|
-
csv:
|
|
657
|
-
ppt:
|
|
658
|
-
zip:
|
|
659
|
-
text:
|
|
660
|
-
markdown:
|
|
661
|
-
generic:
|
|
653
|
+
pdf: Cs,
|
|
654
|
+
doc: ys,
|
|
655
|
+
xls: Ns,
|
|
656
|
+
csv: _s,
|
|
657
|
+
ppt: ws,
|
|
658
|
+
zip: xs,
|
|
659
|
+
text: vs,
|
|
660
|
+
markdown: ps,
|
|
661
|
+
generic: Gt
|
|
662
662
|
};
|
|
663
663
|
function na(e) {
|
|
664
|
-
const t =
|
|
665
|
-
return t !== "document" ? ea[t] : ta[
|
|
664
|
+
const t = ae(e);
|
|
665
|
+
return t !== "document" ? ea[t] : ta[Qt(e)];
|
|
666
666
|
}
|
|
667
667
|
function ce(e, t) {
|
|
668
|
-
return
|
|
668
|
+
return U.createElement(na(e), t);
|
|
669
669
|
}
|
|
670
670
|
const sa = (e) => {
|
|
671
671
|
var t, s;
|
|
@@ -682,78 +682,78 @@ const sa = (e) => {
|
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: m
|
|
684
684
|
}) => {
|
|
685
|
-
const g =
|
|
686
|
-
|
|
687
|
-
}, []),
|
|
685
|
+
const g = ae(t), u = j(null), f = j(null), c = j(null), b = j(r), [w, p] = z(a), [v, _] = z(0), [R, y] = z(!1), [M, D] = z(!1), [$, L] = z(!1), [N, I] = z(!1), [S, F] = z(!0), [T, E] = z(null), A = J(() => {
|
|
686
|
+
L(!1), p(!0);
|
|
687
|
+
}, []), O = J((x) => {
|
|
688
688
|
const k = f.current;
|
|
689
689
|
if (!k) return 0;
|
|
690
|
-
const
|
|
690
|
+
const P = k.getBoundingClientRect();
|
|
691
691
|
return Math.max(
|
|
692
692
|
0,
|
|
693
|
-
Math.min(1, (sa(
|
|
693
|
+
Math.min(1, (sa(x) - P.left) / P.width)
|
|
694
694
|
);
|
|
695
|
-
}, []), B =
|
|
695
|
+
}, []), B = J((x) => {
|
|
696
696
|
const k = u.current;
|
|
697
|
-
k && k.duration && (k.currentTime =
|
|
698
|
-
}, []),
|
|
699
|
-
|
|
700
|
-
const k =
|
|
697
|
+
k && k.duration && (k.currentTime = x * k.duration);
|
|
698
|
+
}, []), H = (x) => {
|
|
699
|
+
x.stopPropagation(), y(!0);
|
|
700
|
+
const k = O(x);
|
|
701
701
|
_(k), B(k);
|
|
702
702
|
};
|
|
703
|
-
|
|
703
|
+
X(() => {
|
|
704
704
|
r !== void 0 && r !== b.current && (b.current = r, p(r));
|
|
705
|
-
}, [r]),
|
|
706
|
-
if (!
|
|
705
|
+
}, [r]), X(() => {
|
|
706
|
+
if (!w) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
|
-
const
|
|
710
|
+
const x = () => {
|
|
711
711
|
const k = u.current;
|
|
712
|
-
k && k.duration && !
|
|
712
|
+
k && k.duration && !R && _(k.currentTime / k.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
|
-
p(!1),
|
|
721
|
-
}) :
|
|
722
|
-
}, [
|
|
723
|
-
if (!
|
|
724
|
-
const
|
|
725
|
-
|
|
717
|
+
}, [w, R]), X(() => {
|
|
718
|
+
const x = u.current;
|
|
719
|
+
x && (w ? x.play().catch((k) => {
|
|
720
|
+
p(!1), L(!0);
|
|
721
|
+
}) : x.pause());
|
|
722
|
+
}, [w]), X(() => {
|
|
723
|
+
if (!R) return;
|
|
724
|
+
const x = (P) => _(O(P)), k = (P) => {
|
|
725
|
+
y(!1), B(O(P));
|
|
726
726
|
};
|
|
727
|
-
return window.addEventListener("mousemove",
|
|
728
|
-
window.removeEventListener("mousemove",
|
|
727
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", k), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", k), () => {
|
|
728
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", k);
|
|
729
729
|
};
|
|
730
|
-
}, [
|
|
731
|
-
const
|
|
730
|
+
}, [R, O, B]);
|
|
731
|
+
const V = T ? { aspectRatio: String(T) } : void 0, Y = T ? "" : " aspect-video", q = Math.round(v * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
735
735
|
role: "button",
|
|
736
736
|
tabIndex: 0,
|
|
737
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
738
|
-
style:
|
|
739
|
-
onClick: (
|
|
737
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${Y}`,
|
|
738
|
+
style: V,
|
|
739
|
+
onClick: (x) => {
|
|
740
740
|
if (m) {
|
|
741
|
-
m(
|
|
741
|
+
m(x);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
$ || o && p((k) => !k);
|
|
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
|
+
$ || o && p((k) => !k);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
756
|
+
s && (g === "audio" || S) && /* @__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" || S) && /* @__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
|
}) }),
|
|
@@ -773,12 +773,12 @@ const sa = (e) => {
|
|
|
773
773
|
loop: i,
|
|
774
774
|
muted: d,
|
|
775
775
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
776
|
+
onLoadStart: () => I(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
|
|
778
|
+
I(!1), F(!1);
|
|
779
779
|
},
|
|
780
|
-
onWaiting: () =>
|
|
781
|
-
onPlay: () =>
|
|
780
|
+
onWaiting: () => I(!0),
|
|
781
|
+
onPlay: () => L(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
783
|
i || (p(!1), _(0));
|
|
784
784
|
},
|
|
@@ -793,15 +793,15 @@ const sa = (e) => {
|
|
|
793
793
|
muted: d,
|
|
794
794
|
playsInline: !0,
|
|
795
795
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
796
|
+
onLoadStart: () => I(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
|
|
798
|
+
I(!1), F(!1);
|
|
799
799
|
},
|
|
800
|
-
onWaiting: () =>
|
|
801
|
-
onPlay: () =>
|
|
800
|
+
onWaiting: () => I(!0),
|
|
801
|
+
onPlay: () => L(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
|
-
const
|
|
804
|
-
|
|
803
|
+
const x = u.current;
|
|
804
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && E(x.videoWidth / x.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
807
|
i || (p(!1), _(0));
|
|
@@ -809,25 +809,25 @@ const sa = (e) => {
|
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
N &&
|
|
812
|
+
N && !$ && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
813
|
pe,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
$ && !o && /* @__PURE__ */ n(
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
822
822
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
823
823
|
role: "button",
|
|
824
824
|
tabIndex: 0,
|
|
825
825
|
"aria-label": "Play preview",
|
|
826
|
-
onClick: (
|
|
827
|
-
|
|
826
|
+
onClick: (x) => {
|
|
827
|
+
x.stopPropagation(), A();
|
|
828
828
|
},
|
|
829
|
-
onKeyDown: (
|
|
830
|
-
|
|
829
|
+
onKeyDown: (x) => {
|
|
830
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), A());
|
|
831
831
|
},
|
|
832
832
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Ue, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
@@ -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": q,
|
|
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: H,
|
|
847
|
+
onTouchStart: H,
|
|
848
|
+
onClick: (x) => x.stopPropagation(),
|
|
849
|
+
onKeyDown: (x) => {
|
|
850
|
+
x.key === "ArrowRight" && B(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, v - 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: `${q}%` }
|
|
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(), p((k) => !k);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
870
|
+
"aria-label": w ? "Pause" : "Play",
|
|
871
|
+
children: w ? /* @__PURE__ */ n(ks, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ue, { 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": q,
|
|
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: (
|
|
885
|
+
onMouseDown: H,
|
|
886
|
+
onTouchStart: H,
|
|
887
|
+
onClick: (x) => x.stopPropagation(),
|
|
888
888
|
onMouseEnter: () => D(!0),
|
|
889
889
|
onMouseLeave: () => D(!1),
|
|
890
|
-
onKeyDown: (
|
|
891
|
-
|
|
890
|
+
onKeyDown: (x) => {
|
|
891
|
+
x.key === "ArrowRight" && B(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, v - 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 ${M || R ? "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: `${q}%` }
|
|
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 ${M || R ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
|
+
style: { left: `${q}%` }
|
|
912
912
|
}
|
|
913
913
|
)
|
|
914
914
|
]
|
|
@@ -918,7 +918,7 @@ const sa = (e) => {
|
|
|
918
918
|
]
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
|
-
},
|
|
921
|
+
}, $t = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", ra = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", en = ({
|
|
922
922
|
mimeType: e,
|
|
923
923
|
sourceUrl: t,
|
|
924
924
|
thumbnailUrl: s,
|
|
@@ -927,7 +927,7 @@ const sa = (e) => {
|
|
|
927
927
|
mediaPlayerProps: i,
|
|
928
928
|
containedImage: o = !1
|
|
929
929
|
}) => {
|
|
930
|
-
const l =
|
|
930
|
+
const l = ae(e), [d, m] = z(!1);
|
|
931
931
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
932
932
|
aa,
|
|
933
933
|
{
|
|
@@ -976,7 +976,7 @@ const sa = (e) => {
|
|
|
976
976
|
{
|
|
977
977
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
978
978
|
children: ce(e, {
|
|
979
|
-
className:
|
|
979
|
+
className: $t(r),
|
|
980
980
|
weight: "regular"
|
|
981
981
|
})
|
|
982
982
|
}
|
|
@@ -993,12 +993,12 @@ const sa = (e) => {
|
|
|
993
993
|
{
|
|
994
994
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
995
|
children: ce(e, {
|
|
996
|
-
className:
|
|
996
|
+
className: $t(r),
|
|
997
997
|
weight: "regular"
|
|
998
998
|
})
|
|
999
999
|
}
|
|
1000
1000
|
);
|
|
1001
|
-
},
|
|
1001
|
+
}, tn = ({
|
|
1002
1002
|
variant: e,
|
|
1003
1003
|
thumbnail: t,
|
|
1004
1004
|
title: s,
|
|
@@ -1018,7 +1018,7 @@ const sa = (e) => {
|
|
|
1018
1018
|
{
|
|
1019
1019
|
ref: g,
|
|
1020
1020
|
"data-testid": u,
|
|
1021
|
-
className:
|
|
1021
|
+
className: C(
|
|
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,7 +1030,7 @@ const sa = (e) => {
|
|
|
1030
1030
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1031
1031
|
"p",
|
|
1032
1032
|
{
|
|
1033
|
-
className:
|
|
1033
|
+
className: C("mb-0.5 truncate text-base font-medium", {
|
|
1034
1034
|
"text-black": !f,
|
|
1035
1035
|
"text-white/30": f && b,
|
|
1036
1036
|
"text-white": f && !b
|
|
@@ -1040,7 +1040,7 @@ const sa = (e) => {
|
|
|
1040
1040
|
),
|
|
1041
1041
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
1042
|
ce(r, {
|
|
1043
|
-
className:
|
|
1043
|
+
className: C(
|
|
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: C(
|
|
1053
1053
|
"text-xs font-medium",
|
|
1054
1054
|
f ? "text-white/55" : "text-black/55"
|
|
1055
1055
|
),
|
|
@@ -1064,10 +1064,10 @@ const sa = (e) => {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
);
|
|
1066
1066
|
};
|
|
1067
|
-
function
|
|
1067
|
+
function nn(e) {
|
|
1068
1068
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Je(e) {
|
|
1071
1071
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1072
1072
|
}
|
|
1073
1073
|
function ia(e) {
|
|
@@ -1085,8 +1085,8 @@ function ca(e) {
|
|
|
1085
1085
|
function da(e) {
|
|
1086
1086
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1087
|
}
|
|
1088
|
-
const
|
|
1089
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(
|
|
1088
|
+
const Ze = ({ attachment: e, isMyMessage: t }) => {
|
|
1089
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(U.Fragment, { children: [
|
|
1090
1090
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1091
|
"img",
|
|
1092
1092
|
{
|
|
@@ -1098,7 +1098,7 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1098
1098
|
"div",
|
|
1099
1099
|
{
|
|
1100
1100
|
className: `aspect-video w-full rounded-[20px] ${ia(t)} flex items-center justify-center`,
|
|
1101
|
-
children: /* @__PURE__ */ n(
|
|
1101
|
+
children: /* @__PURE__ */ n(Es, { className: `size-12 ${da(t)}` })
|
|
1102
1102
|
}
|
|
1103
1103
|
) }),
|
|
1104
1104
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
@@ -1109,12 +1109,12 @@ const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1109
1109
|
] });
|
|
1110
1110
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
|
|
1111
1111
|
};
|
|
1112
|
-
function
|
|
1112
|
+
function sn(e) {
|
|
1113
1113
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function Qe(e) {
|
|
1116
1116
|
var t;
|
|
1117
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1117
|
+
return (t = e.attachments) == null ? void 0 : t.find(sn);
|
|
1118
1118
|
}
|
|
1119
1119
|
async function ua(e, t) {
|
|
1120
1120
|
let s;
|
|
@@ -1132,7 +1132,7 @@ const ma = ({
|
|
|
1132
1132
|
url: e,
|
|
1133
1133
|
filename: t
|
|
1134
1134
|
}) => {
|
|
1135
|
-
const [s, a] =
|
|
1135
|
+
const [s, a] = z(!1);
|
|
1136
1136
|
return /* @__PURE__ */ n(
|
|
1137
1137
|
"button",
|
|
1138
1138
|
{
|
|
@@ -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(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(
|
|
1151
|
+
children: s ? /* @__PURE__ */ n(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(U.Fragment, { children: [
|
|
1152
1152
|
/* @__PURE__ */ n(ve, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
|
-
function
|
|
1158
|
+
function et(e) {
|
|
1159
1159
|
var u, f, c, b;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
|
-
(
|
|
1161
|
+
(w) => w.type === "video" && w.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1163
|
+
(w) => w.type === "image" && w.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1165
|
+
(w) => w.type === "audio" && w.asset_url
|
|
1166
1166
|
), r = (b = e.attachments) == null ? void 0 : b.find(
|
|
1167
|
-
(
|
|
1167
|
+
(w) => w.type === "file" && w.asset_url
|
|
1168
1168
|
), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
1169
|
if (!o) return null;
|
|
1170
1170
|
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -1176,16 +1176,16 @@ function Qe(e) {
|
|
|
1176
1176
|
thumbnailUrl: g
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
1179
|
-
const
|
|
1179
|
+
const an = ({
|
|
1180
1180
|
resolvedUrl: e,
|
|
1181
1181
|
resolvedType: t,
|
|
1182
1182
|
title: s,
|
|
1183
1183
|
fileSize: a,
|
|
1184
1184
|
thumbnailUrl: r
|
|
1185
1185
|
}) => {
|
|
1186
|
-
const i = a !== void 0 ?
|
|
1186
|
+
const i = a !== void 0 ? nn(a) : void 0;
|
|
1187
1187
|
return /* @__PURE__ */ n(
|
|
1188
|
-
|
|
1188
|
+
tn,
|
|
1189
1189
|
{
|
|
1190
1190
|
variant: "dark",
|
|
1191
1191
|
title: s,
|
|
@@ -1193,7 +1193,7 @@ const sn = ({
|
|
|
1193
1193
|
mimeType: t,
|
|
1194
1194
|
detail: i,
|
|
1195
1195
|
thumbnail: /* @__PURE__ */ n(
|
|
1196
|
-
|
|
1196
|
+
en,
|
|
1197
1197
|
{
|
|
1198
1198
|
mimeType: t,
|
|
1199
1199
|
sourceUrl: e,
|
|
@@ -1204,23 +1204,23 @@ const sn = ({
|
|
|
1204
1204
|
)
|
|
1205
1205
|
}
|
|
1206
1206
|
);
|
|
1207
|
-
},
|
|
1207
|
+
}, rn = ({
|
|
1208
1208
|
resolvedUrl: e,
|
|
1209
1209
|
resolvedType: t,
|
|
1210
1210
|
title: s,
|
|
1211
1211
|
fileSize: a,
|
|
1212
1212
|
thumbnailUrl: r
|
|
1213
1213
|
}) => {
|
|
1214
|
-
const i =
|
|
1214
|
+
const i = ae(t), o = a !== void 0 ? nn(a) : void 0;
|
|
1215
1215
|
return /* @__PURE__ */ n(
|
|
1216
|
-
|
|
1216
|
+
tn,
|
|
1217
1217
|
{
|
|
1218
1218
|
variant: "light",
|
|
1219
1219
|
title: s,
|
|
1220
1220
|
mimeType: t,
|
|
1221
1221
|
detail: o,
|
|
1222
1222
|
thumbnail: /* @__PURE__ */ n(
|
|
1223
|
-
|
|
1223
|
+
en,
|
|
1224
1224
|
{
|
|
1225
1225
|
mimeType: t,
|
|
1226
1226
|
sourceUrl: e,
|
|
@@ -1237,10 +1237,10 @@ const sn = ({
|
|
|
1237
1237
|
message: e,
|
|
1238
1238
|
isMyMessage: t = !1
|
|
1239
1239
|
}) => {
|
|
1240
|
-
const s =
|
|
1240
|
+
const s = Qe(e), a = et(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
|
+
ie,
|
|
1244
1244
|
{
|
|
1245
1245
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1246
1246
|
id: e.user.id,
|
|
@@ -1258,7 +1258,7 @@ const sn = ({
|
|
|
1258
1258
|
{
|
|
1259
1259
|
className: "str-chat__message-bubble",
|
|
1260
1260
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1261
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1261
|
+
children: s ? /* @__PURE__ */ n("div", { className: Je(t), children: /* @__PURE__ */ n(Ze, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(an, { ...a }) : /* @__PURE__ */ n(rn, { ...a })
|
|
1262
1262
|
}
|
|
1263
1263
|
) })
|
|
1264
1264
|
}
|
|
@@ -1267,19 +1267,19 @@ const sn = ({
|
|
|
1267
1267
|
}, fa = ({
|
|
1268
1268
|
message: e
|
|
1269
1269
|
}) => {
|
|
1270
|
-
const t =
|
|
1270
|
+
const t = Qe(e);
|
|
1271
1271
|
if (t)
|
|
1272
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1273
|
-
const s =
|
|
1274
|
-
return s ? /* @__PURE__ */ n(
|
|
1272
|
+
return /* @__PURE__ */ n("div", { className: Je(!0), children: /* @__PURE__ */ n(Ze, { attachment: t, isMyMessage: !0 }) });
|
|
1273
|
+
const s = et(e);
|
|
1274
|
+
return s ? /* @__PURE__ */ n(an, { ...s }) : null;
|
|
1275
1275
|
}, ga = ({
|
|
1276
1276
|
message: e
|
|
1277
1277
|
}) => {
|
|
1278
|
-
const t =
|
|
1278
|
+
const t = Qe(e);
|
|
1279
1279
|
if (t)
|
|
1280
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1281
|
-
const s =
|
|
1282
|
-
return s ? /* @__PURE__ */ n(
|
|
1280
|
+
return /* @__PURE__ */ n("div", { className: Je(!1), children: /* @__PURE__ */ n(Ze, { attachment: t, isMyMessage: !1 }) });
|
|
1281
|
+
const s = et(e);
|
|
1282
|
+
return s ? /* @__PURE__ */ n(rn, { ...s }) : null;
|
|
1283
1283
|
}, yi = Object.assign(ha, {
|
|
1284
1284
|
Creator: fa,
|
|
1285
1285
|
Visitor: ga
|
|
@@ -1287,9 +1287,9 @@ const sn = ({
|
|
|
1287
1287
|
isUnlocking: () => !1
|
|
1288
1288
|
}, pa = {
|
|
1289
1289
|
LockedAttachment: ba
|
|
1290
|
-
},
|
|
1290
|
+
}, on = Ye({}), Ci = on.Provider;
|
|
1291
1291
|
function va(e) {
|
|
1292
|
-
return Ae(
|
|
1292
|
+
return Ae(on)[e] ?? pa[e];
|
|
1293
1293
|
}
|
|
1294
1294
|
const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1295
|
"svg",
|
|
@@ -1320,17 +1320,17 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1320
1320
|
}, Na = (e) => {
|
|
1321
1321
|
var t;
|
|
1322
1322
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1323
|
-
},
|
|
1323
|
+
}, ln = (e) => wa(e) || _a(e), ya = (e) => {
|
|
1324
1324
|
var t;
|
|
1325
|
-
return
|
|
1326
|
-
},
|
|
1325
|
+
return ln(e) && !((t = e.text) != null && t.trim());
|
|
1326
|
+
}, Pe = ({
|
|
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 =
|
|
1333
|
+
const r = ln(e), i = Ee(e);
|
|
1334
1334
|
if (!r && !i)
|
|
1335
1335
|
return null;
|
|
1336
1336
|
if (r) {
|
|
@@ -1338,7 +1338,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1338
1338
|
if (!f) return null;
|
|
1339
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(
|
|
1341
|
+
/* @__PURE__ */ n(Ss, { size: t ? 14 : 12 }),
|
|
1342
1342
|
/* @__PURE__ */ n("span", { children: b })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
@@ -1347,10 +1347,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1347
1347
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
1348
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
1349
|
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(xa, { size: o ? 12 : 15 }) });
|
|
1350
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(
|
|
1350
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(se, { children: [
|
|
1351
1351
|
m,
|
|
1352
1352
|
g
|
|
1353
|
-
] }) : /* @__PURE__ */ h(
|
|
1353
|
+
] }) : /* @__PURE__ */ h(se, { children: [
|
|
1354
1354
|
g,
|
|
1355
1355
|
m
|
|
1356
1356
|
] }) });
|
|
@@ -1363,32 +1363,32 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1363
1363
|
"button",
|
|
1364
1364
|
{
|
|
1365
1365
|
type: "button",
|
|
1366
|
-
className:
|
|
1366
|
+
className: C("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(Is, { 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: C("message-vote-button focus-ring", {
|
|
1381
1381
|
"message-vote-button--selected": e === "down"
|
|
1382
1382
|
}),
|
|
1383
1383
|
onClick: s,
|
|
1384
1384
|
"aria-label": "Bad response",
|
|
1385
1385
|
"aria-pressed": e === "down",
|
|
1386
1386
|
"data-tooltip": "Bad response",
|
|
1387
|
-
children: /* @__PURE__ */ n(
|
|
1387
|
+
children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
1390
1390
|
] }), ka = (e) => {
|
|
1391
|
-
var
|
|
1391
|
+
var ft, gt, bt, pt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et, St;
|
|
1392
1392
|
const {
|
|
1393
1393
|
additionalMessageInputProps: t,
|
|
1394
1394
|
chatbotVotingEnabled: s,
|
|
@@ -1404,84 +1404,84 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
1406
|
renderText: b,
|
|
1407
|
-
threadList:
|
|
1407
|
+
threadList: w,
|
|
1408
1408
|
viewerLanguage: p
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1411
|
-
EditMessageModal:
|
|
1409
|
+
} = e, { client: v } = We("CustomMessage"), { channel: _ } = de("CustomMessage"), { isUnlocking: R, onUnlockClick: y, onFetchSource: M, onDownloadClick: D } = va("LockedAttachment"), [$, L] = z(!1), N = Ln(c.id), { selected: I, voteUp: S, voteDown: F } = Hs(c), {
|
|
1410
|
+
Attachment: T = Dn,
|
|
1411
|
+
EditMessageModal: E = On,
|
|
1412
1412
|
MessageActions: A,
|
|
1413
|
-
MessageBlocked:
|
|
1414
|
-
MessageBouncePrompt: B =
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton:
|
|
1418
|
-
ReminderNotification:
|
|
1419
|
-
StreamedMessageText:
|
|
1413
|
+
MessageBlocked: O = Pn,
|
|
1414
|
+
MessageBouncePrompt: B = zn,
|
|
1415
|
+
MessageDeleted: H = $n,
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: V = Fn,
|
|
1417
|
+
MessageRepliesCountButton: Y = Bn,
|
|
1418
|
+
ReminderNotification: q = Un,
|
|
1419
|
+
StreamedMessageText: x = jn,
|
|
1420
1420
|
PinIndicator: k
|
|
1421
|
-
} =
|
|
1421
|
+
} = jt("CustomMessage"), P = Vn(c), W = Gn(c), K = ne(
|
|
1422
1422
|
() => u == null ? void 0 : u(c),
|
|
1423
1423
|
[u, c]
|
|
1424
|
-
),
|
|
1424
|
+
), G = ne(() => {
|
|
1425
1425
|
const fe = c.attachments ?? [], Ce = c.shared_location ? [c.shared_location, ...fe] : fe;
|
|
1426
1426
|
if (!Ee(c)) return Ce;
|
|
1427
|
-
const
|
|
1428
|
-
return
|
|
1429
|
-
}, [c]),
|
|
1430
|
-
const fe =
|
|
1427
|
+
const It = Ce.filter((Tt) => !("type" in Tt) || !sn(Tt));
|
|
1428
|
+
return It.length === Ce.length ? Ce : It;
|
|
1429
|
+
}, [c]), ee = ne(() => {
|
|
1430
|
+
const fe = Kt({ message: c, viewerLanguage: p });
|
|
1431
1431
|
return fe === c.text ? c : { ...c, text: fe };
|
|
1432
1432
|
}, [c, p]);
|
|
1433
|
-
if (
|
|
1433
|
+
if (Hn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1437
|
-
if (
|
|
1438
|
-
return /* @__PURE__ */ n(
|
|
1439
|
-
const ue = !
|
|
1436
|
+
return /* @__PURE__ */ n(H, { message: c });
|
|
1437
|
+
if (Yn(c))
|
|
1438
|
+
return /* @__PURE__ */ n(O, {});
|
|
1439
|
+
const ue = !w && !!c.reply_count, Z = !w && c.show_in_channel && c.parent_id, re = c.status === "failed" && ((ft = c.error) == null ? void 0 : ft.status) !== 403, te = qn(c);
|
|
1440
1440
|
let oe;
|
|
1441
|
-
|
|
1442
|
-
const me = f(),
|
|
1441
|
+
re ? oe = () => m(c) : te && (oe = () => L(!0));
|
|
1442
|
+
const me = f(), En = C(
|
|
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
|
me ? "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
|
-
"str-chat__message--has-attachment":
|
|
1449
|
+
"str-chat__message--has-attachment": P,
|
|
1450
1450
|
"str-chat__message--highlighted": g,
|
|
1451
1451
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
|
-
"str-chat__message--with-reactions":
|
|
1453
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1452
|
+
"str-chat__message--with-reactions": W,
|
|
1453
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((gt = c == null ? void 0 : c.error) == null ? void 0 : gt.status) !== 403,
|
|
1454
1454
|
"str-chat__message-with-thread-link": ue || Z,
|
|
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": o
|
|
1458
1458
|
}
|
|
1459
|
-
),
|
|
1460
|
-
return /* @__PURE__ */ h(
|
|
1459
|
+
), dt = c.poll_id && v.polls.fromState(c.poll_id), ut = ya(c), he = Ee(c), mt = Na(c), Le = !!(G != null && G.length && !c.quoted_message), ht = he && me && Le;
|
|
1460
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1462
|
+
E,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1468
|
-
|
|
1467
|
+
$ && /* @__PURE__ */ n(
|
|
1468
|
+
Wn,
|
|
1469
1469
|
{
|
|
1470
1470
|
MessageBouncePrompt: B,
|
|
1471
|
-
onClose: () =>
|
|
1472
|
-
open:
|
|
1471
|
+
onClose: () => L(!1),
|
|
1472
|
+
open: $
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
1476
1476
|
"div",
|
|
1477
1477
|
{
|
|
1478
|
-
className:
|
|
1478
|
+
className: En,
|
|
1479
1479
|
"data-message-id": c.id,
|
|
1480
1480
|
children: [
|
|
1481
1481
|
k && /* @__PURE__ */ n(k, {}),
|
|
1482
|
-
!!N && /* @__PURE__ */ n(
|
|
1482
|
+
!!N && /* @__PURE__ */ n(q, { reminder: N }),
|
|
1483
1483
|
c.user && /* @__PURE__ */ n(
|
|
1484
|
-
|
|
1484
|
+
ie,
|
|
1485
1485
|
{
|
|
1486
1486
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1487
1487
|
id: c.user.id,
|
|
@@ -1495,8 +1495,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1495
1495
|
/* @__PURE__ */ n(
|
|
1496
1496
|
"div",
|
|
1497
1497
|
{
|
|
1498
|
-
className:
|
|
1499
|
-
"str-chat__simple-message--error-failed":
|
|
1498
|
+
className: C("str-chat__message-inner", {
|
|
1499
|
+
"str-chat__simple-message--error-failed": re || te
|
|
1500
1500
|
}),
|
|
1501
1501
|
"data-testid": "message-inner",
|
|
1502
1502
|
onClick: oe,
|
|
@@ -1509,87 +1509,87 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1509
1509
|
marginInlineEnd: 0,
|
|
1510
1510
|
marginInlineStart: 0
|
|
1511
1511
|
},
|
|
1512
|
-
children:
|
|
1512
|
+
children: mt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1513
1513
|
me ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1514
1514
|
A && /* @__PURE__ */ n(A, {}),
|
|
1515
1515
|
/* @__PURE__ */ n(
|
|
1516
|
-
|
|
1516
|
+
zt.Sent,
|
|
1517
1517
|
{
|
|
1518
|
-
title: (
|
|
1519
|
-
mimeType: (
|
|
1520
|
-
thumbnailUrl: (
|
|
1521
|
-
amountText: (
|
|
1522
|
-
detail: (
|
|
1523
|
-
paymentStatus: (
|
|
1524
|
-
onPreviewClick: () =>
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1518
|
+
title: (bt = c.metadata) == null ? void 0 : bt.attachment_title,
|
|
1519
|
+
mimeType: (pt = c.metadata) == null ? void 0 : pt.attachment_mime_type,
|
|
1520
|
+
thumbnailUrl: (vt = c.metadata) == null ? void 0 : vt.attachment_thumbnail,
|
|
1521
|
+
amountText: (xt = c.metadata) == null ? void 0 : xt.amount_text,
|
|
1522
|
+
detail: (wt = c.metadata) == null ? void 0 : wt.attachment_detail,
|
|
1523
|
+
paymentStatus: (_t = c.metadata) == null ? void 0 : _t.payment_status,
|
|
1524
|
+
onPreviewClick: () => y == null ? void 0 : y(c, _),
|
|
1525
|
+
onFetchSource: async () => await (M == null ? void 0 : M(c, _))
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
1528
1528
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1529
1529
|
/* @__PURE__ */ n(
|
|
1530
|
-
|
|
1530
|
+
zt.Received,
|
|
1531
1531
|
{
|
|
1532
|
-
title: (
|
|
1533
|
-
mimeType: (
|
|
1534
|
-
thumbnailUrl: (
|
|
1535
|
-
amountText: (
|
|
1536
|
-
detail: (
|
|
1537
|
-
paymentStatus: (
|
|
1538
|
-
isUnlocking:
|
|
1539
|
-
onUnlockClick: () =>
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1532
|
+
title: (Nt = c.metadata) == null ? void 0 : Nt.attachment_title,
|
|
1533
|
+
mimeType: (yt = c.metadata) == null ? void 0 : yt.attachment_mime_type,
|
|
1534
|
+
thumbnailUrl: (Ct = c.metadata) == null ? void 0 : Ct.attachment_thumbnail,
|
|
1535
|
+
amountText: (kt = c.metadata) == null ? void 0 : kt.amount_text,
|
|
1536
|
+
detail: (Et = c.metadata) == null ? void 0 : Et.attachment_detail,
|
|
1537
|
+
paymentStatus: (St = c.metadata) == null ? void 0 : St.payment_status,
|
|
1538
|
+
isUnlocking: R(c.id),
|
|
1539
|
+
onUnlockClick: () => y == null ? void 0 : y(c, _),
|
|
1540
|
+
onFetchSource: async () => await (M == null ? void 0 : M(c, _)),
|
|
1541
1541
|
onDownloadClick: () => D == null ? void 0 : D(c, _)
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
1544
|
A && /* @__PURE__ */ n(A, {})
|
|
1545
1545
|
] }),
|
|
1546
1546
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1547
|
-
|
|
1547
|
+
Mt,
|
|
1548
1548
|
{
|
|
1549
|
-
message:
|
|
1549
|
+
message: ee,
|
|
1550
1550
|
renderText: b
|
|
1551
1551
|
}
|
|
1552
1552
|
) })
|
|
1553
|
-
] }) :
|
|
1553
|
+
] }) : ut ? (
|
|
1554
1554
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
|
-
/* @__PURE__ */ n(
|
|
1555
|
+
/* @__PURE__ */ n(Pe, { 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
|
-
he && !
|
|
1558
|
-
|
|
1557
|
+
he && !ht && /* @__PURE__ */ n(
|
|
1558
|
+
Pe,
|
|
1559
1559
|
{
|
|
1560
1560
|
message: c,
|
|
1561
1561
|
hasAttachment: Le,
|
|
1562
1562
|
isMyMessage: me
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1565
|
+
dt && /* @__PURE__ */ n(Xn, { poll: dt }),
|
|
1566
|
+
G != null && G.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1567
|
+
T,
|
|
1568
1568
|
{
|
|
1569
1569
|
actionHandler: l,
|
|
1570
|
-
attachments:
|
|
1570
|
+
attachments: G
|
|
1571
1571
|
}
|
|
1572
1572
|
) : null,
|
|
1573
|
-
|
|
1574
|
-
|
|
1573
|
+
K ? /* @__PURE__ */ n(
|
|
1574
|
+
x,
|
|
1575
1575
|
{
|
|
1576
|
-
message:
|
|
1576
|
+
message: ee,
|
|
1577
1577
|
renderText: b
|
|
1578
1578
|
}
|
|
1579
1579
|
) : /* @__PURE__ */ n(
|
|
1580
|
-
|
|
1580
|
+
Mt,
|
|
1581
1581
|
{
|
|
1582
|
-
message:
|
|
1582
|
+
message: ee,
|
|
1583
1583
|
renderText: b
|
|
1584
1584
|
}
|
|
1585
1585
|
),
|
|
1586
|
-
/* @__PURE__ */ n(
|
|
1586
|
+
/* @__PURE__ */ n(Kn, {})
|
|
1587
1587
|
] }) })
|
|
1588
1588
|
}
|
|
1589
1589
|
),
|
|
1590
|
-
!
|
|
1591
|
-
(!he ||
|
|
1592
|
-
|
|
1590
|
+
!mt && !ut && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1591
|
+
(!he || ht) && /* @__PURE__ */ n(
|
|
1592
|
+
Pe,
|
|
1593
1593
|
{
|
|
1594
1594
|
message: c,
|
|
1595
1595
|
hasAttachment: Le,
|
|
@@ -1599,28 +1599,28 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1599
1599
|
s && he && /* @__PURE__ */ n(
|
|
1600
1600
|
Ca,
|
|
1601
1601
|
{
|
|
1602
|
-
selected:
|
|
1603
|
-
onVoteUp:
|
|
1604
|
-
onVoteDown:
|
|
1602
|
+
selected: I,
|
|
1603
|
+
onVoteUp: S,
|
|
1604
|
+
onVoteDown: F
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] }),
|
|
1608
1608
|
ue && /* @__PURE__ */ n(
|
|
1609
|
-
|
|
1609
|
+
Y,
|
|
1610
1610
|
{
|
|
1611
1611
|
onClick: d,
|
|
1612
1612
|
reply_count: c.reply_count
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
Z && /* @__PURE__ */ n(
|
|
1615
|
+
Z && /* @__PURE__ */ n(V, {})
|
|
1616
1616
|
]
|
|
1617
1617
|
},
|
|
1618
1618
|
c.id
|
|
1619
1619
|
)
|
|
1620
1620
|
] });
|
|
1621
|
-
}, Ea =
|
|
1621
|
+
}, Ea = U.memo(
|
|
1622
1622
|
ka,
|
|
1623
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1623
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Rn(e, t)
|
|
1624
1624
|
), Sa = (e) => {
|
|
1625
1625
|
const t = xe("CustomMessage");
|
|
1626
1626
|
return /* @__PURE__ */ n(Ea, { ...t, ...e });
|
|
@@ -1628,32 +1628,32 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1628
1628
|
var s;
|
|
1629
1629
|
const { handleDelete: e, message: t } = xe("CustomMessageActions");
|
|
1630
1630
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1631
|
-
|
|
1631
|
+
Yt,
|
|
1632
1632
|
{
|
|
1633
1633
|
onClick: e,
|
|
1634
1634
|
"aria-label": "Delete",
|
|
1635
1635
|
title: "Delete",
|
|
1636
1636
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1637
|
-
children: /* @__PURE__ */ n(
|
|
1637
|
+
children: /* @__PURE__ */ n(As, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1638
1638
|
}
|
|
1639
1639
|
);
|
|
1640
1640
|
}, Ta = () => {
|
|
1641
1641
|
const { handleFlag: e } = xe("CustomMessageActions");
|
|
1642
1642
|
return /* @__PURE__ */ n(
|
|
1643
|
-
|
|
1643
|
+
Yt,
|
|
1644
1644
|
{
|
|
1645
1645
|
onClick: e,
|
|
1646
1646
|
"aria-label": "Report",
|
|
1647
1647
|
title: "Report",
|
|
1648
1648
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1649
|
-
children: /* @__PURE__ */ n(
|
|
1649
|
+
children: /* @__PURE__ */ n(Vt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1650
1650
|
}
|
|
1651
1651
|
);
|
|
1652
1652
|
}, Aa = () => {
|
|
1653
1653
|
var t;
|
|
1654
1654
|
const { message: e } = xe("CustomMessageActions");
|
|
1655
1655
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1656
|
-
|
|
1656
|
+
Os,
|
|
1657
1657
|
{
|
|
1658
1658
|
messageActionSet: [
|
|
1659
1659
|
{ Component: Ia, placement: "quick", type: "delete" },
|
|
@@ -1703,10 +1703,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1703
1703
|
);
|
|
1704
1704
|
}, Ra = (e) => ({
|
|
1705
1705
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1706
|
-
(t) =>
|
|
1706
|
+
(t) => At.previewIsLoaded(t) || At.previewIsLoading(t)
|
|
1707
1707
|
)
|
|
1708
1708
|
}), La = () => {
|
|
1709
|
-
const { linkPreviewsManager: e } =
|
|
1709
|
+
const { linkPreviewsManager: e } = Jn(), { linkPreviews: t } = Zn(
|
|
1710
1710
|
e.state,
|
|
1711
1711
|
Ra
|
|
1712
1712
|
), s = (r) => {
|
|
@@ -1720,7 +1720,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1720
1720
|
},
|
|
1721
1721
|
r.og_scrape_url
|
|
1722
1722
|
)) }) : null;
|
|
1723
|
-
},
|
|
1723
|
+
}, cn = U.createContext(!1), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1724
|
"button",
|
|
1725
1725
|
{
|
|
1726
1726
|
...s,
|
|
@@ -1728,20 +1728,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1728
1728
|
"aria-label": "Send",
|
|
1729
1729
|
disabled: t,
|
|
1730
1730
|
onClick: e,
|
|
1731
|
-
children: /* @__PURE__ */ n(
|
|
1731
|
+
children: /* @__PURE__ */ n(Ms, { weight: "bold", className: "size-4" })
|
|
1732
1732
|
}
|
|
1733
|
-
),
|
|
1734
|
-
const e = Ae(
|
|
1733
|
+
), Oa = () => {
|
|
1734
|
+
const e = Ae(cn), { handleSubmit: t } = es(), s = ts(), a = e || !s, {
|
|
1735
1735
|
SendButton: r = Da,
|
|
1736
|
-
AttachmentPreviewList: i =
|
|
1737
|
-
} =
|
|
1736
|
+
AttachmentPreviewList: i = ns
|
|
1737
|
+
} = jt("CustomMessageInput");
|
|
1738
1738
|
return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1739
|
-
/* @__PURE__ */ n(
|
|
1739
|
+
/* @__PURE__ */ n(ss, {}),
|
|
1740
1740
|
/* @__PURE__ */ n(La, {}),
|
|
1741
1741
|
/* @__PURE__ */ n(i, {}),
|
|
1742
1742
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1743
1743
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1744
|
-
|
|
1744
|
+
as,
|
|
1745
1745
|
{
|
|
1746
1746
|
"aria-disabled": e || void 0,
|
|
1747
1747
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1764,7 +1764,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1764
1764
|
)
|
|
1765
1765
|
] })
|
|
1766
1766
|
] });
|
|
1767
|
-
},
|
|
1767
|
+
}, Pa = ({
|
|
1768
1768
|
renderActions: e,
|
|
1769
1769
|
renderFooter: t,
|
|
1770
1770
|
disabled: s = !1,
|
|
@@ -1772,7 +1772,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1772
1772
|
}) => {
|
|
1773
1773
|
var o;
|
|
1774
1774
|
const { channel: r } = de(), i = ((o = r == null ? void 0 : r.data) == null ? void 0 : o.frozen) === !0;
|
|
1775
|
-
return s ? /* @__PURE__ */ h(
|
|
1775
|
+
return s ? /* @__PURE__ */ h(se, { children: [
|
|
1776
1776
|
/* @__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 }),
|
|
1777
1777
|
t == null ? void 0 : t()
|
|
1778
1778
|
] }) : /* @__PURE__ */ h("div", { className: "flex flex-col gap-4 p-4", children: [
|
|
@@ -1784,7 +1784,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1784
1784
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1785
1785
|
children: [
|
|
1786
1786
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1787
|
-
/* @__PURE__ */ n(
|
|
1787
|
+
/* @__PURE__ */ n(cn.Provider, { value: i, children: /* @__PURE__ */ n(Qn, { Input: Oa }) })
|
|
1788
1788
|
]
|
|
1789
1789
|
}
|
|
1790
1790
|
),
|
|
@@ -1800,10 +1800,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1800
1800
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1801
1801
|
], Ba = {
|
|
1802
1802
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1803
|
-
}, ze = "age safety guidelines.", Ua = "https://linktr.ee/s/about/contact",
|
|
1803
|
+
}, ze = "age safety guidelines.", Ua = "https://linktr.ee/s/about/contact", Ft = (e) => za.includes(e), ja = (e) => Fa.includes(e), Va = (e) => {
|
|
1804
1804
|
var a;
|
|
1805
1805
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1806
|
-
if (
|
|
1806
|
+
if (Ft(t))
|
|
1807
1807
|
return {
|
|
1808
1808
|
kind: "dm-agent",
|
|
1809
1809
|
type: t
|
|
@@ -1814,7 +1814,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1814
1814
|
type: t
|
|
1815
1815
|
};
|
|
1816
1816
|
const s = e.dm_agent_system_type;
|
|
1817
|
-
if (
|
|
1817
|
+
if (Ft(s))
|
|
1818
1818
|
return {
|
|
1819
1819
|
kind: "dm-agent",
|
|
1820
1820
|
type: s
|
|
@@ -1824,7 +1824,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1824
1824
|
if (t === -1)
|
|
1825
1825
|
return e;
|
|
1826
1826
|
const s = t + ze.length;
|
|
1827
|
-
return /* @__PURE__ */ h(
|
|
1827
|
+
return /* @__PURE__ */ h(se, { children: [
|
|
1828
1828
|
e.slice(0, t),
|
|
1829
1829
|
/* @__PURE__ */ n(
|
|
1830
1830
|
"a",
|
|
@@ -1880,7 +1880,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1880
1880
|
"data-age-safety-system-type": s.type,
|
|
1881
1881
|
children: [
|
|
1882
1882
|
/* @__PURE__ */ n(
|
|
1883
|
-
|
|
1883
|
+
Rs,
|
|
1884
1884
|
{
|
|
1885
1885
|
size: 24,
|
|
1886
1886
|
weight: "duotone",
|
|
@@ -1904,7 +1904,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1904
1904
|
] }),
|
|
1905
1905
|
!t && /* @__PURE__ */ n(De, { message: e.message })
|
|
1906
1906
|
] });
|
|
1907
|
-
},
|
|
1907
|
+
}, dn = Ye(!1), $e = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1908
1908
|
"animateTransform",
|
|
1909
1909
|
{
|
|
1910
1910
|
attributeName: "transform",
|
|
@@ -1915,16 +1915,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1915
1915
|
repeatCount: "indefinite"
|
|
1916
1916
|
}
|
|
1917
1917
|
) }), Ya = /* @__PURE__ */ new Set([
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1918
|
+
Oe.Thinking,
|
|
1919
|
+
Oe.Generating,
|
|
1920
|
+
Oe.ExternalSources
|
|
1921
1921
|
]), qa = ({ threadList: e }) => {
|
|
1922
|
-
var b,
|
|
1923
|
-
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } =
|
|
1922
|
+
var b, w;
|
|
1923
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = We(), { typing: i = {} } = rs(), { aiState: o } = is(t), l = Ae(dn);
|
|
1924
1924
|
if (!e && l && Ya.has(o)) {
|
|
1925
1925
|
const p = Wa(t, (b = r.user) == null ? void 0 : b.id);
|
|
1926
1926
|
return /* @__PURE__ */ n(
|
|
1927
|
-
|
|
1927
|
+
Bt,
|
|
1928
1928
|
{
|
|
1929
1929
|
avatarId: (p == null ? void 0 : p.id) ?? "ai-agent",
|
|
1930
1930
|
avatarName: (p == null ? void 0 : p.name) ?? (p == null ? void 0 : p.id) ?? "Agent",
|
|
@@ -1936,21 +1936,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1936
1936
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1937
1937
|
return null;
|
|
1938
1938
|
const m = e ? [] : Object.values(i).filter(
|
|
1939
|
-
({ parent_id: p, user:
|
|
1939
|
+
({ parent_id: p, user: v }) => {
|
|
1940
1940
|
var _;
|
|
1941
|
-
return (
|
|
1941
|
+
return (v == null ? void 0 : v.id) !== ((_ = r.user) == null ? void 0 : _.id) && !p;
|
|
1942
1942
|
}
|
|
1943
1943
|
), g = e ? Object.values(i).filter(
|
|
1944
|
-
({ parent_id: p, user:
|
|
1944
|
+
({ parent_id: p, user: v }) => {
|
|
1945
1945
|
var _;
|
|
1946
|
-
return (
|
|
1946
|
+
return (v == null ? void 0 : v.id) !== ((_ = r.user) == null ? void 0 : _.id) && p === (a == null ? void 0 : a.id);
|
|
1947
1947
|
}
|
|
1948
1948
|
) : [], u = e ? g : m;
|
|
1949
1949
|
if (!u.length)
|
|
1950
1950
|
return null;
|
|
1951
|
-
const f = (
|
|
1951
|
+
const f = (w = u[0]) == null ? void 0 : w.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1952
1952
|
return /* @__PURE__ */ n(
|
|
1953
|
-
|
|
1953
|
+
Bt,
|
|
1954
1954
|
{
|
|
1955
1955
|
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
1956
1956
|
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
@@ -1958,7 +1958,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1958
1958
|
testId: "typing-indicator"
|
|
1959
1959
|
}
|
|
1960
1960
|
);
|
|
1961
|
-
},
|
|
1961
|
+
}, Bt = ({
|
|
1962
1962
|
avatarId: e,
|
|
1963
1963
|
avatarName: t,
|
|
1964
1964
|
avatarImage: s,
|
|
@@ -1973,7 +1973,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1973
1973
|
},
|
|
1974
1974
|
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: [
|
|
1975
1975
|
/* @__PURE__ */ n(
|
|
1976
|
-
|
|
1976
|
+
ie,
|
|
1977
1977
|
{
|
|
1978
1978
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1979
1979
|
id: e,
|
|
@@ -2014,7 +2014,7 @@ function Wa(e, t) {
|
|
|
2014
2014
|
const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2015
2015
|
"div",
|
|
2016
2016
|
{
|
|
2017
|
-
className:
|
|
2017
|
+
className: C("flex items-center justify-center h-full", e),
|
|
2018
2018
|
children: [
|
|
2019
2019
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2020
2020
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2054,12 +2054,12 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2054
2054
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2055
2055
|
]
|
|
2056
2056
|
}
|
|
2057
|
-
), Se =
|
|
2057
|
+
), Se = U.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2058
2058
|
/* @__PURE__ */ n(Ka, { className: "w-6 h-6" }),
|
|
2059
2059
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2060
2060
|
] }) }));
|
|
2061
2061
|
Se.displayName = "LoadingState";
|
|
2062
|
-
const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
2062
|
+
const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ut = "Replies instantly with AI assistant", Ja = ({
|
|
2063
2063
|
onBack: e,
|
|
2064
2064
|
showBackButton: t,
|
|
2065
2065
|
showStarButton: s = !1,
|
|
@@ -2074,21 +2074,22 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2074
2074
|
onReportParticipantClick: u,
|
|
2075
2075
|
customChannelActions: f,
|
|
2076
2076
|
renderChannelActions: c,
|
|
2077
|
-
showChannelInfo: b = !0
|
|
2077
|
+
showChannelInfo: b = !0,
|
|
2078
|
+
onParticipantNameClick: w
|
|
2078
2079
|
}) => {
|
|
2079
|
-
var
|
|
2080
|
-
const { channel:
|
|
2081
|
-
var
|
|
2082
|
-
const S = (
|
|
2083
|
-
return S ? Object.values(((
|
|
2084
|
-
(
|
|
2085
|
-
var
|
|
2086
|
-
return ((
|
|
2080
|
+
var D, $, L, N, I;
|
|
2081
|
+
const { channel: p } = de(), v = U.useMemo(() => {
|
|
2082
|
+
var T, E;
|
|
2083
|
+
const S = (T = p._client) == null ? void 0 : T.userID;
|
|
2084
|
+
return S ? Object.values(((E = p.state) == null ? void 0 : E.members) || {}).find(
|
|
2085
|
+
(A) => {
|
|
2086
|
+
var O;
|
|
2087
|
+
return ((O = A.user) == null ? void 0 : O.id) && A.user.id !== S;
|
|
2087
2088
|
}
|
|
2088
2089
|
) : void 0;
|
|
2089
|
-
}, [(
|
|
2090
|
+
}, [(D = p._client) == null ? void 0 : D.userID, ($ = p.state) == null ? void 0 : $.members]), _ = Xt(v == null ? void 0 : v.user), R = (L = v == null ? void 0 : v.user) == null ? void 0 : L.image, y = Wt(p), M = async () => {
|
|
2090
2091
|
try {
|
|
2091
|
-
|
|
2092
|
+
y ? await p.unpin() : await p.pin();
|
|
2092
2093
|
} catch (S) {
|
|
2093
2094
|
console.error(
|
|
2094
2095
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -2101,7 +2102,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2101
2102
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2102
2103
|
"button",
|
|
2103
2104
|
{
|
|
2104
|
-
className:
|
|
2105
|
+
className: C(
|
|
2105
2106
|
le,
|
|
2106
2107
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2107
2108
|
),
|
|
@@ -2109,25 +2110,37 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2109
2110
|
}),
|
|
2110
2111
|
type: "button",
|
|
2111
2112
|
"aria-label": "Back to conversations",
|
|
2112
|
-
children: /* @__PURE__ */ n(
|
|
2113
|
+
children: /* @__PURE__ */ n(Lt, { className: "size-5 text-black/90" })
|
|
2113
2114
|
}
|
|
2114
2115
|
) }),
|
|
2115
2116
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2116
2117
|
/* @__PURE__ */ n(
|
|
2117
|
-
|
|
2118
|
+
ie,
|
|
2118
2119
|
{
|
|
2119
|
-
id: ((
|
|
2120
|
-
name:
|
|
2121
|
-
image:
|
|
2122
|
-
starred: s &&
|
|
2120
|
+
id: ((N = v == null ? void 0 : v.user) == null ? void 0 : N.id) || p.id || "unknown",
|
|
2121
|
+
name: _,
|
|
2122
|
+
image: R,
|
|
2123
|
+
starred: s && y,
|
|
2123
2124
|
dmAgentEnabled: a,
|
|
2124
2125
|
size: 48
|
|
2125
2126
|
}
|
|
2126
2127
|
),
|
|
2127
|
-
/* @__PURE__ */
|
|
2128
|
+
w ? /* @__PURE__ */ h(
|
|
2129
|
+
"button",
|
|
2130
|
+
{
|
|
2131
|
+
type: "button",
|
|
2132
|
+
onClick: w,
|
|
2133
|
+
"aria-label": `View details for ${_}`,
|
|
2134
|
+
className: "flex max-w-full items-center gap-0.5 rounded text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2135
|
+
children: [
|
|
2136
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: _ }),
|
|
2137
|
+
/* @__PURE__ */ n(Ve, { className: "size-3 shrink-0", weight: "bold" })
|
|
2138
|
+
]
|
|
2139
|
+
}
|
|
2140
|
+
) : /* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: _ }),
|
|
2128
2141
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2129
2142
|
/* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
|
|
2130
|
-
/* @__PURE__ */ n("span", { children:
|
|
2143
|
+
/* @__PURE__ */ n("span", { children: Ut })
|
|
2131
2144
|
] })
|
|
2132
2145
|
] }),
|
|
2133
2146
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
@@ -2135,17 +2148,17 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2135
2148
|
"button",
|
|
2136
2149
|
{
|
|
2137
2150
|
className: le,
|
|
2138
|
-
onClick:
|
|
2151
|
+
onClick: M,
|
|
2139
2152
|
type: "button",
|
|
2140
|
-
"aria-label":
|
|
2153
|
+
"aria-label": y ? "Unstar conversation" : "Star conversation",
|
|
2141
2154
|
children: /* @__PURE__ */ n(
|
|
2142
2155
|
Be,
|
|
2143
2156
|
{
|
|
2144
|
-
className:
|
|
2145
|
-
"text-yellow-600":
|
|
2146
|
-
"text-black/90": !
|
|
2157
|
+
className: C("size-5", {
|
|
2158
|
+
"text-yellow-600": y,
|
|
2159
|
+
"text-black/90": !y
|
|
2147
2160
|
}),
|
|
2148
|
-
weight:
|
|
2161
|
+
weight: y ? "duotone" : "regular"
|
|
2149
2162
|
}
|
|
2150
2163
|
)
|
|
2151
2164
|
}
|
|
@@ -2153,8 +2166,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2153
2166
|
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2154
2167
|
Pt,
|
|
2155
2168
|
{
|
|
2156
|
-
channel:
|
|
2157
|
-
participant:
|
|
2169
|
+
channel: p,
|
|
2170
|
+
participant: v,
|
|
2158
2171
|
showDeleteConversation: o,
|
|
2159
2172
|
showBlockParticipant: l,
|
|
2160
2173
|
showReportParticipant: d,
|
|
@@ -2164,7 +2177,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2164
2177
|
onBlockParticipantClick: g,
|
|
2165
2178
|
onReportParticipantClick: u,
|
|
2166
2179
|
customChannelActions: f,
|
|
2167
|
-
triggerClassName:
|
|
2180
|
+
triggerClassName: C(le, "bg-[#F1F0EE]")
|
|
2168
2181
|
}
|
|
2169
2182
|
))
|
|
2170
2183
|
] })
|
|
@@ -2174,32 +2187,44 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2174
2187
|
t && e && /* @__PURE__ */ n(
|
|
2175
2188
|
"button",
|
|
2176
2189
|
{
|
|
2177
|
-
className:
|
|
2190
|
+
className: C(
|
|
2178
2191
|
le,
|
|
2179
2192
|
"messaging-channel-view-back-button-desktop"
|
|
2180
2193
|
),
|
|
2181
2194
|
type: "button",
|
|
2182
2195
|
onClick: e,
|
|
2183
2196
|
"aria-label": "Back to conversations",
|
|
2184
|
-
children: /* @__PURE__ */ n(
|
|
2197
|
+
children: /* @__PURE__ */ n(Lt, { className: "size-5 text-black/90" })
|
|
2185
2198
|
}
|
|
2186
2199
|
),
|
|
2187
2200
|
/* @__PURE__ */ n(
|
|
2188
|
-
|
|
2201
|
+
ie,
|
|
2189
2202
|
{
|
|
2190
|
-
id: ((
|
|
2191
|
-
name:
|
|
2192
|
-
image:
|
|
2193
|
-
starred: s &&
|
|
2203
|
+
id: ((I = v == null ? void 0 : v.user) == null ? void 0 : I.id) || p.id || "unknown",
|
|
2204
|
+
name: _,
|
|
2205
|
+
image: R,
|
|
2206
|
+
starred: s && y,
|
|
2194
2207
|
dmAgentEnabled: a,
|
|
2195
2208
|
size: 48
|
|
2196
2209
|
}
|
|
2197
2210
|
),
|
|
2198
2211
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2199
|
-
/* @__PURE__ */
|
|
2212
|
+
w ? /* @__PURE__ */ h(
|
|
2213
|
+
"button",
|
|
2214
|
+
{
|
|
2215
|
+
type: "button",
|
|
2216
|
+
onClick: w,
|
|
2217
|
+
"aria-label": `View details for ${_}`,
|
|
2218
|
+
className: "flex min-w-0 max-w-full items-center gap-1 rounded font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2219
|
+
children: [
|
|
2220
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: _ }),
|
|
2221
|
+
/* @__PURE__ */ n(Ve, { className: "size-4 shrink-0", weight: "bold" })
|
|
2222
|
+
]
|
|
2223
|
+
}
|
|
2224
|
+
) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: _ }),
|
|
2200
2225
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2201
2226
|
/* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
|
|
2202
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
2227
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Ut })
|
|
2203
2228
|
] })
|
|
2204
2229
|
] })
|
|
2205
2230
|
] }),
|
|
@@ -2208,17 +2233,17 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2208
2233
|
"button",
|
|
2209
2234
|
{
|
|
2210
2235
|
className: le,
|
|
2211
|
-
onClick:
|
|
2236
|
+
onClick: M,
|
|
2212
2237
|
type: "button",
|
|
2213
|
-
"aria-label":
|
|
2238
|
+
"aria-label": y ? "Unstar conversation" : "Star conversation",
|
|
2214
2239
|
children: /* @__PURE__ */ n(
|
|
2215
2240
|
Be,
|
|
2216
2241
|
{
|
|
2217
|
-
className:
|
|
2218
|
-
"text-yellow-600":
|
|
2219
|
-
"text-black/90": !
|
|
2242
|
+
className: C("size-6", {
|
|
2243
|
+
"text-yellow-600": y,
|
|
2244
|
+
"text-black/90": !y
|
|
2220
2245
|
}),
|
|
2221
|
-
weight:
|
|
2246
|
+
weight: y ? "duotone" : "regular"
|
|
2222
2247
|
}
|
|
2223
2248
|
)
|
|
2224
2249
|
}
|
|
@@ -2226,8 +2251,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2226
2251
|
b && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2227
2252
|
Pt,
|
|
2228
2253
|
{
|
|
2229
|
-
channel:
|
|
2230
|
-
participant:
|
|
2254
|
+
channel: p,
|
|
2255
|
+
participant: v,
|
|
2231
2256
|
showDeleteConversation: o,
|
|
2232
2257
|
showBlockParticipant: l,
|
|
2233
2258
|
showReportParticipant: d,
|
|
@@ -2259,63 +2284,64 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2259
2284
|
showReportParticipant: f = !0,
|
|
2260
2285
|
composerDisabled: c = !1,
|
|
2261
2286
|
composerDisabledReason: b,
|
|
2262
|
-
showStarButton:
|
|
2287
|
+
showStarButton: w = !1,
|
|
2263
2288
|
chatbotVotingEnabled: p = !1,
|
|
2264
|
-
renderChannelBanner:
|
|
2289
|
+
renderChannelBanner: v,
|
|
2265
2290
|
customChannelActions: _,
|
|
2266
|
-
renderChannelActions:
|
|
2267
|
-
renderMessage:
|
|
2268
|
-
dmAgentEnabled:
|
|
2291
|
+
renderChannelActions: R,
|
|
2292
|
+
renderMessage: y,
|
|
2293
|
+
dmAgentEnabled: M = !1,
|
|
2269
2294
|
viewerLanguage: D,
|
|
2270
|
-
showChannelInfo:
|
|
2295
|
+
showChannelInfo: $ = !0,
|
|
2296
|
+
onParticipantNameClick: L
|
|
2271
2297
|
}) => {
|
|
2272
|
-
var
|
|
2273
|
-
const { channel:
|
|
2274
|
-
var
|
|
2275
|
-
const
|
|
2276
|
-
return
|
|
2277
|
-
(
|
|
2278
|
-
var
|
|
2279
|
-
return ((
|
|
2298
|
+
var O, B, H, V, Y, q;
|
|
2299
|
+
const { channel: N } = de(), I = U.useMemo(() => {
|
|
2300
|
+
var P, W;
|
|
2301
|
+
const x = (P = N._client) == null ? void 0 : P.userID;
|
|
2302
|
+
return x ? Object.values(((W = N.state) == null ? void 0 : W.members) || {}).find(
|
|
2303
|
+
(K) => {
|
|
2304
|
+
var G;
|
|
2305
|
+
return ((G = K.user) == null ? void 0 : G.id) && K.user.id !== x;
|
|
2280
2306
|
}
|
|
2281
2307
|
) : void 0;
|
|
2282
|
-
}, [(
|
|
2283
|
-
var
|
|
2284
|
-
const
|
|
2285
|
-
return
|
|
2286
|
-
var
|
|
2287
|
-
return ((
|
|
2308
|
+
}, [(O = N._client) == null ? void 0 : O.userID, (B = N.state) == null ? void 0 : B.members]), S = U.useMemo(() => {
|
|
2309
|
+
var P, W;
|
|
2310
|
+
const x = (P = N._client) == null ? void 0 : P.userID;
|
|
2311
|
+
return x ? Object.values(((W = N.state) == null ? void 0 : W.members) || {}).find((K) => {
|
|
2312
|
+
var G;
|
|
2313
|
+
return ((G = K.user) == null ? void 0 : G.id) === x;
|
|
2288
2314
|
}) : void 0;
|
|
2289
|
-
}, [(
|
|
2290
|
-
(
|
|
2291
|
-
const { message:
|
|
2315
|
+
}, [(H = N._client) == null ? void 0 : H.userID, (V = N.state) == null ? void 0 : V.members]), F = ((Y = S == null ? void 0 : S.user) == null ? void 0 : Y.is_account) ?? (S == null ? void 0 : S.is_account), T = ((q = I == null ? void 0 : I.user) == null ? void 0 : q.is_account) ?? (I == null ? void 0 : I.is_account), E = M && F === !1 && T === !0, A = J(
|
|
2316
|
+
(x) => {
|
|
2317
|
+
const { message: k } = xe("ChannelView"), P = /* @__PURE__ */ n(
|
|
2292
2318
|
Sa,
|
|
2293
2319
|
{
|
|
2294
|
-
...
|
|
2320
|
+
...x,
|
|
2295
2321
|
chatbotVotingEnabled: p,
|
|
2296
2322
|
viewerLanguage: D
|
|
2297
2323
|
}
|
|
2298
2324
|
);
|
|
2299
|
-
return !
|
|
2325
|
+
return !y || !k ? P : y(P, k);
|
|
2300
2326
|
},
|
|
2301
|
-
[p,
|
|
2327
|
+
[p, y, D]
|
|
2302
2328
|
);
|
|
2303
|
-
return /* @__PURE__ */ n(
|
|
2304
|
-
|
|
2329
|
+
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
2330
|
+
ls,
|
|
2305
2331
|
{
|
|
2306
2332
|
overrides: {
|
|
2307
|
-
Message:
|
|
2333
|
+
Message: A,
|
|
2308
2334
|
MessageActions: Aa
|
|
2309
2335
|
},
|
|
2310
|
-
children: /* @__PURE__ */ h(
|
|
2336
|
+
children: /* @__PURE__ */ h(cs, { children: [
|
|
2311
2337
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2312
2338
|
Ja,
|
|
2313
2339
|
{
|
|
2314
2340
|
onBack: e,
|
|
2315
2341
|
showBackButton: t,
|
|
2316
|
-
showChannelInfo:
|
|
2317
|
-
showStarButton:
|
|
2318
|
-
dmAgentEnabled:
|
|
2342
|
+
showChannelInfo: $,
|
|
2343
|
+
showStarButton: w,
|
|
2344
|
+
dmAgentEnabled: E,
|
|
2319
2345
|
onLeaveConversation: i,
|
|
2320
2346
|
onBlockParticipant: o,
|
|
2321
2347
|
showDeleteConversation: l,
|
|
@@ -2325,26 +2351,27 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2325
2351
|
onBlockParticipantClick: m,
|
|
2326
2352
|
onReportParticipantClick: g,
|
|
2327
2353
|
customChannelActions: _,
|
|
2328
|
-
renderChannelActions:
|
|
2354
|
+
renderChannelActions: R,
|
|
2355
|
+
onParticipantNameClick: L
|
|
2329
2356
|
}
|
|
2330
2357
|
) }, "lt-channel-header"),
|
|
2331
|
-
|
|
2358
|
+
v ? /* @__PURE__ */ n(U.Fragment, { children: v() }, "lt-channel-banner") : null,
|
|
2332
2359
|
/* @__PURE__ */ n(
|
|
2333
2360
|
"div",
|
|
2334
2361
|
{
|
|
2335
2362
|
className: "flex-1 overflow-hidden relative",
|
|
2336
|
-
children: /* @__PURE__ */ n(
|
|
2363
|
+
children: /* @__PURE__ */ n(ds, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2337
2364
|
},
|
|
2338
2365
|
"lt-channel-message-list"
|
|
2339
2366
|
),
|
|
2340
|
-
r ? /* @__PURE__ */ n(
|
|
2367
|
+
r ? /* @__PURE__ */ n(U.Fragment, { children: r(N) }, "lt-channel-conversation-footer") : null,
|
|
2341
2368
|
/* @__PURE__ */ n(
|
|
2342
|
-
|
|
2369
|
+
Pa,
|
|
2343
2370
|
{
|
|
2344
2371
|
...s && {
|
|
2345
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2372
|
+
renderActions: () => s == null ? void 0 : s(N)
|
|
2346
2373
|
},
|
|
2347
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2374
|
+
renderFooter: () => a == null ? void 0 : a(N),
|
|
2348
2375
|
disabled: c,
|
|
2349
2376
|
disabledReason: b
|
|
2350
2377
|
},
|
|
@@ -2353,7 +2380,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2353
2380
|
] })
|
|
2354
2381
|
}
|
|
2355
2382
|
) });
|
|
2356
|
-
},
|
|
2383
|
+
}, un = U.memo(
|
|
2357
2384
|
({
|
|
2358
2385
|
channel: e,
|
|
2359
2386
|
onBack: t,
|
|
@@ -2370,65 +2397,66 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2370
2397
|
onBlockParticipantClick: f,
|
|
2371
2398
|
onReportParticipantClick: c,
|
|
2372
2399
|
showBlockParticipant: b = !0,
|
|
2373
|
-
showReportParticipant:
|
|
2400
|
+
showReportParticipant: w = !0,
|
|
2374
2401
|
composerDisabled: p = !1,
|
|
2375
|
-
composerDisabledReason:
|
|
2402
|
+
composerDisabledReason: v,
|
|
2376
2403
|
dmAgentEnabled: _,
|
|
2377
|
-
messageMetadata:
|
|
2378
|
-
onMessageSent:
|
|
2379
|
-
showStarButton:
|
|
2404
|
+
messageMetadata: R,
|
|
2405
|
+
onMessageSent: y,
|
|
2406
|
+
showStarButton: M = !1,
|
|
2380
2407
|
chatbotVotingEnabled: D = !1,
|
|
2381
|
-
renderChannelBanner:
|
|
2382
|
-
customChannelActions:
|
|
2408
|
+
renderChannelBanner: $,
|
|
2409
|
+
customChannelActions: L,
|
|
2383
2410
|
renderChannelActions: N,
|
|
2384
|
-
renderMessage:
|
|
2385
|
-
onMessageLinkClick:
|
|
2386
|
-
sendButton:
|
|
2387
|
-
attachmentPreviewList:
|
|
2388
|
-
viewerLanguage:
|
|
2389
|
-
showChannelInfo: A = !0
|
|
2411
|
+
renderMessage: I,
|
|
2412
|
+
onMessageLinkClick: S,
|
|
2413
|
+
sendButton: F,
|
|
2414
|
+
attachmentPreviewList: T,
|
|
2415
|
+
viewerLanguage: E,
|
|
2416
|
+
showChannelInfo: A = !0,
|
|
2417
|
+
onParticipantNameClick: O
|
|
2390
2418
|
}) => {
|
|
2391
|
-
const
|
|
2392
|
-
async (
|
|
2393
|
-
var
|
|
2394
|
-
const
|
|
2395
|
-
...
|
|
2396
|
-
...
|
|
2397
|
-
...
|
|
2419
|
+
const B = J(
|
|
2420
|
+
async (V, Y, q) => {
|
|
2421
|
+
var G;
|
|
2422
|
+
const x = ((G = e.data) == null ? void 0 : G.chatbot_paused) === !0, k = _ && !x, P = {
|
|
2423
|
+
...Y,
|
|
2424
|
+
...k && { silent: !0 },
|
|
2425
|
+
...R && {
|
|
2398
2426
|
metadata: {
|
|
2399
|
-
...
|
|
2400
|
-
...
|
|
2427
|
+
...Y.metadata ?? {},
|
|
2428
|
+
...R
|
|
2401
2429
|
}
|
|
2402
2430
|
}
|
|
2403
|
-
},
|
|
2404
|
-
...
|
|
2405
|
-
...
|
|
2406
|
-
},
|
|
2407
|
-
return
|
|
2431
|
+
}, W = {
|
|
2432
|
+
...q,
|
|
2433
|
+
...k && { skip_push: !0 }
|
|
2434
|
+
}, K = await e.sendMessage(P, W);
|
|
2435
|
+
return y == null || y(K), K;
|
|
2408
2436
|
},
|
|
2409
|
-
[e, _,
|
|
2410
|
-
),
|
|
2411
|
-
return
|
|
2412
|
-
if (!
|
|
2413
|
-
const
|
|
2414
|
-
if (!
|
|
2415
|
-
const
|
|
2416
|
-
const
|
|
2417
|
-
if (!
|
|
2418
|
-
const
|
|
2419
|
-
|
|
2437
|
+
[e, _, R, y]
|
|
2438
|
+
), H = j(null);
|
|
2439
|
+
return X(() => {
|
|
2440
|
+
if (!S) return;
|
|
2441
|
+
const V = H.current;
|
|
2442
|
+
if (!V) return;
|
|
2443
|
+
const Y = (q) => {
|
|
2444
|
+
const x = q.target, k = x == null ? void 0 : x.closest("a[href]"), P = k == null ? void 0 : k.getAttribute("href");
|
|
2445
|
+
if (!P) return;
|
|
2446
|
+
const W = k == null ? void 0 : k.closest("[data-message-id]"), K = W == null ? void 0 : W.getAttribute("data-message-id"), G = K ? e.state.messages.find((ee) => ee.id === K) : void 0;
|
|
2447
|
+
S(P, G);
|
|
2420
2448
|
};
|
|
2421
|
-
return
|
|
2422
|
-
}, [
|
|
2449
|
+
return V.addEventListener("click", Y), () => V.removeEventListener("click", Y);
|
|
2450
|
+
}, [S, e]), /* @__PURE__ */ n(
|
|
2423
2451
|
"div",
|
|
2424
2452
|
{
|
|
2425
|
-
ref:
|
|
2426
|
-
className:
|
|
2453
|
+
ref: H,
|
|
2454
|
+
className: C(
|
|
2427
2455
|
"messaging-channel-view h-full flex flex-col",
|
|
2428
2456
|
d
|
|
2429
2457
|
),
|
|
2430
|
-
children: /* @__PURE__ */ n(
|
|
2431
|
-
|
|
2458
|
+
children: /* @__PURE__ */ n(dn.Provider, { value: _ ?? !1, children: /* @__PURE__ */ n(
|
|
2459
|
+
os,
|
|
2432
2460
|
{
|
|
2433
2461
|
channel: e,
|
|
2434
2462
|
MessageSystem: Ha,
|
|
@@ -2436,9 +2464,9 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2436
2464
|
LoadingIndicator: Se,
|
|
2437
2465
|
DateSeparator: Vs,
|
|
2438
2466
|
TypingIndicator: qa,
|
|
2439
|
-
doSendMessageRequest:
|
|
2440
|
-
...
|
|
2441
|
-
...
|
|
2467
|
+
doSendMessageRequest: B,
|
|
2468
|
+
...F ? { SendButton: F } : {},
|
|
2469
|
+
...T ? { AttachmentPreviewList: T } : {},
|
|
2442
2470
|
children: /* @__PURE__ */ n(
|
|
2443
2471
|
Za,
|
|
2444
2472
|
{
|
|
@@ -2455,18 +2483,19 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2455
2483
|
onBlockParticipantClick: f,
|
|
2456
2484
|
onReportParticipantClick: c,
|
|
2457
2485
|
showBlockParticipant: b,
|
|
2458
|
-
showReportParticipant:
|
|
2486
|
+
showReportParticipant: w,
|
|
2459
2487
|
composerDisabled: p,
|
|
2460
|
-
composerDisabledReason:
|
|
2461
|
-
showStarButton:
|
|
2488
|
+
composerDisabledReason: v,
|
|
2489
|
+
showStarButton: M,
|
|
2462
2490
|
dmAgentEnabled: _,
|
|
2463
2491
|
chatbotVotingEnabled: D,
|
|
2464
|
-
renderChannelBanner:
|
|
2465
|
-
customChannelActions:
|
|
2492
|
+
renderChannelBanner: $,
|
|
2493
|
+
customChannelActions: L,
|
|
2466
2494
|
renderChannelActions: N,
|
|
2467
|
-
renderMessage:
|
|
2468
|
-
viewerLanguage:
|
|
2469
|
-
showChannelInfo: A
|
|
2495
|
+
renderMessage: I,
|
|
2496
|
+
viewerLanguage: E,
|
|
2497
|
+
showChannelInfo: A,
|
|
2498
|
+
onParticipantNameClick: O
|
|
2470
2499
|
}
|
|
2471
2500
|
)
|
|
2472
2501
|
}
|
|
@@ -2475,8 +2504,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2475
2504
|
);
|
|
2476
2505
|
}
|
|
2477
2506
|
);
|
|
2478
|
-
|
|
2479
|
-
const be =
|
|
2507
|
+
un.displayName = "ChannelView";
|
|
2508
|
+
const be = U.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: [
|
|
2480
2509
|
/* @__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: "⚠️" }) }),
|
|
2481
2510
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2482
2511
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2507,107 +2536,107 @@ const ki = ({
|
|
|
2507
2536
|
chatbotVotingEnabled: f = !1,
|
|
2508
2537
|
viewerLanguage: c,
|
|
2509
2538
|
renderChannelBanner: b,
|
|
2510
|
-
customChannelActions:
|
|
2539
|
+
customChannelActions: w,
|
|
2511
2540
|
renderChannelActions: p,
|
|
2512
|
-
renderMessage:
|
|
2541
|
+
renderMessage: v,
|
|
2513
2542
|
onMessageLinkClick: _,
|
|
2514
|
-
showChannelInfo:
|
|
2543
|
+
showChannelInfo: R
|
|
2515
2544
|
}) => {
|
|
2516
2545
|
const {
|
|
2517
|
-
client:
|
|
2518
|
-
isConnected:
|
|
2546
|
+
client: y,
|
|
2547
|
+
isConnected: M,
|
|
2519
2548
|
isLoading: D,
|
|
2520
|
-
error:
|
|
2521
|
-
refreshConnection:
|
|
2549
|
+
error: $,
|
|
2550
|
+
refreshConnection: L,
|
|
2522
2551
|
service: N,
|
|
2523
|
-
debug:
|
|
2524
|
-
} =
|
|
2525
|
-
|
|
2526
|
-
const
|
|
2527
|
-
|
|
2528
|
-
const
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
}, [
|
|
2532
|
-
if (!
|
|
2533
|
-
const
|
|
2534
|
-
if (!
|
|
2535
|
-
const
|
|
2536
|
-
if (
|
|
2537
|
-
|
|
2538
|
-
const
|
|
2539
|
-
|
|
2552
|
+
debug: I
|
|
2553
|
+
} = Ps(), [S, F] = z(null), [T, E] = z(null), [A, O] = z(!1), { showDeleteConversation: B = !0 } = e, H = j(o);
|
|
2554
|
+
H.current = o;
|
|
2555
|
+
const V = j(a);
|
|
2556
|
+
V.current = a;
|
|
2557
|
+
const Y = j(null), q = j(null);
|
|
2558
|
+
X(() => {
|
|
2559
|
+
q.current = S;
|
|
2560
|
+
}, [S]), X(() => {
|
|
2561
|
+
if (!y || !M) return;
|
|
2562
|
+
const P = y.userID;
|
|
2563
|
+
if (!P) return;
|
|
2564
|
+
const W = `${P}::${i}`;
|
|
2565
|
+
if (Y.current === W) return;
|
|
2566
|
+
Y.current = W;
|
|
2567
|
+
const K = () => {
|
|
2568
|
+
Y.current === W && (Y.current = null);
|
|
2540
2569
|
};
|
|
2541
2570
|
(async () => {
|
|
2542
|
-
var
|
|
2571
|
+
var ee, ue;
|
|
2543
2572
|
try {
|
|
2544
|
-
|
|
2573
|
+
I && console.log(
|
|
2545
2574
|
"[MessagingShell] Loading initial conversation with:",
|
|
2546
2575
|
i
|
|
2547
2576
|
);
|
|
2548
|
-
const Z = await
|
|
2577
|
+
const Z = await y.queryChannels(
|
|
2549
2578
|
{
|
|
2550
2579
|
type: "messaging",
|
|
2551
|
-
members: { $eq: [
|
|
2580
|
+
members: { $eq: [P, i] }
|
|
2552
2581
|
},
|
|
2553
2582
|
{},
|
|
2554
2583
|
{ limit: 1 }
|
|
2555
2584
|
);
|
|
2556
2585
|
if (Z.length > 0) {
|
|
2557
|
-
|
|
2586
|
+
F(Z[0]), E(null), (ee = V.current) == null || ee.call(V, Z[0]), I && console.log(
|
|
2558
2587
|
"[MessagingShell] Initial conversation loaded:",
|
|
2559
2588
|
Z[0].id
|
|
2560
2589
|
);
|
|
2561
2590
|
return;
|
|
2562
2591
|
}
|
|
2563
|
-
const
|
|
2564
|
-
if (!
|
|
2565
|
-
|
|
2592
|
+
const re = H.current;
|
|
2593
|
+
if (!re || !N) {
|
|
2594
|
+
K(), E("No conversation found with this account"), I && console.log(
|
|
2566
2595
|
"[MessagingShell] No conversation found for:",
|
|
2567
2596
|
i
|
|
2568
2597
|
);
|
|
2569
2598
|
return;
|
|
2570
2599
|
}
|
|
2571
2600
|
try {
|
|
2572
|
-
const
|
|
2573
|
-
id:
|
|
2574
|
-
name:
|
|
2575
|
-
phone:
|
|
2601
|
+
const te = await N.startChannelWithParticipant({
|
|
2602
|
+
id: re.id,
|
|
2603
|
+
name: re.name,
|
|
2604
|
+
phone: re.phone
|
|
2576
2605
|
});
|
|
2577
|
-
|
|
2606
|
+
F(te), E(null), (ue = V.current) == null || ue.call(V, te), I && console.log(
|
|
2578
2607
|
"[MessagingShell] Channel created and loaded:",
|
|
2579
|
-
|
|
2608
|
+
te.id
|
|
2580
2609
|
);
|
|
2581
|
-
} catch (
|
|
2610
|
+
} catch (te) {
|
|
2582
2611
|
console.error(
|
|
2583
2612
|
"[MessagingShell] Failed to create conversation:",
|
|
2584
|
-
|
|
2585
|
-
),
|
|
2613
|
+
te
|
|
2614
|
+
), K(), E("Failed to create conversation");
|
|
2586
2615
|
}
|
|
2587
2616
|
} catch (Z) {
|
|
2588
2617
|
console.error(
|
|
2589
2618
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2590
2619
|
Z
|
|
2591
|
-
),
|
|
2620
|
+
), K(), q.current || E("Failed to load conversation");
|
|
2592
2621
|
}
|
|
2593
2622
|
})();
|
|
2594
|
-
}, [i,
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2597
|
-
const k =
|
|
2598
|
-
var
|
|
2599
|
-
|
|
2623
|
+
}, [i, y, M, N, I]);
|
|
2624
|
+
const x = j(r);
|
|
2625
|
+
x.current = r;
|
|
2626
|
+
const k = J(() => {
|
|
2627
|
+
var P;
|
|
2628
|
+
F(null), O(!0), (P = x.current) == null || P.call(x);
|
|
2600
2629
|
}, []);
|
|
2601
|
-
return D ? /* @__PURE__ */ n(Se, {}) :
|
|
2630
|
+
return D ? /* @__PURE__ */ n(Se, {}) : $ ? /* @__PURE__ */ n(be, { message: $, onBack: L }) : !M || !y ? /* @__PURE__ */ n(
|
|
2602
2631
|
be,
|
|
2603
2632
|
{
|
|
2604
2633
|
message: "Not connected to messaging service",
|
|
2605
|
-
onBack:
|
|
2634
|
+
onBack: L
|
|
2606
2635
|
}
|
|
2607
|
-
) :
|
|
2608
|
-
|
|
2636
|
+
) : T ? /* @__PURE__ */ n(be, { message: T }) : A && !S ? /* @__PURE__ */ n(be, { message: "Conversation ended" }) : S ? /* @__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(
|
|
2637
|
+
un,
|
|
2609
2638
|
{
|
|
2610
|
-
channel:
|
|
2639
|
+
channel: S,
|
|
2611
2640
|
renderMessageInputActions: t,
|
|
2612
2641
|
renderConversationFooter: s,
|
|
2613
2642
|
renderChannelBanner: b,
|
|
@@ -2621,13 +2650,13 @@ const ki = ({
|
|
|
2621
2650
|
onMessageSent: u,
|
|
2622
2651
|
chatbotVotingEnabled: f,
|
|
2623
2652
|
viewerLanguage: c,
|
|
2624
|
-
customChannelActions:
|
|
2653
|
+
customChannelActions: w,
|
|
2625
2654
|
renderChannelActions: p,
|
|
2626
|
-
renderMessage:
|
|
2655
|
+
renderMessage: v,
|
|
2627
2656
|
onMessageLinkClick: _,
|
|
2628
|
-
showChannelInfo:
|
|
2657
|
+
showChannelInfo: R
|
|
2629
2658
|
},
|
|
2630
|
-
|
|
2659
|
+
S.id
|
|
2631
2660
|
) }) }) : /* @__PURE__ */ n(Se, {});
|
|
2632
2661
|
};
|
|
2633
2662
|
function Qa(e) {
|
|
@@ -2636,14 +2665,14 @@ function Qa(e) {
|
|
|
2636
2665
|
for (const s of t)
|
|
2637
2666
|
e.state.addMessageSorted(s.message);
|
|
2638
2667
|
}
|
|
2639
|
-
const
|
|
2668
|
+
const mn = U.createContext({
|
|
2640
2669
|
selectedChannel: void 0,
|
|
2641
2670
|
onChannelSelect: () => {
|
|
2642
2671
|
},
|
|
2643
2672
|
debug: !1,
|
|
2644
2673
|
renderMessagePreview: void 0,
|
|
2645
2674
|
viewerLanguage: void 0
|
|
2646
|
-
}), er =
|
|
2675
|
+
}), er = mn.Provider, tr = () => U.useContext(mn), nr = (e, t) => {
|
|
2647
2676
|
const s = new Date(
|
|
2648
2677
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2649
2678
|
), r = new Date(
|
|
@@ -2664,9 +2693,9 @@ const un = j.createContext({
|
|
|
2664
2693
|
day: "numeric",
|
|
2665
2694
|
year: "2-digit"
|
|
2666
2695
|
});
|
|
2667
|
-
},
|
|
2696
|
+
}, hn = U.memo(
|
|
2668
2697
|
({ channel: e, unread: t }) => {
|
|
2669
|
-
var D,
|
|
2698
|
+
var D, $, L;
|
|
2670
2699
|
const {
|
|
2671
2700
|
selectedChannel: s,
|
|
2672
2701
|
onChannelSelect: a,
|
|
@@ -2676,39 +2705,39 @@ const un = j.createContext({
|
|
|
2676
2705
|
} = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2677
2706
|
e && a(e);
|
|
2678
2707
|
}, m = (N) => {
|
|
2679
|
-
const
|
|
2680
|
-
!
|
|
2708
|
+
const I = N.key === "Enter" || N.key === " ", S = N.repeat;
|
|
2709
|
+
!I || S || (N.preventDefault(), d());
|
|
2681
2710
|
}, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
|
|
2682
2711
|
(N) => {
|
|
2683
|
-
var
|
|
2684
|
-
return ((
|
|
2712
|
+
var I, S;
|
|
2713
|
+
return ((I = N.user) == null ? void 0 : I.id) && N.user.id !== ((S = e == null ? void 0 : e._client) == null ? void 0 : S.userID);
|
|
2685
2714
|
}
|
|
2686
|
-
), f =
|
|
2687
|
-
var
|
|
2688
|
-
const N = (
|
|
2715
|
+
), f = Xt(u == null ? void 0 : u.user), c = ($ = u == null ? void 0 : u.user) == null ? void 0 : $.image, b = (() => {
|
|
2716
|
+
var I;
|
|
2717
|
+
const N = (I = e == null ? void 0 : e.state) == null ? void 0 : I.messages;
|
|
2689
2718
|
if (N != null && N.length) {
|
|
2690
|
-
for (let
|
|
2691
|
-
if (N[
|
|
2719
|
+
for (let S = N.length - 1; S >= 0; S--)
|
|
2720
|
+
if (N[S].type !== "system") return N[S];
|
|
2692
2721
|
}
|
|
2693
2722
|
})(), p = (() => {
|
|
2694
|
-
var
|
|
2695
|
-
const N =
|
|
2723
|
+
var E, A, O, B;
|
|
2724
|
+
const N = Kt({
|
|
2696
2725
|
message: b,
|
|
2697
2726
|
viewerLanguage: o
|
|
2698
2727
|
});
|
|
2699
|
-
if (((
|
|
2728
|
+
if (((E = b == null ? void 0 : b.metadata) == null ? void 0 : E.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
|
|
2700
2729
|
if (((A = b == null ? void 0 : b.metadata) == null ? void 0 : A.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
|
|
2701
|
-
if (((
|
|
2730
|
+
if (((O = b == null ? void 0 : b.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
|
|
2702
2731
|
if (N) return N;
|
|
2703
|
-
const
|
|
2704
|
-
return
|
|
2705
|
-
})(),
|
|
2732
|
+
const T = (B = b == null ? void 0 : b.attachments) == null ? void 0 : B[0];
|
|
2733
|
+
return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2734
|
+
})(), v = b != null && b.created_at ? sr(new Date(b.created_at)) : "", _ = b ? Ee(b) : !1, R = i ? i(b, p) : `${_ ? "✨ " : ""}${p}`, y = Wt(e), M = t ?? 0;
|
|
2706
2735
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2707
2736
|
channelId: e == null ? void 0 : e.id,
|
|
2708
2737
|
isSelected: l,
|
|
2709
2738
|
participantName: f,
|
|
2710
|
-
unreadCount:
|
|
2711
|
-
hasTimestamp: !!
|
|
2739
|
+
unreadCount: M,
|
|
2740
|
+
hasTimestamp: !!v
|
|
2712
2741
|
}), /* @__PURE__ */ n(
|
|
2713
2742
|
"div",
|
|
2714
2743
|
{
|
|
@@ -2716,7 +2745,7 @@ const un = j.createContext({
|
|
|
2716
2745
|
tabIndex: 0,
|
|
2717
2746
|
onClick: d,
|
|
2718
2747
|
onKeyDown: m,
|
|
2719
|
-
className:
|
|
2748
|
+
className: C(
|
|
2720
2749
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2721
2750
|
{
|
|
2722
2751
|
"bg-black/[0.04]": l,
|
|
@@ -2725,13 +2754,13 @@ const un = j.createContext({
|
|
|
2725
2754
|
),
|
|
2726
2755
|
children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
|
|
2727
2756
|
/* @__PURE__ */ n(
|
|
2728
|
-
|
|
2757
|
+
ie,
|
|
2729
2758
|
{
|
|
2730
|
-
id: ((
|
|
2759
|
+
id: ((L = u == null ? void 0 : u.user) == null ? void 0 : L.id) || e.id || "unknown",
|
|
2731
2760
|
name: f,
|
|
2732
2761
|
image: c,
|
|
2733
2762
|
size: 48,
|
|
2734
|
-
starred:
|
|
2763
|
+
starred: y
|
|
2735
2764
|
}
|
|
2736
2765
|
),
|
|
2737
2766
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2739,20 +2768,20 @@ const un = j.createContext({
|
|
|
2739
2768
|
/* @__PURE__ */ h(
|
|
2740
2769
|
"h3",
|
|
2741
2770
|
{
|
|
2742
|
-
className:
|
|
2771
|
+
className: C(
|
|
2743
2772
|
"text-sm font-medium truncate text-[#191918]"
|
|
2744
2773
|
),
|
|
2745
2774
|
children: [
|
|
2746
|
-
|
|
2775
|
+
y && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2747
2776
|
f
|
|
2748
2777
|
]
|
|
2749
2778
|
}
|
|
2750
2779
|
),
|
|
2751
|
-
|
|
2780
|
+
v && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: v })
|
|
2752
2781
|
] }),
|
|
2753
2782
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2754
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2755
|
-
|
|
2783
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: R }),
|
|
2784
|
+
M > 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: M > 99 ? "99+" : M })
|
|
2756
2785
|
] })
|
|
2757
2786
|
] })
|
|
2758
2787
|
] })
|
|
@@ -2760,8 +2789,8 @@ const un = j.createContext({
|
|
|
2760
2789
|
);
|
|
2761
2790
|
}
|
|
2762
2791
|
);
|
|
2763
|
-
|
|
2764
|
-
const ar = { last_message_at: -1 }, rr =
|
|
2792
|
+
hn.displayName = "CustomChannelPreview";
|
|
2793
|
+
const ar = { last_message_at: -1 }, rr = U.memo(
|
|
2765
2794
|
({
|
|
2766
2795
|
onChannelSelect: e,
|
|
2767
2796
|
selectedChannel: t,
|
|
@@ -2774,12 +2803,12 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2774
2803
|
renderMessagePreview: d,
|
|
2775
2804
|
viewerLanguage: m
|
|
2776
2805
|
}) => {
|
|
2777
|
-
const g =
|
|
2806
|
+
const g = U.useRef(0);
|
|
2778
2807
|
g.current++;
|
|
2779
|
-
const { debug: u = !1 } =
|
|
2808
|
+
const { debug: u = !1 } = Xe(), f = U.useCallback(
|
|
2780
2809
|
(b) => {
|
|
2781
|
-
for (const
|
|
2782
|
-
Qa(
|
|
2810
|
+
for (const w of b)
|
|
2811
|
+
Qa(w);
|
|
2783
2812
|
return r ? r(b) : b;
|
|
2784
2813
|
},
|
|
2785
2814
|
[r]
|
|
@@ -2789,7 +2818,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2789
2818
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2790
2819
|
filters: s
|
|
2791
2820
|
});
|
|
2792
|
-
const c =
|
|
2821
|
+
const c = U.useMemo(
|
|
2793
2822
|
() => ({
|
|
2794
2823
|
selectedChannel: t,
|
|
2795
2824
|
onChannelSelect: e,
|
|
@@ -2808,20 +2837,20 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2808
2837
|
return /* @__PURE__ */ n(
|
|
2809
2838
|
"div",
|
|
2810
2839
|
{
|
|
2811
|
-
className:
|
|
2840
|
+
className: C(
|
|
2812
2841
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2813
2842
|
o
|
|
2814
2843
|
),
|
|
2815
2844
|
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(er, { value: c, children: /* @__PURE__ */ n(
|
|
2816
|
-
|
|
2845
|
+
us,
|
|
2817
2846
|
{
|
|
2818
2847
|
filters: s,
|
|
2819
2848
|
sort: i,
|
|
2820
2849
|
options: { limit: 30 },
|
|
2821
2850
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2822
2851
|
channelRenderFilterFn: f,
|
|
2823
|
-
Paginator:
|
|
2824
|
-
Preview:
|
|
2852
|
+
Paginator: ms,
|
|
2853
|
+
Preview: hn,
|
|
2825
2854
|
EmptyStateIndicator: l
|
|
2826
2855
|
},
|
|
2827
2856
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
@@ -2832,7 +2861,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2832
2861
|
);
|
|
2833
2862
|
rr.displayName = "ChannelList";
|
|
2834
2863
|
const ir = /^([a-z][a-z0-9+.-]*):/i, or = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2835
|
-
function
|
|
2864
|
+
function tt(e) {
|
|
2836
2865
|
if (typeof e != "string") return;
|
|
2837
2866
|
const t = e.trim();
|
|
2838
2867
|
if (t === "") return;
|
|
@@ -2847,10 +2876,10 @@ const lr = {
|
|
|
2847
2876
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2848
2877
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2849
2878
|
}, cr = ({ variant: e, cta: t }) => {
|
|
2850
|
-
const s =
|
|
2879
|
+
const s = C(
|
|
2851
2880
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2852
2881
|
lr[e]
|
|
2853
|
-
), a =
|
|
2882
|
+
), a = tt(t.href);
|
|
2854
2883
|
return a ? /* @__PURE__ */ n(
|
|
2855
2884
|
"a",
|
|
2856
2885
|
{
|
|
@@ -2882,7 +2911,7 @@ const lr = {
|
|
|
2882
2911
|
}, ur = "text-white/30", mr = {
|
|
2883
2912
|
dark: "text-white/55",
|
|
2884
2913
|
light: "text-black/55"
|
|
2885
|
-
},
|
|
2914
|
+
}, nt = ({
|
|
2886
2915
|
variant: e,
|
|
2887
2916
|
title: t,
|
|
2888
2917
|
placeholderTitle: s,
|
|
@@ -2894,10 +2923,10 @@ const lr = {
|
|
|
2894
2923
|
}) => {
|
|
2895
2924
|
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 = o != null;
|
|
2896
2925
|
if (!g && !u && !c && !b) return null;
|
|
2897
|
-
const p =
|
|
2926
|
+
const p = C(
|
|
2898
2927
|
"truncate text-base font-medium leading-6",
|
|
2899
2928
|
d && !t ? ur : dr[e]
|
|
2900
|
-
),
|
|
2929
|
+
), v = C(
|
|
2901
2930
|
"truncate text-xs leading-4",
|
|
2902
2931
|
mr[e]
|
|
2903
2932
|
);
|
|
@@ -2907,17 +2936,17 @@ const lr = {
|
|
|
2907
2936
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2908
2937
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2909
2938
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2910
|
-
/* @__PURE__ */ n("p", { className:
|
|
2939
|
+
/* @__PURE__ */ n("p", { className: C("min-w-0", p), children: m })
|
|
2911
2940
|
] }),
|
|
2912
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2941
|
+
u && /* @__PURE__ */ n("p", { className: v, children: a })
|
|
2913
2942
|
] }),
|
|
2914
|
-
!b && c && /* @__PURE__ */ n("p", { className:
|
|
2943
|
+
!b && c && /* @__PURE__ */ n("p", { className: v, children: f })
|
|
2915
2944
|
] }),
|
|
2916
2945
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2917
2946
|
] }),
|
|
2918
2947
|
o && /* @__PURE__ */ n(cr, { variant: e, cta: o })
|
|
2919
2948
|
] });
|
|
2920
|
-
}, hr =
|
|
2949
|
+
}, hr = C(
|
|
2921
2950
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2922
2951
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2923
2952
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2935,7 +2964,7 @@ const lr = {
|
|
|
2935
2964
|
bgClassName: l,
|
|
2936
2965
|
"data-testid": d
|
|
2937
2966
|
}) => {
|
|
2938
|
-
const m = s != null || a != null, g =
|
|
2967
|
+
const m = s != null || a != null, g = C(
|
|
2939
2968
|
hr,
|
|
2940
2969
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2941
2970
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -2966,7 +2995,7 @@ const lr = {
|
|
|
2966
2995
|
onClick: a,
|
|
2967
2996
|
"aria-label": r,
|
|
2968
2997
|
"data-testid": d,
|
|
2969
|
-
className:
|
|
2998
|
+
className: C(g, "text-left"),
|
|
2970
2999
|
children: [
|
|
2971
3000
|
t,
|
|
2972
3001
|
u
|
|
@@ -2990,11 +3019,11 @@ const lr = {
|
|
|
2990
3019
|
}, gr = {
|
|
2991
3020
|
dark: "size-16 text-white/25",
|
|
2992
3021
|
light: "size-16 text-black/25"
|
|
2993
|
-
}, Re = (e, t) => !!t && !!e &&
|
|
3022
|
+
}, Re = (e, t) => !!t && !!e && ae(e) === "audio", fn = (e, t) => {
|
|
2994
3023
|
if (!t || !e) return !1;
|
|
2995
|
-
const s =
|
|
3024
|
+
const s = ae(e);
|
|
2996
3025
|
return s === "video" || s === "audio";
|
|
2997
|
-
},
|
|
3026
|
+
}, st = "bg-[#F2F3F4]", Te = ({
|
|
2998
3027
|
variant: e,
|
|
2999
3028
|
thumbnailUrl: t,
|
|
3000
3029
|
sourceUrl: s,
|
|
@@ -3003,7 +3032,7 @@ const lr = {
|
|
|
3003
3032
|
topLeft: i,
|
|
3004
3033
|
topRight: o
|
|
3005
3034
|
}) => {
|
|
3006
|
-
const l =
|
|
3035
|
+
const l = ae(r), d = !!s && l === "video";
|
|
3007
3036
|
return Re(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3008
3037
|
"audio",
|
|
3009
3038
|
{
|
|
@@ -3016,7 +3045,7 @@ const lr = {
|
|
|
3016
3045
|
) }) : /* @__PURE__ */ h(
|
|
3017
3046
|
"div",
|
|
3018
3047
|
{
|
|
3019
|
-
className:
|
|
3048
|
+
className: C(
|
|
3020
3049
|
"relative h-[180px] w-full overflow-hidden",
|
|
3021
3050
|
d && "bg-black"
|
|
3022
3051
|
),
|
|
@@ -3043,7 +3072,7 @@ const lr = {
|
|
|
3043
3072
|
) : /* @__PURE__ */ n(
|
|
3044
3073
|
"div",
|
|
3045
3074
|
{
|
|
3046
|
-
className:
|
|
3075
|
+
className: C(
|
|
3047
3076
|
"flex h-full w-full items-center justify-center",
|
|
3048
3077
|
fr[e]
|
|
3049
3078
|
),
|
|
@@ -3081,17 +3110,17 @@ const lr = {
|
|
|
3081
3110
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3082
3111
|
children: /* @__PURE__ */ n(Me, { className: "size-3", weight: "bold" })
|
|
3083
3112
|
}
|
|
3084
|
-
) : void 0,
|
|
3113
|
+
) : void 0, w = u ? /* @__PURE__ */ n(
|
|
3085
3114
|
"button",
|
|
3086
3115
|
{
|
|
3087
3116
|
type: "button",
|
|
3088
3117
|
onClick: u,
|
|
3089
3118
|
"aria-label": "Edit attachment",
|
|
3090
3119
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3091
|
-
children: /* @__PURE__ */ n(
|
|
3120
|
+
children: /* @__PURE__ */ n(Ls, { className: "size-5", weight: "regular" })
|
|
3092
3121
|
}
|
|
3093
3122
|
) : void 0;
|
|
3094
|
-
return c ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName:
|
|
3123
|
+
return c ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: st, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3095
3124
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3096
3125
|
Te,
|
|
3097
3126
|
{
|
|
@@ -3120,7 +3149,7 @@ const lr = {
|
|
|
3120
3149
|
}
|
|
3121
3150
|
),
|
|
3122
3151
|
/* @__PURE__ */ n(
|
|
3123
|
-
|
|
3152
|
+
nt,
|
|
3124
3153
|
{
|
|
3125
3154
|
variant: "dark",
|
|
3126
3155
|
title: e,
|
|
@@ -3129,7 +3158,7 @@ const lr = {
|
|
|
3129
3158
|
url: a,
|
|
3130
3159
|
appIcon: d,
|
|
3131
3160
|
cta: m,
|
|
3132
|
-
trailingAction:
|
|
3161
|
+
trailingAction: w
|
|
3133
3162
|
}
|
|
3134
3163
|
)
|
|
3135
3164
|
]
|
|
@@ -3147,7 +3176,7 @@ const lr = {
|
|
|
3147
3176
|
cta: d,
|
|
3148
3177
|
onClick: m
|
|
3149
3178
|
}) => {
|
|
3150
|
-
const g =
|
|
3179
|
+
const g = fn(a, i), u = tt(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Re(a, i) ? st : void 0, w = d && m ? {
|
|
3151
3180
|
...d,
|
|
3152
3181
|
onClick: () => {
|
|
3153
3182
|
var p;
|
|
@@ -3175,14 +3204,14 @@ const lr = {
|
|
|
3175
3204
|
}
|
|
3176
3205
|
),
|
|
3177
3206
|
/* @__PURE__ */ n(
|
|
3178
|
-
|
|
3207
|
+
nt,
|
|
3179
3208
|
{
|
|
3180
3209
|
variant: "light",
|
|
3181
3210
|
title: e,
|
|
3182
3211
|
description: t,
|
|
3183
3212
|
url: s,
|
|
3184
3213
|
appIcon: l,
|
|
3185
|
-
cta:
|
|
3214
|
+
cta: w
|
|
3186
3215
|
}
|
|
3187
3216
|
)
|
|
3188
3217
|
]
|
|
@@ -3201,14 +3230,14 @@ const lr = {
|
|
|
3201
3230
|
cta: m,
|
|
3202
3231
|
onClick: g
|
|
3203
3232
|
}) => {
|
|
3204
|
-
const u =
|
|
3233
|
+
const u = fn(r, o), f = tt(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
|
|
3205
3234
|
return /* @__PURE__ */ h(
|
|
3206
3235
|
Ie,
|
|
3207
3236
|
{
|
|
3208
3237
|
variant: "dark",
|
|
3209
3238
|
href: c,
|
|
3210
3239
|
onClick: b,
|
|
3211
|
-
bgClassName: Re(r, o) ?
|
|
3240
|
+
bgClassName: Re(r, o) ? st : void 0,
|
|
3212
3241
|
children: [
|
|
3213
3242
|
l === "featured" && /* @__PURE__ */ n(
|
|
3214
3243
|
Te,
|
|
@@ -3221,7 +3250,7 @@ const lr = {
|
|
|
3221
3250
|
}
|
|
3222
3251
|
),
|
|
3223
3252
|
/* @__PURE__ */ n(
|
|
3224
|
-
|
|
3253
|
+
nt,
|
|
3225
3254
|
{
|
|
3226
3255
|
variant: "dark",
|
|
3227
3256
|
title: e,
|
|
@@ -3276,7 +3305,7 @@ const lr = {
|
|
|
3276
3305
|
{
|
|
3277
3306
|
"data-testid": o,
|
|
3278
3307
|
"data-group-position": a,
|
|
3279
|
-
className:
|
|
3308
|
+
className: C(
|
|
3280
3309
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3281
3310
|
// and keeps the document / image / audio bubbles visually
|
|
3282
3311
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3296,7 +3325,7 @@ const lr = {
|
|
|
3296
3325
|
l ? /* @__PURE__ */ n(
|
|
3297
3326
|
"p",
|
|
3298
3327
|
{
|
|
3299
|
-
className:
|
|
3328
|
+
className: C(
|
|
3300
3329
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3301
3330
|
// the same font family + size as `.str-chat__message-text`
|
|
3302
3331
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3325,7 +3354,7 @@ const lr = {
|
|
|
3325
3354
|
a.stopPropagation(), e();
|
|
3326
3355
|
},
|
|
3327
3356
|
"aria-label": s,
|
|
3328
|
-
className:
|
|
3357
|
+
className: C(
|
|
3329
3358
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3330
3359
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3331
3360
|
),
|
|
@@ -3352,7 +3381,7 @@ const lr = {
|
|
|
3352
3381
|
}
|
|
3353
3382
|
),
|
|
3354
3383
|
s ?? null
|
|
3355
|
-
] }),
|
|
3384
|
+
] }), at = ({
|
|
3356
3385
|
state: e,
|
|
3357
3386
|
src: t,
|
|
3358
3387
|
mimeType: s,
|
|
@@ -3389,7 +3418,7 @@ const lr = {
|
|
|
3389
3418
|
)) })
|
|
3390
3419
|
}
|
|
3391
3420
|
);
|
|
3392
|
-
}, Er = (e) => /* @__PURE__ */ n(
|
|
3421
|
+
}, Er = (e) => /* @__PURE__ */ n(at, { ...e, state: "composer" }), Sr = (e) => /* @__PURE__ */ n(at, { ...e, state: "sent" }), Ir = (e) => /* @__PURE__ */ n(at, { ...e, state: "received" }), Tr = {
|
|
3393
3422
|
Composer: Er,
|
|
3394
3423
|
Sent: Sr,
|
|
3395
3424
|
Received: Ir
|
|
@@ -3416,8 +3445,8 @@ function Rr(e, t) {
|
|
|
3416
3445
|
}
|
|
3417
3446
|
}
|
|
3418
3447
|
if (!e) return;
|
|
3419
|
-
if (
|
|
3420
|
-
const r =
|
|
3448
|
+
if (ae(e) === "document") {
|
|
3449
|
+
const r = Qt(e), i = Mr[r];
|
|
3421
3450
|
if (i) return i;
|
|
3422
3451
|
if (e === "application/octet-stream") return;
|
|
3423
3452
|
}
|
|
@@ -3440,13 +3469,13 @@ function Q(e) {
|
|
|
3440
3469
|
const Dr = {
|
|
3441
3470
|
dark: "text-white/55",
|
|
3442
3471
|
light: "text-black/65"
|
|
3443
|
-
},
|
|
3472
|
+
}, Or = {
|
|
3444
3473
|
dark: "bg-white/10",
|
|
3445
3474
|
light: "bg-black/5"
|
|
3446
|
-
},
|
|
3475
|
+
}, Pr = {
|
|
3447
3476
|
dark: "text-white/85",
|
|
3448
3477
|
light: "text-black/85"
|
|
3449
|
-
},
|
|
3478
|
+
}, gn = ({
|
|
3450
3479
|
variant: e,
|
|
3451
3480
|
filename: t,
|
|
3452
3481
|
title: s,
|
|
@@ -3459,13 +3488,13 @@ const Dr = {
|
|
|
3459
3488
|
const d = s ?? t ?? "File", m = Lr(a, t, r), g = /* @__PURE__ */ n(
|
|
3460
3489
|
"div",
|
|
3461
3490
|
{
|
|
3462
|
-
className:
|
|
3491
|
+
className: C(
|
|
3463
3492
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3464
|
-
|
|
3493
|
+
Or[e]
|
|
3465
3494
|
),
|
|
3466
3495
|
"aria-hidden": !0,
|
|
3467
3496
|
children: ce(a, {
|
|
3468
|
-
className:
|
|
3497
|
+
className: C("size-6", Pr[e]),
|
|
3469
3498
|
weight: "regular"
|
|
3470
3499
|
})
|
|
3471
3500
|
}
|
|
@@ -3474,7 +3503,7 @@ const Dr = {
|
|
|
3474
3503
|
m ? /* @__PURE__ */ n(
|
|
3475
3504
|
"p",
|
|
3476
3505
|
{
|
|
3477
|
-
className:
|
|
3506
|
+
className: C(
|
|
3478
3507
|
"truncate text-xs leading-4",
|
|
3479
3508
|
Dr[e]
|
|
3480
3509
|
),
|
|
@@ -3487,7 +3516,7 @@ const Dr = {
|
|
|
3487
3516
|
type: "button",
|
|
3488
3517
|
onClick: i,
|
|
3489
3518
|
"aria-label": o,
|
|
3490
|
-
className:
|
|
3519
|
+
className: C(
|
|
3491
3520
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3492
3521
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3493
3522
|
),
|
|
@@ -3496,7 +3525,7 @@ const Dr = {
|
|
|
3496
3525
|
u
|
|
3497
3526
|
]
|
|
3498
3527
|
}
|
|
3499
|
-
) : /* @__PURE__ */ h(
|
|
3528
|
+
) : /* @__PURE__ */ h(se, { children: [
|
|
3500
3529
|
g,
|
|
3501
3530
|
u
|
|
3502
3531
|
] });
|
|
@@ -3505,7 +3534,7 @@ const Dr = {
|
|
|
3505
3534
|
l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
|
|
3506
3535
|
] });
|
|
3507
3536
|
};
|
|
3508
|
-
async function
|
|
3537
|
+
async function bn(e, t) {
|
|
3509
3538
|
const s = t ?? Q(e);
|
|
3510
3539
|
try {
|
|
3511
3540
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -3535,7 +3564,7 @@ const zr = ({
|
|
|
3535
3564
|
}) => {
|
|
3536
3565
|
const i = t.filename ?? Q(t.src);
|
|
3537
3566
|
return /* @__PURE__ */ n(
|
|
3538
|
-
|
|
3567
|
+
gn,
|
|
3539
3568
|
{
|
|
3540
3569
|
variant: e,
|
|
3541
3570
|
filename: i,
|
|
@@ -3547,7 +3576,7 @@ const zr = ({
|
|
|
3547
3576
|
trailingAction: r
|
|
3548
3577
|
}
|
|
3549
3578
|
);
|
|
3550
|
-
},
|
|
3579
|
+
}, rt = ({
|
|
3551
3580
|
state: e,
|
|
3552
3581
|
src: t,
|
|
3553
3582
|
filename: s,
|
|
@@ -3569,17 +3598,17 @@ const zr = ({
|
|
|
3569
3598
|
items: o
|
|
3570
3599
|
}), b = (p) => {
|
|
3571
3600
|
if ((m == null ? void 0 : m(p)) === !1) return;
|
|
3572
|
-
const
|
|
3573
|
-
if (!
|
|
3574
|
-
const _ =
|
|
3575
|
-
|
|
3601
|
+
const v = c[p];
|
|
3602
|
+
if (!v) return;
|
|
3603
|
+
const _ = v.filename ?? Q(v.src);
|
|
3604
|
+
bn(v.src, _);
|
|
3576
3605
|
};
|
|
3577
3606
|
if (c.length === 0)
|
|
3578
3607
|
return null;
|
|
3579
|
-
const
|
|
3608
|
+
const w = /* @__PURE__ */ n(
|
|
3580
3609
|
"span",
|
|
3581
3610
|
{
|
|
3582
|
-
className:
|
|
3611
|
+
className: C(
|
|
3583
3612
|
"flex size-8 items-center justify-center rounded-full",
|
|
3584
3613
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3585
3614
|
),
|
|
@@ -3594,29 +3623,29 @@ const zr = ({
|
|
|
3594
3623
|
text: l,
|
|
3595
3624
|
groupPosition: d,
|
|
3596
3625
|
"data-testid": "file-attachment",
|
|
3597
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p,
|
|
3626
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, v) => /* @__PURE__ */ n(
|
|
3598
3627
|
$r,
|
|
3599
3628
|
{
|
|
3600
3629
|
variant: u,
|
|
3601
3630
|
item: p,
|
|
3602
|
-
index:
|
|
3631
|
+
index: v,
|
|
3603
3632
|
onActivate: b,
|
|
3604
|
-
trailingAction: f &&
|
|
3633
|
+
trailingAction: f && v === 0 ? /* @__PURE__ */ n(_e, { onClick: g, variant: "inline" }) : w
|
|
3605
3634
|
},
|
|
3606
|
-
`${p.src}-${
|
|
3635
|
+
`${p.src}-${v}`
|
|
3607
3636
|
)) })
|
|
3608
3637
|
}
|
|
3609
3638
|
);
|
|
3610
|
-
}, Fr = (e) => /* @__PURE__ */ n(
|
|
3639
|
+
}, Fr = (e) => /* @__PURE__ */ n(rt, { ...e, state: "composer" }), Br = (e) => /* @__PURE__ */ n(rt, { ...e, state: "sent" }), Ur = (e) => /* @__PURE__ */ n(rt, { ...e, state: "received" }), jr = {
|
|
3611
3640
|
Composer: Fr,
|
|
3612
3641
|
Sent: Br,
|
|
3613
3642
|
Received: Ur
|
|
3614
|
-
},
|
|
3643
|
+
}, it = ({
|
|
3615
3644
|
onPrev: e,
|
|
3616
3645
|
onNext: t,
|
|
3617
3646
|
prevLabel: s = "Previous",
|
|
3618
3647
|
nextLabel: a = "Next"
|
|
3619
|
-
}) => /* @__PURE__ */ h(
|
|
3648
|
+
}) => /* @__PURE__ */ h(se, { children: [
|
|
3620
3649
|
/* @__PURE__ */ n(
|
|
3621
3650
|
"button",
|
|
3622
3651
|
{
|
|
@@ -3624,7 +3653,7 @@ const zr = ({
|
|
|
3624
3653
|
onClick: e,
|
|
3625
3654
|
"aria-label": s,
|
|
3626
3655
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3627
|
-
children: /* @__PURE__ */ n(
|
|
3656
|
+
children: /* @__PURE__ */ n(Ds, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3628
3657
|
}
|
|
3629
3658
|
),
|
|
3630
3659
|
/* @__PURE__ */ n(
|
|
@@ -3634,10 +3663,10 @@ const zr = ({
|
|
|
3634
3663
|
onClick: t,
|
|
3635
3664
|
"aria-label": a,
|
|
3636
3665
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3637
|
-
children: /* @__PURE__ */ n(
|
|
3666
|
+
children: /* @__PURE__ */ n(Ve, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3638
3667
|
}
|
|
3639
3668
|
)
|
|
3640
|
-
] }),
|
|
3669
|
+
] }), pn = ({
|
|
3641
3670
|
url: e,
|
|
3642
3671
|
filename: t,
|
|
3643
3672
|
variant: s = "pill",
|
|
@@ -3646,15 +3675,15 @@ const zr = ({
|
|
|
3646
3675
|
tone: i = "dark",
|
|
3647
3676
|
onTriggered: o
|
|
3648
3677
|
}) => {
|
|
3649
|
-
const [l, d] =
|
|
3678
|
+
const [l, d] = z(!1), m = J(
|
|
3650
3679
|
(c) => {
|
|
3651
|
-
c.stopPropagation(), !l && (d(!0),
|
|
3680
|
+
c.stopPropagation(), !l && (d(!0), bn(e, t).catch(() => {
|
|
3652
3681
|
}).finally(() => {
|
|
3653
3682
|
d(!1), o == null || o();
|
|
3654
3683
|
}));
|
|
3655
3684
|
},
|
|
3656
3685
|
[l, e, t, o]
|
|
3657
|
-
), g = r ?? s !== "pill", f = { className:
|
|
3686
|
+
), g = r ?? s !== "pill", f = { className: C(
|
|
3658
3687
|
s === "pill" ? "size-4" : "size-5",
|
|
3659
3688
|
"shrink-0"
|
|
3660
3689
|
), weight: "bold" };
|
|
@@ -3665,7 +3694,7 @@ const zr = ({
|
|
|
3665
3694
|
onClick: m,
|
|
3666
3695
|
disabled: l,
|
|
3667
3696
|
"aria-label": a,
|
|
3668
|
-
className:
|
|
3697
|
+
className: C(
|
|
3669
3698
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3670
3699
|
{
|
|
3671
3700
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3705,7 +3734,7 @@ const zr = ({
|
|
|
3705
3734
|
onClick: m,
|
|
3706
3735
|
disabled: l,
|
|
3707
3736
|
"aria-label": g ? a : void 0,
|
|
3708
|
-
className:
|
|
3737
|
+
className: C(
|
|
3709
3738
|
"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",
|
|
3710
3739
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3711
3740
|
),
|
|
@@ -3722,23 +3751,23 @@ const zr = ({
|
|
|
3722
3751
|
]
|
|
3723
3752
|
}
|
|
3724
3753
|
);
|
|
3725
|
-
}, Fe = (e, t, s) => Math.min(Math.max(e, t), s),
|
|
3754
|
+
}, Fe = (e, t, s) => Math.min(Math.max(e, t), s), ot = ({
|
|
3726
3755
|
length: e,
|
|
3727
3756
|
initialIndex: t,
|
|
3728
3757
|
open: s
|
|
3729
3758
|
}) => {
|
|
3730
|
-
const a = Fe(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3731
|
-
|
|
3759
|
+
const a = Fe(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
|
|
3760
|
+
X(() => {
|
|
3732
3761
|
s && i(Fe(t, 0, Math.max(e - 1, 0)));
|
|
3733
|
-
}, [s, t, e]),
|
|
3762
|
+
}, [s, t, e]), X(() => {
|
|
3734
3763
|
i((d) => Fe(d, 0, Math.max(e - 1, 0)));
|
|
3735
3764
|
}, [e]);
|
|
3736
|
-
const o =
|
|
3765
|
+
const o = J(() => {
|
|
3737
3766
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3738
|
-
}, [e]), l =
|
|
3767
|
+
}, [e]), l = J(() => {
|
|
3739
3768
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3740
3769
|
}, [e]);
|
|
3741
|
-
return
|
|
3770
|
+
return X(() => {
|
|
3742
3771
|
if (!s || e <= 1) return;
|
|
3743
3772
|
const d = (m) => {
|
|
3744
3773
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
@@ -3747,7 +3776,7 @@ const zr = ({
|
|
|
3747
3776
|
};
|
|
3748
3777
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3749
3778
|
}, [s, e, o, l]), { index: r, prev: o, next: l };
|
|
3750
|
-
},
|
|
3779
|
+
}, lt = ({
|
|
3751
3780
|
open: e,
|
|
3752
3781
|
onClose: t,
|
|
3753
3782
|
ariaLabel: s,
|
|
@@ -3756,8 +3785,8 @@ const zr = ({
|
|
|
3756
3785
|
children: i,
|
|
3757
3786
|
"data-testid": o
|
|
3758
3787
|
}) => {
|
|
3759
|
-
const l =
|
|
3760
|
-
return
|
|
3788
|
+
const l = j(null), d = j(null);
|
|
3789
|
+
return X(() => {
|
|
3761
3790
|
var f;
|
|
3762
3791
|
const u = l.current;
|
|
3763
3792
|
if (u) {
|
|
@@ -3837,29 +3866,29 @@ const zr = ({
|
|
|
3837
3866
|
]
|
|
3838
3867
|
}
|
|
3839
3868
|
);
|
|
3840
|
-
},
|
|
3869
|
+
}, vn = ({
|
|
3841
3870
|
open: e,
|
|
3842
3871
|
items: t,
|
|
3843
3872
|
initialIndex: s = 0,
|
|
3844
3873
|
onClose: a
|
|
3845
3874
|
}) => {
|
|
3846
|
-
const { index: r, prev: i, next: o } =
|
|
3875
|
+
const { index: r, prev: i, next: o } = ot({
|
|
3847
3876
|
length: t.length,
|
|
3848
3877
|
initialIndex: s,
|
|
3849
3878
|
open: e
|
|
3850
|
-
}), l = t[r], d =
|
|
3879
|
+
}), l = t[r], d = ne(
|
|
3851
3880
|
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "image"),
|
|
3852
3881
|
[l]
|
|
3853
3882
|
);
|
|
3854
3883
|
return l ? /* @__PURE__ */ h(
|
|
3855
|
-
|
|
3884
|
+
lt,
|
|
3856
3885
|
{
|
|
3857
3886
|
open: e,
|
|
3858
3887
|
onClose: a,
|
|
3859
3888
|
ariaLabel: d,
|
|
3860
3889
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
3861
3890
|
actions: /* @__PURE__ */ n(
|
|
3862
|
-
|
|
3891
|
+
pn,
|
|
3863
3892
|
{
|
|
3864
3893
|
url: l.src,
|
|
3865
3894
|
filename: d,
|
|
@@ -3882,7 +3911,7 @@ const zr = ({
|
|
|
3882
3911
|
`${r}:${l.src}`
|
|
3883
3912
|
),
|
|
3884
3913
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3885
|
-
|
|
3914
|
+
it,
|
|
3886
3915
|
{
|
|
3887
3916
|
onPrev: i,
|
|
3888
3917
|
onNext: o,
|
|
@@ -3893,7 +3922,7 @@ const zr = ({
|
|
|
3893
3922
|
]
|
|
3894
3923
|
}
|
|
3895
3924
|
) : null;
|
|
3896
|
-
}, Vr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black",
|
|
3925
|
+
}, Vr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", xn = ({
|
|
3897
3926
|
tiles: e,
|
|
3898
3927
|
onTileActivate: t,
|
|
3899
3928
|
maxVisible: s = 4,
|
|
@@ -3902,14 +3931,14 @@ const zr = ({
|
|
|
3902
3931
|
const r = e.length;
|
|
3903
3932
|
if (r === 0) return null;
|
|
3904
3933
|
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
|
|
3905
|
-
const u =
|
|
3934
|
+
const u = C(Vr, "h-full w-full");
|
|
3906
3935
|
return t ? /* @__PURE__ */ h(
|
|
3907
3936
|
"button",
|
|
3908
3937
|
{
|
|
3909
3938
|
type: "button",
|
|
3910
3939
|
onClick: () => t(m),
|
|
3911
3940
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
3912
|
-
className:
|
|
3941
|
+
className: C(u, "cursor-zoom-in"),
|
|
3913
3942
|
children: [
|
|
3914
3943
|
d.content,
|
|
3915
3944
|
g
|
|
@@ -3921,10 +3950,10 @@ const zr = ({
|
|
|
3921
3950
|
g
|
|
3922
3951
|
] }, m);
|
|
3923
3952
|
};
|
|
3924
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
3953
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
3925
3954
|
"div",
|
|
3926
3955
|
{
|
|
3927
|
-
className:
|
|
3956
|
+
className: C(
|
|
3928
3957
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
3929
3958
|
a
|
|
3930
3959
|
),
|
|
@@ -3933,7 +3962,7 @@ const zr = ({
|
|
|
3933
3962
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
3934
3963
|
"div",
|
|
3935
3964
|
{
|
|
3936
|
-
className:
|
|
3965
|
+
className: C(
|
|
3937
3966
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3938
3967
|
a
|
|
3939
3968
|
),
|
|
@@ -3946,7 +3975,7 @@ const zr = ({
|
|
|
3946
3975
|
) : /* @__PURE__ */ n(
|
|
3947
3976
|
"div",
|
|
3948
3977
|
{
|
|
3949
|
-
className:
|
|
3978
|
+
className: C(
|
|
3950
3979
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3951
3980
|
a
|
|
3952
3981
|
),
|
|
@@ -3964,12 +3993,12 @@ const zr = ({
|
|
|
3964
3993
|
}
|
|
3965
3994
|
);
|
|
3966
3995
|
}, ye = (e) => {
|
|
3967
|
-
const [t, s] =
|
|
3996
|
+
const [t, s] = z(!1), [a, r] = z(0), i = J(
|
|
3968
3997
|
(l) => {
|
|
3969
3998
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3970
3999
|
},
|
|
3971
4000
|
[e]
|
|
3972
|
-
), o =
|
|
4001
|
+
), o = J(() => s(!1), []);
|
|
3973
4002
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
3974
4003
|
}, Gr = (e, t, s, a) => ({
|
|
3975
4004
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
@@ -3990,7 +4019,7 @@ const zr = ({
|
|
|
3990
4019
|
src: e,
|
|
3991
4020
|
alt: t,
|
|
3992
4021
|
items: s
|
|
3993
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4022
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], wn = (e, t) => e.map((s, a) => ({
|
|
3994
4023
|
src: s.src,
|
|
3995
4024
|
alt: s.alt,
|
|
3996
4025
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
@@ -4021,16 +4050,16 @@ const zr = ({
|
|
|
4021
4050
|
),
|
|
4022
4051
|
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(_e, { onClick: i }) }) : null,
|
|
4023
4052
|
/* @__PURE__ */ n(
|
|
4024
|
-
|
|
4053
|
+
vn,
|
|
4025
4054
|
{
|
|
4026
4055
|
open: o,
|
|
4027
|
-
items:
|
|
4056
|
+
items: wn([{ src: e, alt: t }], s),
|
|
4028
4057
|
initialIndex: l,
|
|
4029
4058
|
onClose: m
|
|
4030
4059
|
}
|
|
4031
4060
|
)
|
|
4032
4061
|
] });
|
|
4033
|
-
},
|
|
4062
|
+
}, _n = ({
|
|
4034
4063
|
state: e,
|
|
4035
4064
|
src: t,
|
|
4036
4065
|
alt: s,
|
|
@@ -4046,8 +4075,8 @@ const zr = ({
|
|
|
4046
4075
|
);
|
|
4047
4076
|
if (m.length === 0)
|
|
4048
4077
|
return null;
|
|
4049
|
-
const
|
|
4050
|
-
(p,
|
|
4078
|
+
const w = m.map(
|
|
4079
|
+
(p, v) => Gr(p, v, m.length, l)
|
|
4051
4080
|
);
|
|
4052
4081
|
return /* @__PURE__ */ h(
|
|
4053
4082
|
we,
|
|
@@ -4057,12 +4086,12 @@ const zr = ({
|
|
|
4057
4086
|
groupPosition: o,
|
|
4058
4087
|
"data-testid": "image-attachment",
|
|
4059
4088
|
children: [
|
|
4060
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4089
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(xn, { tiles: w, onTileActivate: c }) }),
|
|
4061
4090
|
/* @__PURE__ */ n(
|
|
4062
|
-
|
|
4091
|
+
vn,
|
|
4063
4092
|
{
|
|
4064
4093
|
open: u,
|
|
4065
|
-
items:
|
|
4094
|
+
items: wn(m, a),
|
|
4066
4095
|
initialIndex: f,
|
|
4067
4096
|
onClose: b
|
|
4068
4097
|
}
|
|
@@ -4070,7 +4099,7 @@ const zr = ({
|
|
|
4070
4099
|
]
|
|
4071
4100
|
}
|
|
4072
4101
|
);
|
|
4073
|
-
}, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(
|
|
4102
|
+
}, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "sent" }), Xr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "received" }), Kr = {
|
|
4074
4103
|
Composer: qr,
|
|
4075
4104
|
Sent: Wr,
|
|
4076
4105
|
Received: Xr
|
|
@@ -4080,19 +4109,19 @@ const zr = ({
|
|
|
4080
4109
|
initialIndex: s = 0,
|
|
4081
4110
|
onClose: a
|
|
4082
4111
|
}) => {
|
|
4083
|
-
const { index: r, prev: i, next: o } =
|
|
4112
|
+
const { index: r, prev: i, next: o } = ot({
|
|
4084
4113
|
length: t.length,
|
|
4085
4114
|
initialIndex: s,
|
|
4086
4115
|
open: e
|
|
4087
|
-
}), l = t[r], d =
|
|
4116
|
+
}), l = t[r], d = ne(
|
|
4088
4117
|
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "document"),
|
|
4089
4118
|
[l]
|
|
4090
|
-
), m =
|
|
4119
|
+
), m = ne(
|
|
4091
4120
|
() => l ? Zr(l.src) : void 0,
|
|
4092
4121
|
[l]
|
|
4093
4122
|
);
|
|
4094
4123
|
return !l || !m ? null : /* @__PURE__ */ h(
|
|
4095
|
-
|
|
4124
|
+
lt,
|
|
4096
4125
|
{
|
|
4097
4126
|
open: e,
|
|
4098
4127
|
onClose: a,
|
|
@@ -4111,7 +4140,7 @@ const zr = ({
|
|
|
4111
4140
|
`${r}:${l.src}`
|
|
4112
4141
|
),
|
|
4113
4142
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4114
|
-
|
|
4143
|
+
it,
|
|
4115
4144
|
{
|
|
4116
4145
|
onPrev: i,
|
|
4117
4146
|
onNext: o,
|
|
@@ -4140,7 +4169,7 @@ const zr = ({
|
|
|
4140
4169
|
}) => {
|
|
4141
4170
|
const i = t.filename ?? Q(t.src);
|
|
4142
4171
|
return /* @__PURE__ */ n(
|
|
4143
|
-
|
|
4172
|
+
gn,
|
|
4144
4173
|
{
|
|
4145
4174
|
variant: e,
|
|
4146
4175
|
filename: i,
|
|
@@ -4152,7 +4181,7 @@ const zr = ({
|
|
|
4152
4181
|
trailingAction: r
|
|
4153
4182
|
}
|
|
4154
4183
|
);
|
|
4155
|
-
},
|
|
4184
|
+
}, ct = ({
|
|
4156
4185
|
state: e,
|
|
4157
4186
|
src: t,
|
|
4158
4187
|
filename: s,
|
|
@@ -4164,12 +4193,12 @@ const zr = ({
|
|
|
4164
4193
|
onClick: d,
|
|
4165
4194
|
onDismiss: m
|
|
4166
4195
|
}) => {
|
|
4167
|
-
const g = Ne(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer:
|
|
4196
|
+
const g = Ne(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: w } = ye(
|
|
4168
4197
|
d
|
|
4169
4198
|
), p = e === "composer" && !!m;
|
|
4170
4199
|
if (u.length === 0)
|
|
4171
4200
|
return null;
|
|
4172
|
-
const
|
|
4201
|
+
const v = u.map((_) => ({
|
|
4173
4202
|
src: _.src,
|
|
4174
4203
|
filename: _.filename ?? Q(_.src)
|
|
4175
4204
|
}));
|
|
@@ -4181,14 +4210,14 @@ const zr = ({
|
|
|
4181
4210
|
groupPosition: l,
|
|
4182
4211
|
"data-testid": "pdf-attachment",
|
|
4183
4212
|
children: [
|
|
4184
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_,
|
|
4185
|
-
const
|
|
4186
|
-
|
|
4213
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_, R) => {
|
|
4214
|
+
const y = _.filename ?? Q(_.src), M = p && R === 0 ? /* @__PURE__ */ n(_e, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4215
|
+
pn,
|
|
4187
4216
|
{
|
|
4188
4217
|
url: _.src,
|
|
4189
|
-
filename:
|
|
4218
|
+
filename: y,
|
|
4190
4219
|
variant: "inline",
|
|
4191
|
-
label: `Download ${
|
|
4220
|
+
label: `Download ${y}`,
|
|
4192
4221
|
tone: g
|
|
4193
4222
|
}
|
|
4194
4223
|
);
|
|
@@ -4197,45 +4226,45 @@ const zr = ({
|
|
|
4197
4226
|
{
|
|
4198
4227
|
variant: g,
|
|
4199
4228
|
item: _,
|
|
4200
|
-
index:
|
|
4229
|
+
index: R,
|
|
4201
4230
|
onActivate: b,
|
|
4202
|
-
trailingAction:
|
|
4231
|
+
trailingAction: M
|
|
4203
4232
|
},
|
|
4204
|
-
`${_.src}-${
|
|
4233
|
+
`${_.src}-${R}`
|
|
4205
4234
|
);
|
|
4206
4235
|
}) }),
|
|
4207
4236
|
/* @__PURE__ */ n(
|
|
4208
4237
|
Jr,
|
|
4209
4238
|
{
|
|
4210
4239
|
open: f,
|
|
4211
|
-
items:
|
|
4240
|
+
items: v,
|
|
4212
4241
|
initialIndex: c,
|
|
4213
|
-
onClose:
|
|
4242
|
+
onClose: w
|
|
4214
4243
|
}
|
|
4215
4244
|
)
|
|
4216
4245
|
]
|
|
4217
4246
|
}
|
|
4218
4247
|
);
|
|
4219
|
-
}, ti = (e) => /* @__PURE__ */ n(
|
|
4248
|
+
}, ti = (e) => /* @__PURE__ */ n(ct, { ...e, state: "composer" }), ni = (e) => /* @__PURE__ */ n(ct, { ...e, state: "sent" }), si = (e) => /* @__PURE__ */ n(ct, { ...e, state: "received" }), ai = {
|
|
4220
4249
|
Composer: ti,
|
|
4221
4250
|
Sent: ni,
|
|
4222
4251
|
Received: si
|
|
4223
|
-
},
|
|
4252
|
+
}, Nn = ({
|
|
4224
4253
|
open: e,
|
|
4225
4254
|
items: t,
|
|
4226
4255
|
initialIndex: s = 0,
|
|
4227
4256
|
onClose: a
|
|
4228
4257
|
}) => {
|
|
4229
|
-
const { index: r, prev: i, next: o } =
|
|
4258
|
+
const { index: r, prev: i, next: o } = ot({
|
|
4230
4259
|
length: t.length,
|
|
4231
4260
|
initialIndex: s,
|
|
4232
4261
|
open: e
|
|
4233
|
-
}), l = t[r], d =
|
|
4262
|
+
}), l = t[r], d = ne(
|
|
4234
4263
|
() => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "video"),
|
|
4235
4264
|
[l]
|
|
4236
4265
|
);
|
|
4237
4266
|
return l ? /* @__PURE__ */ h(
|
|
4238
|
-
|
|
4267
|
+
lt,
|
|
4239
4268
|
{
|
|
4240
4269
|
open: e,
|
|
4241
4270
|
onClose: a,
|
|
@@ -4259,7 +4288,7 @@ const zr = ({
|
|
|
4259
4288
|
`${r}:${l.src}`
|
|
4260
4289
|
),
|
|
4261
4290
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4262
|
-
|
|
4291
|
+
it,
|
|
4263
4292
|
{
|
|
4264
4293
|
onPrev: i,
|
|
4265
4294
|
onNext: o,
|
|
@@ -4270,7 +4299,7 @@ const zr = ({
|
|
|
4270
4299
|
]
|
|
4271
4300
|
}
|
|
4272
4301
|
) : null;
|
|
4273
|
-
}, 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(Ue, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }),
|
|
4302
|
+
}, 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(Ue, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), yn = ({
|
|
4274
4303
|
item: e,
|
|
4275
4304
|
index: t
|
|
4276
4305
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4285,7 +4314,7 @@ const zr = ({
|
|
|
4285
4314
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4286
4315
|
}
|
|
4287
4316
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4288
|
-
|
|
4317
|
+
Ht,
|
|
4289
4318
|
{
|
|
4290
4319
|
className: "size-16 rounded-md text-white/30",
|
|
4291
4320
|
weight: "regular",
|
|
@@ -4295,14 +4324,14 @@ const zr = ({
|
|
|
4295
4324
|
/* @__PURE__ */ n(ri, {})
|
|
4296
4325
|
] }), ii = (e, t, s) => ({
|
|
4297
4326
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4298
|
-
content: /* @__PURE__ */ n(
|
|
4327
|
+
content: /* @__PURE__ */ n(yn, { item: e, index: t })
|
|
4299
4328
|
}), oi = ({
|
|
4300
4329
|
src: e,
|
|
4301
4330
|
poster: t,
|
|
4302
4331
|
mimeType: s,
|
|
4303
4332
|
preload: a,
|
|
4304
4333
|
items: r
|
|
4305
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
4334
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], Cn = (e, t) => e.map((s, a) => ({
|
|
4306
4335
|
src: s.src,
|
|
4307
4336
|
poster: s.poster,
|
|
4308
4337
|
mimeType: s.mimeType,
|
|
@@ -4320,15 +4349,15 @@ const zr = ({
|
|
|
4320
4349
|
onClick: () => m(0),
|
|
4321
4350
|
"aria-label": "Play video",
|
|
4322
4351
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
4323
|
-
children: /* @__PURE__ */ n(
|
|
4352
|
+
children: /* @__PURE__ */ n(yn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4324
4353
|
}
|
|
4325
4354
|
),
|
|
4326
4355
|
o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(_e, { onClick: o }) }) : null,
|
|
4327
4356
|
/* @__PURE__ */ n(
|
|
4328
|
-
|
|
4357
|
+
Nn,
|
|
4329
4358
|
{
|
|
4330
4359
|
open: l,
|
|
4331
|
-
items:
|
|
4360
|
+
items: Cn(
|
|
4332
4361
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4333
4362
|
a
|
|
4334
4363
|
),
|
|
@@ -4337,7 +4366,7 @@ const zr = ({
|
|
|
4337
4366
|
}
|
|
4338
4367
|
)
|
|
4339
4368
|
] });
|
|
4340
|
-
},
|
|
4369
|
+
}, kn = ({
|
|
4341
4370
|
state: e,
|
|
4342
4371
|
src: t,
|
|
4343
4372
|
poster: s,
|
|
@@ -4349,13 +4378,13 @@ const zr = ({
|
|
|
4349
4378
|
preload: d,
|
|
4350
4379
|
onClick: m
|
|
4351
4380
|
}) => {
|
|
4352
|
-
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer:
|
|
4381
|
+
const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: w } = ye(
|
|
4353
4382
|
m
|
|
4354
4383
|
);
|
|
4355
4384
|
if (g.length === 0)
|
|
4356
4385
|
return null;
|
|
4357
4386
|
const p = g.map(
|
|
4358
|
-
(
|
|
4387
|
+
(v, _) => ii(v, _, g.length)
|
|
4359
4388
|
);
|
|
4360
4389
|
return /* @__PURE__ */ h(
|
|
4361
4390
|
we,
|
|
@@ -4366,7 +4395,7 @@ const zr = ({
|
|
|
4366
4395
|
"data-testid": "video-attachment",
|
|
4367
4396
|
children: [
|
|
4368
4397
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4369
|
-
|
|
4398
|
+
xn,
|
|
4370
4399
|
{
|
|
4371
4400
|
tiles: p,
|
|
4372
4401
|
onTileActivate: b,
|
|
@@ -4374,18 +4403,18 @@ const zr = ({
|
|
|
4374
4403
|
}
|
|
4375
4404
|
) }),
|
|
4376
4405
|
/* @__PURE__ */ n(
|
|
4377
|
-
|
|
4406
|
+
Nn,
|
|
4378
4407
|
{
|
|
4379
4408
|
open: f,
|
|
4380
|
-
items:
|
|
4409
|
+
items: Cn(g, r),
|
|
4381
4410
|
initialIndex: c,
|
|
4382
|
-
onClose:
|
|
4411
|
+
onClose: w
|
|
4383
4412
|
}
|
|
4384
4413
|
)
|
|
4385
4414
|
]
|
|
4386
4415
|
}
|
|
4387
4416
|
);
|
|
4388
|
-
}, ci = (e) => /* @__PURE__ */ n(li, { ...e }), di = (e) => /* @__PURE__ */ n(
|
|
4417
|
+
}, ci = (e) => /* @__PURE__ */ n(li, { ...e }), di = (e) => /* @__PURE__ */ n(kn, { ...e, state: "sent" }), ui = (e) => /* @__PURE__ */ n(kn, { ...e, state: "received" }), mi = {
|
|
4389
4418
|
Composer: ci,
|
|
4390
4419
|
Sent: di,
|
|
4391
4420
|
Received: ui
|
|
@@ -4407,7 +4436,7 @@ const zr = ({
|
|
|
4407
4436
|
onClick: t,
|
|
4408
4437
|
disabled: s,
|
|
4409
4438
|
style: { backgroundColor: "#E6E5E3" },
|
|
4410
|
-
className:
|
|
4439
|
+
className: C(
|
|
4411
4440
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4412
4441
|
{
|
|
4413
4442
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4429,7 +4458,7 @@ const zr = ({
|
|
|
4429
4458
|
const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
|
|
4430
4459
|
return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
|
|
4431
4460
|
(i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4432
|
-
|
|
4461
|
+
ie,
|
|
4433
4462
|
{
|
|
4434
4463
|
id: o || "account",
|
|
4435
4464
|
name: o || "Account",
|
|
@@ -4460,21 +4489,21 @@ const zr = ({
|
|
|
4460
4489
|
] }) });
|
|
4461
4490
|
};
|
|
4462
4491
|
export {
|
|
4463
|
-
|
|
4492
|
+
en as A,
|
|
4464
4493
|
Hs as B,
|
|
4465
4494
|
Xa as C,
|
|
4466
|
-
|
|
4495
|
+
Ps as D,
|
|
4467
4496
|
Ti as F,
|
|
4468
4497
|
Ei as L,
|
|
4469
4498
|
yi as M,
|
|
4470
4499
|
ge as a,
|
|
4471
|
-
|
|
4500
|
+
ie as b,
|
|
4472
4501
|
rr as c,
|
|
4473
|
-
|
|
4502
|
+
un as d,
|
|
4474
4503
|
Ci as e,
|
|
4475
4504
|
hi as f,
|
|
4476
|
-
|
|
4477
|
-
|
|
4505
|
+
ae as g,
|
|
4506
|
+
zt as h,
|
|
4478
4507
|
Ii as i,
|
|
4479
4508
|
Ca as j,
|
|
4480
4509
|
Ni as k,
|
|
@@ -4483,15 +4512,15 @@ export {
|
|
|
4483
4512
|
Ar as n,
|
|
4484
4513
|
sr as o,
|
|
4485
4514
|
Rr as p,
|
|
4486
|
-
|
|
4515
|
+
Kt as q,
|
|
4487
4516
|
ce as r,
|
|
4488
|
-
|
|
4517
|
+
sn as s,
|
|
4489
4518
|
$s as t,
|
|
4490
4519
|
Si as u,
|
|
4491
4520
|
Ys as v,
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4521
|
+
Qe as w,
|
|
4522
|
+
et as x,
|
|
4523
|
+
Xt as y,
|
|
4495
4524
|
va as z
|
|
4496
4525
|
};
|
|
4497
|
-
//# sourceMappingURL=index-
|
|
4526
|
+
//# sourceMappingURL=index-DKq7HA0h.js.map
|