@linktr.ee/messaging-react 4.1.0-rc-1786608731 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- import { jsx as n, jsxs as f, Fragment as Z } from "react/jsx-runtime";
2
- import z, { createContext as He, useContext as we, useCallback as K, useState as B, useRef as V, useEffect as X, useId as as, Suspense as rs, useMemo as ie } from "react";
3
- import { StreamChatService as is } from "@linktr.ee/messaging-core";
4
- import { StreamChat as ls, LinkPreviewsManager as nt } from "stream-chat";
5
- import { Chat as os, useChannelStateContext as _e, useChatContext as Ve, DateSeparator as cs, useMessageContext as fe, MessageStatus as ds, MessageErrorIcon as st, MessageText as Fe, areMessageUIPropsEqual as us, useMessageReminder as ms, useComponentContext as dn, Attachment as hs, EditMessageModal as fs, MessageBlocked as gs, MessageBouncePrompt as ps, MessageDeleted as bs, MessageIsThreadReplyInChannelButtonIndicator as vs, MessageRepliesCountButton as xs, ReminderNotification as ws, StreamedMessageText as _s, messageHasAttachments as ys, messageHasReactions as Ns, isDateSeparatorMessage as ks, isMessageBlocked as Cs, isMessageBounced as Ss, MessageBounceModal as Es, Poll as Is, useMessageComposer as Ts, useStateStore as As, MessageInput as Ht, useMessageInputContext as Rs, useMessageComposerHasSendableData as Ls, AttachmentPreviewList as Ms, QuotedMessagePreview as Ds, TextareaComposer as Os, MessageTimestamp as Xe, AIStates as qe, useTypingContext as Ps, useAIState as zs, Channel as Fs, WithComponents as $s, Window as Bs, MessageList as Vt, ChannelList as Us, InfiniteScroll as js } from "stream-chat-react";
1
+ import { jsx as n, jsxs as f, Fragment as K } from "react/jsx-runtime";
2
+ import z, { createContext as je, useContext as xe, useCallback as q, useState as B, useRef as H, useEffect as Y, useId as rs, Suspense as is, useMemo as le } from "react";
3
+ import { StreamChatService as ls } from "@linktr.ee/messaging-core";
4
+ import { StreamChat as os, LinkPreviewsManager as tt } from "stream-chat";
5
+ import { Chat as cs, useChannelStateContext as we, useChatContext as He, DateSeparator as ds, useMessageContext as fe, MessageStatus as us, MessageErrorIcon as nt, MessageText as ze, areMessageUIPropsEqual as ms, useMessageReminder as hs, useComponentContext as dn, Attachment as fs, EditMessageModal as gs, MessageBlocked as ps, MessageBouncePrompt as bs, MessageDeleted as vs, MessageIsThreadReplyInChannelButtonIndicator as xs, MessageRepliesCountButton as ws, ReminderNotification as _s, StreamedMessageText as ys, messageHasAttachments as Ns, messageHasReactions as ks, isDateSeparatorMessage as Cs, isMessageBlocked as Ss, isMessageBounced as Es, MessageBounceModal as Is, Poll as Ts, useMessageComposer as As, useStateStore as Rs, MessageInput as Ht, useMessageInputContext as Ls, useMessageComposerHasSendableData as Ms, AttachmentPreviewList as Ds, QuotedMessagePreview as Os, TextareaComposer as Ps, MessageTimestamp as We, AIStates as Xe, useTypingContext as zs, useAIState as Fs, Channel as $s, WithComponents as Bs, Window as Us, MessageList as Vt, ChannelList as js, InfiniteScroll as Hs } from "stream-chat-react";
6
+ import { isOfficialChannel as un, OFFICIAL_SENDER_USER_ID as Vs, MESSAGE_CUSTOM_TYPE as oe, isDmAgentSystemType as Gt, isAgeSafetySystemType as Gs, resolveRichCardImagePresentation as Ys, selectEnabledFaqs as Ws } from "@linktr.ee/messaging-taxonomy";
6
7
  import k from "classnames";
7
- import { StarIcon as at, DotsThreeIcon as Hs, SpinnerGapIcon as Pe, SignOutIcon as Vs, ProhibitInsetIcon as Gt, FlagIcon as un, CurrencyDollarIcon as Gs, CaretRightIcon as mn, ArrowLeftIcon as Ys, FileIcon as hn, ImageIcon as Ws, SpeakerHighIcon as Xs, VideoCameraIcon as fn, FileMdIcon as qs, FileTextIcon as Ks, FileZipIcon as Zs, FilePptIcon as Js, FileCsvIcon as Qs, FileXlsIcon as ea, FileDocIcon as ta, FilePdfIcon as na, CircleNotchIcon as ve, PlayIcon as rt, PauseIcon as sa, LinkIcon as aa, DownloadSimpleIcon as Ee, GiftIcon as ra, WarningCircleIcon as ia, MegaphoneIcon as la, ChecksIcon as oa, XIcon as lt, PencilSimpleIcon as ca, CaretLeftIcon as da, TrashSimpleIcon as ua, ArrowUpIcon as ma, SparkleIcon as ha, ProhibitIcon as fa } from "@phosphor-icons/react";
8
- import { isOfficialChannel as ga, OFFICIAL_SENDER_USER_ID as pa, MESSAGE_CUSTOM_TYPE as le, isDmAgentSystemType as Yt, isAgeSafetySystemType as ba, resolveRichCardImagePresentation as va, selectEnabledFaqs as xa } from "@linktr.ee/messaging-taxonomy";
9
- import { MessageActions as wa, DefaultDropdownActionButton as gn } from "stream-chat-react/experimental";
10
- const pn = He({
8
+ import { StarIcon as st, DotsThreeIcon as Xs, SpinnerGapIcon as Oe, SignOutIcon as qs, ProhibitInsetIcon as Yt, FlagIcon as mn, CurrencyDollarIcon as Ks, CaretRightIcon as hn, ArrowLeftIcon as Zs, FileIcon as fn, ImageIcon as Js, SpeakerHighIcon as Qs, VideoCameraIcon as gn, FileMdIcon as ea, FileTextIcon as ta, FileZipIcon as na, FilePptIcon as sa, FileCsvIcon as aa, FileXlsIcon as ra, FileDocIcon as ia, FilePdfIcon as la, CircleNotchIcon as be, PlayIcon as at, PauseIcon as oa, LinkIcon as ca, DownloadSimpleIcon as Se, GiftIcon as da, WarningCircleIcon as ua, MegaphoneIcon as ma, ChecksIcon as ha, XIcon as it, PencilSimpleIcon as fa, CaretLeftIcon as ga, TrashSimpleIcon as pa, ArrowUpIcon as ba, SparkleIcon as va, ProhibitIcon as xa } from "@phosphor-icons/react";
9
+ import { MessageActions as wa, DefaultDropdownActionButton as pn } from "stream-chat-react/experimental";
10
+ const bn = je({
11
11
  service: null,
12
12
  client: null,
13
13
  isConnected: !1,
@@ -17,7 +17,7 @@ const pn = He({
17
17
  refreshConnection: async () => {
18
18
  },
19
19
  debug: !1
20
- }), ot = () => we(pn), eo = ({
20
+ }), lt = () => xe(bn), eo = ({
21
21
  children: e,
22
22
  user: t,
23
23
  serviceConfig: s,
@@ -26,10 +26,10 @@ const pn = He({
26
26
  debug: i = !1,
27
27
  client: o
28
28
  }) => {
29
- var I, C;
30
- const l = K(
31
- (S, ...P) => {
32
- i && console.log(`🔥 [MessagingProvider] ${S}`, ...P);
29
+ var S, C;
30
+ const l = q(
31
+ (A, ...P) => {
32
+ i && console.log(`🔥 [MessagingProvider] ${A}`, ...P);
33
33
  },
34
34
  [i]
35
35
  );
@@ -39,64 +39,64 @@ const pn = He({
39
39
  serviceConfig: !!s,
40
40
  capabilities: Object.keys(r)
41
41
  });
42
- const [d, u] = B(null), [h, m] = B(null), [g, c] = B(!1), [p, w] = B(!1), [v, x] = B(null), b = V(!1), y = V(null), _ = V(s);
42
+ const [d, u] = B(null), [h, m] = B(null), [g, c] = B(!1), [p, w] = B(!1), [v, x] = B(null), b = H(!1), N = H(null), _ = H(s);
43
43
  _.current = s;
44
- const T = V(i);
44
+ const T = H(i);
45
45
  T.current = i;
46
- const R = V({
46
+ const L = H({
47
47
  userId: t == null ? void 0 : t.id,
48
48
  apiKey: a,
49
49
  serviceConfig: s,
50
50
  capabilities: r
51
- }), L = V(0);
52
- L.current++, l("📊 RENDER INFO", {
53
- renderCount: L.current,
51
+ }), E = H(0);
52
+ E.current++, l("📊 RENDER INFO", {
53
+ renderCount: E.current,
54
54
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
55
55
  propChanges: {
56
- userChanged: R.current.userId !== (t == null ? void 0 : t.id),
57
- apiKeyChanged: R.current.apiKey !== a,
58
- serviceConfigChanged: R.current.serviceConfig !== s,
59
- capabilitiesChanged: R.current.capabilities !== r
56
+ userChanged: L.current.userId !== (t == null ? void 0 : t.id),
57
+ apiKeyChanged: L.current.apiKey !== a,
58
+ serviceConfigChanged: L.current.serviceConfig !== s,
59
+ capabilitiesChanged: L.current.capabilities !== r
60
60
  }
61
- }), R.current = {
61
+ }), L.current = {
62
62
  userId: t == null ? void 0 : t.id,
63
63
  apiKey: a,
64
64
  serviceConfig: s,
65
65
  capabilities: r
66
66
  };
67
- const $ = V(null);
68
- !o && a && ((I = $.current) == null ? void 0 : I.apiKey) !== a && ($.current = { apiKey: a, client: new ls(a) });
67
+ const $ = H(null);
68
+ !o && a && ((S = $.current) == null ? void 0 : S.apiKey) !== a && ($.current = { apiKey: a, client: new os(a) });
69
69
  const F = o || (a ? ((C = $.current) == null ? void 0 : C.client) ?? null : null);
70
- X(() => {
71
- const S = L.current, P = _.current;
70
+ Y(() => {
71
+ const A = E.current, P = _.current;
72
72
  if (o) {
73
- y.current = null, u(null), m(null), c(!1), x(null), w(!1);
73
+ N.current = null, u(null), m(null), c(!1), x(null), w(!1);
74
74
  return;
75
75
  }
76
76
  if (!a || !F || !P) {
77
77
  l("⚠️ SERVICE INIT SKIPPED", {
78
- renderCount: S,
78
+ renderCount: A,
79
79
  reason: "Missing apiKey, client, or serviceConfig"
80
80
  });
81
81
  return;
82
82
  }
83
83
  l("🚀 CREATING SERVICE", {
84
- renderCount: S,
84
+ renderCount: A,
85
85
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
86
86
  });
87
- const U = new is({
87
+ const U = new ls({
88
88
  ...P,
89
89
  apiKey: a,
90
90
  debug: T.current,
91
91
  client: F
92
92
  });
93
- y.current = U, u(U), l("✅ SERVICE SET", {
94
- renderCount: S,
93
+ N.current = U, u(U), l("✅ SERVICE SET", {
94
+ renderCount: A,
95
95
  serviceInstance: !!U
96
96
  });
97
97
  }, [a, F, o]);
98
- const M = V(null);
99
- X(() => {
98
+ const R = H(null);
99
+ Y(() => {
100
100
  var P, U;
101
101
  if (l("🔗 USER CONNECTION EFFECT TRIGGERED", {
102
102
  hasService: !!d,
@@ -115,7 +115,7 @@ const pn = He({
115
115
  l("⚠️ USER CONNECTION SKIPPED", "Already connecting");
116
116
  return;
117
117
  }
118
- if (((P = M.current) == null ? void 0 : P.serviceId) === d && ((U = M.current) == null ? void 0 : U.userId) === t.id) {
118
+ if (((P = R.current) == null ? void 0 : P.serviceId) === d && ((U = R.current) == null ? void 0 : U.userId) === t.id) {
119
119
  l(
120
120
  "⚠️ USER CONNECTION SKIPPED",
121
121
  "Already connected this user with this service"
@@ -126,16 +126,16 @@ const pn = He({
126
126
  l("🚀 STARTING USER CONNECTION", { userId: t.id }), b.current = !0, w(!0), x(null);
127
127
  try {
128
128
  l("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
129
- const j = await d.connectUser(t);
130
- m(j), c(!0), M.current = { serviceId: d, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
129
+ const V = await d.connectUser(t);
130
+ m(V), c(!0), R.current = { serviceId: d, userId: t.id }, l("✅ USER CONNECTION SUCCESS", {
131
131
  userId: t.id,
132
- clientId: j.userID
132
+ clientId: V.userID
133
133
  });
134
- } catch (j) {
135
- const ee = j instanceof Error ? j.message : "Connection failed";
136
- x(ee), l("❌ USER CONNECTION ERROR", {
134
+ } catch (V) {
135
+ const te = V instanceof Error ? V.message : "Connection failed";
136
+ x(te), l("❌ USER CONNECTION ERROR", {
137
137
  userId: t.id,
138
- error: ee
138
+ error: te
139
139
  });
140
140
  } finally {
141
141
  w(!1), b.current = !1, l("🔄 USER CONNECTION FINISHED", {
@@ -144,14 +144,14 @@ const pn = He({
144
144
  });
145
145
  }
146
146
  })();
147
- }, [d, t, l, g, o]), X(() => {
148
- const S = F;
147
+ }, [d, t, l, g, o]), Y(() => {
148
+ const A = F;
149
149
  return () => {
150
150
  var P;
151
- S && (M.current = null, (P = y.current) == null || P.disconnectUser().catch(console.error));
151
+ A && (R.current = null, (P = N.current) == null || P.disconnectUser().catch(console.error));
152
152
  };
153
153
  }, [F]);
154
- const E = K(async () => {
154
+ const I = q(async () => {
155
155
  if (l("🔄 REFRESH CONNECTION CALLED", {
156
156
  hasService: !!d,
157
157
  hasUser: !!t
@@ -163,10 +163,10 @@ const pn = He({
163
163
  l("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), w(!0);
164
164
  try {
165
165
  l("🔌 DISCONNECTING FOR REFRESH"), await d.disconnectUser(), l("📞 RECONNECTING FOR REFRESH");
166
- const S = await d.connectUser(t);
167
- m(S), c(!0), x(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
168
- } catch (S) {
169
- const P = S instanceof Error ? S.message : "Refresh failed";
166
+ const A = await d.connectUser(t);
167
+ m(A), c(!0), x(null), l("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
168
+ } catch (A) {
169
+ const P = A instanceof Error ? A.message : "Refresh failed";
170
170
  x(P), l("❌ CONNECTION REFRESH ERROR", {
171
171
  userId: t.id,
172
172
  error: P
@@ -197,7 +197,7 @@ const pn = He({
197
197
  isLoading: o ? !1 : p,
198
198
  error: o ? null : v,
199
199
  capabilities: r,
200
- refreshConnection: E,
200
+ refreshConnection: I,
201
201
  debug: i
202
202
  }), [
203
203
  d,
@@ -207,16 +207,16 @@ const pn = He({
207
207
  p,
208
208
  v,
209
209
  r,
210
- E,
210
+ I,
211
211
  i,
212
212
  l
213
213
  ]);
214
214
  return l("🔄 RENDER END", {
215
- renderCount: L.current,
215
+ renderCount: E.current,
216
216
  willRenderChat: !!F,
217
217
  contextValueReady: !!D
218
- }), /* @__PURE__ */ n(pn.Provider, { value: D, children: F ? /* @__PURE__ */ n(
219
- os,
218
+ }), /* @__PURE__ */ n(bn.Provider, { value: D, children: F ? /* @__PURE__ */ n(
219
+ cs,
220
220
  {
221
221
  client: F,
222
222
  customClasses: {
@@ -225,12 +225,12 @@ const pn = He({
225
225
  children: e
226
226
  }
227
227
  ) : e });
228
- }, _a = () => ot(), bn = (e) => {
228
+ }, _a = () => lt(), vn = (e) => {
229
229
  var a, r;
230
230
  const [t, s] = B(
231
231
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
232
232
  );
233
- return X(() => {
233
+ return Y(() => {
234
234
  var o;
235
235
  if (!e) {
236
236
  s(!1);
@@ -248,13 +248,13 @@ const pn = He({
248
248
  };
249
249
  }, [e]), t;
250
250
  };
251
- function vn(e, t, s) {
251
+ function xn(e, t, s) {
252
252
  const a = Object.values(e || {});
253
- if (ga(s)) {
253
+ if (un(s)) {
254
254
  const r = a.find(
255
255
  (i) => {
256
256
  var o;
257
- return ((o = i.user) == null ? void 0 : o.id) === pa;
257
+ return ((o = i.user) == null ? void 0 : o.id) === Vs;
258
258
  }
259
259
  );
260
260
  if (r) return r;
@@ -274,7 +274,7 @@ function Wt(e, t) {
274
274
  const s = e == null ? void 0 : e.trim();
275
275
  return !s || t && s === t || t && s === `Follower ${t}` ? !1 : !Na(s);
276
276
  }
277
- function xn(e) {
277
+ function wn(e) {
278
278
  return Wt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Wt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
279
279
  }
280
280
  const Xt = [
@@ -313,16 +313,16 @@ function ka(e) {
313
313
  }
314
314
  return Math.abs(t);
315
315
  }
316
- function wn(e) {
316
+ function _n(e) {
317
317
  return Xt[ka(e) % Xt.length];
318
318
  }
319
319
  function Ca(e) {
320
- return wn(e).emoji;
320
+ return _n(e).emoji;
321
321
  }
322
322
  function Sa(e) {
323
- return wn(e).bgColor;
323
+ return _n(e).bgColor;
324
324
  }
325
- const ye = ({
325
+ const _e = ({
326
326
  id: e,
327
327
  image: t,
328
328
  size: s = 40,
@@ -359,7 +359,7 @@ const ye = ({
359
359
  {
360
360
  "aria-hidden": "true",
361
361
  className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
362
- children: /* @__PURE__ */ n(at, { className: "size-3 text-yellow-600", weight: "duotone" })
362
+ children: /* @__PURE__ */ n(st, { className: "size-3 text-yellow-600", weight: "duotone" })
363
363
  }
364
364
  ),
365
365
  /* @__PURE__ */ n(
@@ -396,41 +396,41 @@ const ye = ({
396
396
  logLabel: h = "useChannelModerationActions"
397
397
  }) => {
398
398
  var D;
399
- const { service: m, debug: g } = ot(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, p = !!(a && s && m && c), [w, v] = B(!1), [x, b] = B(null), [y, _] = B(!1), [T, R] = B(!1), L = p && ((x == null ? void 0 : x.participantId) !== c || (x == null ? void 0 : x.service) !== m);
400
- return X(() => {
399
+ const { service: m, debug: g } = lt(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, p = !!(a && s && m && c), [w, v] = B(!1), [x, b] = B(null), [N, _] = B(!1), [T, L] = B(!1), E = p && ((x == null ? void 0 : x.participantId) !== c || (x == null ? void 0 : x.service) !== m);
400
+ return Y(() => {
401
401
  if (!p || !m || !c) {
402
402
  v(!1), b(null);
403
403
  return;
404
404
  }
405
- let I = !1;
405
+ let S = !1;
406
406
  return (async () => {
407
407
  try {
408
408
  const C = await m.getBlockedUsers();
409
- if (I) return;
409
+ if (S) return;
410
410
  v(
411
411
  C.some(
412
- (S) => S.blocked_user_id === c
412
+ (A) => A.blocked_user_id === c
413
413
  )
414
414
  );
415
415
  } catch (C) {
416
- I || console.error(`[${h}] Failed to check blocked status:`, C);
416
+ S || console.error(`[${h}] Failed to check blocked status:`, C);
417
417
  } finally {
418
- I || b({ participantId: c, service: m });
418
+ S || b({ participantId: c, service: m });
419
419
  }
420
420
  })(), () => {
421
- I = !0;
421
+ S = !0;
422
422
  };
423
423
  }, [p, m, c, h]), {
424
424
  isParticipantBlocked: w,
425
- isCheckingBlockedStatus: L,
426
- isLeaving: y,
425
+ isCheckingBlockedStatus: E,
426
+ isLeaving: N,
427
427
  isUpdatingBlockStatus: T,
428
428
  handleLeaveConversation: async () => {
429
- var I;
430
- if (!y) {
429
+ var S;
430
+ if (!N) {
431
431
  o == null || o(), g && console.log(`[${h}] Leave conversation`, e.cid), _(!0);
432
432
  try {
433
- const C = ((I = e._client) == null ? void 0 : I.userID) ?? null;
433
+ const C = ((S = e._client) == null ? void 0 : S.userID) ?? null;
434
434
  await e.hide(C, !1), r && await r(e), u == null || u();
435
435
  } catch (C) {
436
436
  console.error(`[${h}] Failed to leave conversation`, C);
@@ -440,28 +440,28 @@ const ye = ({
440
440
  }
441
441
  },
442
442
  handleBlockUser: async () => {
443
- var I, C, S;
443
+ var S, C, A;
444
444
  if (!(T || !m)) {
445
- l == null || l(), g && console.log(`[${h}] Block member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), R(!0);
445
+ l == null || l(), g && console.log(`[${h}] Block member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
446
446
  try {
447
- await m.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
447
+ await m.blockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), u == null || u();
448
448
  } catch (P) {
449
449
  console.error(`[${h}] Failed to block member`, P);
450
450
  } finally {
451
- R(!1);
451
+ L(!1);
452
452
  }
453
453
  }
454
454
  },
455
455
  handleUnblockUser: async () => {
456
- var I, C, S;
456
+ var S, C, A;
457
457
  if (!(T || !m)) {
458
- l == null || l(), g && console.log(`[${h}] Unblock member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), R(!0);
458
+ l == null || l(), g && console.log(`[${h}] Unblock member`, (S = t == null ? void 0 : t.user) == null ? void 0 : S.id), L(!0);
459
459
  try {
460
- await m.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), u == null || u();
460
+ await m.unBlockUser((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), u == null || u();
461
461
  } catch (P) {
462
462
  console.error(`[${h}] Failed to unblock member`, P);
463
463
  } finally {
464
- R(!1);
464
+ L(!1);
465
465
  }
466
466
  }
467
467
  },
@@ -469,7 +469,7 @@ const ye = ({
469
469
  d == null || d(), u == null || u(), window.open(Ea, "_blank", "noopener,noreferrer");
470
470
  }
471
471
  };
472
- }, ke = ({
472
+ }, Ne = ({
473
473
  variant: e = "default",
474
474
  className: t,
475
475
  children: s,
@@ -500,14 +500,14 @@ const ye = ({
500
500
  customChannelActions: h,
501
501
  triggerClassName: m
502
502
  }) => {
503
- const [g, c] = B(!1), p = V(null), w = as(), v = K(() => c(!1), []), {
503
+ const [g, c] = B(!1), p = H(null), w = rs(), v = q(() => c(!1), []), {
504
504
  isParticipantBlocked: x,
505
505
  isCheckingBlockedStatus: b,
506
- isLeaving: y,
506
+ isLeaving: N,
507
507
  isUpdatingBlockStatus: _,
508
508
  handleLeaveConversation: T,
509
- handleBlockUser: R,
510
- handleUnblockUser: L,
509
+ handleBlockUser: L,
510
+ handleUnblockUser: E,
511
511
  handleReportUser: $
512
512
  } = Ia({
513
513
  channel: e,
@@ -522,15 +522,15 @@ const ye = ({
522
522
  onActionComplete: v,
523
523
  logLabel: "ChannelActionsMenu"
524
524
  });
525
- return X(() => {
525
+ return Y(() => {
526
526
  if (!g) return;
527
- const M = (D) => {
527
+ const R = (D) => {
528
528
  p.current && !p.current.contains(D.target) && c(!1);
529
- }, E = (D) => {
529
+ }, I = (D) => {
530
530
  D.key === "Escape" && c(!1);
531
531
  };
532
- return document.addEventListener("mousedown", M), document.addEventListener("keydown", E), () => {
533
- document.removeEventListener("mousedown", M), document.removeEventListener("keydown", E);
532
+ return document.addEventListener("mousedown", R), document.addEventListener("keydown", I), () => {
533
+ document.removeEventListener("mousedown", R), document.removeEventListener("keydown", I);
534
534
  };
535
535
  }, [g]), !t || !(s || a || r || !!h) ? null : /* @__PURE__ */ f("div", { ref: p, className: "relative", children: [
536
536
  /* @__PURE__ */ f(
@@ -541,9 +541,9 @@ const ye = ({
541
541
  "aria-haspopup": "true",
542
542
  "aria-expanded": g,
543
543
  "aria-controls": g ? w : void 0,
544
- onClick: () => c((M) => !M),
544
+ onClick: () => c((R) => !R),
545
545
  children: [
546
- /* @__PURE__ */ n(Hs, { className: "size-5 text-black/90" }),
546
+ /* @__PURE__ */ n(Xs, { className: "size-5 text-black/90" }),
547
547
  /* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
548
548
  ]
549
549
  }
@@ -559,13 +559,13 @@ const ye = ({
559
559
  ),
560
560
  children: /* @__PURE__ */ f("ul", { className: "flex flex-col gap-1", children: [
561
561
  s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(
562
- ke,
562
+ Ne,
563
563
  {
564
564
  onClick: T,
565
- disabled: y,
566
- "aria-busy": y,
565
+ disabled: N,
566
+ "aria-busy": N,
567
567
  children: [
568
- y ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Vs, { className: "h-5 w-5" }),
568
+ N ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(qs, { className: "h-5 w-5" }),
569
569
  /* @__PURE__ */ n("span", { children: "Delete Conversation" })
570
570
  ]
571
571
  }
@@ -573,35 +573,35 @@ const ye = ({
573
573
  a && /* @__PURE__ */ n("li", { children: b ? (
574
574
  // Block status not yet resolved — show a disabled placeholder
575
575
  // so a premature click can't act on a stale block state.
576
- /* @__PURE__ */ f(ke, { disabled: !0, "aria-busy": !0, children: [
577
- /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }),
576
+ /* @__PURE__ */ f(Ne, { disabled: !0, "aria-busy": !0, children: [
577
+ /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }),
578
578
  /* @__PURE__ */ n("span", { children: "Block" })
579
579
  ] })
580
580
  ) : x ? /* @__PURE__ */ f(
581
- ke,
581
+ Ne,
582
582
  {
583
- onClick: L,
583
+ onClick: E,
584
584
  disabled: _,
585
585
  "aria-busy": _,
586
586
  children: [
587
- _ ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
587
+ _ ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Yt, { className: "h-5 w-5" }),
588
588
  /* @__PURE__ */ n("span", { children: "Unblock" })
589
589
  ]
590
590
  }
591
591
  ) : /* @__PURE__ */ f(
592
- ke,
592
+ Ne,
593
593
  {
594
- onClick: R,
594
+ onClick: L,
595
595
  disabled: _,
596
596
  "aria-busy": _,
597
597
  children: [
598
- _ ? /* @__PURE__ */ n(Pe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
598
+ _ ? /* @__PURE__ */ n(Oe, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Yt, { className: "h-5 w-5" }),
599
599
  /* @__PURE__ */ n("span", { children: "Block" })
600
600
  ]
601
601
  }
602
602
  ) }),
603
- r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(ke, { variant: "danger", onClick: $, children: [
604
- /* @__PURE__ */ n(un, { className: "h-5 w-5" }),
603
+ r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ f(Ne, { variant: "danger", onClick: $, children: [
604
+ /* @__PURE__ */ n(mn, { className: "h-5 w-5" }),
605
605
  /* @__PURE__ */ n("span", { children: "Report" })
606
606
  ] }) }),
607
607
  h
@@ -609,7 +609,7 @@ const ye = ({
609
609
  }
610
610
  )
611
611
  ] });
612
- }, Ke = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Aa = "CUSTOMER_PAID", Ra = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Aa, La = ({
612
+ }, qe = "flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-white/65 shadow-[0px_4px_8px_0px_rgba(0,0,0,0.06),0px_0px_0px_1px_rgba(0,0,0,0.04)] backdrop-blur-[40px] transition-filter duration-150 hover:brightness-95 aria-expanded:brightness-95 focus-ring", Aa = "CUSTOMER_PAID", Ra = (e) => typeof e == "string" && e.trim().replace(/[\s-]+/g, "_").toUpperCase() === Aa, La = ({
613
613
  className: e,
614
614
  onBack: t,
615
615
  showBackButton: s,
@@ -627,32 +627,32 @@ const ye = ({
627
627
  showChannelInfo: p = !0,
628
628
  onParticipantNameClick: w
629
629
  }) => {
630
- var E, D, I, C;
631
- const { channel: v } = _e(), { client: x } = Ve(), b = z.useMemo(
630
+ var I, D, S, C;
631
+ const { channel: v } = we(), { client: x } = He(), b = z.useMemo(
632
632
  () => {
633
- var S;
634
- return vn(
635
- (S = v.state) == null ? void 0 : S.members,
633
+ var A;
634
+ return xn(
635
+ (A = v.state) == null ? void 0 : A.members,
636
636
  x == null ? void 0 : x.userID,
637
637
  v.type
638
638
  );
639
639
  },
640
- [(E = v.state) == null ? void 0 : E.members, x == null ? void 0 : x.userID, v.type]
641
- ), y = xn(b == null ? void 0 : b.user), _ = (D = b == null ? void 0 : b.user) == null ? void 0 : D.image, T = bn(v), R = Ra((I = v.data) == null ? void 0 : I.customer_tag) && (b == null ? void 0 : b.is_follower) === !0, L = a && T, $ = R || L || !!w, F = async () => {
640
+ [(I = v.state) == null ? void 0 : I.members, x == null ? void 0 : x.userID, v.type]
641
+ ), N = wn(b == null ? void 0 : b.user), _ = (D = b == null ? void 0 : b.user) == null ? void 0 : D.image, T = vn(v), L = Ra((S = v.data) == null ? void 0 : S.customer_tag) && (b == null ? void 0 : b.is_follower) === !0, E = a && T, $ = L || E || !!w, F = async () => {
642
642
  try {
643
643
  T ? await v.unpin() : await v.pin();
644
- } catch (S) {
644
+ } catch (A) {
645
645
  console.error(
646
646
  "[ChannelHeaderRedesign] Failed to update pinned status:",
647
- S
647
+ A
648
648
  );
649
649
  }
650
- }, M = /* @__PURE__ */ f(Z, { children: [
650
+ }, R = /* @__PURE__ */ f(K, { children: [
651
651
  /* @__PURE__ */ n(
652
- ye,
652
+ _e,
653
653
  {
654
654
  id: ((C = b == null ? void 0 : b.user) == null ? void 0 : C.id) || v.id || "unknown",
655
- name: y,
655
+ name: N,
656
656
  image: _,
657
657
  shape: "circle",
658
658
  size: 48,
@@ -667,26 +667,26 @@ const ye = ({
667
667
  $ ? "pl-3 pr-2" : "px-3"
668
668
  ),
669
669
  children: /* @__PURE__ */ f("span", { className: "flex max-w-full items-center justify-center", children: [
670
- /* @__PURE__ */ n("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: y }),
670
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate text-sm font-bold leading-[1.43] tracking-[0.28px] text-black/90", children: N }),
671
671
  $ && /* @__PURE__ */ f("span", { className: "ml-2 flex gap-1", children: [
672
- R && /* @__PURE__ */ n(
672
+ L && /* @__PURE__ */ n(
673
673
  "span",
674
674
  {
675
675
  "aria-label": "Paid customer",
676
676
  className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#34C759] text-white",
677
- children: /* @__PURE__ */ n(Gs, { className: "size-2.5", weight: "bold" })
677
+ children: /* @__PURE__ */ n(Ks, { className: "size-2.5", weight: "bold" })
678
678
  }
679
679
  ),
680
- L && /* @__PURE__ */ n("span", { className: "messaging-header-star-badge flex overflow-hidden", children: /* @__PURE__ */ n(
680
+ E && /* @__PURE__ */ n("span", { className: "messaging-header-star-badge flex overflow-hidden", children: /* @__PURE__ */ n(
681
681
  "span",
682
682
  {
683
683
  "aria-label": "Starred conversation",
684
684
  className: "flex size-4 shrink-0 items-center justify-center rounded-full bg-[#FFD60A] text-white",
685
- children: /* @__PURE__ */ n(at, { className: "size-2.5", weight: "fill" })
685
+ children: /* @__PURE__ */ n(st, { className: "size-2.5", weight: "fill" })
686
686
  }
687
687
  ) }),
688
688
  w && /* @__PURE__ */ n(
689
- mn,
689
+ hn,
690
690
  {
691
691
  "aria-hidden": "true",
692
692
  className: "size-4 shrink-0 text-black/65",
@@ -710,14 +710,14 @@ const ye = ({
710
710
  "button",
711
711
  {
712
712
  className: k(
713
- Ke,
713
+ qe,
714
714
  "messaging-channel-view-back-button-mobile messaging-channel-view-back-button-desktop"
715
715
  ),
716
716
  onClick: t || (() => {
717
717
  }),
718
718
  type: "button",
719
719
  "aria-label": "Back to conversations",
720
- children: /* @__PURE__ */ n(Ys, { className: "size-5 text-black/90" })
720
+ children: /* @__PURE__ */ n(Zs, { className: "size-5 text-black/90" })
721
721
  }
722
722
  ) }),
723
723
  /* @__PURE__ */ n("div", { className: "flex min-w-0 justify-center", "data-dd-privacy": "mask", children: w ? /* @__PURE__ */ n(
@@ -725,22 +725,22 @@ const ye = ({
725
725
  {
726
726
  type: "button",
727
727
  onClick: w,
728
- "aria-label": `View details for ${y}`,
728
+ "aria-label": `View details for ${N}`,
729
729
  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",
730
- children: M
730
+ children: R
731
731
  }
732
- ) : /* @__PURE__ */ n("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children: M }) }),
732
+ ) : /* @__PURE__ */ n("div", { className: "flex min-w-0 max-w-full flex-col items-center px-2", children: R }) }),
733
733
  /* @__PURE__ */ f("div", { className: "flex items-start justify-end gap-2", children: [
734
734
  a && /* @__PURE__ */ n(
735
735
  "button",
736
736
  {
737
- className: Ke,
737
+ className: qe,
738
738
  onClick: F,
739
739
  type: "button",
740
740
  "aria-pressed": T,
741
741
  "aria-label": T ? "Unstar conversation" : "Star conversation",
742
742
  children: /* @__PURE__ */ n(
743
- at,
743
+ st,
744
744
  {
745
745
  className: k("size-5", {
746
746
  "text-[#FFD60A]": T,
@@ -765,18 +765,18 @@ const ye = ({
765
765
  onBlockParticipantClick: h,
766
766
  onReportParticipantClick: m,
767
767
  customChannelActions: g,
768
- triggerClassName: Ke
768
+ triggerClassName: qe
769
769
  }
770
770
  ))
771
771
  ] })
772
772
  ] })
773
773
  }
774
774
  );
775
- }, Ma = (e) => /* @__PURE__ */ n(cs, { ...e, position: "center" });
775
+ }, Ma = (e) => /* @__PURE__ */ n(ds, { ...e, position: "center" });
776
776
  function Da(e) {
777
777
  return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
778
778
  }
779
- function _n({
779
+ function yn({
780
780
  message: e,
781
781
  viewerLanguage: t
782
782
  }) {
@@ -797,7 +797,7 @@ function za(e) {
797
797
  (t) => e === t || e.endsWith(`.${t}`)
798
798
  );
799
799
  }
800
- function oe(e) {
800
+ function ce(e) {
801
801
  const t = e == null ? void 0 : e.trim();
802
802
  if (!t) return;
803
803
  const s = Pa(t);
@@ -815,36 +815,36 @@ const Fa = [
815
815
  [/plain|rtf/, "text"],
816
816
  [/markdown/, "markdown"]
817
817
  ];
818
- function ce(e) {
818
+ function de(e) {
819
819
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
820
820
  }
821
- function yn(e) {
821
+ function Nn(e) {
822
822
  const t = Fa.find(
823
823
  ([s]) => s.test(e)
824
824
  );
825
825
  return t ? t[1] : "generic";
826
826
  }
827
827
  const $a = {
828
- video: fn,
829
- audio: Xs,
830
- image: Ws,
831
- document: hn
828
+ video: gn,
829
+ audio: Qs,
830
+ image: Js,
831
+ document: fn
832
832
  }, Ba = {
833
- pdf: na,
834
- doc: ta,
835
- xls: ea,
836
- csv: Qs,
837
- ppt: Js,
838
- zip: Zs,
839
- text: Ks,
840
- markdown: qs,
841
- generic: hn
833
+ pdf: la,
834
+ doc: ia,
835
+ xls: ra,
836
+ csv: aa,
837
+ ppt: sa,
838
+ zip: na,
839
+ text: ta,
840
+ markdown: ea,
841
+ generic: fn
842
842
  };
843
843
  function Ua(e) {
844
- const t = ce(e);
845
- return t !== "document" ? $a[t] : Ba[yn(e)];
844
+ const t = de(e);
845
+ return t !== "document" ? $a[t] : Ba[Nn(e)];
846
846
  }
847
- function xe(e, t) {
847
+ function ve(e, t) {
848
848
  return z.createElement(Ua(e), t);
849
849
  }
850
850
  const ja = (e) => {
@@ -862,78 +862,78 @@ const ja = (e) => {
862
862
  muted: d = !1,
863
863
  onContainerClick: u
864
864
  }) => {
865
- const h = ce(t), m = V(null), g = V(null), c = V(null), p = V(r), [w, v] = B(a), [x, b] = B(0), [y, _] = B(!1), [T, R] = B(!1), [L, $] = B(!1), [F, M] = B(!1), [E, D] = B(!0), [I, C] = B(null), S = K(() => {
865
+ const h = de(t), m = H(null), g = H(null), c = H(null), p = H(r), [w, v] = B(a), [x, b] = B(0), [N, _] = B(!1), [T, L] = B(!1), [E, $] = B(!1), [F, R] = B(!1), [I, D] = B(!0), [S, C] = B(null), A = q(() => {
866
866
  $(!1), v(!0);
867
- }, []), P = K((N) => {
868
- const A = g.current;
869
- if (!A) return 0;
870
- const Y = A.getBoundingClientRect();
867
+ }, []), P = q((y) => {
868
+ const M = g.current;
869
+ if (!M) return 0;
870
+ const W = M.getBoundingClientRect();
871
871
  return Math.max(
872
872
  0,
873
- Math.min(1, (ja(N) - Y.left) / Y.width)
873
+ Math.min(1, (ja(y) - W.left) / W.width)
874
874
  );
875
- }, []), U = K((N) => {
876
- const A = m.current;
877
- A && A.duration && (A.currentTime = N * A.duration);
878
- }, []), j = (N) => {
879
- N.stopPropagation(), _(!0);
880
- const A = P(N);
881
- b(A), U(A);
875
+ }, []), U = q((y) => {
876
+ const M = m.current;
877
+ M && M.duration && (M.currentTime = y * M.duration);
878
+ }, []), V = (y) => {
879
+ y.stopPropagation(), _(!0);
880
+ const M = P(y);
881
+ b(M), U(M);
882
882
  };
883
- X(() => {
883
+ Y(() => {
884
884
  r !== void 0 && r !== p.current && (p.current = r, v(r));
885
- }, [r]), X(() => {
885
+ }, [r]), Y(() => {
886
886
  if (!w) {
887
887
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
888
888
  return;
889
889
  }
890
- const N = () => {
891
- const A = m.current;
892
- A && A.duration && !y && b(A.currentTime / A.duration), c.current = requestAnimationFrame(N);
890
+ const y = () => {
891
+ const M = m.current;
892
+ M && M.duration && !N && b(M.currentTime / M.duration), c.current = requestAnimationFrame(y);
893
893
  };
894
- return c.current = requestAnimationFrame(N), () => {
894
+ return c.current = requestAnimationFrame(y), () => {
895
895
  c.current !== null && cancelAnimationFrame(c.current);
896
896
  };
897
- }, [w, y]), X(() => {
898
- const N = m.current;
899
- N && (w ? N.play().catch((A) => {
897
+ }, [w, N]), Y(() => {
898
+ const y = m.current;
899
+ y && (w ? y.play().catch((M) => {
900
900
  v(!1), $(!0);
901
- }) : N.pause());
902
- }, [w]), X(() => {
903
- if (!y) return;
904
- const N = (Y) => b(P(Y)), A = (Y) => {
905
- _(!1), U(P(Y));
901
+ }) : y.pause());
902
+ }, [w]), Y(() => {
903
+ if (!N) return;
904
+ const y = (W) => b(P(W)), M = (W) => {
905
+ _(!1), U(P(W));
906
906
  };
907
- return window.addEventListener("mousemove", N), window.addEventListener("mouseup", A), window.addEventListener("touchmove", N, { passive: !0 }), window.addEventListener("touchend", A), () => {
908
- window.removeEventListener("mousemove", N), window.removeEventListener("mouseup", A), window.removeEventListener("touchmove", N), window.removeEventListener("touchend", A);
907
+ return window.addEventListener("mousemove", y), window.addEventListener("mouseup", M), window.addEventListener("touchmove", y, { passive: !0 }), window.addEventListener("touchend", M), () => {
908
+ window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", M), window.removeEventListener("touchmove", y), window.removeEventListener("touchend", M);
909
909
  };
910
- }, [y, P, U]);
911
- const ee = I ? { aspectRatio: String(I) } : void 0, J = I ? "" : " aspect-video", G = Math.round(x * 100);
910
+ }, [N, P, U]);
911
+ const te = S ? { aspectRatio: String(S) } : void 0, Z = S ? "" : " aspect-video", G = Math.round(x * 100);
912
912
  return /* @__PURE__ */ f(
913
913
  "div",
914
914
  {
915
915
  role: "button",
916
916
  tabIndex: 0,
917
- className: `relative cursor-pointer overflow-hidden bg-black ${J}`,
918
- style: ee,
919
- onClick: (N) => {
917
+ className: `relative cursor-pointer overflow-hidden bg-black ${Z}`,
918
+ style: te,
919
+ onClick: (y) => {
920
920
  if (u) {
921
- u(N);
921
+ u(y);
922
922
  return;
923
923
  }
924
- L || o && v((A) => !A);
924
+ E || o && v((M) => !M);
925
925
  },
926
- onKeyDown: (N) => {
927
- if (!(N.key !== "Enter" && N.key !== " ")) {
928
- if (N.preventDefault(), u) {
929
- u(N);
926
+ onKeyDown: (y) => {
927
+ if (!(y.key !== "Enter" && y.key !== " ")) {
928
+ if (y.preventDefault(), u) {
929
+ u(y);
930
930
  return;
931
931
  }
932
- L || o && v((A) => !A);
932
+ E || o && v((M) => !M);
933
933
  }
934
934
  },
935
935
  children: [
936
- s && (h === "audio" || E) && /* @__PURE__ */ n(
936
+ s && (h === "audio" || I) && /* @__PURE__ */ n(
937
937
  "img",
938
938
  {
939
939
  src: s,
@@ -941,7 +941,7 @@ const ja = (e) => {
941
941
  className: "absolute inset-0 h-full w-full object-cover"
942
942
  }
943
943
  ),
944
- !s && (h === "audio" || E) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: xe(t, {
944
+ !s && (h === "audio" || I) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ve(t, {
945
945
  className: "size-12 text-black/20",
946
946
  weight: "regular"
947
947
  }) }),
@@ -953,11 +953,11 @@ const ja = (e) => {
953
953
  loop: i,
954
954
  muted: d,
955
955
  style: { width: "100%", height: "100%" },
956
- onLoadStart: () => M(!0),
956
+ onLoadStart: () => R(!0),
957
957
  onCanPlay: () => {
958
- M(!1), D(!1);
958
+ R(!1), D(!1);
959
959
  },
960
- onWaiting: () => M(!0),
960
+ onWaiting: () => R(!0),
961
961
  onPlay: () => $(!1),
962
962
  onEnded: () => {
963
963
  i || (v(!1), b(0));
@@ -973,15 +973,15 @@ const ja = (e) => {
973
973
  muted: d,
974
974
  playsInline: !0,
975
975
  style: { width: "100%", height: "100%" },
976
- onLoadStart: () => M(!0),
976
+ onLoadStart: () => R(!0),
977
977
  onCanPlay: () => {
978
- M(!1), D(!1);
978
+ R(!1), D(!1);
979
979
  },
980
- onWaiting: () => M(!0),
980
+ onWaiting: () => R(!0),
981
981
  onPlay: () => $(!1),
982
982
  onLoadedMetadata: () => {
983
- const N = m.current;
984
- N instanceof HTMLVideoElement && N.videoWidth && N.videoHeight && C(N.videoWidth / N.videoHeight);
983
+ const y = m.current;
984
+ y instanceof HTMLVideoElement && y.videoWidth && y.videoHeight && C(y.videoWidth / y.videoHeight);
985
985
  },
986
986
  onEnded: () => {
987
987
  i || (v(!1), b(0));
@@ -989,27 +989,27 @@ const ja = (e) => {
989
989
  children: /* @__PURE__ */ n("track", { kind: "captions" })
990
990
  }
991
991
  ) }),
992
- F && !L && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
993
- ve,
992
+ F && !E && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
993
+ be,
994
994
  {
995
995
  className: "size-8 animate-spin text-white/80",
996
996
  weight: "bold"
997
997
  }
998
998
  ) }),
999
- L && !o && /* @__PURE__ */ n(
999
+ E && !o && /* @__PURE__ */ n(
1000
1000
  "div",
1001
1001
  {
1002
1002
  className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
1003
1003
  role: "button",
1004
1004
  tabIndex: 0,
1005
1005
  "aria-label": "Play preview",
1006
- onClick: (N) => {
1007
- N.stopPropagation(), S();
1006
+ onClick: (y) => {
1007
+ y.stopPropagation(), A();
1008
1008
  },
1009
- onKeyDown: (N) => {
1010
- N.key !== "Enter" && N.key !== " " || (N.preventDefault(), N.stopPropagation(), S());
1009
+ onKeyDown: (y) => {
1010
+ y.key !== "Enter" && y.key !== " " || (y.preventDefault(), y.stopPropagation(), A());
1011
1011
  },
1012
- children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(rt, { className: "size-9 translate-x-0.5", weight: "fill" }) })
1012
+ children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(at, { className: "size-9 translate-x-0.5", weight: "fill" }) })
1013
1013
  }
1014
1014
  ),
1015
1015
  l && !o && /* @__PURE__ */ n("div", { className: "absolute inset-x-0 bottom-0 px-3 pb-2.5 pt-6 bg-gradient-to-t from-black/40 to-transparent", children: /* @__PURE__ */ n(
@@ -1023,11 +1023,11 @@ const ja = (e) => {
1023
1023
  tabIndex: 0,
1024
1024
  ref: g,
1025
1025
  className: "relative flex h-4 w-full cursor-pointer items-center",
1026
- onMouseDown: j,
1027
- onTouchStart: j,
1028
- onClick: (N) => N.stopPropagation(),
1029
- onKeyDown: (N) => {
1030
- N.key === "ArrowRight" && U(Math.min(1, x + 0.05)), N.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
1026
+ onMouseDown: V,
1027
+ onTouchStart: V,
1028
+ onClick: (y) => y.stopPropagation(),
1029
+ onKeyDown: (y) => {
1030
+ y.key === "ArrowRight" && U(Math.min(1, x + 0.05)), y.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
1031
1031
  },
1032
1032
  children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
1033
1033
  "div",
@@ -1043,12 +1043,12 @@ const ja = (e) => {
1043
1043
  "button",
1044
1044
  {
1045
1045
  type: "button",
1046
- onClick: (N) => {
1047
- N.stopPropagation(), v((A) => !A);
1046
+ onClick: (y) => {
1047
+ y.stopPropagation(), v((M) => !M);
1048
1048
  },
1049
1049
  className: "shrink-0 text-white",
1050
1050
  "aria-label": w ? "Pause" : "Play",
1051
- children: w ? /* @__PURE__ */ n(sa, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(rt, { className: "size-5 translate-x-px", weight: "fill" })
1051
+ children: w ? /* @__PURE__ */ n(oa, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(at, { className: "size-5 translate-x-px", weight: "fill" })
1052
1052
  }
1053
1053
  ),
1054
1054
  /* @__PURE__ */ f(
@@ -1062,19 +1062,19 @@ const ja = (e) => {
1062
1062
  tabIndex: 0,
1063
1063
  ref: g,
1064
1064
  className: "relative flex h-4 w-full cursor-pointer items-center",
1065
- onMouseDown: j,
1066
- onTouchStart: j,
1067
- onClick: (N) => N.stopPropagation(),
1068
- onMouseEnter: () => R(!0),
1069
- onMouseLeave: () => R(!1),
1070
- onKeyDown: (N) => {
1071
- N.key === "ArrowRight" && U(Math.min(1, x + 0.05)), N.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
1065
+ onMouseDown: V,
1066
+ onTouchStart: V,
1067
+ onClick: (y) => y.stopPropagation(),
1068
+ onMouseEnter: () => L(!0),
1069
+ onMouseLeave: () => L(!1),
1070
+ onKeyDown: (y) => {
1071
+ y.key === "ArrowRight" && U(Math.min(1, x + 0.05)), y.key === "ArrowLeft" && U(Math.max(0, x - 0.05));
1072
1072
  },
1073
1073
  children: [
1074
1074
  /* @__PURE__ */ n(
1075
1075
  "div",
1076
1076
  {
1077
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || y ? "h-1.5" : "h-1"}`,
1077
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${T || N ? "h-1.5" : "h-1"}`,
1078
1078
  children: /* @__PURE__ */ n(
1079
1079
  "div",
1080
1080
  {
@@ -1087,7 +1087,7 @@ const ja = (e) => {
1087
1087
  /* @__PURE__ */ n(
1088
1088
  "div",
1089
1089
  {
1090
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || y ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
1090
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${T || N ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
1091
1091
  style: { left: `${G}%` }
1092
1092
  }
1093
1093
  )
@@ -1098,7 +1098,7 @@ const ja = (e) => {
1098
1098
  ]
1099
1099
  }
1100
1100
  );
1101
- }, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Va = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", Nn = ({
1101
+ }, Kt = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", Va = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", kn = ({
1102
1102
  mimeType: e,
1103
1103
  sourceUrl: t,
1104
1104
  thumbnailUrl: s,
@@ -1107,7 +1107,7 @@ const ja = (e) => {
1107
1107
  mediaPlayerProps: i,
1108
1108
  containedImage: o = !1
1109
1109
  }) => {
1110
- const l = ce(e), [d, u] = B(!1), h = oe(t), m = oe(s);
1110
+ const l = de(e), [d, u] = B(!1), h = ce(t), m = ce(s);
1111
1111
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
1112
1112
  Ha,
1113
1113
  {
@@ -1155,7 +1155,7 @@ const ja = (e) => {
1155
1155
  "div",
1156
1156
  {
1157
1157
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1158
- children: xe(e, {
1158
+ children: ve(e, {
1159
1159
  className: Kt(r),
1160
1160
  weight: "regular"
1161
1161
  })
@@ -1172,13 +1172,13 @@ const ja = (e) => {
1172
1172
  "div",
1173
1173
  {
1174
1174
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
1175
- children: xe(e, {
1175
+ children: ve(e, {
1176
1176
  className: Kt(r),
1177
1177
  weight: "regular"
1178
1178
  })
1179
1179
  }
1180
1180
  );
1181
- }, kn = ({
1181
+ }, Cn = ({
1182
1182
  variant: e,
1183
1183
  thumbnail: t,
1184
1184
  title: s,
@@ -1219,7 +1219,7 @@ const ja = (e) => {
1219
1219
  }
1220
1220
  ),
1221
1221
  /* @__PURE__ */ f("div", { className: "flex flex-wrap items-center gap-1", children: [
1222
- xe(r, {
1222
+ ve(r, {
1223
1223
  className: k(
1224
1224
  "size-5 shrink-0",
1225
1225
  g ? "text-white/55" : "text-black/55"
@@ -1244,10 +1244,10 @@ const ja = (e) => {
1244
1244
  }
1245
1245
  );
1246
1246
  };
1247
- function Cn(e) {
1247
+ function Sn(e) {
1248
1248
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1249
1249
  }
1250
- function ct(e) {
1250
+ function ot(e) {
1251
1251
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#1e2330]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
1252
1252
  }
1253
1253
  function Ga(e) {
@@ -1265,12 +1265,12 @@ function Xa(e) {
1265
1265
  function qa(e) {
1266
1266
  return e ? "text-white/20" : "text-black/20";
1267
1267
  }
1268
- const dt = ({ attachment: e, isMyMessage: t }) => {
1268
+ const ct = ({ attachment: e, isMyMessage: t }) => {
1269
1269
  const { title: s, text: a, image_url: r, og_scrape_url: i, title_link: o } = e, l = i ?? o, d = typeof l == "string" && l.trim() !== "" ? l : void 0, u = /* @__PURE__ */ f(z.Fragment, { children: [
1270
1270
  /* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
1271
1271
  "img",
1272
1272
  {
1273
- src: oe(r) ?? r,
1273
+ src: ce(r) ?? r,
1274
1274
  alt: s ?? "",
1275
1275
  className: "aspect-video w-full rounded-[20px] object-cover"
1276
1276
  }
@@ -1278,7 +1278,7 @@ const dt = ({ attachment: e, isMyMessage: t }) => {
1278
1278
  "div",
1279
1279
  {
1280
1280
  className: `aspect-video w-full rounded-[20px] ${Ga(t)} flex items-center justify-center`,
1281
- children: /* @__PURE__ */ n(aa, { className: `size-12 ${qa(t)}` })
1281
+ children: /* @__PURE__ */ n(ca, { className: `size-12 ${qa(t)}` })
1282
1282
  }
1283
1283
  ) }),
1284
1284
  /* @__PURE__ */ f("div", { className: "px-3 pb-3", children: [
@@ -1316,12 +1316,12 @@ const dt = ({ attachment: e, isMyMessage: t }) => {
1316
1316
  }
1317
1317
  ) : /* @__PURE__ */ n("div", { className: "block", children: u });
1318
1318
  };
1319
- function Sn(e) {
1319
+ function En(e) {
1320
1320
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1321
1321
  }
1322
- function ut(e) {
1322
+ function dt(e) {
1323
1323
  var t;
1324
- return (t = e.attachments) == null ? void 0 : t.find(Sn);
1324
+ return (t = e.attachments) == null ? void 0 : t.find(En);
1325
1325
  }
1326
1326
  async function Ka(e, t) {
1327
1327
  let s;
@@ -1356,19 +1356,19 @@ const Za = ({
1356
1356
  disabled: s,
1357
1357
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
1358
1358
  children: s ? /* @__PURE__ */ n(
1359
- ve,
1359
+ be,
1360
1360
  {
1361
1361
  className: "size-4 animate-spin text-white",
1362
1362
  weight: "bold"
1363
1363
  }
1364
1364
  ) : /* @__PURE__ */ f(z.Fragment, { children: [
1365
- /* @__PURE__ */ n(Ee, { className: "size-4 text-white", weight: "bold" }),
1365
+ /* @__PURE__ */ n(Se, { className: "size-4 text-white", weight: "bold" }),
1366
1366
  "Download"
1367
1367
  ] })
1368
1368
  }
1369
1369
  );
1370
1370
  };
1371
- function mt(e) {
1371
+ function ut(e) {
1372
1372
  var m, g, c, p;
1373
1373
  const t = (m = e.attachments) == null ? void 0 : m.find(
1374
1374
  (w) => w.type === "video" && w.asset_url
@@ -1389,16 +1389,16 @@ function mt(e) {
1389
1389
  thumbnailUrl: h
1390
1390
  };
1391
1391
  }
1392
- const En = ({
1392
+ const In = ({
1393
1393
  resolvedUrl: e,
1394
1394
  resolvedType: t,
1395
1395
  title: s,
1396
1396
  fileSize: a,
1397
1397
  thumbnailUrl: r
1398
1398
  }) => {
1399
- const i = a !== void 0 ? Cn(a) : void 0;
1399
+ const i = a !== void 0 ? Sn(a) : void 0;
1400
1400
  return /* @__PURE__ */ n(
1401
- kn,
1401
+ Cn,
1402
1402
  {
1403
1403
  variant: "dark",
1404
1404
  title: s,
@@ -1406,7 +1406,7 @@ const En = ({
1406
1406
  mimeType: t,
1407
1407
  detail: i,
1408
1408
  thumbnail: /* @__PURE__ */ n(
1409
- Nn,
1409
+ kn,
1410
1410
  {
1411
1411
  mimeType: t,
1412
1412
  sourceUrl: e,
@@ -1417,23 +1417,23 @@ const En = ({
1417
1417
  )
1418
1418
  }
1419
1419
  );
1420
- }, In = ({
1420
+ }, Tn = ({
1421
1421
  resolvedUrl: e,
1422
1422
  resolvedType: t,
1423
1423
  title: s,
1424
1424
  fileSize: a,
1425
1425
  thumbnailUrl: r
1426
1426
  }) => {
1427
- const i = ce(t), o = a !== void 0 ? Cn(a) : void 0;
1427
+ const i = de(t), o = a !== void 0 ? Sn(a) : void 0;
1428
1428
  return /* @__PURE__ */ n(
1429
- kn,
1429
+ Cn,
1430
1430
  {
1431
1431
  variant: "light",
1432
1432
  title: s,
1433
1433
  mimeType: t,
1434
1434
  detail: o,
1435
1435
  thumbnail: /* @__PURE__ */ n(
1436
- Nn,
1436
+ kn,
1437
1437
  {
1438
1438
  mimeType: t,
1439
1439
  sourceUrl: e,
@@ -1450,10 +1450,10 @@ const En = ({
1450
1450
  message: e,
1451
1451
  isMyMessage: t = !1
1452
1452
  }) => {
1453
- const s = ut(e), a = mt(e);
1453
+ const s = dt(e), a = ut(e);
1454
1454
  return !s && !a ? null : /* @__PURE__ */ f("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", "data-dd-privacy": "mask", children: [
1455
1455
  !t && e.user && /* @__PURE__ */ n(
1456
- ye,
1456
+ _e,
1457
1457
  {
1458
1458
  className: "str-chat__avatar str-chat__message-sender-avatar",
1459
1459
  id: e.user.id,
@@ -1477,13 +1477,13 @@ const En = ({
1477
1477
  overflow: "visible",
1478
1478
  background: "transparent"
1479
1479
  },
1480
- children: s ? /* @__PURE__ */ n("div", { className: ct(t), children: /* @__PURE__ */ n(
1481
- dt,
1480
+ children: s ? /* @__PURE__ */ n("div", { className: ot(t), children: /* @__PURE__ */ n(
1481
+ ct,
1482
1482
  {
1483
1483
  attachment: s,
1484
1484
  isMyMessage: t
1485
1485
  }
1486
- ) }) : t ? /* @__PURE__ */ n(En, { ...a }) : /* @__PURE__ */ n(In, { ...a })
1486
+ ) }) : t ? /* @__PURE__ */ n(In, { ...a }) : /* @__PURE__ */ n(Tn, { ...a })
1487
1487
  }
1488
1488
  ) })
1489
1489
  }
@@ -1492,19 +1492,19 @@ const En = ({
1492
1492
  }, Qa = ({
1493
1493
  message: e
1494
1494
  }) => {
1495
- const t = ut(e);
1495
+ const t = dt(e);
1496
1496
  if (t)
1497
- return /* @__PURE__ */ n("div", { className: ct(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(dt, { attachment: t, isMyMessage: !0 }) });
1498
- const s = mt(e);
1499
- return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(En, { ...s }) }) : null;
1497
+ return /* @__PURE__ */ n("div", { className: ot(!0), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(ct, { attachment: t, isMyMessage: !0 }) });
1498
+ const s = ut(e);
1499
+ return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(In, { ...s }) }) : null;
1500
1500
  }, er = ({
1501
1501
  message: e
1502
1502
  }) => {
1503
- const t = ut(e);
1503
+ const t = dt(e);
1504
1504
  if (t)
1505
- return /* @__PURE__ */ n("div", { className: ct(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(dt, { attachment: t, isMyMessage: !1 }) });
1506
- const s = mt(e);
1507
- return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(In, { ...s }) }) : null;
1505
+ return /* @__PURE__ */ n("div", { className: ot(!1), "data-dd-privacy": "mask", children: /* @__PURE__ */ n(ct, { attachment: t, isMyMessage: !1 }) });
1506
+ const s = ut(e);
1507
+ return s ? /* @__PURE__ */ n("div", { style: { display: "contents" }, "data-dd-privacy": "mask", children: /* @__PURE__ */ n(Tn, { ...s }) }) : null;
1508
1508
  }, to = Object.assign(Ja, {
1509
1509
  Creator: Qa,
1510
1510
  Visitor: er
@@ -1512,17 +1512,17 @@ const En = ({
1512
1512
  isUnlocking: () => !1
1513
1513
  }, nr = {
1514
1514
  LockedAttachment: tr
1515
- }, Tn = He({}), no = Tn.Provider;
1515
+ }, An = je({}), no = An.Provider;
1516
1516
  function sr(e) {
1517
- return we(Tn)[e] ?? nr[e];
1517
+ return xe(An)[e] ?? nr[e];
1518
1518
  }
1519
- const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import("./Card-ClyBNKoW.js")), ir = () => /* @__PURE__ */ n(
1519
+ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import("./Card-LPAZ4FjL.js")), ir = () => /* @__PURE__ */ n(
1520
1520
  "div",
1521
1521
  {
1522
1522
  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)]",
1523
1523
  "aria-hidden": !0
1524
1524
  }
1525
- ), ze = (e) => /* @__PURE__ */ n(rs, { fallback: /* @__PURE__ */ n(ir, {}), children: e.contentType === "text" ? /* @__PURE__ */ n(ar, { ...e }) : /* @__PURE__ */ n(rr, { ...e }) }), lr = ({ size: e = 15 }) => /* @__PURE__ */ n(
1525
+ ), Pe = (e) => /* @__PURE__ */ n(is, { fallback: /* @__PURE__ */ n(ir, {}), children: e.contentType === "text" ? /* @__PURE__ */ n(ar, { ...e }) : /* @__PURE__ */ n(rr, { ...e }) }), lr = ({ size: e = 15 }) => /* @__PURE__ */ n(
1526
1526
  "svg",
1527
1527
  {
1528
1528
  width: e,
@@ -1541,41 +1541,41 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1541
1541
  }
1542
1542
  ), or = (e) => {
1543
1543
  var t;
1544
- return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.TIP;
1545
- }, An = (e) => {
1544
+ return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.TIP;
1545
+ }, Rn = (e) => {
1546
1546
  var t;
1547
- return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.PAID;
1548
- }, $e = (e) => {
1547
+ return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.PAID;
1548
+ }, Fe = (e) => {
1549
1549
  var t;
1550
- return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.CHATBOT;
1551
- }, ht = (e) => {
1550
+ return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.CHATBOT;
1551
+ }, mt = (e) => {
1552
1552
  var t;
1553
- return ((t = e.metadata) == null ? void 0 : t.custom_type) === le.ATTACHMENT;
1553
+ return ((t = e.metadata) == null ? void 0 : t.custom_type) === oe.ATTACHMENT;
1554
1554
  }, cr = (e) => {
1555
1555
  var t;
1556
- return ht(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
1556
+ return mt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) === "text";
1557
1557
  }, dr = (e) => {
1558
1558
  var t;
1559
- return ht(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
1560
- }, Rn = (e) => or(e) || An(e), ur = (e) => {
1559
+ return mt(e) && ((t = e.metadata) == null ? void 0 : t.attachment_content_type) !== "text";
1560
+ }, Ln = (e) => or(e) || Rn(e), ur = (e) => {
1561
1561
  var t;
1562
- return Rn(e) && !((t = e.text) != null && t.trim());
1563
- }, Ze = ({
1562
+ return Ln(e) && !((t = e.text) != null && t.trim());
1563
+ }, Ke = ({
1564
1564
  message: e,
1565
1565
  standalone: t = !1,
1566
1566
  isMyMessage: s = !1,
1567
1567
  hasAttachment: a = !1
1568
1568
  }) => {
1569
1569
  var g;
1570
- const r = Rn(e), i = $e(e);
1570
+ const r = Ln(e), i = Fe(e);
1571
1571
  if (!r && !i)
1572
1572
  return null;
1573
1573
  if (r) {
1574
1574
  const c = (g = e.metadata) == null ? void 0 : g.amount_text;
1575
1575
  if (!c) return null;
1576
- const p = t ? "message-tip-standalone inline-flex items-center gap-1.5 px-3.5 py-2.5 rounded-[18px] text-[14px] font-medium text-[#016e1a] bg-[#dbf0e0]" : "message-tag--tip inline-flex items-center gap-1 text-[12px] leading-[2] font-medium text-[#016630]", w = An(e) ? "message" : "tip", v = t ? `${c} ${w}` : `Delivered with ${c} ${w}`;
1576
+ const p = t ? "message-tip-standalone inline-flex items-center gap-1.5 px-3.5 py-2.5 rounded-[18px] text-[14px] font-medium text-[#016e1a] bg-[#dbf0e0]" : "message-tag--tip inline-flex items-center gap-1 text-[12px] leading-[2] font-medium text-[#016630]", w = Rn(e) ? "message" : "tip", v = t ? `${c} ${w}` : `Delivered with ${c} ${w}`;
1577
1577
  return /* @__PURE__ */ f("div", { className: p, children: [
1578
- /* @__PURE__ */ n(ra, { size: t ? 14 : 12 }),
1578
+ /* @__PURE__ */ n(da, { size: t ? 14 : 12 }),
1579
1579
  /* @__PURE__ */ n("span", { children: v })
1580
1580
  ] });
1581
1581
  }
@@ -1585,10 +1585,10 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1585
1585
  {
1586
1586
  className: `${d} ${u}`,
1587
1587
  "data-testid": "message-chatbot-indicator",
1588
- children: s && !o ? /* @__PURE__ */ f(Z, { children: [
1588
+ children: s && !o ? /* @__PURE__ */ f(K, { children: [
1589
1589
  h,
1590
1590
  m
1591
- ] }) : /* @__PURE__ */ f(Z, { children: [
1591
+ ] }) : /* @__PURE__ */ f(K, { children: [
1592
1592
  m,
1593
1593
  h
1594
1594
  ] })
@@ -1597,7 +1597,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1597
1597
  }, Zt = `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%`, mr = {
1598
1598
  me: "var(--str-chat__own-message-bubble-background-color, #1e2330)",
1599
1599
  other: "var(--str-chat__message-bubble-background-color, #f1f0ee)"
1600
- }, Be = ({ side: e }) => /* @__PURE__ */ n(
1600
+ }, $e = ({ side: e }) => /* @__PURE__ */ n(
1601
1601
  "span",
1602
1602
  {
1603
1603
  "aria-hidden": "true",
@@ -1612,7 +1612,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1612
1612
  mask: Zt
1613
1613
  }
1614
1614
  }
1615
- ), Ln = He(
1615
+ ), Mn = je(
1616
1616
  void 0
1617
1617
  ), hr = (e) => {
1618
1618
  var s;
@@ -1650,8 +1650,8 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1650
1650
  }, pr = (e, t) => {
1651
1651
  const s = fr(e, t), [a, r] = B(s);
1652
1652
  return gr(a, s) ? a : (r(s), s);
1653
- }, ft = () => {
1654
- const { message: e } = fe("SentMessageDeliveryStatus"), { messages: t } = _e("SentMessageDeliveryStatus"), s = (() => {
1653
+ }, ht = () => {
1654
+ const { message: e } = fe("SentMessageDeliveryStatus"), { messages: t } = we("SentMessageDeliveryStatus"), s = (() => {
1655
1655
  if (t)
1656
1656
  for (let a = t.length - 1; a >= 0; a -= 1) {
1657
1657
  const r = t[a];
@@ -1660,12 +1660,12 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1660
1660
  }
1661
1661
  })();
1662
1662
  return e.id === s;
1663
- }, Je = () => ft() ? /* @__PURE__ */ f(Z, { children: [
1664
- /* @__PURE__ */ n(oa, { weight: "bold", "aria-hidden": "true" }),
1663
+ }, Ze = () => ht() ? /* @__PURE__ */ f(K, { children: [
1664
+ /* @__PURE__ */ n(ha, { weight: "bold", "aria-hidden": "true" }),
1665
1665
  /* @__PURE__ */ n("span", { "data-testid": "sent-message-delivery-status", children: "Delivered" })
1666
- ] }) : null, br = () => ft() ? /* @__PURE__ */ f(Z, { children: [
1666
+ ] }) : null, br = () => ht() ? /* @__PURE__ */ f(K, { children: [
1667
1667
  /* @__PURE__ */ n(
1668
- ve,
1668
+ be,
1669
1669
  {
1670
1670
  className: "sent-message-status__spinner animate-spin",
1671
1671
  weight: "bold",
@@ -1677,8 +1677,8 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1677
1677
  outbound: e,
1678
1678
  onOutboundClick: t
1679
1679
  }) => {
1680
- const s = e.name || "Broadcast", r = /* @__PURE__ */ f(Z, { children: [
1681
- /* @__PURE__ */ n("span", { className: "sent-message-outbound-badge", "aria-hidden": "true", children: /* @__PURE__ */ n(la, { weight: "fill" }) }),
1680
+ const s = e.name || "Broadcast", r = /* @__PURE__ */ f(K, { children: [
1681
+ /* @__PURE__ */ n("span", { className: "sent-message-outbound-badge", "aria-hidden": "true", children: /* @__PURE__ */ n(ma, { weight: "fill" }) }),
1682
1682
  /* @__PURE__ */ n(
1683
1683
  "span",
1684
1684
  {
@@ -1701,7 +1701,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1701
1701
  }
1702
1702
  ) : r;
1703
1703
  }, xr = () => /* @__PURE__ */ f("span", { className: "str-chat__message-status sent-message-status--failed", children: [
1704
- /* @__PURE__ */ n(ia, { weight: "bold", "aria-hidden": "true" }),
1704
+ /* @__PURE__ */ n(ua, { weight: "bold", "aria-hidden": "true" }),
1705
1705
  /* @__PURE__ */ n("span", { "data-testid": "sent-message-failed-status", children: "Failed to send" })
1706
1706
  ] }), wr = ({
1707
1707
  onOutboundClick: e,
@@ -1710,7 +1710,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1710
1710
  var h;
1711
1711
  const { isMyMessage: s, message: a, threadList: r } = fe(
1712
1712
  "SentMessageDeliveryStatus"
1713
- ), i = s(), o = ft();
1713
+ ), i = s(), o = ht();
1714
1714
  if (r)
1715
1715
  return null;
1716
1716
  if (a.status === "failed" && i && a.type !== "error")
@@ -1724,11 +1724,11 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1724
1724
  onOutboundClick: e
1725
1725
  }
1726
1726
  ) : null, u = /* @__PURE__ */ n(
1727
- ds,
1727
+ us,
1728
1728
  {
1729
- MessageSentStatus: Je,
1730
- MessageDeliveredStatus: Je,
1731
- MessageReadStatus: Je,
1729
+ MessageSentStatus: Ze,
1730
+ MessageDeliveredStatus: Ze,
1731
+ MessageReadStatus: Ze,
1732
1732
  MessageSendingStatus: br
1733
1733
  }
1734
1734
  );
@@ -1738,7 +1738,7 @@ const ar = z.lazy(() => import("./Card-DaJtDL7m.js")), rr = z.lazy(() => import(
1738
1738
  d
1739
1739
  ] }) : u;
1740
1740
  }, _r = /^([a-z][a-z0-9+.-]*):/i, yr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
1741
- function gt(e) {
1741
+ function ft(e) {
1742
1742
  if (typeof e != "string") return;
1743
1743
  const t = e.trim();
1744
1744
  if (t === "") return;
@@ -1758,7 +1758,7 @@ const Nr = {
1758
1758
  primary: "bg-[#121110] text-white hover:bg-[#2a2928]",
1759
1759
  secondary: "bg-black/[0.06] text-[#121110] hover:bg-black/10"
1760
1760
  }
1761
- }, Mn = ({
1761
+ }, Dn = ({
1762
1762
  variant: e,
1763
1763
  cta: t,
1764
1764
  fullWidth: s = !0,
@@ -1769,7 +1769,7 @@ const Nr = {
1769
1769
  s ? "w-full" : "min-w-0",
1770
1770
  !a && "mt-2",
1771
1771
  Nr[e][r]
1772
- ), o = s ? t.label : /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: t.label }), l = gt(t.href);
1772
+ ), o = s ? t.label : /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: t.label }), l = ft(t.href);
1773
1773
  return l ? /* @__PURE__ */ n(
1774
1774
  "a",
1775
1775
  {
@@ -1804,7 +1804,7 @@ const Nr = {
1804
1804
  }, Sr = {
1805
1805
  dark: "bg-white/25",
1806
1806
  light: "bg-black/15"
1807
- }, pt = ({
1807
+ }, gt = ({
1808
1808
  variant: e,
1809
1809
  ctaSurface: t,
1810
1810
  chinTextColor: s,
@@ -1821,13 +1821,13 @@ const Nr = {
1821
1821
  const g = e === "dark", c = a ?? (g ? r : void 0) ?? "", p = c.trim() !== "", w = i != null && i.trim() !== "", v = typeof l == "string" ? l.trim() : "", x = v !== "", b = u != null;
1822
1822
  if (!m && !p && !w && !x && !b)
1823
1823
  return null;
1824
- const y = g && !a, _ = k(
1824
+ const N = g && !a, _ = k(
1825
1825
  "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]",
1826
- s == null && (y ? Cr : kr[e])
1826
+ s == null && (N ? Cr : kr[e])
1827
1827
  ), T = k(
1828
1828
  "truncate text-[12px] leading-4 tracking-[0.24px]",
1829
1829
  s == null && Jt[e]
1830
- ), R = k(
1830
+ ), L = k(
1831
1831
  "text-[12px] leading-4 tracking-[0.24px]",
1832
1832
  o <= 1 && "truncate",
1833
1833
  s == null && Jt[e]
@@ -1842,13 +1842,13 @@ const Nr = {
1842
1842
  /* @__PURE__ */ n("div", { className: k("h-4 w-1/2", F), "aria-hidden": !0 })
1843
1843
  ] }) });
1844
1844
  }
1845
- const L = s ? { color: s } : void 0, $ = o > 1 ? {
1846
- ...L,
1845
+ const E = s ? { color: s } : void 0, $ = o > 1 ? {
1846
+ ...E,
1847
1847
  display: "-webkit-box",
1848
1848
  WebkitBoxOrient: "vertical",
1849
1849
  WebkitLineClamp: o,
1850
1850
  overflow: "hidden"
1851
- } : L;
1851
+ } : E;
1852
1852
  return /* @__PURE__ */ f("div", { className: "shrink-0 px-4 py-3", children: [
1853
1853
  /* @__PURE__ */ f("div", { className: "flex items-end gap-3", children: [
1854
1854
  /* @__PURE__ */ f("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
@@ -1858,24 +1858,29 @@ const Nr = {
1858
1858
  "p",
1859
1859
  {
1860
1860
  className: k("min-w-0", _),
1861
- style: L,
1861
+ style: E,
1862
1862
  children: c
1863
1863
  }
1864
1864
  )
1865
1865
  ] }),
1866
- w && /* @__PURE__ */ n("p", { className: R, style: $, children: i }),
1867
- !b && x && /* @__PURE__ */ n("p", { className: T, style: L, children: v })
1866
+ w && /* @__PURE__ */ n("p", { className: L, style: $, children: i }),
1867
+ !b && x && /* @__PURE__ */ n("p", { className: T, style: E, children: v })
1868
1868
  ] }),
1869
1869
  h && /* @__PURE__ */ n("div", { className: "shrink-0", children: h })
1870
1870
  ] }),
1871
- u && /* @__PURE__ */ n(Mn, { variant: t ?? e, cta: u })
1871
+ u && /* @__PURE__ */ n(Dn, { variant: t ?? e, cta: u })
1872
1872
  ] });
1873
1873
  }, Er = "Loading link preview", Ir = k(
1874
- "relative w-[290px] select-none overflow-hidden",
1874
+ // Width is a channel-scoped token: default 290px, but a read-only surface with no
1875
+ // composer (the official channel) sets `--lt-msg-card-width` on its root to widen the
1876
+ // content column (see ChannelView). Consumers that don't set the var keep 290px.
1877
+ // `max-w-full` caps the card to its container so a widened value can never overflow
1878
+ // horizontally on a narrow (sub-393px) viewport — it shrinks to fit instead.
1879
+ "relative w-[var(--lt-msg-card-width,290px)] max-w-full select-none overflow-hidden",
1875
1880
  // 20px corners — no token exists for it in the component-library preset,
1876
1881
  // whose radius scale is sm .5rem / md 1rem / lg 1.5rem / xl 4rem.
1877
1882
  "rounded-[20px]"
1878
- ), Tr = "flex h-[250px] flex-col", Ie = ({
1883
+ ), Tr = "flex h-[250px] flex-col", Ee = ({
1879
1884
  variant: e,
1880
1885
  children: t,
1881
1886
  href: s,
@@ -1971,11 +1976,11 @@ const Nr = {
1971
1976
  }, Ar = {
1972
1977
  dark: "size-16 text-white/25",
1973
1978
  light: "size-16 text-black/25"
1974
- }, Ae = (e, t) => !!t && !!e && ce(e) === "audio", bt = (e, t) => {
1979
+ }, Te = (e, t) => !!t && !!e && de(e) === "audio", pt = (e, t) => {
1975
1980
  if (!t || !e) return !1;
1976
- const s = ce(e);
1981
+ const s = de(e);
1977
1982
  return s === "video" || s === "audio";
1978
- }, vt = "bg-[#F2F3F4]", Te = ({
1983
+ }, bt = "bg-[#F2F3F4]", Ie = ({
1979
1984
  variant: e,
1980
1985
  thumbnailUrl: t,
1981
1986
  sourceUrl: s,
@@ -1986,8 +1991,8 @@ const Nr = {
1986
1991
  isLoading: l = !1,
1987
1992
  onImageError: d
1988
1993
  }) => {
1989
- const u = ce(r), h = !!s && u === "video", m = oe(t);
1990
- return !l && Ae(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
1994
+ const u = de(r), h = !!s && u === "video", m = ce(t);
1995
+ return !l && Te(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
1991
1996
  "audio",
1992
1997
  {
1993
1998
  src: s,
@@ -2023,7 +2028,7 @@ const Nr = {
2023
2028
  "aria-hidden": !0
2024
2029
  }
2025
2030
  )
2026
- ) : h ? /* @__PURE__ */ f(Z, { children: [
2031
+ ) : h ? /* @__PURE__ */ f(K, { children: [
2027
2032
  /* @__PURE__ */ n(
2028
2033
  "video",
2029
2034
  {
@@ -2064,7 +2069,7 @@ const Nr = {
2064
2069
  "flex h-full w-full items-center justify-center",
2065
2070
  Qt[e]
2066
2071
  ),
2067
- children: xe(r, {
2072
+ children: ve(r, {
2068
2073
  className: Ar[e],
2069
2074
  weight: "regular"
2070
2075
  })
@@ -2080,11 +2085,11 @@ function Lr(e) {
2080
2085
  const t = e.trim();
2081
2086
  return t.startsWith("#") ? t : `#${t}`;
2082
2087
  }
2083
- const Mr = "#FFFFFF", Dn = "#040403", Dr = {
2088
+ const Mr = "#FFFFFF", On = "#040403", Dr = {
2084
2089
  dark: Mr,
2085
- light: Dn
2090
+ light: On
2086
2091
  };
2087
- function Ge({
2092
+ function Ve({
2088
2093
  variant: e,
2089
2094
  accentColor: t,
2090
2095
  status: s = "ready",
@@ -2099,7 +2104,7 @@ function Ge({
2099
2104
  }, [r]);
2100
2105
  const u = z.useCallback(() => {
2101
2106
  d(!0);
2102
- }, []), h = Ae(i, o), c = a === "featured" && !!r && !h && !l && s === "ready" && t != null && Rr.test(t.trim()) ? Lr(t) : void 0, p = h ? Dn : Dr[e];
2107
+ }, []), h = Te(i, o), c = a === "featured" && !!r && !h && !l && s === "ready" && t != null && Rr.test(t.trim()) ? Lr(t) : void 0, p = h ? On : Dr[e];
2103
2108
  return {
2104
2109
  thumbnailUrl: l ? void 0 : r,
2105
2110
  accentHex: c,
@@ -2127,7 +2132,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2127
2132
  onEditClick: p,
2128
2133
  dismissLabel: w = "Dismiss attachment"
2129
2134
  }) => {
2130
- const v = d === "classic", x = Ae(i, l), b = Ge({
2135
+ const v = d === "classic", x = Te(i, l), b = Ve({
2131
2136
  variant: "dark",
2132
2137
  accentColor: m,
2133
2138
  status: g,
@@ -2135,7 +2140,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2135
2140
  thumbnailUrl: o,
2136
2141
  mimeType: i,
2137
2142
  sourceUrl: l
2138
- }), y = c ? /* @__PURE__ */ n(
2143
+ }), N = c ? /* @__PURE__ */ n(
2139
2144
  "button",
2140
2145
  {
2141
2146
  type: "button",
@@ -2145,7 +2150,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2145
2150
  Or,
2146
2151
  !x && Pr
2147
2152
  ),
2148
- children: /* @__PURE__ */ n(lt, { className: "size-3", weight: "bold" })
2153
+ children: /* @__PURE__ */ n(it, { className: "size-3", weight: "bold" })
2149
2154
  }
2150
2155
  ) : void 0, _ = p ? /* @__PURE__ */ n(
2151
2156
  "button",
@@ -2154,12 +2159,12 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2154
2159
  onClick: p,
2155
2160
  "aria-label": "Edit attachment",
2156
2161
  className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
2157
- children: /* @__PURE__ */ n(ca, { className: "size-5", weight: "regular" })
2162
+ children: /* @__PURE__ */ n(fa, { className: "size-5", weight: "regular" })
2158
2163
  }
2159
2164
  ) : void 0;
2160
- return x && !b.isLoading ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: vt, children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2 pr-3", children: [
2165
+ return x && !b.isLoading ? /* @__PURE__ */ n(Ee, { variant: "dark", bgClassName: bt, children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2 pr-3", children: [
2161
2166
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
2162
- Te,
2167
+ Ie,
2163
2168
  {
2164
2169
  variant: "dark",
2165
2170
  sourceUrl: l,
@@ -2167,31 +2172,31 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2167
2172
  mimeType: i
2168
2173
  }
2169
2174
  ) }),
2170
- y && /* @__PURE__ */ n("div", { className: "shrink-0", children: y })
2175
+ N && /* @__PURE__ */ n("div", { className: "shrink-0", children: N })
2171
2176
  ] }) }) : /* @__PURE__ */ f(
2172
- Ie,
2177
+ Ee,
2173
2178
  {
2174
2179
  variant: "dark",
2175
2180
  fixedHeight: !v,
2176
2181
  accentHex: b.accentHex,
2177
2182
  busy: b.isLoading,
2178
- topRight: v ? y : void 0,
2183
+ topRight: v ? N : void 0,
2179
2184
  children: [
2180
2185
  !v && /* @__PURE__ */ n(
2181
- Te,
2186
+ Ie,
2182
2187
  {
2183
2188
  variant: "dark",
2184
2189
  thumbnailUrl: b.thumbnailUrl,
2185
2190
  sourceUrl: l,
2186
2191
  title: e,
2187
2192
  mimeType: i,
2188
- topRight: y,
2193
+ topRight: N,
2189
2194
  isLoading: b.isLoading,
2190
2195
  onImageError: b.onImageError
2191
2196
  }
2192
2197
  ),
2193
2198
  /* @__PURE__ */ n(
2194
- pt,
2199
+ gt,
2195
2200
  {
2196
2201
  chinTextColor: b.chinTextColor,
2197
2202
  variant: "dark",
@@ -2210,7 +2215,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2210
2215
  ]
2211
2216
  }
2212
2217
  );
2213
- }, xt = ({
2218
+ }, vt = ({
2214
2219
  accentHex: e,
2215
2220
  side: t,
2216
2221
  visible: s,
@@ -2235,7 +2240,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2235
2240
  }
2236
2241
  )
2237
2242
  ] })
2238
- ) : /* @__PURE__ */ n(Z, { children: a }), Fr = ({
2243
+ ) : /* @__PURE__ */ n(K, { children: a }), Fr = ({
2239
2244
  title: e,
2240
2245
  description: t,
2241
2246
  descriptionLines: s,
@@ -2251,13 +2256,13 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2251
2256
  onClick: g,
2252
2257
  groupPosition: c = "single"
2253
2258
  }) => {
2254
- const p = bt(r, o), w = gt(a), v = u == null && w != null && !p ? w : void 0, x = u == null && !p ? g : void 0, b = m !== "loading" && Ae(r, o) ? vt : void 0, y = u && g ? {
2259
+ const p = pt(r, o), w = ft(a), v = u == null && w != null && !p ? w : void 0, x = u == null && !p ? g : void 0, b = m !== "loading" && Te(r, o) ? bt : void 0, N = u && g ? {
2255
2260
  ...u,
2256
2261
  onClick: () => {
2257
2262
  var T;
2258
2263
  g(), (T = u.onClick) == null || T.call(u);
2259
2264
  }
2260
- } : u, _ = Ge({
2265
+ } : u, _ = Ve({
2261
2266
  variant: "light",
2262
2267
  accentColor: h,
2263
2268
  status: m,
@@ -2267,13 +2272,13 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2267
2272
  sourceUrl: o
2268
2273
  });
2269
2274
  return /* @__PURE__ */ n(
2270
- xt,
2275
+ vt,
2271
2276
  {
2272
2277
  accentHex: _.accentHex,
2273
2278
  side: "receiver",
2274
2279
  visible: b == null && (c === "single" || c === "end"),
2275
2280
  children: /* @__PURE__ */ f(
2276
- Ie,
2281
+ Ee,
2277
2282
  {
2278
2283
  variant: "light",
2279
2284
  href: v,
@@ -2286,7 +2291,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2286
2291
  "data-testid": "link-attachment",
2287
2292
  children: [
2288
2293
  l === "featured" && /* @__PURE__ */ n(
2289
- Te,
2294
+ Ie,
2290
2295
  {
2291
2296
  variant: "light",
2292
2297
  thumbnailUrl: _.thumbnailUrl,
@@ -2298,7 +2303,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2298
2303
  }
2299
2304
  ),
2300
2305
  /* @__PURE__ */ n(
2301
- pt,
2306
+ gt,
2302
2307
  {
2303
2308
  chinTextColor: _.chinTextColor,
2304
2309
  variant: "light",
@@ -2308,7 +2313,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2308
2313
  descriptionLines: s,
2309
2314
  url: a,
2310
2315
  appIcon: d,
2311
- cta: y,
2316
+ cta: N,
2312
2317
  isLoading: _.isLoading
2313
2318
  }
2314
2319
  )
@@ -2334,7 +2339,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2334
2339
  onClick: c,
2335
2340
  groupPosition: p = "single"
2336
2341
  }) => {
2337
- const w = bt(i, l), v = gt(r), x = h == null && v != null && !w ? v : void 0, b = h == null && !w && x != null ? c : void 0, y = g !== "loading" && Ae(i, l), _ = Ge({
2342
+ const w = pt(i, l), v = ft(r), x = h == null && v != null && !w ? v : void 0, b = h == null && !w && x != null ? c : void 0, N = g !== "loading" && Te(i, l), _ = Ve({
2338
2343
  variant: "dark",
2339
2344
  accentColor: m,
2340
2345
  status: g,
@@ -2344,24 +2349,24 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2344
2349
  sourceUrl: l
2345
2350
  });
2346
2351
  return /* @__PURE__ */ n(
2347
- xt,
2352
+ vt,
2348
2353
  {
2349
2354
  accentHex: _.accentHex,
2350
2355
  side: "sender",
2351
- visible: !y && (p === "single" || p === "end"),
2356
+ visible: !N && (p === "single" || p === "end"),
2352
2357
  children: /* @__PURE__ */ f(
2353
- Ie,
2358
+ Ee,
2354
2359
  {
2355
2360
  variant: "dark",
2356
2361
  href: x,
2357
2362
  onClick: b,
2358
- fixedHeight: d === "featured" && !y,
2363
+ fixedHeight: d === "featured" && !N,
2359
2364
  accentHex: _.accentHex,
2360
2365
  busy: _.isLoading,
2361
- bgClassName: y ? vt : void 0,
2366
+ bgClassName: N ? bt : void 0,
2362
2367
  children: [
2363
2368
  d === "featured" && /* @__PURE__ */ n(
2364
- Te,
2369
+ Ie,
2365
2370
  {
2366
2371
  variant: "dark",
2367
2372
  thumbnailUrl: _.thumbnailUrl,
@@ -2373,7 +2378,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2373
2378
  }
2374
2379
  ),
2375
2380
  /* @__PURE__ */ n(
2376
- pt,
2381
+ gt,
2377
2382
  {
2378
2383
  chinTextColor: _.chinTextColor,
2379
2384
  variant: "dark",
@@ -2393,7 +2398,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2393
2398
  )
2394
2399
  }
2395
2400
  );
2396
- }, it = {
2401
+ }, rt = {
2397
2402
  Composer: zr,
2398
2403
  Sent: $r,
2399
2404
  Received: Fr
@@ -2419,7 +2424,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2419
2424
  middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
2420
2425
  end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
2421
2426
  }
2422
- }, Re = ({
2427
+ }, Ae = ({
2423
2428
  variant: e,
2424
2429
  text: t,
2425
2430
  bordered: s = !0,
@@ -2491,7 +2496,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2491
2496
  ]
2492
2497
  }
2493
2498
  );
2494
- }, Le = ({
2499
+ }, Re = ({
2495
2500
  onClick: e,
2496
2501
  variant: t = "overlay",
2497
2502
  ariaLabel: s = "Dismiss attachment"
@@ -2507,9 +2512,9 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2507
2512
  "flex size-6 items-center justify-center rounded-full text-white",
2508
2513
  t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
2509
2514
  ),
2510
- children: /* @__PURE__ */ n(lt, { className: "size-3", weight: "bold" })
2515
+ children: /* @__PURE__ */ n(it, { className: "size-3", weight: "bold" })
2511
2516
  }
2512
- ), Me = (e) => e === "received" ? "light" : "dark", so = ({
2517
+ ), Le = (e) => e === "received" ? "light" : "dark", so = ({
2513
2518
  firstOfGroup: e,
2514
2519
  endOfGroup: t,
2515
2520
  groupedByUser: s
@@ -2530,7 +2535,7 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2530
2535
  }
2531
2536
  ),
2532
2537
  s ?? null
2533
- ] }), wt = ({
2538
+ ] }), xt = ({
2534
2539
  state: e,
2535
2540
  src: t,
2536
2541
  mimeType: s,
@@ -2541,12 +2546,12 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2541
2546
  preload: l,
2542
2547
  onDismiss: d
2543
2548
  }) => {
2544
- const u = Me(e), h = e === "composer" && !!d, m = Gr({ src: t, mimeType: s, filename: a, items: r });
2549
+ const u = Le(e), h = e === "composer" && !!d, m = Gr({ src: t, mimeType: s, filename: a, items: r });
2545
2550
  if (m.length === 0)
2546
2551
  return null;
2547
2552
  const g = l ?? (m.length > 1 ? "none" : "metadata");
2548
2553
  return /* @__PURE__ */ n(
2549
- Re,
2554
+ Ae,
2550
2555
  {
2551
2556
  variant: u,
2552
2557
  text: i,
@@ -2560,14 +2565,14 @@ const Or = "flex size-6 items-center justify-center rounded-full bg-[#121110] te
2560
2565
  trailingAction: (
2561
2566
  // Composer only supports a single attachment, so the
2562
2567
  // dismiss control sits on the only player.
2563
- h && p === 0 ? /* @__PURE__ */ n(Le, { onClick: d, variant: "inline" }) : void 0
2568
+ h && p === 0 ? /* @__PURE__ */ n(Re, { onClick: d, variant: "inline" }) : void 0
2564
2569
  )
2565
2570
  },
2566
2571
  `${c.src}-${p}`
2567
2572
  )) })
2568
2573
  }
2569
2574
  );
2570
- }, Wr = (e) => /* @__PURE__ */ n(wt, { ...e, state: "composer" }), Xr = (e) => /* @__PURE__ */ n(wt, { ...e, state: "sent" }), qr = (e) => /* @__PURE__ */ n(wt, { ...e, state: "received" }), Kr = {
2575
+ }, Wr = (e) => /* @__PURE__ */ n(xt, { ...e, state: "composer" }), Xr = (e) => /* @__PURE__ */ n(xt, { ...e, state: "sent" }), qr = (e) => /* @__PURE__ */ n(xt, { ...e, state: "received" }), Kr = {
2571
2576
  Composer: Wr,
2572
2577
  Sent: Xr,
2573
2578
  Received: qr
@@ -2594,8 +2599,8 @@ function Qr(e, t) {
2594
2599
  }
2595
2600
  }
2596
2601
  if (!e) return;
2597
- if (ce(e) === "document") {
2598
- const r = yn(e), i = Jr[r];
2602
+ if (de(e) === "document") {
2603
+ const r = Nn(e), i = Jr[r];
2599
2604
  if (i) return i;
2600
2605
  if (e === "application/octet-stream") return;
2601
2606
  }
@@ -2607,7 +2612,7 @@ function ei(e, t, s) {
2607
2612
  const a = Qr(e, t), r = typeof s == "number" && s > 0 ? Zr(s) : void 0;
2608
2613
  return [a, r].filter(Boolean).join(" · ") || void 0;
2609
2614
  }
2610
- function ae(e) {
2615
+ function re(e) {
2611
2616
  try {
2612
2617
  const s = new URL(e).pathname.split("/").pop();
2613
2618
  return s && s.length > 0 ? decodeURIComponent(s) : "download";
@@ -2624,7 +2629,7 @@ const ti = {
2624
2629
  }, si = {
2625
2630
  dark: "text-white/85",
2626
2631
  light: "text-black/85"
2627
- }, On = ({
2632
+ }, Pn = ({
2628
2633
  variant: e,
2629
2634
  filename: t,
2630
2635
  title: s,
@@ -2642,7 +2647,7 @@ const ti = {
2642
2647
  ni[e]
2643
2648
  ),
2644
2649
  "aria-hidden": !0,
2645
- children: xe(a, {
2650
+ children: ve(a, {
2646
2651
  className: k("size-6", si[e]),
2647
2652
  weight: "regular"
2648
2653
  })
@@ -2674,7 +2679,7 @@ const ti = {
2674
2679
  m
2675
2680
  ]
2676
2681
  }
2677
- ) : /* @__PURE__ */ f(Z, { children: [
2682
+ ) : /* @__PURE__ */ f(K, { children: [
2678
2683
  h,
2679
2684
  m
2680
2685
  ] });
@@ -2683,8 +2688,8 @@ const ti = {
2683
2688
  l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
2684
2689
  ] });
2685
2690
  };
2686
- async function Pn(e, t) {
2687
- const s = t ?? ae(e);
2691
+ async function zn(e, t) {
2692
+ const s = t ?? re(e);
2688
2693
  try {
2689
2694
  const a = await fetch(e, { mode: "cors" });
2690
2695
  if (!a.ok) throw new Error(`HTTP ${a.status}`);
@@ -2711,9 +2716,9 @@ const ai = ({
2711
2716
  onActivate: a,
2712
2717
  trailingAction: r
2713
2718
  }) => {
2714
- const i = t.filename ?? ae(t.src);
2719
+ const i = t.filename ?? re(t.src);
2715
2720
  return /* @__PURE__ */ n(
2716
- On,
2721
+ Pn,
2717
2722
  {
2718
2723
  variant: e,
2719
2724
  filename: i,
@@ -2725,7 +2730,7 @@ const ai = ({
2725
2730
  trailingAction: r
2726
2731
  }
2727
2732
  );
2728
- }, _t = ({
2733
+ }, wt = ({
2729
2734
  state: e,
2730
2735
  src: t,
2731
2736
  filename: s,
@@ -2738,7 +2743,7 @@ const ai = ({
2738
2743
  onClick: u,
2739
2744
  onDismiss: h
2740
2745
  }) => {
2741
- const m = Me(e), g = e === "composer" && !!h, c = ai({
2746
+ const m = Le(e), g = e === "composer" && !!h, c = ai({
2742
2747
  src: t,
2743
2748
  filename: s,
2744
2749
  fileSize: a,
@@ -2749,8 +2754,8 @@ const ai = ({
2749
2754
  if ((u == null ? void 0 : u(v)) === !1) return;
2750
2755
  const x = c[v];
2751
2756
  if (!x) return;
2752
- const b = x.filename ?? ae(x.src);
2753
- Pn(x.src, b);
2757
+ const b = x.filename ?? re(x.src);
2758
+ zn(x.src, b);
2754
2759
  };
2755
2760
  if (c.length === 0)
2756
2761
  return null;
@@ -2762,11 +2767,11 @@ const ai = ({
2762
2767
  m === "dark" ? "text-white/70" : "text-black/70"
2763
2768
  ),
2764
2769
  "aria-hidden": !0,
2765
- children: /* @__PURE__ */ n(Ee, { className: "size-5", weight: "bold" })
2770
+ children: /* @__PURE__ */ n(Se, { className: "size-5", weight: "bold" })
2766
2771
  }
2767
2772
  );
2768
2773
  return /* @__PURE__ */ n(
2769
- Re,
2774
+ Ae,
2770
2775
  {
2771
2776
  variant: m,
2772
2777
  text: l,
@@ -2779,22 +2784,22 @@ const ai = ({
2779
2784
  item: v,
2780
2785
  index: x,
2781
2786
  onActivate: p,
2782
- trailingAction: g && x === 0 ? /* @__PURE__ */ n(Le, { onClick: h, variant: "inline" }) : w
2787
+ trailingAction: g && x === 0 ? /* @__PURE__ */ n(Re, { onClick: h, variant: "inline" }) : w
2783
2788
  },
2784
2789
  `${v.src}-${x}`
2785
2790
  )) })
2786
2791
  }
2787
2792
  );
2788
- }, ii = (e) => /* @__PURE__ */ n(_t, { ...e, state: "composer" }), li = (e) => /* @__PURE__ */ n(_t, { ...e, state: "sent" }), oi = (e) => /* @__PURE__ */ n(_t, { ...e, state: "received" }), ci = {
2793
+ }, ii = (e) => /* @__PURE__ */ n(wt, { ...e, state: "composer" }), li = (e) => /* @__PURE__ */ n(wt, { ...e, state: "sent" }), oi = (e) => /* @__PURE__ */ n(wt, { ...e, state: "received" }), ci = {
2789
2794
  Composer: ii,
2790
2795
  Sent: li,
2791
2796
  Received: oi
2792
- }, zn = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", en = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", yt = ({
2797
+ }, Fn = "inline-flex size-10 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none disabled:cursor-default disabled:opacity-40", en = "absolute top-1/2 z-[1] inline-flex size-12 -translate-y-1/2 items-center justify-center rounded-full border-0 bg-white/[0.12] p-0 text-white transition-colors duration-150 ease-[ease] hover:bg-white/[0.22] focus-visible:bg-white/[0.22] focus-visible:outline-none", _t = ({
2793
2798
  onPrev: e,
2794
2799
  onNext: t,
2795
2800
  prevLabel: s = "Previous",
2796
2801
  nextLabel: a = "Next"
2797
- }) => /* @__PURE__ */ f(Z, { children: [
2802
+ }) => /* @__PURE__ */ f(K, { children: [
2798
2803
  /* @__PURE__ */ n(
2799
2804
  "button",
2800
2805
  {
@@ -2802,7 +2807,7 @@ const ai = ({
2802
2807
  onClick: e,
2803
2808
  "aria-label": s,
2804
2809
  className: `${en} left-4`,
2805
- children: /* @__PURE__ */ n(da, { size: 20, weight: "bold", "aria-hidden": !0 })
2810
+ children: /* @__PURE__ */ n(ga, { size: 20, weight: "bold", "aria-hidden": !0 })
2806
2811
  }
2807
2812
  ),
2808
2813
  /* @__PURE__ */ n(
@@ -2812,10 +2817,10 @@ const ai = ({
2812
2817
  onClick: t,
2813
2818
  "aria-label": a,
2814
2819
  className: `${en} right-4`,
2815
- children: /* @__PURE__ */ n(mn, { size: 20, weight: "bold", "aria-hidden": !0 })
2820
+ children: /* @__PURE__ */ n(hn, { size: 20, weight: "bold", "aria-hidden": !0 })
2816
2821
  }
2817
2822
  )
2818
- ] }), Fn = ({
2823
+ ] }), $n = ({
2819
2824
  url: e,
2820
2825
  filename: t,
2821
2826
  variant: s = "pill",
@@ -2824,9 +2829,9 @@ const ai = ({
2824
2829
  tone: i = "dark",
2825
2830
  onTriggered: o
2826
2831
  }) => {
2827
- const [l, d] = B(!1), u = K(
2832
+ const [l, d] = B(!1), u = q(
2828
2833
  (c) => {
2829
- c.stopPropagation(), !l && (d(!0), Pn(e, t).catch(() => {
2834
+ c.stopPropagation(), !l && (d(!0), zn(e, t).catch(() => {
2830
2835
  }).finally(() => {
2831
2836
  d(!1), o == null || o();
2832
2837
  }));
@@ -2851,14 +2856,14 @@ const ai = ({
2851
2856
  }[i]
2852
2857
  ),
2853
2858
  children: l ? /* @__PURE__ */ n(
2854
- ve,
2859
+ be,
2855
2860
  {
2856
2861
  className: "size-4 animate-spin",
2857
2862
  weight: "bold",
2858
2863
  "aria-hidden": !0
2859
2864
  }
2860
2865
  ) : /* @__PURE__ */ n(
2861
- Ee,
2866
+ Se,
2862
2867
  {
2863
2868
  className: "size-5 shrink-0",
2864
2869
  weight: "bold",
@@ -2873,8 +2878,8 @@ const ai = ({
2873
2878
  onClick: u,
2874
2879
  disabled: l,
2875
2880
  "aria-label": a,
2876
- className: zn,
2877
- children: l ? /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(Ee, { size: 20, weight: "bold", "aria-hidden": !0 })
2881
+ className: Fn,
2882
+ children: l ? /* @__PURE__ */ n(be, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(Se, { size: 20, weight: "bold", "aria-hidden": !0 })
2878
2883
  }
2879
2884
  ) : /* @__PURE__ */ f(
2880
2885
  "button",
@@ -2889,34 +2894,34 @@ const ai = ({
2889
2894
  ),
2890
2895
  children: [
2891
2896
  l ? /* @__PURE__ */ n(
2892
- ve,
2897
+ be,
2893
2898
  {
2894
2899
  className: "size-4 animate-spin",
2895
2900
  weight: "bold",
2896
2901
  "aria-hidden": !0
2897
2902
  }
2898
- ) : /* @__PURE__ */ n(Ee, { ...g, "aria-hidden": !0 }),
2903
+ ) : /* @__PURE__ */ n(Se, { ...g, "aria-hidden": !0 }),
2899
2904
  h ? null : a
2900
2905
  ]
2901
2906
  }
2902
2907
  );
2903
- }, Qe = (e, t, s) => Math.min(Math.max(e, t), s), Nt = ({
2908
+ }, Je = (e, t, s) => Math.min(Math.max(e, t), s), yt = ({
2904
2909
  length: e,
2905
2910
  initialIndex: t,
2906
2911
  open: s
2907
2912
  }) => {
2908
- const a = Qe(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
2909
- X(() => {
2910
- s && i(Qe(t, 0, Math.max(e - 1, 0)));
2911
- }, [s, t, e]), X(() => {
2912
- i((d) => Qe(d, 0, Math.max(e - 1, 0)));
2913
+ const a = Je(t, 0, Math.max(e - 1, 0)), [r, i] = B(a);
2914
+ Y(() => {
2915
+ s && i(Je(t, 0, Math.max(e - 1, 0)));
2916
+ }, [s, t, e]), Y(() => {
2917
+ i((d) => Je(d, 0, Math.max(e - 1, 0)));
2913
2918
  }, [e]);
2914
- const o = K(() => {
2919
+ const o = q(() => {
2915
2920
  e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
2916
- }, [e]), l = K(() => {
2921
+ }, [e]), l = q(() => {
2917
2922
  e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
2918
2923
  }, [e]);
2919
- return X(() => {
2924
+ return Y(() => {
2920
2925
  if (!s || e <= 1) return;
2921
2926
  const d = (u) => {
2922
2927
  if (u.key !== "ArrowLeft" && u.key !== "ArrowRight") return;
@@ -2925,7 +2930,7 @@ const ai = ({
2925
2930
  };
2926
2931
  return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
2927
2932
  }, [s, e, o, l]), { index: r, prev: o, next: l };
2928
- }, kt = ({
2933
+ }, Nt = ({
2929
2934
  open: e,
2930
2935
  onClose: t,
2931
2936
  ariaLabel: s,
@@ -2934,8 +2939,8 @@ const ai = ({
2934
2939
  children: i,
2935
2940
  "data-testid": o
2936
2941
  }) => {
2937
- const l = V(null), d = V(null);
2938
- return X(() => {
2942
+ const l = H(null), d = H(null);
2943
+ return Y(() => {
2939
2944
  var g;
2940
2945
  const m = l.current;
2941
2946
  if (m) {
@@ -3005,8 +3010,8 @@ const ai = ({
3005
3010
  type: "button",
3006
3011
  onClick: t,
3007
3012
  "aria-label": "Close viewer",
3008
- className: zn,
3009
- children: /* @__PURE__ */ n(lt, { size: 20, weight: "bold", "aria-hidden": !0 })
3013
+ className: Fn,
3014
+ children: /* @__PURE__ */ n(it, { size: 20, weight: "bold", "aria-hidden": !0 })
3010
3015
  }
3011
3016
  )
3012
3017
  ] })
@@ -3015,29 +3020,29 @@ const ai = ({
3015
3020
  ]
3016
3021
  }
3017
3022
  );
3018
- }, $n = ({
3023
+ }, Bn = ({
3019
3024
  open: e,
3020
3025
  items: t,
3021
3026
  initialIndex: s = 0,
3022
3027
  onClose: a
3023
3028
  }) => {
3024
- const { index: r, prev: i, next: o } = Nt({
3029
+ const { index: r, prev: i, next: o } = yt({
3025
3030
  length: t.length,
3026
3031
  initialIndex: s,
3027
3032
  open: e
3028
- }), l = t[r], d = ie(
3029
- () => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "image"),
3033
+ }), l = t[r], d = le(
3034
+ () => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "image"),
3030
3035
  [l]
3031
3036
  );
3032
3037
  return l ? /* @__PURE__ */ f(
3033
- kt,
3038
+ Nt,
3034
3039
  {
3035
3040
  open: e,
3036
3041
  onClose: a,
3037
3042
  ariaLabel: d,
3038
3043
  counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
3039
3044
  actions: /* @__PURE__ */ n(
3040
- Fn,
3045
+ $n,
3041
3046
  {
3042
3047
  url: l.src,
3043
3048
  filename: d,
@@ -3059,7 +3064,7 @@ const ai = ({
3059
3064
  `${r}:${l.src}`
3060
3065
  ) : null,
3061
3066
  t.length > 1 ? /* @__PURE__ */ n(
3062
- yt,
3067
+ _t,
3063
3068
  {
3064
3069
  onPrev: i,
3065
3070
  onNext: o,
@@ -3080,7 +3085,7 @@ const ai = ({
3080
3085
  "rounded-bl-[18px]",
3081
3086
  "rounded-br-[18px]"
3082
3087
  ]
3083
- }, mi = "--mes-single-width-cap", hi = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", fi = 436, Bn = ({
3088
+ }, mi = "--mes-single-width-cap", hi = "[--mes-single-width-cap:309px] sm:[--mes-single-width-cap:326px]", fi = 436, Un = ({
3084
3089
  tiles: e,
3085
3090
  onTileActivate: t,
3086
3091
  maxVisible: s = 4,
@@ -3181,13 +3186,13 @@ const ai = ({
3181
3186
  })
3182
3187
  }
3183
3188
  );
3184
- }, De = (e) => {
3185
- const [t, s] = B(!1), [a, r] = B(0), i = K(
3189
+ }, Me = (e) => {
3190
+ const [t, s] = B(!1), [a, r] = B(0), i = q(
3186
3191
  (l) => {
3187
3192
  (e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
3188
3193
  },
3189
3194
  [e]
3190
- ), o = K(() => s(!1), []);
3195
+ ), o = q(() => s(!1), []);
3191
3196
  return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
3192
3197
  }, gi = ({
3193
3198
  item: e,
@@ -3205,7 +3210,7 @@ const ai = ({
3205
3210
  "img",
3206
3211
  {
3207
3212
  ref: r,
3208
- src: oe(e.src) ?? e.src,
3213
+ src: ce(e.src) ?? e.src,
3209
3214
  alt: e.alt ?? "",
3210
3215
  width: e.width,
3211
3216
  height: e.height,
@@ -3221,12 +3226,12 @@ const ai = ({
3221
3226
  src: e,
3222
3227
  alt: t,
3223
3228
  items: s
3224
- }) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], Un = (e, t) => e.map((s, a) => ({
3229
+ }) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], jn = (e, t) => e.map((s, a) => ({
3225
3230
  src: s.src,
3226
3231
  alt: s.alt,
3227
3232
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
3228
3233
  })), bi = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
3229
- const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } = De(r);
3234
+ const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: u } = Me(r);
3230
3235
  return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
3231
3236
  /* @__PURE__ */ n(
3232
3237
  "button",
@@ -3238,7 +3243,7 @@ const ai = ({
3238
3243
  children: /* @__PURE__ */ n(
3239
3244
  "img",
3240
3245
  {
3241
- src: oe(e) ?? e,
3246
+ src: ce(e) ?? e,
3242
3247
  alt: t ?? "",
3243
3248
  draggable: !1,
3244
3249
  loading: a,
@@ -3248,12 +3253,12 @@ const ai = ({
3248
3253
  )
3249
3254
  }
3250
3255
  ),
3251
- i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Le, { onClick: i }) }) : null,
3256
+ i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Re, { onClick: i }) }) : null,
3252
3257
  /* @__PURE__ */ n(
3253
- $n,
3258
+ Bn,
3254
3259
  {
3255
3260
  open: o,
3256
- items: Un([{ src: e, alt: t }], s),
3261
+ items: jn([{ src: e, alt: t }], s),
3257
3262
  initialIndex: l,
3258
3263
  onClose: u
3259
3264
  }
@@ -3278,7 +3283,7 @@ const ai = ({
3278
3283
  imgRef: r,
3279
3284
  onLoad: i
3280
3285
  };
3281
- }, jn = ({
3286
+ }, Hn = ({
3282
3287
  state: e,
3283
3288
  src: t,
3284
3289
  alt: s,
@@ -3289,13 +3294,13 @@ const ai = ({
3289
3294
  loading: l = "lazy",
3290
3295
  onClick: d
3291
3296
  }) => {
3292
- const u = pi({ src: t, alt: s, items: r }), h = Me(e), { viewerOpen: m, viewerIndex: g, handleActivate: c, closeViewer: p } = De(d), w = u.length === 1, v = xi(w ? u[0] : void 0);
3297
+ const u = pi({ src: t, alt: s, items: r }), h = Le(e), { viewerOpen: m, viewerIndex: g, handleActivate: c, closeViewer: p } = Me(d), w = u.length === 1, v = xi(w ? u[0] : void 0);
3293
3298
  if (u.length === 0)
3294
3299
  return null;
3295
3300
  const x = u.map(
3296
- (b, y) => gi({
3301
+ (b, N) => gi({
3297
3302
  item: b,
3298
- index: y,
3303
+ index: N,
3299
3304
  totalCount: u.length,
3300
3305
  fallbackLoading: l,
3301
3306
  imgRef: w ? v.imgRef : void 0,
@@ -3303,7 +3308,7 @@ const ai = ({
3303
3308
  })
3304
3309
  );
3305
3310
  return /* @__PURE__ */ f(
3306
- Re,
3311
+ Ae,
3307
3312
  {
3308
3313
  variant: h,
3309
3314
  text: i,
@@ -3315,7 +3320,7 @@ const ai = ({
3315
3320
  "data-testid": "image-attachment",
3316
3321
  children: [
3317
3322
  /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
3318
- Bn,
3323
+ Un,
3319
3324
  {
3320
3325
  tiles: x,
3321
3326
  onTileActivate: c,
@@ -3323,10 +3328,10 @@ const ai = ({
3323
3328
  }
3324
3329
  ) }),
3325
3330
  /* @__PURE__ */ n(
3326
- $n,
3331
+ Bn,
3327
3332
  {
3328
3333
  open: m,
3329
- items: Un(u, a),
3334
+ items: jn(u, a),
3330
3335
  initialIndex: g,
3331
3336
  onClose: p
3332
3337
  }
@@ -3334,7 +3339,7 @@ const ai = ({
3334
3339
  ]
3335
3340
  }
3336
3341
  );
3337
- }, wi = (e) => /* @__PURE__ */ n(bi, { ...e }), _i = (e) => /* @__PURE__ */ n(jn, { ...e, state: "sent" }), yi = (e) => /* @__PURE__ */ n(jn, { ...e, state: "received" }), Ni = {
3342
+ }, wi = (e) => /* @__PURE__ */ n(bi, { ...e }), _i = (e) => /* @__PURE__ */ n(Hn, { ...e, state: "sent" }), yi = (e) => /* @__PURE__ */ n(Hn, { ...e, state: "received" }), Ni = {
3338
3343
  Composer: wi,
3339
3344
  Sent: _i,
3340
3345
  Received: yi
@@ -3344,19 +3349,19 @@ const ai = ({
3344
3349
  initialIndex: s = 0,
3345
3350
  onClose: a
3346
3351
  }) => {
3347
- const { index: r, prev: i, next: o } = Nt({
3352
+ const { index: r, prev: i, next: o } = yt({
3348
3353
  length: t.length,
3349
3354
  initialIndex: s,
3350
3355
  open: e
3351
- }), l = t[r], d = ie(
3352
- () => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "document"),
3356
+ }), l = t[r], d = le(
3357
+ () => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "document"),
3353
3358
  [l]
3354
- ), u = ie(
3359
+ ), u = le(
3355
3360
  () => l ? Ci(l.src) : void 0,
3356
3361
  [l]
3357
3362
  );
3358
3363
  return !l || !u ? null : /* @__PURE__ */ f(
3359
- kt,
3364
+ Nt,
3360
3365
  {
3361
3366
  open: e,
3362
3367
  onClose: a,
@@ -3375,7 +3380,7 @@ const ai = ({
3375
3380
  `${r}:${l.src}`
3376
3381
  ),
3377
3382
  t.length > 1 ? /* @__PURE__ */ n(
3378
- yt,
3383
+ _t,
3379
3384
  {
3380
3385
  onPrev: i,
3381
3386
  onNext: o,
@@ -3402,9 +3407,9 @@ const ai = ({
3402
3407
  onActivate: a,
3403
3408
  trailingAction: r
3404
3409
  }) => {
3405
- const i = t.filename ?? ae(t.src);
3410
+ const i = t.filename ?? re(t.src);
3406
3411
  return /* @__PURE__ */ n(
3407
- On,
3412
+ Pn,
3408
3413
  {
3409
3414
  variant: e,
3410
3415
  filename: i,
@@ -3416,7 +3421,7 @@ const ai = ({
3416
3421
  trailingAction: r
3417
3422
  }
3418
3423
  );
3419
- }, Ct = ({
3424
+ }, kt = ({
3420
3425
  state: e,
3421
3426
  src: t,
3422
3427
  filename: s,
@@ -3428,24 +3433,24 @@ const ai = ({
3428
3433
  onClick: d,
3429
3434
  onDismiss: u
3430
3435
  }) => {
3431
- const h = Me(e), m = Si({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = De(d), v = e === "composer" && !!u;
3436
+ const h = Le(e), m = Si({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = Me(d), v = e === "composer" && !!u;
3432
3437
  if (m.length === 0)
3433
3438
  return null;
3434
3439
  const x = m.map((b) => ({
3435
3440
  src: b.src,
3436
- filename: b.filename ?? ae(b.src)
3441
+ filename: b.filename ?? re(b.src)
3437
3442
  }));
3438
3443
  return /* @__PURE__ */ f(
3439
- Re,
3444
+ Ae,
3440
3445
  {
3441
3446
  variant: h,
3442
3447
  text: o,
3443
3448
  groupPosition: l,
3444
3449
  "data-testid": "pdf-attachment",
3445
3450
  children: [
3446
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((b, y) => {
3447
- const _ = b.filename ?? ae(b.src), T = v && y === 0 ? /* @__PURE__ */ n(Le, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
3448
- Fn,
3451
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: m.map((b, N) => {
3452
+ const _ = b.filename ?? re(b.src), T = v && N === 0 ? /* @__PURE__ */ n(Re, { onClick: u, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
3453
+ $n,
3449
3454
  {
3450
3455
  url: b.src,
3451
3456
  filename: _,
@@ -3459,11 +3464,11 @@ const ai = ({
3459
3464
  {
3460
3465
  variant: h,
3461
3466
  item: b,
3462
- index: y,
3467
+ index: N,
3463
3468
  onActivate: p,
3464
3469
  trailingAction: T
3465
3470
  },
3466
- `${b.src}-${y}`
3471
+ `${b.src}-${N}`
3467
3472
  );
3468
3473
  }) }),
3469
3474
  /* @__PURE__ */ n(
@@ -3478,26 +3483,26 @@ const ai = ({
3478
3483
  ]
3479
3484
  }
3480
3485
  );
3481
- }, Ii = (e) => /* @__PURE__ */ n(Ct, { ...e, state: "composer" }), Ti = (e) => /* @__PURE__ */ n(Ct, { ...e, state: "sent" }), Ai = (e) => /* @__PURE__ */ n(Ct, { ...e, state: "received" }), Ri = {
3486
+ }, Ii = (e) => /* @__PURE__ */ n(kt, { ...e, state: "composer" }), Ti = (e) => /* @__PURE__ */ n(kt, { ...e, state: "sent" }), Ai = (e) => /* @__PURE__ */ n(kt, { ...e, state: "received" }), Ri = {
3482
3487
  Composer: Ii,
3483
3488
  Sent: Ti,
3484
3489
  Received: Ai
3485
- }, Hn = ({
3490
+ }, Vn = ({
3486
3491
  open: e,
3487
3492
  items: t,
3488
3493
  initialIndex: s = 0,
3489
3494
  onClose: a
3490
3495
  }) => {
3491
- const { index: r, prev: i, next: o } = Nt({
3496
+ const { index: r, prev: i, next: o } = yt({
3492
3497
  length: t.length,
3493
3498
  initialIndex: s,
3494
3499
  open: e
3495
- }), l = t[r], d = ie(
3496
- () => (l == null ? void 0 : l.filename) ?? (l ? ae(l.src) : "video"),
3500
+ }), l = t[r], d = le(
3501
+ () => (l == null ? void 0 : l.filename) ?? (l ? re(l.src) : "video"),
3497
3502
  [l]
3498
3503
  );
3499
3504
  return l ? /* @__PURE__ */ f(
3500
- kt,
3505
+ Nt,
3501
3506
  {
3502
3507
  open: e,
3503
3508
  onClose: a,
@@ -3521,7 +3526,7 @@ const ai = ({
3521
3526
  `${r}:${l.src}`
3522
3527
  ),
3523
3528
  t.length > 1 ? /* @__PURE__ */ n(
3524
- yt,
3529
+ _t,
3525
3530
  {
3526
3531
  onPrev: i,
3527
3532
  onNext: o,
@@ -3532,7 +3537,7 @@ const ai = ({
3532
3537
  ]
3533
3538
  }
3534
3539
  ) : null;
3535
- }, Li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(rt, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Vn = ({
3540
+ }, Li = () => /* @__PURE__ */ n("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n("span", { className: "flex size-12 items-center justify-center rounded-full bg-black/55 text-white backdrop-blur", children: /* @__PURE__ */ n(at, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Gn = ({
3536
3541
  item: e,
3537
3542
  index: t
3538
3543
  }) => /* @__PURE__ */ f("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
@@ -3547,7 +3552,7 @@ const ai = ({
3547
3552
  className: "absolute inset-0 size-full object-cover"
3548
3553
  }
3549
3554
  ) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
3550
- fn,
3555
+ gn,
3551
3556
  {
3552
3557
  className: "size-16 text-white/30",
3553
3558
  weight: "regular",
@@ -3557,21 +3562,21 @@ const ai = ({
3557
3562
  /* @__PURE__ */ n(Li, {})
3558
3563
  ] }), Mi = (e, t, s) => ({
3559
3564
  ariaLabel: `Play video ${t + 1} of ${s}`,
3560
- content: /* @__PURE__ */ n(Vn, { item: e, index: t })
3565
+ content: /* @__PURE__ */ n(Gn, { item: e, index: t })
3561
3566
  }), Di = ({
3562
3567
  src: e,
3563
3568
  poster: t,
3564
3569
  mimeType: s,
3565
3570
  preload: a,
3566
3571
  items: r
3567
- }) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], Gn = (e, t) => e.map((s, a) => ({
3572
+ }) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], Yn = (e, t) => e.map((s, a) => ({
3568
3573
  src: s.src,
3569
3574
  poster: s.poster,
3570
3575
  mimeType: s.mimeType,
3571
3576
  preload: s.preload,
3572
3577
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
3573
3578
  })), Oi = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
3574
- const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: h } = De(i);
3579
+ const { viewerOpen: l, viewerIndex: d, handleActivate: u, closeViewer: h } = Me(i);
3575
3580
  return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
3576
3581
  /* @__PURE__ */ n(
3577
3582
  "button",
@@ -3580,21 +3585,21 @@ const ai = ({
3580
3585
  onClick: () => u(0),
3581
3586
  "aria-label": "Play video",
3582
3587
  className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
3583
- children: /* @__PURE__ */ n(Vn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
3588
+ children: /* @__PURE__ */ n(Gn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
3584
3589
  }
3585
3590
  ),
3586
- o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Le, { onClick: o }) }) : null,
3591
+ o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Re, { onClick: o }) }) : null,
3587
3592
  /* @__PURE__ */ n(
3588
- Hn,
3593
+ Vn,
3589
3594
  {
3590
3595
  open: l,
3591
- items: Gn([{ src: e, poster: t, mimeType: s, preload: r }], a),
3596
+ items: Yn([{ src: e, poster: t, mimeType: s, preload: r }], a),
3592
3597
  initialIndex: d,
3593
3598
  onClose: h
3594
3599
  }
3595
3600
  )
3596
3601
  ] });
3597
- }, Yn = ({
3602
+ }, Wn = ({
3598
3603
  state: e,
3599
3604
  src: t,
3600
3605
  poster: s,
@@ -3606,26 +3611,26 @@ const ai = ({
3606
3611
  preload: d,
3607
3612
  onClick: u
3608
3613
  }) => {
3609
- const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Me(e), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = De(u);
3614
+ const h = Di({ src: t, poster: s, mimeType: a, preload: d, items: i }), m = Le(e), { viewerOpen: g, viewerIndex: c, handleActivate: p, closeViewer: w } = Me(u);
3610
3615
  if (h.length === 0)
3611
3616
  return null;
3612
3617
  const v = h.map(
3613
3618
  (x, b) => Mi(x, b, h.length)
3614
3619
  );
3615
3620
  return /* @__PURE__ */ f(
3616
- Re,
3621
+ Ae,
3617
3622
  {
3618
3623
  variant: m,
3619
3624
  text: o,
3620
3625
  groupPosition: l,
3621
3626
  "data-testid": "video-attachment",
3622
3627
  children: [
3623
- /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(Bn, { tiles: v, onTileActivate: p }) }),
3628
+ /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(Un, { tiles: v, onTileActivate: p }) }),
3624
3629
  /* @__PURE__ */ n(
3625
- Hn,
3630
+ Vn,
3626
3631
  {
3627
3632
  open: g,
3628
- items: Gn(h, r),
3633
+ items: Yn(h, r),
3629
3634
  initialIndex: c,
3630
3635
  onClose: w
3631
3636
  }
@@ -3633,11 +3638,11 @@ const ai = ({
3633
3638
  ]
3634
3639
  }
3635
3640
  );
3636
- }, Pi = (e) => /* @__PURE__ */ n(Oi, { ...e }), zi = (e) => /* @__PURE__ */ n(Yn, { ...e, state: "sent" }), Fi = (e) => /* @__PURE__ */ n(Yn, { ...e, state: "received" }), $i = {
3641
+ }, Pi = (e) => /* @__PURE__ */ n(Oi, { ...e }), zi = (e) => /* @__PURE__ */ n(Wn, { ...e, state: "sent" }), Fi = (e) => /* @__PURE__ */ n(Wn, { ...e, state: "received" }), $i = {
3637
3642
  Composer: Pi,
3638
3643
  Sent: zi,
3639
3644
  Received: Fi
3640
- }, Ce = {
3645
+ }, ke = {
3641
3646
  Image: Ni,
3642
3647
  Video: $i,
3643
3648
  Audio: Kr,
@@ -3668,11 +3673,11 @@ function nn(e) {
3668
3673
  title: O(e.title),
3669
3674
  description: O(e.text),
3670
3675
  url: t,
3671
- thumbnailUrl: oe(s),
3676
+ thumbnailUrl: ce(s),
3672
3677
  // Playable clip embedded in a link preview — lets LinkAttachment render its
3673
3678
  // native video/audio player in the hero instead of a static thumbnail.
3674
3679
  sourceUrl: a,
3675
- layout: s || bt(r, a) ? "featured" : "classic",
3680
+ layout: s || pt(r, a) ? "featured" : "classic",
3676
3681
  mimeType: r,
3677
3682
  // Dominant colour of the image, resolved by the sender at stage time and
3678
3683
  // persisted on the attachment (`stream-custom-data.ts`), so every viewer
@@ -3686,13 +3691,13 @@ function nn(e) {
3686
3691
  }
3687
3692
  function Ui(e) {
3688
3693
  var t;
3689
- return Wn(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;
3694
+ return Xn(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;
3690
3695
  }
3691
- function Wn(e) {
3696
+ function Xn(e) {
3692
3697
  const t = O(e.og_scrape_url);
3693
3698
  return e.type === "link" || !!t && !e.asset_url;
3694
3699
  }
3695
- function Xn(e) {
3700
+ function qn(e) {
3696
3701
  if (!(e != null && e.length)) return [];
3697
3702
  const t = [], s = (r, i) => {
3698
3703
  const o = t[t.length - 1];
@@ -3710,7 +3715,7 @@ function Xn(e) {
3710
3715
  t.push({ type: "link", attachments: [r] });
3711
3716
  };
3712
3717
  for (const r of e) {
3713
- if (Wn(r)) {
3718
+ if (Xn(r)) {
3714
3719
  a(r);
3715
3720
  continue;
3716
3721
  }
@@ -3731,15 +3736,15 @@ function sn(e) {
3731
3736
  function Vi(e) {
3732
3737
  switch (e) {
3733
3738
  case "image":
3734
- return Ce.Image;
3739
+ return ke.Image;
3735
3740
  case "video":
3736
- return Ce.Video;
3741
+ return ke.Video;
3737
3742
  case "audio":
3738
- return Ce.Audio;
3743
+ return ke.Audio;
3739
3744
  case "pdf":
3740
- return Ce.Pdf;
3745
+ return ke.Pdf;
3741
3746
  default:
3742
- return Ce.File;
3747
+ return ke.File;
3743
3748
  }
3744
3749
  }
3745
3750
  function Gi(e, t) {
@@ -3843,24 +3848,24 @@ const Wi = ({
3843
3848
  renderText: a
3844
3849
  }) => {
3845
3850
  var v;
3846
- const r = Xn(s.attachments);
3851
+ const r = qn(s.attachments);
3847
3852
  if (r.length === 0) return null;
3848
3853
  const i = ji(r), o = (v = s.text) == null ? void 0 : v.trim(), l = r.find((x) => x.type === "link"), d = (l == null ? void 0 : l.type) === "link" ? nn(l.attachments[0] ?? {}).url : void 0, u = o && Bi(o, d) ? void 0 : o;
3849
3854
  let h = 0;
3850
- const m = [], g = u ? "middle" : e, c = e === "single" || e === "end", p = (x, b, y) => {
3851
- const _ = t ? it.Sent : it.Received;
3855
+ const m = [], g = u ? "middle" : e, c = e === "single" || e === "end", p = (x, b, N) => {
3856
+ const _ = t ? rt.Sent : rt.Received;
3852
3857
  m.push(
3853
3858
  /* @__PURE__ */ n(
3854
3859
  _,
3855
3860
  {
3856
3861
  ...nn(x),
3857
- groupPosition: y ? g : "middle"
3862
+ groupPosition: N ? g : "middle"
3858
3863
  },
3859
3864
  b
3860
3865
  )
3861
3866
  );
3862
3867
  }, w = (x, b) => {
3863
- const y = Hi(
3868
+ const N = Hi(
3864
3869
  h,
3865
3870
  i,
3866
3871
  e
@@ -3869,7 +3874,7 @@ const Wi = ({
3869
3874
  /* @__PURE__ */ n(
3870
3875
  Yi,
3871
3876
  {
3872
- groupPosition: y,
3877
+ groupPosition: N,
3873
3878
  isMyMessage: t,
3874
3879
  segment: x
3875
3880
  },
@@ -3878,13 +3883,13 @@ const Wi = ({
3878
3883
  );
3879
3884
  };
3880
3885
  return r.forEach((x, b) => {
3881
- const y = b === r.length - 1;
3886
+ const N = b === r.length - 1;
3882
3887
  if (x.type === "link") {
3883
3888
  x.attachments.forEach((_, T) => {
3884
3889
  p(
3885
3890
  _,
3886
3891
  `link-${b}-${T}`,
3887
- y && T === x.attachments.length - 1
3892
+ N && T === x.attachments.length - 1
3888
3893
  );
3889
3894
  });
3890
3895
  return;
@@ -3904,7 +3909,7 @@ const Wi = ({
3904
3909
  },
3905
3910
  children: [
3906
3911
  m,
3907
- !u && /* @__PURE__ */ n(st, {})
3912
+ !u && /* @__PURE__ */ n(nt, {})
3908
3913
  ]
3909
3914
  }
3910
3915
  ),
@@ -3915,9 +3920,9 @@ const Wi = ({
3915
3920
  "relative isolate": c
3916
3921
  }),
3917
3922
  children: [
3918
- /* @__PURE__ */ n(Fe, { message: s, renderText: a }),
3919
- /* @__PURE__ */ n(st, {}),
3920
- c && /* @__PURE__ */ n(Be, { side: t ? "me" : "other" })
3923
+ /* @__PURE__ */ n(ze, { message: s, renderText: a }),
3924
+ /* @__PURE__ */ n(nt, {}),
3925
+ c && /* @__PURE__ */ n($e, { side: t ? "me" : "other" })
3921
3926
  ]
3922
3927
  }
3923
3928
  ) : null
@@ -3943,67 +3948,67 @@ const Wi = ({
3943
3948
  viewerLanguage: v,
3944
3949
  onOutboundClick: x,
3945
3950
  resolvedOutbound: b
3946
- } = e, { client: y } = Ve("CustomMessage"), { channel: _ } = _e("CustomMessage"), { isUnlocking: T, onUnlockClick: R, onFetchSource: L, onDownloadClick: $ } = sr("LockedAttachment"), [F, M] = B(!1), E = ms(c.id), {
3947
- Attachment: D = hs,
3948
- EditMessageModal: I = fs,
3951
+ } = e, { client: N } = He("CustomMessage"), { channel: _ } = we("CustomMessage"), { isUnlocking: T, onUnlockClick: L, onFetchSource: E, onDownloadClick: $ } = sr("LockedAttachment"), [F, R] = B(!1), I = hs(c.id), {
3952
+ Attachment: D = fs,
3953
+ EditMessageModal: S = gs,
3949
3954
  MessageActions: C,
3950
- MessageBlocked: S = gs,
3951
- MessageBouncePrompt: P = ps,
3952
- MessageDeleted: U = bs,
3953
- MessageIsThreadReplyInChannelButtonIndicator: j = vs,
3954
- MessageRepliesCountButton: ee = xs,
3955
- ReminderNotification: J = ws,
3956
- StreamedMessageText: G = _s,
3957
- PinIndicator: N
3958
- } = dn("CustomMessage"), A = ys(c), Y = Ns(c), q = ie(
3955
+ MessageBlocked: A = ps,
3956
+ MessageBouncePrompt: P = bs,
3957
+ MessageDeleted: U = vs,
3958
+ MessageIsThreadReplyInChannelButtonIndicator: V = xs,
3959
+ MessageRepliesCountButton: te = ws,
3960
+ ReminderNotification: Z = _s,
3961
+ StreamedMessageText: G = ys,
3962
+ PinIndicator: y
3963
+ } = dn("CustomMessage"), M = Ns(c), W = ks(c), Q = le(
3959
3964
  () => m == null ? void 0 : m(c),
3960
3965
  [m, c]
3961
- ), H = ie(() => {
3962
- const he = c.attachments ?? [], be = c.shared_location ? [c.shared_location, ...he] : he;
3963
- if (!$e(c)) return be;
3964
- const Ut = be.filter((jt) => !("type" in jt) || !Sn(jt));
3965
- return Ut.length === be.length ? be : Ut;
3966
- }, [c]), te = ie(
3967
- () => Xn(H),
3968
- [H]
3969
- ), W = ie(() => {
3970
- const he = _n({ message: c, viewerLanguage: v });
3966
+ ), j = le(() => {
3967
+ const he = c.attachments ?? [], pe = c.shared_location ? [c.shared_location, ...he] : he;
3968
+ if (!Fe(c)) return pe;
3969
+ const Ut = pe.filter((jt) => !("type" in jt) || !En(jt));
3970
+ return Ut.length === pe.length ? pe : Ut;
3971
+ }, [c]), J = le(
3972
+ () => qn(j),
3973
+ [j]
3974
+ ), X = le(() => {
3975
+ const he = yn({ message: c, viewerLanguage: v });
3971
3976
  return he === c.text ? c : { ...c, text: he };
3972
- }, [c, v]), ne = te.length > 0, de = te.reduce(
3973
- (he, be) => he + be.attachments.length,
3977
+ }, [c, v]), ne = J.length > 0, ue = J.reduce(
3978
+ (he, pe) => he + pe.attachments.length,
3974
3979
  0
3975
- ) === ((H == null ? void 0 : H.length) ?? 0), ge = (i == null ? void 0 : i[0]) ?? "", Oe = ge === "top" ? "first" : ge === "middle" ? "middle" : ge === "bottom" ? "end" : "single", ue = ge === "single" || ge === "bottom";
3976
- if (ks(c))
3980
+ ) === ((j == null ? void 0 : j.length) ?? 0), ae = (i == null ? void 0 : i[0]) ?? "", De = ae === "top" ? "first" : ae === "middle" ? "middle" : ae === "bottom" ? "end" : "single", se = ae === "single" || ae === "bottom";
3981
+ if (Cs(c))
3977
3982
  return null;
3978
3983
  if (c.deleted_at || c.type === "deleted")
3979
3984
  return /* @__PURE__ */ n(U, { message: c });
3980
- if (Cs(c))
3981
- return /* @__PURE__ */ n(S, {});
3982
- const se = !w && !!c.reply_count, me = !w && c.show_in_channel && c.parent_id, re = c.status === "failed" && ((Rt = c.error) == null ? void 0 : Rt.status) !== 403, St = Ss(c);
3983
- let pe;
3984
- re ? pe = () => u(c) : St && (pe = () => M(!0));
3985
- const Q = g(), ts = k(
3985
+ if (Ss(c))
3986
+ return /* @__PURE__ */ n(A, {});
3987
+ const me = !w && !!c.reply_count, ie = !w && c.show_in_channel && c.parent_id, Ct = c.status === "failed" && ((Rt = c.error) == null ? void 0 : Rt.status) !== 403, St = Es(c);
3988
+ let ge;
3989
+ Ct ? ge = () => u(c) : St && (ge = () => R(!0));
3990
+ const ee = g(), ns = k(
3986
3991
  "str-chat__message str-chat__message-simple",
3987
3992
  `str-chat__message--${c.type}`,
3988
3993
  `str-chat__message--${c.status}`,
3989
- Q ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
3994
+ ee ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
3990
3995
  c.text ? "str-chat__message--has-text" : "has-no-text",
3991
3996
  {
3992
- "str-chat__message--has-attachment": A,
3997
+ "str-chat__message--has-attachment": M,
3993
3998
  "str-chat__message--highlighted": h,
3994
3999
  "str-chat__message--pinned pinned-message": c.pinned,
3995
- "str-chat__message--with-reactions": Y,
4000
+ "str-chat__message--with-reactions": W,
3996
4001
  "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((Lt = c == null ? void 0 : c.error) == null ? void 0 : Lt.status) !== 403,
3997
- "str-chat__message-with-thread-link": se || me,
4002
+ "str-chat__message-with-thread-link": me || ie,
3998
4003
  "str-chat__virtual-message__wrapper--end": a,
3999
4004
  "str-chat__virtual-message__wrapper--first": r,
4000
4005
  "str-chat__virtual-message__wrapper--group": o
4001
4006
  }
4002
- ), Ye = c.poll_id && y.polls.fromState(c.poll_id), Et = ur(c), Ne = $e(c), ns = ht(c), We = !!(H != null && H.length && !c.quoted_message), It = Ne && Q && We, ss = ne && de && !c.quoted_message && !Ye && !q && !Ne, Tt = {
4007
+ ), Ge = c.poll_id && N.polls.fromState(c.poll_id), Et = ur(c), ye = Fe(c), ss = mt(c), Ye = !!(j != null && j.length && !c.quoted_message), It = ye && ee && Ye, as = ne && ue && !c.quoted_message && !Ge && !Q && !ye, Tt = {
4003
4008
  contentType: "text",
4004
4009
  amountText: (Mt = c.metadata) == null ? void 0 : Mt.amount_text,
4005
4010
  paymentStatus: (Dt = c.metadata) == null ? void 0 : Dt.payment_status,
4006
- renderedText: c.text && /* @__PURE__ */ n(Fe, { message: W, renderText: p })
4011
+ renderedText: c.text && /* @__PURE__ */ n(ze, { message: X, renderText: p })
4007
4012
  }, At = {
4008
4013
  contentType: "media",
4009
4014
  title: (Ot = c.metadata) == null ? void 0 : Ot.attachment_title,
@@ -4012,34 +4017,34 @@ const Wi = ({
4012
4017
  amountText: (Ft = c.metadata) == null ? void 0 : Ft.amount_text,
4013
4018
  detail: ($t = c.metadata) == null ? void 0 : $t.attachment_detail,
4014
4019
  paymentStatus: (Bt = c.metadata) == null ? void 0 : Bt.payment_status,
4015
- onFetchSource: L ? () => L(c, _) : void 0
4020
+ onFetchSource: E ? () => E(c, _) : void 0
4016
4021
  };
4017
- return /* @__PURE__ */ f(Z, { children: [
4022
+ return /* @__PURE__ */ f(K, { children: [
4018
4023
  s && /* @__PURE__ */ n(
4019
- I,
4024
+ S,
4020
4025
  {
4021
4026
  additionalMessageInputProps: t
4022
4027
  }
4023
4028
  ),
4024
4029
  F && /* @__PURE__ */ n(
4025
- Es,
4030
+ Is,
4026
4031
  {
4027
4032
  MessageBouncePrompt: P,
4028
- onClose: () => M(!1),
4033
+ onClose: () => R(!1),
4029
4034
  open: F
4030
4035
  }
4031
4036
  ),
4032
4037
  /* @__PURE__ */ f(
4033
4038
  "div",
4034
4039
  {
4035
- className: ts,
4040
+ className: ns,
4036
4041
  "data-message-id": c.id,
4037
4042
  "data-dd-privacy": "mask",
4038
4043
  children: [
4039
- N && /* @__PURE__ */ n(N, {}),
4040
- !!E && /* @__PURE__ */ n(J, { reminder: E }),
4044
+ y && /* @__PURE__ */ n(y, {}),
4045
+ !!I && /* @__PURE__ */ n(Z, { reminder: I }),
4041
4046
  c.user && /* @__PURE__ */ n(
4042
- ye,
4047
+ _e,
4043
4048
  {
4044
4049
  className: "str-chat__avatar str-chat__message-sender-avatar",
4045
4050
  id: c.user.id,
@@ -4047,86 +4052,86 @@ const Wi = ({
4047
4052
  name: c.user.name || c.user.id,
4048
4053
  size: 24,
4049
4054
  shape: "circle",
4050
- dmAgentEnabled: Ne
4055
+ dmAgentEnabled: ye
4051
4056
  }
4052
4057
  ),
4053
4058
  /* @__PURE__ */ n(
4054
4059
  "div",
4055
4060
  {
4056
4061
  className: k("str-chat__message-inner", {
4057
- "str-chat__simple-message--error-failed": re || St
4062
+ "str-chat__simple-message--error-failed": Ct || St
4058
4063
  }),
4059
4064
  "data-testid": "message-inner",
4060
- onClick: pe,
4061
- onKeyDown: pe,
4062
- role: pe ? "button" : void 0,
4063
- tabIndex: pe ? 0 : void 0,
4065
+ onClick: ge,
4066
+ onKeyDown: ge,
4067
+ role: ge ? "button" : void 0,
4068
+ tabIndex: ge ? 0 : void 0,
4064
4069
  style: {
4065
4070
  // Force margins to 0 to prevent hover layout shift
4066
4071
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
4067
4072
  marginInlineEnd: 0,
4068
4073
  marginInlineStart: 0
4069
4074
  },
4070
- children: Et ? /* @__PURE__ */ n(Ze, { message: c, standalone: !0 }) : cr(c) ? /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
4071
- Q && C && /* @__PURE__ */ n(C, {}),
4072
- Q ? /* @__PURE__ */ n(ze, { ...Tt, isMine: !0 }) : /* @__PURE__ */ n(
4073
- ze,
4075
+ children: Et ? /* @__PURE__ */ n(Ke, { message: c, standalone: !0 }) : cr(c) ? /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
4076
+ ee && C && /* @__PURE__ */ n(C, {}),
4077
+ ee ? /* @__PURE__ */ n(Pe, { ...Tt, isMine: !0 }) : /* @__PURE__ */ n(
4078
+ Pe,
4074
4079
  {
4075
4080
  ...Tt,
4076
4081
  isMine: !1,
4077
4082
  isUnlocking: T(c.id),
4078
- onUnlockClick: () => R == null ? void 0 : R(c, _)
4083
+ onUnlockClick: () => L == null ? void 0 : L(c, _)
4079
4084
  }
4080
4085
  ),
4081
- !Q && C && /* @__PURE__ */ n(C, {})
4086
+ !ee && C && /* @__PURE__ */ n(C, {})
4082
4087
  ] }) }) : dr(c) ? /* @__PURE__ */ f("div", { className: "str-chat__message-bubble-wrapper", children: [
4083
4088
  /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
4084
- Q && C && /* @__PURE__ */ n(C, {}),
4085
- Q ? /* @__PURE__ */ n(
4086
- ze,
4089
+ ee && C && /* @__PURE__ */ n(C, {}),
4090
+ ee ? /* @__PURE__ */ n(
4091
+ Pe,
4087
4092
  {
4088
4093
  ...At,
4089
4094
  isMine: !0,
4090
- onPreviewClick: () => R ? R(c, _) : void 0
4095
+ onPreviewClick: () => L ? L(c, _) : void 0
4091
4096
  }
4092
4097
  ) : /* @__PURE__ */ n(
4093
- ze,
4098
+ Pe,
4094
4099
  {
4095
4100
  ...At,
4096
4101
  isMine: !1,
4097
4102
  isUnlocking: T(c.id),
4098
- onUnlockClick: () => R ? R(c, _) : void 0,
4103
+ onUnlockClick: () => L ? L(c, _) : void 0,
4099
4104
  onDownloadClick: () => $ ? $(c, _) : void 0
4100
4105
  }
4101
4106
  ),
4102
- !Q && C && /* @__PURE__ */ n(C, {})
4107
+ !ee && C && /* @__PURE__ */ n(C, {})
4103
4108
  ] }),
4104
4109
  c.text && /* @__PURE__ */ f(
4105
4110
  "div",
4106
4111
  {
4107
4112
  className: k("str-chat__message-bubble", {
4108
- "relative isolate": ue
4113
+ "relative isolate": se
4109
4114
  }),
4110
4115
  children: [
4111
4116
  /* @__PURE__ */ n(
4112
- Fe,
4117
+ ze,
4113
4118
  {
4114
- message: W,
4119
+ message: X,
4115
4120
  renderText: p
4116
4121
  }
4117
4122
  ),
4118
- ue && /* @__PURE__ */ n(Be, { side: Q ? "me" : "other" })
4123
+ se && /* @__PURE__ */ n($e, { side: ee ? "me" : "other" })
4119
4124
  ]
4120
4125
  }
4121
4126
  )
4122
- ] }) : ss ? /* @__PURE__ */ n(
4127
+ ] }) : as ? /* @__PURE__ */ n(
4123
4128
  Wi,
4124
4129
  {
4125
- groupPosition: Oe,
4126
- isMyMessage: Q,
4130
+ groupPosition: De,
4131
+ isMyMessage: ee,
4127
4132
  message: {
4128
- ...W,
4129
- attachments: H,
4133
+ ...X,
4134
+ attachments: j,
4130
4135
  // MessageText prefers message.i18n[userLanguage_text] from
4131
4136
  // Stream's TranslationContext over message.text. Drop i18n so
4132
4137
  // the caption uses displayMessage.text from viewerLanguage.
@@ -4138,51 +4143,51 @@ const Wi = ({
4138
4143
  "div",
4139
4144
  {
4140
4145
  className: k("str-chat__message-bubble", {
4141
- "relative isolate": ue
4146
+ "relative isolate": se
4142
4147
  }),
4143
4148
  children: [
4144
- Ne && !It && /* @__PURE__ */ n(
4145
- Ze,
4149
+ ye && !It && /* @__PURE__ */ n(
4150
+ Ke,
4146
4151
  {
4147
4152
  message: c,
4148
- hasAttachment: We,
4149
- isMyMessage: Q
4153
+ hasAttachment: Ye,
4154
+ isMyMessage: ee
4150
4155
  }
4151
4156
  ),
4152
- Ye && /* @__PURE__ */ n(Is, { poll: Ye }),
4153
- H != null && H.length && !c.quoted_message ? /* @__PURE__ */ n(
4157
+ Ge && /* @__PURE__ */ n(Ts, { poll: Ge }),
4158
+ j != null && j.length && !c.quoted_message ? /* @__PURE__ */ n(
4154
4159
  D,
4155
4160
  {
4156
4161
  actionHandler: l,
4157
- attachments: H
4162
+ attachments: j
4158
4163
  }
4159
4164
  ) : null,
4160
- q ? /* @__PURE__ */ n(
4165
+ Q ? /* @__PURE__ */ n(
4161
4166
  G,
4162
4167
  {
4163
- message: W,
4168
+ message: X,
4164
4169
  renderText: p
4165
4170
  }
4166
4171
  ) : /* @__PURE__ */ n(
4167
- Fe,
4172
+ ze,
4168
4173
  {
4169
- message: W,
4174
+ message: X,
4170
4175
  renderText: p
4171
4176
  }
4172
4177
  ),
4173
- /* @__PURE__ */ n(st, {}),
4174
- ue && /* @__PURE__ */ n(Be, { side: Q ? "me" : "other" })
4178
+ /* @__PURE__ */ n(nt, {}),
4179
+ se && /* @__PURE__ */ n($e, { side: ee ? "me" : "other" })
4175
4180
  ]
4176
4181
  }
4177
4182
  ) })
4178
4183
  }
4179
4184
  ),
4180
- !ns && !Et && /* @__PURE__ */ n("div", { className: "str-chat__message-footer", children: (!Ne || It) && /* @__PURE__ */ n(
4181
- Ze,
4185
+ !ss && !Et && /* @__PURE__ */ n("div", { className: "str-chat__message-footer", children: (!ye || It) && /* @__PURE__ */ n(
4186
+ Ke,
4182
4187
  {
4183
4188
  message: c,
4184
- hasAttachment: We,
4185
- isMyMessage: Q
4189
+ hasAttachment: Ye,
4190
+ isMyMessage: ee
4186
4191
  }
4187
4192
  ) }),
4188
4193
  /* @__PURE__ */ n(
@@ -4192,14 +4197,14 @@ const Wi = ({
4192
4197
  resolvedOutbound: b
4193
4198
  }
4194
4199
  ),
4195
- se && /* @__PURE__ */ n(
4196
- ee,
4200
+ me && /* @__PURE__ */ n(
4201
+ te,
4197
4202
  {
4198
4203
  onClick: d,
4199
4204
  reply_count: c.reply_count
4200
4205
  }
4201
4206
  ),
4202
- me && /* @__PURE__ */ n(j, {})
4207
+ ie && /* @__PURE__ */ n(V, {})
4203
4208
  ]
4204
4209
  },
4205
4210
  c.id
@@ -4209,11 +4214,11 @@ const Wi = ({
4209
4214
  Xi,
4210
4215
  (e, t) => {
4211
4216
  var s, a, r, i;
4212
- return e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || ((s = e.resolvedOutbound) == null ? void 0 : s.id) !== ((a = t.resolvedOutbound) == null ? void 0 : a.id) || ((r = e.resolvedOutbound) == null ? void 0 : r.name) !== ((i = t.resolvedOutbound) == null ? void 0 : i.name) ? !1 : us(e, t);
4217
+ return e.viewerLanguage !== t.viewerLanguage || e.onOutboundClick !== t.onOutboundClick || ((s = e.resolvedOutbound) == null ? void 0 : s.id) !== ((a = t.resolvedOutbound) == null ? void 0 : a.id) || ((r = e.resolvedOutbound) == null ? void 0 : r.name) !== ((i = t.resolvedOutbound) == null ? void 0 : i.name) ? !1 : ms(e, t);
4213
4218
  }
4214
4219
  ), Ki = (e) => {
4215
4220
  var i;
4216
- const t = fe("CustomMessage"), s = we(Ln), a = (i = t.message.metadata) == null ? void 0 : i.outbound_id, r = typeof a == "string" ? s == null ? void 0 : s[a] : void 0;
4221
+ const t = fe("CustomMessage"), s = xe(Mn), a = (i = t.message.metadata) == null ? void 0 : i.outbound_id, r = typeof a == "string" ? s == null ? void 0 : s[a] : void 0;
4217
4222
  return /* @__PURE__ */ n(
4218
4223
  qi,
4219
4224
  {
@@ -4226,31 +4231,31 @@ const Wi = ({
4226
4231
  var s;
4227
4232
  const { handleDelete: e, message: t } = fe("CustomMessageActions");
4228
4233
  return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
4229
- gn,
4234
+ pn,
4230
4235
  {
4231
4236
  onClick: e,
4232
4237
  "aria-label": "Delete",
4233
4238
  title: "Delete",
4234
4239
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
4235
- children: /* @__PURE__ */ n(ua, { size: 16, weight: "light", "aria-hidden": !0 })
4240
+ children: /* @__PURE__ */ n(pa, { size: 16, weight: "light", "aria-hidden": !0 })
4236
4241
  }
4237
4242
  );
4238
4243
  }, Ji = () => {
4239
4244
  const { handleFlag: e } = fe("CustomMessageActions");
4240
4245
  return /* @__PURE__ */ n(
4241
- gn,
4246
+ pn,
4242
4247
  {
4243
4248
  onClick: e,
4244
4249
  "aria-label": "Report",
4245
4250
  title: "Report",
4246
4251
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
4247
- children: /* @__PURE__ */ n(un, { size: 16, weight: "light", "aria-hidden": !0 })
4252
+ children: /* @__PURE__ */ n(mn, { size: 16, weight: "light", "aria-hidden": !0 })
4248
4253
  }
4249
4254
  );
4250
4255
  }, Qi = () => {
4251
4256
  var t;
4252
4257
  const { message: e } = fe("CustomMessageActions");
4253
- return ((t = e.metadata) == null ? void 0 : t.custom_type) !== le.ATTACHMENT ? null : /* @__PURE__ */ n(
4258
+ return ((t = e.metadata) == null ? void 0 : t.custom_type) !== oe.ATTACHMENT ? null : /* @__PURE__ */ n(
4254
4259
  wa,
4255
4260
  {
4256
4261
  messageActionSet: [
@@ -4261,10 +4266,10 @@ const Wi = ({
4261
4266
  );
4262
4267
  }, el = (e) => ({
4263
4268
  linkPreviews: Array.from(e.previews.values()).filter(
4264
- (t) => nt.previewIsLoaded(t) || nt.previewIsLoading(t)
4269
+ (t) => tt.previewIsLoaded(t) || tt.previewIsLoading(t)
4265
4270
  )
4266
4271
  }), tl = () => {
4267
- const { linkPreviewsManager: e } = Ts(), { linkPreviews: t } = As(
4272
+ const { linkPreviewsManager: e } = As(), { linkPreviews: t } = Rs(
4268
4273
  e.state,
4269
4274
  el
4270
4275
  ), s = (r) => {
@@ -4315,9 +4320,9 @@ const Wi = ({
4315
4320
  // edge lands ~6px past the fold, reachable by scrolling. That residue
4316
4321
  // belongs to whoever owns the mobile layout contract, not to this component.
4317
4322
  /* @__PURE__ */ n("div", { className: "messaging-link-preview-list flex flex-col items-stretch w-full gap-2", children: t.map((r) => {
4318
- const i = nt.previewIsLoading(r);
4323
+ const i = tt.previewIsLoading(r);
4319
4324
  return /* @__PURE__ */ n(
4320
- it.Composer,
4325
+ rt.Composer,
4321
4326
  {
4322
4327
  title: r.title,
4323
4328
  url: r.og_scrape_url,
@@ -4330,7 +4335,7 @@ const Wi = ({
4330
4335
  );
4331
4336
  }) })
4332
4337
  ) : null;
4333
- }, Ue = z.createContext(!1), nl = 200, ao = () => we(Ue), sl = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
4338
+ }, Be = z.createContext(!1), nl = 200, ao = () => xe(Be), sl = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
4334
4339
  "button",
4335
4340
  {
4336
4341
  ...s,
@@ -4339,12 +4344,12 @@ const Wi = ({
4339
4344
  disabled: t,
4340
4345
  onPointerDown: (a) => a.preventDefault(),
4341
4346
  onClick: e,
4342
- children: /* @__PURE__ */ n(ma, { weight: "bold", className: "size-4" })
4347
+ children: /* @__PURE__ */ n(ba, { weight: "bold", className: "size-4" })
4343
4348
  }
4344
4349
  ), an = () => {
4345
- const e = we(Ue), { handleSubmit: t } = Rs(), s = Ls(), a = e || !s, {
4350
+ const e = xe(Be), { handleSubmit: t } = Ls(), s = Ms(), a = e || !s, {
4346
4351
  SendButton: r = sl,
4347
- AttachmentPreviewList: i = Ms
4352
+ AttachmentPreviewList: i = Ds
4348
4353
  } = dn("CustomMessageInput"), o = z.useRef(null);
4349
4354
  return z.useEffect(() => {
4350
4355
  const l = o.current;
@@ -4408,13 +4413,13 @@ const Wi = ({
4408
4413
  "data-dd-privacy": "mask",
4409
4414
  children: [
4410
4415
  /* @__PURE__ */ f("div", { className: "messaging-composer-previews empty:hidden flex flex-col gap-2 px-2 pt-2", children: [
4411
- /* @__PURE__ */ n(Ds, {}),
4416
+ /* @__PURE__ */ n(Os, {}),
4412
4417
  /* @__PURE__ */ n(tl, {}),
4413
4418
  /* @__PURE__ */ n(i, {})
4414
4419
  ] }),
4415
4420
  /* @__PURE__ */ f("div", { className: "messaging-composer-row flex items-start", children: [
4416
4421
  /* @__PURE__ */ n(
4417
- Os,
4422
+ Ps,
4418
4423
  {
4419
4424
  "aria-disabled": e || void 0,
4420
4425
  containerClassName: "min-w-0 flex-1 leading-[0]",
@@ -4450,7 +4455,7 @@ const Wi = ({
4450
4455
  composerInput: i
4451
4456
  }) => {
4452
4457
  var h;
4453
- const { channel: o } = _e(), l = ((h = o == null ? void 0 : o.data) == null ? void 0 : h.frozen) === !0, d = !!i, u = z.useRef(null);
4458
+ const { channel: o } = we(), l = ((h = o == null ? void 0 : o.data) == null ? void 0 : h.frozen) === !0, d = !!i, u = z.useRef(null);
4454
4459
  return z.useEffect(() => {
4455
4460
  if (!d)
4456
4461
  return;
@@ -4463,11 +4468,11 @@ const Wi = ({
4463
4468
  c = v;
4464
4469
  const b = Array.from(
4465
4470
  g.querySelectorAll(".str-chat__list")
4466
- ).find((_) => _.scrollHeight > _.clientHeight) ?? null, y = b ? b.scrollHeight - b.scrollTop - b.clientHeight < nl : !1;
4471
+ ).find((_) => _.scrollHeight > _.clientHeight) ?? null, N = b ? b.scrollHeight - b.scrollTop - b.clientHeight < nl : !1;
4467
4472
  g.style.setProperty(
4468
4473
  "--messaging-composer-height",
4469
4474
  `${v}px`
4470
- ), x && y && b && (b.scrollTop = b.scrollHeight);
4475
+ ), x && N && b && (b.scrollTop = b.scrollHeight);
4471
4476
  };
4472
4477
  if (p(), typeof ResizeObserver > "u")
4473
4478
  return;
@@ -4496,7 +4501,7 @@ const Wi = ({
4496
4501
  ] })
4497
4502
  ]
4498
4503
  }
4499
- ) : /* @__PURE__ */ f(Z, { children: [
4504
+ ) : /* @__PURE__ */ f(K, { children: [
4500
4505
  t == null ? void 0 : t(),
4501
4506
  /* @__PURE__ */ n("div", { className: "messaging-composer-locked-panel flex w-full flex-col items-center justify-center gap-3 px-6 py-4", children: r ? /* @__PURE__ */ n("p", { className: "max-w-[345px] text-center text-xs font-normal leading-[1.3] tracking-[0.12px] text-black/40", children: r }) : null }),
4502
4507
  s == null ? void 0 : s()
@@ -4525,7 +4530,7 @@ const Wi = ({
4525
4530
  className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
4526
4531
  children: [
4527
4532
  e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
4528
- /* @__PURE__ */ n(Ue.Provider, { value: l, children: /* @__PURE__ */ n(Ht, { Input: i ?? an }) })
4533
+ /* @__PURE__ */ n(Be.Provider, { value: l, children: /* @__PURE__ */ n(Ht, { Input: i ?? an }) })
4529
4534
  ]
4530
4535
  }
4531
4536
  ),
@@ -4544,7 +4549,7 @@ const Wi = ({
4544
4549
  className: "message-input flex min-h-0 items-end gap-4 aria-disabled:opacity-40",
4545
4550
  children: [
4546
4551
  e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
4547
- /* @__PURE__ */ n(Ue.Provider, { value: l, children: /* @__PURE__ */ n(Ht, { Input: an }) })
4552
+ /* @__PURE__ */ n(Be.Provider, { value: l, children: /* @__PURE__ */ n(Ht, { Input: an }) })
4548
4553
  ]
4549
4554
  }
4550
4555
  ),
@@ -4555,7 +4560,7 @@ const Wi = ({
4555
4560
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
4556
4561
  }, rl = ["SYSTEM_AGE_SAFETY_BLOCKED"], il = {
4557
4562
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
4558
- }, et = "age safety guidelines.", ll = "https://linktr.ee/s/about/contact", ol = (e) => rl.includes(
4563
+ }, Qe = "age safety guidelines.", ll = "https://linktr.ee/s/about/contact", ol = (e) => rl.includes(
4559
4564
  e
4560
4565
  ), cl = (e) => {
4561
4566
  var t;
@@ -4563,28 +4568,28 @@ const Wi = ({
4563
4568
  }, dl = (e) => {
4564
4569
  var a;
4565
4570
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
4566
- if (Yt(t))
4571
+ if (Gt(t))
4567
4572
  return {
4568
4573
  kind: "dm-agent",
4569
4574
  type: t
4570
4575
  };
4571
- if (ba(t))
4576
+ if (Gs(t))
4572
4577
  return {
4573
4578
  kind: "age-safety",
4574
4579
  type: t
4575
4580
  };
4576
4581
  const s = e.dm_agent_system_type;
4577
- if (Yt(s))
4582
+ if (Gt(s))
4578
4583
  return {
4579
4584
  kind: "dm-agent",
4580
4585
  type: s
4581
4586
  };
4582
4587
  }, ul = (e) => {
4583
- const t = e.indexOf(et);
4588
+ const t = e.indexOf(Qe);
4584
4589
  if (t === -1)
4585
4590
  return e;
4586
- const s = t + et.length;
4587
- return /* @__PURE__ */ f(Z, { children: [
4591
+ const s = t + Qe.length;
4592
+ return /* @__PURE__ */ f(K, { children: [
4588
4593
  e.slice(0, t),
4589
4594
  /* @__PURE__ */ n(
4590
4595
  "a",
@@ -4593,7 +4598,7 @@ const Wi = ({
4593
4598
  target: "_blank",
4594
4599
  rel: "noopener noreferrer",
4595
4600
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
4596
- children: et
4601
+ children: Qe
4597
4602
  }
4598
4603
  ),
4599
4604
  e.slice(s)
@@ -4614,7 +4619,7 @@ const Wi = ({
4614
4619
  "data-dm-agent-system-type": s.type,
4615
4620
  children: [
4616
4621
  /* @__PURE__ */ n(
4617
- ha,
4622
+ va,
4618
4623
  {
4619
4624
  size: 16,
4620
4625
  weight: "regular",
@@ -4626,7 +4631,7 @@ const Wi = ({
4626
4631
  ]
4627
4632
  }
4628
4633
  ),
4629
- !t && /* @__PURE__ */ n(Xe, { message: e.message })
4634
+ !t && /* @__PURE__ */ n(We, { message: e.message })
4630
4635
  ] });
4631
4636
  }
4632
4637
  if ((s == null ? void 0 : s.kind) === "age-safety") {
@@ -4640,7 +4645,7 @@ const Wi = ({
4640
4645
  "data-age-safety-system-type": s.type,
4641
4646
  children: [
4642
4647
  /* @__PURE__ */ n(
4643
- fa,
4648
+ xa,
4644
4649
  {
4645
4650
  size: 24,
4646
4651
  weight: "duotone",
@@ -4653,7 +4658,7 @@ const Wi = ({
4653
4658
  ]
4654
4659
  }
4655
4660
  ),
4656
- !t && /* @__PURE__ */ n(Xe, { message: e.message })
4661
+ !t && /* @__PURE__ */ n(We, { message: e.message })
4657
4662
  ] });
4658
4663
  }
4659
4664
  return /* @__PURE__ */ f("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -4662,9 +4667,9 @@ const Wi = ({
4662
4667
  /* @__PURE__ */ n("p", { children: e.message.text }),
4663
4668
  /* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
4664
4669
  ] }),
4665
- !t && /* @__PURE__ */ n(Xe, { message: e.message })
4670
+ !t && /* @__PURE__ */ n(We, { message: e.message })
4666
4671
  ] });
4667
- }, qn = He(!1), tt = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
4672
+ }, Kn = je(!1), et = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
4668
4673
  "animateTransform",
4669
4674
  {
4670
4675
  attributeName: "transform",
@@ -4675,12 +4680,12 @@ const Wi = ({
4675
4680
  repeatCount: "indefinite"
4676
4681
  }
4677
4682
  ) }), hl = /* @__PURE__ */ new Set([
4678
- qe.Thinking,
4679
- qe.Generating,
4680
- qe.ExternalSources
4683
+ Xe.Thinking,
4684
+ Xe.Generating,
4685
+ Xe.ExternalSources
4681
4686
  ]), fl = ({ threadList: e }) => {
4682
4687
  var p, w;
4683
- const { channel: t, channelConfig: s, thread: a } = _e(), { client: r } = Ve(), { typing: i = {} } = Ps(), { aiState: o } = zs(t), l = we(qn);
4688
+ const { channel: t, channelConfig: s, thread: a } = we(), { client: r } = He(), { typing: i = {} } = zs(), { aiState: o } = Fs(t), l = xe(Kn);
4684
4689
  if (!e && l && hl.has(o)) {
4685
4690
  const v = gl(t, (p = r.user) == null ? void 0 : p.id);
4686
4691
  return /* @__PURE__ */ n(
@@ -4733,7 +4738,7 @@ const Wi = ({
4733
4738
  },
4734
4739
  children: /* @__PURE__ */ f("div", { className: "str-chat__message str-chat__message-simple str-chat__message--regular str-chat__message--received str-chat__message--other str-chat__message--has-text", children: [
4735
4740
  /* @__PURE__ */ n(
4736
- ye,
4741
+ _e,
4737
4742
  {
4738
4743
  className: "str-chat__avatar str-chat__message-sender-avatar",
4739
4744
  id: e,
@@ -4754,13 +4759,13 @@ const Wi = ({
4754
4759
  height: "13",
4755
4760
  overflow: "visible",
4756
4761
  children: [
4757
- /* @__PURE__ */ n(tt, { cx: "4", index: 0 }),
4758
- /* @__PURE__ */ n(tt, { cx: "16", index: 1 }),
4759
- /* @__PURE__ */ n(tt, { cx: "28", index: 2 })
4762
+ /* @__PURE__ */ n(et, { cx: "4", index: 0 }),
4763
+ /* @__PURE__ */ n(et, { cx: "16", index: 1 }),
4764
+ /* @__PURE__ */ n(et, { cx: "28", index: 2 })
4760
4765
  ]
4761
4766
  }
4762
4767
  ) }) }),
4763
- /* @__PURE__ */ n(Be, { side: "other" })
4768
+ /* @__PURE__ */ n($e, { side: "other" })
4764
4769
  ] }) }) })
4765
4770
  ] })
4766
4771
  }
@@ -4817,11 +4822,11 @@ const pl = () => null, bl = ({ className: e, message: t }) => /* @__PURE__ */ f(
4817
4822
  t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
4818
4823
  ]
4819
4824
  }
4820
- ), je = z.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ f("div", { className: "flex items-center", children: [
4825
+ ), Ue = z.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ f("div", { className: "flex items-center", children: [
4821
4826
  /* @__PURE__ */ n(bl, { className: "w-6 h-6" }),
4822
4827
  /* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
4823
4828
  ] }) }));
4824
- je.displayName = "LoadingState";
4829
+ Ue.displayName = "LoadingState";
4825
4830
  const vl = ({
4826
4831
  onBack: e,
4827
4832
  showBackButton: t,
@@ -4842,24 +4847,24 @@ const vl = ({
4842
4847
  renderChannelBanner: v,
4843
4848
  customChannelActions: x,
4844
4849
  renderChannelActions: b,
4845
- renderMessage: y,
4850
+ renderMessage: N,
4846
4851
  viewerLanguage: _,
4847
4852
  showChannelInfo: T = !0,
4848
- onParticipantNameClick: R,
4849
- onOutboundClick: L,
4853
+ onParticipantNameClick: L,
4854
+ onOutboundClick: E,
4850
4855
  resolveOutbound: $,
4851
4856
  composerInput: F
4852
4857
  }) => {
4853
- const { channel: M, messages: E } = _e(), D = V(L);
4854
- X(() => {
4855
- D.current = L;
4856
- }, [L]);
4857
- const I = K((J) => {
4858
+ const { channel: R, messages: I } = we(), D = H(E);
4859
+ Y(() => {
4860
+ D.current = E;
4861
+ }, [E]);
4862
+ const S = q((Z) => {
4858
4863
  var G;
4859
- (G = D.current) == null || G.call(D, J);
4860
- }, []), C = L ? I : void 0, S = pr(E, $), P = M.state.messages.some(
4861
- (J) => J.type !== "deleted"
4862
- ), U = v ? /* @__PURE__ */ n(z.Fragment, { children: v() }, "lt-channel-banner") : null, j = /* @__PURE__ */ n(
4864
+ (G = D.current) == null || G.call(D, Z);
4865
+ }, []), C = E ? S : void 0, A = pr(I, $), P = R.state.messages.some(
4866
+ (Z) => Z.type !== "deleted"
4867
+ ), U = v ? /* @__PURE__ */ n(z.Fragment, { children: v() }, "lt-channel-banner") : null, V = /* @__PURE__ */ n(
4863
4868
  La,
4864
4869
  {
4865
4870
  className: "-mx-[var(--str-chat\\_\\_spacing-2)] px-[var(--str-chat\\_\\_spacing-2)] md:-mx-[min(var(--str-chat\\_\\_spacing-10),4%)] md:px-[min(var(--str-chat\\_\\_spacing-10),4%)]",
@@ -4877,46 +4882,46 @@ const vl = ({
4877
4882
  onReportParticipantClick: h,
4878
4883
  customChannelActions: x,
4879
4884
  renderChannelActions: b,
4880
- onParticipantNameClick: R
4885
+ onParticipantNameClick: L
4881
4886
  }
4882
- ), ee = K(
4883
- (J) => {
4884
- const { message: G } = fe("ChannelView"), N = /* @__PURE__ */ n(
4887
+ ), te = q(
4888
+ (Z) => {
4889
+ const { message: G } = fe("ChannelView"), y = /* @__PURE__ */ n(
4885
4890
  Ki,
4886
4891
  {
4887
- ...J,
4892
+ ...Z,
4888
4893
  viewerLanguage: _,
4889
4894
  onOutboundClick: C
4890
4895
  }
4891
4896
  );
4892
- return !y || !G ? N : y(N, G);
4897
+ return !N || !G ? y : N(y, G);
4893
4898
  },
4894
- [C, y, _]
4899
+ [C, N, _]
4895
4900
  );
4896
- return /* @__PURE__ */ n(Ln.Provider, { value: S, children: /* @__PURE__ */ n(
4897
- $s,
4901
+ return /* @__PURE__ */ n(Mn.Provider, { value: A, children: /* @__PURE__ */ n(
4902
+ Bs,
4898
4903
  {
4899
4904
  overrides: {
4900
- Message: ee,
4905
+ Message: te,
4901
4906
  MessageActions: Qi,
4902
4907
  UnreadMessagesNotification: () => null,
4903
4908
  UnreadMessagesSeparator: () => null
4904
4909
  },
4905
- children: /* @__PURE__ */ n(Bs, { children: F ? /* @__PURE__ */ f("div", { className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col", children: [
4910
+ children: /* @__PURE__ */ n(Us, { children: F ? /* @__PURE__ */ f("div", { className: "messaging-channel-layout relative flex min-h-0 flex-1 flex-col", children: [
4906
4911
  /* @__PURE__ */ f(
4907
4912
  "div",
4908
4913
  {
4909
4914
  className: "messaging-channel-message-list messaging-channel-message-list--floating relative min-h-0 flex-1 overflow-hidden",
4910
4915
  children: [
4911
4916
  !P && /* @__PURE__ */ n("div", { className: "str-chat__list", children: /* @__PURE__ */ f("div", { className: "str-chat__message-list-scroll", children: [
4912
- j,
4917
+ V,
4913
4918
  U
4914
4919
  ] }) }),
4915
4920
  /* @__PURE__ */ n(
4916
4921
  Vt,
4917
4922
  {
4918
4923
  head: P ? /* @__PURE__ */ f("div", { className: "sticky top-0 z-10", children: [
4919
- j,
4924
+ V,
4920
4925
  U
4921
4926
  ] }) : void 0,
4922
4927
  hideDeletedMessages: !0,
@@ -4931,33 +4936,33 @@ const vl = ({
4931
4936
  rn,
4932
4937
  {
4933
4938
  ...s && {
4934
- renderActions: () => s == null ? void 0 : s(M)
4939
+ renderActions: () => s == null ? void 0 : s(R)
4935
4940
  },
4936
4941
  ...r && {
4937
- renderHeader: () => r(M)
4942
+ renderHeader: () => r(R)
4938
4943
  },
4939
- renderFooter: () => a == null ? void 0 : a(M),
4944
+ renderFooter: () => a == null ? void 0 : a(R),
4940
4945
  disabled: c,
4941
4946
  disabledReason: p,
4942
4947
  composerInput: F
4943
4948
  },
4944
4949
  "lt-channel-message-input"
4945
4950
  )
4946
- ] }) : /* @__PURE__ */ f(Z, { children: [
4951
+ ] }) : /* @__PURE__ */ f(K, { children: [
4947
4952
  /* @__PURE__ */ f(
4948
4953
  "div",
4949
4954
  {
4950
4955
  className: "flex-1 overflow-hidden relative",
4951
4956
  children: [
4952
4957
  !P && /* @__PURE__ */ n("div", { className: "str-chat__list", children: /* @__PURE__ */ f("div", { className: "str-chat__message-list-scroll", children: [
4953
- j,
4958
+ V,
4954
4959
  U
4955
4960
  ] }) }),
4956
4961
  /* @__PURE__ */ n(
4957
4962
  Vt,
4958
4963
  {
4959
4964
  head: P ? /* @__PURE__ */ f("div", { className: "sticky top-0 z-10", children: [
4960
- j,
4965
+ V,
4961
4966
  U
4962
4967
  ] }) : void 0,
4963
4968
  hideDeletedMessages: !0,
@@ -4968,14 +4973,14 @@ const vl = ({
4968
4973
  },
4969
4974
  "lt-channel-message-list"
4970
4975
  ),
4971
- r ? /* @__PURE__ */ n(z.Fragment, { children: r(M) }, "lt-channel-conversation-footer") : null,
4976
+ r ? /* @__PURE__ */ n(z.Fragment, { children: r(R) }, "lt-channel-conversation-footer") : null,
4972
4977
  /* @__PURE__ */ n(
4973
4978
  rn,
4974
4979
  {
4975
4980
  ...s && {
4976
- renderActions: () => s == null ? void 0 : s(M)
4981
+ renderActions: () => s == null ? void 0 : s(R)
4977
4982
  },
4978
- renderFooter: () => a == null ? void 0 : a(M),
4983
+ renderFooter: () => a == null ? void 0 : a(R),
4979
4984
  disabled: c,
4980
4985
  disabledReason: p,
4981
4986
  composerInput: F
@@ -4985,7 +4990,7 @@ const vl = ({
4985
4990
  ] }) })
4986
4991
  }
4987
4992
  ) });
4988
- }, Kn = z.memo(
4993
+ }, Zn = z.memo(
4989
4994
  ({
4990
4995
  channel: e,
4991
4996
  onBack: t,
@@ -5006,73 +5011,76 @@ const vl = ({
5006
5011
  composerDisabled: v = !1,
5007
5012
  composerDisabledReason: x,
5008
5013
  dmAgentEnabled: b,
5009
- messageMetadata: y,
5014
+ messageMetadata: N,
5010
5015
  onMessageSent: _,
5011
5016
  showStarButton: T = !1,
5012
- renderChannelBanner: R,
5013
- customChannelActions: L,
5017
+ renderChannelBanner: L,
5018
+ customChannelActions: E,
5014
5019
  renderChannelActions: $,
5015
5020
  renderMessage: F,
5016
- onMessageLinkClick: M,
5017
- sendButton: E,
5021
+ onMessageLinkClick: R,
5022
+ sendButton: I,
5018
5023
  attachmentPreviewList: D,
5019
- viewerLanguage: I,
5024
+ viewerLanguage: S,
5020
5025
  showChannelInfo: C = !0,
5021
- onParticipantNameClick: S,
5026
+ onParticipantNameClick: A,
5022
5027
  onOutboundClick: P,
5023
5028
  resolveOutbound: U,
5024
- composerInput: j
5029
+ composerInput: V
5025
5030
  }) => {
5026
- const ee = K(
5027
- async (G, N, A) => {
5028
- var ne;
5029
- const Y = ((ne = e.data) == null ? void 0 : ne.chatbot_paused) === !0, q = b && !Y, H = {
5030
- ...N,
5031
- ...q && { silent: !0 },
5032
- ...y && {
5031
+ const te = q(
5032
+ async (y, M, W) => {
5033
+ var ue;
5034
+ const Q = ((ue = e.data) == null ? void 0 : ue.chatbot_paused) === !0, j = b && !Q, J = {
5035
+ ...M,
5036
+ ...j && { silent: !0 },
5037
+ ...N && {
5033
5038
  metadata: {
5034
- ...N.metadata ?? {},
5035
- ...y
5039
+ ...M.metadata ?? {},
5040
+ ...N
5036
5041
  }
5037
5042
  }
5038
- }, te = {
5039
- ...A,
5040
- ...q && { skip_push: !0 }
5041
- }, W = await e.sendMessage(H, te);
5042
- return _ == null || _(W), W;
5043
+ }, X = {
5044
+ ...W,
5045
+ ...j && { skip_push: !0 }
5046
+ }, ne = await e.sendMessage(J, X);
5047
+ return _ == null || _(ne), ne;
5043
5048
  },
5044
- [e, b, y, _]
5045
- ), J = V(null);
5046
- return X(() => {
5047
- if (!M) return;
5048
- const G = J.current;
5049
- if (!G) return;
5050
- const N = (A) => {
5051
- const Y = A.target, q = Y == null ? void 0 : Y.closest("a[href]"), H = q == null ? void 0 : q.getAttribute("href");
5052
- if (!H) return;
5053
- const te = q == null ? void 0 : q.closest("[data-message-id]"), W = te == null ? void 0 : te.getAttribute("data-message-id"), ne = W ? e.state.messages.find((de) => de.id === W) : void 0;
5054
- M(H, ne);
5049
+ [e, b, N, _]
5050
+ ), Z = H(null);
5051
+ Y(() => {
5052
+ if (!R) return;
5053
+ const y = Z.current;
5054
+ if (!y) return;
5055
+ const M = (W) => {
5056
+ const Q = W.target, j = Q == null ? void 0 : Q.closest("a[href]"), J = j == null ? void 0 : j.getAttribute("href");
5057
+ if (!J) return;
5058
+ const X = j == null ? void 0 : j.closest("[data-message-id]"), ne = X == null ? void 0 : X.getAttribute("data-message-id"), ue = ne ? e.state.messages.find((ae) => ae.id === ne) : void 0;
5059
+ R(J, ue);
5055
5060
  };
5056
- return G.addEventListener("click", N), () => G.removeEventListener("click", N);
5057
- }, [M, e]), /* @__PURE__ */ n(
5061
+ return y.addEventListener("click", M), () => y.removeEventListener("click", M);
5062
+ }, [R, e]);
5063
+ const G = un(e.type) ? { "--lt-msg-card-width": "368px" } : void 0;
5064
+ return /* @__PURE__ */ n(
5058
5065
  "div",
5059
5066
  {
5060
- ref: J,
5067
+ ref: Z,
5061
5068
  className: k(
5062
5069
  "messaging-channel-view h-full flex flex-col",
5063
5070
  d
5064
5071
  ),
5065
- children: /* @__PURE__ */ n(qn.Provider, { value: b ?? !1, children: /* @__PURE__ */ n(
5066
- Fs,
5072
+ style: G,
5073
+ children: /* @__PURE__ */ n(Kn.Provider, { value: b ?? !1, children: /* @__PURE__ */ n(
5074
+ $s,
5067
5075
  {
5068
5076
  channel: e,
5069
5077
  MessageSystem: ml,
5070
5078
  EmptyStateIndicator: u,
5071
- LoadingIndicator: je,
5079
+ LoadingIndicator: Ue,
5072
5080
  DateSeparator: Ma,
5073
5081
  TypingIndicator: fl,
5074
- doSendMessageRequest: ee,
5075
- ...E ? { SendButton: E } : {},
5082
+ doSendMessageRequest: te,
5083
+ ...I ? { SendButton: I } : {},
5076
5084
  ...D ? { AttachmentPreviewList: D } : {},
5077
5085
  children: /* @__PURE__ */ n(
5078
5086
  vl,
@@ -5094,16 +5102,16 @@ const vl = ({
5094
5102
  composerDisabled: v,
5095
5103
  composerDisabledReason: x,
5096
5104
  showStarButton: T,
5097
- renderChannelBanner: R,
5098
- customChannelActions: L,
5105
+ renderChannelBanner: L,
5106
+ customChannelActions: E,
5099
5107
  renderChannelActions: $,
5100
5108
  renderMessage: F,
5101
- viewerLanguage: I,
5109
+ viewerLanguage: S,
5102
5110
  showChannelInfo: C,
5103
- onParticipantNameClick: S,
5111
+ onParticipantNameClick: A,
5104
5112
  onOutboundClick: P,
5105
5113
  resolveOutbound: U,
5106
- composerInput: j
5114
+ composerInput: V
5107
5115
  }
5108
5116
  )
5109
5117
  }
@@ -5112,8 +5120,8 @@ const vl = ({
5112
5120
  );
5113
5121
  }
5114
5122
  );
5115
- Kn.displayName = "ChannelView";
5116
- const Se = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ f("div", { className: "text-center max-w-sm", children: [
5123
+ Zn.displayName = "ChannelView";
5124
+ const Ce = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ f("div", { className: "text-center max-w-sm", children: [
5117
5125
  /* @__PURE__ */ n("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ n("span", { className: "text-4xl", children: "⚠️" }) }),
5118
5126
  /* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
5119
5127
  /* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
@@ -5127,153 +5135,151 @@ const Se = z.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
5127
5135
  }
5128
5136
  )
5129
5137
  ] }) }));
5130
- Se.displayName = "ErrorState";
5138
+ Ce.displayName = "ErrorState";
5131
5139
  const ro = ({
5132
5140
  capabilities: e = {},
5133
5141
  renderMessageInputActions: t,
5134
- renderMessageInputFooter: s,
5135
- renderConversationFooter: a,
5136
- onChannelSelect: r,
5137
- onExitConversation: i,
5138
- initialParticipantFilter: o,
5139
- initialParticipantData: l,
5140
- CustomChannelEmptyState: d,
5141
- onBlockParticipantClick: u,
5142
- onReportParticipantClick: h,
5143
- dmAgentEnabled: m,
5144
- onMessageSent: g,
5145
- viewerLanguage: c,
5146
- renderChannelBanner: p,
5147
- customChannelActions: w,
5148
- renderChannelActions: v,
5149
- onParticipantNameClick: x,
5150
- onOutboundClick: b,
5151
- resolveOutbound: y,
5152
- renderMessage: _,
5153
- onMessageLinkClick: T,
5154
- showChannelInfo: R,
5142
+ renderConversationFooter: s,
5143
+ onChannelSelect: a,
5144
+ onExitConversation: r,
5145
+ initialParticipantFilter: i,
5146
+ initialParticipantData: o,
5147
+ CustomChannelEmptyState: l,
5148
+ onBlockParticipantClick: d,
5149
+ onReportParticipantClick: u,
5150
+ dmAgentEnabled: h,
5151
+ onMessageSent: m,
5152
+ viewerLanguage: g,
5153
+ renderChannelBanner: c,
5154
+ customChannelActions: p,
5155
+ renderChannelActions: w,
5156
+ onParticipantNameClick: v,
5157
+ onOutboundClick: x,
5158
+ resolveOutbound: b,
5159
+ renderMessage: N,
5160
+ onMessageLinkClick: _,
5161
+ showChannelInfo: T,
5155
5162
  composerInput: L
5156
5163
  }) => {
5157
5164
  const {
5158
- client: $,
5159
- isConnected: F,
5160
- isLoading: M,
5161
- error: E,
5162
- refreshConnection: D,
5163
- service: I,
5164
- debug: C
5165
- } = _a(), [S, P] = B(null), [U, j] = B(null), [ee, J] = B(!1), { showDeleteConversation: G = !0 } = e, N = V(l);
5166
- N.current = l;
5167
- const A = V(r);
5168
- A.current = r;
5169
- const Y = V(null), q = V(null);
5170
- X(() => {
5171
- q.current = S;
5172
- }, [S]), X(() => {
5173
- if (!$ || !F) return;
5174
- const W = $.userID;
5175
- if (!W) return;
5176
- const ne = `${W}::${o}`;
5177
- if (Y.current === ne) return;
5178
- Y.current = ne;
5179
- const de = () => {
5180
- Y.current === ne && (Y.current = null);
5165
+ client: E,
5166
+ isConnected: $,
5167
+ isLoading: F,
5168
+ error: R,
5169
+ refreshConnection: I,
5170
+ service: D,
5171
+ debug: S
5172
+ } = _a(), [C, A] = B(null), [P, U] = B(null), [V, te] = B(!1), { showDeleteConversation: Z = !0 } = e, G = H(o);
5173
+ G.current = o;
5174
+ const y = H(a);
5175
+ y.current = a;
5176
+ const M = H(null), W = H(null);
5177
+ Y(() => {
5178
+ W.current = C;
5179
+ }, [C]), Y(() => {
5180
+ if (!E || !$) return;
5181
+ const J = E.userID;
5182
+ if (!J) return;
5183
+ const X = `${J}::${i}`;
5184
+ if (M.current === X) return;
5185
+ M.current = X;
5186
+ const ne = () => {
5187
+ M.current === X && (M.current = null);
5181
5188
  };
5182
5189
  (async () => {
5183
- var Oe, ue;
5190
+ var ae, De;
5184
5191
  try {
5185
- C && console.log(
5192
+ S && console.log(
5186
5193
  "[MessagingShell] Loading initial conversation with:",
5187
- o
5194
+ i
5188
5195
  );
5189
- const se = await $.queryChannels(
5196
+ const se = await E.queryChannels(
5190
5197
  {
5191
5198
  type: "messaging",
5192
- members: { $eq: [W, o] }
5199
+ members: { $eq: [J, i] }
5193
5200
  },
5194
5201
  {},
5195
5202
  { limit: 1 }
5196
5203
  );
5197
5204
  if (se.length > 0) {
5198
- P(se[0]), j(null), (Oe = A.current) == null || Oe.call(A, se[0]), C && console.log(
5205
+ A(se[0]), U(null), (ae = y.current) == null || ae.call(y, se[0]), S && console.log(
5199
5206
  "[MessagingShell] Initial conversation loaded:",
5200
5207
  se[0].id
5201
5208
  );
5202
5209
  return;
5203
5210
  }
5204
- const me = N.current;
5205
- if (!me || !I) {
5206
- de(), j("No conversation found with this account"), C && console.log(
5211
+ const me = G.current;
5212
+ if (!me || !D) {
5213
+ ne(), U("No conversation found with this account"), S && console.log(
5207
5214
  "[MessagingShell] No conversation found for:",
5208
- o
5215
+ i
5209
5216
  );
5210
5217
  return;
5211
5218
  }
5212
5219
  try {
5213
- const re = await I.startChannelWithParticipant({
5220
+ const ie = await D.startChannelWithParticipant({
5214
5221
  id: me.id,
5215
5222
  name: me.name,
5216
5223
  phone: me.phone
5217
5224
  });
5218
- P(re), j(null), (ue = A.current) == null || ue.call(A, re), C && console.log(
5225
+ A(ie), U(null), (De = y.current) == null || De.call(y, ie), S && console.log(
5219
5226
  "[MessagingShell] Channel created and loaded:",
5220
- re.id
5227
+ ie.id
5221
5228
  );
5222
- } catch (re) {
5229
+ } catch (ie) {
5223
5230
  console.error(
5224
5231
  "[MessagingShell] Failed to create conversation:",
5225
- re
5226
- ), de(), j("Failed to create conversation");
5232
+ ie
5233
+ ), ne(), U("Failed to create conversation");
5227
5234
  }
5228
5235
  } catch (se) {
5229
5236
  console.error(
5230
5237
  "[MessagingShell] Failed to load initial conversation:",
5231
5238
  se
5232
- ), de(), q.current || j("Failed to load conversation");
5239
+ ), ne(), W.current || U("Failed to load conversation");
5233
5240
  }
5234
5241
  })();
5235
- }, [o, $, F, I, C]);
5236
- const H = V(i);
5237
- H.current = i;
5238
- const te = K(() => {
5239
- var W;
5240
- P(null), J(!0), (W = H.current) == null || W.call(H);
5242
+ }, [i, E, $, D, S]);
5243
+ const Q = H(r);
5244
+ Q.current = r;
5245
+ const j = q(() => {
5246
+ var J;
5247
+ A(null), te(!0), (J = Q.current) == null || J.call(Q);
5241
5248
  }, []);
5242
- return M ? /* @__PURE__ */ n(je, {}) : E ? /* @__PURE__ */ n(Se, { message: E, onBack: D }) : !F || !$ ? /* @__PURE__ */ n(
5243
- Se,
5249
+ return F ? /* @__PURE__ */ n(Ue, {}) : R ? /* @__PURE__ */ n(Ce, { message: R, onBack: I }) : !$ || !E ? /* @__PURE__ */ n(
5250
+ Ce,
5244
5251
  {
5245
5252
  message: "Not connected to messaging service",
5246
- onBack: D
5253
+ onBack: I
5247
5254
  }
5248
- ) : U ? /* @__PURE__ */ n(Se, { message: U }) : ee && !S ? /* @__PURE__ */ n(Se, { message: "Conversation ended" }) : S ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
5249
- Kn,
5255
+ ) : P ? /* @__PURE__ */ n(Ce, { message: P }) : V && !C ? /* @__PURE__ */ n(Ce, { message: "Conversation ended" }) : C ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
5256
+ Zn,
5250
5257
  {
5251
- channel: S,
5258
+ channel: C,
5252
5259
  renderMessageInputActions: t,
5253
- renderMessageInputFooter: s,
5254
- renderConversationFooter: a,
5255
- renderChannelBanner: p,
5256
- onLeaveConversation: te,
5257
- onBlockParticipant: te,
5258
- CustomChannelEmptyState: d,
5259
- showDeleteConversation: G,
5260
- onBlockParticipantClick: u,
5261
- onReportParticipantClick: h,
5262
- dmAgentEnabled: m,
5263
- onMessageSent: g,
5264
- viewerLanguage: c,
5265
- customChannelActions: w,
5266
- renderChannelActions: v,
5267
- onParticipantNameClick: x,
5268
- onOutboundClick: b,
5269
- resolveOutbound: y,
5270
- renderMessage: _,
5271
- onMessageLinkClick: T,
5272
- showChannelInfo: R,
5260
+ renderConversationFooter: s,
5261
+ renderChannelBanner: c,
5262
+ onLeaveConversation: j,
5263
+ onBlockParticipant: j,
5264
+ CustomChannelEmptyState: l,
5265
+ showDeleteConversation: Z,
5266
+ onBlockParticipantClick: d,
5267
+ onReportParticipantClick: u,
5268
+ dmAgentEnabled: h,
5269
+ onMessageSent: m,
5270
+ viewerLanguage: g,
5271
+ customChannelActions: p,
5272
+ renderChannelActions: w,
5273
+ onParticipantNameClick: v,
5274
+ onOutboundClick: x,
5275
+ resolveOutbound: b,
5276
+ renderMessage: N,
5277
+ onMessageLinkClick: _,
5278
+ showChannelInfo: T,
5273
5279
  composerInput: L
5274
5280
  },
5275
- S.id
5276
- ) }) }) : /* @__PURE__ */ n(je, {});
5281
+ C.id
5282
+ ) }) }) : /* @__PURE__ */ n(Ue, {});
5277
5283
  };
5278
5284
  function xl(e) {
5279
5285
  const t = e.state.pending_messages;
@@ -5281,7 +5287,7 @@ function xl(e) {
5281
5287
  for (const s of t)
5282
5288
  e.state.addMessageSorted(s.message);
5283
5289
  }
5284
- const Zn = z.createContext({
5290
+ const Jn = z.createContext({
5285
5291
  selectedChannel: void 0,
5286
5292
  onChannelSelect: () => {
5287
5293
  },
@@ -5289,7 +5295,7 @@ const Zn = z.createContext({
5289
5295
  renderMessagePreview: void 0,
5290
5296
  channelPreview: void 0,
5291
5297
  viewerLanguage: void 0
5292
- }), wl = Zn.Provider, _l = () => z.useContext(Zn), yl = (e, t) => {
5298
+ }), wl = Jn.Provider, _l = () => z.useContext(Jn), yl = (e, t) => {
5293
5299
  const s = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate()), a = Date.UTC(t.getFullYear(), t.getMonth(), t.getDate());
5294
5300
  return Math.floor((a - s) / (1e3 * 60 * 60 * 24));
5295
5301
  }, Nl = (e) => {
@@ -5309,9 +5315,9 @@ const Zn = z.createContext({
5309
5315
  day: "numeric",
5310
5316
  year: "numeric"
5311
5317
  });
5312
- }, Jn = z.memo(
5318
+ }, Qn = z.memo(
5313
5319
  (e) => {
5314
- var $, F, M;
5320
+ var $, F, R;
5315
5321
  const { channel: t, unread: s } = e, {
5316
5322
  selectedChannel: a,
5317
5323
  onChannelSelect: r,
@@ -5319,7 +5325,7 @@ const Zn = z.createContext({
5319
5325
  channelPreview: o,
5320
5326
  renderMessagePreview: l,
5321
5327
  viewerLanguage: d
5322
- } = _l(), { client: u } = Ve(), h = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = bn(t);
5328
+ } = _l(), { client: u } = He(), h = (a == null ? void 0 : a.id) === (t == null ? void 0 : t.id), m = vn(t);
5323
5329
  if (o)
5324
5330
  return /* @__PURE__ */ n(
5325
5331
  o,
@@ -5333,45 +5339,45 @@ const Zn = z.createContext({
5333
5339
  );
5334
5340
  const g = () => {
5335
5341
  t && r(t);
5336
- }, c = (E) => {
5337
- const D = E.key === "Enter" || E.key === " ", I = E.repeat;
5338
- !D || I || (E.preventDefault(), g());
5339
- }, p = vn(
5342
+ }, c = (I) => {
5343
+ const D = I.key === "Enter" || I.key === " ", S = I.repeat;
5344
+ !D || S || (I.preventDefault(), g());
5345
+ }, p = xn(
5340
5346
  ($ = t == null ? void 0 : t.state) == null ? void 0 : $.members,
5341
5347
  u == null ? void 0 : u.userID,
5342
5348
  t == null ? void 0 : t.type
5343
- ), w = xn(p == null ? void 0 : p.user), v = (F = p == null ? void 0 : p.user) == null ? void 0 : F.image, x = (() => {
5349
+ ), w = wn(p == null ? void 0 : p.user), v = (F = p == null ? void 0 : p.user) == null ? void 0 : F.image, x = (() => {
5344
5350
  var D;
5345
- const E = (D = t == null ? void 0 : t.state) == null ? void 0 : D.messages;
5346
- if (E != null && E.length) {
5347
- for (let I = E.length - 1; I >= 0; I--)
5348
- if (E[I].type !== "system") return E[I];
5351
+ const I = (D = t == null ? void 0 : t.state) == null ? void 0 : D.messages;
5352
+ if (I != null && I.length) {
5353
+ for (let S = I.length - 1; S >= 0; S--)
5354
+ if (I[S].type !== "system") return I[S];
5349
5355
  }
5350
- })(), y = (() => {
5351
- var S;
5352
- const E = _n({
5356
+ })(), N = (() => {
5357
+ var A;
5358
+ const I = yn({
5353
5359
  message: x,
5354
5360
  viewerLanguage: d
5355
- }), { custom_type: D, attachment_content_type: I } = (x == null ? void 0 : x.metadata) || {};
5356
- if (D === le.TIP)
5357
- return E || "Sent a tip";
5358
- if (D === le.PAID)
5359
- return E || "Sent a message";
5360
- if (D === le.ATTACHMENT) {
5361
- if (I === "text")
5361
+ }), { custom_type: D, attachment_content_type: S } = (x == null ? void 0 : x.metadata) || {};
5362
+ if (D === oe.TIP)
5363
+ return I || "Sent a tip";
5364
+ if (D === oe.PAID)
5365
+ return I || "Sent a message";
5366
+ if (D === oe.ATTACHMENT) {
5367
+ if (S === "text")
5362
5368
  return "🔒 Sent a locked message";
5363
- if (I === "media")
5369
+ if (S === "media")
5364
5370
  return "🔒 Sent a locked attachment";
5365
5371
  }
5366
- if (E) return E;
5367
- const C = (S = x == null ? void 0 : x.attachments) == null ? void 0 : S[0];
5372
+ if (I) return I;
5373
+ const C = (A = x == null ? void 0 : x.attachments) == null ? void 0 : A[0];
5368
5374
  return C ? C.og_scrape_url ? C.og_scrape_url : C.type === "image" ? "📷 Sent an image" : C.type === "video" ? "🎥 Sent a video" : C.type === "audio" ? "🎵 Sent audio" : C.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
5369
- })(), _ = x != null && x.created_at ? Nl(new Date(x.created_at)) : "", T = x ? $e(x) : !1, R = l ? l(x, y) : `${T ? "✨ " : ""}${y}`, L = s ?? 0;
5375
+ })(), _ = x != null && x.created_at ? Nl(new Date(x.created_at)) : "", T = x ? Fe(x) : !1, L = l ? l(x, N) : `${T ? "✨ " : ""}${N}`, E = s ?? 0;
5370
5376
  return i && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
5371
5377
  channelId: t == null ? void 0 : t.id,
5372
5378
  isSelected: h,
5373
5379
  participantName: w,
5374
- unreadCount: L,
5380
+ unreadCount: E,
5375
5381
  hasTimestamp: !!_
5376
5382
  }), /* @__PURE__ */ n(
5377
5383
  "div",
@@ -5390,9 +5396,9 @@ const Zn = z.createContext({
5390
5396
  "data-dd-privacy": "mask",
5391
5397
  children: /* @__PURE__ */ f("div", { className: "flex items-start gap-4", children: [
5392
5398
  /* @__PURE__ */ n(
5393
- ye,
5399
+ _e,
5394
5400
  {
5395
- id: ((M = p == null ? void 0 : p.user) == null ? void 0 : M.id) || t.id || "unknown",
5401
+ id: ((R = p == null ? void 0 : p.user) == null ? void 0 : R.id) || t.id || "unknown",
5396
5402
  name: w,
5397
5403
  image: v,
5398
5404
  size: 48,
@@ -5416,8 +5422,8 @@ const Zn = z.createContext({
5416
5422
  _ && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: _ })
5417
5423
  ] }),
5418
5424
  /* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
5419
- /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: R }),
5420
- L > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: L > 99 ? "99+" : L })
5425
+ /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: L }),
5426
+ E > 0 && /* @__PURE__ */ n("span", { className: "bg-[#7f22fe] text-white text-[10px] rounded-full h-4 flex items-center justify-center p-1 min-w-4 text-center flex-shrink-0", children: E > 99 ? "99+" : E })
5421
5427
  ] })
5422
5428
  ] })
5423
5429
  ] })
@@ -5425,7 +5431,7 @@ const Zn = z.createContext({
5425
5431
  );
5426
5432
  }
5427
5433
  );
5428
- Jn.displayName = "CustomChannelPreview";
5434
+ Qn.displayName = "CustomChannelPreview";
5429
5435
  const kl = { last_message_at: -1 }, Cl = z.memo(
5430
5436
  ({
5431
5437
  onChannelSelect: e,
@@ -5436,7 +5442,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
5436
5442
  sort: i = kl,
5437
5443
  className: o,
5438
5444
  customEmptyStateIndicator: l,
5439
- channelListPaginator: d = js,
5445
+ channelListPaginator: d = Hs,
5440
5446
  channelPreview: u,
5441
5447
  renderMessagePreview: h,
5442
5448
  viewerLanguage: m,
@@ -5449,15 +5455,15 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
5449
5455
  }) => {
5450
5456
  const b = z.useRef(0);
5451
5457
  b.current++;
5452
- const { debug: y = !1 } = ot(), _ = z.useCallback(
5453
- (R) => {
5454
- for (const L of R)
5455
- xl(L);
5456
- return r ? r(R) : R;
5458
+ const { debug: N = !1 } = lt(), _ = z.useCallback(
5459
+ (L) => {
5460
+ for (const E of L)
5461
+ xl(E);
5462
+ return r ? r(L) : L;
5457
5463
  },
5458
5464
  [r]
5459
5465
  );
5460
- y && console.log("📺 [ChannelList] 🔄 RENDER START", {
5466
+ N && console.log("📺 [ChannelList] 🔄 RENDER START", {
5461
5467
  renderCount: b.current,
5462
5468
  selectedChannelId: t == null ? void 0 : t.id,
5463
5469
  filters: s
@@ -5466,7 +5472,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
5466
5472
  () => ({
5467
5473
  selectedChannel: t,
5468
5474
  onChannelSelect: e,
5469
- debug: y,
5475
+ debug: N,
5470
5476
  channelPreview: u,
5471
5477
  renderMessagePreview: h,
5472
5478
  viewerLanguage: m
@@ -5474,7 +5480,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
5474
5480
  [
5475
5481
  t,
5476
5482
  e,
5477
- y,
5483
+ N,
5478
5484
  u,
5479
5485
  h,
5480
5486
  m
@@ -5488,7 +5494,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
5488
5494
  o
5489
5495
  ),
5490
5496
  children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(wl, { value: T, children: /* @__PURE__ */ n(
5491
- Us,
5497
+ js,
5492
5498
  {
5493
5499
  filters: s,
5494
5500
  sort: i,
@@ -5502,7 +5508,7 @@ const kl = { last_message_at: -1 }, Cl = z.memo(
5502
5508
  onAddedToChannel: v,
5503
5509
  onChannelUpdated: x,
5504
5510
  Paginator: d,
5505
- Preview: Jn,
5511
+ Preview: Qn,
5506
5512
  EmptyStateIndicator: l
5507
5513
  },
5508
5514
  `${JSON.stringify(s)}:${JSON.stringify(i)}`
@@ -5527,7 +5533,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5527
5533
  a ? "mt-3 flex-col" : "min-w-0 max-w-[60%] flex-row flex-wrap justify-end"
5528
5534
  ),
5529
5535
  children: t.map((r, i) => /* @__PURE__ */ n(
5530
- Mn,
5536
+ Dn,
5531
5537
  {
5532
5538
  variant: e,
5533
5539
  cta: r,
@@ -5573,6 +5579,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5573
5579
  {
5574
5580
  className: k(
5575
5581
  El,
5582
+ r > 1 && "whitespace-pre-line",
5576
5583
  r <= 1 && "truncate"
5577
5584
  ),
5578
5585
  style: m,
@@ -5583,7 +5590,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5583
5590
  return /* @__PURE__ */ n("div", { className: "shrink-0 px-4 py-3", children: g ? /* @__PURE__ */ f("div", { className: "flex items-center justify-between gap-3", children: [
5584
5591
  c,
5585
5592
  /* @__PURE__ */ n(on, { surface: e, actions: o, layout: "row" })
5586
- ] }) : /* @__PURE__ */ f(Z, { children: [
5593
+ ] }) : /* @__PURE__ */ f(K, { children: [
5587
5594
  c,
5588
5595
  /* @__PURE__ */ n(
5589
5596
  on,
@@ -5628,7 +5635,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5628
5635
  children: l.map(({ src: c, index: p }, w) => /* @__PURE__ */ n(
5629
5636
  "img",
5630
5637
  {
5631
- src: oe(c) ?? c,
5638
+ src: ce(c) ?? c,
5632
5639
  alt: "",
5633
5640
  draggable: !1,
5634
5641
  loading: "lazy",
@@ -5656,7 +5663,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5656
5663
  // hero image errors, so `CardThumbnail` falls through to its placeholder.
5657
5664
  // Do NOT `?? images[0]` here — that would re-instate the failed URL.
5658
5665
  /* @__PURE__ */ n(
5659
- Te,
5666
+ Ie,
5660
5667
  {
5661
5668
  variant: e,
5662
5669
  thumbnailUrl: r,
@@ -5665,7 +5672,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5665
5672
  onImageError: i
5666
5673
  }
5667
5674
  )
5668
- ) }), Qn = ({
5675
+ ) }), es = ({
5669
5676
  variant: e,
5670
5677
  title: t,
5671
5678
  subtitle: s,
@@ -5677,23 +5684,23 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5677
5684
  accentColor: d,
5678
5685
  groupPosition: u = "single"
5679
5686
  }) => {
5680
- const h = va({
5687
+ const h = Ys({
5681
5688
  imagePresentation: i,
5682
5689
  images: r
5683
- }), m = r.length > 0, g = m && h === "hero", c = Ge({
5690
+ }), m = r.length > 0, g = m && h === "hero", c = Ve({
5684
5691
  variant: e,
5685
5692
  accentColor: d,
5686
5693
  layout: "featured",
5687
5694
  thumbnailUrl: g ? r[0] : void 0
5688
5695
  }), p = u === "single" || u === "end";
5689
5696
  return /* @__PURE__ */ n(
5690
- xt,
5697
+ vt,
5691
5698
  {
5692
5699
  accentHex: c.accentHex,
5693
5700
  side: e === "dark" ? "sender" : "receiver",
5694
5701
  visible: p,
5695
5702
  children: /* @__PURE__ */ f(
5696
- Ie,
5703
+ Ee,
5697
5704
  {
5698
5705
  variant: e,
5699
5706
  accentHex: c.accentHex,
@@ -5727,7 +5734,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5727
5734
  )
5728
5735
  }
5729
5736
  );
5730
- }, zl = (e) => /* @__PURE__ */ n(Qn, { ...e, variant: "dark" }), Fl = (e) => /* @__PURE__ */ n(Qn, { ...e, variant: "light" }), io = {
5737
+ }, zl = (e) => /* @__PURE__ */ n(es, { ...e, variant: "dark" }), Fl = (e) => /* @__PURE__ */ n(es, { ...e, variant: "light" }), io = {
5731
5738
  Sent: zl,
5732
5739
  Received: Fl
5733
5740
  }, cn = `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%`, $l = {
@@ -5757,7 +5764,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5757
5764
  backgroundColor: "var(--str-chat__message-bubble-background-color, #f1f0ee)",
5758
5765
  color: "var(--str-chat__message-bubble-color, #000000)"
5759
5766
  }
5760
- }, es = ({
5767
+ }, ts = ({
5761
5768
  variant: e,
5762
5769
  text: t,
5763
5770
  tail: s = !0,
@@ -5789,7 +5796,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5789
5796
  header: s,
5790
5797
  className: a
5791
5798
  }) => /* @__PURE__ */ n(
5792
- es,
5799
+ ts,
5793
5800
  {
5794
5801
  variant: "received",
5795
5802
  text: e,
@@ -5797,7 +5804,7 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5797
5804
  header: s,
5798
5805
  className: a
5799
5806
  }
5800
- ), Hl = ({ text: e, tail: t, className: s }) => /* @__PURE__ */ n(es, { variant: "sent", text: e, tail: t, className: s }), lo = {
5807
+ ), Hl = ({ text: e, tail: t, className: s }) => /* @__PURE__ */ n(ts, { variant: "sent", text: e, tail: t, className: s }), lo = {
5801
5808
  Sent: Hl,
5802
5809
  Received: jl
5803
5810
  }, Vl = ({
@@ -5831,10 +5838,10 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5831
5838
  avatarImage: i,
5832
5839
  avatarName: o
5833
5840
  }) => {
5834
- const l = xa(e);
5841
+ const l = Ws(e);
5835
5842
  return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ f("div", { className: "flex gap-3 items-end", children: [
5836
5843
  (i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
5837
- ye,
5844
+ _e,
5838
5845
  {
5839
5846
  id: o || "account",
5840
5847
  name: o || "Account",
@@ -5865,41 +5872,41 @@ const Sl = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px] [te
5865
5872
  ] }) });
5866
5873
  };
5867
5874
  export {
5868
- Nn as A,
5869
- xn as B,
5875
+ kn as A,
5876
+ wn as B,
5870
5877
  pl as C,
5871
5878
  ao as D,
5872
5879
  sr as E,
5873
5880
  oo as F,
5874
5881
  _a as G,
5875
- it as L,
5882
+ rt as L,
5876
5883
  to as M,
5877
5884
  io as R,
5878
- ke as a,
5879
- ye as b,
5885
+ Ne as a,
5886
+ _e as b,
5880
5887
  Cl as c,
5881
- Kn as d,
5888
+ Zn as d,
5882
5889
  no as e,
5883
5890
  Vl as f,
5884
- ce as g,
5885
- ze as h,
5886
- Ce as i,
5891
+ de as g,
5892
+ Pe as h,
5893
+ ke as i,
5887
5894
  lo as j,
5888
5895
  eo as k,
5889
5896
  ro as l,
5890
5897
  ei as m,
5891
5898
  Zr as n,
5892
- oe as o,
5899
+ ce as o,
5893
5900
  Nl as p,
5894
5901
  Qr as q,
5895
- xe as r,
5896
- _n as s,
5897
- Sn as t,
5902
+ ve as r,
5903
+ yn as s,
5904
+ En as t,
5898
5905
  Na as u,
5899
5906
  so as v,
5900
5907
  Da as w,
5901
- vn as x,
5902
- ut as y,
5903
- mt as z
5908
+ xn as x,
5909
+ dt as y,
5910
+ ut as z
5904
5911
  };
5905
- //# sourceMappingURL=index-CH6y1lmh.js.map
5912
+ //# sourceMappingURL=index-Cxj0F8aQ.js.map