@linktr.ee/messaging-react 3.3.10 → 3.3.11-rc-1781859612
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-giUAe8IB.js → Card-BmU_ztmU.js} +2 -2
- package/dist/{Card-giUAe8IB.js.map → Card-BmU_ztmU.js.map} +1 -1
- package/dist/{Card-DndbBigk.js → Card-CHDQEG9i.js} +2 -2
- package/dist/{Card-DndbBigk.js.map → Card-CHDQEG9i.js.map} +1 -1
- package/dist/{Card-DiSXLhzw.cjs → Card-CizcvpTa.cjs} +2 -2
- package/dist/{Card-DiSXLhzw.cjs.map → Card-CizcvpTa.cjs.map} +1 -1
- package/dist/{Card-qFB_y7k3.js → Card-D-sSG334.js} +3 -3
- package/dist/{Card-qFB_y7k3.js.map → Card-D-sSG334.js.map} +1 -1
- package/dist/{Card-DezN34Sz.cjs → Card-PGPY8ZRL.cjs} +2 -2
- package/dist/{Card-DezN34Sz.cjs.map → Card-PGPY8ZRL.cjs.map} +1 -1
- package/dist/{Card-Ch3cTL6G.cjs → Card-omzCiCc9.cjs} +2 -2
- package/dist/{Card-Ch3cTL6G.cjs.map → Card-omzCiCc9.cjs.map} +1 -1
- package/dist/{LockedThumbnail-C9Y0oCjv.js → LockedThumbnail-BynAff_z.js} +2 -2
- package/dist/{LockedThumbnail-C9Y0oCjv.js.map → LockedThumbnail-BynAff_z.js.map} +1 -1
- package/dist/{LockedThumbnail-DkdVuMZM.cjs → LockedThumbnail-UEkCam1N.cjs} +2 -2
- package/dist/{LockedThumbnail-DkdVuMZM.cjs.map → LockedThumbnail-UEkCam1N.cjs.map} +1 -1
- package/dist/{index-DGVCJzwy.js → index-CAAtAfn1.js} +785 -790
- package/dist/index-CAAtAfn1.js.map +1 -0
- package/dist/index-SMjrfgpc.cjs +2 -0
- package/dist/index-SMjrfgpc.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/providers/MessagingProvider.test.tsx +87 -0
- package/src/providers/MessagingProvider.tsx +40 -30
- package/dist/index-B_8de68T.cjs +0 -2
- package/dist/index-B_8de68T.cjs.map +0 -1
- package/dist/index-DGVCJzwy.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as n, jsxs as h, Fragment as te } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import F, { createContext as Ge, useContext as Te, useCallback as W, useState as O, useRef as H, useEffect as Y, useId as En, useMemo as ee, Suspense as He } from "react";
|
|
3
|
+
import { StreamChatService as In } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { StreamChat as Sn, LinkPreviewsManager as Tt } from "stream-chat";
|
|
5
|
+
import { Chat as Tn, DateSeparator as An, useChannelStateContext as ce, useChatContext as Ye, areMessageUIPropsEqual as Mn, useMessageReminder as Rn, useComponentContext as Ut, Attachment as Ln, EditMessageModal as Dn, MessageBlocked as Pn, MessageBouncePrompt as On, MessageDeleted as zn, MessageIsThreadReplyInChannelButtonIndicator as $n, MessageRepliesCountButton as Fn, ReminderNotification as Bn, StreamedMessageText as Un, messageHasAttachments as jn, messageHasReactions as Vn, isDateSeparatorMessage as Gn, isMessageBlocked as Hn, isMessageBounced as Yn, MessageBounceModal as qn, MessageText as At, Poll as Wn, MessageErrorIcon as Xn, useMessageContext as pe, useMessageComposer as Jn, useStateStore as Kn, MessageInput as Zn, useMessageInputContext as Qn, useMessageComposerHasSendableData as es, AttachmentPreviewList as ts, QuotedMessagePreview as ns, TextareaComposer as ss, MessageTimestamp as Le, AIStates as De, useTypingContext as as, useAIState as rs, Channel as is, WithComponents as os, Window as ls, MessageList as cs, ChannelList as ds, InfiniteScroll as us } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Fe, DotsThreeIcon as ms, SpinnerGapIcon as Ce, SignOutIcon as hs, ProhibitInsetIcon as Mt, FlagIcon as jt, FileIcon as Vt, ImageIcon as fs, SpeakerHighIcon as gs, VideoCameraIcon as Gt, FileMdIcon as bs, FileTextIcon as ps, FileZipIcon as vs, FilePptIcon as xs, FileCsvIcon as ws, FileXlsIcon as _s, FileDocIcon as Ns, FilePdfIcon as ys, CircleNotchIcon as ge, PlayIcon as Be, PauseIcon as Cs, LinkIcon as ks, DownloadSimpleIcon as be, GiftIcon as Es, ThumbsUpIcon as Is, ThumbsDownIcon as Ss, TrashSimpleIcon as Ts, XIcon as Ae, ArrowUpIcon as As, SparkleIcon as Ue, ProhibitIcon as Ms, ArrowLeftIcon as Rt, PencilSimpleIcon as Rs, CaretLeftIcon as Ls, CaretRightIcon as Ds } from "@phosphor-icons/react";
|
|
6
7
|
import y from "classnames";
|
|
7
|
-
import { MessageActions as
|
|
8
|
-
import { LinkPreviewsManager as Rt } from "stream-chat";
|
|
8
|
+
import { MessageActions as Ps, DefaultDropdownActionButton as Ht } from "stream-chat-react/experimental";
|
|
9
9
|
const Yt = Ge({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
@@ -16,7 +16,7 @@ const Yt = Ge({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), qe = () => Te(Yt),
|
|
19
|
+
}), qe = () => Te(Yt), Ni = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -25,8 +25,8 @@ const Yt = Ge({
|
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
27
|
const o = W(
|
|
28
|
-
(
|
|
29
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
28
|
+
(w, ...C) => {
|
|
29
|
+
i && console.log(`🔥 [MessagingProvider] ${w}`, ...C);
|
|
30
30
|
},
|
|
31
31
|
[i]
|
|
32
32
|
);
|
|
@@ -36,84 +36,85 @@ const Yt = Ge({
|
|
|
36
36
|
serviceConfig: !!s,
|
|
37
37
|
capabilities: Object.keys(r)
|
|
38
38
|
});
|
|
39
|
-
const [l, d] =
|
|
39
|
+
const [l, d] = O(null), [m, b] = O(null), [u, f] = O(!1), [c, g] = O(!1), [p, v] = O(null), N = H(!1), _ = H(null), E = H({
|
|
40
40
|
userId: t == null ? void 0 : t.id,
|
|
41
41
|
apiKey: a,
|
|
42
42
|
serviceConfig: s,
|
|
43
43
|
capabilities: r
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
renderCount:
|
|
44
|
+
}), I = H(0);
|
|
45
|
+
I.current++, o("📊 RENDER INFO", {
|
|
46
|
+
renderCount: I.current,
|
|
47
47
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
48
48
|
propChanges: {
|
|
49
|
-
userChanged:
|
|
50
|
-
apiKeyChanged:
|
|
51
|
-
serviceConfigChanged:
|
|
52
|
-
capabilitiesChanged:
|
|
49
|
+
userChanged: E.current.userId !== (t == null ? void 0 : t.id),
|
|
50
|
+
apiKeyChanged: E.current.apiKey !== a,
|
|
51
|
+
serviceConfigChanged: E.current.serviceConfig !== s,
|
|
52
|
+
capabilitiesChanged: E.current.capabilities !== r
|
|
53
53
|
}
|
|
54
|
-
}),
|
|
54
|
+
}), E.current = {
|
|
55
55
|
userId: t == null ? void 0 : t.id,
|
|
56
56
|
apiKey: a,
|
|
57
57
|
serviceConfig: s,
|
|
58
58
|
capabilities: r
|
|
59
|
-
}
|
|
60
|
-
|
|
59
|
+
};
|
|
60
|
+
const T = F.useMemo(
|
|
61
|
+
() => a ? new Sn(a) : null,
|
|
62
|
+
[a]
|
|
63
|
+
);
|
|
64
|
+
Y(() => {
|
|
65
|
+
const w = I.current;
|
|
61
66
|
if (o("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
62
|
-
renderCount:
|
|
67
|
+
renderCount: w,
|
|
63
68
|
apiKey: !!a,
|
|
64
69
|
serviceConfig: !!s,
|
|
65
70
|
dependencies: {
|
|
66
71
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
67
72
|
serviceConfigRef: s,
|
|
68
|
-
serviceConfigStable:
|
|
69
|
-
apiKeyStable:
|
|
73
|
+
serviceConfigStable: E.current.serviceConfig === s,
|
|
74
|
+
apiKeyStable: E.current.apiKey === a
|
|
70
75
|
}
|
|
71
76
|
}), !a || !s) {
|
|
72
77
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
73
|
-
renderCount:
|
|
78
|
+
renderCount: w,
|
|
74
79
|
reason: "Missing apiKey or serviceConfig"
|
|
75
80
|
});
|
|
76
81
|
return;
|
|
77
82
|
}
|
|
78
83
|
o("🚀 CREATING NEW SERVICE", {
|
|
79
|
-
renderCount:
|
|
84
|
+
renderCount: w,
|
|
80
85
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
81
|
-
serviceConfigChanged:
|
|
86
|
+
serviceConfigChanged: E.current.serviceConfig !== s
|
|
82
87
|
});
|
|
83
|
-
const
|
|
88
|
+
const C = new In({
|
|
84
89
|
...s,
|
|
85
90
|
apiKey: a,
|
|
86
|
-
debug: i
|
|
91
|
+
debug: i,
|
|
92
|
+
...T ? { client: T } : {}
|
|
87
93
|
});
|
|
88
|
-
|
|
89
|
-
renderCount:
|
|
90
|
-
serviceInstance: !!
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
reason: "Effect cleanup"
|
|
95
|
-
}), T.disconnectUser().catch(console.error);
|
|
96
|
-
};
|
|
97
|
-
}, [a, s, i, o]);
|
|
98
|
-
const E = H(null);
|
|
94
|
+
_.current = C, d(C), o("✅ SERVICE SET", {
|
|
95
|
+
renderCount: w,
|
|
96
|
+
serviceInstance: !!C
|
|
97
|
+
});
|
|
98
|
+
}, [a, s, i, o, T]);
|
|
99
|
+
const L = H(null);
|
|
99
100
|
Y(() => {
|
|
100
|
-
var
|
|
101
|
+
var C, M;
|
|
101
102
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
103
|
hasService: !!l,
|
|
103
104
|
hasUser: !!t,
|
|
104
105
|
userId: t == null ? void 0 : t.id,
|
|
105
|
-
isConnecting:
|
|
106
|
+
isConnecting: N.current,
|
|
106
107
|
isConnected: u,
|
|
107
108
|
dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
|
|
108
109
|
}), !l || !t) {
|
|
109
110
|
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
|
-
if (
|
|
113
|
+
if (N.current) {
|
|
113
114
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
114
115
|
return;
|
|
115
116
|
}
|
|
116
|
-
if (((
|
|
117
|
+
if (((C = L.current) == null ? void 0 : C.serviceId) === l && ((M = L.current) == null ? void 0 : M.userId) === t.id) {
|
|
117
118
|
o(
|
|
118
119
|
"⚠️ USER CONNECTION SKIPPED",
|
|
119
120
|
"Already connected this user with this service"
|
|
@@ -121,40 +122,34 @@ const Yt = Ge({
|
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
124
|
(async () => {
|
|
124
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
125
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, g(!0), v(null);
|
|
125
126
|
try {
|
|
126
127
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
127
|
-
const
|
|
128
|
-
b(
|
|
128
|
+
const P = await l.connectUser(t);
|
|
129
|
+
b(P), f(!0), L.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
129
130
|
userId: t.id,
|
|
130
|
-
clientId:
|
|
131
|
+
clientId: P.userID
|
|
131
132
|
});
|
|
132
|
-
} catch (
|
|
133
|
-
const
|
|
134
|
-
v(
|
|
133
|
+
} catch (P) {
|
|
134
|
+
const S = P instanceof Error ? P.message : "Connection failed";
|
|
135
|
+
v(S), o("❌ USER CONNECTION ERROR", {
|
|
135
136
|
userId: t.id,
|
|
136
|
-
error:
|
|
137
|
+
error: S
|
|
137
138
|
});
|
|
138
139
|
} finally {
|
|
139
|
-
g(!1),
|
|
140
|
+
g(!1), N.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
140
141
|
userId: t.id,
|
|
141
142
|
isConnected: u
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
145
|
})();
|
|
145
|
-
}, [l, t, o, u]), Y(() => (o("🔌 CLEANUP EFFECT REGISTERED", {
|
|
146
|
-
|
|
147
|
-
isConnected: u
|
|
146
|
+
}, [l, t, o, u]), Y(() => (o("🔌 CLIENT CLEANUP EFFECT REGISTERED", {
|
|
147
|
+
hasClient: !!T
|
|
148
148
|
}), () => {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
hasService: !!l,
|
|
154
|
-
isConnected: u
|
|
155
|
-
});
|
|
156
|
-
}), [l, u, o]);
|
|
157
|
-
const M = W(async () => {
|
|
149
|
+
var w;
|
|
150
|
+
o("🧹 CLIENT CLEANUP EFFECT TRIGGERED", "Disconnecting client"), L.current = null, (w = _.current) == null || w.disconnectUser().catch(console.error);
|
|
151
|
+
}), [T, o]);
|
|
152
|
+
const A = W(async () => {
|
|
158
153
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
159
154
|
hasService: !!l,
|
|
160
155
|
hasUser: !!t
|
|
@@ -165,18 +160,18 @@ const Yt = Ge({
|
|
|
165
160
|
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), g(!0);
|
|
166
161
|
try {
|
|
167
162
|
o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
168
|
-
const
|
|
169
|
-
b(
|
|
170
|
-
} catch (
|
|
171
|
-
const
|
|
172
|
-
v(
|
|
163
|
+
const w = await l.connectUser(t);
|
|
164
|
+
b(w), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
165
|
+
} catch (w) {
|
|
166
|
+
const C = w instanceof Error ? w.message : "Refresh failed";
|
|
167
|
+
v(C), o("❌ CONNECTION REFRESH ERROR", {
|
|
173
168
|
userId: t.id,
|
|
174
|
-
error:
|
|
169
|
+
error: C
|
|
175
170
|
});
|
|
176
171
|
} finally {
|
|
177
172
|
g(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
178
173
|
}
|
|
179
|
-
}, [l, t, o]),
|
|
174
|
+
}, [l, t, o]), R = F.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
180
175
|
hasService: !!l,
|
|
181
176
|
hasClient: !!m,
|
|
182
177
|
isConnected: u,
|
|
@@ -190,7 +185,7 @@ const Yt = Ge({
|
|
|
190
185
|
isLoading: c,
|
|
191
186
|
error: p,
|
|
192
187
|
capabilities: r,
|
|
193
|
-
refreshConnection:
|
|
188
|
+
refreshConnection: A,
|
|
194
189
|
debug: i
|
|
195
190
|
}), [
|
|
196
191
|
l,
|
|
@@ -199,27 +194,27 @@ const Yt = Ge({
|
|
|
199
194
|
c,
|
|
200
195
|
p,
|
|
201
196
|
r,
|
|
202
|
-
|
|
197
|
+
A,
|
|
203
198
|
i,
|
|
204
199
|
o
|
|
205
200
|
]);
|
|
206
201
|
return o("🔄 RENDER END", {
|
|
207
|
-
renderCount:
|
|
208
|
-
willRenderChat: !!
|
|
209
|
-
contextValueReady: !!
|
|
210
|
-
}), /* @__PURE__ */ n(Yt.Provider, { value:
|
|
211
|
-
|
|
202
|
+
renderCount: I.current,
|
|
203
|
+
willRenderChat: !!T,
|
|
204
|
+
contextValueReady: !!R
|
|
205
|
+
}), /* @__PURE__ */ n(Yt.Provider, { value: R, children: T ? /* @__PURE__ */ n(
|
|
206
|
+
Tn,
|
|
212
207
|
{
|
|
213
|
-
client:
|
|
208
|
+
client: T,
|
|
214
209
|
customClasses: {
|
|
215
210
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
216
211
|
},
|
|
217
212
|
children: e
|
|
218
213
|
}
|
|
219
214
|
) : e });
|
|
220
|
-
},
|
|
215
|
+
}, Os = () => qe(), qt = (e) => {
|
|
221
216
|
var a, r;
|
|
222
|
-
const [t, s] =
|
|
217
|
+
const [t, s] = O(
|
|
223
218
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
224
219
|
);
|
|
225
220
|
return Y(() => {
|
|
@@ -239,13 +234,13 @@ const Yt = Ge({
|
|
|
239
234
|
e.off("member.updated", i);
|
|
240
235
|
};
|
|
241
236
|
}, [e]), t;
|
|
242
|
-
},
|
|
243
|
-
function
|
|
244
|
-
return
|
|
237
|
+
}, zs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
238
|
+
function $s(e) {
|
|
239
|
+
return zs.test(e.trim());
|
|
245
240
|
}
|
|
246
241
|
function Lt(e, t) {
|
|
247
242
|
const s = e == null ? void 0 : e.trim();
|
|
248
|
-
return !s || t && s === t ? !1 :
|
|
243
|
+
return !s || t && s === t ? !1 : !$s(s);
|
|
249
244
|
}
|
|
250
245
|
function Wt(e) {
|
|
251
246
|
return Lt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Lt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
|
|
@@ -278,7 +273,7 @@ const Dt = [
|
|
|
278
273
|
"🍈"
|
|
279
274
|
// Melon
|
|
280
275
|
];
|
|
281
|
-
function
|
|
276
|
+
function Fs(e) {
|
|
282
277
|
let t = 0;
|
|
283
278
|
for (let s = 0; s < e.length; s++) {
|
|
284
279
|
const a = e.charCodeAt(s);
|
|
@@ -286,8 +281,8 @@ function $s(e) {
|
|
|
286
281
|
}
|
|
287
282
|
return Math.abs(t);
|
|
288
283
|
}
|
|
289
|
-
function
|
|
290
|
-
const s =
|
|
284
|
+
function Bs(e) {
|
|
285
|
+
const s = Fs(e) % Dt.length;
|
|
291
286
|
return Dt[s];
|
|
292
287
|
}
|
|
293
288
|
const ae = ({
|
|
@@ -299,7 +294,7 @@ const ae = ({
|
|
|
299
294
|
shape: i = "squircle",
|
|
300
295
|
dmAgentEnabled: o = !1
|
|
301
296
|
}) => {
|
|
302
|
-
const l =
|
|
297
|
+
const l = Bs(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", b = 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(
|
|
303
298
|
"img",
|
|
304
299
|
{
|
|
305
300
|
src: t,
|
|
@@ -361,7 +356,7 @@ const ae = ({
|
|
|
361
356
|
]
|
|
362
357
|
}
|
|
363
358
|
);
|
|
364
|
-
},
|
|
359
|
+
}, Us = "https://linktr.ee/s/about/trust-center/report", js = ({
|
|
365
360
|
channel: e,
|
|
366
361
|
participant: t,
|
|
367
362
|
showBlockParticipant: s = !0,
|
|
@@ -374,78 +369,78 @@ const ae = ({
|
|
|
374
369
|
onActionComplete: m,
|
|
375
370
|
logLabel: b = "useChannelModerationActions"
|
|
376
371
|
}) => {
|
|
377
|
-
var
|
|
378
|
-
const { service: u, debug: f } = qe(), c = (
|
|
372
|
+
var P;
|
|
373
|
+
const { service: u, debug: f } = qe(), c = (P = t == null ? void 0 : t.user) == null ? void 0 : P.id, g = !!(a && s && u && c), [p, v] = O(!1), [N, _] = O(null), [E, I] = O(!1), [T, L] = O(!1), A = g && ((N == null ? void 0 : N.participantId) !== c || (N == null ? void 0 : N.service) !== u);
|
|
379
374
|
return Y(() => {
|
|
380
375
|
if (!g || !u || !c) {
|
|
381
|
-
v(!1),
|
|
376
|
+
v(!1), _(null);
|
|
382
377
|
return;
|
|
383
378
|
}
|
|
384
|
-
let
|
|
379
|
+
let S = !1;
|
|
385
380
|
return (async () => {
|
|
386
381
|
try {
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
382
|
+
const D = await u.getBlockedUsers();
|
|
383
|
+
if (S) return;
|
|
389
384
|
v(
|
|
390
|
-
|
|
391
|
-
(
|
|
385
|
+
D.some(
|
|
386
|
+
($) => $.blocked_user_id === c
|
|
392
387
|
)
|
|
393
388
|
);
|
|
394
|
-
} catch (
|
|
395
|
-
|
|
389
|
+
} catch (D) {
|
|
390
|
+
S || console.error(`[${b}] Failed to check blocked status:`, D);
|
|
396
391
|
} finally {
|
|
397
|
-
|
|
392
|
+
S || _({ participantId: c, service: u });
|
|
398
393
|
}
|
|
399
394
|
})(), () => {
|
|
400
|
-
|
|
395
|
+
S = !0;
|
|
401
396
|
};
|
|
402
397
|
}, [g, u, c, b]), {
|
|
403
398
|
isParticipantBlocked: p,
|
|
404
|
-
isCheckingBlockedStatus:
|
|
405
|
-
isLeaving:
|
|
406
|
-
isUpdatingBlockStatus:
|
|
399
|
+
isCheckingBlockedStatus: A,
|
|
400
|
+
isLeaving: E,
|
|
401
|
+
isUpdatingBlockStatus: T,
|
|
407
402
|
handleLeaveConversation: async () => {
|
|
408
|
-
var
|
|
409
|
-
if (!
|
|
410
|
-
o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid),
|
|
403
|
+
var S;
|
|
404
|
+
if (!E) {
|
|
405
|
+
o == null || o(), f && console.log(`[${b}] Leave conversation`, e.cid), I(!0);
|
|
411
406
|
try {
|
|
412
|
-
const
|
|
413
|
-
await e.hide(
|
|
414
|
-
} catch (
|
|
415
|
-
console.error(`[${b}] Failed to leave conversation`,
|
|
407
|
+
const D = ((S = e._client) == null ? void 0 : S.userID) ?? null;
|
|
408
|
+
await e.hide(D, !1), r && await r(e), m == null || m();
|
|
409
|
+
} catch (D) {
|
|
410
|
+
console.error(`[${b}] Failed to leave conversation`, D);
|
|
416
411
|
} finally {
|
|
417
|
-
|
|
412
|
+
I(!1);
|
|
418
413
|
}
|
|
419
414
|
}
|
|
420
415
|
},
|
|
421
416
|
handleBlockUser: async () => {
|
|
422
|
-
var
|
|
423
|
-
if (!(
|
|
424
|
-
l == null || l(), f && console.log(`[${b}] Block member`, (
|
|
417
|
+
var S, D, $;
|
|
418
|
+
if (!(T || !u)) {
|
|
419
|
+
l == null || l(), f && console.log(`[${b}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
|
|
425
420
|
try {
|
|
426
|
-
await u.blockUser((
|
|
421
|
+
await u.blockUser((D = t == null ? void 0 : t.user) == null ? void 0 : D.id), i && await i(($ = t == null ? void 0 : t.user) == null ? void 0 : $.id), m == null || m();
|
|
427
422
|
} catch (V) {
|
|
428
423
|
console.error(`[${b}] Failed to block member`, V);
|
|
429
424
|
} finally {
|
|
430
|
-
|
|
425
|
+
L(!1);
|
|
431
426
|
}
|
|
432
427
|
}
|
|
433
428
|
},
|
|
434
429
|
handleUnblockUser: async () => {
|
|
435
|
-
var
|
|
436
|
-
if (!(
|
|
437
|
-
l == null || l(), f && console.log(`[${b}] Unblock member`, (
|
|
430
|
+
var S, D, $;
|
|
431
|
+
if (!(T || !u)) {
|
|
432
|
+
l == null || l(), f && console.log(`[${b}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
|
|
438
433
|
try {
|
|
439
|
-
await u.unBlockUser((
|
|
434
|
+
await u.unBlockUser((D = t == null ? void 0 : t.user) == null ? void 0 : D.id), i && await i(($ = t == null ? void 0 : t.user) == null ? void 0 : $.id), m == null || m();
|
|
440
435
|
} catch (V) {
|
|
441
436
|
console.error(`[${b}] Failed to unblock member`, V);
|
|
442
437
|
} finally {
|
|
443
|
-
|
|
438
|
+
L(!1);
|
|
444
439
|
}
|
|
445
440
|
}
|
|
446
441
|
},
|
|
447
442
|
handleReportUser: () => {
|
|
448
|
-
d == null || d(), m == null || m(), window.open(
|
|
443
|
+
d == null || d(), m == null || m(), window.open(Us, "_blank", "noopener,noreferrer");
|
|
449
444
|
}
|
|
450
445
|
};
|
|
451
446
|
}, he = ({
|
|
@@ -479,16 +474,16 @@ const ae = ({
|
|
|
479
474
|
customChannelActions: b,
|
|
480
475
|
triggerClassName: u
|
|
481
476
|
}) => {
|
|
482
|
-
const [f, c] =
|
|
483
|
-
isParticipantBlocked:
|
|
484
|
-
isCheckingBlockedStatus:
|
|
485
|
-
isLeaving:
|
|
486
|
-
isUpdatingBlockStatus:
|
|
487
|
-
handleLeaveConversation:
|
|
488
|
-
handleBlockUser:
|
|
489
|
-
handleUnblockUser:
|
|
490
|
-
handleReportUser:
|
|
491
|
-
} =
|
|
477
|
+
const [f, c] = O(!1), g = H(null), p = En(), v = W(() => c(!1), []), {
|
|
478
|
+
isParticipantBlocked: N,
|
|
479
|
+
isCheckingBlockedStatus: _,
|
|
480
|
+
isLeaving: E,
|
|
481
|
+
isUpdatingBlockStatus: I,
|
|
482
|
+
handleLeaveConversation: T,
|
|
483
|
+
handleBlockUser: L,
|
|
484
|
+
handleUnblockUser: A,
|
|
485
|
+
handleReportUser: R
|
|
486
|
+
} = js({
|
|
492
487
|
channel: e,
|
|
493
488
|
participant: t,
|
|
494
489
|
showBlockParticipant: a,
|
|
@@ -503,13 +498,13 @@ const ae = ({
|
|
|
503
498
|
});
|
|
504
499
|
return Y(() => {
|
|
505
500
|
if (!f) return;
|
|
506
|
-
const
|
|
507
|
-
g.current && !g.current.contains(
|
|
508
|
-
},
|
|
509
|
-
|
|
501
|
+
const C = (P) => {
|
|
502
|
+
g.current && !g.current.contains(P.target) && c(!1);
|
|
503
|
+
}, M = (P) => {
|
|
504
|
+
P.key === "Escape" && c(!1);
|
|
510
505
|
};
|
|
511
|
-
return document.addEventListener("mousedown",
|
|
512
|
-
document.removeEventListener("mousedown",
|
|
506
|
+
return document.addEventListener("mousedown", C), document.addEventListener("keydown", M), () => {
|
|
507
|
+
document.removeEventListener("mousedown", C), document.removeEventListener("keydown", M);
|
|
513
508
|
};
|
|
514
509
|
}, [f]), !t || !(s || a || r || !!b) ? null : /* @__PURE__ */ h("div", { ref: g, className: "relative", children: [
|
|
515
510
|
/* @__PURE__ */ h(
|
|
@@ -520,9 +515,9 @@ const ae = ({
|
|
|
520
515
|
"aria-haspopup": "true",
|
|
521
516
|
"aria-expanded": f,
|
|
522
517
|
"aria-controls": f ? p : void 0,
|
|
523
|
-
onClick: () => c((
|
|
518
|
+
onClick: () => c((C) => !C),
|
|
524
519
|
children: [
|
|
525
|
-
/* @__PURE__ */ n(
|
|
520
|
+
/* @__PURE__ */ n(ms, { className: "size-5 text-black/90" }),
|
|
526
521
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
527
522
|
]
|
|
528
523
|
}
|
|
@@ -540,46 +535,46 @@ const ae = ({
|
|
|
540
535
|
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
|
|
541
536
|
he,
|
|
542
537
|
{
|
|
543
|
-
onClick:
|
|
544
|
-
disabled:
|
|
545
|
-
"aria-busy":
|
|
538
|
+
onClick: T,
|
|
539
|
+
disabled: E,
|
|
540
|
+
"aria-busy": E,
|
|
546
541
|
children: [
|
|
547
|
-
|
|
542
|
+
E ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(hs, { className: "h-5 w-5" }),
|
|
548
543
|
/* @__PURE__ */ n("span", { children: "Delete Conversation" })
|
|
549
544
|
]
|
|
550
545
|
}
|
|
551
546
|
) }),
|
|
552
|
-
a && /* @__PURE__ */ n("li", { children:
|
|
547
|
+
a && /* @__PURE__ */ n("li", { children: _ ? (
|
|
553
548
|
// Block status not yet resolved — show a disabled placeholder
|
|
554
549
|
// so a premature click can't act on a stale block state.
|
|
555
550
|
/* @__PURE__ */ h(he, { disabled: !0, "aria-busy": !0, children: [
|
|
556
551
|
/* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }),
|
|
557
552
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
558
553
|
] })
|
|
559
|
-
) :
|
|
554
|
+
) : N ? /* @__PURE__ */ h(
|
|
560
555
|
he,
|
|
561
556
|
{
|
|
562
|
-
onClick:
|
|
563
|
-
disabled:
|
|
564
|
-
"aria-busy":
|
|
557
|
+
onClick: A,
|
|
558
|
+
disabled: I,
|
|
559
|
+
"aria-busy": I,
|
|
565
560
|
children: [
|
|
566
|
-
|
|
561
|
+
I ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
567
562
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
568
563
|
]
|
|
569
564
|
}
|
|
570
565
|
) : /* @__PURE__ */ h(
|
|
571
566
|
he,
|
|
572
567
|
{
|
|
573
|
-
onClick:
|
|
574
|
-
disabled:
|
|
575
|
-
"aria-busy":
|
|
568
|
+
onClick: L,
|
|
569
|
+
disabled: I,
|
|
570
|
+
"aria-busy": I,
|
|
576
571
|
children: [
|
|
577
|
-
|
|
572
|
+
I ? /* @__PURE__ */ n(Ce, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Mt, { className: "h-5 w-5" }),
|
|
578
573
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
579
574
|
]
|
|
580
575
|
}
|
|
581
576
|
) }),
|
|
582
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick:
|
|
577
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(he, { variant: "danger", onClick: R, children: [
|
|
583
578
|
/* @__PURE__ */ n(jt, { className: "h-5 w-5" }),
|
|
584
579
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
585
580
|
] }) }),
|
|
@@ -588,13 +583,13 @@ const ae = ({
|
|
|
588
583
|
}
|
|
589
584
|
)
|
|
590
585
|
] });
|
|
591
|
-
},
|
|
592
|
-
function
|
|
586
|
+
}, Vs = (e) => /* @__PURE__ */ n(An, { ...e, position: "center" }), je = "vote_up", Ve = "vote_down";
|
|
587
|
+
function Gs(e) {
|
|
593
588
|
return e != null && e.length ? e.some((t) => t.type === Ve) ? "down" : e.some((t) => t.type === je) ? "up" : null : null;
|
|
594
589
|
}
|
|
595
|
-
function
|
|
590
|
+
function Hs(e) {
|
|
596
591
|
const { channel: t } = ce(), { client: s } = Ye("useMessageVote"), a = ee(
|
|
597
|
-
() =>
|
|
592
|
+
() => Gs(e.own_reactions),
|
|
598
593
|
[e.own_reactions]
|
|
599
594
|
), r = W(async () => {
|
|
600
595
|
if (s != null && s.userID)
|
|
@@ -619,7 +614,7 @@ function Gs(e) {
|
|
|
619
614
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
620
615
|
return { selected: a, voteUp: r, voteDown: i };
|
|
621
616
|
}
|
|
622
|
-
function
|
|
617
|
+
function Ys(e) {
|
|
623
618
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
624
619
|
}
|
|
625
620
|
function Xt({
|
|
@@ -627,16 +622,16 @@ function Xt({
|
|
|
627
622
|
viewerLanguage: t
|
|
628
623
|
}) {
|
|
629
624
|
var r;
|
|
630
|
-
const s = e == null ? void 0 : e.text, a =
|
|
625
|
+
const s = e == null ? void 0 : e.text, a = Ys(t);
|
|
631
626
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
632
627
|
}
|
|
633
|
-
const
|
|
628
|
+
const qs = F.lazy(() => import("./Card-BmU_ztmU.js")), Ws = F.lazy(() => import("./Card-CHDQEG9i.js")), Xs = F.lazy(() => import("./Card-D-sSG334.js")), We = () => /* @__PURE__ */ n(
|
|
634
629
|
"div",
|
|
635
630
|
{
|
|
636
631
|
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)]",
|
|
637
632
|
"aria-hidden": !0
|
|
638
633
|
}
|
|
639
|
-
),
|
|
634
|
+
), Js = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Ws, { ...e }) }), Kt = (e) => /* @__PURE__ */ n(He, { fallback: /* @__PURE__ */ n(We, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Ks = Jt, Zs = Kt, Ot = { Composer: Js, Sent: Jt, Received: Kt, Creator: Ks, Visitor: Zs }, Qs = [
|
|
640
635
|
[/pdf/, "pdf"],
|
|
641
636
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
642
637
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -650,38 +645,38 @@ function ne(e) {
|
|
|
650
645
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
651
646
|
}
|
|
652
647
|
function Zt(e) {
|
|
653
|
-
const t =
|
|
648
|
+
const t = Qs.find(
|
|
654
649
|
([s]) => s.test(e)
|
|
655
650
|
);
|
|
656
651
|
return t ? t[1] : "generic";
|
|
657
652
|
}
|
|
658
|
-
const
|
|
653
|
+
const ea = {
|
|
659
654
|
video: Gt,
|
|
660
|
-
audio:
|
|
661
|
-
image:
|
|
655
|
+
audio: gs,
|
|
656
|
+
image: fs,
|
|
662
657
|
document: Vt
|
|
663
|
-
},
|
|
664
|
-
pdf:
|
|
665
|
-
doc:
|
|
666
|
-
xls:
|
|
667
|
-
csv:
|
|
668
|
-
ppt:
|
|
669
|
-
zip:
|
|
670
|
-
text:
|
|
671
|
-
markdown:
|
|
658
|
+
}, ta = {
|
|
659
|
+
pdf: ys,
|
|
660
|
+
doc: Ns,
|
|
661
|
+
xls: _s,
|
|
662
|
+
csv: ws,
|
|
663
|
+
ppt: xs,
|
|
664
|
+
zip: vs,
|
|
665
|
+
text: ps,
|
|
666
|
+
markdown: bs,
|
|
672
667
|
generic: Vt
|
|
673
668
|
};
|
|
674
|
-
function
|
|
669
|
+
function na(e) {
|
|
675
670
|
const t = ne(e);
|
|
676
|
-
return t !== "document" ?
|
|
671
|
+
return t !== "document" ? ea[t] : ta[Zt(e)];
|
|
677
672
|
}
|
|
678
673
|
function le(e, t) {
|
|
679
|
-
return
|
|
674
|
+
return F.createElement(na(e), t);
|
|
680
675
|
}
|
|
681
|
-
const
|
|
676
|
+
const sa = (e) => {
|
|
682
677
|
var t, s;
|
|
683
678
|
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;
|
|
684
|
-
},
|
|
679
|
+
}, aa = ({
|
|
685
680
|
source: e,
|
|
686
681
|
mimeType: t,
|
|
687
682
|
poster: s,
|
|
@@ -693,23 +688,23 @@ const na = (e) => {
|
|
|
693
688
|
muted: d = !1,
|
|
694
689
|
onContainerClick: m
|
|
695
690
|
}) => {
|
|
696
|
-
const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [p, v] =
|
|
697
|
-
|
|
698
|
-
}, []), V = W((
|
|
699
|
-
const
|
|
700
|
-
if (!
|
|
701
|
-
const j =
|
|
691
|
+
const b = ne(t), u = H(null), f = H(null), c = H(null), g = H(r), [p, v] = O(a), [N, _] = O(0), [E, I] = O(!1), [T, L] = O(!1), [A, R] = O(!1), [w, C] = O(!1), [M, P] = O(!0), [S, D] = O(null), $ = W(() => {
|
|
692
|
+
R(!1), v(!0);
|
|
693
|
+
}, []), V = W((x) => {
|
|
694
|
+
const k = f.current;
|
|
695
|
+
if (!k) return 0;
|
|
696
|
+
const j = k.getBoundingClientRect();
|
|
702
697
|
return Math.max(
|
|
703
698
|
0,
|
|
704
|
-
Math.min(1, (
|
|
699
|
+
Math.min(1, (sa(x) - j.left) / j.width)
|
|
705
700
|
);
|
|
706
|
-
}, []), B = W((
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
}, []), U = (
|
|
710
|
-
|
|
711
|
-
const
|
|
712
|
-
|
|
701
|
+
}, []), B = W((x) => {
|
|
702
|
+
const k = u.current;
|
|
703
|
+
k && k.duration && (k.currentTime = x * k.duration);
|
|
704
|
+
}, []), U = (x) => {
|
|
705
|
+
x.stopPropagation(), I(!0);
|
|
706
|
+
const k = V(x);
|
|
707
|
+
_(k), B(k);
|
|
713
708
|
};
|
|
714
709
|
Y(() => {
|
|
715
710
|
r !== void 0 && r !== g.current && (g.current = r, v(r));
|
|
@@ -718,28 +713,28 @@ const na = (e) => {
|
|
|
718
713
|
c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
|
|
719
714
|
return;
|
|
720
715
|
}
|
|
721
|
-
const
|
|
722
|
-
const
|
|
723
|
-
|
|
716
|
+
const x = () => {
|
|
717
|
+
const k = u.current;
|
|
718
|
+
k && k.duration && !E && _(k.currentTime / k.duration), c.current = requestAnimationFrame(x);
|
|
724
719
|
};
|
|
725
|
-
return c.current = requestAnimationFrame(
|
|
720
|
+
return c.current = requestAnimationFrame(x), () => {
|
|
726
721
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
727
722
|
};
|
|
728
|
-
}, [p,
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
v(!1),
|
|
732
|
-
}) :
|
|
723
|
+
}, [p, E]), Y(() => {
|
|
724
|
+
const x = u.current;
|
|
725
|
+
x && (p ? x.play().catch((k) => {
|
|
726
|
+
v(!1), R(!0);
|
|
727
|
+
}) : x.pause());
|
|
733
728
|
}, [p]), Y(() => {
|
|
734
|
-
if (!
|
|
735
|
-
const
|
|
736
|
-
|
|
729
|
+
if (!E) return;
|
|
730
|
+
const x = (j) => _(V(j)), k = (j) => {
|
|
731
|
+
I(!1), B(V(j));
|
|
737
732
|
};
|
|
738
|
-
return window.addEventListener("mousemove",
|
|
739
|
-
window.removeEventListener("mousemove",
|
|
733
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", k), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", k), () => {
|
|
734
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", k);
|
|
740
735
|
};
|
|
741
|
-
}, [
|
|
742
|
-
const X =
|
|
736
|
+
}, [E, V, B]);
|
|
737
|
+
const X = S ? { aspectRatio: String(S) } : void 0, G = S ? "" : " aspect-video", z = Math.round(N * 100);
|
|
743
738
|
return /* @__PURE__ */ h(
|
|
744
739
|
"div",
|
|
745
740
|
{
|
|
@@ -747,24 +742,24 @@ const na = (e) => {
|
|
|
747
742
|
tabIndex: 0,
|
|
748
743
|
className: `relative cursor-pointer overflow-hidden bg-black ${G}`,
|
|
749
744
|
style: X,
|
|
750
|
-
onClick: (
|
|
745
|
+
onClick: (x) => {
|
|
751
746
|
if (m) {
|
|
752
|
-
m(
|
|
747
|
+
m(x);
|
|
753
748
|
return;
|
|
754
749
|
}
|
|
755
|
-
|
|
750
|
+
A || o && v((k) => !k);
|
|
756
751
|
},
|
|
757
|
-
onKeyDown: (
|
|
758
|
-
if (!(
|
|
759
|
-
if (
|
|
760
|
-
m(
|
|
752
|
+
onKeyDown: (x) => {
|
|
753
|
+
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
754
|
+
if (x.preventDefault(), m) {
|
|
755
|
+
m(x);
|
|
761
756
|
return;
|
|
762
757
|
}
|
|
763
|
-
|
|
758
|
+
A || o && v((k) => !k);
|
|
764
759
|
}
|
|
765
760
|
},
|
|
766
761
|
children: [
|
|
767
|
-
s && (b === "audio" ||
|
|
762
|
+
s && (b === "audio" || M) && /* @__PURE__ */ n(
|
|
768
763
|
"img",
|
|
769
764
|
{
|
|
770
765
|
src: s,
|
|
@@ -772,7 +767,7 @@ const na = (e) => {
|
|
|
772
767
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
773
768
|
}
|
|
774
769
|
),
|
|
775
|
-
!s && (b === "audio" ||
|
|
770
|
+
!s && (b === "audio" || M) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
|
|
776
771
|
className: "size-12 text-black/20",
|
|
777
772
|
weight: "regular"
|
|
778
773
|
}) }),
|
|
@@ -784,14 +779,14 @@ const na = (e) => {
|
|
|
784
779
|
loop: i,
|
|
785
780
|
muted: d,
|
|
786
781
|
style: { width: "100%", height: "100%" },
|
|
787
|
-
onLoadStart: () =>
|
|
782
|
+
onLoadStart: () => C(!0),
|
|
788
783
|
onCanPlay: () => {
|
|
789
|
-
|
|
784
|
+
C(!1), P(!1);
|
|
790
785
|
},
|
|
791
|
-
onWaiting: () =>
|
|
792
|
-
onPlay: () =>
|
|
786
|
+
onWaiting: () => C(!0),
|
|
787
|
+
onPlay: () => R(!1),
|
|
793
788
|
onEnded: () => {
|
|
794
|
-
i || (v(!1),
|
|
789
|
+
i || (v(!1), _(0));
|
|
795
790
|
},
|
|
796
791
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
797
792
|
}
|
|
@@ -804,41 +799,41 @@ const na = (e) => {
|
|
|
804
799
|
muted: d,
|
|
805
800
|
playsInline: !0,
|
|
806
801
|
style: { width: "100%", height: "100%" },
|
|
807
|
-
onLoadStart: () =>
|
|
802
|
+
onLoadStart: () => C(!0),
|
|
808
803
|
onCanPlay: () => {
|
|
809
|
-
|
|
804
|
+
C(!1), P(!1);
|
|
810
805
|
},
|
|
811
|
-
onWaiting: () =>
|
|
812
|
-
onPlay: () =>
|
|
806
|
+
onWaiting: () => C(!0),
|
|
807
|
+
onPlay: () => R(!1),
|
|
813
808
|
onLoadedMetadata: () => {
|
|
814
|
-
const
|
|
815
|
-
|
|
809
|
+
const x = u.current;
|
|
810
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && D(x.videoWidth / x.videoHeight);
|
|
816
811
|
},
|
|
817
812
|
onEnded: () => {
|
|
818
|
-
i || (v(!1),
|
|
813
|
+
i || (v(!1), _(0));
|
|
819
814
|
},
|
|
820
815
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
821
816
|
}
|
|
822
817
|
) }),
|
|
823
|
-
|
|
818
|
+
w && !A && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
824
819
|
ge,
|
|
825
820
|
{
|
|
826
821
|
className: "size-8 animate-spin text-white/80",
|
|
827
822
|
weight: "bold"
|
|
828
823
|
}
|
|
829
824
|
) }),
|
|
830
|
-
|
|
825
|
+
A && !o && /* @__PURE__ */ n(
|
|
831
826
|
"div",
|
|
832
827
|
{
|
|
833
828
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
834
829
|
role: "button",
|
|
835
830
|
tabIndex: 0,
|
|
836
831
|
"aria-label": "Play preview",
|
|
837
|
-
onClick: (
|
|
838
|
-
|
|
832
|
+
onClick: (x) => {
|
|
833
|
+
x.stopPropagation(), $();
|
|
839
834
|
},
|
|
840
|
-
onKeyDown: (
|
|
841
|
-
|
|
835
|
+
onKeyDown: (x) => {
|
|
836
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), $());
|
|
842
837
|
},
|
|
843
838
|
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(Be, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
844
839
|
}
|
|
@@ -848,7 +843,7 @@ const na = (e) => {
|
|
|
848
843
|
{
|
|
849
844
|
role: "slider",
|
|
850
845
|
"aria-label": "Playback position",
|
|
851
|
-
"aria-valuenow":
|
|
846
|
+
"aria-valuenow": z,
|
|
852
847
|
"aria-valuemin": 0,
|
|
853
848
|
"aria-valuemax": 100,
|
|
854
849
|
tabIndex: 0,
|
|
@@ -856,15 +851,15 @@ const na = (e) => {
|
|
|
856
851
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
857
852
|
onMouseDown: U,
|
|
858
853
|
onTouchStart: U,
|
|
859
|
-
onClick: (
|
|
860
|
-
onKeyDown: (
|
|
861
|
-
|
|
854
|
+
onClick: (x) => x.stopPropagation(),
|
|
855
|
+
onKeyDown: (x) => {
|
|
856
|
+
x.key === "ArrowRight" && B(Math.min(1, N + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, N - 0.05));
|
|
862
857
|
},
|
|
863
858
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
864
859
|
"div",
|
|
865
860
|
{
|
|
866
861
|
className: "h-full rounded-full bg-white",
|
|
867
|
-
style: { width: `${
|
|
862
|
+
style: { width: `${z}%` }
|
|
868
863
|
}
|
|
869
864
|
) })
|
|
870
865
|
}
|
|
@@ -874,12 +869,12 @@ const na = (e) => {
|
|
|
874
869
|
"button",
|
|
875
870
|
{
|
|
876
871
|
type: "button",
|
|
877
|
-
onClick: (
|
|
878
|
-
|
|
872
|
+
onClick: (x) => {
|
|
873
|
+
x.stopPropagation(), v((k) => !k);
|
|
879
874
|
},
|
|
880
875
|
className: "shrink-0 text-white",
|
|
881
876
|
"aria-label": p ? "Pause" : "Play",
|
|
882
|
-
children: p ? /* @__PURE__ */ n(
|
|
877
|
+
children: p ? /* @__PURE__ */ n(Cs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Be, { className: "size-5 translate-x-px", weight: "fill" })
|
|
883
878
|
}
|
|
884
879
|
),
|
|
885
880
|
/* @__PURE__ */ h(
|
|
@@ -887,7 +882,7 @@ const na = (e) => {
|
|
|
887
882
|
{
|
|
888
883
|
role: "slider",
|
|
889
884
|
"aria-label": "Playback position",
|
|
890
|
-
"aria-valuenow":
|
|
885
|
+
"aria-valuenow": z,
|
|
891
886
|
"aria-valuemin": 0,
|
|
892
887
|
"aria-valuemax": 100,
|
|
893
888
|
tabIndex: 0,
|
|
@@ -895,22 +890,22 @@ const na = (e) => {
|
|
|
895
890
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
896
891
|
onMouseDown: U,
|
|
897
892
|
onTouchStart: U,
|
|
898
|
-
onClick: (
|
|
899
|
-
onMouseEnter: () =>
|
|
900
|
-
onMouseLeave: () =>
|
|
901
|
-
onKeyDown: (
|
|
902
|
-
|
|
893
|
+
onClick: (x) => x.stopPropagation(),
|
|
894
|
+
onMouseEnter: () => L(!0),
|
|
895
|
+
onMouseLeave: () => L(!1),
|
|
896
|
+
onKeyDown: (x) => {
|
|
897
|
+
x.key === "ArrowRight" && B(Math.min(1, N + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, N - 0.05));
|
|
903
898
|
},
|
|
904
899
|
children: [
|
|
905
900
|
/* @__PURE__ */ n(
|
|
906
901
|
"div",
|
|
907
902
|
{
|
|
908
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
903
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || E ? "h-1.5" : "h-1"}`,
|
|
909
904
|
children: /* @__PURE__ */ n(
|
|
910
905
|
"div",
|
|
911
906
|
{
|
|
912
907
|
className: "h-full rounded-full bg-white",
|
|
913
|
-
style: { width: `${
|
|
908
|
+
style: { width: `${z}%` }
|
|
914
909
|
}
|
|
915
910
|
)
|
|
916
911
|
}
|
|
@@ -918,8 +913,8 @@ const na = (e) => {
|
|
|
918
913
|
/* @__PURE__ */ n(
|
|
919
914
|
"div",
|
|
920
915
|
{
|
|
921
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
922
|
-
style: { left: `${
|
|
916
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || E ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
917
|
+
style: { left: `${z}%` }
|
|
923
918
|
}
|
|
924
919
|
)
|
|
925
920
|
]
|
|
@@ -929,7 +924,7 @@ const na = (e) => {
|
|
|
929
924
|
]
|
|
930
925
|
}
|
|
931
926
|
);
|
|
932
|
-
}, zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20",
|
|
927
|
+
}, zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", ra = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Qt = ({
|
|
933
928
|
mimeType: e,
|
|
934
929
|
sourceUrl: t,
|
|
935
930
|
thumbnailUrl: s,
|
|
@@ -938,9 +933,9 @@ const na = (e) => {
|
|
|
938
933
|
mediaPlayerProps: i,
|
|
939
934
|
containedImage: o = !1
|
|
940
935
|
}) => {
|
|
941
|
-
const l = ne(e), [d, m] =
|
|
936
|
+
const l = ne(e), [d, m] = O(!1);
|
|
942
937
|
return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
|
|
943
|
-
|
|
938
|
+
aa,
|
|
944
939
|
{
|
|
945
940
|
source: t,
|
|
946
941
|
mimeType: e,
|
|
@@ -991,7 +986,7 @@ const na = (e) => {
|
|
|
991
986
|
weight: "regular"
|
|
992
987
|
})
|
|
993
988
|
}
|
|
994
|
-
) : s ? /* @__PURE__ */ n("div", { className: `relative ${
|
|
989
|
+
) : s ? /* @__PURE__ */ n("div", { className: `relative ${ra(r)}`, children: /* @__PURE__ */ n(
|
|
995
990
|
"img",
|
|
996
991
|
{
|
|
997
992
|
src: s,
|
|
@@ -1081,23 +1076,23 @@ function tn(e) {
|
|
|
1081
1076
|
function Xe(e) {
|
|
1082
1077
|
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)]`;
|
|
1083
1078
|
}
|
|
1084
|
-
function
|
|
1079
|
+
function ia(e) {
|
|
1085
1080
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1086
1081
|
}
|
|
1087
|
-
function
|
|
1082
|
+
function oa(e) {
|
|
1088
1083
|
return e ? "text-white" : "text-black";
|
|
1089
1084
|
}
|
|
1090
|
-
function
|
|
1085
|
+
function la(e) {
|
|
1091
1086
|
return e ? "text-white/55" : "text-black/55";
|
|
1092
1087
|
}
|
|
1093
|
-
function
|
|
1088
|
+
function ca(e) {
|
|
1094
1089
|
return e ? "text-white/40" : "text-black/40";
|
|
1095
1090
|
}
|
|
1096
|
-
function
|
|
1091
|
+
function da(e) {
|
|
1097
1092
|
return e ? "text-white/20" : "text-black/20";
|
|
1098
1093
|
}
|
|
1099
|
-
const
|
|
1100
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(
|
|
1094
|
+
const Je = ({ attachment: e, isMyMessage: t }) => {
|
|
1095
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, m = /* @__PURE__ */ h(F.Fragment, { children: [
|
|
1101
1096
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1102
1097
|
"img",
|
|
1103
1098
|
{
|
|
@@ -1108,14 +1103,14 @@ const Ke = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1108
1103
|
) : /* @__PURE__ */ n(
|
|
1109
1104
|
"div",
|
|
1110
1105
|
{
|
|
1111
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1112
|
-
children: /* @__PURE__ */ n(
|
|
1106
|
+
className: `aspect-video w-full rounded-[20px] ${ia(t)} flex items-center justify-center`,
|
|
1107
|
+
children: /* @__PURE__ */ n(ks, { className: `size-12 ${da(t)}` })
|
|
1113
1108
|
}
|
|
1114
1109
|
) }),
|
|
1115
1110
|
/* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
|
|
1116
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1117
|
-
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${
|
|
1118
|
-
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${
|
|
1111
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${oa(t)}`, children: s }),
|
|
1112
|
+
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${la(t)}`, children: a }),
|
|
1113
|
+
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ca(t)}`, children: d })
|
|
1119
1114
|
] })
|
|
1120
1115
|
] });
|
|
1121
1116
|
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 });
|
|
@@ -1123,11 +1118,11 @@ const Ke = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1123
1118
|
function nn(e) {
|
|
1124
1119
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1125
1120
|
}
|
|
1126
|
-
function
|
|
1121
|
+
function Ke(e) {
|
|
1127
1122
|
var t;
|
|
1128
1123
|
return (t = e.attachments) == null ? void 0 : t.find(nn);
|
|
1129
1124
|
}
|
|
1130
|
-
async function
|
|
1125
|
+
async function ua(e, t) {
|
|
1131
1126
|
let s;
|
|
1132
1127
|
try {
|
|
1133
1128
|
s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
|
|
@@ -1139,11 +1134,11 @@ async function da(e, t) {
|
|
|
1139
1134
|
const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
|
|
1140
1135
|
o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
|
|
1141
1136
|
}
|
|
1142
|
-
const
|
|
1137
|
+
const ma = ({
|
|
1143
1138
|
url: e,
|
|
1144
1139
|
filename: t
|
|
1145
1140
|
}) => {
|
|
1146
|
-
const [s, a] =
|
|
1141
|
+
const [s, a] = O(!1);
|
|
1147
1142
|
return /* @__PURE__ */ n(
|
|
1148
1143
|
"button",
|
|
1149
1144
|
{
|
|
@@ -1151,7 +1146,7 @@ const ua = ({
|
|
|
1151
1146
|
onClick: (i) => {
|
|
1152
1147
|
i.stopPropagation();
|
|
1153
1148
|
const o = window.open("", "_blank", "noopener,noreferrer");
|
|
1154
|
-
a(!0),
|
|
1149
|
+
a(!0), ua(e, t).then(() => {
|
|
1155
1150
|
o == null || o.close();
|
|
1156
1151
|
}).catch(() => {
|
|
1157
1152
|
o && (o.location.href = e);
|
|
@@ -1159,7 +1154,7 @@ const ua = ({
|
|
|
1159
1154
|
},
|
|
1160
1155
|
disabled: s,
|
|
1161
1156
|
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",
|
|
1162
|
-
children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(
|
|
1157
|
+
children: s ? /* @__PURE__ */ n(ge, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(F.Fragment, { children: [
|
|
1163
1158
|
/* @__PURE__ */ n(be, { className: "size-4 text-white", weight: "bold" }),
|
|
1164
1159
|
"Download"
|
|
1165
1160
|
] })
|
|
@@ -1241,14 +1236,14 @@ const sn = ({
|
|
|
1241
1236
|
containedImage: i === "image" || i === "document"
|
|
1242
1237
|
}
|
|
1243
1238
|
),
|
|
1244
|
-
action: /* @__PURE__ */ n(
|
|
1239
|
+
action: /* @__PURE__ */ n(ma, { url: e, filename: s })
|
|
1245
1240
|
}
|
|
1246
1241
|
);
|
|
1247
|
-
},
|
|
1242
|
+
}, ha = ({
|
|
1248
1243
|
message: e,
|
|
1249
1244
|
isMyMessage: t = !1
|
|
1250
1245
|
}) => {
|
|
1251
|
-
const s =
|
|
1246
|
+
const s = Ke(e), a = Ze(e);
|
|
1252
1247
|
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: [
|
|
1253
1248
|
!t && e.user && /* @__PURE__ */ n(
|
|
1254
1249
|
ae,
|
|
@@ -1269,40 +1264,40 @@ const sn = ({
|
|
|
1269
1264
|
{
|
|
1270
1265
|
className: "str-chat__message-bubble",
|
|
1271
1266
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1272
|
-
children: s ? /* @__PURE__ */ n("div", { className: Xe(t), children: /* @__PURE__ */ n(
|
|
1267
|
+
children: s ? /* @__PURE__ */ n("div", { className: Xe(t), children: /* @__PURE__ */ n(Je, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(sn, { ...a }) : /* @__PURE__ */ n(an, { ...a })
|
|
1273
1268
|
}
|
|
1274
1269
|
) })
|
|
1275
1270
|
}
|
|
1276
1271
|
)
|
|
1277
1272
|
] });
|
|
1278
|
-
},
|
|
1273
|
+
}, fa = ({
|
|
1279
1274
|
message: e
|
|
1280
1275
|
}) => {
|
|
1281
|
-
const t =
|
|
1276
|
+
const t = Ke(e);
|
|
1282
1277
|
if (t)
|
|
1283
|
-
return /* @__PURE__ */ n("div", { className: Xe(!0), children: /* @__PURE__ */ n(
|
|
1278
|
+
return /* @__PURE__ */ n("div", { className: Xe(!0), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !0 }) });
|
|
1284
1279
|
const s = Ze(e);
|
|
1285
1280
|
return s ? /* @__PURE__ */ n(sn, { ...s }) : null;
|
|
1286
|
-
},
|
|
1281
|
+
}, ga = ({
|
|
1287
1282
|
message: e
|
|
1288
1283
|
}) => {
|
|
1289
|
-
const t =
|
|
1284
|
+
const t = Ke(e);
|
|
1290
1285
|
if (t)
|
|
1291
|
-
return /* @__PURE__ */ n("div", { className: Xe(!1), children: /* @__PURE__ */ n(
|
|
1286
|
+
return /* @__PURE__ */ n("div", { className: Xe(!1), children: /* @__PURE__ */ n(Je, { attachment: t, isMyMessage: !1 }) });
|
|
1292
1287
|
const s = Ze(e);
|
|
1293
1288
|
return s ? /* @__PURE__ */ n(an, { ...s }) : null;
|
|
1294
|
-
},
|
|
1295
|
-
Creator:
|
|
1296
|
-
Visitor:
|
|
1297
|
-
}),
|
|
1289
|
+
}, yi = Object.assign(ha, {
|
|
1290
|
+
Creator: fa,
|
|
1291
|
+
Visitor: ga
|
|
1292
|
+
}), ba = {
|
|
1298
1293
|
isUnlocking: () => !1
|
|
1299
|
-
},
|
|
1300
|
-
LockedAttachment:
|
|
1301
|
-
}, rn = Ge({}),
|
|
1302
|
-
function
|
|
1303
|
-
return Te(rn)[e] ??
|
|
1294
|
+
}, pa = {
|
|
1295
|
+
LockedAttachment: ba
|
|
1296
|
+
}, rn = Ge({}), Ci = rn.Provider;
|
|
1297
|
+
function va(e) {
|
|
1298
|
+
return Te(rn)[e] ?? pa[e];
|
|
1304
1299
|
}
|
|
1305
|
-
const
|
|
1300
|
+
const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
1306
1301
|
"svg",
|
|
1307
1302
|
{
|
|
1308
1303
|
width: e,
|
|
@@ -1319,19 +1314,19 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1319
1314
|
}
|
|
1320
1315
|
)
|
|
1321
1316
|
}
|
|
1322
|
-
),
|
|
1317
|
+
), wa = (e) => {
|
|
1323
1318
|
var t;
|
|
1324
1319
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
1325
|
-
},
|
|
1320
|
+
}, _a = (e) => {
|
|
1326
1321
|
var t;
|
|
1327
1322
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
1328
1323
|
}, ke = (e) => {
|
|
1329
1324
|
var t;
|
|
1330
1325
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
1331
|
-
},
|
|
1326
|
+
}, Na = (e) => {
|
|
1332
1327
|
var t;
|
|
1333
1328
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
1334
|
-
}, on = (e) =>
|
|
1329
|
+
}, on = (e) => wa(e) || _a(e), ya = (e) => {
|
|
1335
1330
|
var t;
|
|
1336
1331
|
return on(e) && !((t = e.text) != null && t.trim());
|
|
1337
1332
|
}, Pe = ({
|
|
@@ -1349,7 +1344,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1349
1344
|
if (!f) return null;
|
|
1350
1345
|
const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", g = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
1351
1346
|
return /* @__PURE__ */ h("div", { className: c, children: [
|
|
1352
|
-
/* @__PURE__ */ n(
|
|
1347
|
+
/* @__PURE__ */ n(Es, { size: t ? 14 : 12 }),
|
|
1353
1348
|
/* @__PURE__ */ n("span", { children: g })
|
|
1354
1349
|
] });
|
|
1355
1350
|
}
|
|
@@ -1357,7 +1352,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1357
1352
|
"message-chatbot-indicator",
|
|
1358
1353
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
1359
1354
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
1360
|
-
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), b = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(
|
|
1355
|
+
].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), b = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(xa, { size: o ? 12 : 15 }) });
|
|
1361
1356
|
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(te, { children: [
|
|
1362
1357
|
m,
|
|
1363
1358
|
b
|
|
@@ -1365,7 +1360,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1365
1360
|
b,
|
|
1366
1361
|
m
|
|
1367
1362
|
] }) });
|
|
1368
|
-
},
|
|
1363
|
+
}, Ca = ({
|
|
1369
1364
|
selected: e,
|
|
1370
1365
|
onVoteUp: t,
|
|
1371
1366
|
onVoteDown: s
|
|
@@ -1381,7 +1376,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1381
1376
|
"aria-label": "Good response",
|
|
1382
1377
|
"aria-pressed": e === "up",
|
|
1383
1378
|
"data-tooltip": "Good response",
|
|
1384
|
-
children: /* @__PURE__ */ n(
|
|
1379
|
+
children: /* @__PURE__ */ n(Is, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1385
1380
|
}
|
|
1386
1381
|
),
|
|
1387
1382
|
/* @__PURE__ */ n(
|
|
@@ -1398,7 +1393,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1398
1393
|
children: /* @__PURE__ */ n(Ss, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1399
1394
|
}
|
|
1400
1395
|
)
|
|
1401
|
-
] }),
|
|
1396
|
+
] }), ka = (e) => {
|
|
1402
1397
|
var ht, ft, gt, bt, pt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et;
|
|
1403
1398
|
const {
|
|
1404
1399
|
additionalMessageInputProps: t,
|
|
@@ -1417,39 +1412,39 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1417
1412
|
renderText: g,
|
|
1418
1413
|
threadList: p,
|
|
1419
1414
|
viewerLanguage: v
|
|
1420
|
-
} = e, { client:
|
|
1421
|
-
Attachment:
|
|
1422
|
-
EditMessageModal:
|
|
1423
|
-
MessageActions:
|
|
1424
|
-
MessageBlocked: V =
|
|
1425
|
-
MessageBouncePrompt: B =
|
|
1426
|
-
MessageDeleted: U =
|
|
1427
|
-
MessageIsThreadReplyInChannelButtonIndicator: X =
|
|
1428
|
-
MessageRepliesCountButton: G =
|
|
1429
|
-
ReminderNotification:
|
|
1430
|
-
StreamedMessageText:
|
|
1431
|
-
PinIndicator:
|
|
1432
|
-
} = Ut("CustomMessage"), j =
|
|
1415
|
+
} = e, { client: N } = Ye("CustomMessage"), { channel: _ } = ce("CustomMessage"), { isUnlocking: E, onUnlockClick: I, onFetchSource: T, onDownloadClick: L } = va("LockedAttachment"), [A, R] = O(!1), w = Rn(c.id), { selected: C, voteUp: M, voteDown: P } = Hs(c), {
|
|
1416
|
+
Attachment: S = Ln,
|
|
1417
|
+
EditMessageModal: D = Dn,
|
|
1418
|
+
MessageActions: $,
|
|
1419
|
+
MessageBlocked: V = Pn,
|
|
1420
|
+
MessageBouncePrompt: B = On,
|
|
1421
|
+
MessageDeleted: U = zn,
|
|
1422
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = $n,
|
|
1423
|
+
MessageRepliesCountButton: G = Fn,
|
|
1424
|
+
ReminderNotification: z = Bn,
|
|
1425
|
+
StreamedMessageText: x = Un,
|
|
1426
|
+
PinIndicator: k
|
|
1427
|
+
} = Ut("CustomMessage"), j = jn(c), q = Vn(c), Ne = ee(
|
|
1433
1428
|
() => u == null ? void 0 : u(c),
|
|
1434
1429
|
[u, c]
|
|
1435
|
-
),
|
|
1430
|
+
), J = ee(() => {
|
|
1436
1431
|
const me = c.attachments ?? [], ye = c.shared_location ? [c.shared_location, ...me] : me;
|
|
1437
1432
|
if (!ke(c)) return ye;
|
|
1438
|
-
const
|
|
1439
|
-
return
|
|
1433
|
+
const It = ye.filter((St) => !("type" in St) || !nn(St));
|
|
1434
|
+
return It.length === ye.length ? ye : It;
|
|
1440
1435
|
}, [c]), re = ee(() => {
|
|
1441
1436
|
const me = Xt({ message: c, viewerLanguage: v });
|
|
1442
1437
|
return me === c.text ? c : { ...c, text: me };
|
|
1443
1438
|
}, [c, v]);
|
|
1444
|
-
if (
|
|
1439
|
+
if (Gn(c))
|
|
1445
1440
|
return null;
|
|
1446
1441
|
if (c.deleted_at || c.type === "deleted")
|
|
1447
1442
|
return /* @__PURE__ */ n(U, { message: c });
|
|
1448
|
-
if (
|
|
1443
|
+
if (Hn(c))
|
|
1449
1444
|
return /* @__PURE__ */ n(V, {});
|
|
1450
|
-
const
|
|
1445
|
+
const K = !p && !!c.reply_count, se = !p && c.show_in_channel && c.parent_id, Q = c.status === "failed" && ((ht = c.error) == null ? void 0 : ht.status) !== 403, lt = Yn(c);
|
|
1451
1446
|
let ie;
|
|
1452
|
-
Q ? ie = () => m(c) : lt && (ie = () =>
|
|
1447
|
+
Q ? ie = () => m(c) : lt && (ie = () => R(!0));
|
|
1453
1448
|
const de = f(), kn = y(
|
|
1454
1449
|
"str-chat__message str-chat__message-simple",
|
|
1455
1450
|
`str-chat__message--${c.type}`,
|
|
@@ -1462,25 +1457,25 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1462
1457
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1463
1458
|
"str-chat__message--with-reactions": q,
|
|
1464
1459
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((ft = c == null ? void 0 : c.error) == null ? void 0 : ft.status) !== 403,
|
|
1465
|
-
"str-chat__message-with-thread-link":
|
|
1460
|
+
"str-chat__message-with-thread-link": K || se,
|
|
1466
1461
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1467
1462
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1468
1463
|
"str-chat__virtual-message__wrapper--group": o
|
|
1469
1464
|
}
|
|
1470
|
-
), ct = c.poll_id &&
|
|
1465
|
+
), ct = c.poll_id && N.polls.fromState(c.poll_id), dt = ya(c), ue = ke(c), ut = Na(c), Re = !!(J != null && J.length && !c.quoted_message), mt = ue && de && Re;
|
|
1471
1466
|
return /* @__PURE__ */ h(te, { children: [
|
|
1472
1467
|
a && /* @__PURE__ */ n(
|
|
1473
|
-
|
|
1468
|
+
D,
|
|
1474
1469
|
{
|
|
1475
1470
|
additionalMessageInputProps: t
|
|
1476
1471
|
}
|
|
1477
1472
|
),
|
|
1478
|
-
|
|
1479
|
-
|
|
1473
|
+
A && /* @__PURE__ */ n(
|
|
1474
|
+
qn,
|
|
1480
1475
|
{
|
|
1481
1476
|
MessageBouncePrompt: B,
|
|
1482
|
-
onClose: () =>
|
|
1483
|
-
open:
|
|
1477
|
+
onClose: () => R(!1),
|
|
1478
|
+
open: A
|
|
1484
1479
|
}
|
|
1485
1480
|
),
|
|
1486
1481
|
/* @__PURE__ */ h(
|
|
@@ -1489,8 +1484,8 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1489
1484
|
className: kn,
|
|
1490
1485
|
"data-message-id": c.id,
|
|
1491
1486
|
children: [
|
|
1492
|
-
|
|
1493
|
-
!!
|
|
1487
|
+
k && /* @__PURE__ */ n(k, {}),
|
|
1488
|
+
!!w && /* @__PURE__ */ n(z, { reminder: w }),
|
|
1494
1489
|
c.user && /* @__PURE__ */ n(
|
|
1495
1490
|
ae,
|
|
1496
1491
|
{
|
|
@@ -1522,7 +1517,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1522
1517
|
},
|
|
1523
1518
|
children: ut ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1524
1519
|
de ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
1525
|
-
|
|
1520
|
+
$ && /* @__PURE__ */ n($, {}),
|
|
1526
1521
|
/* @__PURE__ */ n(
|
|
1527
1522
|
Ot.Sent,
|
|
1528
1523
|
{
|
|
@@ -1532,8 +1527,8 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1532
1527
|
amountText: (vt = c.metadata) == null ? void 0 : vt.amount_text,
|
|
1533
1528
|
detail: (xt = c.metadata) == null ? void 0 : xt.attachment_detail,
|
|
1534
1529
|
paymentStatus: (wt = c.metadata) == null ? void 0 : wt.payment_status,
|
|
1535
|
-
onPreviewClick: () =>
|
|
1536
|
-
onFetchSource: async () => await (
|
|
1530
|
+
onPreviewClick: () => I == null ? void 0 : I(c, _),
|
|
1531
|
+
onFetchSource: async () => await (T == null ? void 0 : T(c, _))
|
|
1537
1532
|
}
|
|
1538
1533
|
)
|
|
1539
1534
|
] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1546,16 +1541,16 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1546
1541
|
amountText: (Ct = c.metadata) == null ? void 0 : Ct.amount_text,
|
|
1547
1542
|
detail: (kt = c.metadata) == null ? void 0 : kt.attachment_detail,
|
|
1548
1543
|
paymentStatus: (Et = c.metadata) == null ? void 0 : Et.payment_status,
|
|
1549
|
-
isUnlocking:
|
|
1550
|
-
onUnlockClick: () =>
|
|
1551
|
-
onFetchSource: async () => await (
|
|
1552
|
-
onDownloadClick: () =>
|
|
1544
|
+
isUnlocking: E(c.id),
|
|
1545
|
+
onUnlockClick: () => I == null ? void 0 : I(c, _),
|
|
1546
|
+
onFetchSource: async () => await (T == null ? void 0 : T(c, _)),
|
|
1547
|
+
onDownloadClick: () => L == null ? void 0 : L(c, _)
|
|
1553
1548
|
}
|
|
1554
1549
|
),
|
|
1555
|
-
|
|
1550
|
+
$ && /* @__PURE__ */ n($, {})
|
|
1556
1551
|
] }),
|
|
1557
1552
|
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1558
|
-
|
|
1553
|
+
At,
|
|
1559
1554
|
{
|
|
1560
1555
|
message: re,
|
|
1561
1556
|
renderText: g
|
|
@@ -1573,28 +1568,28 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1573
1568
|
isMyMessage: de
|
|
1574
1569
|
}
|
|
1575
1570
|
),
|
|
1576
|
-
ct && /* @__PURE__ */ n(
|
|
1577
|
-
|
|
1578
|
-
|
|
1571
|
+
ct && /* @__PURE__ */ n(Wn, { poll: ct }),
|
|
1572
|
+
J != null && J.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1573
|
+
S,
|
|
1579
1574
|
{
|
|
1580
1575
|
actionHandler: l,
|
|
1581
|
-
attachments:
|
|
1576
|
+
attachments: J
|
|
1582
1577
|
}
|
|
1583
1578
|
) : null,
|
|
1584
1579
|
Ne ? /* @__PURE__ */ n(
|
|
1585
|
-
|
|
1580
|
+
x,
|
|
1586
1581
|
{
|
|
1587
1582
|
message: re,
|
|
1588
1583
|
renderText: g
|
|
1589
1584
|
}
|
|
1590
1585
|
) : /* @__PURE__ */ n(
|
|
1591
|
-
|
|
1586
|
+
At,
|
|
1592
1587
|
{
|
|
1593
1588
|
message: re,
|
|
1594
1589
|
renderText: g
|
|
1595
1590
|
}
|
|
1596
1591
|
),
|
|
1597
|
-
/* @__PURE__ */ n(
|
|
1592
|
+
/* @__PURE__ */ n(Xn, {})
|
|
1598
1593
|
] }) })
|
|
1599
1594
|
}
|
|
1600
1595
|
),
|
|
@@ -1608,15 +1603,15 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1608
1603
|
}
|
|
1609
1604
|
),
|
|
1610
1605
|
s && ue && /* @__PURE__ */ n(
|
|
1611
|
-
|
|
1606
|
+
Ca,
|
|
1612
1607
|
{
|
|
1613
|
-
selected:
|
|
1614
|
-
onVoteUp:
|
|
1615
|
-
onVoteDown:
|
|
1608
|
+
selected: C,
|
|
1609
|
+
onVoteUp: M,
|
|
1610
|
+
onVoteDown: P
|
|
1616
1611
|
}
|
|
1617
1612
|
)
|
|
1618
1613
|
] }),
|
|
1619
|
-
|
|
1614
|
+
K && /* @__PURE__ */ n(
|
|
1620
1615
|
G,
|
|
1621
1616
|
{
|
|
1622
1617
|
onClick: d,
|
|
@@ -1629,12 +1624,12 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1629
1624
|
c.id
|
|
1630
1625
|
)
|
|
1631
1626
|
] });
|
|
1632
|
-
},
|
|
1633
|
-
|
|
1634
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1635
|
-
),
|
|
1627
|
+
}, Ea = F.memo(
|
|
1628
|
+
ka,
|
|
1629
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Mn(e, t)
|
|
1630
|
+
), Ia = (e) => {
|
|
1636
1631
|
const t = pe("CustomMessage");
|
|
1637
|
-
return /* @__PURE__ */ n(
|
|
1632
|
+
return /* @__PURE__ */ n(Ea, { ...t, ...e });
|
|
1638
1633
|
}, Sa = () => {
|
|
1639
1634
|
var s;
|
|
1640
1635
|
const { handleDelete: e, message: t } = pe("CustomMessageActions");
|
|
@@ -1645,10 +1640,10 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1645
1640
|
"aria-label": "Delete",
|
|
1646
1641
|
title: "Delete",
|
|
1647
1642
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1648
|
-
children: /* @__PURE__ */ n(
|
|
1643
|
+
children: /* @__PURE__ */ n(Ts, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1649
1644
|
}
|
|
1650
1645
|
);
|
|
1651
|
-
},
|
|
1646
|
+
}, Ta = () => {
|
|
1652
1647
|
const { handleFlag: e } = pe("CustomMessageActions");
|
|
1653
1648
|
return /* @__PURE__ */ n(
|
|
1654
1649
|
Ht,
|
|
@@ -1660,19 +1655,19 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1660
1655
|
children: /* @__PURE__ */ n(jt, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1661
1656
|
}
|
|
1662
1657
|
);
|
|
1663
|
-
},
|
|
1658
|
+
}, Aa = () => {
|
|
1664
1659
|
var t;
|
|
1665
1660
|
const { message: e } = pe("CustomMessageActions");
|
|
1666
1661
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1667
|
-
|
|
1662
|
+
Ps,
|
|
1668
1663
|
{
|
|
1669
1664
|
messageActionSet: [
|
|
1670
1665
|
{ Component: Sa, placement: "quick", type: "delete" },
|
|
1671
|
-
{ Component:
|
|
1666
|
+
{ Component: Ta, placement: "quick", type: "flag" }
|
|
1672
1667
|
]
|
|
1673
1668
|
}
|
|
1674
1669
|
);
|
|
1675
|
-
},
|
|
1670
|
+
}, Ma = ({
|
|
1676
1671
|
link: e,
|
|
1677
1672
|
onDismiss: t
|
|
1678
1673
|
}) => {
|
|
@@ -1712,26 +1707,26 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1712
1707
|
]
|
|
1713
1708
|
}
|
|
1714
1709
|
);
|
|
1715
|
-
},
|
|
1710
|
+
}, Ra = (e) => ({
|
|
1716
1711
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1717
|
-
(t) =>
|
|
1712
|
+
(t) => Tt.previewIsLoaded(t) || Tt.previewIsLoading(t)
|
|
1718
1713
|
)
|
|
1719
|
-
}),
|
|
1720
|
-
const { linkPreviewsManager: e } =
|
|
1714
|
+
}), La = () => {
|
|
1715
|
+
const { linkPreviewsManager: e } = Jn(), { linkPreviews: t } = Kn(
|
|
1721
1716
|
e.state,
|
|
1722
|
-
|
|
1717
|
+
Ra
|
|
1723
1718
|
), s = (r) => {
|
|
1724
1719
|
e.dismissPreview(r);
|
|
1725
1720
|
};
|
|
1726
1721
|
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(
|
|
1727
|
-
|
|
1722
|
+
Ma,
|
|
1728
1723
|
{
|
|
1729
1724
|
link: r,
|
|
1730
1725
|
onDismiss: s
|
|
1731
1726
|
},
|
|
1732
1727
|
r.og_scrape_url
|
|
1733
1728
|
)) }) : null;
|
|
1734
|
-
}, ln =
|
|
1729
|
+
}, ln = F.createContext(!1), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1735
1730
|
"button",
|
|
1736
1731
|
{
|
|
1737
1732
|
...s,
|
|
@@ -1739,20 +1734,20 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1739
1734
|
"aria-label": "Send",
|
|
1740
1735
|
disabled: t,
|
|
1741
1736
|
onClick: e,
|
|
1742
|
-
children: /* @__PURE__ */ n(
|
|
1737
|
+
children: /* @__PURE__ */ n(As, { weight: "bold", className: "size-4" })
|
|
1743
1738
|
}
|
|
1744
|
-
),
|
|
1745
|
-
const e = Te(ln), { handleSubmit: t } =
|
|
1746
|
-
SendButton: r =
|
|
1747
|
-
AttachmentPreviewList: i =
|
|
1739
|
+
), Pa = () => {
|
|
1740
|
+
const e = Te(ln), { handleSubmit: t } = Qn(), s = es(), a = e || !s, {
|
|
1741
|
+
SendButton: r = Da,
|
|
1742
|
+
AttachmentPreviewList: i = ts
|
|
1748
1743
|
} = Ut("CustomMessageInput");
|
|
1749
1744
|
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: [
|
|
1750
|
-
/* @__PURE__ */ n(
|
|
1751
|
-
/* @__PURE__ */ n(
|
|
1745
|
+
/* @__PURE__ */ n(ns, {}),
|
|
1746
|
+
/* @__PURE__ */ n(La, {}),
|
|
1752
1747
|
/* @__PURE__ */ n(i, {}),
|
|
1753
1748
|
/* @__PURE__ */ h("div", { className: "flex", children: [
|
|
1754
1749
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
1755
|
-
|
|
1750
|
+
ss,
|
|
1756
1751
|
{
|
|
1757
1752
|
"aria-disabled": e || void 0,
|
|
1758
1753
|
className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -1775,7 +1770,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1775
1770
|
)
|
|
1776
1771
|
] })
|
|
1777
1772
|
] });
|
|
1778
|
-
},
|
|
1773
|
+
}, Oa = ({
|
|
1779
1774
|
renderActions: e,
|
|
1780
1775
|
renderFooter: t,
|
|
1781
1776
|
disabled: s = !1,
|
|
@@ -1795,23 +1790,23 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1795
1790
|
className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
|
|
1796
1791
|
children: [
|
|
1797
1792
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
1798
|
-
/* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(
|
|
1793
|
+
/* @__PURE__ */ n(ln.Provider, { value: i, children: /* @__PURE__ */ n(Zn, { Input: Pa }) })
|
|
1799
1794
|
]
|
|
1800
1795
|
}
|
|
1801
1796
|
),
|
|
1802
1797
|
t == null ? void 0 : t()
|
|
1803
1798
|
] });
|
|
1804
|
-
},
|
|
1799
|
+
}, za = [
|
|
1805
1800
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1806
1801
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1807
|
-
],
|
|
1802
|
+
], $a = {
|
|
1808
1803
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1809
1804
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1810
|
-
},
|
|
1805
|
+
}, Fa = [
|
|
1811
1806
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1812
|
-
],
|
|
1807
|
+
], Ba = {
|
|
1813
1808
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1814
|
-
}, Oe = "age safety guidelines.",
|
|
1809
|
+
}, Oe = "age safety guidelines.", Ua = "https://linktr.ee/s/about/contact", $t = (e) => za.includes(e), ja = (e) => Fa.includes(e), Va = (e) => {
|
|
1815
1810
|
var a;
|
|
1816
1811
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1817
1812
|
if ($t(t))
|
|
@@ -1819,7 +1814,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1819
1814
|
kind: "dm-agent",
|
|
1820
1815
|
type: t
|
|
1821
1816
|
};
|
|
1822
|
-
if (
|
|
1817
|
+
if (ja(t))
|
|
1823
1818
|
return {
|
|
1824
1819
|
kind: "age-safety",
|
|
1825
1820
|
type: t
|
|
@@ -1830,7 +1825,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1830
1825
|
kind: "dm-agent",
|
|
1831
1826
|
type: s
|
|
1832
1827
|
};
|
|
1833
|
-
},
|
|
1828
|
+
}, Ga = (e) => {
|
|
1834
1829
|
const t = e.indexOf(Oe);
|
|
1835
1830
|
if (t === -1)
|
|
1836
1831
|
return e;
|
|
@@ -1840,7 +1835,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1840
1835
|
/* @__PURE__ */ n(
|
|
1841
1836
|
"a",
|
|
1842
1837
|
{
|
|
1843
|
-
href:
|
|
1838
|
+
href: Ua,
|
|
1844
1839
|
target: "_blank",
|
|
1845
1840
|
rel: "noopener noreferrer",
|
|
1846
1841
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -1849,13 +1844,13 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1849
1844
|
),
|
|
1850
1845
|
e.slice(s)
|
|
1851
1846
|
] });
|
|
1852
|
-
},
|
|
1847
|
+
}, Ha = (e) => {
|
|
1853
1848
|
var a, r;
|
|
1854
|
-
const t = e.message.hide_date === !0, s =
|
|
1849
|
+
const t = e.message.hide_date === !0, s = Va(
|
|
1855
1850
|
e.message
|
|
1856
1851
|
);
|
|
1857
1852
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
1858
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
1853
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || $a[s.type];
|
|
1859
1854
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1860
1855
|
/* @__PURE__ */ h(
|
|
1861
1856
|
"div",
|
|
@@ -1881,7 +1876,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1881
1876
|
] });
|
|
1882
1877
|
}
|
|
1883
1878
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
1884
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
1879
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ba[s.type];
|
|
1885
1880
|
return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1886
1881
|
/* @__PURE__ */ h(
|
|
1887
1882
|
"div",
|
|
@@ -1891,7 +1886,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1891
1886
|
"data-age-safety-system-type": s.type,
|
|
1892
1887
|
children: [
|
|
1893
1888
|
/* @__PURE__ */ n(
|
|
1894
|
-
|
|
1889
|
+
Ms,
|
|
1895
1890
|
{
|
|
1896
1891
|
size: 24,
|
|
1897
1892
|
weight: "duotone",
|
|
@@ -1900,7 +1895,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1900
1895
|
"data-testid": "age-safety-system-message-icon"
|
|
1901
1896
|
}
|
|
1902
1897
|
),
|
|
1903
|
-
/* @__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:
|
|
1898
|
+
/* @__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: Ga(i) }) })
|
|
1904
1899
|
]
|
|
1905
1900
|
}
|
|
1906
1901
|
),
|
|
@@ -1925,15 +1920,15 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1925
1920
|
begin: `${120 * t}ms`,
|
|
1926
1921
|
repeatCount: "indefinite"
|
|
1927
1922
|
}
|
|
1928
|
-
) }),
|
|
1923
|
+
) }), Ya = /* @__PURE__ */ new Set([
|
|
1929
1924
|
De.Thinking,
|
|
1930
1925
|
De.Generating,
|
|
1931
1926
|
De.ExternalSources
|
|
1932
|
-
]),
|
|
1927
|
+
]), qa = ({ threadList: e }) => {
|
|
1933
1928
|
var g, p;
|
|
1934
|
-
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Ye(), { typing: i = {} } =
|
|
1935
|
-
if (!e && l &&
|
|
1936
|
-
const v =
|
|
1929
|
+
const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Ye(), { typing: i = {} } = as(), { aiState: o } = rs(t), l = Te(cn);
|
|
1930
|
+
if (!e && l && Ya.has(o)) {
|
|
1931
|
+
const v = Wa(t, (g = r.user) == null ? void 0 : g.id);
|
|
1937
1932
|
return /* @__PURE__ */ n(
|
|
1938
1933
|
Ft,
|
|
1939
1934
|
{
|
|
@@ -1947,14 +1942,14 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
1947
1942
|
if ((s == null ? void 0 : s.typing_events) === !1)
|
|
1948
1943
|
return null;
|
|
1949
1944
|
const m = e ? [] : Object.values(i).filter(
|
|
1950
|
-
({ parent_id: v, user:
|
|
1951
|
-
var
|
|
1952
|
-
return (
|
|
1945
|
+
({ parent_id: v, user: N }) => {
|
|
1946
|
+
var _;
|
|
1947
|
+
return (N == null ? void 0 : N.id) !== ((_ = r.user) == null ? void 0 : _.id) && !v;
|
|
1953
1948
|
}
|
|
1954
1949
|
), b = e ? Object.values(i).filter(
|
|
1955
|
-
({ parent_id: v, user:
|
|
1956
|
-
var
|
|
1957
|
-
return (
|
|
1950
|
+
({ parent_id: v, user: N }) => {
|
|
1951
|
+
var _;
|
|
1952
|
+
return (N == null ? void 0 : N.id) !== ((_ = r.user) == null ? void 0 : _.id) && v === (a == null ? void 0 : a.id);
|
|
1958
1953
|
}
|
|
1959
1954
|
) : [], u = e ? b : m;
|
|
1960
1955
|
if (!u.length)
|
|
@@ -2013,7 +2008,7 @@ const va = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2013
2008
|
] })
|
|
2014
2009
|
}
|
|
2015
2010
|
);
|
|
2016
|
-
function
|
|
2011
|
+
function Wa(e, t) {
|
|
2017
2012
|
var a;
|
|
2018
2013
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2019
2014
|
for (const r of Object.values(s)) {
|
|
@@ -2022,7 +2017,7 @@ function qa(e, t) {
|
|
|
2022
2017
|
return i;
|
|
2023
2018
|
}
|
|
2024
2019
|
}
|
|
2025
|
-
const
|
|
2020
|
+
const Xa = () => null, Ja = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
2026
2021
|
"div",
|
|
2027
2022
|
{
|
|
2028
2023
|
className: y("flex items-center justify-center h-full", e),
|
|
@@ -2065,8 +2060,8 @@ const Wa = () => null, Xa = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
2065
2060
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2066
2061
|
]
|
|
2067
2062
|
}
|
|
2068
|
-
), Ee =
|
|
2069
|
-
/* @__PURE__ */ n(
|
|
2063
|
+
), Ee = F.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
|
|
2064
|
+
/* @__PURE__ */ n(Ja, { className: "w-6 h-6" }),
|
|
2070
2065
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2071
2066
|
] }) }));
|
|
2072
2067
|
Ee.displayName = "LoadingState";
|
|
@@ -2086,23 +2081,23 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2086
2081
|
customChannelActions: f,
|
|
2087
2082
|
showActionsMenu: c = !0
|
|
2088
2083
|
}) => {
|
|
2089
|
-
var
|
|
2090
|
-
const { channel: g } = ce(), p =
|
|
2091
|
-
var
|
|
2092
|
-
const
|
|
2093
|
-
return
|
|
2094
|
-
(
|
|
2095
|
-
var
|
|
2096
|
-
return ((
|
|
2084
|
+
var I, T, L, A, R;
|
|
2085
|
+
const { channel: g } = ce(), p = F.useMemo(() => {
|
|
2086
|
+
var M, P;
|
|
2087
|
+
const w = (M = g._client) == null ? void 0 : M.userID;
|
|
2088
|
+
return w ? Object.values(((P = g.state) == null ? void 0 : P.members) || {}).find(
|
|
2089
|
+
(S) => {
|
|
2090
|
+
var D;
|
|
2091
|
+
return ((D = S.user) == null ? void 0 : D.id) && S.user.id !== w;
|
|
2097
2092
|
}
|
|
2098
2093
|
) : void 0;
|
|
2099
|
-
}, [(
|
|
2094
|
+
}, [(I = g._client) == null ? void 0 : I.userID, (T = g.state) == null ? void 0 : T.members]), v = Wt(p == null ? void 0 : p.user), N = (L = p == null ? void 0 : p.user) == null ? void 0 : L.image, _ = qt(g), E = async () => {
|
|
2100
2095
|
try {
|
|
2101
|
-
|
|
2102
|
-
} catch (
|
|
2096
|
+
_ ? await g.unpin() : await g.pin();
|
|
2097
|
+
} catch (w) {
|
|
2103
2098
|
console.error(
|
|
2104
2099
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
2105
|
-
|
|
2100
|
+
w
|
|
2106
2101
|
);
|
|
2107
2102
|
}
|
|
2108
2103
|
};
|
|
@@ -2119,17 +2114,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2119
2114
|
}),
|
|
2120
2115
|
type: "button",
|
|
2121
2116
|
"aria-label": "Back to conversations",
|
|
2122
|
-
children: /* @__PURE__ */ n(
|
|
2117
|
+
children: /* @__PURE__ */ n(Rt, { className: "size-5 text-black/90" })
|
|
2123
2118
|
}
|
|
2124
2119
|
) }),
|
|
2125
2120
|
/* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
2126
2121
|
/* @__PURE__ */ n(
|
|
2127
2122
|
ae,
|
|
2128
2123
|
{
|
|
2129
|
-
id: ((
|
|
2124
|
+
id: ((A = p == null ? void 0 : p.user) == null ? void 0 : A.id) || g.id || "unknown",
|
|
2130
2125
|
name: v,
|
|
2131
|
-
image:
|
|
2132
|
-
starred: s &&
|
|
2126
|
+
image: N,
|
|
2127
|
+
starred: s && _,
|
|
2133
2128
|
dmAgentEnabled: a,
|
|
2134
2129
|
size: 48
|
|
2135
2130
|
}
|
|
@@ -2145,17 +2140,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2145
2140
|
"button",
|
|
2146
2141
|
{
|
|
2147
2142
|
className: oe,
|
|
2148
|
-
onClick:
|
|
2143
|
+
onClick: E,
|
|
2149
2144
|
type: "button",
|
|
2150
|
-
"aria-label":
|
|
2145
|
+
"aria-label": _ ? "Unstar conversation" : "Star conversation",
|
|
2151
2146
|
children: /* @__PURE__ */ n(
|
|
2152
2147
|
Fe,
|
|
2153
2148
|
{
|
|
2154
2149
|
className: y("size-5", {
|
|
2155
|
-
"text-yellow-600":
|
|
2156
|
-
"text-black/90": !
|
|
2150
|
+
"text-yellow-600": _,
|
|
2151
|
+
"text-black/90": !_
|
|
2157
2152
|
}),
|
|
2158
|
-
weight:
|
|
2153
|
+
weight: _ ? "duotone" : "regular"
|
|
2159
2154
|
}
|
|
2160
2155
|
)
|
|
2161
2156
|
}
|
|
@@ -2191,16 +2186,16 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2191
2186
|
type: "button",
|
|
2192
2187
|
onClick: e,
|
|
2193
2188
|
"aria-label": "Back to conversations",
|
|
2194
|
-
children: /* @__PURE__ */ n(
|
|
2189
|
+
children: /* @__PURE__ */ n(Rt, { className: "size-5 text-black/90" })
|
|
2195
2190
|
}
|
|
2196
2191
|
),
|
|
2197
2192
|
/* @__PURE__ */ n(
|
|
2198
2193
|
ae,
|
|
2199
2194
|
{
|
|
2200
|
-
id: ((
|
|
2195
|
+
id: ((R = p == null ? void 0 : p.user) == null ? void 0 : R.id) || g.id || "unknown",
|
|
2201
2196
|
name: v,
|
|
2202
|
-
image:
|
|
2203
|
-
starred: s &&
|
|
2197
|
+
image: N,
|
|
2198
|
+
starred: s && _,
|
|
2204
2199
|
dmAgentEnabled: a,
|
|
2205
2200
|
size: 48
|
|
2206
2201
|
}
|
|
@@ -2218,17 +2213,17 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2218
2213
|
"button",
|
|
2219
2214
|
{
|
|
2220
2215
|
className: oe,
|
|
2221
|
-
onClick:
|
|
2216
|
+
onClick: E,
|
|
2222
2217
|
type: "button",
|
|
2223
|
-
"aria-label":
|
|
2218
|
+
"aria-label": _ ? "Unstar conversation" : "Star conversation",
|
|
2224
2219
|
children: /* @__PURE__ */ n(
|
|
2225
2220
|
Fe,
|
|
2226
2221
|
{
|
|
2227
2222
|
className: y("size-6", {
|
|
2228
|
-
"text-yellow-600":
|
|
2229
|
-
"text-black/90": !
|
|
2223
|
+
"text-yellow-600": _,
|
|
2224
|
+
"text-black/90": !_
|
|
2230
2225
|
}),
|
|
2231
|
-
weight:
|
|
2226
|
+
weight: _ ? "duotone" : "regular"
|
|
2232
2227
|
}
|
|
2233
2228
|
)
|
|
2234
2229
|
}
|
|
@@ -2253,7 +2248,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2253
2248
|
] })
|
|
2254
2249
|
] })
|
|
2255
2250
|
] });
|
|
2256
|
-
},
|
|
2251
|
+
}, Za = ({
|
|
2257
2252
|
onBack: e,
|
|
2258
2253
|
showBackButton: t,
|
|
2259
2254
|
renderMessageInputActions: s,
|
|
@@ -2271,60 +2266,60 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2271
2266
|
composerDisabledReason: g,
|
|
2272
2267
|
showStarButton: p = !1,
|
|
2273
2268
|
chatbotVotingEnabled: v = !1,
|
|
2274
|
-
renderChannelBanner:
|
|
2275
|
-
customChannelActions:
|
|
2276
|
-
renderMessage:
|
|
2277
|
-
dmAgentEnabled:
|
|
2278
|
-
viewerLanguage:
|
|
2279
|
-
showChannelInfo:
|
|
2269
|
+
renderChannelBanner: N,
|
|
2270
|
+
customChannelActions: _,
|
|
2271
|
+
renderMessage: E,
|
|
2272
|
+
dmAgentEnabled: I = !1,
|
|
2273
|
+
viewerLanguage: T,
|
|
2274
|
+
showChannelInfo: L = !0
|
|
2280
2275
|
}) => {
|
|
2281
|
-
var
|
|
2282
|
-
const { channel:
|
|
2283
|
-
var
|
|
2284
|
-
const G = (
|
|
2285
|
-
return G ? Object.values(((
|
|
2276
|
+
var D, $, V, B, U, X;
|
|
2277
|
+
const { channel: A } = ce(), R = F.useMemo(() => {
|
|
2278
|
+
var x, k;
|
|
2279
|
+
const G = (x = A._client) == null ? void 0 : x.userID;
|
|
2280
|
+
return G ? Object.values(((k = A.state) == null ? void 0 : k.members) || {}).find(
|
|
2286
2281
|
(j) => {
|
|
2287
2282
|
var q;
|
|
2288
2283
|
return ((q = j.user) == null ? void 0 : q.id) && j.user.id !== G;
|
|
2289
2284
|
}
|
|
2290
2285
|
) : void 0;
|
|
2291
|
-
}, [(
|
|
2292
|
-
var
|
|
2293
|
-
const G = (
|
|
2294
|
-
return G ? Object.values(((
|
|
2286
|
+
}, [(D = A._client) == null ? void 0 : D.userID, ($ = A.state) == null ? void 0 : $.members]), w = F.useMemo(() => {
|
|
2287
|
+
var x, k;
|
|
2288
|
+
const G = (x = A._client) == null ? void 0 : x.userID;
|
|
2289
|
+
return G ? Object.values(((k = A.state) == null ? void 0 : k.members) || {}).find((j) => {
|
|
2295
2290
|
var q;
|
|
2296
2291
|
return ((q = j.user) == null ? void 0 : q.id) === G;
|
|
2297
2292
|
}) : void 0;
|
|
2298
|
-
}, [(V =
|
|
2293
|
+
}, [(V = A._client) == null ? void 0 : V.userID, (B = A.state) == null ? void 0 : B.members]), C = ((U = w == null ? void 0 : w.user) == null ? void 0 : U.is_account) ?? (w == null ? void 0 : w.is_account), M = ((X = R == null ? void 0 : R.user) == null ? void 0 : X.is_account) ?? (R == null ? void 0 : R.is_account), P = I && C === !1 && M === !0, S = W(
|
|
2299
2294
|
(G) => {
|
|
2300
|
-
const { message:
|
|
2301
|
-
|
|
2295
|
+
const { message: z } = pe("ChannelView"), x = /* @__PURE__ */ n(
|
|
2296
|
+
Ia,
|
|
2302
2297
|
{
|
|
2303
2298
|
...G,
|
|
2304
2299
|
chatbotVotingEnabled: v,
|
|
2305
|
-
viewerLanguage:
|
|
2300
|
+
viewerLanguage: T
|
|
2306
2301
|
}
|
|
2307
2302
|
);
|
|
2308
|
-
return !
|
|
2303
|
+
return !E || !z ? x : E(x, z);
|
|
2309
2304
|
},
|
|
2310
|
-
[v,
|
|
2305
|
+
[v, E, T]
|
|
2311
2306
|
);
|
|
2312
2307
|
return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
2313
|
-
|
|
2308
|
+
os,
|
|
2314
2309
|
{
|
|
2315
2310
|
overrides: {
|
|
2316
|
-
Message:
|
|
2317
|
-
MessageActions:
|
|
2311
|
+
Message: S,
|
|
2312
|
+
MessageActions: Aa
|
|
2318
2313
|
},
|
|
2319
|
-
children: /* @__PURE__ */ h(
|
|
2314
|
+
children: /* @__PURE__ */ h(ls, { children: [
|
|
2320
2315
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
2321
2316
|
Ka,
|
|
2322
2317
|
{
|
|
2323
2318
|
onBack: e,
|
|
2324
2319
|
showBackButton: t,
|
|
2325
|
-
showActionsMenu:
|
|
2320
|
+
showActionsMenu: L,
|
|
2326
2321
|
showStarButton: p,
|
|
2327
|
-
dmAgentEnabled:
|
|
2322
|
+
dmAgentEnabled: P,
|
|
2328
2323
|
onLeaveConversation: i,
|
|
2329
2324
|
onBlockParticipant: o,
|
|
2330
2325
|
showDeleteConversation: l,
|
|
@@ -2333,26 +2328,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2333
2328
|
onDeleteConversationClick: d,
|
|
2334
2329
|
onBlockParticipantClick: m,
|
|
2335
2330
|
onReportParticipantClick: b,
|
|
2336
|
-
customChannelActions:
|
|
2331
|
+
customChannelActions: _
|
|
2337
2332
|
}
|
|
2338
2333
|
) }, "lt-channel-header"),
|
|
2339
|
-
|
|
2334
|
+
N ? /* @__PURE__ */ n(F.Fragment, { children: N() }, "lt-channel-banner") : null,
|
|
2340
2335
|
/* @__PURE__ */ n(
|
|
2341
2336
|
"div",
|
|
2342
2337
|
{
|
|
2343
2338
|
className: "flex-1 overflow-hidden relative",
|
|
2344
|
-
children: /* @__PURE__ */ n(
|
|
2339
|
+
children: /* @__PURE__ */ n(cs, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
2345
2340
|
},
|
|
2346
2341
|
"lt-channel-message-list"
|
|
2347
2342
|
),
|
|
2348
|
-
r ? /* @__PURE__ */ n(
|
|
2343
|
+
r ? /* @__PURE__ */ n(F.Fragment, { children: r(A) }, "lt-channel-conversation-footer") : null,
|
|
2349
2344
|
/* @__PURE__ */ n(
|
|
2350
|
-
|
|
2345
|
+
Oa,
|
|
2351
2346
|
{
|
|
2352
2347
|
...s && {
|
|
2353
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2348
|
+
renderActions: () => s == null ? void 0 : s(A)
|
|
2354
2349
|
},
|
|
2355
|
-
renderFooter: () => a == null ? void 0 : a(
|
|
2350
|
+
renderFooter: () => a == null ? void 0 : a(A),
|
|
2356
2351
|
disabled: c,
|
|
2357
2352
|
disabledReason: g
|
|
2358
2353
|
},
|
|
@@ -2361,7 +2356,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2361
2356
|
] })
|
|
2362
2357
|
}
|
|
2363
2358
|
) });
|
|
2364
|
-
}, dn =
|
|
2359
|
+
}, dn = F.memo(
|
|
2365
2360
|
({
|
|
2366
2361
|
channel: e,
|
|
2367
2362
|
onBack: t,
|
|
@@ -2372,7 +2367,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2372
2367
|
onLeaveConversation: o,
|
|
2373
2368
|
onBlockParticipant: l,
|
|
2374
2369
|
className: d,
|
|
2375
|
-
CustomChannelEmptyState: m =
|
|
2370
|
+
CustomChannelEmptyState: m = Xa,
|
|
2376
2371
|
showDeleteConversation: b = !0,
|
|
2377
2372
|
onDeleteConversationClick: u,
|
|
2378
2373
|
onBlockParticipantClick: f,
|
|
@@ -2380,53 +2375,53 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2380
2375
|
showBlockParticipant: g = !0,
|
|
2381
2376
|
showReportParticipant: p = !0,
|
|
2382
2377
|
composerDisabled: v = !1,
|
|
2383
|
-
composerDisabledReason:
|
|
2384
|
-
dmAgentEnabled:
|
|
2385
|
-
messageMetadata:
|
|
2386
|
-
onMessageSent:
|
|
2387
|
-
showStarButton:
|
|
2388
|
-
chatbotVotingEnabled:
|
|
2389
|
-
renderChannelBanner:
|
|
2390
|
-
customChannelActions:
|
|
2391
|
-
renderMessage:
|
|
2392
|
-
onMessageLinkClick:
|
|
2393
|
-
sendButton:
|
|
2394
|
-
attachmentPreviewList:
|
|
2395
|
-
viewerLanguage:
|
|
2396
|
-
showChannelInfo:
|
|
2378
|
+
composerDisabledReason: N,
|
|
2379
|
+
dmAgentEnabled: _,
|
|
2380
|
+
messageMetadata: E,
|
|
2381
|
+
onMessageSent: I,
|
|
2382
|
+
showStarButton: T = !1,
|
|
2383
|
+
chatbotVotingEnabled: L = !1,
|
|
2384
|
+
renderChannelBanner: A,
|
|
2385
|
+
customChannelActions: R,
|
|
2386
|
+
renderMessage: w,
|
|
2387
|
+
onMessageLinkClick: C,
|
|
2388
|
+
sendButton: M,
|
|
2389
|
+
attachmentPreviewList: P,
|
|
2390
|
+
viewerLanguage: S,
|
|
2391
|
+
showChannelInfo: D = !0
|
|
2397
2392
|
}) => {
|
|
2398
|
-
const
|
|
2393
|
+
const $ = W(
|
|
2399
2394
|
async (B, U, X) => {
|
|
2400
2395
|
var q;
|
|
2401
|
-
const G = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0,
|
|
2396
|
+
const G = ((q = e.data) == null ? void 0 : q.chatbot_paused) === !0, z = _ && !G, x = {
|
|
2402
2397
|
...U,
|
|
2403
|
-
...
|
|
2404
|
-
...
|
|
2398
|
+
...z && { silent: !0 },
|
|
2399
|
+
...E && {
|
|
2405
2400
|
metadata: {
|
|
2406
2401
|
...U.metadata ?? {},
|
|
2407
|
-
...
|
|
2402
|
+
...E
|
|
2408
2403
|
}
|
|
2409
2404
|
}
|
|
2410
|
-
},
|
|
2405
|
+
}, k = {
|
|
2411
2406
|
...X,
|
|
2412
|
-
...
|
|
2413
|
-
}, j = await e.sendMessage(
|
|
2414
|
-
return
|
|
2407
|
+
...z && { skip_push: !0 }
|
|
2408
|
+
}, j = await e.sendMessage(x, k);
|
|
2409
|
+
return I == null || I(j), j;
|
|
2415
2410
|
},
|
|
2416
|
-
[e,
|
|
2411
|
+
[e, _, E, I]
|
|
2417
2412
|
), V = H(null);
|
|
2418
2413
|
return Y(() => {
|
|
2419
|
-
if (!
|
|
2414
|
+
if (!C) return;
|
|
2420
2415
|
const B = V.current;
|
|
2421
2416
|
if (!B) return;
|
|
2422
2417
|
const U = (X) => {
|
|
2423
|
-
const G = X.target,
|
|
2424
|
-
if (!
|
|
2425
|
-
const
|
|
2426
|
-
|
|
2418
|
+
const G = X.target, z = G == null ? void 0 : G.closest("a[href]"), x = z == null ? void 0 : z.getAttribute("href");
|
|
2419
|
+
if (!x) return;
|
|
2420
|
+
const k = z == null ? void 0 : z.closest("[data-message-id]"), j = k == null ? void 0 : k.getAttribute("data-message-id"), q = j ? e.state.messages.find((Ne) => Ne.id === j) : void 0;
|
|
2421
|
+
C(x, q);
|
|
2427
2422
|
};
|
|
2428
2423
|
return B.addEventListener("click", U), () => B.removeEventListener("click", U);
|
|
2429
|
-
}, [
|
|
2424
|
+
}, [C, e]), /* @__PURE__ */ n(
|
|
2430
2425
|
"div",
|
|
2431
2426
|
{
|
|
2432
2427
|
ref: V,
|
|
@@ -2434,20 +2429,20 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2434
2429
|
"messaging-channel-view h-full flex flex-col",
|
|
2435
2430
|
d
|
|
2436
2431
|
),
|
|
2437
|
-
children: /* @__PURE__ */ n(cn.Provider, { value:
|
|
2438
|
-
|
|
2432
|
+
children: /* @__PURE__ */ n(cn.Provider, { value: _ ?? !1, children: /* @__PURE__ */ n(
|
|
2433
|
+
is,
|
|
2439
2434
|
{
|
|
2440
2435
|
channel: e,
|
|
2441
|
-
MessageSystem:
|
|
2436
|
+
MessageSystem: Ha,
|
|
2442
2437
|
EmptyStateIndicator: m,
|
|
2443
2438
|
LoadingIndicator: Ee,
|
|
2444
|
-
DateSeparator:
|
|
2445
|
-
TypingIndicator:
|
|
2446
|
-
doSendMessageRequest:
|
|
2447
|
-
...
|
|
2448
|
-
...
|
|
2439
|
+
DateSeparator: Vs,
|
|
2440
|
+
TypingIndicator: qa,
|
|
2441
|
+
doSendMessageRequest: $,
|
|
2442
|
+
...M ? { SendButton: M } : {},
|
|
2443
|
+
...P ? { AttachmentPreviewList: P } : {},
|
|
2449
2444
|
children: /* @__PURE__ */ n(
|
|
2450
|
-
|
|
2445
|
+
Za,
|
|
2451
2446
|
{
|
|
2452
2447
|
onBack: t,
|
|
2453
2448
|
showBackButton: s,
|
|
@@ -2464,15 +2459,15 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2464
2459
|
showBlockParticipant: g,
|
|
2465
2460
|
showReportParticipant: p,
|
|
2466
2461
|
composerDisabled: v,
|
|
2467
|
-
composerDisabledReason:
|
|
2468
|
-
showStarButton:
|
|
2469
|
-
dmAgentEnabled:
|
|
2470
|
-
chatbotVotingEnabled:
|
|
2471
|
-
renderChannelBanner:
|
|
2472
|
-
customChannelActions:
|
|
2473
|
-
renderMessage:
|
|
2474
|
-
viewerLanguage:
|
|
2475
|
-
showChannelInfo:
|
|
2462
|
+
composerDisabledReason: N,
|
|
2463
|
+
showStarButton: T,
|
|
2464
|
+
dmAgentEnabled: _,
|
|
2465
|
+
chatbotVotingEnabled: L,
|
|
2466
|
+
renderChannelBanner: A,
|
|
2467
|
+
customChannelActions: R,
|
|
2468
|
+
renderMessage: w,
|
|
2469
|
+
viewerLanguage: S,
|
|
2470
|
+
showChannelInfo: D
|
|
2476
2471
|
}
|
|
2477
2472
|
)
|
|
2478
2473
|
}
|
|
@@ -2482,7 +2477,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
2482
2477
|
}
|
|
2483
2478
|
);
|
|
2484
2479
|
dn.displayName = "ChannelView";
|
|
2485
|
-
const fe =
|
|
2480
|
+
const fe = F.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: [
|
|
2486
2481
|
/* @__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: "⚠️" }) }),
|
|
2487
2482
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2488
2483
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2497,7 +2492,7 @@ const fe = $.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2497
2492
|
)
|
|
2498
2493
|
] }) }));
|
|
2499
2494
|
fe.displayName = "ErrorState";
|
|
2500
|
-
const
|
|
2495
|
+
const ki = ({
|
|
2501
2496
|
capabilities: e = {},
|
|
2502
2497
|
renderMessageInputActions: t,
|
|
2503
2498
|
renderConversationFooter: s,
|
|
@@ -2515,71 +2510,71 @@ const Ci = ({
|
|
|
2515
2510
|
renderChannelBanner: g,
|
|
2516
2511
|
customChannelActions: p,
|
|
2517
2512
|
renderMessage: v,
|
|
2518
|
-
onMessageLinkClick:
|
|
2519
|
-
showChannelInfo:
|
|
2513
|
+
onMessageLinkClick: N,
|
|
2514
|
+
showChannelInfo: _
|
|
2520
2515
|
}) => {
|
|
2521
2516
|
const {
|
|
2522
|
-
client:
|
|
2523
|
-
isConnected:
|
|
2524
|
-
isLoading:
|
|
2525
|
-
error:
|
|
2526
|
-
refreshConnection:
|
|
2527
|
-
service:
|
|
2528
|
-
debug:
|
|
2529
|
-
} =
|
|
2517
|
+
client: E,
|
|
2518
|
+
isConnected: I,
|
|
2519
|
+
isLoading: T,
|
|
2520
|
+
error: L,
|
|
2521
|
+
refreshConnection: A,
|
|
2522
|
+
service: R,
|
|
2523
|
+
debug: w
|
|
2524
|
+
} = Os(), [C, M] = O(null), [P, S] = O(null), [D, $] = O(!1), { showDeleteConversation: V = !0 } = e, B = H(o);
|
|
2530
2525
|
B.current = o;
|
|
2531
2526
|
const U = H(a);
|
|
2532
2527
|
U.current = a;
|
|
2533
2528
|
const X = H(null), G = H(null);
|
|
2534
2529
|
Y(() => {
|
|
2535
|
-
G.current =
|
|
2536
|
-
}, [
|
|
2537
|
-
if (!
|
|
2538
|
-
const
|
|
2539
|
-
if (!
|
|
2540
|
-
const j = `${
|
|
2530
|
+
G.current = C;
|
|
2531
|
+
}, [C]), Y(() => {
|
|
2532
|
+
if (!E || !I) return;
|
|
2533
|
+
const k = E.userID;
|
|
2534
|
+
if (!k) return;
|
|
2535
|
+
const j = `${k}::${i}`;
|
|
2541
2536
|
if (X.current === j) return;
|
|
2542
2537
|
X.current = j;
|
|
2543
2538
|
const q = () => {
|
|
2544
2539
|
X.current === j && (X.current = null);
|
|
2545
2540
|
};
|
|
2546
2541
|
(async () => {
|
|
2547
|
-
var
|
|
2542
|
+
var J, re;
|
|
2548
2543
|
try {
|
|
2549
|
-
|
|
2544
|
+
w && console.log(
|
|
2550
2545
|
"[MessagingShell] Loading initial conversation with:",
|
|
2551
2546
|
i
|
|
2552
2547
|
);
|
|
2553
|
-
const
|
|
2548
|
+
const K = await E.queryChannels(
|
|
2554
2549
|
{
|
|
2555
2550
|
type: "messaging",
|
|
2556
|
-
members: { $eq: [
|
|
2551
|
+
members: { $eq: [k, i] }
|
|
2557
2552
|
},
|
|
2558
2553
|
{},
|
|
2559
2554
|
{ limit: 1 }
|
|
2560
2555
|
);
|
|
2561
|
-
if (
|
|
2562
|
-
|
|
2556
|
+
if (K.length > 0) {
|
|
2557
|
+
M(K[0]), S(null), (J = U.current) == null || J.call(U, K[0]), w && console.log(
|
|
2563
2558
|
"[MessagingShell] Initial conversation loaded:",
|
|
2564
|
-
|
|
2559
|
+
K[0].id
|
|
2565
2560
|
);
|
|
2566
2561
|
return;
|
|
2567
2562
|
}
|
|
2568
2563
|
const se = B.current;
|
|
2569
|
-
if (!se || !
|
|
2570
|
-
q(),
|
|
2564
|
+
if (!se || !R) {
|
|
2565
|
+
q(), S("No conversation found with this account"), w && console.log(
|
|
2571
2566
|
"[MessagingShell] No conversation found for:",
|
|
2572
2567
|
i
|
|
2573
2568
|
);
|
|
2574
2569
|
return;
|
|
2575
2570
|
}
|
|
2576
2571
|
try {
|
|
2577
|
-
const Q = await
|
|
2572
|
+
const Q = await R.startChannelWithParticipant({
|
|
2578
2573
|
id: se.id,
|
|
2579
2574
|
name: se.name,
|
|
2580
2575
|
phone: se.phone
|
|
2581
2576
|
});
|
|
2582
|
-
|
|
2577
|
+
M(Q), S(null), (re = U.current) == null || re.call(U, Q), w && console.log(
|
|
2583
2578
|
"[MessagingShell] Channel created and loaded:",
|
|
2584
2579
|
Q.id
|
|
2585
2580
|
);
|
|
@@ -2587,37 +2582,37 @@ const Ci = ({
|
|
|
2587
2582
|
console.error(
|
|
2588
2583
|
"[MessagingShell] Failed to create conversation:",
|
|
2589
2584
|
Q
|
|
2590
|
-
), q(),
|
|
2585
|
+
), q(), S("Failed to create conversation");
|
|
2591
2586
|
}
|
|
2592
|
-
} catch (
|
|
2587
|
+
} catch (K) {
|
|
2593
2588
|
console.error(
|
|
2594
2589
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2595
|
-
|
|
2596
|
-
), q(), G.current ||
|
|
2590
|
+
K
|
|
2591
|
+
), q(), G.current || S("Failed to load conversation");
|
|
2597
2592
|
}
|
|
2598
2593
|
})();
|
|
2599
|
-
}, [i,
|
|
2600
|
-
const
|
|
2601
|
-
|
|
2602
|
-
const
|
|
2603
|
-
var
|
|
2604
|
-
|
|
2594
|
+
}, [i, E, I, R, w]);
|
|
2595
|
+
const z = H(r);
|
|
2596
|
+
z.current = r;
|
|
2597
|
+
const x = W(() => {
|
|
2598
|
+
var k;
|
|
2599
|
+
M(null), $(!0), (k = z.current) == null || k.call(z);
|
|
2605
2600
|
}, []);
|
|
2606
|
-
return
|
|
2601
|
+
return T ? /* @__PURE__ */ n(Ee, {}) : L ? /* @__PURE__ */ n(fe, { message: L, onBack: A }) : !I || !E ? /* @__PURE__ */ n(
|
|
2607
2602
|
fe,
|
|
2608
2603
|
{
|
|
2609
2604
|
message: "Not connected to messaging service",
|
|
2610
|
-
onBack:
|
|
2605
|
+
onBack: A
|
|
2611
2606
|
}
|
|
2612
|
-
) :
|
|
2607
|
+
) : P ? /* @__PURE__ */ n(fe, { message: P }) : D && !C ? /* @__PURE__ */ n(fe, { message: "Conversation ended" }) : C ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
2613
2608
|
dn,
|
|
2614
2609
|
{
|
|
2615
|
-
channel:
|
|
2610
|
+
channel: C,
|
|
2616
2611
|
renderMessageInputActions: t,
|
|
2617
2612
|
renderConversationFooter: s,
|
|
2618
2613
|
renderChannelBanner: g,
|
|
2619
|
-
onLeaveConversation:
|
|
2620
|
-
onBlockParticipant:
|
|
2614
|
+
onLeaveConversation: x,
|
|
2615
|
+
onBlockParticipant: x,
|
|
2621
2616
|
CustomChannelEmptyState: l,
|
|
2622
2617
|
showDeleteConversation: V,
|
|
2623
2618
|
onBlockParticipantClick: d,
|
|
@@ -2628,37 +2623,37 @@ const Ci = ({
|
|
|
2628
2623
|
viewerLanguage: c,
|
|
2629
2624
|
customChannelActions: p,
|
|
2630
2625
|
renderMessage: v,
|
|
2631
|
-
onMessageLinkClick:
|
|
2632
|
-
showChannelInfo:
|
|
2626
|
+
onMessageLinkClick: N,
|
|
2627
|
+
showChannelInfo: _
|
|
2633
2628
|
},
|
|
2634
|
-
|
|
2629
|
+
C.id
|
|
2635
2630
|
) }) }) : /* @__PURE__ */ n(Ee, {});
|
|
2636
2631
|
};
|
|
2637
|
-
function
|
|
2632
|
+
function Qa(e) {
|
|
2638
2633
|
const t = e.state.pending_messages;
|
|
2639
2634
|
if (t != null && t.length)
|
|
2640
2635
|
for (const s of t)
|
|
2641
2636
|
e.state.addMessageSorted(s.message);
|
|
2642
2637
|
}
|
|
2643
|
-
const un =
|
|
2638
|
+
const un = F.createContext({
|
|
2644
2639
|
selectedChannel: void 0,
|
|
2645
2640
|
onChannelSelect: () => {
|
|
2646
2641
|
},
|
|
2647
2642
|
debug: !1,
|
|
2648
2643
|
renderMessagePreview: void 0,
|
|
2649
2644
|
viewerLanguage: void 0
|
|
2650
|
-
}),
|
|
2645
|
+
}), er = un.Provider, tr = () => F.useContext(un), nr = (e, t) => {
|
|
2651
2646
|
const s = new Date(
|
|
2652
2647
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
2653
2648
|
), r = new Date(
|
|
2654
2649
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
2655
2650
|
).getTime() - s.getTime();
|
|
2656
2651
|
return Math.floor(r / (1e3 * 60 * 60 * 24));
|
|
2657
|
-
},
|
|
2652
|
+
}, sr = (e) => {
|
|
2658
2653
|
const t = /* @__PURE__ */ new Date();
|
|
2659
2654
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
|
|
2660
2655
|
return "Just now";
|
|
2661
|
-
const a =
|
|
2656
|
+
const a = nr(e, t);
|
|
2662
2657
|
return a === 0 ? e.toLocaleTimeString([], {
|
|
2663
2658
|
hour: "numeric",
|
|
2664
2659
|
minute: "2-digit",
|
|
@@ -2668,51 +2663,51 @@ const un = $.createContext({
|
|
|
2668
2663
|
day: "numeric",
|
|
2669
2664
|
year: "2-digit"
|
|
2670
2665
|
});
|
|
2671
|
-
}, mn =
|
|
2666
|
+
}, mn = F.memo(
|
|
2672
2667
|
({ channel: e, unread: t }) => {
|
|
2673
|
-
var
|
|
2668
|
+
var L, A, R;
|
|
2674
2669
|
const {
|
|
2675
2670
|
selectedChannel: s,
|
|
2676
2671
|
onChannelSelect: a,
|
|
2677
2672
|
debug: r,
|
|
2678
2673
|
renderMessagePreview: i,
|
|
2679
2674
|
viewerLanguage: o
|
|
2680
|
-
} =
|
|
2675
|
+
} = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
2681
2676
|
e && a(e);
|
|
2682
|
-
}, m = (
|
|
2683
|
-
const
|
|
2684
|
-
!
|
|
2685
|
-
}, u = Object.values(((
|
|
2686
|
-
(
|
|
2687
|
-
var
|
|
2688
|
-
return ((
|
|
2677
|
+
}, m = (w) => {
|
|
2678
|
+
const C = w.key === "Enter" || w.key === " ", M = w.repeat;
|
|
2679
|
+
!C || M || (w.preventDefault(), d());
|
|
2680
|
+
}, u = Object.values(((L = e == null ? void 0 : e.state) == null ? void 0 : L.members) || {}).find(
|
|
2681
|
+
(w) => {
|
|
2682
|
+
var C, M;
|
|
2683
|
+
return ((C = w.user) == null ? void 0 : C.id) && w.user.id !== ((M = e == null ? void 0 : e._client) == null ? void 0 : M.userID);
|
|
2689
2684
|
}
|
|
2690
|
-
), f = Wt(u == null ? void 0 : u.user), c = (
|
|
2691
|
-
var
|
|
2692
|
-
const
|
|
2693
|
-
if (
|
|
2694
|
-
for (let
|
|
2695
|
-
if (
|
|
2685
|
+
), f = Wt(u == null ? void 0 : u.user), c = (A = u == null ? void 0 : u.user) == null ? void 0 : A.image, g = (() => {
|
|
2686
|
+
var C;
|
|
2687
|
+
const w = (C = e == null ? void 0 : e.state) == null ? void 0 : C.messages;
|
|
2688
|
+
if (w != null && w.length) {
|
|
2689
|
+
for (let M = w.length - 1; M >= 0; M--)
|
|
2690
|
+
if (w[M].type !== "system") return w[M];
|
|
2696
2691
|
}
|
|
2697
2692
|
})(), v = (() => {
|
|
2698
|
-
var
|
|
2699
|
-
const
|
|
2693
|
+
var D, $, V, B;
|
|
2694
|
+
const w = Xt({
|
|
2700
2695
|
message: g,
|
|
2701
2696
|
viewerLanguage: o
|
|
2702
2697
|
});
|
|
2703
|
-
if (((
|
|
2704
|
-
if (((
|
|
2705
|
-
if (((V = g == null ? void 0 : g.metadata) == null ? void 0 : V.custom_type) === "MESSAGE_ATTACHMENT") return
|
|
2706
|
-
if (
|
|
2707
|
-
const
|
|
2708
|
-
return
|
|
2709
|
-
})(),
|
|
2698
|
+
if (((D = g == null ? void 0 : g.metadata) == null ? void 0 : D.custom_type) === "MESSAGE_TIP") return w ? `💵 ${w}` : "💵 Sent a tip";
|
|
2699
|
+
if ((($ = g == null ? void 0 : g.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_PAID") return w ? `💰 ${w}` : "💰 Sent a message";
|
|
2700
|
+
if (((V = g == null ? void 0 : g.metadata) == null ? void 0 : V.custom_type) === "MESSAGE_ATTACHMENT") return w ? `📎 ${w}` : "📎 Sent an attachment";
|
|
2701
|
+
if (w) return w;
|
|
2702
|
+
const S = (B = g == null ? void 0 : g.attachments) == null ? void 0 : B[0];
|
|
2703
|
+
return S ? S.og_scrape_url ? S.og_scrape_url : S.type === "image" ? "📷 Sent an image" : S.type === "video" ? "🎥 Sent a video" : S.type === "audio" ? "🎵 Sent audio" : S.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
2704
|
+
})(), N = g != null && g.created_at ? sr(new Date(g.created_at)) : "", _ = g ? ke(g) : !1, E = i ? i(g, v) : `${_ ? "✨ " : ""}${v}`, I = qt(e), T = t ?? 0;
|
|
2710
2705
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
2711
2706
|
channelId: e == null ? void 0 : e.id,
|
|
2712
2707
|
isSelected: l,
|
|
2713
2708
|
participantName: f,
|
|
2714
|
-
unreadCount:
|
|
2715
|
-
hasTimestamp: !!
|
|
2709
|
+
unreadCount: T,
|
|
2710
|
+
hasTimestamp: !!N
|
|
2716
2711
|
}), /* @__PURE__ */ n(
|
|
2717
2712
|
"div",
|
|
2718
2713
|
{
|
|
@@ -2731,11 +2726,11 @@ const un = $.createContext({
|
|
|
2731
2726
|
/* @__PURE__ */ n(
|
|
2732
2727
|
ae,
|
|
2733
2728
|
{
|
|
2734
|
-
id: ((
|
|
2729
|
+
id: ((R = u == null ? void 0 : u.user) == null ? void 0 : R.id) || e.id || "unknown",
|
|
2735
2730
|
name: f,
|
|
2736
2731
|
image: c,
|
|
2737
2732
|
size: 48,
|
|
2738
|
-
starred:
|
|
2733
|
+
starred: I
|
|
2739
2734
|
}
|
|
2740
2735
|
),
|
|
2741
2736
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
@@ -2747,16 +2742,16 @@ const un = $.createContext({
|
|
|
2747
2742
|
"text-sm font-medium truncate text-[#191918]"
|
|
2748
2743
|
),
|
|
2749
2744
|
children: [
|
|
2750
|
-
|
|
2745
|
+
I && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
2751
2746
|
f
|
|
2752
2747
|
]
|
|
2753
2748
|
}
|
|
2754
2749
|
),
|
|
2755
|
-
|
|
2750
|
+
N && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: N })
|
|
2756
2751
|
] }),
|
|
2757
2752
|
/* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
2758
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
2759
|
-
|
|
2753
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: E }),
|
|
2754
|
+
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 })
|
|
2760
2755
|
] })
|
|
2761
2756
|
] })
|
|
2762
2757
|
] })
|
|
@@ -2765,25 +2760,25 @@ const un = $.createContext({
|
|
|
2765
2760
|
}
|
|
2766
2761
|
);
|
|
2767
2762
|
mn.displayName = "CustomChannelPreview";
|
|
2768
|
-
const
|
|
2763
|
+
const ar = { last_message_at: -1 }, rr = F.memo(
|
|
2769
2764
|
({
|
|
2770
2765
|
onChannelSelect: e,
|
|
2771
2766
|
selectedChannel: t,
|
|
2772
2767
|
filters: s,
|
|
2773
2768
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
2774
2769
|
channelRenderFilterFn: r,
|
|
2775
|
-
sort: i =
|
|
2770
|
+
sort: i = ar,
|
|
2776
2771
|
className: o,
|
|
2777
2772
|
customEmptyStateIndicator: l,
|
|
2778
2773
|
renderMessagePreview: d,
|
|
2779
2774
|
viewerLanguage: m
|
|
2780
2775
|
}) => {
|
|
2781
|
-
const b =
|
|
2776
|
+
const b = F.useRef(0);
|
|
2782
2777
|
b.current++;
|
|
2783
|
-
const { debug: u = !1 } = qe(), f =
|
|
2778
|
+
const { debug: u = !1 } = qe(), f = F.useCallback(
|
|
2784
2779
|
(g) => {
|
|
2785
2780
|
for (const p of g)
|
|
2786
|
-
|
|
2781
|
+
Qa(p);
|
|
2787
2782
|
return r ? r(g) : g;
|
|
2788
2783
|
},
|
|
2789
2784
|
[r]
|
|
@@ -2793,7 +2788,7 @@ const sr = { last_message_at: -1 }, ar = $.memo(
|
|
|
2793
2788
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
2794
2789
|
filters: s
|
|
2795
2790
|
});
|
|
2796
|
-
const c =
|
|
2791
|
+
const c = F.useMemo(
|
|
2797
2792
|
() => ({
|
|
2798
2793
|
selectedChannel: t,
|
|
2799
2794
|
onChannelSelect: e,
|
|
@@ -2816,15 +2811,15 @@ const sr = { last_message_at: -1 }, ar = $.memo(
|
|
|
2816
2811
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
2817
2812
|
o
|
|
2818
2813
|
),
|
|
2819
|
-
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(
|
|
2820
|
-
|
|
2814
|
+
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(er, { value: c, children: /* @__PURE__ */ n(
|
|
2815
|
+
ds,
|
|
2821
2816
|
{
|
|
2822
2817
|
filters: s,
|
|
2823
2818
|
sort: i,
|
|
2824
2819
|
options: { limit: 30 },
|
|
2825
2820
|
allowNewMessagesFromUnfilteredChannels: a,
|
|
2826
2821
|
channelRenderFilterFn: f,
|
|
2827
|
-
Paginator:
|
|
2822
|
+
Paginator: us,
|
|
2828
2823
|
Preview: mn,
|
|
2829
2824
|
EmptyStateIndicator: l
|
|
2830
2825
|
},
|
|
@@ -2834,26 +2829,26 @@ const sr = { last_message_at: -1 }, ar = $.memo(
|
|
|
2834
2829
|
);
|
|
2835
2830
|
}
|
|
2836
2831
|
);
|
|
2837
|
-
|
|
2838
|
-
const
|
|
2832
|
+
rr.displayName = "ChannelList";
|
|
2833
|
+
const ir = /^([a-z][a-z0-9+.-]*):/i, or = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
2839
2834
|
function Qe(e) {
|
|
2840
2835
|
if (typeof e != "string") return;
|
|
2841
2836
|
const t = e.trim();
|
|
2842
2837
|
if (t === "") return;
|
|
2843
|
-
const s =
|
|
2838
|
+
const s = ir.exec(t);
|
|
2844
2839
|
if (s) {
|
|
2845
2840
|
const a = s[1].toLowerCase();
|
|
2846
|
-
return
|
|
2841
|
+
return or.has(a) ? t : void 0;
|
|
2847
2842
|
}
|
|
2848
2843
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
2849
2844
|
}
|
|
2850
|
-
const
|
|
2845
|
+
const lr = {
|
|
2851
2846
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2852
2847
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2853
|
-
},
|
|
2848
|
+
}, cr = ({ variant: e, cta: t }) => {
|
|
2854
2849
|
const s = y(
|
|
2855
2850
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2856
|
-
|
|
2851
|
+
lr[e]
|
|
2857
2852
|
), a = Qe(t.href);
|
|
2858
2853
|
return a ? /* @__PURE__ */ n(
|
|
2859
2854
|
"a",
|
|
@@ -2880,10 +2875,10 @@ const or = {
|
|
|
2880
2875
|
children: t.label
|
|
2881
2876
|
}
|
|
2882
2877
|
);
|
|
2883
|
-
},
|
|
2878
|
+
}, dr = {
|
|
2884
2879
|
dark: "text-white",
|
|
2885
2880
|
light: "text-black/90"
|
|
2886
|
-
},
|
|
2881
|
+
}, ur = "text-white/30", mr = {
|
|
2887
2882
|
dark: "text-white/55",
|
|
2888
2883
|
light: "text-black/55"
|
|
2889
2884
|
}, et = ({
|
|
@@ -2900,10 +2895,10 @@ const or = {
|
|
|
2900
2895
|
if (!b && !u && !c && !g) return null;
|
|
2901
2896
|
const v = y(
|
|
2902
2897
|
"truncate text-base font-medium leading-6",
|
|
2903
|
-
d && !t ?
|
|
2904
|
-
),
|
|
2898
|
+
d && !t ? ur : dr[e]
|
|
2899
|
+
), N = y(
|
|
2905
2900
|
"truncate text-xs leading-4",
|
|
2906
|
-
|
|
2901
|
+
mr[e]
|
|
2907
2902
|
);
|
|
2908
2903
|
return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
|
|
2909
2904
|
/* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
|
|
@@ -2913,22 +2908,22 @@ const or = {
|
|
|
2913
2908
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2914
2909
|
/* @__PURE__ */ n("p", { className: y("min-w-0", v), children: m })
|
|
2915
2910
|
] }),
|
|
2916
|
-
u && /* @__PURE__ */ n("p", { className:
|
|
2911
|
+
u && /* @__PURE__ */ n("p", { className: N, children: a })
|
|
2917
2912
|
] }),
|
|
2918
|
-
!g && c && /* @__PURE__ */ n("p", { className:
|
|
2913
|
+
!g && c && /* @__PURE__ */ n("p", { className: N, children: f })
|
|
2919
2914
|
] }),
|
|
2920
2915
|
l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
|
|
2921
2916
|
] }),
|
|
2922
|
-
o && /* @__PURE__ */ n(
|
|
2917
|
+
o && /* @__PURE__ */ n(cr, { variant: e, cta: o })
|
|
2923
2918
|
] });
|
|
2924
|
-
},
|
|
2919
|
+
}, hr = y(
|
|
2925
2920
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2926
2921
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2927
2922
|
// the messaging design system's "small border around link attachments"
|
|
2928
2923
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
2929
2924
|
"border border-black/[0.08]",
|
|
2930
2925
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
2931
|
-
),
|
|
2926
|
+
), Ie = ({
|
|
2932
2927
|
variant: e,
|
|
2933
2928
|
children: t,
|
|
2934
2929
|
href: s,
|
|
@@ -2940,7 +2935,7 @@ const or = {
|
|
|
2940
2935
|
"data-testid": d
|
|
2941
2936
|
}) => {
|
|
2942
2937
|
const m = s != null || a != null, b = y(
|
|
2943
|
-
|
|
2938
|
+
hr,
|
|
2944
2939
|
l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2945
2940
|
// `focus-ring` is a design-system utility from the component-library
|
|
2946
2941
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -2988,17 +2983,17 @@ const or = {
|
|
|
2988
2983
|
]
|
|
2989
2984
|
}
|
|
2990
2985
|
);
|
|
2991
|
-
},
|
|
2986
|
+
}, fr = {
|
|
2992
2987
|
dark: "bg-white/10",
|
|
2993
2988
|
light: "bg-black/5"
|
|
2994
|
-
},
|
|
2989
|
+
}, gr = {
|
|
2995
2990
|
dark: "size-16 text-white/25",
|
|
2996
2991
|
light: "size-16 text-black/25"
|
|
2997
2992
|
}, Me = (e, t) => !!t && !!e && ne(e) === "audio", hn = (e, t) => {
|
|
2998
2993
|
if (!t || !e) return !1;
|
|
2999
2994
|
const s = ne(e);
|
|
3000
2995
|
return s === "video" || s === "audio";
|
|
3001
|
-
}, tt = "bg-[#F2F3F4]",
|
|
2996
|
+
}, tt = "bg-[#F2F3F4]", Se = ({
|
|
3002
2997
|
variant: e,
|
|
3003
2998
|
thumbnailUrl: t,
|
|
3004
2999
|
sourceUrl: s,
|
|
@@ -3049,10 +3044,10 @@ const or = {
|
|
|
3049
3044
|
{
|
|
3050
3045
|
className: y(
|
|
3051
3046
|
"flex h-full w-full items-center justify-center",
|
|
3052
|
-
|
|
3047
|
+
fr[e]
|
|
3053
3048
|
),
|
|
3054
3049
|
children: le(r, {
|
|
3055
|
-
className:
|
|
3050
|
+
className: gr[e],
|
|
3056
3051
|
weight: "regular"
|
|
3057
3052
|
})
|
|
3058
3053
|
}
|
|
@@ -3062,7 +3057,7 @@ const or = {
|
|
|
3062
3057
|
]
|
|
3063
3058
|
}
|
|
3064
3059
|
);
|
|
3065
|
-
},
|
|
3060
|
+
}, br = ({
|
|
3066
3061
|
title: e,
|
|
3067
3062
|
placeholderTitle: t,
|
|
3068
3063
|
description: s,
|
|
@@ -3092,12 +3087,12 @@ const or = {
|
|
|
3092
3087
|
onClick: u,
|
|
3093
3088
|
"aria-label": "Edit attachment",
|
|
3094
3089
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3095
|
-
children: /* @__PURE__ */ n(
|
|
3090
|
+
children: /* @__PURE__ */ n(Rs, { className: "size-5", weight: "regular" })
|
|
3096
3091
|
}
|
|
3097
3092
|
) : void 0;
|
|
3098
|
-
return c ? /* @__PURE__ */ n(
|
|
3093
|
+
return c ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: tt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3099
3094
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3100
|
-
|
|
3095
|
+
Se,
|
|
3101
3096
|
{
|
|
3102
3097
|
variant: "dark",
|
|
3103
3098
|
sourceUrl: o,
|
|
@@ -3107,13 +3102,13 @@ const or = {
|
|
|
3107
3102
|
) }),
|
|
3108
3103
|
g && /* @__PURE__ */ n("div", { className: "shrink-0", children: g })
|
|
3109
3104
|
] }) }) : /* @__PURE__ */ h(
|
|
3110
|
-
|
|
3105
|
+
Ie,
|
|
3111
3106
|
{
|
|
3112
3107
|
variant: "dark",
|
|
3113
3108
|
topRight: f ? g : void 0,
|
|
3114
3109
|
children: [
|
|
3115
3110
|
!f && /* @__PURE__ */ n(
|
|
3116
|
-
|
|
3111
|
+
Se,
|
|
3117
3112
|
{
|
|
3118
3113
|
variant: "dark",
|
|
3119
3114
|
thumbnailUrl: i,
|
|
@@ -3139,7 +3134,7 @@ const or = {
|
|
|
3139
3134
|
]
|
|
3140
3135
|
}
|
|
3141
3136
|
);
|
|
3142
|
-
},
|
|
3137
|
+
}, pr = ({
|
|
3143
3138
|
title: e,
|
|
3144
3139
|
description: t,
|
|
3145
3140
|
url: s,
|
|
@@ -3159,7 +3154,7 @@ const or = {
|
|
|
3159
3154
|
}
|
|
3160
3155
|
} : d;
|
|
3161
3156
|
return /* @__PURE__ */ h(
|
|
3162
|
-
|
|
3157
|
+
Ie,
|
|
3163
3158
|
{
|
|
3164
3159
|
variant: "light",
|
|
3165
3160
|
href: f,
|
|
@@ -3169,7 +3164,7 @@ const or = {
|
|
|
3169
3164
|
"data-testid": "link-attachment",
|
|
3170
3165
|
children: [
|
|
3171
3166
|
o === "featured" && /* @__PURE__ */ n(
|
|
3172
|
-
|
|
3167
|
+
Se,
|
|
3173
3168
|
{
|
|
3174
3169
|
variant: "light",
|
|
3175
3170
|
thumbnailUrl: r,
|
|
@@ -3192,7 +3187,7 @@ const or = {
|
|
|
3192
3187
|
]
|
|
3193
3188
|
}
|
|
3194
3189
|
);
|
|
3195
|
-
},
|
|
3190
|
+
}, vr = ({
|
|
3196
3191
|
title: e,
|
|
3197
3192
|
placeholderTitle: t,
|
|
3198
3193
|
description: s,
|
|
@@ -3207,7 +3202,7 @@ const or = {
|
|
|
3207
3202
|
}) => {
|
|
3208
3203
|
const u = hn(r, o), f = Qe(a), c = m == null && f != null && !u ? f : void 0, g = m == null && !u && c != null ? b : void 0;
|
|
3209
3204
|
return /* @__PURE__ */ h(
|
|
3210
|
-
|
|
3205
|
+
Ie,
|
|
3211
3206
|
{
|
|
3212
3207
|
variant: "dark",
|
|
3213
3208
|
href: c,
|
|
@@ -3215,7 +3210,7 @@ const or = {
|
|
|
3215
3210
|
bgClassName: Me(r, o) ? tt : void 0,
|
|
3216
3211
|
children: [
|
|
3217
3212
|
l === "featured" && /* @__PURE__ */ n(
|
|
3218
|
-
|
|
3213
|
+
Se,
|
|
3219
3214
|
{
|
|
3220
3215
|
variant: "dark",
|
|
3221
3216
|
thumbnailUrl: i,
|
|
@@ -3239,20 +3234,20 @@ const or = {
|
|
|
3239
3234
|
]
|
|
3240
3235
|
}
|
|
3241
3236
|
);
|
|
3242
|
-
},
|
|
3243
|
-
Composer:
|
|
3244
|
-
Sent:
|
|
3245
|
-
Received:
|
|
3246
|
-
},
|
|
3237
|
+
}, Ei = {
|
|
3238
|
+
Composer: br,
|
|
3239
|
+
Sent: vr,
|
|
3240
|
+
Received: pr
|
|
3241
|
+
}, xr = {
|
|
3247
3242
|
dark: "bg-[#121110]",
|
|
3248
3243
|
light: "bg-[#e9eaed]"
|
|
3249
|
-
},
|
|
3244
|
+
}, wr = {
|
|
3250
3245
|
dark: "text-white",
|
|
3251
3246
|
light: "text-[#080707]"
|
|
3252
|
-
},
|
|
3247
|
+
}, _r = {
|
|
3253
3248
|
dark: "border-white/[0.08]",
|
|
3254
3249
|
light: "border-black/[0.08]"
|
|
3255
|
-
},
|
|
3250
|
+
}, Nr = (e) => e === "dark" ? "sender" : "receiver", yr = {
|
|
3256
3251
|
sender: {
|
|
3257
3252
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3258
3253
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3274,7 +3269,7 @@ const or = {
|
|
|
3274
3269
|
children: i,
|
|
3275
3270
|
"data-testid": o
|
|
3276
3271
|
}) => {
|
|
3277
|
-
const l = t != null && t !== "", d = Nr
|
|
3272
|
+
const l = t != null && t !== "", d = yr[Nr(e)][a];
|
|
3278
3273
|
return /* @__PURE__ */ h(
|
|
3279
3274
|
"div",
|
|
3280
3275
|
{
|
|
@@ -3289,10 +3284,10 @@ const or = {
|
|
|
3289
3284
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3290
3285
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3291
3286
|
d,
|
|
3292
|
-
vr[e],
|
|
3293
3287
|
xr[e],
|
|
3288
|
+
wr[e],
|
|
3294
3289
|
s && "border",
|
|
3295
|
-
s &&
|
|
3290
|
+
s && _r[e],
|
|
3296
3291
|
r
|
|
3297
3292
|
),
|
|
3298
3293
|
children: [
|
|
@@ -3335,16 +3330,16 @@ const or = {
|
|
|
3335
3330
|
),
|
|
3336
3331
|
children: /* @__PURE__ */ n(Ae, { className: "size-3", weight: "bold" })
|
|
3337
3332
|
}
|
|
3338
|
-
), we = (e) => e === "received" ? "light" : "dark",
|
|
3333
|
+
), we = (e) => e === "received" ? "light" : "dark", Ii = ({
|
|
3339
3334
|
firstOfGroup: e,
|
|
3340
3335
|
endOfGroup: t,
|
|
3341
3336
|
groupedByUser: s
|
|
3342
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3337
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Cr = ({
|
|
3343
3338
|
src: e,
|
|
3344
3339
|
mimeType: t,
|
|
3345
3340
|
filename: s,
|
|
3346
3341
|
items: a
|
|
3347
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3342
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], kr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
|
|
3348
3343
|
/* @__PURE__ */ n(
|
|
3349
3344
|
"audio",
|
|
3350
3345
|
{
|
|
@@ -3367,7 +3362,7 @@ const or = {
|
|
|
3367
3362
|
preload: l,
|
|
3368
3363
|
onDismiss: d
|
|
3369
3364
|
}) => {
|
|
3370
|
-
const m = we(e), b = e === "composer" && !!d, u =
|
|
3365
|
+
const m = we(e), b = e === "composer" && !!d, u = Cr({ src: t, mimeType: s, filename: a, items: r });
|
|
3371
3366
|
if (u.length === 0)
|
|
3372
3367
|
return null;
|
|
3373
3368
|
const f = l ?? (u.length > 1 ? "none" : "metadata");
|
|
@@ -3379,7 +3374,7 @@ const or = {
|
|
|
3379
3374
|
groupPosition: o,
|
|
3380
3375
|
"data-testid": "audio-attachment",
|
|
3381
3376
|
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, g) => /* @__PURE__ */ n(
|
|
3382
|
-
|
|
3377
|
+
kr,
|
|
3383
3378
|
{
|
|
3384
3379
|
item: c,
|
|
3385
3380
|
preload: f,
|
|
@@ -3393,15 +3388,15 @@ const or = {
|
|
|
3393
3388
|
)) })
|
|
3394
3389
|
}
|
|
3395
3390
|
);
|
|
3396
|
-
},
|
|
3397
|
-
Composer:
|
|
3398
|
-
Sent:
|
|
3391
|
+
}, Er = (e) => /* @__PURE__ */ n(nt, { ...e, state: "composer" }), Ir = (e) => /* @__PURE__ */ n(nt, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ n(nt, { ...e, state: "received" }), Tr = {
|
|
3392
|
+
Composer: Er,
|
|
3393
|
+
Sent: Ir,
|
|
3399
3394
|
Received: Sr
|
|
3400
3395
|
};
|
|
3401
|
-
function
|
|
3396
|
+
function Ar(e) {
|
|
3402
3397
|
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`;
|
|
3403
3398
|
}
|
|
3404
|
-
const
|
|
3399
|
+
const Mr = {
|
|
3405
3400
|
pdf: "PDF",
|
|
3406
3401
|
doc: "DOC",
|
|
3407
3402
|
xls: "XLS",
|
|
@@ -3411,7 +3406,7 @@ const Ar = {
|
|
|
3411
3406
|
text: "TXT",
|
|
3412
3407
|
markdown: "MD"
|
|
3413
3408
|
};
|
|
3414
|
-
function
|
|
3409
|
+
function Rr(e, t) {
|
|
3415
3410
|
if (t) {
|
|
3416
3411
|
const r = t.lastIndexOf(".");
|
|
3417
3412
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3421,7 +3416,7 @@ function Mr(e, t) {
|
|
|
3421
3416
|
}
|
|
3422
3417
|
if (!e) return;
|
|
3423
3418
|
if (ne(e) === "document") {
|
|
3424
|
-
const r = Zt(e), i =
|
|
3419
|
+
const r = Zt(e), i = Mr[r];
|
|
3425
3420
|
if (i) return i;
|
|
3426
3421
|
if (e === "application/octet-stream") return;
|
|
3427
3422
|
}
|
|
@@ -3429,8 +3424,8 @@ function Mr(e, t) {
|
|
|
3429
3424
|
if (!(!a || a === "*"))
|
|
3430
3425
|
return a.toUpperCase();
|
|
3431
3426
|
}
|
|
3432
|
-
function
|
|
3433
|
-
const a =
|
|
3427
|
+
function Lr(e, t, s) {
|
|
3428
|
+
const a = Rr(e, t), r = typeof s == "number" && s > 0 ? Ar(s) : void 0;
|
|
3434
3429
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3435
3430
|
}
|
|
3436
3431
|
function Z(e) {
|
|
@@ -3441,13 +3436,13 @@ function Z(e) {
|
|
|
3441
3436
|
return "download";
|
|
3442
3437
|
}
|
|
3443
3438
|
}
|
|
3444
|
-
const
|
|
3439
|
+
const Dr = {
|
|
3445
3440
|
dark: "text-white/55",
|
|
3446
3441
|
light: "text-black/65"
|
|
3447
|
-
},
|
|
3442
|
+
}, Pr = {
|
|
3448
3443
|
dark: "bg-white/10",
|
|
3449
3444
|
light: "bg-black/5"
|
|
3450
|
-
},
|
|
3445
|
+
}, Or = {
|
|
3451
3446
|
dark: "text-white/85",
|
|
3452
3447
|
light: "text-black/85"
|
|
3453
3448
|
}, fn = ({
|
|
@@ -3460,16 +3455,16 @@ const Lr = {
|
|
|
3460
3455
|
activateLabel: o,
|
|
3461
3456
|
trailingAction: l
|
|
3462
3457
|
}) => {
|
|
3463
|
-
const d = s ?? t ?? "File", m =
|
|
3458
|
+
const d = s ?? t ?? "File", m = Lr(a, t, r), b = /* @__PURE__ */ n(
|
|
3464
3459
|
"div",
|
|
3465
3460
|
{
|
|
3466
3461
|
className: y(
|
|
3467
3462
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3468
|
-
|
|
3463
|
+
Pr[e]
|
|
3469
3464
|
),
|
|
3470
3465
|
"aria-hidden": !0,
|
|
3471
3466
|
children: le(a, {
|
|
3472
|
-
className: y("size-6",
|
|
3467
|
+
className: y("size-6", Or[e]),
|
|
3473
3468
|
weight: "regular"
|
|
3474
3469
|
})
|
|
3475
3470
|
}
|
|
@@ -3480,7 +3475,7 @@ const Lr = {
|
|
|
3480
3475
|
{
|
|
3481
3476
|
className: y(
|
|
3482
3477
|
"truncate text-xs leading-4",
|
|
3483
|
-
|
|
3478
|
+
Dr[e]
|
|
3484
3479
|
),
|
|
3485
3480
|
children: m
|
|
3486
3481
|
}
|
|
@@ -3523,14 +3518,14 @@ async function gn(e, t) {
|
|
|
3523
3518
|
}
|
|
3524
3519
|
}
|
|
3525
3520
|
}
|
|
3526
|
-
const
|
|
3521
|
+
const zr = ({
|
|
3527
3522
|
src: e,
|
|
3528
3523
|
filename: t,
|
|
3529
3524
|
fileSize: s,
|
|
3530
3525
|
mimeType: a,
|
|
3531
3526
|
title: r,
|
|
3532
3527
|
items: i
|
|
3533
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3528
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], $r = ({
|
|
3534
3529
|
variant: e,
|
|
3535
3530
|
item: t,
|
|
3536
3531
|
index: s,
|
|
@@ -3564,7 +3559,7 @@ const Or = ({
|
|
|
3564
3559
|
onClick: m,
|
|
3565
3560
|
onDismiss: b
|
|
3566
3561
|
}) => {
|
|
3567
|
-
const u = we(e), f = e === "composer" && !!b, c =
|
|
3562
|
+
const u = we(e), f = e === "composer" && !!b, c = zr({
|
|
3568
3563
|
src: t,
|
|
3569
3564
|
filename: s,
|
|
3570
3565
|
fileSize: a,
|
|
@@ -3573,10 +3568,10 @@ const Or = ({
|
|
|
3573
3568
|
items: o
|
|
3574
3569
|
}), g = (v) => {
|
|
3575
3570
|
if ((m == null ? void 0 : m(v)) === !1) return;
|
|
3576
|
-
const
|
|
3577
|
-
if (!
|
|
3578
|
-
const
|
|
3579
|
-
gn(
|
|
3571
|
+
const N = c[v];
|
|
3572
|
+
if (!N) return;
|
|
3573
|
+
const _ = N.filename ?? Z(N.src);
|
|
3574
|
+
gn(N.src, _);
|
|
3580
3575
|
};
|
|
3581
3576
|
if (c.length === 0)
|
|
3582
3577
|
return null;
|
|
@@ -3598,23 +3593,23 @@ const Or = ({
|
|
|
3598
3593
|
text: l,
|
|
3599
3594
|
groupPosition: d,
|
|
3600
3595
|
"data-testid": "file-attachment",
|
|
3601
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v,
|
|
3602
|
-
|
|
3596
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, N) => /* @__PURE__ */ n(
|
|
3597
|
+
$r,
|
|
3603
3598
|
{
|
|
3604
3599
|
variant: u,
|
|
3605
3600
|
item: v,
|
|
3606
|
-
index:
|
|
3601
|
+
index: N,
|
|
3607
3602
|
onActivate: g,
|
|
3608
|
-
trailingAction: f &&
|
|
3603
|
+
trailingAction: f && N === 0 ? /* @__PURE__ */ n(xe, { onClick: b, variant: "inline" }) : p
|
|
3609
3604
|
},
|
|
3610
|
-
`${v.src}-${
|
|
3605
|
+
`${v.src}-${N}`
|
|
3611
3606
|
)) })
|
|
3612
3607
|
}
|
|
3613
3608
|
);
|
|
3614
|
-
},
|
|
3615
|
-
Composer:
|
|
3616
|
-
Sent:
|
|
3617
|
-
Received:
|
|
3609
|
+
}, Fr = (e) => /* @__PURE__ */ n(st, { ...e, state: "composer" }), Br = (e) => /* @__PURE__ */ n(st, { ...e, state: "sent" }), Ur = (e) => /* @__PURE__ */ n(st, { ...e, state: "received" }), jr = {
|
|
3610
|
+
Composer: Fr,
|
|
3611
|
+
Sent: Br,
|
|
3612
|
+
Received: Ur
|
|
3618
3613
|
}, at = ({
|
|
3619
3614
|
onPrev: e,
|
|
3620
3615
|
onNext: t,
|
|
@@ -3628,7 +3623,7 @@ const Or = ({
|
|
|
3628
3623
|
onClick: e,
|
|
3629
3624
|
"aria-label": s,
|
|
3630
3625
|
className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
|
|
3631
|
-
children: /* @__PURE__ */ n(
|
|
3626
|
+
children: /* @__PURE__ */ n(Ls, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3632
3627
|
}
|
|
3633
3628
|
),
|
|
3634
3629
|
/* @__PURE__ */ n(
|
|
@@ -3638,7 +3633,7 @@ const Or = ({
|
|
|
3638
3633
|
onClick: t,
|
|
3639
3634
|
"aria-label": a,
|
|
3640
3635
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3641
|
-
children: /* @__PURE__ */ n(
|
|
3636
|
+
children: /* @__PURE__ */ n(Ds, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3642
3637
|
}
|
|
3643
3638
|
)
|
|
3644
3639
|
] }), bn = ({
|
|
@@ -3650,7 +3645,7 @@ const Or = ({
|
|
|
3650
3645
|
tone: i = "dark",
|
|
3651
3646
|
onTriggered: o
|
|
3652
3647
|
}) => {
|
|
3653
|
-
const [l, d] =
|
|
3648
|
+
const [l, d] = O(!1), m = W(
|
|
3654
3649
|
(c) => {
|
|
3655
3650
|
c.stopPropagation(), !l && (d(!0), gn(e, t).catch(() => {
|
|
3656
3651
|
}).finally(() => {
|
|
@@ -3731,7 +3726,7 @@ const Or = ({
|
|
|
3731
3726
|
initialIndex: t,
|
|
3732
3727
|
open: s
|
|
3733
3728
|
}) => {
|
|
3734
|
-
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
3729
|
+
const a = $e(t, 0, Math.max(e - 1, 0)), [r, i] = O(a);
|
|
3735
3730
|
Y(() => {
|
|
3736
3731
|
s && i($e(t, 0, Math.max(e - 1, 0)));
|
|
3737
3732
|
}, [s, t, e]), Y(() => {
|
|
@@ -3897,7 +3892,7 @@ const Or = ({
|
|
|
3897
3892
|
]
|
|
3898
3893
|
}
|
|
3899
3894
|
) : null;
|
|
3900
|
-
},
|
|
3895
|
+
}, Vr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", vn = ({
|
|
3901
3896
|
tiles: e,
|
|
3902
3897
|
onTileActivate: t,
|
|
3903
3898
|
maxVisible: s = 4,
|
|
@@ -3906,7 +3901,7 @@ const Or = ({
|
|
|
3906
3901
|
const r = e.length;
|
|
3907
3902
|
if (r === 0) return null;
|
|
3908
3903
|
const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, b) => {
|
|
3909
|
-
const u = y(
|
|
3904
|
+
const u = y(Vr, "h-full w-full");
|
|
3910
3905
|
return t ? /* @__PURE__ */ h(
|
|
3911
3906
|
"button",
|
|
3912
3907
|
{
|
|
@@ -3968,14 +3963,14 @@ const Or = ({
|
|
|
3968
3963
|
}
|
|
3969
3964
|
);
|
|
3970
3965
|
}, _e = (e) => {
|
|
3971
|
-
const [t, s] =
|
|
3966
|
+
const [t, s] = O(!1), [a, r] = O(0), i = W(
|
|
3972
3967
|
(l) => {
|
|
3973
3968
|
(e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
|
|
3974
3969
|
},
|
|
3975
3970
|
[e]
|
|
3976
3971
|
), o = W(() => s(!1), []);
|
|
3977
3972
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
|
|
3978
|
-
},
|
|
3973
|
+
}, Gr = (e, t, s, a) => ({
|
|
3979
3974
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
3980
3975
|
content: /* @__PURE__ */ n(
|
|
3981
3976
|
"img",
|
|
@@ -3990,7 +3985,7 @@ const Or = ({
|
|
|
3990
3985
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
3991
3986
|
}
|
|
3992
3987
|
)
|
|
3993
|
-
}),
|
|
3988
|
+
}), Hr = ({
|
|
3994
3989
|
src: e,
|
|
3995
3990
|
alt: t,
|
|
3996
3991
|
items: s
|
|
@@ -3998,7 +3993,7 @@ const Or = ({
|
|
|
3998
3993
|
src: s.src,
|
|
3999
3994
|
alt: s.alt,
|
|
4000
3995
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4001
|
-
})),
|
|
3996
|
+
})), Yr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4002
3997
|
const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = _e(
|
|
4003
3998
|
r
|
|
4004
3999
|
);
|
|
@@ -4045,13 +4040,13 @@ const Or = ({
|
|
|
4045
4040
|
loading: l = "lazy",
|
|
4046
4041
|
onClick: d
|
|
4047
4042
|
}) => {
|
|
4048
|
-
const m =
|
|
4043
|
+
const m = Hr({ src: t, alt: s, items: r }), b = we(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: g } = _e(
|
|
4049
4044
|
d
|
|
4050
4045
|
);
|
|
4051
4046
|
if (m.length === 0)
|
|
4052
4047
|
return null;
|
|
4053
4048
|
const p = m.map(
|
|
4054
|
-
(v,
|
|
4049
|
+
(v, N) => Gr(v, N, m.length, l)
|
|
4055
4050
|
);
|
|
4056
4051
|
return /* @__PURE__ */ h(
|
|
4057
4052
|
ve,
|
|
@@ -4074,10 +4069,10 @@ const Or = ({
|
|
|
4074
4069
|
]
|
|
4075
4070
|
}
|
|
4076
4071
|
);
|
|
4077
|
-
},
|
|
4078
|
-
Composer:
|
|
4079
|
-
Sent:
|
|
4080
|
-
Received:
|
|
4072
|
+
}, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "sent" }), Xr = (e) => /* @__PURE__ */ n(wn, { ...e, state: "received" }), Jr = {
|
|
4073
|
+
Composer: qr,
|
|
4074
|
+
Sent: Wr,
|
|
4075
|
+
Received: Xr
|
|
4081
4076
|
}, Kr = ({
|
|
4082
4077
|
open: e,
|
|
4083
4078
|
items: t,
|
|
@@ -4092,7 +4087,7 @@ const Or = ({
|
|
|
4092
4087
|
() => (l == null ? void 0 : l.filename) ?? (l ? Z(l.src) : "document"),
|
|
4093
4088
|
[l]
|
|
4094
4089
|
), m = ee(
|
|
4095
|
-
() => l ?
|
|
4090
|
+
() => l ? Zr(l.src) : void 0,
|
|
4096
4091
|
[l]
|
|
4097
4092
|
);
|
|
4098
4093
|
return !l || !m ? null : /* @__PURE__ */ h(
|
|
@@ -4126,16 +4121,16 @@ const Or = ({
|
|
|
4126
4121
|
]
|
|
4127
4122
|
}
|
|
4128
4123
|
);
|
|
4129
|
-
},
|
|
4124
|
+
}, Zr = (e) => {
|
|
4130
4125
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4131
4126
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4132
|
-
},
|
|
4127
|
+
}, Qr = ({
|
|
4133
4128
|
src: e,
|
|
4134
4129
|
filename: t,
|
|
4135
4130
|
fileSize: s,
|
|
4136
4131
|
title: a,
|
|
4137
4132
|
items: r
|
|
4138
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4133
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], ei = ({
|
|
4139
4134
|
variant: e,
|
|
4140
4135
|
item: t,
|
|
4141
4136
|
index: s,
|
|
@@ -4168,14 +4163,14 @@ const Or = ({
|
|
|
4168
4163
|
onClick: d,
|
|
4169
4164
|
onDismiss: m
|
|
4170
4165
|
}) => {
|
|
4171
|
-
const b = we(e), u =
|
|
4166
|
+
const b = we(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: p } = _e(
|
|
4172
4167
|
d
|
|
4173
4168
|
), v = e === "composer" && !!m;
|
|
4174
4169
|
if (u.length === 0)
|
|
4175
4170
|
return null;
|
|
4176
|
-
const
|
|
4177
|
-
src:
|
|
4178
|
-
filename:
|
|
4171
|
+
const N = u.map((_) => ({
|
|
4172
|
+
src: _.src,
|
|
4173
|
+
filename: _.filename ?? Z(_.src)
|
|
4179
4174
|
}));
|
|
4180
4175
|
return /* @__PURE__ */ h(
|
|
4181
4176
|
ve,
|
|
@@ -4185,34 +4180,34 @@ const Or = ({
|
|
|
4185
4180
|
groupPosition: l,
|
|
4186
4181
|
"data-testid": "pdf-attachment",
|
|
4187
4182
|
children: [
|
|
4188
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((
|
|
4189
|
-
const
|
|
4183
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_, E) => {
|
|
4184
|
+
const I = _.filename ?? Z(_.src), T = v && E === 0 ? /* @__PURE__ */ n(xe, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4190
4185
|
bn,
|
|
4191
4186
|
{
|
|
4192
|
-
url:
|
|
4193
|
-
filename:
|
|
4187
|
+
url: _.src,
|
|
4188
|
+
filename: I,
|
|
4194
4189
|
variant: "inline",
|
|
4195
|
-
label: `Download ${
|
|
4190
|
+
label: `Download ${I}`,
|
|
4196
4191
|
tone: b
|
|
4197
4192
|
}
|
|
4198
4193
|
);
|
|
4199
4194
|
return /* @__PURE__ */ n(
|
|
4200
|
-
|
|
4195
|
+
ei,
|
|
4201
4196
|
{
|
|
4202
4197
|
variant: b,
|
|
4203
|
-
item:
|
|
4204
|
-
index:
|
|
4198
|
+
item: _,
|
|
4199
|
+
index: E,
|
|
4205
4200
|
onActivate: g,
|
|
4206
|
-
trailingAction:
|
|
4201
|
+
trailingAction: T
|
|
4207
4202
|
},
|
|
4208
|
-
`${
|
|
4203
|
+
`${_.src}-${E}`
|
|
4209
4204
|
);
|
|
4210
4205
|
}) }),
|
|
4211
4206
|
/* @__PURE__ */ n(
|
|
4212
4207
|
Kr,
|
|
4213
4208
|
{
|
|
4214
4209
|
open: f,
|
|
4215
|
-
items:
|
|
4210
|
+
items: N,
|
|
4216
4211
|
initialIndex: c,
|
|
4217
4212
|
onClose: p
|
|
4218
4213
|
}
|
|
@@ -4220,10 +4215,10 @@ const Or = ({
|
|
|
4220
4215
|
]
|
|
4221
4216
|
}
|
|
4222
4217
|
);
|
|
4223
|
-
},
|
|
4224
|
-
Composer:
|
|
4225
|
-
Sent:
|
|
4226
|
-
Received:
|
|
4218
|
+
}, ti = (e) => /* @__PURE__ */ n(ot, { ...e, state: "composer" }), ni = (e) => /* @__PURE__ */ n(ot, { ...e, state: "sent" }), si = (e) => /* @__PURE__ */ n(ot, { ...e, state: "received" }), ai = {
|
|
4219
|
+
Composer: ti,
|
|
4220
|
+
Sent: ni,
|
|
4221
|
+
Received: si
|
|
4227
4222
|
}, _n = ({
|
|
4228
4223
|
open: e,
|
|
4229
4224
|
items: t,
|
|
@@ -4274,7 +4269,7 @@ const Or = ({
|
|
|
4274
4269
|
]
|
|
4275
4270
|
}
|
|
4276
4271
|
) : null;
|
|
4277
|
-
},
|
|
4272
|
+
}, ri = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(Be, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Nn = ({
|
|
4278
4273
|
item: e,
|
|
4279
4274
|
index: t
|
|
4280
4275
|
}) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4296,11 +4291,11 @@ const Or = ({
|
|
|
4296
4291
|
"aria-hidden": !0
|
|
4297
4292
|
}
|
|
4298
4293
|
) }),
|
|
4299
|
-
/* @__PURE__ */ n(
|
|
4300
|
-
] }),
|
|
4294
|
+
/* @__PURE__ */ n(ri, {})
|
|
4295
|
+
] }), ii = (e, t, s) => ({
|
|
4301
4296
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4302
4297
|
content: /* @__PURE__ */ n(Nn, { item: e, index: t })
|
|
4303
|
-
}),
|
|
4298
|
+
}), oi = ({
|
|
4304
4299
|
src: e,
|
|
4305
4300
|
poster: t,
|
|
4306
4301
|
mimeType: s,
|
|
@@ -4312,7 +4307,7 @@ const Or = ({
|
|
|
4312
4307
|
mimeType: s.mimeType,
|
|
4313
4308
|
preload: s.preload,
|
|
4314
4309
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4315
|
-
})),
|
|
4310
|
+
})), li = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
|
|
4316
4311
|
const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: b } = _e(
|
|
4317
4312
|
i
|
|
4318
4313
|
);
|
|
@@ -4353,13 +4348,13 @@ const Or = ({
|
|
|
4353
4348
|
preload: d,
|
|
4354
4349
|
onClick: m
|
|
4355
4350
|
}) => {
|
|
4356
|
-
const b =
|
|
4351
|
+
const b = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = we(e), { viewerOpen: f, viewerIndex: c, handleActivate: g, closeViewer: p } = _e(
|
|
4357
4352
|
m
|
|
4358
4353
|
);
|
|
4359
4354
|
if (b.length === 0)
|
|
4360
4355
|
return null;
|
|
4361
4356
|
const v = b.map(
|
|
4362
|
-
(
|
|
4357
|
+
(N, _) => ii(N, _, b.length)
|
|
4363
4358
|
);
|
|
4364
4359
|
return /* @__PURE__ */ h(
|
|
4365
4360
|
ve,
|
|
@@ -4389,17 +4384,17 @@ const Or = ({
|
|
|
4389
4384
|
]
|
|
4390
4385
|
}
|
|
4391
4386
|
);
|
|
4392
|
-
},
|
|
4393
|
-
Composer:
|
|
4394
|
-
Sent:
|
|
4395
|
-
Received:
|
|
4387
|
+
}, ci = (e) => /* @__PURE__ */ n(li, { ...e }), di = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "sent" }), ui = (e) => /* @__PURE__ */ n(Cn, { ...e, state: "received" }), mi = {
|
|
4388
|
+
Composer: ci,
|
|
4389
|
+
Sent: di,
|
|
4390
|
+
Received: ui
|
|
4396
4391
|
}, Si = {
|
|
4397
|
-
Image:
|
|
4398
|
-
Video:
|
|
4399
|
-
Audio:
|
|
4400
|
-
Pdf:
|
|
4401
|
-
File:
|
|
4402
|
-
},
|
|
4392
|
+
Image: Jr,
|
|
4393
|
+
Video: mi,
|
|
4394
|
+
Audio: Tr,
|
|
4395
|
+
Pdf: ai,
|
|
4396
|
+
File: jr
|
|
4397
|
+
}, hi = ({
|
|
4403
4398
|
question: e,
|
|
4404
4399
|
onClick: t,
|
|
4405
4400
|
loading: s = !1,
|
|
@@ -4421,7 +4416,7 @@ const Or = ({
|
|
|
4421
4416
|
),
|
|
4422
4417
|
children: e
|
|
4423
4418
|
}
|
|
4424
|
-
),
|
|
4419
|
+
), Ti = ({
|
|
4425
4420
|
faqs: e,
|
|
4426
4421
|
onFaqClick: t,
|
|
4427
4422
|
loadingFaqId: s,
|
|
@@ -4450,7 +4445,7 @@ const Or = ({
|
|
|
4450
4445
|
children: [
|
|
4451
4446
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4452
4447
|
l.map((d) => /* @__PURE__ */ n(
|
|
4453
|
-
|
|
4448
|
+
hi,
|
|
4454
4449
|
{
|
|
4455
4450
|
question: d.question,
|
|
4456
4451
|
onClick: () => t(d.id),
|
|
@@ -4465,37 +4460,37 @@ const Or = ({
|
|
|
4465
4460
|
};
|
|
4466
4461
|
export {
|
|
4467
4462
|
Qt as A,
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4463
|
+
Hs as B,
|
|
4464
|
+
Xa as C,
|
|
4465
|
+
Os as D,
|
|
4466
|
+
Ti as F,
|
|
4467
|
+
Ei as L,
|
|
4468
|
+
yi as M,
|
|
4474
4469
|
he as a,
|
|
4475
4470
|
ae as b,
|
|
4476
|
-
|
|
4471
|
+
rr as c,
|
|
4477
4472
|
dn as d,
|
|
4478
|
-
|
|
4479
|
-
|
|
4473
|
+
Ci as e,
|
|
4474
|
+
hi as f,
|
|
4480
4475
|
ne as g,
|
|
4481
4476
|
Ot as h,
|
|
4482
4477
|
Si as i,
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4478
|
+
Ca as j,
|
|
4479
|
+
Ni as k,
|
|
4480
|
+
ki as l,
|
|
4481
|
+
Lr as m,
|
|
4482
|
+
Ar as n,
|
|
4483
|
+
sr as o,
|
|
4484
|
+
Rr as p,
|
|
4490
4485
|
Xt as q,
|
|
4491
4486
|
le as r,
|
|
4492
4487
|
nn as s,
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4488
|
+
$s as t,
|
|
4489
|
+
Ii as u,
|
|
4490
|
+
Ys as v,
|
|
4491
|
+
Ke as w,
|
|
4497
4492
|
Ze as x,
|
|
4498
4493
|
Wt as y,
|
|
4499
|
-
|
|
4494
|
+
va as z
|
|
4500
4495
|
};
|
|
4501
|
-
//# sourceMappingURL=index-
|
|
4496
|
+
//# sourceMappingURL=index-CAAtAfn1.js.map
|