@linktr.ee/messaging-react 1.21.0 โ†’ 1.21.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,8 +1,8 @@
1
1
  import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
2
2
  import D from "classnames";
3
- import j, { createContext as Qe, useContext as Xe, useCallback as F, useState as M, useRef as W, useEffect as q, useMemo as be } from "react";
3
+ import A, { createContext as Qe, useContext as Xe, useCallback as T, useState as k, useRef as W, useEffect as q, useMemo as be } from "react";
4
4
  import { StreamChatService as Ke } from "@linktr.ee/messaging-core";
5
- import { Chat as es, ChannelList as ss, DateSeparator as ts, useChannelStateContext as we, useChatContext as Fe, areMessageUIPropsEqual as ns, useMessageReminder as rs, useComponentContext as as, Attachment as ls, EditMessageModal as os, MessageBlocked as is, MessageBouncePrompt as cs, MessageDeleted as ds, MessageIsThreadReplyInChannelButtonIndicator as us, MessageRepliesCountButton as ms, ReminderNotification as hs, StreamedMessageText as fs, messageHasAttachments as gs, messageHasReactions as xs, isDateSeparatorMessage as bs, isMessageBlocked as Cs, isMessageBounced as Ns, MessageBounceModal as vs, Poll as ws, MessageText as ps, MessageErrorIcon as ys, useMessageContext as Es, useMessageComposer as Is, useStateStore as _s, MessageInput as Ss, useMessageInputContext as Ms, useMessageComposerHasSendableData as ks, SimpleAttachmentSelector as Rs, QuotedMessagePreview as Ds, AttachmentPreviewList as Ts, TextareaComposer as Fs, MessageTimestamp as Ls, Channel as Ps, WithComponents as Os, Window as Us, MessageList as Bs } from "stream-chat-react";
5
+ import { Chat as es, ChannelList as ss, DateSeparator as ts, useChannelStateContext as we, useChatContext as Fe, areMessageUIPropsEqual as ns, useMessageReminder as rs, useComponentContext as as, Attachment as os, EditMessageModal as ls, MessageBlocked as is, MessageBouncePrompt as cs, MessageDeleted as ds, MessageIsThreadReplyInChannelButtonIndicator as us, MessageRepliesCountButton as ms, ReminderNotification as hs, StreamedMessageText as fs, messageHasAttachments as gs, messageHasReactions as xs, isDateSeparatorMessage as bs, isMessageBlocked as Cs, isMessageBounced as Ns, MessageBounceModal as vs, Poll as ws, MessageText as ps, MessageErrorIcon as ys, useMessageContext as Es, useMessageComposer as Is, useStateStore as _s, MessageInput as Ss, useMessageInputContext as Ms, useMessageComposerHasSendableData as ks, SimpleAttachmentSelector as Rs, QuotedMessagePreview as Ds, AttachmentPreviewList as Ts, TextareaComposer as Fs, MessageTimestamp as Ls, Channel as Ps, WithComponents as Os, Window as Us, MessageList as Bs } from "stream-chat-react";
6
6
  import { GiftIcon as js, XIcon as pe, ArrowUpIcon as As, ArrowLeftIcon as Ie, StarIcon as _e, DotsThreeIcon as Se, SpinnerGapIcon as ue, SignOutIcon as $s, ProhibitInsetIcon as Me, FlagIcon as zs, MagnifyingGlassIcon as Hs, ChatCircleDotsIcon as ke } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as Re } from "stream-chat";
8
8
  const Le = Qe({
@@ -20,12 +20,12 @@ const Le = Qe({
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: a,
23
- capabilities: o = {},
23
+ capabilities: l = {},
24
24
  debug: c = !1
25
25
  }) => {
26
- const r = F(
27
- (m, ...C) => {
28
- c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...C);
26
+ const r = T(
27
+ (m, ...N) => {
28
+ c && console.log(`๐Ÿ”ฅ [MessagingProvider] ${m}`, ...N);
29
29
  },
30
30
  [c]
31
31
  );
@@ -33,30 +33,30 @@ const Le = Qe({
33
33
  userId: s == null ? void 0 : s.id,
34
34
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
- capabilities: Object.keys(o)
36
+ capabilities: Object.keys(l)
37
37
  });
38
- const [u, b] = M(null), [h, _] = M(null), [x, g] = M(!1), [l, y] = M(!1), [E, w] = M(null), p = W(!1), f = W({
38
+ const [u, g] = k(null), [x, b] = k(null), [f, v] = k(!1), [o, M] = k(!1), [S, w] = k(null), E = W(!1), h = W({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: a,
41
41
  serviceConfig: n,
42
- capabilities: o
43
- }), N = W(0);
44
- N.current++, r("๐Ÿ“Š RENDER INFO", {
45
- renderCount: N.current,
42
+ capabilities: l
43
+ }), C = W(0);
44
+ C.current++, r("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: C.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: f.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: f.current.apiKey !== a,
50
- serviceConfigChanged: f.current.serviceConfig !== n,
51
- capabilitiesChanged: f.current.capabilities !== o
48
+ userChanged: h.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: h.current.apiKey !== a,
50
+ serviceConfigChanged: h.current.serviceConfig !== n,
51
+ capabilitiesChanged: h.current.capabilities !== l
52
52
  }
53
- }), f.current = {
53
+ }), h.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: a,
56
56
  serviceConfig: n,
57
- capabilities: o
57
+ capabilities: l
58
58
  }, q(() => {
59
- const m = N.current;
59
+ const m = C.current;
60
60
  if (r("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: m,
62
62
  apiKey: !!a,
@@ -64,8 +64,8 @@ const Le = Qe({
64
64
  dependencies: {
65
65
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: f.current.serviceConfig === n,
68
- apiKeyStable: f.current.apiKey === a
67
+ serviceConfigStable: h.current.serviceConfig === n,
68
+ apiKeyStable: h.current.apiKey === a
69
69
  }
70
70
  }), !a || !n) {
71
71
  r("โš ๏ธ SERVICE INIT SKIPPED", {
@@ -77,42 +77,42 @@ const Le = Qe({
77
77
  r("๐Ÿš€ CREATING NEW SERVICE", {
78
78
  renderCount: m,
79
79
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
80
- serviceConfigChanged: f.current.serviceConfig !== n
80
+ serviceConfigChanged: h.current.serviceConfig !== n
81
81
  });
82
- const C = new Ke({
82
+ const N = new Ke({
83
83
  ...n,
84
84
  apiKey: a,
85
85
  debug: c
86
86
  });
87
- return b(C), r("โœ… SERVICE SET", {
87
+ return g(N), r("โœ… SERVICE SET", {
88
88
  renderCount: m,
89
- serviceInstance: !!C
89
+ serviceInstance: !!N
90
90
  }), () => {
91
91
  r("๐Ÿงน SERVICE CLEANUP", {
92
92
  renderCount: m,
93
93
  reason: "Effect cleanup"
94
- }), C.disconnectUser().catch(console.error);
94
+ }), N.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [a, n, c, r]);
97
- const v = W(null);
97
+ const p = W(null);
98
98
  q(() => {
99
- var C, k;
99
+ var N, U;
100
100
  if (r("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!u,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: p.current,
105
- isConnected: x,
104
+ isConnecting: E.current,
105
+ isConnected: f,
106
106
  dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
107
107
  }), !u || !s) {
108
108
  r("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (p.current) {
111
+ if (E.current) {
112
112
  r("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((C = v.current) == null ? void 0 : C.serviceId) === u && ((k = v.current) == null ? void 0 : k.userId) === s.id) {
115
+ if (((N = p.current) == null ? void 0 : N.serviceId) === u && ((U = p.current) == null ? void 0 : U.userId) === s.id) {
116
116
  r(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,40 +120,40 @@ const Le = Qe({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), p.current = !0, y(!0), w(null);
123
+ r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), E.current = !0, M(!0), w(null);
124
124
  try {
125
125
  r("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const T = await u.connectUser(s);
127
- _(T), g(!0), v.current = { serviceId: u, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
126
+ const I = await u.connectUser(s);
127
+ b(I), v(!0), p.current = { serviceId: u, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: T.userID
129
+ clientId: I.userID
130
130
  });
131
- } catch (T) {
132
- const S = T instanceof Error ? T.message : "Connection failed";
133
- w(S), r("โŒ USER CONNECTION ERROR", {
131
+ } catch (I) {
132
+ const y = I instanceof Error ? I.message : "Connection failed";
133
+ w(y), r("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: S
135
+ error: y
136
136
  });
137
137
  } finally {
138
- y(!1), p.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ M(!1), E.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: x
140
+ isConnected: f
141
141
  });
142
142
  }
143
143
  })();
144
- }, [u, s, r, x]), q(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
144
+ }, [u, s, r, f]), q(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!u,
146
- isConnected: x
146
+ isConnected: f
147
147
  }), () => {
148
- u && x ? (r(
148
+ u && f ? (r(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), v.current = null, u.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
151
+ ), p.current = null, u.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!u,
153
- isConnected: x
153
+ isConnected: f
154
154
  });
155
- }), [u, x, r]);
156
- const R = F(async () => {
155
+ }), [u, f, r]);
156
+ const R = T(async () => {
157
157
  if (r("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
158
  hasService: !!u,
159
159
  hasUser: !!s
@@ -161,55 +161,55 @@ const Le = Qe({
161
161
  r("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
164
+ r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), M(!0);
165
165
  try {
166
166
  r("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await u.disconnectUser(), r("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
167
  const m = await u.connectUser(s);
168
- _(m), g(!0), w(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
168
+ b(m), v(!0), w(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (m) {
170
- const C = m instanceof Error ? m.message : "Refresh failed";
171
- w(C), r("โŒ CONNECTION REFRESH ERROR", {
170
+ const N = m instanceof Error ? m.message : "Refresh failed";
171
+ w(N), r("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: C
173
+ error: N
174
174
  });
175
175
  } finally {
176
- y(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ M(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [u, s, r]), d = j.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
178
+ }, [u, s, r]), d = A.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!u,
180
- hasClient: !!h,
181
- isConnected: x,
182
- isLoading: l,
183
- hasError: !!E,
184
- capabilitiesKeys: Object.keys(o)
180
+ hasClient: !!x,
181
+ isConnected: f,
182
+ isLoading: o,
183
+ hasError: !!S,
184
+ capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: u,
187
- client: h,
188
- isConnected: x,
189
- isLoading: l,
190
- error: E,
191
- capabilities: o,
187
+ client: x,
188
+ isConnected: f,
189
+ isLoading: o,
190
+ error: S,
191
+ capabilities: l,
192
192
  refreshConnection: R,
193
193
  debug: c
194
194
  }), [
195
195
  u,
196
- h,
197
196
  x,
198
- l,
199
- E,
197
+ f,
200
198
  o,
199
+ S,
200
+ l,
201
201
  R,
202
202
  c,
203
203
  r
204
204
  ]);
205
205
  return r("๐Ÿ”„ RENDER END", {
206
- renderCount: N.current,
207
- willRenderChat: !!(h && x),
206
+ renderCount: C.current,
207
+ willRenderChat: !!(x && f),
208
208
  contextValueReady: !!d
209
- }), /* @__PURE__ */ e(Le.Provider, { value: d, children: h && x ? /* @__PURE__ */ e(
209
+ }), /* @__PURE__ */ e(Le.Provider, { value: d, children: x && f ? /* @__PURE__ */ e(
210
210
  es,
211
211
  {
212
- client: h,
212
+ client: x,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
@@ -219,10 +219,10 @@ const Le = Qe({
219
219
  }, Gs = () => fe(), Vs = (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));
225
+ return Math.floor(l / (1e3 * 60 * 60 * 24));
226
226
  }, Ws = (t) => {
227
227
  const s = /* @__PURE__ */ new Date();
228
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
@@ -282,9 +282,9 @@ const Q = ({
282
282
  image: s,
283
283
  size: n = 40,
284
284
  className: a,
285
- shape: o = "squircle"
285
+ shape: l = "squircle"
286
286
  }) => {
287
- const c = Zs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", b = o === "circle" ? { borderRadius: "50%" } : {
287
+ const c = Zs(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", g = l === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
@@ -295,7 +295,7 @@ const Q = ({
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
298
- ...b
298
+ ...g
299
299
  },
300
300
  children: s ? /* @__PURE__ */ e(
301
301
  "img",
@@ -339,12 +339,12 @@ const Q = ({
339
339
  message: t,
340
340
  standalone: s = !1
341
341
  }) => {
342
- var o;
342
+ var l;
343
343
  const n = Pe(t), a = ye(t);
344
344
  if (!n && !a)
345
345
  return null;
346
346
  if (n) {
347
- const c = (o = t.metadata) == null ? void 0 : o.amount_text;
347
+ const c = (l = t.metadata) == null ? void 0 : l.amount_text;
348
348
  if (!c) return null;
349
349
  const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${c} tip` : `Delivered with ${c} tip`;
350
350
  return /* @__PURE__ */ i("div", { className: r, children: [
@@ -356,40 +356,45 @@ const Q = ({
356
356
  /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Ys, {}) }),
357
357
  /* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
358
358
  ] });
359
- }, Oe = j.memo(
359
+ }, Oe = A.memo(
360
360
  ({
361
361
  channel: t,
362
362
  selectedChannel: s,
363
363
  onChannelSelect: n,
364
364
  debug: a = !1,
365
- unread: o,
365
+ unread: l,
366
366
  renderMessagePreview: c
367
367
  }) => {
368
- var N, v, R, d, m, C;
368
+ var p, R, d, m, N, U;
369
369
  const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
370
370
  t && n(t);
371
- }, h = Object.values(((N = t == null ? void 0 : t.state) == null ? void 0 : N.members) || {}).find(
372
- (k) => {
373
- var T, S;
374
- return ((T = k.user) == null ? void 0 : T.id) && k.user.id !== ((S = t == null ? void 0 : t._client) == null ? void 0 : S.userID);
371
+ }, g = (I) => {
372
+ const y = I.key === "Enter" || I.key === " ", B = I.repeat;
373
+ !y || B || (I.preventDefault(), u());
374
+ }, b = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
375
+ (I) => {
376
+ var y, B;
377
+ return ((y = I.user) == null ? void 0 : y.id) && I.user.id !== ((B = t == null ? void 0 : t._client) == null ? void 0 : B.userID);
375
378
  }
376
- ), _ = ((v = h == null ? void 0 : h.user) == null ? void 0 : v.name) || "Conversation", x = (R = h == null ? void 0 : h.user) == null ? void 0 : R.image, g = (m = (d = t == null ? void 0 : t.state) == null ? void 0 : d.messages) == null ? void 0 : m[t.state.messages.length - 1], y = (() => {
377
- var T;
378
- if (g != null && g.text) return g.text;
379
- const k = (T = g == null ? void 0 : g.attachments) == null ? void 0 : T[0];
380
- return k ? k.og_scrape_url ? k.og_scrape_url : k.type === "image" ? "๐Ÿ“ท Sent an image" : k.type === "video" ? "๐ŸŽฅ Sent a video" : k.type === "audio" ? "๐ŸŽต Sent audio" : k.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
381
- })(), E = g != null && g.created_at ? Ws(new Date(g.created_at)) : "", w = g ? ye(g) : !1, p = c ? c(g, y) : `${w ? "โœจ " : ""}${y}`, f = o ?? 0;
379
+ ), f = ((R = b == null ? void 0 : b.user) == null ? void 0 : R.name) || "Conversation", v = (d = b == null ? void 0 : b.user) == null ? void 0 : d.image, o = (N = (m = t == null ? void 0 : t.state) == null ? void 0 : m.messages) == null ? void 0 : N[t.state.messages.length - 1], S = (() => {
380
+ var y;
381
+ if (o != null && o.text) return o.text;
382
+ const I = (y = o == null ? void 0 : o.attachments) == null ? void 0 : y[0];
383
+ return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "๐Ÿ“ท Sent an image" : I.type === "video" ? "๐ŸŽฅ Sent a video" : I.type === "audio" ? "๐ŸŽต Sent audio" : I.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
384
+ })(), w = o != null && o.created_at ? Ws(new Date(o.created_at)) : "", E = o ? ye(o) : !1, h = c ? c(o, S) : `${E ? "โœจ " : ""}${S}`, C = l ?? 0;
382
385
  return a && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
383
386
  channelId: t == null ? void 0 : t.id,
384
387
  isSelected: r,
385
- participantName: _,
386
- unreadCount: f,
387
- hasTimestamp: !!E
388
+ participantName: f,
389
+ unreadCount: C,
390
+ hasTimestamp: !!w
388
391
  }), /* @__PURE__ */ e(
389
- "button",
392
+ "div",
390
393
  {
391
- type: "button",
394
+ role: "button",
395
+ tabIndex: 0,
392
396
  onClick: u,
397
+ onKeyDown: g,
393
398
  className: D(
394
399
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
395
400
  {
@@ -401,9 +406,9 @@ const Q = ({
401
406
  /* @__PURE__ */ e(
402
407
  Q,
403
408
  {
404
- id: ((C = h == null ? void 0 : h.user) == null ? void 0 : C.id) || t.id || "unknown",
405
- name: _,
406
- image: x,
409
+ id: ((U = b == null ? void 0 : b.user) == null ? void 0 : U.id) || t.id || "unknown",
410
+ name: f,
411
+ image: v,
407
412
  size: 44,
408
413
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
409
414
  }
@@ -417,14 +422,14 @@ const Q = ({
417
422
  "text-sm font-medium truncate",
418
423
  r ? "text-primary" : "text-charcoal"
419
424
  ),
420
- children: _
425
+ children: f
421
426
  }
422
427
  ),
423
- E && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: E })
428
+ w && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: w })
424
429
  ] }),
425
430
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
426
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: p }),
427
- f > 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: f > 99 ? "99+" : f })
431
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: h }),
432
+ 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 })
428
433
  ] })
429
434
  ] })
430
435
  ] })
@@ -433,16 +438,16 @@ const Q = ({
433
438
  }
434
439
  );
435
440
  Oe.displayName = "CustomChannelPreview";
436
- const Ue = j.memo(
441
+ const Ue = A.memo(
437
442
  ({
438
443
  onChannelSelect: t,
439
444
  selectedChannel: s,
440
445
  filters: n,
441
446
  className: a,
442
- customEmptyStateIndicator: o,
447
+ customEmptyStateIndicator: l,
443
448
  renderMessagePreview: c
444
449
  }) => {
445
- const r = j.useRef(0);
450
+ const r = A.useRef(0);
446
451
  r.current++;
447
452
  const { debug: u = !1 } = fe();
448
453
  u && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
@@ -450,10 +455,10 @@ const Ue = j.memo(
450
455
  selectedChannelId: s == null ? void 0 : s.id,
451
456
  filters: n
452
457
  });
453
- const b = j.useMemo(() => (_) => /* @__PURE__ */ e(
458
+ const g = A.useMemo(() => (b) => /* @__PURE__ */ e(
454
459
  Oe,
455
460
  {
456
- ..._,
461
+ ...b,
457
462
  selectedChannel: s,
458
463
  onChannelSelect: t,
459
464
  debug: u,
@@ -473,8 +478,8 @@ const Ue = j.memo(
473
478
  filters: n,
474
479
  sort: { last_message_at: -1 },
475
480
  options: { limit: 30 },
476
- Preview: b,
477
- EmptyStateIndicator: o
481
+ Preview: g,
482
+ EmptyStateIndicator: l
478
483
  },
479
484
  JSON.stringify(n)
480
485
  ) })
@@ -533,7 +538,7 @@ function st(t) {
533
538
  const { channel: s } = we(), { client: n } = Fe("useMessageVote"), a = be(
534
539
  () => et(t.own_reactions),
535
540
  [t.own_reactions]
536
- ), o = F(async () => {
541
+ ), l = T(async () => {
537
542
  if (n != null && n.userID)
538
543
  try {
539
544
  a === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
@@ -543,7 +548,7 @@ function st(t) {
543
548
  );
544
549
  } catch {
545
550
  }
546
- }, [s, n == null ? void 0 : n.userID, t.id, a]), c = F(async () => {
551
+ }, [s, n == null ? void 0 : n.userID, t.id, a]), c = T(async () => {
547
552
  if (n != null && n.userID)
548
553
  try {
549
554
  a === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
@@ -554,7 +559,7 @@ function st(t) {
554
559
  } catch {
555
560
  }
556
561
  }, [s, n == null ? void 0 : n.userID, t.id, a]);
557
- return { selected: a, voteUp: o, voteDown: c };
562
+ return { selected: a, voteUp: l, voteDown: c };
558
563
  }
559
564
  const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
560
565
  "path",
@@ -609,101 +614,101 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
609
614
  additionalMessageInputProps: s,
610
615
  chatbotVotingEnabled: n,
611
616
  editing: a,
612
- endOfGroup: o,
617
+ endOfGroup: l,
613
618
  firstOfGroup: c,
614
619
  groupedByUser: r,
615
620
  handleAction: u,
616
- handleOpenThread: b,
617
- handleRetry: h,
618
- highlighted: _,
619
- isMessageAIGenerated: x,
620
- isMyMessage: g,
621
- message: l,
622
- renderText: y,
623
- threadList: E
624
- } = t, { client: w } = Fe("CustomMessage"), [p, f] = M(!1), N = rs(l.id), { selected: v, voteUp: R, voteDown: d } = st(l), {
625
- Attachment: m = ls,
626
- EditMessageModal: C = os,
627
- MessageBlocked: k = is,
628
- MessageBouncePrompt: T = cs,
629
- MessageDeleted: S = ds,
630
- MessageIsThreadReplyInChannelButtonIndicator: G = us,
631
- MessageRepliesCountButton: z = ms,
621
+ handleOpenThread: g,
622
+ handleRetry: x,
623
+ highlighted: b,
624
+ isMessageAIGenerated: f,
625
+ isMyMessage: v,
626
+ message: o,
627
+ renderText: M,
628
+ threadList: S
629
+ } = t, { client: w } = Fe("CustomMessage"), [E, h] = k(!1), C = rs(o.id), { selected: p, voteUp: R, voteDown: d } = st(o), {
630
+ Attachment: m = os,
631
+ EditMessageModal: N = ls,
632
+ MessageBlocked: U = is,
633
+ MessageBouncePrompt: I = cs,
634
+ MessageDeleted: y = ds,
635
+ MessageIsThreadReplyInChannelButtonIndicator: B = us,
636
+ MessageRepliesCountButton: H = ms,
632
637
  ReminderNotification: X = hs,
633
638
  StreamedMessageText: K = fs,
634
639
  PinIndicator: Y
635
- } = as("CustomMessage"), ee = gs(l), ne = xs(l), J = be(
636
- () => x == null ? void 0 : x(l),
637
- [x, l]
640
+ } = as("CustomMessage"), ee = gs(o), ne = xs(o), J = be(
641
+ () => f == null ? void 0 : f(o),
642
+ [f, o]
638
643
  ), V = be(
639
- () => !l.shared_location && !l.attachments ? [] : l.shared_location ? [l.shared_location, ...l.attachments ?? []] : l.attachments,
640
- [l]
644
+ () => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
645
+ [o]
641
646
  );
642
- if (bs(l))
647
+ if (bs(o))
643
648
  return null;
644
- if (l.deleted_at || l.type === "deleted")
645
- return /* @__PURE__ */ e(S, { message: l });
646
- if (Cs(l))
647
- return /* @__PURE__ */ e(k, {});
648
- const L = !E && !!l.reply_count, P = !E && l.show_in_channel && l.parent_id, H = l.status === "failed" && ((re = l.error) == null ? void 0 : re.status) !== 403, O = Ns(l);
649
- let B;
650
- H ? B = () => h(l) : O && (B = () => f(!0));
651
- const le = D(
649
+ if (o.deleted_at || o.type === "deleted")
650
+ return /* @__PURE__ */ e(y, { message: o });
651
+ if (Cs(o))
652
+ return /* @__PURE__ */ e(U, {});
653
+ const F = !S && !!o.reply_count, L = !S && o.show_in_channel && o.parent_id, G = o.status === "failed" && ((re = o.error) == null ? void 0 : re.status) !== 403, P = Ns(o);
654
+ let j;
655
+ G ? j = () => x(o) : P && (j = () => h(!0));
656
+ const oe = D(
652
657
  "str-chat__message str-chat__message-simple",
653
- `str-chat__message--${l.type}`,
654
- `str-chat__message--${l.status}`,
655
- g() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
656
- l.text ? "str-chat__message--has-text" : "has-no-text",
658
+ `str-chat__message--${o.type}`,
659
+ `str-chat__message--${o.status}`,
660
+ v() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
661
+ o.text ? "str-chat__message--has-text" : "has-no-text",
657
662
  {
658
663
  "str-chat__message--has-attachment": ee,
659
- "str-chat__message--highlighted": _,
660
- "str-chat__message--pinned pinned-message": l.pinned,
664
+ "str-chat__message--highlighted": b,
665
+ "str-chat__message--pinned pinned-message": o.pinned,
661
666
  "str-chat__message--with-reactions": ne,
662
- "str-chat__message-send-can-be-retried": (l == null ? void 0 : l.status) === "failed" && ((ae = l == null ? void 0 : l.error) == null ? void 0 : ae.status) !== 403,
663
- "str-chat__message-with-thread-link": L || P,
664
- "str-chat__virtual-message__wrapper--end": o,
667
+ "str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((ae = o == null ? void 0 : o.error) == null ? void 0 : ae.status) !== 403,
668
+ "str-chat__message-with-thread-link": F || L,
669
+ "str-chat__virtual-message__wrapper--end": l,
665
670
  "str-chat__virtual-message__wrapper--first": c,
666
671
  "str-chat__virtual-message__wrapper--group": r
667
672
  }
668
- ), Z = l.poll_id && w.polls.fromState(l.poll_id), se = Xs(l);
673
+ ), Z = o.poll_id && w.polls.fromState(o.poll_id), se = Xs(o);
669
674
  return /* @__PURE__ */ i(ve, { children: [
670
675
  a && /* @__PURE__ */ e(
671
- C,
676
+ N,
672
677
  {
673
678
  additionalMessageInputProps: s
674
679
  }
675
680
  ),
676
- p && /* @__PURE__ */ e(
681
+ E && /* @__PURE__ */ e(
677
682
  vs,
678
683
  {
679
- MessageBouncePrompt: T,
680
- onClose: () => f(!1),
681
- open: p
684
+ MessageBouncePrompt: I,
685
+ onClose: () => h(!1),
686
+ open: E
682
687
  }
683
688
  ),
684
- /* @__PURE__ */ i("div", { className: le, children: [
689
+ /* @__PURE__ */ i("div", { className: oe, children: [
685
690
  Y && /* @__PURE__ */ e(Y, {}),
686
- !!N && /* @__PURE__ */ e(X, { reminder: N }),
687
- l.user && /* @__PURE__ */ e(
691
+ !!C && /* @__PURE__ */ e(X, { reminder: C }),
692
+ o.user && /* @__PURE__ */ e(
688
693
  Q,
689
694
  {
690
695
  className: "str-chat__avatar str-chat__message-sender-avatar",
691
- id: l.user.id,
692
- image: l.user.image,
693
- name: l.user.name || l.user.id
696
+ id: o.user.id,
697
+ image: o.user.image,
698
+ name: o.user.name || o.user.id
694
699
  }
695
700
  ),
696
701
  /* @__PURE__ */ e(
697
702
  "div",
698
703
  {
699
704
  className: D("str-chat__message-inner", {
700
- "str-chat__simple-message--error-failed": H || O
705
+ "str-chat__simple-message--error-failed": G || P
701
706
  }),
702
707
  "data-testid": "message-inner",
703
- onClick: B,
704
- onKeyDown: B,
705
- role: B ? "button" : void 0,
706
- tabIndex: B ? 0 : void 0,
708
+ onClick: j,
709
+ onKeyDown: j,
710
+ role: j ? "button" : void 0,
711
+ tabIndex: j ? 0 : void 0,
707
712
  style: {
708
713
  // Force margins to 0 to prevent hover layout shift
709
714
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
@@ -712,11 +717,11 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
712
717
  },
713
718
  children: se ? (
714
719
  /* Tip-only messages render as a standalone bubble */
715
- /* @__PURE__ */ e(Te, { message: l, standalone: !0 })
720
+ /* @__PURE__ */ e(Te, { message: o, standalone: !0 })
716
721
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
717
722
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
718
723
  Z && /* @__PURE__ */ e(ws, { poll: Z }),
719
- V != null && V.length && !l.quoted_message ? /* @__PURE__ */ e(
724
+ V != null && V.length && !o.quoted_message ? /* @__PURE__ */ e(
720
725
  m,
721
726
  {
722
727
  actionHandler: u,
@@ -726,17 +731,17 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
726
731
  J ? /* @__PURE__ */ e(
727
732
  K,
728
733
  {
729
- message: l,
730
- renderText: y
734
+ message: o,
735
+ renderText: M
731
736
  }
732
- ) : /* @__PURE__ */ e(ps, { message: l, renderText: y }),
737
+ ) : /* @__PURE__ */ e(ps, { message: o, renderText: M }),
733
738
  /* @__PURE__ */ e(ys, {})
734
739
  ] }),
735
- /* @__PURE__ */ e(Te, { message: l }),
736
- n && ye(l) && /* @__PURE__ */ e(
740
+ /* @__PURE__ */ e(Te, { message: o }),
741
+ n && ye(o) && /* @__PURE__ */ e(
737
742
  rt,
738
743
  {
739
- selected: v,
744
+ selected: p,
740
745
  onVoteUp: R,
741
746
  onVoteDown: d
742
747
  }
@@ -744,22 +749,22 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
744
749
  ] })
745
750
  }
746
751
  ),
747
- L && /* @__PURE__ */ e(
748
- z,
752
+ F && /* @__PURE__ */ e(
753
+ H,
749
754
  {
750
- onClick: b,
751
- reply_count: l.reply_count
755
+ onClick: g,
756
+ reply_count: o.reply_count
752
757
  }
753
758
  ),
754
- P && /* @__PURE__ */ e(G, {})
755
- ] }, l.id)
759
+ L && /* @__PURE__ */ e(B, {})
760
+ ] }, o.id)
756
761
  ] });
757
- }, lt = j.memo(
762
+ }, ot = A.memo(
758
763
  at,
759
764
  ns
760
- ), ot = (t) => {
765
+ ), lt = (t) => {
761
766
  const s = Es("CustomMessage");
762
- return /* @__PURE__ */ e(lt, { ...s, ...t });
767
+ return /* @__PURE__ */ e(ot, { ...s, ...t });
763
768
  }, it = (t) => ({
764
769
  linkPreviews: Array.from(t.previews.values()).filter(
765
770
  (s) => Re.previewIsLoaded(s) || Re.previewIsLoading(s)
@@ -768,7 +773,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
768
773
  link: t,
769
774
  onDismiss: s
770
775
  }) => {
771
- const { og_scrape_url: n, title: a, image_url: o } = t;
776
+ const { og_scrape_url: n, title: a, image_url: l } = t;
772
777
  return /* @__PURE__ */ i(
773
778
  "a",
774
779
  {
@@ -777,10 +782,10 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
777
782
  rel: "noopener noreferrer",
778
783
  className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
779
784
  children: [
780
- o && /* @__PURE__ */ e(
785
+ l && /* @__PURE__ */ e(
781
786
  "img",
782
787
  {
783
- src: o,
788
+ src: l,
784
789
  alt: a || "",
785
790
  className: "h-[148px] w-full rounded-[20px] object-cover"
786
791
  }
@@ -808,16 +813,16 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
808
813
  const { linkPreviewsManager: t } = Is(), { linkPreviews: s } = _s(
809
814
  t.state,
810
815
  it
811
- ), n = (o) => {
812
- t.dismissPreview(o);
816
+ ), n = (l) => {
817
+ t.dismissPreview(l);
813
818
  };
814
- 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(
819
+ 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(
815
820
  ct,
816
821
  {
817
- link: o,
822
+ link: l,
818
823
  onDismiss: n
819
824
  },
820
- o.og_scrape_url
825
+ l.og_scrape_url
821
826
  )) }) : null;
822
827
  }, ut = () => {
823
828
  const { handleSubmit: t } = Ms(), s = ks();
@@ -909,7 +914,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
909
914
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
910
915
  ]
911
916
  }
912
- ), he = j.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
917
+ ), he = A.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
913
918
  /* @__PURE__ */ e(gt, { className: "w-6 h-6" }),
914
919
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
915
920
  ] }) }));
@@ -919,35 +924,35 @@ const xt = ({
919
924
  showBackButton: s,
920
925
  onShowInfo: n,
921
926
  canShowInfo: a,
922
- showStarButton: o = !1
927
+ showStarButton: l = !1
923
928
  }) => {
924
- var g, l, y, E, w, p;
925
- const { channel: c } = we(), r = j.useMemo(() => Object.values(c.state.members || {}).find(
926
- (N) => {
927
- var v;
928
- return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== c._client.userID;
929
+ var v, o, M, S, w, E;
930
+ const { channel: c } = we(), r = A.useMemo(() => Object.values(c.state.members || {}).find(
931
+ (C) => {
932
+ var p;
933
+ return ((p = C.user) == null ? void 0 : p.id) && C.user.id !== c._client.userID;
929
934
  }
930
- ), [c._client.userID, c.state.members]), u = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((l = r == null ? void 0 : r.user) == null ? void 0 : l.id) || "Unknown member", b = (y = r == null ? void 0 : r.user) == null ? void 0 : y.image, [h, _] = M(
931
- !!((E = c.state.membership) != null && E.pinned_at)
935
+ ), [c._client.userID, c.state.members]), u = ((v = r == null ? void 0 : r.user) == null ? void 0 : v.name) || ((o = r == null ? void 0 : r.user) == null ? void 0 : o.id) || "Unknown member", g = (M = r == null ? void 0 : r.user) == null ? void 0 : M.image, [x, b] = k(
936
+ !!((S = c.state.membership) != null && S.pinned_at)
932
937
  );
933
938
  q(() => {
934
- const f = (N) => {
935
- var v;
936
- _(
937
- N != null && N.member ? !!N.member.pinned_at : !!((v = c.state.membership) != null && v.pinned_at)
939
+ const h = (C) => {
940
+ var p;
941
+ b(
942
+ C != null && C.member ? !!C.member.pinned_at : !!((p = c.state.membership) != null && p.pinned_at)
938
943
  );
939
944
  };
940
- return c.on("member.updated", f), () => {
941
- c.off("member.updated", f);
945
+ return c.on("member.updated", h), () => {
946
+ c.off("member.updated", h);
942
947
  };
943
948
  }, [c]);
944
- const x = async () => {
949
+ const f = async () => {
945
950
  try {
946
- h ? await c.unpin() : await c.pin();
947
- } catch (f) {
951
+ x ? await c.unpin() : await c.pin();
952
+ } catch (h) {
948
953
  console.error(
949
954
  "[CustomChannelHeader] Failed to update pinned status:",
950
- f
955
+ h
951
956
  );
952
957
  }
953
958
  };
@@ -972,28 +977,28 @@ const xt = ({
972
977
  {
973
978
  id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || c.id || "unknown",
974
979
  name: u,
975
- image: b,
980
+ image: g,
976
981
  size: 40
977
982
  }
978
983
  ),
979
984
  /* @__PURE__ */ e("h1", { className: "text-xs font-medium text-black/90", children: u })
980
985
  ] }),
981
986
  /* @__PURE__ */ i("div", { className: "flex justify-end items-center gap-2", children: [
982
- o && /* @__PURE__ */ e(
987
+ l && /* @__PURE__ */ e(
983
988
  "button",
984
989
  {
985
990
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
986
- onClick: x,
991
+ onClick: f,
987
992
  type: "button",
988
- "aria-label": h ? "Unstar conversation" : "Star conversation",
993
+ "aria-label": x ? "Unstar conversation" : "Star conversation",
989
994
  children: /* @__PURE__ */ e(
990
995
  _e,
991
996
  {
992
997
  className: D("size-5", {
993
- "text-yellow-600": h,
994
- "text-black/90": !h
998
+ "text-yellow-600": x,
999
+ "text-black/90": !x
995
1000
  }),
996
- weight: h ? "duotone" : "regular"
1001
+ weight: x ? "duotone" : "regular"
997
1002
  }
998
1003
  )
999
1004
  }
@@ -1025,30 +1030,30 @@ const xt = ({
1025
1030
  /* @__PURE__ */ e(
1026
1031
  Q,
1027
1032
  {
1028
- id: ((p = r == null ? void 0 : r.user) == null ? void 0 : p.id) || c.id || "unknown",
1033
+ id: ((E = r == null ? void 0 : r.user) == null ? void 0 : E.id) || c.id || "unknown",
1029
1034
  name: u,
1030
- image: b,
1035
+ image: g,
1031
1036
  size: 40
1032
1037
  }
1033
1038
  ),
1034
1039
  /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("h1", { className: "font-medium text-black/90 truncate", children: u }) })
1035
1040
  ] }),
1036
1041
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
1037
- o && /* @__PURE__ */ e(
1042
+ l && /* @__PURE__ */ e(
1038
1043
  "button",
1039
1044
  {
1040
1045
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1041
- onClick: x,
1046
+ onClick: f,
1042
1047
  type: "button",
1043
- "aria-label": h ? "Unstar conversation" : "Star conversation",
1048
+ "aria-label": x ? "Unstar conversation" : "Star conversation",
1044
1049
  children: /* @__PURE__ */ e(
1045
1050
  _e,
1046
1051
  {
1047
1052
  className: D("size-5", {
1048
- "text-yellow-600": h,
1049
- "text-black/90": !h
1053
+ "text-yellow-600": x,
1054
+ "text-black/90": !x
1050
1055
  }),
1051
- weight: h ? "duotone" : "regular"
1056
+ weight: x ? "duotone" : "regular"
1052
1057
  }
1053
1058
  )
1054
1059
  }
@@ -1071,82 +1076,82 @@ const xt = ({
1071
1076
  onClose: s,
1072
1077
  participant: n,
1073
1078
  channel: a,
1074
- followerStatusLabel: o,
1079
+ followerStatusLabel: l,
1075
1080
  onLeaveConversation: c,
1076
1081
  onBlockParticipant: r,
1077
1082
  showDeleteConversation: u = !0,
1078
- onDeleteConversationClick: b,
1079
- onBlockParticipantClick: h,
1080
- onReportParticipantClick: _
1083
+ onDeleteConversationClick: g,
1084
+ onBlockParticipantClick: x,
1085
+ onReportParticipantClick: b
1081
1086
  }) => {
1082
1087
  var X, K, Y, ee, ne, J, V;
1083
- const { service: x, debug: g } = fe(), [l, y] = M(!1), [E, w] = M(!1), [p, f] = M(!1), N = F(async () => {
1084
- var L;
1085
- if (!(!x || !((L = n == null ? void 0 : n.user) != null && L.id)))
1088
+ const { service: f, debug: v } = fe(), [o, M] = k(!1), [S, w] = k(!1), [E, h] = k(!1), C = T(async () => {
1089
+ var F;
1090
+ if (!(!f || !((F = n == null ? void 0 : n.user) != null && F.id)))
1086
1091
  try {
1087
- const H = (await x.getBlockedUsers()).some(
1088
- (O) => {
1089
- var B;
1090
- return O.blocked_user_id === ((B = n == null ? void 0 : n.user) == null ? void 0 : B.id);
1092
+ const G = (await f.getBlockedUsers()).some(
1093
+ (P) => {
1094
+ var j;
1095
+ return P.blocked_user_id === ((j = n == null ? void 0 : n.user) == null ? void 0 : j.id);
1091
1096
  }
1092
1097
  );
1093
- y(H);
1094
- } catch (P) {
1098
+ M(G);
1099
+ } catch (L) {
1095
1100
  console.error(
1096
1101
  "[ChannelInfoDialog] Failed to check blocked status:",
1097
- P
1102
+ L
1098
1103
  );
1099
1104
  }
1100
- }, [x, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1105
+ }, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1101
1106
  q(() => {
1102
- N();
1103
- }, [N]);
1104
- const v = async () => {
1105
- var L;
1106
- if (!E) {
1107
- b == null || b(), g && console.log("[ChannelInfoDialog] Leave conversation", a.cid), w(!0);
1107
+ C();
1108
+ }, [C]);
1109
+ const p = async () => {
1110
+ var F;
1111
+ if (!S) {
1112
+ g == null || g(), v && console.log("[ChannelInfoDialog] Leave conversation", a.cid), w(!0);
1108
1113
  try {
1109
- const P = ((L = a._client) == null ? void 0 : L.userID) ?? null;
1110
- await a.hide(P, !1), c && await c(a), s();
1111
- } catch (P) {
1112
- console.error("[ChannelInfoDialog] Failed to leave conversation", P);
1114
+ const L = ((F = a._client) == null ? void 0 : F.userID) ?? null;
1115
+ await a.hide(L, !1), c && await c(a), s();
1116
+ } catch (L) {
1117
+ console.error("[ChannelInfoDialog] Failed to leave conversation", L);
1113
1118
  } finally {
1114
1119
  w(!1);
1115
1120
  }
1116
1121
  }
1117
1122
  }, R = async () => {
1118
- var L, P, H;
1119
- if (!(p || !x)) {
1120
- h == null || h(), g && console.log("[ChannelInfoDialog] Block member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
1123
+ var F, L, G;
1124
+ if (!(E || !f)) {
1125
+ x == null || x(), v && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), h(!0);
1121
1126
  try {
1122
- await x.blockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
1123
- } catch (O) {
1124
- console.error("[ChannelInfoDialog] Failed to block member", O);
1127
+ await f.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), r && await r((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1128
+ } catch (P) {
1129
+ console.error("[ChannelInfoDialog] Failed to block member", P);
1125
1130
  } finally {
1126
- f(!1);
1131
+ h(!1);
1127
1132
  }
1128
1133
  }
1129
1134
  }, d = async () => {
1130
- var L, P, H;
1131
- if (!(p || !x)) {
1132
- h == null || h(), g && console.log("[ChannelInfoDialog] Unblock member", (L = n == null ? void 0 : n.user) == null ? void 0 : L.id), f(!0);
1135
+ var F, L, G;
1136
+ if (!(E || !f)) {
1137
+ x == null || x(), v && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), h(!0);
1133
1138
  try {
1134
- await x.unBlockUser((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), r && await r((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
1135
- } catch (O) {
1136
- console.error("[ChannelInfoDialog] Failed to unblock member", O);
1139
+ await f.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), r && await r((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1140
+ } catch (P) {
1141
+ console.error("[ChannelInfoDialog] Failed to unblock member", P);
1137
1142
  } finally {
1138
- f(!1);
1143
+ h(!1);
1139
1144
  }
1140
1145
  }
1141
1146
  }, m = () => {
1142
- _ == null || _(), s(), window.open(
1147
+ b == null || b(), s(), window.open(
1143
1148
  "https://linktr.ee/s/about/trust-center/report",
1144
1149
  "_blank",
1145
1150
  "noopener,noreferrer"
1146
1151
  );
1147
1152
  };
1148
1153
  if (!n) return null;
1149
- const C = ((K = n.user) == null ? void 0 : K.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", k = (ee = n.user) == null ? void 0 : ee.image, T = (ne = n.user) == null ? void 0 : ne.email, S = (J = n.user) == null ? void 0 : J.username, G = T || (S ? `linktr.ee/${S}` : void 0), z = ((V = n.user) == null ? void 0 : V.id) || "unknown";
1154
+ const N = ((K = n.user) == null ? void 0 : K.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", U = (ee = n.user) == null ? void 0 : ee.image, I = (ne = n.user) == null ? void 0 : ne.email, y = (J = n.user) == null ? void 0 : J.username, B = I || (y ? `linktr.ee/${y}` : void 0), H = ((V = n.user) == null ? void 0 : V.id) || "unknown";
1150
1155
  return (
1151
1156
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1152
1157
  /* @__PURE__ */ e(
@@ -1155,8 +1160,8 @@ const xt = ({
1155
1160
  ref: t,
1156
1161
  className: "mes-dialog group",
1157
1162
  onClose: s,
1158
- onClick: (L) => {
1159
- L.target === t.current && s();
1163
+ onClick: (F) => {
1164
+ F.target === t.current && s();
1160
1165
  },
1161
1166
  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: [
1162
1167
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
@@ -1173,28 +1178,28 @@ const xt = ({
1173
1178
  /* @__PURE__ */ e(
1174
1179
  Q,
1175
1180
  {
1176
- id: z,
1177
- name: C,
1178
- image: k,
1181
+ id: H,
1182
+ name: N,
1183
+ image: U,
1179
1184
  size: 88,
1180
1185
  shape: "circle"
1181
1186
  }
1182
1187
  ),
1183
1188
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1184
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
1185
- G && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: G }),
1186
- o && /* @__PURE__ */ e(
1189
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: N }),
1190
+ B && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: B }),
1191
+ l && /* @__PURE__ */ e(
1187
1192
  "span",
1188
1193
  {
1189
1194
  className: "mt-1 rounded-full text-xs font-normal w-fit",
1190
1195
  style: {
1191
1196
  padding: "4px 8px",
1192
- backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
1193
- color: o === "Subscribed to you" ? "#008236" : "#78716C",
1197
+ backgroundColor: l === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
1198
+ color: l === "Subscribed to you" ? "#008236" : "#78716C",
1194
1199
  lineHeight: "133.333%",
1195
1200
  letterSpacing: "0.21px"
1196
1201
  },
1197
- children: o
1202
+ children: l
1198
1203
  }
1199
1204
  )
1200
1205
  ] })
@@ -1205,23 +1210,23 @@ const xt = ({
1205
1210
  u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1206
1211
  de,
1207
1212
  {
1208
- onClick: v,
1209
- disabled: E,
1210
- "aria-busy": E,
1213
+ onClick: p,
1214
+ disabled: S,
1215
+ "aria-busy": S,
1211
1216
  children: [
1212
- E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
1217
+ S ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
1213
1218
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1214
1219
  ]
1215
1220
  }
1216
1221
  ) }),
1217
- /* @__PURE__ */ e("li", { children: l ? /* @__PURE__ */ i(
1222
+ /* @__PURE__ */ e("li", { children: o ? /* @__PURE__ */ i(
1218
1223
  de,
1219
1224
  {
1220
1225
  onClick: d,
1221
- disabled: p,
1222
- "aria-busy": p,
1226
+ disabled: E,
1227
+ "aria-busy": E,
1223
1228
  children: [
1224
- p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1229
+ E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1225
1230
  /* @__PURE__ */ e("span", { children: "Unblock" })
1226
1231
  ]
1227
1232
  }
@@ -1229,10 +1234,10 @@ const xt = ({
1229
1234
  de,
1230
1235
  {
1231
1236
  onClick: R,
1232
- disabled: p,
1233
- "aria-busy": p,
1237
+ disabled: E,
1238
+ "aria-busy": E,
1234
1239
  children: [
1235
- p ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1240
+ E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1236
1241
  /* @__PURE__ */ e("span", { children: "Block" })
1237
1242
  ]
1238
1243
  }
@@ -1252,39 +1257,39 @@ const xt = ({
1252
1257
  showBackButton: s,
1253
1258
  renderMessageInputActions: n,
1254
1259
  onLeaveConversation: a,
1255
- onBlockParticipant: o,
1260
+ onBlockParticipant: l,
1256
1261
  showDeleteConversation: c = !0,
1257
1262
  onDeleteConversationClick: r,
1258
1263
  onBlockParticipantClick: u,
1259
- onReportParticipantClick: b,
1260
- showStarButton: h = !1,
1261
- chatbotVotingEnabled: _ = !1,
1262
- renderChannelBanner: x
1264
+ onReportParticipantClick: g,
1265
+ showStarButton: x = !1,
1266
+ chatbotVotingEnabled: b = !1,
1267
+ renderChannelBanner: f
1263
1268
  }) => {
1264
- const { channel: g } = we(), l = W(null), y = j.useMemo(() => Object.values(g.state.members || {}).find(
1265
- (N) => {
1266
- var v;
1267
- return ((v = N.user) == null ? void 0 : v.id) && N.user.id !== g._client.userID;
1269
+ const { channel: v } = we(), o = W(null), M = A.useMemo(() => Object.values(v.state.members || {}).find(
1270
+ (C) => {
1271
+ var p;
1272
+ return ((p = C.user) == null ? void 0 : p.id) && C.user.id !== v._client.userID;
1268
1273
  }
1269
- ), [g._client.userID, g.state.members]), E = j.useMemo(() => {
1270
- const f = g.data ?? {};
1271
- if (f.followerStatus)
1272
- return String(f.followerStatus);
1273
- if (f.isFollower !== void 0)
1274
- return f.isFollower ? "Subscribed to you" : "Not subscribed";
1275
- }, [g.data]), w = F(() => {
1276
- var f;
1277
- (f = l.current) == null || f.showModal();
1278
- }, []), p = F(() => {
1279
- var f;
1280
- (f = l.current) == null || f.close();
1274
+ ), [v._client.userID, v.state.members]), S = A.useMemo(() => {
1275
+ const h = v.data ?? {};
1276
+ if (h.followerStatus)
1277
+ return String(h.followerStatus);
1278
+ if (h.isFollower !== void 0)
1279
+ return h.isFollower ? "Subscribed to you" : "Not subscribed";
1280
+ }, [v.data]), w = T(() => {
1281
+ var h;
1282
+ (h = o.current) == null || h.showModal();
1283
+ }, []), E = T(() => {
1284
+ var h;
1285
+ (h = o.current) == null || h.close();
1281
1286
  }, []);
1282
1287
  return /* @__PURE__ */ i(ve, { children: [
1283
1288
  /* @__PURE__ */ e(
1284
1289
  Os,
1285
1290
  {
1286
1291
  overrides: {
1287
- Message: (f) => /* @__PURE__ */ e(ot, { ...f, chatbotVotingEnabled: _ })
1292
+ Message: (h) => /* @__PURE__ */ e(lt, { ...h, chatbotVotingEnabled: b })
1288
1293
  },
1289
1294
  children: /* @__PURE__ */ i(Us, { children: [
1290
1295
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
@@ -1293,11 +1298,11 @@ const xt = ({
1293
1298
  onBack: t,
1294
1299
  showBackButton: s,
1295
1300
  onShowInfo: w,
1296
- canShowInfo: !!y,
1297
- showStarButton: h
1301
+ canShowInfo: !!M,
1302
+ showStarButton: x
1298
1303
  }
1299
1304
  ) }),
1300
- x == null ? void 0 : x(),
1305
+ f == null ? void 0 : f(),
1301
1306
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1302
1307
  Bs,
1303
1308
  {
@@ -1309,7 +1314,7 @@ const xt = ({
1309
1314
  /* @__PURE__ */ e(
1310
1315
  mt,
1311
1316
  {
1312
- renderActions: () => n == null ? void 0 : n(g)
1317
+ renderActions: () => n == null ? void 0 : n(v)
1313
1318
  }
1314
1319
  )
1315
1320
  ] })
@@ -1318,60 +1323,60 @@ const xt = ({
1318
1323
  /* @__PURE__ */ e(
1319
1324
  bt,
1320
1325
  {
1321
- dialogRef: l,
1322
- onClose: p,
1323
- participant: y,
1324
- channel: g,
1325
- followerStatusLabel: E,
1326
+ dialogRef: o,
1327
+ onClose: E,
1328
+ participant: M,
1329
+ channel: v,
1330
+ followerStatusLabel: S,
1326
1331
  onLeaveConversation: a,
1327
- onBlockParticipant: o,
1332
+ onBlockParticipant: l,
1328
1333
  showDeleteConversation: c,
1329
1334
  onDeleteConversationClick: r,
1330
1335
  onBlockParticipantClick: u,
1331
- onReportParticipantClick: b
1336
+ onReportParticipantClick: g
1332
1337
  }
1333
1338
  )
1334
1339
  ] });
1335
- }, Ae = j.memo(
1340
+ }, Ae = A.memo(
1336
1341
  ({
1337
1342
  channel: t,
1338
1343
  onBack: s,
1339
1344
  showBackButton: n = !1,
1340
1345
  renderMessageInputActions: a,
1341
- onLeaveConversation: o,
1346
+ onLeaveConversation: l,
1342
1347
  onBlockParticipant: c,
1343
1348
  className: r,
1344
1349
  CustomChannelEmptyState: u = ft,
1345
- showDeleteConversation: b = !0,
1346
- onDeleteConversationClick: h,
1347
- onBlockParticipantClick: _,
1348
- onReportParticipantClick: x,
1349
- dmAgentEnabled: g,
1350
- messageMetadata: l,
1351
- onMessageSent: y,
1352
- showStarButton: E = !1,
1350
+ showDeleteConversation: g = !0,
1351
+ onDeleteConversationClick: x,
1352
+ onBlockParticipantClick: b,
1353
+ onReportParticipantClick: f,
1354
+ dmAgentEnabled: v,
1355
+ messageMetadata: o,
1356
+ onMessageSent: M,
1357
+ showStarButton: S = !1,
1353
1358
  chatbotVotingEnabled: w = !1,
1354
- renderChannelBanner: p
1359
+ renderChannelBanner: E
1355
1360
  }) => {
1356
- const f = F(
1357
- async (N, v, R) => {
1358
- var S;
1359
- const d = ((S = t.data) == null ? void 0 : S.chatbot_paused) === !0, m = g && !d, C = {
1360
- ...v,
1361
+ const h = T(
1362
+ async (C, p, R) => {
1363
+ var y;
1364
+ const d = ((y = t.data) == null ? void 0 : y.chatbot_paused) === !0, m = v && !d, N = {
1365
+ ...p,
1361
1366
  ...m && { silent: !0 },
1362
- ...l && {
1367
+ ...o && {
1363
1368
  metadata: {
1364
- ...v.metadata ?? {},
1365
- ...l
1369
+ ...p.metadata ?? {},
1370
+ ...o
1366
1371
  }
1367
1372
  }
1368
- }, k = {
1373
+ }, U = {
1369
1374
  ...R,
1370
1375
  ...m && { skip_push: !0 }
1371
- }, T = await t.sendMessage(C, k);
1372
- return y == null || y(T), T;
1376
+ }, I = await t.sendMessage(N, U);
1377
+ return M == null || M(I), I;
1373
1378
  },
1374
- [t, g, l, y]
1379
+ [t, v, o, M]
1375
1380
  );
1376
1381
  return /* @__PURE__ */ e(
1377
1382
  "div",
@@ -1388,23 +1393,23 @@ const xt = ({
1388
1393
  EmptyStateIndicator: u,
1389
1394
  LoadingIndicator: he,
1390
1395
  DateSeparator: Ks,
1391
- doSendMessageRequest: f,
1396
+ doSendMessageRequest: h,
1392
1397
  children: /* @__PURE__ */ e(
1393
1398
  Ct,
1394
1399
  {
1395
1400
  onBack: s,
1396
1401
  showBackButton: n,
1397
1402
  renderMessageInputActions: a,
1398
- onLeaveConversation: o,
1403
+ onLeaveConversation: l,
1399
1404
  onBlockParticipant: c,
1400
1405
  CustomChannelEmptyState: u,
1401
- showDeleteConversation: b,
1402
- onDeleteConversationClick: h,
1403
- onBlockParticipantClick: _,
1404
- onReportParticipantClick: x,
1405
- showStarButton: E,
1406
+ showDeleteConversation: g,
1407
+ onDeleteConversationClick: x,
1408
+ onBlockParticipantClick: b,
1409
+ onReportParticipantClick: f,
1410
+ showStarButton: S,
1406
1411
  chatbotVotingEnabled: w,
1407
- renderChannelBanner: p
1412
+ renderChannelBanner: E
1408
1413
  }
1409
1414
  )
1410
1415
  }
@@ -1435,7 +1440,7 @@ function Nt({
1435
1440
  type: "text",
1436
1441
  placeholder: n,
1437
1442
  value: t,
1438
- onChange: (o) => s(o.target.value),
1443
+ onChange: (l) => s(l.target.value),
1439
1444
  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"
1440
1445
  }
1441
1446
  ),
@@ -1444,8 +1449,8 @@ function Nt({
1444
1449
  {
1445
1450
  label: "Clear search",
1446
1451
  onClick: () => {
1447
- var o;
1448
- s(""), (o = a.current) == null || o.focus();
1452
+ var l;
1453
+ s(""), (l = a.current) == null || l.focus();
1449
1454
  },
1450
1455
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1451
1456
  children: /* @__PURE__ */ e(pe, { className: "h-4 w-4", weight: "bold" })
@@ -1458,13 +1463,13 @@ const vt = ({
1458
1463
  onSelectParticipant: s,
1459
1464
  onClose: n,
1460
1465
  existingParticipantIds: a = /* @__PURE__ */ new Set(),
1461
- participantLabel: o = "participants",
1466
+ participantLabel: l = "participants",
1462
1467
  searchPlaceholder: c = "Search participants...",
1463
1468
  className: r
1464
1469
  }) => {
1465
- const { debug: u } = fe(), [b, h] = M(""), [_, x] = M([]), [g, l] = M(!1), [y, E] = M(null), [w, p] = M(
1470
+ const { debug: u } = fe(), [g, x] = k(""), [b, f] = k([]), [v, o] = k(!1), [M, S] = k(null), [w, E] = k(
1466
1471
  null
1467
- ), f = W(!1);
1472
+ ), h = W(!1);
1468
1473
  q(() => {
1469
1474
  if (t.loading) {
1470
1475
  u && console.log(
@@ -1472,46 +1477,46 @@ const vt = ({
1472
1477
  );
1473
1478
  return;
1474
1479
  }
1475
- if (f.current) return;
1480
+ if (h.current) return;
1476
1481
  (async () => {
1477
- u && console.log("[ParticipantPicker] Loading initial participants..."), l(!0), E(null);
1482
+ u && console.log("[ParticipantPicker] Loading initial participants..."), o(!0), S(null);
1478
1483
  try {
1479
1484
  const m = await t.loadParticipants({
1480
1485
  search: "",
1481
1486
  // Load all participants initially
1482
1487
  limit: 100
1483
1488
  });
1484
- x(m.participants), f.current = !0, u && console.log(
1489
+ f(m.participants), h.current = !0, u && console.log(
1485
1490
  "[ParticipantPicker] Participants loaded successfully:",
1486
1491
  m.participants.length
1487
1492
  );
1488
1493
  } catch (m) {
1489
- const C = m instanceof Error ? m.message : "Failed to load participants";
1490
- E(C), console.error("[ParticipantPicker] Failed to load participants:", m);
1494
+ const N = m instanceof Error ? m.message : "Failed to load participants";
1495
+ S(N), console.error("[ParticipantPicker] Failed to load participants:", m);
1491
1496
  } finally {
1492
- l(!1);
1497
+ o(!1);
1493
1498
  }
1494
1499
  })();
1495
1500
  }, [t.loading, u]);
1496
- const N = _.filter((d) => !a.has(d.id)).filter((d) => {
1497
- var C;
1498
- if (!b) return !0;
1499
- const m = b.toLowerCase();
1500
- return d.name.toLowerCase().includes(m) || ((C = d.email) == null ? void 0 : C.toLowerCase().includes(m)) || !1;
1501
- }), v = F(
1501
+ const C = b.filter((d) => !a.has(d.id)).filter((d) => {
1502
+ var N;
1503
+ if (!g) return !0;
1504
+ const m = g.toLowerCase();
1505
+ return d.name.toLowerCase().includes(m) || ((N = d.email) == null ? void 0 : N.toLowerCase().includes(m)) || !1;
1506
+ }), p = T(
1502
1507
  async (d) => {
1503
1508
  if (!w) {
1504
- p(d.id);
1509
+ E(d.id);
1505
1510
  try {
1506
1511
  await s(d);
1507
1512
  } catch (m) {
1508
- console.error("[ParticipantPicker] Failed to start chat:", m), p(null);
1513
+ console.error("[ParticipantPicker] Failed to start chat:", m), E(null);
1509
1514
  }
1510
1515
  }
1511
1516
  },
1512
1517
  [s, w]
1513
1518
  ), R = (d, m) => {
1514
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), v(m));
1519
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), p(m));
1515
1520
  };
1516
1521
  return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1517
1522
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
@@ -1521,47 +1526,47 @@ const vt = ({
1521
1526
  ] }),
1522
1527
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1523
1528
  "Select a ",
1524
- o.slice(0, -1),
1529
+ l.slice(0, -1),
1525
1530
  " to start messaging (",
1526
- N.length,
1531
+ C.length,
1527
1532
  " available)",
1528
- t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${o} total`
1533
+ t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${l} total`
1529
1534
  ] }),
1530
1535
  /* @__PURE__ */ e(
1531
1536
  Nt,
1532
1537
  {
1533
- searchQuery: b,
1534
- setSearchQuery: h,
1538
+ searchQuery: g,
1539
+ setSearchQuery: x,
1535
1540
  placeholder: c
1536
1541
  }
1537
1542
  )
1538
1543
  ] }),
1539
- y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1544
+ M && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1540
1545
  "Error loading ",
1541
- o,
1546
+ l,
1542
1547
  ": ",
1543
- y
1548
+ M
1544
1549
  ] }),
1545
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: g && N.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: [
1550
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && C.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: [
1546
1551
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1547
1552
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1548
1553
  "Loading ",
1549
- o,
1554
+ l,
1550
1555
  "..."
1551
1556
  ] })
1552
- ] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1557
+ ] }) }) : C.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1553
1558
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(ke, { className: "h-8 w-8 text-charcoal" }) }),
1554
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: b ? `No ${o} found` : _.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1555
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: b ? "Try a different search term" : _.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1559
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1560
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1556
1561
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1557
- N.map((d) => {
1558
- const m = d.name || d.email || d.id, C = d.email && d.name ? d.email : d.phone;
1562
+ C.map((d) => {
1563
+ const m = d.name || d.email || d.id, N = d.email && d.name ? d.email : d.phone;
1559
1564
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1560
1565
  "button",
1561
1566
  {
1562
1567
  type: "button",
1563
- onClick: () => v(d),
1564
- onKeyDown: (k) => R(k, d),
1568
+ onClick: () => p(d),
1569
+ onKeyDown: (U) => R(U, d),
1565
1570
  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",
1566
1571
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1567
1572
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
@@ -1576,7 +1581,7 @@ const vt = ({
1576
1581
  ),
1577
1582
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1578
1583
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1579
- C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
1584
+ N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1580
1585
  ] })
1581
1586
  ] }),
1582
1587
  /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === d.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
@@ -1584,7 +1589,7 @@ const vt = ({
1584
1589
  }
1585
1590
  ) }, d.id);
1586
1591
  }),
1587
- g && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1592
+ v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1588
1593
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1589
1594
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1590
1595
  ] }) })
@@ -1724,7 +1729,7 @@ const vt = ({
1724
1729
  ] })
1725
1730
  ]
1726
1731
  }
1727
- ), $e = j.memo(
1732
+ ), $e = A.memo(
1728
1733
  ({ 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: [
1729
1734
  /* @__PURE__ */ e(wt, {}),
1730
1735
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
@@ -1734,7 +1739,7 @@ const vt = ({
1734
1739
  ] }) })
1735
1740
  );
1736
1741
  $e.displayName = "EmptyState";
1737
- const me = j.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: [
1742
+ const me = A.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: [
1738
1743
  /* @__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: "โš ๏ธ" }) }),
1739
1744
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1740
1745
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1754,138 +1759,138 @@ const Dt = ({
1754
1759
  className: s,
1755
1760
  renderMessageInputActions: n,
1756
1761
  onChannelSelect: a,
1757
- onParticipantSelect: o,
1762
+ onParticipantSelect: l,
1758
1763
  initialParticipantFilter: c,
1759
1764
  initialParticipantData: r,
1760
1765
  CustomChannelEmptyState: u,
1761
- showChannelList: b = !0,
1762
- filters: h,
1763
- channelListCustomEmptyStateIndicator: _,
1764
- onDeleteConversationClick: x,
1765
- onBlockParticipantClick: g,
1766
- onReportParticipantClick: l,
1767
- dmAgentEnabled: y,
1768
- messageMetadata: E,
1766
+ showChannelList: g = !0,
1767
+ filters: x,
1768
+ channelListCustomEmptyStateIndicator: b,
1769
+ onDeleteConversationClick: f,
1770
+ onBlockParticipantClick: v,
1771
+ onReportParticipantClick: o,
1772
+ dmAgentEnabled: M,
1773
+ messageMetadata: S,
1769
1774
  onMessageSent: w,
1770
- showStarButton: p = !1,
1771
- chatbotVotingEnabled: f = !1,
1772
- renderMessagePreview: N,
1773
- renderChannelBanner: v
1775
+ showStarButton: E = !1,
1776
+ chatbotVotingEnabled: h = !1,
1777
+ renderMessagePreview: C,
1778
+ renderChannelBanner: p
1774
1779
  }) => {
1775
1780
  const {
1776
1781
  service: R,
1777
1782
  client: d,
1778
1783
  isConnected: m,
1779
- isLoading: C,
1780
- error: k,
1781
- refreshConnection: T,
1782
- debug: S
1783
- } = Gs(), [G, z] = M(null), [X, K] = M(!1), [Y, ee] = M(!1), [ne, J] = M(!1), [V, L] = M(/* @__PURE__ */ new Set()), [P, H] = M(0), [O, B] = M(!1), [le, Z] = M(null), se = W(null), {
1784
+ isLoading: N,
1785
+ error: U,
1786
+ refreshConnection: I,
1787
+ debug: y
1788
+ } = Gs(), [B, H] = k(null), [X, K] = k(!1), [Y, ee] = k(!1), [ne, J] = k(!1), [V, F] = k(/* @__PURE__ */ new Set()), [L, G] = k(0), [P, j] = k(!1), [oe, Z] = k(null), se = W(null), {
1784
1789
  participantSource: re,
1785
1790
  participantLabel: ae = "participants",
1786
1791
  showDeleteConversation: ze = !0
1787
- } = t, He = j.useMemo(() => {
1788
- const I = d == null ? void 0 : d.userID;
1792
+ } = t, He = A.useMemo(() => {
1793
+ const _ = d == null ? void 0 : d.userID;
1789
1794
  return {
1790
1795
  ...{
1791
1796
  type: "messaging",
1792
1797
  last_message_at: { $exists: !0 },
1793
- ...I && {
1794
- members: { $in: [I] },
1798
+ ..._ && {
1799
+ members: { $in: [_] },
1795
1800
  hidden: !1
1796
1801
  }
1797
1802
  },
1798
- ...h
1803
+ ...x
1799
1804
  };
1800
- }, [h, d == null ? void 0 : d.userID]), oe = W(null), te = F(async () => {
1805
+ }, [x, d == null ? void 0 : d.userID]), le = W(null), te = T(async () => {
1801
1806
  if (!d || !m) return;
1802
- const I = d.userID;
1803
- if (I)
1807
+ const _ = d.userID;
1808
+ if (_)
1804
1809
  try {
1805
- S && console.log("[MessagingShell] Syncing channels for user:", I);
1806
- const $ = await d.queryChannels(
1810
+ y && console.log("[MessagingShell] Syncing channels for user:", _);
1811
+ const z = await d.queryChannels(
1807
1812
  {
1808
1813
  type: "messaging",
1809
- members: { $in: [I] }
1814
+ members: { $in: [_] }
1810
1815
  },
1811
1816
  {},
1812
1817
  { limit: 100 }
1813
- ), U = /* @__PURE__ */ new Set();
1814
- $.forEach((A) => {
1815
- const ge = A.state.members;
1818
+ ), O = /* @__PURE__ */ new Set();
1819
+ z.forEach(($) => {
1820
+ const ge = $.state.members;
1816
1821
  Object.values(ge).forEach((Je) => {
1817
1822
  var Ee;
1818
1823
  const xe = (Ee = Je.user) == null ? void 0 : Ee.id;
1819
- xe && xe !== I && U.add(xe);
1824
+ xe && xe !== _ && O.add(xe);
1820
1825
  });
1821
- }), L((A) => A.size === U.size && [...A].every((ge) => U.has(ge)) ? A : U), K($.length > 0), ee(!0), oe.current = I, S && console.log("[MessagingShell] Channels synced successfully:", {
1822
- channelCount: $.length,
1823
- memberCount: U.size
1826
+ }), F(($) => $.size === O.size && [...$].every((ge) => O.has(ge)) ? $ : O), K(z.length > 0), ee(!0), le.current = _, y && console.log("[MessagingShell] Channels synced successfully:", {
1827
+ channelCount: z.length,
1828
+ memberCount: O.size
1824
1829
  });
1825
- } catch ($) {
1826
- console.error("[MessagingShell] Failed to sync channels:", $);
1830
+ } catch (z) {
1831
+ console.error("[MessagingShell] Failed to sync channels:", z);
1827
1832
  }
1828
- }, [d, m, S]);
1833
+ }, [d, m, y]);
1829
1834
  q(() => {
1830
1835
  if (!d || !m) return;
1831
- const I = d.userID;
1832
- I && oe.current !== I && te();
1836
+ const _ = d.userID;
1837
+ _ && le.current !== _ && te();
1833
1838
  }, [d, m, te]), q(() => {
1834
1839
  if (!c || !d || !m) return;
1835
1840
  (async () => {
1836
- const $ = d.userID;
1837
- if ($)
1841
+ const z = d.userID;
1842
+ if (z)
1838
1843
  try {
1839
- S && console.log(
1844
+ y && console.log(
1840
1845
  "[MessagingShell] Loading initial conversation with:",
1841
1846
  c
1842
1847
  );
1843
- const U = await d.queryChannels(
1848
+ const O = await d.queryChannels(
1844
1849
  {
1845
1850
  type: "messaging",
1846
- members: { $eq: [$, c] }
1851
+ members: { $eq: [z, c] }
1847
1852
  },
1848
1853
  {},
1849
1854
  { limit: 1 }
1850
1855
  );
1851
- if (U.length > 0)
1852
- z(U[0]), B(!0), Z(null), a && a(U[0]), S && console.log(
1856
+ if (O.length > 0)
1857
+ H(O[0]), j(!0), Z(null), a && a(O[0]), y && console.log(
1853
1858
  "[MessagingShell] Initial conversation loaded:",
1854
- U[0].id
1859
+ O[0].id
1855
1860
  );
1856
1861
  else if (r && R) {
1857
- S && console.log(
1862
+ y && console.log(
1858
1863
  "[MessagingShell] No conversation found, creating one for:",
1859
1864
  r
1860
1865
  );
1861
1866
  try {
1862
- const A = await R.startChannelWithParticipant({
1867
+ const $ = await R.startChannelWithParticipant({
1863
1868
  id: r.id,
1864
1869
  name: r.name,
1865
1870
  email: r.email,
1866
1871
  phone: r.phone
1867
1872
  });
1868
- z(A), B(!0), Z(null), a && a(A), S && console.log(
1873
+ H($), j(!0), Z(null), a && a($), y && console.log(
1869
1874
  "[MessagingShell] Channel created and loaded:",
1870
- A.id
1875
+ $.id
1871
1876
  );
1872
- } catch (A) {
1877
+ } catch ($) {
1873
1878
  console.error(
1874
1879
  "[MessagingShell] Failed to create conversation:",
1875
- A
1880
+ $
1876
1881
  ), Z("Failed to create conversation");
1877
1882
  }
1878
1883
  } else
1879
1884
  Z(
1880
1885
  "No conversation found with this account"
1881
- ), S && console.log(
1886
+ ), y && console.log(
1882
1887
  "[MessagingShell] No conversation found for:",
1883
1888
  c
1884
1889
  );
1885
- } catch (U) {
1890
+ } catch (O) {
1886
1891
  console.error(
1887
1892
  "[MessagingShell] Failed to load initial conversation:",
1888
- U
1893
+ O
1889
1894
  ), Z("Failed to load conversation");
1890
1895
  }
1891
1896
  })();
@@ -1895,68 +1900,68 @@ const Dt = ({
1895
1900
  d,
1896
1901
  m,
1897
1902
  R,
1898
- S,
1903
+ y,
1899
1904
  a
1900
1905
  ]);
1901
- const Ge = F(
1902
- (I) => {
1903
- z(I), a == null || a(I);
1906
+ const Ge = T(
1907
+ (_) => {
1908
+ H(_), a == null || a(_);
1904
1909
  },
1905
1910
  [a]
1906
- ), Ve = F(() => {
1907
- O || z(null);
1908
- }, [O]), We = F(
1909
- async (I) => {
1910
- var $;
1911
+ ), Ve = T(() => {
1912
+ P || H(null);
1913
+ }, [P]), We = T(
1914
+ async (_) => {
1915
+ var z;
1911
1916
  if (R)
1912
1917
  try {
1913
- S && console.log(
1918
+ y && console.log(
1914
1919
  "[MessagingShell] Starting conversation with:",
1915
- I.id
1920
+ _.id
1916
1921
  );
1917
- const U = await R.startChannelWithParticipant({
1918
- id: I.id,
1919
- name: I.name,
1920
- email: I.email,
1921
- phone: I.phone
1922
+ const O = await R.startChannelWithParticipant({
1923
+ id: _.id,
1924
+ name: _.name,
1925
+ email: _.email,
1926
+ phone: _.phone
1922
1927
  });
1923
1928
  try {
1924
- await U.show();
1925
- } catch (A) {
1926
- console.warn("[MessagingShell] Failed to unhide channel:", A);
1929
+ await O.show();
1930
+ } catch ($) {
1931
+ console.warn("[MessagingShell] Failed to unhide channel:", $);
1927
1932
  }
1928
- z(U), J(!1), ($ = se.current) == null || $.close(), o == null || o(I);
1929
- } catch (U) {
1930
- console.error("[MessagingShell] Failed to start conversation:", U);
1933
+ H(O), J(!1), (z = se.current) == null || z.close(), l == null || l(_);
1934
+ } catch (O) {
1935
+ console.error("[MessagingShell] Failed to start conversation:", O);
1931
1936
  }
1932
1937
  },
1933
- [R, o, S]
1934
- ), ie = F(() => {
1935
- var I;
1936
- J(!1), (I = se.current) == null || I.close();
1937
- }, []), qe = F(
1938
- (I) => {
1939
- I.target === se.current && ie();
1938
+ [R, l, y]
1939
+ ), ie = T(() => {
1940
+ var _;
1941
+ J(!1), (_ = se.current) == null || _.close();
1942
+ }, []), qe = T(
1943
+ (_) => {
1944
+ _.target === se.current && ie();
1940
1945
  },
1941
1946
  [ie]
1942
- ), Ze = F(
1943
- async (I) => {
1944
- S && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), B(!1), oe.current = null, await te();
1947
+ ), Ze = T(
1948
+ async (_) => {
1949
+ y && console.log("[MessagingShell] Leaving conversation:", _.id), H(null), j(!1), le.current = null, await te();
1945
1950
  },
1946
- [te, S]
1947
- ), Ye = F(
1948
- async (I) => {
1949
- S && console.log("[MessagingShell] Blocking participant:", I), z(null), B(!1), oe.current = null, await te();
1951
+ [te, y]
1952
+ ), Ye = T(
1953
+ async (_) => {
1954
+ y && console.log("[MessagingShell] Blocking participant:", _), H(null), j(!1), le.current = null, await te();
1950
1955
  },
1951
- [te, S]
1952
- ), ce = !!G;
1953
- return C ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : k ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: k, onBack: T }) }) : !m || !d ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
1956
+ [te, y]
1957
+ ), ce = !!B;
1958
+ return N ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : U ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: U, onBack: I }) }) : !m || !d ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
1954
1959
  me,
1955
1960
  {
1956
1961
  message: "Not connected to messaging service",
1957
- onBack: T
1962
+ onBack: I
1958
1963
  }
1959
- ) }) : le ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: le }) }) : /* @__PURE__ */ i(
1964
+ ) }) : oe ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: oe }) }) : /* @__PURE__ */ i(
1960
1965
  "div",
1961
1966
  {
1962
1967
  className: D(
@@ -1971,21 +1976,21 @@ const Dt = ({
1971
1976
  className: D(
1972
1977
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1973
1978
  {
1974
- "!hidden": b === !1 || O,
1979
+ "!hidden": g === !1 || P,
1975
1980
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1976
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": b !== !1 && !O && ce,
1981
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !P && ce,
1977
1982
  // Show on mobile when no channel selected, use same wide width on desktop
1978
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": b !== !1 && !O && !ce
1983
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !P && !ce
1979
1984
  }
1980
1985
  ),
1981
1986
  children: /* @__PURE__ */ e(
1982
1987
  Ue,
1983
1988
  {
1984
1989
  onChannelSelect: Ge,
1985
- selectedChannel: G || void 0,
1990
+ selectedChannel: B || void 0,
1986
1991
  filters: He,
1987
- customEmptyStateIndicator: _,
1988
- renderMessagePreview: N
1992
+ customEmptyStateIndicator: b,
1993
+ renderMessagePreview: C
1989
1994
  }
1990
1995
  )
1991
1996
  }
@@ -1997,33 +2002,33 @@ const Dt = ({
1997
2002
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1998
2003
  {
1999
2004
  // In direct conversation mode (or waiting for it), always show (full width)
2000
- flex: O || ce || c,
2005
+ flex: P || ce || c,
2001
2006
  // Normal mode: hide on mobile when no channel selected
2002
- "hidden lg:flex": !O && !ce && !c
2007
+ "hidden lg:flex": !P && !ce && !c
2003
2008
  }
2004
2009
  ),
2005
- children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2010
+ children: B ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2006
2011
  Ae,
2007
2012
  {
2008
- channel: G,
2013
+ channel: B,
2009
2014
  onBack: Ve,
2010
- showBackButton: !O,
2015
+ showBackButton: !P,
2011
2016
  renderMessageInputActions: n,
2012
- renderChannelBanner: v,
2017
+ renderChannelBanner: p,
2013
2018
  onLeaveConversation: Ze,
2014
2019
  onBlockParticipant: Ye,
2015
2020
  CustomChannelEmptyState: u,
2016
2021
  showDeleteConversation: ze,
2017
- onDeleteConversationClick: x,
2018
- onBlockParticipantClick: g,
2019
- onReportParticipantClick: l,
2020
- dmAgentEnabled: y,
2021
- messageMetadata: E,
2022
+ onDeleteConversationClick: f,
2023
+ onBlockParticipantClick: v,
2024
+ onReportParticipantClick: o,
2025
+ dmAgentEnabled: M,
2026
+ messageMetadata: S,
2022
2027
  onMessageSent: w,
2023
- showStarButton: p,
2024
- chatbotVotingEnabled: f
2028
+ showStarButton: E,
2029
+ chatbotVotingEnabled: h
2025
2030
  },
2026
- G.id
2031
+ B.id
2027
2032
  ) }) : c ? (
2028
2033
  // Show loading while creating/loading direct conversation channel
2029
2034
  /* @__PURE__ */ e(he, {})
@@ -2055,7 +2060,7 @@ const Dt = ({
2055
2060
  participantLabel: ae,
2056
2061
  searchPlaceholder: `Search ${ae}...`
2057
2062
  },
2058
- P
2063
+ L
2059
2064
  ) })
2060
2065
  }
2061
2066
  )
@@ -2089,12 +2094,12 @@ const Dt = ({
2089
2094
  onFaqClick: s,
2090
2095
  loadingFaqId: n,
2091
2096
  headerText: a,
2092
- className: o,
2097
+ className: l,
2093
2098
  avatarImage: c,
2094
2099
  avatarName: r
2095
2100
  }) => {
2096
- const u = t.filter((b) => b.enabled).sort((b, h) => (b.order ?? 0) - (h.order ?? 0));
2097
- return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2101
+ const u = t.filter((g) => g.enabled).sort((g, x) => (g.order ?? 0) - (x.order ?? 0));
2102
+ return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2098
2103
  (c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2099
2104
  Q,
2100
2105
  {
@@ -2112,58 +2117,58 @@ const Dt = ({
2112
2117
  style: { backgroundColor: "#F1F0EE" },
2113
2118
  children: [
2114
2119
  a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
2115
- u.map((b) => /* @__PURE__ */ e(
2120
+ u.map((g) => /* @__PURE__ */ e(
2116
2121
  pt,
2117
2122
  {
2118
- question: b.question,
2119
- onClick: () => s(b.id),
2120
- loading: n === b.id
2123
+ question: g.question,
2124
+ onClick: () => s(g.id),
2125
+ loading: n === g.id
2121
2126
  },
2122
- b.id
2127
+ g.id
2123
2128
  ))
2124
2129
  ]
2125
2130
  }
2126
2131
  )
2127
2132
  ] }) });
2128
2133
  }, Ft = (t, s = {}) => {
2129
- const { initialSearch: n = "", pageSize: a = 20 } = s, [o, c] = M([]), [r, u] = M(!1), [b, h] = M(null), [_, x] = M(n), [g, l] = M(!0), [y, E] = M(), w = F(async (v = !1, R) => {
2134
+ const { initialSearch: n = "", pageSize: a = 20 } = s, [l, c] = k([]), [r, u] = k(!1), [g, x] = k(null), [b, f] = k(n), [v, o] = k(!0), [M, S] = k(), w = T(async (p = !1, R) => {
2130
2135
  if (r) return;
2131
- const d = R !== void 0 ? R : _;
2132
- u(!0), h(null);
2136
+ const d = R !== void 0 ? R : b;
2137
+ u(!0), x(null);
2133
2138
  try {
2134
2139
  const m = await t.loadParticipants({
2135
2140
  search: d || void 0,
2136
2141
  limit: a,
2137
- cursor: v ? void 0 : y
2142
+ cursor: p ? void 0 : M
2138
2143
  });
2139
2144
  c(
2140
- (C) => v ? m.participants : [...C, ...m.participants]
2141
- ), l(m.hasMore), E(m.nextCursor);
2145
+ (N) => p ? m.participants : [...N, ...m.participants]
2146
+ ), o(m.hasMore), S(m.nextCursor);
2142
2147
  } catch (m) {
2143
- const C = m instanceof Error ? m.message : "Failed to load participants";
2144
- h(C), console.error("[useParticipants] Load error:", m);
2148
+ const N = m instanceof Error ? m.message : "Failed to load participants";
2149
+ x(N), console.error("[useParticipants] Load error:", m);
2145
2150
  } finally {
2146
2151
  u(!1);
2147
2152
  }
2148
- }, [t, _, y, a, r]), p = F(() => {
2149
- g && !r && w(!1);
2150
- }, [g, r, w]), f = F((v) => {
2151
- x(v), E(void 0), w(!0, v);
2152
- }, [w]), N = F(() => {
2153
- E(void 0), w(!0);
2153
+ }, [t, b, M, a, r]), E = T(() => {
2154
+ v && !r && w(!1);
2155
+ }, [v, r, w]), h = T((p) => {
2156
+ f(p), S(void 0), w(!0, p);
2157
+ }, [w]), C = T(() => {
2158
+ S(void 0), w(!0);
2154
2159
  }, [w]);
2155
2160
  return q(() => {
2156
2161
  w(!0);
2157
2162
  }, [t.loadParticipants]), {
2158
- participants: o,
2163
+ participants: l,
2159
2164
  loading: r,
2160
- error: b,
2161
- searchQuery: _,
2162
- hasMore: g,
2165
+ error: g,
2166
+ searchQuery: b,
2167
+ hasMore: v,
2163
2168
  totalCount: t.totalCount,
2164
- loadMore: p,
2165
- search: f,
2166
- refresh: N
2169
+ loadMore: E,
2170
+ search: h,
2171
+ refresh: C
2167
2172
  };
2168
2173
  };
2169
2174
  export {