@linktr.ee/messaging-react 3.4.2-rc-1782395074 → 3.4.2-rc-1782453401

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