@linktr.ee/messaging-react 1.12.8-rc-1766044049 โ 1.12.8-rc-1766045447
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 +417 -391
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CustomMessageInput/index.tsx +49 -16
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as we } from "react/jsx-runtime";
|
|
2
2
|
import k from "classnames";
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
3
|
+
import U, { createContext as ye, useContext as Ee, useCallback as D, useState as y, useRef as z, useEffect as G } from "react";
|
|
4
|
+
import { StreamChatService as $e } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as Ge, ChannelList as He, useMessageComposer as Ie, useStateStore as Ve, MessageInput as We, useMessageInputContext as Ze, useMessageComposerHasSendableData as qe, useChannelStateContext as ue, SimpleAttachmentSelector as Ye, QuotedMessagePreview as Je, AttachmentPreviewList as Qe, TextareaComposer as Xe, MessageTimestamp as Ke, Channel as es, Window as ss, MessageList as ts } from "stream-chat-react";
|
|
6
6
|
import { XIcon as oe, ArrowUpIcon as ns, ArrowLeftIcon as ge, DotsThreeIcon as xe, SpinnerGapIcon as re, SignOutIcon as rs, ProhibitInsetIcon as be, FlagIcon as ls, MagnifyingGlassIcon as as, ChatCircleDotsIcon as Ne } from "@phosphor-icons/react";
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
7
|
+
import { LinkPreviewsManager as Ce } from "stream-chat";
|
|
8
|
+
const Se = ye({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,19 +15,19 @@ const Ie = ye({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), ie = () => Ee(
|
|
18
|
+
}), ie = () => Ee(Se), Us = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
22
22
|
apiKey: r,
|
|
23
23
|
capabilities: a = {},
|
|
24
|
-
debug:
|
|
24
|
+
debug: o = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const l =
|
|
27
|
-
(
|
|
28
|
-
|
|
26
|
+
const l = D(
|
|
27
|
+
(m, ...x) => {
|
|
28
|
+
o && console.log(`๐ฅ [MessagingProvider] ${m}`, ...x);
|
|
29
29
|
},
|
|
30
|
-
[
|
|
30
|
+
[o]
|
|
31
31
|
);
|
|
32
32
|
l("๐ RENDER START", {
|
|
33
33
|
userId: s == null ? void 0 : s.id,
|
|
@@ -35,7 +35,7 @@ const Ie = ye({
|
|
|
35
35
|
serviceConfig: !!n,
|
|
36
36
|
capabilities: Object.keys(a)
|
|
37
37
|
});
|
|
38
|
-
const [h, f] = y(null), [g,
|
|
38
|
+
const [h, f] = y(null), [g, N] = y(null), [c, E] = y(!1), [R, I] = y(!1), [w, C] = y(null), u = z(!1), b = z({
|
|
39
39
|
userId: s == null ? void 0 : s.id,
|
|
40
40
|
apiKey: r,
|
|
41
41
|
serviceConfig: n,
|
|
@@ -56,9 +56,9 @@ const Ie = ye({
|
|
|
56
56
|
serviceConfig: n,
|
|
57
57
|
capabilities: a
|
|
58
58
|
}, G(() => {
|
|
59
|
-
const
|
|
59
|
+
const m = S.current;
|
|
60
60
|
if (l("๐ง SERVICE INIT EFFECT TRIGGERED", {
|
|
61
|
-
renderCount:
|
|
61
|
+
renderCount: m,
|
|
62
62
|
apiKey: !!r,
|
|
63
63
|
serviceConfig: !!n,
|
|
64
64
|
dependencies: {
|
|
@@ -69,31 +69,31 @@ const Ie = ye({
|
|
|
69
69
|
}
|
|
70
70
|
}), !r || !n) {
|
|
71
71
|
l("โ ๏ธ SERVICE INIT SKIPPED", {
|
|
72
|
-
renderCount:
|
|
72
|
+
renderCount: m,
|
|
73
73
|
reason: "Missing apiKey or serviceConfig"
|
|
74
74
|
});
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
l("๐ CREATING NEW SERVICE", {
|
|
78
|
-
renderCount:
|
|
78
|
+
renderCount: m,
|
|
79
79
|
apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
|
|
80
80
|
serviceConfigChanged: b.current.serviceConfig !== n
|
|
81
81
|
});
|
|
82
|
-
const x = new
|
|
82
|
+
const x = new $e({
|
|
83
83
|
...n,
|
|
84
84
|
apiKey: r,
|
|
85
|
-
debug:
|
|
85
|
+
debug: o
|
|
86
86
|
});
|
|
87
87
|
return f(x), l("โ
SERVICE SET", {
|
|
88
|
-
renderCount:
|
|
88
|
+
renderCount: m,
|
|
89
89
|
serviceInstance: !!x
|
|
90
90
|
}), () => {
|
|
91
91
|
l("๐งน SERVICE CLEANUP", {
|
|
92
|
-
renderCount:
|
|
92
|
+
renderCount: m,
|
|
93
93
|
reason: "Effect cleanup"
|
|
94
94
|
}), x.disconnectUser().catch(console.error);
|
|
95
95
|
};
|
|
96
|
-
}, [r, n,
|
|
96
|
+
}, [r, n, o, l]);
|
|
97
97
|
const p = z(null);
|
|
98
98
|
G(() => {
|
|
99
99
|
var x, B;
|
|
@@ -101,14 +101,14 @@ const Ie = ye({
|
|
|
101
101
|
hasService: !!h,
|
|
102
102
|
hasUser: !!s,
|
|
103
103
|
userId: s == null ? void 0 : s.id,
|
|
104
|
-
isConnecting:
|
|
105
|
-
isConnected:
|
|
104
|
+
isConnecting: u.current,
|
|
105
|
+
isConnected: c,
|
|
106
106
|
dependencies: { service: !!h, userId: s == null ? void 0 : s.id }
|
|
107
107
|
}), !h || !s) {
|
|
108
108
|
l("โ ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (u.current) {
|
|
112
112
|
l("โ ๏ธ USER CONNECTION SKIPPED", "Already connecting");
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -120,40 +120,40 @@ const Ie = ye({
|
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
(async () => {
|
|
123
|
-
l("๐ STARTING USER CONNECTION", { userId: s.id }),
|
|
123
|
+
l("๐ STARTING USER CONNECTION", { userId: s.id }), u.current = !0, I(!0), C(null);
|
|
124
124
|
try {
|
|
125
125
|
l("๐ CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
126
126
|
const A = await h.connectUser(s);
|
|
127
|
-
|
|
127
|
+
N(A), E(!0), p.current = { serviceId: h, userId: s.id }, l("โ
USER CONNECTION SUCCESS", {
|
|
128
128
|
userId: s.id,
|
|
129
129
|
clientId: A.userID
|
|
130
130
|
});
|
|
131
131
|
} catch (A) {
|
|
132
132
|
const H = A instanceof Error ? A.message : "Connection failed";
|
|
133
|
-
|
|
133
|
+
C(H), l("โ USER CONNECTION ERROR", {
|
|
134
134
|
userId: s.id,
|
|
135
135
|
error: H
|
|
136
136
|
});
|
|
137
137
|
} finally {
|
|
138
|
-
I(!1),
|
|
138
|
+
I(!1), u.current = !1, l("๐ USER CONNECTION FINISHED", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
isConnected:
|
|
140
|
+
isConnected: c
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
})();
|
|
144
|
-
}, [h, s, l,
|
|
144
|
+
}, [h, s, l, c]), G(() => (l("๐ CLEANUP EFFECT REGISTERED", {
|
|
145
145
|
hasService: !!h,
|
|
146
|
-
isConnected:
|
|
146
|
+
isConnected: c
|
|
147
147
|
}), () => {
|
|
148
|
-
h &&
|
|
148
|
+
h && c ? (l(
|
|
149
149
|
"๐งน CLEANUP EFFECT TRIGGERED",
|
|
150
150
|
"Cleaning up connection on unmount"
|
|
151
151
|
), p.current = null, h.disconnectUser().catch(console.error)) : l("๐ CLEANUP EFFECT SKIPPED", {
|
|
152
152
|
hasService: !!h,
|
|
153
|
-
isConnected:
|
|
153
|
+
isConnected: c
|
|
154
154
|
});
|
|
155
|
-
}), [h,
|
|
156
|
-
const T =
|
|
155
|
+
}), [h, c, l]);
|
|
156
|
+
const T = D(async () => {
|
|
157
157
|
if (l("๐ REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!h,
|
|
159
159
|
hasUser: !!s
|
|
@@ -164,50 +164,50 @@ const Ie = ye({
|
|
|
164
164
|
l("๐ STARTING CONNECTION REFRESH", { userId: s.id }), I(!0);
|
|
165
165
|
try {
|
|
166
166
|
l("๐ DISCONNECTING FOR REFRESH"), await h.disconnectUser(), l("๐ RECONNECTING FOR REFRESH");
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
} catch (
|
|
170
|
-
const x =
|
|
171
|
-
|
|
167
|
+
const m = await h.connectUser(s);
|
|
168
|
+
N(m), E(!0), C(null), l("โ
CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
169
|
+
} catch (m) {
|
|
170
|
+
const x = m instanceof Error ? m.message : "Refresh failed";
|
|
171
|
+
C(x), l("โ CONNECTION REFRESH ERROR", {
|
|
172
172
|
userId: s.id,
|
|
173
173
|
error: x
|
|
174
174
|
});
|
|
175
175
|
} finally {
|
|
176
176
|
I(!1), l("๐ CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
177
177
|
}
|
|
178
|
-
}, [h, s, l]),
|
|
178
|
+
}, [h, s, l]), d = U.useMemo(() => (l("๐ซ CONTEXT VALUE MEMOIZATION", {
|
|
179
179
|
hasService: !!h,
|
|
180
180
|
hasClient: !!g,
|
|
181
|
-
isConnected:
|
|
181
|
+
isConnected: c,
|
|
182
182
|
isLoading: R,
|
|
183
183
|
hasError: !!w,
|
|
184
184
|
capabilitiesKeys: Object.keys(a)
|
|
185
185
|
}), {
|
|
186
186
|
service: h,
|
|
187
187
|
client: g,
|
|
188
|
-
isConnected:
|
|
188
|
+
isConnected: c,
|
|
189
189
|
isLoading: R,
|
|
190
190
|
error: w,
|
|
191
191
|
capabilities: a,
|
|
192
192
|
refreshConnection: T,
|
|
193
|
-
debug:
|
|
193
|
+
debug: o
|
|
194
194
|
}), [
|
|
195
195
|
h,
|
|
196
196
|
g,
|
|
197
|
-
|
|
197
|
+
c,
|
|
198
198
|
R,
|
|
199
199
|
w,
|
|
200
200
|
a,
|
|
201
201
|
T,
|
|
202
|
-
|
|
202
|
+
o,
|
|
203
203
|
l
|
|
204
204
|
]);
|
|
205
205
|
return l("๐ RENDER END", {
|
|
206
206
|
renderCount: S.current,
|
|
207
|
-
willRenderChat: !!(g &&
|
|
208
|
-
contextValueReady: !!
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
210
|
-
|
|
207
|
+
willRenderChat: !!(g && c),
|
|
208
|
+
contextValueReady: !!d
|
|
209
|
+
}), /* @__PURE__ */ e(Se.Provider, { value: d, children: g && c ? /* @__PURE__ */ e(
|
|
210
|
+
Ge,
|
|
211
211
|
{
|
|
212
212
|
client: g,
|
|
213
213
|
customClasses: {
|
|
@@ -237,7 +237,7 @@ const Ie = ye({
|
|
|
237
237
|
day: "numeric",
|
|
238
238
|
year: "2-digit"
|
|
239
239
|
});
|
|
240
|
-
},
|
|
240
|
+
}, ve = [
|
|
241
241
|
"๐",
|
|
242
242
|
// Apple
|
|
243
243
|
"๐",
|
|
@@ -273,9 +273,9 @@ function ds(t) {
|
|
|
273
273
|
}
|
|
274
274
|
return Math.abs(s);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
const n = ds(t) %
|
|
278
|
-
return
|
|
276
|
+
function ms(t) {
|
|
277
|
+
const n = ds(t) % ve.length;
|
|
278
|
+
return ve[n];
|
|
279
279
|
}
|
|
280
280
|
const Z = ({
|
|
281
281
|
id: t,
|
|
@@ -284,7 +284,7 @@ const Z = ({
|
|
|
284
284
|
className: r,
|
|
285
285
|
shape: a = "squircle"
|
|
286
286
|
}) => {
|
|
287
|
-
const
|
|
287
|
+
const o = ms(t), h = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", f = a === "circle" ? { borderRadius: "50%" } : {
|
|
288
288
|
borderRadius: "33%",
|
|
289
289
|
"corner-shape": "superellipse(1.3)"
|
|
290
290
|
};
|
|
@@ -312,30 +312,30 @@ const Z = ({
|
|
|
312
312
|
"avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
|
|
313
313
|
h
|
|
314
314
|
),
|
|
315
|
-
children:
|
|
315
|
+
children: o
|
|
316
316
|
}
|
|
317
317
|
)
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
|
-
},
|
|
320
|
+
}, pe = U.memo(
|
|
321
321
|
({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
|
|
322
|
-
var
|
|
323
|
-
const
|
|
322
|
+
var C, u, b, S, p, T;
|
|
323
|
+
const o = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
|
|
324
324
|
t && n(t);
|
|
325
|
-
}, f = Object.values(((
|
|
326
|
-
(
|
|
327
|
-
var
|
|
328
|
-
return ((
|
|
325
|
+
}, f = Object.values(((C = t == null ? void 0 : t.state) == null ? void 0 : C.members) || {}).find(
|
|
326
|
+
(d) => {
|
|
327
|
+
var m, x;
|
|
328
|
+
return ((m = d.user) == null ? void 0 : m.id) && d.user.id !== ((x = t == null ? void 0 : t._client) == null ? void 0 : x.userID);
|
|
329
329
|
}
|
|
330
|
-
), g = ((
|
|
331
|
-
var
|
|
332
|
-
if (
|
|
333
|
-
const
|
|
334
|
-
return
|
|
335
|
-
})(), I =
|
|
330
|
+
), g = ((u = f == null ? void 0 : f.user) == null ? void 0 : u.name) || "Conversation", N = (b = f == null ? void 0 : f.user) == null ? void 0 : b.image, c = (p = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : p[t.state.messages.length - 1], R = (() => {
|
|
331
|
+
var m;
|
|
332
|
+
if (c != null && c.text) return c.text;
|
|
333
|
+
const d = (m = c == null ? void 0 : c.attachments) == null ? void 0 : m[0];
|
|
334
|
+
return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "๐ท Sent an image" : d.type === "video" ? "๐ฅ Sent a video" : d.type === "audio" ? "๐ต Sent audio" : d.type === "file" ? "๐ Sent a file" : "๐ Sent an attachment" : "No messages yet";
|
|
335
|
+
})(), I = c != null && c.created_at ? cs(new Date(c.created_at)) : "", w = a ?? 0;
|
|
336
336
|
return r && console.log("๐บ [ChannelList] ๐ CHANNEL PREVIEW RENDER", {
|
|
337
337
|
channelId: t == null ? void 0 : t.id,
|
|
338
|
-
isSelected:
|
|
338
|
+
isSelected: o,
|
|
339
339
|
participantName: g,
|
|
340
340
|
unreadCount: w,
|
|
341
341
|
hasTimestamp: !!I
|
|
@@ -347,36 +347,36 @@ const Z = ({
|
|
|
347
347
|
className: k(
|
|
348
348
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
349
349
|
{
|
|
350
|
-
"bg-primary-alt/10 border-l-4 border-l-primary":
|
|
351
|
-
"hover:bg-sand": !
|
|
350
|
+
"bg-primary-alt/10 border-l-4 border-l-primary": o,
|
|
351
|
+
"hover:bg-sand": !o
|
|
352
352
|
}
|
|
353
353
|
),
|
|
354
|
-
children: /* @__PURE__ */
|
|
354
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
355
355
|
/* @__PURE__ */ e(
|
|
356
356
|
Z,
|
|
357
357
|
{
|
|
358
358
|
id: ((T = f == null ? void 0 : f.user) == null ? void 0 : T.id) || t.id || "unknown",
|
|
359
359
|
name: g,
|
|
360
|
-
image:
|
|
360
|
+
image: N,
|
|
361
361
|
size: 44,
|
|
362
362
|
className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
|
-
/* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
366
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
|
|
367
367
|
/* @__PURE__ */ e(
|
|
368
368
|
"h3",
|
|
369
369
|
{
|
|
370
370
|
className: k(
|
|
371
371
|
"text-sm font-medium truncate",
|
|
372
|
-
|
|
372
|
+
o ? "text-primary" : "text-charcoal"
|
|
373
373
|
),
|
|
374
374
|
children: g
|
|
375
375
|
}
|
|
376
376
|
),
|
|
377
377
|
I && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: I })
|
|
378
378
|
] }),
|
|
379
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
380
380
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: R }),
|
|
381
381
|
w > 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: w > 99 ? "99+" : w })
|
|
382
382
|
] })
|
|
@@ -386,8 +386,8 @@ const Z = ({
|
|
|
386
386
|
);
|
|
387
387
|
}
|
|
388
388
|
);
|
|
389
|
-
|
|
390
|
-
const
|
|
389
|
+
pe.displayName = "CustomChannelPreview";
|
|
390
|
+
const ke = U.memo(
|
|
391
391
|
({
|
|
392
392
|
onChannelSelect: t,
|
|
393
393
|
selectedChannel: s,
|
|
@@ -395,16 +395,16 @@ const pe = P.memo(
|
|
|
395
395
|
className: r,
|
|
396
396
|
customEmptyStateIndicator: a
|
|
397
397
|
}) => {
|
|
398
|
-
const
|
|
399
|
-
|
|
398
|
+
const o = U.useRef(0);
|
|
399
|
+
o.current++;
|
|
400
400
|
const { debug: l = !1 } = ie();
|
|
401
401
|
l && console.log("๐บ [ChannelList] ๐ RENDER START", {
|
|
402
|
-
renderCount:
|
|
402
|
+
renderCount: o.current,
|
|
403
403
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
404
404
|
filters: n
|
|
405
405
|
});
|
|
406
|
-
const h =
|
|
407
|
-
|
|
406
|
+
const h = U.useMemo(() => (g) => /* @__PURE__ */ e(
|
|
407
|
+
pe,
|
|
408
408
|
{
|
|
409
409
|
...g,
|
|
410
410
|
selectedChannel: s,
|
|
@@ -420,7 +420,7 @@ const pe = P.memo(
|
|
|
420
420
|
r
|
|
421
421
|
),
|
|
422
422
|
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
423
|
-
|
|
423
|
+
He,
|
|
424
424
|
{
|
|
425
425
|
filters: n,
|
|
426
426
|
sort: { last_message_at: -1 },
|
|
@@ -434,7 +434,7 @@ const pe = P.memo(
|
|
|
434
434
|
);
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
|
-
|
|
437
|
+
ke.displayName = "ChannelList";
|
|
438
438
|
const ne = ({
|
|
439
439
|
variant: t = "default",
|
|
440
440
|
className: s,
|
|
@@ -453,8 +453,8 @@ const ne = ({
|
|
|
453
453
|
children: n
|
|
454
454
|
}
|
|
455
455
|
);
|
|
456
|
-
function
|
|
457
|
-
return /* @__PURE__ */
|
|
456
|
+
function Re({ label: t, className: s, children: n, ...r }) {
|
|
457
|
+
return /* @__PURE__ */ i(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
@@ -474,19 +474,19 @@ function ke({ label: t, className: s, children: n, ...r }) {
|
|
|
474
474
|
}
|
|
475
475
|
);
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return /* @__PURE__ */ e(
|
|
477
|
+
function De({ onClick: t }) {
|
|
478
|
+
return /* @__PURE__ */ e(Re, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(oe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const us = (t) => ({
|
|
481
481
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
482
|
-
(s) =>
|
|
482
|
+
(s) => Ce.previewIsLoaded(s) || Ce.previewIsLoading(s)
|
|
483
483
|
)
|
|
484
484
|
}), hs = ({
|
|
485
485
|
link: t,
|
|
486
486
|
onDismiss: s
|
|
487
487
|
}) => {
|
|
488
488
|
const { og_scrape_url: n, title: r, image_url: a } = t;
|
|
489
|
-
return /* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ i(
|
|
490
490
|
"a",
|
|
491
491
|
{
|
|
492
492
|
href: n,
|
|
@@ -514,7 +514,7 @@ const ms = (t) => ({
|
|
|
514
514
|
children: /* @__PURE__ */ e(oe, { className: "size-4 text-black/90" })
|
|
515
515
|
}
|
|
516
516
|
),
|
|
517
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
518
518
|
r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
|
|
519
519
|
/* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
|
|
520
520
|
] })
|
|
@@ -522,9 +522,9 @@ const ms = (t) => ({
|
|
|
522
522
|
}
|
|
523
523
|
);
|
|
524
524
|
}, fs = () => {
|
|
525
|
-
const { linkPreviewsManager: t } =
|
|
525
|
+
const { linkPreviewsManager: t } = Ie(), { linkPreviews: s } = Ve(
|
|
526
526
|
t.state,
|
|
527
|
-
|
|
527
|
+
us
|
|
528
528
|
), n = (a) => {
|
|
529
529
|
t.dismissPreview(a);
|
|
530
530
|
};
|
|
@@ -538,7 +538,7 @@ const ms = (t) => ({
|
|
|
538
538
|
)) }) : null;
|
|
539
539
|
}, _e = ye(
|
|
540
540
|
{}
|
|
541
|
-
), gs = ({ attachment: t, onRemove: s }) => /* @__PURE__ */
|
|
541
|
+
), gs = ({ attachment: t, onRemove: s }) => /* @__PURE__ */ i("div", { className: "relative w-full block rounded-[24px] bg-[#121110] p-2 mb-4", children: [
|
|
542
542
|
t.thumb_url && /* @__PURE__ */ e(
|
|
543
543
|
"img",
|
|
544
544
|
{
|
|
@@ -557,47 +557,73 @@ const ms = (t) => ({
|
|
|
557
557
|
children: /* @__PURE__ */ e(oe, { className: "size-4 text-black/90" })
|
|
558
558
|
}
|
|
559
559
|
),
|
|
560
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ i("div", { className: "p-2", children: [
|
|
561
561
|
t.title && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: t.title }),
|
|
562
562
|
t.title_link && /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55 truncate", children: t.title_link })
|
|
563
563
|
] })
|
|
564
564
|
] }), xs = () => {
|
|
565
|
-
const { handleSubmit: t } = Ze(), s = qe(), { channel: n } =
|
|
565
|
+
const { handleSubmit: t } = Ze(), s = qe(), { channel: n } = ue(), r = Ie(), { pendingAttachment: a, onClearPendingAttachment: o } = Ee(
|
|
566
566
|
_e
|
|
567
|
-
),
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
567
|
+
), l = s || !!a, h = D(
|
|
568
|
+
(g) => {
|
|
569
|
+
g.key === "Enter" && !g.shiftKey && a && (g.preventDefault(), g.stopPropagation(), (async () => {
|
|
570
|
+
var N;
|
|
571
|
+
if (a && n)
|
|
572
|
+
try {
|
|
573
|
+
const c = ((N = r.textComposer.text) == null ? void 0 : N.trim()) || "";
|
|
574
|
+
await n.sendMessage({
|
|
575
|
+
text: c,
|
|
576
|
+
attachments: [a]
|
|
577
|
+
}), r.textComposer.setText(""), o == null || o();
|
|
578
|
+
} catch (c) {
|
|
579
|
+
console.error("Failed to send message with attachment:", c);
|
|
580
|
+
}
|
|
581
|
+
})());
|
|
582
|
+
},
|
|
583
|
+
[
|
|
584
|
+
n,
|
|
585
|
+
r.textComposer,
|
|
586
|
+
o,
|
|
587
|
+
a
|
|
588
|
+
]
|
|
589
|
+
), f = D(
|
|
590
|
+
async (g) => {
|
|
591
|
+
var N;
|
|
592
|
+
if (a && n)
|
|
574
593
|
try {
|
|
594
|
+
const c = ((N = r.textComposer.text) == null ? void 0 : N.trim()) || "";
|
|
575
595
|
await n.sendMessage({
|
|
576
|
-
text:
|
|
577
|
-
attachments: [
|
|
578
|
-
}),
|
|
579
|
-
} catch (
|
|
580
|
-
console.error("Failed to send message with attachment:",
|
|
596
|
+
text: c,
|
|
597
|
+
attachments: [a]
|
|
598
|
+
}), r.textComposer.setText(""), o == null || o();
|
|
599
|
+
} catch (c) {
|
|
600
|
+
console.error("Failed to send message with attachment:", c);
|
|
581
601
|
}
|
|
582
|
-
|
|
583
|
-
await t(
|
|
602
|
+
else
|
|
603
|
+
await t(g);
|
|
584
604
|
},
|
|
585
|
-
[
|
|
605
|
+
[
|
|
606
|
+
n,
|
|
607
|
+
t,
|
|
608
|
+
r.textComposer,
|
|
609
|
+
o,
|
|
610
|
+
a
|
|
611
|
+
]
|
|
586
612
|
);
|
|
587
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ i(we, { children: [
|
|
588
614
|
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ye, {}) }),
|
|
589
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__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: [
|
|
590
616
|
/* @__PURE__ */ e(Je, {}),
|
|
591
617
|
/* @__PURE__ */ e(fs, {}),
|
|
592
618
|
/* @__PURE__ */ e(Qe, {}),
|
|
593
|
-
|
|
619
|
+
a && o && /* @__PURE__ */ e(
|
|
594
620
|
gs,
|
|
595
621
|
{
|
|
596
|
-
attachment:
|
|
597
|
-
onRemove:
|
|
622
|
+
attachment: a,
|
|
623
|
+
onRemove: o
|
|
598
624
|
}
|
|
599
625
|
),
|
|
600
|
-
/* @__PURE__ */
|
|
626
|
+
/* @__PURE__ */ i("div", { className: "flex", onKeyDown: h, children: [
|
|
601
627
|
/* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
|
|
602
628
|
Xe,
|
|
603
629
|
{
|
|
@@ -611,8 +637,8 @@ const ms = (t) => ({
|
|
|
611
637
|
"aria-label": "Send",
|
|
612
638
|
className: "str-chat__send-button mt-auto flex justify-center items-center flex-shrink-0 rounded-full size-8 bg-[#121110] disabled:bg-[#F1F0EE] disabled:text-black/20 text-white",
|
|
613
639
|
"data-testid": "send-button",
|
|
614
|
-
disabled: !
|
|
615
|
-
onClick:
|
|
640
|
+
disabled: !l,
|
|
641
|
+
onClick: f,
|
|
616
642
|
type: "button",
|
|
617
643
|
children: /* @__PURE__ */ e(ns, { className: "size-4" })
|
|
618
644
|
}
|
|
@@ -628,27 +654,27 @@ const ms = (t) => ({
|
|
|
628
654
|
_e.Provider,
|
|
629
655
|
{
|
|
630
656
|
value: { pendingAttachment: s, onClearPendingAttachment: n },
|
|
631
|
-
children: /* @__PURE__ */
|
|
657
|
+
children: /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
632
658
|
t && (t == null ? void 0 : t()),
|
|
633
659
|
/* @__PURE__ */ e(We, { Input: xs })
|
|
634
660
|
] })
|
|
635
661
|
}
|
|
636
662
|
), Ns = (t) => {
|
|
637
663
|
const s = t.message.hide_date === !0;
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
665
|
+
/* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
|
|
640
666
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
|
|
641
667
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
642
668
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
643
669
|
] }),
|
|
644
670
|
!s && /* @__PURE__ */ e(Ke, { message: t.message })
|
|
645
671
|
] });
|
|
646
|
-
},
|
|
672
|
+
}, Cs = () => null, vs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
647
673
|
"div",
|
|
648
674
|
{
|
|
649
675
|
className: k("flex items-center justify-center h-full", t),
|
|
650
676
|
children: [
|
|
651
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
652
678
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
653
679
|
"animateTransform",
|
|
654
680
|
{
|
|
@@ -686,21 +712,21 @@ const ms = (t) => ({
|
|
|
686
712
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
687
713
|
]
|
|
688
714
|
}
|
|
689
|
-
), ae =
|
|
690
|
-
/* @__PURE__ */ e(
|
|
715
|
+
), 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: [
|
|
716
|
+
/* @__PURE__ */ e(vs, { className: "w-6 h-6" }),
|
|
691
717
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
692
718
|
] }) }));
|
|
693
719
|
ae.displayName = "LoadingState";
|
|
694
720
|
const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
|
|
695
|
-
var f, g,
|
|
696
|
-
const { channel: a } =
|
|
721
|
+
var f, g, N, c, E;
|
|
722
|
+
const { channel: a } = ue(), o = U.useMemo(() => Object.values(a.state.members || {}).find(
|
|
697
723
|
(I) => {
|
|
698
724
|
var w;
|
|
699
725
|
return ((w = I.user) == null ? void 0 : w.id) && I.user.id !== a._client.userID;
|
|
700
726
|
}
|
|
701
|
-
), [a._client.userID, a.state.members]), l = ((f =
|
|
702
|
-
return /* @__PURE__ */
|
|
703
|
-
/* @__PURE__ */
|
|
727
|
+
), [a._client.userID, a.state.members]), l = ((f = o == null ? void 0 : o.user) == null ? void 0 : f.name) || ((g = o == null ? void 0 : o.user) == null ? void 0 : g.id) || "Unknown member", h = (N = o == null ? void 0 : o.user) == null ? void 0 : N.image;
|
|
728
|
+
return /* @__PURE__ */ i("div", { className: "@container", children: [
|
|
729
|
+
/* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
|
|
704
730
|
/* @__PURE__ */ e(
|
|
705
731
|
"button",
|
|
706
732
|
{
|
|
@@ -715,11 +741,11 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
715
741
|
children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
|
|
716
742
|
}
|
|
717
743
|
),
|
|
718
|
-
/* @__PURE__ */
|
|
744
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
719
745
|
/* @__PURE__ */ e(
|
|
720
746
|
Z,
|
|
721
747
|
{
|
|
722
|
-
id: ((
|
|
748
|
+
id: ((c = o == null ? void 0 : o.user) == null ? void 0 : c.id) || a.id || "unknown",
|
|
723
749
|
name: l,
|
|
724
750
|
image: h,
|
|
725
751
|
size: 40
|
|
@@ -740,8 +766,8 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
740
766
|
}
|
|
741
767
|
)
|
|
742
768
|
] }),
|
|
743
|
-
/* @__PURE__ */
|
|
744
|
-
/* @__PURE__ */
|
|
769
|
+
/* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
|
|
770
|
+
/* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
|
|
745
771
|
s && t && /* @__PURE__ */ e(
|
|
746
772
|
"button",
|
|
747
773
|
{
|
|
@@ -755,7 +781,7 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
755
781
|
/* @__PURE__ */ e(
|
|
756
782
|
Z,
|
|
757
783
|
{
|
|
758
|
-
id: ((E =
|
|
784
|
+
id: ((E = o == null ? void 0 : o.user) == null ? void 0 : E.id) || a.id || "unknown",
|
|
759
785
|
name: l,
|
|
760
786
|
image: h,
|
|
761
787
|
size: 40
|
|
@@ -781,74 +807,74 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
781
807
|
participant: n,
|
|
782
808
|
channel: r,
|
|
783
809
|
followerStatusLabel: a,
|
|
784
|
-
onLeaveConversation:
|
|
810
|
+
onLeaveConversation: o,
|
|
785
811
|
onBlockParticipant: l,
|
|
786
812
|
showDeleteConversation: h = !0,
|
|
787
813
|
onDeleteConversationClick: f,
|
|
788
814
|
onBlockParticipantClick: g,
|
|
789
|
-
onReportParticipantClick:
|
|
815
|
+
onReportParticipantClick: N
|
|
790
816
|
}) => {
|
|
791
817
|
var q, Q, X, K, ce, j, V;
|
|
792
|
-
const { service:
|
|
818
|
+
const { service: c, debug: E } = ie(), [R, I] = y(!1), [w, C] = y(!1), [u, b] = y(!1), S = D(async () => {
|
|
793
819
|
var F;
|
|
794
|
-
if (!(!
|
|
820
|
+
if (!(!c || !((F = n == null ? void 0 : n.user) != null && F.id)))
|
|
795
821
|
try {
|
|
796
|
-
const
|
|
822
|
+
const P = (await c.getBlockedUsers()).some(
|
|
797
823
|
($) => {
|
|
798
824
|
var Y;
|
|
799
825
|
return $.blocked_user_id === ((Y = n == null ? void 0 : n.user) == null ? void 0 : Y.id);
|
|
800
826
|
}
|
|
801
827
|
);
|
|
802
|
-
I(
|
|
803
|
-
} catch (
|
|
828
|
+
I(P);
|
|
829
|
+
} catch (_) {
|
|
804
830
|
console.error(
|
|
805
831
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
806
|
-
|
|
832
|
+
_
|
|
807
833
|
);
|
|
808
834
|
}
|
|
809
|
-
}, [
|
|
835
|
+
}, [c, (q = n == null ? void 0 : n.user) == null ? void 0 : q.id]);
|
|
810
836
|
G(() => {
|
|
811
837
|
S();
|
|
812
838
|
}, [S]);
|
|
813
839
|
const p = async () => {
|
|
814
840
|
var F;
|
|
815
841
|
if (!w) {
|
|
816
|
-
f == null || f(), E && console.log("[ChannelInfoDialog] Leave conversation", r.cid),
|
|
842
|
+
f == null || f(), E && console.log("[ChannelInfoDialog] Leave conversation", r.cid), C(!0);
|
|
817
843
|
try {
|
|
818
|
-
const
|
|
819
|
-
await r.hide(
|
|
820
|
-
} catch (
|
|
821
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
844
|
+
const _ = ((F = r._client) == null ? void 0 : F.userID) ?? null;
|
|
845
|
+
await r.hide(_, !1), o && await o(r), s();
|
|
846
|
+
} catch (_) {
|
|
847
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", _);
|
|
822
848
|
} finally {
|
|
823
|
-
|
|
849
|
+
C(!1);
|
|
824
850
|
}
|
|
825
851
|
}
|
|
826
852
|
}, T = async () => {
|
|
827
|
-
var F,
|
|
828
|
-
if (!(
|
|
853
|
+
var F, _, P;
|
|
854
|
+
if (!(u || !c)) {
|
|
829
855
|
g == null || g(), E && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
|
|
830
856
|
try {
|
|
831
|
-
await
|
|
857
|
+
await c.blockUser((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
|
|
832
858
|
} catch ($) {
|
|
833
859
|
console.error("[ChannelInfoDialog] Failed to block member", $);
|
|
834
860
|
} finally {
|
|
835
861
|
b(!1);
|
|
836
862
|
}
|
|
837
863
|
}
|
|
838
|
-
},
|
|
839
|
-
var F,
|
|
840
|
-
if (!(
|
|
864
|
+
}, d = async () => {
|
|
865
|
+
var F, _, P;
|
|
866
|
+
if (!(u || !c)) {
|
|
841
867
|
g == null || g(), E && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), b(!0);
|
|
842
868
|
try {
|
|
843
|
-
await
|
|
869
|
+
await c.unBlockUser((_ = n == null ? void 0 : n.user) == null ? void 0 : _.id), l && await l((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
|
|
844
870
|
} catch ($) {
|
|
845
871
|
console.error("[ChannelInfoDialog] Failed to unblock member", $);
|
|
846
872
|
} finally {
|
|
847
873
|
b(!1);
|
|
848
874
|
}
|
|
849
875
|
}
|
|
850
|
-
},
|
|
851
|
-
|
|
876
|
+
}, m = () => {
|
|
877
|
+
N == null || N(), s(), window.open(
|
|
852
878
|
"https://linktr.ee/s/about/trust-center/report",
|
|
853
879
|
"_blank",
|
|
854
880
|
"noopener,noreferrer"
|
|
@@ -867,18 +893,18 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
867
893
|
onClick: (F) => {
|
|
868
894
|
F.target === t.current && s();
|
|
869
895
|
},
|
|
870
|
-
children: /* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
896
|
+
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: [
|
|
897
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
872
898
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
873
|
-
/* @__PURE__ */ e(
|
|
899
|
+
/* @__PURE__ */ e(De, { onClick: s })
|
|
874
900
|
] }),
|
|
875
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
876
902
|
/* @__PURE__ */ e(
|
|
877
903
|
"div",
|
|
878
904
|
{
|
|
879
905
|
className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
|
|
880
906
|
style: { backgroundColor: "#FBFAF9" },
|
|
881
|
-
children: /* @__PURE__ */
|
|
907
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
882
908
|
/* @__PURE__ */ e(
|
|
883
909
|
Z,
|
|
884
910
|
{
|
|
@@ -889,7 +915,7 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
889
915
|
shape: "circle"
|
|
890
916
|
}
|
|
891
917
|
),
|
|
892
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
|
|
893
919
|
/* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: x }),
|
|
894
920
|
J && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: J }),
|
|
895
921
|
a && /* @__PURE__ */ e(
|
|
@@ -910,8 +936,8 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
910
936
|
] })
|
|
911
937
|
}
|
|
912
938
|
),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
h && /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
940
|
+
h && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
915
941
|
ne,
|
|
916
942
|
{
|
|
917
943
|
onClick: p,
|
|
@@ -923,30 +949,30 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
923
949
|
]
|
|
924
950
|
}
|
|
925
951
|
) }),
|
|
926
|
-
/* @__PURE__ */ e("li", { children: R ? /* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ e("li", { children: R ? /* @__PURE__ */ i(
|
|
927
953
|
ne,
|
|
928
954
|
{
|
|
929
|
-
onClick:
|
|
930
|
-
disabled:
|
|
931
|
-
"aria-busy":
|
|
955
|
+
onClick: d,
|
|
956
|
+
disabled: u,
|
|
957
|
+
"aria-busy": u,
|
|
932
958
|
children: [
|
|
933
|
-
|
|
959
|
+
u ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(be, { className: "h-5 w-5" }),
|
|
934
960
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
935
961
|
]
|
|
936
962
|
}
|
|
937
|
-
) : /* @__PURE__ */
|
|
963
|
+
) : /* @__PURE__ */ i(
|
|
938
964
|
ne,
|
|
939
965
|
{
|
|
940
966
|
onClick: T,
|
|
941
|
-
disabled:
|
|
942
|
-
"aria-busy":
|
|
967
|
+
disabled: u,
|
|
968
|
+
"aria-busy": u,
|
|
943
969
|
children: [
|
|
944
|
-
|
|
970
|
+
u ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(be, { className: "h-5 w-5" }),
|
|
945
971
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
946
972
|
]
|
|
947
973
|
}
|
|
948
974
|
) }),
|
|
949
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ne, { variant: "danger", onClick: m, children: [
|
|
950
976
|
/* @__PURE__ */ e(ls, { className: "h-5 w-5" }),
|
|
951
977
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
952
978
|
] }) })
|
|
@@ -962,33 +988,33 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
962
988
|
renderMessageInputActions: n,
|
|
963
989
|
onLeaveConversation: r,
|
|
964
990
|
onBlockParticipant: a,
|
|
965
|
-
showDeleteConversation:
|
|
991
|
+
showDeleteConversation: o = !0,
|
|
966
992
|
onDeleteConversationClick: l,
|
|
967
993
|
onBlockParticipantClick: h,
|
|
968
994
|
onReportParticipantClick: f,
|
|
969
995
|
pendingAttachment: g,
|
|
970
|
-
onClearPendingAttachment:
|
|
996
|
+
onClearPendingAttachment: N
|
|
971
997
|
}) => {
|
|
972
|
-
const { channel:
|
|
998
|
+
const { channel: c } = ue(), E = z(null), R = U.useMemo(() => Object.values(c.state.members || {}).find(
|
|
973
999
|
(b) => {
|
|
974
1000
|
var S;
|
|
975
|
-
return ((S = b.user) == null ? void 0 : S.id) && b.user.id !==
|
|
1001
|
+
return ((S = b.user) == null ? void 0 : S.id) && b.user.id !== c._client.userID;
|
|
976
1002
|
}
|
|
977
|
-
), [
|
|
978
|
-
const
|
|
979
|
-
if (
|
|
980
|
-
return String(
|
|
981
|
-
if (
|
|
982
|
-
return
|
|
983
|
-
}, [
|
|
984
|
-
var
|
|
985
|
-
(
|
|
986
|
-
}, []),
|
|
987
|
-
var
|
|
988
|
-
(
|
|
1003
|
+
), [c._client.userID, c.state.members]), I = U.useMemo(() => {
|
|
1004
|
+
const u = c.data ?? {};
|
|
1005
|
+
if (u.followerStatus)
|
|
1006
|
+
return String(u.followerStatus);
|
|
1007
|
+
if (u.isFollower !== void 0)
|
|
1008
|
+
return u.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1009
|
+
}, [c.data]), w = D(() => {
|
|
1010
|
+
var u;
|
|
1011
|
+
(u = E.current) == null || u.showModal();
|
|
1012
|
+
}, []), C = D(() => {
|
|
1013
|
+
var u;
|
|
1014
|
+
(u = E.current) == null || u.close();
|
|
989
1015
|
}, []);
|
|
990
|
-
return /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
1016
|
+
return /* @__PURE__ */ i(we, { children: [
|
|
1017
|
+
/* @__PURE__ */ i(ss, { children: [
|
|
992
1018
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
993
1019
|
ws,
|
|
994
1020
|
{
|
|
@@ -1009,9 +1035,9 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1009
1035
|
/* @__PURE__ */ e(
|
|
1010
1036
|
bs,
|
|
1011
1037
|
{
|
|
1012
|
-
renderActions: () => n == null ? void 0 : n(
|
|
1038
|
+
renderActions: () => n == null ? void 0 : n(c),
|
|
1013
1039
|
pendingAttachment: g,
|
|
1014
|
-
onClearPendingAttachment:
|
|
1040
|
+
onClearPendingAttachment: N
|
|
1015
1041
|
}
|
|
1016
1042
|
)
|
|
1017
1043
|
] }),
|
|
@@ -1019,33 +1045,33 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1019
1045
|
ys,
|
|
1020
1046
|
{
|
|
1021
1047
|
dialogRef: E,
|
|
1022
|
-
onClose:
|
|
1048
|
+
onClose: C,
|
|
1023
1049
|
participant: R,
|
|
1024
|
-
channel:
|
|
1050
|
+
channel: c,
|
|
1025
1051
|
followerStatusLabel: I,
|
|
1026
1052
|
onLeaveConversation: r,
|
|
1027
1053
|
onBlockParticipant: a,
|
|
1028
|
-
showDeleteConversation:
|
|
1054
|
+
showDeleteConversation: o,
|
|
1029
1055
|
onDeleteConversationClick: l,
|
|
1030
1056
|
onBlockParticipantClick: h,
|
|
1031
1057
|
onReportParticipantClick: f
|
|
1032
1058
|
}
|
|
1033
1059
|
)
|
|
1034
1060
|
] });
|
|
1035
|
-
},
|
|
1061
|
+
}, Me = U.memo(
|
|
1036
1062
|
({
|
|
1037
1063
|
channel: t,
|
|
1038
1064
|
onBack: s,
|
|
1039
1065
|
showBackButton: n = !1,
|
|
1040
1066
|
renderMessageInputActions: r,
|
|
1041
1067
|
onLeaveConversation: a,
|
|
1042
|
-
onBlockParticipant:
|
|
1068
|
+
onBlockParticipant: o,
|
|
1043
1069
|
className: l,
|
|
1044
|
-
CustomChannelEmptyState: h =
|
|
1070
|
+
CustomChannelEmptyState: h = Cs,
|
|
1045
1071
|
showDeleteConversation: f = !0,
|
|
1046
1072
|
onDeleteConversationClick: g,
|
|
1047
|
-
onBlockParticipantClick:
|
|
1048
|
-
onReportParticipantClick:
|
|
1073
|
+
onBlockParticipantClick: N,
|
|
1074
|
+
onReportParticipantClick: c,
|
|
1049
1075
|
pendingAttachment: E,
|
|
1050
1076
|
onClearPendingAttachment: R
|
|
1051
1077
|
}) => /* @__PURE__ */ e(
|
|
@@ -1069,12 +1095,12 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1069
1095
|
showBackButton: n,
|
|
1070
1096
|
renderMessageInputActions: r,
|
|
1071
1097
|
onLeaveConversation: a,
|
|
1072
|
-
onBlockParticipant:
|
|
1098
|
+
onBlockParticipant: o,
|
|
1073
1099
|
CustomChannelEmptyState: h,
|
|
1074
1100
|
showDeleteConversation: f,
|
|
1075
1101
|
onDeleteConversationClick: g,
|
|
1076
|
-
onBlockParticipantClick:
|
|
1077
|
-
onReportParticipantClick:
|
|
1102
|
+
onBlockParticipantClick: N,
|
|
1103
|
+
onReportParticipantClick: c,
|
|
1078
1104
|
pendingAttachment: E,
|
|
1079
1105
|
onClearPendingAttachment: R
|
|
1080
1106
|
}
|
|
@@ -1084,14 +1110,14 @@ const ws = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
|
|
|
1084
1110
|
}
|
|
1085
1111
|
)
|
|
1086
1112
|
);
|
|
1087
|
-
|
|
1113
|
+
Me.displayName = "ChannelView";
|
|
1088
1114
|
function Is({
|
|
1089
1115
|
searchQuery: t,
|
|
1090
1116
|
setSearchQuery: s,
|
|
1091
1117
|
placeholder: n
|
|
1092
1118
|
}) {
|
|
1093
1119
|
const r = z(null);
|
|
1094
|
-
return /* @__PURE__ */
|
|
1120
|
+
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
1095
1121
|
/* @__PURE__ */ e(
|
|
1096
1122
|
as,
|
|
1097
1123
|
{
|
|
@@ -1111,7 +1137,7 @@ function Is({
|
|
|
1111
1137
|
}
|
|
1112
1138
|
),
|
|
1113
1139
|
t && /* @__PURE__ */ e(
|
|
1114
|
-
|
|
1140
|
+
Re,
|
|
1115
1141
|
{
|
|
1116
1142
|
label: "Clear search",
|
|
1117
1143
|
onClick: () => {
|
|
@@ -1130,10 +1156,10 @@ const Ss = ({
|
|
|
1130
1156
|
onClose: n,
|
|
1131
1157
|
existingParticipantIds: r = /* @__PURE__ */ new Set(),
|
|
1132
1158
|
participantLabel: a = "participants",
|
|
1133
|
-
searchPlaceholder:
|
|
1159
|
+
searchPlaceholder: o = "Search participants...",
|
|
1134
1160
|
className: l
|
|
1135
1161
|
}) => {
|
|
1136
|
-
const { debug: h } = ie(), [f, g] = y(""), [
|
|
1162
|
+
const { debug: h } = ie(), [f, g] = y(""), [N, c] = y([]), [E, R] = y(!1), [I, w] = y(null), [C, u] = y(
|
|
1137
1163
|
null
|
|
1138
1164
|
), b = z(!1);
|
|
1139
1165
|
G(() => {
|
|
@@ -1147,50 +1173,50 @@ const Ss = ({
|
|
|
1147
1173
|
(async () => {
|
|
1148
1174
|
h && console.log("[ParticipantPicker] Loading initial participants..."), R(!0), w(null);
|
|
1149
1175
|
try {
|
|
1150
|
-
const
|
|
1176
|
+
const m = await t.loadParticipants({
|
|
1151
1177
|
search: "",
|
|
1152
1178
|
// Load all participants initially
|
|
1153
1179
|
limit: 100
|
|
1154
1180
|
});
|
|
1155
|
-
|
|
1181
|
+
c(m.participants), b.current = !0, h && console.log(
|
|
1156
1182
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
1157
|
-
|
|
1183
|
+
m.participants.length
|
|
1158
1184
|
);
|
|
1159
|
-
} catch (
|
|
1160
|
-
const x =
|
|
1161
|
-
w(x), console.error("[ParticipantPicker] Failed to load participants:",
|
|
1185
|
+
} catch (m) {
|
|
1186
|
+
const x = m instanceof Error ? m.message : "Failed to load participants";
|
|
1187
|
+
w(x), console.error("[ParticipantPicker] Failed to load participants:", m);
|
|
1162
1188
|
} finally {
|
|
1163
1189
|
R(!1);
|
|
1164
1190
|
}
|
|
1165
1191
|
})();
|
|
1166
1192
|
}, [t.loading, h]);
|
|
1167
|
-
const S =
|
|
1193
|
+
const S = N.filter((d) => !r.has(d.id)).filter((d) => {
|
|
1168
1194
|
var x;
|
|
1169
1195
|
if (!f) return !0;
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1172
|
-
}), p =
|
|
1173
|
-
async (
|
|
1174
|
-
if (!
|
|
1175
|
-
|
|
1196
|
+
const m = f.toLowerCase();
|
|
1197
|
+
return d.name.toLowerCase().includes(m) || ((x = d.email) == null ? void 0 : x.toLowerCase().includes(m)) || !1;
|
|
1198
|
+
}), p = D(
|
|
1199
|
+
async (d) => {
|
|
1200
|
+
if (!C) {
|
|
1201
|
+
u(d.id);
|
|
1176
1202
|
try {
|
|
1177
|
-
await s(
|
|
1178
|
-
} catch (
|
|
1179
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
1203
|
+
await s(d);
|
|
1204
|
+
} catch (m) {
|
|
1205
|
+
console.error("[ParticipantPicker] Failed to start chat:", m), u(null);
|
|
1180
1206
|
}
|
|
1181
1207
|
}
|
|
1182
1208
|
},
|
|
1183
|
-
[s,
|
|
1184
|
-
), T = (
|
|
1185
|
-
(
|
|
1209
|
+
[s, C]
|
|
1210
|
+
), T = (d, m) => {
|
|
1211
|
+
(d.key === "Enter" || d.key === " ") && (d.preventDefault(), p(m));
|
|
1186
1212
|
};
|
|
1187
|
-
return /* @__PURE__ */
|
|
1188
|
-
/* @__PURE__ */
|
|
1189
|
-
/* @__PURE__ */
|
|
1213
|
+
return /* @__PURE__ */ i("div", { className: k("flex flex-col h-full", l), children: [
|
|
1214
|
+
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1215
|
+
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1190
1216
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1191
|
-
/* @__PURE__ */ e(
|
|
1217
|
+
/* @__PURE__ */ e(De, { onClick: n })
|
|
1192
1218
|
] }),
|
|
1193
|
-
/* @__PURE__ */
|
|
1219
|
+
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1194
1220
|
"Select a ",
|
|
1195
1221
|
a.slice(0, -1),
|
|
1196
1222
|
" to start messaging (",
|
|
@@ -1203,65 +1229,65 @@ const Ss = ({
|
|
|
1203
1229
|
{
|
|
1204
1230
|
searchQuery: f,
|
|
1205
1231
|
setSearchQuery: g,
|
|
1206
|
-
placeholder:
|
|
1232
|
+
placeholder: o
|
|
1207
1233
|
}
|
|
1208
1234
|
)
|
|
1209
1235
|
] }),
|
|
1210
|
-
I && /* @__PURE__ */
|
|
1236
|
+
I && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
1211
1237
|
"Error loading ",
|
|
1212
1238
|
a,
|
|
1213
1239
|
": ",
|
|
1214
1240
|
I
|
|
1215
1241
|
] }),
|
|
1216
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1217
1243
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1218
|
-
/* @__PURE__ */
|
|
1244
|
+
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
1219
1245
|
"Loading ",
|
|
1220
1246
|
a,
|
|
1221
1247
|
"..."
|
|
1222
1248
|
] })
|
|
1223
|
-
] }) }) : S.length === 0 ? /* @__PURE__ */
|
|
1249
|
+
] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1224
1250
|
/* @__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" }) }),
|
|
1225
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${a} found` :
|
|
1226
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" :
|
|
1227
|
-
] }) : /* @__PURE__ */
|
|
1228
|
-
S.map((
|
|
1229
|
-
const
|
|
1251
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${a} found` : N.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
|
|
1252
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : N.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
|
|
1253
|
+
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
1254
|
+
S.map((d) => {
|
|
1255
|
+
const m = d.name || d.email || d.id, x = d.email && d.name ? d.email : d.phone;
|
|
1230
1256
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
1231
1257
|
"button",
|
|
1232
1258
|
{
|
|
1233
1259
|
type: "button",
|
|
1234
|
-
onClick: () => p(
|
|
1235
|
-
onKeyDown: (B) => T(B,
|
|
1260
|
+
onClick: () => p(d),
|
|
1261
|
+
onKeyDown: (B) => T(B, d),
|
|
1236
1262
|
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",
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1238
|
-
/* @__PURE__ */
|
|
1263
|
+
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1264
|
+
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1239
1265
|
/* @__PURE__ */ e(
|
|
1240
1266
|
Z,
|
|
1241
1267
|
{
|
|
1242
|
-
id:
|
|
1243
|
-
name:
|
|
1244
|
-
image:
|
|
1268
|
+
id: d.id,
|
|
1269
|
+
name: m,
|
|
1270
|
+
image: d.image,
|
|
1245
1271
|
size: 40
|
|
1246
1272
|
}
|
|
1247
1273
|
),
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
1274
|
+
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
1275
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
|
|
1250
1276
|
x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
|
|
1251
1277
|
] })
|
|
1252
1278
|
] }),
|
|
1253
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
1279
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: C === d.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
|
|
1254
1280
|
] })
|
|
1255
1281
|
}
|
|
1256
|
-
) },
|
|
1282
|
+
) }, d.id);
|
|
1257
1283
|
}),
|
|
1258
|
-
E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */
|
|
1284
|
+
E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
1259
1285
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
1260
1286
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
1261
1287
|
] }) })
|
|
1262
1288
|
] }) })
|
|
1263
1289
|
] });
|
|
1264
|
-
}, ps = ({ className: t }) => /* @__PURE__ */
|
|
1290
|
+
}, ps = ({ className: t }) => /* @__PURE__ */ i(
|
|
1265
1291
|
"svg",
|
|
1266
1292
|
{
|
|
1267
1293
|
width: "140",
|
|
@@ -1271,7 +1297,7 @@ const Ss = ({
|
|
|
1271
1297
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1272
1298
|
className: t,
|
|
1273
1299
|
children: [
|
|
1274
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
|
|
1275
1301
|
/* @__PURE__ */ e(
|
|
1276
1302
|
"path",
|
|
1277
1303
|
{
|
|
@@ -1300,7 +1326,7 @@ const Ss = ({
|
|
|
1300
1326
|
fill: "white"
|
|
1301
1327
|
}
|
|
1302
1328
|
),
|
|
1303
|
-
/* @__PURE__ */
|
|
1329
|
+
/* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
|
|
1304
1330
|
/* @__PURE__ */ e(
|
|
1305
1331
|
"path",
|
|
1306
1332
|
{
|
|
@@ -1340,8 +1366,8 @@ const Ss = ({
|
|
|
1340
1366
|
}
|
|
1341
1367
|
)
|
|
1342
1368
|
] }),
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1369
|
+
/* @__PURE__ */ i("defs", { children: [
|
|
1370
|
+
/* @__PURE__ */ i(
|
|
1345
1371
|
"filter",
|
|
1346
1372
|
{
|
|
1347
1373
|
id: "filter0_empty_state",
|
|
@@ -1395,17 +1421,17 @@ const Ss = ({
|
|
|
1395
1421
|
] })
|
|
1396
1422
|
]
|
|
1397
1423
|
}
|
|
1398
|
-
),
|
|
1399
|
-
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */
|
|
1424
|
+
), Fe = U.memo(
|
|
1425
|
+
({ 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: [
|
|
1400
1426
|
/* @__PURE__ */ e(ps, {}),
|
|
1401
|
-
s && !t && /* @__PURE__ */
|
|
1427
|
+
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1402
1428
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1403
1429
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1404
1430
|
] })
|
|
1405
1431
|
] }) })
|
|
1406
1432
|
);
|
|
1407
|
-
|
|
1408
|
-
const le =
|
|
1433
|
+
Fe.displayName = "EmptyState";
|
|
1434
|
+
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: [
|
|
1409
1435
|
/* @__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: "โ ๏ธ" }) }),
|
|
1410
1436
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
1411
1437
|
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
|
|
@@ -1420,38 +1446,38 @@ const le = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1420
1446
|
)
|
|
1421
1447
|
] }) }));
|
|
1422
1448
|
le.displayName = "ErrorState";
|
|
1423
|
-
const
|
|
1449
|
+
const Ps = ({
|
|
1424
1450
|
capabilities: t = {},
|
|
1425
1451
|
className: s,
|
|
1426
1452
|
renderMessageInputActions: n,
|
|
1427
1453
|
onChannelSelect: r,
|
|
1428
1454
|
onParticipantSelect: a,
|
|
1429
|
-
initialParticipantFilter:
|
|
1455
|
+
initialParticipantFilter: o,
|
|
1430
1456
|
initialParticipantData: l,
|
|
1431
1457
|
CustomChannelEmptyState: h,
|
|
1432
1458
|
showChannelList: f = !0,
|
|
1433
1459
|
filters: g,
|
|
1434
|
-
channelListCustomEmptyStateIndicator:
|
|
1435
|
-
onDeleteConversationClick:
|
|
1460
|
+
channelListCustomEmptyStateIndicator: N,
|
|
1461
|
+
onDeleteConversationClick: c,
|
|
1436
1462
|
onBlockParticipantClick: E,
|
|
1437
1463
|
onReportParticipantClick: R,
|
|
1438
1464
|
pendingAttachment: I,
|
|
1439
1465
|
onClearPendingAttachment: w
|
|
1440
1466
|
}) => {
|
|
1441
1467
|
const {
|
|
1442
|
-
service:
|
|
1443
|
-
client:
|
|
1468
|
+
service: C,
|
|
1469
|
+
client: u,
|
|
1444
1470
|
isConnected: b,
|
|
1445
1471
|
isLoading: S,
|
|
1446
1472
|
error: p,
|
|
1447
1473
|
refreshConnection: T,
|
|
1448
|
-
debug:
|
|
1449
|
-
} = os(), [
|
|
1474
|
+
debug: d
|
|
1475
|
+
} = os(), [m, x] = y(null), [B, A] = y(!1), [H, J] = y(!1), [he, q] = y(!1), [Q, X] = y(/* @__PURE__ */ new Set()), [K, ce] = y(0), [j, V] = y(!1), [F, _] = y(null), P = z(null), {
|
|
1450
1476
|
participantSource: $,
|
|
1451
1477
|
participantLabel: Y = "participants",
|
|
1452
|
-
showDeleteConversation:
|
|
1453
|
-
} = t,
|
|
1454
|
-
const v =
|
|
1478
|
+
showDeleteConversation: Te = !0
|
|
1479
|
+
} = t, Le = U.useMemo(() => {
|
|
1480
|
+
const v = u == null ? void 0 : u.userID;
|
|
1455
1481
|
return {
|
|
1456
1482
|
...{
|
|
1457
1483
|
type: "messaging",
|
|
@@ -1463,13 +1489,13 @@ const Us = ({
|
|
|
1463
1489
|
},
|
|
1464
1490
|
...g
|
|
1465
1491
|
};
|
|
1466
|
-
}, [g,
|
|
1467
|
-
if (!
|
|
1468
|
-
const v =
|
|
1492
|
+
}, [g, u == null ? void 0 : u.userID]), ee = z(null), W = D(async () => {
|
|
1493
|
+
if (!u || !b) return;
|
|
1494
|
+
const v = u.userID;
|
|
1469
1495
|
if (v)
|
|
1470
1496
|
try {
|
|
1471
|
-
|
|
1472
|
-
const O = await
|
|
1497
|
+
d && console.log("[MessagingShell] Syncing channels for user:", v);
|
|
1498
|
+
const O = await u.queryChannels(
|
|
1473
1499
|
{
|
|
1474
1500
|
type: "messaging",
|
|
1475
1501
|
members: { $in: [v] }
|
|
@@ -1479,59 +1505,59 @@ const Us = ({
|
|
|
1479
1505
|
), M = /* @__PURE__ */ new Set();
|
|
1480
1506
|
O.forEach((L) => {
|
|
1481
1507
|
const de = L.state.members;
|
|
1482
|
-
Object.values(de).forEach((
|
|
1508
|
+
Object.values(de).forEach((Be) => {
|
|
1483
1509
|
var fe;
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1510
|
+
const me = (fe = Be.user) == null ? void 0 : fe.id;
|
|
1511
|
+
me && me !== v && M.add(me);
|
|
1486
1512
|
});
|
|
1487
|
-
}), X((L) => L.size === M.size && [...L].every((de) => M.has(de)) ? L : M), A(O.length > 0), J(!0), ee.current = v,
|
|
1513
|
+
}), X((L) => L.size === M.size && [...L].every((de) => M.has(de)) ? L : M), A(O.length > 0), J(!0), ee.current = v, d && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1488
1514
|
channelCount: O.length,
|
|
1489
1515
|
memberCount: M.size
|
|
1490
1516
|
});
|
|
1491
1517
|
} catch (O) {
|
|
1492
1518
|
console.error("[MessagingShell] Failed to sync channels:", O);
|
|
1493
1519
|
}
|
|
1494
|
-
}, [
|
|
1520
|
+
}, [u, b, d]);
|
|
1495
1521
|
G(() => {
|
|
1496
|
-
if (!
|
|
1497
|
-
const v =
|
|
1522
|
+
if (!u || !b) return;
|
|
1523
|
+
const v = u.userID;
|
|
1498
1524
|
v && ee.current !== v && W();
|
|
1499
|
-
}, [
|
|
1500
|
-
if (!
|
|
1525
|
+
}, [u, b, W]), G(() => {
|
|
1526
|
+
if (!o || !u || !b) return;
|
|
1501
1527
|
(async () => {
|
|
1502
|
-
const O =
|
|
1528
|
+
const O = u.userID;
|
|
1503
1529
|
if (O)
|
|
1504
1530
|
try {
|
|
1505
|
-
|
|
1531
|
+
d && console.log(
|
|
1506
1532
|
"[MessagingShell] Loading initial conversation with:",
|
|
1507
|
-
|
|
1533
|
+
o
|
|
1508
1534
|
);
|
|
1509
|
-
const M = await
|
|
1535
|
+
const M = await u.queryChannels(
|
|
1510
1536
|
{
|
|
1511
1537
|
type: "messaging",
|
|
1512
|
-
members: { $eq: [O,
|
|
1538
|
+
members: { $eq: [O, o] }
|
|
1513
1539
|
},
|
|
1514
1540
|
{},
|
|
1515
1541
|
{ limit: 1 }
|
|
1516
1542
|
);
|
|
1517
1543
|
if (M.length > 0)
|
|
1518
|
-
x(M[0]), V(!0),
|
|
1544
|
+
x(M[0]), V(!0), _(null), r && r(M[0]), d && console.log(
|
|
1519
1545
|
"[MessagingShell] Initial conversation loaded:",
|
|
1520
1546
|
M[0].id
|
|
1521
1547
|
);
|
|
1522
|
-
else if (l &&
|
|
1523
|
-
|
|
1548
|
+
else if (l && C) {
|
|
1549
|
+
d && console.log(
|
|
1524
1550
|
"[MessagingShell] No conversation found, creating one for:",
|
|
1525
1551
|
l
|
|
1526
1552
|
);
|
|
1527
1553
|
try {
|
|
1528
|
-
const L = await
|
|
1554
|
+
const L = await C.startChannelWithParticipant({
|
|
1529
1555
|
id: l.id,
|
|
1530
1556
|
name: l.name,
|
|
1531
1557
|
email: l.email,
|
|
1532
1558
|
phone: l.phone
|
|
1533
1559
|
});
|
|
1534
|
-
x(L), V(!0),
|
|
1560
|
+
x(L), V(!0), _(null), r && r(L), d && console.log(
|
|
1535
1561
|
"[MessagingShell] Channel created and loaded:",
|
|
1536
1562
|
L.id
|
|
1537
1563
|
);
|
|
@@ -1539,48 +1565,48 @@ const Us = ({
|
|
|
1539
1565
|
console.error(
|
|
1540
1566
|
"[MessagingShell] Failed to create conversation:",
|
|
1541
1567
|
L
|
|
1542
|
-
),
|
|
1568
|
+
), _("Failed to create conversation");
|
|
1543
1569
|
}
|
|
1544
1570
|
} else
|
|
1545
|
-
|
|
1571
|
+
_(
|
|
1546
1572
|
"No conversation found with this account"
|
|
1547
|
-
),
|
|
1573
|
+
), d && console.log(
|
|
1548
1574
|
"[MessagingShell] No conversation found for:",
|
|
1549
|
-
|
|
1575
|
+
o
|
|
1550
1576
|
);
|
|
1551
1577
|
} catch (M) {
|
|
1552
1578
|
console.error(
|
|
1553
1579
|
"[MessagingShell] Failed to load initial conversation:",
|
|
1554
1580
|
M
|
|
1555
|
-
),
|
|
1581
|
+
), _("Failed to load conversation");
|
|
1556
1582
|
}
|
|
1557
1583
|
})();
|
|
1558
1584
|
}, [
|
|
1559
|
-
|
|
1585
|
+
o,
|
|
1560
1586
|
l,
|
|
1561
|
-
|
|
1587
|
+
u,
|
|
1562
1588
|
b,
|
|
1563
|
-
|
|
1564
|
-
|
|
1589
|
+
C,
|
|
1590
|
+
d,
|
|
1565
1591
|
r
|
|
1566
1592
|
]);
|
|
1567
|
-
const
|
|
1593
|
+
const Ue = D(
|
|
1568
1594
|
(v) => {
|
|
1569
1595
|
x(v), r == null || r(v);
|
|
1570
1596
|
},
|
|
1571
1597
|
[r]
|
|
1572
|
-
), Pe =
|
|
1598
|
+
), Pe = D(() => {
|
|
1573
1599
|
j || x(null);
|
|
1574
|
-
}, [j]),
|
|
1600
|
+
}, [j]), Oe = D(
|
|
1575
1601
|
async (v) => {
|
|
1576
1602
|
var O;
|
|
1577
|
-
if (
|
|
1603
|
+
if (C)
|
|
1578
1604
|
try {
|
|
1579
|
-
|
|
1605
|
+
d && console.log(
|
|
1580
1606
|
"[MessagingShell] Starting conversation with:",
|
|
1581
1607
|
v.id
|
|
1582
1608
|
);
|
|
1583
|
-
const M = await
|
|
1609
|
+
const M = await C.startChannelWithParticipant({
|
|
1584
1610
|
id: v.id,
|
|
1585
1611
|
name: v.name,
|
|
1586
1612
|
email: v.email,
|
|
@@ -1591,38 +1617,38 @@ const Us = ({
|
|
|
1591
1617
|
} catch (L) {
|
|
1592
1618
|
console.warn("[MessagingShell] Failed to unhide channel:", L);
|
|
1593
1619
|
}
|
|
1594
|
-
x(M), q(!1), (O =
|
|
1620
|
+
x(M), q(!1), (O = P.current) == null || O.close(), a == null || a(v);
|
|
1595
1621
|
} catch (M) {
|
|
1596
1622
|
console.error("[MessagingShell] Failed to start conversation:", M);
|
|
1597
1623
|
}
|
|
1598
1624
|
},
|
|
1599
|
-
[
|
|
1600
|
-
), se =
|
|
1625
|
+
[C, a, d]
|
|
1626
|
+
), se = D(() => {
|
|
1601
1627
|
var v;
|
|
1602
|
-
q(!1), (v =
|
|
1603
|
-
}, []),
|
|
1628
|
+
q(!1), (v = P.current) == null || v.close();
|
|
1629
|
+
}, []), je = D(
|
|
1604
1630
|
(v) => {
|
|
1605
|
-
v.target ===
|
|
1631
|
+
v.target === P.current && se();
|
|
1606
1632
|
},
|
|
1607
1633
|
[se]
|
|
1608
|
-
),
|
|
1634
|
+
), Ae = D(
|
|
1609
1635
|
async (v) => {
|
|
1610
|
-
|
|
1636
|
+
d && console.log("[MessagingShell] Leaving conversation:", v.id), x(null), V(!1), ee.current = null, await W();
|
|
1611
1637
|
},
|
|
1612
|
-
[W,
|
|
1613
|
-
),
|
|
1638
|
+
[W, d]
|
|
1639
|
+
), ze = D(
|
|
1614
1640
|
async (v) => {
|
|
1615
|
-
|
|
1641
|
+
d && console.log("[MessagingShell] Blocking participant:", v), x(null), V(!1), ee.current = null, await W();
|
|
1616
1642
|
},
|
|
1617
|
-
[W,
|
|
1618
|
-
), te = !!
|
|
1619
|
-
return S ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : p ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(le, { message: p, onBack: T }) }) : !b || !
|
|
1643
|
+
[W, d]
|
|
1644
|
+
), te = !!m;
|
|
1645
|
+
return S ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : p ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(le, { message: p, onBack: T }) }) : !b || !u ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(
|
|
1620
1646
|
le,
|
|
1621
1647
|
{
|
|
1622
1648
|
message: "Not connected to messaging service",
|
|
1623
1649
|
onBack: T
|
|
1624
1650
|
}
|
|
1625
|
-
) }) : F ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(le, { message: F }) }) : /* @__PURE__ */
|
|
1651
|
+
) }) : F ? /* @__PURE__ */ e("div", { className: k("h-full", s), children: /* @__PURE__ */ e(le, { message: F }) }) : /* @__PURE__ */ i(
|
|
1626
1652
|
"div",
|
|
1627
1653
|
{
|
|
1628
1654
|
className: k(
|
|
@@ -1630,7 +1656,7 @@ const Us = ({
|
|
|
1630
1656
|
s
|
|
1631
1657
|
),
|
|
1632
1658
|
children: [
|
|
1633
|
-
/* @__PURE__ */
|
|
1659
|
+
/* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
|
|
1634
1660
|
/* @__PURE__ */ e(
|
|
1635
1661
|
"div",
|
|
1636
1662
|
{
|
|
@@ -1645,12 +1671,12 @@ const Us = ({
|
|
|
1645
1671
|
}
|
|
1646
1672
|
),
|
|
1647
1673
|
children: /* @__PURE__ */ e(
|
|
1648
|
-
|
|
1674
|
+
ke,
|
|
1649
1675
|
{
|
|
1650
|
-
onChannelSelect:
|
|
1651
|
-
selectedChannel:
|
|
1652
|
-
filters:
|
|
1653
|
-
customEmptyStateIndicator:
|
|
1676
|
+
onChannelSelect: Ue,
|
|
1677
|
+
selectedChannel: m || void 0,
|
|
1678
|
+
filters: Le,
|
|
1679
|
+
customEmptyStateIndicator: N
|
|
1654
1680
|
}
|
|
1655
1681
|
)
|
|
1656
1682
|
}
|
|
@@ -1662,34 +1688,34 @@ const Us = ({
|
|
|
1662
1688
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
1663
1689
|
{
|
|
1664
1690
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
1665
|
-
flex: j || te ||
|
|
1691
|
+
flex: j || te || o,
|
|
1666
1692
|
// Normal mode: hide on mobile when no channel selected
|
|
1667
|
-
"hidden lg:flex": !j && !te && !
|
|
1693
|
+
"hidden lg:flex": !j && !te && !o
|
|
1668
1694
|
}
|
|
1669
1695
|
),
|
|
1670
|
-
children:
|
|
1671
|
-
|
|
1696
|
+
children: m ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
1697
|
+
Me,
|
|
1672
1698
|
{
|
|
1673
|
-
channel:
|
|
1699
|
+
channel: m,
|
|
1674
1700
|
onBack: Pe,
|
|
1675
1701
|
showBackButton: !j,
|
|
1676
1702
|
renderMessageInputActions: n,
|
|
1677
|
-
onLeaveConversation:
|
|
1678
|
-
onBlockParticipant:
|
|
1703
|
+
onLeaveConversation: Ae,
|
|
1704
|
+
onBlockParticipant: ze,
|
|
1679
1705
|
CustomChannelEmptyState: h,
|
|
1680
|
-
showDeleteConversation:
|
|
1681
|
-
onDeleteConversationClick:
|
|
1706
|
+
showDeleteConversation: Te,
|
|
1707
|
+
onDeleteConversationClick: c,
|
|
1682
1708
|
onBlockParticipantClick: E,
|
|
1683
1709
|
onReportParticipantClick: R,
|
|
1684
1710
|
pendingAttachment: I,
|
|
1685
1711
|
onClearPendingAttachment: w
|
|
1686
1712
|
},
|
|
1687
|
-
|
|
1688
|
-
) }) :
|
|
1713
|
+
m.id
|
|
1714
|
+
) }) : o ? (
|
|
1689
1715
|
// Show loading while creating/loading direct conversation channel
|
|
1690
1716
|
/* @__PURE__ */ e(ae, {})
|
|
1691
1717
|
) : /* @__PURE__ */ e(
|
|
1692
|
-
|
|
1718
|
+
Fe,
|
|
1693
1719
|
{
|
|
1694
1720
|
hasChannels: B,
|
|
1695
1721
|
channelsLoaded: H
|
|
@@ -1702,15 +1728,15 @@ const Us = ({
|
|
|
1702
1728
|
/* @__PURE__ */ e(
|
|
1703
1729
|
"dialog",
|
|
1704
1730
|
{
|
|
1705
|
-
ref:
|
|
1731
|
+
ref: P,
|
|
1706
1732
|
className: "mes-dialog",
|
|
1707
|
-
onClick:
|
|
1733
|
+
onClick: je,
|
|
1708
1734
|
onClose: se,
|
|
1709
1735
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
1710
1736
|
Ss,
|
|
1711
1737
|
{
|
|
1712
1738
|
participantSource: $,
|
|
1713
|
-
onSelectParticipant:
|
|
1739
|
+
onSelectParticipant: Oe,
|
|
1714
1740
|
onClose: se,
|
|
1715
1741
|
existingParticipantIds: Q,
|
|
1716
1742
|
participantLabel: Y,
|
|
@@ -1751,22 +1777,22 @@ const Us = ({
|
|
|
1751
1777
|
loadingFaqId: n,
|
|
1752
1778
|
headerText: r,
|
|
1753
1779
|
className: a,
|
|
1754
|
-
avatarImage:
|
|
1780
|
+
avatarImage: o,
|
|
1755
1781
|
avatarName: l
|
|
1756
1782
|
}) => {
|
|
1757
1783
|
const h = t.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
|
|
1758
|
-
return h.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */
|
|
1759
|
-
(
|
|
1784
|
+
return h.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
1785
|
+
(o || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
1760
1786
|
Z,
|
|
1761
1787
|
{
|
|
1762
1788
|
id: l || "account",
|
|
1763
1789
|
name: l || "Account",
|
|
1764
|
-
image:
|
|
1790
|
+
image: o,
|
|
1765
1791
|
size: 24,
|
|
1766
1792
|
shape: "circle"
|
|
1767
1793
|
}
|
|
1768
1794
|
) }),
|
|
1769
|
-
/* @__PURE__ */
|
|
1795
|
+
/* @__PURE__ */ i(
|
|
1770
1796
|
"div",
|
|
1771
1797
|
{
|
|
1772
1798
|
className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
|
|
@@ -1787,55 +1813,55 @@ const Us = ({
|
|
|
1787
1813
|
)
|
|
1788
1814
|
] }) });
|
|
1789
1815
|
}, js = (t, s = {}) => {
|
|
1790
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [a,
|
|
1816
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [a, o] = y([]), [l, h] = y(!1), [f, g] = y(null), [N, c] = y(n), [E, R] = y(!0), [I, w] = y(), C = D(async (p = !1, T) => {
|
|
1791
1817
|
if (l) return;
|
|
1792
|
-
const
|
|
1818
|
+
const d = T !== void 0 ? T : N;
|
|
1793
1819
|
h(!0), g(null);
|
|
1794
1820
|
try {
|
|
1795
|
-
const
|
|
1796
|
-
search:
|
|
1821
|
+
const m = await t.loadParticipants({
|
|
1822
|
+
search: d || void 0,
|
|
1797
1823
|
limit: r,
|
|
1798
1824
|
cursor: p ? void 0 : I
|
|
1799
1825
|
});
|
|
1800
|
-
|
|
1801
|
-
(x) => p ?
|
|
1802
|
-
), R(
|
|
1803
|
-
} catch (
|
|
1804
|
-
const x =
|
|
1805
|
-
g(x), console.error("[useParticipants] Load error:",
|
|
1826
|
+
o(
|
|
1827
|
+
(x) => p ? m.participants : [...x, ...m.participants]
|
|
1828
|
+
), R(m.hasMore), w(m.nextCursor);
|
|
1829
|
+
} catch (m) {
|
|
1830
|
+
const x = m instanceof Error ? m.message : "Failed to load participants";
|
|
1831
|
+
g(x), console.error("[useParticipants] Load error:", m);
|
|
1806
1832
|
} finally {
|
|
1807
1833
|
h(!1);
|
|
1808
1834
|
}
|
|
1809
|
-
}, [t,
|
|
1810
|
-
E && !l &&
|
|
1811
|
-
}, [E, l,
|
|
1812
|
-
|
|
1813
|
-
}, [
|
|
1814
|
-
w(void 0),
|
|
1815
|
-
}, [
|
|
1835
|
+
}, [t, N, I, r, l]), u = D(() => {
|
|
1836
|
+
E && !l && C(!1);
|
|
1837
|
+
}, [E, l, C]), b = D((p) => {
|
|
1838
|
+
c(p), w(void 0), C(!0, p);
|
|
1839
|
+
}, [C]), S = D(() => {
|
|
1840
|
+
w(void 0), C(!0);
|
|
1841
|
+
}, [C]);
|
|
1816
1842
|
return G(() => {
|
|
1817
|
-
|
|
1843
|
+
C(!0);
|
|
1818
1844
|
}, [t.loadParticipants]), {
|
|
1819
1845
|
participants: a,
|
|
1820
1846
|
loading: l,
|
|
1821
1847
|
error: f,
|
|
1822
|
-
searchQuery:
|
|
1848
|
+
searchQuery: N,
|
|
1823
1849
|
hasMore: E,
|
|
1824
1850
|
totalCount: t.totalCount,
|
|
1825
|
-
loadMore:
|
|
1851
|
+
loadMore: u,
|
|
1826
1852
|
search: b,
|
|
1827
1853
|
refresh: S
|
|
1828
1854
|
};
|
|
1829
1855
|
};
|
|
1830
1856
|
export {
|
|
1831
1857
|
Z as Avatar,
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1858
|
+
Cs as ChannelEmptyState,
|
|
1859
|
+
ke as ChannelList,
|
|
1860
|
+
Me as ChannelView,
|
|
1835
1861
|
Os as FaqList,
|
|
1836
1862
|
ks as FaqListItem,
|
|
1837
|
-
|
|
1838
|
-
|
|
1863
|
+
Us as MessagingProvider,
|
|
1864
|
+
Ps as MessagingShell,
|
|
1839
1865
|
Ss as ParticipantPicker,
|
|
1840
1866
|
cs as formatRelativeTime,
|
|
1841
1867
|
os as useMessaging,
|