@linktr.ee/messaging-react 1.19.3 → 1.20.0

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