@linktr.ee/messaging-react 1.24.2 → 1.24.3-rc-1773289717

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