@linktr.ee/messaging-react 1.12.2-rc-1765340127 โ 1.12.2-rc-1765345284
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +470 -482
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelView.tsx +0 -5
- package/src/components/MessagingShell/ChannelEmptyState.tsx +1 -4
- package/src/components/MessagingShell/LoadingState.tsx +7 -10
- package/src/components/MessagingShell/index.tsx +6 -18
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
|
|
2
|
+
import p from "classnames";
|
|
3
|
+
import U, { createContext as Pe, useContext as Oe, useCallback as D, useState as y, useRef as z, useEffect as G } from "react";
|
|
4
4
|
import { StreamChatService as je } from "@linktr.ee/messaging-core";
|
|
5
|
-
import { Chat as Ae, ChannelList as ze, useMessageComposer as Be, useStateStore as
|
|
6
|
-
import { XIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const ye =
|
|
5
|
+
import { Chat as Ae, ChannelList as ze, useMessageComposer as Be, useStateStore as $e, MessageInput as Ge, useMessageInputContext as He, useMessageComposerHasSendableData as Ve, SimpleAttachmentSelector as We, QuotedMessagePreview as Ze, AttachmentPreviewList as qe, TextareaComposer as Ye, MessageTimestamp as Je, Channel as Qe, useChannelStateContext as we, Window as Xe, MessageList as Ke } from "stream-chat-react";
|
|
6
|
+
import { XIcon as me, ArrowUpIcon as es, ArrowLeftIcon as fe, DotsThreeIcon as ge, SpinnerGapIcon as re, SignOutIcon as ss, ProhibitInsetIcon as xe, FlagIcon as ts, MagnifyingGlassIcon as ns, ChatCircleDotsIcon as Ne } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as be } from "stream-chat";
|
|
8
|
+
const ye = Pe({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,48 +15,48 @@ const ye = Ue({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), oe = () =>
|
|
18
|
+
}), oe = () => Oe(ye), Ms = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
22
|
apiKey: r,
|
|
23
|
-
capabilities:
|
|
24
|
-
debug:
|
|
23
|
+
capabilities: a = {},
|
|
24
|
+
debug: c = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const l =
|
|
27
|
-
(u, ...
|
|
28
|
-
|
|
26
|
+
const l = D(
|
|
27
|
+
(u, ...b) => {
|
|
28
|
+
c && console.log(`๐ฅ [MessagingProvider] ${u}`, ...b);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[c]
|
|
31
31
|
);
|
|
32
32
|
l("๐ RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
34
34
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
35
35
|
serviceConfig: !!n,
|
|
36
|
-
capabilities: Object.keys(
|
|
36
|
+
capabilities: Object.keys(a)
|
|
37
37
|
});
|
|
38
|
-
const [m, h] =
|
|
38
|
+
const [m, h] = y(null), [g, w] = y(null), [f, S] = y(!1), [M, v] = y(!1), [d, N] = y(null), E = z(!1), I = z({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
42
|
-
capabilities:
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
renderCount:
|
|
42
|
+
capabilities: a
|
|
43
|
+
}), k = z(0);
|
|
44
|
+
k.current++, l("๐ RENDER INFO", {
|
|
45
|
+
renderCount: k.current,
|
|
46
46
|
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
|
|
47
47
|
propChanges: {
|
|
48
48
|
userChanged: I.current.userId !== (s == null ? void 0 : s.id),
|
|
49
49
|
apiKeyChanged: I.current.apiKey !== r,
|
|
50
50
|
serviceConfigChanged: I.current.serviceConfig !== n,
|
|
51
|
-
capabilitiesChanged: I.current.capabilities !==
|
|
51
|
+
capabilitiesChanged: I.current.capabilities !== a
|
|
52
52
|
}
|
|
53
53
|
}), I.current = {
|
|
54
54
|
userId: s == null ? void 0 : s.id,
|
|
55
55
|
apiKey: r,
|
|
56
56
|
serviceConfig: n,
|
|
57
|
-
capabilities:
|
|
58
|
-
},
|
|
59
|
-
const u =
|
|
57
|
+
capabilities: a
|
|
58
|
+
}, G(() => {
|
|
59
|
+
const u = k.current;
|
|
60
60
|
if (l("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
61
|
renderCount: u,
|
|
62
62
|
apiKey: !!r,
|
|
@@ -79,40 +79,40 @@ const ye = Ue({
|
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: I.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const
|
|
82
|
+
const b = new je({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
|
-
debug:
|
|
85
|
+
debug: c
|
|
86
86
|
});
|
|
87
|
-
return h(
|
|
87
|
+
return h(b), l("โ
SERVICE SET", {
|
|
88
88
|
renderCount: u,
|
|
89
|
-
serviceInstance: !!
|
|
89
|
+
serviceInstance: !!b
|
|
90
90
|
}), () => {
|
|
91
91
|
l("๐งน SERVICE CLEANUP", {
|
|
92
92
|
renderCount: u,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
|
-
}),
|
|
94
|
+
}), b.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [r, n,
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
var
|
|
96
|
+
}, [r, n, c, l]);
|
|
97
|
+
const x = z(null);
|
|
98
|
+
G(() => {
|
|
99
|
+
var b, B;
|
|
100
100
|
if (l("๐ USER CONNECTION EFFECT TRIGGERED", {
|
|
101
101
|
hasService: !!m,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
104
|
+
isConnecting: E.current,
|
|
105
105
|
isConnected: f,
|
|
106
106
|
dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !m || !s) {
|
|
108
108
|
l("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (E.current) {
|
|
112
112
|
l("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (((
|
|
115
|
+
if (((b = x.current) == null ? void 0 : b.serviceId) === m && ((B = x.current) == null ? void 0 : B.userId) === s.id) {
|
|
116
116
|
l(
|
|
117
117
|
"โ ๏ธ USER CONNECTION SKIPPED",
|
|
118
118
|
"Already connected this user with this service"
|
|
@@ -120,40 +120,40 @@ const ye = Ue({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
l("๐ STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
l("๐ STARTING USER CONNECTION", { userId: s.id }), E.current = !0, v(!0), N(null);
|
|
124
124
|
try {
|
|
125
125
|
l("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const j = await m.connectUser(s);
|
|
127
|
-
|
|
127
|
+
w(j), S(!0), x.current = { serviceId: m, userId: s.id }, l("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: j.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (j) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const W = j instanceof Error ? j.message : "Connection failed";
|
|
133
|
+
N(W), l("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
|
-
error:
|
|
135
|
+
error: W
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
|
|
138
|
+
v(!1), E.current = !1, l("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
140
|
isConnected: f
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [m, s, l, f]),
|
|
144
|
+
}, [m, s, l, f]), G(() => (l("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!m,
|
|
146
146
|
isConnected: f
|
|
147
147
|
}), () => {
|
|
148
148
|
m && f ? (l(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
|
-
),
|
|
151
|
+
), x.current = null, m.disconnectUser().catch(console.error)) : l("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!m,
|
|
153
153
|
isConnected: f
|
|
154
154
|
});
|
|
155
155
|
}), [m, f, l]);
|
|
156
|
-
const
|
|
156
|
+
const R = D(async () => {
|
|
157
157
|
if (l("๐ REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!m,
|
|
159
159
|
hasUser: !!s
|
|
@@ -161,52 +161,52 @@ const ye = Ue({
|
|
|
161
161
|
l("โ ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
l("๐ STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
164
|
+
l("๐ STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
|
|
165
165
|
try {
|
|
166
166
|
l("๐ DISCONNECTING FOR REFRESH"), await m.disconnectUser(), l("๐ RECONNECTING FOR REFRESH");
|
|
167
167
|
const u = await m.connectUser(s);
|
|
168
|
-
|
|
168
|
+
w(u), S(!0), N(null), l("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
169
|
} catch (u) {
|
|
170
|
-
const
|
|
171
|
-
|
|
170
|
+
const b = u instanceof Error ? u.message : "Refresh failed";
|
|
171
|
+
N(b), l("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
|
-
error:
|
|
173
|
+
error: b
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
|
-
|
|
176
|
+
v(!1), l("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [m, s, l]),
|
|
178
|
+
}, [m, s, l]), o = U.useMemo(() => (l("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!m,
|
|
180
180
|
hasClient: !!g,
|
|
181
181
|
isConnected: f,
|
|
182
|
-
isLoading:
|
|
183
|
-
hasError: !!
|
|
184
|
-
capabilitiesKeys: Object.keys(
|
|
182
|
+
isLoading: M,
|
|
183
|
+
hasError: !!d,
|
|
184
|
+
capabilitiesKeys: Object.keys(a)
|
|
185
185
|
}), {
|
|
186
186
|
service: m,
|
|
187
187
|
client: g,
|
|
188
188
|
isConnected: f,
|
|
189
|
-
isLoading:
|
|
190
|
-
error:
|
|
191
|
-
capabilities:
|
|
192
|
-
refreshConnection:
|
|
193
|
-
debug:
|
|
189
|
+
isLoading: M,
|
|
190
|
+
error: d,
|
|
191
|
+
capabilities: a,
|
|
192
|
+
refreshConnection: R,
|
|
193
|
+
debug: c
|
|
194
194
|
}), [
|
|
195
195
|
m,
|
|
196
196
|
g,
|
|
197
197
|
f,
|
|
198
|
+
M,
|
|
199
|
+
d,
|
|
200
|
+
a,
|
|
198
201
|
R,
|
|
199
202
|
c,
|
|
200
|
-
o,
|
|
201
|
-
p,
|
|
202
|
-
d,
|
|
203
203
|
l
|
|
204
204
|
]);
|
|
205
205
|
return l("๐ RENDER END", {
|
|
206
|
-
renderCount:
|
|
206
|
+
renderCount: k.current,
|
|
207
207
|
willRenderChat: !!(g && f),
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(ye.Provider, { value:
|
|
208
|
+
contextValueReady: !!o
|
|
209
|
+
}), /* @__PURE__ */ e(ye.Provider, { value: o, children: g && f ? /* @__PURE__ */ e(
|
|
210
210
|
Ae,
|
|
211
211
|
{
|
|
212
212
|
client: g,
|
|
@@ -219,11 +219,11 @@ const ye = Ue({
|
|
|
219
219
|
}, rs = () => oe(), ls = (t, s) => {
|
|
220
220
|
const n = new Date(
|
|
221
221
|
Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
|
|
222
|
-
),
|
|
222
|
+
), a = new Date(
|
|
223
223
|
Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
|
|
224
224
|
).getTime() - n.getTime();
|
|
225
|
-
return Math.floor(
|
|
226
|
-
},
|
|
225
|
+
return Math.floor(a / (1e3 * 60 * 60 * 24));
|
|
226
|
+
}, as = (t) => {
|
|
227
227
|
const s = /* @__PURE__ */ new Date();
|
|
228
228
|
if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
|
|
229
229
|
return "Just now";
|
|
@@ -236,7 +236,7 @@ const ye = Ue({
|
|
|
236
236
|
day: "numeric",
|
|
237
237
|
year: "2-digit"
|
|
238
238
|
});
|
|
239
|
-
},
|
|
239
|
+
}, Ce = [
|
|
240
240
|
"๐",
|
|
241
241
|
// Apple
|
|
242
242
|
"๐",
|
|
@@ -264,7 +264,7 @@ const ye = Ue({
|
|
|
264
264
|
"๐"
|
|
265
265
|
// Melon
|
|
266
266
|
];
|
|
267
|
-
function
|
|
267
|
+
function os(t) {
|
|
268
268
|
let s = 0;
|
|
269
269
|
for (let n = 0; n < t.length; n++) {
|
|
270
270
|
const r = t.charCodeAt(n);
|
|
@@ -273,24 +273,24 @@ function as(t) {
|
|
|
273
273
|
return Math.abs(s);
|
|
274
274
|
}
|
|
275
275
|
function is(t) {
|
|
276
|
-
const n =
|
|
277
|
-
return
|
|
276
|
+
const n = os(t) % Ce.length;
|
|
277
|
+
return Ce[n];
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const q = ({
|
|
280
280
|
id: t,
|
|
281
281
|
image: s,
|
|
282
282
|
size: n = 40,
|
|
283
283
|
className: r,
|
|
284
|
-
shape:
|
|
284
|
+
shape: a = "squircle"
|
|
285
285
|
}) => {
|
|
286
|
-
const
|
|
286
|
+
const c = is(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = a === "circle" ? { borderRadius: "50%" } : {
|
|
287
287
|
borderRadius: "33%",
|
|
288
288
|
"corner-shape": "superellipse(1.3)"
|
|
289
289
|
};
|
|
290
290
|
return /* @__PURE__ */ e(
|
|
291
291
|
"div",
|
|
292
292
|
{
|
|
293
|
-
className:
|
|
293
|
+
className: p("flex-shrink-0 overflow-hidden", r),
|
|
294
294
|
style: {
|
|
295
295
|
width: `${n}px`,
|
|
296
296
|
height: `${n}px`,
|
|
@@ -307,56 +307,56 @@ const Y = ({
|
|
|
307
307
|
"div",
|
|
308
308
|
{
|
|
309
309
|
"aria-hidden": "true",
|
|
310
|
-
className:
|
|
310
|
+
className: p(
|
|
311
311
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
312
312
|
m
|
|
313
313
|
),
|
|
314
|
-
children:
|
|
314
|
+
children: c
|
|
315
315
|
}
|
|
316
316
|
)
|
|
317
317
|
}
|
|
318
318
|
);
|
|
319
|
-
}, Ee =
|
|
320
|
-
({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread:
|
|
321
|
-
var
|
|
322
|
-
const
|
|
319
|
+
}, Ee = U.memo(
|
|
320
|
+
({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
|
|
321
|
+
var N, E, I, k, x, R;
|
|
322
|
+
const c = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
|
|
323
323
|
t && n(t);
|
|
324
|
-
}, h = Object.values(((
|
|
325
|
-
(
|
|
326
|
-
var u,
|
|
327
|
-
return ((u =
|
|
324
|
+
}, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
|
|
325
|
+
(o) => {
|
|
326
|
+
var u, b;
|
|
327
|
+
return ((u = o.user) == null ? void 0 : u.id) && o.user.id !== ((b = t == null ? void 0 : t._client) == null ? void 0 : b.userID);
|
|
328
328
|
}
|
|
329
|
-
), g = ((
|
|
329
|
+
), g = ((E = h == null ? void 0 : h.user) == null ? void 0 : E.name) || "Conversation", w = (I = h == null ? void 0 : h.user) == null ? void 0 : I.image, f = (x = (k = t == null ? void 0 : t.state) == null ? void 0 : k.messages) == null ? void 0 : x[t.state.messages.length - 1], M = (() => {
|
|
330
330
|
var u;
|
|
331
331
|
if (f != null && f.text) return f.text;
|
|
332
|
-
const
|
|
333
|
-
return
|
|
334
|
-
})(),
|
|
332
|
+
const o = (u = f == null ? void 0 : f.attachments) == null ? void 0 : u[0];
|
|
333
|
+
return o != null && o.asset_url ? o.asset_url : o != null && o.image_url ? o.image_url : o != null && o.og_scrape_url ? o.og_scrape_url : o != null && o.thumb_url ? o.thumb_url : "No messages yet";
|
|
334
|
+
})(), v = f != null && f.created_at ? as(new Date(f.created_at)) : "", d = a ?? 0;
|
|
335
335
|
return r && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
336
336
|
channelId: t == null ? void 0 : t.id,
|
|
337
|
-
isSelected:
|
|
337
|
+
isSelected: c,
|
|
338
338
|
participantName: g,
|
|
339
|
-
unreadCount:
|
|
340
|
-
hasTimestamp: !!
|
|
339
|
+
unreadCount: d,
|
|
340
|
+
hasTimestamp: !!v
|
|
341
341
|
}), /* @__PURE__ */ e(
|
|
342
342
|
"button",
|
|
343
343
|
{
|
|
344
344
|
type: "button",
|
|
345
345
|
onClick: l,
|
|
346
|
-
className:
|
|
346
|
+
className: p(
|
|
347
347
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
348
348
|
{
|
|
349
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
350
|
-
"hover:bg-sand": !
|
|
349
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": c,
|
|
350
|
+
"hover:bg-sand": !c
|
|
351
351
|
}
|
|
352
352
|
),
|
|
353
353
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
354
354
|
/* @__PURE__ */ e(
|
|
355
|
-
|
|
355
|
+
q,
|
|
356
356
|
{
|
|
357
|
-
id: ((
|
|
357
|
+
id: ((R = h == null ? void 0 : h.user) == null ? void 0 : R.id) || t.id || "unknown",
|
|
358
358
|
name: g,
|
|
359
|
-
image:
|
|
359
|
+
image: w,
|
|
360
360
|
size: 44,
|
|
361
361
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
362
362
|
}
|
|
@@ -366,18 +366,18 @@ const Y = ({
|
|
|
366
366
|
/* @__PURE__ */ e(
|
|
367
367
|
"h3",
|
|
368
368
|
{
|
|
369
|
-
className:
|
|
369
|
+
className: p(
|
|
370
370
|
"text-sm font-medium truncate",
|
|
371
|
-
|
|
371
|
+
c ? "text-primary" : "text-charcoal"
|
|
372
372
|
),
|
|
373
373
|
children: g
|
|
374
374
|
}
|
|
375
375
|
),
|
|
376
|
-
|
|
376
|
+
v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
|
|
377
377
|
] }),
|
|
378
378
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
379
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children:
|
|
380
|
-
|
|
379
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: M }),
|
|
380
|
+
d > 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: d > 99 ? "99+" : d })
|
|
381
381
|
] })
|
|
382
382
|
] })
|
|
383
383
|
] })
|
|
@@ -386,23 +386,23 @@ const Y = ({
|
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
388
|
Ee.displayName = "CustomChannelPreview";
|
|
389
|
-
const Ie =
|
|
389
|
+
const Ie = U.memo(
|
|
390
390
|
({
|
|
391
391
|
onChannelSelect: t,
|
|
392
392
|
selectedChannel: s,
|
|
393
393
|
filters: n,
|
|
394
394
|
className: r,
|
|
395
|
-
customEmptyStateIndicator:
|
|
395
|
+
customEmptyStateIndicator: a
|
|
396
396
|
}) => {
|
|
397
|
-
const
|
|
398
|
-
|
|
397
|
+
const c = U.useRef(0);
|
|
398
|
+
c.current++;
|
|
399
399
|
const { debug: l = !1 } = oe();
|
|
400
400
|
l && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
401
|
-
renderCount:
|
|
401
|
+
renderCount: c.current,
|
|
402
402
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
403
403
|
filters: n
|
|
404
404
|
});
|
|
405
|
-
const m =
|
|
405
|
+
const m = U.useMemo(() => (g) => /* @__PURE__ */ e(
|
|
406
406
|
Ee,
|
|
407
407
|
{
|
|
408
408
|
...g,
|
|
@@ -414,7 +414,7 @@ const Ie = O.memo(
|
|
|
414
414
|
return /* @__PURE__ */ e(
|
|
415
415
|
"div",
|
|
416
416
|
{
|
|
417
|
-
className:
|
|
417
|
+
className: p(
|
|
418
418
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
419
419
|
r
|
|
420
420
|
),
|
|
@@ -425,7 +425,7 @@ const Ie = O.memo(
|
|
|
425
425
|
sort: { last_message_at: -1 },
|
|
426
426
|
options: { limit: 30 },
|
|
427
427
|
Preview: m,
|
|
428
|
-
EmptyStateIndicator:
|
|
428
|
+
EmptyStateIndicator: a
|
|
429
429
|
},
|
|
430
430
|
JSON.stringify(n)
|
|
431
431
|
) })
|
|
@@ -443,7 +443,7 @@ const ne = ({
|
|
|
443
443
|
"button",
|
|
444
444
|
{
|
|
445
445
|
type: "button",
|
|
446
|
-
className:
|
|
446
|
+
className: p(
|
|
447
447
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
448
448
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
449
449
|
s
|
|
@@ -457,7 +457,7 @@ function Se({ label: t, className: s, children: n, ...r }) {
|
|
|
457
457
|
"button",
|
|
458
458
|
{
|
|
459
459
|
type: "button",
|
|
460
|
-
className:
|
|
460
|
+
className: p(
|
|
461
461
|
"rounded-full p-2 transition-colors focus-ring",
|
|
462
462
|
{
|
|
463
463
|
"cursor-not-allowed opacity-50": r.disabled,
|
|
@@ -474,17 +474,17 @@ function Se({ label: t, className: s, children: n, ...r }) {
|
|
|
474
474
|
);
|
|
475
475
|
}
|
|
476
476
|
function pe({ onClick: t }) {
|
|
477
|
-
return /* @__PURE__ */ e(Se, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(
|
|
477
|
+
return /* @__PURE__ */ e(Se, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(me, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
478
478
|
}
|
|
479
479
|
const cs = (t) => ({
|
|
480
480
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
481
|
-
(s) =>
|
|
481
|
+
(s) => be.previewIsLoaded(s) || be.previewIsLoading(s)
|
|
482
482
|
)
|
|
483
483
|
}), ds = ({
|
|
484
484
|
link: t,
|
|
485
485
|
onDismiss: s
|
|
486
486
|
}) => {
|
|
487
|
-
const { og_scrape_url: n, title: r, image_url:
|
|
487
|
+
const { og_scrape_url: n, title: r, image_url: a } = t;
|
|
488
488
|
return /* @__PURE__ */ i(
|
|
489
489
|
"a",
|
|
490
490
|
{
|
|
@@ -493,10 +493,10 @@ const cs = (t) => ({
|
|
|
493
493
|
rel: "noopener noreferrer",
|
|
494
494
|
className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
|
|
495
495
|
children: [
|
|
496
|
-
|
|
496
|
+
a && /* @__PURE__ */ e(
|
|
497
497
|
"img",
|
|
498
498
|
{
|
|
499
|
-
src:
|
|
499
|
+
src: a,
|
|
500
500
|
alt: r || "",
|
|
501
501
|
className: "h-[148px] w-full rounded-[20px] object-cover"
|
|
502
502
|
}
|
|
@@ -510,7 +510,7 @@ const cs = (t) => ({
|
|
|
510
510
|
},
|
|
511
511
|
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",
|
|
512
512
|
"aria-label": "Close link preview",
|
|
513
|
-
children: /* @__PURE__ */ e(
|
|
513
|
+
children: /* @__PURE__ */ e(me, { className: "size-4 text-black/90" })
|
|
514
514
|
}
|
|
515
515
|
),
|
|
516
516
|
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
@@ -521,23 +521,23 @@ const cs = (t) => ({
|
|
|
521
521
|
}
|
|
522
522
|
);
|
|
523
523
|
}, us = () => {
|
|
524
|
-
const { linkPreviewsManager: t } = Be(), { linkPreviews: s } =
|
|
524
|
+
const { linkPreviewsManager: t } = Be(), { linkPreviews: s } = $e(
|
|
525
525
|
t.state,
|
|
526
526
|
cs
|
|
527
|
-
), n = (
|
|
528
|
-
t.dismissPreview(
|
|
527
|
+
), n = (a) => {
|
|
528
|
+
t.dismissPreview(a);
|
|
529
529
|
};
|
|
530
|
-
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((
|
|
530
|
+
return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((a) => /* @__PURE__ */ e(
|
|
531
531
|
ds,
|
|
532
532
|
{
|
|
533
|
-
link:
|
|
533
|
+
link: a,
|
|
534
534
|
onDismiss: n
|
|
535
535
|
},
|
|
536
|
-
|
|
536
|
+
a.og_scrape_url
|
|
537
537
|
)) }) : null;
|
|
538
538
|
}, ms = () => {
|
|
539
539
|
const { handleSubmit: t } = He(), s = Ve();
|
|
540
|
-
return /* @__PURE__ */ i(
|
|
540
|
+
return /* @__PURE__ */ i(ve, { children: [
|
|
541
541
|
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(We, {}) }),
|
|
542
542
|
/* @__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: [
|
|
543
543
|
/* @__PURE__ */ e(Ze, {}),
|
|
@@ -570,7 +570,7 @@ const cs = (t) => ({
|
|
|
570
570
|
renderActions: t
|
|
571
571
|
}) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
572
572
|
t && (t == null ? void 0 : t()),
|
|
573
|
-
/* @__PURE__ */ e(
|
|
573
|
+
/* @__PURE__ */ e(Ge, { Input: ms })
|
|
574
574
|
] }), fs = (t) => {
|
|
575
575
|
const s = t.message.hide_date === !0;
|
|
576
576
|
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -581,10 +581,10 @@ const cs = (t) => ({
|
|
|
581
581
|
] }),
|
|
582
582
|
!s && /* @__PURE__ */ e(Je, { message: t.message })
|
|
583
583
|
] });
|
|
584
|
-
}, gs = () =>
|
|
584
|
+
}, gs = () => null, xs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
585
585
|
"div",
|
|
586
586
|
{
|
|
587
|
-
className:
|
|
587
|
+
className: p("flex items-center justify-center h-full", t),
|
|
588
588
|
children: [
|
|
589
589
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
590
590
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -624,25 +624,25 @@ const cs = (t) => ({
|
|
|
624
624
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
625
625
|
]
|
|
626
626
|
}
|
|
627
|
-
),
|
|
627
|
+
), ae = U.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
628
628
|
/* @__PURE__ */ e(xs, { className: "w-6 h-6" }),
|
|
629
629
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
630
|
-
] }) }))
|
|
631
|
-
|
|
630
|
+
] }) }));
|
|
631
|
+
ae.displayName = "LoadingState";
|
|
632
632
|
const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
|
|
633
|
-
var h, g,
|
|
634
|
-
const { channel:
|
|
635
|
-
(
|
|
636
|
-
var
|
|
637
|
-
return ((
|
|
633
|
+
var h, g, w, f, S;
|
|
634
|
+
const { channel: a } = we(), c = U.useMemo(() => Object.values(a.state.members || {}).find(
|
|
635
|
+
(v) => {
|
|
636
|
+
var d;
|
|
637
|
+
return ((d = v.user) == null ? void 0 : d.id) && v.user.id !== a._client.userID;
|
|
638
638
|
}
|
|
639
|
-
), [
|
|
639
|
+
), [a._client.userID, a.state.members]), l = ((h = c == null ? void 0 : c.user) == null ? void 0 : h.name) || ((g = c == null ? void 0 : c.user) == null ? void 0 : g.id) || "Unknown member", m = (w = c == null ? void 0 : c.user) == null ? void 0 : w.image;
|
|
640
640
|
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
641
641
|
/* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
|
|
642
642
|
/* @__PURE__ */ e(
|
|
643
643
|
"button",
|
|
644
644
|
{
|
|
645
|
-
className:
|
|
645
|
+
className: p(
|
|
646
646
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
647
647
|
!s && "invisible"
|
|
648
648
|
),
|
|
@@ -655,9 +655,9 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
655
655
|
),
|
|
656
656
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
657
657
|
/* @__PURE__ */ e(
|
|
658
|
-
|
|
658
|
+
q,
|
|
659
659
|
{
|
|
660
|
-
id: ((f =
|
|
660
|
+
id: ((f = c == null ? void 0 : c.user) == null ? void 0 : f.id) || a.id || "unknown",
|
|
661
661
|
name: l,
|
|
662
662
|
image: m,
|
|
663
663
|
size: 40
|
|
@@ -668,7 +668,7 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
668
668
|
/* @__PURE__ */ e(
|
|
669
669
|
"button",
|
|
670
670
|
{
|
|
671
|
-
className:
|
|
671
|
+
className: p(
|
|
672
672
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
673
673
|
),
|
|
674
674
|
onClick: n,
|
|
@@ -691,9 +691,9 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
691
691
|
}
|
|
692
692
|
),
|
|
693
693
|
/* @__PURE__ */ e(
|
|
694
|
-
|
|
694
|
+
q,
|
|
695
695
|
{
|
|
696
|
-
id: ((S =
|
|
696
|
+
id: ((S = c == null ? void 0 : c.user) == null ? void 0 : S.id) || a.id || "unknown",
|
|
697
697
|
name: l,
|
|
698
698
|
image: m,
|
|
699
699
|
size: 40
|
|
@@ -704,7 +704,7 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
704
704
|
r && n && /* @__PURE__ */ e(
|
|
705
705
|
"button",
|
|
706
706
|
{
|
|
707
|
-
className:
|
|
707
|
+
className: p(
|
|
708
708
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
709
709
|
),
|
|
710
710
|
onClick: n,
|
|
@@ -713,31 +713,31 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
713
713
|
)
|
|
714
714
|
] })
|
|
715
715
|
] });
|
|
716
|
-
},
|
|
716
|
+
}, bs = ({
|
|
717
717
|
dialogRef: t,
|
|
718
718
|
onClose: s,
|
|
719
719
|
participant: n,
|
|
720
720
|
channel: r,
|
|
721
|
-
followerStatusLabel:
|
|
722
|
-
onLeaveConversation:
|
|
721
|
+
followerStatusLabel: a,
|
|
722
|
+
onLeaveConversation: c,
|
|
723
723
|
onBlockParticipant: l,
|
|
724
724
|
showDeleteConversation: m = !0,
|
|
725
725
|
onDeleteConversationClick: h,
|
|
726
726
|
onBlockParticipantClick: g,
|
|
727
|
-
onReportParticipantClick:
|
|
727
|
+
onReportParticipantClick: w
|
|
728
728
|
}) => {
|
|
729
|
-
var Q, X,
|
|
730
|
-
const { service: f, debug: S } = oe(), [
|
|
731
|
-
var
|
|
732
|
-
if (!(!f || !((
|
|
729
|
+
var Q, X, ce, O, H, J, $;
|
|
730
|
+
const { service: f, debug: S } = oe(), [M, v] = y(!1), [d, N] = y(!1), [E, I] = y(!1), k = D(async () => {
|
|
731
|
+
var _;
|
|
732
|
+
if (!(!f || !((_ = n == null ? void 0 : n.user) != null && _.id)))
|
|
733
733
|
try {
|
|
734
734
|
const A = (await f.getBlockedUsers()).some(
|
|
735
|
-
(
|
|
735
|
+
(V) => {
|
|
736
736
|
var K;
|
|
737
|
-
return
|
|
737
|
+
return V.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
|
|
738
738
|
}
|
|
739
739
|
);
|
|
740
|
-
|
|
740
|
+
v(A);
|
|
741
741
|
} catch (T) {
|
|
742
742
|
console.error(
|
|
743
743
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
@@ -745,55 +745,55 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
745
745
|
);
|
|
746
746
|
}
|
|
747
747
|
}, [f, (Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id]);
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
}, [
|
|
751
|
-
const
|
|
752
|
-
var
|
|
753
|
-
if (!
|
|
754
|
-
h == null || h(), S && console.log("[ChannelInfoDialog] Leave conversation", r.cid),
|
|
748
|
+
G(() => {
|
|
749
|
+
k();
|
|
750
|
+
}, [k]);
|
|
751
|
+
const x = async () => {
|
|
752
|
+
var _;
|
|
753
|
+
if (!d) {
|
|
754
|
+
h == null || h(), S && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
|
|
755
755
|
try {
|
|
756
|
-
const T = ((
|
|
757
|
-
await r.hide(T, !1),
|
|
756
|
+
const T = ((_ = r._client) == null ? void 0 : _.userID) ?? null;
|
|
757
|
+
await r.hide(T, !1), c && await c(r), s();
|
|
758
758
|
} catch (T) {
|
|
759
759
|
console.error("[ChannelInfoDialog] Failed to leave conversation", T);
|
|
760
760
|
} finally {
|
|
761
|
-
|
|
761
|
+
N(!1);
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
|
-
},
|
|
765
|
-
var
|
|
766
|
-
if (!(
|
|
767
|
-
g == null || g(), S && console.log("[ChannelInfoDialog] Block member", (
|
|
764
|
+
}, R = async () => {
|
|
765
|
+
var _, T, A;
|
|
766
|
+
if (!(E || !f)) {
|
|
767
|
+
g == null || g(), S && console.log("[ChannelInfoDialog] Block member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), I(!0);
|
|
768
768
|
try {
|
|
769
769
|
await f.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
|
|
770
|
-
} catch (
|
|
771
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
770
|
+
} catch (V) {
|
|
771
|
+
console.error("[ChannelInfoDialog] Failed to block member", V);
|
|
772
772
|
} finally {
|
|
773
773
|
I(!1);
|
|
774
774
|
}
|
|
775
775
|
}
|
|
776
|
-
},
|
|
777
|
-
var
|
|
778
|
-
if (!(
|
|
779
|
-
g == null || g(), S && console.log("[ChannelInfoDialog] Unblock member", (
|
|
776
|
+
}, o = async () => {
|
|
777
|
+
var _, T, A;
|
|
778
|
+
if (!(E || !f)) {
|
|
779
|
+
g == null || g(), S && console.log("[ChannelInfoDialog] Unblock member", (_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), I(!0);
|
|
780
780
|
try {
|
|
781
781
|
await f.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
|
|
782
|
-
} catch (
|
|
783
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
782
|
+
} catch (V) {
|
|
783
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", V);
|
|
784
784
|
} finally {
|
|
785
785
|
I(!1);
|
|
786
786
|
}
|
|
787
787
|
}
|
|
788
788
|
}, u = () => {
|
|
789
|
-
|
|
789
|
+
w == null || w(), s(), window.open(
|
|
790
790
|
"https://linktr.ee/s/about/trust-center/report",
|
|
791
791
|
"_blank",
|
|
792
792
|
"noopener,noreferrer"
|
|
793
793
|
);
|
|
794
794
|
};
|
|
795
795
|
if (!n) return null;
|
|
796
|
-
const
|
|
796
|
+
const b = ((X = n.user) == null ? void 0 : X.name) || ((ce = n.user) == null ? void 0 : ce.id) || "Unknown member", B = (O = n.user) == null ? void 0 : O.image, j = (H = n.user) == null ? void 0 : H.email, W = (J = n.user) == null ? void 0 : J.username, Y = j || (W ? `linktr.ee/${W}` : void 0), ie = (($ = n.user) == null ? void 0 : $.id) || "unknown";
|
|
797
797
|
return (
|
|
798
798
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
799
799
|
/* @__PURE__ */ e(
|
|
@@ -802,8 +802,8 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
802
802
|
ref: t,
|
|
803
803
|
className: "mes-dialog group",
|
|
804
804
|
onClose: s,
|
|
805
|
-
onClick: (
|
|
806
|
-
|
|
805
|
+
onClick: (_) => {
|
|
806
|
+
_.target === t.current && s();
|
|
807
807
|
},
|
|
808
808
|
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: [
|
|
809
809
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
@@ -818,30 +818,30 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
818
818
|
style: { backgroundColor: "#FBFAF9" },
|
|
819
819
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
820
820
|
/* @__PURE__ */ e(
|
|
821
|
-
|
|
821
|
+
q,
|
|
822
822
|
{
|
|
823
|
-
id:
|
|
824
|
-
name:
|
|
823
|
+
id: ie,
|
|
824
|
+
name: b,
|
|
825
825
|
image: B,
|
|
826
826
|
size: 88,
|
|
827
827
|
shape: "circle"
|
|
828
828
|
}
|
|
829
829
|
),
|
|
830
830
|
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
831
|
-
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children:
|
|
832
|
-
|
|
833
|
-
|
|
831
|
+
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: b }),
|
|
832
|
+
Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
|
|
833
|
+
a && /* @__PURE__ */ e(
|
|
834
834
|
"span",
|
|
835
835
|
{
|
|
836
836
|
className: "mt-1 rounded-full text-xs font-normal w-fit",
|
|
837
837
|
style: {
|
|
838
838
|
padding: "4px 8px",
|
|
839
|
-
backgroundColor:
|
|
840
|
-
color:
|
|
839
|
+
backgroundColor: a === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
|
|
840
|
+
color: a === "Subscribed to you" ? "#008236" : "#78716C",
|
|
841
841
|
lineHeight: "133.333%",
|
|
842
842
|
letterSpacing: "0.21px"
|
|
843
843
|
},
|
|
844
|
-
children:
|
|
844
|
+
children: a
|
|
845
845
|
}
|
|
846
846
|
)
|
|
847
847
|
] })
|
|
@@ -852,34 +852,34 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
852
852
|
m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
853
853
|
ne,
|
|
854
854
|
{
|
|
855
|
-
onClick:
|
|
856
|
-
disabled:
|
|
857
|
-
"aria-busy":
|
|
855
|
+
onClick: x,
|
|
856
|
+
disabled: d,
|
|
857
|
+
"aria-busy": d,
|
|
858
858
|
children: [
|
|
859
|
-
|
|
859
|
+
d ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
|
|
860
860
|
/* @__PURE__ */ e("span", { children: "Delete Conversation" })
|
|
861
861
|
]
|
|
862
862
|
}
|
|
863
863
|
) }),
|
|
864
|
-
/* @__PURE__ */ e("li", { children:
|
|
864
|
+
/* @__PURE__ */ e("li", { children: M ? /* @__PURE__ */ i(
|
|
865
865
|
ne,
|
|
866
866
|
{
|
|
867
|
-
onClick:
|
|
868
|
-
disabled:
|
|
869
|
-
"aria-busy":
|
|
867
|
+
onClick: o,
|
|
868
|
+
disabled: E,
|
|
869
|
+
"aria-busy": E,
|
|
870
870
|
children: [
|
|
871
|
-
|
|
871
|
+
E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
|
|
872
872
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
873
873
|
]
|
|
874
874
|
}
|
|
875
875
|
) : /* @__PURE__ */ i(
|
|
876
876
|
ne,
|
|
877
877
|
{
|
|
878
|
-
onClick:
|
|
879
|
-
disabled:
|
|
880
|
-
"aria-busy":
|
|
878
|
+
onClick: R,
|
|
879
|
+
disabled: E,
|
|
880
|
+
"aria-busy": E,
|
|
881
881
|
children: [
|
|
882
|
-
|
|
882
|
+
E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
|
|
883
883
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
884
884
|
]
|
|
885
885
|
}
|
|
@@ -894,43 +894,43 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
894
894
|
}
|
|
895
895
|
)
|
|
896
896
|
);
|
|
897
|
-
},
|
|
897
|
+
}, Cs = ({
|
|
898
898
|
onBack: t,
|
|
899
899
|
showBackButton: s,
|
|
900
900
|
renderMessageInputActions: n,
|
|
901
901
|
onLeaveConversation: r,
|
|
902
|
-
onBlockParticipant:
|
|
903
|
-
showDeleteConversation:
|
|
902
|
+
onBlockParticipant: a,
|
|
903
|
+
showDeleteConversation: c = !0,
|
|
904
904
|
onDeleteConversationClick: l,
|
|
905
905
|
onBlockParticipantClick: m,
|
|
906
906
|
onReportParticipantClick: h
|
|
907
907
|
}) => {
|
|
908
|
-
const { channel: g } =
|
|
909
|
-
(
|
|
910
|
-
var
|
|
911
|
-
return ((
|
|
908
|
+
const { channel: g } = we(), w = z(null), f = U.useMemo(() => Object.values(g.state.members || {}).find(
|
|
909
|
+
(N) => {
|
|
910
|
+
var E;
|
|
911
|
+
return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== g._client.userID;
|
|
912
912
|
}
|
|
913
|
-
), [g._client.userID, g.state.members]), S =
|
|
914
|
-
const
|
|
915
|
-
if (
|
|
916
|
-
return String(
|
|
917
|
-
if (
|
|
918
|
-
return
|
|
919
|
-
}, [g.data]),
|
|
920
|
-
var
|
|
921
|
-
(
|
|
922
|
-
}, []),
|
|
923
|
-
var
|
|
924
|
-
(
|
|
913
|
+
), [g._client.userID, g.state.members]), S = U.useMemo(() => {
|
|
914
|
+
const d = g.data ?? {};
|
|
915
|
+
if (d.followerStatus)
|
|
916
|
+
return String(d.followerStatus);
|
|
917
|
+
if (d.isFollower !== void 0)
|
|
918
|
+
return d.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
919
|
+
}, [g.data]), M = D(() => {
|
|
920
|
+
var d;
|
|
921
|
+
(d = w.current) == null || d.showModal();
|
|
922
|
+
}, []), v = D(() => {
|
|
923
|
+
var d;
|
|
924
|
+
(d = w.current) == null || d.close();
|
|
925
925
|
}, []);
|
|
926
|
-
return /* @__PURE__ */ i(
|
|
926
|
+
return /* @__PURE__ */ i(ve, { children: [
|
|
927
927
|
/* @__PURE__ */ i(Xe, { children: [
|
|
928
928
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
929
929
|
Ns,
|
|
930
930
|
{
|
|
931
931
|
onBack: t,
|
|
932
932
|
showBackButton: s,
|
|
933
|
-
onShowInfo:
|
|
933
|
+
onShowInfo: M,
|
|
934
934
|
canShowInfo: !!f
|
|
935
935
|
}
|
|
936
936
|
) }),
|
|
@@ -950,79 +950,72 @@ const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
950
950
|
)
|
|
951
951
|
] }),
|
|
952
952
|
/* @__PURE__ */ e(
|
|
953
|
-
|
|
953
|
+
bs,
|
|
954
954
|
{
|
|
955
|
-
dialogRef:
|
|
956
|
-
onClose:
|
|
955
|
+
dialogRef: w,
|
|
956
|
+
onClose: v,
|
|
957
957
|
participant: f,
|
|
958
958
|
channel: g,
|
|
959
959
|
followerStatusLabel: S,
|
|
960
960
|
onLeaveConversation: r,
|
|
961
|
-
onBlockParticipant:
|
|
962
|
-
showDeleteConversation:
|
|
961
|
+
onBlockParticipant: a,
|
|
962
|
+
showDeleteConversation: c,
|
|
963
963
|
onDeleteConversationClick: l,
|
|
964
964
|
onBlockParticipantClick: m,
|
|
965
965
|
onReportParticipantClick: h
|
|
966
966
|
}
|
|
967
967
|
)
|
|
968
968
|
] });
|
|
969
|
-
}, ke =
|
|
969
|
+
}, ke = U.memo(
|
|
970
970
|
({
|
|
971
971
|
channel: t,
|
|
972
972
|
onBack: s,
|
|
973
973
|
showBackButton: n = !1,
|
|
974
974
|
renderMessageInputActions: r,
|
|
975
|
-
onLeaveConversation:
|
|
976
|
-
onBlockParticipant:
|
|
975
|
+
onLeaveConversation: a,
|
|
976
|
+
onBlockParticipant: c,
|
|
977
977
|
className: l,
|
|
978
978
|
CustomChannelEmptyState: m = gs,
|
|
979
979
|
showDeleteConversation: h = !0,
|
|
980
980
|
onDeleteConversationClick: g,
|
|
981
|
-
onBlockParticipantClick:
|
|
981
|
+
onBlockParticipantClick: w,
|
|
982
982
|
onReportParticipantClick: f
|
|
983
|
-
}) =>
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
}
|
|
1017
|
-
)
|
|
1018
|
-
}
|
|
1019
|
-
)
|
|
1020
|
-
}
|
|
1021
|
-
);
|
|
1022
|
-
}
|
|
983
|
+
}) => /* @__PURE__ */ e(
|
|
984
|
+
"div",
|
|
985
|
+
{
|
|
986
|
+
className: p(
|
|
987
|
+
"messaging-channel-view h-full flex flex-col",
|
|
988
|
+
l
|
|
989
|
+
),
|
|
990
|
+
children: /* @__PURE__ */ e(
|
|
991
|
+
Qe,
|
|
992
|
+
{
|
|
993
|
+
channel: t,
|
|
994
|
+
MessageSystem: fs,
|
|
995
|
+
EmptyStateIndicator: m,
|
|
996
|
+
LoadingIndicator: ae,
|
|
997
|
+
children: /* @__PURE__ */ e(
|
|
998
|
+
Cs,
|
|
999
|
+
{
|
|
1000
|
+
onBack: s,
|
|
1001
|
+
showBackButton: n,
|
|
1002
|
+
renderMessageInputActions: r,
|
|
1003
|
+
onLeaveConversation: a,
|
|
1004
|
+
onBlockParticipant: c,
|
|
1005
|
+
CustomChannelEmptyState: m,
|
|
1006
|
+
showDeleteConversation: h,
|
|
1007
|
+
onDeleteConversationClick: g,
|
|
1008
|
+
onBlockParticipantClick: w,
|
|
1009
|
+
onReportParticipantClick: f
|
|
1010
|
+
}
|
|
1011
|
+
)
|
|
1012
|
+
}
|
|
1013
|
+
)
|
|
1014
|
+
}
|
|
1015
|
+
)
|
|
1023
1016
|
);
|
|
1024
1017
|
ke.displayName = "ChannelView";
|
|
1025
|
-
function
|
|
1018
|
+
function vs({
|
|
1026
1019
|
searchQuery: t,
|
|
1027
1020
|
setSearchQuery: s,
|
|
1028
1021
|
placeholder: n
|
|
@@ -1043,7 +1036,7 @@ function ws({
|
|
|
1043
1036
|
type: "text",
|
|
1044
1037
|
placeholder: n,
|
|
1045
1038
|
value: t,
|
|
1046
|
-
onChange: (
|
|
1039
|
+
onChange: (a) => s(a.target.value),
|
|
1047
1040
|
className: "w-full pl-10 pr-10 py-3 text-sm border border-sand rounded-xl focus:outline-none focus:ring-2 focus:ring-black focus:border-transparent"
|
|
1048
1041
|
}
|
|
1049
1042
|
),
|
|
@@ -1052,28 +1045,28 @@ function ws({
|
|
|
1052
1045
|
{
|
|
1053
1046
|
label: "Clear search",
|
|
1054
1047
|
onClick: () => {
|
|
1055
|
-
var
|
|
1056
|
-
s(""), (
|
|
1048
|
+
var a;
|
|
1049
|
+
s(""), (a = r.current) == null || a.focus();
|
|
1057
1050
|
},
|
|
1058
1051
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
1059
|
-
children: /* @__PURE__ */ e(
|
|
1052
|
+
children: /* @__PURE__ */ e(me, { className: "h-4 w-4", weight: "bold" })
|
|
1060
1053
|
}
|
|
1061
1054
|
)
|
|
1062
1055
|
] });
|
|
1063
1056
|
}
|
|
1064
|
-
const
|
|
1057
|
+
const ws = ({
|
|
1065
1058
|
participantSource: t,
|
|
1066
1059
|
onSelectParticipant: s,
|
|
1067
1060
|
onClose: n,
|
|
1068
1061
|
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
1069
|
-
participantLabel:
|
|
1070
|
-
searchPlaceholder:
|
|
1062
|
+
participantLabel: a = "participants",
|
|
1063
|
+
searchPlaceholder: c = "Search participants...",
|
|
1071
1064
|
className: l
|
|
1072
1065
|
}) => {
|
|
1073
|
-
const { debug: m } = oe(), [h, g] =
|
|
1066
|
+
const { debug: m } = oe(), [h, g] = y(""), [w, f] = y([]), [S, M] = y(!1), [v, d] = y(null), [N, E] = y(
|
|
1074
1067
|
null
|
|
1075
1068
|
), I = z(!1);
|
|
1076
|
-
|
|
1069
|
+
G(() => {
|
|
1077
1070
|
if (t.loading) {
|
|
1078
1071
|
m && console.log(
|
|
1079
1072
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
@@ -1082,7 +1075,7 @@ const vs = ({
|
|
|
1082
1075
|
}
|
|
1083
1076
|
if (I.current) return;
|
|
1084
1077
|
(async () => {
|
|
1085
|
-
m && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
1078
|
+
m && console.log("[ParticipantPicker] Loading initial participants..."), M(!0), d(null);
|
|
1086
1079
|
try {
|
|
1087
1080
|
const u = await t.loadParticipants({
|
|
1088
1081
|
search: "",
|
|
@@ -1094,34 +1087,34 @@ const vs = ({
|
|
|
1094
1087
|
u.participants.length
|
|
1095
1088
|
);
|
|
1096
1089
|
} catch (u) {
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1090
|
+
const b = u instanceof Error ? u.message : "Failed to load participants";
|
|
1091
|
+
d(b), console.error("[ParticipantPicker] Failed to load participants:", u);
|
|
1099
1092
|
} finally {
|
|
1100
|
-
|
|
1093
|
+
M(!1);
|
|
1101
1094
|
}
|
|
1102
1095
|
})();
|
|
1103
1096
|
}, [t.loading, m]);
|
|
1104
|
-
const
|
|
1105
|
-
var
|
|
1097
|
+
const k = w.filter((o) => !r.has(o.id)).filter((o) => {
|
|
1098
|
+
var b;
|
|
1106
1099
|
if (!h) return !0;
|
|
1107
1100
|
const u = h.toLowerCase();
|
|
1108
|
-
return
|
|
1109
|
-
}),
|
|
1110
|
-
async (
|
|
1111
|
-
if (!
|
|
1112
|
-
|
|
1101
|
+
return o.name.toLowerCase().includes(u) || ((b = o.email) == null ? void 0 : b.toLowerCase().includes(u)) || !1;
|
|
1102
|
+
}), x = D(
|
|
1103
|
+
async (o) => {
|
|
1104
|
+
if (!N) {
|
|
1105
|
+
E(o.id);
|
|
1113
1106
|
try {
|
|
1114
|
-
await s(
|
|
1107
|
+
await s(o);
|
|
1115
1108
|
} catch (u) {
|
|
1116
|
-
console.error("[ParticipantPicker] Failed to start chat:", u),
|
|
1109
|
+
console.error("[ParticipantPicker] Failed to start chat:", u), E(null);
|
|
1117
1110
|
}
|
|
1118
1111
|
}
|
|
1119
1112
|
},
|
|
1120
|
-
[s,
|
|
1121
|
-
),
|
|
1122
|
-
(
|
|
1113
|
+
[s, N]
|
|
1114
|
+
), R = (o, u) => {
|
|
1115
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), x(u));
|
|
1123
1116
|
};
|
|
1124
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1117
|
+
return /* @__PURE__ */ i("div", { className: p("flex flex-col h-full", l), children: [
|
|
1125
1118
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1126
1119
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1127
1120
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
@@ -1129,68 +1122,68 @@ const vs = ({
|
|
|
1129
1122
|
] }),
|
|
1130
1123
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1131
1124
|
"Select a ",
|
|
1132
|
-
|
|
1125
|
+
a.slice(0, -1),
|
|
1133
1126
|
" to start messaging (",
|
|
1134
|
-
|
|
1127
|
+
k.length,
|
|
1135
1128
|
" available)",
|
|
1136
|
-
t.totalCount !== void 0 && ` โข ${t.totalCount} ${
|
|
1129
|
+
t.totalCount !== void 0 && ` โข ${t.totalCount} ${a} total`
|
|
1137
1130
|
] }),
|
|
1138
1131
|
/* @__PURE__ */ e(
|
|
1139
|
-
|
|
1132
|
+
vs,
|
|
1140
1133
|
{
|
|
1141
1134
|
searchQuery: h,
|
|
1142
1135
|
setSearchQuery: g,
|
|
1143
|
-
placeholder:
|
|
1136
|
+
placeholder: c
|
|
1144
1137
|
}
|
|
1145
1138
|
)
|
|
1146
1139
|
] }),
|
|
1147
|
-
|
|
1140
|
+
v && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1148
1141
|
"Error loading ",
|
|
1149
|
-
|
|
1142
|
+
a,
|
|
1150
1143
|
": ",
|
|
1151
|
-
|
|
1144
|
+
v
|
|
1152
1145
|
] }),
|
|
1153
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S &&
|
|
1146
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S && k.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: [
|
|
1154
1147
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1155
1148
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1156
1149
|
"Loading ",
|
|
1157
|
-
|
|
1150
|
+
a,
|
|
1158
1151
|
"..."
|
|
1159
1152
|
] })
|
|
1160
|
-
] }) }) :
|
|
1153
|
+
] }) }) : k.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1161
1154
|
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ne, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1162
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${
|
|
1163
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" :
|
|
1155
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${a} found` : w.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
|
|
1156
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
|
|
1164
1157
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1165
|
-
|
|
1166
|
-
const u =
|
|
1158
|
+
k.map((o) => {
|
|
1159
|
+
const u = o.name || o.email || o.id, b = o.email && o.name ? o.email : o.phone;
|
|
1167
1160
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1168
1161
|
"button",
|
|
1169
1162
|
{
|
|
1170
1163
|
type: "button",
|
|
1171
|
-
onClick: () =>
|
|
1172
|
-
onKeyDown: (B) =>
|
|
1164
|
+
onClick: () => x(o),
|
|
1165
|
+
onKeyDown: (B) => R(B, o),
|
|
1173
1166
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus:outline-none focus:ring-2 focus:ring-black",
|
|
1174
1167
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1175
1168
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1176
1169
|
/* @__PURE__ */ e(
|
|
1177
|
-
|
|
1170
|
+
q,
|
|
1178
1171
|
{
|
|
1179
|
-
id:
|
|
1172
|
+
id: o.id,
|
|
1180
1173
|
name: u,
|
|
1181
|
-
image:
|
|
1174
|
+
image: o.image,
|
|
1182
1175
|
size: 40
|
|
1183
1176
|
}
|
|
1184
1177
|
),
|
|
1185
1178
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1186
1179
|
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
|
|
1187
|
-
|
|
1180
|
+
b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
|
|
1188
1181
|
] })
|
|
1189
1182
|
] }),
|
|
1190
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1183
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === o.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
|
|
1191
1184
|
] })
|
|
1192
1185
|
}
|
|
1193
|
-
) },
|
|
1186
|
+
) }, o.id);
|
|
1194
1187
|
}),
|
|
1195
1188
|
S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1196
1189
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
@@ -1332,7 +1325,7 @@ const vs = ({
|
|
|
1332
1325
|
] })
|
|
1333
1326
|
]
|
|
1334
1327
|
}
|
|
1335
|
-
), Re =
|
|
1328
|
+
), Re = U.memo(
|
|
1336
1329
|
({ 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: [
|
|
1337
1330
|
/* @__PURE__ */ e(ys, {}),
|
|
1338
1331
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
@@ -1342,7 +1335,7 @@ const vs = ({
|
|
|
1342
1335
|
] }) })
|
|
1343
1336
|
);
|
|
1344
1337
|
Re.displayName = "EmptyState";
|
|
1345
|
-
const le =
|
|
1338
|
+
const le = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
1346
1339
|
/* @__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: "โ ๏ธ" }) }),
|
|
1347
1340
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1348
1341
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1362,111 +1355,111 @@ const Fs = ({
|
|
|
1362
1355
|
className: s,
|
|
1363
1356
|
renderMessageInputActions: n,
|
|
1364
1357
|
onChannelSelect: r,
|
|
1365
|
-
onParticipantSelect:
|
|
1366
|
-
initialParticipantFilter:
|
|
1358
|
+
onParticipantSelect: a,
|
|
1359
|
+
initialParticipantFilter: c,
|
|
1367
1360
|
initialParticipantData: l,
|
|
1368
1361
|
CustomChannelEmptyState: m,
|
|
1369
1362
|
showChannelList: h = !0,
|
|
1370
1363
|
filters: g,
|
|
1371
|
-
channelListCustomEmptyStateIndicator:
|
|
1364
|
+
channelListCustomEmptyStateIndicator: w,
|
|
1372
1365
|
onDeleteConversationClick: f,
|
|
1373
1366
|
onBlockParticipantClick: S,
|
|
1374
|
-
onReportParticipantClick:
|
|
1367
|
+
onReportParticipantClick: M
|
|
1375
1368
|
}) => {
|
|
1376
1369
|
const {
|
|
1377
|
-
service:
|
|
1378
|
-
client:
|
|
1379
|
-
isConnected:
|
|
1380
|
-
isLoading:
|
|
1370
|
+
service: v,
|
|
1371
|
+
client: d,
|
|
1372
|
+
isConnected: N,
|
|
1373
|
+
isLoading: E,
|
|
1381
1374
|
error: I,
|
|
1382
|
-
refreshConnection:
|
|
1383
|
-
debug:
|
|
1384
|
-
} = rs(), [
|
|
1375
|
+
refreshConnection: k,
|
|
1376
|
+
debug: x
|
|
1377
|
+
} = rs(), [R, o] = y(null), [u, b] = y(!1), [B, j] = y(!1), [W, Y] = y(!1), [ie, Q] = y(/* @__PURE__ */ new Set()), [X, ce] = y(0), [O, H] = y(!1), [J, $] = y(null), _ = z(null), {
|
|
1385
1378
|
participantSource: T,
|
|
1386
1379
|
participantLabel: A = "participants",
|
|
1387
|
-
showDeleteConversation:
|
|
1388
|
-
} = t, K =
|
|
1389
|
-
const
|
|
1380
|
+
showDeleteConversation: V = !0
|
|
1381
|
+
} = t, K = U.useMemo(() => {
|
|
1382
|
+
const C = d == null ? void 0 : d.userID;
|
|
1390
1383
|
return {
|
|
1391
1384
|
...{
|
|
1392
1385
|
type: "messaging",
|
|
1393
1386
|
last_message_at: { $exists: !0 },
|
|
1394
|
-
...
|
|
1395
|
-
members: { $in: [
|
|
1387
|
+
...C && {
|
|
1388
|
+
members: { $in: [C] },
|
|
1396
1389
|
hidden: !1
|
|
1397
1390
|
}
|
|
1398
1391
|
},
|
|
1399
1392
|
...g
|
|
1400
1393
|
};
|
|
1401
|
-
}, [g,
|
|
1402
|
-
if (!
|
|
1403
|
-
const
|
|
1404
|
-
if (
|
|
1394
|
+
}, [g, d == null ? void 0 : d.userID]), ee = z(null), Z = D(async () => {
|
|
1395
|
+
if (!d || !N) return;
|
|
1396
|
+
const C = d.userID;
|
|
1397
|
+
if (C)
|
|
1405
1398
|
try {
|
|
1406
|
-
|
|
1407
|
-
const P = await
|
|
1399
|
+
x && console.log("[MessagingShell] Syncing channels for user:", C);
|
|
1400
|
+
const P = await d.queryChannels(
|
|
1408
1401
|
{
|
|
1409
1402
|
type: "messaging",
|
|
1410
|
-
members: { $in: [
|
|
1403
|
+
members: { $in: [C] }
|
|
1411
1404
|
},
|
|
1412
1405
|
{},
|
|
1413
1406
|
{ limit: 100 }
|
|
1414
1407
|
), F = /* @__PURE__ */ new Set();
|
|
1415
1408
|
P.forEach((L) => {
|
|
1416
|
-
const
|
|
1417
|
-
Object.values(
|
|
1409
|
+
const de = L.state.members;
|
|
1410
|
+
Object.values(de).forEach((Ue) => {
|
|
1418
1411
|
var he;
|
|
1419
|
-
const
|
|
1420
|
-
|
|
1412
|
+
const ue = (he = Ue.user) == null ? void 0 : he.id;
|
|
1413
|
+
ue && ue !== C && F.add(ue);
|
|
1421
1414
|
});
|
|
1422
|
-
}), Q((L) => L.size === F.size && [...L].every((
|
|
1415
|
+
}), Q((L) => L.size === F.size && [...L].every((de) => F.has(de)) ? L : F), b(P.length > 0), j(!0), ee.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1423
1416
|
channelCount: P.length,
|
|
1424
1417
|
memberCount: F.size
|
|
1425
1418
|
});
|
|
1426
1419
|
} catch (P) {
|
|
1427
1420
|
console.error("[MessagingShell] Failed to sync channels:", P);
|
|
1428
1421
|
}
|
|
1429
|
-
}, [
|
|
1430
|
-
|
|
1431
|
-
if (!
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
}, [
|
|
1435
|
-
if (!
|
|
1422
|
+
}, [d, N, x]);
|
|
1423
|
+
G(() => {
|
|
1424
|
+
if (!d || !N) return;
|
|
1425
|
+
const C = d.userID;
|
|
1426
|
+
C && ee.current !== C && Z();
|
|
1427
|
+
}, [d, N, Z]), G(() => {
|
|
1428
|
+
if (!c || !d || !N) return;
|
|
1436
1429
|
(async () => {
|
|
1437
|
-
const P =
|
|
1430
|
+
const P = d.userID;
|
|
1438
1431
|
if (P)
|
|
1439
1432
|
try {
|
|
1440
|
-
|
|
1433
|
+
x && console.log(
|
|
1441
1434
|
"[MessagingShell] Loading initial conversation with:",
|
|
1442
|
-
|
|
1435
|
+
c
|
|
1443
1436
|
);
|
|
1444
|
-
const F = await
|
|
1437
|
+
const F = await d.queryChannels(
|
|
1445
1438
|
{
|
|
1446
1439
|
type: "messaging",
|
|
1447
|
-
members: { $eq: [P,
|
|
1440
|
+
members: { $eq: [P, c] }
|
|
1448
1441
|
},
|
|
1449
1442
|
{},
|
|
1450
1443
|
{ limit: 1 }
|
|
1451
1444
|
);
|
|
1452
1445
|
if (F.length > 0)
|
|
1453
|
-
|
|
1446
|
+
o(F[0]), H(!0), $(null), r && r(F[0]), x && console.log(
|
|
1454
1447
|
"[MessagingShell] Initial conversation loaded:",
|
|
1455
1448
|
F[0].id
|
|
1456
1449
|
);
|
|
1457
|
-
else if (l &&
|
|
1458
|
-
|
|
1450
|
+
else if (l && v) {
|
|
1451
|
+
x && console.log(
|
|
1459
1452
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1460
1453
|
l
|
|
1461
1454
|
);
|
|
1462
1455
|
try {
|
|
1463
|
-
const L = await
|
|
1456
|
+
const L = await v.startChannelWithParticipant({
|
|
1464
1457
|
id: l.id,
|
|
1465
1458
|
name: l.name,
|
|
1466
1459
|
email: l.email,
|
|
1467
1460
|
phone: l.phone
|
|
1468
1461
|
});
|
|
1469
|
-
|
|
1462
|
+
o(L), H(!0), $(null), r && r(L), x && console.log(
|
|
1470
1463
|
"[MessagingShell] Channel created and loaded:",
|
|
1471
1464
|
L.id
|
|
1472
1465
|
);
|
|
@@ -1474,101 +1467,93 @@ const Fs = ({
|
|
|
1474
1467
|
console.error(
|
|
1475
1468
|
"[MessagingShell] Failed to create conversation:",
|
|
1476
1469
|
L
|
|
1477
|
-
),
|
|
1470
|
+
), $("Failed to create conversation");
|
|
1478
1471
|
}
|
|
1479
1472
|
} else
|
|
1480
|
-
|
|
1473
|
+
$(
|
|
1481
1474
|
"No conversation found with this account"
|
|
1482
|
-
),
|
|
1475
|
+
), x && console.log(
|
|
1483
1476
|
"[MessagingShell] No conversation found for:",
|
|
1484
|
-
|
|
1477
|
+
c
|
|
1485
1478
|
);
|
|
1486
1479
|
} catch (F) {
|
|
1487
1480
|
console.error(
|
|
1488
1481
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1489
1482
|
F
|
|
1490
|
-
),
|
|
1483
|
+
), $("Failed to load conversation");
|
|
1491
1484
|
}
|
|
1492
1485
|
})();
|
|
1493
1486
|
}, [
|
|
1494
|
-
d,
|
|
1495
|
-
l,
|
|
1496
1487
|
c,
|
|
1497
|
-
|
|
1498
|
-
|
|
1488
|
+
l,
|
|
1489
|
+
d,
|
|
1499
1490
|
N,
|
|
1491
|
+
v,
|
|
1492
|
+
x,
|
|
1500
1493
|
r
|
|
1501
1494
|
]);
|
|
1502
|
-
const
|
|
1503
|
-
(
|
|
1504
|
-
|
|
1495
|
+
const _e = D(
|
|
1496
|
+
(C) => {
|
|
1497
|
+
o(C), r == null || r(C);
|
|
1505
1498
|
},
|
|
1506
1499
|
[r]
|
|
1507
|
-
), De =
|
|
1508
|
-
|
|
1509
|
-
}, [
|
|
1510
|
-
async (
|
|
1500
|
+
), De = D(() => {
|
|
1501
|
+
O || o(null);
|
|
1502
|
+
}, [O]), Me = D(
|
|
1503
|
+
async (C) => {
|
|
1511
1504
|
var P;
|
|
1512
|
-
if (
|
|
1505
|
+
if (v)
|
|
1513
1506
|
try {
|
|
1514
|
-
|
|
1507
|
+
x && console.log(
|
|
1515
1508
|
"[MessagingShell] Starting conversation with:",
|
|
1516
|
-
|
|
1509
|
+
C.id
|
|
1517
1510
|
);
|
|
1518
|
-
const F = await
|
|
1519
|
-
id:
|
|
1520
|
-
name:
|
|
1521
|
-
email:
|
|
1522
|
-
phone:
|
|
1511
|
+
const F = await v.startChannelWithParticipant({
|
|
1512
|
+
id: C.id,
|
|
1513
|
+
name: C.name,
|
|
1514
|
+
email: C.email,
|
|
1515
|
+
phone: C.phone
|
|
1523
1516
|
});
|
|
1524
1517
|
try {
|
|
1525
1518
|
await F.show();
|
|
1526
1519
|
} catch (L) {
|
|
1527
1520
|
console.warn("[MessagingShell] Failed to unhide channel:", L);
|
|
1528
1521
|
}
|
|
1529
|
-
|
|
1522
|
+
o(F), Y(!1), (P = _.current) == null || P.close(), a == null || a(C);
|
|
1530
1523
|
} catch (F) {
|
|
1531
1524
|
console.error("[MessagingShell] Failed to start conversation:", F);
|
|
1532
1525
|
}
|
|
1533
1526
|
},
|
|
1534
|
-
[
|
|
1535
|
-
), se =
|
|
1536
|
-
var
|
|
1537
|
-
|
|
1538
|
-
}, []), Fe =
|
|
1539
|
-
(
|
|
1540
|
-
|
|
1527
|
+
[v, a, x]
|
|
1528
|
+
), se = D(() => {
|
|
1529
|
+
var C;
|
|
1530
|
+
Y(!1), (C = _.current) == null || C.close();
|
|
1531
|
+
}, []), Fe = D(
|
|
1532
|
+
(C) => {
|
|
1533
|
+
C.target === _.current && se();
|
|
1541
1534
|
},
|
|
1542
1535
|
[se]
|
|
1543
|
-
), Te =
|
|
1544
|
-
async (
|
|
1545
|
-
|
|
1536
|
+
), Te = D(
|
|
1537
|
+
async (C) => {
|
|
1538
|
+
x && console.log("[MessagingShell] Leaving conversation:", C.id), o(null), H(!1), ee.current = null, await Z();
|
|
1546
1539
|
},
|
|
1547
|
-
[
|
|
1548
|
-
), Le =
|
|
1549
|
-
async (
|
|
1550
|
-
|
|
1540
|
+
[Z, x]
|
|
1541
|
+
), Le = D(
|
|
1542
|
+
async (C) => {
|
|
1543
|
+
x && console.log("[MessagingShell] Blocking participant:", C), o(null), H(!1), ee.current = null, await Z();
|
|
1551
1544
|
},
|
|
1552
|
-
[
|
|
1553
|
-
), te = !!
|
|
1554
|
-
return
|
|
1555
|
-
isLoading: y,
|
|
1556
|
-
error: I,
|
|
1557
|
-
isConnected: x,
|
|
1558
|
-
hasClient: !!c,
|
|
1559
|
-
directConversationError: V,
|
|
1560
|
-
selectedChannelId: p == null ? void 0 : p.id,
|
|
1561
|
-
directConversationMode: U
|
|
1562
|
-
}), y ? (console.log("[MessagingShell] showing LOADING state"), /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(me, {}) })) : I ? (console.log("[MessagingShell] showing ERROR state:", I), /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: M }) })) : !x || !c ? (console.log("[MessagingShell] showing NOT CONNECTED state"), /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(
|
|
1545
|
+
[Z, x]
|
|
1546
|
+
), te = !!R;
|
|
1547
|
+
return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : I ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: k }) }) : !N || !d ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
|
|
1563
1548
|
le,
|
|
1564
1549
|
{
|
|
1565
1550
|
message: "Not connected to messaging service",
|
|
1566
|
-
onBack:
|
|
1551
|
+
onBack: k
|
|
1567
1552
|
}
|
|
1568
|
-
) })
|
|
1553
|
+
) }) : J ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: J }) }) : /* @__PURE__ */ i(
|
|
1569
1554
|
"div",
|
|
1570
1555
|
{
|
|
1571
|
-
className:
|
|
1556
|
+
className: p(
|
|
1572
1557
|
"messaging-shell h-full bg-background-secondary overflow-hidden",
|
|
1573
1558
|
s
|
|
1574
1559
|
),
|
|
@@ -1577,23 +1562,23 @@ const Fs = ({
|
|
|
1577
1562
|
/* @__PURE__ */ e(
|
|
1578
1563
|
"div",
|
|
1579
1564
|
{
|
|
1580
|
-
className:
|
|
1565
|
+
className: p(
|
|
1581
1566
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1582
1567
|
{
|
|
1583
|
-
"!hidden": h === !1 ||
|
|
1568
|
+
"!hidden": h === !1 || O,
|
|
1584
1569
|
// Hide on mobile when channel selected, show on desktop with consistent narrow width
|
|
1585
|
-
"hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !
|
|
1570
|
+
"hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && te,
|
|
1586
1571
|
// Show on mobile when no channel selected, use same narrow width on desktop
|
|
1587
|
-
"flex flex-col w-full lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !
|
|
1572
|
+
"flex flex-col w-full lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && !te
|
|
1588
1573
|
}
|
|
1589
1574
|
),
|
|
1590
1575
|
children: /* @__PURE__ */ e(
|
|
1591
1576
|
Ie,
|
|
1592
1577
|
{
|
|
1593
|
-
onChannelSelect:
|
|
1594
|
-
selectedChannel:
|
|
1578
|
+
onChannelSelect: _e,
|
|
1579
|
+
selectedChannel: R || void 0,
|
|
1595
1580
|
filters: K,
|
|
1596
|
-
customEmptyStateIndicator:
|
|
1581
|
+
customEmptyStateIndicator: w
|
|
1597
1582
|
}
|
|
1598
1583
|
)
|
|
1599
1584
|
}
|
|
@@ -1601,32 +1586,35 @@ const Fs = ({
|
|
|
1601
1586
|
/* @__PURE__ */ e(
|
|
1602
1587
|
"div",
|
|
1603
1588
|
{
|
|
1604
|
-
className:
|
|
1589
|
+
className: p(
|
|
1605
1590
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
1606
1591
|
{
|
|
1607
|
-
// In direct conversation mode, always show (full width)
|
|
1608
|
-
flex:
|
|
1592
|
+
// In direct conversation mode (or waiting for it), always show (full width)
|
|
1593
|
+
flex: O || te || c,
|
|
1609
1594
|
// Normal mode: hide on mobile when no channel selected
|
|
1610
|
-
"hidden lg:flex": !
|
|
1595
|
+
"hidden lg:flex": !O && !te && !c
|
|
1611
1596
|
}
|
|
1612
1597
|
),
|
|
1613
|
-
children:
|
|
1598
|
+
children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
1614
1599
|
ke,
|
|
1615
1600
|
{
|
|
1616
|
-
channel:
|
|
1601
|
+
channel: R,
|
|
1617
1602
|
onBack: De,
|
|
1618
|
-
showBackButton: !
|
|
1603
|
+
showBackButton: !O,
|
|
1619
1604
|
renderMessageInputActions: n,
|
|
1620
1605
|
onLeaveConversation: Te,
|
|
1621
1606
|
onBlockParticipant: Le,
|
|
1622
1607
|
CustomChannelEmptyState: m,
|
|
1623
|
-
showDeleteConversation:
|
|
1608
|
+
showDeleteConversation: V,
|
|
1624
1609
|
onDeleteConversationClick: f,
|
|
1625
1610
|
onBlockParticipantClick: S,
|
|
1626
|
-
onReportParticipantClick:
|
|
1611
|
+
onReportParticipantClick: M
|
|
1627
1612
|
},
|
|
1628
|
-
|
|
1629
|
-
) }) :
|
|
1613
|
+
R.id
|
|
1614
|
+
) }) : c ? (
|
|
1615
|
+
// Show loading while creating/loading direct conversation channel
|
|
1616
|
+
/* @__PURE__ */ e(ae, {})
|
|
1617
|
+
) : /* @__PURE__ */ e(
|
|
1630
1618
|
Re,
|
|
1631
1619
|
{
|
|
1632
1620
|
hasChannels: u,
|
|
@@ -1640,17 +1628,17 @@ const Fs = ({
|
|
|
1640
1628
|
/* @__PURE__ */ e(
|
|
1641
1629
|
"dialog",
|
|
1642
1630
|
{
|
|
1643
|
-
ref:
|
|
1631
|
+
ref: _,
|
|
1644
1632
|
className: "mes-dialog",
|
|
1645
1633
|
onClick: Fe,
|
|
1646
1634
|
onClose: se,
|
|
1647
1635
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
1648
|
-
|
|
1636
|
+
ws,
|
|
1649
1637
|
{
|
|
1650
1638
|
participantSource: T,
|
|
1651
|
-
onSelectParticipant:
|
|
1639
|
+
onSelectParticipant: Me,
|
|
1652
1640
|
onClose: se,
|
|
1653
|
-
existingParticipantIds:
|
|
1641
|
+
existingParticipantIds: ie,
|
|
1654
1642
|
participantLabel: A,
|
|
1655
1643
|
searchPlaceholder: `Search ${A}...`
|
|
1656
1644
|
},
|
|
@@ -1660,7 +1648,7 @@ const Fs = ({
|
|
|
1660
1648
|
)
|
|
1661
1649
|
]
|
|
1662
1650
|
}
|
|
1663
|
-
)
|
|
1651
|
+
);
|
|
1664
1652
|
}, Es = ({
|
|
1665
1653
|
question: t,
|
|
1666
1654
|
onClick: s,
|
|
@@ -1673,7 +1661,7 @@ const Fs = ({
|
|
|
1673
1661
|
onClick: s,
|
|
1674
1662
|
disabled: n,
|
|
1675
1663
|
style: { backgroundColor: "#E6E5E3" },
|
|
1676
|
-
className:
|
|
1664
|
+
className: p(
|
|
1677
1665
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
|
|
1678
1666
|
{
|
|
1679
1667
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -1688,18 +1676,18 @@ const Fs = ({
|
|
|
1688
1676
|
onFaqClick: s,
|
|
1689
1677
|
loadingFaqId: n,
|
|
1690
1678
|
headerText: r,
|
|
1691
|
-
className:
|
|
1692
|
-
avatarImage:
|
|
1679
|
+
className: a,
|
|
1680
|
+
avatarImage: c,
|
|
1693
1681
|
avatarName: l
|
|
1694
1682
|
}) => {
|
|
1695
1683
|
const m = t.filter((h) => h.enabled).sort((h, g) => (h.order ?? 0) - (g.order ?? 0));
|
|
1696
|
-
return m.length === 0 ? null : /* @__PURE__ */ e("div", { className:
|
|
1697
|
-
(
|
|
1698
|
-
|
|
1684
|
+
return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
1685
|
+
(c || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
1686
|
+
q,
|
|
1699
1687
|
{
|
|
1700
1688
|
id: l || "account",
|
|
1701
1689
|
name: l || "Account",
|
|
1702
|
-
image:
|
|
1690
|
+
image: c,
|
|
1703
1691
|
size: 24,
|
|
1704
1692
|
shape: "circle"
|
|
1705
1693
|
}
|
|
@@ -1725,57 +1713,57 @@ const Fs = ({
|
|
|
1725
1713
|
)
|
|
1726
1714
|
] }) });
|
|
1727
1715
|
}, Ls = (t, s = {}) => {
|
|
1728
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [
|
|
1716
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [a, c] = y([]), [l, m] = y(!1), [h, g] = y(null), [w, f] = y(n), [S, M] = y(!0), [v, d] = y(), N = D(async (x = !1, R) => {
|
|
1729
1717
|
if (l) return;
|
|
1730
|
-
const
|
|
1718
|
+
const o = R !== void 0 ? R : w;
|
|
1731
1719
|
m(!0), g(null);
|
|
1732
1720
|
try {
|
|
1733
1721
|
const u = await t.loadParticipants({
|
|
1734
|
-
search:
|
|
1722
|
+
search: o || void 0,
|
|
1735
1723
|
limit: r,
|
|
1736
|
-
cursor:
|
|
1724
|
+
cursor: x ? void 0 : v
|
|
1737
1725
|
});
|
|
1738
|
-
|
|
1739
|
-
(
|
|
1740
|
-
),
|
|
1726
|
+
c(
|
|
1727
|
+
(b) => x ? u.participants : [...b, ...u.participants]
|
|
1728
|
+
), M(u.hasMore), d(u.nextCursor);
|
|
1741
1729
|
} catch (u) {
|
|
1742
|
-
const
|
|
1743
|
-
g(
|
|
1730
|
+
const b = u instanceof Error ? u.message : "Failed to load participants";
|
|
1731
|
+
g(b), console.error("[useParticipants] Load error:", u);
|
|
1744
1732
|
} finally {
|
|
1745
1733
|
m(!1);
|
|
1746
1734
|
}
|
|
1747
|
-
}, [t,
|
|
1748
|
-
S && !l &&
|
|
1749
|
-
}, [S, l,
|
|
1750
|
-
f(
|
|
1751
|
-
}, [
|
|
1752
|
-
|
|
1753
|
-
}, [
|
|
1754
|
-
return
|
|
1755
|
-
|
|
1735
|
+
}, [t, w, v, r, l]), E = D(() => {
|
|
1736
|
+
S && !l && N(!1);
|
|
1737
|
+
}, [S, l, N]), I = D((x) => {
|
|
1738
|
+
f(x), d(void 0), N(!0, x);
|
|
1739
|
+
}, [N]), k = D(() => {
|
|
1740
|
+
d(void 0), N(!0);
|
|
1741
|
+
}, [N]);
|
|
1742
|
+
return G(() => {
|
|
1743
|
+
N(!0);
|
|
1756
1744
|
}, [t.loadParticipants]), {
|
|
1757
|
-
participants:
|
|
1745
|
+
participants: a,
|
|
1758
1746
|
loading: l,
|
|
1759
1747
|
error: h,
|
|
1760
|
-
searchQuery:
|
|
1748
|
+
searchQuery: w,
|
|
1761
1749
|
hasMore: S,
|
|
1762
1750
|
totalCount: t.totalCount,
|
|
1763
|
-
loadMore:
|
|
1751
|
+
loadMore: E,
|
|
1764
1752
|
search: I,
|
|
1765
|
-
refresh:
|
|
1753
|
+
refresh: k
|
|
1766
1754
|
};
|
|
1767
1755
|
};
|
|
1768
1756
|
export {
|
|
1769
|
-
|
|
1757
|
+
q as Avatar,
|
|
1770
1758
|
gs as ChannelEmptyState,
|
|
1771
1759
|
Ie as ChannelList,
|
|
1772
1760
|
ke as ChannelView,
|
|
1773
1761
|
Ts as FaqList,
|
|
1774
1762
|
Es as FaqListItem,
|
|
1775
|
-
|
|
1763
|
+
Ms as MessagingProvider,
|
|
1776
1764
|
Fs as MessagingShell,
|
|
1777
|
-
|
|
1778
|
-
|
|
1765
|
+
ws as ParticipantPicker,
|
|
1766
|
+
as as formatRelativeTime,
|
|
1779
1767
|
rs as useMessaging,
|
|
1780
1768
|
Ls as useParticipants
|
|
1781
1769
|
};
|