@linktr.ee/messaging-react 3.14.0 → 3.14.1-rc-1784609552

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,10 +1,10 @@
1
1
  import { jsx as s, jsxs as u, Fragment as te } from "react/jsx-runtime";
2
- import V, { createContext as dt, useContext as Te, useCallback as Q, useState as B, useRef as G, useEffect as K, useId as Ws, useMemo as re, Suspense as qs } from "react";
2
+ import V, { createContext as dt, useContext as Te, useCallback as Q, useState as U, useRef as G, useEffect as K, useId as qs, useMemo as re, Suspense as Ws } from "react";
3
3
  import { StreamChatService as Xs } from "@linktr.ee/messaging-core";
4
- import { StreamChat as Ks, LinkPreviewsManager as Ht } from "stream-chat";
5
- import { Chat as Zs, useChannelStateContext as oe, useChatContext as fe, DateSeparator as Js, MessageStatus as Qs, useMessageContext as Ne, MessageErrorIcon as at, MessageText as $e, areMessageUIPropsEqual as en, useMessageReminder as tn, useComponentContext as cs, Attachment as sn, EditMessageModal as nn, MessageBlocked as an, MessageBouncePrompt as rn, MessageDeleted as ln, MessageIsThreadReplyInChannelButtonIndicator as on, MessageRepliesCountButton as cn, ReminderNotification as dn, StreamedMessageText as un, messageHasAttachments as mn, messageHasReactions as hn, isDateSeparatorMessage as fn, isMessageBlocked as gn, isMessageBounced as pn, MessageBounceModal as bn, Poll as vn, useMessageComposer as xn, useStateStore as wn, MessageInput as Wt, useMessageInputContext as _n, useMessageComposerHasSendableData as Nn, AttachmentPreviewList as yn, QuotedMessagePreview as kn, TextareaComposer as Cn, MessageTimestamp as Ke, AIStates as Ze, useTypingContext as Sn, useAIState as En, Channel as In, WithComponents as Tn, Window as Mn, MessageList as qt, ChannelList as An, InfiniteScroll as Rn } from "stream-chat-react";
6
- import { StarIcon as Ie, DotsThreeIcon as Ln, SpinnerGapIcon as Pe, SignOutIcon as Dn, ProhibitInsetIcon as Xt, FlagIcon as ds, ArrowLeftIcon as rt, CurrencyDollarIcon as zn, CaretRightIcon as xe, SparkleIcon as we, FileIcon as us, ImageIcon as Pn, SpeakerHighIcon as On, VideoCameraIcon as ms, FileMdIcon as Fn, FileTextIcon as $n, FileZipIcon as Un, FilePptIcon as Bn, FileCsvIcon as jn, FileXlsIcon as Vn, FileDocIcon as Gn, FilePdfIcon as Yn, CircleNotchIcon as Se, PlayIcon as it, PauseIcon as Hn, LinkIcon as Wn, DownloadSimpleIcon as Ee, XIcon as Ye, CaretLeftIcon as qn, GiftIcon as Xn, ThumbsUpIcon as Kn, ThumbsDownIcon as Zn, ChecksIcon as Jn, PencilSimpleIcon as Qn, TrashSimpleIcon as ea, ArrowUpIcon as ta, ProhibitIcon as sa } from "@phosphor-icons/react";
7
- import C from "classnames";
4
+ import { StreamChat as Ks, LinkPreviewsManager as Yt } from "stream-chat";
5
+ import { Chat as Zs, useChannelStateContext as oe, useChatContext as fe, DateSeparator as Js, MessageStatus as Qs, useMessageContext as Ne, MessageErrorIcon as at, MessageText as $e, areMessageUIPropsEqual as en, useMessageReminder as tn, useComponentContext as cs, Attachment as sn, EditMessageModal as nn, MessageBlocked as an, MessageBouncePrompt as rn, MessageDeleted as ln, MessageIsThreadReplyInChannelButtonIndicator as on, MessageRepliesCountButton as cn, ReminderNotification as dn, StreamedMessageText as un, messageHasAttachments as mn, messageHasReactions as hn, isDateSeparatorMessage as fn, isMessageBlocked as gn, isMessageBounced as pn, MessageBounceModal as bn, Poll as vn, useMessageComposer as xn, useStateStore as _n, MessageInput as qt, useMessageInputContext as wn, useMessageComposerHasSendableData as Nn, AttachmentPreviewList as yn, QuotedMessagePreview as kn, TextareaComposer as Cn, MessageTimestamp as Ke, AIStates as Ze, useTypingContext as Sn, useAIState as En, Channel as In, WithComponents as Tn, Window as Mn, MessageList as Wt, ChannelList as An, InfiniteScroll as Rn } from "stream-chat-react";
6
+ import { StarIcon as Ie, DotsThreeIcon as Ln, SpinnerGapIcon as Oe, SignOutIcon as Dn, ProhibitInsetIcon as Xt, FlagIcon as ds, ArrowLeftIcon as rt, CurrencyDollarIcon as zn, CaretRightIcon as xe, SparkleIcon as _e, FileIcon as us, ImageIcon as On, SpeakerHighIcon as Pn, VideoCameraIcon as ms, FileMdIcon as Fn, FileTextIcon as $n, FileZipIcon as Bn, FilePptIcon as Un, FileCsvIcon as jn, FileXlsIcon as Vn, FileDocIcon as Gn, FilePdfIcon as Hn, CircleNotchIcon as Se, PlayIcon as it, PauseIcon as Yn, LinkIcon as qn, DownloadSimpleIcon as Ee, XIcon as He, CaretLeftIcon as Wn, GiftIcon as Xn, ThumbsUpIcon as Kn, ThumbsDownIcon as Zn, ChecksIcon as Jn, PencilSimpleIcon as Qn, TrashSimpleIcon as ea, ArrowUpIcon as ta, ProhibitIcon as sa } from "@phosphor-icons/react";
7
+ import S from "classnames";
8
8
  import { MessageActions as na, DefaultDropdownActionButton as hs } from "stream-chat-react/experimental";
9
9
  const fs = dt({
10
10
  service: null,
@@ -16,7 +16,7 @@ const fs = dt({
16
16
  refreshConnection: async () => {
17
17
  },
18
18
  debug: !1
19
- }), ut = () => Te(fs), gl = ({
19
+ }), ut = () => Te(fs), pl = ({
20
20
  children: e,
21
21
  user: t,
22
22
  serviceConfig: n,
@@ -25,10 +25,10 @@ const fs = dt({
25
25
  debug: i = !1,
26
26
  client: o
27
27
  }) => {
28
- var k, T;
28
+ var C, T;
29
29
  const l = Q(
30
- (M, ...O) => {
31
- i && console.log(`🔥 [MessagingProvider] ${M}`, ...O);
30
+ (M, ...P) => {
31
+ i && console.log(`🔥 [MessagingProvider] ${M}`, ...P);
32
32
  },
33
33
  [i]
34
34
  );
@@ -38,8 +38,8 @@ const fs = dt({
38
38
  serviceConfig: !!n,
39
39
  capabilities: Object.keys(r)
40
40
  });
41
- const [d, m] = B(null), [g, h] = B(null), [f, c] = B(!1), [b, v] = B(!1), [x, p] = B(null), _ = G(!1), w = G(null), S = G(n);
42
- S.current = n;
41
+ const [d, m] = U(null), [g, h] = U(null), [f, c] = U(!1), [b, x] = U(!1), [v, p] = U(null), _ = G(!1), w = G(null), y = G(n);
42
+ y.current = n;
43
43
  const z = G(i);
44
44
  z.current = i;
45
45
  const E = G({
@@ -64,15 +64,15 @@ const fs = dt({
64
64
  capabilities: r
65
65
  };
66
66
  const F = G(null);
67
- !o && a && ((k = F.current) == null ? void 0 : k.apiKey) !== a && (F.current = { apiKey: a, client: new Ks(a) });
67
+ !o && a && ((C = F.current) == null ? void 0 : C.apiKey) !== a && (F.current = { apiKey: a, client: new Ks(a) });
68
68
  const D = o || (a ? ((T = F.current) == null ? void 0 : T.client) ?? null : null);
69
69
  K(() => {
70
- const M = R.current, O = S.current;
70
+ const M = R.current, P = y.current;
71
71
  if (o) {
72
- w.current = null, m(null), h(null), c(!1), p(null), v(!1);
72
+ w.current = null, m(null), h(null), c(!1), p(null), x(!1);
73
73
  return;
74
74
  }
75
- if (!a || !D || !O) {
75
+ if (!a || !D || !P) {
76
76
  l("⚠️ SERVICE INIT SKIPPED", {
77
77
  renderCount: M,
78
78
  reason: "Missing apiKey, client, or serviceConfig"
@@ -84,7 +84,7 @@ const fs = dt({
84
84
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
85
85
  });
86
86
  const $ = new Xs({
87
- ...O,
87
+ ...P,
88
88
  apiKey: a,
89
89
  debug: z.current,
90
90
  client: D
@@ -96,7 +96,7 @@ const fs = dt({
96
96
  }, [a, D, o]);
97
97
  const L = G(null);
98
98
  K(() => {
99
- var O, $;
99
+ var P, $;
100
100
  if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!d,
102
102
  hasUser: !!t,
@@ -114,7 +114,7 @@ const fs = dt({
114
114
  l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
115
115
  return;
116
116
  }
117
- if (((O = L.current) == null ? void 0 : O.serviceId) === d && (($ = L.current) == null ? void 0 : $.userId) === t.id) {
117
+ if (((P = L.current) == null ? void 0 : P.serviceId) === d && (($ = L.current) == null ? void 0 : $.userId) === t.id) {
118
118
  l(
119
119
  "⚠️ USER CONNECTION SKIPPED",
120
120
  "Already connected this user with this service"
@@ -122,7 +122,7 @@ const fs = dt({
122
122
  return;
123
123
  }
124
124
  (async () => {
125
- l("🚀 STARTING USER CONNECTION", { userId: t.id }), _.current = !0, v(!0), p(null);
125
+ l("🚀 STARTING USER CONNECTION", { userId: t.id }), _.current = !0, x(!0), p(null);
126
126
  try {
127
127
  l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
128
128
  const j = await d.connectUser(t);
@@ -137,7 +137,7 @@ const fs = dt({
137
137
  error: Z
138
138
  });
139
139
  } finally {
140
- v(!1), _.current = !1, l("🔄 USER CONNECTION FINISHED", {
140
+ x(!1), _.current = !1, l("🔄 USER CONNECTION FINISHED", {
141
141
  userId: t.id,
142
142
  isConnected: f
143
143
  });
@@ -146,11 +146,11 @@ const fs = dt({
146
146
  }, [d, t, l, f, o]), K(() => {
147
147
  const M = D;
148
148
  return () => {
149
- var O;
150
- M && (L.current = null, (O = w.current) == null || O.disconnectUser().catch(console.error));
149
+ var P;
150
+ M && (L.current = null, (P = w.current) == null || P.disconnectUser().catch(console.error));
151
151
  };
152
152
  }, [D]);
153
- const y = Q(async () => {
153
+ const k = Q(async () => {
154
154
  if (l("🔄 REFRESH CONNECTION CALLED", {
155
155
  hasService: !!d,
156
156
  hasUser: !!t
@@ -159,19 +159,19 @@ const fs = dt({
159
159
  l("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
160
160
  return;
161
161
  }
162
- l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), v(!0);
162
+ l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), x(!0);
163
163
  try {
164
164
  l("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
165
165
  const M = await d.connectUser(t);
166
166
  h(M), c(!0), p(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
167
167
  } catch (M) {
168
- const O = M instanceof Error ? M.message : "Refresh failed";
169
- p(O), l("❌ CONNECTION REFRESH ERROR", {
168
+ const P = M instanceof Error ? M.message : "Refresh failed";
169
+ p(P), l("❌ CONNECTION REFRESH ERROR", {
170
170
  userId: t.id,
171
- error: O
171
+ error: P
172
172
  });
173
173
  } finally {
174
- v(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
174
+ x(!1), l("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
175
175
  }
176
176
  }
177
177
  }, [d, t, l, o]), I = V.useMemo(() => (l("💫 CONTEXT VALUE MEMOIZATION", {
@@ -179,7 +179,7 @@ const fs = dt({
179
179
  hasClient: !!g,
180
180
  isConnected: f,
181
181
  isLoading: b,
182
- hasError: !!x,
182
+ hasError: !!v,
183
183
  capabilitiesKeys: Object.keys(r)
184
184
  }), {
185
185
  // With an injected client, expose no service — the injected client owns
@@ -194,9 +194,9 @@ const fs = dt({
194
194
  client: o ?? g,
195
195
  isConnected: o ? !0 : f,
196
196
  isLoading: o ? !1 : b,
197
- error: o ? null : x,
197
+ error: o ? null : v,
198
198
  capabilities: r,
199
- refreshConnection: y,
199
+ refreshConnection: k,
200
200
  debug: i
201
201
  }), [
202
202
  d,
@@ -204,9 +204,9 @@ const fs = dt({
204
204
  o,
205
205
  f,
206
206
  b,
207
- x,
207
+ v,
208
208
  r,
209
- y,
209
+ k,
210
210
  i,
211
211
  l
212
212
  ]);
@@ -226,7 +226,7 @@ const fs = dt({
226
226
  ) : e });
227
227
  }, aa = () => ut(), mt = (e) => {
228
228
  var a, r;
229
- const [t, n] = B(
229
+ const [t, n] = U(
230
230
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
231
231
  );
232
232
  return K(() => {
@@ -247,7 +247,7 @@ const fs = dt({
247
247
  };
248
248
  }, [e]), t;
249
249
  }, ra = "linktree-official", ia = "linktree-official-sender";
250
- function He(e, t, n) {
250
+ function Ye(e, t, n) {
251
251
  const a = Object.values(e || {});
252
252
  if (n === ra) {
253
253
  const r = a.find(
@@ -341,7 +341,7 @@ const ne = ({
341
341
  "div",
342
342
  {
343
343
  "aria-hidden": "true",
344
- className: C(
344
+ className: S(
345
345
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold select-none transition-colors"
346
346
  ),
347
347
  style: { fontSize: h, lineHeight: 1 },
@@ -351,7 +351,7 @@ const ne = ({
351
351
  return /* @__PURE__ */ u(
352
352
  "div",
353
353
  {
354
- className: C(
354
+ className: S(
355
355
  "relative flex-shrink-0",
356
356
  a
357
357
  ),
@@ -375,7 +375,7 @@ const ne = ({
375
375
  "div",
376
376
  {
377
377
  "data-testid": "avatar-ring",
378
- className: C(
378
+ className: S(
379
379
  "h-full w-full",
380
380
  "bg-transparent"
381
381
  ),
@@ -408,70 +408,70 @@ const ne = ({
408
408
  logLabel: g = "useChannelModerationActions"
409
409
  }) => {
410
410
  var I;
411
- const { service: h, debug: f } = ut(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, b = !!(a && n && h && c), [v, x] = B(!1), [p, _] = B(null), [w, S] = B(!1), [z, E] = B(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
411
+ const { service: h, debug: f } = ut(), c = (I = t == null ? void 0 : t.user) == null ? void 0 : I.id, b = !!(a && n && h && c), [x, v] = U(!1), [p, _] = U(null), [w, y] = U(!1), [z, E] = U(!1), R = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== h);
412
412
  return K(() => {
413
413
  if (!b || !h || !c) {
414
- x(!1), _(null);
414
+ v(!1), _(null);
415
415
  return;
416
416
  }
417
- let k = !1;
417
+ let C = !1;
418
418
  return (async () => {
419
419
  try {
420
420
  const T = await h.getBlockedUsers();
421
- if (k) return;
422
- x(
421
+ if (C) return;
422
+ v(
423
423
  T.some(
424
424
  (M) => M.blocked_user_id === c
425
425
  )
426
426
  );
427
427
  } catch (T) {
428
- k || console.error(`[${g}] Failed to check blocked status:`, T);
428
+ C || console.error(`[${g}] Failed to check blocked status:`, T);
429
429
  } finally {
430
- k || _({ participantId: c, service: h });
430
+ C || _({ participantId: c, service: h });
431
431
  }
432
432
  })(), () => {
433
- k = !0;
433
+ C = !0;
434
434
  };
435
435
  }, [b, h, c, g]), {
436
- isParticipantBlocked: v,
436
+ isParticipantBlocked: x,
437
437
  isCheckingBlockedStatus: R,
438
438
  isLeaving: w,
439
439
  isUpdatingBlockStatus: z,
440
440
  handleLeaveConversation: async () => {
441
- var k;
441
+ var C;
442
442
  if (!w) {
443
- o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), S(!0);
443
+ o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), y(!0);
444
444
  try {
445
- const T = ((k = e._client) == null ? void 0 : k.userID) ?? null;
445
+ const T = ((C = e._client) == null ? void 0 : C.userID) ?? null;
446
446
  await e.hide(T, !1), r && await r(e), m == null || m();
447
447
  } catch (T) {
448
448
  console.error(`[${g}] Failed to leave conversation`, T);
449
449
  } finally {
450
- S(!1);
450
+ y(!1);
451
451
  }
452
452
  }
453
453
  },
454
454
  handleBlockUser: async () => {
455
- var k, T, M;
455
+ var C, T, M;
456
456
  if (!(z || !h)) {
457
- l == null || l(), f && console.log(`[${g}] Block member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), E(!0);
457
+ l == null || l(), f && console.log(`[${g}] Block member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), E(!0);
458
458
  try {
459
459
  await h.blockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
460
- } catch (O) {
461
- console.error(`[${g}] Failed to block member`, O);
460
+ } catch (P) {
461
+ console.error(`[${g}] Failed to block member`, P);
462
462
  } finally {
463
463
  E(!1);
464
464
  }
465
465
  }
466
466
  },
467
467
  handleUnblockUser: async () => {
468
- var k, T, M;
468
+ var C, T, M;
469
469
  if (!(z || !h)) {
470
- l == null || l(), f && console.log(`[${g}] Unblock member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), E(!0);
470
+ l == null || l(), f && console.log(`[${g}] Unblock member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), E(!0);
471
471
  try {
472
472
  await h.unBlockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((M = t == null ? void 0 : t.user) == null ? void 0 : M.id), m == null || m();
473
- } catch (O) {
474
- console.error(`[${g}] Failed to unblock member`, O);
473
+ } catch (P) {
474
+ console.error(`[${g}] Failed to unblock member`, P);
475
475
  } finally {
476
476
  E(!1);
477
477
  }
@@ -490,7 +490,7 @@ const ne = ({
490
490
  "button",
491
491
  {
492
492
  type: "button",
493
- className: C(
493
+ className: S(
494
494
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
495
495
  e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
496
496
  t
@@ -512,11 +512,11 @@ const ne = ({
512
512
  customChannelActions: g,
513
513
  triggerClassName: h
514
514
  }) => {
515
- const [f, c] = B(!1), b = G(null), v = Ws(), x = Q(() => c(!1), []), {
515
+ const [f, c] = U(!1), b = G(null), x = qs(), v = Q(() => c(!1), []), {
516
516
  isParticipantBlocked: p,
517
517
  isCheckingBlockedStatus: _,
518
518
  isLeaving: w,
519
- isUpdatingBlockStatus: S,
519
+ isUpdatingBlockStatus: y,
520
520
  handleLeaveConversation: z,
521
521
  handleBlockUser: E,
522
522
  handleUnblockUser: R,
@@ -531,18 +531,18 @@ const ne = ({
531
531
  onDeleteConversationClick: l,
532
532
  onBlockParticipantClick: d,
533
533
  onReportParticipantClick: m,
534
- onActionComplete: x,
534
+ onActionComplete: v,
535
535
  logLabel: "ChannelActionsMenu"
536
536
  });
537
537
  return K(() => {
538
538
  if (!f) return;
539
539
  const L = (I) => {
540
540
  b.current && !b.current.contains(I.target) && c(!1);
541
- }, y = (I) => {
541
+ }, k = (I) => {
542
542
  I.key === "Escape" && c(!1);
543
543
  };
544
- return document.addEventListener("mousedown", L), document.addEventListener("keydown", y), () => {
545
- document.removeEventListener("mousedown", L), document.removeEventListener("keydown", y);
544
+ return document.addEventListener("mousedown", L), document.addEventListener("keydown", k), () => {
545
+ document.removeEventListener("mousedown", L), document.removeEventListener("keydown", k);
546
546
  };
547
547
  }, [f]), !t || !(n || a || r || !!g) ? null : /* @__PURE__ */ u("div", { ref: b, className: "relative", children: [
548
548
  /* @__PURE__ */ u(
@@ -552,7 +552,7 @@ const ne = ({
552
552
  type: "button",
553
553
  "aria-haspopup": "true",
554
554
  "aria-expanded": f,
555
- "aria-controls": f ? v : void 0,
555
+ "aria-controls": f ? x : void 0,
556
556
  onClick: () => c((L) => !L),
557
557
  children: [
558
558
  /* @__PURE__ */ s(Ln, { className: "size-5 text-black/90" }),
@@ -563,9 +563,9 @@ const ne = ({
563
563
  f && /* @__PURE__ */ s(
564
564
  "div",
565
565
  {
566
- id: v,
566
+ id: x,
567
567
  "aria-label": "Conversation options",
568
- className: C(
568
+ className: S(
569
569
  "absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
570
570
  "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
571
571
  ),
@@ -577,7 +577,7 @@ const ne = ({
577
577
  disabled: w,
578
578
  "aria-busy": w,
579
579
  children: [
580
- w ? /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Dn, { className: "h-5 w-5" }),
580
+ w ? /* @__PURE__ */ s(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Dn, { className: "h-5 w-5" }),
581
581
  /* @__PURE__ */ s("span", { children: "Delete Conversation" })
582
582
  ]
583
583
  }
@@ -586,17 +586,17 @@ const ne = ({
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
588
  /* @__PURE__ */ u(ye, { disabled: !0, "aria-busy": !0, children: [
589
- /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }),
589
+ /* @__PURE__ */ s(Oe, { className: "h-5 w-5 animate-spin" }),
590
590
  /* @__PURE__ */ s("span", { children: "Block" })
591
591
  ] })
592
592
  ) : p ? /* @__PURE__ */ u(
593
593
  ye,
594
594
  {
595
595
  onClick: R,
596
- disabled: S,
597
- "aria-busy": S,
596
+ disabled: y,
597
+ "aria-busy": y,
598
598
  children: [
599
- S ? /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
599
+ y ? /* @__PURE__ */ s(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
600
600
  /* @__PURE__ */ s("span", { children: "Unblock" })
601
601
  ]
602
602
  }
@@ -604,10 +604,10 @@ const ne = ({
604
604
  ye,
605
605
  {
606
606
  onClick: E,
607
- disabled: S,
608
- "aria-busy": S,
607
+ disabled: y,
608
+ "aria-busy": y,
609
609
  children: [
610
- S ? /* @__PURE__ */ s(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
610
+ y ? /* @__PURE__ */ s(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ s(Xt, { className: "h-5 w-5" }),
611
611
  /* @__PURE__ */ s("span", { children: "Block" })
612
612
  ]
613
613
  }
@@ -637,34 +637,34 @@ const ne = ({
637
637
  onReportParticipantClick: f,
638
638
  customChannelActions: c,
639
639
  renderChannelActions: b,
640
- showChannelInfo: v = !0,
641
- onParticipantNameClick: x
640
+ showChannelInfo: x = !0,
641
+ onParticipantNameClick: v
642
642
  }) => {
643
- var D, L, y, I;
643
+ var D, L, k, I;
644
644
  const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
645
645
  () => {
646
- var k;
647
- return He(
648
- (k = p.state) == null ? void 0 : k.members,
646
+ var C;
647
+ return Ye(
648
+ (C = p.state) == null ? void 0 : C.members,
649
649
  _ == null ? void 0 : _.userID,
650
650
  p.type
651
651
  );
652
652
  },
653
653
  [(D = p.state) == null ? void 0 : D.members, _ == null ? void 0 : _.userID, p.type]
654
- ), S = ht(w == null ? void 0 : w.user), z = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, E = mt(p), R = pa((y = p.data) == null ? void 0 : y.customer_tag) && (w == null ? void 0 : w.is_follower) === !0, F = async () => {
654
+ ), y = ht(w == null ? void 0 : w.user), z = (L = w == null ? void 0 : w.user) == null ? void 0 : L.image, E = mt(p), R = pa((k = p.data) == null ? void 0 : k.customer_tag) && (w == null ? void 0 : w.is_follower) === !0, F = async () => {
655
655
  try {
656
656
  E ? await p.unpin() : await p.pin();
657
- } catch (k) {
657
+ } catch (C) {
658
658
  console.error(
659
659
  "[ChannelHeaderRedesign] Failed to update pinned status:",
660
- k
660
+ C
661
661
  );
662
662
  }
663
663
  };
664
664
  return /* @__PURE__ */ s(
665
665
  "div",
666
666
  {
667
- className: C(
667
+ className: S(
668
668
  "@container bg-[linear-gradient(180deg,#FBFAF9_0%,rgba(251,250,249,0.92)_58%,rgba(251,250,249,0)_100%)]",
669
669
  e
670
670
  ),
@@ -672,7 +672,7 @@ const ne = ({
672
672
  /* @__PURE__ */ s("div", { className: "flex items-start", children: n && /* @__PURE__ */ s(
673
673
  "button",
674
674
  {
675
- className: C(
675
+ className: S(
676
676
  Je,
677
677
  "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"
678
678
  ),
@@ -687,15 +687,15 @@ const ne = ({
687
687
  "button",
688
688
  {
689
689
  type: "button",
690
- onClick: x,
691
- "aria-label": `View details for ${S}`,
690
+ onClick: v,
691
+ "aria-label": `View details for ${y}`,
692
692
  className: "group flex min-w-0 max-w-full appearance-none flex-col items-center border-0 bg-transparent px-2 focus-ring focus-visible:outline-none",
693
693
  children: [
694
694
  /* @__PURE__ */ s(
695
695
  ne,
696
696
  {
697
697
  id: ((I = w == null ? void 0 : w.user) == null ? void 0 : I.id) || p.id || "unknown",
698
- name: S,
698
+ name: y,
699
699
  image: z,
700
700
  dmAgentEnabled: r,
701
701
  shape: "circle",
@@ -705,7 +705,7 @@ const ne = ({
705
705
  ),
706
706
  /* @__PURE__ */ u("span", { className: "relative z-10 flex max-w-full flex-col items-center justify-center rounded-full border border-white/10 bg-white/65 py-1.5 pl-3 pr-2 shadow-[0px_0px_0px_0px_rgba(0,0,0,0.04),0px_1px_2px_0px_rgba(0,0,0,0.04),0px_8px_32px_0px_rgba(0,0,0,0.1)] backdrop-blur-[2px] transition-filter duration-150 group-hover:brightness-95", children: [
707
707
  /* @__PURE__ */ u("span", { className: "flex max-w-full items-center justify-center", children: [
708
- /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: S }),
708
+ /* @__PURE__ */ s("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: y }),
709
709
  /* @__PURE__ */ u("span", { className: "ml-2 flex gap-1", children: [
710
710
  R && /* @__PURE__ */ s(
711
711
  "span",
@@ -734,7 +734,7 @@ const ne = ({
734
734
  ] })
735
735
  ] }),
736
736
  r && /* @__PURE__ */ u("span", { className: "mt-1 flex items-center gap-1 px-1 pb-0.5 text-[10px] leading-3 text-black/55", children: [
737
- /* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
737
+ /* @__PURE__ */ s(_e, { className: "size-3 shrink-0 text-black/55" }),
738
738
  /* @__PURE__ */ s("span", { children: ga })
739
739
  ] })
740
740
  ] })
@@ -753,7 +753,7 @@ const ne = ({
753
753
  children: /* @__PURE__ */ s(
754
754
  Ie,
755
755
  {
756
- className: C("size-5", {
756
+ className: S("size-5", {
757
757
  "text-[#FFD60A]": E,
758
758
  "text-black/90": !E
759
759
  }),
@@ -762,7 +762,7 @@ const ne = ({
762
762
  )
763
763
  }
764
764
  ),
765
- v && (b !== void 0 ? b : /* @__PURE__ */ s(
765
+ x && (b !== void 0 ? b : /* @__PURE__ */ s(
766
766
  lt,
767
767
  {
768
768
  channel: p,
@@ -787,7 +787,7 @@ const ne = ({
787
787
  function xa(e) {
788
788
  return e != null && e.length ? e.some((t) => t.type === ct) ? "down" : e.some((t) => t.type === ot) ? "up" : null : null;
789
789
  }
790
- function wa(e) {
790
+ function _a(e) {
791
791
  const { channel: t } = oe(), { client: n } = fe("useMessageVote"), a = re(
792
792
  () => xa(e.own_reactions),
793
793
  [e.own_reactions]
@@ -814,7 +814,7 @@ function wa(e) {
814
814
  }, [t, n == null ? void 0 : n.userID, e.id, a]);
815
815
  return { selected: a, voteUp: r, voteDown: i };
816
816
  }
817
- function _a(e) {
817
+ function wa(e) {
818
818
  return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
819
819
  }
820
820
  function ps({
@@ -822,7 +822,7 @@ function ps({
822
822
  viewerLanguage: t
823
823
  }) {
824
824
  var r;
825
- const n = e == null ? void 0 : e.text, a = _a(t);
825
+ const n = e == null ? void 0 : e.text, a = wa(t);
826
826
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? n : n;
827
827
  }
828
828
  const Na = ["linktr.ee"], Jt = "messaging-attachment-v1_0";
@@ -867,16 +867,16 @@ function bs(e) {
867
867
  }
868
868
  const Sa = {
869
869
  video: ms,
870
- audio: On,
871
- image: Pn,
870
+ audio: Pn,
871
+ image: On,
872
872
  document: us
873
873
  }, Ea = {
874
- pdf: Yn,
874
+ pdf: Hn,
875
875
  doc: Gn,
876
876
  xls: Vn,
877
877
  csv: jn,
878
- ppt: Bn,
879
- zip: Un,
878
+ ppt: Un,
879
+ zip: Bn,
880
880
  text: $n,
881
881
  markdown: Fn,
882
882
  generic: us
@@ -885,7 +885,7 @@ function Ia(e) {
885
885
  const t = ce(e);
886
886
  return t !== "document" ? Sa[t] : Ea[bs(e)];
887
887
  }
888
- function _e(e, t) {
888
+ function we(e, t) {
889
889
  return V.createElement(Ia(e), t);
890
890
  }
891
891
  const Ta = (e) => {
@@ -903,28 +903,28 @@ const Ta = (e) => {
903
903
  muted: d = !1,
904
904
  onContainerClick: m
905
905
  }) => {
906
- const g = ce(t), h = G(null), f = G(null), c = G(null), b = G(r), [v, x] = B(a), [p, _] = B(0), [w, S] = B(!1), [z, E] = B(!1), [R, F] = B(!1), [D, L] = B(!1), [y, I] = B(!0), [k, T] = B(null), M = Q(() => {
907
- F(!1), x(!0);
908
- }, []), O = Q((N) => {
906
+ const g = ce(t), h = G(null), f = G(null), c = G(null), b = G(r), [x, v] = U(a), [p, _] = U(0), [w, y] = U(!1), [z, E] = U(!1), [R, F] = U(!1), [D, L] = U(!1), [k, I] = U(!0), [C, T] = U(null), M = Q(() => {
907
+ F(!1), v(!0);
908
+ }, []), P = Q((N) => {
909
909
  const A = f.current;
910
910
  if (!A) return 0;
911
- const Y = A.getBoundingClientRect();
911
+ const H = A.getBoundingClientRect();
912
912
  return Math.max(
913
913
  0,
914
- Math.min(1, (Ta(N) - Y.left) / Y.width)
914
+ Math.min(1, (Ta(N) - H.left) / H.width)
915
915
  );
916
916
  }, []), $ = Q((N) => {
917
917
  const A = h.current;
918
918
  A && A.duration && (A.currentTime = N * A.duration);
919
919
  }, []), j = (N) => {
920
- N.stopPropagation(), S(!0);
921
- const A = O(N);
920
+ N.stopPropagation(), y(!0);
921
+ const A = P(N);
922
922
  _(A), $(A);
923
923
  };
924
924
  K(() => {
925
- r !== void 0 && r !== b.current && (b.current = r, x(r));
925
+ r !== void 0 && r !== b.current && (b.current = r, v(r));
926
926
  }, [r]), K(() => {
927
- if (!v) {
927
+ if (!x) {
928
928
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
929
929
  return;
930
930
  }
@@ -935,21 +935,21 @@ const Ta = (e) => {
935
935
  return c.current = requestAnimationFrame(N), () => {
936
936
  c.current !== null && cancelAnimationFrame(c.current);
937
937
  };
938
- }, [v, w]), K(() => {
938
+ }, [x, w]), K(() => {
939
939
  const N = h.current;
940
- N && (v ? N.play().catch((A) => {
941
- x(!1), F(!0);
940
+ N && (x ? N.play().catch((A) => {
941
+ v(!1), F(!0);
942
942
  }) : N.pause());
943
- }, [v]), K(() => {
943
+ }, [x]), K(() => {
944
944
  if (!w) return;
945
- const N = (Y) => _(O(Y)), A = (Y) => {
946
- S(!1), $(O(Y));
945
+ const N = (H) => _(P(H)), A = (H) => {
946
+ y(!1), $(P(H));
947
947
  };
948
948
  return window.addEventListener("mousemove", N), window.addEventListener("mouseup", A), window.addEventListener("touchmove", N, { passive: !0 }), window.addEventListener("touchend", A), () => {
949
949
  window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", A), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", A);
950
950
  };
951
- }, [w, O, $]);
952
- const Z = k ? { aspectRatio: String(k) } : void 0, ee = k ? "" : " aspect-video", X = Math.round(p * 100);
951
+ }, [w, P, $]);
952
+ const Z = C ? { aspectRatio: String(C) } : void 0, ee = C ? "" : " aspect-video", X = Math.round(p * 100);
953
953
  return /* @__PURE__ */ u(
954
954
  "div",
955
955
  {
@@ -962,7 +962,7 @@ const Ta = (e) => {
962
962
  m(N);
963
963
  return;
964
964
  }
965
- R || o && x((A) => !A);
965
+ R || o && v((A) => !A);
966
966
  },
967
967
  onKeyDown: (N) => {
968
968
  if (!(N.key !== "Enter" && N.key !== " ")) {
@@ -970,11 +970,11 @@ const Ta = (e) => {
970
970
  m(N);
971
971
  return;
972
972
  }
973
- R || o && x((A) => !A);
973
+ R || o && v((A) => !A);
974
974
  }
975
975
  },
976
976
  children: [
977
- n && (g === "audio" || y) && /* @__PURE__ */ s(
977
+ n && (g === "audio" || k) && /* @__PURE__ */ s(
978
978
  "img",
979
979
  {
980
980
  src: n,
@@ -982,7 +982,7 @@ const Ta = (e) => {
982
982
  className: "absolute inset-0 h-full w-full object-cover"
983
983
  }
984
984
  ),
985
- !n && (g === "audio" || y) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: _e(t, {
985
+ !n && (g === "audio" || k) && /* @__PURE__ */ s("div", { className: "absolute inset-0 flex items-center justify-center", children: we(t, {
986
986
  className: "size-12 text-black/20",
987
987
  weight: "regular"
988
988
  }) }),
@@ -1001,7 +1001,7 @@ const Ta = (e) => {
1001
1001
  onWaiting: () => L(!0),
1002
1002
  onPlay: () => F(!1),
1003
1003
  onEnded: () => {
1004
- i || (x(!1), _(0));
1004
+ i || (v(!1), _(0));
1005
1005
  },
1006
1006
  children: /* @__PURE__ */ s("track", { kind: "captions" })
1007
1007
  }
@@ -1025,7 +1025,7 @@ const Ta = (e) => {
1025
1025
  N instanceof HTMLVideoElement && N.videoWidth && N.videoHeight && T(N.videoWidth / N.videoHeight);
1026
1026
  },
1027
1027
  onEnded: () => {
1028
- i || (x(!1), _(0));
1028
+ i || (v(!1), _(0));
1029
1029
  },
1030
1030
  children: /* @__PURE__ */ s("track", { kind: "captions" })
1031
1031
  }
@@ -1085,11 +1085,11 @@ const Ta = (e) => {
1085
1085
  {
1086
1086
  type: "button",
1087
1087
  onClick: (N) => {
1088
- N.stopPropagation(), x((A) => !A);
1088
+ N.stopPropagation(), v((A) => !A);
1089
1089
  },
1090
1090
  className: "shrink-0 text-white",
1091
- "aria-label": v ? "Pause" : "Play",
1092
- children: v ? /* @__PURE__ */ s(Hn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(it, { className: "size-5 translate-x-px", weight: "fill" })
1091
+ "aria-label": x ? "Pause" : "Play",
1092
+ children: x ? /* @__PURE__ */ s(Yn, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ s(it, { className: "size-5 translate-x-px", weight: "fill" })
1093
1093
  }
1094
1094
  ),
1095
1095
  /* @__PURE__ */ u(
@@ -1148,7 +1148,7 @@ const Ta = (e) => {
1148
1148
  mediaPlayerProps: i,
1149
1149
  containedImage: o = !1
1150
1150
  }) => {
1151
- const l = ce(e), [d, m] = B(!1), g = he(t), h = he(n);
1151
+ const l = ce(e), [d, m] = U(!1), g = he(t), h = he(n);
1152
1152
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ s(
1153
1153
  Ma,
1154
1154
  {
@@ -1196,7 +1196,7 @@ const Ta = (e) => {
1196
1196
  "div",
1197
1197
  {
1198
1198
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1199
- children: _e(e, {
1199
+ children: we(e, {
1200
1200
  className: Qt(r),
1201
1201
  weight: "regular"
1202
1202
  })
@@ -1213,7 +1213,7 @@ const Ta = (e) => {
1213
1213
  "div",
1214
1214
  {
1215
1215
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1216
- children: _e(e, {
1216
+ children: we(e, {
1217
1217
  className: Qt(r),
1218
1218
  weight: "regular"
1219
1219
  })
@@ -1239,7 +1239,7 @@ const Ta = (e) => {
1239
1239
  {
1240
1240
  ref: g,
1241
1241
  "data-testid": h,
1242
- className: C(
1242
+ className: S(
1243
1243
  "relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
1244
1244
  f ? "bg-[#1e2330]" : "bg-white"
1245
1245
  ),
@@ -1251,7 +1251,7 @@ const Ta = (e) => {
1251
1251
  c.trim() !== "" && /* @__PURE__ */ s(
1252
1252
  "p",
1253
1253
  {
1254
- className: C("mb-0.5 truncate text-base font-medium", {
1254
+ className: S("mb-0.5 truncate text-base font-medium", {
1255
1255
  "text-black": !f,
1256
1256
  "text-white/30": f && b,
1257
1257
  "text-white": f && !b
@@ -1260,8 +1260,8 @@ const Ta = (e) => {
1260
1260
  }
1261
1261
  ),
1262
1262
  /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-1", children: [
1263
- _e(r, {
1264
- className: C(
1263
+ we(r, {
1264
+ className: S(
1265
1265
  "size-5 shrink-0",
1266
1266
  f ? "text-white/55" : "text-black/55"
1267
1267
  ),
@@ -1270,7 +1270,7 @@ const Ta = (e) => {
1270
1270
  i != null && i !== "" && /* @__PURE__ */ s(
1271
1271
  "span",
1272
1272
  {
1273
- className: C(
1273
+ className: S(
1274
1274
  "text-xs font-medium",
1275
1275
  f ? "text-white/55" : "text-black/55"
1276
1276
  ),
@@ -1285,7 +1285,7 @@ const Ta = (e) => {
1285
1285
  }
1286
1286
  );
1287
1287
  };
1288
- function ws(e) {
1288
+ function _s(e) {
1289
1289
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1290
1290
  }
1291
1291
  function ft(e) {
@@ -1303,7 +1303,7 @@ function Da(e) {
1303
1303
  function za(e) {
1304
1304
  return e ? "text-white/40" : "text-black/40";
1305
1305
  }
1306
- function Pa(e) {
1306
+ function Oa(e) {
1307
1307
  return e ? "text-white/20" : "text-black/20";
1308
1308
  }
1309
1309
  const gt = ({ attachment: e, isMyMessage: t }) => {
@@ -1319,7 +1319,7 @@ const gt = ({ attachment: e, isMyMessage: t }) => {
1319
1319
  "div",
1320
1320
  {
1321
1321
  className: `aspect-video w-full rounded-[20px] ${Ra(t)} flex items-center justify-center`,
1322
- children: /* @__PURE__ */ s(Wn, { className: `size-12 ${Pa(t)}` })
1322
+ children: /* @__PURE__ */ s(qn, { className: `size-12 ${Oa(t)}` })
1323
1323
  }
1324
1324
  ) }),
1325
1325
  /* @__PURE__ */ u("div", { className: "px-3 pb-3", children: [
@@ -1330,14 +1330,14 @@ const gt = ({ attachment: e, isMyMessage: t }) => {
1330
1330
  ] });
1331
1331
  return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ s("div", { className: "block", children: m });
1332
1332
  };
1333
- function _s(e) {
1333
+ function ws(e) {
1334
1334
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1335
1335
  }
1336
1336
  function pt(e) {
1337
1337
  var t;
1338
- return (t = e.attachments) == null ? void 0 : t.find(_s);
1338
+ return (t = e.attachments) == null ? void 0 : t.find(ws);
1339
1339
  }
1340
- async function Oa(e, t) {
1340
+ async function Pa(e, t) {
1341
1341
  let n;
1342
1342
  try {
1343
1343
  n = t ?? new URL(e).pathname.split("/").pop() ?? "download";
@@ -1353,7 +1353,7 @@ const Fa = ({
1353
1353
  url: e,
1354
1354
  filename: t
1355
1355
  }) => {
1356
- const [n, a] = B(!1);
1356
+ const [n, a] = U(!1);
1357
1357
  return /* @__PURE__ */ s(
1358
1358
  "button",
1359
1359
  {
@@ -1361,7 +1361,7 @@ const Fa = ({
1361
1361
  onClick: (i) => {
1362
1362
  i.stopPropagation();
1363
1363
  const o = window.open("", "_blank", "noopener,noreferrer");
1364
- a(!0), Oa(e, t).then(() => {
1364
+ a(!0), Pa(e, t).then(() => {
1365
1365
  o == null || o.close();
1366
1366
  }).catch(() => {
1367
1367
  o && (o.location.href = e);
@@ -1379,13 +1379,13 @@ const Fa = ({
1379
1379
  function bt(e) {
1380
1380
  var h, f, c, b;
1381
1381
  const t = (h = e.attachments) == null ? void 0 : h.find(
1382
- (v) => v.type === "video" && v.asset_url
1382
+ (x) => x.type === "video" && x.asset_url
1383
1383
  ), n = (f = e.attachments) == null ? void 0 : f.find(
1384
- (v) => v.type === "image" && v.image_url
1384
+ (x) => x.type === "image" && x.image_url
1385
1385
  ), a = (c = e.attachments) == null ? void 0 : c.find(
1386
- (v) => v.type === "audio" && v.asset_url
1386
+ (x) => x.type === "audio" && x.asset_url
1387
1387
  ), r = (b = e.attachments) == null ? void 0 : b.find(
1388
- (v) => v.type === "file" && v.asset_url
1388
+ (x) => x.type === "file" && x.asset_url
1389
1389
  ), i = t ?? n ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (n == null ? void 0 : n.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
1390
1390
  if (!o) return null;
1391
1391
  const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
@@ -1404,7 +1404,7 @@ const Ns = ({
1404
1404
  fileSize: a,
1405
1405
  thumbnailUrl: r
1406
1406
  }) => {
1407
- const i = a !== void 0 ? ws(a) : void 0;
1407
+ const i = a !== void 0 ? _s(a) : void 0;
1408
1408
  return /* @__PURE__ */ s(
1409
1409
  xs,
1410
1410
  {
@@ -1432,7 +1432,7 @@ const Ns = ({
1432
1432
  fileSize: a,
1433
1433
  thumbnailUrl: r
1434
1434
  }) => {
1435
- const i = ce(t), o = a !== void 0 ? ws(a) : void 0;
1435
+ const i = ce(t), o = a !== void 0 ? _s(a) : void 0;
1436
1436
  return /* @__PURE__ */ s(
1437
1437
  xs,
1438
1438
  {
@@ -1486,7 +1486,7 @@ const Ns = ({
1486
1486
  }
1487
1487
  )
1488
1488
  ] });
1489
- }, Ua = ({
1489
+ }, Ba = ({
1490
1490
  message: e
1491
1491
  }) => {
1492
1492
  const t = pt(e);
@@ -1494,7 +1494,7 @@ const Ns = ({
1494
1494
  return /* @__PURE__ */ s("div", { className: ft(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(gt, { attachment: t, isMyMessage: !0 }) });
1495
1495
  const n = bt(e);
1496
1496
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(Ns, { ...n }) }) : null;
1497
- }, Ba = ({
1497
+ }, Ua = ({
1498
1498
  message: e
1499
1499
  }) => {
1500
1500
  const t = pt(e);
@@ -1502,9 +1502,9 @@ const Ns = ({
1502
1502
  return /* @__PURE__ */ s("div", { className: ft(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ s(gt, { attachment: t, isMyMessage: !1 }) });
1503
1503
  const n = bt(e);
1504
1504
  return n ? /* @__PURE__ */ s("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ s(ys, { ...n }) }) : null;
1505
- }, pl = Object.assign($a, {
1506
- Creator: Ua,
1507
- Visitor: Ba
1505
+ }, bl = Object.assign($a, {
1506
+ Creator: Ba,
1507
+ Visitor: Ua
1508
1508
  }), ja = {
1509
1509
  dark: "bg-[#1e2330]",
1510
1510
  light: "bg-[#f2f1ef]"
@@ -1514,7 +1514,7 @@ const Ns = ({
1514
1514
  }, Ga = {
1515
1515
  dark: "border-white/[0.08]",
1516
1516
  light: "border-black/[0.08]"
1517
- }, Ya = (e) => e === "dark" ? "sender" : "receiver", Ha = {
1517
+ }, Ha = (e) => e === "dark" ? "sender" : "receiver", Ya = {
1518
1518
  sender: {
1519
1519
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
1520
1520
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -1536,13 +1536,13 @@ const Ns = ({
1536
1536
  children: i,
1537
1537
  "data-testid": o
1538
1538
  }) => {
1539
- const l = t != null && t !== "", d = Ha[Ya(e)][a];
1539
+ const l = t != null && t !== "", d = Ya[Ha(e)][a];
1540
1540
  return /* @__PURE__ */ u(
1541
1541
  "div",
1542
1542
  {
1543
1543
  "data-testid": o,
1544
1544
  "data-group-position": a,
1545
- className: C(
1545
+ className: S(
1546
1546
  // 280px-wide bubble — matches the mobile chat attachment width
1547
1547
  // and keeps the document / image / audio bubbles visually
1548
1548
  // consistent inside the conversation timeline. The 8px / 16px
@@ -1562,7 +1562,7 @@ const Ns = ({
1562
1562
  l ? /* @__PURE__ */ s(
1563
1563
  "p",
1564
1564
  {
1565
- className: C(
1565
+ className: S(
1566
1566
  // No `text-*` / `font-*` overrides here — caption inherits
1567
1567
  // the same font family + size as `.str-chat__message-text`
1568
1568
  // so it matches the surrounding `CustomMessage` bubbles.
@@ -1591,17 +1591,17 @@ const Ns = ({
1591
1591
  a.stopPropagation(), e();
1592
1592
  },
1593
1593
  "aria-label": n,
1594
- className: C(
1594
+ className: S(
1595
1595
  "flex size-6 items-center justify-center rounded-full text-white",
1596
1596
  t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
1597
1597
  ),
1598
- children: /* @__PURE__ */ s(Ye, { className: "size-3", weight: "bold" })
1598
+ children: /* @__PURE__ */ s(He, { className: "size-3", weight: "bold" })
1599
1599
  }
1600
- ), Re = (e) => e === "received" ? "light" : "dark", Wa = ({
1600
+ ), Re = (e) => e === "received" ? "light" : "dark", qa = ({
1601
1601
  firstOfGroup: e,
1602
1602
  endOfGroup: t,
1603
1603
  groupedByUser: n
1604
- }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", qa = ({
1604
+ }) => !n || e && t ? "single" : e ? "first" : t ? "end" : "middle", Wa = ({
1605
1605
  src: e,
1606
1606
  mimeType: t,
1607
1607
  filename: n,
@@ -1629,7 +1629,7 @@ const Ns = ({
1629
1629
  preload: l,
1630
1630
  onDismiss: d
1631
1631
  }) => {
1632
- const m = Re(e), g = e === "composer" && !!d, h = qa({ src: t, mimeType: n, filename: a, items: r });
1632
+ const m = Re(e), g = e === "composer" && !!d, h = Wa({ src: t, mimeType: n, filename: a, items: r });
1633
1633
  if (h.length === 0)
1634
1634
  return null;
1635
1635
  const f = l ?? (h.length > 1 ? "none" : "metadata");
@@ -1725,13 +1725,13 @@ const ar = {
1725
1725
  const d = n ?? t ?? "File", m = nr(a, t, r), g = /* @__PURE__ */ s(
1726
1726
  "div",
1727
1727
  {
1728
- className: C(
1728
+ className: S(
1729
1729
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
1730
1730
  rr[e]
1731
1731
  ),
1732
1732
  "aria-hidden": !0,
1733
- children: _e(a, {
1734
- className: C("size-6", ir[e]),
1733
+ children: we(a, {
1734
+ className: S("size-6", ir[e]),
1735
1735
  weight: "regular"
1736
1736
  })
1737
1737
  }
@@ -1740,7 +1740,7 @@ const ar = {
1740
1740
  m ? /* @__PURE__ */ s(
1741
1741
  "p",
1742
1742
  {
1743
- className: C(
1743
+ className: S(
1744
1744
  "truncate text-xs leading-4",
1745
1745
  ar[e]
1746
1746
  ),
@@ -1753,7 +1753,7 @@ const ar = {
1753
1753
  type: "button",
1754
1754
  onClick: i,
1755
1755
  "aria-label": o,
1756
- className: C(
1756
+ className: S(
1757
1757
  "flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
1758
1758
  e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
1759
1759
  ),
@@ -1833,19 +1833,19 @@ const lr = ({
1833
1833
  mimeType: r,
1834
1834
  title: i,
1835
1835
  items: o
1836
- }), b = (x) => {
1837
- if ((m == null ? void 0 : m(x)) === !1) return;
1838
- const p = c[x];
1836
+ }), b = (v) => {
1837
+ if ((m == null ? void 0 : m(v)) === !1) return;
1838
+ const p = c[v];
1839
1839
  if (!p) return;
1840
1840
  const _ = p.filename ?? ie(p.src);
1841
1841
  Cs(p.src, _);
1842
1842
  };
1843
1843
  if (c.length === 0)
1844
1844
  return null;
1845
- const v = /* @__PURE__ */ s(
1845
+ const x = /* @__PURE__ */ s(
1846
1846
  "span",
1847
1847
  {
1848
- className: C(
1848
+ className: S(
1849
1849
  "flex size-8 items-center justify-center rounded-full",
1850
1850
  h === "dark" ? "text-white/70" : "text-black/70"
1851
1851
  ),
@@ -1860,16 +1860,16 @@ const lr = ({
1860
1860
  text: l,
1861
1861
  groupPosition: d,
1862
1862
  "data-testid": "file-attachment",
1863
- children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((x, p) => /* @__PURE__ */ s(
1863
+ children: /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: c.map((v, p) => /* @__PURE__ */ s(
1864
1864
  or,
1865
1865
  {
1866
1866
  variant: h,
1867
- item: x,
1867
+ item: v,
1868
1868
  index: p,
1869
1869
  onActivate: b,
1870
- trailingAction: f && p === 0 ? /* @__PURE__ */ s(Ae, { onClick: g, variant: "inline" }) : v
1870
+ trailingAction: f && p === 0 ? /* @__PURE__ */ s(Ae, { onClick: g, variant: "inline" }) : x
1871
1871
  },
1872
- `${x.src}-${p}`
1872
+ `${v.src}-${p}`
1873
1873
  )) })
1874
1874
  }
1875
1875
  );
@@ -1877,7 +1877,7 @@ const lr = ({
1877
1877
  Composer: cr,
1878
1878
  Sent: dr,
1879
1879
  Received: ur
1880
- }, wt = ({
1880
+ }, _t = ({
1881
1881
  onPrev: e,
1882
1882
  onNext: t,
1883
1883
  prevLabel: n = "Previous",
@@ -1890,7 +1890,7 @@ const lr = ({
1890
1890
  onClick: e,
1891
1891
  "aria-label": n,
1892
1892
  className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
1893
- children: /* @__PURE__ */ s(qn, { size: 20, weight: "bold", "aria-hidden": !0 })
1893
+ children: /* @__PURE__ */ s(Wn, { size: 20, weight: "bold", "aria-hidden": !0 })
1894
1894
  }
1895
1895
  ),
1896
1896
  /* @__PURE__ */ s(
@@ -1912,7 +1912,7 @@ const lr = ({
1912
1912
  tone: i = "dark",
1913
1913
  onTriggered: o
1914
1914
  }) => {
1915
- const [l, d] = B(!1), m = Q(
1915
+ const [l, d] = U(!1), m = Q(
1916
1916
  (c) => {
1917
1917
  c.stopPropagation(), !l && (d(!0), Cs(e, t).catch(() => {
1918
1918
  }).finally(() => {
@@ -1920,7 +1920,7 @@ const lr = ({
1920
1920
  }));
1921
1921
  },
1922
1922
  [l, e, t, o]
1923
- ), g = r ?? n !== "pill", f = { className: C(
1923
+ ), g = r ?? n !== "pill", f = { className: S(
1924
1924
  n === "pill" ? "size-4" : "size-5",
1925
1925
  "shrink-0"
1926
1926
  ), weight: "bold" };
@@ -1931,7 +1931,7 @@ const lr = ({
1931
1931
  onClick: m,
1932
1932
  disabled: l,
1933
1933
  "aria-label": a,
1934
- className: C(
1934
+ className: S(
1935
1935
  "flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
1936
1936
  {
1937
1937
  dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
@@ -1971,7 +1971,7 @@ const lr = ({
1971
1971
  onClick: m,
1972
1972
  disabled: l,
1973
1973
  "aria-label": g ? a : void 0,
1974
- className: C(
1974
+ className: S(
1975
1975
  "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
1976
1976
  i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
1977
1977
  ),
@@ -1988,12 +1988,12 @@ const lr = ({
1988
1988
  ]
1989
1989
  }
1990
1990
  );
1991
- }, Qe = (e, t, n) => Math.min(Math.max(e, t), n), _t = ({
1991
+ }, Qe = (e, t, n) => Math.min(Math.max(e, t), n), wt = ({
1992
1992
  length: e,
1993
1993
  initialIndex: t,
1994
1994
  open: n
1995
1995
  }) => {
1996
- const a = Qe(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
1996
+ const a = Qe(t, 0, Math.max(e - 1, 0)), [r, i] = U(a);
1997
1997
  K(() => {
1998
1998
  n && i(Qe(t, 0, Math.max(e - 1, 0)));
1999
1999
  }, [n, t, e]), K(() => {
@@ -2094,7 +2094,7 @@ const lr = ({
2094
2094
  onClick: t,
2095
2095
  "aria-label": "Close viewer",
2096
2096
  className: "mes-media-viewer__action",
2097
- children: /* @__PURE__ */ s(Ye, { size: 20, weight: "bold", "aria-hidden": !0 })
2097
+ children: /* @__PURE__ */ s(He, { size: 20, weight: "bold", "aria-hidden": !0 })
2098
2098
  }
2099
2099
  )
2100
2100
  ] })
@@ -2109,7 +2109,7 @@ const lr = ({
2109
2109
  initialIndex: n = 0,
2110
2110
  onClose: a
2111
2111
  }) => {
2112
- const { index: r, prev: i, next: o } = _t({
2112
+ const { index: r, prev: i, next: o } = wt({
2113
2113
  length: t.length,
2114
2114
  initialIndex: n,
2115
2115
  open: e
@@ -2148,7 +2148,7 @@ const lr = ({
2148
2148
  `${r}:${l.src}`
2149
2149
  ),
2150
2150
  t.length > 1 ? /* @__PURE__ */ s(
2151
- wt,
2151
+ _t,
2152
2152
  {
2153
2153
  onPrev: i,
2154
2154
  onNext: o,
@@ -2168,14 +2168,14 @@ const lr = ({
2168
2168
  const r = e.length;
2169
2169
  if (r === 0) return null;
2170
2170
  const i = e.slice(0, Math.min(r, n)), o = r - i.length, l = (d, m, g) => {
2171
- const h = C(hr, "h-full w-full");
2171
+ const h = S(hr, "h-full w-full");
2172
2172
  return t ? /* @__PURE__ */ u(
2173
2173
  "button",
2174
2174
  {
2175
2175
  type: "button",
2176
2176
  onClick: () => t(m),
2177
2177
  "aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
2178
- className: C(h, "cursor-zoom-in"),
2178
+ className: S(h, "cursor-zoom-in"),
2179
2179
  children: [
2180
2180
  d.content,
2181
2181
  g
@@ -2187,10 +2187,10 @@ const lr = ({
2187
2187
  g
2188
2188
  ] }, m);
2189
2189
  };
2190
- return i.length === 1 ? /* @__PURE__ */ s("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ s(
2190
+ return i.length === 1 ? /* @__PURE__ */ s("div", { className: S("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ s(
2191
2191
  "div",
2192
2192
  {
2193
- className: C(
2193
+ className: S(
2194
2194
  "grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
2195
2195
  a
2196
2196
  ),
@@ -2199,7 +2199,7 @@ const lr = ({
2199
2199
  ) : i.length === 3 ? /* @__PURE__ */ u(
2200
2200
  "div",
2201
2201
  {
2202
- className: C(
2202
+ className: S(
2203
2203
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
2204
2204
  a
2205
2205
  ),
@@ -2212,7 +2212,7 @@ const lr = ({
2212
2212
  ) : /* @__PURE__ */ s(
2213
2213
  "div",
2214
2214
  {
2215
- className: C(
2215
+ className: S(
2216
2216
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
2217
2217
  a
2218
2218
  ),
@@ -2230,7 +2230,7 @@ const lr = ({
2230
2230
  }
2231
2231
  );
2232
2232
  }, Le = (e) => {
2233
- const [t, n] = B(!1), [a, r] = B(0), i = Q(
2233
+ const [t, n] = U(!1), [a, r] = U(0), i = Q(
2234
2234
  (l) => {
2235
2235
  (e == null ? void 0 : e(l)) !== !1 && (r(l), n(!0));
2236
2236
  },
@@ -2312,8 +2312,8 @@ const lr = ({
2312
2312
  );
2313
2313
  if (m.length === 0)
2314
2314
  return null;
2315
- const v = m.map(
2316
- (x, p) => fr(x, p, m.length, l)
2315
+ const x = m.map(
2316
+ (v, p) => fr(v, p, m.length, l)
2317
2317
  );
2318
2318
  return /* @__PURE__ */ u(
2319
2319
  Me,
@@ -2323,7 +2323,7 @@ const lr = ({
2323
2323
  groupPosition: o,
2324
2324
  "data-testid": "image-attachment",
2325
2325
  children: [
2326
- /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Is, { tiles: v, onTileActivate: c }) }),
2326
+ /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(Is, { tiles: x, onTileActivate: c }) }),
2327
2327
  /* @__PURE__ */ s(
2328
2328
  Es,
2329
2329
  {
@@ -2336,17 +2336,17 @@ const lr = ({
2336
2336
  ]
2337
2337
  }
2338
2338
  );
2339
- }, br = (e) => /* @__PURE__ */ s(pr, { ...e }), vr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "sent" }), xr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "received" }), wr = {
2339
+ }, br = (e) => /* @__PURE__ */ s(pr, { ...e }), vr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "sent" }), xr = (e) => /* @__PURE__ */ s(Ms, { ...e, state: "received" }), _r = {
2340
2340
  Composer: br,
2341
2341
  Sent: vr,
2342
2342
  Received: xr
2343
- }, _r = ({
2343
+ }, wr = ({
2344
2344
  open: e,
2345
2345
  items: t,
2346
2346
  initialIndex: n = 0,
2347
2347
  onClose: a
2348
2348
  }) => {
2349
- const { index: r, prev: i, next: o } = _t({
2349
+ const { index: r, prev: i, next: o } = wt({
2350
2350
  length: t.length,
2351
2351
  initialIndex: n,
2352
2352
  open: e
@@ -2377,7 +2377,7 @@ const lr = ({
2377
2377
  `${r}:${l.src}`
2378
2378
  ),
2379
2379
  t.length > 1 ? /* @__PURE__ */ s(
2380
- wt,
2380
+ _t,
2381
2381
  {
2382
2382
  onPrev: i,
2383
2383
  onNext: o,
@@ -2430,9 +2430,9 @@ const lr = ({
2430
2430
  onClick: d,
2431
2431
  onDismiss: m
2432
2432
  }) => {
2433
- const g = Re(e), h = yr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
2433
+ const g = Re(e), h = yr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: x } = Le(
2434
2434
  d
2435
- ), x = e === "composer" && !!m;
2435
+ ), v = e === "composer" && !!m;
2436
2436
  if (h.length === 0)
2437
2437
  return null;
2438
2438
  const p = h.map((_) => ({
@@ -2448,13 +2448,13 @@ const lr = ({
2448
2448
  "data-testid": "pdf-attachment",
2449
2449
  children: [
2450
2450
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: h.map((_, w) => {
2451
- const S = _.filename ?? ie(_.src), z = x && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2451
+ const y = _.filename ?? ie(_.src), z = v && w === 0 ? /* @__PURE__ */ s(Ae, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ s(
2452
2452
  Ss,
2453
2453
  {
2454
2454
  url: _.src,
2455
- filename: S,
2455
+ filename: y,
2456
2456
  variant: "inline",
2457
- label: `Download ${S}`,
2457
+ label: `Download ${y}`,
2458
2458
  tone: g
2459
2459
  }
2460
2460
  );
@@ -2471,12 +2471,12 @@ const lr = ({
2471
2471
  );
2472
2472
  }) }),
2473
2473
  /* @__PURE__ */ s(
2474
- _r,
2474
+ wr,
2475
2475
  {
2476
2476
  open: f,
2477
2477
  items: p,
2478
2478
  initialIndex: c,
2479
- onClose: v
2479
+ onClose: x
2480
2480
  }
2481
2481
  )
2482
2482
  ]
@@ -2492,7 +2492,7 @@ const lr = ({
2492
2492
  initialIndex: n = 0,
2493
2493
  onClose: a
2494
2494
  }) => {
2495
- const { index: r, prev: i, next: o } = _t({
2495
+ const { index: r, prev: i, next: o } = wt({
2496
2496
  length: t.length,
2497
2497
  initialIndex: n,
2498
2498
  open: e
@@ -2525,7 +2525,7 @@ const lr = ({
2525
2525
  `${r}:${l.src}`
2526
2526
  ),
2527
2527
  t.length > 1 ? /* @__PURE__ */ s(
2528
- wt,
2528
+ _t,
2529
2529
  {
2530
2530
  onPrev: i,
2531
2531
  onNext: o,
@@ -2615,12 +2615,12 @@ const lr = ({
2615
2615
  preload: d,
2616
2616
  onClick: m
2617
2617
  }) => {
2618
- const g = Ar({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Re(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: v } = Le(
2618
+ const g = Ar({ src: t, poster: n, mimeType: a, preload: d, items: i }), h = Re(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: x } = Le(
2619
2619
  m
2620
2620
  );
2621
2621
  if (g.length === 0)
2622
2622
  return null;
2623
- const x = g.map(
2623
+ const v = g.map(
2624
2624
  (p, _) => Mr(p, _, g.length)
2625
2625
  );
2626
2626
  return /* @__PURE__ */ u(
@@ -2634,7 +2634,7 @@ const lr = ({
2634
2634
  /* @__PURE__ */ s("div", { className: "relative", children: /* @__PURE__ */ s(
2635
2635
  Is,
2636
2636
  {
2637
- tiles: x,
2637
+ tiles: v,
2638
2638
  onTileActivate: b,
2639
2639
  className: "overflow-hidden rounded-md"
2640
2640
  }
@@ -2645,37 +2645,37 @@ const lr = ({
2645
2645
  open: f,
2646
2646
  items: Ls(g, r),
2647
2647
  initialIndex: c,
2648
- onClose: v
2648
+ onClose: x
2649
2649
  }
2650
2650
  )
2651
2651
  ]
2652
2652
  }
2653
2653
  );
2654
- }, Lr = (e) => /* @__PURE__ */ s(Rr, { ...e }), Dr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "sent" }), zr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "received" }), Pr = {
2654
+ }, Lr = (e) => /* @__PURE__ */ s(Rr, { ...e }), Dr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "sent" }), zr = (e) => /* @__PURE__ */ s(Ds, { ...e, state: "received" }), Or = {
2655
2655
  Composer: Lr,
2656
2656
  Sent: Dr,
2657
2657
  Received: zr
2658
2658
  }, ke = {
2659
- Image: wr,
2660
- Video: Pr,
2659
+ Image: _r,
2660
+ Video: Or,
2661
2661
  Audio: Qa,
2662
2662
  Pdf: Ir,
2663
2663
  File: mr
2664
- }, Or = {
2664
+ }, Pr = {
2665
2665
  isUnlocking: () => !1
2666
2666
  }, Fr = {
2667
- LockedAttachment: Or
2668
- }, zs = dt({}), bl = zs.Provider;
2667
+ LockedAttachment: Pr
2668
+ }, zs = dt({}), vl = zs.Provider;
2669
2669
  function $r(e) {
2670
2670
  return Te(zs)[e] ?? Fr[e];
2671
2671
  }
2672
- const Ur = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import("./Card-fPhu90tj.js")), jr = () => /* @__PURE__ */ s(
2672
+ const Br = V.lazy(() => import("./Card-qS17qnN0.js")), Ur = V.lazy(() => import("./Card-Cr8EMVg2.js")), jr = () => /* @__PURE__ */ s(
2673
2673
  "div",
2674
2674
  {
2675
2675
  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)]",
2676
2676
  "aria-hidden": !0
2677
2677
  }
2678
- ), Oe = (e) => /* @__PURE__ */ s(qs, { fallback: /* @__PURE__ */ s(jr, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(Ur, { ...e }) : /* @__PURE__ */ s(Br, { ...e }) }), Vr = ({ size: e = 15 }) => /* @__PURE__ */ s(
2678
+ ), Pe = (e) => /* @__PURE__ */ s(Ws, { fallback: /* @__PURE__ */ s(jr, {}), children: e.contentType === "text" ? /* @__PURE__ */ s(Br, { ...e }) : /* @__PURE__ */ s(Ur, { ...e }) }), Vr = ({ size: e = 15 }) => /* @__PURE__ */ s(
2679
2679
  "svg",
2680
2680
  {
2681
2681
  width: e,
@@ -2695,24 +2695,24 @@ const Ur = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2695
2695
  ), Gr = (e) => {
2696
2696
  var t;
2697
2697
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
2698
- }, Yr = (e) => {
2698
+ }, Hr = (e) => {
2699
2699
  var t;
2700
2700
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
2701
- }, Ue = (e) => {
2701
+ }, Be = (e) => {
2702
2702
  var t;
2703
2703
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
2704
2704
  }, kt = (e) => {
2705
2705
  var t;
2706
2706
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
2707
- }, Hr = (e) => {
2707
+ }, Yr = (e) => {
2708
2708
  var t;
2709
2709
  return kt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
2710
- }, Wr = (e) => {
2710
+ }, qr = (e) => {
2711
2711
  var t;
2712
2712
  return kt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
2713
- }, Ps = (e) => Gr(e) || Yr(e), qr = (e) => {
2713
+ }, Os = (e) => Gr(e) || Hr(e), Wr = (e) => {
2714
2714
  var t;
2715
- return Ps(e) && !((t = e.text) != null && t.trim());
2715
+ return Os(e) && !((t = e.text) != null && t.trim());
2716
2716
  }, et = ({
2717
2717
  message: e,
2718
2718
  standalone: t = !1,
@@ -2720,7 +2720,7 @@ const Ur = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2720
2720
  hasAttachment: a = !1
2721
2721
  }) => {
2722
2722
  var h;
2723
- const r = Ps(e), i = Ue(e);
2723
+ const r = Os(e), i = Be(e);
2724
2724
  if (!r && !i)
2725
2725
  return null;
2726
2726
  if (r) {
@@ -2753,7 +2753,7 @@ const Ur = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2753
2753
  "button",
2754
2754
  {
2755
2755
  type: "button",
2756
- className: C("message-vote-button focus-ring", {
2756
+ className: S("message-vote-button focus-ring", {
2757
2757
  "message-vote-button--selected": e === "up"
2758
2758
  }),
2759
2759
  onClick: t,
@@ -2767,7 +2767,7 @@ const Ur = V.lazy(() => import("./Card-qS17qnN0.js")), Br = V.lazy(() => import(
2767
2767
  "button",
2768
2768
  {
2769
2769
  type: "button",
2770
- className: C("message-vote-button focus-ring", {
2770
+ className: S("message-vote-button focus-ring", {
2771
2771
  "message-vote-button--selected": e === "down"
2772
2772
  }),
2773
2773
  onClick: n,
@@ -2814,7 +2814,7 @@ const ei = {
2814
2814
  dark: "bg-white text-[#121110] hover:bg-white/90",
2815
2815
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2816
2816
  }, ti = ({ variant: e, cta: t }) => {
2817
- const n = C(
2817
+ const n = S(
2818
2818
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2819
2819
  ei[e]
2820
2820
  ), a = Ct(t.href);
@@ -2861,10 +2861,10 @@ const ei = {
2861
2861
  }) => {
2862
2862
  const d = e === "dark", m = t ?? (d ? n : void 0) ?? "", g = m.trim() !== "", h = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = o != null;
2863
2863
  if (!g && !h && !c && !b) return null;
2864
- const x = C(
2864
+ const v = S(
2865
2865
  "truncate text-base font-medium leading-6",
2866
2866
  d && !t ? ni : si[e]
2867
- ), p = C(
2867
+ ), p = S(
2868
2868
  "truncate text-xs leading-4",
2869
2869
  ai[e]
2870
2870
  );
@@ -2874,7 +2874,7 @@ const ei = {
2874
2874
  /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-col gap-1", children: [
2875
2875
  g && /* @__PURE__ */ u("div", { className: "flex min-w-0 items-center gap-2", children: [
2876
2876
  i ? /* @__PURE__ */ s("span", { className: "shrink-0", children: i }) : null,
2877
- /* @__PURE__ */ s("p", { className: C("min-w-0", x), children: m })
2877
+ /* @__PURE__ */ s("p", { className: S("min-w-0", v), children: m })
2878
2878
  ] }),
2879
2879
  h && /* @__PURE__ */ s("p", { className: p, children: a })
2880
2880
  ] }),
@@ -2884,14 +2884,14 @@ const ei = {
2884
2884
  ] }),
2885
2885
  o && /* @__PURE__ */ s(ti, { variant: e, cta: o })
2886
2886
  ] });
2887
- }, ri = C(
2887
+ }, ri = S(
2888
2888
  "relative block w-[280px] select-none overflow-hidden rounded-md",
2889
2889
  // 1px hairline border that sits flush with the card chrome — matches
2890
2890
  // the messaging design system's "small border around link attachments"
2891
2891
  // treatment from the mobile spec. The drop shadow remains for depth.
2892
2892
  "border border-black/[0.08]",
2893
2893
  "shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
2894
- ), Be = ({
2894
+ ), Ue = ({
2895
2895
  variant: e,
2896
2896
  children: t,
2897
2897
  href: n,
@@ -2902,7 +2902,7 @@ const ei = {
2902
2902
  bgClassName: l,
2903
2903
  "data-testid": d
2904
2904
  }) => {
2905
- const m = n != null || a != null, g = C(
2905
+ const m = n != null || a != null, g = S(
2906
2906
  ri,
2907
2907
  l ?? (e === "dark" ? "bg-[#1e2330]" : "bg-white"),
2908
2908
  // `focus-ring` is a design-system utility from the component-library
@@ -2933,7 +2933,7 @@ const ei = {
2933
2933
  onClick: a,
2934
2934
  "aria-label": r,
2935
2935
  "data-testid": d,
2936
- className: C(g, "text-left"),
2936
+ className: S(g, "text-left"),
2937
2937
  children: [
2938
2938
  t,
2939
2939
  h
@@ -2957,7 +2957,7 @@ const ei = {
2957
2957
  }, li = {
2958
2958
  dark: "size-16 text-white/25",
2959
2959
  light: "size-16 text-black/25"
2960
- }, We = (e, t) => !!t && !!e && ce(e) === "audio", Et = (e, t) => {
2960
+ }, qe = (e, t) => !!t && !!e && ce(e) === "audio", Et = (e, t) => {
2961
2961
  if (!t || !e) return !1;
2962
2962
  const n = ce(e);
2963
2963
  return n === "video" || n === "audio";
@@ -2971,7 +2971,7 @@ const ei = {
2971
2971
  topRight: o
2972
2972
  }) => {
2973
2973
  const l = ce(r), d = !!n && l === "video", m = he(t);
2974
- return We(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
2974
+ return qe(r, n) ? /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s(
2975
2975
  "audio",
2976
2976
  {
2977
2977
  src: n,
@@ -2983,7 +2983,7 @@ const ei = {
2983
2983
  ) }) : /* @__PURE__ */ u(
2984
2984
  "div",
2985
2985
  {
2986
- className: C(
2986
+ className: S(
2987
2987
  "relative h-[180px] w-full overflow-hidden",
2988
2988
  d && "bg-black"
2989
2989
  ),
@@ -3010,11 +3010,11 @@ const ei = {
3010
3010
  ) : /* @__PURE__ */ s(
3011
3011
  "div",
3012
3012
  {
3013
- className: C(
3013
+ className: S(
3014
3014
  "flex h-full w-full items-center justify-center",
3015
3015
  ii[e]
3016
3016
  ),
3017
- children: _e(r, {
3017
+ children: we(r, {
3018
3018
  className: li[e],
3019
3019
  weight: "regular"
3020
3020
  })
@@ -3039,16 +3039,16 @@ const ei = {
3039
3039
  onDismiss: g,
3040
3040
  onEditClick: h
3041
3041
  }) => {
3042
- const f = l === "classic", c = We(r, o), b = g ? /* @__PURE__ */ s(
3042
+ const f = l === "classic", c = qe(r, o), b = g ? /* @__PURE__ */ s(
3043
3043
  "button",
3044
3044
  {
3045
3045
  type: "button",
3046
3046
  onClick: g,
3047
3047
  "aria-label": "Dismiss attachment",
3048
3048
  className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
3049
- children: /* @__PURE__ */ s(Ye, { className: "size-3", weight: "bold" })
3049
+ children: /* @__PURE__ */ s(He, { className: "size-3", weight: "bold" })
3050
3050
  }
3051
- ) : void 0, v = h ? /* @__PURE__ */ s(
3051
+ ) : void 0, x = h ? /* @__PURE__ */ s(
3052
3052
  "button",
3053
3053
  {
3054
3054
  type: "button",
@@ -3058,7 +3058,7 @@ const ei = {
3058
3058
  children: /* @__PURE__ */ s(Qn, { className: "size-5", weight: "regular" })
3059
3059
  }
3060
3060
  ) : void 0;
3061
- return c ? /* @__PURE__ */ s(Be, { variant: "dark", bgClassName: It, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
3061
+ return c ? /* @__PURE__ */ s(Ue, { variant: "dark", bgClassName: It, children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 pr-3", children: [
3062
3062
  /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ s(
3063
3063
  je,
3064
3064
  {
@@ -3070,7 +3070,7 @@ const ei = {
3070
3070
  ) }),
3071
3071
  b && /* @__PURE__ */ s("div", { className: "shrink-0", children: b })
3072
3072
  ] }) }) : /* @__PURE__ */ u(
3073
- Be,
3073
+ Ue,
3074
3074
  {
3075
3075
  variant: "dark",
3076
3076
  topRight: f ? b : void 0,
@@ -3096,7 +3096,7 @@ const ei = {
3096
3096
  url: a,
3097
3097
  appIcon: d,
3098
3098
  cta: m,
3099
- trailingAction: v
3099
+ trailingAction: x
3100
3100
  }
3101
3101
  )
3102
3102
  ]
@@ -3114,15 +3114,15 @@ const ei = {
3114
3114
  cta: d,
3115
3115
  onClick: m
3116
3116
  }) => {
3117
- const g = Et(a, i), h = Ct(n), f = d == null && h != null && !g ? h : void 0, c = d == null && !g ? m : void 0, b = We(a, i) ? It : void 0, v = d && m ? {
3117
+ const g = Et(a, i), h = Ct(n), f = d == null && h != null && !g ? h : void 0, c = d == null && !g ? m : void 0, b = qe(a, i) ? It : void 0, x = d && m ? {
3118
3118
  ...d,
3119
3119
  onClick: () => {
3120
- var x;
3121
- m(), (x = d.onClick) == null || x.call(d);
3120
+ var v;
3121
+ m(), (v = d.onClick) == null || v.call(d);
3122
3122
  }
3123
3123
  } : d;
3124
3124
  return /* @__PURE__ */ u(
3125
- Be,
3125
+ Ue,
3126
3126
  {
3127
3127
  variant: "light",
3128
3128
  href: f,
@@ -3149,7 +3149,7 @@ const ei = {
3149
3149
  description: t,
3150
3150
  url: n,
3151
3151
  appIcon: l,
3152
- cta: v
3152
+ cta: x
3153
3153
  }
3154
3154
  )
3155
3155
  ]
@@ -3170,12 +3170,12 @@ const ei = {
3170
3170
  }) => {
3171
3171
  const h = Et(r, o), f = Ct(a), c = m == null && f != null && !h ? f : void 0, b = m == null && !h && c != null ? g : void 0;
3172
3172
  return /* @__PURE__ */ u(
3173
- Be,
3173
+ Ue,
3174
3174
  {
3175
3175
  variant: "dark",
3176
3176
  href: c,
3177
3177
  onClick: b,
3178
- bgClassName: We(r, o) ? It : void 0,
3178
+ bgClassName: qe(r, o) ? It : void 0,
3179
3179
  children: [
3180
3180
  l === "featured" && /* @__PURE__ */ s(
3181
3181
  je,
@@ -3207,7 +3207,7 @@ const ei = {
3207
3207
  Sent: di,
3208
3208
  Received: ci
3209
3209
  };
3210
- function P(e) {
3210
+ function O(e) {
3211
3211
  const t = e == null ? void 0 : e.trim();
3212
3212
  return t || void 0;
3213
3213
  }
@@ -3226,10 +3226,10 @@ function ui(e, t) {
3226
3226
  return !/[^\p{P}\p{Z}\p{C}]/u.test(r);
3227
3227
  }
3228
3228
  function ss(e) {
3229
- 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);
3229
+ const t = O(e.og_scrape_url) ?? O(e.title_link), n = O(e.image_url) ?? O(e.thumb_url), a = O(e.asset_url), r = O(e.mime_type);
3230
3230
  return {
3231
- title: P(e.title),
3232
- description: P(e.text),
3231
+ title: O(e.title),
3232
+ description: O(e.text),
3233
3233
  url: t,
3234
3234
  thumbnailUrl: he(n),
3235
3235
  // Playable clip embedded in a link preview — lets LinkAttachment render its
@@ -3241,10 +3241,10 @@ function ss(e) {
3241
3241
  }
3242
3242
  function mi(e) {
3243
3243
  var t;
3244
- return Os(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;
3244
+ return Ps(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;
3245
3245
  }
3246
- function Os(e) {
3247
- const t = P(e.og_scrape_url);
3246
+ function Ps(e) {
3247
+ const t = O(e.og_scrape_url);
3248
3248
  return e.type === "link" || !!t && !e.asset_url;
3249
3249
  }
3250
3250
  function Fs(e) {
@@ -3265,7 +3265,7 @@ function Fs(e) {
3265
3265
  t.push({ type: "link", attachments: [r] });
3266
3266
  };
3267
3267
  for (const r of e) {
3268
- if (Os(r)) {
3268
+ if (Ps(r)) {
3269
3269
  a(r);
3270
3270
  continue;
3271
3271
  }
@@ -3281,7 +3281,7 @@ function fi(e, t, n) {
3281
3281
  return t <= 1 ? n : e === 0 ? "first" : e === t - 1 ? "end" : "middle";
3282
3282
  }
3283
3283
  function ns(e) {
3284
- return P(e.image_url) ?? P(e.asset_url) ?? "";
3284
+ return O(e.image_url) ?? O(e.asset_url) ?? "";
3285
3285
  }
3286
3286
  function gi(e) {
3287
3287
  switch (e) {
@@ -3304,25 +3304,25 @@ function pi(e, t) {
3304
3304
  return {
3305
3305
  items: t.map((a) => ({
3306
3306
  src: ns(a),
3307
- alt: P(a.title)
3307
+ alt: O(a.title)
3308
3308
  }))
3309
3309
  };
3310
3310
  case "video":
3311
3311
  return {
3312
3312
  items: t.map((a) => ({
3313
- src: P(a.asset_url) ?? "",
3314
- poster: P(
3313
+ src: O(a.asset_url) ?? "",
3314
+ poster: O(
3315
3315
  a.thumb_url
3316
3316
  ),
3317
- mimeType: P(a.mime_type)
3317
+ mimeType: O(a.mime_type)
3318
3318
  }))
3319
3319
  };
3320
3320
  case "audio":
3321
3321
  return {
3322
3322
  items: t.map((a) => ({
3323
- src: P(a.asset_url) ?? "",
3324
- mimeType: P(a.mime_type) ?? "audio/mpeg",
3325
- filename: P(
3323
+ src: O(a.asset_url) ?? "",
3324
+ mimeType: O(a.mime_type) ?? "audio/mpeg",
3325
+ filename: O(
3326
3326
  a.title
3327
3327
  )
3328
3328
  }))
@@ -3330,8 +3330,8 @@ function pi(e, t) {
3330
3330
  case "pdf":
3331
3331
  return {
3332
3332
  items: t.map((a) => ({
3333
- src: P(a.asset_url) ?? "",
3334
- filename: P(
3333
+ src: O(a.asset_url) ?? "",
3334
+ filename: O(
3335
3335
  a.title
3336
3336
  ),
3337
3337
  fileSize: a.file_size
@@ -3340,12 +3340,12 @@ function pi(e, t) {
3340
3340
  case "file":
3341
3341
  return {
3342
3342
  items: t.map((a) => ({
3343
- src: P(a.asset_url) ?? "",
3344
- filename: P(
3343
+ src: O(a.asset_url) ?? "",
3344
+ filename: O(
3345
3345
  a.title
3346
3346
  ),
3347
3347
  fileSize: a.file_size,
3348
- mimeType: P(a.mime_type) ?? "application/octet-stream"
3348
+ mimeType: O(a.mime_type) ?? "application/octet-stream"
3349
3349
  }))
3350
3350
  };
3351
3351
  }
@@ -3355,32 +3355,32 @@ function pi(e, t) {
3355
3355
  case "image":
3356
3356
  return {
3357
3357
  src: ns(n),
3358
- alt: P(n.title)
3358
+ alt: O(n.title)
3359
3359
  };
3360
3360
  case "video":
3361
3361
  return {
3362
- src: P(n.asset_url) ?? "",
3363
- poster: P(n.thumb_url),
3364
- mimeType: P(n.mime_type)
3362
+ src: O(n.asset_url) ?? "",
3363
+ poster: O(n.thumb_url),
3364
+ mimeType: O(n.mime_type)
3365
3365
  };
3366
3366
  case "audio":
3367
3367
  return {
3368
- src: P(n.asset_url) ?? "",
3369
- mimeType: P(n.mime_type) ?? "audio/mpeg",
3370
- filename: P(n.title)
3368
+ src: O(n.asset_url) ?? "",
3369
+ mimeType: O(n.mime_type) ?? "audio/mpeg",
3370
+ filename: O(n.title)
3371
3371
  };
3372
3372
  case "pdf":
3373
3373
  return {
3374
- src: P(n.asset_url) ?? "",
3375
- filename: P(n.title),
3374
+ src: O(n.asset_url) ?? "",
3375
+ filename: O(n.title),
3376
3376
  fileSize: n.file_size
3377
3377
  };
3378
3378
  case "file":
3379
3379
  return {
3380
- src: P(n.asset_url) ?? "",
3381
- filename: P(n.title),
3380
+ src: O(n.asset_url) ?? "",
3381
+ filename: O(n.title),
3382
3382
  fileSize: n.file_size,
3383
- mimeType: P(n.mime_type) ?? "application/octet-stream"
3383
+ mimeType: O(n.mime_type) ?? "application/octet-stream"
3384
3384
  };
3385
3385
  }
3386
3386
  }
@@ -3404,14 +3404,14 @@ const vi = ({
3404
3404
  var b;
3405
3405
  const r = Fs(n.attachments);
3406
3406
  if (r.length === 0) return null;
3407
- const i = hi(r), o = (b = n.text) == null ? void 0 : b.trim(), l = r.find((v) => v.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? ss(l.attachments[0] ?? {}).url : void 0, m = o && ui(o, d) ? void 0 : o;
3407
+ const i = hi(r), o = (b = n.text) == null ? void 0 : b.trim(), l = r.find((x) => x.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? ss(l.attachments[0] ?? {}).url : void 0, m = o && ui(o, d) ? void 0 : o;
3408
3408
  let g = 0;
3409
- const h = [], f = (v, x) => {
3409
+ const h = [], f = (x, v) => {
3410
3410
  const p = t ? es.Sent : es.Received;
3411
3411
  h.push(
3412
- /* @__PURE__ */ s(p, { ...ss(v) }, x)
3412
+ /* @__PURE__ */ s(p, { ...ss(x) }, v)
3413
3413
  );
3414
- }, c = (v, x) => {
3414
+ }, c = (x, v) => {
3415
3415
  const p = fi(
3416
3416
  g,
3417
3417
  i,
@@ -3423,20 +3423,20 @@ const vi = ({
3423
3423
  {
3424
3424
  groupPosition: p,
3425
3425
  isMyMessage: t,
3426
- segment: v
3426
+ segment: x
3427
3427
  },
3428
- x
3428
+ v
3429
3429
  )
3430
3430
  );
3431
3431
  };
3432
- return r.forEach((v, x) => {
3433
- if (v.type === "link") {
3434
- v.attachments.forEach((p, _) => {
3435
- f(p, `link-${x}-${_}`);
3432
+ return r.forEach((x, v) => {
3433
+ if (x.type === "link") {
3434
+ x.attachments.forEach((p, _) => {
3435
+ f(p, `link-${v}-${_}`);
3436
3436
  });
3437
3437
  return;
3438
3438
  }
3439
- c(v, `media-${x}`);
3439
+ c(x, `media-${v}`);
3440
3440
  }), /* @__PURE__ */ u("div", { className: "str-chat__message-bubble-wrapper", children: [
3441
3441
  /* @__PURE__ */ u(
3442
3442
  "div",
@@ -3467,7 +3467,7 @@ const vi = ({
3467
3467
  ] }) : null
3468
3468
  ] });
3469
3469
  }, xi = (e) => {
3470
- var Dt, zt, Pt, Ot, Ft, $t, Ut, Bt, jt, Vt;
3470
+ var Dt, zt, Ot, Pt, Ft, $t, Bt, Ut, jt, Vt;
3471
3471
  const {
3472
3472
  additionalMessageInputProps: t,
3473
3473
  chatbotVotingEnabled: n,
@@ -3483,13 +3483,13 @@ const vi = ({
3483
3483
  isMyMessage: f,
3484
3484
  message: c,
3485
3485
  renderText: b,
3486
- threadList: v,
3487
- viewerLanguage: x
3488
- } = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: S, onFetchSource: z, onDownloadClick: E } = $r("LockedAttachment"), [R, F] = B(!1), D = tn(c.id), { selected: L, voteUp: y, voteDown: I } = wa(c), {
3489
- Attachment: k = sn,
3486
+ threadList: x,
3487
+ viewerLanguage: v
3488
+ } = e, { client: p } = fe("CustomMessage"), { channel: _ } = oe("CustomMessage"), { isUnlocking: w, onUnlockClick: y, onFetchSource: z, onDownloadClick: E } = $r("LockedAttachment"), [R, F] = U(!1), D = tn(c.id), { selected: L, voteUp: k, voteDown: I } = _a(c), {
3489
+ Attachment: C = sn,
3490
3490
  EditMessageModal: T = nn,
3491
3491
  MessageActions: M,
3492
- MessageBlocked: O = an,
3492
+ MessageBlocked: P = an,
3493
3493
  MessageBouncePrompt: $ = rn,
3494
3494
  MessageDeleted: j = ln,
3495
3495
  MessageIsThreadReplyInChannelButtonIndicator: Z = on,
@@ -3497,24 +3497,24 @@ const vi = ({
3497
3497
  ReminderNotification: X = dn,
3498
3498
  StreamedMessageText: N = un,
3499
3499
  PinIndicator: A
3500
- } = cs("CustomMessage"), Y = mn(c), W = hn(c), H = re(
3500
+ } = cs("CustomMessage"), H = mn(c), q = hn(c), Y = re(
3501
3501
  () => h == null ? void 0 : h(c),
3502
3502
  [h, c]
3503
- ), U = re(() => {
3503
+ ), B = re(() => {
3504
3504
  const me = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...me] : me;
3505
- if (!Ue(c)) return be;
3506
- const Gt = be.filter((Yt) => !("type" in Yt) || !_s(Yt));
3505
+ if (!Be(c)) return be;
3506
+ const Gt = be.filter((Ht) => !("type" in Ht) || !ws(Ht));
3507
3507
  return Gt.length === be.length ? be : Gt;
3508
- }, [c]), q = re(
3509
- () => Fs(U),
3510
- [U]
3508
+ }, [c]), W = re(
3509
+ () => Fs(B),
3510
+ [B]
3511
3511
  ), J = re(() => {
3512
- const me = ps({ message: c, viewerLanguage: x });
3512
+ const me = ps({ message: c, viewerLanguage: v });
3513
3513
  return me === c.text ? c : { ...c, text: me };
3514
- }, [c, x]), de = q.length > 0, De = q.reduce(
3514
+ }, [c, v]), de = W.length > 0, De = W.reduce(
3515
3515
  (me, be) => me + be.attachments.length,
3516
3516
  0
3517
- ) === ((U == null ? void 0 : U.length) ?? 0), ze = Wa({
3517
+ ) === ((B == null ? void 0 : B.length) ?? 0), ze = qa({
3518
3518
  endOfGroup: r,
3519
3519
  firstOfGroup: i,
3520
3520
  groupedByUser: o
@@ -3524,38 +3524,38 @@ const vi = ({
3524
3524
  if (c.deleted_at || c.type === "deleted")
3525
3525
  return /* @__PURE__ */ s(j, { message: c });
3526
3526
  if (gn(c))
3527
- return /* @__PURE__ */ s(O, {});
3528
- const ae = !v && !!c.reply_count, ue = !v && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = pn(c);
3527
+ return /* @__PURE__ */ s(P, {});
3528
+ const ae = !x && !!c.reply_count, ue = !x && c.show_in_channel && c.parent_id, le = c.status === "failed" && ((Dt = c.error) == null ? void 0 : Dt.status) !== 403, Tt = pn(c);
3529
3529
  let ge;
3530
3530
  le ? ge = () => m(c) : Tt && (ge = () => F(!0));
3531
- const se = f(), Gs = C(
3531
+ const se = f(), Gs = S(
3532
3532
  "str-chat__message str-chat__message-simple",
3533
3533
  `str-chat__message--${c.type}`,
3534
3534
  `str-chat__message--${c.status}`,
3535
3535
  se ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
3536
3536
  c.text ? "str-chat__message--has-text" : "has-no-text",
3537
3537
  {
3538
- "str-chat__message--has-attachment": Y,
3538
+ "str-chat__message--has-attachment": H,
3539
3539
  "str-chat__message--highlighted": g,
3540
3540
  "str-chat__message--pinned pinned-message": c.pinned,
3541
- "str-chat__message--with-reactions": W,
3541
+ "str-chat__message--with-reactions": q,
3542
3542
  "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((zt = c == null ? void 0 : c.error) == null ? void 0 : zt.status) !== 403,
3543
3543
  "str-chat__message-with-thread-link": ae || ue,
3544
3544
  "str-chat__virtual-message__wrapper--end": r,
3545
3545
  "str-chat__virtual-message__wrapper--first": i,
3546
3546
  "str-chat__virtual-message__wrapper--group": o
3547
3547
  }
3548
- ), qe = c.poll_id && p.polls.fromState(c.poll_id), Mt = qr(c), pe = Ue(c), Ys = kt(c), Xe = !!(U != null && U.length && !c.quoted_message), At = pe && se && Xe, Hs = de && De && !c.quoted_message && !qe && !H && !pe, Rt = {
3548
+ ), We = c.poll_id && p.polls.fromState(c.poll_id), Mt = Wr(c), pe = Be(c), Hs = kt(c), Xe = !!(B != null && B.length && !c.quoted_message), At = pe && se && Xe, Ys = de && De && !c.quoted_message && !We && !Y && !pe, Rt = {
3549
3549
  contentType: "text",
3550
- amountText: (Pt = c.metadata) == null ? void 0 : Pt.amount_text,
3551
- paymentStatus: (Ot = c.metadata) == null ? void 0 : Ot.payment_status,
3550
+ amountText: (Ot = c.metadata) == null ? void 0 : Ot.amount_text,
3551
+ paymentStatus: (Pt = c.metadata) == null ? void 0 : Pt.payment_status,
3552
3552
  renderedText: c.text && /* @__PURE__ */ s($e, { message: J, renderText: b })
3553
3553
  }, Lt = {
3554
3554
  contentType: "media",
3555
3555
  title: (Ft = c.metadata) == null ? void 0 : Ft.attachment_title,
3556
3556
  mimeType: ($t = c.metadata) == null ? void 0 : $t.attachment_mime_type,
3557
- thumbnailUrl: (Ut = c.metadata) == null ? void 0 : Ut.attachment_thumbnail,
3558
- amountText: (Bt = c.metadata) == null ? void 0 : Bt.amount_text,
3557
+ thumbnailUrl: (Bt = c.metadata) == null ? void 0 : Bt.attachment_thumbnail,
3558
+ amountText: (Ut = c.metadata) == null ? void 0 : Ut.amount_text,
3559
3559
  detail: (jt = c.metadata) == null ? void 0 : jt.attachment_detail,
3560
3560
  paymentStatus: (Vt = c.metadata) == null ? void 0 : Vt.payment_status,
3561
3561
  onFetchSource: z ? () => z(c, _) : void 0
@@ -3599,7 +3599,7 @@ const vi = ({
3599
3599
  /* @__PURE__ */ s(
3600
3600
  "div",
3601
3601
  {
3602
- className: C("str-chat__message-inner", {
3602
+ className: S("str-chat__message-inner", {
3603
3603
  "str-chat__simple-message--error-failed": le || Tt
3604
3604
  }),
3605
3605
  "data-testid": "message-inner",
@@ -3613,41 +3613,41 @@ const vi = ({
3613
3613
  marginInlineEnd: 0,
3614
3614
  marginInlineStart: 0
3615
3615
  },
3616
- children: Mt ? /* @__PURE__ */ s(et, { message: c, standalone: !0 }) : Hr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3616
+ children: Mt ? /* @__PURE__ */ s(et, { message: c, standalone: !0 }) : Yr(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3617
3617
  se && M && /* @__PURE__ */ s(M, {}),
3618
3618
  se ? /* @__PURE__ */ s(
3619
- Oe,
3619
+ Pe,
3620
3620
  {
3621
3621
  ...Rt,
3622
3622
  isMine: !0
3623
3623
  }
3624
3624
  ) : /* @__PURE__ */ s(
3625
- Oe,
3625
+ Pe,
3626
3626
  {
3627
3627
  ...Rt,
3628
3628
  isMine: !1,
3629
3629
  isUnlocking: w(c.id),
3630
- onUnlockClick: () => S == null ? void 0 : S(c, _)
3630
+ onUnlockClick: () => y == null ? void 0 : y(c, _)
3631
3631
  }
3632
3632
  ),
3633
3633
  !se && M && /* @__PURE__ */ s(M, {})
3634
- ] }) }) : Wr(c) ? /* @__PURE__ */ u("div", { className: "str-chat__message-bubble-wrapper", children: [
3634
+ ] }) }) : qr(c) ? /* @__PURE__ */ u("div", { className: "str-chat__message-bubble-wrapper", children: [
3635
3635
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
3636
3636
  se && M && /* @__PURE__ */ s(M, {}),
3637
3637
  se ? /* @__PURE__ */ s(
3638
- Oe,
3638
+ Pe,
3639
3639
  {
3640
3640
  ...Lt,
3641
3641
  isMine: !0,
3642
- onPreviewClick: () => S ? S(c, _) : void 0
3642
+ onPreviewClick: () => y ? y(c, _) : void 0
3643
3643
  }
3644
3644
  ) : /* @__PURE__ */ s(
3645
- Oe,
3645
+ Pe,
3646
3646
  {
3647
3647
  ...Lt,
3648
3648
  isMine: !1,
3649
3649
  isUnlocking: w(c.id),
3650
- onUnlockClick: () => S ? S(c, _) : void 0,
3650
+ onUnlockClick: () => y ? y(c, _) : void 0,
3651
3651
  onDownloadClick: () => E ? E(c, _) : void 0
3652
3652
  }
3653
3653
  ),
@@ -3660,14 +3660,14 @@ const vi = ({
3660
3660
  renderText: b
3661
3661
  }
3662
3662
  ) })
3663
- ] }) : Hs ? /* @__PURE__ */ s(
3663
+ ] }) : Ys ? /* @__PURE__ */ s(
3664
3664
  vi,
3665
3665
  {
3666
3666
  groupPosition: ze,
3667
3667
  isMyMessage: se,
3668
3668
  message: {
3669
3669
  ...J,
3670
- attachments: U,
3670
+ attachments: B,
3671
3671
  // MessageText prefers message.i18n[userLanguage_text] from
3672
3672
  // Stream's TranslationContext over message.text. Drop i18n so
3673
3673
  // the caption uses displayMessage.text from viewerLanguage.
@@ -3684,15 +3684,15 @@ const vi = ({
3684
3684
  isMyMessage: se
3685
3685
  }
3686
3686
  ),
3687
- qe && /* @__PURE__ */ s(vn, { poll: qe }),
3688
- U != null && U.length && !c.quoted_message ? /* @__PURE__ */ s(
3689
- k,
3687
+ We && /* @__PURE__ */ s(vn, { poll: We }),
3688
+ B != null && B.length && !c.quoted_message ? /* @__PURE__ */ s(
3689
+ C,
3690
3690
  {
3691
3691
  actionHandler: l,
3692
- attachments: U
3692
+ attachments: B
3693
3693
  }
3694
3694
  ) : null,
3695
- H ? /* @__PURE__ */ s(
3695
+ Y ? /* @__PURE__ */ s(
3696
3696
  N,
3697
3697
  {
3698
3698
  message: J,
@@ -3709,7 +3709,7 @@ const vi = ({
3709
3709
  ] }) })
3710
3710
  }
3711
3711
  ),
3712
- !Ys && !Mt && /* @__PURE__ */ u("div", { className: "str-chat__message-footer", children: [
3712
+ !Hs && !Mt && /* @__PURE__ */ u("div", { className: "str-chat__message-footer", children: [
3713
3713
  (!pe || At) && /* @__PURE__ */ s(
3714
3714
  et,
3715
3715
  {
@@ -3722,7 +3722,7 @@ const vi = ({
3722
3722
  Xr,
3723
3723
  {
3724
3724
  selected: L,
3725
- onVoteUp: y,
3725
+ onVoteUp: k,
3726
3726
  onVoteDown: I
3727
3727
  }
3728
3728
  )
@@ -3741,12 +3741,12 @@ const vi = ({
3741
3741
  c.id
3742
3742
  )
3743
3743
  ] });
3744
- }, wi = V.memo(
3744
+ }, _i = V.memo(
3745
3745
  xi,
3746
3746
  (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : en(e, t)
3747
- ), _i = (e) => {
3747
+ ), wi = (e) => {
3748
3748
  const t = Ne("CustomMessage");
3749
- return /* @__PURE__ */ s(wi, { ...t, ...e });
3749
+ return /* @__PURE__ */ s(_i, { ...t, ...e });
3750
3750
  }, Ni = () => {
3751
3751
  var n;
3752
3752
  const { handleDelete: e, message: t } = Ne("CustomMessageActions");
@@ -3814,7 +3814,7 @@ const vi = ({
3814
3814
  },
3815
3815
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
3816
3816
  "aria-label": "Close link preview",
3817
- children: /* @__PURE__ */ s(Ye, { className: "size-4 text-black/90" })
3817
+ children: /* @__PURE__ */ s(He, { className: "size-4 text-black/90" })
3818
3818
  }
3819
3819
  ),
3820
3820
  /* @__PURE__ */ u("div", { className: "p-2", children: [
@@ -3826,10 +3826,10 @@ const vi = ({
3826
3826
  );
3827
3827
  }, Si = (e) => ({
3828
3828
  linkPreviews: Array.from(e.previews.values()).filter(
3829
- (t) => Ht.previewIsLoaded(t) || Ht.previewIsLoading(t)
3829
+ (t) => Yt.previewIsLoaded(t) || Yt.previewIsLoading(t)
3830
3830
  )
3831
3831
  }), Ei = () => {
3832
- const { linkPreviewsManager: e } = xn(), { linkPreviews: t } = wn(
3832
+ const { linkPreviewsManager: e } = xn(), { linkPreviews: t } = _n(
3833
3833
  e.state,
3834
3834
  Si
3835
3835
  ), n = (r) => {
@@ -3846,7 +3846,7 @@ const vi = ({
3846
3846
  // fixed-height hero would spill out of the collapsed card box.
3847
3847
  /* @__PURE__ */ s("div", { className: "messaging-link-preview-list flex min-h-0 flex-col items-stretch w-full gap-2 mb-4 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)) })
3848
3848
  ) : null;
3849
- }, Ve = V.createContext(!1), vl = () => Te(Ve), Ii = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
3849
+ }, Ve = V.createContext(!1), Ii = 200, xl = () => Te(Ve), Ti = ({ sendMessage: e, disabled: t, ...n }) => /* @__PURE__ */ s(
3850
3850
  "button",
3851
3851
  {
3852
3852
  ...n,
@@ -3857,8 +3857,8 @@ const vi = ({
3857
3857
  children: /* @__PURE__ */ s(ta, { weight: "bold", className: "size-4" })
3858
3858
  }
3859
3859
  ), as = () => {
3860
- const e = Te(Ve), { handleSubmit: t } = _n(), n = Nn(), a = e || !n, {
3861
- SendButton: r = Ii,
3860
+ const e = Te(Ve), { handleSubmit: t } = wn(), n = Nn(), a = e || !n, {
3861
+ SendButton: r = Ti,
3862
3862
  AttachmentPreviewList: i = yn
3863
3863
  } = cs("CustomMessageInput");
3864
3864
  return (
@@ -3924,17 +3924,23 @@ const vi = ({
3924
3924
  const h = m.current, f = h == null ? void 0 : h.parentElement;
3925
3925
  if (!h || !f)
3926
3926
  return;
3927
- const c = () => {
3927
+ let c = h.offsetHeight;
3928
+ const b = () => {
3929
+ const v = h.offsetHeight, p = v > c;
3930
+ c = v;
3931
+ const _ = Array.from(
3932
+ f.querySelectorAll(".str-chat__list")
3933
+ ).find((y) => y.scrollHeight > y.clientHeight) ?? null, w = _ ? _.scrollHeight - _.scrollTop - _.clientHeight < Ii : !1;
3928
3934
  f.style.setProperty(
3929
3935
  "--messaging-composer-height",
3930
- `${h.offsetHeight + 16}px`
3931
- );
3936
+ `${v + 16}px`
3937
+ ), p && w && _ && (_.scrollTop = _.scrollHeight);
3932
3938
  };
3933
- if (c(), typeof ResizeObserver > "u")
3939
+ if (b(), typeof ResizeObserver > "u")
3934
3940
  return;
3935
- const b = new ResizeObserver(c);
3936
- return b.observe(h), () => {
3937
- b.disconnect(), f.style.removeProperty("--messaging-composer-height");
3941
+ const x = new ResizeObserver(b);
3942
+ return x.observe(h), () => {
3943
+ x.disconnect(), f.style.removeProperty("--messaging-composer-height");
3938
3944
  };
3939
3945
  }, [d]), a ? d ? /* @__PURE__ */ u(
3940
3946
  "div",
@@ -3986,7 +3992,7 @@ const vi = ({
3986
3992
  className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
3987
3993
  children: [
3988
3994
  e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
3989
- /* @__PURE__ */ s(Ve.Provider, { value: l, children: /* @__PURE__ */ s(Wt, { Input: i ?? as }) })
3995
+ /* @__PURE__ */ s(Ve.Provider, { value: l, children: /* @__PURE__ */ s(qt, { Input: i ?? as }) })
3990
3996
  ]
3991
3997
  }
3992
3998
  ),
@@ -4005,28 +4011,28 @@ const vi = ({
4005
4011
  className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
4006
4012
  children: [
4007
4013
  e && /* @__PURE__ */ s("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
4008
- /* @__PURE__ */ s(Ve.Provider, { value: l, children: /* @__PURE__ */ s(Wt, { Input: as }) })
4014
+ /* @__PURE__ */ s(Ve.Provider, { value: l, children: /* @__PURE__ */ s(qt, { Input: as }) })
4009
4015
  ]
4010
4016
  }
4011
4017
  ),
4012
4018
  n == null ? void 0 : n()
4013
4019
  ] });
4014
- }, Ti = [
4020
+ }, Mi = [
4015
4021
  "SYSTEM_DM_AGENT_PAUSED",
4016
4022
  "SYSTEM_DM_AGENT_RESUMED"
4017
- ], Mi = {
4023
+ ], Ai = {
4018
4024
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
4019
4025
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
4020
- }, Ai = [
4026
+ }, Ri = [
4021
4027
  "SYSTEM_AGE_SAFETY_BLOCKED"
4022
- ], Ri = ["SYSTEM_AGE_SAFETY_BLOCKED"], Li = {
4028
+ ], Li = ["SYSTEM_AGE_SAFETY_BLOCKED"], Di = {
4023
4029
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
4024
- }, st = "age safety guidelines.", Di = "https://linktr.ee/s/about/contact", is = (e) => Ti.includes(e), zi = (e) => Ai.includes(e), Pi = (e) => Ri.includes(
4030
+ }, st = "age safety guidelines.", zi = "https://linktr.ee/s/about/contact", is = (e) => Mi.includes(e), Oi = (e) => Ri.includes(e), Pi = (e) => Li.includes(
4025
4031
  e
4026
- ), Oi = (e) => {
4032
+ ), Fi = (e) => {
4027
4033
  var t;
4028
4034
  return Pi((t = e.metadata) == null ? void 0 : t.custom_type);
4029
- }, Fi = (e) => {
4035
+ }, $i = (e) => {
4030
4036
  var a;
4031
4037
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
4032
4038
  if (is(t))
@@ -4034,7 +4040,7 @@ const vi = ({
4034
4040
  kind: "dm-agent",
4035
4041
  type: t
4036
4042
  };
4037
- if (zi(t))
4043
+ if (Oi(t))
4038
4044
  return {
4039
4045
  kind: "age-safety",
4040
4046
  type: t
@@ -4045,7 +4051,7 @@ const vi = ({
4045
4051
  kind: "dm-agent",
4046
4052
  type: n
4047
4053
  };
4048
- }, $i = (e) => {
4054
+ }, Bi = (e) => {
4049
4055
  const t = e.indexOf(st);
4050
4056
  if (t === -1)
4051
4057
  return e;
@@ -4055,7 +4061,7 @@ const vi = ({
4055
4061
  /* @__PURE__ */ s(
4056
4062
  "a",
4057
4063
  {
4058
- href: Di,
4064
+ href: zi,
4059
4065
  target: "_blank",
4060
4066
  rel: "noopener noreferrer",
4061
4067
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
@@ -4066,11 +4072,11 @@ const vi = ({
4066
4072
  ] });
4067
4073
  }, Ui = (e) => {
4068
4074
  var a, r;
4069
- const t = !Oi(e.message), n = Fi(
4075
+ const t = !Fi(e.message), n = $i(
4070
4076
  e.message
4071
4077
  );
4072
4078
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
4073
- const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Mi[n.type];
4079
+ const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ai[n.type];
4074
4080
  return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
4075
4081
  /* @__PURE__ */ u(
4076
4082
  "div",
@@ -4080,7 +4086,7 @@ const vi = ({
4080
4086
  "data-dm-agent-system-type": n.type,
4081
4087
  children: [
4082
4088
  /* @__PURE__ */ s(
4083
- we,
4089
+ _e,
4084
4090
  {
4085
4091
  size: 16,
4086
4092
  weight: "regular",
@@ -4096,7 +4102,7 @@ const vi = ({
4096
4102
  ] });
4097
4103
  }
4098
4104
  if ((n == null ? void 0 : n.kind) === "age-safety") {
4099
- const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Li[n.type];
4105
+ const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Di[n.type];
4100
4106
  return /* @__PURE__ */ u("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
4101
4107
  /* @__PURE__ */ u(
4102
4108
  "div",
@@ -4115,7 +4121,7 @@ const vi = ({
4115
4121
  "data-testid": "age-safety-system-message-icon"
4116
4122
  }
4117
4123
  ),
4118
- /* @__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) }) })
4124
+ /* @__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: Bi(i) }) })
4119
4125
  ]
4120
4126
  }
4121
4127
  ),
@@ -4140,21 +4146,21 @@ const vi = ({
4140
4146
  begin: `${120 * t}ms`,
4141
4147
  repeatCount: "indefinite"
4142
4148
  }
4143
- ) }), Bi = /* @__PURE__ */ new Set([
4149
+ ) }), ji = /* @__PURE__ */ new Set([
4144
4150
  Ze.Thinking,
4145
4151
  Ze.Generating,
4146
4152
  Ze.ExternalSources
4147
- ]), ji = ({ threadList: e }) => {
4148
- var b, v;
4153
+ ]), Vi = ({ threadList: e }) => {
4154
+ var b, x;
4149
4155
  const { channel: t, channelConfig: n, thread: a } = oe(), { client: r } = fe(), { typing: i = {} } = Sn(), { aiState: o } = En(t), l = Te($s);
4150
- if (!e && l && Bi.has(o)) {
4151
- const x = Vi(t, (b = r.user) == null ? void 0 : b.id);
4156
+ if (!e && l && ji.has(o)) {
4157
+ const v = Gi(t, (b = r.user) == null ? void 0 : b.id);
4152
4158
  return /* @__PURE__ */ s(
4153
4159
  ls,
4154
4160
  {
4155
- avatarId: (x == null ? void 0 : x.id) ?? "ai-agent",
4156
- avatarName: (x == null ? void 0 : x.name) ?? (x == null ? void 0 : x.id) ?? "Agent",
4157
- avatarImage: x == null ? void 0 : x.image,
4161
+ avatarId: (v == null ? void 0 : v.id) ?? "ai-agent",
4162
+ avatarName: (v == null ? void 0 : v.name) ?? (v == null ? void 0 : v.id) ?? "Agent",
4163
+ avatarImage: v == null ? void 0 : v.image,
4158
4164
  testId: "typing-indicator-ai"
4159
4165
  }
4160
4166
  );
@@ -4162,19 +4168,19 @@ const vi = ({
4162
4168
  if ((n == null ? void 0 : n.typing_events) === !1)
4163
4169
  return null;
4164
4170
  const m = e ? [] : Object.values(i).filter(
4165
- ({ parent_id: x, user: p }) => {
4171
+ ({ parent_id: v, user: p }) => {
4166
4172
  var _;
4167
- return (p == null ? void 0 : p.id) !== ((_ = r.user) == null ? void 0 : _.id) && !x;
4173
+ return (p == null ? void 0 : p.id) !== ((_ = r.user) == null ? void 0 : _.id) && !v;
4168
4174
  }
4169
4175
  ), g = e ? Object.values(i).filter(
4170
- ({ parent_id: x, user: p }) => {
4176
+ ({ parent_id: v, user: p }) => {
4171
4177
  var _;
4172
- return (p == null ? void 0 : p.id) !== ((_ = r.user) == null ? void 0 : _.id) && x === (a == null ? void 0 : a.id);
4178
+ return (p == null ? void 0 : p.id) !== ((_ = r.user) == null ? void 0 : _.id) && v === (a == null ? void 0 : a.id);
4173
4179
  }
4174
4180
  ) : [], h = e ? g : m;
4175
4181
  if (!h.length)
4176
4182
  return null;
4177
- const f = (v = h[0]) == null ? void 0 : v.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
4183
+ const f = (x = h[0]) == null ? void 0 : x.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
4178
4184
  return /* @__PURE__ */ s(
4179
4185
  ls,
4180
4186
  {
@@ -4228,7 +4234,7 @@ const vi = ({
4228
4234
  ] })
4229
4235
  }
4230
4236
  );
4231
- function Vi(e, t) {
4237
+ function Gi(e, t) {
4232
4238
  var a;
4233
4239
  const n = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
4234
4240
  for (const r of Object.values(n)) {
@@ -4237,10 +4243,10 @@ function Vi(e, t) {
4237
4243
  return i;
4238
4244
  }
4239
4245
  }
4240
- const Gi = () => null, Yi = ({ className: e, message: t }) => /* @__PURE__ */ u(
4246
+ const Hi = () => null, Yi = ({ className: e, message: t }) => /* @__PURE__ */ u(
4241
4247
  "div",
4242
4248
  {
4243
- className: C("flex items-center justify-center h-full", e),
4249
+ className: S("flex items-center justify-center h-full", e),
4244
4250
  children: [
4245
4251
  /* @__PURE__ */ u("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
4246
4252
  /* @__PURE__ */ s("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ s(
@@ -4285,7 +4291,7 @@ const Gi = () => null, Yi = ({ className: e, message: t }) => /* @__PURE__ */ u(
4285
4291
  /* @__PURE__ */ s("span", { className: "text-sm text-stone", children: "Loading messages" })
4286
4292
  ] }) }));
4287
4293
  Ge.displayName = "LoadingState";
4288
- const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Fe = "Replies instantly with AI assistant", Hi = ({
4294
+ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Fe = "Replies instantly with AI assistant", qi = ({
4289
4295
  onBack: e,
4290
4296
  showBackButton: t,
4291
4297
  showStarButton: n = !1,
@@ -4301,27 +4307,27 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4301
4307
  customChannelActions: f,
4302
4308
  renderChannelActions: c,
4303
4309
  showChannelInfo: b = !0,
4304
- onParticipantNameClick: v,
4305
- renderHeaderTitleBadges: x
4310
+ onParticipantNameClick: x,
4311
+ renderHeaderTitleBadges: v
4306
4312
  }) => {
4307
- var I, k, T, M, O, $;
4313
+ var I, C, T, M, P, $;
4308
4314
  const { channel: p } = oe(), { client: _ } = fe(), w = V.useMemo(
4309
4315
  () => {
4310
4316
  var j;
4311
- return He(
4317
+ return Ye(
4312
4318
  (j = p.state) == null ? void 0 : j.members,
4313
4319
  _ == null ? void 0 : _.userID,
4314
4320
  p.type
4315
4321
  );
4316
4322
  },
4317
4323
  [(I = p.state) == null ? void 0 : I.members, _ == null ? void 0 : _.userID, p.type]
4318
- ), S = ht(w == null ? void 0 : w.user), z = (k = w == null ? void 0 : w.user) == null ? void 0 : k.image, E = mt(p), R = x == null ? void 0 : x({
4324
+ ), y = ht(w == null ? void 0 : w.user), z = (C = w == null ? void 0 : w.user) == null ? void 0 : C.image, E = mt(p), R = v == null ? void 0 : v({
4319
4325
  channel: p,
4320
4326
  participant: w
4321
4327
  }), F = "flex max-w-full flex-col items-center gap-1 rounded-[12px] px-1 py-0.5 text-center text-xs font-medium text-black/90", D = "flex min-w-0 max-w-full items-center gap-4 rounded-[12px] px-1 py-0.5 text-left text-black/90", L = /* @__PURE__ */ u(te, { children: [
4322
- /* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: S }),
4328
+ /* @__PURE__ */ s("span", { className: "min-w-0 truncate", children: y }),
4323
4329
  R && /* @__PURE__ */ s("span", { className: "shrink-0", children: R })
4324
- ] }), y = async () => {
4330
+ ] }), k = async () => {
4325
4331
  try {
4326
4332
  E ? await p.unpin() : await p.pin();
4327
4333
  } catch (j) {
@@ -4336,7 +4342,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4336
4342
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ s(
4337
4343
  "button",
4338
4344
  {
4339
- className: C(
4345
+ className: S(
4340
4346
  ve,
4341
4347
  "messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
4342
4348
  ),
@@ -4352,13 +4358,13 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4352
4358
  {
4353
4359
  className: "flex flex-col gap-1 items-center",
4354
4360
  "data-dd-privacy": "mask",
4355
- children: v ? /* @__PURE__ */ u(
4361
+ children: x ? /* @__PURE__ */ u(
4356
4362
  "button",
4357
4363
  {
4358
4364
  type: "button",
4359
- onClick: v,
4360
- "aria-label": `View details for ${S}`,
4361
- className: C(
4365
+ onClick: x,
4366
+ "aria-label": `View details for ${y}`,
4367
+ className: S(
4362
4368
  F,
4363
4369
  "appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
4364
4370
  ),
@@ -4367,7 +4373,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4367
4373
  ne,
4368
4374
  {
4369
4375
  id: ((T = w == null ? void 0 : w.user) == null ? void 0 : T.id) || p.id || "unknown",
4370
- name: S,
4376
+ name: y,
4371
4377
  image: z,
4372
4378
  starred: n && E,
4373
4379
  dmAgentEnabled: a,
@@ -4379,7 +4385,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4379
4385
  /* @__PURE__ */ s(xe, { className: "size-3 shrink-0", weight: "bold" })
4380
4386
  ] }),
4381
4387
  a && /* @__PURE__ */ u("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
4382
- /* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
4388
+ /* @__PURE__ */ s(_e, { className: "size-3 shrink-0 text-black/55" }),
4383
4389
  /* @__PURE__ */ s("span", { children: Fe })
4384
4390
  ] })
4385
4391
  ]
@@ -4389,7 +4395,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4389
4395
  ne,
4390
4396
  {
4391
4397
  id: ((M = w == null ? void 0 : w.user) == null ? void 0 : M.id) || p.id || "unknown",
4392
- name: S,
4398
+ name: y,
4393
4399
  image: z,
4394
4400
  starred: n && E,
4395
4401
  dmAgentEnabled: a,
@@ -4407,7 +4413,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4407
4413
  )
4408
4414
  ] }),
4409
4415
  a && /* @__PURE__ */ u("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
4410
- /* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
4416
+ /* @__PURE__ */ s(_e, { className: "size-3 shrink-0 text-black/55" }),
4411
4417
  /* @__PURE__ */ s("span", { children: Fe })
4412
4418
  ] })
4413
4419
  ] })
@@ -4418,13 +4424,13 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4418
4424
  "button",
4419
4425
  {
4420
4426
  className: ve,
4421
- onClick: y,
4427
+ onClick: k,
4422
4428
  type: "button",
4423
4429
  "aria-label": E ? "Unstar conversation" : "Star conversation",
4424
4430
  children: /* @__PURE__ */ s(
4425
4431
  Ie,
4426
4432
  {
4427
- className: C("size-5", {
4433
+ className: S("size-5", {
4428
4434
  "text-yellow-600": E,
4429
4435
  "text-black/90": !E
4430
4436
  }),
@@ -4447,7 +4453,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4447
4453
  onBlockParticipantClick: g,
4448
4454
  onReportParticipantClick: h,
4449
4455
  customChannelActions: f,
4450
- triggerClassName: C(ve, "bg-[#F1F0EE]")
4456
+ triggerClassName: S(ve, "bg-[#F1F0EE]")
4451
4457
  }
4452
4458
  ))
4453
4459
  ] })
@@ -4457,7 +4463,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4457
4463
  t && e && /* @__PURE__ */ s(
4458
4464
  "button",
4459
4465
  {
4460
- className: C(
4466
+ className: S(
4461
4467
  ve,
4462
4468
  "messaging-channel-view-back-button-desktop"
4463
4469
  ),
@@ -4467,13 +4473,13 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4467
4473
  children: /* @__PURE__ */ s(rt, { className: "size-5 text-black/90" })
4468
4474
  }
4469
4475
  ),
4470
- v ? /* @__PURE__ */ u(
4476
+ x ? /* @__PURE__ */ u(
4471
4477
  "button",
4472
4478
  {
4473
4479
  type: "button",
4474
- onClick: v,
4475
- "aria-label": `View details for ${S}`,
4476
- className: C(
4480
+ onClick: x,
4481
+ "aria-label": `View details for ${y}`,
4482
+ className: S(
4477
4483
  D,
4478
4484
  "appearance-none border-0 bg-transparent transition-opacity hover:opacity-70 focus-ring focus-visible:outline-none"
4479
4485
  ),
@@ -4481,8 +4487,8 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4481
4487
  /* @__PURE__ */ s(
4482
4488
  ne,
4483
4489
  {
4484
- id: ((O = w == null ? void 0 : w.user) == null ? void 0 : O.id) || p.id || "unknown",
4485
- name: S,
4490
+ id: ((P = w == null ? void 0 : w.user) == null ? void 0 : P.id) || p.id || "unknown",
4491
+ name: y,
4486
4492
  image: z,
4487
4493
  starred: n && E,
4488
4494
  dmAgentEnabled: a,
@@ -4495,7 +4501,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4495
4501
  /* @__PURE__ */ s(xe, { className: "size-4 shrink-0", weight: "bold" })
4496
4502
  ] }),
4497
4503
  a && /* @__PURE__ */ u("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
4498
- /* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
4504
+ /* @__PURE__ */ s(_e, { className: "size-3 shrink-0 text-black/55" }),
4499
4505
  /* @__PURE__ */ s("span", { className: "truncate", children: Fe })
4500
4506
  ] })
4501
4507
  ] })
@@ -4506,7 +4512,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4506
4512
  ne,
4507
4513
  {
4508
4514
  id: (($ = w == null ? void 0 : w.user) == null ? void 0 : $.id) || p.id || "unknown",
4509
- name: S,
4515
+ name: y,
4510
4516
  image: z,
4511
4517
  starred: n && E,
4512
4518
  dmAgentEnabled: a,
@@ -4525,7 +4531,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4525
4531
  )
4526
4532
  ] }),
4527
4533
  a && /* @__PURE__ */ u("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
4528
- /* @__PURE__ */ s(we, { className: "size-3 shrink-0 text-black/55" }),
4534
+ /* @__PURE__ */ s(_e, { className: "size-3 shrink-0 text-black/55" }),
4529
4535
  /* @__PURE__ */ s("span", { className: "truncate", children: Fe })
4530
4536
  ] })
4531
4537
  ] })
@@ -4536,13 +4542,13 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4536
4542
  "button",
4537
4543
  {
4538
4544
  className: ve,
4539
- onClick: y,
4545
+ onClick: k,
4540
4546
  type: "button",
4541
4547
  "aria-label": E ? "Unstar conversation" : "Star conversation",
4542
4548
  children: /* @__PURE__ */ s(
4543
4549
  Ie,
4544
4550
  {
4545
- className: C("size-6", {
4551
+ className: S("size-6", {
4546
4552
  "text-yellow-600": E,
4547
4553
  "text-black/90": !E
4548
4554
  }),
@@ -4587,12 +4593,12 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4587
4593
  showReportParticipant: f = !0,
4588
4594
  composerDisabled: c = !1,
4589
4595
  composerDisabledReason: b,
4590
- showStarButton: v = !1,
4591
- chatbotVotingEnabled: x = !1,
4596
+ showStarButton: x = !1,
4597
+ chatbotVotingEnabled: v = !1,
4592
4598
  renderChannelBanner: p,
4593
4599
  renderHeaderTitleBadges: _,
4594
4600
  customChannelActions: w,
4595
- renderChannelActions: S,
4601
+ renderChannelActions: y,
4596
4602
  renderMessage: z,
4597
4603
  dmAgentEnabled: E = !1,
4598
4604
  viewerLanguage: R,
@@ -4600,26 +4606,26 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4600
4606
  onParticipantNameClick: D,
4601
4607
  composerInput: L
4602
4608
  }) => {
4603
- var N, A, Y, W;
4604
- const { channel: y } = oe(), { client: I } = fe(), k = V.useMemo(
4609
+ var N, A, H, q;
4610
+ const { channel: k } = oe(), { client: I } = fe(), C = V.useMemo(
4605
4611
  () => {
4606
- var H;
4607
- return He(
4608
- (H = y.state) == null ? void 0 : H.members,
4612
+ var Y;
4613
+ return Ye(
4614
+ (Y = k.state) == null ? void 0 : Y.members,
4609
4615
  I == null ? void 0 : I.userID,
4610
- y.type
4616
+ k.type
4611
4617
  );
4612
4618
  },
4613
- [(N = y.state) == null ? void 0 : N.members, I == null ? void 0 : I.userID, y.type]
4619
+ [(N = k.state) == null ? void 0 : N.members, I == null ? void 0 : I.userID, k.type]
4614
4620
  ), T = V.useMemo(() => {
4615
- var q;
4616
- const H = I == null ? void 0 : I.userID;
4617
- return H ? Object.values(((q = y.state) == null ? void 0 : q.members) || {}).find((J) => {
4621
+ var W;
4622
+ const Y = I == null ? void 0 : I.userID;
4623
+ return Y ? Object.values(((W = k.state) == null ? void 0 : W.members) || {}).find((J) => {
4618
4624
  var de;
4619
- return ((de = J.user) == null ? void 0 : de.id) === H;
4625
+ return ((de = J.user) == null ? void 0 : de.id) === Y;
4620
4626
  }) : void 0;
4621
- }, [I == null ? void 0 : I.userID, (A = y.state) == null ? void 0 : A.members]), M = ((Y = T == null ? void 0 : T.user) == null ? void 0 : Y.is_account) ?? (T == null ? void 0 : T.is_account), O = ((W = k == null ? void 0 : k.user) == null ? void 0 : W.is_account) ?? (k == null ? void 0 : k.is_account), $ = E && M === !1 && O === !0, j = y.state.messages.some(
4622
- (H) => H.type !== "deleted"
4627
+ }, [I == null ? void 0 : I.userID, (A = k.state) == null ? void 0 : A.members]), M = ((H = T == null ? void 0 : T.user) == null ? void 0 : H.is_account) ?? (T == null ? void 0 : T.is_account), P = ((q = C == null ? void 0 : C.user) == null ? void 0 : q.is_account) ?? (C == null ? void 0 : C.is_account), $ = E && M === !1 && P === !0, j = k.state.messages.some(
4628
+ (Y) => Y.type !== "deleted"
4623
4629
  ), Z = p ? /* @__PURE__ */ s(V.Fragment, { children: p() }, "lt-channel-banner") : null, ee = D ? /* @__PURE__ */ s(
4624
4630
  ba,
4625
4631
  {
@@ -4627,7 +4633,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4627
4633
  onBack: e,
4628
4634
  showBackButton: t,
4629
4635
  showChannelInfo: F,
4630
- showStarButton: v,
4636
+ showStarButton: x,
4631
4637
  dmAgentEnabled: $,
4632
4638
  onLeaveConversation: i,
4633
4639
  onBlockParticipant: o,
@@ -4638,22 +4644,22 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4638
4644
  onBlockParticipantClick: m,
4639
4645
  onReportParticipantClick: g,
4640
4646
  customChannelActions: w,
4641
- renderChannelActions: S,
4647
+ renderChannelActions: y,
4642
4648
  onParticipantNameClick: D
4643
4649
  }
4644
4650
  ) : null, X = Q(
4645
- (H) => {
4646
- const { message: U } = Ne("ChannelView"), q = /* @__PURE__ */ s(
4647
- _i,
4651
+ (Y) => {
4652
+ const { message: B } = Ne("ChannelView"), W = /* @__PURE__ */ s(
4653
+ wi,
4648
4654
  {
4649
- ...H,
4650
- chatbotVotingEnabled: x,
4655
+ ...Y,
4656
+ chatbotVotingEnabled: v,
4651
4657
  viewerLanguage: R
4652
4658
  }
4653
4659
  );
4654
- return !z || !U ? q : z(q, U);
4660
+ return !z || !B ? W : z(W, B);
4655
4661
  },
4656
- [x, z, R]
4662
+ [v, z, R]
4657
4663
  );
4658
4664
  return /* @__PURE__ */ s(te, { children: /* @__PURE__ */ s(
4659
4665
  Tn,
@@ -4667,12 +4673,12 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4667
4673
  children: /* @__PURE__ */ u(Mn, { children: [
4668
4674
  !D && /* @__PURE__ */ u(te, { children: [
4669
4675
  /* @__PURE__ */ s("div", { children: /* @__PURE__ */ s(
4670
- Hi,
4676
+ qi,
4671
4677
  {
4672
4678
  onBack: e,
4673
4679
  showBackButton: t,
4674
4680
  showChannelInfo: F,
4675
- showStarButton: v,
4681
+ showStarButton: x,
4676
4682
  dmAgentEnabled: $,
4677
4683
  onLeaveConversation: i,
4678
4684
  onBlockParticipant: o,
@@ -4683,7 +4689,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4683
4689
  onBlockParticipantClick: m,
4684
4690
  onReportParticipantClick: g,
4685
4691
  customChannelActions: w,
4686
- renderChannelActions: S,
4692
+ renderChannelActions: y,
4687
4693
  renderHeaderTitleBadges: _
4688
4694
  }
4689
4695
  ) }, "lt-channel-header"),
@@ -4700,7 +4706,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4700
4706
  Z
4701
4707
  ] }) }),
4702
4708
  /* @__PURE__ */ s(
4703
- qt,
4709
+ Wt,
4704
4710
  {
4705
4711
  head: D && j ? /* @__PURE__ */ u("div", { className: "sticky top-0 z-10", children: [
4706
4712
  ee,
@@ -4718,12 +4724,12 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4718
4724
  rs,
4719
4725
  {
4720
4726
  ...n && {
4721
- renderActions: () => n == null ? void 0 : n(y)
4727
+ renderActions: () => n == null ? void 0 : n(k)
4722
4728
  },
4723
4729
  ...r && {
4724
- renderHeader: () => r(y)
4730
+ renderHeader: () => r(k)
4725
4731
  },
4726
- renderFooter: () => a == null ? void 0 : a(y),
4732
+ renderFooter: () => a == null ? void 0 : a(k),
4727
4733
  disabled: c,
4728
4734
  disabledReason: b,
4729
4735
  composerInput: L
@@ -4741,7 +4747,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4741
4747
  Z
4742
4748
  ] }) }),
4743
4749
  /* @__PURE__ */ s(
4744
- qt,
4750
+ Wt,
4745
4751
  {
4746
4752
  head: D && j ? /* @__PURE__ */ u("div", { className: "sticky top-0 z-10", children: [
4747
4753
  ee,
@@ -4755,14 +4761,14 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4755
4761
  },
4756
4762
  "lt-channel-message-list"
4757
4763
  ),
4758
- r ? /* @__PURE__ */ s(V.Fragment, { children: r(y) }, "lt-channel-conversation-footer") : null,
4764
+ r ? /* @__PURE__ */ s(V.Fragment, { children: r(k) }, "lt-channel-conversation-footer") : null,
4759
4765
  /* @__PURE__ */ s(
4760
4766
  rs,
4761
4767
  {
4762
4768
  ...n && {
4763
- renderActions: () => n == null ? void 0 : n(y)
4769
+ renderActions: () => n == null ? void 0 : n(k)
4764
4770
  },
4765
- renderFooter: () => a == null ? void 0 : a(y),
4771
+ renderFooter: () => a == null ? void 0 : a(k),
4766
4772
  disabled: c,
4767
4773
  disabledReason: b,
4768
4774
  composerInput: L
@@ -4773,7 +4779,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4773
4779
  ] })
4774
4780
  }
4775
4781
  ) });
4776
- }, Us = V.memo(
4782
+ }, Bs = V.memo(
4777
4783
  ({
4778
4784
  channel: e,
4779
4785
  onBack: t,
@@ -4784,69 +4790,69 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4784
4790
  onLeaveConversation: o,
4785
4791
  onBlockParticipant: l,
4786
4792
  className: d,
4787
- CustomChannelEmptyState: m = Gi,
4793
+ CustomChannelEmptyState: m = Hi,
4788
4794
  showDeleteConversation: g = !0,
4789
4795
  onDeleteConversationClick: h,
4790
4796
  onBlockParticipantClick: f,
4791
4797
  onReportParticipantClick: c,
4792
4798
  showBlockParticipant: b = !0,
4793
- showReportParticipant: v = !0,
4794
- composerDisabled: x = !1,
4799
+ showReportParticipant: x = !0,
4800
+ composerDisabled: v = !1,
4795
4801
  composerDisabledReason: p,
4796
4802
  dmAgentEnabled: _,
4797
4803
  messageMetadata: w,
4798
- onMessageSent: S,
4804
+ onMessageSent: y,
4799
4805
  showStarButton: z = !1,
4800
4806
  chatbotVotingEnabled: E = !1,
4801
4807
  renderChannelBanner: R,
4802
4808
  renderHeaderTitleBadges: F,
4803
4809
  customChannelActions: D,
4804
4810
  renderChannelActions: L,
4805
- renderMessage: y,
4811
+ renderMessage: k,
4806
4812
  onMessageLinkClick: I,
4807
- sendButton: k,
4813
+ sendButton: C,
4808
4814
  attachmentPreviewList: T,
4809
4815
  viewerLanguage: M,
4810
- showChannelInfo: O = !0,
4816
+ showChannelInfo: P = !0,
4811
4817
  onParticipantNameClick: $,
4812
4818
  composerInput: j
4813
4819
  }) => {
4814
4820
  const Z = Q(
4815
4821
  async (X, N, A) => {
4816
4822
  var J;
4817
- const Y = ((J = e.data) == null ? void 0 : J.chatbot_paused) === !0, W = _ && !Y, H = {
4823
+ const H = ((J = e.data) == null ? void 0 : J.chatbot_paused) === !0, q = _ && !H, Y = {
4818
4824
  ...N,
4819
- ...W && { silent: !0 },
4825
+ ...q && { silent: !0 },
4820
4826
  ...w && {
4821
4827
  metadata: {
4822
4828
  ...N.metadata ?? {},
4823
4829
  ...w
4824
4830
  }
4825
4831
  }
4826
- }, U = {
4832
+ }, B = {
4827
4833
  ...A,
4828
- ...W && { skip_push: !0 }
4829
- }, q = await e.sendMessage(H, U);
4830
- return S == null || S(q), q;
4834
+ ...q && { skip_push: !0 }
4835
+ }, W = await e.sendMessage(Y, B);
4836
+ return y == null || y(W), W;
4831
4837
  },
4832
- [e, _, w, S]
4838
+ [e, _, w, y]
4833
4839
  ), ee = G(null);
4834
4840
  return K(() => {
4835
4841
  if (!I) return;
4836
4842
  const X = ee.current;
4837
4843
  if (!X) return;
4838
4844
  const N = (A) => {
4839
- const Y = A.target, W = Y == null ? void 0 : Y.closest("a[href]"), H = W == null ? void 0 : W.getAttribute("href");
4840
- if (!H) return;
4841
- const U = W == null ? void 0 : W.closest("[data-message-id]"), q = U == null ? void 0 : U.getAttribute("data-message-id"), J = q ? e.state.messages.find((de) => de.id === q) : void 0;
4842
- I(H, J);
4845
+ const H = A.target, q = H == null ? void 0 : H.closest("a[href]"), Y = q == null ? void 0 : q.getAttribute("href");
4846
+ if (!Y) return;
4847
+ const B = q == null ? void 0 : q.closest("[data-message-id]"), W = B == null ? void 0 : B.getAttribute("data-message-id"), J = W ? e.state.messages.find((de) => de.id === W) : void 0;
4848
+ I(Y, J);
4843
4849
  };
4844
4850
  return X.addEventListener("click", N), () => X.removeEventListener("click", N);
4845
4851
  }, [I, e]), /* @__PURE__ */ s(
4846
4852
  "div",
4847
4853
  {
4848
4854
  ref: ee,
4849
- className: C(
4855
+ className: S(
4850
4856
  "messaging-channel-view h-full flex flex-col",
4851
4857
  d
4852
4858
  ),
@@ -4858,9 +4864,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4858
4864
  EmptyStateIndicator: m,
4859
4865
  LoadingIndicator: Ge,
4860
4866
  DateSeparator: va,
4861
- TypingIndicator: ji,
4867
+ TypingIndicator: Vi,
4862
4868
  doSendMessageRequest: Z,
4863
- ...k ? { SendButton: k } : {},
4869
+ ...C ? { SendButton: C } : {},
4864
4870
  ...T ? { AttachmentPreviewList: T } : {},
4865
4871
  children: /* @__PURE__ */ s(
4866
4872
  Wi,
@@ -4878,8 +4884,8 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4878
4884
  onBlockParticipantClick: f,
4879
4885
  onReportParticipantClick: c,
4880
4886
  showBlockParticipant: b,
4881
- showReportParticipant: v,
4882
- composerDisabled: x,
4887
+ showReportParticipant: x,
4888
+ composerDisabled: v,
4883
4889
  composerDisabledReason: p,
4884
4890
  showStarButton: z,
4885
4891
  dmAgentEnabled: _,
@@ -4888,9 +4894,9 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4888
4894
  renderHeaderTitleBadges: F,
4889
4895
  customChannelActions: D,
4890
4896
  renderChannelActions: L,
4891
- renderMessage: y,
4897
+ renderMessage: k,
4892
4898
  viewerLanguage: M,
4893
- showChannelInfo: O,
4899
+ showChannelInfo: P,
4894
4900
  onParticipantNameClick: $,
4895
4901
  composerInput: j
4896
4902
  }
@@ -4901,7 +4907,7 @@ const ve = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
4901
4907
  );
4902
4908
  }
4903
4909
  );
4904
- Us.displayName = "ChannelView";
4910
+ Bs.displayName = "ChannelView";
4905
4911
  const Ce = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ u("div", { className: "text-center max-w-sm", children: [
4906
4912
  /* @__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: "⚠️" }) }),
4907
4913
  /* @__PURE__ */ s("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
@@ -4917,7 +4923,7 @@ const Ce = V.memo(({ message: e, onBack: t }) => /* @__PURE__ */ s("div", { clas
4917
4923
  )
4918
4924
  ] }) }));
4919
4925
  Ce.displayName = "ErrorState";
4920
- const xl = ({
4926
+ const _l = ({
4921
4927
  capabilities: e = {},
4922
4928
  renderMessageInputActions: t,
4923
4929
  renderConversationFooter: n,
@@ -4933,12 +4939,12 @@ const xl = ({
4933
4939
  chatbotVotingEnabled: f = !1,
4934
4940
  viewerLanguage: c,
4935
4941
  renderHeaderTitleBadges: b,
4936
- renderChannelBanner: v,
4937
- customChannelActions: x,
4942
+ renderChannelBanner: x,
4943
+ customChannelActions: v,
4938
4944
  renderChannelActions: p,
4939
4945
  onParticipantNameClick: _,
4940
4946
  renderMessage: w,
4941
- onMessageLinkClick: S,
4947
+ onMessageLinkClick: y,
4942
4948
  showChannelInfo: z,
4943
4949
  composerInput: E
4944
4950
  }) => {
@@ -4947,43 +4953,43 @@ const xl = ({
4947
4953
  isConnected: F,
4948
4954
  isLoading: D,
4949
4955
  error: L,
4950
- refreshConnection: y,
4956
+ refreshConnection: k,
4951
4957
  service: I,
4952
- debug: k
4953
- } = aa(), [T, M] = B(null), [O, $] = B(null), [j, Z] = B(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
4958
+ debug: C
4959
+ } = aa(), [T, M] = U(null), [P, $] = U(null), [j, Z] = U(!1), { showDeleteConversation: ee = !0 } = e, X = G(o);
4954
4960
  X.current = o;
4955
4961
  const N = G(a);
4956
4962
  N.current = a;
4957
- const A = G(null), Y = G(null);
4963
+ const A = G(null), H = G(null);
4958
4964
  K(() => {
4959
- Y.current = T;
4965
+ H.current = T;
4960
4966
  }, [T]), K(() => {
4961
4967
  if (!R || !F) return;
4962
- const U = R.userID;
4963
- if (!U) return;
4964
- const q = `${U}::${i}`;
4965
- if (A.current === q) return;
4966
- A.current = q;
4968
+ const B = R.userID;
4969
+ if (!B) return;
4970
+ const W = `${B}::${i}`;
4971
+ if (A.current === W) return;
4972
+ A.current = W;
4967
4973
  const J = () => {
4968
- A.current === q && (A.current = null);
4974
+ A.current === W && (A.current = null);
4969
4975
  };
4970
4976
  (async () => {
4971
4977
  var De, ze;
4972
4978
  try {
4973
- k && console.log(
4979
+ C && console.log(
4974
4980
  "[MessagingShell] Loading initial conversation with:",
4975
4981
  i
4976
4982
  );
4977
4983
  const ae = await R.queryChannels(
4978
4984
  {
4979
4985
  type: "messaging",
4980
- members: { $eq: [U, i] }
4986
+ members: { $eq: [B, i] }
4981
4987
  },
4982
4988
  {},
4983
4989
  { limit: 1 }
4984
4990
  );
4985
4991
  if (ae.length > 0) {
4986
- M(ae[0]), $(null), (De = N.current) == null || De.call(N, ae[0]), k && console.log(
4992
+ M(ae[0]), $(null), (De = N.current) == null || De.call(N, ae[0]), C && console.log(
4987
4993
  "[MessagingShell] Initial conversation loaded:",
4988
4994
  ae[0].id
4989
4995
  );
@@ -4991,7 +4997,7 @@ const xl = ({
4991
4997
  }
4992
4998
  const ue = X.current;
4993
4999
  if (!ue || !I) {
4994
- J(), $("No conversation found with this account"), k && console.log(
5000
+ J(), $("No conversation found with this account"), C && console.log(
4995
5001
  "[MessagingShell] No conversation found for:",
4996
5002
  i
4997
5003
  );
@@ -5003,7 +5009,7 @@ const xl = ({
5003
5009
  name: ue.name,
5004
5010
  phone: ue.phone
5005
5011
  });
5006
- M(le), $(null), (ze = N.current) == null || ze.call(N, le), k && console.log(
5012
+ M(le), $(null), (ze = N.current) == null || ze.call(N, le), C && console.log(
5007
5013
  "[MessagingShell] Channel created and loaded:",
5008
5014
  le.id
5009
5015
  );
@@ -5017,31 +5023,31 @@ const xl = ({
5017
5023
  console.error(
5018
5024
  "[MessagingShell] Failed to load initial conversation:",
5019
5025
  ae
5020
- ), J(), Y.current || $("Failed to load conversation");
5026
+ ), J(), H.current || $("Failed to load conversation");
5021
5027
  }
5022
5028
  })();
5023
- }, [i, R, F, I, k]);
5024
- const W = G(r);
5025
- W.current = r;
5026
- const H = Q(() => {
5027
- var U;
5028
- M(null), Z(!0), (U = W.current) == null || U.call(W);
5029
+ }, [i, R, F, I, C]);
5030
+ const q = G(r);
5031
+ q.current = r;
5032
+ const Y = Q(() => {
5033
+ var B;
5034
+ M(null), Z(!0), (B = q.current) == null || B.call(q);
5029
5035
  }, []);
5030
- return D ? /* @__PURE__ */ s(Ge, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: y }) : !F || !R ? /* @__PURE__ */ s(
5036
+ return D ? /* @__PURE__ */ s(Ge, {}) : L ? /* @__PURE__ */ s(Ce, { message: L, onBack: k }) : !F || !R ? /* @__PURE__ */ s(
5031
5037
  Ce,
5032
5038
  {
5033
5039
  message: "Not connected to messaging service",
5034
- onBack: y
5040
+ onBack: k
5035
5041
  }
5036
- ) : O ? /* @__PURE__ */ s(Ce, { message: O }) : j && !T ? /* @__PURE__ */ s(Ce, { message: "Conversation ended" }) : T ? /* @__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(
5037
- Us,
5042
+ ) : P ? /* @__PURE__ */ s(Ce, { message: P }) : j && !T ? /* @__PURE__ */ s(Ce, { message: "Conversation ended" }) : T ? /* @__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(
5043
+ Bs,
5038
5044
  {
5039
5045
  channel: T,
5040
5046
  renderMessageInputActions: t,
5041
5047
  renderConversationFooter: n,
5042
- renderChannelBanner: v,
5043
- onLeaveConversation: H,
5044
- onBlockParticipant: H,
5048
+ renderChannelBanner: x,
5049
+ onLeaveConversation: Y,
5050
+ onBlockParticipant: Y,
5045
5051
  CustomChannelEmptyState: l,
5046
5052
  showDeleteConversation: ee,
5047
5053
  onBlockParticipantClick: d,
@@ -5051,24 +5057,24 @@ const xl = ({
5051
5057
  chatbotVotingEnabled: f,
5052
5058
  viewerLanguage: c,
5053
5059
  renderHeaderTitleBadges: b,
5054
- customChannelActions: x,
5060
+ customChannelActions: v,
5055
5061
  renderChannelActions: p,
5056
5062
  onParticipantNameClick: _,
5057
5063
  renderMessage: w,
5058
- onMessageLinkClick: S,
5064
+ onMessageLinkClick: y,
5059
5065
  showChannelInfo: z,
5060
5066
  composerInput: E
5061
5067
  },
5062
5068
  T.id
5063
5069
  ) }) }) : /* @__PURE__ */ s(Ge, {});
5064
5070
  };
5065
- function qi(e) {
5071
+ function Xi(e) {
5066
5072
  const t = e.state.pending_messages;
5067
5073
  if (t != null && t.length)
5068
5074
  for (const n of t)
5069
5075
  e.state.addMessageSorted(n.message);
5070
5076
  }
5071
- const Bs = V.createContext({
5077
+ const Us = V.createContext({
5072
5078
  selectedChannel: void 0,
5073
5079
  onChannelSelect: () => {
5074
5080
  },
@@ -5076,18 +5082,18 @@ const Bs = V.createContext({
5076
5082
  renderMessagePreview: void 0,
5077
5083
  channelPreview: void 0,
5078
5084
  viewerLanguage: void 0
5079
- }), Xi = Bs.Provider, Ki = () => V.useContext(Bs), Zi = (e, t) => {
5085
+ }), Ki = Us.Provider, Zi = () => V.useContext(Us), Ji = (e, t) => {
5080
5086
  const n = new Date(
5081
5087
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
5082
5088
  ), r = new Date(
5083
5089
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
5084
5090
  ).getTime() - n.getTime();
5085
5091
  return Math.floor(r / (1e3 * 60 * 60 * 24));
5086
- }, Ji = (e) => {
5092
+ }, Qi = (e) => {
5087
5093
  const t = /* @__PURE__ */ new Date();
5088
5094
  if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
5089
5095
  return "Just now";
5090
- const a = Zi(e, t);
5096
+ const a = Ji(e, t);
5091
5097
  return a === 0 ? e.toLocaleTimeString([], {
5092
5098
  hour: "numeric",
5093
5099
  minute: "2-digit",
@@ -5107,7 +5113,7 @@ const Bs = V.createContext({
5107
5113
  channelPreview: o,
5108
5114
  renderMessagePreview: l,
5109
5115
  viewerLanguage: d
5110
- } = Ki(), { client: m } = fe(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = mt(t);
5116
+ } = Zi(), { client: m } = fe(), g = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), h = mt(t);
5111
5117
  if (o)
5112
5118
  return /* @__PURE__ */ s(
5113
5119
  o,
@@ -5121,46 +5127,46 @@ const Bs = V.createContext({
5121
5127
  );
5122
5128
  const f = () => {
5123
5129
  t && r(t);
5124
- }, c = (y) => {
5125
- const I = y.key === "Enter" || y.key === " ", k = y.repeat;
5126
- !I || k || (y.preventDefault(), f());
5127
- }, b = He(
5130
+ }, c = (k) => {
5131
+ const I = k.key === "Enter" || k.key === " ", C = k.repeat;
5132
+ !I || C || (k.preventDefault(), f());
5133
+ }, b = Ye(
5128
5134
  (F = t == null ? void 0 : t.state) == null ? void 0 : F.members,
5129
5135
  m == null ? void 0 : m.userID,
5130
5136
  t == null ? void 0 : t.type
5131
- ), v = ht(b == null ? void 0 : b.user), x = (D = b == null ? void 0 : b.user) == null ? void 0 : D.image, p = (() => {
5137
+ ), x = ht(b == null ? void 0 : b.user), v = (D = b == null ? void 0 : b.user) == null ? void 0 : D.image, p = (() => {
5132
5138
  var I;
5133
- const y = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
5134
- if (y != null && y.length) {
5135
- for (let k = y.length - 1; k >= 0; k--)
5136
- if (y[k].type !== "system") return y[k];
5139
+ const k = (I = t == null ? void 0 : t.state) == null ? void 0 : I.messages;
5140
+ if (k != null && k.length) {
5141
+ for (let C = k.length - 1; C >= 0; C--)
5142
+ if (k[C].type !== "system") return k[C];
5137
5143
  }
5138
5144
  })(), w = (() => {
5139
5145
  var M;
5140
- const y = ps({
5146
+ const k = ps({
5141
5147
  message: p,
5142
5148
  viewerLanguage: d
5143
- }), { custom_type: I, attachment_content_type: k } = (p == null ? void 0 : p.metadata) || {};
5149
+ }), { custom_type: I, attachment_content_type: C } = (p == null ? void 0 : p.metadata) || {};
5144
5150
  if (I === "MESSAGE_TIP")
5145
- return y || "Sent a tip";
5151
+ return k || "Sent a tip";
5146
5152
  if (I === "MESSAGE_PAID")
5147
- return y || "Sent a message";
5153
+ return k || "Sent a message";
5148
5154
  if (I === "MESSAGE_ATTACHMENT") {
5149
- if (k === "text")
5155
+ if (C === "text")
5150
5156
  return "🔒 Sent a locked message";
5151
- if (k === "media")
5157
+ if (C === "media")
5152
5158
  return "🔒 Sent a locked attachment";
5153
5159
  }
5154
- if (y) return y;
5160
+ if (k) return k;
5155
5161
  const T = (M = p == null ? void 0 : p.attachments) == null ? void 0 : M[0];
5156
5162
  return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
5157
- })(), S = p != null && p.created_at ? Ji(new Date(p.created_at)) : "", z = p ? Ue(p) : !1, E = l ? l(p, w) : `${z ? "✨ " : ""}${w}`, R = n ?? 0;
5163
+ })(), y = p != null && p.created_at ? Qi(new Date(p.created_at)) : "", z = p ? Be(p) : !1, E = l ? l(p, w) : `${z ? "✨ " : ""}${w}`, R = n ?? 0;
5158
5164
  return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
5159
5165
  channelId: t == null ? void 0 : t.id,
5160
5166
  isSelected: g,
5161
- participantName: v,
5167
+ participantName: x,
5162
5168
  unreadCount: R,
5163
- hasTimestamp: !!S
5169
+ hasTimestamp: !!y
5164
5170
  }), /* @__PURE__ */ s(
5165
5171
  "div",
5166
5172
  {
@@ -5168,7 +5174,7 @@ const Bs = V.createContext({
5168
5174
  tabIndex: 0,
5169
5175
  onClick: f,
5170
5176
  onKeyDown: c,
5171
- className: C(
5177
+ className: S(
5172
5178
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
5173
5179
  {
5174
5180
  "bg-black/[0.04]": g,
@@ -5181,8 +5187,8 @@ const Bs = V.createContext({
5181
5187
  ne,
5182
5188
  {
5183
5189
  id: ((L = b == null ? void 0 : b.user) == null ? void 0 : L.id) || t.id || "unknown",
5184
- name: v,
5185
- image: x,
5190
+ name: x,
5191
+ image: v,
5186
5192
  size: 48,
5187
5193
  starred: h
5188
5194
  }
@@ -5192,16 +5198,16 @@ const Bs = V.createContext({
5192
5198
  /* @__PURE__ */ u(
5193
5199
  "h3",
5194
5200
  {
5195
- className: C(
5201
+ className: S(
5196
5202
  "text-sm font-medium truncate text-[#191918]"
5197
5203
  ),
5198
5204
  children: [
5199
5205
  h && /* @__PURE__ */ s("span", { className: "sr-only", children: "Starred conversation. " }),
5200
- v
5206
+ x
5201
5207
  ]
5202
5208
  }
5203
5209
  ),
5204
- S && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: S })
5210
+ y && /* @__PURE__ */ s("span", { className: "text-xs text-[#717070] flex-shrink-0", children: y })
5205
5211
  ] }),
5206
5212
  /* @__PURE__ */ u("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
5207
5213
  /* @__PURE__ */ s("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: E }),
@@ -5214,14 +5220,14 @@ const Bs = V.createContext({
5214
5220
  }
5215
5221
  );
5216
5222
  js.displayName = "CustomChannelPreview";
5217
- const Qi = { last_message_at: -1 }, el = V.memo(
5223
+ const el = { last_message_at: -1 }, tl = V.memo(
5218
5224
  ({
5219
5225
  onChannelSelect: e,
5220
5226
  selectedChannel: t,
5221
5227
  filters: n,
5222
5228
  allowNewMessagesFromUnfilteredChannels: a = !1,
5223
5229
  channelRenderFilterFn: r,
5224
- sort: i = Qi,
5230
+ sort: i = el,
5225
5231
  className: o,
5226
5232
  customEmptyStateIndicator: l,
5227
5233
  channelListPaginator: d = Rn,
@@ -5231,16 +5237,16 @@ const Qi = { last_message_at: -1 }, el = V.memo(
5231
5237
  lockChannelOrder: f,
5232
5238
  onMessageNewHandler: c,
5233
5239
  onMessageNew: b,
5234
- onChannelVisible: v,
5235
- onAddedToChannel: x,
5240
+ onChannelVisible: x,
5241
+ onAddedToChannel: v,
5236
5242
  onChannelUpdated: p
5237
5243
  }) => {
5238
5244
  const _ = V.useRef(0);
5239
5245
  _.current++;
5240
- const { debug: w = !1 } = ut(), S = V.useCallback(
5246
+ const { debug: w = !1 } = ut(), y = V.useCallback(
5241
5247
  (E) => {
5242
5248
  for (const R of E)
5243
- qi(R);
5249
+ Xi(R);
5244
5250
  return r ? r(E) : E;
5245
5251
  },
5246
5252
  [r]
@@ -5271,23 +5277,23 @@ const Qi = { last_message_at: -1 }, el = V.memo(
5271
5277
  return /* @__PURE__ */ s(
5272
5278
  "div",
5273
5279
  {
5274
- className: C(
5280
+ className: S(
5275
5281
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
5276
5282
  o
5277
5283
  ),
5278
- children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Xi, { value: z, children: /* @__PURE__ */ s(
5284
+ children: /* @__PURE__ */ s("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ s(Ki, { value: z, children: /* @__PURE__ */ s(
5279
5285
  An,
5280
5286
  {
5281
5287
  filters: n,
5282
5288
  sort: i,
5283
5289
  options: { limit: 30 },
5284
5290
  allowNewMessagesFromUnfilteredChannels: a,
5285
- channelRenderFilterFn: S,
5291
+ channelRenderFilterFn: y,
5286
5292
  lockChannelOrder: f,
5287
5293
  onMessageNewHandler: c,
5288
5294
  onMessageNew: b,
5289
- onChannelVisible: v,
5290
- onAddedToChannel: x,
5295
+ onChannelVisible: x,
5296
+ onAddedToChannel: v,
5291
5297
  onChannelUpdated: p,
5292
5298
  Paginator: d,
5293
5299
  Preview: js,
@@ -5299,11 +5305,11 @@ const Qi = { last_message_at: -1 }, el = V.memo(
5299
5305
  );
5300
5306
  }
5301
5307
  );
5302
- el.displayName = "ChannelList";
5303
- const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, tl = {
5308
+ tl.displayName = "ChannelList";
5309
+ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='23' fill='none'%3E%3Cpath fill='black' d='M0 0H15C15 10.1934 15.859 15.2345 19.168 21.4893C19.527 22.168 19.039 22.9917 18.274 22.9178C5.176 21.6506 0.32 6.0737 0 0Z'/%3E%3C/svg%3E") no-repeat center / 100% 100%`, sl = {
5304
5310
  sent: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
5305
5311
  received: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
5306
- }, sl = ({ variant: e }) => /* @__PURE__ */ s(
5312
+ }, nl = ({ variant: e }) => /* @__PURE__ */ s(
5307
5313
  "span",
5308
5314
  {
5309
5315
  "aria-hidden": "true",
@@ -5313,12 +5319,12 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5313
5319
  insetInlineStart: e === "received" ? "calc(-1 * 0.25rem)" : void 0,
5314
5320
  transform: e === "received" ? "scaleX(-1)" : void 0,
5315
5321
  transformOrigin: "center",
5316
- backgroundColor: tl[e],
5322
+ backgroundColor: sl[e],
5317
5323
  WebkitMask: os,
5318
5324
  mask: os
5319
5325
  }
5320
5326
  }
5321
- ), nl = {
5327
+ ), al = {
5322
5328
  sent: {
5323
5329
  backgroundColor: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
5324
5330
  color: "var(--str-chat__own-message-bubble-color, #fff)"
@@ -5337,23 +5343,23 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5337
5343
  "div",
5338
5344
  {
5339
5345
  "data-dd-privacy": "mask",
5340
- className: C(
5346
+ className: S(
5341
5347
  "relative px-4 py-3",
5342
5348
  "text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]",
5343
5349
  r
5344
5350
  ),
5345
5351
  style: {
5346
- ...nl[e],
5352
+ ...al[e],
5347
5353
  borderRadius: "var(--str-chat__message-bubble-border-radius, 1.5rem)",
5348
5354
  isolation: "isolate"
5349
5355
  },
5350
5356
  children: [
5351
5357
  a != null && /* @__PURE__ */ s("div", { className: "mb-1 font-medium", "data-testid": "message-bubble-header", children: a }),
5352
5358
  /* @__PURE__ */ s("p", { className: "m-0 whitespace-pre-wrap break-words", children: t }),
5353
- n && /* @__PURE__ */ s(sl, { variant: e })
5359
+ n && /* @__PURE__ */ s(nl, { variant: e })
5354
5360
  ]
5355
5361
  }
5356
- ), al = ({
5362
+ ), rl = ({
5357
5363
  text: e,
5358
5364
  tail: t,
5359
5365
  header: n,
@@ -5367,10 +5373,10 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5367
5373
  header: n,
5368
5374
  className: a
5369
5375
  }
5370
- ), rl = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Vs, { variant: "sent", text: e, tail: t, className: n }), wl = {
5371
- Sent: rl,
5372
- Received: al
5373
- }, il = ({
5376
+ ), il = ({ text: e, tail: t, className: n }) => /* @__PURE__ */ s(Vs, { variant: "sent", text: e, tail: t, className: n }), wl = {
5377
+ Sent: il,
5378
+ Received: rl
5379
+ }, ll = ({
5374
5380
  question: e,
5375
5381
  onClick: t,
5376
5382
  loading: n = !1,
@@ -5382,7 +5388,7 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5382
5388
  onClick: t,
5383
5389
  disabled: n,
5384
5390
  style: { backgroundColor: "#E6E5E3" },
5385
- className: C(
5391
+ className: S(
5386
5392
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
5387
5393
  {
5388
5394
  "hover:brightness-95 active:brightness-90": !n,
@@ -5392,7 +5398,7 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5392
5398
  ),
5393
5399
  children: e
5394
5400
  }
5395
- ), _l = ({
5401
+ ), Nl = ({
5396
5402
  faqs: e,
5397
5403
  onFaqClick: t,
5398
5404
  loadingFaqId: n,
@@ -5421,7 +5427,7 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5421
5427
  children: [
5422
5428
  a && /* @__PURE__ */ s("p", { className: "text-md text-charcoal mb-4", children: a }),
5423
5429
  l.map((d) => /* @__PURE__ */ s(
5424
- il,
5430
+ ll,
5425
5431
  {
5426
5432
  question: d.question,
5427
5433
  onClick: () => t(d.id),
@@ -5437,40 +5443,40 @@ const os = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' wi
5437
5443
  export {
5438
5444
  vs as A,
5439
5445
  bt as B,
5440
- Gi as C,
5446
+ Hi as C,
5441
5447
  ht as D,
5442
- vl as E,
5443
- _l as F,
5448
+ xl as E,
5449
+ Nl as F,
5444
5450
  $r as G,
5445
- wa as H,
5451
+ _a as H,
5446
5452
  aa as I,
5447
5453
  es as L,
5448
- pl as M,
5454
+ bl as M,
5449
5455
  ye as a,
5450
5456
  ne as b,
5451
- el as c,
5452
- Us as d,
5453
- bl as e,
5454
- il as f,
5457
+ tl as c,
5458
+ Bs as d,
5459
+ vl as e,
5460
+ ll as f,
5455
5461
  ce as g,
5456
- Oe as h,
5462
+ Pe as h,
5457
5463
  ke as i,
5458
5464
  wl as j,
5459
5465
  Xr as k,
5460
- gl as l,
5461
- xl as m,
5466
+ pl as l,
5467
+ _l as m,
5462
5468
  nr as n,
5463
5469
  he as o,
5464
5470
  er as p,
5465
- Ji as q,
5466
- _e as r,
5471
+ Qi as q,
5472
+ we as r,
5467
5473
  sr as s,
5468
5474
  ps as t,
5469
- _s as u,
5475
+ ws as u,
5470
5476
  oa as v,
5471
- Wa as w,
5472
- _a as x,
5473
- He as y,
5477
+ qa as w,
5478
+ wa as x,
5479
+ Ye as y,
5474
5480
  pt as z
5475
5481
  };
5476
- //# sourceMappingURL=index-Cw1ij-Py.js.map
5482
+ //# sourceMappingURL=index-4OY62Yxz.js.map