@linktr.ee/messaging-react 1.21.0 โ†’ 1.21.2-rc-1771385662

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