@linktr.ee/messaging-react 3.12.3-rc-1784032997 → 3.12.3-rc-1784034329

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,9 +1,9 @@
1
1
  import { jsx as s, jsxs as u, Fragment as se } from "react/jsx-runtime";
2
- import V, { createContext as ct, useContext as Te, useCallback as J, useState as B, useRef as G, useEffect as K, useId as js, useMemo as re, Suspense as Vs } from "react";
2
+ import V, { createContext as ct, useContext as Te, useCallback as J, useState as U, useRef as G, useEffect as K, useId as js, useMemo as re, Suspense as Vs } from "react";
3
3
  import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
4
4
  import { StreamChat as Hs, LinkPreviewsManager as Yt } from "stream-chat";
5
- import { Chat as Ys, useChannelStateContext as ce, useChatContext as fe, DateSeparator as qs, MessageStatus as Ws, useMessageContext as Ne, MessageErrorIcon as nt, MessageText as $e, areMessageUIPropsEqual as Xs, useMessageReminder as Ks, useComponentContext as as, Attachment as Zs, EditMessageModal as Js, MessageBlocked as Qs, MessageBouncePrompt as en, MessageDeleted as tn, MessageIsThreadReplyInChannelButtonIndicator as sn, MessageRepliesCountButton as nn, ReminderNotification as an, StreamedMessageText as rn, messageHasAttachments as ln, messageHasReactions as on, isDateSeparatorMessage as cn, isMessageBlocked as dn, isMessageBounced as un, MessageBounceModal as mn, Poll as hn, useMessageComposer as fn, useStateStore as gn, MessageInput as pn, useMessageInputContext as bn, useMessageComposerHasSendableData as vn, AttachmentPreviewList as xn, QuotedMessagePreview as wn, TextareaComposer as _n, MessageTimestamp as Xe, AIStates as Ke, useTypingContext as Nn, useAIState as yn, Channel as kn, WithComponents as Cn, Window as Sn, MessageList as En, ChannelList as In, InfiniteScroll as Tn } from "stream-chat-react";
6
- import { StarIcon as Ie, DotsThreeIcon as Mn, SpinnerGapIcon as Fe, SignOutIcon as An, ProhibitInsetIcon as qt, FlagIcon as rs, ArrowLeftIcon as at, CurrencyDollarIcon as Rn, CaretRightIcon as xe, SparkleIcon as we, FileIcon as is, ImageIcon as Ln, SpeakerHighIcon as Dn, VideoCameraIcon as ls, FileMdIcon as zn, FileTextIcon as Fn, FileZipIcon as Pn, FilePptIcon as On, FileCsvIcon as $n, FileXlsIcon as Un, FileDocIcon as Bn, FilePdfIcon as jn, CircleNotchIcon as Se, PlayIcon as rt, PauseIcon as Vn, LinkIcon as Gn, DownloadSimpleIcon as Ee, XIcon as Ge, CaretLeftIcon as Hn, GiftIcon as Yn, ThumbsUpIcon as qn, ThumbsDownIcon as Wn, ChecksIcon as Xn, PencilSimpleIcon as Kn, TrashSimpleIcon as Zn, ArrowUpIcon as Jn, ProhibitIcon as Qn } from "@phosphor-icons/react";
5
+ import { Chat as Ys, useChannelStateContext as oe, useChatContext as fe, DateSeparator as qs, MessageStatus as Ws, useMessageContext as Ne, MessageErrorIcon as nt, MessageText as $e, areMessageUIPropsEqual as Xs, useMessageReminder as Ks, useComponentContext as as, Attachment as Zs, EditMessageModal as Js, MessageBlocked as Qs, MessageBouncePrompt as en, MessageDeleted as tn, MessageIsThreadReplyInChannelButtonIndicator as sn, MessageRepliesCountButton as nn, ReminderNotification as an, StreamedMessageText as rn, messageHasAttachments as ln, messageHasReactions as on, isDateSeparatorMessage as cn, isMessageBlocked as dn, isMessageBounced as un, MessageBounceModal as mn, Poll as hn, useMessageComposer as fn, useStateStore as gn, MessageInput as pn, useMessageInputContext as bn, useMessageComposerHasSendableData as vn, AttachmentPreviewList as xn, QuotedMessagePreview as wn, TextareaComposer as _n, MessageTimestamp as Xe, AIStates as Ke, useTypingContext as Nn, useAIState as yn, Channel as kn, WithComponents as Cn, Window as Sn, MessageList as En, ChannelList as In, InfiniteScroll as Tn } from "stream-chat-react";
6
+ import { StarIcon as Ie, DotsThreeIcon as Mn, SpinnerGapIcon as Fe, SignOutIcon as An, ProhibitInsetIcon as qt, FlagIcon as rs, ArrowLeftIcon as at, CurrencyDollarIcon as Rn, CaretRightIcon as xe, SparkleIcon as we, FileIcon as is, ImageIcon as Ln, SpeakerHighIcon as Dn, VideoCameraIcon as ls, FileMdIcon as zn, FileTextIcon as Fn, FileZipIcon as Pn, FilePptIcon as On, FileCsvIcon as $n, FileXlsIcon as Bn, FileDocIcon as Un, FilePdfIcon as jn, CircleNotchIcon as Se, PlayIcon as rt, PauseIcon as Vn, LinkIcon as Gn, DownloadSimpleIcon as Ee, XIcon as Ge, CaretLeftIcon as Hn, GiftIcon as Yn, ThumbsUpIcon as qn, ThumbsDownIcon as Wn, ChecksIcon as Xn, PencilSimpleIcon as Kn, TrashSimpleIcon as Zn, ArrowUpIcon as Jn, ProhibitIcon as Qn } from "@phosphor-icons/react";
7
7
  import y from "classnames";
8
8
  import { MessageActions as ea, DefaultDropdownActionButton as os } from "stream-chat-react/experimental";
9
9
  const cs = ct({
@@ -38,7 +38,7 @@ const cs = ct({
38
38
  serviceConfig: !!n,
39
39
  capabilities: Object.keys(r)
40
40
  });
41
- const [d, m] = B(null), [f, h] = B(null), [g, c] = B(!1), [b, v] = B(!1), [x, p] = B(null), _ = G(!1), w = G(null), k = G(n);
41
+ const [d, m] = U(null), [f, h] = U(null), [g, c] = U(!1), [b, v] = U(!1), [x, p] = U(null), _ = G(!1), w = G(null), k = G(n);
42
42
  k.current = n;
43
43
  const D = G(i);
44
44
  D.current = i;
@@ -226,7 +226,7 @@ const cs = ct({
226
226
  ) : e });
227
227
  }, ta = () => dt(), ut = (e) => {
228
228
  var a, r;
229
- const [t, n] = B(
229
+ const [t, n] = U(
230
230
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
231
231
  );
232
232
  return K(() => {
@@ -408,7 +408,7 @@ const ne = ({
408
408
  logLabel: f = "useChannelModerationActions"
409
409
  }) => {
410
410
  var E;
411
- const { service: h, debug: g } = dt(), c = (E = t == null ? void 0 : t.user) == null ? void 0 : E.id, b = !!(a && n && h && c), [v, x] = B(!1), [p, _] = B(null), [w, k] = B(!1), [D, S] = B(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
411
+ const { service: h, debug: g } = dt(), c = (E = t == null ? void 0 : t.user) == null ? void 0 : E.id, b = !!(a && n && h && c), [v, x] = U(!1), [p, _] = U(null), [w, k] = U(!1), [D, S] = U(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
412
412
  return K(() => {
413
413
  if (!b || !h || !c) {
414
414
  x(!1), _(null);
@@ -512,7 +512,7 @@ const ne = ({
512
512
  customChannelActions: f,
513
513
  triggerClassName: h
514
514
  }) => {
515
- const [g, c] = B(!1), b = G(null), v = js(), x = J(() => c(!1), []), {
515
+ const [g, c] = U(!1), b = G(null), v = js(), x = J(() => c(!1), []), {
516
516
  isParticipantBlocked: p,
517
517
  isCheckingBlockedStatus: _,
518
518
  isLeaving: w,
@@ -644,7 +644,7 @@ const ne = ({
644
644
  onParticipantNameClick: x
645
645
  }) => {
646
646
  var F, L, C;
647
- const { channel: p } = ce(), { client: _ } = fe(), w = V.useMemo(
647
+ const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
648
648
  () => {
649
649
  var E;
650
650
  return He(
@@ -791,7 +791,7 @@ function ba(e) {
791
791
  return e != null && e.length ? e.some((t) => t.type === ot) ? "down" : e.some((t) => t.type === lt) ? "up" : null : null;
792
792
  }
793
793
  function va(e) {
794
- const { channel: t } = ce(), { client: n } = fe("useMessageVote"), a = re(
794
+ const { channel: t } = oe(), { client: n } = fe("useMessageVote"), a = re(
795
795
  () => ba(e.own_reactions),
796
796
  [e.own_reactions]
797
797
  ), r = J(async () => {
@@ -828,7 +828,7 @@ function us({
828
828
  const n = e == null ? void 0 : e.text, a = xa(t);
829
829
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
830
830
  }
831
- const wa = ["linktr.ee", "cloudfront.net", "cloudinary"], _a = "messaging-attachment-v1_0";
831
+ const wa = ["linktr.ee"], _a = "messaging-attachment-v1_0";
832
832
  function Na(e) {
833
833
  try {
834
834
  return new URL(e).hostname.toLowerCase();
@@ -837,9 +837,11 @@ function Na(e) {
837
837
  }
838
838
  }
839
839
  function ya(e) {
840
- return wa.some((t) => e.includes(t));
840
+ return wa.some(
841
+ (t) => e === t || e.endsWith(`.${t}`)
842
+ );
841
843
  }
842
- function ie(e) {
844
+ function he(e) {
843
845
  const t = e == null ? void 0 : e.trim();
844
846
  if (!t) return;
845
847
  const n = Na(t);
@@ -858,7 +860,7 @@ const ka = [
858
860
  [/plain|rtf/, "text"],
859
861
  [/markdown/, "markdown"]
860
862
  ];
861
- function de(e) {
863
+ function ce(e) {
862
864
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
863
865
  }
864
866
  function ms(e) {
@@ -874,8 +876,8 @@ const Ca = {
874
876
  document: is
875
877
  }, Sa = {
876
878
  pdf: jn,
877
- doc: Bn,
878
- xls: Un,
879
+ doc: Un,
880
+ xls: Bn,
879
881
  csv: $n,
880
882
  ppt: On,
881
883
  zip: Pn,
@@ -884,7 +886,7 @@ const Ca = {
884
886
  generic: is
885
887
  };
886
888
  function Ea(e) {
887
- const t = de(e);
889
+ const t = ce(e);
888
890
  return t !== "document" ? Ca[t] : Sa[ms(e)];
889
891
  }
890
892
  function _e(e, t) {
@@ -905,7 +907,7 @@ const Ia = (e) => {
905
907
  muted: d = !1,
906
908
  onContainerClick: m
907
909
  }) => {
908
- const f = de(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] = B(a), [p, _] = B(0), [w, k] = B(!1), [D, S] = B(!1), [R, O] = B(!1), [F, L] = B(!1), [C, E] = B(!0), [I, T] = B(null), M = J(() => {
910
+ const f = ce(t), h = G(null), g = G(null), c = G(null), b = G(r), [v, x] = U(a), [p, _] = U(0), [w, k] = U(!1), [D, S] = U(!1), [R, O] = U(!1), [F, L] = U(!1), [C, E] = U(!0), [I, T] = U(null), M = J(() => {
909
911
  O(!1), x(!0);
910
912
  }, []), P = J((N) => {
911
913
  const A = g.current;
@@ -1150,7 +1152,7 @@ const Ia = (e) => {
1150
1152
  mediaPlayerProps: i,
1151
1153
  containedImage: o = !1
1152
1154
  }) => {
1153
- const l = de(e), [d, m] = B(!1), f = ie(t), h = ie(n);
1155
+ const l = ce(e), [d, m] = U(!1), f = he(t), h = he(n);
1154
1156
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
1155
1157
  Ta,
1156
1158
  {
@@ -1313,7 +1315,7 @@ const ft = ({ attachment: e, isMyMessage: t }) => {
1313
1315
  /* @__PURE__ */ s("div", { className: "p-2", children: r ? /* @__PURE__ */ s(
1314
1316
  "img",
1315
1317
  {
1316
- src: ie(r) ?? r,
1318
+ src: he(r) ?? r,
1317
1319
  alt: n ?? "",
1318
1320
  className: "aspect-video w-full rounded-[20px] object-cover"
1319
1321
  }
@@ -1355,7 +1357,7 @@ const Pa = ({
1355
1357
  url: e,
1356
1358
  filename: t
1357
1359
  }) => {
1358
- const [n, a] = B(!1);
1360
+ const [n, a] = U(!1);
1359
1361
  return /* @__PURE__ */ s(
1360
1362
  "button",
1361
1363
  {
@@ -1434,7 +1436,7 @@ const bs = ({
1434
1436
  fileSize: a,
1435
1437
  thumbnailUrl: r
1436
1438
  }) => {
1437
- const i = de(t), o = a !== void 0 ? gs(a) : void 0;
1439
+ const i = ce(t), o = a !== void 0 ? gs(a) : void 0;
1438
1440
  return /* @__PURE__ */ s(
1439
1441
  fs,
1440
1442
  {
@@ -1496,7 +1498,7 @@ const bs = ({
1496
1498
  return /* @__PURE__ */ s("div", { className: ht(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ft, { attachment: t, isMyMessage: !0 }) });
1497
1499
  const n = pt(e);
1498
1500
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(bs, { ...n }) }) : null;
1499
- }, Ua = ({
1501
+ }, Ba = ({
1500
1502
  message: e
1501
1503
  }) => {
1502
1504
  const t = gt(e);
@@ -1506,8 +1508,8 @@ const bs = ({
1506
1508
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
1507
1509
  }, fl = Object.assign(Oa, {
1508
1510
  Creator: $a,
1509
- Visitor: Ua
1510
- }), Ba = {
1511
+ Visitor: Ba
1512
+ }), Ua = {
1511
1513
  dark: "bg-[#1e2330]",
1512
1514
  light: "bg-[#f2f1ef]"
1513
1515
  }, ja = {
@@ -1553,7 +1555,7 @@ const bs = ({
1553
1555
  // as the surrounding `CustomMessage` text bubbles.
1554
1556
  "relative w-[280px] overflow-hidden px-2 py-2",
1555
1557
  d,
1556
- Ba[e],
1558
+ Ua[e],
1557
1559
  ja[e],
1558
1560
  n && "border",
1559
1561
  n && Va[e],
@@ -1684,7 +1686,7 @@ function tr(e, t) {
1684
1686
  }
1685
1687
  }
1686
1688
  if (!e) return;
1687
- if (de(e) === "document") {
1689
+ if (ce(e) === "document") {
1688
1690
  const r = ms(e), i = er[r];
1689
1691
  if (i) return i;
1690
1692
  if (e === "application/octet-stream") return;
@@ -1697,7 +1699,7 @@ function sr(e, t, n) {
1697
1699
  const a = tr(e, t), r = typeof n == "number" && n > 0 ? Qa(n) : void 0;
1698
1700
  return [a, r].filter(Boolean).join(" · ") || void 0;
1699
1701
  }
1700
- function le(e) {
1702
+ function ie(e) {
1701
1703
  try {
1702
1704
  const n = new URL(e).pathname.split("/").pop();
1703
1705
  return n && n.length > 0 ? decodeURIComponent(n) : "download";
@@ -1774,7 +1776,7 @@ const nr = {
1774
1776
  ] });
1775
1777
  };
1776
1778
  async function ws(e, t) {
1777
- const n = t ?? le(e);
1779
+ const n = t ?? ie(e);
1778
1780
  try {
1779
1781
  const a = await fetch(e, { mode: "cors" });
1780
1782
  if (!a.ok) throw new Error(`HTTP ${a.status}`);
@@ -1801,7 +1803,7 @@ const ir = ({
1801
1803
  onActivate: a,
1802
1804
  trailingAction: r
1803
1805
  }) => {
1804
- const i = t.filename ?? le(t.src);
1806
+ const i = t.filename ?? ie(t.src);
1805
1807
  return /* @__PURE__ */ s(
1806
1808
  xs,
1807
1809
  {
@@ -1839,7 +1841,7 @@ const ir = ({
1839
1841
  if ((m == null ? void 0 : m(x)) === !1) return;
1840
1842
  const p = c[x];
1841
1843
  if (!p) return;
1842
- const _ = p.filename ?? le(p.src);
1844
+ const _ = p.filename ?? ie(p.src);
1843
1845
  ws(p.src, _);
1844
1846
  };
1845
1847
  if (c.length === 0)
@@ -1914,7 +1916,7 @@ const ir = ({
1914
1916
  tone: i = "dark",
1915
1917
  onTriggered: o
1916
1918
  }) => {
1917
- const [l, d] = B(!1), m = J(
1919
+ const [l, d] = U(!1), m = J(
1918
1920
  (c) => {
1919
1921
  c.stopPropagation(), !l && (d(!0), ws(e, t).catch(() => {
1920
1922
  }).finally(() => {
@@ -1995,7 +1997,7 @@ const ir = ({
1995
1997
  initialIndex: t,
1996
1998
  open: n
1997
1999
  }) => {
1998
- const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
2000
+ const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] = U(a);
1999
2001
  K(() => {
2000
2002
  n && i(Je(t, 0, Math.max(e - 1, 0)));
2001
2003
  }, [n, t, e]), K(() => {
@@ -2116,7 +2118,7 @@ const ir = ({
2116
2118
  initialIndex: n,
2117
2119
  open: e
2118
2120
  }), l = t[r], d = re(
2119
- () => (l == null ? void 0 : l.filename) ?? (l ? le(l.src) : "image"),
2121
+ () => (l == null ? void 0 : l.filename) ?? (l ? ie(l.src) : "image"),
2120
2122
  [l]
2121
2123
  );
2122
2124
  return l ? /* @__PURE__ */ u(
@@ -2232,7 +2234,7 @@ const ir = ({
2232
2234
  }
2233
2235
  );
2234
2236
  }, Le = (e) => {
2235
- const [t, n] = B(!1), [a, r] = B(0), i = J(
2237
+ const [t, n] = U(!1), [a, r] = U(0), i = J(
2236
2238
  (l) => {
2237
2239
  (e == null ? void 0 : e(l)) !== !1 && (r(l), n(!0));
2238
2240
  },
@@ -2244,7 +2246,7 @@ const ir = ({
2244
2246
  content: /* @__PURE__ */ s(
2245
2247
  "img",
2246
2248
  {
2247
- src: ie(e.src) ?? e.src,
2249
+ src: he(e.src) ?? e.src,
2248
2250
  alt: e.alt ?? "",
2249
2251
  width: e.width,
2250
2252
  height: e.height,
@@ -2277,7 +2279,7 @@ const ir = ({
2277
2279
  children: /* @__PURE__ */ s(
2278
2280
  "img",
2279
2281
  {
2280
- src: ie(e) ?? e,
2282
+ src: he(e) ?? e,
2281
2283
  alt: t ?? "",
2282
2284
  draggable: !1,
2283
2285
  loading: a,
@@ -2353,7 +2355,7 @@ const ir = ({
2353
2355
  initialIndex: n,
2354
2356
  open: e
2355
2357
  }), l = t[r], d = re(
2356
- () => (l == null ? void 0 : l.filename) ?? (l ? le(l.src) : "document"),
2358
+ () => (l == null ? void 0 : l.filename) ?? (l ? ie(l.src) : "document"),
2357
2359
  [l]
2358
2360
  ), m = re(
2359
2361
  () => l ? _r(l.src) : void 0,
@@ -2406,7 +2408,7 @@ const ir = ({
2406
2408
  onActivate: a,
2407
2409
  trailingAction: r
2408
2410
  }) => {
2409
- const i = t.filename ?? le(t.src);
2411
+ const i = t.filename ?? ie(t.src);
2410
2412
  return /* @__PURE__ */ s(
2411
2413
  xs,
2412
2414
  {
@@ -2439,7 +2441,7 @@ const ir = ({
2439
2441
  return null;
2440
2442
  const p = h.map((_) => ({
2441
2443
  src: _.src,
2442
- filename: _.filename ?? le(_.src)
2444
+ filename: _.filename ?? ie(_.src)
2443
2445
  }));
2444
2446
  return /* @__PURE__ */ u(
2445
2447
  Me,
@@ -2450,7 +2452,7 @@ const ir = ({
2450
2452
  "data-testid": "pdf-attachment",
2451
2453
  children: [
2452
2454
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((_, w) => {
2453
- const k = _.filename ?? le(_.src), D = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2455
+ const k = _.filename ?? ie(_.src), D = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2454
2456
  _s,
2455
2457
  {
2456
2458
  url: _.src,
@@ -2499,7 +2501,7 @@ const ir = ({
2499
2501
  initialIndex: n,
2500
2502
  open: e
2501
2503
  }), l = t[r], d = re(
2502
- () => (l == null ? void 0 : l.filename) ?? (l ? le(l.src) : "video"),
2504
+ () => (l == null ? void 0 : l.filename) ?? (l ? ie(l.src) : "video"),
2503
2505
  [l]
2504
2506
  );
2505
2507
  return l ? /* @__PURE__ */ u(
@@ -2671,13 +2673,13 @@ const ir = ({
2671
2673
  function Or(e) {
2672
2674
  return Te(Ms)[e] ?? Pr[e];
2673
2675
  }
2674
- const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import("./Card-Bme-pBSF.js")), Br = () => /* @__PURE__ */ s(
2676
+ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import("./Card-dFpcKsyN.js")), Ur = () => /* @__PURE__ */ s(
2675
2677
  "div",
2676
2678
  {
2677
2679
  className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
2678
2680
  "aria-hidden": !0
2679
2681
  }
2680
- ), Pe = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Br, {}), children: e.contentType === "text" ? /* @__PURE__ */ s($r, { ...e }) : /* @__PURE__ */ s(Ur, { ...e }) }), jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
2682
+ ), Pe = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Ur, {}), children: e.contentType === "text" ? /* @__PURE__ */ s($r, { ...e }) : /* @__PURE__ */ s(Br, { ...e }) }), jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
2681
2683
  "svg",
2682
2684
  {
2683
2685
  width: e,
@@ -2700,7 +2702,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
2700
2702
  }, Gr = (e) => {
2701
2703
  var t;
2702
2704
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
2703
- }, Ue = (e) => {
2705
+ }, Be = (e) => {
2704
2706
  var t;
2705
2707
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
2706
2708
  }, yt = (e) => {
@@ -2722,7 +2724,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
2722
2724
  hasAttachment: a = !1
2723
2725
  }) => {
2724
2726
  var h;
2725
- const r = As(e), i = Ue(e);
2727
+ const r = As(e), i = Be(e);
2726
2728
  if (!r && !i)
2727
2729
  return null;
2728
2730
  if (r) {
@@ -2780,7 +2782,7 @@ const $r = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import(
2780
2782
  }
2781
2783
  )
2782
2784
  ] }), et = () => {
2783
- const { message: e } = Ne("SentMessageDeliveryStatus"), { messages: t } = ce("SentMessageDeliveryStatus"), n = (() => {
2785
+ const { message: e } = Ne("SentMessageDeliveryStatus"), { messages: t } = oe("SentMessageDeliveryStatus"), n = (() => {
2784
2786
  if (t)
2785
2787
  for (let a = t.length - 1; a >= 0; a -= 1) {
2786
2788
  const r = t[a];
@@ -2893,7 +2895,7 @@ const Qr = {
2893
2895
  // treatment from the mobile spec. The drop shadow remains for depth.
2894
2896
  "border border-black/[0.08]",
2895
2897
  "shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
2896
- ), Be = ({
2898
+ ), Ue = ({
2897
2899
  variant: e,
2898
2900
  children: t,
2899
2901
  href: n,
@@ -2959,9 +2961,9 @@ const Qr = {
2959
2961
  }, ii = {
2960
2962
  dark: "size-16 text-white/25",
2961
2963
  light: "size-16 text-black/25"
2962
- }, Ye = (e, t) => !!t && !!e && de(e) === "audio", St = (e, t) => {
2964
+ }, Ye = (e, t) => !!t && !!e && ce(e) === "audio", St = (e, t) => {
2963
2965
  if (!t || !e) return !1;
2964
- const n = de(e);
2966
+ const n = ce(e);
2965
2967
  return n === "video" || n === "audio";
2966
2968
  }, Et = "bg-[#F2F3F4]", je = ({
2967
2969
  variant: e,
@@ -2972,7 +2974,7 @@ const Qr = {
2972
2974
  topLeft: i,
2973
2975
  topRight: o
2974
2976
  }) => {
2975
- const l = de(r), d = !!n && l === "video", m = ie(t);
2977
+ const l = ce(r), d = !!n && l === "video", m = he(t);
2976
2978
  return Ye(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
2977
2979
  "audio",
2978
2980
  {
@@ -3060,7 +3062,7 @@ const Qr = {
3060
3062
  children: /* @__PURE__ */ s(Kn, { className: "size-5", weight: "regular" })
3061
3063
  }
3062
3064
  ) : void 0;
3063
- return c ? /* @__PURE__ */ s(Be, { variant: "dark", bgClassName: Et, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
3065
+ return c ? /* @__PURE__ */ s(Ue, { variant: "dark", bgClassName: Et, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
3064
3066
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
3065
3067
  je,
3066
3068
  {
@@ -3072,7 +3074,7 @@ const Qr = {
3072
3074
  ) }),
3073
3075
  b && /* @__PURE__ */ s("div", { className: "shrink-0", children: b })
3074
3076
  ] }) }) : /* @__PURE__ */ u(
3075
- Be,
3077
+ Ue,
3076
3078
  {
3077
3079
  variant: "dark",
3078
3080
  topRight: g ? b : void 0,
@@ -3124,7 +3126,7 @@ const Qr = {
3124
3126
  }
3125
3127
  } : d;
3126
3128
  return /* @__PURE__ */ u(
3127
- Be,
3129
+ Ue,
3128
3130
  {
3129
3131
  variant: "light",
3130
3132
  href: g,
@@ -3172,7 +3174,7 @@ const Qr = {
3172
3174
  }) => {
3173
3175
  const h = St(r, o), g = kt(a), c = m == null && g != null && !h ? g : void 0, b = m == null && !h && c != null ? f : void 0;
3174
3176
  return /* @__PURE__ */ u(
3175
- Be,
3177
+ Ue,
3176
3178
  {
3177
3179
  variant: "dark",
3178
3180
  href: c,
@@ -3233,7 +3235,7 @@ function Qt(e) {
3233
3235
  title: z(e.title),
3234
3236
  description: z(e.text),
3235
3237
  url: t,
3236
- thumbnailUrl: ie(n),
3238
+ thumbnailUrl: he(n),
3237
3239
  // Playable clip embedded in a link preview — lets LinkAttachment render its
3238
3240
  // native video/audio player in the hero instead of a static thumbnail.
3239
3241
  sourceUrl: a,
@@ -3283,9 +3285,7 @@ function hi(e, t, n) {
3283
3285
  return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
3284
3286
  }
3285
3287
  function es(e) {
3286
- return ie(
3287
- z(e.image_url)
3288
- ) ?? ie(z(e.asset_url)) ?? "";
3288
+ return z(e.image_url) ?? z(e.asset_url) ?? "";
3289
3289
  }
3290
3290
  function fi(e) {
3291
3291
  switch (e) {
@@ -3471,7 +3471,7 @@ const bi = ({
3471
3471
  ] }) : null
3472
3472
  ] });
3473
3473
  }, vi = (e) => {
3474
- var Dt, zt, Ft, Pt, Ot, $t, Ut, Bt, jt, Vt;
3474
+ var Dt, zt, Ft, Pt, Ot, $t, Bt, Ut, jt, Vt;
3475
3475
  const {
3476
3476
  additionalMessageInputProps: t,
3477
3477
  chatbotVotingEnabled: n,
@@ -3489,7 +3489,7 @@ const bi = ({
3489
3489
  renderText: b,
3490
3490
  threadList: v,
3491
3491
  viewerLanguage: x
3492
- } = e, { client: p } = fe("CustomMessage"), { channel: _ } = ce("CustomMessage"), { isUnlocking: w, onUnlockClick: k, onFetchSource: D, onDownloadClick: S } = Or("LockedAttachment"), [R, O] = B(!1), F = Ks(c.id), { selected: L, voteUp: C, voteDown: E } = va(c), {
3492
+ } = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: k, onFetchSource: D, onDownloadClick: S } = Or("LockedAttachment"), [R, O] = U(!1), F = Ks(c.id), { selected: L, voteUp: C, voteDown: E } = va(c), {
3493
3493
  Attachment: I = Zs,
3494
3494
  EditMessageModal: T = Js,
3495
3495
  MessageActions: M,
@@ -3504,21 +3504,21 @@ const bi = ({
3504
3504
  } = as("CustomMessage"), H = ln(c), q = on(c), Y = re(
3505
3505
  () => h == null ? void 0 : h(c),
3506
3506
  [h, c]
3507
- ), U = re(() => {
3508
- const he = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...he] : he;
3509
- if (!Ue(c)) return be;
3507
+ ), B = re(() => {
3508
+ const me = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...me] : me;
3509
+ if (!Be(c)) return be;
3510
3510
  const Gt = be.filter((Ht) => !("type" in Ht) || !ps(Ht));
3511
3511
  return Gt.length === be.length ? be : Gt;
3512
3512
  }, [c]), W = re(
3513
- () => Ls(U),
3514
- [U]
3513
+ () => Ls(B),
3514
+ [B]
3515
3515
  ), Z = re(() => {
3516
- const he = us({ message: c, viewerLanguage: x });
3517
- return he === c.text ? c : { ...c, text: he };
3518
- }, [c, x]), ue = W.length > 0, De = W.reduce(
3519
- (he, be) => he + be.attachments.length,
3516
+ const me = us({ message: c, viewerLanguage: x });
3517
+ return me === c.text ? c : { ...c, text: me };
3518
+ }, [c, x]), de = W.length > 0, De = W.reduce(
3519
+ (me, be) => me + be.attachments.length,
3520
3520
  0
3521
- ) === ((U == null ? void 0 : U.length) ?? 0), ze = Ya({
3521
+ ) === ((B == null ? void 0 : B.length) ?? 0), ze = Ya({
3522
3522
  endOfGroup: r,
3523
3523
  firstOfGroup: i,
3524
3524
  groupedByUser: o
@@ -3529,9 +3529,9 @@ const bi = ({
3529
3529
  return /* @__PURE__ */ s(j, { message: c });
3530
3530
  if (dn(c))
3531
3531
  return /* @__PURE__ */ s(P, {});
3532
- const ae = !v && !!c.reply_count, me = !v && c.show_in_channel && c.parent_id, oe = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = un(c);
3532
+ const ae = !v && !!c.reply_count, ue = !v && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = un(c);
3533
3533
  let ge;
3534
- oe ? ge = () => m(c) : Tt && (ge = () => O(!0));
3534
+ le ? ge = () => m(c) : Tt && (ge = () => O(!0));
3535
3535
  const te = g(), $s = y(
3536
3536
  "str-chat__message str-chat__message-simple",
3537
3537
  `str-chat__message--${c.type}`,
@@ -3544,12 +3544,12 @@ const bi = ({
3544
3544
  "str-chat__message--pinned pinned-message": c.pinned,
3545
3545
  "str-chat__message--with-reactions": q,
3546
3546
  "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((zt = c == null ? void 0 : c.error) == null ? void 0 : zt.status) !== 403,
3547
- "str-chat__message-with-thread-link": ae || me,
3547
+ "str-chat__message-with-thread-link": ae || ue,
3548
3548
  "str-chat__virtual-message__wrapper--end": r,
3549
3549
  "str-chat__virtual-message__wrapper--first": i,
3550
3550
  "str-chat__virtual-message__wrapper--group": o
3551
3551
  }
3552
- ), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = qr(c), pe = Ue(c), Us = yt(c), We = !!(U != null && U.length && !c.quoted_message), At = pe && te && We, Bs = ue && De && !c.quoted_message && !qe && !Y && !pe, Rt = {
3552
+ ), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = qr(c), pe = Be(c), Bs = yt(c), We = !!(B != null && B.length && !c.quoted_message), At = pe && te && We, Us = de && De && !c.quoted_message && !qe && !Y && !pe, Rt = {
3553
3553
  contentType: "text",
3554
3554
  amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
3555
3555
  paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
@@ -3558,8 +3558,8 @@ const bi = ({
3558
3558
  contentType: "media",
3559
3559
  title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
3560
3560
  mimeType: ($t = c.metadata) == null ? void 0 : $t.attachment_mime_type,
3561
- thumbnailUrl: (Ut = c.metadata) == null ? void 0 : Ut.attachment_thumbnail,
3562
- amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
3561
+ thumbnailUrl: (Bt = c.metadata) == null ? void 0 : Bt.attachment_thumbnail,
3562
+ amountText: (Ut = c.metadata) == null ? void 0 : Ut.amount_text,
3563
3563
  detail: (jt = c.metadata) == null ? void 0 : jt.attachment_detail,
3564
3564
  paymentStatus: (Vt = c.metadata) == null ? void 0 : Vt.payment_status,
3565
3565
  onFetchSource: D ? () => D(c, _) : void 0
@@ -3604,7 +3604,7 @@ const bi = ({
3604
3604
  "div",
3605
3605
  {
3606
3606
  className: y("str-chat__message-inner", {
3607
- "str-chat__simple-message--error-failed": oe || Tt
3607
+ "str-chat__simple-message--error-failed": le || Tt
3608
3608
  }),
3609
3609
  "data-testid": "message-inner",
3610
3610
  onClick: ge,
@@ -3664,14 +3664,14 @@ const bi = ({
3664
3664
  renderText: b
3665
3665
  }
3666
3666
  ) })
3667
- ] }) : Bs ? /* @__PURE__ */ s(
3667
+ ] }) : Us ? /* @__PURE__ */ s(
3668
3668
  bi,
3669
3669
  {
3670
3670
  groupPosition: ze,
3671
3671
  isMyMessage: te,
3672
3672
  message: {
3673
3673
  ...Z,
3674
- attachments: U,
3674
+ attachments: B,
3675
3675
  // MessageText prefers message.i18n[userLanguage_text] from
3676
3676
  // Stream's TranslationContext over message.text. Drop i18n so
3677
3677
  // the caption uses displayMessage.text from viewerLanguage.
@@ -3689,11 +3689,11 @@ const bi = ({
3689
3689
  }
3690
3690
  ),
3691
3691
  qe && /* @__PURE__ */ s(hn, { poll: qe }),
3692
- U != null && U.length && !c.quoted_message ? /* @__PURE__ */ s(
3692
+ B != null && B.length && !c.quoted_message ? /* @__PURE__ */ s(
3693
3693
  I,
3694
3694
  {
3695
3695
  actionHandler: l,
3696
- attachments: U
3696
+ attachments: B
3697
3697
  }
3698
3698
  ) : null,
3699
3699
  Y ? /* @__PURE__ */ s(
@@ -3713,7 +3713,7 @@ const bi = ({
3713
3713
  ] }) })
3714
3714
  }
3715
3715
  ),
3716
- !Us && !Mt && /* @__PURE__ */ u("div", { className: "str-chat__message-footer", children: [
3716
+ !Bs && !Mt && /* @__PURE__ */ u("div", { className: "str-chat__message-footer", children: [
3717
3717
  (!pe || At) && /* @__PURE__ */ s(
3718
3718
  Qe,
3719
3719
  {
@@ -3739,7 +3739,7 @@ const bi = ({
3739
3739
  reply_count: c.reply_count
3740
3740
  }
3741
3741
  ),
3742
- me && /* @__PURE__ */ s(Q, {})
3742
+ ue && /* @__PURE__ */ s(Q, {})
3743
3743
  ]
3744
3744
  },
3745
3745
  c.id
@@ -3920,7 +3920,7 @@ const bi = ({
3920
3920
  composerInput: r
3921
3921
  }) => {
3922
3922
  var l;
3923
- const { channel: i } = ce(), o = ((l = i == null ? void 0 : i.data) == null ? void 0 : l.frozen) === !0;
3923
+ const { channel: i } = oe(), o = ((l = i == null ? void 0 : i.data) == null ? void 0 : l.frozen) === !0;
3924
3924
  return n ? /* @__PURE__ */ u(se, { children: [
3925
3925
  /* @__PURE__ */ s("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: a ? /* @__PURE__ */ s("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: a }) : null }),
3926
3926
  t == null ? void 0 : t()
@@ -4067,11 +4067,11 @@ const bi = ({
4067
4067
  Ke.Thinking,
4068
4068
  Ke.Generating,
4069
4069
  Ke.ExternalSources
4070
- ]), Ui = ({ threadList: e }) => {
4070
+ ]), Bi = ({ threadList: e }) => {
4071
4071
  var b, v;
4072
- const { channel: t, channelConfig: n, thread: a } = ce(), { client: r } = fe(), { typing: i = {} } = Nn(), { aiState: o } = yn(t), l = Te(Ds);
4072
+ const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } = Nn(), { aiState: o } = yn(t), l = Te(Ds);
4073
4073
  if (!e && l && $i.has(o)) {
4074
- const x = Bi(t, (b = r.user) == null ? void 0 : b.id);
4074
+ const x = Ui(t, (b = r.user) == null ? void 0 : b.id);
4075
4075
  return /* @__PURE__ */ s(
4076
4076
  ss,
4077
4077
  {
@@ -4151,7 +4151,7 @@ const bi = ({
4151
4151
  ] })
4152
4152
  }
4153
4153
  );
4154
- function Bi(e, t) {
4154
+ function Ui(e, t) {
4155
4155
  var a;
4156
4156
  const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
4157
4157
  for (const r of Object.values(n)) {
@@ -4228,7 +4228,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4228
4228
  renderHeaderTitleBadges: x
4229
4229
  }) => {
4230
4230
  var E, I, T, M, P, $;
4231
- const { channel: p } = ce(), { client: _ } = fe(), w = V.useMemo(
4231
+ const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
4232
4232
  () => {
4233
4233
  var j;
4234
4234
  return He(
@@ -4524,7 +4524,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4524
4524
  composerInput: L
4525
4525
  }) => {
4526
4526
  var N, A, H, q;
4527
- const { channel: C } = ce(), { client: E } = fe(), I = V.useMemo(
4527
+ const { channel: C } = oe(), { client: E } = fe(), I = V.useMemo(
4528
4528
  () => {
4529
4529
  var Y;
4530
4530
  return He(
@@ -4538,8 +4538,8 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4538
4538
  var W;
4539
4539
  const Y = E == null ? void 0 : E.userID;
4540
4540
  return Y ? Object.values(((W = C.state) == null ? void 0 : W.members) || {}).find((Z) => {
4541
- var ue;
4542
- return ((ue = Z.user) == null ? void 0 : ue.id) === Y;
4541
+ var de;
4542
+ return ((de = Z.user) == null ? void 0 : de.id) === Y;
4543
4543
  }) : void 0;
4544
4544
  }, [E == null ? void 0 : E.userID, (A = C.state) == null ? void 0 : A.members]), M = ((H = T == null ? void 0 : T.user) == null ? void 0 : H.is_account) ?? (T == null ? void 0 : T.is_account), P = ((q = I == null ? void 0 : I.user) == null ? void 0 : q.is_account) ?? (I == null ? void 0 : I.is_account), $ = S && M === !1 && P === !0, j = C.state.messages.some(
4545
4545
  (Y) => Y.type !== "deleted"
@@ -4566,7 +4566,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4566
4566
  }
4567
4567
  ) : null, X = J(
4568
4568
  (Y) => {
4569
- const { message: U } = Ne("ChannelView"), W = /* @__PURE__ */ s(
4569
+ const { message: B } = Ne("ChannelView"), W = /* @__PURE__ */ s(
4570
4570
  wi,
4571
4571
  {
4572
4572
  ...Y,
@@ -4574,7 +4574,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4574
4574
  viewerLanguage: R
4575
4575
  }
4576
4576
  );
4577
- return !D || !U ? W : D(W, U);
4577
+ return !D || !B ? W : D(W, B);
4578
4578
  },
4579
4579
  [x, D, R]
4580
4580
  );
@@ -4584,7 +4584,6 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4584
4584
  overrides: {
4585
4585
  Message: X,
4586
4586
  MessageActions: yi,
4587
- UnreadMessagesNotification: () => null,
4588
4587
  UnreadMessagesSeparator: () => null
4589
4588
  },
4590
4589
  children: /* @__PURE__ */ u(Sn, { children: [
@@ -4703,10 +4702,10 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4703
4702
  ...w
4704
4703
  }
4705
4704
  }
4706
- }, U = {
4705
+ }, B = {
4707
4706
  ...A,
4708
4707
  ...q && { skip_push: !0 }
4709
- }, W = await e.sendMessage(Y, U);
4708
+ }, W = await e.sendMessage(Y, B);
4710
4709
  return k == null || k(W), W;
4711
4710
  },
4712
4711
  [e, _, w, k]
@@ -4718,7 +4717,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4718
4717
  const N = (A) => {
4719
4718
  const H = A.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
4720
4719
  if (!Y) return;
4721
- const U = q == null ? void 0 : q.closest("[data-message-id]"), W = U == null ? void 0 : U.getAttribute("data-message-id"), Z = W ? e.state.messages.find((ue) => ue.id === W) : void 0;
4720
+ const B = q == null ? void 0 : q.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), Z = W ? e.state.messages.find((de) => de.id === W) : void 0;
4722
4721
  E(Y, Z);
4723
4722
  };
4724
4723
  return X.addEventListener("click", N), () => X.removeEventListener("click", N);
@@ -4738,7 +4737,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4738
4737
  EmptyStateIndicator: m,
4739
4738
  LoadingIndicator: Ve,
4740
4739
  DateSeparator: pa,
4741
- TypingIndicator: Ui,
4740
+ TypingIndicator: Bi,
4742
4741
  doSendMessageRequest: Q,
4743
4742
  ...I ? { SendButton: I } : {},
4744
4743
  ...T ? { AttachmentPreviewList: T } : {},
@@ -4830,7 +4829,7 @@ const bl = ({
4830
4829
  refreshConnection: C,
4831
4830
  service: E,
4832
4831
  debug: I
4833
- } = ta(), [T, M] = B(null), [P, $] = B(null), [j, Q] = B(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
4832
+ } = ta(), [T, M] = U(null), [P, $] = U(null), [j, Q] = U(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
4834
4833
  X.current = o;
4835
4834
  const N = G(a);
4836
4835
  N.current = a;
@@ -4839,9 +4838,9 @@ const bl = ({
4839
4838
  H.current = T;
4840
4839
  }, [T]), K(() => {
4841
4840
  if (!R || !O) return;
4842
- const U = R.userID;
4843
- if (!U) return;
4844
- const W = `${U}::${i}`;
4841
+ const B = R.userID;
4842
+ if (!B) return;
4843
+ const W = `${B}::${i}`;
4845
4844
  if (A.current === W) return;
4846
4845
  A.current = W;
4847
4846
  const Z = () => {
@@ -4857,7 +4856,7 @@ const bl = ({
4857
4856
  const ae = await R.queryChannels(
4858
4857
  {
4859
4858
  type: "messaging",
4860
- members: { $eq: [U, i] }
4859
+ members: { $eq: [B, i] }
4861
4860
  },
4862
4861
  {},
4863
4862
  { limit: 1 }
@@ -4869,8 +4868,8 @@ const bl = ({
4869
4868
  );
4870
4869
  return;
4871
4870
  }
4872
- const me = X.current;
4873
- if (!me || !E) {
4871
+ const ue = X.current;
4872
+ if (!ue || !E) {
4874
4873
  Z(), $("No conversation found with this account"), I && console.log(
4875
4874
  "[MessagingShell] No conversation found for:",
4876
4875
  i
@@ -4878,19 +4877,19 @@ const bl = ({
4878
4877
  return;
4879
4878
  }
4880
4879
  try {
4881
- const oe = await E.startChannelWithParticipant({
4882
- id: me.id,
4883
- name: me.name,
4884
- phone: me.phone
4880
+ const le = await E.startChannelWithParticipant({
4881
+ id: ue.id,
4882
+ name: ue.name,
4883
+ phone: ue.phone
4885
4884
  });
4886
- M(oe), $(null), (ze = N.current) == null || ze.call(N, oe), I && console.log(
4885
+ M(le), $(null), (ze = N.current) == null || ze.call(N, le), I && console.log(
4887
4886
  "[MessagingShell] Channel created and loaded:",
4888
- oe.id
4887
+ le.id
4889
4888
  );
4890
- } catch (oe) {
4889
+ } catch (le) {
4891
4890
  console.error(
4892
4891
  "[MessagingShell] Failed to create conversation:",
4893
- oe
4892
+ le
4894
4893
  ), Z(), $("Failed to create conversation");
4895
4894
  }
4896
4895
  } catch (ae) {
@@ -4904,8 +4903,8 @@ const bl = ({
4904
4903
  const q = G(r);
4905
4904
  q.current = r;
4906
4905
  const Y = J(() => {
4907
- var U;
4908
- M(null), Q(!0), (U = q.current) == null || U.call(q);
4906
+ var B;
4907
+ M(null), Q(!0), (B = q.current) == null || B.call(q);
4909
4908
  }, []);
4910
4909
  return F ? /* @__PURE__ */ s(Ve, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: C }) : !O || !R ? /* @__PURE__ */ s(
4911
4910
  Ce,
@@ -5034,7 +5033,7 @@ const Fs = V.createContext({
5034
5033
  if (C) return C;
5035
5034
  const T = (M = p == null ? void 0 : p.attachments) == null ? void 0 : M[0];
5036
5035
  return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
5037
- })(), k = p != null && p.created_at ? Ki(new Date(p.created_at)) : "", D = p ? Ue(p) : !1, S = l ? l(p, w) : `${D ? "✨ " : ""}${w}`, R = n ?? 0;
5036
+ })(), k = p != null && p.created_at ? Ki(new Date(p.created_at)) : "", D = p ? Be(p) : !1, S = l ? l(p, w) : `${D ? "✨ " : ""}${w}`, R = n ?? 0;
5038
5037
  return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
5039
5038
  channelId: t == null ? void 0 : t.id,
5040
5039
  isSelected: f,
@@ -5332,7 +5331,7 @@ export {
5332
5331
  zs as d,
5333
5332
  gl as e,
5334
5333
  al as f,
5335
- de as g,
5334
+ ce as g,
5336
5335
  Pe as h,
5337
5336
  ke as i,
5338
5337
  vl as j,
@@ -5340,7 +5339,7 @@ export {
5340
5339
  hl as l,
5341
5340
  bl as m,
5342
5341
  sr as n,
5343
- ie as o,
5342
+ he as o,
5344
5343
  Qa as p,
5345
5344
  Ki as q,
5346
5345
  _e as r,
@@ -5353,4 +5352,4 @@ export {
5353
5352
  He as y,
5354
5353
  gt as z
5355
5354
  };
5356
- //# sourceMappingURL=index-D9_M5IWl.js.map
5355
+ //# sourceMappingURL=index-BvuCjzqJ.js.map