@linktr.ee/messaging-react 3.5.7-rc-1783064505 → 3.5.7-rc-1783067095
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-B_-HLzud.js → Card-6zV3sFbU.js} +2 -2
- package/dist/{Card-B_-HLzud.js.map → Card-6zV3sFbU.js.map} +1 -1
- package/dist/{Card-MQ-aiPx5.cjs → Card-BQJP7Y9f.cjs} +2 -2
- package/dist/{Card-MQ-aiPx5.cjs.map → Card-BQJP7Y9f.cjs.map} +1 -1
- package/dist/{Card-D3YgpOVP.js → Card-CAalQRJs.js} +2 -2
- package/dist/{Card-D3YgpOVP.js.map → Card-CAalQRJs.js.map} +1 -1
- package/dist/{Card-B_4odVN0.cjs → Card-CK_XUFsc.cjs} +2 -2
- package/dist/{Card-B_4odVN0.cjs.map → Card-CK_XUFsc.cjs.map} +1 -1
- package/dist/{Card-BXcHirr8.cjs → Card-D2A5fCuk.cjs} +2 -2
- package/dist/{Card-BXcHirr8.cjs.map → Card-D2A5fCuk.cjs.map} +1 -1
- package/dist/{Card-FGxEeWr0.js → Card-wg-7Dyut.js} +3 -3
- package/dist/{Card-FGxEeWr0.js.map → Card-wg-7Dyut.js.map} +1 -1
- package/dist/{LockedThumbnail-C4izVRZs.js → LockedThumbnail-CeTZqbzd.js} +2 -2
- package/dist/{LockedThumbnail-C4izVRZs.js.map → LockedThumbnail-CeTZqbzd.js.map} +1 -1
- package/dist/{LockedThumbnail-DpxLGlQ2.cjs → LockedThumbnail-DxwKL4A1.cjs} +2 -2
- package/dist/{LockedThumbnail-DpxLGlQ2.cjs.map → LockedThumbnail-DxwKL4A1.cjs.map} +1 -1
- package/dist/index-DYBHXWJX.cjs +2 -0
- package/dist/index-DYBHXWJX.cjs.map +1 -0
- package/dist/{index-B_WK4olk.js → index-gnuITMC7.js} +873 -871
- package/dist/index-gnuITMC7.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/ChannelHeaderRedesign.tsx +15 -23
- package/src/components/ChannelView.stories.tsx +119 -1
- package/src/components/ChannelView.tsx +59 -45
- package/dist/index-B-ty9kXZ.cjs +0 -2
- package/dist/index-B-ty9kXZ.cjs.map +0 -1
- package/dist/index-B_WK4olk.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as n, jsxs as m, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import j, { createContext as Qe, useContext as ke, useCallback as K, useState as $, useRef as V, useEffect as X, useId as An, useMemo as ie, Suspense as et } from "react";
|
|
3
3
|
import { StreamChatService as Mn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as Rn, LinkPreviewsManager as $t } from "stream-chat";
|
|
5
|
-
import { Chat as Dn, useChannelStateContext as
|
|
6
|
-
import { StarIcon as ye, DotsThreeIcon as ps, SpinnerGapIcon as Me, SignOutIcon as bs, ProhibitInsetIcon as Bt, FlagIcon as Xt, ArrowLeftIcon as We, CurrencyDollarIcon as vs, CaretRightIcon as
|
|
7
|
-
import
|
|
5
|
+
import { Chat as Dn, useChannelStateContext as ce, useChatContext as de, DateSeparator as Ln, areMessageUIPropsEqual as zn, useMessageReminder as Fn, useComponentContext as Wt, Attachment as Pn, EditMessageModal as On, MessageBlocked as $n, MessageBouncePrompt as jn, MessageDeleted as Bn, MessageIsThreadReplyInChannelButtonIndicator as Un, MessageRepliesCountButton as Vn, ReminderNotification as Gn, StreamedMessageText as Hn, messageHasAttachments as Yn, messageHasReactions as qn, isDateSeparatorMessage as Wn, isMessageBlocked as Xn, isMessageBounced as Kn, MessageBounceModal as Jn, MessageText as jt, Poll as Zn, MessageErrorIcon as Qn, useMessageContext as Ce, useMessageComposer as es, useStateStore as ts, MessageInput as ns, useMessageInputContext as ss, useMessageComposerHasSendableData as as, AttachmentPreviewList as rs, QuotedMessagePreview as is, TextareaComposer as ls, MessageTimestamp as Be, AIStates as Ue, useTypingContext as os, useAIState as cs, Channel as ds, WithComponents as us, Window as ms, MessageList as hs, ChannelList as fs, InfiniteScroll as gs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as ye, DotsThreeIcon as ps, SpinnerGapIcon as Me, SignOutIcon as bs, ProhibitInsetIcon as Bt, FlagIcon as Xt, ArrowLeftIcon as We, CurrencyDollarIcon as vs, CaretRightIcon as me, SparkleIcon as he, FileIcon as Kt, ImageIcon as xs, SpeakerHighIcon as ws, VideoCameraIcon as Jt, FileMdIcon as _s, FileTextIcon as Ns, FileZipIcon as ys, FilePptIcon as ks, FileCsvIcon as Cs, FileXlsIcon as Es, FileDocIcon as Is, FilePdfIcon as Ss, CircleNotchIcon as _e, PlayIcon as Xe, PauseIcon as Ts, LinkIcon as As, DownloadSimpleIcon as Ne, GiftIcon as Ms, ThumbsUpIcon as Rs, ThumbsDownIcon as Ds, TrashSimpleIcon as Ls, XIcon as Pe, ArrowUpIcon as zs, ProhibitIcon as Fs, PencilSimpleIcon as Ps, CaretLeftIcon as Os } from "@phosphor-icons/react";
|
|
7
|
+
import k from "classnames";
|
|
8
8
|
import { MessageActions as $s, DefaultDropdownActionButton as Zt } from "stream-chat-react/experimental";
|
|
9
9
|
const Qt = Qe({
|
|
10
10
|
service: null,
|
|
@@ -24,10 +24,10 @@ const Qt = Qe({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var A,
|
|
28
|
-
const l =
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
var A, I;
|
|
28
|
+
const l = K(
|
|
29
|
+
(C, ...S) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${C}`, ...S);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,77 +37,77 @@ const Qt = Qe({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [o, d] =
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
40
|
+
const [o, d] = $(null), [u, g] = $(null), [h, f] = $(!1), [c, v] = $(!1), [_, b] = $(null), p = V(!1), x = V(null), N = V(s);
|
|
41
|
+
N.current = s;
|
|
42
|
+
const E = V(i);
|
|
43
|
+
E.current = i;
|
|
44
|
+
const T = V({
|
|
45
45
|
userId: t == null ? void 0 : t.id,
|
|
46
46
|
apiKey: a,
|
|
47
47
|
serviceConfig: s,
|
|
48
48
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
49
|
+
}), M = V(0);
|
|
50
|
+
M.current++, l("📊 RENDER INFO", {
|
|
51
|
+
renderCount: M.current,
|
|
52
52
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
53
|
propChanges: {
|
|
54
|
-
userChanged:
|
|
55
|
-
apiKeyChanged:
|
|
56
|
-
serviceConfigChanged:
|
|
57
|
-
capabilitiesChanged:
|
|
54
|
+
userChanged: T.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: T.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: T.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: T.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), T.current = {
|
|
60
60
|
userId: t == null ? void 0 : t.id,
|
|
61
61
|
apiKey: a,
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const L =
|
|
65
|
+
const L = V(null);
|
|
66
66
|
a && ((A = L.current) == null ? void 0 : A.apiKey) !== a && (L.current = { apiKey: a, client: new Rn(a) });
|
|
67
|
-
const D = a ? ((
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
if (!a || !D || !
|
|
67
|
+
const D = a ? ((I = L.current) == null ? void 0 : I.client) ?? null : null;
|
|
68
|
+
X(() => {
|
|
69
|
+
const C = M.current, S = N.current;
|
|
70
|
+
if (!a || !D || !S) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: C,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
l("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: C,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const
|
|
82
|
-
...
|
|
81
|
+
const O = new Mn({
|
|
82
|
+
...S,
|
|
83
83
|
apiKey: a,
|
|
84
|
-
debug:
|
|
84
|
+
debug: E.current,
|
|
85
85
|
client: D
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
87
|
+
x.current = O, d(O), l("✅ SERVICE SET", {
|
|
88
|
+
renderCount: C,
|
|
89
|
+
serviceInstance: !!O
|
|
90
90
|
});
|
|
91
91
|
}, [a, D]);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
var
|
|
92
|
+
const P = V(null);
|
|
93
|
+
X(() => {
|
|
94
|
+
var S, O;
|
|
95
95
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
96
|
hasService: !!o,
|
|
97
97
|
hasUser: !!t,
|
|
98
98
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
99
|
+
isConnecting: p.current,
|
|
100
100
|
isConnected: h,
|
|
101
101
|
dependencies: { service: !!o, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !o || !t) {
|
|
103
103
|
l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (p.current) {
|
|
107
107
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((S = P.current) == null ? void 0 : S.serviceId) === o && ((O = P.current) == null ? void 0 : O.userId) === t.id) {
|
|
111
111
|
l(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,35 +115,35 @@ const Qt = Qe({
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
(async () => {
|
|
118
|
-
l("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
118
|
+
l("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, v(!0), b(null);
|
|
119
119
|
try {
|
|
120
120
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
121
|
const F = await o.connectUser(t);
|
|
122
|
-
|
|
122
|
+
g(F), f(!0), P.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
124
|
clientId: F.userID
|
|
125
125
|
});
|
|
126
126
|
} catch (F) {
|
|
127
|
-
const
|
|
128
|
-
|
|
127
|
+
const B = F instanceof Error ? F.message : "Connection failed";
|
|
128
|
+
b(B), l("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: B
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
v(!1), p.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: h
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
|
-
}, [o, t, l, h]),
|
|
140
|
-
const
|
|
139
|
+
}, [o, t, l, h]), X(() => {
|
|
140
|
+
const C = D;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
|
|
142
|
+
var S;
|
|
143
|
+
C && (P.current = null, (S = x.current) == null || S.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
145
|
}, [D]);
|
|
146
|
-
const z =
|
|
146
|
+
const z = K(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,21 +151,21 @@ const Qt = Qe({
|
|
|
151
151
|
l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
154
|
+
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), v(!0);
|
|
155
155
|
try {
|
|
156
156
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
} catch (
|
|
160
|
-
const
|
|
161
|
-
|
|
157
|
+
const C = await o.connectUser(t);
|
|
158
|
+
g(C), f(!0), b(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (C) {
|
|
160
|
+
const S = C instanceof Error ? C.message : "Refresh failed";
|
|
161
|
+
b(S), l("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: S
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
v(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [o, t, l]), y =
|
|
168
|
+
}, [o, t, l]), y = j.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!o,
|
|
170
170
|
hasClient: !!u,
|
|
171
171
|
isConnected: h,
|
|
@@ -193,7 +193,7 @@ const Qt = Qe({
|
|
|
193
193
|
l
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
196
|
+
renderCount: M.current,
|
|
197
197
|
willRenderChat: !!D,
|
|
198
198
|
contextValueReady: !!y
|
|
199
199
|
}), /* @__PURE__ */ n(Qt.Provider, { value: y, children: D ? /* @__PURE__ */ n(
|
|
@@ -208,10 +208,10 @@ const Qt = Qe({
|
|
|
208
208
|
) : e });
|
|
209
209
|
}, js = () => tt(), nt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = $(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
|
-
return
|
|
214
|
+
return X(() => {
|
|
215
215
|
var l;
|
|
216
216
|
if (!e) {
|
|
217
217
|
s(!1);
|
|
@@ -312,7 +312,7 @@ const ne = ({
|
|
|
312
312
|
shape: i = "squircle",
|
|
313
313
|
dmAgentEnabled: l = !1
|
|
314
314
|
}) => {
|
|
315
|
-
const o = Ys(e), d = qs(e), u = 0.45, h = s < 32 ? Math.round(s * u) : s < 56 ? 14 : s < 120 ? 18 : 36,
|
|
315
|
+
const o = Ys(e), d = qs(e), u = 0.45, h = s < 32 ? Math.round(s * u) : s < 56 ? 14 : s < 120 ? 18 : 36, f = s >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ n(
|
|
316
316
|
"img",
|
|
317
317
|
{
|
|
318
318
|
src: t,
|
|
@@ -323,7 +323,7 @@ const ne = ({
|
|
|
323
323
|
"div",
|
|
324
324
|
{
|
|
325
325
|
"aria-hidden": "true",
|
|
326
|
-
className:
|
|
326
|
+
className: k(
|
|
327
327
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"
|
|
328
328
|
),
|
|
329
329
|
style: { fontSize: h, lineHeight: 1 },
|
|
@@ -333,7 +333,7 @@ const ne = ({
|
|
|
333
333
|
return /* @__PURE__ */ m(
|
|
334
334
|
"div",
|
|
335
335
|
{
|
|
336
|
-
className:
|
|
336
|
+
className: k(
|
|
337
337
|
"relative flex-shrink-0",
|
|
338
338
|
a
|
|
339
339
|
),
|
|
@@ -357,20 +357,20 @@ const ne = ({
|
|
|
357
357
|
"div",
|
|
358
358
|
{
|
|
359
359
|
"data-testid": "avatar-ring",
|
|
360
|
-
className:
|
|
360
|
+
className: k(
|
|
361
361
|
"h-full w-full",
|
|
362
362
|
"bg-transparent"
|
|
363
363
|
),
|
|
364
364
|
style: {
|
|
365
365
|
...c,
|
|
366
366
|
...l && {
|
|
367
|
-
borderWidth: `${
|
|
367
|
+
borderWidth: `${f}px`,
|
|
368
368
|
borderStyle: "solid",
|
|
369
369
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
370
370
|
boxShadow: "inset 0 1px 2px 0 rgba(255, 255, 255, 0.5)"
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
|
-
children:
|
|
373
|
+
children: v
|
|
374
374
|
}
|
|
375
375
|
)
|
|
376
376
|
]
|
|
@@ -387,75 +387,75 @@ const ne = ({
|
|
|
387
387
|
onBlockParticipantClick: o,
|
|
388
388
|
onReportParticipantClick: d,
|
|
389
389
|
onActionComplete: u,
|
|
390
|
-
logLabel:
|
|
390
|
+
logLabel: g = "useChannelModerationActions"
|
|
391
391
|
}) => {
|
|
392
392
|
var A;
|
|
393
|
-
const { service: h, debug:
|
|
394
|
-
return
|
|
395
|
-
if (!
|
|
396
|
-
|
|
393
|
+
const { service: h, debug: f } = tt(), c = (A = t == null ? void 0 : t.user) == null ? void 0 : A.id, v = !!(a && s && h && c), [_, b] = $(!1), [p, x] = $(null), [N, E] = $(!1), [T, M] = $(!1), L = v && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
|
|
394
|
+
return X(() => {
|
|
395
|
+
if (!v || !h || !c) {
|
|
396
|
+
b(!1), x(null);
|
|
397
397
|
return;
|
|
398
398
|
}
|
|
399
|
-
let
|
|
399
|
+
let I = !1;
|
|
400
400
|
return (async () => {
|
|
401
401
|
try {
|
|
402
|
-
const
|
|
403
|
-
if (
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
(
|
|
402
|
+
const C = await h.getBlockedUsers();
|
|
403
|
+
if (I) return;
|
|
404
|
+
b(
|
|
405
|
+
C.some(
|
|
406
|
+
(S) => S.blocked_user_id === c
|
|
407
407
|
)
|
|
408
408
|
);
|
|
409
|
-
} catch (
|
|
410
|
-
|
|
409
|
+
} catch (C) {
|
|
410
|
+
I || console.error(`[${g}] Failed to check blocked status:`, C);
|
|
411
411
|
} finally {
|
|
412
|
-
|
|
412
|
+
I || x({ participantId: c, service: h });
|
|
413
413
|
}
|
|
414
414
|
})(), () => {
|
|
415
|
-
|
|
415
|
+
I = !0;
|
|
416
416
|
};
|
|
417
|
-
}, [
|
|
417
|
+
}, [v, h, c, g]), {
|
|
418
418
|
isParticipantBlocked: _,
|
|
419
419
|
isCheckingBlockedStatus: L,
|
|
420
|
-
isLeaving:
|
|
421
|
-
isUpdatingBlockStatus:
|
|
420
|
+
isLeaving: N,
|
|
421
|
+
isUpdatingBlockStatus: T,
|
|
422
422
|
handleLeaveConversation: async () => {
|
|
423
|
-
var
|
|
424
|
-
if (!
|
|
425
|
-
l == null || l(),
|
|
423
|
+
var I;
|
|
424
|
+
if (!N) {
|
|
425
|
+
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), E(!0);
|
|
426
426
|
try {
|
|
427
|
-
const
|
|
428
|
-
await e.hide(
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${
|
|
427
|
+
const C = ((I = e._client) == null ? void 0 : I.userID) ?? null;
|
|
428
|
+
await e.hide(C, !1), r && await r(e), u == null || u();
|
|
429
|
+
} catch (C) {
|
|
430
|
+
console.error(`[${g}] Failed to leave conversation`, C);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
E(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
handleBlockUser: async () => {
|
|
437
|
-
var
|
|
438
|
-
if (!(
|
|
439
|
-
o == null || o(),
|
|
437
|
+
var I, C, S;
|
|
438
|
+
if (!(T || !h)) {
|
|
439
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), M(!0);
|
|
440
440
|
try {
|
|
441
|
-
await h.blockUser((
|
|
442
|
-
} catch (
|
|
443
|
-
console.error(`[${
|
|
441
|
+
await h.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
|
|
442
|
+
} catch (O) {
|
|
443
|
+
console.error(`[${g}] Failed to block member`, O);
|
|
444
444
|
} finally {
|
|
445
|
-
|
|
445
|
+
M(!1);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
handleUnblockUser: async () => {
|
|
450
|
-
var
|
|
451
|
-
if (!(
|
|
452
|
-
o == null || o(),
|
|
450
|
+
var I, C, S;
|
|
451
|
+
if (!(T || !h)) {
|
|
452
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), M(!0);
|
|
453
453
|
try {
|
|
454
|
-
await h.unBlockUser((
|
|
455
|
-
} catch (
|
|
456
|
-
console.error(`[${
|
|
454
|
+
await h.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
|
|
455
|
+
} catch (O) {
|
|
456
|
+
console.error(`[${g}] Failed to unblock member`, O);
|
|
457
457
|
} finally {
|
|
458
|
-
|
|
458
|
+
M(!1);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
},
|
|
@@ -472,7 +472,7 @@ const ne = ({
|
|
|
472
472
|
"button",
|
|
473
473
|
{
|
|
474
474
|
type: "button",
|
|
475
|
-
className:
|
|
475
|
+
className: k(
|
|
476
476
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
477
477
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
478
478
|
t
|
|
@@ -491,50 +491,50 @@ const ne = ({
|
|
|
491
491
|
onDeleteConversationClick: o,
|
|
492
492
|
onBlockParticipantClick: d,
|
|
493
493
|
onReportParticipantClick: u,
|
|
494
|
-
customChannelActions:
|
|
494
|
+
customChannelActions: g,
|
|
495
495
|
triggerClassName: h
|
|
496
496
|
}) => {
|
|
497
|
-
const [
|
|
498
|
-
isParticipantBlocked:
|
|
499
|
-
isCheckingBlockedStatus:
|
|
500
|
-
isLeaving:
|
|
501
|
-
isUpdatingBlockStatus:
|
|
502
|
-
handleLeaveConversation:
|
|
503
|
-
handleBlockUser:
|
|
497
|
+
const [f, c] = $(!1), v = V(null), _ = An(), b = K(() => c(!1), []), {
|
|
498
|
+
isParticipantBlocked: p,
|
|
499
|
+
isCheckingBlockedStatus: x,
|
|
500
|
+
isLeaving: N,
|
|
501
|
+
isUpdatingBlockStatus: E,
|
|
502
|
+
handleLeaveConversation: T,
|
|
503
|
+
handleBlockUser: M,
|
|
504
504
|
handleUnblockUser: L,
|
|
505
505
|
handleReportUser: D
|
|
506
506
|
} = Xs({
|
|
507
507
|
channel: e,
|
|
508
508
|
participant: t,
|
|
509
509
|
showBlockParticipant: a,
|
|
510
|
-
enabled:
|
|
510
|
+
enabled: f,
|
|
511
511
|
onLeaveConversation: i,
|
|
512
512
|
onBlockParticipant: l,
|
|
513
513
|
onDeleteConversationClick: o,
|
|
514
514
|
onBlockParticipantClick: d,
|
|
515
515
|
onReportParticipantClick: u,
|
|
516
|
-
onActionComplete:
|
|
516
|
+
onActionComplete: b,
|
|
517
517
|
logLabel: "ChannelActionsMenu"
|
|
518
518
|
});
|
|
519
|
-
return
|
|
520
|
-
if (!
|
|
519
|
+
return X(() => {
|
|
520
|
+
if (!f) return;
|
|
521
521
|
const z = (A) => {
|
|
522
|
-
|
|
522
|
+
v.current && !v.current.contains(A.target) && c(!1);
|
|
523
523
|
}, y = (A) => {
|
|
524
524
|
A.key === "Escape" && c(!1);
|
|
525
525
|
};
|
|
526
526
|
return document.addEventListener("mousedown", z), document.addEventListener("keydown", y), () => {
|
|
527
527
|
document.removeEventListener("mousedown", z), document.removeEventListener("keydown", y);
|
|
528
528
|
};
|
|
529
|
-
}, [
|
|
529
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ m("div", { ref: v, className: "relative", children: [
|
|
530
530
|
/* @__PURE__ */ m(
|
|
531
531
|
"button",
|
|
532
532
|
{
|
|
533
533
|
className: h,
|
|
534
534
|
type: "button",
|
|
535
535
|
"aria-haspopup": "true",
|
|
536
|
-
"aria-expanded":
|
|
537
|
-
"aria-controls":
|
|
536
|
+
"aria-expanded": f,
|
|
537
|
+
"aria-controls": f ? _ : void 0,
|
|
538
538
|
onClick: () => c((z) => !z),
|
|
539
539
|
children: [
|
|
540
540
|
/* @__PURE__ */ n(ps, { className: "size-5 text-black/90" }),
|
|
@@ -542,12 +542,12 @@ const ne = ({
|
|
|
542
542
|
]
|
|
543
543
|
}
|
|
544
544
|
),
|
|
545
|
-
|
|
545
|
+
f && /* @__PURE__ */ n(
|
|
546
546
|
"div",
|
|
547
547
|
{
|
|
548
548
|
id: _,
|
|
549
549
|
"aria-label": "Conversation options",
|
|
550
|
-
className:
|
|
550
|
+
className: k(
|
|
551
551
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
552
552
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
553
553
|
),
|
|
@@ -555,41 +555,41 @@ const ne = ({
|
|
|
555
555
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
|
|
556
556
|
xe,
|
|
557
557
|
{
|
|
558
|
-
onClick:
|
|
559
|
-
disabled:
|
|
560
|
-
"aria-busy":
|
|
558
|
+
onClick: T,
|
|
559
|
+
disabled: N,
|
|
560
|
+
"aria-busy": N,
|
|
561
561
|
children: [
|
|
562
|
-
|
|
562
|
+
N ? /* @__PURE__ */ n(Me, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(bs, { className: "h-5 w-5" }),
|
|
563
563
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
564
564
|
]
|
|
565
565
|
}
|
|
566
566
|
) }),
|
|
567
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
567
|
+
a && /* @__PURE__ */ n("li", { children: x ? (
|
|
568
568
|
// Block status not yet resolved — show a disabled placeholder
|
|
569
569
|
// so a premature click can't act on a stale block state.
|
|
570
570
|
/* @__PURE__ */ m(xe, { disabled: !0, "aria-busy": !0, children: [
|
|
571
571
|
/* @__PURE__ */ n(Me, { className: "h-5 w-5 animate-spin" }),
|
|
572
572
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
573
573
|
] })
|
|
574
|
-
) :
|
|
574
|
+
) : p ? /* @__PURE__ */ m(
|
|
575
575
|
xe,
|
|
576
576
|
{
|
|
577
577
|
onClick: L,
|
|
578
|
-
disabled:
|
|
579
|
-
"aria-busy":
|
|
578
|
+
disabled: E,
|
|
579
|
+
"aria-busy": E,
|
|
580
580
|
children: [
|
|
581
|
-
|
|
581
|
+
E ? /* @__PURE__ */ n(Me, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Bt, { className: "h-5 w-5" }),
|
|
582
582
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
583
583
|
]
|
|
584
584
|
}
|
|
585
585
|
) : /* @__PURE__ */ m(
|
|
586
586
|
xe,
|
|
587
587
|
{
|
|
588
|
-
onClick:
|
|
589
|
-
disabled:
|
|
590
|
-
"aria-busy":
|
|
588
|
+
onClick: M,
|
|
589
|
+
disabled: E,
|
|
590
|
+
"aria-busy": E,
|
|
591
591
|
children: [
|
|
592
|
-
|
|
592
|
+
E ? /* @__PURE__ */ n(Me, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Bt, { className: "h-5 w-5" }),
|
|
593
593
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
594
594
|
]
|
|
595
595
|
}
|
|
@@ -598,12 +598,12 @@ const ne = ({
|
|
|
598
598
|
/* @__PURE__ */ n(Xt, { className: "h-5 w-5" }),
|
|
599
599
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
600
600
|
] }) }),
|
|
601
|
-
|
|
601
|
+
g
|
|
602
602
|
] })
|
|
603
603
|
}
|
|
604
604
|
)
|
|
605
605
|
] });
|
|
606
|
-
}, Ve = "
|
|
606
|
+
}, Ve = "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", Ks = "CUSTOMER_PAID", Js = "Replies instantly with AI assistant", Zs = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Ks, Qs = (e) => {
|
|
607
607
|
const t = e;
|
|
608
608
|
return [t == null ? void 0 : t.customerTag, t == null ? void 0 : t.customer_tag].some(Zs);
|
|
609
609
|
}, ea = ({
|
|
@@ -617,43 +617,39 @@ const ne = ({
|
|
|
617
617
|
showBlockParticipant: o = !0,
|
|
618
618
|
showReportParticipant: d = !0,
|
|
619
619
|
onDeleteConversationClick: u,
|
|
620
|
-
onBlockParticipantClick:
|
|
620
|
+
onBlockParticipantClick: g,
|
|
621
621
|
onReportParticipantClick: h,
|
|
622
|
-
customChannelActions:
|
|
622
|
+
customChannelActions: f,
|
|
623
623
|
renderChannelActions: c,
|
|
624
|
-
showChannelInfo:
|
|
625
|
-
onParticipantNameClick: _
|
|
626
|
-
renderHeaderTitleBadges: v
|
|
624
|
+
showChannelInfo: v = !0,
|
|
625
|
+
onParticipantNameClick: _
|
|
627
626
|
}) => {
|
|
628
|
-
var
|
|
629
|
-
const { channel:
|
|
627
|
+
var D, P, z;
|
|
628
|
+
const { channel: b } = ce(), { client: p } = de(), x = j.useMemo(
|
|
630
629
|
() => {
|
|
631
|
-
var
|
|
630
|
+
var y;
|
|
632
631
|
return Oe(
|
|
633
|
-
(
|
|
634
|
-
|
|
635
|
-
|
|
632
|
+
(y = b.state) == null ? void 0 : y.members,
|
|
633
|
+
p == null ? void 0 : p.userID,
|
|
634
|
+
b.type
|
|
636
635
|
);
|
|
637
636
|
},
|
|
638
|
-
[(
|
|
639
|
-
),
|
|
640
|
-
channel: f,
|
|
641
|
-
participant: x
|
|
642
|
-
}), $ = async () => {
|
|
637
|
+
[(D = b.state) == null ? void 0 : D.members, p == null ? void 0 : p.userID, b.type]
|
|
638
|
+
), N = st(x == null ? void 0 : x.user), E = (P = x == null ? void 0 : x.user) == null ? void 0 : P.image, T = nt(b), M = Qs(x), L = async () => {
|
|
643
639
|
try {
|
|
644
|
-
|
|
645
|
-
} catch (
|
|
640
|
+
T ? await b.unpin() : await b.pin();
|
|
641
|
+
} catch (y) {
|
|
646
642
|
console.error(
|
|
647
643
|
"[ChannelHeaderRedesign] Failed to update pinned status:",
|
|
648
|
-
|
|
644
|
+
y
|
|
649
645
|
);
|
|
650
646
|
}
|
|
651
647
|
};
|
|
652
|
-
return /* @__PURE__ */ n("div", { className: "@container
|
|
648
|
+
return /* @__PURE__ */ n("div", { className: "@container w-full bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]", children: /* @__PURE__ */ m("div", { className: "grid min-h-[100px] grid-cols-[minmax(40px,1fr)_auto_minmax(40px,1fr)] items-start pb-2 pt-5 @lg:min-h-[104px] @lg:pt-6", children: [
|
|
653
649
|
/* @__PURE__ */ n("div", { className: "flex items-start", children: t && /* @__PURE__ */ n(
|
|
654
650
|
"button",
|
|
655
651
|
{
|
|
656
|
-
className:
|
|
652
|
+
className: k(
|
|
657
653
|
Ve,
|
|
658
654
|
"messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"
|
|
659
655
|
),
|
|
@@ -669,54 +665,55 @@ const ne = ({
|
|
|
669
665
|
{
|
|
670
666
|
type: "button",
|
|
671
667
|
onClick: _,
|
|
672
|
-
"aria-label": `View details for ${
|
|
673
|
-
className: "group
|
|
668
|
+
"aria-label": `View details for ${N}`,
|
|
669
|
+
className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
|
|
674
670
|
children: [
|
|
675
671
|
/* @__PURE__ */ n(
|
|
676
672
|
ne,
|
|
677
673
|
{
|
|
678
|
-
id: ((
|
|
679
|
-
name:
|
|
680
|
-
image:
|
|
674
|
+
id: ((z = x == null ? void 0 : x.user) == null ? void 0 : z.id) || b.id || "unknown",
|
|
675
|
+
name: N,
|
|
676
|
+
image: E,
|
|
681
677
|
dmAgentEnabled: a,
|
|
682
678
|
shape: "circle",
|
|
683
679
|
size: 48,
|
|
684
680
|
className: "-mb-2"
|
|
685
681
|
}
|
|
686
682
|
),
|
|
687
|
-
/* @__PURE__ */ m("span", { className: "relative z-10
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
683
|
+
/* @__PURE__ */ m("span", { className: "relative z-10 flex max-w-full flex-col items-center justify-center rounded-full border border-white/10 bg-white/65 py-1.5 pl-3 pr-2 shadow-[0px_0px_0px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)] backdrop-blur-[2px] transition-colors duration-150 group-hover:bg-white/80", children: [
|
|
684
|
+
/* @__PURE__ */ m("span", { className: "flex max-w-full items-center justify-center", children: [
|
|
685
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: N }),
|
|
686
|
+
/* @__PURE__ */ m("span", { className: "ml-2 flex gap-1", children: [
|
|
687
|
+
M && /* @__PURE__ */ n(
|
|
688
|
+
"span",
|
|
689
|
+
{
|
|
690
|
+
"aria-label": "Paid customer",
|
|
691
|
+
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
692
|
+
children: /* @__PURE__ */ n(vs, { className: "size-2.5", weight: "bold" })
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
s && T && /* @__PURE__ */ n(
|
|
696
|
+
"span",
|
|
697
|
+
{
|
|
698
|
+
"aria-label": "Starred conversation",
|
|
699
|
+
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
|
|
700
|
+
children: /* @__PURE__ */ n(ye, { className: "size-2.5", weight: "fill" })
|
|
701
|
+
}
|
|
702
|
+
),
|
|
703
|
+
/* @__PURE__ */ n(
|
|
704
|
+
me,
|
|
705
|
+
{
|
|
706
|
+
"aria-hidden": "true",
|
|
707
|
+
className: "size-4 shrink-0 text-black/65",
|
|
708
|
+
weight: "bold"
|
|
709
|
+
}
|
|
710
|
+
)
|
|
711
|
+
] })
|
|
712
|
+
] }),
|
|
713
|
+
a && /* @__PURE__ */ m("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
|
|
714
|
+
/* @__PURE__ */ n(he, { className: "size-3 shrink-0 text-black/55" }),
|
|
715
|
+
/* @__PURE__ */ n("span", { children: Js })
|
|
715
716
|
] })
|
|
716
|
-
] }),
|
|
717
|
-
a && /* @__PURE__ */ m("span", { className: "mt-1 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
718
|
-
/* @__PURE__ */ n(me, { className: "size-3 shrink-0 text-black/55" }),
|
|
719
|
-
/* @__PURE__ */ n("span", { children: Js })
|
|
720
717
|
] })
|
|
721
718
|
]
|
|
722
719
|
}
|
|
@@ -726,26 +723,26 @@ const ne = ({
|
|
|
726
723
|
"button",
|
|
727
724
|
{
|
|
728
725
|
className: Ve,
|
|
729
|
-
onClick:
|
|
726
|
+
onClick: L,
|
|
730
727
|
type: "button",
|
|
731
|
-
"aria-pressed":
|
|
732
|
-
"aria-label":
|
|
728
|
+
"aria-pressed": T,
|
|
729
|
+
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
733
730
|
children: /* @__PURE__ */ n(
|
|
734
731
|
ye,
|
|
735
732
|
{
|
|
736
|
-
className:
|
|
737
|
-
"text-[#FFD60A]":
|
|
738
|
-
"text-black/90": !
|
|
733
|
+
className: k("size-5", {
|
|
734
|
+
"text-[#FFD60A]": T,
|
|
735
|
+
"text-black/90": !T
|
|
739
736
|
}),
|
|
740
|
-
weight:
|
|
737
|
+
weight: T ? "fill" : "regular"
|
|
741
738
|
}
|
|
742
739
|
)
|
|
743
740
|
}
|
|
744
741
|
),
|
|
745
|
-
|
|
742
|
+
v && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
746
743
|
Ke,
|
|
747
744
|
{
|
|
748
|
-
channel:
|
|
745
|
+
channel: b,
|
|
749
746
|
participant: x,
|
|
750
747
|
showDeleteConversation: l,
|
|
751
748
|
showBlockParticipant: o,
|
|
@@ -753,9 +750,9 @@ const ne = ({
|
|
|
753
750
|
onLeaveConversation: r,
|
|
754
751
|
onBlockParticipant: i,
|
|
755
752
|
onDeleteConversationClick: u,
|
|
756
|
-
onBlockParticipantClick:
|
|
753
|
+
onBlockParticipantClick: g,
|
|
757
754
|
onReportParticipantClick: h,
|
|
758
|
-
customChannelActions:
|
|
755
|
+
customChannelActions: f,
|
|
759
756
|
triggerClassName: Ve
|
|
760
757
|
}
|
|
761
758
|
))
|
|
@@ -766,10 +763,10 @@ function na(e) {
|
|
|
766
763
|
return e != null && e.length ? e.some((t) => t.type === Ze) ? "down" : e.some((t) => t.type === Je) ? "up" : null : null;
|
|
767
764
|
}
|
|
768
765
|
function sa(e) {
|
|
769
|
-
const { channel: t } =
|
|
766
|
+
const { channel: t } = ce(), { client: s } = de("useMessageVote"), a = ie(
|
|
770
767
|
() => na(e.own_reactions),
|
|
771
768
|
[e.own_reactions]
|
|
772
|
-
), r =
|
|
769
|
+
), r = K(async () => {
|
|
773
770
|
if (s != null && s.userID)
|
|
774
771
|
try {
|
|
775
772
|
a === "up" ? await t.deleteReaction(e.id, Je) : await t.sendReaction(
|
|
@@ -779,7 +776,7 @@ function sa(e) {
|
|
|
779
776
|
);
|
|
780
777
|
} catch {
|
|
781
778
|
}
|
|
782
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
779
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = K(async () => {
|
|
783
780
|
if (s != null && s.userID)
|
|
784
781
|
try {
|
|
785
782
|
a === "down" ? await t.deleteReaction(e.id, Ze) : await t.sendReaction(
|
|
@@ -803,7 +800,7 @@ function tn({
|
|
|
803
800
|
const s = e == null ? void 0 : e.text, a = aa(t);
|
|
804
801
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
805
802
|
}
|
|
806
|
-
const ra =
|
|
803
|
+
const ra = j.lazy(() => import("./Card-CAalQRJs.js")), ia = j.lazy(() => import("./Card-6zV3sFbU.js")), la = j.lazy(() => import("./Card-wg-7Dyut.js")), at = () => /* @__PURE__ */ n(
|
|
807
804
|
"div",
|
|
808
805
|
{
|
|
809
806
|
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)]",
|
|
@@ -819,7 +816,7 @@ const ra = B.lazy(() => import("./Card-D3YgpOVP.js")), ia = B.lazy(() => import(
|
|
|
819
816
|
[/plain|rtf/, "text"],
|
|
820
817
|
[/markdown/, "markdown"]
|
|
821
818
|
];
|
|
822
|
-
function
|
|
819
|
+
function le(e) {
|
|
823
820
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
824
821
|
}
|
|
825
822
|
function an(e) {
|
|
@@ -845,11 +842,11 @@ const ma = {
|
|
|
845
842
|
generic: Kt
|
|
846
843
|
};
|
|
847
844
|
function fa(e) {
|
|
848
|
-
const t =
|
|
845
|
+
const t = le(e);
|
|
849
846
|
return t !== "document" ? ma[t] : ha[an(e)];
|
|
850
847
|
}
|
|
851
|
-
function
|
|
852
|
-
return
|
|
848
|
+
function fe(e, t) {
|
|
849
|
+
return j.createElement(fa(e), t);
|
|
853
850
|
}
|
|
854
851
|
const ga = (e) => {
|
|
855
852
|
var t, s;
|
|
@@ -866,66 +863,66 @@ const ga = (e) => {
|
|
|
866
863
|
muted: d = !1,
|
|
867
864
|
onContainerClick: u
|
|
868
865
|
}) => {
|
|
869
|
-
const
|
|
870
|
-
D(!1),
|
|
871
|
-
}, []),
|
|
872
|
-
const
|
|
873
|
-
if (!
|
|
874
|
-
const
|
|
866
|
+
const g = le(t), h = V(null), f = V(null), c = V(null), v = V(r), [_, b] = $(a), [p, x] = $(0), [N, E] = $(!1), [T, M] = $(!1), [L, D] = $(!1), [P, z] = $(!1), [y, A] = $(!0), [I, C] = $(null), S = K(() => {
|
|
867
|
+
D(!1), b(!0);
|
|
868
|
+
}, []), O = K((w) => {
|
|
869
|
+
const R = f.current;
|
|
870
|
+
if (!R) return 0;
|
|
871
|
+
const G = R.getBoundingClientRect();
|
|
875
872
|
return Math.max(
|
|
876
873
|
0,
|
|
877
|
-
Math.min(1, (ga(w) -
|
|
874
|
+
Math.min(1, (ga(w) - G.left) / G.width)
|
|
878
875
|
);
|
|
879
|
-
}, []), F =
|
|
880
|
-
const
|
|
881
|
-
|
|
882
|
-
}, []),
|
|
883
|
-
w.stopPropagation(),
|
|
884
|
-
const
|
|
885
|
-
|
|
876
|
+
}, []), F = K((w) => {
|
|
877
|
+
const R = h.current;
|
|
878
|
+
R && R.duration && (R.currentTime = w * R.duration);
|
|
879
|
+
}, []), B = (w) => {
|
|
880
|
+
w.stopPropagation(), E(!0);
|
|
881
|
+
const R = O(w);
|
|
882
|
+
x(R), F(R);
|
|
886
883
|
};
|
|
887
|
-
|
|
888
|
-
r !== void 0 && r !==
|
|
889
|
-
}, [r]),
|
|
884
|
+
X(() => {
|
|
885
|
+
r !== void 0 && r !== v.current && (v.current = r, b(r));
|
|
886
|
+
}, [r]), X(() => {
|
|
890
887
|
if (!_) {
|
|
891
888
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
892
889
|
return;
|
|
893
890
|
}
|
|
894
891
|
const w = () => {
|
|
895
|
-
const
|
|
896
|
-
|
|
892
|
+
const R = h.current;
|
|
893
|
+
R && R.duration && !N && x(R.currentTime / R.duration), c.current = requestAnimationFrame(w);
|
|
897
894
|
};
|
|
898
895
|
return c.current = requestAnimationFrame(w), () => {
|
|
899
896
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
900
897
|
};
|
|
901
|
-
}, [_,
|
|
898
|
+
}, [_, N]), X(() => {
|
|
902
899
|
const w = h.current;
|
|
903
|
-
w && (_ ? w.play().catch((
|
|
904
|
-
|
|
900
|
+
w && (_ ? w.play().catch((R) => {
|
|
901
|
+
b(!1), D(!0);
|
|
905
902
|
}) : w.pause());
|
|
906
|
-
}, [_]),
|
|
907
|
-
if (!
|
|
908
|
-
const w = (
|
|
909
|
-
|
|
903
|
+
}, [_]), X(() => {
|
|
904
|
+
if (!N) return;
|
|
905
|
+
const w = (G) => x(O(G)), R = (G) => {
|
|
906
|
+
E(!1), F(O(G));
|
|
910
907
|
};
|
|
911
|
-
return window.addEventListener("mousemove", w), window.addEventListener("mouseup",
|
|
912
|
-
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup",
|
|
908
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", R), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", R), () => {
|
|
909
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", R), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", R);
|
|
913
910
|
};
|
|
914
|
-
}, [
|
|
915
|
-
const
|
|
911
|
+
}, [N, O, F]);
|
|
912
|
+
const J = I ? { aspectRatio: String(I) } : void 0, ee = I ? "" : " aspect-video", q = Math.round(p * 100);
|
|
916
913
|
return /* @__PURE__ */ m(
|
|
917
914
|
"div",
|
|
918
915
|
{
|
|
919
916
|
role: "button",
|
|
920
917
|
tabIndex: 0,
|
|
921
|
-
className: `relative cursor-pointer overflow-hidden bg-black ${
|
|
922
|
-
style:
|
|
918
|
+
className: `relative cursor-pointer overflow-hidden bg-black ${ee}`,
|
|
919
|
+
style: J,
|
|
923
920
|
onClick: (w) => {
|
|
924
921
|
if (u) {
|
|
925
922
|
u(w);
|
|
926
923
|
return;
|
|
927
924
|
}
|
|
928
|
-
L || l &&
|
|
925
|
+
L || l && b((R) => !R);
|
|
929
926
|
},
|
|
930
927
|
onKeyDown: (w) => {
|
|
931
928
|
if (!(w.key !== "Enter" && w.key !== " ")) {
|
|
@@ -933,11 +930,11 @@ const ga = (e) => {
|
|
|
933
930
|
u(w);
|
|
934
931
|
return;
|
|
935
932
|
}
|
|
936
|
-
L || l &&
|
|
933
|
+
L || l && b((R) => !R);
|
|
937
934
|
}
|
|
938
935
|
},
|
|
939
936
|
children: [
|
|
940
|
-
s && (
|
|
937
|
+
s && (g === "audio" || y) && /* @__PURE__ */ n(
|
|
941
938
|
"img",
|
|
942
939
|
{
|
|
943
940
|
src: s,
|
|
@@ -945,11 +942,11 @@ const ga = (e) => {
|
|
|
945
942
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
946
943
|
}
|
|
947
944
|
),
|
|
948
|
-
!s && (
|
|
945
|
+
!s && (g === "audio" || y) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: fe(t, {
|
|
949
946
|
className: "size-12 text-black/20",
|
|
950
947
|
weight: "regular"
|
|
951
948
|
}) }),
|
|
952
|
-
/* @__PURE__ */ n("div", { className: "absolute inset-0", children:
|
|
949
|
+
/* @__PURE__ */ n("div", { className: "absolute inset-0", children: g === "audio" ? /* @__PURE__ */ n(
|
|
953
950
|
"audio",
|
|
954
951
|
{
|
|
955
952
|
ref: h,
|
|
@@ -964,7 +961,7 @@ const ga = (e) => {
|
|
|
964
961
|
onWaiting: () => z(!0),
|
|
965
962
|
onPlay: () => D(!1),
|
|
966
963
|
onEnded: () => {
|
|
967
|
-
i || (
|
|
964
|
+
i || (b(!1), x(0));
|
|
968
965
|
},
|
|
969
966
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
970
967
|
}
|
|
@@ -985,15 +982,15 @@ const ga = (e) => {
|
|
|
985
982
|
onPlay: () => D(!1),
|
|
986
983
|
onLoadedMetadata: () => {
|
|
987
984
|
const w = h.current;
|
|
988
|
-
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight &&
|
|
985
|
+
w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && C(w.videoWidth / w.videoHeight);
|
|
989
986
|
},
|
|
990
987
|
onEnded: () => {
|
|
991
|
-
i || (
|
|
988
|
+
i || (b(!1), x(0));
|
|
992
989
|
},
|
|
993
990
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
994
991
|
}
|
|
995
992
|
) }),
|
|
996
|
-
|
|
993
|
+
P && !L && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
997
994
|
_e,
|
|
998
995
|
{
|
|
999
996
|
className: "size-8 animate-spin text-white/80",
|
|
@@ -1008,10 +1005,10 @@ const ga = (e) => {
|
|
|
1008
1005
|
tabIndex: 0,
|
|
1009
1006
|
"aria-label": "Play preview",
|
|
1010
1007
|
onClick: (w) => {
|
|
1011
|
-
w.stopPropagation(),
|
|
1008
|
+
w.stopPropagation(), S();
|
|
1012
1009
|
},
|
|
1013
1010
|
onKeyDown: (w) => {
|
|
1014
|
-
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(),
|
|
1011
|
+
w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), S());
|
|
1015
1012
|
},
|
|
1016
1013
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Xe, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1017
1014
|
}
|
|
@@ -1021,23 +1018,23 @@ const ga = (e) => {
|
|
|
1021
1018
|
{
|
|
1022
1019
|
role: "slider",
|
|
1023
1020
|
"aria-label": "Playback position",
|
|
1024
|
-
"aria-valuenow":
|
|
1021
|
+
"aria-valuenow": q,
|
|
1025
1022
|
"aria-valuemin": 0,
|
|
1026
1023
|
"aria-valuemax": 100,
|
|
1027
1024
|
tabIndex: 0,
|
|
1028
|
-
ref:
|
|
1025
|
+
ref: f,
|
|
1029
1026
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1030
|
-
onMouseDown:
|
|
1031
|
-
onTouchStart:
|
|
1027
|
+
onMouseDown: B,
|
|
1028
|
+
onTouchStart: B,
|
|
1032
1029
|
onClick: (w) => w.stopPropagation(),
|
|
1033
1030
|
onKeyDown: (w) => {
|
|
1034
|
-
w.key === "ArrowRight" && F(Math.min(1,
|
|
1031
|
+
w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
|
|
1035
1032
|
},
|
|
1036
1033
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
1037
1034
|
"div",
|
|
1038
1035
|
{
|
|
1039
1036
|
className: "h-full rounded-full bg-white",
|
|
1040
|
-
style: { width: `${
|
|
1037
|
+
style: { width: `${q}%` }
|
|
1041
1038
|
}
|
|
1042
1039
|
) })
|
|
1043
1040
|
}
|
|
@@ -1048,7 +1045,7 @@ const ga = (e) => {
|
|
|
1048
1045
|
{
|
|
1049
1046
|
type: "button",
|
|
1050
1047
|
onClick: (w) => {
|
|
1051
|
-
w.stopPropagation(),
|
|
1048
|
+
w.stopPropagation(), b((R) => !R);
|
|
1052
1049
|
},
|
|
1053
1050
|
className: "shrink-0 text-white",
|
|
1054
1051
|
"aria-label": _ ? "Pause" : "Play",
|
|
@@ -1060,30 +1057,30 @@ const ga = (e) => {
|
|
|
1060
1057
|
{
|
|
1061
1058
|
role: "slider",
|
|
1062
1059
|
"aria-label": "Playback position",
|
|
1063
|
-
"aria-valuenow":
|
|
1060
|
+
"aria-valuenow": q,
|
|
1064
1061
|
"aria-valuemin": 0,
|
|
1065
1062
|
"aria-valuemax": 100,
|
|
1066
1063
|
tabIndex: 0,
|
|
1067
|
-
ref:
|
|
1064
|
+
ref: f,
|
|
1068
1065
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
1069
|
-
onMouseDown:
|
|
1070
|
-
onTouchStart:
|
|
1066
|
+
onMouseDown: B,
|
|
1067
|
+
onTouchStart: B,
|
|
1071
1068
|
onClick: (w) => w.stopPropagation(),
|
|
1072
|
-
onMouseEnter: () =>
|
|
1073
|
-
onMouseLeave: () =>
|
|
1069
|
+
onMouseEnter: () => M(!0),
|
|
1070
|
+
onMouseLeave: () => M(!1),
|
|
1074
1071
|
onKeyDown: (w) => {
|
|
1075
|
-
w.key === "ArrowRight" && F(Math.min(1,
|
|
1072
|
+
w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
|
|
1076
1073
|
},
|
|
1077
1074
|
children: [
|
|
1078
1075
|
/* @__PURE__ */ n(
|
|
1079
1076
|
"div",
|
|
1080
1077
|
{
|
|
1081
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
1078
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || N ? "h-1.5" : "h-1"}`,
|
|
1082
1079
|
children: /* @__PURE__ */ n(
|
|
1083
1080
|
"div",
|
|
1084
1081
|
{
|
|
1085
1082
|
className: "h-full rounded-full bg-white",
|
|
1086
|
-
style: { width: `${
|
|
1083
|
+
style: { width: `${q}%` }
|
|
1087
1084
|
}
|
|
1088
1085
|
)
|
|
1089
1086
|
}
|
|
@@ -1091,8 +1088,8 @@ const ga = (e) => {
|
|
|
1091
1088
|
/* @__PURE__ */ n(
|
|
1092
1089
|
"div",
|
|
1093
1090
|
{
|
|
1094
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
1095
|
-
style: { left: `${
|
|
1091
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || N ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1092
|
+
style: { left: `${q}%` }
|
|
1096
1093
|
}
|
|
1097
1094
|
)
|
|
1098
1095
|
]
|
|
@@ -1111,7 +1108,7 @@ const ga = (e) => {
|
|
|
1111
1108
|
mediaPlayerProps: i,
|
|
1112
1109
|
containedImage: l = !1
|
|
1113
1110
|
}) => {
|
|
1114
|
-
const o =
|
|
1111
|
+
const o = le(e), [d, u] = $(!1);
|
|
1115
1112
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
|
|
1116
1113
|
pa,
|
|
1117
1114
|
{
|
|
@@ -1159,7 +1156,7 @@ const ga = (e) => {
|
|
|
1159
1156
|
"div",
|
|
1160
1157
|
{
|
|
1161
1158
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1162
|
-
children:
|
|
1159
|
+
children: fe(e, {
|
|
1163
1160
|
className: Ht(r),
|
|
1164
1161
|
weight: "regular"
|
|
1165
1162
|
})
|
|
@@ -1176,7 +1173,7 @@ const ga = (e) => {
|
|
|
1176
1173
|
"div",
|
|
1177
1174
|
{
|
|
1178
1175
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
1179
|
-
children:
|
|
1176
|
+
children: fe(e, {
|
|
1180
1177
|
className: Ht(r),
|
|
1181
1178
|
weight: "regular"
|
|
1182
1179
|
})
|
|
@@ -1193,18 +1190,18 @@ const ga = (e) => {
|
|
|
1193
1190
|
action: o,
|
|
1194
1191
|
topLeft: d,
|
|
1195
1192
|
topRight: u,
|
|
1196
|
-
rootRef:
|
|
1193
|
+
rootRef: g,
|
|
1197
1194
|
"data-testid": h
|
|
1198
1195
|
}) => {
|
|
1199
|
-
const
|
|
1196
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", v = f && !s;
|
|
1200
1197
|
return /* @__PURE__ */ m(
|
|
1201
1198
|
"div",
|
|
1202
1199
|
{
|
|
1203
|
-
ref:
|
|
1200
|
+
ref: g,
|
|
1204
1201
|
"data-testid": h,
|
|
1205
|
-
className:
|
|
1202
|
+
className: k(
|
|
1206
1203
|
"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)]",
|
|
1207
|
-
|
|
1204
|
+
f ? "bg-[#121110]" : "bg-white"
|
|
1208
1205
|
),
|
|
1209
1206
|
children: [
|
|
1210
1207
|
d ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: d }) : null,
|
|
@@ -1214,28 +1211,28 @@ const ga = (e) => {
|
|
|
1214
1211
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1215
1212
|
"p",
|
|
1216
1213
|
{
|
|
1217
|
-
className:
|
|
1218
|
-
"text-black": !
|
|
1219
|
-
"text-white/30":
|
|
1220
|
-
"text-white":
|
|
1214
|
+
className: k("mb-0.5 truncate text-base font-medium", {
|
|
1215
|
+
"text-black": !f,
|
|
1216
|
+
"text-white/30": f && v,
|
|
1217
|
+
"text-white": f && !v
|
|
1221
1218
|
}),
|
|
1222
1219
|
children: c
|
|
1223
1220
|
}
|
|
1224
1221
|
),
|
|
1225
1222
|
/* @__PURE__ */ m("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1226
|
-
|
|
1227
|
-
className:
|
|
1223
|
+
fe(r, {
|
|
1224
|
+
className: k(
|
|
1228
1225
|
"size-5 shrink-0",
|
|
1229
|
-
|
|
1226
|
+
f ? "text-white/55" : "text-black/55"
|
|
1230
1227
|
),
|
|
1231
1228
|
weight: "regular"
|
|
1232
1229
|
}),
|
|
1233
1230
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1234
1231
|
"span",
|
|
1235
1232
|
{
|
|
1236
|
-
className:
|
|
1233
|
+
className: k(
|
|
1237
1234
|
"text-xs font-medium",
|
|
1238
|
-
|
|
1235
|
+
f ? "text-white/55" : "text-black/55"
|
|
1239
1236
|
),
|
|
1240
1237
|
children: i
|
|
1241
1238
|
}
|
|
@@ -1270,7 +1267,7 @@ function Na(e) {
|
|
|
1270
1267
|
return e ? "text-white/20" : "text-black/20";
|
|
1271
1268
|
}
|
|
1272
1269
|
const it = ({ attachment: e, isMyMessage: t }) => {
|
|
1273
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ m(
|
|
1270
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ m(j.Fragment, { children: [
|
|
1274
1271
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1275
1272
|
"img",
|
|
1276
1273
|
{
|
|
@@ -1316,7 +1313,7 @@ const ka = ({
|
|
|
1316
1313
|
url: e,
|
|
1317
1314
|
filename: t
|
|
1318
1315
|
}) => {
|
|
1319
|
-
const [s, a] =
|
|
1316
|
+
const [s, a] = $(!1);
|
|
1320
1317
|
return /* @__PURE__ */ n(
|
|
1321
1318
|
"button",
|
|
1322
1319
|
{
|
|
@@ -1332,7 +1329,7 @@ const ka = ({
|
|
|
1332
1329
|
},
|
|
1333
1330
|
disabled: s,
|
|
1334
1331
|
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",
|
|
1335
|
-
children: s ? /* @__PURE__ */ n(_e, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(
|
|
1332
|
+
children: s ? /* @__PURE__ */ n(_e, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(j.Fragment, { children: [
|
|
1336
1333
|
/* @__PURE__ */ n(Ne, { className: "size-4 text-white", weight: "bold" }),
|
|
1337
1334
|
"Download"
|
|
1338
1335
|
] })
|
|
@@ -1340,24 +1337,24 @@ const ka = ({
|
|
|
1340
1337
|
);
|
|
1341
1338
|
};
|
|
1342
1339
|
function ot(e) {
|
|
1343
|
-
var h,
|
|
1340
|
+
var h, f, c, v;
|
|
1344
1341
|
const t = (h = e.attachments) == null ? void 0 : h.find(
|
|
1345
1342
|
(_) => _.type === "video" && _.asset_url
|
|
1346
|
-
), s = (
|
|
1343
|
+
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1347
1344
|
(_) => _.type === "image" && _.image_url
|
|
1348
1345
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1349
1346
|
(_) => _.type === "audio" && _.asset_url
|
|
1350
|
-
), r = (
|
|
1347
|
+
), r = (v = e.attachments) == null ? void 0 : v.find(
|
|
1351
1348
|
(_) => _.type === "file" && _.asset_url
|
|
1352
1349
|
), i = t ?? s ?? a ?? r, l = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1353
1350
|
if (!l) return null;
|
|
1354
|
-
const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, u = i == null ? void 0 : i.file_size,
|
|
1351
|
+
const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, u = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
1355
1352
|
return {
|
|
1356
1353
|
resolvedUrl: l,
|
|
1357
1354
|
resolvedType: o,
|
|
1358
1355
|
title: d,
|
|
1359
1356
|
fileSize: u,
|
|
1360
|
-
thumbnailUrl:
|
|
1357
|
+
thumbnailUrl: g
|
|
1361
1358
|
};
|
|
1362
1359
|
}
|
|
1363
1360
|
const dn = ({
|
|
@@ -1395,7 +1392,7 @@ const dn = ({
|
|
|
1395
1392
|
fileSize: a,
|
|
1396
1393
|
thumbnailUrl: r
|
|
1397
1394
|
}) => {
|
|
1398
|
-
const i =
|
|
1395
|
+
const i = le(t), l = a !== void 0 ? on(a) : void 0;
|
|
1399
1396
|
return /* @__PURE__ */ n(
|
|
1400
1397
|
ln,
|
|
1401
1398
|
{
|
|
@@ -1518,24 +1515,24 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1518
1515
|
if (!r && !i)
|
|
1519
1516
|
return null;
|
|
1520
1517
|
if (r) {
|
|
1521
|
-
const
|
|
1522
|
-
if (!
|
|
1523
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1518
|
+
const f = (h = e.metadata) == null ? void 0 : h.amount_text;
|
|
1519
|
+
if (!f) return null;
|
|
1520
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", v = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1524
1521
|
return /* @__PURE__ */ m("div", { className: c, children: [
|
|
1525
1522
|
/* @__PURE__ */ n(Ms, { size: t ? 14 : 12 }),
|
|
1526
|
-
/* @__PURE__ */ n("span", { children:
|
|
1523
|
+
/* @__PURE__ */ n("span", { children: v })
|
|
1527
1524
|
] });
|
|
1528
1525
|
}
|
|
1529
1526
|
const l = s && a, o = l ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
1530
1527
|
"message-chatbot-indicator",
|
|
1531
1528
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1532
1529
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1533
|
-
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }),
|
|
1530
|
+
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(Ma, { size: l ? 12 : 15 }) });
|
|
1534
1531
|
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ m(se, { children: [
|
|
1535
1532
|
u,
|
|
1536
|
-
|
|
1533
|
+
g
|
|
1537
1534
|
] }) : /* @__PURE__ */ m(se, { children: [
|
|
1538
|
-
|
|
1535
|
+
g,
|
|
1539
1536
|
u
|
|
1540
1537
|
] }) });
|
|
1541
1538
|
}, Fa = ({
|
|
@@ -1547,7 +1544,7 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1547
1544
|
"button",
|
|
1548
1545
|
{
|
|
1549
1546
|
type: "button",
|
|
1550
|
-
className:
|
|
1547
|
+
className: k("message-vote-button focus-ring", {
|
|
1551
1548
|
"message-vote-button--selected": e === "up"
|
|
1552
1549
|
}),
|
|
1553
1550
|
onClick: t,
|
|
@@ -1561,7 +1558,7 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1561
1558
|
"button",
|
|
1562
1559
|
{
|
|
1563
1560
|
type: "button",
|
|
1564
|
-
className:
|
|
1561
|
+
className: k("message-vote-button focus-ring", {
|
|
1565
1562
|
"message-vote-button--selected": e === "down"
|
|
1566
1563
|
}),
|
|
1567
1564
|
onClick: s,
|
|
@@ -1583,67 +1580,67 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1583
1580
|
handleAction: o,
|
|
1584
1581
|
handleOpenThread: d,
|
|
1585
1582
|
handleRetry: u,
|
|
1586
|
-
highlighted:
|
|
1583
|
+
highlighted: g,
|
|
1587
1584
|
isMessageAIGenerated: h,
|
|
1588
|
-
isMyMessage:
|
|
1585
|
+
isMyMessage: f,
|
|
1589
1586
|
message: c,
|
|
1590
|
-
renderText:
|
|
1587
|
+
renderText: v,
|
|
1591
1588
|
threadList: _,
|
|
1592
|
-
viewerLanguage:
|
|
1593
|
-
} = e, { client:
|
|
1594
|
-
Attachment:
|
|
1595
|
-
EditMessageModal:
|
|
1596
|
-
MessageActions:
|
|
1597
|
-
MessageBlocked:
|
|
1589
|
+
viewerLanguage: b
|
|
1590
|
+
} = e, { client: p } = de("CustomMessage"), { channel: x } = ce("CustomMessage"), { isUnlocking: N, onUnlockClick: E, onFetchSource: T, onDownloadClick: M } = Aa("LockedAttachment"), [L, D] = $(!1), P = Fn(c.id), { selected: z, voteUp: y, voteDown: A } = sa(c), {
|
|
1591
|
+
Attachment: I = Pn,
|
|
1592
|
+
EditMessageModal: C = On,
|
|
1593
|
+
MessageActions: S,
|
|
1594
|
+
MessageBlocked: O = $n,
|
|
1598
1595
|
MessageBouncePrompt: F = jn,
|
|
1599
|
-
MessageDeleted:
|
|
1600
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1601
|
-
MessageRepliesCountButton:
|
|
1602
|
-
ReminderNotification:
|
|
1596
|
+
MessageDeleted: B = Bn,
|
|
1597
|
+
MessageIsThreadReplyInChannelButtonIndicator: J = Un,
|
|
1598
|
+
MessageRepliesCountButton: ee = Vn,
|
|
1599
|
+
ReminderNotification: q = Gn,
|
|
1603
1600
|
StreamedMessageText: w = Hn,
|
|
1604
|
-
PinIndicator:
|
|
1605
|
-
} = Wt("CustomMessage"),
|
|
1601
|
+
PinIndicator: R
|
|
1602
|
+
} = Wt("CustomMessage"), G = Yn(c), H = qn(c), W = ie(
|
|
1606
1603
|
() => h == null ? void 0 : h(c),
|
|
1607
1604
|
[h, c]
|
|
1608
|
-
),
|
|
1605
|
+
), U = ie(() => {
|
|
1609
1606
|
const ve = c.attachments ?? [], Ae = c.shared_location ? [c.shared_location, ...ve] : ve;
|
|
1610
1607
|
if (!De(c)) return Ae;
|
|
1611
1608
|
const Pt = Ae.filter((Ot) => !("type" in Ot) || !cn(Ot));
|
|
1612
1609
|
return Pt.length === Ae.length ? Ae : Pt;
|
|
1613
|
-
}, [c]),
|
|
1614
|
-
const ve = tn({ message: c, viewerLanguage:
|
|
1610
|
+
}, [c]), Y = ie(() => {
|
|
1611
|
+
const ve = tn({ message: c, viewerLanguage: b });
|
|
1615
1612
|
return ve === c.text ? c : { ...c, text: ve };
|
|
1616
|
-
}, [c,
|
|
1613
|
+
}, [c, b]);
|
|
1617
1614
|
if (Wn(c))
|
|
1618
1615
|
return null;
|
|
1619
1616
|
if (c.deleted_at || c.type === "deleted")
|
|
1620
|
-
return /* @__PURE__ */ n(
|
|
1617
|
+
return /* @__PURE__ */ n(B, { message: c });
|
|
1621
1618
|
if (Xn(c))
|
|
1622
|
-
return /* @__PURE__ */ n(
|
|
1623
|
-
const
|
|
1624
|
-
let
|
|
1625
|
-
ge ?
|
|
1626
|
-
const te =
|
|
1619
|
+
return /* @__PURE__ */ n(O, {});
|
|
1620
|
+
const Z = !_ && !!c.reply_count, re = !_ && c.show_in_channel && c.parent_id, ge = c.status === "failed" && ((yt = c.error) == null ? void 0 : yt.status) !== 403, pe = Kn(c);
|
|
1621
|
+
let Q;
|
|
1622
|
+
ge ? Q = () => u(c) : pe && (Q = () => D(!0));
|
|
1623
|
+
const te = f(), oe = k(
|
|
1627
1624
|
"str-chat__message str-chat__message-simple",
|
|
1628
1625
|
`str-chat__message--${c.type}`,
|
|
1629
1626
|
`str-chat__message--${c.status}`,
|
|
1630
1627
|
te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1631
1628
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1632
1629
|
{
|
|
1633
|
-
"str-chat__message--has-attachment":
|
|
1634
|
-
"str-chat__message--highlighted":
|
|
1630
|
+
"str-chat__message--has-attachment": G,
|
|
1631
|
+
"str-chat__message--highlighted": g,
|
|
1635
1632
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1636
1633
|
"str-chat__message--with-reactions": H,
|
|
1637
1634
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((kt = c == null ? void 0 : c.error) == null ? void 0 : kt.status) !== 403,
|
|
1638
|
-
"str-chat__message-with-thread-link":
|
|
1635
|
+
"str-chat__message-with-thread-link": Z || re,
|
|
1639
1636
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1640
1637
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1641
1638
|
"str-chat__virtual-message__wrapper--group": l
|
|
1642
1639
|
}
|
|
1643
|
-
), xt = c.poll_id &&
|
|
1640
|
+
), xt = c.poll_id && p.polls.fromState(c.poll_id), wt = za(c), be = De(c), _t = La(c), je = !!(U != null && U.length && !c.quoted_message), Nt = be && te && je;
|
|
1644
1641
|
return /* @__PURE__ */ m(se, { children: [
|
|
1645
1642
|
a && /* @__PURE__ */ n(
|
|
1646
|
-
|
|
1643
|
+
C,
|
|
1647
1644
|
{
|
|
1648
1645
|
additionalMessageInputProps: t
|
|
1649
1646
|
}
|
|
@@ -1659,12 +1656,12 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1659
1656
|
/* @__PURE__ */ m(
|
|
1660
1657
|
"div",
|
|
1661
1658
|
{
|
|
1662
|
-
className:
|
|
1659
|
+
className: oe,
|
|
1663
1660
|
"data-message-id": c.id,
|
|
1664
1661
|
"data-dd-privacy": "mask",
|
|
1665
1662
|
children: [
|
|
1666
|
-
|
|
1667
|
-
|
|
1663
|
+
R && /* @__PURE__ */ n(R, {}),
|
|
1664
|
+
!!P && /* @__PURE__ */ n(q, { reminder: P }),
|
|
1668
1665
|
c.user && /* @__PURE__ */ n(
|
|
1669
1666
|
ne,
|
|
1670
1667
|
{
|
|
@@ -1680,14 +1677,14 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1680
1677
|
/* @__PURE__ */ n(
|
|
1681
1678
|
"div",
|
|
1682
1679
|
{
|
|
1683
|
-
className:
|
|
1680
|
+
className: k("str-chat__message-inner", {
|
|
1684
1681
|
"str-chat__simple-message--error-failed": ge || pe
|
|
1685
1682
|
}),
|
|
1686
1683
|
"data-testid": "message-inner",
|
|
1687
|
-
onClick:
|
|
1688
|
-
onKeyDown:
|
|
1689
|
-
role:
|
|
1690
|
-
tabIndex:
|
|
1684
|
+
onClick: Q,
|
|
1685
|
+
onKeyDown: Q,
|
|
1686
|
+
role: Q ? "button" : void 0,
|
|
1687
|
+
tabIndex: Q ? 0 : void 0,
|
|
1691
1688
|
style: {
|
|
1692
1689
|
// Force margins to 0 to prevent hover layout shift
|
|
1693
1690
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
@@ -1696,7 +1693,7 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1696
1693
|
},
|
|
1697
1694
|
children: _t ? /* @__PURE__ */ m("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1698
1695
|
te ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1699
|
-
|
|
1696
|
+
S && /* @__PURE__ */ n(S, {}),
|
|
1700
1697
|
/* @__PURE__ */ n(
|
|
1701
1698
|
Gt.Sent,
|
|
1702
1699
|
{
|
|
@@ -1706,8 +1703,8 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1706
1703
|
amountText: (St = c.metadata) == null ? void 0 : St.amount_text,
|
|
1707
1704
|
detail: (Tt = c.metadata) == null ? void 0 : Tt.attachment_detail,
|
|
1708
1705
|
paymentStatus: (At = c.metadata) == null ? void 0 : At.payment_status,
|
|
1709
|
-
onPreviewClick: () =>
|
|
1710
|
-
onFetchSource: async () => await (
|
|
1706
|
+
onPreviewClick: () => E == null ? void 0 : E(c, x),
|
|
1707
|
+
onFetchSource: async () => await (T == null ? void 0 : T(c, x))
|
|
1711
1708
|
}
|
|
1712
1709
|
)
|
|
1713
1710
|
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1720,19 +1717,19 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1720
1717
|
amountText: (Lt = c.metadata) == null ? void 0 : Lt.amount_text,
|
|
1721
1718
|
detail: (zt = c.metadata) == null ? void 0 : zt.attachment_detail,
|
|
1722
1719
|
paymentStatus: (Ft = c.metadata) == null ? void 0 : Ft.payment_status,
|
|
1723
|
-
isUnlocking:
|
|
1724
|
-
onUnlockClick: () =>
|
|
1725
|
-
onFetchSource: async () => await (
|
|
1726
|
-
onDownloadClick: () =>
|
|
1720
|
+
isUnlocking: N(c.id),
|
|
1721
|
+
onUnlockClick: () => E == null ? void 0 : E(c, x),
|
|
1722
|
+
onFetchSource: async () => await (T == null ? void 0 : T(c, x)),
|
|
1723
|
+
onDownloadClick: () => M == null ? void 0 : M(c, x)
|
|
1727
1724
|
}
|
|
1728
1725
|
),
|
|
1729
|
-
|
|
1726
|
+
S && /* @__PURE__ */ n(S, {})
|
|
1730
1727
|
] }),
|
|
1731
1728
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1732
1729
|
jt,
|
|
1733
1730
|
{
|
|
1734
|
-
message:
|
|
1735
|
-
renderText:
|
|
1731
|
+
message: Y,
|
|
1732
|
+
renderText: v
|
|
1736
1733
|
}
|
|
1737
1734
|
) })
|
|
1738
1735
|
] }) : wt ? (
|
|
@@ -1748,24 +1745,24 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1748
1745
|
}
|
|
1749
1746
|
),
|
|
1750
1747
|
xt && /* @__PURE__ */ n(Zn, { poll: xt }),
|
|
1751
|
-
|
|
1752
|
-
|
|
1748
|
+
U != null && U.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1749
|
+
I,
|
|
1753
1750
|
{
|
|
1754
1751
|
actionHandler: o,
|
|
1755
|
-
attachments:
|
|
1752
|
+
attachments: U
|
|
1756
1753
|
}
|
|
1757
1754
|
) : null,
|
|
1758
|
-
|
|
1755
|
+
W ? /* @__PURE__ */ n(
|
|
1759
1756
|
w,
|
|
1760
1757
|
{
|
|
1761
|
-
message:
|
|
1762
|
-
renderText:
|
|
1758
|
+
message: Y,
|
|
1759
|
+
renderText: v
|
|
1763
1760
|
}
|
|
1764
1761
|
) : /* @__PURE__ */ n(
|
|
1765
1762
|
jt,
|
|
1766
1763
|
{
|
|
1767
|
-
message:
|
|
1768
|
-
renderText:
|
|
1764
|
+
message: Y,
|
|
1765
|
+
renderText: v
|
|
1769
1766
|
}
|
|
1770
1767
|
),
|
|
1771
1768
|
/* @__PURE__ */ n(Qn, {})
|
|
@@ -1790,20 +1787,20 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1790
1787
|
}
|
|
1791
1788
|
)
|
|
1792
1789
|
] }),
|
|
1793
|
-
|
|
1794
|
-
|
|
1790
|
+
Z && /* @__PURE__ */ n(
|
|
1791
|
+
ee,
|
|
1795
1792
|
{
|
|
1796
1793
|
onClick: d,
|
|
1797
1794
|
reply_count: c.reply_count
|
|
1798
1795
|
}
|
|
1799
1796
|
),
|
|
1800
|
-
|
|
1797
|
+
re && /* @__PURE__ */ n(J, {})
|
|
1801
1798
|
]
|
|
1802
1799
|
},
|
|
1803
1800
|
c.id
|
|
1804
1801
|
)
|
|
1805
1802
|
] });
|
|
1806
|
-
}, Oa =
|
|
1803
|
+
}, Oa = j.memo(
|
|
1807
1804
|
Pa,
|
|
1808
1805
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : zn(e, t)
|
|
1809
1806
|
), $a = (e) => {
|
|
@@ -1908,7 +1905,7 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1908
1905
|
// fixed-height hero would spill out of the collapsed card box.
|
|
1909
1906
|
/* @__PURE__ */ n("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__ */ n("div", { className: "w-full shrink-0", children: /* @__PURE__ */ n(Va, { link: r, onDismiss: s }) }, r.og_scrape_url)) })
|
|
1910
1907
|
) : null;
|
|
1911
|
-
}, ct =
|
|
1908
|
+
}, ct = j.createContext(!1), Pi = () => ke(ct), Ya = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1912
1909
|
"button",
|
|
1913
1910
|
{
|
|
1914
1911
|
...s,
|
|
@@ -1977,7 +1974,7 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1977
1974
|
composerInput: r
|
|
1978
1975
|
}) => {
|
|
1979
1976
|
var o;
|
|
1980
|
-
const { channel: i } =
|
|
1977
|
+
const { channel: i } = ce(), l = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
|
|
1981
1978
|
return s ? /* @__PURE__ */ m(se, { children: [
|
|
1982
1979
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
1983
1980
|
t == null ? void 0 : t()
|
|
@@ -2060,7 +2057,7 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2060
2057
|
"data-dm-agent-system-type": s.type,
|
|
2061
2058
|
children: [
|
|
2062
2059
|
/* @__PURE__ */ n(
|
|
2063
|
-
|
|
2060
|
+
he,
|
|
2064
2061
|
{
|
|
2065
2062
|
size: 16,
|
|
2066
2063
|
weight: "regular",
|
|
@@ -2125,16 +2122,16 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2125
2122
|
Ue.Generating,
|
|
2126
2123
|
Ue.ExternalSources
|
|
2127
2124
|
]), rr = ({ threadList: e }) => {
|
|
2128
|
-
var
|
|
2129
|
-
const { channel: t, channelConfig: s, thread: a } =
|
|
2125
|
+
var v, _;
|
|
2126
|
+
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = de(), { typing: i = {} } = os(), { aiState: l } = cs(t), o = ke(fn);
|
|
2130
2127
|
if (!e && o && ar.has(l)) {
|
|
2131
|
-
const
|
|
2128
|
+
const b = ir(t, (v = r.user) == null ? void 0 : v.id);
|
|
2132
2129
|
return /* @__PURE__ */ n(
|
|
2133
2130
|
qt,
|
|
2134
2131
|
{
|
|
2135
|
-
avatarId: (
|
|
2136
|
-
avatarName: (
|
|
2137
|
-
avatarImage:
|
|
2132
|
+
avatarId: (b == null ? void 0 : b.id) ?? "ai-agent",
|
|
2133
|
+
avatarName: (b == null ? void 0 : b.name) ?? (b == null ? void 0 : b.id) ?? "Agent",
|
|
2134
|
+
avatarImage: b == null ? void 0 : b.image,
|
|
2138
2135
|
testId: "typing-indicator-ai"
|
|
2139
2136
|
}
|
|
2140
2137
|
);
|
|
@@ -2142,25 +2139,25 @@ const Ma = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2142
2139
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
2143
2140
|
return null;
|
|
2144
2141
|
const u = e ? [] : Object.values(i).filter(
|
|
2145
|
-
({ parent_id:
|
|
2146
|
-
var
|
|
2147
|
-
return (
|
|
2142
|
+
({ parent_id: b, user: p }) => {
|
|
2143
|
+
var x;
|
|
2144
|
+
return (p == null ? void 0 : p.id) !== ((x = r.user) == null ? void 0 : x.id) && !b;
|
|
2148
2145
|
}
|
|
2149
|
-
),
|
|
2150
|
-
({ parent_id:
|
|
2151
|
-
var
|
|
2152
|
-
return (
|
|
2146
|
+
), g = e ? Object.values(i).filter(
|
|
2147
|
+
({ parent_id: b, user: p }) => {
|
|
2148
|
+
var x;
|
|
2149
|
+
return (p == null ? void 0 : p.id) !== ((x = r.user) == null ? void 0 : x.id) && b === (a == null ? void 0 : a.id);
|
|
2153
2150
|
}
|
|
2154
|
-
) : [], h = e ?
|
|
2151
|
+
) : [], h = e ? g : u;
|
|
2155
2152
|
if (!h.length)
|
|
2156
2153
|
return null;
|
|
2157
|
-
const
|
|
2154
|
+
const f = (_ = h[0]) == null ? void 0 : _.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
2158
2155
|
return /* @__PURE__ */ n(
|
|
2159
2156
|
qt,
|
|
2160
2157
|
{
|
|
2161
|
-
avatarId: (
|
|
2162
|
-
avatarName: (
|
|
2163
|
-
avatarImage: (
|
|
2158
|
+
avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
|
|
2159
|
+
avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
2160
|
+
avatarImage: (f == null ? void 0 : f.image) ?? (c == null ? void 0 : c.image),
|
|
2164
2161
|
testId: "typing-indicator"
|
|
2165
2162
|
}
|
|
2166
2163
|
);
|
|
@@ -2220,7 +2217,7 @@ function ir(e, t) {
|
|
|
2220
2217
|
const lr = () => null, or = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
2221
2218
|
"div",
|
|
2222
2219
|
{
|
|
2223
|
-
className:
|
|
2220
|
+
className: k("flex items-center justify-center h-full", e),
|
|
2224
2221
|
children: [
|
|
2225
2222
|
/* @__PURE__ */ m("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2226
2223
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2260,12 +2257,12 @@ const lr = () => null, or = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
|
2260
2257
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2261
2258
|
]
|
|
2262
2259
|
}
|
|
2263
|
-
), Le =
|
|
2260
|
+
), Le = j.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ m("div", { className: "flex items-center", children: [
|
|
2264
2261
|
/* @__PURE__ */ n(or, { className: "w-6 h-6" }),
|
|
2265
2262
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2266
2263
|
] }) }));
|
|
2267
2264
|
Le.displayName = "LoadingState";
|
|
2268
|
-
const
|
|
2265
|
+
const ue = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Re = "Replies instantly with AI assistant", cr = ({
|
|
2269
2266
|
onBack: e,
|
|
2270
2267
|
showBackButton: t,
|
|
2271
2268
|
showStarButton: s = !1,
|
|
@@ -2276,38 +2273,38 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2276
2273
|
showBlockParticipant: o = !0,
|
|
2277
2274
|
showReportParticipant: d = !0,
|
|
2278
2275
|
onDeleteConversationClick: u,
|
|
2279
|
-
onBlockParticipantClick:
|
|
2276
|
+
onBlockParticipantClick: g,
|
|
2280
2277
|
onReportParticipantClick: h,
|
|
2281
|
-
customChannelActions:
|
|
2278
|
+
customChannelActions: f,
|
|
2282
2279
|
renderChannelActions: c,
|
|
2283
|
-
showChannelInfo:
|
|
2280
|
+
showChannelInfo: v = !0,
|
|
2284
2281
|
onParticipantNameClick: _,
|
|
2285
|
-
renderHeaderTitleBadges:
|
|
2282
|
+
renderHeaderTitleBadges: b
|
|
2286
2283
|
}) => {
|
|
2287
|
-
var A,
|
|
2288
|
-
const { channel:
|
|
2284
|
+
var A, I, C, S, O, F;
|
|
2285
|
+
const { channel: p } = ce(), { client: x } = de(), N = j.useMemo(
|
|
2289
2286
|
() => {
|
|
2290
|
-
var
|
|
2287
|
+
var B;
|
|
2291
2288
|
return Oe(
|
|
2292
|
-
(
|
|
2293
|
-
|
|
2294
|
-
|
|
2289
|
+
(B = p.state) == null ? void 0 : B.members,
|
|
2290
|
+
x == null ? void 0 : x.userID,
|
|
2291
|
+
p.type
|
|
2295
2292
|
);
|
|
2296
2293
|
},
|
|
2297
|
-
[(A =
|
|
2298
|
-
),
|
|
2299
|
-
channel:
|
|
2300
|
-
participant:
|
|
2301
|
-
}), D = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90",
|
|
2302
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
2294
|
+
[(A = p.state) == null ? void 0 : A.members, x == null ? void 0 : x.userID, p.type]
|
|
2295
|
+
), E = st(N == null ? void 0 : N.user), T = (I = N == null ? void 0 : N.user) == null ? void 0 : I.image, M = nt(p), L = b == null ? void 0 : b({
|
|
2296
|
+
channel: p,
|
|
2297
|
+
participant: N
|
|
2298
|
+
}), D = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", P = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", z = /* @__PURE__ */ m(se, { children: [
|
|
2299
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: E }),
|
|
2303
2300
|
L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
|
|
2304
2301
|
] }), y = async () => {
|
|
2305
2302
|
try {
|
|
2306
|
-
|
|
2307
|
-
} catch (
|
|
2303
|
+
M ? await p.unpin() : await p.pin();
|
|
2304
|
+
} catch (B) {
|
|
2308
2305
|
console.error(
|
|
2309
2306
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2310
|
-
|
|
2307
|
+
B
|
|
2311
2308
|
);
|
|
2312
2309
|
}
|
|
2313
2310
|
};
|
|
@@ -2316,8 +2313,8 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2316
2313
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2317
2314
|
"button",
|
|
2318
2315
|
{
|
|
2319
|
-
className:
|
|
2320
|
-
|
|
2316
|
+
className: k(
|
|
2317
|
+
ue,
|
|
2321
2318
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2322
2319
|
),
|
|
2323
2320
|
onClick: e || (() => {
|
|
@@ -2337,8 +2334,8 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2337
2334
|
{
|
|
2338
2335
|
type: "button",
|
|
2339
2336
|
onClick: _,
|
|
2340
|
-
"aria-label": `View details for ${
|
|
2341
|
-
className:
|
|
2337
|
+
"aria-label": `View details for ${E}`,
|
|
2338
|
+
className: k(
|
|
2342
2339
|
D,
|
|
2343
2340
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2344
2341
|
),
|
|
@@ -2346,20 +2343,20 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2346
2343
|
/* @__PURE__ */ n(
|
|
2347
2344
|
ne,
|
|
2348
2345
|
{
|
|
2349
|
-
id: ((
|
|
2350
|
-
name:
|
|
2351
|
-
image:
|
|
2352
|
-
starred: s &&
|
|
2346
|
+
id: ((C = N == null ? void 0 : N.user) == null ? void 0 : C.id) || p.id || "unknown",
|
|
2347
|
+
name: E,
|
|
2348
|
+
image: T,
|
|
2349
|
+
starred: s && M,
|
|
2353
2350
|
dmAgentEnabled: a,
|
|
2354
2351
|
size: 48
|
|
2355
2352
|
}
|
|
2356
2353
|
),
|
|
2357
2354
|
/* @__PURE__ */ m("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
2358
2355
|
z,
|
|
2359
|
-
/* @__PURE__ */ n(
|
|
2356
|
+
/* @__PURE__ */ n(me, { className: "size-3 shrink-0", weight: "bold" })
|
|
2360
2357
|
] }),
|
|
2361
2358
|
a && /* @__PURE__ */ m("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2362
|
-
/* @__PURE__ */ n(
|
|
2359
|
+
/* @__PURE__ */ n(he, { className: "size-3 shrink-0 text-black/55" }),
|
|
2363
2360
|
/* @__PURE__ */ n("span", { children: Re })
|
|
2364
2361
|
] })
|
|
2365
2362
|
]
|
|
@@ -2368,10 +2365,10 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2368
2365
|
/* @__PURE__ */ n(
|
|
2369
2366
|
ne,
|
|
2370
2367
|
{
|
|
2371
|
-
id: ((
|
|
2372
|
-
name:
|
|
2373
|
-
image:
|
|
2374
|
-
starred: s &&
|
|
2368
|
+
id: ((S = N == null ? void 0 : N.user) == null ? void 0 : S.id) || p.id || "unknown",
|
|
2369
|
+
name: E,
|
|
2370
|
+
image: T,
|
|
2371
|
+
starred: s && M,
|
|
2375
2372
|
dmAgentEnabled: a,
|
|
2376
2373
|
size: 48
|
|
2377
2374
|
}
|
|
@@ -2379,7 +2376,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2379
2376
|
/* @__PURE__ */ m("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
2380
2377
|
z,
|
|
2381
2378
|
/* @__PURE__ */ n(
|
|
2382
|
-
|
|
2379
|
+
me,
|
|
2383
2380
|
{
|
|
2384
2381
|
className: "invisible size-3 shrink-0",
|
|
2385
2382
|
weight: "bold"
|
|
@@ -2387,7 +2384,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2387
2384
|
)
|
|
2388
2385
|
] }),
|
|
2389
2386
|
a && /* @__PURE__ */ m("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2390
|
-
/* @__PURE__ */ n(
|
|
2387
|
+
/* @__PURE__ */ n(he, { className: "size-3 shrink-0 text-black/55" }),
|
|
2391
2388
|
/* @__PURE__ */ n("span", { children: Re })
|
|
2392
2389
|
] })
|
|
2393
2390
|
] })
|
|
@@ -2397,37 +2394,37 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2397
2394
|
s && /* @__PURE__ */ n(
|
|
2398
2395
|
"button",
|
|
2399
2396
|
{
|
|
2400
|
-
className:
|
|
2397
|
+
className: ue,
|
|
2401
2398
|
onClick: y,
|
|
2402
2399
|
type: "button",
|
|
2403
|
-
"aria-label":
|
|
2400
|
+
"aria-label": M ? "Unstar conversation" : "Star conversation",
|
|
2404
2401
|
children: /* @__PURE__ */ n(
|
|
2405
2402
|
ye,
|
|
2406
2403
|
{
|
|
2407
|
-
className:
|
|
2408
|
-
"text-yellow-600":
|
|
2409
|
-
"text-black/90": !
|
|
2404
|
+
className: k("size-5", {
|
|
2405
|
+
"text-yellow-600": M,
|
|
2406
|
+
"text-black/90": !M
|
|
2410
2407
|
}),
|
|
2411
|
-
weight:
|
|
2408
|
+
weight: M ? "duotone" : "regular"
|
|
2412
2409
|
}
|
|
2413
2410
|
)
|
|
2414
2411
|
}
|
|
2415
2412
|
),
|
|
2416
|
-
|
|
2413
|
+
v && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2417
2414
|
Ke,
|
|
2418
2415
|
{
|
|
2419
|
-
channel:
|
|
2420
|
-
participant:
|
|
2416
|
+
channel: p,
|
|
2417
|
+
participant: N,
|
|
2421
2418
|
showDeleteConversation: l,
|
|
2422
2419
|
showBlockParticipant: o,
|
|
2423
2420
|
showReportParticipant: d,
|
|
2424
2421
|
onLeaveConversation: r,
|
|
2425
2422
|
onBlockParticipant: i,
|
|
2426
2423
|
onDeleteConversationClick: u,
|
|
2427
|
-
onBlockParticipantClick:
|
|
2424
|
+
onBlockParticipantClick: g,
|
|
2428
2425
|
onReportParticipantClick: h,
|
|
2429
|
-
customChannelActions:
|
|
2430
|
-
triggerClassName:
|
|
2426
|
+
customChannelActions: f,
|
|
2427
|
+
triggerClassName: k(ue, "bg-[#F1F0EE]")
|
|
2431
2428
|
}
|
|
2432
2429
|
))
|
|
2433
2430
|
] })
|
|
@@ -2437,8 +2434,8 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2437
2434
|
t && e && /* @__PURE__ */ n(
|
|
2438
2435
|
"button",
|
|
2439
2436
|
{
|
|
2440
|
-
className:
|
|
2441
|
-
|
|
2437
|
+
className: k(
|
|
2438
|
+
ue,
|
|
2442
2439
|
"messaging-channel-view-back-button-desktop"
|
|
2443
2440
|
),
|
|
2444
2441
|
type: "button",
|
|
@@ -2452,19 +2449,19 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2452
2449
|
{
|
|
2453
2450
|
type: "button",
|
|
2454
2451
|
onClick: _,
|
|
2455
|
-
"aria-label": `View details for ${
|
|
2456
|
-
className:
|
|
2457
|
-
|
|
2452
|
+
"aria-label": `View details for ${E}`,
|
|
2453
|
+
className: k(
|
|
2454
|
+
P,
|
|
2458
2455
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
2459
2456
|
),
|
|
2460
2457
|
children: [
|
|
2461
2458
|
/* @__PURE__ */ n(
|
|
2462
2459
|
ne,
|
|
2463
2460
|
{
|
|
2464
|
-
id: ((
|
|
2465
|
-
name:
|
|
2466
|
-
image:
|
|
2467
|
-
starred: s &&
|
|
2461
|
+
id: ((O = N == null ? void 0 : N.user) == null ? void 0 : O.id) || p.id || "unknown",
|
|
2462
|
+
name: E,
|
|
2463
|
+
image: T,
|
|
2464
|
+
starred: s && M,
|
|
2468
2465
|
dmAgentEnabled: a,
|
|
2469
2466
|
size: 48
|
|
2470
2467
|
}
|
|
@@ -2472,23 +2469,23 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2472
2469
|
/* @__PURE__ */ m("div", { className: "min-w-0", children: [
|
|
2473
2470
|
/* @__PURE__ */ m("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2474
2471
|
z,
|
|
2475
|
-
/* @__PURE__ */ n(
|
|
2472
|
+
/* @__PURE__ */ n(me, { className: "size-4 shrink-0", weight: "bold" })
|
|
2476
2473
|
] }),
|
|
2477
2474
|
a && /* @__PURE__ */ m("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2478
|
-
/* @__PURE__ */ n(
|
|
2475
|
+
/* @__PURE__ */ n(he, { className: "size-3 shrink-0 text-black/55" }),
|
|
2479
2476
|
/* @__PURE__ */ n("span", { className: "truncate", children: Re })
|
|
2480
2477
|
] })
|
|
2481
2478
|
] })
|
|
2482
2479
|
]
|
|
2483
2480
|
}
|
|
2484
|
-
) : /* @__PURE__ */ m("div", { className:
|
|
2481
|
+
) : /* @__PURE__ */ m("div", { className: P, children: [
|
|
2485
2482
|
/* @__PURE__ */ n(
|
|
2486
2483
|
ne,
|
|
2487
2484
|
{
|
|
2488
|
-
id: ((F =
|
|
2489
|
-
name:
|
|
2490
|
-
image:
|
|
2491
|
-
starred: s &&
|
|
2485
|
+
id: ((F = N == null ? void 0 : N.user) == null ? void 0 : F.id) || p.id || "unknown",
|
|
2486
|
+
name: E,
|
|
2487
|
+
image: T,
|
|
2488
|
+
starred: s && M,
|
|
2492
2489
|
dmAgentEnabled: a,
|
|
2493
2490
|
size: 48
|
|
2494
2491
|
}
|
|
@@ -2497,7 +2494,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2497
2494
|
/* @__PURE__ */ m("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2498
2495
|
z,
|
|
2499
2496
|
/* @__PURE__ */ n(
|
|
2500
|
-
|
|
2497
|
+
me,
|
|
2501
2498
|
{
|
|
2502
2499
|
className: "invisible size-4 shrink-0",
|
|
2503
2500
|
weight: "bold"
|
|
@@ -2505,7 +2502,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2505
2502
|
)
|
|
2506
2503
|
] }),
|
|
2507
2504
|
a && /* @__PURE__ */ m("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2508
|
-
/* @__PURE__ */ n(
|
|
2505
|
+
/* @__PURE__ */ n(he, { className: "size-3 shrink-0 text-black/55" }),
|
|
2509
2506
|
/* @__PURE__ */ n("span", { className: "truncate", children: Re })
|
|
2510
2507
|
] })
|
|
2511
2508
|
] })
|
|
@@ -2515,37 +2512,37 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2515
2512
|
s && /* @__PURE__ */ n(
|
|
2516
2513
|
"button",
|
|
2517
2514
|
{
|
|
2518
|
-
className:
|
|
2515
|
+
className: ue,
|
|
2519
2516
|
onClick: y,
|
|
2520
2517
|
type: "button",
|
|
2521
|
-
"aria-label":
|
|
2518
|
+
"aria-label": M ? "Unstar conversation" : "Star conversation",
|
|
2522
2519
|
children: /* @__PURE__ */ n(
|
|
2523
2520
|
ye,
|
|
2524
2521
|
{
|
|
2525
|
-
className:
|
|
2526
|
-
"text-yellow-600":
|
|
2527
|
-
"text-black/90": !
|
|
2522
|
+
className: k("size-6", {
|
|
2523
|
+
"text-yellow-600": M,
|
|
2524
|
+
"text-black/90": !M
|
|
2528
2525
|
}),
|
|
2529
|
-
weight:
|
|
2526
|
+
weight: M ? "duotone" : "regular"
|
|
2530
2527
|
}
|
|
2531
2528
|
)
|
|
2532
2529
|
}
|
|
2533
2530
|
),
|
|
2534
|
-
|
|
2531
|
+
v && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2535
2532
|
Ke,
|
|
2536
2533
|
{
|
|
2537
|
-
channel:
|
|
2538
|
-
participant:
|
|
2534
|
+
channel: p,
|
|
2535
|
+
participant: N,
|
|
2539
2536
|
showDeleteConversation: l,
|
|
2540
2537
|
showBlockParticipant: o,
|
|
2541
2538
|
showReportParticipant: d,
|
|
2542
2539
|
onLeaveConversation: r,
|
|
2543
2540
|
onBlockParticipant: i,
|
|
2544
2541
|
onDeleteConversationClick: u,
|
|
2545
|
-
onBlockParticipantClick:
|
|
2542
|
+
onBlockParticipantClick: g,
|
|
2546
2543
|
onReportParticipantClick: h,
|
|
2547
|
-
customChannelActions:
|
|
2548
|
-
triggerClassName:
|
|
2544
|
+
customChannelActions: f,
|
|
2545
|
+
triggerClassName: ue
|
|
2549
2546
|
}
|
|
2550
2547
|
))
|
|
2551
2548
|
] })
|
|
@@ -2562,86 +2559,112 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2562
2559
|
showDeleteConversation: o = !0,
|
|
2563
2560
|
onDeleteConversationClick: d,
|
|
2564
2561
|
onBlockParticipantClick: u,
|
|
2565
|
-
onReportParticipantClick:
|
|
2562
|
+
onReportParticipantClick: g,
|
|
2566
2563
|
showBlockParticipant: h = !0,
|
|
2567
|
-
showReportParticipant:
|
|
2564
|
+
showReportParticipant: f = !0,
|
|
2568
2565
|
composerDisabled: c = !1,
|
|
2569
|
-
composerDisabledReason:
|
|
2566
|
+
composerDisabledReason: v,
|
|
2570
2567
|
showStarButton: _ = !1,
|
|
2571
|
-
chatbotVotingEnabled:
|
|
2572
|
-
renderChannelBanner:
|
|
2573
|
-
renderHeaderTitleBadges:
|
|
2574
|
-
customChannelActions:
|
|
2575
|
-
renderChannelActions:
|
|
2576
|
-
renderMessage:
|
|
2577
|
-
dmAgentEnabled:
|
|
2568
|
+
chatbotVotingEnabled: b = !1,
|
|
2569
|
+
renderChannelBanner: p,
|
|
2570
|
+
renderHeaderTitleBadges: x,
|
|
2571
|
+
customChannelActions: N,
|
|
2572
|
+
renderChannelActions: E,
|
|
2573
|
+
renderMessage: T,
|
|
2574
|
+
dmAgentEnabled: M = !1,
|
|
2578
2575
|
viewerLanguage: L,
|
|
2579
2576
|
showChannelInfo: D = !0,
|
|
2580
|
-
onParticipantNameClick:
|
|
2577
|
+
onParticipantNameClick: P,
|
|
2581
2578
|
composerInput: z
|
|
2582
2579
|
}) => {
|
|
2583
|
-
var
|
|
2584
|
-
const { channel: y } =
|
|
2580
|
+
var w, R, G, H;
|
|
2581
|
+
const { channel: y } = ce(), { client: A } = de(), I = j.useMemo(
|
|
2585
2582
|
() => {
|
|
2586
|
-
var
|
|
2583
|
+
var W;
|
|
2587
2584
|
return Oe(
|
|
2588
|
-
(
|
|
2585
|
+
(W = y.state) == null ? void 0 : W.members,
|
|
2589
2586
|
A == null ? void 0 : A.userID,
|
|
2590
2587
|
y.type
|
|
2591
2588
|
);
|
|
2592
2589
|
},
|
|
2593
|
-
[(
|
|
2594
|
-
),
|
|
2595
|
-
var
|
|
2596
|
-
const
|
|
2597
|
-
return
|
|
2598
|
-
var
|
|
2599
|
-
return ((
|
|
2590
|
+
[(w = y.state) == null ? void 0 : w.members, A == null ? void 0 : A.userID, y.type]
|
|
2591
|
+
), C = j.useMemo(() => {
|
|
2592
|
+
var Y;
|
|
2593
|
+
const W = A == null ? void 0 : A.userID;
|
|
2594
|
+
return W ? Object.values(((Y = y.state) == null ? void 0 : Y.members) || {}).find((Z) => {
|
|
2595
|
+
var re;
|
|
2596
|
+
return ((re = Z.user) == null ? void 0 : re.id) === W;
|
|
2600
2597
|
}) : void 0;
|
|
2601
|
-
}, [A == null ? void 0 : A.userID, (
|
|
2602
|
-
|
|
2603
|
-
|
|
2598
|
+
}, [A == null ? void 0 : A.userID, (R = y.state) == null ? void 0 : R.members]), S = ((G = C == null ? void 0 : C.user) == null ? void 0 : G.is_account) ?? (C == null ? void 0 : C.is_account), O = ((H = I == null ? void 0 : I.user) == null ? void 0 : H.is_account) ?? (I == null ? void 0 : I.is_account), F = M && S === !1 && O === !0, B = y.state.messages.length > 0, J = p ? /* @__PURE__ */ n(j.Fragment, { children: p() }, "lt-channel-banner") : null, ee = P ? /* @__PURE__ */ n(
|
|
2599
|
+
ea,
|
|
2600
|
+
{
|
|
2601
|
+
onBack: e,
|
|
2602
|
+
showBackButton: t,
|
|
2603
|
+
showChannelInfo: D,
|
|
2604
|
+
showStarButton: _,
|
|
2605
|
+
dmAgentEnabled: F,
|
|
2606
|
+
onLeaveConversation: i,
|
|
2607
|
+
onBlockParticipant: l,
|
|
2608
|
+
showDeleteConversation: o,
|
|
2609
|
+
showBlockParticipant: h,
|
|
2610
|
+
showReportParticipant: f,
|
|
2611
|
+
onDeleteConversationClick: d,
|
|
2612
|
+
onBlockParticipantClick: u,
|
|
2613
|
+
onReportParticipantClick: g,
|
|
2614
|
+
customChannelActions: N,
|
|
2615
|
+
renderChannelActions: E,
|
|
2616
|
+
onParticipantNameClick: P
|
|
2617
|
+
}
|
|
2618
|
+
) : null, q = K(
|
|
2619
|
+
(W) => {
|
|
2620
|
+
const { message: U } = Ce("ChannelView"), Y = /* @__PURE__ */ n(
|
|
2604
2621
|
$a,
|
|
2605
2622
|
{
|
|
2606
|
-
...
|
|
2607
|
-
chatbotVotingEnabled:
|
|
2623
|
+
...W,
|
|
2624
|
+
chatbotVotingEnabled: b,
|
|
2608
2625
|
viewerLanguage: L
|
|
2609
2626
|
}
|
|
2610
2627
|
);
|
|
2611
|
-
return !
|
|
2628
|
+
return !T || !U ? Y : T(Y, U);
|
|
2612
2629
|
},
|
|
2613
|
-
[
|
|
2630
|
+
[b, T, L]
|
|
2614
2631
|
);
|
|
2615
2632
|
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
2616
2633
|
us,
|
|
2617
2634
|
{
|
|
2618
2635
|
overrides: {
|
|
2619
|
-
Message:
|
|
2636
|
+
Message: q,
|
|
2620
2637
|
MessageActions: Ua
|
|
2621
2638
|
},
|
|
2622
2639
|
children: /* @__PURE__ */ m(ms, { children: [
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2640
|
+
!P && /* @__PURE__ */ m(se, { children: [
|
|
2641
|
+
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2642
|
+
cr,
|
|
2643
|
+
{
|
|
2644
|
+
onBack: e,
|
|
2645
|
+
showBackButton: t,
|
|
2646
|
+
showChannelInfo: D,
|
|
2647
|
+
showStarButton: _,
|
|
2648
|
+
dmAgentEnabled: F,
|
|
2649
|
+
onLeaveConversation: i,
|
|
2650
|
+
onBlockParticipant: l,
|
|
2651
|
+
showDeleteConversation: o,
|
|
2652
|
+
showBlockParticipant: h,
|
|
2653
|
+
showReportParticipant: f,
|
|
2654
|
+
onDeleteConversationClick: d,
|
|
2655
|
+
onBlockParticipantClick: u,
|
|
2656
|
+
onReportParticipantClick: g,
|
|
2657
|
+
customChannelActions: N,
|
|
2658
|
+
renderChannelActions: E,
|
|
2659
|
+
renderHeaderTitleBadges: x
|
|
2660
|
+
}
|
|
2661
|
+
) }, "lt-channel-header"),
|
|
2662
|
+
J
|
|
2663
|
+
] }),
|
|
2664
|
+
P && !B && /* @__PURE__ */ m("div", { className: "px-4 @lg:px-6", children: [
|
|
2665
|
+
ee,
|
|
2666
|
+
J
|
|
2667
|
+
] }),
|
|
2645
2668
|
/* @__PURE__ */ n(
|
|
2646
2669
|
"div",
|
|
2647
2670
|
{
|
|
@@ -2649,30 +2672,9 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2649
2672
|
children: /* @__PURE__ */ n(
|
|
2650
2673
|
hs,
|
|
2651
2674
|
{
|
|
2652
|
-
head:
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
{
|
|
2656
|
-
onBack: e,
|
|
2657
|
-
showBackButton: t,
|
|
2658
|
-
showChannelInfo: D,
|
|
2659
|
-
showStarButton: _,
|
|
2660
|
-
dmAgentEnabled: F,
|
|
2661
|
-
onLeaveConversation: i,
|
|
2662
|
-
onBlockParticipant: l,
|
|
2663
|
-
showDeleteConversation: o,
|
|
2664
|
-
showBlockParticipant: h,
|
|
2665
|
-
showReportParticipant: g,
|
|
2666
|
-
onDeleteConversationClick: d,
|
|
2667
|
-
onBlockParticipantClick: u,
|
|
2668
|
-
onReportParticipantClick: p,
|
|
2669
|
-
customChannelActions: x,
|
|
2670
|
-
renderChannelActions: I,
|
|
2671
|
-
onParticipantNameClick: $,
|
|
2672
|
-
renderHeaderTitleBadges: N
|
|
2673
|
-
}
|
|
2674
|
-
),
|
|
2675
|
-
U
|
|
2675
|
+
head: P && B ? /* @__PURE__ */ m("div", { className: "sticky top-0 z-10", children: [
|
|
2676
|
+
ee,
|
|
2677
|
+
J
|
|
2676
2678
|
] }) : void 0,
|
|
2677
2679
|
hideDeletedMessages: !0,
|
|
2678
2680
|
hideNewMessageSeparator: !1
|
|
@@ -2681,7 +2683,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2681
2683
|
},
|
|
2682
2684
|
"lt-channel-message-list"
|
|
2683
2685
|
),
|
|
2684
|
-
r ? /* @__PURE__ */ n(
|
|
2686
|
+
r ? /* @__PURE__ */ n(j.Fragment, { children: r(y) }, "lt-channel-conversation-footer") : null,
|
|
2685
2687
|
/* @__PURE__ */ n(
|
|
2686
2688
|
Wa,
|
|
2687
2689
|
{
|
|
@@ -2690,7 +2692,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2690
2692
|
},
|
|
2691
2693
|
renderFooter: () => a == null ? void 0 : a(y),
|
|
2692
2694
|
disabled: c,
|
|
2693
|
-
disabledReason:
|
|
2695
|
+
disabledReason: v,
|
|
2694
2696
|
composerInput: z
|
|
2695
2697
|
},
|
|
2696
2698
|
"lt-channel-message-input"
|
|
@@ -2698,7 +2700,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2698
2700
|
] })
|
|
2699
2701
|
}
|
|
2700
2702
|
) });
|
|
2701
|
-
}, gn =
|
|
2703
|
+
}, gn = j.memo(
|
|
2702
2704
|
({
|
|
2703
2705
|
channel: e,
|
|
2704
2706
|
onBack: t,
|
|
@@ -2710,72 +2712,72 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2710
2712
|
onBlockParticipant: o,
|
|
2711
2713
|
className: d,
|
|
2712
2714
|
CustomChannelEmptyState: u = lr,
|
|
2713
|
-
showDeleteConversation:
|
|
2715
|
+
showDeleteConversation: g = !0,
|
|
2714
2716
|
onDeleteConversationClick: h,
|
|
2715
|
-
onBlockParticipantClick:
|
|
2717
|
+
onBlockParticipantClick: f,
|
|
2716
2718
|
onReportParticipantClick: c,
|
|
2717
|
-
showBlockParticipant:
|
|
2719
|
+
showBlockParticipant: v = !0,
|
|
2718
2720
|
showReportParticipant: _ = !0,
|
|
2719
|
-
composerDisabled:
|
|
2720
|
-
composerDisabledReason:
|
|
2721
|
-
dmAgentEnabled:
|
|
2722
|
-
messageMetadata:
|
|
2723
|
-
onMessageSent:
|
|
2724
|
-
showStarButton:
|
|
2725
|
-
chatbotVotingEnabled:
|
|
2721
|
+
composerDisabled: b = !1,
|
|
2722
|
+
composerDisabledReason: p,
|
|
2723
|
+
dmAgentEnabled: x,
|
|
2724
|
+
messageMetadata: N,
|
|
2725
|
+
onMessageSent: E,
|
|
2726
|
+
showStarButton: T = !1,
|
|
2727
|
+
chatbotVotingEnabled: M = !1,
|
|
2726
2728
|
renderChannelBanner: L,
|
|
2727
2729
|
renderHeaderTitleBadges: D,
|
|
2728
|
-
customChannelActions:
|
|
2730
|
+
customChannelActions: P,
|
|
2729
2731
|
renderChannelActions: z,
|
|
2730
2732
|
renderMessage: y,
|
|
2731
2733
|
onMessageLinkClick: A,
|
|
2732
|
-
sendButton:
|
|
2733
|
-
attachmentPreviewList:
|
|
2734
|
-
viewerLanguage:
|
|
2735
|
-
showChannelInfo:
|
|
2734
|
+
sendButton: I,
|
|
2735
|
+
attachmentPreviewList: C,
|
|
2736
|
+
viewerLanguage: S,
|
|
2737
|
+
showChannelInfo: O = !0,
|
|
2736
2738
|
onParticipantNameClick: F,
|
|
2737
|
-
composerInput:
|
|
2739
|
+
composerInput: B
|
|
2738
2740
|
}) => {
|
|
2739
|
-
const
|
|
2740
|
-
async (
|
|
2741
|
-
var
|
|
2742
|
-
const
|
|
2741
|
+
const J = K(
|
|
2742
|
+
async (q, w, R) => {
|
|
2743
|
+
var Z;
|
|
2744
|
+
const G = ((Z = e.data) == null ? void 0 : Z.chatbot_paused) === !0, H = x && !G, W = {
|
|
2743
2745
|
...w,
|
|
2744
2746
|
...H && { silent: !0 },
|
|
2745
|
-
...
|
|
2747
|
+
...N && {
|
|
2746
2748
|
metadata: {
|
|
2747
2749
|
...w.metadata ?? {},
|
|
2748
|
-
...
|
|
2750
|
+
...N
|
|
2749
2751
|
}
|
|
2750
2752
|
}
|
|
2751
|
-
},
|
|
2752
|
-
...
|
|
2753
|
+
}, U = {
|
|
2754
|
+
...R,
|
|
2753
2755
|
...H && { skip_push: !0 }
|
|
2754
|
-
},
|
|
2755
|
-
return
|
|
2756
|
+
}, Y = await e.sendMessage(W, U);
|
|
2757
|
+
return E == null || E(Y), Y;
|
|
2756
2758
|
},
|
|
2757
|
-
[e,
|
|
2758
|
-
),
|
|
2759
|
-
return
|
|
2759
|
+
[e, x, N, E]
|
|
2760
|
+
), ee = V(null);
|
|
2761
|
+
return X(() => {
|
|
2760
2762
|
if (!A) return;
|
|
2761
|
-
const
|
|
2762
|
-
if (!
|
|
2763
|
-
const w = (
|
|
2764
|
-
const
|
|
2765
|
-
if (!
|
|
2766
|
-
const
|
|
2767
|
-
A(
|
|
2763
|
+
const q = ee.current;
|
|
2764
|
+
if (!q) return;
|
|
2765
|
+
const w = (R) => {
|
|
2766
|
+
const G = R.target, H = G == null ? void 0 : G.closest("a[href]"), W = H == null ? void 0 : H.getAttribute("href");
|
|
2767
|
+
if (!W) return;
|
|
2768
|
+
const U = H == null ? void 0 : H.closest("[data-message-id]"), Y = U == null ? void 0 : U.getAttribute("data-message-id"), Z = Y ? e.state.messages.find((re) => re.id === Y) : void 0;
|
|
2769
|
+
A(W, Z);
|
|
2768
2770
|
};
|
|
2769
|
-
return
|
|
2771
|
+
return q.addEventListener("click", w), () => q.removeEventListener("click", w);
|
|
2770
2772
|
}, [A, e]), /* @__PURE__ */ n(
|
|
2771
2773
|
"div",
|
|
2772
2774
|
{
|
|
2773
|
-
ref:
|
|
2774
|
-
className:
|
|
2775
|
+
ref: ee,
|
|
2776
|
+
className: k(
|
|
2775
2777
|
"messaging-channel-view h-full flex flex-col",
|
|
2776
2778
|
d
|
|
2777
2779
|
),
|
|
2778
|
-
children: /* @__PURE__ */ n(fn.Provider, { value:
|
|
2780
|
+
children: /* @__PURE__ */ n(fn.Provider, { value: x ?? !1, children: /* @__PURE__ */ n(
|
|
2779
2781
|
ds,
|
|
2780
2782
|
{
|
|
2781
2783
|
channel: e,
|
|
@@ -2784,9 +2786,9 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2784
2786
|
LoadingIndicator: Le,
|
|
2785
2787
|
DateSeparator: ta,
|
|
2786
2788
|
TypingIndicator: rr,
|
|
2787
|
-
doSendMessageRequest:
|
|
2788
|
-
...
|
|
2789
|
-
...
|
|
2789
|
+
doSendMessageRequest: J,
|
|
2790
|
+
...I ? { SendButton: I } : {},
|
|
2791
|
+
...C ? { AttachmentPreviewList: C } : {},
|
|
2790
2792
|
children: /* @__PURE__ */ n(
|
|
2791
2793
|
dr,
|
|
2792
2794
|
{
|
|
@@ -2798,26 +2800,26 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2798
2800
|
onLeaveConversation: l,
|
|
2799
2801
|
onBlockParticipant: o,
|
|
2800
2802
|
CustomChannelEmptyState: u,
|
|
2801
|
-
showDeleteConversation:
|
|
2803
|
+
showDeleteConversation: g,
|
|
2802
2804
|
onDeleteConversationClick: h,
|
|
2803
|
-
onBlockParticipantClick:
|
|
2805
|
+
onBlockParticipantClick: f,
|
|
2804
2806
|
onReportParticipantClick: c,
|
|
2805
|
-
showBlockParticipant:
|
|
2807
|
+
showBlockParticipant: v,
|
|
2806
2808
|
showReportParticipant: _,
|
|
2807
|
-
composerDisabled:
|
|
2808
|
-
composerDisabledReason:
|
|
2809
|
-
showStarButton:
|
|
2810
|
-
dmAgentEnabled:
|
|
2811
|
-
chatbotVotingEnabled:
|
|
2809
|
+
composerDisabled: b,
|
|
2810
|
+
composerDisabledReason: p,
|
|
2811
|
+
showStarButton: T,
|
|
2812
|
+
dmAgentEnabled: x,
|
|
2813
|
+
chatbotVotingEnabled: M,
|
|
2812
2814
|
renderChannelBanner: L,
|
|
2813
2815
|
renderHeaderTitleBadges: D,
|
|
2814
|
-
customChannelActions:
|
|
2816
|
+
customChannelActions: P,
|
|
2815
2817
|
renderChannelActions: z,
|
|
2816
2818
|
renderMessage: y,
|
|
2817
|
-
viewerLanguage:
|
|
2818
|
-
showChannelInfo:
|
|
2819
|
+
viewerLanguage: S,
|
|
2820
|
+
showChannelInfo: O,
|
|
2819
2821
|
onParticipantNameClick: F,
|
|
2820
|
-
composerInput:
|
|
2822
|
+
composerInput: B
|
|
2821
2823
|
}
|
|
2822
2824
|
)
|
|
2823
2825
|
}
|
|
@@ -2827,7 +2829,7 @@ const de = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2827
2829
|
}
|
|
2828
2830
|
);
|
|
2829
2831
|
gn.displayName = "ChannelView";
|
|
2830
|
-
const we =
|
|
2832
|
+
const we = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ m("div", { className: "text-center max-w-sm", children: [
|
|
2831
2833
|
/* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2832
2834
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2833
2835
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2853,138 +2855,138 @@ const Oi = ({
|
|
|
2853
2855
|
CustomChannelEmptyState: o,
|
|
2854
2856
|
onBlockParticipantClick: d,
|
|
2855
2857
|
onReportParticipantClick: u,
|
|
2856
|
-
dmAgentEnabled:
|
|
2858
|
+
dmAgentEnabled: g,
|
|
2857
2859
|
onMessageSent: h,
|
|
2858
|
-
chatbotVotingEnabled:
|
|
2860
|
+
chatbotVotingEnabled: f = !1,
|
|
2859
2861
|
viewerLanguage: c,
|
|
2860
|
-
renderHeaderTitleBadges:
|
|
2862
|
+
renderHeaderTitleBadges: v,
|
|
2861
2863
|
renderChannelBanner: _,
|
|
2862
|
-
customChannelActions:
|
|
2863
|
-
renderChannelActions:
|
|
2864
|
-
onParticipantNameClick:
|
|
2865
|
-
renderMessage:
|
|
2866
|
-
onMessageLinkClick:
|
|
2867
|
-
showChannelInfo:
|
|
2868
|
-
composerInput:
|
|
2864
|
+
customChannelActions: b,
|
|
2865
|
+
renderChannelActions: p,
|
|
2866
|
+
onParticipantNameClick: x,
|
|
2867
|
+
renderMessage: N,
|
|
2868
|
+
onMessageLinkClick: E,
|
|
2869
|
+
showChannelInfo: T,
|
|
2870
|
+
composerInput: M
|
|
2869
2871
|
}) => {
|
|
2870
2872
|
const {
|
|
2871
2873
|
client: L,
|
|
2872
2874
|
isConnected: D,
|
|
2873
|
-
isLoading:
|
|
2875
|
+
isLoading: P,
|
|
2874
2876
|
error: z,
|
|
2875
2877
|
refreshConnection: y,
|
|
2876
2878
|
service: A,
|
|
2877
|
-
debug:
|
|
2878
|
-
} = js(), [
|
|
2879
|
-
|
|
2880
|
-
const w =
|
|
2879
|
+
debug: I
|
|
2880
|
+
} = js(), [C, S] = $(null), [O, F] = $(null), [B, J] = $(!1), { showDeleteConversation: ee = !0 } = e, q = V(l);
|
|
2881
|
+
q.current = l;
|
|
2882
|
+
const w = V(a);
|
|
2881
2883
|
w.current = a;
|
|
2882
|
-
const
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
}, [
|
|
2884
|
+
const R = V(null), G = V(null);
|
|
2885
|
+
X(() => {
|
|
2886
|
+
G.current = C;
|
|
2887
|
+
}, [C]), X(() => {
|
|
2886
2888
|
if (!L || !D) return;
|
|
2887
|
-
const
|
|
2888
|
-
if (!
|
|
2889
|
-
const
|
|
2890
|
-
if (
|
|
2891
|
-
|
|
2892
|
-
const
|
|
2893
|
-
|
|
2889
|
+
const U = L.userID;
|
|
2890
|
+
if (!U) return;
|
|
2891
|
+
const Y = `${U}::${i}`;
|
|
2892
|
+
if (R.current === Y) return;
|
|
2893
|
+
R.current = Y;
|
|
2894
|
+
const Z = () => {
|
|
2895
|
+
R.current === Y && (R.current = null);
|
|
2894
2896
|
};
|
|
2895
2897
|
(async () => {
|
|
2896
2898
|
var ge, pe;
|
|
2897
2899
|
try {
|
|
2898
|
-
|
|
2900
|
+
I && console.log(
|
|
2899
2901
|
"[MessagingShell] Loading initial conversation with:",
|
|
2900
2902
|
i
|
|
2901
2903
|
);
|
|
2902
|
-
const
|
|
2904
|
+
const Q = await L.queryChannels(
|
|
2903
2905
|
{
|
|
2904
2906
|
type: "messaging",
|
|
2905
|
-
members: { $eq: [
|
|
2907
|
+
members: { $eq: [U, i] }
|
|
2906
2908
|
},
|
|
2907
2909
|
{},
|
|
2908
2910
|
{ limit: 1 }
|
|
2909
2911
|
);
|
|
2910
|
-
if (
|
|
2911
|
-
|
|
2912
|
+
if (Q.length > 0) {
|
|
2913
|
+
S(Q[0]), F(null), (ge = w.current) == null || ge.call(w, Q[0]), I && console.log(
|
|
2912
2914
|
"[MessagingShell] Initial conversation loaded:",
|
|
2913
|
-
|
|
2915
|
+
Q[0].id
|
|
2914
2916
|
);
|
|
2915
2917
|
return;
|
|
2916
2918
|
}
|
|
2917
|
-
const te =
|
|
2919
|
+
const te = q.current;
|
|
2918
2920
|
if (!te || !A) {
|
|
2919
|
-
|
|
2921
|
+
Z(), F("No conversation found with this account"), I && console.log(
|
|
2920
2922
|
"[MessagingShell] No conversation found for:",
|
|
2921
2923
|
i
|
|
2922
2924
|
);
|
|
2923
2925
|
return;
|
|
2924
2926
|
}
|
|
2925
2927
|
try {
|
|
2926
|
-
const
|
|
2928
|
+
const oe = await A.startChannelWithParticipant({
|
|
2927
2929
|
id: te.id,
|
|
2928
2930
|
name: te.name,
|
|
2929
2931
|
phone: te.phone
|
|
2930
2932
|
});
|
|
2931
|
-
|
|
2933
|
+
S(oe), F(null), (pe = w.current) == null || pe.call(w, oe), I && console.log(
|
|
2932
2934
|
"[MessagingShell] Channel created and loaded:",
|
|
2933
|
-
|
|
2935
|
+
oe.id
|
|
2934
2936
|
);
|
|
2935
|
-
} catch (
|
|
2937
|
+
} catch (oe) {
|
|
2936
2938
|
console.error(
|
|
2937
2939
|
"[MessagingShell] Failed to create conversation:",
|
|
2938
|
-
|
|
2939
|
-
),
|
|
2940
|
+
oe
|
|
2941
|
+
), Z(), F("Failed to create conversation");
|
|
2940
2942
|
}
|
|
2941
|
-
} catch (
|
|
2943
|
+
} catch (Q) {
|
|
2942
2944
|
console.error(
|
|
2943
2945
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2944
|
-
|
|
2945
|
-
),
|
|
2946
|
+
Q
|
|
2947
|
+
), Z(), G.current || F("Failed to load conversation");
|
|
2946
2948
|
}
|
|
2947
2949
|
})();
|
|
2948
|
-
}, [i, L, D, A,
|
|
2949
|
-
const H =
|
|
2950
|
+
}, [i, L, D, A, I]);
|
|
2951
|
+
const H = V(r);
|
|
2950
2952
|
H.current = r;
|
|
2951
|
-
const
|
|
2952
|
-
var
|
|
2953
|
-
|
|
2953
|
+
const W = K(() => {
|
|
2954
|
+
var U;
|
|
2955
|
+
S(null), J(!0), (U = H.current) == null || U.call(H);
|
|
2954
2956
|
}, []);
|
|
2955
|
-
return
|
|
2957
|
+
return P ? /* @__PURE__ */ n(Le, {}) : z ? /* @__PURE__ */ n(we, { message: z, onBack: y }) : !D || !L ? /* @__PURE__ */ n(
|
|
2956
2958
|
we,
|
|
2957
2959
|
{
|
|
2958
2960
|
message: "Not connected to messaging service",
|
|
2959
2961
|
onBack: y
|
|
2960
2962
|
}
|
|
2961
|
-
) :
|
|
2963
|
+
) : O ? /* @__PURE__ */ n(we, { message: O }) : B && !C ? /* @__PURE__ */ n(we, { message: "Conversation ended" }) : C ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2962
2964
|
gn,
|
|
2963
2965
|
{
|
|
2964
|
-
channel:
|
|
2966
|
+
channel: C,
|
|
2965
2967
|
renderMessageInputActions: t,
|
|
2966
2968
|
renderConversationFooter: s,
|
|
2967
2969
|
renderChannelBanner: _,
|
|
2968
|
-
onLeaveConversation:
|
|
2969
|
-
onBlockParticipant:
|
|
2970
|
+
onLeaveConversation: W,
|
|
2971
|
+
onBlockParticipant: W,
|
|
2970
2972
|
CustomChannelEmptyState: o,
|
|
2971
|
-
showDeleteConversation:
|
|
2973
|
+
showDeleteConversation: ee,
|
|
2972
2974
|
onBlockParticipantClick: d,
|
|
2973
2975
|
onReportParticipantClick: u,
|
|
2974
|
-
dmAgentEnabled:
|
|
2976
|
+
dmAgentEnabled: g,
|
|
2975
2977
|
onMessageSent: h,
|
|
2976
|
-
chatbotVotingEnabled:
|
|
2978
|
+
chatbotVotingEnabled: f,
|
|
2977
2979
|
viewerLanguage: c,
|
|
2978
|
-
renderHeaderTitleBadges:
|
|
2979
|
-
customChannelActions:
|
|
2980
|
-
renderChannelActions:
|
|
2981
|
-
onParticipantNameClick:
|
|
2982
|
-
renderMessage:
|
|
2983
|
-
onMessageLinkClick:
|
|
2984
|
-
showChannelInfo:
|
|
2985
|
-
composerInput:
|
|
2980
|
+
renderHeaderTitleBadges: v,
|
|
2981
|
+
customChannelActions: b,
|
|
2982
|
+
renderChannelActions: p,
|
|
2983
|
+
onParticipantNameClick: x,
|
|
2984
|
+
renderMessage: N,
|
|
2985
|
+
onMessageLinkClick: E,
|
|
2986
|
+
showChannelInfo: T,
|
|
2987
|
+
composerInput: M
|
|
2986
2988
|
},
|
|
2987
|
-
|
|
2989
|
+
C.id
|
|
2988
2990
|
) }) }) : /* @__PURE__ */ n(Le, {});
|
|
2989
2991
|
};
|
|
2990
2992
|
function ur(e) {
|
|
@@ -2993,7 +2995,7 @@ function ur(e) {
|
|
|
2993
2995
|
for (const s of t)
|
|
2994
2996
|
e.state.addMessageSorted(s.message);
|
|
2995
2997
|
}
|
|
2996
|
-
const pn =
|
|
2998
|
+
const pn = j.createContext({
|
|
2997
2999
|
selectedChannel: void 0,
|
|
2998
3000
|
onChannelSelect: () => {
|
|
2999
3001
|
},
|
|
@@ -3001,7 +3003,7 @@ const pn = B.createContext({
|
|
|
3001
3003
|
renderMessagePreview: void 0,
|
|
3002
3004
|
channelPreview: void 0,
|
|
3003
3005
|
viewerLanguage: void 0
|
|
3004
|
-
}), mr = pn.Provider, hr = () =>
|
|
3006
|
+
}), mr = pn.Provider, hr = () => j.useContext(pn), fr = (e, t) => {
|
|
3005
3007
|
const s = new Date(
|
|
3006
3008
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
3007
3009
|
), r = new Date(
|
|
@@ -3022,9 +3024,9 @@ const pn = B.createContext({
|
|
|
3022
3024
|
day: "numeric",
|
|
3023
3025
|
year: "2-digit"
|
|
3024
3026
|
});
|
|
3025
|
-
}, bn =
|
|
3027
|
+
}, bn = j.memo(
|
|
3026
3028
|
(e) => {
|
|
3027
|
-
var D,
|
|
3029
|
+
var D, P, z;
|
|
3028
3030
|
const { channel: t, unread: s } = e, {
|
|
3029
3031
|
selectedChannel: a,
|
|
3030
3032
|
onChannelSelect: r,
|
|
@@ -3032,66 +3034,66 @@ const pn = B.createContext({
|
|
|
3032
3034
|
channelPreview: l,
|
|
3033
3035
|
renderMessagePreview: o,
|
|
3034
3036
|
viewerLanguage: d
|
|
3035
|
-
} = hr(), { client: u } =
|
|
3037
|
+
} = hr(), { client: u } = de(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = nt(t);
|
|
3036
3038
|
if (l)
|
|
3037
3039
|
return /* @__PURE__ */ n(
|
|
3038
3040
|
l,
|
|
3039
3041
|
{
|
|
3040
3042
|
...e,
|
|
3041
|
-
active:
|
|
3043
|
+
active: g,
|
|
3042
3044
|
selectedChannel: a,
|
|
3043
3045
|
onChannelSelect: r,
|
|
3044
3046
|
viewerLanguage: d
|
|
3045
3047
|
}
|
|
3046
3048
|
);
|
|
3047
|
-
const
|
|
3049
|
+
const f = () => {
|
|
3048
3050
|
t && r(t);
|
|
3049
3051
|
}, c = (y) => {
|
|
3050
|
-
const A = y.key === "Enter" || y.key === " ",
|
|
3051
|
-
!A ||
|
|
3052
|
-
},
|
|
3052
|
+
const A = y.key === "Enter" || y.key === " ", I = y.repeat;
|
|
3053
|
+
!A || I || (y.preventDefault(), f());
|
|
3054
|
+
}, v = Oe(
|
|
3053
3055
|
(D = t == null ? void 0 : t.state) == null ? void 0 : D.members,
|
|
3054
3056
|
u == null ? void 0 : u.userID,
|
|
3055
3057
|
t == null ? void 0 : t.type
|
|
3056
|
-
), _ = st(
|
|
3058
|
+
), _ = st(v == null ? void 0 : v.user), b = (P = v == null ? void 0 : v.user) == null ? void 0 : P.image, p = (() => {
|
|
3057
3059
|
var A;
|
|
3058
3060
|
const y = (A = t == null ? void 0 : t.state) == null ? void 0 : A.messages;
|
|
3059
3061
|
if (y != null && y.length) {
|
|
3060
|
-
for (let
|
|
3061
|
-
if (y[
|
|
3062
|
+
for (let I = y.length - 1; I >= 0; I--)
|
|
3063
|
+
if (y[I].type !== "system") return y[I];
|
|
3062
3064
|
}
|
|
3063
|
-
})(),
|
|
3064
|
-
var
|
|
3065
|
+
})(), N = (() => {
|
|
3066
|
+
var O, F, B, J;
|
|
3065
3067
|
const y = tn({
|
|
3066
|
-
message:
|
|
3068
|
+
message: p,
|
|
3067
3069
|
viewerLanguage: d
|
|
3068
3070
|
});
|
|
3069
|
-
if (((
|
|
3070
|
-
if (((F =
|
|
3071
|
-
if (((
|
|
3071
|
+
if (((O = p == null ? void 0 : p.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_TIP") return y ? `💵 ${y}` : "💵 Sent a tip";
|
|
3072
|
+
if (((F = p == null ? void 0 : p.metadata) == null ? void 0 : F.custom_type) === "MESSAGE_PAID") return y ? `💰 ${y}` : "💰 Sent a message";
|
|
3073
|
+
if (((B = p == null ? void 0 : p.metadata) == null ? void 0 : B.custom_type) === "MESSAGE_ATTACHMENT")
|
|
3072
3074
|
return y ? `📎 ${y}` : "📎 Sent an attachment";
|
|
3073
3075
|
if (y) return y;
|
|
3074
|
-
const
|
|
3075
|
-
return
|
|
3076
|
-
})(),
|
|
3076
|
+
const S = (J = p == null ? void 0 : p.attachments) == null ? void 0 : J[0];
|
|
3077
|
+
return S ? S.og_scrape_url ? S.og_scrape_url : S.type === "image" ? "📷 Sent an image" : S.type === "video" ? "🎥 Sent a video" : S.type === "audio" ? "🎵 Sent audio" : S.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
3078
|
+
})(), E = p != null && p.created_at ? gr(new Date(p.created_at)) : "", T = p ? De(p) : !1, M = o ? o(p, N) : `${T ? "✨ " : ""}${N}`, L = s ?? 0;
|
|
3077
3079
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
3078
3080
|
channelId: t == null ? void 0 : t.id,
|
|
3079
|
-
isSelected:
|
|
3081
|
+
isSelected: g,
|
|
3080
3082
|
participantName: _,
|
|
3081
3083
|
unreadCount: L,
|
|
3082
|
-
hasTimestamp: !!
|
|
3084
|
+
hasTimestamp: !!E
|
|
3083
3085
|
}), /* @__PURE__ */ n(
|
|
3084
3086
|
"div",
|
|
3085
3087
|
{
|
|
3086
3088
|
role: "button",
|
|
3087
3089
|
tabIndex: 0,
|
|
3088
|
-
onClick:
|
|
3090
|
+
onClick: f,
|
|
3089
3091
|
onKeyDown: c,
|
|
3090
|
-
className:
|
|
3092
|
+
className: k(
|
|
3091
3093
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
3092
3094
|
{
|
|
3093
|
-
"bg-black/[0.04]":
|
|
3094
|
-
"hover:bg-black/[0.02]": !
|
|
3095
|
+
"bg-black/[0.04]": g,
|
|
3096
|
+
"hover:bg-black/[0.02]": !g
|
|
3095
3097
|
}
|
|
3096
3098
|
),
|
|
3097
3099
|
"data-dd-privacy": "mask",
|
|
@@ -3099,9 +3101,9 @@ const pn = B.createContext({
|
|
|
3099
3101
|
/* @__PURE__ */ n(
|
|
3100
3102
|
ne,
|
|
3101
3103
|
{
|
|
3102
|
-
id: ((z =
|
|
3104
|
+
id: ((z = v == null ? void 0 : v.user) == null ? void 0 : z.id) || t.id || "unknown",
|
|
3103
3105
|
name: _,
|
|
3104
|
-
image:
|
|
3106
|
+
image: b,
|
|
3105
3107
|
size: 48,
|
|
3106
3108
|
starred: h
|
|
3107
3109
|
}
|
|
@@ -3111,7 +3113,7 @@ const pn = B.createContext({
|
|
|
3111
3113
|
/* @__PURE__ */ m(
|
|
3112
3114
|
"h3",
|
|
3113
3115
|
{
|
|
3114
|
-
className:
|
|
3116
|
+
className: k(
|
|
3115
3117
|
"text-sm font-medium truncate text-[#191918]"
|
|
3116
3118
|
),
|
|
3117
3119
|
children: [
|
|
@@ -3120,10 +3122,10 @@ const pn = B.createContext({
|
|
|
3120
3122
|
]
|
|
3121
3123
|
}
|
|
3122
3124
|
),
|
|
3123
|
-
|
|
3125
|
+
E && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: E })
|
|
3124
3126
|
] }),
|
|
3125
3127
|
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
3126
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
3128
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
3127
3129
|
L > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: L > 99 ? "99+" : L })
|
|
3128
3130
|
] })
|
|
3129
3131
|
] })
|
|
@@ -3133,7 +3135,7 @@ const pn = B.createContext({
|
|
|
3133
3135
|
}
|
|
3134
3136
|
);
|
|
3135
3137
|
bn.displayName = "CustomChannelPreview";
|
|
3136
|
-
const pr = { last_message_at: -1 }, br =
|
|
3138
|
+
const pr = { last_message_at: -1 }, br = j.memo(
|
|
3137
3139
|
({
|
|
3138
3140
|
onChannelSelect: e,
|
|
3139
3141
|
selectedChannel: t,
|
|
@@ -3145,31 +3147,31 @@ const pr = { last_message_at: -1 }, br = B.memo(
|
|
|
3145
3147
|
customEmptyStateIndicator: o,
|
|
3146
3148
|
channelListPaginator: d = gs,
|
|
3147
3149
|
channelPreview: u,
|
|
3148
|
-
renderMessagePreview:
|
|
3150
|
+
renderMessagePreview: g,
|
|
3149
3151
|
viewerLanguage: h
|
|
3150
3152
|
}) => {
|
|
3151
|
-
const
|
|
3152
|
-
|
|
3153
|
-
const { debug: c = !1 } = tt(),
|
|
3154
|
-
(
|
|
3155
|
-
for (const
|
|
3156
|
-
ur(
|
|
3157
|
-
return r ? r(
|
|
3153
|
+
const f = j.useRef(0);
|
|
3154
|
+
f.current++;
|
|
3155
|
+
const { debug: c = !1 } = tt(), v = j.useCallback(
|
|
3156
|
+
(b) => {
|
|
3157
|
+
for (const p of b)
|
|
3158
|
+
ur(p);
|
|
3159
|
+
return r ? r(b) : b;
|
|
3158
3160
|
},
|
|
3159
3161
|
[r]
|
|
3160
3162
|
);
|
|
3161
3163
|
c && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
3162
|
-
renderCount:
|
|
3164
|
+
renderCount: f.current,
|
|
3163
3165
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
3164
3166
|
filters: s
|
|
3165
3167
|
});
|
|
3166
|
-
const _ =
|
|
3168
|
+
const _ = j.useMemo(
|
|
3167
3169
|
() => ({
|
|
3168
3170
|
selectedChannel: t,
|
|
3169
3171
|
onChannelSelect: e,
|
|
3170
3172
|
debug: c,
|
|
3171
3173
|
channelPreview: u,
|
|
3172
|
-
renderMessagePreview:
|
|
3174
|
+
renderMessagePreview: g,
|
|
3173
3175
|
viewerLanguage: h
|
|
3174
3176
|
}),
|
|
3175
3177
|
[
|
|
@@ -3177,14 +3179,14 @@ const pr = { last_message_at: -1 }, br = B.memo(
|
|
|
3177
3179
|
e,
|
|
3178
3180
|
c,
|
|
3179
3181
|
u,
|
|
3180
|
-
|
|
3182
|
+
g,
|
|
3181
3183
|
h
|
|
3182
3184
|
]
|
|
3183
3185
|
);
|
|
3184
3186
|
return /* @__PURE__ */ n(
|
|
3185
3187
|
"div",
|
|
3186
3188
|
{
|
|
3187
|
-
className:
|
|
3189
|
+
className: k(
|
|
3188
3190
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
3189
3191
|
l
|
|
3190
3192
|
),
|
|
@@ -3195,7 +3197,7 @@ const pr = { last_message_at: -1 }, br = B.memo(
|
|
|
3195
3197
|
sort: i,
|
|
3196
3198
|
options: { limit: 30 },
|
|
3197
3199
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
3198
|
-
channelRenderFilterFn:
|
|
3200
|
+
channelRenderFilterFn: v,
|
|
3199
3201
|
Paginator: d,
|
|
3200
3202
|
Preview: bn,
|
|
3201
3203
|
EmptyStateIndicator: o
|
|
@@ -3223,7 +3225,7 @@ const wr = {
|
|
|
3223
3225
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
3224
3226
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
3225
3227
|
}, _r = ({ variant: e, cta: t }) => {
|
|
3226
|
-
const s =
|
|
3228
|
+
const s = k(
|
|
3227
3229
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
3228
3230
|
wr[e]
|
|
3229
3231
|
), a = dt(t.href);
|
|
@@ -3268,12 +3270,12 @@ const wr = {
|
|
|
3268
3270
|
cta: l,
|
|
3269
3271
|
trailingAction: o
|
|
3270
3272
|
}) => {
|
|
3271
|
-
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "",
|
|
3272
|
-
if (!
|
|
3273
|
-
const
|
|
3273
|
+
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", h = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", v = l != null;
|
|
3274
|
+
if (!g && !h && !c && !v) return null;
|
|
3275
|
+
const b = k(
|
|
3274
3276
|
"truncate text-base font-medium leading-6",
|
|
3275
3277
|
d && !t ? yr : Nr[e]
|
|
3276
|
-
),
|
|
3278
|
+
), p = k(
|
|
3277
3279
|
"truncate text-xs leading-4",
|
|
3278
3280
|
kr[e]
|
|
3279
3281
|
);
|
|
@@ -3281,19 +3283,19 @@ const wr = {
|
|
|
3281
3283
|
/* @__PURE__ */ m("div", { className: "flex items-end gap-3", children: [
|
|
3282
3284
|
/* @__PURE__ */ m("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
3283
3285
|
/* @__PURE__ */ m("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
3284
|
-
|
|
3286
|
+
g && /* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
3285
3287
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
3286
|
-
/* @__PURE__ */ n("p", { className:
|
|
3288
|
+
/* @__PURE__ */ n("p", { className: k("min-w-0", b), children: u })
|
|
3287
3289
|
] }),
|
|
3288
|
-
h && /* @__PURE__ */ n("p", { className:
|
|
3290
|
+
h && /* @__PURE__ */ n("p", { className: p, children: a })
|
|
3289
3291
|
] }),
|
|
3290
|
-
!
|
|
3292
|
+
!v && c && /* @__PURE__ */ n("p", { className: p, children: f })
|
|
3291
3293
|
] }),
|
|
3292
3294
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
3293
3295
|
] }),
|
|
3294
3296
|
l && /* @__PURE__ */ n(_r, { variant: e, cta: l })
|
|
3295
3297
|
] });
|
|
3296
|
-
}, Cr =
|
|
3298
|
+
}, Cr = k(
|
|
3297
3299
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
3298
3300
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
3299
3301
|
// the messaging design system's "small border around link attachments"
|
|
@@ -3311,7 +3313,7 @@ const wr = {
|
|
|
3311
3313
|
bgClassName: o,
|
|
3312
3314
|
"data-testid": d
|
|
3313
3315
|
}) => {
|
|
3314
|
-
const u = s != null || a != null,
|
|
3316
|
+
const u = s != null || a != null, g = k(
|
|
3315
3317
|
Cr,
|
|
3316
3318
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3317
3319
|
// `focus-ring` is a design-system utility from the component-library
|
|
@@ -3328,7 +3330,7 @@ const wr = {
|
|
|
3328
3330
|
rel: "noopener noreferrer",
|
|
3329
3331
|
onClick: a,
|
|
3330
3332
|
"data-testid": d,
|
|
3331
|
-
className:
|
|
3333
|
+
className: g,
|
|
3332
3334
|
children: [
|
|
3333
3335
|
t,
|
|
3334
3336
|
h
|
|
@@ -3342,7 +3344,7 @@ const wr = {
|
|
|
3342
3344
|
onClick: a,
|
|
3343
3345
|
"aria-label": r,
|
|
3344
3346
|
"data-testid": d,
|
|
3345
|
-
className:
|
|
3347
|
+
className: k(g, "text-left"),
|
|
3346
3348
|
children: [
|
|
3347
3349
|
t,
|
|
3348
3350
|
h
|
|
@@ -3353,7 +3355,7 @@ const wr = {
|
|
|
3353
3355
|
{
|
|
3354
3356
|
ref: i,
|
|
3355
3357
|
"data-testid": d,
|
|
3356
|
-
className:
|
|
3358
|
+
className: g,
|
|
3357
3359
|
children: [
|
|
3358
3360
|
t,
|
|
3359
3361
|
h
|
|
@@ -3366,9 +3368,9 @@ const wr = {
|
|
|
3366
3368
|
}, Ir = {
|
|
3367
3369
|
dark: "size-16 text-white/25",
|
|
3368
3370
|
light: "size-16 text-black/25"
|
|
3369
|
-
}, $e = (e, t) => !!t && !!e &&
|
|
3371
|
+
}, $e = (e, t) => !!t && !!e && le(e) === "audio", vn = (e, t) => {
|
|
3370
3372
|
if (!t || !e) return !1;
|
|
3371
|
-
const s =
|
|
3373
|
+
const s = le(e);
|
|
3372
3374
|
return s === "video" || s === "audio";
|
|
3373
3375
|
}, mt = "bg-[#F2F3F4]", Fe = ({
|
|
3374
3376
|
variant: e,
|
|
@@ -3379,7 +3381,7 @@ const wr = {
|
|
|
3379
3381
|
topLeft: i,
|
|
3380
3382
|
topRight: l
|
|
3381
3383
|
}) => {
|
|
3382
|
-
const o =
|
|
3384
|
+
const o = le(r), d = !!s && o === "video";
|
|
3383
3385
|
return $e(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3384
3386
|
"audio",
|
|
3385
3387
|
{
|
|
@@ -3392,7 +3394,7 @@ const wr = {
|
|
|
3392
3394
|
) }) : /* @__PURE__ */ m(
|
|
3393
3395
|
"div",
|
|
3394
3396
|
{
|
|
3395
|
-
className:
|
|
3397
|
+
className: k(
|
|
3396
3398
|
"relative h-[180px] w-full overflow-hidden",
|
|
3397
3399
|
d && "bg-black"
|
|
3398
3400
|
),
|
|
@@ -3419,11 +3421,11 @@ const wr = {
|
|
|
3419
3421
|
) : /* @__PURE__ */ n(
|
|
3420
3422
|
"div",
|
|
3421
3423
|
{
|
|
3422
|
-
className:
|
|
3424
|
+
className: k(
|
|
3423
3425
|
"flex h-full w-full items-center justify-center",
|
|
3424
3426
|
Er[e]
|
|
3425
3427
|
),
|
|
3426
|
-
children:
|
|
3428
|
+
children: fe(r, {
|
|
3427
3429
|
className: Ir[e],
|
|
3428
3430
|
weight: "regular"
|
|
3429
3431
|
})
|
|
@@ -3445,14 +3447,14 @@ const wr = {
|
|
|
3445
3447
|
layout: o = "featured",
|
|
3446
3448
|
appIcon: d,
|
|
3447
3449
|
cta: u,
|
|
3448
|
-
onDismiss:
|
|
3450
|
+
onDismiss: g,
|
|
3449
3451
|
onEditClick: h
|
|
3450
3452
|
}) => {
|
|
3451
|
-
const
|
|
3453
|
+
const f = o === "classic", c = $e(r, l), v = g ? /* @__PURE__ */ n(
|
|
3452
3454
|
"button",
|
|
3453
3455
|
{
|
|
3454
3456
|
type: "button",
|
|
3455
|
-
onClick:
|
|
3457
|
+
onClick: g,
|
|
3456
3458
|
"aria-label": "Dismiss attachment",
|
|
3457
3459
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3458
3460
|
children: /* @__PURE__ */ n(Pe, { className: "size-3", weight: "bold" })
|
|
@@ -3477,14 +3479,14 @@ const wr = {
|
|
|
3477
3479
|
mimeType: r
|
|
3478
3480
|
}
|
|
3479
3481
|
) }),
|
|
3480
|
-
|
|
3482
|
+
v && /* @__PURE__ */ n("div", { className: "shrink-0", children: v })
|
|
3481
3483
|
] }) }) : /* @__PURE__ */ m(
|
|
3482
3484
|
ze,
|
|
3483
3485
|
{
|
|
3484
3486
|
variant: "dark",
|
|
3485
|
-
topRight:
|
|
3487
|
+
topRight: f ? v : void 0,
|
|
3486
3488
|
children: [
|
|
3487
|
-
!
|
|
3489
|
+
!f && /* @__PURE__ */ n(
|
|
3488
3490
|
Fe,
|
|
3489
3491
|
{
|
|
3490
3492
|
variant: "dark",
|
|
@@ -3492,7 +3494,7 @@ const wr = {
|
|
|
3492
3494
|
sourceUrl: l,
|
|
3493
3495
|
title: e,
|
|
3494
3496
|
mimeType: r,
|
|
3495
|
-
topRight:
|
|
3497
|
+
topRight: v
|
|
3496
3498
|
}
|
|
3497
3499
|
),
|
|
3498
3500
|
/* @__PURE__ */ n(
|
|
@@ -3523,21 +3525,21 @@ const wr = {
|
|
|
3523
3525
|
cta: d,
|
|
3524
3526
|
onClick: u
|
|
3525
3527
|
}) => {
|
|
3526
|
-
const
|
|
3528
|
+
const g = vn(a, i), h = dt(s), f = d == null && h != null && !g ? h : void 0, c = d == null && !g ? u : void 0, v = $e(a, i) ? mt : void 0, _ = d && u ? {
|
|
3527
3529
|
...d,
|
|
3528
3530
|
onClick: () => {
|
|
3529
|
-
var
|
|
3530
|
-
u(), (
|
|
3531
|
+
var b;
|
|
3532
|
+
u(), (b = d.onClick) == null || b.call(d);
|
|
3531
3533
|
}
|
|
3532
3534
|
} : d;
|
|
3533
3535
|
return /* @__PURE__ */ m(
|
|
3534
3536
|
ze,
|
|
3535
3537
|
{
|
|
3536
3538
|
variant: "light",
|
|
3537
|
-
href:
|
|
3539
|
+
href: f,
|
|
3538
3540
|
onClick: c,
|
|
3539
3541
|
ariaLabel: e ?? "Open attachment preview",
|
|
3540
|
-
bgClassName:
|
|
3542
|
+
bgClassName: v,
|
|
3541
3543
|
"data-testid": "link-attachment",
|
|
3542
3544
|
children: [
|
|
3543
3545
|
l === "featured" && /* @__PURE__ */ n(
|
|
@@ -3575,15 +3577,15 @@ const wr = {
|
|
|
3575
3577
|
layout: o = "featured",
|
|
3576
3578
|
appIcon: d,
|
|
3577
3579
|
cta: u,
|
|
3578
|
-
onClick:
|
|
3580
|
+
onClick: g
|
|
3579
3581
|
}) => {
|
|
3580
|
-
const h = vn(r, l),
|
|
3582
|
+
const h = vn(r, l), f = dt(a), c = u == null && f != null && !h ? f : void 0, v = u == null && !h && c != null ? g : void 0;
|
|
3581
3583
|
return /* @__PURE__ */ m(
|
|
3582
3584
|
ze,
|
|
3583
3585
|
{
|
|
3584
3586
|
variant: "dark",
|
|
3585
3587
|
href: c,
|
|
3586
|
-
onClick:
|
|
3588
|
+
onClick: v,
|
|
3587
3589
|
bgClassName: $e(r, l) ? mt : void 0,
|
|
3588
3590
|
children: [
|
|
3589
3591
|
o === "featured" && /* @__PURE__ */ n(
|
|
@@ -3652,7 +3654,7 @@ const wr = {
|
|
|
3652
3654
|
{
|
|
3653
3655
|
"data-testid": l,
|
|
3654
3656
|
"data-group-position": a,
|
|
3655
|
-
className:
|
|
3657
|
+
className: k(
|
|
3656
3658
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3657
3659
|
// and keeps the document / image / audio bubbles visually
|
|
3658
3660
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3672,7 +3674,7 @@ const wr = {
|
|
|
3672
3674
|
o ? /* @__PURE__ */ n(
|
|
3673
3675
|
"p",
|
|
3674
3676
|
{
|
|
3675
|
-
className:
|
|
3677
|
+
className: k(
|
|
3676
3678
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3677
3679
|
// the same font family + size as `.str-chat__message-text`
|
|
3678
3680
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3701,7 +3703,7 @@ const wr = {
|
|
|
3701
3703
|
a.stopPropagation(), e();
|
|
3702
3704
|
},
|
|
3703
3705
|
"aria-label": s,
|
|
3704
|
-
className:
|
|
3706
|
+
className: k(
|
|
3705
3707
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3706
3708
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3707
3709
|
),
|
|
@@ -3739,10 +3741,10 @@ const wr = {
|
|
|
3739
3741
|
preload: o,
|
|
3740
3742
|
onDismiss: d
|
|
3741
3743
|
}) => {
|
|
3742
|
-
const u = Se(e),
|
|
3744
|
+
const u = Se(e), g = e === "composer" && !!d, h = Fr({ src: t, mimeType: s, filename: a, items: r });
|
|
3743
3745
|
if (h.length === 0)
|
|
3744
3746
|
return null;
|
|
3745
|
-
const
|
|
3747
|
+
const f = o ?? (h.length > 1 ? "none" : "metadata");
|
|
3746
3748
|
return /* @__PURE__ */ n(
|
|
3747
3749
|
Ee,
|
|
3748
3750
|
{
|
|
@@ -3750,18 +3752,18 @@ const wr = {
|
|
|
3750
3752
|
text: i,
|
|
3751
3753
|
groupPosition: l,
|
|
3752
3754
|
"data-testid": "audio-attachment",
|
|
3753
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: h.map((c,
|
|
3755
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: h.map((c, v) => /* @__PURE__ */ n(
|
|
3754
3756
|
Pr,
|
|
3755
3757
|
{
|
|
3756
3758
|
item: c,
|
|
3757
|
-
preload:
|
|
3759
|
+
preload: f,
|
|
3758
3760
|
trailingAction: (
|
|
3759
3761
|
// Composer only supports a single attachment, so the
|
|
3760
3762
|
// dismiss control sits on the only player.
|
|
3761
|
-
|
|
3763
|
+
g && v === 0 ? /* @__PURE__ */ n(Ie, { onClick: d, variant: "inline" }) : void 0
|
|
3762
3764
|
)
|
|
3763
3765
|
},
|
|
3764
|
-
`${c.src}-${
|
|
3766
|
+
`${c.src}-${v}`
|
|
3765
3767
|
)) })
|
|
3766
3768
|
}
|
|
3767
3769
|
);
|
|
@@ -3792,7 +3794,7 @@ function Gr(e, t) {
|
|
|
3792
3794
|
}
|
|
3793
3795
|
}
|
|
3794
3796
|
if (!e) return;
|
|
3795
|
-
if (
|
|
3797
|
+
if (le(e) === "document") {
|
|
3796
3798
|
const r = an(e), i = Vr[r];
|
|
3797
3799
|
if (i) return i;
|
|
3798
3800
|
if (e === "application/octet-stream") return;
|
|
@@ -3832,16 +3834,16 @@ const Yr = {
|
|
|
3832
3834
|
activateLabel: l,
|
|
3833
3835
|
trailingAction: o
|
|
3834
3836
|
}) => {
|
|
3835
|
-
const d = s ?? t ?? "File", u = Hr(a, t, r),
|
|
3837
|
+
const d = s ?? t ?? "File", u = Hr(a, t, r), g = /* @__PURE__ */ n(
|
|
3836
3838
|
"div",
|
|
3837
3839
|
{
|
|
3838
|
-
className:
|
|
3840
|
+
className: k(
|
|
3839
3841
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3840
3842
|
qr[e]
|
|
3841
3843
|
),
|
|
3842
3844
|
"aria-hidden": !0,
|
|
3843
|
-
children:
|
|
3844
|
-
className:
|
|
3845
|
+
children: fe(a, {
|
|
3846
|
+
className: k("size-6", Wr[e]),
|
|
3845
3847
|
weight: "regular"
|
|
3846
3848
|
})
|
|
3847
3849
|
}
|
|
@@ -3850,34 +3852,34 @@ const Yr = {
|
|
|
3850
3852
|
u ? /* @__PURE__ */ n(
|
|
3851
3853
|
"p",
|
|
3852
3854
|
{
|
|
3853
|
-
className:
|
|
3855
|
+
className: k(
|
|
3854
3856
|
"truncate text-xs leading-4",
|
|
3855
3857
|
Yr[e]
|
|
3856
3858
|
),
|
|
3857
3859
|
children: u
|
|
3858
3860
|
}
|
|
3859
3861
|
) : null
|
|
3860
|
-
] }),
|
|
3862
|
+
] }), f = i ? /* @__PURE__ */ m(
|
|
3861
3863
|
"button",
|
|
3862
3864
|
{
|
|
3863
3865
|
type: "button",
|
|
3864
3866
|
onClick: i,
|
|
3865
3867
|
"aria-label": l,
|
|
3866
|
-
className:
|
|
3868
|
+
className: k(
|
|
3867
3869
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3868
3870
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3869
3871
|
),
|
|
3870
3872
|
children: [
|
|
3871
|
-
|
|
3873
|
+
g,
|
|
3872
3874
|
h
|
|
3873
3875
|
]
|
|
3874
3876
|
}
|
|
3875
3877
|
) : /* @__PURE__ */ m(se, { children: [
|
|
3876
|
-
|
|
3878
|
+
g,
|
|
3877
3879
|
h
|
|
3878
3880
|
] });
|
|
3879
3881
|
return /* @__PURE__ */ m("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
3880
|
-
|
|
3882
|
+
f,
|
|
3881
3883
|
o ? /* @__PURE__ */ n("div", { className: "shrink-0", children: o }) : null
|
|
3882
3884
|
] });
|
|
3883
3885
|
};
|
|
@@ -3934,28 +3936,28 @@ const Xr = ({
|
|
|
3934
3936
|
text: o,
|
|
3935
3937
|
groupPosition: d,
|
|
3936
3938
|
onClick: u,
|
|
3937
|
-
onDismiss:
|
|
3939
|
+
onDismiss: g
|
|
3938
3940
|
}) => {
|
|
3939
|
-
const h = Se(e),
|
|
3941
|
+
const h = Se(e), f = e === "composer" && !!g, c = Xr({
|
|
3940
3942
|
src: t,
|
|
3941
3943
|
filename: s,
|
|
3942
3944
|
fileSize: a,
|
|
3943
3945
|
mimeType: r,
|
|
3944
3946
|
title: i,
|
|
3945
3947
|
items: l
|
|
3946
|
-
}),
|
|
3947
|
-
if ((u == null ? void 0 : u(
|
|
3948
|
-
const
|
|
3949
|
-
if (!
|
|
3950
|
-
const
|
|
3951
|
-
wn(
|
|
3948
|
+
}), v = (b) => {
|
|
3949
|
+
if ((u == null ? void 0 : u(b)) === !1) return;
|
|
3950
|
+
const p = c[b];
|
|
3951
|
+
if (!p) return;
|
|
3952
|
+
const x = p.filename ?? ae(p.src);
|
|
3953
|
+
wn(p.src, x);
|
|
3952
3954
|
};
|
|
3953
3955
|
if (c.length === 0)
|
|
3954
3956
|
return null;
|
|
3955
3957
|
const _ = /* @__PURE__ */ n(
|
|
3956
3958
|
"span",
|
|
3957
3959
|
{
|
|
3958
|
-
className:
|
|
3960
|
+
className: k(
|
|
3959
3961
|
"flex size-8 items-center justify-center rounded-full",
|
|
3960
3962
|
h === "dark" ? "text-white/70" : "text-black/70"
|
|
3961
3963
|
),
|
|
@@ -3970,16 +3972,16 @@ const Xr = ({
|
|
|
3970
3972
|
text: o,
|
|
3971
3973
|
groupPosition: d,
|
|
3972
3974
|
"data-testid": "file-attachment",
|
|
3973
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3975
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((b, p) => /* @__PURE__ */ n(
|
|
3974
3976
|
Kr,
|
|
3975
3977
|
{
|
|
3976
3978
|
variant: h,
|
|
3977
|
-
item:
|
|
3978
|
-
index:
|
|
3979
|
-
onActivate:
|
|
3980
|
-
trailingAction:
|
|
3979
|
+
item: b,
|
|
3980
|
+
index: p,
|
|
3981
|
+
onActivate: v,
|
|
3982
|
+
trailingAction: f && p === 0 ? /* @__PURE__ */ n(Ie, { onClick: g, variant: "inline" }) : _
|
|
3981
3983
|
},
|
|
3982
|
-
`${
|
|
3984
|
+
`${b.src}-${p}`
|
|
3983
3985
|
)) })
|
|
3984
3986
|
}
|
|
3985
3987
|
);
|
|
@@ -4010,7 +4012,7 @@ const Xr = ({
|
|
|
4010
4012
|
onClick: t,
|
|
4011
4013
|
"aria-label": a,
|
|
4012
4014
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
4013
|
-
children: /* @__PURE__ */ n(
|
|
4015
|
+
children: /* @__PURE__ */ n(me, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
4014
4016
|
}
|
|
4015
4017
|
)
|
|
4016
4018
|
] }), _n = ({
|
|
@@ -4022,7 +4024,7 @@ const Xr = ({
|
|
|
4022
4024
|
tone: i = "dark",
|
|
4023
4025
|
onTriggered: l
|
|
4024
4026
|
}) => {
|
|
4025
|
-
const [o, d] =
|
|
4027
|
+
const [o, d] = $(!1), u = K(
|
|
4026
4028
|
(c) => {
|
|
4027
4029
|
c.stopPropagation(), !o && (d(!0), wn(e, t).catch(() => {
|
|
4028
4030
|
}).finally(() => {
|
|
@@ -4030,7 +4032,7 @@ const Xr = ({
|
|
|
4030
4032
|
}));
|
|
4031
4033
|
},
|
|
4032
4034
|
[o, e, t, l]
|
|
4033
|
-
),
|
|
4035
|
+
), g = r ?? s !== "pill", f = { className: k(
|
|
4034
4036
|
s === "pill" ? "size-4" : "size-5",
|
|
4035
4037
|
"shrink-0"
|
|
4036
4038
|
), weight: "bold" };
|
|
@@ -4041,7 +4043,7 @@ const Xr = ({
|
|
|
4041
4043
|
onClick: u,
|
|
4042
4044
|
disabled: o,
|
|
4043
4045
|
"aria-label": a,
|
|
4044
|
-
className:
|
|
4046
|
+
className: k(
|
|
4045
4047
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
4046
4048
|
{
|
|
4047
4049
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -4080,8 +4082,8 @@ const Xr = ({
|
|
|
4080
4082
|
type: "button",
|
|
4081
4083
|
onClick: u,
|
|
4082
4084
|
disabled: o,
|
|
4083
|
-
"aria-label":
|
|
4084
|
-
className:
|
|
4085
|
+
"aria-label": g ? a : void 0,
|
|
4086
|
+
className: k(
|
|
4085
4087
|
"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",
|
|
4086
4088
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
4087
4089
|
),
|
|
@@ -4093,8 +4095,8 @@ const Xr = ({
|
|
|
4093
4095
|
weight: "bold",
|
|
4094
4096
|
"aria-hidden": !0
|
|
4095
4097
|
}
|
|
4096
|
-
) : /* @__PURE__ */ n(Ne, { ...
|
|
4097
|
-
|
|
4098
|
+
) : /* @__PURE__ */ n(Ne, { ...f, "aria-hidden": !0 }),
|
|
4099
|
+
g ? null : a
|
|
4098
4100
|
]
|
|
4099
4101
|
}
|
|
4100
4102
|
);
|
|
@@ -4103,23 +4105,23 @@ const Xr = ({
|
|
|
4103
4105
|
initialIndex: t,
|
|
4104
4106
|
open: s
|
|
4105
4107
|
}) => {
|
|
4106
|
-
const a = qe(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
4107
|
-
|
|
4108
|
+
const a = qe(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
|
|
4109
|
+
X(() => {
|
|
4108
4110
|
s && i(qe(t, 0, Math.max(e - 1, 0)));
|
|
4109
|
-
}, [s, t, e]),
|
|
4111
|
+
}, [s, t, e]), X(() => {
|
|
4110
4112
|
i((d) => qe(d, 0, Math.max(e - 1, 0)));
|
|
4111
4113
|
}, [e]);
|
|
4112
|
-
const l =
|
|
4114
|
+
const l = K(() => {
|
|
4113
4115
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
4114
|
-
}, [e]), o =
|
|
4116
|
+
}, [e]), o = K(() => {
|
|
4115
4117
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
4116
4118
|
}, [e]);
|
|
4117
|
-
return
|
|
4119
|
+
return X(() => {
|
|
4118
4120
|
if (!s || e <= 1) return;
|
|
4119
4121
|
const d = (u) => {
|
|
4120
4122
|
if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
|
|
4121
|
-
const
|
|
4122
|
-
|
|
4123
|
+
const g = document.activeElement;
|
|
4124
|
+
g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (u.preventDefault(), u.key === "ArrowLeft" ? l() : o());
|
|
4123
4125
|
};
|
|
4124
4126
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
4125
4127
|
}, [s, e, l, o]), { index: r, prev: l, next: o };
|
|
@@ -4132,9 +4134,9 @@ const Xr = ({
|
|
|
4132
4134
|
children: i,
|
|
4133
4135
|
"data-testid": l
|
|
4134
4136
|
}) => {
|
|
4135
|
-
const o =
|
|
4136
|
-
return
|
|
4137
|
-
var
|
|
4137
|
+
const o = V(null), d = V(null);
|
|
4138
|
+
return X(() => {
|
|
4139
|
+
var f;
|
|
4138
4140
|
const h = o.current;
|
|
4139
4141
|
if (h) {
|
|
4140
4142
|
if (e) {
|
|
@@ -4148,7 +4150,7 @@ const Xr = ({
|
|
|
4148
4150
|
else
|
|
4149
4151
|
h.setAttribute("open", "");
|
|
4150
4152
|
const c = typeof document < "u" ? document.activeElement : null;
|
|
4151
|
-
return (
|
|
4153
|
+
return (f = d.current) == null || f.focus(), () => {
|
|
4152
4154
|
if (h.open)
|
|
4153
4155
|
if (typeof h.close == "function")
|
|
4154
4156
|
try {
|
|
@@ -4223,7 +4225,7 @@ const Xr = ({
|
|
|
4223
4225
|
length: t.length,
|
|
4224
4226
|
initialIndex: s,
|
|
4225
4227
|
open: e
|
|
4226
|
-
}), o = t[r], d =
|
|
4228
|
+
}), o = t[r], d = ie(
|
|
4227
4229
|
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "image"),
|
|
4228
4230
|
[o]
|
|
4229
4231
|
);
|
|
@@ -4277,30 +4279,30 @@ const Xr = ({
|
|
|
4277
4279
|
}) => {
|
|
4278
4280
|
const r = e.length;
|
|
4279
4281
|
if (r === 0) return null;
|
|
4280
|
-
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, u,
|
|
4281
|
-
const h =
|
|
4282
|
+
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, u, g) => {
|
|
4283
|
+
const h = k(ti, "h-full w-full");
|
|
4282
4284
|
return t ? /* @__PURE__ */ m(
|
|
4283
4285
|
"button",
|
|
4284
4286
|
{
|
|
4285
4287
|
type: "button",
|
|
4286
4288
|
onClick: () => t(u),
|
|
4287
4289
|
"aria-label": d.ariaLabel ?? `Open media ${u + 1}`,
|
|
4288
|
-
className:
|
|
4290
|
+
className: k(h, "cursor-zoom-in"),
|
|
4289
4291
|
children: [
|
|
4290
4292
|
d.content,
|
|
4291
|
-
|
|
4293
|
+
g
|
|
4292
4294
|
]
|
|
4293
4295
|
},
|
|
4294
4296
|
u
|
|
4295
4297
|
) : /* @__PURE__ */ m("div", { className: h, children: [
|
|
4296
4298
|
d.content,
|
|
4297
|
-
|
|
4299
|
+
g
|
|
4298
4300
|
] }, u);
|
|
4299
4301
|
};
|
|
4300
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
4302
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: k("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
4301
4303
|
"div",
|
|
4302
4304
|
{
|
|
4303
|
-
className:
|
|
4305
|
+
className: k(
|
|
4304
4306
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
4305
4307
|
a
|
|
4306
4308
|
),
|
|
@@ -4309,7 +4311,7 @@ const Xr = ({
|
|
|
4309
4311
|
) : i.length === 3 ? /* @__PURE__ */ m(
|
|
4310
4312
|
"div",
|
|
4311
4313
|
{
|
|
4312
|
-
className:
|
|
4314
|
+
className: k(
|
|
4313
4315
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4314
4316
|
a
|
|
4315
4317
|
),
|
|
@@ -4322,16 +4324,16 @@ const Xr = ({
|
|
|
4322
4324
|
) : /* @__PURE__ */ n(
|
|
4323
4325
|
"div",
|
|
4324
4326
|
{
|
|
4325
|
-
className:
|
|
4327
|
+
className: k(
|
|
4326
4328
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4327
4329
|
a
|
|
4328
4330
|
),
|
|
4329
4331
|
children: i.map((d, u) => {
|
|
4330
|
-
const
|
|
4332
|
+
const g = l > 0 && u === i.length - 1;
|
|
4331
4333
|
return o(
|
|
4332
4334
|
d,
|
|
4333
4335
|
u,
|
|
4334
|
-
|
|
4336
|
+
g ? /* @__PURE__ */ m("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
4335
4337
|
"+",
|
|
4336
4338
|
l
|
|
4337
4339
|
] }) : null
|
|
@@ -4340,12 +4342,12 @@ const Xr = ({
|
|
|
4340
4342
|
}
|
|
4341
4343
|
);
|
|
4342
4344
|
}, Te = (e) => {
|
|
4343
|
-
const [t, s] =
|
|
4345
|
+
const [t, s] = $(!1), [a, r] = $(0), i = K(
|
|
4344
4346
|
(o) => {
|
|
4345
4347
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
4346
4348
|
},
|
|
4347
4349
|
[e]
|
|
4348
|
-
), l =
|
|
4350
|
+
), l = K(() => s(!1), []);
|
|
4349
4351
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
4350
4352
|
}, ni = (e, t, s, a) => ({
|
|
4351
4353
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
@@ -4417,18 +4419,18 @@ const Xr = ({
|
|
|
4417
4419
|
loading: o = "lazy",
|
|
4418
4420
|
onClick: d
|
|
4419
4421
|
}) => {
|
|
4420
|
-
const u = si({ src: t, alt: s, items: r }),
|
|
4422
|
+
const u = si({ src: t, alt: s, items: r }), g = Se(e), { viewerOpen: h, viewerIndex: f, handleActivate: c, closeViewer: v } = Te(
|
|
4421
4423
|
d
|
|
4422
4424
|
);
|
|
4423
4425
|
if (u.length === 0)
|
|
4424
4426
|
return null;
|
|
4425
4427
|
const _ = u.map(
|
|
4426
|
-
(
|
|
4428
|
+
(b, p) => ni(b, p, u.length, o)
|
|
4427
4429
|
);
|
|
4428
4430
|
return /* @__PURE__ */ m(
|
|
4429
4431
|
Ee,
|
|
4430
4432
|
{
|
|
4431
|
-
variant:
|
|
4433
|
+
variant: g,
|
|
4432
4434
|
text: i,
|
|
4433
4435
|
groupPosition: l,
|
|
4434
4436
|
"data-testid": "image-attachment",
|
|
@@ -4439,8 +4441,8 @@ const Xr = ({
|
|
|
4439
4441
|
{
|
|
4440
4442
|
open: h,
|
|
4441
4443
|
items: kn(u, a),
|
|
4442
|
-
initialIndex:
|
|
4443
|
-
onClose:
|
|
4444
|
+
initialIndex: f,
|
|
4445
|
+
onClose: v
|
|
4444
4446
|
}
|
|
4445
4447
|
)
|
|
4446
4448
|
]
|
|
@@ -4460,10 +4462,10 @@ const Xr = ({
|
|
|
4460
4462
|
length: t.length,
|
|
4461
4463
|
initialIndex: s,
|
|
4462
4464
|
open: e
|
|
4463
|
-
}), o = t[r], d =
|
|
4465
|
+
}), o = t[r], d = ie(
|
|
4464
4466
|
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "document"),
|
|
4465
4467
|
[o]
|
|
4466
|
-
), u =
|
|
4468
|
+
), u = ie(
|
|
4467
4469
|
() => o ? di(o.src) : void 0,
|
|
4468
4470
|
[o]
|
|
4469
4471
|
);
|
|
@@ -4540,51 +4542,51 @@ const Xr = ({
|
|
|
4540
4542
|
onClick: d,
|
|
4541
4543
|
onDismiss: u
|
|
4542
4544
|
}) => {
|
|
4543
|
-
const
|
|
4545
|
+
const g = Se(e), h = ui({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: _ } = Te(
|
|
4544
4546
|
d
|
|
4545
|
-
),
|
|
4547
|
+
), b = e === "composer" && !!u;
|
|
4546
4548
|
if (h.length === 0)
|
|
4547
4549
|
return null;
|
|
4548
|
-
const
|
|
4549
|
-
src:
|
|
4550
|
-
filename:
|
|
4550
|
+
const p = h.map((x) => ({
|
|
4551
|
+
src: x.src,
|
|
4552
|
+
filename: x.filename ?? ae(x.src)
|
|
4551
4553
|
}));
|
|
4552
4554
|
return /* @__PURE__ */ m(
|
|
4553
4555
|
Ee,
|
|
4554
4556
|
{
|
|
4555
|
-
variant:
|
|
4557
|
+
variant: g,
|
|
4556
4558
|
text: l,
|
|
4557
4559
|
groupPosition: o,
|
|
4558
4560
|
"data-testid": "pdf-attachment",
|
|
4559
4561
|
children: [
|
|
4560
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: h.map((
|
|
4561
|
-
const
|
|
4562
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: h.map((x, N) => {
|
|
4563
|
+
const E = x.filename ?? ae(x.src), T = b && N === 0 ? /* @__PURE__ */ n(Ie, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4562
4564
|
_n,
|
|
4563
4565
|
{
|
|
4564
|
-
url:
|
|
4565
|
-
filename:
|
|
4566
|
+
url: x.src,
|
|
4567
|
+
filename: E,
|
|
4566
4568
|
variant: "inline",
|
|
4567
|
-
label: `Download ${
|
|
4568
|
-
tone:
|
|
4569
|
+
label: `Download ${E}`,
|
|
4570
|
+
tone: g
|
|
4569
4571
|
}
|
|
4570
4572
|
);
|
|
4571
4573
|
return /* @__PURE__ */ n(
|
|
4572
4574
|
mi,
|
|
4573
4575
|
{
|
|
4574
|
-
variant:
|
|
4575
|
-
item:
|
|
4576
|
-
index:
|
|
4577
|
-
onActivate:
|
|
4578
|
-
trailingAction:
|
|
4576
|
+
variant: g,
|
|
4577
|
+
item: x,
|
|
4578
|
+
index: N,
|
|
4579
|
+
onActivate: v,
|
|
4580
|
+
trailingAction: T
|
|
4579
4581
|
},
|
|
4580
|
-
`${
|
|
4582
|
+
`${x.src}-${N}`
|
|
4581
4583
|
);
|
|
4582
4584
|
}) }),
|
|
4583
4585
|
/* @__PURE__ */ n(
|
|
4584
4586
|
ci,
|
|
4585
4587
|
{
|
|
4586
|
-
open:
|
|
4587
|
-
items:
|
|
4588
|
+
open: f,
|
|
4589
|
+
items: p,
|
|
4588
4590
|
initialIndex: c,
|
|
4589
4591
|
onClose: _
|
|
4590
4592
|
}
|
|
@@ -4606,7 +4608,7 @@ const Xr = ({
|
|
|
4606
4608
|
length: t.length,
|
|
4607
4609
|
initialIndex: s,
|
|
4608
4610
|
open: e
|
|
4609
|
-
}), o = t[r], d =
|
|
4611
|
+
}), o = t[r], d = ie(
|
|
4610
4612
|
() => (o == null ? void 0 : o.filename) ?? (o ? ae(o.src) : "video"),
|
|
4611
4613
|
[o]
|
|
4612
4614
|
);
|
|
@@ -4685,7 +4687,7 @@ const Xr = ({
|
|
|
4685
4687
|
preload: s.preload,
|
|
4686
4688
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4687
4689
|
})), wi = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
4688
|
-
const { viewerOpen: o, viewerIndex: d, handleActivate: u, closeViewer:
|
|
4690
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: u, closeViewer: g } = Te(
|
|
4689
4691
|
i
|
|
4690
4692
|
);
|
|
4691
4693
|
return /* @__PURE__ */ m("div", { className: "relative w-fit", children: [
|
|
@@ -4709,7 +4711,7 @@ const Xr = ({
|
|
|
4709
4711
|
a
|
|
4710
4712
|
),
|
|
4711
4713
|
initialIndex: d,
|
|
4712
|
-
onClose:
|
|
4714
|
+
onClose: g
|
|
4713
4715
|
}
|
|
4714
4716
|
)
|
|
4715
4717
|
] });
|
|
@@ -4725,13 +4727,13 @@ const Xr = ({
|
|
|
4725
4727
|
preload: d,
|
|
4726
4728
|
onClick: u
|
|
4727
4729
|
}) => {
|
|
4728
|
-
const
|
|
4730
|
+
const g = xi({ src: t, poster: s, mimeType: a, preload: d, items: i }), h = Se(e), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: _ } = Te(
|
|
4729
4731
|
u
|
|
4730
4732
|
);
|
|
4731
|
-
if (
|
|
4733
|
+
if (g.length === 0)
|
|
4732
4734
|
return null;
|
|
4733
|
-
const
|
|
4734
|
-
(
|
|
4735
|
+
const b = g.map(
|
|
4736
|
+
(p, x) => vi(p, x, g.length)
|
|
4735
4737
|
);
|
|
4736
4738
|
return /* @__PURE__ */ m(
|
|
4737
4739
|
Ee,
|
|
@@ -4744,16 +4746,16 @@ const Xr = ({
|
|
|
4744
4746
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4745
4747
|
yn,
|
|
4746
4748
|
{
|
|
4747
|
-
tiles:
|
|
4748
|
-
onTileActivate:
|
|
4749
|
+
tiles: b,
|
|
4750
|
+
onTileActivate: v,
|
|
4749
4751
|
className: "overflow-hidden rounded-md"
|
|
4750
4752
|
}
|
|
4751
4753
|
) }),
|
|
4752
4754
|
/* @__PURE__ */ n(
|
|
4753
4755
|
En,
|
|
4754
4756
|
{
|
|
4755
|
-
open:
|
|
4756
|
-
items: Sn(
|
|
4757
|
+
open: f,
|
|
4758
|
+
items: Sn(g, r),
|
|
4757
4759
|
initialIndex: c,
|
|
4758
4760
|
onClose: _
|
|
4759
4761
|
}
|
|
@@ -4783,7 +4785,7 @@ const Xr = ({
|
|
|
4783
4785
|
onClick: t,
|
|
4784
4786
|
disabled: s,
|
|
4785
4787
|
style: { backgroundColor: "#E6E5E3" },
|
|
4786
|
-
className:
|
|
4788
|
+
className: k(
|
|
4787
4789
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4788
4790
|
{
|
|
4789
4791
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4851,7 +4853,7 @@ export {
|
|
|
4851
4853
|
gn as d,
|
|
4852
4854
|
Fi as e,
|
|
4853
4855
|
Ci as f,
|
|
4854
|
-
|
|
4856
|
+
le as g,
|
|
4855
4857
|
Gt as h,
|
|
4856
4858
|
Bi as i,
|
|
4857
4859
|
Fa as j,
|
|
@@ -4862,7 +4864,7 @@ export {
|
|
|
4862
4864
|
gr as o,
|
|
4863
4865
|
Gr as p,
|
|
4864
4866
|
tn as q,
|
|
4865
|
-
|
|
4867
|
+
fe as r,
|
|
4866
4868
|
cn as s,
|
|
4867
4869
|
Gs as t,
|
|
4868
4870
|
ji as u,
|
|
@@ -4872,4 +4874,4 @@ export {
|
|
|
4872
4874
|
ot as y,
|
|
4873
4875
|
st as z
|
|
4874
4876
|
};
|
|
4875
|
-
//# sourceMappingURL=index-
|
|
4877
|
+
//# sourceMappingURL=index-gnuITMC7.js.map
|