@linktr.ee/messaging-react 2.5.1 → 2.5.3
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-d6L08Luf.cjs → Card-B7TJ2lbG.cjs} +2 -2
- package/dist/{Card-d6L08Luf.cjs.map → Card-B7TJ2lbG.cjs.map} +1 -1
- package/dist/{Card-Dppew_bA.cjs → Card-BbMWytg6.cjs} +2 -2
- package/dist/{Card-Dppew_bA.cjs.map → Card-BbMWytg6.cjs.map} +1 -1
- package/dist/{Card-BpVephnj.js → Card-BwygcpzI.js} +2 -2
- package/dist/{Card-BpVephnj.js.map → Card-BwygcpzI.js.map} +1 -1
- package/dist/{Card-bUYvpOEI.js → Card-CJDGgG0O.js} +3 -3
- package/dist/{Card-bUYvpOEI.js.map → Card-CJDGgG0O.js.map} +1 -1
- package/dist/{Card-BwEzhUW6.cjs → Card-CruyYUqd.cjs} +2 -2
- package/dist/{Card-BwEzhUW6.cjs.map → Card-CruyYUqd.cjs.map} +1 -1
- package/dist/{Card-CYLat33l.js → Card-Dy66r68A.js} +2 -2
- package/dist/{Card-CYLat33l.js.map → Card-Dy66r68A.js.map} +1 -1
- package/dist/{LockedThumbnail-BvYmQvT2.js → LockedThumbnail-BJxXEcxk.js} +2 -2
- package/dist/{LockedThumbnail-BvYmQvT2.js.map → LockedThumbnail-BJxXEcxk.js.map} +1 -1
- package/dist/{LockedThumbnail-CuCWVcEL.cjs → LockedThumbnail-DrsPt5LN.cjs} +2 -2
- package/dist/{LockedThumbnail-CuCWVcEL.cjs.map → LockedThumbnail-DrsPt5LN.cjs.map} +1 -1
- package/dist/index-BIInWpum.cjs +2 -0
- package/dist/index-BIInWpum.cjs.map +1 -0
- package/dist/{index-CxKVYxq6.js → index-CPa6Qru7.js} +869 -828
- package/dist/index-CPa6Qru7.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/CustomChannelPreview.stories.tsx +43 -1
- package/src/components/ChannelList/CustomChannelPreview.tsx +8 -3
- package/src/components/CustomMessage/CustomMessage.stories.tsx +43 -38
- package/src/components/CustomMessage/CustomMessageActions.tsx +30 -16
- package/src/components/CustomMessage/index.tsx +37 -28
- package/dist/index-BQv7yPeG.cjs +0 -2
- package/dist/index-BQv7yPeG.cjs.map +0 -1
- package/dist/index-CxKVYxq6.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as n, jsxs as m, Fragment as ie } from "react/jsx-runtime";
|
|
2
2
|
import y from "classnames";
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as Ge, GiftIcon as ms, XIcon as
|
|
3
|
+
import $, { createContext as Ze, useContext as Ke, useCallback as V, useState as z, useRef as Z, useEffect as X, useMemo as re, Suspense as Je } from "react";
|
|
4
|
+
import { StreamChatService as Sn } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Tn, ChannelList as An, DateSeparator as Mn, useChannelStateContext as me, useChatContext as Qe, areMessageUIPropsEqual as Dn, useMessageReminder as Rn, useComponentContext as Gt, Attachment as Ln, EditMessageModal as Fn, MessageBlocked as On, MessageBouncePrompt as zn, MessageDeleted as Pn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as $n, ReminderNotification as jn, StreamedMessageText as Un, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Dt, Poll as Xn, MessageErrorIcon as Zn, useMessageContext as xe, useMessageComposer as Kn, useStateStore as Jn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, SimpleAttachmentSelector as ns, QuotedMessagePreview as ss, AttachmentPreviewList as as, TextareaComposer as rs, MessageTimestamp as ze, AIStates as Pe, useTypingContext as is, useAIState as os, Channel as ls, WithComponents as cs, Window as ds, MessageList as us } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ge, GiftIcon as ms, XIcon as we, SpinnerGapIcon as Be, SignOutIcon as hs, ProhibitInsetIcon as Rt, FlagIcon as Ht, FileIcon as Yt, ImageIcon as fs, SpeakerHighIcon as gs, VideoCameraIcon as qt, FileMdIcon as bs, FileTextIcon as ps, FileZipIcon as vs, FilePptIcon as xs, FileCsvIcon as ws, FileXlsIcon as Ns, FileDocIcon as ys, FilePdfIcon as _s, CircleNotchIcon as pe, PlayIcon as He, PauseIcon as Cs, LinkIcon as ks, DownloadSimpleIcon as ve, ThumbsUpIcon as Es, ThumbsDownIcon as Is, TrashSimpleIcon as Ss, ArrowUpIcon as Ts, SparkleIcon as Ye, ProhibitIcon as As, ArrowLeftIcon as Lt, CaretRightIcon as qe, DotsThreeIcon as Ft, PencilSimpleIcon as Ms, CaretLeftIcon as Ds } from "@phosphor-icons/react";
|
|
7
7
|
import { MessageActions as Rs, DefaultDropdownActionButton as Wt } from "stream-chat-react/experimental";
|
|
8
8
|
import { LinkPreviewsManager as Ot } from "stream-chat";
|
|
9
|
-
const
|
|
9
|
+
const Xt = Ze({
|
|
10
10
|
service: null,
|
|
11
11
|
client: null,
|
|
12
12
|
isConnected: !1,
|
|
@@ -16,7 +16,7 @@ const qt = Ze({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), et = () => Ke(
|
|
19
|
+
}), et = () => Ke(Xt), Ni = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
@@ -24,9 +24,9 @@ const qt = Ze({
|
|
|
24
24
|
capabilities: r = {},
|
|
25
25
|
debug: i = !1
|
|
26
26
|
}) => {
|
|
27
|
-
const l =
|
|
28
|
-
(
|
|
29
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
const l = V(
|
|
28
|
+
(A, ...O) => {
|
|
29
|
+
i && console.log(`🔥 [MessagingProvider] ${A}`, ...O);
|
|
30
30
|
},
|
|
31
31
|
[i]
|
|
32
32
|
);
|
|
@@ -41,9 +41,9 @@ const qt = Ze({
|
|
|
41
41
|
apiKey: a,
|
|
42
42
|
serviceConfig: s,
|
|
43
43
|
capabilities: r
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
renderCount:
|
|
44
|
+
}), I = Z(0);
|
|
45
|
+
I.current++, l("📊 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
49
|
userChanged: w.current.userId !== (t == null ? void 0 : t.id),
|
|
@@ -57,9 +57,9 @@ const qt = Ze({
|
|
|
57
57
|
serviceConfig: s,
|
|
58
58
|
capabilities: r
|
|
59
59
|
}, X(() => {
|
|
60
|
-
const
|
|
60
|
+
const A = I.current;
|
|
61
61
|
if (l("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
62
|
-
renderCount:
|
|
62
|
+
renderCount: A,
|
|
63
63
|
apiKey: !!a,
|
|
64
64
|
serviceConfig: !!s,
|
|
65
65
|
dependencies: {
|
|
@@ -70,34 +70,34 @@ const qt = Ze({
|
|
|
70
70
|
}
|
|
71
71
|
}), !a || !s) {
|
|
72
72
|
l("⚠️ SERVICE INIT SKIPPED", {
|
|
73
|
-
renderCount:
|
|
73
|
+
renderCount: A,
|
|
74
74
|
reason: "Missing apiKey or serviceConfig"
|
|
75
75
|
});
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
l("🚀 CREATING NEW SERVICE", {
|
|
79
|
-
renderCount:
|
|
79
|
+
renderCount: A,
|
|
80
80
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
|
|
81
81
|
serviceConfigChanged: w.current.serviceConfig !== s
|
|
82
82
|
});
|
|
83
|
-
const O = new
|
|
83
|
+
const O = new Sn({
|
|
84
84
|
...s,
|
|
85
85
|
apiKey: a,
|
|
86
86
|
debug: i
|
|
87
87
|
});
|
|
88
88
|
return d(O), l("✅ SERVICE SET", {
|
|
89
|
-
renderCount:
|
|
89
|
+
renderCount: A,
|
|
90
90
|
serviceInstance: !!O
|
|
91
91
|
}), () => {
|
|
92
92
|
l("🧹 SERVICE CLEANUP", {
|
|
93
|
-
renderCount:
|
|
93
|
+
renderCount: A,
|
|
94
94
|
reason: "Effect cleanup"
|
|
95
95
|
}), O.disconnectUser().catch(console.error);
|
|
96
96
|
};
|
|
97
97
|
}, [a, s, i, l]);
|
|
98
|
-
const
|
|
98
|
+
const S = Z(null);
|
|
99
99
|
X(() => {
|
|
100
|
-
var O,
|
|
100
|
+
var O, E;
|
|
101
101
|
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
102
102
|
hasService: !!o,
|
|
103
103
|
hasUser: !!t,
|
|
@@ -113,7 +113,7 @@ const qt = Ze({
|
|
|
113
113
|
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
if (((O =
|
|
116
|
+
if (((O = S.current) == null ? void 0 : O.serviceId) === o && ((E = S.current) == null ? void 0 : E.userId) === t.id) {
|
|
117
117
|
l(
|
|
118
118
|
"⚠️ USER CONNECTION SKIPPED",
|
|
119
119
|
"Already connected this user with this service"
|
|
@@ -124,16 +124,16 @@ const qt = Ze({
|
|
|
124
124
|
l("🚀 STARTING USER CONNECTION", { userId: t.id }), N.current = !0, b(!0), v(null);
|
|
125
125
|
try {
|
|
126
126
|
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
127
|
-
const
|
|
128
|
-
g(
|
|
127
|
+
const R = await o.connectUser(t);
|
|
128
|
+
g(R), f(!0), S.current = { serviceId: o, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
|
|
129
129
|
userId: t.id,
|
|
130
|
-
clientId:
|
|
130
|
+
clientId: R.userID
|
|
131
131
|
});
|
|
132
|
-
} catch (
|
|
133
|
-
const
|
|
134
|
-
v(
|
|
132
|
+
} catch (R) {
|
|
133
|
+
const P = R instanceof Error ? R.message : "Connection failed";
|
|
134
|
+
v(P), l("❌ USER CONNECTION ERROR", {
|
|
135
135
|
userId: t.id,
|
|
136
|
-
error:
|
|
136
|
+
error: P
|
|
137
137
|
});
|
|
138
138
|
} finally {
|
|
139
139
|
b(!1), N.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
@@ -149,12 +149,12 @@ const qt = Ze({
|
|
|
149
149
|
o && u ? (l(
|
|
150
150
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
151
151
|
"Cleaning up connection on unmount"
|
|
152
|
-
),
|
|
152
|
+
), S.current = null, o.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
|
|
153
153
|
hasService: !!o,
|
|
154
154
|
isConnected: u
|
|
155
155
|
});
|
|
156
156
|
}), [o, u, l]);
|
|
157
|
-
const
|
|
157
|
+
const T = V(async () => {
|
|
158
158
|
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
159
159
|
hasService: !!o,
|
|
160
160
|
hasUser: !!t
|
|
@@ -165,10 +165,10 @@ const qt = Ze({
|
|
|
165
165
|
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
|
|
166
166
|
try {
|
|
167
167
|
l("🔌 DISCONNECTING FOR REFRESH"), await o.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
168
|
-
const
|
|
169
|
-
g(
|
|
170
|
-
} catch (
|
|
171
|
-
const O =
|
|
168
|
+
const A = await o.connectUser(t);
|
|
169
|
+
g(A), f(!0), v(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
170
|
+
} catch (A) {
|
|
171
|
+
const O = A instanceof Error ? A.message : "Refresh failed";
|
|
172
172
|
v(O), l("❌ CONNECTION REFRESH ERROR", {
|
|
173
173
|
userId: t.id,
|
|
174
174
|
error: O
|
|
@@ -176,7 +176,7 @@ const qt = Ze({
|
|
|
176
176
|
} finally {
|
|
177
177
|
b(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
178
178
|
}
|
|
179
|
-
}, [o, t, l]),
|
|
179
|
+
}, [o, t, l]), D = $.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
180
180
|
hasService: !!o,
|
|
181
181
|
hasClient: !!h,
|
|
182
182
|
isConnected: u,
|
|
@@ -190,7 +190,7 @@ const qt = Ze({
|
|
|
190
190
|
isLoading: c,
|
|
191
191
|
error: x,
|
|
192
192
|
capabilities: r,
|
|
193
|
-
refreshConnection:
|
|
193
|
+
refreshConnection: T,
|
|
194
194
|
debug: i
|
|
195
195
|
}), [
|
|
196
196
|
o,
|
|
@@ -199,16 +199,16 @@ const qt = Ze({
|
|
|
199
199
|
c,
|
|
200
200
|
x,
|
|
201
201
|
r,
|
|
202
|
-
|
|
202
|
+
T,
|
|
203
203
|
i,
|
|
204
204
|
l
|
|
205
205
|
]);
|
|
206
206
|
return l("🔄 RENDER END", {
|
|
207
|
-
renderCount:
|
|
207
|
+
renderCount: I.current,
|
|
208
208
|
willRenderChat: !!(h && u),
|
|
209
|
-
contextValueReady: !!
|
|
210
|
-
}), /* @__PURE__ */ n(
|
|
211
|
-
|
|
209
|
+
contextValueReady: !!D
|
|
210
|
+
}), /* @__PURE__ */ n(Xt.Provider, { value: D, children: h && u ? /* @__PURE__ */ n(
|
|
211
|
+
Tn,
|
|
212
212
|
{
|
|
213
213
|
client: h,
|
|
214
214
|
customClasses: {
|
|
@@ -224,14 +224,14 @@ function Fs(e) {
|
|
|
224
224
|
for (const s of t)
|
|
225
225
|
e.state.addMessageSorted(s.message);
|
|
226
226
|
}
|
|
227
|
-
const
|
|
227
|
+
const Zt = $.createContext({
|
|
228
228
|
selectedChannel: void 0,
|
|
229
229
|
onChannelSelect: () => {
|
|
230
230
|
},
|
|
231
231
|
debug: !1,
|
|
232
232
|
renderMessagePreview: void 0,
|
|
233
233
|
viewerLanguage: void 0
|
|
234
|
-
}), Os =
|
|
234
|
+
}), Os = Zt.Provider, zs = () => $.useContext(Zt), Kt = (e) => {
|
|
235
235
|
var a, r;
|
|
236
236
|
const [t, s] = z(
|
|
237
237
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
@@ -278,7 +278,7 @@ const Xt = B.createContext({
|
|
|
278
278
|
function $s(e) {
|
|
279
279
|
return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function Jt({
|
|
282
282
|
message: e,
|
|
283
283
|
viewerLanguage: t
|
|
284
284
|
}) {
|
|
@@ -431,18 +431,18 @@ const oe = ({
|
|
|
431
431
|
), Ys = (e) => {
|
|
432
432
|
var t;
|
|
433
433
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
|
|
434
|
-
},
|
|
434
|
+
}, qs = (e) => {
|
|
435
435
|
var t;
|
|
436
436
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
|
|
437
437
|
}, Me = (e) => {
|
|
438
438
|
var t;
|
|
439
439
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
|
|
440
|
-
},
|
|
440
|
+
}, Ws = (e) => {
|
|
441
441
|
var t;
|
|
442
442
|
return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
|
|
443
|
-
},
|
|
443
|
+
}, Qt = (e) => Ys(e) || qs(e), Xs = (e) => {
|
|
444
444
|
var t;
|
|
445
|
-
return
|
|
445
|
+
return Qt(e) && !((t = e.text) != null && t.trim());
|
|
446
446
|
}, $e = ({
|
|
447
447
|
message: e,
|
|
448
448
|
standalone: t = !1,
|
|
@@ -450,7 +450,7 @@ const oe = ({
|
|
|
450
450
|
hasAttachment: a = !1
|
|
451
451
|
}) => {
|
|
452
452
|
var u;
|
|
453
|
-
const r =
|
|
453
|
+
const r = Qt(e), i = Me(e);
|
|
454
454
|
if (!r && !i)
|
|
455
455
|
return null;
|
|
456
456
|
if (r) {
|
|
@@ -474,9 +474,9 @@ const oe = ({
|
|
|
474
474
|
g,
|
|
475
475
|
h
|
|
476
476
|
] }) });
|
|
477
|
-
},
|
|
477
|
+
}, en = $.memo(
|
|
478
478
|
({ channel: e, unread: t }) => {
|
|
479
|
-
var
|
|
479
|
+
var D, A, O;
|
|
480
480
|
const {
|
|
481
481
|
selectedChannel: s,
|
|
482
482
|
onChannelSelect: a,
|
|
@@ -485,37 +485,39 @@ const oe = ({
|
|
|
485
485
|
viewerLanguage: l
|
|
486
486
|
} = zs(), o = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
|
|
487
487
|
e && a(e);
|
|
488
|
-
}, h = (
|
|
489
|
-
const
|
|
490
|
-
!
|
|
491
|
-
}, u = Object.values(((
|
|
492
|
-
(
|
|
493
|
-
var
|
|
494
|
-
return ((
|
|
488
|
+
}, h = (E) => {
|
|
489
|
+
const R = E.key === "Enter" || E.key === " ", P = E.repeat;
|
|
490
|
+
!R || P || (E.preventDefault(), d());
|
|
491
|
+
}, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
|
|
492
|
+
(E) => {
|
|
493
|
+
var R, P;
|
|
494
|
+
return ((R = E.user) == null ? void 0 : R.id) && E.user.id !== ((P = e == null ? void 0 : e._client) == null ? void 0 : P.userID);
|
|
495
495
|
}
|
|
496
|
-
), f = tt(u == null ? void 0 : u.user), c = (
|
|
497
|
-
var
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
500
|
-
for (let
|
|
501
|
-
if (
|
|
496
|
+
), f = tt(u == null ? void 0 : u.user), c = (A = u == null ? void 0 : u.user) == null ? void 0 : A.image, b = (() => {
|
|
497
|
+
var R;
|
|
498
|
+
const E = (R = e == null ? void 0 : e.state) == null ? void 0 : R.messages;
|
|
499
|
+
if (E != null && E.length) {
|
|
500
|
+
for (let P = E.length - 1; P >= 0; P--)
|
|
501
|
+
if (E[P].type !== "system") return E[P];
|
|
502
502
|
}
|
|
503
503
|
})(), v = (() => {
|
|
504
|
-
var
|
|
505
|
-
const
|
|
504
|
+
var B, G, U, L;
|
|
505
|
+
const E = Jt({
|
|
506
506
|
message: b,
|
|
507
507
|
viewerLanguage: l
|
|
508
508
|
});
|
|
509
|
-
if (
|
|
510
|
-
if (((
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
509
|
+
if (((B = b == null ? void 0 : b.metadata) == null ? void 0 : B.custom_type) === "MESSAGE_TIP") return E ? `💵 ${E}` : "💵 Sent a tip";
|
|
510
|
+
if (((G = b == null ? void 0 : b.metadata) == null ? void 0 : G.custom_type) === "MESSAGE_PAID") return E ? `💰 ${E}` : "💰 Sent a message";
|
|
511
|
+
if (((U = b == null ? void 0 : b.metadata) == null ? void 0 : U.custom_type) === "MESSAGE_ATTACHMENT") return E ? `📎 ${E}` : "📎 Sent an attachment";
|
|
512
|
+
if (E) return E;
|
|
513
|
+
const C = (L = b == null ? void 0 : b.attachments) == null ? void 0 : L[0];
|
|
514
|
+
return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
515
|
+
})(), N = b != null && b.created_at ? Bs(new Date(b.created_at)) : "", w = b ? Me(b) : !1, I = i ? i(b, v) : `${w ? "✨ " : ""}${v}`, S = Kt(e), T = t ?? 0;
|
|
514
516
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
515
517
|
channelId: e == null ? void 0 : e.id,
|
|
516
518
|
isSelected: o,
|
|
517
519
|
participantName: f,
|
|
518
|
-
unreadCount:
|
|
520
|
+
unreadCount: T,
|
|
519
521
|
hasTimestamp: !!N
|
|
520
522
|
}), /* @__PURE__ */ n(
|
|
521
523
|
"div",
|
|
@@ -539,7 +541,7 @@ const oe = ({
|
|
|
539
541
|
name: f,
|
|
540
542
|
image: c,
|
|
541
543
|
size: 44,
|
|
542
|
-
starred:
|
|
544
|
+
starred: S,
|
|
543
545
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
544
546
|
}
|
|
545
547
|
),
|
|
@@ -553,7 +555,7 @@ const oe = ({
|
|
|
553
555
|
o ? "text-primary" : "text-charcoal"
|
|
554
556
|
),
|
|
555
557
|
children: [
|
|
556
|
-
|
|
558
|
+
S && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
557
559
|
f
|
|
558
560
|
]
|
|
559
561
|
}
|
|
@@ -561,8 +563,8 @@ const oe = ({
|
|
|
561
563
|
N && /* @__PURE__ */ n("span", { className: "text-xs text-stone flex-shrink-0", children: N })
|
|
562
564
|
] }),
|
|
563
565
|
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
564
|
-
/* @__PURE__ */ n("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
565
|
-
|
|
566
|
+
/* @__PURE__ */ n("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: I }),
|
|
567
|
+
T > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: T > 99 ? "99+" : T })
|
|
566
568
|
] })
|
|
567
569
|
] })
|
|
568
570
|
] })
|
|
@@ -570,8 +572,8 @@ const oe = ({
|
|
|
570
572
|
);
|
|
571
573
|
}
|
|
572
574
|
);
|
|
573
|
-
|
|
574
|
-
const Zs = { last_message_at: -1 },
|
|
575
|
+
en.displayName = "CustomChannelPreview";
|
|
576
|
+
const Zs = { last_message_at: -1 }, tn = $.memo(
|
|
575
577
|
({
|
|
576
578
|
onChannelSelect: e,
|
|
577
579
|
selectedChannel: t,
|
|
@@ -586,9 +588,9 @@ const Zs = { last_message_at: -1 }, en = B.memo(
|
|
|
586
588
|
renderMessagePreview: g,
|
|
587
589
|
viewerLanguage: u
|
|
588
590
|
}) => {
|
|
589
|
-
const f =
|
|
591
|
+
const f = $.useRef(0);
|
|
590
592
|
f.current++;
|
|
591
|
-
const { debug: c = !1 } = et(), b =
|
|
593
|
+
const { debug: c = !1 } = et(), b = $.useCallback(
|
|
592
594
|
(v) => {
|
|
593
595
|
for (const N of v)
|
|
594
596
|
Fs(N);
|
|
@@ -601,7 +603,7 @@ const Zs = { last_message_at: -1 }, en = B.memo(
|
|
|
601
603
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
602
604
|
filters: s
|
|
603
605
|
});
|
|
604
|
-
const x =
|
|
606
|
+
const x = $.useMemo(
|
|
605
607
|
() => ({
|
|
606
608
|
selectedChannel: t,
|
|
607
609
|
onChannelSelect: e,
|
|
@@ -625,7 +627,7 @@ const Zs = { last_message_at: -1 }, en = B.memo(
|
|
|
625
627
|
d
|
|
626
628
|
),
|
|
627
629
|
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Os, { value: x, children: /* @__PURE__ */ n(
|
|
628
|
-
|
|
630
|
+
An,
|
|
629
631
|
{
|
|
630
632
|
filters: s,
|
|
631
633
|
sort: o,
|
|
@@ -634,7 +636,7 @@ const Zs = { last_message_at: -1 }, en = B.memo(
|
|
|
634
636
|
onMessageNew: r,
|
|
635
637
|
onAddedToChannel: i,
|
|
636
638
|
channelRenderFilterFn: b,
|
|
637
|
-
Preview:
|
|
639
|
+
Preview: en,
|
|
638
640
|
EmptyStateIndicator: h
|
|
639
641
|
},
|
|
640
642
|
`${JSON.stringify(s)}:${JSON.stringify(o)}`
|
|
@@ -643,8 +645,8 @@ const Zs = { last_message_at: -1 }, en = B.memo(
|
|
|
643
645
|
);
|
|
644
646
|
}
|
|
645
647
|
);
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
+
tn.displayName = "ChannelList";
|
|
649
|
+
const Te = ({
|
|
648
650
|
variant: e = "default",
|
|
649
651
|
className: t,
|
|
650
652
|
children: s,
|
|
@@ -684,7 +686,7 @@ function Ks({ label: e, className: t, children: s, ...a }) {
|
|
|
684
686
|
);
|
|
685
687
|
}
|
|
686
688
|
function Js({ onClick: e }) {
|
|
687
|
-
return /* @__PURE__ */ n(Ks, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(
|
|
689
|
+
return /* @__PURE__ */ n(Ks, { label: "Close", onClick: e, className: "p-1", children: /* @__PURE__ */ n(we, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
688
690
|
}
|
|
689
691
|
const Qs = ({
|
|
690
692
|
dialogRef: e,
|
|
@@ -702,66 +704,66 @@ const Qs = ({
|
|
|
702
704
|
customProfileContent: f,
|
|
703
705
|
customChannelActions: c
|
|
704
706
|
}) => {
|
|
705
|
-
var
|
|
706
|
-
const { service: b, debug: x } = et(), [v, N] = z(!1), [w,
|
|
707
|
+
var U, L, F, H;
|
|
708
|
+
const { service: b, debug: x } = et(), [v, N] = z(!1), [w, I] = z(!1), [S, T] = z(!1), D = V(async () => {
|
|
707
709
|
var _;
|
|
708
710
|
if (!(!b || !((_ = s == null ? void 0 : s.user) != null && _.id)))
|
|
709
711
|
try {
|
|
710
712
|
const p = (await b.getBlockedUsers()).some(
|
|
711
|
-
(
|
|
713
|
+
(k) => {
|
|
712
714
|
var Y;
|
|
713
|
-
return
|
|
715
|
+
return k.blocked_user_id === ((Y = s == null ? void 0 : s.user) == null ? void 0 : Y.id);
|
|
714
716
|
}
|
|
715
717
|
);
|
|
716
718
|
N(p);
|
|
717
|
-
} catch (
|
|
719
|
+
} catch (M) {
|
|
718
720
|
console.error(
|
|
719
721
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
720
|
-
|
|
722
|
+
M
|
|
721
723
|
);
|
|
722
724
|
}
|
|
723
|
-
}, [b, (
|
|
725
|
+
}, [b, (U = s == null ? void 0 : s.user) == null ? void 0 : U.id]);
|
|
724
726
|
X(() => {
|
|
725
|
-
|
|
726
|
-
}, [
|
|
727
|
-
const
|
|
727
|
+
D();
|
|
728
|
+
}, [D]);
|
|
729
|
+
const A = async () => {
|
|
728
730
|
var _;
|
|
729
731
|
if (!w) {
|
|
730
|
-
h == null || h(), x && console.log("[ChannelInfoDialog] Leave conversation", r.cid),
|
|
732
|
+
h == null || h(), x && console.log("[ChannelInfoDialog] Leave conversation", r.cid), I(!0);
|
|
731
733
|
try {
|
|
732
|
-
const
|
|
733
|
-
await r.hide(
|
|
734
|
-
} catch (
|
|
735
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
734
|
+
const M = ((_ = r._client) == null ? void 0 : _.userID) ?? null;
|
|
735
|
+
await r.hide(M, !1), l && await l(r), t();
|
|
736
|
+
} catch (M) {
|
|
737
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", M);
|
|
736
738
|
} finally {
|
|
737
|
-
|
|
739
|
+
I(!1);
|
|
738
740
|
}
|
|
739
741
|
}
|
|
740
742
|
}, O = async () => {
|
|
741
|
-
var _,
|
|
742
|
-
if (!(
|
|
743
|
-
g == null || g(), x && console.log("[ChannelInfoDialog] Block member", (_ = s == null ? void 0 : s.user) == null ? void 0 : _.id),
|
|
743
|
+
var _, M, p;
|
|
744
|
+
if (!(S || !b)) {
|
|
745
|
+
g == null || g(), x && console.log("[ChannelInfoDialog] Block member", (_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), T(!0);
|
|
744
746
|
try {
|
|
745
|
-
await b.blockUser((
|
|
746
|
-
} catch (
|
|
747
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
747
|
+
await b.blockUser((M = s == null ? void 0 : s.user) == null ? void 0 : M.id), o && await o((p = s == null ? void 0 : s.user) == null ? void 0 : p.id), t();
|
|
748
|
+
} catch (k) {
|
|
749
|
+
console.error("[ChannelInfoDialog] Failed to block member", k);
|
|
748
750
|
} finally {
|
|
749
|
-
|
|
751
|
+
T(!1);
|
|
750
752
|
}
|
|
751
753
|
}
|
|
752
|
-
},
|
|
753
|
-
var _,
|
|
754
|
-
if (!(
|
|
755
|
-
g == null || g(), x && console.log("[ChannelInfoDialog] Unblock member", (_ = s == null ? void 0 : s.user) == null ? void 0 : _.id),
|
|
754
|
+
}, E = async () => {
|
|
755
|
+
var _, M, p;
|
|
756
|
+
if (!(S || !b)) {
|
|
757
|
+
g == null || g(), x && console.log("[ChannelInfoDialog] Unblock member", (_ = s == null ? void 0 : s.user) == null ? void 0 : _.id), T(!0);
|
|
756
758
|
try {
|
|
757
|
-
await b.unBlockUser((
|
|
758
|
-
} catch (
|
|
759
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
759
|
+
await b.unBlockUser((M = s == null ? void 0 : s.user) == null ? void 0 : M.id), o && await o((p = s == null ? void 0 : s.user) == null ? void 0 : p.id), t();
|
|
760
|
+
} catch (k) {
|
|
761
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", k);
|
|
760
762
|
} finally {
|
|
761
|
-
|
|
763
|
+
T(!1);
|
|
762
764
|
}
|
|
763
765
|
}
|
|
764
|
-
},
|
|
766
|
+
}, R = () => {
|
|
765
767
|
u == null || u(), t(), window.open(
|
|
766
768
|
"https://linktr.ee/s/about/trust-center/report",
|
|
767
769
|
"_blank",
|
|
@@ -769,7 +771,7 @@ const Qs = ({
|
|
|
769
771
|
);
|
|
770
772
|
};
|
|
771
773
|
if (!s) return null;
|
|
772
|
-
const
|
|
774
|
+
const P = a ?? tt(s.user), q = (L = s.user) == null ? void 0 : L.image, C = (F = s.user) == null ? void 0 : F.username, B = C ? `linktr.ee/${C}` : void 0, G = ((H = s.user) == null ? void 0 : H.id) || "unknown";
|
|
773
775
|
return (
|
|
774
776
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
775
777
|
/* @__PURE__ */ n(
|
|
@@ -797,16 +799,16 @@ const Qs = ({
|
|
|
797
799
|
/* @__PURE__ */ n(
|
|
798
800
|
oe,
|
|
799
801
|
{
|
|
800
|
-
id:
|
|
801
|
-
name:
|
|
802
|
-
image:
|
|
802
|
+
id: G,
|
|
803
|
+
name: P,
|
|
804
|
+
image: q,
|
|
803
805
|
size: 88,
|
|
804
806
|
shape: "circle"
|
|
805
807
|
}
|
|
806
808
|
),
|
|
807
809
|
/* @__PURE__ */ m("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
808
|
-
/* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
809
|
-
|
|
810
|
+
/* @__PURE__ */ n("p", { className: "truncate text-base font-semibold text-charcoal", children: P }),
|
|
811
|
+
B && /* @__PURE__ */ n("p", { className: "truncate text-sm text-[#00000055]", children: B }),
|
|
810
812
|
i && !f && /* @__PURE__ */ n(
|
|
811
813
|
"span",
|
|
812
814
|
{
|
|
@@ -829,9 +831,9 @@ const Qs = ({
|
|
|
829
831
|
),
|
|
830
832
|
/* @__PURE__ */ m("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
831
833
|
d && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
|
|
832
|
-
|
|
834
|
+
Te,
|
|
833
835
|
{
|
|
834
|
-
onClick:
|
|
836
|
+
onClick: A,
|
|
835
837
|
disabled: w,
|
|
836
838
|
"aria-busy": w,
|
|
837
839
|
children: [
|
|
@@ -841,30 +843,30 @@ const Qs = ({
|
|
|
841
843
|
}
|
|
842
844
|
) }),
|
|
843
845
|
/* @__PURE__ */ n("li", { children: v ? /* @__PURE__ */ m(
|
|
844
|
-
|
|
846
|
+
Te,
|
|
845
847
|
{
|
|
846
|
-
onClick:
|
|
847
|
-
disabled:
|
|
848
|
-
"aria-busy":
|
|
848
|
+
onClick: E,
|
|
849
|
+
disabled: S,
|
|
850
|
+
"aria-busy": S,
|
|
849
851
|
children: [
|
|
850
|
-
|
|
852
|
+
S ? /* @__PURE__ */ n(Be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
|
|
851
853
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
852
854
|
]
|
|
853
855
|
}
|
|
854
856
|
) : /* @__PURE__ */ m(
|
|
855
|
-
|
|
857
|
+
Te,
|
|
856
858
|
{
|
|
857
859
|
onClick: O,
|
|
858
|
-
disabled:
|
|
859
|
-
"aria-busy":
|
|
860
|
+
disabled: S,
|
|
861
|
+
"aria-busy": S,
|
|
860
862
|
children: [
|
|
861
|
-
|
|
863
|
+
S ? /* @__PURE__ */ n(Be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
|
|
862
864
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
863
865
|
]
|
|
864
866
|
}
|
|
865
867
|
) }),
|
|
866
|
-
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
|
|
867
|
-
/* @__PURE__ */ n(
|
|
868
|
+
/* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(Te, { variant: "danger", onClick: R, children: [
|
|
869
|
+
/* @__PURE__ */ n(Ht, { className: "h-5 w-5" }),
|
|
868
870
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
869
871
|
] }) }),
|
|
870
872
|
c
|
|
@@ -874,25 +876,25 @@ const Qs = ({
|
|
|
874
876
|
}
|
|
875
877
|
)
|
|
876
878
|
);
|
|
877
|
-
}, ea = (e) => /* @__PURE__ */ n(Mn, { ...e, position: "center" }),
|
|
879
|
+
}, ea = (e) => /* @__PURE__ */ n(Mn, { ...e, position: "center" }), We = "vote_up", Xe = "vote_down";
|
|
878
880
|
function ta(e) {
|
|
879
|
-
return e != null && e.length ? e.some((t) => t.type === Xe) ? "down" : e.some((t) => t.type ===
|
|
881
|
+
return e != null && e.length ? e.some((t) => t.type === Xe) ? "down" : e.some((t) => t.type === We) ? "up" : null : null;
|
|
880
882
|
}
|
|
881
883
|
function na(e) {
|
|
882
884
|
const { channel: t } = me(), { client: s } = Qe("useMessageVote"), a = re(
|
|
883
885
|
() => ta(e.own_reactions),
|
|
884
886
|
[e.own_reactions]
|
|
885
|
-
), r =
|
|
887
|
+
), r = V(async () => {
|
|
886
888
|
if (s != null && s.userID)
|
|
887
889
|
try {
|
|
888
|
-
a === "up" ? await t.deleteReaction(e.id,
|
|
890
|
+
a === "up" ? await t.deleteReaction(e.id, We) : await t.sendReaction(
|
|
889
891
|
e.id,
|
|
890
|
-
{ type:
|
|
892
|
+
{ type: We },
|
|
891
893
|
{ enforce_unique: !0, skip_push: !0 }
|
|
892
894
|
);
|
|
893
895
|
} catch {
|
|
894
896
|
}
|
|
895
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
897
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = V(async () => {
|
|
896
898
|
if (s != null && s.userID)
|
|
897
899
|
try {
|
|
898
900
|
a === "down" ? await t.deleteReaction(e.id, Xe) : await t.sendReaction(
|
|
@@ -905,13 +907,13 @@ function na(e) {
|
|
|
905
907
|
}, [t, s == null ? void 0 : s.userID, e.id, a]);
|
|
906
908
|
return { selected: a, voteUp: r, voteDown: i };
|
|
907
909
|
}
|
|
908
|
-
const sa =
|
|
910
|
+
const sa = $.lazy(() => import("./Card-BwygcpzI.js")), aa = $.lazy(() => import("./Card-Dy66r68A.js")), ra = $.lazy(() => import("./Card-CJDGgG0O.js")), nt = () => /* @__PURE__ */ n(
|
|
909
911
|
"div",
|
|
910
912
|
{
|
|
911
913
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
|
|
912
914
|
"aria-hidden": !0
|
|
913
915
|
}
|
|
914
|
-
), ia = (e) => /* @__PURE__ */ n(Je, { fallback: /* @__PURE__ */ n(nt, {}), children: /* @__PURE__ */ n(sa, { ...e }) }),
|
|
916
|
+
), ia = (e) => /* @__PURE__ */ n(Je, { fallback: /* @__PURE__ */ n(nt, {}), children: /* @__PURE__ */ n(sa, { ...e }) }), nn = (e) => /* @__PURE__ */ n(Je, { fallback: /* @__PURE__ */ n(nt, {}), children: /* @__PURE__ */ n(aa, { ...e }) }), sn = (e) => /* @__PURE__ */ n(Je, { fallback: /* @__PURE__ */ n(nt, {}), children: /* @__PURE__ */ n(ra, { ...e }) }), oa = nn, la = sn, Bt = { Composer: ia, Sent: nn, Received: sn, Creator: oa, Visitor: la }, ca = [
|
|
915
917
|
[/pdf/, "pdf"],
|
|
916
918
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
917
919
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -924,34 +926,34 @@ const sa = B.lazy(() => import("./Card-BpVephnj.js")), aa = B.lazy(() => import(
|
|
|
924
926
|
function le(e) {
|
|
925
927
|
return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
|
|
926
928
|
}
|
|
927
|
-
function
|
|
929
|
+
function an(e) {
|
|
928
930
|
const t = ca.find(
|
|
929
931
|
([s]) => s.test(e)
|
|
930
932
|
);
|
|
931
933
|
return t ? t[1] : "generic";
|
|
932
934
|
}
|
|
933
935
|
const da = {
|
|
934
|
-
video:
|
|
935
|
-
audio:
|
|
936
|
-
image:
|
|
937
|
-
document:
|
|
936
|
+
video: qt,
|
|
937
|
+
audio: gs,
|
|
938
|
+
image: fs,
|
|
939
|
+
document: Yt
|
|
938
940
|
}, ua = {
|
|
939
|
-
pdf:
|
|
940
|
-
doc:
|
|
941
|
-
xls:
|
|
942
|
-
csv:
|
|
943
|
-
ppt:
|
|
944
|
-
zip:
|
|
945
|
-
text:
|
|
946
|
-
markdown:
|
|
947
|
-
generic:
|
|
941
|
+
pdf: _s,
|
|
942
|
+
doc: ys,
|
|
943
|
+
xls: Ns,
|
|
944
|
+
csv: ws,
|
|
945
|
+
ppt: xs,
|
|
946
|
+
zip: vs,
|
|
947
|
+
text: ps,
|
|
948
|
+
markdown: bs,
|
|
949
|
+
generic: Yt
|
|
948
950
|
};
|
|
949
951
|
function ma(e) {
|
|
950
952
|
const t = le(e);
|
|
951
|
-
return t !== "document" ? da[t] : ua[
|
|
953
|
+
return t !== "document" ? da[t] : ua[an(e)];
|
|
952
954
|
}
|
|
953
955
|
function ge(e, t) {
|
|
954
|
-
return
|
|
956
|
+
return $.createElement(ma(e), t);
|
|
955
957
|
}
|
|
956
958
|
const ha = (e) => {
|
|
957
959
|
var t, s;
|
|
@@ -968,23 +970,23 @@ const ha = (e) => {
|
|
|
968
970
|
muted: d = !1,
|
|
969
971
|
onContainerClick: h
|
|
970
972
|
}) => {
|
|
971
|
-
const g = le(t), u = Z(null), f = Z(null), c = Z(null), b = Z(r), [x, v] = z(a), [N, w] = z(0), [
|
|
973
|
+
const g = le(t), u = Z(null), f = Z(null), c = Z(null), b = Z(r), [x, v] = z(a), [N, w] = z(0), [I, S] = z(!1), [T, D] = z(!1), [A, O] = z(!1), [E, R] = z(!1), [P, q] = z(!0), [C, B] = z(null), G = V(() => {
|
|
972
974
|
O(!1), v(!0);
|
|
973
|
-
}, []),
|
|
974
|
-
const
|
|
975
|
-
if (!
|
|
976
|
-
const Y =
|
|
975
|
+
}, []), U = V((p) => {
|
|
976
|
+
const k = f.current;
|
|
977
|
+
if (!k) return 0;
|
|
978
|
+
const Y = k.getBoundingClientRect();
|
|
977
979
|
return Math.max(
|
|
978
980
|
0,
|
|
979
981
|
Math.min(1, (ha(p) - Y.left) / Y.width)
|
|
980
982
|
);
|
|
981
|
-
}, []),
|
|
982
|
-
const
|
|
983
|
-
|
|
983
|
+
}, []), L = V((p) => {
|
|
984
|
+
const k = u.current;
|
|
985
|
+
k && k.duration && (k.currentTime = p * k.duration);
|
|
984
986
|
}, []), F = (p) => {
|
|
985
|
-
p.stopPropagation(),
|
|
986
|
-
const
|
|
987
|
-
w(
|
|
987
|
+
p.stopPropagation(), S(!0);
|
|
988
|
+
const k = U(p);
|
|
989
|
+
w(k), L(k);
|
|
988
990
|
};
|
|
989
991
|
X(() => {
|
|
990
992
|
r !== void 0 && r !== b.current && (b.current = r, v(r));
|
|
@@ -994,40 +996,40 @@ const ha = (e) => {
|
|
|
994
996
|
return;
|
|
995
997
|
}
|
|
996
998
|
const p = () => {
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
+
const k = u.current;
|
|
1000
|
+
k && k.duration && !I && w(k.currentTime / k.duration), c.current = requestAnimationFrame(p);
|
|
999
1001
|
};
|
|
1000
1002
|
return c.current = requestAnimationFrame(p), () => {
|
|
1001
1003
|
c.current !== null && cancelAnimationFrame(c.current);
|
|
1002
1004
|
};
|
|
1003
|
-
}, [x,
|
|
1005
|
+
}, [x, I]), X(() => {
|
|
1004
1006
|
const p = u.current;
|
|
1005
|
-
p && (x ? p.play().catch((
|
|
1007
|
+
p && (x ? p.play().catch((k) => {
|
|
1006
1008
|
v(!1), O(!0);
|
|
1007
1009
|
}) : p.pause());
|
|
1008
1010
|
}, [x]), X(() => {
|
|
1009
|
-
if (!
|
|
1010
|
-
const p = (Y) => w(
|
|
1011
|
-
|
|
1011
|
+
if (!I) return;
|
|
1012
|
+
const p = (Y) => w(U(Y)), k = (Y) => {
|
|
1013
|
+
S(!1), L(U(Y));
|
|
1012
1014
|
};
|
|
1013
|
-
return window.addEventListener("mousemove", p), window.addEventListener("mouseup",
|
|
1014
|
-
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup",
|
|
1015
|
+
return window.addEventListener("mousemove", p), window.addEventListener("mouseup", k), window.addEventListener("touchmove", p, { passive: !0 }), window.addEventListener("touchend", k), () => {
|
|
1016
|
+
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", k);
|
|
1015
1017
|
};
|
|
1016
|
-
}, [
|
|
1017
|
-
const
|
|
1018
|
+
}, [I, U, L]);
|
|
1019
|
+
const H = C ? { aspectRatio: String(C) } : void 0, _ = C ? "" : " aspect-video", M = Math.round(N * 100);
|
|
1018
1020
|
return /* @__PURE__ */ m(
|
|
1019
1021
|
"div",
|
|
1020
1022
|
{
|
|
1021
1023
|
role: "button",
|
|
1022
1024
|
tabIndex: 0,
|
|
1023
1025
|
className: `relative cursor-pointer overflow-hidden bg-black ${_}`,
|
|
1024
|
-
style:
|
|
1026
|
+
style: H,
|
|
1025
1027
|
onClick: (p) => {
|
|
1026
1028
|
if (h) {
|
|
1027
1029
|
h(p);
|
|
1028
1030
|
return;
|
|
1029
1031
|
}
|
|
1030
|
-
|
|
1032
|
+
A || l && v((k) => !k);
|
|
1031
1033
|
},
|
|
1032
1034
|
onKeyDown: (p) => {
|
|
1033
1035
|
if (!(p.key !== "Enter" && p.key !== " ")) {
|
|
@@ -1035,11 +1037,11 @@ const ha = (e) => {
|
|
|
1035
1037
|
h(p);
|
|
1036
1038
|
return;
|
|
1037
1039
|
}
|
|
1038
|
-
|
|
1040
|
+
A || l && v((k) => !k);
|
|
1039
1041
|
}
|
|
1040
1042
|
},
|
|
1041
1043
|
children: [
|
|
1042
|
-
s && (g === "audio" ||
|
|
1044
|
+
s && (g === "audio" || P) && /* @__PURE__ */ n(
|
|
1043
1045
|
"img",
|
|
1044
1046
|
{
|
|
1045
1047
|
src: s,
|
|
@@ -1047,7 +1049,7 @@ const ha = (e) => {
|
|
|
1047
1049
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
1048
1050
|
}
|
|
1049
1051
|
),
|
|
1050
|
-
!s && (g === "audio" ||
|
|
1052
|
+
!s && (g === "audio" || P) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(t, {
|
|
1051
1053
|
className: "size-12 text-black/20",
|
|
1052
1054
|
weight: "regular"
|
|
1053
1055
|
}) }),
|
|
@@ -1059,11 +1061,11 @@ const ha = (e) => {
|
|
|
1059
1061
|
loop: i,
|
|
1060
1062
|
muted: d,
|
|
1061
1063
|
style: { width: "100%", height: "100%" },
|
|
1062
|
-
onLoadStart: () =>
|
|
1064
|
+
onLoadStart: () => R(!0),
|
|
1063
1065
|
onCanPlay: () => {
|
|
1064
|
-
|
|
1066
|
+
R(!1), q(!1);
|
|
1065
1067
|
},
|
|
1066
|
-
onWaiting: () =>
|
|
1068
|
+
onWaiting: () => R(!0),
|
|
1067
1069
|
onPlay: () => O(!1),
|
|
1068
1070
|
onEnded: () => {
|
|
1069
1071
|
i || (v(!1), w(0));
|
|
@@ -1079,15 +1081,15 @@ const ha = (e) => {
|
|
|
1079
1081
|
muted: d,
|
|
1080
1082
|
playsInline: !0,
|
|
1081
1083
|
style: { width: "100%", height: "100%" },
|
|
1082
|
-
onLoadStart: () =>
|
|
1084
|
+
onLoadStart: () => R(!0),
|
|
1083
1085
|
onCanPlay: () => {
|
|
1084
|
-
|
|
1086
|
+
R(!1), q(!1);
|
|
1085
1087
|
},
|
|
1086
|
-
onWaiting: () =>
|
|
1088
|
+
onWaiting: () => R(!0),
|
|
1087
1089
|
onPlay: () => O(!1),
|
|
1088
1090
|
onLoadedMetadata: () => {
|
|
1089
1091
|
const p = u.current;
|
|
1090
|
-
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight &&
|
|
1092
|
+
p instanceof HTMLVideoElement && p.videoWidth && p.videoHeight && B(p.videoWidth / p.videoHeight);
|
|
1091
1093
|
},
|
|
1092
1094
|
onEnded: () => {
|
|
1093
1095
|
i || (v(!1), w(0));
|
|
@@ -1095,14 +1097,14 @@ const ha = (e) => {
|
|
|
1095
1097
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
1096
1098
|
}
|
|
1097
1099
|
) }),
|
|
1098
|
-
|
|
1100
|
+
E && !A && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
1099
1101
|
pe,
|
|
1100
1102
|
{
|
|
1101
1103
|
className: "size-8 animate-spin text-white/80",
|
|
1102
1104
|
weight: "bold"
|
|
1103
1105
|
}
|
|
1104
1106
|
) }),
|
|
1105
|
-
|
|
1107
|
+
A && !l && /* @__PURE__ */ n(
|
|
1106
1108
|
"div",
|
|
1107
1109
|
{
|
|
1108
1110
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -1110,10 +1112,10 @@ const ha = (e) => {
|
|
|
1110
1112
|
tabIndex: 0,
|
|
1111
1113
|
"aria-label": "Play preview",
|
|
1112
1114
|
onClick: (p) => {
|
|
1113
|
-
p.stopPropagation(),
|
|
1115
|
+
p.stopPropagation(), G();
|
|
1114
1116
|
},
|
|
1115
1117
|
onKeyDown: (p) => {
|
|
1116
|
-
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(),
|
|
1118
|
+
p.key !== "Enter" && p.key !== " " || (p.preventDefault(), p.stopPropagation(), G());
|
|
1117
1119
|
},
|
|
1118
1120
|
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(He, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
1119
1121
|
}
|
|
@@ -1123,7 +1125,7 @@ const ha = (e) => {
|
|
|
1123
1125
|
{
|
|
1124
1126
|
role: "slider",
|
|
1125
1127
|
"aria-label": "Playback position",
|
|
1126
|
-
"aria-valuenow":
|
|
1128
|
+
"aria-valuenow": M,
|
|
1127
1129
|
"aria-valuemin": 0,
|
|
1128
1130
|
"aria-valuemax": 100,
|
|
1129
1131
|
tabIndex: 0,
|
|
@@ -1133,13 +1135,13 @@ const ha = (e) => {
|
|
|
1133
1135
|
onTouchStart: F,
|
|
1134
1136
|
onClick: (p) => p.stopPropagation(),
|
|
1135
1137
|
onKeyDown: (p) => {
|
|
1136
|
-
p.key === "ArrowRight" &&
|
|
1138
|
+
p.key === "ArrowRight" && L(Math.min(1, N + 0.05)), p.key === "ArrowLeft" && L(Math.max(0, N - 0.05));
|
|
1137
1139
|
},
|
|
1138
1140
|
children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
|
|
1139
1141
|
"div",
|
|
1140
1142
|
{
|
|
1141
1143
|
className: "h-full rounded-full bg-white",
|
|
1142
|
-
style: { width: `${
|
|
1144
|
+
style: { width: `${M}%` }
|
|
1143
1145
|
}
|
|
1144
1146
|
) })
|
|
1145
1147
|
}
|
|
@@ -1150,11 +1152,11 @@ const ha = (e) => {
|
|
|
1150
1152
|
{
|
|
1151
1153
|
type: "button",
|
|
1152
1154
|
onClick: (p) => {
|
|
1153
|
-
p.stopPropagation(), v((
|
|
1155
|
+
p.stopPropagation(), v((k) => !k);
|
|
1154
1156
|
},
|
|
1155
1157
|
className: "shrink-0 text-white",
|
|
1156
1158
|
"aria-label": x ? "Pause" : "Play",
|
|
1157
|
-
children: x ? /* @__PURE__ */ n(
|
|
1159
|
+
children: x ? /* @__PURE__ */ n(Cs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(He, { className: "size-5 translate-x-px", weight: "fill" })
|
|
1158
1160
|
}
|
|
1159
1161
|
),
|
|
1160
1162
|
/* @__PURE__ */ m(
|
|
@@ -1162,7 +1164,7 @@ const ha = (e) => {
|
|
|
1162
1164
|
{
|
|
1163
1165
|
role: "slider",
|
|
1164
1166
|
"aria-label": "Playback position",
|
|
1165
|
-
"aria-valuenow":
|
|
1167
|
+
"aria-valuenow": M,
|
|
1166
1168
|
"aria-valuemin": 0,
|
|
1167
1169
|
"aria-valuemax": 100,
|
|
1168
1170
|
tabIndex: 0,
|
|
@@ -1171,21 +1173,21 @@ const ha = (e) => {
|
|
|
1171
1173
|
onMouseDown: F,
|
|
1172
1174
|
onTouchStart: F,
|
|
1173
1175
|
onClick: (p) => p.stopPropagation(),
|
|
1174
|
-
onMouseEnter: () =>
|
|
1175
|
-
onMouseLeave: () =>
|
|
1176
|
+
onMouseEnter: () => D(!0),
|
|
1177
|
+
onMouseLeave: () => D(!1),
|
|
1176
1178
|
onKeyDown: (p) => {
|
|
1177
|
-
p.key === "ArrowRight" &&
|
|
1179
|
+
p.key === "ArrowRight" && L(Math.min(1, N + 0.05)), p.key === "ArrowLeft" && L(Math.max(0, N - 0.05));
|
|
1178
1180
|
},
|
|
1179
1181
|
children: [
|
|
1180
1182
|
/* @__PURE__ */ n(
|
|
1181
1183
|
"div",
|
|
1182
1184
|
{
|
|
1183
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
1185
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || I ? "h-1.5" : "h-1"}`,
|
|
1184
1186
|
children: /* @__PURE__ */ n(
|
|
1185
1187
|
"div",
|
|
1186
1188
|
{
|
|
1187
1189
|
className: "h-full rounded-full bg-white",
|
|
1188
|
-
style: { width: `${
|
|
1190
|
+
style: { width: `${M}%` }
|
|
1189
1191
|
}
|
|
1190
1192
|
)
|
|
1191
1193
|
}
|
|
@@ -1193,8 +1195,8 @@ const ha = (e) => {
|
|
|
1193
1195
|
/* @__PURE__ */ n(
|
|
1194
1196
|
"div",
|
|
1195
1197
|
{
|
|
1196
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
1197
|
-
style: { left: `${
|
|
1198
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || I ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
1199
|
+
style: { left: `${M}%` }
|
|
1198
1200
|
}
|
|
1199
1201
|
)
|
|
1200
1202
|
]
|
|
@@ -1204,7 +1206,7 @@ const ha = (e) => {
|
|
|
1204
1206
|
]
|
|
1205
1207
|
}
|
|
1206
1208
|
);
|
|
1207
|
-
}, $t = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", ga = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5",
|
|
1209
|
+
}, $t = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", ga = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", rn = ({
|
|
1208
1210
|
mimeType: e,
|
|
1209
1211
|
sourceUrl: t,
|
|
1210
1212
|
thumbnailUrl: s,
|
|
@@ -1284,7 +1286,7 @@ const ha = (e) => {
|
|
|
1284
1286
|
})
|
|
1285
1287
|
}
|
|
1286
1288
|
);
|
|
1287
|
-
},
|
|
1289
|
+
}, on = ({
|
|
1288
1290
|
variant: e,
|
|
1289
1291
|
thumbnail: t,
|
|
1290
1292
|
title: s,
|
|
@@ -1350,7 +1352,7 @@ const ha = (e) => {
|
|
|
1350
1352
|
}
|
|
1351
1353
|
);
|
|
1352
1354
|
};
|
|
1353
|
-
function
|
|
1355
|
+
function ln(e) {
|
|
1354
1356
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
1355
1357
|
}
|
|
1356
1358
|
function st(e) {
|
|
@@ -1372,7 +1374,7 @@ function wa(e) {
|
|
|
1372
1374
|
return e ? "text-white/20" : "text-black/20";
|
|
1373
1375
|
}
|
|
1374
1376
|
const at = ({ attachment: e, isMyMessage: t }) => {
|
|
1375
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, h = /* @__PURE__ */ m(
|
|
1377
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: l } = e, o = i ?? l, d = typeof o == "string" && o.trim() !== "" ? o : void 0, h = /* @__PURE__ */ m($.Fragment, { children: [
|
|
1376
1378
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1377
1379
|
"img",
|
|
1378
1380
|
{
|
|
@@ -1384,7 +1386,7 @@ const at = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1384
1386
|
"div",
|
|
1385
1387
|
{
|
|
1386
1388
|
className: `aspect-video w-full rounded-[20px] ${ba(t)} flex items-center justify-center`,
|
|
1387
|
-
children: /* @__PURE__ */ n(
|
|
1389
|
+
children: /* @__PURE__ */ n(ks, { className: `size-12 ${wa(t)}` })
|
|
1388
1390
|
}
|
|
1389
1391
|
) }),
|
|
1390
1392
|
/* @__PURE__ */ m("div", { className: "px-3 pb-3", children: [
|
|
@@ -1395,12 +1397,12 @@ const at = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1395
1397
|
] });
|
|
1396
1398
|
return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: h }) : /* @__PURE__ */ n("div", { className: "block", children: h });
|
|
1397
1399
|
};
|
|
1398
|
-
function
|
|
1400
|
+
function cn(e) {
|
|
1399
1401
|
return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
|
|
1400
1402
|
}
|
|
1401
1403
|
function rt(e) {
|
|
1402
1404
|
var t;
|
|
1403
|
-
return (t = e.attachments) == null ? void 0 : t.find(
|
|
1405
|
+
return (t = e.attachments) == null ? void 0 : t.find(cn);
|
|
1404
1406
|
}
|
|
1405
1407
|
async function Na(e, t) {
|
|
1406
1408
|
let s;
|
|
@@ -1434,7 +1436,7 @@ const ya = ({
|
|
|
1434
1436
|
},
|
|
1435
1437
|
disabled: s,
|
|
1436
1438
|
className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
|
|
1437
|
-
children: s ? /* @__PURE__ */ n(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(
|
|
1439
|
+
children: s ? /* @__PURE__ */ n(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m($.Fragment, { children: [
|
|
1438
1440
|
/* @__PURE__ */ n(ve, { className: "size-4 text-white", weight: "bold" }),
|
|
1439
1441
|
"Download"
|
|
1440
1442
|
] })
|
|
@@ -1462,16 +1464,16 @@ function it(e) {
|
|
|
1462
1464
|
thumbnailUrl: g
|
|
1463
1465
|
};
|
|
1464
1466
|
}
|
|
1465
|
-
const
|
|
1467
|
+
const dn = ({
|
|
1466
1468
|
resolvedUrl: e,
|
|
1467
1469
|
resolvedType: t,
|
|
1468
1470
|
title: s,
|
|
1469
1471
|
fileSize: a,
|
|
1470
1472
|
thumbnailUrl: r
|
|
1471
1473
|
}) => {
|
|
1472
|
-
const i = a !== void 0 ?
|
|
1474
|
+
const i = a !== void 0 ? ln(a) : void 0;
|
|
1473
1475
|
return /* @__PURE__ */ n(
|
|
1474
|
-
|
|
1476
|
+
on,
|
|
1475
1477
|
{
|
|
1476
1478
|
variant: "dark",
|
|
1477
1479
|
title: s,
|
|
@@ -1479,7 +1481,7 @@ const cn = ({
|
|
|
1479
1481
|
mimeType: t,
|
|
1480
1482
|
detail: i,
|
|
1481
1483
|
thumbnail: /* @__PURE__ */ n(
|
|
1482
|
-
|
|
1484
|
+
rn,
|
|
1483
1485
|
{
|
|
1484
1486
|
mimeType: t,
|
|
1485
1487
|
sourceUrl: e,
|
|
@@ -1490,23 +1492,23 @@ const cn = ({
|
|
|
1490
1492
|
)
|
|
1491
1493
|
}
|
|
1492
1494
|
);
|
|
1493
|
-
},
|
|
1495
|
+
}, un = ({
|
|
1494
1496
|
resolvedUrl: e,
|
|
1495
1497
|
resolvedType: t,
|
|
1496
1498
|
title: s,
|
|
1497
1499
|
fileSize: a,
|
|
1498
1500
|
thumbnailUrl: r
|
|
1499
1501
|
}) => {
|
|
1500
|
-
const i = le(t), l = a !== void 0 ?
|
|
1502
|
+
const i = le(t), l = a !== void 0 ? ln(a) : void 0;
|
|
1501
1503
|
return /* @__PURE__ */ n(
|
|
1502
|
-
|
|
1504
|
+
on,
|
|
1503
1505
|
{
|
|
1504
1506
|
variant: "light",
|
|
1505
1507
|
title: s,
|
|
1506
1508
|
mimeType: t,
|
|
1507
1509
|
detail: l,
|
|
1508
1510
|
thumbnail: /* @__PURE__ */ n(
|
|
1509
|
-
|
|
1511
|
+
rn,
|
|
1510
1512
|
{
|
|
1511
1513
|
mimeType: t,
|
|
1512
1514
|
sourceUrl: e,
|
|
@@ -1544,7 +1546,7 @@ const cn = ({
|
|
|
1544
1546
|
{
|
|
1545
1547
|
className: "str-chat__message-bubble",
|
|
1546
1548
|
style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
|
|
1547
|
-
children: s ? /* @__PURE__ */ n("div", { className: st(t), children: /* @__PURE__ */ n(at, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(
|
|
1549
|
+
children: s ? /* @__PURE__ */ n("div", { className: st(t), children: /* @__PURE__ */ n(at, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(dn, { ...a }) : /* @__PURE__ */ n(un, { ...a })
|
|
1548
1550
|
}
|
|
1549
1551
|
) })
|
|
1550
1552
|
}
|
|
@@ -1557,7 +1559,7 @@ const cn = ({
|
|
|
1557
1559
|
if (t)
|
|
1558
1560
|
return /* @__PURE__ */ n("div", { className: st(!0), children: /* @__PURE__ */ n(at, { attachment: t, isMyMessage: !0 }) });
|
|
1559
1561
|
const s = it(e);
|
|
1560
|
-
return s ? /* @__PURE__ */ n(
|
|
1562
|
+
return s ? /* @__PURE__ */ n(dn, { ...s }) : null;
|
|
1561
1563
|
}, ka = ({
|
|
1562
1564
|
message: e
|
|
1563
1565
|
}) => {
|
|
@@ -1565,17 +1567,17 @@ const cn = ({
|
|
|
1565
1567
|
if (t)
|
|
1566
1568
|
return /* @__PURE__ */ n("div", { className: st(!1), children: /* @__PURE__ */ n(at, { attachment: t, isMyMessage: !1 }) });
|
|
1567
1569
|
const s = it(e);
|
|
1568
|
-
return s ? /* @__PURE__ */ n(
|
|
1569
|
-
},
|
|
1570
|
+
return s ? /* @__PURE__ */ n(un, { ...s }) : null;
|
|
1571
|
+
}, yi = Object.assign(_a, {
|
|
1570
1572
|
Creator: Ca,
|
|
1571
1573
|
Visitor: ka
|
|
1572
1574
|
}), Ea = {
|
|
1573
1575
|
isUnlocking: () => !1
|
|
1574
1576
|
}, Ia = {
|
|
1575
1577
|
LockedAttachment: Ea
|
|
1576
|
-
},
|
|
1578
|
+
}, mn = Ze({}), _i = mn.Provider;
|
|
1577
1579
|
function Sa(e) {
|
|
1578
|
-
return Ke(
|
|
1580
|
+
return Ke(mn)[e] ?? Ia[e];
|
|
1579
1581
|
}
|
|
1580
1582
|
const Ta = ({
|
|
1581
1583
|
selected: e,
|
|
@@ -1593,7 +1595,7 @@ const Ta = ({
|
|
|
1593
1595
|
"aria-label": "Good response",
|
|
1594
1596
|
"aria-pressed": e === "up",
|
|
1595
1597
|
"data-tooltip": "Good response",
|
|
1596
|
-
children: /* @__PURE__ */ n(
|
|
1598
|
+
children: /* @__PURE__ */ n(Es, { size: 16, weight: e === "up" ? "fill" : "regular" })
|
|
1597
1599
|
}
|
|
1598
1600
|
),
|
|
1599
1601
|
/* @__PURE__ */ n(
|
|
@@ -1607,10 +1609,10 @@ const Ta = ({
|
|
|
1607
1609
|
"aria-label": "Bad response",
|
|
1608
1610
|
"aria-pressed": e === "down",
|
|
1609
1611
|
"data-tooltip": "Bad response",
|
|
1610
|
-
children: /* @__PURE__ */ n(
|
|
1612
|
+
children: /* @__PURE__ */ n(Is, { size: 16, weight: e === "down" ? "fill" : "regular" })
|
|
1611
1613
|
}
|
|
1612
1614
|
)
|
|
1613
|
-
] }),
|
|
1615
|
+
] }), Aa = (e) => {
|
|
1614
1616
|
var bt, pt, vt, xt, wt, Nt, yt, _t, Ct, kt, Et, It, St, Tt;
|
|
1615
1617
|
const {
|
|
1616
1618
|
additionalMessageInputProps: t,
|
|
@@ -1629,37 +1631,37 @@ const Ta = ({
|
|
|
1629
1631
|
renderText: b,
|
|
1630
1632
|
threadList: x,
|
|
1631
1633
|
viewerLanguage: v
|
|
1632
|
-
} = e, { client: N } = Qe("CustomMessage"), { channel: w } = me("CustomMessage"), { isUnlocking:
|
|
1633
|
-
Attachment:
|
|
1634
|
-
EditMessageModal:
|
|
1635
|
-
MessageActions:
|
|
1636
|
-
MessageBlocked:
|
|
1637
|
-
MessageBouncePrompt:
|
|
1638
|
-
MessageDeleted: F =
|
|
1639
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
1640
|
-
MessageRepliesCountButton: _ =
|
|
1641
|
-
ReminderNotification:
|
|
1642
|
-
StreamedMessageText: p =
|
|
1643
|
-
PinIndicator:
|
|
1644
|
-
} = Gt("CustomMessage"), Y =
|
|
1634
|
+
} = e, { client: N } = Qe("CustomMessage"), { channel: w } = me("CustomMessage"), { isUnlocking: I, onUnlockClick: S, onFetchSource: T, onDownloadClick: D } = Sa("LockedAttachment"), [A, O] = z(!1), E = Rn(c.id), { selected: R, voteUp: P, voteDown: q } = na(c), {
|
|
1635
|
+
Attachment: C = Ln,
|
|
1636
|
+
EditMessageModal: B = Fn,
|
|
1637
|
+
MessageActions: G,
|
|
1638
|
+
MessageBlocked: U = On,
|
|
1639
|
+
MessageBouncePrompt: L = zn,
|
|
1640
|
+
MessageDeleted: F = Pn,
|
|
1641
|
+
MessageIsThreadReplyInChannelButtonIndicator: H = Bn,
|
|
1642
|
+
MessageRepliesCountButton: _ = $n,
|
|
1643
|
+
ReminderNotification: M = jn,
|
|
1644
|
+
StreamedMessageText: p = Un,
|
|
1645
|
+
PinIndicator: k
|
|
1646
|
+
} = Gt("CustomMessage"), Y = Vn(c), W = Gn(c), he = re(
|
|
1645
1647
|
() => u == null ? void 0 : u(c),
|
|
1646
1648
|
[u, c]
|
|
1647
1649
|
), J = re(() => {
|
|
1648
|
-
const be = c.attachments ?? [],
|
|
1649
|
-
if (!Me(c)) return
|
|
1650
|
-
const
|
|
1651
|
-
return
|
|
1650
|
+
const be = c.attachments ?? [], Se = c.shared_location ? [c.shared_location, ...be] : be;
|
|
1651
|
+
if (!Me(c)) return Se;
|
|
1652
|
+
const At = Se.filter((Mt) => !("type" in Mt) || !cn(Mt));
|
|
1653
|
+
return At.length === Se.length ? Se : At;
|
|
1652
1654
|
}, [c]), ee = re(() => {
|
|
1653
|
-
const be =
|
|
1655
|
+
const be = Jt({ message: c, viewerLanguage: v });
|
|
1654
1656
|
return be === c.text ? c : { ...c, text: be };
|
|
1655
1657
|
}, [c, v]);
|
|
1656
|
-
if (
|
|
1658
|
+
if (Hn(c))
|
|
1657
1659
|
return null;
|
|
1658
1660
|
if (c.deleted_at || c.type === "deleted")
|
|
1659
1661
|
return /* @__PURE__ */ n(F, { message: c });
|
|
1660
|
-
if (
|
|
1661
|
-
return /* @__PURE__ */ n(
|
|
1662
|
-
const
|
|
1662
|
+
if (Yn(c))
|
|
1663
|
+
return /* @__PURE__ */ n(U, {});
|
|
1664
|
+
const ke = !x && !!c.reply_count, Ee = !x && c.show_in_channel && c.parent_id, ce = c.status === "failed" && ((bt = c.error) == null ? void 0 : bt.status) !== 403, te = qn(c);
|
|
1663
1665
|
let se;
|
|
1664
1666
|
ce ? se = () => h(c) : te && (se = () => O(!0));
|
|
1665
1667
|
const de = f(), Oe = y(
|
|
@@ -1672,184 +1674,223 @@ const Ta = ({
|
|
|
1672
1674
|
"str-chat__message--has-attachment": Y,
|
|
1673
1675
|
"str-chat__message--highlighted": g,
|
|
1674
1676
|
"str-chat__message--pinned pinned-message": c.pinned,
|
|
1675
|
-
"str-chat__message--with-reactions":
|
|
1677
|
+
"str-chat__message--with-reactions": W,
|
|
1676
1678
|
"str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((pt = c == null ? void 0 : c.error) == null ? void 0 : pt.status) !== 403,
|
|
1677
|
-
"str-chat__message-with-thread-link":
|
|
1679
|
+
"str-chat__message-with-thread-link": ke || Ee,
|
|
1678
1680
|
"str-chat__virtual-message__wrapper--end": r,
|
|
1679
1681
|
"str-chat__virtual-message__wrapper--first": i,
|
|
1680
1682
|
"str-chat__virtual-message__wrapper--group": l
|
|
1681
1683
|
}
|
|
1682
|
-
),
|
|
1684
|
+
), Ie = c.poll_id && N.polls.fromState(c.poll_id), ue = Xs(c), j = Me(c), K = Ws(c), Q = !!(J != null && J.length && !c.quoted_message), ae = j && de && Q;
|
|
1683
1685
|
return /* @__PURE__ */ m(ie, { children: [
|
|
1684
1686
|
a && /* @__PURE__ */ n(
|
|
1685
|
-
|
|
1687
|
+
B,
|
|
1686
1688
|
{
|
|
1687
1689
|
additionalMessageInputProps: t
|
|
1688
1690
|
}
|
|
1689
1691
|
),
|
|
1690
|
-
|
|
1692
|
+
A && /* @__PURE__ */ n(
|
|
1691
1693
|
Wn,
|
|
1692
1694
|
{
|
|
1693
|
-
MessageBouncePrompt:
|
|
1695
|
+
MessageBouncePrompt: L,
|
|
1694
1696
|
onClose: () => O(!1),
|
|
1695
|
-
open:
|
|
1697
|
+
open: A
|
|
1696
1698
|
}
|
|
1697
1699
|
),
|
|
1698
|
-
/* @__PURE__ */ m(
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
{
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1700
|
+
/* @__PURE__ */ m(
|
|
1701
|
+
"div",
|
|
1702
|
+
{
|
|
1703
|
+
className: Oe,
|
|
1704
|
+
"data-message-id": c.id,
|
|
1705
|
+
children: [
|
|
1706
|
+
k && /* @__PURE__ */ n(k, {}),
|
|
1707
|
+
!!E && /* @__PURE__ */ n(M, { reminder: E }),
|
|
1708
|
+
c.user && /* @__PURE__ */ n(
|
|
1709
|
+
oe,
|
|
1710
|
+
{
|
|
1711
|
+
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
1712
|
+
id: c.user.id,
|
|
1713
|
+
image: c.user.image,
|
|
1714
|
+
name: c.user.name || c.user.id,
|
|
1715
|
+
size: j ? 24 : 28,
|
|
1716
|
+
shape: "circle",
|
|
1717
|
+
dmAgentEnabled: j
|
|
1718
|
+
}
|
|
1719
|
+
),
|
|
1720
|
+
/* @__PURE__ */ n(
|
|
1721
|
+
"div",
|
|
1722
|
+
{
|
|
1723
|
+
className: y("str-chat__message-inner", {
|
|
1724
|
+
"str-chat__simple-message--error-failed": ce || te
|
|
1725
|
+
}),
|
|
1726
|
+
"data-testid": "message-inner",
|
|
1727
|
+
onClick: se,
|
|
1728
|
+
onKeyDown: se,
|
|
1729
|
+
role: se ? "button" : void 0,
|
|
1730
|
+
tabIndex: se ? 0 : void 0,
|
|
1731
|
+
style: {
|
|
1732
|
+
// Force margins to 0 to prevent hover layout shift
|
|
1733
|
+
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1734
|
+
marginInlineEnd: 0,
|
|
1735
|
+
marginInlineStart: 0
|
|
1736
|
+
},
|
|
1737
|
+
children: K ? /* @__PURE__ */ m("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1738
|
+
de ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1739
|
+
G && /* @__PURE__ */ n(G, {}),
|
|
1740
|
+
/* @__PURE__ */ n(
|
|
1741
|
+
Bt.Sent,
|
|
1742
|
+
{
|
|
1743
|
+
title: (vt = c.metadata) == null ? void 0 : vt.attachment_title,
|
|
1744
|
+
mimeType: (xt = c.metadata) == null ? void 0 : xt.attachment_mime_type,
|
|
1745
|
+
thumbnailUrl: (wt = c.metadata) == null ? void 0 : wt.attachment_thumbnail,
|
|
1746
|
+
amountText: (Nt = c.metadata) == null ? void 0 : Nt.amount_text,
|
|
1747
|
+
detail: (yt = c.metadata) == null ? void 0 : yt.attachment_detail,
|
|
1748
|
+
paymentStatus: (_t = c.metadata) == null ? void 0 : _t.payment_status,
|
|
1749
|
+
onPreviewClick: () => S == null ? void 0 : S(c, w),
|
|
1750
|
+
onFetchSource: async () => await (T == null ? void 0 : T(c, w))
|
|
1751
|
+
}
|
|
1752
|
+
)
|
|
1753
|
+
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1754
|
+
/* @__PURE__ */ n(
|
|
1755
|
+
Bt.Received,
|
|
1756
|
+
{
|
|
1757
|
+
title: (Ct = c.metadata) == null ? void 0 : Ct.attachment_title,
|
|
1758
|
+
mimeType: (kt = c.metadata) == null ? void 0 : kt.attachment_mime_type,
|
|
1759
|
+
thumbnailUrl: (Et = c.metadata) == null ? void 0 : Et.attachment_thumbnail,
|
|
1760
|
+
amountText: (It = c.metadata) == null ? void 0 : It.amount_text,
|
|
1761
|
+
detail: (St = c.metadata) == null ? void 0 : St.attachment_detail,
|
|
1762
|
+
paymentStatus: (Tt = c.metadata) == null ? void 0 : Tt.payment_status,
|
|
1763
|
+
isUnlocking: I(c.id),
|
|
1764
|
+
onUnlockClick: () => S == null ? void 0 : S(c, w),
|
|
1765
|
+
onFetchSource: async () => await (T == null ? void 0 : T(c, w)),
|
|
1766
|
+
onDownloadClick: () => D == null ? void 0 : D(c, w)
|
|
1767
|
+
}
|
|
1768
|
+
),
|
|
1769
|
+
G && /* @__PURE__ */ n(G, {})
|
|
1770
|
+
] }),
|
|
1771
|
+
c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
1772
|
+
Dt,
|
|
1773
|
+
{
|
|
1774
|
+
message: ee,
|
|
1775
|
+
renderText: b
|
|
1776
|
+
}
|
|
1777
|
+
) })
|
|
1778
|
+
] }) : ue ? (
|
|
1779
|
+
/* Tip-only messages render as a standalone bubble */
|
|
1780
|
+
/* @__PURE__ */ n($e, { message: c, standalone: !0 })
|
|
1781
|
+
) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m("div", { className: "str-chat__message-bubble", children: [
|
|
1782
|
+
j && !ae && /* @__PURE__ */ n(
|
|
1783
|
+
$e,
|
|
1784
|
+
{
|
|
1785
|
+
message: c,
|
|
1786
|
+
hasAttachment: Q,
|
|
1787
|
+
isMyMessage: de
|
|
1788
|
+
}
|
|
1789
|
+
),
|
|
1790
|
+
Ie && /* @__PURE__ */ n(Xn, { poll: Ie }),
|
|
1791
|
+
J != null && J.length && !c.quoted_message ? /* @__PURE__ */ n(
|
|
1792
|
+
C,
|
|
1793
|
+
{
|
|
1794
|
+
actionHandler: o,
|
|
1795
|
+
attachments: J
|
|
1796
|
+
}
|
|
1797
|
+
) : null,
|
|
1798
|
+
he ? /* @__PURE__ */ n(
|
|
1799
|
+
p,
|
|
1800
|
+
{
|
|
1801
|
+
message: ee,
|
|
1802
|
+
renderText: b
|
|
1803
|
+
}
|
|
1804
|
+
) : /* @__PURE__ */ n(
|
|
1805
|
+
Dt,
|
|
1806
|
+
{
|
|
1807
|
+
message: ee,
|
|
1808
|
+
renderText: b
|
|
1809
|
+
}
|
|
1810
|
+
),
|
|
1811
|
+
/* @__PURE__ */ n(Zn, {})
|
|
1812
|
+
] }) })
|
|
1813
|
+
}
|
|
1814
|
+
),
|
|
1815
|
+
!K && !ue && /* @__PURE__ */ m("div", { className: "str-chat__message-footer", children: [
|
|
1816
|
+
(!j || ae) && /* @__PURE__ */ n(
|
|
1817
|
+
$e,
|
|
1818
|
+
{
|
|
1819
|
+
message: c,
|
|
1820
|
+
hasAttachment: Q,
|
|
1821
|
+
isMyMessage: de
|
|
1822
|
+
}
|
|
1823
|
+
),
|
|
1824
|
+
s && j && /* @__PURE__ */ n(
|
|
1825
|
+
Ta,
|
|
1826
|
+
{
|
|
1827
|
+
selected: R,
|
|
1828
|
+
onVoteUp: P,
|
|
1829
|
+
onVoteDown: q
|
|
1830
|
+
}
|
|
1831
|
+
)
|
|
1832
|
+
] }),
|
|
1833
|
+
ke && /* @__PURE__ */ n(
|
|
1834
|
+
_,
|
|
1835
|
+
{
|
|
1836
|
+
onClick: d,
|
|
1837
|
+
reply_count: c.reply_count
|
|
1838
|
+
}
|
|
1839
|
+
),
|
|
1840
|
+
Ee && /* @__PURE__ */ n(H, {})
|
|
1841
|
+
]
|
|
1842
|
+
},
|
|
1843
|
+
c.id
|
|
1844
|
+
)
|
|
1832
1845
|
] });
|
|
1833
|
-
},
|
|
1834
|
-
|
|
1835
|
-
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 :
|
|
1846
|
+
}, Ma = $.memo(
|
|
1847
|
+
Aa,
|
|
1848
|
+
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Dn(e, t)
|
|
1836
1849
|
), Da = (e) => {
|
|
1837
|
-
const t =
|
|
1838
|
-
return /* @__PURE__ */ n(
|
|
1850
|
+
const t = xe("CustomMessage");
|
|
1851
|
+
return /* @__PURE__ */ n(Ma, { ...t, ...e });
|
|
1839
1852
|
}, Ra = () => {
|
|
1840
|
-
|
|
1841
|
-
|
|
1853
|
+
var s;
|
|
1854
|
+
const { handleDelete: e, message: t } = xe("CustomMessageActions");
|
|
1855
|
+
return ((s = t.metadata) == null ? void 0 : s.payment_status) !== "paid" ? null : /* @__PURE__ */ n(
|
|
1856
|
+
Wt,
|
|
1857
|
+
{
|
|
1858
|
+
onClick: e,
|
|
1859
|
+
"aria-label": "Delete",
|
|
1860
|
+
title: "Delete",
|
|
1861
|
+
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1862
|
+
children: /* @__PURE__ */ n(Ss, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1863
|
+
}
|
|
1864
|
+
);
|
|
1842
1865
|
}, La = () => {
|
|
1843
|
-
const { handleFlag: e } =
|
|
1844
|
-
return /* @__PURE__ */ n(
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1866
|
+
const { handleFlag: e } = xe("CustomMessageActions");
|
|
1867
|
+
return /* @__PURE__ */ n(
|
|
1868
|
+
Wt,
|
|
1869
|
+
{
|
|
1870
|
+
onClick: e,
|
|
1871
|
+
"aria-label": "Report",
|
|
1872
|
+
title: "Report",
|
|
1873
|
+
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
1874
|
+
children: /* @__PURE__ */ n(Ht, { size: 16, weight: "light", "aria-hidden": !0 })
|
|
1875
|
+
}
|
|
1876
|
+
);
|
|
1877
|
+
}, Fa = () => {
|
|
1878
|
+
var t;
|
|
1879
|
+
const { message: e } = xe("CustomMessageActions");
|
|
1880
|
+
return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
|
|
1881
|
+
Rs,
|
|
1882
|
+
{
|
|
1883
|
+
messageActionSet: [
|
|
1884
|
+
{ Component: Ra, placement: "quick", type: "delete" },
|
|
1885
|
+
{ Component: La, placement: "quick", type: "flag" }
|
|
1886
|
+
]
|
|
1887
|
+
}
|
|
1888
|
+
);
|
|
1889
|
+
}, Oa = (e) => ({
|
|
1849
1890
|
linkPreviews: Array.from(e.previews.values()).filter(
|
|
1850
1891
|
(t) => Ot.previewIsLoaded(t) || Ot.previewIsLoading(t)
|
|
1851
1892
|
)
|
|
1852
|
-
}),
|
|
1893
|
+
}), za = ({
|
|
1853
1894
|
link: e,
|
|
1854
1895
|
onDismiss: t
|
|
1855
1896
|
}) => {
|
|
@@ -1879,7 +1920,7 @@ const Ta = ({
|
|
|
1879
1920
|
},
|
|
1880
1921
|
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1881
1922
|
"aria-label": "Close link preview",
|
|
1882
|
-
children: /* @__PURE__ */ n(
|
|
1923
|
+
children: /* @__PURE__ */ n(we, { className: "size-4 text-black/90" })
|
|
1883
1924
|
}
|
|
1884
1925
|
),
|
|
1885
1926
|
/* @__PURE__ */ m("div", { className: "p-2", children: [
|
|
@@ -1889,22 +1930,22 @@ const Ta = ({
|
|
|
1889
1930
|
]
|
|
1890
1931
|
}
|
|
1891
1932
|
);
|
|
1892
|
-
},
|
|
1933
|
+
}, Pa = () => {
|
|
1893
1934
|
const { linkPreviewsManager: e } = Kn(), { linkPreviews: t } = Jn(
|
|
1894
1935
|
e.state,
|
|
1895
|
-
|
|
1936
|
+
Oa
|
|
1896
1937
|
), s = (r) => {
|
|
1897
1938
|
e.dismissPreview(r);
|
|
1898
1939
|
};
|
|
1899
1940
|
return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
|
|
1900
|
-
|
|
1941
|
+
za,
|
|
1901
1942
|
{
|
|
1902
1943
|
link: r,
|
|
1903
1944
|
onDismiss: s
|
|
1904
1945
|
},
|
|
1905
1946
|
r.og_scrape_url
|
|
1906
1947
|
)) }) : null;
|
|
1907
|
-
},
|
|
1948
|
+
}, Ba = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
1908
1949
|
"button",
|
|
1909
1950
|
{
|
|
1910
1951
|
...s,
|
|
@@ -1914,14 +1955,14 @@ const Ta = ({
|
|
|
1914
1955
|
onClick: e,
|
|
1915
1956
|
children: /* @__PURE__ */ n(Ts, { weight: "bold", className: "size-4" })
|
|
1916
1957
|
}
|
|
1917
|
-
),
|
|
1958
|
+
), $a = () => {
|
|
1918
1959
|
var o;
|
|
1919
|
-
const { channel: e } = me(), t = ((o = e == null ? void 0 : e.data) == null ? void 0 : o.frozen) === !0, { handleSubmit: s } = es(), { SendButton: a } = Gt("CustomMessageInput"), r = a ??
|
|
1960
|
+
const { channel: e } = me(), t = ((o = e == null ? void 0 : e.data) == null ? void 0 : o.frozen) === !0, { handleSubmit: s } = es(), { SendButton: a } = Gt("CustomMessageInput"), r = a ?? Ba, i = ts();
|
|
1920
1961
|
return /* @__PURE__ */ m(ie, { children: [
|
|
1921
1962
|
/* @__PURE__ */ n("div", { className: "left-container", children: /* @__PURE__ */ n(ns, {}) }),
|
|
1922
1963
|
/* @__PURE__ */ m("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1923
1964
|
/* @__PURE__ */ n(ss, {}),
|
|
1924
|
-
/* @__PURE__ */ n(
|
|
1965
|
+
/* @__PURE__ */ n(Pa, {}),
|
|
1925
1966
|
/* @__PURE__ */ n(as, {}),
|
|
1926
1967
|
/* @__PURE__ */ m("div", { className: "flex", children: [
|
|
1927
1968
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
@@ -1949,7 +1990,7 @@ const Ta = ({
|
|
|
1949
1990
|
] })
|
|
1950
1991
|
] })
|
|
1951
1992
|
] });
|
|
1952
|
-
},
|
|
1993
|
+
}, ja = ({
|
|
1953
1994
|
renderActions: e
|
|
1954
1995
|
}) => {
|
|
1955
1996
|
var a;
|
|
@@ -1962,21 +2003,21 @@ const Ta = ({
|
|
|
1962
2003
|
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1963
2004
|
children: [
|
|
1964
2005
|
e == null ? void 0 : e(),
|
|
1965
|
-
/* @__PURE__ */ n(Qn, { Input:
|
|
2006
|
+
/* @__PURE__ */ n(Qn, { Input: $a })
|
|
1966
2007
|
]
|
|
1967
2008
|
}
|
|
1968
2009
|
);
|
|
1969
|
-
},
|
|
2010
|
+
}, Ua = [
|
|
1970
2011
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1971
2012
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1972
|
-
],
|
|
2013
|
+
], Va = {
|
|
1973
2014
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1974
2015
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1975
|
-
},
|
|
2016
|
+
}, Ga = [
|
|
1976
2017
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1977
|
-
],
|
|
2018
|
+
], Ha = {
|
|
1978
2019
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1979
|
-
}, je = "age safety guidelines.",
|
|
2020
|
+
}, je = "age safety guidelines.", Ya = "https://linktr.ee/s/about/contact", jt = (e) => Ua.includes(e), qa = (e) => Ga.includes(e), Wa = (e) => {
|
|
1980
2021
|
var a;
|
|
1981
2022
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
1982
2023
|
if (jt(t))
|
|
@@ -1995,7 +2036,7 @@ const Ta = ({
|
|
|
1995
2036
|
kind: "dm-agent",
|
|
1996
2037
|
type: s
|
|
1997
2038
|
};
|
|
1998
|
-
},
|
|
2039
|
+
}, Xa = (e) => {
|
|
1999
2040
|
const t = e.indexOf(je);
|
|
2000
2041
|
if (t === -1)
|
|
2001
2042
|
return e;
|
|
@@ -2005,7 +2046,7 @@ const Ta = ({
|
|
|
2005
2046
|
/* @__PURE__ */ n(
|
|
2006
2047
|
"a",
|
|
2007
2048
|
{
|
|
2008
|
-
href:
|
|
2049
|
+
href: Ya,
|
|
2009
2050
|
target: "_blank",
|
|
2010
2051
|
rel: "noopener noreferrer",
|
|
2011
2052
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -2014,13 +2055,13 @@ const Ta = ({
|
|
|
2014
2055
|
),
|
|
2015
2056
|
e.slice(s)
|
|
2016
2057
|
] });
|
|
2017
|
-
},
|
|
2058
|
+
}, Za = (e) => {
|
|
2018
2059
|
var a, r;
|
|
2019
|
-
const t = e.message.hide_date === !0, s =
|
|
2060
|
+
const t = e.message.hide_date === !0, s = Wa(
|
|
2020
2061
|
e.message
|
|
2021
2062
|
);
|
|
2022
2063
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
2023
|
-
const i = ((a = e.message.text) == null ? void 0 : a.trim()) ||
|
|
2064
|
+
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Va[s.type];
|
|
2024
2065
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
2025
2066
|
/* @__PURE__ */ m(
|
|
2026
2067
|
"div",
|
|
@@ -2046,7 +2087,7 @@ const Ta = ({
|
|
|
2046
2087
|
] });
|
|
2047
2088
|
}
|
|
2048
2089
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
2049
|
-
const i = ((r = e.message.text) == null ? void 0 : r.trim()) ||
|
|
2090
|
+
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ha[s.type];
|
|
2050
2091
|
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
2051
2092
|
/* @__PURE__ */ m(
|
|
2052
2093
|
"div",
|
|
@@ -2056,7 +2097,7 @@ const Ta = ({
|
|
|
2056
2097
|
"data-age-safety-system-type": s.type,
|
|
2057
2098
|
children: [
|
|
2058
2099
|
/* @__PURE__ */ n(
|
|
2059
|
-
|
|
2100
|
+
As,
|
|
2060
2101
|
{
|
|
2061
2102
|
size: 24,
|
|
2062
2103
|
weight: "duotone",
|
|
@@ -2065,7 +2106,7 @@ const Ta = ({
|
|
|
2065
2106
|
"data-testid": "age-safety-system-message-icon"
|
|
2066
2107
|
}
|
|
2067
2108
|
),
|
|
2068
|
-
/* @__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:
|
|
2109
|
+
/* @__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: Xa(i) }) })
|
|
2069
2110
|
]
|
|
2070
2111
|
}
|
|
2071
2112
|
),
|
|
@@ -2080,7 +2121,7 @@ const Ta = ({
|
|
|
2080
2121
|
] }),
|
|
2081
2122
|
!t && /* @__PURE__ */ n(ze, { message: e.message })
|
|
2082
2123
|
] });
|
|
2083
|
-
},
|
|
2124
|
+
}, hn = Ze(!1), Ue = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
|
|
2084
2125
|
"animateTransform",
|
|
2085
2126
|
{
|
|
2086
2127
|
attributeName: "transform",
|
|
@@ -2090,15 +2131,15 @@ const Ta = ({
|
|
|
2090
2131
|
begin: `${120 * t}ms`,
|
|
2091
2132
|
repeatCount: "indefinite"
|
|
2092
2133
|
}
|
|
2093
|
-
) }),
|
|
2134
|
+
) }), Ka = /* @__PURE__ */ new Set([
|
|
2094
2135
|
Pe.Thinking,
|
|
2095
2136
|
Pe.Generating,
|
|
2096
2137
|
Pe.ExternalSources
|
|
2097
|
-
]),
|
|
2138
|
+
]), Ja = ({ threadList: e }) => {
|
|
2098
2139
|
var b, x;
|
|
2099
|
-
const { channel: t, channelConfig: s, thread: a } = me(), { client: r } = Qe(), { typing: i = {} } = is(), { aiState: l } = os(t), o = Ke(
|
|
2100
|
-
if (!e && o &&
|
|
2101
|
-
const v =
|
|
2140
|
+
const { channel: t, channelConfig: s, thread: a } = me(), { client: r } = Qe(), { typing: i = {} } = is(), { aiState: l } = os(t), o = Ke(hn);
|
|
2141
|
+
if (!e && o && Ka.has(l)) {
|
|
2142
|
+
const v = Qa(t, (b = r.user) == null ? void 0 : b.id);
|
|
2102
2143
|
return /* @__PURE__ */ n(
|
|
2103
2144
|
Ut,
|
|
2104
2145
|
{
|
|
@@ -2175,7 +2216,7 @@ const Ta = ({
|
|
|
2175
2216
|
]
|
|
2176
2217
|
}
|
|
2177
2218
|
);
|
|
2178
|
-
function
|
|
2219
|
+
function Qa(e, t) {
|
|
2179
2220
|
var a;
|
|
2180
2221
|
const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
|
|
2181
2222
|
for (const r of Object.values(s)) {
|
|
@@ -2184,7 +2225,7 @@ function er(e, t) {
|
|
|
2184
2225
|
return i;
|
|
2185
2226
|
}
|
|
2186
2227
|
}
|
|
2187
|
-
const
|
|
2228
|
+
const er = () => null, tr = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
2188
2229
|
"div",
|
|
2189
2230
|
{
|
|
2190
2231
|
className: y("flex items-center justify-center h-full", e),
|
|
@@ -2227,12 +2268,12 @@ const tr = () => null, nr = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
|
2227
2268
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
2228
2269
|
]
|
|
2229
2270
|
}
|
|
2230
|
-
),
|
|
2231
|
-
/* @__PURE__ */ n(
|
|
2271
|
+
), De = $.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ m("div", { className: "flex items-center", children: [
|
|
2272
|
+
/* @__PURE__ */ n(tr, { className: "w-6 h-6" }),
|
|
2232
2273
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
2233
2274
|
] }) }));
|
|
2234
|
-
|
|
2235
|
-
const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Vt = "Replies instantly with AI assistant",
|
|
2275
|
+
De.displayName = "LoadingState";
|
|
2276
|
+
const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Vt = "Replies instantly with AI assistant", nr = ({
|
|
2236
2277
|
onBack: e,
|
|
2237
2278
|
showBackButton: t,
|
|
2238
2279
|
onShowInfo: s,
|
|
@@ -2242,16 +2283,16 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2242
2283
|
getParticipantDisplayName: l
|
|
2243
2284
|
}) => {
|
|
2244
2285
|
var c, b, x, v, N;
|
|
2245
|
-
const { channel: o } = me(), d =
|
|
2246
|
-
var
|
|
2247
|
-
const w = (
|
|
2248
|
-
return w ? Object.values(((
|
|
2249
|
-
(
|
|
2250
|
-
var
|
|
2251
|
-
return ((
|
|
2286
|
+
const { channel: o } = me(), d = $.useMemo(() => {
|
|
2287
|
+
var S, T;
|
|
2288
|
+
const w = (S = o._client) == null ? void 0 : S.userID;
|
|
2289
|
+
return w ? Object.values(((T = o.state) == null ? void 0 : T.members) || {}).find(
|
|
2290
|
+
(D) => {
|
|
2291
|
+
var A;
|
|
2292
|
+
return ((A = D.user) == null ? void 0 : A.id) && D.user.id !== w;
|
|
2252
2293
|
}
|
|
2253
2294
|
) : void 0;
|
|
2254
|
-
}, [(c = o._client) == null ? void 0 : c.userID, (b = o.state) == null ? void 0 : b.members]), h = l(d), g = (x = d == null ? void 0 : d.user) == null ? void 0 : x.image, u =
|
|
2295
|
+
}, [(c = o._client) == null ? void 0 : c.userID, (b = o.state) == null ? void 0 : b.members]), h = l(d), g = (x = d == null ? void 0 : d.user) == null ? void 0 : x.image, u = Kt(o), f = async () => {
|
|
2255
2296
|
try {
|
|
2256
2297
|
u ? await o.unpin() : await o.pin();
|
|
2257
2298
|
} catch (w) {
|
|
@@ -2298,7 +2339,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2298
2339
|
"aria-label": `View info for ${h}`,
|
|
2299
2340
|
children: [
|
|
2300
2341
|
h,
|
|
2301
|
-
/* @__PURE__ */ n(
|
|
2342
|
+
/* @__PURE__ */ n(qe, { className: "size-3 shrink-0" })
|
|
2302
2343
|
]
|
|
2303
2344
|
}
|
|
2304
2345
|
),
|
|
@@ -2375,7 +2416,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2375
2416
|
"aria-label": `View info for ${h}`,
|
|
2376
2417
|
children: [
|
|
2377
2418
|
/* @__PURE__ */ n("span", { className: "truncate", children: h }),
|
|
2378
|
-
/* @__PURE__ */ n(
|
|
2419
|
+
/* @__PURE__ */ n(qe, { className: "size-4 shrink-0" })
|
|
2379
2420
|
]
|
|
2380
2421
|
}
|
|
2381
2422
|
) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: h }),
|
|
@@ -2418,7 +2459,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2418
2459
|
] })
|
|
2419
2460
|
] })
|
|
2420
2461
|
] });
|
|
2421
|
-
},
|
|
2462
|
+
}, sr = ({
|
|
2422
2463
|
onBack: e,
|
|
2423
2464
|
showBackButton: t,
|
|
2424
2465
|
renderMessageInputActions: s,
|
|
@@ -2439,38 +2480,38 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2439
2480
|
viewerLanguage: N,
|
|
2440
2481
|
getParticipantDisplayName: w
|
|
2441
2482
|
}) => {
|
|
2442
|
-
var
|
|
2443
|
-
const { channel:
|
|
2444
|
-
var p,
|
|
2445
|
-
const _ = (p =
|
|
2446
|
-
return _ ? Object.values(((
|
|
2483
|
+
var B, G, U, L, F, H;
|
|
2484
|
+
const { channel: I } = me(), S = Z(null), T = $.useMemo(() => {
|
|
2485
|
+
var p, k;
|
|
2486
|
+
const _ = (p = I._client) == null ? void 0 : p.userID;
|
|
2487
|
+
return _ ? Object.values(((k = I.state) == null ? void 0 : k.members) || {}).find(
|
|
2447
2488
|
(Y) => {
|
|
2448
|
-
var
|
|
2449
|
-
return ((
|
|
2489
|
+
var W;
|
|
2490
|
+
return ((W = Y.user) == null ? void 0 : W.id) && Y.user.id !== _;
|
|
2450
2491
|
}
|
|
2451
2492
|
) : void 0;
|
|
2452
|
-
}, [(
|
|
2453
|
-
var p,
|
|
2454
|
-
const _ = (p =
|
|
2455
|
-
return _ ? Object.values(((
|
|
2456
|
-
var
|
|
2457
|
-
return ((
|
|
2493
|
+
}, [(B = I._client) == null ? void 0 : B.userID, (G = I.state) == null ? void 0 : G.members]), D = $.useMemo(() => {
|
|
2494
|
+
var p, k;
|
|
2495
|
+
const _ = (p = I._client) == null ? void 0 : p.userID;
|
|
2496
|
+
return _ ? Object.values(((k = I.state) == null ? void 0 : k.members) || {}).find((Y) => {
|
|
2497
|
+
var W;
|
|
2498
|
+
return ((W = Y.user) == null ? void 0 : W.id) === _;
|
|
2458
2499
|
}) : void 0;
|
|
2459
|
-
}, [(
|
|
2460
|
-
const _ =
|
|
2500
|
+
}, [(U = I._client) == null ? void 0 : U.userID, (L = I.state) == null ? void 0 : L.members]), A = ((F = D == null ? void 0 : D.user) == null ? void 0 : F.is_account) ?? (D == null ? void 0 : D.is_account), O = ((H = T == null ? void 0 : T.user) == null ? void 0 : H.is_account) ?? (T == null ? void 0 : T.is_account), E = v && A === !1 && O === !0, R = $.useMemo(() => {
|
|
2501
|
+
const _ = I.data ?? {};
|
|
2461
2502
|
if (_.followerStatus)
|
|
2462
2503
|
return String(_.followerStatus);
|
|
2463
2504
|
if (_.isFollower !== void 0)
|
|
2464
2505
|
return _.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
2465
|
-
}, [
|
|
2506
|
+
}, [I.data]), P = V(() => {
|
|
2466
2507
|
var _;
|
|
2467
|
-
(_ =
|
|
2468
|
-
}, []),
|
|
2508
|
+
(_ = S.current) == null || _.showModal();
|
|
2509
|
+
}, []), q = V(() => {
|
|
2469
2510
|
var _;
|
|
2470
|
-
(_ =
|
|
2471
|
-
}, []),
|
|
2511
|
+
(_ = S.current) == null || _.close();
|
|
2512
|
+
}, []), C = V(
|
|
2472
2513
|
(_) => {
|
|
2473
|
-
const { message:
|
|
2514
|
+
const { message: M } = xe("ChannelView"), p = /* @__PURE__ */ n(
|
|
2474
2515
|
Da,
|
|
2475
2516
|
{
|
|
2476
2517
|
..._,
|
|
@@ -2478,7 +2519,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2478
2519
|
viewerLanguage: N
|
|
2479
2520
|
}
|
|
2480
2521
|
);
|
|
2481
|
-
return !x || !
|
|
2522
|
+
return !x || !M ? p : x(p, M);
|
|
2482
2523
|
},
|
|
2483
2524
|
[u, x, N]
|
|
2484
2525
|
);
|
|
@@ -2487,23 +2528,23 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2487
2528
|
cs,
|
|
2488
2529
|
{
|
|
2489
2530
|
overrides: {
|
|
2490
|
-
Message:
|
|
2491
|
-
MessageActions:
|
|
2531
|
+
Message: C,
|
|
2532
|
+
MessageActions: Fa
|
|
2492
2533
|
},
|
|
2493
2534
|
children: /* @__PURE__ */ m(ds, { children: [
|
|
2494
2535
|
/* @__PURE__ */ n("div", { className: "p-4", children: /* @__PURE__ */ n(
|
|
2495
|
-
|
|
2536
|
+
nr,
|
|
2496
2537
|
{
|
|
2497
2538
|
onBack: e,
|
|
2498
2539
|
showBackButton: t,
|
|
2499
|
-
onShowInfo:
|
|
2500
|
-
canShowInfo: !!
|
|
2540
|
+
onShowInfo: P,
|
|
2541
|
+
canShowInfo: !!T,
|
|
2501
2542
|
showStarButton: g,
|
|
2502
|
-
dmAgentEnabled:
|
|
2543
|
+
dmAgentEnabled: E,
|
|
2503
2544
|
getParticipantDisplayName: w
|
|
2504
2545
|
}
|
|
2505
2546
|
) }, "lt-channel-header"),
|
|
2506
|
-
f ? /* @__PURE__ */ n(
|
|
2547
|
+
f ? /* @__PURE__ */ n($.Fragment, { children: f() }, "lt-channel-banner") : null,
|
|
2507
2548
|
/* @__PURE__ */ n(
|
|
2508
2549
|
"div",
|
|
2509
2550
|
{
|
|
@@ -2518,11 +2559,11 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2518
2559
|
},
|
|
2519
2560
|
"lt-channel-message-list"
|
|
2520
2561
|
),
|
|
2521
|
-
a ? /* @__PURE__ */ n(
|
|
2562
|
+
a ? /* @__PURE__ */ n($.Fragment, { children: a(I) }, "lt-channel-conversation-footer") : null,
|
|
2522
2563
|
/* @__PURE__ */ n(
|
|
2523
|
-
|
|
2564
|
+
ja,
|
|
2524
2565
|
{
|
|
2525
|
-
renderActions: () => s == null ? void 0 : s(
|
|
2566
|
+
renderActions: () => s == null ? void 0 : s(I)
|
|
2526
2567
|
},
|
|
2527
2568
|
"lt-channel-message-input"
|
|
2528
2569
|
)
|
|
@@ -2532,12 +2573,12 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2532
2573
|
/* @__PURE__ */ n(
|
|
2533
2574
|
Qs,
|
|
2534
2575
|
{
|
|
2535
|
-
dialogRef:
|
|
2536
|
-
onClose:
|
|
2537
|
-
participant:
|
|
2538
|
-
participantDisplayName: w(
|
|
2539
|
-
channel:
|
|
2540
|
-
followerStatusLabel:
|
|
2576
|
+
dialogRef: S,
|
|
2577
|
+
onClose: q,
|
|
2578
|
+
participant: T,
|
|
2579
|
+
participantDisplayName: w(T),
|
|
2580
|
+
channel: I,
|
|
2581
|
+
followerStatusLabel: R,
|
|
2541
2582
|
onLeaveConversation: r,
|
|
2542
2583
|
onBlockParticipant: i,
|
|
2543
2584
|
showDeleteConversation: l,
|
|
@@ -2549,7 +2590,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2549
2590
|
}
|
|
2550
2591
|
)
|
|
2551
2592
|
] });
|
|
2552
|
-
},
|
|
2593
|
+
}, fn = $.memo(
|
|
2553
2594
|
({
|
|
2554
2595
|
channel: e,
|
|
2555
2596
|
onBack: t,
|
|
@@ -2559,7 +2600,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2559
2600
|
onLeaveConversation: i,
|
|
2560
2601
|
onBlockParticipant: l,
|
|
2561
2602
|
className: o,
|
|
2562
|
-
CustomChannelEmptyState: d =
|
|
2603
|
+
CustomChannelEmptyState: d = er,
|
|
2563
2604
|
showDeleteConversation: h = !0,
|
|
2564
2605
|
onDeleteConversationClick: g,
|
|
2565
2606
|
onBlockParticipantClick: u,
|
|
@@ -2570,69 +2611,69 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2570
2611
|
showStarButton: v = !1,
|
|
2571
2612
|
chatbotVotingEnabled: N = !1,
|
|
2572
2613
|
renderChannelBanner: w,
|
|
2573
|
-
customProfileContent:
|
|
2574
|
-
customChannelActions:
|
|
2575
|
-
renderMessage:
|
|
2576
|
-
onMessageLinkClick:
|
|
2577
|
-
sendButton:
|
|
2614
|
+
customProfileContent: I,
|
|
2615
|
+
customChannelActions: S,
|
|
2616
|
+
renderMessage: T,
|
|
2617
|
+
onMessageLinkClick: D,
|
|
2618
|
+
sendButton: A,
|
|
2578
2619
|
viewerLanguage: O,
|
|
2579
|
-
getParticipantDisplayName:
|
|
2620
|
+
getParticipantDisplayName: E
|
|
2580
2621
|
}) => {
|
|
2581
|
-
const
|
|
2582
|
-
(
|
|
2583
|
-
[
|
|
2584
|
-
),
|
|
2585
|
-
async (
|
|
2586
|
-
var
|
|
2587
|
-
const
|
|
2588
|
-
...
|
|
2589
|
-
...
|
|
2622
|
+
const R = V(
|
|
2623
|
+
(C) => (E == null ? void 0 : E(C)) ?? tt(C == null ? void 0 : C.user),
|
|
2624
|
+
[E]
|
|
2625
|
+
), P = V(
|
|
2626
|
+
async (C, B, G) => {
|
|
2627
|
+
var M;
|
|
2628
|
+
const U = ((M = e.data) == null ? void 0 : M.chatbot_paused) === !0, L = c && !U, F = {
|
|
2629
|
+
...B,
|
|
2630
|
+
...L && { silent: !0 },
|
|
2590
2631
|
...b && {
|
|
2591
2632
|
metadata: {
|
|
2592
|
-
...
|
|
2633
|
+
...B.metadata ?? {},
|
|
2593
2634
|
...b
|
|
2594
2635
|
}
|
|
2595
2636
|
}
|
|
2596
|
-
},
|
|
2597
|
-
...
|
|
2598
|
-
...
|
|
2599
|
-
}, _ = await e.sendMessage(F,
|
|
2637
|
+
}, H = {
|
|
2638
|
+
...G,
|
|
2639
|
+
...L && { skip_push: !0 }
|
|
2640
|
+
}, _ = await e.sendMessage(F, H);
|
|
2600
2641
|
return x == null || x(_), _;
|
|
2601
2642
|
},
|
|
2602
2643
|
[e, c, b, x]
|
|
2603
|
-
),
|
|
2644
|
+
), q = Z(null);
|
|
2604
2645
|
return X(() => {
|
|
2605
|
-
if (!
|
|
2606
|
-
const
|
|
2607
|
-
if (!
|
|
2608
|
-
const
|
|
2609
|
-
const
|
|
2646
|
+
if (!D) return;
|
|
2647
|
+
const C = q.current;
|
|
2648
|
+
if (!C) return;
|
|
2649
|
+
const B = (G) => {
|
|
2650
|
+
const U = G.target, L = U == null ? void 0 : U.closest("a[href]"), F = L == null ? void 0 : L.getAttribute("href");
|
|
2610
2651
|
if (!F) return;
|
|
2611
|
-
const
|
|
2612
|
-
|
|
2652
|
+
const H = L == null ? void 0 : L.closest("[data-message-id]"), _ = H == null ? void 0 : H.getAttribute("data-message-id"), M = _ ? e.state.messages.find((p) => p.id === _) : void 0;
|
|
2653
|
+
D(F, M);
|
|
2613
2654
|
};
|
|
2614
|
-
return
|
|
2615
|
-
}, [
|
|
2655
|
+
return C.addEventListener("click", B), () => C.removeEventListener("click", B);
|
|
2656
|
+
}, [D, e]), /* @__PURE__ */ n(
|
|
2616
2657
|
"div",
|
|
2617
2658
|
{
|
|
2618
|
-
ref:
|
|
2659
|
+
ref: q,
|
|
2619
2660
|
className: y(
|
|
2620
2661
|
"messaging-channel-view h-full flex flex-col",
|
|
2621
2662
|
o
|
|
2622
2663
|
),
|
|
2623
|
-
children: /* @__PURE__ */ n(
|
|
2664
|
+
children: /* @__PURE__ */ n(hn.Provider, { value: c ?? !1, children: /* @__PURE__ */ n(
|
|
2624
2665
|
ls,
|
|
2625
2666
|
{
|
|
2626
2667
|
channel: e,
|
|
2627
|
-
MessageSystem:
|
|
2668
|
+
MessageSystem: Za,
|
|
2628
2669
|
EmptyStateIndicator: d,
|
|
2629
|
-
LoadingIndicator:
|
|
2670
|
+
LoadingIndicator: De,
|
|
2630
2671
|
DateSeparator: ea,
|
|
2631
|
-
TypingIndicator:
|
|
2632
|
-
doSendMessageRequest:
|
|
2633
|
-
...
|
|
2672
|
+
TypingIndicator: Ja,
|
|
2673
|
+
doSendMessageRequest: P,
|
|
2674
|
+
...A ? { SendButton: A } : {},
|
|
2634
2675
|
children: /* @__PURE__ */ n(
|
|
2635
|
-
|
|
2676
|
+
sr,
|
|
2636
2677
|
{
|
|
2637
2678
|
onBack: t,
|
|
2638
2679
|
showBackButton: s,
|
|
@@ -2649,11 +2690,11 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2649
2690
|
dmAgentEnabled: c,
|
|
2650
2691
|
chatbotVotingEnabled: N,
|
|
2651
2692
|
renderChannelBanner: w,
|
|
2652
|
-
customProfileContent:
|
|
2653
|
-
customChannelActions:
|
|
2654
|
-
renderMessage:
|
|
2693
|
+
customProfileContent: I,
|
|
2694
|
+
customChannelActions: S,
|
|
2695
|
+
renderMessage: T,
|
|
2655
2696
|
viewerLanguage: O,
|
|
2656
|
-
getParticipantDisplayName:
|
|
2697
|
+
getParticipantDisplayName: R
|
|
2657
2698
|
}
|
|
2658
2699
|
)
|
|
2659
2700
|
}
|
|
@@ -2662,8 +2703,8 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
2662
2703
|
);
|
|
2663
2704
|
}
|
|
2664
2705
|
);
|
|
2665
|
-
|
|
2666
|
-
const
|
|
2706
|
+
fn.displayName = "ChannelView";
|
|
2707
|
+
const ar = ({ className: e }) => /* @__PURE__ */ m(
|
|
2667
2708
|
"svg",
|
|
2668
2709
|
{
|
|
2669
2710
|
width: "140",
|
|
@@ -2797,17 +2838,17 @@ const rr = ({ className: e }) => /* @__PURE__ */ m(
|
|
|
2797
2838
|
] })
|
|
2798
2839
|
]
|
|
2799
2840
|
}
|
|
2800
|
-
),
|
|
2841
|
+
), gn = $.memo(
|
|
2801
2842
|
({ hasChannels: e, channelsLoaded: t }) => /* @__PURE__ */ n("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2802
|
-
/* @__PURE__ */ n(
|
|
2843
|
+
/* @__PURE__ */ n(ar, {}),
|
|
2803
2844
|
t && !e && /* @__PURE__ */ m("div", { className: "mt-8", children: [
|
|
2804
2845
|
/* @__PURE__ */ n("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2805
2846
|
/* @__PURE__ */ n("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2806
2847
|
] })
|
|
2807
2848
|
] }) })
|
|
2808
2849
|
);
|
|
2809
|
-
|
|
2810
|
-
const
|
|
2850
|
+
gn.displayName = "EmptyState";
|
|
2851
|
+
const Ae = $.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ m("div", { className: "text-center max-w-sm", children: [
|
|
2811
2852
|
/* @__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: "⚠️" }) }),
|
|
2812
2853
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2813
2854
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -2821,8 +2862,8 @@ const Te = B.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
|
|
|
2821
2862
|
}
|
|
2822
2863
|
)
|
|
2823
2864
|
] }) }));
|
|
2824
|
-
|
|
2825
|
-
const
|
|
2865
|
+
Ae.displayName = "ErrorState";
|
|
2866
|
+
const Ci = ({
|
|
2826
2867
|
capabilities: e = {},
|
|
2827
2868
|
className: t,
|
|
2828
2869
|
renderMessageInputActions: s,
|
|
@@ -2842,73 +2883,73 @@ const ki = ({
|
|
|
2842
2883
|
messageMetadata: v,
|
|
2843
2884
|
onMessageSent: N,
|
|
2844
2885
|
showStarButton: w = !1,
|
|
2845
|
-
chatbotVotingEnabled:
|
|
2846
|
-
viewerLanguage:
|
|
2847
|
-
renderMessagePreview:
|
|
2848
|
-
renderChannelBanner:
|
|
2849
|
-
customProfileContent:
|
|
2886
|
+
chatbotVotingEnabled: I = !1,
|
|
2887
|
+
viewerLanguage: S,
|
|
2888
|
+
renderMessagePreview: T,
|
|
2889
|
+
renderChannelBanner: D,
|
|
2890
|
+
customProfileContent: A,
|
|
2850
2891
|
customChannelActions: O,
|
|
2851
|
-
renderMessage:
|
|
2852
|
-
onMessageLinkClick:
|
|
2853
|
-
sendButton:
|
|
2892
|
+
renderMessage: E,
|
|
2893
|
+
onMessageLinkClick: R,
|
|
2894
|
+
sendButton: P
|
|
2854
2895
|
}) => {
|
|
2855
2896
|
const {
|
|
2856
|
-
service:
|
|
2857
|
-
client:
|
|
2858
|
-
isConnected:
|
|
2859
|
-
isLoading:
|
|
2860
|
-
error:
|
|
2861
|
-
refreshConnection:
|
|
2897
|
+
service: q,
|
|
2898
|
+
client: C,
|
|
2899
|
+
isConnected: B,
|
|
2900
|
+
isLoading: G,
|
|
2901
|
+
error: U,
|
|
2902
|
+
refreshConnection: L,
|
|
2862
2903
|
debug: F
|
|
2863
|
-
} = Ls(), [
|
|
2864
|
-
const
|
|
2904
|
+
} = Ls(), [H, _] = z(null), [M, p] = z(!1), [k, Y] = z(!1), [W, he] = z(!1), [J, ee] = z(null), { showDeleteConversation: ke = !0 } = e, Ee = $.useMemo(() => {
|
|
2905
|
+
const j = C == null ? void 0 : C.userID;
|
|
2865
2906
|
return {
|
|
2866
2907
|
...{
|
|
2867
2908
|
type: "messaging",
|
|
2868
2909
|
last_message_at: { $exists: !0 },
|
|
2869
|
-
|
|
2870
|
-
members: { $in: [
|
|
2910
|
+
...j && {
|
|
2911
|
+
members: { $in: [j] },
|
|
2871
2912
|
hidden: !1
|
|
2872
2913
|
}
|
|
2873
2914
|
},
|
|
2874
2915
|
...h
|
|
2875
2916
|
};
|
|
2876
|
-
}, [h,
|
|
2877
|
-
if (!
|
|
2878
|
-
const
|
|
2879
|
-
if (
|
|
2917
|
+
}, [h, C == null ? void 0 : C.userID]), ce = Z(null), te = V(async () => {
|
|
2918
|
+
if (!C || !B) return;
|
|
2919
|
+
const j = C.userID;
|
|
2920
|
+
if (j)
|
|
2880
2921
|
try {
|
|
2881
|
-
F && console.log("[MessagingShell] Syncing channels for user:",
|
|
2882
|
-
const K = await
|
|
2922
|
+
F && console.log("[MessagingShell] Syncing channels for user:", j);
|
|
2923
|
+
const K = await C.queryChannels(
|
|
2883
2924
|
{
|
|
2884
2925
|
type: "messaging",
|
|
2885
|
-
members: { $in: [
|
|
2926
|
+
members: { $in: [j] }
|
|
2886
2927
|
},
|
|
2887
2928
|
{},
|
|
2888
2929
|
{ limit: 100 }
|
|
2889
2930
|
);
|
|
2890
|
-
p(K.length > 0), Y(!0), ce.current =
|
|
2931
|
+
p(K.length > 0), Y(!0), ce.current = j, F && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2891
2932
|
channelCount: K.length
|
|
2892
2933
|
});
|
|
2893
2934
|
} catch (K) {
|
|
2894
2935
|
console.error("[MessagingShell] Failed to sync channels:", K);
|
|
2895
2936
|
}
|
|
2896
|
-
}, [
|
|
2937
|
+
}, [C, B, F]);
|
|
2897
2938
|
X(() => {
|
|
2898
|
-
if (!
|
|
2899
|
-
const
|
|
2900
|
-
|
|
2901
|
-
}, [
|
|
2902
|
-
if (!i || !
|
|
2939
|
+
if (!C || !B) return;
|
|
2940
|
+
const j = C.userID;
|
|
2941
|
+
j && ce.current !== j && te();
|
|
2942
|
+
}, [C, B, te]), X(() => {
|
|
2943
|
+
if (!i || !C || !B) return;
|
|
2903
2944
|
(async () => {
|
|
2904
|
-
const K =
|
|
2945
|
+
const K = C.userID;
|
|
2905
2946
|
if (K)
|
|
2906
2947
|
try {
|
|
2907
2948
|
F && console.log(
|
|
2908
2949
|
"[MessagingShell] Loading initial conversation with:",
|
|
2909
2950
|
i
|
|
2910
2951
|
);
|
|
2911
|
-
const Q = await
|
|
2952
|
+
const Q = await C.queryChannels(
|
|
2912
2953
|
{
|
|
2913
2954
|
type: "messaging",
|
|
2914
2955
|
members: { $eq: [K, i] }
|
|
@@ -2921,13 +2962,13 @@ const ki = ({
|
|
|
2921
2962
|
"[MessagingShell] Initial conversation loaded:",
|
|
2922
2963
|
Q[0].id
|
|
2923
2964
|
);
|
|
2924
|
-
else if (l &&
|
|
2965
|
+
else if (l && q) {
|
|
2925
2966
|
F && console.log(
|
|
2926
2967
|
"[MessagingShell] No conversation found, creating one for:",
|
|
2927
2968
|
l
|
|
2928
2969
|
);
|
|
2929
2970
|
try {
|
|
2930
|
-
const ae = await
|
|
2971
|
+
const ae = await q.startChannelWithParticipant({
|
|
2931
2972
|
id: l.id,
|
|
2932
2973
|
name: l.name,
|
|
2933
2974
|
phone: l.phone
|
|
@@ -2959,37 +3000,37 @@ const ki = ({
|
|
|
2959
3000
|
}, [
|
|
2960
3001
|
i,
|
|
2961
3002
|
l,
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
3003
|
+
C,
|
|
3004
|
+
B,
|
|
3005
|
+
q,
|
|
2965
3006
|
F,
|
|
2966
3007
|
r
|
|
2967
3008
|
]);
|
|
2968
|
-
const se =
|
|
2969
|
-
(
|
|
2970
|
-
_(
|
|
3009
|
+
const se = V(
|
|
3010
|
+
(j) => {
|
|
3011
|
+
_(j), r == null || r(j);
|
|
2971
3012
|
},
|
|
2972
3013
|
[r]
|
|
2973
|
-
), de =
|
|
2974
|
-
|
|
2975
|
-
}, [
|
|
2976
|
-
async (
|
|
2977
|
-
F && console.log("[MessagingShell] Leaving conversation:",
|
|
3014
|
+
), de = V(() => {
|
|
3015
|
+
W || _(null);
|
|
3016
|
+
}, [W]), Oe = V(
|
|
3017
|
+
async (j) => {
|
|
3018
|
+
F && console.log("[MessagingShell] Leaving conversation:", j.id), _(null), he(!1), ce.current = null, await te();
|
|
2978
3019
|
},
|
|
2979
3020
|
[te, F]
|
|
2980
|
-
),
|
|
2981
|
-
async (
|
|
2982
|
-
F && console.log("[MessagingShell] Blocking participant:",
|
|
3021
|
+
), Ie = V(
|
|
3022
|
+
async (j) => {
|
|
3023
|
+
F && console.log("[MessagingShell] Blocking participant:", j), _(null), he(!1), ce.current = null, await te();
|
|
2983
3024
|
},
|
|
2984
3025
|
[te, F]
|
|
2985
|
-
), ue = !!
|
|
2986
|
-
return
|
|
2987
|
-
|
|
3026
|
+
), ue = !!H;
|
|
3027
|
+
return G ? /* @__PURE__ */ n("div", { className: y("h-full", t), children: /* @__PURE__ */ n(De, {}) }) : U ? /* @__PURE__ */ n("div", { className: y("h-full", t), children: /* @__PURE__ */ n(Ae, { message: U, onBack: L }) }) : !B || !C ? /* @__PURE__ */ n("div", { className: y("h-full", t), children: /* @__PURE__ */ n(
|
|
3028
|
+
Ae,
|
|
2988
3029
|
{
|
|
2989
3030
|
message: "Not connected to messaging service",
|
|
2990
|
-
onBack:
|
|
3031
|
+
onBack: L
|
|
2991
3032
|
}
|
|
2992
|
-
) }) : J ? /* @__PURE__ */ n("div", { className: y("h-full", t), children: /* @__PURE__ */ n(
|
|
3033
|
+
) }) : J ? /* @__PURE__ */ n("div", { className: y("h-full", t), children: /* @__PURE__ */ n(Ae, { message: J }) }) : /* @__PURE__ */ n(
|
|
2993
3034
|
"div",
|
|
2994
3035
|
{
|
|
2995
3036
|
className: y(
|
|
@@ -3003,23 +3044,23 @@ const ki = ({
|
|
|
3003
3044
|
className: y(
|
|
3004
3045
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
3005
3046
|
{
|
|
3006
|
-
"!hidden": d === !1 ||
|
|
3047
|
+
"!hidden": d === !1 || W,
|
|
3007
3048
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
3008
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": d !== !1 && !
|
|
3049
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": d !== !1 && !W && ue,
|
|
3009
3050
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
3010
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": d !== !1 && !
|
|
3051
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": d !== !1 && !W && !ue
|
|
3011
3052
|
}
|
|
3012
3053
|
),
|
|
3013
3054
|
children: /* @__PURE__ */ n(
|
|
3014
|
-
|
|
3055
|
+
tn,
|
|
3015
3056
|
{
|
|
3016
3057
|
onChannelSelect: se,
|
|
3017
|
-
selectedChannel:
|
|
3018
|
-
filters:
|
|
3058
|
+
selectedChannel: H || void 0,
|
|
3059
|
+
filters: Ee,
|
|
3019
3060
|
channelRenderFilterFn: g,
|
|
3020
3061
|
customEmptyStateIndicator: u,
|
|
3021
|
-
renderMessagePreview:
|
|
3022
|
-
viewerLanguage:
|
|
3062
|
+
renderMessagePreview: T,
|
|
3063
|
+
viewerLanguage: S
|
|
3023
3064
|
}
|
|
3024
3065
|
)
|
|
3025
3066
|
}
|
|
@@ -3031,24 +3072,24 @@ const ki = ({
|
|
|
3031
3072
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
3032
3073
|
{
|
|
3033
3074
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
3034
|
-
flex:
|
|
3075
|
+
flex: W || ue || i,
|
|
3035
3076
|
// Normal mode: hide on mobile when no channel selected
|
|
3036
|
-
"hidden lg:flex": !
|
|
3077
|
+
"hidden lg:flex": !W && !ue && !i
|
|
3037
3078
|
}
|
|
3038
3079
|
),
|
|
3039
|
-
children:
|
|
3040
|
-
|
|
3080
|
+
children: H ? /* @__PURE__ */ n("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ n(
|
|
3081
|
+
fn,
|
|
3041
3082
|
{
|
|
3042
|
-
channel:
|
|
3083
|
+
channel: H,
|
|
3043
3084
|
onBack: de,
|
|
3044
|
-
showBackButton: !
|
|
3085
|
+
showBackButton: !W,
|
|
3045
3086
|
renderMessageInputActions: s,
|
|
3046
3087
|
renderConversationFooter: a,
|
|
3047
|
-
renderChannelBanner:
|
|
3088
|
+
renderChannelBanner: D,
|
|
3048
3089
|
onLeaveConversation: Oe,
|
|
3049
|
-
onBlockParticipant:
|
|
3090
|
+
onBlockParticipant: Ie,
|
|
3050
3091
|
CustomChannelEmptyState: o,
|
|
3051
|
-
showDeleteConversation:
|
|
3092
|
+
showDeleteConversation: ke,
|
|
3052
3093
|
onDeleteConversationClick: f,
|
|
3053
3094
|
onBlockParticipantClick: c,
|
|
3054
3095
|
onReportParticipantClick: b,
|
|
@@ -3056,23 +3097,23 @@ const ki = ({
|
|
|
3056
3097
|
messageMetadata: v,
|
|
3057
3098
|
onMessageSent: N,
|
|
3058
3099
|
showStarButton: w,
|
|
3059
|
-
chatbotVotingEnabled:
|
|
3060
|
-
viewerLanguage:
|
|
3061
|
-
customProfileContent:
|
|
3100
|
+
chatbotVotingEnabled: I,
|
|
3101
|
+
viewerLanguage: S,
|
|
3102
|
+
customProfileContent: A,
|
|
3062
3103
|
customChannelActions: O,
|
|
3063
|
-
renderMessage:
|
|
3064
|
-
onMessageLinkClick:
|
|
3065
|
-
sendButton:
|
|
3104
|
+
renderMessage: E,
|
|
3105
|
+
onMessageLinkClick: R,
|
|
3106
|
+
sendButton: P
|
|
3066
3107
|
},
|
|
3067
|
-
|
|
3108
|
+
H.id
|
|
3068
3109
|
) }) : i ? (
|
|
3069
3110
|
// Show loading while creating/loading direct conversation channel
|
|
3070
|
-
/* @__PURE__ */ n(
|
|
3111
|
+
/* @__PURE__ */ n(De, {})
|
|
3071
3112
|
) : /* @__PURE__ */ n(
|
|
3072
|
-
|
|
3113
|
+
gn,
|
|
3073
3114
|
{
|
|
3074
|
-
hasChannels:
|
|
3075
|
-
channelsLoaded:
|
|
3115
|
+
hasChannels: M,
|
|
3116
|
+
channelsLoaded: k
|
|
3076
3117
|
}
|
|
3077
3118
|
)
|
|
3078
3119
|
}
|
|
@@ -3080,25 +3121,25 @@ const ki = ({
|
|
|
3080
3121
|
] })
|
|
3081
3122
|
}
|
|
3082
3123
|
);
|
|
3083
|
-
},
|
|
3124
|
+
}, rr = /^([a-z][a-z0-9+.-]*):/i, ir = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
|
|
3084
3125
|
function ot(e) {
|
|
3085
3126
|
if (typeof e != "string") return;
|
|
3086
3127
|
const t = e.trim();
|
|
3087
3128
|
if (t === "") return;
|
|
3088
|
-
const s =
|
|
3129
|
+
const s = rr.exec(t);
|
|
3089
3130
|
if (s) {
|
|
3090
3131
|
const a = s[1].toLowerCase();
|
|
3091
|
-
return
|
|
3132
|
+
return ir.has(a) ? t : void 0;
|
|
3092
3133
|
}
|
|
3093
3134
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
3094
3135
|
}
|
|
3095
|
-
const
|
|
3136
|
+
const or = {
|
|
3096
3137
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
3097
3138
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
3098
|
-
},
|
|
3139
|
+
}, lr = ({ variant: e, cta: t }) => {
|
|
3099
3140
|
const s = y(
|
|
3100
3141
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
3101
|
-
|
|
3142
|
+
or[e]
|
|
3102
3143
|
), a = ot(t.href);
|
|
3103
3144
|
return a ? /* @__PURE__ */ n(
|
|
3104
3145
|
"a",
|
|
@@ -3125,10 +3166,10 @@ const lr = {
|
|
|
3125
3166
|
children: t.label
|
|
3126
3167
|
}
|
|
3127
3168
|
);
|
|
3128
|
-
},
|
|
3169
|
+
}, cr = {
|
|
3129
3170
|
dark: "text-white",
|
|
3130
3171
|
light: "text-black/90"
|
|
3131
|
-
},
|
|
3172
|
+
}, dr = "text-white/30", ur = {
|
|
3132
3173
|
dark: "text-white/55",
|
|
3133
3174
|
light: "text-black/55"
|
|
3134
3175
|
}, lt = ({
|
|
@@ -3145,10 +3186,10 @@ const lr = {
|
|
|
3145
3186
|
if (!g && !u && !c && !b) return null;
|
|
3146
3187
|
const v = y(
|
|
3147
3188
|
"truncate text-base font-medium leading-6",
|
|
3148
|
-
d && !t ?
|
|
3189
|
+
d && !t ? dr : cr[e]
|
|
3149
3190
|
), N = y(
|
|
3150
3191
|
"truncate text-xs leading-4",
|
|
3151
|
-
|
|
3192
|
+
ur[e]
|
|
3152
3193
|
);
|
|
3153
3194
|
return /* @__PURE__ */ m("div", { className: "px-4 py-3", children: [
|
|
3154
3195
|
/* @__PURE__ */ m("div", { className: "flex items-end gap-3", children: [
|
|
@@ -3164,16 +3205,16 @@ const lr = {
|
|
|
3164
3205
|
] }),
|
|
3165
3206
|
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
3166
3207
|
] }),
|
|
3167
|
-
l && /* @__PURE__ */ n(
|
|
3208
|
+
l && /* @__PURE__ */ n(lr, { variant: e, cta: l })
|
|
3168
3209
|
] });
|
|
3169
|
-
},
|
|
3210
|
+
}, mr = y(
|
|
3170
3211
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
3171
3212
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
3172
3213
|
// the messaging design system's "small border around link attachments"
|
|
3173
3214
|
// treatment from the mobile spec. The drop shadow remains for depth.
|
|
3174
3215
|
"border border-black/[0.08]",
|
|
3175
3216
|
"shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
|
|
3176
|
-
),
|
|
3217
|
+
), Re = ({
|
|
3177
3218
|
variant: e,
|
|
3178
3219
|
children: t,
|
|
3179
3220
|
href: s,
|
|
@@ -3185,7 +3226,7 @@ const lr = {
|
|
|
3185
3226
|
"data-testid": d
|
|
3186
3227
|
}) => {
|
|
3187
3228
|
const h = s != null || a != null, g = y(
|
|
3188
|
-
|
|
3229
|
+
mr,
|
|
3189
3230
|
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
3190
3231
|
// `focus-ring` is a design-system utility from the component-library
|
|
3191
3232
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
@@ -3233,17 +3274,17 @@ const lr = {
|
|
|
3233
3274
|
]
|
|
3234
3275
|
}
|
|
3235
3276
|
);
|
|
3236
|
-
},
|
|
3277
|
+
}, hr = {
|
|
3237
3278
|
dark: "bg-white/10",
|
|
3238
3279
|
light: "bg-black/5"
|
|
3239
|
-
},
|
|
3280
|
+
}, fr = {
|
|
3240
3281
|
dark: "size-16 text-white/25",
|
|
3241
3282
|
light: "size-16 text-black/25"
|
|
3242
|
-
}, Fe = (e, t) => !!t && !!e && le(e) === "audio",
|
|
3283
|
+
}, Fe = (e, t) => !!t && !!e && le(e) === "audio", bn = (e, t) => {
|
|
3243
3284
|
if (!t || !e) return !1;
|
|
3244
3285
|
const s = le(e);
|
|
3245
3286
|
return s === "video" || s === "audio";
|
|
3246
|
-
}, ct = "bg-[#F2F3F4]",
|
|
3287
|
+
}, ct = "bg-[#F2F3F4]", Le = ({
|
|
3247
3288
|
variant: e,
|
|
3248
3289
|
thumbnailUrl: t,
|
|
3249
3290
|
sourceUrl: s,
|
|
@@ -3294,10 +3335,10 @@ const lr = {
|
|
|
3294
3335
|
{
|
|
3295
3336
|
className: y(
|
|
3296
3337
|
"flex h-full w-full items-center justify-center",
|
|
3297
|
-
|
|
3338
|
+
hr[e]
|
|
3298
3339
|
),
|
|
3299
3340
|
children: ge(r, {
|
|
3300
|
-
className:
|
|
3341
|
+
className: fr[e],
|
|
3301
3342
|
weight: "regular"
|
|
3302
3343
|
})
|
|
3303
3344
|
}
|
|
@@ -3307,7 +3348,7 @@ const lr = {
|
|
|
3307
3348
|
]
|
|
3308
3349
|
}
|
|
3309
3350
|
);
|
|
3310
|
-
},
|
|
3351
|
+
}, gr = ({
|
|
3311
3352
|
title: e,
|
|
3312
3353
|
placeholderTitle: t,
|
|
3313
3354
|
description: s,
|
|
@@ -3328,7 +3369,7 @@ const lr = {
|
|
|
3328
3369
|
onClick: g,
|
|
3329
3370
|
"aria-label": "Dismiss attachment",
|
|
3330
3371
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
3331
|
-
children: /* @__PURE__ */ n(
|
|
3372
|
+
children: /* @__PURE__ */ n(we, { className: "size-3", weight: "bold" })
|
|
3332
3373
|
}
|
|
3333
3374
|
) : void 0, x = u ? /* @__PURE__ */ n(
|
|
3334
3375
|
"button",
|
|
@@ -3337,12 +3378,12 @@ const lr = {
|
|
|
3337
3378
|
onClick: u,
|
|
3338
3379
|
"aria-label": "Edit attachment",
|
|
3339
3380
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
3340
|
-
children: /* @__PURE__ */ n(
|
|
3381
|
+
children: /* @__PURE__ */ n(Ms, { className: "size-5", weight: "regular" })
|
|
3341
3382
|
}
|
|
3342
3383
|
) : void 0;
|
|
3343
|
-
return c ? /* @__PURE__ */ n(
|
|
3384
|
+
return c ? /* @__PURE__ */ n(Re, { variant: "dark", bgClassName: ct, children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
3344
3385
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
3345
|
-
|
|
3386
|
+
Le,
|
|
3346
3387
|
{
|
|
3347
3388
|
variant: "dark",
|
|
3348
3389
|
sourceUrl: l,
|
|
@@ -3352,13 +3393,13 @@ const lr = {
|
|
|
3352
3393
|
) }),
|
|
3353
3394
|
b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
|
|
3354
3395
|
] }) }) : /* @__PURE__ */ m(
|
|
3355
|
-
|
|
3396
|
+
Re,
|
|
3356
3397
|
{
|
|
3357
3398
|
variant: "dark",
|
|
3358
3399
|
topRight: f ? b : void 0,
|
|
3359
3400
|
children: [
|
|
3360
3401
|
!f && /* @__PURE__ */ n(
|
|
3361
|
-
|
|
3402
|
+
Le,
|
|
3362
3403
|
{
|
|
3363
3404
|
variant: "dark",
|
|
3364
3405
|
thumbnailUrl: i,
|
|
@@ -3384,7 +3425,7 @@ const lr = {
|
|
|
3384
3425
|
]
|
|
3385
3426
|
}
|
|
3386
3427
|
);
|
|
3387
|
-
},
|
|
3428
|
+
}, br = ({
|
|
3388
3429
|
title: e,
|
|
3389
3430
|
description: t,
|
|
3390
3431
|
url: s,
|
|
@@ -3396,7 +3437,7 @@ const lr = {
|
|
|
3396
3437
|
cta: d,
|
|
3397
3438
|
onClick: h
|
|
3398
3439
|
}) => {
|
|
3399
|
-
const g =
|
|
3440
|
+
const g = bn(a, i), u = ot(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? h : void 0, b = Fe(a, i) ? ct : void 0, x = d && h ? {
|
|
3400
3441
|
...d,
|
|
3401
3442
|
onClick: () => {
|
|
3402
3443
|
var v;
|
|
@@ -3404,7 +3445,7 @@ const lr = {
|
|
|
3404
3445
|
}
|
|
3405
3446
|
} : d;
|
|
3406
3447
|
return /* @__PURE__ */ m(
|
|
3407
|
-
|
|
3448
|
+
Re,
|
|
3408
3449
|
{
|
|
3409
3450
|
variant: "light",
|
|
3410
3451
|
href: f,
|
|
@@ -3414,7 +3455,7 @@ const lr = {
|
|
|
3414
3455
|
"data-testid": "link-attachment",
|
|
3415
3456
|
children: [
|
|
3416
3457
|
l === "featured" && /* @__PURE__ */ n(
|
|
3417
|
-
|
|
3458
|
+
Le,
|
|
3418
3459
|
{
|
|
3419
3460
|
variant: "light",
|
|
3420
3461
|
thumbnailUrl: r,
|
|
@@ -3437,7 +3478,7 @@ const lr = {
|
|
|
3437
3478
|
]
|
|
3438
3479
|
}
|
|
3439
3480
|
);
|
|
3440
|
-
},
|
|
3481
|
+
}, pr = ({
|
|
3441
3482
|
title: e,
|
|
3442
3483
|
placeholderTitle: t,
|
|
3443
3484
|
description: s,
|
|
@@ -3450,9 +3491,9 @@ const lr = {
|
|
|
3450
3491
|
cta: h,
|
|
3451
3492
|
onClick: g
|
|
3452
3493
|
}) => {
|
|
3453
|
-
const u =
|
|
3494
|
+
const u = bn(r, l), f = ot(a), c = h == null && f != null && !u ? f : void 0, b = h == null && !u && c != null ? g : void 0;
|
|
3454
3495
|
return /* @__PURE__ */ m(
|
|
3455
|
-
|
|
3496
|
+
Re,
|
|
3456
3497
|
{
|
|
3457
3498
|
variant: "dark",
|
|
3458
3499
|
href: c,
|
|
@@ -3460,7 +3501,7 @@ const lr = {
|
|
|
3460
3501
|
bgClassName: Fe(r, l) ? ct : void 0,
|
|
3461
3502
|
children: [
|
|
3462
3503
|
o === "featured" && /* @__PURE__ */ n(
|
|
3463
|
-
|
|
3504
|
+
Le,
|
|
3464
3505
|
{
|
|
3465
3506
|
variant: "dark",
|
|
3466
3507
|
thumbnailUrl: i,
|
|
@@ -3484,20 +3525,20 @@ const lr = {
|
|
|
3484
3525
|
]
|
|
3485
3526
|
}
|
|
3486
3527
|
);
|
|
3487
|
-
},
|
|
3488
|
-
Composer:
|
|
3489
|
-
Sent:
|
|
3490
|
-
Received:
|
|
3491
|
-
},
|
|
3528
|
+
}, ki = {
|
|
3529
|
+
Composer: gr,
|
|
3530
|
+
Sent: pr,
|
|
3531
|
+
Received: br
|
|
3532
|
+
}, vr = {
|
|
3492
3533
|
dark: "bg-[#121110]",
|
|
3493
3534
|
light: "bg-[#e9eaed]"
|
|
3494
|
-
},
|
|
3535
|
+
}, xr = {
|
|
3495
3536
|
dark: "text-white",
|
|
3496
3537
|
light: "text-[#080707]"
|
|
3497
|
-
},
|
|
3538
|
+
}, wr = {
|
|
3498
3539
|
dark: "border-white/[0.08]",
|
|
3499
3540
|
light: "border-black/[0.08]"
|
|
3500
|
-
},
|
|
3541
|
+
}, Nr = (e) => e === "dark" ? "sender" : "receiver", yr = {
|
|
3501
3542
|
sender: {
|
|
3502
3543
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
3503
3544
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -3510,7 +3551,7 @@ const lr = {
|
|
|
3510
3551
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
3511
3552
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
3512
3553
|
}
|
|
3513
|
-
},
|
|
3554
|
+
}, Ne = ({
|
|
3514
3555
|
variant: e,
|
|
3515
3556
|
text: t,
|
|
3516
3557
|
bordered: s = !0,
|
|
@@ -3519,7 +3560,7 @@ const lr = {
|
|
|
3519
3560
|
children: i,
|
|
3520
3561
|
"data-testid": l
|
|
3521
3562
|
}) => {
|
|
3522
|
-
const o = t != null && t !== "", d =
|
|
3563
|
+
const o = t != null && t !== "", d = yr[Nr(e)][a];
|
|
3523
3564
|
return /* @__PURE__ */ m(
|
|
3524
3565
|
"div",
|
|
3525
3566
|
{
|
|
@@ -3534,10 +3575,10 @@ const lr = {
|
|
|
3534
3575
|
// as the surrounding `CustomMessage` text bubbles.
|
|
3535
3576
|
"relative w-[280px] overflow-hidden px-2 py-2",
|
|
3536
3577
|
d,
|
|
3578
|
+
vr[e],
|
|
3537
3579
|
xr[e],
|
|
3538
|
-
wr[e],
|
|
3539
3580
|
s && "border",
|
|
3540
|
-
s &&
|
|
3581
|
+
s && wr[e],
|
|
3541
3582
|
r
|
|
3542
3583
|
),
|
|
3543
3584
|
children: [
|
|
@@ -3562,7 +3603,7 @@ const lr = {
|
|
|
3562
3603
|
]
|
|
3563
3604
|
}
|
|
3564
3605
|
);
|
|
3565
|
-
},
|
|
3606
|
+
}, ye = ({
|
|
3566
3607
|
onClick: e,
|
|
3567
3608
|
variant: t = "overlay",
|
|
3568
3609
|
ariaLabel: s = "Dismiss attachment"
|
|
@@ -3578,18 +3619,18 @@ const lr = {
|
|
|
3578
3619
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
3579
3620
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
3580
3621
|
),
|
|
3581
|
-
children: /* @__PURE__ */ n(
|
|
3622
|
+
children: /* @__PURE__ */ n(we, { className: "size-3", weight: "bold" })
|
|
3582
3623
|
}
|
|
3583
|
-
),
|
|
3624
|
+
), _e = (e) => e === "received" ? "light" : "dark", Ei = ({
|
|
3584
3625
|
firstOfGroup: e,
|
|
3585
3626
|
endOfGroup: t,
|
|
3586
3627
|
groupedByUser: s
|
|
3587
|
-
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle",
|
|
3628
|
+
}) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", _r = ({
|
|
3588
3629
|
src: e,
|
|
3589
3630
|
mimeType: t,
|
|
3590
3631
|
filename: s,
|
|
3591
3632
|
items: a
|
|
3592
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [],
|
|
3633
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Cr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3593
3634
|
/* @__PURE__ */ n(
|
|
3594
3635
|
"audio",
|
|
3595
3636
|
{
|
|
@@ -3612,38 +3653,38 @@ const lr = {
|
|
|
3612
3653
|
preload: o,
|
|
3613
3654
|
onDismiss: d
|
|
3614
3655
|
}) => {
|
|
3615
|
-
const h =
|
|
3656
|
+
const h = _e(e), g = e === "composer" && !!d, u = _r({ src: t, mimeType: s, filename: a, items: r });
|
|
3616
3657
|
if (u.length === 0)
|
|
3617
3658
|
return null;
|
|
3618
3659
|
const f = o ?? (u.length > 1 ? "none" : "metadata");
|
|
3619
3660
|
return /* @__PURE__ */ n(
|
|
3620
|
-
|
|
3661
|
+
Ne,
|
|
3621
3662
|
{
|
|
3622
3663
|
variant: h,
|
|
3623
3664
|
text: i,
|
|
3624
3665
|
groupPosition: l,
|
|
3625
3666
|
"data-testid": "audio-attachment",
|
|
3626
3667
|
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
|
|
3627
|
-
|
|
3668
|
+
Cr,
|
|
3628
3669
|
{
|
|
3629
3670
|
item: c,
|
|
3630
3671
|
preload: f,
|
|
3631
3672
|
trailingAction: (
|
|
3632
3673
|
// Composer only supports a single attachment, so the
|
|
3633
3674
|
// dismiss control sits on the only player.
|
|
3634
|
-
g && b === 0 ? /* @__PURE__ */ n(
|
|
3675
|
+
g && b === 0 ? /* @__PURE__ */ n(ye, { onClick: d, variant: "inline" }) : void 0
|
|
3635
3676
|
)
|
|
3636
3677
|
},
|
|
3637
3678
|
`${c.src}-${b}`
|
|
3638
3679
|
)) })
|
|
3639
3680
|
}
|
|
3640
3681
|
);
|
|
3641
|
-
},
|
|
3642
|
-
Composer:
|
|
3643
|
-
Sent:
|
|
3644
|
-
Received:
|
|
3682
|
+
}, kr = (e) => /* @__PURE__ */ n(dt, { ...e, state: "composer" }), Er = (e) => /* @__PURE__ */ n(dt, { ...e, state: "sent" }), Ir = (e) => /* @__PURE__ */ n(dt, { ...e, state: "received" }), Sr = {
|
|
3683
|
+
Composer: kr,
|
|
3684
|
+
Sent: Er,
|
|
3685
|
+
Received: Ir
|
|
3645
3686
|
};
|
|
3646
|
-
function
|
|
3687
|
+
function Tr(e) {
|
|
3647
3688
|
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`;
|
|
3648
3689
|
}
|
|
3649
3690
|
const Ar = {
|
|
@@ -3656,7 +3697,7 @@ const Ar = {
|
|
|
3656
3697
|
text: "TXT",
|
|
3657
3698
|
markdown: "MD"
|
|
3658
3699
|
};
|
|
3659
|
-
function
|
|
3700
|
+
function Mr(e, t) {
|
|
3660
3701
|
if (t) {
|
|
3661
3702
|
const r = t.lastIndexOf(".");
|
|
3662
3703
|
if (r > 0 && r < t.length - 1) {
|
|
@@ -3666,7 +3707,7 @@ function Dr(e, t) {
|
|
|
3666
3707
|
}
|
|
3667
3708
|
if (!e) return;
|
|
3668
3709
|
if (le(e) === "document") {
|
|
3669
|
-
const r =
|
|
3710
|
+
const r = an(e), i = Ar[r];
|
|
3670
3711
|
if (i) return i;
|
|
3671
3712
|
if (e === "application/octet-stream") return;
|
|
3672
3713
|
}
|
|
@@ -3674,8 +3715,8 @@ function Dr(e, t) {
|
|
|
3674
3715
|
if (!(!a || a === "*"))
|
|
3675
3716
|
return a.toUpperCase();
|
|
3676
3717
|
}
|
|
3677
|
-
function
|
|
3678
|
-
const a =
|
|
3718
|
+
function Dr(e, t, s) {
|
|
3719
|
+
const a = Mr(e, t), r = typeof s == "number" && s > 0 ? Tr(s) : void 0;
|
|
3679
3720
|
return [a, r].filter(Boolean).join(" · ") || void 0;
|
|
3680
3721
|
}
|
|
3681
3722
|
function ne(e) {
|
|
@@ -3686,16 +3727,16 @@ function ne(e) {
|
|
|
3686
3727
|
return "download";
|
|
3687
3728
|
}
|
|
3688
3729
|
}
|
|
3689
|
-
const
|
|
3730
|
+
const Rr = {
|
|
3690
3731
|
dark: "text-white/55",
|
|
3691
3732
|
light: "text-black/65"
|
|
3692
|
-
},
|
|
3733
|
+
}, Lr = {
|
|
3693
3734
|
dark: "bg-white/10",
|
|
3694
3735
|
light: "bg-black/5"
|
|
3695
|
-
},
|
|
3736
|
+
}, Fr = {
|
|
3696
3737
|
dark: "text-white/85",
|
|
3697
3738
|
light: "text-black/85"
|
|
3698
|
-
},
|
|
3739
|
+
}, pn = ({
|
|
3699
3740
|
variant: e,
|
|
3700
3741
|
filename: t,
|
|
3701
3742
|
title: s,
|
|
@@ -3705,16 +3746,16 @@ const Lr = {
|
|
|
3705
3746
|
activateLabel: l,
|
|
3706
3747
|
trailingAction: o
|
|
3707
3748
|
}) => {
|
|
3708
|
-
const d = s ?? t ?? "File", h =
|
|
3749
|
+
const d = s ?? t ?? "File", h = Dr(a, t, r), g = /* @__PURE__ */ n(
|
|
3709
3750
|
"div",
|
|
3710
3751
|
{
|
|
3711
3752
|
className: y(
|
|
3712
3753
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
3713
|
-
|
|
3754
|
+
Lr[e]
|
|
3714
3755
|
),
|
|
3715
3756
|
"aria-hidden": !0,
|
|
3716
3757
|
children: ge(a, {
|
|
3717
|
-
className: y("size-6",
|
|
3758
|
+
className: y("size-6", Fr[e]),
|
|
3718
3759
|
weight: "regular"
|
|
3719
3760
|
})
|
|
3720
3761
|
}
|
|
@@ -3725,7 +3766,7 @@ const Lr = {
|
|
|
3725
3766
|
{
|
|
3726
3767
|
className: y(
|
|
3727
3768
|
"truncate text-xs leading-4",
|
|
3728
|
-
|
|
3769
|
+
Rr[e]
|
|
3729
3770
|
),
|
|
3730
3771
|
children: h
|
|
3731
3772
|
}
|
|
@@ -3754,7 +3795,7 @@ const Lr = {
|
|
|
3754
3795
|
o ? /* @__PURE__ */ n("div", { className: "shrink-0", children: o }) : null
|
|
3755
3796
|
] });
|
|
3756
3797
|
};
|
|
3757
|
-
async function
|
|
3798
|
+
async function vn(e, t) {
|
|
3758
3799
|
const s = t ?? ne(e);
|
|
3759
3800
|
try {
|
|
3760
3801
|
const a = await fetch(e, { mode: "cors" });
|
|
@@ -3768,14 +3809,14 @@ async function pn(e, t) {
|
|
|
3768
3809
|
}
|
|
3769
3810
|
}
|
|
3770
3811
|
}
|
|
3771
|
-
const
|
|
3812
|
+
const Or = ({
|
|
3772
3813
|
src: e,
|
|
3773
3814
|
filename: t,
|
|
3774
3815
|
fileSize: s,
|
|
3775
3816
|
mimeType: a,
|
|
3776
3817
|
title: r,
|
|
3777
3818
|
items: i
|
|
3778
|
-
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [],
|
|
3819
|
+
}) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], zr = ({
|
|
3779
3820
|
variant: e,
|
|
3780
3821
|
item: t,
|
|
3781
3822
|
index: s,
|
|
@@ -3784,7 +3825,7 @@ const zr = ({
|
|
|
3784
3825
|
}) => {
|
|
3785
3826
|
const i = t.filename ?? ne(t.src);
|
|
3786
3827
|
return /* @__PURE__ */ n(
|
|
3787
|
-
|
|
3828
|
+
pn,
|
|
3788
3829
|
{
|
|
3789
3830
|
variant: e,
|
|
3790
3831
|
filename: i,
|
|
@@ -3809,7 +3850,7 @@ const zr = ({
|
|
|
3809
3850
|
onClick: h,
|
|
3810
3851
|
onDismiss: g
|
|
3811
3852
|
}) => {
|
|
3812
|
-
const u =
|
|
3853
|
+
const u = _e(e), f = e === "composer" && !!g, c = Or({
|
|
3813
3854
|
src: t,
|
|
3814
3855
|
filename: s,
|
|
3815
3856
|
fileSize: a,
|
|
@@ -3821,7 +3862,7 @@ const zr = ({
|
|
|
3821
3862
|
const N = c[v];
|
|
3822
3863
|
if (!N) return;
|
|
3823
3864
|
const w = N.filename ?? ne(N.src);
|
|
3824
|
-
|
|
3865
|
+
vn(N.src, w);
|
|
3825
3866
|
};
|
|
3826
3867
|
if (c.length === 0)
|
|
3827
3868
|
return null;
|
|
@@ -3837,29 +3878,29 @@ const zr = ({
|
|
|
3837
3878
|
}
|
|
3838
3879
|
);
|
|
3839
3880
|
return /* @__PURE__ */ n(
|
|
3840
|
-
|
|
3881
|
+
Ne,
|
|
3841
3882
|
{
|
|
3842
3883
|
variant: u,
|
|
3843
3884
|
text: o,
|
|
3844
3885
|
groupPosition: d,
|
|
3845
3886
|
"data-testid": "file-attachment",
|
|
3846
3887
|
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, N) => /* @__PURE__ */ n(
|
|
3847
|
-
|
|
3888
|
+
zr,
|
|
3848
3889
|
{
|
|
3849
3890
|
variant: u,
|
|
3850
3891
|
item: v,
|
|
3851
3892
|
index: N,
|
|
3852
3893
|
onActivate: b,
|
|
3853
|
-
trailingAction: f && N === 0 ? /* @__PURE__ */ n(
|
|
3894
|
+
trailingAction: f && N === 0 ? /* @__PURE__ */ n(ye, { onClick: g, variant: "inline" }) : x
|
|
3854
3895
|
},
|
|
3855
3896
|
`${v.src}-${N}`
|
|
3856
3897
|
)) })
|
|
3857
3898
|
}
|
|
3858
3899
|
);
|
|
3859
|
-
},
|
|
3860
|
-
Composer:
|
|
3861
|
-
Sent:
|
|
3862
|
-
Received:
|
|
3900
|
+
}, Pr = (e) => /* @__PURE__ */ n(ut, { ...e, state: "composer" }), Br = (e) => /* @__PURE__ */ n(ut, { ...e, state: "sent" }), $r = (e) => /* @__PURE__ */ n(ut, { ...e, state: "received" }), jr = {
|
|
3901
|
+
Composer: Pr,
|
|
3902
|
+
Sent: Br,
|
|
3903
|
+
Received: $r
|
|
3863
3904
|
}, mt = ({
|
|
3864
3905
|
onPrev: e,
|
|
3865
3906
|
onNext: t,
|
|
@@ -3883,10 +3924,10 @@ const zr = ({
|
|
|
3883
3924
|
onClick: t,
|
|
3884
3925
|
"aria-label": a,
|
|
3885
3926
|
className: "mes-media-viewer__nav mes-media-viewer__nav--next",
|
|
3886
|
-
children: /* @__PURE__ */ n(
|
|
3927
|
+
children: /* @__PURE__ */ n(qe, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
3887
3928
|
}
|
|
3888
3929
|
)
|
|
3889
|
-
] }),
|
|
3930
|
+
] }), xn = ({
|
|
3890
3931
|
url: e,
|
|
3891
3932
|
filename: t,
|
|
3892
3933
|
variant: s = "pill",
|
|
@@ -3895,9 +3936,9 @@ const zr = ({
|
|
|
3895
3936
|
tone: i = "dark",
|
|
3896
3937
|
onTriggered: l
|
|
3897
3938
|
}) => {
|
|
3898
|
-
const [o, d] = z(!1), h =
|
|
3939
|
+
const [o, d] = z(!1), h = V(
|
|
3899
3940
|
(c) => {
|
|
3900
|
-
c.stopPropagation(), !o && (d(!0),
|
|
3941
|
+
c.stopPropagation(), !o && (d(!0), vn(e, t).catch(() => {
|
|
3901
3942
|
}).finally(() => {
|
|
3902
3943
|
d(!1), l == null || l();
|
|
3903
3944
|
}));
|
|
@@ -3982,9 +4023,9 @@ const zr = ({
|
|
|
3982
4023
|
}, [s, t, e]), X(() => {
|
|
3983
4024
|
i((d) => Ve(d, 0, Math.max(e - 1, 0)));
|
|
3984
4025
|
}, [e]);
|
|
3985
|
-
const l =
|
|
4026
|
+
const l = V(() => {
|
|
3986
4027
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
3987
|
-
}, [e]), o =
|
|
4028
|
+
}, [e]), o = V(() => {
|
|
3988
4029
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
3989
4030
|
}, [e]);
|
|
3990
4031
|
return X(() => {
|
|
@@ -4077,7 +4118,7 @@ const zr = ({
|
|
|
4077
4118
|
onClick: t,
|
|
4078
4119
|
"aria-label": "Close viewer",
|
|
4079
4120
|
className: "mes-media-viewer__action",
|
|
4080
|
-
children: /* @__PURE__ */ n(
|
|
4121
|
+
children: /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
4081
4122
|
}
|
|
4082
4123
|
)
|
|
4083
4124
|
] })
|
|
@@ -4086,7 +4127,7 @@ const zr = ({
|
|
|
4086
4127
|
]
|
|
4087
4128
|
}
|
|
4088
4129
|
);
|
|
4089
|
-
},
|
|
4130
|
+
}, wn = ({
|
|
4090
4131
|
open: e,
|
|
4091
4132
|
items: t,
|
|
4092
4133
|
initialIndex: s = 0,
|
|
@@ -4108,7 +4149,7 @@ const zr = ({
|
|
|
4108
4149
|
ariaLabel: d,
|
|
4109
4150
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
4110
4151
|
actions: /* @__PURE__ */ n(
|
|
4111
|
-
|
|
4152
|
+
xn,
|
|
4112
4153
|
{
|
|
4113
4154
|
url: o.src,
|
|
4114
4155
|
filename: d,
|
|
@@ -4142,7 +4183,7 @@ const zr = ({
|
|
|
4142
4183
|
]
|
|
4143
4184
|
}
|
|
4144
4185
|
) : null;
|
|
4145
|
-
},
|
|
4186
|
+
}, Ur = "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", Nn = ({
|
|
4146
4187
|
tiles: e,
|
|
4147
4188
|
onTileActivate: t,
|
|
4148
4189
|
maxVisible: s = 4,
|
|
@@ -4151,7 +4192,7 @@ const zr = ({
|
|
|
4151
4192
|
const r = e.length;
|
|
4152
4193
|
if (r === 0) return null;
|
|
4153
4194
|
const i = e.slice(0, Math.min(r, s)), l = r - i.length, o = (d, h, g) => {
|
|
4154
|
-
const u = y(
|
|
4195
|
+
const u = y(Ur, "h-full w-full");
|
|
4155
4196
|
return t ? /* @__PURE__ */ m(
|
|
4156
4197
|
"button",
|
|
4157
4198
|
{
|
|
@@ -4212,15 +4253,15 @@ const zr = ({
|
|
|
4212
4253
|
})
|
|
4213
4254
|
}
|
|
4214
4255
|
);
|
|
4215
|
-
},
|
|
4216
|
-
const [t, s] = z(!1), [a, r] = z(0), i =
|
|
4256
|
+
}, Ce = (e) => {
|
|
4257
|
+
const [t, s] = z(!1), [a, r] = z(0), i = V(
|
|
4217
4258
|
(o) => {
|
|
4218
4259
|
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
4219
4260
|
},
|
|
4220
4261
|
[e]
|
|
4221
|
-
), l =
|
|
4262
|
+
), l = V(() => s(!1), []);
|
|
4222
4263
|
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
|
|
4223
|
-
},
|
|
4264
|
+
}, Vr = (e, t, s, a) => ({
|
|
4224
4265
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
4225
4266
|
content: /* @__PURE__ */ n(
|
|
4226
4267
|
"img",
|
|
@@ -4235,16 +4276,16 @@ const zr = ({
|
|
|
4235
4276
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4236
4277
|
}
|
|
4237
4278
|
)
|
|
4238
|
-
}),
|
|
4279
|
+
}), Gr = ({
|
|
4239
4280
|
src: e,
|
|
4240
4281
|
alt: t,
|
|
4241
4282
|
items: s
|
|
4242
|
-
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [],
|
|
4283
|
+
}) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], yn = (e, t) => e.map((s, a) => ({
|
|
4243
4284
|
src: s.src,
|
|
4244
4285
|
alt: s.alt,
|
|
4245
4286
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4246
|
-
})),
|
|
4247
|
-
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: h } =
|
|
4287
|
+
})), Hr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
4288
|
+
const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: h } = Ce(
|
|
4248
4289
|
r
|
|
4249
4290
|
);
|
|
4250
4291
|
return /* @__PURE__ */ m("div", { className: "relative w-fit", children: [
|
|
@@ -4268,18 +4309,18 @@ const zr = ({
|
|
|
4268
4309
|
)
|
|
4269
4310
|
}
|
|
4270
4311
|
),
|
|
4271
|
-
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4312
|
+
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(ye, { onClick: i }) }) : null,
|
|
4272
4313
|
/* @__PURE__ */ n(
|
|
4273
|
-
|
|
4314
|
+
wn,
|
|
4274
4315
|
{
|
|
4275
4316
|
open: l,
|
|
4276
|
-
items:
|
|
4317
|
+
items: yn([{ src: e, alt: t }], s),
|
|
4277
4318
|
initialIndex: o,
|
|
4278
4319
|
onClose: h
|
|
4279
4320
|
}
|
|
4280
4321
|
)
|
|
4281
4322
|
] });
|
|
4282
|
-
},
|
|
4323
|
+
}, _n = ({
|
|
4283
4324
|
state: e,
|
|
4284
4325
|
src: t,
|
|
4285
4326
|
alt: s,
|
|
@@ -4290,28 +4331,28 @@ const zr = ({
|
|
|
4290
4331
|
loading: o = "lazy",
|
|
4291
4332
|
onClick: d
|
|
4292
4333
|
}) => {
|
|
4293
|
-
const h =
|
|
4334
|
+
const h = Gr({ src: t, alt: s, items: r }), g = _e(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = Ce(
|
|
4294
4335
|
d
|
|
4295
4336
|
);
|
|
4296
4337
|
if (h.length === 0)
|
|
4297
4338
|
return null;
|
|
4298
4339
|
const x = h.map(
|
|
4299
|
-
(v, N) =>
|
|
4340
|
+
(v, N) => Vr(v, N, h.length, o)
|
|
4300
4341
|
);
|
|
4301
4342
|
return /* @__PURE__ */ m(
|
|
4302
|
-
|
|
4343
|
+
Ne,
|
|
4303
4344
|
{
|
|
4304
4345
|
variant: g,
|
|
4305
4346
|
text: i,
|
|
4306
4347
|
groupPosition: l,
|
|
4307
4348
|
"data-testid": "image-attachment",
|
|
4308
4349
|
children: [
|
|
4309
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4350
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(Nn, { tiles: x, onTileActivate: c }) }),
|
|
4310
4351
|
/* @__PURE__ */ n(
|
|
4311
|
-
|
|
4352
|
+
wn,
|
|
4312
4353
|
{
|
|
4313
4354
|
open: u,
|
|
4314
|
-
items:
|
|
4355
|
+
items: yn(h, a),
|
|
4315
4356
|
initialIndex: f,
|
|
4316
4357
|
onClose: b
|
|
4317
4358
|
}
|
|
@@ -4319,11 +4360,11 @@ const zr = ({
|
|
|
4319
4360
|
]
|
|
4320
4361
|
}
|
|
4321
4362
|
);
|
|
4322
|
-
},
|
|
4323
|
-
Composer:
|
|
4363
|
+
}, Yr = (e) => /* @__PURE__ */ n(Hr, { ...e }), qr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "sent" }), Wr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "received" }), Xr = {
|
|
4364
|
+
Composer: Yr,
|
|
4324
4365
|
Sent: qr,
|
|
4325
|
-
Received:
|
|
4326
|
-
},
|
|
4366
|
+
Received: Wr
|
|
4367
|
+
}, Zr = ({
|
|
4327
4368
|
open: e,
|
|
4328
4369
|
items: t,
|
|
4329
4370
|
initialIndex: s = 0,
|
|
@@ -4337,7 +4378,7 @@ const zr = ({
|
|
|
4337
4378
|
() => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "document"),
|
|
4338
4379
|
[o]
|
|
4339
4380
|
), h = re(
|
|
4340
|
-
() => o ?
|
|
4381
|
+
() => o ? Kr(o.src) : void 0,
|
|
4341
4382
|
[o]
|
|
4342
4383
|
);
|
|
4343
4384
|
return !o || !h ? null : /* @__PURE__ */ m(
|
|
@@ -4371,16 +4412,16 @@ const zr = ({
|
|
|
4371
4412
|
]
|
|
4372
4413
|
}
|
|
4373
4414
|
);
|
|
4374
|
-
},
|
|
4415
|
+
}, Kr = (e) => {
|
|
4375
4416
|
const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
|
|
4376
4417
|
return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
|
|
4377
|
-
},
|
|
4418
|
+
}, Jr = ({
|
|
4378
4419
|
src: e,
|
|
4379
4420
|
filename: t,
|
|
4380
4421
|
fileSize: s,
|
|
4381
4422
|
title: a,
|
|
4382
4423
|
items: r
|
|
4383
|
-
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [],
|
|
4424
|
+
}) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], Qr = ({
|
|
4384
4425
|
variant: e,
|
|
4385
4426
|
item: t,
|
|
4386
4427
|
index: s,
|
|
@@ -4389,7 +4430,7 @@ const zr = ({
|
|
|
4389
4430
|
}) => {
|
|
4390
4431
|
const i = t.filename ?? ne(t.src);
|
|
4391
4432
|
return /* @__PURE__ */ n(
|
|
4392
|
-
|
|
4433
|
+
pn,
|
|
4393
4434
|
{
|
|
4394
4435
|
variant: e,
|
|
4395
4436
|
filename: i,
|
|
@@ -4413,7 +4454,7 @@ const zr = ({
|
|
|
4413
4454
|
onClick: d,
|
|
4414
4455
|
onDismiss: h
|
|
4415
4456
|
}) => {
|
|
4416
|
-
const g =
|
|
4457
|
+
const g = _e(e), u = Jr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: x } = Ce(
|
|
4417
4458
|
d
|
|
4418
4459
|
), v = e === "composer" && !!h;
|
|
4419
4460
|
if (u.length === 0)
|
|
@@ -4423,38 +4464,38 @@ const zr = ({
|
|
|
4423
4464
|
filename: w.filename ?? ne(w.src)
|
|
4424
4465
|
}));
|
|
4425
4466
|
return /* @__PURE__ */ m(
|
|
4426
|
-
|
|
4467
|
+
Ne,
|
|
4427
4468
|
{
|
|
4428
4469
|
variant: g,
|
|
4429
4470
|
text: l,
|
|
4430
4471
|
groupPosition: o,
|
|
4431
4472
|
"data-testid": "pdf-attachment",
|
|
4432
4473
|
children: [
|
|
4433
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((w,
|
|
4434
|
-
const
|
|
4435
|
-
|
|
4474
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((w, I) => {
|
|
4475
|
+
const S = w.filename ?? ne(w.src), T = v && I === 0 ? /* @__PURE__ */ n(ye, { onClick: h, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
4476
|
+
xn,
|
|
4436
4477
|
{
|
|
4437
4478
|
url: w.src,
|
|
4438
|
-
filename:
|
|
4479
|
+
filename: S,
|
|
4439
4480
|
variant: "inline",
|
|
4440
|
-
label: `Download ${
|
|
4481
|
+
label: `Download ${S}`,
|
|
4441
4482
|
tone: g
|
|
4442
4483
|
}
|
|
4443
4484
|
);
|
|
4444
4485
|
return /* @__PURE__ */ n(
|
|
4445
|
-
|
|
4486
|
+
Qr,
|
|
4446
4487
|
{
|
|
4447
4488
|
variant: g,
|
|
4448
4489
|
item: w,
|
|
4449
|
-
index:
|
|
4490
|
+
index: I,
|
|
4450
4491
|
onActivate: b,
|
|
4451
|
-
trailingAction:
|
|
4492
|
+
trailingAction: T
|
|
4452
4493
|
},
|
|
4453
|
-
`${w.src}-${
|
|
4494
|
+
`${w.src}-${I}`
|
|
4454
4495
|
);
|
|
4455
4496
|
}) }),
|
|
4456
4497
|
/* @__PURE__ */ n(
|
|
4457
|
-
|
|
4498
|
+
Zr,
|
|
4458
4499
|
{
|
|
4459
4500
|
open: f,
|
|
4460
4501
|
items: N,
|
|
@@ -4465,11 +4506,11 @@ const zr = ({
|
|
|
4465
4506
|
]
|
|
4466
4507
|
}
|
|
4467
4508
|
);
|
|
4468
|
-
},
|
|
4469
|
-
Composer:
|
|
4470
|
-
Sent:
|
|
4471
|
-
Received:
|
|
4472
|
-
},
|
|
4509
|
+
}, ei = (e) => /* @__PURE__ */ n(gt, { ...e, state: "composer" }), ti = (e) => /* @__PURE__ */ n(gt, { ...e, state: "sent" }), ni = (e) => /* @__PURE__ */ n(gt, { ...e, state: "received" }), si = {
|
|
4510
|
+
Composer: ei,
|
|
4511
|
+
Sent: ti,
|
|
4512
|
+
Received: ni
|
|
4513
|
+
}, Cn = ({
|
|
4473
4514
|
open: e,
|
|
4474
4515
|
items: t,
|
|
4475
4516
|
initialIndex: s = 0,
|
|
@@ -4519,7 +4560,7 @@ const zr = ({
|
|
|
4519
4560
|
]
|
|
4520
4561
|
}
|
|
4521
4562
|
) : null;
|
|
4522
|
-
},
|
|
4563
|
+
}, ai = () => /* @__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(He, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), kn = ({
|
|
4523
4564
|
item: e,
|
|
4524
4565
|
index: t
|
|
4525
4566
|
}) => /* @__PURE__ */ m("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
@@ -4534,31 +4575,31 @@ const zr = ({
|
|
|
4534
4575
|
className: "absolute inset-0 size-full rounded-md object-cover"
|
|
4535
4576
|
}
|
|
4536
4577
|
) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
4537
|
-
|
|
4578
|
+
qt,
|
|
4538
4579
|
{
|
|
4539
4580
|
className: "size-16 rounded-md text-white/30",
|
|
4540
4581
|
weight: "regular",
|
|
4541
4582
|
"aria-hidden": !0
|
|
4542
4583
|
}
|
|
4543
4584
|
) }),
|
|
4544
|
-
/* @__PURE__ */ n(
|
|
4545
|
-
] }),
|
|
4585
|
+
/* @__PURE__ */ n(ai, {})
|
|
4586
|
+
] }), ri = (e, t, s) => ({
|
|
4546
4587
|
ariaLabel: `Play video ${t + 1} of ${s}`,
|
|
4547
|
-
content: /* @__PURE__ */ n(
|
|
4548
|
-
}),
|
|
4588
|
+
content: /* @__PURE__ */ n(kn, { item: e, index: t })
|
|
4589
|
+
}), ii = ({
|
|
4549
4590
|
src: e,
|
|
4550
4591
|
poster: t,
|
|
4551
4592
|
mimeType: s,
|
|
4552
4593
|
preload: a,
|
|
4553
4594
|
items: r
|
|
4554
|
-
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [],
|
|
4595
|
+
}) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], En = (e, t) => e.map((s, a) => ({
|
|
4555
4596
|
src: s.src,
|
|
4556
4597
|
poster: s.poster,
|
|
4557
4598
|
mimeType: s.mimeType,
|
|
4558
4599
|
preload: s.preload,
|
|
4559
4600
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
4560
|
-
})),
|
|
4561
|
-
const { viewerOpen: o, viewerIndex: d, handleActivate: h, closeViewer: g } =
|
|
4601
|
+
})), oi = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: l }) => {
|
|
4602
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: h, closeViewer: g } = Ce(
|
|
4562
4603
|
i
|
|
4563
4604
|
);
|
|
4564
4605
|
return /* @__PURE__ */ m("div", { className: "relative w-fit", children: [
|
|
@@ -4569,15 +4610,15 @@ const zr = ({
|
|
|
4569
4610
|
onClick: () => h(0),
|
|
4570
4611
|
"aria-label": "Play video",
|
|
4571
4612
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
4572
|
-
children: /* @__PURE__ */ n(
|
|
4613
|
+
children: /* @__PURE__ */ n(kn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
4573
4614
|
}
|
|
4574
4615
|
),
|
|
4575
|
-
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(
|
|
4616
|
+
l ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(ye, { onClick: l }) }) : null,
|
|
4576
4617
|
/* @__PURE__ */ n(
|
|
4577
|
-
|
|
4618
|
+
Cn,
|
|
4578
4619
|
{
|
|
4579
4620
|
open: o,
|
|
4580
|
-
items:
|
|
4621
|
+
items: En(
|
|
4581
4622
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
4582
4623
|
a
|
|
4583
4624
|
),
|
|
@@ -4586,7 +4627,7 @@ const zr = ({
|
|
|
4586
4627
|
}
|
|
4587
4628
|
)
|
|
4588
4629
|
] });
|
|
4589
|
-
},
|
|
4630
|
+
}, In = ({
|
|
4590
4631
|
state: e,
|
|
4591
4632
|
src: t,
|
|
4592
4633
|
poster: s,
|
|
@@ -4598,16 +4639,16 @@ const zr = ({
|
|
|
4598
4639
|
preload: d,
|
|
4599
4640
|
onClick: h
|
|
4600
4641
|
}) => {
|
|
4601
|
-
const g =
|
|
4642
|
+
const g = ii({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = _e(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: x } = Ce(
|
|
4602
4643
|
h
|
|
4603
4644
|
);
|
|
4604
4645
|
if (g.length === 0)
|
|
4605
4646
|
return null;
|
|
4606
4647
|
const v = g.map(
|
|
4607
|
-
(N, w) =>
|
|
4648
|
+
(N, w) => ri(N, w, g.length)
|
|
4608
4649
|
);
|
|
4609
4650
|
return /* @__PURE__ */ m(
|
|
4610
|
-
|
|
4651
|
+
Ne,
|
|
4611
4652
|
{
|
|
4612
4653
|
variant: u,
|
|
4613
4654
|
text: l,
|
|
@@ -4615,7 +4656,7 @@ const zr = ({
|
|
|
4615
4656
|
"data-testid": "video-attachment",
|
|
4616
4657
|
children: [
|
|
4617
4658
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
4618
|
-
|
|
4659
|
+
Nn,
|
|
4619
4660
|
{
|
|
4620
4661
|
tiles: v,
|
|
4621
4662
|
onTileActivate: b,
|
|
@@ -4623,10 +4664,10 @@ const zr = ({
|
|
|
4623
4664
|
}
|
|
4624
4665
|
) }),
|
|
4625
4666
|
/* @__PURE__ */ n(
|
|
4626
|
-
|
|
4667
|
+
Cn,
|
|
4627
4668
|
{
|
|
4628
4669
|
open: f,
|
|
4629
|
-
items:
|
|
4670
|
+
items: En(g, r),
|
|
4630
4671
|
initialIndex: c,
|
|
4631
4672
|
onClose: x
|
|
4632
4673
|
}
|
|
@@ -4634,17 +4675,17 @@ const zr = ({
|
|
|
4634
4675
|
]
|
|
4635
4676
|
}
|
|
4636
4677
|
);
|
|
4637
|
-
},
|
|
4638
|
-
Composer:
|
|
4639
|
-
Sent:
|
|
4640
|
-
Received:
|
|
4641
|
-
},
|
|
4642
|
-
Image:
|
|
4643
|
-
Video:
|
|
4644
|
-
Audio:
|
|
4645
|
-
Pdf:
|
|
4646
|
-
File:
|
|
4647
|
-
},
|
|
4678
|
+
}, li = (e) => /* @__PURE__ */ n(oi, { ...e }), ci = (e) => /* @__PURE__ */ n(In, { ...e, state: "sent" }), di = (e) => /* @__PURE__ */ n(In, { ...e, state: "received" }), ui = {
|
|
4679
|
+
Composer: li,
|
|
4680
|
+
Sent: ci,
|
|
4681
|
+
Received: di
|
|
4682
|
+
}, Ii = {
|
|
4683
|
+
Image: Xr,
|
|
4684
|
+
Video: ui,
|
|
4685
|
+
Audio: Sr,
|
|
4686
|
+
Pdf: si,
|
|
4687
|
+
File: jr
|
|
4688
|
+
}, mi = ({
|
|
4648
4689
|
question: e,
|
|
4649
4690
|
onClick: t,
|
|
4650
4691
|
loading: s = !1,
|
|
@@ -4666,7 +4707,7 @@ const zr = ({
|
|
|
4666
4707
|
),
|
|
4667
4708
|
children: e
|
|
4668
4709
|
}
|
|
4669
|
-
),
|
|
4710
|
+
), Si = ({
|
|
4670
4711
|
faqs: e,
|
|
4671
4712
|
onFaqClick: t,
|
|
4672
4713
|
loadingFaqId: s,
|
|
@@ -4695,7 +4736,7 @@ const zr = ({
|
|
|
4695
4736
|
children: [
|
|
4696
4737
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4697
4738
|
o.map((d) => /* @__PURE__ */ n(
|
|
4698
|
-
|
|
4739
|
+
mi,
|
|
4699
4740
|
{
|
|
4700
4741
|
question: d.question,
|
|
4701
4742
|
onClick: () => t(d.id),
|
|
@@ -4709,38 +4750,38 @@ const zr = ({
|
|
|
4709
4750
|
] }) });
|
|
4710
4751
|
};
|
|
4711
4752
|
export {
|
|
4712
|
-
|
|
4753
|
+
rn as A,
|
|
4713
4754
|
na as B,
|
|
4714
|
-
|
|
4755
|
+
er as C,
|
|
4715
4756
|
Ls as D,
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4757
|
+
Si as F,
|
|
4758
|
+
ki as L,
|
|
4759
|
+
yi as M,
|
|
4760
|
+
Te as a,
|
|
4720
4761
|
oe as b,
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4762
|
+
tn as c,
|
|
4763
|
+
fn as d,
|
|
4764
|
+
_i as e,
|
|
4765
|
+
mi as f,
|
|
4725
4766
|
le as g,
|
|
4726
4767
|
Bt as h,
|
|
4727
|
-
|
|
4768
|
+
Ii as i,
|
|
4728
4769
|
Ta as j,
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
|
|
4770
|
+
Ni as k,
|
|
4771
|
+
Ci as l,
|
|
4772
|
+
Dr as m,
|
|
4773
|
+
Tr as n,
|
|
4733
4774
|
Bs as o,
|
|
4734
|
-
|
|
4735
|
-
|
|
4775
|
+
Mr as p,
|
|
4776
|
+
Jt as q,
|
|
4736
4777
|
ge as r,
|
|
4737
|
-
|
|
4778
|
+
cn as s,
|
|
4738
4779
|
Us as t,
|
|
4739
|
-
|
|
4780
|
+
Ei as u,
|
|
4740
4781
|
$s as v,
|
|
4741
4782
|
rt as w,
|
|
4742
4783
|
it as x,
|
|
4743
4784
|
tt as y,
|
|
4744
4785
|
Sa as z
|
|
4745
4786
|
};
|
|
4746
|
-
//# sourceMappingURL=index-
|
|
4787
|
+
//# sourceMappingURL=index-CPa6Qru7.js.map
|