@linktr.ee/messaging-react 1.25.0 → 1.25.1
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/assets/index.css +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +535 -472
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +31 -0
- package/src/components/CustomSystemMessage/CustomSystemMessage.stories.tsx +8 -0
- package/src/components/CustomSystemMessage/CustomSystemMessage.test.tsx +48 -2
- package/src/components/CustomSystemMessage/index.tsx +119 -13
- package/src/stream-custom-data.ts +3 -0
- package/src/styles.css +0 -30
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import R from "classnames";
|
|
3
|
-
import B, { createContext as
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
3
|
+
import B, { createContext as it, useContext as ct, useCallback as A, useState as T, useRef as X, useEffect as K, useMemo as Se } from "react";
|
|
4
|
+
import { StreamChatService as dt } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as mt, ChannelList as ut, DateSeparator as ht, useChannelStateContext as Te, useChatContext as $e, areMessageUIPropsEqual as ft, useMessageReminder as gt, useComponentContext as xt, Attachment as bt, EditMessageModal as Ct, MessageBlocked as Nt, MessageBouncePrompt as vt, MessageDeleted as pt, MessageIsThreadReplyInChannelButtonIndicator as yt, MessageRepliesCountButton as wt, ReminderNotification as _t, StreamedMessageText as Et, messageHasAttachments as St, messageHasReactions as It, isDateSeparatorMessage as Mt, isMessageBlocked as kt, isMessageBounced as Tt, MessageBounceModal as Dt, Poll as Rt, MessageText as Lt, MessageErrorIcon as At, useMessageContext as je, useMessageComposer as Pt, useStateStore as Ft, MessageInput as Ot, useMessageInputContext as Ut, useMessageComposerHasSendableData as Bt, SimpleAttachmentSelector as Gt, QuotedMessagePreview as $t, AttachmentPreviewList as jt, TextareaComposer as zt, MessageTimestamp as we, Channel as Ht, WithComponents as Vt, Window as Yt, MessageList as Wt } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ie, GiftIcon as qt, XIcon as De, SpinnerGapIcon as be, SignOutIcon as Zt, ProhibitInsetIcon as Ae, FlagIcon as Jt, ArrowUpIcon as Xt, SparkleIcon as Kt, ProhibitIcon as Qt, ArrowLeftIcon as Pe, DotsThreeIcon as Fe, MagnifyingGlassIcon as es, ChatCircleDotsIcon as Oe } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as Ue } from "stream-chat";
|
|
8
|
+
const ze = it({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,19 +15,19 @@ const Ge = lt({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), ve = () =>
|
|
18
|
+
}), ve = () => ct(ze), Ks = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
22
|
apiKey: o,
|
|
23
23
|
capabilities: l = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: d = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const a =
|
|
26
|
+
const a = A(
|
|
27
27
|
(u, ...N) => {
|
|
28
|
-
|
|
28
|
+
d && console.log(`🔥 [MessagingProvider] ${u}`, ...N);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[d]
|
|
31
31
|
);
|
|
32
32
|
a("🔄 RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
@@ -35,14 +35,14 @@ const Ge = lt({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c, g] = T(null), [h, b] = T(null), [x,
|
|
38
|
+
const [c, g] = T(null), [h, b] = T(null), [x, p] = T(!1), [r, w] = T(!1), [_, C] = T(null), M = X(!1), E = X({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: o,
|
|
41
41
|
serviceConfig: n,
|
|
42
42
|
capabilities: l
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
43
|
+
}), y = X(0);
|
|
44
|
+
y.current++, a("📊 RENDER INFO", {
|
|
45
|
+
renderCount: y.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
48
|
userChanged: E.current.userId !== (s == null ? void 0 : s.id),
|
|
@@ -55,8 +55,8 @@ const Ge = lt({
|
|
|
55
55
|
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const u =
|
|
58
|
+
}, K(() => {
|
|
59
|
+
const u = y.current;
|
|
60
60
|
if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
62
|
apiKey: !!o,
|
|
@@ -79,10 +79,10 @@ const Ge = lt({
|
|
|
79
79
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: E.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const N = new
|
|
82
|
+
const N = new dt({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: o,
|
|
85
|
-
debug:
|
|
85
|
+
debug: d
|
|
86
86
|
});
|
|
87
87
|
return g(N), a("✅ SERVICE SET", {
|
|
88
88
|
renderCount: u,
|
|
@@ -93,9 +93,9 @@ const Ge = lt({
|
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
94
|
}), N.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [o, n,
|
|
97
|
-
const S =
|
|
98
|
-
|
|
96
|
+
}, [o, n, d, a]);
|
|
97
|
+
const S = X(null);
|
|
98
|
+
K(() => {
|
|
99
99
|
var N, v;
|
|
100
100
|
if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
@@ -120,11 +120,11 @@ const Ge = lt({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0,
|
|
123
|
+
a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, w(!0), C(null);
|
|
124
124
|
try {
|
|
125
125
|
a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const f = await c.connectUser(s);
|
|
127
|
-
b(f),
|
|
127
|
+
b(f), p(!0), S.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: f.userID
|
|
130
130
|
});
|
|
@@ -135,13 +135,13 @@ const Ge = lt({
|
|
|
135
135
|
error: k
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
w(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: x
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, a, x]),
|
|
144
|
+
}, [c, s, a, x]), K(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
146
|
isConnected: x
|
|
147
147
|
}), () => {
|
|
@@ -153,7 +153,7 @@ const Ge = lt({
|
|
|
153
153
|
isConnected: x
|
|
154
154
|
});
|
|
155
155
|
}), [c, x, a]);
|
|
156
|
-
const L =
|
|
156
|
+
const L = A(async () => {
|
|
157
157
|
if (a("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,11 +161,11 @@ const Ge = lt({
|
|
|
161
161
|
a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
|
|
165
165
|
try {
|
|
166
166
|
a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
|
|
167
167
|
const u = await c.connectUser(s);
|
|
168
|
-
b(u),
|
|
168
|
+
b(u), p(!0), C(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
170
|
const N = u instanceof Error ? u.message : "Refresh failed";
|
|
171
171
|
C(N), a("❌ CONNECTION REFRESH ERROR", {
|
|
@@ -173,9 +173,9 @@ const Ge = lt({
|
|
|
173
173
|
error: N
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
w(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s, a]),
|
|
178
|
+
}, [c, s, a]), m = B.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
180
|
hasClient: !!h,
|
|
181
181
|
isConnected: x,
|
|
@@ -190,7 +190,7 @@ const Ge = lt({
|
|
|
190
190
|
error: _,
|
|
191
191
|
capabilities: l,
|
|
192
192
|
refreshConnection: L,
|
|
193
|
-
debug:
|
|
193
|
+
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
196
|
h,
|
|
@@ -199,15 +199,15 @@ const Ge = lt({
|
|
|
199
199
|
_,
|
|
200
200
|
l,
|
|
201
201
|
L,
|
|
202
|
-
|
|
202
|
+
d,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("🔄 RENDER END", {
|
|
206
|
-
renderCount:
|
|
206
|
+
renderCount: y.current,
|
|
207
207
|
willRenderChat: !!(h && x),
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
208
|
+
contextValueReady: !!m
|
|
209
|
+
}), /* @__PURE__ */ e(ze.Provider, { value: m, children: h && x ? /* @__PURE__ */ e(
|
|
210
|
+
mt,
|
|
211
211
|
{
|
|
212
212
|
client: h,
|
|
213
213
|
customClasses: {
|
|
@@ -216,46 +216,46 @@ const Ge = lt({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, ts = () => ve(), He = B.createContext({
|
|
220
220
|
selectedChannel: void 0,
|
|
221
221
|
onChannelSelect: () => {
|
|
222
222
|
},
|
|
223
223
|
debug: !1,
|
|
224
224
|
renderMessagePreview: void 0
|
|
225
|
-
}),
|
|
225
|
+
}), ss = He.Provider, ns = () => B.useContext(He), Ve = (t) => {
|
|
226
226
|
var o, l;
|
|
227
227
|
const [s, n] = T(
|
|
228
228
|
!!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
|
|
229
229
|
);
|
|
230
|
-
return
|
|
230
|
+
return K(() => {
|
|
231
231
|
var a;
|
|
232
232
|
if (!t) {
|
|
233
233
|
n(!1);
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
n(!!((a = t.state.membership) != null && a.pinned_at));
|
|
237
|
-
const
|
|
237
|
+
const d = (c) => {
|
|
238
238
|
var g;
|
|
239
239
|
n(
|
|
240
240
|
c != null && c.member ? !!c.member.pinned_at : !!((g = t.state.membership) != null && g.pinned_at)
|
|
241
241
|
);
|
|
242
242
|
};
|
|
243
|
-
return t.on("member.updated",
|
|
244
|
-
t.off("member.updated",
|
|
243
|
+
return t.on("member.updated", d), () => {
|
|
244
|
+
t.off("member.updated", d);
|
|
245
245
|
};
|
|
246
246
|
}, [t]), s;
|
|
247
|
-
},
|
|
247
|
+
}, as = (t, s) => {
|
|
248
248
|
const n = new Date(
|
|
249
249
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
250
250
|
), l = new Date(
|
|
251
251
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
252
252
|
).getTime() - n.getTime();
|
|
253
253
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
254
|
-
},
|
|
254
|
+
}, rs = (t) => {
|
|
255
255
|
const s = /* @__PURE__ */ new Date();
|
|
256
256
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
257
257
|
return "Just now";
|
|
258
|
-
const o =
|
|
258
|
+
const o = as(t, s);
|
|
259
259
|
return o === 0 ? t.toLocaleTimeString([], {
|
|
260
260
|
hour: "numeric",
|
|
261
261
|
minute: "2-digit",
|
|
@@ -265,7 +265,7 @@ const Ge = lt({
|
|
|
265
265
|
day: "numeric",
|
|
266
266
|
year: "2-digit"
|
|
267
267
|
});
|
|
268
|
-
},
|
|
268
|
+
}, Be = [
|
|
269
269
|
"🍎",
|
|
270
270
|
// Apple
|
|
271
271
|
"🍌",
|
|
@@ -293,7 +293,7 @@ const Ge = lt({
|
|
|
293
293
|
"🍈"
|
|
294
294
|
// Melon
|
|
295
295
|
];
|
|
296
|
-
function
|
|
296
|
+
function os(t) {
|
|
297
297
|
let s = 0;
|
|
298
298
|
for (let n = 0; n < t.length; n++) {
|
|
299
299
|
const o = t.charCodeAt(n);
|
|
@@ -301,9 +301,9 @@ function as(t) {
|
|
|
301
301
|
}
|
|
302
302
|
return Math.abs(s);
|
|
303
303
|
}
|
|
304
|
-
function
|
|
305
|
-
const n =
|
|
306
|
-
return
|
|
304
|
+
function ls(t) {
|
|
305
|
+
const n = os(t) % Be.length;
|
|
306
|
+
return Be[n];
|
|
307
307
|
}
|
|
308
308
|
const se = ({
|
|
309
309
|
id: t,
|
|
@@ -311,9 +311,9 @@ const se = ({
|
|
|
311
311
|
size: n = 40,
|
|
312
312
|
className: o,
|
|
313
313
|
starred: l = !1,
|
|
314
|
-
shape:
|
|
314
|
+
shape: d = "squircle"
|
|
315
315
|
}) => {
|
|
316
|
-
const a =
|
|
316
|
+
const a = ls(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = d === "circle" ? { borderRadius: "50%" } : {
|
|
317
317
|
borderRadius: "33%",
|
|
318
318
|
"corner-shape": "superellipse(1.3)"
|
|
319
319
|
};
|
|
@@ -331,7 +331,7 @@ const se = ({
|
|
|
331
331
|
{
|
|
332
332
|
"aria-hidden": "true",
|
|
333
333
|
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)]",
|
|
334
|
-
children: /* @__PURE__ */ e(
|
|
334
|
+
children: /* @__PURE__ */ e(Ie, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
335
335
|
}
|
|
336
336
|
),
|
|
337
337
|
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: h, children: s ? /* @__PURE__ */ e(
|
|
@@ -355,7 +355,7 @@ const se = ({
|
|
|
355
355
|
]
|
|
356
356
|
}
|
|
357
357
|
);
|
|
358
|
-
},
|
|
358
|
+
}, is = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
359
359
|
"svg",
|
|
360
360
|
{
|
|
361
361
|
width: t,
|
|
@@ -372,53 +372,53 @@ const se = ({
|
|
|
372
372
|
}
|
|
373
373
|
)
|
|
374
374
|
}
|
|
375
|
-
),
|
|
375
|
+
), cs = (t) => {
|
|
376
376
|
var s;
|
|
377
377
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
378
|
-
},
|
|
378
|
+
}, ds = (t) => {
|
|
379
379
|
var s;
|
|
380
380
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
381
|
-
},
|
|
381
|
+
}, Re = (t) => {
|
|
382
382
|
var s;
|
|
383
383
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
384
|
-
},
|
|
384
|
+
}, Ye = (t) => cs(t) || ds(t), ms = (t) => {
|
|
385
385
|
var s;
|
|
386
|
-
return
|
|
387
|
-
},
|
|
386
|
+
return Ye(t) && !((s = t.text) != null && s.trim());
|
|
387
|
+
}, _e = ({
|
|
388
388
|
message: t,
|
|
389
389
|
standalone: s = !1,
|
|
390
390
|
isMyMessage: n = !1,
|
|
391
391
|
hasAttachment: o = !1
|
|
392
392
|
}) => {
|
|
393
393
|
var x;
|
|
394
|
-
const l =
|
|
395
|
-
if (!l && !
|
|
394
|
+
const l = Ye(t), d = Re(t);
|
|
395
|
+
if (!l && !d)
|
|
396
396
|
return null;
|
|
397
397
|
if (l) {
|
|
398
|
-
const
|
|
399
|
-
if (!
|
|
400
|
-
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
398
|
+
const p = (x = t.metadata) == null ? void 0 : x.amount_text;
|
|
399
|
+
if (!p) return null;
|
|
400
|
+
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", w = s ? `${p} tip` : `Delivered with ${p} tip`;
|
|
401
401
|
return /* @__PURE__ */ i("div", { className: r, children: [
|
|
402
402
|
/* @__PURE__ */ e(qt, { size: s ? 14 : 12 }),
|
|
403
|
-
/* @__PURE__ */ e("span", { children:
|
|
403
|
+
/* @__PURE__ */ e("span", { children: w })
|
|
404
404
|
] });
|
|
405
405
|
}
|
|
406
406
|
const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
|
|
407
407
|
"message-chatbot-indicator",
|
|
408
408
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
409
409
|
a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
410
|
-
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(
|
|
411
|
-
return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(
|
|
410
|
+
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(is, { size: a ? 12 : 15 }) });
|
|
411
|
+
return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(ce, { children: [
|
|
412
412
|
h,
|
|
413
413
|
b
|
|
414
|
-
] }) : /* @__PURE__ */ i(
|
|
414
|
+
] }) : /* @__PURE__ */ i(ce, { children: [
|
|
415
415
|
b,
|
|
416
416
|
h
|
|
417
417
|
] }) });
|
|
418
418
|
}, We = B.memo(
|
|
419
419
|
({ channel: t, unread: s }) => {
|
|
420
|
-
var L,
|
|
421
|
-
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview:
|
|
420
|
+
var L, m, u, N;
|
|
421
|
+
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = ns(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
422
422
|
t && o(t);
|
|
423
423
|
}, g = (v) => {
|
|
424
424
|
const f = v.key === "Enter" || v.key === " ", k = v.repeat;
|
|
@@ -428,7 +428,7 @@ const se = ({
|
|
|
428
428
|
var f, k;
|
|
429
429
|
return ((f = v.user) == null ? void 0 : f.id) && v.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
|
|
430
430
|
}
|
|
431
|
-
), x = ((
|
|
431
|
+
), x = ((m = b == null ? void 0 : b.user) == null ? void 0 : m.name) || "Conversation", p = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, r = (() => {
|
|
432
432
|
var f;
|
|
433
433
|
const v = (f = t == null ? void 0 : t.state) == null ? void 0 : f.messages;
|
|
434
434
|
if (v != null && v.length) {
|
|
@@ -436,12 +436,12 @@ const se = ({
|
|
|
436
436
|
if (v[k].type !== "system") return v[k];
|
|
437
437
|
}
|
|
438
438
|
})(), _ = (() => {
|
|
439
|
-
var k,
|
|
439
|
+
var k, V;
|
|
440
440
|
if (r != null && r.text) return r.text;
|
|
441
441
|
if (((k = r == null ? void 0 : r.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
|
|
442
|
-
const f = (
|
|
442
|
+
const f = (V = r == null ? void 0 : r.attachments) == null ? void 0 : V[0];
|
|
443
443
|
return f ? f.og_scrape_url ? f.og_scrape_url : f.type === "image" ? "📷 Sent an image" : f.type === "video" ? "🎥 Sent a video" : f.type === "audio" ? "🎵 Sent audio" : f.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
|
|
444
|
-
})(), C = r != null && r.created_at ?
|
|
444
|
+
})(), C = r != null && r.created_at ? rs(new Date(r.created_at)) : "", M = r ? Re(r) : !1, E = d ? d(r, _) : `${M ? "✨ " : ""}${_}`, y = Ve(t), S = s ?? 0;
|
|
445
445
|
return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
446
446
|
channelId: t == null ? void 0 : t.id,
|
|
447
447
|
isSelected: a,
|
|
@@ -468,9 +468,9 @@ const se = ({
|
|
|
468
468
|
{
|
|
469
469
|
id: ((N = b == null ? void 0 : b.user) == null ? void 0 : N.id) || t.id || "unknown",
|
|
470
470
|
name: x,
|
|
471
|
-
image:
|
|
471
|
+
image: p,
|
|
472
472
|
size: 44,
|
|
473
|
-
starred:
|
|
473
|
+
starred: y,
|
|
474
474
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
475
475
|
}
|
|
476
476
|
),
|
|
@@ -484,7 +484,7 @@ const se = ({
|
|
|
484
484
|
a ? "text-primary" : "text-charcoal"
|
|
485
485
|
),
|
|
486
486
|
children: [
|
|
487
|
-
|
|
487
|
+
y && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
488
488
|
x
|
|
489
489
|
]
|
|
490
490
|
}
|
|
@@ -502,15 +502,15 @@ const se = ({
|
|
|
502
502
|
}
|
|
503
503
|
);
|
|
504
504
|
We.displayName = "CustomChannelPreview";
|
|
505
|
-
const
|
|
505
|
+
const us = { last_message_at: -1 }, qe = B.memo(
|
|
506
506
|
({
|
|
507
507
|
onChannelSelect: t,
|
|
508
508
|
selectedChannel: s,
|
|
509
509
|
filters: n,
|
|
510
510
|
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
511
511
|
onMessageNew: l,
|
|
512
|
-
onAddedToChannel:
|
|
513
|
-
sort: a =
|
|
512
|
+
onAddedToChannel: d,
|
|
513
|
+
sort: a = us,
|
|
514
514
|
className: c,
|
|
515
515
|
customEmptyStateIndicator: g,
|
|
516
516
|
renderMessagePreview: h
|
|
@@ -523,7 +523,7 @@ const ds = { last_message_at: -1 }, qe = B.memo(
|
|
|
523
523
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
524
524
|
filters: n
|
|
525
525
|
});
|
|
526
|
-
const
|
|
526
|
+
const p = B.useMemo(
|
|
527
527
|
() => ({
|
|
528
528
|
selectedChannel: s,
|
|
529
529
|
onChannelSelect: t,
|
|
@@ -539,7 +539,7 @@ const ds = { last_message_at: -1 }, qe = B.memo(
|
|
|
539
539
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
540
540
|
c
|
|
541
541
|
),
|
|
542
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
542
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(ss, { value: p, children: /* @__PURE__ */ e(
|
|
543
543
|
ut,
|
|
544
544
|
{
|
|
545
545
|
filters: n,
|
|
@@ -547,7 +547,7 @@ const ds = { last_message_at: -1 }, qe = B.memo(
|
|
|
547
547
|
options: { limit: 30 },
|
|
548
548
|
allowNewMessagesFromUnfilteredChannels: o,
|
|
549
549
|
onMessageNew: l,
|
|
550
|
-
onAddedToChannel:
|
|
550
|
+
onAddedToChannel: d,
|
|
551
551
|
Preview: We,
|
|
552
552
|
EmptyStateIndicator: g
|
|
553
553
|
},
|
|
@@ -576,7 +576,7 @@ const xe = ({
|
|
|
576
576
|
children: n
|
|
577
577
|
}
|
|
578
578
|
);
|
|
579
|
-
function
|
|
579
|
+
function Ze({ label: t, className: s, children: n, ...o }) {
|
|
580
580
|
return /* @__PURE__ */ i(
|
|
581
581
|
"button",
|
|
582
582
|
{
|
|
@@ -597,65 +597,65 @@ function Ye({ label: t, className: s, children: n, ...o }) {
|
|
|
597
597
|
}
|
|
598
598
|
);
|
|
599
599
|
}
|
|
600
|
-
function
|
|
601
|
-
return /* @__PURE__ */ e(
|
|
600
|
+
function Je({ onClick: t }) {
|
|
601
|
+
return /* @__PURE__ */ e(Ze, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(De, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
602
602
|
}
|
|
603
|
-
const
|
|
603
|
+
const hs = ({
|
|
604
604
|
dialogRef: t,
|
|
605
605
|
onClose: s,
|
|
606
606
|
participant: n,
|
|
607
607
|
channel: o,
|
|
608
608
|
followerStatusLabel: l,
|
|
609
|
-
onLeaveConversation:
|
|
609
|
+
onLeaveConversation: d,
|
|
610
610
|
onBlockParticipant: a,
|
|
611
611
|
showDeleteConversation: c = !0,
|
|
612
612
|
onDeleteConversationClick: g,
|
|
613
613
|
onBlockParticipantClick: h,
|
|
614
614
|
onReportParticipantClick: b,
|
|
615
615
|
customProfileContent: x,
|
|
616
|
-
customChannelActions:
|
|
616
|
+
customChannelActions: p
|
|
617
617
|
}) => {
|
|
618
|
-
var
|
|
619
|
-
const { service: r, debug:
|
|
620
|
-
var
|
|
621
|
-
if (!(!r || !((
|
|
618
|
+
var Y, $, ne, ae, j, Q, re;
|
|
619
|
+
const { service: r, debug: w } = ve(), [_, C] = T(!1), [M, E] = T(!1), [y, S] = T(!1), L = A(async () => {
|
|
620
|
+
var P;
|
|
621
|
+
if (!(!r || !((P = n == null ? void 0 : n.user) != null && P.id)))
|
|
622
622
|
try {
|
|
623
|
-
const
|
|
623
|
+
const U = (await r.getBlockedUsers()).some(
|
|
624
624
|
(z) => {
|
|
625
|
-
var
|
|
626
|
-
return z.blocked_user_id === ((
|
|
625
|
+
var de;
|
|
626
|
+
return z.blocked_user_id === ((de = n == null ? void 0 : n.user) == null ? void 0 : de.id);
|
|
627
627
|
}
|
|
628
628
|
);
|
|
629
|
-
C(
|
|
630
|
-
} catch (
|
|
629
|
+
C(U);
|
|
630
|
+
} catch (F) {
|
|
631
631
|
console.error(
|
|
632
632
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
633
|
-
|
|
633
|
+
F
|
|
634
634
|
);
|
|
635
635
|
}
|
|
636
|
-
}, [r, (
|
|
637
|
-
|
|
636
|
+
}, [r, (Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id]);
|
|
637
|
+
K(() => {
|
|
638
638
|
L();
|
|
639
639
|
}, [L]);
|
|
640
|
-
const
|
|
641
|
-
var
|
|
640
|
+
const m = async () => {
|
|
641
|
+
var P;
|
|
642
642
|
if (!M) {
|
|
643
|
-
g == null || g(),
|
|
643
|
+
g == null || g(), w && console.log("[ChannelInfoDialog] Leave conversation", o.cid), E(!0);
|
|
644
644
|
try {
|
|
645
|
-
const
|
|
646
|
-
await o.hide(
|
|
647
|
-
} catch (
|
|
648
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
645
|
+
const F = ((P = o._client) == null ? void 0 : P.userID) ?? null;
|
|
646
|
+
await o.hide(F, !1), d && await d(o), s();
|
|
647
|
+
} catch (F) {
|
|
648
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", F);
|
|
649
649
|
} finally {
|
|
650
650
|
E(!1);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
}, u = async () => {
|
|
654
|
-
var
|
|
655
|
-
if (!(
|
|
656
|
-
h == null || h(),
|
|
654
|
+
var P, F, U;
|
|
655
|
+
if (!(y || !r)) {
|
|
656
|
+
h == null || h(), w && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), S(!0);
|
|
657
657
|
try {
|
|
658
|
-
await r.blockUser((
|
|
658
|
+
await r.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
|
|
659
659
|
} catch (z) {
|
|
660
660
|
console.error("[ChannelInfoDialog] Failed to block member", z);
|
|
661
661
|
} finally {
|
|
@@ -663,11 +663,11 @@ const us = ({
|
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
}, N = async () => {
|
|
666
|
-
var
|
|
667
|
-
if (!(
|
|
668
|
-
h == null || h(),
|
|
666
|
+
var P, F, U;
|
|
667
|
+
if (!(y || !r)) {
|
|
668
|
+
h == null || h(), w && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), S(!0);
|
|
669
669
|
try {
|
|
670
|
-
await r.unBlockUser((
|
|
670
|
+
await r.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
|
|
671
671
|
} catch (z) {
|
|
672
672
|
console.error("[ChannelInfoDialog] Failed to unblock member", z);
|
|
673
673
|
} finally {
|
|
@@ -682,7 +682,7 @@ const us = ({
|
|
|
682
682
|
);
|
|
683
683
|
};
|
|
684
684
|
if (!n) return null;
|
|
685
|
-
const f = ((
|
|
685
|
+
const f = (($ = n.user) == null ? void 0 : $.name) || ((ne = n.user) == null ? void 0 : ne.id) || "Unknown member", k = (ae = n.user) == null ? void 0 : ae.image, V = (j = n.user) == null ? void 0 : j.email, Z = (Q = n.user) == null ? void 0 : Q.username, q = V || (Z ? `linktr.ee/${Z}` : void 0), D = ((re = n.user) == null ? void 0 : re.id) || "unknown";
|
|
686
686
|
return (
|
|
687
687
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
688
688
|
/* @__PURE__ */ e(
|
|
@@ -691,13 +691,13 @@ const us = ({
|
|
|
691
691
|
ref: t,
|
|
692
692
|
className: "mes-dialog group",
|
|
693
693
|
onClose: s,
|
|
694
|
-
onClick: (
|
|
695
|
-
|
|
694
|
+
onClick: (P) => {
|
|
695
|
+
P.target === t.current && s();
|
|
696
696
|
},
|
|
697
697
|
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: [
|
|
698
698
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
699
699
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
700
|
-
/* @__PURE__ */ e(
|
|
700
|
+
/* @__PURE__ */ e(Je, { onClick: s })
|
|
701
701
|
] }),
|
|
702
702
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
703
703
|
/* @__PURE__ */ e(
|
|
@@ -718,7 +718,7 @@ const us = ({
|
|
|
718
718
|
),
|
|
719
719
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
720
720
|
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: f }),
|
|
721
|
-
|
|
721
|
+
q && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: q }),
|
|
722
722
|
l && !x && /* @__PURE__ */ e(
|
|
723
723
|
"span",
|
|
724
724
|
{
|
|
@@ -742,11 +742,11 @@ const us = ({
|
|
|
742
742
|
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
743
743
|
xe,
|
|
744
744
|
{
|
|
745
|
-
onClick:
|
|
745
|
+
onClick: m,
|
|
746
746
|
disabled: M,
|
|
747
747
|
"aria-busy": M,
|
|
748
748
|
children: [
|
|
749
|
-
M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
749
|
+
M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
|
|
750
750
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
751
751
|
]
|
|
752
752
|
}
|
|
@@ -755,10 +755,10 @@ const us = ({
|
|
|
755
755
|
xe,
|
|
756
756
|
{
|
|
757
757
|
onClick: N,
|
|
758
|
-
disabled:
|
|
759
|
-
"aria-busy":
|
|
758
|
+
disabled: y,
|
|
759
|
+
"aria-busy": y,
|
|
760
760
|
children: [
|
|
761
|
-
|
|
761
|
+
y ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ae, { className: "h-5 w-5" }),
|
|
762
762
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
763
763
|
]
|
|
764
764
|
}
|
|
@@ -766,57 +766,57 @@ const us = ({
|
|
|
766
766
|
xe,
|
|
767
767
|
{
|
|
768
768
|
onClick: u,
|
|
769
|
-
disabled:
|
|
770
|
-
"aria-busy":
|
|
769
|
+
disabled: y,
|
|
770
|
+
"aria-busy": y,
|
|
771
771
|
children: [
|
|
772
|
-
|
|
772
|
+
y ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ae, { className: "h-5 w-5" }),
|
|
773
773
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
774
774
|
]
|
|
775
775
|
}
|
|
776
776
|
) }),
|
|
777
777
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: v, children: [
|
|
778
|
-
/* @__PURE__ */ e(
|
|
778
|
+
/* @__PURE__ */ e(Jt, { className: "h-5 w-5" }),
|
|
779
779
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
780
780
|
] }) }),
|
|
781
|
-
|
|
781
|
+
p
|
|
782
782
|
] })
|
|
783
783
|
] })
|
|
784
784
|
] })
|
|
785
785
|
}
|
|
786
786
|
)
|
|
787
787
|
);
|
|
788
|
-
},
|
|
789
|
-
function
|
|
790
|
-
return t != null && t.length ? t.some((s) => s.type ===
|
|
788
|
+
}, fs = (t) => /* @__PURE__ */ e(ht, { ...t, position: "center" }), Me = "vote_up", ke = "vote_down";
|
|
789
|
+
function gs(t) {
|
|
790
|
+
return t != null && t.length ? t.some((s) => s.type === ke) ? "down" : t.some((s) => s.type === Me) ? "up" : null : null;
|
|
791
791
|
}
|
|
792
|
-
function
|
|
793
|
-
const { channel: s } =
|
|
794
|
-
() =>
|
|
792
|
+
function xs(t) {
|
|
793
|
+
const { channel: s } = Te(), { client: n } = $e("useMessageVote"), o = Se(
|
|
794
|
+
() => gs(t.own_reactions),
|
|
795
795
|
[t.own_reactions]
|
|
796
|
-
), l =
|
|
796
|
+
), l = A(async () => {
|
|
797
797
|
if (n != null && n.userID)
|
|
798
798
|
try {
|
|
799
|
-
o === "up" ? await s.deleteReaction(t.id,
|
|
799
|
+
o === "up" ? await s.deleteReaction(t.id, Me) : await s.sendReaction(
|
|
800
800
|
t.id,
|
|
801
|
-
{ type:
|
|
801
|
+
{ type: Me },
|
|
802
802
|
{ enforce_unique: !0, skip_push: !0 }
|
|
803
803
|
);
|
|
804
804
|
} catch {
|
|
805
805
|
}
|
|
806
|
-
}, [s, n == null ? void 0 : n.userID, t.id, o]),
|
|
806
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), d = A(async () => {
|
|
807
807
|
if (n != null && n.userID)
|
|
808
808
|
try {
|
|
809
|
-
o === "down" ? await s.deleteReaction(t.id,
|
|
809
|
+
o === "down" ? await s.deleteReaction(t.id, ke) : await s.sendReaction(
|
|
810
810
|
t.id,
|
|
811
|
-
{ type:
|
|
811
|
+
{ type: ke },
|
|
812
812
|
{ enforce_unique: !0, skip_push: !0 }
|
|
813
813
|
);
|
|
814
814
|
} catch {
|
|
815
815
|
}
|
|
816
816
|
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
817
|
-
return { selected: o, voteUp: l, voteDown:
|
|
817
|
+
return { selected: o, voteUp: l, voteDown: d };
|
|
818
818
|
}
|
|
819
|
-
const
|
|
819
|
+
const bs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
820
820
|
"path",
|
|
821
821
|
{
|
|
822
822
|
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",
|
|
@@ -826,7 +826,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
826
826
|
strokeLinejoin: "round",
|
|
827
827
|
fill: t ? "currentColor" : "none"
|
|
828
828
|
}
|
|
829
|
-
) }),
|
|
829
|
+
) }), Cs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
830
830
|
"path",
|
|
831
831
|
{
|
|
832
832
|
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",
|
|
@@ -836,7 +836,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
836
836
|
strokeLinejoin: "round",
|
|
837
837
|
fill: t ? "currentColor" : "none"
|
|
838
838
|
}
|
|
839
|
-
) }),
|
|
839
|
+
) }), Ns = ({
|
|
840
840
|
selected: t,
|
|
841
841
|
onVoteUp: s,
|
|
842
842
|
onVoteDown: n
|
|
@@ -849,7 +849,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
849
849
|
onClick: s,
|
|
850
850
|
"aria-label": "Helpful",
|
|
851
851
|
"aria-pressed": t === "up",
|
|
852
|
-
children: /* @__PURE__ */ e(
|
|
852
|
+
children: /* @__PURE__ */ e(bs, { filled: t === "up" })
|
|
853
853
|
}
|
|
854
854
|
),
|
|
855
855
|
/* @__PURE__ */ e(
|
|
@@ -860,73 +860,73 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
860
860
|
onClick: n,
|
|
861
861
|
"aria-label": "Not helpful",
|
|
862
862
|
"aria-pressed": t === "down",
|
|
863
|
-
children: /* @__PURE__ */ e(
|
|
863
|
+
children: /* @__PURE__ */ e(Cs, { filled: t === "down" })
|
|
864
864
|
}
|
|
865
865
|
)
|
|
866
|
-
] }),
|
|
867
|
-
var
|
|
866
|
+
] }), vs = (t) => {
|
|
867
|
+
var me, ue;
|
|
868
868
|
const {
|
|
869
869
|
additionalMessageInputProps: s,
|
|
870
870
|
chatbotVotingEnabled: n,
|
|
871
871
|
editing: o,
|
|
872
872
|
endOfGroup: l,
|
|
873
|
-
firstOfGroup:
|
|
873
|
+
firstOfGroup: d,
|
|
874
874
|
groupedByUser: a,
|
|
875
875
|
handleAction: c,
|
|
876
876
|
handleOpenThread: g,
|
|
877
877
|
handleRetry: h,
|
|
878
878
|
highlighted: b,
|
|
879
879
|
isMessageAIGenerated: x,
|
|
880
|
-
isMyMessage:
|
|
880
|
+
isMyMessage: p,
|
|
881
881
|
message: r,
|
|
882
|
-
renderText:
|
|
882
|
+
renderText: w,
|
|
883
883
|
threadList: _
|
|
884
|
-
} = t, { client: C } = $e("CustomMessage"), [M, E] = T(!1),
|
|
885
|
-
Attachment: u =
|
|
886
|
-
EditMessageModal: N =
|
|
887
|
-
MessageBlocked: v =
|
|
888
|
-
MessageBouncePrompt: f =
|
|
889
|
-
MessageDeleted: k =
|
|
890
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
891
|
-
MessageRepliesCountButton: Z =
|
|
892
|
-
ReminderNotification:
|
|
893
|
-
StreamedMessageText: D =
|
|
894
|
-
PinIndicator:
|
|
895
|
-
} =
|
|
884
|
+
} = t, { client: C } = $e("CustomMessage"), [M, E] = T(!1), y = gt(r.id), { selected: S, voteUp: L, voteDown: m } = xs(r), {
|
|
885
|
+
Attachment: u = bt,
|
|
886
|
+
EditMessageModal: N = Ct,
|
|
887
|
+
MessageBlocked: v = Nt,
|
|
888
|
+
MessageBouncePrompt: f = vt,
|
|
889
|
+
MessageDeleted: k = pt,
|
|
890
|
+
MessageIsThreadReplyInChannelButtonIndicator: V = yt,
|
|
891
|
+
MessageRepliesCountButton: Z = wt,
|
|
892
|
+
ReminderNotification: q = _t,
|
|
893
|
+
StreamedMessageText: D = Et,
|
|
894
|
+
PinIndicator: Y
|
|
895
|
+
} = xt("CustomMessage"), $ = St(r), ne = It(r), ae = Se(
|
|
896
896
|
() => x == null ? void 0 : x(r),
|
|
897
897
|
[x, r]
|
|
898
|
-
),
|
|
898
|
+
), j = Se(
|
|
899
899
|
() => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
|
|
900
900
|
[r]
|
|
901
901
|
);
|
|
902
|
-
if (
|
|
902
|
+
if (Mt(r))
|
|
903
903
|
return null;
|
|
904
904
|
if (r.deleted_at || r.type === "deleted")
|
|
905
905
|
return /* @__PURE__ */ e(k, { message: r });
|
|
906
|
-
if (
|
|
906
|
+
if (kt(r))
|
|
907
907
|
return /* @__PURE__ */ e(v, {});
|
|
908
|
-
const
|
|
909
|
-
let
|
|
910
|
-
|
|
911
|
-
const z =
|
|
908
|
+
const Q = !_ && !!r.reply_count, re = !_ && r.show_in_channel && r.parent_id, P = r.status === "failed" && ((me = r.error) == null ? void 0 : me.status) !== 403, F = Tt(r);
|
|
909
|
+
let U;
|
|
910
|
+
P ? U = () => h(r) : F && (U = () => E(!0));
|
|
911
|
+
const z = p(), de = R(
|
|
912
912
|
"str-chat__message str-chat__message-simple",
|
|
913
913
|
`str-chat__message--${r.type}`,
|
|
914
914
|
`str-chat__message--${r.status}`,
|
|
915
915
|
z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
916
916
|
r.text ? "str-chat__message--has-text" : "has-no-text",
|
|
917
917
|
{
|
|
918
|
-
"str-chat__message--has-attachment":
|
|
918
|
+
"str-chat__message--has-attachment": $,
|
|
919
919
|
"str-chat__message--highlighted": b,
|
|
920
920
|
"str-chat__message--pinned pinned-message": r.pinned,
|
|
921
921
|
"str-chat__message--with-reactions": ne,
|
|
922
922
|
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((ue = r == null ? void 0 : r.error) == null ? void 0 : ue.status) !== 403,
|
|
923
|
-
"str-chat__message-with-thread-link":
|
|
923
|
+
"str-chat__message-with-thread-link": Q || re,
|
|
924
924
|
"str-chat__virtual-message__wrapper--end": l,
|
|
925
|
-
"str-chat__virtual-message__wrapper--first":
|
|
925
|
+
"str-chat__virtual-message__wrapper--first": d,
|
|
926
926
|
"str-chat__virtual-message__wrapper--group": a
|
|
927
927
|
}
|
|
928
|
-
),
|
|
929
|
-
return /* @__PURE__ */ i(
|
|
928
|
+
), W = r.poll_id && C.polls.fromState(r.poll_id), oe = ms(r), ee = Re(r), J = !!(j != null && j.length && !r.quoted_message), te = ee && z && J;
|
|
929
|
+
return /* @__PURE__ */ i(ce, { children: [
|
|
930
930
|
o && /* @__PURE__ */ e(
|
|
931
931
|
N,
|
|
932
932
|
{
|
|
@@ -934,16 +934,16 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
934
934
|
}
|
|
935
935
|
),
|
|
936
936
|
M && /* @__PURE__ */ e(
|
|
937
|
-
|
|
937
|
+
Dt,
|
|
938
938
|
{
|
|
939
939
|
MessageBouncePrompt: f,
|
|
940
940
|
onClose: () => E(!1),
|
|
941
941
|
open: M
|
|
942
942
|
}
|
|
943
943
|
),
|
|
944
|
-
/* @__PURE__ */ i("div", { className:
|
|
945
|
-
|
|
946
|
-
!!
|
|
944
|
+
/* @__PURE__ */ i("div", { className: de, children: [
|
|
945
|
+
Y && /* @__PURE__ */ e(Y, {}),
|
|
946
|
+
!!y && /* @__PURE__ */ e(q, { reminder: y }),
|
|
947
947
|
r.user && /* @__PURE__ */ e(
|
|
948
948
|
se,
|
|
949
949
|
{
|
|
@@ -957,13 +957,13 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
957
957
|
"div",
|
|
958
958
|
{
|
|
959
959
|
className: R("str-chat__message-inner", {
|
|
960
|
-
"str-chat__simple-message--error-failed":
|
|
960
|
+
"str-chat__simple-message--error-failed": P || F
|
|
961
961
|
}),
|
|
962
962
|
"data-testid": "message-inner",
|
|
963
|
-
onClick:
|
|
964
|
-
onKeyDown:
|
|
965
|
-
role:
|
|
966
|
-
tabIndex:
|
|
963
|
+
onClick: U,
|
|
964
|
+
onKeyDown: U,
|
|
965
|
+
role: U ? "button" : void 0,
|
|
966
|
+
tabIndex: U ? 0 : void 0,
|
|
967
967
|
style: {
|
|
968
968
|
// Force margins to 0 to prevent hover layout shift
|
|
969
969
|
// Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
|
|
@@ -972,36 +972,36 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
972
972
|
},
|
|
973
973
|
children: oe ? (
|
|
974
974
|
/* Tip-only messages render as a standalone bubble */
|
|
975
|
-
/* @__PURE__ */ e(
|
|
975
|
+
/* @__PURE__ */ e(_e, { message: r, standalone: !0 })
|
|
976
976
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
977
977
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
978
978
|
ee && !te && /* @__PURE__ */ e(
|
|
979
|
-
|
|
979
|
+
_e,
|
|
980
980
|
{
|
|
981
981
|
message: r,
|
|
982
982
|
hasAttachment: J,
|
|
983
983
|
isMyMessage: z
|
|
984
984
|
}
|
|
985
985
|
),
|
|
986
|
-
|
|
987
|
-
|
|
986
|
+
W && /* @__PURE__ */ e(Rt, { poll: W }),
|
|
987
|
+
j != null && j.length && !r.quoted_message ? /* @__PURE__ */ e(
|
|
988
988
|
u,
|
|
989
989
|
{
|
|
990
990
|
actionHandler: c,
|
|
991
|
-
attachments:
|
|
991
|
+
attachments: j
|
|
992
992
|
}
|
|
993
993
|
) : null,
|
|
994
994
|
ae ? /* @__PURE__ */ e(
|
|
995
995
|
D,
|
|
996
996
|
{
|
|
997
997
|
message: r,
|
|
998
|
-
renderText:
|
|
998
|
+
renderText: w
|
|
999
999
|
}
|
|
1000
|
-
) : /* @__PURE__ */ e(
|
|
1001
|
-
/* @__PURE__ */ e(
|
|
1000
|
+
) : /* @__PURE__ */ e(Lt, { message: r, renderText: w }),
|
|
1001
|
+
/* @__PURE__ */ e(At, {})
|
|
1002
1002
|
] }),
|
|
1003
1003
|
(!ee || te) && /* @__PURE__ */ e(
|
|
1004
|
-
|
|
1004
|
+
_e,
|
|
1005
1005
|
{
|
|
1006
1006
|
message: r,
|
|
1007
1007
|
hasAttachment: J,
|
|
@@ -1009,37 +1009,37 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1009
1009
|
}
|
|
1010
1010
|
),
|
|
1011
1011
|
n && ee && /* @__PURE__ */ e(
|
|
1012
|
-
|
|
1012
|
+
Ns,
|
|
1013
1013
|
{
|
|
1014
1014
|
selected: S,
|
|
1015
1015
|
onVoteUp: L,
|
|
1016
|
-
onVoteDown:
|
|
1016
|
+
onVoteDown: m
|
|
1017
1017
|
}
|
|
1018
1018
|
)
|
|
1019
1019
|
] })
|
|
1020
1020
|
}
|
|
1021
1021
|
),
|
|
1022
|
-
|
|
1022
|
+
Q && /* @__PURE__ */ e(
|
|
1023
1023
|
Z,
|
|
1024
1024
|
{
|
|
1025
1025
|
onClick: g,
|
|
1026
1026
|
reply_count: r.reply_count
|
|
1027
1027
|
}
|
|
1028
1028
|
),
|
|
1029
|
-
re && /* @__PURE__ */ e(
|
|
1029
|
+
re && /* @__PURE__ */ e(V, {})
|
|
1030
1030
|
] }, r.id)
|
|
1031
1031
|
] });
|
|
1032
|
-
},
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
),
|
|
1032
|
+
}, ps = B.memo(
|
|
1033
|
+
vs,
|
|
1034
|
+
ft
|
|
1035
|
+
), ys = (t) => {
|
|
1036
1036
|
const s = je("CustomMessage");
|
|
1037
|
-
return /* @__PURE__ */ e(
|
|
1037
|
+
return /* @__PURE__ */ e(ps, { ...s, ...t });
|
|
1038
1038
|
}, ws = (t) => ({
|
|
1039
1039
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
1040
|
-
(s) =>
|
|
1040
|
+
(s) => Ue.previewIsLoaded(s) || Ue.previewIsLoading(s)
|
|
1041
1041
|
)
|
|
1042
|
-
}),
|
|
1042
|
+
}), _s = ({
|
|
1043
1043
|
link: t,
|
|
1044
1044
|
onDismiss: s
|
|
1045
1045
|
}) => {
|
|
@@ -1069,7 +1069,7 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1069
1069
|
},
|
|
1070
1070
|
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",
|
|
1071
1071
|
"aria-label": "Close link preview",
|
|
1072
|
-
children: /* @__PURE__ */ e(
|
|
1072
|
+
children: /* @__PURE__ */ e(De, { className: "size-4 text-black/90" })
|
|
1073
1073
|
}
|
|
1074
1074
|
),
|
|
1075
1075
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
@@ -1079,32 +1079,32 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1079
1079
|
]
|
|
1080
1080
|
}
|
|
1081
1081
|
);
|
|
1082
|
-
},
|
|
1083
|
-
const { linkPreviewsManager: t } = Pt(), { linkPreviews: s } =
|
|
1082
|
+
}, Es = () => {
|
|
1083
|
+
const { linkPreviewsManager: t } = Pt(), { linkPreviews: s } = Ft(
|
|
1084
1084
|
t.state,
|
|
1085
1085
|
ws
|
|
1086
1086
|
), n = (l) => {
|
|
1087
1087
|
t.dismissPreview(l);
|
|
1088
1088
|
};
|
|
1089
1089
|
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(
|
|
1090
|
-
|
|
1090
|
+
_s,
|
|
1091
1091
|
{
|
|
1092
1092
|
link: l,
|
|
1093
1093
|
onDismiss: n
|
|
1094
1094
|
},
|
|
1095
1095
|
l.og_scrape_url
|
|
1096
1096
|
)) }) : null;
|
|
1097
|
-
},
|
|
1098
|
-
const { handleSubmit: t } =
|
|
1099
|
-
return /* @__PURE__ */ i(
|
|
1100
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1097
|
+
}, Ss = () => {
|
|
1098
|
+
const { handleSubmit: t } = Ut(), s = Bt();
|
|
1099
|
+
return /* @__PURE__ */ i(ce, { children: [
|
|
1100
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Gt, {}) }),
|
|
1101
1101
|
/* @__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: [
|
|
1102
1102
|
/* @__PURE__ */ e($t, {}),
|
|
1103
|
-
/* @__PURE__ */ e(
|
|
1103
|
+
/* @__PURE__ */ e(Es, {}),
|
|
1104
1104
|
/* @__PURE__ */ e(jt, {}),
|
|
1105
1105
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
1106
1106
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
1107
|
-
|
|
1107
|
+
zt,
|
|
1108
1108
|
{
|
|
1109
1109
|
className: "w-full resize-none outline-none leading-6",
|
|
1110
1110
|
autoFocus: !0,
|
|
@@ -1120,58 +1120,121 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1120
1120
|
disabled: !s,
|
|
1121
1121
|
onClick: t,
|
|
1122
1122
|
type: "button",
|
|
1123
|
-
children: /* @__PURE__ */ e(
|
|
1123
|
+
children: /* @__PURE__ */ e(Xt, { className: "size-4" })
|
|
1124
1124
|
}
|
|
1125
1125
|
)
|
|
1126
1126
|
] })
|
|
1127
1127
|
] })
|
|
1128
1128
|
] });
|
|
1129
|
-
},
|
|
1129
|
+
}, Is = ({
|
|
1130
1130
|
renderActions: t
|
|
1131
1131
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
1132
1132
|
t && (t == null ? void 0 : t()),
|
|
1133
|
-
/* @__PURE__ */ e(Ot, { Input:
|
|
1134
|
-
] }),
|
|
1133
|
+
/* @__PURE__ */ e(Ot, { Input: Ss })
|
|
1134
|
+
] }), Ms = [
|
|
1135
1135
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
1136
1136
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
1137
|
-
],
|
|
1137
|
+
], ks = {
|
|
1138
1138
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
1139
1139
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
1140
|
-
},
|
|
1140
|
+
}, Ts = [
|
|
1141
|
+
"SYSTEM_AGE_SAFETY_BLOCKED"
|
|
1142
|
+
], Ds = {
|
|
1143
|
+
SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
|
|
1144
|
+
}, Ee = "age safety guidelines.", Rs = "https://linktr.ee/s/about/contact", Ge = (t) => Ms.includes(t), Ls = (t) => Ts.includes(t), As = (t) => {
|
|
1141
1145
|
var o;
|
|
1142
1146
|
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
1143
|
-
if (
|
|
1144
|
-
return
|
|
1147
|
+
if (Ge(s))
|
|
1148
|
+
return {
|
|
1149
|
+
kind: "dm-agent",
|
|
1150
|
+
type: s
|
|
1151
|
+
};
|
|
1152
|
+
if (Ls(s))
|
|
1153
|
+
return {
|
|
1154
|
+
kind: "age-safety",
|
|
1155
|
+
type: s
|
|
1156
|
+
};
|
|
1145
1157
|
const n = t.dm_agent_system_type;
|
|
1146
|
-
if (
|
|
1147
|
-
return
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1158
|
+
if (Ge(n))
|
|
1159
|
+
return {
|
|
1160
|
+
kind: "dm-agent",
|
|
1161
|
+
type: n
|
|
1162
|
+
};
|
|
1163
|
+
}, Ps = (t) => {
|
|
1164
|
+
const s = t.indexOf(Ee);
|
|
1165
|
+
if (s === -1)
|
|
1166
|
+
return t;
|
|
1167
|
+
const n = s + Ee.length;
|
|
1168
|
+
return /* @__PURE__ */ i(ce, { children: [
|
|
1169
|
+
t.slice(0, s),
|
|
1170
|
+
/* @__PURE__ */ e(
|
|
1171
|
+
"a",
|
|
1172
|
+
{
|
|
1173
|
+
href: Rs,
|
|
1174
|
+
target: "_blank",
|
|
1175
|
+
rel: "noopener noreferrer",
|
|
1176
|
+
className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
|
|
1177
|
+
children: Ee
|
|
1178
|
+
}
|
|
1179
|
+
),
|
|
1180
|
+
t.slice(n)
|
|
1181
|
+
] });
|
|
1182
|
+
}, Fs = (t) => {
|
|
1183
|
+
var o, l;
|
|
1184
|
+
const s = t.message.hide_date === !0, n = As(
|
|
1185
|
+
t.message
|
|
1186
|
+
);
|
|
1187
|
+
if ((n == null ? void 0 : n.kind) === "dm-agent") {
|
|
1188
|
+
const d = ((o = t.message.text) == null ? void 0 : o.trim()) || ks[n.type];
|
|
1153
1189
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1154
1190
|
/* @__PURE__ */ i(
|
|
1155
1191
|
"div",
|
|
1156
1192
|
{
|
|
1157
|
-
className: "mes-dm-agent-system-message",
|
|
1193
|
+
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)]",
|
|
1158
1194
|
"data-testid": "dm-agent-system-message",
|
|
1159
|
-
"data-dm-agent-system-type": n,
|
|
1195
|
+
"data-dm-agent-system-type": n.type,
|
|
1160
1196
|
children: [
|
|
1161
1197
|
/* @__PURE__ */ e(
|
|
1162
|
-
|
|
1198
|
+
Kt,
|
|
1163
1199
|
{
|
|
1164
1200
|
size: 16,
|
|
1165
1201
|
weight: "regular",
|
|
1166
1202
|
"aria-hidden": !0,
|
|
1167
|
-
className: "mes-dm-agent-system-message__sparkle"
|
|
1203
|
+
className: "mes-dm-agent-system-message__sparkle shrink-0"
|
|
1168
1204
|
}
|
|
1169
1205
|
),
|
|
1170
|
-
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text", children:
|
|
1206
|
+
/* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: d })
|
|
1171
1207
|
]
|
|
1172
1208
|
}
|
|
1173
1209
|
),
|
|
1174
|
-
!s && /* @__PURE__ */ e(
|
|
1210
|
+
!s && /* @__PURE__ */ e(we, { message: t.message })
|
|
1211
|
+
] });
|
|
1212
|
+
}
|
|
1213
|
+
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
1214
|
+
const d = ((l = t.message.text) == null ? void 0 : l.trim()) || Ds[n.type];
|
|
1215
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
1216
|
+
/* @__PURE__ */ i(
|
|
1217
|
+
"div",
|
|
1218
|
+
{
|
|
1219
|
+
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)]",
|
|
1220
|
+
"data-testid": "age-safety-system-message",
|
|
1221
|
+
"data-age-safety-system-type": n.type,
|
|
1222
|
+
children: [
|
|
1223
|
+
/* @__PURE__ */ e(
|
|
1224
|
+
Qt,
|
|
1225
|
+
{
|
|
1226
|
+
size: 24,
|
|
1227
|
+
weight: "duotone",
|
|
1228
|
+
"aria-hidden": !0,
|
|
1229
|
+
className: "mes-age-safety-system-message__icon shrink-0 text-[color:var(--text-warning-on-warning,#894b00)]",
|
|
1230
|
+
"data-testid": "age-safety-system-message-icon"
|
|
1231
|
+
}
|
|
1232
|
+
),
|
|
1233
|
+
/* @__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: Ps(d) }) })
|
|
1234
|
+
]
|
|
1235
|
+
}
|
|
1236
|
+
),
|
|
1237
|
+
!s && /* @__PURE__ */ e(we, { message: t.message })
|
|
1175
1238
|
] });
|
|
1176
1239
|
}
|
|
1177
1240
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1180,9 +1243,9 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1180
1243
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1181
1244
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1182
1245
|
] }),
|
|
1183
|
-
!s && /* @__PURE__ */ e(
|
|
1246
|
+
!s && /* @__PURE__ */ e(we, { message: t.message })
|
|
1184
1247
|
] });
|
|
1185
|
-
},
|
|
1248
|
+
}, Os = () => null, Us = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1186
1249
|
"div",
|
|
1187
1250
|
{
|
|
1188
1251
|
className: R("flex items-center justify-center h-full", t),
|
|
@@ -1226,26 +1289,26 @@ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1226
1289
|
]
|
|
1227
1290
|
}
|
|
1228
1291
|
), Ne = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1229
|
-
/* @__PURE__ */ e(
|
|
1292
|
+
/* @__PURE__ */ e(Us, { className: "w-6 h-6" }),
|
|
1230
1293
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1231
1294
|
] }) }));
|
|
1232
1295
|
Ne.displayName = "LoadingState";
|
|
1233
|
-
const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring",
|
|
1296
|
+
const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Bs = ({
|
|
1234
1297
|
onBack: t,
|
|
1235
1298
|
showBackButton: s,
|
|
1236
1299
|
onShowInfo: n,
|
|
1237
1300
|
canShowInfo: o,
|
|
1238
1301
|
showStarButton: l = !1
|
|
1239
1302
|
}) => {
|
|
1240
|
-
var x,
|
|
1241
|
-
const { channel:
|
|
1303
|
+
var x, p, r, w, _;
|
|
1304
|
+
const { channel: d } = Te(), a = B.useMemo(() => Object.values(d.state.members || {}).find(
|
|
1242
1305
|
(M) => {
|
|
1243
1306
|
var E;
|
|
1244
|
-
return ((E = M.user) == null ? void 0 : E.id) && M.user.id !==
|
|
1307
|
+
return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== d._client.userID;
|
|
1245
1308
|
}
|
|
1246
|
-
), [
|
|
1309
|
+
), [d._client.userID, d.state.members]), c = ((x = a == null ? void 0 : a.user) == null ? void 0 : x.name) || ((p = a == null ? void 0 : a.user) == null ? void 0 : p.id) || "Unknown member", g = (r = a == null ? void 0 : a.user) == null ? void 0 : r.image, h = Ve(d), b = async () => {
|
|
1247
1310
|
try {
|
|
1248
|
-
h ? await
|
|
1311
|
+
h ? await d.unpin() : await d.pin();
|
|
1249
1312
|
} catch (C) {
|
|
1250
1313
|
console.error(
|
|
1251
1314
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
@@ -1270,7 +1333,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1270
1333
|
/* @__PURE__ */ e(
|
|
1271
1334
|
se,
|
|
1272
1335
|
{
|
|
1273
|
-
id: ((
|
|
1336
|
+
id: ((w = a == null ? void 0 : a.user) == null ? void 0 : w.id) || d.id || "unknown",
|
|
1274
1337
|
name: c,
|
|
1275
1338
|
image: g,
|
|
1276
1339
|
starred: h,
|
|
@@ -1288,7 +1351,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1288
1351
|
type: "button",
|
|
1289
1352
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1290
1353
|
children: /* @__PURE__ */ e(
|
|
1291
|
-
|
|
1354
|
+
Ie,
|
|
1292
1355
|
{
|
|
1293
1356
|
className: R("size-5", {
|
|
1294
1357
|
"text-yellow-600": h,
|
|
@@ -1306,7 +1369,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1306
1369
|
onClick: n,
|
|
1307
1370
|
type: "button",
|
|
1308
1371
|
"aria-label": "Show info",
|
|
1309
|
-
children: /* @__PURE__ */ e(
|
|
1372
|
+
children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
|
|
1310
1373
|
}
|
|
1311
1374
|
)
|
|
1312
1375
|
] })
|
|
@@ -1326,7 +1389,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1326
1389
|
/* @__PURE__ */ e(
|
|
1327
1390
|
se,
|
|
1328
1391
|
{
|
|
1329
|
-
id: ((_ = a == null ? void 0 : a.user) == null ? void 0 : _.id) ||
|
|
1392
|
+
id: ((_ = a == null ? void 0 : a.user) == null ? void 0 : _.id) || d.id || "unknown",
|
|
1330
1393
|
name: c,
|
|
1331
1394
|
image: g,
|
|
1332
1395
|
starred: h,
|
|
@@ -1344,7 +1407,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1344
1407
|
type: "button",
|
|
1345
1408
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1346
1409
|
children: /* @__PURE__ */ e(
|
|
1347
|
-
|
|
1410
|
+
Ie,
|
|
1348
1411
|
{
|
|
1349
1412
|
className: R("size-5", {
|
|
1350
1413
|
"text-yellow-600": h,
|
|
@@ -1362,67 +1425,67 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1362
1425
|
onClick: n,
|
|
1363
1426
|
type: "button",
|
|
1364
1427
|
"aria-label": "Show info",
|
|
1365
|
-
children: /* @__PURE__ */ e(
|
|
1428
|
+
children: /* @__PURE__ */ e(Fe, { className: "size-5 text-black/90" })
|
|
1366
1429
|
}
|
|
1367
1430
|
)
|
|
1368
1431
|
] })
|
|
1369
1432
|
] })
|
|
1370
1433
|
] });
|
|
1371
|
-
},
|
|
1434
|
+
}, Gs = ({
|
|
1372
1435
|
onBack: t,
|
|
1373
1436
|
showBackButton: s,
|
|
1374
1437
|
renderMessageInputActions: n,
|
|
1375
1438
|
renderConversationFooter: o,
|
|
1376
1439
|
onLeaveConversation: l,
|
|
1377
|
-
onBlockParticipant:
|
|
1440
|
+
onBlockParticipant: d,
|
|
1378
1441
|
showDeleteConversation: a = !0,
|
|
1379
1442
|
onDeleteConversationClick: c,
|
|
1380
1443
|
onBlockParticipantClick: g,
|
|
1381
1444
|
onReportParticipantClick: h,
|
|
1382
1445
|
showStarButton: b = !1,
|
|
1383
1446
|
chatbotVotingEnabled: x = !1,
|
|
1384
|
-
renderChannelBanner:
|
|
1447
|
+
renderChannelBanner: p,
|
|
1385
1448
|
customProfileContent: r,
|
|
1386
|
-
customChannelActions:
|
|
1449
|
+
customChannelActions: w,
|
|
1387
1450
|
renderMessage: _
|
|
1388
1451
|
}) => {
|
|
1389
|
-
const { channel: C } =
|
|
1452
|
+
const { channel: C } = Te(), M = X(null), E = B.useMemo(() => Object.values(C.state.members || {}).find(
|
|
1390
1453
|
(u) => {
|
|
1391
1454
|
var N;
|
|
1392
1455
|
return ((N = u.user) == null ? void 0 : N.id) && u.user.id !== C._client.userID;
|
|
1393
1456
|
}
|
|
1394
|
-
), [C._client.userID, C.state.members]),
|
|
1395
|
-
const
|
|
1396
|
-
if (
|
|
1397
|
-
return String(
|
|
1398
|
-
if (
|
|
1399
|
-
return
|
|
1400
|
-
}, [C.data]), S =
|
|
1401
|
-
var
|
|
1402
|
-
(
|
|
1403
|
-
}, []), L =
|
|
1404
|
-
var
|
|
1405
|
-
(
|
|
1457
|
+
), [C._client.userID, C.state.members]), y = B.useMemo(() => {
|
|
1458
|
+
const m = C.data ?? {};
|
|
1459
|
+
if (m.followerStatus)
|
|
1460
|
+
return String(m.followerStatus);
|
|
1461
|
+
if (m.isFollower !== void 0)
|
|
1462
|
+
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1463
|
+
}, [C.data]), S = A(() => {
|
|
1464
|
+
var m;
|
|
1465
|
+
(m = M.current) == null || m.showModal();
|
|
1466
|
+
}, []), L = A(() => {
|
|
1467
|
+
var m;
|
|
1468
|
+
(m = M.current) == null || m.close();
|
|
1406
1469
|
}, []);
|
|
1407
|
-
return /* @__PURE__ */ i(
|
|
1470
|
+
return /* @__PURE__ */ i(ce, { children: [
|
|
1408
1471
|
/* @__PURE__ */ e(
|
|
1409
1472
|
Vt,
|
|
1410
1473
|
{
|
|
1411
1474
|
overrides: {
|
|
1412
|
-
Message: (
|
|
1475
|
+
Message: (m) => {
|
|
1413
1476
|
const { message: u } = je("ChannelView"), N = /* @__PURE__ */ e(
|
|
1414
|
-
|
|
1477
|
+
ys,
|
|
1415
1478
|
{
|
|
1416
|
-
...
|
|
1479
|
+
...m,
|
|
1417
1480
|
chatbotVotingEnabled: x
|
|
1418
1481
|
}
|
|
1419
1482
|
);
|
|
1420
1483
|
return !_ || !u ? N : _(N, u);
|
|
1421
1484
|
}
|
|
1422
1485
|
},
|
|
1423
|
-
children: /* @__PURE__ */ i(
|
|
1486
|
+
children: /* @__PURE__ */ i(Yt, { children: [
|
|
1424
1487
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1425
|
-
|
|
1488
|
+
Bs,
|
|
1426
1489
|
{
|
|
1427
1490
|
onBack: t,
|
|
1428
1491
|
showBackButton: s,
|
|
@@ -1431,7 +1494,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1431
1494
|
showStarButton: b
|
|
1432
1495
|
}
|
|
1433
1496
|
) }),
|
|
1434
|
-
|
|
1497
|
+
p == null ? void 0 : p(),
|
|
1435
1498
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1436
1499
|
Wt,
|
|
1437
1500
|
{
|
|
@@ -1442,7 +1505,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1442
1505
|
) }),
|
|
1443
1506
|
o == null ? void 0 : o(C),
|
|
1444
1507
|
/* @__PURE__ */ e(
|
|
1445
|
-
|
|
1508
|
+
Is,
|
|
1446
1509
|
{
|
|
1447
1510
|
renderActions: () => n == null ? void 0 : n(C)
|
|
1448
1511
|
}
|
|
@@ -1451,68 +1514,68 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1451
1514
|
}
|
|
1452
1515
|
),
|
|
1453
1516
|
/* @__PURE__ */ e(
|
|
1454
|
-
|
|
1517
|
+
hs,
|
|
1455
1518
|
{
|
|
1456
1519
|
dialogRef: M,
|
|
1457
1520
|
onClose: L,
|
|
1458
1521
|
participant: E,
|
|
1459
1522
|
channel: C,
|
|
1460
|
-
followerStatusLabel:
|
|
1523
|
+
followerStatusLabel: y,
|
|
1461
1524
|
onLeaveConversation: l,
|
|
1462
|
-
onBlockParticipant:
|
|
1525
|
+
onBlockParticipant: d,
|
|
1463
1526
|
showDeleteConversation: a,
|
|
1464
1527
|
onDeleteConversationClick: c,
|
|
1465
1528
|
onBlockParticipantClick: g,
|
|
1466
1529
|
onReportParticipantClick: h,
|
|
1467
1530
|
customProfileContent: r,
|
|
1468
|
-
customChannelActions:
|
|
1531
|
+
customChannelActions: w
|
|
1469
1532
|
}
|
|
1470
1533
|
)
|
|
1471
1534
|
] });
|
|
1472
|
-
},
|
|
1535
|
+
}, Xe = B.memo(
|
|
1473
1536
|
({
|
|
1474
1537
|
channel: t,
|
|
1475
1538
|
onBack: s,
|
|
1476
1539
|
showBackButton: n = !1,
|
|
1477
1540
|
renderMessageInputActions: o,
|
|
1478
1541
|
renderConversationFooter: l,
|
|
1479
|
-
onLeaveConversation:
|
|
1542
|
+
onLeaveConversation: d,
|
|
1480
1543
|
onBlockParticipant: a,
|
|
1481
1544
|
className: c,
|
|
1482
|
-
CustomChannelEmptyState: g =
|
|
1545
|
+
CustomChannelEmptyState: g = Os,
|
|
1483
1546
|
showDeleteConversation: h = !0,
|
|
1484
1547
|
onDeleteConversationClick: b,
|
|
1485
1548
|
onBlockParticipantClick: x,
|
|
1486
|
-
onReportParticipantClick:
|
|
1549
|
+
onReportParticipantClick: p,
|
|
1487
1550
|
dmAgentEnabled: r,
|
|
1488
|
-
messageMetadata:
|
|
1551
|
+
messageMetadata: w,
|
|
1489
1552
|
onMessageSent: _,
|
|
1490
1553
|
showStarButton: C = !1,
|
|
1491
1554
|
chatbotVotingEnabled: M = !1,
|
|
1492
1555
|
renderChannelBanner: E,
|
|
1493
|
-
customProfileContent:
|
|
1556
|
+
customProfileContent: y,
|
|
1494
1557
|
customChannelActions: S,
|
|
1495
1558
|
renderMessage: L
|
|
1496
1559
|
}) => {
|
|
1497
|
-
const
|
|
1560
|
+
const m = A(
|
|
1498
1561
|
async (u, N, v) => {
|
|
1499
1562
|
var D;
|
|
1500
|
-
const f = ((D = t.data) == null ? void 0 : D.chatbot_paused) === !0, k = r && !f,
|
|
1563
|
+
const f = ((D = t.data) == null ? void 0 : D.chatbot_paused) === !0, k = r && !f, V = {
|
|
1501
1564
|
...N,
|
|
1502
1565
|
...k && { silent: !0 },
|
|
1503
|
-
...
|
|
1566
|
+
...w && {
|
|
1504
1567
|
metadata: {
|
|
1505
1568
|
...N.metadata ?? {},
|
|
1506
|
-
...
|
|
1569
|
+
...w
|
|
1507
1570
|
}
|
|
1508
1571
|
}
|
|
1509
1572
|
}, Z = {
|
|
1510
1573
|
...v,
|
|
1511
1574
|
...k && { skip_push: !0 }
|
|
1512
|
-
},
|
|
1513
|
-
return _ == null || _(
|
|
1575
|
+
}, q = await t.sendMessage(V, Z);
|
|
1576
|
+
return _ == null || _(q), q;
|
|
1514
1577
|
},
|
|
1515
|
-
[t, r,
|
|
1578
|
+
[t, r, w, _]
|
|
1516
1579
|
);
|
|
1517
1580
|
return /* @__PURE__ */ e(
|
|
1518
1581
|
"div",
|
|
@@ -1522,32 +1585,32 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1522
1585
|
c
|
|
1523
1586
|
),
|
|
1524
1587
|
children: /* @__PURE__ */ e(
|
|
1525
|
-
|
|
1588
|
+
Ht,
|
|
1526
1589
|
{
|
|
1527
1590
|
channel: t,
|
|
1528
|
-
MessageSystem:
|
|
1591
|
+
MessageSystem: Fs,
|
|
1529
1592
|
EmptyStateIndicator: g,
|
|
1530
1593
|
LoadingIndicator: Ne,
|
|
1531
|
-
DateSeparator:
|
|
1532
|
-
doSendMessageRequest:
|
|
1594
|
+
DateSeparator: fs,
|
|
1595
|
+
doSendMessageRequest: m,
|
|
1533
1596
|
children: /* @__PURE__ */ e(
|
|
1534
|
-
|
|
1597
|
+
Gs,
|
|
1535
1598
|
{
|
|
1536
1599
|
onBack: s,
|
|
1537
1600
|
showBackButton: n,
|
|
1538
1601
|
renderMessageInputActions: o,
|
|
1539
1602
|
renderConversationFooter: l,
|
|
1540
|
-
onLeaveConversation:
|
|
1603
|
+
onLeaveConversation: d,
|
|
1541
1604
|
onBlockParticipant: a,
|
|
1542
1605
|
CustomChannelEmptyState: g,
|
|
1543
1606
|
showDeleteConversation: h,
|
|
1544
1607
|
onDeleteConversationClick: b,
|
|
1545
1608
|
onBlockParticipantClick: x,
|
|
1546
|
-
onReportParticipantClick:
|
|
1609
|
+
onReportParticipantClick: p,
|
|
1547
1610
|
showStarButton: C,
|
|
1548
1611
|
chatbotVotingEnabled: M,
|
|
1549
1612
|
renderChannelBanner: E,
|
|
1550
|
-
customProfileContent:
|
|
1613
|
+
customProfileContent: y,
|
|
1551
1614
|
customChannelActions: S,
|
|
1552
1615
|
renderMessage: L
|
|
1553
1616
|
}
|
|
@@ -1558,16 +1621,16 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1558
1621
|
);
|
|
1559
1622
|
}
|
|
1560
1623
|
);
|
|
1561
|
-
|
|
1562
|
-
function
|
|
1624
|
+
Xe.displayName = "ChannelView";
|
|
1625
|
+
function $s({
|
|
1563
1626
|
searchQuery: t,
|
|
1564
1627
|
setSearchQuery: s,
|
|
1565
1628
|
placeholder: n
|
|
1566
1629
|
}) {
|
|
1567
|
-
const o =
|
|
1630
|
+
const o = X(null);
|
|
1568
1631
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1569
1632
|
/* @__PURE__ */ e(
|
|
1570
|
-
|
|
1633
|
+
es,
|
|
1571
1634
|
{
|
|
1572
1635
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1573
1636
|
weight: "bold"
|
|
@@ -1585,7 +1648,7 @@ function Ps({
|
|
|
1585
1648
|
}
|
|
1586
1649
|
),
|
|
1587
1650
|
t && /* @__PURE__ */ e(
|
|
1588
|
-
|
|
1651
|
+
Ze,
|
|
1589
1652
|
{
|
|
1590
1653
|
label: "Clear search",
|
|
1591
1654
|
onClick: () => {
|
|
@@ -1593,24 +1656,24 @@ function Ps({
|
|
|
1593
1656
|
s(""), (l = o.current) == null || l.focus();
|
|
1594
1657
|
},
|
|
1595
1658
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1596
|
-
children: /* @__PURE__ */ e(
|
|
1659
|
+
children: /* @__PURE__ */ e(De, { className: "h-4 w-4", weight: "bold" })
|
|
1597
1660
|
}
|
|
1598
1661
|
)
|
|
1599
1662
|
] });
|
|
1600
1663
|
}
|
|
1601
|
-
const
|
|
1664
|
+
const js = ({
|
|
1602
1665
|
participantSource: t,
|
|
1603
1666
|
onSelectParticipant: s,
|
|
1604
1667
|
onClose: n,
|
|
1605
1668
|
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
1606
1669
|
participantLabel: l = "participants",
|
|
1607
|
-
searchPlaceholder:
|
|
1670
|
+
searchPlaceholder: d = "Search participants...",
|
|
1608
1671
|
className: a
|
|
1609
1672
|
}) => {
|
|
1610
|
-
const { debug: c } = ve(), [g, h] = T(""), [b, x] = T([]), [
|
|
1673
|
+
const { debug: c } = ve(), [g, h] = T(""), [b, x] = T([]), [p, r] = T(!1), [w, _] = T(null), [C, M] = T(
|
|
1611
1674
|
null
|
|
1612
|
-
), E =
|
|
1613
|
-
|
|
1675
|
+
), E = X(!1);
|
|
1676
|
+
K(() => {
|
|
1614
1677
|
if (t.loading) {
|
|
1615
1678
|
c && console.log(
|
|
1616
1679
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
@@ -1638,84 +1701,84 @@ const Us = ({
|
|
|
1638
1701
|
}
|
|
1639
1702
|
})();
|
|
1640
1703
|
}, [t.loading, c]);
|
|
1641
|
-
const
|
|
1704
|
+
const y = b.filter((m) => !o.has(m.id)).filter((m) => {
|
|
1642
1705
|
var N;
|
|
1643
1706
|
if (!g) return !0;
|
|
1644
1707
|
const u = g.toLowerCase();
|
|
1645
|
-
return
|
|
1646
|
-
}), S =
|
|
1647
|
-
async (
|
|
1708
|
+
return m.name.toLowerCase().includes(u) || ((N = m.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
|
|
1709
|
+
}), S = A(
|
|
1710
|
+
async (m) => {
|
|
1648
1711
|
if (!C) {
|
|
1649
|
-
M(
|
|
1712
|
+
M(m.id);
|
|
1650
1713
|
try {
|
|
1651
|
-
await s(
|
|
1714
|
+
await s(m);
|
|
1652
1715
|
} catch (u) {
|
|
1653
1716
|
console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
|
|
1654
1717
|
}
|
|
1655
1718
|
}
|
|
1656
1719
|
},
|
|
1657
1720
|
[s, C]
|
|
1658
|
-
), L = (
|
|
1659
|
-
(
|
|
1721
|
+
), L = (m, u) => {
|
|
1722
|
+
(m.key === "Enter" || m.key === " ") && (m.preventDefault(), S(u));
|
|
1660
1723
|
};
|
|
1661
1724
|
return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
|
|
1662
1725
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1663
1726
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1664
1727
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1665
|
-
/* @__PURE__ */ e(
|
|
1728
|
+
/* @__PURE__ */ e(Je, { onClick: n })
|
|
1666
1729
|
] }),
|
|
1667
1730
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1668
1731
|
"Select a ",
|
|
1669
1732
|
l.slice(0, -1),
|
|
1670
1733
|
" to start messaging (",
|
|
1671
|
-
|
|
1734
|
+
y.length,
|
|
1672
1735
|
" available)",
|
|
1673
1736
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
|
|
1674
1737
|
] }),
|
|
1675
1738
|
/* @__PURE__ */ e(
|
|
1676
|
-
|
|
1739
|
+
$s,
|
|
1677
1740
|
{
|
|
1678
1741
|
searchQuery: g,
|
|
1679
1742
|
setSearchQuery: h,
|
|
1680
|
-
placeholder:
|
|
1743
|
+
placeholder: d
|
|
1681
1744
|
}
|
|
1682
1745
|
)
|
|
1683
1746
|
] }),
|
|
1684
|
-
|
|
1747
|
+
w && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1685
1748
|
"Error loading ",
|
|
1686
1749
|
l,
|
|
1687
1750
|
": ",
|
|
1688
|
-
|
|
1751
|
+
w
|
|
1689
1752
|
] }),
|
|
1690
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1753
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: p && y.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: [
|
|
1691
1754
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1692
1755
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1693
1756
|
"Loading ",
|
|
1694
1757
|
l,
|
|
1695
1758
|
"..."
|
|
1696
1759
|
] })
|
|
1697
|
-
] }) }) :
|
|
1760
|
+
] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1698
1761
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Oe, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1699
1762
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
|
|
1700
1763
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "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` })
|
|
1701
1764
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1702
|
-
|
|
1703
|
-
const u =
|
|
1765
|
+
y.map((m) => {
|
|
1766
|
+
const u = m.name || m.email || m.id, N = m.email && m.name ? m.email : m.phone;
|
|
1704
1767
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1705
1768
|
"button",
|
|
1706
1769
|
{
|
|
1707
1770
|
type: "button",
|
|
1708
|
-
onClick: () => S(
|
|
1709
|
-
onKeyDown: (v) => L(v,
|
|
1771
|
+
onClick: () => S(m),
|
|
1772
|
+
onKeyDown: (v) => L(v, m),
|
|
1710
1773
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1711
1774
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1712
1775
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1713
1776
|
/* @__PURE__ */ e(
|
|
1714
1777
|
se,
|
|
1715
1778
|
{
|
|
1716
|
-
id:
|
|
1779
|
+
id: m.id,
|
|
1717
1780
|
name: u,
|
|
1718
|
-
image:
|
|
1781
|
+
image: m.image,
|
|
1719
1782
|
size: 40
|
|
1720
1783
|
}
|
|
1721
1784
|
),
|
|
@@ -1724,18 +1787,18 @@ const Us = ({
|
|
|
1724
1787
|
N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
|
|
1725
1788
|
] })
|
|
1726
1789
|
] }),
|
|
1727
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C ===
|
|
1790
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === m.id ? /* @__PURE__ */ e(be, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone" }) })
|
|
1728
1791
|
] })
|
|
1729
1792
|
}
|
|
1730
|
-
) },
|
|
1793
|
+
) }, m.id);
|
|
1731
1794
|
}),
|
|
1732
|
-
|
|
1795
|
+
p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1733
1796
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1734
1797
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1735
1798
|
] }) })
|
|
1736
1799
|
] }) })
|
|
1737
1800
|
] });
|
|
1738
|
-
},
|
|
1801
|
+
}, zs = ({ className: t }) => /* @__PURE__ */ i(
|
|
1739
1802
|
"svg",
|
|
1740
1803
|
{
|
|
1741
1804
|
width: "140",
|
|
@@ -1869,16 +1932,16 @@ const Us = ({
|
|
|
1869
1932
|
] })
|
|
1870
1933
|
]
|
|
1871
1934
|
}
|
|
1872
|
-
),
|
|
1935
|
+
), Ke = B.memo(
|
|
1873
1936
|
({ 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: [
|
|
1874
|
-
/* @__PURE__ */ e(
|
|
1937
|
+
/* @__PURE__ */ e(zs, {}),
|
|
1875
1938
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1876
1939
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1877
1940
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1878
1941
|
] })
|
|
1879
1942
|
] }) })
|
|
1880
1943
|
);
|
|
1881
|
-
|
|
1944
|
+
Ke.displayName = "EmptyState";
|
|
1882
1945
|
const Ce = B.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: [
|
|
1883
1946
|
/* @__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: "⚠️" }) }),
|
|
1884
1947
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
@@ -1894,30 +1957,30 @@ const Ce = B.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1894
1957
|
)
|
|
1895
1958
|
] }) }));
|
|
1896
1959
|
Ce.displayName = "ErrorState";
|
|
1897
|
-
const
|
|
1960
|
+
const Qs = ({
|
|
1898
1961
|
capabilities: t = {},
|
|
1899
1962
|
className: s,
|
|
1900
1963
|
renderMessageInputActions: n,
|
|
1901
1964
|
renderConversationFooter: o,
|
|
1902
1965
|
onChannelSelect: l,
|
|
1903
|
-
onParticipantSelect:
|
|
1966
|
+
onParticipantSelect: d,
|
|
1904
1967
|
initialParticipantFilter: a,
|
|
1905
1968
|
initialParticipantData: c,
|
|
1906
1969
|
CustomChannelEmptyState: g,
|
|
1907
1970
|
showChannelList: h = !0,
|
|
1908
1971
|
filters: b,
|
|
1909
1972
|
channelListCustomEmptyStateIndicator: x,
|
|
1910
|
-
onDeleteConversationClick:
|
|
1973
|
+
onDeleteConversationClick: p,
|
|
1911
1974
|
onBlockParticipantClick: r,
|
|
1912
|
-
onReportParticipantClick:
|
|
1975
|
+
onReportParticipantClick: w,
|
|
1913
1976
|
dmAgentEnabled: _,
|
|
1914
1977
|
messageMetadata: C,
|
|
1915
1978
|
onMessageSent: M,
|
|
1916
1979
|
showStarButton: E = !1,
|
|
1917
|
-
chatbotVotingEnabled:
|
|
1980
|
+
chatbotVotingEnabled: y = !1,
|
|
1918
1981
|
renderMessagePreview: S,
|
|
1919
1982
|
renderChannelBanner: L,
|
|
1920
|
-
customProfileContent:
|
|
1983
|
+
customProfileContent: m,
|
|
1921
1984
|
customChannelActions: u,
|
|
1922
1985
|
renderMessage: N
|
|
1923
1986
|
}) => {
|
|
@@ -1925,15 +1988,15 @@ const Ws = ({
|
|
|
1925
1988
|
service: v,
|
|
1926
1989
|
client: f,
|
|
1927
1990
|
isConnected: k,
|
|
1928
|
-
isLoading:
|
|
1991
|
+
isLoading: V,
|
|
1929
1992
|
error: Z,
|
|
1930
|
-
refreshConnection:
|
|
1993
|
+
refreshConnection: q,
|
|
1931
1994
|
debug: D
|
|
1932
|
-
} =
|
|
1933
|
-
participantSource:
|
|
1995
|
+
} = ts(), [Y, $] = T(null), [ne, ae] = T(!1), [j, Q] = T(!1), [re, P] = T(!1), [F, U] = T(/* @__PURE__ */ new Set()), [z, de] = T(0), [W, oe] = T(!1), [ee, J] = T(null), te = X(null), {
|
|
1996
|
+
participantSource: me,
|
|
1934
1997
|
participantLabel: ue = "participants",
|
|
1935
|
-
showDeleteConversation:
|
|
1936
|
-
} = t,
|
|
1998
|
+
showDeleteConversation: Qe = !0
|
|
1999
|
+
} = t, et = B.useMemo(() => {
|
|
1937
2000
|
const I = f == null ? void 0 : f.userID;
|
|
1938
2001
|
return {
|
|
1939
2002
|
...{
|
|
@@ -1946,61 +2009,61 @@ const Ws = ({
|
|
|
1946
2009
|
},
|
|
1947
2010
|
...b
|
|
1948
2011
|
};
|
|
1949
|
-
}, [b, f == null ? void 0 : f.userID]), he =
|
|
2012
|
+
}, [b, f == null ? void 0 : f.userID]), he = X(null), le = A(async () => {
|
|
1950
2013
|
if (!f || !k) return;
|
|
1951
2014
|
const I = f.userID;
|
|
1952
2015
|
if (I)
|
|
1953
2016
|
try {
|
|
1954
2017
|
D && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
1955
|
-
const
|
|
2018
|
+
const H = await f.queryChannels(
|
|
1956
2019
|
{
|
|
1957
2020
|
type: "messaging",
|
|
1958
2021
|
members: { $in: [I] }
|
|
1959
2022
|
},
|
|
1960
2023
|
{},
|
|
1961
2024
|
{ limit: 100 }
|
|
1962
|
-
),
|
|
1963
|
-
|
|
1964
|
-
const
|
|
1965
|
-
Object.values(
|
|
1966
|
-
var
|
|
1967
|
-
const
|
|
1968
|
-
|
|
2025
|
+
), O = /* @__PURE__ */ new Set();
|
|
2026
|
+
H.forEach((G) => {
|
|
2027
|
+
const pe = G.state.members;
|
|
2028
|
+
Object.values(pe).forEach((lt) => {
|
|
2029
|
+
var Le;
|
|
2030
|
+
const ye = (Le = lt.user) == null ? void 0 : Le.id;
|
|
2031
|
+
ye && ye !== I && O.add(ye);
|
|
1969
2032
|
});
|
|
1970
|
-
}),
|
|
1971
|
-
channelCount:
|
|
1972
|
-
memberCount:
|
|
2033
|
+
}), U((G) => G.size === O.size && [...G].every((pe) => O.has(pe)) ? G : O), ae(H.length > 0), Q(!0), he.current = I, D && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2034
|
+
channelCount: H.length,
|
|
2035
|
+
memberCount: O.size
|
|
1973
2036
|
});
|
|
1974
|
-
} catch (
|
|
1975
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
2037
|
+
} catch (H) {
|
|
2038
|
+
console.error("[MessagingShell] Failed to sync channels:", H);
|
|
1976
2039
|
}
|
|
1977
2040
|
}, [f, k, D]);
|
|
1978
|
-
|
|
2041
|
+
K(() => {
|
|
1979
2042
|
if (!f || !k) return;
|
|
1980
2043
|
const I = f.userID;
|
|
1981
2044
|
I && he.current !== I && le();
|
|
1982
|
-
}, [f, k, le]),
|
|
2045
|
+
}, [f, k, le]), K(() => {
|
|
1983
2046
|
if (!a || !f || !k) return;
|
|
1984
2047
|
(async () => {
|
|
1985
|
-
const
|
|
1986
|
-
if (
|
|
2048
|
+
const H = f.userID;
|
|
2049
|
+
if (H)
|
|
1987
2050
|
try {
|
|
1988
2051
|
D && console.log(
|
|
1989
2052
|
"[MessagingShell] Loading initial conversation with:",
|
|
1990
2053
|
a
|
|
1991
2054
|
);
|
|
1992
|
-
const
|
|
2055
|
+
const O = await f.queryChannels(
|
|
1993
2056
|
{
|
|
1994
2057
|
type: "messaging",
|
|
1995
|
-
members: { $eq: [
|
|
2058
|
+
members: { $eq: [H, a] }
|
|
1996
2059
|
},
|
|
1997
2060
|
{},
|
|
1998
2061
|
{ limit: 1 }
|
|
1999
2062
|
);
|
|
2000
|
-
if (
|
|
2001
|
-
|
|
2063
|
+
if (O.length > 0)
|
|
2064
|
+
$(O[0]), oe(!0), J(null), l && l(O[0]), D && console.log(
|
|
2002
2065
|
"[MessagingShell] Initial conversation loaded:",
|
|
2003
|
-
|
|
2066
|
+
O[0].id
|
|
2004
2067
|
);
|
|
2005
2068
|
else if (c && v) {
|
|
2006
2069
|
D && console.log(
|
|
@@ -2008,20 +2071,20 @@ const Ws = ({
|
|
|
2008
2071
|
c
|
|
2009
2072
|
);
|
|
2010
2073
|
try {
|
|
2011
|
-
const
|
|
2074
|
+
const G = await v.startChannelWithParticipant({
|
|
2012
2075
|
id: c.id,
|
|
2013
2076
|
name: c.name,
|
|
2014
2077
|
email: c.email,
|
|
2015
2078
|
phone: c.phone
|
|
2016
2079
|
});
|
|
2017
|
-
|
|
2080
|
+
$(G), oe(!0), J(null), l && l(G), D && console.log(
|
|
2018
2081
|
"[MessagingShell] Channel created and loaded:",
|
|
2019
|
-
|
|
2082
|
+
G.id
|
|
2020
2083
|
);
|
|
2021
|
-
} catch (
|
|
2084
|
+
} catch (G) {
|
|
2022
2085
|
console.error(
|
|
2023
2086
|
"[MessagingShell] Failed to create conversation:",
|
|
2024
|
-
|
|
2087
|
+
G
|
|
2025
2088
|
), J("Failed to create conversation");
|
|
2026
2089
|
}
|
|
2027
2090
|
} else
|
|
@@ -2031,10 +2094,10 @@ const Ws = ({
|
|
|
2031
2094
|
"[MessagingShell] No conversation found for:",
|
|
2032
2095
|
a
|
|
2033
2096
|
);
|
|
2034
|
-
} catch (
|
|
2097
|
+
} catch (O) {
|
|
2035
2098
|
console.error(
|
|
2036
2099
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2037
|
-
|
|
2100
|
+
O
|
|
2038
2101
|
), J("Failed to load conversation");
|
|
2039
2102
|
}
|
|
2040
2103
|
})();
|
|
@@ -2047,63 +2110,63 @@ const Ws = ({
|
|
|
2047
2110
|
D,
|
|
2048
2111
|
l
|
|
2049
2112
|
]);
|
|
2050
|
-
const
|
|
2113
|
+
const tt = A(
|
|
2051
2114
|
(I) => {
|
|
2052
|
-
|
|
2115
|
+
$(I), l == null || l(I);
|
|
2053
2116
|
},
|
|
2054
2117
|
[l]
|
|
2055
|
-
),
|
|
2056
|
-
|
|
2057
|
-
}, [
|
|
2118
|
+
), st = A(() => {
|
|
2119
|
+
W || $(null);
|
|
2120
|
+
}, [W]), nt = A(
|
|
2058
2121
|
async (I) => {
|
|
2059
|
-
var
|
|
2122
|
+
var H;
|
|
2060
2123
|
if (v)
|
|
2061
2124
|
try {
|
|
2062
2125
|
D && console.log(
|
|
2063
2126
|
"[MessagingShell] Starting conversation with:",
|
|
2064
2127
|
I.id
|
|
2065
2128
|
);
|
|
2066
|
-
const
|
|
2129
|
+
const O = await v.startChannelWithParticipant({
|
|
2067
2130
|
id: I.id,
|
|
2068
2131
|
name: I.name,
|
|
2069
2132
|
email: I.email,
|
|
2070
2133
|
phone: I.phone
|
|
2071
2134
|
});
|
|
2072
2135
|
try {
|
|
2073
|
-
await
|
|
2074
|
-
} catch (
|
|
2075
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
2136
|
+
await O.show();
|
|
2137
|
+
} catch (G) {
|
|
2138
|
+
console.warn("[MessagingShell] Failed to unhide channel:", G);
|
|
2076
2139
|
}
|
|
2077
|
-
|
|
2078
|
-
} catch (
|
|
2079
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2140
|
+
$(O), P(!1), (H = te.current) == null || H.close(), d == null || d(I);
|
|
2141
|
+
} catch (O) {
|
|
2142
|
+
console.error("[MessagingShell] Failed to start conversation:", O);
|
|
2080
2143
|
}
|
|
2081
2144
|
},
|
|
2082
|
-
[v,
|
|
2083
|
-
), fe =
|
|
2145
|
+
[v, d, D]
|
|
2146
|
+
), fe = A(() => {
|
|
2084
2147
|
var I;
|
|
2085
|
-
|
|
2086
|
-
}, []),
|
|
2148
|
+
P(!1), (I = te.current) == null || I.close();
|
|
2149
|
+
}, []), at = A(
|
|
2087
2150
|
(I) => {
|
|
2088
2151
|
I.target === te.current && fe();
|
|
2089
2152
|
},
|
|
2090
2153
|
[fe]
|
|
2091
|
-
),
|
|
2154
|
+
), rt = A(
|
|
2092
2155
|
async (I) => {
|
|
2093
|
-
D && console.log("[MessagingShell] Leaving conversation:", I.id),
|
|
2156
|
+
D && console.log("[MessagingShell] Leaving conversation:", I.id), $(null), oe(!1), he.current = null, await le();
|
|
2094
2157
|
},
|
|
2095
2158
|
[le, D]
|
|
2096
|
-
),
|
|
2159
|
+
), ot = A(
|
|
2097
2160
|
async (I) => {
|
|
2098
|
-
D && console.log("[MessagingShell] Blocking participant:", I),
|
|
2161
|
+
D && console.log("[MessagingShell] Blocking participant:", I), $(null), oe(!1), he.current = null, await le();
|
|
2099
2162
|
},
|
|
2100
2163
|
[le, D]
|
|
2101
|
-
), ge = !!
|
|
2102
|
-
return
|
|
2164
|
+
), ge = !!Y;
|
|
2165
|
+
return V ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: Z, onBack: q }) }) : !k || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
|
|
2103
2166
|
Ce,
|
|
2104
2167
|
{
|
|
2105
2168
|
message: "Not connected to messaging service",
|
|
2106
|
-
onBack:
|
|
2169
|
+
onBack: q
|
|
2107
2170
|
}
|
|
2108
2171
|
) }) : ee ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: ee }) }) : /* @__PURE__ */ i(
|
|
2109
2172
|
"div",
|
|
@@ -2120,19 +2183,19 @@ const Ws = ({
|
|
|
2120
2183
|
className: R(
|
|
2121
2184
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2122
2185
|
{
|
|
2123
|
-
"!hidden": h === !1 ||
|
|
2186
|
+
"!hidden": h === !1 || W,
|
|
2124
2187
|
// Hide on mobile when channel selected, show on desktop with consistent wide width
|
|
2125
|
-
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !
|
|
2188
|
+
"hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !W && ge,
|
|
2126
2189
|
// Show on mobile when no channel selected, use same wide width on desktop
|
|
2127
|
-
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !
|
|
2190
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !W && !ge
|
|
2128
2191
|
}
|
|
2129
2192
|
),
|
|
2130
2193
|
children: /* @__PURE__ */ e(
|
|
2131
2194
|
qe,
|
|
2132
2195
|
{
|
|
2133
|
-
onChannelSelect:
|
|
2134
|
-
selectedChannel:
|
|
2135
|
-
filters:
|
|
2196
|
+
onChannelSelect: tt,
|
|
2197
|
+
selectedChannel: Y || void 0,
|
|
2198
|
+
filters: et,
|
|
2136
2199
|
customEmptyStateIndicator: x,
|
|
2137
2200
|
renderMessagePreview: S
|
|
2138
2201
|
}
|
|
@@ -2146,65 +2209,65 @@ const Ws = ({
|
|
|
2146
2209
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2147
2210
|
{
|
|
2148
2211
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
2149
|
-
flex:
|
|
2212
|
+
flex: W || ge || a,
|
|
2150
2213
|
// Normal mode: hide on mobile when no channel selected
|
|
2151
|
-
"hidden lg:flex": !
|
|
2214
|
+
"hidden lg:flex": !W && !ge && !a
|
|
2152
2215
|
}
|
|
2153
2216
|
),
|
|
2154
|
-
children:
|
|
2155
|
-
|
|
2217
|
+
children: Y ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2218
|
+
Xe,
|
|
2156
2219
|
{
|
|
2157
|
-
channel:
|
|
2158
|
-
onBack:
|
|
2159
|
-
showBackButton: !
|
|
2220
|
+
channel: Y,
|
|
2221
|
+
onBack: st,
|
|
2222
|
+
showBackButton: !W,
|
|
2160
2223
|
renderMessageInputActions: n,
|
|
2161
2224
|
renderConversationFooter: o,
|
|
2162
2225
|
renderChannelBanner: L,
|
|
2163
|
-
onLeaveConversation:
|
|
2164
|
-
onBlockParticipant:
|
|
2226
|
+
onLeaveConversation: rt,
|
|
2227
|
+
onBlockParticipant: ot,
|
|
2165
2228
|
CustomChannelEmptyState: g,
|
|
2166
|
-
showDeleteConversation:
|
|
2167
|
-
onDeleteConversationClick:
|
|
2229
|
+
showDeleteConversation: Qe,
|
|
2230
|
+
onDeleteConversationClick: p,
|
|
2168
2231
|
onBlockParticipantClick: r,
|
|
2169
|
-
onReportParticipantClick:
|
|
2232
|
+
onReportParticipantClick: w,
|
|
2170
2233
|
dmAgentEnabled: _,
|
|
2171
2234
|
messageMetadata: C,
|
|
2172
2235
|
onMessageSent: M,
|
|
2173
2236
|
showStarButton: E,
|
|
2174
|
-
chatbotVotingEnabled:
|
|
2175
|
-
customProfileContent:
|
|
2237
|
+
chatbotVotingEnabled: y,
|
|
2238
|
+
customProfileContent: m,
|
|
2176
2239
|
customChannelActions: u,
|
|
2177
2240
|
renderMessage: N
|
|
2178
2241
|
},
|
|
2179
|
-
|
|
2242
|
+
Y.id
|
|
2180
2243
|
) }) : a ? (
|
|
2181
2244
|
// Show loading while creating/loading direct conversation channel
|
|
2182
2245
|
/* @__PURE__ */ e(Ne, {})
|
|
2183
2246
|
) : /* @__PURE__ */ e(
|
|
2184
|
-
|
|
2247
|
+
Ke,
|
|
2185
2248
|
{
|
|
2186
2249
|
hasChannels: ne,
|
|
2187
|
-
channelsLoaded:
|
|
2250
|
+
channelsLoaded: j
|
|
2188
2251
|
}
|
|
2189
2252
|
)
|
|
2190
2253
|
}
|
|
2191
2254
|
)
|
|
2192
2255
|
] }),
|
|
2193
|
-
|
|
2256
|
+
me && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2194
2257
|
/* @__PURE__ */ e(
|
|
2195
2258
|
"dialog",
|
|
2196
2259
|
{
|
|
2197
2260
|
ref: te,
|
|
2198
2261
|
className: "mes-dialog",
|
|
2199
|
-
onClick:
|
|
2262
|
+
onClick: at,
|
|
2200
2263
|
onClose: fe,
|
|
2201
2264
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2202
|
-
|
|
2265
|
+
js,
|
|
2203
2266
|
{
|
|
2204
|
-
participantSource:
|
|
2205
|
-
onSelectParticipant:
|
|
2267
|
+
participantSource: me,
|
|
2268
|
+
onSelectParticipant: nt,
|
|
2206
2269
|
onClose: fe,
|
|
2207
|
-
existingParticipantIds:
|
|
2270
|
+
existingParticipantIds: F,
|
|
2208
2271
|
participantLabel: ue,
|
|
2209
2272
|
searchPlaceholder: `Search ${ue}...`
|
|
2210
2273
|
},
|
|
@@ -2215,7 +2278,7 @@ const Ws = ({
|
|
|
2215
2278
|
]
|
|
2216
2279
|
}
|
|
2217
2280
|
);
|
|
2218
|
-
},
|
|
2281
|
+
}, Hs = ({
|
|
2219
2282
|
question: t,
|
|
2220
2283
|
onClick: s,
|
|
2221
2284
|
loading: n = !1,
|
|
@@ -2237,23 +2300,23 @@ const Ws = ({
|
|
|
2237
2300
|
),
|
|
2238
2301
|
children: t
|
|
2239
2302
|
}
|
|
2240
|
-
),
|
|
2303
|
+
), en = ({
|
|
2241
2304
|
faqs: t,
|
|
2242
2305
|
onFaqClick: s,
|
|
2243
2306
|
loadingFaqId: n,
|
|
2244
2307
|
headerText: o,
|
|
2245
2308
|
className: l,
|
|
2246
|
-
avatarImage:
|
|
2309
|
+
avatarImage: d,
|
|
2247
2310
|
avatarName: a
|
|
2248
2311
|
}) => {
|
|
2249
2312
|
const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
|
|
2250
2313
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2251
|
-
(
|
|
2314
|
+
(d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2252
2315
|
se,
|
|
2253
2316
|
{
|
|
2254
2317
|
id: a || "account",
|
|
2255
2318
|
name: a || "Account",
|
|
2256
|
-
image:
|
|
2319
|
+
image: d,
|
|
2257
2320
|
size: 24,
|
|
2258
2321
|
shape: "circle"
|
|
2259
2322
|
}
|
|
@@ -2266,7 +2329,7 @@ const Ws = ({
|
|
|
2266
2329
|
children: [
|
|
2267
2330
|
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2268
2331
|
c.map((g) => /* @__PURE__ */ e(
|
|
2269
|
-
|
|
2332
|
+
Hs,
|
|
2270
2333
|
{
|
|
2271
2334
|
question: g.question,
|
|
2272
2335
|
onClick: () => s(g.id),
|
|
@@ -2278,18 +2341,18 @@ const Ws = ({
|
|
|
2278
2341
|
}
|
|
2279
2342
|
)
|
|
2280
2343
|
] }) });
|
|
2281
|
-
},
|
|
2282
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [l,
|
|
2344
|
+
}, tn = (t, s = {}) => {
|
|
2345
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = T([]), [a, c] = T(!1), [g, h] = T(null), [b, x] = T(n), [p, r] = T(!0), [w, _] = T(), C = A(async (S = !1, L) => {
|
|
2283
2346
|
if (a) return;
|
|
2284
|
-
const
|
|
2347
|
+
const m = L !== void 0 ? L : b;
|
|
2285
2348
|
c(!0), h(null);
|
|
2286
2349
|
try {
|
|
2287
2350
|
const u = await t.loadParticipants({
|
|
2288
|
-
search:
|
|
2351
|
+
search: m || void 0,
|
|
2289
2352
|
limit: o,
|
|
2290
|
-
cursor: S ? void 0 :
|
|
2353
|
+
cursor: S ? void 0 : w
|
|
2291
2354
|
});
|
|
2292
|
-
|
|
2355
|
+
d(
|
|
2293
2356
|
(N) => S ? u.participants : [...N, ...u.participants]
|
|
2294
2357
|
), r(u.hasMore), _(u.nextCursor);
|
|
2295
2358
|
} catch (u) {
|
|
@@ -2298,42 +2361,42 @@ const Ws = ({
|
|
|
2298
2361
|
} finally {
|
|
2299
2362
|
c(!1);
|
|
2300
2363
|
}
|
|
2301
|
-
}, [t, b,
|
|
2302
|
-
|
|
2303
|
-
}, [
|
|
2364
|
+
}, [t, b, w, o, a]), M = A(() => {
|
|
2365
|
+
p && !a && C(!1);
|
|
2366
|
+
}, [p, a, C]), E = A((S) => {
|
|
2304
2367
|
x(S), _(void 0), C(!0, S);
|
|
2305
|
-
}, [C]),
|
|
2368
|
+
}, [C]), y = A(() => {
|
|
2306
2369
|
_(void 0), C(!0);
|
|
2307
2370
|
}, [C]);
|
|
2308
|
-
return
|
|
2371
|
+
return K(() => {
|
|
2309
2372
|
C(!0);
|
|
2310
2373
|
}, [t.loadParticipants]), {
|
|
2311
2374
|
participants: l,
|
|
2312
2375
|
loading: a,
|
|
2313
2376
|
error: g,
|
|
2314
2377
|
searchQuery: b,
|
|
2315
|
-
hasMore:
|
|
2378
|
+
hasMore: p,
|
|
2316
2379
|
totalCount: t.totalCount,
|
|
2317
2380
|
loadMore: M,
|
|
2318
2381
|
search: E,
|
|
2319
|
-
refresh:
|
|
2382
|
+
refresh: y
|
|
2320
2383
|
};
|
|
2321
2384
|
};
|
|
2322
2385
|
export {
|
|
2323
2386
|
xe as ActionButton,
|
|
2324
2387
|
se as Avatar,
|
|
2325
|
-
|
|
2388
|
+
Os as ChannelEmptyState,
|
|
2326
2389
|
qe as ChannelList,
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2390
|
+
Xe as ChannelView,
|
|
2391
|
+
en as FaqList,
|
|
2392
|
+
Hs as FaqListItem,
|
|
2393
|
+
Ns as MessageVoteButtons,
|
|
2394
|
+
Ks as MessagingProvider,
|
|
2395
|
+
Qs as MessagingShell,
|
|
2396
|
+
js as ParticipantPicker,
|
|
2397
|
+
rs as formatRelativeTime,
|
|
2398
|
+
xs as useMessageVote,
|
|
2399
|
+
ts as useMessaging,
|
|
2400
|
+
tn as useParticipants
|
|
2338
2401
|
};
|
|
2339
2402
|
//# sourceMappingURL=index.js.map
|