@linktr.ee/messaging-react 3.4.0-rc-1782374156 → 3.4.0-rc-1782392192

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 (31) hide show
  1. package/dist/{Card-B9Z659Y-.cjs → Card-6snF25TP.cjs} +2 -2
  2. package/dist/{Card-B9Z659Y-.cjs.map → Card-6snF25TP.cjs.map} +1 -1
  3. package/dist/{Card-DVo2e4rF.cjs → Card-BTbz8XCg.cjs} +2 -2
  4. package/dist/{Card-DVo2e4rF.cjs.map → Card-BTbz8XCg.cjs.map} +1 -1
  5. package/dist/{Card-DGkh6_ti.js → Card-CBi3z_Wt.js} +2 -2
  6. package/dist/{Card-DGkh6_ti.js.map → Card-CBi3z_Wt.js.map} +1 -1
  7. package/dist/{Card-h43tRi_a.js → Card-Cbw4GBkm.js} +3 -3
  8. package/dist/{Card-h43tRi_a.js.map → Card-Cbw4GBkm.js.map} +1 -1
  9. package/dist/{Card-TNeK_nFK.js → Card-D3-jTRWp.js} +2 -2
  10. package/dist/{Card-TNeK_nFK.js.map → Card-D3-jTRWp.js.map} +1 -1
  11. package/dist/{Card-C3icBnXT.cjs → Card-DdK8Vv7y.cjs} +2 -2
  12. package/dist/{Card-C3icBnXT.cjs.map → Card-DdK8Vv7y.cjs.map} +1 -1
  13. package/dist/{LockedThumbnail-DjFuOEgv.cjs → LockedThumbnail-Cih__olI.cjs} +2 -2
  14. package/dist/{LockedThumbnail-DjFuOEgv.cjs.map → LockedThumbnail-Cih__olI.cjs.map} +1 -1
  15. package/dist/{LockedThumbnail-DE3KLtk1.js → LockedThumbnail-qPBaTZon.js} +2 -2
  16. package/dist/{LockedThumbnail-DE3KLtk1.js.map → LockedThumbnail-qPBaTZon.js.map} +1 -1
  17. package/dist/{index-DKq7HA0h.js → index-BOsrtjME.js} +683 -665
  18. package/dist/index-BOsrtjME.js.map +1 -0
  19. package/dist/index-DQk6hOJg.cjs +2 -0
  20. package/dist/index-DQk6hOJg.cjs.map +1 -0
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.d.ts +10 -1
  23. package/dist/index.js +1 -1
  24. package/package.json +2 -2
  25. package/src/components/ChannelView.stories.tsx +21 -0
  26. package/src/components/ChannelView.tsx +29 -6
  27. package/src/components/MessagingShell/index.tsx +2 -0
  28. package/src/types.ts +11 -0
  29. package/dist/index--bjxhW3D.cjs +0 -2
  30. package/dist/index--bjxhW3D.cjs.map +0 -1
  31. package/dist/index-DKq7HA0h.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  import { jsx as n, jsxs as h, Fragment as se } from "react/jsx-runtime";
2
- import U, { createContext as Ye, useContext as Ae, useCallback as J, useState as z, useRef as j, useEffect as X, useId as Sn, useMemo as ne, Suspense as qe } from "react";
2
+ import U, { createContext as Ye, useContext as Ae, useCallback as K, useState as z, useRef as H, useEffect as X, useId as Sn, useMemo as ne, Suspense as qe } from "react";
3
3
  import { StreamChatService as In } from "@linktr.ee/messaging-core";
4
4
  import { StreamChat as Tn, LinkPreviewsManager as At } from "stream-chat";
5
5
  import { Chat as An, DateSeparator as Mn, useChannelStateContext as de, useChatContext as We, areMessageUIPropsEqual as Rn, useMessageReminder as Ln, useComponentContext as jt, Attachment as Dn, EditMessageModal as On, MessageBlocked as Pn, MessageBouncePrompt as zn, MessageDeleted as $n, MessageIsThreadReplyInChannelButtonIndicator as Fn, MessageRepliesCountButton as Bn, ReminderNotification as Un, StreamedMessageText as jn, messageHasAttachments as Vn, messageHasReactions as Gn, isDateSeparatorMessage as Hn, isMessageBlocked as Yn, isMessageBounced as qn, MessageBounceModal as Wn, MessageText as Mt, Poll as Xn, MessageErrorIcon as Kn, useMessageContext as xe, useMessageComposer as Jn, useStateStore as Zn, MessageInput as Qn, useMessageInputContext as es, useMessageComposerHasSendableData as ts, AttachmentPreviewList as ns, QuotedMessagePreview as ss, TextareaComposer as as, MessageTimestamp as De, AIStates as Oe, useTypingContext as rs, useAIState as is, Channel as os, WithComponents as ls, Window as cs, MessageList as ds, ChannelList as us, InfiniteScroll as ms } from "stream-chat-react";
6
6
  import { StarIcon as Be, DotsThreeIcon as hs, SpinnerGapIcon as ke, SignOutIcon as fs, ProhibitInsetIcon as Rt, FlagIcon as Vt, FileIcon as Gt, ImageIcon as gs, SpeakerHighIcon as bs, VideoCameraIcon as Ht, FileMdIcon as ps, FileTextIcon as vs, FileZipIcon as xs, FilePptIcon as ws, FileCsvIcon as _s, FileXlsIcon as Ns, FileDocIcon as ys, FilePdfIcon as Cs, CircleNotchIcon as pe, PlayIcon as Ue, PauseIcon as ks, LinkIcon as Es, DownloadSimpleIcon as ve, GiftIcon as Ss, ThumbsUpIcon as Is, ThumbsDownIcon as Ts, TrashSimpleIcon as As, XIcon as Me, ArrowUpIcon as Ms, SparkleIcon as je, ProhibitIcon as Rs, ArrowLeftIcon as Lt, CaretRightIcon as Ve, PencilSimpleIcon as Ls, CaretLeftIcon as Ds } from "@phosphor-icons/react";
7
- import C from "classnames";
7
+ import y from "classnames";
8
8
  import { MessageActions as Os, DefaultDropdownActionButton as Yt } from "stream-chat-react/experimental";
9
9
  const qt = Ye({
10
10
  service: null,
@@ -24,10 +24,10 @@ const qt = Ye({
24
24
  capabilities: r = {},
25
25
  debug: i = !1
26
26
  }) => {
27
- var F, T;
28
- const o = J(
29
- (E, ...A) => {
30
- i && console.log(`🔥 [MessagingProvider] ${E}`, ...A);
27
+ var D, I;
28
+ const o = K(
29
+ (T, ...S) => {
30
+ i && console.log(`🔥 [MessagingProvider] ${T}`, ...S);
31
31
  },
32
32
  [i]
33
33
  );
@@ -37,77 +37,77 @@ const qt = Ye({
37
37
  serviceConfig: !!s,
38
38
  capabilities: Object.keys(r)
39
39
  });
40
- const [l, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, b] = z(!1), [w, p] = z(null), v = j(!1), _ = j(null), R = j(s);
41
- R.current = s;
42
- const y = j(i);
43
- y.current = i;
44
- const M = j({
40
+ const [l, d] = z(null), [m, g] = z(null), [u, f] = z(!1), [c, b] = z(!1), [_, v] = z(null), p = H(!1), x = H(null), A = H(s);
41
+ A.current = s;
42
+ const M = H(i);
43
+ M.current = i;
44
+ const N = H({
45
45
  userId: t == null ? void 0 : t.id,
46
46
  apiKey: a,
47
47
  serviceConfig: s,
48
48
  capabilities: r
49
- }), D = j(0);
50
- D.current++, o("📊 RENDER INFO", {
51
- renderCount: D.current,
49
+ }), L = H(0);
50
+ L.current++, o("📊 RENDER INFO", {
51
+ renderCount: L.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: M.current.userId !== (t == null ? void 0 : t.id),
55
- apiKeyChanged: M.current.apiKey !== a,
56
- serviceConfigChanged: M.current.serviceConfig !== s,
57
- capabilitiesChanged: M.current.capabilities !== r
54
+ userChanged: N.current.userId !== (t == null ? void 0 : t.id),
55
+ apiKeyChanged: N.current.apiKey !== a,
56
+ serviceConfigChanged: N.current.serviceConfig !== s,
57
+ capabilitiesChanged: N.current.capabilities !== r
58
58
  }
59
- }), M.current = {
59
+ }), N.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 $ = j(null);
66
- a && ((F = $.current) == null ? void 0 : F.apiKey) !== a && ($.current = { apiKey: a, client: new Tn(a) });
67
- const L = a ? ((T = $.current) == null ? void 0 : T.client) ?? null : null;
65
+ const $ = H(null);
66
+ a && ((D = $.current) == null ? void 0 : D.apiKey) !== a && ($.current = { apiKey: a, client: new Tn(a) });
67
+ const O = a ? ((I = $.current) == null ? void 0 : I.client) ?? null : null;
68
68
  X(() => {
69
- const E = D.current, A = R.current;
70
- if (!a || !L || !A) {
69
+ const T = L.current, S = A.current;
70
+ if (!a || !O || !S) {
71
71
  o("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: E,
72
+ renderCount: T,
73
73
  reason: "Missing apiKey, client, or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
77
  o("🚀 CREATING SERVICE", {
78
- renderCount: E,
78
+ renderCount: T,
79
79
  apiKey: (a == null ? void 0 : a.substring(0, 8)) + "..."
80
80
  });
81
- const O = new In({
82
- ...A,
81
+ const P = new In({
82
+ ...S,
83
83
  apiKey: a,
84
- debug: y.current,
85
- client: L
84
+ debug: M.current,
85
+ client: O
86
86
  });
87
- _.current = O, d(O), o("✅ SERVICE SET", {
88
- renderCount: E,
89
- serviceInstance: !!O
87
+ x.current = P, d(P), o("✅ SERVICE SET", {
88
+ renderCount: T,
89
+ serviceInstance: !!P
90
90
  });
91
- }, [a, L]);
92
- const N = j(null);
91
+ }, [a, O]);
92
+ const E = H(null);
93
93
  X(() => {
94
- var A, O;
94
+ var S, P;
95
95
  if (o("🔗 USER CONNECTION EFFECT TRIGGERED", {
96
96
  hasService: !!l,
97
97
  hasUser: !!t,
98
98
  userId: t == null ? void 0 : t.id,
99
- isConnecting: v.current,
99
+ isConnecting: p.current,
100
100
  isConnected: u,
101
101
  dependencies: { service: !!l, userId: t == null ? void 0 : t.id }
102
102
  }), !l || !t) {
103
103
  o("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
104
104
  return;
105
105
  }
106
- if (v.current) {
106
+ if (p.current) {
107
107
  o("⚠️ USER CONNECTION SKIPPED", "Already connecting");
108
108
  return;
109
109
  }
110
- if (((A = N.current) == null ? void 0 : A.serviceId) === l && ((O = N.current) == null ? void 0 : O.userId) === t.id) {
110
+ if (((S = E.current) == null ? void 0 : S.serviceId) === l && ((P = E.current) == null ? void 0 : P.userId) === t.id) {
111
111
  o(
112
112
  "⚠️ USER CONNECTION SKIPPED",
113
113
  "Already connected this user with this service"
@@ -115,35 +115,35 @@ const qt = Ye({
115
115
  return;
116
116
  }
117
117
  (async () => {
118
- o("🚀 STARTING USER CONNECTION", { userId: t.id }), v.current = !0, b(!0), p(null);
118
+ o("🚀 STARTING USER CONNECTION", { userId: t.id }), p.current = !0, b(!0), v(null);
119
119
  try {
120
120
  o("📞 CALLING SERVICE.CONNECTUSER", { userId: t.id });
121
- const B = await l.connectUser(t);
122
- g(B), f(!0), N.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
121
+ const F = await l.connectUser(t);
122
+ g(F), f(!0), E.current = { serviceId: l, userId: t.id }, o("✅ USER CONNECTION SUCCESS", {
123
123
  userId: t.id,
124
- clientId: B.userID
124
+ clientId: F.userID
125
125
  });
126
- } catch (B) {
127
- const H = B instanceof Error ? B.message : "Connection failed";
128
- p(H), o("❌ USER CONNECTION ERROR", {
126
+ } catch (F) {
127
+ const Y = F instanceof Error ? F.message : "Connection failed";
128
+ v(Y), o("❌ USER CONNECTION ERROR", {
129
129
  userId: t.id,
130
- error: H
130
+ error: Y
131
131
  });
132
132
  } finally {
133
- b(!1), v.current = !1, o("🔄 USER CONNECTION FINISHED", {
133
+ b(!1), p.current = !1, o("🔄 USER CONNECTION FINISHED", {
134
134
  userId: t.id,
135
135
  isConnected: u
136
136
  });
137
137
  }
138
138
  })();
139
139
  }, [l, t, o, u]), X(() => {
140
- const E = L;
140
+ const T = O;
141
141
  return () => {
142
- var A;
143
- E && (N.current = null, (A = _.current) == null || A.disconnectUser().catch(console.error));
142
+ var S;
143
+ T && (E.current = null, (S = x.current) == null || S.disconnectUser().catch(console.error));
144
144
  };
145
- }, [L]);
146
- const I = J(async () => {
145
+ }, [O]);
146
+ const k = K(async () => {
147
147
  if (o("🔄 REFRESH CONNECTION CALLED", {
148
148
  hasService: !!l,
149
149
  hasUser: !!t
@@ -154,52 +154,52 @@ const qt = Ye({
154
154
  o("🚀 STARTING CONNECTION REFRESH", { userId: t.id }), b(!0);
155
155
  try {
156
156
  o("🔌 DISCONNECTING FOR REFRESH"), await l.disconnectUser(), o("📞 RECONNECTING FOR REFRESH");
157
- const E = await l.connectUser(t);
158
- g(E), f(!0), p(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
159
- } catch (E) {
160
- const A = E instanceof Error ? E.message : "Refresh failed";
161
- p(A), o("❌ CONNECTION REFRESH ERROR", {
157
+ const T = await l.connectUser(t);
158
+ g(T), f(!0), v(null), o("✅ CONNECTION REFRESH SUCCESS", { userId: t.id });
159
+ } catch (T) {
160
+ const S = T instanceof Error ? T.message : "Refresh failed";
161
+ v(S), o("❌ CONNECTION REFRESH ERROR", {
162
162
  userId: t.id,
163
- error: A
163
+ error: S
164
164
  });
165
165
  } finally {
166
166
  b(!1), o("🔄 CONNECTION REFRESH FINISHED", { userId: t.id });
167
167
  }
168
- }, [l, t, o]), S = U.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
168
+ }, [l, t, o]), R = U.useMemo(() => (o("💫 CONTEXT VALUE MEMOIZATION", {
169
169
  hasService: !!l,
170
170
  hasClient: !!m,
171
171
  isConnected: u,
172
172
  isLoading: c,
173
- hasError: !!w,
173
+ hasError: !!_,
174
174
  capabilitiesKeys: Object.keys(r)
175
175
  }), {
176
176
  service: l,
177
177
  client: m,
178
178
  isConnected: u,
179
179
  isLoading: c,
180
- error: w,
180
+ error: _,
181
181
  capabilities: r,
182
- refreshConnection: I,
182
+ refreshConnection: k,
183
183
  debug: i
184
184
  }), [
185
185
  l,
186
186
  m,
187
187
  u,
188
188
  c,
189
- w,
189
+ _,
190
190
  r,
191
- I,
191
+ k,
192
192
  i,
193
193
  o
194
194
  ]);
195
195
  return o("🔄 RENDER END", {
196
- renderCount: D.current,
197
- willRenderChat: !!L,
198
- contextValueReady: !!S
199
- }), /* @__PURE__ */ n(qt.Provider, { value: S, children: L ? /* @__PURE__ */ n(
196
+ renderCount: L.current,
197
+ willRenderChat: !!O,
198
+ contextValueReady: !!R
199
+ }), /* @__PURE__ */ n(qt.Provider, { value: R, children: O ? /* @__PURE__ */ n(
200
200
  An,
201
201
  {
202
- client: L,
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
  },
@@ -279,7 +279,7 @@ function Bs(e) {
279
279
  const s = Fs(e) % Ot.length;
280
280
  return Ot[s];
281
281
  }
282
- const ie = ({
282
+ const oe = ({
283
283
  id: e,
284
284
  image: t,
285
285
  size: s = 40,
@@ -299,7 +299,7 @@ const ie = ({
299
299
  "div",
300
300
  {
301
301
  "aria-hidden": "true",
302
- className: C(
302
+ className: y(
303
303
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
304
304
  m
305
305
  ),
@@ -309,7 +309,7 @@ const ie = ({
309
309
  return /* @__PURE__ */ h(
310
310
  "div",
311
311
  {
312
- className: C(
312
+ className: y(
313
313
  "relative flex-shrink-0 !bg-transparent",
314
314
  a
315
315
  ),
@@ -331,7 +331,7 @@ const ie = ({
331
331
  "div",
332
332
  {
333
333
  "data-testid": "avatar-ring",
334
- className: C(
334
+ className: y(
335
335
  "h-full w-full",
336
336
  "bg-transparent"
337
337
  ),
@@ -363,73 +363,73 @@ const ie = ({
363
363
  onActionComplete: m,
364
364
  logLabel: g = "useChannelModerationActions"
365
365
  }) => {
366
- var F;
367
- const { service: u, debug: f } = Xe(), c = (F = t == null ? void 0 : t.user) == null ? void 0 : F.id, b = !!(a && s && u && c), [w, p] = z(!1), [v, _] = z(null), [R, y] = z(!1), [M, D] = z(!1), $ = b && ((v == null ? void 0 : v.participantId) !== c || (v == null ? void 0 : v.service) !== u);
366
+ var D;
367
+ const { service: u, debug: f } = Xe(), c = (D = t == null ? void 0 : t.user) == null ? void 0 : D.id, b = !!(a && s && u && c), [_, v] = z(!1), [p, x] = z(null), [A, M] = z(!1), [N, L] = z(!1), $ = b && ((p == null ? void 0 : p.participantId) !== c || (p == null ? void 0 : p.service) !== u);
368
368
  return X(() => {
369
369
  if (!b || !u || !c) {
370
- p(!1), _(null);
370
+ v(!1), x(null);
371
371
  return;
372
372
  }
373
- let T = !1;
373
+ let I = !1;
374
374
  return (async () => {
375
375
  try {
376
- const E = await u.getBlockedUsers();
377
- if (T) return;
378
- p(
379
- E.some(
380
- (A) => A.blocked_user_id === c
376
+ const T = await u.getBlockedUsers();
377
+ if (I) return;
378
+ v(
379
+ T.some(
380
+ (S) => S.blocked_user_id === c
381
381
  )
382
382
  );
383
- } catch (E) {
384
- T || console.error(`[${g}] Failed to check blocked status:`, E);
383
+ } catch (T) {
384
+ I || console.error(`[${g}] Failed to check blocked status:`, T);
385
385
  } finally {
386
- T || _({ participantId: c, service: u });
386
+ I || x({ participantId: c, service: u });
387
387
  }
388
388
  })(), () => {
389
- T = !0;
389
+ I = !0;
390
390
  };
391
391
  }, [b, u, c, g]), {
392
- isParticipantBlocked: w,
392
+ isParticipantBlocked: _,
393
393
  isCheckingBlockedStatus: $,
394
- isLeaving: R,
395
- isUpdatingBlockStatus: M,
394
+ isLeaving: A,
395
+ isUpdatingBlockStatus: N,
396
396
  handleLeaveConversation: async () => {
397
- var T;
398
- if (!R) {
399
- o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), y(!0);
397
+ var I;
398
+ if (!A) {
399
+ o == null || o(), f && console.log(`[${g}] Leave conversation`, e.cid), M(!0);
400
400
  try {
401
- const E = ((T = e._client) == null ? void 0 : T.userID) ?? null;
402
- await e.hide(E, !1), r && await r(e), m == null || m();
403
- } catch (E) {
404
- console.error(`[${g}] Failed to leave conversation`, E);
401
+ const T = ((I = e._client) == null ? void 0 : I.userID) ?? null;
402
+ await e.hide(T, !1), r && await r(e), m == null || m();
403
+ } catch (T) {
404
+ console.error(`[${g}] Failed to leave conversation`, T);
405
405
  } finally {
406
- y(!1);
406
+ M(!1);
407
407
  }
408
408
  }
409
409
  },
410
410
  handleBlockUser: async () => {
411
- var T, E, A;
412
- if (!(M || !u)) {
413
- l == null || l(), f && console.log(`[${g}] Block member`, (T = t == null ? void 0 : t.user) == null ? void 0 : T.id), D(!0);
411
+ var I, T, S;
412
+ if (!(N || !u)) {
413
+ l == null || l(), f && console.log(`[${g}] Block member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), L(!0);
414
414
  try {
415
- await u.blockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), m == null || m();
416
- } catch (O) {
417
- console.error(`[${g}] Failed to block member`, O);
415
+ await u.blockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
416
+ } catch (P) {
417
+ console.error(`[${g}] Failed to block member`, P);
418
418
  } finally {
419
- D(!1);
419
+ L(!1);
420
420
  }
421
421
  }
422
422
  },
423
423
  handleUnblockUser: async () => {
424
- var T, E, A;
425
- if (!(M || !u)) {
426
- l == null || l(), f && console.log(`[${g}] Unblock member`, (T = t == null ? void 0 : t.user) == null ? void 0 : T.id), D(!0);
424
+ var I, T, S;
425
+ if (!(N || !u)) {
426
+ l == null || l(), f && console.log(`[${g}] Unblock member`, (I = t == null ? void 0 : t.user) == null ? void 0 : I.id), L(!0);
427
427
  try {
428
- await u.unBlockUser((E = t == null ? void 0 : t.user) == null ? void 0 : E.id), i && await i((A = t == null ? void 0 : t.user) == null ? void 0 : A.id), m == null || m();
429
- } catch (O) {
430
- console.error(`[${g}] Failed to unblock member`, O);
428
+ await u.unBlockUser((T = t == null ? void 0 : t.user) == null ? void 0 : T.id), i && await i((S = t == null ? void 0 : t.user) == null ? void 0 : S.id), m == null || m();
429
+ } catch (P) {
430
+ console.error(`[${g}] Failed to unblock member`, P);
431
431
  } finally {
432
- D(!1);
432
+ L(!1);
433
433
  }
434
434
  }
435
435
  },
@@ -446,7 +446,7 @@ const ie = ({
446
446
  "button",
447
447
  {
448
448
  type: "button",
449
- className: C(
449
+ className: y(
450
450
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
451
451
  e === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
452
452
  t
@@ -468,15 +468,15 @@ const ie = ({
468
468
  customChannelActions: g,
469
469
  triggerClassName: u
470
470
  }) => {
471
- const [f, c] = z(!1), b = j(null), w = Sn(), p = J(() => c(!1), []), {
472
- isParticipantBlocked: v,
473
- isCheckingBlockedStatus: _,
474
- isLeaving: R,
475
- isUpdatingBlockStatus: y,
476
- handleLeaveConversation: M,
477
- handleBlockUser: D,
471
+ const [f, c] = z(!1), b = H(null), _ = Sn(), v = K(() => c(!1), []), {
472
+ isParticipantBlocked: p,
473
+ isCheckingBlockedStatus: x,
474
+ isLeaving: A,
475
+ isUpdatingBlockStatus: M,
476
+ handleLeaveConversation: N,
477
+ handleBlockUser: L,
478
478
  handleUnblockUser: $,
479
- handleReportUser: L
479
+ handleReportUser: O
480
480
  } = js({
481
481
  channel: e,
482
482
  participant: t,
@@ -487,18 +487,18 @@ const ie = ({
487
487
  onDeleteConversationClick: l,
488
488
  onBlockParticipantClick: d,
489
489
  onReportParticipantClick: m,
490
- onActionComplete: p,
490
+ onActionComplete: v,
491
491
  logLabel: "ChannelActionsMenu"
492
492
  });
493
493
  return X(() => {
494
494
  if (!f) return;
495
- const I = (F) => {
496
- b.current && !b.current.contains(F.target) && c(!1);
497
- }, S = (F) => {
498
- F.key === "Escape" && c(!1);
495
+ const k = (D) => {
496
+ b.current && !b.current.contains(D.target) && c(!1);
497
+ }, R = (D) => {
498
+ D.key === "Escape" && c(!1);
499
499
  };
500
- return document.addEventListener("mousedown", I), document.addEventListener("keydown", S), () => {
501
- document.removeEventListener("mousedown", I), document.removeEventListener("keydown", S);
500
+ return document.addEventListener("mousedown", k), document.addEventListener("keydown", R), () => {
501
+ document.removeEventListener("mousedown", k), document.removeEventListener("keydown", R);
502
502
  };
503
503
  }, [f]), !t || !(s || a || r || !!g) ? null : /* @__PURE__ */ h("div", { ref: b, className: "relative", children: [
504
504
  /* @__PURE__ */ h(
@@ -508,8 +508,8 @@ const ie = ({
508
508
  type: "button",
509
509
  "aria-haspopup": "true",
510
510
  "aria-expanded": f,
511
- "aria-controls": f ? w : void 0,
512
- onClick: () => c((I) => !I),
511
+ "aria-controls": f ? _ : void 0,
512
+ onClick: () => c((k) => !k),
513
513
  children: [
514
514
  /* @__PURE__ */ n(hs, { className: "size-5 text-black/90" }),
515
515
  /* @__PURE__ */ n("span", { className: "sr-only", children: "More options" })
@@ -519,9 +519,9 @@ const ie = ({
519
519
  f && /* @__PURE__ */ n(
520
520
  "div",
521
521
  {
522
- id: w,
522
+ id: _,
523
523
  "aria-label": "Conversation options",
524
- className: C(
524
+ className: y(
525
525
  "absolute right-0 top-full z-50 mt-2 w-56 overflow-hidden",
526
526
  "rounded-lg border border-sand bg-white p-1 shadow-max-elevation-light"
527
527
  ),
@@ -529,46 +529,46 @@ const ie = ({
529
529
  s && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(
530
530
  ge,
531
531
  {
532
- onClick: M,
533
- disabled: R,
534
- "aria-busy": R,
532
+ onClick: N,
533
+ disabled: A,
534
+ "aria-busy": A,
535
535
  children: [
536
- R ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(fs, { className: "h-5 w-5" }),
536
+ A ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(fs, { className: "h-5 w-5" }),
537
537
  /* @__PURE__ */ n("span", { children: "Delete Conversation" })
538
538
  ]
539
539
  }
540
540
  ) }),
541
- a && /* @__PURE__ */ n("li", { children: _ ? (
541
+ a && /* @__PURE__ */ n("li", { children: x ? (
542
542
  // Block status not yet resolved — show a disabled placeholder
543
543
  // so a premature click can't act on a stale block state.
544
544
  /* @__PURE__ */ h(ge, { disabled: !0, "aria-busy": !0, children: [
545
545
  /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }),
546
546
  /* @__PURE__ */ n("span", { children: "Block" })
547
547
  ] })
548
- ) : v ? /* @__PURE__ */ h(
548
+ ) : p ? /* @__PURE__ */ h(
549
549
  ge,
550
550
  {
551
551
  onClick: $,
552
- disabled: y,
553
- "aria-busy": y,
552
+ disabled: M,
553
+ "aria-busy": M,
554
554
  children: [
555
- y ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
555
+ M ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
556
556
  /* @__PURE__ */ n("span", { children: "Unblock" })
557
557
  ]
558
558
  }
559
559
  ) : /* @__PURE__ */ h(
560
560
  ge,
561
561
  {
562
- onClick: D,
563
- disabled: y,
564
- "aria-busy": y,
562
+ onClick: L,
563
+ disabled: M,
564
+ "aria-busy": M,
565
565
  children: [
566
- y ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
566
+ M ? /* @__PURE__ */ n(ke, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ n(Rt, { className: "h-5 w-5" }),
567
567
  /* @__PURE__ */ n("span", { children: "Block" })
568
568
  ]
569
569
  }
570
570
  ) }),
571
- r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick: L, children: [
571
+ r && /* @__PURE__ */ n("li", { children: /* @__PURE__ */ h(ge, { variant: "danger", onClick: O, children: [
572
572
  /* @__PURE__ */ n(Vt, { className: "h-5 w-5" }),
573
573
  /* @__PURE__ */ n("span", { children: "Report" })
574
574
  ] }) }),
@@ -585,7 +585,7 @@ function Hs(e) {
585
585
  const { channel: t } = de(), { client: s } = We("useMessageVote"), a = ne(
586
586
  () => Gs(e.own_reactions),
587
587
  [e.own_reactions]
588
- ), r = J(async () => {
588
+ ), r = K(async () => {
589
589
  if (s != null && s.userID)
590
590
  try {
591
591
  a === "up" ? await t.deleteReaction(e.id, Ge) : await t.sendReaction(
@@ -595,7 +595,7 @@ function Hs(e) {
595
595
  );
596
596
  } catch {
597
597
  }
598
- }, [t, s == null ? void 0 : s.userID, e.id, a]), i = J(async () => {
598
+ }, [t, s == null ? void 0 : s.userID, e.id, a]), i = K(async () => {
599
599
  if (s != null && s.userID)
600
600
  try {
601
601
  a === "down" ? await t.deleteReaction(e.id, He) : await t.sendReaction(
@@ -619,7 +619,7 @@ function Kt({
619
619
  const s = e == null ? void 0 : e.text, a = Ys(t);
620
620
  return a ? ((r = e == null ? void 0 : e.i18n) == null ? void 0 : r[`${a}_text`]) ?? s : s;
621
621
  }
622
- const qs = U.lazy(() => import("./Card-DGkh6_ti.js")), Ws = U.lazy(() => import("./Card-TNeK_nFK.js")), Xs = U.lazy(() => import("./Card-h43tRi_a.js")), Ke = () => /* @__PURE__ */ n(
622
+ const qs = U.lazy(() => import("./Card-CBi3z_Wt.js")), Ws = U.lazy(() => import("./Card-D3-jTRWp.js")), Xs = U.lazy(() => import("./Card-Cbw4GBkm.js")), Ke = () => /* @__PURE__ */ n(
623
623
  "div",
624
624
  {
625
625
  className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
@@ -682,78 +682,78 @@ const sa = (e) => {
682
682
  muted: d = !1,
683
683
  onContainerClick: m
684
684
  }) => {
685
- const g = ae(t), u = j(null), f = j(null), c = j(null), b = j(r), [w, p] = z(a), [v, _] = z(0), [R, y] = z(!1), [M, D] = z(!1), [$, L] = z(!1), [N, I] = z(!1), [S, F] = z(!0), [T, E] = z(null), A = J(() => {
686
- L(!1), p(!0);
687
- }, []), O = J((x) => {
688
- const k = f.current;
689
- if (!k) return 0;
690
- const P = k.getBoundingClientRect();
685
+ const g = ae(t), u = H(null), f = H(null), c = H(null), b = H(r), [_, v] = z(a), [p, x] = z(0), [A, M] = z(!1), [N, L] = z(!1), [$, O] = z(!1), [E, k] = z(!1), [R, D] = z(!0), [I, T] = z(null), S = K(() => {
686
+ O(!1), v(!0);
687
+ }, []), P = K((w) => {
688
+ const C = f.current;
689
+ if (!C) return 0;
690
+ const B = C.getBoundingClientRect();
691
691
  return Math.max(
692
692
  0,
693
- Math.min(1, (sa(x) - P.left) / P.width)
693
+ Math.min(1, (sa(w) - B.left) / B.width)
694
694
  );
695
- }, []), B = J((x) => {
696
- const k = u.current;
697
- k && k.duration && (k.currentTime = x * k.duration);
698
- }, []), H = (x) => {
699
- x.stopPropagation(), y(!0);
700
- const k = O(x);
701
- _(k), B(k);
695
+ }, []), F = K((w) => {
696
+ const C = u.current;
697
+ C && C.duration && (C.currentTime = w * C.duration);
698
+ }, []), Y = (w) => {
699
+ w.stopPropagation(), M(!0);
700
+ const C = P(w);
701
+ x(C), F(C);
702
702
  };
703
703
  X(() => {
704
- r !== void 0 && r !== b.current && (b.current = r, p(r));
704
+ r !== void 0 && r !== b.current && (b.current = r, v(r));
705
705
  }, [r]), X(() => {
706
- if (!w) {
706
+ if (!_) {
707
707
  c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
708
708
  return;
709
709
  }
710
- const x = () => {
711
- const k = u.current;
712
- k && k.duration && !R && _(k.currentTime / k.duration), c.current = requestAnimationFrame(x);
710
+ const w = () => {
711
+ const C = u.current;
712
+ C && C.duration && !A && x(C.currentTime / C.duration), c.current = requestAnimationFrame(w);
713
713
  };
714
- return c.current = requestAnimationFrame(x), () => {
714
+ return c.current = requestAnimationFrame(w), () => {
715
715
  c.current !== null && cancelAnimationFrame(c.current);
716
716
  };
717
- }, [w, R]), X(() => {
718
- const x = u.current;
719
- x && (w ? x.play().catch((k) => {
720
- p(!1), L(!0);
721
- }) : x.pause());
722
- }, [w]), X(() => {
723
- if (!R) return;
724
- const x = (P) => _(O(P)), k = (P) => {
725
- y(!1), B(O(P));
717
+ }, [_, A]), X(() => {
718
+ const w = u.current;
719
+ w && (_ ? w.play().catch((C) => {
720
+ v(!1), O(!0);
721
+ }) : w.pause());
722
+ }, [_]), X(() => {
723
+ if (!A) return;
724
+ const w = (B) => x(P(B)), C = (B) => {
725
+ M(!1), F(P(B));
726
726
  };
727
- return window.addEventListener("mousemove", x), window.addEventListener("mouseup", k), window.addEventListener("touchmove", x, { passive: !0 }), window.addEventListener("touchend", k), () => {
728
- window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", k), window.removeEventListener("touchmove", x), window.removeEventListener("touchend", k);
727
+ return window.addEventListener("mousemove", w), window.addEventListener("mouseup", C), window.addEventListener("touchmove", w, { passive: !0 }), window.addEventListener("touchend", C), () => {
728
+ window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", C), window.removeEventListener("touchmove", w), window.removeEventListener("touchend", C);
729
729
  };
730
- }, [R, O, B]);
731
- const V = T ? { aspectRatio: String(T) } : void 0, Y = T ? "" : " aspect-video", q = Math.round(v * 100);
730
+ }, [A, P, F]);
731
+ const Z = I ? { aspectRatio: String(I) } : void 0, q = I ? "" : " aspect-video", G = Math.round(p * 100);
732
732
  return /* @__PURE__ */ h(
733
733
  "div",
734
734
  {
735
735
  role: "button",
736
736
  tabIndex: 0,
737
- className: `relative cursor-pointer overflow-hidden bg-black ${Y}`,
738
- style: V,
739
- onClick: (x) => {
737
+ className: `relative cursor-pointer overflow-hidden bg-black ${q}`,
738
+ style: Z,
739
+ onClick: (w) => {
740
740
  if (m) {
741
- m(x);
741
+ m(w);
742
742
  return;
743
743
  }
744
- $ || o && p((k) => !k);
744
+ $ || o && v((C) => !C);
745
745
  },
746
- onKeyDown: (x) => {
747
- if (!(x.key !== "Enter" && x.key !== " ")) {
748
- if (x.preventDefault(), m) {
749
- m(x);
746
+ onKeyDown: (w) => {
747
+ if (!(w.key !== "Enter" && w.key !== " ")) {
748
+ if (w.preventDefault(), m) {
749
+ m(w);
750
750
  return;
751
751
  }
752
- $ || o && p((k) => !k);
752
+ $ || o && v((C) => !C);
753
753
  }
754
754
  },
755
755
  children: [
756
- s && (g === "audio" || S) && /* @__PURE__ */ n(
756
+ s && (g === "audio" || R) && /* @__PURE__ */ n(
757
757
  "img",
758
758
  {
759
759
  src: s,
@@ -761,7 +761,7 @@ const sa = (e) => {
761
761
  className: "absolute inset-0 h-full w-full object-cover"
762
762
  }
763
763
  ),
764
- !s && (g === "audio" || S) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
764
+ !s && (g === "audio" || R) && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex items-center justify-center", children: ce(t, {
765
765
  className: "size-12 text-black/20",
766
766
  weight: "regular"
767
767
  }) }),
@@ -773,14 +773,14 @@ const sa = (e) => {
773
773
  loop: i,
774
774
  muted: d,
775
775
  style: { width: "100%", height: "100%" },
776
- onLoadStart: () => I(!0),
776
+ onLoadStart: () => k(!0),
777
777
  onCanPlay: () => {
778
- I(!1), F(!1);
778
+ k(!1), D(!1);
779
779
  },
780
- onWaiting: () => I(!0),
781
- onPlay: () => L(!1),
780
+ onWaiting: () => k(!0),
781
+ onPlay: () => O(!1),
782
782
  onEnded: () => {
783
- i || (p(!1), _(0));
783
+ i || (v(!1), x(0));
784
784
  },
785
785
  children: /* @__PURE__ */ n("track", { kind: "captions" })
786
786
  }
@@ -793,23 +793,23 @@ const sa = (e) => {
793
793
  muted: d,
794
794
  playsInline: !0,
795
795
  style: { width: "100%", height: "100%" },
796
- onLoadStart: () => I(!0),
796
+ onLoadStart: () => k(!0),
797
797
  onCanPlay: () => {
798
- I(!1), F(!1);
798
+ k(!1), D(!1);
799
799
  },
800
- onWaiting: () => I(!0),
801
- onPlay: () => L(!1),
800
+ onWaiting: () => k(!0),
801
+ onPlay: () => O(!1),
802
802
  onLoadedMetadata: () => {
803
- const x = u.current;
804
- x instanceof HTMLVideoElement && x.videoWidth && x.videoHeight && E(x.videoWidth / x.videoHeight);
803
+ const w = u.current;
804
+ w instanceof HTMLVideoElement && w.videoWidth && w.videoHeight && T(w.videoWidth / w.videoHeight);
805
805
  },
806
806
  onEnded: () => {
807
- i || (p(!1), _(0));
807
+ i || (v(!1), x(0));
808
808
  },
809
809
  children: /* @__PURE__ */ n("track", { kind: "captions" })
810
810
  }
811
811
  ) }),
812
- N && !$ && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
812
+ E && !$ && /* @__PURE__ */ n("div", { className: "absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ n(
813
813
  pe,
814
814
  {
815
815
  className: "size-8 animate-spin text-white/80",
@@ -823,11 +823,11 @@ const sa = (e) => {
823
823
  role: "button",
824
824
  tabIndex: 0,
825
825
  "aria-label": "Play preview",
826
- onClick: (x) => {
827
- x.stopPropagation(), A();
826
+ onClick: (w) => {
827
+ w.stopPropagation(), S();
828
828
  },
829
- onKeyDown: (x) => {
830
- x.key !== "Enter" && x.key !== " " || (x.preventDefault(), x.stopPropagation(), A());
829
+ onKeyDown: (w) => {
830
+ w.key !== "Enter" && w.key !== " " || (w.preventDefault(), w.stopPropagation(), S());
831
831
  },
832
832
  children: /* @__PURE__ */ n("span", { className: "flex size-16 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm", children: /* @__PURE__ */ n(Ue, { className: "size-9 translate-x-0.5", weight: "fill" }) })
833
833
  }
@@ -837,23 +837,23 @@ const sa = (e) => {
837
837
  {
838
838
  role: "slider",
839
839
  "aria-label": "Playback position",
840
- "aria-valuenow": q,
840
+ "aria-valuenow": G,
841
841
  "aria-valuemin": 0,
842
842
  "aria-valuemax": 100,
843
843
  tabIndex: 0,
844
844
  ref: f,
845
845
  className: "relative flex h-4 w-full cursor-pointer items-center",
846
- onMouseDown: H,
847
- onTouchStart: H,
848
- onClick: (x) => x.stopPropagation(),
849
- onKeyDown: (x) => {
850
- x.key === "ArrowRight" && B(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, v - 0.05));
846
+ onMouseDown: Y,
847
+ onTouchStart: Y,
848
+ onClick: (w) => w.stopPropagation(),
849
+ onKeyDown: (w) => {
850
+ w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
851
851
  },
852
852
  children: /* @__PURE__ */ n("div", { className: "w-full overflow-hidden rounded-full bg-white/30 h-1", children: /* @__PURE__ */ n(
853
853
  "div",
854
854
  {
855
855
  className: "h-full rounded-full bg-white",
856
- style: { width: `${q}%` }
856
+ style: { width: `${G}%` }
857
857
  }
858
858
  ) })
859
859
  }
@@ -863,12 +863,12 @@ const sa = (e) => {
863
863
  "button",
864
864
  {
865
865
  type: "button",
866
- onClick: (x) => {
867
- x.stopPropagation(), p((k) => !k);
866
+ onClick: (w) => {
867
+ w.stopPropagation(), v((C) => !C);
868
868
  },
869
869
  className: "shrink-0 text-white",
870
- "aria-label": w ? "Pause" : "Play",
871
- children: w ? /* @__PURE__ */ n(ks, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ue, { className: "size-5 translate-x-px", weight: "fill" })
870
+ "aria-label": _ ? "Pause" : "Play",
871
+ children: _ ? /* @__PURE__ */ n(ks, { className: "size-5", weight: "fill" }) : /* @__PURE__ */ n(Ue, { className: "size-5 translate-x-px", weight: "fill" })
872
872
  }
873
873
  ),
874
874
  /* @__PURE__ */ h(
@@ -876,30 +876,30 @@ const sa = (e) => {
876
876
  {
877
877
  role: "slider",
878
878
  "aria-label": "Playback position",
879
- "aria-valuenow": q,
879
+ "aria-valuenow": G,
880
880
  "aria-valuemin": 0,
881
881
  "aria-valuemax": 100,
882
882
  tabIndex: 0,
883
883
  ref: f,
884
884
  className: "relative flex h-4 w-full cursor-pointer items-center",
885
- onMouseDown: H,
886
- onTouchStart: H,
887
- onClick: (x) => x.stopPropagation(),
888
- onMouseEnter: () => D(!0),
889
- onMouseLeave: () => D(!1),
890
- onKeyDown: (x) => {
891
- x.key === "ArrowRight" && B(Math.min(1, v + 0.05)), x.key === "ArrowLeft" && B(Math.max(0, v - 0.05));
885
+ onMouseDown: Y,
886
+ onTouchStart: Y,
887
+ onClick: (w) => w.stopPropagation(),
888
+ onMouseEnter: () => L(!0),
889
+ onMouseLeave: () => L(!1),
890
+ onKeyDown: (w) => {
891
+ w.key === "ArrowRight" && F(Math.min(1, p + 0.05)), w.key === "ArrowLeft" && F(Math.max(0, p - 0.05));
892
892
  },
893
893
  children: [
894
894
  /* @__PURE__ */ n(
895
895
  "div",
896
896
  {
897
- className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${M || R ? "h-1.5" : "h-1"}`,
897
+ className: `w-full overflow-hidden rounded-full bg-white/30 transition-all duration-200 ${N || A ? "h-1.5" : "h-1"}`,
898
898
  children: /* @__PURE__ */ n(
899
899
  "div",
900
900
  {
901
901
  className: "h-full rounded-full bg-white",
902
- style: { width: `${q}%` }
902
+ style: { width: `${G}%` }
903
903
  }
904
904
  )
905
905
  }
@@ -907,8 +907,8 @@ const sa = (e) => {
907
907
  /* @__PURE__ */ n(
908
908
  "div",
909
909
  {
910
- className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${M || R ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
911
- style: { left: `${q}%` }
910
+ className: `absolute size-3 -translate-x-1/2 rounded-full bg-white shadow transition-[opacity,transform] duration-200 ${N || A ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
911
+ style: { left: `${G}%` }
912
912
  }
913
913
  )
914
914
  ]
@@ -1018,7 +1018,7 @@ const sa = (e) => {
1018
1018
  {
1019
1019
  ref: g,
1020
1020
  "data-testid": u,
1021
- className: C(
1021
+ className: y(
1022
1022
  "relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
1023
1023
  f ? "bg-[#121110]" : "bg-white"
1024
1024
  ),
@@ -1030,7 +1030,7 @@ const sa = (e) => {
1030
1030
  c.trim() !== "" && /* @__PURE__ */ n(
1031
1031
  "p",
1032
1032
  {
1033
- className: C("mb-0.5 truncate text-base font-medium", {
1033
+ className: y("mb-0.5 truncate text-base font-medium", {
1034
1034
  "text-black": !f,
1035
1035
  "text-white/30": f && b,
1036
1036
  "text-white": f && !b
@@ -1040,7 +1040,7 @@ const sa = (e) => {
1040
1040
  ),
1041
1041
  /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-1", children: [
1042
1042
  ce(r, {
1043
- className: C(
1043
+ className: y(
1044
1044
  "size-5 shrink-0",
1045
1045
  f ? "text-white/55" : "text-black/55"
1046
1046
  ),
@@ -1049,7 +1049,7 @@ const sa = (e) => {
1049
1049
  i != null && i !== "" && /* @__PURE__ */ n(
1050
1050
  "span",
1051
1051
  {
1052
- className: C(
1052
+ className: y(
1053
1053
  "text-xs font-medium",
1054
1054
  f ? "text-white/55" : "text-black/55"
1055
1055
  ),
@@ -1158,13 +1158,13 @@ const ma = ({
1158
1158
  function et(e) {
1159
1159
  var u, f, c, b;
1160
1160
  const t = (u = e.attachments) == null ? void 0 : u.find(
1161
- (w) => w.type === "video" && w.asset_url
1161
+ (_) => _.type === "video" && _.asset_url
1162
1162
  ), s = (f = e.attachments) == null ? void 0 : f.find(
1163
- (w) => w.type === "image" && w.image_url
1163
+ (_) => _.type === "image" && _.image_url
1164
1164
  ), a = (c = e.attachments) == null ? void 0 : c.find(
1165
- (w) => w.type === "audio" && w.asset_url
1165
+ (_) => _.type === "audio" && _.asset_url
1166
1166
  ), r = (b = e.attachments) == null ? void 0 : b.find(
1167
- (w) => w.type === "file" && w.asset_url
1167
+ (_) => _.type === "file" && _.asset_url
1168
1168
  ), i = t ?? s ?? a ?? r, o = (t == null ? void 0 : t.asset_url) ?? (s == null ? void 0 : s.image_url) ?? (a == null ? void 0 : a.asset_url) ?? (r == null ? void 0 : r.asset_url);
1169
1169
  if (!o) return null;
1170
1170
  const l = (i == null ? void 0 : i.mime_type) ?? ((i == null ? void 0 : i.type) === "image" ? "image/jpeg" : (i == null ? void 0 : i.type) === "video" ? "video/mp4" : (i == null ? void 0 : i.type) === "audio" ? "audio/mpeg" : "application/octet-stream"), d = i == null ? void 0 : i.title, m = i == null ? void 0 : i.file_size, g = t == null ? void 0 : t.thumb_url;
@@ -1240,7 +1240,7 @@ const an = ({
1240
1240
  const s = Qe(e), a = et(e);
1241
1241
  return !s && !a ? null : /* @__PURE__ */ h("div", { className: t ? "str-chat__message str-chat__message-simple str-chat__message--me str-chat__message-simple--me" : "str-chat__message str-chat__message-simple str-chat__message--other", children: [
1242
1242
  !t && e.user && /* @__PURE__ */ n(
1243
- ie,
1243
+ oe,
1244
1244
  {
1245
1245
  className: "str-chat__avatar str-chat__message-sender-avatar",
1246
1246
  id: e.user.id,
@@ -1363,7 +1363,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1363
1363
  "button",
1364
1364
  {
1365
1365
  type: "button",
1366
- className: C("message-vote-button focus-ring", {
1366
+ className: y("message-vote-button focus-ring", {
1367
1367
  "message-vote-button--selected": e === "up"
1368
1368
  }),
1369
1369
  onClick: t,
@@ -1377,7 +1377,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1377
1377
  "button",
1378
1378
  {
1379
1379
  type: "button",
1380
- className: C("message-vote-button focus-ring", {
1380
+ className: y("message-vote-button focus-ring", {
1381
1381
  "message-vote-button--selected": e === "down"
1382
1382
  }),
1383
1383
  onClick: s,
@@ -1404,62 +1404,62 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1404
1404
  isMyMessage: f,
1405
1405
  message: c,
1406
1406
  renderText: b,
1407
- threadList: w,
1408
- viewerLanguage: p
1409
- } = e, { client: v } = We("CustomMessage"), { channel: _ } = de("CustomMessage"), { isUnlocking: R, onUnlockClick: y, onFetchSource: M, onDownloadClick: D } = va("LockedAttachment"), [$, L] = z(!1), N = Ln(c.id), { selected: I, voteUp: S, voteDown: F } = Hs(c), {
1410
- Attachment: T = Dn,
1411
- EditMessageModal: E = On,
1412
- MessageActions: A,
1413
- MessageBlocked: O = Pn,
1414
- MessageBouncePrompt: B = zn,
1415
- MessageDeleted: H = $n,
1416
- MessageIsThreadReplyInChannelButtonIndicator: V = Fn,
1417
- MessageRepliesCountButton: Y = Bn,
1418
- ReminderNotification: q = Un,
1419
- StreamedMessageText: x = jn,
1420
- PinIndicator: k
1421
- } = jt("CustomMessage"), P = Vn(c), W = Gn(c), K = ne(
1407
+ threadList: _,
1408
+ viewerLanguage: v
1409
+ } = e, { client: p } = We("CustomMessage"), { channel: x } = de("CustomMessage"), { isUnlocking: A, onUnlockClick: M, onFetchSource: N, onDownloadClick: L } = va("LockedAttachment"), [$, O] = z(!1), E = Ln(c.id), { selected: k, voteUp: R, voteDown: D } = Hs(c), {
1410
+ Attachment: I = Dn,
1411
+ EditMessageModal: T = On,
1412
+ MessageActions: S,
1413
+ MessageBlocked: P = Pn,
1414
+ MessageBouncePrompt: F = zn,
1415
+ MessageDeleted: Y = $n,
1416
+ MessageIsThreadReplyInChannelButtonIndicator: Z = Fn,
1417
+ MessageRepliesCountButton: q = Bn,
1418
+ ReminderNotification: G = Un,
1419
+ StreamedMessageText: w = jn,
1420
+ PinIndicator: C
1421
+ } = jt("CustomMessage"), B = Vn(c), j = Gn(c), W = ne(
1422
1422
  () => u == null ? void 0 : u(c),
1423
1423
  [u, c]
1424
- ), G = ne(() => {
1424
+ ), V = ne(() => {
1425
1425
  const fe = c.attachments ?? [], Ce = c.shared_location ? [c.shared_location, ...fe] : fe;
1426
1426
  if (!Ee(c)) return Ce;
1427
1427
  const It = Ce.filter((Tt) => !("type" in Tt) || !sn(Tt));
1428
1428
  return It.length === Ce.length ? Ce : It;
1429
- }, [c]), ee = ne(() => {
1430
- const fe = Kt({ message: c, viewerLanguage: p });
1429
+ }, [c]), J = ne(() => {
1430
+ const fe = Kt({ message: c, viewerLanguage: v });
1431
1431
  return fe === c.text ? c : { ...c, text: fe };
1432
- }, [c, p]);
1432
+ }, [c, v]);
1433
1433
  if (Hn(c))
1434
1434
  return null;
1435
1435
  if (c.deleted_at || c.type === "deleted")
1436
- return /* @__PURE__ */ n(H, { message: c });
1436
+ return /* @__PURE__ */ n(Y, { message: c });
1437
1437
  if (Yn(c))
1438
- return /* @__PURE__ */ n(O, {});
1439
- const ue = !w && !!c.reply_count, Z = !w && c.show_in_channel && c.parent_id, re = c.status === "failed" && ((ft = c.error) == null ? void 0 : ft.status) !== 403, te = qn(c);
1440
- let oe;
1441
- re ? oe = () => m(c) : te && (oe = () => L(!0));
1442
- const me = f(), En = C(
1438
+ return /* @__PURE__ */ n(P, {});
1439
+ const re = !_ && !!c.reply_count, ue = !_ && c.show_in_channel && c.parent_id, ee = c.status === "failed" && ((ft = c.error) == null ? void 0 : ft.status) !== 403, ie = qn(c);
1440
+ let Q;
1441
+ ee ? Q = () => m(c) : ie && (Q = () => O(!0));
1442
+ const me = f(), En = y(
1443
1443
  "str-chat__message str-chat__message-simple",
1444
1444
  `str-chat__message--${c.type}`,
1445
1445
  `str-chat__message--${c.status}`,
1446
1446
  me ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
1447
1447
  c.text ? "str-chat__message--has-text" : "has-no-text",
1448
1448
  {
1449
- "str-chat__message--has-attachment": P,
1449
+ "str-chat__message--has-attachment": B,
1450
1450
  "str-chat__message--highlighted": g,
1451
1451
  "str-chat__message--pinned pinned-message": c.pinned,
1452
- "str-chat__message--with-reactions": W,
1452
+ "str-chat__message--with-reactions": j,
1453
1453
  "str-chat__message-send-can-be-retried": (c == null ? void 0 : c.status) === "failed" && ((gt = c == null ? void 0 : c.error) == null ? void 0 : gt.status) !== 403,
1454
- "str-chat__message-with-thread-link": ue || Z,
1454
+ "str-chat__message-with-thread-link": re || ue,
1455
1455
  "str-chat__virtual-message__wrapper--end": r,
1456
1456
  "str-chat__virtual-message__wrapper--first": i,
1457
1457
  "str-chat__virtual-message__wrapper--group": o
1458
1458
  }
1459
- ), dt = c.poll_id && v.polls.fromState(c.poll_id), ut = ya(c), he = Ee(c), mt = Na(c), Le = !!(G != null && G.length && !c.quoted_message), ht = he && me && Le;
1459
+ ), dt = c.poll_id && p.polls.fromState(c.poll_id), ut = ya(c), he = Ee(c), mt = Na(c), Le = !!(V != null && V.length && !c.quoted_message), ht = he && me && Le;
1460
1460
  return /* @__PURE__ */ h(se, { children: [
1461
1461
  a && /* @__PURE__ */ n(
1462
- E,
1462
+ T,
1463
1463
  {
1464
1464
  additionalMessageInputProps: t
1465
1465
  }
@@ -1467,8 +1467,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1467
1467
  $ && /* @__PURE__ */ n(
1468
1468
  Wn,
1469
1469
  {
1470
- MessageBouncePrompt: B,
1471
- onClose: () => L(!1),
1470
+ MessageBouncePrompt: F,
1471
+ onClose: () => O(!1),
1472
1472
  open: $
1473
1473
  }
1474
1474
  ),
@@ -1478,10 +1478,10 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1478
1478
  className: En,
1479
1479
  "data-message-id": c.id,
1480
1480
  children: [
1481
- k && /* @__PURE__ */ n(k, {}),
1482
- !!N && /* @__PURE__ */ n(q, { reminder: N }),
1481
+ C && /* @__PURE__ */ n(C, {}),
1482
+ !!E && /* @__PURE__ */ n(G, { reminder: E }),
1483
1483
  c.user && /* @__PURE__ */ n(
1484
- ie,
1484
+ oe,
1485
1485
  {
1486
1486
  className: "str-chat__avatar str-chat__message-sender-avatar",
1487
1487
  id: c.user.id,
@@ -1495,14 +1495,14 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1495
1495
  /* @__PURE__ */ n(
1496
1496
  "div",
1497
1497
  {
1498
- className: C("str-chat__message-inner", {
1499
- "str-chat__simple-message--error-failed": re || te
1498
+ className: y("str-chat__message-inner", {
1499
+ "str-chat__simple-message--error-failed": ee || ie
1500
1500
  }),
1501
1501
  "data-testid": "message-inner",
1502
- onClick: oe,
1503
- onKeyDown: oe,
1504
- role: oe ? "button" : void 0,
1505
- tabIndex: oe ? 0 : void 0,
1502
+ onClick: Q,
1503
+ onKeyDown: Q,
1504
+ role: Q ? "button" : void 0,
1505
+ tabIndex: Q ? 0 : void 0,
1506
1506
  style: {
1507
1507
  // Force margins to 0 to prevent hover layout shift
1508
1508
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
@@ -1511,7 +1511,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1511
1511
  },
1512
1512
  children: mt ? /* @__PURE__ */ h("div", { className: "str-chat__message-bubble-wrapper", children: [
1513
1513
  me ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1514
- A && /* @__PURE__ */ n(A, {}),
1514
+ S && /* @__PURE__ */ n(S, {}),
1515
1515
  /* @__PURE__ */ n(
1516
1516
  zt.Sent,
1517
1517
  {
@@ -1521,8 +1521,8 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1521
1521
  amountText: (xt = c.metadata) == null ? void 0 : xt.amount_text,
1522
1522
  detail: (wt = c.metadata) == null ? void 0 : wt.attachment_detail,
1523
1523
  paymentStatus: (_t = c.metadata) == null ? void 0 : _t.payment_status,
1524
- onPreviewClick: () => y == null ? void 0 : y(c, _),
1525
- onFetchSource: async () => await (M == null ? void 0 : M(c, _))
1524
+ onPreviewClick: () => M == null ? void 0 : M(c, x),
1525
+ onFetchSource: async () => await (N == null ? void 0 : N(c, x))
1526
1526
  }
1527
1527
  )
1528
1528
  ] }) : /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
@@ -1535,18 +1535,18 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1535
1535
  amountText: (kt = c.metadata) == null ? void 0 : kt.amount_text,
1536
1536
  detail: (Et = c.metadata) == null ? void 0 : Et.attachment_detail,
1537
1537
  paymentStatus: (St = c.metadata) == null ? void 0 : St.payment_status,
1538
- isUnlocking: R(c.id),
1539
- onUnlockClick: () => y == null ? void 0 : y(c, _),
1540
- onFetchSource: async () => await (M == null ? void 0 : M(c, _)),
1541
- onDownloadClick: () => D == null ? void 0 : D(c, _)
1538
+ isUnlocking: A(c.id),
1539
+ onUnlockClick: () => M == null ? void 0 : M(c, x),
1540
+ onFetchSource: async () => await (N == null ? void 0 : N(c, x)),
1541
+ onDownloadClick: () => L == null ? void 0 : L(c, x)
1542
1542
  }
1543
1543
  ),
1544
- A && /* @__PURE__ */ n(A, {})
1544
+ S && /* @__PURE__ */ n(S, {})
1545
1545
  ] }),
1546
1546
  c.text && /* @__PURE__ */ n("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ n(
1547
1547
  Mt,
1548
1548
  {
1549
- message: ee,
1549
+ message: J,
1550
1550
  renderText: b
1551
1551
  }
1552
1552
  ) })
@@ -1563,23 +1563,23 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1563
1563
  }
1564
1564
  ),
1565
1565
  dt && /* @__PURE__ */ n(Xn, { poll: dt }),
1566
- G != null && G.length && !c.quoted_message ? /* @__PURE__ */ n(
1567
- T,
1566
+ V != null && V.length && !c.quoted_message ? /* @__PURE__ */ n(
1567
+ I,
1568
1568
  {
1569
1569
  actionHandler: l,
1570
- attachments: G
1570
+ attachments: V
1571
1571
  }
1572
1572
  ) : null,
1573
- K ? /* @__PURE__ */ n(
1574
- x,
1573
+ W ? /* @__PURE__ */ n(
1574
+ w,
1575
1575
  {
1576
- message: ee,
1576
+ message: J,
1577
1577
  renderText: b
1578
1578
  }
1579
1579
  ) : /* @__PURE__ */ n(
1580
1580
  Mt,
1581
1581
  {
1582
- message: ee,
1582
+ message: J,
1583
1583
  renderText: b
1584
1584
  }
1585
1585
  ),
@@ -1599,20 +1599,20 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1599
1599
  s && he && /* @__PURE__ */ n(
1600
1600
  Ca,
1601
1601
  {
1602
- selected: I,
1603
- onVoteUp: S,
1604
- onVoteDown: F
1602
+ selected: k,
1603
+ onVoteUp: R,
1604
+ onVoteDown: D
1605
1605
  }
1606
1606
  )
1607
1607
  ] }),
1608
- ue && /* @__PURE__ */ n(
1609
- Y,
1608
+ re && /* @__PURE__ */ n(
1609
+ q,
1610
1610
  {
1611
1611
  onClick: d,
1612
1612
  reply_count: c.reply_count
1613
1613
  }
1614
1614
  ),
1615
- Z && /* @__PURE__ */ n(V, {})
1615
+ ue && /* @__PURE__ */ n(Z, {})
1616
1616
  ]
1617
1617
  },
1618
1618
  c.id
@@ -1919,16 +1919,16 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1919
1919
  Oe.Generating,
1920
1920
  Oe.ExternalSources
1921
1921
  ]), qa = ({ threadList: e }) => {
1922
- var b, w;
1922
+ var b, _;
1923
1923
  const { channel: t, channelConfig: s, thread: a } = de(), { client: r } = We(), { typing: i = {} } = rs(), { aiState: o } = is(t), l = Ae(dn);
1924
1924
  if (!e && l && Ya.has(o)) {
1925
- const p = Wa(t, (b = r.user) == null ? void 0 : b.id);
1925
+ const v = Wa(t, (b = r.user) == null ? void 0 : b.id);
1926
1926
  return /* @__PURE__ */ n(
1927
1927
  Bt,
1928
1928
  {
1929
- avatarId: (p == null ? void 0 : p.id) ?? "ai-agent",
1930
- avatarName: (p == null ? void 0 : p.name) ?? (p == null ? void 0 : p.id) ?? "Agent",
1931
- avatarImage: p == null ? void 0 : p.image,
1929
+ avatarId: (v == null ? void 0 : v.id) ?? "ai-agent",
1930
+ avatarName: (v == null ? void 0 : v.name) ?? (v == null ? void 0 : v.id) ?? "Agent",
1931
+ avatarImage: v == null ? void 0 : v.image,
1932
1932
  testId: "typing-indicator-ai"
1933
1933
  }
1934
1934
  );
@@ -1936,19 +1936,19 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1936
1936
  if ((s == null ? void 0 : s.typing_events) === !1)
1937
1937
  return null;
1938
1938
  const m = e ? [] : Object.values(i).filter(
1939
- ({ parent_id: p, user: v }) => {
1940
- var _;
1941
- return (v == null ? void 0 : v.id) !== ((_ = r.user) == null ? void 0 : _.id) && !p;
1939
+ ({ parent_id: v, user: p }) => {
1940
+ var x;
1941
+ return (p == null ? void 0 : p.id) !== ((x = r.user) == null ? void 0 : x.id) && !v;
1942
1942
  }
1943
1943
  ), g = e ? Object.values(i).filter(
1944
- ({ parent_id: p, user: v }) => {
1945
- var _;
1946
- return (v == null ? void 0 : v.id) !== ((_ = r.user) == null ? void 0 : _.id) && p === (a == null ? void 0 : a.id);
1944
+ ({ parent_id: v, user: p }) => {
1945
+ var x;
1946
+ return (p == null ? void 0 : p.id) !== ((x = r.user) == null ? void 0 : x.id) && v === (a == null ? void 0 : a.id);
1947
1947
  }
1948
1948
  ) : [], u = e ? g : m;
1949
1949
  if (!u.length)
1950
1950
  return null;
1951
- const f = (w = u[0]) == null ? void 0 : w.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1951
+ const f = (_ = u[0]) == null ? void 0 : _.user, c = f != null && f.id && t.state.members[f.id] ? t.state.members[f.id].user : void 0;
1952
1952
  return /* @__PURE__ */ n(
1953
1953
  Bt,
1954
1954
  {
@@ -1973,7 +1973,7 @@ const xa = ({ size: e = 15 }) => /* @__PURE__ */ n(
1973
1973
  },
1974
1974
  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: [
1975
1975
  /* @__PURE__ */ n(
1976
- ie,
1976
+ oe,
1977
1977
  {
1978
1978
  className: "str-chat__avatar str-chat__message-sender-avatar",
1979
1979
  id: e,
@@ -2014,7 +2014,7 @@ function Wa(e, t) {
2014
2014
  const Xa = () => null, Ka = ({ className: e, message: t }) => /* @__PURE__ */ h(
2015
2015
  "div",
2016
2016
  {
2017
- className: C("flex items-center justify-center h-full", e),
2017
+ className: y("flex items-center justify-center h-full", e),
2018
2018
  children: [
2019
2019
  /* @__PURE__ */ h("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
2020
2020
  /* @__PURE__ */ n("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ n(
@@ -2075,25 +2075,29 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2075
2075
  customChannelActions: f,
2076
2076
  renderChannelActions: c,
2077
2077
  showChannelInfo: b = !0,
2078
- onParticipantNameClick: w
2078
+ onParticipantNameClick: _,
2079
+ renderHeaderTitleBadges: v
2079
2080
  }) => {
2080
- var D, $, L, N, I;
2081
- const { channel: p } = de(), v = U.useMemo(() => {
2082
- var T, E;
2083
- const S = (T = p._client) == null ? void 0 : T.userID;
2084
- return S ? Object.values(((E = p.state) == null ? void 0 : E.members) || {}).find(
2085
- (A) => {
2086
- var O;
2087
- return ((O = A.user) == null ? void 0 : O.id) && A.user.id !== S;
2081
+ var O, E, k, R, D;
2082
+ const { channel: p } = de(), x = U.useMemo(() => {
2083
+ var S, P;
2084
+ const I = (S = p._client) == null ? void 0 : S.userID;
2085
+ return I ? Object.values(((P = p.state) == null ? void 0 : P.members) || {}).find(
2086
+ (F) => {
2087
+ var Y;
2088
+ return ((Y = F.user) == null ? void 0 : Y.id) && F.user.id !== I;
2088
2089
  }
2089
2090
  ) : void 0;
2090
- }, [(D = p._client) == null ? void 0 : D.userID, ($ = p.state) == null ? void 0 : $.members]), _ = Xt(v == null ? void 0 : v.user), R = (L = v == null ? void 0 : v.user) == null ? void 0 : L.image, y = Wt(p), M = async () => {
2091
+ }, [(O = p._client) == null ? void 0 : O.userID, (E = p.state) == null ? void 0 : E.members]), A = Xt(x == null ? void 0 : x.user), M = (k = x == null ? void 0 : x.user) == null ? void 0 : k.image, N = Wt(p), L = v == null ? void 0 : v({
2092
+ channel: p,
2093
+ participant: x
2094
+ }), $ = async () => {
2091
2095
  try {
2092
- y ? await p.unpin() : await p.pin();
2093
- } catch (S) {
2096
+ N ? await p.unpin() : await p.pin();
2097
+ } catch (I) {
2094
2098
  console.error(
2095
2099
  "[CustomChannelHeader] Failed to update pinned status:",
2096
- S
2100
+ I
2097
2101
  );
2098
2102
  }
2099
2103
  };
@@ -2102,7 +2106,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2102
2106
  /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: t && /* @__PURE__ */ n(
2103
2107
  "button",
2104
2108
  {
2105
- className: C(
2109
+ className: y(
2106
2110
  le,
2107
2111
  "messaging-channel-view-back-button-mobile bg-[#F1F0EE]"
2108
2112
  ),
@@ -2115,29 +2119,33 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2115
2119
  ) }),
2116
2120
  /* @__PURE__ */ h("div", { className: "flex flex-col gap-1 items-center", children: [
2117
2121
  /* @__PURE__ */ n(
2118
- ie,
2122
+ oe,
2119
2123
  {
2120
- id: ((N = v == null ? void 0 : v.user) == null ? void 0 : N.id) || p.id || "unknown",
2121
- name: _,
2122
- image: R,
2123
- starred: s && y,
2124
+ id: ((R = x == null ? void 0 : x.user) == null ? void 0 : R.id) || p.id || "unknown",
2125
+ name: A,
2126
+ image: M,
2127
+ starred: s && N,
2124
2128
  dmAgentEnabled: a,
2125
2129
  size: 48
2126
2130
  }
2127
2131
  ),
2128
- w ? /* @__PURE__ */ h(
2132
+ _ ? /* @__PURE__ */ h(
2129
2133
  "button",
2130
2134
  {
2131
2135
  type: "button",
2132
- onClick: w,
2133
- "aria-label": `View details for ${_}`,
2136
+ onClick: _,
2137
+ "aria-label": `View details for ${A}`,
2134
2138
  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",
2135
2139
  children: [
2136
- /* @__PURE__ */ n("span", { className: "truncate", children: _ }),
2140
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2141
+ L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L }),
2137
2142
  /* @__PURE__ */ n(Ve, { className: "size-3 shrink-0", weight: "bold" })
2138
2143
  ]
2139
2144
  }
2140
- ) : /* @__PURE__ */ n("p", { className: "text-center text-xs font-medium text-black/90", children: _ }),
2145
+ ) : /* @__PURE__ */ h("p", { className: "flex max-w-full items-center justify-center gap-1 text-center text-xs font-medium text-black/90", children: [
2146
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2147
+ L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
2148
+ ] }),
2141
2149
  a && /* @__PURE__ */ h("div", { className: "flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2142
2150
  /* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
2143
2151
  /* @__PURE__ */ n("span", { children: Ut })
@@ -2148,17 +2156,17 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2148
2156
  "button",
2149
2157
  {
2150
2158
  className: le,
2151
- onClick: M,
2159
+ onClick: $,
2152
2160
  type: "button",
2153
- "aria-label": y ? "Unstar conversation" : "Star conversation",
2161
+ "aria-label": N ? "Unstar conversation" : "Star conversation",
2154
2162
  children: /* @__PURE__ */ n(
2155
2163
  Be,
2156
2164
  {
2157
- className: C("size-5", {
2158
- "text-yellow-600": y,
2159
- "text-black/90": !y
2165
+ className: y("size-5", {
2166
+ "text-yellow-600": N,
2167
+ "text-black/90": !N
2160
2168
  }),
2161
- weight: y ? "duotone" : "regular"
2169
+ weight: N ? "duotone" : "regular"
2162
2170
  }
2163
2171
  )
2164
2172
  }
@@ -2167,7 +2175,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2167
2175
  Pt,
2168
2176
  {
2169
2177
  channel: p,
2170
- participant: v,
2178
+ participant: x,
2171
2179
  showDeleteConversation: o,
2172
2180
  showBlockParticipant: l,
2173
2181
  showReportParticipant: d,
@@ -2177,7 +2185,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2177
2185
  onBlockParticipantClick: g,
2178
2186
  onReportParticipantClick: u,
2179
2187
  customChannelActions: f,
2180
- triggerClassName: C(le, "bg-[#F1F0EE]")
2188
+ triggerClassName: y(le, "bg-[#F1F0EE]")
2181
2189
  }
2182
2190
  ))
2183
2191
  ] })
@@ -2187,7 +2195,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2187
2195
  t && e && /* @__PURE__ */ n(
2188
2196
  "button",
2189
2197
  {
2190
- className: C(
2198
+ className: y(
2191
2199
  le,
2192
2200
  "messaging-channel-view-back-button-desktop"
2193
2201
  ),
@@ -2198,30 +2206,34 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2198
2206
  }
2199
2207
  ),
2200
2208
  /* @__PURE__ */ n(
2201
- ie,
2209
+ oe,
2202
2210
  {
2203
- id: ((I = v == null ? void 0 : v.user) == null ? void 0 : I.id) || p.id || "unknown",
2204
- name: _,
2205
- image: R,
2206
- starred: s && y,
2211
+ id: ((D = x == null ? void 0 : x.user) == null ? void 0 : D.id) || p.id || "unknown",
2212
+ name: A,
2213
+ image: M,
2214
+ starred: s && N,
2207
2215
  dmAgentEnabled: a,
2208
2216
  size: 48
2209
2217
  }
2210
2218
  ),
2211
2219
  /* @__PURE__ */ h("div", { className: "min-w-0", children: [
2212
- w ? /* @__PURE__ */ h(
2220
+ _ ? /* @__PURE__ */ h(
2213
2221
  "button",
2214
2222
  {
2215
2223
  type: "button",
2216
- onClick: w,
2217
- "aria-label": `View details for ${_}`,
2224
+ onClick: _,
2225
+ "aria-label": `View details for ${A}`,
2218
2226
  className: "flex min-w-0 max-w-full items-center gap-1 rounded font-medium text-black/90 transition-opacity hover:opacity-70",
2219
2227
  children: [
2220
- /* @__PURE__ */ n("span", { className: "truncate", children: _ }),
2228
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2229
+ L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L }),
2221
2230
  /* @__PURE__ */ n(Ve, { className: "size-4 shrink-0", weight: "bold" })
2222
2231
  ]
2223
2232
  }
2224
- ) : /* @__PURE__ */ n("h1", { className: "font-medium text-black/90 truncate", children: _ }),
2233
+ ) : /* @__PURE__ */ h("h1", { className: "flex min-w-0 items-center gap-1 font-medium text-black/90", children: [
2234
+ /* @__PURE__ */ n("span", { className: "min-w-0 truncate", children: A }),
2235
+ L && /* @__PURE__ */ n("span", { className: "shrink-0", children: L })
2236
+ ] }),
2225
2237
  a && /* @__PURE__ */ h("div", { className: "mt-0.5 flex items-center gap-1 text-[10px] leading-3 text-black/55", children: [
2226
2238
  /* @__PURE__ */ n(je, { className: "size-3 shrink-0 text-black/55" }),
2227
2239
  /* @__PURE__ */ n("span", { className: "truncate", children: Ut })
@@ -2233,17 +2245,17 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2233
2245
  "button",
2234
2246
  {
2235
2247
  className: le,
2236
- onClick: M,
2248
+ onClick: $,
2237
2249
  type: "button",
2238
- "aria-label": y ? "Unstar conversation" : "Star conversation",
2250
+ "aria-label": N ? "Unstar conversation" : "Star conversation",
2239
2251
  children: /* @__PURE__ */ n(
2240
2252
  Be,
2241
2253
  {
2242
- className: C("size-6", {
2243
- "text-yellow-600": y,
2244
- "text-black/90": !y
2254
+ className: y("size-6", {
2255
+ "text-yellow-600": N,
2256
+ "text-black/90": !N
2245
2257
  }),
2246
- weight: y ? "duotone" : "regular"
2258
+ weight: N ? "duotone" : "regular"
2247
2259
  }
2248
2260
  )
2249
2261
  }
@@ -2252,7 +2264,7 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2252
2264
  Pt,
2253
2265
  {
2254
2266
  channel: p,
2255
- participant: v,
2267
+ participant: x,
2256
2268
  showDeleteConversation: o,
2257
2269
  showBlockParticipant: l,
2258
2270
  showReportParticipant: d,
@@ -2284,53 +2296,54 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2284
2296
  showReportParticipant: f = !0,
2285
2297
  composerDisabled: c = !1,
2286
2298
  composerDisabledReason: b,
2287
- showStarButton: w = !1,
2288
- chatbotVotingEnabled: p = !1,
2289
- renderChannelBanner: v,
2290
- customChannelActions: _,
2291
- renderChannelActions: R,
2292
- renderMessage: y,
2293
- dmAgentEnabled: M = !1,
2294
- viewerLanguage: D,
2295
- showChannelInfo: $ = !0,
2296
- onParticipantNameClick: L
2299
+ showStarButton: _ = !1,
2300
+ chatbotVotingEnabled: v = !1,
2301
+ renderChannelBanner: p,
2302
+ renderHeaderTitleBadges: x,
2303
+ customChannelActions: A,
2304
+ renderChannelActions: M,
2305
+ renderMessage: N,
2306
+ dmAgentEnabled: L = !1,
2307
+ viewerLanguage: $,
2308
+ showChannelInfo: O = !0,
2309
+ onParticipantNameClick: E
2297
2310
  }) => {
2298
- var O, B, H, V, Y, q;
2299
- const { channel: N } = de(), I = U.useMemo(() => {
2300
- var P, W;
2301
- const x = (P = N._client) == null ? void 0 : P.userID;
2302
- return x ? Object.values(((W = N.state) == null ? void 0 : W.members) || {}).find(
2303
- (K) => {
2304
- var G;
2305
- return ((G = K.user) == null ? void 0 : G.id) && K.user.id !== x;
2311
+ var F, Y, Z, q, G, w;
2312
+ const { channel: k } = de(), R = U.useMemo(() => {
2313
+ var j, W;
2314
+ const C = (j = k._client) == null ? void 0 : j.userID;
2315
+ return C ? Object.values(((W = k.state) == null ? void 0 : W.members) || {}).find(
2316
+ (V) => {
2317
+ var J;
2318
+ return ((J = V.user) == null ? void 0 : J.id) && V.user.id !== C;
2306
2319
  }
2307
2320
  ) : void 0;
2308
- }, [(O = N._client) == null ? void 0 : O.userID, (B = N.state) == null ? void 0 : B.members]), S = U.useMemo(() => {
2309
- var P, W;
2310
- const x = (P = N._client) == null ? void 0 : P.userID;
2311
- return x ? Object.values(((W = N.state) == null ? void 0 : W.members) || {}).find((K) => {
2312
- var G;
2313
- return ((G = K.user) == null ? void 0 : G.id) === x;
2321
+ }, [(F = k._client) == null ? void 0 : F.userID, (Y = k.state) == null ? void 0 : Y.members]), D = U.useMemo(() => {
2322
+ var j, W;
2323
+ const C = (j = k._client) == null ? void 0 : j.userID;
2324
+ return C ? Object.values(((W = k.state) == null ? void 0 : W.members) || {}).find((V) => {
2325
+ var J;
2326
+ return ((J = V.user) == null ? void 0 : J.id) === C;
2314
2327
  }) : void 0;
2315
- }, [(H = N._client) == null ? void 0 : H.userID, (V = N.state) == null ? void 0 : V.members]), F = ((Y = S == null ? void 0 : S.user) == null ? void 0 : Y.is_account) ?? (S == null ? void 0 : S.is_account), T = ((q = I == null ? void 0 : I.user) == null ? void 0 : q.is_account) ?? (I == null ? void 0 : I.is_account), E = M && F === !1 && T === !0, A = J(
2316
- (x) => {
2317
- const { message: k } = xe("ChannelView"), P = /* @__PURE__ */ n(
2328
+ }, [(Z = k._client) == null ? void 0 : Z.userID, (q = k.state) == null ? void 0 : q.members]), I = ((G = D == null ? void 0 : D.user) == null ? void 0 : G.is_account) ?? (D == null ? void 0 : D.is_account), T = ((w = R == null ? void 0 : R.user) == null ? void 0 : w.is_account) ?? (R == null ? void 0 : R.is_account), S = L && I === !1 && T === !0, P = K(
2329
+ (C) => {
2330
+ const { message: B } = xe("ChannelView"), j = /* @__PURE__ */ n(
2318
2331
  Sa,
2319
2332
  {
2320
- ...x,
2321
- chatbotVotingEnabled: p,
2322
- viewerLanguage: D
2333
+ ...C,
2334
+ chatbotVotingEnabled: v,
2335
+ viewerLanguage: $
2323
2336
  }
2324
2337
  );
2325
- return !y || !k ? P : y(P, k);
2338
+ return !N || !B ? j : N(j, B);
2326
2339
  },
2327
- [p, y, D]
2340
+ [v, N, $]
2328
2341
  );
2329
2342
  return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
2330
2343
  ls,
2331
2344
  {
2332
2345
  overrides: {
2333
- Message: A,
2346
+ Message: P,
2334
2347
  MessageActions: Aa
2335
2348
  },
2336
2349
  children: /* @__PURE__ */ h(cs, { children: [
@@ -2339,9 +2352,9 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2339
2352
  {
2340
2353
  onBack: e,
2341
2354
  showBackButton: t,
2342
- showChannelInfo: $,
2343
- showStarButton: w,
2344
- dmAgentEnabled: E,
2355
+ showChannelInfo: O,
2356
+ showStarButton: _,
2357
+ dmAgentEnabled: S,
2345
2358
  onLeaveConversation: i,
2346
2359
  onBlockParticipant: o,
2347
2360
  showDeleteConversation: l,
@@ -2350,12 +2363,13 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2350
2363
  onDeleteConversationClick: d,
2351
2364
  onBlockParticipantClick: m,
2352
2365
  onReportParticipantClick: g,
2353
- customChannelActions: _,
2354
- renderChannelActions: R,
2355
- onParticipantNameClick: L
2366
+ customChannelActions: A,
2367
+ renderChannelActions: M,
2368
+ onParticipantNameClick: E,
2369
+ renderHeaderTitleBadges: x
2356
2370
  }
2357
2371
  ) }, "lt-channel-header"),
2358
- v ? /* @__PURE__ */ n(U.Fragment, { children: v() }, "lt-channel-banner") : null,
2372
+ p ? /* @__PURE__ */ n(U.Fragment, { children: p() }, "lt-channel-banner") : null,
2359
2373
  /* @__PURE__ */ n(
2360
2374
  "div",
2361
2375
  {
@@ -2364,14 +2378,14 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2364
2378
  },
2365
2379
  "lt-channel-message-list"
2366
2380
  ),
2367
- r ? /* @__PURE__ */ n(U.Fragment, { children: r(N) }, "lt-channel-conversation-footer") : null,
2381
+ r ? /* @__PURE__ */ n(U.Fragment, { children: r(k) }, "lt-channel-conversation-footer") : null,
2368
2382
  /* @__PURE__ */ n(
2369
2383
  Pa,
2370
2384
  {
2371
2385
  ...s && {
2372
- renderActions: () => s == null ? void 0 : s(N)
2386
+ renderActions: () => s == null ? void 0 : s(k)
2373
2387
  },
2374
- renderFooter: () => a == null ? void 0 : a(N),
2388
+ renderFooter: () => a == null ? void 0 : a(k),
2375
2389
  disabled: c,
2376
2390
  disabledReason: b
2377
2391
  },
@@ -2397,65 +2411,66 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2397
2411
  onBlockParticipantClick: f,
2398
2412
  onReportParticipantClick: c,
2399
2413
  showBlockParticipant: b = !0,
2400
- showReportParticipant: w = !0,
2401
- composerDisabled: p = !1,
2402
- composerDisabledReason: v,
2403
- dmAgentEnabled: _,
2404
- messageMetadata: R,
2405
- onMessageSent: y,
2406
- showStarButton: M = !1,
2407
- chatbotVotingEnabled: D = !1,
2414
+ showReportParticipant: _ = !0,
2415
+ composerDisabled: v = !1,
2416
+ composerDisabledReason: p,
2417
+ dmAgentEnabled: x,
2418
+ messageMetadata: A,
2419
+ onMessageSent: M,
2420
+ showStarButton: N = !1,
2421
+ chatbotVotingEnabled: L = !1,
2408
2422
  renderChannelBanner: $,
2409
- customChannelActions: L,
2410
- renderChannelActions: N,
2411
- renderMessage: I,
2412
- onMessageLinkClick: S,
2413
- sendButton: F,
2423
+ renderHeaderTitleBadges: O,
2424
+ customChannelActions: E,
2425
+ renderChannelActions: k,
2426
+ renderMessage: R,
2427
+ onMessageLinkClick: D,
2428
+ sendButton: I,
2414
2429
  attachmentPreviewList: T,
2415
- viewerLanguage: E,
2416
- showChannelInfo: A = !0,
2417
- onParticipantNameClick: O
2430
+ viewerLanguage: S,
2431
+ showChannelInfo: P = !0,
2432
+ onParticipantNameClick: F
2418
2433
  }) => {
2419
- const B = J(
2420
- async (V, Y, q) => {
2421
- var G;
2422
- const x = ((G = e.data) == null ? void 0 : G.chatbot_paused) === !0, k = _ && !x, P = {
2423
- ...Y,
2424
- ...k && { silent: !0 },
2425
- ...R && {
2434
+ const Y = K(
2435
+ async (q, G, w) => {
2436
+ var J;
2437
+ const C = ((J = e.data) == null ? void 0 : J.chatbot_paused) === !0, B = x && !C, j = {
2438
+ ...G,
2439
+ ...B && { silent: !0 },
2440
+ ...A && {
2426
2441
  metadata: {
2427
- ...Y.metadata ?? {},
2428
- ...R
2442
+ ...G.metadata ?? {},
2443
+ ...A
2429
2444
  }
2430
2445
  }
2431
2446
  }, W = {
2432
- ...q,
2433
- ...k && { skip_push: !0 }
2434
- }, K = await e.sendMessage(P, W);
2435
- return y == null || y(K), K;
2447
+ ...w,
2448
+ ...B && { skip_push: !0 }
2449
+ }, V = await e.sendMessage(j, W);
2450
+ return M == null || M(V), V;
2436
2451
  },
2437
- [e, _, R, y]
2438
- ), H = j(null);
2452
+ [e, x, A, M]
2453
+ ), Z = H(null);
2439
2454
  return X(() => {
2440
- if (!S) return;
2441
- const V = H.current;
2442
- if (!V) return;
2443
- const Y = (q) => {
2444
- const x = q.target, k = x == null ? void 0 : x.closest("a[href]"), P = k == null ? void 0 : k.getAttribute("href");
2445
- if (!P) return;
2446
- const W = k == null ? void 0 : k.closest("[data-message-id]"), K = W == null ? void 0 : W.getAttribute("data-message-id"), G = K ? e.state.messages.find((ee) => ee.id === K) : void 0;
2447
- S(P, G);
2455
+ if (!D) return;
2456
+ const q = Z.current;
2457
+ if (!q) return;
2458
+ const G = (w) => {
2459
+ const C = w.target, B = C == null ? void 0 : C.closest("a[href]"), j = B == null ? void 0 : B.getAttribute("href");
2460
+ if (!j) return;
2461
+ const W = B == null ? void 0 : B.closest("[data-message-id]"), V = W == null ? void 0 : W.getAttribute("data-message-id"), J = V ? e.state.messages.find((re) => re.id === V) : void 0;
2462
+ D(j, J);
2448
2463
  };
2449
- return V.addEventListener("click", Y), () => V.removeEventListener("click", Y);
2450
- }, [S, e]), /* @__PURE__ */ n(
2464
+ return q.addEventListener("click", G), () => q.removeEventListener("click", G);
2465
+ }, [D, e]), /* @__PURE__ */ n(
2451
2466
  "div",
2452
2467
  {
2453
- ref: H,
2454
- className: C(
2468
+ ref: Z,
2469
+ className: y(
2455
2470
  "messaging-channel-view h-full flex flex-col",
2456
2471
  d
2457
2472
  ),
2458
- children: /* @__PURE__ */ n(dn.Provider, { value: _ ?? !1, children: /* @__PURE__ */ n(
2473
+ children: /* @__PURE__ */ n(dn.Provider, { value: x ?? !1, children: /* @__PURE__ */ n(
2459
2474
  os,
2460
2475
  {
2461
2476
  channel: e,
@@ -2464,8 +2479,8 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2464
2479
  LoadingIndicator: Se,
2465
2480
  DateSeparator: Vs,
2466
2481
  TypingIndicator: qa,
2467
- doSendMessageRequest: B,
2468
- ...F ? { SendButton: F } : {},
2482
+ doSendMessageRequest: Y,
2483
+ ...I ? { SendButton: I } : {},
2469
2484
  ...T ? { AttachmentPreviewList: T } : {},
2470
2485
  children: /* @__PURE__ */ n(
2471
2486
  Za,
@@ -2483,19 +2498,20 @@ const le = "size-10 rounded-full hover:bg-[#E5E4E1] flex items-center justify-ce
2483
2498
  onBlockParticipantClick: f,
2484
2499
  onReportParticipantClick: c,
2485
2500
  showBlockParticipant: b,
2486
- showReportParticipant: w,
2487
- composerDisabled: p,
2488
- composerDisabledReason: v,
2489
- showStarButton: M,
2490
- dmAgentEnabled: _,
2491
- chatbotVotingEnabled: D,
2501
+ showReportParticipant: _,
2502
+ composerDisabled: v,
2503
+ composerDisabledReason: p,
2504
+ showStarButton: N,
2505
+ dmAgentEnabled: x,
2506
+ chatbotVotingEnabled: L,
2492
2507
  renderChannelBanner: $,
2493
- customChannelActions: L,
2494
- renderChannelActions: N,
2495
- renderMessage: I,
2496
- viewerLanguage: E,
2497
- showChannelInfo: A,
2498
- onParticipantNameClick: O
2508
+ renderHeaderTitleBadges: O,
2509
+ customChannelActions: E,
2510
+ renderChannelActions: k,
2511
+ renderMessage: R,
2512
+ viewerLanguage: S,
2513
+ showChannelInfo: P,
2514
+ onParticipantNameClick: F
2499
2515
  }
2500
2516
  )
2501
2517
  }
@@ -2535,128 +2551,130 @@ const ki = ({
2535
2551
  onMessageSent: u,
2536
2552
  chatbotVotingEnabled: f = !1,
2537
2553
  viewerLanguage: c,
2538
- renderChannelBanner: b,
2539
- customChannelActions: w,
2554
+ renderHeaderTitleBadges: b,
2555
+ renderChannelBanner: _,
2556
+ customChannelActions: v,
2540
2557
  renderChannelActions: p,
2541
- renderMessage: v,
2542
- onMessageLinkClick: _,
2543
- showChannelInfo: R
2558
+ renderMessage: x,
2559
+ onMessageLinkClick: A,
2560
+ showChannelInfo: M
2544
2561
  }) => {
2545
2562
  const {
2546
- client: y,
2547
- isConnected: M,
2548
- isLoading: D,
2549
- error: $,
2550
- refreshConnection: L,
2551
- service: N,
2552
- debug: I
2553
- } = Ps(), [S, F] = z(null), [T, E] = z(null), [A, O] = z(!1), { showDeleteConversation: B = !0 } = e, H = j(o);
2554
- H.current = o;
2555
- const V = j(a);
2556
- V.current = a;
2557
- const Y = j(null), q = j(null);
2563
+ client: N,
2564
+ isConnected: L,
2565
+ isLoading: $,
2566
+ error: O,
2567
+ refreshConnection: E,
2568
+ service: k,
2569
+ debug: R
2570
+ } = Ps(), [D, I] = z(null), [T, S] = z(null), [P, F] = z(!1), { showDeleteConversation: Y = !0 } = e, Z = H(o);
2571
+ Z.current = o;
2572
+ const q = H(a);
2573
+ q.current = a;
2574
+ const G = H(null), w = H(null);
2558
2575
  X(() => {
2559
- q.current = S;
2560
- }, [S]), X(() => {
2561
- if (!y || !M) return;
2562
- const P = y.userID;
2563
- if (!P) return;
2564
- const W = `${P}::${i}`;
2565
- if (Y.current === W) return;
2566
- Y.current = W;
2567
- const K = () => {
2568
- Y.current === W && (Y.current = null);
2576
+ w.current = D;
2577
+ }, [D]), X(() => {
2578
+ if (!N || !L) return;
2579
+ const j = N.userID;
2580
+ if (!j) return;
2581
+ const W = `${j}::${i}`;
2582
+ if (G.current === W) return;
2583
+ G.current = W;
2584
+ const V = () => {
2585
+ G.current === W && (G.current = null);
2569
2586
  };
2570
2587
  (async () => {
2571
- var ee, ue;
2588
+ var re, ue;
2572
2589
  try {
2573
- I && console.log(
2590
+ R && console.log(
2574
2591
  "[MessagingShell] Loading initial conversation with:",
2575
2592
  i
2576
2593
  );
2577
- const Z = await y.queryChannels(
2594
+ const ee = await N.queryChannels(
2578
2595
  {
2579
2596
  type: "messaging",
2580
- members: { $eq: [P, i] }
2597
+ members: { $eq: [j, i] }
2581
2598
  },
2582
2599
  {},
2583
2600
  { limit: 1 }
2584
2601
  );
2585
- if (Z.length > 0) {
2586
- F(Z[0]), E(null), (ee = V.current) == null || ee.call(V, Z[0]), I && console.log(
2602
+ if (ee.length > 0) {
2603
+ I(ee[0]), S(null), (re = q.current) == null || re.call(q, ee[0]), R && console.log(
2587
2604
  "[MessagingShell] Initial conversation loaded:",
2588
- Z[0].id
2605
+ ee[0].id
2589
2606
  );
2590
2607
  return;
2591
2608
  }
2592
- const re = H.current;
2593
- if (!re || !N) {
2594
- K(), E("No conversation found with this account"), I && console.log(
2609
+ const ie = Z.current;
2610
+ if (!ie || !k) {
2611
+ V(), S("No conversation found with this account"), R && console.log(
2595
2612
  "[MessagingShell] No conversation found for:",
2596
2613
  i
2597
2614
  );
2598
2615
  return;
2599
2616
  }
2600
2617
  try {
2601
- const te = await N.startChannelWithParticipant({
2602
- id: re.id,
2603
- name: re.name,
2604
- phone: re.phone
2618
+ const Q = await k.startChannelWithParticipant({
2619
+ id: ie.id,
2620
+ name: ie.name,
2621
+ phone: ie.phone
2605
2622
  });
2606
- F(te), E(null), (ue = V.current) == null || ue.call(V, te), I && console.log(
2623
+ I(Q), S(null), (ue = q.current) == null || ue.call(q, Q), R && console.log(
2607
2624
  "[MessagingShell] Channel created and loaded:",
2608
- te.id
2625
+ Q.id
2609
2626
  );
2610
- } catch (te) {
2627
+ } catch (Q) {
2611
2628
  console.error(
2612
2629
  "[MessagingShell] Failed to create conversation:",
2613
- te
2614
- ), K(), E("Failed to create conversation");
2630
+ Q
2631
+ ), V(), S("Failed to create conversation");
2615
2632
  }
2616
- } catch (Z) {
2633
+ } catch (ee) {
2617
2634
  console.error(
2618
2635
  "[MessagingShell] Failed to load initial conversation:",
2619
- Z
2620
- ), K(), q.current || E("Failed to load conversation");
2636
+ ee
2637
+ ), V(), w.current || S("Failed to load conversation");
2621
2638
  }
2622
2639
  })();
2623
- }, [i, y, M, N, I]);
2624
- const x = j(r);
2625
- x.current = r;
2626
- const k = J(() => {
2627
- var P;
2628
- F(null), O(!0), (P = x.current) == null || P.call(x);
2640
+ }, [i, N, L, k, R]);
2641
+ const C = H(r);
2642
+ C.current = r;
2643
+ const B = K(() => {
2644
+ var j;
2645
+ I(null), F(!0), (j = C.current) == null || j.call(C);
2629
2646
  }, []);
2630
- return D ? /* @__PURE__ */ n(Se, {}) : $ ? /* @__PURE__ */ n(be, { message: $, onBack: L }) : !M || !y ? /* @__PURE__ */ n(
2647
+ return $ ? /* @__PURE__ */ n(Se, {}) : O ? /* @__PURE__ */ n(be, { message: O, onBack: E }) : !L || !N ? /* @__PURE__ */ n(
2631
2648
  be,
2632
2649
  {
2633
2650
  message: "Not connected to messaging service",
2634
- onBack: L
2651
+ onBack: E
2635
2652
  }
2636
- ) : T ? /* @__PURE__ */ n(be, { message: T }) : A && !S ? /* @__PURE__ */ n(be, { message: "Conversation ended" }) : S ? /* @__PURE__ */ n("div", { className: "messaging-shell h-full bg-background-primary overflow-hidden", children: /* @__PURE__ */ n("div", { className: "flex h-full min-h-0 flex-col", children: /* @__PURE__ */ n(
2653
+ ) : T ? /* @__PURE__ */ n(be, { message: T }) : P && !D ? /* @__PURE__ */ n(be, { message: "Conversation ended" }) : D ? /* @__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(
2637
2654
  un,
2638
2655
  {
2639
- channel: S,
2656
+ channel: D,
2640
2657
  renderMessageInputActions: t,
2641
2658
  renderConversationFooter: s,
2642
- renderChannelBanner: b,
2643
- onLeaveConversation: k,
2644
- onBlockParticipant: k,
2659
+ renderChannelBanner: _,
2660
+ onLeaveConversation: B,
2661
+ onBlockParticipant: B,
2645
2662
  CustomChannelEmptyState: l,
2646
- showDeleteConversation: B,
2663
+ showDeleteConversation: Y,
2647
2664
  onBlockParticipantClick: d,
2648
2665
  onReportParticipantClick: m,
2649
2666
  dmAgentEnabled: g,
2650
2667
  onMessageSent: u,
2651
2668
  chatbotVotingEnabled: f,
2652
2669
  viewerLanguage: c,
2653
- customChannelActions: w,
2670
+ renderHeaderTitleBadges: b,
2671
+ customChannelActions: v,
2654
2672
  renderChannelActions: p,
2655
- renderMessage: v,
2656
- onMessageLinkClick: _,
2657
- showChannelInfo: R
2673
+ renderMessage: x,
2674
+ onMessageLinkClick: A,
2675
+ showChannelInfo: M
2658
2676
  },
2659
- S.id
2677
+ D.id
2660
2678
  ) }) }) : /* @__PURE__ */ n(Se, {});
2661
2679
  };
2662
2680
  function Qa(e) {
@@ -2695,7 +2713,7 @@ const mn = U.createContext({
2695
2713
  });
2696
2714
  }, hn = U.memo(
2697
2715
  ({ channel: e, unread: t }) => {
2698
- var D, $, L;
2716
+ var L, $, O;
2699
2717
  const {
2700
2718
  selectedChannel: s,
2701
2719
  onChannelSelect: a,
@@ -2704,40 +2722,40 @@ const mn = U.createContext({
2704
2722
  viewerLanguage: o
2705
2723
  } = tr(), l = (s == null ? void 0 : s.id) === (e == null ? void 0 : e.id), d = () => {
2706
2724
  e && a(e);
2707
- }, m = (N) => {
2708
- const I = N.key === "Enter" || N.key === " ", S = N.repeat;
2709
- !I || S || (N.preventDefault(), d());
2710
- }, u = Object.values(((D = e == null ? void 0 : e.state) == null ? void 0 : D.members) || {}).find(
2711
- (N) => {
2712
- var I, S;
2713
- return ((I = N.user) == null ? void 0 : I.id) && N.user.id !== ((S = e == null ? void 0 : e._client) == null ? void 0 : S.userID);
2725
+ }, m = (E) => {
2726
+ const k = E.key === "Enter" || E.key === " ", R = E.repeat;
2727
+ !k || R || (E.preventDefault(), d());
2728
+ }, u = Object.values(((L = e == null ? void 0 : e.state) == null ? void 0 : L.members) || {}).find(
2729
+ (E) => {
2730
+ var k, R;
2731
+ return ((k = E.user) == null ? void 0 : k.id) && E.user.id !== ((R = e == null ? void 0 : e._client) == null ? void 0 : R.userID);
2714
2732
  }
2715
2733
  ), f = Xt(u == null ? void 0 : u.user), c = ($ = u == null ? void 0 : u.user) == null ? void 0 : $.image, b = (() => {
2716
- var I;
2717
- const N = (I = e == null ? void 0 : e.state) == null ? void 0 : I.messages;
2718
- if (N != null && N.length) {
2719
- for (let S = N.length - 1; S >= 0; S--)
2720
- if (N[S].type !== "system") return N[S];
2734
+ var k;
2735
+ const E = (k = e == null ? void 0 : e.state) == null ? void 0 : k.messages;
2736
+ if (E != null && E.length) {
2737
+ for (let R = E.length - 1; R >= 0; R--)
2738
+ if (E[R].type !== "system") return E[R];
2721
2739
  }
2722
- })(), p = (() => {
2723
- var E, A, O, B;
2724
- const N = Kt({
2740
+ })(), v = (() => {
2741
+ var T, S, P, F;
2742
+ const E = Kt({
2725
2743
  message: b,
2726
2744
  viewerLanguage: o
2727
2745
  });
2728
- if (((E = b == null ? void 0 : b.metadata) == null ? void 0 : E.custom_type) === "MESSAGE_TIP") return N ? `💵 ${N}` : "💵 Sent a tip";
2729
- if (((A = b == null ? void 0 : b.metadata) == null ? void 0 : A.custom_type) === "MESSAGE_PAID") return N ? `💰 ${N}` : "💰 Sent a message";
2730
- if (((O = b == null ? void 0 : b.metadata) == null ? void 0 : O.custom_type) === "MESSAGE_ATTACHMENT") return N ? `📎 ${N}` : "📎 Sent an attachment";
2731
- if (N) return N;
2732
- const T = (B = b == null ? void 0 : b.attachments) == null ? void 0 : B[0];
2733
- return T ? T.og_scrape_url ? T.og_scrape_url : T.type === "image" ? "📷 Sent an image" : T.type === "video" ? "🎥 Sent a video" : T.type === "audio" ? "🎵 Sent audio" : T.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2734
- })(), v = b != null && b.created_at ? sr(new Date(b.created_at)) : "", _ = b ? Ee(b) : !1, R = i ? i(b, p) : `${_ ? "✨ " : ""}${p}`, y = Wt(e), M = t ?? 0;
2746
+ if (((T = b == null ? void 0 : b.metadata) == null ? void 0 : T.custom_type) === "MESSAGE_TIP") return E ? `💵 ${E}` : "💵 Sent a tip";
2747
+ if (((S = b == null ? void 0 : b.metadata) == null ? void 0 : S.custom_type) === "MESSAGE_PAID") return E ? `💰 ${E}` : "💰 Sent a message";
2748
+ if (((P = b == null ? void 0 : b.metadata) == null ? void 0 : P.custom_type) === "MESSAGE_ATTACHMENT") return E ? `📎 ${E}` : "📎 Sent an attachment";
2749
+ if (E) return E;
2750
+ const I = (F = b == null ? void 0 : b.attachments) == null ? void 0 : F[0];
2751
+ return I ? I.og_scrape_url ? I.og_scrape_url : I.type === "image" ? "📷 Sent an image" : I.type === "video" ? "🎥 Sent a video" : I.type === "audio" ? "🎵 Sent audio" : I.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
2752
+ })(), p = b != null && b.created_at ? sr(new Date(b.created_at)) : "", x = b ? Ee(b) : !1, A = i ? i(b, v) : `${x ? "✨ " : ""}${v}`, M = Wt(e), N = t ?? 0;
2735
2753
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
2736
2754
  channelId: e == null ? void 0 : e.id,
2737
2755
  isSelected: l,
2738
2756
  participantName: f,
2739
- unreadCount: M,
2740
- hasTimestamp: !!v
2757
+ unreadCount: N,
2758
+ hasTimestamp: !!p
2741
2759
  }), /* @__PURE__ */ n(
2742
2760
  "div",
2743
2761
  {
@@ -2745,7 +2763,7 @@ const mn = U.createContext({
2745
2763
  tabIndex: 0,
2746
2764
  onClick: d,
2747
2765
  onKeyDown: m,
2748
- className: C(
2766
+ className: y(
2749
2767
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring rounded-[12px] [&+&]:mt-2",
2750
2768
  {
2751
2769
  "bg-black/[0.04]": l,
@@ -2754,13 +2772,13 @@ const mn = U.createContext({
2754
2772
  ),
2755
2773
  children: /* @__PURE__ */ h("div", { className: "flex items-start gap-4", children: [
2756
2774
  /* @__PURE__ */ n(
2757
- ie,
2775
+ oe,
2758
2776
  {
2759
- id: ((L = u == null ? void 0 : u.user) == null ? void 0 : L.id) || e.id || "unknown",
2777
+ id: ((O = u == null ? void 0 : u.user) == null ? void 0 : O.id) || e.id || "unknown",
2760
2778
  name: f,
2761
2779
  image: c,
2762
2780
  size: 48,
2763
- starred: y
2781
+ starred: M
2764
2782
  }
2765
2783
  ),
2766
2784
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
@@ -2768,20 +2786,20 @@ const mn = U.createContext({
2768
2786
  /* @__PURE__ */ h(
2769
2787
  "h3",
2770
2788
  {
2771
- className: C(
2789
+ className: y(
2772
2790
  "text-sm font-medium truncate text-[#191918]"
2773
2791
  ),
2774
2792
  children: [
2775
- y && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2793
+ M && /* @__PURE__ */ n("span", { className: "sr-only", children: "Starred conversation. " }),
2776
2794
  f
2777
2795
  ]
2778
2796
  }
2779
2797
  ),
2780
- v && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: v })
2798
+ p && /* @__PURE__ */ n("span", { className: "text-xs text-[#717070] flex-shrink-0", children: p })
2781
2799
  ] }),
2782
2800
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
2783
- /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: R }),
2784
- M > 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: M > 99 ? "99+" : M })
2801
+ /* @__PURE__ */ n("p", { className: "text-sm text-[#717070] flex-1 line-clamp-1", children: A }),
2802
+ N > 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: N > 99 ? "99+" : N })
2785
2803
  ] })
2786
2804
  ] })
2787
2805
  ] })
@@ -2807,8 +2825,8 @@ const ar = { last_message_at: -1 }, rr = U.memo(
2807
2825
  g.current++;
2808
2826
  const { debug: u = !1 } = Xe(), f = U.useCallback(
2809
2827
  (b) => {
2810
- for (const w of b)
2811
- Qa(w);
2828
+ for (const _ of b)
2829
+ Qa(_);
2812
2830
  return r ? r(b) : b;
2813
2831
  },
2814
2832
  [r]
@@ -2837,7 +2855,7 @@ const ar = { last_message_at: -1 }, rr = U.memo(
2837
2855
  return /* @__PURE__ */ n(
2838
2856
  "div",
2839
2857
  {
2840
- className: C(
2858
+ className: y(
2841
2859
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
2842
2860
  o
2843
2861
  ),
@@ -2876,7 +2894,7 @@ const lr = {
2876
2894
  dark: "bg-white text-[#121110] hover:bg-white/90",
2877
2895
  light: "bg-[#121110] text-white hover:bg-[#2a2928]"
2878
2896
  }, cr = ({ variant: e, cta: t }) => {
2879
- const s = C(
2897
+ const s = y(
2880
2898
  "mt-2 inline-flex h-10 w-full items-center justify-center rounded-full px-4 text-sm font-medium leading-none transition-colors",
2881
2899
  lr[e]
2882
2900
  ), a = tt(t.href);
@@ -2923,10 +2941,10 @@ const lr = {
2923
2941
  }) => {
2924
2942
  const d = e === "dark", m = t ?? (d ? s : void 0) ?? "", g = m.trim() !== "", u = a != null && a.trim() !== "", f = typeof r == "string" ? r.trim() : "", c = f !== "", b = o != null;
2925
2943
  if (!g && !u && !c && !b) return null;
2926
- const p = C(
2944
+ const v = y(
2927
2945
  "truncate text-base font-medium leading-6",
2928
2946
  d && !t ? ur : dr[e]
2929
- ), v = C(
2947
+ ), p = y(
2930
2948
  "truncate text-xs leading-4",
2931
2949
  mr[e]
2932
2950
  );
@@ -2936,17 +2954,17 @@ const lr = {
2936
2954
  /* @__PURE__ */ h("div", { className: "flex min-w-0 flex-col gap-1", children: [
2937
2955
  g && /* @__PURE__ */ h("div", { className: "flex min-w-0 items-center gap-2", children: [
2938
2956
  i ? /* @__PURE__ */ n("span", { className: "shrink-0", children: i }) : null,
2939
- /* @__PURE__ */ n("p", { className: C("min-w-0", p), children: m })
2957
+ /* @__PURE__ */ n("p", { className: y("min-w-0", v), children: m })
2940
2958
  ] }),
2941
- u && /* @__PURE__ */ n("p", { className: v, children: a })
2959
+ u && /* @__PURE__ */ n("p", { className: p, children: a })
2942
2960
  ] }),
2943
- !b && c && /* @__PURE__ */ n("p", { className: v, children: f })
2961
+ !b && c && /* @__PURE__ */ n("p", { className: p, children: f })
2944
2962
  ] }),
2945
2963
  l && /* @__PURE__ */ n("div", { className: "shrink-0", children: l })
2946
2964
  ] }),
2947
2965
  o && /* @__PURE__ */ n(cr, { variant: e, cta: o })
2948
2966
  ] });
2949
- }, hr = C(
2967
+ }, hr = y(
2950
2968
  "relative block w-[280px] select-none overflow-hidden rounded-md",
2951
2969
  // 1px hairline border that sits flush with the card chrome — matches
2952
2970
  // the messaging design system's "small border around link attachments"
@@ -2964,7 +2982,7 @@ const lr = {
2964
2982
  bgClassName: l,
2965
2983
  "data-testid": d
2966
2984
  }) => {
2967
- const m = s != null || a != null, g = C(
2985
+ const m = s != null || a != null, g = y(
2968
2986
  hr,
2969
2987
  l ?? (e === "dark" ? "bg-[#121110]" : "bg-white"),
2970
2988
  // `focus-ring` is a design-system utility from the component-library
@@ -2995,7 +3013,7 @@ const lr = {
2995
3013
  onClick: a,
2996
3014
  "aria-label": r,
2997
3015
  "data-testid": d,
2998
- className: C(g, "text-left"),
3016
+ className: y(g, "text-left"),
2999
3017
  children: [
3000
3018
  t,
3001
3019
  u
@@ -3045,7 +3063,7 @@ const lr = {
3045
3063
  ) }) : /* @__PURE__ */ h(
3046
3064
  "div",
3047
3065
  {
3048
- className: C(
3066
+ className: y(
3049
3067
  "relative h-[180px] w-full overflow-hidden",
3050
3068
  d && "bg-black"
3051
3069
  ),
@@ -3072,7 +3090,7 @@ const lr = {
3072
3090
  ) : /* @__PURE__ */ n(
3073
3091
  "div",
3074
3092
  {
3075
- className: C(
3093
+ className: y(
3076
3094
  "flex h-full w-full items-center justify-center",
3077
3095
  fr[e]
3078
3096
  ),
@@ -3110,7 +3128,7 @@ const lr = {
3110
3128
  className: "flex size-6 items-center justify-center rounded-full bg-[#121110] text-white",
3111
3129
  children: /* @__PURE__ */ n(Me, { className: "size-3", weight: "bold" })
3112
3130
  }
3113
- ) : void 0, w = u ? /* @__PURE__ */ n(
3131
+ ) : void 0, _ = u ? /* @__PURE__ */ n(
3114
3132
  "button",
3115
3133
  {
3116
3134
  type: "button",
@@ -3158,7 +3176,7 @@ const lr = {
3158
3176
  url: a,
3159
3177
  appIcon: d,
3160
3178
  cta: m,
3161
- trailingAction: w
3179
+ trailingAction: _
3162
3180
  }
3163
3181
  )
3164
3182
  ]
@@ -3176,11 +3194,11 @@ const lr = {
3176
3194
  cta: d,
3177
3195
  onClick: m
3178
3196
  }) => {
3179
- const g = fn(a, i), u = tt(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Re(a, i) ? st : void 0, w = d && m ? {
3197
+ const g = fn(a, i), u = tt(s), f = d == null && u != null && !g ? u : void 0, c = d == null && !g ? m : void 0, b = Re(a, i) ? st : void 0, _ = d && m ? {
3180
3198
  ...d,
3181
3199
  onClick: () => {
3182
- var p;
3183
- m(), (p = d.onClick) == null || p.call(d);
3200
+ var v;
3201
+ m(), (v = d.onClick) == null || v.call(d);
3184
3202
  }
3185
3203
  } : d;
3186
3204
  return /* @__PURE__ */ h(
@@ -3211,7 +3229,7 @@ const lr = {
3211
3229
  description: t,
3212
3230
  url: s,
3213
3231
  appIcon: l,
3214
- cta: w
3232
+ cta: _
3215
3233
  }
3216
3234
  )
3217
3235
  ]
@@ -3305,7 +3323,7 @@ const lr = {
3305
3323
  {
3306
3324
  "data-testid": o,
3307
3325
  "data-group-position": a,
3308
- className: C(
3326
+ className: y(
3309
3327
  // 280px-wide bubble — matches the mobile chat attachment width
3310
3328
  // and keeps the document / image / audio bubbles visually
3311
3329
  // consistent inside the conversation timeline. The 8px / 16px
@@ -3325,7 +3343,7 @@ const lr = {
3325
3343
  l ? /* @__PURE__ */ n(
3326
3344
  "p",
3327
3345
  {
3328
- className: C(
3346
+ className: y(
3329
3347
  // No `text-*` / `font-*` overrides here — caption inherits
3330
3348
  // the same font family + size as `.str-chat__message-text`
3331
3349
  // so it matches the surrounding `CustomMessage` bubbles.
@@ -3354,7 +3372,7 @@ const lr = {
3354
3372
  a.stopPropagation(), e();
3355
3373
  },
3356
3374
  "aria-label": s,
3357
- className: C(
3375
+ className: y(
3358
3376
  "flex size-6 items-center justify-center rounded-full text-white",
3359
3377
  t === "overlay" ? "bg-[#121110]/85 backdrop-blur" : "bg-white/15 hover:bg-white/25"
3360
3378
  ),
@@ -3458,7 +3476,7 @@ function Lr(e, t, s) {
3458
3476
  const a = Rr(e, t), r = typeof s == "number" && s > 0 ? Ar(s) : void 0;
3459
3477
  return [a, r].filter(Boolean).join(" · ") || void 0;
3460
3478
  }
3461
- function Q(e) {
3479
+ function te(e) {
3462
3480
  try {
3463
3481
  const s = new URL(e).pathname.split("/").pop();
3464
3482
  return s && s.length > 0 ? decodeURIComponent(s) : "download";
@@ -3488,13 +3506,13 @@ const Dr = {
3488
3506
  const d = s ?? t ?? "File", m = Lr(a, t, r), g = /* @__PURE__ */ n(
3489
3507
  "div",
3490
3508
  {
3491
- className: C(
3509
+ className: y(
3492
3510
  "flex size-10 shrink-0 items-center justify-center rounded-sm",
3493
3511
  Or[e]
3494
3512
  ),
3495
3513
  "aria-hidden": !0,
3496
3514
  children: ce(a, {
3497
- className: C("size-6", Pr[e]),
3515
+ className: y("size-6", Pr[e]),
3498
3516
  weight: "regular"
3499
3517
  })
3500
3518
  }
@@ -3503,7 +3521,7 @@ const Dr = {
3503
3521
  m ? /* @__PURE__ */ n(
3504
3522
  "p",
3505
3523
  {
3506
- className: C(
3524
+ className: y(
3507
3525
  "truncate text-xs leading-4",
3508
3526
  Dr[e]
3509
3527
  ),
@@ -3516,7 +3534,7 @@ const Dr = {
3516
3534
  type: "button",
3517
3535
  onClick: i,
3518
3536
  "aria-label": o,
3519
- className: C(
3537
+ className: y(
3520
3538
  "flex min-w-0 flex-1 items-center gap-3 rounded-sm text-left transition-colors",
3521
3539
  e === "dark" ? "hover:bg-white/[0.04]" : "hover:bg-black/[0.04]"
3522
3540
  ),
@@ -3535,7 +3553,7 @@ const Dr = {
3535
3553
  ] });
3536
3554
  };
3537
3555
  async function bn(e, t) {
3538
- const s = t ?? Q(e);
3556
+ const s = t ?? te(e);
3539
3557
  try {
3540
3558
  const a = await fetch(e, { mode: "cors" });
3541
3559
  if (!a.ok) throw new Error(`HTTP ${a.status}`);
@@ -3562,7 +3580,7 @@ const zr = ({
3562
3580
  onActivate: a,
3563
3581
  trailingAction: r
3564
3582
  }) => {
3565
- const i = t.filename ?? Q(t.src);
3583
+ const i = t.filename ?? te(t.src);
3566
3584
  return /* @__PURE__ */ n(
3567
3585
  gn,
3568
3586
  {
@@ -3596,19 +3614,19 @@ const zr = ({
3596
3614
  mimeType: r,
3597
3615
  title: i,
3598
3616
  items: o
3599
- }), b = (p) => {
3600
- if ((m == null ? void 0 : m(p)) === !1) return;
3601
- const v = c[p];
3602
- if (!v) return;
3603
- const _ = v.filename ?? Q(v.src);
3604
- bn(v.src, _);
3617
+ }), b = (v) => {
3618
+ if ((m == null ? void 0 : m(v)) === !1) return;
3619
+ const p = c[v];
3620
+ if (!p) return;
3621
+ const x = p.filename ?? te(p.src);
3622
+ bn(p.src, x);
3605
3623
  };
3606
3624
  if (c.length === 0)
3607
3625
  return null;
3608
- const w = /* @__PURE__ */ n(
3626
+ const _ = /* @__PURE__ */ n(
3609
3627
  "span",
3610
3628
  {
3611
- className: C(
3629
+ className: y(
3612
3630
  "flex size-8 items-center justify-center rounded-full",
3613
3631
  u === "dark" ? "text-white/70" : "text-black/70"
3614
3632
  ),
@@ -3623,16 +3641,16 @@ const zr = ({
3623
3641
  text: l,
3624
3642
  groupPosition: d,
3625
3643
  "data-testid": "file-attachment",
3626
- children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((p, v) => /* @__PURE__ */ n(
3644
+ children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: c.map((v, p) => /* @__PURE__ */ n(
3627
3645
  $r,
3628
3646
  {
3629
3647
  variant: u,
3630
- item: p,
3631
- index: v,
3648
+ item: v,
3649
+ index: p,
3632
3650
  onActivate: b,
3633
- trailingAction: f && v === 0 ? /* @__PURE__ */ n(_e, { onClick: g, variant: "inline" }) : w
3651
+ trailingAction: f && p === 0 ? /* @__PURE__ */ n(_e, { onClick: g, variant: "inline" }) : _
3634
3652
  },
3635
- `${p.src}-${v}`
3653
+ `${v.src}-${p}`
3636
3654
  )) })
3637
3655
  }
3638
3656
  );
@@ -3675,7 +3693,7 @@ const zr = ({
3675
3693
  tone: i = "dark",
3676
3694
  onTriggered: o
3677
3695
  }) => {
3678
- const [l, d] = z(!1), m = J(
3696
+ const [l, d] = z(!1), m = K(
3679
3697
  (c) => {
3680
3698
  c.stopPropagation(), !l && (d(!0), bn(e, t).catch(() => {
3681
3699
  }).finally(() => {
@@ -3683,7 +3701,7 @@ const zr = ({
3683
3701
  }));
3684
3702
  },
3685
3703
  [l, e, t, o]
3686
- ), g = r ?? s !== "pill", f = { className: C(
3704
+ ), g = r ?? s !== "pill", f = { className: y(
3687
3705
  s === "pill" ? "size-4" : "size-5",
3688
3706
  "shrink-0"
3689
3707
  ), weight: "bold" };
@@ -3694,7 +3712,7 @@ const zr = ({
3694
3712
  onClick: m,
3695
3713
  disabled: l,
3696
3714
  "aria-label": a,
3697
- className: C(
3715
+ className: y(
3698
3716
  "flex size-8 shrink-0 items-center justify-center rounded-full transition-colors disabled:opacity-70",
3699
3717
  {
3700
3718
  dark: "text-white/70 hover:bg-white/[0.08] hover:text-white",
@@ -3734,7 +3752,7 @@ const zr = ({
3734
3752
  onClick: m,
3735
3753
  disabled: l,
3736
3754
  "aria-label": g ? a : void 0,
3737
- className: C(
3755
+ className: y(
3738
3756
  "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full px-4 text-sm font-medium leading-none transition-colors disabled:opacity-70",
3739
3757
  i === "dark" ? "bg-[#121110] text-white hover:bg-[#2a2928]" : "bg-white text-[#121110] hover:bg-white/90"
3740
3758
  ),
@@ -3762,9 +3780,9 @@ const zr = ({
3762
3780
  }, [s, t, e]), X(() => {
3763
3781
  i((d) => Fe(d, 0, Math.max(e - 1, 0)));
3764
3782
  }, [e]);
3765
- const o = J(() => {
3783
+ const o = K(() => {
3766
3784
  e <= 1 || i((d) => d <= 0 ? e - 1 : d - 1);
3767
- }, [e]), l = J(() => {
3785
+ }, [e]), l = K(() => {
3768
3786
  e <= 1 || i((d) => d >= e - 1 ? 0 : d + 1);
3769
3787
  }, [e]);
3770
3788
  return X(() => {
@@ -3785,7 +3803,7 @@ const zr = ({
3785
3803
  children: i,
3786
3804
  "data-testid": o
3787
3805
  }) => {
3788
- const l = j(null), d = j(null);
3806
+ const l = H(null), d = H(null);
3789
3807
  return X(() => {
3790
3808
  var f;
3791
3809
  const u = l.current;
@@ -3877,7 +3895,7 @@ const zr = ({
3877
3895
  initialIndex: s,
3878
3896
  open: e
3879
3897
  }), l = t[r], d = ne(
3880
- () => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "image"),
3898
+ () => (l == null ? void 0 : l.filename) ?? (l ? te(l.src) : "image"),
3881
3899
  [l]
3882
3900
  );
3883
3901
  return l ? /* @__PURE__ */ h(
@@ -3931,14 +3949,14 @@ const zr = ({
3931
3949
  const r = e.length;
3932
3950
  if (r === 0) return null;
3933
3951
  const i = e.slice(0, Math.min(r, s)), o = r - i.length, l = (d, m, g) => {
3934
- const u = C(Vr, "h-full w-full");
3952
+ const u = y(Vr, "h-full w-full");
3935
3953
  return t ? /* @__PURE__ */ h(
3936
3954
  "button",
3937
3955
  {
3938
3956
  type: "button",
3939
3957
  onClick: () => t(m),
3940
3958
  "aria-label": d.ariaLabel ?? `Open media ${m + 1}`,
3941
- className: C(u, "cursor-zoom-in"),
3959
+ className: y(u, "cursor-zoom-in"),
3942
3960
  children: [
3943
3961
  d.content,
3944
3962
  g
@@ -3950,10 +3968,10 @@ const zr = ({
3950
3968
  g
3951
3969
  ] }, m);
3952
3970
  };
3953
- return i.length === 1 ? /* @__PURE__ */ n("div", { className: C("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
3971
+ return i.length === 1 ? /* @__PURE__ */ n("div", { className: y("aspect-square w-full", a), children: l(i[0], 0) }) : i.length === 2 ? /* @__PURE__ */ n(
3954
3972
  "div",
3955
3973
  {
3956
- className: C(
3974
+ className: y(
3957
3975
  "grid aspect-[16/9] w-full grid-cols-2 gap-0.5",
3958
3976
  a
3959
3977
  ),
@@ -3962,7 +3980,7 @@ const zr = ({
3962
3980
  ) : i.length === 3 ? /* @__PURE__ */ h(
3963
3981
  "div",
3964
3982
  {
3965
- className: C(
3983
+ className: y(
3966
3984
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
3967
3985
  a
3968
3986
  ),
@@ -3975,7 +3993,7 @@ const zr = ({
3975
3993
  ) : /* @__PURE__ */ n(
3976
3994
  "div",
3977
3995
  {
3978
- className: C(
3996
+ className: y(
3979
3997
  "grid aspect-[4/3] w-full grid-cols-2 grid-rows-2 gap-0.5",
3980
3998
  a
3981
3999
  ),
@@ -3993,12 +4011,12 @@ const zr = ({
3993
4011
  }
3994
4012
  );
3995
4013
  }, ye = (e) => {
3996
- const [t, s] = z(!1), [a, r] = z(0), i = J(
4014
+ const [t, s] = z(!1), [a, r] = z(0), i = K(
3997
4015
  (l) => {
3998
4016
  (e == null ? void 0 : e(l)) !== !1 && (r(l), s(!0));
3999
4017
  },
4000
4018
  [e]
4001
- ), o = J(() => s(!1), []);
4019
+ ), o = K(() => s(!1), []);
4002
4020
  return { viewerOpen: t, viewerIndex: a, handleActivate: i, closeViewer: o };
4003
4021
  }, Gr = (e, t, s, a) => ({
4004
4022
  ariaLabel: `Open image ${t + 1} of ${s}`,
@@ -4075,8 +4093,8 @@ const zr = ({
4075
4093
  );
4076
4094
  if (m.length === 0)
4077
4095
  return null;
4078
- const w = m.map(
4079
- (p, v) => Gr(p, v, m.length, l)
4096
+ const _ = m.map(
4097
+ (v, p) => Gr(v, p, m.length, l)
4080
4098
  );
4081
4099
  return /* @__PURE__ */ h(
4082
4100
  we,
@@ -4086,7 +4104,7 @@ const zr = ({
4086
4104
  groupPosition: o,
4087
4105
  "data-testid": "image-attachment",
4088
4106
  children: [
4089
- /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(xn, { tiles: w, onTileActivate: c }) }),
4107
+ /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(xn, { tiles: _, onTileActivate: c }) }),
4090
4108
  /* @__PURE__ */ n(
4091
4109
  vn,
4092
4110
  {
@@ -4114,7 +4132,7 @@ const zr = ({
4114
4132
  initialIndex: s,
4115
4133
  open: e
4116
4134
  }), l = t[r], d = ne(
4117
- () => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "document"),
4135
+ () => (l == null ? void 0 : l.filename) ?? (l ? te(l.src) : "document"),
4118
4136
  [l]
4119
4137
  ), m = ne(
4120
4138
  () => l ? Zr(l.src) : void 0,
@@ -4167,7 +4185,7 @@ const zr = ({
4167
4185
  onActivate: a,
4168
4186
  trailingAction: r
4169
4187
  }) => {
4170
- const i = t.filename ?? Q(t.src);
4188
+ const i = t.filename ?? te(t.src);
4171
4189
  return /* @__PURE__ */ n(
4172
4190
  gn,
4173
4191
  {
@@ -4193,14 +4211,14 @@ const zr = ({
4193
4211
  onClick: d,
4194
4212
  onDismiss: m
4195
4213
  }) => {
4196
- const g = Ne(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: w } = ye(
4214
+ const g = Ne(e), u = Qr({ src: t, filename: s, fileSize: a, title: r, items: i }), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = ye(
4197
4215
  d
4198
- ), p = e === "composer" && !!m;
4216
+ ), v = e === "composer" && !!m;
4199
4217
  if (u.length === 0)
4200
4218
  return null;
4201
- const v = u.map((_) => ({
4202
- src: _.src,
4203
- filename: _.filename ?? Q(_.src)
4219
+ const p = u.map((x) => ({
4220
+ src: x.src,
4221
+ filename: x.filename ?? te(x.src)
4204
4222
  }));
4205
4223
  return /* @__PURE__ */ h(
4206
4224
  we,
@@ -4210,14 +4228,14 @@ const zr = ({
4210
4228
  groupPosition: l,
4211
4229
  "data-testid": "pdf-attachment",
4212
4230
  children: [
4213
- /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((_, R) => {
4214
- const y = _.filename ?? Q(_.src), M = p && R === 0 ? /* @__PURE__ */ n(_e, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4231
+ /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: u.map((x, A) => {
4232
+ const M = x.filename ?? te(x.src), N = v && A === 0 ? /* @__PURE__ */ n(_e, { onClick: m, variant: "inline" }) : e === "composer" ? void 0 : /* @__PURE__ */ n(
4215
4233
  pn,
4216
4234
  {
4217
- url: _.src,
4218
- filename: y,
4235
+ url: x.src,
4236
+ filename: M,
4219
4237
  variant: "inline",
4220
- label: `Download ${y}`,
4238
+ label: `Download ${M}`,
4221
4239
  tone: g
4222
4240
  }
4223
4241
  );
@@ -4225,21 +4243,21 @@ const zr = ({
4225
4243
  ei,
4226
4244
  {
4227
4245
  variant: g,
4228
- item: _,
4229
- index: R,
4246
+ item: x,
4247
+ index: A,
4230
4248
  onActivate: b,
4231
- trailingAction: M
4249
+ trailingAction: N
4232
4250
  },
4233
- `${_.src}-${R}`
4251
+ `${x.src}-${A}`
4234
4252
  );
4235
4253
  }) }),
4236
4254
  /* @__PURE__ */ n(
4237
4255
  Jr,
4238
4256
  {
4239
4257
  open: f,
4240
- items: v,
4258
+ items: p,
4241
4259
  initialIndex: c,
4242
- onClose: w
4260
+ onClose: _
4243
4261
  }
4244
4262
  )
4245
4263
  ]
@@ -4260,7 +4278,7 @@ const zr = ({
4260
4278
  initialIndex: s,
4261
4279
  open: e
4262
4280
  }), l = t[r], d = ne(
4263
- () => (l == null ? void 0 : l.filename) ?? (l ? Q(l.src) : "video"),
4281
+ () => (l == null ? void 0 : l.filename) ?? (l ? te(l.src) : "video"),
4264
4282
  [l]
4265
4283
  );
4266
4284
  return l ? /* @__PURE__ */ h(
@@ -4378,13 +4396,13 @@ const zr = ({
4378
4396
  preload: d,
4379
4397
  onClick: m
4380
4398
  }) => {
4381
- const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: w } = ye(
4399
+ const g = oi({ src: t, poster: s, mimeType: a, preload: d, items: i }), u = Ne(e), { viewerOpen: f, viewerIndex: c, handleActivate: b, closeViewer: _ } = ye(
4382
4400
  m
4383
4401
  );
4384
4402
  if (g.length === 0)
4385
4403
  return null;
4386
- const p = g.map(
4387
- (v, _) => ii(v, _, g.length)
4404
+ const v = g.map(
4405
+ (p, x) => ii(p, x, g.length)
4388
4406
  );
4389
4407
  return /* @__PURE__ */ h(
4390
4408
  we,
@@ -4397,7 +4415,7 @@ const zr = ({
4397
4415
  /* @__PURE__ */ n("div", { className: "relative", children: /* @__PURE__ */ n(
4398
4416
  xn,
4399
4417
  {
4400
- tiles: p,
4418
+ tiles: v,
4401
4419
  onTileActivate: b,
4402
4420
  className: "overflow-hidden rounded-md"
4403
4421
  }
@@ -4408,7 +4426,7 @@ const zr = ({
4408
4426
  open: f,
4409
4427
  items: Cn(g, r),
4410
4428
  initialIndex: c,
4411
- onClose: w
4429
+ onClose: _
4412
4430
  }
4413
4431
  )
4414
4432
  ]
@@ -4436,7 +4454,7 @@ const zr = ({
4436
4454
  onClick: t,
4437
4455
  disabled: s,
4438
4456
  style: { backgroundColor: "#E6E5E3" },
4439
- className: C(
4457
+ className: y(
4440
4458
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
4441
4459
  {
4442
4460
  "hover:brightness-95 active:brightness-90": !s,
@@ -4458,7 +4476,7 @@ const zr = ({
4458
4476
  const l = e.filter((d) => d.enabled).sort((d, m) => (d.order ?? 0) - (m.order ?? 0));
4459
4477
  return l.length === 0 ? null : /* @__PURE__ */ n("div", { className: r, children: /* @__PURE__ */ h("div", { className: "flex gap-3 items-end", children: [
4460
4478
  (i || o) && /* @__PURE__ */ n("div", { className: "flex-none", children: /* @__PURE__ */ n(
4461
- ie,
4479
+ oe,
4462
4480
  {
4463
4481
  id: o || "account",
4464
4482
  name: o || "Account",
@@ -4497,7 +4515,7 @@ export {
4497
4515
  Ei as L,
4498
4516
  yi as M,
4499
4517
  ge as a,
4500
- ie as b,
4518
+ oe as b,
4501
4519
  rr as c,
4502
4520
  un as d,
4503
4521
  Ci as e,
@@ -4523,4 +4541,4 @@ export {
4523
4541
  Xt as y,
4524
4542
  va as z
4525
4543
  };
4526
- //# sourceMappingURL=index-DKq7HA0h.js.map
4544
+ //# sourceMappingURL=index-BOsrtjME.js.map