@linktr.ee/messaging-react 4.4.7 → 4.4.8-rc-1788251276
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/{AttachmentCard-DSekwIOA.js → AttachmentCard-BaZk77fe.js} +136 -125
- package/dist/AttachmentCard-BaZk77fe.js.map +1 -0
- package/dist/AttachmentCard-ZpYg622K.cjs +2 -0
- package/dist/AttachmentCard-ZpYg622K.cjs.map +1 -0
- package/dist/{Card-BS6Fza2a.cjs → Card-4irOjGaI.cjs} +2 -2
- package/dist/{Card-BS6Fza2a.cjs.map → Card-4irOjGaI.cjs.map} +1 -1
- package/dist/{Card-BhwBkgxI.js → Card-BdyQhysm.js} +2 -2
- package/dist/{Card-BhwBkgxI.js.map → Card-BdyQhysm.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +915 -907
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/AttachmentCard/MediaPlayer.test.tsx +9 -5
- package/src/components/AttachmentCard/MediaPlayer.tsx +3 -5
- package/src/components/AttachmentCard/Thumbnail.test.tsx +4 -0
- package/src/components/ChannelActionsMenu/ChannelActionsMenu.test.tsx +18 -10
- package/src/components/ChannelActionsMenu/index.tsx +13 -4
- package/src/components/ChannelList/ChannelListContext.test.tsx +7 -5
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +7 -5
- package/src/components/ChannelList/index.test.tsx +1 -0
- package/src/components/ChannelView.test.tsx +20 -13
- package/src/components/CustomLinkPreviewList/CustomLinkPreviewList.test.tsx +4 -3
- package/src/components/CustomMessage/CustomMessage.test.tsx +6 -5
- package/src/components/CustomMessage/MessageTag.test.tsx +6 -0
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +19 -9
- package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +12 -5
- package/src/components/CustomMessage/TipMessage/TipMessage.test.tsx +3 -0
- package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +16 -7
- package/src/components/FaqList/FaqList.test.tsx +20 -12
- package/src/components/LinkAttachment/LinkAttachment.test.tsx +27 -14
- package/src/components/LinkAttachment/components/_shared/BubbleTail.test.tsx +1 -0
- package/src/components/LinkAttachment/components/_shared/CardBody.test.tsx +6 -6
- package/src/components/LinkAttachment/components/_shared/CardCta.test.tsx +8 -5
- package/src/components/LinkAttachment/components/_shared/CardShell.test.tsx +7 -5
- package/src/components/LinkAttachment/components/_shared/CardThumbnail.test.tsx +3 -8
- package/src/components/MessageAttachment/MessageAttachment.behavior.test.tsx +22 -15
- package/src/components/MessageAttachment/MessageAttachment.test.tsx +117 -60
- package/src/components/MessageAttachment/_shared/Bubble.test.tsx +2 -0
- package/src/components/MessageAttachment/_shared/CarouselNav.test.tsx +5 -4
- package/src/components/MessageAttachment/_shared/CompactDocumentRow.test.tsx +4 -3
- package/src/components/MessageAttachment/_shared/DismissButton.test.tsx +4 -3
- package/src/components/MessageAttachment/_shared/DownloadAction.test.tsx +8 -5
- package/src/components/MessageAttachment/_shared/DownloadAction.tsx +4 -10
- package/src/components/MessageAttachment/_shared/ImageViewer.test.tsx +6 -3
- package/src/components/MessageAttachment/_shared/MediaStackGrid.test.tsx +11 -4
- package/src/components/MessageAttachment/_shared/PdfViewer.test.tsx +5 -3
- package/src/components/MessageAttachment/_shared/VideoViewer.test.tsx +12 -3
- package/src/components/MessageAttachment/_shared/ViewerShell.test.tsx +13 -6
- package/src/components/MessageAttachment/_shared/useCarousel.test.tsx +10 -4
- package/src/components/MessageBubble/MessageBubble.test.tsx +8 -0
- package/src/components/RichCard/RichCard.test.tsx +10 -2
- package/src/components/_shared/Spinner.test.tsx +75 -0
- package/src/components/_shared/Spinner.tsx +51 -0
- package/dist/AttachmentCard-BbsjzdLJ.cjs +0 -2
- package/dist/AttachmentCard-BbsjzdLJ.cjs.map +0 -1
- package/dist/AttachmentCard-DSekwIOA.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
import
|
|
3
|
-
import { StreamChatService as
|
|
4
|
-
import { LinkPreviewsManager as
|
|
5
|
-
import { AIStates as
|
|
1
|
+
import { a as e, c as t, i as n, n as r, o as i, r as a, s as o } from "./AttachmentCard-BaZk77fe.js";
|
|
2
|
+
import s, { Suspense as c, createContext as l, useCallback as u, useContext as d, useEffect as f, useId as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
3
|
+
import { StreamChatService as _ } from "@linktr.ee/messaging-core";
|
|
4
|
+
import { LinkPreviewsManager as v, StreamChat as y } from "stream-chat";
|
|
5
|
+
import { AIStates as b, Attachment as x, AttachmentPreviewList as S, Channel as C, ChannelList as w, Chat as T, DateSeparator as E, EditMessageModal as D, InfiniteScroll as O, MessageBlocked as k, MessageBounceModal as A, MessageBouncePrompt as j, MessageDeleted as M, MessageErrorIcon as N, MessageInput as P, MessageIsThreadReplyInChannelButtonIndicator as F, MessageList as I, MessageRepliesCountButton as L, MessageStatus as R, MessageText as z, MessageTimestamp as B, Poll as ee, QuotedMessagePreview as te, ReminderNotification as ne, StreamedMessageText as re, TextareaComposer as V, Window as ie, WithComponents as ae, areMessageUIPropsEqual as oe, isDateSeparatorMessage as se, isMessageBlocked as ce, isMessageBounced as le, messageHasAttachments as ue, messageHasReactions as de, useAIState as fe, useActiveAudioPlayer as pe, useChannelStateContext as me, useChatContext as he, useComponentContext as ge, useMessageComposer as _e, useMessageComposerHasSendableData as ve, useMessageContext as H, useMessageInputContext as ye, useMessageReminder as be, useStateStore as xe, useTypingContext as Se } from "stream-chat-react";
|
|
6
6
|
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
7
|
-
import { MESSAGE_CUSTOM_TYPE as K, OFFICIAL_SENDER_USER_ID as q, isAgeSafetySystemType as
|
|
7
|
+
import { MESSAGE_CUSTOM_TYPE as K, OFFICIAL_SENDER_USER_ID as q, isAgeSafetySystemType as Ce, isDmAgentSystemType as we, isOfficialChannel as J, resolveRichCardImagePresentation as Te, selectEnabledFaqs as Ee } from "@linktr.ee/messaging-taxonomy";
|
|
8
8
|
import Y from "classnames";
|
|
9
|
-
import { ArrowLeftIcon as
|
|
10
|
-
import { DefaultDropdownActionButton as
|
|
9
|
+
import { ArrowLeftIcon as De, ArrowUpIcon as Oe, CaretLeftIcon as ke, CaretRightIcon as Ae, ChecksIcon as je, CircleNotchIcon as Me, CurrencyDollarIcon as Ne, DotsThreeIcon as X, DownloadSimpleIcon as Z, FlagIcon as Pe, GiftIcon as Fe, MegaphoneIcon as Ie, PencilSimpleIcon as Le, PlayIcon as Re, ProhibitIcon as ze, ProhibitInsetIcon as Be, SignOutIcon as Ve, SparkleIcon as He, SpinnerGapIcon as Ue, StarIcon as We, TrashSimpleIcon as Ge, VideoCameraIcon as Ke, WarningCircleIcon as qe, XIcon as Je } from "@phosphor-icons/react";
|
|
10
|
+
import { DefaultDropdownActionButton as Ye, MessageActions as Xe } from "stream-chat-react/experimental";
|
|
11
11
|
//#region src/logging/index.tsx
|
|
12
|
-
var
|
|
12
|
+
var Ze = {
|
|
13
13
|
debug: (e, ...t) => console.log(e, ...t),
|
|
14
14
|
info: (e, ...t) => console.log(e, ...t),
|
|
15
15
|
warn: (e, ...t) => console.warn(e, ...t),
|
|
16
16
|
error: (e, ...t) => console.error(e, ...t)
|
|
17
|
-
},
|
|
18
|
-
debug: e?.debug ??
|
|
19
|
-
info: e?.info ??
|
|
20
|
-
warn: e?.warn ??
|
|
21
|
-
error: e?.error ??
|
|
22
|
-
}),
|
|
23
|
-
let n =
|
|
24
|
-
return /* @__PURE__ */ W(
|
|
17
|
+
}, Qe = (e) => ({
|
|
18
|
+
debug: e?.debug ?? Ze.debug,
|
|
19
|
+
info: e?.info ?? Ze.info,
|
|
20
|
+
warn: e?.warn ?? Ze.warn,
|
|
21
|
+
error: e?.error ?? Ze.error
|
|
22
|
+
}), $e = l(Ze), et = ({ logger: e, children: t }) => {
|
|
23
|
+
let n = m(() => Qe(e), [e]);
|
|
24
|
+
return /* @__PURE__ */ W($e.Provider, {
|
|
25
25
|
value: n,
|
|
26
26
|
children: t
|
|
27
27
|
});
|
|
28
|
-
},
|
|
28
|
+
}, tt = () => d($e), nt = l({
|
|
29
29
|
service: null,
|
|
30
30
|
client: null,
|
|
31
31
|
isConnected: !1,
|
|
@@ -34,29 +34,29 @@ var Xe = {
|
|
|
34
34
|
capabilities: {},
|
|
35
35
|
refreshConnection: async () => {},
|
|
36
36
|
debug: !1
|
|
37
|
-
}),
|
|
38
|
-
let
|
|
37
|
+
}), rt = () => d(nt), it = ({ children: e, user: t, serviceConfig: n, apiKey: r, capabilities: i = {}, debug: a = !1, client: o, logger: c }) => {
|
|
38
|
+
let l = u((e, ...t) => {
|
|
39
39
|
a && console.log(`🔥 [MessagingProvider] ${e}`, ...t);
|
|
40
40
|
}, [a]);
|
|
41
|
-
|
|
41
|
+
l("🔄 RENDER START", {
|
|
42
42
|
userId: t?.id,
|
|
43
43
|
apiKey: r?.substring(0, 8) + "...",
|
|
44
44
|
serviceConfig: !!n,
|
|
45
45
|
capabilities: Object.keys(i)
|
|
46
46
|
});
|
|
47
|
-
let [
|
|
47
|
+
let [d, p] = g(null), [m, v] = g(null), [b, x] = g(!1), [S, C] = g(!1), [w, E] = g(null), D = h(!1), O = h(null), k = h(n);
|
|
48
48
|
k.current = n;
|
|
49
|
-
let A =
|
|
49
|
+
let A = h(a);
|
|
50
50
|
A.current = a;
|
|
51
|
-
let j =
|
|
51
|
+
let j = h(c);
|
|
52
52
|
j.current = c;
|
|
53
|
-
let M =
|
|
53
|
+
let M = h({
|
|
54
54
|
userId: t?.id,
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: i
|
|
58
|
-
}), N =
|
|
59
|
-
N.current++,
|
|
58
|
+
}), N = h(0);
|
|
59
|
+
N.current++, l("📊 RENDER INFO", {
|
|
60
60
|
renderCount: N.current,
|
|
61
61
|
currentProps: {
|
|
62
62
|
userId: t?.id,
|
|
@@ -74,90 +74,90 @@ var Xe = {
|
|
|
74
74
|
serviceConfig: n,
|
|
75
75
|
capabilities: i
|
|
76
76
|
};
|
|
77
|
-
let P =
|
|
78
|
-
!
|
|
77
|
+
let P = h(null);
|
|
78
|
+
!o && r && P.current?.apiKey !== r && (P.current = {
|
|
79
79
|
apiKey: r,
|
|
80
|
-
client: new
|
|
80
|
+
client: new y(r)
|
|
81
81
|
});
|
|
82
|
-
let F =
|
|
83
|
-
|
|
82
|
+
let F = o || (r ? P.current?.client ?? null : null);
|
|
83
|
+
f(() => {
|
|
84
84
|
let e = N.current, t = k.current;
|
|
85
|
-
if (
|
|
86
|
-
O.current = null, p(null),
|
|
85
|
+
if (o) {
|
|
86
|
+
O.current = null, p(null), v(null), x(!1), E(null), C(!1);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
89
|
if (!r || !F || !t) {
|
|
90
|
-
|
|
90
|
+
l("⚠️ SERVICE INIT SKIPPED", {
|
|
91
91
|
renderCount: e,
|
|
92
92
|
reason: "Missing apiKey, client, or serviceConfig"
|
|
93
93
|
});
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
l("🚀 CREATING SERVICE", {
|
|
97
97
|
renderCount: e,
|
|
98
98
|
apiKey: r?.substring(0, 8) + "..."
|
|
99
99
|
});
|
|
100
|
-
let n = new
|
|
100
|
+
let n = new _({
|
|
101
101
|
...t,
|
|
102
102
|
apiKey: r,
|
|
103
103
|
debug: A.current,
|
|
104
104
|
client: F,
|
|
105
|
-
...t.logger || !j.current ? {} : { logger:
|
|
105
|
+
...t.logger || !j.current ? {} : { logger: Qe(j.current) }
|
|
106
106
|
});
|
|
107
|
-
O.current = n, p(n),
|
|
107
|
+
O.current = n, p(n), l("✅ SERVICE SET", {
|
|
108
108
|
renderCount: e,
|
|
109
109
|
serviceInstance: !!n
|
|
110
110
|
});
|
|
111
111
|
}, [
|
|
112
112
|
r,
|
|
113
113
|
F,
|
|
114
|
-
|
|
114
|
+
o
|
|
115
115
|
]);
|
|
116
|
-
let I =
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
hasService: !!
|
|
116
|
+
let I = h(null);
|
|
117
|
+
f(() => {
|
|
118
|
+
if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
119
|
+
hasService: !!d,
|
|
120
120
|
hasUser: !!t,
|
|
121
121
|
userId: t?.id,
|
|
122
122
|
isConnecting: D.current,
|
|
123
123
|
isConnected: b,
|
|
124
124
|
dependencies: {
|
|
125
|
-
service: !!
|
|
125
|
+
service: !!d,
|
|
126
126
|
userId: t?.id
|
|
127
127
|
}
|
|
128
|
-
}), !
|
|
129
|
-
if (!
|
|
130
|
-
|
|
128
|
+
}), !o) {
|
|
129
|
+
if (!d || !t) {
|
|
130
|
+
l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
if (D.current) {
|
|
134
|
-
|
|
134
|
+
l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
|
-
if (I.current?.serviceId ===
|
|
138
|
-
|
|
137
|
+
if (I.current?.serviceId === d && I.current?.userId === t.id) {
|
|
138
|
+
l("⚠️ USER CONNECTION SKIPPED", "Already connected this user with this service");
|
|
139
139
|
return;
|
|
140
140
|
}
|
|
141
141
|
(async () => {
|
|
142
|
-
|
|
142
|
+
l("🚀 STARTING USER CONNECTION", { userId: t.id }), D.current = !0, C(!0), E(null);
|
|
143
143
|
try {
|
|
144
|
-
|
|
145
|
-
let e = await
|
|
146
|
-
|
|
147
|
-
serviceId:
|
|
144
|
+
l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
|
|
145
|
+
let e = await d.connectUser(t);
|
|
146
|
+
v(e), x(!0), I.current = {
|
|
147
|
+
serviceId: d,
|
|
148
148
|
userId: t.id
|
|
149
|
-
},
|
|
149
|
+
}, l("✅ USER CONNECTION SUCCESS", {
|
|
150
150
|
userId: t.id,
|
|
151
151
|
clientId: e.userID
|
|
152
152
|
});
|
|
153
153
|
} catch (e) {
|
|
154
154
|
let n = e instanceof Error ? e.message : "Connection failed";
|
|
155
|
-
E(n),
|
|
155
|
+
E(n), l("❌ USER CONNECTION ERROR", {
|
|
156
156
|
userId: t.id,
|
|
157
157
|
error: n
|
|
158
158
|
});
|
|
159
159
|
} finally {
|
|
160
|
-
C(!1), D.current = !1,
|
|
160
|
+
C(!1), D.current = !1, l("🔄 USER CONNECTION FINISHED", {
|
|
161
161
|
userId: t.id,
|
|
162
162
|
isConnected: b
|
|
163
163
|
});
|
|
@@ -165,92 +165,92 @@ var Xe = {
|
|
|
165
165
|
})();
|
|
166
166
|
}
|
|
167
167
|
}, [
|
|
168
|
-
|
|
168
|
+
d,
|
|
169
169
|
t,
|
|
170
|
-
|
|
170
|
+
l,
|
|
171
171
|
b,
|
|
172
|
-
|
|
173
|
-
]),
|
|
172
|
+
o
|
|
173
|
+
]), f(() => {
|
|
174
174
|
let e = F;
|
|
175
175
|
return () => {
|
|
176
176
|
e && (I.current = null, O.current?.disconnectUser().catch(console.error));
|
|
177
177
|
};
|
|
178
178
|
}, [F]);
|
|
179
|
-
let L =
|
|
180
|
-
if (
|
|
181
|
-
hasService: !!
|
|
179
|
+
let L = u(async () => {
|
|
180
|
+
if (l("🔄 REFRESH CONNECTION CALLED", {
|
|
181
|
+
hasService: !!d,
|
|
182
182
|
hasUser: !!t
|
|
183
|
-
}), !
|
|
184
|
-
if (!
|
|
185
|
-
|
|
183
|
+
}), !o) {
|
|
184
|
+
if (!d || !t) {
|
|
185
|
+
l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
-
|
|
188
|
+
l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), C(!0);
|
|
189
189
|
try {
|
|
190
|
-
|
|
191
|
-
let e = await
|
|
192
|
-
|
|
190
|
+
l("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
|
|
191
|
+
let e = await d.connectUser(t);
|
|
192
|
+
v(e), x(!0), E(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
|
|
193
193
|
} catch (e) {
|
|
194
194
|
let n = e instanceof Error ? e.message : "Refresh failed";
|
|
195
|
-
E(n),
|
|
195
|
+
E(n), l("❌ CONNECTION REFRESH ERROR", {
|
|
196
196
|
userId: t.id,
|
|
197
197
|
error: n
|
|
198
198
|
});
|
|
199
199
|
} finally {
|
|
200
|
-
C(!1),
|
|
200
|
+
C(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
}, [
|
|
204
|
-
|
|
204
|
+
d,
|
|
205
205
|
t,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
]), R =
|
|
209
|
-
hasService: !!
|
|
210
|
-
hasClient: !!
|
|
206
|
+
l,
|
|
207
|
+
o
|
|
208
|
+
]), R = s.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
|
|
209
|
+
hasService: !!d,
|
|
210
|
+
hasClient: !!m,
|
|
211
211
|
isConnected: b,
|
|
212
212
|
isLoading: S,
|
|
213
|
-
hasError: !!
|
|
213
|
+
hasError: !!w,
|
|
214
214
|
capabilitiesKeys: Object.keys(i)
|
|
215
215
|
}), {
|
|
216
|
-
service:
|
|
217
|
-
client:
|
|
218
|
-
isConnected:
|
|
219
|
-
isLoading: !
|
|
220
|
-
error:
|
|
216
|
+
service: o ? null : d,
|
|
217
|
+
client: o ?? m,
|
|
218
|
+
isConnected: o ? !0 : b,
|
|
219
|
+
isLoading: !o && S,
|
|
220
|
+
error: o ? null : w,
|
|
221
221
|
capabilities: i,
|
|
222
222
|
refreshConnection: L,
|
|
223
223
|
debug: a
|
|
224
224
|
}), [
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
d,
|
|
226
|
+
m,
|
|
227
|
+
o,
|
|
228
228
|
b,
|
|
229
229
|
S,
|
|
230
|
-
|
|
230
|
+
w,
|
|
231
231
|
i,
|
|
232
232
|
L,
|
|
233
233
|
a,
|
|
234
|
-
|
|
234
|
+
l
|
|
235
235
|
]);
|
|
236
|
-
return
|
|
236
|
+
return l("🔄 RENDER END", {
|
|
237
237
|
renderCount: N.current,
|
|
238
238
|
willRenderChat: !!F,
|
|
239
239
|
contextValueReady: !!R
|
|
240
|
-
}), /* @__PURE__ */ W(
|
|
240
|
+
}), /* @__PURE__ */ W(et, {
|
|
241
241
|
logger: c,
|
|
242
|
-
children: /* @__PURE__ */ W(
|
|
242
|
+
children: /* @__PURE__ */ W(nt.Provider, {
|
|
243
243
|
value: R,
|
|
244
|
-
children: F ? /* @__PURE__ */ W(
|
|
244
|
+
children: F ? /* @__PURE__ */ W(T, {
|
|
245
245
|
client: F,
|
|
246
246
|
customClasses: { channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]" },
|
|
247
247
|
children: e
|
|
248
248
|
}) : e
|
|
249
249
|
})
|
|
250
250
|
});
|
|
251
|
-
},
|
|
252
|
-
let [t, n] =
|
|
253
|
-
return
|
|
251
|
+
}, at = () => rt(), ot = (e) => {
|
|
252
|
+
let [t, n] = g(!!e?.state?.membership?.pinned_at);
|
|
253
|
+
return f(() => {
|
|
254
254
|
if (!e) {
|
|
255
255
|
n(!1);
|
|
256
256
|
return;
|
|
@@ -266,9 +266,9 @@ var Xe = {
|
|
|
266
266
|
};
|
|
267
267
|
//#endregion
|
|
268
268
|
//#region src/utils/resolveConversationParticipant.ts
|
|
269
|
-
function
|
|
269
|
+
function st(e, t, n) {
|
|
270
270
|
let r = Object.values(e || {});
|
|
271
|
-
if (
|
|
271
|
+
if (J(n)) {
|
|
272
272
|
let e = r.find((e) => e.user?.id === q);
|
|
273
273
|
if (e) return e;
|
|
274
274
|
}
|
|
@@ -276,20 +276,20 @@ function ot(e, t, n) {
|
|
|
276
276
|
}
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/utils/resolveParticipantDisplayName.ts
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
279
|
+
var ct = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
280
|
+
function lt(e) {
|
|
281
|
+
return ct.test(e.trim());
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function ut(e, t) {
|
|
284
284
|
let n = e?.trim();
|
|
285
|
-
return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !
|
|
285
|
+
return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !lt(n);
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
return
|
|
287
|
+
function dt(e) {
|
|
288
|
+
return ut(e?.name, e?.id) ? e.name.trim() : ut(e?.username, e?.id) ? e.username.trim() : "Unknown member";
|
|
289
289
|
}
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/components/Avatar/getAvatarEmoji.ts
|
|
292
|
-
var
|
|
292
|
+
var ft = [
|
|
293
293
|
{
|
|
294
294
|
emoji: "🍎",
|
|
295
295
|
bgColor: "#FFD1DD"
|
|
@@ -343,7 +343,7 @@ var dt = [
|
|
|
343
343
|
bgColor: "#D9F7E1"
|
|
344
344
|
}
|
|
345
345
|
];
|
|
346
|
-
function
|
|
346
|
+
function pt(e) {
|
|
347
347
|
let t = 0;
|
|
348
348
|
for (let n = 0; n < e.length; n++) {
|
|
349
349
|
let r = e.charCodeAt(n);
|
|
@@ -351,19 +351,19 @@ function ft(e) {
|
|
|
351
351
|
}
|
|
352
352
|
return Math.abs(t);
|
|
353
353
|
}
|
|
354
|
-
function pt(e) {
|
|
355
|
-
return dt[ft(e) % dt.length];
|
|
356
|
-
}
|
|
357
354
|
function mt(e) {
|
|
358
|
-
return pt(e).
|
|
355
|
+
return ft[pt(e) % ft.length];
|
|
359
356
|
}
|
|
360
357
|
function ht(e) {
|
|
361
|
-
return
|
|
358
|
+
return mt(e).emoji;
|
|
359
|
+
}
|
|
360
|
+
function gt(e) {
|
|
361
|
+
return mt(e).bgColor;
|
|
362
362
|
}
|
|
363
363
|
//#endregion
|
|
364
364
|
//#region src/components/Avatar/index.tsx
|
|
365
|
-
var
|
|
366
|
-
let s =
|
|
365
|
+
var _t = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape: a = "squircle", dmAgentEnabled: o = !1 }) => {
|
|
366
|
+
let s = ht(e), c = gt(e), l = n < 32 ? Math.round(n * .45) : n < 56 ? 14 : n < 120 ? 18 : 36, u = n >= 40 ? 2 : 1, d = a === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ W("div", {
|
|
367
367
|
"data-testid": "avatar-inner",
|
|
368
368
|
className: "h-full w-full overflow-hidden",
|
|
369
369
|
style: d,
|
|
@@ -396,7 +396,7 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
396
396
|
"aria-hidden": "true",
|
|
397
397
|
"data-testid": "avatar-star",
|
|
398
398
|
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)]",
|
|
399
|
-
children: /* @__PURE__ */ W(
|
|
399
|
+
children: /* @__PURE__ */ W(We, {
|
|
400
400
|
className: "size-3 text-yellow-600",
|
|
401
401
|
weight: "duotone"
|
|
402
402
|
})
|
|
@@ -415,17 +415,17 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
415
415
|
children: f
|
|
416
416
|
})]
|
|
417
417
|
});
|
|
418
|
-
},
|
|
419
|
-
let { service:
|
|
420
|
-
return
|
|
421
|
-
if (!
|
|
418
|
+
}, vt = "https://linktr.ee/s/about/trust-center/report", yt = ({ channel: e, participant: t, showBlockParticipant: n = !0, enabled: r = !0, onLeaveConversation: i, onBlockParticipant: a, onDeleteConversationClick: o, onBlockParticipantClick: s, onReportParticipantClick: c, onActionComplete: l, logLabel: u = "useChannelModerationActions" }) => {
|
|
419
|
+
let { service: d, debug: p } = rt(), m = t?.user?.id, h = !!(r && n && d && m), [_, v] = g(!1), [y, b] = g(null), [x, S] = g(!1), [C, w] = g(!1), T = h && (y?.participantId !== m || y?.service !== d);
|
|
420
|
+
return f(() => {
|
|
421
|
+
if (!h || !d || !m) {
|
|
422
422
|
v(!1), b(null);
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
425
|
let e = !1;
|
|
426
426
|
return (async () => {
|
|
427
427
|
try {
|
|
428
|
-
let t = await
|
|
428
|
+
let t = await d.getBlockedUsers();
|
|
429
429
|
if (e) return;
|
|
430
430
|
v(t.some((e) => e.blocked_user_id === m));
|
|
431
431
|
} catch (t) {
|
|
@@ -433,15 +433,15 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
433
433
|
} finally {
|
|
434
434
|
e || b({
|
|
435
435
|
participantId: m,
|
|
436
|
-
service:
|
|
436
|
+
service: d
|
|
437
437
|
});
|
|
438
438
|
}
|
|
439
439
|
})(), () => {
|
|
440
440
|
e = !0;
|
|
441
441
|
};
|
|
442
442
|
}, [
|
|
443
|
-
|
|
444
|
-
|
|
443
|
+
h,
|
|
444
|
+
d,
|
|
445
445
|
m,
|
|
446
446
|
u
|
|
447
447
|
]), {
|
|
@@ -463,10 +463,10 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
463
463
|
}
|
|
464
464
|
},
|
|
465
465
|
handleBlockUser: async () => {
|
|
466
|
-
if (!(C || !
|
|
466
|
+
if (!(C || !d)) {
|
|
467
467
|
s?.(), p && console.log(`[${u}] Block member`, t?.user?.id), w(!0);
|
|
468
468
|
try {
|
|
469
|
-
await
|
|
469
|
+
await d.blockUser(t?.user?.id), a && await a(t?.user?.id), l?.();
|
|
470
470
|
} catch (e) {
|
|
471
471
|
console.error(`[${u}] Failed to block member`, e);
|
|
472
472
|
} finally {
|
|
@@ -475,10 +475,10 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
475
475
|
}
|
|
476
476
|
},
|
|
477
477
|
handleUnblockUser: async () => {
|
|
478
|
-
if (!(C || !
|
|
478
|
+
if (!(C || !d)) {
|
|
479
479
|
s?.(), p && console.log(`[${u}] Unblock member`, t?.user?.id), w(!0);
|
|
480
480
|
try {
|
|
481
|
-
await
|
|
481
|
+
await d.unBlockUser(t?.user?.id), a && await a(t?.user?.id), l?.();
|
|
482
482
|
} catch (e) {
|
|
483
483
|
console.error(`[${u}] Failed to unblock member`, e);
|
|
484
484
|
} finally {
|
|
@@ -487,102 +487,118 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
487
487
|
}
|
|
488
488
|
},
|
|
489
489
|
handleReportUser: () => {
|
|
490
|
-
c?.(), l?.(), window.open(
|
|
490
|
+
c?.(), l?.(), window.open(vt, "_blank", "noopener,noreferrer");
|
|
491
491
|
}
|
|
492
492
|
};
|
|
493
|
-
},
|
|
493
|
+
}, bt = ({ variant: e = "default", className: t, children: n, ...r }) => /* @__PURE__ */ W("button", {
|
|
494
494
|
type: "button",
|
|
495
495
|
className: Y("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", e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand", t),
|
|
496
496
|
...r,
|
|
497
497
|
children: n
|
|
498
|
-
}),
|
|
499
|
-
let [
|
|
498
|
+
}), xt = ({ channel: e, participant: n, showDeleteConversation: r = !0, showBlockParticipant: i = !0, showReportParticipant: a = !0, onLeaveConversation: o, onBlockParticipant: s, onDeleteConversationClick: c, onBlockParticipantClick: l, onReportParticipantClick: d, customChannelActions: m, triggerClassName: _ }) => {
|
|
499
|
+
let [v, y] = g(!1), b = h(null), x = p(), { isParticipantBlocked: S, isCheckingBlockedStatus: C, isLeaving: w, isUpdatingBlockStatus: T, handleLeaveConversation: E, handleBlockUser: D, handleUnblockUser: O, handleReportUser: k } = yt({
|
|
500
500
|
channel: e,
|
|
501
|
-
participant:
|
|
502
|
-
showBlockParticipant:
|
|
503
|
-
enabled:
|
|
504
|
-
onLeaveConversation:
|
|
505
|
-
onBlockParticipant:
|
|
506
|
-
onDeleteConversationClick:
|
|
507
|
-
onBlockParticipantClick:
|
|
508
|
-
onReportParticipantClick:
|
|
509
|
-
onActionComplete:
|
|
501
|
+
participant: n,
|
|
502
|
+
showBlockParticipant: i,
|
|
503
|
+
enabled: v,
|
|
504
|
+
onLeaveConversation: o,
|
|
505
|
+
onBlockParticipant: s,
|
|
506
|
+
onDeleteConversationClick: c,
|
|
507
|
+
onBlockParticipantClick: l,
|
|
508
|
+
onReportParticipantClick: d,
|
|
509
|
+
onActionComplete: u(() => y(!1), []),
|
|
510
510
|
logLabel: "ChannelActionsMenu"
|
|
511
511
|
});
|
|
512
|
-
return
|
|
513
|
-
if (!
|
|
512
|
+
return f(() => {
|
|
513
|
+
if (!v) return;
|
|
514
514
|
let e = (e) => {
|
|
515
|
-
|
|
515
|
+
b.current && !b.current.contains(e.target) && y(!1);
|
|
516
516
|
}, t = (e) => {
|
|
517
|
-
e.key === "Escape" &&
|
|
517
|
+
e.key === "Escape" && y(!1);
|
|
518
518
|
};
|
|
519
519
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
520
520
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
521
521
|
};
|
|
522
|
-
}, [
|
|
523
|
-
ref:
|
|
522
|
+
}, [v]), !n || !(r || i || a || m) ? null : /* @__PURE__ */ G("div", {
|
|
523
|
+
ref: b,
|
|
524
524
|
className: "relative",
|
|
525
525
|
children: [/* @__PURE__ */ G("button", {
|
|
526
|
-
className:
|
|
526
|
+
className: _,
|
|
527
527
|
type: "button",
|
|
528
528
|
"aria-haspopup": "true",
|
|
529
|
-
"aria-expanded":
|
|
530
|
-
"aria-controls":
|
|
531
|
-
onClick: () =>
|
|
532
|
-
children: [/* @__PURE__ */ W(
|
|
529
|
+
"aria-expanded": v,
|
|
530
|
+
"aria-controls": v ? x : void 0,
|
|
531
|
+
onClick: () => y((e) => !e),
|
|
532
|
+
children: [/* @__PURE__ */ W(X, { className: "size-5 text-black/90" }), /* @__PURE__ */ W("span", {
|
|
533
533
|
className: "sr-only",
|
|
534
534
|
children: "More options"
|
|
535
535
|
})]
|
|
536
|
-
}),
|
|
537
|
-
id:
|
|
536
|
+
}), v && /* @__PURE__ */ W("div", {
|
|
537
|
+
id: x,
|
|
538
538
|
"aria-label": "Conversation options",
|
|
539
539
|
className: Y("absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden", "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"),
|
|
540
540
|
children: /* @__PURE__ */ G("ul", {
|
|
541
541
|
className: "flex flex-col gap-1",
|
|
542
542
|
children: [
|
|
543
|
-
|
|
544
|
-
onClick:
|
|
545
|
-
disabled:
|
|
546
|
-
"aria-busy":
|
|
547
|
-
children: [
|
|
543
|
+
r && /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G(bt, {
|
|
544
|
+
onClick: E,
|
|
545
|
+
disabled: w,
|
|
546
|
+
"aria-busy": w,
|
|
547
|
+
children: [w ? /* @__PURE__ */ W(t, {
|
|
548
|
+
size: "md",
|
|
549
|
+
icon: Ue,
|
|
550
|
+
weight: "regular"
|
|
551
|
+
}) : /* @__PURE__ */ W(Ve, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Delete Conversation" })]
|
|
548
552
|
}) }),
|
|
549
|
-
|
|
553
|
+
i && /* @__PURE__ */ W("li", { children: C ? /* @__PURE__ */ G(bt, {
|
|
550
554
|
disabled: !0,
|
|
551
555
|
"aria-busy": !0,
|
|
552
|
-
children: [/* @__PURE__ */ W(
|
|
553
|
-
|
|
556
|
+
children: [/* @__PURE__ */ W(t, {
|
|
557
|
+
size: "md",
|
|
558
|
+
icon: Ue,
|
|
559
|
+
weight: "regular"
|
|
560
|
+
}), /* @__PURE__ */ W("span", { children: "Block" })]
|
|
561
|
+
}) : S ? /* @__PURE__ */ G(bt, {
|
|
562
|
+
onClick: O,
|
|
563
|
+
disabled: T,
|
|
564
|
+
"aria-busy": T,
|
|
565
|
+
children: [T ? /* @__PURE__ */ W(t, {
|
|
566
|
+
size: "md",
|
|
567
|
+
icon: Ue,
|
|
568
|
+
weight: "regular"
|
|
569
|
+
}) : /* @__PURE__ */ W(Be, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Unblock" })]
|
|
570
|
+
}) : /* @__PURE__ */ G(bt, {
|
|
554
571
|
onClick: D,
|
|
555
|
-
disabled:
|
|
556
|
-
"aria-busy":
|
|
557
|
-
children: [
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
"
|
|
562
|
-
children: [w ? /* @__PURE__ */ W(He, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ W(ze, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Block" })]
|
|
572
|
+
disabled: T,
|
|
573
|
+
"aria-busy": T,
|
|
574
|
+
children: [T ? /* @__PURE__ */ W(t, {
|
|
575
|
+
size: "md",
|
|
576
|
+
icon: Ue,
|
|
577
|
+
weight: "regular"
|
|
578
|
+
}) : /* @__PURE__ */ W(Be, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Block" })]
|
|
563
579
|
}) }),
|
|
564
|
-
|
|
580
|
+
a && /* @__PURE__ */ W("li", { children: /* @__PURE__ */ G(bt, {
|
|
565
581
|
variant: "danger",
|
|
566
|
-
onClick:
|
|
567
|
-
children: [/* @__PURE__ */ W(
|
|
582
|
+
onClick: k,
|
|
583
|
+
children: [/* @__PURE__ */ W(Pe, { className: "h-5 w-5" }), /* @__PURE__ */ W("span", { children: "Report" })]
|
|
568
584
|
}) }),
|
|
569
|
-
|
|
585
|
+
m
|
|
570
586
|
]
|
|
571
587
|
})
|
|
572
588
|
})]
|
|
573
589
|
});
|
|
574
|
-
},
|
|
575
|
-
let { channel: _ } =
|
|
590
|
+
}, St = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Ct = "CUSTOMER_PAID", wt = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Ct, Tt = ({ className: e, onBack: t, showBackButton: n, showStarButton: r = !1, onLeaveConversation: i, onBlockParticipant: a, showDeleteConversation: o = !0, showBlockParticipant: c = !0, showReportParticipant: l = !0, onDeleteConversationClick: u, onBlockParticipantClick: d, onReportParticipantClick: f, customChannelActions: p, renderChannelActions: m, showChannelInfo: h = !0, onParticipantNameClick: g }) => {
|
|
591
|
+
let { channel: _ } = me(), { client: v } = he(), y = s.useMemo(() => st(_.state?.members, v?.userID, _.type), [
|
|
576
592
|
_.state?.members,
|
|
577
593
|
v?.userID,
|
|
578
594
|
_.type
|
|
579
|
-
]), b =
|
|
595
|
+
]), b = dt(y?.user), x = y?.user?.image, S = ot(_), C = wt(_.data?.customer_tag) && y?.is_follower === !0, w = r && S, T = C || w || !!g, E = async () => {
|
|
580
596
|
try {
|
|
581
597
|
S ? await _.unpin() : await _.pin();
|
|
582
598
|
} catch (e) {
|
|
583
599
|
console.error("[ChannelHeaderRedesign] Failed to update pinned status:", e);
|
|
584
600
|
}
|
|
585
|
-
}, D = /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(
|
|
601
|
+
}, D = /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(_t, {
|
|
586
602
|
id: y?.user?.id || _.id || "unknown",
|
|
587
603
|
name: b,
|
|
588
604
|
image: x,
|
|
@@ -602,7 +618,7 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
602
618
|
C && /* @__PURE__ */ W("span", {
|
|
603
619
|
"aria-label": "Paid customer",
|
|
604
620
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
|
|
605
|
-
children: /* @__PURE__ */ W(
|
|
621
|
+
children: /* @__PURE__ */ W(Ne, {
|
|
606
622
|
className: "size-2.5",
|
|
607
623
|
weight: "bold"
|
|
608
624
|
})
|
|
@@ -612,13 +628,13 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
612
628
|
children: /* @__PURE__ */ W("span", {
|
|
613
629
|
"aria-label": "Starred conversation",
|
|
614
630
|
className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
|
|
615
|
-
children: /* @__PURE__ */ W(
|
|
631
|
+
children: /* @__PURE__ */ W(We, {
|
|
616
632
|
className: "size-2.5",
|
|
617
633
|
weight: "fill"
|
|
618
634
|
})
|
|
619
635
|
})
|
|
620
636
|
}),
|
|
621
|
-
g && /* @__PURE__ */ W(
|
|
637
|
+
g && /* @__PURE__ */ W(Ae, {
|
|
622
638
|
"aria-hidden": "true",
|
|
623
639
|
className: "size-4 shrink-0 text-black/65",
|
|
624
640
|
weight: "bold"
|
|
@@ -635,11 +651,11 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
635
651
|
/* @__PURE__ */ W("div", {
|
|
636
652
|
className: "flex items-start",
|
|
637
653
|
children: n && /* @__PURE__ */ W("button", {
|
|
638
|
-
className: Y(
|
|
654
|
+
className: Y(St, "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"),
|
|
639
655
|
onClick: t || (() => {}),
|
|
640
656
|
type: "button",
|
|
641
657
|
"aria-label": "Back to conversations",
|
|
642
|
-
children: /* @__PURE__ */ W(
|
|
658
|
+
children: /* @__PURE__ */ W(De, { className: "size-5 text-black/90" })
|
|
643
659
|
})
|
|
644
660
|
}),
|
|
645
661
|
/* @__PURE__ */ W("div", {
|
|
@@ -659,22 +675,22 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
659
675
|
/* @__PURE__ */ G("div", {
|
|
660
676
|
className: "flex items-start justify-end gap-2",
|
|
661
677
|
children: [r && /* @__PURE__ */ W("button", {
|
|
662
|
-
className:
|
|
678
|
+
className: St,
|
|
663
679
|
onClick: E,
|
|
664
680
|
type: "button",
|
|
665
681
|
"aria-pressed": S,
|
|
666
682
|
"aria-label": S ? "Unstar conversation" : "Star conversation",
|
|
667
|
-
children: /* @__PURE__ */ W(
|
|
683
|
+
children: /* @__PURE__ */ W(We, {
|
|
668
684
|
className: Y("size-5", {
|
|
669
685
|
"text-[#FFD60A]": S,
|
|
670
686
|
"text-black/90": !S
|
|
671
687
|
}),
|
|
672
688
|
weight: S ? "fill" : "regular"
|
|
673
689
|
})
|
|
674
|
-
}), h && (m === void 0 ? /* @__PURE__ */ W(
|
|
690
|
+
}), h && (m === void 0 ? /* @__PURE__ */ W(xt, {
|
|
675
691
|
channel: _,
|
|
676
692
|
participant: y,
|
|
677
|
-
showDeleteConversation:
|
|
693
|
+
showDeleteConversation: o,
|
|
678
694
|
showBlockParticipant: c,
|
|
679
695
|
showReportParticipant: l,
|
|
680
696
|
onLeaveConversation: i,
|
|
@@ -683,48 +699,48 @@ var gt = ({ id: e, image: t, size: n = 40, className: r, starred: i = !1, shape:
|
|
|
683
699
|
onBlockParticipantClick: d,
|
|
684
700
|
onReportParticipantClick: f,
|
|
685
701
|
customChannelActions: p,
|
|
686
|
-
triggerClassName:
|
|
702
|
+
triggerClassName: St
|
|
687
703
|
}) : m)]
|
|
688
704
|
})
|
|
689
705
|
]
|
|
690
706
|
})
|
|
691
707
|
});
|
|
692
|
-
},
|
|
708
|
+
}, Et = (e) => /* @__PURE__ */ W(E, {
|
|
693
709
|
...e,
|
|
694
710
|
position: "center"
|
|
695
711
|
});
|
|
696
712
|
//#endregion
|
|
697
713
|
//#region src/utils/getMessageDisplayText.ts
|
|
698
|
-
function
|
|
714
|
+
function Dt(e) {
|
|
699
715
|
return e?.trim().toLowerCase().split(/[-_]/)[0] || void 0;
|
|
700
716
|
}
|
|
701
|
-
function
|
|
702
|
-
let n = e?.text, r =
|
|
717
|
+
function Ot({ message: e, viewerLanguage: t }) {
|
|
718
|
+
let n = e?.text, r = Dt(t);
|
|
703
719
|
return r ? e?.i18n?.[`${r}_text`] ?? n : n;
|
|
704
720
|
}
|
|
705
721
|
//#endregion
|
|
706
722
|
//#region src/components/LinkAttachment/components/_shared/normalizeExternalHref.ts
|
|
707
|
-
var
|
|
723
|
+
var kt = /^([a-z][a-z0-9+.-]*):/i, At = /* @__PURE__ */ new Set([
|
|
708
724
|
"http",
|
|
709
725
|
"https",
|
|
710
726
|
"mailto",
|
|
711
727
|
"tel",
|
|
712
728
|
"sms"
|
|
713
729
|
]);
|
|
714
|
-
function
|
|
730
|
+
function jt(e) {
|
|
715
731
|
if (typeof e != "string") return;
|
|
716
732
|
let t = e.trim();
|
|
717
733
|
if (t === "") return;
|
|
718
|
-
let n =
|
|
734
|
+
let n = kt.exec(t);
|
|
719
735
|
if (n) {
|
|
720
736
|
let e = n[1].toLowerCase();
|
|
721
|
-
return
|
|
737
|
+
return At.has(e) ? t : void 0;
|
|
722
738
|
}
|
|
723
739
|
return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
|
|
724
740
|
}
|
|
725
741
|
//#endregion
|
|
726
742
|
//#region src/components/LinkAttachment/components/_shared/CardCta.tsx
|
|
727
|
-
var
|
|
743
|
+
var Mt = {
|
|
728
744
|
dark: {
|
|
729
745
|
primary: "bg-white text-[#121110] hover:bg-white/90",
|
|
730
746
|
secondary: "bg-white/15 text-white hover:bg-white/25"
|
|
@@ -733,11 +749,11 @@ var jt = {
|
|
|
733
749
|
primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
|
|
734
750
|
secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
|
|
735
751
|
}
|
|
736
|
-
},
|
|
737
|
-
let i = t.variant ?? "primary", a = Y("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2",
|
|
752
|
+
}, Nt = ({ variant: e, cta: t, fullWidth: n = !0, standalone: r = !1 }) => {
|
|
753
|
+
let i = t.variant ?? "primary", a = Y("inline-flex h-10 items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors", n ? "w-full" : "min-w-0", !r && "mt-2", Mt[e][i]), o = n ? t.label : /* @__PURE__ */ W("span", {
|
|
738
754
|
className: "min-w-0 truncate",
|
|
739
755
|
children: t.label
|
|
740
|
-
}), s =
|
|
756
|
+
}), s = jt(t.href);
|
|
741
757
|
return s ? /* @__PURE__ */ W("a", {
|
|
742
758
|
href: s,
|
|
743
759
|
target: "_blank",
|
|
@@ -755,21 +771,21 @@ var jt = {
|
|
|
755
771
|
className: a,
|
|
756
772
|
children: o
|
|
757
773
|
});
|
|
758
|
-
},
|
|
774
|
+
}, Pt = {
|
|
759
775
|
dark: "text-white",
|
|
760
776
|
light: "text-black/90"
|
|
761
|
-
},
|
|
777
|
+
}, Ft = "text-white/30", It = {
|
|
762
778
|
dark: "text-white/55",
|
|
763
779
|
light: "text-black/55"
|
|
764
|
-
},
|
|
780
|
+
}, Lt = {
|
|
765
781
|
dark: "bg-white/25",
|
|
766
782
|
light: "bg-black/15"
|
|
767
|
-
},
|
|
783
|
+
}, Rt = ({ variant: e, ctaSurface: t, chinTextColor: n, title: r, placeholderTitle: i, description: a, descriptionLines: o = 1, url: s, appIcon: c, cta: l, trailingAction: u, isLoading: d = !1 }) => {
|
|
768
784
|
let f = e === "dark", p = r ?? (f ? i : void 0) ?? "", m = p.trim() !== "", h = a != null && a.trim() !== "", g = typeof s == "string" ? s.trim() : "", _ = g !== "", v = l != null;
|
|
769
785
|
if (!d && !m && !h && !_ && !v) return null;
|
|
770
|
-
let y = Y("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ?
|
|
786
|
+
let y = Y("line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", n == null && (f && !r ? Ft : Pt[e])), b = Y("truncate text-[12px] leading-4 tracking-[0.24px]", n == null && It[e]), x = Y("text-[12px] leading-4 tracking-[0.24px]", o <= 1 && "truncate", n == null && It[e]);
|
|
771
787
|
if (d) {
|
|
772
|
-
let t = Y("animate-pulse rounded",
|
|
788
|
+
let t = Y("animate-pulse rounded", Lt[e]);
|
|
773
789
|
return /* @__PURE__ */ W("div", {
|
|
774
790
|
className: "shrink-0 px-4 py-3",
|
|
775
791
|
children: /* @__PURE__ */ G("div", {
|
|
@@ -827,16 +843,16 @@ var jt = {
|
|
|
827
843
|
className: "shrink-0",
|
|
828
844
|
children: u
|
|
829
845
|
})]
|
|
830
|
-
}), l && /* @__PURE__ */ W(
|
|
846
|
+
}), l && /* @__PURE__ */ W(Nt, {
|
|
831
847
|
variant: t ?? e,
|
|
832
848
|
cta: l
|
|
833
849
|
})]
|
|
834
850
|
});
|
|
835
|
-
},
|
|
836
|
-
let f = Y("messaging-link-card",
|
|
851
|
+
}, zt = "Loading link preview", Bt = Y("relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden", "rounded-[20px]"), Vt = "flex h-[250px] flex-col", Ht = ({ variant: e, children: t, href: n, onClick: r, ariaLabel: i, rootRef: a, topRight: o, bgClassName: s, accentHex: c, fixedHeight: l = !1, busy: u = !1, "data-testid": d = "link-card" }) => {
|
|
852
|
+
let f = Y("messaging-link-card", Bt, l ? Vt : "block", s ?? (e === "dark" ? "bg-[#1e2330]" : "bg-[#f1f0ee]"), n != null || r != null ? "cursor-pointer no-underline focus-ring" : null), p = u ? {
|
|
837
853
|
role: "status",
|
|
838
854
|
"aria-busy": !0,
|
|
839
|
-
"aria-label":
|
|
855
|
+
"aria-label": zt
|
|
840
856
|
} : void 0, m = c ? { "--accent": c } : void 0, h = o ? /* @__PURE__ */ W("div", {
|
|
841
857
|
"data-testid": "card-shell-top-right",
|
|
842
858
|
className: "pointer-events-auto absolute right-3 top-3 z-10",
|
|
@@ -874,24 +890,24 @@ var jt = {
|
|
|
874
890
|
...p,
|
|
875
891
|
children: [t, h]
|
|
876
892
|
});
|
|
877
|
-
},
|
|
893
|
+
}, Ut = {
|
|
878
894
|
dark: "bg-white/10",
|
|
879
895
|
light: "bg-black/5"
|
|
880
|
-
},
|
|
896
|
+
}, Wt = {
|
|
881
897
|
dark: "size-16 text-white/25",
|
|
882
898
|
light: "size-16 text-black/25"
|
|
883
|
-
},
|
|
884
|
-
if (!
|
|
885
|
-
let r =
|
|
899
|
+
}, Gt = (e, t) => !!t && !!e && n(e) === "audio", Kt = (e, t) => {
|
|
900
|
+
if (!t || !e) return !1;
|
|
901
|
+
let r = n(e);
|
|
886
902
|
return r === "video" || r === "audio";
|
|
887
|
-
},
|
|
888
|
-
let p =
|
|
889
|
-
return !d &&
|
|
903
|
+
}, qt = "bg-[#F2F3F4]", Jt = ({ variant: t, thumbnailUrl: i, sourceUrl: a, title: s, mimeType: c = "image/*", topLeft: l, topRight: u, isLoading: d = !1, onImageError: f }) => {
|
|
904
|
+
let p = n(c), m = !!a && p === "video", h = o(i);
|
|
905
|
+
return !d && Gt(c, a) ? /* @__PURE__ */ W("div", {
|
|
890
906
|
className: "p-3",
|
|
891
907
|
children: /* @__PURE__ */ W("audio", {
|
|
892
908
|
...e,
|
|
893
909
|
"data-testid": "card-thumbnail-audio",
|
|
894
|
-
src:
|
|
910
|
+
src: a,
|
|
895
911
|
controls: !0,
|
|
896
912
|
preload: "metadata",
|
|
897
913
|
className: "block w-full",
|
|
@@ -903,11 +919,11 @@ var jt = {
|
|
|
903
919
|
children: [
|
|
904
920
|
d ? /* @__PURE__ */ W("div", {
|
|
905
921
|
"data-testid": "card-thumbnail-skeleton",
|
|
906
|
-
className: Y("h-full w-full animate-pulse",
|
|
922
|
+
className: Y("h-full w-full animate-pulse", Ut[t]),
|
|
907
923
|
"aria-hidden": !0
|
|
908
924
|
}) : m ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("video", {
|
|
909
925
|
"data-testid": "card-thumbnail-video",
|
|
910
|
-
src:
|
|
926
|
+
src: a,
|
|
911
927
|
poster: h,
|
|
912
928
|
controls: !0,
|
|
913
929
|
playsInline: !0,
|
|
@@ -930,9 +946,9 @@ var jt = {
|
|
|
930
946
|
className: "absolute inset-0 h-full w-full object-cover"
|
|
931
947
|
}) : /* @__PURE__ */ W("div", {
|
|
932
948
|
"data-testid": "card-thumbnail-placeholder",
|
|
933
|
-
className: Y("flex h-full w-full items-center justify-center",
|
|
934
|
-
children:
|
|
935
|
-
className:
|
|
949
|
+
className: Y("flex h-full w-full items-center justify-center", Ut[t]),
|
|
950
|
+
children: r(c, {
|
|
951
|
+
className: Wt[t],
|
|
936
952
|
weight: "regular"
|
|
937
953
|
})
|
|
938
954
|
}),
|
|
@@ -948,25 +964,25 @@ var jt = {
|
|
|
948
964
|
}) : null
|
|
949
965
|
]
|
|
950
966
|
});
|
|
951
|
-
},
|
|
952
|
-
function
|
|
967
|
+
}, Yt = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
968
|
+
function Xt(e) {
|
|
953
969
|
let t = e.trim();
|
|
954
970
|
return t.startsWith("#") ? t : `#${t}`;
|
|
955
971
|
}
|
|
956
972
|
//#endregion
|
|
957
973
|
//#region src/components/LinkAttachment/components/_shared/useChinPalette.ts
|
|
958
|
-
var
|
|
959
|
-
dark:
|
|
960
|
-
light:
|
|
974
|
+
var Zt = "#FFFFFF", Qt = "#040403", $t = {
|
|
975
|
+
dark: Zt,
|
|
976
|
+
light: Qt
|
|
961
977
|
};
|
|
962
|
-
function
|
|
963
|
-
let [c, l] =
|
|
964
|
-
|
|
978
|
+
function en({ variant: e, accentColor: t, status: n = "ready", layout: r = "featured", thumbnailUrl: i, mimeType: a, sourceUrl: o }) {
|
|
979
|
+
let [c, l] = s.useState(!1);
|
|
980
|
+
s.useEffect(() => {
|
|
965
981
|
l(!1);
|
|
966
982
|
}, [i]);
|
|
967
|
-
let u =
|
|
983
|
+
let u = s.useCallback(() => {
|
|
968
984
|
l(!0);
|
|
969
|
-
}, []), d =
|
|
985
|
+
}, []), d = Gt(a, o), f = r === "featured" && i && !d && !c && n === "ready" && t != null && Yt.test(t.trim()) ? Xt(t) : void 0, p = d ? Qt : $t[e];
|
|
970
986
|
return {
|
|
971
987
|
thumbnailUrl: c ? void 0 : i,
|
|
972
988
|
accentHex: f,
|
|
@@ -978,8 +994,8 @@ function $t({ variant: e, accentColor: t, status: n = "ready", layout: r = "feat
|
|
|
978
994
|
}
|
|
979
995
|
//#endregion
|
|
980
996
|
//#region src/components/LinkAttachment/components/Composer/Card.tsx
|
|
981
|
-
var
|
|
982
|
-
let g = c === "classic", _ =
|
|
997
|
+
var tn = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white transition-colors duration-150 hover:bg-[#2a2928] focus-ring", nn = "relative before:absolute before:-inset-[10px] before:content-['']", rn = ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onDismiss: p, onEditClick: m, dismissLabel: h = "Dismiss attachment" }) => {
|
|
998
|
+
let g = c === "classic", _ = Gt(a, s), v = en({
|
|
983
999
|
variant: "dark",
|
|
984
1000
|
accentColor: d,
|
|
985
1001
|
status: f,
|
|
@@ -991,8 +1007,8 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
991
1007
|
type: "button",
|
|
992
1008
|
onClick: p,
|
|
993
1009
|
"aria-label": h,
|
|
994
|
-
className: Y(
|
|
995
|
-
children: /* @__PURE__ */ W(
|
|
1010
|
+
className: Y(tn, !_ && nn),
|
|
1011
|
+
children: /* @__PURE__ */ W(Je, {
|
|
996
1012
|
className: "size-3",
|
|
997
1013
|
weight: "bold"
|
|
998
1014
|
})
|
|
@@ -1001,19 +1017,19 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1001
1017
|
onClick: m,
|
|
1002
1018
|
"aria-label": "Edit attachment",
|
|
1003
1019
|
className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
|
|
1004
|
-
children: /* @__PURE__ */ W(
|
|
1020
|
+
children: /* @__PURE__ */ W(Le, {
|
|
1005
1021
|
className: "size-5",
|
|
1006
1022
|
weight: "regular"
|
|
1007
1023
|
})
|
|
1008
1024
|
}) : void 0;
|
|
1009
|
-
return _ && !v.isLoading ? /* @__PURE__ */ W(
|
|
1025
|
+
return _ && !v.isLoading ? /* @__PURE__ */ W(Ht, {
|
|
1010
1026
|
variant: "dark",
|
|
1011
|
-
bgClassName:
|
|
1027
|
+
bgClassName: qt,
|
|
1012
1028
|
children: /* @__PURE__ */ G("div", {
|
|
1013
1029
|
className: "flex items-center gap-2 pr-3",
|
|
1014
1030
|
children: [/* @__PURE__ */ W("div", {
|
|
1015
1031
|
className: "min-w-0 flex-1",
|
|
1016
|
-
children: /* @__PURE__ */ W(
|
|
1032
|
+
children: /* @__PURE__ */ W(Jt, {
|
|
1017
1033
|
variant: "dark",
|
|
1018
1034
|
sourceUrl: s,
|
|
1019
1035
|
title: e,
|
|
@@ -1024,13 +1040,13 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1024
1040
|
children: y
|
|
1025
1041
|
})]
|
|
1026
1042
|
})
|
|
1027
|
-
}) : /* @__PURE__ */ G(
|
|
1043
|
+
}) : /* @__PURE__ */ G(Ht, {
|
|
1028
1044
|
variant: "dark",
|
|
1029
1045
|
fixedHeight: !g,
|
|
1030
1046
|
accentHex: v.accentHex,
|
|
1031
1047
|
busy: v.isLoading,
|
|
1032
1048
|
topRight: g ? y : void 0,
|
|
1033
|
-
children: [!g && /* @__PURE__ */ W(
|
|
1049
|
+
children: [!g && /* @__PURE__ */ W(Jt, {
|
|
1034
1050
|
variant: "dark",
|
|
1035
1051
|
thumbnailUrl: v.thumbnailUrl,
|
|
1036
1052
|
sourceUrl: s,
|
|
@@ -1039,7 +1055,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1039
1055
|
topRight: y,
|
|
1040
1056
|
isLoading: v.isLoading,
|
|
1041
1057
|
onImageError: v.onImageError
|
|
1042
|
-
}), /* @__PURE__ */ W(
|
|
1058
|
+
}), /* @__PURE__ */ W(Rt, {
|
|
1043
1059
|
chinTextColor: v.chinTextColor,
|
|
1044
1060
|
variant: "dark",
|
|
1045
1061
|
ctaSurface: v.surface,
|
|
@@ -1054,7 +1070,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1054
1070
|
isLoading: v.isLoading
|
|
1055
1071
|
})]
|
|
1056
1072
|
});
|
|
1057
|
-
},
|
|
1073
|
+
}, an = ({ accentHex: e, side: t, visible: n, children: r }) => n ? /* @__PURE__ */ G("div", {
|
|
1058
1074
|
className: "relative isolate w-fit",
|
|
1059
1075
|
children: [r, /* @__PURE__ */ W("span", {
|
|
1060
1076
|
"aria-hidden": !0,
|
|
@@ -1063,10 +1079,10 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1063
1079
|
style: e ? { "--accent": e } : void 0,
|
|
1064
1080
|
className: Y("messaging-link-card-tail", t === "receiver" && "messaging-link-card-tail--received")
|
|
1065
1081
|
})]
|
|
1066
|
-
}) : /* @__PURE__ */ W(U, { children: r }),
|
|
1067
|
-
Composer:
|
|
1082
|
+
}) : /* @__PURE__ */ W(U, { children: r }), on = {
|
|
1083
|
+
Composer: rn,
|
|
1068
1084
|
Sent: ({ title: e, placeholderTitle: t, description: n, descriptionLines: r, url: i, mimeType: a, thumbnailUrl: o, sourceUrl: s, layout: c = "featured", appIcon: l, cta: u, accentColor: d, status: f = "ready", onClick: p, groupPosition: m = "single" }) => {
|
|
1069
|
-
let h =
|
|
1085
|
+
let h = Kt(a, s), g = jt(i), _ = u == null && g != null && !h ? g : void 0, v = u == null && !h && _ != null ? p : void 0, y = f !== "loading" && Gt(a, s), b = en({
|
|
1070
1086
|
variant: "dark",
|
|
1071
1087
|
accentColor: d,
|
|
1072
1088
|
status: f,
|
|
@@ -1075,19 +1091,19 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1075
1091
|
mimeType: a,
|
|
1076
1092
|
sourceUrl: s
|
|
1077
1093
|
});
|
|
1078
|
-
return /* @__PURE__ */ W(
|
|
1094
|
+
return /* @__PURE__ */ W(an, {
|
|
1079
1095
|
accentHex: b.accentHex,
|
|
1080
1096
|
side: "sender",
|
|
1081
1097
|
visible: !y && (m === "single" || m === "end"),
|
|
1082
|
-
children: /* @__PURE__ */ G(
|
|
1098
|
+
children: /* @__PURE__ */ G(Ht, {
|
|
1083
1099
|
variant: "dark",
|
|
1084
1100
|
href: _,
|
|
1085
1101
|
onClick: v,
|
|
1086
1102
|
fixedHeight: c === "featured" && !y,
|
|
1087
1103
|
accentHex: b.accentHex,
|
|
1088
1104
|
busy: b.isLoading,
|
|
1089
|
-
bgClassName: y ?
|
|
1090
|
-
children: [c === "featured" && /* @__PURE__ */ W(
|
|
1105
|
+
bgClassName: y ? qt : void 0,
|
|
1106
|
+
children: [c === "featured" && /* @__PURE__ */ W(Jt, {
|
|
1091
1107
|
variant: "dark",
|
|
1092
1108
|
thumbnailUrl: b.thumbnailUrl,
|
|
1093
1109
|
sourceUrl: s,
|
|
@@ -1095,7 +1111,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1095
1111
|
mimeType: a,
|
|
1096
1112
|
isLoading: b.isLoading,
|
|
1097
1113
|
onImageError: b.onImageError
|
|
1098
|
-
}), /* @__PURE__ */ W(
|
|
1114
|
+
}), /* @__PURE__ */ W(Rt, {
|
|
1099
1115
|
chinTextColor: b.chinTextColor,
|
|
1100
1116
|
variant: "dark",
|
|
1101
1117
|
ctaSurface: b.surface,
|
|
@@ -1112,12 +1128,12 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1112
1128
|
});
|
|
1113
1129
|
},
|
|
1114
1130
|
Received: ({ title: e, description: t, descriptionLines: n, url: r, mimeType: i, thumbnailUrl: a, sourceUrl: o, layout: s = "featured", appIcon: c, cta: l, accentColor: u, status: d = "ready", onClick: f, groupPosition: p = "single" }) => {
|
|
1115
|
-
let m =
|
|
1131
|
+
let m = Kt(i, o), h = jt(r), g = l == null && h != null && !m ? h : void 0, _ = l == null && !m ? f : void 0, v = d !== "loading" && Gt(i, o) ? qt : void 0, y = l && f ? {
|
|
1116
1132
|
...l,
|
|
1117
1133
|
onClick: () => {
|
|
1118
1134
|
f(), l.onClick?.();
|
|
1119
1135
|
}
|
|
1120
|
-
} : l, b =
|
|
1136
|
+
} : l, b = en({
|
|
1121
1137
|
variant: "light",
|
|
1122
1138
|
accentColor: u,
|
|
1123
1139
|
status: d,
|
|
@@ -1126,11 +1142,11 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1126
1142
|
mimeType: i,
|
|
1127
1143
|
sourceUrl: o
|
|
1128
1144
|
});
|
|
1129
|
-
return /* @__PURE__ */ W(
|
|
1145
|
+
return /* @__PURE__ */ W(an, {
|
|
1130
1146
|
accentHex: b.accentHex,
|
|
1131
1147
|
side: "receiver",
|
|
1132
1148
|
visible: v == null && (p === "single" || p === "end"),
|
|
1133
|
-
children: /* @__PURE__ */ G(
|
|
1149
|
+
children: /* @__PURE__ */ G(Ht, {
|
|
1134
1150
|
variant: "light",
|
|
1135
1151
|
href: g,
|
|
1136
1152
|
onClick: _,
|
|
@@ -1140,7 +1156,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1140
1156
|
busy: b.isLoading,
|
|
1141
1157
|
bgClassName: v,
|
|
1142
1158
|
"data-testid": "link-attachment",
|
|
1143
|
-
children: [s === "featured" && /* @__PURE__ */ W(
|
|
1159
|
+
children: [s === "featured" && /* @__PURE__ */ W(Jt, {
|
|
1144
1160
|
variant: "light",
|
|
1145
1161
|
thumbnailUrl: b.thumbnailUrl,
|
|
1146
1162
|
sourceUrl: o,
|
|
@@ -1148,7 +1164,7 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1148
1164
|
mimeType: i,
|
|
1149
1165
|
isLoading: b.isLoading,
|
|
1150
1166
|
onImageError: b.onImageError
|
|
1151
|
-
}), /* @__PURE__ */ W(
|
|
1167
|
+
}), /* @__PURE__ */ W(Rt, {
|
|
1152
1168
|
chinTextColor: b.chinTextColor,
|
|
1153
1169
|
variant: "light",
|
|
1154
1170
|
ctaSurface: b.surface,
|
|
@@ -1166,24 +1182,24 @@ var en = "flex size-6 items-center justify-center rounded-full bg-[#121110] text
|
|
|
1166
1182
|
};
|
|
1167
1183
|
//#endregion
|
|
1168
1184
|
//#region src/components/MediaMessage/index.tsx
|
|
1169
|
-
function
|
|
1185
|
+
function sn(e) {
|
|
1170
1186
|
return e.type === "link" || !!e.og_scrape_url?.trim();
|
|
1171
1187
|
}
|
|
1172
1188
|
//#endregion
|
|
1173
1189
|
//#region src/components/CustomMessage/context.tsx
|
|
1174
|
-
var
|
|
1175
|
-
function
|
|
1176
|
-
return
|
|
1190
|
+
var cn = { LockedAttachment: { isUnlocking: () => !1 } }, ln = l({}), un = ln.Provider;
|
|
1191
|
+
function dn(e) {
|
|
1192
|
+
return d(ln)[e] ?? cn[e];
|
|
1177
1193
|
}
|
|
1178
1194
|
//#endregion
|
|
1179
1195
|
//#region src/components/CustomMessage/LockedAttachment/index.tsx
|
|
1180
|
-
var
|
|
1196
|
+
var fn = s.lazy(() => import("./Card-C7uLQbYz.js")), pn = s.lazy(() => import("./Card-BdyQhysm.js")), mn = () => /* @__PURE__ */ W("div", {
|
|
1181
1197
|
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)]",
|
|
1182
1198
|
"aria-hidden": !0
|
|
1183
|
-
}),
|
|
1184
|
-
fallback: /* @__PURE__ */ W(
|
|
1185
|
-
children: e.contentType === "text" ? /* @__PURE__ */ W(
|
|
1186
|
-
}),
|
|
1199
|
+
}), hn = (e) => /* @__PURE__ */ W(c, {
|
|
1200
|
+
fallback: /* @__PURE__ */ W(mn, {}),
|
|
1201
|
+
children: e.contentType === "text" ? /* @__PURE__ */ W(fn, { ...e }) : /* @__PURE__ */ W(pn, { ...e })
|
|
1202
|
+
}), gn = ({ size: e = 15 }) => /* @__PURE__ */ W("svg", {
|
|
1187
1203
|
width: e,
|
|
1188
1204
|
height: e,
|
|
1189
1205
|
viewBox: "0 0 15 15",
|
|
@@ -1194,14 +1210,14 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1194
1210
|
fill: "currentColor",
|
|
1195
1211
|
fillOpacity: .55
|
|
1196
1212
|
})
|
|
1197
|
-
}),
|
|
1198
|
-
let r =
|
|
1213
|
+
}), _n = (e) => e.metadata?.custom_type === K.PAID, vn = (e) => e.metadata?.custom_type === K.CHATBOT, yn = (e) => e.metadata?.custom_type === K.ATTACHMENT, bn = (e) => yn(e) && e.metadata?.attachment_content_type === "text", xn = (e) => yn(e) && e.metadata?.attachment_content_type !== "text", Sn = (e) => _n(e) && !!e.metadata?.amount_text, Cn = ({ message: e, isMyMessage: t = !1, hasAttachment: n = !1 }) => {
|
|
1214
|
+
let r = _n(e), i = vn(e);
|
|
1199
1215
|
if (!r && !i) return null;
|
|
1200
1216
|
if (r) {
|
|
1201
1217
|
let t = e.metadata?.amount_text;
|
|
1202
1218
|
return t ? /* @__PURE__ */ G("div", {
|
|
1203
1219
|
className: "message-tag--paid inline-flex items-center gap-1 text-[12px] font-medium leading-[2] text-[#016630]",
|
|
1204
|
-
children: [/* @__PURE__ */ W(
|
|
1220
|
+
children: [/* @__PURE__ */ W(Fe, { size: 12 }), /* @__PURE__ */ G("span", { children: [
|
|
1205
1221
|
"Delivered with ",
|
|
1206
1222
|
t,
|
|
1207
1223
|
" message"
|
|
@@ -1213,17 +1229,17 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1213
1229
|
children: o
|
|
1214
1230
|
}), l = /* @__PURE__ */ W("span", {
|
|
1215
1231
|
className: "inline-flex items-center leading-none",
|
|
1216
|
-
children: /* @__PURE__ */ W(
|
|
1232
|
+
children: /* @__PURE__ */ W(gn, { size: a ? 12 : 15 })
|
|
1217
1233
|
});
|
|
1218
1234
|
return /* @__PURE__ */ W("div", {
|
|
1219
1235
|
className: `inline-flex items-center text-[10px] font-normal leading-4 tracking-[0.2px] ${s}`,
|
|
1220
1236
|
"data-testid": "message-chatbot-indicator",
|
|
1221
1237
|
children: t && !a ? /* @__PURE__ */ G(U, { children: [c, l] }) : /* @__PURE__ */ G(U, { children: [l, c] })
|
|
1222
1238
|
});
|
|
1223
|
-
},
|
|
1239
|
+
}, wn = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", Tn = {
|
|
1224
1240
|
me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
1225
1241
|
other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
1226
|
-
},
|
|
1242
|
+
}, En = ({ side: e }) => /* @__PURE__ */ W("span", {
|
|
1227
1243
|
"aria-hidden": "true",
|
|
1228
1244
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
1229
1245
|
style: {
|
|
@@ -1231,18 +1247,18 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1231
1247
|
insetInlineStart: e === "other" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
1232
1248
|
transform: e === "other" ? "scaleX(-1)" : void 0,
|
|
1233
1249
|
transformOrigin: "center",
|
|
1234
|
-
backgroundColor:
|
|
1235
|
-
WebkitMask:
|
|
1236
|
-
mask:
|
|
1250
|
+
backgroundColor: Tn[e],
|
|
1251
|
+
WebkitMask: wn,
|
|
1252
|
+
mask: wn
|
|
1237
1253
|
}
|
|
1238
|
-
}),
|
|
1254
|
+
}), Dn = l(void 0), On = (e) => {
|
|
1239
1255
|
let t = e.metadata?.outbound_id;
|
|
1240
1256
|
return typeof t == "string" ? t : void 0;
|
|
1241
|
-
},
|
|
1257
|
+
}, kn = (e, t) => {
|
|
1242
1258
|
if (!t || !e?.length) return;
|
|
1243
1259
|
let n = /* @__PURE__ */ new Set(), r;
|
|
1244
1260
|
for (let i of e) {
|
|
1245
|
-
let e =
|
|
1261
|
+
let e = On(i);
|
|
1246
1262
|
if (!e || n.has(e)) continue;
|
|
1247
1263
|
n.add(e);
|
|
1248
1264
|
let a = t(e);
|
|
@@ -1252,15 +1268,15 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1252
1268
|
});
|
|
1253
1269
|
}
|
|
1254
1270
|
return r;
|
|
1255
|
-
},
|
|
1271
|
+
}, An = (e, t) => {
|
|
1256
1272
|
if (e === t) return !0;
|
|
1257
1273
|
if (!e || !t) return !1;
|
|
1258
1274
|
let n = Object.keys(e), r = Object.keys(t);
|
|
1259
1275
|
return n.length === r.length && n.every((n) => e[n].id === t[n]?.id && e[n].name === t[n]?.name);
|
|
1260
|
-
},
|
|
1261
|
-
let n =
|
|
1262
|
-
return
|
|
1263
|
-
},
|
|
1276
|
+
}, jn = (e, t) => {
|
|
1277
|
+
let n = kn(e, t), [r, i] = g(n);
|
|
1278
|
+
return An(r, n) ? r : (i(n), n);
|
|
1279
|
+
}, Mn = (e) => e.metadata?.custom_type === K.TIP, Nn = ({ message: e }) => {
|
|
1264
1280
|
let t = e.metadata?.amount_text;
|
|
1265
1281
|
return t ? /* @__PURE__ */ G("div", {
|
|
1266
1282
|
className: "message-tip-pill inline-flex items-end gap-0.5 max-w-[520px] rounded-[1.5rem] bg-[#43e660] px-4 py-3 text-white",
|
|
@@ -1273,32 +1289,32 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1273
1289
|
children: [t, " tip!"]
|
|
1274
1290
|
})]
|
|
1275
1291
|
}) : null;
|
|
1276
|
-
},
|
|
1277
|
-
let { message: e } = H("SentMessageDeliveryStatus"), { messages: t } =
|
|
1292
|
+
}, Pn = () => {
|
|
1293
|
+
let { message: e } = H("SentMessageDeliveryStatus"), { messages: t } = me("SentMessageDeliveryStatus"), n = (() => {
|
|
1278
1294
|
if (t) for (let e = t.length - 1; e >= 0; --e) {
|
|
1279
1295
|
let n = t[e];
|
|
1280
1296
|
if (n.type !== "system" && n.type !== "ephemeral" && n.type !== "deleted") return n.id;
|
|
1281
1297
|
}
|
|
1282
1298
|
})();
|
|
1283
1299
|
return e.id === n;
|
|
1284
|
-
},
|
|
1300
|
+
}, Fn = () => Pn() ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(je, {
|
|
1285
1301
|
weight: "bold",
|
|
1286
1302
|
"aria-hidden": "true"
|
|
1287
1303
|
}), /* @__PURE__ */ W("span", {
|
|
1288
1304
|
"data-testid": "sent-message-delivery-status",
|
|
1289
1305
|
children: "Delivered"
|
|
1290
|
-
})] }) : null,
|
|
1306
|
+
})] }) : null, In = () => Pn() ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(Me, {
|
|
1291
1307
|
className: "sent-message-status__spinner animate-spin",
|
|
1292
1308
|
weight: "bold",
|
|
1293
1309
|
"aria-hidden": "true"
|
|
1294
1310
|
}), /* @__PURE__ */ W("span", {
|
|
1295
1311
|
"data-testid": "sent-message-sending-status",
|
|
1296
1312
|
children: "Sending"
|
|
1297
|
-
})] }) : null,
|
|
1313
|
+
})] }) : null, Ln = ({ outbound: e, onOutboundClick: t }) => {
|
|
1298
1314
|
let n = e.name || "Broadcast", r = /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("span", {
|
|
1299
1315
|
className: "sent-message-outbound-badge",
|
|
1300
1316
|
"aria-hidden": "true",
|
|
1301
|
-
children: /* @__PURE__ */ W(
|
|
1317
|
+
children: /* @__PURE__ */ W(Ie, { weight: "fill" })
|
|
1302
1318
|
}), /* @__PURE__ */ W("span", {
|
|
1303
1319
|
className: Y("sent-message-outbound-name", { "underline [text-decoration-skip-ink:auto]": !!t }),
|
|
1304
1320
|
"data-testid": "sent-message-outbound-status",
|
|
@@ -1311,28 +1327,28 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1311
1327
|
onClick: () => t(e),
|
|
1312
1328
|
children: r
|
|
1313
1329
|
}) : r;
|
|
1314
|
-
},
|
|
1330
|
+
}, Rn = () => /* @__PURE__ */ G("span", {
|
|
1315
1331
|
className: "str-chat__message-status sent-message-status--failed",
|
|
1316
|
-
children: [/* @__PURE__ */ W(
|
|
1332
|
+
children: [/* @__PURE__ */ W(qe, {
|
|
1317
1333
|
weight: "bold",
|
|
1318
1334
|
"aria-hidden": "true"
|
|
1319
1335
|
}), /* @__PURE__ */ W("span", {
|
|
1320
1336
|
"data-testid": "sent-message-failed-status",
|
|
1321
1337
|
children: "Failed to send"
|
|
1322
1338
|
})]
|
|
1323
|
-
}),
|
|
1324
|
-
let { isMyMessage: n, message: r, threadList: i } = H("SentMessageDeliveryStatus"), a = n(), o =
|
|
1339
|
+
}), zn = ({ onOutboundClick: e, resolvedOutbound: t }) => {
|
|
1340
|
+
let { isMyMessage: n, message: r, threadList: i } = H("SentMessageDeliveryStatus"), a = n(), o = Pn();
|
|
1325
1341
|
if (i) return null;
|
|
1326
|
-
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ W(
|
|
1342
|
+
if (r.status === "failed" && a && r.type !== "error") return /* @__PURE__ */ W(Rn, {});
|
|
1327
1343
|
if (!a) return null;
|
|
1328
|
-
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ W(
|
|
1344
|
+
let s = r.metadata?.outbound_id, c = r.status !== "sending" && r.status !== "failed" && s && t ? /* @__PURE__ */ W(Ln, {
|
|
1329
1345
|
outbound: t,
|
|
1330
1346
|
onOutboundClick: e
|
|
1331
|
-
}) : null, l =
|
|
1332
|
-
MessageSentStatus:
|
|
1333
|
-
MessageDeliveredStatus:
|
|
1334
|
-
MessageReadStatus:
|
|
1335
|
-
MessageSendingStatus:
|
|
1347
|
+
}) : null, l = Sn(r) ? null : /* @__PURE__ */ W(R, {
|
|
1348
|
+
MessageSentStatus: Fn,
|
|
1349
|
+
MessageDeliveredStatus: Fn,
|
|
1350
|
+
MessageReadStatus: Fn,
|
|
1351
|
+
MessageSendingStatus: Mn(r) ? Fn : In
|
|
1336
1352
|
});
|
|
1337
1353
|
return c ? /* @__PURE__ */ G("span", {
|
|
1338
1354
|
className: "sent-message-status-row",
|
|
@@ -1346,16 +1362,16 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1346
1362
|
c
|
|
1347
1363
|
]
|
|
1348
1364
|
}) : l;
|
|
1349
|
-
},
|
|
1365
|
+
}, Bn = {
|
|
1350
1366
|
dark: "bg-[#1e2330]",
|
|
1351
1367
|
light: "bg-[#f2f1ef]"
|
|
1352
|
-
},
|
|
1368
|
+
}, Vn = {
|
|
1353
1369
|
dark: "text-white",
|
|
1354
1370
|
light: "text-[#000000]"
|
|
1355
|
-
},
|
|
1371
|
+
}, Hn = {
|
|
1356
1372
|
dark: "border-white/[0.08]",
|
|
1357
1373
|
light: "border-black/[0.08]"
|
|
1358
|
-
},
|
|
1374
|
+
}, Un = (e) => e === "dark" ? "sender" : "receiver", Wn = {
|
|
1359
1375
|
sender: {
|
|
1360
1376
|
single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
|
|
1361
1377
|
first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
|
|
@@ -1368,33 +1384,33 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1368
1384
|
middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
|
|
1369
1385
|
end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
|
|
1370
1386
|
}
|
|
1371
|
-
},
|
|
1372
|
-
let u = t != null && t !== "", d = o ?? Un
|
|
1387
|
+
}, Gn = ({ variant: e, text: t, bordered: n = !0, groupPosition: r = "single", widthClassName: i = "w-[280px]", paddingClassName: a = "px-2 py-2", radiusClassName: o, className: s, children: c, "data-testid": l }) => {
|
|
1388
|
+
let u = t != null && t !== "", d = o ?? Wn[Un(e)][r];
|
|
1373
1389
|
return /* @__PURE__ */ G("div", {
|
|
1374
1390
|
"data-testid": l,
|
|
1375
1391
|
"data-group-position": r,
|
|
1376
|
-
className: Y("relative", i, "overflow-hidden", a, u && "pb-0", d,
|
|
1392
|
+
className: Y("relative", i, "overflow-hidden", a, u && "pb-0", d, Bn[e], Vn[e], n && "border", n && Hn[e], s),
|
|
1377
1393
|
children: [c, u ? /* @__PURE__ */ W("p", {
|
|
1378
1394
|
className: Y("whitespace-pre-wrap break-words leading-snug hyphens-manual", "pb-2 pt-2", "px-2"),
|
|
1379
1395
|
children: t
|
|
1380
1396
|
}) : null]
|
|
1381
1397
|
});
|
|
1382
|
-
},
|
|
1398
|
+
}, Kn = ({ onClick: e, variant: t = "overlay", ariaLabel: n = "Dismiss attachment" }) => /* @__PURE__ */ W("button", {
|
|
1383
1399
|
type: "button",
|
|
1384
1400
|
onClick: (t) => {
|
|
1385
1401
|
t.stopPropagation(), e();
|
|
1386
1402
|
},
|
|
1387
1403
|
"aria-label": n,
|
|
1388
1404
|
className: Y("flex size-6 items-center justify-center rounded-full text-white", t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"),
|
|
1389
|
-
children: /* @__PURE__ */ W(
|
|
1405
|
+
children: /* @__PURE__ */ W(Je, {
|
|
1390
1406
|
className: "size-3",
|
|
1391
1407
|
weight: "bold"
|
|
1392
1408
|
})
|
|
1393
|
-
}),
|
|
1409
|
+
}), qn = (e) => e === "received" ? "light" : "dark", Jn = ({ firstOfGroup: e, endOfGroup: t, groupedByUser: n }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Yn = ({ src: e, mimeType: t, filename: n, items: r }) => r && r.length > 0 ? r : e ? [{
|
|
1394
1410
|
src: e,
|
|
1395
1411
|
mimeType: t,
|
|
1396
1412
|
filename: n
|
|
1397
|
-
}] : [],
|
|
1413
|
+
}] : [], Xn = ({ item: t, preload: n, trailingAction: r }) => /* @__PURE__ */ G("div", {
|
|
1398
1414
|
className: "flex items-center gap-2",
|
|
1399
1415
|
children: [/* @__PURE__ */ W("audio", {
|
|
1400
1416
|
...e,
|
|
@@ -1407,8 +1423,8 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1407
1423
|
type: t.mimeType
|
|
1408
1424
|
}) : null
|
|
1409
1425
|
}), r ?? null]
|
|
1410
|
-
}),
|
|
1411
|
-
let l =
|
|
1426
|
+
}), Zn = ({ state: e, src: t, mimeType: n, filename: r, items: i, text: a, groupPosition: o, preload: s, onDismiss: c }) => {
|
|
1427
|
+
let l = qn(e), u = e === "composer" && !!c, d = Yn({
|
|
1412
1428
|
src: t,
|
|
1413
1429
|
mimeType: n,
|
|
1414
1430
|
filename: r,
|
|
@@ -1416,43 +1432,43 @@ var dn = o.lazy(() => import("./Card-C7uLQbYz.js")), fn = o.lazy(() => import(".
|
|
|
1416
1432
|
});
|
|
1417
1433
|
if (d.length === 0) return null;
|
|
1418
1434
|
let f = s ?? (d.length > 1 ? "none" : "metadata");
|
|
1419
|
-
return /* @__PURE__ */ W(
|
|
1435
|
+
return /* @__PURE__ */ W(Gn, {
|
|
1420
1436
|
variant: l,
|
|
1421
1437
|
text: a,
|
|
1422
1438
|
groupPosition: o,
|
|
1423
1439
|
"data-testid": "audio-attachment",
|
|
1424
1440
|
children: /* @__PURE__ */ W("div", {
|
|
1425
1441
|
className: "flex flex-col gap-2",
|
|
1426
|
-
children: d.map((e, t) => /* @__PURE__ */ W(
|
|
1442
|
+
children: d.map((e, t) => /* @__PURE__ */ W(Xn, {
|
|
1427
1443
|
item: e,
|
|
1428
1444
|
preload: f,
|
|
1429
|
-
trailingAction: u && t === 0 ? /* @__PURE__ */ W(
|
|
1445
|
+
trailingAction: u && t === 0 ? /* @__PURE__ */ W(Kn, {
|
|
1430
1446
|
onClick: c,
|
|
1431
1447
|
variant: "inline"
|
|
1432
1448
|
}) : void 0
|
|
1433
1449
|
}, `${e.src}-${t}`))
|
|
1434
1450
|
})
|
|
1435
1451
|
});
|
|
1436
|
-
},
|
|
1437
|
-
Composer: (e) => /* @__PURE__ */ W(
|
|
1452
|
+
}, Qn = {
|
|
1453
|
+
Composer: (e) => /* @__PURE__ */ W(Zn, {
|
|
1438
1454
|
...e,
|
|
1439
1455
|
state: "composer"
|
|
1440
1456
|
}),
|
|
1441
|
-
Sent: (e) => /* @__PURE__ */ W(
|
|
1457
|
+
Sent: (e) => /* @__PURE__ */ W(Zn, {
|
|
1442
1458
|
...e,
|
|
1443
1459
|
state: "sent"
|
|
1444
1460
|
}),
|
|
1445
|
-
Received: (e) => /* @__PURE__ */ W(
|
|
1461
|
+
Received: (e) => /* @__PURE__ */ W(Zn, {
|
|
1446
1462
|
...e,
|
|
1447
1463
|
state: "received"
|
|
1448
1464
|
})
|
|
1449
1465
|
};
|
|
1450
1466
|
//#endregion
|
|
1451
1467
|
//#region src/components/MessageAttachment/_shared/fileMeta.ts
|
|
1452
|
-
function
|
|
1468
|
+
function $n(e) {
|
|
1453
1469
|
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : e < 1073741824 ? `${(e / 1048576).toFixed(2)} MB` : `${(e / 1073741824).toFixed(2)} GB`;
|
|
1454
1470
|
}
|
|
1455
|
-
var
|
|
1471
|
+
var er = {
|
|
1456
1472
|
pdf: "PDF",
|
|
1457
1473
|
doc: "DOC",
|
|
1458
1474
|
xls: "XLS",
|
|
@@ -1462,25 +1478,25 @@ var $n = {
|
|
|
1462
1478
|
text: "TXT",
|
|
1463
1479
|
markdown: "MD"
|
|
1464
1480
|
};
|
|
1465
|
-
function
|
|
1466
|
-
if (
|
|
1467
|
-
let e =
|
|
1468
|
-
if (e > 0 && e <
|
|
1469
|
-
let
|
|
1470
|
-
if (
|
|
1481
|
+
function tr(e, t) {
|
|
1482
|
+
if (t) {
|
|
1483
|
+
let e = t.lastIndexOf(".");
|
|
1484
|
+
if (e > 0 && e < t.length - 1) {
|
|
1485
|
+
let n = t.slice(e + 1);
|
|
1486
|
+
if (n && n.length <= 5) return n.toUpperCase();
|
|
1471
1487
|
}
|
|
1472
1488
|
}
|
|
1473
1489
|
if (!e) return;
|
|
1474
|
-
if (
|
|
1475
|
-
let t =
|
|
1490
|
+
if (n(e) === "document") {
|
|
1491
|
+
let t = er[a(e)];
|
|
1476
1492
|
if (t) return t;
|
|
1477
1493
|
if (e === "application/octet-stream") return;
|
|
1478
1494
|
}
|
|
1479
1495
|
let r = e.split("/")[1];
|
|
1480
1496
|
if (!(!r || r === "*")) return r.toUpperCase();
|
|
1481
1497
|
}
|
|
1482
|
-
function
|
|
1483
|
-
return [
|
|
1498
|
+
function nr(e, t, n) {
|
|
1499
|
+
return [tr(e, t), typeof n == "number" && n > 0 ? $n(n) : void 0].filter(Boolean).join(" · ") || void 0;
|
|
1484
1500
|
}
|
|
1485
1501
|
function Q(e) {
|
|
1486
1502
|
try {
|
|
@@ -1492,21 +1508,21 @@ function Q(e) {
|
|
|
1492
1508
|
}
|
|
1493
1509
|
//#endregion
|
|
1494
1510
|
//#region src/components/MessageAttachment/_shared/CompactDocumentRow.tsx
|
|
1495
|
-
var
|
|
1511
|
+
var rr = {
|
|
1496
1512
|
dark: "text-white/55",
|
|
1497
1513
|
light: "text-black/65"
|
|
1498
|
-
},
|
|
1514
|
+
}, ir = {
|
|
1499
1515
|
dark: "bg-white/10",
|
|
1500
1516
|
light: "bg-black/5"
|
|
1501
|
-
},
|
|
1517
|
+
}, ar = {
|
|
1502
1518
|
dark: "text-white/85",
|
|
1503
1519
|
light: "text-black/85"
|
|
1504
|
-
},
|
|
1505
|
-
let l =
|
|
1506
|
-
className: Y("flex size-10 shrink-0 items-center justify-center rounded-sm",
|
|
1520
|
+
}, or = ({ variant: e, filename: t, title: n, mimeType: i = "application/octet-stream", fileSize: a, onActivate: o, activateLabel: s, trailingAction: c }) => {
|
|
1521
|
+
let l = n ?? t ?? "File", u = nr(i, t, a), d = /* @__PURE__ */ W("div", {
|
|
1522
|
+
className: Y("flex size-10 shrink-0 items-center justify-center rounded-sm", ir[e]),
|
|
1507
1523
|
"aria-hidden": !0,
|
|
1508
|
-
children:
|
|
1509
|
-
className: Y("size-6",
|
|
1524
|
+
children: r(i, {
|
|
1525
|
+
className: Y("size-6", ar[e]),
|
|
1510
1526
|
weight: "regular"
|
|
1511
1527
|
})
|
|
1512
1528
|
}), f = /* @__PURE__ */ G("div", {
|
|
@@ -1515,7 +1531,7 @@ var nr = {
|
|
|
1515
1531
|
className: "truncate font-medium leading-snug",
|
|
1516
1532
|
children: l
|
|
1517
1533
|
}), u ? /* @__PURE__ */ W("p", {
|
|
1518
|
-
className: Y("truncate text-xs leading-4",
|
|
1534
|
+
className: Y("truncate text-xs leading-4", rr[e]),
|
|
1519
1535
|
children: u
|
|
1520
1536
|
}) : null]
|
|
1521
1537
|
}), p = o ? /* @__PURE__ */ G("button", {
|
|
@@ -1535,7 +1551,7 @@ var nr = {
|
|
|
1535
1551
|
};
|
|
1536
1552
|
//#endregion
|
|
1537
1553
|
//#region src/components/MessageAttachment/_shared/triggerDownload.ts
|
|
1538
|
-
async function
|
|
1554
|
+
async function sr(e, t) {
|
|
1539
1555
|
let n = t ?? Q(e);
|
|
1540
1556
|
try {
|
|
1541
1557
|
let t = await fetch(e, { mode: "cors" });
|
|
@@ -1551,15 +1567,15 @@ async function or(e, t) {
|
|
|
1551
1567
|
}
|
|
1552
1568
|
//#endregion
|
|
1553
1569
|
//#region src/components/MessageAttachment/File/index.tsx
|
|
1554
|
-
var
|
|
1570
|
+
var cr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a }) => a && a.length > 0 ? a : e ? [{
|
|
1555
1571
|
src: e,
|
|
1556
1572
|
filename: t,
|
|
1557
1573
|
fileSize: n,
|
|
1558
1574
|
mimeType: r,
|
|
1559
1575
|
title: i
|
|
1560
|
-
}] : [],
|
|
1576
|
+
}] : [], lr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
1561
1577
|
let a = t.filename ?? Q(t.src);
|
|
1562
|
-
return /* @__PURE__ */ W(
|
|
1578
|
+
return /* @__PURE__ */ W(or, {
|
|
1563
1579
|
variant: e,
|
|
1564
1580
|
filename: a,
|
|
1565
1581
|
title: t.title,
|
|
@@ -1569,8 +1585,8 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1569
1585
|
activateLabel: `Download ${a}`,
|
|
1570
1586
|
trailingAction: i
|
|
1571
1587
|
});
|
|
1572
|
-
},
|
|
1573
|
-
let d =
|
|
1588
|
+
}, ur = ({ state: e, src: t, filename: n, fileSize: r, mimeType: i, title: a, items: o, text: s, groupPosition: c, onClick: l, onDismiss: u }) => {
|
|
1589
|
+
let d = qn(e), f = e === "composer" && !!u, p = cr({
|
|
1574
1590
|
src: t,
|
|
1575
1591
|
filename: n,
|
|
1576
1592
|
fileSize: r,
|
|
@@ -1582,55 +1598,55 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1582
1598
|
let t = p[e];
|
|
1583
1599
|
if (!t) return;
|
|
1584
1600
|
let n = t.filename ?? Q(t.src);
|
|
1585
|
-
|
|
1601
|
+
sr(t.src, n);
|
|
1586
1602
|
};
|
|
1587
1603
|
if (p.length === 0) return null;
|
|
1588
1604
|
let h = /* @__PURE__ */ W("span", {
|
|
1589
1605
|
className: Y("flex size-8 items-center justify-center rounded-full", d === "dark" ? "text-white/70" : "text-black/70"),
|
|
1590
1606
|
"aria-hidden": !0,
|
|
1591
|
-
children: /* @__PURE__ */ W(
|
|
1607
|
+
children: /* @__PURE__ */ W(Z, {
|
|
1592
1608
|
className: "size-5",
|
|
1593
1609
|
weight: "bold"
|
|
1594
1610
|
})
|
|
1595
1611
|
});
|
|
1596
|
-
return /* @__PURE__ */ W(
|
|
1612
|
+
return /* @__PURE__ */ W(Gn, {
|
|
1597
1613
|
variant: d,
|
|
1598
1614
|
text: s,
|
|
1599
1615
|
groupPosition: c,
|
|
1600
1616
|
"data-testid": "file-attachment",
|
|
1601
1617
|
children: /* @__PURE__ */ W("div", {
|
|
1602
1618
|
className: "flex flex-col gap-2",
|
|
1603
|
-
children: p.map((e, t) => /* @__PURE__ */ W(
|
|
1619
|
+
children: p.map((e, t) => /* @__PURE__ */ W(lr, {
|
|
1604
1620
|
variant: d,
|
|
1605
1621
|
item: e,
|
|
1606
1622
|
index: t,
|
|
1607
1623
|
onActivate: m,
|
|
1608
|
-
trailingAction: f && t === 0 ? /* @__PURE__ */ W(
|
|
1624
|
+
trailingAction: f && t === 0 ? /* @__PURE__ */ W(Kn, {
|
|
1609
1625
|
onClick: u,
|
|
1610
1626
|
variant: "inline"
|
|
1611
1627
|
}) : h
|
|
1612
1628
|
}, `${e.src}-${t}`))
|
|
1613
1629
|
})
|
|
1614
1630
|
});
|
|
1615
|
-
},
|
|
1616
|
-
Composer: (e) => /* @__PURE__ */ W(
|
|
1631
|
+
}, dr = {
|
|
1632
|
+
Composer: (e) => /* @__PURE__ */ W(ur, {
|
|
1617
1633
|
...e,
|
|
1618
1634
|
state: "composer"
|
|
1619
1635
|
}),
|
|
1620
|
-
Sent: (e) => /* @__PURE__ */ W(
|
|
1636
|
+
Sent: (e) => /* @__PURE__ */ W(ur, {
|
|
1621
1637
|
...e,
|
|
1622
1638
|
state: "sent"
|
|
1623
1639
|
}),
|
|
1624
|
-
Received: (e) => /* @__PURE__ */ W(
|
|
1640
|
+
Received: (e) => /* @__PURE__ */ W(ur, {
|
|
1625
1641
|
...e,
|
|
1626
1642
|
state: "received"
|
|
1627
1643
|
})
|
|
1628
|
-
},
|
|
1644
|
+
}, fr = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", pr = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", mr = ({ onPrev: e, onNext: t, prevLabel: n = "Previous", nextLabel: r = "Next" }) => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("button", {
|
|
1629
1645
|
type: "button",
|
|
1630
1646
|
onClick: e,
|
|
1631
1647
|
"aria-label": n,
|
|
1632
|
-
className: `${
|
|
1633
|
-
children: /* @__PURE__ */ W(
|
|
1648
|
+
className: `${pr} left-4`,
|
|
1649
|
+
children: /* @__PURE__ */ W(ke, {
|
|
1634
1650
|
size: 20,
|
|
1635
1651
|
weight: "bold",
|
|
1636
1652
|
"aria-hidden": !0
|
|
@@ -1639,87 +1655,79 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1639
1655
|
type: "button",
|
|
1640
1656
|
onClick: t,
|
|
1641
1657
|
"aria-label": r,
|
|
1642
|
-
className: `${
|
|
1643
|
-
children: /* @__PURE__ */ W(
|
|
1658
|
+
className: `${pr} right-4`,
|
|
1659
|
+
children: /* @__PURE__ */ W(Ae, {
|
|
1644
1660
|
size: 20,
|
|
1645
1661
|
weight: "bold",
|
|
1646
1662
|
"aria-hidden": !0
|
|
1647
1663
|
})
|
|
1648
|
-
})] }),
|
|
1649
|
-
let [
|
|
1650
|
-
|
|
1651
|
-
|
|
1664
|
+
})] }), hr = ({ url: e, filename: n, variant: r = "pill", label: i = "Download", iconOnly: a, tone: o = "dark", onTriggered: s }) => {
|
|
1665
|
+
let [c, l] = g(!1), d = u((t) => {
|
|
1666
|
+
t.stopPropagation(), !c && (l(!0), sr(e, n).catch(() => {}).finally(() => {
|
|
1667
|
+
l(!1), s?.();
|
|
1652
1668
|
}));
|
|
1653
1669
|
}, [
|
|
1654
|
-
|
|
1670
|
+
c,
|
|
1655
1671
|
e,
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
]),
|
|
1659
|
-
className: Y(
|
|
1672
|
+
n,
|
|
1673
|
+
s
|
|
1674
|
+
]), f = a ?? r !== "pill", p = {
|
|
1675
|
+
className: Y(r === "pill" ? "size-4" : "size-5", "shrink-0"),
|
|
1660
1676
|
weight: "bold"
|
|
1661
1677
|
};
|
|
1662
|
-
return
|
|
1678
|
+
return r === "inline" ? /* @__PURE__ */ W("button", {
|
|
1663
1679
|
type: "button",
|
|
1664
|
-
onClick:
|
|
1665
|
-
disabled:
|
|
1666
|
-
"aria-label":
|
|
1680
|
+
onClick: d,
|
|
1681
|
+
disabled: c,
|
|
1682
|
+
"aria-label": i,
|
|
1667
1683
|
className: Y("flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70", {
|
|
1668
1684
|
dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
|
|
1669
1685
|
light: "text-black/70 hover:bg-black/[0.08] hover:text-black"
|
|
1670
|
-
}[
|
|
1671
|
-
children:
|
|
1672
|
-
className: "size-4 animate-spin",
|
|
1673
|
-
weight: "bold",
|
|
1674
|
-
"aria-hidden": !0
|
|
1675
|
-
}) : /* @__PURE__ */ W(X, {
|
|
1686
|
+
}[o]),
|
|
1687
|
+
children: c ? /* @__PURE__ */ W(t, { "aria-hidden": !0 }) : /* @__PURE__ */ W(Z, {
|
|
1676
1688
|
className: "size-5 shrink-0",
|
|
1677
1689
|
weight: "bold",
|
|
1678
1690
|
"aria-hidden": !0
|
|
1679
1691
|
})
|
|
1680
|
-
}) :
|
|
1692
|
+
}) : r === "viewer" ? /* @__PURE__ */ W("button", {
|
|
1681
1693
|
type: "button",
|
|
1682
|
-
onClick:
|
|
1683
|
-
disabled:
|
|
1684
|
-
"aria-label":
|
|
1685
|
-
className:
|
|
1686
|
-
children: W(
|
|
1694
|
+
onClick: d,
|
|
1695
|
+
disabled: c,
|
|
1696
|
+
"aria-label": i,
|
|
1697
|
+
className: fr,
|
|
1698
|
+
children: W(c ? Me : Z, {
|
|
1687
1699
|
size: 20,
|
|
1688
1700
|
weight: "bold",
|
|
1689
1701
|
"aria-hidden": !0
|
|
1690
1702
|
})
|
|
1691
1703
|
}) : /* @__PURE__ */ G("button", {
|
|
1692
1704
|
type: "button",
|
|
1693
|
-
onClick:
|
|
1694
|
-
disabled:
|
|
1695
|
-
"aria-label":
|
|
1696
|
-
className: Y("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",
|
|
1697
|
-
children: [
|
|
1698
|
-
|
|
1699
|
-
weight: "bold",
|
|
1700
|
-
"aria-hidden": !0
|
|
1701
|
-
}) : /* @__PURE__ */ W(X, {
|
|
1702
|
-
...f,
|
|
1705
|
+
onClick: d,
|
|
1706
|
+
disabled: c,
|
|
1707
|
+
"aria-label": f ? i : void 0,
|
|
1708
|
+
className: Y("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", o === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"),
|
|
1709
|
+
children: [c ? /* @__PURE__ */ W(t, { "aria-hidden": !0 }) : /* @__PURE__ */ W(Z, {
|
|
1710
|
+
...p,
|
|
1703
1711
|
"aria-hidden": !0
|
|
1704
|
-
}),
|
|
1712
|
+
}), f ? null : i]
|
|
1705
1713
|
});
|
|
1706
|
-
},
|
|
1707
|
-
let r =
|
|
1708
|
-
|
|
1709
|
-
n && a(
|
|
1714
|
+
}, gr = (e, t, n) => Math.min(Math.max(e, t), n), _r = ({ length: e, initialIndex: t, open: n }) => {
|
|
1715
|
+
let r = gr(t, 0, Math.max(e - 1, 0)), [i, a] = g(r);
|
|
1716
|
+
f(() => {
|
|
1717
|
+
n && a(gr(t, 0, Math.max(e - 1, 0)));
|
|
1710
1718
|
}, [
|
|
1711
1719
|
n,
|
|
1712
1720
|
t,
|
|
1713
1721
|
e
|
|
1714
|
-
]),
|
|
1715
|
-
a((t) =>
|
|
1722
|
+
]), f(() => {
|
|
1723
|
+
a((t) => gr(t, 0, Math.max(e - 1, 0)));
|
|
1716
1724
|
}, [e]);
|
|
1717
|
-
let o =
|
|
1725
|
+
let o = u(() => {
|
|
1718
1726
|
e <= 1 || a((t) => t <= 0 ? e - 1 : t - 1);
|
|
1719
|
-
}, [e]), s =
|
|
1727
|
+
}, [e]), s = u(() => {
|
|
1720
1728
|
e <= 1 || a((t) => t >= e - 1 ? 0 : t + 1);
|
|
1721
1729
|
}, [e]);
|
|
1722
|
-
return
|
|
1730
|
+
return f(() => {
|
|
1723
1731
|
if (!n || e <= 1) return;
|
|
1724
1732
|
let t = (e) => {
|
|
1725
1733
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
@@ -1737,9 +1745,9 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1737
1745
|
prev: o,
|
|
1738
1746
|
next: s
|
|
1739
1747
|
};
|
|
1740
|
-
},
|
|
1741
|
-
let s =
|
|
1742
|
-
return
|
|
1748
|
+
}, vr = ({ open: e, onClose: t, ariaLabel: n, counter: r, actions: i, children: a, "data-testid": o }) => {
|
|
1749
|
+
let s = h(null), c = h(null);
|
|
1750
|
+
return f(() => {
|
|
1743
1751
|
let t = s.current;
|
|
1744
1752
|
if (t) {
|
|
1745
1753
|
if (e) {
|
|
@@ -1796,8 +1804,8 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1796
1804
|
type: "button",
|
|
1797
1805
|
onClick: t,
|
|
1798
1806
|
"aria-label": "Close viewer",
|
|
1799
|
-
className:
|
|
1800
|
-
children: /* @__PURE__ */ W(
|
|
1807
|
+
className: fr,
|
|
1808
|
+
children: /* @__PURE__ */ W(Je, {
|
|
1801
1809
|
size: 20,
|
|
1802
1810
|
weight: "bold",
|
|
1803
1811
|
"aria-hidden": !0
|
|
@@ -1809,18 +1817,18 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1809
1817
|
children: a
|
|
1810
1818
|
})]
|
|
1811
1819
|
});
|
|
1812
|
-
},
|
|
1813
|
-
let { index: i, prev: a, next: o } =
|
|
1820
|
+
}, yr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
1821
|
+
let { index: i, prev: a, next: o } = _r({
|
|
1814
1822
|
length: t.length,
|
|
1815
1823
|
initialIndex: n,
|
|
1816
1824
|
open: e
|
|
1817
|
-
}), s = t[i], c =
|
|
1818
|
-
return s ? /* @__PURE__ */ G(
|
|
1825
|
+
}), s = t[i], c = m(() => s?.filename ?? (s ? Q(s.src) : "image"), [s]);
|
|
1826
|
+
return s ? /* @__PURE__ */ G(vr, {
|
|
1819
1827
|
open: e,
|
|
1820
1828
|
onClose: r,
|
|
1821
1829
|
ariaLabel: c,
|
|
1822
1830
|
counter: t.length > 1 ? `${i + 1} / ${t.length}` : void 0,
|
|
1823
|
-
actions: /* @__PURE__ */ W(
|
|
1831
|
+
actions: /* @__PURE__ */ W(hr, {
|
|
1824
1832
|
url: s.src,
|
|
1825
1833
|
filename: c,
|
|
1826
1834
|
variant: "viewer",
|
|
@@ -1833,14 +1841,14 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1833
1841
|
draggable: !1,
|
|
1834
1842
|
decoding: "async",
|
|
1835
1843
|
className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] select-none object-contain"
|
|
1836
|
-
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ W(
|
|
1844
|
+
}, `${i}:${s.src}`) : null, t.length > 1 ? /* @__PURE__ */ W(mr, {
|
|
1837
1845
|
onPrev: a,
|
|
1838
1846
|
onNext: o,
|
|
1839
1847
|
prevLabel: "Previous image",
|
|
1840
1848
|
nextLabel: "Next image"
|
|
1841
1849
|
}) : null]
|
|
1842
1850
|
}) : null;
|
|
1843
|
-
},
|
|
1851
|
+
}, br = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", xr = {
|
|
1844
1852
|
1: ["rounded-[18px]"],
|
|
1845
1853
|
2: ["rounded-l-[18px]", "rounded-r-[18px]"],
|
|
1846
1854
|
3: [
|
|
@@ -1854,7 +1862,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1854
1862
|
"rounded-bl-[18px]",
|
|
1855
1863
|
"rounded-br-[18px]"
|
|
1856
1864
|
]
|
|
1857
|
-
},
|
|
1865
|
+
}, Sr = "--mes-single-width-cap", Cr = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", wr = 436, Tr = ({ tiles: e, onTileActivate: t, maxVisible: n = 4, singleAspectRatio: r, className: i }) => {
|
|
1858
1866
|
let a = e.length;
|
|
1859
1867
|
if (a === 0) return null;
|
|
1860
1868
|
let o = e.slice(0, Math.min(a, n)), s = a - o.length, c = s > 0 ? /* @__PURE__ */ G("div", {
|
|
@@ -1862,7 +1870,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1862
1870
|
className: "absolute inset-0 flex items-center justify-center bg-[#040403]/50 text-2xl font-bold leading-[28px] tracking-[-0.24px] text-white",
|
|
1863
1871
|
children: ["+", s]
|
|
1864
1872
|
}) : null, l = (e, n, r) => {
|
|
1865
|
-
let i = Y(
|
|
1873
|
+
let i = Y(br, "h-full w-full", xr[o.length]?.[n]);
|
|
1866
1874
|
return t ? /* @__PURE__ */ G("button", {
|
|
1867
1875
|
type: "button",
|
|
1868
1876
|
onClick: () => t(n),
|
|
@@ -1876,10 +1884,10 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1876
1884
|
}, u;
|
|
1877
1885
|
return r && (u = {
|
|
1878
1886
|
aspectRatio: r,
|
|
1879
|
-
width: `min(var(${
|
|
1887
|
+
width: `min(var(${Sr}), ${Math.round(wr * r * 100) / 100}px)`,
|
|
1880
1888
|
maxWidth: "100%"
|
|
1881
1889
|
}), o.length === 1 ? /* @__PURE__ */ W("div", {
|
|
1882
|
-
className: Y(r ?
|
|
1890
|
+
className: Y(r ? Cr : "aspect-square w-full", i),
|
|
1883
1891
|
style: u,
|
|
1884
1892
|
children: l(o[0], 0, c)
|
|
1885
1893
|
}) : o.length === 2 ? /* @__PURE__ */ W("div", {
|
|
@@ -1902,53 +1910,53 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1902
1910
|
return l(e, t, n ? c : null);
|
|
1903
1911
|
})
|
|
1904
1912
|
});
|
|
1905
|
-
},
|
|
1906
|
-
let [r, i] =
|
|
1913
|
+
}, Er = ({ src: e, suppliedRatio: t, fallbackRatio: n }) => {
|
|
1914
|
+
let [r, i] = s.useState(), a = s.useCallback((t) => {
|
|
1907
1915
|
if (!t || t.naturalWidth <= 0 || t.naturalHeight <= 0 || e === void 0) return;
|
|
1908
1916
|
let n = t.naturalWidth / t.naturalHeight;
|
|
1909
1917
|
i((t) => t && t.src === e && t.ratio === n ? t : {
|
|
1910
1918
|
src: e,
|
|
1911
1919
|
ratio: n
|
|
1912
1920
|
});
|
|
1913
|
-
}, [e]),
|
|
1921
|
+
}, [e]), o = s.useCallback((e) => a(e.currentTarget), [a]), c = r && r.src === e ? r.ratio : void 0;
|
|
1914
1922
|
return {
|
|
1915
1923
|
ratio: t ?? c ?? n,
|
|
1916
1924
|
imgRef: a,
|
|
1917
|
-
onLoad:
|
|
1925
|
+
onLoad: o
|
|
1918
1926
|
};
|
|
1919
|
-
},
|
|
1920
|
-
let [t, n] =
|
|
1927
|
+
}, Dr = (e) => {
|
|
1928
|
+
let [t, n] = g(!1), [r, i] = g(0);
|
|
1921
1929
|
return {
|
|
1922
1930
|
viewerOpen: t,
|
|
1923
1931
|
viewerIndex: r,
|
|
1924
|
-
handleActivate:
|
|
1932
|
+
handleActivate: u((t) => {
|
|
1925
1933
|
e?.(t) !== !1 && (i(t), n(!0));
|
|
1926
1934
|
}, [e]),
|
|
1927
|
-
closeViewer:
|
|
1935
|
+
closeViewer: u(() => n(!1), [])
|
|
1928
1936
|
};
|
|
1929
|
-
},
|
|
1937
|
+
}, Or = ({ item: e, index: t, totalCount: n, fallbackLoading: r, imgRef: i, onLoad: a }) => ({
|
|
1930
1938
|
ariaLabel: `Open image ${t + 1} of ${n}`,
|
|
1931
1939
|
content: /* @__PURE__ */ W("img", {
|
|
1932
1940
|
ref: i,
|
|
1933
|
-
src:
|
|
1941
|
+
src: o(e.src) ?? e.src,
|
|
1934
1942
|
alt: e.alt ?? "",
|
|
1935
1943
|
width: e.width,
|
|
1936
1944
|
height: e.height,
|
|
1937
1945
|
draggable: !1,
|
|
1938
1946
|
loading: e.loading ?? r,
|
|
1939
1947
|
decoding: "async",
|
|
1940
|
-
onLoad:
|
|
1948
|
+
onLoad: a,
|
|
1941
1949
|
className: "absolute inset-0 size-full object-cover"
|
|
1942
1950
|
})
|
|
1943
|
-
}),
|
|
1951
|
+
}), kr = ({ src: e, alt: t, items: n }) => n && n.length > 0 ? n : e ? [{
|
|
1944
1952
|
src: e,
|
|
1945
1953
|
alt: t
|
|
1946
|
-
}] : [],
|
|
1954
|
+
}] : [], Ar = (e, t) => e.map((n, r) => ({
|
|
1947
1955
|
src: n.src,
|
|
1948
1956
|
alt: n.alt,
|
|
1949
1957
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
1950
|
-
})),
|
|
1951
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
1958
|
+
})), jr = ({ src: e, alt: t, filename: n, loading: r = "lazy", onClick: i, onDismiss: a }) => {
|
|
1959
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Dr(i);
|
|
1952
1960
|
return /* @__PURE__ */ G("div", {
|
|
1953
1961
|
className: "relative w-fit",
|
|
1954
1962
|
children: [
|
|
@@ -1958,7 +1966,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1958
1966
|
"aria-label": "Open image",
|
|
1959
1967
|
className: "block size-[280px] cursor-zoom-in overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
1960
1968
|
children: /* @__PURE__ */ W("img", {
|
|
1961
|
-
src:
|
|
1969
|
+
src: o(e) ?? e,
|
|
1962
1970
|
alt: t ?? "",
|
|
1963
1971
|
draggable: !1,
|
|
1964
1972
|
loading: r,
|
|
@@ -1966,13 +1974,13 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1966
1974
|
className: "size-full object-cover"
|
|
1967
1975
|
})
|
|
1968
1976
|
}),
|
|
1969
|
-
|
|
1977
|
+
a ? /* @__PURE__ */ W("div", {
|
|
1970
1978
|
className: "absolute right-2 top-2 z-10",
|
|
1971
|
-
children: /* @__PURE__ */ W(
|
|
1979
|
+
children: /* @__PURE__ */ W(Kn, { onClick: a })
|
|
1972
1980
|
}) : null,
|
|
1973
|
-
/* @__PURE__ */ W(
|
|
1981
|
+
/* @__PURE__ */ W(yr, {
|
|
1974
1982
|
open: s,
|
|
1975
|
-
items:
|
|
1983
|
+
items: Ar([{
|
|
1976
1984
|
src: e,
|
|
1977
1985
|
alt: t
|
|
1978
1986
|
}], n),
|
|
@@ -1981,18 +1989,18 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
1981
1989
|
})
|
|
1982
1990
|
]
|
|
1983
1991
|
});
|
|
1984
|
-
},
|
|
1985
|
-
let l =
|
|
1992
|
+
}, Mr = 326 / 246, Nr = ({ state: e, src: t, alt: n, filename: r, items: i, text: a, groupPosition: o, loading: s = "lazy", onClick: c }) => {
|
|
1993
|
+
let l = kr({
|
|
1986
1994
|
src: t,
|
|
1987
1995
|
alt: n,
|
|
1988
1996
|
items: i
|
|
1989
|
-
}), u =
|
|
1997
|
+
}), u = qn(e), { viewerOpen: d, viewerIndex: f, handleActivate: p, closeViewer: m } = Dr(c), h = l.length === 1, g = h ? l[0] : void 0, _ = Er({
|
|
1990
1998
|
src: g?.src,
|
|
1991
1999
|
suppliedRatio: g?.width && g?.height ? g.width / g.height : void 0,
|
|
1992
|
-
fallbackRatio:
|
|
2000
|
+
fallbackRatio: Mr
|
|
1993
2001
|
});
|
|
1994
2002
|
if (l.length === 0) return null;
|
|
1995
|
-
let v = l.map((e, t) =>
|
|
2003
|
+
let v = l.map((e, t) => Or({
|
|
1996
2004
|
item: e,
|
|
1997
2005
|
index: t,
|
|
1998
2006
|
totalCount: l.length,
|
|
@@ -2000,7 +2008,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2000
2008
|
imgRef: h ? _.imgRef : void 0,
|
|
2001
2009
|
onLoad: h ? _.onLoad : void 0
|
|
2002
2010
|
}));
|
|
2003
|
-
return /* @__PURE__ */ G(
|
|
2011
|
+
return /* @__PURE__ */ G(Gn, {
|
|
2004
2012
|
variant: u,
|
|
2005
2013
|
text: a,
|
|
2006
2014
|
groupPosition: o,
|
|
@@ -2011,35 +2019,35 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2011
2019
|
"data-testid": "image-attachment",
|
|
2012
2020
|
children: [/* @__PURE__ */ W("div", {
|
|
2013
2021
|
className: "relative",
|
|
2014
|
-
children: /* @__PURE__ */ W(
|
|
2022
|
+
children: /* @__PURE__ */ W(Tr, {
|
|
2015
2023
|
tiles: v,
|
|
2016
2024
|
onTileActivate: p,
|
|
2017
2025
|
singleAspectRatio: h ? _.ratio : void 0
|
|
2018
2026
|
})
|
|
2019
|
-
}), /* @__PURE__ */ W(
|
|
2027
|
+
}), /* @__PURE__ */ W(yr, {
|
|
2020
2028
|
open: d,
|
|
2021
|
-
items:
|
|
2029
|
+
items: Ar(l, r),
|
|
2022
2030
|
initialIndex: f,
|
|
2023
2031
|
onClose: m
|
|
2024
2032
|
})]
|
|
2025
2033
|
});
|
|
2026
|
-
},
|
|
2027
|
-
Composer: (e) => /* @__PURE__ */ W(
|
|
2028
|
-
Sent: (e) => /* @__PURE__ */ W(
|
|
2034
|
+
}, Pr = {
|
|
2035
|
+
Composer: (e) => /* @__PURE__ */ W(jr, { ...e }),
|
|
2036
|
+
Sent: (e) => /* @__PURE__ */ W(Nr, {
|
|
2029
2037
|
...e,
|
|
2030
2038
|
state: "sent"
|
|
2031
2039
|
}),
|
|
2032
|
-
Received: (e) => /* @__PURE__ */ W(
|
|
2040
|
+
Received: (e) => /* @__PURE__ */ W(Nr, {
|
|
2033
2041
|
...e,
|
|
2034
2042
|
state: "received"
|
|
2035
2043
|
})
|
|
2036
|
-
},
|
|
2037
|
-
let { index: i, prev: a, next: o } =
|
|
2044
|
+
}, Fr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
2045
|
+
let { index: i, prev: a, next: o } = _r({
|
|
2038
2046
|
length: t.length,
|
|
2039
2047
|
initialIndex: n,
|
|
2040
2048
|
open: e
|
|
2041
|
-
}), s = t[i], c =
|
|
2042
|
-
return !s || !l ? null : /* @__PURE__ */ G(
|
|
2049
|
+
}), s = t[i], c = m(() => s?.filename ?? (s ? Q(s.src) : "document"), [s]), l = m(() => s ? Ir(s.src) : void 0, [s]);
|
|
2050
|
+
return !s || !l ? null : /* @__PURE__ */ G(vr, {
|
|
2043
2051
|
open: e,
|
|
2044
2052
|
onClose: r,
|
|
2045
2053
|
ariaLabel: c,
|
|
@@ -2050,24 +2058,24 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2050
2058
|
title: c,
|
|
2051
2059
|
className: "block h-[calc(100dvh-128px)] w-[min(96vw,1400px)] border-0 bg-white",
|
|
2052
2060
|
sandbox: "allow-scripts allow-forms allow-popups allow-downloads"
|
|
2053
|
-
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ W(
|
|
2061
|
+
}, `${i}:${s.src}`), t.length > 1 ? /* @__PURE__ */ W(mr, {
|
|
2054
2062
|
onPrev: a,
|
|
2055
2063
|
onNext: o,
|
|
2056
2064
|
prevLabel: "Previous document",
|
|
2057
2065
|
nextLabel: "Next document"
|
|
2058
2066
|
}) : null]
|
|
2059
2067
|
});
|
|
2060
|
-
},
|
|
2068
|
+
}, Ir = (e) => {
|
|
2061
2069
|
let t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1), i = new URLSearchParams(r);
|
|
2062
2070
|
return i.has("toolbar") || i.set("toolbar", "0"), i.has("navpanes") || i.set("navpanes", "0"), `${n}#${i.toString()}`;
|
|
2063
|
-
},
|
|
2071
|
+
}, Lr = ({ src: e, filename: t, fileSize: n, title: r, items: i }) => i && i.length > 0 ? i : e ? [{
|
|
2064
2072
|
src: e,
|
|
2065
2073
|
filename: t,
|
|
2066
2074
|
fileSize: n,
|
|
2067
2075
|
title: r
|
|
2068
|
-
}] : [],
|
|
2076
|
+
}] : [], Rr = ({ variant: e, item: t, index: n, onActivate: r, trailingAction: i }) => {
|
|
2069
2077
|
let a = t.filename ?? Q(t.src);
|
|
2070
|
-
return /* @__PURE__ */ W(
|
|
2078
|
+
return /* @__PURE__ */ W(or, {
|
|
2071
2079
|
variant: e,
|
|
2072
2080
|
filename: a,
|
|
2073
2081
|
title: t.title,
|
|
@@ -2077,20 +2085,20 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2077
2085
|
activateLabel: `Open ${a}`,
|
|
2078
2086
|
trailingAction: i
|
|
2079
2087
|
});
|
|
2080
|
-
},
|
|
2081
|
-
let u =
|
|
2088
|
+
}, zr = ({ state: e, src: t, filename: n, fileSize: r, title: i, items: a, text: o, groupPosition: s, onClick: c, onDismiss: l }) => {
|
|
2089
|
+
let u = qn(e), d = Lr({
|
|
2082
2090
|
src: t,
|
|
2083
2091
|
filename: n,
|
|
2084
2092
|
fileSize: r,
|
|
2085
2093
|
title: i,
|
|
2086
2094
|
items: a
|
|
2087
|
-
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } =
|
|
2095
|
+
}), { viewerOpen: f, viewerIndex: p, handleActivate: m, closeViewer: h } = Dr(c), g = e === "composer" && !!l;
|
|
2088
2096
|
if (d.length === 0) return null;
|
|
2089
2097
|
let _ = d.map((e) => ({
|
|
2090
2098
|
src: e.src,
|
|
2091
2099
|
filename: e.filename ?? Q(e.src)
|
|
2092
2100
|
}));
|
|
2093
|
-
return /* @__PURE__ */ G(
|
|
2101
|
+
return /* @__PURE__ */ G(Gn, {
|
|
2094
2102
|
variant: u,
|
|
2095
2103
|
text: o,
|
|
2096
2104
|
groupPosition: s,
|
|
@@ -2098,17 +2106,17 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2098
2106
|
children: [/* @__PURE__ */ W("div", {
|
|
2099
2107
|
className: "flex flex-col gap-2",
|
|
2100
2108
|
children: d.map((t, n) => {
|
|
2101
|
-
let r = t.filename ?? Q(t.src), i = g && n === 0 ? /* @__PURE__ */ W(
|
|
2109
|
+
let r = t.filename ?? Q(t.src), i = g && n === 0 ? /* @__PURE__ */ W(Kn, {
|
|
2102
2110
|
onClick: l,
|
|
2103
2111
|
variant: "inline"
|
|
2104
|
-
}) : e === "composer" ? void 0 : /* @__PURE__ */ W(
|
|
2112
|
+
}) : e === "composer" ? void 0 : /* @__PURE__ */ W(hr, {
|
|
2105
2113
|
url: t.src,
|
|
2106
2114
|
filename: r,
|
|
2107
2115
|
variant: "inline",
|
|
2108
2116
|
label: `Download ${r}`,
|
|
2109
2117
|
tone: u
|
|
2110
2118
|
});
|
|
2111
|
-
return /* @__PURE__ */ W(
|
|
2119
|
+
return /* @__PURE__ */ W(Rr, {
|
|
2112
2120
|
variant: u,
|
|
2113
2121
|
item: t,
|
|
2114
2122
|
index: n,
|
|
@@ -2116,87 +2124,87 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2116
2124
|
trailingAction: i
|
|
2117
2125
|
}, `${t.src}-${n}`);
|
|
2118
2126
|
})
|
|
2119
|
-
}), /* @__PURE__ */ W(
|
|
2127
|
+
}), /* @__PURE__ */ W(Fr, {
|
|
2120
2128
|
open: f,
|
|
2121
2129
|
items: _,
|
|
2122
2130
|
initialIndex: p,
|
|
2123
2131
|
onClose: h
|
|
2124
2132
|
})]
|
|
2125
2133
|
});
|
|
2126
|
-
},
|
|
2127
|
-
Composer: (e) => /* @__PURE__ */ W(
|
|
2134
|
+
}, Br = {
|
|
2135
|
+
Composer: (e) => /* @__PURE__ */ W(zr, {
|
|
2128
2136
|
...e,
|
|
2129
2137
|
state: "composer"
|
|
2130
2138
|
}),
|
|
2131
|
-
Sent: (e) => /* @__PURE__ */ W(
|
|
2139
|
+
Sent: (e) => /* @__PURE__ */ W(zr, {
|
|
2132
2140
|
...e,
|
|
2133
2141
|
state: "sent"
|
|
2134
2142
|
}),
|
|
2135
|
-
Received: (e) => /* @__PURE__ */ W(
|
|
2143
|
+
Received: (e) => /* @__PURE__ */ W(zr, {
|
|
2136
2144
|
...e,
|
|
2137
2145
|
state: "received"
|
|
2138
2146
|
})
|
|
2139
|
-
},
|
|
2140
|
-
let { index: a, prev: o, next: s } =
|
|
2147
|
+
}, Vr = 150, Hr = ({ open: e, items: t, initialIndex: n = 0, onClose: r }) => {
|
|
2148
|
+
let { index: a, prev: o, next: s } = _r({
|
|
2141
2149
|
length: t.length,
|
|
2142
2150
|
initialIndex: n,
|
|
2143
2151
|
open: e
|
|
2144
|
-
}), c =
|
|
2145
|
-
|
|
2146
|
-
e && (l?.pause(),
|
|
2152
|
+
}), c = h(null), l = pe();
|
|
2153
|
+
f(() => {
|
|
2154
|
+
e && (l?.pause(), i(c.current));
|
|
2147
2155
|
}, [e, l]);
|
|
2148
|
-
let [u,
|
|
2149
|
-
e && !u &&
|
|
2156
|
+
let [u, d] = g(e);
|
|
2157
|
+
e && !u && d(!0), f(() => {
|
|
2150
2158
|
if (e || !u) return;
|
|
2151
2159
|
c.current?.pause();
|
|
2152
|
-
let t = window.setTimeout(() =>
|
|
2160
|
+
let t = window.setTimeout(() => d(!1), Vr);
|
|
2153
2161
|
return () => window.clearTimeout(t);
|
|
2154
2162
|
}, [e, u]);
|
|
2155
|
-
let
|
|
2156
|
-
return
|
|
2163
|
+
let p = t[a], _ = m(() => p?.filename ?? (p ? Q(p.src) : "video"), [p]);
|
|
2164
|
+
return p ? /* @__PURE__ */ G(vr, {
|
|
2157
2165
|
open: e,
|
|
2158
|
-
onClose:
|
|
2166
|
+
onClose: r,
|
|
2159
2167
|
ariaLabel: _,
|
|
2160
2168
|
counter: t.length > 1 ? `${a + 1} / ${t.length}` : void 0,
|
|
2161
2169
|
"data-testid": "video-viewer",
|
|
2162
2170
|
children: [u ? /* @__PURE__ */ W("video", {
|
|
2163
2171
|
ref: c,
|
|
2164
2172
|
"data-testid": "video-viewer-media",
|
|
2165
|
-
src:
|
|
2166
|
-
poster:
|
|
2173
|
+
src: p.src,
|
|
2174
|
+
poster: p.poster,
|
|
2167
2175
|
controls: !0,
|
|
2168
2176
|
autoPlay: !0,
|
|
2169
2177
|
muted: !0,
|
|
2170
2178
|
playsInline: !0,
|
|
2171
|
-
preload:
|
|
2179
|
+
preload: p.preload ?? "metadata",
|
|
2172
2180
|
className: "block h-auto max-h-[calc(100dvh-128px)] w-auto max-w-[min(96vw,1400px)] bg-black",
|
|
2173
|
-
children:
|
|
2174
|
-
src:
|
|
2175
|
-
type:
|
|
2181
|
+
children: p.mimeType ? /* @__PURE__ */ W("source", {
|
|
2182
|
+
src: p.src,
|
|
2183
|
+
type: p.mimeType
|
|
2176
2184
|
}) : null
|
|
2177
|
-
}, `${a}:${
|
|
2185
|
+
}, `${a}:${p.src}`) : null, t.length > 1 ? /* @__PURE__ */ W(mr, {
|
|
2178
2186
|
onPrev: o,
|
|
2179
2187
|
onNext: s,
|
|
2180
2188
|
prevLabel: "Previous video",
|
|
2181
2189
|
nextLabel: "Next video"
|
|
2182
2190
|
}) : null]
|
|
2183
2191
|
}) : null;
|
|
2184
|
-
},
|
|
2192
|
+
}, Ur = 1, Wr = 4 / 5, Gr = 16 / 9, Kr = () => /* @__PURE__ */ W("div", {
|
|
2185
2193
|
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
2186
2194
|
children: /* @__PURE__ */ W("span", {
|
|
2187
2195
|
className: "flex size-12 items-center justify-center rounded-full bg-black/25 text-white backdrop-blur-[20px]",
|
|
2188
|
-
children: /* @__PURE__ */ W(
|
|
2196
|
+
children: /* @__PURE__ */ W(Re, {
|
|
2189
2197
|
className: "size-6",
|
|
2190
2198
|
weight: "fill",
|
|
2191
2199
|
"aria-hidden": !0
|
|
2192
2200
|
})
|
|
2193
2201
|
})
|
|
2194
|
-
}),
|
|
2202
|
+
}), qr = (e) => {
|
|
2195
2203
|
let t = e.indexOf("#");
|
|
2196
2204
|
if (t === -1) return `${e}#t=0.001`;
|
|
2197
2205
|
let n = e.slice(t + 1);
|
|
2198
2206
|
return /(^|&)t=/.test(n) ? e : `${e}&t=0.001`;
|
|
2199
|
-
},
|
|
2207
|
+
}, Jr = ({ item: e, index: t, showPlayBadge: n = !0, imgRef: r, onLoad: i }) => /* @__PURE__ */ G("div", {
|
|
2200
2208
|
className: "absolute inset-0 size-full bg-[#0d0d0d]",
|
|
2201
2209
|
children: [e.poster ? /* @__PURE__ */ W("img", {
|
|
2202
2210
|
ref: r,
|
|
@@ -2208,7 +2216,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2208
2216
|
onLoad: i,
|
|
2209
2217
|
className: "absolute inset-0 size-full object-cover"
|
|
2210
2218
|
}) : e.src && e.preload !== "none" ? /* @__PURE__ */ W("video", {
|
|
2211
|
-
src:
|
|
2219
|
+
src: qr(e.src),
|
|
2212
2220
|
muted: !0,
|
|
2213
2221
|
playsInline: !0,
|
|
2214
2222
|
preload: "metadata",
|
|
@@ -2216,23 +2224,23 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2216
2224
|
className: "absolute inset-0 size-full object-cover"
|
|
2217
2225
|
}) : /* @__PURE__ */ W("div", {
|
|
2218
2226
|
className: "absolute inset-0 flex items-center justify-center",
|
|
2219
|
-
children: /* @__PURE__ */ W(
|
|
2227
|
+
children: /* @__PURE__ */ W(Ke, {
|
|
2220
2228
|
className: "size-16 text-white/30",
|
|
2221
2229
|
weight: "regular",
|
|
2222
2230
|
"aria-hidden": !0
|
|
2223
2231
|
})
|
|
2224
|
-
}), n ? /* @__PURE__ */ W(
|
|
2225
|
-
}),
|
|
2232
|
+
}), n ? /* @__PURE__ */ W(Kr, {}) : null]
|
|
2233
|
+
}), Yr = ({ item: e, index: t, totalCount: n, isOverflowTile: r, imgRef: i, onLoad: a }) => ({
|
|
2226
2234
|
ariaLabel: `Play video ${t + 1} of ${n}`,
|
|
2227
2235
|
cursorClassName: "cursor-pointer",
|
|
2228
|
-
content: /* @__PURE__ */ W(
|
|
2236
|
+
content: /* @__PURE__ */ W(Jr, {
|
|
2229
2237
|
item: e,
|
|
2230
2238
|
index: t,
|
|
2231
2239
|
showPlayBadge: !r,
|
|
2232
2240
|
imgRef: i,
|
|
2233
2241
|
onLoad: a
|
|
2234
2242
|
})
|
|
2235
|
-
}),
|
|
2243
|
+
}), Xr = ({ src: e, poster: t, mimeType: n, preload: r, naturalAspectRatio: i, items: a }) => a && a.length > 0 ? r ? a.map((e) => ({
|
|
2236
2244
|
...e,
|
|
2237
2245
|
preload: e.preload ?? r
|
|
2238
2246
|
})) : a : e ? [{
|
|
@@ -2241,14 +2249,14 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2241
2249
|
mimeType: n,
|
|
2242
2250
|
preload: r,
|
|
2243
2251
|
naturalAspectRatio: i
|
|
2244
|
-
}] : [],
|
|
2252
|
+
}] : [], Zr = (e, t) => e.map((n, r) => ({
|
|
2245
2253
|
src: n.src,
|
|
2246
2254
|
poster: n.poster,
|
|
2247
2255
|
mimeType: n.mimeType,
|
|
2248
2256
|
preload: n.preload,
|
|
2249
2257
|
filename: t && e.length === 1 ? t : t ? `${t} (${r + 1})` : void 0
|
|
2250
|
-
})),
|
|
2251
|
-
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } =
|
|
2258
|
+
})), Qr = ({ src: e, poster: t, mimeType: n, filename: r, preload: i, onClick: a, onDismiss: o }) => {
|
|
2259
|
+
let { viewerOpen: s, viewerIndex: c, handleActivate: l, closeViewer: u } = Dr(a);
|
|
2252
2260
|
return /* @__PURE__ */ G("div", {
|
|
2253
2261
|
className: "relative w-fit",
|
|
2254
2262
|
children: [
|
|
@@ -2257,7 +2265,7 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2257
2265
|
onClick: () => l(0),
|
|
2258
2266
|
"aria-label": "Play video",
|
|
2259
2267
|
className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
|
|
2260
|
-
children: /* @__PURE__ */ W(
|
|
2268
|
+
children: /* @__PURE__ */ W(Jr, {
|
|
2261
2269
|
item: {
|
|
2262
2270
|
src: e,
|
|
2263
2271
|
poster: t,
|
|
@@ -2269,11 +2277,11 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2269
2277
|
}),
|
|
2270
2278
|
o ? /* @__PURE__ */ W("div", {
|
|
2271
2279
|
className: "absolute right-2 top-2 z-10",
|
|
2272
|
-
children: /* @__PURE__ */ W(
|
|
2280
|
+
children: /* @__PURE__ */ W(Kn, { onClick: o })
|
|
2273
2281
|
}) : null,
|
|
2274
|
-
/* @__PURE__ */ W(
|
|
2282
|
+
/* @__PURE__ */ W(Hr, {
|
|
2275
2283
|
open: s,
|
|
2276
|
-
items:
|
|
2284
|
+
items: Zr([{
|
|
2277
2285
|
src: e,
|
|
2278
2286
|
poster: t,
|
|
2279
2287
|
mimeType: n,
|
|
@@ -2284,29 +2292,29 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2284
2292
|
})
|
|
2285
2293
|
]
|
|
2286
2294
|
});
|
|
2287
|
-
},
|
|
2288
|
-
let d =
|
|
2295
|
+
}, $r = ({ state: e, src: t, poster: n, mimeType: r, filename: i, items: a, text: o, groupPosition: s, preload: c, naturalAspectRatio: l, onClick: u }) => {
|
|
2296
|
+
let d = Xr({
|
|
2289
2297
|
src: t,
|
|
2290
2298
|
poster: n,
|
|
2291
2299
|
mimeType: r,
|
|
2292
2300
|
preload: c,
|
|
2293
2301
|
naturalAspectRatio: l,
|
|
2294
2302
|
items: a
|
|
2295
|
-
}), f =
|
|
2303
|
+
}), f = qn(e), { viewerOpen: p, viewerIndex: m, handleActivate: h, closeViewer: g } = Dr(u), _ = d.length === 1, v = _ ? d[0] : void 0, y = Er({
|
|
2296
2304
|
src: v?.poster,
|
|
2297
2305
|
suppliedRatio: v?.naturalAspectRatio,
|
|
2298
|
-
fallbackRatio:
|
|
2306
|
+
fallbackRatio: Ur
|
|
2299
2307
|
});
|
|
2300
2308
|
if (d.length === 0) return null;
|
|
2301
|
-
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) =>
|
|
2309
|
+
let b = d.length > 4 ? 3 : -1, x = d.map((e, t) => Yr({
|
|
2302
2310
|
item: e,
|
|
2303
2311
|
index: t,
|
|
2304
2312
|
totalCount: d.length,
|
|
2305
2313
|
isOverflowTile: t === b,
|
|
2306
2314
|
imgRef: _ ? y.imgRef : void 0,
|
|
2307
2315
|
onLoad: _ ? y.onLoad : void 0
|
|
2308
|
-
})), S = Math.min(Math.max(y.ratio,
|
|
2309
|
-
return /* @__PURE__ */ G(
|
|
2316
|
+
})), S = Math.min(Math.max(y.ratio, Wr), Gr);
|
|
2317
|
+
return /* @__PURE__ */ G(Gn, {
|
|
2310
2318
|
variant: f,
|
|
2311
2319
|
text: o,
|
|
2312
2320
|
groupPosition: s,
|
|
@@ -2317,73 +2325,73 @@ var sr = ({ src: e, filename: t, fileSize: n, mimeType: r, title: i, items: a })
|
|
|
2317
2325
|
"data-testid": "video-attachment",
|
|
2318
2326
|
children: [/* @__PURE__ */ W("div", {
|
|
2319
2327
|
className: "relative",
|
|
2320
|
-
children: /* @__PURE__ */ W(
|
|
2328
|
+
children: /* @__PURE__ */ W(Tr, {
|
|
2321
2329
|
tiles: x,
|
|
2322
2330
|
onTileActivate: h,
|
|
2323
2331
|
singleAspectRatio: _ ? S : void 0
|
|
2324
2332
|
})
|
|
2325
|
-
}), /* @__PURE__ */ W(
|
|
2333
|
+
}), /* @__PURE__ */ W(Hr, {
|
|
2326
2334
|
open: p,
|
|
2327
|
-
items:
|
|
2335
|
+
items: Zr(d, i),
|
|
2328
2336
|
initialIndex: m,
|
|
2329
2337
|
onClose: g
|
|
2330
2338
|
})]
|
|
2331
2339
|
});
|
|
2332
|
-
},
|
|
2333
|
-
Image:
|
|
2340
|
+
}, ei = {
|
|
2341
|
+
Image: Pr,
|
|
2334
2342
|
Video: {
|
|
2335
|
-
Composer: (e) => /* @__PURE__ */ W(
|
|
2336
|
-
Sent: (e) => /* @__PURE__ */ W(
|
|
2343
|
+
Composer: (e) => /* @__PURE__ */ W(Qr, { ...e }),
|
|
2344
|
+
Sent: (e) => /* @__PURE__ */ W($r, {
|
|
2337
2345
|
...e,
|
|
2338
2346
|
state: "sent"
|
|
2339
2347
|
}),
|
|
2340
|
-
Received: (e) => /* @__PURE__ */ W(
|
|
2348
|
+
Received: (e) => /* @__PURE__ */ W($r, {
|
|
2341
2349
|
...e,
|
|
2342
2350
|
state: "received"
|
|
2343
2351
|
})
|
|
2344
2352
|
},
|
|
2345
|
-
Audio:
|
|
2346
|
-
Pdf:
|
|
2347
|
-
File:
|
|
2353
|
+
Audio: Qn,
|
|
2354
|
+
Pdf: Br,
|
|
2355
|
+
File: dr
|
|
2348
2356
|
};
|
|
2349
2357
|
//#endregion
|
|
2350
2358
|
//#region src/components/CustomMessage/StreamAttachmentMessage.tsx
|
|
2351
2359
|
function $(e) {
|
|
2352
2360
|
return e?.trim() || void 0;
|
|
2353
2361
|
}
|
|
2354
|
-
function
|
|
2362
|
+
function ti(e) {
|
|
2355
2363
|
let { original_width: t, original_height: n } = e;
|
|
2356
2364
|
if (typeof t == "number" && typeof n == "number" && !(!Number.isFinite(t) || !Number.isFinite(n)) && !(t <= 0 || n <= 0)) return t / n;
|
|
2357
2365
|
}
|
|
2358
|
-
function
|
|
2366
|
+
function ni(e) {
|
|
2359
2367
|
return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
|
|
2360
2368
|
}
|
|
2361
|
-
function
|
|
2369
|
+
function ri(e, t) {
|
|
2362
2370
|
if (!e?.trim() || !t?.trim()) return !1;
|
|
2363
|
-
let n =
|
|
2371
|
+
let n = ni(e), r = ni(t);
|
|
2364
2372
|
if (n === r) return !0;
|
|
2365
2373
|
if (!n.includes(r)) return !1;
|
|
2366
2374
|
let i = n.split(r).join("");
|
|
2367
2375
|
return !/[^\p{P}\p{Z}\p{C}]/u.test(i);
|
|
2368
2376
|
}
|
|
2369
|
-
function
|
|
2370
|
-
let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url),
|
|
2377
|
+
function ii(e) {
|
|
2378
|
+
let t = $(e.og_scrape_url) ?? $(e.title_link), n = $(e.image_url) ?? $(e.thumb_url), r = $(e.mime_type), i = $(e.asset_url), a = n && Gt(r, i) ? void 0 : i;
|
|
2371
2379
|
return {
|
|
2372
2380
|
title: $(e.title),
|
|
2373
2381
|
description: $(e.text),
|
|
2374
2382
|
url: t,
|
|
2375
|
-
thumbnailUrl:
|
|
2376
|
-
sourceUrl:
|
|
2377
|
-
layout: n ||
|
|
2383
|
+
thumbnailUrl: o(n),
|
|
2384
|
+
sourceUrl: a,
|
|
2385
|
+
layout: n || Kt(r, a) ? "featured" : "classic",
|
|
2378
2386
|
mimeType: r,
|
|
2379
2387
|
accentColor: $(e.accent_color),
|
|
2380
2388
|
status: "ready"
|
|
2381
2389
|
};
|
|
2382
2390
|
}
|
|
2383
|
-
function ii(e) {
|
|
2384
|
-
return on(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
|
|
2385
|
-
}
|
|
2386
2391
|
function ai(e) {
|
|
2392
|
+
return sn(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : e.mime_type?.startsWith("audio/") ? "audio" : "file" : null;
|
|
2393
|
+
}
|
|
2394
|
+
function oi(e) {
|
|
2387
2395
|
if (!e?.length) return [];
|
|
2388
2396
|
let t = [], n = (e, n) => {
|
|
2389
2397
|
let r = t[t.length - 1];
|
|
@@ -2408,44 +2416,44 @@ function ai(e) {
|
|
|
2408
2416
|
});
|
|
2409
2417
|
};
|
|
2410
2418
|
for (let t of e) {
|
|
2411
|
-
if (
|
|
2419
|
+
if (sn(t)) {
|
|
2412
2420
|
r(t);
|
|
2413
2421
|
continue;
|
|
2414
2422
|
}
|
|
2415
|
-
let e =
|
|
2423
|
+
let e = ai(t);
|
|
2416
2424
|
e && n(e, t);
|
|
2417
2425
|
}
|
|
2418
2426
|
return t;
|
|
2419
2427
|
}
|
|
2420
|
-
function
|
|
2428
|
+
function si(e) {
|
|
2421
2429
|
return e.filter((e) => e.type === "media").length;
|
|
2422
2430
|
}
|
|
2423
|
-
function
|
|
2431
|
+
function ci(e, t, n) {
|
|
2424
2432
|
return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
|
|
2425
2433
|
}
|
|
2426
|
-
function
|
|
2434
|
+
function li(e) {
|
|
2427
2435
|
return $(e.image_url) ?? $(e.asset_url) ?? "";
|
|
2428
2436
|
}
|
|
2429
|
-
function
|
|
2437
|
+
function ui(e) {
|
|
2430
2438
|
switch (e) {
|
|
2431
|
-
case "image": return
|
|
2432
|
-
case "video": return
|
|
2433
|
-
case "audio": return
|
|
2434
|
-
case "pdf": return
|
|
2435
|
-
default: return
|
|
2439
|
+
case "image": return ei.Image;
|
|
2440
|
+
case "video": return ei.Video;
|
|
2441
|
+
case "audio": return ei.Audio;
|
|
2442
|
+
case "pdf": return ei.Pdf;
|
|
2443
|
+
default: return ei.File;
|
|
2436
2444
|
}
|
|
2437
2445
|
}
|
|
2438
|
-
function
|
|
2446
|
+
function di(e, t) {
|
|
2439
2447
|
switch (e) {
|
|
2440
2448
|
case "image": return {
|
|
2441
|
-
src:
|
|
2449
|
+
src: li(t),
|
|
2442
2450
|
alt: $(t.title)
|
|
2443
2451
|
};
|
|
2444
2452
|
case "video": return {
|
|
2445
2453
|
src: $(t.asset_url) ?? "",
|
|
2446
|
-
poster:
|
|
2454
|
+
poster: o(t.thumb_url),
|
|
2447
2455
|
mimeType: $(t.mime_type),
|
|
2448
|
-
naturalAspectRatio:
|
|
2456
|
+
naturalAspectRatio: ti(t)
|
|
2449
2457
|
};
|
|
2450
2458
|
case "audio": return {
|
|
2451
2459
|
src: $(t.asset_url) ?? "",
|
|
@@ -2465,30 +2473,30 @@ function ui(e, t) {
|
|
|
2465
2473
|
};
|
|
2466
2474
|
}
|
|
2467
2475
|
}
|
|
2468
|
-
function
|
|
2469
|
-
if (t.length > 1) return { items: t.map((t) =>
|
|
2476
|
+
function fi(e, t) {
|
|
2477
|
+
if (t.length > 1) return { items: t.map((t) => di(e, t)) };
|
|
2470
2478
|
let n = t[0];
|
|
2471
|
-
return n ?
|
|
2479
|
+
return n ? di(e, n) : {};
|
|
2472
2480
|
}
|
|
2473
|
-
function
|
|
2474
|
-
let r =
|
|
2475
|
-
...
|
|
2481
|
+
function pi({ groupPosition: e, isMyMessage: t, segment: n }) {
|
|
2482
|
+
let r = ui(n.kind), i = {
|
|
2483
|
+
...fi(n.kind, n.attachments),
|
|
2476
2484
|
groupPosition: e
|
|
2477
2485
|
};
|
|
2478
2486
|
return W(t ? r.Sent : r.Received, { ...i });
|
|
2479
2487
|
}
|
|
2480
|
-
var
|
|
2481
|
-
let i =
|
|
2488
|
+
var mi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
2489
|
+
let i = oi(n.attachments);
|
|
2482
2490
|
if (i.length === 0) return null;
|
|
2483
|
-
let a =
|
|
2484
|
-
let i = t ?
|
|
2491
|
+
let a = si(i), o = n.text?.trim(), s = i.find((e) => e.type === "link"), c = s?.type === "link" ? ii(s.attachments[0] ?? {}).url : void 0, l = o && ri(o, c) ? void 0 : o, u = 0, d = [], f = l ? "middle" : e, p = e === "single" || e === "end", m = (e, n, r) => {
|
|
2492
|
+
let i = t ? on.Sent : on.Received;
|
|
2485
2493
|
d.push(/* @__PURE__ */ W(i, {
|
|
2486
|
-
...
|
|
2494
|
+
...ii(e),
|
|
2487
2495
|
groupPosition: r ? f : "middle"
|
|
2488
2496
|
}, n));
|
|
2489
2497
|
}, h = (n, r) => {
|
|
2490
|
-
let i =
|
|
2491
|
-
u += 1, d.push(/* @__PURE__ */ W(
|
|
2498
|
+
let i = ci(u, a, e);
|
|
2499
|
+
u += 1, d.push(/* @__PURE__ */ W(pi, {
|
|
2492
2500
|
groupPosition: i,
|
|
2493
2501
|
isMyMessage: t,
|
|
2494
2502
|
segment: n
|
|
@@ -2519,106 +2527,106 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2519
2527
|
"data-testid": "message-attachment-rows",
|
|
2520
2528
|
className: Y("flex flex-col gap-[4px]", t ? "items-end" : "items-start"),
|
|
2521
2529
|
children: d
|
|
2522
|
-
}), !l && /* @__PURE__ */ W(
|
|
2530
|
+
}), !l && /* @__PURE__ */ W(N, {})]
|
|
2523
2531
|
}), l ? /* @__PURE__ */ G("div", {
|
|
2524
2532
|
"data-testid": "message-caption-bubble",
|
|
2525
2533
|
className: Y("str-chat__message-bubble", { "relative isolate": p }),
|
|
2526
2534
|
children: [
|
|
2527
|
-
/* @__PURE__ */ W(
|
|
2535
|
+
/* @__PURE__ */ W(z, {
|
|
2528
2536
|
message: n,
|
|
2529
2537
|
renderText: r
|
|
2530
2538
|
}),
|
|
2531
|
-
/* @__PURE__ */ W(
|
|
2532
|
-
p && /* @__PURE__ */ W(
|
|
2539
|
+
/* @__PURE__ */ W(N, {}),
|
|
2540
|
+
p && /* @__PURE__ */ W(En, { side: t ? "me" : "other" })
|
|
2533
2541
|
]
|
|
2534
2542
|
}) : null]
|
|
2535
2543
|
});
|
|
2536
|
-
},
|
|
2537
|
-
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message:
|
|
2538
|
-
let e =
|
|
2539
|
-
if (!
|
|
2540
|
-
let n = t.filter((e) => !("type" in e) || !
|
|
2544
|
+
}, hi = s.memo((e) => {
|
|
2545
|
+
let { additionalMessageInputProps: t, editing: n, endOfGroup: r, firstOfGroup: i, groupStyles: a, groupedByUser: o, handleAction: s, handleOpenThread: c, handleRetry: l, highlighted: u, isMessageAIGenerated: d, isMyMessage: f, message: p, renderText: h, threadList: _, viewerLanguage: v, onOutboundClick: y, resolvedOutbound: b } = e, { client: S } = he("CustomMessage"), { channel: C } = me("CustomMessage"), { isUnlocking: w, onUnlockClick: T, onFetchSource: E, onDownloadClick: O } = dn("LockedAttachment"), [P, I] = g(!1), R = be(p.id), { Attachment: B = x, EditMessageModal: te = D, MessageActions: V, MessageBlocked: ie = k, MessageBouncePrompt: ae = j, MessageDeleted: oe = M, MessageIsThreadReplyInChannelButtonIndicator: fe = F, MessageRepliesCountButton: pe = L, ReminderNotification: _e = ne, StreamedMessageText: ve = re, PinIndicator: H } = ge("CustomMessage"), ye = ue(p), xe = de(p), Se = m(() => d?.(p), [d, p]), K = m(() => {
|
|
2546
|
+
let e = p.attachments ?? [], t = p.shared_location ? [p.shared_location, ...e] : e;
|
|
2547
|
+
if (!vn(p)) return t;
|
|
2548
|
+
let n = t.filter((e) => !("type" in e) || !sn(e));
|
|
2541
2549
|
return n.length === t.length ? t : n;
|
|
2542
|
-
}, [
|
|
2543
|
-
let e =
|
|
2544
|
-
return e ?
|
|
2545
|
-
}, [
|
|
2546
|
-
let e =
|
|
2547
|
-
message:
|
|
2550
|
+
}, [p]), q = m(() => (p.attachments ?? []).filter(sn), [p]), Ce = m(() => {
|
|
2551
|
+
let e = p.text?.trim();
|
|
2552
|
+
return e ? ri(e, q[0] ? ii(q[0]).url : void 0) ? void 0 : e : void 0;
|
|
2553
|
+
}, [p, q]), we = m(() => oi(K), [K]), J = m(() => {
|
|
2554
|
+
let e = Ot({
|
|
2555
|
+
message: p,
|
|
2548
2556
|
viewerLanguage: v
|
|
2549
2557
|
});
|
|
2550
|
-
return e ===
|
|
2551
|
-
...
|
|
2558
|
+
return e === p.text ? p : {
|
|
2559
|
+
...p,
|
|
2552
2560
|
text: e
|
|
2553
2561
|
};
|
|
2554
|
-
}, [
|
|
2555
|
-
if (se(
|
|
2556
|
-
if (
|
|
2557
|
-
if (ce(
|
|
2558
|
-
let Ae = !_ && !!
|
|
2559
|
-
Me ? X = () => l(
|
|
2560
|
-
let Z = f(), Pe = Y("str-chat__message str-chat__message-simple", `str-chat__message--${
|
|
2561
|
-
"str-chat__message--has-attachment":
|
|
2562
|
+
}, [p, v]), Te = we.length > 0, Ee = we.reduce((e, t) => e + t.attachments.length, 0) === (K?.length ?? 0), De = a?.[0] ?? "", Oe = De === "top" ? "first" : De === "middle" ? "middle" : De === "bottom" ? "end" : "single", ke = De === "single" || De === "bottom";
|
|
2563
|
+
if (se(p)) return null;
|
|
2564
|
+
if (p.deleted_at || p.type === "deleted") return /* @__PURE__ */ W(oe, { message: p });
|
|
2565
|
+
if (ce(p)) return /* @__PURE__ */ W(ie, {});
|
|
2566
|
+
let Ae = !_ && !!p.reply_count, je = !_ && p.show_in_channel && p.parent_id, Me = p.status === "failed" && p.error?.status !== 403, Ne = le(p), X;
|
|
2567
|
+
Me ? X = () => l(p) : Ne && (X = () => I(!0));
|
|
2568
|
+
let Z = f(), Pe = Y("str-chat__message str-chat__message-simple", `str-chat__message--${p.type}`, `str-chat__message--${p.status}`, Z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other", p.text ? "str-chat__message--has-text" : "has-no-text", {
|
|
2569
|
+
"str-chat__message--has-attachment": ye,
|
|
2562
2570
|
"str-chat__message--highlighted": u,
|
|
2563
|
-
"str-chat__message--pinned pinned-message":
|
|
2571
|
+
"str-chat__message--pinned pinned-message": p.pinned,
|
|
2564
2572
|
"str-chat__message--with-reactions": xe,
|
|
2565
|
-
"str-chat__message-send-can-be-retried":
|
|
2573
|
+
"str-chat__message-send-can-be-retried": p?.status === "failed" && p?.error?.status !== 403,
|
|
2566
2574
|
"str-chat__message-with-thread-link": Ae || je,
|
|
2567
2575
|
"str-chat__virtual-message__wrapper--end": r,
|
|
2568
2576
|
"str-chat__virtual-message__wrapper--first": i,
|
|
2569
2577
|
"str-chat__virtual-message__wrapper--group": o
|
|
2570
|
-
}), Fe =
|
|
2578
|
+
}), Fe = p.poll_id && S.polls.fromState(p.poll_id), Ie = Mn(p), Le = vn(p), Re = yn(p), ze = !!(K?.length && !p.quoted_message), Be = Le && Z && ze, Ve = Te && Ee && !p.quoted_message && !Fe && !Se && !Le, He = {
|
|
2571
2579
|
contentType: "text",
|
|
2572
|
-
amountText:
|
|
2573
|
-
paymentStatus:
|
|
2574
|
-
renderedText:
|
|
2575
|
-
message:
|
|
2576
|
-
renderText:
|
|
2580
|
+
amountText: p.metadata?.amount_text,
|
|
2581
|
+
paymentStatus: p.metadata?.payment_status,
|
|
2582
|
+
renderedText: p.text && /* @__PURE__ */ W(z, {
|
|
2583
|
+
message: J,
|
|
2584
|
+
renderText: h
|
|
2577
2585
|
})
|
|
2578
2586
|
}, Ue = {
|
|
2579
2587
|
contentType: "media",
|
|
2580
|
-
title:
|
|
2581
|
-
mimeType:
|
|
2582
|
-
thumbnailUrl:
|
|
2583
|
-
amountText:
|
|
2584
|
-
detail:
|
|
2585
|
-
paymentStatus:
|
|
2586
|
-
onFetchSource:
|
|
2588
|
+
title: p.metadata?.attachment_title,
|
|
2589
|
+
mimeType: p.metadata?.attachment_mime_type,
|
|
2590
|
+
thumbnailUrl: p.metadata?.attachment_thumbnail,
|
|
2591
|
+
amountText: p.metadata?.amount_text,
|
|
2592
|
+
detail: p.metadata?.attachment_detail,
|
|
2593
|
+
paymentStatus: p.metadata?.payment_status,
|
|
2594
|
+
onFetchSource: E ? () => E(p, C) : void 0
|
|
2587
2595
|
}, We = /* @__PURE__ */ G("div", {
|
|
2588
2596
|
className: Y("str-chat__message-bubble", { "relative isolate": ke }),
|
|
2589
|
-
children: [/* @__PURE__ */ W(
|
|
2590
|
-
message:
|
|
2591
|
-
renderText:
|
|
2592
|
-
}), ke && /* @__PURE__ */ W(
|
|
2593
|
-
}), Ge =
|
|
2597
|
+
children: [/* @__PURE__ */ W(z, {
|
|
2598
|
+
message: J,
|
|
2599
|
+
renderText: h
|
|
2600
|
+
}), ke && /* @__PURE__ */ W(En, { side: Z ? "me" : "other" })]
|
|
2601
|
+
}), Ge = q.length > 0 && /* @__PURE__ */ W("div", {
|
|
2594
2602
|
className: Y("flex flex-col gap-[4px]", Z ? "items-end" : "items-start"),
|
|
2595
|
-
children:
|
|
2596
|
-
let n = Z ?
|
|
2603
|
+
children: q.map((e, t) => {
|
|
2604
|
+
let n = Z ? on.Sent : on.Received, r = t === q.length - 1 && !Ce;
|
|
2597
2605
|
return /* @__PURE__ */ W(n, {
|
|
2598
|
-
...
|
|
2606
|
+
...ii(e),
|
|
2599
2607
|
groupPosition: r ? Oe : "middle"
|
|
2600
2608
|
}, `locked-link-${t}`);
|
|
2601
2609
|
})
|
|
2602
2610
|
});
|
|
2603
2611
|
return /* @__PURE__ */ G(U, { children: [
|
|
2604
|
-
n && /* @__PURE__ */ W(
|
|
2605
|
-
|
|
2606
|
-
MessageBouncePrompt:
|
|
2607
|
-
onClose: () =>
|
|
2608
|
-
open:
|
|
2612
|
+
n && /* @__PURE__ */ W(te, { additionalMessageInputProps: t }),
|
|
2613
|
+
P && /* @__PURE__ */ W(A, {
|
|
2614
|
+
MessageBouncePrompt: ae,
|
|
2615
|
+
onClose: () => I(!1),
|
|
2616
|
+
open: P
|
|
2609
2617
|
}),
|
|
2610
2618
|
/* @__PURE__ */ G("div", {
|
|
2611
2619
|
className: Pe,
|
|
2612
|
-
"data-message-id":
|
|
2620
|
+
"data-message-id": p.id,
|
|
2613
2621
|
"data-dd-privacy": "mask",
|
|
2614
2622
|
children: [
|
|
2615
|
-
|
|
2616
|
-
!!
|
|
2617
|
-
|
|
2623
|
+
H && /* @__PURE__ */ W(H, {}),
|
|
2624
|
+
!!R && /* @__PURE__ */ W(_e, { reminder: R }),
|
|
2625
|
+
p.user && /* @__PURE__ */ W(_t, {
|
|
2618
2626
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
2619
|
-
id:
|
|
2620
|
-
image:
|
|
2621
|
-
name:
|
|
2627
|
+
id: p.user.id,
|
|
2628
|
+
image: p.user.image,
|
|
2629
|
+
name: p.user.name || p.user.id,
|
|
2622
2630
|
size: 24,
|
|
2623
2631
|
shape: "circle",
|
|
2624
2632
|
dmAgentEnabled: Le
|
|
@@ -2636,157 +2644,157 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2636
2644
|
},
|
|
2637
2645
|
children: Ie ? /* @__PURE__ */ G("div", {
|
|
2638
2646
|
className: "str-chat__message-bubble-wrapper message-tip-wrapper",
|
|
2639
|
-
children: [/* @__PURE__ */ W(
|
|
2640
|
-
}) :
|
|
2647
|
+
children: [/* @__PURE__ */ W(Nn, { message: p }), p.text?.trim() && We]
|
|
2648
|
+
}) : bn(p) ? /* @__PURE__ */ W("div", {
|
|
2641
2649
|
className: "str-chat__message-bubble-wrapper",
|
|
2642
2650
|
children: /* @__PURE__ */ G("div", {
|
|
2643
2651
|
className: "flex items-center gap-2",
|
|
2644
2652
|
children: [
|
|
2645
|
-
Z &&
|
|
2646
|
-
Z ? /* @__PURE__ */ W(
|
|
2653
|
+
Z && V && /* @__PURE__ */ W(V, {}),
|
|
2654
|
+
Z ? /* @__PURE__ */ W(hn, {
|
|
2647
2655
|
...He,
|
|
2648
2656
|
isMine: !0
|
|
2649
|
-
}) : /* @__PURE__ */ W(
|
|
2657
|
+
}) : /* @__PURE__ */ W(hn, {
|
|
2650
2658
|
...He,
|
|
2651
2659
|
isMine: !1,
|
|
2652
|
-
isUnlocking: w(
|
|
2653
|
-
onUnlockClick: () => T?.(
|
|
2660
|
+
isUnlocking: w(p.id),
|
|
2661
|
+
onUnlockClick: () => T?.(p, C)
|
|
2654
2662
|
}),
|
|
2655
|
-
!Z &&
|
|
2663
|
+
!Z && V && /* @__PURE__ */ W(V, {})
|
|
2656
2664
|
]
|
|
2657
2665
|
})
|
|
2658
|
-
}) :
|
|
2666
|
+
}) : xn(p) ? /* @__PURE__ */ G("div", {
|
|
2659
2667
|
className: "str-chat__message-bubble-wrapper message-locked-attachment-wrapper",
|
|
2660
2668
|
children: [
|
|
2661
2669
|
/* @__PURE__ */ G("div", {
|
|
2662
2670
|
className: "flex items-center gap-2",
|
|
2663
2671
|
children: [
|
|
2664
|
-
Z &&
|
|
2665
|
-
Z ? /* @__PURE__ */ W(
|
|
2672
|
+
Z && V && /* @__PURE__ */ W(V, {}),
|
|
2673
|
+
Z ? /* @__PURE__ */ W(hn, {
|
|
2666
2674
|
...Ue,
|
|
2667
2675
|
isMine: !0,
|
|
2668
|
-
onPreviewClick: () => T ? T(
|
|
2669
|
-
}) : /* @__PURE__ */ W(
|
|
2676
|
+
onPreviewClick: () => T ? T(p, C) : void 0
|
|
2677
|
+
}) : /* @__PURE__ */ W(hn, {
|
|
2670
2678
|
...Ue,
|
|
2671
2679
|
isMine: !1,
|
|
2672
|
-
isUnlocking: w(
|
|
2673
|
-
onUnlockClick: () => T ? T(
|
|
2674
|
-
onDownloadClick: () =>
|
|
2680
|
+
isUnlocking: w(p.id),
|
|
2681
|
+
onUnlockClick: () => T ? T(p, C) : void 0,
|
|
2682
|
+
onDownloadClick: () => O ? O(p, C) : void 0
|
|
2675
2683
|
}),
|
|
2676
|
-
!Z &&
|
|
2684
|
+
!Z && V && /* @__PURE__ */ W(V, {})
|
|
2677
2685
|
]
|
|
2678
2686
|
}),
|
|
2679
2687
|
Ge,
|
|
2680
|
-
|
|
2688
|
+
Ce && We
|
|
2681
2689
|
]
|
|
2682
|
-
}) : Ve ? /* @__PURE__ */ W(
|
|
2690
|
+
}) : Ve ? /* @__PURE__ */ W(mi, {
|
|
2683
2691
|
groupPosition: Oe,
|
|
2684
2692
|
isMyMessage: Z,
|
|
2685
2693
|
message: {
|
|
2686
|
-
...
|
|
2687
|
-
attachments:
|
|
2694
|
+
...J,
|
|
2695
|
+
attachments: K,
|
|
2688
2696
|
i18n: void 0
|
|
2689
2697
|
},
|
|
2690
|
-
renderText:
|
|
2698
|
+
renderText: h
|
|
2691
2699
|
}) : /* @__PURE__ */ W("div", {
|
|
2692
2700
|
className: "str-chat__message-bubble-wrapper",
|
|
2693
2701
|
children: /* @__PURE__ */ G("div", {
|
|
2694
2702
|
className: Y("str-chat__message-bubble", { "relative isolate": ke }),
|
|
2695
2703
|
children: [
|
|
2696
|
-
Le && !Be && /* @__PURE__ */ W(
|
|
2697
|
-
message:
|
|
2704
|
+
Le && !Be && /* @__PURE__ */ W(Cn, {
|
|
2705
|
+
message: p,
|
|
2698
2706
|
hasAttachment: ze,
|
|
2699
2707
|
isMyMessage: Z
|
|
2700
2708
|
}),
|
|
2701
2709
|
Fe && /* @__PURE__ */ W(ee, { poll: Fe }),
|
|
2702
|
-
|
|
2710
|
+
K?.length && !p.quoted_message ? /* @__PURE__ */ W(B, {
|
|
2703
2711
|
actionHandler: s,
|
|
2704
|
-
attachments:
|
|
2712
|
+
attachments: K
|
|
2705
2713
|
}) : null,
|
|
2706
|
-
W(
|
|
2707
|
-
message:
|
|
2708
|
-
renderText:
|
|
2714
|
+
W(Se ? ve : z, {
|
|
2715
|
+
message: J,
|
|
2716
|
+
renderText: h
|
|
2709
2717
|
}),
|
|
2710
|
-
/* @__PURE__ */ W(
|
|
2711
|
-
ke && /* @__PURE__ */ W(
|
|
2718
|
+
/* @__PURE__ */ W(N, {}),
|
|
2719
|
+
ke && /* @__PURE__ */ W(En, { side: Z ? "me" : "other" })
|
|
2712
2720
|
]
|
|
2713
2721
|
})
|
|
2714
2722
|
})
|
|
2715
2723
|
}),
|
|
2716
2724
|
!Re && !Ie && /* @__PURE__ */ W("div", {
|
|
2717
2725
|
className: "str-chat__message-footer",
|
|
2718
|
-
children: (!Le || Be) && /* @__PURE__ */ W(
|
|
2719
|
-
message:
|
|
2726
|
+
children: (!Le || Be) && /* @__PURE__ */ W(Cn, {
|
|
2727
|
+
message: p,
|
|
2720
2728
|
hasAttachment: ze,
|
|
2721
2729
|
isMyMessage: Z
|
|
2722
2730
|
})
|
|
2723
2731
|
}),
|
|
2724
|
-
/* @__PURE__ */ W(
|
|
2732
|
+
/* @__PURE__ */ W(zn, {
|
|
2725
2733
|
onOutboundClick: y,
|
|
2726
|
-
resolvedOutbound:
|
|
2734
|
+
resolvedOutbound: b
|
|
2727
2735
|
}),
|
|
2728
|
-
Ae && /* @__PURE__ */ W(
|
|
2736
|
+
Ae && /* @__PURE__ */ W(pe, {
|
|
2729
2737
|
onClick: c,
|
|
2730
|
-
reply_count:
|
|
2738
|
+
reply_count: p.reply_count
|
|
2731
2739
|
}),
|
|
2732
|
-
je && /* @__PURE__ */ W(
|
|
2740
|
+
je && /* @__PURE__ */ W(fe, {})
|
|
2733
2741
|
]
|
|
2734
|
-
},
|
|
2742
|
+
}, p.id)
|
|
2735
2743
|
] });
|
|
2736
|
-
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)),
|
|
2737
|
-
let t = H("CustomMessage"), n =
|
|
2738
|
-
return /* @__PURE__ */ W(
|
|
2744
|
+
}, (e, t) => e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || e.resolvedOutbound?.id !== t.resolvedOutbound?.id || e.resolvedOutbound?.name !== t.resolvedOutbound?.name ? !1 : oe(e, t)), gi = (e) => {
|
|
2745
|
+
let t = H("CustomMessage"), n = d(Dn), r = t.message.metadata?.outbound_id, i = typeof r == "string" ? n?.[r] : void 0;
|
|
2746
|
+
return /* @__PURE__ */ W(hi, {
|
|
2739
2747
|
...t,
|
|
2740
2748
|
...e,
|
|
2741
2749
|
resolvedOutbound: i
|
|
2742
2750
|
});
|
|
2743
|
-
},
|
|
2751
|
+
}, _i = () => {
|
|
2744
2752
|
let { handleDelete: e, message: t } = H("CustomMessageActions");
|
|
2745
|
-
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ W(
|
|
2753
|
+
return t.metadata?.payment_status === "paid" ? null : /* @__PURE__ */ W(Ye, {
|
|
2746
2754
|
onClick: e,
|
|
2747
2755
|
"aria-label": "Delete",
|
|
2748
2756
|
title: "Delete",
|
|
2749
2757
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
2750
|
-
children: /* @__PURE__ */ W(
|
|
2758
|
+
children: /* @__PURE__ */ W(Ge, {
|
|
2751
2759
|
size: 16,
|
|
2752
2760
|
weight: "light",
|
|
2753
2761
|
"aria-hidden": !0
|
|
2754
2762
|
})
|
|
2755
2763
|
});
|
|
2756
|
-
},
|
|
2764
|
+
}, vi = () => {
|
|
2757
2765
|
let { handleFlag: e } = H("CustomMessageActions");
|
|
2758
|
-
return /* @__PURE__ */ W(
|
|
2766
|
+
return /* @__PURE__ */ W(Ye, {
|
|
2759
2767
|
onClick: e,
|
|
2760
2768
|
"aria-label": "Report",
|
|
2761
2769
|
title: "Report",
|
|
2762
2770
|
className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
|
|
2763
|
-
children: /* @__PURE__ */ W(
|
|
2771
|
+
children: /* @__PURE__ */ W(Pe, {
|
|
2764
2772
|
size: 16,
|
|
2765
2773
|
weight: "light",
|
|
2766
2774
|
"aria-hidden": !0
|
|
2767
2775
|
})
|
|
2768
2776
|
});
|
|
2769
|
-
},
|
|
2777
|
+
}, yi = () => {
|
|
2770
2778
|
let { message: e } = H("CustomMessageActions");
|
|
2771
|
-
return e.metadata?.custom_type === K.ATTACHMENT ? /* @__PURE__ */ W(
|
|
2772
|
-
Component:
|
|
2779
|
+
return e.metadata?.custom_type === K.ATTACHMENT ? /* @__PURE__ */ W(Xe, { messageActionSet: [{
|
|
2780
|
+
Component: _i,
|
|
2773
2781
|
placement: "quick",
|
|
2774
2782
|
type: "delete"
|
|
2775
2783
|
}, {
|
|
2776
|
-
Component:
|
|
2784
|
+
Component: vi,
|
|
2777
2785
|
placement: "quick",
|
|
2778
2786
|
type: "flag"
|
|
2779
2787
|
}] }) : null;
|
|
2780
|
-
},
|
|
2781
|
-
let { linkPreviewsManager: e } =
|
|
2788
|
+
}, bi = (e) => ({ linkPreviews: Array.from(e.previews.values()).filter((e) => v.previewIsLoaded(e) || v.previewIsLoading(e)) }), xi = () => {
|
|
2789
|
+
let { linkPreviewsManager: e } = _e(), { linkPreviews: t } = xe(e.state, bi), n = (t) => {
|
|
2782
2790
|
e.dismissPreview(t);
|
|
2783
2791
|
};
|
|
2784
2792
|
return t.length > 0 ? /* @__PURE__ */ W("div", {
|
|
2785
2793
|
"data-testid": "link-preview-list",
|
|
2786
2794
|
className: "messaging-link-preview-list flex flex-col items-stretch w-full gap-2",
|
|
2787
2795
|
children: t.map((e) => {
|
|
2788
|
-
let t =
|
|
2789
|
-
return /* @__PURE__ */ W(
|
|
2796
|
+
let t = v.previewIsLoading(e);
|
|
2797
|
+
return /* @__PURE__ */ W(on.Composer, {
|
|
2790
2798
|
title: e.title,
|
|
2791
2799
|
url: e.og_scrape_url,
|
|
2792
2800
|
thumbnailUrl: e.image_url,
|
|
@@ -2796,35 +2804,35 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2796
2804
|
}, e.og_scrape_url);
|
|
2797
2805
|
})
|
|
2798
2806
|
}) : null;
|
|
2799
|
-
},
|
|
2807
|
+
}, Si = s.createContext(!1), Ci = 200, wi = () => d(Si), Ti = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ W("button", {
|
|
2800
2808
|
...n,
|
|
2801
2809
|
type: "button",
|
|
2802
2810
|
"aria-label": "Send",
|
|
2803
2811
|
disabled: t,
|
|
2804
2812
|
onPointerDown: (e) => e.preventDefault(),
|
|
2805
2813
|
onClick: e,
|
|
2806
|
-
children: /* @__PURE__ */ W(
|
|
2814
|
+
children: /* @__PURE__ */ W(Oe, {
|
|
2807
2815
|
weight: "bold",
|
|
2808
2816
|
className: "size-4"
|
|
2809
2817
|
})
|
|
2810
|
-
}),
|
|
2811
|
-
let e =
|
|
2812
|
-
return
|
|
2813
|
-
let e =
|
|
2818
|
+
}), Ei = () => {
|
|
2819
|
+
let e = d(Si), { handleSubmit: t } = ye(), n = ve(), r = e || !n, { SendButton: i = Ti, AttachmentPreviewList: a = S } = ge("CustomMessageInput"), o = s.useRef(null);
|
|
2820
|
+
return s.useEffect(() => {
|
|
2821
|
+
let e = o.current;
|
|
2814
2822
|
if (!e || typeof ResizeObserver > "u") return;
|
|
2815
2823
|
let t = new ResizeObserver(() => {
|
|
2816
2824
|
e.contains(document.activeElement) && (e.scrollTop = e.scrollHeight);
|
|
2817
2825
|
});
|
|
2818
2826
|
return t.observe(e), () => t.disconnect();
|
|
2819
|
-
}, []),
|
|
2820
|
-
let e =
|
|
2827
|
+
}, []), s.useEffect(() => {
|
|
2828
|
+
let e = o.current;
|
|
2821
2829
|
if (!e) return;
|
|
2822
2830
|
let t = (e) => {
|
|
2823
2831
|
Array.from(e.clipboardData?.items ?? []).some((e) => e.kind === "file") || e.stopPropagation();
|
|
2824
2832
|
};
|
|
2825
2833
|
return e.addEventListener("paste", t), () => e.removeEventListener("paste", t);
|
|
2826
2834
|
}, []), /* @__PURE__ */ G("div", {
|
|
2827
|
-
ref:
|
|
2835
|
+
ref: o,
|
|
2828
2836
|
"data-testid": "composer-card",
|
|
2829
2837
|
className: "central-container flex flex-col min-w-0 w-full max-h-[calc(var(--messaging-surface-height,100dvh)*0.5)] overflow-y-auto overscroll-contain 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)] [&>:not(.messaging-composer-previews):not(.messaging-composer-row)]:p-2",
|
|
2830
2838
|
"data-dd-privacy": "mask",
|
|
@@ -2833,13 +2841,13 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2833
2841
|
className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2",
|
|
2834
2842
|
children: [
|
|
2835
2843
|
/* @__PURE__ */ W(te, {}),
|
|
2836
|
-
/* @__PURE__ */ W(
|
|
2844
|
+
/* @__PURE__ */ W(xi, {}),
|
|
2837
2845
|
/* @__PURE__ */ W(a, {})
|
|
2838
2846
|
]
|
|
2839
2847
|
}), /* @__PURE__ */ G("div", {
|
|
2840
2848
|
"data-testid": "composer-row",
|
|
2841
2849
|
className: "messaging-composer-row flex items-start",
|
|
2842
|
-
children: [/* @__PURE__ */ W(
|
|
2850
|
+
children: [/* @__PURE__ */ W(V, {
|
|
2843
2851
|
"aria-disabled": e || void 0,
|
|
2844
2852
|
containerClassName: "min-w-0 flex-1 leading-[0]",
|
|
2845
2853
|
className: "w-full resize-none overflow-hidden bg-transparent py-3.5 pl-4 pr-4 outline-none leading-5 placeholder:text-black/30 text-sm",
|
|
@@ -2862,7 +2870,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2862
2870
|
})]
|
|
2863
2871
|
})]
|
|
2864
2872
|
});
|
|
2865
|
-
},
|
|
2873
|
+
}, Di = () => /* @__PURE__ */ G("div", {
|
|
2866
2874
|
className: "messaging-composer-backdrop",
|
|
2867
2875
|
"aria-hidden": "true",
|
|
2868
2876
|
children: [
|
|
@@ -2873,16 +2881,16 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2873
2881
|
/* @__PURE__ */ W("div", { className: "messaging-composer-backdrop-blur" }),
|
|
2874
2882
|
/* @__PURE__ */ W("div", { className: "messaging-composer-backdrop-gradient" })
|
|
2875
2883
|
]
|
|
2876
|
-
}),
|
|
2877
|
-
let { channel:
|
|
2878
|
-
return
|
|
2884
|
+
}), Oi = ({ renderActions: e, renderHeader: t, renderFooter: n, disabled: r = !1, disabledReason: i, composerInput: a }) => {
|
|
2885
|
+
let { channel: o } = me(), c = o?.data?.frozen === !0, l = !!a, u = s.useRef(null);
|
|
2886
|
+
return s.useEffect(() => {
|
|
2879
2887
|
if (!l) return;
|
|
2880
2888
|
let e = u.current, t = e?.parentElement;
|
|
2881
2889
|
if (!e || !t) return;
|
|
2882
2890
|
let n = e.offsetHeight, r = () => {
|
|
2883
2891
|
let r = e.offsetHeight, i = r > n;
|
|
2884
2892
|
n = r;
|
|
2885
|
-
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight <
|
|
2893
|
+
let a = Array.from(t.querySelectorAll(".str-chat__list")).find((e) => e.scrollHeight > e.clientHeight) ?? null, o = a ? a.scrollHeight - a.scrollTop - a.clientHeight < Ci : !1;
|
|
2886
2894
|
t.style.setProperty("--messaging-composer-height", `${r}px`), i && o && a && (a.scrollTop = a.scrollHeight);
|
|
2887
2895
|
};
|
|
2888
2896
|
if (r(), typeof ResizeObserver > "u") return;
|
|
@@ -2894,7 +2902,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2894
2902
|
ref: u,
|
|
2895
2903
|
"data-testid": "composer-chrome",
|
|
2896
2904
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2897
|
-
children: [/* @__PURE__ */ W(
|
|
2905
|
+
children: [/* @__PURE__ */ W(Di, {}), /* @__PURE__ */ G("div", {
|
|
2898
2906
|
className: "relative z-10 flex flex-col",
|
|
2899
2907
|
children: [
|
|
2900
2908
|
t?.(),
|
|
@@ -2924,7 +2932,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2924
2932
|
ref: u,
|
|
2925
2933
|
"data-testid": "composer-chrome",
|
|
2926
2934
|
className: "messaging-composer-chrome messaging-composer-chrome--floating",
|
|
2927
|
-
children: [/* @__PURE__ */ W(
|
|
2935
|
+
children: [/* @__PURE__ */ W(Di, {}), /* @__PURE__ */ G("div", {
|
|
2928
2936
|
className: "relative z-10 flex min-h-0 flex-col",
|
|
2929
2937
|
children: [t?.(), /* @__PURE__ */ G("div", {
|
|
2930
2938
|
className: "flex min-h-0 flex-col gap-4 p-3 pb-5 md:p-5",
|
|
@@ -2936,9 +2944,9 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2936
2944
|
children: [e && /* @__PURE__ */ W("div", {
|
|
2937
2945
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2938
2946
|
children: e()
|
|
2939
|
-
}), /* @__PURE__ */ W(
|
|
2947
|
+
}), /* @__PURE__ */ W(Si.Provider, {
|
|
2940
2948
|
value: c,
|
|
2941
|
-
children: /* @__PURE__ */ W(
|
|
2949
|
+
children: /* @__PURE__ */ W(P, { Input: a ?? Ei })
|
|
2942
2950
|
})]
|
|
2943
2951
|
}), n?.()]
|
|
2944
2952
|
})]
|
|
@@ -2955,51 +2963,51 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
2955
2963
|
children: [e && /* @__PURE__ */ W("div", {
|
|
2956
2964
|
className: "flex h-12 shrink-0 items-center justify-center",
|
|
2957
2965
|
children: e()
|
|
2958
|
-
}), /* @__PURE__ */ W(
|
|
2966
|
+
}), /* @__PURE__ */ W(Si.Provider, {
|
|
2959
2967
|
value: c,
|
|
2960
|
-
children: /* @__PURE__ */ W(
|
|
2968
|
+
children: /* @__PURE__ */ W(P, { Input: Ei })
|
|
2961
2969
|
})]
|
|
2962
2970
|
}),
|
|
2963
2971
|
n?.()
|
|
2964
2972
|
]
|
|
2965
2973
|
});
|
|
2966
|
-
},
|
|
2974
|
+
}, ki = {
|
|
2967
2975
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
2968
2976
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
2969
|
-
},
|
|
2977
|
+
}, Ai = ["SYSTEM_AGE_SAFETY_BLOCKED"], ji = { SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines." }, Mi = "age safety guidelines.", Ni = "https://linktr.ee/s/about/contact", Pi = (e) => Ai.includes(e), Fi = (e) => Pi(e.metadata?.custom_type), Ii = (e) => {
|
|
2970
2978
|
let t = e.metadata?.custom_type;
|
|
2971
|
-
if (
|
|
2979
|
+
if (we(t)) return {
|
|
2972
2980
|
kind: "dm-agent",
|
|
2973
2981
|
type: t
|
|
2974
2982
|
};
|
|
2975
|
-
if (
|
|
2983
|
+
if (Ce(t)) return {
|
|
2976
2984
|
kind: "age-safety",
|
|
2977
2985
|
type: t
|
|
2978
2986
|
};
|
|
2979
2987
|
let n = e.dm_agent_system_type;
|
|
2980
|
-
if (
|
|
2988
|
+
if (we(n)) return {
|
|
2981
2989
|
kind: "dm-agent",
|
|
2982
2990
|
type: n
|
|
2983
2991
|
};
|
|
2984
|
-
},
|
|
2985
|
-
let t = e.indexOf(
|
|
2992
|
+
}, Li = (e) => {
|
|
2993
|
+
let t = e.indexOf(Mi);
|
|
2986
2994
|
if (t === -1) return e;
|
|
2987
2995
|
let n = t + 22;
|
|
2988
2996
|
return /* @__PURE__ */ G(U, { children: [
|
|
2989
2997
|
e.slice(0, t),
|
|
2990
2998
|
/* @__PURE__ */ W("a", {
|
|
2991
|
-
href:
|
|
2999
|
+
href: Ni,
|
|
2992
3000
|
target: "_blank",
|
|
2993
3001
|
rel: "noopener noreferrer",
|
|
2994
3002
|
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
2995
|
-
children:
|
|
3003
|
+
children: Mi
|
|
2996
3004
|
}),
|
|
2997
3005
|
e.slice(n)
|
|
2998
3006
|
] });
|
|
2999
|
-
},
|
|
3000
|
-
let t = !
|
|
3007
|
+
}, Ri = (e) => {
|
|
3008
|
+
let t = !Fi(e.message), n = Ii(e.message);
|
|
3001
3009
|
if (n?.kind === "dm-agent") {
|
|
3002
|
-
let r = e.message.text?.trim() ||
|
|
3010
|
+
let r = e.message.text?.trim() || ki[n.type];
|
|
3003
3011
|
return /* @__PURE__ */ G("div", {
|
|
3004
3012
|
className: "str-chat__message--system",
|
|
3005
3013
|
"data-testid": "message-system",
|
|
@@ -3007,7 +3015,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3007
3015
|
className: "mes-dm-agent-system-message mx-auto mb-2 inline-flex w-fit max-w-[min(100%,480px)] items-center justify-center gap-[10px] rounded-[12px] border border-[rgba(0,0,0,0.08)] p-3 text-[rgba(0,0,0,0.55)]",
|
|
3008
3016
|
"data-testid": "dm-agent-system-message",
|
|
3009
3017
|
"data-dm-agent-system-type": n.type,
|
|
3010
|
-
children: [/* @__PURE__ */ W(
|
|
3018
|
+
children: [/* @__PURE__ */ W(He, {
|
|
3011
3019
|
size: 16,
|
|
3012
3020
|
weight: "regular",
|
|
3013
3021
|
"aria-hidden": !0,
|
|
@@ -3016,11 +3024,11 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3016
3024
|
className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]",
|
|
3017
3025
|
children: r
|
|
3018
3026
|
})]
|
|
3019
|
-
}), !t && /* @__PURE__ */ W(
|
|
3027
|
+
}), !t && /* @__PURE__ */ W(B, { message: e.message })]
|
|
3020
3028
|
});
|
|
3021
3029
|
}
|
|
3022
3030
|
if (n?.kind === "age-safety") {
|
|
3023
|
-
let r = e.message.text?.trim() ||
|
|
3031
|
+
let r = e.message.text?.trim() || ji[n.type];
|
|
3024
3032
|
return /* @__PURE__ */ G("div", {
|
|
3025
3033
|
className: "str-chat__message--system",
|
|
3026
3034
|
"data-testid": "message-system",
|
|
@@ -3028,7 +3036,7 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3028
3036
|
className: "mes-age-safety-system-message box-border mx-auto mb-2 flex w-full max-w-[329px] items-start justify-center gap-3 rounded-[12px] border border-[var(--border-secondary,rgba(0,0,0,0.08))] bg-[var(--bg-warning-subtle,#fef3c6)] px-2 py-4 pl-5 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
3029
3037
|
"data-testid": "age-safety-system-message",
|
|
3030
3038
|
"data-age-safety-system-type": n.type,
|
|
3031
|
-
children: [/* @__PURE__ */ W(
|
|
3039
|
+
children: [/* @__PURE__ */ W(ze, {
|
|
3032
3040
|
size: 24,
|
|
3033
3041
|
weight: "duotone",
|
|
3034
3042
|
"aria-hidden": !0,
|
|
@@ -3038,10 +3046,10 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3038
3046
|
className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]",
|
|
3039
3047
|
children: /* @__PURE__ */ W("p", {
|
|
3040
3048
|
className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
3041
|
-
children:
|
|
3049
|
+
children: Li(r)
|
|
3042
3050
|
})
|
|
3043
3051
|
})]
|
|
3044
|
-
}), !t && /* @__PURE__ */ W(
|
|
3052
|
+
}), !t && /* @__PURE__ */ W(B, { message: e.message })]
|
|
3045
3053
|
});
|
|
3046
3054
|
}
|
|
3047
3055
|
return /* @__PURE__ */ G("div", {
|
|
@@ -3054,9 +3062,9 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3054
3062
|
/* @__PURE__ */ W("p", { children: e.message.text }),
|
|
3055
3063
|
/* @__PURE__ */ W("div", { className: "str-chat__message--system__line" })
|
|
3056
3064
|
]
|
|
3057
|
-
}), !t && /* @__PURE__ */ W(
|
|
3065
|
+
}), !t && /* @__PURE__ */ W(B, { message: e.message })]
|
|
3058
3066
|
});
|
|
3059
|
-
},
|
|
3067
|
+
}, zi = l(!1), Bi = ({ cx: e, index: t }) => /* @__PURE__ */ W("circle", {
|
|
3060
3068
|
cx: e,
|
|
3061
3069
|
cy: "6.15",
|
|
3062
3070
|
r: "3.9",
|
|
@@ -3069,15 +3077,15 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3069
3077
|
begin: `${120 * t}ms`,
|
|
3070
3078
|
repeatCount: "indefinite"
|
|
3071
3079
|
})
|
|
3072
|
-
}),
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
]),
|
|
3077
|
-
let { channel: t, channelConfig: n, thread: r } =
|
|
3078
|
-
if (!e && s &&
|
|
3079
|
-
let e =
|
|
3080
|
-
return /* @__PURE__ */ W(
|
|
3080
|
+
}), Vi = /* @__PURE__ */ new Set([
|
|
3081
|
+
b.Thinking,
|
|
3082
|
+
b.Generating,
|
|
3083
|
+
b.ExternalSources
|
|
3084
|
+
]), Hi = ({ threadList: e }) => {
|
|
3085
|
+
let { channel: t, channelConfig: n, thread: r } = me(), { client: i } = he(), { typing: a = {} } = Se(), { aiState: o } = fe(t), s = d(zi);
|
|
3086
|
+
if (!e && s && Vi.has(o)) {
|
|
3087
|
+
let e = Wi(t, i.user?.id);
|
|
3088
|
+
return /* @__PURE__ */ W(Ui, {
|
|
3081
3089
|
avatarId: e?.id ?? "ai-agent",
|
|
3082
3090
|
avatarName: e?.name ?? e?.id ?? "Agent",
|
|
3083
3091
|
avatarImage: e?.image,
|
|
@@ -3085,22 +3093,22 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3085
3093
|
});
|
|
3086
3094
|
}
|
|
3087
3095
|
if (n?.typing_events === !1) return null;
|
|
3088
|
-
let c = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), l = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [],
|
|
3089
|
-
if (!
|
|
3090
|
-
let f =
|
|
3091
|
-
return /* @__PURE__ */ W(
|
|
3096
|
+
let c = e ? [] : Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && !e), l = e ? Object.values(a).filter(({ parent_id: e, user: t }) => t?.id !== i.user?.id && e === r?.id) : [], u = e ? l : c;
|
|
3097
|
+
if (!u.length) return null;
|
|
3098
|
+
let f = u[0]?.user, p = f?.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
|
|
3099
|
+
return /* @__PURE__ */ W(Ui, {
|
|
3092
3100
|
avatarId: f?.id ?? p?.id ?? "typing-user",
|
|
3093
3101
|
avatarName: f?.name ?? p?.name ?? f?.id ?? "Typing user",
|
|
3094
3102
|
avatarImage: f?.image ?? p?.image,
|
|
3095
3103
|
testId: "typing-indicator"
|
|
3096
3104
|
});
|
|
3097
|
-
},
|
|
3105
|
+
}, Ui = ({ avatarId: e, avatarName: t, avatarImage: n, testId: r }) => /* @__PURE__ */ W("div", {
|
|
3098
3106
|
className: "str-chat__li str-chat__li--single str-chat__typing-indicator !static",
|
|
3099
3107
|
"data-testid": r,
|
|
3100
3108
|
style: { marginBottom: "var(--messaging-channel-input-spacer-height, 80px)" },
|
|
3101
3109
|
children: /* @__PURE__ */ G("div", {
|
|
3102
3110
|
className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text",
|
|
3103
|
-
children: [/* @__PURE__ */ W(
|
|
3111
|
+
children: [/* @__PURE__ */ W(_t, {
|
|
3104
3112
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
3105
3113
|
id: e,
|
|
3106
3114
|
name: t,
|
|
@@ -3125,28 +3133,28 @@ var pi = ({ groupPosition: e, isMyMessage: t, message: n, renderText: r }) => {
|
|
|
3125
3133
|
height: "13",
|
|
3126
3134
|
overflow: "visible",
|
|
3127
3135
|
children: [
|
|
3128
|
-
/* @__PURE__ */ W(
|
|
3136
|
+
/* @__PURE__ */ W(Bi, {
|
|
3129
3137
|
cx: "4",
|
|
3130
3138
|
index: 0
|
|
3131
3139
|
}),
|
|
3132
|
-
/* @__PURE__ */ W(
|
|
3140
|
+
/* @__PURE__ */ W(Bi, {
|
|
3133
3141
|
cx: "16",
|
|
3134
3142
|
index: 1
|
|
3135
3143
|
}),
|
|
3136
|
-
/* @__PURE__ */ W(
|
|
3144
|
+
/* @__PURE__ */ W(Bi, {
|
|
3137
3145
|
cx: "28",
|
|
3138
3146
|
index: 2
|
|
3139
3147
|
})
|
|
3140
3148
|
]
|
|
3141
3149
|
})
|
|
3142
3150
|
})
|
|
3143
|
-
}), /* @__PURE__ */ W(
|
|
3151
|
+
}), /* @__PURE__ */ W(En, { side: "other" })]
|
|
3144
3152
|
})
|
|
3145
3153
|
})
|
|
3146
3154
|
})]
|
|
3147
3155
|
})
|
|
3148
3156
|
});
|
|
3149
|
-
function
|
|
3157
|
+
function Wi(e, t) {
|
|
3150
3158
|
let n = e?.state?.members ?? {};
|
|
3151
3159
|
for (let e of Object.values(n)) {
|
|
3152
3160
|
let n = e?.user;
|
|
@@ -3155,7 +3163,7 @@ function Ui(e, t) {
|
|
|
3155
3163
|
}
|
|
3156
3164
|
//#endregion
|
|
3157
3165
|
//#region src/components/MessagingShell/ChannelEmptyState.tsx
|
|
3158
|
-
var
|
|
3166
|
+
var Gi = () => null, Ki = ({ className: e, message: t }) => /* @__PURE__ */ G("div", {
|
|
3159
3167
|
className: Y("flex items-center justify-center h-full", e),
|
|
3160
3168
|
children: [/* @__PURE__ */ G("svg", {
|
|
3161
3169
|
viewBox: "0 0 100 100",
|
|
@@ -3206,45 +3214,45 @@ var Wi = () => null, Gi = ({ className: e, message: t }) => /* @__PURE__ */ G("d
|
|
|
3206
3214
|
className: "text-stone",
|
|
3207
3215
|
children: t
|
|
3208
3216
|
})]
|
|
3209
|
-
}),
|
|
3217
|
+
}), qi = s.memo(() => /* @__PURE__ */ W("div", {
|
|
3210
3218
|
className: "messaging-loading-state flex items-center justify-center h-full",
|
|
3211
3219
|
children: /* @__PURE__ */ G("div", {
|
|
3212
3220
|
className: "flex items-center",
|
|
3213
|
-
children: [/* @__PURE__ */ W(
|
|
3221
|
+
children: [/* @__PURE__ */ W(Ki, { className: "w-6 h-6" }), /* @__PURE__ */ W("span", {
|
|
3214
3222
|
className: "text-sm text-stone",
|
|
3215
3223
|
children: "Loading messages"
|
|
3216
3224
|
})]
|
|
3217
3225
|
})
|
|
3218
3226
|
}));
|
|
3219
|
-
|
|
3227
|
+
qi.displayName = "LoadingState";
|
|
3220
3228
|
//#endregion
|
|
3221
3229
|
//#region src/components/ChannelView.tsx
|
|
3222
|
-
var
|
|
3223
|
-
let { channel: A, messages: j } =
|
|
3224
|
-
|
|
3230
|
+
var Ji = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMessageInputFooter: r, renderConversationFooter: i, onLeaveConversation: a, onBlockParticipant: o, showDeleteConversation: c = !0, onDeleteConversationClick: l, onBlockParticipantClick: d, onReportParticipantClick: p, showBlockParticipant: m = !0, showReportParticipant: g = !0, composerDisabled: _ = !1, composerDisabledReason: v, showStarButton: y = !1, renderChannelBanner: b, customChannelActions: x, renderChannelActions: S, renderMessage: C, viewerLanguage: w, showChannelInfo: T = !0, onParticipantNameClick: E, onOutboundClick: D, resolveOutbound: O, composerInput: k }) => {
|
|
3231
|
+
let { channel: A, messages: j } = me(), M = h(D);
|
|
3232
|
+
f(() => {
|
|
3225
3233
|
M.current = D;
|
|
3226
3234
|
}, [D]);
|
|
3227
|
-
let N =
|
|
3235
|
+
let N = u((e) => {
|
|
3228
3236
|
M.current?.(e);
|
|
3229
|
-
}, []), P = D ? N : void 0,
|
|
3237
|
+
}, []), P = D ? N : void 0, F = jn(j, O), L = A.state.messages.some((e) => e.type !== "deleted"), R = b ? /* @__PURE__ */ W(s.Fragment, { children: b() }, "lt-channel-banner") : null, z = /* @__PURE__ */ W(Tt, {
|
|
3230
3238
|
className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
|
|
3231
3239
|
onBack: e,
|
|
3232
3240
|
showBackButton: t,
|
|
3233
3241
|
showChannelInfo: T,
|
|
3234
3242
|
showStarButton: y,
|
|
3235
3243
|
onLeaveConversation: a,
|
|
3236
|
-
onBlockParticipant:
|
|
3244
|
+
onBlockParticipant: o,
|
|
3237
3245
|
showDeleteConversation: c,
|
|
3238
|
-
showBlockParticipant:
|
|
3246
|
+
showBlockParticipant: m,
|
|
3239
3247
|
showReportParticipant: g,
|
|
3240
|
-
onDeleteConversationClick:
|
|
3241
|
-
onBlockParticipantClick:
|
|
3248
|
+
onDeleteConversationClick: l,
|
|
3249
|
+
onBlockParticipantClick: d,
|
|
3242
3250
|
onReportParticipantClick: p,
|
|
3243
3251
|
customChannelActions: x,
|
|
3244
3252
|
renderChannelActions: S,
|
|
3245
3253
|
onParticipantNameClick: E
|
|
3246
|
-
}),
|
|
3247
|
-
let { message: t } = H("ChannelView"), n = /* @__PURE__ */ W(
|
|
3254
|
+
}), B = u((e) => {
|
|
3255
|
+
let { message: t } = H("ChannelView"), n = /* @__PURE__ */ W(gi, {
|
|
3248
3256
|
...e,
|
|
3249
3257
|
viewerLanguage: w,
|
|
3250
3258
|
onOutboundClick: P
|
|
@@ -3255,16 +3263,16 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3255
3263
|
C,
|
|
3256
3264
|
w
|
|
3257
3265
|
]);
|
|
3258
|
-
return /* @__PURE__ */ W(
|
|
3259
|
-
value:
|
|
3266
|
+
return /* @__PURE__ */ W(Dn.Provider, {
|
|
3267
|
+
value: F,
|
|
3260
3268
|
children: /* @__PURE__ */ W(ae, {
|
|
3261
3269
|
overrides: {
|
|
3262
|
-
Message:
|
|
3263
|
-
MessageActions:
|
|
3270
|
+
Message: B,
|
|
3271
|
+
MessageActions: yi,
|
|
3264
3272
|
UnreadMessagesNotification: () => null,
|
|
3265
3273
|
UnreadMessagesSeparator: () => null
|
|
3266
3274
|
},
|
|
3267
|
-
children: /* @__PURE__ */ W(
|
|
3275
|
+
children: /* @__PURE__ */ W(ie, { children: k ? /* @__PURE__ */ G("div", {
|
|
3268
3276
|
className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col",
|
|
3269
3277
|
children: [/* @__PURE__ */ G("div", {
|
|
3270
3278
|
className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
|
|
@@ -3274,7 +3282,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3274
3282
|
className: "str-chat__message-list-scroll",
|
|
3275
3283
|
children: [z, R]
|
|
3276
3284
|
})
|
|
3277
|
-
}), /* @__PURE__ */ W(
|
|
3285
|
+
}), /* @__PURE__ */ W(I, {
|
|
3278
3286
|
head: L ? /* @__PURE__ */ G("div", {
|
|
3279
3287
|
className: "sticky top-0 z-10",
|
|
3280
3288
|
children: [z, R]
|
|
@@ -3282,7 +3290,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3282
3290
|
hideDeletedMessages: !0,
|
|
3283
3291
|
hideNewMessageSeparator: !1
|
|
3284
3292
|
})]
|
|
3285
|
-
}, "lt-channel-message-list"), /* @__PURE__ */ W(
|
|
3293
|
+
}, "lt-channel-message-list"), /* @__PURE__ */ W(Oi, {
|
|
3286
3294
|
...n && { renderActions: () => n?.(A) },
|
|
3287
3295
|
...i && { renderHeader: () => i(A) },
|
|
3288
3296
|
renderFooter: () => r?.(A),
|
|
@@ -3299,7 +3307,7 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3299
3307
|
className: "str-chat__message-list-scroll",
|
|
3300
3308
|
children: [z, R]
|
|
3301
3309
|
})
|
|
3302
|
-
}), /* @__PURE__ */ W(
|
|
3310
|
+
}), /* @__PURE__ */ W(I, {
|
|
3303
3311
|
head: L ? /* @__PURE__ */ G("div", {
|
|
3304
3312
|
className: "sticky top-0 z-10",
|
|
3305
3313
|
children: [z, R]
|
|
@@ -3308,8 +3316,8 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3308
3316
|
hideNewMessageSeparator: !1
|
|
3309
3317
|
})]
|
|
3310
3318
|
}, "lt-channel-message-list"),
|
|
3311
|
-
i ? /* @__PURE__ */ W(
|
|
3312
|
-
/* @__PURE__ */ W(
|
|
3319
|
+
i ? /* @__PURE__ */ W(s.Fragment, { children: i(A) }, "lt-channel-conversation-footer") : null,
|
|
3320
|
+
/* @__PURE__ */ W(Oi, {
|
|
3313
3321
|
...n && { renderActions: () => n?.(A) },
|
|
3314
3322
|
renderFooter: () => r?.(A),
|
|
3315
3323
|
disabled: _,
|
|
@@ -3319,14 +3327,14 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3319
3327
|
] }) })
|
|
3320
3328
|
})
|
|
3321
3329
|
});
|
|
3322
|
-
},
|
|
3323
|
-
let z =
|
|
3330
|
+
}, Yi = s.memo(({ channel: e, onBack: t, showBackButton: n = !1, renderMessageInputActions: r, renderMessageInputFooter: i, renderConversationFooter: a, onLeaveConversation: o, onBlockParticipant: s, className: c, CustomChannelEmptyState: l = Gi, showDeleteConversation: d = !0, onDeleteConversationClick: p, onBlockParticipantClick: m, onReportParticipantClick: g, showBlockParticipant: _ = !0, showReportParticipant: v = !0, composerDisabled: y = !1, composerDisabledReason: b, dmAgentEnabled: x, messageMetadata: S, onMessageSent: w, showStarButton: T = !1, renderChannelBanner: E, customChannelActions: D, renderChannelActions: O, renderMessage: k, onMessageLinkClick: A, sendButton: j, attachmentPreviewList: M, viewerLanguage: N, showChannelInfo: P = !0, onParticipantNameClick: F, onOutboundClick: I, resolveOutbound: L, composerInput: R }) => {
|
|
3331
|
+
let z = u(async (t, n, r) => {
|
|
3324
3332
|
let i = e.data?.chatbot_paused === !0, a = x && !i, o = {
|
|
3325
3333
|
...n,
|
|
3326
3334
|
...a && { silent: !0 },
|
|
3327
|
-
...
|
|
3335
|
+
...S && { metadata: {
|
|
3328
3336
|
...n.metadata ?? {},
|
|
3329
|
-
...
|
|
3337
|
+
...S
|
|
3330
3338
|
} }
|
|
3331
3339
|
}, s = {
|
|
3332
3340
|
...r,
|
|
@@ -3336,12 +3344,12 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3336
3344
|
}, [
|
|
3337
3345
|
e,
|
|
3338
3346
|
x,
|
|
3339
|
-
|
|
3347
|
+
S,
|
|
3340
3348
|
w
|
|
3341
|
-
]),
|
|
3342
|
-
|
|
3349
|
+
]), B = h(null);
|
|
3350
|
+
f(() => {
|
|
3343
3351
|
if (!A) return;
|
|
3344
|
-
let t =
|
|
3352
|
+
let t = B.current;
|
|
3345
3353
|
if (!t) return;
|
|
3346
3354
|
let n = (t) => {
|
|
3347
3355
|
let n = t.target?.closest("a[href]"), r = n?.getAttribute("href");
|
|
@@ -3351,25 +3359,25 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3351
3359
|
};
|
|
3352
3360
|
return t.addEventListener("click", n), () => t.removeEventListener("click", n);
|
|
3353
3361
|
}, [A, e]);
|
|
3354
|
-
let
|
|
3362
|
+
let ee = J(e.type) ? { "--lt-msg-card-width": "368px" } : void 0;
|
|
3355
3363
|
return /* @__PURE__ */ W("div", {
|
|
3356
|
-
ref:
|
|
3364
|
+
ref: B,
|
|
3357
3365
|
"data-testid": "channel-view",
|
|
3358
3366
|
className: Y("messaging-channel-view h-full flex flex-col", c),
|
|
3359
|
-
style:
|
|
3360
|
-
children: /* @__PURE__ */ W(
|
|
3367
|
+
style: ee,
|
|
3368
|
+
children: /* @__PURE__ */ W(zi.Provider, {
|
|
3361
3369
|
value: x ?? !1,
|
|
3362
|
-
children: /* @__PURE__ */ W(
|
|
3370
|
+
children: /* @__PURE__ */ W(C, {
|
|
3363
3371
|
channel: e,
|
|
3364
|
-
MessageSystem:
|
|
3365
|
-
EmptyStateIndicator:
|
|
3366
|
-
LoadingIndicator:
|
|
3367
|
-
DateSeparator:
|
|
3368
|
-
TypingIndicator:
|
|
3372
|
+
MessageSystem: Ri,
|
|
3373
|
+
EmptyStateIndicator: l,
|
|
3374
|
+
LoadingIndicator: qi,
|
|
3375
|
+
DateSeparator: Et,
|
|
3376
|
+
TypingIndicator: Hi,
|
|
3369
3377
|
doSendMessageRequest: z,
|
|
3370
3378
|
...j ? { SendButton: j } : {},
|
|
3371
3379
|
...M ? { AttachmentPreviewList: M } : {},
|
|
3372
|
-
children: /* @__PURE__ */ W(
|
|
3380
|
+
children: /* @__PURE__ */ W(Ji, {
|
|
3373
3381
|
onBack: t,
|
|
3374
3382
|
showBackButton: n,
|
|
3375
3383
|
renderMessageInputActions: r,
|
|
@@ -3377,10 +3385,10 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3377
3385
|
renderConversationFooter: a,
|
|
3378
3386
|
onLeaveConversation: o,
|
|
3379
3387
|
onBlockParticipant: s,
|
|
3380
|
-
CustomChannelEmptyState:
|
|
3381
|
-
showDeleteConversation:
|
|
3388
|
+
CustomChannelEmptyState: l,
|
|
3389
|
+
showDeleteConversation: d,
|
|
3382
3390
|
onDeleteConversationClick: p,
|
|
3383
|
-
onBlockParticipantClick:
|
|
3391
|
+
onBlockParticipantClick: m,
|
|
3384
3392
|
onReportParticipantClick: g,
|
|
3385
3393
|
showBlockParticipant: _,
|
|
3386
3394
|
showReportParticipant: v,
|
|
@@ -3402,10 +3410,10 @@ var qi = ({ onBack: e, showBackButton: t, renderMessageInputActions: n, renderMe
|
|
|
3402
3410
|
})
|
|
3403
3411
|
});
|
|
3404
3412
|
});
|
|
3405
|
-
|
|
3413
|
+
Yi.displayName = "ChannelView";
|
|
3406
3414
|
//#endregion
|
|
3407
3415
|
//#region src/components/MessagingShell/ErrorState.tsx
|
|
3408
|
-
var
|
|
3416
|
+
var Xi = s.memo(({ message: e, onBack: t }) => /* @__PURE__ */ W("div", {
|
|
3409
3417
|
className: "messaging-error-state flex items-center justify-center h-full p-8",
|
|
3410
3418
|
children: /* @__PURE__ */ G("div", {
|
|
3411
3419
|
className: "text-center max-w-sm",
|
|
@@ -3434,26 +3442,26 @@ var Yi = o.memo(({ message: e, onBack: t }) => /* @__PURE__ */ W("div", {
|
|
|
3434
3442
|
]
|
|
3435
3443
|
})
|
|
3436
3444
|
}));
|
|
3437
|
-
|
|
3445
|
+
Xi.displayName = "ErrorState";
|
|
3438
3446
|
//#endregion
|
|
3439
3447
|
//#region src/components/MessagingShell/index.tsx
|
|
3440
|
-
var
|
|
3441
|
-
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } =
|
|
3442
|
-
|
|
3443
|
-
let
|
|
3444
|
-
|
|
3445
|
-
let
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
}, [F]),
|
|
3448
|
+
var Zi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversationFooter: n, onChannelSelect: r, onExitConversation: i, initialParticipantFilter: a, initialParticipantData: o, CustomChannelEmptyState: s, onBlockParticipantClick: c, onReportParticipantClick: l, dmAgentEnabled: d, onMessageSent: p, viewerLanguage: m, renderChannelBanner: _, customChannelActions: v, renderChannelActions: y, onParticipantNameClick: b, onOutboundClick: x, resolveOutbound: S, renderMessage: C, onMessageLinkClick: w, showChannelInfo: T, composerInput: E, attachmentPreviewList: D }) => {
|
|
3449
|
+
let { client: O, isConnected: k, isLoading: A, error: j, refreshConnection: M, service: N, debug: P } = at(), [F, I] = g(null), [L, R] = g(null), [z, B] = g(!1), { showDeleteConversation: ee = !0 } = e, te = h(o);
|
|
3450
|
+
te.current = o;
|
|
3451
|
+
let ne = h(r);
|
|
3452
|
+
ne.current = r;
|
|
3453
|
+
let re = h(null), V = h(null);
|
|
3454
|
+
f(() => {
|
|
3455
|
+
V.current = F;
|
|
3456
|
+
}, [F]), f(() => {
|
|
3449
3457
|
if (!O || !k) return;
|
|
3450
3458
|
let e = O.userID;
|
|
3451
3459
|
if (!e) return;
|
|
3452
3460
|
let t = `${e}::${a}`;
|
|
3453
|
-
if (
|
|
3454
|
-
|
|
3461
|
+
if (re.current === t) return;
|
|
3462
|
+
re.current = t;
|
|
3455
3463
|
let n = () => {
|
|
3456
|
-
|
|
3464
|
+
re.current === t && (re.current = null);
|
|
3457
3465
|
};
|
|
3458
3466
|
(async () => {
|
|
3459
3467
|
try {
|
|
@@ -3463,10 +3471,10 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3463
3471
|
members: { $eq: [e, a] }
|
|
3464
3472
|
}, {}, { limit: 1 });
|
|
3465
3473
|
if (t.length > 0) {
|
|
3466
|
-
I(t[0]), R(null),
|
|
3474
|
+
I(t[0]), R(null), ne.current?.(t[0]), P && console.log("[MessagingShell] Initial conversation loaded:", t[0].id);
|
|
3467
3475
|
return;
|
|
3468
3476
|
}
|
|
3469
|
-
let r =
|
|
3477
|
+
let r = te.current;
|
|
3470
3478
|
if (!r || !N) {
|
|
3471
3479
|
n(), R("No conversation found with this account"), P && console.log("[MessagingShell] No conversation found for:", a);
|
|
3472
3480
|
return;
|
|
@@ -3477,12 +3485,12 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3477
3485
|
name: r.name,
|
|
3478
3486
|
phone: r.phone
|
|
3479
3487
|
});
|
|
3480
|
-
I(e), R(null),
|
|
3488
|
+
I(e), R(null), ne.current?.(e), P && console.log("[MessagingShell] Channel created and loaded:", e.id);
|
|
3481
3489
|
} catch (e) {
|
|
3482
3490
|
console.error("[MessagingShell] Failed to create conversation:", e), n(), R("Failed to create conversation");
|
|
3483
3491
|
}
|
|
3484
3492
|
} catch (e) {
|
|
3485
|
-
console.error("[MessagingShell] Failed to load initial conversation:", e), n(),
|
|
3493
|
+
console.error("[MessagingShell] Failed to load initial conversation:", e), n(), V.current || R("Failed to load conversation");
|
|
3486
3494
|
}
|
|
3487
3495
|
})();
|
|
3488
3496
|
}, [
|
|
@@ -3492,35 +3500,35 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3492
3500
|
N,
|
|
3493
3501
|
P
|
|
3494
3502
|
]);
|
|
3495
|
-
let
|
|
3496
|
-
|
|
3497
|
-
let
|
|
3498
|
-
I(null),
|
|
3503
|
+
let ie = h(i);
|
|
3504
|
+
ie.current = i;
|
|
3505
|
+
let ae = u(() => {
|
|
3506
|
+
I(null), B(!0), ie.current?.();
|
|
3499
3507
|
}, []);
|
|
3500
|
-
return A ? /* @__PURE__ */ W(
|
|
3508
|
+
return A ? /* @__PURE__ */ W(qi, {}) : j ? /* @__PURE__ */ W(Xi, {
|
|
3501
3509
|
message: j,
|
|
3502
3510
|
onBack: M
|
|
3503
|
-
}) : !k || !O ? /* @__PURE__ */ W(
|
|
3511
|
+
}) : !k || !O ? /* @__PURE__ */ W(Xi, {
|
|
3504
3512
|
message: "Not connected to messaging service",
|
|
3505
3513
|
onBack: M
|
|
3506
|
-
}) : L ? /* @__PURE__ */ W(
|
|
3514
|
+
}) : L ? /* @__PURE__ */ W(Xi, { message: L }) : z && !F ? /* @__PURE__ */ W(Xi, { message: "Conversation ended" }) : F ? /* @__PURE__ */ W("div", {
|
|
3507
3515
|
className: "messaging-shell h-full bg-background-primary overflow-hidden",
|
|
3508
3516
|
children: /* @__PURE__ */ W("div", {
|
|
3509
3517
|
className: "flex h-full min-h-0 flex-col",
|
|
3510
|
-
children: /* @__PURE__ */ W(
|
|
3518
|
+
children: /* @__PURE__ */ W(Yi, {
|
|
3511
3519
|
channel: F,
|
|
3512
3520
|
renderMessageInputActions: t,
|
|
3513
3521
|
renderConversationFooter: n,
|
|
3514
3522
|
renderChannelBanner: _,
|
|
3515
|
-
onLeaveConversation:
|
|
3516
|
-
onBlockParticipant:
|
|
3523
|
+
onLeaveConversation: ae,
|
|
3524
|
+
onBlockParticipant: ae,
|
|
3517
3525
|
CustomChannelEmptyState: s,
|
|
3518
|
-
showDeleteConversation:
|
|
3526
|
+
showDeleteConversation: ee,
|
|
3519
3527
|
onBlockParticipantClick: c,
|
|
3520
|
-
onReportParticipantClick:
|
|
3521
|
-
dmAgentEnabled:
|
|
3528
|
+
onReportParticipantClick: l,
|
|
3529
|
+
dmAgentEnabled: d,
|
|
3522
3530
|
onMessageSent: p,
|
|
3523
|
-
viewerLanguage:
|
|
3531
|
+
viewerLanguage: m,
|
|
3524
3532
|
customChannelActions: v,
|
|
3525
3533
|
renderChannelActions: y,
|
|
3526
3534
|
onParticipantNameClick: b,
|
|
@@ -3533,30 +3541,30 @@ var Xi = ({ capabilities: e = {}, renderMessageInputActions: t, renderConversati
|
|
|
3533
3541
|
attachmentPreviewList: D
|
|
3534
3542
|
}, F.id)
|
|
3535
3543
|
})
|
|
3536
|
-
}) : /* @__PURE__ */ W(
|
|
3544
|
+
}) : /* @__PURE__ */ W(qi, {});
|
|
3537
3545
|
};
|
|
3538
3546
|
//#endregion
|
|
3539
3547
|
//#region src/hooks/useRestorePendingMessages.ts
|
|
3540
|
-
function
|
|
3548
|
+
function Qi(e) {
|
|
3541
3549
|
let t = e.state.pending_messages;
|
|
3542
3550
|
if (t?.length) for (let n of t) e.state.addMessageSorted(n.message);
|
|
3543
3551
|
}
|
|
3544
3552
|
//#endregion
|
|
3545
3553
|
//#region src/components/ChannelList/ChannelListContext.tsx
|
|
3546
|
-
var
|
|
3554
|
+
var $i = s.createContext({
|
|
3547
3555
|
selectedChannel: void 0,
|
|
3548
3556
|
onChannelSelect: () => {},
|
|
3549
3557
|
debug: !1,
|
|
3550
3558
|
renderMessagePreview: void 0,
|
|
3551
3559
|
channelPreview: void 0,
|
|
3552
3560
|
viewerLanguage: void 0
|
|
3553
|
-
}),
|
|
3561
|
+
}), ea = $i.Provider, ta = () => s.useContext($i), na = (e, t) => {
|
|
3554
3562
|
let n = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), r = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
|
|
3555
3563
|
return Math.floor((r - n) / 864e5);
|
|
3556
|
-
},
|
|
3564
|
+
}, ra = (e) => {
|
|
3557
3565
|
let t = /* @__PURE__ */ new Date();
|
|
3558
3566
|
if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60) return "Just now";
|
|
3559
|
-
let n =
|
|
3567
|
+
let n = na(e, t);
|
|
3560
3568
|
return n === 0 ? e.toLocaleTimeString([], {
|
|
3561
3569
|
hour: "numeric",
|
|
3562
3570
|
minute: "2-digit",
|
|
@@ -3569,8 +3577,8 @@ var Qi = o.createContext({
|
|
|
3569
3577
|
day: "numeric",
|
|
3570
3578
|
year: "numeric"
|
|
3571
3579
|
});
|
|
3572
|
-
},
|
|
3573
|
-
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } =
|
|
3580
|
+
}, ia = s.memo((e) => {
|
|
3581
|
+
let { channel: t, unread: n } = e, { selectedChannel: r, onChannelSelect: i, debug: a, channelPreview: o, renderMessagePreview: s, viewerLanguage: c } = ta(), { client: l } = he(), u = r?.id === t?.id, d = ot(t);
|
|
3574
3582
|
if (o) return /* @__PURE__ */ W(o, {
|
|
3575
3583
|
...e,
|
|
3576
3584
|
active: u,
|
|
@@ -3583,13 +3591,13 @@ var Qi = o.createContext({
|
|
|
3583
3591
|
}, p = (e) => {
|
|
3584
3592
|
let t = e.key === "Enter" || e.key === " ", n = e.repeat;
|
|
3585
3593
|
!t || n || (e.preventDefault(), f());
|
|
3586
|
-
}, m =
|
|
3594
|
+
}, m = st(t?.state?.members, l?.userID, t?.type), h = dt(m?.user), g = m?.user?.image, _ = (() => {
|
|
3587
3595
|
let e = t?.state?.messages;
|
|
3588
3596
|
if (e?.length) {
|
|
3589
3597
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].type !== "system") return e[t];
|
|
3590
3598
|
}
|
|
3591
3599
|
})(), v = (() => {
|
|
3592
|
-
let e =
|
|
3600
|
+
let e = Ot({
|
|
3593
3601
|
message: _,
|
|
3594
3602
|
viewerLanguage: c
|
|
3595
3603
|
}), { custom_type: t, attachment_content_type: n } = _?.metadata || {};
|
|
@@ -3602,7 +3610,7 @@ var Qi = o.createContext({
|
|
|
3602
3610
|
if (e) return e;
|
|
3603
3611
|
let r = _?.attachments?.[0];
|
|
3604
3612
|
return r ? r.og_scrape_url ? r.og_scrape_url : r.type === "image" ? "📷 Sent an image" : r.type === "video" ? "🎥 Sent a video" : r.type === "audio" ? "🎵 Sent audio" : r.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
3605
|
-
})(), y = _?.created_at ?
|
|
3613
|
+
})(), y = _?.created_at ? ra(new Date(_.created_at)) : "", b = _ ? vn(_) : !1, x = s ? s(_, v) : `${b ? "✨ " : ""}${v}`, S = n ?? 0;
|
|
3606
3614
|
return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
3607
3615
|
channelId: t?.id,
|
|
3608
3616
|
isSelected: u,
|
|
@@ -3621,7 +3629,7 @@ var Qi = o.createContext({
|
|
|
3621
3629
|
"data-dd-privacy": "mask",
|
|
3622
3630
|
children: /* @__PURE__ */ G("div", {
|
|
3623
3631
|
className: "flex items-start gap-4",
|
|
3624
|
-
children: [/* @__PURE__ */ W(
|
|
3632
|
+
children: [/* @__PURE__ */ W(_t, {
|
|
3625
3633
|
id: m?.user?.id || t.id || "unknown",
|
|
3626
3634
|
name: h,
|
|
3627
3635
|
image: g,
|
|
@@ -3657,14 +3665,14 @@ var Qi = o.createContext({
|
|
|
3657
3665
|
})
|
|
3658
3666
|
});
|
|
3659
3667
|
});
|
|
3660
|
-
|
|
3668
|
+
ia.displayName = "CustomChannelPreview";
|
|
3661
3669
|
//#endregion
|
|
3662
3670
|
//#region src/components/ChannelList/index.tsx
|
|
3663
|
-
var
|
|
3664
|
-
let y =
|
|
3671
|
+
var aa = { last_message_at: -1 }, oa = s.memo(({ onChannelSelect: e, selectedChannel: t, filters: n, allowNewMessagesFromUnfilteredChannels: r = !1, channelRenderFilterFn: i, sort: a = aa, className: o, customEmptyStateIndicator: c, channelListPaginator: l = O, channelPreview: u, renderMessagePreview: d, viewerLanguage: f, lockChannelOrder: p, onMessageNewHandler: m, onMessageNew: h, onChannelVisible: g, onAddedToChannel: _, onChannelUpdated: v }) => {
|
|
3672
|
+
let y = s.useRef(0);
|
|
3665
3673
|
y.current++;
|
|
3666
|
-
let { debug: b = !1 } =
|
|
3667
|
-
for (let t of e)
|
|
3674
|
+
let { debug: b = !1 } = rt(), x = s.useCallback((e) => {
|
|
3675
|
+
for (let t of e) Qi(t);
|
|
3668
3676
|
return i ? i(e) : e;
|
|
3669
3677
|
}, [i]);
|
|
3670
3678
|
b && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
@@ -3672,7 +3680,7 @@ var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3672
3680
|
selectedChannelId: t?.id,
|
|
3673
3681
|
filters: n
|
|
3674
3682
|
});
|
|
3675
|
-
let S =
|
|
3683
|
+
let S = s.useMemo(() => ({
|
|
3676
3684
|
selectedChannel: t,
|
|
3677
3685
|
onChannelSelect: e,
|
|
3678
3686
|
debug: b,
|
|
@@ -3688,12 +3696,12 @@ var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3688
3696
|
f
|
|
3689
3697
|
]);
|
|
3690
3698
|
return /* @__PURE__ */ W("div", {
|
|
3691
|
-
className: Y("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
3699
|
+
className: Y("messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden", o),
|
|
3692
3700
|
children: /* @__PURE__ */ W("div", {
|
|
3693
3701
|
className: "flex-1 overflow-hidden min-w-0",
|
|
3694
|
-
children: /* @__PURE__ */ W(
|
|
3702
|
+
children: /* @__PURE__ */ W(ea, {
|
|
3695
3703
|
value: S,
|
|
3696
|
-
children: /* @__PURE__ */ W(
|
|
3704
|
+
children: /* @__PURE__ */ W(w, {
|
|
3697
3705
|
filters: n,
|
|
3698
3706
|
sort: a,
|
|
3699
3707
|
options: { limit: 30 },
|
|
@@ -3706,32 +3714,32 @@ var ia = { last_message_at: -1 }, aa = o.memo(({ onChannelSelect: e, selectedCha
|
|
|
3706
3714
|
onAddedToChannel: _,
|
|
3707
3715
|
onChannelUpdated: v,
|
|
3708
3716
|
Paginator: l,
|
|
3709
|
-
Preview:
|
|
3717
|
+
Preview: ia,
|
|
3710
3718
|
EmptyStateIndicator: c
|
|
3711
3719
|
}, `${JSON.stringify(n)}:${JSON.stringify(a)}`)
|
|
3712
3720
|
})
|
|
3713
3721
|
})
|
|
3714
3722
|
});
|
|
3715
3723
|
});
|
|
3716
|
-
|
|
3724
|
+
oa.displayName = "ChannelList";
|
|
3717
3725
|
//#endregion
|
|
3718
3726
|
//#region src/components/RichCard/RichCardBody.tsx
|
|
3719
|
-
var
|
|
3727
|
+
var sa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", ca = "text-[14px] leading-5 tracking-[0.02em]", la = () => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("br", {}), /* @__PURE__ */ W("span", {
|
|
3720
3728
|
"aria-hidden": !0,
|
|
3721
3729
|
className: "block h-1.5"
|
|
3722
|
-
})] }),
|
|
3730
|
+
})] }), ua = (e) => e.split(/\r?\n/).map((e, t, n) => /* @__PURE__ */ G(s.Fragment, { children: [e, t < n.length - 1 ? /* @__PURE__ */ W(la, {}) : null] }, t)), da = ({ surface: e, actions: t, layout: n }) => {
|
|
3723
3731
|
if (t == null || t.length === 0) return null;
|
|
3724
3732
|
let r = n === "stacked";
|
|
3725
3733
|
return /* @__PURE__ */ W("div", {
|
|
3726
3734
|
className: Y("flex gap-2", r ? "mt-4 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"),
|
|
3727
|
-
children: t.map((t, n) => /* @__PURE__ */ W(
|
|
3735
|
+
children: t.map((t, n) => /* @__PURE__ */ W(Nt, {
|
|
3728
3736
|
variant: e,
|
|
3729
3737
|
cta: t,
|
|
3730
3738
|
fullWidth: r,
|
|
3731
3739
|
standalone: !0
|
|
3732
3740
|
}, `${t.label}-${n}`))
|
|
3733
3741
|
});
|
|
3734
|
-
},
|
|
3742
|
+
}, fa = ({ ctaSurface: e, chinTextColor: t, title: n, subtitle: r, subtitleLines: i = 3, appIcon: a, actions: o }) => {
|
|
3735
3743
|
let s = n != null && n.trim() !== "", c = r != null && r.trim() !== "", l = o != null && o.length > 0;
|
|
3736
3744
|
if (!s && !c && !l) return null;
|
|
3737
3745
|
let u = { color: t }, d = i > 1 ? {
|
|
@@ -3748,14 +3756,14 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3748
3756
|
className: "shrink-0",
|
|
3749
3757
|
children: a
|
|
3750
3758
|
}) : null, /* @__PURE__ */ W("p", {
|
|
3751
|
-
className: Y("min-w-0",
|
|
3759
|
+
className: Y("min-w-0", sa),
|
|
3752
3760
|
style: u,
|
|
3753
3761
|
children: n
|
|
3754
3762
|
})]
|
|
3755
3763
|
}), c && /* @__PURE__ */ W("p", {
|
|
3756
|
-
className: Y(
|
|
3764
|
+
className: Y(ca, i <= 1 && "truncate"),
|
|
3757
3765
|
style: d,
|
|
3758
|
-
children: i > 1 ?
|
|
3766
|
+
children: i > 1 ? ua(r ?? "") : r
|
|
3759
3767
|
})]
|
|
3760
3768
|
});
|
|
3761
3769
|
return /* @__PURE__ */ W("div", {
|
|
@@ -3763,21 +3771,21 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3763
3771
|
children: f ? /* @__PURE__ */ G("div", {
|
|
3764
3772
|
"data-testid": "rich-card-chin-row",
|
|
3765
3773
|
className: "flex items-center justify-between gap-3",
|
|
3766
|
-
children: [p, /* @__PURE__ */ W(
|
|
3774
|
+
children: [p, /* @__PURE__ */ W(da, {
|
|
3767
3775
|
surface: e,
|
|
3768
3776
|
actions: o,
|
|
3769
3777
|
layout: "row"
|
|
3770
3778
|
})]
|
|
3771
|
-
}) : /* @__PURE__ */ G(U, { children: [p, /* @__PURE__ */ W(
|
|
3779
|
+
}) : /* @__PURE__ */ G(U, { children: [p, /* @__PURE__ */ W(da, {
|
|
3772
3780
|
surface: e,
|
|
3773
3781
|
actions: o,
|
|
3774
3782
|
layout: "stacked"
|
|
3775
3783
|
})] })
|
|
3776
3784
|
});
|
|
3777
|
-
},
|
|
3785
|
+
}, pa = {
|
|
3778
3786
|
dark: "bg-white/[0.06]",
|
|
3779
3787
|
light: "bg-black/[0.04]"
|
|
3780
|
-
},
|
|
3788
|
+
}, ma = {
|
|
3781
3789
|
1: [0],
|
|
3782
3790
|
2: [-10, 10],
|
|
3783
3791
|
3: [
|
|
@@ -3785,7 +3793,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3785
3793
|
0,
|
|
3786
3794
|
13
|
|
3787
3795
|
]
|
|
3788
|
-
},
|
|
3796
|
+
}, ha = {
|
|
3789
3797
|
1: [0],
|
|
3790
3798
|
2: [-26, 26],
|
|
3791
3799
|
3: [
|
|
@@ -3793,7 +3801,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3793
3801
|
0,
|
|
3794
3802
|
40
|
|
3795
3803
|
]
|
|
3796
|
-
},
|
|
3804
|
+
}, ga = {
|
|
3797
3805
|
1: [0],
|
|
3798
3806
|
2: [0, 1],
|
|
3799
3807
|
3: [
|
|
@@ -3801,7 +3809,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3801
3809
|
3,
|
|
3802
3810
|
2
|
|
3803
3811
|
]
|
|
3804
|
-
},
|
|
3812
|
+
}, _a = {
|
|
3805
3813
|
1: [1],
|
|
3806
3814
|
2: [1, 1],
|
|
3807
3815
|
3: [
|
|
@@ -3809,17 +3817,17 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3809
3817
|
1.08,
|
|
3810
3818
|
1
|
|
3811
3819
|
]
|
|
3812
|
-
},
|
|
3813
|
-
let [n, r] =
|
|
3814
|
-
i !==
|
|
3820
|
+
}, va = ({ variant: e, images: t }) => {
|
|
3821
|
+
let [n, r] = s.useState({}), i = t.join("\n"), [a, c] = s.useState(i);
|
|
3822
|
+
i !== a && (c(i), r({}));
|
|
3815
3823
|
let l = t.slice(0, 3).map((e, t) => ({
|
|
3816
3824
|
src: e,
|
|
3817
3825
|
index: t
|
|
3818
|
-
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d =
|
|
3826
|
+
})).filter(({ index: e }) => !n[e]), u = l.length >= 3 ? 3 : l.length === 2 ? 2 : 1, d = ma[u], f = ha[u], p = ga[u], m = _a[u];
|
|
3819
3827
|
return /* @__PURE__ */ W("div", {
|
|
3820
|
-
className: Y("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden",
|
|
3828
|
+
className: Y("relative flex min-h-0 w-full flex-1 items-center justify-center overflow-hidden", pa[e]),
|
|
3821
3829
|
children: l.map(({ src: e, index: t }, n) => /* @__PURE__ */ W("img", {
|
|
3822
|
-
src:
|
|
3830
|
+
src: o(e) ?? e,
|
|
3823
3831
|
alt: "",
|
|
3824
3832
|
draggable: !1,
|
|
3825
3833
|
loading: "lazy",
|
|
@@ -3835,44 +3843,44 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3835
3843
|
}
|
|
3836
3844
|
}, `${e}-${t}`))
|
|
3837
3845
|
});
|
|
3838
|
-
},
|
|
3839
|
-
className:
|
|
3840
|
-
children: t === "fan" ? /* @__PURE__ */ W(
|
|
3846
|
+
}, ya = "flex h-[180px] w-full shrink-0 flex-col overflow-hidden", ba = ({ variant: e, presentation: t, images: n, title: r, heroUrl: i, onHeroError: a }) => /* @__PURE__ */ W("div", {
|
|
3847
|
+
className: ya,
|
|
3848
|
+
children: t === "fan" ? /* @__PURE__ */ W(va, {
|
|
3841
3849
|
variant: e,
|
|
3842
3850
|
images: n
|
|
3843
|
-
}) : /* @__PURE__ */ W(
|
|
3851
|
+
}) : /* @__PURE__ */ W(Jt, {
|
|
3844
3852
|
variant: e,
|
|
3845
3853
|
thumbnailUrl: i,
|
|
3846
3854
|
title: r,
|
|
3847
3855
|
mimeType: "image/*",
|
|
3848
3856
|
onImageError: a
|
|
3849
3857
|
})
|
|
3850
|
-
}),
|
|
3851
|
-
let u =
|
|
3858
|
+
}), xa = ({ variant: e, title: t, subtitle: n, subtitleLines: r, images: i = [], imagePresentation: a, actions: o, appIcon: s, accentColor: c, groupPosition: l = "single" }) => {
|
|
3859
|
+
let u = Te({
|
|
3852
3860
|
imagePresentation: a,
|
|
3853
3861
|
images: i
|
|
3854
|
-
}), d = i.length > 0, f = d && u === "hero", p =
|
|
3862
|
+
}), d = i.length > 0, f = d && u === "hero", p = en({
|
|
3855
3863
|
variant: e,
|
|
3856
3864
|
accentColor: c,
|
|
3857
3865
|
layout: "featured",
|
|
3858
3866
|
thumbnailUrl: f ? i[0] : void 0
|
|
3859
3867
|
}), m = l === "single" || l === "end";
|
|
3860
|
-
return /* @__PURE__ */ W(
|
|
3868
|
+
return /* @__PURE__ */ W(an, {
|
|
3861
3869
|
accentHex: p.accentHex,
|
|
3862
3870
|
side: e === "dark" ? "sender" : "receiver",
|
|
3863
3871
|
visible: m,
|
|
3864
|
-
children: /* @__PURE__ */ G(
|
|
3872
|
+
children: /* @__PURE__ */ G(Ht, {
|
|
3865
3873
|
variant: e,
|
|
3866
3874
|
accentHex: p.accentHex,
|
|
3867
3875
|
"data-testid": "rich-card",
|
|
3868
|
-
children: [d && /* @__PURE__ */ W(
|
|
3876
|
+
children: [d && /* @__PURE__ */ W(ba, {
|
|
3869
3877
|
variant: e,
|
|
3870
3878
|
presentation: u,
|
|
3871
3879
|
images: i,
|
|
3872
3880
|
title: t,
|
|
3873
3881
|
heroUrl: f ? p.thumbnailUrl : void 0,
|
|
3874
3882
|
onHeroError: p.onImageError
|
|
3875
|
-
}), /* @__PURE__ */ W(
|
|
3883
|
+
}), /* @__PURE__ */ W(fa, {
|
|
3876
3884
|
ctaSurface: p.surface,
|
|
3877
3885
|
chinTextColor: p.chinTextColor,
|
|
3878
3886
|
title: t,
|
|
@@ -3883,19 +3891,19 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3883
3891
|
})]
|
|
3884
3892
|
})
|
|
3885
3893
|
});
|
|
3886
|
-
},
|
|
3887
|
-
Sent: (e) => /* @__PURE__ */ W(
|
|
3894
|
+
}, Sa = {
|
|
3895
|
+
Sent: (e) => /* @__PURE__ */ W(xa, {
|
|
3888
3896
|
...e,
|
|
3889
3897
|
variant: "dark"
|
|
3890
3898
|
}),
|
|
3891
|
-
Received: (e) => /* @__PURE__ */ W(
|
|
3899
|
+
Received: (e) => /* @__PURE__ */ W(xa, {
|
|
3892
3900
|
...e,
|
|
3893
3901
|
variant: "light"
|
|
3894
3902
|
})
|
|
3895
|
-
},
|
|
3903
|
+
}, Ca = "url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E\") no-repeat center / 100% 100%", wa = {
|
|
3896
3904
|
sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3897
3905
|
received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
|
|
3898
|
-
},
|
|
3906
|
+
}, Ta = ({ variant: e }) => /* @__PURE__ */ W("span", {
|
|
3899
3907
|
"aria-hidden": "true",
|
|
3900
3908
|
className: "pointer-events-none absolute bottom-0 z-[-1] h-[1.4375rem] w-5",
|
|
3901
3909
|
style: {
|
|
@@ -3903,11 +3911,11 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3903
3911
|
insetInlineStart: e === "received" ? "calc(-1 * 0.3125rem)" : void 0,
|
|
3904
3912
|
transform: e === "received" ? "scaleX(-1)" : void 0,
|
|
3905
3913
|
transformOrigin: "center",
|
|
3906
|
-
backgroundColor:
|
|
3907
|
-
WebkitMask:
|
|
3908
|
-
mask:
|
|
3914
|
+
backgroundColor: wa[e],
|
|
3915
|
+
WebkitMask: Ca,
|
|
3916
|
+
mask: Ca
|
|
3909
3917
|
}
|
|
3910
|
-
}),
|
|
3918
|
+
}), Ea = {
|
|
3911
3919
|
sent: {
|
|
3912
3920
|
backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
|
|
3913
3921
|
color: "var(--str-chat__own-message-bubble-color, #fff)"
|
|
@@ -3916,11 +3924,11 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3916
3924
|
backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
|
|
3917
3925
|
color: "var(--str-chat__message-bubble-color, #000000)"
|
|
3918
3926
|
}
|
|
3919
|
-
},
|
|
3927
|
+
}, Da = ({ variant: e, text: t, tail: n = !0, header: r, className: i }) => /* @__PURE__ */ G("div", {
|
|
3920
3928
|
"data-dd-privacy": "mask",
|
|
3921
3929
|
className: Y("relative px-4 py-3", "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]", i),
|
|
3922
3930
|
style: {
|
|
3923
|
-
...
|
|
3931
|
+
...Ea[e],
|
|
3924
3932
|
borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
|
|
3925
3933
|
isolation: "isolate"
|
|
3926
3934
|
},
|
|
@@ -3934,23 +3942,23 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3934
3942
|
className: "m-0 whitespace-pre-wrap break-words hyphens-manual",
|
|
3935
3943
|
children: t
|
|
3936
3944
|
}),
|
|
3937
|
-
n && /* @__PURE__ */ W(
|
|
3945
|
+
n && /* @__PURE__ */ W(Ta, { variant: e })
|
|
3938
3946
|
]
|
|
3939
|
-
}),
|
|
3940
|
-
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ W(
|
|
3947
|
+
}), Oa = {
|
|
3948
|
+
Sent: ({ text: e, tail: t, className: n }) => /* @__PURE__ */ W(Da, {
|
|
3941
3949
|
variant: "sent",
|
|
3942
3950
|
text: e,
|
|
3943
3951
|
tail: t,
|
|
3944
3952
|
className: n
|
|
3945
3953
|
}),
|
|
3946
|
-
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ W(
|
|
3954
|
+
Received: ({ text: e, tail: t, header: n, className: r }) => /* @__PURE__ */ W(Da, {
|
|
3947
3955
|
variant: "received",
|
|
3948
3956
|
text: e,
|
|
3949
3957
|
tail: t,
|
|
3950
3958
|
header: n,
|
|
3951
3959
|
className: r
|
|
3952
3960
|
})
|
|
3953
|
-
},
|
|
3961
|
+
}, ka = ({ question: e, onClick: t, loading: n = !1, className: r }) => /* @__PURE__ */ W("button", {
|
|
3954
3962
|
type: "button",
|
|
3955
3963
|
onClick: t,
|
|
3956
3964
|
disabled: n,
|
|
@@ -3960,15 +3968,15 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3960
3968
|
"opacity-50 cursor-not-allowed": n
|
|
3961
3969
|
}, r),
|
|
3962
3970
|
children: e
|
|
3963
|
-
}),
|
|
3964
|
-
let s =
|
|
3971
|
+
}), Aa = ({ faqs: e, onFaqClick: t, loadingFaqId: n, headerText: r, className: i, avatarImage: a, avatarName: o }) => {
|
|
3972
|
+
let s = Ee(e);
|
|
3965
3973
|
return s.length === 0 ? null : /* @__PURE__ */ W("div", {
|
|
3966
3974
|
className: i,
|
|
3967
3975
|
children: /* @__PURE__ */ G("div", {
|
|
3968
3976
|
className: "flex gap-3 items-end",
|
|
3969
3977
|
children: [(a || o) && /* @__PURE__ */ W("div", {
|
|
3970
3978
|
className: "flex-none",
|
|
3971
|
-
children: /* @__PURE__ */ W(
|
|
3979
|
+
children: /* @__PURE__ */ W(_t, {
|
|
3972
3980
|
id: o || "account",
|
|
3973
3981
|
name: o || "Account",
|
|
3974
3982
|
image: a,
|
|
@@ -3982,7 +3990,7 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3982
3990
|
"data-testid": "faq-list-header",
|
|
3983
3991
|
className: "text-md text-charcoal mb-4",
|
|
3984
3992
|
children: r
|
|
3985
|
-
}), s.map((e) => /* @__PURE__ */ W(
|
|
3993
|
+
}), s.map((e) => /* @__PURE__ */ W(ka, {
|
|
3986
3994
|
question: e.question,
|
|
3987
3995
|
onClick: () => t(e.id),
|
|
3988
3996
|
loading: n === e.id
|
|
@@ -3992,6 +4000,6 @@ var oa = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.02em]", sa
|
|
|
3992
4000
|
});
|
|
3993
4001
|
};
|
|
3994
4002
|
//#endregion
|
|
3995
|
-
export {
|
|
4003
|
+
export { bt as ActionButton, _t as Avatar, Gi as ChannelEmptyState, oa as ChannelList, Yi as ChannelView, un as CustomMessageProvider, Aa as FaqList, ka as FaqListItem, on as LinkAttachment, hn as LockedAttachment, ei as MessageAttachment, Oa as MessageBubble, et as MessagingLoggerProvider, it as MessagingProvider, Zi as MessagingShell, Sa as RichCard, Nn as TipMessage, nr as buildCompactMetaLabel, $n as formatFileSize, ra as formatRelativeTime, tr as getFileExtensionLabel, Ot as getMessageDisplayText, sn as isLinkAttachment, Mn as isTipMessage, lt as isUuidLike, Jn as messageAttachmentGroupPositionFromStream, Dt as normalizeLanguageCode, o as optimizeMessagingAttachmentUrl, st as resolveConversationParticipant, dt as resolveParticipantDisplayName, wi as useComposerLocked, dn as useCustomMessage, at as useMessaging, tt as useMessagingLogger };
|
|
3996
4004
|
|
|
3997
4005
|
//# sourceMappingURL=index.js.map
|