@linktr.ee/messaging-react 1.21.2-rc-1771385662 → 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,105 +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, r = s ? "message-tip-standalone" : "message-tag message-tag--tip", u = c ? s ? `${c} tip` : `Delivered with ${c} tip` : s ? "Tip" : "Delivered with tip";
348
- return /* @__PURE__ */ i("div", { className: r, children: [
349
- /* @__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 }),
350
352
  /* @__PURE__ */ e("span", { children: u })
351
353
  ] });
352
354
  }
353
355
  return /* @__PURE__ */ i("div", { className: "message-tag message-tag--chatbot", children: [
354
- /* @__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, {}) }),
355
357
  /* @__PURE__ */ e("span", { className: "message-tag__label", children: "Chatbot" })
356
358
  ] });
357
- }, Oe = A.memo(
359
+ }, Ue = j.memo(
358
360
  ({
359
361
  channel: t,
360
362
  selectedChannel: s,
361
363
  onChannelSelect: n,
362
- debug: a = !1,
364
+ debug: o = !1,
363
365
  unread: l,
364
- renderMessagePreview: c
366
+ renderMessagePreview: d
365
367
  }) => {
366
- var p, R, d, m, N, U;
367
- 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 = () => {
368
370
  t && n(t);
369
- }, g = (I) => {
370
- const y = I.key === "Enter" || I.key === " ", B = I.repeat;
371
- !y || B || (I.preventDefault(), u());
372
- }, b = Object.values(((p = t == null ? void 0 : t.state) == null ? void 0 : p.members) || {}).find(
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(
373
375
  (I) => {
374
- var y, B;
375
- return ((y = I.user) == null ? void 0 : y.id) && I.user.id !== ((B = t == null ? void 0 : t._client) == null ? void 0 : B.userID);
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);
376
378
  }
377
- ), f = ((R = b == null ? void 0 : b.user) == null ? void 0 : R.name) || "Conversation", v = (d = b == null ? void 0 : b.user) == null ? void 0 : d.image, o = (N = (m = t == null ? void 0 : t.state) == null ? void 0 : m.messages) == null ? void 0 : N[t.state.messages.length - 1], S = (() => {
378
- var y;
379
- if (o != null && o.text) return o.text;
380
- const I = (y = o == null ? void 0 : o.attachments) == null ? void 0 : y[0];
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];
381
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";
382
- })(), w = o != null && o.created_at ? Ws(new Date(o.created_at)) : "", E = o ? ye(o) : !1, h = c ? c(o, S) : `${E ? "✨ " : ""}${S}`, C = l ?? 0;
383
- 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", {
384
386
  channelId: t == null ? void 0 : t.id,
385
- isSelected: r,
386
- participantName: f,
387
- unreadCount: C,
388
- hasTimestamp: !!w
387
+ isSelected: a,
388
+ participantName: C,
389
+ unreadCount: m,
390
+ hasTimestamp: !!v
389
391
  }), /* @__PURE__ */ e(
390
392
  "div",
391
393
  {
392
394
  role: "button",
393
395
  tabIndex: 0,
394
396
  onClick: u,
395
- onKeyDown: g,
396
- className: D(
397
+ onKeyDown: f,
398
+ className: R(
397
399
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
398
400
  {
399
- "bg-primary-alt/10 border-l-4 border-l-primary": r,
400
- "hover:bg-sand": !r
401
+ "bg-primary-alt/10 border-l-4 border-l-primary": a,
402
+ "hover:bg-sand": !a
401
403
  }
402
404
  ),
403
405
  children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
404
406
  /* @__PURE__ */ e(
405
- Q,
407
+ K,
406
408
  {
407
- id: ((U = b == null ? void 0 : b.user) == null ? void 0 : U.id) || t.id || "unknown",
408
- name: f,
409
- 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,
410
412
  size: 44,
411
413
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
412
414
  }
@@ -416,18 +418,18 @@ const Q = ({
416
418
  /* @__PURE__ */ e(
417
419
  "h3",
418
420
  {
419
- className: D(
421
+ className: R(
420
422
  "text-sm font-medium truncate",
421
- r ? "text-primary" : "text-charcoal"
423
+ a ? "text-primary" : "text-charcoal"
422
424
  ),
423
- children: f
425
+ children: C
424
426
  }
425
427
  ),
426
- 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 })
427
429
  ] }),
428
430
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
429
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: h }),
430
- C > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: C > 99 ? "99+" : C })
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 })
431
433
  ] })
432
434
  ] })
433
435
  ] })
@@ -435,48 +437,48 @@ const Q = ({
435
437
  );
436
438
  }
437
439
  );
438
- Oe.displayName = "CustomChannelPreview";
439
- const Ue = A.memo(
440
+ Ue.displayName = "CustomChannelPreview";
441
+ const Be = j.memo(
440
442
  ({
441
443
  onChannelSelect: t,
442
444
  selectedChannel: s,
443
445
  filters: n,
444
- className: a,
446
+ className: o,
445
447
  customEmptyStateIndicator: l,
446
- renderMessagePreview: c
448
+ renderMessagePreview: d
447
449
  }) => {
448
- const r = A.useRef(0);
449
- r.current++;
450
+ const a = j.useRef(0);
451
+ a.current++;
450
452
  const { debug: u = !1 } = fe();
451
453
  u && console.log("📺 [ChannelList] 🔄 RENDER START", {
452
- renderCount: r.current,
454
+ renderCount: a.current,
453
455
  selectedChannelId: s == null ? void 0 : s.id,
454
456
  filters: n
455
457
  });
456
- const g = A.useMemo(() => (b) => /* @__PURE__ */ e(
457
- Oe,
458
+ const f = j.useMemo(() => (N) => /* @__PURE__ */ e(
459
+ Ue,
458
460
  {
459
- ...b,
461
+ ...N,
460
462
  selectedChannel: s,
461
463
  onChannelSelect: t,
462
464
  debug: u,
463
- renderMessagePreview: c
465
+ renderMessagePreview: d
464
466
  }
465
- ), [s, t, u, c]);
467
+ ), [s, t, u, d]);
466
468
  return /* @__PURE__ */ e(
467
469
  "div",
468
470
  {
469
- className: D(
471
+ className: R(
470
472
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
471
- a
473
+ o
472
474
  ),
473
475
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
474
- ss,
476
+ ts,
475
477
  {
476
478
  filters: n,
477
479
  sort: { last_message_at: -1 },
478
480
  options: { limit: 30 },
479
- Preview: g,
481
+ Preview: f,
480
482
  EmptyStateIndicator: l
481
483
  },
482
484
  JSON.stringify(n)
@@ -485,39 +487,39 @@ const Ue = A.memo(
485
487
  );
486
488
  }
487
489
  );
488
- Ue.displayName = "ChannelList";
490
+ Be.displayName = "ChannelList";
489
491
  const de = ({
490
492
  variant: t = "default",
491
493
  className: s,
492
494
  children: n,
493
- ...a
495
+ ...o
494
496
  }) => /* @__PURE__ */ e(
495
497
  "button",
496
498
  {
497
499
  type: "button",
498
- className: D(
500
+ className: R(
499
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",
500
502
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
501
503
  s
502
504
  ),
503
- ...a,
505
+ ...o,
504
506
  children: n
505
507
  }
506
508
  );
507
- function Be({ label: t, className: s, children: n, ...a }) {
509
+ function je({ label: t, className: s, children: n, ...o }) {
508
510
  return /* @__PURE__ */ i(
509
511
  "button",
510
512
  {
511
513
  type: "button",
512
- className: D(
514
+ className: R(
513
515
  "rounded-full p-2 transition-colors focus-ring",
514
516
  {
515
- "cursor-not-allowed opacity-50": a.disabled,
516
- "hover:bg-sand": !a.disabled
517
+ "cursor-not-allowed opacity-50": o.disabled,
518
+ "hover:bg-sand": !o.disabled
517
519
  },
518
520
  s
519
521
  ),
520
- ...a,
522
+ ...o,
521
523
  children: [
522
524
  /* @__PURE__ */ e("span", { className: "sr-only", children: t }),
523
525
  n
@@ -525,41 +527,41 @@ function Be({ label: t, className: s, children: n, ...a }) {
525
527
  }
526
528
  );
527
529
  }
528
- function je({ onClick: t }) {
529
- 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" }) });
530
532
  }
531
- const Ks = (t) => /* @__PURE__ */ e(ts, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
532
- function et(t) {
533
+ const et = (t) => /* @__PURE__ */ e(ns, { ...t, position: "center" }), Ce = "vote_up", Ne = "vote_down";
534
+ function st(t) {
533
535
  return t != null && t.length ? t.some((s) => s.type === Ne) ? "down" : t.some((s) => s.type === Ce) ? "up" : null : null;
534
536
  }
535
- function st(t) {
536
- const { channel: s } = we(), { client: n } = Fe("useMessageVote"), a = be(
537
- () => et(t.own_reactions),
537
+ function tt(t) {
538
+ const { channel: s } = we(), { client: n } = Le("useMessageVote"), o = be(
539
+ () => st(t.own_reactions),
538
540
  [t.own_reactions]
539
- ), l = T(async () => {
541
+ ), l = L(async () => {
540
542
  if (n != null && n.userID)
541
543
  try {
542
- a === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
544
+ o === "up" ? await s.deleteReaction(t.id, Ce) : await s.sendReaction(
543
545
  t.id,
544
546
  { type: Ce },
545
547
  { enforce_unique: !0, skip_push: !0 }
546
548
  );
547
549
  } catch {
548
550
  }
549
- }, [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 () => {
550
552
  if (n != null && n.userID)
551
553
  try {
552
- a === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
554
+ o === "down" ? await s.deleteReaction(t.id, Ne) : await s.sendReaction(
553
555
  t.id,
554
556
  { type: Ne },
555
557
  { enforce_unique: !0, skip_push: !0 }
556
558
  );
557
559
  } catch {
558
560
  }
559
- }, [s, n == null ? void 0 : n.userID, t.id, a]);
560
- 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 };
561
563
  }
562
- 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(
563
565
  "path",
564
566
  {
565
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",
@@ -569,7 +571,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
569
571
  strokeLinejoin: "round",
570
572
  fill: t ? "currentColor" : "none"
571
573
  }
572
- ) }), 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(
573
575
  "path",
574
576
  {
575
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",
@@ -579,7 +581,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
579
581
  strokeLinejoin: "round",
580
582
  fill: t ? "currentColor" : "none"
581
583
  }
582
- ) }), rt = ({
584
+ ) }), at = ({
583
585
  selected: t,
584
586
  onVoteUp: s,
585
587
  onVoteDown: n
@@ -592,7 +594,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
592
594
  onClick: s,
593
595
  "aria-label": "Helpful",
594
596
  "aria-pressed": t === "up",
595
- children: /* @__PURE__ */ e(tt, { filled: t === "up" })
597
+ children: /* @__PURE__ */ e(nt, { filled: t === "up" })
596
598
  }
597
599
  ),
598
600
  /* @__PURE__ */ e(
@@ -603,175 +605,175 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
603
605
  onClick: n,
604
606
  "aria-label": "Not helpful",
605
607
  "aria-pressed": t === "down",
606
- children: /* @__PURE__ */ e(nt, { filled: t === "down" })
608
+ children: /* @__PURE__ */ e(rt, { filled: t === "down" })
607
609
  }
608
610
  )
609
- ] }), at = (t) => {
610
- var re, ae;
611
+ ] }), ot = (t) => {
612
+ var X, oe;
611
613
  const {
612
614
  additionalMessageInputProps: s,
613
615
  chatbotVotingEnabled: n,
614
- editing: a,
616
+ editing: o,
615
617
  endOfGroup: l,
616
- firstOfGroup: c,
617
- groupedByUser: r,
618
+ firstOfGroup: d,
619
+ groupedByUser: a,
618
620
  handleAction: u,
619
- handleOpenThread: g,
620
- handleRetry: x,
621
- highlighted: b,
622
- isMessageAIGenerated: f,
623
- isMyMessage: v,
624
- message: o,
625
- renderText: M,
621
+ handleOpenThread: f,
622
+ handleRetry: g,
623
+ highlighted: N,
624
+ isMessageAIGenerated: C,
625
+ isMyMessage: p,
626
+ message: r,
627
+ renderText: E,
626
628
  threadList: S
627
- } = t, { client: w } = Fe("CustomMessage"), [E, h] = k(!1), C = rs(o.id), { selected: p, voteUp: R, voteDown: d } = st(o), {
628
- Attachment: m = os,
629
- EditMessageModal: N = ls,
630
- MessageBlocked: U = is,
631
- MessageBouncePrompt: I = cs,
632
- MessageDeleted: y = ds,
633
- MessageIsThreadReplyInChannelButtonIndicator: B = us,
634
- MessageRepliesCountButton: H = ms,
635
- ReminderNotification: X = hs,
636
- 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,
637
639
  PinIndicator: Y
638
- } = as("CustomMessage"), ee = gs(o), ne = xs(o), J = be(
639
- () => f == null ? void 0 : f(o),
640
- [f, o]
640
+ } = os("CustomMessage"), se = xs(r), te = bs(r), re = be(
641
+ () => C == null ? void 0 : C(r),
642
+ [C, r]
641
643
  ), V = be(
642
- () => !o.shared_location && !o.attachments ? [] : o.shared_location ? [o.shared_location, ...o.attachments ?? []] : o.attachments,
643
- [o]
644
+ () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
645
+ [r]
644
646
  );
645
- if (bs(o))
647
+ if (Cs(r))
646
648
  return null;
647
- if (o.deleted_at || o.type === "deleted")
648
- return /* @__PURE__ */ e(y, { message: o });
649
- if (Cs(o))
650
- return /* @__PURE__ */ e(U, {});
651
- const F = !S && !!o.reply_count, L = !S && o.show_in_channel && o.parent_id, G = o.status === "failed" && ((re = o.error) == null ? void 0 : re.status) !== 403, P = Ns(o);
652
- let j;
653
- G ? j = () => x(o) : P && (j = () => h(!0));
654
- const oe = D(
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(
655
657
  "str-chat__message str-chat__message-simple",
656
- `str-chat__message--${o.type}`,
657
- `str-chat__message--${o.status}`,
658
- v() ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
659
- o.text ? "str-chat__message--has-text" : "has-no-text",
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",
660
662
  {
661
- "str-chat__message--has-attachment": ee,
662
- "str-chat__message--highlighted": b,
663
- "str-chat__message--pinned pinned-message": o.pinned,
664
- "str-chat__message--with-reactions": ne,
665
- "str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((ae = o == null ? void 0 : o.error) == null ? void 0 : ae.status) !== 403,
666
- "str-chat__message-with-thread-link": F || L,
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,
667
669
  "str-chat__virtual-message__wrapper--end": l,
668
- "str-chat__virtual-message__wrapper--first": c,
669
- "str-chat__virtual-message__wrapper--group": r
670
+ "str-chat__virtual-message__wrapper--first": d,
671
+ "str-chat__virtual-message__wrapper--group": a
670
672
  }
671
- ), 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);
672
674
  return /* @__PURE__ */ i(ve, { children: [
673
- a && /* @__PURE__ */ e(
674
- N,
675
+ o && /* @__PURE__ */ e(
676
+ x,
675
677
  {
676
678
  additionalMessageInputProps: s
677
679
  }
678
680
  ),
679
- E && /* @__PURE__ */ e(
680
- vs,
681
+ k && /* @__PURE__ */ e(
682
+ ws,
681
683
  {
682
684
  MessageBouncePrompt: I,
683
- onClose: () => h(!1),
684
- open: E
685
+ onClose: () => b(!1),
686
+ open: k
685
687
  }
686
688
  ),
687
- /* @__PURE__ */ i("div", { className: oe, children: [
689
+ /* @__PURE__ */ i("div", { className: W, children: [
688
690
  Y && /* @__PURE__ */ e(Y, {}),
689
- !!C && /* @__PURE__ */ e(X, { reminder: C }),
690
- o.user && /* @__PURE__ */ e(
691
- Q,
691
+ !!m && /* @__PURE__ */ e(z, { reminder: m }),
692
+ r.user && /* @__PURE__ */ e(
693
+ K,
692
694
  {
693
695
  className: "str-chat__avatar str-chat__message-sender-avatar",
694
- id: o.user.id,
695
- image: o.user.image,
696
- 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
697
699
  }
698
700
  ),
699
701
  /* @__PURE__ */ e(
700
702
  "div",
701
703
  {
702
- className: D("str-chat__message-inner", {
703
- "str-chat__simple-message--error-failed": G || P
704
+ className: R("str-chat__message-inner", {
705
+ "str-chat__simple-message--error-failed": O || H
704
706
  }),
705
707
  "data-testid": "message-inner",
706
- onClick: j,
707
- onKeyDown: j,
708
- role: j ? "button" : void 0,
709
- tabIndex: j ? 0 : void 0,
708
+ onClick: F,
709
+ onKeyDown: F,
710
+ role: F ? "button" : void 0,
711
+ tabIndex: F ? 0 : void 0,
710
712
  style: {
711
713
  // Force margins to 0 to prevent hover layout shift
712
714
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
713
715
  marginInlineEnd: 0,
714
716
  marginInlineStart: 0
715
717
  },
716
- children: se ? (
718
+ children: Q ? (
717
719
  /* Tip-only messages render as a standalone bubble */
718
- /* @__PURE__ */ e(Te, { message: o, standalone: !0 })
720
+ /* @__PURE__ */ e(Fe, { message: r, standalone: !0 })
719
721
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
720
722
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
721
- Z && /* @__PURE__ */ e(ws, { poll: Z }),
722
- V != null && V.length && !o.quoted_message ? /* @__PURE__ */ e(
723
- m,
723
+ ae && /* @__PURE__ */ e(ps, { poll: ae }),
724
+ V != null && V.length && !r.quoted_message ? /* @__PURE__ */ e(
725
+ c,
724
726
  {
725
727
  actionHandler: u,
726
728
  attachments: V
727
729
  }
728
730
  ) : null,
729
- J ? /* @__PURE__ */ e(
730
- K,
731
+ re ? /* @__PURE__ */ e(
732
+ ee,
731
733
  {
732
- message: o,
733
- renderText: M
734
+ message: r,
735
+ renderText: E
734
736
  }
735
- ) : /* @__PURE__ */ e(ps, { message: o, renderText: M }),
736
- /* @__PURE__ */ e(ys, {})
737
+ ) : /* @__PURE__ */ e(ys, { message: r, renderText: E }),
738
+ /* @__PURE__ */ e(Es, {})
737
739
  ] }),
738
- /* @__PURE__ */ e(Te, { message: o }),
739
- n && ye(o) && /* @__PURE__ */ e(
740
- rt,
740
+ /* @__PURE__ */ e(Fe, { message: r }),
741
+ n && ye(r) && /* @__PURE__ */ e(
742
+ at,
741
743
  {
742
- selected: p,
743
- onVoteUp: R,
744
- onVoteDown: d
744
+ selected: w,
745
+ onVoteUp: D,
746
+ onVoteDown: h
745
747
  }
746
748
  )
747
749
  ] })
748
750
  }
749
751
  ),
750
- F && /* @__PURE__ */ e(
751
- H,
752
+ J && /* @__PURE__ */ e(
753
+ G,
752
754
  {
753
- onClick: g,
754
- reply_count: o.reply_count
755
+ onClick: f,
756
+ reply_count: r.reply_count
755
757
  }
756
758
  ),
757
- L && /* @__PURE__ */ e(B, {})
758
- ] }, o.id)
759
+ P && /* @__PURE__ */ e(M, {})
760
+ ] }, r.id)
759
761
  ] });
760
- }, ot = A.memo(
761
- at,
762
- ns
763
- ), lt = (t) => {
764
- const s = Es("CustomMessage");
765
- return /* @__PURE__ */ e(ot, { ...s, ...t });
766
- }, 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) => ({
767
769
  linkPreviews: Array.from(t.previews.values()).filter(
768
- (s) => Re.previewIsLoaded(s) || Re.previewIsLoading(s)
770
+ (s) => De.previewIsLoaded(s) || De.previewIsLoading(s)
769
771
  )
770
- }), ct = ({
772
+ }), dt = ({
771
773
  link: t,
772
774
  onDismiss: s
773
775
  }) => {
774
- const { og_scrape_url: n, title: a, image_url: l } = t;
776
+ const { og_scrape_url: n, title: o, image_url: l } = t;
775
777
  return /* @__PURE__ */ i(
776
778
  "a",
777
779
  {
@@ -784,7 +786,7 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
784
786
  "img",
785
787
  {
786
788
  src: l,
787
- alt: a || "",
789
+ alt: o || "",
788
790
  className: "h-[148px] w-full rounded-[20px] object-cover"
789
791
  }
790
792
  ),
@@ -792,8 +794,8 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
792
794
  "button",
793
795
  {
794
796
  type: "button",
795
- onClick: (r) => {
796
- r.preventDefault(), s(n);
797
+ onClick: (a) => {
798
+ a.preventDefault(), s(n);
797
799
  },
798
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",
799
801
  "aria-label": "Close link preview",
@@ -801,38 +803,38 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
801
803
  }
802
804
  ),
803
805
  /* @__PURE__ */ i("div", { className: "p-2", children: [
804
- 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 }),
805
807
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
806
808
  ] })
807
809
  ]
808
810
  }
809
811
  );
810
- }, dt = () => {
811
- const { linkPreviewsManager: t } = Is(), { linkPreviews: s } = _s(
812
+ }, ut = () => {
813
+ const { linkPreviewsManager: t } = _s(), { linkPreviews: s } = Ss(
812
814
  t.state,
813
- it
815
+ ct
814
816
  ), n = (l) => {
815
817
  t.dismissPreview(l);
816
818
  };
817
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(
818
- ct,
820
+ dt,
819
821
  {
820
822
  link: l,
821
823
  onDismiss: n
822
824
  },
823
825
  l.og_scrape_url
824
826
  )) }) : null;
825
- }, ut = () => {
826
- const { handleSubmit: t } = Ms(), s = ks();
827
+ }, mt = () => {
828
+ const { handleSubmit: t } = ks(), s = Rs();
827
829
  return /* @__PURE__ */ i(ve, { children: [
828
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Rs, {}) }),
830
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ds, {}) }),
829
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: [
830
- /* @__PURE__ */ e(Ds, {}),
831
- /* @__PURE__ */ e(dt, {}),
832
832
  /* @__PURE__ */ e(Ts, {}),
833
+ /* @__PURE__ */ e(ut, {}),
834
+ /* @__PURE__ */ e(Fs, {}),
833
835
  /* @__PURE__ */ i("div", { className: "flex", children: [
834
836
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
835
- Fs,
837
+ Ls,
836
838
  {
837
839
  className: "w-full resize-none outline-none leading-6",
838
840
  autoFocus: !0,
@@ -848,18 +850,18 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
848
850
  disabled: !s,
849
851
  onClick: t,
850
852
  type: "button",
851
- children: /* @__PURE__ */ e(As, { className: "size-4" })
853
+ children: /* @__PURE__ */ e($s, { className: "size-4" })
852
854
  }
853
855
  )
854
856
  ] })
855
857
  ] })
856
858
  ] });
857
- }, mt = ({
859
+ }, ht = ({
858
860
  renderActions: t
859
861
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
860
862
  t && (t == null ? void 0 : t()),
861
- /* @__PURE__ */ e(Ss, { Input: ut })
862
- ] }), ht = (t) => {
863
+ /* @__PURE__ */ e(Ms, { Input: mt })
864
+ ] }), ft = (t) => {
863
865
  const s = t.message.hide_date === !0;
864
866
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
865
867
  /* @__PURE__ */ i("div", { className: "str-chat__message--system__text", children: [
@@ -867,12 +869,12 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
867
869
  /* @__PURE__ */ e("p", { children: t.message.text }),
868
870
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
869
871
  ] }),
870
- !s && /* @__PURE__ */ e(Ls, { message: t.message })
872
+ !s && /* @__PURE__ */ e(Ps, { message: t.message })
871
873
  ] });
872
- }, ft = () => null, gt = ({ className: t, message: s }) => /* @__PURE__ */ i(
874
+ }, gt = () => null, xt = ({ className: t, message: s }) => /* @__PURE__ */ i(
873
875
  "div",
874
876
  {
875
- className: D("flex items-center justify-center h-full", t),
877
+ className: R("flex items-center justify-center h-full", t),
876
878
  children: [
877
879
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
878
880
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -912,45 +914,45 @@ const tt = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
912
914
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
913
915
  ]
914
916
  }
915
- ), he = A.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
916
- /* @__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" }),
917
919
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
918
920
  ] }) }));
919
921
  he.displayName = "LoadingState";
920
- const xt = ({
922
+ const bt = ({
921
923
  onBack: t,
922
924
  showBackButton: s,
923
925
  onShowInfo: n,
924
- canShowInfo: a,
926
+ canShowInfo: o,
925
927
  showStarButton: l = !1
926
928
  }) => {
927
- var v, o, M, S, w, E;
928
- const { channel: c } = we(), r = A.useMemo(() => Object.values(c.state.members || {}).find(
929
- (C) => {
930
- var p;
931
- return ((p = C.user) == null ? void 0 : p.id) && C.user.id !== c._client.userID;
929
+ 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;
932
934
  }
933
- ), [c._client.userID, c.state.members]), u = ((v = r == null ? void 0 : r.user) == null ? void 0 : v.name) || ((o = r == null ? void 0 : r.user) == null ? void 0 : o.id) || "Unknown member", g = (M = r == null ? void 0 : r.user) == null ? void 0 : M.image, [x, b] = k(
934
- !!((S = c.state.membership) != null && S.pinned_at)
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)
935
937
  );
936
- q(() => {
937
- const h = (C) => {
938
- var p;
939
- b(
940
- C != null && C.member ? !!C.member.pinned_at : !!((p = c.state.membership) != null && p.pinned_at)
938
+ 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)
941
943
  );
942
944
  };
943
- return c.on("member.updated", h), () => {
944
- c.off("member.updated", h);
945
+ return d.on("member.updated", b), () => {
946
+ d.off("member.updated", b);
945
947
  };
946
- }, [c]);
947
- const f = async () => {
948
+ }, [d]);
949
+ const C = async () => {
948
950
  try {
949
- x ? await c.unpin() : await c.pin();
950
- } catch (h) {
951
+ g ? await d.unpin() : await d.pin();
952
+ } catch (b) {
951
953
  console.error(
952
954
  "[CustomChannelHeader] Failed to update pinned status:",
953
- h
955
+ b
954
956
  );
955
957
  }
956
958
  };
@@ -959,23 +961,23 @@ const xt = ({
959
961
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
960
962
  "button",
961
963
  {
962
- className: D(
964
+ className: R(
963
965
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
964
966
  ),
965
967
  onClick: t || (() => {
966
968
  }),
967
969
  type: "button",
968
970
  "aria-label": "Back to conversations",
969
- children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
971
+ children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
970
972
  }
971
973
  ) }),
972
974
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
973
975
  /* @__PURE__ */ e(
974
- Q,
976
+ K,
975
977
  {
976
- 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",
977
979
  name: u,
978
- image: g,
980
+ image: f,
979
981
  size: 40
980
982
  }
981
983
  ),
@@ -986,17 +988,17 @@ const xt = ({
986
988
  "button",
987
989
  {
988
990
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
989
- onClick: f,
991
+ onClick: C,
990
992
  type: "button",
991
- "aria-label": x ? "Unstar conversation" : "Star conversation",
993
+ "aria-label": g ? "Unstar conversation" : "Star conversation",
992
994
  children: /* @__PURE__ */ e(
993
- _e,
995
+ Se,
994
996
  {
995
- className: D("size-5", {
996
- "text-yellow-600": x,
997
- "text-black/90": !x
997
+ className: R("size-5", {
998
+ "text-yellow-600": g,
999
+ "text-black/90": !g
998
1000
  }),
999
- weight: x ? "duotone" : "regular"
1001
+ weight: g ? "duotone" : "regular"
1000
1002
  }
1001
1003
  )
1002
1004
  }
@@ -1008,7 +1010,7 @@ const xt = ({
1008
1010
  onClick: n,
1009
1011
  type: "button",
1010
1012
  "aria-label": "Show info",
1011
- children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
1013
+ children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
1012
1014
  }
1013
1015
  )
1014
1016
  ] })
@@ -1022,15 +1024,15 @@ const xt = ({
1022
1024
  onClick: t,
1023
1025
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1024
1026
  "aria-label": "Back to conversations",
1025
- children: /* @__PURE__ */ e(Ie, { className: "size-5 text-black/90" })
1027
+ children: /* @__PURE__ */ e(_e, { className: "size-5 text-black/90" })
1026
1028
  }
1027
1029
  ),
1028
1030
  /* @__PURE__ */ e(
1029
- Q,
1031
+ K,
1030
1032
  {
1031
- 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",
1032
1034
  name: u,
1033
- image: g,
1035
+ image: f,
1034
1036
  size: 40
1035
1037
  }
1036
1038
  ),
@@ -1041,115 +1043,116 @@ const xt = ({
1041
1043
  "button",
1042
1044
  {
1043
1045
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1044
- onClick: f,
1046
+ onClick: C,
1045
1047
  type: "button",
1046
- "aria-label": x ? "Unstar conversation" : "Star conversation",
1048
+ "aria-label": g ? "Unstar conversation" : "Star conversation",
1047
1049
  children: /* @__PURE__ */ e(
1048
- _e,
1050
+ Se,
1049
1051
  {
1050
- className: D("size-5", {
1051
- "text-yellow-600": x,
1052
- "text-black/90": !x
1052
+ className: R("size-5", {
1053
+ "text-yellow-600": g,
1054
+ "text-black/90": !g
1053
1055
  }),
1054
- weight: x ? "duotone" : "regular"
1056
+ weight: g ? "duotone" : "regular"
1055
1057
  }
1056
1058
  )
1057
1059
  }
1058
1060
  ),
1059
- a && n && /* @__PURE__ */ e(
1061
+ o && n && /* @__PURE__ */ e(
1060
1062
  "button",
1061
1063
  {
1062
1064
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
1063
1065
  onClick: n,
1064
1066
  type: "button",
1065
1067
  "aria-label": "Show info",
1066
- children: /* @__PURE__ */ e(Se, { className: "size-5 text-black/90" })
1068
+ children: /* @__PURE__ */ e(Me, { className: "size-5 text-black/90" })
1067
1069
  }
1068
1070
  )
1069
1071
  ] })
1070
1072
  ] })
1071
1073
  ] });
1072
- }, bt = ({
1074
+ }, Ct = ({
1073
1075
  dialogRef: t,
1074
1076
  onClose: s,
1075
1077
  participant: n,
1076
- channel: a,
1078
+ channel: o,
1077
1079
  followerStatusLabel: l,
1078
- onLeaveConversation: c,
1079
- onBlockParticipant: r,
1080
+ onLeaveConversation: d,
1081
+ onBlockParticipant: a,
1080
1082
  showDeleteConversation: u = !0,
1081
- onDeleteConversationClick: g,
1082
- onBlockParticipantClick: x,
1083
- onReportParticipantClick: b
1083
+ onDeleteConversationClick: f,
1084
+ onBlockParticipantClick: g,
1085
+ onReportParticipantClick: N,
1086
+ customChannelActions: C
1084
1087
  }) => {
1085
- var X, K, Y, ee, ne, J, V;
1086
- const { service: f, debug: v } = fe(), [o, M] = k(!1), [S, w] = k(!1), [E, h] = k(!1), C = T(async () => {
1087
- var F;
1088
- if (!(!f || !((F = n == null ? void 0 : n.user) != null && F.id)))
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)))
1089
1092
  try {
1090
- const G = (await f.getBlockedUsers()).some(
1091
- (P) => {
1092
- var j;
1093
- return P.blocked_user_id === ((j = n == null ? void 0 : n.user) == null ? void 0 : j.id);
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);
1094
1097
  }
1095
1098
  );
1096
- M(G);
1097
- } catch (L) {
1099
+ S(H);
1100
+ } catch (O) {
1098
1101
  console.error(
1099
1102
  "[ChannelInfoDialog] Failed to check blocked status:",
1100
- L
1103
+ O
1101
1104
  );
1102
1105
  }
1103
- }, [f, (X = n == null ? void 0 : n.user) == null ? void 0 : X.id]);
1104
- q(() => {
1105
- C();
1106
- }, [C]);
1107
- const p = async () => {
1108
- var F;
1109
- if (!S) {
1110
- g == null || g(), v && console.log("[ChannelInfoDialog] Leave conversation", a.cid), w(!0);
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);
1111
1114
  try {
1112
- const L = ((F = a._client) == null ? void 0 : F.userID) ?? null;
1113
- await a.hide(L, !1), c && await c(a), s();
1114
- } catch (L) {
1115
- console.error("[ChannelInfoDialog] Failed to leave conversation", L);
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);
1116
1119
  } finally {
1117
- w(!1);
1120
+ k(!1);
1118
1121
  }
1119
1122
  }
1120
- }, R = async () => {
1121
- var F, L, G;
1122
- if (!(E || !f)) {
1123
- x == null || x(), v && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), h(!0);
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);
1124
1127
  try {
1125
- await f.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), r && await r((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1126
- } catch (P) {
1127
- console.error("[ChannelInfoDialog] Failed to block member", P);
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);
1128
1131
  } finally {
1129
- h(!1);
1132
+ m(!1);
1130
1133
  }
1131
1134
  }
1132
- }, d = async () => {
1133
- var F, L, G;
1134
- if (!(E || !f)) {
1135
- x == null || x(), v && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), h(!0);
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);
1136
1139
  try {
1137
- await f.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), r && await r((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1138
- } catch (P) {
1139
- console.error("[ChannelInfoDialog] Failed to unblock member", P);
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);
1140
1143
  } finally {
1141
- h(!1);
1144
+ m(!1);
1142
1145
  }
1143
1146
  }
1144
- }, m = () => {
1145
- b == null || b(), s(), window.open(
1147
+ }, x = () => {
1148
+ N == null || N(), s(), window.open(
1146
1149
  "https://linktr.ee/s/about/trust-center/report",
1147
1150
  "_blank",
1148
1151
  "noopener,noreferrer"
1149
1152
  );
1150
1153
  };
1151
1154
  if (!n) return null;
1152
- const N = ((K = n.user) == null ? void 0 : K.name) || ((Y = n.user) == null ? void 0 : Y.id) || "Unknown member", U = (ee = n.user) == null ? void 0 : ee.image, I = (ne = n.user) == null ? void 0 : ne.email, y = (J = n.user) == null ? void 0 : J.username, B = I || (y ? `linktr.ee/${y}` : void 0), H = ((V = n.user) == null ? void 0 : V.id) || "unknown";
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";
1153
1156
  return (
1154
1157
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1155
1158
  /* @__PURE__ */ e(
@@ -1158,13 +1161,13 @@ const xt = ({
1158
1161
  ref: t,
1159
1162
  className: "mes-dialog group",
1160
1163
  onClose: s,
1161
- onClick: (F) => {
1162
- F.target === t.current && s();
1164
+ onClick: (P) => {
1165
+ P.target === t.current && s();
1163
1166
  },
1164
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: [
1165
1168
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
1166
1169
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
1167
- /* @__PURE__ */ e(je, { onClick: s })
1170
+ /* @__PURE__ */ e(Ae, { onClick: s })
1168
1171
  ] }),
1169
1172
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
1170
1173
  /* @__PURE__ */ e(
@@ -1174,18 +1177,18 @@ const xt = ({
1174
1177
  style: { backgroundColor: "#FBFAF9" },
1175
1178
  children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
1176
1179
  /* @__PURE__ */ e(
1177
- Q,
1180
+ K,
1178
1181
  {
1179
- id: H,
1180
- name: N,
1181
- image: U,
1182
+ id: z,
1183
+ name: B,
1184
+ image: I,
1182
1185
  size: 88,
1183
1186
  shape: "circle"
1184
1187
  }
1185
1188
  ),
1186
1189
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1187
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: N }),
1188
- B && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: B }),
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 }),
1189
1192
  l && /* @__PURE__ */ e(
1190
1193
  "span",
1191
1194
  {
@@ -1208,101 +1211,103 @@ const xt = ({
1208
1211
  u && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
1209
1212
  de,
1210
1213
  {
1211
- onClick: p,
1212
- disabled: S,
1213
- "aria-busy": S,
1214
+ onClick: D,
1215
+ disabled: v,
1216
+ "aria-busy": v,
1214
1217
  children: [
1215
- 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" }),
1216
1219
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1217
1220
  ]
1218
1221
  }
1219
1222
  ) }),
1220
- /* @__PURE__ */ e("li", { children: o ? /* @__PURE__ */ i(
1223
+ /* @__PURE__ */ e("li", { children: E ? /* @__PURE__ */ i(
1221
1224
  de,
1222
1225
  {
1223
- onClick: d,
1224
- disabled: E,
1225
- "aria-busy": E,
1226
+ onClick: c,
1227
+ disabled: b,
1228
+ "aria-busy": b,
1226
1229
  children: [
1227
- 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" }),
1228
1231
  /* @__PURE__ */ e("span", { children: "Unblock" })
1229
1232
  ]
1230
1233
  }
1231
1234
  ) : /* @__PURE__ */ i(
1232
1235
  de,
1233
1236
  {
1234
- onClick: R,
1235
- disabled: E,
1236
- "aria-busy": E,
1237
+ onClick: h,
1238
+ disabled: b,
1239
+ "aria-busy": b,
1237
1240
  children: [
1238
- 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" }),
1239
1242
  /* @__PURE__ */ e("span", { children: "Block" })
1240
1243
  ]
1241
1244
  }
1242
1245
  ) }),
1243
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(de, { variant: "danger", onClick: m, children: [
1244
- /* @__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" }),
1245
1248
  /* @__PURE__ */ e("span", { children: "Report" })
1246
- ] }) })
1249
+ ] }) }),
1250
+ C
1247
1251
  ] })
1248
1252
  ] })
1249
1253
  ] })
1250
1254
  }
1251
1255
  )
1252
1256
  );
1253
- }, Ct = ({
1257
+ }, Nt = ({
1254
1258
  onBack: t,
1255
1259
  showBackButton: s,
1256
1260
  renderMessageInputActions: n,
1257
- onLeaveConversation: a,
1261
+ onLeaveConversation: o,
1258
1262
  onBlockParticipant: l,
1259
- showDeleteConversation: c = !0,
1260
- onDeleteConversationClick: r,
1263
+ showDeleteConversation: d = !0,
1264
+ onDeleteConversationClick: a,
1261
1265
  onBlockParticipantClick: u,
1262
- onReportParticipantClick: g,
1263
- showStarButton: x = !1,
1264
- chatbotVotingEnabled: b = !1,
1265
- renderChannelBanner: f
1266
+ onReportParticipantClick: f,
1267
+ showStarButton: g = !1,
1268
+ chatbotVotingEnabled: N = !1,
1269
+ renderChannelBanner: C,
1270
+ customChannelActions: p
1266
1271
  }) => {
1267
- const { channel: v } = we(), o = W(null), M = A.useMemo(() => Object.values(v.state.members || {}).find(
1268
- (C) => {
1269
- var p;
1270
- return ((p = C.user) == null ? void 0 : p.id) && C.user.id !== v._client.userID;
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;
1271
1276
  }
1272
- ), [v._client.userID, v.state.members]), S = A.useMemo(() => {
1273
- const h = v.data ?? {};
1274
- if (h.followerStatus)
1275
- return String(h.followerStatus);
1276
- if (h.isFollower !== void 0)
1277
- return h.isFollower ? "Subscribed to you" : "Not subscribed";
1278
- }, [v.data]), w = T(() => {
1279
- var h;
1280
- (h = o.current) == null || h.showModal();
1281
- }, []), E = T(() => {
1282
- var h;
1283
- (h = o.current) == null || h.close();
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();
1284
1289
  }, []);
1285
1290
  return /* @__PURE__ */ i(ve, { children: [
1286
1291
  /* @__PURE__ */ e(
1287
- Os,
1292
+ Us,
1288
1293
  {
1289
1294
  overrides: {
1290
- Message: (h) => /* @__PURE__ */ e(lt, { ...h, chatbotVotingEnabled: b })
1295
+ Message: (m) => /* @__PURE__ */ e(it, { ...m, chatbotVotingEnabled: N })
1291
1296
  },
1292
- children: /* @__PURE__ */ i(Us, { children: [
1297
+ children: /* @__PURE__ */ i(Bs, { children: [
1293
1298
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1294
- xt,
1299
+ bt,
1295
1300
  {
1296
1301
  onBack: t,
1297
1302
  showBackButton: s,
1298
- onShowInfo: w,
1299
- canShowInfo: !!M,
1300
- showStarButton: x
1303
+ onShowInfo: k,
1304
+ canShowInfo: !!S,
1305
+ showStarButton: g
1301
1306
  }
1302
1307
  ) }),
1303
- f == null ? void 0 : f(),
1308
+ C == null ? void 0 : C(),
1304
1309
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1305
- Bs,
1310
+ js,
1306
1311
  {
1307
1312
  hideDeletedMessages: !0,
1308
1313
  hideNewMessageSeparator: !1,
@@ -1310,104 +1315,107 @@ const xt = ({
1310
1315
  }
1311
1316
  ) }),
1312
1317
  /* @__PURE__ */ e(
1313
- mt,
1318
+ ht,
1314
1319
  {
1315
- renderActions: () => n == null ? void 0 : n(v)
1320
+ renderActions: () => n == null ? void 0 : n(r)
1316
1321
  }
1317
1322
  )
1318
1323
  ] })
1319
1324
  }
1320
1325
  ),
1321
1326
  /* @__PURE__ */ e(
1322
- bt,
1327
+ Ct,
1323
1328
  {
1324
- dialogRef: o,
1325
- onClose: E,
1326
- participant: M,
1327
- channel: v,
1328
- followerStatusLabel: S,
1329
- onLeaveConversation: a,
1329
+ dialogRef: E,
1330
+ onClose: b,
1331
+ participant: S,
1332
+ channel: r,
1333
+ followerStatusLabel: v,
1334
+ onLeaveConversation: o,
1330
1335
  onBlockParticipant: l,
1331
- showDeleteConversation: c,
1332
- onDeleteConversationClick: r,
1336
+ showDeleteConversation: d,
1337
+ onDeleteConversationClick: a,
1333
1338
  onBlockParticipantClick: u,
1334
- onReportParticipantClick: g
1339
+ onReportParticipantClick: f,
1340
+ customChannelActions: p
1335
1341
  }
1336
1342
  )
1337
1343
  ] });
1338
- }, Ae = A.memo(
1344
+ }, $e = j.memo(
1339
1345
  ({
1340
1346
  channel: t,
1341
1347
  onBack: s,
1342
1348
  showBackButton: n = !1,
1343
- renderMessageInputActions: a,
1349
+ renderMessageInputActions: o,
1344
1350
  onLeaveConversation: l,
1345
- onBlockParticipant: c,
1346
- className: r,
1347
- CustomChannelEmptyState: u = ft,
1348
- showDeleteConversation: g = !0,
1349
- onDeleteConversationClick: x,
1350
- onBlockParticipantClick: b,
1351
- onReportParticipantClick: f,
1352
- dmAgentEnabled: v,
1353
- messageMetadata: o,
1354
- 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,
1355
1361
  showStarButton: S = !1,
1356
- chatbotVotingEnabled: w = !1,
1357
- renderChannelBanner: E
1362
+ chatbotVotingEnabled: v = !1,
1363
+ renderChannelBanner: k,
1364
+ customChannelActions: b
1358
1365
  }) => {
1359
- const h = T(
1360
- async (C, p, R) => {
1361
- var y;
1362
- const d = ((y = t.data) == null ? void 0 : y.chatbot_paused) === !0, m = v && !d, N = {
1363
- ...p,
1364
- ...m && { silent: !0 },
1365
- ...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 && {
1366
1373
  metadata: {
1367
- ...p.metadata ?? {},
1368
- ...o
1374
+ ...D.metadata ?? {},
1375
+ ...r
1369
1376
  }
1370
1377
  }
1371
- }, U = {
1372
- ...R,
1373
- ...m && { skip_push: !0 }
1374
- }, I = await t.sendMessage(N, U);
1375
- 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;
1376
1383
  },
1377
- [t, v, o, M]
1384
+ [t, p, r, E]
1378
1385
  );
1379
1386
  return /* @__PURE__ */ e(
1380
1387
  "div",
1381
1388
  {
1382
- className: D(
1389
+ className: R(
1383
1390
  "messaging-channel-view h-full flex flex-col",
1384
- r
1391
+ a
1385
1392
  ),
1386
1393
  children: /* @__PURE__ */ e(
1387
- Ps,
1394
+ Os,
1388
1395
  {
1389
1396
  channel: t,
1390
- MessageSystem: ht,
1397
+ MessageSystem: ft,
1391
1398
  EmptyStateIndicator: u,
1392
1399
  LoadingIndicator: he,
1393
- DateSeparator: Ks,
1394
- doSendMessageRequest: h,
1400
+ DateSeparator: et,
1401
+ doSendMessageRequest: m,
1395
1402
  children: /* @__PURE__ */ e(
1396
- Ct,
1403
+ Nt,
1397
1404
  {
1398
1405
  onBack: s,
1399
1406
  showBackButton: n,
1400
- renderMessageInputActions: a,
1407
+ renderMessageInputActions: o,
1401
1408
  onLeaveConversation: l,
1402
- onBlockParticipant: c,
1409
+ onBlockParticipant: d,
1403
1410
  CustomChannelEmptyState: u,
1404
- showDeleteConversation: g,
1405
- onDeleteConversationClick: x,
1406
- onBlockParticipantClick: b,
1407
- onReportParticipantClick: f,
1411
+ showDeleteConversation: f,
1412
+ onDeleteConversationClick: g,
1413
+ onBlockParticipantClick: N,
1414
+ onReportParticipantClick: C,
1408
1415
  showStarButton: S,
1409
- chatbotVotingEnabled: w,
1410
- renderChannelBanner: E
1416
+ chatbotVotingEnabled: v,
1417
+ renderChannelBanner: k,
1418
+ customChannelActions: b
1411
1419
  }
1412
1420
  )
1413
1421
  }
@@ -1416,16 +1424,16 @@ const xt = ({
1416
1424
  );
1417
1425
  }
1418
1426
  );
1419
- Ae.displayName = "ChannelView";
1420
- function Nt({
1427
+ $e.displayName = "ChannelView";
1428
+ function vt({
1421
1429
  searchQuery: t,
1422
1430
  setSearchQuery: s,
1423
1431
  placeholder: n
1424
1432
  }) {
1425
- const a = W(null);
1433
+ const o = q(null);
1426
1434
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1427
1435
  /* @__PURE__ */ e(
1428
- Hs,
1436
+ Gs,
1429
1437
  {
1430
1438
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1431
1439
  weight: "bold"
@@ -1434,7 +1442,7 @@ function Nt({
1434
1442
  /* @__PURE__ */ e(
1435
1443
  "input",
1436
1444
  {
1437
- ref: a,
1445
+ ref: o,
1438
1446
  type: "text",
1439
1447
  placeholder: n,
1440
1448
  value: t,
@@ -1443,12 +1451,12 @@ function Nt({
1443
1451
  }
1444
1452
  ),
1445
1453
  t && /* @__PURE__ */ e(
1446
- Be,
1454
+ je,
1447
1455
  {
1448
1456
  label: "Clear search",
1449
1457
  onClick: () => {
1450
1458
  var l;
1451
- s(""), (l = a.current) == null || l.focus();
1459
+ s(""), (l = o.current) == null || l.focus();
1452
1460
  },
1453
1461
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1454
1462
  children: /* @__PURE__ */ e(pe, { className: "h-4 w-4", weight: "bold" })
@@ -1456,144 +1464,144 @@ function Nt({
1456
1464
  )
1457
1465
  ] });
1458
1466
  }
1459
- const vt = ({
1467
+ const wt = ({
1460
1468
  participantSource: t,
1461
1469
  onSelectParticipant: s,
1462
1470
  onClose: n,
1463
- existingParticipantIds: a = /* @__PURE__ */ new Set(),
1471
+ existingParticipantIds: o = /* @__PURE__ */ new Set(),
1464
1472
  participantLabel: l = "participants",
1465
- searchPlaceholder: c = "Search participants...",
1466
- className: r
1473
+ searchPlaceholder: d = "Search participants...",
1474
+ className: a
1467
1475
  }) => {
1468
- 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] = _(
1469
1477
  null
1470
- ), h = W(!1);
1471
- q(() => {
1478
+ ), b = q(!1);
1479
+ Z(() => {
1472
1480
  if (t.loading) {
1473
1481
  u && console.log(
1474
1482
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1475
1483
  );
1476
1484
  return;
1477
1485
  }
1478
- if (h.current) return;
1486
+ if (b.current) return;
1479
1487
  (async () => {
1480
- u && console.log("[ParticipantPicker] Loading initial participants..."), o(!0), S(null);
1488
+ u && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), S(null);
1481
1489
  try {
1482
- const m = await t.loadParticipants({
1490
+ const c = await t.loadParticipants({
1483
1491
  search: "",
1484
1492
  // Load all participants initially
1485
1493
  limit: 100
1486
1494
  });
1487
- f(m.participants), h.current = !0, u && console.log(
1495
+ C(c.participants), b.current = !0, u && console.log(
1488
1496
  "[ParticipantPicker] Participants loaded successfully:",
1489
- m.participants.length
1497
+ c.participants.length
1490
1498
  );
1491
- } catch (m) {
1492
- const N = m instanceof Error ? m.message : "Failed to load participants";
1493
- 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);
1494
1502
  } finally {
1495
- o(!1);
1503
+ r(!1);
1496
1504
  }
1497
1505
  })();
1498
1506
  }, [t.loading, u]);
1499
- const C = b.filter((d) => !a.has(d.id)).filter((d) => {
1500
- var N;
1501
- if (!g) return !0;
1502
- const m = g.toLowerCase();
1503
- return d.name.toLowerCase().includes(m) || ((N = d.email) == null ? void 0 : N.toLowerCase().includes(m)) || !1;
1504
- }), p = T(
1505
- async (d) => {
1506
- if (!w) {
1507
- 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);
1508
1516
  try {
1509
- await s(d);
1510
- } catch (m) {
1511
- 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);
1512
1520
  }
1513
1521
  }
1514
1522
  },
1515
- [s, w]
1516
- ), R = (d, m) => {
1517
- (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));
1518
1526
  };
1519
- 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: [
1520
1528
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1521
1529
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1522
1530
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1523
- /* @__PURE__ */ e(je, { onClick: n })
1531
+ /* @__PURE__ */ e(Ae, { onClick: n })
1524
1532
  ] }),
1525
1533
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1526
1534
  "Select a ",
1527
1535
  l.slice(0, -1),
1528
1536
  " to start messaging (",
1529
- C.length,
1537
+ m.length,
1530
1538
  " available)",
1531
1539
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1532
1540
  ] }),
1533
1541
  /* @__PURE__ */ e(
1534
- Nt,
1542
+ vt,
1535
1543
  {
1536
- searchQuery: g,
1537
- setSearchQuery: x,
1538
- placeholder: c
1544
+ searchQuery: f,
1545
+ setSearchQuery: g,
1546
+ placeholder: d
1539
1547
  }
1540
1548
  )
1541
1549
  ] }),
1542
- 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: [
1543
1551
  "Error loading ",
1544
1552
  l,
1545
1553
  ": ",
1546
- M
1554
+ E
1547
1555
  ] }),
1548
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
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: [
1549
1557
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1550
1558
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1551
1559
  "Loading ",
1552
1560
  l,
1553
1561
  "..."
1554
1562
  ] })
1555
- ] }) }) : C.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1556
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(ke, { className: "h-8 w-8 text-charcoal" }) }),
1557
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1558
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
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` })
1559
1567
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1560
- C.map((d) => {
1561
- 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;
1562
1570
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1563
1571
  "button",
1564
1572
  {
1565
1573
  type: "button",
1566
- onClick: () => p(d),
1567
- onKeyDown: (U) => R(U, d),
1574
+ onClick: () => w(h),
1575
+ onKeyDown: (B) => D(B, h),
1568
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",
1569
1577
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1570
1578
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1571
1579
  /* @__PURE__ */ e(
1572
- Q,
1580
+ K,
1573
1581
  {
1574
- id: d.id,
1575
- name: m,
1576
- image: d.image,
1582
+ id: h.id,
1583
+ name: c,
1584
+ image: h.image,
1577
1585
  size: 40
1578
1586
  }
1579
1587
  ),
1580
1588
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1581
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1582
- 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 })
1583
1591
  ] })
1584
1592
  ] }),
1585
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === d.id ? /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone" }) })
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" }) })
1586
1594
  ] })
1587
1595
  }
1588
- ) }, d.id);
1596
+ ) }, h.id);
1589
1597
  }),
1590
- 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: [
1591
1599
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1592
1600
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1593
1601
  ] }) })
1594
1602
  ] }) })
1595
1603
  ] });
1596
- }, wt = ({ className: t }) => /* @__PURE__ */ i(
1604
+ }, pt = ({ className: t }) => /* @__PURE__ */ i(
1597
1605
  "svg",
1598
1606
  {
1599
1607
  width: "140",
@@ -1727,17 +1735,17 @@ const vt = ({
1727
1735
  ] })
1728
1736
  ]
1729
1737
  }
1730
- ), $e = A.memo(
1738
+ ), ze = j.memo(
1731
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: [
1732
- /* @__PURE__ */ e(wt, {}),
1740
+ /* @__PURE__ */ e(pt, {}),
1733
1741
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1734
1742
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1735
1743
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1736
1744
  ] })
1737
1745
  ] }) })
1738
1746
  );
1739
- $e.displayName = "EmptyState";
1740
- const me = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
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: [
1741
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: "⚠️" }) }),
1742
1750
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1743
1751
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1752,217 +1760,218 @@ const me = A.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1752
1760
  )
1753
1761
  ] }) }));
1754
1762
  me.displayName = "ErrorState";
1755
- const Dt = ({
1763
+ const Tt = ({
1756
1764
  capabilities: t = {},
1757
1765
  className: s,
1758
1766
  renderMessageInputActions: n,
1759
- onChannelSelect: a,
1767
+ onChannelSelect: o,
1760
1768
  onParticipantSelect: l,
1761
- initialParticipantFilter: c,
1762
- initialParticipantData: r,
1769
+ initialParticipantFilter: d,
1770
+ initialParticipantData: a,
1763
1771
  CustomChannelEmptyState: u,
1764
- showChannelList: g = !0,
1765
- filters: x,
1766
- channelListCustomEmptyStateIndicator: b,
1767
- onDeleteConversationClick: f,
1768
- onBlockParticipantClick: v,
1769
- onReportParticipantClick: o,
1770
- dmAgentEnabled: M,
1772
+ showChannelList: f = !0,
1773
+ filters: g,
1774
+ channelListCustomEmptyStateIndicator: N,
1775
+ onDeleteConversationClick: C,
1776
+ onBlockParticipantClick: p,
1777
+ onReportParticipantClick: r,
1778
+ dmAgentEnabled: E,
1771
1779
  messageMetadata: S,
1772
- onMessageSent: w,
1773
- showStarButton: E = !1,
1774
- chatbotVotingEnabled: h = !1,
1775
- renderMessagePreview: C,
1776
- renderChannelBanner: p
1780
+ onMessageSent: v,
1781
+ showStarButton: k = !1,
1782
+ chatbotVotingEnabled: b = !1,
1783
+ renderMessagePreview: m,
1784
+ renderChannelBanner: w,
1785
+ customChannelActions: D
1777
1786
  }) => {
1778
1787
  const {
1779
- service: R,
1780
- client: d,
1781
- isConnected: m,
1782
- isLoading: N,
1783
- error: U,
1784
- refreshConnection: I,
1785
- debug: y
1786
- } = Gs(), [B, H] = k(null), [X, K] = k(!1), [Y, ee] = k(!1), [ne, J] = k(!1), [V, F] = k(/* @__PURE__ */ new Set()), [L, G] = k(0), [P, j] = k(!1), [oe, Z] = k(null), se = W(null), {
1787
- participantSource: re,
1788
- participantLabel: ae = "participants",
1789
- showDeleteConversation: ze = !0
1790
- } = t, He = A.useMemo(() => {
1791
- 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;
1792
1801
  return {
1793
1802
  ...{
1794
1803
  type: "messaging",
1795
1804
  last_message_at: { $exists: !0 },
1796
- ..._ && {
1797
- members: { $in: [_] },
1805
+ ...y && {
1806
+ members: { $in: [y] },
1798
1807
  hidden: !1
1799
1808
  }
1800
1809
  },
1801
- ...x
1810
+ ...g
1802
1811
  };
1803
- }, [x, d == null ? void 0 : d.userID]), le = W(null), te = T(async () => {
1804
- if (!d || !m) return;
1805
- const _ = d.userID;
1806
- 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)
1807
1816
  try {
1808
- y && console.log("[MessagingShell] Syncing channels for user:", _);
1809
- const z = await d.queryChannels(
1817
+ M && console.log("[MessagingShell] Syncing channels for user:", y);
1818
+ const $ = await c.queryChannels(
1810
1819
  {
1811
1820
  type: "messaging",
1812
- members: { $in: [_] }
1821
+ members: { $in: [y] }
1813
1822
  },
1814
1823
  {},
1815
1824
  { limit: 100 }
1816
- ), O = /* @__PURE__ */ new Set();
1817
- z.forEach(($) => {
1818
- const ge = $.state.members;
1819
- Object.values(ge).forEach((Je) => {
1820
- var Ee;
1821
- const xe = (Ee = Je.user) == null ? void 0 : Ee.id;
1822
- 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);
1823
1832
  });
1824
- }), F(($) => $.size === O.size && [...$].every((ge) => O.has(ge)) ? $ : O), K(z.length > 0), ee(!0), le.current = _, y && console.log("[MessagingShell] Channels synced successfully:", {
1825
- channelCount: z.length,
1826
- memberCount: O.size
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
1827
1836
  });
1828
- } catch (z) {
1829
- console.error("[MessagingShell] Failed to sync channels:", z);
1837
+ } catch ($) {
1838
+ console.error("[MessagingShell] Failed to sync channels:", $);
1830
1839
  }
1831
- }, [d, m, y]);
1832
- q(() => {
1833
- if (!d || !m) return;
1834
- const _ = d.userID;
1835
- _ && le.current !== _ && te();
1836
- }, [d, m, te]), q(() => {
1837
- 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;
1838
1847
  (async () => {
1839
- const z = d.userID;
1840
- if (z)
1848
+ const $ = c.userID;
1849
+ if ($)
1841
1850
  try {
1842
- y && console.log(
1851
+ M && console.log(
1843
1852
  "[MessagingShell] Loading initial conversation with:",
1844
- c
1853
+ d
1845
1854
  );
1846
- const O = await d.queryChannels(
1855
+ const U = await c.queryChannels(
1847
1856
  {
1848
1857
  type: "messaging",
1849
- members: { $eq: [z, c] }
1858
+ members: { $eq: [$, d] }
1850
1859
  },
1851
1860
  {},
1852
1861
  { limit: 1 }
1853
1862
  );
1854
- if (O.length > 0)
1855
- 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(
1856
1865
  "[MessagingShell] Initial conversation loaded:",
1857
- O[0].id
1866
+ U[0].id
1858
1867
  );
1859
- else if (r && R) {
1860
- y && console.log(
1868
+ else if (a && h) {
1869
+ M && console.log(
1861
1870
  "[MessagingShell] No conversation found, creating one for:",
1862
- r
1871
+ a
1863
1872
  );
1864
1873
  try {
1865
- const $ = await R.startChannelWithParticipant({
1866
- id: r.id,
1867
- name: r.name,
1868
- email: r.email,
1869
- 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
1870
1879
  });
1871
- H($), j(!0), Z(null), a && a($), y && console.log(
1880
+ z(A), W(!0), Q(null), o && o(A), M && console.log(
1872
1881
  "[MessagingShell] Channel created and loaded:",
1873
- $.id
1882
+ A.id
1874
1883
  );
1875
- } catch ($) {
1884
+ } catch (A) {
1876
1885
  console.error(
1877
1886
  "[MessagingShell] Failed to create conversation:",
1878
- $
1879
- ), Z("Failed to create conversation");
1887
+ A
1888
+ ), Q("Failed to create conversation");
1880
1889
  }
1881
1890
  } else
1882
- Z(
1891
+ Q(
1883
1892
  "No conversation found with this account"
1884
- ), y && console.log(
1893
+ ), M && console.log(
1885
1894
  "[MessagingShell] No conversation found for:",
1886
- c
1895
+ d
1887
1896
  );
1888
- } catch (O) {
1897
+ } catch (U) {
1889
1898
  console.error(
1890
1899
  "[MessagingShell] Failed to load initial conversation:",
1891
- O
1892
- ), Z("Failed to load conversation");
1900
+ U
1901
+ ), Q("Failed to load conversation");
1893
1902
  }
1894
1903
  })();
1895
1904
  }, [
1896
- c,
1897
- r,
1898
1905
  d,
1899
- m,
1900
- R,
1901
- y,
1902
- a
1906
+ a,
1907
+ c,
1908
+ x,
1909
+ h,
1910
+ M,
1911
+ o
1903
1912
  ]);
1904
- const Ge = T(
1905
- (_) => {
1906
- H(_), a == null || a(_);
1913
+ const Ve = L(
1914
+ (y) => {
1915
+ z(y), o == null || o(y);
1907
1916
  },
1908
- [a]
1909
- ), Ve = T(() => {
1910
- P || H(null);
1911
- }, [P]), We = T(
1912
- async (_) => {
1913
- var z;
1914
- if (R)
1917
+ [o]
1918
+ ), We = L(() => {
1919
+ F || z(null);
1920
+ }, [F]), qe = L(
1921
+ async (y) => {
1922
+ var $;
1923
+ if (h)
1915
1924
  try {
1916
- y && console.log(
1925
+ M && console.log(
1917
1926
  "[MessagingShell] Starting conversation with:",
1918
- _.id
1927
+ y.id
1919
1928
  );
1920
- const O = await R.startChannelWithParticipant({
1921
- id: _.id,
1922
- name: _.name,
1923
- email: _.email,
1924
- phone: _.phone
1929
+ const U = await h.startChannelWithParticipant({
1930
+ id: y.id,
1931
+ name: y.name,
1932
+ email: y.email,
1933
+ phone: y.phone
1925
1934
  });
1926
1935
  try {
1927
- await O.show();
1928
- } catch ($) {
1929
- console.warn("[MessagingShell] Failed to unhide channel:", $);
1936
+ await U.show();
1937
+ } catch (A) {
1938
+ console.warn("[MessagingShell] Failed to unhide channel:", A);
1930
1939
  }
1931
- H(O), J(!1), (z = se.current) == null || z.close(), l == null || l(_);
1932
- } catch (O) {
1933
- console.error("[MessagingShell] Failed to start conversation:", O);
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);
1934
1943
  }
1935
1944
  },
1936
- [R, l, y]
1937
- ), ie = T(() => {
1938
- var _;
1939
- J(!1), (_ = se.current) == null || _.close();
1940
- }, []), qe = T(
1941
- (_) => {
1942
- _.target === se.current && ie();
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();
1943
1952
  },
1944
1953
  [ie]
1945
- ), Ze = T(
1946
- async (_) => {
1947
- 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();
1948
1957
  },
1949
- [te, y]
1950
- ), Ye = T(
1951
- async (_) => {
1952
- 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();
1953
1962
  },
1954
- [te, y]
1955
- ), ce = !!B;
1956
- return N ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(he, {}) }) : U ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(me, { message: U, onBack: I }) }) : !m || !d ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
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(
1957
1966
  me,
1958
1967
  {
1959
1968
  message: "Not connected to messaging service",
1960
- onBack: I
1969
+ onBack: T
1961
1970
  }
1962
- ) }) : 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(
1963
1972
  "div",
1964
1973
  {
1965
- className: D(
1974
+ className: R(
1966
1975
  "messaging-shell h-full bg-background-primary overflow-hidden",
1967
1976
  s
1968
1977
  ),
@@ -1971,24 +1980,24 @@ const Dt = ({
1971
1980
  /* @__PURE__ */ e(
1972
1981
  "div",
1973
1982
  {
1974
- className: D(
1983
+ className: R(
1975
1984
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1976
1985
  {
1977
- "!hidden": g === !1 || P,
1986
+ "!hidden": f === !1 || F,
1978
1987
  // Hide on mobile when channel selected, show on desktop with consistent wide width
1979
- "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,
1980
1989
  // Show on mobile when no channel selected, use same wide width on desktop
1981
- "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
1982
1991
  }
1983
1992
  ),
1984
1993
  children: /* @__PURE__ */ e(
1985
- Ue,
1994
+ Be,
1986
1995
  {
1987
- onChannelSelect: Ge,
1988
- selectedChannel: B || void 0,
1989
- filters: He,
1990
- customEmptyStateIndicator: b,
1991
- renderMessagePreview: C
1996
+ onChannelSelect: Ve,
1997
+ selectedChannel: G || void 0,
1998
+ filters: Ge,
1999
+ customEmptyStateIndicator: N,
2000
+ renderMessagePreview: m
1992
2001
  }
1993
2002
  )
1994
2003
  }
@@ -1996,80 +2005,81 @@ const Dt = ({
1996
2005
  /* @__PURE__ */ e(
1997
2006
  "div",
1998
2007
  {
1999
- className: D(
2008
+ className: R(
2000
2009
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2001
2010
  {
2002
2011
  // In direct conversation mode (or waiting for it), always show (full width)
2003
- flex: P || ce || c,
2012
+ flex: F || ce || d,
2004
2013
  // Normal mode: hide on mobile when no channel selected
2005
- "hidden lg:flex": !P && !ce && !c
2014
+ "hidden lg:flex": !F && !ce && !d
2006
2015
  }
2007
2016
  ),
2008
- children: B ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2009
- Ae,
2017
+ children: G ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2018
+ $e,
2010
2019
  {
2011
- channel: B,
2012
- onBack: Ve,
2013
- showBackButton: !P,
2020
+ channel: G,
2021
+ onBack: We,
2022
+ showBackButton: !F,
2014
2023
  renderMessageInputActions: n,
2015
- renderChannelBanner: p,
2016
- onLeaveConversation: Ze,
2017
- onBlockParticipant: Ye,
2024
+ renderChannelBanner: w,
2025
+ onLeaveConversation: Ye,
2026
+ onBlockParticipant: Je,
2018
2027
  CustomChannelEmptyState: u,
2019
- showDeleteConversation: ze,
2020
- onDeleteConversationClick: f,
2021
- onBlockParticipantClick: v,
2022
- onReportParticipantClick: o,
2023
- dmAgentEnabled: M,
2028
+ showDeleteConversation: He,
2029
+ onDeleteConversationClick: C,
2030
+ onBlockParticipantClick: p,
2031
+ onReportParticipantClick: r,
2032
+ dmAgentEnabled: E,
2024
2033
  messageMetadata: S,
2025
- onMessageSent: w,
2026
- showStarButton: E,
2027
- chatbotVotingEnabled: h
2034
+ onMessageSent: v,
2035
+ showStarButton: k,
2036
+ chatbotVotingEnabled: b,
2037
+ customChannelActions: D
2028
2038
  },
2029
- B.id
2030
- ) }) : c ? (
2039
+ G.id
2040
+ ) }) : d ? (
2031
2041
  // Show loading while creating/loading direct conversation channel
2032
2042
  /* @__PURE__ */ e(he, {})
2033
2043
  ) : /* @__PURE__ */ e(
2034
- $e,
2044
+ ze,
2035
2045
  {
2036
- hasChannels: X,
2037
- channelsLoaded: Y
2046
+ hasChannels: ee,
2047
+ channelsLoaded: se
2038
2048
  }
2039
2049
  )
2040
2050
  }
2041
2051
  )
2042
2052
  ] }),
2043
- 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
2044
2054
  /* @__PURE__ */ e(
2045
2055
  "dialog",
2046
2056
  {
2047
- ref: se,
2057
+ ref: X,
2048
2058
  className: "mes-dialog",
2049
- onClick: qe,
2059
+ onClick: Ze,
2050
2060
  onClose: ie,
2051
2061
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2052
- vt,
2062
+ wt,
2053
2063
  {
2054
- participantSource: re,
2055
- onSelectParticipant: We,
2064
+ participantSource: oe,
2065
+ onSelectParticipant: qe,
2056
2066
  onClose: ie,
2057
- existingParticipantIds: V,
2058
- participantLabel: ae,
2059
- searchPlaceholder: `Search ${ae}...`
2067
+ existingParticipantIds: J,
2068
+ participantLabel: Ee,
2069
+ searchPlaceholder: `Search ${Ee}...`
2060
2070
  },
2061
- L
2071
+ O
2062
2072
  ) })
2063
2073
  }
2064
2074
  )
2065
2075
  ]
2066
2076
  }
2067
2077
  );
2068
- }, pt = ({
2078
+ }, yt = ({
2069
2079
  question: t,
2070
2080
  onClick: s,
2071
2081
  loading: n = !1,
2072
- className: a
2082
+ className: o
2073
2083
  }) => /* @__PURE__ */ e(
2074
2084
  "button",
2075
2085
  {
@@ -2077,33 +2087,33 @@ const Dt = ({
2077
2087
  onClick: s,
2078
2088
  disabled: n,
2079
2089
  style: { backgroundColor: "#E6E5E3" },
2080
- className: D(
2090
+ className: R(
2081
2091
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
2082
2092
  {
2083
2093
  "hover:brightness-95 active:brightness-90": !n,
2084
2094
  "opacity-50 cursor-not-allowed": n
2085
2095
  },
2086
- a
2096
+ o
2087
2097
  ),
2088
2098
  children: t
2089
2099
  }
2090
- ), Tt = ({
2100
+ ), Ft = ({
2091
2101
  faqs: t,
2092
2102
  onFaqClick: s,
2093
2103
  loadingFaqId: n,
2094
- headerText: a,
2104
+ headerText: o,
2095
2105
  className: l,
2096
- avatarImage: c,
2097
- avatarName: r
2106
+ avatarImage: d,
2107
+ avatarName: a
2098
2108
  }) => {
2099
- 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));
2100
2110
  return u.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2101
- (c || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2102
- Q,
2111
+ (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2112
+ K,
2103
2113
  {
2104
- id: r || "account",
2105
- name: r || "Account",
2106
- image: c,
2114
+ id: a || "account",
2115
+ name: a || "Account",
2116
+ image: d,
2107
2117
  size: 24,
2108
2118
  shape: "circle"
2109
2119
  }
@@ -2114,75 +2124,76 @@ const Dt = ({
2114
2124
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
2115
2125
  style: { backgroundColor: "#F1F0EE" },
2116
2126
  children: [
2117
- a && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: a }),
2118
- u.map((g) => /* @__PURE__ */ e(
2119
- pt,
2127
+ o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2128
+ u.map((f) => /* @__PURE__ */ e(
2129
+ yt,
2120
2130
  {
2121
- question: g.question,
2122
- onClick: () => s(g.id),
2123
- loading: n === g.id
2131
+ question: f.question,
2132
+ onClick: () => s(f.id),
2133
+ loading: n === f.id
2124
2134
  },
2125
- g.id
2135
+ f.id
2126
2136
  ))
2127
2137
  ]
2128
2138
  }
2129
2139
  )
2130
2140
  ] }) });
2131
- }, Ft = (t, s = {}) => {
2132
- const { initialSearch: n = "", pageSize: a = 20 } = s, [l, c] = k([]), [r, u] = k(!1), [g, x] = k(null), [b, f] = k(n), [v, o] = k(!0), [M, S] = k(), w = T(async (p = !1, R) => {
2133
- if (r) return;
2134
- const d = R !== void 0 ? R : b;
2135
- 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);
2136
2146
  try {
2137
- const m = await t.loadParticipants({
2138
- search: d || void 0,
2139
- limit: a,
2140
- 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
2141
2151
  });
2142
- c(
2143
- (N) => p ? m.participants : [...N, ...m.participants]
2144
- ), o(m.hasMore), S(m.nextCursor);
2145
- } catch (m) {
2146
- const N = m instanceof Error ? m.message : "Failed to load participants";
2147
- 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);
2148
2158
  } finally {
2149
2159
  u(!1);
2150
2160
  }
2151
- }, [t, b, M, a, r]), E = T(() => {
2152
- v && !r && w(!1);
2153
- }, [v, r, w]), h = T((p) => {
2154
- f(p), S(void 0), w(!0, p);
2155
- }, [w]), C = T(() => {
2156
- S(void 0), w(!0);
2157
- }, [w]);
2158
- return q(() => {
2159
- 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);
2160
2170
  }, [t.loadParticipants]), {
2161
2171
  participants: l,
2162
- loading: r,
2163
- error: g,
2164
- searchQuery: b,
2165
- hasMore: v,
2172
+ loading: a,
2173
+ error: f,
2174
+ searchQuery: N,
2175
+ hasMore: p,
2166
2176
  totalCount: t.totalCount,
2167
- loadMore: E,
2168
- search: h,
2169
- refresh: C
2177
+ loadMore: k,
2178
+ search: b,
2179
+ refresh: m
2170
2180
  };
2171
2181
  };
2172
2182
  export {
2173
- Q as Avatar,
2174
- ft as ChannelEmptyState,
2175
- Ue as ChannelList,
2176
- Ae as ChannelView,
2177
- Tt as FaqList,
2178
- pt as FaqListItem,
2179
- rt as MessageVoteButtons,
2180
- Rt as MessagingProvider,
2181
- Dt as MessagingShell,
2182
- vt as ParticipantPicker,
2183
- Ws as formatRelativeTime,
2184
- st as useMessageVote,
2185
- Gs as useMessaging,
2186
- 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
2187
2198
  };
2188
2199
  //# sourceMappingURL=index.js.map