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