@linktr.ee/messaging-react 3.15.2 → 3.16.0-rc-1785206933

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { jsx as s, jsxs as h, Fragment as ee } from "react/jsx-runtime";
2
- import j, { createContext as st, useContext as ye, useCallback as W, useState as F, useRef as G, useEffect as Y, useId as js, useMemo as se, Suspense as Vs } from "react";
3
- import { StreamChatService as Gs } from "@linktr.ee/messaging-core";
4
- import { StreamChat as Hs, LinkPreviewsManager as Ot } from "stream-chat";
5
- import { Chat as Ys, useChannelStateContext as ue, useChatContext as ke, DateSeparator as qs, MessageStatus as Ws, useMessageContext as pe, MessageErrorIcon as Ze, MessageText as Le, areMessageUIPropsEqual as Xs, useMessageReminder as Ks, useComponentContext as es, Attachment as Zs, EditMessageModal as Js, MessageBlocked as Qs, MessageBouncePrompt as en, MessageDeleted as tn, MessageIsThreadReplyInChannelButtonIndicator as sn, MessageRepliesCountButton as nn, ReminderNotification as an, StreamedMessageText as rn, messageHasAttachments as on, messageHasReactions as ln, isDateSeparatorMessage as cn, isMessageBlocked as dn, isMessageBounced as un, MessageBounceModal as mn, Poll as hn, useMessageComposer as fn, useStateStore as gn, MessageInput as Ft, useMessageInputContext as pn, useMessageComposerHasSendableData as bn, AttachmentPreviewList as vn, QuotedMessagePreview as xn, TextareaComposer as wn, MessageTimestamp as Ve, AIStates as Ge, useTypingContext as _n, useAIState as Nn, Channel as yn, WithComponents as kn, Window as Cn, MessageList as Bt, ChannelList as Sn, InfiniteScroll as En } from "stream-chat-react";
1
+ import { jsx as s, jsxs as h, Fragment as K } from "react/jsx-runtime";
2
+ import j, { createContext as st, useContext as ye, useCallback as q, useState as F, useRef as G, useEffect as Y, useId as Vs, useMemo as se, Suspense as Gs } from "react";
3
+ import { StreamChatService as Hs } from "@linktr.ee/messaging-core";
4
+ import { StreamChat as Ys, LinkPreviewsManager as Ot } from "stream-chat";
5
+ import { Chat as Ws, useChannelStateContext as ue, useChatContext as ke, DateSeparator as qs, useMessageContext as me, MessageStatus as Xs, MessageErrorIcon as Ze, MessageText as Le, areMessageUIPropsEqual as Ks, useMessageReminder as Zs, useComponentContext as es, Attachment as Js, EditMessageModal as Qs, MessageBlocked as en, MessageBouncePrompt as tn, MessageDeleted as sn, MessageIsThreadReplyInChannelButtonIndicator as nn, MessageRepliesCountButton as an, ReminderNotification as rn, StreamedMessageText as on, messageHasAttachments as ln, messageHasReactions as cn, isDateSeparatorMessage as dn, isMessageBlocked as un, isMessageBounced as mn, MessageBounceModal as hn, Poll as fn, useMessageComposer as gn, useStateStore as pn, MessageInput as Ft, useMessageInputContext as bn, useMessageComposerHasSendableData as vn, AttachmentPreviewList as xn, QuotedMessagePreview as wn, TextareaComposer as _n, MessageTimestamp as Ve, AIStates as Ge, useTypingContext as Nn, useAIState as yn, Channel as kn, WithComponents as Cn, Window as Sn, MessageList as Bt, ChannelList as En, InfiniteScroll as In } from "stream-chat-react";
6
6
  import N from "classnames";
7
- import { StarIcon as Je, DotsThreeIcon as In, SpinnerGapIcon as Ae, SignOutIcon as Tn, ProhibitInsetIcon as $t, FlagIcon as ts, CurrencyDollarIcon as Mn, CaretRightIcon as ss, ArrowLeftIcon as An, FileIcon as ns, ImageIcon as Rn, SpeakerHighIcon as Ln, VideoCameraIcon as as, FileMdIcon as Dn, FileTextIcon as Pn, FileZipIcon as zn, FilePptIcon as On, FileCsvIcon as Fn, FileXlsIcon as Bn, FileDocIcon as $n, FilePdfIcon as Un, CircleNotchIcon as _e, PlayIcon as Qe, PauseIcon as jn, LinkIcon as Vn, DownloadSimpleIcon as Ne, XIcon as Be, CaretLeftIcon as Gn, GiftIcon as Hn, ThumbsUpIcon as Yn, ThumbsDownIcon as qn, ChecksIcon as Wn, PencilSimpleIcon as Xn, TrashSimpleIcon as Kn, ArrowUpIcon as Zn, SparkleIcon as Jn, ProhibitIcon as Qn } from "@phosphor-icons/react";
8
- import { MessageActions as ea, DefaultDropdownActionButton as rs } from "stream-chat-react/experimental";
7
+ import { StarIcon as Je, DotsThreeIcon as Tn, SpinnerGapIcon as Ae, SignOutIcon as Mn, ProhibitInsetIcon as $t, FlagIcon as ts, CurrencyDollarIcon as An, CaretRightIcon as ss, ArrowLeftIcon as Rn, FileIcon as ns, ImageIcon as Ln, SpeakerHighIcon as Dn, VideoCameraIcon as as, FileMdIcon as Pn, FileTextIcon as zn, FileZipIcon as On, FilePptIcon as Fn, FileCsvIcon as Bn, FileXlsIcon as $n, FileDocIcon as Un, FilePdfIcon as jn, CircleNotchIcon as pe, PlayIcon as Qe, PauseIcon as Vn, LinkIcon as Gn, DownloadSimpleIcon as Ne, XIcon as Be, CaretLeftIcon as Hn, GiftIcon as Yn, ThumbsUpIcon as Wn, ThumbsDownIcon as qn, WarningCircleIcon as Xn, ChecksIcon as Kn, PencilSimpleIcon as Zn, TrashSimpleIcon as Jn, ArrowUpIcon as Qn, SparkleIcon as ea, ProhibitIcon as ta } from "@phosphor-icons/react";
8
+ import { MessageActions as sa, DefaultDropdownActionButton as rs } from "stream-chat-react/experimental";
9
9
  const is = st({
10
10
  service: null,
11
11
  client: null,
@@ -16,7 +16,7 @@ const is = st({
16
16
  refreshConnection: async () => {
17
17
  },
18
18
  debug: !1
19
- }), nt = () => ye(is), ho = ({
19
+ }), nt = () => ye(is), po = ({
20
20
  children: e,
21
21
  user: t,
22
22
  serviceConfig: n,
@@ -26,7 +26,7 @@ const is = st({
26
26
  client: l
27
27
  }) => {
28
28
  var S, I;
29
- const o = W(
29
+ const o = q(
30
30
  (y, ...D) => {
31
31
  i && console.log(`🔥 [MessagingProvider] ${y}`, ...D);
32
32
  },
@@ -64,7 +64,7 @@ const is = st({
64
64
  capabilities: r
65
65
  };
66
66
  const B = G(null);
67
- !l && a && ((S = B.current) == null ? void 0 : S.apiKey) !== a && (B.current = { apiKey: a, client: new Hs(a) });
67
+ !l && a && ((S = B.current) == null ? void 0 : S.apiKey) !== a && (B.current = { apiKey: a, client: new Ys(a) });
68
68
  const O = l || (a ? ((I = B.current) == null ? void 0 : I.client) ?? null : null);
69
69
  Y(() => {
70
70
  const y = z.current, D = k.current;
@@ -83,7 +83,7 @@ const is = st({
83
83
  renderCount: y,
84
84
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
85
85
  });
86
- const H = new Gs({
86
+ const H = new Hs({
87
87
  ...D,
88
88
  apiKey: a,
89
89
  debug: R.current,
@@ -125,16 +125,16 @@ const is = st({
125
125
  o("🚀 STARTING USER CONNECTION", { userId: t.id }), w.current = !0, x(!0), b(null);
126
126
  try {
127
127
  o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
128
- const q = await d.connectUser(t);
129
- m(q), c(!0), L.current = { serviceId: d, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
128
+ const W = await d.connectUser(t);
129
+ m(W), c(!0), L.current = { serviceId: d, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
130
130
  userId: t.id,
131
- clientId: q.userID
131
+ clientId: W.userID
132
132
  });
133
- } catch (q) {
134
- const K = q instanceof Error ? q.message : "Connection failed";
135
- b(K), o("❌ USER CONNECTION ERROR", {
133
+ } catch (W) {
134
+ const Z = W instanceof Error ? W.message : "Connection failed";
135
+ b(Z), o("❌ USER CONNECTION ERROR", {
136
136
  userId: t.id,
137
- error: K
137
+ error: Z
138
138
  });
139
139
  } finally {
140
140
  x(!1), w.current = !1, o("🔄 USER CONNECTION FINISHED", {
@@ -150,7 +150,7 @@ const is = st({
150
150
  y && (L.current = null, (D = E.current) == null || D.disconnectUser().catch(console.error));
151
151
  };
152
152
  }, [O]);
153
- const C = W(async () => {
153
+ const C = q(async () => {
154
154
  if (o("🔄 REFRESH CONNECTION CALLED", {
155
155
  hasService: !!d,
156
156
  hasUser: !!t
@@ -215,7 +215,7 @@ const is = st({
215
215
  willRenderChat: !!O,
216
216
  contextValueReady: !!T
217
217
  }), /* @__PURE__ */ s(is.Provider, { value: T, children: O ? /* @__PURE__ */ s(
218
- Ys,
218
+ Ws,
219
219
  {
220
220
  client: O,
221
221
  customClasses: {
@@ -224,7 +224,7 @@ const is = st({
224
224
  children: e
225
225
  }
226
226
  ) : e });
227
- }, ta = () => nt(), os = (e) => {
227
+ }, na = () => nt(), os = (e) => {
228
228
  var a, r;
229
229
  const [t, n] = F(
230
230
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
@@ -246,14 +246,14 @@ const is = st({
246
246
  e.off("member.updated", i);
247
247
  };
248
248
  }, [e]), t;
249
- }, sa = "linktree-official", na = "linktree-official-sender";
249
+ }, aa = "linktree-official", ra = "linktree-official-sender";
250
250
  function ls(e, t, n) {
251
251
  const a = Object.values(e || {});
252
- if (n === sa) {
252
+ if (n === aa) {
253
253
  const r = a.find(
254
254
  (i) => {
255
255
  var l;
256
- return ((l = i.user) == null ? void 0 : l.id) === na;
256
+ return ((l = i.user) == null ? void 0 : l.id) === ra;
257
257
  }
258
258
  );
259
259
  if (r) return r;
@@ -265,13 +265,13 @@ function ls(e, t, n) {
265
265
  }
266
266
  );
267
267
  }
268
- const aa = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
269
- function ra(e) {
270
- return aa.test(e.trim());
268
+ const ia = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
269
+ function oa(e) {
270
+ return ia.test(e.trim());
271
271
  }
272
272
  function Ut(e, t) {
273
273
  const n = e == null ? void 0 : e.trim();
274
- return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !ra(n);
274
+ return !n || t && n === t || t && n === `Follower ${t}` ? !1 : !oa(n);
275
275
  }
276
276
  function cs(e) {
277
277
  return Ut(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Ut(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
@@ -304,7 +304,7 @@ const jt = [
304
304
  { emoji: "🍈", bgColor: "#D9F7E1" }
305
305
  // Melon
306
306
  ];
307
- function ia(e) {
307
+ function la(e) {
308
308
  let t = 0;
309
309
  for (let n = 0; n < e.length; n++) {
310
310
  const a = e.charCodeAt(n);
@@ -313,15 +313,15 @@ function ia(e) {
313
313
  return Math.abs(t);
314
314
  }
315
315
  function ds(e) {
316
- return jt[ia(e) % jt.length];
316
+ return jt[la(e) % jt.length];
317
317
  }
318
- function oa(e) {
318
+ function ca(e) {
319
319
  return ds(e).emoji;
320
320
  }
321
- function la(e) {
321
+ function da(e) {
322
322
  return ds(e).bgColor;
323
323
  }
324
- const be = ({
324
+ const ve = ({
325
325
  id: e,
326
326
  image: t,
327
327
  size: n = 40,
@@ -330,7 +330,7 @@ const be = ({
330
330
  shape: i = "squircle",
331
331
  dmAgentEnabled: l = !1
332
332
  }) => {
333
- const o = oa(e), d = la(e), u = 0.45, m = n < 32 ? Math.round(n * u) : n < 56 ? 14 : n < 120 ? 18 : 36, f = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
333
+ const o = ca(e), d = da(e), u = 0.45, m = n < 32 ? Math.round(n * u) : n < 56 ? 14 : n < 120 ? 18 : 36, f = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, v = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
334
334
  "img",
335
335
  {
336
336
  src: t,
@@ -394,7 +394,7 @@ const be = ({
394
394
  ]
395
395
  }
396
396
  );
397
- }, ca = "https://linktr.ee/s/about/trust-center/report", da = ({
397
+ }, ua = "https://linktr.ee/s/about/trust-center/report", ma = ({
398
398
  channel: e,
399
399
  participant: t,
400
400
  showBlockParticipant: n = !0,
@@ -478,10 +478,10 @@ const be = ({
478
478
  }
479
479
  },
480
480
  handleReportUser: () => {
481
- d == null || d(), u == null || u(), window.open(ca, "_blank", "noopener,noreferrer");
481
+ d == null || d(), u == null || u(), window.open(ua, "_blank", "noopener,noreferrer");
482
482
  }
483
483
  };
484
- }, ve = ({
484
+ }, xe = ({
485
485
  variant: e = "default",
486
486
  className: t,
487
487
  children: n,
@@ -498,7 +498,7 @@ const be = ({
498
498
  ...a,
499
499
  children: n
500
500
  }
501
- ), ua = ({
501
+ ), ha = ({
502
502
  channel: e,
503
503
  participant: t,
504
504
  showDeleteConversation: n = !0,
@@ -512,7 +512,7 @@ const be = ({
512
512
  customChannelActions: g,
513
513
  triggerClassName: m
514
514
  }) => {
515
- const [f, c] = F(!1), v = G(null), x = js(), p = W(() => c(!1), []), {
515
+ const [f, c] = F(!1), v = G(null), x = Vs(), p = q(() => c(!1), []), {
516
516
  isParticipantBlocked: b,
517
517
  isCheckingBlockedStatus: w,
518
518
  isLeaving: E,
@@ -521,7 +521,7 @@ const be = ({
521
521
  handleBlockUser: A,
522
522
  handleUnblockUser: z,
523
523
  handleReportUser: B
524
- } = da({
524
+ } = ma({
525
525
  channel: e,
526
526
  participant: t,
527
527
  showBlockParticipant: a,
@@ -555,7 +555,7 @@ const be = ({
555
555
  "aria-controls": f ? x : void 0,
556
556
  onClick: () => c((L) => !L),
557
557
  children: [
558
- /* @__PURE__ */ s(In, { className: "size-5 text-black/90" }),
558
+ /* @__PURE__ */ s(Tn, { className: "size-5 text-black/90" }),
559
559
  /* @__PURE__ */ s("span", { className: "sr-only", children: "More options" })
560
560
  ]
561
561
  }
@@ -571,13 +571,13 @@ const be = ({
571
571
  ),
572
572
  children: /* @__PURE__ */ h("ul", { className: "flex flex-col gap-1", children: [
573
573
  n && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(
574
- ve,
574
+ xe,
575
575
  {
576
576
  onClick: R,
577
577
  disabled: E,
578
578
  "aria-busy": E,
579
579
  children: [
580
- E ? /* @__PURE__ */ s(Ae, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Tn, { className: "h-5 w-5" }),
580
+ E ? /* @__PURE__ */ s(Ae, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Mn, { className: "h-5 w-5" }),
581
581
  /* @__PURE__ */ s("span", { children: "Delete Conversation" })
582
582
  ]
583
583
  }
@@ -585,12 +585,12 @@ const be = ({
585
585
  a && /* @__PURE__ */ s("li", { children: w ? (
586
586
  // Block status not yet resolved — show a disabled placeholder
587
587
  // so a premature click can't act on a stale block state.
588
- /* @__PURE__ */ h(ve, { disabled: !0, "aria-busy": !0, children: [
588
+ /* @__PURE__ */ h(xe, { disabled: !0, "aria-busy": !0, children: [
589
589
  /* @__PURE__ */ s(Ae, { className: "h-5 w-5 animate-spin" }),
590
590
  /* @__PURE__ */ s("span", { children: "Block" })
591
591
  ] })
592
592
  ) : b ? /* @__PURE__ */ h(
593
- ve,
593
+ xe,
594
594
  {
595
595
  onClick: z,
596
596
  disabled: k,
@@ -601,7 +601,7 @@ const be = ({
601
601
  ]
602
602
  }
603
603
  ) : /* @__PURE__ */ h(
604
- ve,
604
+ xe,
605
605
  {
606
606
  onClick: A,
607
607
  disabled: k,
@@ -612,7 +612,7 @@ const be = ({
612
612
  ]
613
613
  }
614
614
  ) }),
615
- r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(ve, { variant: "danger", onClick: B, children: [
615
+ r && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ h(xe, { variant: "danger", onClick: B, children: [
616
616
  /* @__PURE__ */ s(ts, { className: "h-5 w-5" }),
617
617
  /* @__PURE__ */ s("span", { children: "Report" })
618
618
  ] }) }),
@@ -621,7 +621,7 @@ const be = ({
621
621
  }
622
622
  )
623
623
  ] });
624
- }, He = "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", ma = "CUSTOMER_PAID", ha = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === ma, fa = ({
624
+ }, He = "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", fa = "CUSTOMER_PAID", ga = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === fa, pa = ({
625
625
  className: e,
626
626
  onBack: t,
627
627
  showBackButton: n,
@@ -650,7 +650,7 @@ const be = ({
650
650
  );
651
651
  },
652
652
  [(C = p.state) == null ? void 0 : C.members, b == null ? void 0 : b.userID, p.type]
653
- ), E = cs(w == null ? void 0 : w.user), k = (T = w == null ? void 0 : w.user) == null ? void 0 : T.image, R = os(p), A = ha((S = p.data) == null ? void 0 : S.customer_tag) && (w == null ? void 0 : w.is_follower) === !0, z = a && R, B = A || z || !!x, O = async () => {
653
+ ), E = cs(w == null ? void 0 : w.user), k = (T = w == null ? void 0 : w.user) == null ? void 0 : T.image, R = os(p), A = ga((S = p.data) == null ? void 0 : S.customer_tag) && (w == null ? void 0 : w.is_follower) === !0, z = a && R, B = A || z || !!x, O = async () => {
654
654
  try {
655
655
  R ? await p.unpin() : await p.pin();
656
656
  } catch (y) {
@@ -659,9 +659,9 @@ const be = ({
659
659
  y
660
660
  );
661
661
  }
662
- }, L = /* @__PURE__ */ h(ee, { children: [
662
+ }, L = /* @__PURE__ */ h(K, { children: [
663
663
  /* @__PURE__ */ s(
664
- be,
664
+ ve,
665
665
  {
666
666
  id: ((I = w == null ? void 0 : w.user) == null ? void 0 : I.id) || p.id || "unknown",
667
667
  name: E,
@@ -686,7 +686,7 @@ const be = ({
686
686
  {
687
687
  "aria-label": "Paid customer",
688
688
  className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
689
- children: /* @__PURE__ */ s(Mn, { className: "size-2.5", weight: "bold" })
689
+ children: /* @__PURE__ */ s(An, { className: "size-2.5", weight: "bold" })
690
690
  }
691
691
  ),
692
692
  z && /* @__PURE__ */ s(
@@ -729,7 +729,7 @@ const be = ({
729
729
  }),
730
730
  type: "button",
731
731
  "aria-label": "Back to conversations",
732
- children: /* @__PURE__ */ s(An, { className: "size-5 text-black/90" })
732
+ children: /* @__PURE__ */ s(Rn, { className: "size-5 text-black/90" })
733
733
  }
734
734
  ) }),
735
735
  /* @__PURE__ */ s("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: x ? /* @__PURE__ */ s(
@@ -764,7 +764,7 @@ const be = ({
764
764
  }
765
765
  ),
766
766
  v && (c !== void 0 ? c : /* @__PURE__ */ s(
767
- ua,
767
+ ha,
768
768
  {
769
769
  channel: p,
770
770
  participant: w,
@@ -784,15 +784,15 @@ const be = ({
784
784
  ] })
785
785
  }
786
786
  );
787
- }, ga = (e) => /* @__PURE__ */ s(qs, { ...e, position: "center" }), et = "vote_up", tt = "vote_down";
788
- function pa(e) {
787
+ }, ba = (e) => /* @__PURE__ */ s(qs, { ...e, position: "center" }), et = "vote_up", tt = "vote_down";
788
+ function va(e) {
789
789
  return e != null && e.length ? e.some((t) => t.type === tt) ? "down" : e.some((t) => t.type === et) ? "up" : null : null;
790
790
  }
791
- function ba(e) {
791
+ function xa(e) {
792
792
  const { channel: t } = ue(), { client: n } = ke("useMessageVote"), a = se(
793
- () => pa(e.own_reactions),
793
+ () => va(e.own_reactions),
794
794
  [e.own_reactions]
795
- ), r = W(async () => {
795
+ ), r = q(async () => {
796
796
  if (n != null && n.userID)
797
797
  try {
798
798
  a === "up" ? await t.deleteReaction(e.id, et) : await t.sendReaction(
@@ -802,7 +802,7 @@ function ba(e) {
802
802
  );
803
803
  } catch {
804
804
  }
805
- }, [t, n == null ? void 0 : n.userID, e.id, a]), i = W(async () => {
805
+ }, [t, n == null ? void 0 : n.userID, e.id, a]), i = q(async () => {
806
806
  if (n != null && n.userID)
807
807
  try {
808
808
  a === "down" ? await t.deleteReaction(e.id, tt) : await t.sendReaction(
@@ -815,7 +815,7 @@ function ba(e) {
815
815
  }, [t, n == null ? void 0 : n.userID, e.id, a]);
816
816
  return { selected: a, voteUp: r, voteDown: i };
817
817
  }
818
- function va(e) {
818
+ function wa(e) {
819
819
  return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
820
820
  }
821
821
  function us({
@@ -823,31 +823,31 @@ function us({
823
823
  viewerLanguage: t
824
824
  }) {
825
825
  var r;
826
- const n = e == null ? void 0 : e.text, a = va(t);
826
+ const n = e == null ? void 0 : e.text, a = wa(t);
827
827
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
828
828
  }
829
- const xa = ["linktr.ee"], Vt = "messaging-attachment-v1_0";
830
- function wa(e) {
829
+ const _a = ["linktr.ee"], Vt = "messaging-attachment-v1_0";
830
+ function Na(e) {
831
831
  try {
832
832
  return new URL(e).hostname.toLowerCase();
833
833
  } catch {
834
834
  return null;
835
835
  }
836
836
  }
837
- function _a(e) {
838
- return xa.some(
837
+ function ya(e) {
838
+ return _a.some(
839
839
  (t) => e === t || e.endsWith(`.${t}`)
840
840
  );
841
841
  }
842
842
  function de(e) {
843
843
  const t = e == null ? void 0 : e.trim();
844
844
  if (!t) return;
845
- const n = wa(t);
846
- if (!n || !_a(n)) return t;
845
+ const n = Na(t);
846
+ if (!n || !ya(n)) return t;
847
847
  const a = new URL(t);
848
848
  return a.searchParams.get("io") === "true" && a.searchParams.get("size") === Vt ? t : (a.searchParams.set("io", "true"), a.searchParams.set("size", Vt), a.toString());
849
849
  }
850
- const Na = [
850
+ const ka = [
851
851
  [/pdf/, "pdf"],
852
852
  [/wordprocessingml|msword|\.doc/, "doc"],
853
853
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -861,38 +861,38 @@ function oe(e) {
861
861
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
862
862
  }
863
863
  function ms(e) {
864
- const t = Na.find(
864
+ const t = ka.find(
865
865
  ([n]) => n.test(e)
866
866
  );
867
867
  return t ? t[1] : "generic";
868
868
  }
869
- const ya = {
869
+ const Ca = {
870
870
  video: as,
871
- audio: Ln,
872
- image: Rn,
871
+ audio: Dn,
872
+ image: Ln,
873
873
  document: ns
874
- }, ka = {
875
- pdf: Un,
876
- doc: $n,
877
- xls: Bn,
878
- csv: Fn,
879
- ppt: On,
880
- zip: zn,
881
- text: Pn,
882
- markdown: Dn,
874
+ }, Sa = {
875
+ pdf: jn,
876
+ doc: Un,
877
+ xls: $n,
878
+ csv: Bn,
879
+ ppt: Fn,
880
+ zip: On,
881
+ text: zn,
882
+ markdown: Pn,
883
883
  generic: ns
884
884
  };
885
- function Ca(e) {
885
+ function Ea(e) {
886
886
  const t = oe(e);
887
- return t !== "document" ? ya[t] : ka[ms(e)];
887
+ return t !== "document" ? Ca[t] : Sa[ms(e)];
888
888
  }
889
- function ge(e, t) {
890
- return j.createElement(Ca(e), t);
889
+ function be(e, t) {
890
+ return j.createElement(Ea(e), t);
891
891
  }
892
- const Sa = (e) => {
892
+ const Ia = (e) => {
893
893
  var t, n;
894
894
  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;
895
- }, Ea = ({
895
+ }, Ta = ({
896
896
  source: e,
897
897
  mimeType: t,
898
898
  poster: n,
@@ -904,20 +904,20 @@ const Sa = (e) => {
904
904
  muted: d = !1,
905
905
  onContainerClick: u
906
906
  }) => {
907
- const g = oe(t), m = G(null), f = G(null), c = G(null), v = G(r), [x, p] = F(a), [b, w] = F(0), [E, k] = F(!1), [R, A] = F(!1), [z, B] = F(!1), [O, L] = F(!1), [C, T] = F(!0), [S, I] = F(null), y = W(() => {
907
+ const g = oe(t), m = G(null), f = G(null), c = G(null), v = G(r), [x, p] = F(a), [b, w] = F(0), [E, k] = F(!1), [R, A] = F(!1), [z, B] = F(!1), [O, L] = F(!1), [C, T] = F(!0), [S, I] = F(null), y = q(() => {
908
908
  B(!1), p(!0);
909
- }, []), D = W((_) => {
909
+ }, []), D = q((_) => {
910
910
  const M = f.current;
911
911
  if (!M) return 0;
912
912
  const $ = M.getBoundingClientRect();
913
913
  return Math.max(
914
914
  0,
915
- Math.min(1, (Sa(_) - $.left) / $.width)
915
+ Math.min(1, (Ia(_) - $.left) / $.width)
916
916
  );
917
- }, []), H = W((_) => {
917
+ }, []), H = q((_) => {
918
918
  const M = m.current;
919
919
  M && M.duration && (M.currentTime = _ * M.duration);
920
- }, []), q = (_) => {
920
+ }, []), W = (_) => {
921
921
  _.stopPropagation(), k(!0);
922
922
  const M = D(_);
923
923
  w(M), H(M);
@@ -950,14 +950,14 @@ const Sa = (e) => {
950
950
  window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", M), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", M);
951
951
  };
952
952
  }, [E, D, H]);
953
- const K = S ? { aspectRatio: String(S) } : void 0, Z = S ? "" : " aspect-video", V = Math.round(b * 100);
953
+ const Z = S ? { aspectRatio: String(S) } : void 0, J = S ? "" : " aspect-video", V = Math.round(b * 100);
954
954
  return /* @__PURE__ */ h(
955
955
  "div",
956
956
  {
957
957
  role: "button",
958
958
  tabIndex: 0,
959
- className: `relative cursor-pointer overflow-hidden bg-black ${Z}`,
960
- style: K,
959
+ className: `relative cursor-pointer overflow-hidden bg-black ${J}`,
960
+ style: Z,
961
961
  onClick: (_) => {
962
962
  if (u) {
963
963
  u(_);
@@ -983,7 +983,7 @@ const Sa = (e) => {
983
983
  className: "absolute inset-0 h-full w-full object-cover"
984
984
  }
985
985
  ),
986
- !n && (g === "audio" || C) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: ge(t, {
986
+ !n && (g === "audio" || C) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: be(t, {
987
987
  className: "size-12 text-black/20",
988
988
  weight: "regular"
989
989
  }) }),
@@ -1032,7 +1032,7 @@ const Sa = (e) => {
1032
1032
  }
1033
1033
  ) }),
1034
1034
  O && !z && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ s(
1035
- _e,
1035
+ pe,
1036
1036
  {
1037
1037
  className: "size-8 animate-spin text-white/80",
1038
1038
  weight: "bold"
@@ -1065,8 +1065,8 @@ const Sa = (e) => {
1065
1065
  tabIndex: 0,
1066
1066
  ref: f,
1067
1067
  className: "relative flex h-4 w-full cursor-pointer items-center",
1068
- onMouseDown: q,
1069
- onTouchStart: q,
1068
+ onMouseDown: W,
1069
+ onTouchStart: W,
1070
1070
  onClick: (_) => _.stopPropagation(),
1071
1071
  onKeyDown: (_) => {
1072
1072
  _.key === "ArrowRight" && H(Math.min(1, b + 0.05)), _.key === "ArrowLeft" && H(Math.max(0, b - 0.05));
@@ -1090,7 +1090,7 @@ const Sa = (e) => {
1090
1090
  },
1091
1091
  className: "shrink-0 text-white",
1092
1092
  "aria-label": x ? "Pause" : "Play",
1093
- children: x ? /* @__PURE__ */ s(jn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(Qe, { className: "size-5 translate-x-px", weight: "fill" })
1093
+ children: x ? /* @__PURE__ */ s(Vn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(Qe, { className: "size-5 translate-x-px", weight: "fill" })
1094
1094
  }
1095
1095
  ),
1096
1096
  /* @__PURE__ */ h(
@@ -1104,8 +1104,8 @@ const Sa = (e) => {
1104
1104
  tabIndex: 0,
1105
1105
  ref: f,
1106
1106
  className: "relative flex h-4 w-full cursor-pointer items-center",
1107
- onMouseDown: q,
1108
- onTouchStart: q,
1107
+ onMouseDown: W,
1108
+ onTouchStart: W,
1109
1109
  onClick: (_) => _.stopPropagation(),
1110
1110
  onMouseEnter: () => A(!0),
1111
1111
  onMouseLeave: () => A(!1),
@@ -1140,7 +1140,7 @@ const Sa = (e) => {
1140
1140
  ]
1141
1141
  }
1142
1142
  );
1143
- }, Gt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ia = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", hs = ({
1143
+ }, Gt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Ma = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", hs = ({
1144
1144
  mimeType: e,
1145
1145
  sourceUrl: t,
1146
1146
  thumbnailUrl: n,
@@ -1151,7 +1151,7 @@ const Sa = (e) => {
1151
1151
  }) => {
1152
1152
  const o = oe(e), [d, u] = F(!1), g = de(t), m = de(n);
1153
1153
  return t && (o === "video" || o === "audio") ? /* @__PURE__ */ s(
1154
- Ea,
1154
+ Ta,
1155
1155
  {
1156
1156
  source: t,
1157
1157
  mimeType: e,
@@ -1197,12 +1197,12 @@ const Sa = (e) => {
1197
1197
  "div",
1198
1198
  {
1199
1199
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1200
- children: ge(e, {
1200
+ children: be(e, {
1201
1201
  className: Gt(r),
1202
1202
  weight: "regular"
1203
1203
  })
1204
1204
  }
1205
- ) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ia(r)}`, children: /* @__PURE__ */ s(
1205
+ ) : n ? /* @__PURE__ */ s("div", { className: `relative ${Ma(r)}`, children: /* @__PURE__ */ s(
1206
1206
  "img",
1207
1207
  {
1208
1208
  src: m ?? n,
@@ -1214,7 +1214,7 @@ const Sa = (e) => {
1214
1214
  "div",
1215
1215
  {
1216
1216
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1217
- children: ge(e, {
1217
+ children: be(e, {
1218
1218
  className: Gt(r),
1219
1219
  weight: "regular"
1220
1220
  })
@@ -1261,7 +1261,7 @@ const Sa = (e) => {
1261
1261
  }
1262
1262
  ),
1263
1263
  /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
1264
- ge(r, {
1264
+ be(r, {
1265
1265
  className: N(
1266
1266
  "size-5 shrink-0",
1267
1267
  f ? "text-white/55" : "text-black/55"
@@ -1292,19 +1292,19 @@ function gs(e) {
1292
1292
  function at(e) {
1293
1293
  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)]`;
1294
1294
  }
1295
- function Ta(e) {
1295
+ function Aa(e) {
1296
1296
  return e ? "bg-white/10" : "bg-black/5";
1297
1297
  }
1298
- function Ma(e) {
1298
+ function Ra(e) {
1299
1299
  return e ? "text-white" : "text-black";
1300
1300
  }
1301
- function Aa(e) {
1301
+ function La(e) {
1302
1302
  return e ? "text-white/55" : "text-black/55";
1303
1303
  }
1304
- function Ra(e) {
1304
+ function Da(e) {
1305
1305
  return e ? "text-white/40" : "text-black/40";
1306
1306
  }
1307
- function La(e) {
1307
+ function Pa(e) {
1308
1308
  return e ? "text-white/20" : "text-black/20";
1309
1309
  }
1310
1310
  const rt = ({ attachment: e, isMyMessage: t }) => {
@@ -1319,14 +1319,14 @@ const rt = ({ attachment: e, isMyMessage: t }) => {
1319
1319
  ) : /* @__PURE__ */ s(
1320
1320
  "div",
1321
1321
  {
1322
- className: `aspect-video w-full rounded-[20px] ${Ta(t)} flex items-center justify-center`,
1323
- children: /* @__PURE__ */ s(Vn, { className: `size-12 ${La(t)}` })
1322
+ className: `aspect-video w-full rounded-[20px] ${Aa(t)} flex items-center justify-center`,
1323
+ children: /* @__PURE__ */ s(Gn, { className: `size-12 ${Pa(t)}` })
1324
1324
  }
1325
1325
  ) }),
1326
1326
  /* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
1327
- n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Ma(t)}`, children: n }),
1328
- a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Aa(t)}`, children: a }),
1329
- d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Ra(t)}`, children: d })
1327
+ n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Ra(t)}`, children: n }),
1328
+ a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${La(t)}`, children: a }),
1329
+ d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Da(t)}`, children: d })
1330
1330
  ] })
1331
1331
  ] });
1332
1332
  return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: u }) : /* @__PURE__ */ s("div", { className: "block", children: u });
@@ -1338,7 +1338,7 @@ function it(e) {
1338
1338
  var t;
1339
1339
  return (t = e.attachments) == null ? void 0 : t.find(ps);
1340
1340
  }
1341
- async function Da(e, t) {
1341
+ async function za(e, t) {
1342
1342
  let n;
1343
1343
  try {
1344
1344
  n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
@@ -1350,7 +1350,7 @@ async function Da(e, t) {
1350
1350
  const r = await a.blob(), i = URL.createObjectURL(r), l = document.createElement("a");
1351
1351
  l.href = i, l.download = n, l.style.display = "none", document.body.appendChild(l), l.click(), document.body.removeChild(l), URL.revokeObjectURL(i);
1352
1352
  }
1353
- const Pa = ({
1353
+ const Oa = ({
1354
1354
  url: e,
1355
1355
  filename: t
1356
1356
  }) => {
@@ -1362,7 +1362,7 @@ const Pa = ({
1362
1362
  onClick: (i) => {
1363
1363
  i.stopPropagation();
1364
1364
  const l = window.open("", "_blank", "noopener,noreferrer");
1365
- a(!0), Da(e, t).then(() => {
1365
+ a(!0), za(e, t).then(() => {
1366
1366
  l == null || l.close();
1367
1367
  }).catch(() => {
1368
1368
  l && (l.location.href = e);
@@ -1370,7 +1370,7 @@ const Pa = ({
1370
1370
  },
1371
1371
  disabled: n,
1372
1372
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
1373
- children: n ? /* @__PURE__ */ s(_e, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
1373
+ children: n ? /* @__PURE__ */ s(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
1374
1374
  /* @__PURE__ */ s(Ne, { className: "size-4 text-white", weight: "bold" }),
1375
1375
  "Download"
1376
1376
  ] })
@@ -1452,17 +1452,17 @@ const bs = ({
1452
1452
  containedImage: i === "image" || i === "document"
1453
1453
  }
1454
1454
  ),
1455
- action: /* @__PURE__ */ s(Pa, { url: e, filename: n })
1455
+ action: /* @__PURE__ */ s(Oa, { url: e, filename: n })
1456
1456
  }
1457
1457
  );
1458
- }, za = ({
1458
+ }, Fa = ({
1459
1459
  message: e,
1460
1460
  isMyMessage: t = !1
1461
1461
  }) => {
1462
1462
  const n = it(e), a = ot(e);
1463
1463
  return !n && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
1464
1464
  !t && e.user && /* @__PURE__ */ s(
1465
- be,
1465
+ ve,
1466
1466
  {
1467
1467
  className: "str-chat__avatar str-chat__message-sender-avatar",
1468
1468
  id: e.user.id,
@@ -1487,7 +1487,7 @@ const bs = ({
1487
1487
  }
1488
1488
  )
1489
1489
  ] });
1490
- }, Oa = ({
1490
+ }, Ba = ({
1491
1491
  message: e
1492
1492
  }) => {
1493
1493
  const t = it(e);
@@ -1495,7 +1495,7 @@ const bs = ({
1495
1495
  return /* @__PURE__ */ s("div", { className: at(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(rt, { attachment: t, isMyMessage: !0 }) });
1496
1496
  const n = ot(e);
1497
1497
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(bs, { ...n }) }) : null;
1498
- }, Fa = ({
1498
+ }, $a = ({
1499
1499
  message: e
1500
1500
  }) => {
1501
1501
  const t = it(e);
@@ -1503,19 +1503,19 @@ const bs = ({
1503
1503
  return /* @__PURE__ */ s("div", { className: at(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(rt, { attachment: t, isMyMessage: !1 }) });
1504
1504
  const n = ot(e);
1505
1505
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(vs, { ...n }) }) : null;
1506
- }, fo = Object.assign(za, {
1507
- Creator: Oa,
1508
- Visitor: Fa
1509
- }), Ba = {
1506
+ }, bo = Object.assign(Fa, {
1507
+ Creator: Ba,
1508
+ Visitor: $a
1509
+ }), Ua = {
1510
1510
  dark: "bg-[#1e2330]",
1511
1511
  light: "bg-[#f2f1ef]"
1512
- }, $a = {
1512
+ }, ja = {
1513
1513
  dark: "text-white",
1514
1514
  light: "text-[#000000]"
1515
- }, Ua = {
1515
+ }, Va = {
1516
1516
  dark: "border-white/[0.08]",
1517
1517
  light: "border-black/[0.08]"
1518
- }, ja = (e) => e === "dark" ? "sender" : "receiver", Va = {
1518
+ }, Ga = (e) => e === "dark" ? "sender" : "receiver", Ha = {
1519
1519
  sender: {
1520
1520
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
1521
1521
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -1537,7 +1537,7 @@ const bs = ({
1537
1537
  children: i,
1538
1538
  "data-testid": l
1539
1539
  }) => {
1540
- const o = t != null && t !== "", d = Va[ja(e)][a];
1540
+ const o = t != null && t !== "", d = Ha[Ga(e)][a];
1541
1541
  return /* @__PURE__ */ h(
1542
1542
  "div",
1543
1543
  {
@@ -1552,10 +1552,10 @@ const bs = ({
1552
1552
  // as the surrounding `CustomMessage` text bubbles.
1553
1553
  "relative w-[280px] overflow-hidden px-2 py-2",
1554
1554
  d,
1555
- Ba[e],
1556
- $a[e],
1555
+ Ua[e],
1556
+ ja[e],
1557
1557
  n && "border",
1558
- n && Ua[e],
1558
+ n && Va[e],
1559
1559
  r
1560
1560
  ),
1561
1561
  children: [
@@ -1598,16 +1598,16 @@ const bs = ({
1598
1598
  ),
1599
1599
  children: /* @__PURE__ */ s(Be, { className: "size-3", weight: "bold" })
1600
1600
  }
1601
- ), Ee = (e) => e === "received" ? "light" : "dark", Ga = ({
1601
+ ), Ee = (e) => e === "received" ? "light" : "dark", Ya = ({
1602
1602
  firstOfGroup: e,
1603
1603
  endOfGroup: t,
1604
1604
  groupedByUser: n
1605
- }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Ha = ({
1605
+ }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Wa = ({
1606
1606
  src: e,
1607
1607
  mimeType: t,
1608
1608
  filename: n,
1609
1609
  items: a
1610
- }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], Ya = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1610
+ }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: n }] : [], qa = ({ item: e, preload: t, trailingAction: n }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1611
1611
  /* @__PURE__ */ s(
1612
1612
  "audio",
1613
1613
  {
@@ -1630,7 +1630,7 @@ const bs = ({
1630
1630
  preload: o,
1631
1631
  onDismiss: d
1632
1632
  }) => {
1633
- const u = Ee(e), g = e === "composer" && !!d, m = Ha({ src: t, mimeType: n, filename: a, items: r });
1633
+ const u = Ee(e), g = e === "composer" && !!d, m = Wa({ src: t, mimeType: n, filename: a, items: r });
1634
1634
  if (m.length === 0)
1635
1635
  return null;
1636
1636
  const f = o ?? (m.length > 1 ? "none" : "metadata");
@@ -1642,7 +1642,7 @@ const bs = ({
1642
1642
  groupPosition: l,
1643
1643
  "data-testid": "audio-attachment",
1644
1644
  children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: m.map((c, v) => /* @__PURE__ */ s(
1645
- Ya,
1645
+ qa,
1646
1646
  {
1647
1647
  item: c,
1648
1648
  preload: f,
@@ -1656,15 +1656,15 @@ const bs = ({
1656
1656
  )) })
1657
1657
  }
1658
1658
  );
1659
- }, qa = (e) => /* @__PURE__ */ s(lt, { ...e, state: "composer" }), Wa = (e) => /* @__PURE__ */ s(lt, { ...e, state: "sent" }), Xa = (e) => /* @__PURE__ */ s(lt, { ...e, state: "received" }), Ka = {
1660
- Composer: qa,
1661
- Sent: Wa,
1662
- Received: Xa
1659
+ }, Xa = (e) => /* @__PURE__ */ s(lt, { ...e, state: "composer" }), Ka = (e) => /* @__PURE__ */ s(lt, { ...e, state: "sent" }), Za = (e) => /* @__PURE__ */ s(lt, { ...e, state: "received" }), Ja = {
1660
+ Composer: Xa,
1661
+ Sent: Ka,
1662
+ Received: Za
1663
1663
  };
1664
- function Za(e) {
1664
+ function Qa(e) {
1665
1665
  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`;
1666
1666
  }
1667
- const Ja = {
1667
+ const er = {
1668
1668
  pdf: "PDF",
1669
1669
  doc: "DOC",
1670
1670
  xls: "XLS",
@@ -1674,7 +1674,7 @@ const Ja = {
1674
1674
  text: "TXT",
1675
1675
  markdown: "MD"
1676
1676
  };
1677
- function Qa(e, t) {
1677
+ function tr(e, t) {
1678
1678
  if (t) {
1679
1679
  const r = t.lastIndexOf(".");
1680
1680
  if (r > 0 && r < t.length - 1) {
@@ -1684,7 +1684,7 @@ function Qa(e, t) {
1684
1684
  }
1685
1685
  if (!e) return;
1686
1686
  if (oe(e) === "document") {
1687
- const r = ms(e), i = Ja[r];
1687
+ const r = ms(e), i = er[r];
1688
1688
  if (i) return i;
1689
1689
  if (e === "application/octet-stream") return;
1690
1690
  }
@@ -1692,8 +1692,8 @@ function Qa(e, t) {
1692
1692
  if (!(!a || a === "*"))
1693
1693
  return a.toUpperCase();
1694
1694
  }
1695
- function er(e, t, n) {
1696
- const a = Qa(e, t), r = typeof n == "number" && n > 0 ? Za(n) : void 0;
1695
+ function sr(e, t, n) {
1696
+ const a = tr(e, t), r = typeof n == "number" && n > 0 ? Qa(n) : void 0;
1697
1697
  return [a, r].filter(Boolean).join(" · ") || void 0;
1698
1698
  }
1699
1699
  function ne(e) {
@@ -1704,13 +1704,13 @@ function ne(e) {
1704
1704
  return "download";
1705
1705
  }
1706
1706
  }
1707
- const tr = {
1707
+ const nr = {
1708
1708
  dark: "text-white/55",
1709
1709
  light: "text-black/65"
1710
- }, sr = {
1710
+ }, ar = {
1711
1711
  dark: "bg-white/10",
1712
1712
  light: "bg-black/5"
1713
- }, nr = {
1713
+ }, rr = {
1714
1714
  dark: "text-white/85",
1715
1715
  light: "text-black/85"
1716
1716
  }, xs = ({
@@ -1723,16 +1723,16 @@ const tr = {
1723
1723
  activateLabel: l,
1724
1724
  trailingAction: o
1725
1725
  }) => {
1726
- const d = n ?? t ?? "File", u = er(a, t, r), g = /* @__PURE__ */ s(
1726
+ const d = n ?? t ?? "File", u = sr(a, t, r), g = /* @__PURE__ */ s(
1727
1727
  "div",
1728
1728
  {
1729
1729
  className: N(
1730
1730
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
1731
- sr[e]
1731
+ ar[e]
1732
1732
  ),
1733
1733
  "aria-hidden": !0,
1734
- children: ge(a, {
1735
- className: N("size-6", nr[e]),
1734
+ children: be(a, {
1735
+ className: N("size-6", rr[e]),
1736
1736
  weight: "regular"
1737
1737
  })
1738
1738
  }
@@ -1743,7 +1743,7 @@ const tr = {
1743
1743
  {
1744
1744
  className: N(
1745
1745
  "truncate text-xs leading-4",
1746
- tr[e]
1746
+ nr[e]
1747
1747
  ),
1748
1748
  children: u
1749
1749
  }
@@ -1763,7 +1763,7 @@ const tr = {
1763
1763
  m
1764
1764
  ]
1765
1765
  }
1766
- ) : /* @__PURE__ */ h(ee, { children: [
1766
+ ) : /* @__PURE__ */ h(K, { children: [
1767
1767
  g,
1768
1768
  m
1769
1769
  ] });
@@ -1786,14 +1786,14 @@ async function ws(e, t) {
1786
1786
  }
1787
1787
  }
1788
1788
  }
1789
- const ar = ({
1789
+ const ir = ({
1790
1790
  src: e,
1791
1791
  filename: t,
1792
1792
  fileSize: n,
1793
1793
  mimeType: a,
1794
1794
  title: r,
1795
1795
  items: i
1796
- }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], rr = ({
1796
+ }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: n, mimeType: a, title: r }] : [], or = ({
1797
1797
  variant: e,
1798
1798
  item: t,
1799
1799
  index: n,
@@ -1827,7 +1827,7 @@ const ar = ({
1827
1827
  onClick: u,
1828
1828
  onDismiss: g
1829
1829
  }) => {
1830
- const m = Ee(e), f = e === "composer" && !!g, c = ar({
1830
+ const m = Ee(e), f = e === "composer" && !!g, c = ir({
1831
1831
  src: t,
1832
1832
  filename: n,
1833
1833
  fileSize: a,
@@ -1862,7 +1862,7 @@ const ar = ({
1862
1862
  groupPosition: d,
1863
1863
  "data-testid": "file-attachment",
1864
1864
  children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((p, b) => /* @__PURE__ */ s(
1865
- rr,
1865
+ or,
1866
1866
  {
1867
1867
  variant: m,
1868
1868
  item: p,
@@ -1874,16 +1874,16 @@ const ar = ({
1874
1874
  )) })
1875
1875
  }
1876
1876
  );
1877
- }, ir = (e) => /* @__PURE__ */ s(ct, { ...e, state: "composer" }), or = (e) => /* @__PURE__ */ s(ct, { ...e, state: "sent" }), lr = (e) => /* @__PURE__ */ s(ct, { ...e, state: "received" }), cr = {
1878
- Composer: ir,
1879
- Sent: or,
1880
- Received: lr
1877
+ }, lr = (e) => /* @__PURE__ */ s(ct, { ...e, state: "composer" }), cr = (e) => /* @__PURE__ */ s(ct, { ...e, state: "sent" }), dr = (e) => /* @__PURE__ */ s(ct, { ...e, state: "received" }), ur = {
1878
+ Composer: lr,
1879
+ Sent: cr,
1880
+ Received: dr
1881
1881
  }, dt = ({
1882
1882
  onPrev: e,
1883
1883
  onNext: t,
1884
1884
  prevLabel: n = "Previous",
1885
1885
  nextLabel: a = "Next"
1886
- }) => /* @__PURE__ */ h(ee, { children: [
1886
+ }) => /* @__PURE__ */ h(K, { children: [
1887
1887
  /* @__PURE__ */ s(
1888
1888
  "button",
1889
1889
  {
@@ -1891,7 +1891,7 @@ const ar = ({
1891
1891
  onClick: e,
1892
1892
  "aria-label": n,
1893
1893
  className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
1894
- children: /* @__PURE__ */ s(Gn, { size: 20, weight: "bold", "aria-hidden": !0 })
1894
+ children: /* @__PURE__ */ s(Hn, { size: 20, weight: "bold", "aria-hidden": !0 })
1895
1895
  }
1896
1896
  ),
1897
1897
  /* @__PURE__ */ s(
@@ -1913,7 +1913,7 @@ const ar = ({
1913
1913
  tone: i = "dark",
1914
1914
  onTriggered: l
1915
1915
  }) => {
1916
- const [o, d] = F(!1), u = W(
1916
+ const [o, d] = F(!1), u = q(
1917
1917
  (c) => {
1918
1918
  c.stopPropagation(), !o && (d(!0), ws(e, t).catch(() => {
1919
1919
  }).finally(() => {
@@ -1940,7 +1940,7 @@ const ar = ({
1940
1940
  }[i]
1941
1941
  ),
1942
1942
  children: o ? /* @__PURE__ */ s(
1943
- _e,
1943
+ pe,
1944
1944
  {
1945
1945
  className: "size-4 animate-spin",
1946
1946
  weight: "bold",
@@ -1963,7 +1963,7 @@ const ar = ({
1963
1963
  disabled: o,
1964
1964
  "aria-label": a,
1965
1965
  className: "mes-media-viewer__action",
1966
- children: o ? /* @__PURE__ */ s(_e, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ s(Ne, { size: 20, weight: "bold", "aria-hidden": !0 })
1966
+ children: o ? /* @__PURE__ */ s(pe, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ s(Ne, { size: 20, weight: "bold", "aria-hidden": !0 })
1967
1967
  }
1968
1968
  ) : /* @__PURE__ */ h(
1969
1969
  "button",
@@ -1978,7 +1978,7 @@ const ar = ({
1978
1978
  ),
1979
1979
  children: [
1980
1980
  o ? /* @__PURE__ */ s(
1981
- _e,
1981
+ pe,
1982
1982
  {
1983
1983
  className: "size-4 animate-spin",
1984
1984
  weight: "bold",
@@ -2000,9 +2000,9 @@ const ar = ({
2000
2000
  }, [n, t, e]), Y(() => {
2001
2001
  i((d) => Ye(d, 0, Math.max(e - 1, 0)));
2002
2002
  }, [e]);
2003
- const l = W(() => {
2003
+ const l = q(() => {
2004
2004
  e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
2005
- }, [e]), o = W(() => {
2005
+ }, [e]), o = q(() => {
2006
2006
  e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
2007
2007
  }, [e]);
2008
2008
  return Y(() => {
@@ -2160,7 +2160,7 @@ const ar = ({
2160
2160
  ]
2161
2161
  }
2162
2162
  ) : null;
2163
- }, dr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", ys = ({
2163
+ }, mr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", ys = ({
2164
2164
  tiles: e,
2165
2165
  onTileActivate: t,
2166
2166
  maxVisible: n = 4,
@@ -2169,7 +2169,7 @@ const ar = ({
2169
2169
  const r = e.length;
2170
2170
  if (r === 0) return null;
2171
2171
  const i = e.slice(0, Math.min(r, n)), l = r - i.length, o = (d, u, g) => {
2172
- const m = N(dr, "h-full w-full");
2172
+ const m = N(mr, "h-full w-full");
2173
2173
  return t ? /* @__PURE__ */ h(
2174
2174
  "button",
2175
2175
  {
@@ -2231,14 +2231,14 @@ const ar = ({
2231
2231
  }
2232
2232
  );
2233
2233
  }, Ie = (e) => {
2234
- const [t, n] = F(!1), [a, r] = F(0), i = W(
2234
+ const [t, n] = F(!1), [a, r] = F(0), i = q(
2235
2235
  (o) => {
2236
2236
  (e == null ? void 0 : e(o)) !== !1 && (r(o), n(!0));
2237
2237
  },
2238
2238
  [e]
2239
- ), l = W(() => n(!1), []);
2239
+ ), l = q(() => n(!1), []);
2240
2240
  return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: l };
2241
- }, ur = (e, t, n, a) => ({
2241
+ }, hr = (e, t, n, a) => ({
2242
2242
  ariaLabel: `Open image ${t + 1} of ${n}`,
2243
2243
  content: /* @__PURE__ */ s(
2244
2244
  "img",
@@ -2253,7 +2253,7 @@ const ar = ({
2253
2253
  className: "absolute inset-0 size-full rounded-md object-cover"
2254
2254
  }
2255
2255
  )
2256
- }), mr = ({
2256
+ }), fr = ({
2257
2257
  src: e,
2258
2258
  alt: t,
2259
2259
  items: n
@@ -2261,7 +2261,7 @@ const ar = ({
2261
2261
  src: n.src,
2262
2262
  alt: n.alt,
2263
2263
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2264
- })), hr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
2264
+ })), gr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
2265
2265
  const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: u } = Ie(
2266
2266
  r
2267
2267
  );
@@ -2308,13 +2308,13 @@ const ar = ({
2308
2308
  loading: o = "lazy",
2309
2309
  onClick: d
2310
2310
  }) => {
2311
- const u = mr({ src: t, alt: n, items: r }), g = Ee(e), { viewerOpen: m, viewerIndex: f, handleActivate: c, closeViewer: v } = Ie(
2311
+ const u = fr({ src: t, alt: n, items: r }), g = Ee(e), { viewerOpen: m, viewerIndex: f, handleActivate: c, closeViewer: v } = Ie(
2312
2312
  d
2313
2313
  );
2314
2314
  if (u.length === 0)
2315
2315
  return null;
2316
2316
  const x = u.map(
2317
- (p, b) => ur(p, b, u.length, o)
2317
+ (p, b) => hr(p, b, u.length, o)
2318
2318
  );
2319
2319
  return /* @__PURE__ */ h(
2320
2320
  Ce,
@@ -2337,11 +2337,11 @@ const ar = ({
2337
2337
  ]
2338
2338
  }
2339
2339
  );
2340
- }, fr = (e) => /* @__PURE__ */ s(hr, { ...e }), gr = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "sent" }), pr = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "received" }), br = {
2341
- Composer: fr,
2342
- Sent: gr,
2343
- Received: pr
2344
- }, vr = ({
2340
+ }, pr = (e) => /* @__PURE__ */ s(gr, { ...e }), br = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "sent" }), vr = (e) => /* @__PURE__ */ s(Cs, { ...e, state: "received" }), xr = {
2341
+ Composer: pr,
2342
+ Sent: br,
2343
+ Received: vr
2344
+ }, wr = ({
2345
2345
  open: e,
2346
2346
  items: t,
2347
2347
  initialIndex: n = 0,
@@ -2355,7 +2355,7 @@ const ar = ({
2355
2355
  () => (o == null ? void 0 : o.filename) ?? (o ? ne(o.src) : "document"),
2356
2356
  [o]
2357
2357
  ), u = se(
2358
- () => o ? xr(o.src) : void 0,
2358
+ () => o ? _r(o.src) : void 0,
2359
2359
  [o]
2360
2360
  );
2361
2361
  return !o || !u ? null : /* @__PURE__ */ h(
@@ -2389,16 +2389,16 @@ const ar = ({
2389
2389
  ]
2390
2390
  }
2391
2391
  );
2392
- }, xr = (e) => {
2392
+ }, _r = (e) => {
2393
2393
  const t = e.indexOf("#"), n = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
2394
2394
  return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${n}#${r.toString()}`;
2395
- }, wr = ({
2395
+ }, Nr = ({
2396
2396
  src: e,
2397
2397
  filename: t,
2398
2398
  fileSize: n,
2399
2399
  title: a,
2400
2400
  items: r
2401
- }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], _r = ({
2401
+ }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: n, title: a }] : [], yr = ({
2402
2402
  variant: e,
2403
2403
  item: t,
2404
2404
  index: n,
@@ -2431,7 +2431,7 @@ const ar = ({
2431
2431
  onClick: d,
2432
2432
  onDismiss: u
2433
2433
  }) => {
2434
- const g = Ee(e), m = wr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: x } = Ie(
2434
+ const g = Ee(e), m = Nr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: x } = Ie(
2435
2435
  d
2436
2436
  ), p = e === "composer" && !!u;
2437
2437
  if (m.length === 0)
@@ -2460,7 +2460,7 @@ const ar = ({
2460
2460
  }
2461
2461
  );
2462
2462
  return /* @__PURE__ */ s(
2463
- _r,
2463
+ yr,
2464
2464
  {
2465
2465
  variant: g,
2466
2466
  item: w,
@@ -2472,7 +2472,7 @@ const ar = ({
2472
2472
  );
2473
2473
  }) }),
2474
2474
  /* @__PURE__ */ s(
2475
- vr,
2475
+ wr,
2476
2476
  {
2477
2477
  open: f,
2478
2478
  items: b,
@@ -2483,10 +2483,10 @@ const ar = ({
2483
2483
  ]
2484
2484
  }
2485
2485
  );
2486
- }, Nr = (e) => /* @__PURE__ */ s(ht, { ...e, state: "composer" }), yr = (e) => /* @__PURE__ */ s(ht, { ...e, state: "sent" }), kr = (e) => /* @__PURE__ */ s(ht, { ...e, state: "received" }), Cr = {
2487
- Composer: Nr,
2488
- Sent: yr,
2489
- Received: kr
2486
+ }, kr = (e) => /* @__PURE__ */ s(ht, { ...e, state: "composer" }), Cr = (e) => /* @__PURE__ */ s(ht, { ...e, state: "sent" }), Sr = (e) => /* @__PURE__ */ s(ht, { ...e, state: "received" }), Er = {
2487
+ Composer: kr,
2488
+ Sent: Cr,
2489
+ Received: Sr
2490
2490
  }, Ss = ({
2491
2491
  open: e,
2492
2492
  items: t,
@@ -2537,7 +2537,7 @@ const ar = ({
2537
2537
  ]
2538
2538
  }
2539
2539
  ) : null;
2540
- }, Sr = () => /* @__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(Qe, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Es = ({
2540
+ }, Ir = () => /* @__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(Qe, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Es = ({
2541
2541
  item: e,
2542
2542
  index: t
2543
2543
  }) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
@@ -2559,11 +2559,11 @@ const ar = ({
2559
2559
  "aria-hidden": !0
2560
2560
  }
2561
2561
  ) }),
2562
- /* @__PURE__ */ s(Sr, {})
2563
- ] }), Er = (e, t, n) => ({
2562
+ /* @__PURE__ */ s(Ir, {})
2563
+ ] }), Tr = (e, t, n) => ({
2564
2564
  ariaLabel: `Play video ${t + 1} of ${n}`,
2565
2565
  content: /* @__PURE__ */ s(Es, { item: e, index: t })
2566
- }), Ir = ({
2566
+ }), Mr = ({
2567
2567
  src: e,
2568
2568
  poster: t,
2569
2569
  mimeType: n,
@@ -2575,7 +2575,7 @@ const ar = ({
2575
2575
  mimeType: n.mimeType,
2576
2576
  preload: n.preload,
2577
2577
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2578
- })), Tr = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
2578
+ })), Ar = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
2579
2579
  const { viewerOpen: o, viewerIndex: d, handleActivate: u, closeViewer: g } = Ie(
2580
2580
  i
2581
2581
  );
@@ -2616,13 +2616,13 @@ const ar = ({
2616
2616
  preload: d,
2617
2617
  onClick: u
2618
2618
  }) => {
2619
- const g = Ir({ src: t, poster: n, mimeType: a, preload: d, items: i }), m = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: x } = Ie(
2619
+ const g = Mr({ src: t, poster: n, mimeType: a, preload: d, items: i }), m = Ee(e), { viewerOpen: f, viewerIndex: c, handleActivate: v, closeViewer: x } = Ie(
2620
2620
  u
2621
2621
  );
2622
2622
  if (g.length === 0)
2623
2623
  return null;
2624
2624
  const p = g.map(
2625
- (b, w) => Er(b, w, g.length)
2625
+ (b, w) => Tr(b, w, g.length)
2626
2626
  );
2627
2627
  return /* @__PURE__ */ h(
2628
2628
  Ce,
@@ -2652,31 +2652,31 @@ const ar = ({
2652
2652
  ]
2653
2653
  }
2654
2654
  );
2655
- }, Mr = (e) => /* @__PURE__ */ s(Tr, { ...e }), Ar = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "sent" }), Rr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "received" }), Lr = {
2656
- Composer: Mr,
2657
- Sent: Ar,
2658
- Received: Rr
2659
- }, xe = {
2660
- Image: br,
2661
- Video: Lr,
2662
- Audio: Ka,
2663
- Pdf: Cr,
2664
- File: cr
2665
- }, Dr = {
2655
+ }, Rr = (e) => /* @__PURE__ */ s(Ar, { ...e }), Lr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "sent" }), Dr = (e) => /* @__PURE__ */ s(Ts, { ...e, state: "received" }), Pr = {
2656
+ Composer: Rr,
2657
+ Sent: Lr,
2658
+ Received: Dr
2659
+ }, we = {
2660
+ Image: xr,
2661
+ Video: Pr,
2662
+ Audio: Ja,
2663
+ Pdf: Er,
2664
+ File: ur
2665
+ }, zr = {
2666
2666
  isUnlocking: () => !1
2667
- }, Pr = {
2668
- LockedAttachment: Dr
2669
- }, Ms = st({}), go = Ms.Provider;
2670
- function zr(e) {
2671
- return ye(Ms)[e] ?? Pr[e];
2667
+ }, Or = {
2668
+ LockedAttachment: zr
2669
+ }, Ms = st({}), vo = Ms.Provider;
2670
+ function Fr(e) {
2671
+ return ye(Ms)[e] ?? Or[e];
2672
2672
  }
2673
- const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import("./Card-CL8BkAA9.js")), Br = () => /* @__PURE__ */ s(
2673
+ const Br = j.lazy(() => import("./Card-qS17qnN0.js")), $r = j.lazy(() => import("./Card-CKBcKjA4.js")), Ur = () => /* @__PURE__ */ s(
2674
2674
  "div",
2675
2675
  {
2676
2676
  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)]",
2677
2677
  "aria-hidden": !0
2678
2678
  }
2679
- ), Re = (e) => /* @__PURE__ */ s(Vs, { fallback: /* @__PURE__ */ s(Br, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(Or, { ...e }) : /* @__PURE__ */ s(Fr, { ...e }) }), $r = ({ size: e = 15 }) => /* @__PURE__ */ s(
2679
+ ), Re = (e) => /* @__PURE__ */ s(Gs, { fallback: /* @__PURE__ */ s(Ur, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(Br, { ...e }) : /* @__PURE__ */ s($r, { ...e }) }), jr = ({ size: e = 15 }) => /* @__PURE__ */ s(
2680
2680
  "svg",
2681
2681
  {
2682
2682
  width: e,
@@ -2693,10 +2693,10 @@ const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import(
2693
2693
  }
2694
2694
  )
2695
2695
  }
2696
- ), Ur = (e) => {
2696
+ ), Vr = (e) => {
2697
2697
  var t;
2698
2698
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
2699
- }, jr = (e) => {
2699
+ }, Gr = (e) => {
2700
2700
  var t;
2701
2701
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
2702
2702
  }, De = (e) => {
@@ -2705,16 +2705,16 @@ const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import(
2705
2705
  }, ft = (e) => {
2706
2706
  var t;
2707
2707
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
2708
- }, Vr = (e) => {
2708
+ }, Hr = (e) => {
2709
2709
  var t;
2710
2710
  return ft(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
2711
- }, Gr = (e) => {
2711
+ }, Yr = (e) => {
2712
2712
  var t;
2713
2713
  return ft(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
2714
- }, As = (e) => Ur(e) || jr(e), Hr = (e) => {
2714
+ }, As = (e) => Vr(e) || Gr(e), Wr = (e) => {
2715
2715
  var t;
2716
2716
  return As(e) && !((t = e.text) != null && t.trim());
2717
- }, qe = ({
2717
+ }, We = ({
2718
2718
  message: e,
2719
2719
  standalone: t = !1,
2720
2720
  isMyMessage: n = !1,
@@ -2729,7 +2729,7 @@ const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import(
2729
2729
  if (!f) return null;
2730
2730
  const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", v = t ? `${f} tip` : `Delivered with ${f} tip`;
2731
2731
  return /* @__PURE__ */ h("div", { className: c, children: [
2732
- /* @__PURE__ */ s(Hn, { size: t ? 14 : 12 }),
2732
+ /* @__PURE__ */ s(Yn, { size: t ? 14 : 12 }),
2733
2733
  /* @__PURE__ */ s("span", { children: v })
2734
2734
  ] });
2735
2735
  }
@@ -2737,15 +2737,15 @@ const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import(
2737
2737
  "message-chatbot-indicator",
2738
2738
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
2739
2739
  l ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
2740
- ].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s($r, { size: l ? 12 : 15 }) });
2741
- return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ h(ee, { children: [
2740
+ ].join(" "), u = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__label", children: o }), g = /* @__PURE__ */ s("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ s(jr, { size: l ? 12 : 15 }) });
2741
+ return /* @__PURE__ */ s("div", { className: d, "data-testid": "message-chatbot-indicator", children: n && !l ? /* @__PURE__ */ h(K, { children: [
2742
2742
  u,
2743
2743
  g
2744
- ] }) : /* @__PURE__ */ h(ee, { children: [
2744
+ ] }) : /* @__PURE__ */ h(K, { children: [
2745
2745
  g,
2746
2746
  u
2747
2747
  ] }) });
2748
- }, Yr = ({
2748
+ }, qr = ({
2749
2749
  selected: e,
2750
2750
  onVoteUp: t,
2751
2751
  onVoteDown: n
@@ -2761,7 +2761,7 @@ const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import(
2761
2761
  "aria-label": "Good response",
2762
2762
  "aria-pressed": e === "up",
2763
2763
  "data-tooltip": "Good response",
2764
- children: /* @__PURE__ */ s(Yn, { size: 16, weight: e === "up" ? "fill" : "regular" })
2764
+ children: /* @__PURE__ */ s(Wn, { size: 16, weight: e === "up" ? "fill" : "regular" })
2765
2765
  }
2766
2766
  ),
2767
2767
  /* @__PURE__ */ s(
@@ -2778,8 +2778,8 @@ const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import(
2778
2778
  children: /* @__PURE__ */ s(qn, { size: 16, weight: e === "down" ? "fill" : "regular" })
2779
2779
  }
2780
2780
  )
2781
- ] }), We = () => {
2782
- const { message: e } = pe("SentMessageDeliveryStatus"), { messages: t } = ue("SentMessageDeliveryStatus"), n = (() => {
2781
+ ] }), Rs = () => {
2782
+ const { message: e } = me("SentMessageDeliveryStatus"), { messages: t } = ue("SentMessageDeliveryStatus"), n = (() => {
2783
2783
  if (t)
2784
2784
  for (let a = t.length - 1; a >= 0; a -= 1) {
2785
2785
  const r = t[a];
@@ -2787,37 +2787,55 @@ const Or = j.lazy(() => import("./Card-qS17qnN0.js")), Fr = j.lazy(() => import(
2787
2787
  return r.id;
2788
2788
  }
2789
2789
  })();
2790
- return e.id !== n ? null : /* @__PURE__ */ h(ee, { children: [
2791
- /* @__PURE__ */ s(Wn, { weight: "bold", "aria-hidden": "true" }),
2792
- /* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
2793
- ] });
2794
- }, qr = () => null, Wr = () => /* @__PURE__ */ s(
2795
- Ws,
2796
- {
2797
- MessageSentStatus: We,
2798
- MessageDeliveredStatus: We,
2799
- MessageReadStatus: We,
2800
- MessageSendingStatus: qr
2801
- }
2802
- ), Xr = /^([a-z][a-z0-9+.-]*):/i, Kr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2790
+ return e.id === n;
2791
+ }, qe = () => Rs() ? /* @__PURE__ */ h(K, { children: [
2792
+ /* @__PURE__ */ s(Kn, { weight: "bold", "aria-hidden": "true" }),
2793
+ /* @__PURE__ */ s("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
2794
+ ] }) : null, Xr = () => Rs() ? /* @__PURE__ */ h(K, { children: [
2795
+ /* @__PURE__ */ s(
2796
+ pe,
2797
+ {
2798
+ className: "sent-message-status__spinner animate-spin",
2799
+ weight: "bold",
2800
+ "aria-hidden": "true"
2801
+ }
2802
+ ),
2803
+ /* @__PURE__ */ s("span", { "data-testid": "sent-message-sending-status", children: "Sending" })
2804
+ ] }) : null, Kr = () => /* @__PURE__ */ h("span", { className: "str-chat__message-status sent-message-status--failed", children: [
2805
+ /* @__PURE__ */ s(Xn, { weight: "bold", "aria-hidden": "true" }),
2806
+ /* @__PURE__ */ s("span", { "data-testid": "sent-message-failed-status", children: "Failed to send" })
2807
+ ] }), Zr = () => {
2808
+ const { isMyMessage: e, message: t, threadList: n } = me(
2809
+ "SentMessageDeliveryStatus"
2810
+ );
2811
+ return t.status === "failed" && e() && t.type !== "error" && !n ? /* @__PURE__ */ s(Kr, {}) : /* @__PURE__ */ s(
2812
+ Xs,
2813
+ {
2814
+ MessageSentStatus: qe,
2815
+ MessageDeliveredStatus: qe,
2816
+ MessageReadStatus: qe,
2817
+ MessageSendingStatus: Xr
2818
+ }
2819
+ );
2820
+ }, Jr = /^([a-z][a-z0-9+.-]*):/i, Qr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2803
2821
  function gt(e) {
2804
2822
  if (typeof e != "string") return;
2805
2823
  const t = e.trim();
2806
2824
  if (t === "") return;
2807
- const n = Xr.exec(t);
2825
+ const n = Jr.exec(t);
2808
2826
  if (n) {
2809
2827
  const a = n[1].toLowerCase();
2810
- return Kr.has(a) ? t : void 0;
2828
+ return Qr.has(a) ? t : void 0;
2811
2829
  }
2812
2830
  return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
2813
2831
  }
2814
- const Zr = {
2832
+ const ei = {
2815
2833
  dark: "bg-white text-[#121110] hover:bg-white/90",
2816
2834
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2817
- }, Jr = ({ variant: e, cta: t }) => {
2835
+ }, ti = ({ variant: e, cta: t }) => {
2818
2836
  const n = N(
2819
2837
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2820
- Zr[e]
2838
+ ei[e]
2821
2839
  ), a = gt(t.href);
2822
2840
  return a ? /* @__PURE__ */ s(
2823
2841
  "a",
@@ -2844,10 +2862,10 @@ const Zr = {
2844
2862
  children: t.label
2845
2863
  }
2846
2864
  );
2847
- }, Qr = {
2865
+ }, si = {
2848
2866
  dark: "text-white",
2849
2867
  light: "text-black/90"
2850
- }, ei = "text-white/30", ti = {
2868
+ }, ni = "text-white/30", ai = {
2851
2869
  dark: "text-white/55",
2852
2870
  light: "text-black/55"
2853
2871
  }, pt = ({
@@ -2864,10 +2882,10 @@ const Zr = {
2864
2882
  if (!g && !m && !c && !v) return null;
2865
2883
  const p = N(
2866
2884
  "truncate text-base font-medium leading-6",
2867
- d && !t ? ei : Qr[e]
2885
+ d && !t ? ni : si[e]
2868
2886
  ), b = N(
2869
2887
  "truncate text-xs leading-4",
2870
- ti[e]
2888
+ ai[e]
2871
2889
  );
2872
2890
  return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
2873
2891
  /* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
@@ -2883,9 +2901,9 @@ const Zr = {
2883
2901
  ] }),
2884
2902
  o && /* @__PURE__ */ s("div", { className: "shrink-0", children: o })
2885
2903
  ] }),
2886
- l && /* @__PURE__ */ s(Jr, { variant: e, cta: l })
2904
+ l && /* @__PURE__ */ s(ti, { variant: e, cta: l })
2887
2905
  ] });
2888
- }, si = N(
2906
+ }, ri = N(
2889
2907
  "relative block w-[280px] select-none overflow-hidden rounded-md",
2890
2908
  // 1px hairline border that sits flush with the card chrome — matches
2891
2909
  // the messaging design system's "small border around link attachments"
@@ -2904,7 +2922,7 @@ const Zr = {
2904
2922
  "data-testid": d
2905
2923
  }) => {
2906
2924
  const u = n != null || a != null, g = N(
2907
- si,
2925
+ ri,
2908
2926
  o ?? (e === "dark" ? "bg-[#1e2330]" : "bg-white"),
2909
2927
  // `focus-ring` is a design-system utility from the component-library
2910
2928
  // tailwind preset — outline-none + a black 2px focus-visible ring
@@ -2952,10 +2970,10 @@ const Zr = {
2952
2970
  ]
2953
2971
  }
2954
2972
  );
2955
- }, ni = {
2973
+ }, ii = {
2956
2974
  dark: "bg-white/10",
2957
2975
  light: "bg-black/5"
2958
- }, ai = {
2976
+ }, oi = {
2959
2977
  dark: "size-16 text-white/25",
2960
2978
  light: "size-16 text-black/25"
2961
2979
  }, $e = (e, t) => !!t && !!e && oe(e) === "audio", bt = (e, t) => {
@@ -3013,10 +3031,10 @@ const Zr = {
3013
3031
  {
3014
3032
  className: N(
3015
3033
  "flex h-full w-full items-center justify-center",
3016
- ni[e]
3034
+ ii[e]
3017
3035
  ),
3018
- children: ge(r, {
3019
- className: ai[e],
3036
+ children: be(r, {
3037
+ className: oi[e],
3020
3038
  weight: "regular"
3021
3039
  })
3022
3040
  }
@@ -3026,7 +3044,7 @@ const Zr = {
3026
3044
  ]
3027
3045
  }
3028
3046
  );
3029
- }, ri = ({
3047
+ }, li = ({
3030
3048
  title: e,
3031
3049
  placeholderTitle: t,
3032
3050
  description: n,
@@ -3056,7 +3074,7 @@ const Zr = {
3056
3074
  onClick: m,
3057
3075
  "aria-label": "Edit attachment",
3058
3076
  className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
3059
- children: /* @__PURE__ */ s(Xn, { className: "size-5", weight: "regular" })
3077
+ children: /* @__PURE__ */ s(Zn, { className: "size-5", weight: "regular" })
3060
3078
  }
3061
3079
  ) : void 0;
3062
3080
  return c ? /* @__PURE__ */ s(Pe, { variant: "dark", bgClassName: vt, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
@@ -3103,7 +3121,7 @@ const Zr = {
3103
3121
  ]
3104
3122
  }
3105
3123
  );
3106
- }, ii = ({
3124
+ }, ci = ({
3107
3125
  title: e,
3108
3126
  description: t,
3109
3127
  url: n,
@@ -3156,7 +3174,7 @@ const Zr = {
3156
3174
  ]
3157
3175
  }
3158
3176
  );
3159
- }, oi = ({
3177
+ }, di = ({
3160
3178
  title: e,
3161
3179
  placeholderTitle: t,
3162
3180
  description: n,
@@ -3204,9 +3222,9 @@ const Zr = {
3204
3222
  }
3205
3223
  );
3206
3224
  }, Ht = {
3207
- Composer: ri,
3208
- Sent: oi,
3209
- Received: ii
3225
+ Composer: li,
3226
+ Sent: di,
3227
+ Received: ci
3210
3228
  };
3211
3229
  function P(e) {
3212
3230
  const t = e == null ? void 0 : e.trim();
@@ -3215,7 +3233,7 @@ function P(e) {
3215
3233
  function Yt(e) {
3216
3234
  return e.trim().replace(/^https?:\/\//i, "").replace(/\/+$/, "").toLowerCase();
3217
3235
  }
3218
- function li(e, t) {
3236
+ function ui(e, t) {
3219
3237
  if (!(e != null && e.trim()) || !(t != null && t.trim()))
3220
3238
  return !1;
3221
3239
  const n = Yt(e), a = Yt(t);
@@ -3226,7 +3244,7 @@ function li(e, t) {
3226
3244
  const r = n.split(a).join("");
3227
3245
  return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
3228
3246
  }
3229
- function qt(e) {
3247
+ function Wt(e) {
3230
3248
  const t = P(e.og_scrape_url) ?? P(e.title_link), n = P(e.image_url) ?? P(e.thumb_url), a = P(e.asset_url), r = P(e.mime_type);
3231
3249
  return {
3232
3250
  title: P(e.title),
@@ -3240,15 +3258,15 @@ function qt(e) {
3240
3258
  mimeType: r
3241
3259
  };
3242
3260
  }
3243
- function ci(e) {
3261
+ function mi(e) {
3244
3262
  var t;
3245
- return Rs(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;
3263
+ return Ls(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;
3246
3264
  }
3247
- function Rs(e) {
3265
+ function Ls(e) {
3248
3266
  const t = P(e.og_scrape_url);
3249
3267
  return e.type === "link" || !!t && !e.asset_url;
3250
3268
  }
3251
- function Ls(e) {
3269
+ function Ds(e) {
3252
3270
  if (!(e != null && e.length)) return [];
3253
3271
  const t = [], n = (r, i) => {
3254
3272
  const l = t[t.length - 1];
@@ -3266,45 +3284,45 @@ function Ls(e) {
3266
3284
  t.push({ type: "link", attachments: [r] });
3267
3285
  };
3268
3286
  for (const r of e) {
3269
- if (Rs(r)) {
3287
+ if (Ls(r)) {
3270
3288
  a(r);
3271
3289
  continue;
3272
3290
  }
3273
- const i = ci(r);
3291
+ const i = mi(r);
3274
3292
  i && n(i, r);
3275
3293
  }
3276
3294
  return t;
3277
3295
  }
3278
- function di(e) {
3296
+ function hi(e) {
3279
3297
  return e.filter((t) => t.type === "media").length;
3280
3298
  }
3281
- function ui(e, t, n) {
3299
+ function fi(e, t, n) {
3282
3300
  return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
3283
3301
  }
3284
- function Wt(e) {
3302
+ function qt(e) {
3285
3303
  return P(e.image_url) ?? P(e.asset_url) ?? "";
3286
3304
  }
3287
- function mi(e) {
3305
+ function gi(e) {
3288
3306
  switch (e) {
3289
3307
  case "image":
3290
- return xe.Image;
3308
+ return we.Image;
3291
3309
  case "video":
3292
- return xe.Video;
3310
+ return we.Video;
3293
3311
  case "audio":
3294
- return xe.Audio;
3312
+ return we.Audio;
3295
3313
  case "pdf":
3296
- return xe.Pdf;
3314
+ return we.Pdf;
3297
3315
  default:
3298
- return xe.File;
3316
+ return we.File;
3299
3317
  }
3300
3318
  }
3301
- function hi(e, t) {
3319
+ function pi(e, t) {
3302
3320
  if (t.length > 1)
3303
3321
  switch (e) {
3304
3322
  case "image":
3305
3323
  return {
3306
3324
  items: t.map((a) => ({
3307
- src: Wt(a),
3325
+ src: qt(a),
3308
3326
  alt: P(a.title)
3309
3327
  }))
3310
3328
  };
@@ -3355,7 +3373,7 @@ function hi(e, t) {
3355
3373
  switch (e) {
3356
3374
  case "image":
3357
3375
  return {
3358
- src: Wt(n),
3376
+ src: qt(n),
3359
3377
  alt: P(n.title)
3360
3378
  };
3361
3379
  case "video":
@@ -3385,42 +3403,42 @@ function hi(e, t) {
3385
3403
  };
3386
3404
  }
3387
3405
  }
3388
- function fi({
3406
+ function bi({
3389
3407
  groupPosition: e,
3390
3408
  isMyMessage: t,
3391
3409
  segment: n
3392
3410
  }) {
3393
- const a = mi(n.kind), r = {
3394
- ...hi(n.kind, n.attachments),
3411
+ const a = gi(n.kind), r = {
3412
+ ...pi(n.kind, n.attachments),
3395
3413
  groupPosition: e
3396
3414
  };
3397
3415
  return t ? /* @__PURE__ */ s(a.Sent, { ...r }) : /* @__PURE__ */ s(a.Received, { ...r });
3398
3416
  }
3399
- const gi = ({
3417
+ const vi = ({
3400
3418
  groupPosition: e,
3401
3419
  isMyMessage: t,
3402
3420
  message: n,
3403
3421
  renderText: a
3404
3422
  }) => {
3405
3423
  var v;
3406
- const r = Ls(n.attachments);
3424
+ const r = Ds(n.attachments);
3407
3425
  if (r.length === 0) return null;
3408
- const i = di(r), l = (v = n.text) == null ? void 0 : v.trim(), o = r.find((x) => x.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? qt(o.attachments[0] ?? {}).url : void 0, u = l && li(l, d) ? void 0 : l;
3426
+ const i = hi(r), l = (v = n.text) == null ? void 0 : v.trim(), o = r.find((x) => x.type === "link"), d = (o == null ? void 0 : o.type) === "link" ? Wt(o.attachments[0] ?? {}).url : void 0, u = l && ui(l, d) ? void 0 : l;
3409
3427
  let g = 0;
3410
3428
  const m = [], f = (x, p) => {
3411
3429
  const b = t ? Ht.Sent : Ht.Received;
3412
3430
  m.push(
3413
- /* @__PURE__ */ s(b, { ...qt(x) }, p)
3431
+ /* @__PURE__ */ s(b, { ...Wt(x) }, p)
3414
3432
  );
3415
3433
  }, c = (x, p) => {
3416
- const b = ui(
3434
+ const b = fi(
3417
3435
  g,
3418
3436
  i,
3419
3437
  e
3420
3438
  );
3421
3439
  g += 1, m.push(
3422
3440
  /* @__PURE__ */ s(
3423
- fi,
3441
+ bi,
3424
3442
  {
3425
3443
  groupPosition: b,
3426
3444
  isMyMessage: t,
@@ -3467,7 +3485,7 @@ const gi = ({
3467
3485
  /* @__PURE__ */ s(Ze, {})
3468
3486
  ] }) : null
3469
3487
  ] });
3470
- }, pi = (e) => {
3488
+ }, xi = (e) => {
3471
3489
  var Ct, St, Et, It, Tt, Mt, At, Rt, Lt, Dt;
3472
3490
  const {
3473
3491
  additionalMessageInputProps: t,
@@ -3486,54 +3504,54 @@ const gi = ({
3486
3504
  renderText: v,
3487
3505
  threadList: x,
3488
3506
  viewerLanguage: p
3489
- } = e, { client: b } = ke("CustomMessage"), { channel: w } = ue("CustomMessage"), { isUnlocking: E, onUnlockClick: k, onFetchSource: R, onDownloadClick: A } = zr("LockedAttachment"), [z, B] = F(!1), O = Ks(c.id), { selected: L, voteUp: C, voteDown: T } = ba(c), {
3490
- Attachment: S = Zs,
3491
- EditMessageModal: I = Js,
3507
+ } = e, { client: b } = ke("CustomMessage"), { channel: w } = ue("CustomMessage"), { isUnlocking: E, onUnlockClick: k, onFetchSource: R, onDownloadClick: A } = Fr("LockedAttachment"), [z, B] = F(!1), O = Zs(c.id), { selected: L, voteUp: C, voteDown: T } = xa(c), {
3508
+ Attachment: S = Js,
3509
+ EditMessageModal: I = Qs,
3492
3510
  MessageActions: y,
3493
- MessageBlocked: D = Qs,
3494
- MessageBouncePrompt: H = en,
3495
- MessageDeleted: q = tn,
3496
- MessageIsThreadReplyInChannelButtonIndicator: K = sn,
3497
- MessageRepliesCountButton: Z = nn,
3498
- ReminderNotification: V = an,
3499
- StreamedMessageText: _ = rn,
3511
+ MessageBlocked: D = en,
3512
+ MessageBouncePrompt: H = tn,
3513
+ MessageDeleted: W = sn,
3514
+ MessageIsThreadReplyInChannelButtonIndicator: Z = nn,
3515
+ MessageRepliesCountButton: J = an,
3516
+ ReminderNotification: V = rn,
3517
+ StreamedMessageText: _ = on,
3500
3518
  PinIndicator: M
3501
- } = es("CustomMessage"), $ = on(c), te = ln(c), X = se(
3519
+ } = es("CustomMessage"), $ = ln(c), te = cn(c), X = se(
3502
3520
  () => m == null ? void 0 : m(c),
3503
3521
  [m, c]
3504
3522
  ), U = se(() => {
3505
- const ce = c.attachments ?? [], fe = c.shared_location ? [c.shared_location, ...ce] : ce;
3506
- if (!De(c)) return fe;
3507
- const Pt = fe.filter((zt) => !("type" in zt) || !ps(zt));
3508
- return Pt.length === fe.length ? fe : Pt;
3509
- }, [c]), J = se(
3510
- () => Ls(U),
3523
+ const ce = c.attachments ?? [], ge = c.shared_location ? [c.shared_location, ...ce] : ce;
3524
+ if (!De(c)) return ge;
3525
+ const Pt = ge.filter((zt) => !("type" in zt) || !ps(zt));
3526
+ return Pt.length === ge.length ? ge : Pt;
3527
+ }, [c]), Q = se(
3528
+ () => Ds(U),
3511
3529
  [U]
3512
3530
  ), ae = se(() => {
3513
3531
  const ce = us({ message: c, viewerLanguage: p });
3514
3532
  return ce === c.text ? c : { ...c, text: ce };
3515
- }, [c, p]), Te = J.length > 0, Me = J.reduce(
3516
- (ce, fe) => ce + fe.attachments.length,
3533
+ }, [c, p]), Te = Q.length > 0, Me = Q.reduce(
3534
+ (ce, ge) => ce + ge.attachments.length,
3517
3535
  0
3518
- ) === ((U == null ? void 0 : U.length) ?? 0), re = Ga({
3536
+ ) === ((U == null ? void 0 : U.length) ?? 0), re = Ya({
3519
3537
  endOfGroup: r,
3520
3538
  firstOfGroup: i,
3521
3539
  groupedByUser: l
3522
3540
  });
3523
- if (cn(c))
3541
+ if (dn(c))
3524
3542
  return null;
3525
3543
  if (c.deleted_at || c.type === "deleted")
3526
- return /* @__PURE__ */ s(q, { message: c });
3527
- if (dn(c))
3544
+ return /* @__PURE__ */ s(W, { message: c });
3545
+ if (un(c))
3528
3546
  return /* @__PURE__ */ s(D, {});
3529
- const le = !x && !!c.reply_count, ie = !x && c.show_in_channel && c.parent_id, xt = c.status === "failed" && ((Ct = c.error) == null ? void 0 : Ct.status) !== 403, wt = un(c);
3530
- let me;
3531
- xt ? me = () => u(c) : wt && (me = () => B(!0));
3532
- const Q = f(), Bs = N(
3547
+ const le = !x && !!c.reply_count, ie = !x && c.show_in_channel && c.parent_id, xt = c.status === "failed" && ((Ct = c.error) == null ? void 0 : Ct.status) !== 403, wt = mn(c);
3548
+ let he;
3549
+ xt ? he = () => u(c) : wt && (he = () => B(!0));
3550
+ const ee = f(), $s = N(
3533
3551
  "str-chat__message str-chat__message-simple",
3534
3552
  `str-chat__message--${c.type}`,
3535
3553
  `str-chat__message--${c.status}`,
3536
- Q ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
3554
+ ee ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
3537
3555
  c.text ? "str-chat__message--has-text" : "has-no-text",
3538
3556
  {
3539
3557
  "str-chat__message--has-attachment": $,
@@ -3546,7 +3564,7 @@ const gi = ({
3546
3564
  "str-chat__virtual-message__wrapper--first": i,
3547
3565
  "str-chat__virtual-message__wrapper--group": l
3548
3566
  }
3549
- ), Ue = c.poll_id && b.polls.fromState(c.poll_id), _t = Hr(c), he = De(c), $s = ft(c), je = !!(U != null && U.length && !c.quoted_message), Nt = he && Q && je, Us = Te && Me && !c.quoted_message && !Ue && !X && !he, yt = {
3567
+ ), Ue = c.poll_id && b.polls.fromState(c.poll_id), _t = Wr(c), fe = De(c), Us = ft(c), je = !!(U != null && U.length && !c.quoted_message), Nt = fe && ee && je, js = Te && Me && !c.quoted_message && !Ue && !X && !fe, yt = {
3550
3568
  contentType: "text",
3551
3569
  amountText: (Et = c.metadata) == null ? void 0 : Et.amount_text,
3552
3570
  paymentStatus: (It = c.metadata) == null ? void 0 : It.payment_status,
@@ -3561,7 +3579,7 @@ const gi = ({
3561
3579
  paymentStatus: (Dt = c.metadata) == null ? void 0 : Dt.payment_status,
3562
3580
  onFetchSource: R ? () => R(c, w) : void 0
3563
3581
  };
3564
- return /* @__PURE__ */ h(ee, { children: [
3582
+ return /* @__PURE__ */ h(K, { children: [
3565
3583
  a && /* @__PURE__ */ s(
3566
3584
  I,
3567
3585
  {
@@ -3569,7 +3587,7 @@ const gi = ({
3569
3587
  }
3570
3588
  ),
3571
3589
  z && /* @__PURE__ */ s(
3572
- mn,
3590
+ hn,
3573
3591
  {
3574
3592
  MessageBouncePrompt: H,
3575
3593
  onClose: () => B(!1),
@@ -3579,14 +3597,14 @@ const gi = ({
3579
3597
  /* @__PURE__ */ h(
3580
3598
  "div",
3581
3599
  {
3582
- className: Bs,
3600
+ className: $s,
3583
3601
  "data-message-id": c.id,
3584
3602
  "data-dd-privacy": "mask",
3585
3603
  children: [
3586
3604
  M && /* @__PURE__ */ s(M, {}),
3587
3605
  !!O && /* @__PURE__ */ s(V, { reminder: O }),
3588
3606
  c.user && /* @__PURE__ */ s(
3589
- be,
3607
+ ve,
3590
3608
  {
3591
3609
  className: "str-chat__avatar str-chat__message-sender-avatar",
3592
3610
  id: c.user.id,
@@ -3594,7 +3612,7 @@ const gi = ({
3594
3612
  name: c.user.name || c.user.id,
3595
3613
  size: 24,
3596
3614
  shape: "circle",
3597
- dmAgentEnabled: he
3615
+ dmAgentEnabled: fe
3598
3616
  }
3599
3617
  ),
3600
3618
  /* @__PURE__ */ s(
@@ -3604,19 +3622,19 @@ const gi = ({
3604
3622
  "str-chat__simple-message--error-failed": xt || wt
3605
3623
  }),
3606
3624
  "data-testid": "message-inner",
3607
- onClick: me,
3608
- onKeyDown: me,
3609
- role: me ? "button" : void 0,
3610
- tabIndex: me ? 0 : void 0,
3625
+ onClick: he,
3626
+ onKeyDown: he,
3627
+ role: he ? "button" : void 0,
3628
+ tabIndex: he ? 0 : void 0,
3611
3629
  style: {
3612
3630
  // Force margins to 0 to prevent hover layout shift
3613
3631
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
3614
3632
  marginInlineEnd: 0,
3615
3633
  marginInlineStart: 0
3616
3634
  },
3617
- children: _t ? /* @__PURE__ */ s(qe, { message: c, standalone: !0 }) : Vr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3618
- Q && y && /* @__PURE__ */ s(y, {}),
3619
- Q ? /* @__PURE__ */ s(
3635
+ children: _t ? /* @__PURE__ */ s(We, { message: c, standalone: !0 }) : Hr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3636
+ ee && y && /* @__PURE__ */ s(y, {}),
3637
+ ee ? /* @__PURE__ */ s(
3620
3638
  Re,
3621
3639
  {
3622
3640
  ...yt,
@@ -3631,11 +3649,11 @@ const gi = ({
3631
3649
  onUnlockClick: () => k == null ? void 0 : k(c, w)
3632
3650
  }
3633
3651
  ),
3634
- !Q && y && /* @__PURE__ */ s(y, {})
3635
- ] }) }) : Gr(c) ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
3652
+ !ee && y && /* @__PURE__ */ s(y, {})
3653
+ ] }) }) : Yr(c) ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
3636
3654
  /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3637
- Q && y && /* @__PURE__ */ s(y, {}),
3638
- Q ? /* @__PURE__ */ s(
3655
+ ee && y && /* @__PURE__ */ s(y, {}),
3656
+ ee ? /* @__PURE__ */ s(
3639
3657
  Re,
3640
3658
  {
3641
3659
  ...kt,
@@ -3652,7 +3670,7 @@ const gi = ({
3652
3670
  onDownloadClick: () => A ? A(c, w) : void 0
3653
3671
  }
3654
3672
  ),
3655
- !Q && y && /* @__PURE__ */ s(y, {})
3673
+ !ee && y && /* @__PURE__ */ s(y, {})
3656
3674
  ] }),
3657
3675
  c.text && /* @__PURE__ */ s("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ s(
3658
3676
  Le,
@@ -3661,11 +3679,11 @@ const gi = ({
3661
3679
  renderText: v
3662
3680
  }
3663
3681
  ) })
3664
- ] }) : Us ? /* @__PURE__ */ s(
3665
- gi,
3682
+ ] }) : js ? /* @__PURE__ */ s(
3683
+ vi,
3666
3684
  {
3667
3685
  groupPosition: re,
3668
- isMyMessage: Q,
3686
+ isMyMessage: ee,
3669
3687
  message: {
3670
3688
  ...ae,
3671
3689
  attachments: U,
@@ -3677,15 +3695,15 @@ const gi = ({
3677
3695
  renderText: v
3678
3696
  }
3679
3697
  ) : /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
3680
- he && !Nt && /* @__PURE__ */ s(
3681
- qe,
3698
+ fe && !Nt && /* @__PURE__ */ s(
3699
+ We,
3682
3700
  {
3683
3701
  message: c,
3684
3702
  hasAttachment: je,
3685
- isMyMessage: Q
3703
+ isMyMessage: ee
3686
3704
  }
3687
3705
  ),
3688
- Ue && /* @__PURE__ */ s(hn, { poll: Ue }),
3706
+ Ue && /* @__PURE__ */ s(fn, { poll: Ue }),
3689
3707
  U != null && U.length && !c.quoted_message ? /* @__PURE__ */ s(
3690
3708
  S,
3691
3709
  {
@@ -3710,17 +3728,17 @@ const gi = ({
3710
3728
  ] }) })
3711
3729
  }
3712
3730
  ),
3713
- !$s && !_t && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
3714
- (!he || Nt) && /* @__PURE__ */ s(
3715
- qe,
3731
+ !Us && !_t && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
3732
+ (!fe || Nt) && /* @__PURE__ */ s(
3733
+ We,
3716
3734
  {
3717
3735
  message: c,
3718
3736
  hasAttachment: je,
3719
- isMyMessage: Q
3737
+ isMyMessage: ee
3720
3738
  }
3721
3739
  ),
3722
- n && he && /* @__PURE__ */ s(
3723
- Yr,
3740
+ n && fe && /* @__PURE__ */ s(
3741
+ qr,
3724
3742
  {
3725
3743
  selected: L,
3726
3744
  onVoteUp: C,
@@ -3728,29 +3746,29 @@ const gi = ({
3728
3746
  }
3729
3747
  )
3730
3748
  ] }),
3731
- /* @__PURE__ */ s(Wr, {}),
3749
+ /* @__PURE__ */ s(Zr, {}),
3732
3750
  le && /* @__PURE__ */ s(
3733
- Z,
3751
+ J,
3734
3752
  {
3735
3753
  onClick: d,
3736
3754
  reply_count: c.reply_count
3737
3755
  }
3738
3756
  ),
3739
- ie && /* @__PURE__ */ s(K, {})
3757
+ ie && /* @__PURE__ */ s(Z, {})
3740
3758
  ]
3741
3759
  },
3742
3760
  c.id
3743
3761
  )
3744
3762
  ] });
3745
- }, bi = j.memo(
3746
- pi,
3747
- (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Xs(e, t)
3748
- ), vi = (e) => {
3749
- const t = pe("CustomMessage");
3750
- return /* @__PURE__ */ s(bi, { ...t, ...e });
3751
- }, xi = () => {
3763
+ }, wi = j.memo(
3764
+ xi,
3765
+ (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ks(e, t)
3766
+ ), _i = (e) => {
3767
+ const t = me("CustomMessage");
3768
+ return /* @__PURE__ */ s(wi, { ...t, ...e });
3769
+ }, Ni = () => {
3752
3770
  var n;
3753
- const { handleDelete: e, message: t } = pe("CustomMessageActions");
3771
+ const { handleDelete: e, message: t } = me("CustomMessageActions");
3754
3772
  return ((n = t.metadata) == null ? void 0 : n.payment_status) === "paid" ? null : /* @__PURE__ */ s(
3755
3773
  rs,
3756
3774
  {
@@ -3758,11 +3776,11 @@ const gi = ({
3758
3776
  "aria-label": "Delete",
3759
3777
  title: "Delete",
3760
3778
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
3761
- children: /* @__PURE__ */ s(Kn, { size: 16, weight: "light", "aria-hidden": !0 })
3779
+ children: /* @__PURE__ */ s(Jn, { size: 16, weight: "light", "aria-hidden": !0 })
3762
3780
  }
3763
3781
  );
3764
- }, wi = () => {
3765
- const { handleFlag: e } = pe("CustomMessageActions");
3782
+ }, yi = () => {
3783
+ const { handleFlag: e } = me("CustomMessageActions");
3766
3784
  return /* @__PURE__ */ s(
3767
3785
  rs,
3768
3786
  {
@@ -3773,19 +3791,19 @@ const gi = ({
3773
3791
  children: /* @__PURE__ */ s(ts, { size: 16, weight: "light", "aria-hidden": !0 })
3774
3792
  }
3775
3793
  );
3776
- }, _i = () => {
3794
+ }, ki = () => {
3777
3795
  var t;
3778
- const { message: e } = pe("CustomMessageActions");
3796
+ const { message: e } = me("CustomMessageActions");
3779
3797
  return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ s(
3780
- ea,
3798
+ sa,
3781
3799
  {
3782
3800
  messageActionSet: [
3783
- { Component: xi, placement: "quick", type: "delete" },
3784
- { Component: wi, placement: "quick", type: "flag" }
3801
+ { Component: Ni, placement: "quick", type: "delete" },
3802
+ { Component: yi, placement: "quick", type: "flag" }
3785
3803
  ]
3786
3804
  }
3787
3805
  );
3788
- }, Ni = ({
3806
+ }, Ci = ({
3789
3807
  link: e,
3790
3808
  onDismiss: t
3791
3809
  }) => {
@@ -3825,14 +3843,14 @@ const gi = ({
3825
3843
  ]
3826
3844
  }
3827
3845
  );
3828
- }, yi = (e) => ({
3846
+ }, Si = (e) => ({
3829
3847
  linkPreviews: Array.from(e.previews.values()).filter(
3830
3848
  (t) => Ot.previewIsLoaded(t) || Ot.previewIsLoading(t)
3831
3849
  )
3832
- }), ki = () => {
3833
- const { linkPreviewsManager: e } = fn(), { linkPreviews: t } = gn(
3850
+ }), Ei = () => {
3851
+ const { linkPreviewsManager: e } = gn(), { linkPreviews: t } = pn(
3834
3852
  e.state,
3835
- yi
3853
+ Si
3836
3854
  ), n = (r) => {
3837
3855
  e.dismissPreview(r);
3838
3856
  };
@@ -3845,9 +3863,9 @@ const gi = ({
3845
3863
  // block so it keeps its intrinsic height and the container scrolls — a
3846
3864
  // bare flex-column child would be shrunk on the column axis and its
3847
3865
  // fixed-height hero would spill out of the collapsed card box.
3848
- /* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(Ni, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
3866
+ /* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 overflow-y-auto overscroll-contain", children: t.map((r) => /* @__PURE__ */ s("div", { className: "w-full shrink-0", children: /* @__PURE__ */ s(Ci, { link: r, onDismiss: n }) }, r.og_scrape_url)) })
3849
3867
  ) : null;
3850
- }, Oe = j.createContext(!1), Ci = 200, po = () => ye(Oe), Si = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
3868
+ }, Oe = j.createContext(!1), Ii = 200, xo = () => ye(Oe), Ti = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
3851
3869
  "button",
3852
3870
  {
3853
3871
  ...n,
@@ -3856,12 +3874,12 @@ const gi = ({
3856
3874
  disabled: t,
3857
3875
  onPointerDown: (a) => a.preventDefault(),
3858
3876
  onClick: e,
3859
- children: /* @__PURE__ */ s(Zn, { weight: "bold", className: "size-4" })
3877
+ children: /* @__PURE__ */ s(Qn, { weight: "bold", className: "size-4" })
3860
3878
  }
3861
3879
  ), Xt = () => {
3862
- const e = ye(Oe), { handleSubmit: t } = pn(), n = bn(), a = e || !n, {
3863
- SendButton: r = Si,
3864
- AttachmentPreviewList: i = vn
3880
+ const e = ye(Oe), { handleSubmit: t } = bn(), n = vn(), a = e || !n, {
3881
+ SendButton: r = Ti,
3882
+ AttachmentPreviewList: i = xn
3865
3883
  } = es("CustomMessageInput");
3866
3884
  return (
3867
3885
  // min-h-0 lets the composer shrink under keyboard squeeze (the link
@@ -3892,13 +3910,13 @@ const gi = ({
3892
3910
  "data-dd-privacy": "mask",
3893
3911
  children: [
3894
3912
  /* @__PURE__ */ h("div", { className: "messaging-composer-previews empty:hidden flex min-h-0 flex-col gap-2 px-2 pt-2", children: [
3895
- /* @__PURE__ */ s(xn, {}),
3896
- /* @__PURE__ */ s(ki, {}),
3913
+ /* @__PURE__ */ s(wn, {}),
3914
+ /* @__PURE__ */ s(Ei, {}),
3897
3915
  /* @__PURE__ */ s(i, {})
3898
3916
  ] }),
3899
3917
  /* @__PURE__ */ h("div", { className: "messaging-composer-row flex shrink-0 items-start", children: [
3900
3918
  /* @__PURE__ */ s(
3901
- wn,
3919
+ _n,
3902
3920
  {
3903
3921
  "aria-disabled": e || void 0,
3904
3922
  containerClassName: "min-w-0 flex-1 leading-[0]",
@@ -3948,7 +3966,7 @@ const gi = ({
3948
3966
  c = p;
3949
3967
  const w = Array.from(
3950
3968
  f.querySelectorAll(".str-chat__list")
3951
- ).find((k) => k.scrollHeight > k.clientHeight) ?? null, E = w ? w.scrollHeight - w.scrollTop - w.clientHeight < Ci : !1;
3969
+ ).find((k) => k.scrollHeight > k.clientHeight) ?? null, E = w ? w.scrollHeight - w.scrollTop - w.clientHeight < Ii : !1;
3952
3970
  f.style.setProperty(
3953
3971
  "--messaging-composer-height",
3954
3972
  `${p}px`
@@ -3981,7 +3999,7 @@ const gi = ({
3981
3999
  ] })
3982
4000
  ]
3983
4001
  }
3984
- ) : /* @__PURE__ */ h(ee, { children: [
4002
+ ) : /* @__PURE__ */ h(K, { children: [
3985
4003
  t == null ? void 0 : t(),
3986
4004
  /* @__PURE__ */ s("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: r ? /* @__PURE__ */ s("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: r }) : null }),
3987
4005
  n == null ? void 0 : n()
@@ -4035,22 +4053,22 @@ const gi = ({
4035
4053
  ),
4036
4054
  n == null ? void 0 : n()
4037
4055
  ] });
4038
- }, Ei = [
4056
+ }, Mi = [
4039
4057
  "SYSTEM_DM_AGENT_PAUSED",
4040
4058
  "SYSTEM_DM_AGENT_RESUMED"
4041
- ], Ii = {
4059
+ ], Ai = {
4042
4060
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
4043
4061
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
4044
- }, Ti = [
4062
+ }, Ri = [
4045
4063
  "SYSTEM_AGE_SAFETY_BLOCKED"
4046
- ], Mi = ["SYSTEM_AGE_SAFETY_BLOCKED"], Ai = {
4064
+ ], Li = ["SYSTEM_AGE_SAFETY_BLOCKED"], Di = {
4047
4065
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
4048
- }, Xe = "age safety guidelines.", Ri = "https://linktr.ee/s/about/contact", Zt = (e) => Ei.includes(e), Li = (e) => Ti.includes(e), Di = (e) => Mi.includes(
4066
+ }, Xe = "age safety guidelines.", Pi = "https://linktr.ee/s/about/contact", Zt = (e) => Mi.includes(e), zi = (e) => Ri.includes(e), Oi = (e) => Li.includes(
4049
4067
  e
4050
- ), Pi = (e) => {
4068
+ ), Fi = (e) => {
4051
4069
  var t;
4052
- return Di((t = e.metadata) == null ? void 0 : t.custom_type);
4053
- }, zi = (e) => {
4070
+ return Oi((t = e.metadata) == null ? void 0 : t.custom_type);
4071
+ }, Bi = (e) => {
4054
4072
  var a;
4055
4073
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
4056
4074
  if (Zt(t))
@@ -4058,7 +4076,7 @@ const gi = ({
4058
4076
  kind: "dm-agent",
4059
4077
  type: t
4060
4078
  };
4061
- if (Li(t))
4079
+ if (zi(t))
4062
4080
  return {
4063
4081
  kind: "age-safety",
4064
4082
  type: t
@@ -4069,17 +4087,17 @@ const gi = ({
4069
4087
  kind: "dm-agent",
4070
4088
  type: n
4071
4089
  };
4072
- }, Oi = (e) => {
4090
+ }, $i = (e) => {
4073
4091
  const t = e.indexOf(Xe);
4074
4092
  if (t === -1)
4075
4093
  return e;
4076
4094
  const n = t + Xe.length;
4077
- return /* @__PURE__ */ h(ee, { children: [
4095
+ return /* @__PURE__ */ h(K, { children: [
4078
4096
  e.slice(0, t),
4079
4097
  /* @__PURE__ */ s(
4080
4098
  "a",
4081
4099
  {
4082
- href: Ri,
4100
+ href: Pi,
4083
4101
  target: "_blank",
4084
4102
  rel: "noopener noreferrer",
4085
4103
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
@@ -4088,13 +4106,13 @@ const gi = ({
4088
4106
  ),
4089
4107
  e.slice(n)
4090
4108
  ] });
4091
- }, Fi = (e) => {
4109
+ }, Ui = (e) => {
4092
4110
  var a, r;
4093
- const t = !Pi(e.message), n = zi(
4111
+ const t = !Fi(e.message), n = Bi(
4094
4112
  e.message
4095
4113
  );
4096
4114
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
4097
- const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ii[n.type];
4115
+ const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ai[n.type];
4098
4116
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
4099
4117
  /* @__PURE__ */ h(
4100
4118
  "div",
@@ -4104,7 +4122,7 @@ const gi = ({
4104
4122
  "data-dm-agent-system-type": n.type,
4105
4123
  children: [
4106
4124
  /* @__PURE__ */ s(
4107
- Jn,
4125
+ ea,
4108
4126
  {
4109
4127
  size: 16,
4110
4128
  weight: "regular",
@@ -4120,7 +4138,7 @@ const gi = ({
4120
4138
  ] });
4121
4139
  }
4122
4140
  if ((n == null ? void 0 : n.kind) === "age-safety") {
4123
- const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ai[n.type];
4141
+ const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Di[n.type];
4124
4142
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
4125
4143
  /* @__PURE__ */ h(
4126
4144
  "div",
@@ -4130,7 +4148,7 @@ const gi = ({
4130
4148
  "data-age-safety-system-type": n.type,
4131
4149
  children: [
4132
4150
  /* @__PURE__ */ s(
4133
- Qn,
4151
+ ta,
4134
4152
  {
4135
4153
  size: 24,
4136
4154
  weight: "duotone",
@@ -4139,7 +4157,7 @@ const gi = ({
4139
4157
  "data-testid": "age-safety-system-message-icon"
4140
4158
  }
4141
4159
  ),
4142
- /* @__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: Oi(i) }) })
4160
+ /* @__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: $i(i) }) })
4143
4161
  ]
4144
4162
  }
4145
4163
  ),
@@ -4154,7 +4172,7 @@ const gi = ({
4154
4172
  ] }),
4155
4173
  !t && /* @__PURE__ */ s(Ve, { message: e.message })
4156
4174
  ] });
4157
- }, Ds = st(!1), Ke = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
4175
+ }, Ps = st(!1), Ke = ({ cx: e, index: t }) => /* @__PURE__ */ s("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ s(
4158
4176
  "animateTransform",
4159
4177
  {
4160
4178
  attributeName: "transform",
@@ -4164,15 +4182,15 @@ const gi = ({
4164
4182
  begin: `${120 * t}ms`,
4165
4183
  repeatCount: "indefinite"
4166
4184
  }
4167
- ) }), Bi = /* @__PURE__ */ new Set([
4185
+ ) }), ji = /* @__PURE__ */ new Set([
4168
4186
  Ge.Thinking,
4169
4187
  Ge.Generating,
4170
4188
  Ge.ExternalSources
4171
- ]), $i = ({ threadList: e }) => {
4189
+ ]), Vi = ({ threadList: e }) => {
4172
4190
  var v, x;
4173
- const { channel: t, channelConfig: n, thread: a } = ue(), { client: r } = ke(), { typing: i = {} } = _n(), { aiState: l } = Nn(t), o = ye(Ds);
4174
- if (!e && o && Bi.has(l)) {
4175
- const p = Ui(t, (v = r.user) == null ? void 0 : v.id);
4191
+ const { channel: t, channelConfig: n, thread: a } = ue(), { client: r } = ke(), { typing: i = {} } = Nn(), { aiState: l } = yn(t), o = ye(Ps);
4192
+ if (!e && o && ji.has(l)) {
4193
+ const p = Gi(t, (v = r.user) == null ? void 0 : v.id);
4176
4194
  return /* @__PURE__ */ s(
4177
4195
  Jt,
4178
4196
  {
@@ -4223,7 +4241,7 @@ const gi = ({
4223
4241
  },
4224
4242
  children: /* @__PURE__ */ h("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
4225
4243
  /* @__PURE__ */ s(
4226
- be,
4244
+ ve,
4227
4245
  {
4228
4246
  className: "str-chat__avatar str-chat__message-sender-avatar",
4229
4247
  id: e,
@@ -4252,7 +4270,7 @@ const gi = ({
4252
4270
  ] })
4253
4271
  }
4254
4272
  );
4255
- function Ui(e, t) {
4273
+ function Gi(e, t) {
4256
4274
  var a;
4257
4275
  const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
4258
4276
  for (const r of Object.values(n)) {
@@ -4261,7 +4279,7 @@ function Ui(e, t) {
4261
4279
  return i;
4262
4280
  }
4263
4281
  }
4264
- const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ h(
4282
+ const Hi = () => null, Yi = ({ className: e, message: t }) => /* @__PURE__ */ h(
4265
4283
  "div",
4266
4284
  {
4267
4285
  className: N("flex items-center justify-center h-full", e),
@@ -4305,11 +4323,11 @@ const ji = () => null, Vi = ({ className: e, message: t }) => /* @__PURE__ */ h(
4305
4323
  ]
4306
4324
  }
4307
4325
  ), Fe = j.memo(() => /* @__PURE__ */ s("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
4308
- /* @__PURE__ */ s(Vi, { className: "w-6 h-6" }),
4326
+ /* @__PURE__ */ s(Yi, { className: "w-6 h-6" }),
4309
4327
  /* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
4310
4328
  ] }) }));
4311
4329
  Fe.displayName = "LoadingState";
4312
- const Gi = ({
4330
+ const Wi = ({
4313
4331
  onBack: e,
4314
4332
  showBackButton: t,
4315
4333
  renderMessageInputActions: n,
@@ -4339,7 +4357,7 @@ const Gi = ({
4339
4357
  const { channel: O } = ue(), L = O.state.messages.some(
4340
4358
  (I) => I.type !== "deleted"
4341
4359
  ), C = b ? /* @__PURE__ */ s(j.Fragment, { children: b() }, "lt-channel-banner") : null, T = /* @__PURE__ */ s(
4342
- fa,
4360
+ pa,
4343
4361
  {
4344
4362
  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%)]",
4345
4363
  onBack: e,
@@ -4358,10 +4376,10 @@ const Gi = ({
4358
4376
  renderChannelActions: E,
4359
4377
  onParticipantNameClick: z
4360
4378
  }
4361
- ), S = W(
4379
+ ), S = q(
4362
4380
  (I) => {
4363
- const { message: y } = pe("ChannelView"), D = /* @__PURE__ */ s(
4364
- vi,
4381
+ const { message: y } = me("ChannelView"), D = /* @__PURE__ */ s(
4382
+ _i,
4365
4383
  {
4366
4384
  ...I,
4367
4385
  chatbotVotingEnabled: p,
@@ -4372,16 +4390,16 @@ const Gi = ({
4372
4390
  },
4373
4391
  [p, k, R]
4374
4392
  );
4375
- return /* @__PURE__ */ s(ee, { children: /* @__PURE__ */ s(
4376
- kn,
4393
+ return /* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(
4394
+ Cn,
4377
4395
  {
4378
4396
  overrides: {
4379
4397
  Message: S,
4380
- MessageActions: _i,
4398
+ MessageActions: ki,
4381
4399
  UnreadMessagesNotification: () => null,
4382
4400
  UnreadMessagesSeparator: () => null
4383
4401
  },
4384
- children: /* @__PURE__ */ s(Cn, { children: B ? /* @__PURE__ */ h("div", { className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col", children: [
4402
+ children: /* @__PURE__ */ s(Sn, { children: B ? /* @__PURE__ */ h("div", { className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col", children: [
4385
4403
  /* @__PURE__ */ h(
4386
4404
  "div",
4387
4405
  {
@@ -4422,7 +4440,7 @@ const Gi = ({
4422
4440
  },
4423
4441
  "lt-channel-message-input"
4424
4442
  )
4425
- ] }) : /* @__PURE__ */ h(ee, { children: [
4443
+ ] }) : /* @__PURE__ */ h(K, { children: [
4426
4444
  /* @__PURE__ */ h(
4427
4445
  "div",
4428
4446
  {
@@ -4464,7 +4482,7 @@ const Gi = ({
4464
4482
  ] }) })
4465
4483
  }
4466
4484
  ) });
4467
- }, Ps = j.memo(
4485
+ }, zs = j.memo(
4468
4486
  ({
4469
4487
  channel: e,
4470
4488
  onBack: t,
@@ -4475,7 +4493,7 @@ const Gi = ({
4475
4493
  onLeaveConversation: l,
4476
4494
  onBlockParticipant: o,
4477
4495
  className: d,
4478
- CustomChannelEmptyState: u = ji,
4496
+ CustomChannelEmptyState: u = Hi,
4479
4497
  showDeleteConversation: g = !0,
4480
4498
  onDeleteConversationClick: m,
4481
4499
  onBlockParticipantClick: f,
@@ -4501,10 +4519,10 @@ const Gi = ({
4501
4519
  onParticipantNameClick: D,
4502
4520
  composerInput: H
4503
4521
  }) => {
4504
- const q = W(
4505
- async (Z, V, _) => {
4506
- var J;
4507
- const M = ((J = e.data) == null ? void 0 : J.chatbot_paused) === !0, $ = w && !M, te = {
4522
+ const W = q(
4523
+ async (J, V, _) => {
4524
+ var Q;
4525
+ const M = ((Q = e.data) == null ? void 0 : Q.chatbot_paused) === !0, $ = w && !M, te = {
4508
4526
  ...V,
4509
4527
  ...$ && { silent: !0 },
4510
4528
  ...E && {
@@ -4520,40 +4538,40 @@ const Gi = ({
4520
4538
  return k == null || k(U), U;
4521
4539
  },
4522
4540
  [e, w, E, k]
4523
- ), K = G(null);
4541
+ ), Z = G(null);
4524
4542
  return Y(() => {
4525
4543
  if (!C) return;
4526
- const Z = K.current;
4527
- if (!Z) return;
4544
+ const J = Z.current;
4545
+ if (!J) return;
4528
4546
  const V = (_) => {
4529
4547
  const M = _.target, $ = M == null ? void 0 : M.closest("a[href]"), te = $ == null ? void 0 : $.getAttribute("href");
4530
4548
  if (!te) return;
4531
- const X = $ == null ? void 0 : $.closest("[data-message-id]"), U = X == null ? void 0 : X.getAttribute("data-message-id"), J = U ? e.state.messages.find((ae) => ae.id === U) : void 0;
4532
- C(te, J);
4549
+ const X = $ == null ? void 0 : $.closest("[data-message-id]"), U = X == null ? void 0 : X.getAttribute("data-message-id"), Q = U ? e.state.messages.find((ae) => ae.id === U) : void 0;
4550
+ C(te, Q);
4533
4551
  };
4534
- return Z.addEventListener("click", V), () => Z.removeEventListener("click", V);
4552
+ return J.addEventListener("click", V), () => J.removeEventListener("click", V);
4535
4553
  }, [C, e]), /* @__PURE__ */ s(
4536
4554
  "div",
4537
4555
  {
4538
- ref: K,
4556
+ ref: Z,
4539
4557
  className: N(
4540
4558
  "messaging-channel-view h-full flex flex-col",
4541
4559
  d
4542
4560
  ),
4543
- children: /* @__PURE__ */ s(Ds.Provider, { value: w ?? !1, children: /* @__PURE__ */ s(
4544
- yn,
4561
+ children: /* @__PURE__ */ s(Ps.Provider, { value: w ?? !1, children: /* @__PURE__ */ s(
4562
+ kn,
4545
4563
  {
4546
4564
  channel: e,
4547
- MessageSystem: Fi,
4565
+ MessageSystem: Ui,
4548
4566
  EmptyStateIndicator: u,
4549
4567
  LoadingIndicator: Fe,
4550
- DateSeparator: ga,
4551
- TypingIndicator: $i,
4552
- doSendMessageRequest: q,
4568
+ DateSeparator: ba,
4569
+ TypingIndicator: Vi,
4570
+ doSendMessageRequest: W,
4553
4571
  ...T ? { SendButton: T } : {},
4554
4572
  ...S ? { AttachmentPreviewList: S } : {},
4555
4573
  children: /* @__PURE__ */ s(
4556
- Gi,
4574
+ Wi,
4557
4575
  {
4558
4576
  onBack: t,
4559
4577
  showBackButton: n,
@@ -4589,8 +4607,8 @@ const Gi = ({
4589
4607
  );
4590
4608
  }
4591
4609
  );
4592
- Ps.displayName = "ChannelView";
4593
- const we = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
4610
+ zs.displayName = "ChannelView";
4611
+ const _e = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
4594
4612
  /* @__PURE__ */ s("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ s("span", { className: "text-4xl", children: "⚠️" }) }),
4595
4613
  /* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
4596
4614
  /* @__PURE__ */ s("p", { className: "text-stone text-sm mb-6", children: e }),
@@ -4604,8 +4622,8 @@ const we = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
4604
4622
  }
4605
4623
  )
4606
4624
  ] }) }));
4607
- we.displayName = "ErrorState";
4608
- const bo = ({
4625
+ _e.displayName = "ErrorState";
4626
+ const wo = ({
4609
4627
  capabilities: e = {},
4610
4628
  renderMessageInputActions: t,
4611
4629
  renderConversationFooter: n,
@@ -4637,8 +4655,8 @@ const bo = ({
4637
4655
  refreshConnection: L,
4638
4656
  service: C,
4639
4657
  debug: T
4640
- } = ta(), [S, I] = F(null), [y, D] = F(null), [H, q] = F(!1), { showDeleteConversation: K = !0 } = e, Z = G(l);
4641
- Z.current = l;
4658
+ } = na(), [S, I] = F(null), [y, D] = F(null), [H, W] = F(!1), { showDeleteConversation: Z = !0 } = e, J = G(l);
4659
+ J.current = l;
4642
4660
  const V = G(a);
4643
4661
  V.current = a;
4644
4662
  const _ = G(null), M = G(null);
@@ -4651,7 +4669,7 @@ const bo = ({
4651
4669
  const U = `${X}::${i}`;
4652
4670
  if (_.current === U) return;
4653
4671
  _.current = U;
4654
- const J = () => {
4672
+ const Q = () => {
4655
4673
  _.current === U && (_.current = null);
4656
4674
  };
4657
4675
  (async () => {
@@ -4676,9 +4694,9 @@ const bo = ({
4676
4694
  );
4677
4695
  return;
4678
4696
  }
4679
- const le = Z.current;
4697
+ const le = J.current;
4680
4698
  if (!le || !C) {
4681
- J(), D("No conversation found with this account"), T && console.log(
4699
+ Q(), D("No conversation found with this account"), T && console.log(
4682
4700
  "[MessagingShell] No conversation found for:",
4683
4701
  i
4684
4702
  );
@@ -4698,30 +4716,30 @@ const bo = ({
4698
4716
  console.error(
4699
4717
  "[MessagingShell] Failed to create conversation:",
4700
4718
  ie
4701
- ), J(), D("Failed to create conversation");
4719
+ ), Q(), D("Failed to create conversation");
4702
4720
  }
4703
4721
  } catch (re) {
4704
4722
  console.error(
4705
4723
  "[MessagingShell] Failed to load initial conversation:",
4706
4724
  re
4707
- ), J(), M.current || D("Failed to load conversation");
4725
+ ), Q(), M.current || D("Failed to load conversation");
4708
4726
  }
4709
4727
  })();
4710
4728
  }, [i, A, z, C, T]);
4711
4729
  const $ = G(r);
4712
4730
  $.current = r;
4713
- const te = W(() => {
4731
+ const te = q(() => {
4714
4732
  var X;
4715
- I(null), q(!0), (X = $.current) == null || X.call($);
4733
+ I(null), W(!0), (X = $.current) == null || X.call($);
4716
4734
  }, []);
4717
- return B ? /* @__PURE__ */ s(Fe, {}) : O ? /* @__PURE__ */ s(we, { message: O, onBack: L }) : !z || !A ? /* @__PURE__ */ s(
4718
- we,
4735
+ return B ? /* @__PURE__ */ s(Fe, {}) : O ? /* @__PURE__ */ s(_e, { message: O, onBack: L }) : !z || !A ? /* @__PURE__ */ s(
4736
+ _e,
4719
4737
  {
4720
4738
  message: "Not connected to messaging service",
4721
4739
  onBack: L
4722
4740
  }
4723
- ) : y ? /* @__PURE__ */ s(we, { message: y }) : H && !S ? /* @__PURE__ */ s(we, { message: "Conversation ended" }) : S ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
4724
- Ps,
4741
+ ) : y ? /* @__PURE__ */ s(_e, { message: y }) : H && !S ? /* @__PURE__ */ s(_e, { message: "Conversation ended" }) : S ? /* @__PURE__ */ s("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ s("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ s(
4742
+ zs,
4725
4743
  {
4726
4744
  channel: S,
4727
4745
  renderMessageInputActions: t,
@@ -4730,7 +4748,7 @@ const bo = ({
4730
4748
  onLeaveConversation: te,
4731
4749
  onBlockParticipant: te,
4732
4750
  CustomChannelEmptyState: o,
4733
- showDeleteConversation: K,
4751
+ showDeleteConversation: Z,
4734
4752
  onBlockParticipantClick: d,
4735
4753
  onReportParticipantClick: u,
4736
4754
  dmAgentEnabled: g,
@@ -4748,13 +4766,13 @@ const bo = ({
4748
4766
  S.id
4749
4767
  ) }) }) : /* @__PURE__ */ s(Fe, {});
4750
4768
  };
4751
- function Hi(e) {
4769
+ function qi(e) {
4752
4770
  const t = e.state.pending_messages;
4753
4771
  if (t != null && t.length)
4754
4772
  for (const n of t)
4755
4773
  e.state.addMessageSorted(n.message);
4756
4774
  }
4757
- const zs = j.createContext({
4775
+ const Os = j.createContext({
4758
4776
  selectedChannel: void 0,
4759
4777
  onChannelSelect: () => {
4760
4778
  },
@@ -4762,18 +4780,18 @@ const zs = j.createContext({
4762
4780
  renderMessagePreview: void 0,
4763
4781
  channelPreview: void 0,
4764
4782
  viewerLanguage: void 0
4765
- }), Yi = zs.Provider, qi = () => j.useContext(zs), Wi = (e, t) => {
4783
+ }), Xi = Os.Provider, Ki = () => j.useContext(Os), Zi = (e, t) => {
4766
4784
  const n = new Date(
4767
4785
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
4768
4786
  ), r = new Date(
4769
4787
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
4770
4788
  ).getTime() - n.getTime();
4771
4789
  return Math.floor(r / (1e3 * 60 * 60 * 24));
4772
- }, Xi = (e) => {
4790
+ }, Ji = (e) => {
4773
4791
  const t = /* @__PURE__ */ new Date();
4774
4792
  if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
4775
4793
  return "Just now";
4776
- const a = Wi(e, t);
4794
+ const a = Zi(e, t);
4777
4795
  return a === 0 ? e.toLocaleTimeString([], {
4778
4796
  hour: "numeric",
4779
4797
  minute: "2-digit",
@@ -4783,7 +4801,7 @@ const zs = j.createContext({
4783
4801
  month: "short",
4784
4802
  year: "2-digit"
4785
4803
  });
4786
- }, Os = j.memo(
4804
+ }, Fs = j.memo(
4787
4805
  (e) => {
4788
4806
  var B, O, L;
4789
4807
  const { channel: t, unread: n } = e, {
@@ -4793,7 +4811,7 @@ const zs = j.createContext({
4793
4811
  channelPreview: l,
4794
4812
  renderMessagePreview: o,
4795
4813
  viewerLanguage: d
4796
- } = qi(), { client: u } = ke(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = os(t);
4814
+ } = Ki(), { client: u } = ke(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = os(t);
4797
4815
  if (l)
4798
4816
  return /* @__PURE__ */ s(
4799
4817
  l,
@@ -4840,7 +4858,7 @@ const zs = j.createContext({
4840
4858
  if (C) return C;
4841
4859
  const I = (y = b == null ? void 0 : b.attachments) == null ? void 0 : y[0];
4842
4860
  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";
4843
- })(), k = b != null && b.created_at ? Xi(new Date(b.created_at)) : "", R = b ? De(b) : !1, A = o ? o(b, E) : `${R ? "✨ " : ""}${E}`, z = n ?? 0;
4861
+ })(), k = b != null && b.created_at ? Ji(new Date(b.created_at)) : "", R = b ? De(b) : !1, A = o ? o(b, E) : `${R ? "✨ " : ""}${E}`, z = n ?? 0;
4844
4862
  return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
4845
4863
  channelId: t == null ? void 0 : t.id,
4846
4864
  isSelected: g,
@@ -4864,7 +4882,7 @@ const zs = j.createContext({
4864
4882
  "data-dd-privacy": "mask",
4865
4883
  children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
4866
4884
  /* @__PURE__ */ s(
4867
- be,
4885
+ ve,
4868
4886
  {
4869
4887
  id: ((L = v == null ? void 0 : v.user) == null ? void 0 : L.id) || t.id || "unknown",
4870
4888
  name: x,
@@ -4899,18 +4917,18 @@ const zs = j.createContext({
4899
4917
  );
4900
4918
  }
4901
4919
  );
4902
- Os.displayName = "CustomChannelPreview";
4903
- const Ki = { last_message_at: -1 }, Zi = j.memo(
4920
+ Fs.displayName = "CustomChannelPreview";
4921
+ const Qi = { last_message_at: -1 }, eo = j.memo(
4904
4922
  ({
4905
4923
  onChannelSelect: e,
4906
4924
  selectedChannel: t,
4907
4925
  filters: n,
4908
4926
  allowNewMessagesFromUnfilteredChannels: a = !1,
4909
4927
  channelRenderFilterFn: r,
4910
- sort: i = Ki,
4928
+ sort: i = Qi,
4911
4929
  className: l,
4912
4930
  customEmptyStateIndicator: o,
4913
- channelListPaginator: d = En,
4931
+ channelListPaginator: d = In,
4914
4932
  channelPreview: u,
4915
4933
  renderMessagePreview: g,
4916
4934
  viewerLanguage: m,
@@ -4926,7 +4944,7 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
4926
4944
  const { debug: E = !1 } = nt(), k = j.useCallback(
4927
4945
  (A) => {
4928
4946
  for (const z of A)
4929
- Hi(z);
4947
+ qi(z);
4930
4948
  return r ? r(A) : A;
4931
4949
  },
4932
4950
  [r]
@@ -4961,8 +4979,8 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
4961
4979
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
4962
4980
  l
4963
4981
  ),
4964
- children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Yi, { value: R, children: /* @__PURE__ */ s(
4965
- Sn,
4982
+ children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Xi, { value: R, children: /* @__PURE__ */ s(
4983
+ En,
4966
4984
  {
4967
4985
  filters: n,
4968
4986
  sort: i,
@@ -4976,7 +4994,7 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
4976
4994
  onAddedToChannel: p,
4977
4995
  onChannelUpdated: b,
4978
4996
  Paginator: d,
4979
- Preview: Os,
4997
+ Preview: Fs,
4980
4998
  EmptyStateIndicator: o
4981
4999
  },
4982
5000
  `${JSON.stringify(n)}:${JSON.stringify(i)}`
@@ -4985,11 +5003,11 @@ const Ki = { last_message_at: -1 }, Zi = j.memo(
4985
5003
  );
4986
5004
  }
4987
5005
  );
4988
- Zi.displayName = "ChannelList";
4989
- const Qt = `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%`, Ji = {
5006
+ eo.displayName = "ChannelList";
5007
+ const Qt = `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%`, to = {
4990
5008
  sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
4991
5009
  received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
4992
- }, Qi = ({ variant: e }) => /* @__PURE__ */ s(
5010
+ }, so = ({ variant: e }) => /* @__PURE__ */ s(
4993
5011
  "span",
4994
5012
  {
4995
5013
  "aria-hidden": "true",
@@ -4999,12 +5017,12 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
4999
5017
  insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
5000
5018
  transform: e === "received" ? "scaleX(-1)" : void 0,
5001
5019
  transformOrigin: "center",
5002
- backgroundColor: Ji[e],
5020
+ backgroundColor: to[e],
5003
5021
  WebkitMask: Qt,
5004
5022
  mask: Qt
5005
5023
  }
5006
5024
  }
5007
- ), eo = {
5025
+ ), no = {
5008
5026
  sent: {
5009
5027
  backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
5010
5028
  color: "var(--str-chat__own-message-bubble-color, #fff)"
@@ -5013,7 +5031,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5013
5031
  backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
5014
5032
  color: "var(--str-chat__message-bubble-color, #000000)"
5015
5033
  }
5016
- }, Fs = ({
5034
+ }, Bs = ({
5017
5035
  variant: e,
5018
5036
  text: t,
5019
5037
  tail: n = !0,
@@ -5029,23 +5047,23 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5029
5047
  r
5030
5048
  ),
5031
5049
  style: {
5032
- ...eo[e],
5050
+ ...no[e],
5033
5051
  borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
5034
5052
  isolation: "isolate"
5035
5053
  },
5036
5054
  children: [
5037
5055
  a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
5038
5056
  /* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
5039
- n && /* @__PURE__ */ s(Qi, { variant: e })
5057
+ n && /* @__PURE__ */ s(so, { variant: e })
5040
5058
  ]
5041
5059
  }
5042
- ), to = ({
5060
+ ), ao = ({
5043
5061
  text: e,
5044
5062
  tail: t,
5045
5063
  header: n,
5046
5064
  className: a
5047
5065
  }) => /* @__PURE__ */ s(
5048
- Fs,
5066
+ Bs,
5049
5067
  {
5050
5068
  variant: "received",
5051
5069
  text: e,
@@ -5053,10 +5071,10 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5053
5071
  header: n,
5054
5072
  className: a
5055
5073
  }
5056
- ), so = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Fs, { variant: "sent", text: e, tail: t, className: n }), vo = {
5057
- Sent: so,
5058
- Received: to
5059
- }, no = ({
5074
+ ), ro = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Bs, { variant: "sent", text: e, tail: t, className: n }), _o = {
5075
+ Sent: ro,
5076
+ Received: ao
5077
+ }, io = ({
5060
5078
  question: e,
5061
5079
  onClick: t,
5062
5080
  loading: n = !1,
@@ -5078,7 +5096,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5078
5096
  ),
5079
5097
  children: e
5080
5098
  }
5081
- ), xo = ({
5099
+ ), No = ({
5082
5100
  faqs: e,
5083
5101
  onFaqClick: t,
5084
5102
  loadingFaqId: n,
@@ -5090,7 +5108,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5090
5108
  const o = e.filter((d) => d.enabled).sort((d, u) => (d.order ?? 0) - (u.order ?? 0));
5091
5109
  return o.length === 0 ? null : /* @__PURE__ */ s("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
5092
5110
  (i || l) && /* @__PURE__ */ s("div", { className: "flex-none", children: /* @__PURE__ */ s(
5093
- be,
5111
+ ve,
5094
5112
  {
5095
5113
  id: l || "account",
5096
5114
  name: l || "Account",
@@ -5107,7 +5125,7 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5107
5125
  children: [
5108
5126
  a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
5109
5127
  o.map((d) => /* @__PURE__ */ s(
5110
- no,
5128
+ io,
5111
5129
  {
5112
5130
  question: d.question,
5113
5131
  onClick: () => t(d.id),
@@ -5123,40 +5141,40 @@ const Qt = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5123
5141
  export {
5124
5142
  hs as A,
5125
5143
  ot as B,
5126
- ji as C,
5144
+ Hi as C,
5127
5145
  cs as D,
5128
- po as E,
5129
- xo as F,
5130
- zr as G,
5131
- ba as H,
5132
- ta as I,
5146
+ xo as E,
5147
+ No as F,
5148
+ Fr as G,
5149
+ xa as H,
5150
+ na as I,
5133
5151
  Ht as L,
5134
- fo as M,
5135
- ve as a,
5136
- be as b,
5137
- Zi as c,
5138
- Ps as d,
5139
- go as e,
5140
- no as f,
5152
+ bo as M,
5153
+ xe as a,
5154
+ ve as b,
5155
+ eo as c,
5156
+ zs as d,
5157
+ vo as e,
5158
+ io as f,
5141
5159
  oe as g,
5142
5160
  Re as h,
5143
- xe as i,
5144
- vo as j,
5145
- Yr as k,
5146
- ho as l,
5147
- bo as m,
5148
- er as n,
5161
+ we as i,
5162
+ _o as j,
5163
+ qr as k,
5164
+ po as l,
5165
+ wo as m,
5166
+ sr as n,
5149
5167
  de as o,
5150
- Za as p,
5151
- Xi as q,
5152
- ge as r,
5153
- Qa as s,
5168
+ Qa as p,
5169
+ Ji as q,
5170
+ be as r,
5171
+ tr as s,
5154
5172
  us as t,
5155
5173
  ps as u,
5156
- ra as v,
5157
- Ga as w,
5158
- va as x,
5174
+ oa as v,
5175
+ Ya as w,
5176
+ wa as x,
5159
5177
  ls as y,
5160
5178
  it as z
5161
5179
  };
5162
- //# sourceMappingURL=index-CGWNR062.js.map
5180
+ //# sourceMappingURL=index-fP-uUIi5.js.map