@linktr.ee/messaging-react 3.19.0-rc-1785393579 → 3.19.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.
@@ -2,11 +2,11 @@ import { jsx as s, jsxs as h, Fragment as K } from "react/jsx-runtime";
2
2
  import B, { createContext as ot, useContext as Ce, useCallback as q, useState as F, useRef as H, useEffect as Y, useId as Qs, useMemo as se, Suspense as en } from "react";
3
3
  import { StreamChatService as tn } from "@linktr.ee/messaging-core";
4
4
  import { StreamChat as sn, LinkPreviewsManager as Qe } from "stream-chat";
5
- import { Chat as nn, useChannelStateContext as me, useChatContext as ke, DateSeparator as an, useMessageContext as he, MessageStatus as rn, MessageErrorIcon as et, MessageText as Oe, areMessageUIPropsEqual as on, useMessageReminder as ln, useComponentContext as ls, Attachment as cn, EditMessageModal as dn, MessageBlocked as un, MessageBouncePrompt as mn, MessageDeleted as hn, MessageIsThreadReplyInChannelButtonIndicator as fn, MessageRepliesCountButton as gn, ReminderNotification as pn, StreamedMessageText as bn, messageHasAttachments as vn, messageHasReactions as xn, isDateSeparatorMessage as _n, isMessageBlocked as wn, isMessageBounced as Nn, MessageBounceModal as yn, Poll as Cn, useMessageComposer as kn, useStateStore as Sn, MessageInput as Ht, useMessageInputContext as En, useMessageComposerHasSendableData as In, AttachmentPreviewList as Tn, QuotedMessagePreview as An, TextareaComposer as Mn, MessageTimestamp as He, AIStates as Ge, useTypingContext as Ln, useAIState as Rn, Channel as Dn, WithComponents as Pn, Window as On, MessageList as Gt, ChannelList as zn, InfiniteScroll as Fn } from "stream-chat-react";
5
+ import { Chat as nn, useChannelStateContext as me, useChatContext as ke, DateSeparator as an, useMessageContext as he, MessageStatus as rn, MessageErrorIcon as et, MessageText as Oe, areMessageUIPropsEqual as on, useMessageReminder as ln, useComponentContext as ls, Attachment as cn, EditMessageModal as dn, MessageBlocked as un, MessageBouncePrompt as mn, MessageDeleted as hn, MessageIsThreadReplyInChannelButtonIndicator as fn, MessageRepliesCountButton as gn, ReminderNotification as pn, StreamedMessageText as bn, messageHasAttachments as vn, messageHasReactions as xn, isDateSeparatorMessage as _n, isMessageBlocked as wn, isMessageBounced as Nn, MessageBounceModal as yn, Poll as Cn, useMessageComposer as kn, useStateStore as Sn, MessageInput as Ht, useMessageInputContext as En, useMessageComposerHasSendableData as In, AttachmentPreviewList as Tn, QuotedMessagePreview as An, TextareaComposer as Ln, MessageTimestamp as He, AIStates as Ge, useTypingContext as Mn, useAIState as Rn, Channel as Dn, WithComponents as Pn, Window as On, MessageList as Gt, ChannelList as zn, InfiniteScroll as Fn } from "stream-chat-react";
6
6
  import C from "classnames";
7
7
  import { StarIcon as tt, DotsThreeIcon as Bn, SpinnerGapIcon as Re, SignOutIcon as $n, ProhibitInsetIcon as Yt, FlagIcon as cs, CurrencyDollarIcon as Un, CaretRightIcon as ds, ArrowLeftIcon as Vn, FileIcon as us, ImageIcon as jn, SpeakerHighIcon as Hn, VideoCameraIcon as ms, FileMdIcon as Gn, FileTextIcon as Yn, FileZipIcon as Wn, FilePptIcon as qn, FileCsvIcon as Xn, FileXlsIcon as Kn, FileDocIcon as Zn, FilePdfIcon as Jn, CircleNotchIcon as be, PlayIcon as st, PauseIcon as Qn, LinkIcon as ea, DownloadSimpleIcon as ye, XIcon as lt, CaretLeftIcon as ta, GiftIcon as sa, ThumbsUpIcon as na, ThumbsDownIcon as aa, WarningCircleIcon as ra, ChecksIcon as ia, PencilSimpleIcon as oa, TrashSimpleIcon as la, ArrowUpIcon as ca, SparkleIcon as da, ProhibitIcon as ua } from "@phosphor-icons/react";
8
- import { isOfficialChannel as ma, MESSAGE_CUSTOM_TYPE as oe, selectEnabledFaqs as ha } from "@linktr.ee/messaging-taxonomy";
9
- import { MessageActions as fa, DefaultDropdownActionButton as hs } from "stream-chat-react/experimental";
8
+ import { isOfficialChannel as ma, OFFICIAL_SENDER_USER_ID as ha, MESSAGE_CUSTOM_TYPE as oe, isDmAgentSystemType as Wt, isAgeSafetySystemType as fa, selectEnabledFaqs as ga } from "@linktr.ee/messaging-taxonomy";
9
+ import { MessageActions as pa, DefaultDropdownActionButton as hs } from "stream-chat-react/experimental";
10
10
  const fs = ot({
11
11
  service: null,
12
12
  client: null,
@@ -17,7 +17,7 @@ const fs = ot({
17
17
  refreshConnection: async () => {
18
18
  },
19
19
  debug: !1
20
- }), ct = () => Ce(fs), jo = ({
20
+ }), ct = () => Ce(fs), Uo = ({
21
21
  children: e,
22
22
  user: t,
23
23
  serviceConfig: n,
@@ -41,9 +41,9 @@ const fs = ot({
41
41
  });
42
42
  const [d, m] = F(null), [f, u] = F(null), [g, c] = F(!1), [x, _] = F(!1), [b, p] = F(null), v = H(!1), w = H(null), y = H(n);
43
43
  y.current = n;
44
- const M = H(i);
45
- M.current = i;
46
- const L = H({
44
+ const L = H(i);
45
+ L.current = i;
46
+ const M = H({
47
47
  userId: t == null ? void 0 : t.id,
48
48
  apiKey: a,
49
49
  serviceConfig: n,
@@ -53,12 +53,12 @@ const fs = ot({
53
53
  renderCount: O.current,
54
54
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
55
55
  propChanges: {
56
- userChanged: L.current.userId !== (t == null ? void 0 : t.id),
57
- apiKeyChanged: L.current.apiKey !== a,
58
- serviceConfigChanged: L.current.serviceConfig !== n,
59
- capabilitiesChanged: L.current.capabilities !== r
56
+ userChanged: M.current.userId !== (t == null ? void 0 : t.id),
57
+ apiKeyChanged: M.current.apiKey !== a,
58
+ serviceConfigChanged: M.current.serviceConfig !== n,
59
+ capabilitiesChanged: M.current.capabilities !== r
60
60
  }
61
- }), L.current = {
61
+ }), M.current = {
62
62
  userId: t == null ? void 0 : t.id,
63
63
  apiKey: a,
64
64
  serviceConfig: n,
@@ -87,7 +87,7 @@ const fs = ot({
87
87
  const G = new tn({
88
88
  ...P,
89
89
  apiKey: a,
90
- debug: M.current,
90
+ debug: L.current,
91
91
  client: z
92
92
  });
93
93
  w.current = G, m(G), o("✅ SERVICE SET", {
@@ -225,7 +225,7 @@ const fs = ot({
225
225
  children: e
226
226
  }
227
227
  ) : e });
228
- }, ga = () => ct(), gs = (e) => {
228
+ }, ba = () => ct(), gs = (e) => {
229
229
  var a, r;
230
230
  const [t, n] = F(
231
231
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
@@ -247,14 +247,14 @@ const fs = ot({
247
247
  e.off("member.updated", i);
248
248
  };
249
249
  }, [e]), t;
250
- }, pa = "linktree-official-sender";
250
+ };
251
251
  function ps(e, t, n) {
252
252
  const a = Object.values(e || {});
253
253
  if (ma(n)) {
254
254
  const r = a.find(
255
255
  (i) => {
256
256
  var l;
257
- return ((l = i.user) == null ? void 0 : l.id) === pa;
257
+ return ((l = i.user) == null ? void 0 : l.id) === ha;
258
258
  }
259
259
  );
260
260
  if (r) return r;
@@ -266,18 +266,18 @@ function ps(e, t, n) {
266
266
  }
267
267
  );
268
268
  }
269
- const ba = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
270
- function va(e) {
271
- return ba.test(e.trim());
269
+ const va = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
270
+ function xa(e) {
271
+ return va.test(e.trim());
272
272
  }
273
- function Wt(e, t) {
273
+ function qt(e, t) {
274
274
  const n = e == null ? void 0 : e.trim();
275
- return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !va(n);
275
+ return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !xa(n);
276
276
  }
277
277
  function bs(e) {
278
- return Wt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Wt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
278
+ return qt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : qt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
279
279
  }
280
- const qt = [
280
+ const Xt = [
281
281
  { emoji: "🍎", bgColor: "#FFD1DD" },
282
282
  // Apple
283
283
  { emoji: "🍌", bgColor: "#FFF1C9" },
@@ -305,7 +305,7 @@ const qt = [
305
305
  { emoji: "🍈", bgColor: "#D9F7E1" }
306
306
  // Melon
307
307
  ];
308
- function xa(e) {
308
+ function _a(e) {
309
309
  let t = 0;
310
310
  for (let n = 0; n < e.length; n++) {
311
311
  const a = e.charCodeAt(n);
@@ -314,12 +314,12 @@ function xa(e) {
314
314
  return Math.abs(t);
315
315
  }
316
316
  function vs(e) {
317
- return qt[xa(e) % qt.length];
317
+ return Xt[_a(e) % Xt.length];
318
318
  }
319
- function _a(e) {
319
+ function wa(e) {
320
320
  return vs(e).emoji;
321
321
  }
322
- function wa(e) {
322
+ function Na(e) {
323
323
  return vs(e).bgColor;
324
324
  }
325
325
  const xe = ({
@@ -331,7 +331,7 @@ const xe = ({
331
331
  shape: i = "squircle",
332
332
  dmAgentEnabled: l = !1
333
333
  }) => {
334
- const o = _a(e), d = wa(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, x = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
334
+ const o = wa(e), d = Na(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, x = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
335
335
  "img",
336
336
  {
337
337
  src: t,
@@ -395,7 +395,7 @@ const xe = ({
395
395
  ]
396
396
  }
397
397
  );
398
- }, Na = "https://linktr.ee/s/about/trust-center/report", ya = ({
398
+ }, ya = "https://linktr.ee/s/about/trust-center/report", Ca = ({
399
399
  channel: e,
400
400
  participant: t,
401
401
  showBlockParticipant: n = !0,
@@ -409,7 +409,7 @@ const xe = ({
409
409
  logLabel: f = "useChannelModerationActions"
410
410
  }) => {
411
411
  var T;
412
- const { service: u, debug: g } = ct(), c = (T = t == null ? void 0 : t.user) == null ? void 0 : T.id, x = !!(a && n && u && c), [_, b] = F(!1), [p, v] = F(null), [w, y] = F(!1), [M, L] = F(!1), O = x && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
412
+ const { service: u, debug: g } = ct(), c = (T = t == null ? void 0 : t.user) == null ? void 0 : T.id, x = !!(a && n && u && c), [_, b] = F(!1), [p, v] = F(null), [w, y] = F(!1), [L, M] = F(!1), O = x && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
413
413
  return Y(() => {
414
414
  if (!x || !u || !c) {
415
415
  b(!1), v(null);
@@ -437,7 +437,7 @@ const xe = ({
437
437
  isParticipantBlocked: _,
438
438
  isCheckingBlockedStatus: O,
439
439
  isLeaving: w,
440
- isUpdatingBlockStatus: M,
440
+ isUpdatingBlockStatus: L,
441
441
  handleLeaveConversation: async () => {
442
442
  var E;
443
443
  if (!w) {
@@ -454,32 +454,32 @@ const xe = ({
454
454
  },
455
455
  handleBlockUser: async () => {
456
456
  var E, I, k;
457
- if (!(M || !u)) {
458
- o == null || o(), g && console.log(`[${f}] Block member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), L(!0);
457
+ if (!(L || !u)) {
458
+ o == null || o(), g && console.log(`[${f}] Block member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), M(!0);
459
459
  try {
460
460
  await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), m == null || m();
461
461
  } catch (P) {
462
462
  console.error(`[${f}] Failed to block member`, P);
463
463
  } finally {
464
- L(!1);
464
+ M(!1);
465
465
  }
466
466
  }
467
467
  },
468
468
  handleUnblockUser: async () => {
469
469
  var E, I, k;
470
- if (!(M || !u)) {
471
- o == null || o(), g && console.log(`[${f}] Unblock member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), L(!0);
470
+ if (!(L || !u)) {
471
+ o == null || o(), g && console.log(`[${f}] Unblock member`, (E = t == null ? void 0 : t.user) == null ? void 0 : E.id), M(!0);
472
472
  try {
473
473
  await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((k = t == null ? void 0 : t.user) == null ? void 0 : k.id), m == null || m();
474
474
  } catch (P) {
475
475
  console.error(`[${f}] Failed to unblock member`, P);
476
476
  } finally {
477
- L(!1);
477
+ M(!1);
478
478
  }
479
479
  }
480
480
  },
481
481
  handleReportUser: () => {
482
- d == null || d(), m == null || m(), window.open(Na, "_blank", "noopener,noreferrer");
482
+ d == null || d(), m == null || m(), window.open(ya, "_blank", "noopener,noreferrer");
483
483
  }
484
484
  };
485
485
  }, _e = ({
@@ -499,7 +499,7 @@ const xe = ({
499
499
  ...a,
500
500
  children: n
501
501
  }
502
- ), Ca = ({
502
+ ), ka = ({
503
503
  channel: e,
504
504
  participant: t,
505
505
  showDeleteConversation: n = !0,
@@ -518,11 +518,11 @@ const xe = ({
518
518
  isCheckingBlockedStatus: v,
519
519
  isLeaving: w,
520
520
  isUpdatingBlockStatus: y,
521
- handleLeaveConversation: M,
522
- handleBlockUser: L,
521
+ handleLeaveConversation: L,
522
+ handleBlockUser: M,
523
523
  handleUnblockUser: O,
524
524
  handleReportUser: $
525
- } = ya({
525
+ } = Ca({
526
526
  channel: e,
527
527
  participant: t,
528
528
  showBlockParticipant: a,
@@ -574,7 +574,7 @@ const xe = ({
574
574
  n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(
575
575
  _e,
576
576
  {
577
- onClick: M,
577
+ onClick: L,
578
578
  disabled: w,
579
579
  "aria-busy": w,
580
580
  children: [
@@ -604,7 +604,7 @@ const xe = ({
604
604
  ) : /* @__PURE__ */ h(
605
605
  _e,
606
606
  {
607
- onClick: L,
607
+ onClick: M,
608
608
  disabled: y,
609
609
  "aria-busy": y,
610
610
  children: [
@@ -622,7 +622,7 @@ const xe = ({
622
622
  }
623
623
  )
624
624
  ] });
625
- }, Ye = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", ka = "CUSTOMER_PAID", Sa = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ka, Ea = ({
625
+ }, Ye = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Sa = "CUSTOMER_PAID", Ea = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Sa, Ia = ({
626
626
  className: e,
627
627
  onBack: t,
628
628
  showBackButton: n,
@@ -651,9 +651,9 @@ const xe = ({
651
651
  );
652
652
  },
653
653
  [(S = b.state) == null ? void 0 : S.members, p == null ? void 0 : p.userID, b.type]
654
- ), w = bs(v == null ? void 0 : v.user), y = (T = v == null ? void 0 : v.user) == null ? void 0 : T.image, M = gs(b), L = Sa((E = b.data) == null ? void 0 : E.customer_tag) && (v == null ? void 0 : v.is_follower) === !0, O = a && M, $ = L || O || !!_, z = async () => {
654
+ ), w = bs(v == null ? void 0 : v.user), y = (T = v == null ? void 0 : v.user) == null ? void 0 : T.image, L = gs(b), M = Ea((E = b.data) == null ? void 0 : E.customer_tag) && (v == null ? void 0 : v.is_follower) === !0, O = a && L, $ = M || O || !!_, z = async () => {
655
655
  try {
656
- M ? await b.unpin() : await b.pin();
656
+ L ? await b.unpin() : await b.pin();
657
657
  } catch (k) {
658
658
  console.error(
659
659
  "[ChannelHeaderRedesign] Failed to update pinned status:",
@@ -682,7 +682,7 @@ const xe = ({
682
682
  children: /* @__PURE__ */ h("span", { className: "flex max-w-full items-center justify-center", children: [
683
683
  /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: w }),
684
684
  $ && /* @__PURE__ */ h("span", { className: "ml-2 flex gap-1", children: [
685
- L && /* @__PURE__ */ s(
685
+ M && /* @__PURE__ */ s(
686
686
  "span",
687
687
  {
688
688
  "aria-label": "Paid customer",
@@ -750,22 +750,22 @@ const xe = ({
750
750
  className: Ye,
751
751
  onClick: z,
752
752
  type: "button",
753
- "aria-pressed": M,
754
- "aria-label": M ? "Unstar conversation" : "Star conversation",
753
+ "aria-pressed": L,
754
+ "aria-label": L ? "Unstar conversation" : "Star conversation",
755
755
  children: /* @__PURE__ */ s(
756
756
  tt,
757
757
  {
758
758
  className: C("size-5", {
759
- "text-[#FFD60A]": M,
760
- "text-black/90": !M
759
+ "text-[#FFD60A]": L,
760
+ "text-black/90": !L
761
761
  }),
762
- weight: M ? "fill" : "regular"
762
+ weight: L ? "fill" : "regular"
763
763
  }
764
764
  )
765
765
  }
766
766
  ),
767
767
  x && (c !== void 0 ? c : /* @__PURE__ */ s(
768
- Ca,
768
+ ka,
769
769
  {
770
770
  channel: b,
771
771
  participant: v,
@@ -785,13 +785,13 @@ const xe = ({
785
785
  ] })
786
786
  }
787
787
  );
788
- }, Ia = (e) => /* @__PURE__ */ s(an, { ...e, position: "center" }), nt = "vote_up", at = "vote_down";
789
- function Ta(e) {
788
+ }, Ta = (e) => /* @__PURE__ */ s(an, { ...e, position: "center" }), nt = "vote_up", at = "vote_down";
789
+ function Aa(e) {
790
790
  return e != null && e.length ? e.some((t) => t.type === at) ? "down" : e.some((t) => t.type === nt) ? "up" : null : null;
791
791
  }
792
- function Aa(e) {
792
+ function La(e) {
793
793
  const { channel: t } = me(), { client: n } = ke("useMessageVote"), a = se(
794
- () => Ta(e.own_reactions),
794
+ () => Aa(e.own_reactions),
795
795
  [e.own_reactions]
796
796
  ), r = q(async () => {
797
797
  if (n != null && n.userID)
@@ -827,28 +827,28 @@ function xs({
827
827
  const n = e == null ? void 0 : e.text, a = Ma(t);
828
828
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
829
829
  }
830
- const La = ["linktr.ee"], Xt = "messaging-attachment-v1_0";
831
- function Ra(e) {
830
+ const Ra = ["linktr.ee"], Kt = "messaging-attachment-v1_0";
831
+ function Da(e) {
832
832
  try {
833
833
  return new URL(e).hostname.toLowerCase();
834
834
  } catch {
835
835
  return null;
836
836
  }
837
837
  }
838
- function Da(e) {
839
- return La.some(
838
+ function Pa(e) {
839
+ return Ra.some(
840
840
  (t) => e === t || e.endsWith(`.${t}`)
841
841
  );
842
842
  }
843
843
  function ue(e) {
844
844
  const t = e == null ? void 0 : e.trim();
845
845
  if (!t) return;
846
- const n = Ra(t);
847
- if (!n || !Da(n)) return t;
846
+ const n = Da(t);
847
+ if (!n || !Pa(n)) return t;
848
848
  const a = new URL(t);
849
- return a.searchParams.get("io") === "true" && a.searchParams.get("size") === Xt ? t : (a.searchParams.set("io", "true"), a.searchParams.set("size", Xt), a.toString());
849
+ return a.searchParams.get("io") === "true" && a.searchParams.get("size") === Kt ? t : (a.searchParams.set("io", "true"), a.searchParams.set("size", Kt), a.toString());
850
850
  }
851
- const Pa = [
851
+ const Oa = [
852
852
  [/pdf/, "pdf"],
853
853
  [/wordprocessingml|msword|\.doc/, "doc"],
854
854
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -862,17 +862,17 @@ function le(e) {
862
862
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
863
863
  }
864
864
  function _s(e) {
865
- const t = Pa.find(
865
+ const t = Oa.find(
866
866
  ([n]) => n.test(e)
867
867
  );
868
868
  return t ? t[1] : "generic";
869
869
  }
870
- const Oa = {
870
+ const za = {
871
871
  video: ms,
872
872
  audio: Hn,
873
873
  image: jn,
874
874
  document: us
875
- }, za = {
875
+ }, Fa = {
876
876
  pdf: Jn,
877
877
  doc: Zn,
878
878
  xls: Kn,
@@ -883,17 +883,17 @@ const Oa = {
883
883
  markdown: Gn,
884
884
  generic: us
885
885
  };
886
- function Fa(e) {
886
+ function Ba(e) {
887
887
  const t = le(e);
888
- return t !== "document" ? Oa[t] : za[_s(e)];
888
+ return t !== "document" ? za[t] : Fa[_s(e)];
889
889
  }
890
890
  function ve(e, t) {
891
- return B.createElement(Fa(e), t);
891
+ return B.createElement(Ba(e), t);
892
892
  }
893
- const Ba = (e) => {
893
+ const $a = (e) => {
894
894
  var t, n;
895
895
  return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((n = e.changedTouches[0]) == null ? void 0 : n.clientX) ?? 0 : e.clientX;
896
- }, $a = ({
896
+ }, Ua = ({
897
897
  source: e,
898
898
  mimeType: t,
899
899
  poster: n,
@@ -905,7 +905,7 @@ const Ba = (e) => {
905
905
  muted: d = !1,
906
906
  onContainerClick: m
907
907
  }) => {
908
- const f = le(t), u = H(null), g = H(null), c = H(null), x = H(r), [_, b] = F(a), [p, v] = F(0), [w, y] = F(!1), [M, L] = F(!1), [O, $] = F(!1), [z, D] = F(!1), [S, T] = F(!0), [E, I] = F(null), k = q(() => {
908
+ const f = le(t), u = H(null), g = H(null), c = H(null), x = H(r), [_, b] = F(a), [p, v] = F(0), [w, y] = F(!1), [L, M] = F(!1), [O, $] = F(!1), [z, D] = F(!1), [S, T] = F(!0), [E, I] = F(null), k = q(() => {
909
909
  $(!1), b(!0);
910
910
  }, []), P = q((N) => {
911
911
  const A = g.current;
@@ -913,7 +913,7 @@ const Ba = (e) => {
913
913
  const U = A.getBoundingClientRect();
914
914
  return Math.max(
915
915
  0,
916
- Math.min(1, (Ba(N) - U.left) / U.width)
916
+ Math.min(1, ($a(N) - U.left) / U.width)
917
917
  );
918
918
  }, []), G = q((N) => {
919
919
  const A = u.current;
@@ -1108,8 +1108,8 @@ const Ba = (e) => {
1108
1108
  onMouseDown: W,
1109
1109
  onTouchStart: W,
1110
1110
  onClick: (N) => N.stopPropagation(),
1111
- onMouseEnter: () => L(!0),
1112
- onMouseLeave: () => L(!1),
1111
+ onMouseEnter: () => M(!0),
1112
+ onMouseLeave: () => M(!1),
1113
1113
  onKeyDown: (N) => {
1114
1114
  N.key === "ArrowRight" && G(Math.min(1, p + 0.05)), N.key === "ArrowLeft" && G(Math.max(0, p - 0.05));
1115
1115
  },
@@ -1117,7 +1117,7 @@ const Ba = (e) => {
1117
1117
  /* @__PURE__ */ s(
1118
1118
  "div",
1119
1119
  {
1120
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${M || w ? "h-1.5" : "h-1"}`,
1120
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || w ? "h-1.5" : "h-1"}`,
1121
1121
  children: /* @__PURE__ */ s(
1122
1122
  "div",
1123
1123
  {
@@ -1130,7 +1130,7 @@ const Ba = (e) => {
1130
1130
  /* @__PURE__ */ s(
1131
1131
  "div",
1132
1132
  {
1133
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${M || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
1133
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || w ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
1134
1134
  style: { left: `${j}%` }
1135
1135
  }
1136
1136
  )
@@ -1141,7 +1141,7 @@ const Ba = (e) => {
1141
1141
  ]
1142
1142
  }
1143
1143
  );
1144
- }, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ua = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", ws = ({
1144
+ }, Zt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Va = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", ws = ({
1145
1145
  mimeType: e,
1146
1146
  sourceUrl: t,
1147
1147
  thumbnailUrl: n,
@@ -1152,7 +1152,7 @@ const Ba = (e) => {
1152
1152
  }) => {
1153
1153
  const o = le(e), [d, m] = F(!1), f = ue(t), u = ue(n);
1154
1154
  return t && (o === "video" || o === "audio") ? /* @__PURE__ */ s(
1155
- $a,
1155
+ Ua,
1156
1156
  {
1157
1157
  source: t,
1158
1158
  mimeType: e,
@@ -1199,11 +1199,11 @@ const Ba = (e) => {
1199
1199
  {
1200
1200
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1201
1201
  children: ve(e, {
1202
- className: Kt(r),
1202
+ className: Zt(r),
1203
1203
  weight: "regular"
1204
1204
  })
1205
1205
  }
1206
- ) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ua(r)}`, children: /* @__PURE__ */ s(
1206
+ ) : n ? /* @__PURE__ */ s("div", { className: `relative ${Va(r)}`, children: /* @__PURE__ */ s(
1207
1207
  "img",
1208
1208
  {
1209
1209
  src: u ?? n,
@@ -1216,7 +1216,7 @@ const Ba = (e) => {
1216
1216
  {
1217
1217
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1218
1218
  children: ve(e, {
1219
- className: Kt(r),
1219
+ className: Zt(r),
1220
1220
  weight: "regular"
1221
1221
  })
1222
1222
  }
@@ -1293,19 +1293,19 @@ function ys(e) {
1293
1293
  function dt(e) {
1294
1294
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#1e2330]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
1295
1295
  }
1296
- function Va(e) {
1296
+ function ja(e) {
1297
1297
  return e ? "bg-white/10" : "bg-black/5";
1298
1298
  }
1299
- function ja(e) {
1299
+ function Ha(e) {
1300
1300
  return e ? "text-white" : "text-black";
1301
1301
  }
1302
- function Ha(e) {
1302
+ function Ga(e) {
1303
1303
  return e ? "text-white/55" : "text-black/55";
1304
1304
  }
1305
- function Ga(e) {
1305
+ function Ya(e) {
1306
1306
  return e ? "text-white/40" : "text-black/40";
1307
1307
  }
1308
- function Ya(e) {
1308
+ function Wa(e) {
1309
1309
  return e ? "text-white/20" : "text-black/20";
1310
1310
  }
1311
1311
  const ut = ({ attachment: e, isMyMessage: t }) => {
@@ -1320,14 +1320,14 @@ const ut = ({ attachment: e, isMyMessage: t }) => {
1320
1320
  ) : /* @__PURE__ */ s(
1321
1321
  "div",
1322
1322
  {
1323
- className: `aspect-video w-full rounded-[20px] ${Va(t)} flex items-center justify-center`,
1324
- children: /* @__PURE__ */ s(ea, { className: `size-12 ${Ya(t)}` })
1323
+ className: `aspect-video w-full rounded-[20px] ${ja(t)} flex items-center justify-center`,
1324
+ children: /* @__PURE__ */ s(ea, { className: `size-12 ${Wa(t)}` })
1325
1325
  }
1326
1326
  ) }),
1327
1327
  /* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
1328
- n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${ja(t)}`, children: n }),
1329
- a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Ha(t)}`, children: a }),
1330
- d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Ga(t)}`, children: d })
1328
+ n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Ha(t)}`, children: n }),
1329
+ a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Ga(t)}`, children: a }),
1330
+ d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Ya(t)}`, children: d })
1331
1331
  ] })
1332
1332
  ] });
1333
1333
  return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ s("div", { className: "block", children: m });
@@ -1339,7 +1339,7 @@ function mt(e) {
1339
1339
  var t;
1340
1340
  return (t = e.attachments) == null ? void 0 : t.find(Cs);
1341
1341
  }
1342
- async function Wa(e, t) {
1342
+ async function qa(e, t) {
1343
1343
  let n;
1344
1344
  try {
1345
1345
  n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
@@ -1351,7 +1351,7 @@ async function Wa(e, t) {
1351
1351
  const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
1352
1352
  l.href = i, l.download = n, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
1353
1353
  }
1354
- const qa = ({
1354
+ const Xa = ({
1355
1355
  url: e,
1356
1356
  filename: t
1357
1357
  }) => {
@@ -1363,7 +1363,7 @@ const qa = ({
1363
1363
  onClick: (i) => {
1364
1364
  i.stopPropagation();
1365
1365
  const l = window.open("", "_blank", "noopener,noreferrer");
1366
- a(!0), Wa(e, t).then(() => {
1366
+ a(!0), qa(e, t).then(() => {
1367
1367
  l == null || l.close();
1368
1368
  }).catch(() => {
1369
1369
  l && (l.location.href = e);
@@ -1453,10 +1453,10 @@ const ks = ({
1453
1453
  containedImage: i === "image" || i === "document"
1454
1454
  }
1455
1455
  ),
1456
- action: /* @__PURE__ */ s(qa, { url: e, filename: n })
1456
+ action: /* @__PURE__ */ s(Xa, { url: e, filename: n })
1457
1457
  }
1458
1458
  );
1459
- }, Xa = ({
1459
+ }, Ka = ({
1460
1460
  message: e,
1461
1461
  isMyMessage: t = !1
1462
1462
  }) => {
@@ -1488,7 +1488,7 @@ const ks = ({
1488
1488
  }
1489
1489
  )
1490
1490
  ] });
1491
- }, Ka = ({
1491
+ }, Za = ({
1492
1492
  message: e
1493
1493
  }) => {
1494
1494
  const t = mt(e);
@@ -1496,7 +1496,7 @@ const ks = ({
1496
1496
  return /* @__PURE__ */ s("div", { className: dt(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ut, { attachment: t, isMyMessage: !0 }) });
1497
1497
  const n = ht(e);
1498
1498
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ks, { ...n }) }) : null;
1499
- }, Za = ({
1499
+ }, Ja = ({
1500
1500
  message: e
1501
1501
  }) => {
1502
1502
  const t = mt(e);
@@ -1504,19 +1504,19 @@ const ks = ({
1504
1504
  return /* @__PURE__ */ s("div", { className: dt(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ut, { attachment: t, isMyMessage: !1 }) });
1505
1505
  const n = ht(e);
1506
1506
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(Ss, { ...n }) }) : null;
1507
- }, Ho = Object.assign(Xa, {
1508
- Creator: Ka,
1509
- Visitor: Za
1510
- }), Ja = {
1507
+ }, Vo = Object.assign(Ka, {
1508
+ Creator: Za,
1509
+ Visitor: Ja
1510
+ }), Qa = {
1511
1511
  dark: "bg-[#1e2330]",
1512
1512
  light: "bg-[#f2f1ef]"
1513
- }, Qa = {
1513
+ }, er = {
1514
1514
  dark: "text-white",
1515
1515
  light: "text-[#000000]"
1516
- }, er = {
1516
+ }, tr = {
1517
1517
  dark: "border-white/[0.08]",
1518
1518
  light: "border-black/[0.08]"
1519
- }, tr = (e) => e === "dark" ? "sender" : "receiver", sr = {
1519
+ }, sr = (e) => e === "dark" ? "sender" : "receiver", nr = {
1520
1520
  sender: {
1521
1521
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
1522
1522
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -1541,7 +1541,7 @@ const ks = ({
1541
1541
  children: d,
1542
1542
  "data-testid": m
1543
1543
  }) => {
1544
- const f = t != null && t !== "", u = l ?? sr[tr(e)][a];
1544
+ const f = t != null && t !== "", u = l ?? nr[sr(e)][a];
1545
1545
  return /* @__PURE__ */ h(
1546
1546
  "div",
1547
1547
  {
@@ -1570,10 +1570,10 @@ const ks = ({
1570
1570
  // there is no ambiguity to resolve.
1571
1571
  f && "pb-0",
1572
1572
  u,
1573
- Ja[e],
1574
1573
  Qa[e],
1574
+ er[e],
1575
1575
  n && "border",
1576
- n && er[e],
1576
+ n && tr[e],
1577
1577
  o
1578
1578
  ),
1579
1579
  children: [
@@ -1619,16 +1619,16 @@ const ks = ({
1619
1619
  ),
1620
1620
  children: /* @__PURE__ */ s(lt, { className: "size-3", weight: "bold" })
1621
1621
  }
1622
- ), Ie = (e) => e === "received" ? "light" : "dark", nr = ({
1622
+ ), Ie = (e) => e === "received" ? "light" : "dark", ar = ({
1623
1623
  firstOfGroup: e,
1624
1624
  endOfGroup: t,
1625
1625
  groupedByUser: n
1626
- }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", ar = ({
1626
+ }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", rr = ({
1627
1627
  src: e,
1628
1628
  mimeType: t,
1629
1629
  filename: n,
1630
1630
  items: a
1631
- }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], rr = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1631
+ }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], ir = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1632
1632
  /* @__PURE__ */ s(
1633
1633
  "audio",
1634
1634
  {
@@ -1651,7 +1651,7 @@ const ks = ({
1651
1651
  preload: o,
1652
1652
  onDismiss: d
1653
1653
  }) => {
1654
- const m = Ie(e), f = e === "composer" && !!d, u = ar({ src: t, mimeType: n, filename: a, items: r });
1654
+ const m = Ie(e), f = e === "composer" && !!d, u = rr({ src: t, mimeType: n, filename: a, items: r });
1655
1655
  if (u.length === 0)
1656
1656
  return null;
1657
1657
  const g = o ?? (u.length > 1 ? "none" : "metadata");
@@ -1663,7 +1663,7 @@ const ks = ({
1663
1663
  groupPosition: l,
1664
1664
  "data-testid": "audio-attachment",
1665
1665
  children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: u.map((c, x) => /* @__PURE__ */ s(
1666
- rr,
1666
+ ir,
1667
1667
  {
1668
1668
  item: c,
1669
1669
  preload: g,
@@ -1677,15 +1677,15 @@ const ks = ({
1677
1677
  )) })
1678
1678
  }
1679
1679
  );
1680
- }, ir = (e) => /* @__PURE__ */ s(ft, { ...e, state: "composer" }), or = (e) => /* @__PURE__ */ s(ft, { ...e, state: "sent" }), lr = (e) => /* @__PURE__ */ s(ft, { ...e, state: "received" }), cr = {
1681
- Composer: ir,
1682
- Sent: or,
1683
- Received: lr
1680
+ }, or = (e) => /* @__PURE__ */ s(ft, { ...e, state: "composer" }), lr = (e) => /* @__PURE__ */ s(ft, { ...e, state: "sent" }), cr = (e) => /* @__PURE__ */ s(ft, { ...e, state: "received" }), dr = {
1681
+ Composer: or,
1682
+ Sent: lr,
1683
+ Received: cr
1684
1684
  };
1685
- function dr(e) {
1685
+ function ur(e) {
1686
1686
  return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
1687
1687
  }
1688
- const ur = {
1688
+ const mr = {
1689
1689
  pdf: "PDF",
1690
1690
  doc: "DOC",
1691
1691
  xls: "XLS",
@@ -1695,7 +1695,7 @@ const ur = {
1695
1695
  text: "TXT",
1696
1696
  markdown: "MD"
1697
1697
  };
1698
- function mr(e, t) {
1698
+ function hr(e, t) {
1699
1699
  if (t) {
1700
1700
  const r = t.lastIndexOf(".");
1701
1701
  if (r > 0 && r < t.length - 1) {
@@ -1705,7 +1705,7 @@ function mr(e, t) {
1705
1705
  }
1706
1706
  if (!e) return;
1707
1707
  if (le(e) === "document") {
1708
- const r = _s(e), i = ur[r];
1708
+ const r = _s(e), i = mr[r];
1709
1709
  if (i) return i;
1710
1710
  if (e === "application/octet-stream") return;
1711
1711
  }
@@ -1713,8 +1713,8 @@ function mr(e, t) {
1713
1713
  if (!(!a || a === "*"))
1714
1714
  return a.toUpperCase();
1715
1715
  }
1716
- function hr(e, t, n) {
1717
- const a = mr(e, t), r = typeof n == "number" && n > 0 ? dr(n) : void 0;
1716
+ function fr(e, t, n) {
1717
+ const a = hr(e, t), r = typeof n == "number" && n > 0 ? ur(n) : void 0;
1718
1718
  return [a, r].filter(Boolean).join(" · ") || void 0;
1719
1719
  }
1720
1720
  function ne(e) {
@@ -1725,13 +1725,13 @@ function ne(e) {
1725
1725
  return "download";
1726
1726
  }
1727
1727
  }
1728
- const fr = {
1728
+ const gr = {
1729
1729
  dark: "text-white/55",
1730
1730
  light: "text-black/65"
1731
- }, gr = {
1731
+ }, pr = {
1732
1732
  dark: "bg-white/10",
1733
1733
  light: "bg-black/5"
1734
- }, pr = {
1734
+ }, br = {
1735
1735
  dark: "text-white/85",
1736
1736
  light: "text-black/85"
1737
1737
  }, Es = ({
@@ -1744,16 +1744,16 @@ const fr = {
1744
1744
  activateLabel: l,
1745
1745
  trailingAction: o
1746
1746
  }) => {
1747
- const d = n ?? t ?? "File", m = hr(a, t, r), f = /* @__PURE__ */ s(
1747
+ const d = n ?? t ?? "File", m = fr(a, t, r), f = /* @__PURE__ */ s(
1748
1748
  "div",
1749
1749
  {
1750
1750
  className: C(
1751
1751
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
1752
- gr[e]
1752
+ pr[e]
1753
1753
  ),
1754
1754
  "aria-hidden": !0,
1755
1755
  children: ve(a, {
1756
- className: C("size-6", pr[e]),
1756
+ className: C("size-6", br[e]),
1757
1757
  weight: "regular"
1758
1758
  })
1759
1759
  }
@@ -1764,7 +1764,7 @@ const fr = {
1764
1764
  {
1765
1765
  className: C(
1766
1766
  "truncate text-xs leading-4",
1767
- fr[e]
1767
+ gr[e]
1768
1768
  ),
1769
1769
  children: m
1770
1770
  }
@@ -1807,14 +1807,14 @@ async function Is(e, t) {
1807
1807
  }
1808
1808
  }
1809
1809
  }
1810
- const br = ({
1810
+ const vr = ({
1811
1811
  src: e,
1812
1812
  filename: t,
1813
1813
  fileSize: n,
1814
1814
  mimeType: a,
1815
1815
  title: r,
1816
1816
  items: i
1817
- }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], vr = ({
1817
+ }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], xr = ({
1818
1818
  variant: e,
1819
1819
  item: t,
1820
1820
  index: n,
@@ -1848,7 +1848,7 @@ const br = ({
1848
1848
  onClick: m,
1849
1849
  onDismiss: f
1850
1850
  }) => {
1851
- const u = Ie(e), g = e === "composer" && !!f, c = br({
1851
+ const u = Ie(e), g = e === "composer" && !!f, c = vr({
1852
1852
  src: t,
1853
1853
  filename: n,
1854
1854
  fileSize: a,
@@ -1883,7 +1883,7 @@ const br = ({
1883
1883
  groupPosition: d,
1884
1884
  "data-testid": "file-attachment",
1885
1885
  children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((b, p) => /* @__PURE__ */ s(
1886
- vr,
1886
+ xr,
1887
1887
  {
1888
1888
  variant: u,
1889
1889
  item: b,
@@ -1895,10 +1895,10 @@ const br = ({
1895
1895
  )) })
1896
1896
  }
1897
1897
  );
1898
- }, xr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "composer" }), _r = (e) => /* @__PURE__ */ s(gt, { ...e, state: "sent" }), wr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "received" }), Nr = {
1899
- Composer: xr,
1900
- Sent: _r,
1901
- Received: wr
1898
+ }, _r = (e) => /* @__PURE__ */ s(gt, { ...e, state: "composer" }), wr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "sent" }), Nr = (e) => /* @__PURE__ */ s(gt, { ...e, state: "received" }), yr = {
1899
+ Composer: _r,
1900
+ Sent: wr,
1901
+ Received: Nr
1902
1902
  }, pt = ({
1903
1903
  onPrev: e,
1904
1904
  onNext: t,
@@ -2181,7 +2181,7 @@ const br = ({
2181
2181
  ]
2182
2182
  }
2183
2183
  ) : null;
2184
- }, yr = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", Cr = {
2184
+ }, Cr = "relative block size-full overflow-hidden bg-black/5 outline-none after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-white/80 focus-visible:after:ring-offset-2 focus-visible:after:ring-offset-black", kr = {
2185
2185
  1: ["rounded-[18px]"],
2186
2186
  2: ["rounded-l-[18px]", "rounded-r-[18px]"],
2187
2187
  3: ["rounded-l-[18px]", "rounded-tr-[18px]", "rounded-br-[18px]"],
@@ -2191,7 +2191,7 @@ const br = ({
2191
2191
  "rounded-bl-[18px]",
2192
2192
  "rounded-br-[18px]"
2193
2193
  ]
2194
- }, kr = "--mes-single-width-cap", Sr = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", Er = 436, Ms = ({
2194
+ }, Sr = "--mes-single-width-cap", Er = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", Ir = 436, Ls = ({
2195
2195
  tiles: e,
2196
2196
  onTileActivate: t,
2197
2197
  maxVisible: n = 4,
@@ -2203,9 +2203,9 @@ const br = ({
2203
2203
  const l = e.slice(0, Math.min(i, n)), o = i - l.length, d = (f, u, g) => {
2204
2204
  var x;
2205
2205
  const c = C(
2206
- yr,
2206
+ Cr,
2207
2207
  "h-full w-full",
2208
- (x = Cr[l.length]) == null ? void 0 : x[u]
2208
+ (x = kr[l.length]) == null ? void 0 : x[u]
2209
2209
  );
2210
2210
  return t ? /* @__PURE__ */ h(
2211
2211
  "button",
@@ -2230,14 +2230,14 @@ const br = ({
2230
2230
  aspectRatio: a,
2231
2231
  // Hundredths keep the emitted declaration readable in devtools;
2232
2232
  // the rounding error is well under a device pixel.
2233
- width: `min(var(${kr}), ${Math.round(Er * a * 100) / 100}px)`,
2233
+ width: `min(var(${Sr}), ${Math.round(Ir * a * 100) / 100}px)`,
2234
2234
  // Only bites in a container narrower than the width cap.
2235
2235
  maxWidth: "100%"
2236
2236
  }), l.length === 1 ? /* @__PURE__ */ s(
2237
2237
  "div",
2238
2238
  {
2239
2239
  className: C(
2240
- a ? Sr : "aspect-square w-full",
2240
+ a ? Er : "aspect-square w-full",
2241
2241
  r
2242
2242
  ),
2243
2243
  style: m,
@@ -2300,7 +2300,7 @@ const br = ({
2300
2300
  [e]
2301
2301
  ), l = q(() => n(!1), []);
2302
2302
  return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
2303
- }, Ir = ({
2303
+ }, Tr = ({
2304
2304
  item: e,
2305
2305
  index: t,
2306
2306
  totalCount: n,
@@ -2328,15 +2328,15 @@ const br = ({
2328
2328
  }
2329
2329
  )
2330
2330
  )
2331
- }), Tr = ({
2331
+ }), Ar = ({
2332
2332
  src: e,
2333
2333
  alt: t,
2334
2334
  items: n
2335
- }) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Ls = (e, t) => e.map((n, a) => ({
2335
+ }) => n && n.length > 0 ? n : e ? [{ src: e, alt: t }] : [], Ms = (e, t) => e.map((n, a) => ({
2336
2336
  src: n.src,
2337
2337
  alt: n.alt,
2338
2338
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2339
- })), Ar = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
2339
+ })), Lr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
2340
2340
  const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Te(
2341
2341
  r
2342
2342
  );
@@ -2366,13 +2366,13 @@ const br = ({
2366
2366
  As,
2367
2367
  {
2368
2368
  open: l,
2369
- items: Ls([{ src: e, alt: t }], n),
2369
+ items: Ms([{ src: e, alt: t }], n),
2370
2370
  initialIndex: o,
2371
2371
  onClose: m
2372
2372
  }
2373
2373
  )
2374
2374
  ] });
2375
- }, Mr = 326 / 246, Lr = (e) => {
2375
+ }, Mr = 326 / 246, Rr = (e) => {
2376
2376
  const t = e == null ? void 0 : e.src, [n, a] = B.useState(), r = B.useCallback(
2377
2377
  (d) => {
2378
2378
  if (!d || d.naturalWidth <= 0 || d.naturalHeight <= 0 || t === void 0) return;
@@ -2402,13 +2402,13 @@ const br = ({
2402
2402
  loading: o = "lazy",
2403
2403
  onClick: d
2404
2404
  }) => {
2405
- const m = Tr({ src: t, alt: n, items: r }), f = Ie(e), { viewerOpen: u, viewerIndex: g, handleActivate: c, closeViewer: x } = Te(
2405
+ const m = Ar({ src: t, alt: n, items: r }), f = Ie(e), { viewerOpen: u, viewerIndex: g, handleActivate: c, closeViewer: x } = Te(
2406
2406
  d
2407
- ), _ = m.length === 1, b = Lr(_ ? m[0] : void 0);
2407
+ ), _ = m.length === 1, b = Rr(_ ? m[0] : void 0);
2408
2408
  if (m.length === 0)
2409
2409
  return null;
2410
2410
  const p = m.map(
2411
- (v, w) => Ir({
2411
+ (v, w) => Tr({
2412
2412
  item: v,
2413
2413
  index: w,
2414
2414
  totalCount: m.length,
@@ -2430,7 +2430,7 @@ const br = ({
2430
2430
  "data-testid": "image-attachment",
2431
2431
  children: [
2432
2432
  /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
2433
- Ms,
2433
+ Ls,
2434
2434
  {
2435
2435
  tiles: p,
2436
2436
  onTileActivate: c,
@@ -2441,7 +2441,7 @@ const br = ({
2441
2441
  As,
2442
2442
  {
2443
2443
  open: u,
2444
- items: Ls(m, a),
2444
+ items: Ms(m, a),
2445
2445
  initialIndex: g,
2446
2446
  onClose: x
2447
2447
  }
@@ -2449,11 +2449,11 @@ const br = ({
2449
2449
  ]
2450
2450
  }
2451
2451
  );
2452
- }, Rr = (e) => /* @__PURE__ */ s(Ar, { ...e }), Dr = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "sent" }), Pr = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "received" }), Or = {
2453
- Composer: Rr,
2454
- Sent: Dr,
2455
- Received: Pr
2456
- }, zr = ({
2452
+ }, Dr = (e) => /* @__PURE__ */ s(Lr, { ...e }), Pr = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "sent" }), Or = (e) => /* @__PURE__ */ s(Rs, { ...e, state: "received" }), zr = {
2453
+ Composer: Dr,
2454
+ Sent: Pr,
2455
+ Received: Or
2456
+ }, Fr = ({
2457
2457
  open: e,
2458
2458
  items: t,
2459
2459
  initialIndex: n = 0,
@@ -2467,7 +2467,7 @@ const br = ({
2467
2467
  () => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "document"),
2468
2468
  [o]
2469
2469
  ), m = se(
2470
- () => o ? Fr(o.src) : void 0,
2470
+ () => o ? Br(o.src) : void 0,
2471
2471
  [o]
2472
2472
  );
2473
2473
  return !o || !m ? null : /* @__PURE__ */ h(
@@ -2501,16 +2501,16 @@ const br = ({
2501
2501
  ]
2502
2502
  }
2503
2503
  );
2504
- }, Fr = (e) => {
2504
+ }, Br = (e) => {
2505
2505
  const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
2506
2506
  return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
2507
- }, Br = ({
2507
+ }, $r = ({
2508
2508
  src: e,
2509
2509
  filename: t,
2510
2510
  fileSize: n,
2511
2511
  title: a,
2512
2512
  items: r
2513
- }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], $r = ({
2513
+ }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], Ur = ({
2514
2514
  variant: e,
2515
2515
  item: t,
2516
2516
  index: n,
@@ -2543,7 +2543,7 @@ const br = ({
2543
2543
  onClick: d,
2544
2544
  onDismiss: m
2545
2545
  }) => {
2546
- const f = Ie(e), u = Br({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: x, closeViewer: _ } = Te(
2546
+ const f = Ie(e), u = $r({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: x, closeViewer: _ } = Te(
2547
2547
  d
2548
2548
  ), b = e === "composer" && !!m;
2549
2549
  if (u.length === 0)
@@ -2561,7 +2561,7 @@ const br = ({
2561
2561
  "data-testid": "pdf-attachment",
2562
2562
  children: [
2563
2563
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: u.map((v, w) => {
2564
- const y = v.filename ?? ne(v.src), M = b && w === 0 ? /* @__PURE__ */ s(Ee, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2564
+ const y = v.filename ?? ne(v.src), L = b && w === 0 ? /* @__PURE__ */ s(Ee, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2565
2565
  Ts,
2566
2566
  {
2567
2567
  url: v.src,
@@ -2572,19 +2572,19 @@ const br = ({
2572
2572
  }
2573
2573
  );
2574
2574
  return /* @__PURE__ */ s(
2575
- $r,
2575
+ Ur,
2576
2576
  {
2577
2577
  variant: f,
2578
2578
  item: v,
2579
2579
  index: w,
2580
2580
  onActivate: x,
2581
- trailingAction: M
2581
+ trailingAction: L
2582
2582
  },
2583
2583
  `${v.src}-${w}`
2584
2584
  );
2585
2585
  }) }),
2586
2586
  /* @__PURE__ */ s(
2587
- zr,
2587
+ Fr,
2588
2588
  {
2589
2589
  open: g,
2590
2590
  items: p,
@@ -2595,10 +2595,10 @@ const br = ({
2595
2595
  ]
2596
2596
  }
2597
2597
  );
2598
- }, Ur = (e) => /* @__PURE__ */ s(xt, { ...e, state: "composer" }), Vr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "sent" }), jr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "received" }), Hr = {
2599
- Composer: Ur,
2600
- Sent: Vr,
2601
- Received: jr
2598
+ }, Vr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "composer" }), jr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "sent" }), Hr = (e) => /* @__PURE__ */ s(xt, { ...e, state: "received" }), Gr = {
2599
+ Composer: Vr,
2600
+ Sent: jr,
2601
+ Received: Hr
2602
2602
  }, Ds = ({
2603
2603
  open: e,
2604
2604
  items: t,
@@ -2649,7 +2649,7 @@ const br = ({
2649
2649
  ]
2650
2650
  }
2651
2651
  ) : null;
2652
- }, Gr = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(st, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Ps = ({
2652
+ }, Yr = () => /* @__PURE__ */ s("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ s("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ s(st, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Ps = ({
2653
2653
  item: e,
2654
2654
  index: t
2655
2655
  }) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
@@ -2671,11 +2671,11 @@ const br = ({
2671
2671
  "aria-hidden": !0
2672
2672
  }
2673
2673
  ) }),
2674
- /* @__PURE__ */ s(Gr, {})
2675
- ] }), Yr = (e, t, n) => ({
2674
+ /* @__PURE__ */ s(Yr, {})
2675
+ ] }), Wr = (e, t, n) => ({
2676
2676
  ariaLabel: `Play video ${t + 1} of ${n}`,
2677
2677
  content: /* @__PURE__ */ s(Ps, { item: e, index: t })
2678
- }), Wr = ({
2678
+ }), qr = ({
2679
2679
  src: e,
2680
2680
  poster: t,
2681
2681
  mimeType: n,
@@ -2687,7 +2687,7 @@ const br = ({
2687
2687
  mimeType: n.mimeType,
2688
2688
  preload: n.preload,
2689
2689
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2690
- })), qr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
2690
+ })), Xr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
2691
2691
  const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: f } = Te(
2692
2692
  i
2693
2693
  );
@@ -2728,13 +2728,13 @@ const br = ({
2728
2728
  preload: d,
2729
2729
  onClick: m
2730
2730
  }) => {
2731
- const f = Wr({ src: t, poster: n, mimeType: a, preload: d, items: i }), u = Ie(e), { viewerOpen: g, viewerIndex: c, handleActivate: x, closeViewer: _ } = Te(
2731
+ const f = qr({ src: t, poster: n, mimeType: a, preload: d, items: i }), u = Ie(e), { viewerOpen: g, viewerIndex: c, handleActivate: x, closeViewer: _ } = Te(
2732
2732
  m
2733
2733
  );
2734
2734
  if (f.length === 0)
2735
2735
  return null;
2736
2736
  const b = f.map(
2737
- (p, v) => Yr(p, v, f.length)
2737
+ (p, v) => Wr(p, v, f.length)
2738
2738
  );
2739
2739
  return /* @__PURE__ */ h(
2740
2740
  Se,
@@ -2744,7 +2744,7 @@ const br = ({
2744
2744
  groupPosition: o,
2745
2745
  "data-testid": "video-attachment",
2746
2746
  children: [
2747
- /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Ms, { tiles: b, onTileActivate: x }) }),
2747
+ /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Ls, { tiles: b, onTileActivate: x }) }),
2748
2748
  /* @__PURE__ */ s(
2749
2749
  Ds,
2750
2750
  {
@@ -2757,31 +2757,31 @@ const br = ({
2757
2757
  ]
2758
2758
  }
2759
2759
  );
2760
- }, Xr = (e) => /* @__PURE__ */ s(qr, { ...e }), Kr = (e) => /* @__PURE__ */ s(zs, { ...e, state: "sent" }), Zr = (e) => /* @__PURE__ */ s(zs, { ...e, state: "received" }), Jr = {
2761
- Composer: Xr,
2762
- Sent: Kr,
2763
- Received: Zr
2760
+ }, Kr = (e) => /* @__PURE__ */ s(Xr, { ...e }), Zr = (e) => /* @__PURE__ */ s(zs, { ...e, state: "sent" }), Jr = (e) => /* @__PURE__ */ s(zs, { ...e, state: "received" }), Qr = {
2761
+ Composer: Kr,
2762
+ Sent: Zr,
2763
+ Received: Jr
2764
2764
  }, we = {
2765
- Image: Or,
2766
- Video: Jr,
2767
- Audio: cr,
2768
- Pdf: Hr,
2769
- File: Nr
2770
- }, Qr = {
2771
- isUnlocking: () => !1
2765
+ Image: zr,
2766
+ Video: Qr,
2767
+ Audio: dr,
2768
+ Pdf: Gr,
2769
+ File: yr
2772
2770
  }, ei = {
2773
- LockedAttachment: Qr
2774
- }, Fs = ot({}), Go = Fs.Provider;
2775
- function ti(e) {
2776
- return Ce(Fs)[e] ?? ei[e];
2771
+ isUnlocking: () => !1
2772
+ }, ti = {
2773
+ LockedAttachment: ei
2774
+ }, Fs = ot({}), jo = Fs.Provider;
2775
+ function si(e) {
2776
+ return Ce(Fs)[e] ?? ti[e];
2777
2777
  }
2778
- const si = B.lazy(() => import("./Card-qS17qnN0.js")), ni = B.lazy(() => import("./Card-CFJBJl09.js")), ai = () => /* @__PURE__ */ s(
2778
+ const ni = B.lazy(() => import("./Card-qS17qnN0.js")), ai = B.lazy(() => import("./Card-gNYP3vdJ.js")), ri = () => /* @__PURE__ */ s(
2779
2779
  "div",
2780
2780
  {
2781
2781
  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)]",
2782
2782
  "aria-hidden": !0
2783
2783
  }
2784
- ), De = (e) => /* @__PURE__ */ s(en, { fallback: /* @__PURE__ */ s(ai, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(si, { ...e }) : /* @__PURE__ */ s(ni, { ...e }) }), ri = ({ size: e = 15 }) => /* @__PURE__ */ s(
2784
+ ), De = (e) => /* @__PURE__ */ s(en, { fallback: /* @__PURE__ */ s(ri, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(ni, { ...e }) : /* @__PURE__ */ s(ai, { ...e }) }), ii = ({ size: e = 15 }) => /* @__PURE__ */ s(
2785
2785
  "svg",
2786
2786
  {
2787
2787
  width: e,
@@ -2798,7 +2798,7 @@ const si = B.lazy(() => import("./Card-qS17qnN0.js")), ni = B.lazy(() => import(
2798
2798
  }
2799
2799
  )
2800
2800
  }
2801
- ), ii = (e) => {
2801
+ ), oi = (e) => {
2802
2802
  var t;
2803
2803
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.TIP;
2804
2804
  }, Bs = (e) => {
@@ -2810,13 +2810,13 @@ const si = B.lazy(() => import("./Card-qS17qnN0.js")), ni = B.lazy(() => import(
2810
2810
  }, _t = (e) => {
2811
2811
  var t;
2812
2812
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.ATTACHMENT;
2813
- }, oi = (e) => {
2813
+ }, li = (e) => {
2814
2814
  var t;
2815
2815
  return _t(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
2816
- }, li = (e) => {
2816
+ }, ci = (e) => {
2817
2817
  var t;
2818
2818
  return _t(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
2819
- }, $s = (e) => ii(e) || Bs(e), ci = (e) => {
2819
+ }, $s = (e) => oi(e) || Bs(e), di = (e) => {
2820
2820
  var t;
2821
2821
  return $s(e) && !((t = e.text) != null && t.trim());
2822
2822
  }, qe = ({
@@ -2842,7 +2842,7 @@ const si = B.lazy(() => import("./Card-qS17qnN0.js")), ni = B.lazy(() => import(
2842
2842
  "message-chatbot-indicator",
2843
2843
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
2844
2844
  l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
2845
- ].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(ri, { size: l ? 12 : 15 }) });
2845
+ ].join(" "), m = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), f = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(ii, { size: l ? 12 : 15 }) });
2846
2846
  return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ h(K, { children: [
2847
2847
  m,
2848
2848
  f
@@ -2850,7 +2850,7 @@ const si = B.lazy(() => import("./Card-qS17qnN0.js")), ni = B.lazy(() => import(
2850
2850
  f,
2851
2851
  m
2852
2852
  ] }) });
2853
- }, di = ({
2853
+ }, ui = ({
2854
2854
  selected: e,
2855
2855
  onVoteUp: t,
2856
2856
  onVoteDown: n
@@ -2896,7 +2896,7 @@ const si = B.lazy(() => import("./Card-qS17qnN0.js")), ni = B.lazy(() => import(
2896
2896
  }, Xe = () => Us() ? /* @__PURE__ */ h(K, { children: [
2897
2897
  /* @__PURE__ */ s(ia, { weight: "bold", "aria-hidden": "true" }),
2898
2898
  /* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
2899
- ] }) : null, ui = () => Us() ? /* @__PURE__ */ h(K, { children: [
2899
+ ] }) : null, mi = () => Us() ? /* @__PURE__ */ h(K, { children: [
2900
2900
  /* @__PURE__ */ s(
2901
2901
  be,
2902
2902
  {
@@ -2906,41 +2906,41 @@ const si = B.lazy(() => import("./Card-qS17qnN0.js")), ni = B.lazy(() => import(
2906
2906
  }
2907
2907
  ),
2908
2908
  /* @__PURE__ */ s("span", { "data-testid": "sent-message-sending-status", children: "Sending" })
2909
- ] }) : null, mi = () => /* @__PURE__ */ h("span", { className: "str-chat__message-status sent-message-status--failed", children: [
2909
+ ] }) : null, hi = () => /* @__PURE__ */ h("span", { className: "str-chat__message-status sent-message-status--failed", children: [
2910
2910
  /* @__PURE__ */ s(ra, { weight: "bold", "aria-hidden": "true" }),
2911
2911
  /* @__PURE__ */ s("span", { "data-testid": "sent-message-failed-status", children: "Failed to send" })
2912
- ] }), hi = () => {
2912
+ ] }), fi = () => {
2913
2913
  const { isMyMessage: e, message: t, threadList: n } = he(
2914
2914
  "SentMessageDeliveryStatus"
2915
2915
  );
2916
- return n ? null : t.status === "failed" && e() && t.type !== "error" ? /* @__PURE__ */ s(mi, {}) : /* @__PURE__ */ s(
2916
+ return n ? null : t.status === "failed" && e() && t.type !== "error" ? /* @__PURE__ */ s(hi, {}) : /* @__PURE__ */ s(
2917
2917
  rn,
2918
2918
  {
2919
2919
  MessageSentStatus: Xe,
2920
2920
  MessageDeliveredStatus: Xe,
2921
2921
  MessageReadStatus: Xe,
2922
- MessageSendingStatus: ui
2922
+ MessageSendingStatus: mi
2923
2923
  }
2924
2924
  );
2925
- }, fi = /^([a-z][a-z0-9+.-]*):/i, gi = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2925
+ }, gi = /^([a-z][a-z0-9+.-]*):/i, pi = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2926
2926
  function wt(e) {
2927
2927
  if (typeof e != "string") return;
2928
2928
  const t = e.trim();
2929
2929
  if (t === "") return;
2930
- const n = fi.exec(t);
2930
+ const n = gi.exec(t);
2931
2931
  if (n) {
2932
2932
  const a = n[1].toLowerCase();
2933
- return gi.has(a) ? t : void 0;
2933
+ return pi.has(a) ? t : void 0;
2934
2934
  }
2935
2935
  return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
2936
2936
  }
2937
- const pi = {
2937
+ const bi = {
2938
2938
  dark: "bg-white text-[#121110] hover:bg-white/90",
2939
2939
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2940
- }, bi = ({ variant: e, cta: t }) => {
2940
+ }, vi = ({ variant: e, cta: t }) => {
2941
2941
  const n = C(
2942
2942
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2943
- pi[e]
2943
+ bi[e]
2944
2944
  ), a = wt(t.href);
2945
2945
  return a ? /* @__PURE__ */ s(
2946
2946
  "a",
@@ -2967,13 +2967,13 @@ const pi = {
2967
2967
  children: t.label
2968
2968
  }
2969
2969
  );
2970
- }, vi = {
2970
+ }, xi = {
2971
2971
  dark: "text-white",
2972
2972
  light: "text-black/90"
2973
- }, xi = "text-white/30", _i = {
2973
+ }, _i = "text-white/30", wi = {
2974
2974
  dark: "text-white/55",
2975
2975
  light: "text-black/55"
2976
- }, wi = {
2976
+ }, Ni = {
2977
2977
  dark: "bg-white/25",
2978
2978
  light: "bg-black/15"
2979
2979
  }, Nt = ({
@@ -2993,19 +2993,19 @@ const pi = {
2993
2993
  return null;
2994
2994
  const p = f && !t, v = C(
2995
2995
  "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]",
2996
- d == null && (p ? xi : vi[e])
2996
+ d == null && (p ? _i : xi[e])
2997
2997
  ), w = C(
2998
2998
  "truncate text-[12px] leading-4 tracking-[0.24px]",
2999
- d == null && _i[e]
2999
+ d == null && wi[e]
3000
3000
  ), y = d ? { color: d } : void 0;
3001
3001
  if (m) {
3002
- const M = C(
3002
+ const L = C(
3003
3003
  "animate-pulse rounded",
3004
- wi[e]
3004
+ Ni[e]
3005
3005
  );
3006
3006
  return /* @__PURE__ */ s("div", { className: "shrink-0 px-4 py-3", children: /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-[2px]", children: [
3007
- /* @__PURE__ */ s("div", { className: C("h-5 w-3/4", M), "aria-hidden": !0 }),
3008
- /* @__PURE__ */ s("div", { className: C("h-4 w-1/2", M), "aria-hidden": !0 })
3007
+ /* @__PURE__ */ s("div", { className: C("h-5 w-3/4", L), "aria-hidden": !0 }),
3008
+ /* @__PURE__ */ s("div", { className: C("h-4 w-1/2", L), "aria-hidden": !0 })
3009
3009
  ] }) });
3010
3010
  }
3011
3011
  return /* @__PURE__ */ h("div", { className: "shrink-0 px-4 py-3", children: [
@@ -3027,14 +3027,14 @@ const pi = {
3027
3027
  ] }),
3028
3028
  o && /* @__PURE__ */ s("div", { className: "shrink-0", children: o })
3029
3029
  ] }),
3030
- l && /* @__PURE__ */ s(bi, { variant: e, cta: l })
3030
+ l && /* @__PURE__ */ s(vi, { variant: e, cta: l })
3031
3031
  ] });
3032
- }, Ni = "Loading link preview", yi = C(
3032
+ }, yi = "Loading link preview", Ci = C(
3033
3033
  "relative w-[290px] select-none overflow-hidden",
3034
3034
  // 20px corners — no token exists for it in the component-library preset,
3035
3035
  // whose radius scale is sm .5rem / md 1rem / lg 1.5rem / xl 4rem.
3036
3036
  "rounded-[20px]"
3037
- ), Ci = "flex h-[250px] flex-col", Fe = ({
3037
+ ), ki = "flex h-[250px] flex-col", Fe = ({
3038
3038
  variant: e,
3039
3039
  children: t,
3040
3040
  href: n,
@@ -3049,8 +3049,8 @@ const pi = {
3049
3049
  "data-testid": u
3050
3050
  }) => {
3051
3051
  const g = n != null || a != null, c = C(
3052
- yi,
3053
- m ? Ci : "block",
3052
+ Ci,
3053
+ m ? ki : "block",
3054
3054
  // Kept underneath `accentStyle` rather than swapped out: the inline
3055
3055
  // background wins on specificity, and leaving the class in place means
3056
3056
  // an accent that somehow doesn't paint still lands on a sane surface.
@@ -3059,7 +3059,7 @@ const pi = {
3059
3059
  // tailwind preset — outline-none + a black 2px focus-visible ring
3060
3060
  // with offset, so keyboard users can see the focused card.
3061
3061
  g ? "cursor-pointer no-underline focus-ring" : null
3062
- ), x = f ? { role: "status", "aria-busy": !0, "aria-label": Ni } : void 0, _ = l ? /* @__PURE__ */ s("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: l }) : null;
3062
+ ), x = f ? { role: "status", "aria-busy": !0, "aria-label": yi } : void 0, _ = l ? /* @__PURE__ */ s("div", { className: "pointer-events-auto absolute right-3 top-3 z-10", children: l }) : null;
3063
3063
  return n ? /* @__PURE__ */ h(
3064
3064
  "a",
3065
3065
  {
@@ -3107,10 +3107,10 @@ const pi = {
3107
3107
  ]
3108
3108
  }
3109
3109
  );
3110
- }, Zt = {
3110
+ }, Jt = {
3111
3111
  dark: "bg-white/10",
3112
3112
  light: "bg-black/5"
3113
- }, ki = {
3113
+ }, Si = {
3114
3114
  dark: "size-16 text-white/25",
3115
3115
  light: "size-16 text-black/25"
3116
3116
  }, Ae = (e, t) => !!t && !!e && le(e) === "audio", yt = (e, t) => {
@@ -3160,7 +3160,7 @@ const pi = {
3160
3160
  {
3161
3161
  className: C(
3162
3162
  "h-full w-full animate-pulse",
3163
- Zt[e]
3163
+ Jt[e]
3164
3164
  ),
3165
3165
  "aria-hidden": !0
3166
3166
  }
@@ -3204,10 +3204,10 @@ const pi = {
3204
3204
  {
3205
3205
  className: C(
3206
3206
  "flex h-full w-full items-center justify-center",
3207
- Zt[e]
3207
+ Jt[e]
3208
3208
  ),
3209
3209
  children: ve(r, {
3210
- className: ki[e],
3210
+ className: Si[e],
3211
3211
  weight: "regular"
3212
3212
  })
3213
3213
  }
@@ -3217,10 +3217,10 @@ const pi = {
3217
3217
  ]
3218
3218
  }
3219
3219
  );
3220
- }, Pe = "#FFFFFF", Jt = "#040403", Si = "#1e2330", Ei = 3, Ii = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3221
- function Ti(e) {
3222
- if (typeof e != "string" || !Ii.test(e.trim())) return;
3223
- const t = e.trim().replace(/^#/, ""), n = t.length === Ei ? t.replace(/./g, (a) => a + a) : t;
3220
+ }, Pe = "#FFFFFF", Qt = "#040403", Ei = "#1e2330", Ii = 3, Ti = /^#?(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3221
+ function Ai(e) {
3222
+ if (typeof e != "string" || !Ti.test(e.trim())) return;
3223
+ const t = e.trim().replace(/^#/, ""), n = t.length === Ii ? t.replace(/./g, (a) => a + a) : t;
3224
3224
  return [
3225
3225
  Number.parseInt(n.slice(0, 2), 16),
3226
3226
  Number.parseInt(n.slice(2, 4), 16),
@@ -3232,27 +3232,27 @@ function Ke(e) {
3232
3232
  return t <= 0.03928 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
3233
3233
  }
3234
3234
  function rt(e) {
3235
- const t = Ti(e);
3235
+ const t = Ai(e);
3236
3236
  return t ? 0.2126 * Ke(t[0]) + 0.7152 * Ke(t[1]) + 0.0722 * Ke(t[2]) : Number.NaN;
3237
3237
  }
3238
- function Qt(e, t) {
3238
+ function es(e, t) {
3239
3239
  const n = rt(e), a = rt(t);
3240
3240
  if (Number.isNaN(n) || Number.isNaN(a)) return Number.NaN;
3241
3241
  const r = Math.max(n, a), i = Math.min(n, a);
3242
3242
  return (r + 0.05) / (i + 0.05);
3243
3243
  }
3244
- function Ai(e) {
3244
+ function Li(e) {
3245
3245
  if (e == null) return Pe;
3246
- const t = Qt(e, Pe);
3247
- return Number.isNaN(t) || t >= Qt(e, Jt) ? Pe : Jt;
3246
+ const t = es(e, Pe);
3247
+ return Number.isNaN(t) || t >= es(e, Qt) ? Pe : Qt;
3248
3248
  }
3249
3249
  function Mi(e) {
3250
3250
  if (e == null || Number.isNaN(rt(e))) return;
3251
3251
  const t = e.trim();
3252
3252
  return t.startsWith("#") ? t : `#${t}`;
3253
3253
  }
3254
- const Li = {
3255
- dark: Si,
3254
+ const Ri = {
3255
+ dark: Ei,
3256
3256
  light: "#ffffff"
3257
3257
  };
3258
3258
  function kt({
@@ -3274,13 +3274,13 @@ function kt({
3274
3274
  return {
3275
3275
  thumbnailUrl: o ? void 0 : r,
3276
3276
  accentStyle: u ? { backgroundColor: u } : void 0,
3277
- chinTextColor: u ? Ai(u) : void 0,
3278
- tailColor: u ?? Li[e],
3277
+ chinTextColor: u ? Li(u) : void 0,
3278
+ tailColor: u ?? Ri[e],
3279
3279
  isLoading: n === "loading",
3280
3280
  onImageError: m
3281
3281
  };
3282
3282
  }
3283
- const Ri = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white focus-ring", Di = "relative before:absolute before:-inset-[10px] before:content-['']", Pi = ({
3283
+ const Di = "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white focus-ring", Pi = "relative before:absolute before:-inset-[10px] before:content-['']", Oi = ({
3284
3284
  title: e,
3285
3285
  placeholderTitle: t,
3286
3286
  description: n,
@@ -3312,8 +3312,8 @@ const Ri = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3312
3312
  onClick: g,
3313
3313
  "aria-label": x,
3314
3314
  className: C(
3315
- Ri,
3316
- !b && Di
3315
+ Di,
3316
+ !b && Pi
3317
3317
  ),
3318
3318
  children: /* @__PURE__ */ s(lt, { className: "size-3", weight: "bold" })
3319
3319
  }
@@ -3402,7 +3402,7 @@ const Ri = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3402
3402
  }
3403
3403
  )
3404
3404
  ] })
3405
- ) : /* @__PURE__ */ s(K, { children: a }), Oi = ({
3405
+ ) : /* @__PURE__ */ s(K, { children: a }), zi = ({
3406
3406
  title: e,
3407
3407
  description: t,
3408
3408
  url: n,
@@ -3481,7 +3481,7 @@ const Ri = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3481
3481
  )
3482
3482
  }
3483
3483
  );
3484
- }, zi = ({
3484
+ }, Fi = ({
3485
3485
  title: e,
3486
3486
  placeholderTitle: t,
3487
3487
  description: n,
@@ -3555,21 +3555,21 @@ const Ri = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
3555
3555
  }
3556
3556
  );
3557
3557
  }, it = {
3558
- Composer: Pi,
3559
- Sent: zi,
3560
- Received: Oi
3558
+ Composer: Oi,
3559
+ Sent: Fi,
3560
+ Received: zi
3561
3561
  };
3562
3562
  function R(e) {
3563
3563
  const t = e == null ? void 0 : e.trim();
3564
3564
  return t || void 0;
3565
3565
  }
3566
- function es(e) {
3566
+ function ts(e) {
3567
3567
  return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
3568
3568
  }
3569
- function Fi(e, t) {
3569
+ function Bi(e, t) {
3570
3570
  if (!(e != null && e.trim()) || !(t != null && t.trim()))
3571
3571
  return !1;
3572
- const n = es(e), a = es(t);
3572
+ const n = ts(e), a = ts(t);
3573
3573
  if (n === a)
3574
3574
  return !0;
3575
3575
  if (!n.includes(a))
@@ -3577,7 +3577,7 @@ function Fi(e, t) {
3577
3577
  const r = n.split(a).join("");
3578
3578
  return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
3579
3579
  }
3580
- function ts(e) {
3580
+ function ss(e) {
3581
3581
  const t = R(e.og_scrape_url) ?? R(e.title_link), n = R(e.image_url) ?? R(e.thumb_url), a = R(e.asset_url), r = R(e.mime_type);
3582
3582
  return {
3583
3583
  title: R(e.title),
@@ -3599,7 +3599,7 @@ function ts(e) {
3599
3599
  status: "ready"
3600
3600
  };
3601
3601
  }
3602
- function Bi(e) {
3602
+ function $i(e) {
3603
3603
  var t;
3604
3604
  return js(e) ? null : e.type === "image" ? e.image_url || e.asset_url ? "image" : null : e.type === "video" && e.asset_url ? "video" : e.type === "audio" && e.asset_url ? "audio" : e.type === "file" && e.asset_url ? e.mime_type === "application/pdf" ? "pdf" : (t = e.mime_type) != null && t.startsWith("audio/") ? "audio" : "file" : null;
3605
3605
  }
@@ -3629,21 +3629,21 @@ function Hs(e) {
3629
3629
  a(r);
3630
3630
  continue;
3631
3631
  }
3632
- const i = Bi(r);
3632
+ const i = $i(r);
3633
3633
  i && n(i, r);
3634
3634
  }
3635
3635
  return t;
3636
3636
  }
3637
- function $i(e) {
3637
+ function Ui(e) {
3638
3638
  return e.filter((t) => t.type === "media").length;
3639
3639
  }
3640
- function Ui(e, t, n) {
3640
+ function Vi(e, t, n) {
3641
3641
  return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
3642
3642
  }
3643
- function ss(e) {
3643
+ function ns(e) {
3644
3644
  return R(e.image_url) ?? R(e.asset_url) ?? "";
3645
3645
  }
3646
- function Vi(e) {
3646
+ function ji(e) {
3647
3647
  switch (e) {
3648
3648
  case "image":
3649
3649
  return we.Image;
@@ -3657,13 +3657,13 @@ function Vi(e) {
3657
3657
  return we.File;
3658
3658
  }
3659
3659
  }
3660
- function ji(e, t) {
3660
+ function Hi(e, t) {
3661
3661
  if (t.length > 1)
3662
3662
  switch (e) {
3663
3663
  case "image":
3664
3664
  return {
3665
3665
  items: t.map((a) => ({
3666
- src: ss(a),
3666
+ src: ns(a),
3667
3667
  alt: R(a.title)
3668
3668
  }))
3669
3669
  };
@@ -3708,7 +3708,7 @@ function ji(e, t) {
3708
3708
  switch (e) {
3709
3709
  case "image":
3710
3710
  return {
3711
- src: ss(n),
3711
+ src: ns(n),
3712
3712
  alt: R(n.title)
3713
3713
  };
3714
3714
  case "video":
@@ -3740,18 +3740,18 @@ function ji(e, t) {
3740
3740
  };
3741
3741
  }
3742
3742
  }
3743
- function Hi({
3743
+ function Gi({
3744
3744
  groupPosition: e,
3745
3745
  isMyMessage: t,
3746
3746
  segment: n
3747
3747
  }) {
3748
- const a = Vi(n.kind), r = {
3749
- ...ji(n.kind, n.attachments),
3748
+ const a = ji(n.kind), r = {
3749
+ ...Hi(n.kind, n.attachments),
3750
3750
  groupPosition: e
3751
3751
  };
3752
3752
  return t ? /* @__PURE__ */ s(a.Sent, { ...r }) : /* @__PURE__ */ s(a.Received, { ...r });
3753
3753
  }
3754
- const Gi = ({
3754
+ const Yi = ({
3755
3755
  groupPosition: e,
3756
3756
  isMyMessage: t,
3757
3757
  message: n,
@@ -3760,7 +3760,7 @@ const Gi = ({
3760
3760
  var _;
3761
3761
  const r = Hs(n.attachments);
3762
3762
  if (r.length === 0) return null;
3763
- const i = $i(r), l = (_ = n.text) == null ? void 0 : _.trim(), o = r.find((b) => b.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? ts(o.attachments[0] ?? {}).url : void 0, m = l && Fi(l, d) ? void 0 : l;
3763
+ const i = Ui(r), l = (_ = n.text) == null ? void 0 : _.trim(), o = r.find((b) => b.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? ss(o.attachments[0] ?? {}).url : void 0, m = l && Bi(l, d) ? void 0 : l;
3764
3764
  let f = 0;
3765
3765
  const u = [], g = m ? "middle" : e, c = (b, p, v) => {
3766
3766
  const w = t ? it.Sent : it.Received;
@@ -3768,21 +3768,21 @@ const Gi = ({
3768
3768
  /* @__PURE__ */ s(
3769
3769
  w,
3770
3770
  {
3771
- ...ts(b),
3771
+ ...ss(b),
3772
3772
  groupPosition: v ? g : "middle"
3773
3773
  },
3774
3774
  p
3775
3775
  )
3776
3776
  );
3777
3777
  }, x = (b, p) => {
3778
- const v = Ui(
3778
+ const v = Vi(
3779
3779
  f,
3780
3780
  i,
3781
3781
  e
3782
3782
  );
3783
3783
  f += 1, u.push(
3784
3784
  /* @__PURE__ */ s(
3785
- Hi,
3785
+ Gi,
3786
3786
  {
3787
3787
  groupPosition: v,
3788
3788
  isMyMessage: t,
@@ -3828,8 +3828,8 @@ const Gi = ({
3828
3828
  /* @__PURE__ */ s(et, {})
3829
3829
  ] }) : null
3830
3830
  ] });
3831
- }, Yi = (e) => {
3832
- var Lt, Rt, Dt, Pt, Ot, zt, Ft, Bt, $t, Ut;
3831
+ }, Wi = (e) => {
3832
+ var Mt, Rt, Dt, Pt, Ot, zt, Ft, Bt, $t, Ut;
3833
3833
  const {
3834
3834
  additionalMessageInputProps: t,
3835
3835
  chatbotVotingEnabled: n,
@@ -3847,7 +3847,7 @@ const Gi = ({
3847
3847
  renderText: x,
3848
3848
  threadList: _,
3849
3849
  viewerLanguage: b
3850
- } = e, { client: p } = ke("CustomMessage"), { channel: v } = me("CustomMessage"), { isUnlocking: w, onUnlockClick: y, onFetchSource: M, onDownloadClick: L } = ti("LockedAttachment"), [O, $] = F(!1), z = ln(c.id), { selected: D, voteUp: S, voteDown: T } = Aa(c), {
3850
+ } = e, { client: p } = ke("CustomMessage"), { channel: v } = me("CustomMessage"), { isUnlocking: w, onUnlockClick: y, onFetchSource: L, onDownloadClick: M } = si("LockedAttachment"), [O, $] = F(!1), z = ln(c.id), { selected: D, voteUp: S, voteDown: T } = La(c), {
3851
3851
  Attachment: E = cn,
3852
3852
  EditMessageModal: I = dn,
3853
3853
  MessageActions: k,
@@ -3873,10 +3873,10 @@ const Gi = ({
3873
3873
  ), ae = se(() => {
3874
3874
  const de = xs({ message: c, viewerLanguage: b });
3875
3875
  return de === c.text ? c : { ...c, text: de };
3876
- }, [c, b]), Me = Q.length > 0, Le = Q.reduce(
3876
+ }, [c, b]), Le = Q.length > 0, Me = Q.reduce(
3877
3877
  (de, pe) => de + pe.attachments.length,
3878
3878
  0
3879
- ) === ((V == null ? void 0 : V.length) ?? 0), re = nr({
3879
+ ) === ((V == null ? void 0 : V.length) ?? 0), re = ar({
3880
3880
  endOfGroup: r,
3881
3881
  firstOfGroup: i,
3882
3882
  groupedByUser: l
@@ -3887,7 +3887,7 @@ const Gi = ({
3887
3887
  return /* @__PURE__ */ s(W, { message: c });
3888
3888
  if (wn(c))
3889
3889
  return /* @__PURE__ */ s(P, {});
3890
- const ce = !_ && !!c.reply_count, ie = !_ && c.show_in_channel && c.parent_id, St = c.status === "failed" && ((Lt = c.error) == null ? void 0 : Lt.status) !== 403, Et = Nn(c);
3890
+ const ce = !_ && !!c.reply_count, ie = !_ && c.show_in_channel && c.parent_id, St = c.status === "failed" && ((Mt = c.error) == null ? void 0 : Mt.status) !== 403, Et = Nn(c);
3891
3891
  let fe;
3892
3892
  St ? fe = () => m(c) : Et && (fe = () => $(!0));
3893
3893
  const ee = g(), Ks = C(
@@ -3907,12 +3907,12 @@ const Gi = ({
3907
3907
  "str-chat__virtual-message__wrapper--first": i,
3908
3908
  "str-chat__virtual-message__wrapper--group": l
3909
3909
  }
3910
- ), Ve = c.poll_id && p.polls.fromState(c.poll_id), It = ci(c), ge = ze(c), Zs = _t(c), je = !!(V != null && V.length && !c.quoted_message), Tt = ge && ee && je, Js = Me && Le && !c.quoted_message && !Ve && !X && !ge, At = {
3910
+ ), Ve = c.poll_id && p.polls.fromState(c.poll_id), It = di(c), ge = ze(c), Zs = _t(c), je = !!(V != null && V.length && !c.quoted_message), Tt = ge && ee && je, Js = Le && Me && !c.quoted_message && !Ve && !X && !ge, At = {
3911
3911
  contentType: "text",
3912
3912
  amountText: (Dt = c.metadata) == null ? void 0 : Dt.amount_text,
3913
3913
  paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
3914
3914
  renderedText: c.text && /* @__PURE__ */ s(Oe, { message: ae, renderText: x })
3915
- }, Mt = {
3915
+ }, Lt = {
3916
3916
  contentType: "media",
3917
3917
  title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
3918
3918
  mimeType: (zt = c.metadata) == null ? void 0 : zt.attachment_mime_type,
@@ -3920,7 +3920,7 @@ const Gi = ({
3920
3920
  amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
3921
3921
  detail: ($t = c.metadata) == null ? void 0 : $t.attachment_detail,
3922
3922
  paymentStatus: (Ut = c.metadata) == null ? void 0 : Ut.payment_status,
3923
- onFetchSource: M ? () => M(c, v) : void 0
3923
+ onFetchSource: L ? () => L(c, v) : void 0
3924
3924
  };
3925
3925
  return /* @__PURE__ */ h(K, { children: [
3926
3926
  a && /* @__PURE__ */ s(
@@ -3975,7 +3975,7 @@ const Gi = ({
3975
3975
  marginInlineEnd: 0,
3976
3976
  marginInlineStart: 0
3977
3977
  },
3978
- children: It ? /* @__PURE__ */ s(qe, { message: c, standalone: !0 }) : oi(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3978
+ children: It ? /* @__PURE__ */ s(qe, { message: c, standalone: !0 }) : li(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3979
3979
  ee && k && /* @__PURE__ */ s(k, {}),
3980
3980
  ee ? /* @__PURE__ */ s(
3981
3981
  De,
@@ -3993,24 +3993,24 @@ const Gi = ({
3993
3993
  }
3994
3994
  ),
3995
3995
  !ee && k && /* @__PURE__ */ s(k, {})
3996
- ] }) }) : li(c) ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
3996
+ ] }) }) : ci(c) ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
3997
3997
  /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3998
3998
  ee && k && /* @__PURE__ */ s(k, {}),
3999
3999
  ee ? /* @__PURE__ */ s(
4000
4000
  De,
4001
4001
  {
4002
- ...Mt,
4002
+ ...Lt,
4003
4003
  isMine: !0,
4004
4004
  onPreviewClick: () => y ? y(c, v) : void 0
4005
4005
  }
4006
4006
  ) : /* @__PURE__ */ s(
4007
4007
  De,
4008
4008
  {
4009
- ...Mt,
4009
+ ...Lt,
4010
4010
  isMine: !1,
4011
4011
  isUnlocking: w(c.id),
4012
4012
  onUnlockClick: () => y ? y(c, v) : void 0,
4013
- onDownloadClick: () => L ? L(c, v) : void 0
4013
+ onDownloadClick: () => M ? M(c, v) : void 0
4014
4014
  }
4015
4015
  ),
4016
4016
  !ee && k && /* @__PURE__ */ s(k, {})
@@ -4023,7 +4023,7 @@ const Gi = ({
4023
4023
  }
4024
4024
  ) })
4025
4025
  ] }) : Js ? /* @__PURE__ */ s(
4026
- Gi,
4026
+ Yi,
4027
4027
  {
4028
4028
  groupPosition: re,
4029
4029
  isMyMessage: ee,
@@ -4081,7 +4081,7 @@ const Gi = ({
4081
4081
  }
4082
4082
  ),
4083
4083
  n && ge && /* @__PURE__ */ s(
4084
- di,
4084
+ ui,
4085
4085
  {
4086
4086
  selected: D,
4087
4087
  onVoteUp: S,
@@ -4089,7 +4089,7 @@ const Gi = ({
4089
4089
  }
4090
4090
  )
4091
4091
  ] }),
4092
- /* @__PURE__ */ s(hi, {}),
4092
+ /* @__PURE__ */ s(fi, {}),
4093
4093
  ce && /* @__PURE__ */ s(
4094
4094
  J,
4095
4095
  {
@@ -4103,13 +4103,13 @@ const Gi = ({
4103
4103
  c.id
4104
4104
  )
4105
4105
  ] });
4106
- }, Wi = B.memo(
4107
- Yi,
4106
+ }, qi = B.memo(
4107
+ Wi,
4108
4108
  (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : on(e, t)
4109
- ), qi = (e) => {
4109
+ ), Xi = (e) => {
4110
4110
  const t = he("CustomMessage");
4111
- return /* @__PURE__ */ s(Wi, { ...t, ...e });
4112
- }, Xi = () => {
4111
+ return /* @__PURE__ */ s(qi, { ...t, ...e });
4112
+ }, Ki = () => {
4113
4113
  var n;
4114
4114
  const { handleDelete: e, message: t } = he("CustomMessageActions");
4115
4115
  return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
@@ -4122,7 +4122,7 @@ const Gi = ({
4122
4122
  children: /* @__PURE__ */ s(la, { size: 16, weight: "light", "aria-hidden": !0 })
4123
4123
  }
4124
4124
  );
4125
- }, Ki = () => {
4125
+ }, Zi = () => {
4126
4126
  const { handleFlag: e } = he("CustomMessageActions");
4127
4127
  return /* @__PURE__ */ s(
4128
4128
  hs,
@@ -4134,26 +4134,26 @@ const Gi = ({
4134
4134
  children: /* @__PURE__ */ s(cs, { size: 16, weight: "light", "aria-hidden": !0 })
4135
4135
  }
4136
4136
  );
4137
- }, Zi = () => {
4137
+ }, Ji = () => {
4138
4138
  var t;
4139
4139
  const { message: e } = he("CustomMessageActions");
4140
4140
  return ((t = e.metadata) == null ? void 0 : t.custom_type) !== oe.ATTACHMENT ? null : /* @__PURE__ */ s(
4141
- fa,
4141
+ pa,
4142
4142
  {
4143
4143
  messageActionSet: [
4144
- { Component: Xi, placement: "quick", type: "delete" },
4145
- { Component: Ki, placement: "quick", type: "flag" }
4144
+ { Component: Ki, placement: "quick", type: "delete" },
4145
+ { Component: Zi, placement: "quick", type: "flag" }
4146
4146
  ]
4147
4147
  }
4148
4148
  );
4149
- }, Ji = (e) => ({
4149
+ }, Qi = (e) => ({
4150
4150
  linkPreviews: Array.from(e.previews.values()).filter(
4151
4151
  (t) => Qe.previewIsLoaded(t) || Qe.previewIsLoading(t)
4152
4152
  )
4153
- }), Qi = () => {
4153
+ }), eo = () => {
4154
4154
  const { linkPreviewsManager: e } = kn(), { linkPreviews: t } = Sn(
4155
4155
  e.state,
4156
- Ji
4156
+ Qi
4157
4157
  ), n = (r) => {
4158
4158
  e.dismissPreview(r);
4159
4159
  };
@@ -4215,7 +4215,7 @@ const Gi = ({
4215
4215
  ) }, r.og_scrape_url);
4216
4216
  }) })
4217
4217
  ) : null;
4218
- }, $e = B.createContext(!1), eo = 200, Yo = () => Ce($e), to = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
4218
+ }, $e = B.createContext(!1), to = 200, Ho = () => Ce($e), so = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
4219
4219
  "button",
4220
4220
  {
4221
4221
  ...n,
@@ -4226,9 +4226,9 @@ const Gi = ({
4226
4226
  onClick: e,
4227
4227
  children: /* @__PURE__ */ s(ca, { weight: "bold", className: "size-4" })
4228
4228
  }
4229
- ), ns = () => {
4229
+ ), as = () => {
4230
4230
  const e = Ce($e), { handleSubmit: t } = En(), n = In(), a = e || !n, {
4231
- SendButton: r = to,
4231
+ SendButton: r = so,
4232
4232
  AttachmentPreviewList: i = Tn
4233
4233
  } = ls("CustomMessageInput");
4234
4234
  return (
@@ -4261,12 +4261,12 @@ const Gi = ({
4261
4261
  children: [
4262
4262
  /* @__PURE__ */ h("div", { className: "messaging-composer-previews empty:hidden flex min-h-0 flex-col gap-2 px-2 pt-2", children: [
4263
4263
  /* @__PURE__ */ s(An, {}),
4264
- /* @__PURE__ */ s(Qi, {}),
4264
+ /* @__PURE__ */ s(eo, {}),
4265
4265
  /* @__PURE__ */ s(i, {})
4266
4266
  ] }),
4267
4267
  /* @__PURE__ */ h("div", { className: "messaging-composer-row flex shrink-0 items-start", children: [
4268
4268
  /* @__PURE__ */ s(
4269
- Mn,
4269
+ Ln,
4270
4270
  {
4271
4271
  "aria-disabled": e || void 0,
4272
4272
  containerClassName: "min-w-0 flex-1 leading-[0]",
@@ -4294,7 +4294,7 @@ const Gi = ({
4294
4294
  }
4295
4295
  )
4296
4296
  );
4297
- }, as = ({
4297
+ }, rs = ({
4298
4298
  renderActions: e,
4299
4299
  renderHeader: t,
4300
4300
  renderFooter: n,
@@ -4316,7 +4316,7 @@ const Gi = ({
4316
4316
  c = b;
4317
4317
  const v = Array.from(
4318
4318
  g.querySelectorAll(".str-chat__list")
4319
- ).find((y) => y.scrollHeight > y.clientHeight) ?? null, w = v ? v.scrollHeight - v.scrollTop - v.clientHeight < eo : !1;
4319
+ ).find((y) => y.scrollHeight > y.clientHeight) ?? null, w = v ? v.scrollHeight - v.scrollTop - v.clientHeight < to : !1;
4320
4320
  g.style.setProperty(
4321
4321
  "--messaging-composer-height",
4322
4322
  `${b}px`
@@ -4378,7 +4378,7 @@ const Gi = ({
4378
4378
  className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
4379
4379
  children: [
4380
4380
  e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
4381
- /* @__PURE__ */ s($e.Provider, { value: o, children: /* @__PURE__ */ s(Ht, { Input: i ?? ns }) })
4381
+ /* @__PURE__ */ s($e.Provider, { value: o, children: /* @__PURE__ */ s(Ht, { Input: i ?? as }) })
4382
4382
  ]
4383
4383
  }
4384
4384
  ),
@@ -4397,47 +4397,42 @@ const Gi = ({
4397
4397
  className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
4398
4398
  children: [
4399
4399
  e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
4400
- /* @__PURE__ */ s($e.Provider, { value: o, children: /* @__PURE__ */ s(Ht, { Input: ns }) })
4400
+ /* @__PURE__ */ s($e.Provider, { value: o, children: /* @__PURE__ */ s(Ht, { Input: as }) })
4401
4401
  ]
4402
4402
  }
4403
4403
  ),
4404
4404
  n == null ? void 0 : n()
4405
4405
  ] });
4406
- }, so = [
4407
- "SYSTEM_DM_AGENT_PAUSED",
4408
- "SYSTEM_DM_AGENT_RESUMED"
4409
- ], no = {
4406
+ }, no = {
4410
4407
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
4411
4408
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
4412
- }, ao = [
4413
- "SYSTEM_AGE_SAFETY_BLOCKED"
4414
- ], ro = ["SYSTEM_AGE_SAFETY_BLOCKED"], io = {
4409
+ }, ao = ["SYSTEM_AGE_SAFETY_BLOCKED"], ro = {
4415
4410
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
4416
- }, Ze = "age safety guidelines.", oo = "https://linktr.ee/s/about/contact", rs = (e) => so.includes(e), lo = (e) => ao.includes(e), co = (e) => ro.includes(
4411
+ }, Ze = "age safety guidelines.", io = "https://linktr.ee/s/about/contact", oo = (e) => ao.includes(
4417
4412
  e
4418
- ), uo = (e) => {
4413
+ ), lo = (e) => {
4419
4414
  var t;
4420
- return co((t = e.metadata) == null ? void 0 : t.custom_type);
4421
- }, mo = (e) => {
4415
+ return oo((t = e.metadata) == null ? void 0 : t.custom_type);
4416
+ }, co = (e) => {
4422
4417
  var a;
4423
4418
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
4424
- if (rs(t))
4419
+ if (Wt(t))
4425
4420
  return {
4426
4421
  kind: "dm-agent",
4427
4422
  type: t
4428
4423
  };
4429
- if (lo(t))
4424
+ if (fa(t))
4430
4425
  return {
4431
4426
  kind: "age-safety",
4432
4427
  type: t
4433
4428
  };
4434
4429
  const n = e.dm_agent_system_type;
4435
- if (rs(n))
4430
+ if (Wt(n))
4436
4431
  return {
4437
4432
  kind: "dm-agent",
4438
4433
  type: n
4439
4434
  };
4440
- }, ho = (e) => {
4435
+ }, uo = (e) => {
4441
4436
  const t = e.indexOf(Ze);
4442
4437
  if (t === -1)
4443
4438
  return e;
@@ -4447,7 +4442,7 @@ const Gi = ({
4447
4442
  /* @__PURE__ */ s(
4448
4443
  "a",
4449
4444
  {
4450
- href: oo,
4445
+ href: io,
4451
4446
  target: "_blank",
4452
4447
  rel: "noopener noreferrer",
4453
4448
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
@@ -4456,9 +4451,9 @@ const Gi = ({
4456
4451
  ),
4457
4452
  e.slice(n)
4458
4453
  ] });
4459
- }, fo = (e) => {
4454
+ }, mo = (e) => {
4460
4455
  var a, r;
4461
- const t = !uo(e.message), n = mo(
4456
+ const t = !lo(e.message), n = co(
4462
4457
  e.message
4463
4458
  );
4464
4459
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
@@ -4488,7 +4483,7 @@ const Gi = ({
4488
4483
  ] });
4489
4484
  }
4490
4485
  if ((n == null ? void 0 : n.kind) === "age-safety") {
4491
- const i = ((r = e.message.text) == null ? void 0 : r.trim()) || io[n.type];
4486
+ const i = ((r = e.message.text) == null ? void 0 : r.trim()) || ro[n.type];
4492
4487
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
4493
4488
  /* @__PURE__ */ h(
4494
4489
  "div",
@@ -4507,7 +4502,7 @@ const Gi = ({
4507
4502
  "data-testid": "age-safety-system-message-icon"
4508
4503
  }
4509
4504
  ),
4510
- /* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: ho(i) }) })
4505
+ /* @__PURE__ */ s("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ s("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: uo(i) }) })
4511
4506
  ]
4512
4507
  }
4513
4508
  ),
@@ -4532,15 +4527,15 @@ const Gi = ({
4532
4527
  begin: `${120 * t}ms`,
4533
4528
  repeatCount: "indefinite"
4534
4529
  }
4535
- ) }), go = /* @__PURE__ */ new Set([
4530
+ ) }), ho = /* @__PURE__ */ new Set([
4536
4531
  Ge.Thinking,
4537
4532
  Ge.Generating,
4538
4533
  Ge.ExternalSources
4539
- ]), po = ({ threadList: e }) => {
4534
+ ]), fo = ({ threadList: e }) => {
4540
4535
  var x, _;
4541
- const { channel: t, channelConfig: n, thread: a } = me(), { client: r } = ke(), { typing: i = {} } = Ln(), { aiState: l } = Rn(t), o = Ce(Gs);
4542
- if (!e && o && go.has(l)) {
4543
- const b = bo(t, (x = r.user) == null ? void 0 : x.id);
4536
+ const { channel: t, channelConfig: n, thread: a } = me(), { client: r } = ke(), { typing: i = {} } = Mn(), { aiState: l } = Rn(t), o = Ce(Gs);
4537
+ if (!e && o && ho.has(l)) {
4538
+ const b = go(t, (x = r.user) == null ? void 0 : x.id);
4544
4539
  return /* @__PURE__ */ s(
4545
4540
  is,
4546
4541
  {
@@ -4620,7 +4615,7 @@ const Gi = ({
4620
4615
  ] })
4621
4616
  }
4622
4617
  );
4623
- function bo(e, t) {
4618
+ function go(e, t) {
4624
4619
  var a;
4625
4620
  const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
4626
4621
  for (const r of Object.values(n)) {
@@ -4629,7 +4624,7 @@ function bo(e, t) {
4629
4624
  return i;
4630
4625
  }
4631
4626
  }
4632
- const vo = () => null, xo = ({ className: e, message: t }) => /* @__PURE__ */ h(
4627
+ const po = () => null, bo = ({ className: e, message: t }) => /* @__PURE__ */ h(
4633
4628
  "div",
4634
4629
  {
4635
4630
  className: C("flex items-center justify-center h-full", e),
@@ -4673,11 +4668,11 @@ const vo = () => null, xo = ({ className: e, message: t }) => /* @__PURE__ */ h(
4673
4668
  ]
4674
4669
  }
4675
4670
  ), Ue = B.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
4676
- /* @__PURE__ */ s(xo, { className: "w-6 h-6" }),
4671
+ /* @__PURE__ */ s(bo, { className: "w-6 h-6" }),
4677
4672
  /* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
4678
4673
  ] }) }));
4679
4674
  Ue.displayName = "LoadingState";
4680
- const _o = ({
4675
+ const vo = ({
4681
4676
  onBack: e,
4682
4677
  showBackButton: t,
4683
4678
  renderMessageInputActions: n,
@@ -4699,20 +4694,20 @@ const _o = ({
4699
4694
  customChannelActions: v,
4700
4695
  renderChannelActions: w,
4701
4696
  renderMessage: y,
4702
- viewerLanguage: M,
4703
- showChannelInfo: L = !0,
4697
+ viewerLanguage: L,
4698
+ showChannelInfo: M = !0,
4704
4699
  onParticipantNameClick: O,
4705
4700
  composerInput: $
4706
4701
  }) => {
4707
4702
  const { channel: z } = me(), D = z.state.messages.some(
4708
4703
  (I) => I.type !== "deleted"
4709
4704
  ), S = p ? /* @__PURE__ */ s(B.Fragment, { children: p() }, "lt-channel-banner") : null, T = /* @__PURE__ */ s(
4710
- Ea,
4705
+ Ia,
4711
4706
  {
4712
4707
  className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
4713
4708
  onBack: e,
4714
4709
  showBackButton: t,
4715
- showChannelInfo: L,
4710
+ showChannelInfo: M,
4716
4711
  showStarButton: _,
4717
4712
  onLeaveConversation: i,
4718
4713
  onBlockParticipant: l,
@@ -4729,23 +4724,23 @@ const _o = ({
4729
4724
  ), E = q(
4730
4725
  (I) => {
4731
4726
  const { message: k } = he("ChannelView"), P = /* @__PURE__ */ s(
4732
- qi,
4727
+ Xi,
4733
4728
  {
4734
4729
  ...I,
4735
4730
  chatbotVotingEnabled: b,
4736
- viewerLanguage: M
4731
+ viewerLanguage: L
4737
4732
  }
4738
4733
  );
4739
4734
  return !y || !k ? P : y(P, k);
4740
4735
  },
4741
- [b, y, M]
4736
+ [b, y, L]
4742
4737
  );
4743
4738
  return /* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(
4744
4739
  Pn,
4745
4740
  {
4746
4741
  overrides: {
4747
4742
  Message: E,
4748
- MessageActions: Zi,
4743
+ MessageActions: Ji,
4749
4744
  UnreadMessagesNotification: () => null,
4750
4745
  UnreadMessagesSeparator: () => null
4751
4746
  },
@@ -4775,7 +4770,7 @@ const _o = ({
4775
4770
  "lt-channel-message-list"
4776
4771
  ),
4777
4772
  /* @__PURE__ */ s(
4778
- as,
4773
+ rs,
4779
4774
  {
4780
4775
  ...n && {
4781
4776
  renderActions: () => n == null ? void 0 : n(z)
@@ -4817,7 +4812,7 @@ const _o = ({
4817
4812
  ),
4818
4813
  r ? /* @__PURE__ */ s(B.Fragment, { children: r(z) }, "lt-channel-conversation-footer") : null,
4819
4814
  /* @__PURE__ */ s(
4820
- as,
4815
+ rs,
4821
4816
  {
4822
4817
  ...n && {
4823
4818
  renderActions: () => n == null ? void 0 : n(z)
@@ -4843,7 +4838,7 @@ const _o = ({
4843
4838
  onLeaveConversation: l,
4844
4839
  onBlockParticipant: o,
4845
4840
  className: d,
4846
- CustomChannelEmptyState: m = vo,
4841
+ CustomChannelEmptyState: m = po,
4847
4842
  showDeleteConversation: f = !0,
4848
4843
  onDeleteConversationClick: u,
4849
4844
  onBlockParticipantClick: g,
@@ -4855,8 +4850,8 @@ const _o = ({
4855
4850
  dmAgentEnabled: v,
4856
4851
  messageMetadata: w,
4857
4852
  onMessageSent: y,
4858
- showStarButton: M = !1,
4859
- chatbotVotingEnabled: L = !1,
4853
+ showStarButton: L = !1,
4854
+ chatbotVotingEnabled: M = !1,
4860
4855
  renderChannelBanner: O,
4861
4856
  customChannelActions: $,
4862
4857
  renderChannelActions: z,
@@ -4912,16 +4907,16 @@ const _o = ({
4912
4907
  Dn,
4913
4908
  {
4914
4909
  channel: e,
4915
- MessageSystem: fo,
4910
+ MessageSystem: mo,
4916
4911
  EmptyStateIndicator: m,
4917
4912
  LoadingIndicator: Ue,
4918
- DateSeparator: Ia,
4919
- TypingIndicator: po,
4913
+ DateSeparator: Ta,
4914
+ TypingIndicator: fo,
4920
4915
  doSendMessageRequest: W,
4921
4916
  ...T ? { SendButton: T } : {},
4922
4917
  ...E ? { AttachmentPreviewList: E } : {},
4923
4918
  children: /* @__PURE__ */ s(
4924
- _o,
4919
+ vo,
4925
4920
  {
4926
4921
  onBack: t,
4927
4922
  showBackButton: n,
@@ -4939,8 +4934,8 @@ const _o = ({
4939
4934
  showReportParticipant: _,
4940
4935
  composerDisabled: b,
4941
4936
  composerDisabledReason: p,
4942
- showStarButton: M,
4943
- chatbotVotingEnabled: L,
4937
+ showStarButton: L,
4938
+ chatbotVotingEnabled: M,
4944
4939
  renderChannelBanner: O,
4945
4940
  customChannelActions: $,
4946
4941
  renderChannelActions: z,
@@ -4973,7 +4968,7 @@ const Ne = B.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
4973
4968
  )
4974
4969
  ] }) }));
4975
4970
  Ne.displayName = "ErrorState";
4976
- const Wo = ({
4971
+ const Go = ({
4977
4972
  capabilities: e = {},
4978
4973
  renderMessageInputActions: t,
4979
4974
  renderConversationFooter: n,
@@ -4995,17 +4990,17 @@ const Wo = ({
4995
4990
  renderMessage: v,
4996
4991
  onMessageLinkClick: w,
4997
4992
  showChannelInfo: y,
4998
- composerInput: M
4993
+ composerInput: L
4999
4994
  }) => {
5000
4995
  const {
5001
- client: L,
4996
+ client: M,
5002
4997
  isConnected: O,
5003
4998
  isLoading: $,
5004
4999
  error: z,
5005
5000
  refreshConnection: D,
5006
5001
  service: S,
5007
5002
  debug: T
5008
- } = ga(), [E, I] = F(null), [k, P] = F(null), [G, W] = F(!1), { showDeleteConversation: Z = !0 } = e, J = H(l);
5003
+ } = ba(), [E, I] = F(null), [k, P] = F(null), [G, W] = F(!1), { showDeleteConversation: Z = !0 } = e, J = H(l);
5009
5004
  J.current = l;
5010
5005
  const j = H(a);
5011
5006
  j.current = a;
@@ -5013,8 +5008,8 @@ const Wo = ({
5013
5008
  Y(() => {
5014
5009
  A.current = E;
5015
5010
  }, [E]), Y(() => {
5016
- if (!L || !O) return;
5017
- const X = L.userID;
5011
+ if (!M || !O) return;
5012
+ const X = M.userID;
5018
5013
  if (!X) return;
5019
5014
  const V = `${X}::${i}`;
5020
5015
  if (N.current === V) return;
@@ -5023,13 +5018,13 @@ const Wo = ({
5023
5018
  N.current === V && (N.current = null);
5024
5019
  };
5025
5020
  (async () => {
5026
- var Me, Le;
5021
+ var Le, Me;
5027
5022
  try {
5028
5023
  T && console.log(
5029
5024
  "[MessagingShell] Loading initial conversation with:",
5030
5025
  i
5031
5026
  );
5032
- const re = await L.queryChannels(
5027
+ const re = await M.queryChannels(
5033
5028
  {
5034
5029
  type: "messaging",
5035
5030
  members: { $eq: [X, i] }
@@ -5038,7 +5033,7 @@ const Wo = ({
5038
5033
  { limit: 1 }
5039
5034
  );
5040
5035
  if (re.length > 0) {
5041
- I(re[0]), P(null), (Me = j.current) == null || Me.call(j, re[0]), T && console.log(
5036
+ I(re[0]), P(null), (Le = j.current) == null || Le.call(j, re[0]), T && console.log(
5042
5037
  "[MessagingShell] Initial conversation loaded:",
5043
5038
  re[0].id
5044
5039
  );
@@ -5058,7 +5053,7 @@ const Wo = ({
5058
5053
  name: ce.name,
5059
5054
  phone: ce.phone
5060
5055
  });
5061
- I(ie), P(null), (Le = j.current) == null || Le.call(j, ie), T && console.log(
5056
+ I(ie), P(null), (Me = j.current) == null || Me.call(j, ie), T && console.log(
5062
5057
  "[MessagingShell] Channel created and loaded:",
5063
5058
  ie.id
5064
5059
  );
@@ -5075,14 +5070,14 @@ const Wo = ({
5075
5070
  ), Q(), A.current || P("Failed to load conversation");
5076
5071
  }
5077
5072
  })();
5078
- }, [i, L, O, S, T]);
5073
+ }, [i, M, O, S, T]);
5079
5074
  const U = H(r);
5080
5075
  U.current = r;
5081
5076
  const te = q(() => {
5082
5077
  var X;
5083
5078
  I(null), W(!0), (X = U.current) == null || X.call(U);
5084
5079
  }, []);
5085
- return $ ? /* @__PURE__ */ s(Ue, {}) : z ? /* @__PURE__ */ s(Ne, { message: z, onBack: D }) : !O || !L ? /* @__PURE__ */ s(
5080
+ return $ ? /* @__PURE__ */ s(Ue, {}) : z ? /* @__PURE__ */ s(Ne, { message: z, onBack: D }) : !O || !M ? /* @__PURE__ */ s(
5086
5081
  Ne,
5087
5082
  {
5088
5083
  message: "Not connected to messaging service",
@@ -5111,12 +5106,12 @@ const Wo = ({
5111
5106
  renderMessage: v,
5112
5107
  onMessageLinkClick: w,
5113
5108
  showChannelInfo: y,
5114
- composerInput: M
5109
+ composerInput: L
5115
5110
  },
5116
5111
  E.id
5117
5112
  ) }) }) : /* @__PURE__ */ s(Ue, {});
5118
5113
  };
5119
- function wo(e) {
5114
+ function xo(e) {
5120
5115
  const t = e.state.pending_messages;
5121
5116
  if (t != null && t.length)
5122
5117
  for (const n of t)
@@ -5130,18 +5125,18 @@ const Ws = B.createContext({
5130
5125
  renderMessagePreview: void 0,
5131
5126
  channelPreview: void 0,
5132
5127
  viewerLanguage: void 0
5133
- }), No = Ws.Provider, yo = () => B.useContext(Ws), Co = (e, t) => {
5128
+ }), _o = Ws.Provider, wo = () => B.useContext(Ws), No = (e, t) => {
5134
5129
  const n = new Date(
5135
5130
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
5136
5131
  ), r = new Date(
5137
5132
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
5138
5133
  ).getTime() - n.getTime();
5139
5134
  return Math.floor(r / (1e3 * 60 * 60 * 24));
5140
- }, ko = (e) => {
5135
+ }, yo = (e) => {
5141
5136
  const t = /* @__PURE__ */ new Date();
5142
5137
  if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
5143
5138
  return "Just now";
5144
- const a = Co(e, t);
5139
+ const a = No(e, t);
5145
5140
  return a === 0 ? e.toLocaleTimeString([], {
5146
5141
  hour: "numeric",
5147
5142
  minute: "2-digit",
@@ -5161,7 +5156,7 @@ const Ws = B.createContext({
5161
5156
  channelPreview: l,
5162
5157
  renderMessagePreview: o,
5163
5158
  viewerLanguage: d
5164
- } = yo(), { client: m } = ke(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), u = gs(t);
5159
+ } = wo(), { client: m } = ke(), f = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), u = gs(t);
5165
5160
  if (l)
5166
5161
  return /* @__PURE__ */ s(
5167
5162
  l,
@@ -5208,7 +5203,7 @@ const Ws = B.createContext({
5208
5203
  if (S) return S;
5209
5204
  const I = (k = p == null ? void 0 : p.attachments) == null ? void 0 : k[0];
5210
5205
  return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
5211
- })(), y = p != null && p.created_at ? ko(new Date(p.created_at)) : "", M = p ? ze(p) : !1, L = o ? o(p, w) : `${M ? "✨ " : ""}${w}`, O = n ?? 0;
5206
+ })(), y = p != null && p.created_at ? yo(new Date(p.created_at)) : "", L = p ? ze(p) : !1, M = o ? o(p, w) : `${L ? "✨ " : ""}${w}`, O = n ?? 0;
5212
5207
  return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
5213
5208
  channelId: t == null ? void 0 : t.id,
5214
5209
  isSelected: f,
@@ -5258,7 +5253,7 @@ const Ws = B.createContext({
5258
5253
  y && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: y })
5259
5254
  ] }),
5260
5255
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
5261
- /* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: L }),
5256
+ /* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: M }),
5262
5257
  O > 0 && /* @__PURE__ */ s("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: O > 99 ? "99+" : O })
5263
5258
  ] })
5264
5259
  ] })
@@ -5268,14 +5263,14 @@ const Ws = B.createContext({
5268
5263
  }
5269
5264
  );
5270
5265
  qs.displayName = "CustomChannelPreview";
5271
- const So = { last_message_at: -1 }, Eo = B.memo(
5266
+ const Co = { last_message_at: -1 }, ko = B.memo(
5272
5267
  ({
5273
5268
  onChannelSelect: e,
5274
5269
  selectedChannel: t,
5275
5270
  filters: n,
5276
5271
  allowNewMessagesFromUnfilteredChannels: a = !1,
5277
5272
  channelRenderFilterFn: r,
5278
- sort: i = So,
5273
+ sort: i = Co,
5279
5274
  className: l,
5280
5275
  customEmptyStateIndicator: o,
5281
5276
  channelListPaginator: d = Fn,
@@ -5292,10 +5287,10 @@ const So = { last_message_at: -1 }, Eo = B.memo(
5292
5287
  const v = B.useRef(0);
5293
5288
  v.current++;
5294
5289
  const { debug: w = !1 } = ct(), y = B.useCallback(
5295
- (L) => {
5296
- for (const O of L)
5297
- wo(O);
5298
- return r ? r(L) : L;
5290
+ (M) => {
5291
+ for (const O of M)
5292
+ xo(O);
5293
+ return r ? r(M) : M;
5299
5294
  },
5300
5295
  [r]
5301
5296
  );
@@ -5304,7 +5299,7 @@ const So = { last_message_at: -1 }, Eo = B.memo(
5304
5299
  selectedChannelId: t == null ? void 0 : t.id,
5305
5300
  filters: n
5306
5301
  });
5307
- const M = B.useMemo(
5302
+ const L = B.useMemo(
5308
5303
  () => ({
5309
5304
  selectedChannel: t,
5310
5305
  onChannelSelect: e,
@@ -5329,7 +5324,7 @@ const So = { last_message_at: -1 }, Eo = B.memo(
5329
5324
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
5330
5325
  l
5331
5326
  ),
5332
- children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(No, { value: M, children: /* @__PURE__ */ s(
5327
+ children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(_o, { value: L, children: /* @__PURE__ */ s(
5333
5328
  zn,
5334
5329
  {
5335
5330
  filters: n,
@@ -5353,11 +5348,11 @@ const So = { last_message_at: -1 }, Eo = B.memo(
5353
5348
  );
5354
5349
  }
5355
5350
  );
5356
- Eo.displayName = "ChannelList";
5357
- const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, Io = {
5351
+ ko.displayName = "ChannelList";
5352
+ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, So = {
5358
5353
  sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
5359
5354
  received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
5360
- }, To = ({ variant: e }) => /* @__PURE__ */ s(
5355
+ }, Eo = ({ variant: e }) => /* @__PURE__ */ s(
5361
5356
  "span",
5362
5357
  {
5363
5358
  "aria-hidden": "true",
@@ -5367,12 +5362,12 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5367
5362
  insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
5368
5363
  transform: e === "received" ? "scaleX(-1)" : void 0,
5369
5364
  transformOrigin: "center",
5370
- backgroundColor: Io[e],
5365
+ backgroundColor: So[e],
5371
5366
  WebkitMask: os,
5372
5367
  mask: os
5373
5368
  }
5374
5369
  }
5375
- ), Ao = {
5370
+ ), Io = {
5376
5371
  sent: {
5377
5372
  backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
5378
5373
  color: "var(--str-chat__own-message-bubble-color, #fff)"
@@ -5397,17 +5392,17 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5397
5392
  r
5398
5393
  ),
5399
5394
  style: {
5400
- ...Ao[e],
5395
+ ...Io[e],
5401
5396
  borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
5402
5397
  isolation: "isolate"
5403
5398
  },
5404
5399
  children: [
5405
5400
  a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
5406
5401
  /* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
5407
- n && /* @__PURE__ */ s(To, { variant: e })
5402
+ n && /* @__PURE__ */ s(Eo, { variant: e })
5408
5403
  ]
5409
5404
  }
5410
- ), Mo = ({
5405
+ ), To = ({
5411
5406
  text: e,
5412
5407
  tail: t,
5413
5408
  header: n,
@@ -5421,10 +5416,10 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5421
5416
  header: n,
5422
5417
  className: a
5423
5418
  }
5424
- ), Lo = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Xs, { variant: "sent", text: e, tail: t, className: n }), qo = {
5425
- Sent: Lo,
5426
- Received: Mo
5427
- }, Ro = ({
5419
+ ), Ao = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Xs, { variant: "sent", text: e, tail: t, className: n }), Yo = {
5420
+ Sent: Ao,
5421
+ Received: To
5422
+ }, Lo = ({
5428
5423
  question: e,
5429
5424
  onClick: t,
5430
5425
  loading: n = !1,
@@ -5446,7 +5441,7 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5446
5441
  ),
5447
5442
  children: e
5448
5443
  }
5449
- ), Xo = ({
5444
+ ), Wo = ({
5450
5445
  faqs: e,
5451
5446
  onFaqClick: t,
5452
5447
  loadingFaqId: n,
@@ -5455,7 +5450,7 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5455
5450
  avatarImage: i,
5456
5451
  avatarName: l
5457
5452
  }) => {
5458
- const o = ha(e);
5453
+ const o = ga(e);
5459
5454
  return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
5460
5455
  (i || l) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
5461
5456
  xe,
@@ -5475,7 +5470,7 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5475
5470
  children: [
5476
5471
  a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
5477
5472
  o.map((d) => /* @__PURE__ */ s(
5478
- Ro,
5473
+ Lo,
5479
5474
  {
5480
5475
  question: d.question,
5481
5476
  onClick: () => t(d.id),
@@ -5491,40 +5486,40 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5491
5486
  export {
5492
5487
  ws as A,
5493
5488
  ht as B,
5494
- vo as C,
5489
+ po as C,
5495
5490
  bs as D,
5496
- Yo as E,
5497
- Xo as F,
5498
- ti as G,
5499
- Aa as H,
5500
- ga as I,
5491
+ Ho as E,
5492
+ Wo as F,
5493
+ si as G,
5494
+ La as H,
5495
+ ba as I,
5501
5496
  it as L,
5502
- Ho as M,
5497
+ Vo as M,
5503
5498
  _e as a,
5504
5499
  xe as b,
5505
- Eo as c,
5500
+ ko as c,
5506
5501
  Ys as d,
5507
- Go as e,
5508
- Ro as f,
5502
+ jo as e,
5503
+ Lo as f,
5509
5504
  le as g,
5510
5505
  De as h,
5511
5506
  we as i,
5512
- qo as j,
5513
- di as k,
5514
- jo as l,
5515
- Wo as m,
5516
- hr as n,
5507
+ Yo as j,
5508
+ ui as k,
5509
+ Uo as l,
5510
+ Go as m,
5511
+ fr as n,
5517
5512
  ue as o,
5518
- dr as p,
5519
- ko as q,
5513
+ ur as p,
5514
+ yo as q,
5520
5515
  ve as r,
5521
- mr as s,
5516
+ hr as s,
5522
5517
  xs as t,
5523
5518
  Cs as u,
5524
- va as v,
5525
- nr as w,
5519
+ xa as v,
5520
+ ar as w,
5526
5521
  Ma as x,
5527
5522
  ps as y,
5528
5523
  mt as z
5529
5524
  };
5530
- //# sourceMappingURL=index-DtD5bLEl.js.map
5525
+ //# sourceMappingURL=index-BuqmY6ae.js.map