@linktr.ee/messaging-react 3.12.2 → 3.12.3-rc-1784034329
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-Dd-lw8HD.cjs +2 -0
- package/dist/Card-Dd-lw8HD.cjs.map +1 -0
- package/dist/{Card-Za6WfwFP.js → Card-dFpcKsyN.js} +123 -119
- package/dist/Card-dFpcKsyN.js.map +1 -0
- package/dist/{index-KfZ2Wx3D.js → index-BvuCjzqJ.js} +958 -936
- package/dist/index-BvuCjzqJ.js.map +1 -0
- package/dist/index-C1eZGd_f.cjs +2 -0
- package/dist/index-C1eZGd_f.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/AttachmentCard/Thumbnail.tsx +10 -6
- package/src/components/ChannelView.test.tsx +3 -23
- package/src/components/ChannelView.tsx +0 -1
- package/src/components/CustomMessage/LockedAttachment/components/_shared/GalleryThumbnail.tsx +5 -1
- package/src/components/CustomMessage/LockedAttachment/components/_shared/SingleThumbnail.tsx +5 -1
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +58 -1
- package/src/components/CustomMessage/StreamAttachmentMessage.tsx +2 -1
- package/src/components/LinkAttachment/components/_shared/CardThumbnail.tsx +4 -2
- package/src/components/MediaMessage/index.tsx +2 -1
- package/src/components/MessageAttachment/Image/index.tsx +3 -2
- package/src/components/MessageAttachment/MessageAttachment.test.tsx +20 -0
- package/src/utils/cdnImageUrl.test.ts +37 -0
- package/src/utils/cdnImageUrl.ts +34 -0
- package/dist/Card-Bs3dV_7R.cjs +0 -2
- package/dist/Card-Bs3dV_7R.cjs.map +0 -1
- package/dist/Card-Za6WfwFP.js.map +0 -1
- package/dist/index-KfZ2Wx3D.js.map +0 -1
- package/dist/index-gl5pV2zJ.cjs +0 -2
- package/dist/index-gl5pV2zJ.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as s, jsxs as u, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import V, { createContext as
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
2
|
+
import V, { createContext as ct, useContext as Te, useCallback as J, useState as U, useRef as G, useEffect as K, useId as js, useMemo as re, Suspense as Vs } from "react";
|
|
3
|
+
import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Hs, LinkPreviewsManager as Yt } from "stream-chat";
|
|
5
|
+
import { Chat as Ys, useChannelStateContext as oe, useChatContext as fe, DateSeparator as qs, MessageStatus as Ws, useMessageContext as Ne, MessageErrorIcon as nt, MessageText as $e, areMessageUIPropsEqual as Xs, useMessageReminder as Ks, useComponentContext as as, Attachment as Zs, EditMessageModal as Js, MessageBlocked as Qs, MessageBouncePrompt as en, MessageDeleted as tn, MessageIsThreadReplyInChannelButtonIndicator as sn, MessageRepliesCountButton as nn, ReminderNotification as an, StreamedMessageText as rn, messageHasAttachments as ln, messageHasReactions as on, isDateSeparatorMessage as cn, isMessageBlocked as dn, isMessageBounced as un, MessageBounceModal as mn, Poll as hn, useMessageComposer as fn, useStateStore as gn, MessageInput as pn, useMessageInputContext as bn, useMessageComposerHasSendableData as vn, AttachmentPreviewList as xn, QuotedMessagePreview as wn, TextareaComposer as _n, MessageTimestamp as Xe, AIStates as Ke, useTypingContext as Nn, useAIState as yn, Channel as kn, WithComponents as Cn, Window as Sn, MessageList as En, ChannelList as In, InfiniteScroll as Tn } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ie, DotsThreeIcon as Mn, SpinnerGapIcon as Fe, SignOutIcon as An, ProhibitInsetIcon as qt, FlagIcon as rs, ArrowLeftIcon as at, CurrencyDollarIcon as Rn, CaretRightIcon as xe, SparkleIcon as we, FileIcon as is, ImageIcon as Ln, SpeakerHighIcon as Dn, VideoCameraIcon as ls, FileMdIcon as zn, FileTextIcon as Fn, FileZipIcon as Pn, FilePptIcon as On, FileCsvIcon as $n, FileXlsIcon as Bn, FileDocIcon as Un, FilePdfIcon as jn, CircleNotchIcon as Se, PlayIcon as rt, PauseIcon as Vn, LinkIcon as Gn, DownloadSimpleIcon as Ee, XIcon as Ge, CaretLeftIcon as Hn, GiftIcon as Yn, ThumbsUpIcon as qn, ThumbsDownIcon as Wn, ChecksIcon as Xn, PencilSimpleIcon as Kn, TrashSimpleIcon as Zn, ArrowUpIcon as Jn, ProhibitIcon as Qn } from "@phosphor-icons/react";
|
|
7
7
|
import y from "classnames";
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
8
|
+
import { MessageActions as ea, DefaultDropdownActionButton as os } from "stream-chat-react/experimental";
|
|
9
|
+
const cs = ct({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const os = ot({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), dt = () => Te(cs), hl = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: n,
|
|
@@ -38,10 +38,10 @@ const os = ot({
|
|
|
38
38
|
serviceConfig: !!n,
|
|
39
39
|
capabilities: Object.keys(r)
|
|
40
40
|
});
|
|
41
|
-
const [d, m] = U(null), [
|
|
41
|
+
const [d, m] = U(null), [f, h] = U(null), [g, c] = U(!1), [b, v] = U(!1), [x, p] = U(null), _ = G(!1), w = G(null), k = G(n);
|
|
42
42
|
k.current = n;
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
const D = G(i);
|
|
44
|
+
D.current = i;
|
|
45
45
|
const S = G({
|
|
46
46
|
userId: t == null ? void 0 : t.id,
|
|
47
47
|
apiKey: a,
|
|
@@ -64,7 +64,7 @@ const os = ot({
|
|
|
64
64
|
capabilities: r
|
|
65
65
|
};
|
|
66
66
|
const O = G(null);
|
|
67
|
-
!o && a && ((I = O.current) == null ? void 0 : I.apiKey) !== a && (O.current = { apiKey: a, client: new
|
|
67
|
+
!o && a && ((I = O.current) == null ? void 0 : I.apiKey) !== a && (O.current = { apiKey: a, client: new Hs(a) });
|
|
68
68
|
const F = o || (a ? ((T = O.current) == null ? void 0 : T.client) ?? null : null);
|
|
69
69
|
K(() => {
|
|
70
70
|
const M = R.current, P = k.current;
|
|
@@ -83,10 +83,10 @@ const os = ot({
|
|
|
83
83
|
renderCount: M,
|
|
84
84
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
85
85
|
});
|
|
86
|
-
const $ = new
|
|
86
|
+
const $ = new Gs({
|
|
87
87
|
...P,
|
|
88
88
|
apiKey: a,
|
|
89
|
-
debug:
|
|
89
|
+
debug: D.current,
|
|
90
90
|
client: F
|
|
91
91
|
});
|
|
92
92
|
w.current = $, m($), l("✅ SERVICE SET", {
|
|
@@ -94,7 +94,7 @@ const os = ot({
|
|
|
94
94
|
serviceInstance: !!$
|
|
95
95
|
});
|
|
96
96
|
}, [a, F, o]);
|
|
97
|
-
const
|
|
97
|
+
const L = G(null);
|
|
98
98
|
K(() => {
|
|
99
99
|
var P, $;
|
|
100
100
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
@@ -102,7 +102,7 @@ const os = ot({
|
|
|
102
102
|
hasUser: !!t,
|
|
103
103
|
userId: t == null ? void 0 : t.id,
|
|
104
104
|
isConnecting: _.current,
|
|
105
|
-
isConnected:
|
|
105
|
+
isConnected: g,
|
|
106
106
|
dependencies: { service: !!d, userId: t == null ? void 0 : t.id }
|
|
107
107
|
}), o)
|
|
108
108
|
return;
|
|
@@ -114,7 +114,7 @@ const os = ot({
|
|
|
114
114
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
if (((P =
|
|
117
|
+
if (((P = L.current) == null ? void 0 : P.serviceId) === d && (($ = L.current) == null ? void 0 : $.userId) === t.id) {
|
|
118
118
|
l(
|
|
119
119
|
"⚠️ USER CONNECTION SKIPPED",
|
|
120
120
|
"Already connected this user with this service"
|
|
@@ -126,7 +126,7 @@ const os = ot({
|
|
|
126
126
|
try {
|
|
127
127
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
128
128
|
const j = await d.connectUser(t);
|
|
129
|
-
h(j), c(!0),
|
|
129
|
+
h(j), c(!0), L.current = { serviceId: d, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
130
130
|
userId: t.id,
|
|
131
131
|
clientId: j.userID
|
|
132
132
|
});
|
|
@@ -139,15 +139,15 @@ const os = ot({
|
|
|
139
139
|
} finally {
|
|
140
140
|
v(!1), _.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
141
141
|
userId: t.id,
|
|
142
|
-
isConnected:
|
|
142
|
+
isConnected: g
|
|
143
143
|
});
|
|
144
144
|
}
|
|
145
145
|
})();
|
|
146
|
-
}, [d, t, l,
|
|
146
|
+
}, [d, t, l, g, o]), K(() => {
|
|
147
147
|
const M = F;
|
|
148
148
|
return () => {
|
|
149
149
|
var P;
|
|
150
|
-
M && (
|
|
150
|
+
M && (L.current = null, (P = w.current) == null || P.disconnectUser().catch(console.error));
|
|
151
151
|
};
|
|
152
152
|
}, [F]);
|
|
153
153
|
const C = J(async () => {
|
|
@@ -176,8 +176,8 @@ const os = ot({
|
|
|
176
176
|
}
|
|
177
177
|
}, [d, t, l, o]), E = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
178
178
|
hasService: !!d,
|
|
179
|
-
hasClient: !!
|
|
180
|
-
isConnected:
|
|
179
|
+
hasClient: !!f,
|
|
180
|
+
isConnected: g,
|
|
181
181
|
isLoading: b,
|
|
182
182
|
hasError: !!x,
|
|
183
183
|
capabilitiesKeys: Object.keys(r)
|
|
@@ -191,8 +191,8 @@ const os = ot({
|
|
|
191
191
|
// surface it directly and report a clean connected state — the apiKey
|
|
192
192
|
// path's `client`/`isLoading`/`error` (from connectUser) must not leak
|
|
193
193
|
// through if the same provider previously attempted an apiKey connect.
|
|
194
|
-
client: o ??
|
|
195
|
-
isConnected: o ? !0 :
|
|
194
|
+
client: o ?? f,
|
|
195
|
+
isConnected: o ? !0 : g,
|
|
196
196
|
isLoading: o ? !1 : b,
|
|
197
197
|
error: o ? null : x,
|
|
198
198
|
capabilities: r,
|
|
@@ -200,9 +200,9 @@ const os = ot({
|
|
|
200
200
|
debug: i
|
|
201
201
|
}), [
|
|
202
202
|
d,
|
|
203
|
-
g,
|
|
204
|
-
o,
|
|
205
203
|
f,
|
|
204
|
+
o,
|
|
205
|
+
g,
|
|
206
206
|
b,
|
|
207
207
|
x,
|
|
208
208
|
r,
|
|
@@ -214,8 +214,8 @@ const os = ot({
|
|
|
214
214
|
renderCount: R.current,
|
|
215
215
|
willRenderChat: !!F,
|
|
216
216
|
contextValueReady: !!E
|
|
217
|
-
}), /* @__PURE__ */ s(
|
|
218
|
-
|
|
217
|
+
}), /* @__PURE__ */ s(cs.Provider, { value: E, children: F ? /* @__PURE__ */ s(
|
|
218
|
+
Ys,
|
|
219
219
|
{
|
|
220
220
|
client: F,
|
|
221
221
|
customClasses: {
|
|
@@ -224,7 +224,7 @@ const os = ot({
|
|
|
224
224
|
children: e
|
|
225
225
|
}
|
|
226
226
|
) : e });
|
|
227
|
-
},
|
|
227
|
+
}, ta = () => dt(), ut = (e) => {
|
|
228
228
|
var a, r;
|
|
229
229
|
const [t, n] = U(
|
|
230
230
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -246,14 +246,14 @@ const os = ot({
|
|
|
246
246
|
e.off("member.updated", i);
|
|
247
247
|
};
|
|
248
248
|
}, [e]), t;
|
|
249
|
-
},
|
|
250
|
-
function
|
|
249
|
+
}, sa = "linktree-official", na = "linktree-official-sender";
|
|
250
|
+
function He(e, t, n) {
|
|
251
251
|
const a = Object.values(e || {});
|
|
252
|
-
if (n ===
|
|
252
|
+
if (n === sa) {
|
|
253
253
|
const r = a.find(
|
|
254
254
|
(i) => {
|
|
255
255
|
var o;
|
|
256
|
-
return ((o = i.user) == null ? void 0 : o.id) ===
|
|
256
|
+
return ((o = i.user) == null ? void 0 : o.id) === na;
|
|
257
257
|
}
|
|
258
258
|
);
|
|
259
259
|
if (r) return r;
|
|
@@ -265,18 +265,18 @@ function Ge(e, t, n) {
|
|
|
265
265
|
}
|
|
266
266
|
);
|
|
267
267
|
}
|
|
268
|
-
const
|
|
269
|
-
function
|
|
270
|
-
return
|
|
268
|
+
const aa = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
269
|
+
function ra(e) {
|
|
270
|
+
return aa.test(e.trim());
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function Wt(e, t) {
|
|
273
273
|
const n = e == null ? void 0 : e.trim();
|
|
274
|
-
return !n || t && n === t ? !1 : !
|
|
274
|
+
return !n || t && n === t ? !1 : !ra(n);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
return
|
|
276
|
+
function mt(e) {
|
|
277
|
+
return Wt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Wt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const Xt = [
|
|
280
280
|
{ emoji: "🍎", bgColor: "#FFD1DD" },
|
|
281
281
|
// Apple
|
|
282
282
|
{ emoji: "🍌", bgColor: "#FFF1C9" },
|
|
@@ -304,7 +304,7 @@ const Wt = [
|
|
|
304
304
|
{ emoji: "🍈", bgColor: "#D9F7E1" }
|
|
305
305
|
// Melon
|
|
306
306
|
];
|
|
307
|
-
function
|
|
307
|
+
function ia(e) {
|
|
308
308
|
let t = 0;
|
|
309
309
|
for (let n = 0; n < e.length; n++) {
|
|
310
310
|
const a = e.charCodeAt(n);
|
|
@@ -312,14 +312,14 @@ function ra(e) {
|
|
|
312
312
|
}
|
|
313
313
|
return Math.abs(t);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
317
|
-
}
|
|
318
|
-
function ia(e) {
|
|
319
|
-
return cs(e).emoji;
|
|
315
|
+
function ds(e) {
|
|
316
|
+
return Xt[ia(e) % Xt.length];
|
|
320
317
|
}
|
|
321
318
|
function la(e) {
|
|
322
|
-
return
|
|
319
|
+
return ds(e).emoji;
|
|
320
|
+
}
|
|
321
|
+
function oa(e) {
|
|
322
|
+
return ds(e).bgColor;
|
|
323
323
|
}
|
|
324
324
|
const ne = ({
|
|
325
325
|
id: e,
|
|
@@ -330,7 +330,7 @@ const ne = ({
|
|
|
330
330
|
shape: i = "squircle",
|
|
331
331
|
dmAgentEnabled: o = !1
|
|
332
332
|
}) => {
|
|
333
|
-
const l =
|
|
333
|
+
const l = la(e), d = oa(e), m = 0.45, h = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
|
|
334
334
|
"img",
|
|
335
335
|
{
|
|
336
336
|
src: t,
|
|
@@ -368,7 +368,7 @@ const ne = ({
|
|
|
368
368
|
{
|
|
369
369
|
"aria-hidden": "true",
|
|
370
370
|
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)]",
|
|
371
|
-
children: /* @__PURE__ */ s(
|
|
371
|
+
children: /* @__PURE__ */ s(Ie, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
372
372
|
}
|
|
373
373
|
),
|
|
374
374
|
/* @__PURE__ */ s(
|
|
@@ -382,7 +382,7 @@ const ne = ({
|
|
|
382
382
|
style: {
|
|
383
383
|
...c,
|
|
384
384
|
...o && {
|
|
385
|
-
borderWidth: `${
|
|
385
|
+
borderWidth: `${g}px`,
|
|
386
386
|
borderStyle: "solid",
|
|
387
387
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
388
388
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
@@ -394,7 +394,7 @@ const ne = ({
|
|
|
394
394
|
]
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
|
-
},
|
|
397
|
+
}, ca = "https://linktr.ee/s/about/trust-center/report", da = ({
|
|
398
398
|
channel: e,
|
|
399
399
|
participant: t,
|
|
400
400
|
showBlockParticipant: n = !0,
|
|
@@ -405,10 +405,10 @@ const ne = ({
|
|
|
405
405
|
onBlockParticipantClick: l,
|
|
406
406
|
onReportParticipantClick: d,
|
|
407
407
|
onActionComplete: m,
|
|
408
|
-
logLabel:
|
|
408
|
+
logLabel: f = "useChannelModerationActions"
|
|
409
409
|
}) => {
|
|
410
410
|
var E;
|
|
411
|
-
const { service: h, debug:
|
|
411
|
+
const { service: h, debug: g } = dt(), c = (E = t == null ? void 0 : t.user) == null ? void 0 : E.id, b = !!(a && n && h && c), [v, x] = U(!1), [p, _] = U(null), [w, k] = U(!1), [D, S] = U(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
|
|
412
412
|
return K(() => {
|
|
413
413
|
if (!b || !h || !c) {
|
|
414
414
|
x(!1), _(null);
|
|
@@ -425,27 +425,27 @@ const ne = ({
|
|
|
425
425
|
)
|
|
426
426
|
);
|
|
427
427
|
} catch (T) {
|
|
428
|
-
I || console.error(`[${
|
|
428
|
+
I || console.error(`[${f}] Failed to check blocked status:`, T);
|
|
429
429
|
} finally {
|
|
430
430
|
I || _({ participantId: c, service: h });
|
|
431
431
|
}
|
|
432
432
|
})(), () => {
|
|
433
433
|
I = !0;
|
|
434
434
|
};
|
|
435
|
-
}, [b, h, c,
|
|
435
|
+
}, [b, h, c, f]), {
|
|
436
436
|
isParticipantBlocked: v,
|
|
437
437
|
isCheckingBlockedStatus: R,
|
|
438
438
|
isLeaving: w,
|
|
439
|
-
isUpdatingBlockStatus:
|
|
439
|
+
isUpdatingBlockStatus: D,
|
|
440
440
|
handleLeaveConversation: async () => {
|
|
441
441
|
var I;
|
|
442
442
|
if (!w) {
|
|
443
|
-
o == null || o(),
|
|
443
|
+
o == null || o(), g && console.log(`[${f}] Leave conversation`, e.cid), k(!0);
|
|
444
444
|
try {
|
|
445
445
|
const T = ((I = e._client) == null ? void 0 : I.userID) ?? null;
|
|
446
446
|
await e.hide(T, !1), r && await r(e), m == null || m();
|
|
447
447
|
} catch (T) {
|
|
448
|
-
console.error(`[${
|
|
448
|
+
console.error(`[${f}] Failed to leave conversation`, T);
|
|
449
449
|
} finally {
|
|
450
450
|
k(!1);
|
|
451
451
|
}
|
|
@@ -453,12 +453,12 @@ const ne = ({
|
|
|
453
453
|
},
|
|
454
454
|
handleBlockUser: async () => {
|
|
455
455
|
var I, T, M;
|
|
456
|
-
if (!(
|
|
457
|
-
l == null || l(),
|
|
456
|
+
if (!(D || !h)) {
|
|
457
|
+
l == null || l(), g && console.log(`[${f}] Block member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), S(!0);
|
|
458
458
|
try {
|
|
459
459
|
await h.blockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
|
|
460
460
|
} catch (P) {
|
|
461
|
-
console.error(`[${
|
|
461
|
+
console.error(`[${f}] Failed to block member`, P);
|
|
462
462
|
} finally {
|
|
463
463
|
S(!1);
|
|
464
464
|
}
|
|
@@ -466,22 +466,22 @@ const ne = ({
|
|
|
466
466
|
},
|
|
467
467
|
handleUnblockUser: async () => {
|
|
468
468
|
var I, T, M;
|
|
469
|
-
if (!(
|
|
470
|
-
l == null || l(),
|
|
469
|
+
if (!(D || !h)) {
|
|
470
|
+
l == null || l(), g && console.log(`[${f}] Unblock member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), S(!0);
|
|
471
471
|
try {
|
|
472
472
|
await h.unBlockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
|
|
473
473
|
} catch (P) {
|
|
474
|
-
console.error(`[${
|
|
474
|
+
console.error(`[${f}] Failed to unblock member`, P);
|
|
475
475
|
} finally {
|
|
476
476
|
S(!1);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
},
|
|
480
480
|
handleReportUser: () => {
|
|
481
|
-
d == null || d(), m == null || m(), window.open(
|
|
481
|
+
d == null || d(), m == null || m(), window.open(ca, "_blank", "noopener,noreferrer");
|
|
482
482
|
}
|
|
483
483
|
};
|
|
484
|
-
},
|
|
484
|
+
}, ye = ({
|
|
485
485
|
variant: e = "default",
|
|
486
486
|
className: t,
|
|
487
487
|
children: n,
|
|
@@ -498,7 +498,7 @@ const ne = ({
|
|
|
498
498
|
...a,
|
|
499
499
|
children: n
|
|
500
500
|
}
|
|
501
|
-
),
|
|
501
|
+
), it = ({
|
|
502
502
|
channel: e,
|
|
503
503
|
participant: t,
|
|
504
504
|
showDeleteConversation: n = !0,
|
|
@@ -509,23 +509,23 @@ const ne = ({
|
|
|
509
509
|
onDeleteConversationClick: l,
|
|
510
510
|
onBlockParticipantClick: d,
|
|
511
511
|
onReportParticipantClick: m,
|
|
512
|
-
customChannelActions:
|
|
512
|
+
customChannelActions: f,
|
|
513
513
|
triggerClassName: h
|
|
514
514
|
}) => {
|
|
515
|
-
const [
|
|
515
|
+
const [g, c] = U(!1), b = G(null), v = js(), x = J(() => c(!1), []), {
|
|
516
516
|
isParticipantBlocked: p,
|
|
517
517
|
isCheckingBlockedStatus: _,
|
|
518
518
|
isLeaving: w,
|
|
519
519
|
isUpdatingBlockStatus: k,
|
|
520
|
-
handleLeaveConversation:
|
|
520
|
+
handleLeaveConversation: D,
|
|
521
521
|
handleBlockUser: S,
|
|
522
522
|
handleUnblockUser: R,
|
|
523
523
|
handleReportUser: O
|
|
524
|
-
} =
|
|
524
|
+
} = da({
|
|
525
525
|
channel: e,
|
|
526
526
|
participant: t,
|
|
527
527
|
showBlockParticipant: a,
|
|
528
|
-
enabled:
|
|
528
|
+
enabled: g,
|
|
529
529
|
onLeaveConversation: i,
|
|
530
530
|
onBlockParticipant: o,
|
|
531
531
|
onDeleteConversationClick: l,
|
|
@@ -535,32 +535,32 @@ const ne = ({
|
|
|
535
535
|
logLabel: "ChannelActionsMenu"
|
|
536
536
|
});
|
|
537
537
|
return K(() => {
|
|
538
|
-
if (!
|
|
539
|
-
const
|
|
538
|
+
if (!g) return;
|
|
539
|
+
const L = (E) => {
|
|
540
540
|
b.current && !b.current.contains(E.target) && c(!1);
|
|
541
541
|
}, C = (E) => {
|
|
542
542
|
E.key === "Escape" && c(!1);
|
|
543
543
|
};
|
|
544
|
-
return document.addEventListener("mousedown",
|
|
545
|
-
document.removeEventListener("mousedown",
|
|
544
|
+
return document.addEventListener("mousedown", L), document.addEventListener("keydown", C), () => {
|
|
545
|
+
document.removeEventListener("mousedown", L), document.removeEventListener("keydown", C);
|
|
546
546
|
};
|
|
547
|
-
}, [
|
|
547
|
+
}, [g]), !t || !(n || a || r || !!f) ? null : /* @__PURE__ */ u("div", { ref: b, className: "relative", children: [
|
|
548
548
|
/* @__PURE__ */ u(
|
|
549
549
|
"button",
|
|
550
550
|
{
|
|
551
551
|
className: h,
|
|
552
552
|
type: "button",
|
|
553
553
|
"aria-haspopup": "true",
|
|
554
|
-
"aria-expanded":
|
|
555
|
-
"aria-controls":
|
|
556
|
-
onClick: () => c((
|
|
554
|
+
"aria-expanded": g,
|
|
555
|
+
"aria-controls": g ? v : void 0,
|
|
556
|
+
onClick: () => c((L) => !L),
|
|
557
557
|
children: [
|
|
558
|
-
/* @__PURE__ */ s(
|
|
558
|
+
/* @__PURE__ */ s(Mn, { className: "size-5 text-black/90" }),
|
|
559
559
|
/* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
|
|
560
560
|
]
|
|
561
561
|
}
|
|
562
562
|
),
|
|
563
|
-
|
|
563
|
+
g && /* @__PURE__ */ s(
|
|
564
564
|
"div",
|
|
565
565
|
{
|
|
566
566
|
id: v,
|
|
@@ -571,13 +571,13 @@ const ne = ({
|
|
|
571
571
|
),
|
|
572
572
|
children: /* @__PURE__ */ u("ul", { className: "flex flex-col gap-1", children: [
|
|
573
573
|
n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ u(
|
|
574
|
-
|
|
574
|
+
ye,
|
|
575
575
|
{
|
|
576
|
-
onClick:
|
|
576
|
+
onClick: D,
|
|
577
577
|
disabled: w,
|
|
578
578
|
"aria-busy": w,
|
|
579
579
|
children: [
|
|
580
|
-
w ? /* @__PURE__ */ s(
|
|
580
|
+
w ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(An, { className: "h-5 w-5" }),
|
|
581
581
|
/* @__PURE__ */ s("span", { children: "Delete Conversation" })
|
|
582
582
|
]
|
|
583
583
|
}
|
|
@@ -585,46 +585,46 @@ const ne = ({
|
|
|
585
585
|
a && /* @__PURE__ */ s("li", { children: _ ? (
|
|
586
586
|
// Block status not yet resolved — show a disabled placeholder
|
|
587
587
|
// so a premature click can't act on a stale block state.
|
|
588
|
-
/* @__PURE__ */ u(
|
|
589
|
-
/* @__PURE__ */ s(
|
|
588
|
+
/* @__PURE__ */ u(ye, { disabled: !0, "aria-busy": !0, children: [
|
|
589
|
+
/* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }),
|
|
590
590
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
591
591
|
] })
|
|
592
592
|
) : p ? /* @__PURE__ */ u(
|
|
593
|
-
|
|
593
|
+
ye,
|
|
594
594
|
{
|
|
595
595
|
onClick: R,
|
|
596
596
|
disabled: k,
|
|
597
597
|
"aria-busy": k,
|
|
598
598
|
children: [
|
|
599
|
-
k ? /* @__PURE__ */ s(
|
|
599
|
+
k ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
|
|
600
600
|
/* @__PURE__ */ s("span", { children: "Unblock" })
|
|
601
601
|
]
|
|
602
602
|
}
|
|
603
603
|
) : /* @__PURE__ */ u(
|
|
604
|
-
|
|
604
|
+
ye,
|
|
605
605
|
{
|
|
606
606
|
onClick: S,
|
|
607
607
|
disabled: k,
|
|
608
608
|
"aria-busy": k,
|
|
609
609
|
children: [
|
|
610
|
-
k ? /* @__PURE__ */ s(
|
|
610
|
+
k ? /* @__PURE__ */ s(Fe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(qt, { className: "h-5 w-5" }),
|
|
611
611
|
/* @__PURE__ */ s("span", { children: "Block" })
|
|
612
612
|
]
|
|
613
613
|
}
|
|
614
614
|
) }),
|
|
615
|
-
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ u(
|
|
616
|
-
/* @__PURE__ */ s(
|
|
615
|
+
r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ u(ye, { variant: "danger", onClick: O, children: [
|
|
616
|
+
/* @__PURE__ */ s(rs, { className: "h-5 w-5" }),
|
|
617
617
|
/* @__PURE__ */ s("span", { children: "Report" })
|
|
618
618
|
] }) }),
|
|
619
|
-
|
|
619
|
+
f
|
|
620
620
|
] })
|
|
621
621
|
}
|
|
622
622
|
)
|
|
623
623
|
] });
|
|
624
|
-
},
|
|
624
|
+
}, Ze = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", ua = "CUSTOMER_PAID", ma = "Replies instantly with AI assistant", ha = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ua, fa = (e) => {
|
|
625
625
|
const t = e;
|
|
626
|
-
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(
|
|
627
|
-
},
|
|
626
|
+
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(ha);
|
|
627
|
+
}, ga = ({
|
|
628
628
|
className: e,
|
|
629
629
|
onBack: t,
|
|
630
630
|
showBackButton: n,
|
|
@@ -635,26 +635,26 @@ const ne = ({
|
|
|
635
635
|
showDeleteConversation: l = !0,
|
|
636
636
|
showBlockParticipant: d = !0,
|
|
637
637
|
showReportParticipant: m = !0,
|
|
638
|
-
onDeleteConversationClick:
|
|
638
|
+
onDeleteConversationClick: f,
|
|
639
639
|
onBlockParticipantClick: h,
|
|
640
|
-
onReportParticipantClick:
|
|
640
|
+
onReportParticipantClick: g,
|
|
641
641
|
customChannelActions: c,
|
|
642
642
|
renderChannelActions: b,
|
|
643
643
|
showChannelInfo: v = !0,
|
|
644
644
|
onParticipantNameClick: x
|
|
645
645
|
}) => {
|
|
646
|
-
var F,
|
|
647
|
-
const { channel: p } = oe(), { client: _ } =
|
|
646
|
+
var F, L, C;
|
|
647
|
+
const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
|
|
648
648
|
() => {
|
|
649
649
|
var E;
|
|
650
|
-
return
|
|
650
|
+
return He(
|
|
651
651
|
(E = p.state) == null ? void 0 : E.members,
|
|
652
652
|
_ == null ? void 0 : _.userID,
|
|
653
653
|
p.type
|
|
654
654
|
);
|
|
655
655
|
},
|
|
656
656
|
[(F = p.state) == null ? void 0 : F.members, _ == null ? void 0 : _.userID, p.type]
|
|
657
|
-
), k =
|
|
657
|
+
), k = mt(w == null ? void 0 : w.user), D = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, S = ut(p), R = fa(w), O = async () => {
|
|
658
658
|
try {
|
|
659
659
|
S ? await p.unpin() : await p.pin();
|
|
660
660
|
} catch (E) {
|
|
@@ -676,14 +676,14 @@ const ne = ({
|
|
|
676
676
|
"button",
|
|
677
677
|
{
|
|
678
678
|
className: y(
|
|
679
|
-
|
|
679
|
+
Ze,
|
|
680
680
|
"messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"
|
|
681
681
|
),
|
|
682
682
|
onClick: t || (() => {
|
|
683
683
|
}),
|
|
684
684
|
type: "button",
|
|
685
685
|
"aria-label": "Back to conversations",
|
|
686
|
-
children: /* @__PURE__ */ s(
|
|
686
|
+
children: /* @__PURE__ */ s(at, { className: "size-5 text-black/90" })
|
|
687
687
|
}
|
|
688
688
|
) }),
|
|
689
689
|
/* @__PURE__ */ s("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: /* @__PURE__ */ u(
|
|
@@ -699,7 +699,7 @@ const ne = ({
|
|
|
699
699
|
{
|
|
700
700
|
id: ((C = w == null ? void 0 : w.user) == null ? void 0 : C.id) || p.id || "unknown",
|
|
701
701
|
name: k,
|
|
702
|
-
image:
|
|
702
|
+
image: D,
|
|
703
703
|
dmAgentEnabled: r,
|
|
704
704
|
shape: "circle",
|
|
705
705
|
size: 48,
|
|
@@ -715,7 +715,7 @@ const ne = ({
|
|
|
715
715
|
{
|
|
716
716
|
"aria-label": "Paid customer",
|
|
717
717
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
718
|
-
children: /* @__PURE__ */ s(
|
|
718
|
+
children: /* @__PURE__ */ s(Rn, { className: "size-2.5", weight: "bold" })
|
|
719
719
|
}
|
|
720
720
|
),
|
|
721
721
|
a && S && /* @__PURE__ */ s(
|
|
@@ -723,11 +723,11 @@ const ne = ({
|
|
|
723
723
|
{
|
|
724
724
|
"aria-label": "Starred conversation",
|
|
725
725
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
|
|
726
|
-
children: /* @__PURE__ */ s(
|
|
726
|
+
children: /* @__PURE__ */ s(Ie, { className: "size-2.5", weight: "fill" })
|
|
727
727
|
}
|
|
728
728
|
),
|
|
729
729
|
/* @__PURE__ */ s(
|
|
730
|
-
|
|
730
|
+
xe,
|
|
731
731
|
{
|
|
732
732
|
"aria-hidden": "true",
|
|
733
733
|
className: "size-4 shrink-0 text-black/65",
|
|
@@ -737,8 +737,8 @@ const ne = ({
|
|
|
737
737
|
] })
|
|
738
738
|
] }),
|
|
739
739
|
r && /* @__PURE__ */ u("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
|
|
740
|
-
/* @__PURE__ */ s(
|
|
741
|
-
/* @__PURE__ */ s("span", { children:
|
|
740
|
+
/* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
|
|
741
|
+
/* @__PURE__ */ s("span", { children: ma })
|
|
742
742
|
] })
|
|
743
743
|
] })
|
|
744
744
|
]
|
|
@@ -748,13 +748,13 @@ const ne = ({
|
|
|
748
748
|
a && /* @__PURE__ */ s(
|
|
749
749
|
"button",
|
|
750
750
|
{
|
|
751
|
-
className:
|
|
751
|
+
className: Ze,
|
|
752
752
|
onClick: O,
|
|
753
753
|
type: "button",
|
|
754
754
|
"aria-pressed": S,
|
|
755
755
|
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
756
756
|
children: /* @__PURE__ */ s(
|
|
757
|
-
|
|
757
|
+
Ie,
|
|
758
758
|
{
|
|
759
759
|
className: y("size-5", {
|
|
760
760
|
"text-[#FFD60A]": S,
|
|
@@ -766,7 +766,7 @@ const ne = ({
|
|
|
766
766
|
}
|
|
767
767
|
),
|
|
768
768
|
v && (b !== void 0 ? b : /* @__PURE__ */ s(
|
|
769
|
-
|
|
769
|
+
it,
|
|
770
770
|
{
|
|
771
771
|
channel: p,
|
|
772
772
|
participant: w,
|
|
@@ -775,31 +775,31 @@ const ne = ({
|
|
|
775
775
|
showReportParticipant: m,
|
|
776
776
|
onLeaveConversation: i,
|
|
777
777
|
onBlockParticipant: o,
|
|
778
|
-
onDeleteConversationClick:
|
|
778
|
+
onDeleteConversationClick: f,
|
|
779
779
|
onBlockParticipantClick: h,
|
|
780
|
-
onReportParticipantClick:
|
|
780
|
+
onReportParticipantClick: g,
|
|
781
781
|
customChannelActions: c,
|
|
782
|
-
triggerClassName:
|
|
782
|
+
triggerClassName: Ze
|
|
783
783
|
}
|
|
784
784
|
))
|
|
785
785
|
] })
|
|
786
786
|
] })
|
|
787
787
|
}
|
|
788
788
|
);
|
|
789
|
-
},
|
|
790
|
-
function pa(e) {
|
|
791
|
-
return e != null && e.length ? e.some((t) => t.type === lt) ? "down" : e.some((t) => t.type === it) ? "up" : null : null;
|
|
792
|
-
}
|
|
789
|
+
}, pa = (e) => /* @__PURE__ */ s(qs, { ...e, position: "center" }), lt = "vote_up", ot = "vote_down";
|
|
793
790
|
function ba(e) {
|
|
794
|
-
|
|
795
|
-
|
|
791
|
+
return e != null && e.length ? e.some((t) => t.type === ot) ? "down" : e.some((t) => t.type === lt) ? "up" : null : null;
|
|
792
|
+
}
|
|
793
|
+
function va(e) {
|
|
794
|
+
const { channel: t } = oe(), { client: n } = fe("useMessageVote"), a = re(
|
|
795
|
+
() => ba(e.own_reactions),
|
|
796
796
|
[e.own_reactions]
|
|
797
797
|
), r = J(async () => {
|
|
798
798
|
if (n != null && n.userID)
|
|
799
799
|
try {
|
|
800
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
800
|
+
a === "up" ? await t.deleteReaction(e.id, lt) : await t.sendReaction(
|
|
801
801
|
e.id,
|
|
802
|
-
{ type:
|
|
802
|
+
{ type: lt },
|
|
803
803
|
{ enforce_unique: !0, skip_push: !0 }
|
|
804
804
|
);
|
|
805
805
|
} catch {
|
|
@@ -807,9 +807,9 @@ function ba(e) {
|
|
|
807
807
|
}, [t, n == null ? void 0 : n.userID, e.id, a]), i = J(async () => {
|
|
808
808
|
if (n != null && n.userID)
|
|
809
809
|
try {
|
|
810
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
810
|
+
a === "down" ? await t.deleteReaction(e.id, ot) : await t.sendReaction(
|
|
811
811
|
e.id,
|
|
812
|
-
{ type:
|
|
812
|
+
{ type: ot },
|
|
813
813
|
{ enforce_unique: !0, skip_push: !0 }
|
|
814
814
|
);
|
|
815
815
|
} catch {
|
|
@@ -817,18 +817,40 @@ function ba(e) {
|
|
|
817
817
|
}, [t, n == null ? void 0 : n.userID, e.id, a]);
|
|
818
818
|
return { selected: a, voteUp: r, voteDown: i };
|
|
819
819
|
}
|
|
820
|
-
function
|
|
820
|
+
function xa(e) {
|
|
821
821
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function us({
|
|
824
824
|
message: e,
|
|
825
825
|
viewerLanguage: t
|
|
826
826
|
}) {
|
|
827
827
|
var r;
|
|
828
|
-
const n = e == null ? void 0 : e.text, a =
|
|
828
|
+
const n = e == null ? void 0 : e.text, a = xa(t);
|
|
829
829
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
|
|
830
830
|
}
|
|
831
|
-
const
|
|
831
|
+
const wa = ["linktr.ee"], _a = "messaging-attachment-v1_0";
|
|
832
|
+
function Na(e) {
|
|
833
|
+
try {
|
|
834
|
+
return new URL(e).hostname.toLowerCase();
|
|
835
|
+
} catch {
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
function ya(e) {
|
|
840
|
+
return wa.some(
|
|
841
|
+
(t) => e === t || e.endsWith(`.${t}`)
|
|
842
|
+
);
|
|
843
|
+
}
|
|
844
|
+
function he(e) {
|
|
845
|
+
const t = e == null ? void 0 : e.trim();
|
|
846
|
+
if (!t) return;
|
|
847
|
+
const n = Na(t);
|
|
848
|
+
if (!n || !ya(n) || /[?&]io=true(?:&|$)/.test(t) && /[?&]size=/.test(t))
|
|
849
|
+
return t;
|
|
850
|
+
const a = t.includes("?") ? "&" : "?";
|
|
851
|
+
return `${t}${a}io=true&size=${_a}`;
|
|
852
|
+
}
|
|
853
|
+
const ka = [
|
|
832
854
|
[/pdf/, "pdf"],
|
|
833
855
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
834
856
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -841,39 +863,39 @@ const xa = [
|
|
|
841
863
|
function ce(e) {
|
|
842
864
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
843
865
|
}
|
|
844
|
-
function
|
|
845
|
-
const t =
|
|
866
|
+
function ms(e) {
|
|
867
|
+
const t = ka.find(
|
|
846
868
|
([n]) => n.test(e)
|
|
847
869
|
);
|
|
848
870
|
return t ? t[1] : "generic";
|
|
849
871
|
}
|
|
850
|
-
const
|
|
851
|
-
video:
|
|
872
|
+
const Ca = {
|
|
873
|
+
video: ls,
|
|
852
874
|
audio: Dn,
|
|
853
|
-
image:
|
|
854
|
-
document:
|
|
855
|
-
},
|
|
856
|
-
pdf:
|
|
857
|
-
doc:
|
|
858
|
-
xls:
|
|
859
|
-
csv:
|
|
860
|
-
ppt:
|
|
861
|
-
zip:
|
|
862
|
-
text:
|
|
863
|
-
markdown:
|
|
864
|
-
generic:
|
|
875
|
+
image: Ln,
|
|
876
|
+
document: is
|
|
877
|
+
}, Sa = {
|
|
878
|
+
pdf: jn,
|
|
879
|
+
doc: Un,
|
|
880
|
+
xls: Bn,
|
|
881
|
+
csv: $n,
|
|
882
|
+
ppt: On,
|
|
883
|
+
zip: Pn,
|
|
884
|
+
text: Fn,
|
|
885
|
+
markdown: zn,
|
|
886
|
+
generic: is
|
|
865
887
|
};
|
|
866
|
-
function
|
|
888
|
+
function Ea(e) {
|
|
867
889
|
const t = ce(e);
|
|
868
|
-
return t !== "document" ?
|
|
890
|
+
return t !== "document" ? Ca[t] : Sa[ms(e)];
|
|
869
891
|
}
|
|
870
|
-
function
|
|
871
|
-
return V.createElement(
|
|
892
|
+
function _e(e, t) {
|
|
893
|
+
return V.createElement(Ea(e), t);
|
|
872
894
|
}
|
|
873
|
-
const
|
|
895
|
+
const Ia = (e) => {
|
|
874
896
|
var t, n;
|
|
875
897
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
|
|
876
|
-
},
|
|
898
|
+
}, Ta = ({
|
|
877
899
|
source: e,
|
|
878
900
|
mimeType: t,
|
|
879
901
|
poster: n,
|
|
@@ -885,15 +907,15 @@ const ya = (e) => {
|
|
|
885
907
|
muted: d = !1,
|
|
886
908
|
onContainerClick: m
|
|
887
909
|
}) => {
|
|
888
|
-
const
|
|
910
|
+
const f = ce(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] = U(a), [p, _] = U(0), [w, k] = U(!1), [D, S] = U(!1), [R, O] = U(!1), [F, L] = U(!1), [C, E] = U(!0), [I, T] = U(null), M = J(() => {
|
|
889
911
|
O(!1), x(!0);
|
|
890
912
|
}, []), P = J((N) => {
|
|
891
|
-
const A =
|
|
913
|
+
const A = g.current;
|
|
892
914
|
if (!A) return 0;
|
|
893
915
|
const H = A.getBoundingClientRect();
|
|
894
916
|
return Math.max(
|
|
895
917
|
0,
|
|
896
|
-
Math.min(1, (
|
|
918
|
+
Math.min(1, (Ia(N) - H.left) / H.width)
|
|
897
919
|
);
|
|
898
920
|
}, []), $ = J((N) => {
|
|
899
921
|
const A = h.current;
|
|
@@ -956,7 +978,7 @@ const ya = (e) => {
|
|
|
956
978
|
}
|
|
957
979
|
},
|
|
958
980
|
children: [
|
|
959
|
-
n && (
|
|
981
|
+
n && (f === "audio" || C) && /* @__PURE__ */ s(
|
|
960
982
|
"img",
|
|
961
983
|
{
|
|
962
984
|
src: n,
|
|
@@ -964,11 +986,11 @@ const ya = (e) => {
|
|
|
964
986
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
965
987
|
}
|
|
966
988
|
),
|
|
967
|
-
!n && (
|
|
989
|
+
!n && (f === "audio" || C) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: _e(t, {
|
|
968
990
|
className: "size-12 text-black/20",
|
|
969
991
|
weight: "regular"
|
|
970
992
|
}) }),
|
|
971
|
-
/* @__PURE__ */ s("div", { className: "absolute inset-0", children:
|
|
993
|
+
/* @__PURE__ */ s("div", { className: "absolute inset-0", children: f === "audio" ? /* @__PURE__ */ s(
|
|
972
994
|
"audio",
|
|
973
995
|
{
|
|
974
996
|
ref: h,
|
|
@@ -976,11 +998,11 @@ const ya = (e) => {
|
|
|
976
998
|
loop: i,
|
|
977
999
|
muted: d,
|
|
978
1000
|
style: { width: "100%", height: "100%" },
|
|
979
|
-
onLoadStart: () =>
|
|
1001
|
+
onLoadStart: () => L(!0),
|
|
980
1002
|
onCanPlay: () => {
|
|
981
|
-
|
|
1003
|
+
L(!1), E(!1);
|
|
982
1004
|
},
|
|
983
|
-
onWaiting: () =>
|
|
1005
|
+
onWaiting: () => L(!0),
|
|
984
1006
|
onPlay: () => O(!1),
|
|
985
1007
|
onEnded: () => {
|
|
986
1008
|
i || (x(!1), _(0));
|
|
@@ -996,11 +1018,11 @@ const ya = (e) => {
|
|
|
996
1018
|
muted: d,
|
|
997
1019
|
playsInline: !0,
|
|
998
1020
|
style: { width: "100%", height: "100%" },
|
|
999
|
-
onLoadStart: () =>
|
|
1021
|
+
onLoadStart: () => L(!0),
|
|
1000
1022
|
onCanPlay: () => {
|
|
1001
|
-
|
|
1023
|
+
L(!1), E(!1);
|
|
1002
1024
|
},
|
|
1003
|
-
onWaiting: () =>
|
|
1025
|
+
onWaiting: () => L(!0),
|
|
1004
1026
|
onPlay: () => O(!1),
|
|
1005
1027
|
onLoadedMetadata: () => {
|
|
1006
1028
|
const N = h.current;
|
|
@@ -1013,7 +1035,7 @@ const ya = (e) => {
|
|
|
1013
1035
|
}
|
|
1014
1036
|
) }),
|
|
1015
1037
|
F && !R && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
1016
|
-
|
|
1038
|
+
Se,
|
|
1017
1039
|
{
|
|
1018
1040
|
className: "size-8 animate-spin text-white/80",
|
|
1019
1041
|
weight: "bold"
|
|
@@ -1032,7 +1054,7 @@ const ya = (e) => {
|
|
|
1032
1054
|
onKeyDown: (N) => {
|
|
1033
1055
|
N.key !== "Enter" && N.key !== " " || (N.preventDefault(), N.stopPropagation(), M());
|
|
1034
1056
|
},
|
|
1035
|
-
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(
|
|
1057
|
+
children: /* @__PURE__ */ s("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ s(rt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1036
1058
|
}
|
|
1037
1059
|
),
|
|
1038
1060
|
l && !o && /* @__PURE__ */ s("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__ */ s(
|
|
@@ -1044,7 +1066,7 @@ const ya = (e) => {
|
|
|
1044
1066
|
"aria-valuemin": 0,
|
|
1045
1067
|
"aria-valuemax": 100,
|
|
1046
1068
|
tabIndex: 0,
|
|
1047
|
-
ref:
|
|
1069
|
+
ref: g,
|
|
1048
1070
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1049
1071
|
onMouseDown: j,
|
|
1050
1072
|
onTouchStart: j,
|
|
@@ -1071,7 +1093,7 @@ const ya = (e) => {
|
|
|
1071
1093
|
},
|
|
1072
1094
|
className: "shrink-0 text-white",
|
|
1073
1095
|
"aria-label": v ? "Pause" : "Play",
|
|
1074
|
-
children: v ? /* @__PURE__ */ s(
|
|
1096
|
+
children: v ? /* @__PURE__ */ s(Vn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(rt, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1075
1097
|
}
|
|
1076
1098
|
),
|
|
1077
1099
|
/* @__PURE__ */ u(
|
|
@@ -1083,7 +1105,7 @@ const ya = (e) => {
|
|
|
1083
1105
|
"aria-valuemin": 0,
|
|
1084
1106
|
"aria-valuemax": 100,
|
|
1085
1107
|
tabIndex: 0,
|
|
1086
|
-
ref:
|
|
1108
|
+
ref: g,
|
|
1087
1109
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1088
1110
|
onMouseDown: j,
|
|
1089
1111
|
onTouchStart: j,
|
|
@@ -1097,7 +1119,7 @@ const ya = (e) => {
|
|
|
1097
1119
|
/* @__PURE__ */ s(
|
|
1098
1120
|
"div",
|
|
1099
1121
|
{
|
|
1100
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
1122
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${D || w ? "h-1.5" : "h-1"}`,
|
|
1101
1123
|
children: /* @__PURE__ */ s(
|
|
1102
1124
|
"div",
|
|
1103
1125
|
{
|
|
@@ -1110,7 +1132,7 @@ const ya = (e) => {
|
|
|
1110
1132
|
/* @__PURE__ */ s(
|
|
1111
1133
|
"div",
|
|
1112
1134
|
{
|
|
1113
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
1135
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${D || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1114
1136
|
style: { left: `${X}%` }
|
|
1115
1137
|
}
|
|
1116
1138
|
)
|
|
@@ -1121,7 +1143,7 @@ const ya = (e) => {
|
|
|
1121
1143
|
]
|
|
1122
1144
|
}
|
|
1123
1145
|
);
|
|
1124
|
-
},
|
|
1146
|
+
}, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ma = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", hs = ({
|
|
1125
1147
|
mimeType: e,
|
|
1126
1148
|
sourceUrl: t,
|
|
1127
1149
|
thumbnailUrl: n,
|
|
@@ -1130,20 +1152,20 @@ const ya = (e) => {
|
|
|
1130
1152
|
mediaPlayerProps: i,
|
|
1131
1153
|
containedImage: o = !1
|
|
1132
1154
|
}) => {
|
|
1133
|
-
const l = ce(e), [d, m] = U(!1);
|
|
1155
|
+
const l = ce(e), [d, m] = U(!1), f = he(t), h = he(n);
|
|
1134
1156
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
|
|
1135
|
-
|
|
1157
|
+
Ta,
|
|
1136
1158
|
{
|
|
1137
1159
|
source: t,
|
|
1138
1160
|
mimeType: e,
|
|
1139
|
-
poster:
|
|
1161
|
+
poster: h,
|
|
1140
1162
|
controls: !0,
|
|
1141
1163
|
...i
|
|
1142
1164
|
}
|
|
1143
1165
|
) : t && l === "image" ? o ? /* @__PURE__ */ s("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ s(
|
|
1144
1166
|
"img",
|
|
1145
1167
|
{
|
|
1146
|
-
src: t,
|
|
1168
|
+
src: f ?? t,
|
|
1147
1169
|
alt: a ?? "",
|
|
1148
1170
|
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${d ? "opacity-100" : "opacity-0"}`,
|
|
1149
1171
|
draggable: !1,
|
|
@@ -1152,7 +1174,7 @@ const ya = (e) => {
|
|
|
1152
1174
|
) }) : /* @__PURE__ */ s(
|
|
1153
1175
|
"img",
|
|
1154
1176
|
{
|
|
1155
|
-
src: t,
|
|
1177
|
+
src: f ?? t,
|
|
1156
1178
|
alt: a ?? "",
|
|
1157
1179
|
className: "block w-full",
|
|
1158
1180
|
draggable: !1
|
|
@@ -1160,7 +1182,7 @@ const ya = (e) => {
|
|
|
1160
1182
|
) : t && l === "document" ? n ? o ? /* @__PURE__ */ s("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ s(
|
|
1161
1183
|
"img",
|
|
1162
1184
|
{
|
|
1163
|
-
src: n,
|
|
1185
|
+
src: h ?? n,
|
|
1164
1186
|
alt: a ?? "",
|
|
1165
1187
|
className: `absolute inset-0 h-full w-full object-contain transition-opacity duration-300 ${d ? "opacity-100" : "opacity-0"}`,
|
|
1166
1188
|
draggable: !1,
|
|
@@ -1169,7 +1191,7 @@ const ya = (e) => {
|
|
|
1169
1191
|
) }) : /* @__PURE__ */ s(
|
|
1170
1192
|
"img",
|
|
1171
1193
|
{
|
|
1172
|
-
src: n,
|
|
1194
|
+
src: h ?? n,
|
|
1173
1195
|
alt: "",
|
|
1174
1196
|
className: "block w-full",
|
|
1175
1197
|
draggable: !1
|
|
@@ -1178,15 +1200,15 @@ const ya = (e) => {
|
|
|
1178
1200
|
"div",
|
|
1179
1201
|
{
|
|
1180
1202
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1181
|
-
children:
|
|
1182
|
-
className:
|
|
1203
|
+
children: _e(e, {
|
|
1204
|
+
className: Kt(r),
|
|
1183
1205
|
weight: "regular"
|
|
1184
1206
|
})
|
|
1185
1207
|
}
|
|
1186
|
-
) : n ? /* @__PURE__ */ s("div", { className: `relative ${
|
|
1208
|
+
) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ma(r)}`, children: /* @__PURE__ */ s(
|
|
1187
1209
|
"img",
|
|
1188
1210
|
{
|
|
1189
|
-
src: n,
|
|
1211
|
+
src: h ?? n,
|
|
1190
1212
|
alt: a ?? "",
|
|
1191
1213
|
draggable: !1,
|
|
1192
1214
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
@@ -1195,13 +1217,13 @@ const ya = (e) => {
|
|
|
1195
1217
|
"div",
|
|
1196
1218
|
{
|
|
1197
1219
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1198
|
-
children:
|
|
1199
|
-
className:
|
|
1220
|
+
children: _e(e, {
|
|
1221
|
+
className: Kt(r),
|
|
1200
1222
|
weight: "regular"
|
|
1201
1223
|
})
|
|
1202
1224
|
}
|
|
1203
1225
|
);
|
|
1204
|
-
},
|
|
1226
|
+
}, fs = ({
|
|
1205
1227
|
variant: e,
|
|
1206
1228
|
thumbnail: t,
|
|
1207
1229
|
title: n,
|
|
@@ -1212,18 +1234,18 @@ const ya = (e) => {
|
|
|
1212
1234
|
action: l,
|
|
1213
1235
|
topLeft: d,
|
|
1214
1236
|
topRight: m,
|
|
1215
|
-
rootRef:
|
|
1237
|
+
rootRef: f,
|
|
1216
1238
|
"data-testid": h
|
|
1217
1239
|
}) => {
|
|
1218
|
-
const
|
|
1240
|
+
const g = e === "dark", c = g ? n ?? a : n ?? "", b = g && !n;
|
|
1219
1241
|
return /* @__PURE__ */ u(
|
|
1220
1242
|
"div",
|
|
1221
1243
|
{
|
|
1222
|
-
ref:
|
|
1244
|
+
ref: f,
|
|
1223
1245
|
"data-testid": h,
|
|
1224
1246
|
className: y(
|
|
1225
1247
|
"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)]",
|
|
1226
|
-
|
|
1248
|
+
g ? "bg-[#1e2330]" : "bg-white"
|
|
1227
1249
|
),
|
|
1228
1250
|
children: [
|
|
1229
1251
|
d ? /* @__PURE__ */ s("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: d }) : null,
|
|
@@ -1234,18 +1256,18 @@ const ya = (e) => {
|
|
|
1234
1256
|
"p",
|
|
1235
1257
|
{
|
|
1236
1258
|
className: y("mb-0.5 truncate text-base font-medium", {
|
|
1237
|
-
"text-black": !
|
|
1238
|
-
"text-white/30":
|
|
1239
|
-
"text-white":
|
|
1259
|
+
"text-black": !g,
|
|
1260
|
+
"text-white/30": g && b,
|
|
1261
|
+
"text-white": g && !b
|
|
1240
1262
|
}),
|
|
1241
1263
|
children: c
|
|
1242
1264
|
}
|
|
1243
1265
|
),
|
|
1244
1266
|
/* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1245
|
-
|
|
1267
|
+
_e(r, {
|
|
1246
1268
|
className: y(
|
|
1247
1269
|
"size-5 shrink-0",
|
|
1248
|
-
|
|
1270
|
+
g ? "text-white/55" : "text-black/55"
|
|
1249
1271
|
),
|
|
1250
1272
|
weight: "regular"
|
|
1251
1273
|
}),
|
|
@@ -1254,7 +1276,7 @@ const ya = (e) => {
|
|
|
1254
1276
|
{
|
|
1255
1277
|
className: y(
|
|
1256
1278
|
"text-xs font-medium",
|
|
1257
|
-
|
|
1279
|
+
g ? "text-white/55" : "text-black/55"
|
|
1258
1280
|
),
|
|
1259
1281
|
children: i
|
|
1260
1282
|
}
|
|
@@ -1267,59 +1289,59 @@ const ya = (e) => {
|
|
|
1267
1289
|
}
|
|
1268
1290
|
);
|
|
1269
1291
|
};
|
|
1270
|
-
function
|
|
1292
|
+
function gs(e) {
|
|
1271
1293
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1272
1294
|
}
|
|
1273
|
-
function
|
|
1295
|
+
function ht(e) {
|
|
1274
1296
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#1e2330]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1275
1297
|
}
|
|
1276
|
-
function
|
|
1298
|
+
function Aa(e) {
|
|
1277
1299
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1278
1300
|
}
|
|
1279
|
-
function
|
|
1301
|
+
function Ra(e) {
|
|
1280
1302
|
return e ? "text-white" : "text-black";
|
|
1281
1303
|
}
|
|
1282
|
-
function
|
|
1304
|
+
function La(e) {
|
|
1283
1305
|
return e ? "text-white/55" : "text-black/55";
|
|
1284
1306
|
}
|
|
1285
|
-
function
|
|
1307
|
+
function Da(e) {
|
|
1286
1308
|
return e ? "text-white/40" : "text-black/40";
|
|
1287
1309
|
}
|
|
1288
|
-
function
|
|
1310
|
+
function za(e) {
|
|
1289
1311
|
return e ? "text-white/20" : "text-black/20";
|
|
1290
1312
|
}
|
|
1291
|
-
const
|
|
1313
|
+
const ft = ({ attachment: e, isMyMessage: t }) => {
|
|
1292
1314
|
const { title: n, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ u(V.Fragment, { children: [
|
|
1293
1315
|
/* @__PURE__ */ s("div", { className: "p-2", children: r ? /* @__PURE__ */ s(
|
|
1294
1316
|
"img",
|
|
1295
1317
|
{
|
|
1296
|
-
src: r,
|
|
1318
|
+
src: he(r) ?? r,
|
|
1297
1319
|
alt: n ?? "",
|
|
1298
1320
|
className: "aspect-video w-full rounded-[20px] object-cover"
|
|
1299
1321
|
}
|
|
1300
1322
|
) : /* @__PURE__ */ s(
|
|
1301
1323
|
"div",
|
|
1302
1324
|
{
|
|
1303
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1304
|
-
children: /* @__PURE__ */ s(
|
|
1325
|
+
className: `aspect-video w-full rounded-[20px] ${Aa(t)} flex items-center justify-center`,
|
|
1326
|
+
children: /* @__PURE__ */ s(Gn, { className: `size-12 ${za(t)}` })
|
|
1305
1327
|
}
|
|
1306
1328
|
) }),
|
|
1307
1329
|
/* @__PURE__ */ u("div", { className: "px-3 pb-3", children: [
|
|
1308
|
-
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1309
|
-
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${
|
|
1310
|
-
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1330
|
+
n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Ra(t)}`, children: n }),
|
|
1331
|
+
a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${La(t)}`, children: a }),
|
|
1332
|
+
d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Da(t)}`, children: d })
|
|
1311
1333
|
] })
|
|
1312
1334
|
] });
|
|
1313
1335
|
return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ s("div", { className: "block", children: m });
|
|
1314
1336
|
};
|
|
1315
|
-
function
|
|
1337
|
+
function ps(e) {
|
|
1316
1338
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1317
1339
|
}
|
|
1318
|
-
function
|
|
1340
|
+
function gt(e) {
|
|
1319
1341
|
var t;
|
|
1320
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1342
|
+
return (t = e.attachments) == null ? void 0 : t.find(ps);
|
|
1321
1343
|
}
|
|
1322
|
-
async function
|
|
1344
|
+
async function Fa(e, t) {
|
|
1323
1345
|
let n;
|
|
1324
1346
|
try {
|
|
1325
1347
|
n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1331,7 +1353,7 @@ async function Aa(e, t) {
|
|
|
1331
1353
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1332
1354
|
o.href = i, o.download = n, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1333
1355
|
}
|
|
1334
|
-
const
|
|
1356
|
+
const Pa = ({
|
|
1335
1357
|
url: e,
|
|
1336
1358
|
filename: t
|
|
1337
1359
|
}) => {
|
|
@@ -1343,7 +1365,7 @@ const Ra = ({
|
|
|
1343
1365
|
onClick: (i) => {
|
|
1344
1366
|
i.stopPropagation();
|
|
1345
1367
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1346
|
-
a(!0),
|
|
1368
|
+
a(!0), Fa(e, t).then(() => {
|
|
1347
1369
|
o == null || o.close();
|
|
1348
1370
|
}).catch(() => {
|
|
1349
1371
|
o && (o.location.href = e);
|
|
@@ -1351,18 +1373,18 @@ const Ra = ({
|
|
|
1351
1373
|
},
|
|
1352
1374
|
disabled: n,
|
|
1353
1375
|
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",
|
|
1354
|
-
children: n ? /* @__PURE__ */ s(
|
|
1355
|
-
/* @__PURE__ */ s(
|
|
1376
|
+
children: n ? /* @__PURE__ */ s(Se, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ u(V.Fragment, { children: [
|
|
1377
|
+
/* @__PURE__ */ s(Ee, { className: "size-4 text-white", weight: "bold" }),
|
|
1356
1378
|
"Download"
|
|
1357
1379
|
] })
|
|
1358
1380
|
}
|
|
1359
1381
|
);
|
|
1360
1382
|
};
|
|
1361
|
-
function
|
|
1362
|
-
var h,
|
|
1383
|
+
function pt(e) {
|
|
1384
|
+
var h, g, c, b;
|
|
1363
1385
|
const t = (h = e.attachments) == null ? void 0 : h.find(
|
|
1364
1386
|
(v) => v.type === "video" && v.asset_url
|
|
1365
|
-
), n = (
|
|
1387
|
+
), n = (g = e.attachments) == null ? void 0 : g.find(
|
|
1366
1388
|
(v) => v.type === "image" && v.image_url
|
|
1367
1389
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1368
1390
|
(v) => v.type === "audio" && v.asset_url
|
|
@@ -1370,25 +1392,25 @@ function gt(e) {
|
|
|
1370
1392
|
(v) => v.type === "file" && v.asset_url
|
|
1371
1393
|
), i = t ?? n ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1372
1394
|
if (!o) return null;
|
|
1373
|
-
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size,
|
|
1395
|
+
const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, f = t == null ? void 0 : t.thumb_url;
|
|
1374
1396
|
return {
|
|
1375
1397
|
resolvedUrl: o,
|
|
1376
1398
|
resolvedType: l,
|
|
1377
1399
|
title: d,
|
|
1378
1400
|
fileSize: m,
|
|
1379
|
-
thumbnailUrl:
|
|
1401
|
+
thumbnailUrl: f
|
|
1380
1402
|
};
|
|
1381
1403
|
}
|
|
1382
|
-
const
|
|
1404
|
+
const bs = ({
|
|
1383
1405
|
resolvedUrl: e,
|
|
1384
1406
|
resolvedType: t,
|
|
1385
1407
|
title: n,
|
|
1386
1408
|
fileSize: a,
|
|
1387
1409
|
thumbnailUrl: r
|
|
1388
1410
|
}) => {
|
|
1389
|
-
const i = a !== void 0 ?
|
|
1411
|
+
const i = a !== void 0 ? gs(a) : void 0;
|
|
1390
1412
|
return /* @__PURE__ */ s(
|
|
1391
|
-
|
|
1413
|
+
fs,
|
|
1392
1414
|
{
|
|
1393
1415
|
variant: "dark",
|
|
1394
1416
|
title: n,
|
|
@@ -1396,7 +1418,7 @@ const ps = ({
|
|
|
1396
1418
|
mimeType: t,
|
|
1397
1419
|
detail: i,
|
|
1398
1420
|
thumbnail: /* @__PURE__ */ s(
|
|
1399
|
-
|
|
1421
|
+
hs,
|
|
1400
1422
|
{
|
|
1401
1423
|
mimeType: t,
|
|
1402
1424
|
sourceUrl: e,
|
|
@@ -1407,23 +1429,23 @@ const ps = ({
|
|
|
1407
1429
|
)
|
|
1408
1430
|
}
|
|
1409
1431
|
);
|
|
1410
|
-
},
|
|
1432
|
+
}, vs = ({
|
|
1411
1433
|
resolvedUrl: e,
|
|
1412
1434
|
resolvedType: t,
|
|
1413
1435
|
title: n,
|
|
1414
1436
|
fileSize: a,
|
|
1415
1437
|
thumbnailUrl: r
|
|
1416
1438
|
}) => {
|
|
1417
|
-
const i = ce(t), o = a !== void 0 ?
|
|
1439
|
+
const i = ce(t), o = a !== void 0 ? gs(a) : void 0;
|
|
1418
1440
|
return /* @__PURE__ */ s(
|
|
1419
|
-
|
|
1441
|
+
fs,
|
|
1420
1442
|
{
|
|
1421
1443
|
variant: "light",
|
|
1422
1444
|
title: n,
|
|
1423
1445
|
mimeType: t,
|
|
1424
1446
|
detail: o,
|
|
1425
1447
|
thumbnail: /* @__PURE__ */ s(
|
|
1426
|
-
|
|
1448
|
+
hs,
|
|
1427
1449
|
{
|
|
1428
1450
|
mimeType: t,
|
|
1429
1451
|
sourceUrl: e,
|
|
@@ -1433,14 +1455,14 @@ const ps = ({
|
|
|
1433
1455
|
containedImage: i === "image" || i === "document"
|
|
1434
1456
|
}
|
|
1435
1457
|
),
|
|
1436
|
-
action: /* @__PURE__ */ s(
|
|
1458
|
+
action: /* @__PURE__ */ s(Pa, { url: e, filename: n })
|
|
1437
1459
|
}
|
|
1438
1460
|
);
|
|
1439
|
-
},
|
|
1461
|
+
}, Oa = ({
|
|
1440
1462
|
message: e,
|
|
1441
1463
|
isMyMessage: t = !1
|
|
1442
1464
|
}) => {
|
|
1443
|
-
const n =
|
|
1465
|
+
const n = gt(e), a = pt(e);
|
|
1444
1466
|
return !n && !a ? null : /* @__PURE__ */ u("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1445
1467
|
!t && e.user && /* @__PURE__ */ s(
|
|
1446
1468
|
ne,
|
|
@@ -1462,41 +1484,41 @@ const ps = ({
|
|
|
1462
1484
|
className: "str-chat__message-bubble",
|
|
1463
1485
|
"data-attachment-bubble": "true",
|
|
1464
1486
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1465
|
-
children: n ? /* @__PURE__ */ s("div", { className:
|
|
1487
|
+
children: n ? /* @__PURE__ */ s("div", { className: ht(t), children: /* @__PURE__ */ s(ft, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(bs, { ...a }) : /* @__PURE__ */ s(vs, { ...a })
|
|
1466
1488
|
}
|
|
1467
1489
|
) })
|
|
1468
1490
|
}
|
|
1469
1491
|
)
|
|
1470
1492
|
] });
|
|
1471
|
-
},
|
|
1493
|
+
}, $a = ({
|
|
1472
1494
|
message: e
|
|
1473
1495
|
}) => {
|
|
1474
|
-
const t =
|
|
1496
|
+
const t = gt(e);
|
|
1475
1497
|
if (t)
|
|
1476
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1477
|
-
const n =
|
|
1478
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1479
|
-
},
|
|
1498
|
+
return /* @__PURE__ */ s("div", { className: ht(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !0 }) });
|
|
1499
|
+
const n = pt(e);
|
|
1500
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(bs, { ...n }) }) : null;
|
|
1501
|
+
}, Ba = ({
|
|
1480
1502
|
message: e
|
|
1481
1503
|
}) => {
|
|
1482
|
-
const t =
|
|
1504
|
+
const t = gt(e);
|
|
1483
1505
|
if (t)
|
|
1484
|
-
return /* @__PURE__ */ s("div", { className:
|
|
1485
|
-
const n =
|
|
1486
|
-
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(
|
|
1487
|
-
},
|
|
1488
|
-
Creator:
|
|
1489
|
-
Visitor:
|
|
1490
|
-
}),
|
|
1506
|
+
return /* @__PURE__ */ s("div", { className: ht(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !1 }) });
|
|
1507
|
+
const n = pt(e);
|
|
1508
|
+
return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
|
|
1509
|
+
}, fl = Object.assign(Oa, {
|
|
1510
|
+
Creator: $a,
|
|
1511
|
+
Visitor: Ba
|
|
1512
|
+
}), Ua = {
|
|
1491
1513
|
dark: "bg-[#1e2330]",
|
|
1492
1514
|
light: "bg-[#f2f1ef]"
|
|
1493
|
-
},
|
|
1515
|
+
}, ja = {
|
|
1494
1516
|
dark: "text-white",
|
|
1495
1517
|
light: "text-[#000000]"
|
|
1496
|
-
},
|
|
1518
|
+
}, Va = {
|
|
1497
1519
|
dark: "border-white/[0.08]",
|
|
1498
1520
|
light: "border-black/[0.08]"
|
|
1499
|
-
},
|
|
1521
|
+
}, Ga = (e) => e === "dark" ? "sender" : "receiver", Ha = {
|
|
1500
1522
|
sender: {
|
|
1501
1523
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1502
1524
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1509,7 +1531,7 @@ const ps = ({
|
|
|
1509
1531
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
1510
1532
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
1511
1533
|
}
|
|
1512
|
-
},
|
|
1534
|
+
}, Me = ({
|
|
1513
1535
|
variant: e,
|
|
1514
1536
|
text: t,
|
|
1515
1537
|
bordered: n = !0,
|
|
@@ -1518,7 +1540,7 @@ const ps = ({
|
|
|
1518
1540
|
children: i,
|
|
1519
1541
|
"data-testid": o
|
|
1520
1542
|
}) => {
|
|
1521
|
-
const l = t != null && t !== "", d =
|
|
1543
|
+
const l = t != null && t !== "", d = Ha[Ga(e)][a];
|
|
1522
1544
|
return /* @__PURE__ */ u(
|
|
1523
1545
|
"div",
|
|
1524
1546
|
{
|
|
@@ -1533,10 +1555,10 @@ const ps = ({
|
|
|
1533
1555
|
// as the surrounding `CustomMessage` text bubbles.
|
|
1534
1556
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
1535
1557
|
d,
|
|
1536
|
-
|
|
1537
|
-
|
|
1558
|
+
Ua[e],
|
|
1559
|
+
ja[e],
|
|
1538
1560
|
n && "border",
|
|
1539
|
-
n &&
|
|
1561
|
+
n && Va[e],
|
|
1540
1562
|
r
|
|
1541
1563
|
),
|
|
1542
1564
|
children: [
|
|
@@ -1561,7 +1583,7 @@ const ps = ({
|
|
|
1561
1583
|
]
|
|
1562
1584
|
}
|
|
1563
1585
|
);
|
|
1564
|
-
},
|
|
1586
|
+
}, Ae = ({
|
|
1565
1587
|
onClick: e,
|
|
1566
1588
|
variant: t = "overlay",
|
|
1567
1589
|
ariaLabel: n = "Dismiss attachment"
|
|
@@ -1577,18 +1599,18 @@ const ps = ({
|
|
|
1577
1599
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
1578
1600
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
1579
1601
|
),
|
|
1580
|
-
children: /* @__PURE__ */ s(
|
|
1602
|
+
children: /* @__PURE__ */ s(Ge, { className: "size-3", weight: "bold" })
|
|
1581
1603
|
}
|
|
1582
|
-
),
|
|
1604
|
+
), Re = (e) => e === "received" ? "light" : "dark", Ya = ({
|
|
1583
1605
|
firstOfGroup: e,
|
|
1584
1606
|
endOfGroup: t,
|
|
1585
1607
|
groupedByUser: n
|
|
1586
|
-
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
1608
|
+
}) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", qa = ({
|
|
1587
1609
|
src: e,
|
|
1588
1610
|
mimeType: t,
|
|
1589
1611
|
filename: n,
|
|
1590
1612
|
items: a
|
|
1591
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [],
|
|
1613
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], Wa = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
1592
1614
|
/* @__PURE__ */ s(
|
|
1593
1615
|
"audio",
|
|
1594
1616
|
{
|
|
@@ -1600,7 +1622,7 @@ const ps = ({
|
|
|
1600
1622
|
}
|
|
1601
1623
|
),
|
|
1602
1624
|
n ?? null
|
|
1603
|
-
] }),
|
|
1625
|
+
] }), bt = ({
|
|
1604
1626
|
state: e,
|
|
1605
1627
|
src: t,
|
|
1606
1628
|
mimeType: n,
|
|
@@ -1611,41 +1633,41 @@ const ps = ({
|
|
|
1611
1633
|
preload: l,
|
|
1612
1634
|
onDismiss: d
|
|
1613
1635
|
}) => {
|
|
1614
|
-
const m =
|
|
1636
|
+
const m = Re(e), f = e === "composer" && !!d, h = qa({ src: t, mimeType: n, filename: a, items: r });
|
|
1615
1637
|
if (h.length === 0)
|
|
1616
1638
|
return null;
|
|
1617
|
-
const
|
|
1639
|
+
const g = l ?? (h.length > 1 ? "none" : "metadata");
|
|
1618
1640
|
return /* @__PURE__ */ s(
|
|
1619
|
-
|
|
1641
|
+
Me,
|
|
1620
1642
|
{
|
|
1621
1643
|
variant: m,
|
|
1622
1644
|
text: i,
|
|
1623
1645
|
groupPosition: o,
|
|
1624
1646
|
"data-testid": "audio-attachment",
|
|
1625
1647
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((c, b) => /* @__PURE__ */ s(
|
|
1626
|
-
|
|
1648
|
+
Wa,
|
|
1627
1649
|
{
|
|
1628
1650
|
item: c,
|
|
1629
|
-
preload:
|
|
1651
|
+
preload: g,
|
|
1630
1652
|
trailingAction: (
|
|
1631
1653
|
// Composer only supports a single attachment, so the
|
|
1632
1654
|
// dismiss control sits on the only player.
|
|
1633
|
-
|
|
1655
|
+
f && b === 0 ? /* @__PURE__ */ s(Ae, { onClick: d, variant: "inline" }) : void 0
|
|
1634
1656
|
)
|
|
1635
1657
|
},
|
|
1636
1658
|
`${c.src}-${b}`
|
|
1637
1659
|
)) })
|
|
1638
1660
|
}
|
|
1639
1661
|
);
|
|
1640
|
-
},
|
|
1641
|
-
Composer:
|
|
1642
|
-
Sent:
|
|
1643
|
-
Received:
|
|
1662
|
+
}, Xa = (e) => /* @__PURE__ */ s(bt, { ...e, state: "composer" }), Ka = (e) => /* @__PURE__ */ s(bt, { ...e, state: "sent" }), Za = (e) => /* @__PURE__ */ s(bt, { ...e, state: "received" }), Ja = {
|
|
1663
|
+
Composer: Xa,
|
|
1664
|
+
Sent: Ka,
|
|
1665
|
+
Received: Za
|
|
1644
1666
|
};
|
|
1645
|
-
function
|
|
1667
|
+
function Qa(e) {
|
|
1646
1668
|
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`;
|
|
1647
1669
|
}
|
|
1648
|
-
const
|
|
1670
|
+
const er = {
|
|
1649
1671
|
pdf: "PDF",
|
|
1650
1672
|
doc: "DOC",
|
|
1651
1673
|
xls: "XLS",
|
|
@@ -1655,7 +1677,7 @@ const Xa = {
|
|
|
1655
1677
|
text: "TXT",
|
|
1656
1678
|
markdown: "MD"
|
|
1657
1679
|
};
|
|
1658
|
-
function
|
|
1680
|
+
function tr(e, t) {
|
|
1659
1681
|
if (t) {
|
|
1660
1682
|
const r = t.lastIndexOf(".");
|
|
1661
1683
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -1665,7 +1687,7 @@ function Ka(e, t) {
|
|
|
1665
1687
|
}
|
|
1666
1688
|
if (!e) return;
|
|
1667
1689
|
if (ce(e) === "document") {
|
|
1668
|
-
const r =
|
|
1690
|
+
const r = ms(e), i = er[r];
|
|
1669
1691
|
if (i) return i;
|
|
1670
1692
|
if (e === "application/octet-stream") return;
|
|
1671
1693
|
}
|
|
@@ -1673,8 +1695,8 @@ function Ka(e, t) {
|
|
|
1673
1695
|
if (!(!a || a === "*"))
|
|
1674
1696
|
return a.toUpperCase();
|
|
1675
1697
|
}
|
|
1676
|
-
function
|
|
1677
|
-
const a =
|
|
1698
|
+
function sr(e, t, n) {
|
|
1699
|
+
const a = tr(e, t), r = typeof n == "number" && n > 0 ? Qa(n) : void 0;
|
|
1678
1700
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
1679
1701
|
}
|
|
1680
1702
|
function ie(e) {
|
|
@@ -1685,16 +1707,16 @@ function ie(e) {
|
|
|
1685
1707
|
return "download";
|
|
1686
1708
|
}
|
|
1687
1709
|
}
|
|
1688
|
-
const
|
|
1710
|
+
const nr = {
|
|
1689
1711
|
dark: "text-white/55",
|
|
1690
1712
|
light: "text-black/65"
|
|
1691
|
-
},
|
|
1713
|
+
}, ar = {
|
|
1692
1714
|
dark: "bg-white/10",
|
|
1693
1715
|
light: "bg-black/5"
|
|
1694
|
-
},
|
|
1716
|
+
}, rr = {
|
|
1695
1717
|
dark: "text-white/85",
|
|
1696
1718
|
light: "text-black/85"
|
|
1697
|
-
},
|
|
1719
|
+
}, xs = ({
|
|
1698
1720
|
variant: e,
|
|
1699
1721
|
filename: t,
|
|
1700
1722
|
title: n,
|
|
@@ -1704,16 +1726,16 @@ const Ja = {
|
|
|
1704
1726
|
activateLabel: o,
|
|
1705
1727
|
trailingAction: l
|
|
1706
1728
|
}) => {
|
|
1707
|
-
const d = n ?? t ?? "File", m =
|
|
1729
|
+
const d = n ?? t ?? "File", m = sr(a, t, r), f = /* @__PURE__ */ s(
|
|
1708
1730
|
"div",
|
|
1709
1731
|
{
|
|
1710
1732
|
className: y(
|
|
1711
1733
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1712
|
-
|
|
1734
|
+
ar[e]
|
|
1713
1735
|
),
|
|
1714
1736
|
"aria-hidden": !0,
|
|
1715
|
-
children:
|
|
1716
|
-
className: y("size-6",
|
|
1737
|
+
children: _e(a, {
|
|
1738
|
+
className: y("size-6", rr[e]),
|
|
1717
1739
|
weight: "regular"
|
|
1718
1740
|
})
|
|
1719
1741
|
}
|
|
@@ -1724,12 +1746,12 @@ const Ja = {
|
|
|
1724
1746
|
{
|
|
1725
1747
|
className: y(
|
|
1726
1748
|
"truncate text-xs leading-4",
|
|
1727
|
-
|
|
1749
|
+
nr[e]
|
|
1728
1750
|
),
|
|
1729
1751
|
children: m
|
|
1730
1752
|
}
|
|
1731
1753
|
) : null
|
|
1732
|
-
] }),
|
|
1754
|
+
] }), g = i ? /* @__PURE__ */ u(
|
|
1733
1755
|
"button",
|
|
1734
1756
|
{
|
|
1735
1757
|
type: "button",
|
|
@@ -1740,20 +1762,20 @@ const Ja = {
|
|
|
1740
1762
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
1741
1763
|
),
|
|
1742
1764
|
children: [
|
|
1743
|
-
|
|
1765
|
+
f,
|
|
1744
1766
|
h
|
|
1745
1767
|
]
|
|
1746
1768
|
}
|
|
1747
1769
|
) : /* @__PURE__ */ u(se, { children: [
|
|
1748
|
-
|
|
1770
|
+
f,
|
|
1749
1771
|
h
|
|
1750
1772
|
] });
|
|
1751
1773
|
return /* @__PURE__ */ u("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
1752
|
-
|
|
1774
|
+
g,
|
|
1753
1775
|
l ? /* @__PURE__ */ s("div", { className: "shrink-0", children: l }) : null
|
|
1754
1776
|
] });
|
|
1755
1777
|
};
|
|
1756
|
-
async function
|
|
1778
|
+
async function ws(e, t) {
|
|
1757
1779
|
const n = t ?? ie(e);
|
|
1758
1780
|
try {
|
|
1759
1781
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -1767,14 +1789,14 @@ async function xs(e, t) {
|
|
|
1767
1789
|
}
|
|
1768
1790
|
}
|
|
1769
1791
|
}
|
|
1770
|
-
const
|
|
1792
|
+
const ir = ({
|
|
1771
1793
|
src: e,
|
|
1772
1794
|
filename: t,
|
|
1773
1795
|
fileSize: n,
|
|
1774
1796
|
mimeType: a,
|
|
1775
1797
|
title: r,
|
|
1776
1798
|
items: i
|
|
1777
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [],
|
|
1799
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], lr = ({
|
|
1778
1800
|
variant: e,
|
|
1779
1801
|
item: t,
|
|
1780
1802
|
index: n,
|
|
@@ -1783,7 +1805,7 @@ const tr = ({
|
|
|
1783
1805
|
}) => {
|
|
1784
1806
|
const i = t.filename ?? ie(t.src);
|
|
1785
1807
|
return /* @__PURE__ */ s(
|
|
1786
|
-
|
|
1808
|
+
xs,
|
|
1787
1809
|
{
|
|
1788
1810
|
variant: e,
|
|
1789
1811
|
filename: i,
|
|
@@ -1795,7 +1817,7 @@ const tr = ({
|
|
|
1795
1817
|
trailingAction: r
|
|
1796
1818
|
}
|
|
1797
1819
|
);
|
|
1798
|
-
},
|
|
1820
|
+
}, vt = ({
|
|
1799
1821
|
state: e,
|
|
1800
1822
|
src: t,
|
|
1801
1823
|
filename: n,
|
|
@@ -1806,9 +1828,9 @@ const tr = ({
|
|
|
1806
1828
|
text: l,
|
|
1807
1829
|
groupPosition: d,
|
|
1808
1830
|
onClick: m,
|
|
1809
|
-
onDismiss:
|
|
1831
|
+
onDismiss: f
|
|
1810
1832
|
}) => {
|
|
1811
|
-
const h =
|
|
1833
|
+
const h = Re(e), g = e === "composer" && !!f, c = ir({
|
|
1812
1834
|
src: t,
|
|
1813
1835
|
filename: n,
|
|
1814
1836
|
fileSize: a,
|
|
@@ -1820,7 +1842,7 @@ const tr = ({
|
|
|
1820
1842
|
const p = c[x];
|
|
1821
1843
|
if (!p) return;
|
|
1822
1844
|
const _ = p.filename ?? ie(p.src);
|
|
1823
|
-
|
|
1845
|
+
ws(p.src, _);
|
|
1824
1846
|
};
|
|
1825
1847
|
if (c.length === 0)
|
|
1826
1848
|
return null;
|
|
@@ -1832,34 +1854,34 @@ const tr = ({
|
|
|
1832
1854
|
h === "dark" ? "text-white/70" : "text-black/70"
|
|
1833
1855
|
),
|
|
1834
1856
|
"aria-hidden": !0,
|
|
1835
|
-
children: /* @__PURE__ */ s(
|
|
1857
|
+
children: /* @__PURE__ */ s(Ee, { className: "size-5", weight: "bold" })
|
|
1836
1858
|
}
|
|
1837
1859
|
);
|
|
1838
1860
|
return /* @__PURE__ */ s(
|
|
1839
|
-
|
|
1861
|
+
Me,
|
|
1840
1862
|
{
|
|
1841
1863
|
variant: h,
|
|
1842
1864
|
text: l,
|
|
1843
1865
|
groupPosition: d,
|
|
1844
1866
|
"data-testid": "file-attachment",
|
|
1845
1867
|
children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((x, p) => /* @__PURE__ */ s(
|
|
1846
|
-
|
|
1868
|
+
lr,
|
|
1847
1869
|
{
|
|
1848
1870
|
variant: h,
|
|
1849
1871
|
item: x,
|
|
1850
1872
|
index: p,
|
|
1851
1873
|
onActivate: b,
|
|
1852
|
-
trailingAction:
|
|
1874
|
+
trailingAction: g && p === 0 ? /* @__PURE__ */ s(Ae, { onClick: f, variant: "inline" }) : v
|
|
1853
1875
|
},
|
|
1854
1876
|
`${x.src}-${p}`
|
|
1855
1877
|
)) })
|
|
1856
1878
|
}
|
|
1857
1879
|
);
|
|
1858
|
-
},
|
|
1859
|
-
Composer:
|
|
1860
|
-
Sent:
|
|
1861
|
-
Received:
|
|
1862
|
-
},
|
|
1880
|
+
}, or = (e) => /* @__PURE__ */ s(vt, { ...e, state: "composer" }), cr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "sent" }), dr = (e) => /* @__PURE__ */ s(vt, { ...e, state: "received" }), ur = {
|
|
1881
|
+
Composer: or,
|
|
1882
|
+
Sent: cr,
|
|
1883
|
+
Received: dr
|
|
1884
|
+
}, xt = ({
|
|
1863
1885
|
onPrev: e,
|
|
1864
1886
|
onNext: t,
|
|
1865
1887
|
prevLabel: n = "Previous",
|
|
@@ -1872,7 +1894,7 @@ const tr = ({
|
|
|
1872
1894
|
onClick: e,
|
|
1873
1895
|
"aria-label": n,
|
|
1874
1896
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
1875
|
-
children: /* @__PURE__ */ s(
|
|
1897
|
+
children: /* @__PURE__ */ s(Hn, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1876
1898
|
}
|
|
1877
1899
|
),
|
|
1878
1900
|
/* @__PURE__ */ s(
|
|
@@ -1882,10 +1904,10 @@ const tr = ({
|
|
|
1882
1904
|
onClick: t,
|
|
1883
1905
|
"aria-label": a,
|
|
1884
1906
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
1885
|
-
children: /* @__PURE__ */ s(
|
|
1907
|
+
children: /* @__PURE__ */ s(xe, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1886
1908
|
}
|
|
1887
1909
|
)
|
|
1888
|
-
] }),
|
|
1910
|
+
] }), _s = ({
|
|
1889
1911
|
url: e,
|
|
1890
1912
|
filename: t,
|
|
1891
1913
|
variant: n = "pill",
|
|
@@ -1896,13 +1918,13 @@ const tr = ({
|
|
|
1896
1918
|
}) => {
|
|
1897
1919
|
const [l, d] = U(!1), m = J(
|
|
1898
1920
|
(c) => {
|
|
1899
|
-
c.stopPropagation(), !l && (d(!0),
|
|
1921
|
+
c.stopPropagation(), !l && (d(!0), ws(e, t).catch(() => {
|
|
1900
1922
|
}).finally(() => {
|
|
1901
1923
|
d(!1), o == null || o();
|
|
1902
1924
|
}));
|
|
1903
1925
|
},
|
|
1904
1926
|
[l, e, t, o]
|
|
1905
|
-
),
|
|
1927
|
+
), f = r ?? n !== "pill", g = { className: y(
|
|
1906
1928
|
n === "pill" ? "size-4" : "size-5",
|
|
1907
1929
|
"shrink-0"
|
|
1908
1930
|
), weight: "bold" };
|
|
@@ -1921,14 +1943,14 @@ const tr = ({
|
|
|
1921
1943
|
}[i]
|
|
1922
1944
|
),
|
|
1923
1945
|
children: l ? /* @__PURE__ */ s(
|
|
1924
|
-
|
|
1946
|
+
Se,
|
|
1925
1947
|
{
|
|
1926
1948
|
className: "size-4 animate-spin",
|
|
1927
1949
|
weight: "bold",
|
|
1928
1950
|
"aria-hidden": !0
|
|
1929
1951
|
}
|
|
1930
1952
|
) : /* @__PURE__ */ s(
|
|
1931
|
-
|
|
1953
|
+
Ee,
|
|
1932
1954
|
{
|
|
1933
1955
|
className: "size-5 shrink-0",
|
|
1934
1956
|
weight: "bold",
|
|
@@ -1944,7 +1966,7 @@ const tr = ({
|
|
|
1944
1966
|
disabled: l,
|
|
1945
1967
|
"aria-label": a,
|
|
1946
1968
|
className: "mes-media-viewer__action",
|
|
1947
|
-
children: l ? /* @__PURE__ */ s(
|
|
1969
|
+
children: l ? /* @__PURE__ */ s(Se, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ s(Ee, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1948
1970
|
}
|
|
1949
1971
|
) : /* @__PURE__ */ u(
|
|
1950
1972
|
"button",
|
|
@@ -1952,34 +1974,34 @@ const tr = ({
|
|
|
1952
1974
|
type: "button",
|
|
1953
1975
|
onClick: m,
|
|
1954
1976
|
disabled: l,
|
|
1955
|
-
"aria-label":
|
|
1977
|
+
"aria-label": f ? a : void 0,
|
|
1956
1978
|
className: y(
|
|
1957
1979
|
"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",
|
|
1958
1980
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
1959
1981
|
),
|
|
1960
1982
|
children: [
|
|
1961
1983
|
l ? /* @__PURE__ */ s(
|
|
1962
|
-
|
|
1984
|
+
Se,
|
|
1963
1985
|
{
|
|
1964
1986
|
className: "size-4 animate-spin",
|
|
1965
1987
|
weight: "bold",
|
|
1966
1988
|
"aria-hidden": !0
|
|
1967
1989
|
}
|
|
1968
|
-
) : /* @__PURE__ */ s(
|
|
1969
|
-
|
|
1990
|
+
) : /* @__PURE__ */ s(Ee, { ...g, "aria-hidden": !0 }),
|
|
1991
|
+
f ? null : a
|
|
1970
1992
|
]
|
|
1971
1993
|
}
|
|
1972
1994
|
);
|
|
1973
|
-
},
|
|
1995
|
+
}, Je = (e, t, n) => Math.min(Math.max(e, t), n), wt = ({
|
|
1974
1996
|
length: e,
|
|
1975
1997
|
initialIndex: t,
|
|
1976
1998
|
open: n
|
|
1977
1999
|
}) => {
|
|
1978
|
-
const a =
|
|
2000
|
+
const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] = U(a);
|
|
1979
2001
|
K(() => {
|
|
1980
|
-
n && i(
|
|
2002
|
+
n && i(Je(t, 0, Math.max(e - 1, 0)));
|
|
1981
2003
|
}, [n, t, e]), K(() => {
|
|
1982
|
-
i((d) =>
|
|
2004
|
+
i((d) => Je(d, 0, Math.max(e - 1, 0)));
|
|
1983
2005
|
}, [e]);
|
|
1984
2006
|
const o = J(() => {
|
|
1985
2007
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
@@ -1990,12 +2012,12 @@ const tr = ({
|
|
|
1990
2012
|
if (!n || e <= 1) return;
|
|
1991
2013
|
const d = (m) => {
|
|
1992
2014
|
if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
|
|
1993
|
-
const
|
|
1994
|
-
|
|
2015
|
+
const f = document.activeElement;
|
|
2016
|
+
f && (f.tagName === "VIDEO" || f.tagName === "AUDIO") || (m.preventDefault(), m.key === "ArrowLeft" ? o() : l());
|
|
1995
2017
|
};
|
|
1996
2018
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
1997
2019
|
}, [n, e, o, l]), { index: r, prev: o, next: l };
|
|
1998
|
-
},
|
|
2020
|
+
}, _t = ({
|
|
1999
2021
|
open: e,
|
|
2000
2022
|
onClose: t,
|
|
2001
2023
|
ariaLabel: n,
|
|
@@ -2006,7 +2028,7 @@ const tr = ({
|
|
|
2006
2028
|
}) => {
|
|
2007
2029
|
const l = G(null), d = G(null);
|
|
2008
2030
|
return K(() => {
|
|
2009
|
-
var
|
|
2031
|
+
var g;
|
|
2010
2032
|
const h = l.current;
|
|
2011
2033
|
if (h) {
|
|
2012
2034
|
if (e) {
|
|
@@ -2020,7 +2042,7 @@ const tr = ({
|
|
|
2020
2042
|
else
|
|
2021
2043
|
h.setAttribute("open", "");
|
|
2022
2044
|
const c = typeof document < "u" ? document.activeElement : null;
|
|
2023
|
-
return (
|
|
2045
|
+
return (g = d.current) == null || g.focus(), () => {
|
|
2024
2046
|
if (h.open)
|
|
2025
2047
|
if (typeof h.close == "function")
|
|
2026
2048
|
try {
|
|
@@ -2076,7 +2098,7 @@ const tr = ({
|
|
|
2076
2098
|
onClick: t,
|
|
2077
2099
|
"aria-label": "Close viewer",
|
|
2078
2100
|
className: "mes-media-viewer__action",
|
|
2079
|
-
children: /* @__PURE__ */ s(
|
|
2101
|
+
children: /* @__PURE__ */ s(Ge, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
2080
2102
|
}
|
|
2081
2103
|
)
|
|
2082
2104
|
] })
|
|
@@ -2085,13 +2107,13 @@ const tr = ({
|
|
|
2085
2107
|
]
|
|
2086
2108
|
}
|
|
2087
2109
|
);
|
|
2088
|
-
},
|
|
2110
|
+
}, Ns = ({
|
|
2089
2111
|
open: e,
|
|
2090
2112
|
items: t,
|
|
2091
2113
|
initialIndex: n = 0,
|
|
2092
2114
|
onClose: a
|
|
2093
2115
|
}) => {
|
|
2094
|
-
const { index: r, prev: i, next: o } =
|
|
2116
|
+
const { index: r, prev: i, next: o } = wt({
|
|
2095
2117
|
length: t.length,
|
|
2096
2118
|
initialIndex: n,
|
|
2097
2119
|
open: e
|
|
@@ -2100,14 +2122,14 @@ const tr = ({
|
|
|
2100
2122
|
[l]
|
|
2101
2123
|
);
|
|
2102
2124
|
return l ? /* @__PURE__ */ u(
|
|
2103
|
-
|
|
2125
|
+
_t,
|
|
2104
2126
|
{
|
|
2105
2127
|
open: e,
|
|
2106
2128
|
onClose: a,
|
|
2107
2129
|
ariaLabel: d,
|
|
2108
2130
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
2109
2131
|
actions: /* @__PURE__ */ s(
|
|
2110
|
-
|
|
2132
|
+
_s,
|
|
2111
2133
|
{
|
|
2112
2134
|
url: l.src,
|
|
2113
2135
|
filename: d,
|
|
@@ -2130,7 +2152,7 @@ const tr = ({
|
|
|
2130
2152
|
`${r}:${l.src}`
|
|
2131
2153
|
),
|
|
2132
2154
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2133
|
-
|
|
2155
|
+
xt,
|
|
2134
2156
|
{
|
|
2135
2157
|
onPrev: i,
|
|
2136
2158
|
onNext: o,
|
|
@@ -2141,7 +2163,7 @@ const tr = ({
|
|
|
2141
2163
|
]
|
|
2142
2164
|
}
|
|
2143
2165
|
) : null;
|
|
2144
|
-
},
|
|
2166
|
+
}, mr = "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", ys = ({
|
|
2145
2167
|
tiles: e,
|
|
2146
2168
|
onTileActivate: t,
|
|
2147
2169
|
maxVisible: n = 4,
|
|
@@ -2149,8 +2171,8 @@ const tr = ({
|
|
|
2149
2171
|
}) => {
|
|
2150
2172
|
const r = e.length;
|
|
2151
2173
|
if (r === 0) return null;
|
|
2152
|
-
const i = e.slice(0, Math.min(r, n)), o = r - i.length, l = (d, m,
|
|
2153
|
-
const h = y(
|
|
2174
|
+
const i = e.slice(0, Math.min(r, n)), o = r - i.length, l = (d, m, f) => {
|
|
2175
|
+
const h = y(mr, "h-full w-full");
|
|
2154
2176
|
return t ? /* @__PURE__ */ u(
|
|
2155
2177
|
"button",
|
|
2156
2178
|
{
|
|
@@ -2160,13 +2182,13 @@ const tr = ({
|
|
|
2160
2182
|
className: y(h, "cursor-zoom-in"),
|
|
2161
2183
|
children: [
|
|
2162
2184
|
d.content,
|
|
2163
|
-
|
|
2185
|
+
f
|
|
2164
2186
|
]
|
|
2165
2187
|
},
|
|
2166
2188
|
m
|
|
2167
2189
|
) : /* @__PURE__ */ u("div", { className: h, children: [
|
|
2168
2190
|
d.content,
|
|
2169
|
-
|
|
2191
|
+
f
|
|
2170
2192
|
] }, m);
|
|
2171
2193
|
};
|
|
2172
2194
|
return i.length === 1 ? /* @__PURE__ */ s("div", { className: y("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ s(
|
|
@@ -2199,11 +2221,11 @@ const tr = ({
|
|
|
2199
2221
|
a
|
|
2200
2222
|
),
|
|
2201
2223
|
children: i.map((d, m) => {
|
|
2202
|
-
const
|
|
2224
|
+
const f = o > 0 && m === i.length - 1;
|
|
2203
2225
|
return l(
|
|
2204
2226
|
d,
|
|
2205
2227
|
m,
|
|
2206
|
-
|
|
2228
|
+
f ? /* @__PURE__ */ u("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
2207
2229
|
"+",
|
|
2208
2230
|
o
|
|
2209
2231
|
] }) : null
|
|
@@ -2211,7 +2233,7 @@ const tr = ({
|
|
|
2211
2233
|
})
|
|
2212
2234
|
}
|
|
2213
2235
|
);
|
|
2214
|
-
},
|
|
2236
|
+
}, Le = (e) => {
|
|
2215
2237
|
const [t, n] = U(!1), [a, r] = U(0), i = J(
|
|
2216
2238
|
(l) => {
|
|
2217
2239
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), n(!0));
|
|
@@ -2219,12 +2241,12 @@ const tr = ({
|
|
|
2219
2241
|
[e]
|
|
2220
2242
|
), o = J(() => n(!1), []);
|
|
2221
2243
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
2222
|
-
},
|
|
2244
|
+
}, hr = (e, t, n, a) => ({
|
|
2223
2245
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
2224
2246
|
content: /* @__PURE__ */ s(
|
|
2225
2247
|
"img",
|
|
2226
2248
|
{
|
|
2227
|
-
src: e.src,
|
|
2249
|
+
src: he(e.src) ?? e.src,
|
|
2228
2250
|
alt: e.alt ?? "",
|
|
2229
2251
|
width: e.width,
|
|
2230
2252
|
height: e.height,
|
|
@@ -2234,16 +2256,16 @@ const tr = ({
|
|
|
2234
2256
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2235
2257
|
}
|
|
2236
2258
|
)
|
|
2237
|
-
}),
|
|
2259
|
+
}), fr = ({
|
|
2238
2260
|
src: e,
|
|
2239
2261
|
alt: t,
|
|
2240
2262
|
items: n
|
|
2241
|
-
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [],
|
|
2263
|
+
}) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], ks = (e, t) => e.map((n, a) => ({
|
|
2242
2264
|
src: n.src,
|
|
2243
2265
|
alt: n.alt,
|
|
2244
2266
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2245
|
-
})),
|
|
2246
|
-
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } =
|
|
2267
|
+
})), gr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2268
|
+
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Le(
|
|
2247
2269
|
r
|
|
2248
2270
|
);
|
|
2249
2271
|
return /* @__PURE__ */ u("div", { className: "relative w-fit", children: [
|
|
@@ -2257,7 +2279,7 @@ const tr = ({
|
|
|
2257
2279
|
children: /* @__PURE__ */ s(
|
|
2258
2280
|
"img",
|
|
2259
2281
|
{
|
|
2260
|
-
src: e,
|
|
2282
|
+
src: he(e) ?? e,
|
|
2261
2283
|
alt: t ?? "",
|
|
2262
2284
|
draggable: !1,
|
|
2263
2285
|
loading: a,
|
|
@@ -2267,18 +2289,18 @@ const tr = ({
|
|
|
2267
2289
|
)
|
|
2268
2290
|
}
|
|
2269
2291
|
),
|
|
2270
|
-
i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(
|
|
2292
|
+
i ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: i }) }) : null,
|
|
2271
2293
|
/* @__PURE__ */ s(
|
|
2272
|
-
|
|
2294
|
+
Ns,
|
|
2273
2295
|
{
|
|
2274
2296
|
open: o,
|
|
2275
|
-
items:
|
|
2297
|
+
items: ks([{ src: e, alt: t }], n),
|
|
2276
2298
|
initialIndex: l,
|
|
2277
2299
|
onClose: m
|
|
2278
2300
|
}
|
|
2279
2301
|
)
|
|
2280
2302
|
] });
|
|
2281
|
-
},
|
|
2303
|
+
}, Cs = ({
|
|
2282
2304
|
state: e,
|
|
2283
2305
|
src: t,
|
|
2284
2306
|
alt: n,
|
|
@@ -2289,46 +2311,46 @@ const tr = ({
|
|
|
2289
2311
|
loading: l = "lazy",
|
|
2290
2312
|
onClick: d
|
|
2291
2313
|
}) => {
|
|
2292
|
-
const m =
|
|
2314
|
+
const m = fr({ src: t, alt: n, items: r }), f = Re(e), { viewerOpen: h, viewerIndex: g, handleActivate: c, closeViewer: b } = Le(
|
|
2293
2315
|
d
|
|
2294
2316
|
);
|
|
2295
2317
|
if (m.length === 0)
|
|
2296
2318
|
return null;
|
|
2297
2319
|
const v = m.map(
|
|
2298
|
-
(x, p) =>
|
|
2320
|
+
(x, p) => hr(x, p, m.length, l)
|
|
2299
2321
|
);
|
|
2300
2322
|
return /* @__PURE__ */ u(
|
|
2301
|
-
|
|
2323
|
+
Me,
|
|
2302
2324
|
{
|
|
2303
|
-
variant:
|
|
2325
|
+
variant: f,
|
|
2304
2326
|
text: i,
|
|
2305
2327
|
groupPosition: o,
|
|
2306
2328
|
"data-testid": "image-attachment",
|
|
2307
2329
|
children: [
|
|
2308
|
-
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
|
|
2330
|
+
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(ys, { tiles: v, onTileActivate: c }) }),
|
|
2309
2331
|
/* @__PURE__ */ s(
|
|
2310
|
-
|
|
2332
|
+
Ns,
|
|
2311
2333
|
{
|
|
2312
2334
|
open: h,
|
|
2313
|
-
items:
|
|
2314
|
-
initialIndex:
|
|
2335
|
+
items: ks(m, a),
|
|
2336
|
+
initialIndex: g,
|
|
2315
2337
|
onClose: b
|
|
2316
2338
|
}
|
|
2317
2339
|
)
|
|
2318
2340
|
]
|
|
2319
2341
|
}
|
|
2320
2342
|
);
|
|
2321
|
-
},
|
|
2322
|
-
Composer:
|
|
2323
|
-
Sent:
|
|
2324
|
-
Received:
|
|
2325
|
-
},
|
|
2343
|
+
}, pr = (e) => /* @__PURE__ */ s(gr, { ...e }), br = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "sent" }), vr = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "received" }), xr = {
|
|
2344
|
+
Composer: pr,
|
|
2345
|
+
Sent: br,
|
|
2346
|
+
Received: vr
|
|
2347
|
+
}, wr = ({
|
|
2326
2348
|
open: e,
|
|
2327
2349
|
items: t,
|
|
2328
2350
|
initialIndex: n = 0,
|
|
2329
2351
|
onClose: a
|
|
2330
2352
|
}) => {
|
|
2331
|
-
const { index: r, prev: i, next: o } =
|
|
2353
|
+
const { index: r, prev: i, next: o } = wt({
|
|
2332
2354
|
length: t.length,
|
|
2333
2355
|
initialIndex: n,
|
|
2334
2356
|
open: e
|
|
@@ -2336,11 +2358,11 @@ const tr = ({
|
|
|
2336
2358
|
() => (l == null ? void 0 : l.filename) ?? (l ? ie(l.src) : "document"),
|
|
2337
2359
|
[l]
|
|
2338
2360
|
), m = re(
|
|
2339
|
-
() => l ?
|
|
2361
|
+
() => l ? _r(l.src) : void 0,
|
|
2340
2362
|
[l]
|
|
2341
2363
|
);
|
|
2342
2364
|
return !l || !m ? null : /* @__PURE__ */ u(
|
|
2343
|
-
|
|
2365
|
+
_t,
|
|
2344
2366
|
{
|
|
2345
2367
|
open: e,
|
|
2346
2368
|
onClose: a,
|
|
@@ -2359,7 +2381,7 @@ const tr = ({
|
|
|
2359
2381
|
`${r}:${l.src}`
|
|
2360
2382
|
),
|
|
2361
2383
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2362
|
-
|
|
2384
|
+
xt,
|
|
2363
2385
|
{
|
|
2364
2386
|
onPrev: i,
|
|
2365
2387
|
onNext: o,
|
|
@@ -2370,16 +2392,16 @@ const tr = ({
|
|
|
2370
2392
|
]
|
|
2371
2393
|
}
|
|
2372
2394
|
);
|
|
2373
|
-
},
|
|
2395
|
+
}, _r = (e) => {
|
|
2374
2396
|
const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
2375
2397
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
|
|
2376
|
-
},
|
|
2398
|
+
}, Nr = ({
|
|
2377
2399
|
src: e,
|
|
2378
2400
|
filename: t,
|
|
2379
2401
|
fileSize: n,
|
|
2380
2402
|
title: a,
|
|
2381
2403
|
items: r
|
|
2382
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [],
|
|
2404
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], yr = ({
|
|
2383
2405
|
variant: e,
|
|
2384
2406
|
item: t,
|
|
2385
2407
|
index: n,
|
|
@@ -2388,7 +2410,7 @@ const tr = ({
|
|
|
2388
2410
|
}) => {
|
|
2389
2411
|
const i = t.filename ?? ie(t.src);
|
|
2390
2412
|
return /* @__PURE__ */ s(
|
|
2391
|
-
|
|
2413
|
+
xs,
|
|
2392
2414
|
{
|
|
2393
2415
|
variant: e,
|
|
2394
2416
|
filename: i,
|
|
@@ -2400,7 +2422,7 @@ const tr = ({
|
|
|
2400
2422
|
trailingAction: r
|
|
2401
2423
|
}
|
|
2402
2424
|
);
|
|
2403
|
-
},
|
|
2425
|
+
}, Nt = ({
|
|
2404
2426
|
state: e,
|
|
2405
2427
|
src: t,
|
|
2406
2428
|
filename: n,
|
|
@@ -2412,7 +2434,7 @@ const tr = ({
|
|
|
2412
2434
|
onClick: d,
|
|
2413
2435
|
onDismiss: m
|
|
2414
2436
|
}) => {
|
|
2415
|
-
const
|
|
2437
|
+
const f = Re(e), h = Nr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
|
|
2416
2438
|
d
|
|
2417
2439
|
), x = e === "composer" && !!m;
|
|
2418
2440
|
if (h.length === 0)
|
|
@@ -2422,40 +2444,40 @@ const tr = ({
|
|
|
2422
2444
|
filename: _.filename ?? ie(_.src)
|
|
2423
2445
|
}));
|
|
2424
2446
|
return /* @__PURE__ */ u(
|
|
2425
|
-
|
|
2447
|
+
Me,
|
|
2426
2448
|
{
|
|
2427
|
-
variant:
|
|
2449
|
+
variant: f,
|
|
2428
2450
|
text: o,
|
|
2429
2451
|
groupPosition: l,
|
|
2430
2452
|
"data-testid": "pdf-attachment",
|
|
2431
2453
|
children: [
|
|
2432
2454
|
/* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((_, w) => {
|
|
2433
|
-
const k = _.filename ?? ie(_.src),
|
|
2434
|
-
|
|
2455
|
+
const k = _.filename ?? ie(_.src), D = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
|
|
2456
|
+
_s,
|
|
2435
2457
|
{
|
|
2436
2458
|
url: _.src,
|
|
2437
2459
|
filename: k,
|
|
2438
2460
|
variant: "inline",
|
|
2439
2461
|
label: `Download ${k}`,
|
|
2440
|
-
tone:
|
|
2462
|
+
tone: f
|
|
2441
2463
|
}
|
|
2442
2464
|
);
|
|
2443
2465
|
return /* @__PURE__ */ s(
|
|
2444
|
-
|
|
2466
|
+
yr,
|
|
2445
2467
|
{
|
|
2446
|
-
variant:
|
|
2468
|
+
variant: f,
|
|
2447
2469
|
item: _,
|
|
2448
2470
|
index: w,
|
|
2449
2471
|
onActivate: b,
|
|
2450
|
-
trailingAction:
|
|
2472
|
+
trailingAction: D
|
|
2451
2473
|
},
|
|
2452
2474
|
`${_.src}-${w}`
|
|
2453
2475
|
);
|
|
2454
2476
|
}) }),
|
|
2455
2477
|
/* @__PURE__ */ s(
|
|
2456
|
-
|
|
2478
|
+
wr,
|
|
2457
2479
|
{
|
|
2458
|
-
open:
|
|
2480
|
+
open: g,
|
|
2459
2481
|
items: p,
|
|
2460
2482
|
initialIndex: c,
|
|
2461
2483
|
onClose: v
|
|
@@ -2464,17 +2486,17 @@ const tr = ({
|
|
|
2464
2486
|
]
|
|
2465
2487
|
}
|
|
2466
2488
|
);
|
|
2467
|
-
},
|
|
2468
|
-
Composer:
|
|
2469
|
-
Sent:
|
|
2470
|
-
Received:
|
|
2471
|
-
},
|
|
2489
|
+
}, kr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "composer" }), Cr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ s(Nt, { ...e, state: "received" }), Er = {
|
|
2490
|
+
Composer: kr,
|
|
2491
|
+
Sent: Cr,
|
|
2492
|
+
Received: Sr
|
|
2493
|
+
}, Ss = ({
|
|
2472
2494
|
open: e,
|
|
2473
2495
|
items: t,
|
|
2474
2496
|
initialIndex: n = 0,
|
|
2475
2497
|
onClose: a
|
|
2476
2498
|
}) => {
|
|
2477
|
-
const { index: r, prev: i, next: o } =
|
|
2499
|
+
const { index: r, prev: i, next: o } = wt({
|
|
2478
2500
|
length: t.length,
|
|
2479
2501
|
initialIndex: n,
|
|
2480
2502
|
open: e
|
|
@@ -2483,7 +2505,7 @@ const tr = ({
|
|
|
2483
2505
|
[l]
|
|
2484
2506
|
);
|
|
2485
2507
|
return l ? /* @__PURE__ */ u(
|
|
2486
|
-
|
|
2508
|
+
_t,
|
|
2487
2509
|
{
|
|
2488
2510
|
open: e,
|
|
2489
2511
|
onClose: a,
|
|
@@ -2507,7 +2529,7 @@ const tr = ({
|
|
|
2507
2529
|
`${r}:${l.src}`
|
|
2508
2530
|
),
|
|
2509
2531
|
t.length > 1 ? /* @__PURE__ */ s(
|
|
2510
|
-
|
|
2532
|
+
xt,
|
|
2511
2533
|
{
|
|
2512
2534
|
onPrev: i,
|
|
2513
2535
|
onNext: o,
|
|
@@ -2518,7 +2540,7 @@ const tr = ({
|
|
|
2518
2540
|
]
|
|
2519
2541
|
}
|
|
2520
2542
|
) : null;
|
|
2521
|
-
},
|
|
2543
|
+
}, Ir = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(rt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Es = ({
|
|
2522
2544
|
item: e,
|
|
2523
2545
|
index: t
|
|
2524
2546
|
}) => /* @__PURE__ */ u("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -2533,31 +2555,31 @@ const tr = ({
|
|
|
2533
2555
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
2534
2556
|
}
|
|
2535
2557
|
) : /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
2536
|
-
|
|
2558
|
+
ls,
|
|
2537
2559
|
{
|
|
2538
2560
|
className: "size-16 rounded-md text-white/30",
|
|
2539
2561
|
weight: "regular",
|
|
2540
2562
|
"aria-hidden": !0
|
|
2541
2563
|
}
|
|
2542
2564
|
) }),
|
|
2543
|
-
/* @__PURE__ */ s(
|
|
2544
|
-
] }),
|
|
2565
|
+
/* @__PURE__ */ s(Ir, {})
|
|
2566
|
+
] }), Tr = (e, t, n) => ({
|
|
2545
2567
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2546
|
-
content: /* @__PURE__ */ s(
|
|
2547
|
-
}),
|
|
2568
|
+
content: /* @__PURE__ */ s(Es, { item: e, index: t })
|
|
2569
|
+
}), Mr = ({
|
|
2548
2570
|
src: e,
|
|
2549
2571
|
poster: t,
|
|
2550
2572
|
mimeType: n,
|
|
2551
2573
|
preload: a,
|
|
2552
2574
|
items: r
|
|
2553
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [],
|
|
2575
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: n, preload: a }] : [], Is = (e, t) => e.map((n, a) => ({
|
|
2554
2576
|
src: n.src,
|
|
2555
2577
|
poster: n.poster,
|
|
2556
2578
|
mimeType: n.mimeType,
|
|
2557
2579
|
preload: n.preload,
|
|
2558
2580
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2559
|
-
})),
|
|
2560
|
-
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer:
|
|
2581
|
+
})), Ar = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
2582
|
+
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: f } = Le(
|
|
2561
2583
|
i
|
|
2562
2584
|
);
|
|
2563
2585
|
return /* @__PURE__ */ u("div", { className: "relative w-fit", children: [
|
|
@@ -2568,24 +2590,24 @@ const tr = ({
|
|
|
2568
2590
|
onClick: () => m(0),
|
|
2569
2591
|
"aria-label": "Play video",
|
|
2570
2592
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2571
|
-
children: /* @__PURE__ */ s(
|
|
2593
|
+
children: /* @__PURE__ */ s(Es, { item: { src: e, poster: t, mimeType: n }, index: 0 })
|
|
2572
2594
|
}
|
|
2573
2595
|
),
|
|
2574
|
-
o ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(
|
|
2596
|
+
o ? /* @__PURE__ */ s("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ s(Ae, { onClick: o }) }) : null,
|
|
2575
2597
|
/* @__PURE__ */ s(
|
|
2576
|
-
|
|
2598
|
+
Ss,
|
|
2577
2599
|
{
|
|
2578
2600
|
open: l,
|
|
2579
|
-
items:
|
|
2601
|
+
items: Is(
|
|
2580
2602
|
[{ src: e, poster: t, mimeType: n, preload: r }],
|
|
2581
2603
|
a
|
|
2582
2604
|
),
|
|
2583
2605
|
initialIndex: d,
|
|
2584
|
-
onClose:
|
|
2606
|
+
onClose: f
|
|
2585
2607
|
}
|
|
2586
2608
|
)
|
|
2587
2609
|
] });
|
|
2588
|
-
},
|
|
2610
|
+
}, Ts = ({
|
|
2589
2611
|
state: e,
|
|
2590
2612
|
src: t,
|
|
2591
2613
|
poster: n,
|
|
@@ -2597,16 +2619,16 @@ const tr = ({
|
|
|
2597
2619
|
preload: d,
|
|
2598
2620
|
onClick: m
|
|
2599
2621
|
}) => {
|
|
2600
|
-
const
|
|
2622
|
+
const f = Mr({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Re(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
|
|
2601
2623
|
m
|
|
2602
2624
|
);
|
|
2603
|
-
if (
|
|
2625
|
+
if (f.length === 0)
|
|
2604
2626
|
return null;
|
|
2605
|
-
const x =
|
|
2606
|
-
(p, _) =>
|
|
2627
|
+
const x = f.map(
|
|
2628
|
+
(p, _) => Tr(p, _, f.length)
|
|
2607
2629
|
);
|
|
2608
2630
|
return /* @__PURE__ */ u(
|
|
2609
|
-
|
|
2631
|
+
Me,
|
|
2610
2632
|
{
|
|
2611
2633
|
variant: h,
|
|
2612
2634
|
text: o,
|
|
@@ -2614,7 +2636,7 @@ const tr = ({
|
|
|
2614
2636
|
"data-testid": "video-attachment",
|
|
2615
2637
|
children: [
|
|
2616
2638
|
/* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
|
|
2617
|
-
|
|
2639
|
+
ys,
|
|
2618
2640
|
{
|
|
2619
2641
|
tiles: x,
|
|
2620
2642
|
onTileActivate: b,
|
|
@@ -2622,10 +2644,10 @@ const tr = ({
|
|
|
2622
2644
|
}
|
|
2623
2645
|
) }),
|
|
2624
2646
|
/* @__PURE__ */ s(
|
|
2625
|
-
|
|
2647
|
+
Ss,
|
|
2626
2648
|
{
|
|
2627
|
-
open:
|
|
2628
|
-
items:
|
|
2649
|
+
open: g,
|
|
2650
|
+
items: Is(f, r),
|
|
2629
2651
|
initialIndex: c,
|
|
2630
2652
|
onClose: v
|
|
2631
2653
|
}
|
|
@@ -2633,31 +2655,31 @@ const tr = ({
|
|
|
2633
2655
|
]
|
|
2634
2656
|
}
|
|
2635
2657
|
);
|
|
2636
|
-
},
|
|
2637
|
-
Composer:
|
|
2638
|
-
Sent:
|
|
2639
|
-
Received:
|
|
2640
|
-
},
|
|
2641
|
-
Image:
|
|
2642
|
-
Video:
|
|
2643
|
-
Audio:
|
|
2644
|
-
Pdf:
|
|
2645
|
-
File:
|
|
2646
|
-
},
|
|
2658
|
+
}, Rr = (e) => /* @__PURE__ */ s(Ar, { ...e }), Lr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "sent" }), Dr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "received" }), zr = {
|
|
2659
|
+
Composer: Rr,
|
|
2660
|
+
Sent: Lr,
|
|
2661
|
+
Received: Dr
|
|
2662
|
+
}, ke = {
|
|
2663
|
+
Image: xr,
|
|
2664
|
+
Video: zr,
|
|
2665
|
+
Audio: Ja,
|
|
2666
|
+
Pdf: Er,
|
|
2667
|
+
File: ur
|
|
2668
|
+
}, Fr = {
|
|
2647
2669
|
isUnlocking: () => !1
|
|
2648
|
-
},
|
|
2649
|
-
LockedAttachment:
|
|
2650
|
-
},
|
|
2651
|
-
function
|
|
2652
|
-
return
|
|
2670
|
+
}, Pr = {
|
|
2671
|
+
LockedAttachment: Fr
|
|
2672
|
+
}, Ms = ct({}), gl = Ms.Provider;
|
|
2673
|
+
function Or(e) {
|
|
2674
|
+
return Te(Ms)[e] ?? Pr[e];
|
|
2653
2675
|
}
|
|
2654
|
-
const
|
|
2676
|
+
const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import("./Card-dFpcKsyN.js")), Ur = () => /* @__PURE__ */ s(
|
|
2655
2677
|
"div",
|
|
2656
2678
|
{
|
|
2657
2679
|
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)]",
|
|
2658
2680
|
"aria-hidden": !0
|
|
2659
2681
|
}
|
|
2660
|
-
),
|
|
2682
|
+
), Pe = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Ur, {}), children: e.contentType === "text" ? /* @__PURE__ */ s($r, { ...e }) : /* @__PURE__ */ s(Br, { ...e }) }), jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
|
|
2661
2683
|
"svg",
|
|
2662
2684
|
{
|
|
2663
2685
|
width: e,
|
|
@@ -2674,43 +2696,43 @@ const Lr = V.lazy(() => import("./Card-qS17qnN0.js")), zr = V.lazy(() => import(
|
|
|
2674
2696
|
}
|
|
2675
2697
|
)
|
|
2676
2698
|
}
|
|
2677
|
-
),
|
|
2699
|
+
), Vr = (e) => {
|
|
2678
2700
|
var t;
|
|
2679
2701
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
2680
|
-
},
|
|
2702
|
+
}, Gr = (e) => {
|
|
2681
2703
|
var t;
|
|
2682
2704
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
2683
|
-
},
|
|
2705
|
+
}, Be = (e) => {
|
|
2684
2706
|
var t;
|
|
2685
2707
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
2686
|
-
},
|
|
2708
|
+
}, yt = (e) => {
|
|
2687
2709
|
var t;
|
|
2688
2710
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
2689
|
-
},
|
|
2711
|
+
}, Hr = (e) => {
|
|
2690
2712
|
var t;
|
|
2691
|
-
return
|
|
2692
|
-
},
|
|
2713
|
+
return yt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
|
|
2714
|
+
}, Yr = (e) => {
|
|
2693
2715
|
var t;
|
|
2694
|
-
return
|
|
2695
|
-
},
|
|
2716
|
+
return yt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
|
|
2717
|
+
}, As = (e) => Vr(e) || Gr(e), qr = (e) => {
|
|
2696
2718
|
var t;
|
|
2697
|
-
return
|
|
2698
|
-
},
|
|
2719
|
+
return As(e) && !((t = e.text) != null && t.trim());
|
|
2720
|
+
}, Qe = ({
|
|
2699
2721
|
message: e,
|
|
2700
2722
|
standalone: t = !1,
|
|
2701
2723
|
isMyMessage: n = !1,
|
|
2702
2724
|
hasAttachment: a = !1
|
|
2703
2725
|
}) => {
|
|
2704
2726
|
var h;
|
|
2705
|
-
const r =
|
|
2727
|
+
const r = As(e), i = Be(e);
|
|
2706
2728
|
if (!r && !i)
|
|
2707
2729
|
return null;
|
|
2708
2730
|
if (r) {
|
|
2709
|
-
const
|
|
2710
|
-
if (!
|
|
2711
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${
|
|
2731
|
+
const g = (h = e.metadata) == null ? void 0 : h.amount_text;
|
|
2732
|
+
if (!g) return null;
|
|
2733
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${g} tip` : `Delivered with ${g} tip`;
|
|
2712
2734
|
return /* @__PURE__ */ u("div", { className: c, children: [
|
|
2713
|
-
/* @__PURE__ */ s(
|
|
2735
|
+
/* @__PURE__ */ s(Yn, { size: t ? 14 : 12 }),
|
|
2714
2736
|
/* @__PURE__ */ s("span", { children: b })
|
|
2715
2737
|
] });
|
|
2716
2738
|
}
|
|
@@ -2718,15 +2740,15 @@ const Lr = V.lazy(() => import("./Card-qS17qnN0.js")), zr = V.lazy(() => import(
|
|
|
2718
2740
|
"message-chatbot-indicator",
|
|
2719
2741
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2720
2742
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2721
|
-
].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }),
|
|
2743
|
+
].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: l }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(jr, { size: o ? 12 : 15 }) });
|
|
2722
2744
|
return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ u(se, { children: [
|
|
2723
2745
|
m,
|
|
2724
|
-
|
|
2746
|
+
f
|
|
2725
2747
|
] }) : /* @__PURE__ */ u(se, { children: [
|
|
2726
|
-
|
|
2748
|
+
f,
|
|
2727
2749
|
m
|
|
2728
2750
|
] }) });
|
|
2729
|
-
},
|
|
2751
|
+
}, Wr = ({
|
|
2730
2752
|
selected: e,
|
|
2731
2753
|
onVoteUp: t,
|
|
2732
2754
|
onVoteDown: n
|
|
@@ -2742,7 +2764,7 @@ const Lr = V.lazy(() => import("./Card-qS17qnN0.js")), zr = V.lazy(() => import(
|
|
|
2742
2764
|
"aria-label": "Good response",
|
|
2743
2765
|
"aria-pressed": e === "up",
|
|
2744
2766
|
"data-tooltip": "Good response",
|
|
2745
|
-
children: /* @__PURE__ */ s(
|
|
2767
|
+
children: /* @__PURE__ */ s(qn, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
2746
2768
|
}
|
|
2747
2769
|
),
|
|
2748
2770
|
/* @__PURE__ */ s(
|
|
@@ -2756,11 +2778,11 @@ const Lr = V.lazy(() => import("./Card-qS17qnN0.js")), zr = V.lazy(() => import(
|
|
|
2756
2778
|
"aria-label": "Bad response",
|
|
2757
2779
|
"aria-pressed": e === "down",
|
|
2758
2780
|
"data-tooltip": "Bad response",
|
|
2759
|
-
children: /* @__PURE__ */ s(
|
|
2781
|
+
children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
2760
2782
|
}
|
|
2761
2783
|
)
|
|
2762
|
-
] }),
|
|
2763
|
-
const { message: e } =
|
|
2784
|
+
] }), et = () => {
|
|
2785
|
+
const { message: e } = Ne("SentMessageDeliveryStatus"), { messages: t } = oe("SentMessageDeliveryStatus"), n = (() => {
|
|
2764
2786
|
if (t)
|
|
2765
2787
|
for (let a = t.length - 1; a >= 0; a -= 1) {
|
|
2766
2788
|
const r = t[a];
|
|
@@ -2769,37 +2791,37 @@ const Lr = V.lazy(() => import("./Card-qS17qnN0.js")), zr = V.lazy(() => import(
|
|
|
2769
2791
|
}
|
|
2770
2792
|
})();
|
|
2771
2793
|
return e.id !== n ? null : /* @__PURE__ */ u(se, { children: [
|
|
2772
|
-
/* @__PURE__ */ s(
|
|
2794
|
+
/* @__PURE__ */ s(Xn, { weight: "bold", "aria-hidden": "true" }),
|
|
2773
2795
|
/* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
|
|
2774
2796
|
] });
|
|
2775
|
-
},
|
|
2776
|
-
|
|
2797
|
+
}, Xr = () => null, Kr = () => /* @__PURE__ */ s(
|
|
2798
|
+
Ws,
|
|
2777
2799
|
{
|
|
2778
|
-
MessageSentStatus:
|
|
2779
|
-
MessageDeliveredStatus:
|
|
2780
|
-
MessageReadStatus:
|
|
2781
|
-
MessageSendingStatus:
|
|
2800
|
+
MessageSentStatus: et,
|
|
2801
|
+
MessageDeliveredStatus: et,
|
|
2802
|
+
MessageReadStatus: et,
|
|
2803
|
+
MessageSendingStatus: Xr
|
|
2782
2804
|
}
|
|
2783
|
-
),
|
|
2784
|
-
function
|
|
2805
|
+
), Zr = /^([a-z][a-z0-9+.-]*):/i, Jr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2806
|
+
function kt(e) {
|
|
2785
2807
|
if (typeof e != "string") return;
|
|
2786
2808
|
const t = e.trim();
|
|
2787
2809
|
if (t === "") return;
|
|
2788
|
-
const n =
|
|
2810
|
+
const n = Zr.exec(t);
|
|
2789
2811
|
if (n) {
|
|
2790
2812
|
const a = n[1].toLowerCase();
|
|
2791
|
-
return
|
|
2813
|
+
return Jr.has(a) ? t : void 0;
|
|
2792
2814
|
}
|
|
2793
2815
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2794
2816
|
}
|
|
2795
|
-
const
|
|
2817
|
+
const Qr = {
|
|
2796
2818
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2797
2819
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2798
|
-
},
|
|
2820
|
+
}, ei = ({ variant: e, cta: t }) => {
|
|
2799
2821
|
const n = y(
|
|
2800
2822
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2801
|
-
|
|
2802
|
-
), a =
|
|
2823
|
+
Qr[e]
|
|
2824
|
+
), a = kt(t.href);
|
|
2803
2825
|
return a ? /* @__PURE__ */ s(
|
|
2804
2826
|
"a",
|
|
2805
2827
|
{
|
|
@@ -2825,13 +2847,13 @@ const Wr = {
|
|
|
2825
2847
|
children: t.label
|
|
2826
2848
|
}
|
|
2827
2849
|
);
|
|
2828
|
-
},
|
|
2850
|
+
}, ti = {
|
|
2829
2851
|
dark: "text-white",
|
|
2830
2852
|
light: "text-black/90"
|
|
2831
|
-
},
|
|
2853
|
+
}, si = "text-white/30", ni = {
|
|
2832
2854
|
dark: "text-white/55",
|
|
2833
2855
|
light: "text-black/55"
|
|
2834
|
-
},
|
|
2856
|
+
}, Ct = ({
|
|
2835
2857
|
variant: e,
|
|
2836
2858
|
title: t,
|
|
2837
2859
|
placeholderTitle: n,
|
|
@@ -2841,39 +2863,39 @@ const Wr = {
|
|
|
2841
2863
|
cta: o,
|
|
2842
2864
|
trailingAction: l
|
|
2843
2865
|
}) => {
|
|
2844
|
-
const d = e === "dark", m = t ?? (d ? n : void 0) ?? "",
|
|
2845
|
-
if (!
|
|
2866
|
+
const d = e === "dark", m = t ?? (d ? n : void 0) ?? "", f = m.trim() !== "", h = a != null && a.trim() !== "", g = typeof r == "string" ? r.trim() : "", c = g !== "", b = o != null;
|
|
2867
|
+
if (!f && !h && !c && !b) return null;
|
|
2846
2868
|
const x = y(
|
|
2847
2869
|
"truncate text-base font-medium leading-6",
|
|
2848
|
-
d && !t ?
|
|
2870
|
+
d && !t ? si : ti[e]
|
|
2849
2871
|
), p = y(
|
|
2850
2872
|
"truncate text-xs leading-4",
|
|
2851
|
-
|
|
2873
|
+
ni[e]
|
|
2852
2874
|
);
|
|
2853
2875
|
return /* @__PURE__ */ u("div", { className: "px-4 py-3", children: [
|
|
2854
2876
|
/* @__PURE__ */ u("div", { className: "flex items-end gap-3", children: [
|
|
2855
2877
|
/* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2856
2878
|
/* @__PURE__ */ u("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2857
|
-
|
|
2879
|
+
f && /* @__PURE__ */ u("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2858
2880
|
i ? /* @__PURE__ */ s("span", { className: "shrink-0", children: i }) : null,
|
|
2859
2881
|
/* @__PURE__ */ s("p", { className: y("min-w-0", x), children: m })
|
|
2860
2882
|
] }),
|
|
2861
2883
|
h && /* @__PURE__ */ s("p", { className: p, children: a })
|
|
2862
2884
|
] }),
|
|
2863
|
-
!b && c && /* @__PURE__ */ s("p", { className: p, children:
|
|
2885
|
+
!b && c && /* @__PURE__ */ s("p", { className: p, children: g })
|
|
2864
2886
|
] }),
|
|
2865
2887
|
l && /* @__PURE__ */ s("div", { className: "shrink-0", children: l })
|
|
2866
2888
|
] }),
|
|
2867
|
-
o && /* @__PURE__ */ s(
|
|
2889
|
+
o && /* @__PURE__ */ s(ei, { variant: e, cta: o })
|
|
2868
2890
|
] });
|
|
2869
|
-
},
|
|
2891
|
+
}, ai = y(
|
|
2870
2892
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2871
2893
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2872
2894
|
// the messaging design system's "small border around link attachments"
|
|
2873
2895
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2874
2896
|
"border border-black/[0.08]",
|
|
2875
2897
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2876
|
-
),
|
|
2898
|
+
), Ue = ({
|
|
2877
2899
|
variant: e,
|
|
2878
2900
|
children: t,
|
|
2879
2901
|
href: n,
|
|
@@ -2884,8 +2906,8 @@ const Wr = {
|
|
|
2884
2906
|
bgClassName: l,
|
|
2885
2907
|
"data-testid": d
|
|
2886
2908
|
}) => {
|
|
2887
|
-
const m = n != null || a != null,
|
|
2888
|
-
|
|
2909
|
+
const m = n != null || a != null, f = y(
|
|
2910
|
+
ai,
|
|
2889
2911
|
l ?? (e === "dark" ? "bg-[#1e2330]" : "bg-white"),
|
|
2890
2912
|
// `focus-ring` is a design-system utility from the component-library
|
|
2891
2913
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2901,7 +2923,7 @@ const Wr = {
|
|
|
2901
2923
|
rel: "noopener noreferrer",
|
|
2902
2924
|
onClick: a,
|
|
2903
2925
|
"data-testid": d,
|
|
2904
|
-
className:
|
|
2926
|
+
className: f,
|
|
2905
2927
|
children: [
|
|
2906
2928
|
t,
|
|
2907
2929
|
h
|
|
@@ -2915,7 +2937,7 @@ const Wr = {
|
|
|
2915
2937
|
onClick: a,
|
|
2916
2938
|
"aria-label": r,
|
|
2917
2939
|
"data-testid": d,
|
|
2918
|
-
className: y(
|
|
2940
|
+
className: y(f, "text-left"),
|
|
2919
2941
|
children: [
|
|
2920
2942
|
t,
|
|
2921
2943
|
h
|
|
@@ -2926,24 +2948,24 @@ const Wr = {
|
|
|
2926
2948
|
{
|
|
2927
2949
|
ref: i,
|
|
2928
2950
|
"data-testid": d,
|
|
2929
|
-
className:
|
|
2951
|
+
className: f,
|
|
2930
2952
|
children: [
|
|
2931
2953
|
t,
|
|
2932
2954
|
h
|
|
2933
2955
|
]
|
|
2934
2956
|
}
|
|
2935
2957
|
);
|
|
2936
|
-
},
|
|
2958
|
+
}, ri = {
|
|
2937
2959
|
dark: "bg-white/10",
|
|
2938
2960
|
light: "bg-black/5"
|
|
2939
|
-
},
|
|
2961
|
+
}, ii = {
|
|
2940
2962
|
dark: "size-16 text-white/25",
|
|
2941
2963
|
light: "size-16 text-black/25"
|
|
2942
|
-
},
|
|
2964
|
+
}, Ye = (e, t) => !!t && !!e && ce(e) === "audio", St = (e, t) => {
|
|
2943
2965
|
if (!t || !e) return !1;
|
|
2944
2966
|
const n = ce(e);
|
|
2945
2967
|
return n === "video" || n === "audio";
|
|
2946
|
-
},
|
|
2968
|
+
}, Et = "bg-[#F2F3F4]", je = ({
|
|
2947
2969
|
variant: e,
|
|
2948
2970
|
thumbnailUrl: t,
|
|
2949
2971
|
sourceUrl: n,
|
|
@@ -2952,8 +2974,8 @@ const Wr = {
|
|
|
2952
2974
|
topLeft: i,
|
|
2953
2975
|
topRight: o
|
|
2954
2976
|
}) => {
|
|
2955
|
-
const l = ce(r), d = !!n && l === "video";
|
|
2956
|
-
return
|
|
2977
|
+
const l = ce(r), d = !!n && l === "video", m = he(t);
|
|
2978
|
+
return Ye(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
|
|
2957
2979
|
"audio",
|
|
2958
2980
|
{
|
|
2959
2981
|
src: n,
|
|
@@ -2974,7 +2996,7 @@ const Wr = {
|
|
|
2974
2996
|
"video",
|
|
2975
2997
|
{
|
|
2976
2998
|
src: n,
|
|
2977
|
-
poster:
|
|
2999
|
+
poster: m,
|
|
2978
3000
|
controls: !0,
|
|
2979
3001
|
playsInline: !0,
|
|
2980
3002
|
preload: "metadata",
|
|
@@ -2984,7 +3006,7 @@ const Wr = {
|
|
|
2984
3006
|
) : t ? /* @__PURE__ */ s(
|
|
2985
3007
|
"img",
|
|
2986
3008
|
{
|
|
2987
|
-
src: t,
|
|
3009
|
+
src: m ?? t,
|
|
2988
3010
|
alt: a ?? "",
|
|
2989
3011
|
draggable: !1,
|
|
2990
3012
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
@@ -2994,10 +3016,10 @@ const Wr = {
|
|
|
2994
3016
|
{
|
|
2995
3017
|
className: y(
|
|
2996
3018
|
"flex h-full w-full items-center justify-center",
|
|
2997
|
-
|
|
3019
|
+
ri[e]
|
|
2998
3020
|
),
|
|
2999
|
-
children:
|
|
3000
|
-
className:
|
|
3021
|
+
children: _e(r, {
|
|
3022
|
+
className: ii[e],
|
|
3001
3023
|
weight: "regular"
|
|
3002
3024
|
})
|
|
3003
3025
|
}
|
|
@@ -3007,7 +3029,7 @@ const Wr = {
|
|
|
3007
3029
|
]
|
|
3008
3030
|
}
|
|
3009
3031
|
);
|
|
3010
|
-
},
|
|
3032
|
+
}, li = ({
|
|
3011
3033
|
title: e,
|
|
3012
3034
|
placeholderTitle: t,
|
|
3013
3035
|
description: n,
|
|
@@ -3018,17 +3040,17 @@ const Wr = {
|
|
|
3018
3040
|
layout: l = "featured",
|
|
3019
3041
|
appIcon: d,
|
|
3020
3042
|
cta: m,
|
|
3021
|
-
onDismiss:
|
|
3043
|
+
onDismiss: f,
|
|
3022
3044
|
onEditClick: h
|
|
3023
3045
|
}) => {
|
|
3024
|
-
const
|
|
3046
|
+
const g = l === "classic", c = Ye(r, o), b = f ? /* @__PURE__ */ s(
|
|
3025
3047
|
"button",
|
|
3026
3048
|
{
|
|
3027
3049
|
type: "button",
|
|
3028
|
-
onClick:
|
|
3050
|
+
onClick: f,
|
|
3029
3051
|
"aria-label": "Dismiss attachment",
|
|
3030
3052
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3031
|
-
children: /* @__PURE__ */ s(
|
|
3053
|
+
children: /* @__PURE__ */ s(Ge, { className: "size-3", weight: "bold" })
|
|
3032
3054
|
}
|
|
3033
3055
|
) : void 0, v = h ? /* @__PURE__ */ s(
|
|
3034
3056
|
"button",
|
|
@@ -3037,12 +3059,12 @@ const Wr = {
|
|
|
3037
3059
|
onClick: h,
|
|
3038
3060
|
"aria-label": "Edit attachment",
|
|
3039
3061
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3040
|
-
children: /* @__PURE__ */ s(
|
|
3062
|
+
children: /* @__PURE__ */ s(Kn, { className: "size-5", weight: "regular" })
|
|
3041
3063
|
}
|
|
3042
3064
|
) : void 0;
|
|
3043
|
-
return c ? /* @__PURE__ */ s(
|
|
3065
|
+
return c ? /* @__PURE__ */ s(Ue, { variant: "dark", bgClassName: Et, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3044
3066
|
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
|
|
3045
|
-
|
|
3067
|
+
je,
|
|
3046
3068
|
{
|
|
3047
3069
|
variant: "dark",
|
|
3048
3070
|
sourceUrl: o,
|
|
@@ -3052,13 +3074,13 @@ const Wr = {
|
|
|
3052
3074
|
) }),
|
|
3053
3075
|
b && /* @__PURE__ */ s("div", { className: "shrink-0", children: b })
|
|
3054
3076
|
] }) }) : /* @__PURE__ */ u(
|
|
3055
|
-
|
|
3077
|
+
Ue,
|
|
3056
3078
|
{
|
|
3057
3079
|
variant: "dark",
|
|
3058
|
-
topRight:
|
|
3080
|
+
topRight: g ? b : void 0,
|
|
3059
3081
|
children: [
|
|
3060
|
-
!
|
|
3061
|
-
|
|
3082
|
+
!g && /* @__PURE__ */ s(
|
|
3083
|
+
je,
|
|
3062
3084
|
{
|
|
3063
3085
|
variant: "dark",
|
|
3064
3086
|
thumbnailUrl: i,
|
|
@@ -3069,7 +3091,7 @@ const Wr = {
|
|
|
3069
3091
|
}
|
|
3070
3092
|
),
|
|
3071
3093
|
/* @__PURE__ */ s(
|
|
3072
|
-
|
|
3094
|
+
Ct,
|
|
3073
3095
|
{
|
|
3074
3096
|
variant: "dark",
|
|
3075
3097
|
title: e,
|
|
@@ -3084,7 +3106,7 @@ const Wr = {
|
|
|
3084
3106
|
]
|
|
3085
3107
|
}
|
|
3086
3108
|
);
|
|
3087
|
-
},
|
|
3109
|
+
}, oi = ({
|
|
3088
3110
|
title: e,
|
|
3089
3111
|
description: t,
|
|
3090
3112
|
url: n,
|
|
@@ -3096,7 +3118,7 @@ const Wr = {
|
|
|
3096
3118
|
cta: d,
|
|
3097
3119
|
onClick: m
|
|
3098
3120
|
}) => {
|
|
3099
|
-
const
|
|
3121
|
+
const f = St(a, i), h = kt(n), g = d == null && h != null && !f ? h : void 0, c = d == null && !f ? m : void 0, b = Ye(a, i) ? Et : void 0, v = d && m ? {
|
|
3100
3122
|
...d,
|
|
3101
3123
|
onClick: () => {
|
|
3102
3124
|
var x;
|
|
@@ -3104,17 +3126,17 @@ const Wr = {
|
|
|
3104
3126
|
}
|
|
3105
3127
|
} : d;
|
|
3106
3128
|
return /* @__PURE__ */ u(
|
|
3107
|
-
|
|
3129
|
+
Ue,
|
|
3108
3130
|
{
|
|
3109
3131
|
variant: "light",
|
|
3110
|
-
href:
|
|
3132
|
+
href: g,
|
|
3111
3133
|
onClick: c,
|
|
3112
3134
|
ariaLabel: e ?? "Open attachment preview",
|
|
3113
3135
|
bgClassName: b,
|
|
3114
3136
|
"data-testid": "link-attachment",
|
|
3115
3137
|
children: [
|
|
3116
3138
|
o === "featured" && /* @__PURE__ */ s(
|
|
3117
|
-
|
|
3139
|
+
je,
|
|
3118
3140
|
{
|
|
3119
3141
|
variant: "light",
|
|
3120
3142
|
thumbnailUrl: r,
|
|
@@ -3124,7 +3146,7 @@ const Wr = {
|
|
|
3124
3146
|
}
|
|
3125
3147
|
),
|
|
3126
3148
|
/* @__PURE__ */ s(
|
|
3127
|
-
|
|
3149
|
+
Ct,
|
|
3128
3150
|
{
|
|
3129
3151
|
variant: "light",
|
|
3130
3152
|
title: e,
|
|
@@ -3137,7 +3159,7 @@ const Wr = {
|
|
|
3137
3159
|
]
|
|
3138
3160
|
}
|
|
3139
3161
|
);
|
|
3140
|
-
},
|
|
3162
|
+
}, ci = ({
|
|
3141
3163
|
title: e,
|
|
3142
3164
|
placeholderTitle: t,
|
|
3143
3165
|
description: n,
|
|
@@ -3148,19 +3170,19 @@ const Wr = {
|
|
|
3148
3170
|
layout: l = "featured",
|
|
3149
3171
|
appIcon: d,
|
|
3150
3172
|
cta: m,
|
|
3151
|
-
onClick:
|
|
3173
|
+
onClick: f
|
|
3152
3174
|
}) => {
|
|
3153
|
-
const h =
|
|
3175
|
+
const h = St(r, o), g = kt(a), c = m == null && g != null && !h ? g : void 0, b = m == null && !h && c != null ? f : void 0;
|
|
3154
3176
|
return /* @__PURE__ */ u(
|
|
3155
|
-
|
|
3177
|
+
Ue,
|
|
3156
3178
|
{
|
|
3157
3179
|
variant: "dark",
|
|
3158
3180
|
href: c,
|
|
3159
3181
|
onClick: b,
|
|
3160
|
-
bgClassName:
|
|
3182
|
+
bgClassName: Ye(r, o) ? Et : void 0,
|
|
3161
3183
|
children: [
|
|
3162
3184
|
l === "featured" && /* @__PURE__ */ s(
|
|
3163
|
-
|
|
3185
|
+
je,
|
|
3164
3186
|
{
|
|
3165
3187
|
variant: "dark",
|
|
3166
3188
|
thumbnailUrl: i,
|
|
@@ -3170,7 +3192,7 @@ const Wr = {
|
|
|
3170
3192
|
}
|
|
3171
3193
|
),
|
|
3172
3194
|
/* @__PURE__ */ s(
|
|
3173
|
-
|
|
3195
|
+
Ct,
|
|
3174
3196
|
{
|
|
3175
3197
|
variant: "dark",
|
|
3176
3198
|
title: e,
|
|
@@ -3184,22 +3206,22 @@ const Wr = {
|
|
|
3184
3206
|
]
|
|
3185
3207
|
}
|
|
3186
3208
|
);
|
|
3187
|
-
},
|
|
3188
|
-
Composer:
|
|
3189
|
-
Sent:
|
|
3190
|
-
Received:
|
|
3209
|
+
}, Zt = {
|
|
3210
|
+
Composer: li,
|
|
3211
|
+
Sent: ci,
|
|
3212
|
+
Received: oi
|
|
3191
3213
|
};
|
|
3192
3214
|
function z(e) {
|
|
3193
3215
|
const t = e == null ? void 0 : e.trim();
|
|
3194
3216
|
return t || void 0;
|
|
3195
3217
|
}
|
|
3196
|
-
function
|
|
3218
|
+
function Jt(e) {
|
|
3197
3219
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
3198
3220
|
}
|
|
3199
|
-
function
|
|
3221
|
+
function di(e, t) {
|
|
3200
3222
|
if (!(e != null && e.trim()) || !(t != null && t.trim()))
|
|
3201
3223
|
return !1;
|
|
3202
|
-
const n =
|
|
3224
|
+
const n = Jt(e), a = Jt(t);
|
|
3203
3225
|
if (n === a)
|
|
3204
3226
|
return !0;
|
|
3205
3227
|
if (!n.includes(a))
|
|
@@ -3207,29 +3229,29 @@ function ri(e, t) {
|
|
|
3207
3229
|
const r = n.split(a).join("");
|
|
3208
3230
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
3209
3231
|
}
|
|
3210
|
-
function
|
|
3232
|
+
function Qt(e) {
|
|
3211
3233
|
const t = z(e.og_scrape_url) ?? z(e.title_link), n = z(e.image_url) ?? z(e.thumb_url), a = z(e.asset_url), r = z(e.mime_type);
|
|
3212
3234
|
return {
|
|
3213
3235
|
title: z(e.title),
|
|
3214
3236
|
description: z(e.text),
|
|
3215
3237
|
url: t,
|
|
3216
|
-
thumbnailUrl: n,
|
|
3238
|
+
thumbnailUrl: he(n),
|
|
3217
3239
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
3218
3240
|
// native video/audio player in the hero instead of a static thumbnail.
|
|
3219
3241
|
sourceUrl: a,
|
|
3220
|
-
layout: n ||
|
|
3242
|
+
layout: n || St(r, a) ? "featured" : "classic",
|
|
3221
3243
|
mimeType: r
|
|
3222
3244
|
};
|
|
3223
3245
|
}
|
|
3224
|
-
function
|
|
3246
|
+
function ui(e) {
|
|
3225
3247
|
var t;
|
|
3226
|
-
return
|
|
3248
|
+
return Rs(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3227
3249
|
}
|
|
3228
|
-
function
|
|
3250
|
+
function Rs(e) {
|
|
3229
3251
|
const t = z(e.og_scrape_url);
|
|
3230
3252
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3231
3253
|
}
|
|
3232
|
-
function
|
|
3254
|
+
function Ls(e) {
|
|
3233
3255
|
if (!(e != null && e.length)) return [];
|
|
3234
3256
|
const t = [], n = (r, i) => {
|
|
3235
3257
|
const o = t[t.length - 1];
|
|
@@ -3247,45 +3269,45 @@ function Rs(e) {
|
|
|
3247
3269
|
t.push({ type: "link", attachments: [r] });
|
|
3248
3270
|
};
|
|
3249
3271
|
for (const r of e) {
|
|
3250
|
-
if (
|
|
3272
|
+
if (Rs(r)) {
|
|
3251
3273
|
a(r);
|
|
3252
3274
|
continue;
|
|
3253
3275
|
}
|
|
3254
|
-
const i =
|
|
3276
|
+
const i = ui(r);
|
|
3255
3277
|
i && n(i, r);
|
|
3256
3278
|
}
|
|
3257
3279
|
return t;
|
|
3258
3280
|
}
|
|
3259
|
-
function
|
|
3281
|
+
function mi(e) {
|
|
3260
3282
|
return e.filter((t) => t.type === "media").length;
|
|
3261
3283
|
}
|
|
3262
|
-
function
|
|
3284
|
+
function hi(e, t, n) {
|
|
3263
3285
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3264
3286
|
}
|
|
3265
|
-
function
|
|
3287
|
+
function es(e) {
|
|
3266
3288
|
return z(e.image_url) ?? z(e.asset_url) ?? "";
|
|
3267
3289
|
}
|
|
3268
|
-
function
|
|
3290
|
+
function fi(e) {
|
|
3269
3291
|
switch (e) {
|
|
3270
3292
|
case "image":
|
|
3271
|
-
return
|
|
3293
|
+
return ke.Image;
|
|
3272
3294
|
case "video":
|
|
3273
|
-
return
|
|
3295
|
+
return ke.Video;
|
|
3274
3296
|
case "audio":
|
|
3275
|
-
return
|
|
3297
|
+
return ke.Audio;
|
|
3276
3298
|
case "pdf":
|
|
3277
|
-
return
|
|
3299
|
+
return ke.Pdf;
|
|
3278
3300
|
default:
|
|
3279
|
-
return
|
|
3301
|
+
return ke.File;
|
|
3280
3302
|
}
|
|
3281
3303
|
}
|
|
3282
|
-
function
|
|
3304
|
+
function gi(e, t) {
|
|
3283
3305
|
if (t.length > 1)
|
|
3284
3306
|
switch (e) {
|
|
3285
3307
|
case "image":
|
|
3286
3308
|
return {
|
|
3287
3309
|
items: t.map((a) => ({
|
|
3288
|
-
src:
|
|
3310
|
+
src: es(a),
|
|
3289
3311
|
alt: z(a.title)
|
|
3290
3312
|
}))
|
|
3291
3313
|
};
|
|
@@ -3336,7 +3358,7 @@ function di(e, t) {
|
|
|
3336
3358
|
switch (e) {
|
|
3337
3359
|
case "image":
|
|
3338
3360
|
return {
|
|
3339
|
-
src:
|
|
3361
|
+
src: es(n),
|
|
3340
3362
|
alt: z(n.title)
|
|
3341
3363
|
};
|
|
3342
3364
|
case "video":
|
|
@@ -3366,42 +3388,42 @@ function di(e, t) {
|
|
|
3366
3388
|
};
|
|
3367
3389
|
}
|
|
3368
3390
|
}
|
|
3369
|
-
function
|
|
3391
|
+
function pi({
|
|
3370
3392
|
groupPosition: e,
|
|
3371
3393
|
isMyMessage: t,
|
|
3372
3394
|
segment: n
|
|
3373
3395
|
}) {
|
|
3374
|
-
const a =
|
|
3375
|
-
...
|
|
3396
|
+
const a = fi(n.kind), r = {
|
|
3397
|
+
...gi(n.kind, n.attachments),
|
|
3376
3398
|
groupPosition: e
|
|
3377
3399
|
};
|
|
3378
3400
|
return t ? /* @__PURE__ */ s(a.Sent, { ...r }) : /* @__PURE__ */ s(a.Received, { ...r });
|
|
3379
3401
|
}
|
|
3380
|
-
const
|
|
3402
|
+
const bi = ({
|
|
3381
3403
|
groupPosition: e,
|
|
3382
3404
|
isMyMessage: t,
|
|
3383
3405
|
message: n,
|
|
3384
3406
|
renderText: a
|
|
3385
3407
|
}) => {
|
|
3386
3408
|
var b;
|
|
3387
|
-
const r =
|
|
3409
|
+
const r = Ls(n.attachments);
|
|
3388
3410
|
if (r.length === 0) return null;
|
|
3389
|
-
const i =
|
|
3390
|
-
let
|
|
3391
|
-
const h = [],
|
|
3392
|
-
const p = t ?
|
|
3411
|
+
const i = mi(r), o = (b = n.text) == null ? void 0 : b.trim(), l = r.find((v) => v.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? Qt(l.attachments[0] ?? {}).url : void 0, m = o && di(o, d) ? void 0 : o;
|
|
3412
|
+
let f = 0;
|
|
3413
|
+
const h = [], g = (v, x) => {
|
|
3414
|
+
const p = t ? Zt.Sent : Zt.Received;
|
|
3393
3415
|
h.push(
|
|
3394
|
-
/* @__PURE__ */ s(p, { ...
|
|
3416
|
+
/* @__PURE__ */ s(p, { ...Qt(v) }, x)
|
|
3395
3417
|
);
|
|
3396
3418
|
}, c = (v, x) => {
|
|
3397
|
-
const p =
|
|
3398
|
-
|
|
3419
|
+
const p = hi(
|
|
3420
|
+
f,
|
|
3399
3421
|
i,
|
|
3400
3422
|
e
|
|
3401
3423
|
);
|
|
3402
|
-
|
|
3424
|
+
f += 1, h.push(
|
|
3403
3425
|
/* @__PURE__ */ s(
|
|
3404
|
-
|
|
3426
|
+
pi,
|
|
3405
3427
|
{
|
|
3406
3428
|
groupPosition: p,
|
|
3407
3429
|
isMyMessage: t,
|
|
@@ -3414,7 +3436,7 @@ const mi = ({
|
|
|
3414
3436
|
return r.forEach((v, x) => {
|
|
3415
3437
|
if (v.type === "link") {
|
|
3416
3438
|
v.attachments.forEach((p, _) => {
|
|
3417
|
-
|
|
3439
|
+
g(p, `link-${x}-${_}`);
|
|
3418
3440
|
});
|
|
3419
3441
|
return;
|
|
3420
3442
|
}
|
|
@@ -3433,23 +3455,23 @@ const mi = ({
|
|
|
3433
3455
|
},
|
|
3434
3456
|
children: [
|
|
3435
3457
|
h,
|
|
3436
|
-
!m && /* @__PURE__ */ s(
|
|
3458
|
+
!m && /* @__PURE__ */ s(nt, {})
|
|
3437
3459
|
]
|
|
3438
3460
|
}
|
|
3439
3461
|
),
|
|
3440
3462
|
m ? /* @__PURE__ */ u("div", { className: "str-chat__message-bubble", children: [
|
|
3441
3463
|
/* @__PURE__ */ s(
|
|
3442
|
-
|
|
3464
|
+
$e,
|
|
3443
3465
|
{
|
|
3444
3466
|
message: n,
|
|
3445
3467
|
renderText: a
|
|
3446
3468
|
}
|
|
3447
3469
|
),
|
|
3448
|
-
/* @__PURE__ */ s(
|
|
3470
|
+
/* @__PURE__ */ s(nt, {})
|
|
3449
3471
|
] }) : null
|
|
3450
3472
|
] });
|
|
3451
|
-
},
|
|
3452
|
-
var Dt,
|
|
3473
|
+
}, vi = (e) => {
|
|
3474
|
+
var Dt, zt, Ft, Pt, Ot, $t, Bt, Ut, jt, Vt;
|
|
3453
3475
|
const {
|
|
3454
3476
|
additionalMessageInputProps: t,
|
|
3455
3477
|
chatbotVotingEnabled: n,
|
|
@@ -3460,57 +3482,57 @@ const mi = ({
|
|
|
3460
3482
|
handleAction: l,
|
|
3461
3483
|
handleOpenThread: d,
|
|
3462
3484
|
handleRetry: m,
|
|
3463
|
-
highlighted:
|
|
3485
|
+
highlighted: f,
|
|
3464
3486
|
isMessageAIGenerated: h,
|
|
3465
|
-
isMyMessage:
|
|
3487
|
+
isMyMessage: g,
|
|
3466
3488
|
message: c,
|
|
3467
3489
|
renderText: b,
|
|
3468
3490
|
threadList: v,
|
|
3469
3491
|
viewerLanguage: x
|
|
3470
|
-
} = e, { client: p } =
|
|
3471
|
-
Attachment: I =
|
|
3472
|
-
EditMessageModal: T =
|
|
3492
|
+
} = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: k, onFetchSource: D, onDownloadClick: S } = Or("LockedAttachment"), [R, O] = U(!1), F = Ks(c.id), { selected: L, voteUp: C, voteDown: E } = va(c), {
|
|
3493
|
+
Attachment: I = Zs,
|
|
3494
|
+
EditMessageModal: T = Js,
|
|
3473
3495
|
MessageActions: M,
|
|
3474
|
-
MessageBlocked: P =
|
|
3475
|
-
MessageBouncePrompt: $ =
|
|
3476
|
-
MessageDeleted: j =
|
|
3477
|
-
MessageIsThreadReplyInChannelButtonIndicator: Q =
|
|
3478
|
-
MessageRepliesCountButton: ee =
|
|
3479
|
-
ReminderNotification: X =
|
|
3480
|
-
StreamedMessageText: N =
|
|
3496
|
+
MessageBlocked: P = Qs,
|
|
3497
|
+
MessageBouncePrompt: $ = en,
|
|
3498
|
+
MessageDeleted: j = tn,
|
|
3499
|
+
MessageIsThreadReplyInChannelButtonIndicator: Q = sn,
|
|
3500
|
+
MessageRepliesCountButton: ee = nn,
|
|
3501
|
+
ReminderNotification: X = an,
|
|
3502
|
+
StreamedMessageText: N = rn,
|
|
3481
3503
|
PinIndicator: A
|
|
3482
|
-
} =
|
|
3504
|
+
} = as("CustomMessage"), H = ln(c), q = on(c), Y = re(
|
|
3483
3505
|
() => h == null ? void 0 : h(c),
|
|
3484
3506
|
[h, c]
|
|
3485
3507
|
), B = re(() => {
|
|
3486
|
-
const me = c.attachments ?? [],
|
|
3487
|
-
if (
|
|
3488
|
-
const
|
|
3489
|
-
return
|
|
3508
|
+
const me = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...me] : me;
|
|
3509
|
+
if (!Be(c)) return be;
|
|
3510
|
+
const Gt = be.filter((Ht) => !("type" in Ht) || !ps(Ht));
|
|
3511
|
+
return Gt.length === be.length ? be : Gt;
|
|
3490
3512
|
}, [c]), W = re(
|
|
3491
|
-
() =>
|
|
3513
|
+
() => Ls(B),
|
|
3492
3514
|
[B]
|
|
3493
3515
|
), Z = re(() => {
|
|
3494
|
-
const me =
|
|
3516
|
+
const me = us({ message: c, viewerLanguage: x });
|
|
3495
3517
|
return me === c.text ? c : { ...c, text: me };
|
|
3496
3518
|
}, [c, x]), de = W.length > 0, De = W.reduce(
|
|
3497
|
-
(me,
|
|
3519
|
+
(me, be) => me + be.attachments.length,
|
|
3498
3520
|
0
|
|
3499
|
-
) === ((B == null ? void 0 : B.length) ?? 0),
|
|
3521
|
+
) === ((B == null ? void 0 : B.length) ?? 0), ze = Ya({
|
|
3500
3522
|
endOfGroup: r,
|
|
3501
3523
|
firstOfGroup: i,
|
|
3502
3524
|
groupedByUser: o
|
|
3503
3525
|
});
|
|
3504
|
-
if (
|
|
3526
|
+
if (cn(c))
|
|
3505
3527
|
return null;
|
|
3506
3528
|
if (c.deleted_at || c.type === "deleted")
|
|
3507
3529
|
return /* @__PURE__ */ s(j, { message: c });
|
|
3508
|
-
if (
|
|
3530
|
+
if (dn(c))
|
|
3509
3531
|
return /* @__PURE__ */ s(P, {});
|
|
3510
|
-
const ae = !v && !!c.reply_count, ue = !v && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403,
|
|
3511
|
-
let
|
|
3512
|
-
le ?
|
|
3513
|
-
const te =
|
|
3532
|
+
const ae = !v && !!c.reply_count, ue = !v && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = un(c);
|
|
3533
|
+
let ge;
|
|
3534
|
+
le ? ge = () => m(c) : Tt && (ge = () => O(!0));
|
|
3535
|
+
const te = g(), $s = y(
|
|
3514
3536
|
"str-chat__message str-chat__message-simple",
|
|
3515
3537
|
`str-chat__message--${c.type}`,
|
|
3516
3538
|
`str-chat__message--${c.status}`,
|
|
@@ -3518,29 +3540,29 @@ const mi = ({
|
|
|
3518
3540
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
3519
3541
|
{
|
|
3520
3542
|
"str-chat__message--has-attachment": H,
|
|
3521
|
-
"str-chat__message--highlighted":
|
|
3543
|
+
"str-chat__message--highlighted": f,
|
|
3522
3544
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
3523
3545
|
"str-chat__message--with-reactions": q,
|
|
3524
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
3546
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((zt = c == null ? void 0 : c.error) == null ? void 0 : zt.status) !== 403,
|
|
3525
3547
|
"str-chat__message-with-thread-link": ae || ue,
|
|
3526
3548
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3527
3549
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3528
3550
|
"str-chat__virtual-message__wrapper--group": o
|
|
3529
3551
|
}
|
|
3530
|
-
),
|
|
3552
|
+
), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = qr(c), pe = Be(c), Bs = yt(c), We = !!(B != null && B.length && !c.quoted_message), At = pe && te && We, Us = de && De && !c.quoted_message && !qe && !Y && !pe, Rt = {
|
|
3531
3553
|
contentType: "text",
|
|
3532
|
-
amountText: (
|
|
3533
|
-
paymentStatus: (
|
|
3534
|
-
renderedText: c.text && /* @__PURE__ */ s(
|
|
3535
|
-
},
|
|
3554
|
+
amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
|
|
3555
|
+
paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
|
|
3556
|
+
renderedText: c.text && /* @__PURE__ */ s($e, { message: Z, renderText: b })
|
|
3557
|
+
}, Lt = {
|
|
3536
3558
|
contentType: "media",
|
|
3537
|
-
title: (
|
|
3538
|
-
mimeType: (
|
|
3539
|
-
thumbnailUrl: (
|
|
3540
|
-
amountText: (
|
|
3541
|
-
detail: (
|
|
3542
|
-
paymentStatus: (
|
|
3543
|
-
onFetchSource:
|
|
3559
|
+
title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
|
|
3560
|
+
mimeType: ($t = c.metadata) == null ? void 0 : $t.attachment_mime_type,
|
|
3561
|
+
thumbnailUrl: (Bt = c.metadata) == null ? void 0 : Bt.attachment_thumbnail,
|
|
3562
|
+
amountText: (Ut = c.metadata) == null ? void 0 : Ut.amount_text,
|
|
3563
|
+
detail: (jt = c.metadata) == null ? void 0 : jt.attachment_detail,
|
|
3564
|
+
paymentStatus: (Vt = c.metadata) == null ? void 0 : Vt.payment_status,
|
|
3565
|
+
onFetchSource: D ? () => D(c, _) : void 0
|
|
3544
3566
|
};
|
|
3545
3567
|
return /* @__PURE__ */ u(se, { children: [
|
|
3546
3568
|
a && /* @__PURE__ */ s(
|
|
@@ -3550,7 +3572,7 @@ const mi = ({
|
|
|
3550
3572
|
}
|
|
3551
3573
|
),
|
|
3552
3574
|
R && /* @__PURE__ */ s(
|
|
3553
|
-
|
|
3575
|
+
mn,
|
|
3554
3576
|
{
|
|
3555
3577
|
MessageBouncePrompt: $,
|
|
3556
3578
|
onClose: () => O(!1),
|
|
@@ -3560,7 +3582,7 @@ const mi = ({
|
|
|
3560
3582
|
/* @__PURE__ */ u(
|
|
3561
3583
|
"div",
|
|
3562
3584
|
{
|
|
3563
|
-
className:
|
|
3585
|
+
className: $s,
|
|
3564
3586
|
"data-message-id": c.id,
|
|
3565
3587
|
"data-dd-privacy": "mask",
|
|
3566
3588
|
children: [
|
|
@@ -3575,58 +3597,58 @@ const mi = ({
|
|
|
3575
3597
|
name: c.user.name || c.user.id,
|
|
3576
3598
|
size: 24,
|
|
3577
3599
|
shape: "circle",
|
|
3578
|
-
dmAgentEnabled:
|
|
3600
|
+
dmAgentEnabled: pe
|
|
3579
3601
|
}
|
|
3580
3602
|
),
|
|
3581
3603
|
/* @__PURE__ */ s(
|
|
3582
3604
|
"div",
|
|
3583
3605
|
{
|
|
3584
3606
|
className: y("str-chat__message-inner", {
|
|
3585
|
-
"str-chat__simple-message--error-failed": le ||
|
|
3607
|
+
"str-chat__simple-message--error-failed": le || Tt
|
|
3586
3608
|
}),
|
|
3587
3609
|
"data-testid": "message-inner",
|
|
3588
|
-
onClick:
|
|
3589
|
-
onKeyDown:
|
|
3590
|
-
role:
|
|
3591
|
-
tabIndex:
|
|
3610
|
+
onClick: ge,
|
|
3611
|
+
onKeyDown: ge,
|
|
3612
|
+
role: ge ? "button" : void 0,
|
|
3613
|
+
tabIndex: ge ? 0 : void 0,
|
|
3592
3614
|
style: {
|
|
3593
3615
|
// Force margins to 0 to prevent hover layout shift
|
|
3594
3616
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
3595
3617
|
marginInlineEnd: 0,
|
|
3596
3618
|
marginInlineStart: 0
|
|
3597
3619
|
},
|
|
3598
|
-
children:
|
|
3620
|
+
children: Mt ? /* @__PURE__ */ s(Qe, { message: c, standalone: !0 }) : Hr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3599
3621
|
te && M && /* @__PURE__ */ s(M, {}),
|
|
3600
3622
|
te ? /* @__PURE__ */ s(
|
|
3601
|
-
|
|
3623
|
+
Pe,
|
|
3602
3624
|
{
|
|
3603
|
-
...
|
|
3625
|
+
...Rt,
|
|
3604
3626
|
isMine: !0
|
|
3605
3627
|
}
|
|
3606
3628
|
) : /* @__PURE__ */ s(
|
|
3607
|
-
|
|
3629
|
+
Pe,
|
|
3608
3630
|
{
|
|
3609
|
-
...
|
|
3631
|
+
...Rt,
|
|
3610
3632
|
isMine: !1,
|
|
3611
3633
|
isUnlocking: w(c.id),
|
|
3612
3634
|
onUnlockClick: () => k == null ? void 0 : k(c, _)
|
|
3613
3635
|
}
|
|
3614
3636
|
),
|
|
3615
3637
|
!te && M && /* @__PURE__ */ s(M, {})
|
|
3616
|
-
] }) }) :
|
|
3638
|
+
] }) }) : Yr(c) ? /* @__PURE__ */ u("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3617
3639
|
/* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
|
|
3618
3640
|
te && M && /* @__PURE__ */ s(M, {}),
|
|
3619
3641
|
te ? /* @__PURE__ */ s(
|
|
3620
|
-
|
|
3642
|
+
Pe,
|
|
3621
3643
|
{
|
|
3622
|
-
...
|
|
3644
|
+
...Lt,
|
|
3623
3645
|
isMine: !0,
|
|
3624
3646
|
onPreviewClick: () => k ? k(c, _) : void 0
|
|
3625
3647
|
}
|
|
3626
3648
|
) : /* @__PURE__ */ s(
|
|
3627
|
-
|
|
3649
|
+
Pe,
|
|
3628
3650
|
{
|
|
3629
|
-
...
|
|
3651
|
+
...Lt,
|
|
3630
3652
|
isMine: !1,
|
|
3631
3653
|
isUnlocking: w(c.id),
|
|
3632
3654
|
onUnlockClick: () => k ? k(c, _) : void 0,
|
|
@@ -3636,16 +3658,16 @@ const mi = ({
|
|
|
3636
3658
|
!te && M && /* @__PURE__ */ s(M, {})
|
|
3637
3659
|
] }),
|
|
3638
3660
|
c.text && /* @__PURE__ */ s("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ s(
|
|
3639
|
-
|
|
3661
|
+
$e,
|
|
3640
3662
|
{
|
|
3641
3663
|
message: Z,
|
|
3642
3664
|
renderText: b
|
|
3643
3665
|
}
|
|
3644
3666
|
) })
|
|
3645
|
-
] }) :
|
|
3646
|
-
|
|
3667
|
+
] }) : Us ? /* @__PURE__ */ s(
|
|
3668
|
+
bi,
|
|
3647
3669
|
{
|
|
3648
|
-
groupPosition:
|
|
3670
|
+
groupPosition: ze,
|
|
3649
3671
|
isMyMessage: te,
|
|
3650
3672
|
message: {
|
|
3651
3673
|
...Z,
|
|
@@ -3658,15 +3680,15 @@ const mi = ({
|
|
|
3658
3680
|
renderText: b
|
|
3659
3681
|
}
|
|
3660
3682
|
) : /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ u("div", { className: "str-chat__message-bubble", children: [
|
|
3661
|
-
|
|
3662
|
-
|
|
3683
|
+
pe && !At && /* @__PURE__ */ s(
|
|
3684
|
+
Qe,
|
|
3663
3685
|
{
|
|
3664
3686
|
message: c,
|
|
3665
|
-
hasAttachment:
|
|
3687
|
+
hasAttachment: We,
|
|
3666
3688
|
isMyMessage: te
|
|
3667
3689
|
}
|
|
3668
3690
|
),
|
|
3669
|
-
|
|
3691
|
+
qe && /* @__PURE__ */ s(hn, { poll: qe }),
|
|
3670
3692
|
B != null && B.length && !c.quoted_message ? /* @__PURE__ */ s(
|
|
3671
3693
|
I,
|
|
3672
3694
|
{
|
|
@@ -3681,35 +3703,35 @@ const mi = ({
|
|
|
3681
3703
|
renderText: b
|
|
3682
3704
|
}
|
|
3683
3705
|
) : /* @__PURE__ */ s(
|
|
3684
|
-
|
|
3706
|
+
$e,
|
|
3685
3707
|
{
|
|
3686
3708
|
message: Z,
|
|
3687
3709
|
renderText: b
|
|
3688
3710
|
}
|
|
3689
3711
|
),
|
|
3690
|
-
/* @__PURE__ */ s(
|
|
3712
|
+
/* @__PURE__ */ s(nt, {})
|
|
3691
3713
|
] }) })
|
|
3692
3714
|
}
|
|
3693
3715
|
),
|
|
3694
|
-
|
|
3695
|
-
(!
|
|
3696
|
-
|
|
3716
|
+
!Bs && !Mt && /* @__PURE__ */ u("div", { className: "str-chat__message-footer", children: [
|
|
3717
|
+
(!pe || At) && /* @__PURE__ */ s(
|
|
3718
|
+
Qe,
|
|
3697
3719
|
{
|
|
3698
3720
|
message: c,
|
|
3699
|
-
hasAttachment:
|
|
3721
|
+
hasAttachment: We,
|
|
3700
3722
|
isMyMessage: te
|
|
3701
3723
|
}
|
|
3702
3724
|
),
|
|
3703
|
-
n &&
|
|
3704
|
-
|
|
3725
|
+
n && pe && /* @__PURE__ */ s(
|
|
3726
|
+
Wr,
|
|
3705
3727
|
{
|
|
3706
|
-
selected:
|
|
3728
|
+
selected: L,
|
|
3707
3729
|
onVoteUp: C,
|
|
3708
3730
|
onVoteDown: E
|
|
3709
3731
|
}
|
|
3710
3732
|
)
|
|
3711
3733
|
] }),
|
|
3712
|
-
/* @__PURE__ */ s(
|
|
3734
|
+
/* @__PURE__ */ s(Kr, {}),
|
|
3713
3735
|
ae && /* @__PURE__ */ s(
|
|
3714
3736
|
ee,
|
|
3715
3737
|
{
|
|
@@ -3723,50 +3745,50 @@ const mi = ({
|
|
|
3723
3745
|
c.id
|
|
3724
3746
|
)
|
|
3725
3747
|
] });
|
|
3726
|
-
},
|
|
3727
|
-
|
|
3728
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
3729
|
-
),
|
|
3730
|
-
const t =
|
|
3731
|
-
return /* @__PURE__ */ s(
|
|
3732
|
-
},
|
|
3748
|
+
}, xi = V.memo(
|
|
3749
|
+
vi,
|
|
3750
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Xs(e, t)
|
|
3751
|
+
), wi = (e) => {
|
|
3752
|
+
const t = Ne("CustomMessage");
|
|
3753
|
+
return /* @__PURE__ */ s(xi, { ...t, ...e });
|
|
3754
|
+
}, _i = () => {
|
|
3733
3755
|
var n;
|
|
3734
|
-
const { handleDelete: e, message: t } =
|
|
3756
|
+
const { handleDelete: e, message: t } = Ne("CustomMessageActions");
|
|
3735
3757
|
return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
|
|
3736
|
-
|
|
3758
|
+
os,
|
|
3737
3759
|
{
|
|
3738
3760
|
onClick: e,
|
|
3739
3761
|
"aria-label": "Delete",
|
|
3740
3762
|
title: "Delete",
|
|
3741
3763
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3742
|
-
children: /* @__PURE__ */ s(
|
|
3764
|
+
children: /* @__PURE__ */ s(Zn, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3743
3765
|
}
|
|
3744
3766
|
);
|
|
3745
|
-
},
|
|
3746
|
-
const { handleFlag: e } =
|
|
3767
|
+
}, Ni = () => {
|
|
3768
|
+
const { handleFlag: e } = Ne("CustomMessageActions");
|
|
3747
3769
|
return /* @__PURE__ */ s(
|
|
3748
|
-
|
|
3770
|
+
os,
|
|
3749
3771
|
{
|
|
3750
3772
|
onClick: e,
|
|
3751
3773
|
"aria-label": "Report",
|
|
3752
3774
|
title: "Report",
|
|
3753
3775
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
3754
|
-
children: /* @__PURE__ */ s(
|
|
3776
|
+
children: /* @__PURE__ */ s(rs, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
3755
3777
|
}
|
|
3756
3778
|
);
|
|
3757
|
-
},
|
|
3779
|
+
}, yi = () => {
|
|
3758
3780
|
var t;
|
|
3759
|
-
const { message: e } =
|
|
3781
|
+
const { message: e } = Ne("CustomMessageActions");
|
|
3760
3782
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
|
|
3761
|
-
|
|
3783
|
+
ea,
|
|
3762
3784
|
{
|
|
3763
3785
|
messageActionSet: [
|
|
3764
|
-
{ Component:
|
|
3765
|
-
{ Component:
|
|
3786
|
+
{ Component: _i, placement: "quick", type: "delete" },
|
|
3787
|
+
{ Component: Ni, placement: "quick", type: "flag" }
|
|
3766
3788
|
]
|
|
3767
3789
|
}
|
|
3768
3790
|
);
|
|
3769
|
-
},
|
|
3791
|
+
}, ki = ({
|
|
3770
3792
|
link: e,
|
|
3771
3793
|
onDismiss: t
|
|
3772
3794
|
}) => {
|
|
@@ -3796,7 +3818,7 @@ const mi = ({
|
|
|
3796
3818
|
},
|
|
3797
3819
|
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",
|
|
3798
3820
|
"aria-label": "Close link preview",
|
|
3799
|
-
children: /* @__PURE__ */ s(
|
|
3821
|
+
children: /* @__PURE__ */ s(Ge, { className: "size-4 text-black/90" })
|
|
3800
3822
|
}
|
|
3801
3823
|
),
|
|
3802
3824
|
/* @__PURE__ */ u("div", { className: "p-2", children: [
|
|
@@ -3806,14 +3828,14 @@ const mi = ({
|
|
|
3806
3828
|
]
|
|
3807
3829
|
}
|
|
3808
3830
|
);
|
|
3809
|
-
},
|
|
3831
|
+
}, Ci = (e) => ({
|
|
3810
3832
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
3811
|
-
(t) =>
|
|
3833
|
+
(t) => Yt.previewIsLoaded(t) || Yt.previewIsLoading(t)
|
|
3812
3834
|
)
|
|
3813
|
-
}),
|
|
3814
|
-
const { linkPreviewsManager: e } =
|
|
3835
|
+
}), Si = () => {
|
|
3836
|
+
const { linkPreviewsManager: e } = fn(), { linkPreviews: t } = gn(
|
|
3815
3837
|
e.state,
|
|
3816
|
-
|
|
3838
|
+
Ci
|
|
3817
3839
|
), n = (r) => {
|
|
3818
3840
|
e.dismissPreview(r);
|
|
3819
3841
|
};
|
|
@@ -3826,9 +3848,9 @@ const mi = ({
|
|
|
3826
3848
|
// block so it keeps its intrinsic height and the container scrolls — a
|
|
3827
3849
|
// bare flex-column child would be shrunk on the column axis and its
|
|
3828
3850
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3829
|
-
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(
|
|
3851
|
+
/* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(ki, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
|
|
3830
3852
|
) : null;
|
|
3831
|
-
},
|
|
3853
|
+
}, It = V.createContext(!1), pl = () => Te(It), Ei = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
|
|
3832
3854
|
"button",
|
|
3833
3855
|
{
|
|
3834
3856
|
...n,
|
|
@@ -3836,13 +3858,13 @@ const mi = ({
|
|
|
3836
3858
|
"aria-label": "Send",
|
|
3837
3859
|
disabled: t,
|
|
3838
3860
|
onClick: e,
|
|
3839
|
-
children: /* @__PURE__ */ s(
|
|
3861
|
+
children: /* @__PURE__ */ s(Jn, { weight: "bold", className: "size-4" })
|
|
3840
3862
|
}
|
|
3841
|
-
),
|
|
3842
|
-
const e =
|
|
3843
|
-
SendButton: r =
|
|
3844
|
-
AttachmentPreviewList: i =
|
|
3845
|
-
} =
|
|
3863
|
+
), Ii = () => {
|
|
3864
|
+
const e = Te(It), { handleSubmit: t } = bn(), n = vn(), a = e || !n, {
|
|
3865
|
+
SendButton: r = Ei,
|
|
3866
|
+
AttachmentPreviewList: i = xn
|
|
3867
|
+
} = as("CustomMessageInput");
|
|
3846
3868
|
return (
|
|
3847
3869
|
// min-h-0 lets the composer shrink under keyboard squeeze (the link
|
|
3848
3870
|
// preview list inside is the scrollable region); the textarea + send row
|
|
@@ -3858,12 +3880,12 @@ const mi = ({
|
|
|
3858
3880
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch 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)]",
|
|
3859
3881
|
"data-dd-privacy": "mask",
|
|
3860
3882
|
children: [
|
|
3861
|
-
/* @__PURE__ */ s(
|
|
3862
|
-
/* @__PURE__ */ s(
|
|
3883
|
+
/* @__PURE__ */ s(wn, {}),
|
|
3884
|
+
/* @__PURE__ */ s(Si, {}),
|
|
3863
3885
|
/* @__PURE__ */ s(i, {}),
|
|
3864
3886
|
/* @__PURE__ */ u("div", { className: "flex shrink-0", children: [
|
|
3865
3887
|
/* @__PURE__ */ s("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ s(
|
|
3866
|
-
|
|
3888
|
+
_n,
|
|
3867
3889
|
{
|
|
3868
3890
|
"aria-disabled": e || void 0,
|
|
3869
3891
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -3890,7 +3912,7 @@ const mi = ({
|
|
|
3890
3912
|
}
|
|
3891
3913
|
)
|
|
3892
3914
|
);
|
|
3893
|
-
},
|
|
3915
|
+
}, Ti = ({
|
|
3894
3916
|
renderActions: e,
|
|
3895
3917
|
renderFooter: t,
|
|
3896
3918
|
disabled: n = !1,
|
|
@@ -3911,67 +3933,67 @@ const mi = ({
|
|
|
3911
3933
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3912
3934
|
children: [
|
|
3913
3935
|
e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3914
|
-
/* @__PURE__ */ s(
|
|
3936
|
+
/* @__PURE__ */ s(It.Provider, { value: o, children: /* @__PURE__ */ s(pn, { Input: r ?? Ii }) })
|
|
3915
3937
|
]
|
|
3916
3938
|
}
|
|
3917
3939
|
),
|
|
3918
3940
|
t == null ? void 0 : t()
|
|
3919
3941
|
] });
|
|
3920
|
-
},
|
|
3942
|
+
}, Mi = [
|
|
3921
3943
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
3922
3944
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
3923
|
-
],
|
|
3945
|
+
], Ai = {
|
|
3924
3946
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
3925
3947
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
3926
|
-
},
|
|
3948
|
+
}, Ri = [
|
|
3927
3949
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3928
|
-
],
|
|
3950
|
+
], Li = {
|
|
3929
3951
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3930
|
-
},
|
|
3952
|
+
}, tt = "age safety guidelines.", Di = "https://linktr.ee/s/about/contact", ts = (e) => Mi.includes(e), zi = (e) => Ri.includes(e), Fi = (e) => {
|
|
3931
3953
|
var a;
|
|
3932
3954
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3933
|
-
if (
|
|
3955
|
+
if (ts(t))
|
|
3934
3956
|
return {
|
|
3935
3957
|
kind: "dm-agent",
|
|
3936
3958
|
type: t
|
|
3937
3959
|
};
|
|
3938
|
-
if (
|
|
3960
|
+
if (zi(t))
|
|
3939
3961
|
return {
|
|
3940
3962
|
kind: "age-safety",
|
|
3941
3963
|
type: t
|
|
3942
3964
|
};
|
|
3943
3965
|
const n = e.dm_agent_system_type;
|
|
3944
|
-
if (
|
|
3966
|
+
if (ts(n))
|
|
3945
3967
|
return {
|
|
3946
3968
|
kind: "dm-agent",
|
|
3947
3969
|
type: n
|
|
3948
3970
|
};
|
|
3949
|
-
},
|
|
3950
|
-
const t = e.indexOf(
|
|
3971
|
+
}, Pi = (e) => {
|
|
3972
|
+
const t = e.indexOf(tt);
|
|
3951
3973
|
if (t === -1)
|
|
3952
3974
|
return e;
|
|
3953
|
-
const n = t +
|
|
3975
|
+
const n = t + tt.length;
|
|
3954
3976
|
return /* @__PURE__ */ u(se, { children: [
|
|
3955
3977
|
e.slice(0, t),
|
|
3956
3978
|
/* @__PURE__ */ s(
|
|
3957
3979
|
"a",
|
|
3958
3980
|
{
|
|
3959
|
-
href:
|
|
3981
|
+
href: Di,
|
|
3960
3982
|
target: "_blank",
|
|
3961
3983
|
rel: "noopener noreferrer",
|
|
3962
3984
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
3963
|
-
children:
|
|
3985
|
+
children: tt
|
|
3964
3986
|
}
|
|
3965
3987
|
),
|
|
3966
3988
|
e.slice(n)
|
|
3967
3989
|
] });
|
|
3968
|
-
},
|
|
3990
|
+
}, Oi = (e) => {
|
|
3969
3991
|
var a, r;
|
|
3970
|
-
const t = e.message.hide_date === !0, n =
|
|
3992
|
+
const t = e.message.hide_date === !0, n = Fi(
|
|
3971
3993
|
e.message
|
|
3972
3994
|
);
|
|
3973
3995
|
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
3974
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
3996
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ai[n.type];
|
|
3975
3997
|
return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3976
3998
|
/* @__PURE__ */ u(
|
|
3977
3999
|
"div",
|
|
@@ -3981,7 +4003,7 @@ const mi = ({
|
|
|
3981
4003
|
"data-dm-agent-system-type": n.type,
|
|
3982
4004
|
children: [
|
|
3983
4005
|
/* @__PURE__ */ s(
|
|
3984
|
-
|
|
4006
|
+
we,
|
|
3985
4007
|
{
|
|
3986
4008
|
size: 16,
|
|
3987
4009
|
weight: "regular",
|
|
@@ -3993,11 +4015,11 @@ const mi = ({
|
|
|
3993
4015
|
]
|
|
3994
4016
|
}
|
|
3995
4017
|
),
|
|
3996
|
-
!t && /* @__PURE__ */ s(
|
|
4018
|
+
!t && /* @__PURE__ */ s(Xe, { message: e.message })
|
|
3997
4019
|
] });
|
|
3998
4020
|
}
|
|
3999
4021
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
4000
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
4022
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Li[n.type];
|
|
4001
4023
|
return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
4002
4024
|
/* @__PURE__ */ u(
|
|
4003
4025
|
"div",
|
|
@@ -4007,7 +4029,7 @@ const mi = ({
|
|
|
4007
4029
|
"data-age-safety-system-type": n.type,
|
|
4008
4030
|
children: [
|
|
4009
4031
|
/* @__PURE__ */ s(
|
|
4010
|
-
|
|
4032
|
+
Qn,
|
|
4011
4033
|
{
|
|
4012
4034
|
size: 24,
|
|
4013
4035
|
weight: "duotone",
|
|
@@ -4016,11 +4038,11 @@ const mi = ({
|
|
|
4016
4038
|
"data-testid": "age-safety-system-message-icon"
|
|
4017
4039
|
}
|
|
4018
4040
|
),
|
|
4019
|
-
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("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:
|
|
4041
|
+
/* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("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: Pi(i) }) })
|
|
4020
4042
|
]
|
|
4021
4043
|
}
|
|
4022
4044
|
),
|
|
4023
|
-
!t && /* @__PURE__ */ s(
|
|
4045
|
+
!t && /* @__PURE__ */ s(Xe, { message: e.message })
|
|
4024
4046
|
] });
|
|
4025
4047
|
}
|
|
4026
4048
|
return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -4029,9 +4051,9 @@ const mi = ({
|
|
|
4029
4051
|
/* @__PURE__ */ s("p", { children: e.message.text }),
|
|
4030
4052
|
/* @__PURE__ */ s("div", { className: "str-chat__message--system__line" })
|
|
4031
4053
|
] }),
|
|
4032
|
-
!t && /* @__PURE__ */ s(
|
|
4054
|
+
!t && /* @__PURE__ */ s(Xe, { message: e.message })
|
|
4033
4055
|
] });
|
|
4034
|
-
}, Ds =
|
|
4056
|
+
}, Ds = ct(!1), st = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
|
|
4035
4057
|
"animateTransform",
|
|
4036
4058
|
{
|
|
4037
4059
|
attributeName: "transform",
|
|
@@ -4041,17 +4063,17 @@ const mi = ({
|
|
|
4041
4063
|
begin: `${120 * t}ms`,
|
|
4042
4064
|
repeatCount: "indefinite"
|
|
4043
4065
|
}
|
|
4044
|
-
) }),
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
]),
|
|
4066
|
+
) }), $i = /* @__PURE__ */ new Set([
|
|
4067
|
+
Ke.Thinking,
|
|
4068
|
+
Ke.Generating,
|
|
4069
|
+
Ke.ExternalSources
|
|
4070
|
+
]), Bi = ({ threadList: e }) => {
|
|
4049
4071
|
var b, v;
|
|
4050
|
-
const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } =
|
|
4051
|
-
if (!e && l &&
|
|
4052
|
-
const x =
|
|
4072
|
+
const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } = Nn(), { aiState: o } = yn(t), l = Te(Ds);
|
|
4073
|
+
if (!e && l && $i.has(o)) {
|
|
4074
|
+
const x = Ui(t, (b = r.user) == null ? void 0 : b.id);
|
|
4053
4075
|
return /* @__PURE__ */ s(
|
|
4054
|
-
|
|
4076
|
+
ss,
|
|
4055
4077
|
{
|
|
4056
4078
|
avatarId: (x == null ? void 0 : x.id) ?? "ai-agent",
|
|
4057
4079
|
avatarName: (x == null ? void 0 : x.name) ?? (x == null ? void 0 : x.id) ?? "Agent",
|
|
@@ -4067,25 +4089,25 @@ const mi = ({
|
|
|
4067
4089
|
var _;
|
|
4068
4090
|
return (p == null ? void 0 : p.id) !== ((_ = r.user) == null ? void 0 : _.id) && !x;
|
|
4069
4091
|
}
|
|
4070
|
-
),
|
|
4092
|
+
), f = e ? Object.values(i).filter(
|
|
4071
4093
|
({ parent_id: x, user: p }) => {
|
|
4072
4094
|
var _;
|
|
4073
4095
|
return (p == null ? void 0 : p.id) !== ((_ = r.user) == null ? void 0 : _.id) && x === (a == null ? void 0 : a.id);
|
|
4074
4096
|
}
|
|
4075
|
-
) : [], h = e ?
|
|
4097
|
+
) : [], h = e ? f : m;
|
|
4076
4098
|
if (!h.length)
|
|
4077
4099
|
return null;
|
|
4078
|
-
const
|
|
4100
|
+
const g = (v = h[0]) == null ? void 0 : v.user, c = g != null && g.id && t.state.members[g.id] ? t.state.members[g.id].user : void 0;
|
|
4079
4101
|
return /* @__PURE__ */ s(
|
|
4080
|
-
|
|
4102
|
+
ss,
|
|
4081
4103
|
{
|
|
4082
|
-
avatarId: (
|
|
4083
|
-
avatarName: (
|
|
4084
|
-
avatarImage: (
|
|
4104
|
+
avatarId: (g == null ? void 0 : g.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
4105
|
+
avatarName: (g == null ? void 0 : g.name) ?? (c == null ? void 0 : c.name) ?? (g == null ? void 0 : g.id) ?? "Typing user",
|
|
4106
|
+
avatarImage: (g == null ? void 0 : g.image) ?? (c == null ? void 0 : c.image),
|
|
4085
4107
|
testId: "typing-indicator"
|
|
4086
4108
|
}
|
|
4087
4109
|
);
|
|
4088
|
-
},
|
|
4110
|
+
}, ss = ({
|
|
4089
4111
|
avatarId: e,
|
|
4090
4112
|
avatarName: t,
|
|
4091
4113
|
avatarImage: n,
|
|
@@ -4120,16 +4142,16 @@ const mi = ({
|
|
|
4120
4142
|
height: "13",
|
|
4121
4143
|
overflow: "visible",
|
|
4122
4144
|
children: [
|
|
4123
|
-
/* @__PURE__ */ s(
|
|
4124
|
-
/* @__PURE__ */ s(
|
|
4125
|
-
/* @__PURE__ */ s(
|
|
4145
|
+
/* @__PURE__ */ s(st, { cx: "4", index: 0 }),
|
|
4146
|
+
/* @__PURE__ */ s(st, { cx: "16", index: 1 }),
|
|
4147
|
+
/* @__PURE__ */ s(st, { cx: "28", index: 2 })
|
|
4126
4148
|
]
|
|
4127
4149
|
}
|
|
4128
4150
|
) }) }) }) }) })
|
|
4129
4151
|
] })
|
|
4130
4152
|
}
|
|
4131
4153
|
);
|
|
4132
|
-
function
|
|
4154
|
+
function Ui(e, t) {
|
|
4133
4155
|
var a;
|
|
4134
4156
|
const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
4135
4157
|
for (const r of Object.values(n)) {
|
|
@@ -4138,7 +4160,7 @@ function Fi(e, t) {
|
|
|
4138
4160
|
return i;
|
|
4139
4161
|
}
|
|
4140
4162
|
}
|
|
4141
|
-
const
|
|
4163
|
+
const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ u(
|
|
4142
4164
|
"div",
|
|
4143
4165
|
{
|
|
4144
4166
|
className: y("flex items-center justify-center h-full", e),
|
|
@@ -4181,12 +4203,12 @@ const Pi = () => null, Oi = ({ className: e, message: t }) => /* @__PURE__ */ u(
|
|
|
4181
4203
|
t && /* @__PURE__ */ s("span", { className: "text-stone", children: t })
|
|
4182
4204
|
]
|
|
4183
4205
|
}
|
|
4184
|
-
),
|
|
4185
|
-
/* @__PURE__ */ s(
|
|
4206
|
+
), Ve = V.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ u("div", { className: "flex items-center", children: [
|
|
4207
|
+
/* @__PURE__ */ s(Vi, { className: "w-6 h-6" }),
|
|
4186
4208
|
/* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
4187
4209
|
] }) }));
|
|
4188
|
-
|
|
4189
|
-
const
|
|
4210
|
+
Ve.displayName = "LoadingState";
|
|
4211
|
+
const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Oe = "Replies instantly with AI assistant", Gi = ({
|
|
4190
4212
|
onBack: e,
|
|
4191
4213
|
showBackButton: t,
|
|
4192
4214
|
showStarButton: n = !1,
|
|
@@ -4197,29 +4219,29 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4197
4219
|
showBlockParticipant: l = !0,
|
|
4198
4220
|
showReportParticipant: d = !0,
|
|
4199
4221
|
onDeleteConversationClick: m,
|
|
4200
|
-
onBlockParticipantClick:
|
|
4222
|
+
onBlockParticipantClick: f,
|
|
4201
4223
|
onReportParticipantClick: h,
|
|
4202
|
-
customChannelActions:
|
|
4224
|
+
customChannelActions: g,
|
|
4203
4225
|
renderChannelActions: c,
|
|
4204
4226
|
showChannelInfo: b = !0,
|
|
4205
4227
|
onParticipantNameClick: v,
|
|
4206
4228
|
renderHeaderTitleBadges: x
|
|
4207
4229
|
}) => {
|
|
4208
4230
|
var E, I, T, M, P, $;
|
|
4209
|
-
const { channel: p } = oe(), { client: _ } =
|
|
4231
|
+
const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
|
|
4210
4232
|
() => {
|
|
4211
4233
|
var j;
|
|
4212
|
-
return
|
|
4234
|
+
return He(
|
|
4213
4235
|
(j = p.state) == null ? void 0 : j.members,
|
|
4214
4236
|
_ == null ? void 0 : _.userID,
|
|
4215
4237
|
p.type
|
|
4216
4238
|
);
|
|
4217
4239
|
},
|
|
4218
4240
|
[(E = p.state) == null ? void 0 : E.members, _ == null ? void 0 : _.userID, p.type]
|
|
4219
|
-
), k =
|
|
4241
|
+
), k = mt(w == null ? void 0 : w.user), D = (I = w == null ? void 0 : w.user) == null ? void 0 : I.image, S = ut(p), R = x == null ? void 0 : x({
|
|
4220
4242
|
channel: p,
|
|
4221
4243
|
participant: w
|
|
4222
|
-
}), O = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", F = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90",
|
|
4244
|
+
}), O = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", F = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", L = /* @__PURE__ */ u(se, { children: [
|
|
4223
4245
|
/* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: k }),
|
|
4224
4246
|
R && /* @__PURE__ */ s("span", { className: "shrink-0", children: R })
|
|
4225
4247
|
] }), C = async () => {
|
|
@@ -4238,14 +4260,14 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4238
4260
|
"button",
|
|
4239
4261
|
{
|
|
4240
4262
|
className: y(
|
|
4241
|
-
|
|
4263
|
+
ve,
|
|
4242
4264
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
4243
4265
|
),
|
|
4244
4266
|
onClick: e || (() => {
|
|
4245
4267
|
}),
|
|
4246
4268
|
type: "button",
|
|
4247
4269
|
"aria-label": "Back to conversations",
|
|
4248
|
-
children: /* @__PURE__ */ s(
|
|
4270
|
+
children: /* @__PURE__ */ s(at, { className: "size-5 text-black/90" })
|
|
4249
4271
|
}
|
|
4250
4272
|
) }),
|
|
4251
4273
|
/* @__PURE__ */ s(
|
|
@@ -4269,19 +4291,19 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4269
4291
|
{
|
|
4270
4292
|
id: ((T = w == null ? void 0 : w.user) == null ? void 0 : T.id) || p.id || "unknown",
|
|
4271
4293
|
name: k,
|
|
4272
|
-
image:
|
|
4294
|
+
image: D,
|
|
4273
4295
|
starred: n && S,
|
|
4274
4296
|
dmAgentEnabled: a,
|
|
4275
4297
|
size: 48
|
|
4276
4298
|
}
|
|
4277
4299
|
),
|
|
4278
4300
|
/* @__PURE__ */ u("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
4279
|
-
|
|
4280
|
-
/* @__PURE__ */ s(
|
|
4301
|
+
L,
|
|
4302
|
+
/* @__PURE__ */ s(xe, { className: "size-3 shrink-0", weight: "bold" })
|
|
4281
4303
|
] }),
|
|
4282
4304
|
a && /* @__PURE__ */ u("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4283
|
-
/* @__PURE__ */ s(
|
|
4284
|
-
/* @__PURE__ */ s("span", { children:
|
|
4305
|
+
/* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
|
|
4306
|
+
/* @__PURE__ */ s("span", { children: Oe })
|
|
4285
4307
|
] })
|
|
4286
4308
|
]
|
|
4287
4309
|
}
|
|
@@ -4291,16 +4313,16 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4291
4313
|
{
|
|
4292
4314
|
id: ((M = w == null ? void 0 : w.user) == null ? void 0 : M.id) || p.id || "unknown",
|
|
4293
4315
|
name: k,
|
|
4294
|
-
image:
|
|
4316
|
+
image: D,
|
|
4295
4317
|
starred: n && S,
|
|
4296
4318
|
dmAgentEnabled: a,
|
|
4297
4319
|
size: 48
|
|
4298
4320
|
}
|
|
4299
4321
|
),
|
|
4300
4322
|
/* @__PURE__ */ u("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
4301
|
-
|
|
4323
|
+
L,
|
|
4302
4324
|
/* @__PURE__ */ s(
|
|
4303
|
-
|
|
4325
|
+
xe,
|
|
4304
4326
|
{
|
|
4305
4327
|
className: "invisible size-3 shrink-0",
|
|
4306
4328
|
weight: "bold"
|
|
@@ -4308,8 +4330,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4308
4330
|
)
|
|
4309
4331
|
] }),
|
|
4310
4332
|
a && /* @__PURE__ */ u("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4311
|
-
/* @__PURE__ */ s(
|
|
4312
|
-
/* @__PURE__ */ s("span", { children:
|
|
4333
|
+
/* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
|
|
4334
|
+
/* @__PURE__ */ s("span", { children: Oe })
|
|
4313
4335
|
] })
|
|
4314
4336
|
] })
|
|
4315
4337
|
}
|
|
@@ -4318,12 +4340,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4318
4340
|
n && /* @__PURE__ */ s(
|
|
4319
4341
|
"button",
|
|
4320
4342
|
{
|
|
4321
|
-
className:
|
|
4343
|
+
className: ve,
|
|
4322
4344
|
onClick: C,
|
|
4323
4345
|
type: "button",
|
|
4324
4346
|
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
4325
4347
|
children: /* @__PURE__ */ s(
|
|
4326
|
-
|
|
4348
|
+
Ie,
|
|
4327
4349
|
{
|
|
4328
4350
|
className: y("size-5", {
|
|
4329
4351
|
"text-yellow-600": S,
|
|
@@ -4335,7 +4357,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4335
4357
|
}
|
|
4336
4358
|
),
|
|
4337
4359
|
b && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4338
|
-
|
|
4360
|
+
it,
|
|
4339
4361
|
{
|
|
4340
4362
|
channel: p,
|
|
4341
4363
|
participant: w,
|
|
@@ -4345,10 +4367,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4345
4367
|
onLeaveConversation: r,
|
|
4346
4368
|
onBlockParticipant: i,
|
|
4347
4369
|
onDeleteConversationClick: m,
|
|
4348
|
-
onBlockParticipantClick:
|
|
4370
|
+
onBlockParticipantClick: f,
|
|
4349
4371
|
onReportParticipantClick: h,
|
|
4350
|
-
customChannelActions:
|
|
4351
|
-
triggerClassName: y(
|
|
4372
|
+
customChannelActions: g,
|
|
4373
|
+
triggerClassName: y(ve, "bg-[#F1F0EE]")
|
|
4352
4374
|
}
|
|
4353
4375
|
))
|
|
4354
4376
|
] })
|
|
@@ -4359,13 +4381,13 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4359
4381
|
"button",
|
|
4360
4382
|
{
|
|
4361
4383
|
className: y(
|
|
4362
|
-
|
|
4384
|
+
ve,
|
|
4363
4385
|
"messaging-channel-view-back-button-desktop"
|
|
4364
4386
|
),
|
|
4365
4387
|
type: "button",
|
|
4366
4388
|
onClick: e,
|
|
4367
4389
|
"aria-label": "Back to conversations",
|
|
4368
|
-
children: /* @__PURE__ */ s(
|
|
4390
|
+
children: /* @__PURE__ */ s(at, { className: "size-5 text-black/90" })
|
|
4369
4391
|
}
|
|
4370
4392
|
),
|
|
4371
4393
|
v ? /* @__PURE__ */ u(
|
|
@@ -4384,7 +4406,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4384
4406
|
{
|
|
4385
4407
|
id: ((P = w == null ? void 0 : w.user) == null ? void 0 : P.id) || p.id || "unknown",
|
|
4386
4408
|
name: k,
|
|
4387
|
-
image:
|
|
4409
|
+
image: D,
|
|
4388
4410
|
starred: n && S,
|
|
4389
4411
|
dmAgentEnabled: a,
|
|
4390
4412
|
size: 48
|
|
@@ -4392,12 +4414,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4392
4414
|
),
|
|
4393
4415
|
/* @__PURE__ */ u("div", { className: "min-w-0", children: [
|
|
4394
4416
|
/* @__PURE__ */ u("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4395
|
-
|
|
4396
|
-
/* @__PURE__ */ s(
|
|
4417
|
+
L,
|
|
4418
|
+
/* @__PURE__ */ s(xe, { className: "size-4 shrink-0", weight: "bold" })
|
|
4397
4419
|
] }),
|
|
4398
4420
|
a && /* @__PURE__ */ u("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4399
|
-
/* @__PURE__ */ s(
|
|
4400
|
-
/* @__PURE__ */ s("span", { className: "truncate", children:
|
|
4421
|
+
/* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
|
|
4422
|
+
/* @__PURE__ */ s("span", { className: "truncate", children: Oe })
|
|
4401
4423
|
] })
|
|
4402
4424
|
] })
|
|
4403
4425
|
]
|
|
@@ -4408,7 +4430,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4408
4430
|
{
|
|
4409
4431
|
id: (($ = w == null ? void 0 : w.user) == null ? void 0 : $.id) || p.id || "unknown",
|
|
4410
4432
|
name: k,
|
|
4411
|
-
image:
|
|
4433
|
+
image: D,
|
|
4412
4434
|
starred: n && S,
|
|
4413
4435
|
dmAgentEnabled: a,
|
|
4414
4436
|
size: 48
|
|
@@ -4416,9 +4438,9 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4416
4438
|
),
|
|
4417
4439
|
/* @__PURE__ */ u("div", { className: "min-w-0", children: [
|
|
4418
4440
|
/* @__PURE__ */ u("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4419
|
-
|
|
4441
|
+
L,
|
|
4420
4442
|
/* @__PURE__ */ s(
|
|
4421
|
-
|
|
4443
|
+
xe,
|
|
4422
4444
|
{
|
|
4423
4445
|
className: "invisible size-4 shrink-0",
|
|
4424
4446
|
weight: "bold"
|
|
@@ -4426,8 +4448,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4426
4448
|
)
|
|
4427
4449
|
] }),
|
|
4428
4450
|
a && /* @__PURE__ */ u("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4429
|
-
/* @__PURE__ */ s(
|
|
4430
|
-
/* @__PURE__ */ s("span", { className: "truncate", children:
|
|
4451
|
+
/* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
|
|
4452
|
+
/* @__PURE__ */ s("span", { className: "truncate", children: Oe })
|
|
4431
4453
|
] })
|
|
4432
4454
|
] })
|
|
4433
4455
|
] })
|
|
@@ -4436,12 +4458,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4436
4458
|
n && /* @__PURE__ */ s(
|
|
4437
4459
|
"button",
|
|
4438
4460
|
{
|
|
4439
|
-
className:
|
|
4461
|
+
className: ve,
|
|
4440
4462
|
onClick: C,
|
|
4441
4463
|
type: "button",
|
|
4442
4464
|
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
4443
4465
|
children: /* @__PURE__ */ s(
|
|
4444
|
-
|
|
4466
|
+
Ie,
|
|
4445
4467
|
{
|
|
4446
4468
|
className: y("size-6", {
|
|
4447
4469
|
"text-yellow-600": S,
|
|
@@ -4453,7 +4475,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4453
4475
|
}
|
|
4454
4476
|
),
|
|
4455
4477
|
b && (c !== void 0 ? c : /* @__PURE__ */ s(
|
|
4456
|
-
|
|
4478
|
+
it,
|
|
4457
4479
|
{
|
|
4458
4480
|
channel: p,
|
|
4459
4481
|
participant: w,
|
|
@@ -4463,16 +4485,16 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4463
4485
|
onLeaveConversation: r,
|
|
4464
4486
|
onBlockParticipant: i,
|
|
4465
4487
|
onDeleteConversationClick: m,
|
|
4466
|
-
onBlockParticipantClick:
|
|
4488
|
+
onBlockParticipantClick: f,
|
|
4467
4489
|
onReportParticipantClick: h,
|
|
4468
|
-
customChannelActions:
|
|
4469
|
-
triggerClassName:
|
|
4490
|
+
customChannelActions: g,
|
|
4491
|
+
triggerClassName: ve
|
|
4470
4492
|
}
|
|
4471
4493
|
))
|
|
4472
4494
|
] })
|
|
4473
4495
|
] })
|
|
4474
4496
|
] });
|
|
4475
|
-
},
|
|
4497
|
+
}, Hi = ({
|
|
4476
4498
|
onBack: e,
|
|
4477
4499
|
showBackButton: t,
|
|
4478
4500
|
renderMessageInputActions: n,
|
|
@@ -4483,9 +4505,9 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4483
4505
|
showDeleteConversation: l = !0,
|
|
4484
4506
|
onDeleteConversationClick: d,
|
|
4485
4507
|
onBlockParticipantClick: m,
|
|
4486
|
-
onReportParticipantClick:
|
|
4508
|
+
onReportParticipantClick: f,
|
|
4487
4509
|
showBlockParticipant: h = !0,
|
|
4488
|
-
showReportParticipant:
|
|
4510
|
+
showReportParticipant: g = !0,
|
|
4489
4511
|
composerDisabled: c = !1,
|
|
4490
4512
|
composerDisabledReason: b,
|
|
4491
4513
|
showStarButton: v = !1,
|
|
@@ -4494,18 +4516,18 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4494
4516
|
renderHeaderTitleBadges: _,
|
|
4495
4517
|
customChannelActions: w,
|
|
4496
4518
|
renderChannelActions: k,
|
|
4497
|
-
renderMessage:
|
|
4519
|
+
renderMessage: D,
|
|
4498
4520
|
dmAgentEnabled: S = !1,
|
|
4499
4521
|
viewerLanguage: R,
|
|
4500
4522
|
showChannelInfo: O = !0,
|
|
4501
4523
|
onParticipantNameClick: F,
|
|
4502
|
-
composerInput:
|
|
4524
|
+
composerInput: L
|
|
4503
4525
|
}) => {
|
|
4504
4526
|
var N, A, H, q;
|
|
4505
|
-
const { channel: C } = oe(), { client: E } =
|
|
4527
|
+
const { channel: C } = oe(), { client: E } = fe(), I = V.useMemo(
|
|
4506
4528
|
() => {
|
|
4507
4529
|
var Y;
|
|
4508
|
-
return
|
|
4530
|
+
return He(
|
|
4509
4531
|
(Y = C.state) == null ? void 0 : Y.members,
|
|
4510
4532
|
E == null ? void 0 : E.userID,
|
|
4511
4533
|
C.type
|
|
@@ -4522,7 +4544,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4522
4544
|
}, [E == null ? void 0 : E.userID, (A = C.state) == null ? void 0 : A.members]), M = ((H = T == null ? void 0 : T.user) == null ? void 0 : H.is_account) ?? (T == null ? void 0 : T.is_account), P = ((q = I == null ? void 0 : I.user) == null ? void 0 : q.is_account) ?? (I == null ? void 0 : I.is_account), $ = S && M === !1 && P === !0, j = C.state.messages.some(
|
|
4523
4545
|
(Y) => Y.type !== "deleted"
|
|
4524
4546
|
), Q = p ? /* @__PURE__ */ s(V.Fragment, { children: p() }, "lt-channel-banner") : null, ee = F ? /* @__PURE__ */ s(
|
|
4525
|
-
|
|
4547
|
+
ga,
|
|
4526
4548
|
{
|
|
4527
4549
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
4528
4550
|
onBack: e,
|
|
@@ -4534,41 +4556,40 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4534
4556
|
onBlockParticipant: o,
|
|
4535
4557
|
showDeleteConversation: l,
|
|
4536
4558
|
showBlockParticipant: h,
|
|
4537
|
-
showReportParticipant:
|
|
4559
|
+
showReportParticipant: g,
|
|
4538
4560
|
onDeleteConversationClick: d,
|
|
4539
4561
|
onBlockParticipantClick: m,
|
|
4540
|
-
onReportParticipantClick:
|
|
4562
|
+
onReportParticipantClick: f,
|
|
4541
4563
|
customChannelActions: w,
|
|
4542
4564
|
renderChannelActions: k,
|
|
4543
4565
|
onParticipantNameClick: F
|
|
4544
4566
|
}
|
|
4545
4567
|
) : null, X = J(
|
|
4546
4568
|
(Y) => {
|
|
4547
|
-
const { message: B } =
|
|
4548
|
-
|
|
4569
|
+
const { message: B } = Ne("ChannelView"), W = /* @__PURE__ */ s(
|
|
4570
|
+
wi,
|
|
4549
4571
|
{
|
|
4550
4572
|
...Y,
|
|
4551
4573
|
chatbotVotingEnabled: x,
|
|
4552
4574
|
viewerLanguage: R
|
|
4553
4575
|
}
|
|
4554
4576
|
);
|
|
4555
|
-
return !
|
|
4577
|
+
return !D || !B ? W : D(W, B);
|
|
4556
4578
|
},
|
|
4557
|
-
[x,
|
|
4579
|
+
[x, D, R]
|
|
4558
4580
|
);
|
|
4559
4581
|
return /* @__PURE__ */ s(se, { children: /* @__PURE__ */ s(
|
|
4560
|
-
|
|
4582
|
+
Cn,
|
|
4561
4583
|
{
|
|
4562
4584
|
overrides: {
|
|
4563
4585
|
Message: X,
|
|
4564
|
-
MessageActions:
|
|
4565
|
-
UnreadMessagesNotification: () => null,
|
|
4586
|
+
MessageActions: yi,
|
|
4566
4587
|
UnreadMessagesSeparator: () => null
|
|
4567
4588
|
},
|
|
4568
|
-
children: /* @__PURE__ */ u(
|
|
4589
|
+
children: /* @__PURE__ */ u(Sn, { children: [
|
|
4569
4590
|
!F && /* @__PURE__ */ u(se, { children: [
|
|
4570
4591
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
|
|
4571
|
-
|
|
4592
|
+
Gi,
|
|
4572
4593
|
{
|
|
4573
4594
|
onBack: e,
|
|
4574
4595
|
showBackButton: t,
|
|
@@ -4579,10 +4600,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4579
4600
|
onBlockParticipant: o,
|
|
4580
4601
|
showDeleteConversation: l,
|
|
4581
4602
|
showBlockParticipant: h,
|
|
4582
|
-
showReportParticipant:
|
|
4603
|
+
showReportParticipant: g,
|
|
4583
4604
|
onDeleteConversationClick: d,
|
|
4584
4605
|
onBlockParticipantClick: m,
|
|
4585
|
-
onReportParticipantClick:
|
|
4606
|
+
onReportParticipantClick: f,
|
|
4586
4607
|
customChannelActions: w,
|
|
4587
4608
|
renderChannelActions: k,
|
|
4588
4609
|
renderHeaderTitleBadges: _
|
|
@@ -4600,7 +4621,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4600
4621
|
Q
|
|
4601
4622
|
] }) }),
|
|
4602
4623
|
/* @__PURE__ */ s(
|
|
4603
|
-
|
|
4624
|
+
En,
|
|
4604
4625
|
{
|
|
4605
4626
|
head: F && j ? /* @__PURE__ */ u("div", { className: "sticky top-0 z-10", children: [
|
|
4606
4627
|
ee,
|
|
@@ -4616,7 +4637,7 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4616
4637
|
),
|
|
4617
4638
|
r ? /* @__PURE__ */ s(V.Fragment, { children: r(C) }, "lt-channel-conversation-footer") : null,
|
|
4618
4639
|
/* @__PURE__ */ s(
|
|
4619
|
-
|
|
4640
|
+
Ti,
|
|
4620
4641
|
{
|
|
4621
4642
|
...n && {
|
|
4622
4643
|
renderActions: () => n == null ? void 0 : n(C)
|
|
@@ -4624,14 +4645,14 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4624
4645
|
renderFooter: () => a == null ? void 0 : a(C),
|
|
4625
4646
|
disabled: c,
|
|
4626
4647
|
disabledReason: b,
|
|
4627
|
-
composerInput:
|
|
4648
|
+
composerInput: L
|
|
4628
4649
|
},
|
|
4629
4650
|
"lt-channel-message-input"
|
|
4630
4651
|
)
|
|
4631
4652
|
] })
|
|
4632
4653
|
}
|
|
4633
4654
|
) });
|
|
4634
|
-
},
|
|
4655
|
+
}, zs = V.memo(
|
|
4635
4656
|
({
|
|
4636
4657
|
channel: e,
|
|
4637
4658
|
onBack: t,
|
|
@@ -4642,10 +4663,10 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4642
4663
|
onLeaveConversation: o,
|
|
4643
4664
|
onBlockParticipant: l,
|
|
4644
4665
|
className: d,
|
|
4645
|
-
CustomChannelEmptyState: m =
|
|
4646
|
-
showDeleteConversation:
|
|
4666
|
+
CustomChannelEmptyState: m = ji,
|
|
4667
|
+
showDeleteConversation: f = !0,
|
|
4647
4668
|
onDeleteConversationClick: h,
|
|
4648
|
-
onBlockParticipantClick:
|
|
4669
|
+
onBlockParticipantClick: g,
|
|
4649
4670
|
onReportParticipantClick: c,
|
|
4650
4671
|
showBlockParticipant: b = !0,
|
|
4651
4672
|
showReportParticipant: v = !0,
|
|
@@ -4654,12 +4675,12 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4654
4675
|
dmAgentEnabled: _,
|
|
4655
4676
|
messageMetadata: w,
|
|
4656
4677
|
onMessageSent: k,
|
|
4657
|
-
showStarButton:
|
|
4678
|
+
showStarButton: D = !1,
|
|
4658
4679
|
chatbotVotingEnabled: S = !1,
|
|
4659
4680
|
renderChannelBanner: R,
|
|
4660
4681
|
renderHeaderTitleBadges: O,
|
|
4661
4682
|
customChannelActions: F,
|
|
4662
|
-
renderChannelActions:
|
|
4683
|
+
renderChannelActions: L,
|
|
4663
4684
|
renderMessage: C,
|
|
4664
4685
|
onMessageLinkClick: E,
|
|
4665
4686
|
sendButton: I,
|
|
@@ -4709,19 +4730,19 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4709
4730
|
d
|
|
4710
4731
|
),
|
|
4711
4732
|
children: /* @__PURE__ */ s(Ds.Provider, { value: _ ?? !1, children: /* @__PURE__ */ s(
|
|
4712
|
-
|
|
4733
|
+
kn,
|
|
4713
4734
|
{
|
|
4714
4735
|
channel: e,
|
|
4715
|
-
MessageSystem:
|
|
4736
|
+
MessageSystem: Oi,
|
|
4716
4737
|
EmptyStateIndicator: m,
|
|
4717
|
-
LoadingIndicator:
|
|
4718
|
-
DateSeparator:
|
|
4719
|
-
TypingIndicator:
|
|
4738
|
+
LoadingIndicator: Ve,
|
|
4739
|
+
DateSeparator: pa,
|
|
4740
|
+
TypingIndicator: Bi,
|
|
4720
4741
|
doSendMessageRequest: Q,
|
|
4721
4742
|
...I ? { SendButton: I } : {},
|
|
4722
4743
|
...T ? { AttachmentPreviewList: T } : {},
|
|
4723
4744
|
children: /* @__PURE__ */ s(
|
|
4724
|
-
|
|
4745
|
+
Hi,
|
|
4725
4746
|
{
|
|
4726
4747
|
onBack: t,
|
|
4727
4748
|
showBackButton: n,
|
|
@@ -4731,21 +4752,21 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4731
4752
|
onLeaveConversation: o,
|
|
4732
4753
|
onBlockParticipant: l,
|
|
4733
4754
|
CustomChannelEmptyState: m,
|
|
4734
|
-
showDeleteConversation:
|
|
4755
|
+
showDeleteConversation: f,
|
|
4735
4756
|
onDeleteConversationClick: h,
|
|
4736
|
-
onBlockParticipantClick:
|
|
4757
|
+
onBlockParticipantClick: g,
|
|
4737
4758
|
onReportParticipantClick: c,
|
|
4738
4759
|
showBlockParticipant: b,
|
|
4739
4760
|
showReportParticipant: v,
|
|
4740
4761
|
composerDisabled: x,
|
|
4741
4762
|
composerDisabledReason: p,
|
|
4742
|
-
showStarButton:
|
|
4763
|
+
showStarButton: D,
|
|
4743
4764
|
dmAgentEnabled: _,
|
|
4744
4765
|
chatbotVotingEnabled: S,
|
|
4745
4766
|
renderChannelBanner: R,
|
|
4746
4767
|
renderHeaderTitleBadges: O,
|
|
4747
4768
|
customChannelActions: F,
|
|
4748
|
-
renderChannelActions:
|
|
4769
|
+
renderChannelActions: L,
|
|
4749
4770
|
renderMessage: C,
|
|
4750
4771
|
viewerLanguage: M,
|
|
4751
4772
|
showChannelInfo: P,
|
|
@@ -4759,8 +4780,8 @@ const be = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4759
4780
|
);
|
|
4760
4781
|
}
|
|
4761
4782
|
);
|
|
4762
|
-
|
|
4763
|
-
const
|
|
4783
|
+
zs.displayName = "ChannelView";
|
|
4784
|
+
const Ce = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
|
|
4764
4785
|
/* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
4765
4786
|
/* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
4766
4787
|
/* @__PURE__ */ s("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -4774,8 +4795,8 @@ const ke = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
|
|
|
4774
4795
|
}
|
|
4775
4796
|
)
|
|
4776
4797
|
] }) }));
|
|
4777
|
-
|
|
4778
|
-
const
|
|
4798
|
+
Ce.displayName = "ErrorState";
|
|
4799
|
+
const bl = ({
|
|
4779
4800
|
capabilities: e = {},
|
|
4780
4801
|
renderMessageInputActions: t,
|
|
4781
4802
|
renderConversationFooter: n,
|
|
@@ -4786,9 +4807,9 @@ const ml = ({
|
|
|
4786
4807
|
CustomChannelEmptyState: l,
|
|
4787
4808
|
onBlockParticipantClick: d,
|
|
4788
4809
|
onReportParticipantClick: m,
|
|
4789
|
-
dmAgentEnabled:
|
|
4810
|
+
dmAgentEnabled: f,
|
|
4790
4811
|
onMessageSent: h,
|
|
4791
|
-
chatbotVotingEnabled:
|
|
4812
|
+
chatbotVotingEnabled: g = !1,
|
|
4792
4813
|
viewerLanguage: c,
|
|
4793
4814
|
renderHeaderTitleBadges: b,
|
|
4794
4815
|
renderChannelBanner: v,
|
|
@@ -4797,18 +4818,18 @@ const ml = ({
|
|
|
4797
4818
|
onParticipantNameClick: _,
|
|
4798
4819
|
renderMessage: w,
|
|
4799
4820
|
onMessageLinkClick: k,
|
|
4800
|
-
showChannelInfo:
|
|
4821
|
+
showChannelInfo: D,
|
|
4801
4822
|
composerInput: S
|
|
4802
4823
|
}) => {
|
|
4803
4824
|
const {
|
|
4804
4825
|
client: R,
|
|
4805
4826
|
isConnected: O,
|
|
4806
4827
|
isLoading: F,
|
|
4807
|
-
error:
|
|
4828
|
+
error: L,
|
|
4808
4829
|
refreshConnection: C,
|
|
4809
4830
|
service: E,
|
|
4810
4831
|
debug: I
|
|
4811
|
-
} =
|
|
4832
|
+
} = ta(), [T, M] = U(null), [P, $] = U(null), [j, Q] = U(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
|
|
4812
4833
|
X.current = o;
|
|
4813
4834
|
const N = G(a);
|
|
4814
4835
|
N.current = a;
|
|
@@ -4826,7 +4847,7 @@ const ml = ({
|
|
|
4826
4847
|
A.current === W && (A.current = null);
|
|
4827
4848
|
};
|
|
4828
4849
|
(async () => {
|
|
4829
|
-
var De,
|
|
4850
|
+
var De, ze;
|
|
4830
4851
|
try {
|
|
4831
4852
|
I && console.log(
|
|
4832
4853
|
"[MessagingShell] Loading initial conversation with:",
|
|
@@ -4861,7 +4882,7 @@ const ml = ({
|
|
|
4861
4882
|
name: ue.name,
|
|
4862
4883
|
phone: ue.phone
|
|
4863
4884
|
});
|
|
4864
|
-
M(le), $(null), (
|
|
4885
|
+
M(le), $(null), (ze = N.current) == null || ze.call(N, le), I && console.log(
|
|
4865
4886
|
"[MessagingShell] Channel created and loaded:",
|
|
4866
4887
|
le.id
|
|
4867
4888
|
);
|
|
@@ -4885,14 +4906,14 @@ const ml = ({
|
|
|
4885
4906
|
var B;
|
|
4886
4907
|
M(null), Q(!0), (B = q.current) == null || B.call(q);
|
|
4887
4908
|
}, []);
|
|
4888
|
-
return F ? /* @__PURE__ */ s(
|
|
4889
|
-
|
|
4909
|
+
return F ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: C }) : !O || !R ? /* @__PURE__ */ s(
|
|
4910
|
+
Ce,
|
|
4890
4911
|
{
|
|
4891
4912
|
message: "Not connected to messaging service",
|
|
4892
4913
|
onBack: C
|
|
4893
4914
|
}
|
|
4894
|
-
) : P ? /* @__PURE__ */ s(
|
|
4895
|
-
|
|
4915
|
+
) : P ? /* @__PURE__ */ s(Ce, { message: P }) : j && !T ? /* @__PURE__ */ s(Ce, { message: "Conversation ended" }) : T ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
|
|
4916
|
+
zs,
|
|
4896
4917
|
{
|
|
4897
4918
|
channel: T,
|
|
4898
4919
|
renderMessageInputActions: t,
|
|
@@ -4904,9 +4925,9 @@ const ml = ({
|
|
|
4904
4925
|
showDeleteConversation: ee,
|
|
4905
4926
|
onBlockParticipantClick: d,
|
|
4906
4927
|
onReportParticipantClick: m,
|
|
4907
|
-
dmAgentEnabled:
|
|
4928
|
+
dmAgentEnabled: f,
|
|
4908
4929
|
onMessageSent: h,
|
|
4909
|
-
chatbotVotingEnabled:
|
|
4930
|
+
chatbotVotingEnabled: g,
|
|
4910
4931
|
viewerLanguage: c,
|
|
4911
4932
|
renderHeaderTitleBadges: b,
|
|
4912
4933
|
customChannelActions: x,
|
|
@@ -4914,19 +4935,19 @@ const ml = ({
|
|
|
4914
4935
|
onParticipantNameClick: _,
|
|
4915
4936
|
renderMessage: w,
|
|
4916
4937
|
onMessageLinkClick: k,
|
|
4917
|
-
showChannelInfo:
|
|
4938
|
+
showChannelInfo: D,
|
|
4918
4939
|
composerInput: S
|
|
4919
4940
|
},
|
|
4920
4941
|
T.id
|
|
4921
|
-
) }) }) : /* @__PURE__ */ s(
|
|
4942
|
+
) }) }) : /* @__PURE__ */ s(Ve, {});
|
|
4922
4943
|
};
|
|
4923
|
-
function
|
|
4944
|
+
function Yi(e) {
|
|
4924
4945
|
const t = e.state.pending_messages;
|
|
4925
4946
|
if (t != null && t.length)
|
|
4926
4947
|
for (const n of t)
|
|
4927
4948
|
e.state.addMessageSorted(n.message);
|
|
4928
4949
|
}
|
|
4929
|
-
const
|
|
4950
|
+
const Fs = V.createContext({
|
|
4930
4951
|
selectedChannel: void 0,
|
|
4931
4952
|
onChannelSelect: () => {
|
|
4932
4953
|
},
|
|
@@ -4934,18 +4955,18 @@ const zs = V.createContext({
|
|
|
4934
4955
|
renderMessagePreview: void 0,
|
|
4935
4956
|
channelPreview: void 0,
|
|
4936
4957
|
viewerLanguage: void 0
|
|
4937
|
-
}),
|
|
4958
|
+
}), qi = Fs.Provider, Wi = () => V.useContext(Fs), Xi = (e, t) => {
|
|
4938
4959
|
const n = new Date(
|
|
4939
4960
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4940
4961
|
), r = new Date(
|
|
4941
4962
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
4942
4963
|
).getTime() - n.getTime();
|
|
4943
4964
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
4944
|
-
},
|
|
4965
|
+
}, Ki = (e) => {
|
|
4945
4966
|
const t = /* @__PURE__ */ new Date();
|
|
4946
4967
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
4947
4968
|
return "Just now";
|
|
4948
|
-
const a =
|
|
4969
|
+
const a = Xi(e, t);
|
|
4949
4970
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
4950
4971
|
hour: "numeric",
|
|
4951
4972
|
minute: "2-digit",
|
|
@@ -4955,9 +4976,9 @@ const zs = V.createContext({
|
|
|
4955
4976
|
day: "numeric",
|
|
4956
4977
|
year: "2-digit"
|
|
4957
4978
|
});
|
|
4958
|
-
},
|
|
4979
|
+
}, Ps = V.memo(
|
|
4959
4980
|
(e) => {
|
|
4960
|
-
var O, F,
|
|
4981
|
+
var O, F, L;
|
|
4961
4982
|
const { channel: t, unread: n } = e, {
|
|
4962
4983
|
selectedChannel: a,
|
|
4963
4984
|
onChannelSelect: r,
|
|
@@ -4965,28 +4986,28 @@ const zs = V.createContext({
|
|
|
4965
4986
|
channelPreview: o,
|
|
4966
4987
|
renderMessagePreview: l,
|
|
4967
4988
|
viewerLanguage: d
|
|
4968
|
-
} =
|
|
4989
|
+
} = Wi(), { client: m } = fe(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = ut(t);
|
|
4969
4990
|
if (o)
|
|
4970
4991
|
return /* @__PURE__ */ s(
|
|
4971
4992
|
o,
|
|
4972
4993
|
{
|
|
4973
4994
|
...e,
|
|
4974
|
-
active:
|
|
4995
|
+
active: f,
|
|
4975
4996
|
selectedChannel: a,
|
|
4976
4997
|
onChannelSelect: r,
|
|
4977
4998
|
viewerLanguage: d
|
|
4978
4999
|
}
|
|
4979
5000
|
);
|
|
4980
|
-
const
|
|
5001
|
+
const g = () => {
|
|
4981
5002
|
t && r(t);
|
|
4982
5003
|
}, c = (C) => {
|
|
4983
5004
|
const E = C.key === "Enter" || C.key === " ", I = C.repeat;
|
|
4984
|
-
!E || I || (C.preventDefault(),
|
|
4985
|
-
}, b =
|
|
5005
|
+
!E || I || (C.preventDefault(), g());
|
|
5006
|
+
}, b = He(
|
|
4986
5007
|
(O = t == null ? void 0 : t.state) == null ? void 0 : O.members,
|
|
4987
5008
|
m == null ? void 0 : m.userID,
|
|
4988
5009
|
t == null ? void 0 : t.type
|
|
4989
|
-
), v =
|
|
5010
|
+
), v = mt(b == null ? void 0 : b.user), x = (F = b == null ? void 0 : b.user) == null ? void 0 : F.image, p = (() => {
|
|
4990
5011
|
var E;
|
|
4991
5012
|
const C = (E = t == null ? void 0 : t.state) == null ? void 0 : E.messages;
|
|
4992
5013
|
if (C != null && C.length) {
|
|
@@ -4995,7 +5016,7 @@ const zs = V.createContext({
|
|
|
4995
5016
|
}
|
|
4996
5017
|
})(), w = (() => {
|
|
4997
5018
|
var M;
|
|
4998
|
-
const C =
|
|
5019
|
+
const C = us({
|
|
4999
5020
|
message: p,
|
|
5000
5021
|
viewerLanguage: d
|
|
5001
5022
|
}), { custom_type: E, attachment_content_type: I } = (p == null ? void 0 : p.metadata) || {};
|
|
@@ -5012,10 +5033,10 @@ const zs = V.createContext({
|
|
|
5012
5033
|
if (C) return C;
|
|
5013
5034
|
const T = (M = p == null ? void 0 : p.attachments) == null ? void 0 : M[0];
|
|
5014
5035
|
return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
5015
|
-
})(), k = p != null && p.created_at ?
|
|
5036
|
+
})(), k = p != null && p.created_at ? Ki(new Date(p.created_at)) : "", D = p ? Be(p) : !1, S = l ? l(p, w) : `${D ? "✨ " : ""}${w}`, R = n ?? 0;
|
|
5016
5037
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
5017
5038
|
channelId: t == null ? void 0 : t.id,
|
|
5018
|
-
isSelected:
|
|
5039
|
+
isSelected: f,
|
|
5019
5040
|
participantName: v,
|
|
5020
5041
|
unreadCount: R,
|
|
5021
5042
|
hasTimestamp: !!k
|
|
@@ -5024,13 +5045,13 @@ const zs = V.createContext({
|
|
|
5024
5045
|
{
|
|
5025
5046
|
role: "button",
|
|
5026
5047
|
tabIndex: 0,
|
|
5027
|
-
onClick:
|
|
5048
|
+
onClick: g,
|
|
5028
5049
|
onKeyDown: c,
|
|
5029
5050
|
className: y(
|
|
5030
5051
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
5031
5052
|
{
|
|
5032
|
-
"bg-black/[0.04]":
|
|
5033
|
-
"hover:bg-black/[0.02]": !
|
|
5053
|
+
"bg-black/[0.04]": f,
|
|
5054
|
+
"hover:bg-black/[0.02]": !f
|
|
5034
5055
|
}
|
|
5035
5056
|
),
|
|
5036
5057
|
"data-dd-privacy": "mask",
|
|
@@ -5038,7 +5059,7 @@ const zs = V.createContext({
|
|
|
5038
5059
|
/* @__PURE__ */ s(
|
|
5039
5060
|
ne,
|
|
5040
5061
|
{
|
|
5041
|
-
id: ((
|
|
5062
|
+
id: ((L = b == null ? void 0 : b.user) == null ? void 0 : L.id) || t.id || "unknown",
|
|
5042
5063
|
name: v,
|
|
5043
5064
|
image: x,
|
|
5044
5065
|
size: 48,
|
|
@@ -5071,22 +5092,22 @@ const zs = V.createContext({
|
|
|
5071
5092
|
);
|
|
5072
5093
|
}
|
|
5073
5094
|
);
|
|
5074
|
-
|
|
5075
|
-
const
|
|
5095
|
+
Ps.displayName = "CustomChannelPreview";
|
|
5096
|
+
const Zi = { last_message_at: -1 }, Ji = V.memo(
|
|
5076
5097
|
({
|
|
5077
5098
|
onChannelSelect: e,
|
|
5078
5099
|
selectedChannel: t,
|
|
5079
5100
|
filters: n,
|
|
5080
5101
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
5081
5102
|
channelRenderFilterFn: r,
|
|
5082
|
-
sort: i =
|
|
5103
|
+
sort: i = Zi,
|
|
5083
5104
|
className: o,
|
|
5084
5105
|
customEmptyStateIndicator: l,
|
|
5085
|
-
channelListPaginator: d =
|
|
5106
|
+
channelListPaginator: d = Tn,
|
|
5086
5107
|
channelPreview: m,
|
|
5087
|
-
renderMessagePreview:
|
|
5108
|
+
renderMessagePreview: f,
|
|
5088
5109
|
viewerLanguage: h,
|
|
5089
|
-
lockChannelOrder:
|
|
5110
|
+
lockChannelOrder: g,
|
|
5090
5111
|
onMessageNewHandler: c,
|
|
5091
5112
|
onMessageNew: b,
|
|
5092
5113
|
onChannelVisible: v,
|
|
@@ -5095,10 +5116,10 @@ const Yi = { last_message_at: -1 }, qi = V.memo(
|
|
|
5095
5116
|
}) => {
|
|
5096
5117
|
const _ = V.useRef(0);
|
|
5097
5118
|
_.current++;
|
|
5098
|
-
const { debug: w = !1 } =
|
|
5119
|
+
const { debug: w = !1 } = dt(), k = V.useCallback(
|
|
5099
5120
|
(S) => {
|
|
5100
5121
|
for (const R of S)
|
|
5101
|
-
|
|
5122
|
+
Yi(R);
|
|
5102
5123
|
return r ? r(S) : S;
|
|
5103
5124
|
},
|
|
5104
5125
|
[r]
|
|
@@ -5108,13 +5129,13 @@ const Yi = { last_message_at: -1 }, qi = V.memo(
|
|
|
5108
5129
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
5109
5130
|
filters: n
|
|
5110
5131
|
});
|
|
5111
|
-
const
|
|
5132
|
+
const D = V.useMemo(
|
|
5112
5133
|
() => ({
|
|
5113
5134
|
selectedChannel: t,
|
|
5114
5135
|
onChannelSelect: e,
|
|
5115
5136
|
debug: w,
|
|
5116
5137
|
channelPreview: m,
|
|
5117
|
-
renderMessagePreview:
|
|
5138
|
+
renderMessagePreview: f,
|
|
5118
5139
|
viewerLanguage: h
|
|
5119
5140
|
}),
|
|
5120
5141
|
[
|
|
@@ -5122,7 +5143,7 @@ const Yi = { last_message_at: -1 }, qi = V.memo(
|
|
|
5122
5143
|
e,
|
|
5123
5144
|
w,
|
|
5124
5145
|
m,
|
|
5125
|
-
|
|
5146
|
+
f,
|
|
5126
5147
|
h
|
|
5127
5148
|
]
|
|
5128
5149
|
);
|
|
@@ -5133,22 +5154,22 @@ const Yi = { last_message_at: -1 }, qi = V.memo(
|
|
|
5133
5154
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
5134
5155
|
o
|
|
5135
5156
|
),
|
|
5136
|
-
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(
|
|
5137
|
-
|
|
5157
|
+
children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(qi, { value: D, children: /* @__PURE__ */ s(
|
|
5158
|
+
In,
|
|
5138
5159
|
{
|
|
5139
5160
|
filters: n,
|
|
5140
5161
|
sort: i,
|
|
5141
5162
|
options: { limit: 30 },
|
|
5142
5163
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
5143
5164
|
channelRenderFilterFn: k,
|
|
5144
|
-
lockChannelOrder:
|
|
5165
|
+
lockChannelOrder: g,
|
|
5145
5166
|
onMessageNewHandler: c,
|
|
5146
5167
|
onMessageNew: b,
|
|
5147
5168
|
onChannelVisible: v,
|
|
5148
5169
|
onAddedToChannel: x,
|
|
5149
5170
|
onChannelUpdated: p,
|
|
5150
5171
|
Paginator: d,
|
|
5151
|
-
Preview:
|
|
5172
|
+
Preview: Ps,
|
|
5152
5173
|
EmptyStateIndicator: l
|
|
5153
5174
|
},
|
|
5154
5175
|
`${JSON.stringify(n)}:${JSON.stringify(i)}`
|
|
@@ -5157,11 +5178,11 @@ const Yi = { last_message_at: -1 }, qi = V.memo(
|
|
|
5157
5178
|
);
|
|
5158
5179
|
}
|
|
5159
5180
|
);
|
|
5160
|
-
|
|
5161
|
-
const
|
|
5181
|
+
Ji.displayName = "ChannelList";
|
|
5182
|
+
const ns = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, Qi = {
|
|
5162
5183
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
5163
5184
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
5164
|
-
},
|
|
5185
|
+
}, el = ({ variant: e }) => /* @__PURE__ */ s(
|
|
5165
5186
|
"span",
|
|
5166
5187
|
{
|
|
5167
5188
|
"aria-hidden": "true",
|
|
@@ -5171,12 +5192,12 @@ const ss = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5171
5192
|
insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
|
|
5172
5193
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
5173
5194
|
transformOrigin: "center",
|
|
5174
|
-
backgroundColor:
|
|
5175
|
-
WebkitMask:
|
|
5176
|
-
mask:
|
|
5195
|
+
backgroundColor: Qi[e],
|
|
5196
|
+
WebkitMask: ns,
|
|
5197
|
+
mask: ns
|
|
5177
5198
|
}
|
|
5178
5199
|
}
|
|
5179
|
-
),
|
|
5200
|
+
), tl = {
|
|
5180
5201
|
sent: {
|
|
5181
5202
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
5182
5203
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -5185,7 +5206,7 @@ const ss = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5185
5206
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
5186
5207
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
5187
5208
|
}
|
|
5188
|
-
},
|
|
5209
|
+
}, Os = ({
|
|
5189
5210
|
variant: e,
|
|
5190
5211
|
text: t,
|
|
5191
5212
|
tail: n = !0,
|
|
@@ -5201,23 +5222,23 @@ const ss = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5201
5222
|
r
|
|
5202
5223
|
),
|
|
5203
5224
|
style: {
|
|
5204
|
-
...
|
|
5225
|
+
...tl[e],
|
|
5205
5226
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
5206
5227
|
isolation: "isolate"
|
|
5207
5228
|
},
|
|
5208
5229
|
children: [
|
|
5209
5230
|
a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
|
|
5210
5231
|
/* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
|
|
5211
|
-
n && /* @__PURE__ */ s(
|
|
5232
|
+
n && /* @__PURE__ */ s(el, { variant: e })
|
|
5212
5233
|
]
|
|
5213
5234
|
}
|
|
5214
|
-
),
|
|
5235
|
+
), sl = ({
|
|
5215
5236
|
text: e,
|
|
5216
5237
|
tail: t,
|
|
5217
5238
|
header: n,
|
|
5218
5239
|
className: a
|
|
5219
5240
|
}) => /* @__PURE__ */ s(
|
|
5220
|
-
|
|
5241
|
+
Os,
|
|
5221
5242
|
{
|
|
5222
5243
|
variant: "received",
|
|
5223
5244
|
text: e,
|
|
@@ -5225,10 +5246,10 @@ const ss = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5225
5246
|
header: n,
|
|
5226
5247
|
className: a
|
|
5227
5248
|
}
|
|
5228
|
-
),
|
|
5229
|
-
Sent:
|
|
5230
|
-
Received:
|
|
5231
|
-
},
|
|
5249
|
+
), nl = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Os, { variant: "sent", text: e, tail: t, className: n }), vl = {
|
|
5250
|
+
Sent: nl,
|
|
5251
|
+
Received: sl
|
|
5252
|
+
}, al = ({
|
|
5232
5253
|
question: e,
|
|
5233
5254
|
onClick: t,
|
|
5234
5255
|
loading: n = !1,
|
|
@@ -5250,7 +5271,7 @@ const ss = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5250
5271
|
),
|
|
5251
5272
|
children: e
|
|
5252
5273
|
}
|
|
5253
|
-
),
|
|
5274
|
+
), xl = ({
|
|
5254
5275
|
faqs: e,
|
|
5255
5276
|
onFaqClick: t,
|
|
5256
5277
|
loadingFaqId: n,
|
|
@@ -5279,7 +5300,7 @@ const ss = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5279
5300
|
children: [
|
|
5280
5301
|
a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
5281
5302
|
l.map((d) => /* @__PURE__ */ s(
|
|
5282
|
-
|
|
5303
|
+
al,
|
|
5283
5304
|
{
|
|
5284
5305
|
question: d.question,
|
|
5285
5306
|
onClick: () => t(d.id),
|
|
@@ -5293,41 +5314,42 @@ const ss = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
|
|
|
5293
5314
|
] }) });
|
|
5294
5315
|
};
|
|
5295
5316
|
export {
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5317
|
+
hs as A,
|
|
5318
|
+
pt as B,
|
|
5319
|
+
ji as C,
|
|
5320
|
+
mt as D,
|
|
5321
|
+
pl as E,
|
|
5322
|
+
xl as F,
|
|
5323
|
+
Or as G,
|
|
5324
|
+
va as H,
|
|
5325
|
+
ta as I,
|
|
5326
|
+
Zt as L,
|
|
5327
|
+
fl as M,
|
|
5328
|
+
ye as a,
|
|
5307
5329
|
ne as b,
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5330
|
+
Ji as c,
|
|
5331
|
+
zs as d,
|
|
5332
|
+
gl as e,
|
|
5333
|
+
al as f,
|
|
5312
5334
|
ce as g,
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5335
|
+
Pe as h,
|
|
5336
|
+
ke as i,
|
|
5337
|
+
vl as j,
|
|
5338
|
+
Wr as k,
|
|
5339
|
+
hl as l,
|
|
5340
|
+
bl as m,
|
|
5341
|
+
sr as n,
|
|
5342
|
+
he as o,
|
|
5343
|
+
Qa as p,
|
|
5344
|
+
Ki as q,
|
|
5345
|
+
_e as r,
|
|
5346
|
+
tr as s,
|
|
5347
|
+
us as t,
|
|
5348
|
+
ps as u,
|
|
5349
|
+
ra as v,
|
|
5350
|
+
Ya as w,
|
|
5351
|
+
xa as x,
|
|
5352
|
+
He as y,
|
|
5331
5353
|
gt as z
|
|
5332
5354
|
};
|
|
5333
|
-
//# sourceMappingURL=index-
|
|
5355
|
+
//# sourceMappingURL=index-BvuCjzqJ.js.map
|