@linktr.ee/messaging-react 3.4.1 → 3.5.0-rc-1782408966

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.
Files changed (34) hide show
  1. package/dist/{Card-BKd0E-B9.js → Card-BNzC_bp8.js} +3 -3
  2. package/dist/{Card-BKd0E-B9.js.map → Card-BNzC_bp8.js.map} +1 -1
  3. package/dist/{Card-CrTBu2I6.js → Card-CUHEDe8O.js} +2 -2
  4. package/dist/{Card-CrTBu2I6.js.map → Card-CUHEDe8O.js.map} +1 -1
  5. package/dist/{Card-CdaZxDEx.cjs → Card-DEa50m9p.cjs} +2 -2
  6. package/dist/{Card-CdaZxDEx.cjs.map → Card-DEa50m9p.cjs.map} +1 -1
  7. package/dist/{Card-DaalkoQW.cjs → Card-DJtDI03Y.cjs} +2 -2
  8. package/dist/{Card-DaalkoQW.cjs.map → Card-DJtDI03Y.cjs.map} +1 -1
  9. package/dist/{Card-DXWp0uwi.cjs → Card-DuMr5KMP.cjs} +2 -2
  10. package/dist/{Card-DXWp0uwi.cjs.map → Card-DuMr5KMP.cjs.map} +1 -1
  11. package/dist/{Card-XVTz8IYz.js → Card-iekRe643.js} +2 -2
  12. package/dist/{Card-XVTz8IYz.js.map → Card-iekRe643.js.map} +1 -1
  13. package/dist/{LockedThumbnail-D_44b-Uy.js → LockedThumbnail-CvpRZFi-.js} +2 -2
  14. package/dist/{LockedThumbnail-D_44b-Uy.js.map → LockedThumbnail-CvpRZFi-.js.map} +1 -1
  15. package/dist/{LockedThumbnail-D3Xwdb5_.cjs → LockedThumbnail-aME0f_ZF.cjs} +2 -2
  16. package/dist/{LockedThumbnail-D3Xwdb5_.cjs.map → LockedThumbnail-aME0f_ZF.cjs.map} +1 -1
  17. package/dist/index-BIWS3Inh.cjs +2 -0
  18. package/dist/index-BIWS3Inh.cjs.map +1 -0
  19. package/dist/{index-DPGZRLRM.js → index-BlpDX5fl.js} +1175 -1165
  20. package/dist/index-BlpDX5fl.js.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.ts +18 -0
  23. package/dist/index.js +20 -19
  24. package/package.json +2 -2
  25. package/src/components/ChannelList/CustomChannelPreview.test.tsx +38 -0
  26. package/src/components/ChannelList/CustomChannelPreview.tsx +5 -6
  27. package/src/components/ChannelView.test.tsx +35 -0
  28. package/src/components/ChannelView.tsx +6 -0
  29. package/src/components/VerifiedBadge/index.tsx +25 -0
  30. package/src/index.ts +2 -0
  31. package/src/stream-custom-data.ts +8 -0
  32. package/dist/index-Cds2w5zi.cjs +0 -2
  33. package/dist/index-Cds2w5zi.cjs.map +0 -1
  34. package/dist/index-DPGZRLRM.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  import { jsx as n, jsxs as h, Fragment as ae } from "react/jsx-runtime";
2
- import j, { createContext as Ye, useContext as Ae, useCallback as K, useState as $, useRef as G, useEffect as X, useId as Sn, useMemo as se, Suspense as qe } from "react";
3
- import { StreamChatService as In } from "@linktr.ee/messaging-core";
4
- import { StreamChat as Tn, LinkPreviewsManager as At } from "stream-chat";
5
- import { Chat as An, DateSeparator as Mn, useChannelStateContext as ce, useChatContext as We, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as jt, Attachment as Dn, EditMessageModal as On, MessageBlocked as Pn, MessageBouncePrompt as zn, MessageDeleted as $n, MessageIsThreadReplyInChannelButtonIndicator as Fn, MessageRepliesCountButton as Bn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Mt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as xe, useMessageComposer as Jn, useStateStore as Zn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, AttachmentPreviewList as ns, QuotedMessagePreview as ss, TextareaComposer as as, MessageTimestamp as De, AIStates as Oe, useTypingContext as rs, useAIState as is, Channel as os, WithComponents as ls, Window as cs, MessageList as ds, ChannelList as us, InfiniteScroll as ms } from "stream-chat-react";
6
- import { StarIcon as Be, DotsThreeIcon as hs, SpinnerGapIcon as ke, SignOutIcon as fs, ProhibitInsetIcon as Rt, FlagIcon as Vt, FileIcon as Gt, ImageIcon as gs, SpeakerHighIcon as bs, VideoCameraIcon as Ht, FileMdIcon as ps, FileTextIcon as vs, FileZipIcon as xs, FilePptIcon as ws, FileCsvIcon as _s, FileXlsIcon as Ns, FileDocIcon as ys, FilePdfIcon as Cs, CircleNotchIcon as pe, PlayIcon as Ue, PauseIcon as ks, LinkIcon as Es, DownloadSimpleIcon as ve, GiftIcon as Ss, ThumbsUpIcon as Is, ThumbsDownIcon as Ts, TrashSimpleIcon as As, XIcon as Me, ArrowUpIcon as Ms, SparkleIcon as je, ProhibitIcon as Rs, ArrowLeftIcon as Lt, CaretRightIcon as Ve, PencilSimpleIcon as Ls, CaretLeftIcon as Ds } from "@phosphor-icons/react";
7
- import N from "classnames";
8
- import { MessageActions as Os, DefaultDropdownActionButton as Yt } from "stream-chat-react/experimental";
9
- const qt = Ye({
2
+ import U, { createContext as qe, useContext as Me, useCallback as Z, useState as z, useRef as H, useEffect as J, useId as In, useMemo as se, Suspense as We } from "react";
3
+ import { StreamChatService as Tn } from "@linktr.ee/messaging-core";
4
+ import { StreamChat as An, LinkPreviewsManager as Mt } from "stream-chat";
5
+ import { Chat as Mn, DateSeparator as Rn, useChannelStateContext as ce, useChatContext as Xe, areMessageUIPropsEqual as Ln, useMessageReminder as Dn, useComponentContext as jt, Attachment as Pn, EditMessageModal as On, MessageBlocked as zn, MessageBouncePrompt as $n, MessageDeleted as Fn, MessageIsThreadReplyInChannelButtonIndicator as Bn, MessageRepliesCountButton as Vn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Gn, messageHasReactions as Hn, isDateSeparatorMessage as Yn, isMessageBlocked as qn, isMessageBounced as Wn, MessageBounceModal as Xn, MessageText as Rt, Poll as Kn, MessageErrorIcon as Jn, useMessageContext as we, useMessageComposer as Zn, useStateStore as Qn, MessageInput as es, useMessageInputContext as ts, useMessageComposerHasSendableData as ns, AttachmentPreviewList as ss, QuotedMessagePreview as as, TextareaComposer as rs, MessageTimestamp as Pe, AIStates as Oe, useTypingContext as is, useAIState as os, Channel as ls, WithComponents as cs, Window as ds, MessageList as us, ChannelList as ms, InfiniteScroll as hs } from "stream-chat-react";
6
+ import { StarIcon as Ve, DotsThreeIcon as fs, SpinnerGapIcon as Ee, SignOutIcon as gs, ProhibitInsetIcon as Lt, FlagIcon as Gt, FileIcon as Ht, ImageIcon as bs, SpeakerHighIcon as ps, VideoCameraIcon as Yt, FileMdIcon as vs, FileTextIcon as xs, FileZipIcon as ws, FilePptIcon as _s, FileCsvIcon as Ns, FileXlsIcon as ys, FileDocIcon as Cs, FilePdfIcon as ks, CircleNotchIcon as ve, PlayIcon as Ue, PauseIcon as Es, LinkIcon as Ss, DownloadSimpleIcon as xe, GiftIcon as Is, ThumbsUpIcon as Ts, ThumbsDownIcon as As, TrashSimpleIcon as Ms, XIcon as Re, ArrowUpIcon as Rs, SparkleIcon as je, ProhibitIcon as Ls, SealCheckIcon as Ds, ArrowLeftIcon as Dt, CaretRightIcon as Ge, PencilSimpleIcon as Ps, CaretLeftIcon as Os } from "@phosphor-icons/react";
7
+ import y from "classnames";
8
+ import { MessageActions as zs, DefaultDropdownActionButton as qt } from "stream-chat-react/experimental";
9
+ const Wt = qe({
10
10
  service: null,
11
11
  client: null,
12
12
  isConnected: !1,
@@ -16,7 +16,7 @@ const qt = Ye({
16
16
  refreshConnection: async () => {
17
17
  },
18
18
  debug: !1
19
- }), Xe = () => Ae(qt), Ni = ({
19
+ }), Ke = () => Me(Wt), Ci = ({
20
20
  children: e,
21
21
  user: t,
22
22
  serviceConfig: s,
@@ -24,10 +24,10 @@ const qt = Ye({
24
24
  capabilities: r = {},
25
25
  debug: i = !1
26
26
  }) => {
27
- var D, C;
28
- const o = K(
29
- (I, ...T) => {
30
- i && console.log(`🔥 [MessagingProvider] ${I}`, ...T);
27
+ var T, k;
28
+ const o = Z(
29
+ (I, ...C) => {
30
+ i && console.log(`🔥 [MessagingProvider] ${I}`, ...C);
31
31
  },
32
32
  [i]
33
33
  );
@@ -37,37 +37,37 @@ const qt = Ye({
37
37
  serviceConfig: !!s,
38
38
  capabilities: Object.keys(r)
39
39
  });
40
- const [l, d] = $(null), [m, g] = $(null), [u, f] = $(!1), [c, b] = $(!1), [_, v] = $(null), p = G(!1), x = G(null), A = G(s);
40
+ const [l, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, x] = z(!1), [b, w] = z(null), v = H(!1), p = H(null), A = H(s);
41
41
  A.current = s;
42
- const M = G(i);
43
- M.current = i;
44
- const y = G({
42
+ const R = H(i);
43
+ R.current = i;
44
+ const L = H({
45
45
  userId: t == null ? void 0 : t.id,
46
46
  apiKey: a,
47
47
  serviceConfig: s,
48
48
  capabilities: r
49
- }), R = G(0);
50
- R.current++, o("📊 RENDER INFO", {
51
- renderCount: R.current,
49
+ }), S = H(0);
50
+ S.current++, o("📊 RENDER INFO", {
51
+ renderCount: S.current,
52
52
  currentProps: { userId: t == null ? void 0 : t.id, apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..." },
53
53
  propChanges: {
54
- userChanged: y.current.userId !== (t == null ? void 0 : t.id),
55
- apiKeyChanged: y.current.apiKey !== a,
56
- serviceConfigChanged: y.current.serviceConfig !== s,
57
- capabilitiesChanged: y.current.capabilities !== r
54
+ userChanged: L.current.userId !== (t == null ? void 0 : t.id),
55
+ apiKeyChanged: L.current.apiKey !== a,
56
+ serviceConfigChanged: L.current.serviceConfig !== s,
57
+ capabilitiesChanged: L.current.capabilities !== r
58
58
  }
59
- }), y.current = {
59
+ }), L.current = {
60
60
  userId: t == null ? void 0 : t.id,
61
61
  apiKey: a,
62
62
  serviceConfig: s,
63
63
  capabilities: r
64
64
  };
65
- const z = G(null);
66
- a && ((D = z.current) == null ? void 0 : D.apiKey) !== a && (z.current = { apiKey: a, client: new Tn(a) });
67
- const P = a ? ((C = z.current) == null ? void 0 : C.client) ?? null : null;
68
- X(() => {
69
- const I = R.current, T = A.current;
70
- if (!a || !P || !T) {
65
+ const D = H(null);
66
+ a && ((T = D.current) == null ? void 0 : T.apiKey) !== a && (D.current = { apiKey: a, client: new An(a) });
67
+ const P = a ? ((k = D.current) == null ? void 0 : k.client) ?? null : null;
68
+ J(() => {
69
+ const I = S.current, C = A.current;
70
+ if (!a || !P || !C) {
71
71
  o("⚠️ SERVICE INIT SKIPPED", {
72
72
  renderCount: I,
73
73
  reason: "Missing apiKey, client, or serviceConfig"
@@ -78,36 +78,36 @@ const qt = Ye({
78
78
  renderCount: I,
79
79
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
80
80
  });
81
- const O = new In({
82
- ...T,
81
+ const O = new Tn({
82
+ ...C,
83
83
  apiKey: a,
84
- debug: M.current,
84
+ debug: R.current,
85
85
  client: P
86
86
  });
87
- x.current = O, d(O), o("✅ SERVICE SET", {
87
+ p.current = O, d(O), o("✅ SERVICE SET", {
88
88
  renderCount: I,
89
89
  serviceInstance: !!O
90
90
  });
91
91
  }, [a, P]);
92
- const S = G(null);
93
- X(() => {
94
- var T, O;
92
+ const B = H(null);
93
+ J(() => {
94
+ var C, O;
95
95
  if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
96
96
  hasService: !!l,
97
97
  hasUser: !!t,
98
98
  userId: t == null ? void 0 : t.id,
99
- isConnecting: p.current,
99
+ isConnecting: v.current,
100
100
  isConnected: u,
101
101
  dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
102
102
  }), !l || !t) {
103
103
  o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
104
104
  return;
105
105
  }
106
- if (p.current) {
106
+ if (v.current) {
107
107
  o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
108
108
  return;
109
109
  }
110
- if (((T = S.current) == null ? void 0 : T.serviceId) === l && ((O = S.current) == null ? void 0 : O.userId) === t.id) {
110
+ if (((C = B.current) == null ? void 0 : C.serviceId) === l && ((O = B.current) == null ? void 0 : O.userId) === t.id) {
111
111
  o(
112
112
  "⚠️ USER CONNECTION SKIPPED",
113
113
  "Already connected this user with this service"
@@ -115,35 +115,35 @@ const qt = Ye({
115
115
  return;
116
116
  }
117
117
  (async () => {
118
- o("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, b(!0), v(null);
118
+ o("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, x(!0), w(null);
119
119
  try {
120
120
  o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
121
- const F = await l.connectUser(t);
122
- g(F), f(!0), S.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
121
+ const $ = await l.connectUser(t);
122
+ g($), f(!0), B.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
123
123
  userId: t.id,
124
- clientId: F.userID
124
+ clientId: $.userID
125
125
  });
126
- } catch (F) {
127
- const Y = F instanceof Error ? F.message : "Connection failed";
128
- v(Y), o("❌ USER CONNECTION ERROR", {
126
+ } catch ($) {
127
+ const j = $ instanceof Error ? $.message : "Connection failed";
128
+ w(j), o("❌ USER CONNECTION ERROR", {
129
129
  userId: t.id,
130
- error: Y
130
+ error: j
131
131
  });
132
132
  } finally {
133
- b(!1), p.current = !1, o("🔄 USER CONNECTION FINISHED", {
133
+ x(!1), v.current = !1, o("🔄 USER CONNECTION FINISHED", {
134
134
  userId: t.id,
135
135
  isConnected: u
136
136
  });
137
137
  }
138
138
  })();
139
- }, [l, t, o, u]), X(() => {
139
+ }, [l, t, o, u]), J(() => {
140
140
  const I = P;
141
141
  return () => {
142
- var T;
143
- I && (S.current = null, (T = x.current) == null || T.disconnectUser().catch(console.error));
142
+ var C;
143
+ I && (B.current = null, (C = p.current) == null || C.disconnectUser().catch(console.error));
144
144
  };
145
145
  }, [P]);
146
- const E = K(async () => {
146
+ const M = Z(async () => {
147
147
  if (o("🔄 REFRESH CONNECTION CALLED", {
148
148
  hasService: !!l,
149
149
  hasUser: !!t
@@ -151,53 +151,53 @@ const qt = Ye({
151
151
  o("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
152
152
  return;
153
153
  }
154
- o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
154
+ o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), x(!0);
155
155
  try {
156
156
  o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
157
157
  const I = await l.connectUser(t);
158
- g(I), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
158
+ g(I), f(!0), w(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
159
159
  } catch (I) {
160
- const T = I instanceof Error ? I.message : "Refresh failed";
161
- v(T), o("❌ CONNECTION REFRESH ERROR", {
160
+ const C = I instanceof Error ? I.message : "Refresh failed";
161
+ w(C), o("❌ CONNECTION REFRESH ERROR", {
162
162
  userId: t.id,
163
- error: T
163
+ error: C
164
164
  });
165
165
  } finally {
166
- b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
166
+ x(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
167
167
  }
168
- }, [l, t, o]), L = j.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
168
+ }, [l, t, o]), N = U.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
169
169
  hasService: !!l,
170
170
  hasClient: !!m,
171
171
  isConnected: u,
172
172
  isLoading: c,
173
- hasError: !!_,
173
+ hasError: !!b,
174
174
  capabilitiesKeys: Object.keys(r)
175
175
  }), {
176
176
  service: l,
177
177
  client: m,
178
178
  isConnected: u,
179
179
  isLoading: c,
180
- error: _,
180
+ error: b,
181
181
  capabilities: r,
182
- refreshConnection: E,
182
+ refreshConnection: M,
183
183
  debug: i
184
184
  }), [
185
185
  l,
186
186
  m,
187
187
  u,
188
188
  c,
189
- _,
189
+ b,
190
190
  r,
191
- E,
191
+ M,
192
192
  i,
193
193
  o
194
194
  ]);
195
195
  return o("🔄 RENDER END", {
196
- renderCount: R.current,
196
+ renderCount: S.current,
197
197
  willRenderChat: !!P,
198
- contextValueReady: !!L
199
- }), /* @__PURE__ */ n(qt.Provider, { value: L, children: P ? /* @__PURE__ */ n(
200
- An,
198
+ contextValueReady: !!N
199
+ }), /* @__PURE__ */ n(Wt.Provider, { value: N, children: P ? /* @__PURE__ */ n(
200
+ Mn,
201
201
  {
202
202
  client: P,
203
203
  customClasses: {
@@ -206,12 +206,12 @@ const qt = Ye({
206
206
  children: e
207
207
  }
208
208
  ) : e });
209
- }, Ps = () => Xe(), Wt = (e) => {
209
+ }, $s = () => Ke(), Xt = (e) => {
210
210
  var a, r;
211
- const [t, s] = $(
211
+ const [t, s] = z(
212
212
  !!((r = (a = e == null ? void 0 : e.state) == null ? void 0 : a.membership) != null && r.pinned_at)
213
213
  );
214
- return X(() => {
214
+ return J(() => {
215
215
  var o;
216
216
  if (!e) {
217
217
  s(!1);
@@ -228,16 +228,16 @@ const qt = Ye({
228
228
  e.off("member.updated", i);
229
229
  };
230
230
  }, [e]), t;
231
- }, zs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
232
- function $s(e) {
233
- return zs.test(e.trim());
231
+ }, Fs = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
232
+ function Bs(e) {
233
+ return Fs.test(e.trim());
234
234
  }
235
- function Dt(e, t) {
235
+ function Pt(e, t) {
236
236
  const s = e == null ? void 0 : e.trim();
237
- return !s || t && s === t ? !1 : !$s(s);
237
+ return !s || t && s === t ? !1 : !Bs(s);
238
238
  }
239
- function Xt(e) {
240
- return Dt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Dt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
239
+ function Kt(e) {
240
+ return Pt(e == null ? void 0 : e.name, e == null ? void 0 : e.id) ? e.name.trim() : Pt(e == null ? void 0 : e.username, e == null ? void 0 : e.id) ? e.username.trim() : "Unknown member";
241
241
  }
242
242
  const Ot = [
243
243
  "🍎",
@@ -267,7 +267,7 @@ const Ot = [
267
267
  "🍈"
268
268
  // Melon
269
269
  ];
270
- function Fs(e) {
270
+ function Vs(e) {
271
271
  let t = 0;
272
272
  for (let s = 0; s < e.length; s++) {
273
273
  const a = e.charCodeAt(s);
@@ -275,8 +275,8 @@ function Fs(e) {
275
275
  }
276
276
  return Math.abs(t);
277
277
  }
278
- function Bs(e) {
279
- const s = Fs(e) % Ot.length;
278
+ function Us(e) {
279
+ const s = Vs(e) % Ot.length;
280
280
  return Ot[s];
281
281
  }
282
282
  const ie = ({
@@ -288,7 +288,7 @@ const ie = ({
288
288
  shape: i = "squircle",
289
289
  dmAgentEnabled: o = !1
290
290
  }) => {
291
- const l = Bs(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
291
+ const l = Us(e), m = s < 32 ? "text-xs" : s < 56 ? "text-sm" : s < 120 ? "text-lg" : "text-4xl", g = s >= 40 ? 2 : 1, u = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, f = /* @__PURE__ */ n("div", { className: "h-full w-full overflow-hidden", style: u, children: t ? /* @__PURE__ */ n(
292
292
  "img",
293
293
  {
294
294
  src: t,
@@ -299,7 +299,7 @@ const ie = ({
299
299
  "div",
300
300
  {
301
301
  "aria-hidden": "true",
302
- className: N(
302
+ className: y(
303
303
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
304
304
  m
305
305
  ),
@@ -309,7 +309,7 @@ const ie = ({
309
309
  return /* @__PURE__ */ h(
310
310
  "div",
311
311
  {
312
- className: N(
312
+ className: y(
313
313
  "relative flex-shrink-0 !bg-transparent",
314
314
  a
315
315
  ),
@@ -324,14 +324,14 @@ const ie = ({
324
324
  {
325
325
  "aria-hidden": "true",
326
326
  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)]",
327
- children: /* @__PURE__ */ n(Be, { className: "size-3 text-yellow-600", weight: "duotone" })
327
+ children: /* @__PURE__ */ n(Ve, { className: "size-3 text-yellow-600", weight: "duotone" })
328
328
  }
329
329
  ),
330
330
  /* @__PURE__ */ n(
331
331
  "div",
332
332
  {
333
333
  "data-testid": "avatar-ring",
334
- className: N(
334
+ className: y(
335
335
  "h-full w-full",
336
336
  "bg-transparent"
337
337
  ),
@@ -350,7 +350,7 @@ const ie = ({
350
350
  ]
351
351
  }
352
352
  );
353
- }, Us = "https://linktr.ee/s/about/trust-center/report", js = ({
353
+ }, js = "https://linktr.ee/s/about/trust-center/report", Gs = ({
354
354
  channel: e,
355
355
  participant: t,
356
356
  showBlockParticipant: s = !0,
@@ -363,78 +363,78 @@ const ie = ({
363
363
  onActionComplete: m,
364
364
  logLabel: g = "useChannelModerationActions"
365
365
  }) => {
366
- var D;
367
- const { service: u, debug: f } = Xe(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, b = !!(a && s && u && c), [_, v] = $(!1), [p, x] = $(null), [A, M] = $(!1), [y, R] = $(!1), z = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
368
- return X(() => {
369
- if (!b || !u || !c) {
370
- v(!1), x(null);
366
+ var T;
367
+ const { service: u, debug: f } = Ke(), c = (T = t == null ? void 0 : t.user) == null ? void 0 : T.id, x = !!(a && s && u && c), [b, w] = z(!1), [v, p] = z(null), [A, R] = z(!1), [L, S] = z(!1), D = x && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== u);
368
+ return J(() => {
369
+ if (!x || !u || !c) {
370
+ w(!1), p(null);
371
371
  return;
372
372
  }
373
- let C = !1;
373
+ let k = !1;
374
374
  return (async () => {
375
375
  try {
376
376
  const I = await u.getBlockedUsers();
377
- if (C) return;
378
- v(
377
+ if (k) return;
378
+ w(
379
379
  I.some(
380
- (T) => T.blocked_user_id === c
380
+ (C) => C.blocked_user_id === c
381
381
  )
382
382
  );
383
383
  } catch (I) {
384
- C || console.error(`[${g}] Failed to check blocked status:`, I);
384
+ k || console.error(`[${g}] Failed to check blocked status:`, I);
385
385
  } finally {
386
- C || x({ participantId: c, service: u });
386
+ k || p({ participantId: c, service: u });
387
387
  }
388
388
  })(), () => {
389
- C = !0;
389
+ k = !0;
390
390
  };
391
- }, [b, u, c, g]), {
392
- isParticipantBlocked: _,
393
- isCheckingBlockedStatus: z,
391
+ }, [x, u, c, g]), {
392
+ isParticipantBlocked: b,
393
+ isCheckingBlockedStatus: D,
394
394
  isLeaving: A,
395
- isUpdatingBlockStatus: y,
395
+ isUpdatingBlockStatus: L,
396
396
  handleLeaveConversation: async () => {
397
- var C;
397
+ var k;
398
398
  if (!A) {
399
- o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), M(!0);
399
+ o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), R(!0);
400
400
  try {
401
- const I = ((C = e._client) == null ? void 0 : C.userID) ?? null;
401
+ const I = ((k = e._client) == null ? void 0 : k.userID) ?? null;
402
402
  await e.hide(I, !1), r && await r(e), m == null || m();
403
403
  } catch (I) {
404
404
  console.error(`[${g}] Failed to leave conversation`, I);
405
405
  } finally {
406
- M(!1);
406
+ R(!1);
407
407
  }
408
408
  }
409
409
  },
410
410
  handleBlockUser: async () => {
411
- var C, I, T;
412
- if (!(y || !u)) {
413
- l == null || l(), f && console.log(`[${g}] Block member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), R(!0);
411
+ var k, I, C;
412
+ if (!(L || !u)) {
413
+ l == null || l(), f && console.log(`[${g}] Block member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), S(!0);
414
414
  try {
415
- await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), m == null || m();
415
+ await u.blockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
416
416
  } catch (O) {
417
417
  console.error(`[${g}] Failed to block member`, O);
418
418
  } finally {
419
- R(!1);
419
+ S(!1);
420
420
  }
421
421
  }
422
422
  },
423
423
  handleUnblockUser: async () => {
424
- var C, I, T;
425
- if (!(y || !u)) {
426
- l == null || l(), f && console.log(`[${g}] Unblock member`, (C = t == null ? void 0 : t.user) == null ? void 0 : C.id), R(!0);
424
+ var k, I, C;
425
+ if (!(L || !u)) {
426
+ l == null || l(), f && console.log(`[${g}] Unblock member`, (k = t == null ? void 0 : t.user) == null ? void 0 : k.id), S(!0);
427
427
  try {
428
- await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), m == null || m();
428
+ await u.unBlockUser((I = t == null ? void 0 : t.user) == null ? void 0 : I.id), i && await i((C = t == null ? void 0 : t.user) == null ? void 0 : C.id), m == null || m();
429
429
  } catch (O) {
430
430
  console.error(`[${g}] Failed to unblock member`, O);
431
431
  } finally {
432
- R(!1);
432
+ S(!1);
433
433
  }
434
434
  }
435
435
  },
436
436
  handleReportUser: () => {
437
- d == null || d(), m == null || m(), window.open(Us, "_blank", "noopener,noreferrer");
437
+ d == null || d(), m == null || m(), window.open(js, "_blank", "noopener,noreferrer");
438
438
  }
439
439
  };
440
440
  }, ge = ({
@@ -446,7 +446,7 @@ const ie = ({
446
446
  "button",
447
447
  {
448
448
  type: "button",
449
- className: N(
449
+ className: y(
450
450
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
451
451
  e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
452
452
  t
@@ -454,7 +454,7 @@ const ie = ({
454
454
  ...a,
455
455
  children: s
456
456
  }
457
- ), Pt = ({
457
+ ), zt = ({
458
458
  channel: e,
459
459
  participant: t,
460
460
  showDeleteConversation: s = !0,
@@ -468,16 +468,16 @@ const ie = ({
468
468
  customChannelActions: g,
469
469
  triggerClassName: u
470
470
  }) => {
471
- const [f, c] = $(!1), b = G(null), _ = Sn(), v = K(() => c(!1), []), {
472
- isParticipantBlocked: p,
473
- isCheckingBlockedStatus: x,
471
+ const [f, c] = z(!1), x = H(null), b = In(), w = Z(() => c(!1), []), {
472
+ isParticipantBlocked: v,
473
+ isCheckingBlockedStatus: p,
474
474
  isLeaving: A,
475
- isUpdatingBlockStatus: M,
476
- handleLeaveConversation: y,
477
- handleBlockUser: R,
478
- handleUnblockUser: z,
475
+ isUpdatingBlockStatus: R,
476
+ handleLeaveConversation: L,
477
+ handleBlockUser: S,
478
+ handleUnblockUser: D,
479
479
  handleReportUser: P
480
- } = js({
480
+ } = Gs({
481
481
  channel: e,
482
482
  participant: t,
483
483
  showBlockParticipant: a,
@@ -487,20 +487,20 @@ const ie = ({
487
487
  onDeleteConversationClick: l,
488
488
  onBlockParticipantClick: d,
489
489
  onReportParticipantClick: m,
490
- onActionComplete: v,
490
+ onActionComplete: w,
491
491
  logLabel: "ChannelActionsMenu"
492
492
  });
493
- return X(() => {
493
+ return J(() => {
494
494
  if (!f) return;
495
- const E = (D) => {
496
- b.current && !b.current.contains(D.target) && c(!1);
497
- }, L = (D) => {
498
- D.key === "Escape" && c(!1);
495
+ const M = (T) => {
496
+ x.current && !x.current.contains(T.target) && c(!1);
497
+ }, N = (T) => {
498
+ T.key === "Escape" && c(!1);
499
499
  };
500
- return document.addEventListener("mousedown", E), document.addEventListener("keydown", L), () => {
501
- document.removeEventListener("mousedown", E), document.removeEventListener("keydown", L);
500
+ return document.addEventListener("mousedown", M), document.addEventListener("keydown", N), () => {
501
+ document.removeEventListener("mousedown", M), document.removeEventListener("keydown", N);
502
502
  };
503
- }, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
503
+ }, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: x, className: "relative", children: [
504
504
  /* @__PURE__ */ h(
505
505
  "button",
506
506
  {
@@ -508,10 +508,10 @@ const ie = ({
508
508
  type: "button",
509
509
  "aria-haspopup": "true",
510
510
  "aria-expanded": f,
511
- "aria-controls": f ? _ : void 0,
512
- onClick: () => c((E) => !E),
511
+ "aria-controls": f ? b : void 0,
512
+ onClick: () => c((M) => !M),
513
513
  children: [
514
- /* @__PURE__ */ n(hs, { className: "size-5 text-black/90" }),
514
+ /* @__PURE__ */ n(fs, { className: "size-5 text-black/90" }),
515
515
  /* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
516
516
  ]
517
517
  }
@@ -519,9 +519,9 @@ const ie = ({
519
519
  f && /* @__PURE__ */ n(
520
520
  "div",
521
521
  {
522
- id: _,
522
+ id: b,
523
523
  "aria-label": "Conversation options",
524
- className: N(
524
+ className: y(
525
525
  "absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
526
526
  "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
527
527
  ),
@@ -529,47 +529,47 @@ const ie = ({
529
529
  s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
530
530
  ge,
531
531
  {
532
- onClick: y,
532
+ onClick: L,
533
533
  disabled: A,
534
534
  "aria-busy": A,
535
535
  children: [
536
- A ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(fs, { className: "h-5 w-5" }),
536
+ A ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(gs, { className: "h-5 w-5" }),
537
537
  /* @__PURE__ */ n("span", { children: "Delete Conversation" })
538
538
  ]
539
539
  }
540
540
  ) }),
541
- a && /* @__PURE__ */ n("li", { children: x ? (
541
+ a && /* @__PURE__ */ n("li", { children: p ? (
542
542
  // Block status not yet resolved — show a disabled placeholder
543
543
  // so a premature click can't act on a stale block state.
544
544
  /* @__PURE__ */ h(ge, { disabled: !0, "aria-busy": !0, children: [
545
- /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }),
545
+ /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }),
546
546
  /* @__PURE__ */ n("span", { children: "Block" })
547
547
  ] })
548
- ) : p ? /* @__PURE__ */ h(
548
+ ) : v ? /* @__PURE__ */ h(
549
549
  ge,
550
550
  {
551
- onClick: z,
552
- disabled: M,
553
- "aria-busy": M,
551
+ onClick: D,
552
+ disabled: R,
553
+ "aria-busy": R,
554
554
  children: [
555
- M ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
555
+ R ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Lt, { className: "h-5 w-5" }),
556
556
  /* @__PURE__ */ n("span", { children: "Unblock" })
557
557
  ]
558
558
  }
559
559
  ) : /* @__PURE__ */ h(
560
560
  ge,
561
561
  {
562
- onClick: R,
563
- disabled: M,
564
- "aria-busy": M,
562
+ onClick: S,
563
+ disabled: R,
564
+ "aria-busy": R,
565
565
  children: [
566
- M ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
566
+ R ? /* @__PURE__ */ n(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Lt, { className: "h-5 w-5" }),
567
567
  /* @__PURE__ */ n("span", { children: "Block" })
568
568
  ]
569
569
  }
570
570
  ) }),
571
571
  r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick: P, children: [
572
- /* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
572
+ /* @__PURE__ */ n(Gt, { className: "h-5 w-5" }),
573
573
  /* @__PURE__ */ n("span", { children: "Report" })
574
574
  ] }) }),
575
575
  g
@@ -577,30 +577,30 @@ const ie = ({
577
577
  }
578
578
  )
579
579
  ] });
580
- }, Vs = (e) => /* @__PURE__ */ n(Mn, { ...e, position: "center" }), Ge = "vote_up", He = "vote_down";
581
- function Gs(e) {
582
- return e != null && e.length ? e.some((t) => t.type === He) ? "down" : e.some((t) => t.type === Ge) ? "up" : null : null;
580
+ }, Hs = (e) => /* @__PURE__ */ n(Rn, { ...e, position: "center" }), He = "vote_up", Ye = "vote_down";
581
+ function Ys(e) {
582
+ return e != null && e.length ? e.some((t) => t.type === Ye) ? "down" : e.some((t) => t.type === He) ? "up" : null : null;
583
583
  }
584
- function Hs(e) {
585
- const { channel: t } = ce(), { client: s } = We("useMessageVote"), a = se(
586
- () => Gs(e.own_reactions),
584
+ function qs(e) {
585
+ const { channel: t } = ce(), { client: s } = Xe("useMessageVote"), a = se(
586
+ () => Ys(e.own_reactions),
587
587
  [e.own_reactions]
588
- ), r = K(async () => {
588
+ ), r = Z(async () => {
589
589
  if (s != null && s.userID)
590
590
  try {
591
- a === "up" ? await t.deleteReaction(e.id, Ge) : await t.sendReaction(
591
+ a === "up" ? await t.deleteReaction(e.id, He) : await t.sendReaction(
592
592
  e.id,
593
- { type: Ge },
593
+ { type: He },
594
594
  { enforce_unique: !0, skip_push: !0 }
595
595
  );
596
596
  } catch {
597
597
  }
598
- }, [t, s == null ? void 0 : s.userID, e.id, a]), i = K(async () => {
598
+ }, [t, s == null ? void 0 : s.userID, e.id, a]), i = Z(async () => {
599
599
  if (s != null && s.userID)
600
600
  try {
601
- a === "down" ? await t.deleteReaction(e.id, He) : await t.sendReaction(
601
+ a === "down" ? await t.deleteReaction(e.id, Ye) : await t.sendReaction(
602
602
  e.id,
603
- { type: He },
603
+ { type: Ye },
604
604
  { enforce_unique: !0, skip_push: !0 }
605
605
  );
606
606
  } catch {
@@ -608,24 +608,24 @@ function Hs(e) {
608
608
  }, [t, s == null ? void 0 : s.userID, e.id, a]);
609
609
  return { selected: a, voteUp: r, voteDown: i };
610
610
  }
611
- function Ys(e) {
611
+ function Ws(e) {
612
612
  return (e == null ? void 0 : e.trim().toLowerCase().split(/[-_]/)[0]) || void 0;
613
613
  }
614
- function Kt({
614
+ function Jt({
615
615
  message: e,
616
616
  viewerLanguage: t
617
617
  }) {
618
618
  var r;
619
- const s = e == null ? void 0 : e.text, a = Ys(t);
619
+ const s = e == null ? void 0 : e.text, a = Ws(t);
620
620
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
621
621
  }
622
- const qs = j.lazy(() => import("./Card-XVTz8IYz.js")), Ws = j.lazy(() => import("./Card-CrTBu2I6.js")), Xs = j.lazy(() => import("./Card-BKd0E-B9.js")), Ke = () => /* @__PURE__ */ n(
622
+ const Xs = U.lazy(() => import("./Card-iekRe643.js")), Ks = U.lazy(() => import("./Card-CUHEDe8O.js")), Js = U.lazy(() => import("./Card-BNzC_bp8.js")), Je = () => /* @__PURE__ */ n(
623
623
  "div",
624
624
  {
625
625
  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)]",
626
626
  "aria-hidden": !0
627
627
  }
628
- ), Ks = (e) => /* @__PURE__ */ n(qe, { fallback: /* @__PURE__ */ n(Ke, {}), children: /* @__PURE__ */ n(qs, { ...e }) }), Jt = (e) => /* @__PURE__ */ n(qe, { fallback: /* @__PURE__ */ n(Ke, {}), children: /* @__PURE__ */ n(Ws, { ...e }) }), Zt = (e) => /* @__PURE__ */ n(qe, { fallback: /* @__PURE__ */ n(Ke, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Js = Jt, Zs = Zt, zt = { Composer: Ks, Sent: Jt, Received: Zt, Creator: Js, Visitor: Zs }, Qs = [
628
+ ), Zs = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Xs, { ...e }) }), Zt = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Ks, { ...e }) }), Qt = (e) => /* @__PURE__ */ n(We, { fallback: /* @__PURE__ */ n(Je, {}), children: /* @__PURE__ */ n(Js, { ...e }) }), Qs = Zt, ea = Qt, $t = { Composer: Zs, Sent: Zt, Received: Qt, Creator: Qs, Visitor: ea }, ta = [
629
629
  [/pdf/, "pdf"],
630
630
  [/wordprocessingml|msword|\.doc/, "doc"],
631
631
  [/spreadsheetml|ms-excel|\.xls/, "xls"],
@@ -638,39 +638,39 @@ const qs = j.lazy(() => import("./Card-XVTz8IYz.js")), Ws = j.lazy(() => import(
638
638
  function re(e) {
639
639
  return e.startsWith("video/") ? "video" : e.startsWith("audio/") ? "audio" : e.startsWith("image/") ? "image" : "document";
640
640
  }
641
- function Qt(e) {
642
- const t = Qs.find(
641
+ function en(e) {
642
+ const t = ta.find(
643
643
  ([s]) => s.test(e)
644
644
  );
645
645
  return t ? t[1] : "generic";
646
646
  }
647
- const ea = {
648
- video: Ht,
649
- audio: bs,
650
- image: gs,
651
- document: Gt
652
- }, ta = {
653
- pdf: Cs,
654
- doc: ys,
655
- xls: Ns,
656
- csv: _s,
657
- ppt: ws,
658
- zip: xs,
659
- text: vs,
660
- markdown: ps,
661
- generic: Gt
647
+ const na = {
648
+ video: Yt,
649
+ audio: ps,
650
+ image: bs,
651
+ document: Ht
652
+ }, sa = {
653
+ pdf: ks,
654
+ doc: Cs,
655
+ xls: ys,
656
+ csv: Ns,
657
+ ppt: _s,
658
+ zip: ws,
659
+ text: xs,
660
+ markdown: vs,
661
+ generic: Ht
662
662
  };
663
- function na(e) {
663
+ function aa(e) {
664
664
  const t = re(e);
665
- return t !== "document" ? ea[t] : ta[Qt(e)];
665
+ return t !== "document" ? na[t] : sa[en(e)];
666
666
  }
667
667
  function le(e, t) {
668
- return j.createElement(na(e), t);
668
+ return U.createElement(aa(e), t);
669
669
  }
670
- const sa = (e) => {
670
+ const ra = (e) => {
671
671
  var t, s;
672
672
  return "touches" in e ? ((t = e.touches[0]) == null ? void 0 : t.clientX) ?? ((s = e.changedTouches[0]) == null ? void 0 : s.clientX) ?? 0 : e.clientX;
673
- }, aa = ({
673
+ }, ia = ({
674
674
  source: e,
675
675
  mimeType: t,
676
676
  poster: s,
@@ -682,78 +682,78 @@ const sa = (e) => {
682
682
  muted: d = !1,
683
683
  onContainerClick: m
684
684
  }) => {
685
- const g = re(t), u = G(null), f = G(null), c = G(null), b = G(r), [_, v] = $(a), [p, x] = $(0), [A, M] = $(!1), [y, R] = $(!1), [z, P] = $(!1), [S, E] = $(!1), [L, D] = $(!0), [C, I] = $(null), T = K(() => {
686
- P(!1), v(!0);
687
- }, []), O = K((w) => {
688
- const k = f.current;
689
- if (!k) return 0;
690
- const B = k.getBoundingClientRect();
685
+ const g = re(t), u = H(null), f = H(null), c = H(null), x = H(r), [b, w] = z(a), [v, p] = z(0), [A, R] = z(!1), [L, S] = z(!1), [D, P] = z(!1), [B, M] = z(!1), [N, T] = z(!0), [k, I] = z(null), C = Z(() => {
686
+ P(!1), w(!0);
687
+ }, []), O = Z((_) => {
688
+ const E = f.current;
689
+ if (!E) return 0;
690
+ const F = E.getBoundingClientRect();
691
691
  return Math.max(
692
692
  0,
693
- Math.min(1, (sa(w) - B.left) / B.width)
693
+ Math.min(1, (ra(_) - F.left) / F.width)
694
694
  );
695
- }, []), F = K((w) => {
696
- const k = u.current;
697
- k && k.duration && (k.currentTime = w * k.duration);
698
- }, []), Y = (w) => {
699
- w.stopPropagation(), M(!0);
700
- const k = O(w);
701
- x(k), F(k);
695
+ }, []), $ = Z((_) => {
696
+ const E = u.current;
697
+ E && E.duration && (E.currentTime = _ * E.duration);
698
+ }, []), j = (_) => {
699
+ _.stopPropagation(), R(!0);
700
+ const E = O(_);
701
+ p(E), $(E);
702
702
  };
703
- X(() => {
704
- r !== void 0 && r !== b.current && (b.current = r, v(r));
705
- }, [r]), X(() => {
706
- if (!_) {
703
+ J(() => {
704
+ r !== void 0 && r !== x.current && (x.current = r, w(r));
705
+ }, [r]), J(() => {
706
+ if (!b) {
707
707
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
708
708
  return;
709
709
  }
710
- const w = () => {
711
- const k = u.current;
712
- k && k.duration && !A && x(k.currentTime / k.duration), c.current = requestAnimationFrame(w);
710
+ const _ = () => {
711
+ const E = u.current;
712
+ E && E.duration && !A && p(E.currentTime / E.duration), c.current = requestAnimationFrame(_);
713
713
  };
714
- return c.current = requestAnimationFrame(w), () => {
714
+ return c.current = requestAnimationFrame(_), () => {
715
715
  c.current !== null && cancelAnimationFrame(c.current);
716
716
  };
717
- }, [_, A]), X(() => {
718
- const w = u.current;
719
- w && (_ ? w.play().catch((k) => {
720
- v(!1), P(!0);
721
- }) : w.pause());
722
- }, [_]), X(() => {
717
+ }, [b, A]), J(() => {
718
+ const _ = u.current;
719
+ _ && (b ? _.play().catch((E) => {
720
+ w(!1), P(!0);
721
+ }) : _.pause());
722
+ }, [b]), J(() => {
723
723
  if (!A) return;
724
- const w = (B) => x(O(B)), k = (B) => {
725
- M(!1), F(O(B));
724
+ const _ = (F) => p(O(F)), E = (F) => {
725
+ R(!1), $(O(F));
726
726
  };
727
- return window.addEventListener("mousemove", w), window.addEventListener("mouseup", k), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", k), () => {
728
- window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", k);
727
+ return window.addEventListener("mousemove", _), window.addEventListener("mouseup", E), window.addEventListener("touchmove", _, { passive: !0 }), window.addEventListener("touchend", E), () => {
728
+ window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", E), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", E);
729
729
  };
730
- }, [A, O, F]);
731
- const Z = C ? { aspectRatio: String(C) } : void 0, J = C ? "" : " aspect-video", U = Math.round(p * 100);
730
+ }, [A, O, $]);
731
+ const X = k ? { aspectRatio: String(k) } : void 0, K = k ? "" : " aspect-video", V = Math.round(v * 100);
732
732
  return /* @__PURE__ */ h(
733
733
  "div",
734
734
  {
735
735
  role: "button",
736
736
  tabIndex: 0,
737
- className: `relative cursor-pointer overflow-hidden bg-black ${J}`,
738
- style: Z,
739
- onClick: (w) => {
737
+ className: `relative cursor-pointer overflow-hidden bg-black ${K}`,
738
+ style: X,
739
+ onClick: (_) => {
740
740
  if (m) {
741
- m(w);
741
+ m(_);
742
742
  return;
743
743
  }
744
- z || o && v((k) => !k);
744
+ D || o && w((E) => !E);
745
745
  },
746
- onKeyDown: (w) => {
747
- if (!(w.key !== "Enter" && w.key !== " ")) {
748
- if (w.preventDefault(), m) {
749
- m(w);
746
+ onKeyDown: (_) => {
747
+ if (!(_.key !== "Enter" && _.key !== " ")) {
748
+ if (_.preventDefault(), m) {
749
+ m(_);
750
750
  return;
751
751
  }
752
- z || o && v((k) => !k);
752
+ D || o && w((E) => !E);
753
753
  }
754
754
  },
755
755
  children: [
756
- s && (g === "audio" || L) && /* @__PURE__ */ n(
756
+ s && (g === "audio" || N) && /* @__PURE__ */ n(
757
757
  "img",
758
758
  {
759
759
  src: s,
@@ -761,7 +761,7 @@ const sa = (e) => {
761
761
  className: "absolute inset-0 h-full w-full object-cover"
762
762
  }
763
763
  ),
764
- !s && (g === "audio" || L) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
764
+ !s && (g === "audio" || N) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: le(t, {
765
765
  className: "size-12 text-black/20",
766
766
  weight: "regular"
767
767
  }) }),
@@ -773,14 +773,14 @@ const sa = (e) => {
773
773
  loop: i,
774
774
  muted: d,
775
775
  style: { width: "100%", height: "100%" },
776
- onLoadStart: () => E(!0),
776
+ onLoadStart: () => M(!0),
777
777
  onCanPlay: () => {
778
- E(!1), D(!1);
778
+ M(!1), T(!1);
779
779
  },
780
- onWaiting: () => E(!0),
780
+ onWaiting: () => M(!0),
781
781
  onPlay: () => P(!1),
782
782
  onEnded: () => {
783
- i || (v(!1), x(0));
783
+ i || (w(!1), p(0));
784
784
  },
785
785
  children: /* @__PURE__ */ n("track", { kind: "captions" })
786
786
  }
@@ -793,41 +793,41 @@ const sa = (e) => {
793
793
  muted: d,
794
794
  playsInline: !0,
795
795
  style: { width: "100%", height: "100%" },
796
- onLoadStart: () => E(!0),
796
+ onLoadStart: () => M(!0),
797
797
  onCanPlay: () => {
798
- E(!1), D(!1);
798
+ M(!1), T(!1);
799
799
  },
800
- onWaiting: () => E(!0),
800
+ onWaiting: () => M(!0),
801
801
  onPlay: () => P(!1),
802
802
  onLoadedMetadata: () => {
803
- const w = u.current;
804
- w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && I(w.videoWidth / w.videoHeight);
803
+ const _ = u.current;
804
+ _ instanceof HTMLVideoElement && _.videoWidth && _.videoHeight && I(_.videoWidth / _.videoHeight);
805
805
  },
806
806
  onEnded: () => {
807
- i || (v(!1), x(0));
807
+ i || (w(!1), p(0));
808
808
  },
809
809
  children: /* @__PURE__ */ n("track", { kind: "captions" })
810
810
  }
811
811
  ) }),
812
- S && !z && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
813
- pe,
812
+ B && !D && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
813
+ ve,
814
814
  {
815
815
  className: "size-8 animate-spin text-white/80",
816
816
  weight: "bold"
817
817
  }
818
818
  ) }),
819
- z && !o && /* @__PURE__ */ n(
819
+ D && !o && /* @__PURE__ */ n(
820
820
  "div",
821
821
  {
822
822
  className: "absolute inset-0 z-30 flex cursor-pointer items-center justify-center bg-black/35",
823
823
  role: "button",
824
824
  tabIndex: 0,
825
825
  "aria-label": "Play preview",
826
- onClick: (w) => {
827
- w.stopPropagation(), T();
826
+ onClick: (_) => {
827
+ _.stopPropagation(), C();
828
828
  },
829
- onKeyDown: (w) => {
830
- w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), T());
829
+ onKeyDown: (_) => {
830
+ _.key !== "Enter" && _.key !== " " || (_.preventDefault(), _.stopPropagation(), C());
831
831
  },
832
832
  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(Ue, { className: "size-9 translate-x-0.5", weight: "fill" }) })
833
833
  }
@@ -837,23 +837,23 @@ const sa = (e) => {
837
837
  {
838
838
  role: "slider",
839
839
  "aria-label": "Playback position",
840
- "aria-valuenow": U,
840
+ "aria-valuenow": V,
841
841
  "aria-valuemin": 0,
842
842
  "aria-valuemax": 100,
843
843
  tabIndex: 0,
844
844
  ref: f,
845
845
  className: "relative flex h-4 w-full cursor-pointer items-center",
846
- onMouseDown: Y,
847
- onTouchStart: Y,
848
- onClick: (w) => w.stopPropagation(),
849
- onKeyDown: (w) => {
850
- w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
846
+ onMouseDown: j,
847
+ onTouchStart: j,
848
+ onClick: (_) => _.stopPropagation(),
849
+ onKeyDown: (_) => {
850
+ _.key === "ArrowRight" && $(Math.min(1, v + 0.05)), _.key === "ArrowLeft" && $(Math.max(0, v - 0.05));
851
851
  },
852
852
  children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
853
853
  "div",
854
854
  {
855
855
  className: "h-full rounded-full bg-white",
856
- style: { width: `${U}%` }
856
+ style: { width: `${V}%` }
857
857
  }
858
858
  ) })
859
859
  }
@@ -863,12 +863,12 @@ const sa = (e) => {
863
863
  "button",
864
864
  {
865
865
  type: "button",
866
- onClick: (w) => {
867
- w.stopPropagation(), v((k) => !k);
866
+ onClick: (_) => {
867
+ _.stopPropagation(), w((E) => !E);
868
868
  },
869
869
  className: "shrink-0 text-white",
870
- "aria-label": _ ? "Pause" : "Play",
871
- children: _ ? /* @__PURE__ */ n(ks, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ue, { className: "size-5 translate-x-px", weight: "fill" })
870
+ "aria-label": b ? "Pause" : "Play",
871
+ children: b ? /* @__PURE__ */ n(Es, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ue, { className: "size-5 translate-x-px", weight: "fill" })
872
872
  }
873
873
  ),
874
874
  /* @__PURE__ */ h(
@@ -876,30 +876,30 @@ const sa = (e) => {
876
876
  {
877
877
  role: "slider",
878
878
  "aria-label": "Playback position",
879
- "aria-valuenow": U,
879
+ "aria-valuenow": V,
880
880
  "aria-valuemin": 0,
881
881
  "aria-valuemax": 100,
882
882
  tabIndex: 0,
883
883
  ref: f,
884
884
  className: "relative flex h-4 w-full cursor-pointer items-center",
885
- onMouseDown: Y,
886
- onTouchStart: Y,
887
- onClick: (w) => w.stopPropagation(),
888
- onMouseEnter: () => R(!0),
889
- onMouseLeave: () => R(!1),
890
- onKeyDown: (w) => {
891
- w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
885
+ onMouseDown: j,
886
+ onTouchStart: j,
887
+ onClick: (_) => _.stopPropagation(),
888
+ onMouseEnter: () => S(!0),
889
+ onMouseLeave: () => S(!1),
890
+ onKeyDown: (_) => {
891
+ _.key === "ArrowRight" && $(Math.min(1, v + 0.05)), _.key === "ArrowLeft" && $(Math.max(0, v - 0.05));
892
892
  },
893
893
  children: [
894
894
  /* @__PURE__ */ n(
895
895
  "div",
896
896
  {
897
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${y || A ? "h-1.5" : "h-1"}`,
897
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${L || A ? "h-1.5" : "h-1"}`,
898
898
  children: /* @__PURE__ */ n(
899
899
  "div",
900
900
  {
901
901
  className: "h-full rounded-full bg-white",
902
- style: { width: `${U}%` }
902
+ style: { width: `${V}%` }
903
903
  }
904
904
  )
905
905
  }
@@ -907,8 +907,8 @@ const sa = (e) => {
907
907
  /* @__PURE__ */ n(
908
908
  "div",
909
909
  {
910
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${y || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
911
- style: { left: `${U}%` }
910
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${L || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
911
+ style: { left: `${V}%` }
912
912
  }
913
913
  )
914
914
  ]
@@ -918,7 +918,7 @@ const sa = (e) => {
918
918
  ]
919
919
  }
920
920
  );
921
- }, $t = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", ra = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", en = ({
921
+ }, Ft = (e) => e === "dark" ? "size-12 text-white/20" : "size-12 text-black/20", oa = (e) => e === "dark" ? "aspect-video overflow-hidden bg-white/10" : "aspect-video overflow-hidden bg-black/5", tn = ({
922
922
  mimeType: e,
923
923
  sourceUrl: t,
924
924
  thumbnailUrl: s,
@@ -927,9 +927,9 @@ const sa = (e) => {
927
927
  mediaPlayerProps: i,
928
928
  containedImage: o = !1
929
929
  }) => {
930
- const l = re(e), [d, m] = $(!1);
930
+ const l = re(e), [d, m] = z(!1);
931
931
  return t && (l === "video" || l === "audio") ? /* @__PURE__ */ n(
932
- aa,
932
+ ia,
933
933
  {
934
934
  source: t,
935
935
  mimeType: e,
@@ -976,11 +976,11 @@ const sa = (e) => {
976
976
  {
977
977
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
978
978
  children: le(e, {
979
- className: $t(r),
979
+ className: Ft(r),
980
980
  weight: "regular"
981
981
  })
982
982
  }
983
- ) : s ? /* @__PURE__ */ n("div", { className: `relative ${ra(r)}`, children: /* @__PURE__ */ n(
983
+ ) : s ? /* @__PURE__ */ n("div", { className: `relative ${oa(r)}`, children: /* @__PURE__ */ n(
984
984
  "img",
985
985
  {
986
986
  src: s,
@@ -993,12 +993,12 @@ const sa = (e) => {
993
993
  {
994
994
  className: `flex aspect-video w-full items-center justify-center ${r === "dark" ? "bg-white/10" : "bg-black/5"}`,
995
995
  children: le(e, {
996
- className: $t(r),
996
+ className: Ft(r),
997
997
  weight: "regular"
998
998
  })
999
999
  }
1000
1000
  );
1001
- }, tn = ({
1001
+ }, nn = ({
1002
1002
  variant: e,
1003
1003
  thumbnail: t,
1004
1004
  title: s,
@@ -1012,13 +1012,13 @@ const sa = (e) => {
1012
1012
  rootRef: g,
1013
1013
  "data-testid": u
1014
1014
  }) => {
1015
- const f = e === "dark", c = f ? s ?? a : s ?? "", b = f && !s;
1015
+ const f = e === "dark", c = f ? s ?? a : s ?? "", x = f && !s;
1016
1016
  return /* @__PURE__ */ h(
1017
1017
  "div",
1018
1018
  {
1019
1019
  ref: g,
1020
1020
  "data-testid": u,
1021
- className: N(
1021
+ className: y(
1022
1022
  "relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
1023
1023
  f ? "bg-[#121110]" : "bg-white"
1024
1024
  ),
@@ -1030,17 +1030,17 @@ const sa = (e) => {
1030
1030
  c.trim() !== "" && /* @__PURE__ */ n(
1031
1031
  "p",
1032
1032
  {
1033
- className: N("mb-0.5 truncate text-base font-medium", {
1033
+ className: y("mb-0.5 truncate text-base font-medium", {
1034
1034
  "text-black": !f,
1035
- "text-white/30": f && b,
1036
- "text-white": f && !b
1035
+ "text-white/30": f && x,
1036
+ "text-white": f && !x
1037
1037
  }),
1038
1038
  children: c
1039
1039
  }
1040
1040
  ),
1041
1041
  /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
1042
1042
  le(r, {
1043
- className: N(
1043
+ className: y(
1044
1044
  "size-5 shrink-0",
1045
1045
  f ? "text-white/55" : "text-black/55"
1046
1046
  ),
@@ -1049,7 +1049,7 @@ const sa = (e) => {
1049
1049
  i != null && i !== "" && /* @__PURE__ */ n(
1050
1050
  "span",
1051
1051
  {
1052
- className: N(
1052
+ className: y(
1053
1053
  "text-xs font-medium",
1054
1054
  f ? "text-white/55" : "text-black/55"
1055
1055
  ),
@@ -1064,29 +1064,29 @@ const sa = (e) => {
1064
1064
  }
1065
1065
  );
1066
1066
  };
1067
- function nn(e) {
1067
+ function sn(e) {
1068
1068
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
1069
1069
  }
1070
- function Je(e) {
1070
+ function Ze(e) {
1071
1071
  return `w-[280px] select-none overflow-hidden rounded-[24px] ${e ? "bg-[#121110]" : "bg-[#F3F3F1]"} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`;
1072
1072
  }
1073
- function ia(e) {
1073
+ function la(e) {
1074
1074
  return e ? "bg-white/10" : "bg-black/5";
1075
1075
  }
1076
- function oa(e) {
1076
+ function ca(e) {
1077
1077
  return e ? "text-white" : "text-black";
1078
1078
  }
1079
- function la(e) {
1079
+ function da(e) {
1080
1080
  return e ? "text-white/55" : "text-black/55";
1081
1081
  }
1082
- function ca(e) {
1082
+ function ua(e) {
1083
1083
  return e ? "text-white/40" : "text-black/40";
1084
1084
  }
1085
- function da(e) {
1085
+ function ma(e) {
1086
1086
  return e ? "text-white/20" : "text-black/20";
1087
1087
  }
1088
- const Ze = ({ attachment: e, isMyMessage: t }) => {
1089
- 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, m = /* @__PURE__ */ h(j.Fragment, { children: [
1088
+ const Qe = ({ attachment: e, isMyMessage: t }) => {
1089
+ 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, m = /* @__PURE__ */ h(U.Fragment, { children: [
1090
1090
  /* @__PURE__ */ n("div", { className: "p-2", children: r ? /* @__PURE__ */ n(
1091
1091
  "img",
1092
1092
  {
@@ -1097,26 +1097,26 @@ const Ze = ({ attachment: e, isMyMessage: t }) => {
1097
1097
  ) : /* @__PURE__ */ n(
1098
1098
  "div",
1099
1099
  {
1100
- className: `aspect-video w-full rounded-[20px] ${ia(t)} flex items-center justify-center`,
1101
- children: /* @__PURE__ */ n(Es, { className: `size-12 ${da(t)}` })
1100
+ className: `aspect-video w-full rounded-[20px] ${la(t)} flex items-center justify-center`,
1101
+ children: /* @__PURE__ */ n(Ss, { className: `size-12 ${ma(t)}` })
1102
1102
  }
1103
1103
  ) }),
1104
1104
  /* @__PURE__ */ h("div", { className: "px-3 pb-3", children: [
1105
- s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${oa(t)}`, children: s }),
1106
- a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${la(t)}`, children: a }),
1107
- d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ca(t)}`, children: d })
1105
+ s && /* @__PURE__ */ n("p", { className: `truncate text-[14px] font-medium leading-5 ${ca(t)}`, children: s }),
1106
+ a && /* @__PURE__ */ n("p", { className: `truncate text-[12px] leading-4 ${da(t)}`, children: a }),
1107
+ d && /* @__PURE__ */ n("p", { className: `mt-1 truncate text-[12px] leading-4 ${ua(t)}`, children: d })
1108
1108
  ] })
1109
1109
  ] });
1110
1110
  return d ? /* @__PURE__ */ n("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ n("div", { className: "block", children: m });
1111
1111
  };
1112
- function sn(e) {
1112
+ function an(e) {
1113
1113
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
1114
1114
  }
1115
- function Qe(e) {
1115
+ function et(e) {
1116
1116
  var t;
1117
- return (t = e.attachments) == null ? void 0 : t.find(sn);
1117
+ return (t = e.attachments) == null ? void 0 : t.find(an);
1118
1118
  }
1119
- async function ua(e, t) {
1119
+ async function ha(e, t) {
1120
1120
  let s;
1121
1121
  try {
1122
1122
  s = t ?? new URL(e).pathname.split("/").pop() ?? "download";
@@ -1128,11 +1128,11 @@ async function ua(e, t) {
1128
1128
  const r = await a.blob(), i = URL.createObjectURL(r), o = document.createElement("a");
1129
1129
  o.href = i, o.download = s, o.style.display = "none", document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(i);
1130
1130
  }
1131
- const ma = ({
1131
+ const fa = ({
1132
1132
  url: e,
1133
1133
  filename: t
1134
1134
  }) => {
1135
- const [s, a] = $(!1);
1135
+ const [s, a] = z(!1);
1136
1136
  return /* @__PURE__ */ n(
1137
1137
  "button",
1138
1138
  {
@@ -1140,7 +1140,7 @@ const ma = ({
1140
1140
  onClick: (i) => {
1141
1141
  i.stopPropagation();
1142
1142
  const o = window.open("", "_blank", "noopener,noreferrer");
1143
- a(!0), ua(e, t).then(() => {
1143
+ a(!0), ha(e, t).then(() => {
1144
1144
  o == null || o.close();
1145
1145
  }).catch(() => {
1146
1146
  o && (o.location.href = e);
@@ -1148,23 +1148,23 @@ const ma = ({
1148
1148
  },
1149
1149
  disabled: s,
1150
1150
  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",
1151
- children: s ? /* @__PURE__ */ n(pe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(j.Fragment, { children: [
1152
- /* @__PURE__ */ n(ve, { className: "size-4 text-white", weight: "bold" }),
1151
+ children: s ? /* @__PURE__ */ n(ve, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ h(U.Fragment, { children: [
1152
+ /* @__PURE__ */ n(xe, { className: "size-4 text-white", weight: "bold" }),
1153
1153
  "Download"
1154
1154
  ] })
1155
1155
  }
1156
1156
  );
1157
1157
  };
1158
- function et(e) {
1159
- var u, f, c, b;
1158
+ function tt(e) {
1159
+ var u, f, c, x;
1160
1160
  const t = (u = e.attachments) == null ? void 0 : u.find(
1161
- (_) => _.type === "video" && _.asset_url
1161
+ (b) => b.type === "video" && b.asset_url
1162
1162
  ), s = (f = e.attachments) == null ? void 0 : f.find(
1163
- (_) => _.type === "image" && _.image_url
1163
+ (b) => b.type === "image" && b.image_url
1164
1164
  ), a = (c = e.attachments) == null ? void 0 : c.find(
1165
- (_) => _.type === "audio" && _.asset_url
1166
- ), r = (b = e.attachments) == null ? void 0 : b.find(
1167
- (_) => _.type === "file" && _.asset_url
1165
+ (b) => b.type === "audio" && b.asset_url
1166
+ ), r = (x = e.attachments) == null ? void 0 : x.find(
1167
+ (b) => b.type === "file" && b.asset_url
1168
1168
  ), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
1169
1169
  if (!o) return null;
1170
1170
  const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
@@ -1176,16 +1176,16 @@ function et(e) {
1176
1176
  thumbnailUrl: g
1177
1177
  };
1178
1178
  }
1179
- const an = ({
1179
+ const rn = ({
1180
1180
  resolvedUrl: e,
1181
1181
  resolvedType: t,
1182
1182
  title: s,
1183
1183
  fileSize: a,
1184
1184
  thumbnailUrl: r
1185
1185
  }) => {
1186
- const i = a !== void 0 ? nn(a) : void 0;
1186
+ const i = a !== void 0 ? sn(a) : void 0;
1187
1187
  return /* @__PURE__ */ n(
1188
- tn,
1188
+ nn,
1189
1189
  {
1190
1190
  variant: "dark",
1191
1191
  title: s,
@@ -1193,7 +1193,7 @@ const an = ({
1193
1193
  mimeType: t,
1194
1194
  detail: i,
1195
1195
  thumbnail: /* @__PURE__ */ n(
1196
- en,
1196
+ tn,
1197
1197
  {
1198
1198
  mimeType: t,
1199
1199
  sourceUrl: e,
@@ -1204,23 +1204,23 @@ const an = ({
1204
1204
  )
1205
1205
  }
1206
1206
  );
1207
- }, rn = ({
1207
+ }, on = ({
1208
1208
  resolvedUrl: e,
1209
1209
  resolvedType: t,
1210
1210
  title: s,
1211
1211
  fileSize: a,
1212
1212
  thumbnailUrl: r
1213
1213
  }) => {
1214
- const i = re(t), o = a !== void 0 ? nn(a) : void 0;
1214
+ const i = re(t), o = a !== void 0 ? sn(a) : void 0;
1215
1215
  return /* @__PURE__ */ n(
1216
- tn,
1216
+ nn,
1217
1217
  {
1218
1218
  variant: "light",
1219
1219
  title: s,
1220
1220
  mimeType: t,
1221
1221
  detail: o,
1222
1222
  thumbnail: /* @__PURE__ */ n(
1223
- en,
1223
+ tn,
1224
1224
  {
1225
1225
  mimeType: t,
1226
1226
  sourceUrl: e,
@@ -1230,14 +1230,14 @@ const an = ({
1230
1230
  containedImage: i === "image" || i === "document"
1231
1231
  }
1232
1232
  ),
1233
- action: /* @__PURE__ */ n(ma, { url: e, filename: s })
1233
+ action: /* @__PURE__ */ n(fa, { url: e, filename: s })
1234
1234
  }
1235
1235
  );
1236
- }, ha = ({
1236
+ }, ga = ({
1237
1237
  message: e,
1238
1238
  isMyMessage: t = !1
1239
1239
  }) => {
1240
- const s = Qe(e), a = et(e);
1240
+ const s = et(e), a = tt(e);
1241
1241
  return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
1242
1242
  !t && e.user && /* @__PURE__ */ n(
1243
1243
  ie,
@@ -1258,40 +1258,40 @@ const an = ({
1258
1258
  {
1259
1259
  className: "str-chat__message-bubble",
1260
1260
  style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
1261
- children: s ? /* @__PURE__ */ n("div", { className: Je(t), children: /* @__PURE__ */ n(Ze, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(an, { ...a }) : /* @__PURE__ */ n(rn, { ...a })
1261
+ children: s ? /* @__PURE__ */ n("div", { className: Ze(t), children: /* @__PURE__ */ n(Qe, { attachment: s, isMyMessage: t }) }) : t ? /* @__PURE__ */ n(rn, { ...a }) : /* @__PURE__ */ n(on, { ...a })
1262
1262
  }
1263
1263
  ) })
1264
1264
  }
1265
1265
  )
1266
1266
  ] });
1267
- }, fa = ({
1267
+ }, ba = ({
1268
1268
  message: e
1269
1269
  }) => {
1270
- const t = Qe(e);
1270
+ const t = et(e);
1271
1271
  if (t)
1272
- return /* @__PURE__ */ n("div", { className: Je(!0), children: /* @__PURE__ */ n(Ze, { attachment: t, isMyMessage: !0 }) });
1273
- const s = et(e);
1274
- return s ? /* @__PURE__ */ n(an, { ...s }) : null;
1275
- }, ga = ({
1272
+ return /* @__PURE__ */ n("div", { className: Ze(!0), children: /* @__PURE__ */ n(Qe, { attachment: t, isMyMessage: !0 }) });
1273
+ const s = tt(e);
1274
+ return s ? /* @__PURE__ */ n(rn, { ...s }) : null;
1275
+ }, pa = ({
1276
1276
  message: e
1277
1277
  }) => {
1278
- const t = Qe(e);
1278
+ const t = et(e);
1279
1279
  if (t)
1280
- return /* @__PURE__ */ n("div", { className: Je(!1), children: /* @__PURE__ */ n(Ze, { attachment: t, isMyMessage: !1 }) });
1281
- const s = et(e);
1282
- return s ? /* @__PURE__ */ n(rn, { ...s }) : null;
1283
- }, yi = Object.assign(ha, {
1284
- Creator: fa,
1285
- Visitor: ga
1286
- }), ba = {
1280
+ return /* @__PURE__ */ n("div", { className: Ze(!1), children: /* @__PURE__ */ n(Qe, { attachment: t, isMyMessage: !1 }) });
1281
+ const s = tt(e);
1282
+ return s ? /* @__PURE__ */ n(on, { ...s }) : null;
1283
+ }, ki = Object.assign(ga, {
1284
+ Creator: ba,
1285
+ Visitor: pa
1286
+ }), va = {
1287
1287
  isUnlocking: () => !1
1288
- }, pa = {
1289
- LockedAttachment: ba
1290
- }, on = Ye({}), Ci = on.Provider;
1291
- function va(e) {
1292
- return Ae(on)[e] ?? pa[e];
1288
+ }, xa = {
1289
+ LockedAttachment: va
1290
+ }, ln = qe({}), Ei = ln.Provider;
1291
+ function wa(e) {
1292
+ return Me(ln)[e] ?? xa[e];
1293
1293
  }
1294
- const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1294
+ const _a = ({ size: e = 15 }) => /* @__PURE__ */ n(
1295
1295
  "svg",
1296
1296
  {
1297
1297
  width: e,
@@ -1308,45 +1308,45 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1308
1308
  }
1309
1309
  )
1310
1310
  }
1311
- ), wa = (e) => {
1311
+ ), Na = (e) => {
1312
1312
  var t;
1313
1313
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_TIP";
1314
- }, _a = (e) => {
1314
+ }, ya = (e) => {
1315
1315
  var t;
1316
1316
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_PAID";
1317
- }, Ee = (e) => {
1317
+ }, Se = (e) => {
1318
1318
  var t;
1319
1319
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_CHATBOT";
1320
- }, Na = (e) => {
1320
+ }, Ca = (e) => {
1321
1321
  var t;
1322
1322
  return ((t = e.metadata) == null ? void 0 : t.custom_type) === "MESSAGE_ATTACHMENT";
1323
- }, ln = (e) => wa(e) || _a(e), ya = (e) => {
1323
+ }, cn = (e) => Na(e) || ya(e), ka = (e) => {
1324
1324
  var t;
1325
- return ln(e) && !((t = e.text) != null && t.trim());
1326
- }, Pe = ({
1325
+ return cn(e) && !((t = e.text) != null && t.trim());
1326
+ }, ze = ({
1327
1327
  message: e,
1328
1328
  standalone: t = !1,
1329
1329
  isMyMessage: s = !1,
1330
1330
  hasAttachment: a = !1
1331
1331
  }) => {
1332
1332
  var u;
1333
- const r = ln(e), i = Ee(e);
1333
+ const r = cn(e), i = Se(e);
1334
1334
  if (!r && !i)
1335
1335
  return null;
1336
1336
  if (r) {
1337
1337
  const f = (u = e.metadata) == null ? void 0 : u.amount_text;
1338
1338
  if (!f) return null;
1339
- const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", b = t ? `${f} tip` : `Delivered with ${f} tip`;
1339
+ const c = t ? "message-tip-standalone" : "message-tag message-tag--tip", x = t ? `${f} tip` : `Delivered with ${f} tip`;
1340
1340
  return /* @__PURE__ */ h("div", { className: c, children: [
1341
- /* @__PURE__ */ n(Ss, { size: t ? 14 : 12 }),
1342
- /* @__PURE__ */ n("span", { children: b })
1341
+ /* @__PURE__ */ n(Is, { size: t ? 14 : 12 }),
1342
+ /* @__PURE__ */ n("span", { children: x })
1343
1343
  ] });
1344
1344
  }
1345
1345
  const o = s && a, l = o ? "Sent with AI" : "Sent by AI Assistant", d = [
1346
1346
  "message-chatbot-indicator",
1347
1347
  s ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
1348
1348
  o ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
1349
- ].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(xa, { size: o ? 12 : 15 }) });
1349
+ ].join(" "), m = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__label", children: l }), g = /* @__PURE__ */ n("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ n(_a, { size: o ? 12 : 15 }) });
1350
1350
  return /* @__PURE__ */ n("div", { className: d, "data-testid": "message-chatbot-indicator", children: s && !o ? /* @__PURE__ */ h(ae, { children: [
1351
1351
  m,
1352
1352
  g
@@ -1354,7 +1354,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1354
1354
  g,
1355
1355
  m
1356
1356
  ] }) });
1357
- }, Ca = ({
1357
+ }, Ea = ({
1358
1358
  selected: e,
1359
1359
  onVoteUp: t,
1360
1360
  onVoteDown: s
@@ -1363,32 +1363,32 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1363
1363
  "button",
1364
1364
  {
1365
1365
  type: "button",
1366
- className: N("message-vote-button focus-ring", {
1366
+ className: y("message-vote-button focus-ring", {
1367
1367
  "message-vote-button--selected": e === "up"
1368
1368
  }),
1369
1369
  onClick: t,
1370
1370
  "aria-label": "Good response",
1371
1371
  "aria-pressed": e === "up",
1372
1372
  "data-tooltip": "Good response",
1373
- children: /* @__PURE__ */ n(Is, { size: 16, weight: e === "up" ? "fill" : "regular" })
1373
+ children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "up" ? "fill" : "regular" })
1374
1374
  }
1375
1375
  ),
1376
1376
  /* @__PURE__ */ n(
1377
1377
  "button",
1378
1378
  {
1379
1379
  type: "button",
1380
- className: N("message-vote-button focus-ring", {
1380
+ className: y("message-vote-button focus-ring", {
1381
1381
  "message-vote-button--selected": e === "down"
1382
1382
  }),
1383
1383
  onClick: s,
1384
1384
  "aria-label": "Bad response",
1385
1385
  "aria-pressed": e === "down",
1386
1386
  "data-tooltip": "Bad response",
1387
- children: /* @__PURE__ */ n(Ts, { size: 16, weight: e === "down" ? "fill" : "regular" })
1387
+ children: /* @__PURE__ */ n(As, { size: 16, weight: e === "down" ? "fill" : "regular" })
1388
1388
  }
1389
1389
  )
1390
- ] }), ka = (e) => {
1391
- var ft, gt, bt, pt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et, St;
1390
+ ] }), Sa = (e) => {
1391
+ var gt, bt, pt, vt, xt, wt, _t, Nt, yt, Ct, kt, Et, St, It;
1392
1392
  const {
1393
1393
  additionalMessageInputProps: t,
1394
1394
  chatbotVotingEnabled: s,
@@ -1403,60 +1403,60 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1403
1403
  isMessageAIGenerated: u,
1404
1404
  isMyMessage: f,
1405
1405
  message: c,
1406
- renderText: b,
1407
- threadList: _,
1408
- viewerLanguage: v
1409
- } = e, { client: p } = We("CustomMessage"), { channel: x } = ce("CustomMessage"), { isUnlocking: A, onUnlockClick: M, onFetchSource: y, onDownloadClick: R } = va("LockedAttachment"), [z, P] = $(!1), S = Ln(c.id), { selected: E, voteUp: L, voteDown: D } = Hs(c), {
1410
- Attachment: C = Dn,
1406
+ renderText: x,
1407
+ threadList: b,
1408
+ viewerLanguage: w
1409
+ } = e, { client: v } = Xe("CustomMessage"), { channel: p } = ce("CustomMessage"), { isUnlocking: A, onUnlockClick: R, onFetchSource: L, onDownloadClick: S } = wa("LockedAttachment"), [D, P] = z(!1), B = Dn(c.id), { selected: M, voteUp: N, voteDown: T } = qs(c), {
1410
+ Attachment: k = Pn,
1411
1411
  EditMessageModal: I = On,
1412
- MessageActions: T,
1413
- MessageBlocked: O = Pn,
1414
- MessageBouncePrompt: F = zn,
1415
- MessageDeleted: Y = $n,
1416
- MessageIsThreadReplyInChannelButtonIndicator: Z = Fn,
1417
- MessageRepliesCountButton: J = Bn,
1418
- ReminderNotification: U = Un,
1419
- StreamedMessageText: w = jn,
1420
- PinIndicator: k
1421
- } = jt("CustomMessage"), B = Vn(c), q = Gn(c), H = se(
1412
+ MessageActions: C,
1413
+ MessageBlocked: O = zn,
1414
+ MessageBouncePrompt: $ = $n,
1415
+ MessageDeleted: j = Fn,
1416
+ MessageIsThreadReplyInChannelButtonIndicator: X = Bn,
1417
+ MessageRepliesCountButton: K = Vn,
1418
+ ReminderNotification: V = Un,
1419
+ StreamedMessageText: _ = jn,
1420
+ PinIndicator: E
1421
+ } = jt("CustomMessage"), F = Gn(c), q = Hn(c), Y = se(
1422
1422
  () => u == null ? void 0 : u(c),
1423
1423
  [u, c]
1424
- ), V = se(() => {
1425
- const fe = c.attachments ?? [], Ce = c.shared_location ? [c.shared_location, ...fe] : fe;
1426
- if (!Ee(c)) return Ce;
1427
- const It = Ce.filter((Tt) => !("type" in Tt) || !sn(Tt));
1428
- return It.length === Ce.length ? Ce : It;
1424
+ ), G = se(() => {
1425
+ const fe = c.attachments ?? [], ke = c.shared_location ? [c.shared_location, ...fe] : fe;
1426
+ if (!Se(c)) return ke;
1427
+ const Tt = ke.filter((At) => !("type" in At) || !an(At));
1428
+ return Tt.length === ke.length ? ke : Tt;
1429
1429
  }, [c]), W = se(() => {
1430
- const fe = Kt({ message: c, viewerLanguage: v });
1430
+ const fe = Jt({ message: c, viewerLanguage: w });
1431
1431
  return fe === c.text ? c : { ...c, text: fe };
1432
- }, [c, v]);
1433
- if (Hn(c))
1432
+ }, [c, w]);
1433
+ if (Yn(c))
1434
1434
  return null;
1435
1435
  if (c.deleted_at || c.type === "deleted")
1436
- return /* @__PURE__ */ n(Y, { message: c });
1437
- if (Yn(c))
1436
+ return /* @__PURE__ */ n(j, { message: c });
1437
+ if (qn(c))
1438
1438
  return /* @__PURE__ */ n(O, {});
1439
- const de = !_ && !!c.reply_count, ue = !_ && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((ft = c.error) == null ? void 0 : ft.status) !== 403, te = qn(c);
1439
+ const de = !b && !!c.reply_count, ue = !b && c.show_in_channel && c.parent_id, me = c.status === "failed" && ((gt = c.error) == null ? void 0 : gt.status) !== 403, te = Wn(c);
1440
1440
  let Q;
1441
1441
  me ? Q = () => m(c) : te && (Q = () => P(!0));
1442
- const ee = f(), En = N(
1442
+ const ee = f(), Sn = y(
1443
1443
  "str-chat__message str-chat__message-simple",
1444
1444
  `str-chat__message--${c.type}`,
1445
1445
  `str-chat__message--${c.status}`,
1446
1446
  ee ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
1447
1447
  c.text ? "str-chat__message--has-text" : "has-no-text",
1448
1448
  {
1449
- "str-chat__message--has-attachment": B,
1449
+ "str-chat__message--has-attachment": F,
1450
1450
  "str-chat__message--highlighted": g,
1451
1451
  "str-chat__message--pinned pinned-message": c.pinned,
1452
1452
  "str-chat__message--with-reactions": q,
1453
- "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((gt = c == null ? void 0 : c.error) == null ? void 0 : gt.status) !== 403,
1453
+ "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((bt = c == null ? void 0 : c.error) == null ? void 0 : bt.status) !== 403,
1454
1454
  "str-chat__message-with-thread-link": de || ue,
1455
1455
  "str-chat__virtual-message__wrapper--end": r,
1456
1456
  "str-chat__virtual-message__wrapper--first": i,
1457
1457
  "str-chat__virtual-message__wrapper--group": o
1458
1458
  }
1459
- ), dt = c.poll_id && p.polls.fromState(c.poll_id), ut = ya(c), he = Ee(c), mt = Na(c), Le = !!(V != null && V.length && !c.quoted_message), ht = he && ee && Le;
1459
+ ), ut = c.poll_id && v.polls.fromState(c.poll_id), mt = ka(c), he = Se(c), ht = Ca(c), De = !!(G != null && G.length && !c.quoted_message), ft = he && ee && De;
1460
1460
  return /* @__PURE__ */ h(ae, { children: [
1461
1461
  a && /* @__PURE__ */ n(
1462
1462
  I,
@@ -1464,22 +1464,22 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1464
1464
  additionalMessageInputProps: t
1465
1465
  }
1466
1466
  ),
1467
- z && /* @__PURE__ */ n(
1468
- Wn,
1467
+ D && /* @__PURE__ */ n(
1468
+ Xn,
1469
1469
  {
1470
- MessageBouncePrompt: F,
1470
+ MessageBouncePrompt: $,
1471
1471
  onClose: () => P(!1),
1472
- open: z
1472
+ open: D
1473
1473
  }
1474
1474
  ),
1475
1475
  /* @__PURE__ */ h(
1476
1476
  "div",
1477
1477
  {
1478
- className: En,
1478
+ className: Sn,
1479
1479
  "data-message-id": c.id,
1480
1480
  children: [
1481
- k && /* @__PURE__ */ n(k, {}),
1482
- !!S && /* @__PURE__ */ n(U, { reminder: S }),
1481
+ E && /* @__PURE__ */ n(E, {}),
1482
+ !!B && /* @__PURE__ */ n(V, { reminder: B }),
1483
1483
  c.user && /* @__PURE__ */ n(
1484
1484
  ie,
1485
1485
  {
@@ -1495,7 +1495,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1495
1495
  /* @__PURE__ */ n(
1496
1496
  "div",
1497
1497
  {
1498
- className: N("str-chat__message-inner", {
1498
+ className: y("str-chat__message-inner", {
1499
1499
  "str-chat__simple-message--error-failed": me || te
1500
1500
  }),
1501
1501
  "data-testid": "message-inner",
@@ -1509,159 +1509,159 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1509
1509
  marginInlineEnd: 0,
1510
1510
  marginInlineStart: 0
1511
1511
  },
1512
- children: mt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
1512
+ children: ht ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
1513
1513
  ee ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1514
- T && /* @__PURE__ */ n(T, {}),
1514
+ C && /* @__PURE__ */ n(C, {}),
1515
1515
  /* @__PURE__ */ n(
1516
- zt.Sent,
1516
+ $t.Sent,
1517
1517
  {
1518
- title: (bt = c.metadata) == null ? void 0 : bt.attachment_title,
1519
- mimeType: (pt = c.metadata) == null ? void 0 : pt.attachment_mime_type,
1520
- thumbnailUrl: (vt = c.metadata) == null ? void 0 : vt.attachment_thumbnail,
1521
- amountText: (xt = c.metadata) == null ? void 0 : xt.amount_text,
1522
- detail: (wt = c.metadata) == null ? void 0 : wt.attachment_detail,
1523
- paymentStatus: (_t = c.metadata) == null ? void 0 : _t.payment_status,
1524
- onPreviewClick: () => M == null ? void 0 : M(c, x),
1525
- onFetchSource: async () => await (y == null ? void 0 : y(c, x))
1518
+ title: (pt = c.metadata) == null ? void 0 : pt.attachment_title,
1519
+ mimeType: (vt = c.metadata) == null ? void 0 : vt.attachment_mime_type,
1520
+ thumbnailUrl: (xt = c.metadata) == null ? void 0 : xt.attachment_thumbnail,
1521
+ amountText: (wt = c.metadata) == null ? void 0 : wt.amount_text,
1522
+ detail: (_t = c.metadata) == null ? void 0 : _t.attachment_detail,
1523
+ paymentStatus: (Nt = c.metadata) == null ? void 0 : Nt.payment_status,
1524
+ onPreviewClick: () => R == null ? void 0 : R(c, p),
1525
+ onFetchSource: async () => await (L == null ? void 0 : L(c, p))
1526
1526
  }
1527
1527
  )
1528
1528
  ] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1529
1529
  /* @__PURE__ */ n(
1530
- zt.Received,
1530
+ $t.Received,
1531
1531
  {
1532
- title: (Nt = c.metadata) == null ? void 0 : Nt.attachment_title,
1533
- mimeType: (yt = c.metadata) == null ? void 0 : yt.attachment_mime_type,
1534
- thumbnailUrl: (Ct = c.metadata) == null ? void 0 : Ct.attachment_thumbnail,
1535
- amountText: (kt = c.metadata) == null ? void 0 : kt.amount_text,
1536
- detail: (Et = c.metadata) == null ? void 0 : Et.attachment_detail,
1537
- paymentStatus: (St = c.metadata) == null ? void 0 : St.payment_status,
1532
+ title: (yt = c.metadata) == null ? void 0 : yt.attachment_title,
1533
+ mimeType: (Ct = c.metadata) == null ? void 0 : Ct.attachment_mime_type,
1534
+ thumbnailUrl: (kt = c.metadata) == null ? void 0 : kt.attachment_thumbnail,
1535
+ amountText: (Et = c.metadata) == null ? void 0 : Et.amount_text,
1536
+ detail: (St = c.metadata) == null ? void 0 : St.attachment_detail,
1537
+ paymentStatus: (It = c.metadata) == null ? void 0 : It.payment_status,
1538
1538
  isUnlocking: A(c.id),
1539
- onUnlockClick: () => M == null ? void 0 : M(c, x),
1540
- onFetchSource: async () => await (y == null ? void 0 : y(c, x)),
1541
- onDownloadClick: () => R == null ? void 0 : R(c, x)
1539
+ onUnlockClick: () => R == null ? void 0 : R(c, p),
1540
+ onFetchSource: async () => await (L == null ? void 0 : L(c, p)),
1541
+ onDownloadClick: () => S == null ? void 0 : S(c, p)
1542
1542
  }
1543
1543
  ),
1544
- T && /* @__PURE__ */ n(T, {})
1544
+ C && /* @__PURE__ */ n(C, {})
1545
1545
  ] }),
1546
1546
  c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
1547
- Mt,
1547
+ Rt,
1548
1548
  {
1549
1549
  message: W,
1550
- renderText: b
1550
+ renderText: x
1551
1551
  }
1552
1552
  ) })
1553
- ] }) : ut ? (
1553
+ ] }) : mt ? (
1554
1554
  /* Tip-only messages render as a standalone bubble */
1555
- /* @__PURE__ */ n(Pe, { message: c, standalone: !0 })
1555
+ /* @__PURE__ */ n(ze, { message: c, standalone: !0 })
1556
1556
  ) : /* @__PURE__ */ n("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ h("div", { className: "str-chat__message-bubble", children: [
1557
- he && !ht && /* @__PURE__ */ n(
1558
- Pe,
1557
+ he && !ft && /* @__PURE__ */ n(
1558
+ ze,
1559
1559
  {
1560
1560
  message: c,
1561
- hasAttachment: Le,
1561
+ hasAttachment: De,
1562
1562
  isMyMessage: ee
1563
1563
  }
1564
1564
  ),
1565
- dt && /* @__PURE__ */ n(Xn, { poll: dt }),
1566
- V != null && V.length && !c.quoted_message ? /* @__PURE__ */ n(
1567
- C,
1565
+ ut && /* @__PURE__ */ n(Kn, { poll: ut }),
1566
+ G != null && G.length && !c.quoted_message ? /* @__PURE__ */ n(
1567
+ k,
1568
1568
  {
1569
1569
  actionHandler: l,
1570
- attachments: V
1570
+ attachments: G
1571
1571
  }
1572
1572
  ) : null,
1573
- H ? /* @__PURE__ */ n(
1574
- w,
1573
+ Y ? /* @__PURE__ */ n(
1574
+ _,
1575
1575
  {
1576
1576
  message: W,
1577
- renderText: b
1577
+ renderText: x
1578
1578
  }
1579
1579
  ) : /* @__PURE__ */ n(
1580
- Mt,
1580
+ Rt,
1581
1581
  {
1582
1582
  message: W,
1583
- renderText: b
1583
+ renderText: x
1584
1584
  }
1585
1585
  ),
1586
- /* @__PURE__ */ n(Kn, {})
1586
+ /* @__PURE__ */ n(Jn, {})
1587
1587
  ] }) })
1588
1588
  }
1589
1589
  ),
1590
- !mt && !ut && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
1591
- (!he || ht) && /* @__PURE__ */ n(
1592
- Pe,
1590
+ !ht && !mt && /* @__PURE__ */ h("div", { className: "str-chat__message-footer", children: [
1591
+ (!he || ft) && /* @__PURE__ */ n(
1592
+ ze,
1593
1593
  {
1594
1594
  message: c,
1595
- hasAttachment: Le,
1595
+ hasAttachment: De,
1596
1596
  isMyMessage: ee
1597
1597
  }
1598
1598
  ),
1599
1599
  s && he && /* @__PURE__ */ n(
1600
- Ca,
1600
+ Ea,
1601
1601
  {
1602
- selected: E,
1603
- onVoteUp: L,
1604
- onVoteDown: D
1602
+ selected: M,
1603
+ onVoteUp: N,
1604
+ onVoteDown: T
1605
1605
  }
1606
1606
  )
1607
1607
  ] }),
1608
1608
  de && /* @__PURE__ */ n(
1609
- J,
1609
+ K,
1610
1610
  {
1611
1611
  onClick: d,
1612
1612
  reply_count: c.reply_count
1613
1613
  }
1614
1614
  ),
1615
- ue && /* @__PURE__ */ n(Z, {})
1615
+ ue && /* @__PURE__ */ n(X, {})
1616
1616
  ]
1617
1617
  },
1618
1618
  c.id
1619
1619
  )
1620
1620
  ] });
1621
- }, Ea = j.memo(
1622
- ka,
1623
- (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Rn(e, t)
1624
- ), Sa = (e) => {
1625
- const t = xe("CustomMessage");
1626
- return /* @__PURE__ */ n(Ea, { ...t, ...e });
1627
- }, Ia = () => {
1621
+ }, Ia = U.memo(
1622
+ Sa,
1623
+ (e, t) => e.chatbotVotingEnabled !== t.chatbotVotingEnabled || e.viewerLanguage !== t.viewerLanguage ? !1 : Ln(e, t)
1624
+ ), Ta = (e) => {
1625
+ const t = we("CustomMessage");
1626
+ return /* @__PURE__ */ n(Ia, { ...t, ...e });
1627
+ }, Aa = () => {
1628
1628
  var s;
1629
- const { handleDelete: e, message: t } = xe("CustomMessageActions");
1629
+ const { handleDelete: e, message: t } = we("CustomMessageActions");
1630
1630
  return ((s = t.metadata) == null ? void 0 : s.payment_status) === "paid" ? null : /* @__PURE__ */ n(
1631
- Yt,
1631
+ qt,
1632
1632
  {
1633
1633
  onClick: e,
1634
1634
  "aria-label": "Delete",
1635
1635
  title: "Delete",
1636
1636
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
1637
- children: /* @__PURE__ */ n(As, { size: 16, weight: "light", "aria-hidden": !0 })
1637
+ children: /* @__PURE__ */ n(Ms, { size: 16, weight: "light", "aria-hidden": !0 })
1638
1638
  }
1639
1639
  );
1640
- }, Ta = () => {
1641
- const { handleFlag: e } = xe("CustomMessageActions");
1640
+ }, Ma = () => {
1641
+ const { handleFlag: e } = we("CustomMessageActions");
1642
1642
  return /* @__PURE__ */ n(
1643
- Yt,
1643
+ qt,
1644
1644
  {
1645
1645
  onClick: e,
1646
1646
  "aria-label": "Report",
1647
1647
  title: "Report",
1648
1648
  className: "bg-marble rounded-full p-2 hover:bg-sand transition-all",
1649
- children: /* @__PURE__ */ n(Vt, { size: 16, weight: "light", "aria-hidden": !0 })
1649
+ children: /* @__PURE__ */ n(Gt, { size: 16, weight: "light", "aria-hidden": !0 })
1650
1650
  }
1651
1651
  );
1652
- }, Aa = () => {
1652
+ }, Ra = () => {
1653
1653
  var t;
1654
- const { message: e } = xe("CustomMessageActions");
1654
+ const { message: e } = we("CustomMessageActions");
1655
1655
  return ((t = e.metadata) == null ? void 0 : t.custom_type) !== "MESSAGE_ATTACHMENT" ? null : /* @__PURE__ */ n(
1656
- Os,
1656
+ zs,
1657
1657
  {
1658
1658
  messageActionSet: [
1659
- { Component: Ia, placement: "quick", type: "delete" },
1660
- { Component: Ta, placement: "quick", type: "flag" }
1659
+ { Component: Aa, placement: "quick", type: "delete" },
1660
+ { Component: Ma, placement: "quick", type: "flag" }
1661
1661
  ]
1662
1662
  }
1663
1663
  );
1664
- }, Ma = ({
1664
+ }, La = ({
1665
1665
  link: e,
1666
1666
  onDismiss: t
1667
1667
  }) => {
@@ -1691,7 +1691,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1691
1691
  },
1692
1692
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
1693
1693
  "aria-label": "Close link preview",
1694
- children: /* @__PURE__ */ n(Me, { className: "size-4 text-black/90" })
1694
+ children: /* @__PURE__ */ n(Re, { className: "size-4 text-black/90" })
1695
1695
  }
1696
1696
  ),
1697
1697
  /* @__PURE__ */ h("div", { className: "p-2", children: [
@@ -1701,26 +1701,26 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1701
1701
  ]
1702
1702
  }
1703
1703
  );
1704
- }, Ra = (e) => ({
1704
+ }, Da = (e) => ({
1705
1705
  linkPreviews: Array.from(e.previews.values()).filter(
1706
- (t) => At.previewIsLoaded(t) || At.previewIsLoading(t)
1706
+ (t) => Mt.previewIsLoaded(t) || Mt.previewIsLoading(t)
1707
1707
  )
1708
- }), La = () => {
1709
- const { linkPreviewsManager: e } = Jn(), { linkPreviews: t } = Zn(
1708
+ }), Pa = () => {
1709
+ const { linkPreviewsManager: e } = Zn(), { linkPreviews: t } = Qn(
1710
1710
  e.state,
1711
- Ra
1711
+ Da
1712
1712
  ), s = (r) => {
1713
1713
  e.dismissPreview(r);
1714
1714
  };
1715
1715
  return t.length > 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col items-stretch w-full gap-2 mb-4", children: t.map((r) => /* @__PURE__ */ n(
1716
- Ma,
1716
+ La,
1717
1717
  {
1718
1718
  link: r,
1719
1719
  onDismiss: s
1720
1720
  },
1721
1721
  r.og_scrape_url
1722
1722
  )) }) : null;
1723
- }, cn = j.createContext(!1), Da = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1723
+ }, dn = U.createContext(!1), Oa = ({ sendMessage: e, disabled: t, ...s }) => /* @__PURE__ */ n(
1724
1724
  "button",
1725
1725
  {
1726
1726
  ...s,
@@ -1728,20 +1728,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1728
1728
  "aria-label": "Send",
1729
1729
  disabled: t,
1730
1730
  onClick: e,
1731
- children: /* @__PURE__ */ n(Ms, { weight: "bold", className: "size-4" })
1731
+ children: /* @__PURE__ */ n(Rs, { weight: "bold", className: "size-4" })
1732
1732
  }
1733
- ), Oa = () => {
1734
- const e = Ae(cn), { handleSubmit: t } = es(), s = ts(), a = e || !s, {
1735
- SendButton: r = Da,
1736
- AttachmentPreviewList: i = ns
1733
+ ), za = () => {
1734
+ const e = Me(dn), { handleSubmit: t } = ts(), s = ns(), a = e || !s, {
1735
+ SendButton: r = Oa,
1736
+ AttachmentPreviewList: i = ss
1737
1737
  } = jt("CustomMessageInput");
1738
1738
  return /* @__PURE__ */ h("div", { className: "central-container flex flex-col gap-2 min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
1739
- /* @__PURE__ */ n(ss, {}),
1740
- /* @__PURE__ */ n(La, {}),
1739
+ /* @__PURE__ */ n(as, {}),
1740
+ /* @__PURE__ */ n(Pa, {}),
1741
1741
  /* @__PURE__ */ n(i, {}),
1742
1742
  /* @__PURE__ */ h("div", { className: "flex", children: [
1743
1743
  /* @__PURE__ */ n("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ n(
1744
- as,
1744
+ rs,
1745
1745
  {
1746
1746
  "aria-disabled": e || void 0,
1747
1747
  className: "w-full resize-none outline-none leading-5 placeholder:text-black/30 text-sm",
@@ -1764,7 +1764,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1764
1764
  )
1765
1765
  ] })
1766
1766
  ] });
1767
- }, Pa = ({
1767
+ }, $a = ({
1768
1768
  renderActions: e,
1769
1769
  renderFooter: t,
1770
1770
  disabled: s = !1,
@@ -1784,67 +1784,67 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1784
1784
  className: "message-input flex items-end gap-4 aria-disabled:opacity-40",
1785
1785
  children: [
1786
1786
  e && /* @__PURE__ */ n("div", { className: "flex h-12 shrink-0 items-center justify-center", children: e() }),
1787
- /* @__PURE__ */ n(cn.Provider, { value: i, children: /* @__PURE__ */ n(Qn, { Input: Oa }) })
1787
+ /* @__PURE__ */ n(dn.Provider, { value: i, children: /* @__PURE__ */ n(es, { Input: za }) })
1788
1788
  ]
1789
1789
  }
1790
1790
  ),
1791
1791
  t == null ? void 0 : t()
1792
1792
  ] });
1793
- }, za = [
1793
+ }, Fa = [
1794
1794
  "SYSTEM_DM_AGENT_PAUSED",
1795
1795
  "SYSTEM_DM_AGENT_RESUMED"
1796
- ], $a = {
1796
+ ], Ba = {
1797
1797
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1798
1798
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1799
- }, Fa = [
1799
+ }, Va = [
1800
1800
  "SYSTEM_AGE_SAFETY_BLOCKED"
1801
- ], Ba = {
1801
+ ], Ua = {
1802
1802
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1803
- }, ze = "age safety guidelines.", Ua = "https://linktr.ee/s/about/contact", Ft = (e) => za.includes(e), ja = (e) => Fa.includes(e), Va = (e) => {
1803
+ }, $e = "age safety guidelines.", ja = "https://linktr.ee/s/about/contact", Bt = (e) => Fa.includes(e), Ga = (e) => Va.includes(e), Ha = (e) => {
1804
1804
  var a;
1805
1805
  const t = (a = e.metadata) == null ? void 0 : a.custom_type;
1806
- if (Ft(t))
1806
+ if (Bt(t))
1807
1807
  return {
1808
1808
  kind: "dm-agent",
1809
1809
  type: t
1810
1810
  };
1811
- if (ja(t))
1811
+ if (Ga(t))
1812
1812
  return {
1813
1813
  kind: "age-safety",
1814
1814
  type: t
1815
1815
  };
1816
1816
  const s = e.dm_agent_system_type;
1817
- if (Ft(s))
1817
+ if (Bt(s))
1818
1818
  return {
1819
1819
  kind: "dm-agent",
1820
1820
  type: s
1821
1821
  };
1822
- }, Ga = (e) => {
1823
- const t = e.indexOf(ze);
1822
+ }, Ya = (e) => {
1823
+ const t = e.indexOf($e);
1824
1824
  if (t === -1)
1825
1825
  return e;
1826
- const s = t + ze.length;
1826
+ const s = t + $e.length;
1827
1827
  return /* @__PURE__ */ h(ae, { children: [
1828
1828
  e.slice(0, t),
1829
1829
  /* @__PURE__ */ n(
1830
1830
  "a",
1831
1831
  {
1832
- href: Ua,
1832
+ href: ja,
1833
1833
  target: "_blank",
1834
1834
  rel: "noopener noreferrer",
1835
1835
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1836
- children: ze
1836
+ children: $e
1837
1837
  }
1838
1838
  ),
1839
1839
  e.slice(s)
1840
1840
  ] });
1841
- }, Ha = (e) => {
1841
+ }, qa = (e) => {
1842
1842
  var a, r;
1843
- const t = e.message.hide_date === !0, s = Va(
1843
+ const t = e.message.hide_date === !0, s = Ha(
1844
1844
  e.message
1845
1845
  );
1846
1846
  if ((s == null ? void 0 : s.kind) === "dm-agent") {
1847
- const i = ((a = e.message.text) == null ? void 0 : a.trim()) || $a[s.type];
1847
+ const i = ((a = e.message.text) == null ? void 0 : a.trim()) || Ba[s.type];
1848
1848
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1849
1849
  /* @__PURE__ */ h(
1850
1850
  "div",
@@ -1866,11 +1866,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1866
1866
  ]
1867
1867
  }
1868
1868
  ),
1869
- !t && /* @__PURE__ */ n(De, { message: e.message })
1869
+ !t && /* @__PURE__ */ n(Pe, { message: e.message })
1870
1870
  ] });
1871
1871
  }
1872
1872
  if ((s == null ? void 0 : s.kind) === "age-safety") {
1873
- const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ba[s.type];
1873
+ const i = ((r = e.message.text) == null ? void 0 : r.trim()) || Ua[s.type];
1874
1874
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1875
1875
  /* @__PURE__ */ h(
1876
1876
  "div",
@@ -1880,7 +1880,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1880
1880
  "data-age-safety-system-type": s.type,
1881
1881
  children: [
1882
1882
  /* @__PURE__ */ n(
1883
- Rs,
1883
+ Ls,
1884
1884
  {
1885
1885
  size: 24,
1886
1886
  weight: "duotone",
@@ -1889,11 +1889,11 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1889
1889
  "data-testid": "age-safety-system-message-icon"
1890
1890
  }
1891
1891
  ),
1892
- /* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ga(i) }) })
1892
+ /* @__PURE__ */ n("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ n("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ya(i) }) })
1893
1893
  ]
1894
1894
  }
1895
1895
  ),
1896
- !t && /* @__PURE__ */ n(De, { message: e.message })
1896
+ !t && /* @__PURE__ */ n(Pe, { message: e.message })
1897
1897
  ] });
1898
1898
  }
1899
1899
  return /* @__PURE__ */ h("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1902,9 +1902,9 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1902
1902
  /* @__PURE__ */ n("p", { children: e.message.text }),
1903
1903
  /* @__PURE__ */ n("div", { className: "str-chat__message--system__line" })
1904
1904
  ] }),
1905
- !t && /* @__PURE__ */ n(De, { message: e.message })
1905
+ !t && /* @__PURE__ */ n(Pe, { message: e.message })
1906
1906
  ] });
1907
- }, dn = Ye(!1), $e = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
1907
+ }, un = qe(!1), Fe = ({ cx: e, index: t }) => /* @__PURE__ */ n("circle", { cx: e, cy: "6.15", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ n(
1908
1908
  "animateTransform",
1909
1909
  {
1910
1910
  attributeName: "transform",
@@ -1914,21 +1914,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1914
1914
  begin: `${120 * t}ms`,
1915
1915
  repeatCount: "indefinite"
1916
1916
  }
1917
- ) }), Ya = /* @__PURE__ */ new Set([
1917
+ ) }), Wa = /* @__PURE__ */ new Set([
1918
1918
  Oe.Thinking,
1919
1919
  Oe.Generating,
1920
1920
  Oe.ExternalSources
1921
- ]), qa = ({ threadList: e }) => {
1922
- var b, _;
1923
- const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = We(), { typing: i = {} } = rs(), { aiState: o } = is(t), l = Ae(dn);
1924
- if (!e && l && Ya.has(o)) {
1925
- const v = Wa(t, (b = r.user) == null ? void 0 : b.id);
1921
+ ]), Xa = ({ threadList: e }) => {
1922
+ var x, b;
1923
+ const { channel: t, channelConfig: s, thread: a } = ce(), { client: r } = Xe(), { typing: i = {} } = is(), { aiState: o } = os(t), l = Me(un);
1924
+ if (!e && l && Wa.has(o)) {
1925
+ const w = Ka(t, (x = r.user) == null ? void 0 : x.id);
1926
1926
  return /* @__PURE__ */ n(
1927
- Bt,
1927
+ Vt,
1928
1928
  {
1929
- avatarId: (v == null ? void 0 : v.id) ?? "ai-agent",
1930
- avatarName: (v == null ? void 0 : v.name) ?? (v == null ? void 0 : v.id) ?? "Agent",
1931
- avatarImage: v == null ? void 0 : v.image,
1929
+ avatarId: (w == null ? void 0 : w.id) ?? "ai-agent",
1930
+ avatarName: (w == null ? void 0 : w.name) ?? (w == null ? void 0 : w.id) ?? "Agent",
1931
+ avatarImage: w == null ? void 0 : w.image,
1932
1932
  testId: "typing-indicator-ai"
1933
1933
  }
1934
1934
  );
@@ -1936,21 +1936,21 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1936
1936
  if ((s == null ? void 0 : s.typing_events) === !1)
1937
1937
  return null;
1938
1938
  const m = e ? [] : Object.values(i).filter(
1939
- ({ parent_id: v, user: p }) => {
1940
- var x;
1941
- return (p == null ? void 0 : p.id) !== ((x = r.user) == null ? void 0 : x.id) && !v;
1939
+ ({ parent_id: w, user: v }) => {
1940
+ var p;
1941
+ return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && !w;
1942
1942
  }
1943
1943
  ), g = e ? Object.values(i).filter(
1944
- ({ parent_id: v, user: p }) => {
1945
- var x;
1946
- return (p == null ? void 0 : p.id) !== ((x = r.user) == null ? void 0 : x.id) && v === (a == null ? void 0 : a.id);
1944
+ ({ parent_id: w, user: v }) => {
1945
+ var p;
1946
+ return (v == null ? void 0 : v.id) !== ((p = r.user) == null ? void 0 : p.id) && w === (a == null ? void 0 : a.id);
1947
1947
  }
1948
1948
  ) : [], u = e ? g : m;
1949
1949
  if (!u.length)
1950
1950
  return null;
1951
- const f = (_ = u[0]) == null ? void 0 : _.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1951
+ const f = (b = u[0]) == null ? void 0 : b.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1952
1952
  return /* @__PURE__ */ n(
1953
- Bt,
1953
+ Vt,
1954
1954
  {
1955
1955
  avatarId: (f == null ? void 0 : f.id) ?? (c == null ? void 0 : c.id) ?? "typing-user",
1956
1956
  avatarName: (f == null ? void 0 : f.name) ?? (c == null ? void 0 : c.name) ?? (f == null ? void 0 : f.id) ?? "Typing user",
@@ -1958,7 +1958,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1958
1958
  testId: "typing-indicator"
1959
1959
  }
1960
1960
  );
1961
- }, Bt = ({
1961
+ }, Vt = ({
1962
1962
  avatarId: e,
1963
1963
  avatarName: t,
1964
1964
  avatarImage: s,
@@ -1993,16 +1993,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1993
1993
  height: "13",
1994
1994
  overflow: "visible",
1995
1995
  children: [
1996
- /* @__PURE__ */ n($e, { cx: "4", index: 0 }),
1997
- /* @__PURE__ */ n($e, { cx: "16", index: 1 }),
1998
- /* @__PURE__ */ n($e, { cx: "28", index: 2 })
1996
+ /* @__PURE__ */ n(Fe, { cx: "4", index: 0 }),
1997
+ /* @__PURE__ */ n(Fe, { cx: "16", index: 1 }),
1998
+ /* @__PURE__ */ n(Fe, { cx: "28", index: 2 })
1999
1999
  ]
2000
2000
  }
2001
2001
  ) }) }) }) }) })
2002
2002
  ] })
2003
2003
  }
2004
2004
  );
2005
- function Wa(e, t) {
2005
+ function Ka(e, t) {
2006
2006
  var a;
2007
2007
  const s = ((a = e == null ? void 0 : e.state) == null ? void 0 : a.members) ?? {};
2008
2008
  for (const r of Object.values(s)) {
@@ -2011,10 +2011,10 @@ function Wa(e, t) {
2011
2011
  return i;
2012
2012
  }
2013
2013
  }
2014
- const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
2014
+ const Ja = () => null, Za = ({ className: e, message: t }) => /* @__PURE__ */ h(
2015
2015
  "div",
2016
2016
  {
2017
- className: N("flex items-center justify-center h-full", e),
2017
+ className: y("flex items-center justify-center h-full", e),
2018
2018
  children: [
2019
2019
  /* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
2020
2020
  /* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
@@ -2054,12 +2054,24 @@ const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
2054
2054
  t && /* @__PURE__ */ n("span", { className: "text-stone", children: t })
2055
2055
  ]
2056
2056
  }
2057
- ), Se = j.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2058
- /* @__PURE__ */ n(Ka, { className: "w-6 h-6" }),
2057
+ ), Ie = U.memo(() => /* @__PURE__ */ n("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2058
+ /* @__PURE__ */ n(Za, { className: "w-6 h-6" }),
2059
2059
  /* @__PURE__ */ n("span", { className: "text-sm text-stone", children: "Loading messages" })
2060
2060
  ] }) }));
2061
- Se.displayName = "LoadingState";
2062
- const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ut = "Replies instantly with AI assistant", Ja = ({
2061
+ Ie.displayName = "LoadingState";
2062
+ const be = ({
2063
+ className: e,
2064
+ size: t = 16
2065
+ }) => /* @__PURE__ */ n(
2066
+ Ds,
2067
+ {
2068
+ weight: "fill",
2069
+ size: t,
2070
+ className: y("shrink-0 text-[#1D9BF0]", e),
2071
+ "aria-label": "Verified",
2072
+ role: "img"
2073
+ }
2074
+ ), oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ut = "Replies instantly with AI assistant", Qa = ({
2063
2075
  onBack: e,
2064
2076
  showBackButton: t,
2065
2077
  showStarButton: s = !1,
@@ -2074,26 +2086,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2074
2086
  onReportParticipantClick: u,
2075
2087
  customChannelActions: f,
2076
2088
  renderChannelActions: c,
2077
- showChannelInfo: b = !0,
2078
- onParticipantNameClick: _,
2079
- renderHeaderTitleBadges: v
2089
+ showChannelInfo: x = !0,
2090
+ onParticipantNameClick: b,
2091
+ renderHeaderTitleBadges: w
2080
2092
  }) => {
2081
- var P, S, E, L, D;
2082
- const { channel: p } = ce(), x = j.useMemo(() => {
2083
- var T, O;
2084
- const C = (T = p._client) == null ? void 0 : T.userID;
2085
- return C ? Object.values(((O = p.state) == null ? void 0 : O.members) || {}).find(
2086
- (F) => {
2087
- var Y;
2088
- return ((Y = F.user) == null ? void 0 : Y.id) && F.user.id !== C;
2093
+ var B, M, N, T, k, I;
2094
+ const { channel: v } = ce(), p = U.useMemo(() => {
2095
+ var $, j;
2096
+ const C = ($ = v._client) == null ? void 0 : $.userID;
2097
+ return C ? Object.values(((j = v.state) == null ? void 0 : j.members) || {}).find(
2098
+ (X) => {
2099
+ var K;
2100
+ return ((K = X.user) == null ? void 0 : K.id) && X.user.id !== C;
2089
2101
  }
2090
2102
  ) : void 0;
2091
- }, [(P = p._client) == null ? void 0 : P.userID, (S = p.state) == null ? void 0 : S.members]), A = Xt(x == null ? void 0 : x.user), M = (E = x == null ? void 0 : x.user) == null ? void 0 : E.image, y = Wt(p), R = v == null ? void 0 : v({
2092
- channel: p,
2093
- participant: x
2094
- }), z = async () => {
2103
+ }, [(B = v._client) == null ? void 0 : B.userID, (M = v.state) == null ? void 0 : M.members]), A = Kt(p == null ? void 0 : p.user), R = (N = p == null ? void 0 : p.user) == null ? void 0 : N.image, L = ((T = p == null ? void 0 : p.user) == null ? void 0 : T.is_verified) === !0, S = Xt(v), D = w == null ? void 0 : w({
2104
+ channel: v,
2105
+ participant: p
2106
+ }), P = async () => {
2095
2107
  try {
2096
- y ? await p.unpin() : await p.pin();
2108
+ S ? await v.unpin() : await v.pin();
2097
2109
  } catch (C) {
2098
2110
  console.error(
2099
2111
  "[CustomChannelHeader] Failed to update pinned status:",
@@ -2106,7 +2118,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2106
2118
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
2107
2119
  "button",
2108
2120
  {
2109
- className: N(
2121
+ className: y(
2110
2122
  oe,
2111
2123
  "messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
2112
2124
  ),
@@ -2114,37 +2126,39 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2114
2126
  }),
2115
2127
  type: "button",
2116
2128
  "aria-label": "Back to conversations",
2117
- children: /* @__PURE__ */ n(Lt, { className: "size-5 text-black/90" })
2129
+ children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
2118
2130
  }
2119
2131
  ) }),
2120
2132
  /* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
2121
2133
  /* @__PURE__ */ n(
2122
2134
  ie,
2123
2135
  {
2124
- id: ((L = x == null ? void 0 : x.user) == null ? void 0 : L.id) || p.id || "unknown",
2136
+ id: ((k = p == null ? void 0 : p.user) == null ? void 0 : k.id) || v.id || "unknown",
2125
2137
  name: A,
2126
- image: M,
2127
- starred: s && y,
2138
+ image: R,
2139
+ starred: s && S,
2128
2140
  dmAgentEnabled: a,
2129
2141
  size: 48
2130
2142
  }
2131
2143
  ),
2132
- _ ? /* @__PURE__ */ h(
2144
+ b ? /* @__PURE__ */ h(
2133
2145
  "button",
2134
2146
  {
2135
2147
  type: "button",
2136
- onClick: _,
2148
+ onClick: b,
2137
2149
  "aria-label": `View details for ${A}`,
2138
2150
  className: "flex max-w-full items-center gap-0.5 rounded text-center text-xs font-medium text-black/90 transition-opacity hover:opacity-70",
2139
2151
  children: [
2140
2152
  /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2141
- R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R }),
2142
- /* @__PURE__ */ n(Ve, { className: "size-3 shrink-0", weight: "bold" })
2153
+ L && /* @__PURE__ */ n(be, {}),
2154
+ D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D }),
2155
+ /* @__PURE__ */ n(Ge, { className: "size-3 shrink-0", weight: "bold" })
2143
2156
  ]
2144
2157
  }
2145
2158
  ) : /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
2146
2159
  /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2147
- R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R })
2160
+ L && /* @__PURE__ */ n(be, {}),
2161
+ D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D })
2148
2162
  ] }),
2149
2163
  a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2150
2164
  /* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
@@ -2156,26 +2170,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2156
2170
  "button",
2157
2171
  {
2158
2172
  className: oe,
2159
- onClick: z,
2173
+ onClick: P,
2160
2174
  type: "button",
2161
- "aria-label": y ? "Unstar conversation" : "Star conversation",
2175
+ "aria-label": S ? "Unstar conversation" : "Star conversation",
2162
2176
  children: /* @__PURE__ */ n(
2163
- Be,
2177
+ Ve,
2164
2178
  {
2165
- className: N("size-5", {
2166
- "text-yellow-600": y,
2167
- "text-black/90": !y
2179
+ className: y("size-5", {
2180
+ "text-yellow-600": S,
2181
+ "text-black/90": !S
2168
2182
  }),
2169
- weight: y ? "duotone" : "regular"
2183
+ weight: S ? "duotone" : "regular"
2170
2184
  }
2171
2185
  )
2172
2186
  }
2173
2187
  ),
2174
- b && (c !== void 0 ? c : /* @__PURE__ */ n(
2175
- Pt,
2188
+ x && (c !== void 0 ? c : /* @__PURE__ */ n(
2189
+ zt,
2176
2190
  {
2177
- channel: p,
2178
- participant: x,
2191
+ channel: v,
2192
+ participant: p,
2179
2193
  showDeleteConversation: o,
2180
2194
  showBlockParticipant: l,
2181
2195
  showReportParticipant: d,
@@ -2185,7 +2199,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2185
2199
  onBlockParticipantClick: g,
2186
2200
  onReportParticipantClick: u,
2187
2201
  customChannelActions: f,
2188
- triggerClassName: N(oe, "bg-[#F1F0EE]")
2202
+ triggerClassName: y(oe, "bg-[#F1F0EE]")
2189
2203
  }
2190
2204
  ))
2191
2205
  ] })
@@ -2195,44 +2209,46 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2195
2209
  t && e && /* @__PURE__ */ n(
2196
2210
  "button",
2197
2211
  {
2198
- className: N(
2212
+ className: y(
2199
2213
  oe,
2200
2214
  "messaging-channel-view-back-button-desktop"
2201
2215
  ),
2202
2216
  type: "button",
2203
2217
  onClick: e,
2204
2218
  "aria-label": "Back to conversations",
2205
- children: /* @__PURE__ */ n(Lt, { className: "size-5 text-black/90" })
2219
+ children: /* @__PURE__ */ n(Dt, { className: "size-5 text-black/90" })
2206
2220
  }
2207
2221
  ),
2208
2222
  /* @__PURE__ */ n(
2209
2223
  ie,
2210
2224
  {
2211
- id: ((D = x == null ? void 0 : x.user) == null ? void 0 : D.id) || p.id || "unknown",
2225
+ id: ((I = p == null ? void 0 : p.user) == null ? void 0 : I.id) || v.id || "unknown",
2212
2226
  name: A,
2213
- image: M,
2214
- starred: s && y,
2227
+ image: R,
2228
+ starred: s && S,
2215
2229
  dmAgentEnabled: a,
2216
2230
  size: 48
2217
2231
  }
2218
2232
  ),
2219
2233
  /* @__PURE__ */ h("div", { className: "min-w-0", children: [
2220
- _ ? /* @__PURE__ */ h(
2234
+ b ? /* @__PURE__ */ h(
2221
2235
  "button",
2222
2236
  {
2223
2237
  type: "button",
2224
- onClick: _,
2238
+ onClick: b,
2225
2239
  "aria-label": `View details for ${A}`,
2226
2240
  className: "flex min-w-0 max-w-full items-center gap-1 rounded font-medium text-black/90 transition-opacity hover:opacity-70",
2227
2241
  children: [
2228
2242
  /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2229
- R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R }),
2230
- /* @__PURE__ */ n(Ve, { className: "size-4 shrink-0", weight: "bold" })
2243
+ L && /* @__PURE__ */ n(be, {}),
2244
+ D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D }),
2245
+ /* @__PURE__ */ n(Ge, { className: "size-4 shrink-0", weight: "bold" })
2231
2246
  ]
2232
2247
  }
2233
2248
  ) : /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
2234
2249
  /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2235
- R && /* @__PURE__ */ n("span", { className: "shrink-0", children: R })
2250
+ L && /* @__PURE__ */ n(be, {}),
2251
+ D && /* @__PURE__ */ n("span", { className: "shrink-0", children: D })
2236
2252
  ] }),
2237
2253
  a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2238
2254
  /* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
@@ -2245,26 +2261,26 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2245
2261
  "button",
2246
2262
  {
2247
2263
  className: oe,
2248
- onClick: z,
2264
+ onClick: P,
2249
2265
  type: "button",
2250
- "aria-label": y ? "Unstar conversation" : "Star conversation",
2266
+ "aria-label": S ? "Unstar conversation" : "Star conversation",
2251
2267
  children: /* @__PURE__ */ n(
2252
- Be,
2268
+ Ve,
2253
2269
  {
2254
- className: N("size-6", {
2255
- "text-yellow-600": y,
2256
- "text-black/90": !y
2270
+ className: y("size-6", {
2271
+ "text-yellow-600": S,
2272
+ "text-black/90": !S
2257
2273
  }),
2258
- weight: y ? "duotone" : "regular"
2274
+ weight: S ? "duotone" : "regular"
2259
2275
  }
2260
2276
  )
2261
2277
  }
2262
2278
  ),
2263
- b && (c !== void 0 ? c : /* @__PURE__ */ n(
2264
- Pt,
2279
+ x && (c !== void 0 ? c : /* @__PURE__ */ n(
2280
+ zt,
2265
2281
  {
2266
- channel: p,
2267
- participant: x,
2282
+ channel: v,
2283
+ participant: p,
2268
2284
  showDeleteConversation: o,
2269
2285
  showBlockParticipant: l,
2270
2286
  showReportParticipant: d,
@@ -2280,7 +2296,7 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2280
2296
  ] })
2281
2297
  ] })
2282
2298
  ] });
2283
- }, Za = ({
2299
+ }, er = ({
2284
2300
  onBack: e,
2285
2301
  showBackButton: t,
2286
2302
  renderMessageInputActions: s,
@@ -2295,66 +2311,66 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2295
2311
  showBlockParticipant: u = !0,
2296
2312
  showReportParticipant: f = !0,
2297
2313
  composerDisabled: c = !1,
2298
- composerDisabledReason: b,
2299
- showStarButton: _ = !1,
2300
- chatbotVotingEnabled: v = !1,
2301
- renderChannelBanner: p,
2302
- renderHeaderTitleBadges: x,
2314
+ composerDisabledReason: x,
2315
+ showStarButton: b = !1,
2316
+ chatbotVotingEnabled: w = !1,
2317
+ renderChannelBanner: v,
2318
+ renderHeaderTitleBadges: p,
2303
2319
  customChannelActions: A,
2304
- renderChannelActions: M,
2305
- renderMessage: y,
2306
- dmAgentEnabled: R = !1,
2307
- viewerLanguage: z,
2320
+ renderChannelActions: R,
2321
+ renderMessage: L,
2322
+ dmAgentEnabled: S = !1,
2323
+ viewerLanguage: D,
2308
2324
  showChannelInfo: P = !0,
2309
- onParticipantNameClick: S
2325
+ onParticipantNameClick: B
2310
2326
  }) => {
2311
- var F, Y, Z, J, U, w;
2312
- const { channel: E } = ce(), L = j.useMemo(() => {
2313
- var q, H;
2314
- const k = (q = E._client) == null ? void 0 : q.userID;
2315
- return k ? Object.values(((H = E.state) == null ? void 0 : H.members) || {}).find(
2316
- (V) => {
2327
+ var $, j, X, K, V, _;
2328
+ const { channel: M } = ce(), N = U.useMemo(() => {
2329
+ var q, Y;
2330
+ const E = (q = M._client) == null ? void 0 : q.userID;
2331
+ return E ? Object.values(((Y = M.state) == null ? void 0 : Y.members) || {}).find(
2332
+ (G) => {
2317
2333
  var W;
2318
- return ((W = V.user) == null ? void 0 : W.id) && V.user.id !== k;
2334
+ return ((W = G.user) == null ? void 0 : W.id) && G.user.id !== E;
2319
2335
  }
2320
2336
  ) : void 0;
2321
- }, [(F = E._client) == null ? void 0 : F.userID, (Y = E.state) == null ? void 0 : Y.members]), D = j.useMemo(() => {
2322
- var q, H;
2323
- const k = (q = E._client) == null ? void 0 : q.userID;
2324
- return k ? Object.values(((H = E.state) == null ? void 0 : H.members) || {}).find((V) => {
2337
+ }, [($ = M._client) == null ? void 0 : $.userID, (j = M.state) == null ? void 0 : j.members]), T = U.useMemo(() => {
2338
+ var q, Y;
2339
+ const E = (q = M._client) == null ? void 0 : q.userID;
2340
+ return E ? Object.values(((Y = M.state) == null ? void 0 : Y.members) || {}).find((G) => {
2325
2341
  var W;
2326
- return ((W = V.user) == null ? void 0 : W.id) === k;
2342
+ return ((W = G.user) == null ? void 0 : W.id) === E;
2327
2343
  }) : void 0;
2328
- }, [(Z = E._client) == null ? void 0 : Z.userID, (J = E.state) == null ? void 0 : J.members]), C = ((U = D == null ? void 0 : D.user) == null ? void 0 : U.is_account) ?? (D == null ? void 0 : D.is_account), I = ((w = L == null ? void 0 : L.user) == null ? void 0 : w.is_account) ?? (L == null ? void 0 : L.is_account), T = R && C === !1 && I === !0, O = K(
2329
- (k) => {
2330
- const { message: B } = xe("ChannelView"), q = /* @__PURE__ */ n(
2331
- Sa,
2344
+ }, [(X = M._client) == null ? void 0 : X.userID, (K = M.state) == null ? void 0 : K.members]), k = ((V = T == null ? void 0 : T.user) == null ? void 0 : V.is_account) ?? (T == null ? void 0 : T.is_account), I = ((_ = N == null ? void 0 : N.user) == null ? void 0 : _.is_account) ?? (N == null ? void 0 : N.is_account), C = S && k === !1 && I === !0, O = Z(
2345
+ (E) => {
2346
+ const { message: F } = we("ChannelView"), q = /* @__PURE__ */ n(
2347
+ Ta,
2332
2348
  {
2333
- ...k,
2334
- chatbotVotingEnabled: v,
2335
- viewerLanguage: z
2349
+ ...E,
2350
+ chatbotVotingEnabled: w,
2351
+ viewerLanguage: D
2336
2352
  }
2337
2353
  );
2338
- return !y || !B ? q : y(q, B);
2354
+ return !L || !F ? q : L(q, F);
2339
2355
  },
2340
- [v, y, z]
2356
+ [w, L, D]
2341
2357
  );
2342
2358
  return /* @__PURE__ */ n(ae, { children: /* @__PURE__ */ n(
2343
- ls,
2359
+ cs,
2344
2360
  {
2345
2361
  overrides: {
2346
2362
  Message: O,
2347
- MessageActions: Aa
2363
+ MessageActions: Ra
2348
2364
  },
2349
- children: /* @__PURE__ */ h(cs, { children: [
2365
+ children: /* @__PURE__ */ h(ds, { children: [
2350
2366
  /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
2351
- Ja,
2367
+ Qa,
2352
2368
  {
2353
2369
  onBack: e,
2354
2370
  showBackButton: t,
2355
2371
  showChannelInfo: P,
2356
- showStarButton: _,
2357
- dmAgentEnabled: T,
2372
+ showStarButton: b,
2373
+ dmAgentEnabled: C,
2358
2374
  onLeaveConversation: i,
2359
2375
  onBlockParticipant: o,
2360
2376
  showDeleteConversation: l,
@@ -2364,37 +2380,37 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2364
2380
  onBlockParticipantClick: m,
2365
2381
  onReportParticipantClick: g,
2366
2382
  customChannelActions: A,
2367
- renderChannelActions: M,
2368
- onParticipantNameClick: S,
2369
- renderHeaderTitleBadges: x
2383
+ renderChannelActions: R,
2384
+ onParticipantNameClick: B,
2385
+ renderHeaderTitleBadges: p
2370
2386
  }
2371
2387
  ) }, "lt-channel-header"),
2372
- p ? /* @__PURE__ */ n(j.Fragment, { children: p() }, "lt-channel-banner") : null,
2388
+ v ? /* @__PURE__ */ n(U.Fragment, { children: v() }, "lt-channel-banner") : null,
2373
2389
  /* @__PURE__ */ n(
2374
2390
  "div",
2375
2391
  {
2376
2392
  className: "flex-1 overflow-hidden relative",
2377
- children: /* @__PURE__ */ n(ds, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
2393
+ children: /* @__PURE__ */ n(us, { hideDeletedMessages: !0, hideNewMessageSeparator: !1 })
2378
2394
  },
2379
2395
  "lt-channel-message-list"
2380
2396
  ),
2381
- r ? /* @__PURE__ */ n(j.Fragment, { children: r(E) }, "lt-channel-conversation-footer") : null,
2397
+ r ? /* @__PURE__ */ n(U.Fragment, { children: r(M) }, "lt-channel-conversation-footer") : null,
2382
2398
  /* @__PURE__ */ n(
2383
- Pa,
2399
+ $a,
2384
2400
  {
2385
2401
  ...s && {
2386
- renderActions: () => s == null ? void 0 : s(E)
2402
+ renderActions: () => s == null ? void 0 : s(M)
2387
2403
  },
2388
- renderFooter: () => a == null ? void 0 : a(E),
2404
+ renderFooter: () => a == null ? void 0 : a(M),
2389
2405
  disabled: c,
2390
- disabledReason: b
2406
+ disabledReason: x
2391
2407
  },
2392
2408
  "lt-channel-message-input"
2393
2409
  )
2394
2410
  ] })
2395
2411
  }
2396
2412
  ) });
2397
- }, un = j.memo(
2413
+ }, mn = U.memo(
2398
2414
  ({
2399
2415
  channel: e,
2400
2416
  onBack: t,
@@ -2405,85 +2421,85 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2405
2421
  onLeaveConversation: o,
2406
2422
  onBlockParticipant: l,
2407
2423
  className: d,
2408
- CustomChannelEmptyState: m = Xa,
2424
+ CustomChannelEmptyState: m = Ja,
2409
2425
  showDeleteConversation: g = !0,
2410
2426
  onDeleteConversationClick: u,
2411
2427
  onBlockParticipantClick: f,
2412
2428
  onReportParticipantClick: c,
2413
- showBlockParticipant: b = !0,
2414
- showReportParticipant: _ = !0,
2415
- composerDisabled: v = !1,
2416
- composerDisabledReason: p,
2417
- dmAgentEnabled: x,
2429
+ showBlockParticipant: x = !0,
2430
+ showReportParticipant: b = !0,
2431
+ composerDisabled: w = !1,
2432
+ composerDisabledReason: v,
2433
+ dmAgentEnabled: p,
2418
2434
  messageMetadata: A,
2419
- onMessageSent: M,
2420
- showStarButton: y = !1,
2421
- chatbotVotingEnabled: R = !1,
2422
- renderChannelBanner: z,
2435
+ onMessageSent: R,
2436
+ showStarButton: L = !1,
2437
+ chatbotVotingEnabled: S = !1,
2438
+ renderChannelBanner: D,
2423
2439
  renderHeaderTitleBadges: P,
2424
- customChannelActions: S,
2425
- renderChannelActions: E,
2426
- renderMessage: L,
2427
- onMessageLinkClick: D,
2428
- sendButton: C,
2440
+ customChannelActions: B,
2441
+ renderChannelActions: M,
2442
+ renderMessage: N,
2443
+ onMessageLinkClick: T,
2444
+ sendButton: k,
2429
2445
  attachmentPreviewList: I,
2430
- viewerLanguage: T,
2446
+ viewerLanguage: C,
2431
2447
  showChannelInfo: O = !0,
2432
- onParticipantNameClick: F
2448
+ onParticipantNameClick: $
2433
2449
  }) => {
2434
- const Y = K(
2435
- async (J, U, w) => {
2450
+ const j = Z(
2451
+ async (K, V, _) => {
2436
2452
  var W;
2437
- const k = ((W = e.data) == null ? void 0 : W.chatbot_paused) === !0, B = x && !k, q = {
2438
- ...U,
2439
- ...B && { silent: !0 },
2453
+ const E = ((W = e.data) == null ? void 0 : W.chatbot_paused) === !0, F = p && !E, q = {
2454
+ ...V,
2455
+ ...F && { silent: !0 },
2440
2456
  ...A && {
2441
2457
  metadata: {
2442
- ...U.metadata ?? {},
2458
+ ...V.metadata ?? {},
2443
2459
  ...A
2444
2460
  }
2445
2461
  }
2446
- }, H = {
2447
- ...w,
2448
- ...B && { skip_push: !0 }
2449
- }, V = await e.sendMessage(q, H);
2450
- return M == null || M(V), V;
2462
+ }, Y = {
2463
+ ..._,
2464
+ ...F && { skip_push: !0 }
2465
+ }, G = await e.sendMessage(q, Y);
2466
+ return R == null || R(G), G;
2451
2467
  },
2452
- [e, x, A, M]
2453
- ), Z = G(null);
2454
- return X(() => {
2455
- if (!D) return;
2456
- const J = Z.current;
2457
- if (!J) return;
2458
- const U = (w) => {
2459
- const k = w.target, B = k == null ? void 0 : k.closest("a[href]"), q = B == null ? void 0 : B.getAttribute("href");
2468
+ [e, p, A, R]
2469
+ ), X = H(null);
2470
+ return J(() => {
2471
+ if (!T) return;
2472
+ const K = X.current;
2473
+ if (!K) return;
2474
+ const V = (_) => {
2475
+ const E = _.target, F = E == null ? void 0 : E.closest("a[href]"), q = F == null ? void 0 : F.getAttribute("href");
2460
2476
  if (!q) return;
2461
- const H = B == null ? void 0 : B.closest("[data-message-id]"), V = H == null ? void 0 : H.getAttribute("data-message-id"), W = V ? e.state.messages.find((de) => de.id === V) : void 0;
2462
- D(q, W);
2477
+ const Y = F == null ? void 0 : F.closest("[data-message-id]"), G = Y == null ? void 0 : Y.getAttribute("data-message-id"), W = G ? e.state.messages.find((de) => de.id === G) : void 0;
2478
+ T(q, W);
2463
2479
  };
2464
- return J.addEventListener("click", U), () => J.removeEventListener("click", U);
2465
- }, [D, e]), /* @__PURE__ */ n(
2480
+ return K.addEventListener("click", V), () => K.removeEventListener("click", V);
2481
+ }, [T, e]), /* @__PURE__ */ n(
2466
2482
  "div",
2467
2483
  {
2468
- ref: Z,
2469
- className: N(
2484
+ ref: X,
2485
+ className: y(
2470
2486
  "messaging-channel-view h-full flex flex-col",
2471
2487
  d
2472
2488
  ),
2473
- children: /* @__PURE__ */ n(dn.Provider, { value: x ?? !1, children: /* @__PURE__ */ n(
2474
- os,
2489
+ children: /* @__PURE__ */ n(un.Provider, { value: p ?? !1, children: /* @__PURE__ */ n(
2490
+ ls,
2475
2491
  {
2476
2492
  channel: e,
2477
- MessageSystem: Ha,
2493
+ MessageSystem: qa,
2478
2494
  EmptyStateIndicator: m,
2479
- LoadingIndicator: Se,
2480
- DateSeparator: Vs,
2481
- TypingIndicator: qa,
2482
- doSendMessageRequest: Y,
2483
- ...C ? { SendButton: C } : {},
2495
+ LoadingIndicator: Ie,
2496
+ DateSeparator: Hs,
2497
+ TypingIndicator: Xa,
2498
+ doSendMessageRequest: j,
2499
+ ...k ? { SendButton: k } : {},
2484
2500
  ...I ? { AttachmentPreviewList: I } : {},
2485
2501
  children: /* @__PURE__ */ n(
2486
- Za,
2502
+ er,
2487
2503
  {
2488
2504
  onBack: t,
2489
2505
  showBackButton: s,
@@ -2497,21 +2513,21 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2497
2513
  onDeleteConversationClick: u,
2498
2514
  onBlockParticipantClick: f,
2499
2515
  onReportParticipantClick: c,
2500
- showBlockParticipant: b,
2501
- showReportParticipant: _,
2502
- composerDisabled: v,
2503
- composerDisabledReason: p,
2504
- showStarButton: y,
2505
- dmAgentEnabled: x,
2506
- chatbotVotingEnabled: R,
2507
- renderChannelBanner: z,
2516
+ showBlockParticipant: x,
2517
+ showReportParticipant: b,
2518
+ composerDisabled: w,
2519
+ composerDisabledReason: v,
2520
+ showStarButton: L,
2521
+ dmAgentEnabled: p,
2522
+ chatbotVotingEnabled: S,
2523
+ renderChannelBanner: D,
2508
2524
  renderHeaderTitleBadges: P,
2509
- customChannelActions: S,
2510
- renderChannelActions: E,
2511
- renderMessage: L,
2512
- viewerLanguage: T,
2525
+ customChannelActions: B,
2526
+ renderChannelActions: M,
2527
+ renderMessage: N,
2528
+ viewerLanguage: C,
2513
2529
  showChannelInfo: O,
2514
- onParticipantNameClick: F
2530
+ onParticipantNameClick: $
2515
2531
  }
2516
2532
  )
2517
2533
  }
@@ -2520,8 +2536,8 @@ const oe = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2520
2536
  );
2521
2537
  }
2522
2538
  );
2523
- un.displayName = "ChannelView";
2524
- const be = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
2539
+ mn.displayName = "ChannelView";
2540
+ const pe = U.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ h("div", { className: "text-center max-w-sm", children: [
2525
2541
  /* @__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: "⚠️" }) }),
2526
2542
  /* @__PURE__ */ n("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
2527
2543
  /* @__PURE__ */ n("p", { className: "text-stone text-sm mb-6", children: e }),
@@ -2535,8 +2551,8 @@ const be = j.memo(({ message: e, onBack: t }) => /* @__PURE__ */ n("div", { clas
2535
2551
  }
2536
2552
  )
2537
2553
  ] }) }));
2538
- be.displayName = "ErrorState";
2539
- const ki = ({
2554
+ pe.displayName = "ErrorState";
2555
+ const Si = ({
2540
2556
  capabilities: e = {},
2541
2557
  renderMessageInputActions: t,
2542
2558
  renderConversationFooter: s,
@@ -2551,77 +2567,77 @@ const ki = ({
2551
2567
  onMessageSent: u,
2552
2568
  chatbotVotingEnabled: f = !1,
2553
2569
  viewerLanguage: c,
2554
- renderHeaderTitleBadges: b,
2555
- renderChannelBanner: _,
2556
- customChannelActions: v,
2557
- renderChannelActions: p,
2558
- onParticipantNameClick: x,
2570
+ renderHeaderTitleBadges: x,
2571
+ renderChannelBanner: b,
2572
+ customChannelActions: w,
2573
+ renderChannelActions: v,
2574
+ onParticipantNameClick: p,
2559
2575
  renderMessage: A,
2560
- onMessageLinkClick: M,
2561
- showChannelInfo: y
2576
+ onMessageLinkClick: R,
2577
+ showChannelInfo: L
2562
2578
  }) => {
2563
2579
  const {
2564
- client: R,
2565
- isConnected: z,
2580
+ client: S,
2581
+ isConnected: D,
2566
2582
  isLoading: P,
2567
- error: S,
2568
- refreshConnection: E,
2569
- service: L,
2570
- debug: D
2571
- } = Ps(), [C, I] = $(null), [T, O] = $(null), [F, Y] = $(!1), { showDeleteConversation: Z = !0 } = e, J = G(o);
2572
- J.current = o;
2573
- const U = G(a);
2574
- U.current = a;
2575
- const w = G(null), k = G(null);
2576
- X(() => {
2577
- k.current = C;
2578
- }, [C]), X(() => {
2579
- if (!R || !z) return;
2580
- const H = R.userID;
2581
- if (!H) return;
2582
- const V = `${H}::${i}`;
2583
- if (w.current === V) return;
2584
- w.current = V;
2583
+ error: B,
2584
+ refreshConnection: M,
2585
+ service: N,
2586
+ debug: T
2587
+ } = $s(), [k, I] = z(null), [C, O] = z(null), [$, j] = z(!1), { showDeleteConversation: X = !0 } = e, K = H(o);
2588
+ K.current = o;
2589
+ const V = H(a);
2590
+ V.current = a;
2591
+ const _ = H(null), E = H(null);
2592
+ J(() => {
2593
+ E.current = k;
2594
+ }, [k]), J(() => {
2595
+ if (!S || !D) return;
2596
+ const Y = S.userID;
2597
+ if (!Y) return;
2598
+ const G = `${Y}::${i}`;
2599
+ if (_.current === G) return;
2600
+ _.current = G;
2585
2601
  const W = () => {
2586
- w.current === V && (w.current = null);
2602
+ _.current === G && (_.current = null);
2587
2603
  };
2588
2604
  (async () => {
2589
2605
  var ue, me;
2590
2606
  try {
2591
- D && console.log(
2607
+ T && console.log(
2592
2608
  "[MessagingShell] Loading initial conversation with:",
2593
2609
  i
2594
2610
  );
2595
- const te = await R.queryChannels(
2611
+ const te = await S.queryChannels(
2596
2612
  {
2597
2613
  type: "messaging",
2598
- members: { $eq: [H, i] }
2614
+ members: { $eq: [Y, i] }
2599
2615
  },
2600
2616
  {},
2601
2617
  { limit: 1 }
2602
2618
  );
2603
2619
  if (te.length > 0) {
2604
- I(te[0]), O(null), (ue = U.current) == null || ue.call(U, te[0]), D && console.log(
2620
+ I(te[0]), O(null), (ue = V.current) == null || ue.call(V, te[0]), T && console.log(
2605
2621
  "[MessagingShell] Initial conversation loaded:",
2606
2622
  te[0].id
2607
2623
  );
2608
2624
  return;
2609
2625
  }
2610
- const Q = J.current;
2611
- if (!Q || !L) {
2612
- W(), O("No conversation found with this account"), D && console.log(
2626
+ const Q = K.current;
2627
+ if (!Q || !N) {
2628
+ W(), O("No conversation found with this account"), T && console.log(
2613
2629
  "[MessagingShell] No conversation found for:",
2614
2630
  i
2615
2631
  );
2616
2632
  return;
2617
2633
  }
2618
2634
  try {
2619
- const ee = await L.startChannelWithParticipant({
2635
+ const ee = await N.startChannelWithParticipant({
2620
2636
  id: Q.id,
2621
2637
  name: Q.name,
2622
2638
  phone: Q.phone
2623
2639
  });
2624
- I(ee), O(null), (me = U.current) == null || me.call(U, ee), D && console.log(
2640
+ I(ee), O(null), (me = V.current) == null || me.call(V, ee), T && console.log(
2625
2641
  "[MessagingShell] Channel created and loaded:",
2626
2642
  ee.id
2627
2643
  );
@@ -2635,75 +2651,75 @@ const ki = ({
2635
2651
  console.error(
2636
2652
  "[MessagingShell] Failed to load initial conversation:",
2637
2653
  te
2638
- ), W(), k.current || O("Failed to load conversation");
2654
+ ), W(), E.current || O("Failed to load conversation");
2639
2655
  }
2640
2656
  })();
2641
- }, [i, R, z, L, D]);
2642
- const B = G(r);
2643
- B.current = r;
2644
- const q = K(() => {
2645
- var H;
2646
- I(null), Y(!0), (H = B.current) == null || H.call(B);
2657
+ }, [i, S, D, N, T]);
2658
+ const F = H(r);
2659
+ F.current = r;
2660
+ const q = Z(() => {
2661
+ var Y;
2662
+ I(null), j(!0), (Y = F.current) == null || Y.call(F);
2647
2663
  }, []);
2648
- return P ? /* @__PURE__ */ n(Se, {}) : S ? /* @__PURE__ */ n(be, { message: S, onBack: E }) : !z || !R ? /* @__PURE__ */ n(
2649
- be,
2664
+ return P ? /* @__PURE__ */ n(Ie, {}) : B ? /* @__PURE__ */ n(pe, { message: B, onBack: M }) : !D || !S ? /* @__PURE__ */ n(
2665
+ pe,
2650
2666
  {
2651
2667
  message: "Not connected to messaging service",
2652
- onBack: E
2668
+ onBack: M
2653
2669
  }
2654
- ) : T ? /* @__PURE__ */ n(be, { message: T }) : F && !C ? /* @__PURE__ */ n(be, { 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(
2655
- un,
2670
+ ) : C ? /* @__PURE__ */ n(pe, { message: C }) : $ && !k ? /* @__PURE__ */ n(pe, { message: "Conversation ended" }) : k ? /* @__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(
2671
+ mn,
2656
2672
  {
2657
- channel: C,
2673
+ channel: k,
2658
2674
  renderMessageInputActions: t,
2659
2675
  renderConversationFooter: s,
2660
- renderChannelBanner: _,
2676
+ renderChannelBanner: b,
2661
2677
  onLeaveConversation: q,
2662
2678
  onBlockParticipant: q,
2663
2679
  CustomChannelEmptyState: l,
2664
- showDeleteConversation: Z,
2680
+ showDeleteConversation: X,
2665
2681
  onBlockParticipantClick: d,
2666
2682
  onReportParticipantClick: m,
2667
2683
  dmAgentEnabled: g,
2668
2684
  onMessageSent: u,
2669
2685
  chatbotVotingEnabled: f,
2670
2686
  viewerLanguage: c,
2671
- renderHeaderTitleBadges: b,
2672
- customChannelActions: v,
2673
- renderChannelActions: p,
2674
- onParticipantNameClick: x,
2687
+ renderHeaderTitleBadges: x,
2688
+ customChannelActions: w,
2689
+ renderChannelActions: v,
2690
+ onParticipantNameClick: p,
2675
2691
  renderMessage: A,
2676
- onMessageLinkClick: M,
2677
- showChannelInfo: y
2692
+ onMessageLinkClick: R,
2693
+ showChannelInfo: L
2678
2694
  },
2679
- C.id
2680
- ) }) }) : /* @__PURE__ */ n(Se, {});
2695
+ k.id
2696
+ ) }) }) : /* @__PURE__ */ n(Ie, {});
2681
2697
  };
2682
- function Qa(e) {
2698
+ function tr(e) {
2683
2699
  const t = e.state.pending_messages;
2684
2700
  if (t != null && t.length)
2685
2701
  for (const s of t)
2686
2702
  e.state.addMessageSorted(s.message);
2687
2703
  }
2688
- const mn = j.createContext({
2704
+ const hn = U.createContext({
2689
2705
  selectedChannel: void 0,
2690
2706
  onChannelSelect: () => {
2691
2707
  },
2692
2708
  debug: !1,
2693
2709
  renderMessagePreview: void 0,
2694
2710
  viewerLanguage: void 0
2695
- }), er = mn.Provider, tr = () => j.useContext(mn), nr = (e, t) => {
2711
+ }), nr = hn.Provider, sr = () => U.useContext(hn), ar = (e, t) => {
2696
2712
  const s = new Date(
2697
2713
  Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())
2698
2714
  ), r = new Date(
2699
2715
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
2700
2716
  ).getTime() - s.getTime();
2701
2717
  return Math.floor(r / (1e3 * 60 * 60 * 24));
2702
- }, sr = (e) => {
2718
+ }, rr = (e) => {
2703
2719
  const t = /* @__PURE__ */ new Date();
2704
2720
  if (Math.floor((t.getTime() - e.getTime()) / 1e3) < 60)
2705
2721
  return "Just now";
2706
- const a = nr(e, t);
2722
+ const a = ar(e, t);
2707
2723
  return a === 0 ? e.toLocaleTimeString([], {
2708
2724
  hour: "numeric",
2709
2725
  minute: "2-digit",
@@ -2713,50 +2729,50 @@ const mn = j.createContext({
2713
2729
  day: "numeric",
2714
2730
  year: "2-digit"
2715
2731
  });
2716
- }, hn = j.memo(
2732
+ }, fn = U.memo(
2717
2733
  ({ channel: e, unread: t }) => {
2718
- var R, z, P;
2734
+ var D, P, B, M;
2719
2735
  const {
2720
2736
  selectedChannel: s,
2721
2737
  onChannelSelect: a,
2722
2738
  debug: r,
2723
2739
  renderMessagePreview: i,
2724
2740
  viewerLanguage: o
2725
- } = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
2741
+ } = sr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
2726
2742
  e && a(e);
2727
- }, m = (S) => {
2728
- const E = S.key === "Enter" || S.key === " ", L = S.repeat;
2729
- !E || L || (S.preventDefault(), d());
2730
- }, u = Object.values(((R = e == null ? void 0 : e.state) == null ? void 0 : R.members) || {}).find(
2731
- (S) => {
2732
- var E, L;
2733
- return ((E = S.user) == null ? void 0 : E.id) && S.user.id !== ((L = e == null ? void 0 : e._client) == null ? void 0 : L.userID);
2743
+ }, m = (N) => {
2744
+ const T = N.key === "Enter" || N.key === " ", k = N.repeat;
2745
+ !T || k || (N.preventDefault(), d());
2746
+ }, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
2747
+ (N) => {
2748
+ var T, k;
2749
+ return ((T = N.user) == null ? void 0 : T.id) && N.user.id !== ((k = e == null ? void 0 : e._client) == null ? void 0 : k.userID);
2734
2750
  }
2735
- ), f = Xt(u == null ? void 0 : u.user), c = (z = u == null ? void 0 : u.user) == null ? void 0 : z.image, b = (() => {
2736
- var E;
2737
- const S = (E = e == null ? void 0 : e.state) == null ? void 0 : E.messages;
2738
- if (S != null && S.length) {
2739
- for (let L = S.length - 1; L >= 0; L--)
2740
- if (S[L].type !== "system") return S[L];
2751
+ ), f = Kt(u == null ? void 0 : u.user), c = (P = u == null ? void 0 : u.user) == null ? void 0 : P.image, x = ((B = u == null ? void 0 : u.user) == null ? void 0 : B.is_verified) === !0, b = (() => {
2752
+ var T;
2753
+ const N = (T = e == null ? void 0 : e.state) == null ? void 0 : T.messages;
2754
+ if (N != null && N.length) {
2755
+ for (let k = N.length - 1; k >= 0; k--)
2756
+ if (N[k].type !== "system") return N[k];
2741
2757
  }
2742
2758
  })(), v = (() => {
2743
- var I, T, O, F;
2744
- const S = Kt({
2759
+ var O, $, j, X;
2760
+ const N = Jt({
2745
2761
  message: b,
2746
2762
  viewerLanguage: o
2747
2763
  });
2748
- if (((I = b == null ? void 0 : b.metadata) == null ? void 0 : I.custom_type) === "MESSAGE_TIP") return S ? `💵 ${S}` : "💵 Sent a tip";
2749
- if (((T = b == null ? void 0 : b.metadata) == null ? void 0 : T.custom_type) === "MESSAGE_PAID") return S ? `💰 ${S}` : "💰 Sent a message";
2750
- if (((O = b == null ? void 0 : b.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_ATTACHMENT") return S ? `📎 ${S}` : "📎 Sent an attachment";
2751
- if (S) return S;
2752
- const C = (F = b == null ? void 0 : b.attachments) == null ? void 0 : F[0];
2764
+ if (((O = b == null ? void 0 : b.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
2765
+ if ((($ = b == null ? void 0 : b.metadata) == null ? void 0 : $.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
2766
+ if (((j = b == null ? void 0 : b.metadata) == null ? void 0 : j.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
2767
+ if (N) return N;
2768
+ const C = (X = b == null ? void 0 : b.attachments) == null ? void 0 : X[0];
2753
2769
  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";
2754
- })(), p = b != null && b.created_at ? sr(new Date(b.created_at)) : "", x = b ? Ee(b) : !1, A = i ? i(b, v) : `${x ? "✨ " : ""}${v}`, M = Wt(e), y = t ?? 0;
2770
+ })(), p = b != null && b.created_at ? rr(new Date(b.created_at)) : "", A = b ? Se(b) : !1, R = i ? i(b, v) : `${A ? "✨ " : ""}${v}`, L = Xt(e), S = t ?? 0;
2755
2771
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
2756
2772
  channelId: e == null ? void 0 : e.id,
2757
2773
  isSelected: l,
2758
2774
  participantName: f,
2759
- unreadCount: y,
2775
+ unreadCount: S,
2760
2776
  hasTimestamp: !!p
2761
2777
  }), /* @__PURE__ */ n(
2762
2778
  "div",
@@ -2765,7 +2781,7 @@ const mn = j.createContext({
2765
2781
  tabIndex: 0,
2766
2782
  onClick: d,
2767
2783
  onKeyDown: m,
2768
- className: N(
2784
+ className: y(
2769
2785
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
2770
2786
  {
2771
2787
  "bg-black/[0.04]": l,
@@ -2776,32 +2792,25 @@ const mn = j.createContext({
2776
2792
  /* @__PURE__ */ n(
2777
2793
  ie,
2778
2794
  {
2779
- id: ((P = u == null ? void 0 : u.user) == null ? void 0 : P.id) || e.id || "unknown",
2795
+ id: ((M = u == null ? void 0 : u.user) == null ? void 0 : M.id) || e.id || "unknown",
2780
2796
  name: f,
2781
2797
  image: c,
2782
2798
  size: 48,
2783
- starred: M
2799
+ starred: L
2784
2800
  }
2785
2801
  ),
2786
2802
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
2787
2803
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2", children: [
2788
- /* @__PURE__ */ h(
2789
- "h3",
2790
- {
2791
- className: N(
2792
- "text-sm font-medium truncate text-[#191918]"
2793
- ),
2794
- children: [
2795
- M && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2796
- f
2797
- ]
2798
- }
2799
- ),
2804
+ /* @__PURE__ */ h("h3", { className: "flex min-w-0 items-center gap-1 text-sm font-medium text-[#191918]", children: [
2805
+ L && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2806
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: f }),
2807
+ x && /* @__PURE__ */ n(be, {})
2808
+ ] }),
2800
2809
  p && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: p })
2801
2810
  ] }),
2802
2811
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
2803
- /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
2804
- y > 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: y > 99 ? "99+" : y })
2812
+ /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: R }),
2813
+ S > 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: S > 99 ? "99+" : S })
2805
2814
  ] })
2806
2815
  ] })
2807
2816
  ] })
@@ -2809,27 +2818,27 @@ const mn = j.createContext({
2809
2818
  );
2810
2819
  }
2811
2820
  );
2812
- hn.displayName = "CustomChannelPreview";
2813
- const ar = { last_message_at: -1 }, rr = j.memo(
2821
+ fn.displayName = "CustomChannelPreview";
2822
+ const ir = { last_message_at: -1 }, or = U.memo(
2814
2823
  ({
2815
2824
  onChannelSelect: e,
2816
2825
  selectedChannel: t,
2817
2826
  filters: s,
2818
2827
  allowNewMessagesFromUnfilteredChannels: a = !1,
2819
2828
  channelRenderFilterFn: r,
2820
- sort: i = ar,
2829
+ sort: i = ir,
2821
2830
  className: o,
2822
2831
  customEmptyStateIndicator: l,
2823
2832
  renderMessagePreview: d,
2824
2833
  viewerLanguage: m
2825
2834
  }) => {
2826
- const g = j.useRef(0);
2835
+ const g = U.useRef(0);
2827
2836
  g.current++;
2828
- const { debug: u = !1 } = Xe(), f = j.useCallback(
2829
- (b) => {
2830
- for (const _ of b)
2831
- Qa(_);
2832
- return r ? r(b) : b;
2837
+ const { debug: u = !1 } = Ke(), f = U.useCallback(
2838
+ (x) => {
2839
+ for (const b of x)
2840
+ tr(b);
2841
+ return r ? r(x) : x;
2833
2842
  },
2834
2843
  [r]
2835
2844
  );
@@ -2838,7 +2847,7 @@ const ar = { last_message_at: -1 }, rr = j.memo(
2838
2847
  selectedChannelId: t == null ? void 0 : t.id,
2839
2848
  filters: s
2840
2849
  });
2841
- const c = j.useMemo(
2850
+ const c = U.useMemo(
2842
2851
  () => ({
2843
2852
  selectedChannel: t,
2844
2853
  onChannelSelect: e,
@@ -2857,20 +2866,20 @@ const ar = { last_message_at: -1 }, rr = j.memo(
2857
2866
  return /* @__PURE__ */ n(
2858
2867
  "div",
2859
2868
  {
2860
- className: N(
2869
+ className: y(
2861
2870
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
2862
2871
  o
2863
2872
  ),
2864
- children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(er, { value: c, children: /* @__PURE__ */ n(
2865
- us,
2873
+ children: /* @__PURE__ */ n("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ n(nr, { value: c, children: /* @__PURE__ */ n(
2874
+ ms,
2866
2875
  {
2867
2876
  filters: s,
2868
2877
  sort: i,
2869
2878
  options: { limit: 30 },
2870
2879
  allowNewMessagesFromUnfilteredChannels: a,
2871
2880
  channelRenderFilterFn: f,
2872
- Paginator: ms,
2873
- Preview: hn,
2881
+ Paginator: hs,
2882
+ Preview: fn,
2874
2883
  EmptyStateIndicator: l
2875
2884
  },
2876
2885
  `${JSON.stringify(s)}:${JSON.stringify(i)}`
@@ -2879,27 +2888,27 @@ const ar = { last_message_at: -1 }, rr = j.memo(
2879
2888
  );
2880
2889
  }
2881
2890
  );
2882
- rr.displayName = "ChannelList";
2883
- const ir = /^([a-z][a-z0-9+.-]*):/i, or = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2884
- function tt(e) {
2891
+ or.displayName = "ChannelList";
2892
+ const lr = /^([a-z][a-z0-9+.-]*):/i, cr = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
2893
+ function nt(e) {
2885
2894
  if (typeof e != "string") return;
2886
2895
  const t = e.trim();
2887
2896
  if (t === "") return;
2888
- const s = ir.exec(t);
2897
+ const s = lr.exec(t);
2889
2898
  if (s) {
2890
2899
  const a = s[1].toLowerCase();
2891
- return or.has(a) ? t : void 0;
2900
+ return cr.has(a) ? t : void 0;
2892
2901
  }
2893
2902
  return t.startsWith("//") || t.startsWith("/") ? t : `https://${t}`;
2894
2903
  }
2895
- const lr = {
2904
+ const dr = {
2896
2905
  dark: "bg-white text-[#121110] hover:bg-white/90",
2897
2906
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2898
- }, cr = ({ variant: e, cta: t }) => {
2899
- const s = N(
2907
+ }, ur = ({ variant: e, cta: t }) => {
2908
+ const s = y(
2900
2909
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2901
- lr[e]
2902
- ), a = tt(t.href);
2910
+ dr[e]
2911
+ ), a = nt(t.href);
2903
2912
  return a ? /* @__PURE__ */ n(
2904
2913
  "a",
2905
2914
  {
@@ -2925,13 +2934,13 @@ const lr = {
2925
2934
  children: t.label
2926
2935
  }
2927
2936
  );
2928
- }, dr = {
2937
+ }, mr = {
2929
2938
  dark: "text-white",
2930
2939
  light: "text-black/90"
2931
- }, ur = "text-white/30", mr = {
2940
+ }, hr = "text-white/30", fr = {
2932
2941
  dark: "text-white/55",
2933
2942
  light: "text-black/55"
2934
- }, nt = ({
2943
+ }, st = ({
2935
2944
  variant: e,
2936
2945
  title: t,
2937
2946
  placeholderTitle: s,
@@ -2941,14 +2950,14 @@ const lr = {
2941
2950
  cta: o,
2942
2951
  trailingAction: l
2943
2952
  }) => {
2944
- const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = o != null;
2945
- if (!g && !u && !c && !b) return null;
2946
- const v = N(
2953
+ const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", x = o != null;
2954
+ if (!g && !u && !c && !x) return null;
2955
+ const w = y(
2947
2956
  "truncate text-base font-medium leading-6",
2948
- d && !t ? ur : dr[e]
2949
- ), p = N(
2957
+ d && !t ? hr : mr[e]
2958
+ ), v = y(
2950
2959
  "truncate text-xs leading-4",
2951
- mr[e]
2960
+ fr[e]
2952
2961
  );
2953
2962
  return /* @__PURE__ */ h("div", { className: "px-4 py-3", children: [
2954
2963
  /* @__PURE__ */ h("div", { className: "flex items-end gap-3", children: [
@@ -2956,24 +2965,24 @@ const lr = {
2956
2965
  /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
2957
2966
  g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
2958
2967
  i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
2959
- /* @__PURE__ */ n("p", { className: N("min-w-0", v), children: m })
2968
+ /* @__PURE__ */ n("p", { className: y("min-w-0", w), children: m })
2960
2969
  ] }),
2961
- u && /* @__PURE__ */ n("p", { className: p, children: a })
2970
+ u && /* @__PURE__ */ n("p", { className: v, children: a })
2962
2971
  ] }),
2963
- !b && c && /* @__PURE__ */ n("p", { className: p, children: f })
2972
+ !x && c && /* @__PURE__ */ n("p", { className: v, children: f })
2964
2973
  ] }),
2965
2974
  l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
2966
2975
  ] }),
2967
- o && /* @__PURE__ */ n(cr, { variant: e, cta: o })
2976
+ o && /* @__PURE__ */ n(ur, { variant: e, cta: o })
2968
2977
  ] });
2969
- }, hr = N(
2978
+ }, gr = y(
2970
2979
  "relative block w-[280px] select-none overflow-hidden rounded-md",
2971
2980
  // 1px hairline border that sits flush with the card chrome — matches
2972
2981
  // the messaging design system's "small border around link attachments"
2973
2982
  // treatment from the mobile spec. The drop shadow remains for depth.
2974
2983
  "border border-black/[0.08]",
2975
2984
  "shadow-[0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]"
2976
- ), Ie = ({
2985
+ ), Te = ({
2977
2986
  variant: e,
2978
2987
  children: t,
2979
2988
  href: s,
@@ -2984,8 +2993,8 @@ const lr = {
2984
2993
  bgClassName: l,
2985
2994
  "data-testid": d
2986
2995
  }) => {
2987
- const m = s != null || a != null, g = N(
2988
- hr,
2996
+ const m = s != null || a != null, g = y(
2997
+ gr,
2989
2998
  l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
2990
2999
  // `focus-ring` is a design-system utility from the component-library
2991
3000
  // tailwind preset — outline-none + a black 2px focus-visible ring
@@ -3015,7 +3024,7 @@ const lr = {
3015
3024
  onClick: a,
3016
3025
  "aria-label": r,
3017
3026
  "data-testid": d,
3018
- className: N(g, "text-left"),
3027
+ className: y(g, "text-left"),
3019
3028
  children: [
3020
3029
  t,
3021
3030
  u
@@ -3033,17 +3042,17 @@ const lr = {
3033
3042
  ]
3034
3043
  }
3035
3044
  );
3036
- }, fr = {
3045
+ }, br = {
3037
3046
  dark: "bg-white/10",
3038
3047
  light: "bg-black/5"
3039
- }, gr = {
3048
+ }, pr = {
3040
3049
  dark: "size-16 text-white/25",
3041
3050
  light: "size-16 text-black/25"
3042
- }, Re = (e, t) => !!t && !!e && re(e) === "audio", fn = (e, t) => {
3051
+ }, Le = (e, t) => !!t && !!e && re(e) === "audio", gn = (e, t) => {
3043
3052
  if (!t || !e) return !1;
3044
3053
  const s = re(e);
3045
3054
  return s === "video" || s === "audio";
3046
- }, st = "bg-[#F2F3F4]", Te = ({
3055
+ }, at = "bg-[#F2F3F4]", Ae = ({
3047
3056
  variant: e,
3048
3057
  thumbnailUrl: t,
3049
3058
  sourceUrl: s,
@@ -3053,7 +3062,7 @@ const lr = {
3053
3062
  topRight: o
3054
3063
  }) => {
3055
3064
  const l = re(r), d = !!s && l === "video";
3056
- return Re(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
3065
+ return Le(r, s) ? /* @__PURE__ */ n("div", { className: "p-3", children: /* @__PURE__ */ n(
3057
3066
  "audio",
3058
3067
  {
3059
3068
  src: s,
@@ -3065,7 +3074,7 @@ const lr = {
3065
3074
  ) }) : /* @__PURE__ */ h(
3066
3075
  "div",
3067
3076
  {
3068
- className: N(
3077
+ className: y(
3069
3078
  "relative h-[180px] w-full overflow-hidden",
3070
3079
  d && "bg-black"
3071
3080
  ),
@@ -3092,12 +3101,12 @@ const lr = {
3092
3101
  ) : /* @__PURE__ */ n(
3093
3102
  "div",
3094
3103
  {
3095
- className: N(
3104
+ className: y(
3096
3105
  "flex h-full w-full items-center justify-center",
3097
- fr[e]
3106
+ br[e]
3098
3107
  ),
3099
3108
  children: le(r, {
3100
- className: gr[e],
3109
+ className: pr[e],
3101
3110
  weight: "regular"
3102
3111
  })
3103
3112
  }
@@ -3107,7 +3116,7 @@ const lr = {
3107
3116
  ]
3108
3117
  }
3109
3118
  );
3110
- }, br = ({
3119
+ }, vr = ({
3111
3120
  title: e,
3112
3121
  placeholderTitle: t,
3113
3122
  description: s,
@@ -3121,28 +3130,28 @@ const lr = {
3121
3130
  onDismiss: g,
3122
3131
  onEditClick: u
3123
3132
  }) => {
3124
- const f = l === "classic", c = Re(r, o), b = g ? /* @__PURE__ */ n(
3133
+ const f = l === "classic", c = Le(r, o), x = g ? /* @__PURE__ */ n(
3125
3134
  "button",
3126
3135
  {
3127
3136
  type: "button",
3128
3137
  onClick: g,
3129
3138
  "aria-label": "Dismiss attachment",
3130
3139
  className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
3131
- children: /* @__PURE__ */ n(Me, { className: "size-3", weight: "bold" })
3140
+ children: /* @__PURE__ */ n(Re, { className: "size-3", weight: "bold" })
3132
3141
  }
3133
- ) : void 0, _ = u ? /* @__PURE__ */ n(
3142
+ ) : void 0, b = u ? /* @__PURE__ */ n(
3134
3143
  "button",
3135
3144
  {
3136
3145
  type: "button",
3137
3146
  onClick: u,
3138
3147
  "aria-label": "Edit attachment",
3139
3148
  className: "flex size-10 items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/15",
3140
- children: /* @__PURE__ */ n(Ls, { className: "size-5", weight: "regular" })
3149
+ children: /* @__PURE__ */ n(Ps, { className: "size-5", weight: "regular" })
3141
3150
  }
3142
3151
  ) : void 0;
3143
- return c ? /* @__PURE__ */ n(Ie, { variant: "dark", bgClassName: st, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3152
+ return c ? /* @__PURE__ */ n(Te, { variant: "dark", bgClassName: at, children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2 pr-3", children: [
3144
3153
  /* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ n(
3145
- Te,
3154
+ Ae,
3146
3155
  {
3147
3156
  variant: "dark",
3148
3157
  sourceUrl: o,
@@ -3150,26 +3159,26 @@ const lr = {
3150
3159
  mimeType: r
3151
3160
  }
3152
3161
  ) }),
3153
- b && /* @__PURE__ */ n("div", { className: "shrink-0", children: b })
3162
+ x && /* @__PURE__ */ n("div", { className: "shrink-0", children: x })
3154
3163
  ] }) }) : /* @__PURE__ */ h(
3155
- Ie,
3164
+ Te,
3156
3165
  {
3157
3166
  variant: "dark",
3158
- topRight: f ? b : void 0,
3167
+ topRight: f ? x : void 0,
3159
3168
  children: [
3160
3169
  !f && /* @__PURE__ */ n(
3161
- Te,
3170
+ Ae,
3162
3171
  {
3163
3172
  variant: "dark",
3164
3173
  thumbnailUrl: i,
3165
3174
  sourceUrl: o,
3166
3175
  title: e,
3167
3176
  mimeType: r,
3168
- topRight: b
3177
+ topRight: x
3169
3178
  }
3170
3179
  ),
3171
3180
  /* @__PURE__ */ n(
3172
- nt,
3181
+ st,
3173
3182
  {
3174
3183
  variant: "dark",
3175
3184
  title: e,
@@ -3178,13 +3187,13 @@ const lr = {
3178
3187
  url: a,
3179
3188
  appIcon: d,
3180
3189
  cta: m,
3181
- trailingAction: _
3190
+ trailingAction: b
3182
3191
  }
3183
3192
  )
3184
3193
  ]
3185
3194
  }
3186
3195
  );
3187
- }, pr = ({
3196
+ }, xr = ({
3188
3197
  title: e,
3189
3198
  description: t,
3190
3199
  url: s,
@@ -3196,25 +3205,25 @@ const lr = {
3196
3205
  cta: d,
3197
3206
  onClick: m
3198
3207
  }) => {
3199
- const g = fn(a, i), u = tt(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Re(a, i) ? st : void 0, _ = d && m ? {
3208
+ const g = gn(a, i), u = nt(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, x = Le(a, i) ? at : void 0, b = d && m ? {
3200
3209
  ...d,
3201
3210
  onClick: () => {
3202
- var v;
3203
- m(), (v = d.onClick) == null || v.call(d);
3211
+ var w;
3212
+ m(), (w = d.onClick) == null || w.call(d);
3204
3213
  }
3205
3214
  } : d;
3206
3215
  return /* @__PURE__ */ h(
3207
- Ie,
3216
+ Te,
3208
3217
  {
3209
3218
  variant: "light",
3210
3219
  href: f,
3211
3220
  onClick: c,
3212
3221
  ariaLabel: e ?? "Open attachment preview",
3213
- bgClassName: b,
3222
+ bgClassName: x,
3214
3223
  "data-testid": "link-attachment",
3215
3224
  children: [
3216
3225
  o === "featured" && /* @__PURE__ */ n(
3217
- Te,
3226
+ Ae,
3218
3227
  {
3219
3228
  variant: "light",
3220
3229
  thumbnailUrl: r,
@@ -3224,20 +3233,20 @@ const lr = {
3224
3233
  }
3225
3234
  ),
3226
3235
  /* @__PURE__ */ n(
3227
- nt,
3236
+ st,
3228
3237
  {
3229
3238
  variant: "light",
3230
3239
  title: e,
3231
3240
  description: t,
3232
3241
  url: s,
3233
3242
  appIcon: l,
3234
- cta: _
3243
+ cta: b
3235
3244
  }
3236
3245
  )
3237
3246
  ]
3238
3247
  }
3239
3248
  );
3240
- }, vr = ({
3249
+ }, wr = ({
3241
3250
  title: e,
3242
3251
  placeholderTitle: t,
3243
3252
  description: s,
@@ -3250,17 +3259,17 @@ const lr = {
3250
3259
  cta: m,
3251
3260
  onClick: g
3252
3261
  }) => {
3253
- const u = fn(r, o), f = tt(a), c = m == null && f != null && !u ? f : void 0, b = m == null && !u && c != null ? g : void 0;
3262
+ const u = gn(r, o), f = nt(a), c = m == null && f != null && !u ? f : void 0, x = m == null && !u && c != null ? g : void 0;
3254
3263
  return /* @__PURE__ */ h(
3255
- Ie,
3264
+ Te,
3256
3265
  {
3257
3266
  variant: "dark",
3258
3267
  href: c,
3259
- onClick: b,
3260
- bgClassName: Re(r, o) ? st : void 0,
3268
+ onClick: x,
3269
+ bgClassName: Le(r, o) ? at : void 0,
3261
3270
  children: [
3262
3271
  l === "featured" && /* @__PURE__ */ n(
3263
- Te,
3272
+ Ae,
3264
3273
  {
3265
3274
  variant: "dark",
3266
3275
  thumbnailUrl: i,
@@ -3270,7 +3279,7 @@ const lr = {
3270
3279
  }
3271
3280
  ),
3272
3281
  /* @__PURE__ */ n(
3273
- nt,
3282
+ st,
3274
3283
  {
3275
3284
  variant: "dark",
3276
3285
  title: e,
@@ -3284,20 +3293,20 @@ const lr = {
3284
3293
  ]
3285
3294
  }
3286
3295
  );
3287
- }, Ei = {
3288
- Composer: br,
3289
- Sent: vr,
3290
- Received: pr
3291
- }, xr = {
3296
+ }, Ii = {
3297
+ Composer: vr,
3298
+ Sent: wr,
3299
+ Received: xr
3300
+ }, _r = {
3292
3301
  dark: "bg-[#121110]",
3293
3302
  light: "bg-[#e9eaed]"
3294
- }, wr = {
3303
+ }, Nr = {
3295
3304
  dark: "text-white",
3296
3305
  light: "text-[#080707]"
3297
- }, _r = {
3306
+ }, yr = {
3298
3307
  dark: "border-white/[0.08]",
3299
3308
  light: "border-black/[0.08]"
3300
- }, Nr = (e) => e === "dark" ? "sender" : "receiver", yr = {
3309
+ }, Cr = (e) => e === "dark" ? "sender" : "receiver", kr = {
3301
3310
  sender: {
3302
3311
  single: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]",
3303
3312
  first: "rounded-tl-[18px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[4px]",
@@ -3310,7 +3319,7 @@ const lr = {
3310
3319
  middle: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[4px] rounded-br-[18px]",
3311
3320
  end: "rounded-tl-[4px] rounded-tr-[18px] rounded-bl-[18px] rounded-br-[18px]"
3312
3321
  }
3313
- }, we = ({
3322
+ }, _e = ({
3314
3323
  variant: e,
3315
3324
  text: t,
3316
3325
  bordered: s = !0,
@@ -3319,13 +3328,13 @@ const lr = {
3319
3328
  children: i,
3320
3329
  "data-testid": o
3321
3330
  }) => {
3322
- const l = t != null && t !== "", d = yr[Nr(e)][a];
3331
+ const l = t != null && t !== "", d = kr[Cr(e)][a];
3323
3332
  return /* @__PURE__ */ h(
3324
3333
  "div",
3325
3334
  {
3326
3335
  "data-testid": o,
3327
3336
  "data-group-position": a,
3328
- className: N(
3337
+ className: y(
3329
3338
  // 280px-wide bubble — matches the mobile chat attachment width
3330
3339
  // and keeps the document / image / audio bubbles visually
3331
3340
  // consistent inside the conversation timeline. The 8px / 16px
@@ -3334,10 +3343,10 @@ const lr = {
3334
3343
  // as the surrounding `CustomMessage` text bubbles.
3335
3344
  "relative w-[280px] overflow-hidden px-2 py-2",
3336
3345
  d,
3337
- xr[e],
3338
- wr[e],
3346
+ _r[e],
3347
+ Nr[e],
3339
3348
  s && "border",
3340
- s && _r[e],
3349
+ s && yr[e],
3341
3350
  r
3342
3351
  ),
3343
3352
  children: [
@@ -3345,7 +3354,7 @@ const lr = {
3345
3354
  l ? /* @__PURE__ */ n(
3346
3355
  "p",
3347
3356
  {
3348
- className: N(
3357
+ className: y(
3349
3358
  // No `text-*` / `font-*` overrides here — caption inherits
3350
3359
  // the same font family + size as `.str-chat__message-text`
3351
3360
  // so it matches the surrounding `CustomMessage` bubbles.
@@ -3362,7 +3371,7 @@ const lr = {
3362
3371
  ]
3363
3372
  }
3364
3373
  );
3365
- }, _e = ({
3374
+ }, Ne = ({
3366
3375
  onClick: e,
3367
3376
  variant: t = "overlay",
3368
3377
  ariaLabel: s = "Dismiss attachment"
@@ -3374,22 +3383,22 @@ const lr = {
3374
3383
  a.stopPropagation(), e();
3375
3384
  },
3376
3385
  "aria-label": s,
3377
- className: N(
3386
+ className: y(
3378
3387
  "flex size-6 items-center justify-center rounded-full text-white",
3379
3388
  t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
3380
3389
  ),
3381
- children: /* @__PURE__ */ n(Me, { className: "size-3", weight: "bold" })
3390
+ children: /* @__PURE__ */ n(Re, { className: "size-3", weight: "bold" })
3382
3391
  }
3383
- ), Ne = (e) => e === "received" ? "light" : "dark", Si = ({
3392
+ ), ye = (e) => e === "received" ? "light" : "dark", Ti = ({
3384
3393
  firstOfGroup: e,
3385
3394
  endOfGroup: t,
3386
3395
  groupedByUser: s
3387
- }) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Cr = ({
3396
+ }) => !s || e && t ? "single" : e ? "first" : t ? "end" : "middle", Er = ({
3388
3397
  src: e,
3389
3398
  mimeType: t,
3390
3399
  filename: s,
3391
3400
  items: a
3392
- }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], kr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3401
+ }) => a && a.length > 0 ? a : e ? [{ src: e, mimeType: t, filename: s }] : [], Sr = ({ item: e, preload: t, trailingAction: s }) => /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
3393
3402
  /* @__PURE__ */ n(
3394
3403
  "audio",
3395
3404
  {
@@ -3401,7 +3410,7 @@ const lr = {
3401
3410
  }
3402
3411
  ),
3403
3412
  s ?? null
3404
- ] }), at = ({
3413
+ ] }), rt = ({
3405
3414
  state: e,
3406
3415
  src: t,
3407
3416
  mimeType: s,
@@ -3412,41 +3421,41 @@ const lr = {
3412
3421
  preload: l,
3413
3422
  onDismiss: d
3414
3423
  }) => {
3415
- const m = Ne(e), g = e === "composer" && !!d, u = Cr({ src: t, mimeType: s, filename: a, items: r });
3424
+ const m = ye(e), g = e === "composer" && !!d, u = Er({ src: t, mimeType: s, filename: a, items: r });
3416
3425
  if (u.length === 0)
3417
3426
  return null;
3418
3427
  const f = l ?? (u.length > 1 ? "none" : "metadata");
3419
3428
  return /* @__PURE__ */ n(
3420
- we,
3429
+ _e,
3421
3430
  {
3422
3431
  variant: m,
3423
3432
  text: i,
3424
3433
  groupPosition: o,
3425
3434
  "data-testid": "audio-attachment",
3426
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, b) => /* @__PURE__ */ n(
3427
- kr,
3435
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((c, x) => /* @__PURE__ */ n(
3436
+ Sr,
3428
3437
  {
3429
3438
  item: c,
3430
3439
  preload: f,
3431
3440
  trailingAction: (
3432
3441
  // Composer only supports a single attachment, so the
3433
3442
  // dismiss control sits on the only player.
3434
- g && b === 0 ? /* @__PURE__ */ n(_e, { onClick: d, variant: "inline" }) : void 0
3443
+ g && x === 0 ? /* @__PURE__ */ n(Ne, { onClick: d, variant: "inline" }) : void 0
3435
3444
  )
3436
3445
  },
3437
- `${c.src}-${b}`
3446
+ `${c.src}-${x}`
3438
3447
  )) })
3439
3448
  }
3440
3449
  );
3441
- }, Er = (e) => /* @__PURE__ */ n(at, { ...e, state: "composer" }), Sr = (e) => /* @__PURE__ */ n(at, { ...e, state: "sent" }), Ir = (e) => /* @__PURE__ */ n(at, { ...e, state: "received" }), Tr = {
3442
- Composer: Er,
3443
- Sent: Sr,
3444
- Received: Ir
3450
+ }, Ir = (e) => /* @__PURE__ */ n(rt, { ...e, state: "composer" }), Tr = (e) => /* @__PURE__ */ n(rt, { ...e, state: "sent" }), Ar = (e) => /* @__PURE__ */ n(rt, { ...e, state: "received" }), Mr = {
3451
+ Composer: Ir,
3452
+ Sent: Tr,
3453
+ Received: Ar
3445
3454
  };
3446
- function Ar(e) {
3455
+ function Rr(e) {
3447
3456
  return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : e < 1024 * 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(2)} MB` : `${(e / (1024 * 1024 * 1024)).toFixed(2)} GB`;
3448
3457
  }
3449
- const Mr = {
3458
+ const Lr = {
3450
3459
  pdf: "PDF",
3451
3460
  doc: "DOC",
3452
3461
  xls: "XLS",
@@ -3456,7 +3465,7 @@ const Mr = {
3456
3465
  text: "TXT",
3457
3466
  markdown: "MD"
3458
3467
  };
3459
- function Rr(e, t) {
3468
+ function Dr(e, t) {
3460
3469
  if (t) {
3461
3470
  const r = t.lastIndexOf(".");
3462
3471
  if (r > 0 && r < t.length - 1) {
@@ -3466,7 +3475,7 @@ function Rr(e, t) {
3466
3475
  }
3467
3476
  if (!e) return;
3468
3477
  if (re(e) === "document") {
3469
- const r = Qt(e), i = Mr[r];
3478
+ const r = en(e), i = Lr[r];
3470
3479
  if (i) return i;
3471
3480
  if (e === "application/octet-stream") return;
3472
3481
  }
@@ -3474,8 +3483,8 @@ function Rr(e, t) {
3474
3483
  if (!(!a || a === "*"))
3475
3484
  return a.toUpperCase();
3476
3485
  }
3477
- function Lr(e, t, s) {
3478
- const a = Rr(e, t), r = typeof s == "number" && s > 0 ? Ar(s) : void 0;
3486
+ function Pr(e, t, s) {
3487
+ const a = Dr(e, t), r = typeof s == "number" && s > 0 ? Rr(s) : void 0;
3479
3488
  return [a, r].filter(Boolean).join(" · ") || void 0;
3480
3489
  }
3481
3490
  function ne(e) {
@@ -3486,16 +3495,16 @@ function ne(e) {
3486
3495
  return "download";
3487
3496
  }
3488
3497
  }
3489
- const Dr = {
3498
+ const Or = {
3490
3499
  dark: "text-white/55",
3491
3500
  light: "text-black/65"
3492
- }, Or = {
3501
+ }, zr = {
3493
3502
  dark: "bg-white/10",
3494
3503
  light: "bg-black/5"
3495
- }, Pr = {
3504
+ }, $r = {
3496
3505
  dark: "text-white/85",
3497
3506
  light: "text-black/85"
3498
- }, gn = ({
3507
+ }, bn = ({
3499
3508
  variant: e,
3500
3509
  filename: t,
3501
3510
  title: s,
@@ -3505,16 +3514,16 @@ const Dr = {
3505
3514
  activateLabel: o,
3506
3515
  trailingAction: l
3507
3516
  }) => {
3508
- const d = s ?? t ?? "File", m = Lr(a, t, r), g = /* @__PURE__ */ n(
3517
+ const d = s ?? t ?? "File", m = Pr(a, t, r), g = /* @__PURE__ */ n(
3509
3518
  "div",
3510
3519
  {
3511
- className: N(
3520
+ className: y(
3512
3521
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
3513
- Or[e]
3522
+ zr[e]
3514
3523
  ),
3515
3524
  "aria-hidden": !0,
3516
3525
  children: le(a, {
3517
- className: N("size-6", Pr[e]),
3526
+ className: y("size-6", $r[e]),
3518
3527
  weight: "regular"
3519
3528
  })
3520
3529
  }
@@ -3523,9 +3532,9 @@ const Dr = {
3523
3532
  m ? /* @__PURE__ */ n(
3524
3533
  "p",
3525
3534
  {
3526
- className: N(
3535
+ className: y(
3527
3536
  "truncate text-xs leading-4",
3528
- Dr[e]
3537
+ Or[e]
3529
3538
  ),
3530
3539
  children: m
3531
3540
  }
@@ -3536,7 +3545,7 @@ const Dr = {
3536
3545
  type: "button",
3537
3546
  onClick: i,
3538
3547
  "aria-label": o,
3539
- className: N(
3548
+ className: y(
3540
3549
  "flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
3541
3550
  e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
3542
3551
  ),
@@ -3554,7 +3563,7 @@ const Dr = {
3554
3563
  l ? /* @__PURE__ */ n("div", { className: "shrink-0", children: l }) : null
3555
3564
  ] });
3556
3565
  };
3557
- async function bn(e, t) {
3566
+ async function pn(e, t) {
3558
3567
  const s = t ?? ne(e);
3559
3568
  try {
3560
3569
  const a = await fetch(e, { mode: "cors" });
@@ -3568,14 +3577,14 @@ async function bn(e, t) {
3568
3577
  }
3569
3578
  }
3570
3579
  }
3571
- const zr = ({
3580
+ const Fr = ({
3572
3581
  src: e,
3573
3582
  filename: t,
3574
3583
  fileSize: s,
3575
3584
  mimeType: a,
3576
3585
  title: r,
3577
3586
  items: i
3578
- }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], $r = ({
3587
+ }) => i && i.length > 0 ? i : e ? [{ src: e, filename: t, fileSize: s, mimeType: a, title: r }] : [], Br = ({
3579
3588
  variant: e,
3580
3589
  item: t,
3581
3590
  index: s,
@@ -3584,7 +3593,7 @@ const zr = ({
3584
3593
  }) => {
3585
3594
  const i = t.filename ?? ne(t.src);
3586
3595
  return /* @__PURE__ */ n(
3587
- gn,
3596
+ bn,
3588
3597
  {
3589
3598
  variant: e,
3590
3599
  filename: i,
@@ -3596,7 +3605,7 @@ const zr = ({
3596
3605
  trailingAction: r
3597
3606
  }
3598
3607
  );
3599
- }, rt = ({
3608
+ }, it = ({
3600
3609
  state: e,
3601
3610
  src: t,
3602
3611
  filename: s,
@@ -3609,58 +3618,58 @@ const zr = ({
3609
3618
  onClick: m,
3610
3619
  onDismiss: g
3611
3620
  }) => {
3612
- const u = Ne(e), f = e === "composer" && !!g, c = zr({
3621
+ const u = ye(e), f = e === "composer" && !!g, c = Fr({
3613
3622
  src: t,
3614
3623
  filename: s,
3615
3624
  fileSize: a,
3616
3625
  mimeType: r,
3617
3626
  title: i,
3618
3627
  items: o
3619
- }), b = (v) => {
3620
- if ((m == null ? void 0 : m(v)) === !1) return;
3621
- const p = c[v];
3622
- if (!p) return;
3623
- const x = p.filename ?? ne(p.src);
3624
- bn(p.src, x);
3628
+ }), x = (w) => {
3629
+ if ((m == null ? void 0 : m(w)) === !1) return;
3630
+ const v = c[w];
3631
+ if (!v) return;
3632
+ const p = v.filename ?? ne(v.src);
3633
+ pn(v.src, p);
3625
3634
  };
3626
3635
  if (c.length === 0)
3627
3636
  return null;
3628
- const _ = /* @__PURE__ */ n(
3637
+ const b = /* @__PURE__ */ n(
3629
3638
  "span",
3630
3639
  {
3631
- className: N(
3640
+ className: y(
3632
3641
  "flex size-8 items-center justify-center rounded-full",
3633
3642
  u === "dark" ? "text-white/70" : "text-black/70"
3634
3643
  ),
3635
3644
  "aria-hidden": !0,
3636
- children: /* @__PURE__ */ n(ve, { className: "size-5", weight: "bold" })
3645
+ children: /* @__PURE__ */ n(xe, { className: "size-5", weight: "bold" })
3637
3646
  }
3638
3647
  );
3639
3648
  return /* @__PURE__ */ n(
3640
- we,
3649
+ _e,
3641
3650
  {
3642
3651
  variant: u,
3643
3652
  text: l,
3644
3653
  groupPosition: d,
3645
3654
  "data-testid": "file-attachment",
3646
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, p) => /* @__PURE__ */ n(
3647
- $r,
3655
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((w, v) => /* @__PURE__ */ n(
3656
+ Br,
3648
3657
  {
3649
3658
  variant: u,
3650
- item: v,
3651
- index: p,
3652
- onActivate: b,
3653
- trailingAction: f && p === 0 ? /* @__PURE__ */ n(_e, { onClick: g, variant: "inline" }) : _
3659
+ item: w,
3660
+ index: v,
3661
+ onActivate: x,
3662
+ trailingAction: f && v === 0 ? /* @__PURE__ */ n(Ne, { onClick: g, variant: "inline" }) : b
3654
3663
  },
3655
- `${v.src}-${p}`
3664
+ `${w.src}-${v}`
3656
3665
  )) })
3657
3666
  }
3658
3667
  );
3659
- }, Fr = (e) => /* @__PURE__ */ n(rt, { ...e, state: "composer" }), Br = (e) => /* @__PURE__ */ n(rt, { ...e, state: "sent" }), Ur = (e) => /* @__PURE__ */ n(rt, { ...e, state: "received" }), jr = {
3660
- Composer: Fr,
3661
- Sent: Br,
3662
- Received: Ur
3663
- }, it = ({
3668
+ }, Vr = (e) => /* @__PURE__ */ n(it, { ...e, state: "composer" }), Ur = (e) => /* @__PURE__ */ n(it, { ...e, state: "sent" }), jr = (e) => /* @__PURE__ */ n(it, { ...e, state: "received" }), Gr = {
3669
+ Composer: Vr,
3670
+ Sent: Ur,
3671
+ Received: jr
3672
+ }, ot = ({
3664
3673
  onPrev: e,
3665
3674
  onNext: t,
3666
3675
  prevLabel: s = "Previous",
@@ -3673,7 +3682,7 @@ const zr = ({
3673
3682
  onClick: e,
3674
3683
  "aria-label": s,
3675
3684
  className: "mes-media-viewer__nav mes-media-viewer__nav--prev",
3676
- children: /* @__PURE__ */ n(Ds, { size: 20, weight: "bold", "aria-hidden": !0 })
3685
+ children: /* @__PURE__ */ n(Os, { size: 20, weight: "bold", "aria-hidden": !0 })
3677
3686
  }
3678
3687
  ),
3679
3688
  /* @__PURE__ */ n(
@@ -3683,10 +3692,10 @@ const zr = ({
3683
3692
  onClick: t,
3684
3693
  "aria-label": a,
3685
3694
  className: "mes-media-viewer__nav mes-media-viewer__nav--next",
3686
- children: /* @__PURE__ */ n(Ve, { size: 20, weight: "bold", "aria-hidden": !0 })
3695
+ children: /* @__PURE__ */ n(Ge, { size: 20, weight: "bold", "aria-hidden": !0 })
3687
3696
  }
3688
3697
  )
3689
- ] }), pn = ({
3698
+ ] }), vn = ({
3690
3699
  url: e,
3691
3700
  filename: t,
3692
3701
  variant: s = "pill",
@@ -3695,15 +3704,15 @@ const zr = ({
3695
3704
  tone: i = "dark",
3696
3705
  onTriggered: o
3697
3706
  }) => {
3698
- const [l, d] = $(!1), m = K(
3707
+ const [l, d] = z(!1), m = Z(
3699
3708
  (c) => {
3700
- c.stopPropagation(), !l && (d(!0), bn(e, t).catch(() => {
3709
+ c.stopPropagation(), !l && (d(!0), pn(e, t).catch(() => {
3701
3710
  }).finally(() => {
3702
3711
  d(!1), o == null || o();
3703
3712
  }));
3704
3713
  },
3705
3714
  [l, e, t, o]
3706
- ), g = r ?? s !== "pill", f = { className: N(
3715
+ ), g = r ?? s !== "pill", f = { className: y(
3707
3716
  s === "pill" ? "size-4" : "size-5",
3708
3717
  "shrink-0"
3709
3718
  ), weight: "bold" };
@@ -3714,7 +3723,7 @@ const zr = ({
3714
3723
  onClick: m,
3715
3724
  disabled: l,
3716
3725
  "aria-label": a,
3717
- className: N(
3726
+ className: y(
3718
3727
  "flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
3719
3728
  {
3720
3729
  dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
@@ -3722,14 +3731,14 @@ const zr = ({
3722
3731
  }[i]
3723
3732
  ),
3724
3733
  children: l ? /* @__PURE__ */ n(
3725
- pe,
3734
+ ve,
3726
3735
  {
3727
3736
  className: "size-4 animate-spin",
3728
3737
  weight: "bold",
3729
3738
  "aria-hidden": !0
3730
3739
  }
3731
3740
  ) : /* @__PURE__ */ n(
3732
- ve,
3741
+ xe,
3733
3742
  {
3734
3743
  className: "size-5 shrink-0",
3735
3744
  weight: "bold",
@@ -3745,7 +3754,7 @@ const zr = ({
3745
3754
  disabled: l,
3746
3755
  "aria-label": a,
3747
3756
  className: "mes-media-viewer__action",
3748
- children: l ? /* @__PURE__ */ n(pe, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 })
3757
+ children: l ? /* @__PURE__ */ n(ve, { size: 20, weight: "bold", "aria-hidden": !0 }) : /* @__PURE__ */ n(xe, { size: 20, weight: "bold", "aria-hidden": !0 })
3749
3758
  }
3750
3759
  ) : /* @__PURE__ */ h(
3751
3760
  "button",
@@ -3754,40 +3763,40 @@ const zr = ({
3754
3763
  onClick: m,
3755
3764
  disabled: l,
3756
3765
  "aria-label": g ? a : void 0,
3757
- className: N(
3766
+ className: y(
3758
3767
  "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
3759
3768
  i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
3760
3769
  ),
3761
3770
  children: [
3762
3771
  l ? /* @__PURE__ */ n(
3763
- pe,
3772
+ ve,
3764
3773
  {
3765
3774
  className: "size-4 animate-spin",
3766
3775
  weight: "bold",
3767
3776
  "aria-hidden": !0
3768
3777
  }
3769
- ) : /* @__PURE__ */ n(ve, { ...f, "aria-hidden": !0 }),
3778
+ ) : /* @__PURE__ */ n(xe, { ...f, "aria-hidden": !0 }),
3770
3779
  g ? null : a
3771
3780
  ]
3772
3781
  }
3773
3782
  );
3774
- }, Fe = (e, t, s) => Math.min(Math.max(e, t), s), ot = ({
3783
+ }, Be = (e, t, s) => Math.min(Math.max(e, t), s), lt = ({
3775
3784
  length: e,
3776
3785
  initialIndex: t,
3777
3786
  open: s
3778
3787
  }) => {
3779
- const a = Fe(t, 0, Math.max(e - 1, 0)), [r, i] = $(a);
3780
- X(() => {
3781
- s && i(Fe(t, 0, Math.max(e - 1, 0)));
3782
- }, [s, t, e]), X(() => {
3783
- i((d) => Fe(d, 0, Math.max(e - 1, 0)));
3788
+ const a = Be(t, 0, Math.max(e - 1, 0)), [r, i] = z(a);
3789
+ J(() => {
3790
+ s && i(Be(t, 0, Math.max(e - 1, 0)));
3791
+ }, [s, t, e]), J(() => {
3792
+ i((d) => Be(d, 0, Math.max(e - 1, 0)));
3784
3793
  }, [e]);
3785
- const o = K(() => {
3794
+ const o = Z(() => {
3786
3795
  e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
3787
- }, [e]), l = K(() => {
3796
+ }, [e]), l = Z(() => {
3788
3797
  e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
3789
3798
  }, [e]);
3790
- return X(() => {
3799
+ return J(() => {
3791
3800
  if (!s || e <= 1) return;
3792
3801
  const d = (m) => {
3793
3802
  if (m.key !== "ArrowLeft" && m.key !== "ArrowRight") return;
@@ -3796,7 +3805,7 @@ const zr = ({
3796
3805
  };
3797
3806
  return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
3798
3807
  }, [s, e, o, l]), { index: r, prev: o, next: l };
3799
- }, lt = ({
3808
+ }, ct = ({
3800
3809
  open: e,
3801
3810
  onClose: t,
3802
3811
  ariaLabel: s,
@@ -3805,8 +3814,8 @@ const zr = ({
3805
3814
  children: i,
3806
3815
  "data-testid": o
3807
3816
  }) => {
3808
- const l = G(null), d = G(null);
3809
- return X(() => {
3817
+ const l = H(null), d = H(null);
3818
+ return J(() => {
3810
3819
  var f;
3811
3820
  const u = l.current;
3812
3821
  if (u) {
@@ -3877,7 +3886,7 @@ const zr = ({
3877
3886
  onClick: t,
3878
3887
  "aria-label": "Close viewer",
3879
3888
  className: "mes-media-viewer__action",
3880
- children: /* @__PURE__ */ n(Me, { size: 20, weight: "bold", "aria-hidden": !0 })
3889
+ children: /* @__PURE__ */ n(Re, { size: 20, weight: "bold", "aria-hidden": !0 })
3881
3890
  }
3882
3891
  )
3883
3892
  ] })
@@ -3886,13 +3895,13 @@ const zr = ({
3886
3895
  ]
3887
3896
  }
3888
3897
  );
3889
- }, vn = ({
3898
+ }, xn = ({
3890
3899
  open: e,
3891
3900
  items: t,
3892
3901
  initialIndex: s = 0,
3893
3902
  onClose: a
3894
3903
  }) => {
3895
- const { index: r, prev: i, next: o } = ot({
3904
+ const { index: r, prev: i, next: o } = lt({
3896
3905
  length: t.length,
3897
3906
  initialIndex: s,
3898
3907
  open: e
@@ -3901,14 +3910,14 @@ const zr = ({
3901
3910
  [l]
3902
3911
  );
3903
3912
  return l ? /* @__PURE__ */ h(
3904
- lt,
3913
+ ct,
3905
3914
  {
3906
3915
  open: e,
3907
3916
  onClose: a,
3908
3917
  ariaLabel: d,
3909
3918
  counter: t.length > 1 ? `${r + 1} / ${t.length}` : void 0,
3910
3919
  actions: /* @__PURE__ */ n(
3911
- pn,
3920
+ vn,
3912
3921
  {
3913
3922
  url: l.src,
3914
3923
  filename: d,
@@ -3931,7 +3940,7 @@ const zr = ({
3931
3940
  `${r}:${l.src}`
3932
3941
  ),
3933
3942
  t.length > 1 ? /* @__PURE__ */ n(
3934
- it,
3943
+ ot,
3935
3944
  {
3936
3945
  onPrev: i,
3937
3946
  onNext: o,
@@ -3942,7 +3951,7 @@ const zr = ({
3942
3951
  ]
3943
3952
  }
3944
3953
  ) : null;
3945
- }, Vr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", xn = ({
3954
+ }, Hr = "relative block size-full overflow-hidden bg-black/5 outline-none focus-visible:ring-2 focus-visible:ring-white/80 focus-visible:ring-offset-2 focus-visible:ring-offset-black", wn = ({
3946
3955
  tiles: e,
3947
3956
  onTileActivate: t,
3948
3957
  maxVisible: s = 4,
@@ -3951,14 +3960,14 @@ const zr = ({
3951
3960
  const r = e.length;
3952
3961
  if (r === 0) return null;
3953
3962
  const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
3954
- const u = N(Vr, "h-full w-full");
3963
+ const u = y(Hr, "h-full w-full");
3955
3964
  return t ? /* @__PURE__ */ h(
3956
3965
  "button",
3957
3966
  {
3958
3967
  type: "button",
3959
3968
  onClick: () => t(m),
3960
3969
  "aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
3961
- className: N(u, "cursor-zoom-in"),
3970
+ className: y(u, "cursor-zoom-in"),
3962
3971
  children: [
3963
3972
  d.content,
3964
3973
  g
@@ -3970,10 +3979,10 @@ const zr = ({
3970
3979
  g
3971
3980
  ] }, m);
3972
3981
  };
3973
- return i.length === 1 ? /* @__PURE__ */ n("div", { className: N("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
3982
+ return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
3974
3983
  "div",
3975
3984
  {
3976
- className: N(
3985
+ className: y(
3977
3986
  "grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
3978
3987
  a
3979
3988
  ),
@@ -3982,7 +3991,7 @@ const zr = ({
3982
3991
  ) : i.length === 3 ? /* @__PURE__ */ h(
3983
3992
  "div",
3984
3993
  {
3985
- className: N(
3994
+ className: y(
3986
3995
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
3987
3996
  a
3988
3997
  ),
@@ -3995,7 +4004,7 @@ const zr = ({
3995
4004
  ) : /* @__PURE__ */ n(
3996
4005
  "div",
3997
4006
  {
3998
- className: N(
4007
+ className: y(
3999
4008
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
4000
4009
  a
4001
4010
  ),
@@ -4012,15 +4021,15 @@ const zr = ({
4012
4021
  })
4013
4022
  }
4014
4023
  );
4015
- }, ye = (e) => {
4016
- const [t, s] = $(!1), [a, r] = $(0), i = K(
4024
+ }, Ce = (e) => {
4025
+ const [t, s] = z(!1), [a, r] = z(0), i = Z(
4017
4026
  (l) => {
4018
4027
  (e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
4019
4028
  },
4020
4029
  [e]
4021
- ), o = K(() => s(!1), []);
4030
+ ), o = Z(() => s(!1), []);
4022
4031
  return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
4023
- }, Gr = (e, t, s, a) => ({
4032
+ }, Yr = (e, t, s, a) => ({
4024
4033
  ariaLabel: `Open image ${t + 1} of ${s}`,
4025
4034
  content: /* @__PURE__ */ n(
4026
4035
  "img",
@@ -4035,16 +4044,16 @@ const zr = ({
4035
4044
  className: "absolute inset-0 size-full rounded-md object-cover"
4036
4045
  }
4037
4046
  )
4038
- }), Hr = ({
4047
+ }), qr = ({
4039
4048
  src: e,
4040
4049
  alt: t,
4041
4050
  items: s
4042
- }) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], wn = (e, t) => e.map((s, a) => ({
4051
+ }) => s && s.length > 0 ? s : e ? [{ src: e, alt: t }] : [], _n = (e, t) => e.map((s, a) => ({
4043
4052
  src: s.src,
4044
4053
  alt: s.alt,
4045
4054
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
4046
- })), Yr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
4047
- const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = ye(
4055
+ })), Wr = ({ src: e, alt: t, filename: s, loading: a = "lazy", onClick: r, onDismiss: i }) => {
4056
+ const { viewerOpen: o, viewerIndex: l, handleActivate: d, closeViewer: m } = Ce(
4048
4057
  r
4049
4058
  );
4050
4059
  return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
@@ -4068,18 +4077,18 @@ const zr = ({
4068
4077
  )
4069
4078
  }
4070
4079
  ),
4071
- i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(_e, { onClick: i }) }) : null,
4080
+ i ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ne, { onClick: i }) }) : null,
4072
4081
  /* @__PURE__ */ n(
4073
- vn,
4082
+ xn,
4074
4083
  {
4075
4084
  open: o,
4076
- items: wn([{ src: e, alt: t }], s),
4085
+ items: _n([{ src: e, alt: t }], s),
4077
4086
  initialIndex: l,
4078
4087
  onClose: m
4079
4088
  }
4080
4089
  )
4081
4090
  ] });
4082
- }, _n = ({
4091
+ }, Nn = ({
4083
4092
  state: e,
4084
4093
  src: t,
4085
4094
  alt: s,
@@ -4090,46 +4099,46 @@ const zr = ({
4090
4099
  loading: l = "lazy",
4091
4100
  onClick: d
4092
4101
  }) => {
4093
- const m = Hr({ src: t, alt: s, items: r }), g = Ne(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: b } = ye(
4102
+ const m = qr({ src: t, alt: s, items: r }), g = ye(e), { viewerOpen: u, viewerIndex: f, handleActivate: c, closeViewer: x } = Ce(
4094
4103
  d
4095
4104
  );
4096
4105
  if (m.length === 0)
4097
4106
  return null;
4098
- const _ = m.map(
4099
- (v, p) => Gr(v, p, m.length, l)
4107
+ const b = m.map(
4108
+ (w, v) => Yr(w, v, m.length, l)
4100
4109
  );
4101
4110
  return /* @__PURE__ */ h(
4102
- we,
4111
+ _e,
4103
4112
  {
4104
4113
  variant: g,
4105
4114
  text: i,
4106
4115
  groupPosition: o,
4107
4116
  "data-testid": "image-attachment",
4108
4117
  children: [
4109
- /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(xn, { tiles: _, onTileActivate: c }) }),
4118
+ /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(wn, { tiles: b, onTileActivate: c }) }),
4110
4119
  /* @__PURE__ */ n(
4111
- vn,
4120
+ xn,
4112
4121
  {
4113
4122
  open: u,
4114
- items: wn(m, a),
4123
+ items: _n(m, a),
4115
4124
  initialIndex: f,
4116
- onClose: b
4125
+ onClose: x
4117
4126
  }
4118
4127
  )
4119
4128
  ]
4120
4129
  }
4121
4130
  );
4122
- }, qr = (e) => /* @__PURE__ */ n(Yr, { ...e }), Wr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "sent" }), Xr = (e) => /* @__PURE__ */ n(_n, { ...e, state: "received" }), Kr = {
4123
- Composer: qr,
4124
- Sent: Wr,
4125
- Received: Xr
4126
- }, Jr = ({
4131
+ }, Xr = (e) => /* @__PURE__ */ n(Wr, { ...e }), Kr = (e) => /* @__PURE__ */ n(Nn, { ...e, state: "sent" }), Jr = (e) => /* @__PURE__ */ n(Nn, { ...e, state: "received" }), Zr = {
4132
+ Composer: Xr,
4133
+ Sent: Kr,
4134
+ Received: Jr
4135
+ }, Qr = ({
4127
4136
  open: e,
4128
4137
  items: t,
4129
4138
  initialIndex: s = 0,
4130
4139
  onClose: a
4131
4140
  }) => {
4132
- const { index: r, prev: i, next: o } = ot({
4141
+ const { index: r, prev: i, next: o } = lt({
4133
4142
  length: t.length,
4134
4143
  initialIndex: s,
4135
4144
  open: e
@@ -4137,11 +4146,11 @@ const zr = ({
4137
4146
  () => (l == null ? void 0 : l.filename) ?? (l ? ne(l.src) : "document"),
4138
4147
  [l]
4139
4148
  ), m = se(
4140
- () => l ? Zr(l.src) : void 0,
4149
+ () => l ? ei(l.src) : void 0,
4141
4150
  [l]
4142
4151
  );
4143
4152
  return !l || !m ? null : /* @__PURE__ */ h(
4144
- lt,
4153
+ ct,
4145
4154
  {
4146
4155
  open: e,
4147
4156
  onClose: a,
@@ -4160,7 +4169,7 @@ const zr = ({
4160
4169
  `${r}:${l.src}`
4161
4170
  ),
4162
4171
  t.length > 1 ? /* @__PURE__ */ n(
4163
- it,
4172
+ ot,
4164
4173
  {
4165
4174
  onPrev: i,
4166
4175
  onNext: o,
@@ -4171,16 +4180,16 @@ const zr = ({
4171
4180
  ]
4172
4181
  }
4173
4182
  );
4174
- }, Zr = (e) => {
4183
+ }, ei = (e) => {
4175
4184
  const t = e.indexOf("#"), s = t === -1 ? e : e.slice(0, t), a = t === -1 ? "" : e.slice(t + 1), r = new URLSearchParams(a);
4176
4185
  return r.has("toolbar") || r.set("toolbar", "0"), r.has("navpanes") || r.set("navpanes", "0"), `${s}#${r.toString()}`;
4177
- }, Qr = ({
4186
+ }, ti = ({
4178
4187
  src: e,
4179
4188
  filename: t,
4180
4189
  fileSize: s,
4181
4190
  title: a,
4182
4191
  items: r
4183
- }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], ei = ({
4192
+ }) => r && r.length > 0 ? r : e ? [{ src: e, filename: t, fileSize: s, title: a }] : [], ni = ({
4184
4193
  variant: e,
4185
4194
  item: t,
4186
4195
  index: s,
@@ -4189,7 +4198,7 @@ const zr = ({
4189
4198
  }) => {
4190
4199
  const i = t.filename ?? ne(t.src);
4191
4200
  return /* @__PURE__ */ n(
4192
- gn,
4201
+ bn,
4193
4202
  {
4194
4203
  variant: e,
4195
4204
  filename: i,
@@ -4201,7 +4210,7 @@ const zr = ({
4201
4210
  trailingAction: r
4202
4211
  }
4203
4212
  );
4204
- }, ct = ({
4213
+ }, dt = ({
4205
4214
  state: e,
4206
4215
  src: t,
4207
4216
  filename: s,
@@ -4213,69 +4222,69 @@ const zr = ({
4213
4222
  onClick: d,
4214
4223
  onDismiss: m
4215
4224
  }) => {
4216
- const g = Ne(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = ye(
4225
+ const g = ye(e), u = ti({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: x, closeViewer: b } = Ce(
4217
4226
  d
4218
- ), v = e === "composer" && !!m;
4227
+ ), w = e === "composer" && !!m;
4219
4228
  if (u.length === 0)
4220
4229
  return null;
4221
- const p = u.map((x) => ({
4222
- src: x.src,
4223
- filename: x.filename ?? ne(x.src)
4230
+ const v = u.map((p) => ({
4231
+ src: p.src,
4232
+ filename: p.filename ?? ne(p.src)
4224
4233
  }));
4225
4234
  return /* @__PURE__ */ h(
4226
- we,
4235
+ _e,
4227
4236
  {
4228
4237
  variant: g,
4229
4238
  text: o,
4230
4239
  groupPosition: l,
4231
4240
  "data-testid": "pdf-attachment",
4232
4241
  children: [
4233
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((x, A) => {
4234
- const M = x.filename ?? ne(x.src), y = v && A === 0 ? /* @__PURE__ */ n(_e, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4235
- pn,
4242
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((p, A) => {
4243
+ const R = p.filename ?? ne(p.src), L = w && A === 0 ? /* @__PURE__ */ n(Ne, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4244
+ vn,
4236
4245
  {
4237
- url: x.src,
4238
- filename: M,
4246
+ url: p.src,
4247
+ filename: R,
4239
4248
  variant: "inline",
4240
- label: `Download ${M}`,
4249
+ label: `Download ${R}`,
4241
4250
  tone: g
4242
4251
  }
4243
4252
  );
4244
4253
  return /* @__PURE__ */ n(
4245
- ei,
4254
+ ni,
4246
4255
  {
4247
4256
  variant: g,
4248
- item: x,
4257
+ item: p,
4249
4258
  index: A,
4250
- onActivate: b,
4251
- trailingAction: y
4259
+ onActivate: x,
4260
+ trailingAction: L
4252
4261
  },
4253
- `${x.src}-${A}`
4262
+ `${p.src}-${A}`
4254
4263
  );
4255
4264
  }) }),
4256
4265
  /* @__PURE__ */ n(
4257
- Jr,
4266
+ Qr,
4258
4267
  {
4259
4268
  open: f,
4260
- items: p,
4269
+ items: v,
4261
4270
  initialIndex: c,
4262
- onClose: _
4271
+ onClose: b
4263
4272
  }
4264
4273
  )
4265
4274
  ]
4266
4275
  }
4267
4276
  );
4268
- }, ti = (e) => /* @__PURE__ */ n(ct, { ...e, state: "composer" }), ni = (e) => /* @__PURE__ */ n(ct, { ...e, state: "sent" }), si = (e) => /* @__PURE__ */ n(ct, { ...e, state: "received" }), ai = {
4269
- Composer: ti,
4270
- Sent: ni,
4271
- Received: si
4272
- }, Nn = ({
4277
+ }, si = (e) => /* @__PURE__ */ n(dt, { ...e, state: "composer" }), ai = (e) => /* @__PURE__ */ n(dt, { ...e, state: "sent" }), ri = (e) => /* @__PURE__ */ n(dt, { ...e, state: "received" }), ii = {
4278
+ Composer: si,
4279
+ Sent: ai,
4280
+ Received: ri
4281
+ }, yn = ({
4273
4282
  open: e,
4274
4283
  items: t,
4275
4284
  initialIndex: s = 0,
4276
4285
  onClose: a
4277
4286
  }) => {
4278
- const { index: r, prev: i, next: o } = ot({
4287
+ const { index: r, prev: i, next: o } = lt({
4279
4288
  length: t.length,
4280
4289
  initialIndex: s,
4281
4290
  open: e
@@ -4284,7 +4293,7 @@ const zr = ({
4284
4293
  [l]
4285
4294
  );
4286
4295
  return l ? /* @__PURE__ */ h(
4287
- lt,
4296
+ ct,
4288
4297
  {
4289
4298
  open: e,
4290
4299
  onClose: a,
@@ -4308,7 +4317,7 @@ const zr = ({
4308
4317
  `${r}:${l.src}`
4309
4318
  ),
4310
4319
  t.length > 1 ? /* @__PURE__ */ n(
4311
- it,
4320
+ ot,
4312
4321
  {
4313
4322
  onPrev: i,
4314
4323
  onNext: o,
@@ -4319,7 +4328,7 @@ const zr = ({
4319
4328
  ]
4320
4329
  }
4321
4330
  ) : null;
4322
- }, ri = () => /* @__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(Ue, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), yn = ({
4331
+ }, oi = () => /* @__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(Ue, { className: "size-6", weight: "fill", "aria-hidden": !0 }) }) }), Cn = ({
4323
4332
  item: e,
4324
4333
  index: t
4325
4334
  }) => /* @__PURE__ */ h("div", { className: "absolute inset-0 size-full bg-[#0d0d0d]", children: [
@@ -4334,31 +4343,31 @@ const zr = ({
4334
4343
  className: "absolute inset-0 size-full rounded-md object-cover"
4335
4344
  }
4336
4345
  ) : /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ n(
4337
- Ht,
4346
+ Yt,
4338
4347
  {
4339
4348
  className: "size-16 rounded-md text-white/30",
4340
4349
  weight: "regular",
4341
4350
  "aria-hidden": !0
4342
4351
  }
4343
4352
  ) }),
4344
- /* @__PURE__ */ n(ri, {})
4345
- ] }), ii = (e, t, s) => ({
4353
+ /* @__PURE__ */ n(oi, {})
4354
+ ] }), li = (e, t, s) => ({
4346
4355
  ariaLabel: `Play video ${t + 1} of ${s}`,
4347
- content: /* @__PURE__ */ n(yn, { item: e, index: t })
4348
- }), oi = ({
4356
+ content: /* @__PURE__ */ n(Cn, { item: e, index: t })
4357
+ }), ci = ({
4349
4358
  src: e,
4350
4359
  poster: t,
4351
4360
  mimeType: s,
4352
4361
  preload: a,
4353
4362
  items: r
4354
- }) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], Cn = (e, t) => e.map((s, a) => ({
4363
+ }) => r && r.length > 0 ? a ? r.map((i) => ({ ...i, preload: i.preload ?? a })) : r : e ? [{ src: e, poster: t, mimeType: s, preload: a }] : [], kn = (e, t) => e.map((s, a) => ({
4355
4364
  src: s.src,
4356
4365
  poster: s.poster,
4357
4366
  mimeType: s.mimeType,
4358
4367
  preload: s.preload,
4359
4368
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
4360
- })), li = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
4361
- const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = ye(
4369
+ })), di = ({ src: e, poster: t, mimeType: s, filename: a, preload: r, onClick: i, onDismiss: o }) => {
4370
+ const { viewerOpen: l, viewerIndex: d, handleActivate: m, closeViewer: g } = Ce(
4362
4371
  i
4363
4372
  );
4364
4373
  return /* @__PURE__ */ h("div", { className: "relative w-fit", children: [
@@ -4369,15 +4378,15 @@ const zr = ({
4369
4378
  onClick: () => m(0),
4370
4379
  "aria-label": "Play video",
4371
4380
  className: "relative block size-[280px] cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-black/40",
4372
- children: /* @__PURE__ */ n(yn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
4381
+ children: /* @__PURE__ */ n(Cn, { item: { src: e, poster: t, mimeType: s }, index: 0 })
4373
4382
  }
4374
4383
  ),
4375
- o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(_e, { onClick: o }) }) : null,
4384
+ o ? /* @__PURE__ */ n("div", { className: "absolute right-2 top-2 z-10", children: /* @__PURE__ */ n(Ne, { onClick: o }) }) : null,
4376
4385
  /* @__PURE__ */ n(
4377
- Nn,
4386
+ yn,
4378
4387
  {
4379
4388
  open: l,
4380
- items: Cn(
4389
+ items: kn(
4381
4390
  [{ src: e, poster: t, mimeType: s, preload: r }],
4382
4391
  a
4383
4392
  ),
@@ -4386,7 +4395,7 @@ const zr = ({
4386
4395
  }
4387
4396
  )
4388
4397
  ] });
4389
- }, kn = ({
4398
+ }, En = ({
4390
4399
  state: e,
4391
4400
  src: t,
4392
4401
  poster: s,
@@ -4398,16 +4407,16 @@ const zr = ({
4398
4407
  preload: d,
4399
4408
  onClick: m
4400
4409
  }) => {
4401
- const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = ye(
4410
+ const g = ci({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = ye(e), { viewerOpen: f, viewerIndex: c, handleActivate: x, closeViewer: b } = Ce(
4402
4411
  m
4403
4412
  );
4404
4413
  if (g.length === 0)
4405
4414
  return null;
4406
- const v = g.map(
4407
- (p, x) => ii(p, x, g.length)
4415
+ const w = g.map(
4416
+ (v, p) => li(v, p, g.length)
4408
4417
  );
4409
4418
  return /* @__PURE__ */ h(
4410
- we,
4419
+ _e,
4411
4420
  {
4412
4421
  variant: u,
4413
4422
  text: o,
@@ -4415,36 +4424,36 @@ const zr = ({
4415
4424
  "data-testid": "video-attachment",
4416
4425
  children: [
4417
4426
  /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
4418
- xn,
4427
+ wn,
4419
4428
  {
4420
- tiles: v,
4421
- onTileActivate: b,
4429
+ tiles: w,
4430
+ onTileActivate: x,
4422
4431
  className: "overflow-hidden rounded-md"
4423
4432
  }
4424
4433
  ) }),
4425
4434
  /* @__PURE__ */ n(
4426
- Nn,
4435
+ yn,
4427
4436
  {
4428
4437
  open: f,
4429
- items: Cn(g, r),
4438
+ items: kn(g, r),
4430
4439
  initialIndex: c,
4431
- onClose: _
4440
+ onClose: b
4432
4441
  }
4433
4442
  )
4434
4443
  ]
4435
4444
  }
4436
4445
  );
4437
- }, ci = (e) => /* @__PURE__ */ n(li, { ...e }), di = (e) => /* @__PURE__ */ n(kn, { ...e, state: "sent" }), ui = (e) => /* @__PURE__ */ n(kn, { ...e, state: "received" }), mi = {
4438
- Composer: ci,
4439
- Sent: di,
4440
- Received: ui
4441
- }, Ii = {
4442
- Image: Kr,
4443
- Video: mi,
4444
- Audio: Tr,
4445
- Pdf: ai,
4446
- File: jr
4447
- }, hi = ({
4446
+ }, ui = (e) => /* @__PURE__ */ n(di, { ...e }), mi = (e) => /* @__PURE__ */ n(En, { ...e, state: "sent" }), hi = (e) => /* @__PURE__ */ n(En, { ...e, state: "received" }), fi = {
4447
+ Composer: ui,
4448
+ Sent: mi,
4449
+ Received: hi
4450
+ }, Ai = {
4451
+ Image: Zr,
4452
+ Video: fi,
4453
+ Audio: Mr,
4454
+ Pdf: ii,
4455
+ File: Gr
4456
+ }, gi = ({
4448
4457
  question: e,
4449
4458
  onClick: t,
4450
4459
  loading: s = !1,
@@ -4456,7 +4465,7 @@ const zr = ({
4456
4465
  onClick: t,
4457
4466
  disabled: s,
4458
4467
  style: { backgroundColor: "#E6E5E3" },
4459
- className: N(
4468
+ className: y(
4460
4469
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
4461
4470
  {
4462
4471
  "hover:brightness-95 active:brightness-90": !s,
@@ -4466,7 +4475,7 @@ const zr = ({
4466
4475
  ),
4467
4476
  children: e
4468
4477
  }
4469
- ), Ti = ({
4478
+ ), Mi = ({
4470
4479
  faqs: e,
4471
4480
  onFaqClick: t,
4472
4481
  loadingFaqId: s,
@@ -4495,7 +4504,7 @@ const zr = ({
4495
4504
  children: [
4496
4505
  a && /* @__PURE__ */ n("p", { className: "text-md text-charcoal mb-4", children: a }),
4497
4506
  l.map((d) => /* @__PURE__ */ n(
4498
- hi,
4507
+ gi,
4499
4508
  {
4500
4509
  question: d.question,
4501
4510
  onClick: () => t(d.id),
@@ -4509,38 +4518,39 @@ const zr = ({
4509
4518
  ] }) });
4510
4519
  };
4511
4520
  export {
4512
- en as A,
4513
- Hs as B,
4514
- Xa as C,
4515
- Ps as D,
4516
- Ti as F,
4517
- Ei as L,
4518
- yi as M,
4521
+ tn as A,
4522
+ qs as B,
4523
+ Ja as C,
4524
+ $s as D,
4525
+ Mi as F,
4526
+ Ii as L,
4527
+ ki as M,
4528
+ be as V,
4519
4529
  ge as a,
4520
4530
  ie as b,
4521
- rr as c,
4522
- un as d,
4523
- Ci as e,
4524
- hi as f,
4531
+ or as c,
4532
+ mn as d,
4533
+ Ei as e,
4534
+ gi as f,
4525
4535
  re as g,
4526
- zt as h,
4527
- Ii as i,
4528
- Ca as j,
4529
- Ni as k,
4530
- ki as l,
4531
- Lr as m,
4532
- Ar as n,
4533
- sr as o,
4534
- Rr as p,
4535
- Kt as q,
4536
+ $t as h,
4537
+ Ai as i,
4538
+ Ea as j,
4539
+ Ci as k,
4540
+ Si as l,
4541
+ Pr as m,
4542
+ Rr as n,
4543
+ rr as o,
4544
+ Dr as p,
4545
+ Jt as q,
4536
4546
  le as r,
4537
- sn as s,
4538
- $s as t,
4539
- Si as u,
4540
- Ys as v,
4541
- Qe as w,
4542
- et as x,
4543
- Xt as y,
4544
- va as z
4547
+ an as s,
4548
+ Bs as t,
4549
+ Ti as u,
4550
+ Ws as v,
4551
+ et as w,
4552
+ tt as x,
4553
+ Kt as y,
4554
+ wa as z
4545
4555
  };
4546
- //# sourceMappingURL=index-DPGZRLRM.js.map
4556
+ //# sourceMappingURL=index-BlpDX5fl.js.map