@linktr.ee/messaging-react 3.4.2 → 3.5.0-rc-1782480113
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-BKalDyyu.js → Card-D34G7gvm.js} +2 -2
- package/dist/{Card-BKalDyyu.js.map → Card-D34G7gvm.js.map} +1 -1
- package/dist/{Card-DxroYNrS.cjs → Card-DIFgYVKx.cjs} +2 -2
- package/dist/{Card-DxroYNrS.cjs.map → Card-DIFgYVKx.cjs.map} +1 -1
- package/dist/{Card-mpVcQ8-W.js → Card-DVDoFfkP.js} +3 -3
- package/dist/{Card-mpVcQ8-W.js.map → Card-DVDoFfkP.js.map} +1 -1
- package/dist/{Card-V-bNUxcw.cjs → Card-DhAhEetQ.cjs} +2 -2
- package/dist/{Card-V-bNUxcw.cjs.map → Card-DhAhEetQ.cjs.map} +1 -1
- package/dist/{Card-CphU_jG-.js → Card-Dy1Qj3MR.js} +2 -2
- package/dist/{Card-CphU_jG-.js.map → Card-Dy1Qj3MR.js.map} +1 -1
- package/dist/{Card-DFy_ZvFH.cjs → Card-yHlBBfOt.cjs} +2 -2
- package/dist/{Card-DFy_ZvFH.cjs.map → Card-yHlBBfOt.cjs.map} +1 -1
- package/dist/{LockedThumbnail-BD7qtcso.js → LockedThumbnail-1S_Rjelj.js} +2 -2
- package/dist/{LockedThumbnail-BD7qtcso.js.map → LockedThumbnail-1S_Rjelj.js.map} +1 -1
- package/dist/{LockedThumbnail-B3W7upHs.cjs → LockedThumbnail-P2BVsLli.cjs} +2 -2
- package/dist/{LockedThumbnail-B3W7upHs.cjs.map → LockedThumbnail-P2BVsLli.cjs.map} +1 -1
- package/dist/index-BZjaMDgI.cjs +2 -0
- package/dist/index-BZjaMDgI.cjs.map +1 -0
- package/dist/{index-CjwQ2Hj3.js → index-CgczmQkU.js} +1160 -1150
- package/dist/index-CgczmQkU.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +18 -17
- package/package.json +2 -2
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +38 -0
- package/src/components/ChannelList/CustomChannelPreview.tsx +5 -6
- package/src/components/ChannelView.test.tsx +35 -0
- package/src/components/ChannelView.tsx +6 -0
- package/src/components/VerifiedBadge/index.tsx +25 -0
- package/src/index.ts +2 -0
- package/src/stream-custom-data.ts +8 -0
- package/dist/index-CjwQ2Hj3.js.map +0 -1
- package/dist/index-tI-4cxV1.cjs +0 -2
- package/dist/index-tI-4cxV1.cjs.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { StreamChat as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ue, DotsThreeIcon as
|
|
7
|
-
import
|
|
8
|
-
import { MessageActions as
|
|
9
|
-
const
|
|
2
|
+
import V, { createContext as We, useContext as _e, useCallback as Z, useState as z, useRef as H, useEffect as K, useId as In, useMemo as se, Suspense as Xe } from "react";
|
|
3
|
+
import { StreamChatService as Tn } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as An, LinkPreviewsManager as Lt } from "stream-chat";
|
|
5
|
+
import { Chat as Mn, DateSeparator as Rn, useChannelStateContext as de, useChatContext as Ke, areMessageUIPropsEqual as Ln, useMessageReminder as Dn, useComponentContext as Ht, Attachment as Pn, EditMessageModal as On, MessageBlocked as zn, MessageBouncePrompt as $n, MessageDeleted as Fn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as Vn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Gn, messageHasReactions as Hn, isDateSeparatorMessage as Yn, isMessageBlocked as qn, isMessageBounced as Wn, MessageBounceModal as Xn, MessageText as Dt, Poll as Kn, MessageErrorIcon as Jn, useMessageContext as Ne, useMessageComposer as Zn, useStateStore as Qn, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ns, AttachmentPreviewList as ss, QuotedMessagePreview as as, TextareaComposer as rs, MessageTimestamp as Oe, AIStates as ze, useTypingContext as is, useAIState as os, Channel as ls, WithComponents as cs, Window as ds, MessageList as us, ChannelList as ms, InfiniteScroll as hs } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ue, DotsThreeIcon as fs, SpinnerGapIcon as Ie, SignOutIcon as gs, ProhibitInsetIcon as Pt, FlagIcon as Yt, FileIcon as qt, ImageIcon as bs, SpeakerHighIcon as ps, VideoCameraIcon as Wt, FileMdIcon as vs, FileTextIcon as xs, FileZipIcon as ws, FilePptIcon as _s, FileCsvIcon as Ns, FileXlsIcon as ys, FileDocIcon as Cs, FilePdfIcon as ks, CircleNotchIcon as xe, PlayIcon as je, PauseIcon as Es, LinkIcon as Ss, DownloadSimpleIcon as we, GiftIcon as Is, ThumbsUpIcon as Ts, ThumbsDownIcon as As, TrashSimpleIcon as Ms, XIcon as Le, ArrowUpIcon as Rs, SparkleIcon as Ge, ProhibitIcon as Ls, SealCheckIcon as Ds, ArrowLeftIcon as Ot, CaretRightIcon as He, PencilSimpleIcon as Ps, CaretLeftIcon as Os } from "@phosphor-icons/react";
|
|
7
|
+
import k from "classnames";
|
|
8
|
+
import { MessageActions as zs, DefaultDropdownActionButton as Xt } from "stream-chat-react/experimental";
|
|
9
|
+
const Kt = We({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const Xt = qe({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}),
|
|
19
|
+
}), Je = () => _e(Kt), Ci = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,10 +24,10 @@ const Xt = qe({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const l =
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
var A, y;
|
|
28
|
+
const l = Z(
|
|
29
|
+
(E, ...C) => {
|
|
30
|
+
i && console.log(`🔥 [MessagingProvider] ${E}`, ...C);
|
|
31
31
|
},
|
|
32
32
|
[i]
|
|
33
33
|
);
|
|
@@ -37,77 +37,77 @@ const Xt = qe({
|
|
|
37
37
|
serviceConfig: !!s,
|
|
38
38
|
capabilities: Object.keys(r)
|
|
39
39
|
});
|
|
40
|
-
const [o, d] =
|
|
41
|
-
|
|
42
|
-
const M =
|
|
40
|
+
const [o, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, w] = z(!1), [b, _] = z(null), v = H(!1), p = H(null), I = H(s);
|
|
41
|
+
I.current = s;
|
|
42
|
+
const M = H(i);
|
|
43
43
|
M.current = i;
|
|
44
|
-
const
|
|
44
|
+
const R = H({
|
|
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
|
+
}), T = H(0);
|
|
50
|
+
T.current++, l("📊 RENDER INFO", {
|
|
51
|
+
renderCount: T.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: R.current.userId !== (t == null ? void 0 : t.id),
|
|
55
|
+
apiKeyChanged: R.current.apiKey !== a,
|
|
56
|
+
serviceConfigChanged: R.current.serviceConfig !== s,
|
|
57
|
+
capabilitiesChanged: R.current.capabilities !== r
|
|
58
58
|
}
|
|
59
|
-
}),
|
|
59
|
+
}), R.current = {
|
|
60
60
|
userId: t == null ? void 0 : t.id,
|
|
61
61
|
apiKey: a,
|
|
62
62
|
serviceConfig: s,
|
|
63
63
|
capabilities: r
|
|
64
64
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((
|
|
67
|
-
const D = a ? ((
|
|
65
|
+
const L = H(null);
|
|
66
|
+
a && ((A = L.current) == null ? void 0 : A.apiKey) !== a && (L.current = { apiKey: a, client: new An(a) });
|
|
67
|
+
const D = a ? ((y = L.current) == null ? void 0 : y.client) ?? null : null;
|
|
68
68
|
K(() => {
|
|
69
|
-
const
|
|
70
|
-
if (!a || !D || !
|
|
69
|
+
const E = T.current, C = I.current;
|
|
70
|
+
if (!a || !D || !C) {
|
|
71
71
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: E,
|
|
73
73
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
l("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: E,
|
|
79
79
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
80
|
});
|
|
81
|
-
const $ = new
|
|
82
|
-
...
|
|
81
|
+
const $ = new Tn({
|
|
82
|
+
...C,
|
|
83
83
|
apiKey: a,
|
|
84
84
|
debug: M.current,
|
|
85
85
|
client: D
|
|
86
86
|
});
|
|
87
|
-
|
|
88
|
-
renderCount:
|
|
87
|
+
p.current = $, d($), l("✅ SERVICE SET", {
|
|
88
|
+
renderCount: E,
|
|
89
89
|
serviceInstance: !!$
|
|
90
90
|
});
|
|
91
91
|
}, [a, D]);
|
|
92
|
-
const
|
|
92
|
+
const U = H(null);
|
|
93
93
|
K(() => {
|
|
94
|
-
var
|
|
94
|
+
var C, $;
|
|
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: v.current,
|
|
100
100
|
isConnected: u,
|
|
101
101
|
dependencies: { service: !!o, userId: t == null ? void 0 : t.id }
|
|
102
102
|
}), !o || !t) {
|
|
103
103
|
l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
if (
|
|
106
|
+
if (v.current) {
|
|
107
107
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (((
|
|
110
|
+
if (((C = U.current) == null ? void 0 : C.serviceId) === o && (($ = U.current) == null ? void 0 : $.userId) === t.id) {
|
|
111
111
|
l(
|
|
112
112
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
113
|
"Already connected this user with this service"
|
|
@@ -115,35 +115,35 @@ const Xt = 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 }), v.current = !0, w(!0), _(null);
|
|
119
119
|
try {
|
|
120
120
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
g(
|
|
121
|
+
const P = await o.connectUser(t);
|
|
122
|
+
g(P), f(!0), U.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
123
123
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
124
|
+
clientId: P.userID
|
|
125
125
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
126
|
+
} catch (P) {
|
|
127
|
+
const j = P instanceof Error ? P.message : "Connection failed";
|
|
128
|
+
_(j), l("❌ USER CONNECTION ERROR", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
error:
|
|
130
|
+
error: j
|
|
131
131
|
});
|
|
132
132
|
} finally {
|
|
133
|
-
|
|
133
|
+
w(!1), v.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
134
134
|
userId: t.id,
|
|
135
135
|
isConnected: u
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
})();
|
|
139
139
|
}, [o, t, l, u]), K(() => {
|
|
140
|
-
const
|
|
140
|
+
const E = D;
|
|
141
141
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
|
|
142
|
+
var C;
|
|
143
|
+
E && (U.current = null, (C = p.current) == null || C.disconnectUser().catch(console.error));
|
|
144
144
|
};
|
|
145
145
|
}, [D]);
|
|
146
|
-
const
|
|
146
|
+
const O = Z(async () => {
|
|
147
147
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
148
148
|
hasService: !!o,
|
|
149
149
|
hasUser: !!t
|
|
@@ -151,53 +151,53 @@ const Xt = 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 }), w(!0);
|
|
155
155
|
try {
|
|
156
156
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
157
|
-
const
|
|
158
|
-
g(
|
|
159
|
-
} catch (
|
|
160
|
-
const
|
|
161
|
-
|
|
157
|
+
const E = await o.connectUser(t);
|
|
158
|
+
g(E), f(!0), _(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
159
|
+
} catch (E) {
|
|
160
|
+
const C = E instanceof Error ? E.message : "Refresh failed";
|
|
161
|
+
_(C), l("❌ CONNECTION REFRESH ERROR", {
|
|
162
162
|
userId: t.id,
|
|
163
|
-
error:
|
|
163
|
+
error: C
|
|
164
164
|
});
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
w(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
167
|
}
|
|
168
|
-
}, [o, t, l]),
|
|
168
|
+
}, [o, t, l]), N = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
169
169
|
hasService: !!o,
|
|
170
170
|
hasClient: !!m,
|
|
171
171
|
isConnected: u,
|
|
172
172
|
isLoading: c,
|
|
173
|
-
hasError: !!
|
|
173
|
+
hasError: !!b,
|
|
174
174
|
capabilitiesKeys: Object.keys(r)
|
|
175
175
|
}), {
|
|
176
176
|
service: o,
|
|
177
177
|
client: m,
|
|
178
178
|
isConnected: u,
|
|
179
179
|
isLoading: c,
|
|
180
|
-
error:
|
|
180
|
+
error: b,
|
|
181
181
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
182
|
+
refreshConnection: O,
|
|
183
183
|
debug: i
|
|
184
184
|
}), [
|
|
185
185
|
o,
|
|
186
186
|
m,
|
|
187
187
|
u,
|
|
188
188
|
c,
|
|
189
|
-
|
|
189
|
+
b,
|
|
190
190
|
r,
|
|
191
|
-
|
|
191
|
+
O,
|
|
192
192
|
i,
|
|
193
193
|
l
|
|
194
194
|
]);
|
|
195
195
|
return l("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
196
|
+
renderCount: T.current,
|
|
197
197
|
willRenderChat: !!D,
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(
|
|
200
|
-
|
|
198
|
+
contextValueReady: !!N
|
|
199
|
+
}), /* @__PURE__ */ n(Kt.Provider, { value: N, children: D ? /* @__PURE__ */ n(
|
|
200
|
+
Mn,
|
|
201
201
|
{
|
|
202
202
|
client: D,
|
|
203
203
|
customClasses: {
|
|
@@ -206,9 +206,9 @@ const Xt = qe({
|
|
|
206
206
|
children: e
|
|
207
207
|
}
|
|
208
208
|
) : e });
|
|
209
|
-
},
|
|
209
|
+
}, $s = () => Je(), Jt = (e) => {
|
|
210
210
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
211
|
+
const [t, s] = z(
|
|
212
212
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
213
|
);
|
|
214
214
|
return K(() => {
|
|
@@ -228,18 +228,18 @@ const Xt = qe({
|
|
|
228
228
|
e.off("member.updated", i);
|
|
229
229
|
};
|
|
230
230
|
}, [e]), t;
|
|
231
|
-
},
|
|
232
|
-
function
|
|
233
|
-
return
|
|
231
|
+
}, Fs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
232
|
+
function Bs(e) {
|
|
233
|
+
return Fs.test(e.trim());
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function zt(e, t) {
|
|
236
236
|
const s = e == null ? void 0 : e.trim();
|
|
237
|
-
return !s || t && s === t ? !1 :
|
|
237
|
+
return !s || t && s === t ? !1 : !Bs(s);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
239
|
+
function Zt(e) {
|
|
240
|
+
return zt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : zt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
241
241
|
}
|
|
242
|
-
const
|
|
242
|
+
const $t = [
|
|
243
243
|
"🍎",
|
|
244
244
|
// Apple
|
|
245
245
|
"🍌",
|
|
@@ -267,7 +267,7 @@ const zt = [
|
|
|
267
267
|
"🍈"
|
|
268
268
|
// Melon
|
|
269
269
|
];
|
|
270
|
-
function
|
|
270
|
+
function Vs(e) {
|
|
271
271
|
let t = 0;
|
|
272
272
|
for (let s = 0; s < e.length; s++) {
|
|
273
273
|
const a = e.charCodeAt(s);
|
|
@@ -275,9 +275,9 @@ function Fs(e) {
|
|
|
275
275
|
}
|
|
276
276
|
return Math.abs(t);
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
const s =
|
|
280
|
-
return
|
|
278
|
+
function Us(e) {
|
|
279
|
+
const s = Vs(e) % $t.length;
|
|
280
|
+
return $t[s];
|
|
281
281
|
}
|
|
282
282
|
const oe = ({
|
|
283
283
|
id: e,
|
|
@@ -288,7 +288,7 @@ const oe = ({
|
|
|
288
288
|
shape: i = "squircle",
|
|
289
289
|
dmAgentEnabled: l = !1
|
|
290
290
|
}) => {
|
|
291
|
-
const o =
|
|
291
|
+
const o = Us(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
|
|
292
292
|
"img",
|
|
293
293
|
{
|
|
294
294
|
src: t,
|
|
@@ -299,7 +299,7 @@ const oe = ({
|
|
|
299
299
|
"div",
|
|
300
300
|
{
|
|
301
301
|
"aria-hidden": "true",
|
|
302
|
-
className:
|
|
302
|
+
className: k(
|
|
303
303
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
304
304
|
m
|
|
305
305
|
),
|
|
@@ -309,7 +309,7 @@ const oe = ({
|
|
|
309
309
|
return /* @__PURE__ */ h(
|
|
310
310
|
"div",
|
|
311
311
|
{
|
|
312
|
-
className:
|
|
312
|
+
className: k(
|
|
313
313
|
"relative flex-shrink-0 !bg-transparent",
|
|
314
314
|
a
|
|
315
315
|
),
|
|
@@ -331,7 +331,7 @@ const oe = ({
|
|
|
331
331
|
"div",
|
|
332
332
|
{
|
|
333
333
|
"data-testid": "avatar-ring",
|
|
334
|
-
className:
|
|
334
|
+
className: k(
|
|
335
335
|
"h-full w-full",
|
|
336
336
|
"bg-transparent"
|
|
337
337
|
),
|
|
@@ -350,7 +350,7 @@ const oe = ({
|
|
|
350
350
|
]
|
|
351
351
|
}
|
|
352
352
|
);
|
|
353
|
-
},
|
|
353
|
+
}, js = "https://linktr.ee/s/about/trust-center/report", Gs = ({
|
|
354
354
|
channel: e,
|
|
355
355
|
participant: t,
|
|
356
356
|
showBlockParticipant: s = !0,
|
|
@@ -363,78 +363,78 @@ const oe = ({
|
|
|
363
363
|
onActionComplete: m,
|
|
364
364
|
logLabel: g = "useChannelModerationActions"
|
|
365
365
|
}) => {
|
|
366
|
-
var
|
|
367
|
-
const { service: u, debug: f } =
|
|
366
|
+
var A;
|
|
367
|
+
const { service: u, debug: f } = Je(), c = (A = t == null ? void 0 : t.user) == null ? void 0 : A.id, w = !!(a && s && u && c), [b, _] = z(!1), [v, p] = z(null), [I, M] = z(!1), [R, T] = z(!1), L = w && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== u);
|
|
368
368
|
return K(() => {
|
|
369
|
-
if (!
|
|
370
|
-
|
|
369
|
+
if (!w || !u || !c) {
|
|
370
|
+
_(!1), p(null);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
let
|
|
373
|
+
let y = !1;
|
|
374
374
|
return (async () => {
|
|
375
375
|
try {
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
(
|
|
376
|
+
const E = await u.getBlockedUsers();
|
|
377
|
+
if (y) return;
|
|
378
|
+
_(
|
|
379
|
+
E.some(
|
|
380
|
+
(C) => C.blocked_user_id === c
|
|
381
381
|
)
|
|
382
382
|
);
|
|
383
|
-
} catch (
|
|
384
|
-
|
|
383
|
+
} catch (E) {
|
|
384
|
+
y || console.error(`[${g}] Failed to check blocked status:`, E);
|
|
385
385
|
} finally {
|
|
386
|
-
|
|
386
|
+
y || p({ participantId: c, service: u });
|
|
387
387
|
}
|
|
388
388
|
})(), () => {
|
|
389
|
-
|
|
389
|
+
y = !0;
|
|
390
390
|
};
|
|
391
|
-
}, [
|
|
392
|
-
isParticipantBlocked:
|
|
393
|
-
isCheckingBlockedStatus:
|
|
394
|
-
isLeaving:
|
|
395
|
-
isUpdatingBlockStatus:
|
|
391
|
+
}, [w, u, c, g]), {
|
|
392
|
+
isParticipantBlocked: b,
|
|
393
|
+
isCheckingBlockedStatus: L,
|
|
394
|
+
isLeaving: I,
|
|
395
|
+
isUpdatingBlockStatus: R,
|
|
396
396
|
handleLeaveConversation: async () => {
|
|
397
|
-
var
|
|
398
|
-
if (!
|
|
397
|
+
var y;
|
|
398
|
+
if (!I) {
|
|
399
399
|
l == null || l(), f && console.log(`[${g}] Leave conversation`, e.cid), M(!0);
|
|
400
400
|
try {
|
|
401
|
-
const
|
|
402
|
-
await e.hide(
|
|
403
|
-
} catch (
|
|
404
|
-
console.error(`[${g}] Failed to leave conversation`,
|
|
401
|
+
const E = ((y = e._client) == null ? void 0 : y.userID) ?? null;
|
|
402
|
+
await e.hide(E, !1), r && await r(e), m == null || m();
|
|
403
|
+
} catch (E) {
|
|
404
|
+
console.error(`[${g}] Failed to leave conversation`, E);
|
|
405
405
|
} finally {
|
|
406
406
|
M(!1);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
},
|
|
410
410
|
handleBlockUser: async () => {
|
|
411
|
-
var
|
|
412
|
-
if (!(
|
|
413
|
-
o == null || o(), f && console.log(`[${g}] Block member`, (
|
|
411
|
+
var y, E, C;
|
|
412
|
+
if (!(R || !u)) {
|
|
413
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), T(!0);
|
|
414
414
|
try {
|
|
415
|
-
await u.blockUser((
|
|
415
|
+
await u.blockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
|
|
416
416
|
} catch ($) {
|
|
417
417
|
console.error(`[${g}] Failed to block member`, $);
|
|
418
418
|
} finally {
|
|
419
|
-
|
|
419
|
+
T(!1);
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
handleUnblockUser: async () => {
|
|
424
|
-
var
|
|
425
|
-
if (!(
|
|
426
|
-
o == null || o(), f && console.log(`[${g}] Unblock member`, (
|
|
424
|
+
var y, E, C;
|
|
425
|
+
if (!(R || !u)) {
|
|
426
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (y = t == null ? void 0 : t.user) == null ? void 0 : y.id), T(!0);
|
|
427
427
|
try {
|
|
428
|
-
await u.unBlockUser((
|
|
428
|
+
await u.unBlockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
|
|
429
429
|
} catch ($) {
|
|
430
430
|
console.error(`[${g}] Failed to unblock member`, $);
|
|
431
431
|
} finally {
|
|
432
|
-
|
|
432
|
+
T(!1);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
},
|
|
436
436
|
handleReportUser: () => {
|
|
437
|
-
d == null || d(), m == null || m(), window.open(
|
|
437
|
+
d == null || d(), m == null || m(), window.open(js, "_blank", "noopener,noreferrer");
|
|
438
438
|
}
|
|
439
439
|
};
|
|
440
440
|
}, be = ({
|
|
@@ -446,7 +446,7 @@ const oe = ({
|
|
|
446
446
|
"button",
|
|
447
447
|
{
|
|
448
448
|
type: "button",
|
|
449
|
-
className:
|
|
449
|
+
className: k(
|
|
450
450
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
451
451
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
452
452
|
t
|
|
@@ -454,7 +454,7 @@ const oe = ({
|
|
|
454
454
|
...a,
|
|
455
455
|
children: s
|
|
456
456
|
}
|
|
457
|
-
),
|
|
457
|
+
), Ft = ({
|
|
458
458
|
channel: e,
|
|
459
459
|
participant: t,
|
|
460
460
|
showDeleteConversation: s = !0,
|
|
@@ -468,16 +468,16 @@ const oe = ({
|
|
|
468
468
|
customChannelActions: g,
|
|
469
469
|
triggerClassName: u
|
|
470
470
|
}) => {
|
|
471
|
-
const [f, c] =
|
|
472
|
-
isParticipantBlocked:
|
|
473
|
-
isCheckingBlockedStatus:
|
|
474
|
-
isLeaving:
|
|
471
|
+
const [f, c] = z(!1), w = H(null), b = In(), _ = Z(() => c(!1), []), {
|
|
472
|
+
isParticipantBlocked: v,
|
|
473
|
+
isCheckingBlockedStatus: p,
|
|
474
|
+
isLeaving: I,
|
|
475
475
|
isUpdatingBlockStatus: M,
|
|
476
|
-
handleLeaveConversation:
|
|
477
|
-
handleBlockUser:
|
|
478
|
-
handleUnblockUser:
|
|
476
|
+
handleLeaveConversation: R,
|
|
477
|
+
handleBlockUser: T,
|
|
478
|
+
handleUnblockUser: L,
|
|
479
479
|
handleReportUser: D
|
|
480
|
-
} =
|
|
480
|
+
} = Gs({
|
|
481
481
|
channel: e,
|
|
482
482
|
participant: t,
|
|
483
483
|
showBlockParticipant: a,
|
|
@@ -487,20 +487,20 @@ const oe = ({
|
|
|
487
487
|
onDeleteConversationClick: o,
|
|
488
488
|
onBlockParticipantClick: d,
|
|
489
489
|
onReportParticipantClick: m,
|
|
490
|
-
onActionComplete:
|
|
490
|
+
onActionComplete: _,
|
|
491
491
|
logLabel: "ChannelActionsMenu"
|
|
492
492
|
});
|
|
493
493
|
return K(() => {
|
|
494
494
|
if (!f) return;
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
},
|
|
498
|
-
|
|
495
|
+
const O = (A) => {
|
|
496
|
+
w.current && !w.current.contains(A.target) && c(!1);
|
|
497
|
+
}, N = (A) => {
|
|
498
|
+
A.key === "Escape" && c(!1);
|
|
499
499
|
};
|
|
500
|
-
return document.addEventListener("mousedown",
|
|
501
|
-
document.removeEventListener("mousedown",
|
|
500
|
+
return document.addEventListener("mousedown", O), document.addEventListener("keydown", N), () => {
|
|
501
|
+
document.removeEventListener("mousedown", O), document.removeEventListener("keydown", N);
|
|
502
502
|
};
|
|
503
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref:
|
|
503
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: w, className: "relative", children: [
|
|
504
504
|
/* @__PURE__ */ h(
|
|
505
505
|
"button",
|
|
506
506
|
{
|
|
@@ -508,10 +508,10 @@ const oe = ({
|
|
|
508
508
|
type: "button",
|
|
509
509
|
"aria-haspopup": "true",
|
|
510
510
|
"aria-expanded": f,
|
|
511
|
-
"aria-controls": f ?
|
|
512
|
-
onClick: () => c((
|
|
511
|
+
"aria-controls": f ? b : void 0,
|
|
512
|
+
onClick: () => c((O) => !O),
|
|
513
513
|
children: [
|
|
514
|
-
/* @__PURE__ */ n(
|
|
514
|
+
/* @__PURE__ */ n(fs, { className: "size-5 text-black/90" }),
|
|
515
515
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
516
516
|
]
|
|
517
517
|
}
|
|
@@ -519,9 +519,9 @@ const oe = ({
|
|
|
519
519
|
f && /* @__PURE__ */ n(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
|
-
id:
|
|
522
|
+
id: b,
|
|
523
523
|
"aria-label": "Conversation options",
|
|
524
|
-
className:
|
|
524
|
+
className: k(
|
|
525
525
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
526
526
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
527
527
|
),
|
|
@@ -529,47 +529,47 @@ const oe = ({
|
|
|
529
529
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
530
530
|
be,
|
|
531
531
|
{
|
|
532
|
-
onClick:
|
|
533
|
-
disabled:
|
|
534
|
-
"aria-busy":
|
|
532
|
+
onClick: R,
|
|
533
|
+
disabled: I,
|
|
534
|
+
"aria-busy": I,
|
|
535
535
|
children: [
|
|
536
|
-
|
|
536
|
+
I ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(gs, { className: "h-5 w-5" }),
|
|
537
537
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
538
538
|
]
|
|
539
539
|
}
|
|
540
540
|
) }),
|
|
541
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
541
|
+
a && /* @__PURE__ */ n("li", { children: p ? (
|
|
542
542
|
// Block status not yet resolved — show a disabled placeholder
|
|
543
543
|
// so a premature click can't act on a stale block state.
|
|
544
544
|
/* @__PURE__ */ h(be, { disabled: !0, "aria-busy": !0, children: [
|
|
545
|
-
/* @__PURE__ */ n(
|
|
545
|
+
/* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }),
|
|
546
546
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
547
547
|
] })
|
|
548
|
-
) :
|
|
548
|
+
) : v ? /* @__PURE__ */ h(
|
|
549
549
|
be,
|
|
550
550
|
{
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: L,
|
|
552
552
|
disabled: M,
|
|
553
553
|
"aria-busy": M,
|
|
554
554
|
children: [
|
|
555
|
-
M ? /* @__PURE__ */ n(
|
|
555
|
+
M ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Pt, { className: "h-5 w-5" }),
|
|
556
556
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
557
557
|
]
|
|
558
558
|
}
|
|
559
559
|
) : /* @__PURE__ */ h(
|
|
560
560
|
be,
|
|
561
561
|
{
|
|
562
|
-
onClick:
|
|
562
|
+
onClick: T,
|
|
563
563
|
disabled: M,
|
|
564
564
|
"aria-busy": M,
|
|
565
565
|
children: [
|
|
566
|
-
M ? /* @__PURE__ */ n(
|
|
566
|
+
M ? /* @__PURE__ */ n(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Pt, { className: "h-5 w-5" }),
|
|
567
567
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
568
568
|
]
|
|
569
569
|
}
|
|
570
570
|
) }),
|
|
571
571
|
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(be, { variant: "danger", onClick: D, children: [
|
|
572
|
-
/* @__PURE__ */ n(
|
|
572
|
+
/* @__PURE__ */ n(Yt, { className: "h-5 w-5" }),
|
|
573
573
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
574
574
|
] }) }),
|
|
575
575
|
g
|
|
@@ -577,30 +577,30 @@ const oe = ({
|
|
|
577
577
|
}
|
|
578
578
|
)
|
|
579
579
|
] });
|
|
580
|
-
},
|
|
581
|
-
function
|
|
582
|
-
return e != null && e.length ? e.some((t) => t.type ===
|
|
580
|
+
}, Hs = (e) => /* @__PURE__ */ n(Rn, { ...e, position: "center" }), Ye = "vote_up", qe = "vote_down";
|
|
581
|
+
function Ys(e) {
|
|
582
|
+
return e != null && e.length ? e.some((t) => t.type === qe) ? "down" : e.some((t) => t.type === Ye) ? "up" : null : null;
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
const { channel: t } = de(), { client: s } =
|
|
586
|
-
() =>
|
|
584
|
+
function qs(e) {
|
|
585
|
+
const { channel: t } = de(), { client: s } = Ke("useMessageVote"), a = se(
|
|
586
|
+
() => Ys(e.own_reactions),
|
|
587
587
|
[e.own_reactions]
|
|
588
|
-
), r =
|
|
588
|
+
), r = Z(async () => {
|
|
589
589
|
if (s != null && s.userID)
|
|
590
590
|
try {
|
|
591
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
591
|
+
a === "up" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
|
|
592
592
|
e.id,
|
|
593
|
-
{ type:
|
|
593
|
+
{ type: Ye },
|
|
594
594
|
{ enforce_unique: !0, skip_push: !0 }
|
|
595
595
|
);
|
|
596
596
|
} catch {
|
|
597
597
|
}
|
|
598
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
598
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = Z(async () => {
|
|
599
599
|
if (s != null && s.userID)
|
|
600
600
|
try {
|
|
601
|
-
a === "down" ? await t.deleteReaction(e.id,
|
|
601
|
+
a === "down" ? await t.deleteReaction(e.id, qe) : await t.sendReaction(
|
|
602
602
|
e.id,
|
|
603
|
-
{ type:
|
|
603
|
+
{ type: qe },
|
|
604
604
|
{ enforce_unique: !0, skip_push: !0 }
|
|
605
605
|
);
|
|
606
606
|
} catch {
|
|
@@ -608,24 +608,24 @@ function Hs(e) {
|
|
|
608
608
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
609
609
|
return { selected: a, voteUp: r, voteDown: i };
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function Ws(e) {
|
|
612
612
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
613
613
|
}
|
|
614
|
-
function
|
|
614
|
+
function Qt({
|
|
615
615
|
message: e,
|
|
616
616
|
viewerLanguage: t
|
|
617
617
|
}) {
|
|
618
618
|
var r;
|
|
619
|
-
const s = e == null ? void 0 : e.text, a =
|
|
619
|
+
const s = e == null ? void 0 : e.text, a = Ws(t);
|
|
620
620
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const Xs = V.lazy(() => import("./Card-Dy1Qj3MR.js")), Ks = V.lazy(() => import("./Card-D34G7gvm.js")), Js = V.lazy(() => import("./Card-DVDoFfkP.js")), Ze = () => /* @__PURE__ */ n(
|
|
623
623
|
"div",
|
|
624
624
|
{
|
|
625
625
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
626
626
|
"aria-hidden": !0
|
|
627
627
|
}
|
|
628
|
-
),
|
|
628
|
+
), Zs = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), en = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Ks, { ...e }) }), tn = (e) => /* @__PURE__ */ n(Xe, { fallback: /* @__PURE__ */ n(Ze, {}), children: /* @__PURE__ */ n(Js, { ...e }) }), Qs = en, ea = tn, Bt = { Composer: Zs, Sent: en, Received: tn, Creator: Qs, Visitor: ea }, ta = [
|
|
629
629
|
[/pdf/, "pdf"],
|
|
630
630
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
631
631
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -638,39 +638,39 @@ const qs = j.lazy(() => import("./Card-CphU_jG-.js")), Ws = j.lazy(() => import(
|
|
|
638
638
|
function re(e) {
|
|
639
639
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
640
640
|
}
|
|
641
|
-
function
|
|
642
|
-
const t =
|
|
641
|
+
function nn(e) {
|
|
642
|
+
const t = ta.find(
|
|
643
643
|
([s]) => s.test(e)
|
|
644
644
|
);
|
|
645
645
|
return t ? t[1] : "generic";
|
|
646
646
|
}
|
|
647
|
-
const
|
|
648
|
-
video:
|
|
649
|
-
audio:
|
|
650
|
-
image:
|
|
651
|
-
document:
|
|
652
|
-
},
|
|
653
|
-
pdf:
|
|
654
|
-
doc:
|
|
655
|
-
xls:
|
|
656
|
-
csv:
|
|
657
|
-
ppt:
|
|
658
|
-
zip:
|
|
659
|
-
text:
|
|
660
|
-
markdown:
|
|
661
|
-
generic:
|
|
647
|
+
const na = {
|
|
648
|
+
video: Wt,
|
|
649
|
+
audio: ps,
|
|
650
|
+
image: bs,
|
|
651
|
+
document: qt
|
|
652
|
+
}, sa = {
|
|
653
|
+
pdf: ks,
|
|
654
|
+
doc: Cs,
|
|
655
|
+
xls: ys,
|
|
656
|
+
csv: Ns,
|
|
657
|
+
ppt: _s,
|
|
658
|
+
zip: ws,
|
|
659
|
+
text: xs,
|
|
660
|
+
markdown: vs,
|
|
661
|
+
generic: qt
|
|
662
662
|
};
|
|
663
|
-
function
|
|
663
|
+
function aa(e) {
|
|
664
664
|
const t = re(e);
|
|
665
|
-
return t !== "document" ?
|
|
665
|
+
return t !== "document" ? na[t] : sa[nn(e)];
|
|
666
666
|
}
|
|
667
667
|
function ce(e, t) {
|
|
668
|
-
return
|
|
668
|
+
return V.createElement(aa(e), t);
|
|
669
669
|
}
|
|
670
|
-
const
|
|
670
|
+
const ra = (e) => {
|
|
671
671
|
var t, s;
|
|
672
672
|
return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
|
|
673
|
-
},
|
|
673
|
+
}, ia = ({
|
|
674
674
|
source: e,
|
|
675
675
|
mimeType: t,
|
|
676
676
|
poster: s,
|
|
@@ -682,66 +682,66 @@ const sa = (e) => {
|
|
|
682
682
|
muted: d = !1,
|
|
683
683
|
onContainerClick: m
|
|
684
684
|
}) => {
|
|
685
|
-
const g = re(t), u =
|
|
686
|
-
D(!1),
|
|
687
|
-
}, []), $ =
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
690
|
-
const
|
|
685
|
+
const g = re(t), u = H(null), f = H(null), c = H(null), w = H(r), [b, _] = z(a), [v, p] = z(0), [I, M] = z(!1), [R, T] = z(!1), [L, D] = z(!1), [U, O] = z(!1), [N, A] = z(!0), [y, E] = z(null), C = Z(() => {
|
|
686
|
+
D(!1), _(!0);
|
|
687
|
+
}, []), $ = Z((x) => {
|
|
688
|
+
const S = f.current;
|
|
689
|
+
if (!S) return 0;
|
|
690
|
+
const B = S.getBoundingClientRect();
|
|
691
691
|
return Math.max(
|
|
692
692
|
0,
|
|
693
|
-
Math.min(1, (
|
|
693
|
+
Math.min(1, (ra(x) - B.left) / B.width)
|
|
694
694
|
);
|
|
695
|
-
}, []),
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
695
|
+
}, []), P = Z((x) => {
|
|
696
|
+
const S = u.current;
|
|
697
|
+
S && S.duration && (S.currentTime = x * S.duration);
|
|
698
|
+
}, []), j = (x) => {
|
|
699
699
|
x.stopPropagation(), M(!0);
|
|
700
|
-
const
|
|
701
|
-
|
|
700
|
+
const S = $(x);
|
|
701
|
+
p(S), P(S);
|
|
702
702
|
};
|
|
703
703
|
K(() => {
|
|
704
|
-
r !== void 0 && r !==
|
|
704
|
+
r !== void 0 && r !== w.current && (w.current = r, _(r));
|
|
705
705
|
}, [r]), K(() => {
|
|
706
|
-
if (!
|
|
706
|
+
if (!b) {
|
|
707
707
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
708
708
|
return;
|
|
709
709
|
}
|
|
710
710
|
const x = () => {
|
|
711
|
-
const
|
|
712
|
-
|
|
711
|
+
const S = u.current;
|
|
712
|
+
S && S.duration && !I && p(S.currentTime / S.duration), c.current = requestAnimationFrame(x);
|
|
713
713
|
};
|
|
714
714
|
return c.current = requestAnimationFrame(x), () => {
|
|
715
715
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
716
716
|
};
|
|
717
|
-
}, [
|
|
717
|
+
}, [b, I]), K(() => {
|
|
718
718
|
const x = u.current;
|
|
719
|
-
x && (
|
|
720
|
-
|
|
719
|
+
x && (b ? x.play().catch((S) => {
|
|
720
|
+
_(!1), D(!0);
|
|
721
721
|
}) : x.pause());
|
|
722
|
-
}, [
|
|
723
|
-
if (!
|
|
724
|
-
const x = (
|
|
725
|
-
M(!1),
|
|
722
|
+
}, [b]), K(() => {
|
|
723
|
+
if (!I) return;
|
|
724
|
+
const x = (B) => p($(B)), S = (B) => {
|
|
725
|
+
M(!1), P($(B));
|
|
726
726
|
};
|
|
727
|
-
return window.addEventListener("mousemove", x), window.addEventListener("mouseup",
|
|
728
|
-
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup",
|
|
727
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", S), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", S), () => {
|
|
728
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", S), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", S);
|
|
729
729
|
};
|
|
730
|
-
}, [
|
|
731
|
-
const
|
|
730
|
+
}, [I, $, P]);
|
|
731
|
+
const J = y ? { aspectRatio: String(y) } : void 0, Q = y ? "" : " aspect-video", Y = Math.round(v * 100);
|
|
732
732
|
return /* @__PURE__ */ h(
|
|
733
733
|
"div",
|
|
734
734
|
{
|
|
735
735
|
role: "button",
|
|
736
736
|
tabIndex: 0,
|
|
737
737
|
className: `relative cursor-pointer overflow-hidden bg-black ${Q}`,
|
|
738
|
-
style:
|
|
738
|
+
style: J,
|
|
739
739
|
onClick: (x) => {
|
|
740
740
|
if (m) {
|
|
741
741
|
m(x);
|
|
742
742
|
return;
|
|
743
743
|
}
|
|
744
|
-
|
|
744
|
+
L || l && _((S) => !S);
|
|
745
745
|
},
|
|
746
746
|
onKeyDown: (x) => {
|
|
747
747
|
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
@@ -749,11 +749,11 @@ const sa = (e) => {
|
|
|
749
749
|
m(x);
|
|
750
750
|
return;
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
L || l && _((S) => !S);
|
|
753
753
|
}
|
|
754
754
|
},
|
|
755
755
|
children: [
|
|
756
|
-
s && (g === "audio" ||
|
|
756
|
+
s && (g === "audio" || N) && /* @__PURE__ */ n(
|
|
757
757
|
"img",
|
|
758
758
|
{
|
|
759
759
|
src: s,
|
|
@@ -761,7 +761,7 @@ const sa = (e) => {
|
|
|
761
761
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
762
762
|
}
|
|
763
763
|
),
|
|
764
|
-
!s && (g === "audio" ||
|
|
764
|
+
!s && (g === "audio" || N) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
|
|
765
765
|
className: "size-12 text-black/20",
|
|
766
766
|
weight: "regular"
|
|
767
767
|
}) }),
|
|
@@ -773,14 +773,14 @@ const sa = (e) => {
|
|
|
773
773
|
loop: i,
|
|
774
774
|
muted: d,
|
|
775
775
|
style: { width: "100%", height: "100%" },
|
|
776
|
-
onLoadStart: () =>
|
|
776
|
+
onLoadStart: () => O(!0),
|
|
777
777
|
onCanPlay: () => {
|
|
778
|
-
|
|
778
|
+
O(!1), A(!1);
|
|
779
779
|
},
|
|
780
|
-
onWaiting: () =>
|
|
780
|
+
onWaiting: () => O(!0),
|
|
781
781
|
onPlay: () => D(!1),
|
|
782
782
|
onEnded: () => {
|
|
783
|
-
i || (
|
|
783
|
+
i || (_(!1), p(0));
|
|
784
784
|
},
|
|
785
785
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
786
786
|
}
|
|
@@ -793,30 +793,30 @@ const sa = (e) => {
|
|
|
793
793
|
muted: d,
|
|
794
794
|
playsInline: !0,
|
|
795
795
|
style: { width: "100%", height: "100%" },
|
|
796
|
-
onLoadStart: () =>
|
|
796
|
+
onLoadStart: () => O(!0),
|
|
797
797
|
onCanPlay: () => {
|
|
798
|
-
|
|
798
|
+
O(!1), A(!1);
|
|
799
799
|
},
|
|
800
|
-
onWaiting: () =>
|
|
800
|
+
onWaiting: () => O(!0),
|
|
801
801
|
onPlay: () => D(!1),
|
|
802
802
|
onLoadedMetadata: () => {
|
|
803
803
|
const x = u.current;
|
|
804
|
-
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight &&
|
|
804
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && E(x.videoWidth / x.videoHeight);
|
|
805
805
|
},
|
|
806
806
|
onEnded: () => {
|
|
807
|
-
i || (
|
|
807
|
+
i || (_(!1), p(0));
|
|
808
808
|
},
|
|
809
809
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
810
810
|
}
|
|
811
811
|
) }),
|
|
812
|
-
|
|
813
|
-
|
|
812
|
+
U && !L && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
813
|
+
xe,
|
|
814
814
|
{
|
|
815
815
|
className: "size-8 animate-spin text-white/80",
|
|
816
816
|
weight: "bold"
|
|
817
817
|
}
|
|
818
818
|
) }),
|
|
819
|
-
|
|
819
|
+
L && !l && /* @__PURE__ */ n(
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
822
822
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -824,10 +824,10 @@ const sa = (e) => {
|
|
|
824
824
|
tabIndex: 0,
|
|
825
825
|
"aria-label": "Play preview",
|
|
826
826
|
onClick: (x) => {
|
|
827
|
-
x.stopPropagation(),
|
|
827
|
+
x.stopPropagation(), C();
|
|
828
828
|
},
|
|
829
829
|
onKeyDown: (x) => {
|
|
830
|
-
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(),
|
|
830
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), C());
|
|
831
831
|
},
|
|
832
832
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(je, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
833
833
|
}
|
|
@@ -843,11 +843,11 @@ const sa = (e) => {
|
|
|
843
843
|
tabIndex: 0,
|
|
844
844
|
ref: f,
|
|
845
845
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
846
|
-
onMouseDown:
|
|
847
|
-
onTouchStart:
|
|
846
|
+
onMouseDown: j,
|
|
847
|
+
onTouchStart: j,
|
|
848
848
|
onClick: (x) => x.stopPropagation(),
|
|
849
849
|
onKeyDown: (x) => {
|
|
850
|
-
x.key === "ArrowRight" &&
|
|
850
|
+
x.key === "ArrowRight" && P(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, v - 0.05));
|
|
851
851
|
},
|
|
852
852
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
853
853
|
"div",
|
|
@@ -864,11 +864,11 @@ const sa = (e) => {
|
|
|
864
864
|
{
|
|
865
865
|
type: "button",
|
|
866
866
|
onClick: (x) => {
|
|
867
|
-
x.stopPropagation(),
|
|
867
|
+
x.stopPropagation(), _((S) => !S);
|
|
868
868
|
},
|
|
869
869
|
className: "shrink-0 text-white",
|
|
870
|
-
"aria-label":
|
|
871
|
-
children:
|
|
870
|
+
"aria-label": b ? "Pause" : "Play",
|
|
871
|
+
children: b ? /* @__PURE__ */ n(Es, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(je, { className: "size-5 translate-x-px", weight: "fill" })
|
|
872
872
|
}
|
|
873
873
|
),
|
|
874
874
|
/* @__PURE__ */ h(
|
|
@@ -882,19 +882,19 @@ const sa = (e) => {
|
|
|
882
882
|
tabIndex: 0,
|
|
883
883
|
ref: f,
|
|
884
884
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
885
|
-
onMouseDown:
|
|
886
|
-
onTouchStart:
|
|
885
|
+
onMouseDown: j,
|
|
886
|
+
onTouchStart: j,
|
|
887
887
|
onClick: (x) => x.stopPropagation(),
|
|
888
|
-
onMouseEnter: () =>
|
|
889
|
-
onMouseLeave: () =>
|
|
888
|
+
onMouseEnter: () => T(!0),
|
|
889
|
+
onMouseLeave: () => T(!1),
|
|
890
890
|
onKeyDown: (x) => {
|
|
891
|
-
x.key === "ArrowRight" &&
|
|
891
|
+
x.key === "ArrowRight" && P(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && P(Math.max(0, v - 0.05));
|
|
892
892
|
},
|
|
893
893
|
children: [
|
|
894
894
|
/* @__PURE__ */ n(
|
|
895
895
|
"div",
|
|
896
896
|
{
|
|
897
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
897
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${R || I ? "h-1.5" : "h-1"}`,
|
|
898
898
|
children: /* @__PURE__ */ n(
|
|
899
899
|
"div",
|
|
900
900
|
{
|
|
@@ -907,7 +907,7 @@ const sa = (e) => {
|
|
|
907
907
|
/* @__PURE__ */ n(
|
|
908
908
|
"div",
|
|
909
909
|
{
|
|
910
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
910
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${R || I ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
911
911
|
style: { left: `${Y}%` }
|
|
912
912
|
}
|
|
913
913
|
)
|
|
@@ -918,7 +918,7 @@ const sa = (e) => {
|
|
|
918
918
|
]
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
|
-
},
|
|
921
|
+
}, Vt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", oa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", sn = ({
|
|
922
922
|
mimeType: e,
|
|
923
923
|
sourceUrl: t,
|
|
924
924
|
thumbnailUrl: s,
|
|
@@ -927,9 +927,9 @@ const sa = (e) => {
|
|
|
927
927
|
mediaPlayerProps: i,
|
|
928
928
|
containedImage: l = !1
|
|
929
929
|
}) => {
|
|
930
|
-
const o = re(e), [d, m] =
|
|
930
|
+
const o = re(e), [d, m] = z(!1);
|
|
931
931
|
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
|
|
932
|
-
|
|
932
|
+
ia,
|
|
933
933
|
{
|
|
934
934
|
source: t,
|
|
935
935
|
mimeType: e,
|
|
@@ -976,11 +976,11 @@ const sa = (e) => {
|
|
|
976
976
|
{
|
|
977
977
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
978
978
|
children: ce(e, {
|
|
979
|
-
className:
|
|
979
|
+
className: Vt(r),
|
|
980
980
|
weight: "regular"
|
|
981
981
|
})
|
|
982
982
|
}
|
|
983
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
983
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${oa(r)}`, children: /* @__PURE__ */ n(
|
|
984
984
|
"img",
|
|
985
985
|
{
|
|
986
986
|
src: s,
|
|
@@ -993,12 +993,12 @@ const sa = (e) => {
|
|
|
993
993
|
{
|
|
994
994
|
className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
|
|
995
995
|
children: ce(e, {
|
|
996
|
-
className:
|
|
996
|
+
className: Vt(r),
|
|
997
997
|
weight: "regular"
|
|
998
998
|
})
|
|
999
999
|
}
|
|
1000
1000
|
);
|
|
1001
|
-
},
|
|
1001
|
+
}, an = ({
|
|
1002
1002
|
variant: e,
|
|
1003
1003
|
thumbnail: t,
|
|
1004
1004
|
title: s,
|
|
@@ -1012,13 +1012,13 @@ const sa = (e) => {
|
|
|
1012
1012
|
rootRef: g,
|
|
1013
1013
|
"data-testid": u
|
|
1014
1014
|
}) => {
|
|
1015
|
-
const f = e === "dark", c = f ? s ?? a : s ?? "",
|
|
1015
|
+
const f = e === "dark", c = f ? s ?? a : s ?? "", w = f && !s;
|
|
1016
1016
|
return /* @__PURE__ */ h(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
ref: g,
|
|
1020
1020
|
"data-testid": u,
|
|
1021
|
-
className:
|
|
1021
|
+
className: k(
|
|
1022
1022
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
1023
1023
|
f ? "bg-[#121110]" : "bg-white"
|
|
1024
1024
|
),
|
|
@@ -1030,17 +1030,17 @@ const sa = (e) => {
|
|
|
1030
1030
|
c.trim() !== "" && /* @__PURE__ */ n(
|
|
1031
1031
|
"p",
|
|
1032
1032
|
{
|
|
1033
|
-
className:
|
|
1033
|
+
className: k("mb-0.5 truncate text-base font-medium", {
|
|
1034
1034
|
"text-black": !f,
|
|
1035
|
-
"text-white/30": f &&
|
|
1036
|
-
"text-white": f && !
|
|
1035
|
+
"text-white/30": f && w,
|
|
1036
|
+
"text-white": f && !w
|
|
1037
1037
|
}),
|
|
1038
1038
|
children: c
|
|
1039
1039
|
}
|
|
1040
1040
|
),
|
|
1041
1041
|
/* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1042
1042
|
ce(r, {
|
|
1043
|
-
className:
|
|
1043
|
+
className: k(
|
|
1044
1044
|
"size-5 shrink-0",
|
|
1045
1045
|
f ? "text-white/55" : "text-black/55"
|
|
1046
1046
|
),
|
|
@@ -1049,7 +1049,7 @@ const sa = (e) => {
|
|
|
1049
1049
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1050
1050
|
"span",
|
|
1051
1051
|
{
|
|
1052
|
-
className:
|
|
1052
|
+
className: k(
|
|
1053
1053
|
"text-xs font-medium",
|
|
1054
1054
|
f ? "text-white/55" : "text-black/55"
|
|
1055
1055
|
),
|
|
@@ -1064,29 +1064,29 @@ const sa = (e) => {
|
|
|
1064
1064
|
}
|
|
1065
1065
|
);
|
|
1066
1066
|
};
|
|
1067
|
-
function
|
|
1067
|
+
function rn(e) {
|
|
1068
1068
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Qe(e) {
|
|
1071
1071
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function la(e) {
|
|
1074
1074
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function ca(e) {
|
|
1077
1077
|
return e ? "text-white" : "text-black";
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function da(e) {
|
|
1080
1080
|
return e ? "text-white/55" : "text-black/55";
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function ua(e) {
|
|
1083
1083
|
return e ? "text-white/40" : "text-black/40";
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function ma(e) {
|
|
1086
1086
|
return e ? "text-white/20" : "text-black/20";
|
|
1087
1087
|
}
|
|
1088
|
-
const
|
|
1089
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, m = /* @__PURE__ */ h(
|
|
1088
|
+
const et = ({ attachment: e, isMyMessage: t }) => {
|
|
1089
|
+
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, m = /* @__PURE__ */ h(V.Fragment, { children: [
|
|
1090
1090
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1091
1091
|
"img",
|
|
1092
1092
|
{
|
|
@@ -1097,26 +1097,26 @@ const Qe = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1097
1097
|
) : /* @__PURE__ */ n(
|
|
1098
1098
|
"div",
|
|
1099
1099
|
{
|
|
1100
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1101
|
-
children: /* @__PURE__ */ n(
|
|
1100
|
+
className: `aspect-video w-full rounded-[20px] ${la(t)} flex items-center justify-center`,
|
|
1101
|
+
children: /* @__PURE__ */ n(Ss, { className: `size-12 ${ma(t)}` })
|
|
1102
1102
|
}
|
|
1103
1103
|
) }),
|
|
1104
1104
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1105
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1106
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1107
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1105
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${ca(t)}`, children: s }),
|
|
1106
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${da(t)}`, children: a }),
|
|
1107
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ua(t)}`, children: d })
|
|
1108
1108
|
] })
|
|
1109
1109
|
] });
|
|
1110
1110
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
|
|
1111
1111
|
};
|
|
1112
|
-
function
|
|
1112
|
+
function on(e) {
|
|
1113
1113
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function tt(e) {
|
|
1116
1116
|
var t;
|
|
1117
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1117
|
+
return (t = e.attachments) == null ? void 0 : t.find(on);
|
|
1118
1118
|
}
|
|
1119
|
-
async function
|
|
1119
|
+
async function ha(e, t) {
|
|
1120
1120
|
let s;
|
|
1121
1121
|
try {
|
|
1122
1122
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1128,11 +1128,11 @@ async function ua(e, t) {
|
|
|
1128
1128
|
const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
|
|
1129
1129
|
l.href = i, l.download = s, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
|
|
1130
1130
|
}
|
|
1131
|
-
const
|
|
1131
|
+
const fa = ({
|
|
1132
1132
|
url: e,
|
|
1133
1133
|
filename: t
|
|
1134
1134
|
}) => {
|
|
1135
|
-
const [s, a] =
|
|
1135
|
+
const [s, a] = z(!1);
|
|
1136
1136
|
return /* @__PURE__ */ n(
|
|
1137
1137
|
"button",
|
|
1138
1138
|
{
|
|
@@ -1140,7 +1140,7 @@ const ma = ({
|
|
|
1140
1140
|
onClick: (i) => {
|
|
1141
1141
|
i.stopPropagation();
|
|
1142
1142
|
const l = window.open("", "_blank", "noopener,noreferrer");
|
|
1143
|
-
a(!0),
|
|
1143
|
+
a(!0), ha(e, t).then(() => {
|
|
1144
1144
|
l == null || l.close();
|
|
1145
1145
|
}).catch(() => {
|
|
1146
1146
|
l && (l.location.href = e);
|
|
@@ -1148,23 +1148,23 @@ const ma = ({
|
|
|
1148
1148
|
},
|
|
1149
1149
|
disabled: s,
|
|
1150
1150
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1151
|
-
children: s ? /* @__PURE__ */ n(
|
|
1152
|
-
/* @__PURE__ */ n(
|
|
1151
|
+
children: s ? /* @__PURE__ */ n(xe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(V.Fragment, { children: [
|
|
1152
|
+
/* @__PURE__ */ n(we, { className: "size-4 text-white", weight: "bold" }),
|
|
1153
1153
|
"Download"
|
|
1154
1154
|
] })
|
|
1155
1155
|
}
|
|
1156
1156
|
);
|
|
1157
1157
|
};
|
|
1158
|
-
function
|
|
1159
|
-
var u, f, c,
|
|
1158
|
+
function nt(e) {
|
|
1159
|
+
var u, f, c, w;
|
|
1160
1160
|
const t = (u = e.attachments) == null ? void 0 : u.find(
|
|
1161
|
-
(
|
|
1161
|
+
(b) => b.type === "video" && b.asset_url
|
|
1162
1162
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1163
|
-
(
|
|
1163
|
+
(b) => b.type === "image" && b.image_url
|
|
1164
1164
|
), a = (c = e.attachments) == null ? void 0 : c.find(
|
|
1165
|
-
(
|
|
1166
|
-
), r = (
|
|
1167
|
-
(
|
|
1165
|
+
(b) => b.type === "audio" && b.asset_url
|
|
1166
|
+
), r = (w = e.attachments) == null ? void 0 : w.find(
|
|
1167
|
+
(b) => b.type === "file" && b.asset_url
|
|
1168
1168
|
), i = t ?? s ?? a ?? r, l = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1169
1169
|
if (!l) return null;
|
|
1170
1170
|
const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
@@ -1176,16 +1176,16 @@ function tt(e) {
|
|
|
1176
1176
|
thumbnailUrl: g
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
1179
|
-
const
|
|
1179
|
+
const ln = ({
|
|
1180
1180
|
resolvedUrl: e,
|
|
1181
1181
|
resolvedType: t,
|
|
1182
1182
|
title: s,
|
|
1183
1183
|
fileSize: a,
|
|
1184
1184
|
thumbnailUrl: r
|
|
1185
1185
|
}) => {
|
|
1186
|
-
const i = a !== void 0 ?
|
|
1186
|
+
const i = a !== void 0 ? rn(a) : void 0;
|
|
1187
1187
|
return /* @__PURE__ */ n(
|
|
1188
|
-
|
|
1188
|
+
an,
|
|
1189
1189
|
{
|
|
1190
1190
|
variant: "dark",
|
|
1191
1191
|
title: s,
|
|
@@ -1193,7 +1193,7 @@ const on = ({
|
|
|
1193
1193
|
mimeType: t,
|
|
1194
1194
|
detail: i,
|
|
1195
1195
|
thumbnail: /* @__PURE__ */ n(
|
|
1196
|
-
|
|
1196
|
+
sn,
|
|
1197
1197
|
{
|
|
1198
1198
|
mimeType: t,
|
|
1199
1199
|
sourceUrl: e,
|
|
@@ -1204,23 +1204,23 @@ const on = ({
|
|
|
1204
1204
|
)
|
|
1205
1205
|
}
|
|
1206
1206
|
);
|
|
1207
|
-
},
|
|
1207
|
+
}, cn = ({
|
|
1208
1208
|
resolvedUrl: e,
|
|
1209
1209
|
resolvedType: t,
|
|
1210
1210
|
title: s,
|
|
1211
1211
|
fileSize: a,
|
|
1212
1212
|
thumbnailUrl: r
|
|
1213
1213
|
}) => {
|
|
1214
|
-
const i = re(t), l = a !== void 0 ?
|
|
1214
|
+
const i = re(t), l = a !== void 0 ? rn(a) : void 0;
|
|
1215
1215
|
return /* @__PURE__ */ n(
|
|
1216
|
-
|
|
1216
|
+
an,
|
|
1217
1217
|
{
|
|
1218
1218
|
variant: "light",
|
|
1219
1219
|
title: s,
|
|
1220
1220
|
mimeType: t,
|
|
1221
1221
|
detail: l,
|
|
1222
1222
|
thumbnail: /* @__PURE__ */ n(
|
|
1223
|
-
|
|
1223
|
+
sn,
|
|
1224
1224
|
{
|
|
1225
1225
|
mimeType: t,
|
|
1226
1226
|
sourceUrl: e,
|
|
@@ -1230,14 +1230,14 @@ const on = ({
|
|
|
1230
1230
|
containedImage: i === "image" || i === "document"
|
|
1231
1231
|
}
|
|
1232
1232
|
),
|
|
1233
|
-
action: /* @__PURE__ */ n(
|
|
1233
|
+
action: /* @__PURE__ */ n(fa, { url: e, filename: s })
|
|
1234
1234
|
}
|
|
1235
1235
|
);
|
|
1236
|
-
},
|
|
1236
|
+
}, ga = ({
|
|
1237
1237
|
message: e,
|
|
1238
1238
|
isMyMessage: t = !1
|
|
1239
1239
|
}) => {
|
|
1240
|
-
const s =
|
|
1240
|
+
const s = tt(e), a = nt(e);
|
|
1241
1241
|
return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
|
|
1242
1242
|
!t && e.user && /* @__PURE__ */ n(
|
|
1243
1243
|
oe,
|
|
@@ -1258,40 +1258,40 @@ const on = ({
|
|
|
1258
1258
|
{
|
|
1259
1259
|
className: "str-chat__message-bubble",
|
|
1260
1260
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1261
|
-
children: s ? /* @__PURE__ */ n("div", { className:
|
|
1261
|
+
children: s ? /* @__PURE__ */ n("div", { className: Qe(t), children: /* @__PURE__ */ n(et, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(ln, { ...a }) : /* @__PURE__ */ n(cn, { ...a })
|
|
1262
1262
|
}
|
|
1263
1263
|
) })
|
|
1264
1264
|
}
|
|
1265
1265
|
)
|
|
1266
1266
|
] });
|
|
1267
|
-
},
|
|
1267
|
+
}, ba = ({
|
|
1268
1268
|
message: e
|
|
1269
1269
|
}) => {
|
|
1270
|
-
const t =
|
|
1270
|
+
const t = tt(e);
|
|
1271
1271
|
if (t)
|
|
1272
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1273
|
-
const s =
|
|
1274
|
-
return s ? /* @__PURE__ */ n(
|
|
1275
|
-
},
|
|
1272
|
+
return /* @__PURE__ */ n("div", { className: Qe(!0), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !0 }) });
|
|
1273
|
+
const s = nt(e);
|
|
1274
|
+
return s ? /* @__PURE__ */ n(ln, { ...s }) : null;
|
|
1275
|
+
}, pa = ({
|
|
1276
1276
|
message: e
|
|
1277
1277
|
}) => {
|
|
1278
|
-
const t =
|
|
1278
|
+
const t = tt(e);
|
|
1279
1279
|
if (t)
|
|
1280
|
-
return /* @__PURE__ */ n("div", { className:
|
|
1281
|
-
const s =
|
|
1282
|
-
return s ? /* @__PURE__ */ n(
|
|
1283
|
-
},
|
|
1284
|
-
Creator:
|
|
1285
|
-
Visitor:
|
|
1286
|
-
}),
|
|
1280
|
+
return /* @__PURE__ */ n("div", { className: Qe(!1), children: /* @__PURE__ */ n(et, { attachment: t, isMyMessage: !1 }) });
|
|
1281
|
+
const s = nt(e);
|
|
1282
|
+
return s ? /* @__PURE__ */ n(cn, { ...s }) : null;
|
|
1283
|
+
}, ki = Object.assign(ga, {
|
|
1284
|
+
Creator: ba,
|
|
1285
|
+
Visitor: pa
|
|
1286
|
+
}), va = {
|
|
1287
1287
|
isUnlocking: () => !1
|
|
1288
|
-
},
|
|
1289
|
-
LockedAttachment:
|
|
1290
|
-
},
|
|
1291
|
-
function
|
|
1292
|
-
return
|
|
1288
|
+
}, xa = {
|
|
1289
|
+
LockedAttachment: va
|
|
1290
|
+
}, dn = We({}), Ei = dn.Provider;
|
|
1291
|
+
function wa(e) {
|
|
1292
|
+
return _e(dn)[e] ?? xa[e];
|
|
1293
1293
|
}
|
|
1294
|
-
const
|
|
1294
|
+
const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1295
1295
|
"svg",
|
|
1296
1296
|
{
|
|
1297
1297
|
width: e,
|
|
@@ -1308,45 +1308,45 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1308
1308
|
}
|
|
1309
1309
|
)
|
|
1310
1310
|
}
|
|
1311
|
-
),
|
|
1311
|
+
), Na = (e) => {
|
|
1312
1312
|
var t;
|
|
1313
1313
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1314
|
-
},
|
|
1314
|
+
}, ya = (e) => {
|
|
1315
1315
|
var t;
|
|
1316
1316
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1317
|
-
},
|
|
1317
|
+
}, Te = (e) => {
|
|
1318
1318
|
var t;
|
|
1319
1319
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1320
|
-
},
|
|
1320
|
+
}, Ca = (e) => {
|
|
1321
1321
|
var t;
|
|
1322
1322
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1323
|
-
},
|
|
1323
|
+
}, un = (e) => Na(e) || ya(e), ka = (e) => {
|
|
1324
1324
|
var t;
|
|
1325
|
-
return
|
|
1326
|
-
},
|
|
1325
|
+
return un(e) && !((t = e.text) != null && t.trim());
|
|
1326
|
+
}, $e = ({
|
|
1327
1327
|
message: e,
|
|
1328
1328
|
standalone: t = !1,
|
|
1329
1329
|
isMyMessage: s = !1,
|
|
1330
1330
|
hasAttachment: a = !1
|
|
1331
1331
|
}) => {
|
|
1332
1332
|
var u;
|
|
1333
|
-
const r =
|
|
1333
|
+
const r = un(e), i = Te(e);
|
|
1334
1334
|
if (!r && !i)
|
|
1335
1335
|
return null;
|
|
1336
1336
|
if (r) {
|
|
1337
1337
|
const f = (u = e.metadata) == null ? void 0 : u.amount_text;
|
|
1338
1338
|
if (!f) return null;
|
|
1339
|
-
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
1339
|
+
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", w = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1340
1340
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1341
|
-
/* @__PURE__ */ n(
|
|
1342
|
-
/* @__PURE__ */ n("span", { children:
|
|
1341
|
+
/* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
|
|
1342
|
+
/* @__PURE__ */ n("span", { children: w })
|
|
1343
1343
|
] });
|
|
1344
1344
|
}
|
|
1345
1345
|
const l = s && a, o = l ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
1346
1346
|
"message-chatbot-indicator",
|
|
1347
1347
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1348
1348
|
l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1349
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(
|
|
1349
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(_a, { size: l ? 12 : 15 }) });
|
|
1350
1350
|
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !l ? /* @__PURE__ */ h(ae, { children: [
|
|
1351
1351
|
m,
|
|
1352
1352
|
g
|
|
@@ -1354,7 +1354,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1354
1354
|
g,
|
|
1355
1355
|
m
|
|
1356
1356
|
] }) });
|
|
1357
|
-
},
|
|
1357
|
+
}, Ea = ({
|
|
1358
1358
|
selected: e,
|
|
1359
1359
|
onVoteUp: t,
|
|
1360
1360
|
onVoteDown: s
|
|
@@ -1363,32 +1363,32 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1363
1363
|
"button",
|
|
1364
1364
|
{
|
|
1365
1365
|
type: "button",
|
|
1366
|
-
className:
|
|
1366
|
+
className: k("message-vote-button focus-ring", {
|
|
1367
1367
|
"message-vote-button--selected": e === "up"
|
|
1368
1368
|
}),
|
|
1369
1369
|
onClick: t,
|
|
1370
1370
|
"aria-label": "Good response",
|
|
1371
1371
|
"aria-pressed": e === "up",
|
|
1372
1372
|
"data-tooltip": "Good response",
|
|
1373
|
-
children: /* @__PURE__ */ n(
|
|
1373
|
+
children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1374
1374
|
}
|
|
1375
1375
|
),
|
|
1376
1376
|
/* @__PURE__ */ n(
|
|
1377
1377
|
"button",
|
|
1378
1378
|
{
|
|
1379
1379
|
type: "button",
|
|
1380
|
-
className:
|
|
1380
|
+
className: k("message-vote-button focus-ring", {
|
|
1381
1381
|
"message-vote-button--selected": e === "down"
|
|
1382
1382
|
}),
|
|
1383
1383
|
onClick: s,
|
|
1384
1384
|
"aria-label": "Bad response",
|
|
1385
1385
|
"aria-pressed": e === "down",
|
|
1386
1386
|
"data-tooltip": "Bad response",
|
|
1387
|
-
children: /* @__PURE__ */ n(
|
|
1387
|
+
children: /* @__PURE__ */ n(As, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1388
1388
|
}
|
|
1389
1389
|
)
|
|
1390
|
-
] }),
|
|
1391
|
-
var
|
|
1390
|
+
] }), Sa = (e) => {
|
|
1391
|
+
var pt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et, St, It, Tt, At;
|
|
1392
1392
|
const {
|
|
1393
1393
|
additionalMessageInputProps: t,
|
|
1394
1394
|
chatbotVotingEnabled: s,
|
|
@@ -1403,73 +1403,73 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1403
1403
|
isMessageAIGenerated: u,
|
|
1404
1404
|
isMyMessage: f,
|
|
1405
1405
|
message: c,
|
|
1406
|
-
renderText:
|
|
1407
|
-
threadList:
|
|
1408
|
-
viewerLanguage:
|
|
1409
|
-
} = e, { client:
|
|
1410
|
-
Attachment:
|
|
1411
|
-
EditMessageModal:
|
|
1412
|
-
MessageActions:
|
|
1413
|
-
MessageBlocked: $ =
|
|
1414
|
-
MessageBouncePrompt:
|
|
1415
|
-
MessageDeleted:
|
|
1416
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1417
|
-
MessageRepliesCountButton: Q =
|
|
1406
|
+
renderText: w,
|
|
1407
|
+
threadList: b,
|
|
1408
|
+
viewerLanguage: _
|
|
1409
|
+
} = e, { client: v } = Ke("CustomMessage"), { channel: p } = de("CustomMessage"), { isUnlocking: I, onUnlockClick: M, onFetchSource: R, onDownloadClick: T } = wa("LockedAttachment"), [L, D] = z(!1), U = Dn(c.id), { selected: O, voteUp: N, voteDown: A } = qs(c), {
|
|
1410
|
+
Attachment: y = Pn,
|
|
1411
|
+
EditMessageModal: E = On,
|
|
1412
|
+
MessageActions: C,
|
|
1413
|
+
MessageBlocked: $ = zn,
|
|
1414
|
+
MessageBouncePrompt: P = $n,
|
|
1415
|
+
MessageDeleted: j = Fn,
|
|
1416
|
+
MessageIsThreadReplyInChannelButtonIndicator: J = Bn,
|
|
1417
|
+
MessageRepliesCountButton: Q = Vn,
|
|
1418
1418
|
ReminderNotification: Y = Un,
|
|
1419
1419
|
StreamedMessageText: x = jn,
|
|
1420
|
-
PinIndicator:
|
|
1421
|
-
} =
|
|
1420
|
+
PinIndicator: S
|
|
1421
|
+
} = Ht("CustomMessage"), B = Gn(c), G = Hn(c), q = se(
|
|
1422
1422
|
() => u == null ? void 0 : u(c),
|
|
1423
1423
|
[u, c]
|
|
1424
|
-
),
|
|
1425
|
-
const ge = c.attachments ?? [],
|
|
1426
|
-
if (!
|
|
1427
|
-
const
|
|
1428
|
-
return
|
|
1424
|
+
), F = se(() => {
|
|
1425
|
+
const ge = c.attachments ?? [], Se = c.shared_location ? [c.shared_location, ...ge] : ge;
|
|
1426
|
+
if (!Te(c)) return Se;
|
|
1427
|
+
const Mt = Se.filter((Rt) => !("type" in Rt) || !on(Rt));
|
|
1428
|
+
return Mt.length === Se.length ? Se : Mt;
|
|
1429
1429
|
}, [c]), W = se(() => {
|
|
1430
|
-
const ge =
|
|
1430
|
+
const ge = Qt({ message: c, viewerLanguage: _ });
|
|
1431
1431
|
return ge === c.text ? c : { ...c, text: ge };
|
|
1432
|
-
}, [c,
|
|
1433
|
-
if (
|
|
1432
|
+
}, [c, _]);
|
|
1433
|
+
if (Yn(c))
|
|
1434
1434
|
return null;
|
|
1435
1435
|
if (c.deleted_at || c.type === "deleted")
|
|
1436
|
-
return /* @__PURE__ */ n(
|
|
1437
|
-
if (
|
|
1436
|
+
return /* @__PURE__ */ n(j, { message: c });
|
|
1437
|
+
if (qn(c))
|
|
1438
1438
|
return /* @__PURE__ */ n($, {});
|
|
1439
|
-
const X = !
|
|
1440
|
-
let
|
|
1441
|
-
me ?
|
|
1442
|
-
const te = f(), ie =
|
|
1439
|
+
const X = !b && !!c.reply_count, ue = !b && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((pt = c.error) == null ? void 0 : pt.status) !== 403, he = Wn(c);
|
|
1440
|
+
let ee;
|
|
1441
|
+
me ? ee = () => m(c) : he && (ee = () => D(!0));
|
|
1442
|
+
const te = f(), ie = k(
|
|
1443
1443
|
"str-chat__message str-chat__message-simple",
|
|
1444
1444
|
`str-chat__message--${c.type}`,
|
|
1445
1445
|
`str-chat__message--${c.status}`,
|
|
1446
1446
|
te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
1447
1447
|
c.text ? "str-chat__message--has-text" : "has-no-text",
|
|
1448
1448
|
{
|
|
1449
|
-
"str-chat__message--has-attachment":
|
|
1449
|
+
"str-chat__message--has-attachment": B,
|
|
1450
1450
|
"str-chat__message--highlighted": g,
|
|
1451
1451
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1452
|
-
"str-chat__message--with-reactions":
|
|
1453
|
-
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((
|
|
1452
|
+
"str-chat__message--with-reactions": G,
|
|
1453
|
+
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((vt = c == null ? void 0 : c.error) == null ? void 0 : vt.status) !== 403,
|
|
1454
1454
|
"str-chat__message-with-thread-link": X || ue,
|
|
1455
1455
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1456
1456
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1457
1457
|
"str-chat__virtual-message__wrapper--group": l
|
|
1458
1458
|
}
|
|
1459
|
-
),
|
|
1459
|
+
), ht = c.poll_id && v.polls.fromState(c.poll_id), ft = ka(c), fe = Te(c), gt = Ca(c), Pe = !!(F != null && F.length && !c.quoted_message), bt = fe && te && Pe;
|
|
1460
1460
|
return /* @__PURE__ */ h(ae, { children: [
|
|
1461
1461
|
a && /* @__PURE__ */ n(
|
|
1462
|
-
|
|
1462
|
+
E,
|
|
1463
1463
|
{
|
|
1464
1464
|
additionalMessageInputProps: t
|
|
1465
1465
|
}
|
|
1466
1466
|
),
|
|
1467
|
-
|
|
1468
|
-
|
|
1467
|
+
L && /* @__PURE__ */ n(
|
|
1468
|
+
Xn,
|
|
1469
1469
|
{
|
|
1470
|
-
MessageBouncePrompt:
|
|
1470
|
+
MessageBouncePrompt: P,
|
|
1471
1471
|
onClose: () => D(!1),
|
|
1472
|
-
open:
|
|
1472
|
+
open: L
|
|
1473
1473
|
}
|
|
1474
1474
|
),
|
|
1475
1475
|
/* @__PURE__ */ h(
|
|
@@ -1478,8 +1478,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1478
1478
|
className: ie,
|
|
1479
1479
|
"data-message-id": c.id,
|
|
1480
1480
|
children: [
|
|
1481
|
-
|
|
1482
|
-
!!
|
|
1481
|
+
S && /* @__PURE__ */ n(S, {}),
|
|
1482
|
+
!!U && /* @__PURE__ */ n(Y, { reminder: U }),
|
|
1483
1483
|
c.user && /* @__PURE__ */ n(
|
|
1484
1484
|
oe,
|
|
1485
1485
|
{
|
|
@@ -1495,113 +1495,113 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1495
1495
|
/* @__PURE__ */ n(
|
|
1496
1496
|
"div",
|
|
1497
1497
|
{
|
|
1498
|
-
className:
|
|
1498
|
+
className: k("str-chat__message-inner", {
|
|
1499
1499
|
"str-chat__simple-message--error-failed": me || he
|
|
1500
1500
|
}),
|
|
1501
1501
|
"data-testid": "message-inner",
|
|
1502
|
-
onClick:
|
|
1503
|
-
onKeyDown:
|
|
1504
|
-
role:
|
|
1505
|
-
tabIndex:
|
|
1502
|
+
onClick: ee,
|
|
1503
|
+
onKeyDown: ee,
|
|
1504
|
+
role: ee ? "button" : void 0,
|
|
1505
|
+
tabIndex: ee ? 0 : void 0,
|
|
1506
1506
|
style: {
|
|
1507
1507
|
// Force margins to 0 to prevent hover layout shift
|
|
1508
1508
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1509
1509
|
marginInlineEnd: 0,
|
|
1510
1510
|
marginInlineStart: 0
|
|
1511
1511
|
},
|
|
1512
|
-
children:
|
|
1512
|
+
children: gt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1513
1513
|
te ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1514
|
-
|
|
1514
|
+
C && /* @__PURE__ */ n(C, {}),
|
|
1515
1515
|
/* @__PURE__ */ n(
|
|
1516
|
-
|
|
1516
|
+
Bt.Sent,
|
|
1517
1517
|
{
|
|
1518
|
-
title: (
|
|
1519
|
-
mimeType: (
|
|
1520
|
-
thumbnailUrl: (
|
|
1521
|
-
amountText: (
|
|
1522
|
-
detail: (
|
|
1523
|
-
paymentStatus: (
|
|
1524
|
-
onPreviewClick: () => M == null ? void 0 : M(c,
|
|
1525
|
-
onFetchSource: async () => await (
|
|
1518
|
+
title: (xt = c.metadata) == null ? void 0 : xt.attachment_title,
|
|
1519
|
+
mimeType: (wt = c.metadata) == null ? void 0 : wt.attachment_mime_type,
|
|
1520
|
+
thumbnailUrl: (_t = c.metadata) == null ? void 0 : _t.attachment_thumbnail,
|
|
1521
|
+
amountText: (Nt = c.metadata) == null ? void 0 : Nt.amount_text,
|
|
1522
|
+
detail: (yt = c.metadata) == null ? void 0 : yt.attachment_detail,
|
|
1523
|
+
paymentStatus: (Ct = c.metadata) == null ? void 0 : Ct.payment_status,
|
|
1524
|
+
onPreviewClick: () => M == null ? void 0 : M(c, p),
|
|
1525
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, p))
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
1528
1528
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1529
1529
|
/* @__PURE__ */ n(
|
|
1530
|
-
|
|
1530
|
+
Bt.Received,
|
|
1531
1531
|
{
|
|
1532
|
-
title: (
|
|
1533
|
-
mimeType: (
|
|
1534
|
-
thumbnailUrl: (
|
|
1535
|
-
amountText: (
|
|
1536
|
-
detail: (
|
|
1537
|
-
paymentStatus: (
|
|
1538
|
-
isUnlocking:
|
|
1539
|
-
onUnlockClick: () => M == null ? void 0 : M(c,
|
|
1540
|
-
onFetchSource: async () => await (
|
|
1541
|
-
onDownloadClick: () =>
|
|
1532
|
+
title: (kt = c.metadata) == null ? void 0 : kt.attachment_title,
|
|
1533
|
+
mimeType: (Et = c.metadata) == null ? void 0 : Et.attachment_mime_type,
|
|
1534
|
+
thumbnailUrl: (St = c.metadata) == null ? void 0 : St.attachment_thumbnail,
|
|
1535
|
+
amountText: (It = c.metadata) == null ? void 0 : It.amount_text,
|
|
1536
|
+
detail: (Tt = c.metadata) == null ? void 0 : Tt.attachment_detail,
|
|
1537
|
+
paymentStatus: (At = c.metadata) == null ? void 0 : At.payment_status,
|
|
1538
|
+
isUnlocking: I(c.id),
|
|
1539
|
+
onUnlockClick: () => M == null ? void 0 : M(c, p),
|
|
1540
|
+
onFetchSource: async () => await (R == null ? void 0 : R(c, p)),
|
|
1541
|
+
onDownloadClick: () => T == null ? void 0 : T(c, p)
|
|
1542
1542
|
}
|
|
1543
1543
|
),
|
|
1544
|
-
|
|
1544
|
+
C && /* @__PURE__ */ n(C, {})
|
|
1545
1545
|
] }),
|
|
1546
1546
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1547
|
-
|
|
1547
|
+
Dt,
|
|
1548
1548
|
{
|
|
1549
1549
|
message: W,
|
|
1550
|
-
renderText:
|
|
1550
|
+
renderText: w
|
|
1551
1551
|
}
|
|
1552
1552
|
) })
|
|
1553
|
-
] }) :
|
|
1553
|
+
] }) : ft ? (
|
|
1554
1554
|
/* Tip-only messages render as a standalone bubble */
|
|
1555
|
-
/* @__PURE__ */ n(
|
|
1555
|
+
/* @__PURE__ */ n($e, { message: c, standalone: !0 })
|
|
1556
1556
|
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
|
|
1557
|
-
fe && !
|
|
1558
|
-
|
|
1557
|
+
fe && !bt && /* @__PURE__ */ n(
|
|
1558
|
+
$e,
|
|
1559
1559
|
{
|
|
1560
1560
|
message: c,
|
|
1561
|
-
hasAttachment:
|
|
1561
|
+
hasAttachment: Pe,
|
|
1562
1562
|
isMyMessage: te
|
|
1563
1563
|
}
|
|
1564
1564
|
),
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1565
|
+
ht && /* @__PURE__ */ n(Kn, { poll: ht }),
|
|
1566
|
+
F != null && F.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1567
|
+
y,
|
|
1568
1568
|
{
|
|
1569
1569
|
actionHandler: o,
|
|
1570
|
-
attachments:
|
|
1570
|
+
attachments: F
|
|
1571
1571
|
}
|
|
1572
1572
|
) : null,
|
|
1573
1573
|
q ? /* @__PURE__ */ n(
|
|
1574
1574
|
x,
|
|
1575
1575
|
{
|
|
1576
1576
|
message: W,
|
|
1577
|
-
renderText:
|
|
1577
|
+
renderText: w
|
|
1578
1578
|
}
|
|
1579
1579
|
) : /* @__PURE__ */ n(
|
|
1580
|
-
|
|
1580
|
+
Dt,
|
|
1581
1581
|
{
|
|
1582
1582
|
message: W,
|
|
1583
|
-
renderText:
|
|
1583
|
+
renderText: w
|
|
1584
1584
|
}
|
|
1585
1585
|
),
|
|
1586
|
-
/* @__PURE__ */ n(
|
|
1586
|
+
/* @__PURE__ */ n(Jn, {})
|
|
1587
1587
|
] }) })
|
|
1588
1588
|
}
|
|
1589
1589
|
),
|
|
1590
|
-
!
|
|
1591
|
-
(!fe ||
|
|
1592
|
-
|
|
1590
|
+
!gt && !ft && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
|
|
1591
|
+
(!fe || bt) && /* @__PURE__ */ n(
|
|
1592
|
+
$e,
|
|
1593
1593
|
{
|
|
1594
1594
|
message: c,
|
|
1595
|
-
hasAttachment:
|
|
1595
|
+
hasAttachment: Pe,
|
|
1596
1596
|
isMyMessage: te
|
|
1597
1597
|
}
|
|
1598
1598
|
),
|
|
1599
1599
|
s && fe && /* @__PURE__ */ n(
|
|
1600
|
-
|
|
1600
|
+
Ea,
|
|
1601
1601
|
{
|
|
1602
|
-
selected:
|
|
1603
|
-
onVoteUp:
|
|
1604
|
-
onVoteDown:
|
|
1602
|
+
selected: O,
|
|
1603
|
+
onVoteUp: N,
|
|
1604
|
+
onVoteDown: A
|
|
1605
1605
|
}
|
|
1606
1606
|
)
|
|
1607
1607
|
] }),
|
|
@@ -1612,56 +1612,56 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1612
1612
|
reply_count: c.reply_count
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
ue && /* @__PURE__ */ n(
|
|
1615
|
+
ue && /* @__PURE__ */ n(J, {})
|
|
1616
1616
|
]
|
|
1617
1617
|
},
|
|
1618
1618
|
c.id
|
|
1619
1619
|
)
|
|
1620
1620
|
] });
|
|
1621
|
-
},
|
|
1622
|
-
|
|
1623
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1624
|
-
),
|
|
1625
|
-
const t =
|
|
1626
|
-
return /* @__PURE__ */ n(
|
|
1627
|
-
},
|
|
1621
|
+
}, Ia = V.memo(
|
|
1622
|
+
Sa,
|
|
1623
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ln(e, t)
|
|
1624
|
+
), Ta = (e) => {
|
|
1625
|
+
const t = Ne("CustomMessage");
|
|
1626
|
+
return /* @__PURE__ */ n(Ia, { ...t, ...e });
|
|
1627
|
+
}, Aa = () => {
|
|
1628
1628
|
var s;
|
|
1629
|
-
const { handleDelete: e, message: t } =
|
|
1629
|
+
const { handleDelete: e, message: t } = Ne("CustomMessageActions");
|
|
1630
1630
|
return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
|
|
1631
|
-
|
|
1631
|
+
Xt,
|
|
1632
1632
|
{
|
|
1633
1633
|
onClick: e,
|
|
1634
1634
|
"aria-label": "Delete",
|
|
1635
1635
|
title: "Delete",
|
|
1636
1636
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1637
|
-
children: /* @__PURE__ */ n(
|
|
1637
|
+
children: /* @__PURE__ */ n(Ms, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1638
1638
|
}
|
|
1639
1639
|
);
|
|
1640
|
-
},
|
|
1641
|
-
const { handleFlag: e } =
|
|
1640
|
+
}, Ma = () => {
|
|
1641
|
+
const { handleFlag: e } = Ne("CustomMessageActions");
|
|
1642
1642
|
return /* @__PURE__ */ n(
|
|
1643
|
-
|
|
1643
|
+
Xt,
|
|
1644
1644
|
{
|
|
1645
1645
|
onClick: e,
|
|
1646
1646
|
"aria-label": "Report",
|
|
1647
1647
|
title: "Report",
|
|
1648
1648
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1649
|
-
children: /* @__PURE__ */ n(
|
|
1649
|
+
children: /* @__PURE__ */ n(Yt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1650
1650
|
}
|
|
1651
1651
|
);
|
|
1652
|
-
},
|
|
1652
|
+
}, Ra = () => {
|
|
1653
1653
|
var t;
|
|
1654
|
-
const { message: e } =
|
|
1654
|
+
const { message: e } = Ne("CustomMessageActions");
|
|
1655
1655
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1656
|
-
|
|
1656
|
+
zs,
|
|
1657
1657
|
{
|
|
1658
1658
|
messageActionSet: [
|
|
1659
|
-
{ Component:
|
|
1660
|
-
{ Component:
|
|
1659
|
+
{ Component: Aa, placement: "quick", type: "delete" },
|
|
1660
|
+
{ Component: Ma, placement: "quick", type: "flag" }
|
|
1661
1661
|
]
|
|
1662
1662
|
}
|
|
1663
1663
|
);
|
|
1664
|
-
},
|
|
1664
|
+
}, La = ({
|
|
1665
1665
|
link: e,
|
|
1666
1666
|
onDismiss: t
|
|
1667
1667
|
}) => {
|
|
@@ -1691,7 +1691,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1691
1691
|
},
|
|
1692
1692
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1693
1693
|
"aria-label": "Close link preview",
|
|
1694
|
-
children: /* @__PURE__ */ n(
|
|
1694
|
+
children: /* @__PURE__ */ n(Le, { className: "size-4 text-black/90" })
|
|
1695
1695
|
}
|
|
1696
1696
|
),
|
|
1697
1697
|
/* @__PURE__ */ h("div", { className: "p-2", children: [
|
|
@@ -1701,26 +1701,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1701
1701
|
]
|
|
1702
1702
|
}
|
|
1703
1703
|
);
|
|
1704
|
-
},
|
|
1704
|
+
}, Da = (e) => ({
|
|
1705
1705
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1706
|
-
(t) =>
|
|
1706
|
+
(t) => Lt.previewIsLoaded(t) || Lt.previewIsLoading(t)
|
|
1707
1707
|
)
|
|
1708
|
-
}),
|
|
1709
|
-
const { linkPreviewsManager: e } =
|
|
1708
|
+
}), Pa = () => {
|
|
1709
|
+
const { linkPreviewsManager: e } = Zn(), { linkPreviews: t } = Qn(
|
|
1710
1710
|
e.state,
|
|
1711
|
-
|
|
1711
|
+
Da
|
|
1712
1712
|
), s = (r) => {
|
|
1713
1713
|
e.dismissPreview(r);
|
|
1714
1714
|
};
|
|
1715
1715
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-stretch w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1716
|
-
|
|
1716
|
+
La,
|
|
1717
1717
|
{
|
|
1718
1718
|
link: r,
|
|
1719
1719
|
onDismiss: s
|
|
1720
1720
|
},
|
|
1721
1721
|
r.og_scrape_url
|
|
1722
1722
|
)) }) : null;
|
|
1723
|
-
},
|
|
1723
|
+
}, st = V.createContext(!1), Si = () => _e(st), Oa = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1724
1724
|
"button",
|
|
1725
1725
|
{
|
|
1726
1726
|
...s,
|
|
@@ -1728,20 +1728,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1728
1728
|
"aria-label": "Send",
|
|
1729
1729
|
disabled: t,
|
|
1730
1730
|
onClick: e,
|
|
1731
|
-
children: /* @__PURE__ */ n(
|
|
1731
|
+
children: /* @__PURE__ */ n(Rs, { weight: "bold", className: "size-4" })
|
|
1732
1732
|
}
|
|
1733
|
-
),
|
|
1734
|
-
const e =
|
|
1735
|
-
SendButton: r =
|
|
1736
|
-
AttachmentPreviewList: i =
|
|
1737
|
-
} =
|
|
1733
|
+
), za = () => {
|
|
1734
|
+
const e = _e(st), { handleSubmit: t } = ts(), s = ns(), a = e || !s, {
|
|
1735
|
+
SendButton: r = Oa,
|
|
1736
|
+
AttachmentPreviewList: i = ss
|
|
1737
|
+
} = Ht("CustomMessageInput");
|
|
1738
1738
|
return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1739
|
-
/* @__PURE__ */ n(
|
|
1740
|
-
/* @__PURE__ */ n(
|
|
1739
|
+
/* @__PURE__ */ n(as, {}),
|
|
1740
|
+
/* @__PURE__ */ n(Pa, {}),
|
|
1741
1741
|
/* @__PURE__ */ n(i, {}),
|
|
1742
1742
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1743
1743
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1744
|
-
|
|
1744
|
+
rs,
|
|
1745
1745
|
{
|
|
1746
1746
|
"aria-disabled": e || void 0,
|
|
1747
1747
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1764,7 +1764,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1764
1764
|
)
|
|
1765
1765
|
] })
|
|
1766
1766
|
] });
|
|
1767
|
-
},
|
|
1767
|
+
}, $a = ({
|
|
1768
1768
|
renderActions: e,
|
|
1769
1769
|
renderFooter: t,
|
|
1770
1770
|
disabled: s = !1,
|
|
@@ -1785,23 +1785,23 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1785
1785
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1786
1786
|
children: [
|
|
1787
1787
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1788
|
-
/* @__PURE__ */ n(
|
|
1788
|
+
/* @__PURE__ */ n(st.Provider, { value: l, children: /* @__PURE__ */ n(es, { Input: r ?? za }) })
|
|
1789
1789
|
]
|
|
1790
1790
|
}
|
|
1791
1791
|
),
|
|
1792
1792
|
t == null ? void 0 : t()
|
|
1793
1793
|
] });
|
|
1794
|
-
},
|
|
1794
|
+
}, Fa = [
|
|
1795
1795
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1796
1796
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1797
|
-
],
|
|
1797
|
+
], Ba = {
|
|
1798
1798
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1799
1799
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1800
|
-
},
|
|
1800
|
+
}, Va = [
|
|
1801
1801
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1802
|
-
],
|
|
1802
|
+
], Ua = {
|
|
1803
1803
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1804
|
-
},
|
|
1804
|
+
}, Fe = "age safety guidelines.", ja = "https://linktr.ee/s/about/contact", Ut = (e) => Fa.includes(e), Ga = (e) => Va.includes(e), Ha = (e) => {
|
|
1805
1805
|
var a;
|
|
1806
1806
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1807
1807
|
if (Ut(t))
|
|
@@ -1809,7 +1809,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1809
1809
|
kind: "dm-agent",
|
|
1810
1810
|
type: t
|
|
1811
1811
|
};
|
|
1812
|
-
if (
|
|
1812
|
+
if (Ga(t))
|
|
1813
1813
|
return {
|
|
1814
1814
|
kind: "age-safety",
|
|
1815
1815
|
type: t
|
|
@@ -1820,32 +1820,32 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1820
1820
|
kind: "dm-agent",
|
|
1821
1821
|
type: s
|
|
1822
1822
|
};
|
|
1823
|
-
},
|
|
1824
|
-
const t = e.indexOf(
|
|
1823
|
+
}, Ya = (e) => {
|
|
1824
|
+
const t = e.indexOf(Fe);
|
|
1825
1825
|
if (t === -1)
|
|
1826
1826
|
return e;
|
|
1827
|
-
const s = t +
|
|
1827
|
+
const s = t + Fe.length;
|
|
1828
1828
|
return /* @__PURE__ */ h(ae, { children: [
|
|
1829
1829
|
e.slice(0, t),
|
|
1830
1830
|
/* @__PURE__ */ n(
|
|
1831
1831
|
"a",
|
|
1832
1832
|
{
|
|
1833
|
-
href:
|
|
1833
|
+
href: ja,
|
|
1834
1834
|
target: "_blank",
|
|
1835
1835
|
rel: "noopener noreferrer",
|
|
1836
1836
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1837
|
-
children:
|
|
1837
|
+
children: Fe
|
|
1838
1838
|
}
|
|
1839
1839
|
),
|
|
1840
1840
|
e.slice(s)
|
|
1841
1841
|
] });
|
|
1842
|
-
},
|
|
1842
|
+
}, qa = (e) => {
|
|
1843
1843
|
var a, r;
|
|
1844
|
-
const t = e.message.hide_date === !0, s =
|
|
1844
|
+
const t = e.message.hide_date === !0, s = Ha(
|
|
1845
1845
|
e.message
|
|
1846
1846
|
);
|
|
1847
1847
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
1848
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1848
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ba[s.type];
|
|
1849
1849
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1850
1850
|
/* @__PURE__ */ h(
|
|
1851
1851
|
"div",
|
|
@@ -1855,7 +1855,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1855
1855
|
"data-dm-agent-system-type": s.type,
|
|
1856
1856
|
children: [
|
|
1857
1857
|
/* @__PURE__ */ n(
|
|
1858
|
-
|
|
1858
|
+
Ge,
|
|
1859
1859
|
{
|
|
1860
1860
|
size: 16,
|
|
1861
1861
|
weight: "regular",
|
|
@@ -1871,7 +1871,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1871
1871
|
] });
|
|
1872
1872
|
}
|
|
1873
1873
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1874
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1874
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ua[s.type];
|
|
1875
1875
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1876
1876
|
/* @__PURE__ */ h(
|
|
1877
1877
|
"div",
|
|
@@ -1881,7 +1881,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1881
1881
|
"data-age-safety-system-type": s.type,
|
|
1882
1882
|
children: [
|
|
1883
1883
|
/* @__PURE__ */ n(
|
|
1884
|
-
|
|
1884
|
+
Ls,
|
|
1885
1885
|
{
|
|
1886
1886
|
size: 24,
|
|
1887
1887
|
weight: "duotone",
|
|
@@ -1890,7 +1890,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1890
1890
|
"data-testid": "age-safety-system-message-icon"
|
|
1891
1891
|
}
|
|
1892
1892
|
),
|
|
1893
|
-
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children:
|
|
1893
|
+
/* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ya(i) }) })
|
|
1894
1894
|
]
|
|
1895
1895
|
}
|
|
1896
1896
|
),
|
|
@@ -1905,7 +1905,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1905
1905
|
] }),
|
|
1906
1906
|
!t && /* @__PURE__ */ n(Oe, { message: e.message })
|
|
1907
1907
|
] });
|
|
1908
|
-
},
|
|
1908
|
+
}, mn = We(!1), Be = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
1909
1909
|
"animateTransform",
|
|
1910
1910
|
{
|
|
1911
1911
|
attributeName: "transform",
|
|
@@ -1915,21 +1915,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1915
1915
|
begin: `${120 * t}ms`,
|
|
1916
1916
|
repeatCount: "indefinite"
|
|
1917
1917
|
}
|
|
1918
|
-
) }),
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
]),
|
|
1923
|
-
var
|
|
1924
|
-
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } =
|
|
1925
|
-
if (!e && o &&
|
|
1926
|
-
const
|
|
1918
|
+
) }), Wa = /* @__PURE__ */ new Set([
|
|
1919
|
+
ze.Thinking,
|
|
1920
|
+
ze.Generating,
|
|
1921
|
+
ze.ExternalSources
|
|
1922
|
+
]), Xa = ({ threadList: e }) => {
|
|
1923
|
+
var w, b;
|
|
1924
|
+
const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = Ke(), { typing: i = {} } = is(), { aiState: l } = os(t), o = _e(mn);
|
|
1925
|
+
if (!e && o && Wa.has(l)) {
|
|
1926
|
+
const _ = Ka(t, (w = r.user) == null ? void 0 : w.id);
|
|
1927
1927
|
return /* @__PURE__ */ n(
|
|
1928
1928
|
jt,
|
|
1929
1929
|
{
|
|
1930
|
-
avatarId: (
|
|
1931
|
-
avatarName: (
|
|
1932
|
-
avatarImage:
|
|
1930
|
+
avatarId: (_ == null ? void 0 : _.id) ?? "ai-agent",
|
|
1931
|
+
avatarName: (_ == null ? void 0 : _.name) ?? (_ == null ? void 0 : _.id) ?? "Agent",
|
|
1932
|
+
avatarImage: _ == null ? void 0 : _.image,
|
|
1933
1933
|
testId: "typing-indicator-ai"
|
|
1934
1934
|
}
|
|
1935
1935
|
);
|
|
@@ -1937,19 +1937,19 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1937
1937
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1938
1938
|
return null;
|
|
1939
1939
|
const m = e ? [] : Object.values(i).filter(
|
|
1940
|
-
({ parent_id:
|
|
1941
|
-
var
|
|
1942
|
-
return (
|
|
1940
|
+
({ parent_id: _, user: v }) => {
|
|
1941
|
+
var p;
|
|
1942
|
+
return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && !_;
|
|
1943
1943
|
}
|
|
1944
1944
|
), g = e ? Object.values(i).filter(
|
|
1945
|
-
({ parent_id:
|
|
1946
|
-
var
|
|
1947
|
-
return (
|
|
1945
|
+
({ parent_id: _, user: v }) => {
|
|
1946
|
+
var p;
|
|
1947
|
+
return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && _ === (a == null ? void 0 : a.id);
|
|
1948
1948
|
}
|
|
1949
1949
|
) : [], u = e ? g : m;
|
|
1950
1950
|
if (!u.length)
|
|
1951
1951
|
return null;
|
|
1952
|
-
const f = (
|
|
1952
|
+
const f = (b = u[0]) == null ? void 0 : b.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
1953
1953
|
return /* @__PURE__ */ n(
|
|
1954
1954
|
jt,
|
|
1955
1955
|
{
|
|
@@ -1994,16 +1994,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1994
1994
|
height: "13",
|
|
1995
1995
|
overflow: "visible",
|
|
1996
1996
|
children: [
|
|
1997
|
-
/* @__PURE__ */ n(
|
|
1998
|
-
/* @__PURE__ */ n(
|
|
1999
|
-
/* @__PURE__ */ n(
|
|
1997
|
+
/* @__PURE__ */ n(Be, { cx: "4", index: 0 }),
|
|
1998
|
+
/* @__PURE__ */ n(Be, { cx: "16", index: 1 }),
|
|
1999
|
+
/* @__PURE__ */ n(Be, { cx: "28", index: 2 })
|
|
2000
2000
|
]
|
|
2001
2001
|
}
|
|
2002
2002
|
) }) }) }) }) })
|
|
2003
2003
|
] })
|
|
2004
2004
|
}
|
|
2005
2005
|
);
|
|
2006
|
-
function
|
|
2006
|
+
function Ka(e, t) {
|
|
2007
2007
|
var a;
|
|
2008
2008
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2009
2009
|
for (const r of Object.values(s)) {
|
|
@@ -2012,10 +2012,10 @@ function Wa(e, t) {
|
|
|
2012
2012
|
return i;
|
|
2013
2013
|
}
|
|
2014
2014
|
}
|
|
2015
|
-
const
|
|
2015
|
+
const Ja = () => null, Za = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2016
2016
|
"div",
|
|
2017
2017
|
{
|
|
2018
|
-
className:
|
|
2018
|
+
className: k("flex items-center justify-center h-full", e),
|
|
2019
2019
|
children: [
|
|
2020
2020
|
/* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
2021
2021
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
@@ -2055,12 +2055,24 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2055
2055
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2056
2056
|
]
|
|
2057
2057
|
}
|
|
2058
|
-
),
|
|
2059
|
-
/* @__PURE__ */ n(
|
|
2058
|
+
), Ae = V.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2059
|
+
/* @__PURE__ */ n(Za, { className: "w-6 h-6" }),
|
|
2060
2060
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2061
2061
|
] }) }));
|
|
2062
|
-
|
|
2063
|
-
const
|
|
2062
|
+
Ae.displayName = "LoadingState";
|
|
2063
|
+
const pe = ({
|
|
2064
|
+
className: e,
|
|
2065
|
+
size: t = 16
|
|
2066
|
+
}) => /* @__PURE__ */ n(
|
|
2067
|
+
Ds,
|
|
2068
|
+
{
|
|
2069
|
+
weight: "fill",
|
|
2070
|
+
size: t,
|
|
2071
|
+
className: k("shrink-0 text-[#1D9BF0]", e),
|
|
2072
|
+
"aria-label": "Verified",
|
|
2073
|
+
role: "img"
|
|
2074
|
+
}
|
|
2075
|
+
), le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Gt = "Replies instantly with AI assistant", Qa = ({
|
|
2064
2076
|
onBack: e,
|
|
2065
2077
|
showBackButton: t,
|
|
2066
2078
|
showStarButton: s = !1,
|
|
@@ -2075,30 +2087,30 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2075
2087
|
onReportParticipantClick: u,
|
|
2076
2088
|
customChannelActions: f,
|
|
2077
2089
|
renderChannelActions: c,
|
|
2078
|
-
showChannelInfo:
|
|
2079
|
-
onParticipantNameClick:
|
|
2080
|
-
renderHeaderTitleBadges:
|
|
2090
|
+
showChannelInfo: w = !0,
|
|
2091
|
+
onParticipantNameClick: b,
|
|
2092
|
+
renderHeaderTitleBadges: _
|
|
2081
2093
|
}) => {
|
|
2082
|
-
var
|
|
2083
|
-
const { channel:
|
|
2084
|
-
var
|
|
2085
|
-
const
|
|
2086
|
-
return
|
|
2087
|
-
(
|
|
2088
|
-
var
|
|
2089
|
-
return ((
|
|
2094
|
+
var U, O, N, A, y, E;
|
|
2095
|
+
const { channel: v } = de(), p = V.useMemo(() => {
|
|
2096
|
+
var P, j;
|
|
2097
|
+
const C = (P = v._client) == null ? void 0 : P.userID;
|
|
2098
|
+
return C ? Object.values(((j = v.state) == null ? void 0 : j.members) || {}).find(
|
|
2099
|
+
(J) => {
|
|
2100
|
+
var Q;
|
|
2101
|
+
return ((Q = J.user) == null ? void 0 : Q.id) && J.user.id !== C;
|
|
2090
2102
|
}
|
|
2091
2103
|
) : void 0;
|
|
2092
|
-
}, [(
|
|
2093
|
-
channel:
|
|
2094
|
-
participant:
|
|
2095
|
-
}),
|
|
2104
|
+
}, [(U = v._client) == null ? void 0 : U.userID, (O = v.state) == null ? void 0 : O.members]), I = Zt(p == null ? void 0 : p.user), M = (N = p == null ? void 0 : p.user) == null ? void 0 : N.image, R = ((A = p == null ? void 0 : p.user) == null ? void 0 : A.is_verified) === !0, T = Jt(v), L = _ == null ? void 0 : _({
|
|
2105
|
+
channel: v,
|
|
2106
|
+
participant: p
|
|
2107
|
+
}), D = async () => {
|
|
2096
2108
|
try {
|
|
2097
|
-
|
|
2098
|
-
} catch (
|
|
2109
|
+
T ? await v.unpin() : await v.pin();
|
|
2110
|
+
} catch (C) {
|
|
2099
2111
|
console.error(
|
|
2100
2112
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2101
|
-
|
|
2113
|
+
C
|
|
2102
2114
|
);
|
|
2103
2115
|
}
|
|
2104
2116
|
};
|
|
@@ -2107,7 +2119,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2107
2119
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
2108
2120
|
"button",
|
|
2109
2121
|
{
|
|
2110
|
-
className:
|
|
2122
|
+
className: k(
|
|
2111
2123
|
le,
|
|
2112
2124
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
2113
2125
|
),
|
|
@@ -2122,34 +2134,36 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2122
2134
|
/* @__PURE__ */ n(
|
|
2123
2135
|
oe,
|
|
2124
2136
|
{
|
|
2125
|
-
id: ((
|
|
2126
|
-
name:
|
|
2137
|
+
id: ((y = p == null ? void 0 : p.user) == null ? void 0 : y.id) || v.id || "unknown",
|
|
2138
|
+
name: I,
|
|
2127
2139
|
image: M,
|
|
2128
|
-
starred: s &&
|
|
2140
|
+
starred: s && T,
|
|
2129
2141
|
dmAgentEnabled: a,
|
|
2130
2142
|
size: 48
|
|
2131
2143
|
}
|
|
2132
2144
|
),
|
|
2133
|
-
|
|
2145
|
+
b ? /* @__PURE__ */ h(
|
|
2134
2146
|
"button",
|
|
2135
2147
|
{
|
|
2136
2148
|
type: "button",
|
|
2137
|
-
onClick:
|
|
2138
|
-
"aria-label": `View details for ${
|
|
2149
|
+
onClick: b,
|
|
2150
|
+
"aria-label": `View details for ${I}`,
|
|
2139
2151
|
className: "flex max-w-full items-center gap-0.5 rounded text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2140
2152
|
children: [
|
|
2141
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
2142
|
-
R && /* @__PURE__ */ n(
|
|
2143
|
-
/* @__PURE__ */ n(
|
|
2153
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
|
|
2154
|
+
R && /* @__PURE__ */ n(pe, {}),
|
|
2155
|
+
L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L }),
|
|
2156
|
+
/* @__PURE__ */ n(He, { className: "size-3 shrink-0", weight: "bold" })
|
|
2144
2157
|
]
|
|
2145
2158
|
}
|
|
2146
2159
|
) : /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
|
|
2147
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
2148
|
-
R && /* @__PURE__ */ n(
|
|
2160
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
|
|
2161
|
+
R && /* @__PURE__ */ n(pe, {}),
|
|
2162
|
+
L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
|
|
2149
2163
|
] }),
|
|
2150
2164
|
a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2151
|
-
/* @__PURE__ */ n(
|
|
2152
|
-
/* @__PURE__ */ n("span", { children:
|
|
2165
|
+
/* @__PURE__ */ n(Ge, { className: "size-3 shrink-0 text-black/55" }),
|
|
2166
|
+
/* @__PURE__ */ n("span", { children: Gt })
|
|
2153
2167
|
] })
|
|
2154
2168
|
] }),
|
|
2155
2169
|
/* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
|
|
@@ -2157,26 +2171,26 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2157
2171
|
"button",
|
|
2158
2172
|
{
|
|
2159
2173
|
className: le,
|
|
2160
|
-
onClick:
|
|
2174
|
+
onClick: D,
|
|
2161
2175
|
type: "button",
|
|
2162
|
-
"aria-label":
|
|
2176
|
+
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
2163
2177
|
children: /* @__PURE__ */ n(
|
|
2164
2178
|
Ue,
|
|
2165
2179
|
{
|
|
2166
|
-
className:
|
|
2167
|
-
"text-yellow-600":
|
|
2168
|
-
"text-black/90": !
|
|
2180
|
+
className: k("size-5", {
|
|
2181
|
+
"text-yellow-600": T,
|
|
2182
|
+
"text-black/90": !T
|
|
2169
2183
|
}),
|
|
2170
|
-
weight:
|
|
2184
|
+
weight: T ? "duotone" : "regular"
|
|
2171
2185
|
}
|
|
2172
2186
|
)
|
|
2173
2187
|
}
|
|
2174
2188
|
),
|
|
2175
|
-
|
|
2176
|
-
|
|
2189
|
+
w && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2190
|
+
Ft,
|
|
2177
2191
|
{
|
|
2178
|
-
channel:
|
|
2179
|
-
participant:
|
|
2192
|
+
channel: v,
|
|
2193
|
+
participant: p,
|
|
2180
2194
|
showDeleteConversation: l,
|
|
2181
2195
|
showBlockParticipant: o,
|
|
2182
2196
|
showReportParticipant: d,
|
|
@@ -2186,7 +2200,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2186
2200
|
onBlockParticipantClick: g,
|
|
2187
2201
|
onReportParticipantClick: u,
|
|
2188
2202
|
customChannelActions: f,
|
|
2189
|
-
triggerClassName:
|
|
2203
|
+
triggerClassName: k(le, "bg-[#F1F0EE]")
|
|
2190
2204
|
}
|
|
2191
2205
|
))
|
|
2192
2206
|
] })
|
|
@@ -2196,7 +2210,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2196
2210
|
t && e && /* @__PURE__ */ n(
|
|
2197
2211
|
"button",
|
|
2198
2212
|
{
|
|
2199
|
-
className:
|
|
2213
|
+
className: k(
|
|
2200
2214
|
le,
|
|
2201
2215
|
"messaging-channel-view-back-button-desktop"
|
|
2202
2216
|
),
|
|
@@ -2209,35 +2223,37 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2209
2223
|
/* @__PURE__ */ n(
|
|
2210
2224
|
oe,
|
|
2211
2225
|
{
|
|
2212
|
-
id: ((
|
|
2213
|
-
name:
|
|
2226
|
+
id: ((E = p == null ? void 0 : p.user) == null ? void 0 : E.id) || v.id || "unknown",
|
|
2227
|
+
name: I,
|
|
2214
2228
|
image: M,
|
|
2215
|
-
starred: s &&
|
|
2229
|
+
starred: s && T,
|
|
2216
2230
|
dmAgentEnabled: a,
|
|
2217
2231
|
size: 48
|
|
2218
2232
|
}
|
|
2219
2233
|
),
|
|
2220
2234
|
/* @__PURE__ */ h("div", { className: "min-w-0", children: [
|
|
2221
|
-
|
|
2235
|
+
b ? /* @__PURE__ */ h(
|
|
2222
2236
|
"button",
|
|
2223
2237
|
{
|
|
2224
2238
|
type: "button",
|
|
2225
|
-
onClick:
|
|
2226
|
-
"aria-label": `View details for ${
|
|
2239
|
+
onClick: b,
|
|
2240
|
+
"aria-label": `View details for ${I}`,
|
|
2227
2241
|
className: "flex min-w-0 max-w-full items-center gap-1 rounded font-medium text-black/90 transition-opacity hover:opacity-70",
|
|
2228
2242
|
children: [
|
|
2229
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
2230
|
-
R && /* @__PURE__ */ n(
|
|
2231
|
-
/* @__PURE__ */ n(
|
|
2243
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
|
|
2244
|
+
R && /* @__PURE__ */ n(pe, {}),
|
|
2245
|
+
L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L }),
|
|
2246
|
+
/* @__PURE__ */ n(He, { className: "size-4 shrink-0", weight: "bold" })
|
|
2232
2247
|
]
|
|
2233
2248
|
}
|
|
2234
2249
|
) : /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
2235
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
2236
|
-
R && /* @__PURE__ */ n(
|
|
2250
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
|
|
2251
|
+
R && /* @__PURE__ */ n(pe, {}),
|
|
2252
|
+
L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
|
|
2237
2253
|
] }),
|
|
2238
2254
|
a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
2239
|
-
/* @__PURE__ */ n(
|
|
2240
|
-
/* @__PURE__ */ n("span", { className: "truncate", children:
|
|
2255
|
+
/* @__PURE__ */ n(Ge, { className: "size-3 shrink-0 text-black/55" }),
|
|
2256
|
+
/* @__PURE__ */ n("span", { className: "truncate", children: Gt })
|
|
2241
2257
|
] })
|
|
2242
2258
|
] })
|
|
2243
2259
|
] }),
|
|
@@ -2246,26 +2262,26 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2246
2262
|
"button",
|
|
2247
2263
|
{
|
|
2248
2264
|
className: le,
|
|
2249
|
-
onClick:
|
|
2265
|
+
onClick: D,
|
|
2250
2266
|
type: "button",
|
|
2251
|
-
"aria-label":
|
|
2267
|
+
"aria-label": T ? "Unstar conversation" : "Star conversation",
|
|
2252
2268
|
children: /* @__PURE__ */ n(
|
|
2253
2269
|
Ue,
|
|
2254
2270
|
{
|
|
2255
|
-
className:
|
|
2256
|
-
"text-yellow-600":
|
|
2257
|
-
"text-black/90": !
|
|
2271
|
+
className: k("size-6", {
|
|
2272
|
+
"text-yellow-600": T,
|
|
2273
|
+
"text-black/90": !T
|
|
2258
2274
|
}),
|
|
2259
|
-
weight:
|
|
2275
|
+
weight: T ? "duotone" : "regular"
|
|
2260
2276
|
}
|
|
2261
2277
|
)
|
|
2262
2278
|
}
|
|
2263
2279
|
),
|
|
2264
|
-
|
|
2265
|
-
|
|
2280
|
+
w && (c !== void 0 ? c : /* @__PURE__ */ n(
|
|
2281
|
+
Ft,
|
|
2266
2282
|
{
|
|
2267
|
-
channel:
|
|
2268
|
-
participant:
|
|
2283
|
+
channel: v,
|
|
2284
|
+
participant: p,
|
|
2269
2285
|
showDeleteConversation: l,
|
|
2270
2286
|
showBlockParticipant: o,
|
|
2271
2287
|
showReportParticipant: d,
|
|
@@ -2281,7 +2297,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2281
2297
|
] })
|
|
2282
2298
|
] })
|
|
2283
2299
|
] });
|
|
2284
|
-
},
|
|
2300
|
+
}, er = ({
|
|
2285
2301
|
onBack: e,
|
|
2286
2302
|
showBackButton: t,
|
|
2287
2303
|
renderMessageInputActions: s,
|
|
@@ -2296,66 +2312,66 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2296
2312
|
showBlockParticipant: u = !0,
|
|
2297
2313
|
showReportParticipant: f = !0,
|
|
2298
2314
|
composerDisabled: c = !1,
|
|
2299
|
-
composerDisabledReason:
|
|
2300
|
-
showStarButton:
|
|
2301
|
-
chatbotVotingEnabled:
|
|
2302
|
-
renderChannelBanner:
|
|
2303
|
-
renderHeaderTitleBadges:
|
|
2304
|
-
customChannelActions:
|
|
2315
|
+
composerDisabledReason: w,
|
|
2316
|
+
showStarButton: b = !1,
|
|
2317
|
+
chatbotVotingEnabled: _ = !1,
|
|
2318
|
+
renderChannelBanner: v,
|
|
2319
|
+
renderHeaderTitleBadges: p,
|
|
2320
|
+
customChannelActions: I,
|
|
2305
2321
|
renderChannelActions: M,
|
|
2306
|
-
renderMessage:
|
|
2307
|
-
dmAgentEnabled:
|
|
2308
|
-
viewerLanguage:
|
|
2322
|
+
renderMessage: R,
|
|
2323
|
+
dmAgentEnabled: T = !1,
|
|
2324
|
+
viewerLanguage: L,
|
|
2309
2325
|
showChannelInfo: D = !0,
|
|
2310
|
-
onParticipantNameClick:
|
|
2311
|
-
composerInput:
|
|
2326
|
+
onParticipantNameClick: U,
|
|
2327
|
+
composerInput: O
|
|
2312
2328
|
}) => {
|
|
2313
|
-
var
|
|
2314
|
-
const { channel:
|
|
2315
|
-
var q,
|
|
2316
|
-
const
|
|
2317
|
-
return
|
|
2329
|
+
var j, J, Q, Y, x, S;
|
|
2330
|
+
const { channel: N } = de(), A = V.useMemo(() => {
|
|
2331
|
+
var q, F;
|
|
2332
|
+
const B = (q = N._client) == null ? void 0 : q.userID;
|
|
2333
|
+
return B ? Object.values(((F = N.state) == null ? void 0 : F.members) || {}).find(
|
|
2318
2334
|
(W) => {
|
|
2319
2335
|
var X;
|
|
2320
|
-
return ((X = W.user) == null ? void 0 : X.id) && W.user.id !==
|
|
2336
|
+
return ((X = W.user) == null ? void 0 : X.id) && W.user.id !== B;
|
|
2321
2337
|
}
|
|
2322
2338
|
) : void 0;
|
|
2323
|
-
}, [(
|
|
2324
|
-
var q,
|
|
2325
|
-
const
|
|
2326
|
-
return
|
|
2339
|
+
}, [(j = N._client) == null ? void 0 : j.userID, (J = N.state) == null ? void 0 : J.members]), y = V.useMemo(() => {
|
|
2340
|
+
var q, F;
|
|
2341
|
+
const B = (q = N._client) == null ? void 0 : q.userID;
|
|
2342
|
+
return B ? Object.values(((F = N.state) == null ? void 0 : F.members) || {}).find((W) => {
|
|
2327
2343
|
var X;
|
|
2328
|
-
return ((X = W.user) == null ? void 0 : X.id) ===
|
|
2344
|
+
return ((X = W.user) == null ? void 0 : X.id) === B;
|
|
2329
2345
|
}) : void 0;
|
|
2330
|
-
}, [(Q =
|
|
2331
|
-
(
|
|
2332
|
-
const { message:
|
|
2333
|
-
|
|
2346
|
+
}, [(Q = N._client) == null ? void 0 : Q.userID, (Y = N.state) == null ? void 0 : Y.members]), E = ((x = y == null ? void 0 : y.user) == null ? void 0 : x.is_account) ?? (y == null ? void 0 : y.is_account), C = ((S = A == null ? void 0 : A.user) == null ? void 0 : S.is_account) ?? (A == null ? void 0 : A.is_account), $ = T && E === !1 && C === !0, P = Z(
|
|
2347
|
+
(B) => {
|
|
2348
|
+
const { message: G } = Ne("ChannelView"), q = /* @__PURE__ */ n(
|
|
2349
|
+
Ta,
|
|
2334
2350
|
{
|
|
2335
|
-
...
|
|
2336
|
-
chatbotVotingEnabled:
|
|
2337
|
-
viewerLanguage:
|
|
2351
|
+
...B,
|
|
2352
|
+
chatbotVotingEnabled: _,
|
|
2353
|
+
viewerLanguage: L
|
|
2338
2354
|
}
|
|
2339
2355
|
);
|
|
2340
|
-
return !
|
|
2356
|
+
return !R || !G ? q : R(q, G);
|
|
2341
2357
|
},
|
|
2342
|
-
[
|
|
2358
|
+
[_, R, L]
|
|
2343
2359
|
);
|
|
2344
2360
|
return /* @__PURE__ */ n(ae, { children: /* @__PURE__ */ n(
|
|
2345
|
-
|
|
2361
|
+
cs,
|
|
2346
2362
|
{
|
|
2347
2363
|
overrides: {
|
|
2348
|
-
Message:
|
|
2349
|
-
MessageActions:
|
|
2364
|
+
Message: P,
|
|
2365
|
+
MessageActions: Ra
|
|
2350
2366
|
},
|
|
2351
|
-
children: /* @__PURE__ */ h(
|
|
2367
|
+
children: /* @__PURE__ */ h(ds, { children: [
|
|
2352
2368
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2353
|
-
|
|
2369
|
+
Qa,
|
|
2354
2370
|
{
|
|
2355
2371
|
onBack: e,
|
|
2356
2372
|
showBackButton: t,
|
|
2357
2373
|
showChannelInfo: D,
|
|
2358
|
-
showStarButton:
|
|
2374
|
+
showStarButton: b,
|
|
2359
2375
|
dmAgentEnabled: $,
|
|
2360
2376
|
onLeaveConversation: i,
|
|
2361
2377
|
onBlockParticipant: l,
|
|
@@ -2365,39 +2381,39 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2365
2381
|
onDeleteConversationClick: d,
|
|
2366
2382
|
onBlockParticipantClick: m,
|
|
2367
2383
|
onReportParticipantClick: g,
|
|
2368
|
-
customChannelActions:
|
|
2384
|
+
customChannelActions: I,
|
|
2369
2385
|
renderChannelActions: M,
|
|
2370
|
-
onParticipantNameClick:
|
|
2371
|
-
renderHeaderTitleBadges:
|
|
2386
|
+
onParticipantNameClick: U,
|
|
2387
|
+
renderHeaderTitleBadges: p
|
|
2372
2388
|
}
|
|
2373
2389
|
) }, "lt-channel-header"),
|
|
2374
|
-
|
|
2390
|
+
v ? /* @__PURE__ */ n(V.Fragment, { children: v() }, "lt-channel-banner") : null,
|
|
2375
2391
|
/* @__PURE__ */ n(
|
|
2376
2392
|
"div",
|
|
2377
2393
|
{
|
|
2378
2394
|
className: "flex-1 overflow-hidden relative",
|
|
2379
|
-
children: /* @__PURE__ */ n(
|
|
2395
|
+
children: /* @__PURE__ */ n(us, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2380
2396
|
},
|
|
2381
2397
|
"lt-channel-message-list"
|
|
2382
2398
|
),
|
|
2383
|
-
r ? /* @__PURE__ */ n(
|
|
2399
|
+
r ? /* @__PURE__ */ n(V.Fragment, { children: r(N) }, "lt-channel-conversation-footer") : null,
|
|
2384
2400
|
/* @__PURE__ */ n(
|
|
2385
|
-
|
|
2401
|
+
$a,
|
|
2386
2402
|
{
|
|
2387
2403
|
...s && {
|
|
2388
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2404
|
+
renderActions: () => s == null ? void 0 : s(N)
|
|
2389
2405
|
},
|
|
2390
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2406
|
+
renderFooter: () => a == null ? void 0 : a(N),
|
|
2391
2407
|
disabled: c,
|
|
2392
|
-
disabledReason:
|
|
2393
|
-
composerInput:
|
|
2408
|
+
disabledReason: w,
|
|
2409
|
+
composerInput: O
|
|
2394
2410
|
},
|
|
2395
2411
|
"lt-channel-message-input"
|
|
2396
2412
|
)
|
|
2397
2413
|
] })
|
|
2398
2414
|
}
|
|
2399
2415
|
) });
|
|
2400
|
-
},
|
|
2416
|
+
}, hn = V.memo(
|
|
2401
2417
|
({
|
|
2402
2418
|
channel: e,
|
|
2403
2419
|
onBack: t,
|
|
@@ -2408,86 +2424,86 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2408
2424
|
onLeaveConversation: l,
|
|
2409
2425
|
onBlockParticipant: o,
|
|
2410
2426
|
className: d,
|
|
2411
|
-
CustomChannelEmptyState: m =
|
|
2427
|
+
CustomChannelEmptyState: m = Ja,
|
|
2412
2428
|
showDeleteConversation: g = !0,
|
|
2413
2429
|
onDeleteConversationClick: u,
|
|
2414
2430
|
onBlockParticipantClick: f,
|
|
2415
2431
|
onReportParticipantClick: c,
|
|
2416
|
-
showBlockParticipant:
|
|
2417
|
-
showReportParticipant:
|
|
2418
|
-
composerDisabled:
|
|
2419
|
-
composerDisabledReason:
|
|
2420
|
-
dmAgentEnabled:
|
|
2421
|
-
messageMetadata:
|
|
2432
|
+
showBlockParticipant: w = !0,
|
|
2433
|
+
showReportParticipant: b = !0,
|
|
2434
|
+
composerDisabled: _ = !1,
|
|
2435
|
+
composerDisabledReason: v,
|
|
2436
|
+
dmAgentEnabled: p,
|
|
2437
|
+
messageMetadata: I,
|
|
2422
2438
|
onMessageSent: M,
|
|
2423
|
-
showStarButton:
|
|
2424
|
-
chatbotVotingEnabled:
|
|
2425
|
-
renderChannelBanner:
|
|
2439
|
+
showStarButton: R = !1,
|
|
2440
|
+
chatbotVotingEnabled: T = !1,
|
|
2441
|
+
renderChannelBanner: L,
|
|
2426
2442
|
renderHeaderTitleBadges: D,
|
|
2427
|
-
customChannelActions:
|
|
2428
|
-
renderChannelActions:
|
|
2429
|
-
renderMessage:
|
|
2430
|
-
onMessageLinkClick:
|
|
2431
|
-
sendButton:
|
|
2432
|
-
attachmentPreviewList:
|
|
2433
|
-
viewerLanguage:
|
|
2443
|
+
customChannelActions: U,
|
|
2444
|
+
renderChannelActions: O,
|
|
2445
|
+
renderMessage: N,
|
|
2446
|
+
onMessageLinkClick: A,
|
|
2447
|
+
sendButton: y,
|
|
2448
|
+
attachmentPreviewList: E,
|
|
2449
|
+
viewerLanguage: C,
|
|
2434
2450
|
showChannelInfo: $ = !0,
|
|
2435
|
-
onParticipantNameClick:
|
|
2436
|
-
composerInput:
|
|
2451
|
+
onParticipantNameClick: P,
|
|
2452
|
+
composerInput: j
|
|
2437
2453
|
}) => {
|
|
2438
|
-
const
|
|
2439
|
-
async (Y, x,
|
|
2454
|
+
const J = Z(
|
|
2455
|
+
async (Y, x, S) => {
|
|
2440
2456
|
var X;
|
|
2441
|
-
const
|
|
2457
|
+
const B = ((X = e.data) == null ? void 0 : X.chatbot_paused) === !0, G = p && !B, q = {
|
|
2442
2458
|
...x,
|
|
2443
|
-
...
|
|
2444
|
-
...
|
|
2459
|
+
...G && { silent: !0 },
|
|
2460
|
+
...I && {
|
|
2445
2461
|
metadata: {
|
|
2446
2462
|
...x.metadata ?? {},
|
|
2447
|
-
...
|
|
2463
|
+
...I
|
|
2448
2464
|
}
|
|
2449
2465
|
}
|
|
2450
|
-
},
|
|
2451
|
-
...
|
|
2452
|
-
...
|
|
2453
|
-
}, W = await e.sendMessage(q,
|
|
2466
|
+
}, F = {
|
|
2467
|
+
...S,
|
|
2468
|
+
...G && { skip_push: !0 }
|
|
2469
|
+
}, W = await e.sendMessage(q, F);
|
|
2454
2470
|
return M == null || M(W), W;
|
|
2455
2471
|
},
|
|
2456
|
-
[e,
|
|
2457
|
-
), Q =
|
|
2472
|
+
[e, p, I, M]
|
|
2473
|
+
), Q = H(null);
|
|
2458
2474
|
return K(() => {
|
|
2459
|
-
if (!
|
|
2475
|
+
if (!A) return;
|
|
2460
2476
|
const Y = Q.current;
|
|
2461
2477
|
if (!Y) return;
|
|
2462
|
-
const x = (
|
|
2463
|
-
const
|
|
2478
|
+
const x = (S) => {
|
|
2479
|
+
const B = S.target, G = B == null ? void 0 : B.closest("a[href]"), q = G == null ? void 0 : G.getAttribute("href");
|
|
2464
2480
|
if (!q) return;
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2481
|
+
const F = G == null ? void 0 : G.closest("[data-message-id]"), W = F == null ? void 0 : F.getAttribute("data-message-id"), X = W ? e.state.messages.find((ue) => ue.id === W) : void 0;
|
|
2482
|
+
A(q, X);
|
|
2467
2483
|
};
|
|
2468
2484
|
return Y.addEventListener("click", x), () => Y.removeEventListener("click", x);
|
|
2469
|
-
}, [
|
|
2485
|
+
}, [A, e]), /* @__PURE__ */ n(
|
|
2470
2486
|
"div",
|
|
2471
2487
|
{
|
|
2472
2488
|
ref: Q,
|
|
2473
|
-
className:
|
|
2489
|
+
className: k(
|
|
2474
2490
|
"messaging-channel-view h-full flex flex-col",
|
|
2475
2491
|
d
|
|
2476
2492
|
),
|
|
2477
|
-
children: /* @__PURE__ */ n(
|
|
2478
|
-
|
|
2493
|
+
children: /* @__PURE__ */ n(mn.Provider, { value: p ?? !1, children: /* @__PURE__ */ n(
|
|
2494
|
+
ls,
|
|
2479
2495
|
{
|
|
2480
2496
|
channel: e,
|
|
2481
|
-
MessageSystem:
|
|
2497
|
+
MessageSystem: qa,
|
|
2482
2498
|
EmptyStateIndicator: m,
|
|
2483
|
-
LoadingIndicator:
|
|
2484
|
-
DateSeparator:
|
|
2485
|
-
TypingIndicator:
|
|
2486
|
-
doSendMessageRequest:
|
|
2487
|
-
...
|
|
2488
|
-
...
|
|
2499
|
+
LoadingIndicator: Ae,
|
|
2500
|
+
DateSeparator: Hs,
|
|
2501
|
+
TypingIndicator: Xa,
|
|
2502
|
+
doSendMessageRequest: J,
|
|
2503
|
+
...y ? { SendButton: y } : {},
|
|
2504
|
+
...E ? { AttachmentPreviewList: E } : {},
|
|
2489
2505
|
children: /* @__PURE__ */ n(
|
|
2490
|
-
|
|
2506
|
+
er,
|
|
2491
2507
|
{
|
|
2492
2508
|
onBack: t,
|
|
2493
2509
|
showBackButton: s,
|
|
@@ -2501,22 +2517,22 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2501
2517
|
onDeleteConversationClick: u,
|
|
2502
2518
|
onBlockParticipantClick: f,
|
|
2503
2519
|
onReportParticipantClick: c,
|
|
2504
|
-
showBlockParticipant:
|
|
2505
|
-
showReportParticipant:
|
|
2506
|
-
composerDisabled:
|
|
2507
|
-
composerDisabledReason:
|
|
2508
|
-
showStarButton:
|
|
2509
|
-
dmAgentEnabled:
|
|
2510
|
-
chatbotVotingEnabled:
|
|
2511
|
-
renderChannelBanner:
|
|
2520
|
+
showBlockParticipant: w,
|
|
2521
|
+
showReportParticipant: b,
|
|
2522
|
+
composerDisabled: _,
|
|
2523
|
+
composerDisabledReason: v,
|
|
2524
|
+
showStarButton: R,
|
|
2525
|
+
dmAgentEnabled: p,
|
|
2526
|
+
chatbotVotingEnabled: T,
|
|
2527
|
+
renderChannelBanner: L,
|
|
2512
2528
|
renderHeaderTitleBadges: D,
|
|
2513
|
-
customChannelActions:
|
|
2514
|
-
renderChannelActions:
|
|
2515
|
-
renderMessage:
|
|
2516
|
-
viewerLanguage:
|
|
2529
|
+
customChannelActions: U,
|
|
2530
|
+
renderChannelActions: O,
|
|
2531
|
+
renderMessage: N,
|
|
2532
|
+
viewerLanguage: C,
|
|
2517
2533
|
showChannelInfo: $,
|
|
2518
|
-
onParticipantNameClick:
|
|
2519
|
-
composerInput:
|
|
2534
|
+
onParticipantNameClick: P,
|
|
2535
|
+
composerInput: j
|
|
2520
2536
|
}
|
|
2521
2537
|
)
|
|
2522
2538
|
}
|
|
@@ -2525,8 +2541,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2525
2541
|
);
|
|
2526
2542
|
}
|
|
2527
2543
|
);
|
|
2528
|
-
|
|
2529
|
-
const
|
|
2544
|
+
hn.displayName = "ChannelView";
|
|
2545
|
+
const ve = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
|
|
2530
2546
|
/* @__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: "⚠️" }) }),
|
|
2531
2547
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2532
2548
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2540,8 +2556,8 @@ const pe = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2540
2556
|
}
|
|
2541
2557
|
)
|
|
2542
2558
|
] }) }));
|
|
2543
|
-
|
|
2544
|
-
const
|
|
2559
|
+
ve.displayName = "ErrorState";
|
|
2560
|
+
const Ii = ({
|
|
2545
2561
|
capabilities: e = {},
|
|
2546
2562
|
renderMessageInputActions: t,
|
|
2547
2563
|
renderConversationFooter: s,
|
|
@@ -2556,78 +2572,78 @@ const Ei = ({
|
|
|
2556
2572
|
onMessageSent: u,
|
|
2557
2573
|
chatbotVotingEnabled: f = !1,
|
|
2558
2574
|
viewerLanguage: c,
|
|
2559
|
-
renderHeaderTitleBadges:
|
|
2560
|
-
renderChannelBanner:
|
|
2561
|
-
customChannelActions:
|
|
2562
|
-
renderChannelActions:
|
|
2563
|
-
onParticipantNameClick:
|
|
2564
|
-
renderMessage:
|
|
2575
|
+
renderHeaderTitleBadges: w,
|
|
2576
|
+
renderChannelBanner: b,
|
|
2577
|
+
customChannelActions: _,
|
|
2578
|
+
renderChannelActions: v,
|
|
2579
|
+
onParticipantNameClick: p,
|
|
2580
|
+
renderMessage: I,
|
|
2565
2581
|
onMessageLinkClick: M,
|
|
2566
|
-
showChannelInfo:
|
|
2567
|
-
composerInput:
|
|
2582
|
+
showChannelInfo: R,
|
|
2583
|
+
composerInput: T
|
|
2568
2584
|
}) => {
|
|
2569
2585
|
const {
|
|
2570
|
-
client:
|
|
2586
|
+
client: L,
|
|
2571
2587
|
isConnected: D,
|
|
2572
|
-
isLoading:
|
|
2573
|
-
error:
|
|
2574
|
-
refreshConnection:
|
|
2575
|
-
service:
|
|
2576
|
-
debug:
|
|
2577
|
-
} =
|
|
2588
|
+
isLoading: U,
|
|
2589
|
+
error: O,
|
|
2590
|
+
refreshConnection: N,
|
|
2591
|
+
service: A,
|
|
2592
|
+
debug: y
|
|
2593
|
+
} = $s(), [E, C] = z(null), [$, P] = z(null), [j, J] = z(!1), { showDeleteConversation: Q = !0 } = e, Y = H(l);
|
|
2578
2594
|
Y.current = l;
|
|
2579
|
-
const x =
|
|
2595
|
+
const x = H(a);
|
|
2580
2596
|
x.current = a;
|
|
2581
|
-
const
|
|
2597
|
+
const S = H(null), B = H(null);
|
|
2582
2598
|
K(() => {
|
|
2583
|
-
|
|
2584
|
-
}, [
|
|
2585
|
-
if (!
|
|
2586
|
-
const
|
|
2587
|
-
if (!
|
|
2588
|
-
const W = `${
|
|
2589
|
-
if (
|
|
2590
|
-
|
|
2599
|
+
B.current = E;
|
|
2600
|
+
}, [E]), K(() => {
|
|
2601
|
+
if (!L || !D) return;
|
|
2602
|
+
const F = L.userID;
|
|
2603
|
+
if (!F) return;
|
|
2604
|
+
const W = `${F}::${i}`;
|
|
2605
|
+
if (S.current === W) return;
|
|
2606
|
+
S.current = W;
|
|
2591
2607
|
const X = () => {
|
|
2592
|
-
|
|
2608
|
+
S.current === W && (S.current = null);
|
|
2593
2609
|
};
|
|
2594
2610
|
(async () => {
|
|
2595
2611
|
var me, he;
|
|
2596
2612
|
try {
|
|
2597
|
-
|
|
2613
|
+
y && console.log(
|
|
2598
2614
|
"[MessagingShell] Loading initial conversation with:",
|
|
2599
2615
|
i
|
|
2600
2616
|
);
|
|
2601
|
-
const
|
|
2617
|
+
const ee = await L.queryChannels(
|
|
2602
2618
|
{
|
|
2603
2619
|
type: "messaging",
|
|
2604
|
-
members: { $eq: [
|
|
2620
|
+
members: { $eq: [F, i] }
|
|
2605
2621
|
},
|
|
2606
2622
|
{},
|
|
2607
2623
|
{ limit: 1 }
|
|
2608
2624
|
);
|
|
2609
|
-
if (
|
|
2610
|
-
|
|
2625
|
+
if (ee.length > 0) {
|
|
2626
|
+
C(ee[0]), P(null), (me = x.current) == null || me.call(x, ee[0]), y && console.log(
|
|
2611
2627
|
"[MessagingShell] Initial conversation loaded:",
|
|
2612
|
-
|
|
2628
|
+
ee[0].id
|
|
2613
2629
|
);
|
|
2614
2630
|
return;
|
|
2615
2631
|
}
|
|
2616
2632
|
const te = Y.current;
|
|
2617
|
-
if (!te || !
|
|
2618
|
-
X(),
|
|
2633
|
+
if (!te || !A) {
|
|
2634
|
+
X(), P("No conversation found with this account"), y && console.log(
|
|
2619
2635
|
"[MessagingShell] No conversation found for:",
|
|
2620
2636
|
i
|
|
2621
2637
|
);
|
|
2622
2638
|
return;
|
|
2623
2639
|
}
|
|
2624
2640
|
try {
|
|
2625
|
-
const ie = await
|
|
2641
|
+
const ie = await A.startChannelWithParticipant({
|
|
2626
2642
|
id: te.id,
|
|
2627
2643
|
name: te.name,
|
|
2628
2644
|
phone: te.phone
|
|
2629
2645
|
});
|
|
2630
|
-
|
|
2646
|
+
C(ie), P(null), (he = x.current) == null || he.call(x, ie), y && console.log(
|
|
2631
2647
|
"[MessagingShell] Channel created and loaded:",
|
|
2632
2648
|
ie.id
|
|
2633
2649
|
);
|
|
@@ -2635,35 +2651,35 @@ const Ei = ({
|
|
|
2635
2651
|
console.error(
|
|
2636
2652
|
"[MessagingShell] Failed to create conversation:",
|
|
2637
2653
|
ie
|
|
2638
|
-
), X(),
|
|
2654
|
+
), X(), P("Failed to create conversation");
|
|
2639
2655
|
}
|
|
2640
|
-
} catch (
|
|
2656
|
+
} catch (ee) {
|
|
2641
2657
|
console.error(
|
|
2642
2658
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2643
|
-
|
|
2644
|
-
), X(),
|
|
2659
|
+
ee
|
|
2660
|
+
), X(), B.current || P("Failed to load conversation");
|
|
2645
2661
|
}
|
|
2646
2662
|
})();
|
|
2647
|
-
}, [i,
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
const q =
|
|
2651
|
-
var
|
|
2652
|
-
|
|
2663
|
+
}, [i, L, D, A, y]);
|
|
2664
|
+
const G = H(r);
|
|
2665
|
+
G.current = r;
|
|
2666
|
+
const q = Z(() => {
|
|
2667
|
+
var F;
|
|
2668
|
+
C(null), J(!0), (F = G.current) == null || F.call(G);
|
|
2653
2669
|
}, []);
|
|
2654
|
-
return
|
|
2655
|
-
|
|
2670
|
+
return U ? /* @__PURE__ */ n(Ae, {}) : O ? /* @__PURE__ */ n(ve, { message: O, onBack: N }) : !D || !L ? /* @__PURE__ */ n(
|
|
2671
|
+
ve,
|
|
2656
2672
|
{
|
|
2657
2673
|
message: "Not connected to messaging service",
|
|
2658
|
-
onBack:
|
|
2674
|
+
onBack: N
|
|
2659
2675
|
}
|
|
2660
|
-
) : $ ? /* @__PURE__ */ n(
|
|
2661
|
-
|
|
2676
|
+
) : $ ? /* @__PURE__ */ n(ve, { message: $ }) : j && !E ? /* @__PURE__ */ n(ve, { message: "Conversation ended" }) : E ? /* @__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(
|
|
2677
|
+
hn,
|
|
2662
2678
|
{
|
|
2663
|
-
channel:
|
|
2679
|
+
channel: E,
|
|
2664
2680
|
renderMessageInputActions: t,
|
|
2665
2681
|
renderConversationFooter: s,
|
|
2666
|
-
renderChannelBanner:
|
|
2682
|
+
renderChannelBanner: b,
|
|
2667
2683
|
onLeaveConversation: q,
|
|
2668
2684
|
onBlockParticipant: q,
|
|
2669
2685
|
CustomChannelEmptyState: o,
|
|
@@ -2674,43 +2690,43 @@ const Ei = ({
|
|
|
2674
2690
|
onMessageSent: u,
|
|
2675
2691
|
chatbotVotingEnabled: f,
|
|
2676
2692
|
viewerLanguage: c,
|
|
2677
|
-
renderHeaderTitleBadges:
|
|
2678
|
-
customChannelActions:
|
|
2679
|
-
renderChannelActions:
|
|
2680
|
-
onParticipantNameClick:
|
|
2681
|
-
renderMessage:
|
|
2693
|
+
renderHeaderTitleBadges: w,
|
|
2694
|
+
customChannelActions: _,
|
|
2695
|
+
renderChannelActions: v,
|
|
2696
|
+
onParticipantNameClick: p,
|
|
2697
|
+
renderMessage: I,
|
|
2682
2698
|
onMessageLinkClick: M,
|
|
2683
|
-
showChannelInfo:
|
|
2684
|
-
composerInput:
|
|
2699
|
+
showChannelInfo: R,
|
|
2700
|
+
composerInput: T
|
|
2685
2701
|
},
|
|
2686
|
-
|
|
2687
|
-
) }) }) : /* @__PURE__ */ n(
|
|
2702
|
+
E.id
|
|
2703
|
+
) }) }) : /* @__PURE__ */ n(Ae, {});
|
|
2688
2704
|
};
|
|
2689
|
-
function
|
|
2705
|
+
function tr(e) {
|
|
2690
2706
|
const t = e.state.pending_messages;
|
|
2691
2707
|
if (t != null && t.length)
|
|
2692
2708
|
for (const s of t)
|
|
2693
2709
|
e.state.addMessageSorted(s.message);
|
|
2694
2710
|
}
|
|
2695
|
-
const
|
|
2711
|
+
const fn = V.createContext({
|
|
2696
2712
|
selectedChannel: void 0,
|
|
2697
2713
|
onChannelSelect: () => {
|
|
2698
2714
|
},
|
|
2699
2715
|
debug: !1,
|
|
2700
2716
|
renderMessagePreview: void 0,
|
|
2701
2717
|
viewerLanguage: void 0
|
|
2702
|
-
}),
|
|
2718
|
+
}), nr = fn.Provider, sr = () => V.useContext(fn), ar = (e, t) => {
|
|
2703
2719
|
const s = new Date(
|
|
2704
2720
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2705
2721
|
), r = new Date(
|
|
2706
2722
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
2707
2723
|
).getTime() - s.getTime();
|
|
2708
2724
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2709
|
-
},
|
|
2725
|
+
}, rr = (e) => {
|
|
2710
2726
|
const t = /* @__PURE__ */ new Date();
|
|
2711
2727
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
2712
2728
|
return "Just now";
|
|
2713
|
-
const a =
|
|
2729
|
+
const a = ar(e, t);
|
|
2714
2730
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
2715
2731
|
hour: "numeric",
|
|
2716
2732
|
minute: "2-digit",
|
|
@@ -2720,50 +2736,50 @@ const hn = j.createContext({
|
|
|
2720
2736
|
day: "numeric",
|
|
2721
2737
|
year: "2-digit"
|
|
2722
2738
|
});
|
|
2723
|
-
},
|
|
2739
|
+
}, gn = V.memo(
|
|
2724
2740
|
({ channel: e, unread: t }) => {
|
|
2725
|
-
var
|
|
2741
|
+
var L, D, U, O;
|
|
2726
2742
|
const {
|
|
2727
2743
|
selectedChannel: s,
|
|
2728
2744
|
onChannelSelect: a,
|
|
2729
2745
|
debug: r,
|
|
2730
2746
|
renderMessagePreview: i,
|
|
2731
2747
|
viewerLanguage: l
|
|
2732
|
-
} =
|
|
2748
|
+
} = sr(), o = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2733
2749
|
e && a(e);
|
|
2734
|
-
}, m = (
|
|
2735
|
-
const
|
|
2736
|
-
!
|
|
2737
|
-
}, u = Object.values(((
|
|
2738
|
-
(
|
|
2739
|
-
var
|
|
2740
|
-
return ((
|
|
2750
|
+
}, m = (N) => {
|
|
2751
|
+
const A = N.key === "Enter" || N.key === " ", y = N.repeat;
|
|
2752
|
+
!A || y || (N.preventDefault(), d());
|
|
2753
|
+
}, u = Object.values(((L = e == null ? void 0 : e.state) == null ? void 0 : L.members) || {}).find(
|
|
2754
|
+
(N) => {
|
|
2755
|
+
var A, y;
|
|
2756
|
+
return ((A = N.user) == null ? void 0 : A.id) && N.user.id !== ((y = e == null ? void 0 : e._client) == null ? void 0 : y.userID);
|
|
2741
2757
|
}
|
|
2742
|
-
), f =
|
|
2743
|
-
var
|
|
2744
|
-
const
|
|
2745
|
-
if (
|
|
2746
|
-
for (let
|
|
2747
|
-
if (
|
|
2758
|
+
), f = Zt(u == null ? void 0 : u.user), c = (D = u == null ? void 0 : u.user) == null ? void 0 : D.image, w = ((U = u == null ? void 0 : u.user) == null ? void 0 : U.is_verified) === !0, b = (() => {
|
|
2759
|
+
var A;
|
|
2760
|
+
const N = (A = e == null ? void 0 : e.state) == null ? void 0 : A.messages;
|
|
2761
|
+
if (N != null && N.length) {
|
|
2762
|
+
for (let y = N.length - 1; y >= 0; y--)
|
|
2763
|
+
if (N[y].type !== "system") return N[y];
|
|
2748
2764
|
}
|
|
2749
2765
|
})(), v = (() => {
|
|
2750
|
-
var
|
|
2751
|
-
const
|
|
2766
|
+
var $, P, j, J;
|
|
2767
|
+
const N = Qt({
|
|
2752
2768
|
message: b,
|
|
2753
2769
|
viewerLanguage: l
|
|
2754
2770
|
});
|
|
2755
|
-
if (((
|
|
2756
|
-
if (((
|
|
2757
|
-
if (((
|
|
2758
|
-
if (
|
|
2759
|
-
const
|
|
2760
|
-
return
|
|
2761
|
-
})(), p = b != null && b.created_at ?
|
|
2771
|
+
if ((($ = b == null ? void 0 : b.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
|
|
2772
|
+
if (((P = b == null ? void 0 : b.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
|
|
2773
|
+
if (((j = b == null ? void 0 : b.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
|
|
2774
|
+
if (N) return N;
|
|
2775
|
+
const C = (J = b == null ? void 0 : b.attachments) == null ? void 0 : J[0];
|
|
2776
|
+
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2777
|
+
})(), p = b != null && b.created_at ? rr(new Date(b.created_at)) : "", I = b ? Te(b) : !1, M = i ? i(b, v) : `${I ? "✨ " : ""}${v}`, R = Jt(e), T = t ?? 0;
|
|
2762
2778
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2763
2779
|
channelId: e == null ? void 0 : e.id,
|
|
2764
2780
|
isSelected: o,
|
|
2765
2781
|
participantName: f,
|
|
2766
|
-
unreadCount:
|
|
2782
|
+
unreadCount: T,
|
|
2767
2783
|
hasTimestamp: !!p
|
|
2768
2784
|
}), /* @__PURE__ */ n(
|
|
2769
2785
|
"div",
|
|
@@ -2772,7 +2788,7 @@ const hn = j.createContext({
|
|
|
2772
2788
|
tabIndex: 0,
|
|
2773
2789
|
onClick: d,
|
|
2774
2790
|
onKeyDown: m,
|
|
2775
|
-
className:
|
|
2791
|
+
className: k(
|
|
2776
2792
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
2777
2793
|
{
|
|
2778
2794
|
"bg-black/[0.04]": o,
|
|
@@ -2783,32 +2799,25 @@ const hn = j.createContext({
|
|
|
2783
2799
|
/* @__PURE__ */ n(
|
|
2784
2800
|
oe,
|
|
2785
2801
|
{
|
|
2786
|
-
id: ((
|
|
2802
|
+
id: ((O = u == null ? void 0 : u.user) == null ? void 0 : O.id) || e.id || "unknown",
|
|
2787
2803
|
name: f,
|
|
2788
2804
|
image: c,
|
|
2789
2805
|
size: 48,
|
|
2790
|
-
starred:
|
|
2806
|
+
starred: R
|
|
2791
2807
|
}
|
|
2792
2808
|
),
|
|
2793
2809
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
2794
2810
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2795
|
-
/* @__PURE__ */ h(
|
|
2796
|
-
"
|
|
2797
|
-
{
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
),
|
|
2801
|
-
children: [
|
|
2802
|
-
M && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2803
|
-
f
|
|
2804
|
-
]
|
|
2805
|
-
}
|
|
2806
|
-
),
|
|
2811
|
+
/* @__PURE__ */ h("h3", { className: "flex min-w-0 items-center gap-1 text-sm font-medium text-[#191918]", children: [
|
|
2812
|
+
R && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2813
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: f }),
|
|
2814
|
+
w && /* @__PURE__ */ n(pe, {})
|
|
2815
|
+
] }),
|
|
2807
2816
|
p && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: p })
|
|
2808
2817
|
] }),
|
|
2809
2818
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2810
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2811
|
-
|
|
2819
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
|
|
2820
|
+
T > 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: T > 99 ? "99+" : T })
|
|
2812
2821
|
] })
|
|
2813
2822
|
] })
|
|
2814
2823
|
] })
|
|
@@ -2816,27 +2825,27 @@ const hn = j.createContext({
|
|
|
2816
2825
|
);
|
|
2817
2826
|
}
|
|
2818
2827
|
);
|
|
2819
|
-
|
|
2820
|
-
const
|
|
2828
|
+
gn.displayName = "CustomChannelPreview";
|
|
2829
|
+
const ir = { last_message_at: -1 }, or = V.memo(
|
|
2821
2830
|
({
|
|
2822
2831
|
onChannelSelect: e,
|
|
2823
2832
|
selectedChannel: t,
|
|
2824
2833
|
filters: s,
|
|
2825
2834
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2826
2835
|
channelRenderFilterFn: r,
|
|
2827
|
-
sort: i =
|
|
2836
|
+
sort: i = ir,
|
|
2828
2837
|
className: l,
|
|
2829
2838
|
customEmptyStateIndicator: o,
|
|
2830
2839
|
renderMessagePreview: d,
|
|
2831
2840
|
viewerLanguage: m
|
|
2832
2841
|
}) => {
|
|
2833
|
-
const g =
|
|
2842
|
+
const g = V.useRef(0);
|
|
2834
2843
|
g.current++;
|
|
2835
|
-
const { debug: u = !1 } =
|
|
2836
|
-
(
|
|
2837
|
-
for (const
|
|
2838
|
-
|
|
2839
|
-
return r ? r(
|
|
2844
|
+
const { debug: u = !1 } = Je(), f = V.useCallback(
|
|
2845
|
+
(w) => {
|
|
2846
|
+
for (const b of w)
|
|
2847
|
+
tr(b);
|
|
2848
|
+
return r ? r(w) : w;
|
|
2840
2849
|
},
|
|
2841
2850
|
[r]
|
|
2842
2851
|
);
|
|
@@ -2845,7 +2854,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2845
2854
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2846
2855
|
filters: s
|
|
2847
2856
|
});
|
|
2848
|
-
const c =
|
|
2857
|
+
const c = V.useMemo(
|
|
2849
2858
|
() => ({
|
|
2850
2859
|
selectedChannel: t,
|
|
2851
2860
|
onChannelSelect: e,
|
|
@@ -2864,20 +2873,20 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2864
2873
|
return /* @__PURE__ */ n(
|
|
2865
2874
|
"div",
|
|
2866
2875
|
{
|
|
2867
|
-
className:
|
|
2876
|
+
className: k(
|
|
2868
2877
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2869
2878
|
l
|
|
2870
2879
|
),
|
|
2871
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
2872
|
-
|
|
2880
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(nr, { value: c, children: /* @__PURE__ */ n(
|
|
2881
|
+
ms,
|
|
2873
2882
|
{
|
|
2874
2883
|
filters: s,
|
|
2875
2884
|
sort: i,
|
|
2876
2885
|
options: { limit: 30 },
|
|
2877
2886
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2878
2887
|
channelRenderFilterFn: f,
|
|
2879
|
-
Paginator:
|
|
2880
|
-
Preview:
|
|
2888
|
+
Paginator: hs,
|
|
2889
|
+
Preview: gn,
|
|
2881
2890
|
EmptyStateIndicator: o
|
|
2882
2891
|
},
|
|
2883
2892
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
@@ -2886,27 +2895,27 @@ const ar = { last_message_at: -1 }, rr = j.memo(
|
|
|
2886
2895
|
);
|
|
2887
2896
|
}
|
|
2888
2897
|
);
|
|
2889
|
-
|
|
2890
|
-
const
|
|
2891
|
-
function
|
|
2898
|
+
or.displayName = "ChannelList";
|
|
2899
|
+
const lr = /^([a-z][a-z0-9+.-]*):/i, cr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2900
|
+
function at(e) {
|
|
2892
2901
|
if (typeof e != "string") return;
|
|
2893
2902
|
const t = e.trim();
|
|
2894
2903
|
if (t === "") return;
|
|
2895
|
-
const s =
|
|
2904
|
+
const s = lr.exec(t);
|
|
2896
2905
|
if (s) {
|
|
2897
2906
|
const a = s[1].toLowerCase();
|
|
2898
|
-
return
|
|
2907
|
+
return cr.has(a) ? t : void 0;
|
|
2899
2908
|
}
|
|
2900
2909
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2901
2910
|
}
|
|
2902
|
-
const
|
|
2911
|
+
const dr = {
|
|
2903
2912
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2904
2913
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2905
|
-
},
|
|
2906
|
-
const s =
|
|
2914
|
+
}, ur = ({ variant: e, cta: t }) => {
|
|
2915
|
+
const s = k(
|
|
2907
2916
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2908
|
-
|
|
2909
|
-
), a =
|
|
2917
|
+
dr[e]
|
|
2918
|
+
), a = at(t.href);
|
|
2910
2919
|
return a ? /* @__PURE__ */ n(
|
|
2911
2920
|
"a",
|
|
2912
2921
|
{
|
|
@@ -2932,13 +2941,13 @@ const lr = {
|
|
|
2932
2941
|
children: t.label
|
|
2933
2942
|
}
|
|
2934
2943
|
);
|
|
2935
|
-
},
|
|
2944
|
+
}, mr = {
|
|
2936
2945
|
dark: "text-white",
|
|
2937
2946
|
light: "text-black/90"
|
|
2938
|
-
},
|
|
2947
|
+
}, hr = "text-white/30", fr = {
|
|
2939
2948
|
dark: "text-white/55",
|
|
2940
2949
|
light: "text-black/55"
|
|
2941
|
-
},
|
|
2950
|
+
}, rt = ({
|
|
2942
2951
|
variant: e,
|
|
2943
2952
|
title: t,
|
|
2944
2953
|
placeholderTitle: s,
|
|
@@ -2948,14 +2957,14 @@ const lr = {
|
|
|
2948
2957
|
cta: l,
|
|
2949
2958
|
trailingAction: o
|
|
2950
2959
|
}) => {
|
|
2951
|
-
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "",
|
|
2952
|
-
if (!g && !u && !c && !
|
|
2953
|
-
const
|
|
2960
|
+
const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", w = l != null;
|
|
2961
|
+
if (!g && !u && !c && !w) return null;
|
|
2962
|
+
const _ = k(
|
|
2954
2963
|
"truncate text-base font-medium leading-6",
|
|
2955
|
-
d && !t ?
|
|
2956
|
-
),
|
|
2964
|
+
d && !t ? hr : mr[e]
|
|
2965
|
+
), v = k(
|
|
2957
2966
|
"truncate text-xs leading-4",
|
|
2958
|
-
|
|
2967
|
+
fr[e]
|
|
2959
2968
|
);
|
|
2960
2969
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
2961
2970
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2963,24 +2972,24 @@ const lr = {
|
|
|
2963
2972
|
/* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2964
2973
|
g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2965
2974
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2966
|
-
/* @__PURE__ */ n("p", { className:
|
|
2975
|
+
/* @__PURE__ */ n("p", { className: k("min-w-0", _), children: m })
|
|
2967
2976
|
] }),
|
|
2968
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2977
|
+
u && /* @__PURE__ */ n("p", { className: v, children: a })
|
|
2969
2978
|
] }),
|
|
2970
|
-
!
|
|
2979
|
+
!w && c && /* @__PURE__ */ n("p", { className: v, children: f })
|
|
2971
2980
|
] }),
|
|
2972
2981
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
2973
2982
|
] }),
|
|
2974
|
-
l && /* @__PURE__ */ n(
|
|
2983
|
+
l && /* @__PURE__ */ n(ur, { variant: e, cta: l })
|
|
2975
2984
|
] });
|
|
2976
|
-
},
|
|
2985
|
+
}, gr = k(
|
|
2977
2986
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2978
2987
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2979
2988
|
// the messaging design system's "small border around link attachments"
|
|
2980
2989
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2981
2990
|
"border border-black/[0.08]",
|
|
2982
2991
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2983
|
-
),
|
|
2992
|
+
), Me = ({
|
|
2984
2993
|
variant: e,
|
|
2985
2994
|
children: t,
|
|
2986
2995
|
href: s,
|
|
@@ -2991,8 +3000,8 @@ const lr = {
|
|
|
2991
3000
|
bgClassName: o,
|
|
2992
3001
|
"data-testid": d
|
|
2993
3002
|
}) => {
|
|
2994
|
-
const m = s != null || a != null, g =
|
|
2995
|
-
|
|
3003
|
+
const m = s != null || a != null, g = k(
|
|
3004
|
+
gr,
|
|
2996
3005
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2997
3006
|
// `focus-ring` is a design-system utility from the component-library
|
|
2998
3007
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -3022,7 +3031,7 @@ const lr = {
|
|
|
3022
3031
|
onClick: a,
|
|
3023
3032
|
"aria-label": r,
|
|
3024
3033
|
"data-testid": d,
|
|
3025
|
-
className:
|
|
3034
|
+
className: k(g, "text-left"),
|
|
3026
3035
|
children: [
|
|
3027
3036
|
t,
|
|
3028
3037
|
u
|
|
@@ -3040,17 +3049,17 @@ const lr = {
|
|
|
3040
3049
|
]
|
|
3041
3050
|
}
|
|
3042
3051
|
);
|
|
3043
|
-
},
|
|
3052
|
+
}, br = {
|
|
3044
3053
|
dark: "bg-white/10",
|
|
3045
3054
|
light: "bg-black/5"
|
|
3046
|
-
},
|
|
3055
|
+
}, pr = {
|
|
3047
3056
|
dark: "size-16 text-white/25",
|
|
3048
3057
|
light: "size-16 text-black/25"
|
|
3049
|
-
},
|
|
3058
|
+
}, De = (e, t) => !!t && !!e && re(e) === "audio", bn = (e, t) => {
|
|
3050
3059
|
if (!t || !e) return !1;
|
|
3051
3060
|
const s = re(e);
|
|
3052
3061
|
return s === "video" || s === "audio";
|
|
3053
|
-
},
|
|
3062
|
+
}, it = "bg-[#F2F3F4]", Re = ({
|
|
3054
3063
|
variant: e,
|
|
3055
3064
|
thumbnailUrl: t,
|
|
3056
3065
|
sourceUrl: s,
|
|
@@ -3060,7 +3069,7 @@ const lr = {
|
|
|
3060
3069
|
topRight: l
|
|
3061
3070
|
}) => {
|
|
3062
3071
|
const o = re(r), d = !!s && o === "video";
|
|
3063
|
-
return
|
|
3072
|
+
return De(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
3064
3073
|
"audio",
|
|
3065
3074
|
{
|
|
3066
3075
|
src: s,
|
|
@@ -3072,7 +3081,7 @@ const lr = {
|
|
|
3072
3081
|
) }) : /* @__PURE__ */ h(
|
|
3073
3082
|
"div",
|
|
3074
3083
|
{
|
|
3075
|
-
className:
|
|
3084
|
+
className: k(
|
|
3076
3085
|
"relative h-[180px] w-full overflow-hidden",
|
|
3077
3086
|
d && "bg-black"
|
|
3078
3087
|
),
|
|
@@ -3099,12 +3108,12 @@ const lr = {
|
|
|
3099
3108
|
) : /* @__PURE__ */ n(
|
|
3100
3109
|
"div",
|
|
3101
3110
|
{
|
|
3102
|
-
className:
|
|
3111
|
+
className: k(
|
|
3103
3112
|
"flex h-full w-full items-center justify-center",
|
|
3104
|
-
|
|
3113
|
+
br[e]
|
|
3105
3114
|
),
|
|
3106
3115
|
children: ce(r, {
|
|
3107
|
-
className:
|
|
3116
|
+
className: pr[e],
|
|
3108
3117
|
weight: "regular"
|
|
3109
3118
|
})
|
|
3110
3119
|
}
|
|
@@ -3114,7 +3123,7 @@ const lr = {
|
|
|
3114
3123
|
]
|
|
3115
3124
|
}
|
|
3116
3125
|
);
|
|
3117
|
-
},
|
|
3126
|
+
}, vr = ({
|
|
3118
3127
|
title: e,
|
|
3119
3128
|
placeholderTitle: t,
|
|
3120
3129
|
description: s,
|
|
@@ -3128,28 +3137,28 @@ const lr = {
|
|
|
3128
3137
|
onDismiss: g,
|
|
3129
3138
|
onEditClick: u
|
|
3130
3139
|
}) => {
|
|
3131
|
-
const f = o === "classic", c =
|
|
3140
|
+
const f = o === "classic", c = De(r, l), w = g ? /* @__PURE__ */ n(
|
|
3132
3141
|
"button",
|
|
3133
3142
|
{
|
|
3134
3143
|
type: "button",
|
|
3135
3144
|
onClick: g,
|
|
3136
3145
|
"aria-label": "Dismiss attachment",
|
|
3137
3146
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3138
|
-
children: /* @__PURE__ */ n(
|
|
3147
|
+
children: /* @__PURE__ */ n(Le, { className: "size-3", weight: "bold" })
|
|
3139
3148
|
}
|
|
3140
|
-
) : void 0,
|
|
3149
|
+
) : void 0, b = u ? /* @__PURE__ */ n(
|
|
3141
3150
|
"button",
|
|
3142
3151
|
{
|
|
3143
3152
|
type: "button",
|
|
3144
3153
|
onClick: u,
|
|
3145
3154
|
"aria-label": "Edit attachment",
|
|
3146
3155
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3147
|
-
children: /* @__PURE__ */ n(
|
|
3156
|
+
children: /* @__PURE__ */ n(Ps, { className: "size-5", weight: "regular" })
|
|
3148
3157
|
}
|
|
3149
3158
|
) : void 0;
|
|
3150
|
-
return c ? /* @__PURE__ */ n(
|
|
3159
|
+
return c ? /* @__PURE__ */ n(Me, { variant: "dark", bgClassName: it, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3151
3160
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3152
|
-
|
|
3161
|
+
Re,
|
|
3153
3162
|
{
|
|
3154
3163
|
variant: "dark",
|
|
3155
3164
|
sourceUrl: l,
|
|
@@ -3157,26 +3166,26 @@ const lr = {
|
|
|
3157
3166
|
mimeType: r
|
|
3158
3167
|
}
|
|
3159
3168
|
) }),
|
|
3160
|
-
|
|
3169
|
+
w && /* @__PURE__ */ n("div", { className: "shrink-0", children: w })
|
|
3161
3170
|
] }) }) : /* @__PURE__ */ h(
|
|
3162
|
-
|
|
3171
|
+
Me,
|
|
3163
3172
|
{
|
|
3164
3173
|
variant: "dark",
|
|
3165
|
-
topRight: f ?
|
|
3174
|
+
topRight: f ? w : void 0,
|
|
3166
3175
|
children: [
|
|
3167
3176
|
!f && /* @__PURE__ */ n(
|
|
3168
|
-
|
|
3177
|
+
Re,
|
|
3169
3178
|
{
|
|
3170
3179
|
variant: "dark",
|
|
3171
3180
|
thumbnailUrl: i,
|
|
3172
3181
|
sourceUrl: l,
|
|
3173
3182
|
title: e,
|
|
3174
3183
|
mimeType: r,
|
|
3175
|
-
topRight:
|
|
3184
|
+
topRight: w
|
|
3176
3185
|
}
|
|
3177
3186
|
),
|
|
3178
3187
|
/* @__PURE__ */ n(
|
|
3179
|
-
|
|
3188
|
+
rt,
|
|
3180
3189
|
{
|
|
3181
3190
|
variant: "dark",
|
|
3182
3191
|
title: e,
|
|
@@ -3185,13 +3194,13 @@ const lr = {
|
|
|
3185
3194
|
url: a,
|
|
3186
3195
|
appIcon: d,
|
|
3187
3196
|
cta: m,
|
|
3188
|
-
trailingAction:
|
|
3197
|
+
trailingAction: b
|
|
3189
3198
|
}
|
|
3190
3199
|
)
|
|
3191
3200
|
]
|
|
3192
3201
|
}
|
|
3193
3202
|
);
|
|
3194
|
-
},
|
|
3203
|
+
}, xr = ({
|
|
3195
3204
|
title: e,
|
|
3196
3205
|
description: t,
|
|
3197
3206
|
url: s,
|
|
@@ -3203,25 +3212,25 @@ const lr = {
|
|
|
3203
3212
|
cta: d,
|
|
3204
3213
|
onClick: m
|
|
3205
3214
|
}) => {
|
|
3206
|
-
const g =
|
|
3215
|
+
const g = bn(a, i), u = at(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, w = De(a, i) ? it : void 0, b = d && m ? {
|
|
3207
3216
|
...d,
|
|
3208
3217
|
onClick: () => {
|
|
3209
|
-
var
|
|
3210
|
-
m(), (
|
|
3218
|
+
var _;
|
|
3219
|
+
m(), (_ = d.onClick) == null || _.call(d);
|
|
3211
3220
|
}
|
|
3212
3221
|
} : d;
|
|
3213
3222
|
return /* @__PURE__ */ h(
|
|
3214
|
-
|
|
3223
|
+
Me,
|
|
3215
3224
|
{
|
|
3216
3225
|
variant: "light",
|
|
3217
3226
|
href: f,
|
|
3218
3227
|
onClick: c,
|
|
3219
3228
|
ariaLabel: e ?? "Open attachment preview",
|
|
3220
|
-
bgClassName:
|
|
3229
|
+
bgClassName: w,
|
|
3221
3230
|
"data-testid": "link-attachment",
|
|
3222
3231
|
children: [
|
|
3223
3232
|
l === "featured" && /* @__PURE__ */ n(
|
|
3224
|
-
|
|
3233
|
+
Re,
|
|
3225
3234
|
{
|
|
3226
3235
|
variant: "light",
|
|
3227
3236
|
thumbnailUrl: r,
|
|
@@ -3231,20 +3240,20 @@ const lr = {
|
|
|
3231
3240
|
}
|
|
3232
3241
|
),
|
|
3233
3242
|
/* @__PURE__ */ n(
|
|
3234
|
-
|
|
3243
|
+
rt,
|
|
3235
3244
|
{
|
|
3236
3245
|
variant: "light",
|
|
3237
3246
|
title: e,
|
|
3238
3247
|
description: t,
|
|
3239
3248
|
url: s,
|
|
3240
3249
|
appIcon: o,
|
|
3241
|
-
cta:
|
|
3250
|
+
cta: b
|
|
3242
3251
|
}
|
|
3243
3252
|
)
|
|
3244
3253
|
]
|
|
3245
3254
|
}
|
|
3246
3255
|
);
|
|
3247
|
-
},
|
|
3256
|
+
}, wr = ({
|
|
3248
3257
|
title: e,
|
|
3249
3258
|
placeholderTitle: t,
|
|
3250
3259
|
description: s,
|
|
@@ -3257,17 +3266,17 @@ const lr = {
|
|
|
3257
3266
|
cta: m,
|
|
3258
3267
|
onClick: g
|
|
3259
3268
|
}) => {
|
|
3260
|
-
const u =
|
|
3269
|
+
const u = bn(r, l), f = at(a), c = m == null && f != null && !u ? f : void 0, w = m == null && !u && c != null ? g : void 0;
|
|
3261
3270
|
return /* @__PURE__ */ h(
|
|
3262
|
-
|
|
3271
|
+
Me,
|
|
3263
3272
|
{
|
|
3264
3273
|
variant: "dark",
|
|
3265
3274
|
href: c,
|
|
3266
|
-
onClick:
|
|
3267
|
-
bgClassName:
|
|
3275
|
+
onClick: w,
|
|
3276
|
+
bgClassName: De(r, l) ? it : void 0,
|
|
3268
3277
|
children: [
|
|
3269
3278
|
o === "featured" && /* @__PURE__ */ n(
|
|
3270
|
-
|
|
3279
|
+
Re,
|
|
3271
3280
|
{
|
|
3272
3281
|
variant: "dark",
|
|
3273
3282
|
thumbnailUrl: i,
|
|
@@ -3277,7 +3286,7 @@ const lr = {
|
|
|
3277
3286
|
}
|
|
3278
3287
|
),
|
|
3279
3288
|
/* @__PURE__ */ n(
|
|
3280
|
-
|
|
3289
|
+
rt,
|
|
3281
3290
|
{
|
|
3282
3291
|
variant: "dark",
|
|
3283
3292
|
title: e,
|
|
@@ -3291,20 +3300,20 @@ const lr = {
|
|
|
3291
3300
|
]
|
|
3292
3301
|
}
|
|
3293
3302
|
);
|
|
3294
|
-
},
|
|
3295
|
-
Composer:
|
|
3296
|
-
Sent:
|
|
3297
|
-
Received:
|
|
3298
|
-
},
|
|
3303
|
+
}, Ti = {
|
|
3304
|
+
Composer: vr,
|
|
3305
|
+
Sent: wr,
|
|
3306
|
+
Received: xr
|
|
3307
|
+
}, _r = {
|
|
3299
3308
|
dark: "bg-[#121110]",
|
|
3300
3309
|
light: "bg-[#e9eaed]"
|
|
3301
|
-
},
|
|
3310
|
+
}, Nr = {
|
|
3302
3311
|
dark: "text-white",
|
|
3303
3312
|
light: "text-[#080707]"
|
|
3304
|
-
},
|
|
3313
|
+
}, yr = {
|
|
3305
3314
|
dark: "border-white/[0.08]",
|
|
3306
3315
|
light: "border-black/[0.08]"
|
|
3307
|
-
},
|
|
3316
|
+
}, Cr = (e) => e === "dark" ? "sender" : "receiver", kr = {
|
|
3308
3317
|
sender: {
|
|
3309
3318
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3310
3319
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3317,7 +3326,7 @@ const lr = {
|
|
|
3317
3326
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3318
3327
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3319
3328
|
}
|
|
3320
|
-
},
|
|
3329
|
+
}, ye = ({
|
|
3321
3330
|
variant: e,
|
|
3322
3331
|
text: t,
|
|
3323
3332
|
bordered: s = !0,
|
|
@@ -3326,13 +3335,13 @@ const lr = {
|
|
|
3326
3335
|
children: i,
|
|
3327
3336
|
"data-testid": l
|
|
3328
3337
|
}) => {
|
|
3329
|
-
const o = t != null && t !== "", d =
|
|
3338
|
+
const o = t != null && t !== "", d = kr[Cr(e)][a];
|
|
3330
3339
|
return /* @__PURE__ */ h(
|
|
3331
3340
|
"div",
|
|
3332
3341
|
{
|
|
3333
3342
|
"data-testid": l,
|
|
3334
3343
|
"data-group-position": a,
|
|
3335
|
-
className:
|
|
3344
|
+
className: k(
|
|
3336
3345
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
3337
3346
|
// and keeps the document / image / audio bubbles visually
|
|
3338
3347
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -3341,10 +3350,10 @@ const lr = {
|
|
|
3341
3350
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3342
3351
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3343
3352
|
d,
|
|
3344
|
-
|
|
3345
|
-
|
|
3353
|
+
_r[e],
|
|
3354
|
+
Nr[e],
|
|
3346
3355
|
s && "border",
|
|
3347
|
-
s &&
|
|
3356
|
+
s && yr[e],
|
|
3348
3357
|
r
|
|
3349
3358
|
),
|
|
3350
3359
|
children: [
|
|
@@ -3352,7 +3361,7 @@ const lr = {
|
|
|
3352
3361
|
o ? /* @__PURE__ */ n(
|
|
3353
3362
|
"p",
|
|
3354
3363
|
{
|
|
3355
|
-
className:
|
|
3364
|
+
className: k(
|
|
3356
3365
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
3357
3366
|
// the same font family + size as `.str-chat__message-text`
|
|
3358
3367
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -3369,7 +3378,7 @@ const lr = {
|
|
|
3369
3378
|
]
|
|
3370
3379
|
}
|
|
3371
3380
|
);
|
|
3372
|
-
},
|
|
3381
|
+
}, Ce = ({
|
|
3373
3382
|
onClick: e,
|
|
3374
3383
|
variant: t = "overlay",
|
|
3375
3384
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3381,22 +3390,22 @@ const lr = {
|
|
|
3381
3390
|
a.stopPropagation(), e();
|
|
3382
3391
|
},
|
|
3383
3392
|
"aria-label": s,
|
|
3384
|
-
className:
|
|
3393
|
+
className: k(
|
|
3385
3394
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3386
3395
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3387
3396
|
),
|
|
3388
|
-
children: /* @__PURE__ */ n(
|
|
3397
|
+
children: /* @__PURE__ */ n(Le, { className: "size-3", weight: "bold" })
|
|
3389
3398
|
}
|
|
3390
|
-
),
|
|
3399
|
+
), ke = (e) => e === "received" ? "light" : "dark", Ai = ({
|
|
3391
3400
|
firstOfGroup: e,
|
|
3392
3401
|
endOfGroup: t,
|
|
3393
3402
|
groupedByUser: s
|
|
3394
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3403
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Er = ({
|
|
3395
3404
|
src: e,
|
|
3396
3405
|
mimeType: t,
|
|
3397
3406
|
filename: s,
|
|
3398
3407
|
items: a
|
|
3399
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3408
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Sr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3400
3409
|
/* @__PURE__ */ n(
|
|
3401
3410
|
"audio",
|
|
3402
3411
|
{
|
|
@@ -3408,7 +3417,7 @@ const lr = {
|
|
|
3408
3417
|
}
|
|
3409
3418
|
),
|
|
3410
3419
|
s ?? null
|
|
3411
|
-
] }),
|
|
3420
|
+
] }), ot = ({
|
|
3412
3421
|
state: e,
|
|
3413
3422
|
src: t,
|
|
3414
3423
|
mimeType: s,
|
|
@@ -3419,41 +3428,41 @@ const lr = {
|
|
|
3419
3428
|
preload: o,
|
|
3420
3429
|
onDismiss: d
|
|
3421
3430
|
}) => {
|
|
3422
|
-
const m =
|
|
3431
|
+
const m = ke(e), g = e === "composer" && !!d, u = Er({ src: t, mimeType: s, filename: a, items: r });
|
|
3423
3432
|
if (u.length === 0)
|
|
3424
3433
|
return null;
|
|
3425
3434
|
const f = o ?? (u.length > 1 ? "none" : "metadata");
|
|
3426
3435
|
return /* @__PURE__ */ n(
|
|
3427
|
-
|
|
3436
|
+
ye,
|
|
3428
3437
|
{
|
|
3429
3438
|
variant: m,
|
|
3430
3439
|
text: i,
|
|
3431
3440
|
groupPosition: l,
|
|
3432
3441
|
"data-testid": "audio-attachment",
|
|
3433
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c,
|
|
3434
|
-
|
|
3442
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, w) => /* @__PURE__ */ n(
|
|
3443
|
+
Sr,
|
|
3435
3444
|
{
|
|
3436
3445
|
item: c,
|
|
3437
3446
|
preload: f,
|
|
3438
3447
|
trailingAction: (
|
|
3439
3448
|
// Composer only supports a single attachment, so the
|
|
3440
3449
|
// dismiss control sits on the only player.
|
|
3441
|
-
g &&
|
|
3450
|
+
g && w === 0 ? /* @__PURE__ */ n(Ce, { onClick: d, variant: "inline" }) : void 0
|
|
3442
3451
|
)
|
|
3443
3452
|
},
|
|
3444
|
-
`${c.src}-${
|
|
3453
|
+
`${c.src}-${w}`
|
|
3445
3454
|
)) })
|
|
3446
3455
|
}
|
|
3447
3456
|
);
|
|
3448
|
-
},
|
|
3449
|
-
Composer:
|
|
3450
|
-
Sent:
|
|
3451
|
-
Received:
|
|
3457
|
+
}, Ir = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), Tr = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), Ar = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), Mr = {
|
|
3458
|
+
Composer: Ir,
|
|
3459
|
+
Sent: Tr,
|
|
3460
|
+
Received: Ar
|
|
3452
3461
|
};
|
|
3453
|
-
function
|
|
3462
|
+
function Rr(e) {
|
|
3454
3463
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
|
|
3455
3464
|
}
|
|
3456
|
-
const
|
|
3465
|
+
const Lr = {
|
|
3457
3466
|
pdf: "PDF",
|
|
3458
3467
|
doc: "DOC",
|
|
3459
3468
|
xls: "XLS",
|
|
@@ -3463,7 +3472,7 @@ const Mr = {
|
|
|
3463
3472
|
text: "TXT",
|
|
3464
3473
|
markdown: "MD"
|
|
3465
3474
|
};
|
|
3466
|
-
function
|
|
3475
|
+
function Dr(e, t) {
|
|
3467
3476
|
if (t) {
|
|
3468
3477
|
const r = t.lastIndexOf(".");
|
|
3469
3478
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3473,7 +3482,7 @@ function Rr(e, t) {
|
|
|
3473
3482
|
}
|
|
3474
3483
|
if (!e) return;
|
|
3475
3484
|
if (re(e) === "document") {
|
|
3476
|
-
const r =
|
|
3485
|
+
const r = nn(e), i = Lr[r];
|
|
3477
3486
|
if (i) return i;
|
|
3478
3487
|
if (e === "application/octet-stream") return;
|
|
3479
3488
|
}
|
|
@@ -3481,8 +3490,8 @@ function Rr(e, t) {
|
|
|
3481
3490
|
if (!(!a || a === "*"))
|
|
3482
3491
|
return a.toUpperCase();
|
|
3483
3492
|
}
|
|
3484
|
-
function
|
|
3485
|
-
const a =
|
|
3493
|
+
function Pr(e, t, s) {
|
|
3494
|
+
const a = Dr(e, t), r = typeof s == "number" && s > 0 ? Rr(s) : void 0;
|
|
3486
3495
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3487
3496
|
}
|
|
3488
3497
|
function ne(e) {
|
|
@@ -3493,16 +3502,16 @@ function ne(e) {
|
|
|
3493
3502
|
return "download";
|
|
3494
3503
|
}
|
|
3495
3504
|
}
|
|
3496
|
-
const
|
|
3505
|
+
const Or = {
|
|
3497
3506
|
dark: "text-white/55",
|
|
3498
3507
|
light: "text-black/65"
|
|
3499
|
-
},
|
|
3508
|
+
}, zr = {
|
|
3500
3509
|
dark: "bg-white/10",
|
|
3501
3510
|
light: "bg-black/5"
|
|
3502
|
-
},
|
|
3511
|
+
}, $r = {
|
|
3503
3512
|
dark: "text-white/85",
|
|
3504
3513
|
light: "text-black/85"
|
|
3505
|
-
},
|
|
3514
|
+
}, pn = ({
|
|
3506
3515
|
variant: e,
|
|
3507
3516
|
filename: t,
|
|
3508
3517
|
title: s,
|
|
@@ -3512,16 +3521,16 @@ const Dr = {
|
|
|
3512
3521
|
activateLabel: l,
|
|
3513
3522
|
trailingAction: o
|
|
3514
3523
|
}) => {
|
|
3515
|
-
const d = s ?? t ?? "File", m =
|
|
3524
|
+
const d = s ?? t ?? "File", m = Pr(a, t, r), g = /* @__PURE__ */ n(
|
|
3516
3525
|
"div",
|
|
3517
3526
|
{
|
|
3518
|
-
className:
|
|
3527
|
+
className: k(
|
|
3519
3528
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3520
|
-
|
|
3529
|
+
zr[e]
|
|
3521
3530
|
),
|
|
3522
3531
|
"aria-hidden": !0,
|
|
3523
3532
|
children: ce(a, {
|
|
3524
|
-
className:
|
|
3533
|
+
className: k("size-6", $r[e]),
|
|
3525
3534
|
weight: "regular"
|
|
3526
3535
|
})
|
|
3527
3536
|
}
|
|
@@ -3530,9 +3539,9 @@ const Dr = {
|
|
|
3530
3539
|
m ? /* @__PURE__ */ n(
|
|
3531
3540
|
"p",
|
|
3532
3541
|
{
|
|
3533
|
-
className:
|
|
3542
|
+
className: k(
|
|
3534
3543
|
"truncate text-xs leading-4",
|
|
3535
|
-
|
|
3544
|
+
Or[e]
|
|
3536
3545
|
),
|
|
3537
3546
|
children: m
|
|
3538
3547
|
}
|
|
@@ -3543,7 +3552,7 @@ const Dr = {
|
|
|
3543
3552
|
type: "button",
|
|
3544
3553
|
onClick: i,
|
|
3545
3554
|
"aria-label": l,
|
|
3546
|
-
className:
|
|
3555
|
+
className: k(
|
|
3547
3556
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
3548
3557
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
3549
3558
|
),
|
|
@@ -3561,7 +3570,7 @@ const Dr = {
|
|
|
3561
3570
|
o ? /* @__PURE__ */ n("div", { className: "shrink-0", children: o }) : null
|
|
3562
3571
|
] });
|
|
3563
3572
|
};
|
|
3564
|
-
async function
|
|
3573
|
+
async function vn(e, t) {
|
|
3565
3574
|
const s = t ?? ne(e);
|
|
3566
3575
|
try {
|
|
3567
3576
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -3575,14 +3584,14 @@ async function pn(e, t) {
|
|
|
3575
3584
|
}
|
|
3576
3585
|
}
|
|
3577
3586
|
}
|
|
3578
|
-
const
|
|
3587
|
+
const Fr = ({
|
|
3579
3588
|
src: e,
|
|
3580
3589
|
filename: t,
|
|
3581
3590
|
fileSize: s,
|
|
3582
3591
|
mimeType: a,
|
|
3583
3592
|
title: r,
|
|
3584
3593
|
items: i
|
|
3585
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3594
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Br = ({
|
|
3586
3595
|
variant: e,
|
|
3587
3596
|
item: t,
|
|
3588
3597
|
index: s,
|
|
@@ -3591,7 +3600,7 @@ const zr = ({
|
|
|
3591
3600
|
}) => {
|
|
3592
3601
|
const i = t.filename ?? ne(t.src);
|
|
3593
3602
|
return /* @__PURE__ */ n(
|
|
3594
|
-
|
|
3603
|
+
pn,
|
|
3595
3604
|
{
|
|
3596
3605
|
variant: e,
|
|
3597
3606
|
filename: i,
|
|
@@ -3603,7 +3612,7 @@ const zr = ({
|
|
|
3603
3612
|
trailingAction: r
|
|
3604
3613
|
}
|
|
3605
3614
|
);
|
|
3606
|
-
},
|
|
3615
|
+
}, lt = ({
|
|
3607
3616
|
state: e,
|
|
3608
3617
|
src: t,
|
|
3609
3618
|
filename: s,
|
|
@@ -3616,58 +3625,58 @@ const zr = ({
|
|
|
3616
3625
|
onClick: m,
|
|
3617
3626
|
onDismiss: g
|
|
3618
3627
|
}) => {
|
|
3619
|
-
const u =
|
|
3628
|
+
const u = ke(e), f = e === "composer" && !!g, c = Fr({
|
|
3620
3629
|
src: t,
|
|
3621
3630
|
filename: s,
|
|
3622
3631
|
fileSize: a,
|
|
3623
3632
|
mimeType: r,
|
|
3624
3633
|
title: i,
|
|
3625
3634
|
items: l
|
|
3626
|
-
}),
|
|
3627
|
-
if ((m == null ? void 0 : m(
|
|
3628
|
-
const
|
|
3629
|
-
if (!
|
|
3630
|
-
const
|
|
3631
|
-
|
|
3635
|
+
}), w = (_) => {
|
|
3636
|
+
if ((m == null ? void 0 : m(_)) === !1) return;
|
|
3637
|
+
const v = c[_];
|
|
3638
|
+
if (!v) return;
|
|
3639
|
+
const p = v.filename ?? ne(v.src);
|
|
3640
|
+
vn(v.src, p);
|
|
3632
3641
|
};
|
|
3633
3642
|
if (c.length === 0)
|
|
3634
3643
|
return null;
|
|
3635
|
-
const
|
|
3644
|
+
const b = /* @__PURE__ */ n(
|
|
3636
3645
|
"span",
|
|
3637
3646
|
{
|
|
3638
|
-
className:
|
|
3647
|
+
className: k(
|
|
3639
3648
|
"flex size-8 items-center justify-center rounded-full",
|
|
3640
3649
|
u === "dark" ? "text-white/70" : "text-black/70"
|
|
3641
3650
|
),
|
|
3642
3651
|
"aria-hidden": !0,
|
|
3643
|
-
children: /* @__PURE__ */ n(
|
|
3652
|
+
children: /* @__PURE__ */ n(we, { className: "size-5", weight: "bold" })
|
|
3644
3653
|
}
|
|
3645
3654
|
);
|
|
3646
3655
|
return /* @__PURE__ */ n(
|
|
3647
|
-
|
|
3656
|
+
ye,
|
|
3648
3657
|
{
|
|
3649
3658
|
variant: u,
|
|
3650
3659
|
text: o,
|
|
3651
3660
|
groupPosition: d,
|
|
3652
3661
|
"data-testid": "file-attachment",
|
|
3653
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((
|
|
3654
|
-
|
|
3662
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((_, v) => /* @__PURE__ */ n(
|
|
3663
|
+
Br,
|
|
3655
3664
|
{
|
|
3656
3665
|
variant: u,
|
|
3657
|
-
item:
|
|
3658
|
-
index:
|
|
3659
|
-
onActivate:
|
|
3660
|
-
trailingAction: f &&
|
|
3666
|
+
item: _,
|
|
3667
|
+
index: v,
|
|
3668
|
+
onActivate: w,
|
|
3669
|
+
trailingAction: f && v === 0 ? /* @__PURE__ */ n(Ce, { onClick: g, variant: "inline" }) : b
|
|
3661
3670
|
},
|
|
3662
|
-
`${
|
|
3671
|
+
`${_.src}-${v}`
|
|
3663
3672
|
)) })
|
|
3664
3673
|
}
|
|
3665
3674
|
);
|
|
3666
|
-
},
|
|
3667
|
-
Composer:
|
|
3668
|
-
Sent:
|
|
3669
|
-
Received:
|
|
3670
|
-
},
|
|
3675
|
+
}, Vr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "composer" }), Ur = (e) => /* @__PURE__ */ n(lt, { ...e, state: "sent" }), jr = (e) => /* @__PURE__ */ n(lt, { ...e, state: "received" }), Gr = {
|
|
3676
|
+
Composer: Vr,
|
|
3677
|
+
Sent: Ur,
|
|
3678
|
+
Received: jr
|
|
3679
|
+
}, ct = ({
|
|
3671
3680
|
onPrev: e,
|
|
3672
3681
|
onNext: t,
|
|
3673
3682
|
prevLabel: s = "Previous",
|
|
@@ -3680,7 +3689,7 @@ const zr = ({
|
|
|
3680
3689
|
onClick: e,
|
|
3681
3690
|
"aria-label": s,
|
|
3682
3691
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3683
|
-
children: /* @__PURE__ */ n(
|
|
3692
|
+
children: /* @__PURE__ */ n(Os, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3684
3693
|
}
|
|
3685
3694
|
),
|
|
3686
3695
|
/* @__PURE__ */ n(
|
|
@@ -3690,10 +3699,10 @@ const zr = ({
|
|
|
3690
3699
|
onClick: t,
|
|
3691
3700
|
"aria-label": a,
|
|
3692
3701
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3693
|
-
children: /* @__PURE__ */ n(
|
|
3702
|
+
children: /* @__PURE__ */ n(He, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3694
3703
|
}
|
|
3695
3704
|
)
|
|
3696
|
-
] }),
|
|
3705
|
+
] }), xn = ({
|
|
3697
3706
|
url: e,
|
|
3698
3707
|
filename: t,
|
|
3699
3708
|
variant: s = "pill",
|
|
@@ -3702,15 +3711,15 @@ const zr = ({
|
|
|
3702
3711
|
tone: i = "dark",
|
|
3703
3712
|
onTriggered: l
|
|
3704
3713
|
}) => {
|
|
3705
|
-
const [o, d] =
|
|
3714
|
+
const [o, d] = z(!1), m = Z(
|
|
3706
3715
|
(c) => {
|
|
3707
|
-
c.stopPropagation(), !o && (d(!0),
|
|
3716
|
+
c.stopPropagation(), !o && (d(!0), vn(e, t).catch(() => {
|
|
3708
3717
|
}).finally(() => {
|
|
3709
3718
|
d(!1), l == null || l();
|
|
3710
3719
|
}));
|
|
3711
3720
|
},
|
|
3712
3721
|
[o, e, t, l]
|
|
3713
|
-
), g = r ?? s !== "pill", f = { className:
|
|
3722
|
+
), g = r ?? s !== "pill", f = { className: k(
|
|
3714
3723
|
s === "pill" ? "size-4" : "size-5",
|
|
3715
3724
|
"shrink-0"
|
|
3716
3725
|
), weight: "bold" };
|
|
@@ -3721,7 +3730,7 @@ const zr = ({
|
|
|
3721
3730
|
onClick: m,
|
|
3722
3731
|
disabled: o,
|
|
3723
3732
|
"aria-label": a,
|
|
3724
|
-
className:
|
|
3733
|
+
className: k(
|
|
3725
3734
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
3726
3735
|
{
|
|
3727
3736
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
@@ -3729,14 +3738,14 @@ const zr = ({
|
|
|
3729
3738
|
}[i]
|
|
3730
3739
|
),
|
|
3731
3740
|
children: o ? /* @__PURE__ */ n(
|
|
3732
|
-
|
|
3741
|
+
xe,
|
|
3733
3742
|
{
|
|
3734
3743
|
className: "size-4 animate-spin",
|
|
3735
3744
|
weight: "bold",
|
|
3736
3745
|
"aria-hidden": !0
|
|
3737
3746
|
}
|
|
3738
3747
|
) : /* @__PURE__ */ n(
|
|
3739
|
-
|
|
3748
|
+
we,
|
|
3740
3749
|
{
|
|
3741
3750
|
className: "size-5 shrink-0",
|
|
3742
3751
|
weight: "bold",
|
|
@@ -3752,7 +3761,7 @@ const zr = ({
|
|
|
3752
3761
|
disabled: o,
|
|
3753
3762
|
"aria-label": a,
|
|
3754
3763
|
className: "mes-media-viewer__action",
|
|
3755
|
-
children: o ? /* @__PURE__ */ n(
|
|
3764
|
+
children: o ? /* @__PURE__ */ n(xe, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3756
3765
|
}
|
|
3757
3766
|
) : /* @__PURE__ */ h(
|
|
3758
3767
|
"button",
|
|
@@ -3761,37 +3770,37 @@ const zr = ({
|
|
|
3761
3770
|
onClick: m,
|
|
3762
3771
|
disabled: o,
|
|
3763
3772
|
"aria-label": g ? a : void 0,
|
|
3764
|
-
className:
|
|
3773
|
+
className: k(
|
|
3765
3774
|
"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",
|
|
3766
3775
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
3767
3776
|
),
|
|
3768
3777
|
children: [
|
|
3769
3778
|
o ? /* @__PURE__ */ n(
|
|
3770
|
-
|
|
3779
|
+
xe,
|
|
3771
3780
|
{
|
|
3772
3781
|
className: "size-4 animate-spin",
|
|
3773
3782
|
weight: "bold",
|
|
3774
3783
|
"aria-hidden": !0
|
|
3775
3784
|
}
|
|
3776
|
-
) : /* @__PURE__ */ n(
|
|
3785
|
+
) : /* @__PURE__ */ n(we, { ...f, "aria-hidden": !0 }),
|
|
3777
3786
|
g ? null : a
|
|
3778
3787
|
]
|
|
3779
3788
|
}
|
|
3780
3789
|
);
|
|
3781
|
-
},
|
|
3790
|
+
}, Ve = (e, t, s) => Math.min(Math.max(e, t), s), dt = ({
|
|
3782
3791
|
length: e,
|
|
3783
3792
|
initialIndex: t,
|
|
3784
3793
|
open: s
|
|
3785
3794
|
}) => {
|
|
3786
|
-
const a =
|
|
3795
|
+
const a = Ve(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
|
|
3787
3796
|
K(() => {
|
|
3788
|
-
s && i(
|
|
3797
|
+
s && i(Ve(t, 0, Math.max(e - 1, 0)));
|
|
3789
3798
|
}, [s, t, e]), K(() => {
|
|
3790
|
-
i((d) =>
|
|
3799
|
+
i((d) => Ve(d, 0, Math.max(e - 1, 0)));
|
|
3791
3800
|
}, [e]);
|
|
3792
|
-
const l =
|
|
3801
|
+
const l = Z(() => {
|
|
3793
3802
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3794
|
-
}, [e]), o =
|
|
3803
|
+
}, [e]), o = Z(() => {
|
|
3795
3804
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3796
3805
|
}, [e]);
|
|
3797
3806
|
return K(() => {
|
|
@@ -3803,7 +3812,7 @@ const zr = ({
|
|
|
3803
3812
|
};
|
|
3804
3813
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
3805
3814
|
}, [s, e, l, o]), { index: r, prev: l, next: o };
|
|
3806
|
-
},
|
|
3815
|
+
}, ut = ({
|
|
3807
3816
|
open: e,
|
|
3808
3817
|
onClose: t,
|
|
3809
3818
|
ariaLabel: s,
|
|
@@ -3812,7 +3821,7 @@ const zr = ({
|
|
|
3812
3821
|
children: i,
|
|
3813
3822
|
"data-testid": l
|
|
3814
3823
|
}) => {
|
|
3815
|
-
const o =
|
|
3824
|
+
const o = H(null), d = H(null);
|
|
3816
3825
|
return K(() => {
|
|
3817
3826
|
var f;
|
|
3818
3827
|
const u = o.current;
|
|
@@ -3884,7 +3893,7 @@ const zr = ({
|
|
|
3884
3893
|
onClick: t,
|
|
3885
3894
|
"aria-label": "Close viewer",
|
|
3886
3895
|
className: "mes-media-viewer__action",
|
|
3887
|
-
children: /* @__PURE__ */ n(
|
|
3896
|
+
children: /* @__PURE__ */ n(Le, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3888
3897
|
}
|
|
3889
3898
|
)
|
|
3890
3899
|
] })
|
|
@@ -3893,13 +3902,13 @@ const zr = ({
|
|
|
3893
3902
|
]
|
|
3894
3903
|
}
|
|
3895
3904
|
);
|
|
3896
|
-
},
|
|
3905
|
+
}, wn = ({
|
|
3897
3906
|
open: e,
|
|
3898
3907
|
items: t,
|
|
3899
3908
|
initialIndex: s = 0,
|
|
3900
3909
|
onClose: a
|
|
3901
3910
|
}) => {
|
|
3902
|
-
const { index: r, prev: i, next: l } =
|
|
3911
|
+
const { index: r, prev: i, next: l } = dt({
|
|
3903
3912
|
length: t.length,
|
|
3904
3913
|
initialIndex: s,
|
|
3905
3914
|
open: e
|
|
@@ -3908,14 +3917,14 @@ const zr = ({
|
|
|
3908
3917
|
[o]
|
|
3909
3918
|
);
|
|
3910
3919
|
return o ? /* @__PURE__ */ h(
|
|
3911
|
-
|
|
3920
|
+
ut,
|
|
3912
3921
|
{
|
|
3913
3922
|
open: e,
|
|
3914
3923
|
onClose: a,
|
|
3915
3924
|
ariaLabel: d,
|
|
3916
3925
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
3917
3926
|
actions: /* @__PURE__ */ n(
|
|
3918
|
-
|
|
3927
|
+
xn,
|
|
3919
3928
|
{
|
|
3920
3929
|
url: o.src,
|
|
3921
3930
|
filename: d,
|
|
@@ -3938,7 +3947,7 @@ const zr = ({
|
|
|
3938
3947
|
`${r}:${o.src}`
|
|
3939
3948
|
),
|
|
3940
3949
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
3941
|
-
|
|
3950
|
+
ct,
|
|
3942
3951
|
{
|
|
3943
3952
|
onPrev: i,
|
|
3944
3953
|
onNext: l,
|
|
@@ -3949,7 +3958,7 @@ const zr = ({
|
|
|
3949
3958
|
]
|
|
3950
3959
|
}
|
|
3951
3960
|
) : null;
|
|
3952
|
-
},
|
|
3961
|
+
}, Hr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", _n = ({
|
|
3953
3962
|
tiles: e,
|
|
3954
3963
|
onTileActivate: t,
|
|
3955
3964
|
maxVisible: s = 4,
|
|
@@ -3958,14 +3967,14 @@ const zr = ({
|
|
|
3958
3967
|
const r = e.length;
|
|
3959
3968
|
if (r === 0) return null;
|
|
3960
3969
|
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, m, g) => {
|
|
3961
|
-
const u =
|
|
3970
|
+
const u = k(Hr, "h-full w-full");
|
|
3962
3971
|
return t ? /* @__PURE__ */ h(
|
|
3963
3972
|
"button",
|
|
3964
3973
|
{
|
|
3965
3974
|
type: "button",
|
|
3966
3975
|
onClick: () => t(m),
|
|
3967
3976
|
"aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
|
|
3968
|
-
className:
|
|
3977
|
+
className: k(u, "cursor-zoom-in"),
|
|
3969
3978
|
children: [
|
|
3970
3979
|
d.content,
|
|
3971
3980
|
g
|
|
@@ -3977,10 +3986,10 @@ const zr = ({
|
|
|
3977
3986
|
g
|
|
3978
3987
|
] }, m);
|
|
3979
3988
|
};
|
|
3980
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
3989
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: k("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
3981
3990
|
"div",
|
|
3982
3991
|
{
|
|
3983
|
-
className:
|
|
3992
|
+
className: k(
|
|
3984
3993
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
3985
3994
|
a
|
|
3986
3995
|
),
|
|
@@ -3989,7 +3998,7 @@ const zr = ({
|
|
|
3989
3998
|
) : i.length === 3 ? /* @__PURE__ */ h(
|
|
3990
3999
|
"div",
|
|
3991
4000
|
{
|
|
3992
|
-
className:
|
|
4001
|
+
className: k(
|
|
3993
4002
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
3994
4003
|
a
|
|
3995
4004
|
),
|
|
@@ -4002,7 +4011,7 @@ const zr = ({
|
|
|
4002
4011
|
) : /* @__PURE__ */ n(
|
|
4003
4012
|
"div",
|
|
4004
4013
|
{
|
|
4005
|
-
className:
|
|
4014
|
+
className: k(
|
|
4006
4015
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
4007
4016
|
a
|
|
4008
4017
|
),
|
|
@@ -4019,15 +4028,15 @@ const zr = ({
|
|
|
4019
4028
|
})
|
|
4020
4029
|
}
|
|
4021
4030
|
);
|
|
4022
|
-
},
|
|
4023
|
-
const [t, s] =
|
|
4031
|
+
}, Ee = (e) => {
|
|
4032
|
+
const [t, s] = z(!1), [a, r] = z(0), i = Z(
|
|
4024
4033
|
(o) => {
|
|
4025
4034
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
4026
4035
|
},
|
|
4027
4036
|
[e]
|
|
4028
|
-
), l =
|
|
4037
|
+
), l = Z(() => s(!1), []);
|
|
4029
4038
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
4030
|
-
},
|
|
4039
|
+
}, Yr = (e, t, s, a) => ({
|
|
4031
4040
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4032
4041
|
content: /* @__PURE__ */ n(
|
|
4033
4042
|
"img",
|
|
@@ -4042,16 +4051,16 @@ const zr = ({
|
|
|
4042
4051
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4043
4052
|
}
|
|
4044
4053
|
)
|
|
4045
|
-
}),
|
|
4054
|
+
}), qr = ({
|
|
4046
4055
|
src: e,
|
|
4047
4056
|
alt: t,
|
|
4048
4057
|
items: s
|
|
4049
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4058
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], Nn = (e, t) => e.map((s, a) => ({
|
|
4050
4059
|
src: s.src,
|
|
4051
4060
|
alt: s.alt,
|
|
4052
4061
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4053
|
-
})),
|
|
4054
|
-
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } =
|
|
4062
|
+
})), Wr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4063
|
+
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Ee(
|
|
4055
4064
|
r
|
|
4056
4065
|
);
|
|
4057
4066
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4075,18 +4084,18 @@ const zr = ({
|
|
|
4075
4084
|
)
|
|
4076
4085
|
}
|
|
4077
4086
|
),
|
|
4078
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4087
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: i }) }) : null,
|
|
4079
4088
|
/* @__PURE__ */ n(
|
|
4080
|
-
|
|
4089
|
+
wn,
|
|
4081
4090
|
{
|
|
4082
4091
|
open: l,
|
|
4083
|
-
items:
|
|
4092
|
+
items: Nn([{ src: e, alt: t }], s),
|
|
4084
4093
|
initialIndex: o,
|
|
4085
4094
|
onClose: m
|
|
4086
4095
|
}
|
|
4087
4096
|
)
|
|
4088
4097
|
] });
|
|
4089
|
-
},
|
|
4098
|
+
}, yn = ({
|
|
4090
4099
|
state: e,
|
|
4091
4100
|
src: t,
|
|
4092
4101
|
alt: s,
|
|
@@ -4097,46 +4106,46 @@ const zr = ({
|
|
|
4097
4106
|
loading: o = "lazy",
|
|
4098
4107
|
onClick: d
|
|
4099
4108
|
}) => {
|
|
4100
|
-
const m =
|
|
4109
|
+
const m = qr({ src: t, alt: s, items: r }), g = ke(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: w } = Ee(
|
|
4101
4110
|
d
|
|
4102
4111
|
);
|
|
4103
4112
|
if (m.length === 0)
|
|
4104
4113
|
return null;
|
|
4105
|
-
const
|
|
4106
|
-
(
|
|
4114
|
+
const b = m.map(
|
|
4115
|
+
(_, v) => Yr(_, v, m.length, o)
|
|
4107
4116
|
);
|
|
4108
4117
|
return /* @__PURE__ */ h(
|
|
4109
|
-
|
|
4118
|
+
ye,
|
|
4110
4119
|
{
|
|
4111
4120
|
variant: g,
|
|
4112
4121
|
text: i,
|
|
4113
4122
|
groupPosition: l,
|
|
4114
4123
|
"data-testid": "image-attachment",
|
|
4115
4124
|
children: [
|
|
4116
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4125
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(_n, { tiles: b, onTileActivate: c }) }),
|
|
4117
4126
|
/* @__PURE__ */ n(
|
|
4118
|
-
|
|
4127
|
+
wn,
|
|
4119
4128
|
{
|
|
4120
4129
|
open: u,
|
|
4121
|
-
items:
|
|
4130
|
+
items: Nn(m, a),
|
|
4122
4131
|
initialIndex: f,
|
|
4123
|
-
onClose:
|
|
4132
|
+
onClose: w
|
|
4124
4133
|
}
|
|
4125
4134
|
)
|
|
4126
4135
|
]
|
|
4127
4136
|
}
|
|
4128
4137
|
);
|
|
4129
|
-
},
|
|
4130
|
-
Composer:
|
|
4131
|
-
Sent:
|
|
4132
|
-
Received:
|
|
4133
|
-
},
|
|
4138
|
+
}, Xr = (e) => /* @__PURE__ */ n(Wr, { ...e }), Kr = (e) => /* @__PURE__ */ n(yn, { ...e, state: "sent" }), Jr = (e) => /* @__PURE__ */ n(yn, { ...e, state: "received" }), Zr = {
|
|
4139
|
+
Composer: Xr,
|
|
4140
|
+
Sent: Kr,
|
|
4141
|
+
Received: Jr
|
|
4142
|
+
}, Qr = ({
|
|
4134
4143
|
open: e,
|
|
4135
4144
|
items: t,
|
|
4136
4145
|
initialIndex: s = 0,
|
|
4137
4146
|
onClose: a
|
|
4138
4147
|
}) => {
|
|
4139
|
-
const { index: r, prev: i, next: l } =
|
|
4148
|
+
const { index: r, prev: i, next: l } = dt({
|
|
4140
4149
|
length: t.length,
|
|
4141
4150
|
initialIndex: s,
|
|
4142
4151
|
open: e
|
|
@@ -4144,11 +4153,11 @@ const zr = ({
|
|
|
4144
4153
|
() => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "document"),
|
|
4145
4154
|
[o]
|
|
4146
4155
|
), m = se(
|
|
4147
|
-
() => o ?
|
|
4156
|
+
() => o ? ei(o.src) : void 0,
|
|
4148
4157
|
[o]
|
|
4149
4158
|
);
|
|
4150
4159
|
return !o || !m ? null : /* @__PURE__ */ h(
|
|
4151
|
-
|
|
4160
|
+
ut,
|
|
4152
4161
|
{
|
|
4153
4162
|
open: e,
|
|
4154
4163
|
onClose: a,
|
|
@@ -4167,7 +4176,7 @@ const zr = ({
|
|
|
4167
4176
|
`${r}:${o.src}`
|
|
4168
4177
|
),
|
|
4169
4178
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4170
|
-
|
|
4179
|
+
ct,
|
|
4171
4180
|
{
|
|
4172
4181
|
onPrev: i,
|
|
4173
4182
|
onNext: l,
|
|
@@ -4178,16 +4187,16 @@ const zr = ({
|
|
|
4178
4187
|
]
|
|
4179
4188
|
}
|
|
4180
4189
|
);
|
|
4181
|
-
},
|
|
4190
|
+
}, ei = (e) => {
|
|
4182
4191
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4183
4192
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4184
|
-
},
|
|
4193
|
+
}, ti = ({
|
|
4185
4194
|
src: e,
|
|
4186
4195
|
filename: t,
|
|
4187
4196
|
fileSize: s,
|
|
4188
4197
|
title: a,
|
|
4189
4198
|
items: r
|
|
4190
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4199
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], ni = ({
|
|
4191
4200
|
variant: e,
|
|
4192
4201
|
item: t,
|
|
4193
4202
|
index: s,
|
|
@@ -4196,7 +4205,7 @@ const zr = ({
|
|
|
4196
4205
|
}) => {
|
|
4197
4206
|
const i = t.filename ?? ne(t.src);
|
|
4198
4207
|
return /* @__PURE__ */ n(
|
|
4199
|
-
|
|
4208
|
+
pn,
|
|
4200
4209
|
{
|
|
4201
4210
|
variant: e,
|
|
4202
4211
|
filename: i,
|
|
@@ -4208,7 +4217,7 @@ const zr = ({
|
|
|
4208
4217
|
trailingAction: r
|
|
4209
4218
|
}
|
|
4210
4219
|
);
|
|
4211
|
-
},
|
|
4220
|
+
}, mt = ({
|
|
4212
4221
|
state: e,
|
|
4213
4222
|
src: t,
|
|
4214
4223
|
filename: s,
|
|
@@ -4220,28 +4229,28 @@ const zr = ({
|
|
|
4220
4229
|
onClick: d,
|
|
4221
4230
|
onDismiss: m
|
|
4222
4231
|
}) => {
|
|
4223
|
-
const g =
|
|
4232
|
+
const g = ke(e), u = ti({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: w, closeViewer: b } = Ee(
|
|
4224
4233
|
d
|
|
4225
|
-
),
|
|
4234
|
+
), _ = e === "composer" && !!m;
|
|
4226
4235
|
if (u.length === 0)
|
|
4227
4236
|
return null;
|
|
4228
|
-
const
|
|
4229
|
-
src:
|
|
4230
|
-
filename:
|
|
4237
|
+
const v = u.map((p) => ({
|
|
4238
|
+
src: p.src,
|
|
4239
|
+
filename: p.filename ?? ne(p.src)
|
|
4231
4240
|
}));
|
|
4232
4241
|
return /* @__PURE__ */ h(
|
|
4233
|
-
|
|
4242
|
+
ye,
|
|
4234
4243
|
{
|
|
4235
4244
|
variant: g,
|
|
4236
4245
|
text: l,
|
|
4237
4246
|
groupPosition: o,
|
|
4238
4247
|
"data-testid": "pdf-attachment",
|
|
4239
4248
|
children: [
|
|
4240
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4241
|
-
const M =
|
|
4242
|
-
|
|
4249
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((p, I) => {
|
|
4250
|
+
const M = p.filename ?? ne(p.src), R = _ && I === 0 ? /* @__PURE__ */ n(Ce, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4251
|
+
xn,
|
|
4243
4252
|
{
|
|
4244
|
-
url:
|
|
4253
|
+
url: p.src,
|
|
4245
4254
|
filename: M,
|
|
4246
4255
|
variant: "inline",
|
|
4247
4256
|
label: `Download ${M}`,
|
|
@@ -4249,40 +4258,40 @@ const zr = ({
|
|
|
4249
4258
|
}
|
|
4250
4259
|
);
|
|
4251
4260
|
return /* @__PURE__ */ n(
|
|
4252
|
-
|
|
4261
|
+
ni,
|
|
4253
4262
|
{
|
|
4254
4263
|
variant: g,
|
|
4255
|
-
item:
|
|
4256
|
-
index:
|
|
4257
|
-
onActivate:
|
|
4258
|
-
trailingAction:
|
|
4264
|
+
item: p,
|
|
4265
|
+
index: I,
|
|
4266
|
+
onActivate: w,
|
|
4267
|
+
trailingAction: R
|
|
4259
4268
|
},
|
|
4260
|
-
`${
|
|
4269
|
+
`${p.src}-${I}`
|
|
4261
4270
|
);
|
|
4262
4271
|
}) }),
|
|
4263
4272
|
/* @__PURE__ */ n(
|
|
4264
|
-
|
|
4273
|
+
Qr,
|
|
4265
4274
|
{
|
|
4266
4275
|
open: f,
|
|
4267
|
-
items:
|
|
4276
|
+
items: v,
|
|
4268
4277
|
initialIndex: c,
|
|
4269
|
-
onClose:
|
|
4278
|
+
onClose: b
|
|
4270
4279
|
}
|
|
4271
4280
|
)
|
|
4272
4281
|
]
|
|
4273
4282
|
}
|
|
4274
4283
|
);
|
|
4275
|
-
},
|
|
4276
|
-
Composer:
|
|
4277
|
-
Sent:
|
|
4278
|
-
Received:
|
|
4279
|
-
},
|
|
4284
|
+
}, si = (e) => /* @__PURE__ */ n(mt, { ...e, state: "composer" }), ai = (e) => /* @__PURE__ */ n(mt, { ...e, state: "sent" }), ri = (e) => /* @__PURE__ */ n(mt, { ...e, state: "received" }), ii = {
|
|
4285
|
+
Composer: si,
|
|
4286
|
+
Sent: ai,
|
|
4287
|
+
Received: ri
|
|
4288
|
+
}, Cn = ({
|
|
4280
4289
|
open: e,
|
|
4281
4290
|
items: t,
|
|
4282
4291
|
initialIndex: s = 0,
|
|
4283
4292
|
onClose: a
|
|
4284
4293
|
}) => {
|
|
4285
|
-
const { index: r, prev: i, next: l } =
|
|
4294
|
+
const { index: r, prev: i, next: l } = dt({
|
|
4286
4295
|
length: t.length,
|
|
4287
4296
|
initialIndex: s,
|
|
4288
4297
|
open: e
|
|
@@ -4291,7 +4300,7 @@ const zr = ({
|
|
|
4291
4300
|
[o]
|
|
4292
4301
|
);
|
|
4293
4302
|
return o ? /* @__PURE__ */ h(
|
|
4294
|
-
|
|
4303
|
+
ut,
|
|
4295
4304
|
{
|
|
4296
4305
|
open: e,
|
|
4297
4306
|
onClose: a,
|
|
@@ -4315,7 +4324,7 @@ const zr = ({
|
|
|
4315
4324
|
`${r}:${o.src}`
|
|
4316
4325
|
),
|
|
4317
4326
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
4318
|
-
|
|
4327
|
+
ct,
|
|
4319
4328
|
{
|
|
4320
4329
|
onPrev: i,
|
|
4321
4330
|
onNext: l,
|
|
@@ -4326,7 +4335,7 @@ const zr = ({
|
|
|
4326
4335
|
]
|
|
4327
4336
|
}
|
|
4328
4337
|
) : null;
|
|
4329
|
-
},
|
|
4338
|
+
}, oi = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(je, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), kn = ({
|
|
4330
4339
|
item: e,
|
|
4331
4340
|
index: t
|
|
4332
4341
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4341,31 +4350,31 @@ const zr = ({
|
|
|
4341
4350
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4342
4351
|
}
|
|
4343
4352
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4344
|
-
|
|
4353
|
+
Wt,
|
|
4345
4354
|
{
|
|
4346
4355
|
className: "size-16 rounded-md text-white/30",
|
|
4347
4356
|
weight: "regular",
|
|
4348
4357
|
"aria-hidden": !0
|
|
4349
4358
|
}
|
|
4350
4359
|
) }),
|
|
4351
|
-
/* @__PURE__ */ n(
|
|
4352
|
-
] }),
|
|
4360
|
+
/* @__PURE__ */ n(oi, {})
|
|
4361
|
+
] }), li = (e, t, s) => ({
|
|
4353
4362
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4354
|
-
content: /* @__PURE__ */ n(
|
|
4355
|
-
}),
|
|
4363
|
+
content: /* @__PURE__ */ n(kn, { item: e, index: t })
|
|
4364
|
+
}), ci = ({
|
|
4356
4365
|
src: e,
|
|
4357
4366
|
poster: t,
|
|
4358
4367
|
mimeType: s,
|
|
4359
4368
|
preload: a,
|
|
4360
4369
|
items: r
|
|
4361
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
4370
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], En = (e, t) => e.map((s, a) => ({
|
|
4362
4371
|
src: s.src,
|
|
4363
4372
|
poster: s.poster,
|
|
4364
4373
|
mimeType: s.mimeType,
|
|
4365
4374
|
preload: s.preload,
|
|
4366
4375
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4367
|
-
})),
|
|
4368
|
-
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } =
|
|
4376
|
+
})), di = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
4377
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: g } = Ee(
|
|
4369
4378
|
i
|
|
4370
4379
|
);
|
|
4371
4380
|
return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
|
|
@@ -4376,15 +4385,15 @@ const zr = ({
|
|
|
4376
4385
|
onClick: () => m(0),
|
|
4377
4386
|
"aria-label": "Play video",
|
|
4378
4387
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
4379
|
-
children: /* @__PURE__ */ n(
|
|
4388
|
+
children: /* @__PURE__ */ n(kn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4380
4389
|
}
|
|
4381
4390
|
),
|
|
4382
|
-
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4391
|
+
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ce, { onClick: l }) }) : null,
|
|
4383
4392
|
/* @__PURE__ */ n(
|
|
4384
|
-
|
|
4393
|
+
Cn,
|
|
4385
4394
|
{
|
|
4386
4395
|
open: o,
|
|
4387
|
-
items:
|
|
4396
|
+
items: En(
|
|
4388
4397
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4389
4398
|
a
|
|
4390
4399
|
),
|
|
@@ -4393,7 +4402,7 @@ const zr = ({
|
|
|
4393
4402
|
}
|
|
4394
4403
|
)
|
|
4395
4404
|
] });
|
|
4396
|
-
},
|
|
4405
|
+
}, Sn = ({
|
|
4397
4406
|
state: e,
|
|
4398
4407
|
src: t,
|
|
4399
4408
|
poster: s,
|
|
@@ -4405,16 +4414,16 @@ const zr = ({
|
|
|
4405
4414
|
preload: d,
|
|
4406
4415
|
onClick: m
|
|
4407
4416
|
}) => {
|
|
4408
|
-
const g =
|
|
4417
|
+
const g = ci({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = ke(e), { viewerOpen: f, viewerIndex: c, handleActivate: w, closeViewer: b } = Ee(
|
|
4409
4418
|
m
|
|
4410
4419
|
);
|
|
4411
4420
|
if (g.length === 0)
|
|
4412
4421
|
return null;
|
|
4413
|
-
const
|
|
4414
|
-
(
|
|
4422
|
+
const _ = g.map(
|
|
4423
|
+
(v, p) => li(v, p, g.length)
|
|
4415
4424
|
);
|
|
4416
4425
|
return /* @__PURE__ */ h(
|
|
4417
|
-
|
|
4426
|
+
ye,
|
|
4418
4427
|
{
|
|
4419
4428
|
variant: u,
|
|
4420
4429
|
text: l,
|
|
@@ -4422,36 +4431,36 @@ const zr = ({
|
|
|
4422
4431
|
"data-testid": "video-attachment",
|
|
4423
4432
|
children: [
|
|
4424
4433
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4425
|
-
|
|
4434
|
+
_n,
|
|
4426
4435
|
{
|
|
4427
|
-
tiles:
|
|
4428
|
-
onTileActivate:
|
|
4436
|
+
tiles: _,
|
|
4437
|
+
onTileActivate: w,
|
|
4429
4438
|
className: "overflow-hidden rounded-md"
|
|
4430
4439
|
}
|
|
4431
4440
|
) }),
|
|
4432
4441
|
/* @__PURE__ */ n(
|
|
4433
|
-
|
|
4442
|
+
Cn,
|
|
4434
4443
|
{
|
|
4435
4444
|
open: f,
|
|
4436
|
-
items:
|
|
4445
|
+
items: En(g, r),
|
|
4437
4446
|
initialIndex: c,
|
|
4438
|
-
onClose:
|
|
4447
|
+
onClose: b
|
|
4439
4448
|
}
|
|
4440
4449
|
)
|
|
4441
4450
|
]
|
|
4442
4451
|
}
|
|
4443
4452
|
);
|
|
4444
|
-
},
|
|
4445
|
-
Composer:
|
|
4446
|
-
Sent:
|
|
4447
|
-
Received:
|
|
4448
|
-
},
|
|
4449
|
-
Image:
|
|
4450
|
-
Video:
|
|
4451
|
-
Audio:
|
|
4452
|
-
Pdf:
|
|
4453
|
-
File:
|
|
4454
|
-
},
|
|
4453
|
+
}, ui = (e) => /* @__PURE__ */ n(di, { ...e }), mi = (e) => /* @__PURE__ */ n(Sn, { ...e, state: "sent" }), hi = (e) => /* @__PURE__ */ n(Sn, { ...e, state: "received" }), fi = {
|
|
4454
|
+
Composer: ui,
|
|
4455
|
+
Sent: mi,
|
|
4456
|
+
Received: hi
|
|
4457
|
+
}, Mi = {
|
|
4458
|
+
Image: Zr,
|
|
4459
|
+
Video: fi,
|
|
4460
|
+
Audio: Mr,
|
|
4461
|
+
Pdf: ii,
|
|
4462
|
+
File: Gr
|
|
4463
|
+
}, gi = ({
|
|
4455
4464
|
question: e,
|
|
4456
4465
|
onClick: t,
|
|
4457
4466
|
loading: s = !1,
|
|
@@ -4463,7 +4472,7 @@ const zr = ({
|
|
|
4463
4472
|
onClick: t,
|
|
4464
4473
|
disabled: s,
|
|
4465
4474
|
style: { backgroundColor: "#E6E5E3" },
|
|
4466
|
-
className:
|
|
4475
|
+
className: k(
|
|
4467
4476
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4468
4477
|
{
|
|
4469
4478
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4473,7 +4482,7 @@ const zr = ({
|
|
|
4473
4482
|
),
|
|
4474
4483
|
children: e
|
|
4475
4484
|
}
|
|
4476
|
-
),
|
|
4485
|
+
), Ri = ({
|
|
4477
4486
|
faqs: e,
|
|
4478
4487
|
onFaqClick: t,
|
|
4479
4488
|
loadingFaqId: s,
|
|
@@ -4502,7 +4511,7 @@ const zr = ({
|
|
|
4502
4511
|
children: [
|
|
4503
4512
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4504
4513
|
o.map((d) => /* @__PURE__ */ n(
|
|
4505
|
-
|
|
4514
|
+
gi,
|
|
4506
4515
|
{
|
|
4507
4516
|
question: d.question,
|
|
4508
4517
|
onClick: () => t(d.id),
|
|
@@ -4516,39 +4525,40 @@ const zr = ({
|
|
|
4516
4525
|
] }) });
|
|
4517
4526
|
};
|
|
4518
4527
|
export {
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4528
|
+
sn as A,
|
|
4529
|
+
wa as B,
|
|
4530
|
+
Ja as C,
|
|
4531
|
+
qs as D,
|
|
4532
|
+
$s as E,
|
|
4533
|
+
Ri as F,
|
|
4534
|
+
Ti as L,
|
|
4535
|
+
ki as M,
|
|
4536
|
+
pe as V,
|
|
4527
4537
|
be as a,
|
|
4528
4538
|
oe as b,
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4539
|
+
or as c,
|
|
4540
|
+
hn as d,
|
|
4541
|
+
Ei as e,
|
|
4542
|
+
gi as f,
|
|
4533
4543
|
re as g,
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
+
Bt as h,
|
|
4545
|
+
Mi as i,
|
|
4546
|
+
Ea as j,
|
|
4547
|
+
Ci as k,
|
|
4548
|
+
Ii as l,
|
|
4549
|
+
Pr as m,
|
|
4550
|
+
Rr as n,
|
|
4551
|
+
rr as o,
|
|
4552
|
+
Dr as p,
|
|
4553
|
+
Qt as q,
|
|
4544
4554
|
ce as r,
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4555
|
+
on as s,
|
|
4556
|
+
Bs as t,
|
|
4557
|
+
Ai as u,
|
|
4558
|
+
Ws as v,
|
|
4559
|
+
tt as w,
|
|
4560
|
+
nt as x,
|
|
4561
|
+
Zt as y,
|
|
4562
|
+
Si as z
|
|
4553
4563
|
};
|
|
4554
|
-
//# sourceMappingURL=index-
|
|
4564
|
+
//# sourceMappingURL=index-CgczmQkU.js.map
|