@linktr.ee/messaging-react 1.24.4 โ 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +11 -1
- package/dist/index.js +860 -827
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +7 -0
- package/src/components/Avatar/index.tsx +26 -14
- package/src/components/ChannelInfoDialog/ChannelInfoDialog.test.tsx +259 -0
- package/src/components/ChannelInfoDialog/index.tsx +316 -0
- package/src/components/ChannelList/CustomChannelPreview.test.tsx +57 -5
- package/src/components/ChannelList/CustomChannelPreview.tsx +8 -0
- package/src/components/ChannelView.tsx +12 -330
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/hooks/useChannelStar.ts +31 -0
- package/src/types.ts +11 -0
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 me } from "react/jsx-runtime";
|
|
2
2
|
import R from "classnames";
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import {
|
|
3
|
+
import B, { createContext as lt, useContext as it, useCallback as P, useState as T, useRef as Q, useEffect as X, useMemo as _e } from "react";
|
|
4
|
+
import { StreamChatService as ct } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as dt, ChannelList as ut, DateSeparator as mt, useChannelStateContext as Me, useChatContext as $e, areMessageUIPropsEqual as ht, useMessageReminder as ft, useComponentContext as gt, Attachment as xt, EditMessageModal as bt, MessageBlocked as Ct, MessageBouncePrompt as Nt, MessageDeleted as vt, MessageIsThreadReplyInChannelButtonIndicator as wt, MessageRepliesCountButton as pt, ReminderNotification as yt, StreamedMessageText as _t, messageHasAttachments as Et, messageHasReactions as St, isDateSeparatorMessage as It, isMessageBlocked as Mt, isMessageBounced as kt, MessageBounceModal as Tt, Poll as Dt, MessageText as Rt, MessageErrorIcon as Lt, useMessageContext as je, useMessageComposer as Pt, useStateStore as Ut, MessageInput as Ot, useMessageInputContext as Ft, useMessageComposerHasSendableData as At, SimpleAttachmentSelector as Bt, QuotedMessagePreview as $t, AttachmentPreviewList as jt, TextareaComposer as Gt, MessageTimestamp as Re, Channel as zt, WithComponents as Vt, Window as Ht, MessageList as Wt } from "stream-chat-react";
|
|
6
|
+
import { StarIcon as Ee, GiftIcon as qt, XIcon as ke, SpinnerGapIcon as be, SignOutIcon as Yt, ProhibitInsetIcon as Le, FlagIcon as Zt, ArrowUpIcon as Jt, SparkleIcon as Qt, ArrowLeftIcon as Pe, DotsThreeIcon as Ue, MagnifyingGlassIcon as Xt, ChatCircleDotsIcon as Oe } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as Fe } from "stream-chat";
|
|
8
|
-
const Ge =
|
|
8
|
+
const Ge = lt({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const Ge = rt({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), ve = () =>
|
|
18
|
+
}), ve = () => it(Ge), Hs = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -23,9 +23,9 @@ const Ge = rt({
|
|
|
23
23
|
capabilities: l = {},
|
|
24
24
|
debug: m = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const a =
|
|
27
|
-
(u, ...
|
|
28
|
-
m && console.log(`๐ฅ [MessagingProvider] ${u}`, ...
|
|
26
|
+
const a = P(
|
|
27
|
+
(u, ...N) => {
|
|
28
|
+
m && console.log(`๐ฅ [MessagingProvider] ${u}`, ...N);
|
|
29
29
|
},
|
|
30
30
|
[m]
|
|
31
31
|
);
|
|
@@ -35,28 +35,28 @@ const Ge = rt({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(l)
|
|
37
37
|
});
|
|
38
|
-
const [c,
|
|
38
|
+
const [c, g] = T(null), [h, b] = T(null), [x, w] = T(!1), [r, y] = T(!1), [_, C] = T(null), M = Q(!1), E = Q({
|
|
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
|
+
}), p = Q(0);
|
|
44
|
+
p.current++, a("๐ RENDER INFO", {
|
|
45
|
+
renderCount: p.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
|
-
userChanged:
|
|
49
|
-
apiKeyChanged:
|
|
50
|
-
serviceConfigChanged:
|
|
51
|
-
capabilitiesChanged:
|
|
48
|
+
userChanged: E.current.userId !== (s == null ? void 0 : s.id),
|
|
49
|
+
apiKeyChanged: E.current.apiKey !== o,
|
|
50
|
+
serviceConfigChanged: E.current.serviceConfig !== n,
|
|
51
|
+
capabilitiesChanged: E.current.capabilities !== l
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), E.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: o,
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: l
|
|
58
|
-
},
|
|
59
|
-
const u =
|
|
58
|
+
}, X(() => {
|
|
59
|
+
const u = p.current;
|
|
60
60
|
if (a("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
62
|
apiKey: !!o,
|
|
@@ -64,8 +64,8 @@ const Ge = rt({
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
66
66
|
serviceConfigRef: n,
|
|
67
|
-
serviceConfigStable:
|
|
68
|
-
apiKeyStable:
|
|
67
|
+
serviceConfigStable: E.current.serviceConfig === n,
|
|
68
|
+
apiKeyStable: E.current.apiKey === o
|
|
69
69
|
}
|
|
70
70
|
}), !o || !n) {
|
|
71
71
|
a("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
@@ -77,42 +77,42 @@ const Ge = rt({
|
|
|
77
77
|
a("๐ CREATING NEW SERVICE", {
|
|
78
78
|
renderCount: u,
|
|
79
79
|
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
80
|
-
serviceConfigChanged:
|
|
80
|
+
serviceConfigChanged: E.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const N = new ct({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: o,
|
|
85
85
|
debug: m
|
|
86
86
|
});
|
|
87
|
-
return
|
|
87
|
+
return g(N), a("โ
SERVICE SET", {
|
|
88
88
|
renderCount: u,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!N
|
|
90
90
|
}), () => {
|
|
91
91
|
a("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: u,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), N.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
96
|
}, [o, n, m, a]);
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
97
|
+
const S = Q(null);
|
|
98
|
+
X(() => {
|
|
99
|
+
var N, v;
|
|
100
100
|
if (a("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!c,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
104
|
+
isConnecting: M.current,
|
|
105
|
+
isConnected: x,
|
|
106
106
|
dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !c || !s) {
|
|
108
108
|
a("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (M.current) {
|
|
112
112
|
a("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((N = S.current) == null ? void 0 : N.serviceId) === c && ((v = S.current) == null ? void 0 : v.userId) === s.id) {
|
|
116
116
|
a(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,40 +120,40 @@ const Ge = rt({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
a("๐ STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
a("๐ STARTING USER CONNECTION", { userId: s.id }), M.current = !0, y(!0), C(null);
|
|
124
124
|
try {
|
|
125
125
|
a("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
|
-
const
|
|
127
|
-
b(
|
|
126
|
+
const f = await c.connectUser(s);
|
|
127
|
+
b(f), w(!0), S.current = { serviceId: c, userId: s.id }, a("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
|
-
clientId:
|
|
129
|
+
clientId: f.userID
|
|
130
130
|
});
|
|
131
|
-
} catch (
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
} catch (f) {
|
|
132
|
+
const k = f instanceof Error ? f.message : "Connection failed";
|
|
133
|
+
C(k), a("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: k
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
y(!1), M.current = !1, a("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: x
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [c, s, a,
|
|
144
|
+
}, [c, s, a, x]), X(() => (a("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!c,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: x
|
|
147
147
|
}), () => {
|
|
148
|
-
c &&
|
|
148
|
+
c && x ? (a(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), S.current = null, c.disconnectUser().catch(console.error)) : a("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!c,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: x
|
|
154
154
|
});
|
|
155
|
-
}), [c,
|
|
156
|
-
const
|
|
155
|
+
}), [c, x, a]);
|
|
156
|
+
const L = P(async () => {
|
|
157
157
|
if (a("๐ REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,53 +161,53 @@ const Ge = rt({
|
|
|
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 }), y(!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), w(!0), C(null), a("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const N = u instanceof Error ? u.message : "Refresh failed";
|
|
171
|
+
C(N), a("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: N
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
y(!1), a("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [c, s, a]),
|
|
178
|
+
}, [c, s, a]), d = B.useMemo(() => (a("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!c,
|
|
180
180
|
hasClient: !!h,
|
|
181
|
-
isConnected:
|
|
181
|
+
isConnected: x,
|
|
182
182
|
isLoading: r,
|
|
183
|
-
hasError: !!
|
|
183
|
+
hasError: !!_,
|
|
184
184
|
capabilitiesKeys: Object.keys(l)
|
|
185
185
|
}), {
|
|
186
186
|
service: c,
|
|
187
187
|
client: h,
|
|
188
|
-
isConnected:
|
|
188
|
+
isConnected: x,
|
|
189
189
|
isLoading: r,
|
|
190
|
-
error:
|
|
190
|
+
error: _,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: L,
|
|
193
193
|
debug: m
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
196
196
|
h,
|
|
197
|
-
|
|
197
|
+
x,
|
|
198
198
|
r,
|
|
199
|
-
w,
|
|
200
|
-
l,
|
|
201
199
|
_,
|
|
200
|
+
l,
|
|
201
|
+
L,
|
|
202
202
|
m,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
205
205
|
return a("๐ RENDER END", {
|
|
206
|
-
renderCount:
|
|
207
|
-
willRenderChat: !!(h &&
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(Ge.Provider, { value:
|
|
210
|
-
|
|
206
|
+
renderCount: p.current,
|
|
207
|
+
willRenderChat: !!(h && x),
|
|
208
|
+
contextValueReady: !!d
|
|
209
|
+
}), /* @__PURE__ */ e(Ge.Provider, { value: d, children: h && x ? /* @__PURE__ */ e(
|
|
210
|
+
dt,
|
|
211
211
|
{
|
|
212
212
|
client: h,
|
|
213
213
|
customClasses: {
|
|
@@ -216,24 +216,46 @@ const Ge = rt({
|
|
|
216
216
|
children: t
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
|
-
},
|
|
219
|
+
}, Kt = () => ve(), ze = B.createContext({
|
|
220
220
|
selectedChannel: void 0,
|
|
221
221
|
onChannelSelect: () => {
|
|
222
222
|
},
|
|
223
223
|
debug: !1,
|
|
224
224
|
renderMessagePreview: void 0
|
|
225
|
-
}),
|
|
225
|
+
}), es = ze.Provider, ts = () => B.useContext(ze), Ve = (t) => {
|
|
226
|
+
var o, l;
|
|
227
|
+
const [s, n] = T(
|
|
228
|
+
!!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
|
|
229
|
+
);
|
|
230
|
+
return X(() => {
|
|
231
|
+
var a;
|
|
232
|
+
if (!t) {
|
|
233
|
+
n(!1);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
n(!!((a = t.state.membership) != null && a.pinned_at));
|
|
237
|
+
const m = (c) => {
|
|
238
|
+
var g;
|
|
239
|
+
n(
|
|
240
|
+
c != null && c.member ? !!c.member.pinned_at : !!((g = t.state.membership) != null && g.pinned_at)
|
|
241
|
+
);
|
|
242
|
+
};
|
|
243
|
+
return t.on("member.updated", m), () => {
|
|
244
|
+
t.off("member.updated", m);
|
|
245
|
+
};
|
|
246
|
+
}, [t]), s;
|
|
247
|
+
}, ss = (t, s) => {
|
|
226
248
|
const n = new Date(
|
|
227
249
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
228
250
|
), l = new Date(
|
|
229
251
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
230
252
|
).getTime() - n.getTime();
|
|
231
253
|
return Math.floor(l / (1e3 * 60 * 60 * 24));
|
|
232
|
-
},
|
|
254
|
+
}, ns = (t) => {
|
|
233
255
|
const s = /* @__PURE__ */ new Date();
|
|
234
256
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
235
257
|
return "Just now";
|
|
236
|
-
const o =
|
|
258
|
+
const o = ss(t, s);
|
|
237
259
|
return o === 0 ? t.toLocaleTimeString([], {
|
|
238
260
|
hour: "numeric",
|
|
239
261
|
minute: "2-digit",
|
|
@@ -271,7 +293,7 @@ const Ge = rt({
|
|
|
271
293
|
"๐"
|
|
272
294
|
// Melon
|
|
273
295
|
];
|
|
274
|
-
function
|
|
296
|
+
function as(t) {
|
|
275
297
|
let s = 0;
|
|
276
298
|
for (let n = 0; n < t.length; n++) {
|
|
277
299
|
const o = t.charCodeAt(n);
|
|
@@ -279,51 +301,61 @@ function ss(t) {
|
|
|
279
301
|
}
|
|
280
302
|
return Math.abs(s);
|
|
281
303
|
}
|
|
282
|
-
function
|
|
283
|
-
const n =
|
|
304
|
+
function rs(t) {
|
|
305
|
+
const n = as(t) % Ae.length;
|
|
284
306
|
return Ae[n];
|
|
285
307
|
}
|
|
286
|
-
const
|
|
308
|
+
const se = ({
|
|
287
309
|
id: t,
|
|
288
310
|
image: s,
|
|
289
311
|
size: n = 40,
|
|
290
312
|
className: o,
|
|
291
|
-
|
|
313
|
+
starred: l = !1,
|
|
314
|
+
shape: m = "squircle"
|
|
292
315
|
}) => {
|
|
293
|
-
const
|
|
316
|
+
const a = rs(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = m === "circle" ? { borderRadius: "50%" } : {
|
|
294
317
|
borderRadius: "33%",
|
|
295
318
|
"corner-shape": "superellipse(1.3)"
|
|
296
319
|
};
|
|
297
|
-
return /* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ i(
|
|
298
321
|
"div",
|
|
299
322
|
{
|
|
300
|
-
className: R("flex-shrink-0
|
|
323
|
+
className: R("relative flex-shrink-0", o),
|
|
301
324
|
style: {
|
|
302
325
|
width: `${n}px`,
|
|
303
|
-
height: `${n}px
|
|
304
|
-
...x
|
|
326
|
+
height: `${n}px`
|
|
305
327
|
},
|
|
306
|
-
children:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
{
|
|
316
|
-
"
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
328
|
+
children: [
|
|
329
|
+
l && /* @__PURE__ */ e(
|
|
330
|
+
"div",
|
|
331
|
+
{
|
|
332
|
+
"aria-hidden": "true",
|
|
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(Ee, { className: "size-3 text-yellow-600", weight: "duotone" })
|
|
335
|
+
}
|
|
336
|
+
),
|
|
337
|
+
/* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: h, children: s ? /* @__PURE__ */ e(
|
|
338
|
+
"img",
|
|
339
|
+
{
|
|
340
|
+
src: s,
|
|
341
|
+
alt: "",
|
|
342
|
+
className: "aspect-square h-full w-full object-cover"
|
|
343
|
+
}
|
|
344
|
+
) : /* @__PURE__ */ e(
|
|
345
|
+
"div",
|
|
346
|
+
{
|
|
347
|
+
"aria-hidden": "true",
|
|
348
|
+
className: R(
|
|
349
|
+
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
350
|
+
g
|
|
351
|
+
),
|
|
352
|
+
children: a
|
|
353
|
+
}
|
|
354
|
+
) })
|
|
355
|
+
]
|
|
324
356
|
}
|
|
325
357
|
);
|
|
326
|
-
},
|
|
358
|
+
}, os = ({ size: t = 15 }) => /* @__PURE__ */ e(
|
|
327
359
|
"svg",
|
|
328
360
|
{
|
|
329
361
|
width: t,
|
|
@@ -340,16 +372,16 @@ const te = ({
|
|
|
340
372
|
}
|
|
341
373
|
)
|
|
342
374
|
}
|
|
343
|
-
),
|
|
375
|
+
), ls = (t) => {
|
|
344
376
|
var s;
|
|
345
377
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
|
|
346
|
-
},
|
|
378
|
+
}, is = (t) => {
|
|
347
379
|
var s;
|
|
348
380
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
|
|
349
|
-
},
|
|
381
|
+
}, Te = (t) => {
|
|
350
382
|
var s;
|
|
351
383
|
return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
|
|
352
|
-
}, He = (t) =>
|
|
384
|
+
}, He = (t) => ls(t) || is(t), cs = (t) => {
|
|
353
385
|
var s;
|
|
354
386
|
return He(t) && !((s = t.text) != null && s.trim());
|
|
355
387
|
}, ye = ({
|
|
@@ -358,70 +390,71 @@ const te = ({
|
|
|
358
390
|
isMyMessage: n = !1,
|
|
359
391
|
hasAttachment: o = !1
|
|
360
392
|
}) => {
|
|
361
|
-
var
|
|
362
|
-
const l = He(t), m =
|
|
393
|
+
var x;
|
|
394
|
+
const l = He(t), m = Te(t);
|
|
363
395
|
if (!l && !m)
|
|
364
396
|
return null;
|
|
365
397
|
if (l) {
|
|
366
|
-
const
|
|
367
|
-
if (!
|
|
368
|
-
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip",
|
|
398
|
+
const w = (x = t.metadata) == null ? void 0 : x.amount_text;
|
|
399
|
+
if (!w) return null;
|
|
400
|
+
const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${w} tip` : `Delivered with ${w} tip`;
|
|
369
401
|
return /* @__PURE__ */ i("div", { className: r, children: [
|
|
370
|
-
/* @__PURE__ */ e(
|
|
371
|
-
/* @__PURE__ */ e("span", { children:
|
|
402
|
+
/* @__PURE__ */ e(qt, { size: s ? 14 : 12 }),
|
|
403
|
+
/* @__PURE__ */ e("span", { children: y })
|
|
372
404
|
] });
|
|
373
405
|
}
|
|
374
|
-
const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent",
|
|
406
|
+
const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
|
|
375
407
|
"message-chatbot-indicator",
|
|
376
408
|
n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
|
|
377
409
|
a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
|
|
378
|
-
].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(
|
|
379
|
-
return /* @__PURE__ */ e("div", { className:
|
|
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(os, { size: a ? 12 : 15 }) });
|
|
411
|
+
return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(me, { children: [
|
|
380
412
|
h,
|
|
381
413
|
b
|
|
382
|
-
] }) : /* @__PURE__ */ i(
|
|
414
|
+
] }) : /* @__PURE__ */ i(me, { children: [
|
|
383
415
|
b,
|
|
384
416
|
h
|
|
385
417
|
] }) });
|
|
386
|
-
},
|
|
418
|
+
}, We = B.memo(
|
|
387
419
|
({ channel: t, unread: s }) => {
|
|
388
|
-
var
|
|
389
|
-
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } =
|
|
420
|
+
var L, d, u, N;
|
|
421
|
+
const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } = ts(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
390
422
|
t && o(t);
|
|
391
|
-
},
|
|
392
|
-
const
|
|
393
|
-
!
|
|
394
|
-
}, b = Object.values(((
|
|
395
|
-
(
|
|
396
|
-
var
|
|
397
|
-
return ((
|
|
423
|
+
}, g = (v) => {
|
|
424
|
+
const f = v.key === "Enter" || v.key === " ", k = v.repeat;
|
|
425
|
+
!f || k || (v.preventDefault(), c());
|
|
426
|
+
}, b = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
|
|
427
|
+
(v) => {
|
|
428
|
+
var f, k;
|
|
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);
|
|
398
430
|
}
|
|
399
|
-
),
|
|
400
|
-
var
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
for (let
|
|
404
|
-
if (
|
|
431
|
+
), x = ((d = b == null ? void 0 : b.user) == null ? void 0 : d.name) || "Conversation", w = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, r = (() => {
|
|
432
|
+
var f;
|
|
433
|
+
const v = (f = t == null ? void 0 : t.state) == null ? void 0 : f.messages;
|
|
434
|
+
if (v != null && v.length) {
|
|
435
|
+
for (let k = v.length - 1; k >= 0; k--)
|
|
436
|
+
if (v[k].type !== "system") return v[k];
|
|
405
437
|
}
|
|
406
|
-
})(),
|
|
407
|
-
var
|
|
438
|
+
})(), _ = (() => {
|
|
439
|
+
var k, H;
|
|
408
440
|
if (r != null && r.text) return r.text;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
441
|
+
if (((k = r == null ? void 0 : r.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return "๐ต Sent a tip";
|
|
442
|
+
const f = (H = r == null ? void 0 : r.attachments) == null ? void 0 : H[0];
|
|
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 ? ns(new Date(r.created_at)) : "", M = r ? Te(r) : !1, E = m ? m(r, _) : `${M ? "โจ " : ""}${_}`, p = Ve(t), S = s ?? 0;
|
|
412
445
|
return l && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
413
446
|
channelId: t == null ? void 0 : t.id,
|
|
414
447
|
isSelected: a,
|
|
415
|
-
participantName:
|
|
416
|
-
unreadCount:
|
|
417
|
-
hasTimestamp: !!
|
|
448
|
+
participantName: x,
|
|
449
|
+
unreadCount: S,
|
|
450
|
+
hasTimestamp: !!C
|
|
418
451
|
}), /* @__PURE__ */ e(
|
|
419
452
|
"div",
|
|
420
453
|
{
|
|
421
454
|
role: "button",
|
|
422
455
|
tabIndex: 0,
|
|
423
456
|
onClick: c,
|
|
424
|
-
onKeyDown:
|
|
457
|
+
onKeyDown: g,
|
|
425
458
|
className: R(
|
|
426
459
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
427
460
|
{
|
|
@@ -431,32 +464,36 @@ const te = ({
|
|
|
431
464
|
),
|
|
432
465
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
433
466
|
/* @__PURE__ */ e(
|
|
434
|
-
|
|
467
|
+
se,
|
|
435
468
|
{
|
|
436
|
-
id: ((
|
|
437
|
-
name:
|
|
438
|
-
image:
|
|
469
|
+
id: ((N = b == null ? void 0 : b.user) == null ? void 0 : N.id) || t.id || "unknown",
|
|
470
|
+
name: x,
|
|
471
|
+
image: w,
|
|
439
472
|
size: 44,
|
|
473
|
+
starred: p,
|
|
440
474
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
441
475
|
}
|
|
442
476
|
),
|
|
443
477
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
444
478
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
|
|
445
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ i(
|
|
446
480
|
"h3",
|
|
447
481
|
{
|
|
448
482
|
className: R(
|
|
449
483
|
"text-sm font-medium truncate",
|
|
450
484
|
a ? "text-primary" : "text-charcoal"
|
|
451
485
|
),
|
|
452
|
-
children:
|
|
486
|
+
children: [
|
|
487
|
+
p && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
|
|
488
|
+
x
|
|
489
|
+
]
|
|
453
490
|
}
|
|
454
491
|
),
|
|
455
|
-
|
|
492
|
+
C && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: C })
|
|
456
493
|
] }),
|
|
457
494
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
458
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children:
|
|
459
|
-
|
|
495
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: E }),
|
|
496
|
+
S > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: S > 99 ? "99+" : S })
|
|
460
497
|
] })
|
|
461
498
|
] })
|
|
462
499
|
] })
|
|
@@ -464,8 +501,8 @@ const te = ({
|
|
|
464
501
|
);
|
|
465
502
|
}
|
|
466
503
|
);
|
|
467
|
-
|
|
468
|
-
const
|
|
504
|
+
We.displayName = "CustomChannelPreview";
|
|
505
|
+
const ds = { last_message_at: -1 }, qe = B.memo(
|
|
469
506
|
({
|
|
470
507
|
onChannelSelect: t,
|
|
471
508
|
selectedChannel: s,
|
|
@@ -473,27 +510,27 @@ const is = { last_message_at: -1 }, We = F.memo(
|
|
|
473
510
|
allowNewMessagesFromUnfilteredChannels: o = !1,
|
|
474
511
|
onMessageNew: l,
|
|
475
512
|
onAddedToChannel: m,
|
|
476
|
-
sort: a =
|
|
513
|
+
sort: a = ds,
|
|
477
514
|
className: c,
|
|
478
|
-
customEmptyStateIndicator:
|
|
515
|
+
customEmptyStateIndicator: g,
|
|
479
516
|
renderMessagePreview: h
|
|
480
517
|
}) => {
|
|
481
|
-
const b =
|
|
518
|
+
const b = B.useRef(0);
|
|
482
519
|
b.current++;
|
|
483
|
-
const { debug:
|
|
484
|
-
|
|
520
|
+
const { debug: x = !1 } = ve();
|
|
521
|
+
x && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
485
522
|
renderCount: b.current,
|
|
486
523
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
487
524
|
filters: n
|
|
488
525
|
});
|
|
489
|
-
const
|
|
526
|
+
const w = B.useMemo(
|
|
490
527
|
() => ({
|
|
491
528
|
selectedChannel: s,
|
|
492
529
|
onChannelSelect: t,
|
|
493
|
-
debug:
|
|
530
|
+
debug: x,
|
|
494
531
|
renderMessagePreview: h
|
|
495
532
|
}),
|
|
496
|
-
[s, t,
|
|
533
|
+
[s, t, x, h]
|
|
497
534
|
);
|
|
498
535
|
return /* @__PURE__ */ e(
|
|
499
536
|
"div",
|
|
@@ -502,8 +539,8 @@ const is = { last_message_at: -1 }, We = F.memo(
|
|
|
502
539
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
503
540
|
c
|
|
504
541
|
),
|
|
505
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
506
|
-
|
|
542
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(es, { value: w, children: /* @__PURE__ */ e(
|
|
543
|
+
ut,
|
|
507
544
|
{
|
|
508
545
|
filters: n,
|
|
509
546
|
sort: a,
|
|
@@ -511,8 +548,8 @@ const is = { last_message_at: -1 }, We = F.memo(
|
|
|
511
548
|
allowNewMessagesFromUnfilteredChannels: o,
|
|
512
549
|
onMessageNew: l,
|
|
513
550
|
onAddedToChannel: m,
|
|
514
|
-
Preview:
|
|
515
|
-
EmptyStateIndicator:
|
|
551
|
+
Preview: We,
|
|
552
|
+
EmptyStateIndicator: g
|
|
516
553
|
},
|
|
517
554
|
`${JSON.stringify(n)}:${JSON.stringify(a)}`
|
|
518
555
|
) }) })
|
|
@@ -520,7 +557,7 @@ const is = { last_message_at: -1 }, We = F.memo(
|
|
|
520
557
|
);
|
|
521
558
|
}
|
|
522
559
|
);
|
|
523
|
-
|
|
560
|
+
qe.displayName = "ChannelList";
|
|
524
561
|
const xe = ({
|
|
525
562
|
variant: t = "default",
|
|
526
563
|
className: s,
|
|
@@ -539,7 +576,7 @@ const xe = ({
|
|
|
539
576
|
children: n
|
|
540
577
|
}
|
|
541
578
|
);
|
|
542
|
-
function
|
|
579
|
+
function Ye({ label: t, className: s, children: n, ...o }) {
|
|
543
580
|
return /* @__PURE__ */ i(
|
|
544
581
|
"button",
|
|
545
582
|
{
|
|
@@ -560,28 +597,213 @@ function qe({ label: t, className: s, children: n, ...o }) {
|
|
|
560
597
|
}
|
|
561
598
|
);
|
|
562
599
|
}
|
|
563
|
-
function
|
|
564
|
-
return /* @__PURE__ */ e(
|
|
600
|
+
function Ze({ onClick: t }) {
|
|
601
|
+
return /* @__PURE__ */ e(Ye, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
565
602
|
}
|
|
566
|
-
const
|
|
567
|
-
|
|
568
|
-
|
|
603
|
+
const us = ({
|
|
604
|
+
dialogRef: t,
|
|
605
|
+
onClose: s,
|
|
606
|
+
participant: n,
|
|
607
|
+
channel: o,
|
|
608
|
+
followerStatusLabel: l,
|
|
609
|
+
onLeaveConversation: m,
|
|
610
|
+
onBlockParticipant: a,
|
|
611
|
+
showDeleteConversation: c = !0,
|
|
612
|
+
onDeleteConversationClick: g,
|
|
613
|
+
onBlockParticipantClick: h,
|
|
614
|
+
onReportParticipantClick: b,
|
|
615
|
+
customProfileContent: x,
|
|
616
|
+
customChannelActions: w
|
|
617
|
+
}) => {
|
|
618
|
+
var W, j, ne, ae, G, K, re;
|
|
619
|
+
const { service: r, debug: y } = ve(), [_, C] = T(!1), [M, E] = T(!1), [p, S] = T(!1), L = P(async () => {
|
|
620
|
+
var U;
|
|
621
|
+
if (!(!r || !((U = n == null ? void 0 : n.user) != null && U.id)))
|
|
622
|
+
try {
|
|
623
|
+
const A = (await r.getBlockedUsers()).some(
|
|
624
|
+
(z) => {
|
|
625
|
+
var ce;
|
|
626
|
+
return z.blocked_user_id === ((ce = n == null ? void 0 : n.user) == null ? void 0 : ce.id);
|
|
627
|
+
}
|
|
628
|
+
);
|
|
629
|
+
C(A);
|
|
630
|
+
} catch (O) {
|
|
631
|
+
console.error(
|
|
632
|
+
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
633
|
+
O
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
}, [r, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
|
|
637
|
+
X(() => {
|
|
638
|
+
L();
|
|
639
|
+
}, [L]);
|
|
640
|
+
const d = async () => {
|
|
641
|
+
var U;
|
|
642
|
+
if (!M) {
|
|
643
|
+
g == null || g(), y && console.log("[ChannelInfoDialog] Leave conversation", o.cid), E(!0);
|
|
644
|
+
try {
|
|
645
|
+
const O = ((U = o._client) == null ? void 0 : U.userID) ?? null;
|
|
646
|
+
await o.hide(O, !1), m && await m(o), s();
|
|
647
|
+
} catch (O) {
|
|
648
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", O);
|
|
649
|
+
} finally {
|
|
650
|
+
E(!1);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}, u = async () => {
|
|
654
|
+
var U, O, A;
|
|
655
|
+
if (!(p || !r)) {
|
|
656
|
+
h == null || h(), y && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), S(!0);
|
|
657
|
+
try {
|
|
658
|
+
await r.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
|
|
659
|
+
} catch (z) {
|
|
660
|
+
console.error("[ChannelInfoDialog] Failed to block member", z);
|
|
661
|
+
} finally {
|
|
662
|
+
S(!1);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
}, N = async () => {
|
|
666
|
+
var U, O, A;
|
|
667
|
+
if (!(p || !r)) {
|
|
668
|
+
h == null || h(), y && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), S(!0);
|
|
669
|
+
try {
|
|
670
|
+
await r.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
|
|
671
|
+
} catch (z) {
|
|
672
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", z);
|
|
673
|
+
} finally {
|
|
674
|
+
S(!1);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}, v = () => {
|
|
678
|
+
b == null || b(), s(), window.open(
|
|
679
|
+
"https://linktr.ee/s/about/trust-center/report",
|
|
680
|
+
"_blank",
|
|
681
|
+
"noopener,noreferrer"
|
|
682
|
+
);
|
|
683
|
+
};
|
|
684
|
+
if (!n) return null;
|
|
685
|
+
const f = ((j = n.user) == null ? void 0 : j.name) || ((ne = n.user) == null ? void 0 : ne.id) || "Unknown member", k = (ae = n.user) == null ? void 0 : ae.image, H = (G = n.user) == null ? void 0 : G.email, Z = (K = n.user) == null ? void 0 : K.username, Y = H || (Z ? `linktr.ee/${Z}` : void 0), D = ((re = n.user) == null ? void 0 : re.id) || "unknown";
|
|
686
|
+
return (
|
|
687
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
688
|
+
/* @__PURE__ */ e(
|
|
689
|
+
"dialog",
|
|
690
|
+
{
|
|
691
|
+
ref: t,
|
|
692
|
+
className: "mes-dialog group",
|
|
693
|
+
onClose: s,
|
|
694
|
+
onClick: (U) => {
|
|
695
|
+
U.target === t.current && s();
|
|
696
|
+
},
|
|
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
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
699
|
+
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
700
|
+
/* @__PURE__ */ e(Ze, { onClick: s })
|
|
701
|
+
] }),
|
|
702
|
+
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
703
|
+
/* @__PURE__ */ e(
|
|
704
|
+
"div",
|
|
705
|
+
{
|
|
706
|
+
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
707
|
+
style: { backgroundColor: "#FBFAF9" },
|
|
708
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
709
|
+
/* @__PURE__ */ e(
|
|
710
|
+
se,
|
|
711
|
+
{
|
|
712
|
+
id: D,
|
|
713
|
+
name: f,
|
|
714
|
+
image: k,
|
|
715
|
+
size: 88,
|
|
716
|
+
shape: "circle"
|
|
717
|
+
}
|
|
718
|
+
),
|
|
719
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
720
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: f }),
|
|
721
|
+
Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
|
|
722
|
+
l && !x && /* @__PURE__ */ e(
|
|
723
|
+
"span",
|
|
724
|
+
{
|
|
725
|
+
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
726
|
+
style: {
|
|
727
|
+
padding: "4px 8px",
|
|
728
|
+
backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
729
|
+
color: l === "Subscribed to you" ? "#008236" : "#78716C",
|
|
730
|
+
lineHeight: "133.333%",
|
|
731
|
+
letterSpacing: "0.21px"
|
|
732
|
+
},
|
|
733
|
+
children: l
|
|
734
|
+
}
|
|
735
|
+
),
|
|
736
|
+
x
|
|
737
|
+
] })
|
|
738
|
+
] })
|
|
739
|
+
}
|
|
740
|
+
),
|
|
741
|
+
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
742
|
+
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
743
|
+
xe,
|
|
744
|
+
{
|
|
745
|
+
onClick: d,
|
|
746
|
+
disabled: M,
|
|
747
|
+
"aria-busy": M,
|
|
748
|
+
children: [
|
|
749
|
+
M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
|
|
750
|
+
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
751
|
+
]
|
|
752
|
+
}
|
|
753
|
+
) }),
|
|
754
|
+
/* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ i(
|
|
755
|
+
xe,
|
|
756
|
+
{
|
|
757
|
+
onClick: N,
|
|
758
|
+
disabled: p,
|
|
759
|
+
"aria-busy": p,
|
|
760
|
+
children: [
|
|
761
|
+
p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
|
|
762
|
+
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
763
|
+
]
|
|
764
|
+
}
|
|
765
|
+
) : /* @__PURE__ */ i(
|
|
766
|
+
xe,
|
|
767
|
+
{
|
|
768
|
+
onClick: u,
|
|
769
|
+
disabled: p,
|
|
770
|
+
"aria-busy": p,
|
|
771
|
+
children: [
|
|
772
|
+
p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
|
|
773
|
+
/* @__PURE__ */ e("span", { children: "Block" })
|
|
774
|
+
]
|
|
775
|
+
}
|
|
776
|
+
) }),
|
|
777
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: v, children: [
|
|
778
|
+
/* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
|
|
779
|
+
/* @__PURE__ */ e("span", { children: "Report" })
|
|
780
|
+
] }) }),
|
|
781
|
+
w
|
|
782
|
+
] })
|
|
783
|
+
] })
|
|
784
|
+
] })
|
|
785
|
+
}
|
|
786
|
+
)
|
|
787
|
+
);
|
|
788
|
+
}, ms = (t) => /* @__PURE__ */ e(mt, { ...t, position: "center" }), Se = "vote_up", Ie = "vote_down";
|
|
789
|
+
function hs(t) {
|
|
790
|
+
return t != null && t.length ? t.some((s) => s.type === Ie) ? "down" : t.some((s) => s.type === Se) ? "up" : null : null;
|
|
569
791
|
}
|
|
570
|
-
function
|
|
571
|
-
const { channel: s } =
|
|
572
|
-
() =>
|
|
792
|
+
function fs(t) {
|
|
793
|
+
const { channel: s } = Me(), { client: n } = $e("useMessageVote"), o = _e(
|
|
794
|
+
() => hs(t.own_reactions),
|
|
573
795
|
[t.own_reactions]
|
|
574
|
-
), l =
|
|
796
|
+
), l = P(async () => {
|
|
575
797
|
if (n != null && n.userID)
|
|
576
798
|
try {
|
|
577
|
-
o === "up" ? await s.deleteReaction(t.id,
|
|
799
|
+
o === "up" ? await s.deleteReaction(t.id, Se) : await s.sendReaction(
|
|
578
800
|
t.id,
|
|
579
|
-
{ type:
|
|
801
|
+
{ type: Se },
|
|
580
802
|
{ enforce_unique: !0, skip_push: !0 }
|
|
581
803
|
);
|
|
582
804
|
} catch {
|
|
583
805
|
}
|
|
584
|
-
}, [s, n == null ? void 0 : n.userID, t.id, o]), m =
|
|
806
|
+
}, [s, n == null ? void 0 : n.userID, t.id, o]), m = P(async () => {
|
|
585
807
|
if (n != null && n.userID)
|
|
586
808
|
try {
|
|
587
809
|
o === "down" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
|
|
@@ -594,7 +816,7 @@ function us(t) {
|
|
|
594
816
|
}, [s, n == null ? void 0 : n.userID, t.id, o]);
|
|
595
817
|
return { selected: o, voteUp: l, voteDown: m };
|
|
596
818
|
}
|
|
597
|
-
const
|
|
819
|
+
const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
598
820
|
"path",
|
|
599
821
|
{
|
|
600
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",
|
|
@@ -604,7 +826,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
604
826
|
strokeLinejoin: "round",
|
|
605
827
|
fill: t ? "currentColor" : "none"
|
|
606
828
|
}
|
|
607
|
-
) }),
|
|
829
|
+
) }), xs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
608
830
|
"path",
|
|
609
831
|
{
|
|
610
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",
|
|
@@ -614,7 +836,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
614
836
|
strokeLinejoin: "round",
|
|
615
837
|
fill: t ? "currentColor" : "none"
|
|
616
838
|
}
|
|
617
|
-
) }),
|
|
839
|
+
) }), bs = ({
|
|
618
840
|
selected: t,
|
|
619
841
|
onVoteUp: s,
|
|
620
842
|
onVoteDown: n
|
|
@@ -627,7 +849,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
627
849
|
onClick: s,
|
|
628
850
|
"aria-label": "Helpful",
|
|
629
851
|
"aria-pressed": t === "up",
|
|
630
|
-
children: /* @__PURE__ */ e(
|
|
852
|
+
children: /* @__PURE__ */ e(gs, { filled: t === "up" })
|
|
631
853
|
}
|
|
632
854
|
),
|
|
633
855
|
/* @__PURE__ */ e(
|
|
@@ -638,11 +860,11 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
638
860
|
onClick: n,
|
|
639
861
|
"aria-label": "Not helpful",
|
|
640
862
|
"aria-pressed": t === "down",
|
|
641
|
-
children: /* @__PURE__ */ e(
|
|
863
|
+
children: /* @__PURE__ */ e(xs, { filled: t === "down" })
|
|
642
864
|
}
|
|
643
865
|
)
|
|
644
|
-
] }),
|
|
645
|
-
var
|
|
866
|
+
] }), Cs = (t) => {
|
|
867
|
+
var de, ue;
|
|
646
868
|
const {
|
|
647
869
|
additionalMessageInputProps: s,
|
|
648
870
|
chatbotVotingEnabled: n,
|
|
@@ -651,79 +873,79 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
651
873
|
firstOfGroup: m,
|
|
652
874
|
groupedByUser: a,
|
|
653
875
|
handleAction: c,
|
|
654
|
-
handleOpenThread:
|
|
876
|
+
handleOpenThread: g,
|
|
655
877
|
handleRetry: h,
|
|
656
878
|
highlighted: b,
|
|
657
|
-
isMessageAIGenerated:
|
|
658
|
-
isMyMessage:
|
|
879
|
+
isMessageAIGenerated: x,
|
|
880
|
+
isMyMessage: w,
|
|
659
881
|
message: r,
|
|
660
|
-
renderText:
|
|
661
|
-
threadList:
|
|
662
|
-
} = t, { client:
|
|
663
|
-
Attachment: u =
|
|
664
|
-
EditMessageModal:
|
|
665
|
-
MessageBlocked:
|
|
666
|
-
MessageBouncePrompt:
|
|
667
|
-
MessageDeleted:
|
|
668
|
-
MessageIsThreadReplyInChannelButtonIndicator:
|
|
669
|
-
MessageRepliesCountButton:
|
|
670
|
-
ReminderNotification:
|
|
671
|
-
StreamedMessageText:
|
|
672
|
-
PinIndicator:
|
|
673
|
-
} =
|
|
674
|
-
() =>
|
|
675
|
-
[
|
|
676
|
-
),
|
|
882
|
+
renderText: y,
|
|
883
|
+
threadList: _
|
|
884
|
+
} = t, { client: C } = $e("CustomMessage"), [M, E] = T(!1), p = ft(r.id), { selected: S, voteUp: L, voteDown: d } = fs(r), {
|
|
885
|
+
Attachment: u = xt,
|
|
886
|
+
EditMessageModal: N = bt,
|
|
887
|
+
MessageBlocked: v = Ct,
|
|
888
|
+
MessageBouncePrompt: f = Nt,
|
|
889
|
+
MessageDeleted: k = vt,
|
|
890
|
+
MessageIsThreadReplyInChannelButtonIndicator: H = wt,
|
|
891
|
+
MessageRepliesCountButton: Z = pt,
|
|
892
|
+
ReminderNotification: Y = yt,
|
|
893
|
+
StreamedMessageText: D = _t,
|
|
894
|
+
PinIndicator: W
|
|
895
|
+
} = gt("CustomMessage"), j = Et(r), ne = St(r), ae = _e(
|
|
896
|
+
() => x == null ? void 0 : x(r),
|
|
897
|
+
[x, r]
|
|
898
|
+
), G = _e(
|
|
677
899
|
() => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
|
|
678
900
|
[r]
|
|
679
901
|
);
|
|
680
|
-
if (
|
|
902
|
+
if (It(r))
|
|
681
903
|
return null;
|
|
682
904
|
if (r.deleted_at || r.type === "deleted")
|
|
683
|
-
return /* @__PURE__ */ e(
|
|
684
|
-
if (
|
|
685
|
-
return /* @__PURE__ */ e(
|
|
686
|
-
const
|
|
905
|
+
return /* @__PURE__ */ e(k, { message: r });
|
|
906
|
+
if (Mt(r))
|
|
907
|
+
return /* @__PURE__ */ e(v, {});
|
|
908
|
+
const K = !_ && !!r.reply_count, re = !_ && r.show_in_channel && r.parent_id, U = r.status === "failed" && ((de = r.error) == null ? void 0 : de.status) !== 403, O = kt(r);
|
|
687
909
|
let A;
|
|
688
|
-
U ? A = () => h(r) :
|
|
689
|
-
const
|
|
910
|
+
U ? A = () => h(r) : O && (A = () => E(!0));
|
|
911
|
+
const z = w(), ce = R(
|
|
690
912
|
"str-chat__message str-chat__message-simple",
|
|
691
913
|
`str-chat__message--${r.type}`,
|
|
692
914
|
`str-chat__message--${r.status}`,
|
|
693
|
-
|
|
915
|
+
z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
694
916
|
r.text ? "str-chat__message--has-text" : "has-no-text",
|
|
695
917
|
{
|
|
696
|
-
"str-chat__message--has-attachment":
|
|
918
|
+
"str-chat__message--has-attachment": j,
|
|
697
919
|
"str-chat__message--highlighted": b,
|
|
698
920
|
"str-chat__message--pinned pinned-message": r.pinned,
|
|
699
921
|
"str-chat__message--with-reactions": ne,
|
|
700
|
-
"str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((
|
|
701
|
-
"str-chat__message-with-thread-link":
|
|
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": K || re,
|
|
702
924
|
"str-chat__virtual-message__wrapper--end": l,
|
|
703
925
|
"str-chat__virtual-message__wrapper--first": m,
|
|
704
926
|
"str-chat__virtual-message__wrapper--group": a
|
|
705
927
|
}
|
|
706
|
-
),
|
|
707
|
-
return /* @__PURE__ */ i(
|
|
928
|
+
), q = r.poll_id && C.polls.fromState(r.poll_id), oe = cs(r), ee = Te(r), J = !!(G != null && G.length && !r.quoted_message), te = ee && z && J;
|
|
929
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
708
930
|
o && /* @__PURE__ */ e(
|
|
709
|
-
|
|
931
|
+
N,
|
|
710
932
|
{
|
|
711
933
|
additionalMessageInputProps: s
|
|
712
934
|
}
|
|
713
935
|
),
|
|
714
|
-
|
|
715
|
-
|
|
936
|
+
M && /* @__PURE__ */ e(
|
|
937
|
+
Tt,
|
|
716
938
|
{
|
|
717
|
-
MessageBouncePrompt:
|
|
718
|
-
onClose: () =>
|
|
719
|
-
open:
|
|
939
|
+
MessageBouncePrompt: f,
|
|
940
|
+
onClose: () => E(!1),
|
|
941
|
+
open: M
|
|
720
942
|
}
|
|
721
943
|
),
|
|
722
|
-
/* @__PURE__ */ i("div", { className:
|
|
723
|
-
|
|
724
|
-
!!
|
|
944
|
+
/* @__PURE__ */ i("div", { className: ce, children: [
|
|
945
|
+
W && /* @__PURE__ */ e(W, {}),
|
|
946
|
+
!!p && /* @__PURE__ */ e(Y, { reminder: p }),
|
|
725
947
|
r.user && /* @__PURE__ */ e(
|
|
726
|
-
|
|
948
|
+
se,
|
|
727
949
|
{
|
|
728
950
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
729
951
|
id: r.user.id,
|
|
@@ -735,7 +957,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
735
957
|
"div",
|
|
736
958
|
{
|
|
737
959
|
className: R("str-chat__message-inner", {
|
|
738
|
-
"str-chat__simple-message--error-failed": U ||
|
|
960
|
+
"str-chat__simple-message--error-failed": U || O
|
|
739
961
|
}),
|
|
740
962
|
"data-testid": "message-inner",
|
|
741
963
|
onClick: A,
|
|
@@ -748,76 +970,76 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
748
970
|
marginInlineEnd: 0,
|
|
749
971
|
marginInlineStart: 0
|
|
750
972
|
},
|
|
751
|
-
children:
|
|
973
|
+
children: oe ? (
|
|
752
974
|
/* Tip-only messages render as a standalone bubble */
|
|
753
975
|
/* @__PURE__ */ e(ye, { message: r, standalone: !0 })
|
|
754
976
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
755
977
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
756
|
-
|
|
978
|
+
ee && !te && /* @__PURE__ */ e(
|
|
757
979
|
ye,
|
|
758
980
|
{
|
|
759
981
|
message: r,
|
|
760
|
-
hasAttachment:
|
|
761
|
-
isMyMessage:
|
|
982
|
+
hasAttachment: J,
|
|
983
|
+
isMyMessage: z
|
|
762
984
|
}
|
|
763
985
|
),
|
|
764
|
-
|
|
765
|
-
|
|
986
|
+
q && /* @__PURE__ */ e(Dt, { poll: q }),
|
|
987
|
+
G != null && G.length && !r.quoted_message ? /* @__PURE__ */ e(
|
|
766
988
|
u,
|
|
767
989
|
{
|
|
768
990
|
actionHandler: c,
|
|
769
|
-
attachments:
|
|
991
|
+
attachments: G
|
|
770
992
|
}
|
|
771
993
|
) : null,
|
|
772
994
|
ae ? /* @__PURE__ */ e(
|
|
773
|
-
|
|
995
|
+
D,
|
|
774
996
|
{
|
|
775
997
|
message: r,
|
|
776
|
-
renderText:
|
|
998
|
+
renderText: y
|
|
777
999
|
}
|
|
778
|
-
) : /* @__PURE__ */ e(
|
|
779
|
-
/* @__PURE__ */ e(
|
|
1000
|
+
) : /* @__PURE__ */ e(Rt, { message: r, renderText: y }),
|
|
1001
|
+
/* @__PURE__ */ e(Lt, {})
|
|
780
1002
|
] }),
|
|
781
|
-
(!
|
|
1003
|
+
(!ee || te) && /* @__PURE__ */ e(
|
|
782
1004
|
ye,
|
|
783
1005
|
{
|
|
784
1006
|
message: r,
|
|
785
|
-
hasAttachment:
|
|
786
|
-
isMyMessage:
|
|
1007
|
+
hasAttachment: J,
|
|
1008
|
+
isMyMessage: z
|
|
787
1009
|
}
|
|
788
1010
|
),
|
|
789
|
-
n &&
|
|
790
|
-
|
|
1011
|
+
n && ee && /* @__PURE__ */ e(
|
|
1012
|
+
bs,
|
|
791
1013
|
{
|
|
792
|
-
selected:
|
|
793
|
-
onVoteUp:
|
|
794
|
-
onVoteDown:
|
|
1014
|
+
selected: S,
|
|
1015
|
+
onVoteUp: L,
|
|
1016
|
+
onVoteDown: d
|
|
795
1017
|
}
|
|
796
1018
|
)
|
|
797
1019
|
] })
|
|
798
1020
|
}
|
|
799
1021
|
),
|
|
800
|
-
|
|
801
|
-
|
|
1022
|
+
K && /* @__PURE__ */ e(
|
|
1023
|
+
Z,
|
|
802
1024
|
{
|
|
803
|
-
onClick:
|
|
1025
|
+
onClick: g,
|
|
804
1026
|
reply_count: r.reply_count
|
|
805
1027
|
}
|
|
806
1028
|
),
|
|
807
|
-
|
|
1029
|
+
re && /* @__PURE__ */ e(H, {})
|
|
808
1030
|
] }, r.id)
|
|
809
1031
|
] });
|
|
810
|
-
},
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
),
|
|
1032
|
+
}, Ns = B.memo(
|
|
1033
|
+
Cs,
|
|
1034
|
+
ht
|
|
1035
|
+
), vs = (t) => {
|
|
814
1036
|
const s = je("CustomMessage");
|
|
815
|
-
return /* @__PURE__ */ e(
|
|
816
|
-
},
|
|
1037
|
+
return /* @__PURE__ */ e(Ns, { ...s, ...t });
|
|
1038
|
+
}, ws = (t) => ({
|
|
817
1039
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
818
1040
|
(s) => Fe.previewIsLoaded(s) || Fe.previewIsLoading(s)
|
|
819
1041
|
)
|
|
820
|
-
}),
|
|
1042
|
+
}), ps = ({
|
|
821
1043
|
link: t,
|
|
822
1044
|
onDismiss: s
|
|
823
1045
|
}) => {
|
|
@@ -847,7 +1069,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
847
1069
|
},
|
|
848
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",
|
|
849
1071
|
"aria-label": "Close link preview",
|
|
850
|
-
children: /* @__PURE__ */ e(
|
|
1072
|
+
children: /* @__PURE__ */ e(ke, { className: "size-4 text-black/90" })
|
|
851
1073
|
}
|
|
852
1074
|
),
|
|
853
1075
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
@@ -857,32 +1079,32 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
857
1079
|
]
|
|
858
1080
|
}
|
|
859
1081
|
);
|
|
860
|
-
},
|
|
861
|
-
const { linkPreviewsManager: t } =
|
|
1082
|
+
}, ys = () => {
|
|
1083
|
+
const { linkPreviewsManager: t } = Pt(), { linkPreviews: s } = Ut(
|
|
862
1084
|
t.state,
|
|
863
|
-
|
|
1085
|
+
ws
|
|
864
1086
|
), n = (l) => {
|
|
865
1087
|
t.dismissPreview(l);
|
|
866
1088
|
};
|
|
867
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(
|
|
868
|
-
|
|
1090
|
+
ps,
|
|
869
1091
|
{
|
|
870
1092
|
link: l,
|
|
871
1093
|
onDismiss: n
|
|
872
1094
|
},
|
|
873
1095
|
l.og_scrape_url
|
|
874
1096
|
)) }) : null;
|
|
875
|
-
},
|
|
876
|
-
const { handleSubmit: t } =
|
|
877
|
-
return /* @__PURE__ */ i(
|
|
878
|
-
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(
|
|
1097
|
+
}, _s = () => {
|
|
1098
|
+
const { handleSubmit: t } = Ft(), s = At();
|
|
1099
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
1100
|
+
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Bt, {}) }),
|
|
879
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: [
|
|
880
|
-
/* @__PURE__ */ e(
|
|
881
|
-
/* @__PURE__ */ e(
|
|
882
|
-
/* @__PURE__ */ e(
|
|
1102
|
+
/* @__PURE__ */ e($t, {}),
|
|
1103
|
+
/* @__PURE__ */ e(ys, {}),
|
|
1104
|
+
/* @__PURE__ */ e(jt, {}),
|
|
883
1105
|
/* @__PURE__ */ i("div", { className: "flex", children: [
|
|
884
1106
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
885
|
-
|
|
1107
|
+
Gt,
|
|
886
1108
|
{
|
|
887
1109
|
className: "w-full resize-none outline-none leading-6",
|
|
888
1110
|
autoFocus: !0,
|
|
@@ -898,24 +1120,24 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
898
1120
|
disabled: !s,
|
|
899
1121
|
onClick: t,
|
|
900
1122
|
type: "button",
|
|
901
|
-
children: /* @__PURE__ */ e(
|
|
1123
|
+
children: /* @__PURE__ */ e(Jt, { className: "size-4" })
|
|
902
1124
|
}
|
|
903
1125
|
)
|
|
904
1126
|
] })
|
|
905
1127
|
] })
|
|
906
1128
|
] });
|
|
907
|
-
},
|
|
1129
|
+
}, Es = ({
|
|
908
1130
|
renderActions: t
|
|
909
1131
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
910
1132
|
t && (t == null ? void 0 : t()),
|
|
911
|
-
/* @__PURE__ */ e(
|
|
912
|
-
] }),
|
|
1133
|
+
/* @__PURE__ */ e(Ot, { Input: _s })
|
|
1134
|
+
] }), Ss = [
|
|
913
1135
|
"SYSTEM_DM_AGENT_PAUSED",
|
|
914
1136
|
"SYSTEM_DM_AGENT_RESUMED"
|
|
915
|
-
],
|
|
1137
|
+
], Is = {
|
|
916
1138
|
SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
|
|
917
1139
|
SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
|
|
918
|
-
}, Be = (t) =>
|
|
1140
|
+
}, Be = (t) => Ss.includes(t), Ms = (t) => {
|
|
919
1141
|
var o;
|
|
920
1142
|
const s = (o = t.metadata) == null ? void 0 : o.custom_type;
|
|
921
1143
|
if (Be(s))
|
|
@@ -923,11 +1145,11 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
923
1145
|
const n = t.dm_agent_system_type;
|
|
924
1146
|
if (Be(n))
|
|
925
1147
|
return n;
|
|
926
|
-
},
|
|
1148
|
+
}, ks = (t) => {
|
|
927
1149
|
var o;
|
|
928
|
-
const s = t.message.hide_date === !0, n =
|
|
1150
|
+
const s = t.message.hide_date === !0, n = Ms(t.message);
|
|
929
1151
|
if (n) {
|
|
930
|
-
const l = ((o = t.message.text) == null ? void 0 : o.trim()) ||
|
|
1152
|
+
const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Is[n];
|
|
931
1153
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
932
1154
|
/* @__PURE__ */ i(
|
|
933
1155
|
"div",
|
|
@@ -937,7 +1159,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
937
1159
|
"data-dm-agent-system-type": n,
|
|
938
1160
|
children: [
|
|
939
1161
|
/* @__PURE__ */ e(
|
|
940
|
-
|
|
1162
|
+
Qt,
|
|
941
1163
|
{
|
|
942
1164
|
size: 16,
|
|
943
1165
|
weight: "regular",
|
|
@@ -949,7 +1171,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
949
1171
|
]
|
|
950
1172
|
}
|
|
951
1173
|
),
|
|
952
|
-
!s && /* @__PURE__ */ e(
|
|
1174
|
+
!s && /* @__PURE__ */ e(Re, { message: t.message })
|
|
953
1175
|
] });
|
|
954
1176
|
}
|
|
955
1177
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -958,9 +1180,9 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
958
1180
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
959
1181
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
960
1182
|
] }),
|
|
961
|
-
!s && /* @__PURE__ */ e(
|
|
1183
|
+
!s && /* @__PURE__ */ e(Re, { message: t.message })
|
|
962
1184
|
] });
|
|
963
|
-
},
|
|
1185
|
+
}, Ts = () => null, Ds = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
964
1186
|
"div",
|
|
965
1187
|
{
|
|
966
1188
|
className: R("flex items-center justify-center h-full", t),
|
|
@@ -1003,45 +1225,31 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1003
1225
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1004
1226
|
]
|
|
1005
1227
|
}
|
|
1006
|
-
), Ne =
|
|
1007
|
-
/* @__PURE__ */ e(
|
|
1228
|
+
), 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(Ds, { className: "w-6 h-6" }),
|
|
1008
1230
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1009
1231
|
] }) }));
|
|
1010
1232
|
Ne.displayName = "LoadingState";
|
|
1011
|
-
const
|
|
1233
|
+
const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Rs = ({
|
|
1012
1234
|
onBack: t,
|
|
1013
1235
|
showBackButton: s,
|
|
1014
1236
|
onShowInfo: n,
|
|
1015
1237
|
canShowInfo: o,
|
|
1016
1238
|
showStarButton: l = !1
|
|
1017
1239
|
}) => {
|
|
1018
|
-
var
|
|
1019
|
-
const { channel: m } =
|
|
1020
|
-
(
|
|
1240
|
+
var x, w, r, y, _;
|
|
1241
|
+
const { channel: m } = Me(), a = B.useMemo(() => Object.values(m.state.members || {}).find(
|
|
1242
|
+
(M) => {
|
|
1021
1243
|
var E;
|
|
1022
|
-
return ((E =
|
|
1244
|
+
return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== m._client.userID;
|
|
1023
1245
|
}
|
|
1024
|
-
), [m._client.userID, m.state.members]), c = ((
|
|
1025
|
-
!!((w = m.state.membership) != null && w.pinned_at)
|
|
1026
|
-
);
|
|
1027
|
-
Q(() => {
|
|
1028
|
-
const N = (y) => {
|
|
1029
|
-
var E;
|
|
1030
|
-
b(
|
|
1031
|
-
y != null && y.member ? !!y.member.pinned_at : !!((E = m.state.membership) != null && E.pinned_at)
|
|
1032
|
-
);
|
|
1033
|
-
};
|
|
1034
|
-
return m.on("member.updated", N), () => {
|
|
1035
|
-
m.off("member.updated", N);
|
|
1036
|
-
};
|
|
1037
|
-
}, [m]);
|
|
1038
|
-
const g = async () => {
|
|
1246
|
+
), [m._client.userID, m.state.members]), c = ((x = a == null ? void 0 : a.user) == null ? void 0 : x.name) || ((w = a == null ? void 0 : a.user) == null ? void 0 : w.id) || "Unknown member", g = (r = a == null ? void 0 : a.user) == null ? void 0 : r.image, h = Ve(m), b = async () => {
|
|
1039
1247
|
try {
|
|
1040
1248
|
h ? await m.unpin() : await m.pin();
|
|
1041
|
-
} catch (
|
|
1249
|
+
} catch (C) {
|
|
1042
1250
|
console.error(
|
|
1043
1251
|
"[CustomChannelHeader] Failed to update pinned status:",
|
|
1044
|
-
|
|
1252
|
+
C
|
|
1045
1253
|
);
|
|
1046
1254
|
}
|
|
1047
1255
|
};
|
|
@@ -1050,21 +1258,22 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1050
1258
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
|
|
1051
1259
|
"button",
|
|
1052
1260
|
{
|
|
1053
|
-
className:
|
|
1261
|
+
className: ie,
|
|
1054
1262
|
onClick: t || (() => {
|
|
1055
1263
|
}),
|
|
1056
1264
|
type: "button",
|
|
1057
1265
|
"aria-label": "Back to conversations",
|
|
1058
|
-
children: /* @__PURE__ */ e(
|
|
1266
|
+
children: /* @__PURE__ */ e(Pe, { className: "size-5 text-black/90" })
|
|
1059
1267
|
}
|
|
1060
1268
|
) }),
|
|
1061
1269
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1062
1270
|
/* @__PURE__ */ e(
|
|
1063
|
-
|
|
1271
|
+
se,
|
|
1064
1272
|
{
|
|
1065
|
-
id: ((
|
|
1273
|
+
id: ((y = a == null ? void 0 : a.user) == null ? void 0 : y.id) || m.id || "unknown",
|
|
1066
1274
|
name: c,
|
|
1067
|
-
image:
|
|
1275
|
+
image: g,
|
|
1276
|
+
starred: h,
|
|
1068
1277
|
size: 40
|
|
1069
1278
|
}
|
|
1070
1279
|
),
|
|
@@ -1074,12 +1283,12 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1074
1283
|
l && /* @__PURE__ */ e(
|
|
1075
1284
|
"button",
|
|
1076
1285
|
{
|
|
1077
|
-
className:
|
|
1078
|
-
onClick:
|
|
1286
|
+
className: ie,
|
|
1287
|
+
onClick: b,
|
|
1079
1288
|
type: "button",
|
|
1080
1289
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1081
1290
|
children: /* @__PURE__ */ e(
|
|
1082
|
-
|
|
1291
|
+
Ee,
|
|
1083
1292
|
{
|
|
1084
1293
|
className: R("size-5", {
|
|
1085
1294
|
"text-yellow-600": h,
|
|
@@ -1093,11 +1302,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1093
1302
|
/* @__PURE__ */ e(
|
|
1094
1303
|
"button",
|
|
1095
1304
|
{
|
|
1096
|
-
className:
|
|
1305
|
+
className: ie,
|
|
1097
1306
|
onClick: n,
|
|
1098
1307
|
type: "button",
|
|
1099
1308
|
"aria-label": "Show info",
|
|
1100
|
-
children: /* @__PURE__ */ e(
|
|
1309
|
+
children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
|
|
1101
1310
|
}
|
|
1102
1311
|
)
|
|
1103
1312
|
] })
|
|
@@ -1109,17 +1318,18 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1109
1318
|
{
|
|
1110
1319
|
type: "button",
|
|
1111
1320
|
onClick: t,
|
|
1112
|
-
className:
|
|
1321
|
+
className: ie,
|
|
1113
1322
|
"aria-label": "Back to conversations",
|
|
1114
|
-
children: /* @__PURE__ */ e(
|
|
1323
|
+
children: /* @__PURE__ */ e(Pe, { className: "size-5 text-black/90" })
|
|
1115
1324
|
}
|
|
1116
1325
|
),
|
|
1117
1326
|
/* @__PURE__ */ e(
|
|
1118
|
-
|
|
1327
|
+
se,
|
|
1119
1328
|
{
|
|
1120
|
-
id: ((
|
|
1329
|
+
id: ((_ = a == null ? void 0 : a.user) == null ? void 0 : _.id) || m.id || "unknown",
|
|
1121
1330
|
name: c,
|
|
1122
|
-
image:
|
|
1331
|
+
image: g,
|
|
1332
|
+
starred: h,
|
|
1123
1333
|
size: 40
|
|
1124
1334
|
}
|
|
1125
1335
|
),
|
|
@@ -1129,12 +1339,12 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1129
1339
|
l && /* @__PURE__ */ e(
|
|
1130
1340
|
"button",
|
|
1131
1341
|
{
|
|
1132
|
-
className:
|
|
1133
|
-
onClick:
|
|
1342
|
+
className: ie,
|
|
1343
|
+
onClick: b,
|
|
1134
1344
|
type: "button",
|
|
1135
1345
|
"aria-label": h ? "Unstar conversation" : "Star conversation",
|
|
1136
1346
|
children: /* @__PURE__ */ e(
|
|
1137
|
-
|
|
1347
|
+
Ee,
|
|
1138
1348
|
{
|
|
1139
1349
|
className: R("size-5", {
|
|
1140
1350
|
"text-yellow-600": h,
|
|
@@ -1148,200 +1358,17 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1148
1358
|
o && n && /* @__PURE__ */ e(
|
|
1149
1359
|
"button",
|
|
1150
1360
|
{
|
|
1151
|
-
className:
|
|
1361
|
+
className: ie,
|
|
1152
1362
|
onClick: n,
|
|
1153
1363
|
type: "button",
|
|
1154
1364
|
"aria-label": "Show info",
|
|
1155
|
-
children: /* @__PURE__ */ e(
|
|
1365
|
+
children: /* @__PURE__ */ e(Ue, { className: "size-5 text-black/90" })
|
|
1156
1366
|
}
|
|
1157
1367
|
)
|
|
1158
1368
|
] })
|
|
1159
1369
|
] })
|
|
1160
1370
|
] });
|
|
1161
|
-
},
|
|
1162
|
-
dialogRef: t,
|
|
1163
|
-
onClose: s,
|
|
1164
|
-
participant: n,
|
|
1165
|
-
channel: o,
|
|
1166
|
-
followerStatusLabel: l,
|
|
1167
|
-
onLeaveConversation: m,
|
|
1168
|
-
onBlockParticipant: a,
|
|
1169
|
-
showDeleteConversation: c = !0,
|
|
1170
|
-
onDeleteConversationClick: x,
|
|
1171
|
-
onBlockParticipantClick: h,
|
|
1172
|
-
onReportParticipantClick: b,
|
|
1173
|
-
customChannelActions: g
|
|
1174
|
-
}) => {
|
|
1175
|
-
var W, B, se, ne, ae, j, re;
|
|
1176
|
-
const { service: v, debug: r } = ve(), [S, w] = k(!1), [p, D] = k(!1), [N, y] = k(!1), E = L(async () => {
|
|
1177
|
-
var P;
|
|
1178
|
-
if (!(!v || !((P = n == null ? void 0 : n.user) != null && P.id)))
|
|
1179
|
-
try {
|
|
1180
|
-
const G = (await v.getBlockedUsers()).some(
|
|
1181
|
-
(A) => {
|
|
1182
|
-
var X;
|
|
1183
|
-
return A.blocked_user_id === ((X = n == null ? void 0 : n.user) == null ? void 0 : X.id);
|
|
1184
|
-
}
|
|
1185
|
-
);
|
|
1186
|
-
w(G);
|
|
1187
|
-
} catch (U) {
|
|
1188
|
-
console.error(
|
|
1189
|
-
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
1190
|
-
U
|
|
1191
|
-
);
|
|
1192
|
-
}
|
|
1193
|
-
}, [v, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
|
|
1194
|
-
Q(() => {
|
|
1195
|
-
E();
|
|
1196
|
-
}, [E]);
|
|
1197
|
-
const _ = async () => {
|
|
1198
|
-
var P;
|
|
1199
|
-
if (!p) {
|
|
1200
|
-
x == null || x(), r && console.log("[ChannelInfoDialog] Leave conversation", o.cid), D(!0);
|
|
1201
|
-
try {
|
|
1202
|
-
const U = ((P = o._client) == null ? void 0 : P.userID) ?? null;
|
|
1203
|
-
await o.hide(U, !1), m && await m(o), s();
|
|
1204
|
-
} catch (U) {
|
|
1205
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation", U);
|
|
1206
|
-
} finally {
|
|
1207
|
-
D(!1);
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
}, f = async () => {
|
|
1211
|
-
var P, U, G;
|
|
1212
|
-
if (!(N || !v)) {
|
|
1213
|
-
h == null || h(), r && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), y(!0);
|
|
1214
|
-
try {
|
|
1215
|
-
await v.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
|
|
1216
|
-
} catch (A) {
|
|
1217
|
-
console.error("[ChannelInfoDialog] Failed to block member", A);
|
|
1218
|
-
} finally {
|
|
1219
|
-
y(!1);
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
}, u = async () => {
|
|
1223
|
-
var P, U, G;
|
|
1224
|
-
if (!(N || !v)) {
|
|
1225
|
-
h == null || h(), r && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), y(!0);
|
|
1226
|
-
try {
|
|
1227
|
-
await v.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
|
|
1228
|
-
} catch (A) {
|
|
1229
|
-
console.error("[ChannelInfoDialog] Failed to unblock member", A);
|
|
1230
|
-
} finally {
|
|
1231
|
-
y(!1);
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
}, d = () => {
|
|
1235
|
-
b == null || b(), s(), window.open(
|
|
1236
|
-
"https://linktr.ee/s/about/trust-center/report",
|
|
1237
|
-
"_blank",
|
|
1238
|
-
"noopener,noreferrer"
|
|
1239
|
-
);
|
|
1240
|
-
};
|
|
1241
|
-
if (!n) return null;
|
|
1242
|
-
const C = ((B = n.user) == null ? void 0 : B.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", M = (ne = n.user) == null ? void 0 : ne.image, H = (ae = n.user) == null ? void 0 : ae.email, Z = (j = n.user) == null ? void 0 : j.username, z = H || (Z ? `linktr.ee/${Z}` : void 0), T = ((re = n.user) == null ? void 0 : re.id) || "unknown";
|
|
1243
|
-
return (
|
|
1244
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1245
|
-
/* @__PURE__ */ e(
|
|
1246
|
-
"dialog",
|
|
1247
|
-
{
|
|
1248
|
-
ref: t,
|
|
1249
|
-
className: "mes-dialog group",
|
|
1250
|
-
onClose: s,
|
|
1251
|
-
onClick: (P) => {
|
|
1252
|
-
P.target === t.current && s();
|
|
1253
|
-
},
|
|
1254
|
-
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: [
|
|
1255
|
-
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
1256
|
-
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
1257
|
-
/* @__PURE__ */ e(Ye, { onClick: s })
|
|
1258
|
-
] }),
|
|
1259
|
-
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
1260
|
-
/* @__PURE__ */ e(
|
|
1261
|
-
"div",
|
|
1262
|
-
{
|
|
1263
|
-
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
1264
|
-
style: { backgroundColor: "#FBFAF9" },
|
|
1265
|
-
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
1266
|
-
/* @__PURE__ */ e(
|
|
1267
|
-
te,
|
|
1268
|
-
{
|
|
1269
|
-
id: T,
|
|
1270
|
-
name: C,
|
|
1271
|
-
image: M,
|
|
1272
|
-
size: 88,
|
|
1273
|
-
shape: "circle"
|
|
1274
|
-
}
|
|
1275
|
-
),
|
|
1276
|
-
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
1277
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
|
|
1278
|
-
z && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: z }),
|
|
1279
|
-
l && /* @__PURE__ */ e(
|
|
1280
|
-
"span",
|
|
1281
|
-
{
|
|
1282
|
-
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
1283
|
-
style: {
|
|
1284
|
-
padding: "4px 8px",
|
|
1285
|
-
backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
1286
|
-
color: l === "Subscribed to you" ? "#008236" : "#78716C",
|
|
1287
|
-
lineHeight: "133.333%",
|
|
1288
|
-
letterSpacing: "0.21px"
|
|
1289
|
-
},
|
|
1290
|
-
children: l
|
|
1291
|
-
}
|
|
1292
|
-
)
|
|
1293
|
-
] })
|
|
1294
|
-
] })
|
|
1295
|
-
}
|
|
1296
|
-
),
|
|
1297
|
-
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
1298
|
-
c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
1299
|
-
xe,
|
|
1300
|
-
{
|
|
1301
|
-
onClick: _,
|
|
1302
|
-
disabled: p,
|
|
1303
|
-
"aria-busy": p,
|
|
1304
|
-
children: [
|
|
1305
|
-
p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
|
|
1306
|
-
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
1307
|
-
]
|
|
1308
|
-
}
|
|
1309
|
-
) }),
|
|
1310
|
-
/* @__PURE__ */ e("li", { children: S ? /* @__PURE__ */ i(
|
|
1311
|
-
xe,
|
|
1312
|
-
{
|
|
1313
|
-
onClick: u,
|
|
1314
|
-
disabled: N,
|
|
1315
|
-
"aria-busy": N,
|
|
1316
|
-
children: [
|
|
1317
|
-
N ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
|
|
1318
|
-
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
1319
|
-
]
|
|
1320
|
-
}
|
|
1321
|
-
) : /* @__PURE__ */ i(
|
|
1322
|
-
xe,
|
|
1323
|
-
{
|
|
1324
|
-
onClick: f,
|
|
1325
|
-
disabled: N,
|
|
1326
|
-
"aria-busy": N,
|
|
1327
|
-
children: [
|
|
1328
|
-
N ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
|
|
1329
|
-
/* @__PURE__ */ e("span", { children: "Block" })
|
|
1330
|
-
]
|
|
1331
|
-
}
|
|
1332
|
-
) }),
|
|
1333
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: d, children: [
|
|
1334
|
-
/* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
|
|
1335
|
-
/* @__PURE__ */ e("span", { children: "Report" })
|
|
1336
|
-
] }) }),
|
|
1337
|
-
g
|
|
1338
|
-
] })
|
|
1339
|
-
] })
|
|
1340
|
-
] })
|
|
1341
|
-
}
|
|
1342
|
-
)
|
|
1343
|
-
);
|
|
1344
|
-
}, Ts = ({
|
|
1371
|
+
}, Ls = ({
|
|
1345
1372
|
onBack: t,
|
|
1346
1373
|
showBackButton: s,
|
|
1347
1374
|
renderMessageInputActions: n,
|
|
@@ -1350,97 +1377,99 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1350
1377
|
onBlockParticipant: m,
|
|
1351
1378
|
showDeleteConversation: a = !0,
|
|
1352
1379
|
onDeleteConversationClick: c,
|
|
1353
|
-
onBlockParticipantClick:
|
|
1380
|
+
onBlockParticipantClick: g,
|
|
1354
1381
|
onReportParticipantClick: h,
|
|
1355
1382
|
showStarButton: b = !1,
|
|
1356
|
-
chatbotVotingEnabled:
|
|
1357
|
-
renderChannelBanner:
|
|
1358
|
-
|
|
1359
|
-
|
|
1383
|
+
chatbotVotingEnabled: x = !1,
|
|
1384
|
+
renderChannelBanner: w,
|
|
1385
|
+
customProfileContent: r,
|
|
1386
|
+
customChannelActions: y,
|
|
1387
|
+
renderMessage: _
|
|
1360
1388
|
}) => {
|
|
1361
|
-
const { channel:
|
|
1362
|
-
(
|
|
1363
|
-
var
|
|
1364
|
-
return ((
|
|
1389
|
+
const { channel: C } = Me(), M = Q(null), E = B.useMemo(() => Object.values(C.state.members || {}).find(
|
|
1390
|
+
(u) => {
|
|
1391
|
+
var N;
|
|
1392
|
+
return ((N = u.user) == null ? void 0 : N.id) && u.user.id !== C._client.userID;
|
|
1365
1393
|
}
|
|
1366
|
-
), [
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1369
|
-
return String(
|
|
1370
|
-
if (
|
|
1371
|
-
return
|
|
1372
|
-
}, [
|
|
1373
|
-
var
|
|
1374
|
-
(
|
|
1375
|
-
}, []),
|
|
1376
|
-
var
|
|
1377
|
-
(
|
|
1394
|
+
), [C._client.userID, C.state.members]), p = B.useMemo(() => {
|
|
1395
|
+
const d = C.data ?? {};
|
|
1396
|
+
if (d.followerStatus)
|
|
1397
|
+
return String(d.followerStatus);
|
|
1398
|
+
if (d.isFollower !== void 0)
|
|
1399
|
+
return d.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1400
|
+
}, [C.data]), S = P(() => {
|
|
1401
|
+
var d;
|
|
1402
|
+
(d = M.current) == null || d.showModal();
|
|
1403
|
+
}, []), L = P(() => {
|
|
1404
|
+
var d;
|
|
1405
|
+
(d = M.current) == null || d.close();
|
|
1378
1406
|
}, []);
|
|
1379
|
-
return /* @__PURE__ */ i(
|
|
1407
|
+
return /* @__PURE__ */ i(me, { children: [
|
|
1380
1408
|
/* @__PURE__ */ e(
|
|
1381
|
-
|
|
1409
|
+
Vt,
|
|
1382
1410
|
{
|
|
1383
1411
|
overrides: {
|
|
1384
|
-
Message: (
|
|
1385
|
-
const { message:
|
|
1386
|
-
|
|
1412
|
+
Message: (d) => {
|
|
1413
|
+
const { message: u } = je("ChannelView"), N = /* @__PURE__ */ e(
|
|
1414
|
+
vs,
|
|
1387
1415
|
{
|
|
1388
|
-
...
|
|
1389
|
-
chatbotVotingEnabled:
|
|
1416
|
+
...d,
|
|
1417
|
+
chatbotVotingEnabled: x
|
|
1390
1418
|
}
|
|
1391
1419
|
);
|
|
1392
|
-
return !
|
|
1420
|
+
return !_ || !u ? N : _(N, u);
|
|
1393
1421
|
}
|
|
1394
1422
|
},
|
|
1395
|
-
children: /* @__PURE__ */ i(
|
|
1423
|
+
children: /* @__PURE__ */ i(Ht, { children: [
|
|
1396
1424
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
1397
|
-
|
|
1425
|
+
Rs,
|
|
1398
1426
|
{
|
|
1399
1427
|
onBack: t,
|
|
1400
1428
|
showBackButton: s,
|
|
1401
|
-
onShowInfo:
|
|
1402
|
-
canShowInfo: !!
|
|
1429
|
+
onShowInfo: S,
|
|
1430
|
+
canShowInfo: !!E,
|
|
1403
1431
|
showStarButton: b
|
|
1404
1432
|
}
|
|
1405
1433
|
) }),
|
|
1406
|
-
|
|
1434
|
+
w == null ? void 0 : w(),
|
|
1407
1435
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
|
|
1408
|
-
|
|
1436
|
+
Wt,
|
|
1409
1437
|
{
|
|
1410
1438
|
hideDeletedMessages: !0,
|
|
1411
1439
|
hideNewMessageSeparator: !1,
|
|
1412
1440
|
messageActions: void 0
|
|
1413
1441
|
}
|
|
1414
1442
|
) }),
|
|
1415
|
-
o == null ? void 0 : o(
|
|
1443
|
+
o == null ? void 0 : o(C),
|
|
1416
1444
|
/* @__PURE__ */ e(
|
|
1417
|
-
|
|
1445
|
+
Es,
|
|
1418
1446
|
{
|
|
1419
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1447
|
+
renderActions: () => n == null ? void 0 : n(C)
|
|
1420
1448
|
}
|
|
1421
1449
|
)
|
|
1422
1450
|
] })
|
|
1423
1451
|
}
|
|
1424
1452
|
),
|
|
1425
1453
|
/* @__PURE__ */ e(
|
|
1426
|
-
|
|
1454
|
+
us,
|
|
1427
1455
|
{
|
|
1428
|
-
dialogRef:
|
|
1429
|
-
onClose:
|
|
1430
|
-
participant:
|
|
1431
|
-
channel:
|
|
1432
|
-
followerStatusLabel:
|
|
1456
|
+
dialogRef: M,
|
|
1457
|
+
onClose: L,
|
|
1458
|
+
participant: E,
|
|
1459
|
+
channel: C,
|
|
1460
|
+
followerStatusLabel: p,
|
|
1433
1461
|
onLeaveConversation: l,
|
|
1434
1462
|
onBlockParticipant: m,
|
|
1435
1463
|
showDeleteConversation: a,
|
|
1436
1464
|
onDeleteConversationClick: c,
|
|
1437
|
-
onBlockParticipantClick:
|
|
1465
|
+
onBlockParticipantClick: g,
|
|
1438
1466
|
onReportParticipantClick: h,
|
|
1439
|
-
|
|
1467
|
+
customProfileContent: r,
|
|
1468
|
+
customChannelActions: y
|
|
1440
1469
|
}
|
|
1441
1470
|
)
|
|
1442
1471
|
] });
|
|
1443
|
-
},
|
|
1472
|
+
}, Je = B.memo(
|
|
1444
1473
|
({
|
|
1445
1474
|
channel: t,
|
|
1446
1475
|
onBack: s,
|
|
@@ -1450,39 +1479,40 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1450
1479
|
onLeaveConversation: m,
|
|
1451
1480
|
onBlockParticipant: a,
|
|
1452
1481
|
className: c,
|
|
1453
|
-
CustomChannelEmptyState:
|
|
1482
|
+
CustomChannelEmptyState: g = Ts,
|
|
1454
1483
|
showDeleteConversation: h = !0,
|
|
1455
1484
|
onDeleteConversationClick: b,
|
|
1456
|
-
onBlockParticipantClick:
|
|
1457
|
-
onReportParticipantClick:
|
|
1485
|
+
onBlockParticipantClick: x,
|
|
1486
|
+
onReportParticipantClick: w,
|
|
1458
1487
|
dmAgentEnabled: r,
|
|
1459
|
-
messageMetadata:
|
|
1460
|
-
onMessageSent:
|
|
1461
|
-
showStarButton:
|
|
1462
|
-
chatbotVotingEnabled:
|
|
1463
|
-
renderChannelBanner:
|
|
1464
|
-
|
|
1465
|
-
|
|
1488
|
+
messageMetadata: y,
|
|
1489
|
+
onMessageSent: _,
|
|
1490
|
+
showStarButton: C = !1,
|
|
1491
|
+
chatbotVotingEnabled: M = !1,
|
|
1492
|
+
renderChannelBanner: E,
|
|
1493
|
+
customProfileContent: p,
|
|
1494
|
+
customChannelActions: S,
|
|
1495
|
+
renderMessage: L
|
|
1466
1496
|
}) => {
|
|
1467
|
-
const
|
|
1468
|
-
async (
|
|
1469
|
-
var
|
|
1470
|
-
const
|
|
1471
|
-
...
|
|
1472
|
-
...
|
|
1473
|
-
...
|
|
1497
|
+
const d = P(
|
|
1498
|
+
async (u, N, v) => {
|
|
1499
|
+
var D;
|
|
1500
|
+
const f = ((D = t.data) == null ? void 0 : D.chatbot_paused) === !0, k = r && !f, H = {
|
|
1501
|
+
...N,
|
|
1502
|
+
...k && { silent: !0 },
|
|
1503
|
+
...y && {
|
|
1474
1504
|
metadata: {
|
|
1475
|
-
...
|
|
1476
|
-
...
|
|
1505
|
+
...N.metadata ?? {},
|
|
1506
|
+
...y
|
|
1477
1507
|
}
|
|
1478
1508
|
}
|
|
1479
1509
|
}, Z = {
|
|
1480
|
-
...
|
|
1481
|
-
...
|
|
1482
|
-
},
|
|
1483
|
-
return
|
|
1510
|
+
...v,
|
|
1511
|
+
...k && { skip_push: !0 }
|
|
1512
|
+
}, Y = await t.sendMessage(H, Z);
|
|
1513
|
+
return _ == null || _(Y), Y;
|
|
1484
1514
|
},
|
|
1485
|
-
[t, r,
|
|
1515
|
+
[t, r, y, _]
|
|
1486
1516
|
);
|
|
1487
1517
|
return /* @__PURE__ */ e(
|
|
1488
1518
|
"div",
|
|
@@ -1492,16 +1522,16 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1492
1522
|
c
|
|
1493
1523
|
),
|
|
1494
1524
|
children: /* @__PURE__ */ e(
|
|
1495
|
-
|
|
1525
|
+
zt,
|
|
1496
1526
|
{
|
|
1497
1527
|
channel: t,
|
|
1498
|
-
MessageSystem:
|
|
1499
|
-
EmptyStateIndicator:
|
|
1528
|
+
MessageSystem: ks,
|
|
1529
|
+
EmptyStateIndicator: g,
|
|
1500
1530
|
LoadingIndicator: Ne,
|
|
1501
|
-
DateSeparator:
|
|
1502
|
-
doSendMessageRequest:
|
|
1531
|
+
DateSeparator: ms,
|
|
1532
|
+
doSendMessageRequest: d,
|
|
1503
1533
|
children: /* @__PURE__ */ e(
|
|
1504
|
-
|
|
1534
|
+
Ls,
|
|
1505
1535
|
{
|
|
1506
1536
|
onBack: s,
|
|
1507
1537
|
showBackButton: n,
|
|
@@ -1509,16 +1539,17 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1509
1539
|
renderConversationFooter: l,
|
|
1510
1540
|
onLeaveConversation: m,
|
|
1511
1541
|
onBlockParticipant: a,
|
|
1512
|
-
CustomChannelEmptyState:
|
|
1542
|
+
CustomChannelEmptyState: g,
|
|
1513
1543
|
showDeleteConversation: h,
|
|
1514
1544
|
onDeleteConversationClick: b,
|
|
1515
|
-
onBlockParticipantClick:
|
|
1516
|
-
onReportParticipantClick:
|
|
1517
|
-
showStarButton:
|
|
1518
|
-
chatbotVotingEnabled:
|
|
1519
|
-
renderChannelBanner:
|
|
1520
|
-
|
|
1521
|
-
|
|
1545
|
+
onBlockParticipantClick: x,
|
|
1546
|
+
onReportParticipantClick: w,
|
|
1547
|
+
showStarButton: C,
|
|
1548
|
+
chatbotVotingEnabled: M,
|
|
1549
|
+
renderChannelBanner: E,
|
|
1550
|
+
customProfileContent: p,
|
|
1551
|
+
customChannelActions: S,
|
|
1552
|
+
renderMessage: L
|
|
1522
1553
|
}
|
|
1523
1554
|
)
|
|
1524
1555
|
}
|
|
@@ -1527,16 +1558,16 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1527
1558
|
);
|
|
1528
1559
|
}
|
|
1529
1560
|
);
|
|
1530
|
-
|
|
1531
|
-
function
|
|
1561
|
+
Je.displayName = "ChannelView";
|
|
1562
|
+
function Ps({
|
|
1532
1563
|
searchQuery: t,
|
|
1533
1564
|
setSearchQuery: s,
|
|
1534
1565
|
placeholder: n
|
|
1535
1566
|
}) {
|
|
1536
|
-
const o =
|
|
1567
|
+
const o = Q(null);
|
|
1537
1568
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1538
1569
|
/* @__PURE__ */ e(
|
|
1539
|
-
|
|
1570
|
+
Xt,
|
|
1540
1571
|
{
|
|
1541
1572
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
1542
1573
|
weight: "bold"
|
|
@@ -1554,7 +1585,7 @@ function Rs({
|
|
|
1554
1585
|
}
|
|
1555
1586
|
),
|
|
1556
1587
|
t && /* @__PURE__ */ e(
|
|
1557
|
-
|
|
1588
|
+
Ye,
|
|
1558
1589
|
{
|
|
1559
1590
|
label: "Clear search",
|
|
1560
1591
|
onClick: () => {
|
|
@@ -1562,12 +1593,12 @@ function Rs({
|
|
|
1562
1593
|
s(""), (l = o.current) == null || l.focus();
|
|
1563
1594
|
},
|
|
1564
1595
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1565
|
-
children: /* @__PURE__ */ e(
|
|
1596
|
+
children: /* @__PURE__ */ e(ke, { className: "h-4 w-4", weight: "bold" })
|
|
1566
1597
|
}
|
|
1567
1598
|
)
|
|
1568
1599
|
] });
|
|
1569
1600
|
}
|
|
1570
|
-
const
|
|
1601
|
+
const Us = ({
|
|
1571
1602
|
participantSource: t,
|
|
1572
1603
|
onSelectParticipant: s,
|
|
1573
1604
|
onClose: n,
|
|
@@ -1576,135 +1607,135 @@ const Ls = ({
|
|
|
1576
1607
|
searchPlaceholder: m = "Search participants...",
|
|
1577
1608
|
className: a
|
|
1578
1609
|
}) => {
|
|
1579
|
-
const { debug: c } = ve(), [
|
|
1610
|
+
const { debug: c } = ve(), [g, h] = T(""), [b, x] = T([]), [w, r] = T(!1), [y, _] = T(null), [C, M] = T(
|
|
1580
1611
|
null
|
|
1581
|
-
),
|
|
1582
|
-
|
|
1612
|
+
), E = Q(!1);
|
|
1613
|
+
X(() => {
|
|
1583
1614
|
if (t.loading) {
|
|
1584
1615
|
c && console.log(
|
|
1585
1616
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
1586
1617
|
);
|
|
1587
1618
|
return;
|
|
1588
1619
|
}
|
|
1589
|
-
if (
|
|
1620
|
+
if (E.current) return;
|
|
1590
1621
|
(async () => {
|
|
1591
|
-
c && console.log("[ParticipantPicker] Loading initial participants..."), r(!0),
|
|
1622
|
+
c && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), _(null);
|
|
1592
1623
|
try {
|
|
1593
1624
|
const u = await t.loadParticipants({
|
|
1594
1625
|
search: "",
|
|
1595
1626
|
// Load all participants initially
|
|
1596
1627
|
limit: 100
|
|
1597
1628
|
});
|
|
1598
|
-
|
|
1629
|
+
x(u.participants), E.current = !0, c && console.log(
|
|
1599
1630
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1600
1631
|
u.participants.length
|
|
1601
1632
|
);
|
|
1602
1633
|
} catch (u) {
|
|
1603
|
-
const
|
|
1604
|
-
|
|
1634
|
+
const N = u instanceof Error ? u.message : "Failed to load participants";
|
|
1635
|
+
_(N), console.error("[ParticipantPicker] Failed to load participants:", u);
|
|
1605
1636
|
} finally {
|
|
1606
1637
|
r(!1);
|
|
1607
1638
|
}
|
|
1608
1639
|
})();
|
|
1609
1640
|
}, [t.loading, c]);
|
|
1610
|
-
const
|
|
1611
|
-
var
|
|
1612
|
-
if (!
|
|
1613
|
-
const u =
|
|
1614
|
-
return
|
|
1615
|
-
}),
|
|
1616
|
-
async (
|
|
1617
|
-
if (!
|
|
1618
|
-
|
|
1641
|
+
const p = b.filter((d) => !o.has(d.id)).filter((d) => {
|
|
1642
|
+
var N;
|
|
1643
|
+
if (!g) return !0;
|
|
1644
|
+
const u = g.toLowerCase();
|
|
1645
|
+
return d.name.toLowerCase().includes(u) || ((N = d.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
|
|
1646
|
+
}), S = P(
|
|
1647
|
+
async (d) => {
|
|
1648
|
+
if (!C) {
|
|
1649
|
+
M(d.id);
|
|
1619
1650
|
try {
|
|
1620
|
-
await s(
|
|
1651
|
+
await s(d);
|
|
1621
1652
|
} catch (u) {
|
|
1622
|
-
console.error("[ParticipantPicker] Failed to start chat:", u),
|
|
1653
|
+
console.error("[ParticipantPicker] Failed to start chat:", u), M(null);
|
|
1623
1654
|
}
|
|
1624
1655
|
}
|
|
1625
1656
|
},
|
|
1626
|
-
[s,
|
|
1627
|
-
),
|
|
1628
|
-
(
|
|
1657
|
+
[s, C]
|
|
1658
|
+
), L = (d, u) => {
|
|
1659
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), S(u));
|
|
1629
1660
|
};
|
|
1630
1661
|
return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
|
|
1631
1662
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1632
1663
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1633
1664
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1634
|
-
/* @__PURE__ */ e(
|
|
1665
|
+
/* @__PURE__ */ e(Ze, { onClick: n })
|
|
1635
1666
|
] }),
|
|
1636
1667
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1637
1668
|
"Select a ",
|
|
1638
1669
|
l.slice(0, -1),
|
|
1639
1670
|
" to start messaging (",
|
|
1640
|
-
|
|
1671
|
+
p.length,
|
|
1641
1672
|
" available)",
|
|
1642
1673
|
t.totalCount !== void 0 && ` โข ${t.totalCount} ${l} total`
|
|
1643
1674
|
] }),
|
|
1644
1675
|
/* @__PURE__ */ e(
|
|
1645
|
-
|
|
1676
|
+
Ps,
|
|
1646
1677
|
{
|
|
1647
|
-
searchQuery:
|
|
1678
|
+
searchQuery: g,
|
|
1648
1679
|
setSearchQuery: h,
|
|
1649
1680
|
placeholder: m
|
|
1650
1681
|
}
|
|
1651
1682
|
)
|
|
1652
1683
|
] }),
|
|
1653
|
-
|
|
1684
|
+
y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1654
1685
|
"Error loading ",
|
|
1655
1686
|
l,
|
|
1656
1687
|
": ",
|
|
1657
|
-
|
|
1688
|
+
y
|
|
1658
1689
|
] }),
|
|
1659
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
1690
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: w && p.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: [
|
|
1660
1691
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1661
1692
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1662
1693
|
"Loading ",
|
|
1663
1694
|
l,
|
|
1664
1695
|
"..."
|
|
1665
1696
|
] })
|
|
1666
|
-
] }) }) :
|
|
1697
|
+
] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1667
1698
|
/* @__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" }) }),
|
|
1668
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
1669
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
1699
|
+
/* @__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
|
+
/* @__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` })
|
|
1670
1701
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1671
|
-
|
|
1672
|
-
const u =
|
|
1702
|
+
p.map((d) => {
|
|
1703
|
+
const u = d.name || d.email || d.id, N = d.email && d.name ? d.email : d.phone;
|
|
1673
1704
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1674
1705
|
"button",
|
|
1675
1706
|
{
|
|
1676
1707
|
type: "button",
|
|
1677
|
-
onClick: () =>
|
|
1678
|
-
onKeyDown: (
|
|
1708
|
+
onClick: () => S(d),
|
|
1709
|
+
onKeyDown: (v) => L(v, d),
|
|
1679
1710
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1680
1711
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1681
1712
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1682
1713
|
/* @__PURE__ */ e(
|
|
1683
|
-
|
|
1714
|
+
se,
|
|
1684
1715
|
{
|
|
1685
|
-
id:
|
|
1716
|
+
id: d.id,
|
|
1686
1717
|
name: u,
|
|
1687
|
-
image:
|
|
1718
|
+
image: d.image,
|
|
1688
1719
|
size: 40
|
|
1689
1720
|
}
|
|
1690
1721
|
),
|
|
1691
1722
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1692
1723
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
|
|
1693
|
-
|
|
1724
|
+
N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
|
|
1694
1725
|
] })
|
|
1695
1726
|
] }),
|
|
1696
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1727
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === d.id ? /* @__PURE__ */ e(be, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone" }) })
|
|
1697
1728
|
] })
|
|
1698
1729
|
}
|
|
1699
|
-
) },
|
|
1730
|
+
) }, d.id);
|
|
1700
1731
|
}),
|
|
1701
|
-
|
|
1732
|
+
w && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1702
1733
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1703
1734
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1704
1735
|
] }) })
|
|
1705
1736
|
] }) })
|
|
1706
1737
|
] });
|
|
1707
|
-
},
|
|
1738
|
+
}, Os = ({ className: t }) => /* @__PURE__ */ i(
|
|
1708
1739
|
"svg",
|
|
1709
1740
|
{
|
|
1710
1741
|
width: "140",
|
|
@@ -1838,17 +1869,17 @@ const Ls = ({
|
|
|
1838
1869
|
] })
|
|
1839
1870
|
]
|
|
1840
1871
|
}
|
|
1841
|
-
),
|
|
1872
|
+
), Qe = B.memo(
|
|
1842
1873
|
({ 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: [
|
|
1843
|
-
/* @__PURE__ */ e(
|
|
1874
|
+
/* @__PURE__ */ e(Os, {}),
|
|
1844
1875
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1845
1876
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1846
1877
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1847
1878
|
] })
|
|
1848
1879
|
] }) })
|
|
1849
1880
|
);
|
|
1850
|
-
|
|
1851
|
-
const Ce =
|
|
1881
|
+
Qe.displayName = "EmptyState";
|
|
1882
|
+
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: [
|
|
1852
1883
|
/* @__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: "โ ๏ธ" }) }),
|
|
1853
1884
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1854
1885
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1863,7 +1894,7 @@ const Ce = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1863
1894
|
)
|
|
1864
1895
|
] }) }));
|
|
1865
1896
|
Ce.displayName = "ErrorState";
|
|
1866
|
-
const
|
|
1897
|
+
const Ws = ({
|
|
1867
1898
|
capabilities: t = {},
|
|
1868
1899
|
className: s,
|
|
1869
1900
|
renderMessageInputActions: n,
|
|
@@ -1872,37 +1903,38 @@ const Hs = ({
|
|
|
1872
1903
|
onParticipantSelect: m,
|
|
1873
1904
|
initialParticipantFilter: a,
|
|
1874
1905
|
initialParticipantData: c,
|
|
1875
|
-
CustomChannelEmptyState:
|
|
1906
|
+
CustomChannelEmptyState: g,
|
|
1876
1907
|
showChannelList: h = !0,
|
|
1877
1908
|
filters: b,
|
|
1878
|
-
channelListCustomEmptyStateIndicator:
|
|
1879
|
-
onDeleteConversationClick:
|
|
1909
|
+
channelListCustomEmptyStateIndicator: x,
|
|
1910
|
+
onDeleteConversationClick: w,
|
|
1880
1911
|
onBlockParticipantClick: r,
|
|
1881
|
-
onReportParticipantClick:
|
|
1882
|
-
dmAgentEnabled:
|
|
1883
|
-
messageMetadata:
|
|
1884
|
-
onMessageSent:
|
|
1885
|
-
showStarButton:
|
|
1886
|
-
chatbotVotingEnabled:
|
|
1887
|
-
renderMessagePreview:
|
|
1888
|
-
renderChannelBanner:
|
|
1889
|
-
|
|
1890
|
-
|
|
1912
|
+
onReportParticipantClick: y,
|
|
1913
|
+
dmAgentEnabled: _,
|
|
1914
|
+
messageMetadata: C,
|
|
1915
|
+
onMessageSent: M,
|
|
1916
|
+
showStarButton: E = !1,
|
|
1917
|
+
chatbotVotingEnabled: p = !1,
|
|
1918
|
+
renderMessagePreview: S,
|
|
1919
|
+
renderChannelBanner: L,
|
|
1920
|
+
customProfileContent: d,
|
|
1921
|
+
customChannelActions: u,
|
|
1922
|
+
renderMessage: N
|
|
1891
1923
|
}) => {
|
|
1892
1924
|
const {
|
|
1893
|
-
service:
|
|
1894
|
-
client:
|
|
1895
|
-
isConnected:
|
|
1925
|
+
service: v,
|
|
1926
|
+
client: f,
|
|
1927
|
+
isConnected: k,
|
|
1896
1928
|
isLoading: H,
|
|
1897
1929
|
error: Z,
|
|
1898
|
-
refreshConnection:
|
|
1899
|
-
debug:
|
|
1900
|
-
} =
|
|
1901
|
-
participantSource:
|
|
1902
|
-
participantLabel:
|
|
1903
|
-
showDeleteConversation:
|
|
1904
|
-
} = t,
|
|
1905
|
-
const I =
|
|
1930
|
+
refreshConnection: Y,
|
|
1931
|
+
debug: D
|
|
1932
|
+
} = Kt(), [W, j] = T(null), [ne, ae] = T(!1), [G, K] = T(!1), [re, U] = T(!1), [O, A] = T(/* @__PURE__ */ new Set()), [z, ce] = T(0), [q, oe] = T(!1), [ee, J] = T(null), te = Q(null), {
|
|
1933
|
+
participantSource: de,
|
|
1934
|
+
participantLabel: ue = "participants",
|
|
1935
|
+
showDeleteConversation: Xe = !0
|
|
1936
|
+
} = t, Ke = B.useMemo(() => {
|
|
1937
|
+
const I = f == null ? void 0 : f.userID;
|
|
1906
1938
|
return {
|
|
1907
1939
|
...{
|
|
1908
1940
|
type: "messaging",
|
|
@@ -1914,50 +1946,50 @@ const Hs = ({
|
|
|
1914
1946
|
},
|
|
1915
1947
|
...b
|
|
1916
1948
|
};
|
|
1917
|
-
}, [b,
|
|
1918
|
-
if (!
|
|
1919
|
-
const I =
|
|
1949
|
+
}, [b, f == null ? void 0 : f.userID]), he = Q(null), le = P(async () => {
|
|
1950
|
+
if (!f || !k) return;
|
|
1951
|
+
const I = f.userID;
|
|
1920
1952
|
if (I)
|
|
1921
1953
|
try {
|
|
1922
|
-
|
|
1923
|
-
const V = await
|
|
1954
|
+
D && console.log("[MessagingShell] Syncing channels for user:", I);
|
|
1955
|
+
const V = await f.queryChannels(
|
|
1924
1956
|
{
|
|
1925
1957
|
type: "messaging",
|
|
1926
1958
|
members: { $in: [I] }
|
|
1927
1959
|
},
|
|
1928
1960
|
{},
|
|
1929
1961
|
{ limit: 100 }
|
|
1930
|
-
),
|
|
1962
|
+
), F = /* @__PURE__ */ new Set();
|
|
1931
1963
|
V.forEach(($) => {
|
|
1932
1964
|
const we = $.state.members;
|
|
1933
|
-
Object.values(we).forEach((
|
|
1965
|
+
Object.values(we).forEach((ot) => {
|
|
1934
1966
|
var De;
|
|
1935
|
-
const pe = (De =
|
|
1936
|
-
pe && pe !== I &&
|
|
1967
|
+
const pe = (De = ot.user) == null ? void 0 : De.id;
|
|
1968
|
+
pe && pe !== I && F.add(pe);
|
|
1937
1969
|
});
|
|
1938
|
-
}),
|
|
1970
|
+
}), A(($) => $.size === F.size && [...$].every((we) => F.has(we)) ? $ : F), ae(V.length > 0), K(!0), he.current = I, D && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1939
1971
|
channelCount: V.length,
|
|
1940
|
-
memberCount:
|
|
1972
|
+
memberCount: F.size
|
|
1941
1973
|
});
|
|
1942
1974
|
} catch (V) {
|
|
1943
1975
|
console.error("[MessagingShell] Failed to sync channels:", V);
|
|
1944
1976
|
}
|
|
1945
|
-
}, [
|
|
1946
|
-
|
|
1947
|
-
if (!
|
|
1948
|
-
const I =
|
|
1949
|
-
I && he.current !== I &&
|
|
1950
|
-
}, [
|
|
1951
|
-
if (!a || !
|
|
1977
|
+
}, [f, k, D]);
|
|
1978
|
+
X(() => {
|
|
1979
|
+
if (!f || !k) return;
|
|
1980
|
+
const I = f.userID;
|
|
1981
|
+
I && he.current !== I && le();
|
|
1982
|
+
}, [f, k, le]), X(() => {
|
|
1983
|
+
if (!a || !f || !k) return;
|
|
1952
1984
|
(async () => {
|
|
1953
|
-
const V =
|
|
1985
|
+
const V = f.userID;
|
|
1954
1986
|
if (V)
|
|
1955
1987
|
try {
|
|
1956
|
-
|
|
1988
|
+
D && console.log(
|
|
1957
1989
|
"[MessagingShell] Loading initial conversation with:",
|
|
1958
1990
|
a
|
|
1959
1991
|
);
|
|
1960
|
-
const
|
|
1992
|
+
const F = await f.queryChannels(
|
|
1961
1993
|
{
|
|
1962
1994
|
type: "messaging",
|
|
1963
1995
|
members: { $eq: [V, a] }
|
|
@@ -1965,24 +1997,24 @@ const Hs = ({
|
|
|
1965
1997
|
{},
|
|
1966
1998
|
{ limit: 1 }
|
|
1967
1999
|
);
|
|
1968
|
-
if (
|
|
1969
|
-
|
|
2000
|
+
if (F.length > 0)
|
|
2001
|
+
j(F[0]), oe(!0), J(null), l && l(F[0]), D && console.log(
|
|
1970
2002
|
"[MessagingShell] Initial conversation loaded:",
|
|
1971
|
-
|
|
2003
|
+
F[0].id
|
|
1972
2004
|
);
|
|
1973
|
-
else if (c &&
|
|
1974
|
-
|
|
2005
|
+
else if (c && v) {
|
|
2006
|
+
D && console.log(
|
|
1975
2007
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1976
2008
|
c
|
|
1977
2009
|
);
|
|
1978
2010
|
try {
|
|
1979
|
-
const $ = await
|
|
2011
|
+
const $ = await v.startChannelWithParticipant({
|
|
1980
2012
|
id: c.id,
|
|
1981
2013
|
name: c.name,
|
|
1982
2014
|
email: c.email,
|
|
1983
2015
|
phone: c.phone
|
|
1984
2016
|
});
|
|
1985
|
-
|
|
2017
|
+
j($), oe(!0), J(null), l && l($), D && console.log(
|
|
1986
2018
|
"[MessagingShell] Channel created and loaded:",
|
|
1987
2019
|
$.id
|
|
1988
2020
|
);
|
|
@@ -1990,90 +2022,90 @@ const Hs = ({
|
|
|
1990
2022
|
console.error(
|
|
1991
2023
|
"[MessagingShell] Failed to create conversation:",
|
|
1992
2024
|
$
|
|
1993
|
-
),
|
|
2025
|
+
), J("Failed to create conversation");
|
|
1994
2026
|
}
|
|
1995
2027
|
} else
|
|
1996
|
-
|
|
2028
|
+
J(
|
|
1997
2029
|
"No conversation found with this account"
|
|
1998
|
-
),
|
|
2030
|
+
), D && console.log(
|
|
1999
2031
|
"[MessagingShell] No conversation found for:",
|
|
2000
2032
|
a
|
|
2001
2033
|
);
|
|
2002
|
-
} catch (
|
|
2034
|
+
} catch (F) {
|
|
2003
2035
|
console.error(
|
|
2004
2036
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2005
|
-
|
|
2006
|
-
),
|
|
2037
|
+
F
|
|
2038
|
+
), J("Failed to load conversation");
|
|
2007
2039
|
}
|
|
2008
2040
|
})();
|
|
2009
2041
|
}, [
|
|
2010
2042
|
a,
|
|
2011
2043
|
c,
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2044
|
+
f,
|
|
2045
|
+
k,
|
|
2046
|
+
v,
|
|
2047
|
+
D,
|
|
2016
2048
|
l
|
|
2017
2049
|
]);
|
|
2018
|
-
const
|
|
2050
|
+
const et = P(
|
|
2019
2051
|
(I) => {
|
|
2020
|
-
|
|
2052
|
+
j(I), l == null || l(I);
|
|
2021
2053
|
},
|
|
2022
2054
|
[l]
|
|
2023
|
-
),
|
|
2024
|
-
q ||
|
|
2025
|
-
}, [q]),
|
|
2055
|
+
), tt = P(() => {
|
|
2056
|
+
q || j(null);
|
|
2057
|
+
}, [q]), st = P(
|
|
2026
2058
|
async (I) => {
|
|
2027
2059
|
var V;
|
|
2028
|
-
if (
|
|
2060
|
+
if (v)
|
|
2029
2061
|
try {
|
|
2030
|
-
|
|
2062
|
+
D && console.log(
|
|
2031
2063
|
"[MessagingShell] Starting conversation with:",
|
|
2032
2064
|
I.id
|
|
2033
2065
|
);
|
|
2034
|
-
const
|
|
2066
|
+
const F = await v.startChannelWithParticipant({
|
|
2035
2067
|
id: I.id,
|
|
2036
2068
|
name: I.name,
|
|
2037
2069
|
email: I.email,
|
|
2038
2070
|
phone: I.phone
|
|
2039
2071
|
});
|
|
2040
2072
|
try {
|
|
2041
|
-
await
|
|
2073
|
+
await F.show();
|
|
2042
2074
|
} catch ($) {
|
|
2043
2075
|
console.warn("[MessagingShell] Failed to unhide channel:", $);
|
|
2044
2076
|
}
|
|
2045
|
-
|
|
2046
|
-
} catch (
|
|
2047
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
2077
|
+
j(F), U(!1), (V = te.current) == null || V.close(), m == null || m(I);
|
|
2078
|
+
} catch (F) {
|
|
2079
|
+
console.error("[MessagingShell] Failed to start conversation:", F);
|
|
2048
2080
|
}
|
|
2049
2081
|
},
|
|
2050
|
-
[
|
|
2051
|
-
), fe =
|
|
2082
|
+
[v, m, D]
|
|
2083
|
+
), fe = P(() => {
|
|
2052
2084
|
var I;
|
|
2053
|
-
|
|
2054
|
-
}, []),
|
|
2085
|
+
U(!1), (I = te.current) == null || I.close();
|
|
2086
|
+
}, []), nt = P(
|
|
2055
2087
|
(I) => {
|
|
2056
|
-
I.target ===
|
|
2088
|
+
I.target === te.current && fe();
|
|
2057
2089
|
},
|
|
2058
2090
|
[fe]
|
|
2059
|
-
),
|
|
2091
|
+
), at = P(
|
|
2060
2092
|
async (I) => {
|
|
2061
|
-
|
|
2093
|
+
D && console.log("[MessagingShell] Leaving conversation:", I.id), j(null), oe(!1), he.current = null, await le();
|
|
2062
2094
|
},
|
|
2063
|
-
[
|
|
2064
|
-
),
|
|
2095
|
+
[le, D]
|
|
2096
|
+
), rt = P(
|
|
2065
2097
|
async (I) => {
|
|
2066
|
-
|
|
2098
|
+
D && console.log("[MessagingShell] Blocking participant:", I), j(null), oe(!1), he.current = null, await le();
|
|
2067
2099
|
},
|
|
2068
|
-
[
|
|
2100
|
+
[le, D]
|
|
2069
2101
|
), ge = !!W;
|
|
2070
|
-
return H ? /* @__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:
|
|
2102
|
+
return H ? /* @__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: Y }) }) : !k || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
|
|
2071
2103
|
Ce,
|
|
2072
2104
|
{
|
|
2073
2105
|
message: "Not connected to messaging service",
|
|
2074
|
-
onBack:
|
|
2106
|
+
onBack: Y
|
|
2075
2107
|
}
|
|
2076
|
-
) }) :
|
|
2108
|
+
) }) : ee ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: ee }) }) : /* @__PURE__ */ i(
|
|
2077
2109
|
"div",
|
|
2078
2110
|
{
|
|
2079
2111
|
className: R(
|
|
@@ -2096,13 +2128,13 @@ const Hs = ({
|
|
|
2096
2128
|
}
|
|
2097
2129
|
),
|
|
2098
2130
|
children: /* @__PURE__ */ e(
|
|
2099
|
-
|
|
2131
|
+
qe,
|
|
2100
2132
|
{
|
|
2101
|
-
onChannelSelect:
|
|
2133
|
+
onChannelSelect: et,
|
|
2102
2134
|
selectedChannel: W || void 0,
|
|
2103
|
-
filters:
|
|
2104
|
-
customEmptyStateIndicator:
|
|
2105
|
-
renderMessagePreview:
|
|
2135
|
+
filters: Ke,
|
|
2136
|
+
customEmptyStateIndicator: x,
|
|
2137
|
+
renderMessagePreview: S
|
|
2106
2138
|
}
|
|
2107
2139
|
)
|
|
2108
2140
|
}
|
|
@@ -2120,69 +2152,70 @@ const Hs = ({
|
|
|
2120
2152
|
}
|
|
2121
2153
|
),
|
|
2122
2154
|
children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
2123
|
-
|
|
2155
|
+
Je,
|
|
2124
2156
|
{
|
|
2125
2157
|
channel: W,
|
|
2126
|
-
onBack:
|
|
2158
|
+
onBack: tt,
|
|
2127
2159
|
showBackButton: !q,
|
|
2128
2160
|
renderMessageInputActions: n,
|
|
2129
2161
|
renderConversationFooter: o,
|
|
2130
|
-
renderChannelBanner:
|
|
2131
|
-
onLeaveConversation:
|
|
2132
|
-
onBlockParticipant:
|
|
2133
|
-
CustomChannelEmptyState:
|
|
2134
|
-
showDeleteConversation:
|
|
2135
|
-
onDeleteConversationClick:
|
|
2162
|
+
renderChannelBanner: L,
|
|
2163
|
+
onLeaveConversation: at,
|
|
2164
|
+
onBlockParticipant: rt,
|
|
2165
|
+
CustomChannelEmptyState: g,
|
|
2166
|
+
showDeleteConversation: Xe,
|
|
2167
|
+
onDeleteConversationClick: w,
|
|
2136
2168
|
onBlockParticipantClick: r,
|
|
2137
|
-
onReportParticipantClick:
|
|
2138
|
-
dmAgentEnabled:
|
|
2139
|
-
messageMetadata:
|
|
2140
|
-
onMessageSent:
|
|
2141
|
-
showStarButton:
|
|
2142
|
-
chatbotVotingEnabled:
|
|
2143
|
-
|
|
2144
|
-
|
|
2169
|
+
onReportParticipantClick: y,
|
|
2170
|
+
dmAgentEnabled: _,
|
|
2171
|
+
messageMetadata: C,
|
|
2172
|
+
onMessageSent: M,
|
|
2173
|
+
showStarButton: E,
|
|
2174
|
+
chatbotVotingEnabled: p,
|
|
2175
|
+
customProfileContent: d,
|
|
2176
|
+
customChannelActions: u,
|
|
2177
|
+
renderMessage: N
|
|
2145
2178
|
},
|
|
2146
2179
|
W.id
|
|
2147
2180
|
) }) : a ? (
|
|
2148
2181
|
// Show loading while creating/loading direct conversation channel
|
|
2149
2182
|
/* @__PURE__ */ e(Ne, {})
|
|
2150
2183
|
) : /* @__PURE__ */ e(
|
|
2151
|
-
|
|
2184
|
+
Qe,
|
|
2152
2185
|
{
|
|
2153
|
-
hasChannels:
|
|
2154
|
-
channelsLoaded:
|
|
2186
|
+
hasChannels: ne,
|
|
2187
|
+
channelsLoaded: G
|
|
2155
2188
|
}
|
|
2156
2189
|
)
|
|
2157
2190
|
}
|
|
2158
2191
|
)
|
|
2159
2192
|
] }),
|
|
2160
|
-
|
|
2193
|
+
de && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
2161
2194
|
/* @__PURE__ */ e(
|
|
2162
2195
|
"dialog",
|
|
2163
2196
|
{
|
|
2164
|
-
ref:
|
|
2197
|
+
ref: te,
|
|
2165
2198
|
className: "mes-dialog",
|
|
2166
|
-
onClick:
|
|
2199
|
+
onClick: nt,
|
|
2167
2200
|
onClose: fe,
|
|
2168
2201
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
2169
|
-
|
|
2202
|
+
Us,
|
|
2170
2203
|
{
|
|
2171
|
-
participantSource:
|
|
2172
|
-
onSelectParticipant:
|
|
2204
|
+
participantSource: de,
|
|
2205
|
+
onSelectParticipant: st,
|
|
2173
2206
|
onClose: fe,
|
|
2174
|
-
existingParticipantIds:
|
|
2175
|
-
participantLabel:
|
|
2176
|
-
searchPlaceholder: `Search ${
|
|
2207
|
+
existingParticipantIds: O,
|
|
2208
|
+
participantLabel: ue,
|
|
2209
|
+
searchPlaceholder: `Search ${ue}...`
|
|
2177
2210
|
},
|
|
2178
|
-
|
|
2211
|
+
z
|
|
2179
2212
|
) })
|
|
2180
2213
|
}
|
|
2181
2214
|
)
|
|
2182
2215
|
]
|
|
2183
2216
|
}
|
|
2184
2217
|
);
|
|
2185
|
-
},
|
|
2218
|
+
}, Fs = ({
|
|
2186
2219
|
question: t,
|
|
2187
2220
|
onClick: s,
|
|
2188
2221
|
loading: n = !1,
|
|
@@ -2204,7 +2237,7 @@ const Hs = ({
|
|
|
2204
2237
|
),
|
|
2205
2238
|
children: t
|
|
2206
2239
|
}
|
|
2207
|
-
),
|
|
2240
|
+
), qs = ({
|
|
2208
2241
|
faqs: t,
|
|
2209
2242
|
onFaqClick: s,
|
|
2210
2243
|
loadingFaqId: n,
|
|
@@ -2213,10 +2246,10 @@ const Hs = ({
|
|
|
2213
2246
|
avatarImage: m,
|
|
2214
2247
|
avatarName: a
|
|
2215
2248
|
}) => {
|
|
2216
|
-
const c = t.filter((
|
|
2249
|
+
const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
|
|
2217
2250
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2218
2251
|
(m || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2219
|
-
|
|
2252
|
+
se,
|
|
2220
2253
|
{
|
|
2221
2254
|
id: a || "account",
|
|
2222
2255
|
name: a || "Account",
|
|
@@ -2232,75 +2265,75 @@ const Hs = ({
|
|
|
2232
2265
|
style: { backgroundColor: "#F1F0EE" },
|
|
2233
2266
|
children: [
|
|
2234
2267
|
o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
|
|
2235
|
-
c.map((
|
|
2236
|
-
|
|
2268
|
+
c.map((g) => /* @__PURE__ */ e(
|
|
2269
|
+
Fs,
|
|
2237
2270
|
{
|
|
2238
|
-
question:
|
|
2239
|
-
onClick: () => s(
|
|
2240
|
-
loading: n ===
|
|
2271
|
+
question: g.question,
|
|
2272
|
+
onClick: () => s(g.id),
|
|
2273
|
+
loading: n === g.id
|
|
2241
2274
|
},
|
|
2242
|
-
|
|
2275
|
+
g.id
|
|
2243
2276
|
))
|
|
2244
2277
|
]
|
|
2245
2278
|
}
|
|
2246
2279
|
)
|
|
2247
2280
|
] }) });
|
|
2248
|
-
},
|
|
2249
|
-
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] =
|
|
2281
|
+
}, Ys = (t, s = {}) => {
|
|
2282
|
+
const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = T([]), [a, c] = T(!1), [g, h] = T(null), [b, x] = T(n), [w, r] = T(!0), [y, _] = T(), C = P(async (S = !1, L) => {
|
|
2250
2283
|
if (a) return;
|
|
2251
|
-
const
|
|
2284
|
+
const d = L !== void 0 ? L : b;
|
|
2252
2285
|
c(!0), h(null);
|
|
2253
2286
|
try {
|
|
2254
2287
|
const u = await t.loadParticipants({
|
|
2255
|
-
search:
|
|
2288
|
+
search: d || void 0,
|
|
2256
2289
|
limit: o,
|
|
2257
|
-
cursor:
|
|
2290
|
+
cursor: S ? void 0 : y
|
|
2258
2291
|
});
|
|
2259
2292
|
m(
|
|
2260
|
-
(
|
|
2261
|
-
), r(u.hasMore),
|
|
2293
|
+
(N) => S ? u.participants : [...N, ...u.participants]
|
|
2294
|
+
), r(u.hasMore), _(u.nextCursor);
|
|
2262
2295
|
} catch (u) {
|
|
2263
|
-
const
|
|
2264
|
-
h(
|
|
2296
|
+
const N = u instanceof Error ? u.message : "Failed to load participants";
|
|
2297
|
+
h(N), console.error("[useParticipants] Load error:", u);
|
|
2265
2298
|
} finally {
|
|
2266
2299
|
c(!1);
|
|
2267
2300
|
}
|
|
2268
|
-
}, [t, b,
|
|
2269
|
-
|
|
2270
|
-
}, [
|
|
2271
|
-
|
|
2272
|
-
}, [
|
|
2273
|
-
|
|
2274
|
-
}, [
|
|
2275
|
-
return
|
|
2276
|
-
|
|
2301
|
+
}, [t, b, y, o, a]), M = P(() => {
|
|
2302
|
+
w && !a && C(!1);
|
|
2303
|
+
}, [w, a, C]), E = P((S) => {
|
|
2304
|
+
x(S), _(void 0), C(!0, S);
|
|
2305
|
+
}, [C]), p = P(() => {
|
|
2306
|
+
_(void 0), C(!0);
|
|
2307
|
+
}, [C]);
|
|
2308
|
+
return X(() => {
|
|
2309
|
+
C(!0);
|
|
2277
2310
|
}, [t.loadParticipants]), {
|
|
2278
2311
|
participants: l,
|
|
2279
2312
|
loading: a,
|
|
2280
|
-
error:
|
|
2313
|
+
error: g,
|
|
2281
2314
|
searchQuery: b,
|
|
2282
|
-
hasMore:
|
|
2315
|
+
hasMore: w,
|
|
2283
2316
|
totalCount: t.totalCount,
|
|
2284
|
-
loadMore:
|
|
2285
|
-
search:
|
|
2286
|
-
refresh:
|
|
2317
|
+
loadMore: M,
|
|
2318
|
+
search: E,
|
|
2319
|
+
refresh: p
|
|
2287
2320
|
};
|
|
2288
2321
|
};
|
|
2289
2322
|
export {
|
|
2290
2323
|
xe as ActionButton,
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2324
|
+
se as Avatar,
|
|
2325
|
+
Ts as ChannelEmptyState,
|
|
2326
|
+
qe as ChannelList,
|
|
2327
|
+
Je as ChannelView,
|
|
2328
|
+
qs as FaqList,
|
|
2329
|
+
Fs as FaqListItem,
|
|
2330
|
+
bs as MessageVoteButtons,
|
|
2331
|
+
Hs as MessagingProvider,
|
|
2332
|
+
Ws as MessagingShell,
|
|
2333
|
+
Us as ParticipantPicker,
|
|
2334
|
+
ns as formatRelativeTime,
|
|
2335
|
+
fs as useMessageVote,
|
|
2336
|
+
Kt as useMessaging,
|
|
2337
|
+
Ys as useParticipants
|
|
2305
2338
|
};
|
|
2306
2339
|
//# sourceMappingURL=index.js.map
|