@linktr.ee/messaging-react 1.33.3 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import { jsx as e, jsxs as i, Fragment as se } from "react/jsx-runtime";
2
- import O from "classnames";
2
+ import U from "classnames";
3
3
  import z, { createContext as ot, useContext as lt, useCallback as A, useState as I, useRef as X, useEffect as q, useMemo as ze, Suspense as it } from "react";
4
4
  import { StreamChatService as Mt } from "@linktr.ee/messaging-core";
5
- import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as fe, useChatContext as ct, areMessageUIPropsEqual as Pt, useMessageReminder as Ft, useComponentContext as dt, Attachment as At, EditMessageModal as Ut, MessageBlocked as Ot, MessageBouncePrompt as $t, MessageDeleted as zt, MessageIsThreadReplyInChannelButtonIndicator as Bt, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as Wt, isMessageBlocked as qt, isMessageBounced as Zt, MessageBounceModal as Xt, MessageText as Ze, Poll as Kt, MessageErrorIcon as Jt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as os, TextareaComposer as ls, MessageTimestamp as Ue, Channel as is, WithComponents as cs, Window as ds, MessageList as us } from "stream-chat-react";
5
+ import { Chat as Dt, ChannelList as Rt, DateSeparator as Lt, useChannelStateContext as fe, useChatContext as ct, areMessageUIPropsEqual as Pt, useMessageReminder as Ft, useComponentContext as dt, Attachment as At, EditMessageModal as Ot, MessageBlocked as Ut, MessageBouncePrompt as $t, MessageDeleted as zt, MessageIsThreadReplyInChannelButtonIndicator as Bt, MessageRepliesCountButton as jt, ReminderNotification as Gt, StreamedMessageText as Vt, messageHasAttachments as Ht, messageHasReactions as Yt, isDateSeparatorMessage as Wt, isMessageBlocked as qt, isMessageBounced as Zt, MessageBounceModal as Xt, MessageText as Ze, Poll as Kt, MessageErrorIcon as Jt, useMessageContext as ut, useMessageComposer as Qt, useStateStore as es, MessageInput as ts, useMessageInputContext as ss, useMessageComposerHasSendableData as ns, SimpleAttachmentSelector as as, QuotedMessagePreview as rs, AttachmentPreviewList as os, TextareaComposer as ls, MessageTimestamp as Oe, Channel as is, WithComponents as cs, Window as ds, MessageList as us } from "stream-chat-react";
6
6
  import { StarIcon as Be, GiftIcon as ms, XIcon as Re, SpinnerGapIcon as Ie, SignOutIcon as hs, ProhibitInsetIcon as Xe, FlagIcon as fs, ArrowUpIcon as gs, SparkleIcon as bs, ProhibitIcon as ps, ArrowLeftIcon as Ke, CaretRightIcon as Je, DotsThreeIcon as Qe, MagnifyingGlassIcon as xs, ChatCircleDotsIcon as et, FileIcon as mt, ImageIcon as vs, SpeakerHighIcon as ws, VideoCameraIcon as Ns, FileMdIcon as ys, FileTextIcon as Cs, FileZipIcon as _s, FilePptIcon as Es, FileCsvIcon as Ss, FileXlsIcon as ks, FileDocIcon as Is, FilePdfIcon as Ts, CircleNotchIcon as ht, PlayIcon as tt, PauseIcon as Ms, LinkIcon as Ds, DownloadSimpleIcon as Rs } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as st } from "stream-chat";
8
8
  const ft = ot({
@@ -35,28 +35,28 @@ const ft = ot({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [c, x] = I(null), [u, g] = I(null), [h, N] = I(!1), [a, _] = I(!1), [w, p] = I(null), E = X(!1), S = X({
38
+ const [c, x] = I(null), [u, g] = I(null), [h, y] = I(!1), [a, _] = I(!1), [w, p] = I(null), S = X(!1), k = X({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: o,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), C = X(0);
44
- C.current++, r("📊 RENDER INFO", {
45
- renderCount: C.current,
43
+ }), N = X(0);
44
+ N.current++, r("📊 RENDER INFO", {
45
+ renderCount: N.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: S.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: S.current.apiKey !== o,
50
- serviceConfigChanged: S.current.serviceConfig !== n,
51
- capabilitiesChanged: S.current.capabilities !== l
48
+ userChanged: k.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: k.current.apiKey !== o,
50
+ serviceConfigChanged: k.current.serviceConfig !== n,
51
+ capabilitiesChanged: k.current.capabilities !== l
52
52
  }
53
- }), S.current = {
53
+ }), k.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: o,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
58
  }, q(() => {
59
- const m = C.current;
59
+ const m = N.current;
60
60
  if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: m,
62
62
  apiKey: !!o,
@@ -64,8 +64,8 @@ const ft = ot({
64
64
  dependencies: {
65
65
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: S.current.serviceConfig === n,
68
- apiKeyStable: S.current.apiKey === o
67
+ serviceConfigStable: k.current.serviceConfig === n,
68
+ apiKeyStable: k.current.apiKey === o
69
69
  }
70
70
  }), !o || !n) {
71
71
  r("⚠️ SERVICE INIT SKIPPED", {
@@ -77,7 +77,7 @@ const ft = ot({
77
77
  r("🚀 CREATING NEW SERVICE", {
78
78
  renderCount: m,
79
79
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
- serviceConfigChanged: S.current.serviceConfig !== n
80
+ serviceConfigChanged: k.current.serviceConfig !== n
81
81
  });
82
82
  const f = new Mt({
83
83
  ...n,
@@ -94,25 +94,25 @@ const ft = ot({
94
94
  }), f.disconnectUser().catch(console.error);
95
95
  };
96
96
  }, [o, n, d, r]);
97
- const k = X(null);
97
+ const E = X(null);
98
98
  q(() => {
99
99
  var f, T;
100
100
  if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: E.current,
104
+ isConnecting: S.current,
105
105
  isConnected: h,
106
106
  dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
107
  }), !c || !s) {
108
108
  r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (E.current) {
111
+ if (S.current) {
112
112
  r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((f = k.current) == null ? void 0 : f.serviceId) === c && ((T = k.current) == null ? void 0 : T.userId) === s.id) {
115
+ if (((f = E.current) == null ? void 0 : f.serviceId) === c && ((T = E.current) == null ? void 0 : T.userId) === s.id) {
116
116
  r(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,11 +120,11 @@ const ft = ot({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- r("🚀 STARTING USER CONNECTION", { userId: s.id }), E.current = !0, _(!0), p(null);
123
+ r("🚀 STARTING USER CONNECTION", { userId: s.id }), S.current = !0, _(!0), p(null);
124
124
  try {
125
125
  r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
126
  const M = await c.connectUser(s);
127
- g(M), N(!0), k.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
127
+ g(M), y(!0), E.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: M.userID
130
130
  });
@@ -135,7 +135,7 @@ const ft = ot({
135
135
  error: L
136
136
  });
137
137
  } finally {
138
- _(!1), E.current = !1, r("🔄 USER CONNECTION FINISHED", {
138
+ _(!1), S.current = !1, r("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: h
141
141
  });
@@ -148,7 +148,7 @@ const ft = ot({
148
148
  c && h ? (r(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), k.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
151
+ ), E.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!c,
153
153
  isConnected: h
154
154
  });
@@ -165,7 +165,7 @@ const ft = ot({
165
165
  try {
166
166
  r("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
167
167
  const m = await c.connectUser(s);
168
- g(m), N(!0), p(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
168
+ g(m), y(!0), p(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (m) {
170
170
  const f = m instanceof Error ? m.message : "Refresh failed";
171
171
  p(f), r("❌ CONNECTION REFRESH ERROR", {
@@ -203,7 +203,7 @@ const ft = ot({
203
203
  r
204
204
  ]);
205
205
  return r("🔄 RENDER END", {
206
- renderCount: C.current,
206
+ renderCount: N.current,
207
207
  willRenderChat: !!(u && h),
208
208
  contextValueReady: !!v
209
209
  }), /* @__PURE__ */ e(ft.Provider, { value: v, children: u && h ? /* @__PURE__ */ e(
@@ -251,18 +251,18 @@ const gt = z.createContext({
251
251
  t.off("member.updated", d);
252
252
  };
253
253
  }, [t]), s;
254
- }, Us = (t, s) => {
254
+ }, Os = (t, s) => {
255
255
  const n = new Date(
256
256
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
257
257
  ), l = new Date(
258
258
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
259
259
  ).getTime() - n.getTime();
260
260
  return Math.floor(l / (1e3 * 60 * 60 * 24));
261
- }, Os = (t) => {
261
+ }, Us = (t) => {
262
262
  const s = /* @__PURE__ */ new Date();
263
263
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
264
264
  return "Just now";
265
- const o = Us(t, s);
265
+ const o = Os(t, s);
266
266
  return o === 0 ? t.toLocaleTimeString([], {
267
267
  hour: "numeric",
268
268
  minute: "2-digit",
@@ -327,7 +327,7 @@ const oe = ({
327
327
  return /* @__PURE__ */ i(
328
328
  "div",
329
329
  {
330
- className: O("relative flex-shrink-0", o),
330
+ className: U("relative flex-shrink-0", o),
331
331
  style: {
332
332
  width: `${n}px`,
333
333
  height: `${n}px`
@@ -352,7 +352,7 @@ const oe = ({
352
352
  "div",
353
353
  {
354
354
  "aria-hidden": "true",
355
- className: O(
355
+ className: U(
356
356
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
357
357
  x
358
358
  ),
@@ -394,7 +394,7 @@ const oe = ({
394
394
  }, pt = (t) => js(t) || Gs(t), Hs = (t) => {
395
395
  var s;
396
396
  return pt(t) && !((s = t.text) != null && s.trim());
397
- }, Oe = ({
397
+ }, Ue = ({
398
398
  message: t,
399
399
  standalone: s = !1,
400
400
  isMyMessage: n = !1,
@@ -405,9 +405,9 @@ const oe = ({
405
405
  if (!l && !d)
406
406
  return null;
407
407
  if (l) {
408
- const N = (h = t.metadata) == null ? void 0 : h.amount_text;
409
- if (!N) return null;
410
- const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${N} tip` : `Delivered with ${N} tip`;
408
+ const y = (h = t.metadata) == null ? void 0 : h.amount_text;
409
+ if (!y) return null;
410
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", _ = s ? `${y} tip` : `Delivered with ${y} tip`;
411
411
  return /* @__PURE__ */ i("div", { className: a, children: [
412
412
  /* @__PURE__ */ e(ms, { size: s ? 14 : 12 }),
413
413
  /* @__PURE__ */ e("span", { children: _ })
@@ -438,7 +438,7 @@ const oe = ({
438
438
  var M, L;
439
439
  return ((M = T.user) == null ? void 0 : M.id) && T.user.id !== ((L = t == null ? void 0 : t._client) == null ? void 0 : L.userID);
440
440
  }
441
- ), h = ((v = g == null ? void 0 : g.user) == null ? void 0 : v.name) || "Conversation", N = (m = g == null ? void 0 : g.user) == null ? void 0 : m.image, a = (() => {
441
+ ), h = ((v = g == null ? void 0 : g.user) == null ? void 0 : v.name) || "Conversation", y = (m = g == null ? void 0 : g.user) == null ? void 0 : m.image, a = (() => {
442
442
  var M;
443
443
  const T = (M = t == null ? void 0 : t.state) == null ? void 0 : M.messages;
444
444
  if (T != null && T.length) {
@@ -451,12 +451,12 @@ const oe = ({
451
451
  if (((L = a == null ? void 0 : a.metadata) == null ? void 0 : L.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
452
452
  const M = (R = a == null ? void 0 : a.attachments) == null ? void 0 : R[0];
453
453
  return M ? M.og_scrape_url ? M.og_scrape_url : M.type === "image" ? "📷 Sent an image" : M.type === "video" ? "🎥 Sent a video" : M.type === "audio" ? "🎵 Sent audio" : M.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
454
- })(), p = a != null && a.created_at ? Os(new Date(a.created_at)) : "", E = a ? He(a) : !1, S = d ? d(a, w) : `${E ? "✨ " : ""}${w}`, C = bt(t), k = s ?? 0;
454
+ })(), p = a != null && a.created_at ? Us(new Date(a.created_at)) : "", S = a ? He(a) : !1, k = d ? d(a, w) : `${S ? "✨ " : ""}${w}`, N = bt(t), E = s ?? 0;
455
455
  return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
456
456
  channelId: t == null ? void 0 : t.id,
457
457
  isSelected: r,
458
458
  participantName: h,
459
- unreadCount: k,
459
+ unreadCount: E,
460
460
  hasTimestamp: !!p
461
461
  }), /* @__PURE__ */ e(
462
462
  "div",
@@ -465,7 +465,7 @@ const oe = ({
465
465
  tabIndex: 0,
466
466
  onClick: c,
467
467
  onKeyDown: x,
468
- className: O(
468
+ className: U(
469
469
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
470
470
  {
471
471
  "bg-primary-alt/10 border-l-4 border-l-primary": r,
@@ -478,9 +478,9 @@ const oe = ({
478
478
  {
479
479
  id: ((f = g == null ? void 0 : g.user) == null ? void 0 : f.id) || t.id || "unknown",
480
480
  name: h,
481
- image: N,
481
+ image: y,
482
482
  size: 44,
483
- starred: C,
483
+ starred: N,
484
484
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
485
485
  }
486
486
  ),
@@ -489,12 +489,12 @@ const oe = ({
489
489
  /* @__PURE__ */ i(
490
490
  "h3",
491
491
  {
492
- className: O(
492
+ className: U(
493
493
  "text-sm font-medium truncate",
494
494
  r ? "text-primary" : "text-charcoal"
495
495
  ),
496
496
  children: [
497
- C && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
497
+ N && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
498
498
  h
499
499
  ]
500
500
  }
@@ -502,8 +502,8 @@ const oe = ({
502
502
  p && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: p })
503
503
  ] }),
504
504
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
505
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
506
- k > 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: k > 99 ? "99+" : k })
505
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: k }),
506
+ E > 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: E > 99 ? "99+" : E })
507
507
  ] })
508
508
  ] })
509
509
  ] })
@@ -528,7 +528,7 @@ const Ys = { last_message_at: -1 }, vt = z.memo(
528
528
  }) => {
529
529
  const h = z.useRef(0);
530
530
  h.current++;
531
- const { debug: N = !1 } = Le(), a = z.useCallback(
531
+ const { debug: y = !1 } = Le(), a = z.useCallback(
532
532
  (w) => {
533
533
  for (const p of w)
534
534
  Ps(p);
@@ -536,7 +536,7 @@ const Ys = { last_message_at: -1 }, vt = z.memo(
536
536
  },
537
537
  [r]
538
538
  );
539
- N && console.log("📺 [ChannelList] 🔄 RENDER START", {
539
+ y && console.log("📺 [ChannelList] 🔄 RENDER START", {
540
540
  renderCount: h.current,
541
541
  selectedChannelId: s == null ? void 0 : s.id,
542
542
  filters: n
@@ -545,15 +545,15 @@ const Ys = { last_message_at: -1 }, vt = z.memo(
545
545
  () => ({
546
546
  selectedChannel: s,
547
547
  onChannelSelect: t,
548
- debug: N,
548
+ debug: y,
549
549
  renderMessagePreview: g
550
550
  }),
551
- [s, t, N, g]
551
+ [s, t, y, g]
552
552
  );
553
553
  return /* @__PURE__ */ e(
554
554
  "div",
555
555
  {
556
- className: O(
556
+ className: U(
557
557
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
558
558
  x
559
559
  ),
@@ -586,7 +586,7 @@ const ke = ({
586
586
  "button",
587
587
  {
588
588
  type: "button",
589
- className: O(
589
+ className: U(
590
590
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
591
591
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
592
592
  s
@@ -600,7 +600,7 @@ function wt({ label: t, className: s, children: n, ...o }) {
600
600
  "button",
601
601
  {
602
602
  type: "button",
603
- className: O(
603
+ className: U(
604
604
  "inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
605
605
  {
606
606
  "cursor-not-allowed opacity-50": o.disabled,
@@ -632,24 +632,24 @@ const Ws = ({
632
632
  onBlockParticipantClick: u,
633
633
  onReportParticipantClick: g,
634
634
  customProfileContent: h,
635
- customChannelActions: N
635
+ customChannelActions: y
636
636
  }) => {
637
637
  var V, F, H, Z, ae, K, b;
638
- const { service: a, debug: _ } = Le(), [w, p] = I(!1), [E, S] = I(!1), [C, k] = I(!1), P = A(async () => {
639
- var y;
640
- if (!(!a || !((y = n == null ? void 0 : n.user) != null && y.id)))
638
+ const { service: a, debug: _ } = Le(), [w, p] = I(!1), [S, k] = I(!1), [N, E] = I(!1), P = A(async () => {
639
+ var C;
640
+ if (!(!a || !((C = n == null ? void 0 : n.user) != null && C.id)))
641
641
  try {
642
642
  const j = (await a.getBlockedUsers()).some(
643
- (te) => {
643
+ (ee) => {
644
644
  var le;
645
- return te.blocked_user_id === ((le = n == null ? void 0 : n.user) == null ? void 0 : le.id);
645
+ return ee.blocked_user_id === ((le = n == null ? void 0 : n.user) == null ? void 0 : le.id);
646
646
  }
647
647
  );
648
648
  p(j);
649
- } catch (U) {
649
+ } catch (O) {
650
650
  console.error(
651
651
  "[ChannelInfoDialog] Failed to check blocked status:",
652
- U
652
+ O
653
653
  );
654
654
  }
655
655
  }, [a, (V = n == null ? void 0 : n.user) == null ? void 0 : V.id]);
@@ -657,40 +657,40 @@ const Ws = ({
657
657
  P();
658
658
  }, [P]);
659
659
  const v = async () => {
660
- var y;
661
- if (!E) {
662
- x == null || x(), _ && console.log("[ChannelInfoDialog] Leave conversation", o.cid), S(!0);
660
+ var C;
661
+ if (!S) {
662
+ x == null || x(), _ && console.log("[ChannelInfoDialog] Leave conversation", o.cid), k(!0);
663
663
  try {
664
- const U = ((y = o._client) == null ? void 0 : y.userID) ?? null;
665
- await o.hide(U, !1), d && await d(o), s();
666
- } catch (U) {
667
- console.error("[ChannelInfoDialog] Failed to leave conversation", U);
664
+ const O = ((C = o._client) == null ? void 0 : C.userID) ?? null;
665
+ await o.hide(O, !1), d && await d(o), s();
666
+ } catch (O) {
667
+ console.error("[ChannelInfoDialog] Failed to leave conversation", O);
668
668
  } finally {
669
- S(!1);
669
+ k(!1);
670
670
  }
671
671
  }
672
672
  }, m = async () => {
673
- var y, U, j;
674
- if (!(C || !a)) {
675
- u == null || u(), _ && console.log("[ChannelInfoDialog] Block member", (y = n == null ? void 0 : n.user) == null ? void 0 : y.id), k(!0);
673
+ var C, O, j;
674
+ if (!(N || !a)) {
675
+ u == null || u(), _ && console.log("[ChannelInfoDialog] Block member", (C = n == null ? void 0 : n.user) == null ? void 0 : C.id), E(!0);
676
676
  try {
677
- await a.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
678
- } catch (te) {
679
- console.error("[ChannelInfoDialog] Failed to block member", te);
677
+ await a.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
678
+ } catch (ee) {
679
+ console.error("[ChannelInfoDialog] Failed to block member", ee);
680
680
  } finally {
681
- k(!1);
681
+ E(!1);
682
682
  }
683
683
  }
684
684
  }, f = async () => {
685
- var y, U, j;
686
- if (!(C || !a)) {
687
- u == null || u(), _ && console.log("[ChannelInfoDialog] Unblock member", (y = n == null ? void 0 : n.user) == null ? void 0 : y.id), k(!0);
685
+ var C, O, j;
686
+ if (!(N || !a)) {
687
+ u == null || u(), _ && console.log("[ChannelInfoDialog] Unblock member", (C = n == null ? void 0 : n.user) == null ? void 0 : C.id), E(!0);
688
688
  try {
689
- await a.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
690
- } catch (te) {
691
- console.error("[ChannelInfoDialog] Failed to unblock member", te);
689
+ await a.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((j = n == null ? void 0 : n.user) == null ? void 0 : j.id), s();
690
+ } catch (ee) {
691
+ console.error("[ChannelInfoDialog] Failed to unblock member", ee);
692
692
  } finally {
693
- k(!1);
693
+ E(!1);
694
694
  }
695
695
  }
696
696
  }, T = () => {
@@ -701,7 +701,7 @@ const Ws = ({
701
701
  );
702
702
  };
703
703
  if (!n) return null;
704
- const M = ((F = n.user) == null ? void 0 : F.name) || ((H = n.user) == null ? void 0 : H.id) || "Unknown member", L = (Z = n.user) == null ? void 0 : Z.image, R = (ae = n.user) == null ? void 0 : ae.email, B = (K = n.user) == null ? void 0 : K.username, ee = R || (B ? `linktr.ee/${B}` : void 0), J = ((b = n.user) == null ? void 0 : b.id) || "unknown";
704
+ const M = ((F = n.user) == null ? void 0 : F.name) || ((H = n.user) == null ? void 0 : H.id) || "Unknown member", L = (Z = n.user) == null ? void 0 : Z.image, R = (ae = n.user) == null ? void 0 : ae.email, B = (K = n.user) == null ? void 0 : K.username, Q = R || (B ? `linktr.ee/${B}` : void 0), J = ((b = n.user) == null ? void 0 : b.id) || "unknown";
705
705
  return (
706
706
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
707
707
  /* @__PURE__ */ e(
@@ -710,8 +710,8 @@ const Ws = ({
710
710
  ref: t,
711
711
  className: "mes-dialog group",
712
712
  onClose: s,
713
- onClick: (y) => {
714
- y.target === t.current && s();
713
+ onClick: (C) => {
714
+ C.target === t.current && s();
715
715
  },
716
716
  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: [
717
717
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
@@ -738,7 +738,7 @@ const Ws = ({
738
738
  ),
739
739
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
740
740
  /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: M }),
741
- ee && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: ee }),
741
+ Q && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Q }),
742
742
  l && !h && /* @__PURE__ */ e(
743
743
  "span",
744
744
  {
@@ -764,10 +764,10 @@ const Ws = ({
764
764
  ke,
765
765
  {
766
766
  onClick: v,
767
- disabled: E,
768
- "aria-busy": E,
767
+ disabled: S,
768
+ "aria-busy": S,
769
769
  children: [
770
- E ? /* @__PURE__ */ e(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(hs, { className: "h-5 w-5" }),
770
+ S ? /* @__PURE__ */ e(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(hs, { className: "h-5 w-5" }),
771
771
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
772
772
  ]
773
773
  }
@@ -776,10 +776,10 @@ const Ws = ({
776
776
  ke,
777
777
  {
778
778
  onClick: f,
779
- disabled: C,
780
- "aria-busy": C,
779
+ disabled: N,
780
+ "aria-busy": N,
781
781
  children: [
782
- C ? /* @__PURE__ */ e(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Xe, { className: "h-5 w-5" }),
782
+ N ? /* @__PURE__ */ e(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Xe, { className: "h-5 w-5" }),
783
783
  /* @__PURE__ */ e("span", { children: "Unblock" })
784
784
  ]
785
785
  }
@@ -787,10 +787,10 @@ const Ws = ({
787
787
  ke,
788
788
  {
789
789
  onClick: m,
790
- disabled: C,
791
- "aria-busy": C,
790
+ disabled: N,
791
+ "aria-busy": N,
792
792
  children: [
793
- C ? /* @__PURE__ */ e(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Xe, { className: "h-5 w-5" }),
793
+ N ? /* @__PURE__ */ e(Ie, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Xe, { className: "h-5 w-5" }),
794
794
  /* @__PURE__ */ e("span", { children: "Block" })
795
795
  ]
796
796
  }
@@ -799,7 +799,7 @@ const Ws = ({
799
799
  /* @__PURE__ */ e(fs, { className: "h-5 w-5" }),
800
800
  /* @__PURE__ */ e("span", { children: "Report" })
801
801
  ] }) }),
802
- N
802
+ y
803
803
  ] })
804
804
  ] })
805
805
  ] })
@@ -837,7 +837,7 @@ function Xs(t) {
837
837
  }, [s, n == null ? void 0 : n.userID, t.id, o]);
838
838
  return { selected: o, voteUp: l, voteDown: d };
839
839
  }
840
- const Ks = z.lazy(() => import("./Card-BfA8wq8O.js")), Js = z.lazy(() => import("./Card-Bpud_enW.js")), yt = () => /* @__PURE__ */ e(
840
+ const Ks = z.lazy(() => import("./Card-KHDSM8Zs.js")), Js = z.lazy(() => import("./Card-mHUN_YWq.js")), yt = () => /* @__PURE__ */ e(
841
841
  "div",
842
842
  {
843
843
  className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
@@ -912,14 +912,14 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
912
912
  handleRetry: u,
913
913
  highlighted: g,
914
914
  isMessageAIGenerated: h,
915
- isMyMessage: N,
915
+ isMyMessage: y,
916
916
  message: a,
917
917
  renderText: _,
918
918
  threadList: w
919
- } = t, { client: p } = ct("CustomMessage"), { channel: E } = fe("CustomMessage"), { isUnlocking: S, onUnlockClick: C, onFetchSource: k, onDownloadClick: P } = nn("LockedAttachment"), [v, m] = I(!1), f = Ft(a.id), { selected: T, voteUp: M, voteDown: L } = Xs(a), {
919
+ } = t, { client: p } = ct("CustomMessage"), { channel: S } = fe("CustomMessage"), { isUnlocking: k, onUnlockClick: N, onFetchSource: E, onDownloadClick: P } = nn("LockedAttachment"), [v, m] = I(!1), f = Ft(a.id), { selected: T, voteUp: M, voteDown: L } = Xs(a), {
920
920
  Attachment: R = At,
921
- EditMessageModal: B = Ut,
922
- MessageBlocked: ee = Ot,
921
+ EditMessageModal: B = Ot,
922
+ MessageBlocked: Q = Ut,
923
923
  MessageBouncePrompt: J = $t,
924
924
  MessageDeleted: V = zt,
925
925
  MessageIsThreadReplyInChannelButtonIndicator: F = Bt,
@@ -927,7 +927,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
927
927
  ReminderNotification: Z = Gt,
928
928
  StreamedMessageText: ae = Vt,
929
929
  PinIndicator: K
930
- } = dt("CustomMessage"), b = Ht(a), y = Yt(a), U = ze(
930
+ } = dt("CustomMessage"), b = Ht(a), C = Yt(a), O = ze(
931
931
  () => h == null ? void 0 : h(a),
932
932
  [h, a]
933
933
  ), j = ze(
@@ -939,28 +939,28 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
939
939
  if (a.deleted_at || a.type === "deleted")
940
940
  return /* @__PURE__ */ e(V, { message: a });
941
941
  if (qt(a))
942
- return /* @__PURE__ */ e(ee, {});
943
- const te = !w && !!a.reply_count, le = !w && a.show_in_channel && a.parent_id, pe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403, Pe = Zt(a);
942
+ return /* @__PURE__ */ e(Q, {});
943
+ const ee = !w && !!a.reply_count, le = !w && a.show_in_channel && a.parent_id, pe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403, Pe = Zt(a);
944
944
  let Y;
945
945
  pe ? Y = () => u(a) : Pe && (Y = () => m(!0));
946
- const Q = N(), xe = O(
946
+ const te = y(), xe = U(
947
947
  "str-chat__message str-chat__message-simple",
948
948
  `str-chat__message--${a.type}`,
949
949
  `str-chat__message--${a.status}`,
950
- Q ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
950
+ te ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
951
951
  a.text ? "str-chat__message--has-text" : "has-no-text",
952
952
  {
953
953
  "str-chat__message--has-attachment": b,
954
954
  "str-chat__message--highlighted": g,
955
955
  "str-chat__message--pinned pinned-message": a.pinned,
956
- "str-chat__message--with-reactions": y,
956
+ "str-chat__message--with-reactions": C,
957
957
  "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((ne = a == null ? void 0 : a.error) == null ? void 0 : ne.status) !== 403,
958
- "str-chat__message-with-thread-link": te || le,
958
+ "str-chat__message-with-thread-link": ee || le,
959
959
  "str-chat__virtual-message__wrapper--end": l,
960
960
  "str-chat__virtual-message__wrapper--first": d,
961
961
  "str-chat__virtual-message__wrapper--group": r
962
962
  }
963
- ), re = a.poll_id && p.polls.fromState(a.poll_id), me = Hs(a), ie = He(a), ve = Vs(a), ge = !!(j != null && j.length && !a.quoted_message), we = ie && Q && ge;
963
+ ), re = a.poll_id && p.polls.fromState(a.poll_id), me = Hs(a), ie = He(a), ve = Vs(a), ge = !!(j != null && j.length && !a.quoted_message), we = ie && te && ge;
964
964
  return /* @__PURE__ */ i(se, { children: [
965
965
  o && /* @__PURE__ */ e(
966
966
  B,
@@ -991,7 +991,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
991
991
  /* @__PURE__ */ e(
992
992
  "div",
993
993
  {
994
- className: O("str-chat__message-inner", {
994
+ className: U("str-chat__message-inner", {
995
995
  "str-chat__simple-message--error-failed": pe || Pe
996
996
  }),
997
997
  "data-testid": "message-inner",
@@ -1005,8 +1005,8 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1005
1005
  marginInlineEnd: 0,
1006
1006
  marginInlineStart: 0
1007
1007
  },
1008
- children: ve ? /* @__PURE__ */ i("div", { className: `flex flex-col gap-1 ${Q ? "items-end" : "items-start"}`, children: [
1009
- Q ? /* @__PURE__ */ e(
1008
+ children: ve ? /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
1009
+ te ? /* @__PURE__ */ e(
1010
1010
  at.Creator,
1011
1011
  {
1012
1012
  title: (Ne = a.metadata) == null ? void 0 : Ne.attachment_title,
@@ -1014,7 +1014,10 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1014
1014
  thumbnailUrl: (Ce = a.metadata) == null ? void 0 : Ce.attachment_thumbnail,
1015
1015
  amountText: (de = a.metadata) == null ? void 0 : de.amount_text,
1016
1016
  detail: (_e = a.metadata) == null ? void 0 : _e.attachment_detail,
1017
- paymentStatus: (Ee = a.metadata) == null ? void 0 : Ee.payment_status
1017
+ paymentStatus: (Ee = a.metadata) == null ? void 0 : Ee.payment_status,
1018
+ isUnlocking: k(a.id),
1019
+ onPreviewClick: () => N == null ? void 0 : N(a, S),
1020
+ onFetchSource: async () => await (E == null ? void 0 : E(a, S))
1018
1021
  }
1019
1022
  ) : /* @__PURE__ */ e(
1020
1023
  at.Visitor,
@@ -1025,24 +1028,24 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1025
1028
  amountText: (W = a.metadata) == null ? void 0 : W.amount_text,
1026
1029
  detail: ($ = a.metadata) == null ? void 0 : $.attachment_detail,
1027
1030
  paymentStatus: (G = a.metadata) == null ? void 0 : G.payment_status,
1028
- isUnlocking: S(a.id),
1029
- onUnlockClick: () => C == null ? void 0 : C(a, E),
1030
- onFetchSource: async () => await (k == null ? void 0 : k(a, E)),
1031
- onDownloadClick: () => P == null ? void 0 : P(a, E)
1031
+ isUnlocking: k(a.id),
1032
+ onUnlockClick: () => N == null ? void 0 : N(a, S),
1033
+ onFetchSource: async () => await (E == null ? void 0 : E(a, S)),
1034
+ onDownloadClick: () => P == null ? void 0 : P(a, S)
1032
1035
  }
1033
1036
  ),
1034
- a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Ze, { message: a, renderText: _ }) }) })
1037
+ a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(Ze, { message: a, renderText: _ }) })
1035
1038
  ] }) : me ? (
1036
1039
  /* Tip-only messages render as a standalone bubble */
1037
- /* @__PURE__ */ e(Oe, { message: a, standalone: !0 })
1040
+ /* @__PURE__ */ e(Ue, { message: a, standalone: !0 })
1038
1041
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
1039
1042
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
1040
1043
  ie && !we && /* @__PURE__ */ e(
1041
- Oe,
1044
+ Ue,
1042
1045
  {
1043
1046
  message: a,
1044
1047
  hasAttachment: ge,
1045
- isMyMessage: Q
1048
+ isMyMessage: te
1046
1049
  }
1047
1050
  ),
1048
1051
  re && /* @__PURE__ */ e(Kt, { poll: re }),
@@ -1053,7 +1056,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1053
1056
  attachments: j
1054
1057
  }
1055
1058
  ) : null,
1056
- U ? /* @__PURE__ */ e(
1059
+ O ? /* @__PURE__ */ e(
1057
1060
  ae,
1058
1061
  {
1059
1062
  message: a,
@@ -1063,11 +1066,11 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1063
1066
  /* @__PURE__ */ e(Jt, {})
1064
1067
  ] }),
1065
1068
  (!ie || we) && /* @__PURE__ */ e(
1066
- Oe,
1069
+ Ue,
1067
1070
  {
1068
1071
  message: a,
1069
1072
  hasAttachment: ge,
1070
- isMyMessage: Q
1073
+ isMyMessage: te
1071
1074
  }
1072
1075
  ),
1073
1076
  n && ie && /* @__PURE__ */ e(
@@ -1081,7 +1084,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1081
1084
  ] })
1082
1085
  }
1083
1086
  ),
1084
- te && /* @__PURE__ */ e(
1087
+ ee && /* @__PURE__ */ e(
1085
1088
  H,
1086
1089
  {
1087
1090
  onClick: x,
@@ -1296,7 +1299,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1296
1299
  ]
1297
1300
  }
1298
1301
  ),
1299
- !s && /* @__PURE__ */ e(Ue, { message: t.message })
1302
+ !s && /* @__PURE__ */ e(Oe, { message: t.message })
1300
1303
  ] });
1301
1304
  }
1302
1305
  if ((n == null ? void 0 : n.kind) === "age-safety") {
@@ -1323,7 +1326,7 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1323
1326
  ]
1324
1327
  }
1325
1328
  ),
1326
- !s && /* @__PURE__ */ e(Ue, { message: t.message })
1329
+ !s && /* @__PURE__ */ e(Oe, { message: t.message })
1327
1330
  ] });
1328
1331
  }
1329
1332
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1332,12 +1335,12 @@ const an = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1332
1335
  /* @__PURE__ */ e("p", { children: t.message.text }),
1333
1336
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
1334
1337
  ] }),
1335
- !s && /* @__PURE__ */ e(Ue, { message: t.message })
1338
+ !s && /* @__PURE__ */ e(Oe, { message: t.message })
1336
1339
  ] });
1337
1340
  }, Sn = () => null, kn = ({ className: t, message: s }) => /* @__PURE__ */ i(
1338
1341
  "div",
1339
1342
  {
1340
- className: O("flex items-center justify-center h-full", t),
1343
+ className: U("flex items-center justify-center h-full", t),
1341
1344
  children: [
1342
1345
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1343
1346
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -1389,13 +1392,13 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1389
1392
  canShowInfo: o,
1390
1393
  showStarButton: l = !1
1391
1394
  }) => {
1392
- var h, N, a, _, w;
1395
+ var h, y, a, _, w;
1393
1396
  const { channel: d } = fe(), r = z.useMemo(() => Object.values(d.state.members || {}).find(
1394
- (E) => {
1395
- var S;
1396
- return ((S = E.user) == null ? void 0 : S.id) && E.user.id !== d._client.userID;
1397
+ (S) => {
1398
+ var k;
1399
+ return ((k = S.user) == null ? void 0 : k.id) && S.user.id !== d._client.userID;
1397
1400
  }
1398
- ), [d._client.userID, d.state.members]), c = ((h = r == null ? void 0 : r.user) == null ? void 0 : h.name) || ((N = r == null ? void 0 : r.user) == null ? void 0 : N.id) || "Unknown member", x = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, u = bt(d), g = async () => {
1401
+ ), [d._client.userID, d.state.members]), c = ((h = r == null ? void 0 : r.user) == null ? void 0 : h.name) || ((y = r == null ? void 0 : r.user) == null ? void 0 : y.id) || "Unknown member", x = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, u = bt(d), g = async () => {
1399
1402
  try {
1400
1403
  u ? await d.unpin() : await d.pin();
1401
1404
  } catch (p) {
@@ -1454,7 +1457,7 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1454
1457
  children: /* @__PURE__ */ e(
1455
1458
  Be,
1456
1459
  {
1457
- className: O("size-5", {
1460
+ className: U("size-5", {
1458
1461
  "text-yellow-600": u,
1459
1462
  "text-black/90": !u
1460
1463
  }),
@@ -1522,7 +1525,7 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1522
1525
  children: /* @__PURE__ */ e(
1523
1526
  Be,
1524
1527
  {
1525
- className: O("size-5", {
1528
+ className: U("size-5", {
1526
1529
  "text-yellow-600": u,
1527
1530
  "text-black/90": !u
1528
1531
  }),
@@ -1557,28 +1560,28 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1557
1560
  onReportParticipantClick: u,
1558
1561
  showStarButton: g = !1,
1559
1562
  chatbotVotingEnabled: h = !1,
1560
- renderChannelBanner: N,
1563
+ renderChannelBanner: y,
1561
1564
  customProfileContent: a,
1562
1565
  customChannelActions: _,
1563
1566
  renderMessage: w
1564
1567
  }) => {
1565
- const { channel: p } = fe(), E = X(null), S = z.useMemo(() => Object.values(p.state.members || {}).find(
1568
+ const { channel: p } = fe(), S = X(null), k = z.useMemo(() => Object.values(p.state.members || {}).find(
1566
1569
  (f) => {
1567
1570
  var T;
1568
1571
  return ((T = f.user) == null ? void 0 : T.id) && f.user.id !== p._client.userID;
1569
1572
  }
1570
- ), [p._client.userID, p.state.members]), C = z.useMemo(() => {
1573
+ ), [p._client.userID, p.state.members]), N = z.useMemo(() => {
1571
1574
  const m = p.data ?? {};
1572
1575
  if (m.followerStatus)
1573
1576
  return String(m.followerStatus);
1574
1577
  if (m.isFollower !== void 0)
1575
1578
  return m.isFollower ? "Subscribed to you" : "Not subscribed";
1576
- }, [p.data]), k = A(() => {
1579
+ }, [p.data]), E = A(() => {
1577
1580
  var m;
1578
- (m = E.current) == null || m.showModal();
1581
+ (m = S.current) == null || m.showModal();
1579
1582
  }, []), P = A(() => {
1580
1583
  var m;
1581
- (m = E.current) == null || m.close();
1584
+ (m = S.current) == null || m.close();
1582
1585
  }, []), v = A(
1583
1586
  (m) => {
1584
1587
  const { message: f } = ut("ChannelView"), T = /* @__PURE__ */ e(
@@ -1599,12 +1602,12 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1599
1602
  {
1600
1603
  onBack: t,
1601
1604
  showBackButton: s,
1602
- onShowInfo: k,
1603
- canShowInfo: !!S,
1605
+ onShowInfo: E,
1606
+ canShowInfo: !!k,
1604
1607
  showStarButton: g
1605
1608
  }
1606
1609
  ) }),
1607
- N == null ? void 0 : N(),
1610
+ y == null ? void 0 : y(),
1608
1611
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1609
1612
  us,
1610
1613
  {
@@ -1624,11 +1627,11 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1624
1627
  /* @__PURE__ */ e(
1625
1628
  Ws,
1626
1629
  {
1627
- dialogRef: E,
1630
+ dialogRef: S,
1628
1631
  onClose: P,
1629
- participant: S,
1632
+ participant: k,
1630
1633
  channel: p,
1631
- followerStatusLabel: C,
1634
+ followerStatusLabel: N,
1632
1635
  onLeaveConversation: l,
1633
1636
  onBlockParticipant: d,
1634
1637
  showDeleteConversation: r,
@@ -1654,15 +1657,15 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1654
1657
  showDeleteConversation: u = !0,
1655
1658
  onDeleteConversationClick: g,
1656
1659
  onBlockParticipantClick: h,
1657
- onReportParticipantClick: N,
1660
+ onReportParticipantClick: y,
1658
1661
  dmAgentEnabled: a,
1659
1662
  messageMetadata: _,
1660
1663
  onMessageSent: w,
1661
1664
  showStarButton: p = !1,
1662
- chatbotVotingEnabled: E = !1,
1663
- renderChannelBanner: S,
1664
- customProfileContent: C,
1665
- customChannelActions: k,
1665
+ chatbotVotingEnabled: S = !1,
1666
+ renderChannelBanner: k,
1667
+ customProfileContent: N,
1668
+ customChannelActions: E,
1666
1669
  renderMessage: P,
1667
1670
  sendButton: v
1668
1671
  }) => {
@@ -1678,10 +1681,10 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1678
1681
  ..._
1679
1682
  }
1680
1683
  }
1681
- }, ee = {
1684
+ }, Q = {
1682
1685
  ...M,
1683
1686
  ...R && { skip_push: !0 }
1684
- }, J = await t.sendMessage(B, ee);
1687
+ }, J = await t.sendMessage(B, Q);
1685
1688
  return w == null || w(J), J;
1686
1689
  },
1687
1690
  [t, a, _, w]
@@ -1689,7 +1692,7 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1689
1692
  return /* @__PURE__ */ e(
1690
1693
  "div",
1691
1694
  {
1692
- className: O(
1695
+ className: U(
1693
1696
  "messaging-channel-view h-full flex flex-col",
1694
1697
  c
1695
1698
  ),
@@ -1716,12 +1719,12 @@ const he = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1716
1719
  showDeleteConversation: u,
1717
1720
  onDeleteConversationClick: g,
1718
1721
  onBlockParticipantClick: h,
1719
- onReportParticipantClick: N,
1722
+ onReportParticipantClick: y,
1720
1723
  showStarButton: p,
1721
- chatbotVotingEnabled: E,
1722
- renderChannelBanner: S,
1723
- customProfileContent: C,
1724
- customChannelActions: k,
1724
+ chatbotVotingEnabled: S,
1725
+ renderChannelBanner: k,
1726
+ customProfileContent: N,
1727
+ customChannelActions: E,
1725
1728
  renderMessage: P
1726
1729
  }
1727
1730
  )
@@ -1780,11 +1783,11 @@ const Dn = ({
1780
1783
  searchPlaceholder: d = "Search participants...",
1781
1784
  className: r
1782
1785
  }) => {
1783
- const { debug: c } = Le(), [x, u] = I(""), [g, h] = I([]), [N, a] = I(!1), [_, w] = I(null), [p, E] = I(
1786
+ const { debug: c } = Le(), [x, u] = I(""), [g, h] = I([]), [y, a] = I(!1), [_, w] = I(null), [p, S] = I(
1784
1787
  null
1785
- ), S = X(!1);
1788
+ ), k = X(!1);
1786
1789
  q(() => {
1787
- S.current = !1;
1790
+ k.current = !1;
1788
1791
  }, [t]), q(() => {
1789
1792
  if (t.loading) {
1790
1793
  c && console.log(
@@ -1792,7 +1795,7 @@ const Dn = ({
1792
1795
  );
1793
1796
  return;
1794
1797
  }
1795
- if (S.current) return;
1798
+ if (k.current) return;
1796
1799
  (async () => {
1797
1800
  c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), w(null);
1798
1801
  try {
@@ -1801,7 +1804,7 @@ const Dn = ({
1801
1804
  // Load all participants initially
1802
1805
  limit: 100
1803
1806
  });
1804
- h(m.participants), S.current = !0, c && console.log(
1807
+ h(m.participants), k.current = !0, c && console.log(
1805
1808
  "[ParticipantPicker] Participants loaded successfully:",
1806
1809
  m.participants.length
1807
1810
  );
@@ -1813,27 +1816,27 @@ const Dn = ({
1813
1816
  }
1814
1817
  })();
1815
1818
  }, [t, c]);
1816
- const C = g.filter((v) => !o.has(v.id)).filter((v) => {
1819
+ const N = g.filter((v) => !o.has(v.id)).filter((v) => {
1817
1820
  var f;
1818
1821
  if (!x) return !0;
1819
1822
  const m = x.toLowerCase();
1820
1823
  return v.name.toLowerCase().includes(m) || ((f = v.email) == null ? void 0 : f.toLowerCase().includes(m)) || !1;
1821
- }), k = A(
1824
+ }), E = A(
1822
1825
  async (v) => {
1823
1826
  if (!p) {
1824
- E(v.id);
1827
+ S(v.id);
1825
1828
  try {
1826
1829
  await s(v);
1827
1830
  } catch (m) {
1828
- console.error("[ParticipantPicker] Failed to start chat:", m), E(null);
1831
+ console.error("[ParticipantPicker] Failed to start chat:", m), S(null);
1829
1832
  }
1830
1833
  }
1831
1834
  },
1832
1835
  [s, p]
1833
1836
  ), P = (v, m) => {
1834
- (v.key === "Enter" || v.key === " ") && (v.preventDefault(), k(m));
1837
+ (v.key === "Enter" || v.key === " ") && (v.preventDefault(), E(m));
1835
1838
  };
1836
- return /* @__PURE__ */ i("div", { className: O("flex flex-col h-full", r), children: [
1839
+ return /* @__PURE__ */ i("div", { className: U("flex flex-col h-full", r), children: [
1837
1840
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1838
1841
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1839
1842
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
@@ -1843,7 +1846,7 @@ const Dn = ({
1843
1846
  "Select a ",
1844
1847
  l.slice(0, -1),
1845
1848
  " to start messaging (",
1846
- C.length,
1849
+ N.length,
1847
1850
  " available)",
1848
1851
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1849
1852
  ] }),
@@ -1862,25 +1865,25 @@ const Dn = ({
1862
1865
  ": ",
1863
1866
  _
1864
1867
  ] }),
1865
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: N && C.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1868
+ /* @__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__ */ i("div", { className: "flex items-center space-x-2", children: [
1866
1869
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1867
1870
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1868
1871
  "Loading ",
1869
1872
  l,
1870
1873
  "..."
1871
1874
  ] })
1872
- ] }) }) : C.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1875
+ ] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1873
1876
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(et, { className: "h-8 w-8 text-charcoal" }) }),
1874
1877
  /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : g.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1875
1878
  /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" : g.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1876
1879
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1877
- C.map((v) => {
1880
+ N.map((v) => {
1878
1881
  const m = v.name || v.email || v.id, f = v.email && v.name ? v.email : v.phone;
1879
1882
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1880
1883
  "button",
1881
1884
  {
1882
1885
  type: "button",
1883
- onClick: () => k(v),
1886
+ onClick: () => E(v),
1884
1887
  onKeyDown: (T) => P(T, v),
1885
1888
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1886
1889
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
@@ -1904,7 +1907,7 @@ const Dn = ({
1904
1907
  }
1905
1908
  ) }, v.id);
1906
1909
  }),
1907
- N && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1910
+ y && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1908
1911
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1909
1912
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1910
1913
  ] }) })
@@ -2082,15 +2085,15 @@ const aa = ({
2082
2085
  showChannelList: u = !0,
2083
2086
  filters: g,
2084
2087
  channelRenderFilterFn: h,
2085
- channelListCustomEmptyStateIndicator: N,
2088
+ channelListCustomEmptyStateIndicator: y,
2086
2089
  onDeleteConversationClick: a,
2087
2090
  onBlockParticipantClick: _,
2088
2091
  onReportParticipantClick: w,
2089
2092
  dmAgentEnabled: p,
2090
- messageMetadata: E,
2091
- onMessageSent: S,
2092
- showStarButton: C = !1,
2093
- chatbotVotingEnabled: k = !1,
2093
+ messageMetadata: S,
2094
+ onMessageSent: k,
2095
+ showStarButton: N = !1,
2096
+ chatbotVotingEnabled: E = !1,
2094
2097
  renderMessagePreview: P,
2095
2098
  renderChannelBanner: v,
2096
2099
  customProfileContent: m,
@@ -2102,11 +2105,11 @@ const aa = ({
2102
2105
  service: L,
2103
2106
  client: R,
2104
2107
  isConnected: B,
2105
- isLoading: ee,
2108
+ isLoading: Q,
2106
2109
  error: J,
2107
2110
  refreshConnection: V,
2108
2111
  debug: F
2109
- } = Ls(), [H, Z] = I(null), [ae, K] = I(!1), [b, y] = I(!1), [U, j] = I(!1), [te, le] = I(/* @__PURE__ */ new Set()), [pe, Pe] = I(0), [Y, Q] = I(!1), [xe, re] = I(null), me = X(null), {
2112
+ } = Ls(), [H, Z] = I(null), [ae, K] = I(!1), [b, C] = I(!1), [O, j] = I(!1), [ee, le] = I(/* @__PURE__ */ new Set()), [pe, Pe] = I(0), [Y, te] = I(!1), [xe, re] = I(null), me = X(null), {
2110
2113
  participantSource: ie,
2111
2114
  participantLabel: ve = "participants",
2112
2115
  showDeleteConversation: ge = !0
@@ -2144,7 +2147,7 @@ const aa = ({
2144
2147
  const Ae = (qe = Tt.user) == null ? void 0 : qe.id;
2145
2148
  Ae && Ae !== D && $.add(Ae);
2146
2149
  });
2147
- }), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0), y(!0), ce.current = D, F && console.log("[MessagingShell] Channels synced successfully:", {
2150
+ }), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0), C(!0), ce.current = D, F && console.log("[MessagingShell] Channels synced successfully:", {
2148
2151
  channelCount: W.length,
2149
2152
  memberCount: $.size
2150
2153
  });
@@ -2175,7 +2178,7 @@ const aa = ({
2175
2178
  { limit: 1 }
2176
2179
  );
2177
2180
  if ($.length > 0)
2178
- Z($[0]), Q(!0), re(null), l && l($[0]), F && console.log(
2181
+ Z($[0]), te(!0), re(null), l && l($[0]), F && console.log(
2179
2182
  "[MessagingShell] Initial conversation loaded:",
2180
2183
  $[0].id
2181
2184
  );
@@ -2191,7 +2194,7 @@ const aa = ({
2191
2194
  email: c.email,
2192
2195
  phone: c.phone
2193
2196
  });
2194
- Z(G), Q(!0), re(null), l && l(G), F && console.log(
2197
+ Z(G), te(!0), re(null), l && l(G), F && console.log(
2195
2198
  "[MessagingShell] Channel created and loaded:",
2196
2199
  G.id
2197
2200
  );
@@ -2267,25 +2270,25 @@ const aa = ({
2267
2270
  [de]
2268
2271
  ), Ee = A(
2269
2272
  async (D) => {
2270
- F && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), Q(!1), ce.current = null, await ne();
2273
+ F && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), te(!1), ce.current = null, await ne();
2271
2274
  },
2272
2275
  [ne, F]
2273
2276
  ), Se = A(
2274
2277
  async (D) => {
2275
- F && console.log("[MessagingShell] Blocking participant:", D), Z(null), Q(!1), ce.current = null, await ne();
2278
+ F && console.log("[MessagingShell] Blocking participant:", D), Z(null), te(!1), ce.current = null, await ne();
2276
2279
  },
2277
2280
  [ne, F]
2278
2281
  ), ue = !!H;
2279
- return ee ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(De, {}) }) : J ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: J, onBack: V }) }) : !B || !R ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(
2282
+ return Q ? /* @__PURE__ */ e("div", { className: U("h-full", s), children: /* @__PURE__ */ e(De, {}) }) : J ? /* @__PURE__ */ e("div", { className: U("h-full", s), children: /* @__PURE__ */ e(Te, { message: J, onBack: V }) }) : !B || !R ? /* @__PURE__ */ e("div", { className: U("h-full", s), children: /* @__PURE__ */ e(
2280
2283
  Te,
2281
2284
  {
2282
2285
  message: "Not connected to messaging service",
2283
2286
  onBack: V
2284
2287
  }
2285
- ) }) : xe ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: xe }) }) : /* @__PURE__ */ i(
2288
+ ) }) : xe ? /* @__PURE__ */ e("div", { className: U("h-full", s), children: /* @__PURE__ */ e(Te, { message: xe }) }) : /* @__PURE__ */ i(
2286
2289
  "div",
2287
2290
  {
2288
- className: O(
2291
+ className: U(
2289
2292
  "messaging-shell h-full bg-background-primary overflow-hidden",
2290
2293
  s
2291
2294
  ),
@@ -2294,7 +2297,7 @@ const aa = ({
2294
2297
  /* @__PURE__ */ e(
2295
2298
  "div",
2296
2299
  {
2297
- className: O(
2300
+ className: U(
2298
2301
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2299
2302
  {
2300
2303
  "!hidden": u === !1 || Y,
@@ -2311,7 +2314,7 @@ const aa = ({
2311
2314
  selectedChannel: H || void 0,
2312
2315
  filters: we,
2313
2316
  channelRenderFilterFn: h,
2314
- customEmptyStateIndicator: N,
2317
+ customEmptyStateIndicator: y,
2315
2318
  renderMessagePreview: P
2316
2319
  }
2317
2320
  )
@@ -2320,7 +2323,7 @@ const aa = ({
2320
2323
  /* @__PURE__ */ e(
2321
2324
  "div",
2322
2325
  {
2323
- className: O(
2326
+ className: U(
2324
2327
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2325
2328
  {
2326
2329
  // In direct conversation mode (or waiting for it), always show (full width)
@@ -2346,10 +2349,10 @@ const aa = ({
2346
2349
  onBlockParticipantClick: _,
2347
2350
  onReportParticipantClick: w,
2348
2351
  dmAgentEnabled: p,
2349
- messageMetadata: E,
2350
- onMessageSent: S,
2351
- showStarButton: C,
2352
- chatbotVotingEnabled: k,
2352
+ messageMetadata: S,
2353
+ onMessageSent: k,
2354
+ showStarButton: N,
2355
+ chatbotVotingEnabled: E,
2353
2356
  customProfileContent: m,
2354
2357
  customChannelActions: f,
2355
2358
  renderMessage: T,
@@ -2383,7 +2386,7 @@ const aa = ({
2383
2386
  participantSource: ie,
2384
2387
  onSelectParticipant: Ce,
2385
2388
  onClose: de,
2386
- existingParticipantIds: te,
2389
+ existingParticipantIds: ee,
2387
2390
  participantLabel: ve,
2388
2391
  searchPlaceholder: `Search ${ve}...`
2389
2392
  },
@@ -2406,7 +2409,7 @@ const aa = ({
2406
2409
  onClick: s,
2407
2410
  disabled: n,
2408
2411
  style: { backgroundColor: "#E6E5E3" },
2409
- className: O(
2412
+ className: U(
2410
2413
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
2411
2414
  {
2412
2415
  "hover:brightness-95 active:brightness-90": !n,
@@ -2481,7 +2484,7 @@ const An = {
2481
2484
  audio: ws,
2482
2485
  image: vs,
2483
2486
  document: mt
2484
- }, Un = {
2487
+ }, On = {
2485
2488
  pdf: Ts,
2486
2489
  doc: Is,
2487
2490
  xls: ks,
@@ -2492,12 +2495,12 @@ const An = {
2492
2495
  markdown: ys,
2493
2496
  generic: mt
2494
2497
  };
2495
- function On(t) {
2498
+ function Un(t) {
2496
2499
  const s = Ye(t);
2497
- return s !== "document" ? An[s] : Un[Fn(t)];
2500
+ return s !== "document" ? An[s] : On[Fn(t)];
2498
2501
  }
2499
2502
  function We(t, s) {
2500
- return z.createElement(On(t), s);
2503
+ return z.createElement(Un(t), s);
2501
2504
  }
2502
2505
  const $n = (t) => {
2503
2506
  var s, n;
@@ -2514,23 +2517,23 @@ const $n = (t) => {
2514
2517
  muted: x = !1,
2515
2518
  onContainerClick: u
2516
2519
  }) => {
2517
- const g = Ye(s), h = X(null), N = X(null), a = X(null), _ = X(l), [w, p] = I(o), [E, S] = I(0), [C, k] = I(!1), [P, v] = I(!1), [m, f] = I(!1), [T, M] = I(!1), [L, R] = I(!0), [B, ee] = I(null), J = A(() => {
2520
+ const g = Ye(s), h = X(null), y = X(null), a = X(null), _ = X(l), [w, p] = I(o), [S, k] = I(0), [N, E] = I(!1), [P, v] = I(!1), [m, f] = I(!1), [T, M] = I(!1), [L, R] = I(!0), [B, Q] = I(null), J = A(() => {
2518
2521
  f(!1), p(!0);
2519
2522
  }, []), V = A((b) => {
2520
- const y = N.current;
2521
- if (!y) return 0;
2522
- const U = y.getBoundingClientRect();
2523
+ const C = y.current;
2524
+ if (!C) return 0;
2525
+ const O = C.getBoundingClientRect();
2523
2526
  return Math.max(
2524
2527
  0,
2525
- Math.min(1, ($n(b) - U.left) / U.width)
2528
+ Math.min(1, ($n(b) - O.left) / O.width)
2526
2529
  );
2527
2530
  }, []), F = A((b) => {
2528
- const y = h.current;
2529
- y && y.duration && (y.currentTime = b * y.duration);
2531
+ const C = h.current;
2532
+ C && C.duration && (C.currentTime = b * C.duration);
2530
2533
  }, []), H = (b) => {
2531
- b.stopPropagation(), k(!0);
2532
- const y = V(b);
2533
- S(y), F(y);
2534
+ b.stopPropagation(), E(!0);
2535
+ const C = V(b);
2536
+ k(C), F(C);
2534
2537
  };
2535
2538
  q(() => {
2536
2539
  l !== void 0 && l !== _.current && (_.current = l, p(l));
@@ -2540,27 +2543,27 @@ const $n = (t) => {
2540
2543
  return;
2541
2544
  }
2542
2545
  const b = () => {
2543
- const y = h.current;
2544
- y && y.duration && !C && S(y.currentTime / y.duration), a.current = requestAnimationFrame(b);
2546
+ const C = h.current;
2547
+ C && C.duration && !N && k(C.currentTime / C.duration), a.current = requestAnimationFrame(b);
2545
2548
  };
2546
2549
  return a.current = requestAnimationFrame(b), () => {
2547
2550
  a.current !== null && cancelAnimationFrame(a.current);
2548
2551
  };
2549
- }, [w, C]), q(() => {
2552
+ }, [w, N]), q(() => {
2550
2553
  const b = h.current;
2551
- b && (w ? b.play().catch((y) => {
2554
+ b && (w ? b.play().catch((C) => {
2552
2555
  p(!1), f(!0);
2553
2556
  }) : b.pause());
2554
2557
  }, [w]), q(() => {
2555
- if (!C) return;
2556
- const b = (U) => S(V(U)), y = (U) => {
2557
- k(!1), F(V(U));
2558
+ if (!N) return;
2559
+ const b = (O) => k(V(O)), C = (O) => {
2560
+ E(!1), F(V(O));
2558
2561
  };
2559
- return window.addEventListener("mousemove", b), window.addEventListener("mouseup", y), window.addEventListener("touchmove", b, { passive: !0 }), window.addEventListener("touchend", y), () => {
2560
- window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", y), window.removeEventListener("touchmove", b), window.removeEventListener("touchend", y);
2562
+ return window.addEventListener("mousemove", b), window.addEventListener("mouseup", C), window.addEventListener("touchmove", b, { passive: !0 }), window.addEventListener("touchend", C), () => {
2563
+ window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", C), window.removeEventListener("touchmove", b), window.removeEventListener("touchend", C);
2561
2564
  };
2562
- }, [C, V, F]);
2563
- const Z = B ? { aspectRatio: String(B) } : void 0, ae = B ? "" : " aspect-video", K = Math.round(E * 100);
2565
+ }, [N, V, F]);
2566
+ const Z = B ? { aspectRatio: String(B) } : void 0, ae = B ? "" : " aspect-video", K = Math.round(S * 100);
2564
2567
  return /* @__PURE__ */ i(
2565
2568
  "div",
2566
2569
  {
@@ -2573,7 +2576,7 @@ const $n = (t) => {
2573
2576
  u(b);
2574
2577
  return;
2575
2578
  }
2576
- m || r && p((y) => !y);
2579
+ m || r && p((C) => !C);
2577
2580
  },
2578
2581
  onKeyDown: (b) => {
2579
2582
  if (!(b.key !== "Enter" && b.key !== " ")) {
@@ -2581,7 +2584,7 @@ const $n = (t) => {
2581
2584
  u(b);
2582
2585
  return;
2583
2586
  }
2584
- m || r && p((y) => !y);
2587
+ m || r && p((C) => !C);
2585
2588
  }
2586
2589
  },
2587
2590
  children: [
@@ -2612,7 +2615,7 @@ const $n = (t) => {
2612
2615
  onWaiting: () => M(!0),
2613
2616
  onPlay: () => f(!1),
2614
2617
  onEnded: () => {
2615
- d || (p(!1), S(0));
2618
+ d || (p(!1), k(0));
2616
2619
  },
2617
2620
  children: /* @__PURE__ */ e("track", { kind: "captions" })
2618
2621
  }
@@ -2633,10 +2636,10 @@ const $n = (t) => {
2633
2636
  onPlay: () => f(!1),
2634
2637
  onLoadedMetadata: () => {
2635
2638
  const b = h.current;
2636
- b instanceof HTMLVideoElement && b.videoWidth && b.videoHeight && ee(b.videoWidth / b.videoHeight);
2639
+ b instanceof HTMLVideoElement && b.videoWidth && b.videoHeight && Q(b.videoWidth / b.videoHeight);
2637
2640
  },
2638
2641
  onEnded: () => {
2639
- d || (p(!1), S(0));
2642
+ d || (p(!1), k(0));
2640
2643
  },
2641
2644
  children: /* @__PURE__ */ e("track", { kind: "captions" })
2642
2645
  }
@@ -2673,13 +2676,13 @@ const $n = (t) => {
2673
2676
  "aria-valuemin": 0,
2674
2677
  "aria-valuemax": 100,
2675
2678
  tabIndex: 0,
2676
- ref: N,
2679
+ ref: y,
2677
2680
  className: "relative flex h-4 w-full cursor-pointer items-center",
2678
2681
  onMouseDown: H,
2679
2682
  onTouchStart: H,
2680
2683
  onClick: (b) => b.stopPropagation(),
2681
2684
  onKeyDown: (b) => {
2682
- b.key === "ArrowRight" && F(Math.min(1, E + 0.05)), b.key === "ArrowLeft" && F(Math.max(0, E - 0.05));
2685
+ b.key === "ArrowRight" && F(Math.min(1, S + 0.05)), b.key === "ArrowLeft" && F(Math.max(0, S - 0.05));
2683
2686
  },
2684
2687
  children: /* @__PURE__ */ e("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ e(
2685
2688
  "div",
@@ -2696,7 +2699,7 @@ const $n = (t) => {
2696
2699
  {
2697
2700
  type: "button",
2698
2701
  onClick: (b) => {
2699
- b.stopPropagation(), p((y) => !y);
2702
+ b.stopPropagation(), p((C) => !C);
2700
2703
  },
2701
2704
  className: "shrink-0 text-white",
2702
2705
  "aria-label": w ? "Pause" : "Play",
@@ -2712,7 +2715,7 @@ const $n = (t) => {
2712
2715
  "aria-valuemin": 0,
2713
2716
  "aria-valuemax": 100,
2714
2717
  tabIndex: 0,
2715
- ref: N,
2718
+ ref: y,
2716
2719
  className: "relative flex h-4 w-full cursor-pointer items-center",
2717
2720
  onMouseDown: H,
2718
2721
  onTouchStart: H,
@@ -2720,13 +2723,13 @@ const $n = (t) => {
2720
2723
  onMouseEnter: () => v(!0),
2721
2724
  onMouseLeave: () => v(!1),
2722
2725
  onKeyDown: (b) => {
2723
- b.key === "ArrowRight" && F(Math.min(1, E + 0.05)), b.key === "ArrowLeft" && F(Math.max(0, E - 0.05));
2726
+ b.key === "ArrowRight" && F(Math.min(1, S + 0.05)), b.key === "ArrowLeft" && F(Math.max(0, S - 0.05));
2724
2727
  },
2725
2728
  children: [
2726
2729
  /* @__PURE__ */ e(
2727
2730
  "div",
2728
2731
  {
2729
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || C ? "h-1.5" : "h-1"}`,
2732
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${P || N ? "h-1.5" : "h-1"}`,
2730
2733
  children: /* @__PURE__ */ e(
2731
2734
  "div",
2732
2735
  {
@@ -2739,7 +2742,7 @@ const $n = (t) => {
2739
2742
  /* @__PURE__ */ e(
2740
2743
  "div",
2741
2744
  {
2742
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || C ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
2745
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${P || N ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
2743
2746
  style: { left: `${K}%` }
2744
2747
  }
2745
2748
  )
@@ -2814,7 +2817,7 @@ const Hn = ({
2814
2817
  );
2815
2818
  }, Me = ({ mimeType: t, title: s, fileSize: n, url: o, isMyMessage: l }) => /* @__PURE__ */ i("div", { className: "flex items-start gap-2 px-4 pb-3 pt-3", children: [
2816
2819
  /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
2817
- s && /* @__PURE__ */ e("p", { className: `mb-1.5 truncate text-base font-medium ${St(l)}`, children: s }),
2820
+ s && /* @__PURE__ */ e("p", { className: `truncate text-base font-medium ${St(l)}`, children: s }),
2818
2821
  n !== void 0 && /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
2819
2822
  We(t, {
2820
2823
  className: `size-5 shrink-0 ${be(l)}`,
@@ -2936,10 +2939,10 @@ const Hn = ({
2936
2939
  message: t,
2937
2940
  isMyMessage: s = !1
2938
2941
  }) => {
2939
- var C, k, P, v, m;
2940
- const [n, o] = I(!1), l = (C = t.attachments) == null ? void 0 : C.find(
2942
+ var N, E, P, v, m;
2943
+ const [n, o] = I(!1), l = (N = t.attachments) == null ? void 0 : N.find(
2941
2944
  (f) => f.type === "link" || f.og_scrape_url && !f.asset_url
2942
- ), d = (k = t.attachments) == null ? void 0 : k.find(
2945
+ ), d = (E = t.attachments) == null ? void 0 : E.find(
2943
2946
  (f) => f.type === "video" && f.asset_url
2944
2947
  ), r = (P = t.attachments) == null ? void 0 : P.find(
2945
2948
  (f) => f.type === "image" && f.image_url
@@ -2949,9 +2952,9 @@ const Hn = ({
2949
2952
  (f) => f.type === "file" && f.asset_url
2950
2953
  ), u = d ?? r ?? c ?? x, g = (d == null ? void 0 : d.asset_url) ?? (r == null ? void 0 : r.image_url) ?? (c == null ? void 0 : c.asset_url) ?? (x == null ? void 0 : x.asset_url), h = (u == null ? void 0 : u.mime_type) ?? ((u == null ? void 0 : u.type) === "image" ? "image/jpeg" : (u == null ? void 0 : u.type) === "video" ? "video/mp4" : (u == null ? void 0 : u.type) === "audio" ? "audio/mpeg" : "application/octet-stream");
2951
2954
  if (!l && !g) return null;
2952
- const N = g ? Ye(h) : null, a = u == null ? void 0 : u.title, _ = u == null ? void 0 : u.file_size, w = d == null ? void 0 : d.thumb_url, p = h === "application/pdf", E = s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", S = N === "image" || N === "video" || p;
2955
+ const y = g ? Ye(h) : null, a = u == null ? void 0 : u.title, _ = u == null ? void 0 : u.file_size, w = d == null ? void 0 : d.thumb_url, p = h === "application/pdf", S = s ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", k = y === "image" || y === "video" || p;
2953
2956
  return /* @__PURE__ */ i(se, { children: [
2954
- /* @__PURE__ */ i("div", { className: E, children: [
2957
+ /* @__PURE__ */ i("div", { className: S, children: [
2955
2958
  !s && t.user && /* @__PURE__ */ e(
2956
2959
  oe,
2957
2960
  {
@@ -2971,7 +2974,7 @@ const Hn = ({
2971
2974
  {
2972
2975
  className: "str-chat__message-bubble",
2973
2976
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
2974
- children: /* @__PURE__ */ e("div", { className: Bn(s), children: l ? /* @__PURE__ */ e(Wn, { attachment: l, isMyMessage: s }) : N === "image" ? /* @__PURE__ */ i(se, { children: [
2977
+ children: /* @__PURE__ */ e("div", { className: Bn(s), children: l ? /* @__PURE__ */ e(Wn, { attachment: l, isMyMessage: s }) : y === "image" ? /* @__PURE__ */ i(se, { children: [
2975
2978
  /* @__PURE__ */ e(
2976
2979
  "button",
2977
2980
  {
@@ -2991,7 +2994,7 @@ const Hn = ({
2991
2994
  isMyMessage: s
2992
2995
  }
2993
2996
  )
2994
- ] }) : N === "video" ? /* @__PURE__ */ i(se, { children: [
2997
+ ] }) : y === "video" ? /* @__PURE__ */ i(se, { children: [
2995
2998
  /* @__PURE__ */ e(
2996
2999
  Ve,
2997
3000
  {
@@ -3012,7 +3015,7 @@ const Hn = ({
3012
3015
  isMyMessage: s
3013
3016
  }
3014
3017
  )
3015
- ] }) : N === "audio" ? /* @__PURE__ */ i(se, { children: [
3018
+ ] }) : y === "audio" ? /* @__PURE__ */ i(se, { children: [
3016
3019
  /* @__PURE__ */ e(
3017
3020
  Ve,
3018
3021
  {
@@ -3050,10 +3053,10 @@ const Hn = ({
3050
3053
  }
3051
3054
  )
3052
3055
  ] }),
3053
- n && S && g && /* @__PURE__ */ e(
3056
+ n && k && g && /* @__PURE__ */ e(
3054
3057
  qn,
3055
3058
  {
3056
- sourceType: N,
3059
+ sourceType: y,
3057
3060
  url: g,
3058
3061
  mimeType: h,
3059
3062
  title: a,
@@ -3063,7 +3066,7 @@ const Hn = ({
3063
3066
  )
3064
3067
  ] });
3065
3068
  }, la = (t, s = {}) => {
3066
- const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = I([]), [r, c] = I(!1), [x, u] = I(null), [g, h] = I(n), [N, a] = I(!0), [_, w] = I(), p = A(async (k = !1, P) => {
3069
+ const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = I([]), [r, c] = I(!1), [x, u] = I(null), [g, h] = I(n), [y, a] = I(!0), [_, w] = I(), p = A(async (E = !1, P) => {
3067
3070
  if (r) return;
3068
3071
  const v = P !== void 0 ? P : g;
3069
3072
  c(!0), u(null);
@@ -3071,10 +3074,10 @@ const Hn = ({
3071
3074
  const m = await t.loadParticipants({
3072
3075
  search: v || void 0,
3073
3076
  limit: o,
3074
- cursor: k ? void 0 : _
3077
+ cursor: E ? void 0 : _
3075
3078
  });
3076
3079
  d(
3077
- (f) => k ? m.participants : [...f, ...m.participants]
3080
+ (f) => E ? m.participants : [...f, ...m.participants]
3078
3081
  ), a(m.hasMore), w(m.nextCursor);
3079
3082
  } catch (m) {
3080
3083
  const f = m instanceof Error ? m.message : "Failed to load participants";
@@ -3082,11 +3085,11 @@ const Hn = ({
3082
3085
  } finally {
3083
3086
  c(!1);
3084
3087
  }
3085
- }, [t, g, _, o, r]), E = A(() => {
3086
- N && !r && p(!1);
3087
- }, [N, r, p]), S = A((k) => {
3088
- h(k), w(void 0), p(!0, k);
3089
- }, [p]), C = A(() => {
3088
+ }, [t, g, _, o, r]), S = A(() => {
3089
+ y && !r && p(!1);
3090
+ }, [y, r, p]), k = A((E) => {
3091
+ h(E), w(void 0), p(!0, E);
3092
+ }, [p]), N = A(() => {
3090
3093
  w(void 0), p(!0);
3091
3094
  }, [p]);
3092
3095
  return q(() => {
@@ -3096,11 +3099,11 @@ const Hn = ({
3096
3099
  loading: r,
3097
3100
  error: x,
3098
3101
  searchQuery: g,
3099
- hasMore: N,
3102
+ hasMore: y,
3100
3103
  totalCount: t.totalCount,
3101
- loadMore: E,
3102
- search: S,
3103
- refresh: C
3104
+ loadMore: S,
3105
+ search: k,
3106
+ refresh: N
3104
3107
  };
3105
3108
  };
3106
3109
  export {
@@ -3120,11 +3123,11 @@ export {
3120
3123
  on as h,
3121
3124
  sa as i,
3122
3125
  aa as j,
3123
- Os as k,
3126
+ Us as k,
3124
3127
  Xs as l,
3125
3128
  Ls as m,
3126
3129
  la as n,
3127
3130
  We as r,
3128
3131
  nn as u
3129
3132
  };
3130
- //# sourceMappingURL=index-Ydi1pTAi.js.map
3133
+ //# sourceMappingURL=index-DWk0f1PF.js.map