@linktr.ee/messaging-react 1.21.1 → 1.21.2-rc-1771424513

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
2
- import D from "classnames";
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
- 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 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
- 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
- import { LinkPreviewsManager as Re } from "stream-chat";
8
- const Le = Qe({
2
+ import R from "classnames";
3
+ import j, { createContext as Xe, useContext as Ke, useCallback as L, useState as _, useRef as q, useEffect as Z, useMemo as be } from "react";
4
+ import { StreamChatService as es } from "@linktr.ee/messaging-core";
5
+ import { Chat as ss, ChannelList as ts, DateSeparator as ns, useChannelStateContext as we, useChatContext as Le, areMessageUIPropsEqual as rs, useMessageReminder as as, useComponentContext as os, Attachment as ls, EditMessageModal as is, MessageBlocked as cs, MessageBouncePrompt as ds, MessageDeleted as us, MessageIsThreadReplyInChannelButtonIndicator as ms, MessageRepliesCountButton as hs, ReminderNotification as fs, StreamedMessageText as gs, messageHasAttachments as xs, messageHasReactions as bs, isDateSeparatorMessage as Cs, isMessageBlocked as Ns, isMessageBounced as vs, MessageBounceModal as ws, Poll as ps, MessageText as ys, MessageErrorIcon as Es, useMessageContext as Is, useMessageComposer as _s, useStateStore as Ss, MessageInput as Ms, useMessageInputContext as ks, useMessageComposerHasSendableData as Rs, SimpleAttachmentSelector as Ds, QuotedMessagePreview as Ts, AttachmentPreviewList as Fs, TextareaComposer as Ls, MessageTimestamp as Ps, Channel as Os, WithComponents as Us, Window as Bs, MessageList as js } from "stream-chat-react";
6
+ import { GiftIcon as As, XIcon as pe, ArrowUpIcon as $s, ArrowLeftIcon as _e, StarIcon as Se, DotsThreeIcon as Me, SpinnerGapIcon as ue, SignOutIcon as zs, ProhibitInsetIcon as ke, FlagIcon as Hs, MagnifyingGlassIcon as Gs, ChatCircleDotsIcon as Re } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as De } from "stream-chat";
8
+ const Pe = Xe({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,229 +15,229 @@ const Le = Qe({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), fe = () => Xe(Le), Rt = ({
18
+ }), fe = () => Ke(Pe), Dt = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
- apiKey: a,
22
+ apiKey: o,
23
23
  capabilities: l = {},
24
- debug: c = !1
24
+ debug: d = !1
25
25
  }) => {
26
- const r = T(
27
- (m, ...N) => {
28
- c && console.log(`🔥 [MessagingProvider] ${m}`, ...N);
26
+ const a = L(
27
+ (c, ...x) => {
28
+ d && console.log(`🔥 [MessagingProvider] ${c}`, ...x);
29
29
  },
30
- [c]
30
+ [d]
31
31
  );
32
- r("🔄 RENDER START", {
32
+ a("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
34
+ apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
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({
38
+ const [u, f] = _(null), [g, N] = _(null), [C, p] = _(!1), [r, E] = _(!1), [S, v] = _(null), k = q(!1), b = q({
39
39
  userId: s == null ? void 0 : s.id,
40
- apiKey: a,
40
+ apiKey: o,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), C = W(0);
44
- C.current++, r("📊 RENDER INFO", {
45
- renderCount: C.current,
46
- currentProps: { userId: s == null ? void 0 : s.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
43
+ }), m = q(0);
44
+ m.current++, a("📊 RENDER INFO", {
45
+ renderCount: m.current,
46
+ currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
47
47
  propChanges: {
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
48
+ userChanged: b.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: b.current.apiKey !== o,
50
+ serviceConfigChanged: b.current.serviceConfig !== n,
51
+ capabilitiesChanged: b.current.capabilities !== l
52
52
  }
53
- }), h.current = {
53
+ }), b.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
- apiKey: a,
55
+ apiKey: o,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
- }, q(() => {
59
- const m = C.current;
60
- if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: m,
62
- apiKey: !!a,
58
+ }, Z(() => {
59
+ const c = m.current;
60
+ if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
+ renderCount: c,
62
+ apiKey: !!o,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
65
+ apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: h.current.serviceConfig === n,
68
- apiKeyStable: h.current.apiKey === a
67
+ serviceConfigStable: b.current.serviceConfig === n,
68
+ apiKeyStable: b.current.apiKey === o
69
69
  }
70
- }), !a || !n) {
71
- r("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: m,
70
+ }), !o || !n) {
71
+ a("⚠️ SERVICE INIT SKIPPED", {
72
+ renderCount: c,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
- r("🚀 CREATING NEW SERVICE", {
78
- renderCount: m,
79
- apiKey: (a == null ? void 0 : a.substring(0, 8)) + "...",
80
- serviceConfigChanged: h.current.serviceConfig !== n
77
+ a("🚀 CREATING NEW SERVICE", {
78
+ renderCount: c,
79
+ apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
+ serviceConfigChanged: b.current.serviceConfig !== n
81
81
  });
82
- const N = new Ke({
82
+ const x = new es({
83
83
  ...n,
84
- apiKey: a,
85
- debug: c
84
+ apiKey: o,
85
+ debug: d
86
86
  });
87
- return g(N), r("✅ SERVICE SET", {
88
- renderCount: m,
89
- serviceInstance: !!N
87
+ return f(x), a("✅ SERVICE SET", {
88
+ renderCount: c,
89
+ serviceInstance: !!x
90
90
  }), () => {
91
- r("🧹 SERVICE CLEANUP", {
92
- renderCount: m,
91
+ a("🧹 SERVICE CLEANUP", {
92
+ renderCount: c,
93
93
  reason: "Effect cleanup"
94
- }), N.disconnectUser().catch(console.error);
94
+ }), x.disconnectUser().catch(console.error);
95
95
  };
96
- }, [a, n, c, r]);
97
- const p = W(null);
98
- q(() => {
99
- var N, U;
100
- if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
96
+ }, [o, n, d, a]);
97
+ const w = q(null);
98
+ Z(() => {
99
+ var x, B;
100
+ if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!u,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: E.current,
105
- isConnected: f,
104
+ isConnecting: k.current,
105
+ isConnected: C,
106
106
  dependencies: { service: !!u, userId: s == null ? void 0 : s.id }
107
107
  }), !u || !s) {
108
- r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
108
+ a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (E.current) {
112
- r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
111
+ if (k.current) {
112
+ a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((N = p.current) == null ? void 0 : N.serviceId) === u && ((U = p.current) == null ? void 0 : U.userId) === s.id) {
116
- r(
115
+ if (((x = w.current) == null ? void 0 : x.serviceId) === u && ((B = w.current) == null ? void 0 : B.userId) === s.id) {
116
+ a(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
119
119
  );
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- r("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, M(!0), w(null);
123
+ a("🚀 STARTING USER CONNECTION", { userId: s.id }), k.current = !0, E(!0), v(null);
124
124
  try {
125
- r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
125
+ a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
126
  const I = await u.connectUser(s);
127
- b(I), v(!0), p.current = { serviceId: u, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
127
+ N(I), p(!0), w.current = { serviceId: u, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: I.userID
130
130
  });
131
131
  } catch (I) {
132
- const y = I instanceof Error ? I.message : "Connection failed";
133
- w(y), r("❌ USER CONNECTION ERROR", {
132
+ const T = I instanceof Error ? I.message : "Connection failed";
133
+ v(T), a("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: y
135
+ error: T
136
136
  });
137
137
  } finally {
138
- M(!1), E.current = !1, r("🔄 USER CONNECTION FINISHED", {
138
+ E(!1), k.current = !1, a("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: f
140
+ isConnected: C
141
141
  });
142
142
  }
143
143
  })();
144
- }, [u, s, r, f]), q(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
144
+ }, [u, s, a, C]), Z(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!u,
146
- isConnected: f
146
+ isConnected: C
147
147
  }), () => {
148
- u && f ? (r(
148
+ u && C ? (a(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), p.current = null, u.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
151
+ ), w.current = null, u.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!u,
153
- isConnected: f
153
+ isConnected: C
154
154
  });
155
- }), [u, f, r]);
156
- const R = T(async () => {
157
- if (r("🔄 REFRESH CONNECTION CALLED", {
155
+ }), [u, C, a]);
156
+ const D = L(async () => {
157
+ if (a("🔄 REFRESH CONNECTION CALLED", {
158
158
  hasService: !!u,
159
159
  hasUser: !!s
160
160
  }), !u || !s) {
161
- r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
161
+ a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), M(!0);
164
+ a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), E(!0);
165
165
  try {
166
- r("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
167
- const m = await u.connectUser(s);
168
- b(m), v(!0), w(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (m) {
170
- const N = m instanceof Error ? m.message : "Refresh failed";
171
- w(N), r("❌ CONNECTION REFRESH ERROR", {
166
+ a("🔌 DISCONNECTING FOR REFRESH"), await u.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
+ const c = await u.connectUser(s);
168
+ N(c), p(!0), v(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (c) {
170
+ const x = c instanceof Error ? c.message : "Refresh failed";
171
+ v(x), a("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: N
173
+ error: x
174
174
  });
175
175
  } finally {
176
- M(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ E(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [u, s, r]), d = A.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [u, s, a]), h = j.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!u,
180
- hasClient: !!x,
181
- isConnected: f,
182
- isLoading: o,
180
+ hasClient: !!g,
181
+ isConnected: C,
182
+ isLoading: r,
183
183
  hasError: !!S,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: u,
187
- client: x,
188
- isConnected: f,
189
- isLoading: o,
187
+ client: g,
188
+ isConnected: C,
189
+ isLoading: r,
190
190
  error: S,
191
191
  capabilities: l,
192
- refreshConnection: R,
193
- debug: c
192
+ refreshConnection: D,
193
+ debug: d
194
194
  }), [
195
195
  u,
196
- x,
197
- f,
198
- o,
196
+ g,
197
+ C,
198
+ r,
199
199
  S,
200
200
  l,
201
- R,
202
- c,
203
- r
201
+ D,
202
+ d,
203
+ a
204
204
  ]);
205
- return r("🔄 RENDER END", {
206
- renderCount: C.current,
207
- willRenderChat: !!(x && f),
208
- contextValueReady: !!d
209
- }), /* @__PURE__ */ e(Le.Provider, { value: d, children: x && f ? /* @__PURE__ */ e(
210
- es,
205
+ return a("🔄 RENDER END", {
206
+ renderCount: m.current,
207
+ willRenderChat: !!(g && C),
208
+ contextValueReady: !!h
209
+ }), /* @__PURE__ */ e(Pe.Provider, { value: h, children: g && C ? /* @__PURE__ */ e(
210
+ ss,
211
211
  {
212
- client: x,
212
+ client: g,
213
213
  customClasses: {
214
214
  channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
215
  },
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, Gs = () => fe(), Vs = (t, s) => {
219
+ }, Vs = () => fe(), Ws = (t, s) => {
220
220
  const n = new Date(
221
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
222
222
  ), l = new Date(
223
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
224
224
  ).getTime() - n.getTime();
225
225
  return Math.floor(l / (1e3 * 60 * 60 * 24));
226
- }, Ws = (t) => {
226
+ }, qs = (t) => {
227
227
  const s = /* @__PURE__ */ new Date();
228
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
229
229
  return "Just now";
230
- const a = Vs(t, s);
231
- return a === 0 ? t.toLocaleTimeString([], {
230
+ const o = Ws(t, s);
231
+ return o === 0 ? t.toLocaleTimeString([], {
232
232
  hour: "numeric",
233
233
  minute: "2-digit",
234
234
  hour12: !0
235
- }) : a === 1 ? "Yesterday" : a < 7 ? `${a}d` : a < 28 ? `${Math.floor(a / 7)}w` : t.toLocaleDateString("en-US", {
235
+ }) : o === 1 ? "Yesterday" : o < 7 ? `${o}d` : o < 28 ? `${Math.floor(o / 7)}w` : t.toLocaleDateString("en-US", {
236
236
  month: "numeric",
237
237
  day: "numeric",
238
238
  year: "2-digit"
239
239
  });
240
- }, De = [
240
+ }, Te = [
241
241
  "🍎",
242
242
  // Apple
243
243
  "🍌",
@@ -265,37 +265,37 @@ const Le = Qe({
265
265
  "🍈"
266
266
  // Melon
267
267
  ];
268
- function qs(t) {
268
+ function Zs(t) {
269
269
  let s = 0;
270
270
  for (let n = 0; n < t.length; n++) {
271
- const a = t.charCodeAt(n);
272
- s = (s << 5) - s + a, s = s & s;
271
+ const o = t.charCodeAt(n);
272
+ s = (s << 5) - s + o, s = s & s;
273
273
  }
274
274
  return Math.abs(s);
275
275
  }
276
- function Zs(t) {
277
- const n = qs(t) % De.length;
278
- return De[n];
276
+ function Ys(t) {
277
+ const n = Zs(t) % Te.length;
278
+ return Te[n];
279
279
  }
280
- const Q = ({
280
+ const K = ({
281
281
  id: t,
282
282
  image: s,
283
283
  size: n = 40,
284
- className: a,
284
+ className: o,
285
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", g = l === "circle" ? { borderRadius: "50%" } : {
287
+ const d = Ys(t), u = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", f = l === "circle" ? { borderRadius: "50%" } : {
288
288
  borderRadius: "33%",
289
289
  "corner-shape": "superellipse(1.3)"
290
290
  };
291
291
  return /* @__PURE__ */ e(
292
292
  "div",
293
293
  {
294
- className: D("flex-shrink-0 overflow-hidden", a),
294
+ className: R("flex-shrink-0 overflow-hidden", o),
295
295
  style: {
296
296
  width: `${n}px`,
297
297
  height: `${n}px`,
298
- ...g
298
+ ...f
299
299
  },
300
300
  children: s ? /* @__PURE__ */ e(
301
301
  "img",
@@ -308,107 +308,107 @@ const Q = ({
308
308
  "div",
309
309
  {
310
310
  "aria-hidden": "true",
311
- className: D(
311
+ className: R(
312
312
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
313
313
  u
314
314
  ),
315
- children: c
315
+ children: d
316
316
  }
317
317
  )
318
318
  }
319
319
  );
320
- }, Ys = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
320
+ }, Js = () => /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ e(
321
321
  "path",
322
322
  {
323
323
  d: "M10.003 5a.705.705 0 0 1-.469.67L6.7 6.7 5.67 9.535a.715.715 0 0 1-1.34 0L3.3 6.7.466 5.67a.715.715 0 0 1 0-1.34L3.3 3.3 4.33.466a.715.715 0 0 1 1.34 0L6.7 3.3l2.834 1.03a.705.705 0 0 1 .469.67",
324
324
  fill: "currentColor"
325
325
  }
326
- ) }), Js = (t) => {
326
+ ) }), Qs = (t) => {
327
327
  var s;
328
328
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
329
- }, Qs = (t) => {
329
+ }, Xs = (t) => {
330
330
  var s;
331
331
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
332
332
  }, ye = (t) => {
333
333
  var s;
334
334
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
335
- }, Pe = (t) => Js(t) || Qs(t), Xs = (t) => {
335
+ }, Oe = (t) => Qs(t) || Xs(t), Ks = (t) => {
336
336
  var s;
337
- return Pe(t) && !((s = t.text) != null && s.trim());
338
- }, Te = ({
337
+ return Oe(t) && !((s = t.text) != null && s.trim());
338
+ }, Fe = ({
339
339
  message: t,
340
340
  standalone: s = !1
341
341
  }) => {
342
342
  var l;
343
- const n = Pe(t), a = ye(t);
344
- if (!n && !a)
343
+ const n = Oe(t), o = ye(t);
344
+ if (!n && !o)
345
345
  return null;
346
346
  if (n) {
347
- const c = (l = t.metadata) == null ? void 0 : l.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`;
350
- return /* @__PURE__ */ i("div", { className: r, children: [
351
- /* @__PURE__ */ e(js, { size: s ? 14 : 12 }),
347
+ const d = (l = t.metadata) == null ? void 0 : l.amount_text;
348
+ if (!d) return null;
349
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = s ? `${d} tip` : `Delivered with ${d} tip`;
350
+ return /* @__PURE__ */ i("div", { className: a, children: [
351
+ /* @__PURE__ */ e(As, { size: s ? 14 : 12 }),
352
352
  /* @__PURE__ */ e("span", { children: u })
353
353
  ] });
354
354
  }
355
355
  return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
356
- /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Ys, {}) }),
356
+ /* @__PURE__ */ e("span", { className: "message-tag__icon", style: { marginTop: -1 }, children: /* @__PURE__ */ e(Js, {}) }),
357
357
  /* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
358
358
  ] });
359
- }, Oe = A.memo(
359
+ }, Ue = j.memo(
360
360
  ({
361
361
  channel: t,
362
362
  selectedChannel: s,
363
363
  onChannelSelect: n,
364
- debug: a = !1,
364
+ debug: o = !1,
365
365
  unread: l,
366
- renderMessagePreview: c
366
+ renderMessagePreview: d
367
367
  }) => {
368
- var p, R, d, m, N, U;
369
- const r = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
368
+ var w, D, h, c, x, B;
369
+ const a = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), u = () => {
370
370
  t && n(t);
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(
371
+ }, f = (I) => {
372
+ const T = I.key === "Enter" || I.key === " ", M = I.repeat;
373
+ !T || M || (I.preventDefault(), u());
374
+ }, N = Object.values(((w = t == null ? void 0 : t.state) == null ? void 0 : w.members) || {}).find(
375
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);
376
+ var T, M;
377
+ return ((T = I.user) == null ? void 0 : T.id) && I.user.id !== ((M = t == null ? void 0 : t._client) == null ? void 0 : M.userID);
378
378
  }
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];
379
+ ), C = ((D = N == null ? void 0 : N.user) == null ? void 0 : D.name) || "Conversation", p = (h = N == null ? void 0 : N.user) == null ? void 0 : h.image, r = (x = (c = t == null ? void 0 : t.state) == null ? void 0 : c.messages) == null ? void 0 : x[t.state.messages.length - 1], S = (() => {
380
+ var T;
381
+ if (r != null && r.text) return r.text;
382
+ const I = (T = r == null ? void 0 : r.attachments) == null ? void 0 : T[0];
383
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;
385
- return a && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
384
+ })(), v = r != null && r.created_at ? qs(new Date(r.created_at)) : "", k = r ? ye(r) : !1, b = d ? d(r, S) : `${k ? "✨ " : ""}${S}`, m = l ?? 0;
385
+ return o && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
386
386
  channelId: t == null ? void 0 : t.id,
387
- isSelected: r,
388
- participantName: f,
389
- unreadCount: C,
390
- hasTimestamp: !!w
387
+ isSelected: a,
388
+ participantName: C,
389
+ unreadCount: m,
390
+ hasTimestamp: !!v
391
391
  }), /* @__PURE__ */ e(
392
392
  "div",
393
393
  {
394
394
  role: "button",
395
395
  tabIndex: 0,
396
396
  onClick: u,
397
- onKeyDown: g,
398
- className: D(
397
+ onKeyDown: f,
398
+ className: R(
399
399
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
400
400
  {
401
- "bg-primary-alt/10 border-l-4 border-l-primary": r,
402
- "hover:bg-sand": !r
401
+ "bg-primary-alt/10 border-l-4 border-l-primary": a,
402
+ "hover:bg-sand": !a
403
403
  }
404
404
  ),
405
405
  children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
406
406
  /* @__PURE__ */ e(
407
- Q,
407
+ K,
408
408
  {
409
- id: ((U = b == null ? void 0 : b.user) == null ? void 0 : U.id) || t.id || "unknown",
410
- name: f,
411
- image: v,
409
+ id: ((B = N == null ? void 0 : N.user) == null ? void 0 : B.id) || t.id || "unknown",
410
+ name: C,
411
+ image: p,
412
412
  size: 44,
413
413
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
414
414
  }
@@ -418,18 +418,18 @@ const Q = ({
418
418
  /* @__PURE__ */ e(
419
419
  "h3",
420
420
  {
421
- className: D(
421
+ className: R(
422
422
  "text-sm font-medium truncate",
423
- r ? "text-primary" : "text-charcoal"
423
+ a ? "text-primary" : "text-charcoal"
424
424
  ),
425
- children: f
425
+ children: C
426
426
  }
427
427
  ),
428
- w && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: w })
428
+ v && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: v })
429
429
  ] }),
430
430
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
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 })
431
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: b }),
432
+ m > 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: m > 99 ? "99+" : m })
433
433
  ] })
434
434
  ] })
435
435
  ] })
@@ -437,48 +437,48 @@ const Q = ({
437
437
  );
438
438
  }
439
439
  );
440
- Oe.displayName = "CustomChannelPreview";
441
- const Ue = A.memo(
440
+ Ue.displayName = "CustomChannelPreview";
441
+ const Be = j.memo(
442
442
  ({
443
443
  onChannelSelect: t,
444
444
  selectedChannel: s,
445
445
  filters: n,
446
- className: a,
446
+ className: o,
447
447
  customEmptyStateIndicator: l,
448
- renderMessagePreview: c
448
+ renderMessagePreview: d
449
449
  }) => {
450
- const r = A.useRef(0);
451
- r.current++;
450
+ const a = j.useRef(0);
451
+ a.current++;
452
452
  const { debug: u = !1 } = fe();
453
453
  u && console.log("📺 [ChannelList] 🔄 RENDER START", {
454
- renderCount: r.current,
454
+ renderCount: a.current,
455
455
  selectedChannelId: s == null ? void 0 : s.id,
456
456
  filters: n
457
457
  });
458
- const g = A.useMemo(() => (b) => /* @__PURE__ */ e(
459
- Oe,
458
+ const f = j.useMemo(() => (N) => /* @__PURE__ */ e(
459
+ Ue,
460
460
  {
461
- ...b,
461
+ ...N,
462
462
  selectedChannel: s,
463
463
  onChannelSelect: t,
464
464
  debug: u,
465
- renderMessagePreview: c
465
+ renderMessagePreview: d
466
466
  }
467
- ), [s, t, u, c]);
467
+ ), [s, t, u, d]);
468
468
  return /* @__PURE__ */ e(
469
469
  "div",
470
470
  {
471
- className: D(
471
+ className: R(
472
472
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
473
- a
473
+ o
474
474
  ),
475
475
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
476
- ss,
476
+ ts,
477
477
  {
478
478
  filters: n,
479
479
  sort: { last_message_at: -1 },
480
480
  options: { limit: 30 },
481
- Preview: g,
481
+ Preview: f,
482
482
  EmptyStateIndicator: l
483
483
  },
484
484
  JSON.stringify(n)
@@ -487,39 +487,39 @@ const Ue = A.memo(
487
487
  );
488
488
  }
489
489
  );
490
- Ue.displayName = "ChannelList";
490
+ Be.displayName = "ChannelList";
491
491
  const de = ({
492
492
  variant: t = "default",
493
493
  className: s,
494
494
  children: n,
495
- ...a
495
+ ...o
496
496
  }) => /* @__PURE__ */ e(
497
497
  "button",
498
498
  {
499
499
  type: "button",
500
- className: D(
500
+ className: R(
501
501
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
502
502
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
503
503
  s
504
504
  ),
505
- ...a,
505
+ ...o,
506
506
  children: n
507
507
  }
508
508
  );
509
- function Be({ label: t, className: s, children: n, ...a }) {
509
+ function je({ label: t, className: s, children: n, ...o }) {
510
510
  return /* @__PURE__ */ i(
511
511
  "button",
512
512
  {
513
513
  type: "button",
514
- className: D(
514
+ className: R(
515
515
  "rounded-full p-2 transition-colors focus-ring",
516
516
  {
517
- "cursor-not-allowed opacity-50": a.disabled,
518
- "hover:bg-sand": !a.disabled
517
+ "cursor-not-allowed opacity-50": o.disabled,
518
+ "hover:bg-sand": !o.disabled
519
519
  },
520
520
  s
521
521
  ),
522
- ...a,
522
+ ...o,
523
523
  children: [
524
524
  /* @__PURE__ */ e("span", { className: "sr-only", children: t }),
525
525
  n
@@ -527,41 +527,41 @@ function Be({ label: t, className: s, children: n, ...a }) {
527
527
  }
528
528
  );
529
529
  }
530
- function je({ onClick: t }) {
531
- return /* @__PURE__ */ e(Be, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
530
+ function Ae({ onClick: t }) {
531
+ return /* @__PURE__ */ e(je, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 text-stone", weight: "bold" }) });
532
532
  }
533
- const Ks = (t) => /* @__PURE__ */ e(ts, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
534
- function et(t) {
533
+ const et = (t) => /* @__PURE__ */ e(ns, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
534
+ function st(t) {
535
535
  return t != null && t.length ? t.some((s) => s.type === Ne) ? "down" : t.some((s) => s.type === Ce) ? "up" : null : null;
536
536
  }
537
- function st(t) {
538
- const { channel: s } = we(), { client: n } = Fe("useMessageVote"), a = be(
539
- () => et(t.own_reactions),
537
+ function tt(t) {
538
+ const { channel: s } = we(), { client: n } = Le("useMessageVote"), o = be(
539
+ () => st(t.own_reactions),
540
540
  [t.own_reactions]
541
- ), l = T(async () => {
541
+ ), l = L(async () => {
542
542
  if (n != null && n.userID)
543
543
  try {
544
- a === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
544
+ o === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
545
545
  t.id,
546
546
  { type: Ce },
547
547
  { enforce_unique: !0, skip_push: !0 }
548
548
  );
549
549
  } catch {
550
550
  }
551
- }, [s, n == null ? void 0 : n.userID, t.id, a]), c = T(async () => {
551
+ }, [s, n == null ? void 0 : n.userID, t.id, o]), d = L(async () => {
552
552
  if (n != null && n.userID)
553
553
  try {
554
- a === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
554
+ o === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
555
555
  t.id,
556
556
  { type: Ne },
557
557
  { enforce_unique: !0, skip_push: !0 }
558
558
  );
559
559
  } catch {
560
560
  }
561
- }, [s, n == null ? void 0 : n.userID, t.id, a]);
562
- return { selected: a, voteUp: l, voteDown: c };
561
+ }, [s, n == null ? void 0 : n.userID, t.id, o]);
562
+ return { selected: o, voteUp: l, voteDown: d };
563
563
  }
564
- const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
564
+ const nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
565
565
  "path",
566
566
  {
567
567
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -571,7 +571,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
571
571
  strokeLinejoin: "round",
572
572
  fill: t ? "currentColor" : "none"
573
573
  }
574
- ) }), nt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
574
+ ) }), rt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
575
575
  "path",
576
576
  {
577
577
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -581,7 +581,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
581
581
  strokeLinejoin: "round",
582
582
  fill: t ? "currentColor" : "none"
583
583
  }
584
- ) }), rt = ({
584
+ ) }), at = ({
585
585
  selected: t,
586
586
  onVoteUp: s,
587
587
  onVoteDown: n
@@ -594,7 +594,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
594
594
  onClick: s,
595
595
  "aria-label": "Helpful",
596
596
  "aria-pressed": t === "up",
597
- children: /* @__PURE__ */ e(tt, { filled: t === "up" })
597
+ children: /* @__PURE__ */ e(nt, { filled: t === "up" })
598
598
  }
599
599
  ),
600
600
  /* @__PURE__ */ e(
@@ -605,175 +605,175 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
605
605
  onClick: n,
606
606
  "aria-label": "Not helpful",
607
607
  "aria-pressed": t === "down",
608
- children: /* @__PURE__ */ e(nt, { filled: t === "down" })
608
+ children: /* @__PURE__ */ e(rt, { filled: t === "down" })
609
609
  }
610
610
  )
611
- ] }), at = (t) => {
612
- var re, ae;
611
+ ] }), ot = (t) => {
612
+ var X, oe;
613
613
  const {
614
614
  additionalMessageInputProps: s,
615
615
  chatbotVotingEnabled: n,
616
- editing: a,
616
+ editing: o,
617
617
  endOfGroup: l,
618
- firstOfGroup: c,
619
- groupedByUser: r,
618
+ firstOfGroup: d,
619
+ groupedByUser: a,
620
620
  handleAction: u,
621
- handleOpenThread: g,
622
- handleRetry: x,
623
- highlighted: b,
624
- isMessageAIGenerated: f,
625
- isMyMessage: v,
626
- message: o,
627
- renderText: M,
621
+ handleOpenThread: f,
622
+ handleRetry: g,
623
+ highlighted: N,
624
+ isMessageAIGenerated: C,
625
+ isMyMessage: p,
626
+ message: r,
627
+ renderText: E,
628
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,
637
- ReminderNotification: X = hs,
638
- StreamedMessageText: K = fs,
629
+ } = t, { client: v } = Le("CustomMessage"), [k, b] = _(!1), m = as(r.id), { selected: w, voteUp: D, voteDown: h } = tt(r), {
630
+ Attachment: c = ls,
631
+ EditMessageModal: x = is,
632
+ MessageBlocked: B = cs,
633
+ MessageBouncePrompt: I = ds,
634
+ MessageDeleted: T = us,
635
+ MessageIsThreadReplyInChannelButtonIndicator: M = ms,
636
+ MessageRepliesCountButton: G = hs,
637
+ ReminderNotification: z = fs,
638
+ StreamedMessageText: ee = gs,
639
639
  PinIndicator: Y
640
- } = as("CustomMessage"), ee = gs(o), ne = xs(o), J = be(
641
- () => f == null ? void 0 : f(o),
642
- [f, o]
640
+ } = os("CustomMessage"), se = xs(r), te = bs(r), re = be(
641
+ () => C == null ? void 0 : C(r),
642
+ [C, r]
643
643
  ), V = be(
644
- () => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
645
- [o]
644
+ () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
645
+ [r]
646
646
  );
647
- if (bs(o))
647
+ if (Cs(r))
648
648
  return null;
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(
649
+ if (r.deleted_at || r.type === "deleted")
650
+ return /* @__PURE__ */ e(T, { message: r });
651
+ if (Ns(r))
652
+ return /* @__PURE__ */ e(B, {});
653
+ const J = !S && !!r.reply_count, P = !S && r.show_in_channel && r.parent_id, O = r.status === "failed" && ((X = r.error) == null ? void 0 : X.status) !== 403, H = vs(r);
654
+ let F;
655
+ O ? F = () => g(r) : H && (F = () => b(!0));
656
+ const W = R(
657
657
  "str-chat__message str-chat__message-simple",
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",
658
+ `str-chat__message--${r.type}`,
659
+ `str-chat__message--${r.status}`,
660
+ p() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
661
+ r.text ? "str-chat__message--has-text" : "has-no-text",
662
662
  {
663
- "str-chat__message--has-attachment": ee,
664
- "str-chat__message--highlighted": b,
665
- "str-chat__message--pinned pinned-message": o.pinned,
666
- "str-chat__message--with-reactions": ne,
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,
663
+ "str-chat__message--has-attachment": se,
664
+ "str-chat__message--highlighted": N,
665
+ "str-chat__message--pinned pinned-message": r.pinned,
666
+ "str-chat__message--with-reactions": te,
667
+ "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((oe = r == null ? void 0 : r.error) == null ? void 0 : oe.status) !== 403,
668
+ "str-chat__message-with-thread-link": J || P,
669
669
  "str-chat__virtual-message__wrapper--end": l,
670
- "str-chat__virtual-message__wrapper--first": c,
671
- "str-chat__virtual-message__wrapper--group": r
670
+ "str-chat__virtual-message__wrapper--first": d,
671
+ "str-chat__virtual-message__wrapper--group": a
672
672
  }
673
- ), Z = o.poll_id && w.polls.fromState(o.poll_id), se = Xs(o);
673
+ ), ae = r.poll_id && v.polls.fromState(r.poll_id), Q = Ks(r);
674
674
  return /* @__PURE__ */ i(ve, { children: [
675
- a && /* @__PURE__ */ e(
676
- N,
675
+ o && /* @__PURE__ */ e(
676
+ x,
677
677
  {
678
678
  additionalMessageInputProps: s
679
679
  }
680
680
  ),
681
- E && /* @__PURE__ */ e(
682
- vs,
681
+ k && /* @__PURE__ */ e(
682
+ ws,
683
683
  {
684
684
  MessageBouncePrompt: I,
685
- onClose: () => h(!1),
686
- open: E
685
+ onClose: () => b(!1),
686
+ open: k
687
687
  }
688
688
  ),
689
- /* @__PURE__ */ i("div", { className: oe, children: [
689
+ /* @__PURE__ */ i("div", { className: W, children: [
690
690
  Y && /* @__PURE__ */ e(Y, {}),
691
- !!C && /* @__PURE__ */ e(X, { reminder: C }),
692
- o.user && /* @__PURE__ */ e(
693
- Q,
691
+ !!m && /* @__PURE__ */ e(z, { reminder: m }),
692
+ r.user && /* @__PURE__ */ e(
693
+ K,
694
694
  {
695
695
  className: "str-chat__avatar str-chat__message-sender-avatar",
696
- id: o.user.id,
697
- image: o.user.image,
698
- name: o.user.name || o.user.id
696
+ id: r.user.id,
697
+ image: r.user.image,
698
+ name: r.user.name || r.user.id
699
699
  }
700
700
  ),
701
701
  /* @__PURE__ */ e(
702
702
  "div",
703
703
  {
704
- className: D("str-chat__message-inner", {
705
- "str-chat__simple-message--error-failed": G || P
704
+ className: R("str-chat__message-inner", {
705
+ "str-chat__simple-message--error-failed": O || H
706
706
  }),
707
707
  "data-testid": "message-inner",
708
- onClick: j,
709
- onKeyDown: j,
710
- role: j ? "button" : void 0,
711
- tabIndex: j ? 0 : void 0,
708
+ onClick: F,
709
+ onKeyDown: F,
710
+ role: F ? "button" : void 0,
711
+ tabIndex: F ? 0 : void 0,
712
712
  style: {
713
713
  // Force margins to 0 to prevent hover layout shift
714
714
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
715
715
  marginInlineEnd: 0,
716
716
  marginInlineStart: 0
717
717
  },
718
- children: se ? (
718
+ children: Q ? (
719
719
  /* Tip-only messages render as a standalone bubble */
720
- /* @__PURE__ */ e(Te, { message: o, standalone: !0 })
720
+ /* @__PURE__ */ e(Fe, { message: r, standalone: !0 })
721
721
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
722
722
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
723
- Z && /* @__PURE__ */ e(ws, { poll: Z }),
724
- V != null && V.length && !o.quoted_message ? /* @__PURE__ */ e(
725
- m,
723
+ ae && /* @__PURE__ */ e(ps, { poll: ae }),
724
+ V != null && V.length && !r.quoted_message ? /* @__PURE__ */ e(
725
+ c,
726
726
  {
727
727
  actionHandler: u,
728
728
  attachments: V
729
729
  }
730
730
  ) : null,
731
- J ? /* @__PURE__ */ e(
732
- K,
731
+ re ? /* @__PURE__ */ e(
732
+ ee,
733
733
  {
734
- message: o,
735
- renderText: M
734
+ message: r,
735
+ renderText: E
736
736
  }
737
- ) : /* @__PURE__ */ e(ps, { message: o, renderText: M }),
738
- /* @__PURE__ */ e(ys, {})
737
+ ) : /* @__PURE__ */ e(ys, { message: r, renderText: E }),
738
+ /* @__PURE__ */ e(Es, {})
739
739
  ] }),
740
- /* @__PURE__ */ e(Te, { message: o }),
741
- n && ye(o) && /* @__PURE__ */ e(
742
- rt,
740
+ /* @__PURE__ */ e(Fe, { message: r }),
741
+ n && ye(r) && /* @__PURE__ */ e(
742
+ at,
743
743
  {
744
- selected: p,
745
- onVoteUp: R,
746
- onVoteDown: d
744
+ selected: w,
745
+ onVoteUp: D,
746
+ onVoteDown: h
747
747
  }
748
748
  )
749
749
  ] })
750
750
  }
751
751
  ),
752
- F && /* @__PURE__ */ e(
753
- H,
752
+ J && /* @__PURE__ */ e(
753
+ G,
754
754
  {
755
- onClick: g,
756
- reply_count: o.reply_count
755
+ onClick: f,
756
+ reply_count: r.reply_count
757
757
  }
758
758
  ),
759
- L && /* @__PURE__ */ e(B, {})
760
- ] }, o.id)
759
+ P && /* @__PURE__ */ e(M, {})
760
+ ] }, r.id)
761
761
  ] });
762
- }, ot = A.memo(
763
- at,
764
- ns
765
- ), lt = (t) => {
766
- const s = Es("CustomMessage");
767
- return /* @__PURE__ */ e(ot, { ...s, ...t });
768
- }, it = (t) => ({
762
+ }, lt = j.memo(
763
+ ot,
764
+ rs
765
+ ), it = (t) => {
766
+ const s = Is("CustomMessage");
767
+ return /* @__PURE__ */ e(lt, { ...s, ...t });
768
+ }, ct = (t) => ({
769
769
  linkPreviews: Array.from(t.previews.values()).filter(
770
- (s) => Re.previewIsLoaded(s) || Re.previewIsLoading(s)
770
+ (s) => De.previewIsLoaded(s) || De.previewIsLoading(s)
771
771
  )
772
- }), ct = ({
772
+ }), dt = ({
773
773
  link: t,
774
774
  onDismiss: s
775
775
  }) => {
776
- const { og_scrape_url: n, title: a, image_url: l } = t;
776
+ const { og_scrape_url: n, title: o, image_url: l } = t;
777
777
  return /* @__PURE__ */ i(
778
778
  "a",
779
779
  {
@@ -786,7 +786,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
786
786
  "img",
787
787
  {
788
788
  src: l,
789
- alt: a || "",
789
+ alt: o || "",
790
790
  className: "h-[148px] w-full rounded-[20px] object-cover"
791
791
  }
792
792
  ),
@@ -794,8 +794,8 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
794
794
  "button",
795
795
  {
796
796
  type: "button",
797
- onClick: (r) => {
798
- r.preventDefault(), s(n);
797
+ onClick: (a) => {
798
+ a.preventDefault(), s(n);
799
799
  },
800
800
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl",
801
801
  "aria-label": "Close link preview",
@@ -803,38 +803,38 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
803
803
  }
804
804
  ),
805
805
  /* @__PURE__ */ i("div", { className: "p-2", children: [
806
- a && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: a }),
806
+ o && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: o }),
807
807
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
808
808
  ] })
809
809
  ]
810
810
  }
811
811
  );
812
- }, dt = () => {
813
- const { linkPreviewsManager: t } = Is(), { linkPreviews: s } = _s(
812
+ }, ut = () => {
813
+ const { linkPreviewsManager: t } = _s(), { linkPreviews: s } = Ss(
814
814
  t.state,
815
- it
815
+ ct
816
816
  ), n = (l) => {
817
817
  t.dismissPreview(l);
818
818
  };
819
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(
820
- ct,
820
+ dt,
821
821
  {
822
822
  link: l,
823
823
  onDismiss: n
824
824
  },
825
825
  l.og_scrape_url
826
826
  )) }) : null;
827
- }, ut = () => {
828
- const { handleSubmit: t } = Ms(), s = ks();
827
+ }, mt = () => {
828
+ const { handleSubmit: t } = ks(), s = Rs();
829
829
  return /* @__PURE__ */ i(ve, { children: [
830
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Rs, {}) }),
830
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ds, {}) }),
831
831
  /* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
832
- /* @__PURE__ */ e(Ds, {}),
833
- /* @__PURE__ */ e(dt, {}),
834
832
  /* @__PURE__ */ e(Ts, {}),
833
+ /* @__PURE__ */ e(ut, {}),
834
+ /* @__PURE__ */ e(Fs, {}),
835
835
  /* @__PURE__ */ i("div", { className: "flex", children: [
836
836
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
837
- Fs,
837
+ Ls,
838
838
  {
839
839
  className: "w-full resize-none outline-none leading-6",
840
840
  autoFocus: !0,
@@ -850,18 +850,18 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
850
850
  disabled: !s,
851
851
  onClick: t,
852
852
  type: "button",
853
- children: /* @__PURE__ */ e(As, { className: "size-4" })
853
+ children: /* @__PURE__ */ e($s, { className: "size-4" })
854
854
  }
855
855
  )
856
856
  ] })
857
857
  ] })
858
858
  ] });
859
- }, mt = ({
859
+ }, ht = ({
860
860
  renderActions: t
861
861
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
862
862
  t && (t == null ? void 0 : t()),
863
- /* @__PURE__ */ e(Ss, { Input: ut })
864
- ] }), ht = (t) => {
863
+ /* @__PURE__ */ e(Ms, { Input: mt })
864
+ ] }), ft = (t) => {
865
865
  const s = t.message.hide_date === !0;
866
866
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
867
867
  /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
@@ -869,12 +869,12 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
869
869
  /* @__PURE__ */ e("p", { children: t.message.text }),
870
870
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
871
871
  ] }),
872
- !s && /* @__PURE__ */ e(Ls, { message: t.message })
872
+ !s && /* @__PURE__ */ e(Ps, { message: t.message })
873
873
  ] });
874
- }, ft = () => null, gt = ({ className: t, message: s }) => /* @__PURE__ */ i(
874
+ }, gt = () => null, xt = ({ className: t, message: s }) => /* @__PURE__ */ i(
875
875
  "div",
876
876
  {
877
- className: D("flex items-center justify-center h-full", t),
877
+ className: R("flex items-center justify-center h-full", t),
878
878
  children: [
879
879
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
880
880
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -914,45 +914,45 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
914
914
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
915
915
  ]
916
916
  }
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: [
918
- /* @__PURE__ */ e(gt, { className: "w-6 h-6" }),
917
+ ), 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: [
918
+ /* @__PURE__ */ e(xt, { className: "w-6 h-6" }),
919
919
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
920
920
  ] }) }));
921
921
  he.displayName = "LoadingState";
922
- const xt = ({
922
+ const bt = ({
923
923
  onBack: t,
924
924
  showBackButton: s,
925
925
  onShowInfo: n,
926
- canShowInfo: a,
926
+ canShowInfo: o,
927
927
  showStarButton: l = !1
928
928
  }) => {
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
+ var p, r, E, S, v, k;
930
+ const { channel: d } = we(), a = j.useMemo(() => Object.values(d.state.members || {}).find(
931
+ (m) => {
932
+ var w;
933
+ return ((w = m.user) == null ? void 0 : w.id) && m.user.id !== d._client.userID;
934
934
  }
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)
935
+ ), [d._client.userID, d.state.members]), u = ((p = a == null ? void 0 : a.user) == null ? void 0 : p.name) || ((r = a == null ? void 0 : a.user) == null ? void 0 : r.id) || "Unknown member", f = (E = a == null ? void 0 : a.user) == null ? void 0 : E.image, [g, N] = _(
936
+ !!((S = d.state.membership) != null && S.pinned_at)
937
937
  );
938
- q(() => {
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
+ Z(() => {
939
+ const b = (m) => {
940
+ var w;
941
+ N(
942
+ m != null && m.member ? !!m.member.pinned_at : !!((w = d.state.membership) != null && w.pinned_at)
943
943
  );
944
944
  };
945
- return c.on("member.updated", h), () => {
946
- c.off("member.updated", h);
945
+ return d.on("member.updated", b), () => {
946
+ d.off("member.updated", b);
947
947
  };
948
- }, [c]);
949
- const f = async () => {
948
+ }, [d]);
949
+ const C = async () => {
950
950
  try {
951
- x ? await c.unpin() : await c.pin();
952
- } catch (h) {
951
+ g ? await d.unpin() : await d.pin();
952
+ } catch (b) {
953
953
  console.error(
954
954
  "[CustomChannelHeader] Failed to update pinned status:",
955
- h
955
+ b
956
956
  );
957
957
  }
958
958
  };
@@ -961,23 +961,23 @@ const xt = ({
961
961
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
962
962
  "button",
963
963
  {
964
- className: D(
964
+ className: R(
965
965
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
966
966
  ),
967
967
  onClick: t || (() => {
968
968
  }),
969
969
  type: "button",
970
970
  "aria-label": "Back to conversations",
971
- children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
971
+ children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
972
972
  }
973
973
  ) }),
974
974
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
975
975
  /* @__PURE__ */ e(
976
- Q,
976
+ K,
977
977
  {
978
- id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || c.id || "unknown",
978
+ id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
979
979
  name: u,
980
- image: g,
980
+ image: f,
981
981
  size: 40
982
982
  }
983
983
  ),
@@ -988,17 +988,17 @@ const xt = ({
988
988
  "button",
989
989
  {
990
990
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
991
- onClick: f,
991
+ onClick: C,
992
992
  type: "button",
993
- "aria-label": x ? "Unstar conversation" : "Star conversation",
993
+ "aria-label": g ? "Unstar conversation" : "Star conversation",
994
994
  children: /* @__PURE__ */ e(
995
- _e,
995
+ Se,
996
996
  {
997
- className: D("size-5", {
998
- "text-yellow-600": x,
999
- "text-black/90": !x
997
+ className: R("size-5", {
998
+ "text-yellow-600": g,
999
+ "text-black/90": !g
1000
1000
  }),
1001
- weight: x ? "duotone" : "regular"
1001
+ weight: g ? "duotone" : "regular"
1002
1002
  }
1003
1003
  )
1004
1004
  }
@@ -1010,7 +1010,7 @@ const xt = ({
1010
1010
  onClick: n,
1011
1011
  type: "button",
1012
1012
  "aria-label": "Show info",
1013
- children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
1013
+ children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
1014
1014
  }
1015
1015
  )
1016
1016
  ] })
@@ -1024,15 +1024,15 @@ const xt = ({
1024
1024
  onClick: t,
1025
1025
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1026
1026
  "aria-label": "Back to conversations",
1027
- children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
1027
+ children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
1028
1028
  }
1029
1029
  ),
1030
1030
  /* @__PURE__ */ e(
1031
- Q,
1031
+ K,
1032
1032
  {
1033
- id: ((E = r == null ? void 0 : r.user) == null ? void 0 : E.id) || c.id || "unknown",
1033
+ id: ((k = a == null ? void 0 : a.user) == null ? void 0 : k.id) || d.id || "unknown",
1034
1034
  name: u,
1035
- image: g,
1035
+ image: f,
1036
1036
  size: 40
1037
1037
  }
1038
1038
  ),
@@ -1043,115 +1043,116 @@ const xt = ({
1043
1043
  "button",
1044
1044
  {
1045
1045
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1046
- onClick: f,
1046
+ onClick: C,
1047
1047
  type: "button",
1048
- "aria-label": x ? "Unstar conversation" : "Star conversation",
1048
+ "aria-label": g ? "Unstar conversation" : "Star conversation",
1049
1049
  children: /* @__PURE__ */ e(
1050
- _e,
1050
+ Se,
1051
1051
  {
1052
- className: D("size-5", {
1053
- "text-yellow-600": x,
1054
- "text-black/90": !x
1052
+ className: R("size-5", {
1053
+ "text-yellow-600": g,
1054
+ "text-black/90": !g
1055
1055
  }),
1056
- weight: x ? "duotone" : "regular"
1056
+ weight: g ? "duotone" : "regular"
1057
1057
  }
1058
1058
  )
1059
1059
  }
1060
1060
  ),
1061
- a && n && /* @__PURE__ */ e(
1061
+ o && n && /* @__PURE__ */ e(
1062
1062
  "button",
1063
1063
  {
1064
1064
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1065
1065
  onClick: n,
1066
1066
  type: "button",
1067
1067
  "aria-label": "Show info",
1068
- children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
1068
+ children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
1069
1069
  }
1070
1070
  )
1071
1071
  ] })
1072
1072
  ] })
1073
1073
  ] });
1074
- }, bt = ({
1074
+ }, Ct = ({
1075
1075
  dialogRef: t,
1076
1076
  onClose: s,
1077
1077
  participant: n,
1078
- channel: a,
1078
+ channel: o,
1079
1079
  followerStatusLabel: l,
1080
- onLeaveConversation: c,
1081
- onBlockParticipant: r,
1080
+ onLeaveConversation: d,
1081
+ onBlockParticipant: a,
1082
1082
  showDeleteConversation: u = !0,
1083
- onDeleteConversationClick: g,
1084
- onBlockParticipantClick: x,
1085
- onReportParticipantClick: b
1083
+ onDeleteConversationClick: f,
1084
+ onBlockParticipantClick: g,
1085
+ onReportParticipantClick: N,
1086
+ customChannelActions: C
1086
1087
  }) => {
1087
- var X, K, Y, ee, ne, J, V;
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)))
1088
+ var ee, Y, se, te, re, V, J;
1089
+ const { service: p, debug: r } = fe(), [E, S] = _(!1), [v, k] = _(!1), [b, m] = _(!1), w = L(async () => {
1090
+ var P;
1091
+ if (!(!p || !((P = n == null ? void 0 : n.user) != null && P.id)))
1091
1092
  try {
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);
1093
+ const H = (await p.getBlockedUsers()).some(
1094
+ (F) => {
1095
+ var W;
1096
+ return F.blocked_user_id === ((W = n == null ? void 0 : n.user) == null ? void 0 : W.id);
1096
1097
  }
1097
1098
  );
1098
- M(G);
1099
- } catch (L) {
1099
+ S(H);
1100
+ } catch (O) {
1100
1101
  console.error(
1101
1102
  "[ChannelInfoDialog] Failed to check blocked status:",
1102
- L
1103
+ O
1103
1104
  );
1104
1105
  }
1105
- }, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1106
- q(() => {
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);
1106
+ }, [p, (ee = n == null ? void 0 : n.user) == null ? void 0 : ee.id]);
1107
+ Z(() => {
1108
+ w();
1109
+ }, [w]);
1110
+ const D = async () => {
1111
+ var P;
1112
+ if (!v) {
1113
+ f == null || f(), r && console.log("[ChannelInfoDialog] Leave conversation", o.cid), k(!0);
1113
1114
  try {
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);
1115
+ const O = ((P = o._client) == null ? void 0 : P.userID) ?? null;
1116
+ await o.hide(O, !1), d && await d(o), s();
1117
+ } catch (O) {
1118
+ console.error("[ChannelInfoDialog] Failed to leave conversation", O);
1118
1119
  } finally {
1119
- w(!1);
1120
+ k(!1);
1120
1121
  }
1121
1122
  }
1122
- }, R = async () => {
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);
1123
+ }, h = async () => {
1124
+ var P, O, H;
1125
+ if (!(b || !p)) {
1126
+ g == null || g(), r && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1126
1127
  try {
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);
1128
+ await p.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
1129
+ } catch (F) {
1130
+ console.error("[ChannelInfoDialog] Failed to block member", F);
1130
1131
  } finally {
1131
- h(!1);
1132
+ m(!1);
1132
1133
  }
1133
1134
  }
1134
- }, d = async () => {
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);
1135
+ }, c = async () => {
1136
+ var P, O, H;
1137
+ if (!(b || !p)) {
1138
+ g == null || g(), r && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), m(!0);
1138
1139
  try {
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);
1140
+ await p.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
1141
+ } catch (F) {
1142
+ console.error("[ChannelInfoDialog] Failed to unblock member", F);
1142
1143
  } finally {
1143
- h(!1);
1144
+ m(!1);
1144
1145
  }
1145
1146
  }
1146
- }, m = () => {
1147
- b == null || b(), s(), window.open(
1147
+ }, x = () => {
1148
+ N == null || N(), s(), window.open(
1148
1149
  "https://linktr.ee/s/about/trust-center/report",
1149
1150
  "_blank",
1150
1151
  "noopener,noreferrer"
1151
1152
  );
1152
1153
  };
1153
1154
  if (!n) return null;
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";
1155
+ const B = ((Y = n.user) == null ? void 0 : Y.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", I = (te = n.user) == null ? void 0 : te.image, T = (re = n.user) == null ? void 0 : re.email, M = (V = n.user) == null ? void 0 : V.username, G = T || (M ? `linktr.ee/${M}` : void 0), z = ((J = n.user) == null ? void 0 : J.id) || "unknown";
1155
1156
  return (
1156
1157
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1157
1158
  /* @__PURE__ */ e(
@@ -1160,13 +1161,13 @@ const xt = ({
1160
1161
  ref: t,
1161
1162
  className: "mes-dialog group",
1162
1163
  onClose: s,
1163
- onClick: (F) => {
1164
- F.target === t.current && s();
1164
+ onClick: (P) => {
1165
+ P.target === t.current && s();
1165
1166
  },
1166
1167
  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: [
1167
1168
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1168
1169
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
1169
- /* @__PURE__ */ e(je, { onClick: s })
1170
+ /* @__PURE__ */ e(Ae, { onClick: s })
1170
1171
  ] }),
1171
1172
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1172
1173
  /* @__PURE__ */ e(
@@ -1176,18 +1177,18 @@ const xt = ({
1176
1177
  style: { backgroundColor: "#FBFAF9" },
1177
1178
  children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
1178
1179
  /* @__PURE__ */ e(
1179
- Q,
1180
+ K,
1180
1181
  {
1181
- id: H,
1182
- name: N,
1183
- image: U,
1182
+ id: z,
1183
+ name: B,
1184
+ image: I,
1184
1185
  size: 88,
1185
1186
  shape: "circle"
1186
1187
  }
1187
1188
  ),
1188
1189
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
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 }),
1190
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: B }),
1191
+ G && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: G }),
1191
1192
  l && /* @__PURE__ */ e(
1192
1193
  "span",
1193
1194
  {
@@ -1210,101 +1211,103 @@ const xt = ({
1210
1211
  u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1211
1212
  de,
1212
1213
  {
1213
- onClick: p,
1214
- disabled: S,
1215
- "aria-busy": S,
1214
+ onClick: D,
1215
+ disabled: v,
1216
+ "aria-busy": v,
1216
1217
  children: [
1217
- S ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e($s, { className: "h-5 w-5" }),
1218
+ v ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
1218
1219
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1219
1220
  ]
1220
1221
  }
1221
1222
  ) }),
1222
- /* @__PURE__ */ e("li", { children: o ? /* @__PURE__ */ i(
1223
+ /* @__PURE__ */ e("li", { children: E ? /* @__PURE__ */ i(
1223
1224
  de,
1224
1225
  {
1225
- onClick: d,
1226
- disabled: E,
1227
- "aria-busy": E,
1226
+ onClick: c,
1227
+ disabled: b,
1228
+ "aria-busy": b,
1228
1229
  children: [
1229
- E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1230
+ b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
1230
1231
  /* @__PURE__ */ e("span", { children: "Unblock" })
1231
1232
  ]
1232
1233
  }
1233
1234
  ) : /* @__PURE__ */ i(
1234
1235
  de,
1235
1236
  {
1236
- onClick: R,
1237
- disabled: E,
1238
- "aria-busy": E,
1237
+ onClick: h,
1238
+ disabled: b,
1239
+ "aria-busy": b,
1239
1240
  children: [
1240
- E ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Me, { className: "h-5 w-5" }),
1241
+ b ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5" }),
1241
1242
  /* @__PURE__ */ e("span", { children: "Block" })
1242
1243
  ]
1243
1244
  }
1244
1245
  ) }),
1245
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: m, children: [
1246
- /* @__PURE__ */ e(zs, { className: "h-5 w-5" }),
1246
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: x, children: [
1247
+ /* @__PURE__ */ e(Hs, { className: "h-5 w-5" }),
1247
1248
  /* @__PURE__ */ e("span", { children: "Report" })
1248
- ] }) })
1249
+ ] }) }),
1250
+ C
1249
1251
  ] })
1250
1252
  ] })
1251
1253
  ] })
1252
1254
  }
1253
1255
  )
1254
1256
  );
1255
- }, Ct = ({
1257
+ }, Nt = ({
1256
1258
  onBack: t,
1257
1259
  showBackButton: s,
1258
1260
  renderMessageInputActions: n,
1259
- onLeaveConversation: a,
1261
+ onLeaveConversation: o,
1260
1262
  onBlockParticipant: l,
1261
- showDeleteConversation: c = !0,
1262
- onDeleteConversationClick: r,
1263
+ showDeleteConversation: d = !0,
1264
+ onDeleteConversationClick: a,
1263
1265
  onBlockParticipantClick: u,
1264
- onReportParticipantClick: g,
1265
- showStarButton: x = !1,
1266
- chatbotVotingEnabled: b = !1,
1267
- renderChannelBanner: f
1266
+ onReportParticipantClick: f,
1267
+ showStarButton: g = !1,
1268
+ chatbotVotingEnabled: N = !1,
1269
+ renderChannelBanner: C,
1270
+ customChannelActions: p
1268
1271
  }) => {
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;
1272
+ const { channel: r } = we(), E = q(null), S = j.useMemo(() => Object.values(r.state.members || {}).find(
1273
+ (w) => {
1274
+ var D;
1275
+ return ((D = w.user) == null ? void 0 : D.id) && w.user.id !== r._client.userID;
1273
1276
  }
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();
1277
+ ), [r._client.userID, r.state.members]), v = j.useMemo(() => {
1278
+ const m = r.data ?? {};
1279
+ if (m.followerStatus)
1280
+ return String(m.followerStatus);
1281
+ if (m.isFollower !== void 0)
1282
+ return m.isFollower ? "Subscribed to you" : "Not subscribed";
1283
+ }, [r.data]), k = L(() => {
1284
+ var m;
1285
+ (m = E.current) == null || m.showModal();
1286
+ }, []), b = L(() => {
1287
+ var m;
1288
+ (m = E.current) == null || m.close();
1286
1289
  }, []);
1287
1290
  return /* @__PURE__ */ i(ve, { children: [
1288
1291
  /* @__PURE__ */ e(
1289
- Os,
1292
+ Us,
1290
1293
  {
1291
1294
  overrides: {
1292
- Message: (h) => /* @__PURE__ */ e(lt, { ...h, chatbotVotingEnabled: b })
1295
+ Message: (m) => /* @__PURE__ */ e(it, { ...m, chatbotVotingEnabled: N })
1293
1296
  },
1294
- children: /* @__PURE__ */ i(Us, { children: [
1297
+ children: /* @__PURE__ */ i(Bs, { children: [
1295
1298
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1296
- xt,
1299
+ bt,
1297
1300
  {
1298
1301
  onBack: t,
1299
1302
  showBackButton: s,
1300
- onShowInfo: w,
1301
- canShowInfo: !!M,
1302
- showStarButton: x
1303
+ onShowInfo: k,
1304
+ canShowInfo: !!S,
1305
+ showStarButton: g
1303
1306
  }
1304
1307
  ) }),
1305
- f == null ? void 0 : f(),
1308
+ C == null ? void 0 : C(),
1306
1309
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1307
- Bs,
1310
+ js,
1308
1311
  {
1309
1312
  hideDeletedMessages: !0,
1310
1313
  hideNewMessageSeparator: !1,
@@ -1312,104 +1315,107 @@ const xt = ({
1312
1315
  }
1313
1316
  ) }),
1314
1317
  /* @__PURE__ */ e(
1315
- mt,
1318
+ ht,
1316
1319
  {
1317
- renderActions: () => n == null ? void 0 : n(v)
1320
+ renderActions: () => n == null ? void 0 : n(r)
1318
1321
  }
1319
1322
  )
1320
1323
  ] })
1321
1324
  }
1322
1325
  ),
1323
1326
  /* @__PURE__ */ e(
1324
- bt,
1327
+ Ct,
1325
1328
  {
1326
- dialogRef: o,
1327
- onClose: E,
1328
- participant: M,
1329
- channel: v,
1330
- followerStatusLabel: S,
1331
- onLeaveConversation: a,
1329
+ dialogRef: E,
1330
+ onClose: b,
1331
+ participant: S,
1332
+ channel: r,
1333
+ followerStatusLabel: v,
1334
+ onLeaveConversation: o,
1332
1335
  onBlockParticipant: l,
1333
- showDeleteConversation: c,
1334
- onDeleteConversationClick: r,
1336
+ showDeleteConversation: d,
1337
+ onDeleteConversationClick: a,
1335
1338
  onBlockParticipantClick: u,
1336
- onReportParticipantClick: g
1339
+ onReportParticipantClick: f,
1340
+ customChannelActions: p
1337
1341
  }
1338
1342
  )
1339
1343
  ] });
1340
- }, Ae = A.memo(
1344
+ }, $e = j.memo(
1341
1345
  ({
1342
1346
  channel: t,
1343
1347
  onBack: s,
1344
1348
  showBackButton: n = !1,
1345
- renderMessageInputActions: a,
1349
+ renderMessageInputActions: o,
1346
1350
  onLeaveConversation: l,
1347
- onBlockParticipant: c,
1348
- className: r,
1349
- CustomChannelEmptyState: u = ft,
1350
- showDeleteConversation: g = !0,
1351
- onDeleteConversationClick: x,
1352
- onBlockParticipantClick: b,
1353
- onReportParticipantClick: f,
1354
- dmAgentEnabled: v,
1355
- messageMetadata: o,
1356
- onMessageSent: M,
1351
+ onBlockParticipant: d,
1352
+ className: a,
1353
+ CustomChannelEmptyState: u = gt,
1354
+ showDeleteConversation: f = !0,
1355
+ onDeleteConversationClick: g,
1356
+ onBlockParticipantClick: N,
1357
+ onReportParticipantClick: C,
1358
+ dmAgentEnabled: p,
1359
+ messageMetadata: r,
1360
+ onMessageSent: E,
1357
1361
  showStarButton: S = !1,
1358
- chatbotVotingEnabled: w = !1,
1359
- renderChannelBanner: E
1362
+ chatbotVotingEnabled: v = !1,
1363
+ renderChannelBanner: k,
1364
+ customChannelActions: b
1360
1365
  }) => {
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,
1366
- ...m && { silent: !0 },
1367
- ...o && {
1366
+ const m = L(
1367
+ async (w, D, h) => {
1368
+ var M;
1369
+ const c = ((M = t.data) == null ? void 0 : M.chatbot_paused) === !0, x = p && !c, B = {
1370
+ ...D,
1371
+ ...x && { silent: !0 },
1372
+ ...r && {
1368
1373
  metadata: {
1369
- ...p.metadata ?? {},
1370
- ...o
1374
+ ...D.metadata ?? {},
1375
+ ...r
1371
1376
  }
1372
1377
  }
1373
- }, U = {
1374
- ...R,
1375
- ...m && { skip_push: !0 }
1376
- }, I = await t.sendMessage(N, U);
1377
- return M == null || M(I), I;
1378
+ }, I = {
1379
+ ...h,
1380
+ ...x && { skip_push: !0 }
1381
+ }, T = await t.sendMessage(B, I);
1382
+ return E == null || E(T), T;
1378
1383
  },
1379
- [t, v, o, M]
1384
+ [t, p, r, E]
1380
1385
  );
1381
1386
  return /* @__PURE__ */ e(
1382
1387
  "div",
1383
1388
  {
1384
- className: D(
1389
+ className: R(
1385
1390
  "messaging-channel-view h-full flex flex-col",
1386
- r
1391
+ a
1387
1392
  ),
1388
1393
  children: /* @__PURE__ */ e(
1389
- Ps,
1394
+ Os,
1390
1395
  {
1391
1396
  channel: t,
1392
- MessageSystem: ht,
1397
+ MessageSystem: ft,
1393
1398
  EmptyStateIndicator: u,
1394
1399
  LoadingIndicator: he,
1395
- DateSeparator: Ks,
1396
- doSendMessageRequest: h,
1400
+ DateSeparator: et,
1401
+ doSendMessageRequest: m,
1397
1402
  children: /* @__PURE__ */ e(
1398
- Ct,
1403
+ Nt,
1399
1404
  {
1400
1405
  onBack: s,
1401
1406
  showBackButton: n,
1402
- renderMessageInputActions: a,
1407
+ renderMessageInputActions: o,
1403
1408
  onLeaveConversation: l,
1404
- onBlockParticipant: c,
1409
+ onBlockParticipant: d,
1405
1410
  CustomChannelEmptyState: u,
1406
- showDeleteConversation: g,
1407
- onDeleteConversationClick: x,
1408
- onBlockParticipantClick: b,
1409
- onReportParticipantClick: f,
1411
+ showDeleteConversation: f,
1412
+ onDeleteConversationClick: g,
1413
+ onBlockParticipantClick: N,
1414
+ onReportParticipantClick: C,
1410
1415
  showStarButton: S,
1411
- chatbotVotingEnabled: w,
1412
- renderChannelBanner: E
1416
+ chatbotVotingEnabled: v,
1417
+ renderChannelBanner: k,
1418
+ customChannelActions: b
1413
1419
  }
1414
1420
  )
1415
1421
  }
@@ -1418,16 +1424,16 @@ const xt = ({
1418
1424
  );
1419
1425
  }
1420
1426
  );
1421
- Ae.displayName = "ChannelView";
1422
- function Nt({
1427
+ $e.displayName = "ChannelView";
1428
+ function vt({
1423
1429
  searchQuery: t,
1424
1430
  setSearchQuery: s,
1425
1431
  placeholder: n
1426
1432
  }) {
1427
- const a = W(null);
1433
+ const o = q(null);
1428
1434
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1429
1435
  /* @__PURE__ */ e(
1430
- Hs,
1436
+ Gs,
1431
1437
  {
1432
1438
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1433
1439
  weight: "bold"
@@ -1436,7 +1442,7 @@ function Nt({
1436
1442
  /* @__PURE__ */ e(
1437
1443
  "input",
1438
1444
  {
1439
- ref: a,
1445
+ ref: o,
1440
1446
  type: "text",
1441
1447
  placeholder: n,
1442
1448
  value: t,
@@ -1445,12 +1451,12 @@ function Nt({
1445
1451
  }
1446
1452
  ),
1447
1453
  t && /* @__PURE__ */ e(
1448
- Be,
1454
+ je,
1449
1455
  {
1450
1456
  label: "Clear search",
1451
1457
  onClick: () => {
1452
1458
  var l;
1453
- s(""), (l = a.current) == null || l.focus();
1459
+ s(""), (l = o.current) == null || l.focus();
1454
1460
  },
1455
1461
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1456
1462
  children: /* @__PURE__ */ e(pe, { className: "h-4 w-4", weight: "bold" })
@@ -1458,144 +1464,144 @@ function Nt({
1458
1464
  )
1459
1465
  ] });
1460
1466
  }
1461
- const vt = ({
1467
+ const wt = ({
1462
1468
  participantSource: t,
1463
1469
  onSelectParticipant: s,
1464
1470
  onClose: n,
1465
- existingParticipantIds: a = /* @__PURE__ */ new Set(),
1471
+ existingParticipantIds: o = /* @__PURE__ */ new Set(),
1466
1472
  participantLabel: l = "participants",
1467
- searchPlaceholder: c = "Search participants...",
1468
- className: r
1473
+ searchPlaceholder: d = "Search participants...",
1474
+ className: a
1469
1475
  }) => {
1470
- const { debug: u } = fe(), [g, x] = k(""), [b, f] = k([]), [v, o] = k(!1), [M, S] = k(null), [w, E] = k(
1476
+ const { debug: u } = fe(), [f, g] = _(""), [N, C] = _([]), [p, r] = _(!1), [E, S] = _(null), [v, k] = _(
1471
1477
  null
1472
- ), h = W(!1);
1473
- q(() => {
1478
+ ), b = q(!1);
1479
+ Z(() => {
1474
1480
  if (t.loading) {
1475
1481
  u && console.log(
1476
1482
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1477
1483
  );
1478
1484
  return;
1479
1485
  }
1480
- if (h.current) return;
1486
+ if (b.current) return;
1481
1487
  (async () => {
1482
- u && console.log("[ParticipantPicker] Loading initial participants..."), o(!0), S(null);
1488
+ u && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), S(null);
1483
1489
  try {
1484
- const m = await t.loadParticipants({
1490
+ const c = await t.loadParticipants({
1485
1491
  search: "",
1486
1492
  // Load all participants initially
1487
1493
  limit: 100
1488
1494
  });
1489
- f(m.participants), h.current = !0, u && console.log(
1495
+ C(c.participants), b.current = !0, u && console.log(
1490
1496
  "[ParticipantPicker] Participants loaded successfully:",
1491
- m.participants.length
1497
+ c.participants.length
1492
1498
  );
1493
- } catch (m) {
1494
- const N = m instanceof Error ? m.message : "Failed to load participants";
1495
- S(N), console.error("[ParticipantPicker] Failed to load participants:", m);
1499
+ } catch (c) {
1500
+ const x = c instanceof Error ? c.message : "Failed to load participants";
1501
+ S(x), console.error("[ParticipantPicker] Failed to load participants:", c);
1496
1502
  } finally {
1497
- o(!1);
1503
+ r(!1);
1498
1504
  }
1499
1505
  })();
1500
1506
  }, [t.loading, u]);
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(
1507
- async (d) => {
1508
- if (!w) {
1509
- E(d.id);
1507
+ const m = N.filter((h) => !o.has(h.id)).filter((h) => {
1508
+ var x;
1509
+ if (!f) return !0;
1510
+ const c = f.toLowerCase();
1511
+ return h.name.toLowerCase().includes(c) || ((x = h.email) == null ? void 0 : x.toLowerCase().includes(c)) || !1;
1512
+ }), w = L(
1513
+ async (h) => {
1514
+ if (!v) {
1515
+ k(h.id);
1510
1516
  try {
1511
- await s(d);
1512
- } catch (m) {
1513
- console.error("[ParticipantPicker] Failed to start chat:", m), E(null);
1517
+ await s(h);
1518
+ } catch (c) {
1519
+ console.error("[ParticipantPicker] Failed to start chat:", c), k(null);
1514
1520
  }
1515
1521
  }
1516
1522
  },
1517
- [s, w]
1518
- ), R = (d, m) => {
1519
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), p(m));
1523
+ [s, v]
1524
+ ), D = (h, c) => {
1525
+ (h.key === "Enter" || h.key === " ") && (h.preventDefault(), w(c));
1520
1526
  };
1521
- return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1527
+ return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
1522
1528
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1523
1529
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1524
1530
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1525
- /* @__PURE__ */ e(je, { onClick: n })
1531
+ /* @__PURE__ */ e(Ae, { onClick: n })
1526
1532
  ] }),
1527
1533
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1528
1534
  "Select a ",
1529
1535
  l.slice(0, -1),
1530
1536
  " to start messaging (",
1531
- C.length,
1537
+ m.length,
1532
1538
  " available)",
1533
1539
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1534
1540
  ] }),
1535
1541
  /* @__PURE__ */ e(
1536
- Nt,
1542
+ vt,
1537
1543
  {
1538
- searchQuery: g,
1539
- setSearchQuery: x,
1540
- placeholder: c
1544
+ searchQuery: f,
1545
+ setSearchQuery: g,
1546
+ placeholder: d
1541
1547
  }
1542
1548
  )
1543
1549
  ] }),
1544
- M && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1550
+ E && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1545
1551
  "Error loading ",
1546
1552
  l,
1547
1553
  ": ",
1548
- M
1554
+ E
1549
1555
  ] }),
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: [
1556
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: p && m.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: [
1551
1557
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1552
1558
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1553
1559
  "Loading ",
1554
1560
  l,
1555
1561
  "..."
1556
1562
  ] })
1557
- ] }) }) : C.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
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" }) }),
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` })
1563
+ ] }) }) : m.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1564
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Re, { className: "h-8 w-8 text-charcoal" }) }),
1565
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : N.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1566
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : N.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1561
1567
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1562
- C.map((d) => {
1563
- const m = d.name || d.email || d.id, N = d.email && d.name ? d.email : d.phone;
1568
+ m.map((h) => {
1569
+ const c = h.name || h.email || h.id, x = h.email && h.name ? h.email : h.phone;
1564
1570
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1565
1571
  "button",
1566
1572
  {
1567
1573
  type: "button",
1568
- onClick: () => p(d),
1569
- onKeyDown: (U) => R(U, d),
1574
+ onClick: () => w(h),
1575
+ onKeyDown: (B) => D(B, h),
1570
1576
  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",
1571
1577
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1572
1578
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1573
1579
  /* @__PURE__ */ e(
1574
- Q,
1580
+ K,
1575
1581
  {
1576
- id: d.id,
1577
- name: m,
1578
- image: d.image,
1582
+ id: h.id,
1583
+ name: c,
1584
+ image: h.image,
1579
1585
  size: 40
1580
1586
  }
1581
1587
  ),
1582
1588
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1583
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1584
- N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1589
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: c }),
1590
+ x && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: x })
1585
1591
  ] })
1586
1592
  ] }),
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" }) })
1593
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: v === h.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Re, { className: "h-5 w-5 text-stone" }) })
1588
1594
  ] })
1589
1595
  }
1590
- ) }, d.id);
1596
+ ) }, h.id);
1591
1597
  }),
1592
- v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1598
+ p && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1593
1599
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1594
1600
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1595
1601
  ] }) })
1596
1602
  ] }) })
1597
1603
  ] });
1598
- }, wt = ({ className: t }) => /* @__PURE__ */ i(
1604
+ }, pt = ({ className: t }) => /* @__PURE__ */ i(
1599
1605
  "svg",
1600
1606
  {
1601
1607
  width: "140",
@@ -1729,17 +1735,17 @@ const vt = ({
1729
1735
  ] })
1730
1736
  ]
1731
1737
  }
1732
- ), $e = A.memo(
1738
+ ), ze = j.memo(
1733
1739
  ({ 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: [
1734
- /* @__PURE__ */ e(wt, {}),
1740
+ /* @__PURE__ */ e(pt, {}),
1735
1741
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1736
1742
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1737
1743
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1738
1744
  ] })
1739
1745
  ] }) })
1740
1746
  );
1741
- $e.displayName = "EmptyState";
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: [
1747
+ ze.displayName = "EmptyState";
1748
+ 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: [
1743
1749
  /* @__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: "⚠️" }) }),
1744
1750
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1745
1751
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1754,217 +1760,218 @@ const me = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1754
1760
  )
1755
1761
  ] }) }));
1756
1762
  me.displayName = "ErrorState";
1757
- const Dt = ({
1763
+ const Tt = ({
1758
1764
  capabilities: t = {},
1759
1765
  className: s,
1760
1766
  renderMessageInputActions: n,
1761
- onChannelSelect: a,
1767
+ onChannelSelect: o,
1762
1768
  onParticipantSelect: l,
1763
- initialParticipantFilter: c,
1764
- initialParticipantData: r,
1769
+ initialParticipantFilter: d,
1770
+ initialParticipantData: a,
1765
1771
  CustomChannelEmptyState: u,
1766
- showChannelList: g = !0,
1767
- filters: x,
1768
- channelListCustomEmptyStateIndicator: b,
1769
- onDeleteConversationClick: f,
1770
- onBlockParticipantClick: v,
1771
- onReportParticipantClick: o,
1772
- dmAgentEnabled: M,
1772
+ showChannelList: f = !0,
1773
+ filters: g,
1774
+ channelListCustomEmptyStateIndicator: N,
1775
+ onDeleteConversationClick: C,
1776
+ onBlockParticipantClick: p,
1777
+ onReportParticipantClick: r,
1778
+ dmAgentEnabled: E,
1773
1779
  messageMetadata: S,
1774
- onMessageSent: w,
1775
- showStarButton: E = !1,
1776
- chatbotVotingEnabled: h = !1,
1777
- renderMessagePreview: C,
1778
- renderChannelBanner: p
1780
+ onMessageSent: v,
1781
+ showStarButton: k = !1,
1782
+ chatbotVotingEnabled: b = !1,
1783
+ renderMessagePreview: m,
1784
+ renderChannelBanner: w,
1785
+ customChannelActions: D
1779
1786
  }) => {
1780
1787
  const {
1781
- service: R,
1782
- client: d,
1783
- isConnected: m,
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), {
1789
- participantSource: re,
1790
- participantLabel: ae = "participants",
1791
- showDeleteConversation: ze = !0
1792
- } = t, He = A.useMemo(() => {
1793
- const _ = d == null ? void 0 : d.userID;
1788
+ service: h,
1789
+ client: c,
1790
+ isConnected: x,
1791
+ isLoading: B,
1792
+ error: I,
1793
+ refreshConnection: T,
1794
+ debug: M
1795
+ } = Vs(), [G, z] = _(null), [ee, Y] = _(!1), [se, te] = _(!1), [re, V] = _(!1), [J, P] = _(/* @__PURE__ */ new Set()), [O, H] = _(0), [F, W] = _(!1), [ae, Q] = _(null), X = q(null), {
1796
+ participantSource: oe,
1797
+ participantLabel: Ee = "participants",
1798
+ showDeleteConversation: He = !0
1799
+ } = t, Ge = j.useMemo(() => {
1800
+ const y = c == null ? void 0 : c.userID;
1794
1801
  return {
1795
1802
  ...{
1796
1803
  type: "messaging",
1797
1804
  last_message_at: { $exists: !0 },
1798
- ..._ && {
1799
- members: { $in: [_] },
1805
+ ...y && {
1806
+ members: { $in: [y] },
1800
1807
  hidden: !1
1801
1808
  }
1802
1809
  },
1803
- ...x
1810
+ ...g
1804
1811
  };
1805
- }, [x, d == null ? void 0 : d.userID]), le = W(null), te = T(async () => {
1806
- if (!d || !m) return;
1807
- const _ = d.userID;
1808
- if (_)
1812
+ }, [g, c == null ? void 0 : c.userID]), le = q(null), ne = L(async () => {
1813
+ if (!c || !x) return;
1814
+ const y = c.userID;
1815
+ if (y)
1809
1816
  try {
1810
- y && console.log("[MessagingShell] Syncing channels for user:", _);
1811
- const z = await d.queryChannels(
1817
+ M && console.log("[MessagingShell] Syncing channels for user:", y);
1818
+ const $ = await c.queryChannels(
1812
1819
  {
1813
1820
  type: "messaging",
1814
- members: { $in: [_] }
1821
+ members: { $in: [y] }
1815
1822
  },
1816
1823
  {},
1817
1824
  { limit: 100 }
1818
- ), O = /* @__PURE__ */ new Set();
1819
- z.forEach(($) => {
1820
- const ge = $.state.members;
1821
- Object.values(ge).forEach((Je) => {
1822
- var Ee;
1823
- const xe = (Ee = Je.user) == null ? void 0 : Ee.id;
1824
- xe && xe !== _ && O.add(xe);
1825
+ ), U = /* @__PURE__ */ new Set();
1826
+ $.forEach((A) => {
1827
+ const ge = A.state.members;
1828
+ Object.values(ge).forEach((Qe) => {
1829
+ var Ie;
1830
+ const xe = (Ie = Qe.user) == null ? void 0 : Ie.id;
1831
+ xe && xe !== y && U.add(xe);
1825
1832
  });
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
1833
+ }), P((A) => A.size === U.size && [...A].every((ge) => U.has(ge)) ? A : U), Y($.length > 0), te(!0), le.current = y, M && console.log("[MessagingShell] Channels synced successfully:", {
1834
+ channelCount: $.length,
1835
+ memberCount: U.size
1829
1836
  });
1830
- } catch (z) {
1831
- console.error("[MessagingShell] Failed to sync channels:", z);
1837
+ } catch ($) {
1838
+ console.error("[MessagingShell] Failed to sync channels:", $);
1832
1839
  }
1833
- }, [d, m, y]);
1834
- q(() => {
1835
- if (!d || !m) return;
1836
- const _ = d.userID;
1837
- _ && le.current !== _ && te();
1838
- }, [d, m, te]), q(() => {
1839
- if (!c || !d || !m) return;
1840
+ }, [c, x, M]);
1841
+ Z(() => {
1842
+ if (!c || !x) return;
1843
+ const y = c.userID;
1844
+ y && le.current !== y && ne();
1845
+ }, [c, x, ne]), Z(() => {
1846
+ if (!d || !c || !x) return;
1840
1847
  (async () => {
1841
- const z = d.userID;
1842
- if (z)
1848
+ const $ = c.userID;
1849
+ if ($)
1843
1850
  try {
1844
- y && console.log(
1851
+ M && console.log(
1845
1852
  "[MessagingShell] Loading initial conversation with:",
1846
- c
1853
+ d
1847
1854
  );
1848
- const O = await d.queryChannels(
1855
+ const U = await c.queryChannels(
1849
1856
  {
1850
1857
  type: "messaging",
1851
- members: { $eq: [z, c] }
1858
+ members: { $eq: [$, d] }
1852
1859
  },
1853
1860
  {},
1854
1861
  { limit: 1 }
1855
1862
  );
1856
- if (O.length > 0)
1857
- H(O[0]), j(!0), Z(null), a && a(O[0]), y && console.log(
1863
+ if (U.length > 0)
1864
+ z(U[0]), W(!0), Q(null), o && o(U[0]), M && console.log(
1858
1865
  "[MessagingShell] Initial conversation loaded:",
1859
- O[0].id
1866
+ U[0].id
1860
1867
  );
1861
- else if (r && R) {
1862
- y && console.log(
1868
+ else if (a && h) {
1869
+ M && console.log(
1863
1870
  "[MessagingShell] No conversation found, creating one for:",
1864
- r
1871
+ a
1865
1872
  );
1866
1873
  try {
1867
- const $ = await R.startChannelWithParticipant({
1868
- id: r.id,
1869
- name: r.name,
1870
- email: r.email,
1871
- phone: r.phone
1874
+ const A = await h.startChannelWithParticipant({
1875
+ id: a.id,
1876
+ name: a.name,
1877
+ email: a.email,
1878
+ phone: a.phone
1872
1879
  });
1873
- H($), j(!0), Z(null), a && a($), y && console.log(
1880
+ z(A), W(!0), Q(null), o && o(A), M && console.log(
1874
1881
  "[MessagingShell] Channel created and loaded:",
1875
- $.id
1882
+ A.id
1876
1883
  );
1877
- } catch ($) {
1884
+ } catch (A) {
1878
1885
  console.error(
1879
1886
  "[MessagingShell] Failed to create conversation:",
1880
- $
1881
- ), Z("Failed to create conversation");
1887
+ A
1888
+ ), Q("Failed to create conversation");
1882
1889
  }
1883
1890
  } else
1884
- Z(
1891
+ Q(
1885
1892
  "No conversation found with this account"
1886
- ), y && console.log(
1893
+ ), M && console.log(
1887
1894
  "[MessagingShell] No conversation found for:",
1888
- c
1895
+ d
1889
1896
  );
1890
- } catch (O) {
1897
+ } catch (U) {
1891
1898
  console.error(
1892
1899
  "[MessagingShell] Failed to load initial conversation:",
1893
- O
1894
- ), Z("Failed to load conversation");
1900
+ U
1901
+ ), Q("Failed to load conversation");
1895
1902
  }
1896
1903
  })();
1897
1904
  }, [
1898
- c,
1899
- r,
1900
1905
  d,
1901
- m,
1902
- R,
1903
- y,
1904
- a
1906
+ a,
1907
+ c,
1908
+ x,
1909
+ h,
1910
+ M,
1911
+ o
1905
1912
  ]);
1906
- const Ge = T(
1907
- (_) => {
1908
- H(_), a == null || a(_);
1913
+ const Ve = L(
1914
+ (y) => {
1915
+ z(y), o == null || o(y);
1909
1916
  },
1910
- [a]
1911
- ), Ve = T(() => {
1912
- P || H(null);
1913
- }, [P]), We = T(
1914
- async (_) => {
1915
- var z;
1916
- if (R)
1917
+ [o]
1918
+ ), We = L(() => {
1919
+ F || z(null);
1920
+ }, [F]), qe = L(
1921
+ async (y) => {
1922
+ var $;
1923
+ if (h)
1917
1924
  try {
1918
- y && console.log(
1925
+ M && console.log(
1919
1926
  "[MessagingShell] Starting conversation with:",
1920
- _.id
1927
+ y.id
1921
1928
  );
1922
- const O = await R.startChannelWithParticipant({
1923
- id: _.id,
1924
- name: _.name,
1925
- email: _.email,
1926
- phone: _.phone
1929
+ const U = await h.startChannelWithParticipant({
1930
+ id: y.id,
1931
+ name: y.name,
1932
+ email: y.email,
1933
+ phone: y.phone
1927
1934
  });
1928
1935
  try {
1929
- await O.show();
1930
- } catch ($) {
1931
- console.warn("[MessagingShell] Failed to unhide channel:", $);
1936
+ await U.show();
1937
+ } catch (A) {
1938
+ console.warn("[MessagingShell] Failed to unhide channel:", A);
1932
1939
  }
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);
1940
+ z(U), V(!1), ($ = X.current) == null || $.close(), l == null || l(y);
1941
+ } catch (U) {
1942
+ console.error("[MessagingShell] Failed to start conversation:", U);
1936
1943
  }
1937
1944
  },
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();
1945
+ [h, l, M]
1946
+ ), ie = L(() => {
1947
+ var y;
1948
+ V(!1), (y = X.current) == null || y.close();
1949
+ }, []), Ze = L(
1950
+ (y) => {
1951
+ y.target === X.current && ie();
1945
1952
  },
1946
1953
  [ie]
1947
- ), Ze = T(
1948
- async (_) => {
1949
- y && console.log("[MessagingShell] Leaving conversation:", _.id), H(null), j(!1), le.current = null, await te();
1954
+ ), Ye = L(
1955
+ async (y) => {
1956
+ M && console.log("[MessagingShell] Leaving conversation:", y.id), z(null), W(!1), le.current = null, await ne();
1950
1957
  },
1951
- [te, y]
1952
- ), Ye = T(
1953
- async (_) => {
1954
- y && console.log("[MessagingShell] Blocking participant:", _), H(null), j(!1), le.current = null, await te();
1958
+ [ne, M]
1959
+ ), Je = L(
1960
+ async (y) => {
1961
+ M && console.log("[MessagingShell] Blocking participant:", y), z(null), W(!1), le.current = null, await ne();
1955
1962
  },
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(
1963
+ [ne, M]
1964
+ ), ce = !!G;
1965
+ return B ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : I ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(me, { message: I, onBack: T }) }) : !x || !c ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1959
1966
  me,
1960
1967
  {
1961
1968
  message: "Not connected to messaging service",
1962
- onBack: I
1969
+ onBack: T
1963
1970
  }
1964
- ) }) : oe ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: oe }) }) : /* @__PURE__ */ i(
1971
+ ) }) : ae ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(me, { message: ae }) }) : /* @__PURE__ */ i(
1965
1972
  "div",
1966
1973
  {
1967
- className: D(
1974
+ className: R(
1968
1975
  "messaging-shell h-full bg-background-primary overflow-hidden",
1969
1976
  s
1970
1977
  ),
@@ -1973,24 +1980,24 @@ const Dt = ({
1973
1980
  /* @__PURE__ */ e(
1974
1981
  "div",
1975
1982
  {
1976
- className: D(
1983
+ className: R(
1977
1984
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1978
1985
  {
1979
- "!hidden": g === !1 || P,
1986
+ "!hidden": f === !1 || F,
1980
1987
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1981
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": g !== !1 && !P && ce,
1988
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !F && ce,
1982
1989
  // Show on mobile when no channel selected, use same wide width on desktop
1983
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": g !== !1 && !P && !ce
1990
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !F && !ce
1984
1991
  }
1985
1992
  ),
1986
1993
  children: /* @__PURE__ */ e(
1987
- Ue,
1994
+ Be,
1988
1995
  {
1989
- onChannelSelect: Ge,
1990
- selectedChannel: B || void 0,
1991
- filters: He,
1992
- customEmptyStateIndicator: b,
1993
- renderMessagePreview: C
1996
+ onChannelSelect: Ve,
1997
+ selectedChannel: G || void 0,
1998
+ filters: Ge,
1999
+ customEmptyStateIndicator: N,
2000
+ renderMessagePreview: m
1994
2001
  }
1995
2002
  )
1996
2003
  }
@@ -1998,80 +2005,81 @@ const Dt = ({
1998
2005
  /* @__PURE__ */ e(
1999
2006
  "div",
2000
2007
  {
2001
- className: D(
2008
+ className: R(
2002
2009
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2003
2010
  {
2004
2011
  // In direct conversation mode (or waiting for it), always show (full width)
2005
- flex: P || ce || c,
2012
+ flex: F || ce || d,
2006
2013
  // Normal mode: hide on mobile when no channel selected
2007
- "hidden lg:flex": !P && !ce && !c
2014
+ "hidden lg:flex": !F && !ce && !d
2008
2015
  }
2009
2016
  ),
2010
- children: B ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2011
- Ae,
2017
+ children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2018
+ $e,
2012
2019
  {
2013
- channel: B,
2014
- onBack: Ve,
2015
- showBackButton: !P,
2020
+ channel: G,
2021
+ onBack: We,
2022
+ showBackButton: !F,
2016
2023
  renderMessageInputActions: n,
2017
- renderChannelBanner: p,
2018
- onLeaveConversation: Ze,
2019
- onBlockParticipant: Ye,
2024
+ renderChannelBanner: w,
2025
+ onLeaveConversation: Ye,
2026
+ onBlockParticipant: Je,
2020
2027
  CustomChannelEmptyState: u,
2021
- showDeleteConversation: ze,
2022
- onDeleteConversationClick: f,
2023
- onBlockParticipantClick: v,
2024
- onReportParticipantClick: o,
2025
- dmAgentEnabled: M,
2028
+ showDeleteConversation: He,
2029
+ onDeleteConversationClick: C,
2030
+ onBlockParticipantClick: p,
2031
+ onReportParticipantClick: r,
2032
+ dmAgentEnabled: E,
2026
2033
  messageMetadata: S,
2027
- onMessageSent: w,
2028
- showStarButton: E,
2029
- chatbotVotingEnabled: h
2034
+ onMessageSent: v,
2035
+ showStarButton: k,
2036
+ chatbotVotingEnabled: b,
2037
+ customChannelActions: D
2030
2038
  },
2031
- B.id
2032
- ) }) : c ? (
2039
+ G.id
2040
+ ) }) : d ? (
2033
2041
  // Show loading while creating/loading direct conversation channel
2034
2042
  /* @__PURE__ */ e(he, {})
2035
2043
  ) : /* @__PURE__ */ e(
2036
- $e,
2044
+ ze,
2037
2045
  {
2038
- hasChannels: X,
2039
- channelsLoaded: Y
2046
+ hasChannels: ee,
2047
+ channelsLoaded: se
2040
2048
  }
2041
2049
  )
2042
2050
  }
2043
2051
  )
2044
2052
  ] }),
2045
- re && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2053
+ oe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2046
2054
  /* @__PURE__ */ e(
2047
2055
  "dialog",
2048
2056
  {
2049
- ref: se,
2057
+ ref: X,
2050
2058
  className: "mes-dialog",
2051
- onClick: qe,
2059
+ onClick: Ze,
2052
2060
  onClose: ie,
2053
2061
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2054
- vt,
2062
+ wt,
2055
2063
  {
2056
- participantSource: re,
2057
- onSelectParticipant: We,
2064
+ participantSource: oe,
2065
+ onSelectParticipant: qe,
2058
2066
  onClose: ie,
2059
- existingParticipantIds: V,
2060
- participantLabel: ae,
2061
- searchPlaceholder: `Search ${ae}...`
2067
+ existingParticipantIds: J,
2068
+ participantLabel: Ee,
2069
+ searchPlaceholder: `Search ${Ee}...`
2062
2070
  },
2063
- L
2071
+ O
2064
2072
  ) })
2065
2073
  }
2066
2074
  )
2067
2075
  ]
2068
2076
  }
2069
2077
  );
2070
- }, pt = ({
2078
+ }, yt = ({
2071
2079
  question: t,
2072
2080
  onClick: s,
2073
2081
  loading: n = !1,
2074
- className: a
2082
+ className: o
2075
2083
  }) => /* @__PURE__ */ e(
2076
2084
  "button",
2077
2085
  {
@@ -2079,33 +2087,33 @@ const Dt = ({
2079
2087
  onClick: s,
2080
2088
  disabled: n,
2081
2089
  style: { backgroundColor: "#E6E5E3" },
2082
- className: D(
2090
+ className: R(
2083
2091
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
2084
2092
  {
2085
2093
  "hover:brightness-95 active:brightness-90": !n,
2086
2094
  "opacity-50 cursor-not-allowed": n
2087
2095
  },
2088
- a
2096
+ o
2089
2097
  ),
2090
2098
  children: t
2091
2099
  }
2092
- ), Tt = ({
2100
+ ), Ft = ({
2093
2101
  faqs: t,
2094
2102
  onFaqClick: s,
2095
2103
  loadingFaqId: n,
2096
- headerText: a,
2104
+ headerText: o,
2097
2105
  className: l,
2098
- avatarImage: c,
2099
- avatarName: r
2106
+ avatarImage: d,
2107
+ avatarName: a
2100
2108
  }) => {
2101
- const u = t.filter((g) => g.enabled).sort((g, x) => (g.order ?? 0) - (x.order ?? 0));
2109
+ const u = t.filter((f) => f.enabled).sort((f, g) => (f.order ?? 0) - (g.order ?? 0));
2102
2110
  return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2103
- (c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2104
- Q,
2111
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2112
+ K,
2105
2113
  {
2106
- id: r || "account",
2107
- name: r || "Account",
2108
- image: c,
2114
+ id: a || "account",
2115
+ name: a || "Account",
2116
+ image: d,
2109
2117
  size: 24,
2110
2118
  shape: "circle"
2111
2119
  }
@@ -2116,75 +2124,76 @@ const Dt = ({
2116
2124
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
2117
2125
  style: { backgroundColor: "#F1F0EE" },
2118
2126
  children: [
2119
- a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
2120
- u.map((g) => /* @__PURE__ */ e(
2121
- pt,
2127
+ o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2128
+ u.map((f) => /* @__PURE__ */ e(
2129
+ yt,
2122
2130
  {
2123
- question: g.question,
2124
- onClick: () => s(g.id),
2125
- loading: n === g.id
2131
+ question: f.question,
2132
+ onClick: () => s(f.id),
2133
+ loading: n === f.id
2126
2134
  },
2127
- g.id
2135
+ f.id
2128
2136
  ))
2129
2137
  ]
2130
2138
  }
2131
2139
  )
2132
2140
  ] }) });
2133
- }, Ft = (t, s = {}) => {
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) => {
2135
- if (r) return;
2136
- const d = R !== void 0 ? R : b;
2137
- u(!0), x(null);
2141
+ }, Lt = (t, s = {}) => {
2142
+ const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = _([]), [a, u] = _(!1), [f, g] = _(null), [N, C] = _(n), [p, r] = _(!0), [E, S] = _(), v = L(async (w = !1, D) => {
2143
+ if (a) return;
2144
+ const h = D !== void 0 ? D : N;
2145
+ u(!0), g(null);
2138
2146
  try {
2139
- const m = await t.loadParticipants({
2140
- search: d || void 0,
2141
- limit: a,
2142
- cursor: p ? void 0 : M
2147
+ const c = await t.loadParticipants({
2148
+ search: h || void 0,
2149
+ limit: o,
2150
+ cursor: w ? void 0 : E
2143
2151
  });
2144
- c(
2145
- (N) => p ? m.participants : [...N, ...m.participants]
2146
- ), o(m.hasMore), S(m.nextCursor);
2147
- } catch (m) {
2148
- const N = m instanceof Error ? m.message : "Failed to load participants";
2149
- x(N), console.error("[useParticipants] Load error:", m);
2152
+ d(
2153
+ (x) => w ? c.participants : [...x, ...c.participants]
2154
+ ), r(c.hasMore), S(c.nextCursor);
2155
+ } catch (c) {
2156
+ const x = c instanceof Error ? c.message : "Failed to load participants";
2157
+ g(x), console.error("[useParticipants] Load error:", c);
2150
2158
  } finally {
2151
2159
  u(!1);
2152
2160
  }
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);
2159
- }, [w]);
2160
- return q(() => {
2161
- w(!0);
2161
+ }, [t, N, E, o, a]), k = L(() => {
2162
+ p && !a && v(!1);
2163
+ }, [p, a, v]), b = L((w) => {
2164
+ C(w), S(void 0), v(!0, w);
2165
+ }, [v]), m = L(() => {
2166
+ S(void 0), v(!0);
2167
+ }, [v]);
2168
+ return Z(() => {
2169
+ v(!0);
2162
2170
  }, [t.loadParticipants]), {
2163
2171
  participants: l,
2164
- loading: r,
2165
- error: g,
2166
- searchQuery: b,
2167
- hasMore: v,
2172
+ loading: a,
2173
+ error: f,
2174
+ searchQuery: N,
2175
+ hasMore: p,
2168
2176
  totalCount: t.totalCount,
2169
- loadMore: E,
2170
- search: h,
2171
- refresh: C
2177
+ loadMore: k,
2178
+ search: b,
2179
+ refresh: m
2172
2180
  };
2173
2181
  };
2174
2182
  export {
2175
- Q as Avatar,
2176
- ft as ChannelEmptyState,
2177
- Ue as ChannelList,
2178
- Ae as ChannelView,
2179
- Tt as FaqList,
2180
- pt as FaqListItem,
2181
- rt as MessageVoteButtons,
2182
- Rt as MessagingProvider,
2183
- Dt as MessagingShell,
2184
- vt as ParticipantPicker,
2185
- Ws as formatRelativeTime,
2186
- st as useMessageVote,
2187
- Gs as useMessaging,
2188
- Ft as useParticipants
2183
+ de as ActionButton,
2184
+ K as Avatar,
2185
+ gt as ChannelEmptyState,
2186
+ Be as ChannelList,
2187
+ $e as ChannelView,
2188
+ Ft as FaqList,
2189
+ yt as FaqListItem,
2190
+ at as MessageVoteButtons,
2191
+ Dt as MessagingProvider,
2192
+ Tt as MessagingShell,
2193
+ wt as ParticipantPicker,
2194
+ qs as formatRelativeTime,
2195
+ tt as useMessageVote,
2196
+ Vs as useMessaging,
2197
+ Lt as useParticipants
2189
2198
  };
2190
2199
  //# sourceMappingURL=index.js.map