@linktr.ee/messaging-react 1.32.1 → 1.33.0-rc-1777272812
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Card-1CQEn-OT.js → Card-DEe10CiS.js} +2 -2
- package/dist/{Card-1CQEn-OT.js.map → Card-DEe10CiS.js.map} +1 -1
- package/dist/{Card-ClE_iExA.js → Card-Ddi8bg90.js} +2 -2
- package/dist/{Card-ClE_iExA.js.map → Card-Ddi8bg90.js.map} +1 -1
- package/dist/index-BePLvyvi.js +2868 -0
- package/dist/index-BePLvyvi.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.js +20 -2477
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.stories.tsx +38 -0
- package/src/components/ChannelView.test.tsx +25 -6
- package/src/components/ChannelView.tsx +2 -0
- package/src/components/CustomMessageInput/CustomMessageInput.stories.tsx +180 -0
- package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +63 -1
- package/src/components/CustomMessageInput/index.tsx +24 -5
- package/src/components/MediaMessage/MediaMessage.stories.tsx +170 -0
- package/src/components/MediaMessage/MediaMessage.test.tsx +261 -0
- package/src/components/MediaMessage/index.tsx +165 -0
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/index.ts +2 -0
- package/src/types.ts +13 -0
- package/dist/MediaPlayer-B9Ws2NeE.js +0 -292
- package/dist/MediaPlayer-B9Ws2NeE.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2480 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import A from "classnames";
|
|
3
|
-
import U, { createContext as Ke, useContext as Qe, useCallback as R, useState as T, useRef as Q, useEffect as Z, useMemo as Ue, Suspense as et } from "react";
|
|
4
|
-
import { StreamChatService as xt } from "@linktr.ee/messaging-core";
|
|
5
|
-
import { Chat as bt, ChannelList as Ct, DateSeparator as pt, useChannelStateContext as xe, useChatContext as tt, areMessageUIPropsEqual as Nt, useMessageReminder as yt, useComponentContext as vt, Attachment as wt, EditMessageModal as _t, MessageBlocked as Et, MessageBouncePrompt as St, MessageDeleted as It, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as kt, ReminderNotification as Tt, StreamedMessageText as Dt, messageHasAttachments as Rt, messageHasReactions as At, isDateSeparatorMessage as Lt, isMessageBlocked as Pt, isMessageBounced as Ut, MessageBounceModal as Ft, MessageText as ze, Poll as Ot, MessageErrorIcon as Bt, useMessageContext as st, useMessageComposer as Gt, useStateStore as $t, MessageInput as jt, useMessageInputContext as zt, useMessageComposerHasSendableData as Vt, SimpleAttachmentSelector as Ht, QuotedMessagePreview as Yt, AttachmentPreviewList as Wt, TextareaComposer as qt, MessageTimestamp as Ae, Channel as Zt, WithComponents as Jt, Window as Xt, MessageList as Kt } from "stream-chat-react";
|
|
6
|
-
import { StarIcon as Fe, GiftIcon as Qt, XIcon as Ge, SpinnerGapIcon as Se, SignOutIcon as es, ProhibitInsetIcon as Ve, FlagIcon as ts, ArrowUpIcon as ss, SparkleIcon as ns, ProhibitIcon as as, ArrowLeftIcon as He, DotsThreeIcon as Ye, MagnifyingGlassIcon as rs, ChatCircleDotsIcon as We } from "@phosphor-icons/react";
|
|
7
|
-
import { LinkPreviewsManager as qe } from "stream-chat";
|
|
8
|
-
const nt = Ke({
|
|
9
|
-
service: null,
|
|
10
|
-
client: null,
|
|
11
|
-
isConnected: !1,
|
|
12
|
-
isLoading: !1,
|
|
13
|
-
error: null,
|
|
14
|
-
capabilities: {},
|
|
15
|
-
refreshConnection: async () => {
|
|
16
|
-
},
|
|
17
|
-
debug: !1
|
|
18
|
-
}), ke = () => Qe(nt), hn = ({
|
|
19
|
-
children: t,
|
|
20
|
-
user: s,
|
|
21
|
-
serviceConfig: n,
|
|
22
|
-
apiKey: o,
|
|
23
|
-
capabilities: l = {},
|
|
24
|
-
debug: m = !1
|
|
25
|
-
}) => {
|
|
26
|
-
const r = R(
|
|
27
|
-
(d, ...C) => {
|
|
28
|
-
m && console.log(`🔥 [MessagingProvider] ${d}`, ...C);
|
|
29
|
-
},
|
|
30
|
-
[m]
|
|
31
|
-
);
|
|
32
|
-
r("🔄 RENDER START", {
|
|
33
|
-
userId: s == null ? void 0 : s.id,
|
|
34
|
-
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
35
|
-
serviceConfig: !!n,
|
|
36
|
-
capabilities: Object.keys(l)
|
|
37
|
-
});
|
|
38
|
-
const [c, h] = T(null), [u, b] = T(null), [g, v] = T(!1), [a, w] = T(!1), [N, x] = T(null), M = Q(!1), k = Q({
|
|
39
|
-
userId: s == null ? void 0 : s.id,
|
|
40
|
-
apiKey: o,
|
|
41
|
-
serviceConfig: n,
|
|
42
|
-
capabilities: l
|
|
43
|
-
}), S = Q(0);
|
|
44
|
-
S.current++, r("📊 RENDER INFO", {
|
|
45
|
-
renderCount: S.current,
|
|
46
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
|
-
propChanges: {
|
|
48
|
-
userChanged: k.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
-
apiKeyChanged: k.current.apiKey !== o,
|
|
50
|
-
serviceConfigChanged: k.current.serviceConfig !== n,
|
|
51
|
-
capabilitiesChanged: k.current.capabilities !== l
|
|
52
|
-
}
|
|
53
|
-
}), k.current = {
|
|
54
|
-
userId: s == null ? void 0 : s.id,
|
|
55
|
-
apiKey: o,
|
|
56
|
-
serviceConfig: n,
|
|
57
|
-
capabilities: l
|
|
58
|
-
}, Z(() => {
|
|
59
|
-
const d = S.current;
|
|
60
|
-
if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount: d,
|
|
62
|
-
apiKey: !!o,
|
|
63
|
-
serviceConfig: !!n,
|
|
64
|
-
dependencies: {
|
|
65
|
-
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
66
|
-
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable: k.current.serviceConfig === n,
|
|
68
|
-
apiKeyStable: k.current.apiKey === o
|
|
69
|
-
}
|
|
70
|
-
}), !o || !n) {
|
|
71
|
-
r("⚠️ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount: d,
|
|
73
|
-
reason: "Missing apiKey or serviceConfig"
|
|
74
|
-
});
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
r("🚀 CREATING NEW SERVICE", {
|
|
78
|
-
renderCount: d,
|
|
79
|
-
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged: k.current.serviceConfig !== n
|
|
81
|
-
});
|
|
82
|
-
const C = new xt({
|
|
83
|
-
...n,
|
|
84
|
-
apiKey: o,
|
|
85
|
-
debug: m
|
|
86
|
-
});
|
|
87
|
-
return h(C), r("✅ SERVICE SET", {
|
|
88
|
-
renderCount: d,
|
|
89
|
-
serviceInstance: !!C
|
|
90
|
-
}), () => {
|
|
91
|
-
r("🧹 SERVICE CLEANUP", {
|
|
92
|
-
renderCount: d,
|
|
93
|
-
reason: "Effect cleanup"
|
|
94
|
-
}), C.disconnectUser().catch(console.error);
|
|
95
|
-
};
|
|
96
|
-
}, [o, n, m, r]);
|
|
97
|
-
const I = Q(null);
|
|
98
|
-
Z(() => {
|
|
99
|
-
var C, _;
|
|
100
|
-
if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
|
-
hasService: !!c,
|
|
102
|
-
hasUser: !!s,
|
|
103
|
-
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting: M.current,
|
|
105
|
-
isConnected: g,
|
|
106
|
-
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
|
-
}), !c || !s) {
|
|
108
|
-
r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (M.current) {
|
|
112
|
-
r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (((C = I.current) == null ? void 0 : C.serviceId) === c && ((_ = I.current) == null ? void 0 : _.userId) === s.id) {
|
|
116
|
-
r(
|
|
117
|
-
"⚠️ USER CONNECTION SKIPPED",
|
|
118
|
-
"Already connected this user with this service"
|
|
119
|
-
);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
(async () => {
|
|
123
|
-
r("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, w(!0), x(null);
|
|
124
|
-
try {
|
|
125
|
-
r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const y = await c.connectUser(s);
|
|
127
|
-
b(y), v(!0), I.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
|
|
128
|
-
userId: s.id,
|
|
129
|
-
clientId: y.userID
|
|
130
|
-
});
|
|
131
|
-
} catch (y) {
|
|
132
|
-
const p = y instanceof Error ? y.message : "Connection failed";
|
|
133
|
-
x(p), r("❌ USER CONNECTION ERROR", {
|
|
134
|
-
userId: s.id,
|
|
135
|
-
error: p
|
|
136
|
-
});
|
|
137
|
-
} finally {
|
|
138
|
-
w(!1), M.current = !1, r("🔄 USER CONNECTION FINISHED", {
|
|
139
|
-
userId: s.id,
|
|
140
|
-
isConnected: g
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
})();
|
|
144
|
-
}, [c, s, r, g]), Z(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
|
-
hasService: !!c,
|
|
146
|
-
isConnected: g
|
|
147
|
-
}), () => {
|
|
148
|
-
c && g ? (r(
|
|
149
|
-
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
150
|
-
"Cleaning up connection on unmount"
|
|
151
|
-
), I.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
|
|
152
|
-
hasService: !!c,
|
|
153
|
-
isConnected: g
|
|
154
|
-
});
|
|
155
|
-
}), [c, g, r]);
|
|
156
|
-
const D = R(async () => {
|
|
157
|
-
if (r("🔄 REFRESH CONNECTION CALLED", {
|
|
158
|
-
hasService: !!c,
|
|
159
|
-
hasUser: !!s
|
|
160
|
-
}), !c || !s) {
|
|
161
|
-
r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
|
|
165
|
-
try {
|
|
166
|
-
r("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
|
|
167
|
-
const d = await c.connectUser(s);
|
|
168
|
-
b(d), v(!0), x(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
-
} catch (d) {
|
|
170
|
-
const C = d instanceof Error ? d.message : "Refresh failed";
|
|
171
|
-
x(C), r("❌ CONNECTION REFRESH ERROR", {
|
|
172
|
-
userId: s.id,
|
|
173
|
-
error: C
|
|
174
|
-
});
|
|
175
|
-
} finally {
|
|
176
|
-
w(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
|
-
}
|
|
178
|
-
}, [c, s, r]), f = U.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
|
-
hasService: !!c,
|
|
180
|
-
hasClient: !!u,
|
|
181
|
-
isConnected: g,
|
|
182
|
-
isLoading: a,
|
|
183
|
-
hasError: !!N,
|
|
184
|
-
capabilitiesKeys: Object.keys(l)
|
|
185
|
-
}), {
|
|
186
|
-
service: c,
|
|
187
|
-
client: u,
|
|
188
|
-
isConnected: g,
|
|
189
|
-
isLoading: a,
|
|
190
|
-
error: N,
|
|
191
|
-
capabilities: l,
|
|
192
|
-
refreshConnection: D,
|
|
193
|
-
debug: m
|
|
194
|
-
}), [
|
|
195
|
-
c,
|
|
196
|
-
u,
|
|
197
|
-
g,
|
|
198
|
-
a,
|
|
199
|
-
N,
|
|
200
|
-
l,
|
|
201
|
-
D,
|
|
202
|
-
m,
|
|
203
|
-
r
|
|
204
|
-
]);
|
|
205
|
-
return r("🔄 RENDER END", {
|
|
206
|
-
renderCount: S.current,
|
|
207
|
-
willRenderChat: !!(u && g),
|
|
208
|
-
contextValueReady: !!f
|
|
209
|
-
}), /* @__PURE__ */ e(nt.Provider, { value: f, children: u && g ? /* @__PURE__ */ e(
|
|
210
|
-
bt,
|
|
211
|
-
{
|
|
212
|
-
client: u,
|
|
213
|
-
customClasses: {
|
|
214
|
-
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
|
-
},
|
|
216
|
-
children: t
|
|
217
|
-
}
|
|
218
|
-
) : t });
|
|
219
|
-
}, os = () => ke();
|
|
220
|
-
function ls(t) {
|
|
221
|
-
const s = t.state.pending_messages;
|
|
222
|
-
if (s != null && s.length)
|
|
223
|
-
for (const n of s)
|
|
224
|
-
t.state.addMessageSorted(n.message);
|
|
225
|
-
}
|
|
226
|
-
const at = U.createContext({
|
|
227
|
-
selectedChannel: void 0,
|
|
228
|
-
onChannelSelect: () => {
|
|
229
|
-
},
|
|
230
|
-
debug: !1,
|
|
231
|
-
renderMessagePreview: void 0
|
|
232
|
-
}), is = at.Provider, cs = () => U.useContext(at), rt = (t) => {
|
|
233
|
-
var o, l;
|
|
234
|
-
const [s, n] = T(
|
|
235
|
-
!!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
|
|
236
|
-
);
|
|
237
|
-
return Z(() => {
|
|
238
|
-
var r;
|
|
239
|
-
if (!t) {
|
|
240
|
-
n(!1);
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
n(!!((r = t.state.membership) != null && r.pinned_at));
|
|
244
|
-
const m = (c) => {
|
|
245
|
-
var h;
|
|
246
|
-
n(
|
|
247
|
-
c != null && c.member ? !!c.member.pinned_at : !!((h = t.state.membership) != null && h.pinned_at)
|
|
248
|
-
);
|
|
249
|
-
};
|
|
250
|
-
return t.on("member.updated", m), () => {
|
|
251
|
-
t.off("member.updated", m);
|
|
252
|
-
};
|
|
253
|
-
}, [t]), s;
|
|
254
|
-
}, ds = (t, s) => {
|
|
255
|
-
const n = new Date(
|
|
256
|
-
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
257
|
-
), l = new Date(
|
|
258
|
-
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
259
|
-
).getTime() - n.getTime();
|
|
260
|
-
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
261
|
-
}, ms = (t) => {
|
|
262
|
-
const s = /* @__PURE__ */ new Date();
|
|
263
|
-
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
264
|
-
return "Just now";
|
|
265
|
-
const o = ds(t, s);
|
|
266
|
-
return o === 0 ? t.toLocaleTimeString([], {
|
|
267
|
-
hour: "numeric",
|
|
268
|
-
minute: "2-digit",
|
|
269
|
-
hour12: !0
|
|
270
|
-
}) : o === 1 ? "Yesterday" : o < 7 ? `${o}d` : o < 28 ? `${Math.floor(o / 7)}w` : t.toLocaleDateString("en-US", {
|
|
271
|
-
month: "numeric",
|
|
272
|
-
day: "numeric",
|
|
273
|
-
year: "2-digit"
|
|
274
|
-
});
|
|
275
|
-
}, Ze = [
|
|
276
|
-
"🍎",
|
|
277
|
-
// Apple
|
|
278
|
-
"🍌",
|
|
279
|
-
// Banana
|
|
280
|
-
"🍇",
|
|
281
|
-
// Grape
|
|
282
|
-
"🍊",
|
|
283
|
-
// Orange
|
|
284
|
-
"🍓",
|
|
285
|
-
// Strawberry
|
|
286
|
-
"🥥",
|
|
287
|
-
// Coconut
|
|
288
|
-
"🍒",
|
|
289
|
-
// Cherry
|
|
290
|
-
"🥭",
|
|
291
|
-
// Mango
|
|
292
|
-
"🍉",
|
|
293
|
-
// Watermelon
|
|
294
|
-
"🍋",
|
|
295
|
-
// Lemon
|
|
296
|
-
"🥝",
|
|
297
|
-
// Kiwi
|
|
298
|
-
"🫒",
|
|
299
|
-
// Olive
|
|
300
|
-
"🍈"
|
|
301
|
-
// Melon
|
|
302
|
-
];
|
|
303
|
-
function us(t) {
|
|
304
|
-
let s = 0;
|
|
305
|
-
for (let n = 0; n < t.length; n++) {
|
|
306
|
-
const o = t.charCodeAt(n);
|
|
307
|
-
s = (s << 5) - s + o, s = s & s;
|
|
308
|
-
}
|
|
309
|
-
return Math.abs(s);
|
|
310
|
-
}
|
|
311
|
-
function hs(t) {
|
|
312
|
-
const n = us(t) % Ze.length;
|
|
313
|
-
return Ze[n];
|
|
314
|
-
}
|
|
315
|
-
const ce = ({
|
|
316
|
-
id: t,
|
|
317
|
-
image: s,
|
|
318
|
-
size: n = 40,
|
|
319
|
-
className: o,
|
|
320
|
-
starred: l = !1,
|
|
321
|
-
shape: m = "squircle"
|
|
322
|
-
}) => {
|
|
323
|
-
const r = hs(t), h = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", u = m === "circle" ? { borderRadius: "50%" } : {
|
|
324
|
-
borderRadius: "33%",
|
|
325
|
-
"corner-shape": "superellipse(1.3)"
|
|
326
|
-
};
|
|
327
|
-
return /* @__PURE__ */ i(
|
|
328
|
-
"div",
|
|
329
|
-
{
|
|
330
|
-
className: A("relative flex-shrink-0", o),
|
|
331
|
-
style: {
|
|
332
|
-
width: `${n}px`,
|
|
333
|
-
height: `${n}px`
|
|
334
|
-
},
|
|
335
|
-
children: [
|
|
336
|
-
l && /* @__PURE__ */ e(
|
|
337
|
-
"div",
|
|
338
|
-
{
|
|
339
|
-
"aria-hidden": "true",
|
|
340
|
-
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)]",
|
|
341
|
-
children: /* @__PURE__ */ e(Fe, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
342
|
-
}
|
|
343
|
-
),
|
|
344
|
-
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: u, children: s ? /* @__PURE__ */ e(
|
|
345
|
-
"img",
|
|
346
|
-
{
|
|
347
|
-
src: s,
|
|
348
|
-
alt: "",
|
|
349
|
-
className: "aspect-square h-full w-full object-cover"
|
|
350
|
-
}
|
|
351
|
-
) : /* @__PURE__ */ e(
|
|
352
|
-
"div",
|
|
353
|
-
{
|
|
354
|
-
"aria-hidden": "true",
|
|
355
|
-
className: A(
|
|
356
|
-
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
357
|
-
h
|
|
358
|
-
),
|
|
359
|
-
children: r
|
|
360
|
-
}
|
|
361
|
-
) })
|
|
362
|
-
]
|
|
363
|
-
}
|
|
364
|
-
);
|
|
365
|
-
}, fs = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
366
|
-
"svg",
|
|
367
|
-
{
|
|
368
|
-
width: t,
|
|
369
|
-
height: t,
|
|
370
|
-
viewBox: "0 0 15 15",
|
|
371
|
-
fill: "none",
|
|
372
|
-
"aria-hidden": "true",
|
|
373
|
-
children: /* @__PURE__ */ e(
|
|
374
|
-
"path",
|
|
375
|
-
{
|
|
376
|
-
d: "M12.003 9a.985.985 0 0 1-.652.934l-3.223 1.191-1.188 3.226a.995.995 0 0 1-1.867 0l-1.195-3.226L.65 9.937a.995.995 0 0 1 0-1.867l3.227-1.195 1.187-3.226a.995.995 0 0 1 1.868 0l1.195 3.226 3.226 1.187a.99.99 0 0 1 .649.938m3-5.83a.52.52 0 0 1-.344.492l-1.702.63-.627 1.703a.525.525 0 0 1-.986 0l-.63-1.704-1.704-.627a.525.525 0 0 1 0-.986l1.703-.63.627-1.704a.526.526 0 0 1 .986 0l.631 1.703 1.704.627a.52.52 0 0 1 .342.495",
|
|
377
|
-
fill: "currentColor",
|
|
378
|
-
fillOpacity: 0.55
|
|
379
|
-
}
|
|
380
|
-
)
|
|
381
|
-
}
|
|
382
|
-
), gs = (t) => {
|
|
383
|
-
var s;
|
|
384
|
-
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
385
|
-
}, xs = (t) => {
|
|
386
|
-
var s;
|
|
387
|
-
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
388
|
-
}, $e = (t) => {
|
|
389
|
-
var s;
|
|
390
|
-
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
391
|
-
}, bs = (t) => {
|
|
392
|
-
var s;
|
|
393
|
-
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
|
|
394
|
-
}, ot = (t) => gs(t) || xs(t), Cs = (t) => {
|
|
395
|
-
var s;
|
|
396
|
-
return ot(t) && !((s = t.text) != null && s.trim());
|
|
397
|
-
}, Le = ({
|
|
398
|
-
message: t,
|
|
399
|
-
standalone: s = !1,
|
|
400
|
-
isMyMessage: n = !1,
|
|
401
|
-
hasAttachment: o = !1
|
|
402
|
-
}) => {
|
|
403
|
-
var g;
|
|
404
|
-
const l = ot(t), m = $e(t);
|
|
405
|
-
if (!l && !m)
|
|
406
|
-
return null;
|
|
407
|
-
if (l) {
|
|
408
|
-
const v = (g = t.metadata) == null ? void 0 : g.amount_text;
|
|
409
|
-
if (!v) return null;
|
|
410
|
-
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", w = s ? `${v} tip` : `Delivered with ${v} tip`;
|
|
411
|
-
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
412
|
-
/* @__PURE__ */ e(Qt, { size: s ? 14 : 12 }),
|
|
413
|
-
/* @__PURE__ */ e("span", { children: w })
|
|
414
|
-
] });
|
|
415
|
-
}
|
|
416
|
-
const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent", h = [
|
|
417
|
-
"message-chatbot-indicator",
|
|
418
|
-
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
419
|
-
r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
420
|
-
].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(fs, { size: r ? 12 : 15 }) });
|
|
421
|
-
return /* @__PURE__ */ e("div", { className: h, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ i(ge, { children: [
|
|
422
|
-
u,
|
|
423
|
-
b
|
|
424
|
-
] }) : /* @__PURE__ */ i(ge, { children: [
|
|
425
|
-
b,
|
|
426
|
-
u
|
|
427
|
-
] }) });
|
|
428
|
-
}, lt = U.memo(
|
|
429
|
-
({ channel: t, unread: s }) => {
|
|
430
|
-
var D, f, d, C;
|
|
431
|
-
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } = cs(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
432
|
-
t && o(t);
|
|
433
|
-
}, h = (_) => {
|
|
434
|
-
const y = _.key === "Enter" || _.key === " ", p = _.repeat;
|
|
435
|
-
!y || p || (_.preventDefault(), c());
|
|
436
|
-
}, b = Object.values(((D = t == null ? void 0 : t.state) == null ? void 0 : D.members) || {}).find(
|
|
437
|
-
(_) => {
|
|
438
|
-
var y, p;
|
|
439
|
-
return ((y = _.user) == null ? void 0 : y.id) && _.user.id !== ((p = t == null ? void 0 : t._client) == null ? void 0 : p.userID);
|
|
440
|
-
}
|
|
441
|
-
), g = ((f = b == null ? void 0 : b.user) == null ? void 0 : f.name) || "Conversation", v = (d = b == null ? void 0 : b.user) == null ? void 0 : d.image, a = (() => {
|
|
442
|
-
var y;
|
|
443
|
-
const _ = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
|
|
444
|
-
if (_ != null && _.length) {
|
|
445
|
-
for (let p = _.length - 1; p >= 0; p--)
|
|
446
|
-
if (_[p].type !== "system") return _[p];
|
|
447
|
-
}
|
|
448
|
-
})(), N = (() => {
|
|
449
|
-
var p, F;
|
|
450
|
-
if (a != null && a.text) return a.text;
|
|
451
|
-
if (((p = a == null ? void 0 : a.metadata) == null ? void 0 : p.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
452
|
-
const y = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
|
|
453
|
-
return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
454
|
-
})(), x = a != null && a.created_at ? ms(new Date(a.created_at)) : "", M = a ? $e(a) : !1, k = m ? m(a, N) : `${M ? "✨ " : ""}${N}`, S = rt(t), I = s ?? 0;
|
|
455
|
-
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
456
|
-
channelId: t == null ? void 0 : t.id,
|
|
457
|
-
isSelected: r,
|
|
458
|
-
participantName: g,
|
|
459
|
-
unreadCount: I,
|
|
460
|
-
hasTimestamp: !!x
|
|
461
|
-
}), /* @__PURE__ */ e(
|
|
462
|
-
"div",
|
|
463
|
-
{
|
|
464
|
-
role: "button",
|
|
465
|
-
tabIndex: 0,
|
|
466
|
-
onClick: c,
|
|
467
|
-
onKeyDown: h,
|
|
468
|
-
className: A(
|
|
469
|
-
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
470
|
-
{
|
|
471
|
-
"bg-primary-alt/10 border-l-4 border-l-primary": r,
|
|
472
|
-
"hover:bg-sand": !r
|
|
473
|
-
}
|
|
474
|
-
),
|
|
475
|
-
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
476
|
-
/* @__PURE__ */ e(
|
|
477
|
-
ce,
|
|
478
|
-
{
|
|
479
|
-
id: ((C = b == null ? void 0 : b.user) == null ? void 0 : C.id) || t.id || "unknown",
|
|
480
|
-
name: g,
|
|
481
|
-
image: v,
|
|
482
|
-
size: 44,
|
|
483
|
-
starred: S,
|
|
484
|
-
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
485
|
-
}
|
|
486
|
-
),
|
|
487
|
-
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
488
|
-
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
|
|
489
|
-
/* @__PURE__ */ i(
|
|
490
|
-
"h3",
|
|
491
|
-
{
|
|
492
|
-
className: A(
|
|
493
|
-
"text-sm font-medium truncate",
|
|
494
|
-
r ? "text-primary" : "text-charcoal"
|
|
495
|
-
),
|
|
496
|
-
children: [
|
|
497
|
-
S && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
498
|
-
g
|
|
499
|
-
]
|
|
500
|
-
}
|
|
501
|
-
),
|
|
502
|
-
x && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: x })
|
|
503
|
-
] }),
|
|
504
|
-
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
505
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: k }),
|
|
506
|
-
I > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: I > 99 ? "99+" : I })
|
|
507
|
-
] })
|
|
508
|
-
] })
|
|
509
|
-
] })
|
|
510
|
-
}
|
|
511
|
-
);
|
|
512
|
-
}
|
|
513
|
-
);
|
|
514
|
-
lt.displayName = "CustomChannelPreview";
|
|
515
|
-
const ps = { last_message_at: -1 }, it = U.memo(
|
|
516
|
-
({
|
|
517
|
-
onChannelSelect: t,
|
|
518
|
-
selectedChannel: s,
|
|
519
|
-
filters: n,
|
|
520
|
-
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
521
|
-
onMessageNew: l,
|
|
522
|
-
onAddedToChannel: m,
|
|
523
|
-
channelRenderFilterFn: r,
|
|
524
|
-
sort: c = ps,
|
|
525
|
-
className: h,
|
|
526
|
-
customEmptyStateIndicator: u,
|
|
527
|
-
renderMessagePreview: b
|
|
528
|
-
}) => {
|
|
529
|
-
const g = U.useRef(0);
|
|
530
|
-
g.current++;
|
|
531
|
-
const { debug: v = !1 } = ke(), a = U.useCallback(
|
|
532
|
-
(N) => {
|
|
533
|
-
for (const x of N)
|
|
534
|
-
ls(x);
|
|
535
|
-
return r ? r(N) : N;
|
|
536
|
-
},
|
|
537
|
-
[r]
|
|
538
|
-
);
|
|
539
|
-
v && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
540
|
-
renderCount: g.current,
|
|
541
|
-
selectedChannelId: s == null ? void 0 : s.id,
|
|
542
|
-
filters: n
|
|
543
|
-
});
|
|
544
|
-
const w = U.useMemo(
|
|
545
|
-
() => ({
|
|
546
|
-
selectedChannel: s,
|
|
547
|
-
onChannelSelect: t,
|
|
548
|
-
debug: v,
|
|
549
|
-
renderMessagePreview: b
|
|
550
|
-
}),
|
|
551
|
-
[s, t, v, b]
|
|
552
|
-
);
|
|
553
|
-
return /* @__PURE__ */ e(
|
|
554
|
-
"div",
|
|
555
|
-
{
|
|
556
|
-
className: A(
|
|
557
|
-
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
558
|
-
h
|
|
559
|
-
),
|
|
560
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(is, { value: w, children: /* @__PURE__ */ e(
|
|
561
|
-
Ct,
|
|
562
|
-
{
|
|
563
|
-
filters: n,
|
|
564
|
-
sort: c,
|
|
565
|
-
options: { limit: 30 },
|
|
566
|
-
allowNewMessagesFromUnfilteredChannels: o,
|
|
567
|
-
onMessageNew: l,
|
|
568
|
-
onAddedToChannel: m,
|
|
569
|
-
channelRenderFilterFn: a,
|
|
570
|
-
Preview: lt,
|
|
571
|
-
EmptyStateIndicator: u
|
|
572
|
-
},
|
|
573
|
-
`${JSON.stringify(n)}:${JSON.stringify(c)}`
|
|
574
|
-
) }) })
|
|
575
|
-
}
|
|
576
|
-
);
|
|
577
|
-
}
|
|
578
|
-
);
|
|
579
|
-
it.displayName = "ChannelList";
|
|
580
|
-
const Ee = ({
|
|
581
|
-
variant: t = "default",
|
|
582
|
-
className: s,
|
|
583
|
-
children: n,
|
|
584
|
-
...o
|
|
585
|
-
}) => /* @__PURE__ */ e(
|
|
586
|
-
"button",
|
|
587
|
-
{
|
|
588
|
-
type: "button",
|
|
589
|
-
className: A(
|
|
590
|
-
"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",
|
|
591
|
-
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
592
|
-
s
|
|
593
|
-
),
|
|
594
|
-
...o,
|
|
595
|
-
children: n
|
|
596
|
-
}
|
|
597
|
-
);
|
|
598
|
-
function ct({ label: t, className: s, children: n, ...o }) {
|
|
599
|
-
return /* @__PURE__ */ i(
|
|
600
|
-
"button",
|
|
601
|
-
{
|
|
602
|
-
type: "button",
|
|
603
|
-
className: A(
|
|
604
|
-
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
605
|
-
{
|
|
606
|
-
"cursor-not-allowed opacity-50": o.disabled,
|
|
607
|
-
"hover:bg-sand": !o.disabled
|
|
608
|
-
},
|
|
609
|
-
s
|
|
610
|
-
),
|
|
611
|
-
...o,
|
|
612
|
-
children: [
|
|
613
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: t }),
|
|
614
|
-
n
|
|
615
|
-
]
|
|
616
|
-
}
|
|
617
|
-
);
|
|
618
|
-
}
|
|
619
|
-
function dt({ onClick: t }) {
|
|
620
|
-
return /* @__PURE__ */ e(ct, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Ge, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
621
|
-
}
|
|
622
|
-
const Ns = ({
|
|
623
|
-
dialogRef: t,
|
|
624
|
-
onClose: s,
|
|
625
|
-
participant: n,
|
|
626
|
-
channel: o,
|
|
627
|
-
followerStatusLabel: l,
|
|
628
|
-
onLeaveConversation: m,
|
|
629
|
-
onBlockParticipant: r,
|
|
630
|
-
showDeleteConversation: c = !0,
|
|
631
|
-
onDeleteConversationClick: h,
|
|
632
|
-
onBlockParticipantClick: u,
|
|
633
|
-
onReportParticipantClick: b,
|
|
634
|
-
customProfileContent: g,
|
|
635
|
-
customChannelActions: v
|
|
636
|
-
}) => {
|
|
637
|
-
var L, W, z, de, me, te, ue;
|
|
638
|
-
const { service: a, debug: w } = ke(), [N, x] = T(!1), [M, k] = T(!1), [S, I] = T(!1), D = R(async () => {
|
|
639
|
-
var G;
|
|
640
|
-
if (!(!a || !((G = n == null ? void 0 : n.user) != null && G.id)))
|
|
641
|
-
try {
|
|
642
|
-
const B = (await a.getBlockedUsers()).some(
|
|
643
|
-
(q) => {
|
|
644
|
-
var se;
|
|
645
|
-
return q.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
|
|
646
|
-
}
|
|
647
|
-
);
|
|
648
|
-
x(B);
|
|
649
|
-
} catch (O) {
|
|
650
|
-
console.error(
|
|
651
|
-
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
652
|
-
O
|
|
653
|
-
);
|
|
654
|
-
}
|
|
655
|
-
}, [a, (L = n == null ? void 0 : n.user) == null ? void 0 : L.id]);
|
|
656
|
-
Z(() => {
|
|
657
|
-
D();
|
|
658
|
-
}, [D]);
|
|
659
|
-
const f = async () => {
|
|
660
|
-
var G;
|
|
661
|
-
if (!M) {
|
|
662
|
-
h == null || h(), w && console.log("[ChannelInfoDialog] Leave conversation", o.cid), k(!0);
|
|
663
|
-
try {
|
|
664
|
-
const O = ((G = o._client) == null ? void 0 : G.userID) ?? null;
|
|
665
|
-
await o.hide(O, !1), m && await m(o), s();
|
|
666
|
-
} catch (O) {
|
|
667
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation", O);
|
|
668
|
-
} finally {
|
|
669
|
-
k(!1);
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
}, d = async () => {
|
|
673
|
-
var G, O, B;
|
|
674
|
-
if (!(S || !a)) {
|
|
675
|
-
u == null || u(), w && console.log("[ChannelInfoDialog] Block member", (G = n == null ? void 0 : n.user) == null ? void 0 : G.id), I(!0);
|
|
676
|
-
try {
|
|
677
|
-
await a.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
|
|
678
|
-
} catch (q) {
|
|
679
|
-
console.error("[ChannelInfoDialog] Failed to block member", q);
|
|
680
|
-
} finally {
|
|
681
|
-
I(!1);
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
}, C = async () => {
|
|
685
|
-
var G, O, B;
|
|
686
|
-
if (!(S || !a)) {
|
|
687
|
-
u == null || u(), w && console.log("[ChannelInfoDialog] Unblock member", (G = n == null ? void 0 : n.user) == null ? void 0 : G.id), I(!0);
|
|
688
|
-
try {
|
|
689
|
-
await a.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
|
|
690
|
-
} catch (q) {
|
|
691
|
-
console.error("[ChannelInfoDialog] Failed to unblock member", q);
|
|
692
|
-
} finally {
|
|
693
|
-
I(!1);
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
}, _ = () => {
|
|
697
|
-
b == null || b(), s(), window.open(
|
|
698
|
-
"https://linktr.ee/s/about/trust-center/report",
|
|
699
|
-
"_blank",
|
|
700
|
-
"noopener,noreferrer"
|
|
701
|
-
);
|
|
702
|
-
};
|
|
703
|
-
if (!n) return null;
|
|
704
|
-
const y = ((W = n.user) == null ? void 0 : W.name) || ((z = n.user) == null ? void 0 : z.id) || "Unknown member", p = (de = n.user) == null ? void 0 : de.image, F = (me = n.user) == null ? void 0 : me.email, ee = (te = n.user) == null ? void 0 : te.username, Y = F || (ee ? `linktr.ee/${ee}` : void 0), J = ((ue = n.user) == null ? void 0 : ue.id) || "unknown";
|
|
705
|
-
return (
|
|
706
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
707
|
-
/* @__PURE__ */ e(
|
|
708
|
-
"dialog",
|
|
709
|
-
{
|
|
710
|
-
ref: t,
|
|
711
|
-
className: "mes-dialog group",
|
|
712
|
-
onClose: s,
|
|
713
|
-
onClick: (G) => {
|
|
714
|
-
G.target === t.current && s();
|
|
715
|
-
},
|
|
716
|
-
children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
717
|
-
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
718
|
-
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
719
|
-
/* @__PURE__ */ e(dt, { onClick: s })
|
|
720
|
-
] }),
|
|
721
|
-
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
722
|
-
/* @__PURE__ */ e(
|
|
723
|
-
"div",
|
|
724
|
-
{
|
|
725
|
-
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
726
|
-
style: { backgroundColor: "#FBFAF9" },
|
|
727
|
-
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
728
|
-
/* @__PURE__ */ e(
|
|
729
|
-
ce,
|
|
730
|
-
{
|
|
731
|
-
id: J,
|
|
732
|
-
name: y,
|
|
733
|
-
image: p,
|
|
734
|
-
size: 88,
|
|
735
|
-
shape: "circle"
|
|
736
|
-
}
|
|
737
|
-
),
|
|
738
|
-
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
739
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
|
|
740
|
-
Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
|
|
741
|
-
l && !g && /* @__PURE__ */ e(
|
|
742
|
-
"span",
|
|
743
|
-
{
|
|
744
|
-
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
745
|
-
style: {
|
|
746
|
-
padding: "4px 8px",
|
|
747
|
-
backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
748
|
-
color: l === "Subscribed to you" ? "#008236" : "#78716C",
|
|
749
|
-
lineHeight: "133.333%",
|
|
750
|
-
letterSpacing: "0.21px"
|
|
751
|
-
},
|
|
752
|
-
children: l
|
|
753
|
-
}
|
|
754
|
-
),
|
|
755
|
-
g
|
|
756
|
-
] })
|
|
757
|
-
] })
|
|
758
|
-
}
|
|
759
|
-
),
|
|
760
|
-
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
761
|
-
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
762
|
-
Ee,
|
|
763
|
-
{
|
|
764
|
-
onClick: f,
|
|
765
|
-
disabled: M,
|
|
766
|
-
"aria-busy": M,
|
|
767
|
-
children: [
|
|
768
|
-
M ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(es, { className: "h-5 w-5" }),
|
|
769
|
-
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
770
|
-
]
|
|
771
|
-
}
|
|
772
|
-
) }),
|
|
773
|
-
/* @__PURE__ */ e("li", { children: N ? /* @__PURE__ */ i(
|
|
774
|
-
Ee,
|
|
775
|
-
{
|
|
776
|
-
onClick: C,
|
|
777
|
-
disabled: S,
|
|
778
|
-
"aria-busy": S,
|
|
779
|
-
children: [
|
|
780
|
-
S ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
|
|
781
|
-
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
782
|
-
]
|
|
783
|
-
}
|
|
784
|
-
) : /* @__PURE__ */ i(
|
|
785
|
-
Ee,
|
|
786
|
-
{
|
|
787
|
-
onClick: d,
|
|
788
|
-
disabled: S,
|
|
789
|
-
"aria-busy": S,
|
|
790
|
-
children: [
|
|
791
|
-
S ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
|
|
792
|
-
/* @__PURE__ */ e("span", { children: "Block" })
|
|
793
|
-
]
|
|
794
|
-
}
|
|
795
|
-
) }),
|
|
796
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(Ee, { variant: "danger", onClick: _, children: [
|
|
797
|
-
/* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
|
|
798
|
-
/* @__PURE__ */ e("span", { children: "Report" })
|
|
799
|
-
] }) }),
|
|
800
|
-
v
|
|
801
|
-
] })
|
|
802
|
-
] })
|
|
803
|
-
] })
|
|
804
|
-
}
|
|
805
|
-
)
|
|
806
|
-
);
|
|
807
|
-
}, ys = (t) => /* @__PURE__ */ e(pt, { ...t, position: "center" }), Oe = "vote_up", Be = "vote_down";
|
|
808
|
-
function vs(t) {
|
|
809
|
-
return t != null && t.length ? t.some((s) => s.type === Be) ? "down" : t.some((s) => s.type === Oe) ? "up" : null : null;
|
|
810
|
-
}
|
|
811
|
-
function ws(t) {
|
|
812
|
-
const { channel: s } = xe(), { client: n } = tt("useMessageVote"), o = Ue(
|
|
813
|
-
() => vs(t.own_reactions),
|
|
814
|
-
[t.own_reactions]
|
|
815
|
-
), l = R(async () => {
|
|
816
|
-
if (n != null && n.userID)
|
|
817
|
-
try {
|
|
818
|
-
o === "up" ? await s.deleteReaction(t.id, Oe) : await s.sendReaction(
|
|
819
|
-
t.id,
|
|
820
|
-
{ type: Oe },
|
|
821
|
-
{ enforce_unique: !0, skip_push: !0 }
|
|
822
|
-
);
|
|
823
|
-
} catch {
|
|
824
|
-
}
|
|
825
|
-
}, [s, n == null ? void 0 : n.userID, t.id, o]), m = R(async () => {
|
|
826
|
-
if (n != null && n.userID)
|
|
827
|
-
try {
|
|
828
|
-
o === "down" ? await s.deleteReaction(t.id, Be) : await s.sendReaction(
|
|
829
|
-
t.id,
|
|
830
|
-
{ type: Be },
|
|
831
|
-
{ enforce_unique: !0, skip_push: !0 }
|
|
832
|
-
);
|
|
833
|
-
} catch {
|
|
834
|
-
}
|
|
835
|
-
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
836
|
-
return { selected: o, voteUp: l, voteDown: m };
|
|
837
|
-
}
|
|
838
|
-
const _s = U.lazy(() => import("./Card-1CQEn-OT.js")), Es = U.lazy(() => import("./Card-ClE_iExA.js")), mt = () => /* @__PURE__ */ e(
|
|
839
|
-
"div",
|
|
840
|
-
{
|
|
841
|
-
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
842
|
-
"aria-hidden": !0
|
|
843
|
-
}
|
|
844
|
-
), Ss = (t) => /* @__PURE__ */ e(et, { fallback: /* @__PURE__ */ e(mt, {}), children: /* @__PURE__ */ e(_s, { ...t }) }), Is = (t) => /* @__PURE__ */ e(et, { fallback: /* @__PURE__ */ e(mt, {}), children: /* @__PURE__ */ e(Es, { ...t }) }), Je = { Creator: Ss, Visitor: Is }, Ms = {
|
|
845
|
-
isUnlocking: () => !1
|
|
846
|
-
}, ks = {
|
|
847
|
-
LockedAttachment: Ms
|
|
848
|
-
}, ut = Ke({}), fn = ut.Provider;
|
|
849
|
-
function Ts(t) {
|
|
850
|
-
return Qe(ut)[t] ?? ks[t];
|
|
851
|
-
}
|
|
852
|
-
const Ds = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
853
|
-
"path",
|
|
854
|
-
{
|
|
855
|
-
d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
|
|
856
|
-
stroke: "currentColor",
|
|
857
|
-
strokeWidth: "1.33",
|
|
858
|
-
strokeLinecap: "round",
|
|
859
|
-
strokeLinejoin: "round",
|
|
860
|
-
fill: t ? "currentColor" : "none"
|
|
861
|
-
}
|
|
862
|
-
) }), Rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
863
|
-
"path",
|
|
864
|
-
{
|
|
865
|
-
d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
|
|
866
|
-
stroke: "currentColor",
|
|
867
|
-
strokeWidth: "1.33",
|
|
868
|
-
strokeLinecap: "round",
|
|
869
|
-
strokeLinejoin: "round",
|
|
870
|
-
fill: t ? "currentColor" : "none"
|
|
871
|
-
}
|
|
872
|
-
) }), As = ({
|
|
873
|
-
selected: t,
|
|
874
|
-
onVoteUp: s,
|
|
875
|
-
onVoteDown: n
|
|
876
|
-
}) => /* @__PURE__ */ i("div", { className: "message-vote-buttons", children: [
|
|
877
|
-
/* @__PURE__ */ e(
|
|
878
|
-
"button",
|
|
879
|
-
{
|
|
880
|
-
type: "button",
|
|
881
|
-
className: `message-vote-button${t === "up" ? " message-vote-button--selected" : ""} focus-ring`,
|
|
882
|
-
onClick: s,
|
|
883
|
-
"aria-label": "Helpful",
|
|
884
|
-
"aria-pressed": t === "up",
|
|
885
|
-
children: /* @__PURE__ */ e(Ds, { filled: t === "up" })
|
|
886
|
-
}
|
|
887
|
-
),
|
|
888
|
-
/* @__PURE__ */ e(
|
|
889
|
-
"button",
|
|
890
|
-
{
|
|
891
|
-
type: "button",
|
|
892
|
-
className: `message-vote-button${t === "down" ? " message-vote-button--selected" : ""} focus-ring`,
|
|
893
|
-
onClick: n,
|
|
894
|
-
"aria-label": "Not helpful",
|
|
895
|
-
"aria-pressed": t === "down",
|
|
896
|
-
children: /* @__PURE__ */ e(Rs, { filled: t === "down" })
|
|
897
|
-
}
|
|
898
|
-
)
|
|
899
|
-
] }), Ls = (t) => {
|
|
900
|
-
var K, pe, Ne, ye, le, ve, we, _e, ie, E, j, P, $, he;
|
|
901
|
-
const {
|
|
902
|
-
additionalMessageInputProps: s,
|
|
903
|
-
chatbotVotingEnabled: n,
|
|
904
|
-
editing: o,
|
|
905
|
-
endOfGroup: l,
|
|
906
|
-
firstOfGroup: m,
|
|
907
|
-
groupedByUser: r,
|
|
908
|
-
handleAction: c,
|
|
909
|
-
handleOpenThread: h,
|
|
910
|
-
handleRetry: u,
|
|
911
|
-
highlighted: b,
|
|
912
|
-
isMessageAIGenerated: g,
|
|
913
|
-
isMyMessage: v,
|
|
914
|
-
message: a,
|
|
915
|
-
renderText: w,
|
|
916
|
-
threadList: N
|
|
917
|
-
} = t, { client: x } = tt("CustomMessage"), { channel: M } = xe("CustomMessage"), { isUnlocking: k, onUnlockClick: S, onFetchSource: I, onDownloadClick: D } = Ts("LockedAttachment"), [f, d] = T(!1), C = yt(a.id), { selected: _, voteUp: y, voteDown: p } = ws(a), {
|
|
918
|
-
Attachment: F = wt,
|
|
919
|
-
EditMessageModal: ee = _t,
|
|
920
|
-
MessageBlocked: Y = Et,
|
|
921
|
-
MessageBouncePrompt: J = St,
|
|
922
|
-
MessageDeleted: L = It,
|
|
923
|
-
MessageIsThreadReplyInChannelButtonIndicator: W = Mt,
|
|
924
|
-
MessageRepliesCountButton: z = kt,
|
|
925
|
-
ReminderNotification: de = Tt,
|
|
926
|
-
StreamedMessageText: me = Dt,
|
|
927
|
-
PinIndicator: te
|
|
928
|
-
} = vt("CustomMessage"), ue = Rt(a), G = At(a), O = Ue(
|
|
929
|
-
() => g == null ? void 0 : g(a),
|
|
930
|
-
[g, a]
|
|
931
|
-
), B = Ue(
|
|
932
|
-
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
933
|
-
[a]
|
|
934
|
-
);
|
|
935
|
-
if (Lt(a))
|
|
936
|
-
return null;
|
|
937
|
-
if (a.deleted_at || a.type === "deleted")
|
|
938
|
-
return /* @__PURE__ */ e(L, { message: a });
|
|
939
|
-
if (Pt(a))
|
|
940
|
-
return /* @__PURE__ */ e(Y, {});
|
|
941
|
-
const q = !N && !!a.reply_count, se = !N && a.show_in_channel && a.parent_id, Te = a.status === "failed" && ((K = a.error) == null ? void 0 : K.status) !== 403, V = Ut(a);
|
|
942
|
-
let H;
|
|
943
|
-
Te ? H = () => u(a) : V && (H = () => d(!0));
|
|
944
|
-
const X = v(), ne = A(
|
|
945
|
-
"str-chat__message str-chat__message-simple",
|
|
946
|
-
`str-chat__message--${a.type}`,
|
|
947
|
-
`str-chat__message--${a.status}`,
|
|
948
|
-
X ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
949
|
-
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
950
|
-
{
|
|
951
|
-
"str-chat__message--has-attachment": ue,
|
|
952
|
-
"str-chat__message--highlighted": b,
|
|
953
|
-
"str-chat__message--pinned pinned-message": a.pinned,
|
|
954
|
-
"str-chat__message--with-reactions": G,
|
|
955
|
-
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((pe = a == null ? void 0 : a.error) == null ? void 0 : pe.status) !== 403,
|
|
956
|
-
"str-chat__message-with-thread-link": q || se,
|
|
957
|
-
"str-chat__virtual-message__wrapper--end": l,
|
|
958
|
-
"str-chat__virtual-message__wrapper--first": m,
|
|
959
|
-
"str-chat__virtual-message__wrapper--group": r
|
|
960
|
-
}
|
|
961
|
-
), ae = a.poll_id && x.polls.fromState(a.poll_id), Ce = Cs(a), re = $e(a), De = bs(a), be = !!(B != null && B.length && !a.quoted_message), oe = re && X && be;
|
|
962
|
-
return /* @__PURE__ */ i(ge, { children: [
|
|
963
|
-
o && /* @__PURE__ */ e(
|
|
964
|
-
ee,
|
|
965
|
-
{
|
|
966
|
-
additionalMessageInputProps: s
|
|
967
|
-
}
|
|
968
|
-
),
|
|
969
|
-
f && /* @__PURE__ */ e(
|
|
970
|
-
Ft,
|
|
971
|
-
{
|
|
972
|
-
MessageBouncePrompt: J,
|
|
973
|
-
onClose: () => d(!1),
|
|
974
|
-
open: f
|
|
975
|
-
}
|
|
976
|
-
),
|
|
977
|
-
/* @__PURE__ */ i("div", { className: ne, children: [
|
|
978
|
-
te && /* @__PURE__ */ e(te, {}),
|
|
979
|
-
!!C && /* @__PURE__ */ e(de, { reminder: C }),
|
|
980
|
-
a.user && /* @__PURE__ */ e(
|
|
981
|
-
ce,
|
|
982
|
-
{
|
|
983
|
-
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
984
|
-
id: a.user.id,
|
|
985
|
-
image: a.user.image,
|
|
986
|
-
name: a.user.name || a.user.id
|
|
987
|
-
}
|
|
988
|
-
),
|
|
989
|
-
/* @__PURE__ */ e(
|
|
990
|
-
"div",
|
|
991
|
-
{
|
|
992
|
-
className: A("str-chat__message-inner", {
|
|
993
|
-
"str-chat__simple-message--error-failed": Te || V
|
|
994
|
-
}),
|
|
995
|
-
"data-testid": "message-inner",
|
|
996
|
-
onClick: H,
|
|
997
|
-
onKeyDown: H,
|
|
998
|
-
role: H ? "button" : void 0,
|
|
999
|
-
tabIndex: H ? 0 : void 0,
|
|
1000
|
-
style: {
|
|
1001
|
-
// Force margins to 0 to prevent hover layout shift
|
|
1002
|
-
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
1003
|
-
marginInlineEnd: 0,
|
|
1004
|
-
marginInlineStart: 0
|
|
1005
|
-
},
|
|
1006
|
-
children: De ? /* @__PURE__ */ i("div", { className: `flex flex-col gap-1 ${X ? "items-end" : "items-start"}`, children: [
|
|
1007
|
-
X ? /* @__PURE__ */ e(
|
|
1008
|
-
Je.Creator,
|
|
1009
|
-
{
|
|
1010
|
-
title: (Ne = a.metadata) == null ? void 0 : Ne.attachment_title,
|
|
1011
|
-
mimeType: (ye = a.metadata) == null ? void 0 : ye.attachment_mime_type,
|
|
1012
|
-
thumbnailUrl: (le = a.metadata) == null ? void 0 : le.attachment_thumbnail,
|
|
1013
|
-
amountText: (ve = a.metadata) == null ? void 0 : ve.amount_text,
|
|
1014
|
-
detail: (we = a.metadata) == null ? void 0 : we.attachment_detail,
|
|
1015
|
-
paymentStatus: (_e = a.metadata) == null ? void 0 : _e.payment_status
|
|
1016
|
-
}
|
|
1017
|
-
) : /* @__PURE__ */ e(
|
|
1018
|
-
Je.Visitor,
|
|
1019
|
-
{
|
|
1020
|
-
title: (ie = a.metadata) == null ? void 0 : ie.attachment_title,
|
|
1021
|
-
mimeType: (E = a.metadata) == null ? void 0 : E.attachment_mime_type,
|
|
1022
|
-
thumbnailUrl: (j = a.metadata) == null ? void 0 : j.attachment_thumbnail,
|
|
1023
|
-
amountText: (P = a.metadata) == null ? void 0 : P.amount_text,
|
|
1024
|
-
detail: ($ = a.metadata) == null ? void 0 : $.attachment_detail,
|
|
1025
|
-
paymentStatus: (he = a.metadata) == null ? void 0 : he.payment_status,
|
|
1026
|
-
isUnlocking: k(a.id),
|
|
1027
|
-
onUnlockClick: () => S == null ? void 0 : S(a, M),
|
|
1028
|
-
onFetchSource: async () => await (I == null ? void 0 : I(a, M)),
|
|
1029
|
-
onDownloadClick: () => D == null ? void 0 : D(a, M)
|
|
1030
|
-
}
|
|
1031
|
-
),
|
|
1032
|
-
a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(ze, { message: a, renderText: w }) }) })
|
|
1033
|
-
] }) : Ce ? (
|
|
1034
|
-
/* Tip-only messages render as a standalone bubble */
|
|
1035
|
-
/* @__PURE__ */ e(Le, { message: a, standalone: !0 })
|
|
1036
|
-
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1037
|
-
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
1038
|
-
re && !oe && /* @__PURE__ */ e(
|
|
1039
|
-
Le,
|
|
1040
|
-
{
|
|
1041
|
-
message: a,
|
|
1042
|
-
hasAttachment: be,
|
|
1043
|
-
isMyMessage: X
|
|
1044
|
-
}
|
|
1045
|
-
),
|
|
1046
|
-
ae && /* @__PURE__ */ e(Ot, { poll: ae }),
|
|
1047
|
-
B != null && B.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
1048
|
-
F,
|
|
1049
|
-
{
|
|
1050
|
-
actionHandler: c,
|
|
1051
|
-
attachments: B
|
|
1052
|
-
}
|
|
1053
|
-
) : null,
|
|
1054
|
-
O ? /* @__PURE__ */ e(
|
|
1055
|
-
me,
|
|
1056
|
-
{
|
|
1057
|
-
message: a,
|
|
1058
|
-
renderText: w
|
|
1059
|
-
}
|
|
1060
|
-
) : /* @__PURE__ */ e(ze, { message: a, renderText: w }),
|
|
1061
|
-
/* @__PURE__ */ e(Bt, {})
|
|
1062
|
-
] }),
|
|
1063
|
-
(!re || oe) && /* @__PURE__ */ e(
|
|
1064
|
-
Le,
|
|
1065
|
-
{
|
|
1066
|
-
message: a,
|
|
1067
|
-
hasAttachment: be,
|
|
1068
|
-
isMyMessage: X
|
|
1069
|
-
}
|
|
1070
|
-
),
|
|
1071
|
-
n && re && /* @__PURE__ */ e(
|
|
1072
|
-
As,
|
|
1073
|
-
{
|
|
1074
|
-
selected: _,
|
|
1075
|
-
onVoteUp: y,
|
|
1076
|
-
onVoteDown: p
|
|
1077
|
-
}
|
|
1078
|
-
)
|
|
1079
|
-
] })
|
|
1080
|
-
}
|
|
1081
|
-
),
|
|
1082
|
-
q && /* @__PURE__ */ e(
|
|
1083
|
-
z,
|
|
1084
|
-
{
|
|
1085
|
-
onClick: h,
|
|
1086
|
-
reply_count: a.reply_count
|
|
1087
|
-
}
|
|
1088
|
-
),
|
|
1089
|
-
se && /* @__PURE__ */ e(W, {})
|
|
1090
|
-
] }, a.id)
|
|
1091
|
-
] });
|
|
1092
|
-
}, Ps = U.memo(
|
|
1093
|
-
Ls,
|
|
1094
|
-
(t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : Nt(t, s)
|
|
1095
|
-
), Us = (t) => {
|
|
1096
|
-
const s = st("CustomMessage");
|
|
1097
|
-
return /* @__PURE__ */ e(Ps, { ...s, ...t });
|
|
1098
|
-
}, Fs = (t) => ({
|
|
1099
|
-
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1100
|
-
(s) => qe.previewIsLoaded(s) || qe.previewIsLoading(s)
|
|
1101
|
-
)
|
|
1102
|
-
}), Os = ({
|
|
1103
|
-
link: t,
|
|
1104
|
-
onDismiss: s
|
|
1105
|
-
}) => {
|
|
1106
|
-
const { og_scrape_url: n, title: o, image_url: l } = t;
|
|
1107
|
-
return /* @__PURE__ */ i(
|
|
1108
|
-
"a",
|
|
1109
|
-
{
|
|
1110
|
-
href: n,
|
|
1111
|
-
target: "_blank",
|
|
1112
|
-
rel: "noopener noreferrer",
|
|
1113
|
-
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
1114
|
-
children: [
|
|
1115
|
-
l && /* @__PURE__ */ e(
|
|
1116
|
-
"img",
|
|
1117
|
-
{
|
|
1118
|
-
src: l,
|
|
1119
|
-
alt: o || "",
|
|
1120
|
-
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
1121
|
-
}
|
|
1122
|
-
),
|
|
1123
|
-
/* @__PURE__ */ e(
|
|
1124
|
-
"button",
|
|
1125
|
-
{
|
|
1126
|
-
type: "button",
|
|
1127
|
-
onClick: (r) => {
|
|
1128
|
-
r.preventDefault(), s(n);
|
|
1129
|
-
},
|
|
1130
|
-
className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
|
|
1131
|
-
"aria-label": "Close link preview",
|
|
1132
|
-
children: /* @__PURE__ */ e(Ge, { className: "size-4 text-black/90" })
|
|
1133
|
-
}
|
|
1134
|
-
),
|
|
1135
|
-
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
1136
|
-
o && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: o }),
|
|
1137
|
-
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
1138
|
-
] })
|
|
1139
|
-
]
|
|
1140
|
-
}
|
|
1141
|
-
);
|
|
1142
|
-
}, Bs = () => {
|
|
1143
|
-
const { linkPreviewsManager: t } = Gt(), { linkPreviews: s } = $t(
|
|
1144
|
-
t.state,
|
|
1145
|
-
Fs
|
|
1146
|
-
), n = (l) => {
|
|
1147
|
-
t.dismissPreview(l);
|
|
1148
|
-
};
|
|
1149
|
-
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
|
|
1150
|
-
Os,
|
|
1151
|
-
{
|
|
1152
|
-
link: l,
|
|
1153
|
-
onDismiss: n
|
|
1154
|
-
},
|
|
1155
|
-
l.og_scrape_url
|
|
1156
|
-
)) }) : null;
|
|
1157
|
-
}, Gs = () => {
|
|
1158
|
-
var m;
|
|
1159
|
-
const { channel: t } = xe(), s = ((m = t == null ? void 0 : t.data) == null ? void 0 : m.frozen) === !0, { handleSubmit: n } = zt(), o = Vt();
|
|
1160
|
-
return /* @__PURE__ */ i(ge, { children: [
|
|
1161
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ht, {}) }),
|
|
1162
|
-
/* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
1163
|
-
/* @__PURE__ */ e(Yt, {}),
|
|
1164
|
-
/* @__PURE__ */ e(Bs, {}),
|
|
1165
|
-
/* @__PURE__ */ e(Wt, {}),
|
|
1166
|
-
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1167
|
-
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1168
|
-
qt,
|
|
1169
|
-
{
|
|
1170
|
-
"aria-disabled": s || void 0,
|
|
1171
|
-
className: "w-full resize-none outline-none leading-6",
|
|
1172
|
-
autoFocus: !s,
|
|
1173
|
-
maxRows: 4,
|
|
1174
|
-
readOnly: s,
|
|
1175
|
-
tabIndex: s ? -1 : void 0
|
|
1176
|
-
}
|
|
1177
|
-
) }),
|
|
1178
|
-
/* @__PURE__ */ e(
|
|
1179
|
-
"button",
|
|
1180
|
-
{
|
|
1181
|
-
"aria-label": "Send",
|
|
1182
|
-
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white focus-ring",
|
|
1183
|
-
"data-testid": "send-button",
|
|
1184
|
-
disabled: s || !o,
|
|
1185
|
-
onClick: n,
|
|
1186
|
-
type: "button",
|
|
1187
|
-
children: /* @__PURE__ */ e(ss, { className: "size-4" })
|
|
1188
|
-
}
|
|
1189
|
-
)
|
|
1190
|
-
] })
|
|
1191
|
-
] })
|
|
1192
|
-
] });
|
|
1193
|
-
}, $s = ({
|
|
1194
|
-
renderActions: t
|
|
1195
|
-
}) => {
|
|
1196
|
-
var o;
|
|
1197
|
-
const { channel: s } = xe(), n = ((o = s == null ? void 0 : s.data) == null ? void 0 : o.frozen) === !0;
|
|
1198
|
-
return /* @__PURE__ */ i(
|
|
1199
|
-
"div",
|
|
1200
|
-
{
|
|
1201
|
-
inert: n ? "" : void 0,
|
|
1202
|
-
"aria-disabled": n || void 0,
|
|
1203
|
-
className: "message-input flex items-center gap-2 p-4 aria-disabled:opacity-40",
|
|
1204
|
-
children: [
|
|
1205
|
-
t == null ? void 0 : t(),
|
|
1206
|
-
/* @__PURE__ */ e(jt, { Input: Gs })
|
|
1207
|
-
]
|
|
1208
|
-
}
|
|
1209
|
-
);
|
|
1210
|
-
}, js = [
|
|
1211
|
-
"SYSTEM_DM_AGENT_PAUSED",
|
|
1212
|
-
"SYSTEM_DM_AGENT_RESUMED"
|
|
1213
|
-
], zs = {
|
|
1214
|
-
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1215
|
-
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1216
|
-
}, Vs = [
|
|
1217
|
-
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1218
|
-
], Hs = {
|
|
1219
|
-
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1220
|
-
}, Pe = "age safety guidelines.", Ys = "https://linktr.ee/s/about/contact", Xe = (t) => js.includes(t), Ws = (t) => Vs.includes(t), qs = (t) => {
|
|
1221
|
-
var o;
|
|
1222
|
-
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
1223
|
-
if (Xe(s))
|
|
1224
|
-
return {
|
|
1225
|
-
kind: "dm-agent",
|
|
1226
|
-
type: s
|
|
1227
|
-
};
|
|
1228
|
-
if (Ws(s))
|
|
1229
|
-
return {
|
|
1230
|
-
kind: "age-safety",
|
|
1231
|
-
type: s
|
|
1232
|
-
};
|
|
1233
|
-
const n = t.dm_agent_system_type;
|
|
1234
|
-
if (Xe(n))
|
|
1235
|
-
return {
|
|
1236
|
-
kind: "dm-agent",
|
|
1237
|
-
type: n
|
|
1238
|
-
};
|
|
1239
|
-
}, Zs = (t) => {
|
|
1240
|
-
const s = t.indexOf(Pe);
|
|
1241
|
-
if (s === -1)
|
|
1242
|
-
return t;
|
|
1243
|
-
const n = s + Pe.length;
|
|
1244
|
-
return /* @__PURE__ */ i(ge, { children: [
|
|
1245
|
-
t.slice(0, s),
|
|
1246
|
-
/* @__PURE__ */ e(
|
|
1247
|
-
"a",
|
|
1248
|
-
{
|
|
1249
|
-
href: Ys,
|
|
1250
|
-
target: "_blank",
|
|
1251
|
-
rel: "noopener noreferrer",
|
|
1252
|
-
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1253
|
-
children: Pe
|
|
1254
|
-
}
|
|
1255
|
-
),
|
|
1256
|
-
t.slice(n)
|
|
1257
|
-
] });
|
|
1258
|
-
}, Js = (t) => {
|
|
1259
|
-
var o, l;
|
|
1260
|
-
const s = t.message.hide_date === !0, n = qs(
|
|
1261
|
-
t.message
|
|
1262
|
-
);
|
|
1263
|
-
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1264
|
-
const m = ((o = t.message.text) == null ? void 0 : o.trim()) || zs[n.type];
|
|
1265
|
-
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1266
|
-
/* @__PURE__ */ i(
|
|
1267
|
-
"div",
|
|
1268
|
-
{
|
|
1269
|
-
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)]",
|
|
1270
|
-
"data-testid": "dm-agent-system-message",
|
|
1271
|
-
"data-dm-agent-system-type": n.type,
|
|
1272
|
-
children: [
|
|
1273
|
-
/* @__PURE__ */ e(
|
|
1274
|
-
ns,
|
|
1275
|
-
{
|
|
1276
|
-
size: 16,
|
|
1277
|
-
weight: "regular",
|
|
1278
|
-
"aria-hidden": !0,
|
|
1279
|
-
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1280
|
-
}
|
|
1281
|
-
),
|
|
1282
|
-
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: m })
|
|
1283
|
-
]
|
|
1284
|
-
}
|
|
1285
|
-
),
|
|
1286
|
-
!s && /* @__PURE__ */ e(Ae, { message: t.message })
|
|
1287
|
-
] });
|
|
1288
|
-
}
|
|
1289
|
-
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1290
|
-
const m = ((l = t.message.text) == null ? void 0 : l.trim()) || Hs[n.type];
|
|
1291
|
-
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1292
|
-
/* @__PURE__ */ i(
|
|
1293
|
-
"div",
|
|
1294
|
-
{
|
|
1295
|
-
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)]",
|
|
1296
|
-
"data-testid": "age-safety-system-message",
|
|
1297
|
-
"data-age-safety-system-type": n.type,
|
|
1298
|
-
children: [
|
|
1299
|
-
/* @__PURE__ */ e(
|
|
1300
|
-
as,
|
|
1301
|
-
{
|
|
1302
|
-
size: 24,
|
|
1303
|
-
weight: "duotone",
|
|
1304
|
-
"aria-hidden": !0,
|
|
1305
|
-
className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1306
|
-
"data-testid": "age-safety-system-message-icon"
|
|
1307
|
-
}
|
|
1308
|
-
),
|
|
1309
|
-
/* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Zs(m) }) })
|
|
1310
|
-
]
|
|
1311
|
-
}
|
|
1312
|
-
),
|
|
1313
|
-
!s && /* @__PURE__ */ e(Ae, { message: t.message })
|
|
1314
|
-
] });
|
|
1315
|
-
}
|
|
1316
|
-
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1317
|
-
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
1318
|
-
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
1319
|
-
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1320
|
-
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1321
|
-
] }),
|
|
1322
|
-
!s && /* @__PURE__ */ e(Ae, { message: t.message })
|
|
1323
|
-
] });
|
|
1324
|
-
}, Xs = () => null, Ks = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1325
|
-
"div",
|
|
1326
|
-
{
|
|
1327
|
-
className: A("flex items-center justify-center h-full", t),
|
|
1328
|
-
children: [
|
|
1329
|
-
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1330
|
-
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1331
|
-
"animateTransform",
|
|
1332
|
-
{
|
|
1333
|
-
attributeName: "transform",
|
|
1334
|
-
dur: "1s",
|
|
1335
|
-
type: "translate",
|
|
1336
|
-
values: "0 15 ; 0 -15; 0 15",
|
|
1337
|
-
repeatCount: "indefinite",
|
|
1338
|
-
begin: "0.1"
|
|
1339
|
-
}
|
|
1340
|
-
) }),
|
|
1341
|
-
/* @__PURE__ */ e("circle", { cx: "30", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1342
|
-
"animateTransform",
|
|
1343
|
-
{
|
|
1344
|
-
attributeName: "transform",
|
|
1345
|
-
dur: "1s",
|
|
1346
|
-
type: "translate",
|
|
1347
|
-
values: "0 10 ; 0 -10; 0 10",
|
|
1348
|
-
repeatCount: "indefinite",
|
|
1349
|
-
begin: "0.2"
|
|
1350
|
-
}
|
|
1351
|
-
) }),
|
|
1352
|
-
/* @__PURE__ */ e("circle", { cx: "54", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1353
|
-
"animateTransform",
|
|
1354
|
-
{
|
|
1355
|
-
attributeName: "transform",
|
|
1356
|
-
dur: "1s",
|
|
1357
|
-
type: "translate",
|
|
1358
|
-
values: "0 5 ; 0 -5; 0 5",
|
|
1359
|
-
repeatCount: "indefinite",
|
|
1360
|
-
begin: "0.3"
|
|
1361
|
-
}
|
|
1362
|
-
) })
|
|
1363
|
-
] }),
|
|
1364
|
-
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1365
|
-
]
|
|
1366
|
-
}
|
|
1367
|
-
), Me = U.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1368
|
-
/* @__PURE__ */ e(Ks, { className: "w-6 h-6" }),
|
|
1369
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1370
|
-
] }) }));
|
|
1371
|
-
Me.displayName = "LoadingState";
|
|
1372
|
-
const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Qs = ({
|
|
1373
|
-
onBack: t,
|
|
1374
|
-
showBackButton: s,
|
|
1375
|
-
onShowInfo: n,
|
|
1376
|
-
canShowInfo: o,
|
|
1377
|
-
showStarButton: l = !1
|
|
1378
|
-
}) => {
|
|
1379
|
-
var g, v, a, w, N;
|
|
1380
|
-
const { channel: m } = xe(), r = U.useMemo(() => Object.values(m.state.members || {}).find(
|
|
1381
|
-
(M) => {
|
|
1382
|
-
var k;
|
|
1383
|
-
return ((k = M.user) == null ? void 0 : k.id) && M.user.id !== m._client.userID;
|
|
1384
|
-
}
|
|
1385
|
-
), [m._client.userID, m.state.members]), c = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((v = r == null ? void 0 : r.user) == null ? void 0 : v.id) || "Unknown member", h = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, u = rt(m), b = async () => {
|
|
1386
|
-
try {
|
|
1387
|
-
u ? await m.unpin() : await m.pin();
|
|
1388
|
-
} catch (x) {
|
|
1389
|
-
console.error(
|
|
1390
|
-
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1391
|
-
x
|
|
1392
|
-
);
|
|
1393
|
-
}
|
|
1394
|
-
};
|
|
1395
|
-
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
1396
|
-
/* @__PURE__ */ i("div", { className: "grid grid-cols-[1fr_auto_1fr] w-full items-center @lg:hidden", children: [
|
|
1397
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1398
|
-
"button",
|
|
1399
|
-
{
|
|
1400
|
-
className: fe,
|
|
1401
|
-
onClick: t || (() => {
|
|
1402
|
-
}),
|
|
1403
|
-
type: "button",
|
|
1404
|
-
"aria-label": "Back to conversations",
|
|
1405
|
-
children: /* @__PURE__ */ e(He, { className: "size-5 text-black/90" })
|
|
1406
|
-
}
|
|
1407
|
-
) }),
|
|
1408
|
-
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1409
|
-
/* @__PURE__ */ e(
|
|
1410
|
-
ce,
|
|
1411
|
-
{
|
|
1412
|
-
id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || m.id || "unknown",
|
|
1413
|
-
name: c,
|
|
1414
|
-
image: h,
|
|
1415
|
-
starred: l && u,
|
|
1416
|
-
size: 40
|
|
1417
|
-
}
|
|
1418
|
-
),
|
|
1419
|
-
/* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: c })
|
|
1420
|
-
] }),
|
|
1421
|
-
/* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
|
|
1422
|
-
l && /* @__PURE__ */ e(
|
|
1423
|
-
"button",
|
|
1424
|
-
{
|
|
1425
|
-
className: fe,
|
|
1426
|
-
onClick: b,
|
|
1427
|
-
type: "button",
|
|
1428
|
-
"aria-label": u ? "Unstar conversation" : "Star conversation",
|
|
1429
|
-
children: /* @__PURE__ */ e(
|
|
1430
|
-
Fe,
|
|
1431
|
-
{
|
|
1432
|
-
className: A("size-5", {
|
|
1433
|
-
"text-yellow-600": u,
|
|
1434
|
-
"text-black/90": !u
|
|
1435
|
-
}),
|
|
1436
|
-
weight: u ? "duotone" : "regular"
|
|
1437
|
-
}
|
|
1438
|
-
)
|
|
1439
|
-
}
|
|
1440
|
-
),
|
|
1441
|
-
/* @__PURE__ */ e(
|
|
1442
|
-
"button",
|
|
1443
|
-
{
|
|
1444
|
-
className: fe,
|
|
1445
|
-
onClick: n,
|
|
1446
|
-
type: "button",
|
|
1447
|
-
"aria-label": "Show info",
|
|
1448
|
-
children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
|
|
1449
|
-
}
|
|
1450
|
-
)
|
|
1451
|
-
] })
|
|
1452
|
-
] }),
|
|
1453
|
-
/* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
1454
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
1455
|
-
s && t && /* @__PURE__ */ e(
|
|
1456
|
-
"button",
|
|
1457
|
-
{
|
|
1458
|
-
type: "button",
|
|
1459
|
-
onClick: t,
|
|
1460
|
-
className: fe,
|
|
1461
|
-
"aria-label": "Back to conversations",
|
|
1462
|
-
children: /* @__PURE__ */ e(He, { className: "size-5 text-black/90" })
|
|
1463
|
-
}
|
|
1464
|
-
),
|
|
1465
|
-
/* @__PURE__ */ e(
|
|
1466
|
-
ce,
|
|
1467
|
-
{
|
|
1468
|
-
id: ((N = r == null ? void 0 : r.user) == null ? void 0 : N.id) || m.id || "unknown",
|
|
1469
|
-
name: c,
|
|
1470
|
-
image: h,
|
|
1471
|
-
starred: l && u,
|
|
1472
|
-
size: 40
|
|
1473
|
-
}
|
|
1474
|
-
),
|
|
1475
|
-
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: c }) })
|
|
1476
|
-
] }),
|
|
1477
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1478
|
-
l && /* @__PURE__ */ e(
|
|
1479
|
-
"button",
|
|
1480
|
-
{
|
|
1481
|
-
className: fe,
|
|
1482
|
-
onClick: b,
|
|
1483
|
-
type: "button",
|
|
1484
|
-
"aria-label": u ? "Unstar conversation" : "Star conversation",
|
|
1485
|
-
children: /* @__PURE__ */ e(
|
|
1486
|
-
Fe,
|
|
1487
|
-
{
|
|
1488
|
-
className: A("size-5", {
|
|
1489
|
-
"text-yellow-600": u,
|
|
1490
|
-
"text-black/90": !u
|
|
1491
|
-
}),
|
|
1492
|
-
weight: u ? "duotone" : "regular"
|
|
1493
|
-
}
|
|
1494
|
-
)
|
|
1495
|
-
}
|
|
1496
|
-
),
|
|
1497
|
-
o && n && /* @__PURE__ */ e(
|
|
1498
|
-
"button",
|
|
1499
|
-
{
|
|
1500
|
-
className: fe,
|
|
1501
|
-
onClick: n,
|
|
1502
|
-
type: "button",
|
|
1503
|
-
"aria-label": "Show info",
|
|
1504
|
-
children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
|
|
1505
|
-
}
|
|
1506
|
-
)
|
|
1507
|
-
] })
|
|
1508
|
-
] })
|
|
1509
|
-
] });
|
|
1510
|
-
}, en = ({
|
|
1511
|
-
onBack: t,
|
|
1512
|
-
showBackButton: s,
|
|
1513
|
-
renderMessageInputActions: n,
|
|
1514
|
-
renderConversationFooter: o,
|
|
1515
|
-
onLeaveConversation: l,
|
|
1516
|
-
onBlockParticipant: m,
|
|
1517
|
-
showDeleteConversation: r = !0,
|
|
1518
|
-
onDeleteConversationClick: c,
|
|
1519
|
-
onBlockParticipantClick: h,
|
|
1520
|
-
onReportParticipantClick: u,
|
|
1521
|
-
showStarButton: b = !1,
|
|
1522
|
-
chatbotVotingEnabled: g = !1,
|
|
1523
|
-
renderChannelBanner: v,
|
|
1524
|
-
customProfileContent: a,
|
|
1525
|
-
customChannelActions: w,
|
|
1526
|
-
renderMessage: N
|
|
1527
|
-
}) => {
|
|
1528
|
-
const { channel: x } = xe(), M = Q(null), k = U.useMemo(() => Object.values(x.state.members || {}).find(
|
|
1529
|
-
(C) => {
|
|
1530
|
-
var _;
|
|
1531
|
-
return ((_ = C.user) == null ? void 0 : _.id) && C.user.id !== x._client.userID;
|
|
1532
|
-
}
|
|
1533
|
-
), [x._client.userID, x.state.members]), S = U.useMemo(() => {
|
|
1534
|
-
const d = x.data ?? {};
|
|
1535
|
-
if (d.followerStatus)
|
|
1536
|
-
return String(d.followerStatus);
|
|
1537
|
-
if (d.isFollower !== void 0)
|
|
1538
|
-
return d.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1539
|
-
}, [x.data]), I = R(() => {
|
|
1540
|
-
var d;
|
|
1541
|
-
(d = M.current) == null || d.showModal();
|
|
1542
|
-
}, []), D = R(() => {
|
|
1543
|
-
var d;
|
|
1544
|
-
(d = M.current) == null || d.close();
|
|
1545
|
-
}, []), f = R(
|
|
1546
|
-
(d) => {
|
|
1547
|
-
const { message: C } = st("ChannelView"), _ = /* @__PURE__ */ e(
|
|
1548
|
-
Us,
|
|
1549
|
-
{
|
|
1550
|
-
...d,
|
|
1551
|
-
chatbotVotingEnabled: g
|
|
1552
|
-
}
|
|
1553
|
-
);
|
|
1554
|
-
return !N || !C ? _ : N(_, C);
|
|
1555
|
-
},
|
|
1556
|
-
[g, N]
|
|
1557
|
-
);
|
|
1558
|
-
return /* @__PURE__ */ i(ge, { children: [
|
|
1559
|
-
/* @__PURE__ */ e(Jt, { overrides: { Message: f }, children: /* @__PURE__ */ i(Xt, { children: [
|
|
1560
|
-
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1561
|
-
Qs,
|
|
1562
|
-
{
|
|
1563
|
-
onBack: t,
|
|
1564
|
-
showBackButton: s,
|
|
1565
|
-
onShowInfo: I,
|
|
1566
|
-
canShowInfo: !!k,
|
|
1567
|
-
showStarButton: b
|
|
1568
|
-
}
|
|
1569
|
-
) }),
|
|
1570
|
-
v == null ? void 0 : v(),
|
|
1571
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1572
|
-
Kt,
|
|
1573
|
-
{
|
|
1574
|
-
hideDeletedMessages: !0,
|
|
1575
|
-
hideNewMessageSeparator: !1,
|
|
1576
|
-
messageActions: void 0
|
|
1577
|
-
}
|
|
1578
|
-
) }),
|
|
1579
|
-
o == null ? void 0 : o(x),
|
|
1580
|
-
/* @__PURE__ */ e(
|
|
1581
|
-
$s,
|
|
1582
|
-
{
|
|
1583
|
-
renderActions: () => n == null ? void 0 : n(x)
|
|
1584
|
-
}
|
|
1585
|
-
)
|
|
1586
|
-
] }) }),
|
|
1587
|
-
/* @__PURE__ */ e(
|
|
1588
|
-
Ns,
|
|
1589
|
-
{
|
|
1590
|
-
dialogRef: M,
|
|
1591
|
-
onClose: D,
|
|
1592
|
-
participant: k,
|
|
1593
|
-
channel: x,
|
|
1594
|
-
followerStatusLabel: S,
|
|
1595
|
-
onLeaveConversation: l,
|
|
1596
|
-
onBlockParticipant: m,
|
|
1597
|
-
showDeleteConversation: r,
|
|
1598
|
-
onDeleteConversationClick: c,
|
|
1599
|
-
onBlockParticipantClick: h,
|
|
1600
|
-
onReportParticipantClick: u,
|
|
1601
|
-
customProfileContent: a,
|
|
1602
|
-
customChannelActions: w
|
|
1603
|
-
}
|
|
1604
|
-
)
|
|
1605
|
-
] });
|
|
1606
|
-
}, ht = U.memo(
|
|
1607
|
-
({
|
|
1608
|
-
channel: t,
|
|
1609
|
-
onBack: s,
|
|
1610
|
-
showBackButton: n = !1,
|
|
1611
|
-
renderMessageInputActions: o,
|
|
1612
|
-
renderConversationFooter: l,
|
|
1613
|
-
onLeaveConversation: m,
|
|
1614
|
-
onBlockParticipant: r,
|
|
1615
|
-
className: c,
|
|
1616
|
-
CustomChannelEmptyState: h = Xs,
|
|
1617
|
-
showDeleteConversation: u = !0,
|
|
1618
|
-
onDeleteConversationClick: b,
|
|
1619
|
-
onBlockParticipantClick: g,
|
|
1620
|
-
onReportParticipantClick: v,
|
|
1621
|
-
dmAgentEnabled: a,
|
|
1622
|
-
messageMetadata: w,
|
|
1623
|
-
onMessageSent: N,
|
|
1624
|
-
showStarButton: x = !1,
|
|
1625
|
-
chatbotVotingEnabled: M = !1,
|
|
1626
|
-
renderChannelBanner: k,
|
|
1627
|
-
customProfileContent: S,
|
|
1628
|
-
customChannelActions: I,
|
|
1629
|
-
renderMessage: D
|
|
1630
|
-
}) => {
|
|
1631
|
-
const f = R(
|
|
1632
|
-
async (d, C, _) => {
|
|
1633
|
-
var J;
|
|
1634
|
-
const y = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, p = a && !y, F = {
|
|
1635
|
-
...C,
|
|
1636
|
-
...p && { silent: !0 },
|
|
1637
|
-
...w && {
|
|
1638
|
-
metadata: {
|
|
1639
|
-
...C.metadata ?? {},
|
|
1640
|
-
...w
|
|
1641
|
-
}
|
|
1642
|
-
}
|
|
1643
|
-
}, ee = {
|
|
1644
|
-
..._,
|
|
1645
|
-
...p && { skip_push: !0 }
|
|
1646
|
-
}, Y = await t.sendMessage(F, ee);
|
|
1647
|
-
return N == null || N(Y), Y;
|
|
1648
|
-
},
|
|
1649
|
-
[t, a, w, N]
|
|
1650
|
-
);
|
|
1651
|
-
return /* @__PURE__ */ e(
|
|
1652
|
-
"div",
|
|
1653
|
-
{
|
|
1654
|
-
className: A(
|
|
1655
|
-
"messaging-channel-view h-full flex flex-col",
|
|
1656
|
-
c
|
|
1657
|
-
),
|
|
1658
|
-
children: /* @__PURE__ */ e(
|
|
1659
|
-
Zt,
|
|
1660
|
-
{
|
|
1661
|
-
channel: t,
|
|
1662
|
-
MessageSystem: Js,
|
|
1663
|
-
EmptyStateIndicator: h,
|
|
1664
|
-
LoadingIndicator: Me,
|
|
1665
|
-
DateSeparator: ys,
|
|
1666
|
-
doSendMessageRequest: f,
|
|
1667
|
-
children: /* @__PURE__ */ e(
|
|
1668
|
-
en,
|
|
1669
|
-
{
|
|
1670
|
-
onBack: s,
|
|
1671
|
-
showBackButton: n,
|
|
1672
|
-
renderMessageInputActions: o,
|
|
1673
|
-
renderConversationFooter: l,
|
|
1674
|
-
onLeaveConversation: m,
|
|
1675
|
-
onBlockParticipant: r,
|
|
1676
|
-
CustomChannelEmptyState: h,
|
|
1677
|
-
showDeleteConversation: u,
|
|
1678
|
-
onDeleteConversationClick: b,
|
|
1679
|
-
onBlockParticipantClick: g,
|
|
1680
|
-
onReportParticipantClick: v,
|
|
1681
|
-
showStarButton: x,
|
|
1682
|
-
chatbotVotingEnabled: M,
|
|
1683
|
-
renderChannelBanner: k,
|
|
1684
|
-
customProfileContent: S,
|
|
1685
|
-
customChannelActions: I,
|
|
1686
|
-
renderMessage: D
|
|
1687
|
-
}
|
|
1688
|
-
)
|
|
1689
|
-
}
|
|
1690
|
-
)
|
|
1691
|
-
}
|
|
1692
|
-
);
|
|
1693
|
-
}
|
|
1694
|
-
);
|
|
1695
|
-
ht.displayName = "ChannelView";
|
|
1696
|
-
function tn({
|
|
1697
|
-
searchQuery: t,
|
|
1698
|
-
setSearchQuery: s,
|
|
1699
|
-
placeholder: n
|
|
1700
|
-
}) {
|
|
1701
|
-
const o = Q(null);
|
|
1702
|
-
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1703
|
-
/* @__PURE__ */ e(
|
|
1704
|
-
rs,
|
|
1705
|
-
{
|
|
1706
|
-
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1707
|
-
weight: "bold"
|
|
1708
|
-
}
|
|
1709
|
-
),
|
|
1710
|
-
/* @__PURE__ */ e(
|
|
1711
|
-
"input",
|
|
1712
|
-
{
|
|
1713
|
-
ref: o,
|
|
1714
|
-
type: "text",
|
|
1715
|
-
placeholder: n,
|
|
1716
|
-
value: t,
|
|
1717
|
-
onChange: (l) => s(l.target.value),
|
|
1718
|
-
className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
|
|
1719
|
-
}
|
|
1720
|
-
),
|
|
1721
|
-
t && /* @__PURE__ */ e(
|
|
1722
|
-
ct,
|
|
1723
|
-
{
|
|
1724
|
-
label: "Clear search",
|
|
1725
|
-
onClick: () => {
|
|
1726
|
-
var l;
|
|
1727
|
-
s(""), (l = o.current) == null || l.focus();
|
|
1728
|
-
},
|
|
1729
|
-
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1730
|
-
children: /* @__PURE__ */ e(Ge, { className: "h-4 w-4", weight: "bold" })
|
|
1731
|
-
}
|
|
1732
|
-
)
|
|
1733
|
-
] });
|
|
1734
|
-
}
|
|
1735
|
-
const sn = ({
|
|
1736
|
-
participantSource: t,
|
|
1737
|
-
onSelectParticipant: s,
|
|
1738
|
-
onClose: n,
|
|
1739
|
-
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1740
|
-
participantLabel: l = "participants",
|
|
1741
|
-
searchPlaceholder: m = "Search participants...",
|
|
1742
|
-
className: r
|
|
1743
|
-
}) => {
|
|
1744
|
-
const { debug: c } = ke(), [h, u] = T(""), [b, g] = T([]), [v, a] = T(!1), [w, N] = T(null), [x, M] = T(
|
|
1745
|
-
null
|
|
1746
|
-
), k = Q(!1);
|
|
1747
|
-
Z(() => {
|
|
1748
|
-
k.current = !1;
|
|
1749
|
-
}, [t]), Z(() => {
|
|
1750
|
-
if (t.loading) {
|
|
1751
|
-
c && console.log(
|
|
1752
|
-
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1753
|
-
);
|
|
1754
|
-
return;
|
|
1755
|
-
}
|
|
1756
|
-
if (k.current) return;
|
|
1757
|
-
(async () => {
|
|
1758
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), N(null);
|
|
1759
|
-
try {
|
|
1760
|
-
const d = await t.loadParticipants({
|
|
1761
|
-
search: "",
|
|
1762
|
-
// Load all participants initially
|
|
1763
|
-
limit: 100
|
|
1764
|
-
});
|
|
1765
|
-
g(d.participants), k.current = !0, c && console.log(
|
|
1766
|
-
"[ParticipantPicker] Participants loaded successfully:",
|
|
1767
|
-
d.participants.length
|
|
1768
|
-
);
|
|
1769
|
-
} catch (d) {
|
|
1770
|
-
const C = d instanceof Error ? d.message : "Failed to load participants";
|
|
1771
|
-
N(C), console.error("[ParticipantPicker] Failed to load participants:", d);
|
|
1772
|
-
} finally {
|
|
1773
|
-
a(!1);
|
|
1774
|
-
}
|
|
1775
|
-
})();
|
|
1776
|
-
}, [t, c]);
|
|
1777
|
-
const S = b.filter((f) => !o.has(f.id)).filter((f) => {
|
|
1778
|
-
var C;
|
|
1779
|
-
if (!h) return !0;
|
|
1780
|
-
const d = h.toLowerCase();
|
|
1781
|
-
return f.name.toLowerCase().includes(d) || ((C = f.email) == null ? void 0 : C.toLowerCase().includes(d)) || !1;
|
|
1782
|
-
}), I = R(
|
|
1783
|
-
async (f) => {
|
|
1784
|
-
if (!x) {
|
|
1785
|
-
M(f.id);
|
|
1786
|
-
try {
|
|
1787
|
-
await s(f);
|
|
1788
|
-
} catch (d) {
|
|
1789
|
-
console.error("[ParticipantPicker] Failed to start chat:", d), M(null);
|
|
1790
|
-
}
|
|
1791
|
-
}
|
|
1792
|
-
},
|
|
1793
|
-
[s, x]
|
|
1794
|
-
), D = (f, d) => {
|
|
1795
|
-
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), I(d));
|
|
1796
|
-
};
|
|
1797
|
-
return /* @__PURE__ */ i("div", { className: A("flex flex-col h-full", r), children: [
|
|
1798
|
-
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1799
|
-
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1800
|
-
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1801
|
-
/* @__PURE__ */ e(dt, { onClick: n })
|
|
1802
|
-
] }),
|
|
1803
|
-
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1804
|
-
"Select a ",
|
|
1805
|
-
l.slice(0, -1),
|
|
1806
|
-
" to start messaging (",
|
|
1807
|
-
S.length,
|
|
1808
|
-
" available)",
|
|
1809
|
-
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1810
|
-
] }),
|
|
1811
|
-
/* @__PURE__ */ e(
|
|
1812
|
-
tn,
|
|
1813
|
-
{
|
|
1814
|
-
searchQuery: h,
|
|
1815
|
-
setSearchQuery: u,
|
|
1816
|
-
placeholder: m
|
|
1817
|
-
}
|
|
1818
|
-
)
|
|
1819
|
-
] }),
|
|
1820
|
-
w && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1821
|
-
"Error loading ",
|
|
1822
|
-
l,
|
|
1823
|
-
": ",
|
|
1824
|
-
w
|
|
1825
|
-
] }),
|
|
1826
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1827
|
-
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1828
|
-
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1829
|
-
"Loading ",
|
|
1830
|
-
l,
|
|
1831
|
-
"..."
|
|
1832
|
-
] })
|
|
1833
|
-
] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1834
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(We, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1835
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1836
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1837
|
-
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1838
|
-
S.map((f) => {
|
|
1839
|
-
const d = f.name || f.email || f.id, C = f.email && f.name ? f.email : f.phone;
|
|
1840
|
-
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1841
|
-
"button",
|
|
1842
|
-
{
|
|
1843
|
-
type: "button",
|
|
1844
|
-
onClick: () => I(f),
|
|
1845
|
-
onKeyDown: (_) => D(_, f),
|
|
1846
|
-
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1847
|
-
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1848
|
-
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1849
|
-
/* @__PURE__ */ e(
|
|
1850
|
-
ce,
|
|
1851
|
-
{
|
|
1852
|
-
id: f.id,
|
|
1853
|
-
name: d,
|
|
1854
|
-
image: f.image,
|
|
1855
|
-
size: 40
|
|
1856
|
-
}
|
|
1857
|
-
),
|
|
1858
|
-
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1859
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: d }),
|
|
1860
|
-
C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
|
|
1861
|
-
] })
|
|
1862
|
-
] }),
|
|
1863
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: x === f.id ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(We, { className: "h-5 w-5 text-stone" }) })
|
|
1864
|
-
] })
|
|
1865
|
-
}
|
|
1866
|
-
) }, f.id);
|
|
1867
|
-
}),
|
|
1868
|
-
v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1869
|
-
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1870
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1871
|
-
] }) })
|
|
1872
|
-
] }) })
|
|
1873
|
-
] });
|
|
1874
|
-
}, nn = ({ className: t }) => /* @__PURE__ */ i(
|
|
1875
|
-
"svg",
|
|
1876
|
-
{
|
|
1877
|
-
width: "140",
|
|
1878
|
-
height: "120",
|
|
1879
|
-
viewBox: "44 -2 144 126",
|
|
1880
|
-
fill: "none",
|
|
1881
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1882
|
-
className: t,
|
|
1883
|
-
children: [
|
|
1884
|
-
/* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1885
|
-
/* @__PURE__ */ e(
|
|
1886
|
-
"path",
|
|
1887
|
-
{
|
|
1888
|
-
d: "M123.68 82.1932C123.383 103.675 105.839 121 84.2417 121C77.4724 121 71.0986 119.297 65.5327 116.299L52.5873 119.687L53.8036 106.673C48.1776 99.8701 44.7994 91.1453 44.7994 81.6356C44.7994 59.8965 62.4554 42.2754 84.2374 42.2754C89.1328 42.2754 93.8175 43.1633 98.1413 44.789",
|
|
1889
|
-
fill: "#D7D4CE"
|
|
1890
|
-
}
|
|
1891
|
-
),
|
|
1892
|
-
/* @__PURE__ */ e(
|
|
1893
|
-
"path",
|
|
1894
|
-
{
|
|
1895
|
-
d: "M84.2458 86.0364C82.2851 86.0364 80.6957 84.4501 80.6957 82.4933C80.6957 80.5365 82.2851 78.9502 84.2458 78.9502C86.2065 78.9502 87.7959 80.5365 87.7959 82.4933C87.7959 84.4501 86.2065 86.0364 84.2458 86.0364Z",
|
|
1896
|
-
fill: "white"
|
|
1897
|
-
}
|
|
1898
|
-
),
|
|
1899
|
-
/* @__PURE__ */ e(
|
|
1900
|
-
"path",
|
|
1901
|
-
{
|
|
1902
|
-
d: "M68.3044 86.0364C66.3437 86.0364 64.7543 84.4501 64.7543 82.4933C64.7543 80.5365 66.3437 78.9502 68.3044 78.9502C70.2651 78.9502 71.8545 80.5365 71.8545 82.4933C71.8545 84.4501 70.2651 86.0364 68.3044 86.0364Z",
|
|
1903
|
-
fill: "white"
|
|
1904
|
-
}
|
|
1905
|
-
),
|
|
1906
|
-
/* @__PURE__ */ e(
|
|
1907
|
-
"path",
|
|
1908
|
-
{
|
|
1909
|
-
d: "M100.183 86.0364C98.2226 86.0364 96.6332 84.4501 96.6332 82.4933C96.6332 80.5365 98.2226 78.9502 100.183 78.9502C102.144 78.9502 103.733 80.5365 103.733 82.4933C103.733 84.4501 102.144 86.0364 100.183 86.0364Z",
|
|
1910
|
-
fill: "white"
|
|
1911
|
-
}
|
|
1912
|
-
),
|
|
1913
|
-
/* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
|
|
1914
|
-
/* @__PURE__ */ e(
|
|
1915
|
-
"path",
|
|
1916
|
-
{
|
|
1917
|
-
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
1918
|
-
fill: "white"
|
|
1919
|
-
}
|
|
1920
|
-
),
|
|
1921
|
-
/* @__PURE__ */ e(
|
|
1922
|
-
"path",
|
|
1923
|
-
{
|
|
1924
|
-
d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
|
|
1925
|
-
stroke: "#D7D4CE",
|
|
1926
|
-
strokeWidth: "2",
|
|
1927
|
-
strokeMiterlimit: "10"
|
|
1928
|
-
}
|
|
1929
|
-
)
|
|
1930
|
-
] }),
|
|
1931
|
-
/* @__PURE__ */ e(
|
|
1932
|
-
"path",
|
|
1933
|
-
{
|
|
1934
|
-
d: "M139.502 45.5431C137.541 45.5431 135.952 43.9568 135.952 42C135.952 40.0432 137.541 38.4569 139.502 38.4569C141.462 38.4569 143.052 40.0432 143.052 42C143.052 43.9568 141.462 45.5431 139.502 45.5431Z",
|
|
1935
|
-
fill: "#D7D4CE"
|
|
1936
|
-
}
|
|
1937
|
-
),
|
|
1938
|
-
/* @__PURE__ */ e(
|
|
1939
|
-
"path",
|
|
1940
|
-
{
|
|
1941
|
-
d: "M123.561 45.5431C121.601 45.5431 120.011 43.9568 120.011 42C120.011 40.0432 121.601 38.4569 123.561 38.4569C125.522 38.4569 127.111 40.0432 127.111 42C127.111 43.9568 125.522 45.5431 123.561 45.5431Z",
|
|
1942
|
-
fill: "#D7D4CE"
|
|
1943
|
-
}
|
|
1944
|
-
),
|
|
1945
|
-
/* @__PURE__ */ e(
|
|
1946
|
-
"path",
|
|
1947
|
-
{
|
|
1948
|
-
d: "M155.439 45.5431C153.478 45.5431 151.889 43.9568 151.889 42C151.889 40.0432 153.478 38.4569 155.439 38.4569C157.4 38.4569 158.989 40.0432 158.989 42C158.989 43.9568 157.4 45.5431 155.439 45.5431Z",
|
|
1949
|
-
fill: "#D7D4CE"
|
|
1950
|
-
}
|
|
1951
|
-
)
|
|
1952
|
-
] }),
|
|
1953
|
-
/* @__PURE__ */ i("defs", { children: [
|
|
1954
|
-
/* @__PURE__ */ i(
|
|
1955
|
-
"filter",
|
|
1956
|
-
{
|
|
1957
|
-
id: "filter0_empty_state",
|
|
1958
|
-
x: "97",
|
|
1959
|
-
y: "-1",
|
|
1960
|
-
width: "89",
|
|
1961
|
-
height: "90",
|
|
1962
|
-
filterUnits: "userSpaceOnUse",
|
|
1963
|
-
colorInterpolationFilters: "sRGB",
|
|
1964
|
-
children: [
|
|
1965
|
-
/* @__PURE__ */ e("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
|
|
1966
|
-
/* @__PURE__ */ e(
|
|
1967
|
-
"feColorMatrix",
|
|
1968
|
-
{
|
|
1969
|
-
in: "SourceAlpha",
|
|
1970
|
-
type: "matrix",
|
|
1971
|
-
values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
|
|
1972
|
-
result: "hardAlpha"
|
|
1973
|
-
}
|
|
1974
|
-
),
|
|
1975
|
-
/* @__PURE__ */ e("feOffset", { dx: "4", dy: "4" }),
|
|
1976
|
-
/* @__PURE__ */ e("feComposite", { in2: "hardAlpha", operator: "out" }),
|
|
1977
|
-
/* @__PURE__ */ e(
|
|
1978
|
-
"feColorMatrix",
|
|
1979
|
-
{
|
|
1980
|
-
type: "matrix",
|
|
1981
|
-
values: "0 0 0 0 0.8428 0 0 0 0 0.830064 0 0 0 0 0.8095 0 0 0 1 0"
|
|
1982
|
-
}
|
|
1983
|
-
),
|
|
1984
|
-
/* @__PURE__ */ e(
|
|
1985
|
-
"feBlend",
|
|
1986
|
-
{
|
|
1987
|
-
mode: "normal",
|
|
1988
|
-
in2: "BackgroundImageFix",
|
|
1989
|
-
result: "effect1_dropShadow"
|
|
1990
|
-
}
|
|
1991
|
-
),
|
|
1992
|
-
/* @__PURE__ */ e(
|
|
1993
|
-
"feBlend",
|
|
1994
|
-
{
|
|
1995
|
-
mode: "normal",
|
|
1996
|
-
in: "SourceGraphic",
|
|
1997
|
-
in2: "effect1_dropShadow",
|
|
1998
|
-
result: "shape"
|
|
1999
|
-
}
|
|
2000
|
-
)
|
|
2001
|
-
]
|
|
2002
|
-
}
|
|
2003
|
-
),
|
|
2004
|
-
/* @__PURE__ */ e("clipPath", { id: "clip0_empty_state", children: /* @__PURE__ */ e("rect", { width: "233", height: "233", fill: "white" }) })
|
|
2005
|
-
] })
|
|
2006
|
-
]
|
|
2007
|
-
}
|
|
2008
|
-
), ft = U.memo(
|
|
2009
|
-
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
2010
|
-
/* @__PURE__ */ e(nn, {}),
|
|
2011
|
-
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
2012
|
-
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
2013
|
-
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
2014
|
-
] })
|
|
2015
|
-
] }) })
|
|
2016
|
-
);
|
|
2017
|
-
ft.displayName = "EmptyState";
|
|
2018
|
-
const Ie = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
2019
|
-
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
2020
|
-
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
2021
|
-
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
2022
|
-
s && /* @__PURE__ */ e(
|
|
2023
|
-
"button",
|
|
2024
|
-
{
|
|
2025
|
-
type: "button",
|
|
2026
|
-
onClick: s,
|
|
2027
|
-
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[#7f22fe] hover:bg-primary-alt rounded-lg transition-colors focus-ring",
|
|
2028
|
-
children: "Go Back"
|
|
2029
|
-
}
|
|
2030
|
-
)
|
|
2031
|
-
] }) }));
|
|
2032
|
-
Ie.displayName = "ErrorState";
|
|
2033
|
-
const gn = ({
|
|
2034
|
-
capabilities: t = {},
|
|
2035
|
-
className: s,
|
|
2036
|
-
renderMessageInputActions: n,
|
|
2037
|
-
renderConversationFooter: o,
|
|
2038
|
-
onChannelSelect: l,
|
|
2039
|
-
onParticipantSelect: m,
|
|
2040
|
-
initialParticipantFilter: r,
|
|
2041
|
-
initialParticipantData: c,
|
|
2042
|
-
CustomChannelEmptyState: h,
|
|
2043
|
-
showChannelList: u = !0,
|
|
2044
|
-
filters: b,
|
|
2045
|
-
channelRenderFilterFn: g,
|
|
2046
|
-
channelListCustomEmptyStateIndicator: v,
|
|
2047
|
-
onDeleteConversationClick: a,
|
|
2048
|
-
onBlockParticipantClick: w,
|
|
2049
|
-
onReportParticipantClick: N,
|
|
2050
|
-
dmAgentEnabled: x,
|
|
2051
|
-
messageMetadata: M,
|
|
2052
|
-
onMessageSent: k,
|
|
2053
|
-
showStarButton: S = !1,
|
|
2054
|
-
chatbotVotingEnabled: I = !1,
|
|
2055
|
-
renderMessagePreview: D,
|
|
2056
|
-
renderChannelBanner: f,
|
|
2057
|
-
customProfileContent: d,
|
|
2058
|
-
customChannelActions: C,
|
|
2059
|
-
renderMessage: _
|
|
2060
|
-
}) => {
|
|
2061
|
-
const {
|
|
2062
|
-
service: y,
|
|
2063
|
-
client: p,
|
|
2064
|
-
isConnected: F,
|
|
2065
|
-
isLoading: ee,
|
|
2066
|
-
error: Y,
|
|
2067
|
-
refreshConnection: J,
|
|
2068
|
-
debug: L
|
|
2069
|
-
} = os(), [W, z] = T(null), [de, me] = T(!1), [te, ue] = T(!1), [G, O] = T(!1), [B, q] = T(/* @__PURE__ */ new Set()), [se, Te] = T(0), [V, H] = T(!1), [X, ne] = T(null), ae = Q(null), {
|
|
2070
|
-
participantSource: Ce,
|
|
2071
|
-
participantLabel: re = "participants",
|
|
2072
|
-
showDeleteConversation: De = !0
|
|
2073
|
-
} = t, be = U.useMemo(() => {
|
|
2074
|
-
const E = p == null ? void 0 : p.userID;
|
|
2075
|
-
return {
|
|
2076
|
-
...{
|
|
2077
|
-
type: "messaging",
|
|
2078
|
-
last_message_at: { $exists: !0 },
|
|
2079
|
-
...E && {
|
|
2080
|
-
members: { $in: [E] },
|
|
2081
|
-
hidden: !1
|
|
2082
|
-
}
|
|
2083
|
-
},
|
|
2084
|
-
...b
|
|
2085
|
-
};
|
|
2086
|
-
}, [b, p == null ? void 0 : p.userID]), oe = Q(null), K = R(async () => {
|
|
2087
|
-
if (!p || !F) return;
|
|
2088
|
-
const E = p.userID;
|
|
2089
|
-
if (E)
|
|
2090
|
-
try {
|
|
2091
|
-
L && console.log("[MessagingShell] Syncing channels for user:", E);
|
|
2092
|
-
const j = await p.queryChannels(
|
|
2093
|
-
{
|
|
2094
|
-
type: "messaging",
|
|
2095
|
-
members: { $in: [E] }
|
|
2096
|
-
},
|
|
2097
|
-
{},
|
|
2098
|
-
{ limit: 100 }
|
|
2099
|
-
), P = /* @__PURE__ */ new Set();
|
|
2100
|
-
j.forEach(($) => {
|
|
2101
|
-
const he = $.state.members;
|
|
2102
|
-
Object.values(he).forEach((gt) => {
|
|
2103
|
-
var je;
|
|
2104
|
-
const Re = (je = gt.user) == null ? void 0 : je.id;
|
|
2105
|
-
Re && Re !== E && P.add(Re);
|
|
2106
|
-
});
|
|
2107
|
-
}), q(($) => $.size === P.size && [...$].every((he) => P.has(he)) ? $ : P), me(j.length > 0), ue(!0), oe.current = E, L && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2108
|
-
channelCount: j.length,
|
|
2109
|
-
memberCount: P.size
|
|
2110
|
-
});
|
|
2111
|
-
} catch (j) {
|
|
2112
|
-
console.error("[MessagingShell] Failed to sync channels:", j);
|
|
2113
|
-
}
|
|
2114
|
-
}, [p, F, L]);
|
|
2115
|
-
Z(() => {
|
|
2116
|
-
if (!p || !F) return;
|
|
2117
|
-
const E = p.userID;
|
|
2118
|
-
E && oe.current !== E && K();
|
|
2119
|
-
}, [p, F, K]), Z(() => {
|
|
2120
|
-
if (!r || !p || !F) return;
|
|
2121
|
-
(async () => {
|
|
2122
|
-
const j = p.userID;
|
|
2123
|
-
if (j)
|
|
2124
|
-
try {
|
|
2125
|
-
L && console.log(
|
|
2126
|
-
"[MessagingShell] Loading initial conversation with:",
|
|
2127
|
-
r
|
|
2128
|
-
);
|
|
2129
|
-
const P = await p.queryChannels(
|
|
2130
|
-
{
|
|
2131
|
-
type: "messaging",
|
|
2132
|
-
members: { $eq: [j, r] }
|
|
2133
|
-
},
|
|
2134
|
-
{},
|
|
2135
|
-
{ limit: 1 }
|
|
2136
|
-
);
|
|
2137
|
-
if (P.length > 0)
|
|
2138
|
-
z(P[0]), H(!0), ne(null), l && l(P[0]), L && console.log(
|
|
2139
|
-
"[MessagingShell] Initial conversation loaded:",
|
|
2140
|
-
P[0].id
|
|
2141
|
-
);
|
|
2142
|
-
else if (c && y) {
|
|
2143
|
-
L && console.log(
|
|
2144
|
-
"[MessagingShell] No conversation found, creating one for:",
|
|
2145
|
-
c
|
|
2146
|
-
);
|
|
2147
|
-
try {
|
|
2148
|
-
const $ = await y.startChannelWithParticipant({
|
|
2149
|
-
id: c.id,
|
|
2150
|
-
name: c.name,
|
|
2151
|
-
email: c.email,
|
|
2152
|
-
phone: c.phone
|
|
2153
|
-
});
|
|
2154
|
-
z($), H(!0), ne(null), l && l($), L && console.log(
|
|
2155
|
-
"[MessagingShell] Channel created and loaded:",
|
|
2156
|
-
$.id
|
|
2157
|
-
);
|
|
2158
|
-
} catch ($) {
|
|
2159
|
-
console.error(
|
|
2160
|
-
"[MessagingShell] Failed to create conversation:",
|
|
2161
|
-
$
|
|
2162
|
-
), ne("Failed to create conversation");
|
|
2163
|
-
}
|
|
2164
|
-
} else
|
|
2165
|
-
ne(
|
|
2166
|
-
"No conversation found with this account"
|
|
2167
|
-
), L && console.log(
|
|
2168
|
-
"[MessagingShell] No conversation found for:",
|
|
2169
|
-
r
|
|
2170
|
-
);
|
|
2171
|
-
} catch (P) {
|
|
2172
|
-
console.error(
|
|
2173
|
-
"[MessagingShell] Failed to load initial conversation:",
|
|
2174
|
-
P
|
|
2175
|
-
), ne("Failed to load conversation");
|
|
2176
|
-
}
|
|
2177
|
-
})();
|
|
2178
|
-
}, [
|
|
2179
|
-
r,
|
|
2180
|
-
c,
|
|
2181
|
-
p,
|
|
2182
|
-
F,
|
|
2183
|
-
y,
|
|
2184
|
-
L,
|
|
2185
|
-
l
|
|
2186
|
-
]);
|
|
2187
|
-
const pe = R(
|
|
2188
|
-
(E) => {
|
|
2189
|
-
z(E), l == null || l(E);
|
|
2190
|
-
},
|
|
2191
|
-
[l]
|
|
2192
|
-
), Ne = R(() => {
|
|
2193
|
-
V || z(null);
|
|
2194
|
-
}, [V]), ye = R(
|
|
2195
|
-
async (E) => {
|
|
2196
|
-
var j;
|
|
2197
|
-
if (y)
|
|
2198
|
-
try {
|
|
2199
|
-
L && console.log(
|
|
2200
|
-
"[MessagingShell] Starting conversation with:",
|
|
2201
|
-
E.id
|
|
2202
|
-
);
|
|
2203
|
-
const P = await y.startChannelWithParticipant({
|
|
2204
|
-
id: E.id,
|
|
2205
|
-
name: E.name,
|
|
2206
|
-
email: E.email,
|
|
2207
|
-
phone: E.phone
|
|
2208
|
-
});
|
|
2209
|
-
try {
|
|
2210
|
-
await P.show();
|
|
2211
|
-
} catch ($) {
|
|
2212
|
-
console.warn("[MessagingShell] Failed to unhide channel:", $);
|
|
2213
|
-
}
|
|
2214
|
-
z(P), O(!1), (j = ae.current) == null || j.close(), m == null || m(E);
|
|
2215
|
-
} catch (P) {
|
|
2216
|
-
console.error("[MessagingShell] Failed to start conversation:", P);
|
|
2217
|
-
}
|
|
2218
|
-
},
|
|
2219
|
-
[y, m, L]
|
|
2220
|
-
), le = R(() => {
|
|
2221
|
-
var E;
|
|
2222
|
-
O(!1), (E = ae.current) == null || E.close();
|
|
2223
|
-
}, []), ve = R(
|
|
2224
|
-
(E) => {
|
|
2225
|
-
E.target === ae.current && le();
|
|
2226
|
-
},
|
|
2227
|
-
[le]
|
|
2228
|
-
), we = R(
|
|
2229
|
-
async (E) => {
|
|
2230
|
-
L && console.log("[MessagingShell] Leaving conversation:", E.id), z(null), H(!1), oe.current = null, await K();
|
|
2231
|
-
},
|
|
2232
|
-
[K, L]
|
|
2233
|
-
), _e = R(
|
|
2234
|
-
async (E) => {
|
|
2235
|
-
L && console.log("[MessagingShell] Blocking participant:", E), z(null), H(!1), oe.current = null, await K();
|
|
2236
|
-
},
|
|
2237
|
-
[K, L]
|
|
2238
|
-
), ie = !!W;
|
|
2239
|
-
return ee ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Me, {}) }) : Y ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, { message: Y, onBack: J }) }) : !F || !p ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
|
|
2240
|
-
Ie,
|
|
2241
|
-
{
|
|
2242
|
-
message: "Not connected to messaging service",
|
|
2243
|
-
onBack: J
|
|
2244
|
-
}
|
|
2245
|
-
) }) : X ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, { message: X }) }) : /* @__PURE__ */ i(
|
|
2246
|
-
"div",
|
|
2247
|
-
{
|
|
2248
|
-
className: A(
|
|
2249
|
-
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2250
|
-
s
|
|
2251
|
-
),
|
|
2252
|
-
children: [
|
|
2253
|
-
/* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
|
|
2254
|
-
/* @__PURE__ */ e(
|
|
2255
|
-
"div",
|
|
2256
|
-
{
|
|
2257
|
-
className: A(
|
|
2258
|
-
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2259
|
-
{
|
|
2260
|
-
"!hidden": u === !1 || V,
|
|
2261
|
-
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2262
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !V && ie,
|
|
2263
|
-
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2264
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !V && !ie
|
|
2265
|
-
}
|
|
2266
|
-
),
|
|
2267
|
-
children: /* @__PURE__ */ e(
|
|
2268
|
-
it,
|
|
2269
|
-
{
|
|
2270
|
-
onChannelSelect: pe,
|
|
2271
|
-
selectedChannel: W || void 0,
|
|
2272
|
-
filters: be,
|
|
2273
|
-
channelRenderFilterFn: g,
|
|
2274
|
-
customEmptyStateIndicator: v,
|
|
2275
|
-
renderMessagePreview: D
|
|
2276
|
-
}
|
|
2277
|
-
)
|
|
2278
|
-
}
|
|
2279
|
-
),
|
|
2280
|
-
/* @__PURE__ */ e(
|
|
2281
|
-
"div",
|
|
2282
|
-
{
|
|
2283
|
-
className: A(
|
|
2284
|
-
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2285
|
-
{
|
|
2286
|
-
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2287
|
-
flex: V || ie || r,
|
|
2288
|
-
// Normal mode: hide on mobile when no channel selected
|
|
2289
|
-
"hidden lg:flex": !V && !ie && !r
|
|
2290
|
-
}
|
|
2291
|
-
),
|
|
2292
|
-
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2293
|
-
ht,
|
|
2294
|
-
{
|
|
2295
|
-
channel: W,
|
|
2296
|
-
onBack: Ne,
|
|
2297
|
-
showBackButton: !V,
|
|
2298
|
-
renderMessageInputActions: n,
|
|
2299
|
-
renderConversationFooter: o,
|
|
2300
|
-
renderChannelBanner: f,
|
|
2301
|
-
onLeaveConversation: we,
|
|
2302
|
-
onBlockParticipant: _e,
|
|
2303
|
-
CustomChannelEmptyState: h,
|
|
2304
|
-
showDeleteConversation: De,
|
|
2305
|
-
onDeleteConversationClick: a,
|
|
2306
|
-
onBlockParticipantClick: w,
|
|
2307
|
-
onReportParticipantClick: N,
|
|
2308
|
-
dmAgentEnabled: x,
|
|
2309
|
-
messageMetadata: M,
|
|
2310
|
-
onMessageSent: k,
|
|
2311
|
-
showStarButton: S,
|
|
2312
|
-
chatbotVotingEnabled: I,
|
|
2313
|
-
customProfileContent: d,
|
|
2314
|
-
customChannelActions: C,
|
|
2315
|
-
renderMessage: _
|
|
2316
|
-
},
|
|
2317
|
-
W.id
|
|
2318
|
-
) }) : r ? (
|
|
2319
|
-
// Show loading while creating/loading direct conversation channel
|
|
2320
|
-
/* @__PURE__ */ e(Me, {})
|
|
2321
|
-
) : /* @__PURE__ */ e(
|
|
2322
|
-
ft,
|
|
2323
|
-
{
|
|
2324
|
-
hasChannels: de,
|
|
2325
|
-
channelsLoaded: te
|
|
2326
|
-
}
|
|
2327
|
-
)
|
|
2328
|
-
}
|
|
2329
|
-
)
|
|
2330
|
-
] }),
|
|
2331
|
-
Ce && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2332
|
-
/* @__PURE__ */ e(
|
|
2333
|
-
"dialog",
|
|
2334
|
-
{
|
|
2335
|
-
ref: ae,
|
|
2336
|
-
className: "mes-dialog",
|
|
2337
|
-
onClick: ve,
|
|
2338
|
-
onClose: le,
|
|
2339
|
-
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2340
|
-
sn,
|
|
2341
|
-
{
|
|
2342
|
-
participantSource: Ce,
|
|
2343
|
-
onSelectParticipant: ye,
|
|
2344
|
-
onClose: le,
|
|
2345
|
-
existingParticipantIds: B,
|
|
2346
|
-
participantLabel: re,
|
|
2347
|
-
searchPlaceholder: `Search ${re}...`
|
|
2348
|
-
},
|
|
2349
|
-
se
|
|
2350
|
-
) })
|
|
2351
|
-
}
|
|
2352
|
-
)
|
|
2353
|
-
]
|
|
2354
|
-
}
|
|
2355
|
-
);
|
|
2356
|
-
}, an = ({
|
|
2357
|
-
question: t,
|
|
2358
|
-
onClick: s,
|
|
2359
|
-
loading: n = !1,
|
|
2360
|
-
className: o
|
|
2361
|
-
}) => /* @__PURE__ */ e(
|
|
2362
|
-
"button",
|
|
2363
|
-
{
|
|
2364
|
-
type: "button",
|
|
2365
|
-
onClick: s,
|
|
2366
|
-
disabled: n,
|
|
2367
|
-
style: { backgroundColor: "#E6E5E3" },
|
|
2368
|
-
className: A(
|
|
2369
|
-
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2370
|
-
{
|
|
2371
|
-
"hover:brightness-95 active:brightness-90": !n,
|
|
2372
|
-
"opacity-50 cursor-not-allowed": n
|
|
2373
|
-
},
|
|
2374
|
-
o
|
|
2375
|
-
),
|
|
2376
|
-
children: t
|
|
2377
|
-
}
|
|
2378
|
-
), xn = ({
|
|
2379
|
-
faqs: t,
|
|
2380
|
-
onFaqClick: s,
|
|
2381
|
-
loadingFaqId: n,
|
|
2382
|
-
headerText: o,
|
|
2383
|
-
className: l,
|
|
2384
|
-
avatarImage: m,
|
|
2385
|
-
avatarName: r
|
|
2386
|
-
}) => {
|
|
2387
|
-
const c = t.filter((h) => h.enabled).sort((h, u) => (h.order ?? 0) - (u.order ?? 0));
|
|
2388
|
-
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2389
|
-
(m || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2390
|
-
ce,
|
|
2391
|
-
{
|
|
2392
|
-
id: r || "account",
|
|
2393
|
-
name: r || "Account",
|
|
2394
|
-
image: m,
|
|
2395
|
-
size: 24,
|
|
2396
|
-
shape: "circle"
|
|
2397
|
-
}
|
|
2398
|
-
) }),
|
|
2399
|
-
/* @__PURE__ */ i(
|
|
2400
|
-
"div",
|
|
2401
|
-
{
|
|
2402
|
-
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
2403
|
-
style: { backgroundColor: "#F1F0EE" },
|
|
2404
|
-
children: [
|
|
2405
|
-
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2406
|
-
c.map((h) => /* @__PURE__ */ e(
|
|
2407
|
-
an,
|
|
2408
|
-
{
|
|
2409
|
-
question: h.question,
|
|
2410
|
-
onClick: () => s(h.id),
|
|
2411
|
-
loading: n === h.id
|
|
2412
|
-
},
|
|
2413
|
-
h.id
|
|
2414
|
-
))
|
|
2415
|
-
]
|
|
2416
|
-
}
|
|
2417
|
-
)
|
|
2418
|
-
] }) });
|
|
2419
|
-
}, bn = (t, s = {}) => {
|
|
2420
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = T([]), [r, c] = T(!1), [h, u] = T(null), [b, g] = T(n), [v, a] = T(!0), [w, N] = T(), x = R(async (I = !1, D) => {
|
|
2421
|
-
if (r) return;
|
|
2422
|
-
const f = D !== void 0 ? D : b;
|
|
2423
|
-
c(!0), u(null);
|
|
2424
|
-
try {
|
|
2425
|
-
const d = await t.loadParticipants({
|
|
2426
|
-
search: f || void 0,
|
|
2427
|
-
limit: o,
|
|
2428
|
-
cursor: I ? void 0 : w
|
|
2429
|
-
});
|
|
2430
|
-
m(
|
|
2431
|
-
(C) => I ? d.participants : [...C, ...d.participants]
|
|
2432
|
-
), a(d.hasMore), N(d.nextCursor);
|
|
2433
|
-
} catch (d) {
|
|
2434
|
-
const C = d instanceof Error ? d.message : "Failed to load participants";
|
|
2435
|
-
u(C), console.error("[useParticipants] Load error:", d);
|
|
2436
|
-
} finally {
|
|
2437
|
-
c(!1);
|
|
2438
|
-
}
|
|
2439
|
-
}, [t, b, w, o, r]), M = R(() => {
|
|
2440
|
-
v && !r && x(!1);
|
|
2441
|
-
}, [v, r, x]), k = R((I) => {
|
|
2442
|
-
g(I), N(void 0), x(!0, I);
|
|
2443
|
-
}, [x]), S = R(() => {
|
|
2444
|
-
N(void 0), x(!0);
|
|
2445
|
-
}, [x]);
|
|
2446
|
-
return Z(() => {
|
|
2447
|
-
x(!0);
|
|
2448
|
-
}, [t.loadParticipants]), {
|
|
2449
|
-
participants: l,
|
|
2450
|
-
loading: r,
|
|
2451
|
-
error: h,
|
|
2452
|
-
searchQuery: b,
|
|
2453
|
-
hasMore: v,
|
|
2454
|
-
totalCount: t.totalCount,
|
|
2455
|
-
loadMore: M,
|
|
2456
|
-
search: k,
|
|
2457
|
-
refresh: S
|
|
2458
|
-
};
|
|
2459
|
-
};
|
|
1
|
+
import { A as e, a as t, C as i, b as n, c as o, d as g, F as r, e as m, L as u, f as M, h as c, i as l, j as h, P as C, k as P, u as d, l as L, m as p, n as v } from "./index-BePLvyvi.js";
|
|
2460
2
|
export {
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
3
|
+
e as ActionButton,
|
|
4
|
+
t as Avatar,
|
|
5
|
+
i as ChannelEmptyState,
|
|
6
|
+
n as ChannelList,
|
|
7
|
+
o as ChannelView,
|
|
8
|
+
g as CustomMessageProvider,
|
|
9
|
+
r as FaqList,
|
|
10
|
+
m as FaqListItem,
|
|
11
|
+
u as LockedAttachment,
|
|
12
|
+
M as MediaMessage,
|
|
13
|
+
c as MessageVoteButtons,
|
|
14
|
+
l as MessagingProvider,
|
|
15
|
+
h as MessagingShell,
|
|
16
|
+
C as ParticipantPicker,
|
|
17
|
+
P as formatRelativeTime,
|
|
18
|
+
d as useCustomMessage,
|
|
19
|
+
L as useMessageVote,
|
|
20
|
+
p as useMessaging,
|
|
21
|
+
v as useParticipants
|
|
2479
22
|
};
|
|
2480
23
|
//# sourceMappingURL=index.js.map
|