@linktr.ee/messaging-react 1.3.0 → 1.4.0-rc-1761053580
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +17 -0
- package/dist/index.js +724 -629
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/index.tsx +1 -1
- package/src/components/ChannelView.tsx +7 -2
- package/src/components/MessagingShell/EmptyState.tsx +1 -1
- package/src/components/MessagingShell/ErrorState.stories.tsx +9 -9
- package/src/components/MessagingShell/ErrorState.tsx +18 -20
- package/src/components/MessagingShell/LoadingState.tsx +1 -1
- package/src/components/MessagingShell/index.tsx +154 -13
- package/src/components/ParticipantPicker/ParticipantPicker.tsx +6 -1
- package/src/types.ts +80 -58
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { StreamChatService as
|
|
5
|
-
import { Chat as
|
|
6
|
-
import { NotePencilIcon as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import P from "classnames";
|
|
3
|
+
import Q, { createContext as Ne, useContext as Ce, useCallback as M, useState as E, useRef as H, useEffect as G } from "react";
|
|
4
|
+
import { StreamChatService as be } from "@linktr.ee/messaging-core";
|
|
5
|
+
import { Chat as ve, useChatContext as we, ChannelList as Ee, Channel as Ie, Window as ye, MessageList as Se, useChannelStateContext as Re, MessageInput as ke } from "stream-chat-react";
|
|
6
|
+
import { NotePencilIcon as Te, XIcon as de, ArrowLeftIcon as Pe, DotsThreeIcon as De, SpinnerGapIcon as K, SignOutIcon as Me, ProhibitInsetIcon as ae, FlagIcon as Oe, MagnifyingGlassIcon as Ue, ChatCircleDotsIcon as ie } from "@phosphor-icons/react";
|
|
7
|
+
const ue = Ne({
|
|
8
8
|
service: null,
|
|
9
9
|
client: null,
|
|
10
10
|
isConnected: !1,
|
|
@@ -15,101 +15,101 @@ const ae = ue({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}),
|
|
19
|
-
children:
|
|
18
|
+
}), ee = () => Ce(ue), Ke = ({
|
|
19
|
+
children: n,
|
|
20
20
|
user: s,
|
|
21
|
-
serviceConfig:
|
|
22
|
-
apiKey:
|
|
21
|
+
serviceConfig: t,
|
|
22
|
+
apiKey: o,
|
|
23
23
|
capabilities: a = {},
|
|
24
|
-
customization:
|
|
24
|
+
customization: c = {},
|
|
25
25
|
debug: d = !1
|
|
26
26
|
}) => {
|
|
27
|
-
const r =
|
|
28
|
-
(
|
|
29
|
-
d && console.log(`🔥 [MessagingProvider] ${
|
|
27
|
+
const r = M(
|
|
28
|
+
(f, ...S) => {
|
|
29
|
+
d && console.log(`🔥 [MessagingProvider] ${f}`, ...S);
|
|
30
30
|
},
|
|
31
31
|
[d]
|
|
32
32
|
);
|
|
33
33
|
r("🔄 RENDER START", {
|
|
34
34
|
userId: s == null ? void 0 : s.id,
|
|
35
|
-
apiKey: (
|
|
36
|
-
serviceConfig: !!
|
|
35
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
36
|
+
serviceConfig: !!t,
|
|
37
37
|
capabilities: Object.keys(a),
|
|
38
|
-
customization: Object.keys(
|
|
38
|
+
customization: Object.keys(c)
|
|
39
39
|
});
|
|
40
|
-
const [
|
|
40
|
+
const [l, b] = E(null), [x, v] = E(null), [u, m] = E(!1), [C, w] = E(!1), [y, D] = E(null), O = H(!1), I = H({
|
|
41
41
|
userId: s == null ? void 0 : s.id,
|
|
42
|
-
apiKey:
|
|
43
|
-
serviceConfig:
|
|
42
|
+
apiKey: o,
|
|
43
|
+
serviceConfig: t,
|
|
44
44
|
capabilities: a,
|
|
45
|
-
customization:
|
|
46
|
-
}), R =
|
|
45
|
+
customization: c
|
|
46
|
+
}), R = H(0);
|
|
47
47
|
R.current++, r("📊 RENDER INFO", {
|
|
48
48
|
renderCount: R.current,
|
|
49
|
-
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (
|
|
49
|
+
currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
|
|
50
50
|
propChanges: {
|
|
51
|
-
userChanged:
|
|
52
|
-
apiKeyChanged:
|
|
53
|
-
serviceConfigChanged:
|
|
54
|
-
capabilitiesChanged:
|
|
55
|
-
customizationChanged:
|
|
51
|
+
userChanged: I.current.userId !== (s == null ? void 0 : s.id),
|
|
52
|
+
apiKeyChanged: I.current.apiKey !== o,
|
|
53
|
+
serviceConfigChanged: I.current.serviceConfig !== t,
|
|
54
|
+
capabilitiesChanged: I.current.capabilities !== a,
|
|
55
|
+
customizationChanged: I.current.customization !== c
|
|
56
56
|
}
|
|
57
|
-
}),
|
|
57
|
+
}), I.current = {
|
|
58
58
|
userId: s == null ? void 0 : s.id,
|
|
59
|
-
apiKey:
|
|
60
|
-
serviceConfig:
|
|
59
|
+
apiKey: o,
|
|
60
|
+
serviceConfig: t,
|
|
61
61
|
capabilities: a,
|
|
62
|
-
customization:
|
|
63
|
-
},
|
|
64
|
-
const
|
|
62
|
+
customization: c
|
|
63
|
+
}, G(() => {
|
|
64
|
+
const f = R.current;
|
|
65
65
|
if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
|
|
66
|
-
renderCount:
|
|
67
|
-
apiKey: !!
|
|
68
|
-
serviceConfig: !!
|
|
66
|
+
renderCount: f,
|
|
67
|
+
apiKey: !!o,
|
|
68
|
+
serviceConfig: !!t,
|
|
69
69
|
dependencies: {
|
|
70
|
-
apiKey: (
|
|
71
|
-
serviceConfigRef:
|
|
72
|
-
serviceConfigStable:
|
|
73
|
-
apiKeyStable:
|
|
70
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
71
|
+
serviceConfigRef: t,
|
|
72
|
+
serviceConfigStable: I.current.serviceConfig === t,
|
|
73
|
+
apiKeyStable: I.current.apiKey === o
|
|
74
74
|
}
|
|
75
|
-
}), !
|
|
75
|
+
}), !o || !t) {
|
|
76
76
|
r("⚠️ SERVICE INIT SKIPPED", {
|
|
77
|
-
renderCount:
|
|
77
|
+
renderCount: f,
|
|
78
78
|
reason: "Missing apiKey or serviceConfig"
|
|
79
79
|
});
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
r("🚀 CREATING NEW SERVICE", {
|
|
83
|
-
renderCount:
|
|
84
|
-
apiKey: (
|
|
85
|
-
serviceConfigChanged:
|
|
83
|
+
renderCount: f,
|
|
84
|
+
apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
|
|
85
|
+
serviceConfigChanged: I.current.serviceConfig !== t
|
|
86
86
|
});
|
|
87
|
-
const S = new
|
|
88
|
-
...
|
|
89
|
-
apiKey:
|
|
87
|
+
const S = new be({
|
|
88
|
+
...t,
|
|
89
|
+
apiKey: o,
|
|
90
90
|
debug: d
|
|
91
91
|
});
|
|
92
|
-
return
|
|
93
|
-
renderCount:
|
|
92
|
+
return b(S), r("✅ SERVICE SET", {
|
|
93
|
+
renderCount: f,
|
|
94
94
|
serviceInstance: !!S
|
|
95
95
|
}), () => {
|
|
96
96
|
r("🧹 SERVICE CLEANUP", {
|
|
97
|
-
renderCount:
|
|
97
|
+
renderCount: f,
|
|
98
98
|
reason: "Effect cleanup"
|
|
99
99
|
}), S.disconnectUser().catch(console.error);
|
|
100
100
|
};
|
|
101
|
-
}, [
|
|
102
|
-
const T =
|
|
103
|
-
|
|
104
|
-
var S,
|
|
101
|
+
}, [o, t, d, r]);
|
|
102
|
+
const T = H(null);
|
|
103
|
+
G(() => {
|
|
104
|
+
var S, V;
|
|
105
105
|
if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
|
|
106
|
-
hasService: !!
|
|
106
|
+
hasService: !!l,
|
|
107
107
|
hasUser: !!s,
|
|
108
108
|
userId: s == null ? void 0 : s.id,
|
|
109
109
|
isConnecting: O.current,
|
|
110
|
-
isConnected:
|
|
111
|
-
dependencies: { service: !!
|
|
112
|
-
}), !
|
|
110
|
+
isConnected: u,
|
|
111
|
+
dependencies: { service: !!l, userId: s == null ? void 0 : s.id }
|
|
112
|
+
}), !l || !s) {
|
|
113
113
|
r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
@@ -117,7 +117,7 @@ const ae = ue({
|
|
|
117
117
|
r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
120
|
-
if (((S = T.current) == null ? void 0 : S.serviceId) ===
|
|
120
|
+
if (((S = T.current) == null ? void 0 : S.serviceId) === l && ((V = T.current) == null ? void 0 : V.userId) === s.id) {
|
|
121
121
|
r(
|
|
122
122
|
"⚠️ USER CONNECTION SKIPPED",
|
|
123
123
|
"Already connected this user with this service"
|
|
@@ -125,119 +125,119 @@ const ae = ue({
|
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
(async () => {
|
|
128
|
-
r("🚀 STARTING USER CONNECTION", { userId: s.id }), O.current = !0,
|
|
128
|
+
r("🚀 STARTING USER CONNECTION", { userId: s.id }), O.current = !0, w(!0), D(null);
|
|
129
129
|
try {
|
|
130
130
|
r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
|
|
131
|
-
const
|
|
132
|
-
|
|
131
|
+
const U = await l.connectUser(s);
|
|
132
|
+
v(U), m(!0), T.current = { serviceId: l, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
|
|
133
133
|
userId: s.id,
|
|
134
|
-
clientId:
|
|
134
|
+
clientId: U.userID
|
|
135
135
|
});
|
|
136
|
-
} catch (
|
|
137
|
-
const
|
|
138
|
-
|
|
136
|
+
} catch (U) {
|
|
137
|
+
const j = U instanceof Error ? U.message : "Connection failed";
|
|
138
|
+
D(j), r("❌ USER CONNECTION ERROR", {
|
|
139
139
|
userId: s.id,
|
|
140
|
-
error:
|
|
140
|
+
error: j
|
|
141
141
|
});
|
|
142
142
|
} finally {
|
|
143
|
-
|
|
143
|
+
w(!1), O.current = !1, r("🔄 USER CONNECTION FINISHED", {
|
|
144
144
|
userId: s.id,
|
|
145
|
-
isConnected:
|
|
145
|
+
isConnected: u
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
})();
|
|
149
|
-
}, [
|
|
150
|
-
hasService: !!
|
|
151
|
-
isConnected:
|
|
149
|
+
}, [l, s, r, u]), G(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
|
|
150
|
+
hasService: !!l,
|
|
151
|
+
isConnected: u
|
|
152
152
|
}), () => {
|
|
153
|
-
|
|
153
|
+
l && u ? (r(
|
|
154
154
|
"🧹 CLEANUP EFFECT TRIGGERED",
|
|
155
155
|
"Cleaning up connection on unmount"
|
|
156
|
-
), T.current = null,
|
|
157
|
-
hasService: !!
|
|
158
|
-
isConnected:
|
|
156
|
+
), T.current = null, l.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
|
|
157
|
+
hasService: !!l,
|
|
158
|
+
isConnected: u
|
|
159
159
|
});
|
|
160
|
-
}), [
|
|
161
|
-
const
|
|
160
|
+
}), [l, u, r]);
|
|
161
|
+
const h = M(async () => {
|
|
162
162
|
if (r("🔄 REFRESH CONNECTION CALLED", {
|
|
163
|
-
hasService: !!
|
|
163
|
+
hasService: !!l,
|
|
164
164
|
hasUser: !!s
|
|
165
|
-
}), !
|
|
165
|
+
}), !l || !s) {
|
|
166
166
|
r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }),
|
|
169
|
+
r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
|
|
170
170
|
try {
|
|
171
|
-
r("🔌 DISCONNECTING FOR REFRESH"), await
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
} catch (
|
|
175
|
-
const S =
|
|
176
|
-
|
|
171
|
+
r("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
|
|
172
|
+
const f = await l.connectUser(s);
|
|
173
|
+
v(f), m(!0), D(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
|
|
174
|
+
} catch (f) {
|
|
175
|
+
const S = f instanceof Error ? f.message : "Refresh failed";
|
|
176
|
+
D(S), r("❌ CONNECTION REFRESH ERROR", {
|
|
177
177
|
userId: s.id,
|
|
178
178
|
error: S
|
|
179
179
|
});
|
|
180
180
|
} finally {
|
|
181
|
-
|
|
181
|
+
w(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
|
|
182
182
|
}
|
|
183
|
-
}, [
|
|
184
|
-
hasService: !!
|
|
183
|
+
}, [l, s, r]), g = Q.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
|
|
184
|
+
hasService: !!l,
|
|
185
185
|
hasClient: !!x,
|
|
186
|
-
isConnected:
|
|
187
|
-
isLoading:
|
|
188
|
-
hasError: !!
|
|
186
|
+
isConnected: u,
|
|
187
|
+
isLoading: C,
|
|
188
|
+
hasError: !!y,
|
|
189
189
|
capabilitiesKeys: Object.keys(a),
|
|
190
|
-
customizationKeys: Object.keys(
|
|
190
|
+
customizationKeys: Object.keys(c)
|
|
191
191
|
}), {
|
|
192
|
-
service:
|
|
192
|
+
service: l,
|
|
193
193
|
client: x,
|
|
194
|
-
isConnected:
|
|
195
|
-
isLoading:
|
|
196
|
-
error:
|
|
194
|
+
isConnected: u,
|
|
195
|
+
isLoading: C,
|
|
196
|
+
error: y,
|
|
197
197
|
capabilities: a,
|
|
198
|
-
customization:
|
|
199
|
-
refreshConnection:
|
|
198
|
+
customization: c,
|
|
199
|
+
refreshConnection: h,
|
|
200
200
|
debug: d
|
|
201
201
|
}), [
|
|
202
|
-
|
|
202
|
+
l,
|
|
203
203
|
x,
|
|
204
|
-
c,
|
|
205
|
-
b,
|
|
206
|
-
I,
|
|
207
|
-
a,
|
|
208
|
-
m,
|
|
209
204
|
u,
|
|
205
|
+
C,
|
|
206
|
+
y,
|
|
207
|
+
a,
|
|
208
|
+
c,
|
|
209
|
+
h,
|
|
210
210
|
d,
|
|
211
211
|
r
|
|
212
212
|
]);
|
|
213
213
|
return r("🔄 RENDER END", {
|
|
214
214
|
renderCount: R.current,
|
|
215
|
-
willRenderChat: !!(x &&
|
|
216
|
-
contextValueReady: !!
|
|
217
|
-
}), /* @__PURE__ */ e(
|
|
218
|
-
},
|
|
219
|
-
function
|
|
215
|
+
willRenderChat: !!(x && u),
|
|
216
|
+
contextValueReady: !!g
|
|
217
|
+
}), /* @__PURE__ */ e(ue.Provider, { value: g, children: x && u ? /* @__PURE__ */ e(ve, { client: x, children: n }) : n });
|
|
218
|
+
}, Le = () => ee();
|
|
219
|
+
function se({ label: n, className: s, children: t, ...o }) {
|
|
220
220
|
return /* @__PURE__ */ i(
|
|
221
221
|
"button",
|
|
222
222
|
{
|
|
223
223
|
type: "button",
|
|
224
|
-
className:
|
|
224
|
+
className: P(
|
|
225
225
|
"rounded-full p-2 transition-colors focus-ring",
|
|
226
226
|
{
|
|
227
|
-
"cursor-not-allowed opacity-50":
|
|
228
|
-
"hover:bg-sand": !
|
|
227
|
+
"cursor-not-allowed opacity-50": o.disabled,
|
|
228
|
+
"hover:bg-sand": !o.disabled
|
|
229
229
|
},
|
|
230
230
|
s
|
|
231
231
|
),
|
|
232
|
-
...
|
|
232
|
+
...o,
|
|
233
233
|
children: [
|
|
234
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children:
|
|
235
|
-
|
|
234
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: n }),
|
|
235
|
+
t
|
|
236
236
|
]
|
|
237
237
|
}
|
|
238
238
|
);
|
|
239
239
|
}
|
|
240
|
-
function
|
|
240
|
+
function Fe(n) {
|
|
241
241
|
const s = [
|
|
242
242
|
{ color: "#8129D9" },
|
|
243
243
|
// purple
|
|
@@ -264,32 +264,32 @@ function Te(t) {
|
|
|
264
264
|
{ color: "#70764d" }
|
|
265
265
|
// olive green
|
|
266
266
|
];
|
|
267
|
-
let
|
|
268
|
-
for (let a = 0; a <
|
|
269
|
-
|
|
270
|
-
const
|
|
271
|
-
return s[
|
|
267
|
+
let t = 0;
|
|
268
|
+
for (let a = 0; a < n.length; a++)
|
|
269
|
+
t = (t << 5) - t + n.charCodeAt(a), t = t & t;
|
|
270
|
+
const o = Math.abs(t) % s.length;
|
|
271
|
+
return s[o];
|
|
272
272
|
}
|
|
273
|
-
const
|
|
274
|
-
id:
|
|
273
|
+
const ne = ({
|
|
274
|
+
id: n,
|
|
275
275
|
name: s,
|
|
276
|
-
image:
|
|
277
|
-
size:
|
|
276
|
+
image: t,
|
|
277
|
+
size: o = 40,
|
|
278
278
|
className: a
|
|
279
279
|
}) => {
|
|
280
|
-
const { color:
|
|
280
|
+
const { color: c } = Fe(n), d = s.charAt(0).toUpperCase(), l = o < 32 ? "text-xs" : o < 56 ? "text-sm" : "text-lg";
|
|
281
281
|
return /* @__PURE__ */ e(
|
|
282
282
|
"div",
|
|
283
283
|
{
|
|
284
|
-
className:
|
|
284
|
+
className: P(
|
|
285
285
|
"flex-shrink-0 overflow-hidden rounded-full",
|
|
286
286
|
a
|
|
287
287
|
),
|
|
288
|
-
style: { width: `${
|
|
289
|
-
children:
|
|
288
|
+
style: { width: `${o}px`, height: `${o}px` },
|
|
289
|
+
children: t ? /* @__PURE__ */ e(
|
|
290
290
|
"img",
|
|
291
291
|
{
|
|
292
|
-
src:
|
|
292
|
+
src: t,
|
|
293
293
|
alt: "",
|
|
294
294
|
className: "h-full w-full object-cover aspect-square"
|
|
295
295
|
}
|
|
@@ -297,44 +297,44 @@ const Y = ({
|
|
|
297
297
|
"div",
|
|
298
298
|
{
|
|
299
299
|
"aria-hidden": "true",
|
|
300
|
-
className:
|
|
300
|
+
className: P(
|
|
301
301
|
"flex h-full w-full items-center justify-center font-semibold",
|
|
302
|
-
|
|
302
|
+
l
|
|
303
303
|
),
|
|
304
304
|
style: {
|
|
305
|
-
color:
|
|
306
|
-
backgroundColor: `color-mix(in srgb, ${
|
|
305
|
+
color: c,
|
|
306
|
+
backgroundColor: `color-mix(in srgb, ${c} 20%, transparent)`
|
|
307
307
|
},
|
|
308
308
|
children: d
|
|
309
309
|
}
|
|
310
310
|
)
|
|
311
311
|
}
|
|
312
312
|
);
|
|
313
|
-
},
|
|
314
|
-
var
|
|
315
|
-
const a = (s == null ? void 0 : s.id) === (
|
|
316
|
-
|
|
317
|
-
}, r = Object.values(((
|
|
313
|
+
}, pe = ({ channel: n, selectedChannel: s, onChannelSelect: t, debug: o = !1 }) => {
|
|
314
|
+
var C, w, y, D, O, I, R;
|
|
315
|
+
const a = (s == null ? void 0 : s.id) === (n == null ? void 0 : n.id), c = () => {
|
|
316
|
+
n && t(n);
|
|
317
|
+
}, r = Object.values(((C = n == null ? void 0 : n.state) == null ? void 0 : C.members) || {}).find(
|
|
318
318
|
(T) => {
|
|
319
|
-
var
|
|
320
|
-
return ((
|
|
319
|
+
var h, g;
|
|
320
|
+
return ((h = T.user) == null ? void 0 : h.id) && T.user.id !== ((g = n == null ? void 0 : n._client) == null ? void 0 : g.userID);
|
|
321
321
|
}
|
|
322
|
-
),
|
|
322
|
+
), l = ((w = r == null ? void 0 : r.user) == null ? void 0 : w.name) || "Conversation", b = (y = r == null ? void 0 : r.user) == null ? void 0 : y.image, x = (O = (D = n == null ? void 0 : n.state) == null ? void 0 : D.messages) == null ? void 0 : O[n.state.messages.length - 1], v = (x == null ? void 0 : x.text) || "No messages yet", u = x != null && x.created_at ? new Date(x.created_at).toLocaleTimeString([], {
|
|
323
323
|
hour: "2-digit",
|
|
324
324
|
minute: "2-digit"
|
|
325
|
-
}) : "",
|
|
326
|
-
return
|
|
327
|
-
channelId:
|
|
325
|
+
}) : "", m = ((I = n == null ? void 0 : n.state) == null ? void 0 : I.unreadCount) || 0;
|
|
326
|
+
return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
327
|
+
channelId: n == null ? void 0 : n.id,
|
|
328
328
|
isSelected: a,
|
|
329
|
-
participantName:
|
|
330
|
-
unread:
|
|
331
|
-
hasTimestamp: !!
|
|
329
|
+
participantName: l,
|
|
330
|
+
unread: m,
|
|
331
|
+
hasTimestamp: !!u
|
|
332
332
|
}), /* @__PURE__ */ e(
|
|
333
333
|
"button",
|
|
334
334
|
{
|
|
335
335
|
type: "button",
|
|
336
|
-
onClick:
|
|
337
|
-
className:
|
|
336
|
+
onClick: c,
|
|
337
|
+
className: P(
|
|
338
338
|
"w-full px-4 py-3 transition-colors border-b border-sand text-left max-w-full overflow-hidden focus-ring",
|
|
339
339
|
{
|
|
340
340
|
"bg-primary-alt/10 border-l-4 border-l-primary": a,
|
|
@@ -343,11 +343,11 @@ const Y = ({
|
|
|
343
343
|
),
|
|
344
344
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
345
345
|
/* @__PURE__ */ e(
|
|
346
|
-
|
|
346
|
+
ne,
|
|
347
347
|
{
|
|
348
|
-
id: ((R = r == null ? void 0 : r.user) == null ? void 0 : R.id) ||
|
|
349
|
-
name:
|
|
350
|
-
image:
|
|
348
|
+
id: ((R = r == null ? void 0 : r.user) == null ? void 0 : R.id) || n.id || "unknown",
|
|
349
|
+
name: l,
|
|
350
|
+
image: b,
|
|
351
351
|
size: 44
|
|
352
352
|
}
|
|
353
353
|
),
|
|
@@ -356,99 +356,99 @@ const Y = ({
|
|
|
356
356
|
/* @__PURE__ */ e(
|
|
357
357
|
"h3",
|
|
358
358
|
{
|
|
359
|
-
className:
|
|
359
|
+
className: P(
|
|
360
360
|
"text-sm font-medium truncate",
|
|
361
361
|
a ? "text-primary" : "text-charcoal"
|
|
362
362
|
),
|
|
363
|
-
children:
|
|
363
|
+
children: l
|
|
364
364
|
}
|
|
365
365
|
),
|
|
366
|
-
|
|
366
|
+
u && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: u })
|
|
367
367
|
] }),
|
|
368
368
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
|
|
369
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children:
|
|
370
|
-
|
|
369
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: v }),
|
|
370
|
+
m > 0 && /* @__PURE__ */ e("span", { className: "bg-primary text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: m > 99 ? "99+" : m })
|
|
371
371
|
] })
|
|
372
372
|
] })
|
|
373
373
|
] })
|
|
374
374
|
}
|
|
375
375
|
);
|
|
376
|
-
},
|
|
377
|
-
onChannelSelect:
|
|
376
|
+
}, je = ({
|
|
377
|
+
onChannelSelect: n,
|
|
378
378
|
selectedChannel: s,
|
|
379
|
-
showStartConversation:
|
|
380
|
-
onStartConversation:
|
|
379
|
+
showStartConversation: t = !1,
|
|
380
|
+
onStartConversation: o,
|
|
381
381
|
participantLabel: a = "participants",
|
|
382
|
-
className:
|
|
382
|
+
className: c
|
|
383
383
|
}) => {
|
|
384
384
|
var x;
|
|
385
|
-
const d =
|
|
385
|
+
const d = Q.useRef(0);
|
|
386
386
|
d.current++;
|
|
387
|
-
const { debug: r = !1 } =
|
|
387
|
+
const { debug: r = !1 } = ee();
|
|
388
388
|
r && console.log("📺 [ChannelList] 🔄 RENDER START", {
|
|
389
389
|
renderCount: d.current,
|
|
390
390
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
391
|
-
showStartConversation:
|
|
391
|
+
showStartConversation: t,
|
|
392
392
|
participantLabel: a
|
|
393
393
|
});
|
|
394
|
-
const { client:
|
|
394
|
+
const { client: l } = we();
|
|
395
395
|
r && console.log("📺 [ChannelList] 📡 CHAT CONTEXT", {
|
|
396
396
|
renderCount: d.current,
|
|
397
|
-
hasClient: !!
|
|
398
|
-
clientUserId:
|
|
399
|
-
clientConnected: (x =
|
|
397
|
+
hasClient: !!l,
|
|
398
|
+
clientUserId: l == null ? void 0 : l.userID,
|
|
399
|
+
clientConnected: (x = l == null ? void 0 : l.wsConnection) == null ? void 0 : x.isHealthy
|
|
400
400
|
});
|
|
401
|
-
const
|
|
402
|
-
const
|
|
401
|
+
const b = Q.useMemo(() => {
|
|
402
|
+
const v = l.userID, u = v ? { type: "messaging", members: { $in: [v] }, hidden: !1 } : { type: "messaging" };
|
|
403
403
|
return r && console.log("📺 [ChannelList] 🔍 FILTERS MEMOIZED", {
|
|
404
404
|
renderCount: d.current,
|
|
405
|
-
userId:
|
|
406
|
-
filters:
|
|
407
|
-
}),
|
|
408
|
-
}, [
|
|
405
|
+
userId: v,
|
|
406
|
+
filters: u
|
|
407
|
+
}), u;
|
|
408
|
+
}, [l.userID, r]);
|
|
409
409
|
return /* @__PURE__ */ i(
|
|
410
410
|
"div",
|
|
411
411
|
{
|
|
412
|
-
className:
|
|
413
|
-
"h-full flex flex-col min-w-0 overflow-hidden",
|
|
414
|
-
|
|
412
|
+
className: P(
|
|
413
|
+
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
414
|
+
c
|
|
415
415
|
),
|
|
416
416
|
children: [
|
|
417
417
|
/* @__PURE__ */ e("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-3 min-h-10 min-w-0", children: [
|
|
418
418
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Conversations" }),
|
|
419
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children:
|
|
420
|
-
|
|
419
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t && o && /* @__PURE__ */ e(
|
|
420
|
+
se,
|
|
421
421
|
{
|
|
422
422
|
label: "Start a new conversation",
|
|
423
|
-
onClick:
|
|
423
|
+
onClick: o,
|
|
424
424
|
className: "inline-flex size-10 items-center justify-center",
|
|
425
|
-
children: /* @__PURE__ */ e(
|
|
425
|
+
children: /* @__PURE__ */ e(Te, { className: "h-5 w-5" })
|
|
426
426
|
}
|
|
427
427
|
) })
|
|
428
428
|
] }) }),
|
|
429
429
|
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (r && console.log("📺 [ChannelList] 🎬 RENDERING STREAM CHANNEL LIST", {
|
|
430
430
|
renderCount: d.current,
|
|
431
|
-
filters:
|
|
432
|
-
hasClient: !!
|
|
433
|
-
clientUserId:
|
|
431
|
+
filters: b,
|
|
432
|
+
hasClient: !!l,
|
|
433
|
+
clientUserId: l == null ? void 0 : l.userID
|
|
434
434
|
}), /* @__PURE__ */ e(
|
|
435
|
-
|
|
435
|
+
Ee,
|
|
436
436
|
{
|
|
437
|
-
filters:
|
|
437
|
+
filters: b,
|
|
438
438
|
sort: { last_message_at: -1 },
|
|
439
439
|
options: { limit: 30 },
|
|
440
|
-
Preview: (
|
|
441
|
-
var
|
|
440
|
+
Preview: (v) => {
|
|
441
|
+
var u, m;
|
|
442
442
|
return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
|
|
443
|
-
channelId: (
|
|
443
|
+
channelId: (u = v.channel) == null ? void 0 : u.id,
|
|
444
444
|
selectedChannelId: s == null ? void 0 : s.id,
|
|
445
|
-
isSelected: (s == null ? void 0 : s.id) === ((
|
|
445
|
+
isSelected: (s == null ? void 0 : s.id) === ((m = v.channel) == null ? void 0 : m.id)
|
|
446
446
|
}), /* @__PURE__ */ e(
|
|
447
|
-
|
|
447
|
+
pe,
|
|
448
448
|
{
|
|
449
|
-
...
|
|
449
|
+
...v,
|
|
450
450
|
selectedChannel: s,
|
|
451
|
-
onChannelSelect:
|
|
451
|
+
onChannelSelect: n,
|
|
452
452
|
debug: r
|
|
453
453
|
}
|
|
454
454
|
);
|
|
@@ -458,54 +458,54 @@ const Y = ({
|
|
|
458
458
|
]
|
|
459
459
|
}
|
|
460
460
|
);
|
|
461
|
-
},
|
|
462
|
-
variant:
|
|
461
|
+
}, J = ({
|
|
462
|
+
variant: n = "default",
|
|
463
463
|
className: s,
|
|
464
|
-
children:
|
|
465
|
-
...
|
|
464
|
+
children: t,
|
|
465
|
+
...o
|
|
466
466
|
}) => /* @__PURE__ */ e(
|
|
467
467
|
"button",
|
|
468
468
|
{
|
|
469
469
|
type: "button",
|
|
470
|
-
className:
|
|
470
|
+
className: P(
|
|
471
471
|
"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",
|
|
472
|
-
|
|
472
|
+
n === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
473
473
|
s
|
|
474
474
|
),
|
|
475
|
-
...
|
|
476
|
-
children:
|
|
475
|
+
...o,
|
|
476
|
+
children: t
|
|
477
477
|
}
|
|
478
478
|
);
|
|
479
|
-
function
|
|
480
|
-
return /* @__PURE__ */ e(
|
|
479
|
+
function me({ onClick: n }) {
|
|
480
|
+
return /* @__PURE__ */ e(se, { label: "Close", onClick: n, className: "p-1", children: /* @__PURE__ */ e(de, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
481
481
|
}
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
/* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
|
|
485
|
-
] }),
|
|
486
|
-
var
|
|
487
|
-
const { channel: a } =
|
|
488
|
-
(
|
|
489
|
-
var
|
|
490
|
-
return ((
|
|
482
|
+
const Be = ({ renderActions: n }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
|
|
483
|
+
n && n(),
|
|
484
|
+
/* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(ke, { focus: !0, maxRows: 4 }) })
|
|
485
|
+
] }), Ae = ({ onBack: n, showBackButton: s, onShowInfo: t, canShowInfo: o }) => {
|
|
486
|
+
var l, b, x, v;
|
|
487
|
+
const { channel: a } = Re(), c = Q.useMemo(() => Object.values(a.state.members || {}).find(
|
|
488
|
+
(m) => {
|
|
489
|
+
var C;
|
|
490
|
+
return ((C = m.user) == null ? void 0 : C.id) && m.user.id !== a._client.userID;
|
|
491
491
|
}
|
|
492
|
-
), [a._client.userID, a.state.members]), d = ((
|
|
492
|
+
), [a._client.userID, a.state.members]), d = ((l = c == null ? void 0 : c.user) == null ? void 0 : l.name) || ((b = c == null ? void 0 : c.user) == null ? void 0 : b.id) || "Unknown member", r = (x = c == null ? void 0 : c.user) == null ? void 0 : x.image;
|
|
493
493
|
return /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-3 min-h-12", children: [
|
|
494
494
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
495
|
-
s &&
|
|
495
|
+
s && n && /* @__PURE__ */ e(
|
|
496
496
|
"button",
|
|
497
497
|
{
|
|
498
498
|
type: "button",
|
|
499
|
-
onClick:
|
|
499
|
+
onClick: n,
|
|
500
500
|
className: "inline-flex items-center justify-center w-8 h-8 rounded-lg hover:bg-sand focus:outline-none focus:ring-2 focus:ring-primary transition-colors lg:hidden",
|
|
501
|
-
"aria-label": "Back to
|
|
502
|
-
children: /* @__PURE__ */ e(
|
|
501
|
+
"aria-label": "Back to conversations",
|
|
502
|
+
children: /* @__PURE__ */ e(Pe, { className: "h-5 w-5 text-stone", weight: "bold" })
|
|
503
503
|
}
|
|
504
504
|
),
|
|
505
505
|
/* @__PURE__ */ e(
|
|
506
|
-
|
|
506
|
+
ne,
|
|
507
507
|
{
|
|
508
|
-
id: ((
|
|
508
|
+
id: ((v = c == null ? void 0 : c.user) == null ? void 0 : v.id) || a.id || "unknown",
|
|
509
509
|
name: d,
|
|
510
510
|
image: r,
|
|
511
511
|
size: 40
|
|
@@ -513,79 +513,79 @@ const Ue = ({ renderActions: t }) => /* @__PURE__ */ i("div", { className: "mess
|
|
|
513
513
|
),
|
|
514
514
|
/* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "text-lg font-semibold text-charcoal truncate", children: d }) })
|
|
515
515
|
] }),
|
|
516
|
-
|
|
516
|
+
o && t && /* @__PURE__ */ e(se, { label: "Chat info", onClick: t, children: /* @__PURE__ */ e(De, { className: "h-6 w-6 text-charcoal", weight: "bold" }) })
|
|
517
517
|
] });
|
|
518
|
-
},
|
|
519
|
-
isOpen:
|
|
518
|
+
}, He = ({
|
|
519
|
+
isOpen: n,
|
|
520
520
|
onClose: s,
|
|
521
|
-
participant:
|
|
522
|
-
channel:
|
|
521
|
+
participant: t,
|
|
522
|
+
channel: o,
|
|
523
523
|
followerStatusLabel: a,
|
|
524
|
-
onLeaveConversation:
|
|
524
|
+
onLeaveConversation: c,
|
|
525
525
|
onBlockParticipant: d
|
|
526
526
|
}) => {
|
|
527
|
-
var
|
|
528
|
-
const { service: r, debug:
|
|
529
|
-
|
|
530
|
-
const k =
|
|
531
|
-
k && (
|
|
532
|
-
}, [
|
|
533
|
-
const
|
|
527
|
+
var U, j, Z, $, W, z, A;
|
|
528
|
+
const { service: r, debug: l } = ee(), b = H(null), [x, v] = E(!1), [u, m] = E(!1), [C, w] = E(!1);
|
|
529
|
+
G(() => {
|
|
530
|
+
const k = b.current;
|
|
531
|
+
k && (n ? k.showModal() : k.close());
|
|
532
|
+
}, [n]);
|
|
533
|
+
const y = M(async () => {
|
|
534
534
|
var k;
|
|
535
|
-
if (!(!r || !((k =
|
|
535
|
+
if (!(!r || !((k = t == null ? void 0 : t.user) != null && k.id)))
|
|
536
536
|
try {
|
|
537
|
-
const
|
|
538
|
-
(
|
|
539
|
-
var
|
|
540
|
-
return
|
|
537
|
+
const B = (await r.getBlockedUsers()).some(
|
|
538
|
+
(q) => {
|
|
539
|
+
var X;
|
|
540
|
+
return q.blocked_user_id === ((X = t == null ? void 0 : t.user) == null ? void 0 : X.id);
|
|
541
541
|
}
|
|
542
542
|
);
|
|
543
|
-
|
|
544
|
-
} catch (
|
|
543
|
+
v(B);
|
|
544
|
+
} catch (L) {
|
|
545
545
|
console.error(
|
|
546
546
|
"[ChannelInfoDialog] Failed to check blocked status:",
|
|
547
|
-
|
|
547
|
+
L
|
|
548
548
|
);
|
|
549
549
|
}
|
|
550
|
-
}, [r, (
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
}, [
|
|
554
|
-
const
|
|
550
|
+
}, [r, (U = t == null ? void 0 : t.user) == null ? void 0 : U.id]);
|
|
551
|
+
G(() => {
|
|
552
|
+
n && y();
|
|
553
|
+
}, [n, y]);
|
|
554
|
+
const D = async () => {
|
|
555
555
|
var k;
|
|
556
|
-
if (!
|
|
557
|
-
|
|
556
|
+
if (!u) {
|
|
557
|
+
l && console.log("[ChannelInfoDialog] Leave conversation", o.cid), m(!0);
|
|
558
558
|
try {
|
|
559
|
-
const
|
|
560
|
-
await
|
|
561
|
-
} catch (
|
|
562
|
-
console.error("[ChannelInfoDialog] Failed to leave conversation",
|
|
559
|
+
const L = ((k = o._client) == null ? void 0 : k.userID) ?? null;
|
|
560
|
+
await o.hide(L, !1), c && await c(o), s();
|
|
561
|
+
} catch (L) {
|
|
562
|
+
console.error("[ChannelInfoDialog] Failed to leave conversation", L);
|
|
563
563
|
} finally {
|
|
564
|
-
|
|
564
|
+
m(!1);
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
}, O = async () => {
|
|
568
|
-
var k,
|
|
569
|
-
if (!(
|
|
570
|
-
|
|
568
|
+
var k, L, B;
|
|
569
|
+
if (!(C || !r)) {
|
|
570
|
+
l && console.log("[ChannelInfoDialog] Block member", (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), w(!0);
|
|
571
571
|
try {
|
|
572
|
-
await r.blockUser((
|
|
573
|
-
} catch (
|
|
574
|
-
console.error("[ChannelInfoDialog] Failed to block member",
|
|
572
|
+
await r.blockUser((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), d && await d((B = t == null ? void 0 : t.user) == null ? void 0 : B.id), s();
|
|
573
|
+
} catch (q) {
|
|
574
|
+
console.error("[ChannelInfoDialog] Failed to block member", q);
|
|
575
575
|
} finally {
|
|
576
|
-
|
|
576
|
+
w(!1);
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
|
-
},
|
|
580
|
-
var k,
|
|
581
|
-
if (!(
|
|
582
|
-
|
|
579
|
+
}, I = async () => {
|
|
580
|
+
var k, L, B;
|
|
581
|
+
if (!(C || !r)) {
|
|
582
|
+
l && console.log("[ChannelInfoDialog] Unblock member", (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), w(!0);
|
|
583
583
|
try {
|
|
584
|
-
await r.unBlockUser((
|
|
585
|
-
} catch (
|
|
586
|
-
console.error("[ChannelInfoDialog] Failed to unblock member",
|
|
584
|
+
await r.unBlockUser((L = t == null ? void 0 : t.user) == null ? void 0 : L.id), d && await d((B = t == null ? void 0 : t.user) == null ? void 0 : B.id), s();
|
|
585
|
+
} catch (q) {
|
|
586
|
+
console.error("[ChannelInfoDialog] Failed to unblock member", q);
|
|
587
587
|
} finally {
|
|
588
|
-
|
|
588
|
+
w(!1);
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
}, R = () => {
|
|
@@ -595,32 +595,32 @@ const Ue = ({ renderActions: t }) => /* @__PURE__ */ i("div", { className: "mess
|
|
|
595
595
|
"noopener,noreferrer"
|
|
596
596
|
);
|
|
597
597
|
};
|
|
598
|
-
if (!
|
|
599
|
-
const T = ((
|
|
598
|
+
if (!t) return null;
|
|
599
|
+
const T = ((j = t.user) == null ? void 0 : j.name) || ((Z = t.user) == null ? void 0 : Z.id) || "Unknown member", h = ($ = t.user) == null ? void 0 : $.image, g = (W = t.user) == null ? void 0 : W.email, f = (z = t.user) == null ? void 0 : z.username, S = g || (f ? `linktr.ee/${f}` : void 0), V = ((A = t.user) == null ? void 0 : A.id) || "unknown";
|
|
600
600
|
return (
|
|
601
601
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
602
602
|
/* @__PURE__ */ e(
|
|
603
603
|
"dialog",
|
|
604
604
|
{
|
|
605
|
-
ref:
|
|
605
|
+
ref: b,
|
|
606
606
|
className: "mes-dialog",
|
|
607
607
|
onClose: s,
|
|
608
608
|
onClick: (k) => {
|
|
609
|
-
k.target ===
|
|
609
|
+
k.target === b.current && s();
|
|
610
610
|
},
|
|
611
611
|
children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light", children: [
|
|
612
612
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
613
613
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
614
|
-
/* @__PURE__ */ e(
|
|
614
|
+
/* @__PURE__ */ e(me, { onClick: s })
|
|
615
615
|
] }),
|
|
616
616
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto px-6 py-6", children: [
|
|
617
617
|
/* @__PURE__ */ e("div", { className: "rounded-2xl bg-chalk p-4", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-4", children: [
|
|
618
618
|
/* @__PURE__ */ e(
|
|
619
|
-
|
|
619
|
+
ne,
|
|
620
620
|
{
|
|
621
|
-
id:
|
|
621
|
+
id: V,
|
|
622
622
|
name: T,
|
|
623
|
-
image:
|
|
623
|
+
image: h,
|
|
624
624
|
size: 64
|
|
625
625
|
}
|
|
626
626
|
),
|
|
@@ -632,42 +632,42 @@ const Ue = ({ renderActions: t }) => /* @__PURE__ */ i("div", { className: "mess
|
|
|
632
632
|
] }) }),
|
|
633
633
|
/* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
|
|
634
634
|
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
635
|
-
|
|
635
|
+
J,
|
|
636
636
|
{
|
|
637
|
-
onClick:
|
|
638
|
-
disabled:
|
|
639
|
-
"aria-busy":
|
|
637
|
+
onClick: D,
|
|
638
|
+
disabled: u,
|
|
639
|
+
"aria-busy": u,
|
|
640
640
|
children: [
|
|
641
|
-
|
|
641
|
+
u ? /* @__PURE__ */ e(K, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
|
|
642
642
|
/* @__PURE__ */ e("span", { children: "Leave Conversation" })
|
|
643
643
|
]
|
|
644
644
|
}
|
|
645
645
|
) }),
|
|
646
646
|
/* @__PURE__ */ e("li", { children: x ? /* @__PURE__ */ i(
|
|
647
|
-
|
|
647
|
+
J,
|
|
648
648
|
{
|
|
649
|
-
onClick:
|
|
650
|
-
disabled:
|
|
651
|
-
"aria-busy":
|
|
649
|
+
onClick: I,
|
|
650
|
+
disabled: C,
|
|
651
|
+
"aria-busy": C,
|
|
652
652
|
children: [
|
|
653
|
-
|
|
653
|
+
C ? /* @__PURE__ */ e(K, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ae, { className: "h-5 w-5" }),
|
|
654
654
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
655
655
|
]
|
|
656
656
|
}
|
|
657
657
|
) : /* @__PURE__ */ i(
|
|
658
|
-
|
|
658
|
+
J,
|
|
659
659
|
{
|
|
660
660
|
onClick: O,
|
|
661
|
-
disabled:
|
|
662
|
-
"aria-busy":
|
|
661
|
+
disabled: C,
|
|
662
|
+
"aria-busy": C,
|
|
663
663
|
children: [
|
|
664
|
-
|
|
664
|
+
C ? /* @__PURE__ */ e(K, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ae, { className: "h-5 w-5" }),
|
|
665
665
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
666
666
|
]
|
|
667
667
|
}
|
|
668
668
|
) }),
|
|
669
|
-
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
|
|
670
|
-
/* @__PURE__ */ e(
|
|
669
|
+
/* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(J, { variant: "danger", onClick: R, children: [
|
|
670
|
+
/* @__PURE__ */ e(Oe, { className: "h-5 w-5" }),
|
|
671
671
|
/* @__PURE__ */ e("span", { children: "Report" })
|
|
672
672
|
] }) })
|
|
673
673
|
] })
|
|
@@ -676,66 +676,75 @@ const Ue = ({ renderActions: t }) => /* @__PURE__ */ i("div", { className: "mess
|
|
|
676
676
|
}
|
|
677
677
|
)
|
|
678
678
|
);
|
|
679
|
-
},
|
|
680
|
-
channel:
|
|
679
|
+
}, Ge = ({
|
|
680
|
+
channel: n,
|
|
681
681
|
onBack: s,
|
|
682
|
-
showBackButton:
|
|
683
|
-
renderMessageInputActions:
|
|
682
|
+
showBackButton: t = !1,
|
|
683
|
+
renderMessageInputActions: o,
|
|
684
684
|
onLeaveConversation: a,
|
|
685
|
-
onBlockParticipant:
|
|
685
|
+
onBlockParticipant: c,
|
|
686
686
|
className: d
|
|
687
687
|
}) => {
|
|
688
|
-
const [r,
|
|
689
|
-
(
|
|
690
|
-
var
|
|
691
|
-
return ((
|
|
688
|
+
const [r, l] = E(!1), b = Q.useMemo(() => Object.values(n.state.members || {}).find(
|
|
689
|
+
(u) => {
|
|
690
|
+
var m;
|
|
691
|
+
return ((m = u.user) == null ? void 0 : m.id) && u.user.id !== n._client.userID;
|
|
692
692
|
}
|
|
693
|
-
), [
|
|
694
|
-
const
|
|
695
|
-
return
|
|
696
|
-
}, [
|
|
697
|
-
return /* @__PURE__ */ i(
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
693
|
+
), [n._client.userID, n.state.members]), x = Q.useMemo(() => {
|
|
694
|
+
const v = n.data ?? {};
|
|
695
|
+
return v.followerStatus ? String(v.followerStatus) : v.isFollower ? "Subscribed to you" : void 0;
|
|
696
|
+
}, [n.data]);
|
|
697
|
+
return /* @__PURE__ */ i(
|
|
698
|
+
"div",
|
|
699
|
+
{
|
|
700
|
+
className: P(
|
|
701
|
+
"messaging-channel-view h-full flex flex-col",
|
|
702
|
+
d
|
|
703
|
+
),
|
|
704
|
+
children: [
|
|
705
|
+
/* @__PURE__ */ e(Ie, { channel: n, children: /* @__PURE__ */ i(ye, { children: [
|
|
706
|
+
/* @__PURE__ */ e("div", { className: "border-b border-sand bg-white px-4 py-3", children: /* @__PURE__ */ e(
|
|
707
|
+
Ae,
|
|
708
|
+
{
|
|
709
|
+
onBack: s,
|
|
710
|
+
showBackButton: t,
|
|
711
|
+
onShowInfo: () => l(!0),
|
|
712
|
+
canShowInfo: !!b
|
|
713
|
+
}
|
|
714
|
+
) }),
|
|
715
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden", children: /* @__PURE__ */ e(Se, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 }) }),
|
|
716
|
+
/* @__PURE__ */ e(
|
|
717
|
+
Be,
|
|
718
|
+
{
|
|
719
|
+
renderActions: () => o == null ? void 0 : o(n)
|
|
720
|
+
}
|
|
721
|
+
)
|
|
722
|
+
] }) }),
|
|
723
|
+
/* @__PURE__ */ e(
|
|
724
|
+
He,
|
|
725
|
+
{
|
|
726
|
+
isOpen: r,
|
|
727
|
+
onClose: () => l(!1),
|
|
728
|
+
participant: b,
|
|
729
|
+
channel: n,
|
|
730
|
+
followerStatusLabel: x,
|
|
731
|
+
onLeaveConversation: a,
|
|
732
|
+
onBlockParticipant: c
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
);
|
|
729
738
|
};
|
|
730
|
-
function
|
|
731
|
-
searchQuery:
|
|
739
|
+
function $e({
|
|
740
|
+
searchQuery: n,
|
|
732
741
|
setSearchQuery: s,
|
|
733
|
-
placeholder:
|
|
742
|
+
placeholder: t
|
|
734
743
|
}) {
|
|
735
|
-
const
|
|
744
|
+
const o = H(null);
|
|
736
745
|
return /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
737
746
|
/* @__PURE__ */ e(
|
|
738
|
-
|
|
747
|
+
Ue,
|
|
739
748
|
{
|
|
740
749
|
className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
|
|
741
750
|
weight: "bold"
|
|
@@ -744,42 +753,42 @@ function pe({
|
|
|
744
753
|
/* @__PURE__ */ e(
|
|
745
754
|
"input",
|
|
746
755
|
{
|
|
747
|
-
ref:
|
|
756
|
+
ref: o,
|
|
748
757
|
type: "text",
|
|
749
|
-
placeholder:
|
|
750
|
-
value:
|
|
758
|
+
placeholder: t,
|
|
759
|
+
value: n,
|
|
751
760
|
onChange: (a) => s(a.target.value),
|
|
752
761
|
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"
|
|
753
762
|
}
|
|
754
763
|
),
|
|
755
|
-
|
|
756
|
-
|
|
764
|
+
n && /* @__PURE__ */ e(
|
|
765
|
+
se,
|
|
757
766
|
{
|
|
758
767
|
label: "Clear search",
|
|
759
768
|
onClick: () => {
|
|
760
769
|
var a;
|
|
761
|
-
s(""), (a =
|
|
770
|
+
s(""), (a = o.current) == null || a.focus();
|
|
762
771
|
},
|
|
763
772
|
className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
|
|
764
|
-
children: /* @__PURE__ */ e(
|
|
773
|
+
children: /* @__PURE__ */ e(de, { className: "h-4 w-4", weight: "bold" })
|
|
765
774
|
}
|
|
766
775
|
)
|
|
767
776
|
] });
|
|
768
777
|
}
|
|
769
|
-
const
|
|
770
|
-
participantSource:
|
|
778
|
+
const _e = ({
|
|
779
|
+
participantSource: n,
|
|
771
780
|
onSelectParticipant: s,
|
|
772
|
-
onClose:
|
|
773
|
-
existingParticipantIds:
|
|
781
|
+
onClose: t,
|
|
782
|
+
existingParticipantIds: o = /* @__PURE__ */ new Set(),
|
|
774
783
|
participantLabel: a = "participants",
|
|
775
|
-
searchPlaceholder:
|
|
784
|
+
searchPlaceholder: c = "Search participants...",
|
|
776
785
|
className: d
|
|
777
786
|
}) => {
|
|
778
|
-
const { debug: r } =
|
|
787
|
+
const { debug: r } = ee(), [l, b] = E(""), [x, v] = E([]), [u, m] = E(!1), [C, w] = E(null), [y, D] = E(
|
|
779
788
|
null
|
|
780
|
-
), O =
|
|
781
|
-
|
|
782
|
-
if (
|
|
789
|
+
), O = H(!1);
|
|
790
|
+
G(() => {
|
|
791
|
+
if (n.loading) {
|
|
783
792
|
r && console.log(
|
|
784
793
|
"[ParticipantPicker] Waiting for participant source to finish loading..."
|
|
785
794
|
);
|
|
@@ -787,169 +796,169 @@ const je = ({
|
|
|
787
796
|
}
|
|
788
797
|
if (O.current) return;
|
|
789
798
|
(async () => {
|
|
790
|
-
r && console.log("[ParticipantPicker] Loading initial participants..."),
|
|
799
|
+
r && console.log("[ParticipantPicker] Loading initial participants..."), m(!0), w(null);
|
|
791
800
|
try {
|
|
792
|
-
const
|
|
801
|
+
const g = await n.loadParticipants({
|
|
793
802
|
search: "",
|
|
794
803
|
// Load all participants initially
|
|
795
804
|
limit: 100
|
|
796
805
|
});
|
|
797
|
-
g
|
|
806
|
+
v(g.participants), O.current = !0, r && console.log(
|
|
798
807
|
"[ParticipantPicker] Participants loaded successfully:",
|
|
799
|
-
|
|
808
|
+
g.participants.length
|
|
800
809
|
);
|
|
801
|
-
} catch (
|
|
802
|
-
const
|
|
803
|
-
|
|
810
|
+
} catch (g) {
|
|
811
|
+
const f = g instanceof Error ? g.message : "Failed to load participants";
|
|
812
|
+
w(f), console.error("[ParticipantPicker] Failed to load participants:", g);
|
|
804
813
|
} finally {
|
|
805
|
-
|
|
814
|
+
m(!1);
|
|
806
815
|
}
|
|
807
816
|
})();
|
|
808
|
-
}, [
|
|
809
|
-
const
|
|
810
|
-
var
|
|
811
|
-
if (!
|
|
812
|
-
const
|
|
813
|
-
return
|
|
814
|
-
}), R =
|
|
815
|
-
async (
|
|
816
|
-
if (!
|
|
817
|
-
|
|
817
|
+
}, [n.loading, r]);
|
|
818
|
+
const I = x.filter((h) => !o.has(h.id)).filter((h) => {
|
|
819
|
+
var f;
|
|
820
|
+
if (!l) return !0;
|
|
821
|
+
const g = l.toLowerCase();
|
|
822
|
+
return h.name.toLowerCase().includes(g) || ((f = h.email) == null ? void 0 : f.toLowerCase().includes(g)) || !1;
|
|
823
|
+
}), R = M(
|
|
824
|
+
async (h) => {
|
|
825
|
+
if (!y) {
|
|
826
|
+
D(h.id);
|
|
818
827
|
try {
|
|
819
|
-
await s(
|
|
820
|
-
} catch (
|
|
821
|
-
console.error("[ParticipantPicker] Failed to start chat:",
|
|
828
|
+
await s(h);
|
|
829
|
+
} catch (g) {
|
|
830
|
+
console.error("[ParticipantPicker] Failed to start chat:", g), D(null);
|
|
822
831
|
}
|
|
823
832
|
}
|
|
824
833
|
},
|
|
825
|
-
[s,
|
|
826
|
-
), T = (
|
|
827
|
-
(
|
|
834
|
+
[s, y]
|
|
835
|
+
), T = (h, g) => {
|
|
836
|
+
(h.key === "Enter" || h.key === " ") && (h.preventDefault(), R(g));
|
|
828
837
|
};
|
|
829
|
-
return /* @__PURE__ */ i("div", { className:
|
|
838
|
+
return /* @__PURE__ */ i("div", { className: P("flex flex-col h-full", d), children: [
|
|
830
839
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
831
840
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
832
841
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
833
|
-
/* @__PURE__ */ e(
|
|
842
|
+
/* @__PURE__ */ e(me, { onClick: t })
|
|
834
843
|
] }),
|
|
835
844
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
836
845
|
"Select a ",
|
|
837
846
|
a.slice(0, -1),
|
|
838
847
|
" to start messaging (",
|
|
839
|
-
|
|
848
|
+
I.length,
|
|
840
849
|
" available)",
|
|
841
|
-
|
|
850
|
+
n.totalCount !== void 0 && ` • ${n.totalCount} ${a} total`
|
|
842
851
|
] }),
|
|
843
852
|
/* @__PURE__ */ e(
|
|
844
|
-
|
|
853
|
+
$e,
|
|
845
854
|
{
|
|
846
|
-
searchQuery:
|
|
847
|
-
setSearchQuery:
|
|
848
|
-
placeholder:
|
|
855
|
+
searchQuery: l,
|
|
856
|
+
setSearchQuery: b,
|
|
857
|
+
placeholder: c
|
|
849
858
|
}
|
|
850
859
|
)
|
|
851
860
|
] }),
|
|
852
|
-
|
|
861
|
+
C && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
|
|
853
862
|
"Error loading ",
|
|
854
863
|
a,
|
|
855
864
|
": ",
|
|
856
|
-
|
|
865
|
+
C
|
|
857
866
|
] }),
|
|
858
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children:
|
|
867
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: u && I.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: [
|
|
859
868
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
860
869
|
/* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
|
|
861
870
|
"Loading ",
|
|
862
871
|
a,
|
|
863
872
|
"..."
|
|
864
873
|
] })
|
|
865
|
-
] }) }) :
|
|
866
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
867
|
-
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children:
|
|
868
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children:
|
|
874
|
+
] }) }) : I.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
875
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(ie, { className: "h-8 w-8 text-charcoal" }) }),
|
|
876
|
+
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: l ? `No ${a} found` : x.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
|
|
877
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: l ? "Try a different search term" : x.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
|
|
869
878
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
870
|
-
|
|
871
|
-
const
|
|
879
|
+
I.map((h) => {
|
|
880
|
+
const g = h.name || h.email || h.id, f = h.email && h.name ? h.email : h.phone;
|
|
872
881
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
|
|
873
882
|
"button",
|
|
874
883
|
{
|
|
875
884
|
type: "button",
|
|
876
|
-
onClick: () => R(
|
|
877
|
-
onKeyDown: (S) => T(S,
|
|
885
|
+
onClick: () => R(h),
|
|
886
|
+
onKeyDown: (S) => T(S, h),
|
|
878
887
|
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",
|
|
879
888
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
880
889
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
881
890
|
/* @__PURE__ */ e(
|
|
882
|
-
|
|
891
|
+
ne,
|
|
883
892
|
{
|
|
884
|
-
id:
|
|
885
|
-
name:
|
|
886
|
-
image:
|
|
893
|
+
id: h.id,
|
|
894
|
+
name: g,
|
|
895
|
+
image: h.image,
|
|
887
896
|
size: 40
|
|
888
897
|
}
|
|
889
898
|
),
|
|
890
899
|
/* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
|
|
891
|
-
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children:
|
|
892
|
-
|
|
900
|
+
/* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: g }),
|
|
901
|
+
f && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: f })
|
|
893
902
|
] })
|
|
894
903
|
] }),
|
|
895
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children:
|
|
904
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: y === h.id ? /* @__PURE__ */ e(K, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ie, { className: "h-5 w-5 text-stone" }) })
|
|
896
905
|
] })
|
|
897
906
|
}
|
|
898
|
-
) },
|
|
907
|
+
) }, h.id);
|
|
899
908
|
}),
|
|
900
|
-
|
|
909
|
+
u && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
|
|
901
910
|
/* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
902
911
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
|
|
903
912
|
] }) })
|
|
904
913
|
] }) })
|
|
905
914
|
] });
|
|
906
|
-
},
|
|
915
|
+
}, Ve = ({ hasChannels: n, onStartConversation: s, participantLabel: t }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
907
916
|
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-primary-alt/10 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "💬" }) }),
|
|
908
917
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal", children: "Welcome to Messages" }),
|
|
909
|
-
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children:
|
|
918
|
+
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: n ? /* @__PURE__ */ i(oe, { children: [
|
|
910
919
|
"Choose a conversation from the list or",
|
|
911
920
|
" ",
|
|
912
|
-
s && /* @__PURE__ */ i(
|
|
921
|
+
s && /* @__PURE__ */ i(ce, { onClick: s, children: [
|
|
913
922
|
"start a new conversation with a ",
|
|
914
|
-
|
|
923
|
+
t.slice(0, -1),
|
|
915
924
|
"."
|
|
916
925
|
] })
|
|
917
|
-
] }) : s && /* @__PURE__ */ i(
|
|
918
|
-
/* @__PURE__ */ i(
|
|
926
|
+
] }) : s && /* @__PURE__ */ i(oe, { children: [
|
|
927
|
+
/* @__PURE__ */ i(ce, { onClick: s, children: [
|
|
919
928
|
"Start a new conversation with one of your ",
|
|
920
|
-
|
|
929
|
+
t
|
|
921
930
|
] }),
|
|
922
931
|
" ",
|
|
923
932
|
"to begin messaging."
|
|
924
933
|
] }) })
|
|
925
|
-
] }) }),
|
|
926
|
-
onClick:
|
|
934
|
+
] }) }), ce = ({
|
|
935
|
+
onClick: n,
|
|
927
936
|
children: s
|
|
928
937
|
}) => /* @__PURE__ */ e(
|
|
929
938
|
"button",
|
|
930
939
|
{
|
|
931
940
|
type: "button",
|
|
932
|
-
onClick:
|
|
941
|
+
onClick: n,
|
|
933
942
|
className: "inline-flex items-center gap-1 text-sm font-medium text-primary hover:text-primary-alt focus:outline-none focus:ring-2 focus:ring-primary",
|
|
934
943
|
children: s
|
|
935
944
|
}
|
|
936
|
-
),
|
|
937
|
-
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
938
|
-
/* @__PURE__ */ e("h2", { className: "
|
|
939
|
-
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children:
|
|
945
|
+
), re = ({ message: n, 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: [
|
|
946
|
+
/* @__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: "⚠️" }) }),
|
|
947
|
+
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
948
|
+
/* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: n }),
|
|
940
949
|
s && /* @__PURE__ */ e(
|
|
941
950
|
"button",
|
|
942
951
|
{
|
|
943
952
|
type: "button",
|
|
944
953
|
onClick: s,
|
|
945
|
-
className: "inline-flex items-center px-4 py-2
|
|
946
|
-
children: "
|
|
954
|
+
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary hover:bg-primary-alt rounded-lg focus:outline-none focus:ring-2 focus:ring-primary transition-colors",
|
|
955
|
+
children: "Go Back"
|
|
947
956
|
}
|
|
948
957
|
)
|
|
949
|
-
] }) }),
|
|
958
|
+
] }) }), We = ({ className: n, message: s }) => /* @__PURE__ */ i(
|
|
950
959
|
"div",
|
|
951
960
|
{
|
|
952
|
-
className:
|
|
961
|
+
className: P("flex items-center justify-center h-full", n),
|
|
953
962
|
children: [
|
|
954
963
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
955
964
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -989,245 +998,331 @@ const je = ({
|
|
|
989
998
|
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
990
999
|
]
|
|
991
1000
|
}
|
|
992
|
-
),
|
|
993
|
-
/* @__PURE__ */ e(
|
|
1001
|
+
), ze = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1002
|
+
/* @__PURE__ */ e(We, { className: "w-6 h-6" }),
|
|
994
1003
|
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
995
|
-
] }) }),
|
|
996
|
-
capabilities:
|
|
1004
|
+
] }) }), es = ({
|
|
1005
|
+
capabilities: n = {},
|
|
997
1006
|
className: s,
|
|
998
|
-
renderMessageInputActions:
|
|
999
|
-
onChannelSelect:
|
|
1000
|
-
onParticipantSelect: a
|
|
1007
|
+
renderMessageInputActions: t,
|
|
1008
|
+
onChannelSelect: o,
|
|
1009
|
+
onParticipantSelect: a,
|
|
1010
|
+
initialParticipantFilter: c,
|
|
1011
|
+
initialParticipantData: d
|
|
1001
1012
|
}) => {
|
|
1002
1013
|
const {
|
|
1003
|
-
service:
|
|
1004
|
-
client:
|
|
1005
|
-
isConnected:
|
|
1006
|
-
isLoading:
|
|
1007
|
-
error:
|
|
1008
|
-
refreshConnection:
|
|
1009
|
-
debug:
|
|
1010
|
-
} =
|
|
1011
|
-
showStartConversation:
|
|
1012
|
-
participantSource:
|
|
1013
|
-
participantLabel:
|
|
1014
|
-
} =
|
|
1015
|
-
if (!
|
|
1016
|
-
const
|
|
1017
|
-
if (
|
|
1014
|
+
service: r,
|
|
1015
|
+
client: l,
|
|
1016
|
+
isConnected: b,
|
|
1017
|
+
isLoading: x,
|
|
1018
|
+
error: v,
|
|
1019
|
+
refreshConnection: u,
|
|
1020
|
+
debug: m
|
|
1021
|
+
} = Le(), [C, w] = E(null), [y, D] = E(!1), [O, I] = E(!1), [R, T] = E(/* @__PURE__ */ new Set()), [h, g] = E(0), [f, S] = E(!1), [V, U] = E(null), j = H(null), {
|
|
1022
|
+
showStartConversation: Z = !1,
|
|
1023
|
+
participantSource: $,
|
|
1024
|
+
participantLabel: W = "participants"
|
|
1025
|
+
} = n, z = H(null), A = M(async () => {
|
|
1026
|
+
if (!l || !b) return;
|
|
1027
|
+
const N = l.userID;
|
|
1028
|
+
if (N)
|
|
1018
1029
|
try {
|
|
1019
|
-
|
|
1020
|
-
const
|
|
1030
|
+
m && console.log("[MessagingShell] Syncing channels for user:", N);
|
|
1031
|
+
const p = await l.queryChannels(
|
|
1021
1032
|
{
|
|
1022
1033
|
type: "messaging",
|
|
1023
|
-
members: { $in: [
|
|
1034
|
+
members: { $in: [N] }
|
|
1024
1035
|
},
|
|
1025
1036
|
{},
|
|
1026
1037
|
{ limit: 100 }
|
|
1027
|
-
),
|
|
1028
|
-
|
|
1029
|
-
const
|
|
1030
|
-
Object.values(
|
|
1031
|
-
var
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1038
|
+
), F = /* @__PURE__ */ new Set();
|
|
1039
|
+
p.forEach((_) => {
|
|
1040
|
+
const ge = _.state.members;
|
|
1041
|
+
Object.values(ge).forEach((xe) => {
|
|
1042
|
+
var le;
|
|
1043
|
+
const te = (le = xe.user) == null ? void 0 : le.id;
|
|
1044
|
+
te && te !== N && F.add(te);
|
|
1034
1045
|
});
|
|
1035
|
-
}),
|
|
1036
|
-
channelCount:
|
|
1037
|
-
memberCount:
|
|
1046
|
+
}), T(F), D(p.length > 0), z.current = N, m && console.log("[MessagingShell] Channels synced successfully:", {
|
|
1047
|
+
channelCount: p.length,
|
|
1048
|
+
memberCount: F.size
|
|
1038
1049
|
});
|
|
1039
|
-
} catch (
|
|
1040
|
-
console.error("[MessagingShell] Failed to sync channels:",
|
|
1050
|
+
} catch (p) {
|
|
1051
|
+
console.error("[MessagingShell] Failed to sync channels:", p);
|
|
1041
1052
|
}
|
|
1042
|
-
}, [
|
|
1043
|
-
|
|
1044
|
-
if (!
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1047
|
-
}, [
|
|
1048
|
-
|
|
1049
|
-
(
|
|
1050
|
-
|
|
1053
|
+
}, [l, b, m]);
|
|
1054
|
+
G(() => {
|
|
1055
|
+
if (!l || !b) return;
|
|
1056
|
+
const N = l.userID;
|
|
1057
|
+
N && z.current !== N && A();
|
|
1058
|
+
}, [l, b, A]), G(() => {
|
|
1059
|
+
if (!c || !l || !b) return;
|
|
1060
|
+
(async () => {
|
|
1061
|
+
const p = l.userID;
|
|
1062
|
+
if (p)
|
|
1063
|
+
try {
|
|
1064
|
+
m && console.log(
|
|
1065
|
+
"[MessagingShell] Loading initial conversation with:",
|
|
1066
|
+
c
|
|
1067
|
+
);
|
|
1068
|
+
const F = await l.queryChannels(
|
|
1069
|
+
{
|
|
1070
|
+
type: "messaging",
|
|
1071
|
+
members: { $eq: [p, c] }
|
|
1072
|
+
},
|
|
1073
|
+
{},
|
|
1074
|
+
{ limit: 1 }
|
|
1075
|
+
);
|
|
1076
|
+
if (F.length > 0)
|
|
1077
|
+
w(F[0]), S(!0), U(null), m && console.log(
|
|
1078
|
+
"[MessagingShell] Initial conversation loaded:",
|
|
1079
|
+
F[0].id
|
|
1080
|
+
);
|
|
1081
|
+
else if (d && r) {
|
|
1082
|
+
m && console.log(
|
|
1083
|
+
"[MessagingShell] No conversation found, creating one for:",
|
|
1084
|
+
d
|
|
1085
|
+
);
|
|
1086
|
+
try {
|
|
1087
|
+
const _ = await r.startChannelWithParticipant({
|
|
1088
|
+
id: d.id,
|
|
1089
|
+
name: d.name,
|
|
1090
|
+
email: d.email,
|
|
1091
|
+
phone: d.phone
|
|
1092
|
+
});
|
|
1093
|
+
w(_), S(!0), U(null), m && console.log(
|
|
1094
|
+
"[MessagingShell] Channel created and loaded:",
|
|
1095
|
+
_.id
|
|
1096
|
+
);
|
|
1097
|
+
} catch (_) {
|
|
1098
|
+
console.error(
|
|
1099
|
+
"[MessagingShell] Failed to create conversation:",
|
|
1100
|
+
_
|
|
1101
|
+
), U("Failed to create conversation");
|
|
1102
|
+
}
|
|
1103
|
+
} else
|
|
1104
|
+
U(
|
|
1105
|
+
"No conversation found with this account"
|
|
1106
|
+
), m && console.log(
|
|
1107
|
+
"[MessagingShell] No conversation found for:",
|
|
1108
|
+
c
|
|
1109
|
+
);
|
|
1110
|
+
} catch (F) {
|
|
1111
|
+
console.error(
|
|
1112
|
+
"[MessagingShell] Failed to load initial conversation:",
|
|
1113
|
+
F
|
|
1114
|
+
), U("Failed to load conversation");
|
|
1115
|
+
}
|
|
1116
|
+
})();
|
|
1117
|
+
}, [
|
|
1118
|
+
c,
|
|
1119
|
+
d,
|
|
1120
|
+
l,
|
|
1121
|
+
b,
|
|
1122
|
+
r,
|
|
1123
|
+
m
|
|
1124
|
+
]);
|
|
1125
|
+
const k = M(
|
|
1126
|
+
(N) => {
|
|
1127
|
+
w(N), o == null || o(N);
|
|
1051
1128
|
},
|
|
1052
|
-
[
|
|
1053
|
-
),
|
|
1054
|
-
|
|
1055
|
-
}, []),
|
|
1056
|
-
var
|
|
1057
|
-
|
|
1058
|
-
}, [
|
|
1059
|
-
async (
|
|
1060
|
-
var
|
|
1061
|
-
if (
|
|
1129
|
+
[o]
|
|
1130
|
+
), L = M(() => {
|
|
1131
|
+
f || w(null);
|
|
1132
|
+
}, [f]), B = M(() => {
|
|
1133
|
+
var N;
|
|
1134
|
+
$ && (g((p) => p + 1), I(!0), (N = j.current) == null || N.showModal());
|
|
1135
|
+
}, [$]), q = M(
|
|
1136
|
+
async (N) => {
|
|
1137
|
+
var p;
|
|
1138
|
+
if (r)
|
|
1062
1139
|
try {
|
|
1063
|
-
|
|
1140
|
+
m && console.log(
|
|
1064
1141
|
"[MessagingShell] Starting conversation with:",
|
|
1065
|
-
|
|
1142
|
+
N.id
|
|
1066
1143
|
);
|
|
1067
|
-
const
|
|
1068
|
-
id:
|
|
1069
|
-
name:
|
|
1070
|
-
email:
|
|
1071
|
-
phone:
|
|
1144
|
+
const F = await r.startChannelWithParticipant({
|
|
1145
|
+
id: N.id,
|
|
1146
|
+
name: N.name,
|
|
1147
|
+
email: N.email,
|
|
1148
|
+
phone: N.phone
|
|
1072
1149
|
});
|
|
1073
1150
|
try {
|
|
1074
|
-
await
|
|
1075
|
-
} catch (
|
|
1076
|
-
console.warn("[MessagingShell] Failed to unhide channel:",
|
|
1151
|
+
await F.show();
|
|
1152
|
+
} catch (_) {
|
|
1153
|
+
console.warn("[MessagingShell] Failed to unhide channel:", _);
|
|
1077
1154
|
}
|
|
1078
|
-
|
|
1079
|
-
} catch (
|
|
1080
|
-
console.error("[MessagingShell] Failed to start conversation:",
|
|
1155
|
+
w(F), I(!1), (p = j.current) == null || p.close(), a == null || a(N);
|
|
1156
|
+
} catch (F) {
|
|
1157
|
+
console.error("[MessagingShell] Failed to start conversation:", F);
|
|
1081
1158
|
}
|
|
1082
1159
|
},
|
|
1083
|
-
[
|
|
1084
|
-
),
|
|
1085
|
-
var
|
|
1086
|
-
|
|
1087
|
-
}, []),
|
|
1088
|
-
async (
|
|
1089
|
-
|
|
1160
|
+
[r, a, m]
|
|
1161
|
+
), X = M(() => {
|
|
1162
|
+
var N;
|
|
1163
|
+
I(!1), (N = j.current) == null || N.close();
|
|
1164
|
+
}, []), he = M(
|
|
1165
|
+
async (N) => {
|
|
1166
|
+
m && console.log("[MessagingShell] Leaving conversation:", N.id), w(null), S(!1), z.current = null, await A();
|
|
1090
1167
|
},
|
|
1091
|
-
[
|
|
1092
|
-
),
|
|
1093
|
-
async (
|
|
1094
|
-
|
|
1168
|
+
[A, m]
|
|
1169
|
+
), fe = M(
|
|
1170
|
+
async (N) => {
|
|
1171
|
+
m && console.log("[MessagingShell] Blocking participant:", N), w(null), S(!1), z.current = null, await A();
|
|
1095
1172
|
},
|
|
1096
|
-
[
|
|
1097
|
-
),
|
|
1098
|
-
return
|
|
1099
|
-
|
|
1173
|
+
[A, m]
|
|
1174
|
+
), Y = !!C;
|
|
1175
|
+
return x ? /* @__PURE__ */ e("div", { className: P("h-full", s), children: /* @__PURE__ */ e(ze, {}) }) : v ? /* @__PURE__ */ e("div", { className: P("h-full", s), children: /* @__PURE__ */ e(re, { message: v, onBack: u }) }) : !b || !l ? /* @__PURE__ */ e("div", { className: P("h-full", s), children: /* @__PURE__ */ e(
|
|
1176
|
+
re,
|
|
1100
1177
|
{
|
|
1101
|
-
|
|
1102
|
-
|
|
1178
|
+
message: "Not connected to messaging service",
|
|
1179
|
+
onBack: u
|
|
1103
1180
|
}
|
|
1104
|
-
) }) : /* @__PURE__ */
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1181
|
+
) }) : V ? /* @__PURE__ */ e("div", { className: P("h-full", s), children: /* @__PURE__ */ e(re, { message: V }) }) : /* @__PURE__ */ i(
|
|
1182
|
+
"div",
|
|
1183
|
+
{
|
|
1184
|
+
className: P(
|
|
1185
|
+
"messaging-shell h-full bg-white overflow-hidden",
|
|
1186
|
+
s
|
|
1187
|
+
),
|
|
1188
|
+
children: [
|
|
1189
|
+
/* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
|
|
1190
|
+
/* @__PURE__ */ e(
|
|
1191
|
+
"div",
|
|
1111
1192
|
{
|
|
1112
|
-
|
|
1113
|
-
|
|
1193
|
+
className: P(
|
|
1194
|
+
"messaging-channel-list-sidebar min-h-0 min-w-0 bg-white lg:bg-chalk lg:flex lg:flex-col lg:border-r lg:border-sand",
|
|
1195
|
+
{
|
|
1196
|
+
// In direct conversation mode, always hide the channel list
|
|
1197
|
+
hidden: f,
|
|
1198
|
+
// Normal mode: hide on mobile when channel selected, show on desktop
|
|
1199
|
+
"hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": !f && Y,
|
|
1200
|
+
// Normal mode: show when no channel selected
|
|
1201
|
+
"flex flex-col w-full lg:flex-1 lg:max-w-2xl": !f && !Y
|
|
1202
|
+
}
|
|
1203
|
+
),
|
|
1204
|
+
children: /* @__PURE__ */ e(
|
|
1205
|
+
je,
|
|
1206
|
+
{
|
|
1207
|
+
onChannelSelect: k,
|
|
1208
|
+
selectedChannel: C || void 0,
|
|
1209
|
+
showStartConversation: Z && !!$,
|
|
1210
|
+
onStartConversation: B,
|
|
1211
|
+
participantLabel: W
|
|
1212
|
+
}
|
|
1213
|
+
)
|
|
1114
1214
|
}
|
|
1115
1215
|
),
|
|
1116
|
-
|
|
1117
|
-
|
|
1216
|
+
/* @__PURE__ */ e(
|
|
1217
|
+
"div",
|
|
1118
1218
|
{
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
Ae,
|
|
1148
|
-
{
|
|
1149
|
-
hasChannels: b,
|
|
1150
|
-
onStartConversation: f ? _ : void 0,
|
|
1151
|
-
participantLabel: S
|
|
1219
|
+
className: P(
|
|
1220
|
+
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
1221
|
+
{
|
|
1222
|
+
// In direct conversation mode, always show (full width)
|
|
1223
|
+
flex: f || Y,
|
|
1224
|
+
// Normal mode: hide on mobile when no channel selected
|
|
1225
|
+
"hidden lg:flex": !f && !Y
|
|
1226
|
+
}
|
|
1227
|
+
),
|
|
1228
|
+
children: C ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
1229
|
+
Ge,
|
|
1230
|
+
{
|
|
1231
|
+
channel: C,
|
|
1232
|
+
onBack: L,
|
|
1233
|
+
showBackButton: !f,
|
|
1234
|
+
renderMessageInputActions: t,
|
|
1235
|
+
onLeaveConversation: he,
|
|
1236
|
+
onBlockParticipant: fe
|
|
1237
|
+
},
|
|
1238
|
+
C.id
|
|
1239
|
+
) }) : /* @__PURE__ */ e(
|
|
1240
|
+
Ve,
|
|
1241
|
+
{
|
|
1242
|
+
hasChannels: y,
|
|
1243
|
+
onStartConversation: Z ? B : void 0,
|
|
1244
|
+
participantLabel: W
|
|
1245
|
+
}
|
|
1246
|
+
)
|
|
1152
1247
|
}
|
|
1153
1248
|
)
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
/* @__PURE__ */ e(
|
|
1159
|
-
"dialog",
|
|
1160
|
-
{
|
|
1161
|
-
ref: u,
|
|
1162
|
-
className: "mes-dialog",
|
|
1163
|
-
onClick: (h) => {
|
|
1164
|
-
h.target === u.current && G();
|
|
1165
|
-
},
|
|
1166
|
-
onClose: G,
|
|
1167
|
-
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
1168
|
-
je,
|
|
1249
|
+
] }),
|
|
1250
|
+
$ && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
1251
|
+
/* @__PURE__ */ e(
|
|
1252
|
+
"dialog",
|
|
1169
1253
|
{
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1254
|
+
ref: j,
|
|
1255
|
+
className: "mes-dialog",
|
|
1256
|
+
onClick: (N) => {
|
|
1257
|
+
N.target === j.current && X();
|
|
1258
|
+
},
|
|
1259
|
+
onClose: X,
|
|
1260
|
+
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
1261
|
+
_e,
|
|
1262
|
+
{
|
|
1263
|
+
participantSource: $,
|
|
1264
|
+
onSelectParticipant: q,
|
|
1265
|
+
onClose: X,
|
|
1266
|
+
existingParticipantIds: R,
|
|
1267
|
+
participantLabel: W,
|
|
1268
|
+
searchPlaceholder: `Search ${W}...`
|
|
1269
|
+
},
|
|
1270
|
+
h
|
|
1271
|
+
) })
|
|
1272
|
+
}
|
|
1273
|
+
)
|
|
1274
|
+
]
|
|
1275
|
+
}
|
|
1276
|
+
);
|
|
1277
|
+
}, ss = (n, s = {}) => {
|
|
1278
|
+
const { initialSearch: t = "", pageSize: o = 20 } = s, [a, c] = E([]), [d, r] = E(!1), [l, b] = E(null), [x, v] = E(t), [u, m] = E(!0), [C, w] = E(), y = M(async (R = !1, T) => {
|
|
1184
1279
|
if (d) return;
|
|
1185
|
-
const
|
|
1186
|
-
r(!0),
|
|
1280
|
+
const h = T !== void 0 ? T : x;
|
|
1281
|
+
r(!0), b(null);
|
|
1187
1282
|
try {
|
|
1188
|
-
const
|
|
1189
|
-
search:
|
|
1190
|
-
limit:
|
|
1191
|
-
cursor: R ? void 0 :
|
|
1283
|
+
const g = await n.loadParticipants({
|
|
1284
|
+
search: h || void 0,
|
|
1285
|
+
limit: o,
|
|
1286
|
+
cursor: R ? void 0 : C
|
|
1192
1287
|
});
|
|
1193
|
-
|
|
1194
|
-
(
|
|
1195
|
-
),
|
|
1196
|
-
} catch (
|
|
1197
|
-
const
|
|
1198
|
-
|
|
1288
|
+
c(
|
|
1289
|
+
(f) => R ? g.participants : [...f, ...g.participants]
|
|
1290
|
+
), m(g.hasMore), w(g.nextCursor);
|
|
1291
|
+
} catch (g) {
|
|
1292
|
+
const f = g instanceof Error ? g.message : "Failed to load participants";
|
|
1293
|
+
b(f), console.error("[useParticipants] Load error:", g);
|
|
1199
1294
|
} finally {
|
|
1200
1295
|
r(!1);
|
|
1201
1296
|
}
|
|
1202
|
-
}, [
|
|
1203
|
-
|
|
1204
|
-
}, [
|
|
1205
|
-
|
|
1206
|
-
}, [
|
|
1207
|
-
|
|
1208
|
-
}, [
|
|
1209
|
-
return
|
|
1210
|
-
|
|
1211
|
-
}, [
|
|
1297
|
+
}, [n, x, C, o, d]), D = M(() => {
|
|
1298
|
+
u && !d && y(!1);
|
|
1299
|
+
}, [u, d, y]), O = M((R) => {
|
|
1300
|
+
v(R), w(void 0), y(!0, R);
|
|
1301
|
+
}, [y]), I = M(() => {
|
|
1302
|
+
w(void 0), y(!0);
|
|
1303
|
+
}, [y]);
|
|
1304
|
+
return G(() => {
|
|
1305
|
+
y(!0);
|
|
1306
|
+
}, [n.loadParticipants]), {
|
|
1212
1307
|
participants: a,
|
|
1213
1308
|
loading: d,
|
|
1214
|
-
error:
|
|
1309
|
+
error: l,
|
|
1215
1310
|
searchQuery: x,
|
|
1216
|
-
hasMore:
|
|
1217
|
-
totalCount:
|
|
1218
|
-
loadMore:
|
|
1311
|
+
hasMore: u,
|
|
1312
|
+
totalCount: n.totalCount,
|
|
1313
|
+
loadMore: D,
|
|
1219
1314
|
search: O,
|
|
1220
|
-
refresh:
|
|
1315
|
+
refresh: I
|
|
1221
1316
|
};
|
|
1222
1317
|
};
|
|
1223
1318
|
export {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1319
|
+
ne as Avatar,
|
|
1320
|
+
je as ChannelList,
|
|
1321
|
+
Ge as ChannelView,
|
|
1322
|
+
Ke as MessagingProvider,
|
|
1323
|
+
es as MessagingShell,
|
|
1324
|
+
_e as ParticipantPicker,
|
|
1325
|
+
Le as useMessaging,
|
|
1326
|
+
ss as useParticipants
|
|
1232
1327
|
};
|
|
1233
1328
|
//# sourceMappingURL=index.js.map
|