@linktr.ee/messaging-react 3.6.1 → 3.7.0-rc-1783304153
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-CxS7GNqp.js → Card-BAt0xifq.js} +2 -2
- package/dist/{Card-CxS7GNqp.js.map → Card-BAt0xifq.js.map} +1 -1
- package/dist/{Card-B0lzpuYf.js → Card-BB34_MDl.js} +3 -3
- package/dist/{Card-B0lzpuYf.js.map → Card-BB34_MDl.js.map} +1 -1
- package/dist/{Card-DcUPqd79.cjs → Card-BDKGSydN.cjs} +2 -2
- package/dist/{Card-DcUPqd79.cjs.map → Card-BDKGSydN.cjs.map} +1 -1
- package/dist/{Card-BuR6mbUu.cjs → Card-BGJY5HWf.cjs} +2 -2
- package/dist/{Card-BuR6mbUu.cjs.map → Card-BGJY5HWf.cjs.map} +1 -1
- package/dist/{Card-BrC7mKtr.js → Card-C3-Ea5ho.js} +2 -2
- package/dist/{Card-BrC7mKtr.js.map → Card-C3-Ea5ho.js.map} +1 -1
- package/dist/{Card-d0_xEfdM.cjs → Card-DnFtpG1h.cjs} +2 -2
- package/dist/{Card-d0_xEfdM.cjs.map → Card-DnFtpG1h.cjs.map} +1 -1
- package/dist/{LockedThumbnail-BDtKMJjz.cjs → LockedThumbnail-Bl9UC9sQ.cjs} +2 -2
- package/dist/{LockedThumbnail-BDtKMJjz.cjs.map → LockedThumbnail-Bl9UC9sQ.cjs.map} +1 -1
- package/dist/{LockedThumbnail-BaDgF8qJ.js → LockedThumbnail-so7ftBnG.js} +2 -2
- package/dist/{LockedThumbnail-BaDgF8qJ.js.map → LockedThumbnail-so7ftBnG.js.map} +1 -1
- package/dist/{index-BPfehHDD.js → index-2HMjfjM-.js} +1013 -1006
- package/dist/index-2HMjfjM-.js.map +1 -0
- package/dist/index-BgzqZorr.cjs +2 -0
- package/dist/index-BgzqZorr.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +14 -2
- package/dist/index.js +1 -1
- package/dist/testing.cjs +2 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.ts +116 -0
- package/dist/testing.js +107 -0
- package/dist/testing.js.map +1 -0
- package/package.json +7 -2
- package/src/providers/MessagingProvider.test.tsx +30 -0
- package/src/providers/MessagingProvider.tsx +24 -5
- package/src/testing/createMockMessagingClient.stories.tsx +77 -0
- package/src/testing/createMockMessagingClient.ts +231 -0
- package/src/testing/index.ts +7 -0
- package/src/types.ts +15 -2
- package/dist/index-BPfehHDD.js.map +0 -1
- package/dist/index-G4pnfm4m.cjs +0 -2
- package/dist/index-G4pnfm4m.cjs.map +0 -1
- /package/dist/assets/{index.css → messaging-react.css} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as m, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import V, { createContext as et, useContext as Ce, useCallback as K, useState as $, useRef as Y, useEffect as W, useId as Vn, useMemo as se, Suspense as tt } from "react";
|
|
3
3
|
import { StreamChatService as Gn } from "@linktr.ee/messaging-core";
|
|
4
4
|
import { StreamChat as Hn, LinkPreviewsManager as Bt } from "stream-chat";
|
|
5
|
-
import { Chat as Yn, DateSeparator as qn, useChannelStateContext as pe, useChatContext as be, areMessageUIPropsEqual as Wn, useMessageReminder as Xn, useComponentContext as nn, Attachment as Kn, EditMessageModal as Jn, MessageBlocked as Zn, MessageBouncePrompt as Qn, MessageDeleted as es, MessageIsThreadReplyInChannelButtonIndicator as ts, MessageRepliesCountButton as ns, ReminderNotification as ss, StreamedMessageText as as, messageHasAttachments as rs, messageHasReactions as is, isDateSeparatorMessage as os, isMessageBlocked as ls, isMessageBounced as cs, MessageBounceModal as ds, MessageText as jt, MessageErrorIcon as Ut, Poll as us, useMessageContext as Ee, useMessageComposer as ms, useStateStore as hs, MessageInput as fs, useMessageInputContext as gs, useMessageComposerHasSendableData as ps, AttachmentPreviewList as bs, QuotedMessagePreview as vs, TextareaComposer as xs, MessageTimestamp as Ge, AIStates as He, useTypingContext as ws, useAIState as _s, Channel as Ns, WithComponents as ys, Window as
|
|
6
|
-
import { StarIcon as Ke, DotsThreeIcon as Is, SpinnerGapIcon as De, SignOutIcon as Ts, ProhibitInsetIcon as Vt, FlagIcon as sn, FileIcon as an, ImageIcon as As, SpeakerHighIcon as Ms, VideoCameraIcon as rn, FileMdIcon as Rs, FileTextIcon as Ls, FileZipIcon as Ds, FilePptIcon as Ps, FileCsvIcon as zs, FileXlsIcon as Os, FileDocIcon as Fs, FilePdfIcon as $s, CircleNotchIcon as ye, PlayIcon as Je, PauseIcon as Bs, LinkIcon as js, DownloadSimpleIcon as
|
|
7
|
-
import
|
|
5
|
+
import { Chat as Yn, DateSeparator as qn, useChannelStateContext as pe, useChatContext as be, areMessageUIPropsEqual as Wn, useMessageReminder as Xn, useComponentContext as nn, Attachment as Kn, EditMessageModal as Jn, MessageBlocked as Zn, MessageBouncePrompt as Qn, MessageDeleted as es, MessageIsThreadReplyInChannelButtonIndicator as ts, MessageRepliesCountButton as ns, ReminderNotification as ss, StreamedMessageText as as, messageHasAttachments as rs, messageHasReactions as is, isDateSeparatorMessage as os, isMessageBlocked as ls, isMessageBounced as cs, MessageBounceModal as ds, MessageText as jt, MessageErrorIcon as Ut, Poll as us, useMessageContext as Ee, useMessageComposer as ms, useStateStore as hs, MessageInput as fs, useMessageInputContext as gs, useMessageComposerHasSendableData as ps, AttachmentPreviewList as bs, QuotedMessagePreview as vs, TextareaComposer as xs, MessageTimestamp as Ge, AIStates as He, useTypingContext as ws, useAIState as _s, Channel as Ns, WithComponents as ys, Window as ks, MessageList as Cs, ChannelList as Es, InfiniteScroll as Ss } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ke, DotsThreeIcon as Is, SpinnerGapIcon as De, SignOutIcon as Ts, ProhibitInsetIcon as Vt, FlagIcon as sn, FileIcon as an, ImageIcon as As, SpeakerHighIcon as Ms, VideoCameraIcon as rn, FileMdIcon as Rs, FileTextIcon as Ls, FileZipIcon as Ds, FilePptIcon as Ps, FileCsvIcon as zs, FileXlsIcon as Os, FileDocIcon as Fs, FilePdfIcon as $s, CircleNotchIcon as ye, PlayIcon as Je, PauseIcon as Bs, LinkIcon as js, DownloadSimpleIcon as ke, XIcon as Be, CaretLeftIcon as Us, CaretRightIcon as we, GiftIcon as Vs, ThumbsUpIcon as Gs, ThumbsDownIcon as Hs, PencilSimpleIcon as Ys, TrashSimpleIcon as qs, ArrowUpIcon as Ws, SparkleIcon as _e, ProhibitIcon as Xs, ArrowLeftIcon as Gt } from "@phosphor-icons/react";
|
|
7
|
+
import y from "classnames";
|
|
8
8
|
import { MessageActions as Ks, DefaultDropdownActionButton as on } from "stream-chat-react/experimental";
|
|
9
9
|
const ln = et({
|
|
10
10
|
service: null,
|
|
@@ -16,18 +16,19 @@ const ln = et({
|
|
|
16
16
|
refreshConnection: async () => {
|
|
17
17
|
},
|
|
18
18
|
debug: !1
|
|
19
|
-
}), nt = () =>
|
|
19
|
+
}), nt = () => Ce(ln), Zi = ({
|
|
20
20
|
children: e,
|
|
21
21
|
user: t,
|
|
22
22
|
serviceConfig: s,
|
|
23
23
|
apiKey: a,
|
|
24
24
|
capabilities: r = {},
|
|
25
|
-
debug: i = !1
|
|
25
|
+
debug: i = !1,
|
|
26
|
+
client: c
|
|
26
27
|
}) => {
|
|
27
|
-
var
|
|
28
|
-
const o =
|
|
29
|
-
(
|
|
30
|
-
i && console.log(`🔥 [MessagingProvider] ${
|
|
28
|
+
var C, M;
|
|
29
|
+
const o = K(
|
|
30
|
+
(E, ...R) => {
|
|
31
|
+
i && console.log(`🔥 [MessagingProvider] ${E}`, ...R);
|
|
31
32
|
},
|
|
32
33
|
[i]
|
|
33
34
|
);
|
|
@@ -37,77 +38,79 @@ const ln = et({
|
|
|
37
38
|
serviceConfig: !!s,
|
|
38
39
|
capabilities: Object.keys(r)
|
|
39
40
|
});
|
|
40
|
-
const [
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
const
|
|
41
|
+
const [d, u] = $(null), [g, h] = $(null), [f, l] = $(!1), [v, w] = $(!1), [b, p] = $(null), _ = Y(!1), N = Y(null), I = Y(s);
|
|
42
|
+
I.current = s;
|
|
43
|
+
const L = Y(i);
|
|
44
|
+
L.current = i;
|
|
45
|
+
const A = Y({
|
|
45
46
|
userId: t == null ? void 0 : t.id,
|
|
46
47
|
apiKey: a,
|
|
47
48
|
serviceConfig: s,
|
|
48
49
|
capabilities: r
|
|
49
|
-
}),
|
|
50
|
-
|
|
51
|
-
renderCount:
|
|
50
|
+
}), D = Y(0);
|
|
51
|
+
D.current++, o("📊 RENDER INFO", {
|
|
52
|
+
renderCount: D.current,
|
|
52
53
|
currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
|
|
53
54
|
propChanges: {
|
|
54
|
-
userChanged:
|
|
55
|
-
apiKeyChanged:
|
|
56
|
-
serviceConfigChanged:
|
|
57
|
-
capabilitiesChanged:
|
|
55
|
+
userChanged: A.current.userId !== (t == null ? void 0 : t.id),
|
|
56
|
+
apiKeyChanged: A.current.apiKey !== a,
|
|
57
|
+
serviceConfigChanged: A.current.serviceConfig !== s,
|
|
58
|
+
capabilitiesChanged: A.current.capabilities !== r
|
|
58
59
|
}
|
|
59
|
-
}),
|
|
60
|
+
}), A.current = {
|
|
60
61
|
userId: t == null ? void 0 : t.id,
|
|
61
62
|
apiKey: a,
|
|
62
63
|
serviceConfig: s,
|
|
63
64
|
capabilities: r
|
|
64
65
|
};
|
|
65
|
-
const
|
|
66
|
-
a && ((
|
|
67
|
-
const
|
|
66
|
+
const B = Y(null);
|
|
67
|
+
!c && a && ((C = B.current) == null ? void 0 : C.apiKey) !== a && (B.current = { apiKey: a, client: new Hn(a) });
|
|
68
|
+
const j = c || (a ? ((M = B.current) == null ? void 0 : M.client) ?? null : null);
|
|
68
69
|
W(() => {
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
70
|
+
const E = D.current, R = I.current;
|
|
71
|
+
if (c)
|
|
72
|
+
return;
|
|
73
|
+
if (!a || !j || !R) {
|
|
71
74
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
75
|
+
renderCount: E,
|
|
73
76
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
74
77
|
});
|
|
75
78
|
return;
|
|
76
79
|
}
|
|
77
80
|
o("🚀 CREATING SERVICE", {
|
|
78
|
-
renderCount:
|
|
81
|
+
renderCount: E,
|
|
79
82
|
apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
|
|
80
83
|
});
|
|
81
|
-
const
|
|
82
|
-
...
|
|
84
|
+
const O = new Gn({
|
|
85
|
+
...R,
|
|
83
86
|
apiKey: a,
|
|
84
|
-
debug:
|
|
85
|
-
client:
|
|
87
|
+
debug: L.current,
|
|
88
|
+
client: j
|
|
86
89
|
});
|
|
87
|
-
|
|
88
|
-
renderCount:
|
|
89
|
-
serviceInstance: !!
|
|
90
|
+
N.current = O, u(O), o("✅ SERVICE SET", {
|
|
91
|
+
renderCount: E,
|
|
92
|
+
serviceInstance: !!O
|
|
90
93
|
});
|
|
91
|
-
}, [a,
|
|
92
|
-
const
|
|
94
|
+
}, [a, j, c]);
|
|
95
|
+
const z = Y(null);
|
|
93
96
|
W(() => {
|
|
94
|
-
var
|
|
97
|
+
var R, O;
|
|
95
98
|
if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
96
|
-
hasService: !!
|
|
99
|
+
hasService: !!d,
|
|
97
100
|
hasUser: !!t,
|
|
98
101
|
userId: t == null ? void 0 : t.id,
|
|
99
|
-
isConnecting:
|
|
100
|
-
isConnected:
|
|
101
|
-
dependencies: { service: !!
|
|
102
|
-
}), !
|
|
102
|
+
isConnecting: _.current,
|
|
103
|
+
isConnected: f,
|
|
104
|
+
dependencies: { service: !!d, userId: t == null ? void 0 : t.id }
|
|
105
|
+
}), !d || !t) {
|
|
103
106
|
o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
104
107
|
return;
|
|
105
108
|
}
|
|
106
|
-
if (
|
|
109
|
+
if (_.current) {
|
|
107
110
|
o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
108
111
|
return;
|
|
109
112
|
}
|
|
110
|
-
if (((
|
|
113
|
+
if (((R = z.current) == null ? void 0 : R.serviceId) === d && ((O = z.current) == null ? void 0 : O.userId) === t.id) {
|
|
111
114
|
o(
|
|
112
115
|
"⚠️ USER CONNECTION SKIPPED",
|
|
113
116
|
"Already connected this user with this service"
|
|
@@ -115,91 +118,95 @@ const ln = et({
|
|
|
115
118
|
return;
|
|
116
119
|
}
|
|
117
120
|
(async () => {
|
|
118
|
-
o("🚀 STARTING USER CONNECTION", { userId: t.id }),
|
|
121
|
+
o("🚀 STARTING USER CONNECTION", { userId: t.id }), _.current = !0, w(!0), p(null);
|
|
119
122
|
try {
|
|
120
123
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
121
|
-
const
|
|
122
|
-
|
|
124
|
+
const U = await d.connectUser(t);
|
|
125
|
+
h(U), l(!0), z.current = { serviceId: d, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
123
126
|
userId: t.id,
|
|
124
|
-
clientId:
|
|
127
|
+
clientId: U.userID
|
|
125
128
|
});
|
|
126
|
-
} catch (
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
+
} catch (U) {
|
|
130
|
+
const X = U instanceof Error ? U.message : "Connection failed";
|
|
131
|
+
p(X), o("❌ USER CONNECTION ERROR", {
|
|
129
132
|
userId: t.id,
|
|
130
|
-
error:
|
|
133
|
+
error: X
|
|
131
134
|
});
|
|
132
135
|
} finally {
|
|
133
|
-
|
|
136
|
+
w(!1), _.current = !1, o("🔄 USER CONNECTION FINISHED", {
|
|
134
137
|
userId: t.id,
|
|
135
|
-
isConnected:
|
|
138
|
+
isConnected: f
|
|
136
139
|
});
|
|
137
140
|
}
|
|
138
141
|
})();
|
|
139
|
-
}, [
|
|
140
|
-
const
|
|
142
|
+
}, [d, t, o, f]), W(() => {
|
|
143
|
+
const E = j;
|
|
141
144
|
return () => {
|
|
142
|
-
var
|
|
143
|
-
|
|
145
|
+
var R;
|
|
146
|
+
E && (z.current = null, (R = N.current) == null || R.disconnectUser().catch(console.error));
|
|
144
147
|
};
|
|
145
|
-
}, [
|
|
146
|
-
const
|
|
148
|
+
}, [j]);
|
|
149
|
+
const k = K(async () => {
|
|
147
150
|
if (o("🔄 REFRESH CONNECTION CALLED", {
|
|
148
|
-
hasService: !!
|
|
151
|
+
hasService: !!d,
|
|
149
152
|
hasUser: !!t
|
|
150
|
-
}), !
|
|
153
|
+
}), !d || !t) {
|
|
151
154
|
o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
152
155
|
return;
|
|
153
156
|
}
|
|
154
|
-
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }),
|
|
157
|
+
o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), w(!0);
|
|
155
158
|
try {
|
|
156
|
-
o("🔌 DISCONNECTING FOR REFRESH"), await
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
} catch (
|
|
160
|
-
const
|
|
161
|
-
|
|
159
|
+
o("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
160
|
+
const E = await d.connectUser(t);
|
|
161
|
+
h(E), l(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
162
|
+
} catch (E) {
|
|
163
|
+
const R = E instanceof Error ? E.message : "Refresh failed";
|
|
164
|
+
p(R), o("❌ CONNECTION REFRESH ERROR", {
|
|
162
165
|
userId: t.id,
|
|
163
|
-
error:
|
|
166
|
+
error: R
|
|
164
167
|
});
|
|
165
168
|
} finally {
|
|
166
|
-
|
|
169
|
+
w(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
167
170
|
}
|
|
168
|
-
}, [
|
|
169
|
-
hasService: !!
|
|
170
|
-
hasClient: !!
|
|
171
|
-
isConnected:
|
|
172
|
-
isLoading:
|
|
173
|
-
hasError: !!
|
|
171
|
+
}, [d, t, o]), T = V.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
172
|
+
hasService: !!d,
|
|
173
|
+
hasClient: !!g,
|
|
174
|
+
isConnected: f,
|
|
175
|
+
isLoading: v,
|
|
176
|
+
hasError: !!b,
|
|
174
177
|
capabilitiesKeys: Object.keys(r)
|
|
175
178
|
}), {
|
|
176
|
-
service:
|
|
177
|
-
client
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
service: d,
|
|
180
|
+
// An injected client is already connected and owns its lifecycle, so
|
|
181
|
+
// surface it directly and report connected — the apiKey path's `client`
|
|
182
|
+
// state (set by connectUser) is never populated in that mode.
|
|
183
|
+
client: c ?? g,
|
|
184
|
+
isConnected: c ? !0 : f,
|
|
185
|
+
isLoading: v,
|
|
186
|
+
error: b,
|
|
181
187
|
capabilities: r,
|
|
182
|
-
refreshConnection:
|
|
188
|
+
refreshConnection: k,
|
|
183
189
|
debug: i
|
|
184
190
|
}), [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
m,
|
|
191
|
+
d,
|
|
192
|
+
g,
|
|
188
193
|
c,
|
|
189
|
-
|
|
194
|
+
f,
|
|
195
|
+
v,
|
|
196
|
+
b,
|
|
190
197
|
r,
|
|
191
|
-
|
|
198
|
+
k,
|
|
192
199
|
i,
|
|
193
200
|
o
|
|
194
201
|
]);
|
|
195
202
|
return o("🔄 RENDER END", {
|
|
196
|
-
renderCount:
|
|
197
|
-
willRenderChat: !!
|
|
198
|
-
contextValueReady: !!
|
|
199
|
-
}), /* @__PURE__ */ n(ln.Provider, { value:
|
|
203
|
+
renderCount: D.current,
|
|
204
|
+
willRenderChat: !!j,
|
|
205
|
+
contextValueReady: !!T
|
|
206
|
+
}), /* @__PURE__ */ n(ln.Provider, { value: T, children: j ? /* @__PURE__ */ n(
|
|
200
207
|
Yn,
|
|
201
208
|
{
|
|
202
|
-
client:
|
|
209
|
+
client: j,
|
|
203
210
|
customClasses: {
|
|
204
211
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
205
212
|
},
|
|
@@ -208,20 +215,20 @@ const ln = et({
|
|
|
208
215
|
) : e });
|
|
209
216
|
}, Js = () => nt(), cn = (e) => {
|
|
210
217
|
var a, r;
|
|
211
|
-
const [t, s] =
|
|
218
|
+
const [t, s] = $(
|
|
212
219
|
!!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
|
|
213
220
|
);
|
|
214
221
|
return W(() => {
|
|
215
|
-
var
|
|
222
|
+
var c;
|
|
216
223
|
if (!e) {
|
|
217
224
|
s(!1);
|
|
218
225
|
return;
|
|
219
226
|
}
|
|
220
|
-
s(!!((
|
|
221
|
-
const i = (
|
|
227
|
+
s(!!((c = e.state.membership) != null && c.pinned_at));
|
|
228
|
+
const i = (o) => {
|
|
222
229
|
var d;
|
|
223
230
|
s(
|
|
224
|
-
|
|
231
|
+
o != null && o.member ? !!o.member.pinned_at : !!((d = e.state.membership) != null && d.pinned_at)
|
|
225
232
|
);
|
|
226
233
|
};
|
|
227
234
|
return e.on("member.updated", i), () => {
|
|
@@ -234,8 +241,8 @@ function st(e, t, s) {
|
|
|
234
241
|
if (s === Zs) {
|
|
235
242
|
const r = a.find(
|
|
236
243
|
(i) => {
|
|
237
|
-
var
|
|
238
|
-
return ((
|
|
244
|
+
var c;
|
|
245
|
+
return ((c = i.user) == null ? void 0 : c.id) === Qs;
|
|
239
246
|
}
|
|
240
247
|
);
|
|
241
248
|
if (r) return r;
|
|
@@ -310,9 +317,9 @@ const ae = ({
|
|
|
310
317
|
className: a,
|
|
311
318
|
starred: r = !1,
|
|
312
319
|
shape: i = "squircle",
|
|
313
|
-
dmAgentEnabled:
|
|
320
|
+
dmAgentEnabled: c = !1
|
|
314
321
|
}) => {
|
|
315
|
-
const
|
|
322
|
+
const o = sa(e), d = aa(e), u = 0.45, h = s < 32 ? Math.round(s * u) : s < 56 ? 14 : s < 120 ? 18 : 36, f = s >= 40 ? 2 : 1, l = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: l, children: t ? /* @__PURE__ */ n(
|
|
316
323
|
"img",
|
|
317
324
|
{
|
|
318
325
|
src: t,
|
|
@@ -323,17 +330,17 @@ const ae = ({
|
|
|
323
330
|
"div",
|
|
324
331
|
{
|
|
325
332
|
"aria-hidden": "true",
|
|
326
|
-
className:
|
|
333
|
+
className: y(
|
|
327
334
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"
|
|
328
335
|
),
|
|
329
|
-
style: { fontSize:
|
|
330
|
-
children:
|
|
336
|
+
style: { fontSize: h, lineHeight: 1 },
|
|
337
|
+
children: o
|
|
331
338
|
}
|
|
332
339
|
) });
|
|
333
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ m(
|
|
334
341
|
"div",
|
|
335
342
|
{
|
|
336
|
-
className:
|
|
343
|
+
className: y(
|
|
337
344
|
"relative flex-shrink-0",
|
|
338
345
|
a
|
|
339
346
|
),
|
|
@@ -342,7 +349,7 @@ const ae = ({
|
|
|
342
349
|
width: `${s}px`,
|
|
343
350
|
height: `${s}px`,
|
|
344
351
|
backgroundColor: t ? void 0 : d,
|
|
345
|
-
...
|
|
352
|
+
...l
|
|
346
353
|
},
|
|
347
354
|
children: [
|
|
348
355
|
r && /* @__PURE__ */ n(
|
|
@@ -357,13 +364,13 @@ const ae = ({
|
|
|
357
364
|
"div",
|
|
358
365
|
{
|
|
359
366
|
"data-testid": "avatar-ring",
|
|
360
|
-
className:
|
|
367
|
+
className: y(
|
|
361
368
|
"h-full w-full",
|
|
362
369
|
"bg-transparent"
|
|
363
370
|
),
|
|
364
371
|
style: {
|
|
365
|
-
...
|
|
366
|
-
...
|
|
372
|
+
...l,
|
|
373
|
+
...c && {
|
|
367
374
|
borderWidth: `${f}px`,
|
|
368
375
|
borderStyle: "solid",
|
|
369
376
|
borderColor: "var(--AI-Gradient, #7F22FE)",
|
|
@@ -383,79 +390,79 @@ const ae = ({
|
|
|
383
390
|
enabled: a = !0,
|
|
384
391
|
onLeaveConversation: r,
|
|
385
392
|
onBlockParticipant: i,
|
|
386
|
-
onDeleteConversationClick:
|
|
387
|
-
onBlockParticipantClick:
|
|
393
|
+
onDeleteConversationClick: c,
|
|
394
|
+
onBlockParticipantClick: o,
|
|
388
395
|
onReportParticipantClick: d,
|
|
389
396
|
onActionComplete: u,
|
|
390
397
|
logLabel: g = "useChannelModerationActions"
|
|
391
398
|
}) => {
|
|
392
|
-
var
|
|
393
|
-
const { service:
|
|
399
|
+
var T;
|
|
400
|
+
const { service: h, debug: f } = nt(), l = (T = t == null ? void 0 : t.user) == null ? void 0 : T.id, v = !!(a && s && h && l), [w, b] = $(!1), [p, _] = $(null), [N, I] = $(!1), [L, A] = $(!1), D = v && ((p == null ? void 0 : p.participantId) !== l || (p == null ? void 0 : p.service) !== h);
|
|
394
401
|
return W(() => {
|
|
395
|
-
if (!v || !
|
|
402
|
+
if (!v || !h || !l) {
|
|
396
403
|
b(!1), _(null);
|
|
397
404
|
return;
|
|
398
405
|
}
|
|
399
|
-
let
|
|
406
|
+
let C = !1;
|
|
400
407
|
return (async () => {
|
|
401
408
|
try {
|
|
402
|
-
const
|
|
403
|
-
if (
|
|
409
|
+
const M = await h.getBlockedUsers();
|
|
410
|
+
if (C) return;
|
|
404
411
|
b(
|
|
405
|
-
|
|
406
|
-
(
|
|
412
|
+
M.some(
|
|
413
|
+
(E) => E.blocked_user_id === l
|
|
407
414
|
)
|
|
408
415
|
);
|
|
409
|
-
} catch (
|
|
410
|
-
|
|
416
|
+
} catch (M) {
|
|
417
|
+
C || console.error(`[${g}] Failed to check blocked status:`, M);
|
|
411
418
|
} finally {
|
|
412
|
-
|
|
419
|
+
C || _({ participantId: l, service: h });
|
|
413
420
|
}
|
|
414
421
|
})(), () => {
|
|
415
|
-
|
|
422
|
+
C = !0;
|
|
416
423
|
};
|
|
417
|
-
}, [v,
|
|
424
|
+
}, [v, h, l, g]), {
|
|
418
425
|
isParticipantBlocked: w,
|
|
419
426
|
isCheckingBlockedStatus: D,
|
|
420
427
|
isLeaving: N,
|
|
421
|
-
isUpdatingBlockStatus:
|
|
428
|
+
isUpdatingBlockStatus: L,
|
|
422
429
|
handleLeaveConversation: async () => {
|
|
423
|
-
var
|
|
430
|
+
var C;
|
|
424
431
|
if (!N) {
|
|
425
|
-
|
|
432
|
+
c == null || c(), f && console.log(`[${g}] Leave conversation`, e.cid), I(!0);
|
|
426
433
|
try {
|
|
427
|
-
const
|
|
428
|
-
await e.hide(
|
|
429
|
-
} catch (
|
|
430
|
-
console.error(`[${g}] Failed to leave conversation`,
|
|
434
|
+
const M = ((C = e._client) == null ? void 0 : C.userID) ?? null;
|
|
435
|
+
await e.hide(M, !1), r && await r(e), u == null || u();
|
|
436
|
+
} catch (M) {
|
|
437
|
+
console.error(`[${g}] Failed to leave conversation`, M);
|
|
431
438
|
} finally {
|
|
432
|
-
|
|
439
|
+
I(!1);
|
|
433
440
|
}
|
|
434
441
|
}
|
|
435
442
|
},
|
|
436
443
|
handleBlockUser: async () => {
|
|
437
|
-
var
|
|
438
|
-
if (!(
|
|
439
|
-
|
|
444
|
+
var C, M, E;
|
|
445
|
+
if (!(L || !h)) {
|
|
446
|
+
o == null || o(), f && console.log(`[${g}] Block member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), A(!0);
|
|
440
447
|
try {
|
|
441
|
-
await
|
|
442
|
-
} catch (
|
|
443
|
-
console.error(`[${g}] Failed to block member`,
|
|
448
|
+
await h.blockUser((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), i && await i((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), u == null || u();
|
|
449
|
+
} catch (R) {
|
|
450
|
+
console.error(`[${g}] Failed to block member`, R);
|
|
444
451
|
} finally {
|
|
445
|
-
|
|
452
|
+
A(!1);
|
|
446
453
|
}
|
|
447
454
|
}
|
|
448
455
|
},
|
|
449
456
|
handleUnblockUser: async () => {
|
|
450
|
-
var
|
|
451
|
-
if (!(
|
|
452
|
-
|
|
457
|
+
var C, M, E;
|
|
458
|
+
if (!(L || !h)) {
|
|
459
|
+
o == null || o(), f && console.log(`[${g}] Unblock member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), A(!0);
|
|
453
460
|
try {
|
|
454
|
-
await
|
|
455
|
-
} catch (
|
|
456
|
-
console.error(`[${g}] Failed to unblock member`,
|
|
461
|
+
await h.unBlockUser((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), i && await i((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), u == null || u();
|
|
462
|
+
} catch (R) {
|
|
463
|
+
console.error(`[${g}] Failed to unblock member`, R);
|
|
457
464
|
} finally {
|
|
458
|
-
|
|
465
|
+
A(!1);
|
|
459
466
|
}
|
|
460
467
|
}
|
|
461
468
|
},
|
|
@@ -472,7 +479,7 @@ const ae = ({
|
|
|
472
479
|
"button",
|
|
473
480
|
{
|
|
474
481
|
type: "button",
|
|
475
|
-
className:
|
|
482
|
+
className: y(
|
|
476
483
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
477
484
|
e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
478
485
|
t
|
|
@@ -487,30 +494,30 @@ const ae = ({
|
|
|
487
494
|
showBlockParticipant: a = !0,
|
|
488
495
|
showReportParticipant: r = !0,
|
|
489
496
|
onLeaveConversation: i,
|
|
490
|
-
onBlockParticipant:
|
|
491
|
-
onDeleteConversationClick:
|
|
497
|
+
onBlockParticipant: c,
|
|
498
|
+
onDeleteConversationClick: o,
|
|
492
499
|
onBlockParticipantClick: d,
|
|
493
500
|
onReportParticipantClick: u,
|
|
494
501
|
customChannelActions: g,
|
|
495
|
-
triggerClassName:
|
|
502
|
+
triggerClassName: h
|
|
496
503
|
}) => {
|
|
497
|
-
const [f,
|
|
504
|
+
const [f, l] = $(!1), v = Y(null), w = Vn(), b = K(() => l(!1), []), {
|
|
498
505
|
isParticipantBlocked: p,
|
|
499
506
|
isCheckingBlockedStatus: _,
|
|
500
507
|
isLeaving: N,
|
|
501
|
-
isUpdatingBlockStatus:
|
|
502
|
-
handleLeaveConversation:
|
|
503
|
-
handleBlockUser:
|
|
508
|
+
isUpdatingBlockStatus: I,
|
|
509
|
+
handleLeaveConversation: L,
|
|
510
|
+
handleBlockUser: A,
|
|
504
511
|
handleUnblockUser: D,
|
|
505
|
-
handleReportUser:
|
|
512
|
+
handleReportUser: B
|
|
506
513
|
} = ia({
|
|
507
514
|
channel: e,
|
|
508
515
|
participant: t,
|
|
509
516
|
showBlockParticipant: a,
|
|
510
517
|
enabled: f,
|
|
511
518
|
onLeaveConversation: i,
|
|
512
|
-
onBlockParticipant:
|
|
513
|
-
onDeleteConversationClick:
|
|
519
|
+
onBlockParticipant: c,
|
|
520
|
+
onDeleteConversationClick: o,
|
|
514
521
|
onBlockParticipantClick: d,
|
|
515
522
|
onReportParticipantClick: u,
|
|
516
523
|
onActionComplete: b,
|
|
@@ -518,24 +525,24 @@ const ae = ({
|
|
|
518
525
|
});
|
|
519
526
|
return W(() => {
|
|
520
527
|
if (!f) return;
|
|
521
|
-
const z = (
|
|
522
|
-
v.current && !v.current.contains(
|
|
523
|
-
}, k = (
|
|
524
|
-
|
|
528
|
+
const z = (T) => {
|
|
529
|
+
v.current && !v.current.contains(T.target) && l(!1);
|
|
530
|
+
}, k = (T) => {
|
|
531
|
+
T.key === "Escape" && l(!1);
|
|
525
532
|
};
|
|
526
533
|
return document.addEventListener("mousedown", z), document.addEventListener("keydown", k), () => {
|
|
527
534
|
document.removeEventListener("mousedown", z), document.removeEventListener("keydown", k);
|
|
528
535
|
};
|
|
529
|
-
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */
|
|
530
|
-
/* @__PURE__ */
|
|
536
|
+
}, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ m("div", { ref: v, className: "relative", children: [
|
|
537
|
+
/* @__PURE__ */ m(
|
|
531
538
|
"button",
|
|
532
539
|
{
|
|
533
|
-
className:
|
|
540
|
+
className: h,
|
|
534
541
|
type: "button",
|
|
535
542
|
"aria-haspopup": "true",
|
|
536
543
|
"aria-expanded": f,
|
|
537
544
|
"aria-controls": f ? w : void 0,
|
|
538
|
-
onClick: () =>
|
|
545
|
+
onClick: () => l((z) => !z),
|
|
539
546
|
children: [
|
|
540
547
|
/* @__PURE__ */ n(Is, { className: "size-5 text-black/90" }),
|
|
541
548
|
/* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
|
|
@@ -547,15 +554,15 @@ const ae = ({
|
|
|
547
554
|
{
|
|
548
555
|
id: w,
|
|
549
556
|
"aria-label": "Conversation options",
|
|
550
|
-
className:
|
|
557
|
+
className: y(
|
|
551
558
|
"absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
|
|
552
559
|
"rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
|
|
553
560
|
),
|
|
554
|
-
children: /* @__PURE__ */
|
|
555
|
-
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ m("ul", { className: "flex flex-col gap-1", children: [
|
|
562
|
+
s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(
|
|
556
563
|
ve,
|
|
557
564
|
{
|
|
558
|
-
onClick:
|
|
565
|
+
onClick: L,
|
|
559
566
|
disabled: N,
|
|
560
567
|
"aria-busy": N,
|
|
561
568
|
children: [
|
|
@@ -567,34 +574,34 @@ const ae = ({
|
|
|
567
574
|
a && /* @__PURE__ */ n("li", { children: _ ? (
|
|
568
575
|
// Block status not yet resolved — show a disabled placeholder
|
|
569
576
|
// so a premature click can't act on a stale block state.
|
|
570
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ m(ve, { disabled: !0, "aria-busy": !0, children: [
|
|
571
578
|
/* @__PURE__ */ n(De, { className: "h-5 w-5 animate-spin" }),
|
|
572
579
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
573
580
|
] })
|
|
574
|
-
) : p ? /* @__PURE__ */
|
|
581
|
+
) : p ? /* @__PURE__ */ m(
|
|
575
582
|
ve,
|
|
576
583
|
{
|
|
577
584
|
onClick: D,
|
|
578
|
-
disabled:
|
|
579
|
-
"aria-busy":
|
|
585
|
+
disabled: I,
|
|
586
|
+
"aria-busy": I,
|
|
580
587
|
children: [
|
|
581
|
-
|
|
588
|
+
I ? /* @__PURE__ */ n(De, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
|
|
582
589
|
/* @__PURE__ */ n("span", { children: "Unblock" })
|
|
583
590
|
]
|
|
584
591
|
}
|
|
585
|
-
) : /* @__PURE__ */
|
|
592
|
+
) : /* @__PURE__ */ m(
|
|
586
593
|
ve,
|
|
587
594
|
{
|
|
588
|
-
onClick:
|
|
589
|
-
disabled:
|
|
590
|
-
"aria-busy":
|
|
595
|
+
onClick: A,
|
|
596
|
+
disabled: I,
|
|
597
|
+
"aria-busy": I,
|
|
591
598
|
children: [
|
|
592
|
-
|
|
599
|
+
I ? /* @__PURE__ */ n(De, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
|
|
593
600
|
/* @__PURE__ */ n("span", { children: "Block" })
|
|
594
601
|
]
|
|
595
602
|
}
|
|
596
603
|
) }),
|
|
597
|
-
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */
|
|
604
|
+
r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ m(ve, { variant: "danger", onClick: B, children: [
|
|
598
605
|
/* @__PURE__ */ n(sn, { className: "h-5 w-5" }),
|
|
599
606
|
/* @__PURE__ */ n("span", { children: "Report" })
|
|
600
607
|
] }) }),
|
|
@@ -611,7 +618,7 @@ function ca(e) {
|
|
|
611
618
|
const { channel: t } = pe(), { client: s } = be("useMessageVote"), a = se(
|
|
612
619
|
() => la(e.own_reactions),
|
|
613
620
|
[e.own_reactions]
|
|
614
|
-
), r =
|
|
621
|
+
), r = K(async () => {
|
|
615
622
|
if (s != null && s.userID)
|
|
616
623
|
try {
|
|
617
624
|
a === "up" ? await t.deleteReaction(e.id, Ze) : await t.sendReaction(
|
|
@@ -621,7 +628,7 @@ function ca(e) {
|
|
|
621
628
|
);
|
|
622
629
|
} catch {
|
|
623
630
|
}
|
|
624
|
-
}, [t, s == null ? void 0 : s.userID, e.id, a]), i =
|
|
631
|
+
}, [t, s == null ? void 0 : s.userID, e.id, a]), i = K(async () => {
|
|
625
632
|
if (s != null && s.userID)
|
|
626
633
|
try {
|
|
627
634
|
a === "down" ? await t.deleteReaction(e.id, Qe) : await t.sendReaction(
|
|
@@ -645,7 +652,7 @@ function mn({
|
|
|
645
652
|
const s = e == null ? void 0 : e.text, a = da(t);
|
|
646
653
|
return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
|
|
647
654
|
}
|
|
648
|
-
const ua =
|
|
655
|
+
const ua = V.lazy(() => import("./Card-BAt0xifq.js")), ma = V.lazy(() => import("./Card-C3-Ea5ho.js")), ha = V.lazy(() => import("./Card-BB34_MDl.js")), at = () => /* @__PURE__ */ n(
|
|
649
656
|
"div",
|
|
650
657
|
{
|
|
651
658
|
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)]",
|
|
@@ -691,7 +698,7 @@ function wa(e) {
|
|
|
691
698
|
return t !== "document" ? va[t] : xa[gn(e)];
|
|
692
699
|
}
|
|
693
700
|
function ge(e, t) {
|
|
694
|
-
return
|
|
701
|
+
return V.createElement(wa(e), t);
|
|
695
702
|
}
|
|
696
703
|
const _a = (e) => {
|
|
697
704
|
var t, s;
|
|
@@ -703,71 +710,71 @@ const _a = (e) => {
|
|
|
703
710
|
autoPlay: a = !1,
|
|
704
711
|
playing: r,
|
|
705
712
|
loop: i = !1,
|
|
706
|
-
controls:
|
|
707
|
-
showProgress:
|
|
713
|
+
controls: c = !0,
|
|
714
|
+
showProgress: o = !1,
|
|
708
715
|
muted: d = !1,
|
|
709
716
|
onContainerClick: u
|
|
710
717
|
}) => {
|
|
711
|
-
const g = oe(t),
|
|
712
|
-
|
|
713
|
-
}, []),
|
|
714
|
-
const
|
|
715
|
-
if (!
|
|
716
|
-
const H =
|
|
718
|
+
const g = oe(t), h = Y(null), f = Y(null), l = Y(null), v = Y(r), [w, b] = $(a), [p, _] = $(0), [N, I] = $(!1), [L, A] = $(!1), [D, B] = $(!1), [j, z] = $(!1), [k, T] = $(!0), [C, M] = $(null), E = K(() => {
|
|
719
|
+
B(!1), b(!0);
|
|
720
|
+
}, []), R = K((x) => {
|
|
721
|
+
const S = f.current;
|
|
722
|
+
if (!S) return 0;
|
|
723
|
+
const H = S.getBoundingClientRect();
|
|
717
724
|
return Math.max(
|
|
718
725
|
0,
|
|
719
726
|
Math.min(1, (_a(x) - H.left) / H.width)
|
|
720
727
|
);
|
|
721
|
-
}, []), O =
|
|
722
|
-
const
|
|
723
|
-
|
|
724
|
-
}, []),
|
|
725
|
-
x.stopPropagation(),
|
|
726
|
-
const
|
|
727
|
-
_(
|
|
728
|
+
}, []), O = K((x) => {
|
|
729
|
+
const S = h.current;
|
|
730
|
+
S && S.duration && (S.currentTime = x * S.duration);
|
|
731
|
+
}, []), U = (x) => {
|
|
732
|
+
x.stopPropagation(), I(!0);
|
|
733
|
+
const S = R(x);
|
|
734
|
+
_(S), O(S);
|
|
728
735
|
};
|
|
729
736
|
W(() => {
|
|
730
737
|
r !== void 0 && r !== v.current && (v.current = r, b(r));
|
|
731
738
|
}, [r]), W(() => {
|
|
732
739
|
if (!w) {
|
|
733
|
-
|
|
740
|
+
l.current !== null && (cancelAnimationFrame(l.current), l.current = null);
|
|
734
741
|
return;
|
|
735
742
|
}
|
|
736
743
|
const x = () => {
|
|
737
|
-
const
|
|
738
|
-
|
|
744
|
+
const S = h.current;
|
|
745
|
+
S && S.duration && !N && _(S.currentTime / S.duration), l.current = requestAnimationFrame(x);
|
|
739
746
|
};
|
|
740
|
-
return
|
|
741
|
-
|
|
747
|
+
return l.current = requestAnimationFrame(x), () => {
|
|
748
|
+
l.current !== null && cancelAnimationFrame(l.current);
|
|
742
749
|
};
|
|
743
750
|
}, [w, N]), W(() => {
|
|
744
|
-
const x =
|
|
745
|
-
x && (w ? x.play().catch((
|
|
746
|
-
b(!1),
|
|
751
|
+
const x = h.current;
|
|
752
|
+
x && (w ? x.play().catch((S) => {
|
|
753
|
+
b(!1), B(!0);
|
|
747
754
|
}) : x.pause());
|
|
748
755
|
}, [w]), W(() => {
|
|
749
756
|
if (!N) return;
|
|
750
|
-
const x = (H) => _(
|
|
751
|
-
|
|
757
|
+
const x = (H) => _(R(H)), S = (H) => {
|
|
758
|
+
I(!1), O(R(H));
|
|
752
759
|
};
|
|
753
|
-
return window.addEventListener("mousemove", x), window.addEventListener("mouseup",
|
|
754
|
-
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup",
|
|
760
|
+
return window.addEventListener("mousemove", x), window.addEventListener("mouseup", S), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", S), () => {
|
|
761
|
+
window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", S), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", S);
|
|
755
762
|
};
|
|
756
|
-
}, [N,
|
|
757
|
-
const
|
|
758
|
-
return /* @__PURE__ */
|
|
763
|
+
}, [N, R, O]);
|
|
764
|
+
const X = C ? { aspectRatio: String(C) } : void 0, ee = C ? "" : " aspect-video", q = Math.round(p * 100);
|
|
765
|
+
return /* @__PURE__ */ m(
|
|
759
766
|
"div",
|
|
760
767
|
{
|
|
761
768
|
role: "button",
|
|
762
769
|
tabIndex: 0,
|
|
763
770
|
className: `relative cursor-pointer overflow-hidden bg-black ${ee}`,
|
|
764
|
-
style:
|
|
771
|
+
style: X,
|
|
765
772
|
onClick: (x) => {
|
|
766
773
|
if (u) {
|
|
767
774
|
u(x);
|
|
768
775
|
return;
|
|
769
776
|
}
|
|
770
|
-
D ||
|
|
777
|
+
D || c && b((S) => !S);
|
|
771
778
|
},
|
|
772
779
|
onKeyDown: (x) => {
|
|
773
780
|
if (!(x.key !== "Enter" && x.key !== " ")) {
|
|
@@ -775,7 +782,7 @@ const _a = (e) => {
|
|
|
775
782
|
u(x);
|
|
776
783
|
return;
|
|
777
784
|
}
|
|
778
|
-
D ||
|
|
785
|
+
D || c && b((S) => !S);
|
|
779
786
|
}
|
|
780
787
|
},
|
|
781
788
|
children: [
|
|
@@ -794,17 +801,17 @@ const _a = (e) => {
|
|
|
794
801
|
/* @__PURE__ */ n("div", { className: "absolute inset-0", children: g === "audio" ? /* @__PURE__ */ n(
|
|
795
802
|
"audio",
|
|
796
803
|
{
|
|
797
|
-
ref:
|
|
804
|
+
ref: h,
|
|
798
805
|
src: e,
|
|
799
806
|
loop: i,
|
|
800
807
|
muted: d,
|
|
801
808
|
style: { width: "100%", height: "100%" },
|
|
802
809
|
onLoadStart: () => z(!0),
|
|
803
810
|
onCanPlay: () => {
|
|
804
|
-
z(!1),
|
|
811
|
+
z(!1), T(!1);
|
|
805
812
|
},
|
|
806
813
|
onWaiting: () => z(!0),
|
|
807
|
-
onPlay: () =>
|
|
814
|
+
onPlay: () => B(!1),
|
|
808
815
|
onEnded: () => {
|
|
809
816
|
i || (b(!1), _(0));
|
|
810
817
|
},
|
|
@@ -813,7 +820,7 @@ const _a = (e) => {
|
|
|
813
820
|
) : /* @__PURE__ */ n(
|
|
814
821
|
"video",
|
|
815
822
|
{
|
|
816
|
-
ref:
|
|
823
|
+
ref: h,
|
|
817
824
|
src: e,
|
|
818
825
|
loop: i,
|
|
819
826
|
muted: d,
|
|
@@ -821,13 +828,13 @@ const _a = (e) => {
|
|
|
821
828
|
style: { width: "100%", height: "100%" },
|
|
822
829
|
onLoadStart: () => z(!0),
|
|
823
830
|
onCanPlay: () => {
|
|
824
|
-
z(!1),
|
|
831
|
+
z(!1), T(!1);
|
|
825
832
|
},
|
|
826
833
|
onWaiting: () => z(!0),
|
|
827
|
-
onPlay: () =>
|
|
834
|
+
onPlay: () => B(!1),
|
|
828
835
|
onLoadedMetadata: () => {
|
|
829
|
-
const x =
|
|
830
|
-
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight &&
|
|
836
|
+
const x = h.current;
|
|
837
|
+
x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && M(x.videoWidth / x.videoHeight);
|
|
831
838
|
},
|
|
832
839
|
onEnded: () => {
|
|
833
840
|
i || (b(!1), _(0));
|
|
@@ -835,14 +842,14 @@ const _a = (e) => {
|
|
|
835
842
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
836
843
|
}
|
|
837
844
|
) }),
|
|
838
|
-
|
|
845
|
+
j && !D && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
|
|
839
846
|
ye,
|
|
840
847
|
{
|
|
841
848
|
className: "size-8 animate-spin text-white/80",
|
|
842
849
|
weight: "bold"
|
|
843
850
|
}
|
|
844
851
|
) }),
|
|
845
|
-
D && !
|
|
852
|
+
D && !c && /* @__PURE__ */ n(
|
|
846
853
|
"div",
|
|
847
854
|
{
|
|
848
855
|
className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
|
|
@@ -850,15 +857,15 @@ const _a = (e) => {
|
|
|
850
857
|
tabIndex: 0,
|
|
851
858
|
"aria-label": "Play preview",
|
|
852
859
|
onClick: (x) => {
|
|
853
|
-
x.stopPropagation(),
|
|
860
|
+
x.stopPropagation(), E();
|
|
854
861
|
},
|
|
855
862
|
onKeyDown: (x) => {
|
|
856
|
-
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(),
|
|
863
|
+
x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), E());
|
|
857
864
|
},
|
|
858
865
|
children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Je, { className: "size-9 translate-x-0.5", weight: "fill" }) })
|
|
859
866
|
}
|
|
860
867
|
),
|
|
861
|
-
|
|
868
|
+
o && !c && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
|
|
862
869
|
"div",
|
|
863
870
|
{
|
|
864
871
|
role: "slider",
|
|
@@ -869,8 +876,8 @@ const _a = (e) => {
|
|
|
869
876
|
tabIndex: 0,
|
|
870
877
|
ref: f,
|
|
871
878
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
872
|
-
onMouseDown:
|
|
873
|
-
onTouchStart:
|
|
879
|
+
onMouseDown: U,
|
|
880
|
+
onTouchStart: U,
|
|
874
881
|
onClick: (x) => x.stopPropagation(),
|
|
875
882
|
onKeyDown: (x) => {
|
|
876
883
|
x.key === "ArrowRight" && O(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && O(Math.max(0, p - 0.05));
|
|
@@ -884,20 +891,20 @@ const _a = (e) => {
|
|
|
884
891
|
) })
|
|
885
892
|
}
|
|
886
893
|
) }),
|
|
887
|
-
|
|
894
|
+
c && /* @__PURE__ */ m("div", { className: "absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-black/60 to-transparent px-3 pb-2.5 pt-6 transition-all duration-200", children: [
|
|
888
895
|
/* @__PURE__ */ n(
|
|
889
896
|
"button",
|
|
890
897
|
{
|
|
891
898
|
type: "button",
|
|
892
899
|
onClick: (x) => {
|
|
893
|
-
x.stopPropagation(), b((
|
|
900
|
+
x.stopPropagation(), b((S) => !S);
|
|
894
901
|
},
|
|
895
902
|
className: "shrink-0 text-white",
|
|
896
903
|
"aria-label": w ? "Pause" : "Play",
|
|
897
904
|
children: w ? /* @__PURE__ */ n(Bs, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Je, { className: "size-5 translate-x-px", weight: "fill" })
|
|
898
905
|
}
|
|
899
906
|
),
|
|
900
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ m(
|
|
901
908
|
"div",
|
|
902
909
|
{
|
|
903
910
|
role: "slider",
|
|
@@ -908,11 +915,11 @@ const _a = (e) => {
|
|
|
908
915
|
tabIndex: 0,
|
|
909
916
|
ref: f,
|
|
910
917
|
className: "relative flex h-4 w-full cursor-pointer items-center",
|
|
911
|
-
onMouseDown:
|
|
912
|
-
onTouchStart:
|
|
918
|
+
onMouseDown: U,
|
|
919
|
+
onTouchStart: U,
|
|
913
920
|
onClick: (x) => x.stopPropagation(),
|
|
914
|
-
onMouseEnter: () =>
|
|
915
|
-
onMouseLeave: () =>
|
|
921
|
+
onMouseEnter: () => A(!0),
|
|
922
|
+
onMouseLeave: () => A(!1),
|
|
916
923
|
onKeyDown: (x) => {
|
|
917
924
|
x.key === "ArrowRight" && O(Math.min(1, p + 0.05)), x.key === "ArrowLeft" && O(Math.max(0, p - 0.05));
|
|
918
925
|
},
|
|
@@ -920,7 +927,7 @@ const _a = (e) => {
|
|
|
920
927
|
/* @__PURE__ */ n(
|
|
921
928
|
"div",
|
|
922
929
|
{
|
|
923
|
-
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${
|
|
930
|
+
className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || N ? "h-1.5" : "h-1"}`,
|
|
924
931
|
children: /* @__PURE__ */ n(
|
|
925
932
|
"div",
|
|
926
933
|
{
|
|
@@ -933,7 +940,7 @@ const _a = (e) => {
|
|
|
933
940
|
/* @__PURE__ */ n(
|
|
934
941
|
"div",
|
|
935
942
|
{
|
|
936
|
-
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${
|
|
943
|
+
className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || N ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
937
944
|
style: { left: `${q}%` }
|
|
938
945
|
}
|
|
939
946
|
)
|
|
@@ -951,10 +958,10 @@ const _a = (e) => {
|
|
|
951
958
|
title: a,
|
|
952
959
|
variant: r,
|
|
953
960
|
mediaPlayerProps: i,
|
|
954
|
-
containedImage:
|
|
961
|
+
containedImage: c = !1
|
|
955
962
|
}) => {
|
|
956
|
-
const
|
|
957
|
-
return t && (
|
|
963
|
+
const o = oe(e), [d, u] = $(!1);
|
|
964
|
+
return t && (o === "video" || o === "audio") ? /* @__PURE__ */ n(
|
|
958
965
|
Na,
|
|
959
966
|
{
|
|
960
967
|
source: t,
|
|
@@ -963,7 +970,7 @@ const _a = (e) => {
|
|
|
963
970
|
controls: !0,
|
|
964
971
|
...i
|
|
965
972
|
}
|
|
966
|
-
) : t &&
|
|
973
|
+
) : t && o === "image" ? c ? /* @__PURE__ */ n("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ n(
|
|
967
974
|
"img",
|
|
968
975
|
{
|
|
969
976
|
src: t,
|
|
@@ -980,7 +987,7 @@ const _a = (e) => {
|
|
|
980
987
|
className: "block w-full",
|
|
981
988
|
draggable: !1
|
|
982
989
|
}
|
|
983
|
-
) : t &&
|
|
990
|
+
) : t && o === "document" ? s ? c ? /* @__PURE__ */ n("div", { className: "relative aspect-video overflow-hidden bg-black/5", children: /* @__PURE__ */ n(
|
|
984
991
|
"img",
|
|
985
992
|
{
|
|
986
993
|
src: s,
|
|
@@ -1031,20 +1038,20 @@ const _a = (e) => {
|
|
|
1031
1038
|
placeholderTitle: a = "Attachment title",
|
|
1032
1039
|
mimeType: r,
|
|
1033
1040
|
detail: i,
|
|
1034
|
-
statusBadge:
|
|
1035
|
-
action:
|
|
1041
|
+
statusBadge: c,
|
|
1042
|
+
action: o,
|
|
1036
1043
|
topLeft: d,
|
|
1037
1044
|
topRight: u,
|
|
1038
1045
|
rootRef: g,
|
|
1039
|
-
"data-testid":
|
|
1046
|
+
"data-testid": h
|
|
1040
1047
|
}) => {
|
|
1041
|
-
const f = e === "dark",
|
|
1042
|
-
return /* @__PURE__ */
|
|
1048
|
+
const f = e === "dark", l = f ? s ?? a : s ?? "", v = f && !s;
|
|
1049
|
+
return /* @__PURE__ */ m(
|
|
1043
1050
|
"div",
|
|
1044
1051
|
{
|
|
1045
1052
|
ref: g,
|
|
1046
|
-
"data-testid":
|
|
1047
|
-
className:
|
|
1053
|
+
"data-testid": h,
|
|
1054
|
+
className: y(
|
|
1048
1055
|
"relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
1049
1056
|
f ? "bg-[#121110]" : "bg-white"
|
|
1050
1057
|
),
|
|
@@ -1052,21 +1059,21 @@ const _a = (e) => {
|
|
|
1052
1059
|
d ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute left-3 top-3 z-50", children: d }) : null,
|
|
1053
1060
|
u ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-50", children: u }) : null,
|
|
1054
1061
|
t,
|
|
1055
|
-
/* @__PURE__ */
|
|
1056
|
-
|
|
1062
|
+
/* @__PURE__ */ m("div", { className: "px-4 pb-3 pt-3", children: [
|
|
1063
|
+
l.trim() !== "" && /* @__PURE__ */ n(
|
|
1057
1064
|
"p",
|
|
1058
1065
|
{
|
|
1059
|
-
className:
|
|
1066
|
+
className: y("mb-0.5 truncate text-base font-medium", {
|
|
1060
1067
|
"text-black": !f,
|
|
1061
1068
|
"text-white/30": f && v,
|
|
1062
1069
|
"text-white": f && !v
|
|
1063
1070
|
}),
|
|
1064
|
-
children:
|
|
1071
|
+
children: l
|
|
1065
1072
|
}
|
|
1066
1073
|
),
|
|
1067
|
-
/* @__PURE__ */
|
|
1074
|
+
/* @__PURE__ */ m("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1068
1075
|
ge(r, {
|
|
1069
|
-
className:
|
|
1076
|
+
className: y(
|
|
1070
1077
|
"size-5 shrink-0",
|
|
1071
1078
|
f ? "text-white/55" : "text-black/55"
|
|
1072
1079
|
),
|
|
@@ -1075,16 +1082,16 @@ const _a = (e) => {
|
|
|
1075
1082
|
i != null && i !== "" && /* @__PURE__ */ n(
|
|
1076
1083
|
"span",
|
|
1077
1084
|
{
|
|
1078
|
-
className:
|
|
1085
|
+
className: y(
|
|
1079
1086
|
"text-xs font-medium",
|
|
1080
1087
|
f ? "text-white/55" : "text-black/55"
|
|
1081
1088
|
),
|
|
1082
1089
|
children: i
|
|
1083
1090
|
}
|
|
1084
1091
|
),
|
|
1085
|
-
|
|
1092
|
+
c
|
|
1086
1093
|
] }),
|
|
1087
|
-
|
|
1094
|
+
o
|
|
1088
1095
|
] })
|
|
1089
1096
|
]
|
|
1090
1097
|
}
|
|
@@ -1096,10 +1103,10 @@ function vn(e) {
|
|
|
1096
1103
|
function rt(e) {
|
|
1097
1104
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
|
|
1098
1105
|
}
|
|
1099
|
-
function
|
|
1106
|
+
function ka(e) {
|
|
1100
1107
|
return e ? "bg-white/10" : "bg-black/5";
|
|
1101
1108
|
}
|
|
1102
|
-
function
|
|
1109
|
+
function Ca(e) {
|
|
1103
1110
|
return e ? "text-white" : "text-black";
|
|
1104
1111
|
}
|
|
1105
1112
|
function Ea(e) {
|
|
@@ -1112,7 +1119,7 @@ function Ia(e) {
|
|
|
1112
1119
|
return e ? "text-white/20" : "text-black/20";
|
|
1113
1120
|
}
|
|
1114
1121
|
const it = ({ attachment: e, isMyMessage: t }) => {
|
|
1115
|
-
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link:
|
|
1122
|
+
const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: c } = e, o = i ?? c, d = typeof o == "string" && o.trim() !== "" ? o : void 0, u = /* @__PURE__ */ m(V.Fragment, { children: [
|
|
1116
1123
|
/* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
|
|
1117
1124
|
"img",
|
|
1118
1125
|
{
|
|
@@ -1123,12 +1130,12 @@ const it = ({ attachment: e, isMyMessage: t }) => {
|
|
|
1123
1130
|
) : /* @__PURE__ */ n(
|
|
1124
1131
|
"div",
|
|
1125
1132
|
{
|
|
1126
|
-
className: `aspect-video w-full rounded-[20px] ${
|
|
1133
|
+
className: `aspect-video w-full rounded-[20px] ${ka(t)} flex items-center justify-center`,
|
|
1127
1134
|
children: /* @__PURE__ */ n(js, { className: `size-12 ${Ia(t)}` })
|
|
1128
1135
|
}
|
|
1129
1136
|
) }),
|
|
1130
|
-
/* @__PURE__ */
|
|
1131
|
-
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${
|
|
1137
|
+
/* @__PURE__ */ m("div", { className: "px-3 pb-3", children: [
|
|
1138
|
+
s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${Ca(t)}`, children: s }),
|
|
1132
1139
|
a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${Ea(t)}`, children: a }),
|
|
1133
1140
|
d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${Sa(t)}`, children: d })
|
|
1134
1141
|
] })
|
|
@@ -1151,52 +1158,52 @@ async function Ta(e, t) {
|
|
|
1151
1158
|
}
|
|
1152
1159
|
const a = await fetch(e, { mode: "cors" });
|
|
1153
1160
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
1154
|
-
const r = await a.blob(), i = URL.createObjectURL(r),
|
|
1155
|
-
|
|
1161
|
+
const r = await a.blob(), i = URL.createObjectURL(r), c = document.createElement("a");
|
|
1162
|
+
c.href = i, c.download = s, c.style.display = "none", document.body.appendChild(c), c.click(), document.body.removeChild(c), URL.revokeObjectURL(i);
|
|
1156
1163
|
}
|
|
1157
1164
|
const Aa = ({
|
|
1158
1165
|
url: e,
|
|
1159
1166
|
filename: t
|
|
1160
1167
|
}) => {
|
|
1161
|
-
const [s, a] =
|
|
1168
|
+
const [s, a] = $(!1);
|
|
1162
1169
|
return /* @__PURE__ */ n(
|
|
1163
1170
|
"button",
|
|
1164
1171
|
{
|
|
1165
1172
|
type: "button",
|
|
1166
1173
|
onClick: (i) => {
|
|
1167
1174
|
i.stopPropagation();
|
|
1168
|
-
const
|
|
1175
|
+
const c = window.open("", "_blank", "noopener,noreferrer");
|
|
1169
1176
|
a(!0), Ta(e, t).then(() => {
|
|
1170
|
-
|
|
1177
|
+
c == null || c.close();
|
|
1171
1178
|
}).catch(() => {
|
|
1172
|
-
|
|
1179
|
+
c && (c.location.href = e);
|
|
1173
1180
|
}).finally(() => a(!1));
|
|
1174
1181
|
},
|
|
1175
1182
|
disabled: s,
|
|
1176
1183
|
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",
|
|
1177
|
-
children: s ? /* @__PURE__ */ n(ye, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */ n(
|
|
1184
|
+
children: s ? /* @__PURE__ */ n(ye, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ m(V.Fragment, { children: [
|
|
1185
|
+
/* @__PURE__ */ n(ke, { className: "size-4 text-white", weight: "bold" }),
|
|
1179
1186
|
"Download"
|
|
1180
1187
|
] })
|
|
1181
1188
|
}
|
|
1182
1189
|
);
|
|
1183
1190
|
};
|
|
1184
1191
|
function lt(e) {
|
|
1185
|
-
var
|
|
1186
|
-
const t = (
|
|
1192
|
+
var h, f, l, v;
|
|
1193
|
+
const t = (h = e.attachments) == null ? void 0 : h.find(
|
|
1187
1194
|
(w) => w.type === "video" && w.asset_url
|
|
1188
1195
|
), s = (f = e.attachments) == null ? void 0 : f.find(
|
|
1189
1196
|
(w) => w.type === "image" && w.image_url
|
|
1190
|
-
), a = (
|
|
1197
|
+
), a = (l = e.attachments) == null ? void 0 : l.find(
|
|
1191
1198
|
(w) => w.type === "audio" && w.asset_url
|
|
1192
1199
|
), r = (v = e.attachments) == null ? void 0 : v.find(
|
|
1193
1200
|
(w) => w.type === "file" && w.asset_url
|
|
1194
|
-
), i = t ?? s ?? a ?? r,
|
|
1195
|
-
if (!
|
|
1196
|
-
const
|
|
1201
|
+
), i = t ?? s ?? a ?? r, c = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
|
|
1202
|
+
if (!c) return null;
|
|
1203
|
+
const o = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, u = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
|
|
1197
1204
|
return {
|
|
1198
|
-
resolvedUrl:
|
|
1199
|
-
resolvedType:
|
|
1205
|
+
resolvedUrl: c,
|
|
1206
|
+
resolvedType: o,
|
|
1200
1207
|
title: d,
|
|
1201
1208
|
fileSize: u,
|
|
1202
1209
|
thumbnailUrl: g
|
|
@@ -1237,14 +1244,14 @@ const wn = ({
|
|
|
1237
1244
|
fileSize: a,
|
|
1238
1245
|
thumbnailUrl: r
|
|
1239
1246
|
}) => {
|
|
1240
|
-
const i = oe(t),
|
|
1247
|
+
const i = oe(t), c = a !== void 0 ? vn(a) : void 0;
|
|
1241
1248
|
return /* @__PURE__ */ n(
|
|
1242
1249
|
bn,
|
|
1243
1250
|
{
|
|
1244
1251
|
variant: "light",
|
|
1245
1252
|
title: s,
|
|
1246
1253
|
mimeType: t,
|
|
1247
|
-
detail:
|
|
1254
|
+
detail: c,
|
|
1248
1255
|
thumbnail: /* @__PURE__ */ n(
|
|
1249
1256
|
pn,
|
|
1250
1257
|
{
|
|
@@ -1264,7 +1271,7 @@ const wn = ({
|
|
|
1264
1271
|
isMyMessage: t = !1
|
|
1265
1272
|
}) => {
|
|
1266
1273
|
const s = ot(e), a = lt(e);
|
|
1267
|
-
return !s && !a ? null : /* @__PURE__ */
|
|
1274
|
+
return !s && !a ? null : /* @__PURE__ */ m("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
|
|
1268
1275
|
!t && e.user && /* @__PURE__ */ n(
|
|
1269
1276
|
ae,
|
|
1270
1277
|
{
|
|
@@ -1338,15 +1345,15 @@ const wn = ({
|
|
|
1338
1345
|
groupPosition: a = "single",
|
|
1339
1346
|
className: r,
|
|
1340
1347
|
children: i,
|
|
1341
|
-
"data-testid":
|
|
1348
|
+
"data-testid": c
|
|
1342
1349
|
}) => {
|
|
1343
|
-
const
|
|
1344
|
-
return /* @__PURE__ */
|
|
1350
|
+
const o = t != null && t !== "", d = Fa[Oa(e)][a];
|
|
1351
|
+
return /* @__PURE__ */ m(
|
|
1345
1352
|
"div",
|
|
1346
1353
|
{
|
|
1347
|
-
"data-testid":
|
|
1354
|
+
"data-testid": c,
|
|
1348
1355
|
"data-group-position": a,
|
|
1349
|
-
className:
|
|
1356
|
+
className: y(
|
|
1350
1357
|
// 280px-wide bubble — matches the mobile chat attachment width
|
|
1351
1358
|
// and keeps the document / image / audio bubbles visually
|
|
1352
1359
|
// consistent inside the conversation timeline. The 8px / 16px
|
|
@@ -1363,10 +1370,10 @@ const wn = ({
|
|
|
1363
1370
|
),
|
|
1364
1371
|
children: [
|
|
1365
1372
|
i,
|
|
1366
|
-
|
|
1373
|
+
o ? /* @__PURE__ */ n(
|
|
1367
1374
|
"p",
|
|
1368
1375
|
{
|
|
1369
|
-
className:
|
|
1376
|
+
className: y(
|
|
1370
1377
|
// No `text-*` / `font-*` overrides here — caption inherits
|
|
1371
1378
|
// the same font family + size as `.str-chat__message-text`
|
|
1372
1379
|
// so it matches the surrounding `CustomMessage` bubbles.
|
|
@@ -1395,7 +1402,7 @@ const wn = ({
|
|
|
1395
1402
|
a.stopPropagation(), e();
|
|
1396
1403
|
},
|
|
1397
1404
|
"aria-label": s,
|
|
1398
|
-
className:
|
|
1405
|
+
className: y(
|
|
1399
1406
|
"flex size-6 items-center justify-center rounded-full text-white",
|
|
1400
1407
|
t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
|
|
1401
1408
|
),
|
|
@@ -1410,7 +1417,7 @@ const wn = ({
|
|
|
1410
1417
|
mimeType: t,
|
|
1411
1418
|
filename: s,
|
|
1412
1419
|
items: a
|
|
1413
|
-
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], ja = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */
|
|
1420
|
+
}) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], ja = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
1414
1421
|
/* @__PURE__ */ n(
|
|
1415
1422
|
"audio",
|
|
1416
1423
|
{
|
|
@@ -1429,25 +1436,25 @@ const wn = ({
|
|
|
1429
1436
|
filename: a,
|
|
1430
1437
|
items: r,
|
|
1431
1438
|
text: i,
|
|
1432
|
-
groupPosition:
|
|
1433
|
-
preload:
|
|
1439
|
+
groupPosition: c,
|
|
1440
|
+
preload: o,
|
|
1434
1441
|
onDismiss: d
|
|
1435
1442
|
}) => {
|
|
1436
|
-
const u = Te(e), g = e === "composer" && !!d,
|
|
1437
|
-
if (
|
|
1443
|
+
const u = Te(e), g = e === "composer" && !!d, h = Ba({ src: t, mimeType: s, filename: a, items: r });
|
|
1444
|
+
if (h.length === 0)
|
|
1438
1445
|
return null;
|
|
1439
|
-
const f =
|
|
1446
|
+
const f = o ?? (h.length > 1 ? "none" : "metadata");
|
|
1440
1447
|
return /* @__PURE__ */ n(
|
|
1441
1448
|
Se,
|
|
1442
1449
|
{
|
|
1443
1450
|
variant: u,
|
|
1444
1451
|
text: i,
|
|
1445
|
-
groupPosition:
|
|
1452
|
+
groupPosition: c,
|
|
1446
1453
|
"data-testid": "audio-attachment",
|
|
1447
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children:
|
|
1454
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: h.map((l, v) => /* @__PURE__ */ n(
|
|
1448
1455
|
ja,
|
|
1449
1456
|
{
|
|
1450
|
-
item:
|
|
1457
|
+
item: l,
|
|
1451
1458
|
preload: f,
|
|
1452
1459
|
trailingAction: (
|
|
1453
1460
|
// Composer only supports a single attachment, so the
|
|
@@ -1455,7 +1462,7 @@ const wn = ({
|
|
|
1455
1462
|
g && v === 0 ? /* @__PURE__ */ n(Ie, { onClick: d, variant: "inline" }) : void 0
|
|
1456
1463
|
)
|
|
1457
1464
|
},
|
|
1458
|
-
`${
|
|
1465
|
+
`${l.src}-${v}`
|
|
1459
1466
|
)) })
|
|
1460
1467
|
}
|
|
1461
1468
|
);
|
|
@@ -1523,56 +1530,56 @@ const Ka = {
|
|
|
1523
1530
|
mimeType: a = "application/octet-stream",
|
|
1524
1531
|
fileSize: r,
|
|
1525
1532
|
onActivate: i,
|
|
1526
|
-
activateLabel:
|
|
1527
|
-
trailingAction:
|
|
1533
|
+
activateLabel: c,
|
|
1534
|
+
trailingAction: o
|
|
1528
1535
|
}) => {
|
|
1529
1536
|
const d = s ?? t ?? "File", u = Xa(a, t, r), g = /* @__PURE__ */ n(
|
|
1530
1537
|
"div",
|
|
1531
1538
|
{
|
|
1532
|
-
className:
|
|
1539
|
+
className: y(
|
|
1533
1540
|
"flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1534
1541
|
Ja[e]
|
|
1535
1542
|
),
|
|
1536
1543
|
"aria-hidden": !0,
|
|
1537
1544
|
children: ge(a, {
|
|
1538
|
-
className:
|
|
1545
|
+
className: y("size-6", Za[e]),
|
|
1539
1546
|
weight: "regular"
|
|
1540
1547
|
})
|
|
1541
1548
|
}
|
|
1542
|
-
),
|
|
1549
|
+
), h = /* @__PURE__ */ m("div", { className: "flex min-w-0 flex-1 flex-col text-left", children: [
|
|
1543
1550
|
/* @__PURE__ */ n("p", { className: "truncate font-medium leading-snug", children: d }),
|
|
1544
1551
|
u ? /* @__PURE__ */ n(
|
|
1545
1552
|
"p",
|
|
1546
1553
|
{
|
|
1547
|
-
className:
|
|
1554
|
+
className: y(
|
|
1548
1555
|
"truncate text-xs leading-4",
|
|
1549
1556
|
Ka[e]
|
|
1550
1557
|
),
|
|
1551
1558
|
children: u
|
|
1552
1559
|
}
|
|
1553
1560
|
) : null
|
|
1554
|
-
] }), f = i ? /* @__PURE__ */
|
|
1561
|
+
] }), f = i ? /* @__PURE__ */ m(
|
|
1555
1562
|
"button",
|
|
1556
1563
|
{
|
|
1557
1564
|
type: "button",
|
|
1558
1565
|
onClick: i,
|
|
1559
|
-
"aria-label":
|
|
1560
|
-
className:
|
|
1566
|
+
"aria-label": c,
|
|
1567
|
+
className: y(
|
|
1561
1568
|
"flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
|
|
1562
1569
|
e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
|
|
1563
1570
|
),
|
|
1564
1571
|
children: [
|
|
1565
1572
|
g,
|
|
1566
|
-
|
|
1573
|
+
h
|
|
1567
1574
|
]
|
|
1568
1575
|
}
|
|
1569
|
-
) : /* @__PURE__ */
|
|
1576
|
+
) : /* @__PURE__ */ m(te, { children: [
|
|
1570
1577
|
g,
|
|
1571
|
-
|
|
1578
|
+
h
|
|
1572
1579
|
] });
|
|
1573
|
-
return /* @__PURE__ */
|
|
1580
|
+
return /* @__PURE__ */ m("div", { className: "flex items-center gap-3 px-3 py-2", children: [
|
|
1574
1581
|
f,
|
|
1575
|
-
|
|
1582
|
+
o ? /* @__PURE__ */ n("div", { className: "shrink-0", children: o }) : null
|
|
1576
1583
|
] });
|
|
1577
1584
|
};
|
|
1578
1585
|
async function yn(e, t) {
|
|
@@ -1580,8 +1587,8 @@ async function yn(e, t) {
|
|
|
1580
1587
|
try {
|
|
1581
1588
|
const a = await fetch(e, { mode: "cors" });
|
|
1582
1589
|
if (!a.ok) throw new Error(`HTTP ${a.status}`);
|
|
1583
|
-
const r = await a.blob(), i = URL.createObjectURL(r),
|
|
1584
|
-
|
|
1590
|
+
const r = await a.blob(), i = URL.createObjectURL(r), c = document.createElement("a");
|
|
1591
|
+
c.href = i, c.download = s, c.style.display = "none", document.body.appendChild(c), c.click(), document.body.removeChild(c), URL.revokeObjectURL(i);
|
|
1585
1592
|
} catch {
|
|
1586
1593
|
if (!window.open(e, "_blank", "noopener,noreferrer")) {
|
|
1587
1594
|
const r = document.createElement("a");
|
|
@@ -1624,50 +1631,50 @@ const Qa = ({
|
|
|
1624
1631
|
fileSize: a,
|
|
1625
1632
|
mimeType: r,
|
|
1626
1633
|
title: i,
|
|
1627
|
-
items:
|
|
1628
|
-
text:
|
|
1634
|
+
items: c,
|
|
1635
|
+
text: o,
|
|
1629
1636
|
groupPosition: d,
|
|
1630
1637
|
onClick: u,
|
|
1631
1638
|
onDismiss: g
|
|
1632
1639
|
}) => {
|
|
1633
|
-
const
|
|
1640
|
+
const h = Te(e), f = e === "composer" && !!g, l = Qa({
|
|
1634
1641
|
src: t,
|
|
1635
1642
|
filename: s,
|
|
1636
1643
|
fileSize: a,
|
|
1637
1644
|
mimeType: r,
|
|
1638
1645
|
title: i,
|
|
1639
|
-
items:
|
|
1646
|
+
items: c
|
|
1640
1647
|
}), v = (b) => {
|
|
1641
1648
|
if ((u == null ? void 0 : u(b)) === !1) return;
|
|
1642
|
-
const p =
|
|
1649
|
+
const p = l[b];
|
|
1643
1650
|
if (!p) return;
|
|
1644
1651
|
const _ = p.filename ?? re(p.src);
|
|
1645
1652
|
yn(p.src, _);
|
|
1646
1653
|
};
|
|
1647
|
-
if (
|
|
1654
|
+
if (l.length === 0)
|
|
1648
1655
|
return null;
|
|
1649
1656
|
const w = /* @__PURE__ */ n(
|
|
1650
1657
|
"span",
|
|
1651
1658
|
{
|
|
1652
|
-
className:
|
|
1659
|
+
className: y(
|
|
1653
1660
|
"flex size-8 items-center justify-center rounded-full",
|
|
1654
|
-
|
|
1661
|
+
h === "dark" ? "text-white/70" : "text-black/70"
|
|
1655
1662
|
),
|
|
1656
1663
|
"aria-hidden": !0,
|
|
1657
|
-
children: /* @__PURE__ */ n(
|
|
1664
|
+
children: /* @__PURE__ */ n(ke, { className: "size-5", weight: "bold" })
|
|
1658
1665
|
}
|
|
1659
1666
|
);
|
|
1660
1667
|
return /* @__PURE__ */ n(
|
|
1661
1668
|
Se,
|
|
1662
1669
|
{
|
|
1663
|
-
variant:
|
|
1664
|
-
text:
|
|
1670
|
+
variant: h,
|
|
1671
|
+
text: o,
|
|
1665
1672
|
groupPosition: d,
|
|
1666
1673
|
"data-testid": "file-attachment",
|
|
1667
|
-
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children:
|
|
1674
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: l.map((b, p) => /* @__PURE__ */ n(
|
|
1668
1675
|
er,
|
|
1669
1676
|
{
|
|
1670
|
-
variant:
|
|
1677
|
+
variant: h,
|
|
1671
1678
|
item: b,
|
|
1672
1679
|
index: p,
|
|
1673
1680
|
onActivate: v,
|
|
@@ -1686,7 +1693,7 @@ const Qa = ({
|
|
|
1686
1693
|
onNext: t,
|
|
1687
1694
|
prevLabel: s = "Previous",
|
|
1688
1695
|
nextLabel: a = "Next"
|
|
1689
|
-
}) => /* @__PURE__ */
|
|
1696
|
+
}) => /* @__PURE__ */ m(te, { children: [
|
|
1690
1697
|
/* @__PURE__ */ n(
|
|
1691
1698
|
"button",
|
|
1692
1699
|
{
|
|
@@ -1707,24 +1714,24 @@ const Qa = ({
|
|
|
1707
1714
|
children: /* @__PURE__ */ n(we, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1708
1715
|
}
|
|
1709
1716
|
)
|
|
1710
|
-
] }),
|
|
1717
|
+
] }), kn = ({
|
|
1711
1718
|
url: e,
|
|
1712
1719
|
filename: t,
|
|
1713
1720
|
variant: s = "pill",
|
|
1714
1721
|
label: a = "Download",
|
|
1715
1722
|
iconOnly: r,
|
|
1716
1723
|
tone: i = "dark",
|
|
1717
|
-
onTriggered:
|
|
1724
|
+
onTriggered: c
|
|
1718
1725
|
}) => {
|
|
1719
|
-
const [
|
|
1720
|
-
(
|
|
1721
|
-
|
|
1726
|
+
const [o, d] = $(!1), u = K(
|
|
1727
|
+
(l) => {
|
|
1728
|
+
l.stopPropagation(), !o && (d(!0), yn(e, t).catch(() => {
|
|
1722
1729
|
}).finally(() => {
|
|
1723
|
-
d(!1),
|
|
1730
|
+
d(!1), c == null || c();
|
|
1724
1731
|
}));
|
|
1725
1732
|
},
|
|
1726
|
-
[
|
|
1727
|
-
), g = r ?? s !== "pill", f = { className:
|
|
1733
|
+
[o, e, t, c]
|
|
1734
|
+
), g = r ?? s !== "pill", f = { className: y(
|
|
1728
1735
|
s === "pill" ? "size-4" : "size-5",
|
|
1729
1736
|
"shrink-0"
|
|
1730
1737
|
), weight: "bold" };
|
|
@@ -1733,16 +1740,16 @@ const Qa = ({
|
|
|
1733
1740
|
{
|
|
1734
1741
|
type: "button",
|
|
1735
1742
|
onClick: u,
|
|
1736
|
-
disabled:
|
|
1743
|
+
disabled: o,
|
|
1737
1744
|
"aria-label": a,
|
|
1738
|
-
className:
|
|
1745
|
+
className: y(
|
|
1739
1746
|
"flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
|
|
1740
1747
|
{
|
|
1741
1748
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
1742
1749
|
light: "text-black/70 hover:bg-black/[0.08] hover:text-black"
|
|
1743
1750
|
}[i]
|
|
1744
1751
|
),
|
|
1745
|
-
children:
|
|
1752
|
+
children: o ? /* @__PURE__ */ n(
|
|
1746
1753
|
ye,
|
|
1747
1754
|
{
|
|
1748
1755
|
className: "size-4 animate-spin",
|
|
@@ -1750,7 +1757,7 @@ const Qa = ({
|
|
|
1750
1757
|
"aria-hidden": !0
|
|
1751
1758
|
}
|
|
1752
1759
|
) : /* @__PURE__ */ n(
|
|
1753
|
-
|
|
1760
|
+
ke,
|
|
1754
1761
|
{
|
|
1755
1762
|
className: "size-5 shrink-0",
|
|
1756
1763
|
weight: "bold",
|
|
@@ -1763,31 +1770,31 @@ const Qa = ({
|
|
|
1763
1770
|
{
|
|
1764
1771
|
type: "button",
|
|
1765
1772
|
onClick: u,
|
|
1766
|
-
disabled:
|
|
1773
|
+
disabled: o,
|
|
1767
1774
|
"aria-label": a,
|
|
1768
1775
|
className: "mes-media-viewer__action",
|
|
1769
|
-
children:
|
|
1776
|
+
children: o ? /* @__PURE__ */ n(ye, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(ke, { size: 20, weight: "bold", "aria-hidden": !0 })
|
|
1770
1777
|
}
|
|
1771
|
-
) : /* @__PURE__ */
|
|
1778
|
+
) : /* @__PURE__ */ m(
|
|
1772
1779
|
"button",
|
|
1773
1780
|
{
|
|
1774
1781
|
type: "button",
|
|
1775
1782
|
onClick: u,
|
|
1776
|
-
disabled:
|
|
1783
|
+
disabled: o,
|
|
1777
1784
|
"aria-label": g ? a : void 0,
|
|
1778
|
-
className:
|
|
1785
|
+
className: y(
|
|
1779
1786
|
"mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
|
|
1780
1787
|
i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
|
|
1781
1788
|
),
|
|
1782
1789
|
children: [
|
|
1783
|
-
|
|
1790
|
+
o ? /* @__PURE__ */ n(
|
|
1784
1791
|
ye,
|
|
1785
1792
|
{
|
|
1786
1793
|
className: "size-4 animate-spin",
|
|
1787
1794
|
weight: "bold",
|
|
1788
1795
|
"aria-hidden": !0
|
|
1789
1796
|
}
|
|
1790
|
-
) : /* @__PURE__ */ n(
|
|
1797
|
+
) : /* @__PURE__ */ n(ke, { ...f, "aria-hidden": !0 }),
|
|
1791
1798
|
g ? null : a
|
|
1792
1799
|
]
|
|
1793
1800
|
}
|
|
@@ -1797,15 +1804,15 @@ const Qa = ({
|
|
|
1797
1804
|
initialIndex: t,
|
|
1798
1805
|
open: s
|
|
1799
1806
|
}) => {
|
|
1800
|
-
const a = Ye(t, 0, Math.max(e - 1, 0)), [r, i] =
|
|
1807
|
+
const a = Ye(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
|
|
1801
1808
|
W(() => {
|
|
1802
1809
|
s && i(Ye(t, 0, Math.max(e - 1, 0)));
|
|
1803
1810
|
}, [s, t, e]), W(() => {
|
|
1804
1811
|
i((d) => Ye(d, 0, Math.max(e - 1, 0)));
|
|
1805
1812
|
}, [e]);
|
|
1806
|
-
const
|
|
1813
|
+
const c = K(() => {
|
|
1807
1814
|
e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
|
|
1808
|
-
}, [e]),
|
|
1815
|
+
}, [e]), o = K(() => {
|
|
1809
1816
|
e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
|
|
1810
1817
|
}, [e]);
|
|
1811
1818
|
return W(() => {
|
|
@@ -1813,10 +1820,10 @@ const Qa = ({
|
|
|
1813
1820
|
const d = (u) => {
|
|
1814
1821
|
if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
|
|
1815
1822
|
const g = document.activeElement;
|
|
1816
|
-
g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (u.preventDefault(), u.key === "ArrowLeft" ?
|
|
1823
|
+
g && (g.tagName === "VIDEO" || g.tagName === "AUDIO") || (u.preventDefault(), u.key === "ArrowLeft" ? c() : o());
|
|
1817
1824
|
};
|
|
1818
1825
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
1819
|
-
}, [s, e,
|
|
1826
|
+
}, [s, e, c, o]), { index: r, prev: c, next: o };
|
|
1820
1827
|
}, ht = ({
|
|
1821
1828
|
open: e,
|
|
1822
1829
|
onClose: t,
|
|
@@ -1824,46 +1831,46 @@ const Qa = ({
|
|
|
1824
1831
|
counter: a,
|
|
1825
1832
|
actions: r,
|
|
1826
1833
|
children: i,
|
|
1827
|
-
"data-testid":
|
|
1834
|
+
"data-testid": c
|
|
1828
1835
|
}) => {
|
|
1829
|
-
const
|
|
1836
|
+
const o = Y(null), d = Y(null);
|
|
1830
1837
|
return W(() => {
|
|
1831
1838
|
var f;
|
|
1832
|
-
const
|
|
1833
|
-
if (
|
|
1839
|
+
const h = o.current;
|
|
1840
|
+
if (h) {
|
|
1834
1841
|
if (e) {
|
|
1835
|
-
if (!
|
|
1836
|
-
if (typeof
|
|
1842
|
+
if (!h.open)
|
|
1843
|
+
if (typeof h.showModal == "function")
|
|
1837
1844
|
try {
|
|
1838
|
-
|
|
1845
|
+
h.showModal();
|
|
1839
1846
|
} catch {
|
|
1840
|
-
|
|
1847
|
+
h.setAttribute("open", "");
|
|
1841
1848
|
}
|
|
1842
1849
|
else
|
|
1843
|
-
|
|
1844
|
-
const
|
|
1850
|
+
h.setAttribute("open", "");
|
|
1851
|
+
const l = typeof document < "u" ? document.activeElement : null;
|
|
1845
1852
|
return (f = d.current) == null || f.focus(), () => {
|
|
1846
|
-
if (
|
|
1847
|
-
if (typeof
|
|
1853
|
+
if (h.open)
|
|
1854
|
+
if (typeof h.close == "function")
|
|
1848
1855
|
try {
|
|
1849
|
-
|
|
1856
|
+
h.close();
|
|
1850
1857
|
} catch {
|
|
1851
|
-
|
|
1858
|
+
h.removeAttribute("open");
|
|
1852
1859
|
}
|
|
1853
1860
|
else
|
|
1854
|
-
|
|
1855
|
-
|
|
1861
|
+
h.removeAttribute("open");
|
|
1862
|
+
l && document.body.contains(l) && l.focus();
|
|
1856
1863
|
};
|
|
1857
1864
|
}
|
|
1858
|
-
if (
|
|
1859
|
-
if (typeof
|
|
1865
|
+
if (h.open)
|
|
1866
|
+
if (typeof h.close == "function")
|
|
1860
1867
|
try {
|
|
1861
|
-
|
|
1868
|
+
h.close();
|
|
1862
1869
|
} catch {
|
|
1863
|
-
|
|
1870
|
+
h.removeAttribute("open");
|
|
1864
1871
|
}
|
|
1865
1872
|
else
|
|
1866
|
-
|
|
1873
|
+
h.removeAttribute("open");
|
|
1867
1874
|
}
|
|
1868
1875
|
}, [e]), // The native `<dialog>` element ships its own keyboard dismissal
|
|
1869
1876
|
// (Escape, handled by the platform and surfaced through `onClose`),
|
|
@@ -1872,23 +1879,23 @@ const Qa = ({
|
|
|
1872
1879
|
// `jsx-a11y` rules below don't model `<dialog>` as interactive, so
|
|
1873
1880
|
// we silence them locally with the rationale captured here.
|
|
1874
1881
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1875
|
-
/* @__PURE__ */
|
|
1882
|
+
/* @__PURE__ */ m(
|
|
1876
1883
|
"dialog",
|
|
1877
1884
|
{
|
|
1878
|
-
ref:
|
|
1885
|
+
ref: o,
|
|
1879
1886
|
className: "mes-media-viewer",
|
|
1880
1887
|
"aria-label": s ?? "Attachment viewer",
|
|
1881
|
-
"data-testid":
|
|
1888
|
+
"data-testid": c,
|
|
1882
1889
|
onClose: () => {
|
|
1883
1890
|
t();
|
|
1884
1891
|
},
|
|
1885
|
-
onClick: (
|
|
1886
|
-
|
|
1892
|
+
onClick: (h) => {
|
|
1893
|
+
h.target === o.current && t();
|
|
1887
1894
|
},
|
|
1888
1895
|
children: [
|
|
1889
|
-
/* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ m("div", { className: "mes-media-viewer__chrome", children: [
|
|
1890
1897
|
a ? /* @__PURE__ */ n("span", { className: "mes-media-viewer__counter", children: a }) : null,
|
|
1891
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ m("div", { className: "mes-media-viewer__actions", children: [
|
|
1892
1899
|
r,
|
|
1893
1900
|
/* @__PURE__ */ n(
|
|
1894
1901
|
"button",
|
|
@@ -1907,21 +1914,21 @@ const Qa = ({
|
|
|
1907
1914
|
]
|
|
1908
1915
|
}
|
|
1909
1916
|
);
|
|
1910
|
-
},
|
|
1917
|
+
}, Cn = ({
|
|
1911
1918
|
open: e,
|
|
1912
1919
|
items: t,
|
|
1913
1920
|
initialIndex: s = 0,
|
|
1914
1921
|
onClose: a
|
|
1915
1922
|
}) => {
|
|
1916
|
-
const { index: r, prev: i, next:
|
|
1923
|
+
const { index: r, prev: i, next: c } = mt({
|
|
1917
1924
|
length: t.length,
|
|
1918
1925
|
initialIndex: s,
|
|
1919
1926
|
open: e
|
|
1920
|
-
}),
|
|
1921
|
-
() => (
|
|
1922
|
-
[
|
|
1927
|
+
}), o = t[r], d = se(
|
|
1928
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "image"),
|
|
1929
|
+
[o]
|
|
1923
1930
|
);
|
|
1924
|
-
return
|
|
1931
|
+
return o ? /* @__PURE__ */ m(
|
|
1925
1932
|
ht,
|
|
1926
1933
|
{
|
|
1927
1934
|
open: e,
|
|
@@ -1929,9 +1936,9 @@ const Qa = ({
|
|
|
1929
1936
|
ariaLabel: d,
|
|
1930
1937
|
counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
|
|
1931
1938
|
actions: /* @__PURE__ */ n(
|
|
1932
|
-
|
|
1939
|
+
kn,
|
|
1933
1940
|
{
|
|
1934
|
-
url:
|
|
1941
|
+
url: o.src,
|
|
1935
1942
|
filename: d,
|
|
1936
1943
|
variant: "viewer",
|
|
1937
1944
|
label: `Download ${d}`
|
|
@@ -1942,20 +1949,20 @@ const Qa = ({
|
|
|
1942
1949
|
/* @__PURE__ */ n(
|
|
1943
1950
|
"img",
|
|
1944
1951
|
{
|
|
1945
|
-
src:
|
|
1946
|
-
alt:
|
|
1952
|
+
src: o.src,
|
|
1953
|
+
alt: o.alt ?? d,
|
|
1947
1954
|
draggable: !1,
|
|
1948
1955
|
loading: "eager",
|
|
1949
1956
|
decoding: "async",
|
|
1950
1957
|
className: "mes-media-viewer__image"
|
|
1951
1958
|
},
|
|
1952
|
-
`${r}:${
|
|
1959
|
+
`${r}:${o.src}`
|
|
1953
1960
|
),
|
|
1954
1961
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
1955
1962
|
ut,
|
|
1956
1963
|
{
|
|
1957
1964
|
onPrev: i,
|
|
1958
|
-
onNext:
|
|
1965
|
+
onNext: c,
|
|
1959
1966
|
prevLabel: "Previous image",
|
|
1960
1967
|
nextLabel: "Next image"
|
|
1961
1968
|
}
|
|
@@ -1971,76 +1978,76 @@ const Qa = ({
|
|
|
1971
1978
|
}) => {
|
|
1972
1979
|
const r = e.length;
|
|
1973
1980
|
if (r === 0) return null;
|
|
1974
|
-
const i = e.slice(0, Math.min(r, s)),
|
|
1975
|
-
const
|
|
1976
|
-
return t ? /* @__PURE__ */
|
|
1981
|
+
const i = e.slice(0, Math.min(r, s)), c = r - i.length, o = (d, u, g) => {
|
|
1982
|
+
const h = y(rr, "h-full w-full");
|
|
1983
|
+
return t ? /* @__PURE__ */ m(
|
|
1977
1984
|
"button",
|
|
1978
1985
|
{
|
|
1979
1986
|
type: "button",
|
|
1980
1987
|
onClick: () => t(u),
|
|
1981
1988
|
"aria-label": d.ariaLabel ?? `Open media ${u + 1}`,
|
|
1982
|
-
className:
|
|
1989
|
+
className: y(h, "cursor-zoom-in"),
|
|
1983
1990
|
children: [
|
|
1984
1991
|
d.content,
|
|
1985
1992
|
g
|
|
1986
1993
|
]
|
|
1987
1994
|
},
|
|
1988
1995
|
u
|
|
1989
|
-
) : /* @__PURE__ */
|
|
1996
|
+
) : /* @__PURE__ */ m("div", { className: h, children: [
|
|
1990
1997
|
d.content,
|
|
1991
1998
|
g
|
|
1992
1999
|
] }, u);
|
|
1993
2000
|
};
|
|
1994
|
-
return i.length === 1 ? /* @__PURE__ */ n("div", { className:
|
|
2001
|
+
return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: o(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
|
|
1995
2002
|
"div",
|
|
1996
2003
|
{
|
|
1997
|
-
className:
|
|
2004
|
+
className: y(
|
|
1998
2005
|
"grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
|
|
1999
2006
|
a
|
|
2000
2007
|
),
|
|
2001
|
-
children: i.map((d, u) =>
|
|
2008
|
+
children: i.map((d, u) => o(d, u))
|
|
2002
2009
|
}
|
|
2003
|
-
) : i.length === 3 ? /* @__PURE__ */
|
|
2010
|
+
) : i.length === 3 ? /* @__PURE__ */ m(
|
|
2004
2011
|
"div",
|
|
2005
2012
|
{
|
|
2006
|
-
className:
|
|
2013
|
+
className: y(
|
|
2007
2014
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
2008
2015
|
a
|
|
2009
2016
|
),
|
|
2010
2017
|
children: [
|
|
2011
|
-
/* @__PURE__ */ n("div", { className: "row-span-2", children:
|
|
2012
|
-
|
|
2013
|
-
|
|
2018
|
+
/* @__PURE__ */ n("div", { className: "row-span-2", children: o(i[0], 0) }),
|
|
2019
|
+
o(i[1], 1),
|
|
2020
|
+
o(i[2], 2)
|
|
2014
2021
|
]
|
|
2015
2022
|
}
|
|
2016
2023
|
) : /* @__PURE__ */ n(
|
|
2017
2024
|
"div",
|
|
2018
2025
|
{
|
|
2019
|
-
className:
|
|
2026
|
+
className: y(
|
|
2020
2027
|
"grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
|
|
2021
2028
|
a
|
|
2022
2029
|
),
|
|
2023
2030
|
children: i.map((d, u) => {
|
|
2024
|
-
const g =
|
|
2025
|
-
return
|
|
2031
|
+
const g = c > 0 && u === i.length - 1;
|
|
2032
|
+
return o(
|
|
2026
2033
|
d,
|
|
2027
2034
|
u,
|
|
2028
|
-
g ? /* @__PURE__ */
|
|
2035
|
+
g ? /* @__PURE__ */ m("div", { className: "absolute inset-0 flex items-center justify-center bg-black/55 text-2xl font-semibold text-white", children: [
|
|
2029
2036
|
"+",
|
|
2030
|
-
|
|
2037
|
+
c
|
|
2031
2038
|
] }) : null
|
|
2032
2039
|
);
|
|
2033
2040
|
})
|
|
2034
2041
|
}
|
|
2035
2042
|
);
|
|
2036
2043
|
}, Ae = (e) => {
|
|
2037
|
-
const [t, s] =
|
|
2038
|
-
(
|
|
2039
|
-
(e == null ? void 0 : e(
|
|
2044
|
+
const [t, s] = $(!1), [a, r] = $(0), i = K(
|
|
2045
|
+
(o) => {
|
|
2046
|
+
(e == null ? void 0 : e(o)) !== !1 && (r(o), s(!0));
|
|
2040
2047
|
},
|
|
2041
2048
|
[e]
|
|
2042
|
-
),
|
|
2043
|
-
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer:
|
|
2049
|
+
), c = K(() => s(!1), []);
|
|
2050
|
+
return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: c };
|
|
2044
2051
|
}, ir = (e, t, s, a) => ({
|
|
2045
2052
|
ariaLabel: `Open image ${t + 1} of ${s}`,
|
|
2046
2053
|
content: /* @__PURE__ */ n(
|
|
@@ -2065,10 +2072,10 @@ const Qa = ({
|
|
|
2065
2072
|
alt: s.alt,
|
|
2066
2073
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2067
2074
|
})), lr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
|
|
2068
|
-
const { viewerOpen:
|
|
2075
|
+
const { viewerOpen: c, viewerIndex: o, handleActivate: d, closeViewer: u } = Ae(
|
|
2069
2076
|
r
|
|
2070
2077
|
);
|
|
2071
|
-
return /* @__PURE__ */
|
|
2078
|
+
return /* @__PURE__ */ m("div", { className: "relative w-fit", children: [
|
|
2072
2079
|
/* @__PURE__ */ n(
|
|
2073
2080
|
"button",
|
|
2074
2081
|
{
|
|
@@ -2091,11 +2098,11 @@ const Qa = ({
|
|
|
2091
2098
|
),
|
|
2092
2099
|
i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ie, { onClick: i }) }) : null,
|
|
2093
2100
|
/* @__PURE__ */ n(
|
|
2094
|
-
|
|
2101
|
+
Cn,
|
|
2095
2102
|
{
|
|
2096
|
-
open:
|
|
2103
|
+
open: c,
|
|
2097
2104
|
items: Sn([{ src: e, alt: t }], s),
|
|
2098
|
-
initialIndex:
|
|
2105
|
+
initialIndex: o,
|
|
2099
2106
|
onClose: u
|
|
2100
2107
|
}
|
|
2101
2108
|
)
|
|
@@ -2107,31 +2114,31 @@ const Qa = ({
|
|
|
2107
2114
|
filename: a,
|
|
2108
2115
|
items: r,
|
|
2109
2116
|
text: i,
|
|
2110
|
-
groupPosition:
|
|
2111
|
-
loading:
|
|
2117
|
+
groupPosition: c,
|
|
2118
|
+
loading: o = "lazy",
|
|
2112
2119
|
onClick: d
|
|
2113
2120
|
}) => {
|
|
2114
|
-
const u = or({ src: t, alt: s, items: r }), g = Te(e), { viewerOpen:
|
|
2121
|
+
const u = or({ src: t, alt: s, items: r }), g = Te(e), { viewerOpen: h, viewerIndex: f, handleActivate: l, closeViewer: v } = Ae(
|
|
2115
2122
|
d
|
|
2116
2123
|
);
|
|
2117
2124
|
if (u.length === 0)
|
|
2118
2125
|
return null;
|
|
2119
2126
|
const w = u.map(
|
|
2120
|
-
(b, p) => ir(b, p, u.length,
|
|
2127
|
+
(b, p) => ir(b, p, u.length, o)
|
|
2121
2128
|
);
|
|
2122
|
-
return /* @__PURE__ */
|
|
2129
|
+
return /* @__PURE__ */ m(
|
|
2123
2130
|
Se,
|
|
2124
2131
|
{
|
|
2125
2132
|
variant: g,
|
|
2126
2133
|
text: i,
|
|
2127
|
-
groupPosition:
|
|
2134
|
+
groupPosition: c,
|
|
2128
2135
|
"data-testid": "image-attachment",
|
|
2129
2136
|
children: [
|
|
2130
|
-
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(En, { tiles: w, onTileActivate:
|
|
2137
|
+
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(En, { tiles: w, onTileActivate: l }) }),
|
|
2131
2138
|
/* @__PURE__ */ n(
|
|
2132
|
-
|
|
2139
|
+
Cn,
|
|
2133
2140
|
{
|
|
2134
|
-
open:
|
|
2141
|
+
open: h,
|
|
2135
2142
|
items: Sn(u, a),
|
|
2136
2143
|
initialIndex: f,
|
|
2137
2144
|
onClose: v
|
|
@@ -2150,18 +2157,18 @@ const Qa = ({
|
|
|
2150
2157
|
initialIndex: s = 0,
|
|
2151
2158
|
onClose: a
|
|
2152
2159
|
}) => {
|
|
2153
|
-
const { index: r, prev: i, next:
|
|
2160
|
+
const { index: r, prev: i, next: c } = mt({
|
|
2154
2161
|
length: t.length,
|
|
2155
2162
|
initialIndex: s,
|
|
2156
2163
|
open: e
|
|
2157
|
-
}),
|
|
2158
|
-
() => (
|
|
2159
|
-
[
|
|
2164
|
+
}), o = t[r], d = se(
|
|
2165
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "document"),
|
|
2166
|
+
[o]
|
|
2160
2167
|
), u = se(
|
|
2161
|
-
() =>
|
|
2162
|
-
[
|
|
2168
|
+
() => o ? fr(o.src) : void 0,
|
|
2169
|
+
[o]
|
|
2163
2170
|
);
|
|
2164
|
-
return !
|
|
2171
|
+
return !o || !u ? null : /* @__PURE__ */ m(
|
|
2165
2172
|
ht,
|
|
2166
2173
|
{
|
|
2167
2174
|
open: e,
|
|
@@ -2178,13 +2185,13 @@ const Qa = ({
|
|
|
2178
2185
|
className: "mes-media-viewer__iframe",
|
|
2179
2186
|
sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
|
|
2180
2187
|
},
|
|
2181
|
-
`${r}:${
|
|
2188
|
+
`${r}:${o.src}`
|
|
2182
2189
|
),
|
|
2183
2190
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
2184
2191
|
ut,
|
|
2185
2192
|
{
|
|
2186
2193
|
onPrev: i,
|
|
2187
|
-
onNext:
|
|
2194
|
+
onNext: c,
|
|
2188
2195
|
prevLabel: "Previous document",
|
|
2189
2196
|
nextLabel: "Next document"
|
|
2190
2197
|
}
|
|
@@ -2229,36 +2236,36 @@ const Qa = ({
|
|
|
2229
2236
|
fileSize: a,
|
|
2230
2237
|
title: r,
|
|
2231
2238
|
items: i,
|
|
2232
|
-
text:
|
|
2233
|
-
groupPosition:
|
|
2239
|
+
text: c,
|
|
2240
|
+
groupPosition: o,
|
|
2234
2241
|
onClick: d,
|
|
2235
2242
|
onDismiss: u
|
|
2236
2243
|
}) => {
|
|
2237
|
-
const g = Te(e),
|
|
2244
|
+
const g = Te(e), h = gr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: l, handleActivate: v, closeViewer: w } = Ae(
|
|
2238
2245
|
d
|
|
2239
2246
|
), b = e === "composer" && !!u;
|
|
2240
|
-
if (
|
|
2247
|
+
if (h.length === 0)
|
|
2241
2248
|
return null;
|
|
2242
|
-
const p =
|
|
2249
|
+
const p = h.map((_) => ({
|
|
2243
2250
|
src: _.src,
|
|
2244
2251
|
filename: _.filename ?? re(_.src)
|
|
2245
2252
|
}));
|
|
2246
|
-
return /* @__PURE__ */
|
|
2253
|
+
return /* @__PURE__ */ m(
|
|
2247
2254
|
Se,
|
|
2248
2255
|
{
|
|
2249
2256
|
variant: g,
|
|
2250
|
-
text:
|
|
2251
|
-
groupPosition:
|
|
2257
|
+
text: c,
|
|
2258
|
+
groupPosition: o,
|
|
2252
2259
|
"data-testid": "pdf-attachment",
|
|
2253
2260
|
children: [
|
|
2254
|
-
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children:
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2261
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: h.map((_, N) => {
|
|
2262
|
+
const I = _.filename ?? re(_.src), L = b && N === 0 ? /* @__PURE__ */ n(Ie, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
|
|
2263
|
+
kn,
|
|
2257
2264
|
{
|
|
2258
2265
|
url: _.src,
|
|
2259
|
-
filename:
|
|
2266
|
+
filename: I,
|
|
2260
2267
|
variant: "inline",
|
|
2261
|
-
label: `Download ${
|
|
2268
|
+
label: `Download ${I}`,
|
|
2262
2269
|
tone: g
|
|
2263
2270
|
}
|
|
2264
2271
|
);
|
|
@@ -2269,7 +2276,7 @@ const Qa = ({
|
|
|
2269
2276
|
item: _,
|
|
2270
2277
|
index: N,
|
|
2271
2278
|
onActivate: v,
|
|
2272
|
-
trailingAction:
|
|
2279
|
+
trailingAction: L
|
|
2273
2280
|
},
|
|
2274
2281
|
`${_.src}-${N}`
|
|
2275
2282
|
);
|
|
@@ -2279,7 +2286,7 @@ const Qa = ({
|
|
|
2279
2286
|
{
|
|
2280
2287
|
open: f,
|
|
2281
2288
|
items: p,
|
|
2282
|
-
initialIndex:
|
|
2289
|
+
initialIndex: l,
|
|
2283
2290
|
onClose: w
|
|
2284
2291
|
}
|
|
2285
2292
|
)
|
|
@@ -2296,15 +2303,15 @@ const Qa = ({
|
|
|
2296
2303
|
initialIndex: s = 0,
|
|
2297
2304
|
onClose: a
|
|
2298
2305
|
}) => {
|
|
2299
|
-
const { index: r, prev: i, next:
|
|
2306
|
+
const { index: r, prev: i, next: c } = mt({
|
|
2300
2307
|
length: t.length,
|
|
2301
2308
|
initialIndex: s,
|
|
2302
2309
|
open: e
|
|
2303
|
-
}),
|
|
2304
|
-
() => (
|
|
2305
|
-
[
|
|
2310
|
+
}), o = t[r], d = se(
|
|
2311
|
+
() => (o == null ? void 0 : o.filename) ?? (o ? re(o.src) : "video"),
|
|
2312
|
+
[o]
|
|
2306
2313
|
);
|
|
2307
|
-
return
|
|
2314
|
+
return o ? /* @__PURE__ */ m(
|
|
2308
2315
|
ht,
|
|
2309
2316
|
{
|
|
2310
2317
|
open: e,
|
|
@@ -2316,23 +2323,23 @@ const Qa = ({
|
|
|
2316
2323
|
/* @__PURE__ */ n(
|
|
2317
2324
|
"video",
|
|
2318
2325
|
{
|
|
2319
|
-
src:
|
|
2320
|
-
poster:
|
|
2326
|
+
src: o.src,
|
|
2327
|
+
poster: o.poster,
|
|
2321
2328
|
controls: !0,
|
|
2322
2329
|
autoPlay: !0,
|
|
2323
2330
|
muted: !0,
|
|
2324
2331
|
playsInline: !0,
|
|
2325
|
-
preload:
|
|
2332
|
+
preload: o.preload ?? "metadata",
|
|
2326
2333
|
className: "mes-media-viewer__video",
|
|
2327
|
-
children:
|
|
2334
|
+
children: o.mimeType ? /* @__PURE__ */ n("source", { src: o.src, type: o.mimeType }) : null
|
|
2328
2335
|
},
|
|
2329
|
-
`${r}:${
|
|
2336
|
+
`${r}:${o.src}`
|
|
2330
2337
|
),
|
|
2331
2338
|
t.length > 1 ? /* @__PURE__ */ n(
|
|
2332
2339
|
ut,
|
|
2333
2340
|
{
|
|
2334
2341
|
onPrev: i,
|
|
2335
|
-
onNext:
|
|
2342
|
+
onNext: c,
|
|
2336
2343
|
prevLabel: "Previous video",
|
|
2337
2344
|
nextLabel: "Next video"
|
|
2338
2345
|
}
|
|
@@ -2343,7 +2350,7 @@ const Qa = ({
|
|
|
2343
2350
|
}, _r = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(Je, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), An = ({
|
|
2344
2351
|
item: e,
|
|
2345
2352
|
index: t
|
|
2346
|
-
}) => /* @__PURE__ */
|
|
2353
|
+
}) => /* @__PURE__ */ m("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
|
|
2347
2354
|
e.poster ? /* @__PURE__ */ n(
|
|
2348
2355
|
"img",
|
|
2349
2356
|
{
|
|
@@ -2378,11 +2385,11 @@ const Qa = ({
|
|
|
2378
2385
|
mimeType: s.mimeType,
|
|
2379
2386
|
preload: s.preload,
|
|
2380
2387
|
filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
|
|
2381
|
-
})),
|
|
2382
|
-
const { viewerOpen:
|
|
2388
|
+
})), kr = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: c }) => {
|
|
2389
|
+
const { viewerOpen: o, viewerIndex: d, handleActivate: u, closeViewer: g } = Ae(
|
|
2383
2390
|
i
|
|
2384
2391
|
);
|
|
2385
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */ m("div", { className: "relative w-fit", children: [
|
|
2386
2393
|
/* @__PURE__ */ n(
|
|
2387
2394
|
"button",
|
|
2388
2395
|
{
|
|
@@ -2393,11 +2400,11 @@ const Qa = ({
|
|
|
2393
2400
|
children: /* @__PURE__ */ n(An, { item: { src: e, poster: t, mimeType: s }, index: 0 })
|
|
2394
2401
|
}
|
|
2395
2402
|
),
|
|
2396
|
-
|
|
2403
|
+
c ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ie, { onClick: c }) }) : null,
|
|
2397
2404
|
/* @__PURE__ */ n(
|
|
2398
2405
|
Tn,
|
|
2399
2406
|
{
|
|
2400
|
-
open:
|
|
2407
|
+
open: o,
|
|
2401
2408
|
items: Mn(
|
|
2402
2409
|
[{ src: e, poster: t, mimeType: s, preload: r }],
|
|
2403
2410
|
a
|
|
@@ -2414,12 +2421,12 @@ const Qa = ({
|
|
|
2414
2421
|
mimeType: a,
|
|
2415
2422
|
filename: r,
|
|
2416
2423
|
items: i,
|
|
2417
|
-
text:
|
|
2418
|
-
groupPosition:
|
|
2424
|
+
text: c,
|
|
2425
|
+
groupPosition: o,
|
|
2419
2426
|
preload: d,
|
|
2420
2427
|
onClick: u
|
|
2421
2428
|
}) => {
|
|
2422
|
-
const g = yr({ src: t, poster: s, mimeType: a, preload: d, items: i }),
|
|
2429
|
+
const g = yr({ src: t, poster: s, mimeType: a, preload: d, items: i }), h = Te(e), { viewerOpen: f, viewerIndex: l, handleActivate: v, closeViewer: w } = Ae(
|
|
2423
2430
|
u
|
|
2424
2431
|
);
|
|
2425
2432
|
if (g.length === 0)
|
|
@@ -2427,12 +2434,12 @@ const Qa = ({
|
|
|
2427
2434
|
const b = g.map(
|
|
2428
2435
|
(p, _) => Nr(p, _, g.length)
|
|
2429
2436
|
);
|
|
2430
|
-
return /* @__PURE__ */
|
|
2437
|
+
return /* @__PURE__ */ m(
|
|
2431
2438
|
Se,
|
|
2432
2439
|
{
|
|
2433
|
-
variant:
|
|
2434
|
-
text:
|
|
2435
|
-
groupPosition:
|
|
2440
|
+
variant: h,
|
|
2441
|
+
text: c,
|
|
2442
|
+
groupPosition: o,
|
|
2436
2443
|
"data-testid": "video-attachment",
|
|
2437
2444
|
children: [
|
|
2438
2445
|
/* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
|
|
@@ -2448,15 +2455,15 @@ const Qa = ({
|
|
|
2448
2455
|
{
|
|
2449
2456
|
open: f,
|
|
2450
2457
|
items: Mn(g, r),
|
|
2451
|
-
initialIndex:
|
|
2458
|
+
initialIndex: l,
|
|
2452
2459
|
onClose: w
|
|
2453
2460
|
}
|
|
2454
2461
|
)
|
|
2455
2462
|
]
|
|
2456
2463
|
}
|
|
2457
2464
|
);
|
|
2458
|
-
},
|
|
2459
|
-
Composer:
|
|
2465
|
+
}, Cr = (e) => /* @__PURE__ */ n(kr, { ...e }), Er = (e) => /* @__PURE__ */ n(Rn, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ n(Rn, { ...e, state: "received" }), Ir = {
|
|
2466
|
+
Composer: Cr,
|
|
2460
2467
|
Sent: Er,
|
|
2461
2468
|
Received: Sr
|
|
2462
2469
|
}, xe = {
|
|
@@ -2471,7 +2478,7 @@ const Qa = ({
|
|
|
2471
2478
|
LockedAttachment: Tr
|
|
2472
2479
|
}, Ln = et({}), eo = Ln.Provider;
|
|
2473
2480
|
function Mr(e) {
|
|
2474
|
-
return
|
|
2481
|
+
return Ce(Ln)[e] ?? Ar[e];
|
|
2475
2482
|
}
|
|
2476
2483
|
const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
2477
2484
|
"svg",
|
|
@@ -2511,28 +2518,28 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2511
2518
|
isMyMessage: s = !1,
|
|
2512
2519
|
hasAttachment: a = !1
|
|
2513
2520
|
}) => {
|
|
2514
|
-
var
|
|
2521
|
+
var h;
|
|
2515
2522
|
const r = Dn(e), i = ze(e);
|
|
2516
2523
|
if (!r && !i)
|
|
2517
2524
|
return null;
|
|
2518
2525
|
if (r) {
|
|
2519
|
-
const f = (
|
|
2526
|
+
const f = (h = e.metadata) == null ? void 0 : h.amount_text;
|
|
2520
2527
|
if (!f) return null;
|
|
2521
|
-
const
|
|
2522
|
-
return /* @__PURE__ */
|
|
2528
|
+
const l = t ? "message-tip-standalone" : "message-tag message-tag--tip", v = t ? `${f} tip` : `Delivered with ${f} tip`;
|
|
2529
|
+
return /* @__PURE__ */ m("div", { className: l, children: [
|
|
2523
2530
|
/* @__PURE__ */ n(Vs, { size: t ? 14 : 12 }),
|
|
2524
2531
|
/* @__PURE__ */ n("span", { children: v })
|
|
2525
2532
|
] });
|
|
2526
2533
|
}
|
|
2527
|
-
const
|
|
2534
|
+
const c = s && a, o = c ? "Sent with AI" : "Sent by AI Assistant", d = [
|
|
2528
2535
|
"message-chatbot-indicator",
|
|
2529
2536
|
s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
2530
|
-
|
|
2531
|
-
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children:
|
|
2532
|
-
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !
|
|
2537
|
+
c ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
2538
|
+
].join(" "), u = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(Rr, { size: c ? 12 : 15 }) });
|
|
2539
|
+
return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !c ? /* @__PURE__ */ m(te, { children: [
|
|
2533
2540
|
u,
|
|
2534
2541
|
g
|
|
2535
|
-
] }) : /* @__PURE__ */
|
|
2542
|
+
] }) : /* @__PURE__ */ m(te, { children: [
|
|
2536
2543
|
g,
|
|
2537
2544
|
u
|
|
2538
2545
|
] }) });
|
|
@@ -2540,12 +2547,12 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2540
2547
|
selected: e,
|
|
2541
2548
|
onVoteUp: t,
|
|
2542
2549
|
onVoteDown: s
|
|
2543
|
-
}) => /* @__PURE__ */
|
|
2550
|
+
}) => /* @__PURE__ */ m("div", { className: "message-vote-buttons", children: [
|
|
2544
2551
|
/* @__PURE__ */ n(
|
|
2545
2552
|
"button",
|
|
2546
2553
|
{
|
|
2547
2554
|
type: "button",
|
|
2548
|
-
className:
|
|
2555
|
+
className: y("message-vote-button focus-ring", {
|
|
2549
2556
|
"message-vote-button--selected": e === "up"
|
|
2550
2557
|
}),
|
|
2551
2558
|
onClick: t,
|
|
@@ -2559,7 +2566,7 @@ const Rr = ({ size: e = 15 }) => /* @__PURE__ */ n(
|
|
|
2559
2566
|
"button",
|
|
2560
2567
|
{
|
|
2561
2568
|
type: "button",
|
|
2562
|
-
className:
|
|
2569
|
+
className: y("message-vote-button focus-ring", {
|
|
2563
2570
|
"message-vote-button--selected": e === "down"
|
|
2564
2571
|
}),
|
|
2565
2572
|
onClick: s,
|
|
@@ -2585,7 +2592,7 @@ const Br = {
|
|
|
2585
2592
|
dark: "bg-white text-[#121110] hover:bg-white/90",
|
|
2586
2593
|
light: "bg-[#121110] text-white hover:bg-[#2a2928]"
|
|
2587
2594
|
}, jr = ({ variant: e, cta: t }) => {
|
|
2588
|
-
const s =
|
|
2595
|
+
const s = y(
|
|
2589
2596
|
"mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
|
|
2590
2597
|
Br[e]
|
|
2591
2598
|
), a = gt(t.href);
|
|
@@ -2627,35 +2634,35 @@ const Br = {
|
|
|
2627
2634
|
description: a,
|
|
2628
2635
|
url: r,
|
|
2629
2636
|
appIcon: i,
|
|
2630
|
-
cta:
|
|
2631
|
-
trailingAction:
|
|
2637
|
+
cta: c,
|
|
2638
|
+
trailingAction: o
|
|
2632
2639
|
}) => {
|
|
2633
|
-
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "",
|
|
2634
|
-
if (!g && !
|
|
2635
|
-
const b =
|
|
2640
|
+
const d = e === "dark", u = t ?? (d ? s : void 0) ?? "", g = u.trim() !== "", h = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", l = f !== "", v = c != null;
|
|
2641
|
+
if (!g && !h && !l && !v) return null;
|
|
2642
|
+
const b = y(
|
|
2636
2643
|
"truncate text-base font-medium leading-6",
|
|
2637
2644
|
d && !t ? Vr : Ur[e]
|
|
2638
|
-
), p =
|
|
2645
|
+
), p = y(
|
|
2639
2646
|
"truncate text-xs leading-4",
|
|
2640
2647
|
Gr[e]
|
|
2641
2648
|
);
|
|
2642
|
-
return /* @__PURE__ */
|
|
2643
|
-
/* @__PURE__ */
|
|
2644
|
-
/* @__PURE__ */
|
|
2645
|
-
/* @__PURE__ */
|
|
2646
|
-
g && /* @__PURE__ */
|
|
2649
|
+
return /* @__PURE__ */ m("div", { className: "px-4 py-3", children: [
|
|
2650
|
+
/* @__PURE__ */ m("div", { className: "flex items-end gap-3", children: [
|
|
2651
|
+
/* @__PURE__ */ m("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
2652
|
+
/* @__PURE__ */ m("div", { className: "flex min-w-0 flex-col gap-1", children: [
|
|
2653
|
+
g && /* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2647
2654
|
i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
|
|
2648
|
-
/* @__PURE__ */ n("p", { className:
|
|
2655
|
+
/* @__PURE__ */ n("p", { className: y("min-w-0", b), children: u })
|
|
2649
2656
|
] }),
|
|
2650
|
-
|
|
2657
|
+
h && /* @__PURE__ */ n("p", { className: p, children: a })
|
|
2651
2658
|
] }),
|
|
2652
|
-
!v &&
|
|
2659
|
+
!v && l && /* @__PURE__ */ n("p", { className: p, children: f })
|
|
2653
2660
|
] }),
|
|
2654
|
-
|
|
2661
|
+
o && /* @__PURE__ */ n("div", { className: "shrink-0", children: o })
|
|
2655
2662
|
] }),
|
|
2656
|
-
|
|
2663
|
+
c && /* @__PURE__ */ n(jr, { variant: e, cta: c })
|
|
2657
2664
|
] });
|
|
2658
|
-
}, Hr =
|
|
2665
|
+
}, Hr = y(
|
|
2659
2666
|
"relative block w-[280px] select-none overflow-hidden rounded-md",
|
|
2660
2667
|
// 1px hairline border that sits flush with the card chrome — matches
|
|
2661
2668
|
// the messaging design system's "small border around link attachments"
|
|
@@ -2669,19 +2676,19 @@ const Br = {
|
|
|
2669
2676
|
onClick: a,
|
|
2670
2677
|
ariaLabel: r,
|
|
2671
2678
|
rootRef: i,
|
|
2672
|
-
topRight:
|
|
2673
|
-
bgClassName:
|
|
2679
|
+
topRight: c,
|
|
2680
|
+
bgClassName: o,
|
|
2674
2681
|
"data-testid": d
|
|
2675
2682
|
}) => {
|
|
2676
|
-
const u = s != null || a != null, g =
|
|
2683
|
+
const u = s != null || a != null, g = y(
|
|
2677
2684
|
Hr,
|
|
2678
|
-
|
|
2685
|
+
o ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
|
|
2679
2686
|
// `focus-ring` is a design-system utility from the component-library
|
|
2680
2687
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
2681
2688
|
// with offset, so keyboard users can see the focused card.
|
|
2682
2689
|
u ? "cursor-pointer no-underline focus-ring" : null
|
|
2683
|
-
),
|
|
2684
|
-
return s ? /* @__PURE__ */
|
|
2690
|
+
), h = c ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: c }) : null;
|
|
2691
|
+
return s ? /* @__PURE__ */ m(
|
|
2685
2692
|
"a",
|
|
2686
2693
|
{
|
|
2687
2694
|
ref: i,
|
|
@@ -2693,10 +2700,10 @@ const Br = {
|
|
|
2693
2700
|
className: g,
|
|
2694
2701
|
children: [
|
|
2695
2702
|
t,
|
|
2696
|
-
|
|
2703
|
+
h
|
|
2697
2704
|
]
|
|
2698
2705
|
}
|
|
2699
|
-
) : a ? /* @__PURE__ */
|
|
2706
|
+
) : a ? /* @__PURE__ */ m(
|
|
2700
2707
|
"button",
|
|
2701
2708
|
{
|
|
2702
2709
|
ref: i,
|
|
@@ -2704,13 +2711,13 @@ const Br = {
|
|
|
2704
2711
|
onClick: a,
|
|
2705
2712
|
"aria-label": r,
|
|
2706
2713
|
"data-testid": d,
|
|
2707
|
-
className:
|
|
2714
|
+
className: y(g, "text-left"),
|
|
2708
2715
|
children: [
|
|
2709
2716
|
t,
|
|
2710
|
-
|
|
2717
|
+
h
|
|
2711
2718
|
]
|
|
2712
2719
|
}
|
|
2713
|
-
) : /* @__PURE__ */
|
|
2720
|
+
) : /* @__PURE__ */ m(
|
|
2714
2721
|
"div",
|
|
2715
2722
|
{
|
|
2716
2723
|
ref: i,
|
|
@@ -2718,7 +2725,7 @@ const Br = {
|
|
|
2718
2725
|
className: g,
|
|
2719
2726
|
children: [
|
|
2720
2727
|
t,
|
|
2721
|
-
|
|
2728
|
+
h
|
|
2722
2729
|
]
|
|
2723
2730
|
}
|
|
2724
2731
|
);
|
|
@@ -2739,9 +2746,9 @@ const Br = {
|
|
|
2739
2746
|
title: a,
|
|
2740
2747
|
mimeType: r = "image/*",
|
|
2741
2748
|
topLeft: i,
|
|
2742
|
-
topRight:
|
|
2749
|
+
topRight: c
|
|
2743
2750
|
}) => {
|
|
2744
|
-
const
|
|
2751
|
+
const o = oe(r), d = !!s && o === "video";
|
|
2745
2752
|
return je(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
|
|
2746
2753
|
"audio",
|
|
2747
2754
|
{
|
|
@@ -2751,10 +2758,10 @@ const Br = {
|
|
|
2751
2758
|
className: "block w-full",
|
|
2752
2759
|
children: /* @__PURE__ */ n("track", { kind: "captions" })
|
|
2753
2760
|
}
|
|
2754
|
-
) }) : /* @__PURE__ */
|
|
2761
|
+
) }) : /* @__PURE__ */ m(
|
|
2755
2762
|
"div",
|
|
2756
2763
|
{
|
|
2757
|
-
className:
|
|
2764
|
+
className: y(
|
|
2758
2765
|
"relative h-[180px] w-full overflow-hidden",
|
|
2759
2766
|
d && "bg-black"
|
|
2760
2767
|
),
|
|
@@ -2781,7 +2788,7 @@ const Br = {
|
|
|
2781
2788
|
) : /* @__PURE__ */ n(
|
|
2782
2789
|
"div",
|
|
2783
2790
|
{
|
|
2784
|
-
className:
|
|
2791
|
+
className: y(
|
|
2785
2792
|
"flex h-full w-full items-center justify-center",
|
|
2786
2793
|
Yr[e]
|
|
2787
2794
|
),
|
|
@@ -2792,7 +2799,7 @@ const Br = {
|
|
|
2792
2799
|
}
|
|
2793
2800
|
),
|
|
2794
2801
|
i ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute left-3 top-3 z-10", children: i }) : null,
|
|
2795
|
-
|
|
2802
|
+
c ? /* @__PURE__ */ n("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: c }) : null
|
|
2796
2803
|
]
|
|
2797
2804
|
}
|
|
2798
2805
|
);
|
|
@@ -2803,14 +2810,14 @@ const Br = {
|
|
|
2803
2810
|
url: a,
|
|
2804
2811
|
mimeType: r,
|
|
2805
2812
|
thumbnailUrl: i,
|
|
2806
|
-
sourceUrl:
|
|
2807
|
-
layout:
|
|
2813
|
+
sourceUrl: c,
|
|
2814
|
+
layout: o = "featured",
|
|
2808
2815
|
appIcon: d,
|
|
2809
2816
|
cta: u,
|
|
2810
2817
|
onDismiss: g,
|
|
2811
|
-
onEditClick:
|
|
2818
|
+
onEditClick: h
|
|
2812
2819
|
}) => {
|
|
2813
|
-
const f =
|
|
2820
|
+
const f = o === "classic", l = je(r, c), v = g ? /* @__PURE__ */ n(
|
|
2814
2821
|
"button",
|
|
2815
2822
|
{
|
|
2816
2823
|
type: "button",
|
|
@@ -2819,28 +2826,28 @@ const Br = {
|
|
|
2819
2826
|
className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
|
|
2820
2827
|
children: /* @__PURE__ */ n(Be, { className: "size-3", weight: "bold" })
|
|
2821
2828
|
}
|
|
2822
|
-
) : void 0, w =
|
|
2829
|
+
) : void 0, w = h ? /* @__PURE__ */ n(
|
|
2823
2830
|
"button",
|
|
2824
2831
|
{
|
|
2825
2832
|
type: "button",
|
|
2826
|
-
onClick:
|
|
2833
|
+
onClick: h,
|
|
2827
2834
|
"aria-label": "Edit attachment",
|
|
2828
2835
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
2829
2836
|
children: /* @__PURE__ */ n(Ys, { className: "size-5", weight: "regular" })
|
|
2830
2837
|
}
|
|
2831
2838
|
) : void 0;
|
|
2832
|
-
return
|
|
2839
|
+
return l ? /* @__PURE__ */ n(Oe, { variant: "dark", bgClassName: vt, children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 pr-3", children: [
|
|
2833
2840
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
|
|
2834
2841
|
Fe,
|
|
2835
2842
|
{
|
|
2836
2843
|
variant: "dark",
|
|
2837
|
-
sourceUrl:
|
|
2844
|
+
sourceUrl: c,
|
|
2838
2845
|
title: e,
|
|
2839
2846
|
mimeType: r
|
|
2840
2847
|
}
|
|
2841
2848
|
) }),
|
|
2842
2849
|
v && /* @__PURE__ */ n("div", { className: "shrink-0", children: v })
|
|
2843
|
-
] }) }) : /* @__PURE__ */
|
|
2850
|
+
] }) }) : /* @__PURE__ */ m(
|
|
2844
2851
|
Oe,
|
|
2845
2852
|
{
|
|
2846
2853
|
variant: "dark",
|
|
@@ -2851,7 +2858,7 @@ const Br = {
|
|
|
2851
2858
|
{
|
|
2852
2859
|
variant: "dark",
|
|
2853
2860
|
thumbnailUrl: i,
|
|
2854
|
-
sourceUrl:
|
|
2861
|
+
sourceUrl: c,
|
|
2855
2862
|
title: e,
|
|
2856
2863
|
mimeType: r,
|
|
2857
2864
|
topRight: v
|
|
@@ -2880,29 +2887,29 @@ const Br = {
|
|
|
2880
2887
|
mimeType: a,
|
|
2881
2888
|
thumbnailUrl: r,
|
|
2882
2889
|
sourceUrl: i,
|
|
2883
|
-
layout:
|
|
2884
|
-
appIcon:
|
|
2890
|
+
layout: c = "featured",
|
|
2891
|
+
appIcon: o,
|
|
2885
2892
|
cta: d,
|
|
2886
2893
|
onClick: u
|
|
2887
2894
|
}) => {
|
|
2888
|
-
const g = bt(a, i),
|
|
2895
|
+
const g = bt(a, i), h = gt(s), f = d == null && h != null && !g ? h : void 0, l = d == null && !g ? u : void 0, v = je(a, i) ? vt : void 0, w = d && u ? {
|
|
2889
2896
|
...d,
|
|
2890
2897
|
onClick: () => {
|
|
2891
2898
|
var b;
|
|
2892
2899
|
u(), (b = d.onClick) == null || b.call(d);
|
|
2893
2900
|
}
|
|
2894
2901
|
} : d;
|
|
2895
|
-
return /* @__PURE__ */
|
|
2902
|
+
return /* @__PURE__ */ m(
|
|
2896
2903
|
Oe,
|
|
2897
2904
|
{
|
|
2898
2905
|
variant: "light",
|
|
2899
2906
|
href: f,
|
|
2900
|
-
onClick:
|
|
2907
|
+
onClick: l,
|
|
2901
2908
|
ariaLabel: e ?? "Open attachment preview",
|
|
2902
2909
|
bgClassName: v,
|
|
2903
2910
|
"data-testid": "link-attachment",
|
|
2904
2911
|
children: [
|
|
2905
|
-
|
|
2912
|
+
c === "featured" && /* @__PURE__ */ n(
|
|
2906
2913
|
Fe,
|
|
2907
2914
|
{
|
|
2908
2915
|
variant: "light",
|
|
@@ -2919,7 +2926,7 @@ const Br = {
|
|
|
2919
2926
|
title: e,
|
|
2920
2927
|
description: t,
|
|
2921
2928
|
url: s,
|
|
2922
|
-
appIcon:
|
|
2929
|
+
appIcon: o,
|
|
2923
2930
|
cta: w
|
|
2924
2931
|
}
|
|
2925
2932
|
)
|
|
@@ -2933,27 +2940,27 @@ const Br = {
|
|
|
2933
2940
|
url: a,
|
|
2934
2941
|
mimeType: r,
|
|
2935
2942
|
thumbnailUrl: i,
|
|
2936
|
-
sourceUrl:
|
|
2937
|
-
layout:
|
|
2943
|
+
sourceUrl: c,
|
|
2944
|
+
layout: o = "featured",
|
|
2938
2945
|
appIcon: d,
|
|
2939
2946
|
cta: u,
|
|
2940
2947
|
onClick: g
|
|
2941
2948
|
}) => {
|
|
2942
|
-
const
|
|
2943
|
-
return /* @__PURE__ */
|
|
2949
|
+
const h = bt(r, c), f = gt(a), l = u == null && f != null && !h ? f : void 0, v = u == null && !h && l != null ? g : void 0;
|
|
2950
|
+
return /* @__PURE__ */ m(
|
|
2944
2951
|
Oe,
|
|
2945
2952
|
{
|
|
2946
2953
|
variant: "dark",
|
|
2947
|
-
href:
|
|
2954
|
+
href: l,
|
|
2948
2955
|
onClick: v,
|
|
2949
|
-
bgClassName: je(r,
|
|
2956
|
+
bgClassName: je(r, c) ? vt : void 0,
|
|
2950
2957
|
children: [
|
|
2951
|
-
|
|
2958
|
+
o === "featured" && /* @__PURE__ */ n(
|
|
2952
2959
|
Fe,
|
|
2953
2960
|
{
|
|
2954
2961
|
variant: "dark",
|
|
2955
2962
|
thumbnailUrl: i,
|
|
2956
|
-
sourceUrl:
|
|
2963
|
+
sourceUrl: c,
|
|
2957
2964
|
title: e,
|
|
2958
2965
|
mimeType: r
|
|
2959
2966
|
}
|
|
@@ -2978,7 +2985,7 @@ const Br = {
|
|
|
2978
2985
|
Sent: Kr,
|
|
2979
2986
|
Received: Xr
|
|
2980
2987
|
}, Jr = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#121110] px-4 py-2 text-white", Zr = "mt-[2px] max-w-[280px] whitespace-pre-wrap break-words rounded-[18px] bg-[#e9eaed] px-4 py-2 text-[#080707]";
|
|
2981
|
-
function
|
|
2988
|
+
function P(e) {
|
|
2982
2989
|
const t = e == null ? void 0 : e.trim();
|
|
2983
2990
|
return t || void 0;
|
|
2984
2991
|
}
|
|
@@ -2997,10 +3004,10 @@ function Qr(e, t) {
|
|
|
2997
3004
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
|
|
2998
3005
|
}
|
|
2999
3006
|
function Zt(e) {
|
|
3000
|
-
const t =
|
|
3007
|
+
const t = P(e.og_scrape_url) ?? P(e.title_link), s = P(e.image_url) ?? P(e.thumb_url), a = P(e.asset_url), r = P(e.mime_type);
|
|
3001
3008
|
return {
|
|
3002
|
-
title:
|
|
3003
|
-
description:
|
|
3009
|
+
title: P(e.title),
|
|
3010
|
+
description: P(e.text),
|
|
3004
3011
|
url: t,
|
|
3005
3012
|
thumbnailUrl: s,
|
|
3006
3013
|
// Playable clip embedded in a link preview — lets LinkAttachment render its
|
|
@@ -3015,15 +3022,15 @@ function ei(e) {
|
|
|
3015
3022
|
return Pn(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
|
|
3016
3023
|
}
|
|
3017
3024
|
function Pn(e) {
|
|
3018
|
-
const t =
|
|
3025
|
+
const t = P(e.og_scrape_url);
|
|
3019
3026
|
return e.type === "link" || !!t && !e.asset_url;
|
|
3020
3027
|
}
|
|
3021
3028
|
function zn(e) {
|
|
3022
3029
|
if (!(e != null && e.length)) return [];
|
|
3023
3030
|
const t = [], s = (r, i) => {
|
|
3024
|
-
const
|
|
3025
|
-
if ((
|
|
3026
|
-
|
|
3031
|
+
const c = t[t.length - 1];
|
|
3032
|
+
if ((c == null ? void 0 : c.type) === "media" && c.kind === r) {
|
|
3033
|
+
c.attachments.push(i);
|
|
3027
3034
|
return;
|
|
3028
3035
|
}
|
|
3029
3036
|
t.push({ type: "media", kind: r, attachments: [i] });
|
|
@@ -3058,7 +3065,7 @@ function si(e, t, s) {
|
|
|
3058
3065
|
return t <= 1 ? s : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
3059
3066
|
}
|
|
3060
3067
|
function Qt(e) {
|
|
3061
|
-
return
|
|
3068
|
+
return P(e.image_url) ?? P(e.asset_url) ?? "";
|
|
3062
3069
|
}
|
|
3063
3070
|
function ai(e) {
|
|
3064
3071
|
switch (e) {
|
|
@@ -3081,25 +3088,25 @@ function ri(e, t) {
|
|
|
3081
3088
|
return {
|
|
3082
3089
|
items: t.map((a) => ({
|
|
3083
3090
|
src: Qt(a),
|
|
3084
|
-
alt:
|
|
3091
|
+
alt: P(a.title)
|
|
3085
3092
|
}))
|
|
3086
3093
|
};
|
|
3087
3094
|
case "video":
|
|
3088
3095
|
return {
|
|
3089
3096
|
items: t.map((a) => ({
|
|
3090
|
-
src:
|
|
3091
|
-
poster:
|
|
3097
|
+
src: P(a.asset_url) ?? "",
|
|
3098
|
+
poster: P(
|
|
3092
3099
|
a.thumb_url
|
|
3093
3100
|
),
|
|
3094
|
-
mimeType:
|
|
3101
|
+
mimeType: P(a.mime_type)
|
|
3095
3102
|
}))
|
|
3096
3103
|
};
|
|
3097
3104
|
case "audio":
|
|
3098
3105
|
return {
|
|
3099
3106
|
items: t.map((a) => ({
|
|
3100
|
-
src:
|
|
3101
|
-
mimeType:
|
|
3102
|
-
filename:
|
|
3107
|
+
src: P(a.asset_url) ?? "",
|
|
3108
|
+
mimeType: P(a.mime_type) ?? "audio/mpeg",
|
|
3109
|
+
filename: P(
|
|
3103
3110
|
a.title
|
|
3104
3111
|
)
|
|
3105
3112
|
}))
|
|
@@ -3107,8 +3114,8 @@ function ri(e, t) {
|
|
|
3107
3114
|
case "pdf":
|
|
3108
3115
|
return {
|
|
3109
3116
|
items: t.map((a) => ({
|
|
3110
|
-
src:
|
|
3111
|
-
filename:
|
|
3117
|
+
src: P(a.asset_url) ?? "",
|
|
3118
|
+
filename: P(
|
|
3112
3119
|
a.title
|
|
3113
3120
|
),
|
|
3114
3121
|
fileSize: a.file_size
|
|
@@ -3117,12 +3124,12 @@ function ri(e, t) {
|
|
|
3117
3124
|
case "file":
|
|
3118
3125
|
return {
|
|
3119
3126
|
items: t.map((a) => ({
|
|
3120
|
-
src:
|
|
3121
|
-
filename:
|
|
3127
|
+
src: P(a.asset_url) ?? "",
|
|
3128
|
+
filename: P(
|
|
3122
3129
|
a.title
|
|
3123
3130
|
),
|
|
3124
3131
|
fileSize: a.file_size,
|
|
3125
|
-
mimeType:
|
|
3132
|
+
mimeType: P(a.mime_type) ?? "application/octet-stream"
|
|
3126
3133
|
}))
|
|
3127
3134
|
};
|
|
3128
3135
|
}
|
|
@@ -3132,32 +3139,32 @@ function ri(e, t) {
|
|
|
3132
3139
|
case "image":
|
|
3133
3140
|
return {
|
|
3134
3141
|
src: Qt(s),
|
|
3135
|
-
alt:
|
|
3142
|
+
alt: P(s.title)
|
|
3136
3143
|
};
|
|
3137
3144
|
case "video":
|
|
3138
3145
|
return {
|
|
3139
|
-
src:
|
|
3140
|
-
poster:
|
|
3141
|
-
mimeType:
|
|
3146
|
+
src: P(s.asset_url) ?? "",
|
|
3147
|
+
poster: P(s.thumb_url),
|
|
3148
|
+
mimeType: P(s.mime_type)
|
|
3142
3149
|
};
|
|
3143
3150
|
case "audio":
|
|
3144
3151
|
return {
|
|
3145
|
-
src:
|
|
3146
|
-
mimeType:
|
|
3147
|
-
filename:
|
|
3152
|
+
src: P(s.asset_url) ?? "",
|
|
3153
|
+
mimeType: P(s.mime_type) ?? "audio/mpeg",
|
|
3154
|
+
filename: P(s.title)
|
|
3148
3155
|
};
|
|
3149
3156
|
case "pdf":
|
|
3150
3157
|
return {
|
|
3151
|
-
src:
|
|
3152
|
-
filename:
|
|
3158
|
+
src: P(s.asset_url) ?? "",
|
|
3159
|
+
filename: P(s.title),
|
|
3153
3160
|
fileSize: s.file_size
|
|
3154
3161
|
};
|
|
3155
3162
|
case "file":
|
|
3156
3163
|
return {
|
|
3157
|
-
src:
|
|
3158
|
-
filename:
|
|
3164
|
+
src: P(s.asset_url) ?? "",
|
|
3165
|
+
filename: P(s.title),
|
|
3159
3166
|
fileSize: s.file_size,
|
|
3160
|
-
mimeType:
|
|
3167
|
+
mimeType: P(s.mime_type) ?? "application/octet-stream"
|
|
3161
3168
|
};
|
|
3162
3169
|
}
|
|
3163
3170
|
}
|
|
@@ -3182,25 +3189,25 @@ const oi = ({
|
|
|
3182
3189
|
var w;
|
|
3183
3190
|
const a = zn(s.attachments);
|
|
3184
3191
|
if (a.length === 0) return null;
|
|
3185
|
-
const r = ti(a), i = ni(a),
|
|
3186
|
-
let g = 0,
|
|
3187
|
-
const f = [],
|
|
3192
|
+
const r = ti(a), i = ni(a), c = (w = s.text) == null ? void 0 : w.trim(), o = a.find((b) => b.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? Zt(o.attachments[0] ?? {}).url : void 0, u = c && Qr(c, d) ? void 0 : c;
|
|
3193
|
+
let g = 0, h = 0;
|
|
3194
|
+
const f = [], l = (b, p) => {
|
|
3188
3195
|
const _ = g === r - 1;
|
|
3189
3196
|
g += 1;
|
|
3190
3197
|
const N = t ? Kt.Sent : Kt.Received;
|
|
3191
3198
|
f.push(
|
|
3192
|
-
/* @__PURE__ */
|
|
3199
|
+
/* @__PURE__ */ m(V.Fragment, { children: [
|
|
3193
3200
|
/* @__PURE__ */ n(N, { ...Zt(b) }),
|
|
3194
3201
|
_ && u ? /* @__PURE__ */ n("div", { className: t ? Jr : Zr, children: u }) : null
|
|
3195
3202
|
] }, p)
|
|
3196
3203
|
);
|
|
3197
3204
|
}, v = (b, p) => {
|
|
3198
3205
|
const _ = g === r - 1, N = si(
|
|
3199
|
-
|
|
3206
|
+
h,
|
|
3200
3207
|
i,
|
|
3201
3208
|
e
|
|
3202
3209
|
);
|
|
3203
|
-
g += 1,
|
|
3210
|
+
g += 1, h += 1, f.push(
|
|
3204
3211
|
/* @__PURE__ */ n(
|
|
3205
3212
|
ii,
|
|
3206
3213
|
{
|
|
@@ -3216,97 +3223,97 @@ const oi = ({
|
|
|
3216
3223
|
return a.forEach((b, p) => {
|
|
3217
3224
|
if (b.type === "link") {
|
|
3218
3225
|
b.attachments.forEach((_, N) => {
|
|
3219
|
-
|
|
3226
|
+
l(_, `link-${p}-${N}`);
|
|
3220
3227
|
});
|
|
3221
3228
|
return;
|
|
3222
3229
|
}
|
|
3223
3230
|
v(b, `media-${p}`);
|
|
3224
3231
|
}), /* @__PURE__ */ n(te, { children: f });
|
|
3225
3232
|
}, li = (e) => {
|
|
3226
|
-
var
|
|
3233
|
+
var kt, Ct, Et, St, It, Tt, At, Mt, Rt, Lt, Dt, Pt, zt, Ot;
|
|
3227
3234
|
const {
|
|
3228
3235
|
additionalMessageInputProps: t,
|
|
3229
3236
|
chatbotVotingEnabled: s,
|
|
3230
3237
|
editing: a,
|
|
3231
3238
|
endOfGroup: r,
|
|
3232
3239
|
firstOfGroup: i,
|
|
3233
|
-
groupedByUser:
|
|
3234
|
-
handleAction:
|
|
3240
|
+
groupedByUser: c,
|
|
3241
|
+
handleAction: o,
|
|
3235
3242
|
handleOpenThread: d,
|
|
3236
3243
|
handleRetry: u,
|
|
3237
3244
|
highlighted: g,
|
|
3238
|
-
isMessageAIGenerated:
|
|
3245
|
+
isMessageAIGenerated: h,
|
|
3239
3246
|
isMyMessage: f,
|
|
3240
|
-
message:
|
|
3247
|
+
message: l,
|
|
3241
3248
|
renderText: v,
|
|
3242
3249
|
threadList: w,
|
|
3243
3250
|
viewerLanguage: b
|
|
3244
|
-
} = e, { client: p } = be("CustomMessage"), { channel: _ } = pe("CustomMessage"), { isUnlocking: N, onUnlockClick:
|
|
3245
|
-
Attachment:
|
|
3246
|
-
EditMessageModal:
|
|
3247
|
-
MessageActions:
|
|
3248
|
-
MessageBlocked:
|
|
3251
|
+
} = e, { client: p } = be("CustomMessage"), { channel: _ } = pe("CustomMessage"), { isUnlocking: N, onUnlockClick: I, onFetchSource: L, onDownloadClick: A } = Mr("LockedAttachment"), [D, B] = $(!1), j = Xn(l.id), { selected: z, voteUp: k, voteDown: T } = ca(l), {
|
|
3252
|
+
Attachment: C = Kn,
|
|
3253
|
+
EditMessageModal: M = Jn,
|
|
3254
|
+
MessageActions: E,
|
|
3255
|
+
MessageBlocked: R = Zn,
|
|
3249
3256
|
MessageBouncePrompt: O = Qn,
|
|
3250
|
-
MessageDeleted:
|
|
3251
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
3257
|
+
MessageDeleted: U = es,
|
|
3258
|
+
MessageIsThreadReplyInChannelButtonIndicator: X = ts,
|
|
3252
3259
|
MessageRepliesCountButton: ee = ns,
|
|
3253
3260
|
ReminderNotification: q = ss,
|
|
3254
3261
|
StreamedMessageText: x = as,
|
|
3255
|
-
PinIndicator:
|
|
3256
|
-
} = nn("CustomMessage"), H = rs(
|
|
3257
|
-
() =>
|
|
3258
|
-
[
|
|
3259
|
-
),
|
|
3260
|
-
const ce =
|
|
3261
|
-
if (!ze(
|
|
3262
|
+
PinIndicator: S
|
|
3263
|
+
} = nn("CustomMessage"), H = rs(l), G = is(l), Z = se(
|
|
3264
|
+
() => h == null ? void 0 : h(l),
|
|
3265
|
+
[h, l]
|
|
3266
|
+
), F = se(() => {
|
|
3267
|
+
const ce = l.attachments ?? [], he = l.shared_location ? [l.shared_location, ...ce] : ce;
|
|
3268
|
+
if (!ze(l)) return he;
|
|
3262
3269
|
const Ft = he.filter(($t) => !("type" in $t) || !xn($t));
|
|
3263
3270
|
return Ft.length === he.length ? he : Ft;
|
|
3264
|
-
}, [
|
|
3265
|
-
() => zn(
|
|
3266
|
-
[
|
|
3271
|
+
}, [l]), Q = se(
|
|
3272
|
+
() => zn(F),
|
|
3273
|
+
[F]
|
|
3267
3274
|
), J = se(() => {
|
|
3268
|
-
const ce = mn({ message:
|
|
3269
|
-
return ce ===
|
|
3270
|
-
}, [
|
|
3275
|
+
const ce = mn({ message: l, viewerLanguage: b });
|
|
3276
|
+
return ce === l.text ? l : { ...l, text: ce };
|
|
3277
|
+
}, [l, b]), Me = Q.length > 0, Re = Q.reduce(
|
|
3271
3278
|
(ce, he) => ce + he.attachments.length,
|
|
3272
3279
|
0
|
|
3273
|
-
) === ((
|
|
3280
|
+
) === ((F == null ? void 0 : F.length) ?? 0), Le = $a(
|
|
3274
3281
|
{
|
|
3275
3282
|
endOfGroup: r,
|
|
3276
3283
|
firstOfGroup: i,
|
|
3277
|
-
groupedByUser:
|
|
3284
|
+
groupedByUser: c
|
|
3278
3285
|
}
|
|
3279
3286
|
);
|
|
3280
|
-
if (os(
|
|
3287
|
+
if (os(l))
|
|
3281
3288
|
return null;
|
|
3282
|
-
if (
|
|
3283
|
-
return /* @__PURE__ */ n(
|
|
3284
|
-
if (ls(
|
|
3285
|
-
return /* @__PURE__ */ n(
|
|
3286
|
-
const ne = !w && !!
|
|
3289
|
+
if (l.deleted_at || l.type === "deleted")
|
|
3290
|
+
return /* @__PURE__ */ n(U, { message: l });
|
|
3291
|
+
if (ls(l))
|
|
3292
|
+
return /* @__PURE__ */ n(R, {});
|
|
3293
|
+
const ne = !w && !!l.reply_count, le = !w && l.show_in_channel && l.parent_id, ie = l.status === "failed" && ((kt = l.error) == null ? void 0 : kt.status) !== 403, wt = cs(l);
|
|
3287
3294
|
let de;
|
|
3288
|
-
ie ? de = () => u(
|
|
3289
|
-
const ue = f(), jn =
|
|
3295
|
+
ie ? de = () => u(l) : wt && (de = () => B(!0));
|
|
3296
|
+
const ue = f(), jn = y(
|
|
3290
3297
|
"str-chat__message str-chat__message-simple",
|
|
3291
|
-
`str-chat__message--${
|
|
3292
|
-
`str-chat__message--${
|
|
3298
|
+
`str-chat__message--${l.type}`,
|
|
3299
|
+
`str-chat__message--${l.status}`,
|
|
3293
3300
|
ue ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
3294
|
-
|
|
3301
|
+
l.text ? "str-chat__message--has-text" : "has-no-text",
|
|
3295
3302
|
{
|
|
3296
3303
|
"str-chat__message--has-attachment": H,
|
|
3297
3304
|
"str-chat__message--highlighted": g,
|
|
3298
|
-
"str-chat__message--pinned pinned-message":
|
|
3305
|
+
"str-chat__message--pinned pinned-message": l.pinned,
|
|
3299
3306
|
"str-chat__message--with-reactions": G,
|
|
3300
|
-
"str-chat__message-send-can-be-retried": (
|
|
3307
|
+
"str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((Ct = l == null ? void 0 : l.error) == null ? void 0 : Ct.status) !== 403,
|
|
3301
3308
|
"str-chat__message-with-thread-link": ne || le,
|
|
3302
3309
|
"str-chat__virtual-message__wrapper--end": r,
|
|
3303
3310
|
"str-chat__virtual-message__wrapper--first": i,
|
|
3304
|
-
"str-chat__virtual-message__wrapper--group":
|
|
3311
|
+
"str-chat__virtual-message__wrapper--group": c
|
|
3305
3312
|
}
|
|
3306
|
-
), Ue =
|
|
3307
|
-
return /* @__PURE__ */
|
|
3313
|
+
), Ue = l.poll_id && p.polls.fromState(l.poll_id), _t = zr(l), me = ze(l), Nt = Pr(l), Ve = !!(F != null && F.length && !l.quoted_message), yt = me && ue && Ve, Un = Me && Re && !l.quoted_message && !Ue && !Z && !me;
|
|
3314
|
+
return /* @__PURE__ */ m(te, { children: [
|
|
3308
3315
|
a && /* @__PURE__ */ n(
|
|
3309
|
-
|
|
3316
|
+
M,
|
|
3310
3317
|
{
|
|
3311
3318
|
additionalMessageInputProps: t
|
|
3312
3319
|
}
|
|
@@ -3315,26 +3322,26 @@ const oi = ({
|
|
|
3315
3322
|
ds,
|
|
3316
3323
|
{
|
|
3317
3324
|
MessageBouncePrompt: O,
|
|
3318
|
-
onClose: () =>
|
|
3325
|
+
onClose: () => B(!1),
|
|
3319
3326
|
open: D
|
|
3320
3327
|
}
|
|
3321
3328
|
),
|
|
3322
|
-
/* @__PURE__ */
|
|
3329
|
+
/* @__PURE__ */ m(
|
|
3323
3330
|
"div",
|
|
3324
3331
|
{
|
|
3325
3332
|
className: jn,
|
|
3326
|
-
"data-message-id":
|
|
3333
|
+
"data-message-id": l.id,
|
|
3327
3334
|
"data-dd-privacy": "mask",
|
|
3328
3335
|
children: [
|
|
3329
|
-
|
|
3330
|
-
!!
|
|
3331
|
-
|
|
3336
|
+
S && /* @__PURE__ */ n(S, {}),
|
|
3337
|
+
!!j && /* @__PURE__ */ n(q, { reminder: j }),
|
|
3338
|
+
l.user && /* @__PURE__ */ n(
|
|
3332
3339
|
ae,
|
|
3333
3340
|
{
|
|
3334
3341
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3335
|
-
id:
|
|
3336
|
-
image:
|
|
3337
|
-
name:
|
|
3342
|
+
id: l.user.id,
|
|
3343
|
+
image: l.user.image,
|
|
3344
|
+
name: l.user.name || l.user.id,
|
|
3338
3345
|
size: 24,
|
|
3339
3346
|
shape: "circle",
|
|
3340
3347
|
dmAgentEnabled: me
|
|
@@ -3343,7 +3350,7 @@ const oi = ({
|
|
|
3343
3350
|
/* @__PURE__ */ n(
|
|
3344
3351
|
"div",
|
|
3345
3352
|
{
|
|
3346
|
-
className:
|
|
3353
|
+
className: y("str-chat__message-inner", {
|
|
3347
3354
|
"str-chat__simple-message--error-failed": ie || wt
|
|
3348
3355
|
}),
|
|
3349
3356
|
"data-testid": "message-inner",
|
|
@@ -3357,41 +3364,41 @@ const oi = ({
|
|
|
3357
3364
|
marginInlineEnd: 0,
|
|
3358
3365
|
marginInlineStart: 0
|
|
3359
3366
|
},
|
|
3360
|
-
children: Nt ? /* @__PURE__ */
|
|
3361
|
-
ue ? /* @__PURE__ */
|
|
3362
|
-
|
|
3367
|
+
children: Nt ? /* @__PURE__ */ m("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
3368
|
+
ue ? /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3369
|
+
E && /* @__PURE__ */ n(E, {}),
|
|
3363
3370
|
/* @__PURE__ */ n(
|
|
3364
3371
|
Wt.Sent,
|
|
3365
3372
|
{
|
|
3366
|
-
title: (Et =
|
|
3367
|
-
mimeType: (St =
|
|
3368
|
-
thumbnailUrl: (It =
|
|
3369
|
-
amountText: (Tt =
|
|
3370
|
-
detail: (At =
|
|
3371
|
-
paymentStatus: (Mt =
|
|
3372
|
-
onPreviewClick: () =>
|
|
3373
|
-
onFetchSource: async () => await (
|
|
3373
|
+
title: (Et = l.metadata) == null ? void 0 : Et.attachment_title,
|
|
3374
|
+
mimeType: (St = l.metadata) == null ? void 0 : St.attachment_mime_type,
|
|
3375
|
+
thumbnailUrl: (It = l.metadata) == null ? void 0 : It.attachment_thumbnail,
|
|
3376
|
+
amountText: (Tt = l.metadata) == null ? void 0 : Tt.amount_text,
|
|
3377
|
+
detail: (At = l.metadata) == null ? void 0 : At.attachment_detail,
|
|
3378
|
+
paymentStatus: (Mt = l.metadata) == null ? void 0 : Mt.payment_status,
|
|
3379
|
+
onPreviewClick: () => I == null ? void 0 : I(l, _),
|
|
3380
|
+
onFetchSource: async () => await (L == null ? void 0 : L(l, _))
|
|
3374
3381
|
}
|
|
3375
3382
|
)
|
|
3376
|
-
] }) : /* @__PURE__ */
|
|
3383
|
+
] }) : /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
3377
3384
|
/* @__PURE__ */ n(
|
|
3378
3385
|
Wt.Received,
|
|
3379
3386
|
{
|
|
3380
|
-
title: (Rt =
|
|
3381
|
-
mimeType: (Lt =
|
|
3382
|
-
thumbnailUrl: (Dt =
|
|
3383
|
-
amountText: (Pt =
|
|
3384
|
-
detail: (zt =
|
|
3385
|
-
paymentStatus: (Ot =
|
|
3386
|
-
isUnlocking: N(
|
|
3387
|
-
onUnlockClick: () =>
|
|
3388
|
-
onFetchSource: async () => await (
|
|
3389
|
-
onDownloadClick: () =>
|
|
3387
|
+
title: (Rt = l.metadata) == null ? void 0 : Rt.attachment_title,
|
|
3388
|
+
mimeType: (Lt = l.metadata) == null ? void 0 : Lt.attachment_mime_type,
|
|
3389
|
+
thumbnailUrl: (Dt = l.metadata) == null ? void 0 : Dt.attachment_thumbnail,
|
|
3390
|
+
amountText: (Pt = l.metadata) == null ? void 0 : Pt.amount_text,
|
|
3391
|
+
detail: (zt = l.metadata) == null ? void 0 : zt.attachment_detail,
|
|
3392
|
+
paymentStatus: (Ot = l.metadata) == null ? void 0 : Ot.payment_status,
|
|
3393
|
+
isUnlocking: N(l.id),
|
|
3394
|
+
onUnlockClick: () => I == null ? void 0 : I(l, _),
|
|
3395
|
+
onFetchSource: async () => await (L == null ? void 0 : L(l, _)),
|
|
3396
|
+
onDownloadClick: () => A == null ? void 0 : A(l, _)
|
|
3390
3397
|
}
|
|
3391
3398
|
),
|
|
3392
|
-
|
|
3399
|
+
E && /* @__PURE__ */ n(E, {})
|
|
3393
3400
|
] }),
|
|
3394
|
-
|
|
3401
|
+
l.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
|
|
3395
3402
|
jt,
|
|
3396
3403
|
{
|
|
3397
3404
|
message: J,
|
|
@@ -3400,8 +3407,8 @@ const oi = ({
|
|
|
3400
3407
|
) })
|
|
3401
3408
|
] }) : _t ? (
|
|
3402
3409
|
/* Tip-only messages render as a standalone bubble */
|
|
3403
|
-
/* @__PURE__ */ n(qe, { message:
|
|
3404
|
-
) : Un ? /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */
|
|
3410
|
+
/* @__PURE__ */ n(qe, { message: l, standalone: !0 })
|
|
3411
|
+
) : Un ? /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m(
|
|
3405
3412
|
"div",
|
|
3406
3413
|
{
|
|
3407
3414
|
className: "str-chat__message-bubble",
|
|
@@ -3418,7 +3425,7 @@ const oi = ({
|
|
|
3418
3425
|
groupPosition: Le,
|
|
3419
3426
|
isMyMessage: ue,
|
|
3420
3427
|
message: {
|
|
3421
|
-
attachments:
|
|
3428
|
+
attachments: F,
|
|
3422
3429
|
text: J.text
|
|
3423
3430
|
}
|
|
3424
3431
|
}
|
|
@@ -3426,21 +3433,21 @@ const oi = ({
|
|
|
3426
3433
|
/* @__PURE__ */ n(Ut, {})
|
|
3427
3434
|
]
|
|
3428
3435
|
}
|
|
3429
|
-
) }) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */
|
|
3436
|
+
) }) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ m("div", { className: "str-chat__message-bubble", children: [
|
|
3430
3437
|
me && !yt && /* @__PURE__ */ n(
|
|
3431
3438
|
qe,
|
|
3432
3439
|
{
|
|
3433
|
-
message:
|
|
3440
|
+
message: l,
|
|
3434
3441
|
hasAttachment: Ve,
|
|
3435
3442
|
isMyMessage: ue
|
|
3436
3443
|
}
|
|
3437
3444
|
),
|
|
3438
3445
|
Ue && /* @__PURE__ */ n(us, { poll: Ue }),
|
|
3439
|
-
|
|
3440
|
-
|
|
3446
|
+
F != null && F.length && !l.quoted_message ? /* @__PURE__ */ n(
|
|
3447
|
+
C,
|
|
3441
3448
|
{
|
|
3442
|
-
actionHandler:
|
|
3443
|
-
attachments:
|
|
3449
|
+
actionHandler: o,
|
|
3450
|
+
attachments: F
|
|
3444
3451
|
}
|
|
3445
3452
|
) : null,
|
|
3446
3453
|
Z ? /* @__PURE__ */ n(
|
|
@@ -3460,11 +3467,11 @@ const oi = ({
|
|
|
3460
3467
|
] }) })
|
|
3461
3468
|
}
|
|
3462
3469
|
),
|
|
3463
|
-
!Nt && !_t && /* @__PURE__ */
|
|
3470
|
+
!Nt && !_t && /* @__PURE__ */ m("div", { className: "str-chat__message-footer", children: [
|
|
3464
3471
|
(!me || yt) && /* @__PURE__ */ n(
|
|
3465
3472
|
qe,
|
|
3466
3473
|
{
|
|
3467
|
-
message:
|
|
3474
|
+
message: l,
|
|
3468
3475
|
hasAttachment: Ve,
|
|
3469
3476
|
isMyMessage: ue
|
|
3470
3477
|
}
|
|
@@ -3474,7 +3481,7 @@ const oi = ({
|
|
|
3474
3481
|
{
|
|
3475
3482
|
selected: z,
|
|
3476
3483
|
onVoteUp: k,
|
|
3477
|
-
onVoteDown:
|
|
3484
|
+
onVoteDown: T
|
|
3478
3485
|
}
|
|
3479
3486
|
)
|
|
3480
3487
|
] }),
|
|
@@ -3482,16 +3489,16 @@ const oi = ({
|
|
|
3482
3489
|
ee,
|
|
3483
3490
|
{
|
|
3484
3491
|
onClick: d,
|
|
3485
|
-
reply_count:
|
|
3492
|
+
reply_count: l.reply_count
|
|
3486
3493
|
}
|
|
3487
3494
|
),
|
|
3488
|
-
le && /* @__PURE__ */ n(
|
|
3495
|
+
le && /* @__PURE__ */ n(X, {})
|
|
3489
3496
|
]
|
|
3490
3497
|
},
|
|
3491
|
-
|
|
3498
|
+
l.id
|
|
3492
3499
|
)
|
|
3493
3500
|
] });
|
|
3494
|
-
}, ci =
|
|
3501
|
+
}, ci = V.memo(
|
|
3495
3502
|
li,
|
|
3496
3503
|
(e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Wn(e, t)
|
|
3497
3504
|
), di = (e) => {
|
|
@@ -3539,7 +3546,7 @@ const oi = ({
|
|
|
3539
3546
|
onDismiss: t
|
|
3540
3547
|
}) => {
|
|
3541
3548
|
const { og_scrape_url: s, title: a, image_url: r } = e;
|
|
3542
|
-
return /* @__PURE__ */
|
|
3549
|
+
return /* @__PURE__ */ m(
|
|
3543
3550
|
"a",
|
|
3544
3551
|
{
|
|
3545
3552
|
href: s,
|
|
@@ -3559,15 +3566,15 @@ const oi = ({
|
|
|
3559
3566
|
"button",
|
|
3560
3567
|
{
|
|
3561
3568
|
type: "button",
|
|
3562
|
-
onClick: (
|
|
3563
|
-
|
|
3569
|
+
onClick: (c) => {
|
|
3570
|
+
c.preventDefault(), t(s);
|
|
3564
3571
|
},
|
|
3565
3572
|
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",
|
|
3566
3573
|
"aria-label": "Close link preview",
|
|
3567
3574
|
children: /* @__PURE__ */ n(Be, { className: "size-4 text-black/90" })
|
|
3568
3575
|
}
|
|
3569
3576
|
),
|
|
3570
|
-
/* @__PURE__ */
|
|
3577
|
+
/* @__PURE__ */ m("div", { className: "p-2", children: [
|
|
3571
3578
|
a && /* @__PURE__ */ n("div", { className: "truncate text-[14px] font-medium leading-5 text-white", children: a }),
|
|
3572
3579
|
/* @__PURE__ */ n("div", { className: "truncate text-[12px] leading-4 text-white/55", children: s })
|
|
3573
3580
|
] })
|
|
@@ -3596,7 +3603,7 @@ const oi = ({
|
|
|
3596
3603
|
// fixed-height hero would spill out of the collapsed card box.
|
|
3597
3604
|
/* @__PURE__ */ n("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ n("div", { className: "w-full shrink-0", children: /* @__PURE__ */ n(fi, { link: r, onDismiss: s }) }, r.og_scrape_url)) })
|
|
3598
3605
|
) : null;
|
|
3599
|
-
}, xt =
|
|
3606
|
+
}, xt = V.createContext(!1), to = () => Ce(xt), bi = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
|
|
3600
3607
|
"button",
|
|
3601
3608
|
{
|
|
3602
3609
|
...s,
|
|
@@ -3607,7 +3614,7 @@ const oi = ({
|
|
|
3607
3614
|
children: /* @__PURE__ */ n(Ws, { weight: "bold", className: "size-4" })
|
|
3608
3615
|
}
|
|
3609
3616
|
), vi = () => {
|
|
3610
|
-
const e =
|
|
3617
|
+
const e = Ce(xt), { handleSubmit: t } = gs(), s = ps(), a = e || !s, {
|
|
3611
3618
|
SendButton: r = bi,
|
|
3612
3619
|
AttachmentPreviewList: i = bs
|
|
3613
3620
|
} = nn("CustomMessageInput");
|
|
@@ -3620,7 +3627,7 @@ const oi = ({
|
|
|
3620
3627
|
// content height and the squeeze never reaches the preview list. Stream's
|
|
3621
3628
|
// <MessageInput> renders its Input directly (context providers only, no
|
|
3622
3629
|
// wrapper element), so this is a direct flex item of that row.
|
|
3623
|
-
/* @__PURE__ */
|
|
3630
|
+
/* @__PURE__ */ m(
|
|
3624
3631
|
"div",
|
|
3625
3632
|
{
|
|
3626
3633
|
className: "central-container flex min-h-0 flex-col gap-2 min-w-0 w-full self-stretch p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]",
|
|
@@ -3629,7 +3636,7 @@ const oi = ({
|
|
|
3629
3636
|
/* @__PURE__ */ n(vs, {}),
|
|
3630
3637
|
/* @__PURE__ */ n(pi, {}),
|
|
3631
3638
|
/* @__PURE__ */ n(i, {}),
|
|
3632
|
-
/* @__PURE__ */
|
|
3639
|
+
/* @__PURE__ */ m("div", { className: "flex shrink-0", children: [
|
|
3633
3640
|
/* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
|
|
3634
3641
|
xs,
|
|
3635
3642
|
{
|
|
@@ -3664,21 +3671,21 @@ const oi = ({
|
|
|
3664
3671
|
disabledReason: a,
|
|
3665
3672
|
composerInput: r
|
|
3666
3673
|
}) => {
|
|
3667
|
-
var
|
|
3668
|
-
const { channel: i } = pe(),
|
|
3669
|
-
return s ? /* @__PURE__ */
|
|
3674
|
+
var o;
|
|
3675
|
+
const { channel: i } = pe(), c = ((o = i == null ? void 0 : i.data) == null ? void 0 : o.frozen) === !0;
|
|
3676
|
+
return s ? /* @__PURE__ */ m(te, { children: [
|
|
3670
3677
|
/* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
|
|
3671
3678
|
t == null ? void 0 : t()
|
|
3672
|
-
] }) : /* @__PURE__ */
|
|
3673
|
-
/* @__PURE__ */
|
|
3679
|
+
] }) : /* @__PURE__ */ m("div", { className: "flex min-h-0 flex-col gap-4 p-4", children: [
|
|
3680
|
+
/* @__PURE__ */ m(
|
|
3674
3681
|
"div",
|
|
3675
3682
|
{
|
|
3676
|
-
inert:
|
|
3677
|
-
"aria-disabled":
|
|
3683
|
+
inert: c ? "" : void 0,
|
|
3684
|
+
"aria-disabled": c || void 0,
|
|
3678
3685
|
className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
|
|
3679
3686
|
children: [
|
|
3680
3687
|
e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
|
|
3681
|
-
/* @__PURE__ */ n(xt.Provider, { value:
|
|
3688
|
+
/* @__PURE__ */ n(xt.Provider, { value: c, children: /* @__PURE__ */ n(fs, { Input: r ?? vi }) })
|
|
3682
3689
|
]
|
|
3683
3690
|
}
|
|
3684
3691
|
),
|
|
@@ -3694,7 +3701,7 @@ const oi = ({
|
|
|
3694
3701
|
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
3695
3702
|
], yi = {
|
|
3696
3703
|
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
3697
|
-
}, We = "age safety guidelines.",
|
|
3704
|
+
}, We = "age safety guidelines.", ki = "https://linktr.ee/s/about/contact", en = (e) => wi.includes(e), Ci = (e) => Ni.includes(e), Ei = (e) => {
|
|
3698
3705
|
var a;
|
|
3699
3706
|
const t = (a = e.metadata) == null ? void 0 : a.custom_type;
|
|
3700
3707
|
if (en(t))
|
|
@@ -3702,7 +3709,7 @@ const oi = ({
|
|
|
3702
3709
|
kind: "dm-agent",
|
|
3703
3710
|
type: t
|
|
3704
3711
|
};
|
|
3705
|
-
if (
|
|
3712
|
+
if (Ci(t))
|
|
3706
3713
|
return {
|
|
3707
3714
|
kind: "age-safety",
|
|
3708
3715
|
type: t
|
|
@@ -3718,12 +3725,12 @@ const oi = ({
|
|
|
3718
3725
|
if (t === -1)
|
|
3719
3726
|
return e;
|
|
3720
3727
|
const s = t + We.length;
|
|
3721
|
-
return /* @__PURE__ */
|
|
3728
|
+
return /* @__PURE__ */ m(te, { children: [
|
|
3722
3729
|
e.slice(0, t),
|
|
3723
3730
|
/* @__PURE__ */ n(
|
|
3724
3731
|
"a",
|
|
3725
3732
|
{
|
|
3726
|
-
href:
|
|
3733
|
+
href: ki,
|
|
3727
3734
|
target: "_blank",
|
|
3728
3735
|
rel: "noopener noreferrer",
|
|
3729
3736
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
@@ -3739,8 +3746,8 @@ const oi = ({
|
|
|
3739
3746
|
);
|
|
3740
3747
|
if ((s == null ? void 0 : s.kind) === "dm-agent") {
|
|
3741
3748
|
const i = ((a = e.message.text) == null ? void 0 : a.trim()) || _i[s.type];
|
|
3742
|
-
return /* @__PURE__ */
|
|
3743
|
-
/* @__PURE__ */
|
|
3749
|
+
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3750
|
+
/* @__PURE__ */ m(
|
|
3744
3751
|
"div",
|
|
3745
3752
|
{
|
|
3746
3753
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
@@ -3765,8 +3772,8 @@ const oi = ({
|
|
|
3765
3772
|
}
|
|
3766
3773
|
if ((s == null ? void 0 : s.kind) === "age-safety") {
|
|
3767
3774
|
const i = ((r = e.message.text) == null ? void 0 : r.trim()) || yi[s.type];
|
|
3768
|
-
return /* @__PURE__ */
|
|
3769
|
-
/* @__PURE__ */
|
|
3775
|
+
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3776
|
+
/* @__PURE__ */ m(
|
|
3770
3777
|
"div",
|
|
3771
3778
|
{
|
|
3772
3779
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
@@ -3790,8 +3797,8 @@ const oi = ({
|
|
|
3790
3797
|
!t && /* @__PURE__ */ n(Ge, { message: e.message })
|
|
3791
3798
|
] });
|
|
3792
3799
|
}
|
|
3793
|
-
return /* @__PURE__ */
|
|
3794
|
-
/* @__PURE__ */
|
|
3800
|
+
return /* @__PURE__ */ m("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
3801
|
+
/* @__PURE__ */ m("div", { className: "str-chat__message--system__text", children: [
|
|
3795
3802
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" }),
|
|
3796
3803
|
/* @__PURE__ */ n("p", { children: e.message.text }),
|
|
3797
3804
|
/* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
|
|
@@ -3814,8 +3821,8 @@ const oi = ({
|
|
|
3814
3821
|
He.ExternalSources
|
|
3815
3822
|
]), Ai = ({ threadList: e }) => {
|
|
3816
3823
|
var v, w;
|
|
3817
|
-
const { channel: t, channelConfig: s, thread: a } = pe(), { client: r } = be(), { typing: i = {} } = ws(), { aiState:
|
|
3818
|
-
if (!e &&
|
|
3824
|
+
const { channel: t, channelConfig: s, thread: a } = pe(), { client: r } = be(), { typing: i = {} } = ws(), { aiState: c } = _s(t), o = Ce(On);
|
|
3825
|
+
if (!e && o && Ti.has(c)) {
|
|
3819
3826
|
const b = Mi(t, (v = r.user) == null ? void 0 : v.id);
|
|
3820
3827
|
return /* @__PURE__ */ n(
|
|
3821
3828
|
tn,
|
|
@@ -3839,16 +3846,16 @@ const oi = ({
|
|
|
3839
3846
|
var _;
|
|
3840
3847
|
return (p == null ? void 0 : p.id) !== ((_ = r.user) == null ? void 0 : _.id) && b === (a == null ? void 0 : a.id);
|
|
3841
3848
|
}
|
|
3842
|
-
) : [],
|
|
3843
|
-
if (!
|
|
3849
|
+
) : [], h = e ? g : u;
|
|
3850
|
+
if (!h.length)
|
|
3844
3851
|
return null;
|
|
3845
|
-
const f = (w =
|
|
3852
|
+
const f = (w = h[0]) == null ? void 0 : w.user, l = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
3846
3853
|
return /* @__PURE__ */ n(
|
|
3847
3854
|
tn,
|
|
3848
3855
|
{
|
|
3849
|
-
avatarId: (f == null ? void 0 : f.id) ?? (
|
|
3850
|
-
avatarName: (f == null ? void 0 : f.name) ?? (
|
|
3851
|
-
avatarImage: (f == null ? void 0 : f.image) ?? (
|
|
3856
|
+
avatarId: (f == null ? void 0 : f.id) ?? (l == null ? void 0 : l.id) ?? "typing-user",
|
|
3857
|
+
avatarName: (f == null ? void 0 : f.name) ?? (l == null ? void 0 : l.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
|
|
3858
|
+
avatarImage: (f == null ? void 0 : f.image) ?? (l == null ? void 0 : l.image),
|
|
3852
3859
|
testId: "typing-indicator"
|
|
3853
3860
|
}
|
|
3854
3861
|
);
|
|
@@ -3865,7 +3872,7 @@ const oi = ({
|
|
|
3865
3872
|
style: {
|
|
3866
3873
|
marginBottom: "var(--messaging-channel-input-spacer-height, 80px)"
|
|
3867
3874
|
},
|
|
3868
|
-
children: /* @__PURE__ */
|
|
3875
|
+
children: /* @__PURE__ */ m("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
|
|
3869
3876
|
/* @__PURE__ */ n(
|
|
3870
3877
|
ae,
|
|
3871
3878
|
{
|
|
@@ -3877,7 +3884,7 @@ const oi = ({
|
|
|
3877
3884
|
shape: "circle"
|
|
3878
3885
|
}
|
|
3879
3886
|
),
|
|
3880
|
-
/* @__PURE__ */ n("div", { className: "str-chat__message-inner mx-0", children: /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n("div", { className: "str-chat__message-text min-h-11 flex items-center", children: /* @__PURE__ */ n("div", { className: "str-chat__message-text-inner str-chat__message-simple-text-inner", children: /* @__PURE__ */
|
|
3887
|
+
/* @__PURE__ */ n("div", { className: "str-chat__message-inner mx-0", children: /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n("div", { className: "str-chat__message-text min-h-11 flex items-center", children: /* @__PURE__ */ n("div", { className: "str-chat__message-text-inner str-chat__message-simple-text-inner", children: /* @__PURE__ */ m(
|
|
3881
3888
|
"svg",
|
|
3882
3889
|
{
|
|
3883
3890
|
"aria-hidden": "true",
|
|
@@ -3905,12 +3912,12 @@ function Mi(e, t) {
|
|
|
3905
3912
|
return i;
|
|
3906
3913
|
}
|
|
3907
3914
|
}
|
|
3908
|
-
const Ri = () => null, Li = ({ className: e, message: t }) => /* @__PURE__ */
|
|
3915
|
+
const Ri = () => null, Li = ({ className: e, message: t }) => /* @__PURE__ */ m(
|
|
3909
3916
|
"div",
|
|
3910
3917
|
{
|
|
3911
|
-
className:
|
|
3918
|
+
className: y("flex items-center justify-center h-full", e),
|
|
3912
3919
|
children: [
|
|
3913
|
-
/* @__PURE__ */
|
|
3920
|
+
/* @__PURE__ */ m("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
3914
3921
|
/* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
|
|
3915
3922
|
"animateTransform",
|
|
3916
3923
|
{
|
|
@@ -3948,7 +3955,7 @@ const Ri = () => null, Li = ({ className: e, message: t }) => /* @__PURE__ */ h(
|
|
|
3948
3955
|
t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
|
|
3949
3956
|
]
|
|
3950
3957
|
}
|
|
3951
|
-
), $e =
|
|
3958
|
+
), $e = V.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ m("div", { className: "flex items-center", children: [
|
|
3952
3959
|
/* @__PURE__ */ n(Li, { className: "w-6 h-6" }),
|
|
3953
3960
|
/* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
3954
3961
|
] }) }));
|
|
@@ -3960,51 +3967,51 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
3960
3967
|
dmAgentEnabled: a = !1,
|
|
3961
3968
|
onLeaveConversation: r,
|
|
3962
3969
|
onBlockParticipant: i,
|
|
3963
|
-
showDeleteConversation:
|
|
3964
|
-
showBlockParticipant:
|
|
3970
|
+
showDeleteConversation: c = !0,
|
|
3971
|
+
showBlockParticipant: o = !0,
|
|
3965
3972
|
showReportParticipant: d = !0,
|
|
3966
3973
|
onDeleteConversationClick: u,
|
|
3967
3974
|
onBlockParticipantClick: g,
|
|
3968
|
-
onReportParticipantClick:
|
|
3975
|
+
onReportParticipantClick: h,
|
|
3969
3976
|
customChannelActions: f,
|
|
3970
|
-
renderChannelActions:
|
|
3977
|
+
renderChannelActions: l,
|
|
3971
3978
|
showChannelInfo: v = !0,
|
|
3972
3979
|
onParticipantNameClick: w,
|
|
3973
3980
|
renderHeaderTitleBadges: b
|
|
3974
3981
|
}) => {
|
|
3975
|
-
var
|
|
3976
|
-
const { channel: p } = pe(), { client: _ } = be(), N =
|
|
3982
|
+
var T, C, M, E, R, O;
|
|
3983
|
+
const { channel: p } = pe(), { client: _ } = be(), N = V.useMemo(
|
|
3977
3984
|
() => {
|
|
3978
|
-
var
|
|
3985
|
+
var U;
|
|
3979
3986
|
return st(
|
|
3980
|
-
(
|
|
3987
|
+
(U = p.state) == null ? void 0 : U.members,
|
|
3981
3988
|
_ == null ? void 0 : _.userID,
|
|
3982
3989
|
p.type
|
|
3983
3990
|
);
|
|
3984
3991
|
},
|
|
3985
|
-
[(
|
|
3986
|
-
),
|
|
3992
|
+
[(T = p.state) == null ? void 0 : T.members, _ == null ? void 0 : _.userID, p.type]
|
|
3993
|
+
), I = dn(N == null ? void 0 : N.user), L = (C = N == null ? void 0 : N.user) == null ? void 0 : C.image, A = cn(p), D = b == null ? void 0 : b({
|
|
3987
3994
|
channel: p,
|
|
3988
3995
|
participant: N
|
|
3989
|
-
}),
|
|
3990
|
-
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children:
|
|
3996
|
+
}), B = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", j = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", z = /* @__PURE__ */ m(te, { children: [
|
|
3997
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: I }),
|
|
3991
3998
|
D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D })
|
|
3992
3999
|
] }), k = async () => {
|
|
3993
4000
|
try {
|
|
3994
|
-
|
|
3995
|
-
} catch (
|
|
4001
|
+
A ? await p.unpin() : await p.pin();
|
|
4002
|
+
} catch (U) {
|
|
3996
4003
|
console.error(
|
|
3997
4004
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
3998
|
-
|
|
4005
|
+
U
|
|
3999
4006
|
);
|
|
4000
4007
|
}
|
|
4001
4008
|
};
|
|
4002
|
-
return /* @__PURE__ */
|
|
4003
|
-
/* @__PURE__ */
|
|
4009
|
+
return /* @__PURE__ */ m("div", { className: "@container", children: [
|
|
4010
|
+
/* @__PURE__ */ m("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden px-6 py-3", children: [
|
|
4004
4011
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
|
|
4005
4012
|
"button",
|
|
4006
4013
|
{
|
|
4007
|
-
className:
|
|
4014
|
+
className: y(
|
|
4008
4015
|
fe,
|
|
4009
4016
|
"messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
|
|
4010
4017
|
),
|
|
@@ -4020,51 +4027,51 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4020
4027
|
{
|
|
4021
4028
|
className: "flex flex-col gap-1 items-center",
|
|
4022
4029
|
"data-dd-privacy": "mask",
|
|
4023
|
-
children: w ? /* @__PURE__ */
|
|
4030
|
+
children: w ? /* @__PURE__ */ m(
|
|
4024
4031
|
"button",
|
|
4025
4032
|
{
|
|
4026
4033
|
type: "button",
|
|
4027
4034
|
onClick: w,
|
|
4028
|
-
"aria-label": `View details for ${
|
|
4029
|
-
className:
|
|
4030
|
-
|
|
4035
|
+
"aria-label": `View details for ${I}`,
|
|
4036
|
+
className: y(
|
|
4037
|
+
B,
|
|
4031
4038
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4032
4039
|
),
|
|
4033
4040
|
children: [
|
|
4034
4041
|
/* @__PURE__ */ n(
|
|
4035
4042
|
ae,
|
|
4036
4043
|
{
|
|
4037
|
-
id: ((
|
|
4038
|
-
name:
|
|
4039
|
-
image:
|
|
4040
|
-
starred: s &&
|
|
4044
|
+
id: ((M = N == null ? void 0 : N.user) == null ? void 0 : M.id) || p.id || "unknown",
|
|
4045
|
+
name: I,
|
|
4046
|
+
image: L,
|
|
4047
|
+
starred: s && A,
|
|
4041
4048
|
dmAgentEnabled: a,
|
|
4042
4049
|
size: 48
|
|
4043
4050
|
}
|
|
4044
4051
|
),
|
|
4045
|
-
/* @__PURE__ */
|
|
4052
|
+
/* @__PURE__ */ m("span", { className: "flex max-w-full items-center gap-0.5", children: [
|
|
4046
4053
|
z,
|
|
4047
4054
|
/* @__PURE__ */ n(we, { className: "size-3 shrink-0", weight: "bold" })
|
|
4048
4055
|
] }),
|
|
4049
|
-
a && /* @__PURE__ */
|
|
4056
|
+
a && /* @__PURE__ */ m("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4050
4057
|
/* @__PURE__ */ n(_e, { className: "size-3 shrink-0 text-black/55" }),
|
|
4051
4058
|
/* @__PURE__ */ n("span", { children: Pe })
|
|
4052
4059
|
] })
|
|
4053
4060
|
]
|
|
4054
4061
|
}
|
|
4055
|
-
) : /* @__PURE__ */
|
|
4062
|
+
) : /* @__PURE__ */ m("div", { className: B, children: [
|
|
4056
4063
|
/* @__PURE__ */ n(
|
|
4057
4064
|
ae,
|
|
4058
4065
|
{
|
|
4059
|
-
id: ((
|
|
4060
|
-
name:
|
|
4061
|
-
image:
|
|
4062
|
-
starred: s &&
|
|
4066
|
+
id: ((E = N == null ? void 0 : N.user) == null ? void 0 : E.id) || p.id || "unknown",
|
|
4067
|
+
name: I,
|
|
4068
|
+
image: L,
|
|
4069
|
+
starred: s && A,
|
|
4063
4070
|
dmAgentEnabled: a,
|
|
4064
4071
|
size: 48
|
|
4065
4072
|
}
|
|
4066
4073
|
),
|
|
4067
|
-
/* @__PURE__ */
|
|
4074
|
+
/* @__PURE__ */ m("p", { className: "flex max-w-full items-center justify-center gap-0.5", children: [
|
|
4068
4075
|
z,
|
|
4069
4076
|
/* @__PURE__ */ n(
|
|
4070
4077
|
we,
|
|
@@ -4074,58 +4081,58 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4074
4081
|
}
|
|
4075
4082
|
)
|
|
4076
4083
|
] }),
|
|
4077
|
-
a && /* @__PURE__ */
|
|
4084
|
+
a && /* @__PURE__ */ m("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4078
4085
|
/* @__PURE__ */ n(_e, { className: "size-3 shrink-0 text-black/55" }),
|
|
4079
4086
|
/* @__PURE__ */ n("span", { children: Pe })
|
|
4080
4087
|
] })
|
|
4081
4088
|
] })
|
|
4082
4089
|
}
|
|
4083
4090
|
),
|
|
4084
|
-
/* @__PURE__ */
|
|
4091
|
+
/* @__PURE__ */ m("div", { className: "flex justify-end items-center gap-2", children: [
|
|
4085
4092
|
s && /* @__PURE__ */ n(
|
|
4086
4093
|
"button",
|
|
4087
4094
|
{
|
|
4088
4095
|
className: fe,
|
|
4089
4096
|
onClick: k,
|
|
4090
4097
|
type: "button",
|
|
4091
|
-
"aria-label":
|
|
4098
|
+
"aria-label": A ? "Unstar conversation" : "Star conversation",
|
|
4092
4099
|
children: /* @__PURE__ */ n(
|
|
4093
4100
|
Ke,
|
|
4094
4101
|
{
|
|
4095
|
-
className:
|
|
4096
|
-
"text-yellow-600":
|
|
4097
|
-
"text-black/90": !
|
|
4102
|
+
className: y("size-5", {
|
|
4103
|
+
"text-yellow-600": A,
|
|
4104
|
+
"text-black/90": !A
|
|
4098
4105
|
}),
|
|
4099
|
-
weight:
|
|
4106
|
+
weight: A ? "duotone" : "regular"
|
|
4100
4107
|
}
|
|
4101
4108
|
)
|
|
4102
4109
|
}
|
|
4103
4110
|
),
|
|
4104
|
-
v && (
|
|
4111
|
+
v && (l !== void 0 ? l : /* @__PURE__ */ n(
|
|
4105
4112
|
qt,
|
|
4106
4113
|
{
|
|
4107
4114
|
channel: p,
|
|
4108
4115
|
participant: N,
|
|
4109
|
-
showDeleteConversation:
|
|
4110
|
-
showBlockParticipant:
|
|
4116
|
+
showDeleteConversation: c,
|
|
4117
|
+
showBlockParticipant: o,
|
|
4111
4118
|
showReportParticipant: d,
|
|
4112
4119
|
onLeaveConversation: r,
|
|
4113
4120
|
onBlockParticipant: i,
|
|
4114
4121
|
onDeleteConversationClick: u,
|
|
4115
4122
|
onBlockParticipantClick: g,
|
|
4116
|
-
onReportParticipantClick:
|
|
4123
|
+
onReportParticipantClick: h,
|
|
4117
4124
|
customChannelActions: f,
|
|
4118
|
-
triggerClassName:
|
|
4125
|
+
triggerClassName: y(fe, "bg-[#F1F0EE]")
|
|
4119
4126
|
}
|
|
4120
4127
|
))
|
|
4121
4128
|
] })
|
|
4122
4129
|
] }),
|
|
4123
|
-
/* @__PURE__ */
|
|
4124
|
-
/* @__PURE__ */
|
|
4130
|
+
/* @__PURE__ */ m("div", { className: "px-6 py-3 hidden @lg:flex items-center justify-between gap-3 min-h-12 border-b border-b-black/[0.08]", children: [
|
|
4131
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-4 min-w-0", "data-dd-privacy": "mask", children: [
|
|
4125
4132
|
t && e && /* @__PURE__ */ n(
|
|
4126
4133
|
"button",
|
|
4127
4134
|
{
|
|
4128
|
-
className:
|
|
4135
|
+
className: y(
|
|
4129
4136
|
fe,
|
|
4130
4137
|
"messaging-channel-view-back-button-desktop"
|
|
4131
4138
|
),
|
|
@@ -4135,54 +4142,54 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4135
4142
|
children: /* @__PURE__ */ n(Gt, { className: "size-5 text-black/90" })
|
|
4136
4143
|
}
|
|
4137
4144
|
),
|
|
4138
|
-
w ? /* @__PURE__ */
|
|
4145
|
+
w ? /* @__PURE__ */ m(
|
|
4139
4146
|
"button",
|
|
4140
4147
|
{
|
|
4141
4148
|
type: "button",
|
|
4142
4149
|
onClick: w,
|
|
4143
|
-
"aria-label": `View details for ${
|
|
4144
|
-
className:
|
|
4145
|
-
|
|
4150
|
+
"aria-label": `View details for ${I}`,
|
|
4151
|
+
className: y(
|
|
4152
|
+
j,
|
|
4146
4153
|
"appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
|
|
4147
4154
|
),
|
|
4148
4155
|
children: [
|
|
4149
4156
|
/* @__PURE__ */ n(
|
|
4150
4157
|
ae,
|
|
4151
4158
|
{
|
|
4152
|
-
id: ((
|
|
4153
|
-
name:
|
|
4154
|
-
image:
|
|
4155
|
-
starred: s &&
|
|
4159
|
+
id: ((R = N == null ? void 0 : N.user) == null ? void 0 : R.id) || p.id || "unknown",
|
|
4160
|
+
name: I,
|
|
4161
|
+
image: L,
|
|
4162
|
+
starred: s && A,
|
|
4156
4163
|
dmAgentEnabled: a,
|
|
4157
4164
|
size: 48
|
|
4158
4165
|
}
|
|
4159
4166
|
),
|
|
4160
|
-
/* @__PURE__ */
|
|
4161
|
-
/* @__PURE__ */
|
|
4167
|
+
/* @__PURE__ */ m("div", { className: "min-w-0", children: [
|
|
4168
|
+
/* @__PURE__ */ m("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4162
4169
|
z,
|
|
4163
4170
|
/* @__PURE__ */ n(we, { className: "size-4 shrink-0", weight: "bold" })
|
|
4164
4171
|
] }),
|
|
4165
|
-
a && /* @__PURE__ */
|
|
4172
|
+
a && /* @__PURE__ */ m("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4166
4173
|
/* @__PURE__ */ n(_e, { className: "size-3 shrink-0 text-black/55" }),
|
|
4167
4174
|
/* @__PURE__ */ n("span", { className: "truncate", children: Pe })
|
|
4168
4175
|
] })
|
|
4169
4176
|
] })
|
|
4170
4177
|
]
|
|
4171
4178
|
}
|
|
4172
|
-
) : /* @__PURE__ */
|
|
4179
|
+
) : /* @__PURE__ */ m("div", { className: j, children: [
|
|
4173
4180
|
/* @__PURE__ */ n(
|
|
4174
4181
|
ae,
|
|
4175
4182
|
{
|
|
4176
4183
|
id: ((O = N == null ? void 0 : N.user) == null ? void 0 : O.id) || p.id || "unknown",
|
|
4177
|
-
name:
|
|
4178
|
-
image:
|
|
4179
|
-
starred: s &&
|
|
4184
|
+
name: I,
|
|
4185
|
+
image: L,
|
|
4186
|
+
starred: s && A,
|
|
4180
4187
|
dmAgentEnabled: a,
|
|
4181
4188
|
size: 48
|
|
4182
4189
|
}
|
|
4183
4190
|
),
|
|
4184
|
-
/* @__PURE__ */
|
|
4185
|
-
/* @__PURE__ */
|
|
4191
|
+
/* @__PURE__ */ m("div", { className: "min-w-0", children: [
|
|
4192
|
+
/* @__PURE__ */ m("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
|
|
4186
4193
|
z,
|
|
4187
4194
|
/* @__PURE__ */ n(
|
|
4188
4195
|
we,
|
|
@@ -4192,46 +4199,46 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4192
4199
|
}
|
|
4193
4200
|
)
|
|
4194
4201
|
] }),
|
|
4195
|
-
a && /* @__PURE__ */
|
|
4202
|
+
a && /* @__PURE__ */ m("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
|
|
4196
4203
|
/* @__PURE__ */ n(_e, { className: "size-3 shrink-0 text-black/55" }),
|
|
4197
4204
|
/* @__PURE__ */ n("span", { className: "truncate", children: Pe })
|
|
4198
4205
|
] })
|
|
4199
4206
|
] })
|
|
4200
4207
|
] })
|
|
4201
4208
|
] }),
|
|
4202
|
-
/* @__PURE__ */
|
|
4209
|
+
/* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
|
|
4203
4210
|
s && /* @__PURE__ */ n(
|
|
4204
4211
|
"button",
|
|
4205
4212
|
{
|
|
4206
4213
|
className: fe,
|
|
4207
4214
|
onClick: k,
|
|
4208
4215
|
type: "button",
|
|
4209
|
-
"aria-label":
|
|
4216
|
+
"aria-label": A ? "Unstar conversation" : "Star conversation",
|
|
4210
4217
|
children: /* @__PURE__ */ n(
|
|
4211
4218
|
Ke,
|
|
4212
4219
|
{
|
|
4213
|
-
className:
|
|
4214
|
-
"text-yellow-600":
|
|
4215
|
-
"text-black/90": !
|
|
4220
|
+
className: y("size-6", {
|
|
4221
|
+
"text-yellow-600": A,
|
|
4222
|
+
"text-black/90": !A
|
|
4216
4223
|
}),
|
|
4217
|
-
weight:
|
|
4224
|
+
weight: A ? "duotone" : "regular"
|
|
4218
4225
|
}
|
|
4219
4226
|
)
|
|
4220
4227
|
}
|
|
4221
4228
|
),
|
|
4222
|
-
v && (
|
|
4229
|
+
v && (l !== void 0 ? l : /* @__PURE__ */ n(
|
|
4223
4230
|
qt,
|
|
4224
4231
|
{
|
|
4225
4232
|
channel: p,
|
|
4226
4233
|
participant: N,
|
|
4227
|
-
showDeleteConversation:
|
|
4228
|
-
showBlockParticipant:
|
|
4234
|
+
showDeleteConversation: c,
|
|
4235
|
+
showBlockParticipant: o,
|
|
4229
4236
|
showReportParticipant: d,
|
|
4230
4237
|
onLeaveConversation: r,
|
|
4231
4238
|
onBlockParticipant: i,
|
|
4232
4239
|
onDeleteConversationClick: u,
|
|
4233
4240
|
onBlockParticipantClick: g,
|
|
4234
|
-
onReportParticipantClick:
|
|
4241
|
+
onReportParticipantClick: h,
|
|
4235
4242
|
customChannelActions: f,
|
|
4236
4243
|
triggerClassName: fe
|
|
4237
4244
|
}
|
|
@@ -4246,100 +4253,100 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4246
4253
|
renderMessageInputFooter: a,
|
|
4247
4254
|
renderConversationFooter: r,
|
|
4248
4255
|
onLeaveConversation: i,
|
|
4249
|
-
onBlockParticipant:
|
|
4250
|
-
showDeleteConversation:
|
|
4256
|
+
onBlockParticipant: c,
|
|
4257
|
+
showDeleteConversation: o = !0,
|
|
4251
4258
|
onDeleteConversationClick: d,
|
|
4252
4259
|
onBlockParticipantClick: u,
|
|
4253
4260
|
onReportParticipantClick: g,
|
|
4254
|
-
showBlockParticipant:
|
|
4261
|
+
showBlockParticipant: h = !0,
|
|
4255
4262
|
showReportParticipant: f = !0,
|
|
4256
|
-
composerDisabled:
|
|
4263
|
+
composerDisabled: l = !1,
|
|
4257
4264
|
composerDisabledReason: v,
|
|
4258
4265
|
showStarButton: w = !1,
|
|
4259
4266
|
chatbotVotingEnabled: b = !1,
|
|
4260
4267
|
renderChannelBanner: p,
|
|
4261
4268
|
renderHeaderTitleBadges: _,
|
|
4262
4269
|
customChannelActions: N,
|
|
4263
|
-
renderChannelActions:
|
|
4264
|
-
renderMessage:
|
|
4265
|
-
dmAgentEnabled:
|
|
4270
|
+
renderChannelActions: I,
|
|
4271
|
+
renderMessage: L,
|
|
4272
|
+
dmAgentEnabled: A = !1,
|
|
4266
4273
|
viewerLanguage: D,
|
|
4267
|
-
showChannelInfo:
|
|
4268
|
-
onParticipantNameClick:
|
|
4274
|
+
showChannelInfo: B = !0,
|
|
4275
|
+
onParticipantNameClick: j,
|
|
4269
4276
|
composerInput: z
|
|
4270
4277
|
}) => {
|
|
4271
|
-
var
|
|
4272
|
-
const { channel: k } = pe(), { client:
|
|
4278
|
+
var X, ee, q, x;
|
|
4279
|
+
const { channel: k } = pe(), { client: T } = be(), C = V.useMemo(
|
|
4273
4280
|
() => {
|
|
4274
|
-
var
|
|
4281
|
+
var S;
|
|
4275
4282
|
return st(
|
|
4276
|
-
(
|
|
4277
|
-
|
|
4283
|
+
(S = k.state) == null ? void 0 : S.members,
|
|
4284
|
+
T == null ? void 0 : T.userID,
|
|
4278
4285
|
k.type
|
|
4279
4286
|
);
|
|
4280
4287
|
},
|
|
4281
|
-
[(
|
|
4282
|
-
),
|
|
4288
|
+
[(X = k.state) == null ? void 0 : X.members, T == null ? void 0 : T.userID, k.type]
|
|
4289
|
+
), M = V.useMemo(() => {
|
|
4283
4290
|
var G;
|
|
4284
|
-
const
|
|
4285
|
-
return
|
|
4286
|
-
var
|
|
4287
|
-
return ((
|
|
4291
|
+
const S = T == null ? void 0 : T.userID;
|
|
4292
|
+
return S ? Object.values(((G = k.state) == null ? void 0 : G.members) || {}).find((Z) => {
|
|
4293
|
+
var F;
|
|
4294
|
+
return ((F = Z.user) == null ? void 0 : F.id) === S;
|
|
4288
4295
|
}) : void 0;
|
|
4289
|
-
}, [
|
|
4290
|
-
(
|
|
4296
|
+
}, [T == null ? void 0 : T.userID, (ee = k.state) == null ? void 0 : ee.members]), E = ((q = M == null ? void 0 : M.user) == null ? void 0 : q.is_account) ?? (M == null ? void 0 : M.is_account), R = ((x = C == null ? void 0 : C.user) == null ? void 0 : x.is_account) ?? (C == null ? void 0 : C.is_account), O = A && E === !1 && R === !0, U = K(
|
|
4297
|
+
(S) => {
|
|
4291
4298
|
const { message: H } = Ee("ChannelView"), G = /* @__PURE__ */ n(
|
|
4292
4299
|
di,
|
|
4293
4300
|
{
|
|
4294
|
-
...
|
|
4301
|
+
...S,
|
|
4295
4302
|
chatbotVotingEnabled: b,
|
|
4296
4303
|
viewerLanguage: D
|
|
4297
4304
|
}
|
|
4298
4305
|
);
|
|
4299
|
-
return !
|
|
4306
|
+
return !L || !H ? G : L(G, H);
|
|
4300
4307
|
},
|
|
4301
|
-
[b,
|
|
4308
|
+
[b, L, D]
|
|
4302
4309
|
);
|
|
4303
4310
|
return /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(
|
|
4304
4311
|
ys,
|
|
4305
4312
|
{
|
|
4306
4313
|
overrides: {
|
|
4307
|
-
Message:
|
|
4314
|
+
Message: U,
|
|
4308
4315
|
MessageActions: hi
|
|
4309
4316
|
},
|
|
4310
|
-
children: /* @__PURE__ */
|
|
4317
|
+
children: /* @__PURE__ */ m(ks, { children: [
|
|
4311
4318
|
/* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
|
|
4312
4319
|
Di,
|
|
4313
4320
|
{
|
|
4314
4321
|
onBack: e,
|
|
4315
4322
|
showBackButton: t,
|
|
4316
|
-
showChannelInfo:
|
|
4323
|
+
showChannelInfo: B,
|
|
4317
4324
|
showStarButton: w,
|
|
4318
4325
|
dmAgentEnabled: O,
|
|
4319
4326
|
onLeaveConversation: i,
|
|
4320
|
-
onBlockParticipant:
|
|
4321
|
-
showDeleteConversation:
|
|
4322
|
-
showBlockParticipant:
|
|
4327
|
+
onBlockParticipant: c,
|
|
4328
|
+
showDeleteConversation: o,
|
|
4329
|
+
showBlockParticipant: h,
|
|
4323
4330
|
showReportParticipant: f,
|
|
4324
4331
|
onDeleteConversationClick: d,
|
|
4325
4332
|
onBlockParticipantClick: u,
|
|
4326
4333
|
onReportParticipantClick: g,
|
|
4327
4334
|
customChannelActions: N,
|
|
4328
|
-
renderChannelActions:
|
|
4329
|
-
onParticipantNameClick:
|
|
4335
|
+
renderChannelActions: I,
|
|
4336
|
+
onParticipantNameClick: j,
|
|
4330
4337
|
renderHeaderTitleBadges: _
|
|
4331
4338
|
}
|
|
4332
4339
|
) }, "lt-channel-header"),
|
|
4333
|
-
p ? /* @__PURE__ */ n(
|
|
4340
|
+
p ? /* @__PURE__ */ n(V.Fragment, { children: p() }, "lt-channel-banner") : null,
|
|
4334
4341
|
/* @__PURE__ */ n(
|
|
4335
4342
|
"div",
|
|
4336
4343
|
{
|
|
4337
4344
|
className: "flex-1 overflow-hidden relative",
|
|
4338
|
-
children: /* @__PURE__ */ n(
|
|
4345
|
+
children: /* @__PURE__ */ n(Cs, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
|
|
4339
4346
|
},
|
|
4340
4347
|
"lt-channel-message-list"
|
|
4341
4348
|
),
|
|
4342
|
-
r ? /* @__PURE__ */ n(
|
|
4349
|
+
r ? /* @__PURE__ */ n(V.Fragment, { children: r(k) }, "lt-channel-conversation-footer") : null,
|
|
4343
4350
|
/* @__PURE__ */ n(
|
|
4344
4351
|
xi,
|
|
4345
4352
|
{
|
|
@@ -4347,7 +4354,7 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4347
4354
|
renderActions: () => s == null ? void 0 : s(k)
|
|
4348
4355
|
},
|
|
4349
4356
|
renderFooter: () => a == null ? void 0 : a(k),
|
|
4350
|
-
disabled:
|
|
4357
|
+
disabled: l,
|
|
4351
4358
|
disabledReason: v,
|
|
4352
4359
|
composerInput: z
|
|
4353
4360
|
},
|
|
@@ -4356,7 +4363,7 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4356
4363
|
] })
|
|
4357
4364
|
}
|
|
4358
4365
|
) });
|
|
4359
|
-
}, Fn =
|
|
4366
|
+
}, Fn = V.memo(
|
|
4360
4367
|
({
|
|
4361
4368
|
channel: e,
|
|
4362
4369
|
onBack: t,
|
|
@@ -4364,38 +4371,38 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4364
4371
|
renderMessageInputActions: a,
|
|
4365
4372
|
renderMessageInputFooter: r,
|
|
4366
4373
|
renderConversationFooter: i,
|
|
4367
|
-
onLeaveConversation:
|
|
4368
|
-
onBlockParticipant:
|
|
4374
|
+
onLeaveConversation: c,
|
|
4375
|
+
onBlockParticipant: o,
|
|
4369
4376
|
className: d,
|
|
4370
4377
|
CustomChannelEmptyState: u = Ri,
|
|
4371
4378
|
showDeleteConversation: g = !0,
|
|
4372
|
-
onDeleteConversationClick:
|
|
4379
|
+
onDeleteConversationClick: h,
|
|
4373
4380
|
onBlockParticipantClick: f,
|
|
4374
|
-
onReportParticipantClick:
|
|
4381
|
+
onReportParticipantClick: l,
|
|
4375
4382
|
showBlockParticipant: v = !0,
|
|
4376
4383
|
showReportParticipant: w = !0,
|
|
4377
4384
|
composerDisabled: b = !1,
|
|
4378
4385
|
composerDisabledReason: p,
|
|
4379
4386
|
dmAgentEnabled: _,
|
|
4380
4387
|
messageMetadata: N,
|
|
4381
|
-
onMessageSent:
|
|
4382
|
-
showStarButton:
|
|
4383
|
-
chatbotVotingEnabled:
|
|
4388
|
+
onMessageSent: I,
|
|
4389
|
+
showStarButton: L = !1,
|
|
4390
|
+
chatbotVotingEnabled: A = !1,
|
|
4384
4391
|
renderChannelBanner: D,
|
|
4385
|
-
renderHeaderTitleBadges:
|
|
4386
|
-
customChannelActions:
|
|
4392
|
+
renderHeaderTitleBadges: B,
|
|
4393
|
+
customChannelActions: j,
|
|
4387
4394
|
renderChannelActions: z,
|
|
4388
4395
|
renderMessage: k,
|
|
4389
|
-
onMessageLinkClick:
|
|
4390
|
-
sendButton:
|
|
4391
|
-
attachmentPreviewList:
|
|
4392
|
-
viewerLanguage:
|
|
4393
|
-
showChannelInfo:
|
|
4396
|
+
onMessageLinkClick: T,
|
|
4397
|
+
sendButton: C,
|
|
4398
|
+
attachmentPreviewList: M,
|
|
4399
|
+
viewerLanguage: E,
|
|
4400
|
+
showChannelInfo: R = !0,
|
|
4394
4401
|
onParticipantNameClick: O,
|
|
4395
|
-
composerInput:
|
|
4402
|
+
composerInput: U
|
|
4396
4403
|
}) => {
|
|
4397
|
-
const
|
|
4398
|
-
async (q, x,
|
|
4404
|
+
const X = K(
|
|
4405
|
+
async (q, x, S) => {
|
|
4399
4406
|
var J;
|
|
4400
4407
|
const H = ((J = e.data) == null ? void 0 : J.chatbot_paused) === !0, G = _ && !H, Z = {
|
|
4401
4408
|
...x,
|
|
@@ -4406,30 +4413,30 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4406
4413
|
...N
|
|
4407
4414
|
}
|
|
4408
4415
|
}
|
|
4409
|
-
},
|
|
4410
|
-
...
|
|
4416
|
+
}, F = {
|
|
4417
|
+
...S,
|
|
4411
4418
|
...G && { skip_push: !0 }
|
|
4412
|
-
}, Q = await e.sendMessage(Z,
|
|
4413
|
-
return
|
|
4419
|
+
}, Q = await e.sendMessage(Z, F);
|
|
4420
|
+
return I == null || I(Q), Q;
|
|
4414
4421
|
},
|
|
4415
|
-
[e, _, N,
|
|
4422
|
+
[e, _, N, I]
|
|
4416
4423
|
), ee = Y(null);
|
|
4417
4424
|
return W(() => {
|
|
4418
|
-
if (!
|
|
4425
|
+
if (!T) return;
|
|
4419
4426
|
const q = ee.current;
|
|
4420
4427
|
if (!q) return;
|
|
4421
|
-
const x = (
|
|
4422
|
-
const H =
|
|
4428
|
+
const x = (S) => {
|
|
4429
|
+
const H = S.target, G = H == null ? void 0 : H.closest("a[href]"), Z = G == null ? void 0 : G.getAttribute("href");
|
|
4423
4430
|
if (!Z) return;
|
|
4424
|
-
const
|
|
4425
|
-
|
|
4431
|
+
const F = G == null ? void 0 : G.closest("[data-message-id]"), Q = F == null ? void 0 : F.getAttribute("data-message-id"), J = Q ? e.state.messages.find((Me) => Me.id === Q) : void 0;
|
|
4432
|
+
T(Z, J);
|
|
4426
4433
|
};
|
|
4427
4434
|
return q.addEventListener("click", x), () => q.removeEventListener("click", x);
|
|
4428
|
-
}, [
|
|
4435
|
+
}, [T, e]), /* @__PURE__ */ n(
|
|
4429
4436
|
"div",
|
|
4430
4437
|
{
|
|
4431
4438
|
ref: ee,
|
|
4432
|
-
className:
|
|
4439
|
+
className: y(
|
|
4433
4440
|
"messaging-channel-view h-full flex flex-col",
|
|
4434
4441
|
d
|
|
4435
4442
|
),
|
|
@@ -4442,9 +4449,9 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4442
4449
|
LoadingIndicator: $e,
|
|
4443
4450
|
DateSeparator: oa,
|
|
4444
4451
|
TypingIndicator: Ai,
|
|
4445
|
-
doSendMessageRequest:
|
|
4446
|
-
...
|
|
4447
|
-
...
|
|
4452
|
+
doSendMessageRequest: X,
|
|
4453
|
+
...C ? { SendButton: C } : {},
|
|
4454
|
+
...M ? { AttachmentPreviewList: M } : {},
|
|
4448
4455
|
children: /* @__PURE__ */ n(
|
|
4449
4456
|
Pi,
|
|
4450
4457
|
{
|
|
@@ -4453,29 +4460,29 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4453
4460
|
renderMessageInputActions: a,
|
|
4454
4461
|
renderMessageInputFooter: r,
|
|
4455
4462
|
renderConversationFooter: i,
|
|
4456
|
-
onLeaveConversation:
|
|
4457
|
-
onBlockParticipant:
|
|
4463
|
+
onLeaveConversation: c,
|
|
4464
|
+
onBlockParticipant: o,
|
|
4458
4465
|
CustomChannelEmptyState: u,
|
|
4459
4466
|
showDeleteConversation: g,
|
|
4460
|
-
onDeleteConversationClick:
|
|
4467
|
+
onDeleteConversationClick: h,
|
|
4461
4468
|
onBlockParticipantClick: f,
|
|
4462
|
-
onReportParticipantClick:
|
|
4469
|
+
onReportParticipantClick: l,
|
|
4463
4470
|
showBlockParticipant: v,
|
|
4464
4471
|
showReportParticipant: w,
|
|
4465
4472
|
composerDisabled: b,
|
|
4466
4473
|
composerDisabledReason: p,
|
|
4467
|
-
showStarButton:
|
|
4474
|
+
showStarButton: L,
|
|
4468
4475
|
dmAgentEnabled: _,
|
|
4469
|
-
chatbotVotingEnabled:
|
|
4476
|
+
chatbotVotingEnabled: A,
|
|
4470
4477
|
renderChannelBanner: D,
|
|
4471
|
-
renderHeaderTitleBadges:
|
|
4472
|
-
customChannelActions:
|
|
4478
|
+
renderHeaderTitleBadges: B,
|
|
4479
|
+
customChannelActions: j,
|
|
4473
4480
|
renderChannelActions: z,
|
|
4474
4481
|
renderMessage: k,
|
|
4475
|
-
viewerLanguage:
|
|
4476
|
-
showChannelInfo:
|
|
4482
|
+
viewerLanguage: E,
|
|
4483
|
+
showChannelInfo: R,
|
|
4477
4484
|
onParticipantNameClick: O,
|
|
4478
|
-
composerInput:
|
|
4485
|
+
composerInput: U
|
|
4479
4486
|
}
|
|
4480
4487
|
)
|
|
4481
4488
|
}
|
|
@@ -4485,7 +4492,7 @@ const fe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
|
|
|
4485
4492
|
}
|
|
4486
4493
|
);
|
|
4487
4494
|
Fn.displayName = "ChannelView";
|
|
4488
|
-
const Ne =
|
|
4495
|
+
const Ne = V.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: [
|
|
4489
4496
|
/* @__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: "⚠️" }) }),
|
|
4490
4497
|
/* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
4491
4498
|
/* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
|
|
@@ -4507,86 +4514,86 @@ const no = ({
|
|
|
4507
4514
|
onChannelSelect: a,
|
|
4508
4515
|
onExitConversation: r,
|
|
4509
4516
|
initialParticipantFilter: i,
|
|
4510
|
-
initialParticipantData:
|
|
4511
|
-
CustomChannelEmptyState:
|
|
4517
|
+
initialParticipantData: c,
|
|
4518
|
+
CustomChannelEmptyState: o,
|
|
4512
4519
|
onBlockParticipantClick: d,
|
|
4513
4520
|
onReportParticipantClick: u,
|
|
4514
4521
|
dmAgentEnabled: g,
|
|
4515
|
-
onMessageSent:
|
|
4522
|
+
onMessageSent: h,
|
|
4516
4523
|
chatbotVotingEnabled: f = !1,
|
|
4517
|
-
viewerLanguage:
|
|
4524
|
+
viewerLanguage: l,
|
|
4518
4525
|
renderHeaderTitleBadges: v,
|
|
4519
4526
|
renderChannelBanner: w,
|
|
4520
4527
|
customChannelActions: b,
|
|
4521
4528
|
renderChannelActions: p,
|
|
4522
4529
|
onParticipantNameClick: _,
|
|
4523
4530
|
renderMessage: N,
|
|
4524
|
-
onMessageLinkClick:
|
|
4525
|
-
showChannelInfo:
|
|
4526
|
-
composerInput:
|
|
4531
|
+
onMessageLinkClick: I,
|
|
4532
|
+
showChannelInfo: L,
|
|
4533
|
+
composerInput: A
|
|
4527
4534
|
}) => {
|
|
4528
4535
|
const {
|
|
4529
4536
|
client: D,
|
|
4530
|
-
isConnected:
|
|
4531
|
-
isLoading:
|
|
4537
|
+
isConnected: B,
|
|
4538
|
+
isLoading: j,
|
|
4532
4539
|
error: z,
|
|
4533
4540
|
refreshConnection: k,
|
|
4534
|
-
service:
|
|
4535
|
-
debug:
|
|
4536
|
-
} = Js(), [
|
|
4537
|
-
q.current =
|
|
4541
|
+
service: T,
|
|
4542
|
+
debug: C
|
|
4543
|
+
} = Js(), [M, E] = $(null), [R, O] = $(null), [U, X] = $(!1), { showDeleteConversation: ee = !0 } = e, q = Y(c);
|
|
4544
|
+
q.current = c;
|
|
4538
4545
|
const x = Y(a);
|
|
4539
4546
|
x.current = a;
|
|
4540
|
-
const
|
|
4547
|
+
const S = Y(null), H = Y(null);
|
|
4541
4548
|
W(() => {
|
|
4542
|
-
H.current =
|
|
4543
|
-
}, [
|
|
4544
|
-
if (!D || !
|
|
4545
|
-
const
|
|
4546
|
-
if (
|
|
4547
|
-
const Q = `${
|
|
4548
|
-
if (
|
|
4549
|
-
|
|
4549
|
+
H.current = M;
|
|
4550
|
+
}, [M]), W(() => {
|
|
4551
|
+
if (!D || !B) return;
|
|
4552
|
+
const F = D.userID;
|
|
4553
|
+
if (!F) return;
|
|
4554
|
+
const Q = `${F}::${i}`;
|
|
4555
|
+
if (S.current === Q) return;
|
|
4556
|
+
S.current = Q;
|
|
4550
4557
|
const J = () => {
|
|
4551
|
-
|
|
4558
|
+
S.current === Q && (S.current = null);
|
|
4552
4559
|
};
|
|
4553
4560
|
(async () => {
|
|
4554
4561
|
var Re, Le;
|
|
4555
4562
|
try {
|
|
4556
|
-
|
|
4563
|
+
C && console.log(
|
|
4557
4564
|
"[MessagingShell] Loading initial conversation with:",
|
|
4558
4565
|
i
|
|
4559
4566
|
);
|
|
4560
4567
|
const ne = await D.queryChannels(
|
|
4561
4568
|
{
|
|
4562
4569
|
type: "messaging",
|
|
4563
|
-
members: { $eq: [
|
|
4570
|
+
members: { $eq: [F, i] }
|
|
4564
4571
|
},
|
|
4565
4572
|
{},
|
|
4566
4573
|
{ limit: 1 }
|
|
4567
4574
|
);
|
|
4568
4575
|
if (ne.length > 0) {
|
|
4569
|
-
|
|
4576
|
+
E(ne[0]), O(null), (Re = x.current) == null || Re.call(x, ne[0]), C && console.log(
|
|
4570
4577
|
"[MessagingShell] Initial conversation loaded:",
|
|
4571
4578
|
ne[0].id
|
|
4572
4579
|
);
|
|
4573
4580
|
return;
|
|
4574
4581
|
}
|
|
4575
4582
|
const le = q.current;
|
|
4576
|
-
if (!le || !
|
|
4577
|
-
J(), O("No conversation found with this account"),
|
|
4583
|
+
if (!le || !T) {
|
|
4584
|
+
J(), O("No conversation found with this account"), C && console.log(
|
|
4578
4585
|
"[MessagingShell] No conversation found for:",
|
|
4579
4586
|
i
|
|
4580
4587
|
);
|
|
4581
4588
|
return;
|
|
4582
4589
|
}
|
|
4583
4590
|
try {
|
|
4584
|
-
const ie = await
|
|
4591
|
+
const ie = await T.startChannelWithParticipant({
|
|
4585
4592
|
id: le.id,
|
|
4586
4593
|
name: le.name,
|
|
4587
4594
|
phone: le.phone
|
|
4588
4595
|
});
|
|
4589
|
-
|
|
4596
|
+
E(ie), O(null), (Le = x.current) == null || Le.call(x, ie), C && console.log(
|
|
4590
4597
|
"[MessagingShell] Channel created and loaded:",
|
|
4591
4598
|
ie.id
|
|
4592
4599
|
);
|
|
@@ -4603,46 +4610,46 @@ const no = ({
|
|
|
4603
4610
|
), J(), H.current || O("Failed to load conversation");
|
|
4604
4611
|
}
|
|
4605
4612
|
})();
|
|
4606
|
-
}, [i, D,
|
|
4613
|
+
}, [i, D, B, T, C]);
|
|
4607
4614
|
const G = Y(r);
|
|
4608
4615
|
G.current = r;
|
|
4609
|
-
const Z =
|
|
4610
|
-
var
|
|
4611
|
-
|
|
4616
|
+
const Z = K(() => {
|
|
4617
|
+
var F;
|
|
4618
|
+
E(null), X(!0), (F = G.current) == null || F.call(G);
|
|
4612
4619
|
}, []);
|
|
4613
|
-
return
|
|
4620
|
+
return j ? /* @__PURE__ */ n($e, {}) : z ? /* @__PURE__ */ n(Ne, { message: z, onBack: k }) : !B || !D ? /* @__PURE__ */ n(
|
|
4614
4621
|
Ne,
|
|
4615
4622
|
{
|
|
4616
4623
|
message: "Not connected to messaging service",
|
|
4617
4624
|
onBack: k
|
|
4618
4625
|
}
|
|
4619
|
-
) :
|
|
4626
|
+
) : R ? /* @__PURE__ */ n(Ne, { message: R }) : U && !M ? /* @__PURE__ */ n(Ne, { message: "Conversation ended" }) : M ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
|
|
4620
4627
|
Fn,
|
|
4621
4628
|
{
|
|
4622
|
-
channel:
|
|
4629
|
+
channel: M,
|
|
4623
4630
|
renderMessageInputActions: t,
|
|
4624
4631
|
renderConversationFooter: s,
|
|
4625
4632
|
renderChannelBanner: w,
|
|
4626
4633
|
onLeaveConversation: Z,
|
|
4627
4634
|
onBlockParticipant: Z,
|
|
4628
|
-
CustomChannelEmptyState:
|
|
4635
|
+
CustomChannelEmptyState: o,
|
|
4629
4636
|
showDeleteConversation: ee,
|
|
4630
4637
|
onBlockParticipantClick: d,
|
|
4631
4638
|
onReportParticipantClick: u,
|
|
4632
4639
|
dmAgentEnabled: g,
|
|
4633
|
-
onMessageSent:
|
|
4640
|
+
onMessageSent: h,
|
|
4634
4641
|
chatbotVotingEnabled: f,
|
|
4635
|
-
viewerLanguage:
|
|
4642
|
+
viewerLanguage: l,
|
|
4636
4643
|
renderHeaderTitleBadges: v,
|
|
4637
4644
|
customChannelActions: b,
|
|
4638
4645
|
renderChannelActions: p,
|
|
4639
4646
|
onParticipantNameClick: _,
|
|
4640
4647
|
renderMessage: N,
|
|
4641
|
-
onMessageLinkClick:
|
|
4642
|
-
showChannelInfo:
|
|
4643
|
-
composerInput:
|
|
4648
|
+
onMessageLinkClick: I,
|
|
4649
|
+
showChannelInfo: L,
|
|
4650
|
+
composerInput: A
|
|
4644
4651
|
},
|
|
4645
|
-
|
|
4652
|
+
M.id
|
|
4646
4653
|
) }) }) : /* @__PURE__ */ n($e, {});
|
|
4647
4654
|
};
|
|
4648
4655
|
function zi(e) {
|
|
@@ -4651,7 +4658,7 @@ function zi(e) {
|
|
|
4651
4658
|
for (const s of t)
|
|
4652
4659
|
e.state.addMessageSorted(s.message);
|
|
4653
4660
|
}
|
|
4654
|
-
const $n =
|
|
4661
|
+
const $n = V.createContext({
|
|
4655
4662
|
selectedChannel: void 0,
|
|
4656
4663
|
onChannelSelect: () => {
|
|
4657
4664
|
},
|
|
@@ -4659,7 +4666,7 @@ const $n = j.createContext({
|
|
|
4659
4666
|
renderMessagePreview: void 0,
|
|
4660
4667
|
channelPreview: void 0,
|
|
4661
4668
|
viewerLanguage: void 0
|
|
4662
|
-
}), Oi = $n.Provider, Fi = () =>
|
|
4669
|
+
}), Oi = $n.Provider, Fi = () => V.useContext($n), $i = (e, t) => {
|
|
4663
4670
|
const s = new Date(
|
|
4664
4671
|
Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
|
|
4665
4672
|
), r = new Date(
|
|
@@ -4680,20 +4687,20 @@ const $n = j.createContext({
|
|
|
4680
4687
|
day: "numeric",
|
|
4681
4688
|
year: "2-digit"
|
|
4682
4689
|
});
|
|
4683
|
-
}, Bn =
|
|
4690
|
+
}, Bn = V.memo(
|
|
4684
4691
|
(e) => {
|
|
4685
|
-
var
|
|
4692
|
+
var B, j, z;
|
|
4686
4693
|
const { channel: t, unread: s } = e, {
|
|
4687
4694
|
selectedChannel: a,
|
|
4688
4695
|
onChannelSelect: r,
|
|
4689
4696
|
debug: i,
|
|
4690
|
-
channelPreview:
|
|
4691
|
-
renderMessagePreview:
|
|
4697
|
+
channelPreview: c,
|
|
4698
|
+
renderMessagePreview: o,
|
|
4692
4699
|
viewerLanguage: d
|
|
4693
|
-
} = Fi(), { client: u } = be(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id),
|
|
4694
|
-
if (
|
|
4700
|
+
} = Fi(), { client: u } = be(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = cn(t);
|
|
4701
|
+
if (c)
|
|
4695
4702
|
return /* @__PURE__ */ n(
|
|
4696
|
-
|
|
4703
|
+
c,
|
|
4697
4704
|
{
|
|
4698
4705
|
...e,
|
|
4699
4706
|
active: g,
|
|
@@ -4704,48 +4711,48 @@ const $n = j.createContext({
|
|
|
4704
4711
|
);
|
|
4705
4712
|
const f = () => {
|
|
4706
4713
|
t && r(t);
|
|
4707
|
-
},
|
|
4708
|
-
const
|
|
4709
|
-
!
|
|
4714
|
+
}, l = (k) => {
|
|
4715
|
+
const T = k.key === "Enter" || k.key === " ", C = k.repeat;
|
|
4716
|
+
!T || C || (k.preventDefault(), f());
|
|
4710
4717
|
}, v = st(
|
|
4711
|
-
(
|
|
4718
|
+
(B = t == null ? void 0 : t.state) == null ? void 0 : B.members,
|
|
4712
4719
|
u == null ? void 0 : u.userID,
|
|
4713
4720
|
t == null ? void 0 : t.type
|
|
4714
|
-
), w = dn(v == null ? void 0 : v.user), b = (
|
|
4715
|
-
var
|
|
4716
|
-
const k = (
|
|
4721
|
+
), w = dn(v == null ? void 0 : v.user), b = (j = v == null ? void 0 : v.user) == null ? void 0 : j.image, p = (() => {
|
|
4722
|
+
var T;
|
|
4723
|
+
const k = (T = t == null ? void 0 : t.state) == null ? void 0 : T.messages;
|
|
4717
4724
|
if (k != null && k.length) {
|
|
4718
|
-
for (let
|
|
4719
|
-
if (k[
|
|
4725
|
+
for (let C = k.length - 1; C >= 0; C--)
|
|
4726
|
+
if (k[C].type !== "system") return k[C];
|
|
4720
4727
|
}
|
|
4721
4728
|
})(), N = (() => {
|
|
4722
|
-
var
|
|
4729
|
+
var R, O, U, X;
|
|
4723
4730
|
const k = mn({
|
|
4724
4731
|
message: p,
|
|
4725
4732
|
viewerLanguage: d
|
|
4726
4733
|
});
|
|
4727
|
-
if (((
|
|
4734
|
+
if (((R = p == null ? void 0 : p.metadata) == null ? void 0 : R.custom_type) === "MESSAGE_TIP") return k ? `💵 ${k}` : "💵 Sent a tip";
|
|
4728
4735
|
if (((O = p == null ? void 0 : p.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_PAID") return k ? `💰 ${k}` : "💰 Sent a message";
|
|
4729
|
-
if (((
|
|
4736
|
+
if (((U = p == null ? void 0 : p.metadata) == null ? void 0 : U.custom_type) === "MESSAGE_ATTACHMENT")
|
|
4730
4737
|
return k ? `📎 ${k}` : "📎 Sent an attachment";
|
|
4731
4738
|
if (k) return k;
|
|
4732
|
-
const
|
|
4733
|
-
return
|
|
4734
|
-
})(),
|
|
4739
|
+
const E = (X = p == null ? void 0 : p.attachments) == null ? void 0 : X[0];
|
|
4740
|
+
return E ? E.og_scrape_url ? E.og_scrape_url : E.type === "image" ? "📷 Sent an image" : E.type === "video" ? "🎥 Sent a video" : E.type === "audio" ? "🎵 Sent audio" : E.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
4741
|
+
})(), I = p != null && p.created_at ? Bi(new Date(p.created_at)) : "", L = p ? ze(p) : !1, A = o ? o(p, N) : `${L ? "✨ " : ""}${N}`, D = s ?? 0;
|
|
4735
4742
|
return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
4736
4743
|
channelId: t == null ? void 0 : t.id,
|
|
4737
4744
|
isSelected: g,
|
|
4738
4745
|
participantName: w,
|
|
4739
4746
|
unreadCount: D,
|
|
4740
|
-
hasTimestamp: !!
|
|
4747
|
+
hasTimestamp: !!I
|
|
4741
4748
|
}), /* @__PURE__ */ n(
|
|
4742
4749
|
"div",
|
|
4743
4750
|
{
|
|
4744
4751
|
role: "button",
|
|
4745
4752
|
tabIndex: 0,
|
|
4746
4753
|
onClick: f,
|
|
4747
|
-
onKeyDown:
|
|
4748
|
-
className:
|
|
4754
|
+
onKeyDown: l,
|
|
4755
|
+
className: y(
|
|
4749
4756
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
|
|
4750
4757
|
{
|
|
4751
4758
|
"bg-black/[0.04]": g,
|
|
@@ -4753,7 +4760,7 @@ const $n = j.createContext({
|
|
|
4753
4760
|
}
|
|
4754
4761
|
),
|
|
4755
4762
|
"data-dd-privacy": "mask",
|
|
4756
|
-
children: /* @__PURE__ */
|
|
4763
|
+
children: /* @__PURE__ */ m("div", { className: "flex items-start gap-4", children: [
|
|
4757
4764
|
/* @__PURE__ */ n(
|
|
4758
4765
|
ae,
|
|
4759
4766
|
{
|
|
@@ -4761,27 +4768,27 @@ const $n = j.createContext({
|
|
|
4761
4768
|
name: w,
|
|
4762
4769
|
image: b,
|
|
4763
4770
|
size: 48,
|
|
4764
|
-
starred:
|
|
4771
|
+
starred: h
|
|
4765
4772
|
}
|
|
4766
4773
|
),
|
|
4767
|
-
/* @__PURE__ */
|
|
4768
|
-
/* @__PURE__ */
|
|
4769
|
-
/* @__PURE__ */
|
|
4774
|
+
/* @__PURE__ */ m("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
4775
|
+
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4776
|
+
/* @__PURE__ */ m(
|
|
4770
4777
|
"h3",
|
|
4771
4778
|
{
|
|
4772
|
-
className:
|
|
4779
|
+
className: y(
|
|
4773
4780
|
"text-sm font-medium truncate text-[#191918]"
|
|
4774
4781
|
),
|
|
4775
4782
|
children: [
|
|
4776
|
-
|
|
4783
|
+
h && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
4777
4784
|
w
|
|
4778
4785
|
]
|
|
4779
4786
|
}
|
|
4780
4787
|
),
|
|
4781
|
-
|
|
4788
|
+
I && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: I })
|
|
4782
4789
|
] }),
|
|
4783
|
-
/* @__PURE__ */
|
|
4784
|
-
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children:
|
|
4790
|
+
/* @__PURE__ */ m("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
4791
|
+
/* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
|
|
4785
4792
|
D > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: D > 99 ? "99+" : D })
|
|
4786
4793
|
] })
|
|
4787
4794
|
] })
|
|
@@ -4791,7 +4798,7 @@ const $n = j.createContext({
|
|
|
4791
4798
|
}
|
|
4792
4799
|
);
|
|
4793
4800
|
Bn.displayName = "CustomChannelPreview";
|
|
4794
|
-
const ji = { last_message_at: -1 }, Ui =
|
|
4801
|
+
const ji = { last_message_at: -1 }, Ui = V.memo(
|
|
4795
4802
|
({
|
|
4796
4803
|
onChannelSelect: e,
|
|
4797
4804
|
selectedChannel: t,
|
|
@@ -4799,16 +4806,16 @@ const ji = { last_message_at: -1 }, Ui = j.memo(
|
|
|
4799
4806
|
allowNewMessagesFromUnfilteredChannels: a = !1,
|
|
4800
4807
|
channelRenderFilterFn: r,
|
|
4801
4808
|
sort: i = ji,
|
|
4802
|
-
className:
|
|
4803
|
-
customEmptyStateIndicator:
|
|
4809
|
+
className: c,
|
|
4810
|
+
customEmptyStateIndicator: o,
|
|
4804
4811
|
channelListPaginator: d = Ss,
|
|
4805
4812
|
channelPreview: u,
|
|
4806
4813
|
renderMessagePreview: g,
|
|
4807
|
-
viewerLanguage:
|
|
4814
|
+
viewerLanguage: h
|
|
4808
4815
|
}) => {
|
|
4809
|
-
const f =
|
|
4816
|
+
const f = V.useRef(0);
|
|
4810
4817
|
f.current++;
|
|
4811
|
-
const { debug:
|
|
4818
|
+
const { debug: l = !1 } = nt(), v = V.useCallback(
|
|
4812
4819
|
(b) => {
|
|
4813
4820
|
for (const p of b)
|
|
4814
4821
|
zi(p);
|
|
@@ -4816,35 +4823,35 @@ const ji = { last_message_at: -1 }, Ui = j.memo(
|
|
|
4816
4823
|
},
|
|
4817
4824
|
[r]
|
|
4818
4825
|
);
|
|
4819
|
-
|
|
4826
|
+
l && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
4820
4827
|
renderCount: f.current,
|
|
4821
4828
|
selectedChannelId: t == null ? void 0 : t.id,
|
|
4822
4829
|
filters: s
|
|
4823
4830
|
});
|
|
4824
|
-
const w =
|
|
4831
|
+
const w = V.useMemo(
|
|
4825
4832
|
() => ({
|
|
4826
4833
|
selectedChannel: t,
|
|
4827
4834
|
onChannelSelect: e,
|
|
4828
|
-
debug:
|
|
4835
|
+
debug: l,
|
|
4829
4836
|
channelPreview: u,
|
|
4830
4837
|
renderMessagePreview: g,
|
|
4831
|
-
viewerLanguage:
|
|
4838
|
+
viewerLanguage: h
|
|
4832
4839
|
}),
|
|
4833
4840
|
[
|
|
4834
4841
|
t,
|
|
4835
4842
|
e,
|
|
4836
|
-
|
|
4843
|
+
l,
|
|
4837
4844
|
u,
|
|
4838
4845
|
g,
|
|
4839
|
-
|
|
4846
|
+
h
|
|
4840
4847
|
]
|
|
4841
4848
|
);
|
|
4842
4849
|
return /* @__PURE__ */ n(
|
|
4843
4850
|
"div",
|
|
4844
4851
|
{
|
|
4845
|
-
className:
|
|
4852
|
+
className: y(
|
|
4846
4853
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
4847
|
-
|
|
4854
|
+
c
|
|
4848
4855
|
),
|
|
4849
4856
|
children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(Oi, { value: w, children: /* @__PURE__ */ n(
|
|
4850
4857
|
Es,
|
|
@@ -4856,7 +4863,7 @@ const ji = { last_message_at: -1 }, Ui = j.memo(
|
|
|
4856
4863
|
channelRenderFilterFn: v,
|
|
4857
4864
|
Paginator: d,
|
|
4858
4865
|
Preview: Bn,
|
|
4859
|
-
EmptyStateIndicator:
|
|
4866
|
+
EmptyStateIndicator: o
|
|
4860
4867
|
},
|
|
4861
4868
|
`${JSON.stringify(s)}:${JSON.stringify(i)}`
|
|
4862
4869
|
) }) })
|
|
@@ -4877,7 +4884,7 @@ const Vi = ({
|
|
|
4877
4884
|
onClick: t,
|
|
4878
4885
|
disabled: s,
|
|
4879
4886
|
style: { backgroundColor: "#E6E5E3" },
|
|
4880
|
-
className:
|
|
4887
|
+
className: y(
|
|
4881
4888
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
4882
4889
|
{
|
|
4883
4890
|
"hover:brightness-95 active:brightness-90": !s,
|
|
@@ -4894,28 +4901,28 @@ const Vi = ({
|
|
|
4894
4901
|
headerText: a,
|
|
4895
4902
|
className: r,
|
|
4896
4903
|
avatarImage: i,
|
|
4897
|
-
avatarName:
|
|
4904
|
+
avatarName: c
|
|
4898
4905
|
}) => {
|
|
4899
|
-
const
|
|
4900
|
-
return
|
|
4901
|
-
(i ||
|
|
4906
|
+
const o = e.filter((d) => d.enabled).sort((d, u) => (d.order ?? 0) - (u.order ?? 0));
|
|
4907
|
+
return o.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ m("div", { className: "flex gap-3 items-end", children: [
|
|
4908
|
+
(i || c) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
|
|
4902
4909
|
ae,
|
|
4903
4910
|
{
|
|
4904
|
-
id:
|
|
4905
|
-
name:
|
|
4911
|
+
id: c || "account",
|
|
4912
|
+
name: c || "Account",
|
|
4906
4913
|
image: i,
|
|
4907
4914
|
size: 24,
|
|
4908
4915
|
shape: "circle"
|
|
4909
4916
|
}
|
|
4910
4917
|
) }),
|
|
4911
|
-
/* @__PURE__ */
|
|
4918
|
+
/* @__PURE__ */ m(
|
|
4912
4919
|
"div",
|
|
4913
4920
|
{
|
|
4914
4921
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
4915
4922
|
style: { backgroundColor: "#F1F0EE" },
|
|
4916
4923
|
children: [
|
|
4917
4924
|
a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
|
|
4918
|
-
|
|
4925
|
+
o.map((d) => /* @__PURE__ */ n(
|
|
4919
4926
|
Vi,
|
|
4920
4927
|
{
|
|
4921
4928
|
question: d.question,
|
|
@@ -4966,4 +4973,4 @@ export {
|
|
|
4966
4973
|
lt as y,
|
|
4967
4974
|
dn as z
|
|
4968
4975
|
};
|
|
4969
|
-
//# sourceMappingURL=index-
|
|
4976
|
+
//# sourceMappingURL=index-2HMjfjM-.js.map
|