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