@linktr.ee/messaging-react 1.13.1 → 1.14.1

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,11 +1,11 @@
1
- import { jsx as e, jsxs as o, Fragment as ve } from "react/jsx-runtime";
2
- import p from "classnames";
3
- import U, { createContext as Pe, useContext as Oe, useCallback as M, useState as y, useRef as z, useEffect as G } from "react";
4
- import { StreamChatService as je } from "@linktr.ee/messaging-core";
5
- import { Chat as Ae, ChannelList as ze, DateSeparator as Be, useMessageComposer as $e, useStateStore as Ge, MessageInput as He, useMessageInputContext as Ve, useMessageComposerHasSendableData as We, SimpleAttachmentSelector as Ze, QuotedMessagePreview as qe, AttachmentPreviewList as Ye, TextareaComposer as Je, MessageTimestamp as Qe, Channel as Xe, useChannelStateContext as we, Window as Ke, MessageList as es } from "stream-chat-react";
6
- import { XIcon as me, ArrowUpIcon as ss, ArrowLeftIcon as fe, DotsThreeIcon as ge, SpinnerGapIcon as re, SignOutIcon as ts, ProhibitInsetIcon as xe, FlagIcon as ns, MagnifyingGlassIcon as rs, ChatCircleDotsIcon as Ne } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as be } from "stream-chat";
8
- const ye = Pe({
1
+ import { jsx as e, jsxs as i, Fragment as Ne } from "react/jsx-runtime";
2
+ import S from "classnames";
3
+ import P, { createContext as $e, useContext as je, useCallback as T, useState as p, useRef as W, useEffect as q, useMemo as we } from "react";
4
+ import { StreamChatService as ze } from "@linktr.ee/messaging-core";
5
+ import { Chat as Ge, ChannelList as He, DateSeparator as Ve, areMessageUIPropsEqual as We, useChatContext as Ze, useTranslationContext as qe, useMessageReminder as Ye, useComponentContext as Je, Attachment as Qe, Avatar as Xe, EditMessageModal as Ke, MessageBlocked as es, MessageBouncePrompt as ss, MessageDeleted as ts, MessageIsThreadReplyInChannelButtonIndicator as ns, MessageRepliesCountButton as rs, MessageStatus as as, MessageTimestamp as ke, ReminderNotification as ls, StreamedMessageText as os, messageHasAttachments as is, messageHasReactions as cs, isDateSeparatorMessage as ds, isMessageBlocked as ms, isMessageBounced as us, isMessageEdited as hs, MessageBounceModal as fs, Poll as gs, MessageText as xs, MessageErrorIcon as Cs, MessageEditedTimestamp as Ns, useMessageContext as bs, useMessageComposer as vs, useStateStore as ws, MessageInput as ys, useMessageInputContext as ps, useMessageComposerHasSendableData as Es, SimpleAttachmentSelector as Is, QuotedMessagePreview as _s, AttachmentPreviewList as Ss, TextareaComposer as Ms, Channel as ks, useChannelStateContext as Re, WithComponents as Rs, Window as Ts, MessageList as Ds } from "stream-chat-react";
6
+ import { XIcon as be, GiftIcon as Fs, ArrowUpIcon as Ls, ArrowLeftIcon as ye, DotsThreeIcon as pe, SpinnerGapIcon as de, SignOutIcon as Ps, ProhibitInsetIcon as Ee, FlagIcon as Os, MagnifyingGlassIcon as Us, ChatCircleDotsIcon as Ie } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as _e } from "stream-chat";
8
+ const Te = $e({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,50 +15,50 @@ const ye = Pe({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), oe = () => Oe(ye), Ts = ({
18
+ }), he = () => je(Te), vt = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: r,
23
- capabilities: a = {},
24
- debug: i = !1
23
+ capabilities: o = {},
24
+ debug: c = !1
25
25
  }) => {
26
- const l = M(
27
- (u, ...b) => {
28
- i && console.log(`🔥 [MessagingProvider] ${u}`, ...b);
26
+ const a = T(
27
+ (h, ...v) => {
28
+ c && console.log(`🔥 [MessagingProvider] ${h}`, ...v);
29
29
  },
30
- [i]
30
+ [c]
31
31
  );
32
- l("🔄 RENDER START", {
32
+ a("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
34
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
- capabilities: Object.keys(a)
36
+ capabilities: Object.keys(o)
37
37
  });
38
- const [m, h] = y(null), [g, w] = y(null), [f, S] = y(!1), [_, v] = y(!1), [c, N] = y(null), E = z(!1), I = z({
38
+ const [u, g] = p(null), [x, w] = p(null), [f, l] = p(!1), [R, y] = p(!1), [d, N] = p(null), E = W(!1), I = W({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: r,
41
41
  serviceConfig: n,
42
- capabilities: a
43
- }), k = z(0);
44
- k.current++, l("📊 RENDER INFO", {
45
- renderCount: k.current,
42
+ capabilities: o
43
+ }), _ = W(0);
44
+ _.current++, a("📊 RENDER INFO", {
45
+ renderCount: _.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (r == null ? void 0 : r.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
48
  userChanged: I.current.userId !== (s == null ? void 0 : s.id),
49
49
  apiKeyChanged: I.current.apiKey !== r,
50
50
  serviceConfigChanged: I.current.serviceConfig !== n,
51
- capabilitiesChanged: I.current.capabilities !== a
51
+ capabilitiesChanged: I.current.capabilities !== o
52
52
  }
53
53
  }), I.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: r,
56
56
  serviceConfig: n,
57
- capabilities: a
58
- }, G(() => {
59
- const u = k.current;
60
- if (l("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: u,
57
+ capabilities: o
58
+ }, q(() => {
59
+ const h = _.current;
60
+ if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
+ renderCount: h,
62
62
  apiKey: !!r,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
@@ -68,166 +68,166 @@ const ye = Pe({
68
68
  apiKeyStable: I.current.apiKey === r
69
69
  }
70
70
  }), !r || !n) {
71
- l("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: u,
71
+ a("⚠️ SERVICE INIT SKIPPED", {
72
+ renderCount: h,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
- l("🚀 CREATING NEW SERVICE", {
78
- renderCount: u,
77
+ a("🚀 CREATING NEW SERVICE", {
78
+ renderCount: h,
79
79
  apiKey: (r == null ? void 0 : r.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const b = new je({
82
+ const v = new ze({
83
83
  ...n,
84
84
  apiKey: r,
85
- debug: i
85
+ debug: c
86
86
  });
87
- return h(b), l("✅ SERVICE SET", {
88
- renderCount: u,
89
- serviceInstance: !!b
87
+ return g(v), a("✅ SERVICE SET", {
88
+ renderCount: h,
89
+ serviceInstance: !!v
90
90
  }), () => {
91
- l("🧹 SERVICE CLEANUP", {
92
- renderCount: u,
91
+ a("🧹 SERVICE CLEANUP", {
92
+ renderCount: h,
93
93
  reason: "Effect cleanup"
94
- }), b.disconnectUser().catch(console.error);
94
+ }), v.disconnectUser().catch(console.error);
95
95
  };
96
- }, [r, n, i, l]);
97
- const x = z(null);
98
- G(() => {
99
- var b, B;
100
- if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!m,
96
+ }, [r, n, c, a]);
97
+ const C = W(null);
98
+ q(() => {
99
+ var v, G;
100
+ if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
+ hasService: !!u,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
104
  isConnecting: E.current,
105
105
  isConnected: f,
106
- dependencies: { service: !!m, userId: s == null ? void 0 : s.id }
107
- }), !m || !s) {
108
- l("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
106
+ dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
107
+ }), !u || !s) {
108
+ a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
111
  if (E.current) {
112
- l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
112
+ a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((b = x.current) == null ? void 0 : b.serviceId) === m && ((B = x.current) == null ? void 0 : B.userId) === s.id) {
116
- l(
115
+ if (((v = C.current) == null ? void 0 : v.serviceId) === u && ((G = C.current) == null ? void 0 : G.userId) === s.id) {
116
+ a(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
119
119
  );
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- l("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, v(!0), N(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, y(!0), N(null);
124
124
  try {
125
- l("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const j = await m.connectUser(s);
127
- w(j), S(!0), x.current = { serviceId: m, userId: s.id }, l("✅ USER CONNECTION SUCCESS", {
125
+ a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
+ const A = await u.connectUser(s);
127
+ w(A), l(!0), C.current = { serviceId: u, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: j.userID
129
+ clientId: A.userID
130
130
  });
131
- } catch (j) {
132
- const W = j instanceof Error ? j.message : "Connection failed";
133
- N(W), l("❌ USER CONNECTION ERROR", {
131
+ } catch (A) {
132
+ const Z = A instanceof Error ? A.message : "Connection failed";
133
+ N(Z), a("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: W
135
+ error: Z
136
136
  });
137
137
  } finally {
138
- v(!1), E.current = !1, l("🔄 USER CONNECTION FINISHED", {
138
+ y(!1), E.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [m, s, l, f]), G(() => (l("🔌 CLEANUP EFFECT REGISTERED", {
145
- hasService: !!m,
144
+ }, [u, s, a, f]), q(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!u,
146
146
  isConnected: f
147
147
  }), () => {
148
- m && f ? (l(
148
+ u && f ? (a(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), x.current = null, m.disconnectUser().catch(console.error)) : l("🔇 CLEANUP EFFECT SKIPPED", {
152
- hasService: !!m,
151
+ ), C.current = null, u.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!u,
153
153
  isConnected: f
154
154
  });
155
- }), [m, f, l]);
156
- const R = M(async () => {
157
- if (l("🔄 REFRESH CONNECTION CALLED", {
158
- hasService: !!m,
155
+ }), [u, f, a]);
156
+ const M = T(async () => {
157
+ if (a("🔄 REFRESH CONNECTION CALLED", {
158
+ hasService: !!u,
159
159
  hasUser: !!s
160
- }), !m || !s) {
161
- l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
160
+ }), !u || !s) {
161
+ a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- l("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), v(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
165
165
  try {
166
- l("🔌 DISCONNECTING FOR REFRESH"), await m.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
167
- const u = await m.connectUser(s);
168
- w(u), S(!0), N(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (u) {
170
- const b = u instanceof Error ? u.message : "Refresh failed";
171
- N(b), l("❌ CONNECTION REFRESH ERROR", {
166
+ a("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
+ const h = await u.connectUser(s);
168
+ w(h), l(!0), N(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (h) {
170
+ const v = h instanceof Error ? h.message : "Refresh failed";
171
+ N(v), a("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: b
173
+ error: v
174
174
  });
175
175
  } finally {
176
- v(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ y(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [m, s, l]), d = U.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!m,
180
- hasClient: !!g,
178
+ }, [u, s, a]), m = P.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!u,
180
+ hasClient: !!x,
181
181
  isConnected: f,
182
- isLoading: _,
183
- hasError: !!c,
184
- capabilitiesKeys: Object.keys(a)
182
+ isLoading: R,
183
+ hasError: !!d,
184
+ capabilitiesKeys: Object.keys(o)
185
185
  }), {
186
- service: m,
187
- client: g,
186
+ service: u,
187
+ client: x,
188
188
  isConnected: f,
189
- isLoading: _,
190
- error: c,
191
- capabilities: a,
192
- refreshConnection: R,
193
- debug: i
189
+ isLoading: R,
190
+ error: d,
191
+ capabilities: o,
192
+ refreshConnection: M,
193
+ debug: c
194
194
  }), [
195
- m,
196
- g,
195
+ u,
196
+ x,
197
197
  f,
198
- _,
199
- c,
200
- a,
201
198
  R,
202
- i,
203
- l
199
+ d,
200
+ o,
201
+ M,
202
+ c,
203
+ a
204
204
  ]);
205
- return l("🔄 RENDER END", {
206
- renderCount: k.current,
207
- willRenderChat: !!(g && f),
208
- contextValueReady: !!d
209
- }), /* @__PURE__ */ e(ye.Provider, { value: d, children: g && f ? /* @__PURE__ */ e(
210
- Ae,
205
+ return a("🔄 RENDER END", {
206
+ renderCount: _.current,
207
+ willRenderChat: !!(x && f),
208
+ contextValueReady: !!m
209
+ }), /* @__PURE__ */ e(Te.Provider, { value: m, children: x && f ? /* @__PURE__ */ e(
210
+ Ge,
211
211
  {
212
- client: g,
212
+ client: x,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, ls = () => oe(), as = (t, s) => {
219
+ }, Bs = () => he(), As = (t, s) => {
220
220
  const n = new Date(
221
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
- ), a = new Date(
222
+ ), o = new Date(
223
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
224
  ).getTime() - n.getTime();
225
- return Math.floor(a / (1e3 * 60 * 60 * 24));
226
- }, os = (t) => {
225
+ return Math.floor(o / (1e3 * 60 * 60 * 24));
226
+ }, $s = (t) => {
227
227
  const s = /* @__PURE__ */ new Date();
228
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
229
229
  return "Just now";
230
- const r = as(t, s);
230
+ const r = As(t, s);
231
231
  return r === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit",
@@ -237,7 +237,7 @@ const ye = Pe({
237
237
  day: "numeric",
238
238
  year: "2-digit"
239
239
  });
240
- }, Ce = [
240
+ }, Se = [
241
241
  "🍎",
242
242
  // Apple
243
243
  "🍌",
@@ -265,7 +265,7 @@ const ye = Pe({
265
265
  "🍈"
266
266
  // Melon
267
267
  ];
268
- function is(t) {
268
+ function js(t) {
269
269
  let s = 0;
270
270
  for (let n = 0; n < t.length; n++) {
271
271
  const r = t.charCodeAt(n);
@@ -273,29 +273,29 @@ function is(t) {
273
273
  }
274
274
  return Math.abs(s);
275
275
  }
276
- function cs(t) {
277
- const n = is(t) % Ce.length;
278
- return Ce[n];
276
+ function zs(t) {
277
+ const n = js(t) % Se.length;
278
+ return Se[n];
279
279
  }
280
- const q = ({
280
+ const te = ({
281
281
  id: t,
282
282
  image: s,
283
283
  size: n = 40,
284
284
  className: r,
285
- shape: a = "squircle"
285
+ shape: o = "squircle"
286
286
  }) => {
287
- const i = cs(t), m = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", h = a === "circle" ? { borderRadius: "50%" } : {
287
+ const c = zs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", g = o === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
291
291
  return /* @__PURE__ */ e(
292
292
  "div",
293
293
  {
294
- className: p("flex-shrink-0 overflow-hidden", r),
294
+ className: S("flex-shrink-0 overflow-hidden", r),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
298
- ...h
298
+ ...g
299
299
  },
300
300
  children: s ? /* @__PURE__ */ e(
301
301
  "img",
@@ -308,77 +308,77 @@ const q = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: p(
311
+ className: S(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
- m
313
+ u
314
314
  ),
315
- children: i
315
+ children: c
316
316
  }
317
317
  )
318
318
  }
319
319
  );
320
- }, Ee = U.memo(
321
- ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
322
- var N, E, I, k, x, R;
323
- const i = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
320
+ }, De = P.memo(
321
+ ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: o }) => {
322
+ var N, E, I, _, C, M;
323
+ const c = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), a = () => {
324
324
  t && n(t);
325
- }, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
326
- (d) => {
327
- var u, b;
328
- return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((b = t == null ? void 0 : t._client) == null ? void 0 : b.userID);
325
+ }, g = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
326
+ (m) => {
327
+ var h, v;
328
+ return ((h = m.user) == null ? void 0 : h.id) && m.user.id !== ((v = t == null ? void 0 : t._client) == null ? void 0 : v.userID);
329
329
  }
330
- ), g = ((E = h == null ? void 0 : h.user) == null ? void 0 : E.name) || "Conversation", w = (I = h == null ? void 0 : h.user) == null ? void 0 : I.image, f = (x = (k = t == null ? void 0 : t.state) == null ? void 0 : k.messages) == null ? void 0 : x[t.state.messages.length - 1], _ = (() => {
331
- var u;
330
+ ), x = ((E = g == null ? void 0 : g.user) == null ? void 0 : E.name) || "Conversation", w = (I = g == null ? void 0 : g.user) == null ? void 0 : I.image, f = (C = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages) == null ? void 0 : C[t.state.messages.length - 1], R = (() => {
331
+ var h;
332
332
  if (f != null && f.text) return f.text;
333
- const d = (u = f == null ? void 0 : f.attachments) == null ? void 0 : u[0];
334
- return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "📷 Sent an image" : d.type === "video" ? "🎥 Sent a video" : d.type === "audio" ? "🎵 Sent audio" : d.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
335
- })(), v = f != null && f.created_at ? os(new Date(f.created_at)) : "", c = a ?? 0;
333
+ const m = (h = f == null ? void 0 : f.attachments) == null ? void 0 : h[0];
334
+ return m ? m.og_scrape_url ? m.og_scrape_url : m.type === "image" ? "📷 Sent an image" : m.type === "video" ? "🎥 Sent a video" : m.type === "audio" ? "🎵 Sent audio" : m.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
335
+ })(), y = f != null && f.created_at ? $s(new Date(f.created_at)) : "", d = o ?? 0;
336
336
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
337
337
  channelId: t == null ? void 0 : t.id,
338
- isSelected: i,
339
- participantName: g,
340
- unreadCount: c,
341
- hasTimestamp: !!v
338
+ isSelected: c,
339
+ participantName: x,
340
+ unreadCount: d,
341
+ hasTimestamp: !!y
342
342
  }), /* @__PURE__ */ e(
343
343
  "button",
344
344
  {
345
345
  type: "button",
346
- onClick: l,
347
- className: p(
346
+ onClick: a,
347
+ className: S(
348
348
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
349
349
  {
350
- "bg-primary-alt/10 border-l-4 border-l-primary": i,
351
- "hover:bg-sand": !i
350
+ "bg-primary-alt/10 border-l-4 border-l-primary": c,
351
+ "hover:bg-sand": !c
352
352
  }
353
353
  ),
354
- children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
354
+ children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
355
355
  /* @__PURE__ */ e(
356
- q,
356
+ te,
357
357
  {
358
- id: ((R = h == null ? void 0 : h.user) == null ? void 0 : R.id) || t.id || "unknown",
359
- name: g,
358
+ id: ((M = g == null ? void 0 : g.user) == null ? void 0 : M.id) || t.id || "unknown",
359
+ name: x,
360
360
  image: w,
361
361
  size: 44,
362
362
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
363
363
  }
364
364
  ),
365
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
366
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2", children: [
365
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
366
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2", children: [
367
367
  /* @__PURE__ */ e(
368
368
  "h3",
369
369
  {
370
- className: p(
370
+ className: S(
371
371
  "text-sm font-medium truncate",
372
- i ? "text-primary" : "text-charcoal"
372
+ c ? "text-primary" : "text-charcoal"
373
373
  ),
374
- children: g
374
+ children: x
375
375
  }
376
376
  ),
377
- v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
377
+ y && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: y })
378
378
  ] }),
379
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
380
- /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: _ }),
381
- c > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: c > 99 ? "99+" : c })
379
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
380
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: R }),
381
+ d > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: d > 99 ? "99+" : d })
382
382
  ] })
383
383
  ] })
384
384
  ] })
@@ -386,47 +386,47 @@ const q = ({
386
386
  );
387
387
  }
388
388
  );
389
- Ee.displayName = "CustomChannelPreview";
390
- const Ie = U.memo(
389
+ De.displayName = "CustomChannelPreview";
390
+ const Fe = P.memo(
391
391
  ({
392
392
  onChannelSelect: t,
393
393
  selectedChannel: s,
394
394
  filters: n,
395
395
  className: r,
396
- customEmptyStateIndicator: a
396
+ customEmptyStateIndicator: o
397
397
  }) => {
398
- const i = U.useRef(0);
399
- i.current++;
400
- const { debug: l = !1 } = oe();
401
- l && console.log("📺 [ChannelList] 🔄 RENDER START", {
402
- renderCount: i.current,
398
+ const c = P.useRef(0);
399
+ c.current++;
400
+ const { debug: a = !1 } = he();
401
+ a && console.log("📺 [ChannelList] 🔄 RENDER START", {
402
+ renderCount: c.current,
403
403
  selectedChannelId: s == null ? void 0 : s.id,
404
404
  filters: n
405
405
  });
406
- const m = U.useMemo(() => (g) => /* @__PURE__ */ e(
407
- Ee,
406
+ const u = P.useMemo(() => (x) => /* @__PURE__ */ e(
407
+ De,
408
408
  {
409
- ...g,
409
+ ...x,
410
410
  selectedChannel: s,
411
411
  onChannelSelect: t,
412
- debug: l
412
+ debug: a
413
413
  }
414
- ), [s, t, l]);
414
+ ), [s, t, a]);
415
415
  return /* @__PURE__ */ e(
416
416
  "div",
417
417
  {
418
- className: p(
418
+ className: S(
419
419
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
420
420
  r
421
421
  ),
422
422
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
423
- ze,
423
+ He,
424
424
  {
425
425
  filters: n,
426
426
  sort: { last_message_at: -1 },
427
427
  options: { limit: 30 },
428
- Preview: m,
429
- EmptyStateIndicator: a
428
+ Preview: u,
429
+ EmptyStateIndicator: o
430
430
  },
431
431
  JSON.stringify(n)
432
432
  ) })
@@ -434,8 +434,8 @@ const Ie = U.memo(
434
434
  );
435
435
  }
436
436
  );
437
- Ie.displayName = "ChannelList";
438
- const ne = ({
437
+ Fe.displayName = "ChannelList";
438
+ const ce = ({
439
439
  variant: t = "default",
440
440
  className: s,
441
441
  children: n,
@@ -444,7 +444,7 @@ const ne = ({
444
444
  "button",
445
445
  {
446
446
  type: "button",
447
- className: p(
447
+ className: S(
448
448
  "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",
449
449
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
450
450
  s
@@ -453,12 +453,12 @@ const ne = ({
453
453
  children: n
454
454
  }
455
455
  );
456
- function Se({ label: t, className: s, children: n, ...r }) {
457
- return /* @__PURE__ */ o(
456
+ function Le({ label: t, className: s, children: n, ...r }) {
457
+ return /* @__PURE__ */ i(
458
458
  "button",
459
459
  {
460
460
  type: "button",
461
- className: p(
461
+ className: S(
462
462
  "rounded-full p-2 transition-colors focus-ring",
463
463
  {
464
464
  "cursor-not-allowed opacity-50": r.disabled,
@@ -474,19 +474,213 @@ function Se({ label: t, className: s, children: n, ...r }) {
474
474
  }
475
475
  );
476
476
  }
477
- function pe({ onClick: t }) {
478
- return /* @__PURE__ */ e(Se, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(me, { className: "h-5 w-5 text-stone", weight: "bold" }) });
477
+ function Pe({ onClick: t }) {
478
+ return /* @__PURE__ */ e(Le, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(be, { className: "h-5 w-5 text-stone", weight: "bold" }) });
479
479
  }
480
- const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t) => ({
480
+ const Gs = (t) => /* @__PURE__ */ e(Ve, { ...t, position: "center" }), Hs = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
481
+ "path",
482
+ {
483
+ d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
484
+ fill: "currentColor"
485
+ }
486
+ ) }), Vs = (t) => {
487
+ var s;
488
+ return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
489
+ }, Ws = (t) => {
490
+ var s;
491
+ return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
492
+ }, Zs = (t) => {
493
+ var s;
494
+ return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
495
+ }, Oe = (t) => Vs(t) || Ws(t), qs = (t) => {
496
+ var s;
497
+ return Oe(t) && !((s = t.text) != null && s.trim());
498
+ }, Me = ({
499
+ message: t,
500
+ standalone: s = !1
501
+ }) => {
502
+ var o;
503
+ const n = Oe(t), r = Zs(t);
504
+ if (!n && !r)
505
+ return null;
506
+ if (n) {
507
+ const c = (o = t.metadata) == null ? void 0 : o.amount_text;
508
+ if (!c) return null;
509
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
510
+ return /* @__PURE__ */ i("div", { className: a, children: [
511
+ /* @__PURE__ */ e(Fs, { size: s ? 14 : 12 }),
512
+ /* @__PURE__ */ e("span", { children: u })
513
+ ] });
514
+ }
515
+ return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
516
+ /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Hs, {}) }),
517
+ /* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
518
+ ] });
519
+ }, Ys = (t) => {
520
+ var X, b;
521
+ const {
522
+ additionalMessageInputProps: s,
523
+ editing: n,
524
+ endOfGroup: r,
525
+ firstOfGroup: o,
526
+ groupedByUser: c,
527
+ handleAction: a,
528
+ handleOpenThread: u,
529
+ handleRetry: g,
530
+ highlighted: x,
531
+ isMessageAIGenerated: w,
532
+ isMyMessage: f,
533
+ message: l,
534
+ onUserClick: R,
535
+ onUserHover: y,
536
+ renderText: d,
537
+ threadList: N
538
+ } = t, { client: E } = Ze("CustomMessage"), { t: I } = qe("CustomMessage"), [_, C] = p(!1), [M, m] = p(!1), h = Ye(l.id), {
539
+ Attachment: v = Qe,
540
+ Avatar: G = Xe,
541
+ EditMessageModal: A = Ke,
542
+ MessageBlocked: Z = es,
543
+ MessageBouncePrompt: Y = ss,
544
+ MessageDeleted: ne = ts,
545
+ MessageIsThreadReplyInChannelButtonIndicator: K = ns,
546
+ MessageRepliesCountButton: ee = rs,
547
+ MessageStatus: re = as,
548
+ MessageTimestamp: O = ke,
549
+ ReminderNotification: H = ls,
550
+ StreamedMessageText: J = os,
551
+ PinIndicator: z
552
+ } = Je("CustomMessage"), k = is(l), D = cs(l), U = we(
553
+ () => w == null ? void 0 : w(l),
554
+ [w, l]
555
+ ), $ = we(
556
+ () => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
557
+ [l]
558
+ );
559
+ if (ds(l))
560
+ return null;
561
+ if (l.deleted_at || l.type === "deleted")
562
+ return /* @__PURE__ */ e(ne, { message: l });
563
+ if (ms(l))
564
+ return /* @__PURE__ */ e(Z, {});
565
+ const se = !c || r, Q = !N && !!l.reply_count, V = !N && l.show_in_channel && l.parent_id, le = l.status === "failed" && ((X = l.error) == null ? void 0 : X.status) !== 403, oe = us(l), ae = hs(l) && !U;
566
+ let j;
567
+ le ? j = () => g(l) : oe ? j = () => C(!0) : ae && (j = () => m((L) => !L));
568
+ const fe = S(
569
+ "str-chat__message str-chat__message-simple",
570
+ `str-chat__message--${l.type}`,
571
+ `str-chat__message--${l.status}`,
572
+ f() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
573
+ l.text ? "str-chat__message--has-text" : "has-no-text",
574
+ {
575
+ "str-chat__message--has-attachment": k,
576
+ "str-chat__message--highlighted": x,
577
+ "str-chat__message--pinned pinned-message": l.pinned,
578
+ "str-chat__message--with-reactions": D,
579
+ "str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((b = l == null ? void 0 : l.error) == null ? void 0 : b.status) !== 403,
580
+ "str-chat__message-with-thread-link": Q || V,
581
+ "str-chat__virtual-message__wrapper--end": r,
582
+ "str-chat__virtual-message__wrapper--first": o,
583
+ "str-chat__virtual-message__wrapper--group": c
584
+ }
585
+ ), ie = l.poll_id && E.polls.fromState(l.poll_id), ge = qs(l);
586
+ return /* @__PURE__ */ i(Ne, { children: [
587
+ n && /* @__PURE__ */ e(
588
+ A,
589
+ {
590
+ additionalMessageInputProps: s
591
+ }
592
+ ),
593
+ _ && /* @__PURE__ */ e(
594
+ fs,
595
+ {
596
+ MessageBouncePrompt: Y,
597
+ onClose: () => C(!1),
598
+ open: _
599
+ }
600
+ ),
601
+ /* @__PURE__ */ i("div", { className: fe, children: [
602
+ z && /* @__PURE__ */ e(z, {}),
603
+ !!h && /* @__PURE__ */ e(H, { reminder: h }),
604
+ l.user && /* @__PURE__ */ e(
605
+ G,
606
+ {
607
+ image: l.user.image,
608
+ name: l.user.name || l.user.id,
609
+ onClick: R,
610
+ onMouseOver: y,
611
+ user: l.user
612
+ }
613
+ ),
614
+ /* @__PURE__ */ e(
615
+ "div",
616
+ {
617
+ className: S("str-chat__message-inner", {
618
+ "str-chat__simple-message--error-failed": le || oe
619
+ }),
620
+ "data-testid": "message-inner",
621
+ onClick: j,
622
+ onKeyDown: j,
623
+ role: j ? "button" : void 0,
624
+ tabIndex: j ? 0 : void 0,
625
+ children: ge ? (
626
+ /* Tip-only messages render as a standalone bubble */
627
+ /* @__PURE__ */ e(Me, { message: l, standalone: !0 })
628
+ ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
629
+ /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
630
+ ie && /* @__PURE__ */ e(gs, { poll: ie }),
631
+ $ != null && $.length && !l.quoted_message ? /* @__PURE__ */ e(
632
+ v,
633
+ {
634
+ actionHandler: a,
635
+ attachments: $
636
+ }
637
+ ) : null,
638
+ U ? /* @__PURE__ */ e(
639
+ J,
640
+ {
641
+ message: l,
642
+ renderText: d
643
+ }
644
+ ) : /* @__PURE__ */ e(xs, { message: l, renderText: d }),
645
+ /* @__PURE__ */ e(Cs, {})
646
+ ] }),
647
+ /* @__PURE__ */ e(Me, { message: l })
648
+ ] })
649
+ }
650
+ ),
651
+ Q && /* @__PURE__ */ e(
652
+ ee,
653
+ {
654
+ onClick: u,
655
+ reply_count: l.reply_count
656
+ }
657
+ ),
658
+ V && /* @__PURE__ */ e(K, {}),
659
+ se && /* @__PURE__ */ i("div", { className: "str-chat__message-metadata", children: [
660
+ /* @__PURE__ */ e(re, {}),
661
+ !f() && !!l.user && /* @__PURE__ */ e("span", { className: "str-chat__message-simple-name", children: l.user.name || l.user.id }),
662
+ /* @__PURE__ */ e(O, { customClass: "str-chat__message-simple-timestamp" }),
663
+ ae && /* @__PURE__ */ e("span", { className: "str-chat__mesage-simple-edited", children: I("Edited") }),
664
+ ae && /* @__PURE__ */ e(Ns, { calendar: !0, open: M })
665
+ ] })
666
+ ] }, l.id)
667
+ ] });
668
+ }, Js = P.memo(
669
+ Ys,
670
+ We
671
+ ), Qs = (t) => {
672
+ const s = bs("CustomMessage");
673
+ return /* @__PURE__ */ e(Js, { ...s, ...t });
674
+ }, Xs = (t) => ({
481
675
  linkPreviews: Array.from(t.previews.values()).filter(
482
- (s) => be.previewIsLoaded(s) || be.previewIsLoading(s)
676
+ (s) => _e.previewIsLoaded(s) || _e.previewIsLoading(s)
483
677
  )
484
- }), ms = ({
678
+ }), Ks = ({
485
679
  link: t,
486
680
  onDismiss: s
487
681
  }) => {
488
- const { og_scrape_url: n, title: r, image_url: a } = t;
489
- return /* @__PURE__ */ o(
682
+ const { og_scrape_url: n, title: r, image_url: o } = t;
683
+ return /* @__PURE__ */ i(
490
684
  "a",
491
685
  {
492
686
  href: n,
@@ -494,10 +688,10 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
494
688
  rel: "noopener noreferrer",
495
689
  className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
496
690
  children: [
497
- a && /* @__PURE__ */ e(
691
+ o && /* @__PURE__ */ e(
498
692
  "img",
499
693
  {
500
- src: a,
694
+ src: o,
501
695
  alt: r || "",
502
696
  className: "h-[148px] w-full rounded-[20px] object-cover"
503
697
  }
@@ -506,47 +700,47 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
506
700
  "button",
507
701
  {
508
702
  type: "button",
509
- onClick: (l) => {
510
- l.preventDefault(), s(n);
703
+ onClick: (a) => {
704
+ a.preventDefault(), s(n);
511
705
  },
512
706
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl",
513
707
  "aria-label": "Close link preview",
514
- children: /* @__PURE__ */ e(me, { className: "size-4 text-black/90" })
708
+ children: /* @__PURE__ */ e(be, { className: "size-4 text-black/90" })
515
709
  }
516
710
  ),
517
- /* @__PURE__ */ o("div", { className: "p-2", children: [
711
+ /* @__PURE__ */ i("div", { className: "p-2", children: [
518
712
  r && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: r }),
519
713
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
520
714
  ] })
521
715
  ]
522
716
  }
523
717
  );
524
- }, hs = () => {
525
- const { linkPreviewsManager: t } = $e(), { linkPreviews: s } = Ge(
718
+ }, et = () => {
719
+ const { linkPreviewsManager: t } = vs(), { linkPreviews: s } = ws(
526
720
  t.state,
527
- us
528
- ), n = (a) => {
529
- t.dismissPreview(a);
721
+ Xs
722
+ ), n = (o) => {
723
+ t.dismissPreview(o);
530
724
  };
531
- return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((a) => /* @__PURE__ */ e(
532
- ms,
725
+ return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
726
+ Ks,
533
727
  {
534
- link: a,
728
+ link: o,
535
729
  onDismiss: n
536
730
  },
537
- a.og_scrape_url
731
+ o.og_scrape_url
538
732
  )) }) : null;
539
- }, fs = () => {
540
- const { handleSubmit: t } = Ve(), s = We();
541
- return /* @__PURE__ */ o(ve, { children: [
542
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ze, {}) }),
543
- /* @__PURE__ */ o("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
544
- /* @__PURE__ */ e(qe, {}),
545
- /* @__PURE__ */ e(hs, {}),
546
- /* @__PURE__ */ e(Ye, {}),
547
- /* @__PURE__ */ o("div", { className: "flex", children: [
733
+ }, st = () => {
734
+ const { handleSubmit: t } = ps(), s = Es();
735
+ return /* @__PURE__ */ i(Ne, { children: [
736
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Is, {}) }),
737
+ /* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
738
+ /* @__PURE__ */ e(_s, {}),
739
+ /* @__PURE__ */ e(et, {}),
740
+ /* @__PURE__ */ e(Ss, {}),
741
+ /* @__PURE__ */ i("div", { className: "flex", children: [
548
742
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
549
- Je,
743
+ Ms,
550
744
  {
551
745
  className: "w-full resize-none outline-none leading-6",
552
746
  autoFocus: !0,
@@ -562,33 +756,33 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
562
756
  disabled: !s,
563
757
  onClick: t,
564
758
  type: "button",
565
- children: /* @__PURE__ */ e(ss, { className: "size-4" })
759
+ children: /* @__PURE__ */ e(Ls, { className: "size-4" })
566
760
  }
567
761
  )
568
762
  ] })
569
763
  ] })
570
764
  ] });
571
- }, gs = ({
765
+ }, tt = ({
572
766
  renderActions: t
573
- }) => /* @__PURE__ */ o("div", { className: "message-input flex items-center gap-2 p-4", children: [
767
+ }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
574
768
  t && (t == null ? void 0 : t()),
575
- /* @__PURE__ */ e(He, { Input: fs })
576
- ] }), xs = (t) => {
769
+ /* @__PURE__ */ e(ys, { Input: st })
770
+ ] }), nt = (t) => {
577
771
  const s = t.message.hide_date === !0;
578
- return /* @__PURE__ */ o("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
579
- /* @__PURE__ */ o("div", { className: "str-chat__message--system__text", children: [
772
+ return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
773
+ /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
580
774
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
581
775
  /* @__PURE__ */ e("p", { children: t.message.text }),
582
776
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
583
777
  ] }),
584
- !s && /* @__PURE__ */ e(Qe, { message: t.message })
778
+ !s && /* @__PURE__ */ e(ke, { message: t.message })
585
779
  ] });
586
- }, Ns = () => null, bs = ({ className: t, message: s }) => /* @__PURE__ */ o(
780
+ }, rt = () => null, at = ({ className: t, message: s }) => /* @__PURE__ */ i(
587
781
  "div",
588
782
  {
589
- className: p("flex items-center justify-center h-full", t),
783
+ className: S("flex items-center justify-center h-full", t),
590
784
  children: [
591
- /* @__PURE__ */ o("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
785
+ /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
592
786
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
593
787
  "animateTransform",
594
788
  {
@@ -626,25 +820,25 @@ const ds = (t) => /* @__PURE__ */ e(Be, { ...t, position: "center" }), us = (t)
626
820
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
627
821
  ]
628
822
  }
629
- ), ae = U.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ o("div", { className: "flex items-center", children: [
630
- /* @__PURE__ */ e(bs, { className: "w-6 h-6" }),
823
+ ), ue = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
824
+ /* @__PURE__ */ e(at, { className: "w-6 h-6" }),
631
825
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
632
826
  ] }) }));
633
- ae.displayName = "LoadingState";
634
- const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
635
- var h, g, w, f, S;
636
- const { channel: a } = we(), i = U.useMemo(() => Object.values(a.state.members || {}).find(
637
- (v) => {
638
- var c;
639
- return ((c = v.user) == null ? void 0 : c.id) && v.user.id !== a._client.userID;
827
+ ue.displayName = "LoadingState";
828
+ const lt = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
829
+ var g, x, w, f, l;
830
+ const { channel: o } = Re(), c = P.useMemo(() => Object.values(o.state.members || {}).find(
831
+ (y) => {
832
+ var d;
833
+ return ((d = y.user) == null ? void 0 : d.id) && y.user.id !== o._client.userID;
640
834
  }
641
- ), [a._client.userID, a.state.members]), l = ((h = i == null ? void 0 : i.user) == null ? void 0 : h.name) || ((g = i == null ? void 0 : i.user) == null ? void 0 : g.id) || "Unknown member", m = (w = i == null ? void 0 : i.user) == null ? void 0 : w.image;
642
- return /* @__PURE__ */ o("div", { className: "@container", children: [
643
- /* @__PURE__ */ o("div", { className: "flex justify-between items-center @lg:hidden", children: [
835
+ ), [o._client.userID, o.state.members]), a = ((g = c == null ? void 0 : c.user) == null ? void 0 : g.name) || ((x = c == null ? void 0 : c.user) == null ? void 0 : x.id) || "Unknown member", u = (w = c == null ? void 0 : c.user) == null ? void 0 : w.image;
836
+ return /* @__PURE__ */ i("div", { className: "@container", children: [
837
+ /* @__PURE__ */ i("div", { className: "flex justify-between items-center @lg:hidden", children: [
644
838
  /* @__PURE__ */ e(
645
839
  "button",
646
840
  {
647
- className: p(
841
+ className: S(
648
842
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
649
843
  !s && "invisible"
650
844
  ),
@@ -652,36 +846,36 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
652
846
  }),
653
847
  type: "button",
654
848
  "aria-label": "Back to conversations",
655
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
849
+ children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
656
850
  }
657
851
  ),
658
- /* @__PURE__ */ o("div", { className: "flex flex-col gap-1 items-center", children: [
852
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
659
853
  /* @__PURE__ */ e(
660
- q,
854
+ te,
661
855
  {
662
- id: ((f = i == null ? void 0 : i.user) == null ? void 0 : f.id) || a.id || "unknown",
663
- name: l,
664
- image: m,
856
+ id: ((f = c == null ? void 0 : c.user) == null ? void 0 : f.id) || o.id || "unknown",
857
+ name: a,
858
+ image: u,
665
859
  size: 40
666
860
  }
667
861
  ),
668
- /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: l })
862
+ /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: a })
669
863
  ] }),
670
864
  /* @__PURE__ */ e(
671
865
  "button",
672
866
  {
673
- className: p(
867
+ className: S(
674
868
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
675
869
  ),
676
870
  onClick: n,
677
871
  type: "button",
678
872
  "aria-label": "Show info",
679
- children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
873
+ children: /* @__PURE__ */ e(pe, { className: "size-5 text-black/90" })
680
874
  }
681
875
  )
682
876
  ] }),
683
- /* @__PURE__ */ o("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
684
- /* @__PURE__ */ o("div", { className: "flex items-center gap-4 min-w-0", children: [
877
+ /* @__PURE__ */ i("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
878
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-4 min-w-0", children: [
685
879
  s && t && /* @__PURE__ */ e(
686
880
  "button",
687
881
  {
@@ -689,105 +883,105 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
689
883
  onClick: t,
690
884
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
691
885
  "aria-label": "Back to conversations",
692
- children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
886
+ children: /* @__PURE__ */ e(ye, { className: "size-5 text-black/90" })
693
887
  }
694
888
  ),
695
889
  /* @__PURE__ */ e(
696
- q,
890
+ te,
697
891
  {
698
- id: ((S = i == null ? void 0 : i.user) == null ? void 0 : S.id) || a.id || "unknown",
699
- name: l,
700
- image: m,
892
+ id: ((l = c == null ? void 0 : c.user) == null ? void 0 : l.id) || o.id || "unknown",
893
+ name: a,
894
+ image: u,
701
895
  size: 40
702
896
  }
703
897
  ),
704
- /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: l }) })
898
+ /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: a }) })
705
899
  ] }),
706
900
  r && n && /* @__PURE__ */ e(
707
901
  "button",
708
902
  {
709
- className: p(
903
+ className: S(
710
904
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
711
905
  ),
712
906
  onClick: n,
713
- children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
907
+ children: /* @__PURE__ */ e(pe, { className: "size-5 text-black/90" })
714
908
  }
715
909
  )
716
910
  ] })
717
911
  ] });
718
- }, vs = ({
912
+ }, ot = ({
719
913
  dialogRef: t,
720
914
  onClose: s,
721
915
  participant: n,
722
916
  channel: r,
723
- followerStatusLabel: a,
724
- onLeaveConversation: i,
725
- onBlockParticipant: l,
726
- showDeleteConversation: m = !0,
727
- onDeleteConversationClick: h,
728
- onBlockParticipantClick: g,
917
+ followerStatusLabel: o,
918
+ onLeaveConversation: c,
919
+ onBlockParticipant: a,
920
+ showDeleteConversation: u = !0,
921
+ onDeleteConversationClick: g,
922
+ onBlockParticipantClick: x,
729
923
  onReportParticipantClick: w
730
924
  }) => {
731
- var Q, X, ce, O, H, J, $;
732
- const { service: f, debug: S } = oe(), [_, v] = y(!1), [c, N] = y(!1), [E, I] = y(!1), k = M(async () => {
733
- var D;
734
- if (!(!f || !((D = n == null ? void 0 : n.user) != null && D.id)))
925
+ var K, ee, re, O, H, J, z;
926
+ const { service: f, debug: l } = he(), [R, y] = p(!1), [d, N] = p(!1), [E, I] = p(!1), _ = T(async () => {
927
+ var k;
928
+ if (!(!f || !((k = n == null ? void 0 : n.user) != null && k.id)))
735
929
  try {
736
- const A = (await f.getBlockedUsers()).some(
737
- (V) => {
738
- var K;
739
- return V.blocked_user_id === ((K = n == null ? void 0 : n.user) == null ? void 0 : K.id);
930
+ const U = (await f.getBlockedUsers()).some(
931
+ ($) => {
932
+ var se;
933
+ return $.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
740
934
  }
741
935
  );
742
- v(A);
743
- } catch (T) {
936
+ y(U);
937
+ } catch (D) {
744
938
  console.error(
745
939
  "[ChannelInfoDialog] Failed to check blocked status:",
746
- T
940
+ D
747
941
  );
748
942
  }
749
- }, [f, (Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id]);
750
- G(() => {
751
- k();
752
- }, [k]);
753
- const x = async () => {
754
- var D;
755
- if (!c) {
756
- h == null || h(), S && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
943
+ }, [f, (K = n == null ? void 0 : n.user) == null ? void 0 : K.id]);
944
+ q(() => {
945
+ _();
946
+ }, [_]);
947
+ const C = async () => {
948
+ var k;
949
+ if (!d) {
950
+ g == null || g(), l && console.log("[ChannelInfoDialog] Leave conversation", r.cid), N(!0);
757
951
  try {
758
- const T = ((D = r._client) == null ? void 0 : D.userID) ?? null;
759
- await r.hide(T, !1), i && await i(r), s();
760
- } catch (T) {
761
- console.error("[ChannelInfoDialog] Failed to leave conversation", T);
952
+ const D = ((k = r._client) == null ? void 0 : k.userID) ?? null;
953
+ await r.hide(D, !1), c && await c(r), s();
954
+ } catch (D) {
955
+ console.error("[ChannelInfoDialog] Failed to leave conversation", D);
762
956
  } finally {
763
957
  N(!1);
764
958
  }
765
959
  }
766
- }, R = async () => {
767
- var D, T, A;
960
+ }, M = async () => {
961
+ var k, D, U;
768
962
  if (!(E || !f)) {
769
- g == null || g(), S && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), I(!0);
963
+ x == null || x(), l && console.log("[ChannelInfoDialog] Block member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), I(!0);
770
964
  try {
771
- await f.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
772
- } catch (V) {
773
- console.error("[ChannelInfoDialog] Failed to block member", V);
965
+ await f.blockUser((D = n == null ? void 0 : n.user) == null ? void 0 : D.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
966
+ } catch ($) {
967
+ console.error("[ChannelInfoDialog] Failed to block member", $);
774
968
  } finally {
775
969
  I(!1);
776
970
  }
777
971
  }
778
- }, d = async () => {
779
- var D, T, A;
972
+ }, m = async () => {
973
+ var k, D, U;
780
974
  if (!(E || !f)) {
781
- g == null || g(), S && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), I(!0);
975
+ x == null || x(), l && console.log("[ChannelInfoDialog] Unblock member", (k = n == null ? void 0 : n.user) == null ? void 0 : k.id), I(!0);
782
976
  try {
783
- await f.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), l && await l((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
784
- } catch (V) {
785
- console.error("[ChannelInfoDialog] Failed to unblock member", V);
977
+ await f.unBlockUser((D = n == null ? void 0 : n.user) == null ? void 0 : D.id), a && await a((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), s();
978
+ } catch ($) {
979
+ console.error("[ChannelInfoDialog] Failed to unblock member", $);
786
980
  } finally {
787
981
  I(!1);
788
982
  }
789
983
  }
790
- }, u = () => {
984
+ }, h = () => {
791
985
  w == null || w(), s(), window.open(
792
986
  "https://linktr.ee/s/about/trust-center/report",
793
987
  "_blank",
@@ -795,7 +989,7 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
795
989
  );
796
990
  };
797
991
  if (!n) return null;
798
- const b = ((X = n.user) == null ? void 0 : X.name) || ((ce = n.user) == null ? void 0 : ce.id) || "Unknown member", B = (O = n.user) == null ? void 0 : O.image, j = (H = n.user) == null ? void 0 : H.email, W = (J = n.user) == null ? void 0 : J.username, Y = j || (W ? `linktr.ee/${W}` : void 0), ie = (($ = n.user) == null ? void 0 : $.id) || "unknown";
992
+ const v = ((ee = n.user) == null ? void 0 : ee.name) || ((re = n.user) == null ? void 0 : re.id) || "Unknown member", G = (O = n.user) == null ? void 0 : O.image, A = (H = n.user) == null ? void 0 : H.email, Z = (J = n.user) == null ? void 0 : J.username, Y = A || (Z ? `linktr.ee/${Z}` : void 0), ne = ((z = n.user) == null ? void 0 : z.id) || "unknown";
799
993
  return (
800
994
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
801
995
  /* @__PURE__ */ e(
@@ -804,90 +998,90 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
804
998
  ref: t,
805
999
  className: "mes-dialog group",
806
1000
  onClose: s,
807
- onClick: (D) => {
808
- D.target === t.current && s();
1001
+ onClick: (k) => {
1002
+ k.target === t.current && s();
809
1003
  },
810
- children: /* @__PURE__ */ o("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
811
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1004
+ children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
1005
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
812
1006
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
813
- /* @__PURE__ */ e(pe, { onClick: s })
1007
+ /* @__PURE__ */ e(Pe, { onClick: s })
814
1008
  ] }),
815
- /* @__PURE__ */ o("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1009
+ /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
816
1010
  /* @__PURE__ */ e(
817
1011
  "div",
818
1012
  {
819
1013
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
820
1014
  style: { backgroundColor: "#FBFAF9" },
821
- children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3 w-full", children: [
1015
+ children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
822
1016
  /* @__PURE__ */ e(
823
- q,
1017
+ te,
824
1018
  {
825
- id: ie,
826
- name: b,
827
- image: B,
1019
+ id: ne,
1020
+ name: v,
1021
+ image: G,
828
1022
  size: 88,
829
1023
  shape: "circle"
830
1024
  }
831
1025
  ),
832
- /* @__PURE__ */ o("div", { className: "flex flex-col min-w-0 flex-1", children: [
833
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: b }),
1026
+ /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1027
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: v }),
834
1028
  Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
835
- a && /* @__PURE__ */ e(
1029
+ o && /* @__PURE__ */ e(
836
1030
  "span",
837
1031
  {
838
1032
  className: "mt-1 rounded-full text-xs font-normal w-fit",
839
1033
  style: {
840
1034
  padding: "4px 8px",
841
- backgroundColor: a === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
842
- color: a === "Subscribed to you" ? "#008236" : "#78716C",
1035
+ backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
1036
+ color: o === "Subscribed to you" ? "#008236" : "#78716C",
843
1037
  lineHeight: "133.333%",
844
1038
  letterSpacing: "0.21px"
845
1039
  },
846
- children: a
1040
+ children: o
847
1041
  }
848
1042
  )
849
1043
  ] })
850
1044
  ] })
851
1045
  }
852
1046
  ),
853
- /* @__PURE__ */ o("ul", { className: "flex flex-col gap-2 mt-2", children: [
854
- m && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
855
- ne,
1047
+ /* @__PURE__ */ i("ul", { className: "flex flex-col gap-2 mt-2", children: [
1048
+ u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1049
+ ce,
856
1050
  {
857
- onClick: x,
858
- disabled: c,
859
- "aria-busy": c,
1051
+ onClick: C,
1052
+ disabled: d,
1053
+ "aria-busy": d,
860
1054
  children: [
861
- c ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
1055
+ d ? /* @__PURE__ */ e(de, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ps, { className: "h-5 w-5" }),
862
1056
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
863
1057
  ]
864
1058
  }
865
1059
  ) }),
866
- /* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ o(
867
- ne,
1060
+ /* @__PURE__ */ e("li", { children: R ? /* @__PURE__ */ i(
1061
+ ce,
868
1062
  {
869
- onClick: d,
1063
+ onClick: m,
870
1064
  disabled: E,
871
1065
  "aria-busy": E,
872
1066
  children: [
873
- E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
1067
+ E ? /* @__PURE__ */ e(de, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ee, { className: "h-5 w-5" }),
874
1068
  /* @__PURE__ */ e("span", { children: "Unblock" })
875
1069
  ]
876
1070
  }
877
- ) : /* @__PURE__ */ o(
878
- ne,
1071
+ ) : /* @__PURE__ */ i(
1072
+ ce,
879
1073
  {
880
- onClick: R,
1074
+ onClick: M,
881
1075
  disabled: E,
882
1076
  "aria-busy": E,
883
1077
  children: [
884
- E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
1078
+ E ? /* @__PURE__ */ e(de, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ee, { className: "h-5 w-5" }),
885
1079
  /* @__PURE__ */ e("span", { children: "Block" })
886
1080
  ]
887
1081
  }
888
1082
  ) }),
889
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(ne, { variant: "danger", onClick: u, children: [
890
- /* @__PURE__ */ e(ns, { className: "h-5 w-5" }),
1083
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(ce, { variant: "danger", onClick: h, children: [
1084
+ /* @__PURE__ */ e(Os, { className: "h-5 w-5" }),
891
1085
  /* @__PURE__ */ e("span", { children: "Report" })
892
1086
  ] }) })
893
1087
  ] })
@@ -896,118 +1090,126 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
896
1090
  }
897
1091
  )
898
1092
  );
899
- }, ws = ({
1093
+ }, it = ({
900
1094
  onBack: t,
901
1095
  showBackButton: s,
902
1096
  renderMessageInputActions: n,
903
1097
  onLeaveConversation: r,
904
- onBlockParticipant: a,
905
- showDeleteConversation: i = !0,
906
- onDeleteConversationClick: l,
907
- onBlockParticipantClick: m,
908
- onReportParticipantClick: h
1098
+ onBlockParticipant: o,
1099
+ showDeleteConversation: c = !0,
1100
+ onDeleteConversationClick: a,
1101
+ onBlockParticipantClick: u,
1102
+ onReportParticipantClick: g
909
1103
  }) => {
910
- const { channel: g } = we(), w = z(null), f = U.useMemo(() => Object.values(g.state.members || {}).find(
1104
+ const { channel: x } = Re(), w = W(null), f = P.useMemo(() => Object.values(x.state.members || {}).find(
911
1105
  (N) => {
912
1106
  var E;
913
- return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== g._client.userID;
1107
+ return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== x._client.userID;
914
1108
  }
915
- ), [g._client.userID, g.state.members]), S = U.useMemo(() => {
916
- const c = g.data ?? {};
917
- if (c.followerStatus)
918
- return String(c.followerStatus);
919
- if (c.isFollower !== void 0)
920
- return c.isFollower ? "Subscribed to you" : "Not subscribed";
921
- }, [g.data]), _ = M(() => {
922
- var c;
923
- (c = w.current) == null || c.showModal();
924
- }, []), v = M(() => {
925
- var c;
926
- (c = w.current) == null || c.close();
1109
+ ), [x._client.userID, x.state.members]), l = P.useMemo(() => {
1110
+ const d = x.data ?? {};
1111
+ if (d.followerStatus)
1112
+ return String(d.followerStatus);
1113
+ if (d.isFollower !== void 0)
1114
+ return d.isFollower ? "Subscribed to you" : "Not subscribed";
1115
+ }, [x.data]), R = T(() => {
1116
+ var d;
1117
+ (d = w.current) == null || d.showModal();
1118
+ }, []), y = T(() => {
1119
+ var d;
1120
+ (d = w.current) == null || d.close();
927
1121
  }, []);
928
- return /* @__PURE__ */ o(ve, { children: [
929
- /* @__PURE__ */ o(Ke, { children: [
930
- /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
931
- Cs,
932
- {
933
- onBack: t,
934
- showBackButton: s,
935
- onShowInfo: _,
936
- canShowInfo: !!f
937
- }
938
- ) }),
939
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
940
- es,
941
- {
942
- hideDeletedMessages: !0,
943
- hideNewMessageSeparator: !1,
944
- messageActions: []
945
- }
946
- ) }),
947
- /* @__PURE__ */ e(
948
- gs,
949
- {
950
- renderActions: () => n == null ? void 0 : n(g)
951
- }
952
- )
953
- ] }),
1122
+ return /* @__PURE__ */ i(Ne, { children: [
1123
+ /* @__PURE__ */ e(
1124
+ Rs,
1125
+ {
1126
+ overrides: {
1127
+ Message: (d) => /* @__PURE__ */ e(Qs, { ...d })
1128
+ },
1129
+ children: /* @__PURE__ */ i(Ts, { children: [
1130
+ /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1131
+ lt,
1132
+ {
1133
+ onBack: t,
1134
+ showBackButton: s,
1135
+ onShowInfo: R,
1136
+ canShowInfo: !!f
1137
+ }
1138
+ ) }),
1139
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1140
+ Ds,
1141
+ {
1142
+ hideDeletedMessages: !0,
1143
+ hideNewMessageSeparator: !1,
1144
+ messageActions: void 0
1145
+ }
1146
+ ) }),
1147
+ /* @__PURE__ */ e(
1148
+ tt,
1149
+ {
1150
+ renderActions: () => n == null ? void 0 : n(x)
1151
+ }
1152
+ )
1153
+ ] })
1154
+ }
1155
+ ),
954
1156
  /* @__PURE__ */ e(
955
- vs,
1157
+ ot,
956
1158
  {
957
1159
  dialogRef: w,
958
- onClose: v,
1160
+ onClose: y,
959
1161
  participant: f,
960
- channel: g,
961
- followerStatusLabel: S,
1162
+ channel: x,
1163
+ followerStatusLabel: l,
962
1164
  onLeaveConversation: r,
963
- onBlockParticipant: a,
964
- showDeleteConversation: i,
965
- onDeleteConversationClick: l,
966
- onBlockParticipantClick: m,
967
- onReportParticipantClick: h
1165
+ onBlockParticipant: o,
1166
+ showDeleteConversation: c,
1167
+ onDeleteConversationClick: a,
1168
+ onBlockParticipantClick: u,
1169
+ onReportParticipantClick: g
968
1170
  }
969
1171
  )
970
1172
  ] });
971
- }, ke = U.memo(
1173
+ }, Ue = P.memo(
972
1174
  ({
973
1175
  channel: t,
974
1176
  onBack: s,
975
1177
  showBackButton: n = !1,
976
1178
  renderMessageInputActions: r,
977
- onLeaveConversation: a,
978
- onBlockParticipant: i,
979
- className: l,
980
- CustomChannelEmptyState: m = Ns,
981
- showDeleteConversation: h = !0,
982
- onDeleteConversationClick: g,
1179
+ onLeaveConversation: o,
1180
+ onBlockParticipant: c,
1181
+ className: a,
1182
+ CustomChannelEmptyState: u = rt,
1183
+ showDeleteConversation: g = !0,
1184
+ onDeleteConversationClick: x,
983
1185
  onBlockParticipantClick: w,
984
1186
  onReportParticipantClick: f
985
1187
  }) => /* @__PURE__ */ e(
986
1188
  "div",
987
1189
  {
988
- className: p(
1190
+ className: S(
989
1191
  "messaging-channel-view h-full flex flex-col",
990
- l
1192
+ a
991
1193
  ),
992
1194
  children: /* @__PURE__ */ e(
993
- Xe,
1195
+ ks,
994
1196
  {
995
1197
  channel: t,
996
- MessageSystem: xs,
997
- EmptyStateIndicator: m,
998
- LoadingIndicator: ae,
999
- DateSeparator: ds,
1198
+ MessageSystem: nt,
1199
+ EmptyStateIndicator: u,
1200
+ LoadingIndicator: ue,
1201
+ DateSeparator: Gs,
1000
1202
  children: /* @__PURE__ */ e(
1001
- ws,
1203
+ it,
1002
1204
  {
1003
1205
  onBack: s,
1004
1206
  showBackButton: n,
1005
1207
  renderMessageInputActions: r,
1006
- onLeaveConversation: a,
1007
- onBlockParticipant: i,
1008
- CustomChannelEmptyState: m,
1009
- showDeleteConversation: h,
1010
- onDeleteConversationClick: g,
1208
+ onLeaveConversation: o,
1209
+ onBlockParticipant: c,
1210
+ CustomChannelEmptyState: u,
1211
+ showDeleteConversation: g,
1212
+ onDeleteConversationClick: x,
1011
1213
  onBlockParticipantClick: w,
1012
1214
  onReportParticipantClick: f
1013
1215
  }
@@ -1017,16 +1219,16 @@ const Cs = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) =>
1017
1219
  }
1018
1220
  )
1019
1221
  );
1020
- ke.displayName = "ChannelView";
1021
- function ys({
1222
+ Ue.displayName = "ChannelView";
1223
+ function ct({
1022
1224
  searchQuery: t,
1023
1225
  setSearchQuery: s,
1024
1226
  placeholder: n
1025
1227
  }) {
1026
- const r = z(null);
1027
- return /* @__PURE__ */ o("div", { className: "relative", children: [
1228
+ const r = W(null);
1229
+ return /* @__PURE__ */ i("div", { className: "relative", children: [
1028
1230
  /* @__PURE__ */ e(
1029
- rs,
1231
+ Us,
1030
1232
  {
1031
1233
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1032
1234
  weight: "bold"
@@ -1039,162 +1241,162 @@ function ys({
1039
1241
  type: "text",
1040
1242
  placeholder: n,
1041
1243
  value: t,
1042
- onChange: (a) => s(a.target.value),
1244
+ onChange: (o) => s(o.target.value),
1043
1245
  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"
1044
1246
  }
1045
1247
  ),
1046
1248
  t && /* @__PURE__ */ e(
1047
- Se,
1249
+ Le,
1048
1250
  {
1049
1251
  label: "Clear search",
1050
1252
  onClick: () => {
1051
- var a;
1052
- s(""), (a = r.current) == null || a.focus();
1253
+ var o;
1254
+ s(""), (o = r.current) == null || o.focus();
1053
1255
  },
1054
1256
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1055
- children: /* @__PURE__ */ e(me, { className: "h-4 w-4", weight: "bold" })
1257
+ children: /* @__PURE__ */ e(be, { className: "h-4 w-4", weight: "bold" })
1056
1258
  }
1057
1259
  )
1058
1260
  ] });
1059
1261
  }
1060
- const Es = ({
1262
+ const dt = ({
1061
1263
  participantSource: t,
1062
1264
  onSelectParticipant: s,
1063
1265
  onClose: n,
1064
1266
  existingParticipantIds: r = /* @__PURE__ */ new Set(),
1065
- participantLabel: a = "participants",
1066
- searchPlaceholder: i = "Search participants...",
1067
- className: l
1267
+ participantLabel: o = "participants",
1268
+ searchPlaceholder: c = "Search participants...",
1269
+ className: a
1068
1270
  }) => {
1069
- const { debug: m } = oe(), [h, g] = y(""), [w, f] = y([]), [S, _] = y(!1), [v, c] = y(null), [N, E] = y(
1271
+ const { debug: u } = he(), [g, x] = p(""), [w, f] = p([]), [l, R] = p(!1), [y, d] = p(null), [N, E] = p(
1070
1272
  null
1071
- ), I = z(!1);
1072
- G(() => {
1273
+ ), I = W(!1);
1274
+ q(() => {
1073
1275
  if (t.loading) {
1074
- m && console.log(
1276
+ u && console.log(
1075
1277
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1076
1278
  );
1077
1279
  return;
1078
1280
  }
1079
1281
  if (I.current) return;
1080
1282
  (async () => {
1081
- m && console.log("[ParticipantPicker] Loading initial participants..."), _(!0), c(null);
1283
+ u && console.log("[ParticipantPicker] Loading initial participants..."), R(!0), d(null);
1082
1284
  try {
1083
- const u = await t.loadParticipants({
1285
+ const h = await t.loadParticipants({
1084
1286
  search: "",
1085
1287
  // Load all participants initially
1086
1288
  limit: 100
1087
1289
  });
1088
- f(u.participants), I.current = !0, m && console.log(
1290
+ f(h.participants), I.current = !0, u && console.log(
1089
1291
  "[ParticipantPicker] Participants loaded successfully:",
1090
- u.participants.length
1292
+ h.participants.length
1091
1293
  );
1092
- } catch (u) {
1093
- const b = u instanceof Error ? u.message : "Failed to load participants";
1094
- c(b), console.error("[ParticipantPicker] Failed to load participants:", u);
1294
+ } catch (h) {
1295
+ const v = h instanceof Error ? h.message : "Failed to load participants";
1296
+ d(v), console.error("[ParticipantPicker] Failed to load participants:", h);
1095
1297
  } finally {
1096
- _(!1);
1298
+ R(!1);
1097
1299
  }
1098
1300
  })();
1099
- }, [t.loading, m]);
1100
- const k = w.filter((d) => !r.has(d.id)).filter((d) => {
1101
- var b;
1102
- if (!h) return !0;
1103
- const u = h.toLowerCase();
1104
- return d.name.toLowerCase().includes(u) || ((b = d.email) == null ? void 0 : b.toLowerCase().includes(u)) || !1;
1105
- }), x = M(
1106
- async (d) => {
1301
+ }, [t.loading, u]);
1302
+ const _ = w.filter((m) => !r.has(m.id)).filter((m) => {
1303
+ var v;
1304
+ if (!g) return !0;
1305
+ const h = g.toLowerCase();
1306
+ return m.name.toLowerCase().includes(h) || ((v = m.email) == null ? void 0 : v.toLowerCase().includes(h)) || !1;
1307
+ }), C = T(
1308
+ async (m) => {
1107
1309
  if (!N) {
1108
- E(d.id);
1310
+ E(m.id);
1109
1311
  try {
1110
- await s(d);
1111
- } catch (u) {
1112
- console.error("[ParticipantPicker] Failed to start chat:", u), E(null);
1312
+ await s(m);
1313
+ } catch (h) {
1314
+ console.error("[ParticipantPicker] Failed to start chat:", h), E(null);
1113
1315
  }
1114
1316
  }
1115
1317
  },
1116
1318
  [s, N]
1117
- ), R = (d, u) => {
1118
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), x(u));
1319
+ ), M = (m, h) => {
1320
+ (m.key === "Enter" || m.key === " ") && (m.preventDefault(), C(h));
1119
1321
  };
1120
- return /* @__PURE__ */ o("div", { className: p("flex flex-col h-full", l), children: [
1121
- /* @__PURE__ */ o("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1122
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-3", children: [
1322
+ return /* @__PURE__ */ i("div", { className: S("flex flex-col h-full", a), children: [
1323
+ /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1324
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1123
1325
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1124
- /* @__PURE__ */ e(pe, { onClick: n })
1326
+ /* @__PURE__ */ e(Pe, { onClick: n })
1125
1327
  ] }),
1126
- /* @__PURE__ */ o("p", { className: "text-xs text-stone mb-3", children: [
1328
+ /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1127
1329
  "Select a ",
1128
- a.slice(0, -1),
1330
+ o.slice(0, -1),
1129
1331
  " to start messaging (",
1130
- k.length,
1332
+ _.length,
1131
1333
  " available)",
1132
- t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
1334
+ t.totalCount !== void 0 && ` • ${t.totalCount} ${o} total`
1133
1335
  ] }),
1134
1336
  /* @__PURE__ */ e(
1135
- ys,
1337
+ ct,
1136
1338
  {
1137
- searchQuery: h,
1138
- setSearchQuery: g,
1139
- placeholder: i
1339
+ searchQuery: g,
1340
+ setSearchQuery: x,
1341
+ placeholder: c
1140
1342
  }
1141
1343
  )
1142
1344
  ] }),
1143
- v && /* @__PURE__ */ o("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1345
+ y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1144
1346
  "Error loading ",
1145
- a,
1347
+ o,
1146
1348
  ": ",
1147
- v
1349
+ y
1148
1350
  ] }),
1149
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: S && k.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1351
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: l && _.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: [
1150
1352
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1151
- /* @__PURE__ */ o("span", { className: "text-sm text-stone", children: [
1353
+ /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1152
1354
  "Loading ",
1153
- a,
1355
+ o,
1154
1356
  "..."
1155
1357
  ] })
1156
- ] }) }) : k.length === 0 ? /* @__PURE__ */ o("div", { className: "p-6 text-center", children: [
1157
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ne, { className: "h-8 w-8 text-charcoal" }) }),
1158
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${a} found` : w.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1159
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1160
- ] }) : /* @__PURE__ */ o("ul", { className: "space-y-0", children: [
1161
- k.map((d) => {
1162
- const u = d.name || d.email || d.id, b = d.email && d.name ? d.email : d.phone;
1358
+ ] }) }) : _.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1359
+ /* @__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" }) }),
1360
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${o} found` : w.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1361
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1362
+ ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1363
+ _.map((m) => {
1364
+ const h = m.name || m.email || m.id, v = m.email && m.name ? m.email : m.phone;
1163
1365
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1164
1366
  "button",
1165
1367
  {
1166
1368
  type: "button",
1167
- onClick: () => x(d),
1168
- onKeyDown: (B) => R(B, d),
1369
+ onClick: () => C(m),
1370
+ onKeyDown: (G) => M(G, m),
1169
1371
  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",
1170
- children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
1171
- /* @__PURE__ */ o("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1372
+ children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1373
+ /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1172
1374
  /* @__PURE__ */ e(
1173
- q,
1375
+ te,
1174
1376
  {
1175
- id: d.id,
1176
- name: u,
1177
- image: d.image,
1377
+ id: m.id,
1378
+ name: h,
1379
+ image: m.image,
1178
1380
  size: 40
1179
1381
  }
1180
1382
  ),
1181
- /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
1182
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1183
- b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
1383
+ /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1384
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: h }),
1385
+ v && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: v })
1184
1386
  ] })
1185
1387
  ] }),
1186
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === d.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
1388
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === m.id ? /* @__PURE__ */ e(de, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ie, { className: "h-5 w-5 text-stone" }) })
1187
1389
  ] })
1188
1390
  }
1189
- ) }, d.id);
1391
+ ) }, m.id);
1190
1392
  }),
1191
- S && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1393
+ l && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1192
1394
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1193
1395
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1194
1396
  ] }) })
1195
1397
  ] }) })
1196
1398
  ] });
1197
- }, Is = ({ className: t }) => /* @__PURE__ */ o(
1399
+ }, mt = ({ className: t }) => /* @__PURE__ */ i(
1198
1400
  "svg",
1199
1401
  {
1200
1402
  width: "140",
@@ -1204,7 +1406,7 @@ const Es = ({
1204
1406
  xmlns: "http://www.w3.org/2000/svg",
1205
1407
  className: t,
1206
1408
  children: [
1207
- /* @__PURE__ */ o("g", { clipPath: "url(#clip0_empty_state)", children: [
1409
+ /* @__PURE__ */ i("g", { clipPath: "url(#clip0_empty_state)", children: [
1208
1410
  /* @__PURE__ */ e(
1209
1411
  "path",
1210
1412
  {
@@ -1233,7 +1435,7 @@ const Es = ({
1233
1435
  fill: "white"
1234
1436
  }
1235
1437
  ),
1236
- /* @__PURE__ */ o("g", { filter: "url(#filter0_empty_state)", children: [
1438
+ /* @__PURE__ */ i("g", { filter: "url(#filter0_empty_state)", children: [
1237
1439
  /* @__PURE__ */ e(
1238
1440
  "path",
1239
1441
  {
@@ -1273,8 +1475,8 @@ const Es = ({
1273
1475
  }
1274
1476
  )
1275
1477
  ] }),
1276
- /* @__PURE__ */ o("defs", { children: [
1277
- /* @__PURE__ */ o(
1478
+ /* @__PURE__ */ i("defs", { children: [
1479
+ /* @__PURE__ */ i(
1278
1480
  "filter",
1279
1481
  {
1280
1482
  id: "filter0_empty_state",
@@ -1328,17 +1530,17 @@ const Es = ({
1328
1530
  ] })
1329
1531
  ]
1330
1532
  }
1331
- ), Re = U.memo(
1332
- ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1333
- /* @__PURE__ */ e(Is, {}),
1334
- s && !t && /* @__PURE__ */ o("div", { className: "mt-8", children: [
1533
+ ), Be = P.memo(
1534
+ ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1535
+ /* @__PURE__ */ e(mt, {}),
1536
+ s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1335
1537
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1336
1538
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1337
1539
  ] })
1338
1540
  ] }) })
1339
1541
  );
1340
- Re.displayName = "EmptyState";
1341
- const le = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ o("div", { className: "text-center max-w-sm", children: [
1542
+ Be.displayName = "EmptyState";
1543
+ const me = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
1342
1544
  /* @__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: "⚠️" }) }),
1343
1545
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1344
1546
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1352,235 +1554,235 @@ const le = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1352
1554
  }
1353
1555
  )
1354
1556
  ] }) }));
1355
- le.displayName = "ErrorState";
1356
- const Ls = ({
1557
+ me.displayName = "ErrorState";
1558
+ const wt = ({
1357
1559
  capabilities: t = {},
1358
1560
  className: s,
1359
1561
  renderMessageInputActions: n,
1360
1562
  onChannelSelect: r,
1361
- onParticipantSelect: a,
1362
- initialParticipantFilter: i,
1363
- initialParticipantData: l,
1364
- CustomChannelEmptyState: m,
1365
- showChannelList: h = !0,
1366
- filters: g,
1563
+ onParticipantSelect: o,
1564
+ initialParticipantFilter: c,
1565
+ initialParticipantData: a,
1566
+ CustomChannelEmptyState: u,
1567
+ showChannelList: g = !0,
1568
+ filters: x,
1367
1569
  channelListCustomEmptyStateIndicator: w,
1368
1570
  onDeleteConversationClick: f,
1369
- onBlockParticipantClick: S,
1370
- onReportParticipantClick: _
1571
+ onBlockParticipantClick: l,
1572
+ onReportParticipantClick: R
1371
1573
  }) => {
1372
1574
  const {
1373
- service: v,
1374
- client: c,
1575
+ service: y,
1576
+ client: d,
1375
1577
  isConnected: N,
1376
1578
  isLoading: E,
1377
1579
  error: I,
1378
- refreshConnection: k,
1379
- debug: x
1380
- } = ls(), [R, d] = y(null), [u, b] = y(!1), [B, j] = y(!1), [W, Y] = y(!1), [ie, Q] = y(/* @__PURE__ */ new Set()), [X, ce] = y(0), [O, H] = y(!1), [J, $] = y(null), D = z(null), {
1381
- participantSource: T,
1382
- participantLabel: A = "participants",
1383
- showDeleteConversation: V = !0
1384
- } = t, K = U.useMemo(() => {
1385
- const C = c == null ? void 0 : c.userID;
1580
+ refreshConnection: _,
1581
+ debug: C
1582
+ } = Bs(), [M, m] = p(null), [h, v] = p(!1), [G, A] = p(!1), [Z, Y] = p(!1), [ne, K] = p(/* @__PURE__ */ new Set()), [ee, re] = p(0), [O, H] = p(!1), [J, z] = p(null), k = W(null), {
1583
+ participantSource: D,
1584
+ participantLabel: U = "participants",
1585
+ showDeleteConversation: $ = !0
1586
+ } = t, se = P.useMemo(() => {
1587
+ const b = d == null ? void 0 : d.userID;
1386
1588
  return {
1387
1589
  ...{
1388
1590
  type: "messaging",
1389
1591
  last_message_at: { $exists: !0 },
1390
- ...C && {
1391
- members: { $in: [C] },
1592
+ ...b && {
1593
+ members: { $in: [b] },
1392
1594
  hidden: !1
1393
1595
  }
1394
1596
  },
1395
- ...g
1597
+ ...x
1396
1598
  };
1397
- }, [g, c == null ? void 0 : c.userID]), ee = z(null), Z = M(async () => {
1398
- if (!c || !N) return;
1399
- const C = c.userID;
1400
- if (C)
1599
+ }, [x, d == null ? void 0 : d.userID]), Q = W(null), V = T(async () => {
1600
+ if (!d || !N) return;
1601
+ const b = d.userID;
1602
+ if (b)
1401
1603
  try {
1402
- x && console.log("[MessagingShell] Syncing channels for user:", C);
1403
- const P = await c.queryChannels(
1604
+ C && console.log("[MessagingShell] Syncing channels for user:", b);
1605
+ const L = await d.queryChannels(
1404
1606
  {
1405
1607
  type: "messaging",
1406
- members: { $in: [C] }
1608
+ members: { $in: [b] }
1407
1609
  },
1408
1610
  {},
1409
1611
  { limit: 100 }
1410
1612
  ), F = /* @__PURE__ */ new Set();
1411
- P.forEach((L) => {
1412
- const de = L.state.members;
1413
- Object.values(de).forEach((Ue) => {
1414
- var he;
1415
- const ue = (he = Ue.user) == null ? void 0 : he.id;
1416
- ue && ue !== C && F.add(ue);
1613
+ L.forEach((B) => {
1614
+ const xe = B.state.members;
1615
+ Object.values(xe).forEach((Ae) => {
1616
+ var ve;
1617
+ const Ce = (ve = Ae.user) == null ? void 0 : ve.id;
1618
+ Ce && Ce !== b && F.add(Ce);
1417
1619
  });
1418
- }), Q((L) => L.size === F.size && [...L].every((de) => F.has(de)) ? L : F), b(P.length > 0), j(!0), ee.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
1419
- channelCount: P.length,
1620
+ }), K((B) => B.size === F.size && [...B].every((xe) => F.has(xe)) ? B : F), v(L.length > 0), A(!0), Q.current = b, C && console.log("[MessagingShell] Channels synced successfully:", {
1621
+ channelCount: L.length,
1420
1622
  memberCount: F.size
1421
1623
  });
1422
- } catch (P) {
1423
- console.error("[MessagingShell] Failed to sync channels:", P);
1624
+ } catch (L) {
1625
+ console.error("[MessagingShell] Failed to sync channels:", L);
1424
1626
  }
1425
- }, [c, N, x]);
1426
- G(() => {
1427
- if (!c || !N) return;
1428
- const C = c.userID;
1429
- C && ee.current !== C && Z();
1430
- }, [c, N, Z]), G(() => {
1431
- if (!i || !c || !N) return;
1627
+ }, [d, N, C]);
1628
+ q(() => {
1629
+ if (!d || !N) return;
1630
+ const b = d.userID;
1631
+ b && Q.current !== b && V();
1632
+ }, [d, N, V]), q(() => {
1633
+ if (!c || !d || !N) return;
1432
1634
  (async () => {
1433
- const P = c.userID;
1434
- if (P)
1635
+ const L = d.userID;
1636
+ if (L)
1435
1637
  try {
1436
- x && console.log(
1638
+ C && console.log(
1437
1639
  "[MessagingShell] Loading initial conversation with:",
1438
- i
1640
+ c
1439
1641
  );
1440
- const F = await c.queryChannels(
1642
+ const F = await d.queryChannels(
1441
1643
  {
1442
1644
  type: "messaging",
1443
- members: { $eq: [P, i] }
1645
+ members: { $eq: [L, c] }
1444
1646
  },
1445
1647
  {},
1446
1648
  { limit: 1 }
1447
1649
  );
1448
1650
  if (F.length > 0)
1449
- d(F[0]), H(!0), $(null), r && r(F[0]), x && console.log(
1651
+ m(F[0]), H(!0), z(null), r && r(F[0]), C && console.log(
1450
1652
  "[MessagingShell] Initial conversation loaded:",
1451
1653
  F[0].id
1452
1654
  );
1453
- else if (l && v) {
1454
- x && console.log(
1655
+ else if (a && y) {
1656
+ C && console.log(
1455
1657
  "[MessagingShell] No conversation found, creating one for:",
1456
- l
1658
+ a
1457
1659
  );
1458
1660
  try {
1459
- const L = await v.startChannelWithParticipant({
1460
- id: l.id,
1461
- name: l.name,
1462
- email: l.email,
1463
- phone: l.phone
1661
+ const B = await y.startChannelWithParticipant({
1662
+ id: a.id,
1663
+ name: a.name,
1664
+ email: a.email,
1665
+ phone: a.phone
1464
1666
  });
1465
- d(L), H(!0), $(null), r && r(L), x && console.log(
1667
+ m(B), H(!0), z(null), r && r(B), C && console.log(
1466
1668
  "[MessagingShell] Channel created and loaded:",
1467
- L.id
1669
+ B.id
1468
1670
  );
1469
- } catch (L) {
1671
+ } catch (B) {
1470
1672
  console.error(
1471
1673
  "[MessagingShell] Failed to create conversation:",
1472
- L
1473
- ), $("Failed to create conversation");
1674
+ B
1675
+ ), z("Failed to create conversation");
1474
1676
  }
1475
1677
  } else
1476
- $(
1678
+ z(
1477
1679
  "No conversation found with this account"
1478
- ), x && console.log(
1680
+ ), C && console.log(
1479
1681
  "[MessagingShell] No conversation found for:",
1480
- i
1682
+ c
1481
1683
  );
1482
1684
  } catch (F) {
1483
1685
  console.error(
1484
1686
  "[MessagingShell] Failed to load initial conversation:",
1485
1687
  F
1486
- ), $("Failed to load conversation");
1688
+ ), z("Failed to load conversation");
1487
1689
  }
1488
1690
  })();
1489
1691
  }, [
1490
- i,
1491
- l,
1492
1692
  c,
1693
+ a,
1694
+ d,
1493
1695
  N,
1494
- v,
1495
- x,
1696
+ y,
1697
+ C,
1496
1698
  r
1497
1699
  ]);
1498
- const De = M(
1499
- (C) => {
1500
- d(C), r == null || r(C);
1700
+ const le = T(
1701
+ (b) => {
1702
+ m(b), r == null || r(b);
1501
1703
  },
1502
1704
  [r]
1503
- ), Me = M(() => {
1504
- O || d(null);
1505
- }, [O]), _e = M(
1506
- async (C) => {
1507
- var P;
1508
- if (v)
1705
+ ), oe = T(() => {
1706
+ O || m(null);
1707
+ }, [O]), ae = T(
1708
+ async (b) => {
1709
+ var L;
1710
+ if (y)
1509
1711
  try {
1510
- x && console.log(
1712
+ C && console.log(
1511
1713
  "[MessagingShell] Starting conversation with:",
1512
- C.id
1714
+ b.id
1513
1715
  );
1514
- const F = await v.startChannelWithParticipant({
1515
- id: C.id,
1516
- name: C.name,
1517
- email: C.email,
1518
- phone: C.phone
1716
+ const F = await y.startChannelWithParticipant({
1717
+ id: b.id,
1718
+ name: b.name,
1719
+ email: b.email,
1720
+ phone: b.phone
1519
1721
  });
1520
1722
  try {
1521
1723
  await F.show();
1522
- } catch (L) {
1523
- console.warn("[MessagingShell] Failed to unhide channel:", L);
1724
+ } catch (B) {
1725
+ console.warn("[MessagingShell] Failed to unhide channel:", B);
1524
1726
  }
1525
- d(F), Y(!1), (P = D.current) == null || P.close(), a == null || a(C);
1727
+ m(F), Y(!1), (L = k.current) == null || L.close(), o == null || o(b);
1526
1728
  } catch (F) {
1527
1729
  console.error("[MessagingShell] Failed to start conversation:", F);
1528
1730
  }
1529
1731
  },
1530
- [v, a, x]
1531
- ), se = M(() => {
1532
- var C;
1533
- Y(!1), (C = D.current) == null || C.close();
1534
- }, []), Fe = M(
1535
- (C) => {
1536
- C.target === D.current && se();
1732
+ [y, o, C]
1733
+ ), j = T(() => {
1734
+ var b;
1735
+ Y(!1), (b = k.current) == null || b.close();
1736
+ }, []), fe = T(
1737
+ (b) => {
1738
+ b.target === k.current && j();
1537
1739
  },
1538
- [se]
1539
- ), Te = M(
1540
- async (C) => {
1541
- x && console.log("[MessagingShell] Leaving conversation:", C.id), d(null), H(!1), ee.current = null, await Z();
1740
+ [j]
1741
+ ), ie = T(
1742
+ async (b) => {
1743
+ C && console.log("[MessagingShell] Leaving conversation:", b.id), m(null), H(!1), Q.current = null, await V();
1542
1744
  },
1543
- [Z, x]
1544
- ), Le = M(
1545
- async (C) => {
1546
- x && console.log("[MessagingShell] Blocking participant:", C), d(null), H(!1), ee.current = null, await Z();
1745
+ [V, C]
1746
+ ), ge = T(
1747
+ async (b) => {
1748
+ C && console.log("[MessagingShell] Blocking participant:", b), m(null), H(!1), Q.current = null, await V();
1547
1749
  },
1548
- [Z, x]
1549
- ), te = !!R;
1550
- return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(ae, {}) }) : I ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: k }) }) : !N || !c ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
1551
- le,
1750
+ [V, C]
1751
+ ), X = !!M;
1752
+ return E ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(ue, {}) }) : I ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(me, { message: I, onBack: _ }) }) : !N || !d ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(
1753
+ me,
1552
1754
  {
1553
1755
  message: "Not connected to messaging service",
1554
- onBack: k
1756
+ onBack: _
1555
1757
  }
1556
- ) }) : J ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: J }) }) : /* @__PURE__ */ o(
1758
+ ) }) : J ? /* @__PURE__ */ e("div", { className: S("h-full", s), children: /* @__PURE__ */ e(me, { message: J }) }) : /* @__PURE__ */ i(
1557
1759
  "div",
1558
1760
  {
1559
- className: p(
1761
+ className: S(
1560
1762
  "messaging-shell h-full bg-background-primary overflow-hidden",
1561
1763
  s
1562
1764
  ),
1563
1765
  children: [
1564
- /* @__PURE__ */ o("div", { className: "flex h-full min-h-0", children: [
1766
+ /* @__PURE__ */ i("div", { className: "flex h-full min-h-0", children: [
1565
1767
  /* @__PURE__ */ e(
1566
1768
  "div",
1567
1769
  {
1568
- className: p(
1770
+ className: S(
1569
1771
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1570
1772
  {
1571
- "!hidden": h === !1 || O,
1773
+ "!hidden": g === !1 || O,
1572
1774
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1573
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !O && te,
1775
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !O && X,
1574
1776
  // Show on mobile when no channel selected, use same wide width on desktop
1575
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !O && !te
1777
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !O && !X
1576
1778
  }
1577
1779
  ),
1578
1780
  children: /* @__PURE__ */ e(
1579
- Ie,
1781
+ Fe,
1580
1782
  {
1581
- onChannelSelect: De,
1582
- selectedChannel: R || void 0,
1583
- filters: K,
1783
+ onChannelSelect: le,
1784
+ selectedChannel: M || void 0,
1785
+ filters: se,
1584
1786
  customEmptyStateIndicator: w
1585
1787
  }
1586
1788
  )
@@ -1589,70 +1791,70 @@ const Ls = ({
1589
1791
  /* @__PURE__ */ e(
1590
1792
  "div",
1591
1793
  {
1592
- className: p(
1794
+ className: S(
1593
1795
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1594
1796
  {
1595
1797
  // In direct conversation mode (or waiting for it), always show (full width)
1596
- flex: O || te || i,
1798
+ flex: O || X || c,
1597
1799
  // Normal mode: hide on mobile when no channel selected
1598
- "hidden lg:flex": !O && !te && !i
1800
+ "hidden lg:flex": !O && !X && !c
1599
1801
  }
1600
1802
  ),
1601
- children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1602
- ke,
1803
+ children: M ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1804
+ Ue,
1603
1805
  {
1604
- channel: R,
1605
- onBack: Me,
1806
+ channel: M,
1807
+ onBack: oe,
1606
1808
  showBackButton: !O,
1607
1809
  renderMessageInputActions: n,
1608
- onLeaveConversation: Te,
1609
- onBlockParticipant: Le,
1610
- CustomChannelEmptyState: m,
1611
- showDeleteConversation: V,
1810
+ onLeaveConversation: ie,
1811
+ onBlockParticipant: ge,
1812
+ CustomChannelEmptyState: u,
1813
+ showDeleteConversation: $,
1612
1814
  onDeleteConversationClick: f,
1613
- onBlockParticipantClick: S,
1614
- onReportParticipantClick: _
1815
+ onBlockParticipantClick: l,
1816
+ onReportParticipantClick: R
1615
1817
  },
1616
- R.id
1617
- ) }) : i ? (
1818
+ M.id
1819
+ ) }) : c ? (
1618
1820
  // Show loading while creating/loading direct conversation channel
1619
- /* @__PURE__ */ e(ae, {})
1821
+ /* @__PURE__ */ e(ue, {})
1620
1822
  ) : /* @__PURE__ */ e(
1621
- Re,
1823
+ Be,
1622
1824
  {
1623
- hasChannels: u,
1624
- channelsLoaded: B
1825
+ hasChannels: h,
1826
+ channelsLoaded: G
1625
1827
  }
1626
1828
  )
1627
1829
  }
1628
1830
  )
1629
1831
  ] }),
1630
- T && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1832
+ D && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1631
1833
  /* @__PURE__ */ e(
1632
1834
  "dialog",
1633
1835
  {
1634
- ref: D,
1836
+ ref: k,
1635
1837
  className: "mes-dialog",
1636
- onClick: Fe,
1637
- onClose: se,
1838
+ onClick: fe,
1839
+ onClose: j,
1638
1840
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1639
- Es,
1841
+ dt,
1640
1842
  {
1641
- participantSource: T,
1642
- onSelectParticipant: _e,
1643
- onClose: se,
1644
- existingParticipantIds: ie,
1645
- participantLabel: A,
1646
- searchPlaceholder: `Search ${A}...`
1843
+ participantSource: D,
1844
+ onSelectParticipant: ae,
1845
+ onClose: j,
1846
+ existingParticipantIds: ne,
1847
+ participantLabel: U,
1848
+ searchPlaceholder: `Search ${U}...`
1647
1849
  },
1648
- X
1850
+ ee
1649
1851
  ) })
1650
1852
  }
1651
1853
  )
1652
1854
  ]
1653
1855
  }
1654
1856
  );
1655
- }, Ss = ({
1857
+ }, ut = ({
1656
1858
  question: t,
1657
1859
  onClick: s,
1658
1860
  loading: n = !1,
@@ -1664,7 +1866,7 @@ const Ls = ({
1664
1866
  onClick: s,
1665
1867
  disabled: n,
1666
1868
  style: { backgroundColor: "#E6E5E3" },
1667
- className: p(
1869
+ className: S(
1668
1870
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1669
1871
  {
1670
1872
  "hover:brightness-95 active:brightness-90": !n,
@@ -1674,100 +1876,100 @@ const Ls = ({
1674
1876
  ),
1675
1877
  children: t
1676
1878
  }
1677
- ), Us = ({
1879
+ ), yt = ({
1678
1880
  faqs: t,
1679
1881
  onFaqClick: s,
1680
1882
  loadingFaqId: n,
1681
1883
  headerText: r,
1682
- className: a,
1683
- avatarImage: i,
1684
- avatarName: l
1884
+ className: o,
1885
+ avatarImage: c,
1886
+ avatarName: a
1685
1887
  }) => {
1686
- const m = t.filter((h) => h.enabled).sort((h, g) => (h.order ?? 0) - (g.order ?? 0));
1687
- return m.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ o("div", { className: "flex gap-3 items-end", children: [
1688
- (i || l) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1689
- q,
1888
+ const u = t.filter((g) => g.enabled).sort((g, x) => (g.order ?? 0) - (x.order ?? 0));
1889
+ return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
1890
+ (c || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1891
+ te,
1690
1892
  {
1691
- id: l || "account",
1692
- name: l || "Account",
1693
- image: i,
1893
+ id: a || "account",
1894
+ name: a || "Account",
1895
+ image: c,
1694
1896
  size: 24,
1695
1897
  shape: "circle"
1696
1898
  }
1697
1899
  ) }),
1698
- /* @__PURE__ */ o(
1900
+ /* @__PURE__ */ i(
1699
1901
  "div",
1700
1902
  {
1701
1903
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
1702
1904
  style: { backgroundColor: "#F1F0EE" },
1703
1905
  children: [
1704
1906
  r && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: r }),
1705
- m.map((h) => /* @__PURE__ */ e(
1706
- Ss,
1907
+ u.map((g) => /* @__PURE__ */ e(
1908
+ ut,
1707
1909
  {
1708
- question: h.question,
1709
- onClick: () => s(h.id),
1710
- loading: n === h.id
1910
+ question: g.question,
1911
+ onClick: () => s(g.id),
1912
+ loading: n === g.id
1711
1913
  },
1712
- h.id
1914
+ g.id
1713
1915
  ))
1714
1916
  ]
1715
1917
  }
1716
1918
  )
1717
1919
  ] }) });
1718
- }, Ps = (t, s = {}) => {
1719
- const { initialSearch: n = "", pageSize: r = 20 } = s, [a, i] = y([]), [l, m] = y(!1), [h, g] = y(null), [w, f] = y(n), [S, _] = y(!0), [v, c] = y(), N = M(async (x = !1, R) => {
1720
- if (l) return;
1721
- const d = R !== void 0 ? R : w;
1722
- m(!0), g(null);
1920
+ }, pt = (t, s = {}) => {
1921
+ const { initialSearch: n = "", pageSize: r = 20 } = s, [o, c] = p([]), [a, u] = p(!1), [g, x] = p(null), [w, f] = p(n), [l, R] = p(!0), [y, d] = p(), N = T(async (C = !1, M) => {
1922
+ if (a) return;
1923
+ const m = M !== void 0 ? M : w;
1924
+ u(!0), x(null);
1723
1925
  try {
1724
- const u = await t.loadParticipants({
1725
- search: d || void 0,
1926
+ const h = await t.loadParticipants({
1927
+ search: m || void 0,
1726
1928
  limit: r,
1727
- cursor: x ? void 0 : v
1929
+ cursor: C ? void 0 : y
1728
1930
  });
1729
- i(
1730
- (b) => x ? u.participants : [...b, ...u.participants]
1731
- ), _(u.hasMore), c(u.nextCursor);
1732
- } catch (u) {
1733
- const b = u instanceof Error ? u.message : "Failed to load participants";
1734
- g(b), console.error("[useParticipants] Load error:", u);
1931
+ c(
1932
+ (v) => C ? h.participants : [...v, ...h.participants]
1933
+ ), R(h.hasMore), d(h.nextCursor);
1934
+ } catch (h) {
1935
+ const v = h instanceof Error ? h.message : "Failed to load participants";
1936
+ x(v), console.error("[useParticipants] Load error:", h);
1735
1937
  } finally {
1736
- m(!1);
1938
+ u(!1);
1737
1939
  }
1738
- }, [t, w, v, r, l]), E = M(() => {
1739
- S && !l && N(!1);
1740
- }, [S, l, N]), I = M((x) => {
1741
- f(x), c(void 0), N(!0, x);
1742
- }, [N]), k = M(() => {
1743
- c(void 0), N(!0);
1940
+ }, [t, w, y, r, a]), E = T(() => {
1941
+ l && !a && N(!1);
1942
+ }, [l, a, N]), I = T((C) => {
1943
+ f(C), d(void 0), N(!0, C);
1944
+ }, [N]), _ = T(() => {
1945
+ d(void 0), N(!0);
1744
1946
  }, [N]);
1745
- return G(() => {
1947
+ return q(() => {
1746
1948
  N(!0);
1747
1949
  }, [t.loadParticipants]), {
1748
- participants: a,
1749
- loading: l,
1750
- error: h,
1950
+ participants: o,
1951
+ loading: a,
1952
+ error: g,
1751
1953
  searchQuery: w,
1752
- hasMore: S,
1954
+ hasMore: l,
1753
1955
  totalCount: t.totalCount,
1754
1956
  loadMore: E,
1755
1957
  search: I,
1756
- refresh: k
1958
+ refresh: _
1757
1959
  };
1758
1960
  };
1759
1961
  export {
1760
- q as Avatar,
1761
- Ns as ChannelEmptyState,
1762
- Ie as ChannelList,
1763
- ke as ChannelView,
1764
- Us as FaqList,
1765
- Ss as FaqListItem,
1766
- Ts as MessagingProvider,
1767
- Ls as MessagingShell,
1768
- Es as ParticipantPicker,
1769
- os as formatRelativeTime,
1770
- ls as useMessaging,
1771
- Ps as useParticipants
1962
+ te as Avatar,
1963
+ rt as ChannelEmptyState,
1964
+ Fe as ChannelList,
1965
+ Ue as ChannelView,
1966
+ yt as FaqList,
1967
+ ut as FaqListItem,
1968
+ vt as MessagingProvider,
1969
+ wt as MessagingShell,
1970
+ dt as ParticipantPicker,
1971
+ $s as formatRelativeTime,
1972
+ Bs as useMessaging,
1973
+ pt as useParticipants
1772
1974
  };
1773
1975
  //# sourceMappingURL=index.js.map