@linktr.ee/messaging-react 1.22.2-rc-1772424036 → 1.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import R from "classnames";
|
|
3
|
-
import A, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { GiftIcon as
|
|
3
|
+
import A, { createContext as st, useContext as nt, useCallback as P, useState as _, useRef as q, useEffect as Y, useMemo as ye } from "react";
|
|
4
|
+
import { StreamChatService as at } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as rt, ChannelList as ot, DateSeparator as lt, useChannelStateContext as Ie, useChatContext as Be, areMessageUIPropsEqual as it, useMessageReminder as ct, useComponentContext as dt, Attachment as ut, EditMessageModal as mt, MessageBlocked as ht, MessageBouncePrompt as ft, MessageDeleted as gt, MessageIsThreadReplyInChannelButtonIndicator as xt, MessageRepliesCountButton as bt, ReminderNotification as Ct, StreamedMessageText as Nt, messageHasAttachments as vt, messageHasReactions as wt, isDateSeparatorMessage as pt, isMessageBlocked as yt, isMessageBounced as Et, MessageBounceModal as _t, Poll as It, MessageText as St, MessageErrorIcon as Mt, useMessageContext as kt, useMessageComposer as Dt, useStateStore as Tt, MessageInput as Rt, useMessageInputContext as Lt, useMessageComposerHasSendableData as Pt, SimpleAttachmentSelector as Ut, QuotedMessagePreview as Ft, AttachmentPreviewList as Ot, TextareaComposer as At, MessageTimestamp as De, Channel as Bt, WithComponents as $t, Window as jt, MessageList as Gt } from "stream-chat-react";
|
|
6
|
+
import { GiftIcon as Ht, XIcon as Se, ArrowUpIcon as Vt, SparkleIcon as zt, ArrowLeftIcon as Te, StarIcon as Re, DotsThreeIcon as Le, SpinnerGapIcon as xe, SignOutIcon as Wt, ProhibitInsetIcon as Pe, FlagIcon as qt, MagnifyingGlassIcon as Yt, ChatCircleDotsIcon as Ue } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as Fe } from "stream-chat";
|
|
8
|
-
const $e =
|
|
8
|
+
const $e = st({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const $e = tt({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), Ne = () =>
|
|
18
|
+
}), Ne = () => nt($e), $s = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -35,7 +35,7 @@ const $e = tt({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [m,
|
|
38
|
+
const [m, g] = _(null), [x, N] = _(null), [b, w] = _(!1), [a, y] = _(!1), [I, v] = _(null), S = q(!1), C = q({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
@@ -45,12 +45,12 @@ const $e = tt({
|
|
|
45
45
|
renderCount: h.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: C.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: C.current.apiKey !== r,
|
|
50
|
+
serviceConfigChanged: C.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: C.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), C.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
@@ -64,8 +64,8 @@ const $e = tt({
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: C.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: C.current.apiKey === r
|
|
69
69
|
}
|
|
70
70
|
}), !r || !n) {
|
|
71
71
|
o("⚠️ SERVICE INIT SKIPPED", {
|
|
@@ -77,14 +77,14 @@ const $e = tt({
|
|
|
77
77
|
o("🚀 CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: c,
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: C.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const d = new
|
|
82
|
+
const d = new at({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
85
|
debug: u
|
|
86
86
|
});
|
|
87
|
-
return
|
|
87
|
+
return g(d), o("✅ SERVICE SET", {
|
|
88
88
|
renderCount: c,
|
|
89
89
|
serviceInstance: !!d
|
|
90
90
|
}), () => {
|
|
@@ -124,7 +124,7 @@ const $e = tt({
|
|
|
124
124
|
try {
|
|
125
125
|
o("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const k = await m.connectUser(s);
|
|
127
|
-
|
|
127
|
+
N(k), w(!0), p.current = { serviceId: m, userId: s.id }, o("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: k.userID
|
|
130
130
|
});
|
|
@@ -165,7 +165,7 @@ const $e = tt({
|
|
|
165
165
|
try {
|
|
166
166
|
o("🔌 DISCONNECTING FOR REFRESH"), await m.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
|
|
167
167
|
const c = await m.connectUser(s);
|
|
168
|
-
|
|
168
|
+
N(c), w(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (c) {
|
|
170
170
|
const d = c instanceof Error ? c.message : "Refresh failed";
|
|
171
171
|
v(d), o("❌ CONNECTION REFRESH ERROR", {
|
|
@@ -177,14 +177,14 @@ const $e = tt({
|
|
|
177
177
|
}
|
|
178
178
|
}, [m, s, o]), f = A.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!m,
|
|
180
|
-
hasClient: !!
|
|
180
|
+
hasClient: !!x,
|
|
181
181
|
isConnected: b,
|
|
182
182
|
isLoading: a,
|
|
183
183
|
hasError: !!I,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: m,
|
|
187
|
-
client:
|
|
187
|
+
client: x,
|
|
188
188
|
isConnected: b,
|
|
189
189
|
isLoading: a,
|
|
190
190
|
error: I,
|
|
@@ -193,7 +193,7 @@ const $e = tt({
|
|
|
193
193
|
debug: u
|
|
194
194
|
}), [
|
|
195
195
|
m,
|
|
196
|
-
|
|
196
|
+
x,
|
|
197
197
|
b,
|
|
198
198
|
a,
|
|
199
199
|
I,
|
|
@@ -204,30 +204,36 @@ const $e = tt({
|
|
|
204
204
|
]);
|
|
205
205
|
return o("🔄 RENDER END", {
|
|
206
206
|
renderCount: h.current,
|
|
207
|
-
willRenderChat: !!(
|
|
207
|
+
willRenderChat: !!(x && b),
|
|
208
208
|
contextValueReady: !!f
|
|
209
|
-
}), /* @__PURE__ */ e($e.Provider, { value: f, children:
|
|
210
|
-
|
|
209
|
+
}), /* @__PURE__ */ e($e.Provider, { value: f, children: x && b ? /* @__PURE__ */ e(
|
|
210
|
+
rt,
|
|
211
211
|
{
|
|
212
|
-
client:
|
|
212
|
+
client: x,
|
|
213
213
|
customClasses: {
|
|
214
214
|
channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
|
|
215
215
|
},
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, Zt = () => Ne(), je = A.createContext({
|
|
220
|
+
selectedChannel: void 0,
|
|
221
|
+
onChannelSelect: () => {
|
|
222
|
+
},
|
|
223
|
+
debug: !1,
|
|
224
|
+
renderMessagePreview: void 0
|
|
225
|
+
}), Jt = je.Provider, Qt = () => A.useContext(je), Xt = (t, s) => {
|
|
220
226
|
const n = new Date(
|
|
221
227
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
228
|
), l = new Date(
|
|
223
229
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
224
230
|
).getTime() - n.getTime();
|
|
225
231
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
226
|
-
},
|
|
232
|
+
}, Kt = (t) => {
|
|
227
233
|
const s = /* @__PURE__ */ new Date();
|
|
228
234
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
229
235
|
return "Just now";
|
|
230
|
-
const r =
|
|
236
|
+
const r = Xt(t, s);
|
|
231
237
|
return r === 0 ? t.toLocaleTimeString([], {
|
|
232
238
|
hour: "numeric",
|
|
233
239
|
minute: "2-digit",
|
|
@@ -265,7 +271,7 @@ const $e = tt({
|
|
|
265
271
|
"🍈"
|
|
266
272
|
// Melon
|
|
267
273
|
];
|
|
268
|
-
function
|
|
274
|
+
function es(t) {
|
|
269
275
|
let s = 0;
|
|
270
276
|
for (let n = 0; n < t.length; n++) {
|
|
271
277
|
const r = t.charCodeAt(n);
|
|
@@ -273,8 +279,8 @@ function Qt(t) {
|
|
|
273
279
|
}
|
|
274
280
|
return Math.abs(s);
|
|
275
281
|
}
|
|
276
|
-
function
|
|
277
|
-
const n =
|
|
282
|
+
function ts(t) {
|
|
283
|
+
const n = es(t) % Oe.length;
|
|
278
284
|
return Oe[n];
|
|
279
285
|
}
|
|
280
286
|
const ee = ({
|
|
@@ -284,7 +290,7 @@ const ee = ({
|
|
|
284
290
|
className: r,
|
|
285
291
|
shape: l = "squircle"
|
|
286
292
|
}) => {
|
|
287
|
-
const u =
|
|
293
|
+
const u = ts(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", g = l === "circle" ? { borderRadius: "50%" } : {
|
|
288
294
|
borderRadius: "33%",
|
|
289
295
|
"corner-shape": "superellipse(1.3)"
|
|
290
296
|
};
|
|
@@ -295,7 +301,7 @@ const ee = ({
|
|
|
295
301
|
style: {
|
|
296
302
|
width: `${n}px`,
|
|
297
303
|
height: `${n}px`,
|
|
298
|
-
...
|
|
304
|
+
...g
|
|
299
305
|
},
|
|
300
306
|
children: s ? /* @__PURE__ */ e(
|
|
301
307
|
"img",
|
|
@@ -317,7 +323,7 @@ const ee = ({
|
|
|
317
323
|
)
|
|
318
324
|
}
|
|
319
325
|
);
|
|
320
|
-
},
|
|
326
|
+
}, ss = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
321
327
|
"svg",
|
|
322
328
|
{
|
|
323
329
|
width: t,
|
|
@@ -334,18 +340,18 @@ const ee = ({
|
|
|
334
340
|
}
|
|
335
341
|
)
|
|
336
342
|
}
|
|
337
|
-
),
|
|
343
|
+
), ns = (t) => {
|
|
338
344
|
var s;
|
|
339
345
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
340
|
-
},
|
|
346
|
+
}, as = (t) => {
|
|
341
347
|
var s;
|
|
342
348
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
343
349
|
}, Me = (t) => {
|
|
344
350
|
var s;
|
|
345
351
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
346
|
-
},
|
|
352
|
+
}, Ge = (t) => ns(t) || as(t), rs = (t) => {
|
|
347
353
|
var s;
|
|
348
|
-
return
|
|
354
|
+
return Ge(t) && !((s = t.text) != null && s.trim());
|
|
349
355
|
}, pe = ({
|
|
350
356
|
message: t,
|
|
351
357
|
standalone: s = !1,
|
|
@@ -353,7 +359,7 @@ const ee = ({
|
|
|
353
359
|
hasAttachment: r = !1
|
|
354
360
|
}) => {
|
|
355
361
|
var b;
|
|
356
|
-
const l =
|
|
362
|
+
const l = Ge(t), u = Me(t);
|
|
357
363
|
if (!l && !u)
|
|
358
364
|
return null;
|
|
359
365
|
if (l) {
|
|
@@ -361,43 +367,36 @@ const ee = ({
|
|
|
361
367
|
if (!w) return null;
|
|
362
368
|
const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${w} tip` : `Delivered with ${w} tip`;
|
|
363
369
|
return /* @__PURE__ */ i("div", { className: a, children: [
|
|
364
|
-
/* @__PURE__ */ e(
|
|
370
|
+
/* @__PURE__ */ e(Ht, { size: s ? 14 : 12 }),
|
|
365
371
|
/* @__PURE__ */ e("span", { children: y })
|
|
366
372
|
] });
|
|
367
373
|
}
|
|
368
|
-
const o = n && r, m = o ? "Sent with AI" : "Sent with DM Agent",
|
|
374
|
+
const o = n && r, m = o ? "Sent with AI" : "Sent with DM Agent", g = [
|
|
369
375
|
"message-chatbot-indicator",
|
|
370
376
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
371
377
|
o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
372
|
-
].join(" "),
|
|
373
|
-
return /* @__PURE__ */ e("div", { className:
|
|
374
|
-
|
|
375
|
-
|
|
378
|
+
].join(" "), x = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: m }), N = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(ss, { size: o ? 12 : 15 }) });
|
|
379
|
+
return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !o ? /* @__PURE__ */ i(ce, { children: [
|
|
380
|
+
x,
|
|
381
|
+
N
|
|
376
382
|
] }) : /* @__PURE__ */ i(ce, { children: [
|
|
377
|
-
|
|
378
|
-
|
|
383
|
+
N,
|
|
384
|
+
x
|
|
379
385
|
] }) });
|
|
380
|
-
},
|
|
381
|
-
({
|
|
382
|
-
channel: t,
|
|
383
|
-
selectedChannel: s,
|
|
384
|
-
onChannelSelect: n,
|
|
385
|
-
debug: r = !1,
|
|
386
|
-
unread: l,
|
|
387
|
-
renderMessagePreview: u
|
|
388
|
-
}) => {
|
|
386
|
+
}, He = A.memo(
|
|
387
|
+
({ channel: t, unread: s }) => {
|
|
389
388
|
var p, T, f, c;
|
|
390
|
-
const o = (
|
|
391
|
-
t &&
|
|
392
|
-
},
|
|
389
|
+
const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: u } = Qt(), o = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), m = () => {
|
|
390
|
+
t && r(t);
|
|
391
|
+
}, g = (d) => {
|
|
393
392
|
const M = d.key === "Enter" || d.key === " ", k = d.repeat;
|
|
394
393
|
!M || k || (d.preventDefault(), m());
|
|
395
|
-
},
|
|
394
|
+
}, N = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
|
|
396
395
|
(d) => {
|
|
397
396
|
var M, k;
|
|
398
397
|
return ((M = d.user) == null ? void 0 : M.id) && d.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
|
|
399
398
|
}
|
|
400
|
-
), b = ((T =
|
|
399
|
+
), b = ((T = N == null ? void 0 : N.user) == null ? void 0 : T.name) || "Conversation", w = (f = N == null ? void 0 : N.user) == null ? void 0 : f.image, a = (() => {
|
|
401
400
|
var M;
|
|
402
401
|
const d = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
|
|
403
402
|
if (d != null && d.length) {
|
|
@@ -409,8 +408,8 @@ const ee = ({
|
|
|
409
408
|
if (a != null && a.text) return a.text;
|
|
410
409
|
const d = (M = a == null ? void 0 : a.attachments) == null ? void 0 : M[0];
|
|
411
410
|
return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "📷 Sent an image" : d.type === "video" ? "🎥 Sent a video" : d.type === "audio" ? "🎵 Sent audio" : d.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
412
|
-
})(), v = a != null && a.created_at ?
|
|
413
|
-
return
|
|
411
|
+
})(), v = a != null && a.created_at ? Kt(new Date(a.created_at)) : "", S = a ? Me(a) : !1, C = u ? u(a, I) : `${S ? "✨ " : ""}${I}`, h = s ?? 0;
|
|
412
|
+
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
414
413
|
channelId: t == null ? void 0 : t.id,
|
|
415
414
|
isSelected: o,
|
|
416
415
|
participantName: b,
|
|
@@ -422,7 +421,7 @@ const ee = ({
|
|
|
422
421
|
role: "button",
|
|
423
422
|
tabIndex: 0,
|
|
424
423
|
onClick: m,
|
|
425
|
-
onKeyDown:
|
|
424
|
+
onKeyDown: g,
|
|
426
425
|
className: R(
|
|
427
426
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
428
427
|
{
|
|
@@ -434,7 +433,7 @@ const ee = ({
|
|
|
434
433
|
/* @__PURE__ */ e(
|
|
435
434
|
ee,
|
|
436
435
|
{
|
|
437
|
-
id: ((c =
|
|
436
|
+
id: ((c = N == null ? void 0 : N.user) == null ? void 0 : c.id) || t.id || "unknown",
|
|
438
437
|
name: b,
|
|
439
438
|
image: w,
|
|
440
439
|
size: 44,
|
|
@@ -456,7 +455,7 @@ const ee = ({
|
|
|
456
455
|
v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
|
|
457
456
|
] }),
|
|
458
457
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
459
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
458
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: C }),
|
|
460
459
|
h > 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: h > 99 ? "99+" : h })
|
|
461
460
|
] })
|
|
462
461
|
] })
|
|
@@ -465,8 +464,8 @@ const ee = ({
|
|
|
465
464
|
);
|
|
466
465
|
}
|
|
467
466
|
);
|
|
468
|
-
|
|
469
|
-
const
|
|
467
|
+
He.displayName = "CustomChannelPreview";
|
|
468
|
+
const Ve = A.memo(
|
|
470
469
|
({
|
|
471
470
|
onChannelSelect: t,
|
|
472
471
|
selectedChannel: s,
|
|
@@ -483,16 +482,15 @@ const He = A.memo(
|
|
|
483
482
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
484
483
|
filters: n
|
|
485
484
|
});
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
{
|
|
489
|
-
...C,
|
|
485
|
+
const g = A.useMemo(
|
|
486
|
+
() => ({
|
|
490
487
|
selectedChannel: s,
|
|
491
488
|
onChannelSelect: t,
|
|
492
489
|
debug: m,
|
|
493
490
|
renderMessagePreview: u
|
|
494
|
-
}
|
|
495
|
-
|
|
491
|
+
}),
|
|
492
|
+
[s, t, m, u]
|
|
493
|
+
);
|
|
496
494
|
return /* @__PURE__ */ e(
|
|
497
495
|
"div",
|
|
498
496
|
{
|
|
@@ -500,22 +498,22 @@ const He = A.memo(
|
|
|
500
498
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
501
499
|
r
|
|
502
500
|
),
|
|
503
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
504
|
-
|
|
501
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Jt, { value: g, children: /* @__PURE__ */ e(
|
|
502
|
+
ot,
|
|
505
503
|
{
|
|
506
504
|
filters: n,
|
|
507
505
|
sort: { last_message_at: -1 },
|
|
508
506
|
options: { limit: 30 },
|
|
509
|
-
Preview:
|
|
507
|
+
Preview: He,
|
|
510
508
|
EmptyStateIndicator: l
|
|
511
509
|
},
|
|
512
510
|
JSON.stringify(n)
|
|
513
|
-
) })
|
|
511
|
+
) }) })
|
|
514
512
|
}
|
|
515
513
|
);
|
|
516
514
|
}
|
|
517
515
|
);
|
|
518
|
-
|
|
516
|
+
Ve.displayName = "ChannelList";
|
|
519
517
|
const ge = ({
|
|
520
518
|
variant: t = "default",
|
|
521
519
|
className: s,
|
|
@@ -555,16 +553,16 @@ function ze({ label: t, className: s, children: n, ...r }) {
|
|
|
555
553
|
}
|
|
556
554
|
);
|
|
557
555
|
}
|
|
558
|
-
function
|
|
556
|
+
function We({ onClick: t }) {
|
|
559
557
|
return /* @__PURE__ */ e(ze, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
560
558
|
}
|
|
561
|
-
const
|
|
562
|
-
function
|
|
559
|
+
const os = (t) => /* @__PURE__ */ e(lt, { ...t, position: "center" }), Ee = "vote_up", _e = "vote_down";
|
|
560
|
+
function ls(t) {
|
|
563
561
|
return t != null && t.length ? t.some((s) => s.type === _e) ? "down" : t.some((s) => s.type === Ee) ? "up" : null : null;
|
|
564
562
|
}
|
|
565
|
-
function
|
|
563
|
+
function is(t) {
|
|
566
564
|
const { channel: s } = Ie(), { client: n } = Be("useMessageVote"), r = ye(
|
|
567
|
-
() =>
|
|
565
|
+
() => ls(t.own_reactions),
|
|
568
566
|
[t.own_reactions]
|
|
569
567
|
), l = P(async () => {
|
|
570
568
|
if (n != null && n.userID)
|
|
@@ -589,7 +587,7 @@ function rs(t) {
|
|
|
589
587
|
}, [s, n == null ? void 0 : n.userID, t.id, r]);
|
|
590
588
|
return { selected: r, voteUp: l, voteDown: u };
|
|
591
589
|
}
|
|
592
|
-
const
|
|
590
|
+
const cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
593
591
|
"path",
|
|
594
592
|
{
|
|
595
593
|
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",
|
|
@@ -599,7 +597,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
599
597
|
strokeLinejoin: "round",
|
|
600
598
|
fill: t ? "currentColor" : "none"
|
|
601
599
|
}
|
|
602
|
-
) }),
|
|
600
|
+
) }), ds = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
603
601
|
"path",
|
|
604
602
|
{
|
|
605
603
|
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",
|
|
@@ -609,7 +607,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
609
607
|
strokeLinejoin: "round",
|
|
610
608
|
fill: t ? "currentColor" : "none"
|
|
611
609
|
}
|
|
612
|
-
) }),
|
|
610
|
+
) }), us = ({
|
|
613
611
|
selected: t,
|
|
614
612
|
onVoteUp: s,
|
|
615
613
|
onVoteDown: n
|
|
@@ -622,7 +620,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
622
620
|
onClick: s,
|
|
623
621
|
"aria-label": "Helpful",
|
|
624
622
|
"aria-pressed": t === "up",
|
|
625
|
-
children: /* @__PURE__ */ e(
|
|
623
|
+
children: /* @__PURE__ */ e(cs, { filled: t === "up" })
|
|
626
624
|
}
|
|
627
625
|
),
|
|
628
626
|
/* @__PURE__ */ e(
|
|
@@ -633,10 +631,10 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
633
631
|
onClick: n,
|
|
634
632
|
"aria-label": "Not helpful",
|
|
635
633
|
"aria-pressed": t === "down",
|
|
636
|
-
children: /* @__PURE__ */ e(
|
|
634
|
+
children: /* @__PURE__ */ e(ds, { filled: t === "down" })
|
|
637
635
|
}
|
|
638
636
|
)
|
|
639
|
-
] }),
|
|
637
|
+
] }), ms = (t) => {
|
|
640
638
|
var me, K;
|
|
641
639
|
const {
|
|
642
640
|
additionalMessageInputProps: s,
|
|
@@ -646,41 +644,41 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
646
644
|
firstOfGroup: u,
|
|
647
645
|
groupedByUser: o,
|
|
648
646
|
handleAction: m,
|
|
649
|
-
handleOpenThread:
|
|
650
|
-
handleRetry:
|
|
651
|
-
highlighted:
|
|
647
|
+
handleOpenThread: g,
|
|
648
|
+
handleRetry: x,
|
|
649
|
+
highlighted: N,
|
|
652
650
|
isMessageAIGenerated: b,
|
|
653
651
|
isMyMessage: w,
|
|
654
652
|
message: a,
|
|
655
653
|
renderText: y,
|
|
656
654
|
threadList: I
|
|
657
|
-
} = t, { client: v } = Be("CustomMessage"), [S,
|
|
658
|
-
Attachment: c =
|
|
659
|
-
EditMessageModal: d =
|
|
660
|
-
MessageBlocked: M =
|
|
661
|
-
MessageBouncePrompt: k =
|
|
662
|
-
MessageDeleted: B =
|
|
663
|
-
MessageIsThreadReplyInChannelButtonIndicator: D =
|
|
664
|
-
MessageRepliesCountButton: W =
|
|
665
|
-
ReminderNotification:
|
|
666
|
-
StreamedMessageText: te =
|
|
655
|
+
} = t, { client: v } = Be("CustomMessage"), [S, C] = _(!1), h = ct(a.id), { selected: p, voteUp: T, voteDown: f } = is(a), {
|
|
656
|
+
Attachment: c = ut,
|
|
657
|
+
EditMessageModal: d = mt,
|
|
658
|
+
MessageBlocked: M = ht,
|
|
659
|
+
MessageBouncePrompt: k = ft,
|
|
660
|
+
MessageDeleted: B = gt,
|
|
661
|
+
MessageIsThreadReplyInChannelButtonIndicator: D = xt,
|
|
662
|
+
MessageRepliesCountButton: W = bt,
|
|
663
|
+
ReminderNotification: V = Ct,
|
|
664
|
+
StreamedMessageText: te = Nt,
|
|
667
665
|
PinIndicator: J
|
|
668
|
-
} =
|
|
666
|
+
} = dt("CustomMessage"), se = vt(a), ne = wt(a), ie = ye(
|
|
669
667
|
() => b == null ? void 0 : b(a),
|
|
670
668
|
[b, a]
|
|
671
669
|
), $ = ye(
|
|
672
670
|
() => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
|
|
673
671
|
[a]
|
|
674
672
|
);
|
|
675
|
-
if (
|
|
673
|
+
if (pt(a))
|
|
676
674
|
return null;
|
|
677
675
|
if (a.deleted_at || a.type === "deleted")
|
|
678
676
|
return /* @__PURE__ */ e(B, { message: a });
|
|
679
|
-
if (
|
|
677
|
+
if (yt(a))
|
|
680
678
|
return /* @__PURE__ */ e(M, {});
|
|
681
|
-
const Q = !I && !!a.reply_count, U = !I && a.show_in_channel && a.parent_id, F = a.status === "failed" && ((me = a.error) == null ? void 0 : me.status) !== 403,
|
|
679
|
+
const Q = !I && !!a.reply_count, U = !I && a.show_in_channel && a.parent_id, F = a.status === "failed" && ((me = a.error) == null ? void 0 : me.status) !== 403, z = Et(a);
|
|
682
680
|
let L;
|
|
683
|
-
F ? L = () =>
|
|
681
|
+
F ? L = () => x(a) : z && (L = () => C(!0));
|
|
684
682
|
const G = w(), de = R(
|
|
685
683
|
"str-chat__message str-chat__message-simple",
|
|
686
684
|
`str-chat__message--${a.type}`,
|
|
@@ -689,7 +687,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
689
687
|
a.text ? "str-chat__message--has-text" : "has-no-text",
|
|
690
688
|
{
|
|
691
689
|
"str-chat__message--has-attachment": se,
|
|
692
|
-
"str-chat__message--highlighted":
|
|
690
|
+
"str-chat__message--highlighted": N,
|
|
693
691
|
"str-chat__message--pinned pinned-message": a.pinned,
|
|
694
692
|
"str-chat__message--with-reactions": ne,
|
|
695
693
|
"str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((K = a == null ? void 0 : a.error) == null ? void 0 : K.status) !== 403,
|
|
@@ -698,7 +696,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
698
696
|
"str-chat__virtual-message__wrapper--first": u,
|
|
699
697
|
"str-chat__virtual-message__wrapper--group": o
|
|
700
698
|
}
|
|
701
|
-
), Z = a.poll_id && v.polls.fromState(a.poll_id), ae =
|
|
699
|
+
), Z = a.poll_id && v.polls.fromState(a.poll_id), ae = rs(a), X = Me(a), re = !!($ != null && $.length && !a.quoted_message), ue = X && G && re;
|
|
702
700
|
return /* @__PURE__ */ i(ce, { children: [
|
|
703
701
|
r && /* @__PURE__ */ e(
|
|
704
702
|
d,
|
|
@@ -707,16 +705,16 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
707
705
|
}
|
|
708
706
|
),
|
|
709
707
|
S && /* @__PURE__ */ e(
|
|
710
|
-
|
|
708
|
+
_t,
|
|
711
709
|
{
|
|
712
710
|
MessageBouncePrompt: k,
|
|
713
|
-
onClose: () =>
|
|
711
|
+
onClose: () => C(!1),
|
|
714
712
|
open: S
|
|
715
713
|
}
|
|
716
714
|
),
|
|
717
715
|
/* @__PURE__ */ i("div", { className: de, children: [
|
|
718
716
|
J && /* @__PURE__ */ e(J, {}),
|
|
719
|
-
!!h && /* @__PURE__ */ e(
|
|
717
|
+
!!h && /* @__PURE__ */ e(V, { reminder: h }),
|
|
720
718
|
a.user && /* @__PURE__ */ e(
|
|
721
719
|
ee,
|
|
722
720
|
{
|
|
@@ -730,7 +728,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
730
728
|
"div",
|
|
731
729
|
{
|
|
732
730
|
className: R("str-chat__message-inner", {
|
|
733
|
-
"str-chat__simple-message--error-failed": F ||
|
|
731
|
+
"str-chat__simple-message--error-failed": F || z
|
|
734
732
|
}),
|
|
735
733
|
"data-testid": "message-inner",
|
|
736
734
|
onClick: L,
|
|
@@ -756,7 +754,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
756
754
|
isMyMessage: G
|
|
757
755
|
}
|
|
758
756
|
),
|
|
759
|
-
Z && /* @__PURE__ */ e(
|
|
757
|
+
Z && /* @__PURE__ */ e(It, { poll: Z }),
|
|
760
758
|
$ != null && $.length && !a.quoted_message ? /* @__PURE__ */ e(
|
|
761
759
|
c,
|
|
762
760
|
{
|
|
@@ -770,8 +768,8 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
770
768
|
message: a,
|
|
771
769
|
renderText: y
|
|
772
770
|
}
|
|
773
|
-
) : /* @__PURE__ */ e(
|
|
774
|
-
/* @__PURE__ */ e(
|
|
771
|
+
) : /* @__PURE__ */ e(St, { message: a, renderText: y }),
|
|
772
|
+
/* @__PURE__ */ e(Mt, {})
|
|
775
773
|
] }),
|
|
776
774
|
(!X || ue) && /* @__PURE__ */ e(
|
|
777
775
|
pe,
|
|
@@ -782,7 +780,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
782
780
|
}
|
|
783
781
|
),
|
|
784
782
|
n && X && /* @__PURE__ */ e(
|
|
785
|
-
|
|
783
|
+
us,
|
|
786
784
|
{
|
|
787
785
|
selected: p,
|
|
788
786
|
onVoteUp: T,
|
|
@@ -795,24 +793,24 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
795
793
|
Q && /* @__PURE__ */ e(
|
|
796
794
|
W,
|
|
797
795
|
{
|
|
798
|
-
onClick:
|
|
796
|
+
onClick: g,
|
|
799
797
|
reply_count: a.reply_count
|
|
800
798
|
}
|
|
801
799
|
),
|
|
802
800
|
U && /* @__PURE__ */ e(D, {})
|
|
803
801
|
] }, a.id)
|
|
804
802
|
] });
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
),
|
|
809
|
-
const s =
|
|
810
|
-
return /* @__PURE__ */ e(
|
|
811
|
-
},
|
|
803
|
+
}, hs = A.memo(
|
|
804
|
+
ms,
|
|
805
|
+
it
|
|
806
|
+
), fs = (t) => {
|
|
807
|
+
const s = kt("CustomMessage");
|
|
808
|
+
return /* @__PURE__ */ e(hs, { ...s, ...t });
|
|
809
|
+
}, gs = (t) => ({
|
|
812
810
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
813
811
|
(s) => Fe.previewIsLoaded(s) || Fe.previewIsLoading(s)
|
|
814
812
|
)
|
|
815
|
-
}),
|
|
813
|
+
}), xs = ({
|
|
816
814
|
link: t,
|
|
817
815
|
onDismiss: s
|
|
818
816
|
}) => {
|
|
@@ -852,32 +850,32 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
852
850
|
]
|
|
853
851
|
}
|
|
854
852
|
);
|
|
855
|
-
},
|
|
856
|
-
const { linkPreviewsManager: t } =
|
|
853
|
+
}, bs = () => {
|
|
854
|
+
const { linkPreviewsManager: t } = Dt(), { linkPreviews: s } = Tt(
|
|
857
855
|
t.state,
|
|
858
|
-
|
|
856
|
+
gs
|
|
859
857
|
), n = (l) => {
|
|
860
858
|
t.dismissPreview(l);
|
|
861
859
|
};
|
|
862
860
|
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(
|
|
863
|
-
|
|
861
|
+
xs,
|
|
864
862
|
{
|
|
865
863
|
link: l,
|
|
866
864
|
onDismiss: n
|
|
867
865
|
},
|
|
868
866
|
l.og_scrape_url
|
|
869
867
|
)) }) : null;
|
|
870
|
-
},
|
|
871
|
-
const { handleSubmit: t } =
|
|
868
|
+
}, Cs = () => {
|
|
869
|
+
const { handleSubmit: t } = Lt(), s = Pt();
|
|
872
870
|
return /* @__PURE__ */ i(ce, { children: [
|
|
873
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
871
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ut, {}) }),
|
|
874
872
|
/* @__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: [
|
|
875
|
-
/* @__PURE__ */ e(Ut, {}),
|
|
876
|
-
/* @__PURE__ */ e(fs, {}),
|
|
877
873
|
/* @__PURE__ */ e(Ft, {}),
|
|
874
|
+
/* @__PURE__ */ e(bs, {}),
|
|
875
|
+
/* @__PURE__ */ e(Ot, {}),
|
|
878
876
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
879
877
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
880
|
-
|
|
878
|
+
At,
|
|
881
879
|
{
|
|
882
880
|
className: "w-full resize-none outline-none leading-6",
|
|
883
881
|
autoFocus: !0,
|
|
@@ -893,24 +891,24 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
893
891
|
disabled: !s,
|
|
894
892
|
onClick: t,
|
|
895
893
|
type: "button",
|
|
896
|
-
children: /* @__PURE__ */ e(
|
|
894
|
+
children: /* @__PURE__ */ e(Vt, { className: "size-4" })
|
|
897
895
|
}
|
|
898
896
|
)
|
|
899
897
|
] })
|
|
900
898
|
] })
|
|
901
899
|
] });
|
|
902
|
-
},
|
|
900
|
+
}, Ns = ({
|
|
903
901
|
renderActions: t
|
|
904
902
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
905
903
|
t && (t == null ? void 0 : t()),
|
|
906
|
-
/* @__PURE__ */ e(
|
|
907
|
-
] }),
|
|
904
|
+
/* @__PURE__ */ e(Rt, { Input: Cs })
|
|
905
|
+
] }), vs = [
|
|
908
906
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
909
907
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
910
|
-
],
|
|
908
|
+
], ws = {
|
|
911
909
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
912
910
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
913
|
-
}, Ae = (t) =>
|
|
911
|
+
}, Ae = (t) => vs.includes(t), ps = (t) => {
|
|
914
912
|
var r;
|
|
915
913
|
const s = (r = t.metadata) == null ? void 0 : r.custom_type;
|
|
916
914
|
if (Ae(s))
|
|
@@ -918,11 +916,11 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
918
916
|
const n = t.dm_agent_system_type;
|
|
919
917
|
if (Ae(n))
|
|
920
918
|
return n;
|
|
921
|
-
},
|
|
919
|
+
}, ys = (t) => {
|
|
922
920
|
var r;
|
|
923
|
-
const s = t.message.hide_date === !0, n =
|
|
921
|
+
const s = t.message.hide_date === !0, n = ps(t.message);
|
|
924
922
|
if (n) {
|
|
925
|
-
const l = ((r = t.message.text) == null ? void 0 : r.trim()) ||
|
|
923
|
+
const l = ((r = t.message.text) == null ? void 0 : r.trim()) || ws[n];
|
|
926
924
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
927
925
|
/* @__PURE__ */ i(
|
|
928
926
|
"div",
|
|
@@ -955,7 +953,7 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
955
953
|
] }),
|
|
956
954
|
!s && /* @__PURE__ */ e(De, { message: t.message })
|
|
957
955
|
] });
|
|
958
|
-
},
|
|
956
|
+
}, Es = () => null, _s = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
959
957
|
"div",
|
|
960
958
|
{
|
|
961
959
|
className: R("flex items-center justify-center h-full", t),
|
|
@@ -999,11 +997,11 @@ const os = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
999
997
|
]
|
|
1000
998
|
}
|
|
1001
999
|
), Ce = A.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1002
|
-
/* @__PURE__ */ e(
|
|
1000
|
+
/* @__PURE__ */ e(_s, { className: "w-6 h-6" }),
|
|
1003
1001
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1004
1002
|
] }) }));
|
|
1005
1003
|
Ce.displayName = "LoadingState";
|
|
1006
|
-
const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150",
|
|
1004
|
+
const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150", Is = ({
|
|
1007
1005
|
onBack: t,
|
|
1008
1006
|
showBackButton: s,
|
|
1009
1007
|
onShowInfo: n,
|
|
@@ -1016,27 +1014,27 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1016
1014
|
var p;
|
|
1017
1015
|
return ((p = h.user) == null ? void 0 : p.id) && h.user.id !== u._client.userID;
|
|
1018
1016
|
}
|
|
1019
|
-
), [u._client.userID, u.state.members]), m = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((a = o == null ? void 0 : o.user) == null ? void 0 : a.id) || "Unknown member",
|
|
1017
|
+
), [u._client.userID, u.state.members]), m = ((w = o == null ? void 0 : o.user) == null ? void 0 : w.name) || ((a = o == null ? void 0 : o.user) == null ? void 0 : a.id) || "Unknown member", g = (y = o == null ? void 0 : o.user) == null ? void 0 : y.image, [x, N] = _(
|
|
1020
1018
|
!!((I = u.state.membership) != null && I.pinned_at)
|
|
1021
1019
|
);
|
|
1022
1020
|
Y(() => {
|
|
1023
|
-
const
|
|
1021
|
+
const C = (h) => {
|
|
1024
1022
|
var p;
|
|
1025
|
-
|
|
1023
|
+
N(
|
|
1026
1024
|
h != null && h.member ? !!h.member.pinned_at : !!((p = u.state.membership) != null && p.pinned_at)
|
|
1027
1025
|
);
|
|
1028
1026
|
};
|
|
1029
|
-
return u.on("member.updated",
|
|
1030
|
-
u.off("member.updated",
|
|
1027
|
+
return u.on("member.updated", C), () => {
|
|
1028
|
+
u.off("member.updated", C);
|
|
1031
1029
|
};
|
|
1032
1030
|
}, [u]);
|
|
1033
1031
|
const b = async () => {
|
|
1034
1032
|
try {
|
|
1035
|
-
|
|
1036
|
-
} catch (
|
|
1033
|
+
x ? await u.unpin() : await u.pin();
|
|
1034
|
+
} catch (C) {
|
|
1037
1035
|
console.error(
|
|
1038
1036
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1039
|
-
|
|
1037
|
+
C
|
|
1040
1038
|
);
|
|
1041
1039
|
}
|
|
1042
1040
|
};
|
|
@@ -1059,7 +1057,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1059
1057
|
{
|
|
1060
1058
|
id: ((v = o == null ? void 0 : o.user) == null ? void 0 : v.id) || u.id || "unknown",
|
|
1061
1059
|
name: m,
|
|
1062
|
-
image:
|
|
1060
|
+
image: g,
|
|
1063
1061
|
size: 40
|
|
1064
1062
|
}
|
|
1065
1063
|
),
|
|
@@ -1072,15 +1070,15 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1072
1070
|
className: le,
|
|
1073
1071
|
onClick: b,
|
|
1074
1072
|
type: "button",
|
|
1075
|
-
"aria-label":
|
|
1073
|
+
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
1076
1074
|
children: /* @__PURE__ */ e(
|
|
1077
1075
|
Re,
|
|
1078
1076
|
{
|
|
1079
1077
|
className: R("size-5", {
|
|
1080
|
-
"text-yellow-600":
|
|
1081
|
-
"text-black/90": !
|
|
1078
|
+
"text-yellow-600": x,
|
|
1079
|
+
"text-black/90": !x
|
|
1082
1080
|
}),
|
|
1083
|
-
weight:
|
|
1081
|
+
weight: x ? "duotone" : "regular"
|
|
1084
1082
|
}
|
|
1085
1083
|
)
|
|
1086
1084
|
}
|
|
@@ -1114,7 +1112,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1114
1112
|
{
|
|
1115
1113
|
id: ((S = o == null ? void 0 : o.user) == null ? void 0 : S.id) || u.id || "unknown",
|
|
1116
1114
|
name: m,
|
|
1117
|
-
image:
|
|
1115
|
+
image: g,
|
|
1118
1116
|
size: 40
|
|
1119
1117
|
}
|
|
1120
1118
|
),
|
|
@@ -1127,15 +1125,15 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1127
1125
|
className: le,
|
|
1128
1126
|
onClick: b,
|
|
1129
1127
|
type: "button",
|
|
1130
|
-
"aria-label":
|
|
1128
|
+
"aria-label": x ? "Unstar conversation" : "Star conversation",
|
|
1131
1129
|
children: /* @__PURE__ */ e(
|
|
1132
1130
|
Re,
|
|
1133
1131
|
{
|
|
1134
1132
|
className: R("size-5", {
|
|
1135
|
-
"text-yellow-600":
|
|
1136
|
-
"text-black/90": !
|
|
1133
|
+
"text-yellow-600": x,
|
|
1134
|
+
"text-black/90": !x
|
|
1137
1135
|
}),
|
|
1138
|
-
weight:
|
|
1136
|
+
weight: x ? "duotone" : "regular"
|
|
1139
1137
|
}
|
|
1140
1138
|
)
|
|
1141
1139
|
}
|
|
@@ -1153,7 +1151,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1153
1151
|
] })
|
|
1154
1152
|
] })
|
|
1155
1153
|
] });
|
|
1156
|
-
},
|
|
1154
|
+
}, Ss = ({
|
|
1157
1155
|
dialogRef: t,
|
|
1158
1156
|
onClose: s,
|
|
1159
1157
|
participant: n,
|
|
@@ -1162,23 +1160,23 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1162
1160
|
onLeaveConversation: u,
|
|
1163
1161
|
onBlockParticipant: o,
|
|
1164
1162
|
showDeleteConversation: m = !0,
|
|
1165
|
-
onDeleteConversationClick:
|
|
1166
|
-
onBlockParticipantClick:
|
|
1167
|
-
onReportParticipantClick:
|
|
1163
|
+
onDeleteConversationClick: g,
|
|
1164
|
+
onBlockParticipantClick: x,
|
|
1165
|
+
onReportParticipantClick: N,
|
|
1168
1166
|
customChannelActions: b
|
|
1169
1167
|
}) => {
|
|
1170
1168
|
var te, J, se, ne, ie, $, Q;
|
|
1171
|
-
const { service: w, debug: a } = Ne(), [y, I] = _(!1), [v, S] = _(!1), [
|
|
1169
|
+
const { service: w, debug: a } = Ne(), [y, I] = _(!1), [v, S] = _(!1), [C, h] = _(!1), p = P(async () => {
|
|
1172
1170
|
var U;
|
|
1173
1171
|
if (!(!w || !((U = n == null ? void 0 : n.user) != null && U.id)))
|
|
1174
1172
|
try {
|
|
1175
|
-
const
|
|
1173
|
+
const z = (await w.getBlockedUsers()).some(
|
|
1176
1174
|
(L) => {
|
|
1177
1175
|
var G;
|
|
1178
1176
|
return L.blocked_user_id === ((G = n == null ? void 0 : n.user) == null ? void 0 : G.id);
|
|
1179
1177
|
}
|
|
1180
1178
|
);
|
|
1181
|
-
I(
|
|
1179
|
+
I(z);
|
|
1182
1180
|
} catch (F) {
|
|
1183
1181
|
console.error(
|
|
1184
1182
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
@@ -1192,7 +1190,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1192
1190
|
const T = async () => {
|
|
1193
1191
|
var U;
|
|
1194
1192
|
if (!v) {
|
|
1195
|
-
|
|
1193
|
+
g == null || g(), a && console.log("[ChannelInfoDialog] Leave conversation", r.cid), S(!0);
|
|
1196
1194
|
try {
|
|
1197
1195
|
const F = ((U = r._client) == null ? void 0 : U.userID) ?? null;
|
|
1198
1196
|
await r.hide(F, !1), u && await u(r), s();
|
|
@@ -1203,11 +1201,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1203
1201
|
}
|
|
1204
1202
|
}
|
|
1205
1203
|
}, f = async () => {
|
|
1206
|
-
var U, F,
|
|
1207
|
-
if (!(
|
|
1208
|
-
|
|
1204
|
+
var U, F, z;
|
|
1205
|
+
if (!(C || !w)) {
|
|
1206
|
+
x == null || x(), a && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
|
|
1209
1207
|
try {
|
|
1210
|
-
await w.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((
|
|
1208
|
+
await w.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), s();
|
|
1211
1209
|
} catch (L) {
|
|
1212
1210
|
console.error("[ChannelInfoDialog] Failed to block member", L);
|
|
1213
1211
|
} finally {
|
|
@@ -1215,11 +1213,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1215
1213
|
}
|
|
1216
1214
|
}
|
|
1217
1215
|
}, c = async () => {
|
|
1218
|
-
var U, F,
|
|
1219
|
-
if (!(
|
|
1220
|
-
|
|
1216
|
+
var U, F, z;
|
|
1217
|
+
if (!(C || !w)) {
|
|
1218
|
+
x == null || x(), a && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), h(!0);
|
|
1221
1219
|
try {
|
|
1222
|
-
await w.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((
|
|
1220
|
+
await w.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), o && await o((z = n == null ? void 0 : n.user) == null ? void 0 : z.id), s();
|
|
1223
1221
|
} catch (L) {
|
|
1224
1222
|
console.error("[ChannelInfoDialog] Failed to unblock member", L);
|
|
1225
1223
|
} finally {
|
|
@@ -1227,14 +1225,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1227
1225
|
}
|
|
1228
1226
|
}
|
|
1229
1227
|
}, d = () => {
|
|
1230
|
-
|
|
1228
|
+
N == null || N(), s(), window.open(
|
|
1231
1229
|
"https://linktr.ee/s/about/trust-center/report",
|
|
1232
1230
|
"_blank",
|
|
1233
1231
|
"noopener,noreferrer"
|
|
1234
1232
|
);
|
|
1235
1233
|
};
|
|
1236
1234
|
if (!n) return null;
|
|
1237
|
-
const M = ((J = n.user) == null ? void 0 : J.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", k = (ne = n.user) == null ? void 0 : ne.image, B = (ie = n.user) == null ? void 0 : ie.email, D = ($ = n.user) == null ? void 0 : $.username, W = B || (D ? `linktr.ee/${D}` : void 0),
|
|
1235
|
+
const M = ((J = n.user) == null ? void 0 : J.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", k = (ne = n.user) == null ? void 0 : ne.image, B = (ie = n.user) == null ? void 0 : ie.email, D = ($ = n.user) == null ? void 0 : $.username, W = B || (D ? `linktr.ee/${D}` : void 0), V = ((Q = n.user) == null ? void 0 : Q.id) || "unknown";
|
|
1238
1236
|
return (
|
|
1239
1237
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1240
1238
|
/* @__PURE__ */ e(
|
|
@@ -1249,7 +1247,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1249
1247
|
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: [
|
|
1250
1248
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1251
1249
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1252
|
-
/* @__PURE__ */ e(
|
|
1250
|
+
/* @__PURE__ */ e(We, { onClick: s })
|
|
1253
1251
|
] }),
|
|
1254
1252
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1255
1253
|
/* @__PURE__ */ e(
|
|
@@ -1261,7 +1259,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1261
1259
|
/* @__PURE__ */ e(
|
|
1262
1260
|
ee,
|
|
1263
1261
|
{
|
|
1264
|
-
id:
|
|
1262
|
+
id: V,
|
|
1265
1263
|
name: M,
|
|
1266
1264
|
image: k,
|
|
1267
1265
|
size: 88,
|
|
@@ -1297,7 +1295,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1297
1295
|
disabled: v,
|
|
1298
1296
|
"aria-busy": v,
|
|
1299
1297
|
children: [
|
|
1300
|
-
v ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
1298
|
+
v ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Wt, { className: "h-5 w-5" }),
|
|
1301
1299
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1302
1300
|
]
|
|
1303
1301
|
}
|
|
@@ -1306,10 +1304,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1306
1304
|
ge,
|
|
1307
1305
|
{
|
|
1308
1306
|
onClick: c,
|
|
1309
|
-
disabled:
|
|
1310
|
-
"aria-busy":
|
|
1307
|
+
disabled: C,
|
|
1308
|
+
"aria-busy": C,
|
|
1311
1309
|
children: [
|
|
1312
|
-
|
|
1310
|
+
C ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
|
|
1313
1311
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1314
1312
|
]
|
|
1315
1313
|
}
|
|
@@ -1317,16 +1315,16 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1317
1315
|
ge,
|
|
1318
1316
|
{
|
|
1319
1317
|
onClick: f,
|
|
1320
|
-
disabled:
|
|
1321
|
-
"aria-busy":
|
|
1318
|
+
disabled: C,
|
|
1319
|
+
"aria-busy": C,
|
|
1322
1320
|
children: [
|
|
1323
|
-
|
|
1321
|
+
C ? /* @__PURE__ */ e(xe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Pe, { className: "h-5 w-5" }),
|
|
1324
1322
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1325
1323
|
]
|
|
1326
1324
|
}
|
|
1327
1325
|
) }),
|
|
1328
1326
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ge, { variant: "danger", onClick: d, children: [
|
|
1329
|
-
/* @__PURE__ */ e(
|
|
1327
|
+
/* @__PURE__ */ e(qt, { className: "h-5 w-5" }),
|
|
1330
1328
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1331
1329
|
] }) }),
|
|
1332
1330
|
b
|
|
@@ -1336,7 +1334,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1336
1334
|
}
|
|
1337
1335
|
)
|
|
1338
1336
|
);
|
|
1339
|
-
},
|
|
1337
|
+
}, Ms = ({
|
|
1340
1338
|
onBack: t,
|
|
1341
1339
|
showBackButton: s,
|
|
1342
1340
|
renderMessageInputActions: n,
|
|
@@ -1345,9 +1343,9 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1345
1343
|
showDeleteConversation: u = !0,
|
|
1346
1344
|
onDeleteConversationClick: o,
|
|
1347
1345
|
onBlockParticipantClick: m,
|
|
1348
|
-
onReportParticipantClick:
|
|
1349
|
-
showStarButton:
|
|
1350
|
-
chatbotVotingEnabled:
|
|
1346
|
+
onReportParticipantClick: g,
|
|
1347
|
+
showStarButton: x = !1,
|
|
1348
|
+
chatbotVotingEnabled: N = !1,
|
|
1351
1349
|
renderChannelBanner: b,
|
|
1352
1350
|
customChannelActions: w
|
|
1353
1351
|
}) => {
|
|
@@ -1365,31 +1363,31 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1365
1363
|
}, [a.data]), S = P(() => {
|
|
1366
1364
|
var h;
|
|
1367
1365
|
(h = y.current) == null || h.showModal();
|
|
1368
|
-
}, []),
|
|
1366
|
+
}, []), C = P(() => {
|
|
1369
1367
|
var h;
|
|
1370
1368
|
(h = y.current) == null || h.close();
|
|
1371
1369
|
}, []);
|
|
1372
1370
|
return /* @__PURE__ */ i(ce, { children: [
|
|
1373
1371
|
/* @__PURE__ */ e(
|
|
1374
|
-
|
|
1372
|
+
$t,
|
|
1375
1373
|
{
|
|
1376
1374
|
overrides: {
|
|
1377
|
-
Message: (h) => /* @__PURE__ */ e(
|
|
1375
|
+
Message: (h) => /* @__PURE__ */ e(fs, { ...h, chatbotVotingEnabled: N })
|
|
1378
1376
|
},
|
|
1379
|
-
children: /* @__PURE__ */ i(
|
|
1377
|
+
children: /* @__PURE__ */ i(jt, { children: [
|
|
1380
1378
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1381
|
-
|
|
1379
|
+
Is,
|
|
1382
1380
|
{
|
|
1383
1381
|
onBack: t,
|
|
1384
1382
|
showBackButton: s,
|
|
1385
1383
|
onShowInfo: S,
|
|
1386
1384
|
canShowInfo: !!I,
|
|
1387
|
-
showStarButton:
|
|
1385
|
+
showStarButton: x
|
|
1388
1386
|
}
|
|
1389
1387
|
) }),
|
|
1390
1388
|
b == null ? void 0 : b(),
|
|
1391
1389
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1392
|
-
|
|
1390
|
+
Gt,
|
|
1393
1391
|
{
|
|
1394
1392
|
hideDeletedMessages: !0,
|
|
1395
1393
|
hideNewMessageSeparator: !1,
|
|
@@ -1397,7 +1395,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1397
1395
|
}
|
|
1398
1396
|
) }),
|
|
1399
1397
|
/* @__PURE__ */ e(
|
|
1400
|
-
|
|
1398
|
+
Ns,
|
|
1401
1399
|
{
|
|
1402
1400
|
renderActions: () => n == null ? void 0 : n(a)
|
|
1403
1401
|
}
|
|
@@ -1406,10 +1404,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1406
1404
|
}
|
|
1407
1405
|
),
|
|
1408
1406
|
/* @__PURE__ */ e(
|
|
1409
|
-
|
|
1407
|
+
Ss,
|
|
1410
1408
|
{
|
|
1411
1409
|
dialogRef: y,
|
|
1412
|
-
onClose:
|
|
1410
|
+
onClose: C,
|
|
1413
1411
|
participant: I,
|
|
1414
1412
|
channel: a,
|
|
1415
1413
|
followerStatusLabel: v,
|
|
@@ -1418,12 +1416,12 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1418
1416
|
showDeleteConversation: u,
|
|
1419
1417
|
onDeleteConversationClick: o,
|
|
1420
1418
|
onBlockParticipantClick: m,
|
|
1421
|
-
onReportParticipantClick:
|
|
1419
|
+
onReportParticipantClick: g,
|
|
1422
1420
|
customChannelActions: w
|
|
1423
1421
|
}
|
|
1424
1422
|
)
|
|
1425
1423
|
] });
|
|
1426
|
-
},
|
|
1424
|
+
}, qe = A.memo(
|
|
1427
1425
|
({
|
|
1428
1426
|
channel: t,
|
|
1429
1427
|
onBack: s,
|
|
@@ -1432,10 +1430,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1432
1430
|
onLeaveConversation: l,
|
|
1433
1431
|
onBlockParticipant: u,
|
|
1434
1432
|
className: o,
|
|
1435
|
-
CustomChannelEmptyState: m =
|
|
1436
|
-
showDeleteConversation:
|
|
1437
|
-
onDeleteConversationClick:
|
|
1438
|
-
onBlockParticipantClick:
|
|
1433
|
+
CustomChannelEmptyState: m = Es,
|
|
1434
|
+
showDeleteConversation: g = !0,
|
|
1435
|
+
onDeleteConversationClick: x,
|
|
1436
|
+
onBlockParticipantClick: N,
|
|
1439
1437
|
onReportParticipantClick: b,
|
|
1440
1438
|
dmAgentEnabled: w,
|
|
1441
1439
|
messageMetadata: a,
|
|
@@ -1443,7 +1441,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1443
1441
|
showStarButton: I = !1,
|
|
1444
1442
|
chatbotVotingEnabled: v = !1,
|
|
1445
1443
|
renderChannelBanner: S,
|
|
1446
|
-
customChannelActions:
|
|
1444
|
+
customChannelActions: C
|
|
1447
1445
|
}) => {
|
|
1448
1446
|
const h = P(
|
|
1449
1447
|
async (p, T, f) => {
|
|
@@ -1473,16 +1471,16 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1473
1471
|
o
|
|
1474
1472
|
),
|
|
1475
1473
|
children: /* @__PURE__ */ e(
|
|
1476
|
-
|
|
1474
|
+
Bt,
|
|
1477
1475
|
{
|
|
1478
1476
|
channel: t,
|
|
1479
|
-
MessageSystem:
|
|
1477
|
+
MessageSystem: ys,
|
|
1480
1478
|
EmptyStateIndicator: m,
|
|
1481
1479
|
LoadingIndicator: Ce,
|
|
1482
|
-
DateSeparator:
|
|
1480
|
+
DateSeparator: os,
|
|
1483
1481
|
doSendMessageRequest: h,
|
|
1484
1482
|
children: /* @__PURE__ */ e(
|
|
1485
|
-
|
|
1483
|
+
Ms,
|
|
1486
1484
|
{
|
|
1487
1485
|
onBack: s,
|
|
1488
1486
|
showBackButton: n,
|
|
@@ -1490,14 +1488,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1490
1488
|
onLeaveConversation: l,
|
|
1491
1489
|
onBlockParticipant: u,
|
|
1492
1490
|
CustomChannelEmptyState: m,
|
|
1493
|
-
showDeleteConversation:
|
|
1494
|
-
onDeleteConversationClick:
|
|
1495
|
-
onBlockParticipantClick:
|
|
1491
|
+
showDeleteConversation: g,
|
|
1492
|
+
onDeleteConversationClick: x,
|
|
1493
|
+
onBlockParticipantClick: N,
|
|
1496
1494
|
onReportParticipantClick: b,
|
|
1497
1495
|
showStarButton: I,
|
|
1498
1496
|
chatbotVotingEnabled: v,
|
|
1499
1497
|
renderChannelBanner: S,
|
|
1500
|
-
customChannelActions:
|
|
1498
|
+
customChannelActions: C
|
|
1501
1499
|
}
|
|
1502
1500
|
)
|
|
1503
1501
|
}
|
|
@@ -1506,8 +1504,8 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1506
1504
|
);
|
|
1507
1505
|
}
|
|
1508
1506
|
);
|
|
1509
|
-
|
|
1510
|
-
function
|
|
1507
|
+
qe.displayName = "ChannelView";
|
|
1508
|
+
function ks({
|
|
1511
1509
|
searchQuery: t,
|
|
1512
1510
|
setSearchQuery: s,
|
|
1513
1511
|
placeholder: n
|
|
@@ -1515,7 +1513,7 @@ function Is({
|
|
|
1515
1513
|
const r = q(null);
|
|
1516
1514
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1517
1515
|
/* @__PURE__ */ e(
|
|
1518
|
-
|
|
1516
|
+
Yt,
|
|
1519
1517
|
{
|
|
1520
1518
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1521
1519
|
weight: "bold"
|
|
@@ -1546,7 +1544,7 @@ function Is({
|
|
|
1546
1544
|
)
|
|
1547
1545
|
] });
|
|
1548
1546
|
}
|
|
1549
|
-
const
|
|
1547
|
+
const Ds = ({
|
|
1550
1548
|
participantSource: t,
|
|
1551
1549
|
onSelectParticipant: s,
|
|
1552
1550
|
onClose: n,
|
|
@@ -1555,9 +1553,9 @@ const Ss = ({
|
|
|
1555
1553
|
searchPlaceholder: u = "Search participants...",
|
|
1556
1554
|
className: o
|
|
1557
1555
|
}) => {
|
|
1558
|
-
const { debug: m } = Ne(), [
|
|
1556
|
+
const { debug: m } = Ne(), [g, x] = _(""), [N, b] = _([]), [w, a] = _(!1), [y, I] = _(null), [v, S] = _(
|
|
1559
1557
|
null
|
|
1560
|
-
),
|
|
1558
|
+
), C = q(!1);
|
|
1561
1559
|
Y(() => {
|
|
1562
1560
|
if (t.loading) {
|
|
1563
1561
|
m && console.log(
|
|
@@ -1565,7 +1563,7 @@ const Ss = ({
|
|
|
1565
1563
|
);
|
|
1566
1564
|
return;
|
|
1567
1565
|
}
|
|
1568
|
-
if (
|
|
1566
|
+
if (C.current) return;
|
|
1569
1567
|
(async () => {
|
|
1570
1568
|
m && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), I(null);
|
|
1571
1569
|
try {
|
|
@@ -1574,7 +1572,7 @@ const Ss = ({
|
|
|
1574
1572
|
// Load all participants initially
|
|
1575
1573
|
limit: 100
|
|
1576
1574
|
});
|
|
1577
|
-
b(c.participants),
|
|
1575
|
+
b(c.participants), C.current = !0, m && console.log(
|
|
1578
1576
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1579
1577
|
c.participants.length
|
|
1580
1578
|
);
|
|
@@ -1586,10 +1584,10 @@ const Ss = ({
|
|
|
1586
1584
|
}
|
|
1587
1585
|
})();
|
|
1588
1586
|
}, [t.loading, m]);
|
|
1589
|
-
const h =
|
|
1587
|
+
const h = N.filter((f) => !r.has(f.id)).filter((f) => {
|
|
1590
1588
|
var d;
|
|
1591
|
-
if (!
|
|
1592
|
-
const c =
|
|
1589
|
+
if (!g) return !0;
|
|
1590
|
+
const c = g.toLowerCase();
|
|
1593
1591
|
return f.name.toLowerCase().includes(c) || ((d = f.email) == null ? void 0 : d.toLowerCase().includes(c)) || !1;
|
|
1594
1592
|
}), p = P(
|
|
1595
1593
|
async (f) => {
|
|
@@ -1610,7 +1608,7 @@ const Ss = ({
|
|
|
1610
1608
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1611
1609
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1612
1610
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1613
|
-
/* @__PURE__ */ e(
|
|
1611
|
+
/* @__PURE__ */ e(We, { onClick: n })
|
|
1614
1612
|
] }),
|
|
1615
1613
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1616
1614
|
"Select a ",
|
|
@@ -1621,10 +1619,10 @@ const Ss = ({
|
|
|
1621
1619
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1622
1620
|
] }),
|
|
1623
1621
|
/* @__PURE__ */ e(
|
|
1624
|
-
|
|
1622
|
+
ks,
|
|
1625
1623
|
{
|
|
1626
|
-
searchQuery:
|
|
1627
|
-
setSearchQuery:
|
|
1624
|
+
searchQuery: g,
|
|
1625
|
+
setSearchQuery: x,
|
|
1628
1626
|
placeholder: u
|
|
1629
1627
|
}
|
|
1630
1628
|
)
|
|
@@ -1644,8 +1642,8 @@ const Ss = ({
|
|
|
1644
1642
|
] })
|
|
1645
1643
|
] }) }) : h.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1646
1644
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ue, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1647
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1648
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1645
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : N.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1646
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : N.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
|
|
1649
1647
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1650
1648
|
h.map((f) => {
|
|
1651
1649
|
const c = f.name || f.email || f.id, d = f.email && f.name ? f.email : f.phone;
|
|
@@ -1683,7 +1681,7 @@ const Ss = ({
|
|
|
1683
1681
|
] }) })
|
|
1684
1682
|
] }) })
|
|
1685
1683
|
] });
|
|
1686
|
-
},
|
|
1684
|
+
}, Ts = ({ className: t }) => /* @__PURE__ */ i(
|
|
1687
1685
|
"svg",
|
|
1688
1686
|
{
|
|
1689
1687
|
width: "140",
|
|
@@ -1817,16 +1815,16 @@ const Ss = ({
|
|
|
1817
1815
|
] })
|
|
1818
1816
|
]
|
|
1819
1817
|
}
|
|
1820
|
-
),
|
|
1818
|
+
), Ye = A.memo(
|
|
1821
1819
|
({ 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: [
|
|
1822
|
-
/* @__PURE__ */ e(
|
|
1820
|
+
/* @__PURE__ */ e(Ts, {}),
|
|
1823
1821
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1824
1822
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1825
1823
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1826
1824
|
] })
|
|
1827
1825
|
] }) })
|
|
1828
1826
|
);
|
|
1829
|
-
|
|
1827
|
+
Ye.displayName = "EmptyState";
|
|
1830
1828
|
const be = A.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: [
|
|
1831
1829
|
/* @__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: "⚠️" }) }),
|
|
1832
1830
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
@@ -1842,7 +1840,7 @@ const be = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1842
1840
|
)
|
|
1843
1841
|
] }) }));
|
|
1844
1842
|
be.displayName = "ErrorState";
|
|
1845
|
-
const
|
|
1843
|
+
const js = ({
|
|
1846
1844
|
capabilities: t = {},
|
|
1847
1845
|
className: s,
|
|
1848
1846
|
renderMessageInputActions: n,
|
|
@@ -1851,9 +1849,9 @@ const As = ({
|
|
|
1851
1849
|
initialParticipantFilter: u,
|
|
1852
1850
|
initialParticipantData: o,
|
|
1853
1851
|
CustomChannelEmptyState: m,
|
|
1854
|
-
showChannelList:
|
|
1855
|
-
filters:
|
|
1856
|
-
channelListCustomEmptyStateIndicator:
|
|
1852
|
+
showChannelList: g = !0,
|
|
1853
|
+
filters: x,
|
|
1854
|
+
channelListCustomEmptyStateIndicator: N,
|
|
1857
1855
|
onDeleteConversationClick: b,
|
|
1858
1856
|
onBlockParticipantClick: w,
|
|
1859
1857
|
onReportParticipantClick: a,
|
|
@@ -1861,7 +1859,7 @@ const As = ({
|
|
|
1861
1859
|
messageMetadata: I,
|
|
1862
1860
|
onMessageSent: v,
|
|
1863
1861
|
showStarButton: S = !1,
|
|
1864
|
-
chatbotVotingEnabled:
|
|
1862
|
+
chatbotVotingEnabled: C = !1,
|
|
1865
1863
|
renderMessagePreview: h,
|
|
1866
1864
|
renderChannelBanner: p,
|
|
1867
1865
|
customChannelActions: T
|
|
@@ -1874,7 +1872,7 @@ const As = ({
|
|
|
1874
1872
|
error: k,
|
|
1875
1873
|
refreshConnection: B,
|
|
1876
1874
|
debug: D
|
|
1877
|
-
} =
|
|
1875
|
+
} = Zt(), [W, V] = _(null), [te, J] = _(!1), [se, ne] = _(!1), [ie, $] = _(!1), [Q, U] = _(/* @__PURE__ */ new Set()), [F, z] = _(0), [L, G] = _(!1), [de, Z] = _(null), ae = q(null), {
|
|
1878
1876
|
participantSource: X,
|
|
1879
1877
|
participantLabel: re = "participants",
|
|
1880
1878
|
showDeleteConversation: ue = !0
|
|
@@ -1889,9 +1887,9 @@ const As = ({
|
|
|
1889
1887
|
hidden: !1
|
|
1890
1888
|
}
|
|
1891
1889
|
},
|
|
1892
|
-
...
|
|
1890
|
+
...x
|
|
1893
1891
|
};
|
|
1894
|
-
}, [
|
|
1892
|
+
}, [x, c == null ? void 0 : c.userID]), K = q(null), oe = P(async () => {
|
|
1895
1893
|
if (!c || !d) return;
|
|
1896
1894
|
const E = c.userID;
|
|
1897
1895
|
if (E)
|
|
@@ -1907,9 +1905,9 @@ const As = ({
|
|
|
1907
1905
|
), O = /* @__PURE__ */ new Set();
|
|
1908
1906
|
H.forEach((j) => {
|
|
1909
1907
|
const ve = j.state.members;
|
|
1910
|
-
Object.values(ve).forEach((
|
|
1908
|
+
Object.values(ve).forEach((tt) => {
|
|
1911
1909
|
var ke;
|
|
1912
|
-
const we = (ke =
|
|
1910
|
+
const we = (ke = tt.user) == null ? void 0 : ke.id;
|
|
1913
1911
|
we && we !== E && O.add(we);
|
|
1914
1912
|
});
|
|
1915
1913
|
}), U((j) => j.size === O.size && [...j].every((ve) => O.has(ve)) ? j : O), J(H.length > 0), ne(!0), K.current = E, D && console.log("[MessagingShell] Channels synced successfully:", {
|
|
@@ -1943,7 +1941,7 @@ const As = ({
|
|
|
1943
1941
|
{ limit: 1 }
|
|
1944
1942
|
);
|
|
1945
1943
|
if (O.length > 0)
|
|
1946
|
-
|
|
1944
|
+
V(O[0]), G(!0), Z(null), r && r(O[0]), D && console.log(
|
|
1947
1945
|
"[MessagingShell] Initial conversation loaded:",
|
|
1948
1946
|
O[0].id
|
|
1949
1947
|
);
|
|
@@ -1959,7 +1957,7 @@ const As = ({
|
|
|
1959
1957
|
email: o.email,
|
|
1960
1958
|
phone: o.phone
|
|
1961
1959
|
});
|
|
1962
|
-
|
|
1960
|
+
V(j), G(!0), Z(null), r && r(j), D && console.log(
|
|
1963
1961
|
"[MessagingShell] Channel created and loaded:",
|
|
1964
1962
|
j.id
|
|
1965
1963
|
);
|
|
@@ -1992,14 +1990,14 @@ const As = ({
|
|
|
1992
1990
|
D,
|
|
1993
1991
|
r
|
|
1994
1992
|
]);
|
|
1995
|
-
const
|
|
1993
|
+
const Ze = P(
|
|
1996
1994
|
(E) => {
|
|
1997
|
-
|
|
1995
|
+
V(E), r == null || r(E);
|
|
1998
1996
|
},
|
|
1999
1997
|
[r]
|
|
2000
|
-
),
|
|
2001
|
-
L ||
|
|
2002
|
-
}, [L]),
|
|
1998
|
+
), Je = P(() => {
|
|
1999
|
+
L || V(null);
|
|
2000
|
+
}, [L]), Qe = P(
|
|
2003
2001
|
async (E) => {
|
|
2004
2002
|
var H;
|
|
2005
2003
|
if (f)
|
|
@@ -2019,7 +2017,7 @@ const As = ({
|
|
|
2019
2017
|
} catch (j) {
|
|
2020
2018
|
console.warn("[MessagingShell] Failed to unhide channel:", j);
|
|
2021
2019
|
}
|
|
2022
|
-
|
|
2020
|
+
V(O), $(!1), (H = ae.current) == null || H.close(), l == null || l(E);
|
|
2023
2021
|
} catch (O) {
|
|
2024
2022
|
console.error("[MessagingShell] Failed to start conversation:", O);
|
|
2025
2023
|
}
|
|
@@ -2028,19 +2026,19 @@ const As = ({
|
|
|
2028
2026
|
), he = P(() => {
|
|
2029
2027
|
var E;
|
|
2030
2028
|
$(!1), (E = ae.current) == null || E.close();
|
|
2031
|
-
}, []),
|
|
2029
|
+
}, []), Xe = P(
|
|
2032
2030
|
(E) => {
|
|
2033
2031
|
E.target === ae.current && he();
|
|
2034
2032
|
},
|
|
2035
2033
|
[he]
|
|
2036
|
-
),
|
|
2034
|
+
), Ke = P(
|
|
2037
2035
|
async (E) => {
|
|
2038
|
-
D && console.log("[MessagingShell] Leaving conversation:", E.id),
|
|
2036
|
+
D && console.log("[MessagingShell] Leaving conversation:", E.id), V(null), G(!1), K.current = null, await oe();
|
|
2039
2037
|
},
|
|
2040
2038
|
[oe, D]
|
|
2041
|
-
),
|
|
2039
|
+
), et = P(
|
|
2042
2040
|
async (E) => {
|
|
2043
|
-
D && console.log("[MessagingShell] Blocking participant:", E),
|
|
2041
|
+
D && console.log("[MessagingShell] Blocking participant:", E), V(null), G(!1), K.current = null, await oe();
|
|
2044
2042
|
},
|
|
2045
2043
|
[oe, D]
|
|
2046
2044
|
), fe = !!W;
|
|
@@ -2065,20 +2063,20 @@ const As = ({
|
|
|
2065
2063
|
className: R(
|
|
2066
2064
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2067
2065
|
{
|
|
2068
|
-
"!hidden":
|
|
2066
|
+
"!hidden": g === !1 || L,
|
|
2069
2067
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2070
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl":
|
|
2068
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !L && fe,
|
|
2071
2069
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2072
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl":
|
|
2070
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !L && !fe
|
|
2073
2071
|
}
|
|
2074
2072
|
),
|
|
2075
2073
|
children: /* @__PURE__ */ e(
|
|
2076
|
-
|
|
2074
|
+
Ve,
|
|
2077
2075
|
{
|
|
2078
|
-
onChannelSelect:
|
|
2076
|
+
onChannelSelect: Ze,
|
|
2079
2077
|
selectedChannel: W || void 0,
|
|
2080
2078
|
filters: me,
|
|
2081
|
-
customEmptyStateIndicator:
|
|
2079
|
+
customEmptyStateIndicator: N,
|
|
2082
2080
|
renderMessagePreview: h
|
|
2083
2081
|
}
|
|
2084
2082
|
)
|
|
@@ -2097,15 +2095,15 @@ const As = ({
|
|
|
2097
2095
|
}
|
|
2098
2096
|
),
|
|
2099
2097
|
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2100
|
-
|
|
2098
|
+
qe,
|
|
2101
2099
|
{
|
|
2102
2100
|
channel: W,
|
|
2103
|
-
onBack:
|
|
2101
|
+
onBack: Je,
|
|
2104
2102
|
showBackButton: !L,
|
|
2105
2103
|
renderMessageInputActions: n,
|
|
2106
2104
|
renderChannelBanner: p,
|
|
2107
|
-
onLeaveConversation:
|
|
2108
|
-
onBlockParticipant:
|
|
2105
|
+
onLeaveConversation: Ke,
|
|
2106
|
+
onBlockParticipant: et,
|
|
2109
2107
|
CustomChannelEmptyState: m,
|
|
2110
2108
|
showDeleteConversation: ue,
|
|
2111
2109
|
onDeleteConversationClick: b,
|
|
@@ -2115,7 +2113,7 @@ const As = ({
|
|
|
2115
2113
|
messageMetadata: I,
|
|
2116
2114
|
onMessageSent: v,
|
|
2117
2115
|
showStarButton: S,
|
|
2118
|
-
chatbotVotingEnabled:
|
|
2116
|
+
chatbotVotingEnabled: C,
|
|
2119
2117
|
customChannelActions: T
|
|
2120
2118
|
},
|
|
2121
2119
|
W.id
|
|
@@ -2123,7 +2121,7 @@ const As = ({
|
|
|
2123
2121
|
// Show loading while creating/loading direct conversation channel
|
|
2124
2122
|
/* @__PURE__ */ e(Ce, {})
|
|
2125
2123
|
) : /* @__PURE__ */ e(
|
|
2126
|
-
|
|
2124
|
+
Ye,
|
|
2127
2125
|
{
|
|
2128
2126
|
hasChannels: te,
|
|
2129
2127
|
channelsLoaded: se
|
|
@@ -2138,13 +2136,13 @@ const As = ({
|
|
|
2138
2136
|
{
|
|
2139
2137
|
ref: ae,
|
|
2140
2138
|
className: "mes-dialog",
|
|
2141
|
-
onClick:
|
|
2139
|
+
onClick: Xe,
|
|
2142
2140
|
onClose: he,
|
|
2143
2141
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2144
|
-
|
|
2142
|
+
Ds,
|
|
2145
2143
|
{
|
|
2146
2144
|
participantSource: X,
|
|
2147
|
-
onSelectParticipant:
|
|
2145
|
+
onSelectParticipant: Qe,
|
|
2148
2146
|
onClose: he,
|
|
2149
2147
|
existingParticipantIds: Q,
|
|
2150
2148
|
participantLabel: re,
|
|
@@ -2157,7 +2155,7 @@ const As = ({
|
|
|
2157
2155
|
]
|
|
2158
2156
|
}
|
|
2159
2157
|
);
|
|
2160
|
-
},
|
|
2158
|
+
}, Rs = ({
|
|
2161
2159
|
question: t,
|
|
2162
2160
|
onClick: s,
|
|
2163
2161
|
loading: n = !1,
|
|
@@ -2179,7 +2177,7 @@ const As = ({
|
|
|
2179
2177
|
),
|
|
2180
2178
|
children: t
|
|
2181
2179
|
}
|
|
2182
|
-
),
|
|
2180
|
+
), Gs = ({
|
|
2183
2181
|
faqs: t,
|
|
2184
2182
|
onFaqClick: s,
|
|
2185
2183
|
loadingFaqId: n,
|
|
@@ -2188,7 +2186,7 @@ const As = ({
|
|
|
2188
2186
|
avatarImage: u,
|
|
2189
2187
|
avatarName: o
|
|
2190
2188
|
}) => {
|
|
2191
|
-
const m = t.filter((
|
|
2189
|
+
const m = t.filter((g) => g.enabled).sort((g, x) => (g.order ?? 0) - (x.order ?? 0));
|
|
2192
2190
|
return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2193
2191
|
(u || o) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2194
2192
|
ee,
|
|
@@ -2207,24 +2205,24 @@ const As = ({
|
|
|
2207
2205
|
style: { backgroundColor: "#F1F0EE" },
|
|
2208
2206
|
children: [
|
|
2209
2207
|
r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
|
|
2210
|
-
m.map((
|
|
2211
|
-
|
|
2208
|
+
m.map((g) => /* @__PURE__ */ e(
|
|
2209
|
+
Rs,
|
|
2212
2210
|
{
|
|
2213
|
-
question:
|
|
2214
|
-
onClick: () => s(
|
|
2215
|
-
loading: n ===
|
|
2211
|
+
question: g.question,
|
|
2212
|
+
onClick: () => s(g.id),
|
|
2213
|
+
loading: n === g.id
|
|
2216
2214
|
},
|
|
2217
|
-
|
|
2215
|
+
g.id
|
|
2218
2216
|
))
|
|
2219
2217
|
]
|
|
2220
2218
|
}
|
|
2221
2219
|
)
|
|
2222
2220
|
] }) });
|
|
2223
|
-
},
|
|
2224
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, u] = _([]), [o, m] = _(!1), [
|
|
2221
|
+
}, Hs = (t, s = {}) => {
|
|
2222
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, u] = _([]), [o, m] = _(!1), [g, x] = _(null), [N, b] = _(n), [w, a] = _(!0), [y, I] = _(), v = P(async (p = !1, T) => {
|
|
2225
2223
|
if (o) return;
|
|
2226
|
-
const f = T !== void 0 ? T :
|
|
2227
|
-
m(!0),
|
|
2224
|
+
const f = T !== void 0 ? T : N;
|
|
2225
|
+
m(!0), x(null);
|
|
2228
2226
|
try {
|
|
2229
2227
|
const c = await t.loadParticipants({
|
|
2230
2228
|
search: f || void 0,
|
|
@@ -2236,13 +2234,13 @@ const As = ({
|
|
|
2236
2234
|
), a(c.hasMore), I(c.nextCursor);
|
|
2237
2235
|
} catch (c) {
|
|
2238
2236
|
const d = c instanceof Error ? c.message : "Failed to load participants";
|
|
2239
|
-
|
|
2237
|
+
x(d), console.error("[useParticipants] Load error:", c);
|
|
2240
2238
|
} finally {
|
|
2241
2239
|
m(!1);
|
|
2242
2240
|
}
|
|
2243
|
-
}, [t,
|
|
2241
|
+
}, [t, N, y, r, o]), S = P(() => {
|
|
2244
2242
|
w && !o && v(!1);
|
|
2245
|
-
}, [w, o, v]),
|
|
2243
|
+
}, [w, o, v]), C = P((p) => {
|
|
2246
2244
|
b(p), I(void 0), v(!0, p);
|
|
2247
2245
|
}, [v]), h = P(() => {
|
|
2248
2246
|
I(void 0), v(!0);
|
|
@@ -2252,30 +2250,30 @@ const As = ({
|
|
|
2252
2250
|
}, [t.loadParticipants]), {
|
|
2253
2251
|
participants: l,
|
|
2254
2252
|
loading: o,
|
|
2255
|
-
error:
|
|
2256
|
-
searchQuery:
|
|
2253
|
+
error: g,
|
|
2254
|
+
searchQuery: N,
|
|
2257
2255
|
hasMore: w,
|
|
2258
2256
|
totalCount: t.totalCount,
|
|
2259
2257
|
loadMore: S,
|
|
2260
|
-
search:
|
|
2258
|
+
search: C,
|
|
2261
2259
|
refresh: h
|
|
2262
2260
|
};
|
|
2263
2261
|
};
|
|
2264
2262
|
export {
|
|
2265
2263
|
ge as ActionButton,
|
|
2266
2264
|
ee as Avatar,
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2265
|
+
Es as ChannelEmptyState,
|
|
2266
|
+
Ve as ChannelList,
|
|
2267
|
+
qe as ChannelView,
|
|
2268
|
+
Gs as FaqList,
|
|
2269
|
+
Rs as FaqListItem,
|
|
2270
|
+
us as MessageVoteButtons,
|
|
2271
|
+
$s as MessagingProvider,
|
|
2272
|
+
js as MessagingShell,
|
|
2273
|
+
Ds as ParticipantPicker,
|
|
2274
|
+
Kt as formatRelativeTime,
|
|
2275
|
+
is as useMessageVote,
|
|
2276
|
+
Zt as useMessaging,
|
|
2277
|
+
Hs as useParticipants
|
|
2280
2278
|
};
|
|
2281
2279
|
//# sourceMappingURL=index.js.map
|