@linktr.ee/messaging-react 1.4.1 → 1.5.1-rc-1761642868

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