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