@linktr.ee/messaging-react 1.31.0-rc-1776677746 → 1.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{Creator-DGe3CQ_j.js → Card-C5t3dZ5q.js} +177 -150
  2. package/dist/Card-C5t3dZ5q.js.map +1 -0
  3. package/dist/Card-Cn2va-Qr.js +205 -0
  4. package/dist/Card-Cn2va-Qr.js.map +1 -0
  5. package/dist/index.d.ts +35 -30
  6. package/dist/index.js +951 -956
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/ChannelView.tsx +24 -36
  10. package/src/components/CustomMessage/CustomMessage.stories.tsx +1 -14
  11. package/src/components/CustomMessage/context.tsx +20 -0
  12. package/src/components/CustomMessage/index.tsx +39 -28
  13. package/src/components/LockedAttachment/LockedAttachment.stories.tsx +8 -13
  14. package/src/components/LockedAttachment/components/Creator/Card.tsx +159 -0
  15. package/src/components/LockedAttachment/components/Creator/CardAudioPreview.tsx +161 -0
  16. package/src/components/LockedAttachment/components/Creator/CardCollapsedThumbnail.tsx +58 -0
  17. package/src/components/LockedAttachment/components/Creator/CardImagePreview.tsx +56 -0
  18. package/src/components/LockedAttachment/components/Creator/CardVideoPreview.tsx +91 -0
  19. package/src/components/LockedAttachment/components/Creator/index.tsx +2 -0
  20. package/src/components/LockedAttachment/components/Visitor/Card.tsx +186 -0
  21. package/src/components/LockedAttachment/components/Visitor/CardActions.tsx +71 -0
  22. package/src/components/LockedAttachment/components/Visitor/CardImagePreview.tsx +39 -0
  23. package/src/components/LockedAttachment/components/Visitor/CardMediaPreview.tsx +36 -0
  24. package/src/components/LockedAttachment/components/Visitor/CardThumbnailPreview.tsx +45 -0
  25. package/src/components/LockedAttachment/components/Visitor/index.ts +2 -0
  26. package/src/components/LockedAttachment/index.tsx +16 -23
  27. package/src/components/LockedAttachment/types.ts +14 -1
  28. package/src/components/MessagingShell/index.tsx +0 -6
  29. package/src/index.ts +4 -1
  30. package/src/types.ts +0 -21
  31. package/dist/Creator-DGe3CQ_j.js.map +0 -1
  32. package/dist/Visitor-DyJTWB2_.js +0 -204
  33. package/dist/Visitor-DyJTWB2_.js.map +0 -1
  34. package/src/components/LockedAttachment/components/Creator.tsx +0 -470
  35. package/src/components/LockedAttachment/components/Visitor.tsx +0 -356
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as i, Fragment as ge } from "react/jsx-runtime";
2
2
  import A from "classnames";
3
- import F, { createContext as gt, useContext as xt, useCallback as U, useState as T, useRef as ee, useEffect as X, useMemo as Ue, Suspense as ze } from "react";
4
- import { StreamChatService as bt } from "@linktr.ee/messaging-core";
5
- import { Chat as Ct, ChannelList as Nt, DateSeparator as yt, useChannelStateContext as ke, useChatContext as Qe, areMessageUIPropsEqual as pt, useMessageReminder as vt, useComponentContext as wt, Attachment as _t, EditMessageModal as Et, MessageBlocked as St, MessageBouncePrompt as It, MessageDeleted as kt, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as Tt, ReminderNotification as Dt, StreamedMessageText as Rt, messageHasAttachments as At, messageHasReactions as Lt, isDateSeparatorMessage as Ut, isMessageBlocked as Pt, isMessageBounced as Ft, MessageBounceModal as Ot, MessageText as He, Poll as Bt, MessageErrorIcon as Gt, useMessageContext as et, useMessageComposer as jt, useStateStore as $t, MessageInput as zt, useMessageInputContext as Ht, useMessageComposerHasSendableData as Vt, SimpleAttachmentSelector as Yt, QuotedMessagePreview as Wt, AttachmentPreviewList as qt, TextareaComposer as Zt, MessageTimestamp as Re, Channel as Jt, WithComponents as Xt, Window as Kt, MessageList as Qt } from "stream-chat-react";
6
- import { StarIcon as Pe, GiftIcon as es, XIcon as Be, SpinnerGapIcon as Ee, SignOutIcon as ts, ProhibitInsetIcon as Ve, FlagIcon as ss, ArrowUpIcon as ns, SparkleIcon as as, ProhibitIcon as rs, ArrowLeftIcon as Ye, DotsThreeIcon as We, MagnifyingGlassIcon as os, ChatCircleDotsIcon as qe } from "@phosphor-icons/react";
7
- import { LinkPreviewsManager as Ze } from "stream-chat";
8
- const tt = gt({
3
+ import U, { createContext as Ke, useContext as Qe, useCallback as R, useState as T, useRef as Q, useEffect as Z, useMemo as Ue, Suspense as et } from "react";
4
+ import { StreamChatService as xt } from "@linktr.ee/messaging-core";
5
+ import { Chat as bt, ChannelList as Ct, DateSeparator as pt, useChannelStateContext as Me, useChatContext as tt, areMessageUIPropsEqual as Nt, useMessageReminder as yt, useComponentContext as vt, Attachment as wt, EditMessageModal as _t, MessageBlocked as Et, MessageBouncePrompt as St, MessageDeleted as It, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as kt, ReminderNotification as Tt, StreamedMessageText as Dt, messageHasAttachments as Rt, messageHasReactions as At, isDateSeparatorMessage as Lt, isMessageBlocked as Pt, isMessageBounced as Ut, MessageBounceModal as Ft, MessageText as ze, Poll as Ot, MessageErrorIcon as Bt, useMessageContext as st, useMessageComposer as Gt, useStateStore as $t, MessageInput as jt, useMessageInputContext as zt, useMessageComposerHasSendableData as Vt, SimpleAttachmentSelector as Ht, QuotedMessagePreview as Yt, AttachmentPreviewList as Wt, TextareaComposer as qt, MessageTimestamp as Ae, Channel as Zt, WithComponents as Jt, Window as Xt, MessageList as Kt } from "stream-chat-react";
6
+ import { StarIcon as Fe, GiftIcon as Qt, XIcon as Ge, SpinnerGapIcon as Ee, SignOutIcon as es, ProhibitInsetIcon as Ve, FlagIcon as ts, ArrowUpIcon as ss, SparkleIcon as ns, ProhibitIcon as as, ArrowLeftIcon as He, DotsThreeIcon as Ye, MagnifyingGlassIcon as rs, ChatCircleDotsIcon as We } from "@phosphor-icons/react";
7
+ import { LinkPreviewsManager as qe } from "stream-chat";
8
+ const nt = Ke({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,199 +15,199 @@ const tt = gt({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), Me = () => xt(tt), dn = ({
18
+ }), ke = () => Qe(nt), hn = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: o,
23
23
  capabilities: l = {},
24
- debug: d = !1
24
+ debug: m = !1
25
25
  }) => {
26
- const a = U(
27
- (m, ...y) => {
28
- d && console.log(`🔥 [MessagingProvider] ${m}`, ...y);
26
+ const r = R(
27
+ (d, ...C) => {
28
+ m && console.log(`🔥 [MessagingProvider] ${d}`, ...C);
29
29
  },
30
- [d]
30
+ [m]
31
31
  );
32
- a("🔄 RENDER START", {
32
+ r("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
34
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [c, f] = T(null), [u, x] = T(null), [C, E] = T(!1), [h, p] = T(!1), [v, r] = T(null), M = ee(!1), S = ee({
38
+ const [c, h] = T(null), [u, b] = T(null), [g, v] = T(!1), [a, w] = T(!1), [N, x] = T(null), M = Q(!1), k = Q({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: o,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), N = ee(0);
44
- N.current++, a("📊 RENDER INFO", {
45
- renderCount: N.current,
43
+ }), S = Q(0);
44
+ S.current++, r("📊 RENDER INFO", {
45
+ renderCount: S.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: S.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: S.current.apiKey !== o,
50
- serviceConfigChanged: S.current.serviceConfig !== n,
51
- capabilitiesChanged: S.current.capabilities !== l
48
+ userChanged: k.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: k.current.apiKey !== o,
50
+ serviceConfigChanged: k.current.serviceConfig !== n,
51
+ capabilitiesChanged: k.current.capabilities !== l
52
52
  }
53
- }), S.current = {
53
+ }), k.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: o,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
- }, X(() => {
59
- const m = N.current;
60
- if (a("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
- renderCount: m,
58
+ }, Z(() => {
59
+ const d = S.current;
60
+ if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
+ renderCount: d,
62
62
  apiKey: !!o,
63
63
  serviceConfig: !!n,
64
64
  dependencies: {
65
65
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: S.current.serviceConfig === n,
68
- apiKeyStable: S.current.apiKey === o
67
+ serviceConfigStable: k.current.serviceConfig === n,
68
+ apiKeyStable: k.current.apiKey === o
69
69
  }
70
70
  }), !o || !n) {
71
- a("⚠️ SERVICE INIT SKIPPED", {
72
- renderCount: m,
71
+ r("⚠️ SERVICE INIT SKIPPED", {
72
+ renderCount: d,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
- a("🚀 CREATING NEW SERVICE", {
78
- renderCount: m,
77
+ r("🚀 CREATING NEW SERVICE", {
78
+ renderCount: d,
79
79
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
- serviceConfigChanged: S.current.serviceConfig !== n
80
+ serviceConfigChanged: k.current.serviceConfig !== n
81
81
  });
82
- const y = new bt({
82
+ const C = new xt({
83
83
  ...n,
84
84
  apiKey: o,
85
- debug: d
85
+ debug: m
86
86
  });
87
- return f(y), a("✅ SERVICE SET", {
88
- renderCount: m,
89
- serviceInstance: !!y
87
+ return h(C), r("✅ SERVICE SET", {
88
+ renderCount: d,
89
+ serviceInstance: !!C
90
90
  }), () => {
91
- a("🧹 SERVICE CLEANUP", {
92
- renderCount: m,
91
+ r("🧹 SERVICE CLEANUP", {
92
+ renderCount: d,
93
93
  reason: "Effect cleanup"
94
- }), y.disconnectUser().catch(console.error);
94
+ }), C.disconnectUser().catch(console.error);
95
95
  };
96
- }, [o, n, d, a]);
97
- const w = ee(null);
98
- X(() => {
99
- var y, b;
100
- if (a("🔗 USER CONNECTION EFFECT TRIGGERED", {
96
+ }, [o, n, m, r]);
97
+ const I = Q(null);
98
+ Z(() => {
99
+ var C, _;
100
+ if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
104
  isConnecting: M.current,
105
- isConnected: C,
105
+ isConnected: g,
106
106
  dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
107
  }), !c || !s) {
108
- a("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
108
+ r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
111
  if (M.current) {
112
- a("⚠️ USER CONNECTION SKIPPED", "Already connecting");
112
+ r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((y = w.current) == null ? void 0 : y.serviceId) === c && ((b = w.current) == null ? void 0 : b.userId) === s.id) {
116
- a(
115
+ if (((C = I.current) == null ? void 0 : C.serviceId) === c && ((_ = I.current) == null ? void 0 : _.userId) === s.id) {
116
+ r(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
119
119
  );
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- a("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, p(!0), r(null);
123
+ r("🚀 STARTING USER CONNECTION", { userId: s.id }), M.current = !0, w(!0), x(null);
124
124
  try {
125
- a("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const _ = await c.connectUser(s);
127
- x(_), E(!0), w.current = { serviceId: c, userId: s.id }, a("✅ USER CONNECTION SUCCESS", {
125
+ r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
+ const y = await c.connectUser(s);
127
+ b(y), v(!0), I.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
- clientId: _.userID
129
+ clientId: y.userID
130
130
  });
131
- } catch (_) {
132
- const k = _ instanceof Error ? _.message : "Connection failed";
133
- r(k), a("❌ USER CONNECTION ERROR", {
131
+ } catch (y) {
132
+ const p = y instanceof Error ? y.message : "Connection failed";
133
+ x(p), r("❌ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: k
135
+ error: p
136
136
  });
137
137
  } finally {
138
- p(!1), M.current = !1, a("🔄 USER CONNECTION FINISHED", {
138
+ w(!1), M.current = !1, r("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: C
140
+ isConnected: g
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, a, C]), X(() => (a("🔌 CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, r, g]), Z(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
- isConnected: C
146
+ isConnected: g
147
147
  }), () => {
148
- c && C ? (a(
148
+ c && g ? (r(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), w.current = null, c.disconnectUser().catch(console.error)) : a("🔇 CLEANUP EFFECT SKIPPED", {
151
+ ), I.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!c,
153
- isConnected: C
153
+ isConnected: g
154
154
  });
155
- }), [c, C, a]);
156
- const R = U(async () => {
157
- if (a("🔄 REFRESH CONNECTION CALLED", {
155
+ }), [c, g, r]);
156
+ const D = R(async () => {
157
+ if (r("🔄 REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
159
159
  hasUser: !!s
160
160
  }), !c || !s) {
161
- a("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
161
+ r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- a("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), p(!0);
164
+ r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), w(!0);
165
165
  try {
166
- a("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("📞 RECONNECTING FOR REFRESH");
167
- const m = await c.connectUser(s);
168
- x(m), E(!0), r(null), a("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
- } catch (m) {
170
- const y = m instanceof Error ? m.message : "Refresh failed";
171
- r(y), a("❌ CONNECTION REFRESH ERROR", {
166
+ r("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
167
+ const d = await c.connectUser(s);
168
+ b(d), v(!0), x(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
+ } catch (d) {
170
+ const C = d instanceof Error ? d.message : "Refresh failed";
171
+ x(C), r("❌ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
- error: y
173
+ error: C
174
174
  });
175
175
  } finally {
176
- p(!1), a("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ w(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, a]), g = F.useMemo(() => (a("💫 CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, r]), f = U.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
180
  hasClient: !!u,
181
- isConnected: C,
182
- isLoading: h,
183
- hasError: !!v,
181
+ isConnected: g,
182
+ isLoading: a,
183
+ hasError: !!N,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: c,
187
187
  client: u,
188
- isConnected: C,
189
- isLoading: h,
190
- error: v,
188
+ isConnected: g,
189
+ isLoading: a,
190
+ error: N,
191
191
  capabilities: l,
192
- refreshConnection: R,
193
- debug: d
192
+ refreshConnection: D,
193
+ debug: m
194
194
  }), [
195
195
  c,
196
196
  u,
197
- C,
198
- h,
199
- v,
197
+ g,
198
+ a,
199
+ N,
200
200
  l,
201
- R,
202
- d,
203
- a
201
+ D,
202
+ m,
203
+ r
204
204
  ]);
205
- return a("🔄 RENDER END", {
206
- renderCount: N.current,
207
- willRenderChat: !!(u && C),
208
- contextValueReady: !!g
209
- }), /* @__PURE__ */ e(tt.Provider, { value: g, children: u && C ? /* @__PURE__ */ e(
210
- Ct,
205
+ return r("🔄 RENDER END", {
206
+ renderCount: S.current,
207
+ willRenderChat: !!(u && g),
208
+ contextValueReady: !!f
209
+ }), /* @__PURE__ */ e(nt.Provider, { value: f, children: u && g ? /* @__PURE__ */ e(
210
+ bt,
211
211
  {
212
212
  client: u,
213
213
  customClasses: {
@@ -216,53 +216,53 @@ const tt = gt({
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, ls = () => Me();
220
- function is(t) {
219
+ }, os = () => ke();
220
+ function ls(t) {
221
221
  const s = t.state.pending_messages;
222
222
  if (s != null && s.length)
223
223
  for (const n of s)
224
224
  t.state.addMessageSorted(n.message);
225
225
  }
226
- const st = F.createContext({
226
+ const at = U.createContext({
227
227
  selectedChannel: void 0,
228
228
  onChannelSelect: () => {
229
229
  },
230
230
  debug: !1,
231
231
  renderMessagePreview: void 0
232
- }), cs = st.Provider, ds = () => F.useContext(st), nt = (t) => {
232
+ }), is = at.Provider, cs = () => U.useContext(at), rt = (t) => {
233
233
  var o, l;
234
234
  const [s, n] = T(
235
235
  !!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
236
236
  );
237
- return X(() => {
238
- var a;
237
+ return Z(() => {
238
+ var r;
239
239
  if (!t) {
240
240
  n(!1);
241
241
  return;
242
242
  }
243
- n(!!((a = t.state.membership) != null && a.pinned_at));
244
- const d = (c) => {
245
- var f;
243
+ n(!!((r = t.state.membership) != null && r.pinned_at));
244
+ const m = (c) => {
245
+ var h;
246
246
  n(
247
- c != null && c.member ? !!c.member.pinned_at : !!((f = t.state.membership) != null && f.pinned_at)
247
+ c != null && c.member ? !!c.member.pinned_at : !!((h = t.state.membership) != null && h.pinned_at)
248
248
  );
249
249
  };
250
- return t.on("member.updated", d), () => {
251
- t.off("member.updated", d);
250
+ return t.on("member.updated", m), () => {
251
+ t.off("member.updated", m);
252
252
  };
253
253
  }, [t]), s;
254
- }, ms = (t, s) => {
254
+ }, ds = (t, s) => {
255
255
  const n = new Date(
256
256
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
257
257
  ), l = new Date(
258
258
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
259
259
  ).getTime() - n.getTime();
260
260
  return Math.floor(l / (1e3 * 60 * 60 * 24));
261
- }, us = (t) => {
261
+ }, ms = (t) => {
262
262
  const s = /* @__PURE__ */ new Date();
263
263
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
264
264
  return "Just now";
265
- const o = ms(t, s);
265
+ const o = ds(t, s);
266
266
  return o === 0 ? t.toLocaleTimeString([], {
267
267
  hour: "numeric",
268
268
  minute: "2-digit",
@@ -272,7 +272,7 @@ const st = F.createContext({
272
272
  day: "numeric",
273
273
  year: "2-digit"
274
274
  });
275
- }, Je = [
275
+ }, Ze = [
276
276
  "🍎",
277
277
  // Apple
278
278
  "🍌",
@@ -300,7 +300,7 @@ const st = F.createContext({
300
300
  "🍈"
301
301
  // Melon
302
302
  ];
303
- function hs(t) {
303
+ function us(t) {
304
304
  let s = 0;
305
305
  for (let n = 0; n < t.length; n++) {
306
306
  const o = t.charCodeAt(n);
@@ -308,9 +308,9 @@ function hs(t) {
308
308
  }
309
309
  return Math.abs(s);
310
310
  }
311
- function fs(t) {
312
- const n = hs(t) % Je.length;
313
- return Je[n];
311
+ function hs(t) {
312
+ const n = us(t) % Ze.length;
313
+ return Ze[n];
314
314
  }
315
315
  const ce = ({
316
316
  id: t,
@@ -318,9 +318,9 @@ const ce = ({
318
318
  size: n = 40,
319
319
  className: o,
320
320
  starred: l = !1,
321
- shape: d = "squircle"
321
+ shape: m = "squircle"
322
322
  }) => {
323
- const a = fs(t), f = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", u = d === "circle" ? { borderRadius: "50%" } : {
323
+ const r = hs(t), h = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", u = m === "circle" ? { borderRadius: "50%" } : {
324
324
  borderRadius: "33%",
325
325
  "corner-shape": "superellipse(1.3)"
326
326
  };
@@ -338,7 +338,7 @@ const ce = ({
338
338
  {
339
339
  "aria-hidden": "true",
340
340
  className: "absolute -left-1.5 -top-1.5 z-10 flex size-5 items-center justify-center rounded-full bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
341
- children: /* @__PURE__ */ e(Pe, { className: "size-3 text-yellow-600", weight: "duotone" })
341
+ children: /* @__PURE__ */ e(Fe, { className: "size-3 text-yellow-600", weight: "duotone" })
342
342
  }
343
343
  ),
344
344
  /* @__PURE__ */ e("div", { className: "h-full w-full overflow-hidden", style: u, children: s ? /* @__PURE__ */ e(
@@ -354,15 +354,15 @@ const ce = ({
354
354
  "aria-hidden": "true",
355
355
  className: A(
356
356
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
357
- f
357
+ h
358
358
  ),
359
- children: a
359
+ children: r
360
360
  }
361
361
  ) })
362
362
  ]
363
363
  }
364
364
  );
365
- }, gs = ({ size: t = 15 }) => /* @__PURE__ */ e(
365
+ }, fs = ({ size: t = 15 }) => /* @__PURE__ */ e(
366
366
  "svg",
367
367
  {
368
368
  width: t,
@@ -379,108 +379,108 @@ const ce = ({
379
379
  }
380
380
  )
381
381
  }
382
- ), xs = (t) => {
382
+ ), gs = (t) => {
383
383
  var s;
384
384
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
385
- }, bs = (t) => {
385
+ }, xs = (t) => {
386
386
  var s;
387
387
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
388
- }, Ge = (t) => {
388
+ }, $e = (t) => {
389
389
  var s;
390
390
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
391
- }, Cs = (t) => {
391
+ }, bs = (t) => {
392
392
  var s;
393
393
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_ATTACHMENT";
394
- }, at = (t) => xs(t) || bs(t), Ns = (t) => {
394
+ }, ot = (t) => gs(t) || xs(t), Cs = (t) => {
395
395
  var s;
396
- return at(t) && !((s = t.text) != null && s.trim());
397
- }, Ae = ({
396
+ return ot(t) && !((s = t.text) != null && s.trim());
397
+ }, Le = ({
398
398
  message: t,
399
399
  standalone: s = !1,
400
400
  isMyMessage: n = !1,
401
401
  hasAttachment: o = !1
402
402
  }) => {
403
- var C;
404
- const l = at(t), d = Ge(t);
405
- if (!l && !d)
403
+ var g;
404
+ const l = ot(t), m = $e(t);
405
+ if (!l && !m)
406
406
  return null;
407
407
  if (l) {
408
- const E = (C = t.metadata) == null ? void 0 : C.amount_text;
409
- if (!E) return null;
410
- const h = s ? "message-tip-standalone" : "message-tag message-tag--tip", p = s ? `${E} tip` : `Delivered with ${E} tip`;
411
- return /* @__PURE__ */ i("div", { className: h, children: [
412
- /* @__PURE__ */ e(es, { size: s ? 14 : 12 }),
413
- /* @__PURE__ */ e("span", { children: p })
408
+ const v = (g = t.metadata) == null ? void 0 : g.amount_text;
409
+ if (!v) return null;
410
+ const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", w = s ? `${v} tip` : `Delivered with ${v} tip`;
411
+ return /* @__PURE__ */ i("div", { className: a, children: [
412
+ /* @__PURE__ */ e(Qt, { size: s ? 14 : 12 }),
413
+ /* @__PURE__ */ e("span", { children: w })
414
414
  ] });
415
415
  }
416
- const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", f = [
416
+ const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent", h = [
417
417
  "message-chatbot-indicator",
418
418
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
419
- a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
420
- ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), x = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(gs, { size: a ? 12 : 15 }) });
421
- return /* @__PURE__ */ e("div", { className: f, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(he, { children: [
419
+ r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
420
+ ].join(" "), u = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(fs, { size: r ? 12 : 15 }) });
421
+ return /* @__PURE__ */ e("div", { className: h, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ i(ge, { children: [
422
422
  u,
423
- x
424
- ] }) : /* @__PURE__ */ i(he, { children: [
425
- x,
423
+ b
424
+ ] }) : /* @__PURE__ */ i(ge, { children: [
425
+ b,
426
426
  u
427
427
  ] }) });
428
- }, rt = F.memo(
428
+ }, lt = U.memo(
429
429
  ({ channel: t, unread: s }) => {
430
- var R, g, m, y;
431
- const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: d } = ds(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
430
+ var D, f, d, C;
431
+ const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } = cs(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
432
432
  t && o(t);
433
- }, f = (b) => {
434
- const _ = b.key === "Enter" || b.key === " ", k = b.repeat;
435
- !_ || k || (b.preventDefault(), c());
436
- }, x = Object.values(((R = t == null ? void 0 : t.state) == null ? void 0 : R.members) || {}).find(
437
- (b) => {
438
- var _, k;
439
- return ((_ = b.user) == null ? void 0 : _.id) && b.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
433
+ }, h = (_) => {
434
+ const y = _.key === "Enter" || _.key === " ", p = _.repeat;
435
+ !y || p || (_.preventDefault(), c());
436
+ }, b = Object.values(((D = t == null ? void 0 : t.state) == null ? void 0 : D.members) || {}).find(
437
+ (_) => {
438
+ var y, p;
439
+ return ((y = _.user) == null ? void 0 : y.id) && _.user.id !== ((p = t == null ? void 0 : t._client) == null ? void 0 : p.userID);
440
440
  }
441
- ), C = ((g = x == null ? void 0 : x.user) == null ? void 0 : g.name) || "Conversation", E = (m = x == null ? void 0 : x.user) == null ? void 0 : m.image, h = (() => {
442
- var _;
443
- const b = (_ = t == null ? void 0 : t.state) == null ? void 0 : _.messages;
444
- if (b != null && b.length) {
445
- for (let k = b.length - 1; k >= 0; k--)
446
- if (b[k].type !== "system") return b[k];
441
+ ), g = ((f = b == null ? void 0 : b.user) == null ? void 0 : f.name) || "Conversation", v = (d = b == null ? void 0 : b.user) == null ? void 0 : d.image, a = (() => {
442
+ var y;
443
+ const _ = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
444
+ if (_ != null && _.length) {
445
+ for (let p = _.length - 1; p >= 0; p--)
446
+ if (_[p].type !== "system") return _[p];
447
447
  }
448
- })(), v = (() => {
449
- var k, Y;
450
- if (h != null && h.text) return h.text;
451
- if (((k = h == null ? void 0 : h.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
452
- const _ = (Y = h == null ? void 0 : h.attachments) == null ? void 0 : Y[0];
453
- return _ ? _.og_scrape_url ? _.og_scrape_url : _.type === "image" ? "📷 Sent an image" : _.type === "video" ? "🎥 Sent a video" : _.type === "audio" ? "🎵 Sent audio" : _.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
454
- })(), r = h != null && h.created_at ? us(new Date(h.created_at)) : "", M = h ? Ge(h) : !1, S = d ? d(h, v) : `${M ? "✨ " : ""}${v}`, N = nt(t), w = s ?? 0;
448
+ })(), N = (() => {
449
+ var p, F;
450
+ if (a != null && a.text) return a.text;
451
+ if (((p = a == null ? void 0 : a.metadata) == null ? void 0 : p.custom_type) === "MESSAGE_TIP") return "💵 Sent a tip";
452
+ const y = (F = a == null ? void 0 : a.attachments) == null ? void 0 : F[0];
453
+ return y ? y.og_scrape_url ? y.og_scrape_url : y.type === "image" ? "📷 Sent an image" : y.type === "video" ? "🎥 Sent a video" : y.type === "audio" ? "🎵 Sent audio" : y.type === "file" ? "📎 Sent a file" : "📎 Sent an attachment" : "No messages yet";
454
+ })(), x = a != null && a.created_at ? ms(new Date(a.created_at)) : "", M = a ? $e(a) : !1, k = m ? m(a, N) : `${M ? "✨ " : ""}${N}`, S = rt(t), I = s ?? 0;
455
455
  return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
456
456
  channelId: t == null ? void 0 : t.id,
457
- isSelected: a,
458
- participantName: C,
459
- unreadCount: w,
460
- hasTimestamp: !!r
457
+ isSelected: r,
458
+ participantName: g,
459
+ unreadCount: I,
460
+ hasTimestamp: !!x
461
461
  }), /* @__PURE__ */ e(
462
462
  "div",
463
463
  {
464
464
  role: "button",
465
465
  tabIndex: 0,
466
466
  onClick: c,
467
- onKeyDown: f,
467
+ onKeyDown: h,
468
468
  className: A(
469
469
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
470
470
  {
471
- "bg-primary-alt/10 border-l-4 border-l-primary": a,
472
- "hover:bg-sand": !a
471
+ "bg-primary-alt/10 border-l-4 border-l-primary": r,
472
+ "hover:bg-sand": !r
473
473
  }
474
474
  ),
475
475
  children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
476
476
  /* @__PURE__ */ e(
477
477
  ce,
478
478
  {
479
- id: ((y = x == null ? void 0 : x.user) == null ? void 0 : y.id) || t.id || "unknown",
480
- name: C,
481
- image: E,
479
+ id: ((C = b == null ? void 0 : b.user) == null ? void 0 : C.id) || t.id || "unknown",
480
+ name: g,
481
+ image: v,
482
482
  size: 44,
483
- starred: N,
483
+ starred: S,
484
484
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
485
485
  }
486
486
  ),
@@ -491,19 +491,19 @@ const ce = ({
491
491
  {
492
492
  className: A(
493
493
  "text-sm font-medium truncate",
494
- a ? "text-primary" : "text-charcoal"
494
+ r ? "text-primary" : "text-charcoal"
495
495
  ),
496
496
  children: [
497
- N && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
498
- C
497
+ S && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
498
+ g
499
499
  ]
500
500
  }
501
501
  ),
502
- r && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: r })
502
+ x && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: x })
503
503
  ] }),
504
504
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
505
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: S }),
506
- w > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: w > 99 ? "99+" : w })
505
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: k }),
506
+ I > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: I > 99 ? "99+" : I })
507
507
  ] })
508
508
  ] })
509
509
  ] })
@@ -511,63 +511,63 @@ const ce = ({
511
511
  );
512
512
  }
513
513
  );
514
- rt.displayName = "CustomChannelPreview";
515
- const ys = { last_message_at: -1 }, ot = F.memo(
514
+ lt.displayName = "CustomChannelPreview";
515
+ const ps = { last_message_at: -1 }, it = U.memo(
516
516
  ({
517
517
  onChannelSelect: t,
518
518
  selectedChannel: s,
519
519
  filters: n,
520
520
  allowNewMessagesFromUnfilteredChannels: o = !1,
521
521
  onMessageNew: l,
522
- onAddedToChannel: d,
523
- channelRenderFilterFn: a,
524
- sort: c = ys,
525
- className: f,
522
+ onAddedToChannel: m,
523
+ channelRenderFilterFn: r,
524
+ sort: c = ps,
525
+ className: h,
526
526
  customEmptyStateIndicator: u,
527
- renderMessagePreview: x
527
+ renderMessagePreview: b
528
528
  }) => {
529
- const C = F.useRef(0);
530
- C.current++;
531
- const { debug: E = !1 } = Me(), h = F.useCallback(
532
- (v) => {
533
- for (const r of v)
534
- is(r);
535
- return a ? a(v) : v;
529
+ const g = U.useRef(0);
530
+ g.current++;
531
+ const { debug: v = !1 } = ke(), a = U.useCallback(
532
+ (N) => {
533
+ for (const x of N)
534
+ ls(x);
535
+ return r ? r(N) : N;
536
536
  },
537
- [a]
537
+ [r]
538
538
  );
539
- E && console.log("📺 [ChannelList] 🔄 RENDER START", {
540
- renderCount: C.current,
539
+ v && console.log("📺 [ChannelList] 🔄 RENDER START", {
540
+ renderCount: g.current,
541
541
  selectedChannelId: s == null ? void 0 : s.id,
542
542
  filters: n
543
543
  });
544
- const p = F.useMemo(
544
+ const w = U.useMemo(
545
545
  () => ({
546
546
  selectedChannel: s,
547
547
  onChannelSelect: t,
548
- debug: E,
549
- renderMessagePreview: x
548
+ debug: v,
549
+ renderMessagePreview: b
550
550
  }),
551
- [s, t, E, x]
551
+ [s, t, v, b]
552
552
  );
553
553
  return /* @__PURE__ */ e(
554
554
  "div",
555
555
  {
556
556
  className: A(
557
557
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
558
- f
558
+ h
559
559
  ),
560
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(cs, { value: p, children: /* @__PURE__ */ e(
561
- Nt,
560
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(is, { value: w, children: /* @__PURE__ */ e(
561
+ Ct,
562
562
  {
563
563
  filters: n,
564
564
  sort: c,
565
565
  options: { limit: 30 },
566
566
  allowNewMessagesFromUnfilteredChannels: o,
567
567
  onMessageNew: l,
568
- onAddedToChannel: d,
569
- channelRenderFilterFn: h,
570
- Preview: rt,
568
+ onAddedToChannel: m,
569
+ channelRenderFilterFn: a,
570
+ Preview: lt,
571
571
  EmptyStateIndicator: u
572
572
  },
573
573
  `${JSON.stringify(n)}:${JSON.stringify(c)}`
@@ -576,7 +576,7 @@ const ys = { last_message_at: -1 }, ot = F.memo(
576
576
  );
577
577
  }
578
578
  );
579
- ot.displayName = "ChannelList";
579
+ it.displayName = "ChannelList";
580
580
  const _e = ({
581
581
  variant: t = "default",
582
582
  className: s,
@@ -595,7 +595,7 @@ const _e = ({
595
595
  children: n
596
596
  }
597
597
  );
598
- function lt({ label: t, className: s, children: n, ...o }) {
598
+ function ct({ label: t, className: s, children: n, ...o }) {
599
599
  return /* @__PURE__ */ i(
600
600
  "button",
601
601
  {
@@ -616,92 +616,92 @@ function lt({ label: t, className: s, children: n, ...o }) {
616
616
  }
617
617
  );
618
618
  }
619
- function it({ onClick: t }) {
620
- return /* @__PURE__ */ e(lt, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Be, { className: "h-5 w-5 text-stone", weight: "bold" }) });
619
+ function dt({ onClick: t }) {
620
+ return /* @__PURE__ */ e(ct, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(Ge, { className: "h-5 w-5 text-stone", weight: "bold" }) });
621
621
  }
622
- const ps = ({
622
+ const Ns = ({
623
623
  dialogRef: t,
624
624
  onClose: s,
625
625
  participant: n,
626
626
  channel: o,
627
627
  followerStatusLabel: l,
628
- onLeaveConversation: d,
629
- onBlockParticipant: a,
628
+ onLeaveConversation: m,
629
+ onBlockParticipant: r,
630
630
  showDeleteConversation: c = !0,
631
- onDeleteConversationClick: f,
631
+ onDeleteConversationClick: h,
632
632
  onBlockParticipantClick: u,
633
- onReportParticipantClick: x,
634
- customProfileContent: C,
635
- customChannelActions: E
633
+ onReportParticipantClick: b,
634
+ customProfileContent: g,
635
+ customChannelActions: v
636
636
  }) => {
637
- var te, Z, J, P, W, z, de;
638
- const { service: h, debug: p } = Me(), [v, r] = T(!1), [M, S] = T(!1), [N, w] = T(!1), R = U(async () => {
639
- var O;
640
- if (!(!h || !((O = n == null ? void 0 : n.user) != null && O.id)))
637
+ var L, W, z, de, me, te, ue;
638
+ const { service: a, debug: w } = ke(), [N, x] = T(!1), [M, k] = T(!1), [S, I] = T(!1), D = R(async () => {
639
+ var G;
640
+ if (!(!a || !((G = n == null ? void 0 : n.user) != null && G.id)))
641
641
  try {
642
- const H = (await h.getBlockedUsers()).some(
643
- (K) => {
642
+ const B = (await a.getBlockedUsers()).some(
643
+ (q) => {
644
644
  var se;
645
- return K.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
645
+ return q.blocked_user_id === ((se = n == null ? void 0 : n.user) == null ? void 0 : se.id);
646
646
  }
647
647
  );
648
- r(H);
649
- } catch (L) {
648
+ x(B);
649
+ } catch (O) {
650
650
  console.error(
651
651
  "[ChannelInfoDialog] Failed to check blocked status:",
652
- L
652
+ O
653
653
  );
654
654
  }
655
- }, [h, (te = n == null ? void 0 : n.user) == null ? void 0 : te.id]);
656
- X(() => {
657
- R();
658
- }, [R]);
659
- const g = async () => {
660
- var O;
655
+ }, [a, (L = n == null ? void 0 : n.user) == null ? void 0 : L.id]);
656
+ Z(() => {
657
+ D();
658
+ }, [D]);
659
+ const f = async () => {
660
+ var G;
661
661
  if (!M) {
662
- f == null || f(), p && console.log("[ChannelInfoDialog] Leave conversation", o.cid), S(!0);
662
+ h == null || h(), w && console.log("[ChannelInfoDialog] Leave conversation", o.cid), k(!0);
663
663
  try {
664
- const L = ((O = o._client) == null ? void 0 : O.userID) ?? null;
665
- await o.hide(L, !1), d && await d(o), s();
666
- } catch (L) {
667
- console.error("[ChannelInfoDialog] Failed to leave conversation", L);
664
+ const O = ((G = o._client) == null ? void 0 : G.userID) ?? null;
665
+ await o.hide(O, !1), m && await m(o), s();
666
+ } catch (O) {
667
+ console.error("[ChannelInfoDialog] Failed to leave conversation", O);
668
668
  } finally {
669
- S(!1);
669
+ k(!1);
670
670
  }
671
671
  }
672
- }, m = async () => {
673
- var O, L, H;
674
- if (!(N || !h)) {
675
- u == null || u(), p && console.log("[ChannelInfoDialog] Block member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
672
+ }, d = async () => {
673
+ var G, O, B;
674
+ if (!(S || !a)) {
675
+ u == null || u(), w && console.log("[ChannelInfoDialog] Block member", (G = n == null ? void 0 : n.user) == null ? void 0 : G.id), I(!0);
676
676
  try {
677
- await h.blockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
678
- } catch (K) {
679
- console.error("[ChannelInfoDialog] Failed to block member", K);
677
+ await a.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
678
+ } catch (q) {
679
+ console.error("[ChannelInfoDialog] Failed to block member", q);
680
680
  } finally {
681
- w(!1);
681
+ I(!1);
682
682
  }
683
683
  }
684
- }, y = async () => {
685
- var O, L, H;
686
- if (!(N || !h)) {
687
- u == null || u(), p && console.log("[ChannelInfoDialog] Unblock member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
684
+ }, C = async () => {
685
+ var G, O, B;
686
+ if (!(S || !a)) {
687
+ u == null || u(), w && console.log("[ChannelInfoDialog] Unblock member", (G = n == null ? void 0 : n.user) == null ? void 0 : G.id), I(!0);
688
688
  try {
689
- await h.unBlockUser((L = n == null ? void 0 : n.user) == null ? void 0 : L.id), a && await a((H = n == null ? void 0 : n.user) == null ? void 0 : H.id), s();
690
- } catch (K) {
691
- console.error("[ChannelInfoDialog] Failed to unblock member", K);
689
+ await a.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
690
+ } catch (q) {
691
+ console.error("[ChannelInfoDialog] Failed to unblock member", q);
692
692
  } finally {
693
- w(!1);
693
+ I(!1);
694
694
  }
695
695
  }
696
- }, b = () => {
697
- x == null || x(), s(), window.open(
696
+ }, _ = () => {
697
+ b == null || b(), s(), window.open(
698
698
  "https://linktr.ee/s/about/trust-center/report",
699
699
  "_blank",
700
700
  "noopener,noreferrer"
701
701
  );
702
702
  };
703
703
  if (!n) return null;
704
- const _ = ((Z = n.user) == null ? void 0 : Z.name) || ((J = n.user) == null ? void 0 : J.id) || "Unknown member", k = (P = n.user) == null ? void 0 : P.image, Y = (W = n.user) == null ? void 0 : W.email, G = (z = n.user) == null ? void 0 : z.username, D = Y || (G ? `linktr.ee/${G}` : void 0), j = ((de = n.user) == null ? void 0 : de.id) || "unknown";
704
+ const y = ((W = n.user) == null ? void 0 : W.name) || ((z = n.user) == null ? void 0 : z.id) || "Unknown member", p = (de = n.user) == null ? void 0 : de.image, F = (me = n.user) == null ? void 0 : me.email, ee = (te = n.user) == null ? void 0 : te.username, Y = F || (ee ? `linktr.ee/${ee}` : void 0), J = ((ue = n.user) == null ? void 0 : ue.id) || "unknown";
705
705
  return (
706
706
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
707
707
  /* @__PURE__ */ e(
@@ -710,13 +710,13 @@ const ps = ({
710
710
  ref: t,
711
711
  className: "mes-dialog group",
712
712
  onClose: s,
713
- onClick: (O) => {
714
- O.target === t.current && s();
713
+ onClick: (G) => {
714
+ G.target === t.current && s();
715
715
  },
716
716
  children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
717
717
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
718
718
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
719
- /* @__PURE__ */ e(it, { onClick: s })
719
+ /* @__PURE__ */ e(dt, { onClick: s })
720
720
  ] }),
721
721
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
722
722
  /* @__PURE__ */ e(
@@ -728,17 +728,17 @@ const ps = ({
728
728
  /* @__PURE__ */ e(
729
729
  ce,
730
730
  {
731
- id: j,
732
- name: _,
733
- image: k,
731
+ id: J,
732
+ name: y,
733
+ image: p,
734
734
  size: 88,
735
735
  shape: "circle"
736
736
  }
737
737
  ),
738
738
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
739
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
740
- D && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: D }),
741
- l && !C && /* @__PURE__ */ e(
739
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: y }),
740
+ Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
741
+ l && !g && /* @__PURE__ */ e(
742
742
  "span",
743
743
  {
744
744
  className: "mt-1 rounded-full text-xs font-normal w-fit",
@@ -752,7 +752,7 @@ const ps = ({
752
752
  children: l
753
753
  }
754
754
  ),
755
- C
755
+ g
756
756
  ] })
757
757
  ] })
758
758
  }
@@ -761,87 +761,95 @@ const ps = ({
761
761
  c && /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(
762
762
  _e,
763
763
  {
764
- onClick: g,
764
+ onClick: f,
765
765
  disabled: M,
766
766
  "aria-busy": M,
767
767
  children: [
768
- M ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
768
+ M ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(es, { className: "h-5 w-5" }),
769
769
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
770
770
  ]
771
771
  }
772
772
  ) }),
773
- /* @__PURE__ */ e("li", { children: v ? /* @__PURE__ */ i(
773
+ /* @__PURE__ */ e("li", { children: N ? /* @__PURE__ */ i(
774
774
  _e,
775
775
  {
776
- onClick: y,
777
- disabled: N,
778
- "aria-busy": N,
776
+ onClick: C,
777
+ disabled: S,
778
+ "aria-busy": S,
779
779
  children: [
780
- N ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
780
+ S ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
781
781
  /* @__PURE__ */ e("span", { children: "Unblock" })
782
782
  ]
783
783
  }
784
784
  ) : /* @__PURE__ */ i(
785
785
  _e,
786
786
  {
787
- onClick: m,
788
- disabled: N,
789
- "aria-busy": N,
787
+ onClick: d,
788
+ disabled: S,
789
+ "aria-busy": S,
790
790
  children: [
791
- N ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
791
+ S ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
792
792
  /* @__PURE__ */ e("span", { children: "Block" })
793
793
  ]
794
794
  }
795
795
  ) }),
796
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(_e, { variant: "danger", onClick: b, children: [
797
- /* @__PURE__ */ e(ss, { className: "h-5 w-5" }),
796
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(_e, { variant: "danger", onClick: _, children: [
797
+ /* @__PURE__ */ e(ts, { className: "h-5 w-5" }),
798
798
  /* @__PURE__ */ e("span", { children: "Report" })
799
799
  ] }) }),
800
- E
800
+ v
801
801
  ] })
802
802
  ] })
803
803
  ] })
804
804
  }
805
805
  )
806
806
  );
807
- }, vs = (t) => /* @__PURE__ */ e(yt, { ...t, position: "center" }), Fe = "vote_up", Oe = "vote_down";
808
- function ws(t) {
809
- return t != null && t.length ? t.some((s) => s.type === Oe) ? "down" : t.some((s) => s.type === Fe) ? "up" : null : null;
807
+ }, ys = (t) => /* @__PURE__ */ e(pt, { ...t, position: "center" }), Oe = "vote_up", Be = "vote_down";
808
+ function vs(t) {
809
+ return t != null && t.length ? t.some((s) => s.type === Be) ? "down" : t.some((s) => s.type === Oe) ? "up" : null : null;
810
810
  }
811
- function _s(t) {
812
- const { channel: s } = ke(), { client: n } = Qe("useMessageVote"), o = Ue(
813
- () => ws(t.own_reactions),
811
+ function ws(t) {
812
+ const { channel: s } = Me(), { client: n } = tt("useMessageVote"), o = Ue(
813
+ () => vs(t.own_reactions),
814
814
  [t.own_reactions]
815
- ), l = U(async () => {
815
+ ), l = R(async () => {
816
816
  if (n != null && n.userID)
817
817
  try {
818
- o === "up" ? await s.deleteReaction(t.id, Fe) : await s.sendReaction(
818
+ o === "up" ? await s.deleteReaction(t.id, Oe) : await s.sendReaction(
819
819
  t.id,
820
- { type: Fe },
820
+ { type: Oe },
821
821
  { enforce_unique: !0, skip_push: !0 }
822
822
  );
823
823
  } catch {
824
824
  }
825
- }, [s, n == null ? void 0 : n.userID, t.id, o]), d = U(async () => {
825
+ }, [s, n == null ? void 0 : n.userID, t.id, o]), m = R(async () => {
826
826
  if (n != null && n.userID)
827
827
  try {
828
- o === "down" ? await s.deleteReaction(t.id, Oe) : await s.sendReaction(
828
+ o === "down" ? await s.deleteReaction(t.id, Be) : await s.sendReaction(
829
829
  t.id,
830
- { type: Oe },
830
+ { type: Be },
831
831
  { enforce_unique: !0, skip_push: !0 }
832
832
  );
833
833
  } catch {
834
834
  }
835
835
  }, [s, n == null ? void 0 : n.userID, t.id, o]);
836
- return { selected: o, voteUp: l, voteDown: d };
836
+ return { selected: o, voteUp: l, voteDown: m };
837
837
  }
838
- const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => import("./Visitor-DyJTWB2_.js")), Xe = () => /* @__PURE__ */ e(
838
+ const _s = U.lazy(() => import("./Card-C5t3dZ5q.js")), Es = U.lazy(() => import("./Card-Cn2va-Qr.js")), mt = () => /* @__PURE__ */ e(
839
839
  "div",
840
840
  {
841
841
  className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
842
842
  "aria-hidden": !0
843
843
  }
844
- ), Is = (t) => t.onUnlockClick != null || t.onDownloadClick != null || t.onUnlocked != null ? /* @__PURE__ */ e(ze, { fallback: /* @__PURE__ */ e(Xe, {}), children: /* @__PURE__ */ e(Ss, { ...t }) }) : /* @__PURE__ */ e(ze, { fallback: /* @__PURE__ */ e(Xe, {}), children: /* @__PURE__ */ e(Es, { ...t }) }), ks = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
844
+ ), Ss = (t) => /* @__PURE__ */ e(et, { fallback: /* @__PURE__ */ e(mt, {}), children: /* @__PURE__ */ e(_s, { ...t }) }), Is = (t) => /* @__PURE__ */ e(et, { fallback: /* @__PURE__ */ e(mt, {}), children: /* @__PURE__ */ e(Es, { ...t }) }), Je = { Creator: Ss, Visitor: Is }, Ms = {
845
+ isUnlocking: () => !1
846
+ }, ks = {
847
+ LockedAttachment: Ms
848
+ }, ut = Ke({}), fn = ut.Provider;
849
+ function Ts(t) {
850
+ return Qe(ut)[t] ?? ks[t];
851
+ }
852
+ const Ds = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
845
853
  "path",
846
854
  {
847
855
  d: "M4.667 7.333l2.666-6A1.333 1.333 0 018.667 2v2.667a.667.667 0 00.666.666h3.764a1.334 1.334 0 011.192 1.93l-2.333 4.666a1.333 1.333 0 01-1.193.738H4.667m0-5.334v5.334m0-5.334H2.667a1.333 1.333 0 00-1.334 1.334v2.666a1.333 1.333 0 001.334 1.334h2",
@@ -851,7 +859,7 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
851
859
  strokeLinejoin: "round",
852
860
  fill: t ? "currentColor" : "none"
853
861
  }
854
- ) }), Ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
862
+ ) }), Rs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
855
863
  "path",
856
864
  {
857
865
  d: "M11.333 8.667l-2.666 6A1.333 1.333 0 017.333 14v-2.667a.667.667 0 00-.666-.666H2.903a1.334 1.334 0 01-1.192-1.93l2.333-4.666a1.333 1.333 0 011.193-.738h6.096m0 5.334V3.333m0 5.334h2a1.333 1.333 0 001.334-1.334V4.667a1.333 1.333 0 00-1.334-1.334h-2",
@@ -861,7 +869,7 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
861
869
  strokeLinejoin: "round",
862
870
  fill: t ? "currentColor" : "none"
863
871
  }
864
- ) }), Ts = ({
872
+ ) }), As = ({
865
873
  selected: t,
866
874
  onVoteUp: s,
867
875
  onVoteDown: n
@@ -874,7 +882,7 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
874
882
  onClick: s,
875
883
  "aria-label": "Helpful",
876
884
  "aria-pressed": t === "up",
877
- children: /* @__PURE__ */ e(ks, { filled: t === "up" })
885
+ children: /* @__PURE__ */ e(Ds, { filled: t === "up" })
878
886
  }
879
887
  ),
880
888
  /* @__PURE__ */ e(
@@ -885,205 +893,213 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
885
893
  onClick: n,
886
894
  "aria-label": "Not helpful",
887
895
  "aria-pressed": t === "down",
888
- children: /* @__PURE__ */ e(Ms, { filled: t === "down" })
896
+ children: /* @__PURE__ */ e(Rs, { filled: t === "down" })
889
897
  }
890
898
  )
891
- ] }), Ds = (t) => {
892
- var ge, be, Ce, ie, Q, Ne, ye, pe;
899
+ ] }), Ls = (t) => {
900
+ var K, Ce, pe, Ne, le, ye, ve, we, ie, E, j, P, $, he;
893
901
  const {
894
902
  additionalMessageInputProps: s,
895
903
  chatbotVotingEnabled: n,
896
- onAttachmentUnlockClick: o,
897
- onAttachmentDownloadClick: l,
898
- onAttachmentUnlocked: d,
899
- editing: a,
900
- endOfGroup: c,
901
- firstOfGroup: f,
902
- groupedByUser: u,
903
- handleAction: x,
904
- handleOpenThread: C,
905
- handleRetry: E,
906
- highlighted: h,
907
- isMessageAIGenerated: p,
904
+ editing: o,
905
+ endOfGroup: l,
906
+ firstOfGroup: m,
907
+ groupedByUser: r,
908
+ handleAction: c,
909
+ handleOpenThread: h,
910
+ handleRetry: u,
911
+ highlighted: b,
912
+ isMessageAIGenerated: g,
908
913
  isMyMessage: v,
909
- message: r,
910
- renderText: M,
911
- threadList: S
912
- } = t, { client: N } = Qe("CustomMessage"), { channel: w } = ke("CustomMessage"), [R, g] = T(!1), m = vt(r.id), { selected: y, voteUp: b, voteDown: _ } = _s(r), {
913
- Attachment: k = _t,
914
- EditMessageModal: Y = Et,
915
- MessageBlocked: G = St,
916
- MessageBouncePrompt: D = It,
917
- MessageDeleted: j = kt,
918
- MessageIsThreadReplyInChannelButtonIndicator: te = Mt,
919
- MessageRepliesCountButton: Z = Tt,
920
- ReminderNotification: J = Dt,
921
- StreamedMessageText: P = Rt,
922
- PinIndicator: W
923
- } = wt("CustomMessage"), z = At(r), de = Lt(r), O = Ue(
924
- () => p == null ? void 0 : p(r),
925
- [p, r]
926
- ), L = Ue(
927
- () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
928
- [r]
914
+ message: a,
915
+ renderText: w,
916
+ threadList: N
917
+ } = t, { client: x } = tt("CustomMessage"), { channel: M } = Me("CustomMessage"), { isUnlocking: k, onUnlockClick: S, onFetchSource: I, onDownloadClick: D } = Ts("LockedAttachment"), [f, d] = T(!1), C = yt(a.id), { selected: _, voteUp: y, voteDown: p } = ws(a), {
918
+ Attachment: F = wt,
919
+ EditMessageModal: ee = _t,
920
+ MessageBlocked: Y = Et,
921
+ MessageBouncePrompt: J = St,
922
+ MessageDeleted: L = It,
923
+ MessageIsThreadReplyInChannelButtonIndicator: W = Mt,
924
+ MessageRepliesCountButton: z = kt,
925
+ ReminderNotification: de = Tt,
926
+ StreamedMessageText: me = Dt,
927
+ PinIndicator: te
928
+ } = vt("CustomMessage"), ue = Rt(a), G = At(a), O = Ue(
929
+ () => g == null ? void 0 : g(a),
930
+ [g, a]
931
+ ), B = Ue(
932
+ () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
933
+ [a]
929
934
  );
930
- if (Ut(r))
935
+ if (Lt(a))
931
936
  return null;
932
- if (r.deleted_at || r.type === "deleted")
933
- return /* @__PURE__ */ e(j, { message: r });
934
- if (Pt(r))
935
- return /* @__PURE__ */ e(G, {});
936
- const H = !S && !!r.reply_count, K = !S && r.show_in_channel && r.parent_id, se = r.status === "failed" && ((ge = r.error) == null ? void 0 : ge.status) !== 403, xe = Ft(r);
937
- let ne;
938
- se ? ne = () => E(r) : xe && (ne = () => g(!0));
939
- const re = v(), je = A(
937
+ if (a.deleted_at || a.type === "deleted")
938
+ return /* @__PURE__ */ e(L, { message: a });
939
+ if (Pt(a))
940
+ return /* @__PURE__ */ e(Y, {});
941
+ const q = !N && !!a.reply_count, se = !N && a.show_in_channel && a.parent_id, Te = a.status === "failed" && ((K = a.error) == null ? void 0 : K.status) !== 403, V = Ut(a);
942
+ let H;
943
+ Te ? H = () => u(a) : V && (H = () => d(!0));
944
+ const X = v(), ne = A(
940
945
  "str-chat__message str-chat__message-simple",
941
- `str-chat__message--${r.type}`,
942
- `str-chat__message--${r.status}`,
943
- re ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
944
- r.text ? "str-chat__message--has-text" : "has-no-text",
946
+ `str-chat__message--${a.type}`,
947
+ `str-chat__message--${a.status}`,
948
+ X ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
949
+ a.text ? "str-chat__message--has-text" : "has-no-text",
945
950
  {
946
- "str-chat__message--has-attachment": z,
947
- "str-chat__message--highlighted": h,
948
- "str-chat__message--pinned pinned-message": r.pinned,
949
- "str-chat__message--with-reactions": de,
950
- "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((be = r == null ? void 0 : r.error) == null ? void 0 : be.status) !== 403,
951
- "str-chat__message-with-thread-link": H || K,
952
- "str-chat__virtual-message__wrapper--end": c,
953
- "str-chat__virtual-message__wrapper--first": f,
954
- "str-chat__virtual-message__wrapper--group": u
951
+ "str-chat__message--has-attachment": ue,
952
+ "str-chat__message--highlighted": b,
953
+ "str-chat__message--pinned pinned-message": a.pinned,
954
+ "str-chat__message--with-reactions": G,
955
+ "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((Ce = a == null ? void 0 : a.error) == null ? void 0 : Ce.status) !== 403,
956
+ "str-chat__message-with-thread-link": q || se,
957
+ "str-chat__virtual-message__wrapper--end": l,
958
+ "str-chat__virtual-message__wrapper--first": m,
959
+ "str-chat__virtual-message__wrapper--group": r
955
960
  }
956
- ), q = r.poll_id && N.polls.fromState(r.poll_id), me = Ns(r), oe = Ge(r), le = Cs(r), ae = !!(L != null && L.length && !r.quoted_message), fe = oe && re && ae;
957
- return /* @__PURE__ */ i(he, { children: [
958
- a && /* @__PURE__ */ e(
959
- Y,
961
+ ), ae = a.poll_id && x.polls.fromState(a.poll_id), be = Cs(a), re = $e(a), De = bs(a), xe = !!(B != null && B.length && !a.quoted_message), oe = re && X && xe;
962
+ return /* @__PURE__ */ i(ge, { children: [
963
+ o && /* @__PURE__ */ e(
964
+ ee,
960
965
  {
961
966
  additionalMessageInputProps: s
962
967
  }
963
968
  ),
964
- R && /* @__PURE__ */ e(
965
- Ot,
969
+ f && /* @__PURE__ */ e(
970
+ Ft,
966
971
  {
967
- MessageBouncePrompt: D,
968
- onClose: () => g(!1),
969
- open: R
972
+ MessageBouncePrompt: J,
973
+ onClose: () => d(!1),
974
+ open: f
970
975
  }
971
976
  ),
972
- /* @__PURE__ */ i("div", { className: je, children: [
973
- W && /* @__PURE__ */ e(W, {}),
974
- !!m && /* @__PURE__ */ e(J, { reminder: m }),
975
- r.user && /* @__PURE__ */ e(
977
+ /* @__PURE__ */ i("div", { className: ne, children: [
978
+ te && /* @__PURE__ */ e(te, {}),
979
+ !!C && /* @__PURE__ */ e(de, { reminder: C }),
980
+ a.user && /* @__PURE__ */ e(
976
981
  ce,
977
982
  {
978
983
  className: "str-chat__avatar str-chat__message-sender-avatar",
979
- id: r.user.id,
980
- image: r.user.image,
981
- name: r.user.name || r.user.id
984
+ id: a.user.id,
985
+ image: a.user.image,
986
+ name: a.user.name || a.user.id
982
987
  }
983
988
  ),
984
989
  /* @__PURE__ */ e(
985
990
  "div",
986
991
  {
987
992
  className: A("str-chat__message-inner", {
988
- "str-chat__simple-message--error-failed": se || xe
993
+ "str-chat__simple-message--error-failed": Te || V
989
994
  }),
990
995
  "data-testid": "message-inner",
991
- onClick: ne,
992
- onKeyDown: ne,
993
- role: ne ? "button" : void 0,
994
- tabIndex: ne ? 0 : void 0,
996
+ onClick: H,
997
+ onKeyDown: H,
998
+ role: H ? "button" : void 0,
999
+ tabIndex: H ? 0 : void 0,
995
1000
  style: {
996
1001
  // Force margins to 0 to prevent hover layout shift
997
1002
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
998
1003
  marginInlineEnd: 0,
999
1004
  marginInlineStart: 0
1000
1005
  },
1001
- children: le ? /* @__PURE__ */ i("div", { className: A("flex flex-col gap-1", re ? "items-end" : "items-start"), children: [
1002
- /* @__PURE__ */ e(
1003
- Is,
1006
+ children: De ? /* @__PURE__ */ i("div", { className: `flex flex-col gap-1 ${X ? "items-end" : "items-start"}`, children: [
1007
+ X ? /* @__PURE__ */ e(
1008
+ Je.Creator,
1009
+ {
1010
+ title: (pe = a.metadata) == null ? void 0 : pe.attachment_title,
1011
+ mimeType: (Ne = a.metadata) == null ? void 0 : Ne.attachment_mime_type,
1012
+ thumbnailUrl: (le = a.metadata) == null ? void 0 : le.attachment_thumbnail,
1013
+ amountText: (ye = a.metadata) == null ? void 0 : ye.amount_text,
1014
+ detail: (ve = a.metadata) == null ? void 0 : ve.attachment_detail,
1015
+ paymentStatus: (we = a.metadata) == null ? void 0 : we.payment_status
1016
+ }
1017
+ ) : /* @__PURE__ */ e(
1018
+ Je.Visitor,
1004
1019
  {
1005
- title: (Ce = r.metadata) == null ? void 0 : Ce.attachment_title,
1006
- mimeType: ((ie = r.metadata) == null ? void 0 : ie.attachment_mime_type) ?? "application/octet-stream",
1007
- thumbnailUrl: (Q = r.metadata) == null ? void 0 : Q.attachment_thumbnail,
1008
- amountText: (Ne = r.metadata) == null ? void 0 : Ne.amount_text,
1009
- detail: (ye = r.metadata) == null ? void 0 : ye.attachment_detail,
1010
- paymentStatus: (pe = r.metadata) == null ? void 0 : pe.payment_status,
1011
- onUnlockClick: o ? () => o(r, w) : void 0,
1012
- onDownloadClick: l ? () => l(r, w) : void 0,
1013
- onUnlocked: d ? () => d(r, w) : void 0
1020
+ title: (ie = a.metadata) == null ? void 0 : ie.attachment_title,
1021
+ mimeType: (E = a.metadata) == null ? void 0 : E.attachment_mime_type,
1022
+ thumbnailUrl: (j = a.metadata) == null ? void 0 : j.attachment_thumbnail,
1023
+ amountText: (P = a.metadata) == null ? void 0 : P.amount_text,
1024
+ detail: ($ = a.metadata) == null ? void 0 : $.attachment_detail,
1025
+ paymentStatus: (he = a.metadata) == null ? void 0 : he.payment_status,
1026
+ isUnlocking: k(a.id),
1027
+ onUnlockClick: () => S == null ? void 0 : S(a, M),
1028
+ onFetchSource: async () => await (I == null ? void 0 : I(a, M)),
1029
+ onDownloadClick: () => D == null ? void 0 : D(a, M)
1014
1030
  }
1015
1031
  ),
1016
- r.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(He, { message: r, renderText: M }) }) })
1017
- ] }) : me ? (
1032
+ a.text && /* @__PURE__ */ e("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ e("div", { className: "str-chat__message-bubble", children: /* @__PURE__ */ e(ze, { message: a, renderText: w }) }) })
1033
+ ] }) : be ? (
1018
1034
  /* Tip-only messages render as a standalone bubble */
1019
- /* @__PURE__ */ e(Ae, { message: r, standalone: !0 })
1035
+ /* @__PURE__ */ e(Le, { message: a, standalone: !0 })
1020
1036
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
1021
1037
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
1022
- oe && !fe && /* @__PURE__ */ e(
1023
- Ae,
1038
+ re && !oe && /* @__PURE__ */ e(
1039
+ Le,
1024
1040
  {
1025
- message: r,
1026
- hasAttachment: ae,
1027
- isMyMessage: re
1041
+ message: a,
1042
+ hasAttachment: xe,
1043
+ isMyMessage: X
1028
1044
  }
1029
1045
  ),
1030
- q && /* @__PURE__ */ e(Bt, { poll: q }),
1031
- L != null && L.length && !r.quoted_message ? /* @__PURE__ */ e(
1032
- k,
1046
+ ae && /* @__PURE__ */ e(Ot, { poll: ae }),
1047
+ B != null && B.length && !a.quoted_message ? /* @__PURE__ */ e(
1048
+ F,
1033
1049
  {
1034
- actionHandler: x,
1035
- attachments: L
1050
+ actionHandler: c,
1051
+ attachments: B
1036
1052
  }
1037
1053
  ) : null,
1038
1054
  O ? /* @__PURE__ */ e(
1039
- P,
1055
+ me,
1040
1056
  {
1041
- message: r,
1042
- renderText: M
1057
+ message: a,
1058
+ renderText: w
1043
1059
  }
1044
- ) : /* @__PURE__ */ e(He, { message: r, renderText: M }),
1045
- /* @__PURE__ */ e(Gt, {})
1060
+ ) : /* @__PURE__ */ e(ze, { message: a, renderText: w }),
1061
+ /* @__PURE__ */ e(Bt, {})
1046
1062
  ] }),
1047
- (!oe || fe) && /* @__PURE__ */ e(
1048
- Ae,
1063
+ (!re || oe) && /* @__PURE__ */ e(
1064
+ Le,
1049
1065
  {
1050
- message: r,
1051
- hasAttachment: ae,
1052
- isMyMessage: re
1066
+ message: a,
1067
+ hasAttachment: xe,
1068
+ isMyMessage: X
1053
1069
  }
1054
1070
  ),
1055
- n && oe && /* @__PURE__ */ e(
1056
- Ts,
1071
+ n && re && /* @__PURE__ */ e(
1072
+ As,
1057
1073
  {
1058
- selected: y,
1059
- onVoteUp: b,
1060
- onVoteDown: _
1074
+ selected: _,
1075
+ onVoteUp: y,
1076
+ onVoteDown: p
1061
1077
  }
1062
1078
  )
1063
1079
  ] })
1064
1080
  }
1065
1081
  ),
1066
- H && /* @__PURE__ */ e(
1067
- Z,
1082
+ q && /* @__PURE__ */ e(
1083
+ z,
1068
1084
  {
1069
- onClick: C,
1070
- reply_count: r.reply_count
1085
+ onClick: h,
1086
+ reply_count: a.reply_count
1071
1087
  }
1072
1088
  ),
1073
- K && /* @__PURE__ */ e(te, {})
1074
- ] }, r.id)
1089
+ se && /* @__PURE__ */ e(W, {})
1090
+ ] }, a.id)
1075
1091
  ] });
1076
- }, Rs = F.memo(
1077
- Ds,
1078
- (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled || t.onAttachmentUnlockClick !== s.onAttachmentUnlockClick || t.onAttachmentDownloadClick !== s.onAttachmentDownloadClick || t.onAttachmentUnlocked !== s.onAttachmentUnlocked ? !1 : pt(t, s)
1079
- ), As = (t) => {
1080
- const s = et("CustomMessage");
1081
- return /* @__PURE__ */ e(Rs, { ...s, ...t });
1082
- }, Ls = (t) => ({
1092
+ }, Ps = U.memo(
1093
+ Ls,
1094
+ (t, s) => t.chatbotVotingEnabled !== s.chatbotVotingEnabled ? !1 : Nt(t, s)
1095
+ ), Us = (t) => {
1096
+ const s = st("CustomMessage");
1097
+ return /* @__PURE__ */ e(Ps, { ...s, ...t });
1098
+ }, Fs = (t) => ({
1083
1099
  linkPreviews: Array.from(t.previews.values()).filter(
1084
- (s) => Ze.previewIsLoaded(s) || Ze.previewIsLoading(s)
1100
+ (s) => qe.previewIsLoaded(s) || qe.previewIsLoading(s)
1085
1101
  )
1086
- }), Us = ({
1102
+ }), Os = ({
1087
1103
  link: t,
1088
1104
  onDismiss: s
1089
1105
  }) => {
@@ -1108,12 +1124,12 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1108
1124
  "button",
1109
1125
  {
1110
1126
  type: "button",
1111
- onClick: (a) => {
1112
- a.preventDefault(), s(n);
1127
+ onClick: (r) => {
1128
+ r.preventDefault(), s(n);
1113
1129
  },
1114
1130
  className: "absolute right-4 top-4 flex size-6 items-center justify-center rounded-full border border-white/40 bg-white/70 backdrop-blur-2xl focus-ring",
1115
1131
  "aria-label": "Close link preview",
1116
- children: /* @__PURE__ */ e(Be, { className: "size-4 text-black/90" })
1132
+ children: /* @__PURE__ */ e(Ge, { className: "size-4 text-black/90" })
1117
1133
  }
1118
1134
  ),
1119
1135
  /* @__PURE__ */ i("div", { className: "p-2", children: [
@@ -1123,32 +1139,32 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1123
1139
  ]
1124
1140
  }
1125
1141
  );
1126
- }, Ps = () => {
1127
- const { linkPreviewsManager: t } = jt(), { linkPreviews: s } = $t(
1142
+ }, Bs = () => {
1143
+ const { linkPreviewsManager: t } = Gt(), { linkPreviews: s } = $t(
1128
1144
  t.state,
1129
- Ls
1145
+ Fs
1130
1146
  ), n = (l) => {
1131
1147
  t.dismissPreview(l);
1132
1148
  };
1133
1149
  return s.length > 0 ? /* @__PURE__ */ e("div", { className: "flex flex-col items-center w-full gap-2 mb-4", children: s.map((l) => /* @__PURE__ */ e(
1134
- Us,
1150
+ Os,
1135
1151
  {
1136
1152
  link: l,
1137
1153
  onDismiss: n
1138
1154
  },
1139
1155
  l.og_scrape_url
1140
1156
  )) }) : null;
1141
- }, Fs = () => {
1142
- const { handleSubmit: t } = Ht(), s = Vt();
1143
- return /* @__PURE__ */ i(he, { children: [
1144
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Yt, {}) }),
1157
+ }, Gs = () => {
1158
+ const { handleSubmit: t } = zt(), s = Vt();
1159
+ return /* @__PURE__ */ i(ge, { children: [
1160
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Ht, {}) }),
1145
1161
  /* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
1162
+ /* @__PURE__ */ e(Yt, {}),
1163
+ /* @__PURE__ */ e(Bs, {}),
1146
1164
  /* @__PURE__ */ e(Wt, {}),
1147
- /* @__PURE__ */ e(Ps, {}),
1148
- /* @__PURE__ */ e(qt, {}),
1149
1165
  /* @__PURE__ */ i("div", { className: "flex", children: [
1150
1166
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
1151
- Zt,
1167
+ qt,
1152
1168
  {
1153
1169
  className: "w-full resize-none outline-none leading-6",
1154
1170
  autoFocus: !0,
@@ -1164,72 +1180,72 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1164
1180
  disabled: !s,
1165
1181
  onClick: t,
1166
1182
  type: "button",
1167
- children: /* @__PURE__ */ e(ns, { className: "size-4" })
1183
+ children: /* @__PURE__ */ e(ss, { className: "size-4" })
1168
1184
  }
1169
1185
  )
1170
1186
  ] })
1171
1187
  ] })
1172
1188
  ] });
1173
- }, Os = ({
1189
+ }, $s = ({
1174
1190
  renderActions: t
1175
1191
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
1176
1192
  t && (t == null ? void 0 : t()),
1177
- /* @__PURE__ */ e(zt, { Input: Fs })
1178
- ] }), Bs = [
1193
+ /* @__PURE__ */ e(jt, { Input: Gs })
1194
+ ] }), js = [
1179
1195
  "SYSTEM_DM_AGENT_PAUSED",
1180
1196
  "SYSTEM_DM_AGENT_RESUMED"
1181
- ], Gs = {
1197
+ ], zs = {
1182
1198
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1183
1199
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1184
- }, js = [
1200
+ }, Vs = [
1185
1201
  "SYSTEM_AGE_SAFETY_BLOCKED"
1186
- ], $s = {
1202
+ ], Hs = {
1187
1203
  SYSTEM_AGE_SAFETY_BLOCKED: "This user isn’t able to reply because they don’t meet our age safety guidelines."
1188
- }, Le = "age safety guidelines.", zs = "https://linktr.ee/s/about/contact", Ke = (t) => Bs.includes(t), Hs = (t) => js.includes(t), Vs = (t) => {
1204
+ }, Pe = "age safety guidelines.", Ys = "https://linktr.ee/s/about/contact", Xe = (t) => js.includes(t), Ws = (t) => Vs.includes(t), qs = (t) => {
1189
1205
  var o;
1190
1206
  const s = (o = t.metadata) == null ? void 0 : o.custom_type;
1191
- if (Ke(s))
1207
+ if (Xe(s))
1192
1208
  return {
1193
1209
  kind: "dm-agent",
1194
1210
  type: s
1195
1211
  };
1196
- if (Hs(s))
1212
+ if (Ws(s))
1197
1213
  return {
1198
1214
  kind: "age-safety",
1199
1215
  type: s
1200
1216
  };
1201
1217
  const n = t.dm_agent_system_type;
1202
- if (Ke(n))
1218
+ if (Xe(n))
1203
1219
  return {
1204
1220
  kind: "dm-agent",
1205
1221
  type: n
1206
1222
  };
1207
- }, Ys = (t) => {
1208
- const s = t.indexOf(Le);
1223
+ }, Zs = (t) => {
1224
+ const s = t.indexOf(Pe);
1209
1225
  if (s === -1)
1210
1226
  return t;
1211
- const n = s + Le.length;
1212
- return /* @__PURE__ */ i(he, { children: [
1227
+ const n = s + Pe.length;
1228
+ return /* @__PURE__ */ i(ge, { children: [
1213
1229
  t.slice(0, s),
1214
1230
  /* @__PURE__ */ e(
1215
1231
  "a",
1216
1232
  {
1217
- href: zs,
1233
+ href: Ys,
1218
1234
  target: "_blank",
1219
1235
  rel: "noopener noreferrer",
1220
1236
  className: "mes-age-safety-system-message__emphasis font-medium text-inherit underline",
1221
- children: Le
1237
+ children: Pe
1222
1238
  }
1223
1239
  ),
1224
1240
  t.slice(n)
1225
1241
  ] });
1226
- }, Ws = (t) => {
1242
+ }, Js = (t) => {
1227
1243
  var o, l;
1228
- const s = t.message.hide_date === !0, n = Vs(
1244
+ const s = t.message.hide_date === !0, n = qs(
1229
1245
  t.message
1230
1246
  );
1231
1247
  if ((n == null ? void 0 : n.kind) === "dm-agent") {
1232
- const d = ((o = t.message.text) == null ? void 0 : o.trim()) || Gs[n.type];
1248
+ const m = ((o = t.message.text) == null ? void 0 : o.trim()) || zs[n.type];
1233
1249
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1234
1250
  /* @__PURE__ */ i(
1235
1251
  "div",
@@ -1239,7 +1255,7 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1239
1255
  "data-dm-agent-system-type": n.type,
1240
1256
  children: [
1241
1257
  /* @__PURE__ */ e(
1242
- as,
1258
+ ns,
1243
1259
  {
1244
1260
  size: 16,
1245
1261
  weight: "regular",
@@ -1247,15 +1263,15 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1247
1263
  className: "mes-dm-agent-system-message__sparkle shrink-0"
1248
1264
  }
1249
1265
  ),
1250
- /* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: d })
1266
+ /* @__PURE__ */ e("p", { className: "mes-dm-agent-system-message__text m-0 text-center text-[14px] font-normal leading-5 tracking-[0.21px]", children: m })
1251
1267
  ]
1252
1268
  }
1253
1269
  ),
1254
- !s && /* @__PURE__ */ e(Re, { message: t.message })
1270
+ !s && /* @__PURE__ */ e(Ae, { message: t.message })
1255
1271
  ] });
1256
1272
  }
1257
1273
  if ((n == null ? void 0 : n.kind) === "age-safety") {
1258
- const d = ((l = t.message.text) == null ? void 0 : l.trim()) || $s[n.type];
1274
+ const m = ((l = t.message.text) == null ? void 0 : l.trim()) || Hs[n.type];
1259
1275
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
1260
1276
  /* @__PURE__ */ i(
1261
1277
  "div",
@@ -1265,7 +1281,7 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1265
1281
  "data-age-safety-system-type": n.type,
1266
1282
  children: [
1267
1283
  /* @__PURE__ */ e(
1268
- rs,
1284
+ as,
1269
1285
  {
1270
1286
  size: 24,
1271
1287
  weight: "duotone",
@@ -1274,11 +1290,11 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1274
1290
  "data-testid": "age-safety-system-message-icon"
1275
1291
  }
1276
1292
  ),
1277
- /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Ys(d) }) })
1293
+ /* @__PURE__ */ e("div", { className: "mes-age-safety-system-message__content min-w-0 flex-[1_0_0]", children: /* @__PURE__ */ e("p", { className: "m-0 text-balance text-left text-[12px] font-normal leading-4 tracking-[0.21px] text-[color:var(--text-warning-on-warning,#894b00)]", children: Zs(m) }) })
1278
1294
  ]
1279
1295
  }
1280
1296
  ),
1281
- !s && /* @__PURE__ */ e(Re, { message: t.message })
1297
+ !s && /* @__PURE__ */ e(Ae, { message: t.message })
1282
1298
  ] });
1283
1299
  }
1284
1300
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1287,9 +1303,9 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1287
1303
  /* @__PURE__ */ e("p", { children: t.message.text }),
1288
1304
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
1289
1305
  ] }),
1290
- !s && /* @__PURE__ */ e(Re, { message: t.message })
1306
+ !s && /* @__PURE__ */ e(Ae, { message: t.message })
1291
1307
  ] });
1292
- }, qs = () => null, Zs = ({ className: t, message: s }) => /* @__PURE__ */ i(
1308
+ }, Xs = () => null, Ks = ({ className: t, message: s }) => /* @__PURE__ */ i(
1293
1309
  "div",
1294
1310
  {
1295
1311
  className: A("flex items-center justify-center h-full", t),
@@ -1332,31 +1348,31 @@ const Es = F.lazy(() => import("./Creator-DGe3CQ_j.js")), Ss = F.lazy(() => impo
1332
1348
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1333
1349
  ]
1334
1350
  }
1335
- ), Ie = F.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1336
- /* @__PURE__ */ e(Zs, { className: "w-6 h-6" }),
1351
+ ), Ie = U.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1352
+ /* @__PURE__ */ e(Ks, { className: "w-6 h-6" }),
1337
1353
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1338
1354
  ] }) }));
1339
1355
  Ie.displayName = "LoadingState";
1340
- const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Js = ({
1356
+ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Qs = ({
1341
1357
  onBack: t,
1342
1358
  showBackButton: s,
1343
1359
  onShowInfo: n,
1344
1360
  canShowInfo: o,
1345
1361
  showStarButton: l = !1
1346
1362
  }) => {
1347
- var C, E, h, p, v;
1348
- const { channel: d } = ke(), a = F.useMemo(() => Object.values(d.state.members || {}).find(
1363
+ var g, v, a, w, N;
1364
+ const { channel: m } = Me(), r = U.useMemo(() => Object.values(m.state.members || {}).find(
1349
1365
  (M) => {
1350
- var S;
1351
- return ((S = M.user) == null ? void 0 : S.id) && M.user.id !== d._client.userID;
1366
+ var k;
1367
+ return ((k = M.user) == null ? void 0 : k.id) && M.user.id !== m._client.userID;
1352
1368
  }
1353
- ), [d._client.userID, d.state.members]), c = ((C = a == null ? void 0 : a.user) == null ? void 0 : C.name) || ((E = a == null ? void 0 : a.user) == null ? void 0 : E.id) || "Unknown member", f = (h = a == null ? void 0 : a.user) == null ? void 0 : h.image, u = nt(d), x = async () => {
1369
+ ), [m._client.userID, m.state.members]), c = ((g = r == null ? void 0 : r.user) == null ? void 0 : g.name) || ((v = r == null ? void 0 : r.user) == null ? void 0 : v.id) || "Unknown member", h = (a = r == null ? void 0 : r.user) == null ? void 0 : a.image, u = rt(m), b = async () => {
1354
1370
  try {
1355
- u ? await d.unpin() : await d.pin();
1356
- } catch (r) {
1371
+ u ? await m.unpin() : await m.pin();
1372
+ } catch (x) {
1357
1373
  console.error(
1358
1374
  "[CustomChannelHeader] Failed to update pinned status:",
1359
- r
1375
+ x
1360
1376
  );
1361
1377
  }
1362
1378
  };
@@ -1365,21 +1381,21 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1365
1381
  /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s && /* @__PURE__ */ e(
1366
1382
  "button",
1367
1383
  {
1368
- className: ue,
1384
+ className: fe,
1369
1385
  onClick: t || (() => {
1370
1386
  }),
1371
1387
  type: "button",
1372
1388
  "aria-label": "Back to conversations",
1373
- children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1389
+ children: /* @__PURE__ */ e(He, { className: "size-5 text-black/90" })
1374
1390
  }
1375
1391
  ) }),
1376
1392
  /* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
1377
1393
  /* @__PURE__ */ e(
1378
1394
  ce,
1379
1395
  {
1380
- id: ((p = a == null ? void 0 : a.user) == null ? void 0 : p.id) || d.id || "unknown",
1396
+ id: ((w = r == null ? void 0 : r.user) == null ? void 0 : w.id) || m.id || "unknown",
1381
1397
  name: c,
1382
- image: f,
1398
+ image: h,
1383
1399
  starred: l && u,
1384
1400
  size: 40
1385
1401
  }
@@ -1390,12 +1406,12 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1390
1406
  l && /* @__PURE__ */ e(
1391
1407
  "button",
1392
1408
  {
1393
- className: ue,
1394
- onClick: x,
1409
+ className: fe,
1410
+ onClick: b,
1395
1411
  type: "button",
1396
1412
  "aria-label": u ? "Unstar conversation" : "Star conversation",
1397
1413
  children: /* @__PURE__ */ e(
1398
- Pe,
1414
+ Fe,
1399
1415
  {
1400
1416
  className: A("size-5", {
1401
1417
  "text-yellow-600": u,
@@ -1409,11 +1425,11 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1409
1425
  /* @__PURE__ */ e(
1410
1426
  "button",
1411
1427
  {
1412
- className: ue,
1428
+ className: fe,
1413
1429
  onClick: n,
1414
1430
  type: "button",
1415
1431
  "aria-label": "Show info",
1416
- children: /* @__PURE__ */ e(We, { className: "size-5 text-black/90" })
1432
+ children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1417
1433
  }
1418
1434
  )
1419
1435
  ] })
@@ -1425,17 +1441,17 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1425
1441
  {
1426
1442
  type: "button",
1427
1443
  onClick: t,
1428
- className: ue,
1444
+ className: fe,
1429
1445
  "aria-label": "Back to conversations",
1430
- children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1446
+ children: /* @__PURE__ */ e(He, { className: "size-5 text-black/90" })
1431
1447
  }
1432
1448
  ),
1433
1449
  /* @__PURE__ */ e(
1434
1450
  ce,
1435
1451
  {
1436
- id: ((v = a == null ? void 0 : a.user) == null ? void 0 : v.id) || d.id || "unknown",
1452
+ id: ((N = r == null ? void 0 : r.user) == null ? void 0 : N.id) || m.id || "unknown",
1437
1453
  name: c,
1438
- image: f,
1454
+ image: h,
1439
1455
  starred: l && u,
1440
1456
  size: 40
1441
1457
  }
@@ -1446,12 +1462,12 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1446
1462
  l && /* @__PURE__ */ e(
1447
1463
  "button",
1448
1464
  {
1449
- className: ue,
1450
- onClick: x,
1465
+ className: fe,
1466
+ onClick: b,
1451
1467
  type: "button",
1452
1468
  "aria-label": u ? "Unstar conversation" : "Star conversation",
1453
1469
  children: /* @__PURE__ */ e(
1454
- Pe,
1470
+ Fe,
1455
1471
  {
1456
1472
  className: A("size-5", {
1457
1473
  "text-yellow-600": u,
@@ -1465,170 +1481,156 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1465
1481
  o && n && /* @__PURE__ */ e(
1466
1482
  "button",
1467
1483
  {
1468
- className: ue,
1484
+ className: fe,
1469
1485
  onClick: n,
1470
1486
  type: "button",
1471
1487
  "aria-label": "Show info",
1472
- children: /* @__PURE__ */ e(We, { className: "size-5 text-black/90" })
1488
+ children: /* @__PURE__ */ e(Ye, { className: "size-5 text-black/90" })
1473
1489
  }
1474
1490
  )
1475
1491
  ] })
1476
1492
  ] })
1477
1493
  ] });
1478
- }, Xs = ({
1494
+ }, en = ({
1479
1495
  onBack: t,
1480
1496
  showBackButton: s,
1481
1497
  renderMessageInputActions: n,
1482
1498
  renderConversationFooter: o,
1483
1499
  onLeaveConversation: l,
1484
- onBlockParticipant: d,
1485
- showDeleteConversation: a = !0,
1500
+ onBlockParticipant: m,
1501
+ showDeleteConversation: r = !0,
1486
1502
  onDeleteConversationClick: c,
1487
- onBlockParticipantClick: f,
1503
+ onBlockParticipantClick: h,
1488
1504
  onReportParticipantClick: u,
1489
- showStarButton: x = !1,
1490
- chatbotVotingEnabled: C = !1,
1491
- onAttachmentUnlockClick: E,
1492
- onAttachmentDownloadClick: h,
1493
- onAttachmentUnlocked: p,
1505
+ showStarButton: b = !1,
1506
+ chatbotVotingEnabled: g = !1,
1494
1507
  renderChannelBanner: v,
1495
- customProfileContent: r,
1496
- customChannelActions: M,
1497
- renderMessage: S
1508
+ customProfileContent: a,
1509
+ customChannelActions: w,
1510
+ renderMessage: N
1498
1511
  }) => {
1499
- const { channel: N } = ke(), w = ee(null), R = F.useMemo(() => Object.values(N.state.members || {}).find(
1500
- (_) => {
1501
- var k;
1502
- return ((k = _.user) == null ? void 0 : k.id) && _.user.id !== N._client.userID;
1512
+ const { channel: x } = Me(), M = Q(null), k = U.useMemo(() => Object.values(x.state.members || {}).find(
1513
+ (C) => {
1514
+ var _;
1515
+ return ((_ = C.user) == null ? void 0 : _.id) && C.user.id !== x._client.userID;
1503
1516
  }
1504
- ), [N._client.userID, N.state.members]), g = F.useMemo(() => {
1505
- const b = N.data ?? {};
1506
- if (b.followerStatus)
1507
- return String(b.followerStatus);
1508
- if (b.isFollower !== void 0)
1509
- return b.isFollower ? "Subscribed to you" : "Not subscribed";
1510
- }, [N.data]), m = U(() => {
1511
- var b;
1512
- (b = w.current) == null || b.showModal();
1513
- }, []), y = U(() => {
1514
- var b;
1515
- (b = w.current) == null || b.close();
1516
- }, []);
1517
- return /* @__PURE__ */ i(he, { children: [
1518
- /* @__PURE__ */ e(
1519
- Xt,
1520
- {
1521
- overrides: {
1522
- Message: (b) => {
1523
- const { message: _ } = et("ChannelView"), k = /* @__PURE__ */ e(
1524
- As,
1525
- {
1526
- ...b,
1527
- chatbotVotingEnabled: C,
1528
- onAttachmentUnlockClick: E,
1529
- onAttachmentDownloadClick: h,
1530
- onAttachmentUnlocked: p
1531
- }
1532
- );
1533
- return !S || !_ ? k : S(k, _);
1534
- }
1535
- },
1536
- children: /* @__PURE__ */ i(Kt, { children: [
1537
- /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1538
- Js,
1539
- {
1540
- onBack: t,
1541
- showBackButton: s,
1542
- onShowInfo: m,
1543
- canShowInfo: !!R,
1544
- showStarButton: x
1545
- }
1546
- ) }),
1547
- v == null ? void 0 : v(),
1548
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1549
- Qt,
1550
- {
1551
- hideDeletedMessages: !0,
1552
- hideNewMessageSeparator: !1,
1553
- messageActions: void 0
1554
- }
1555
- ) }),
1556
- o == null ? void 0 : o(N),
1557
- /* @__PURE__ */ e(
1558
- Os,
1559
- {
1560
- renderActions: () => n == null ? void 0 : n(N)
1561
- }
1562
- )
1563
- ] })
1564
- }
1565
- ),
1517
+ ), [x._client.userID, x.state.members]), S = U.useMemo(() => {
1518
+ const d = x.data ?? {};
1519
+ if (d.followerStatus)
1520
+ return String(d.followerStatus);
1521
+ if (d.isFollower !== void 0)
1522
+ return d.isFollower ? "Subscribed to you" : "Not subscribed";
1523
+ }, [x.data]), I = R(() => {
1524
+ var d;
1525
+ (d = M.current) == null || d.showModal();
1526
+ }, []), D = R(() => {
1527
+ var d;
1528
+ (d = M.current) == null || d.close();
1529
+ }, []), f = R(
1530
+ (d) => {
1531
+ const { message: C } = st("ChannelView"), _ = /* @__PURE__ */ e(
1532
+ Us,
1533
+ {
1534
+ ...d,
1535
+ chatbotVotingEnabled: g
1536
+ }
1537
+ );
1538
+ return !N || !C ? _ : N(_, C);
1539
+ },
1540
+ [g, N]
1541
+ );
1542
+ return /* @__PURE__ */ i(ge, { children: [
1543
+ /* @__PURE__ */ e(Jt, { overrides: { Message: f }, children: /* @__PURE__ */ i(Xt, { children: [
1544
+ /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1545
+ Qs,
1546
+ {
1547
+ onBack: t,
1548
+ showBackButton: s,
1549
+ onShowInfo: I,
1550
+ canShowInfo: !!k,
1551
+ showStarButton: b
1552
+ }
1553
+ ) }),
1554
+ v == null ? void 0 : v(),
1555
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1556
+ Kt,
1557
+ {
1558
+ hideDeletedMessages: !0,
1559
+ hideNewMessageSeparator: !1,
1560
+ messageActions: void 0
1561
+ }
1562
+ ) }),
1563
+ o == null ? void 0 : o(x),
1564
+ /* @__PURE__ */ e(
1565
+ $s,
1566
+ {
1567
+ renderActions: () => n == null ? void 0 : n(x)
1568
+ }
1569
+ )
1570
+ ] }) }),
1566
1571
  /* @__PURE__ */ e(
1567
- ps,
1572
+ Ns,
1568
1573
  {
1569
- dialogRef: w,
1570
- onClose: y,
1571
- participant: R,
1572
- channel: N,
1573
- followerStatusLabel: g,
1574
+ dialogRef: M,
1575
+ onClose: D,
1576
+ participant: k,
1577
+ channel: x,
1578
+ followerStatusLabel: S,
1574
1579
  onLeaveConversation: l,
1575
- onBlockParticipant: d,
1576
- showDeleteConversation: a,
1580
+ onBlockParticipant: m,
1581
+ showDeleteConversation: r,
1577
1582
  onDeleteConversationClick: c,
1578
- onBlockParticipantClick: f,
1583
+ onBlockParticipantClick: h,
1579
1584
  onReportParticipantClick: u,
1580
- customProfileContent: r,
1581
- customChannelActions: M
1585
+ customProfileContent: a,
1586
+ customChannelActions: w
1582
1587
  }
1583
1588
  )
1584
1589
  ] });
1585
- }, ct = F.memo(
1590
+ }, ht = U.memo(
1586
1591
  ({
1587
1592
  channel: t,
1588
1593
  onBack: s,
1589
1594
  showBackButton: n = !1,
1590
1595
  renderMessageInputActions: o,
1591
1596
  renderConversationFooter: l,
1592
- onLeaveConversation: d,
1593
- onBlockParticipant: a,
1597
+ onLeaveConversation: m,
1598
+ onBlockParticipant: r,
1594
1599
  className: c,
1595
- CustomChannelEmptyState: f = qs,
1600
+ CustomChannelEmptyState: h = Xs,
1596
1601
  showDeleteConversation: u = !0,
1597
- onDeleteConversationClick: x,
1598
- onBlockParticipantClick: C,
1599
- onReportParticipantClick: E,
1600
- dmAgentEnabled: h,
1601
- messageMetadata: p,
1602
- onMessageSent: v,
1603
- showStarButton: r = !1,
1602
+ onDeleteConversationClick: b,
1603
+ onBlockParticipantClick: g,
1604
+ onReportParticipantClick: v,
1605
+ dmAgentEnabled: a,
1606
+ messageMetadata: w,
1607
+ onMessageSent: N,
1608
+ showStarButton: x = !1,
1604
1609
  chatbotVotingEnabled: M = !1,
1605
- onAttachmentUnlockClick: S,
1606
- onAttachmentDownloadClick: N,
1607
- onAttachmentUnlocked: w,
1608
- renderChannelBanner: R,
1609
- customProfileContent: g,
1610
- customChannelActions: m,
1611
- renderMessage: y
1610
+ renderChannelBanner: k,
1611
+ customProfileContent: S,
1612
+ customChannelActions: I,
1613
+ renderMessage: D
1612
1614
  }) => {
1613
- const b = U(
1614
- async (_, k, Y) => {
1615
+ const f = R(
1616
+ async (d, C, _) => {
1615
1617
  var J;
1616
- const G = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, D = h && !G, j = {
1617
- ...k,
1618
- ...D && { silent: !0 },
1619
- ...p && {
1618
+ const y = ((J = t.data) == null ? void 0 : J.chatbot_paused) === !0, p = a && !y, F = {
1619
+ ...C,
1620
+ ...p && { silent: !0 },
1621
+ ...w && {
1620
1622
  metadata: {
1621
- ...k.metadata ?? {},
1622
- ...p
1623
+ ...C.metadata ?? {},
1624
+ ...w
1623
1625
  }
1624
1626
  }
1625
- }, te = {
1626
- ...Y,
1627
- ...D && { skip_push: !0 }
1628
- }, Z = await t.sendMessage(j, te);
1629
- return v == null || v(Z), Z;
1627
+ }, ee = {
1628
+ ..._,
1629
+ ...p && { skip_push: !0 }
1630
+ }, Y = await t.sendMessage(F, ee);
1631
+ return N == null || N(Y), Y;
1630
1632
  },
1631
- [t, h, p, v]
1633
+ [t, a, w, N]
1632
1634
  );
1633
1635
  return /* @__PURE__ */ e(
1634
1636
  "div",
@@ -1638,37 +1640,34 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1638
1640
  c
1639
1641
  ),
1640
1642
  children: /* @__PURE__ */ e(
1641
- Jt,
1643
+ Zt,
1642
1644
  {
1643
1645
  channel: t,
1644
- MessageSystem: Ws,
1645
- EmptyStateIndicator: f,
1646
+ MessageSystem: Js,
1647
+ EmptyStateIndicator: h,
1646
1648
  LoadingIndicator: Ie,
1647
- DateSeparator: vs,
1648
- doSendMessageRequest: b,
1649
+ DateSeparator: ys,
1650
+ doSendMessageRequest: f,
1649
1651
  children: /* @__PURE__ */ e(
1650
- Xs,
1652
+ en,
1651
1653
  {
1652
1654
  onBack: s,
1653
1655
  showBackButton: n,
1654
1656
  renderMessageInputActions: o,
1655
1657
  renderConversationFooter: l,
1656
- onLeaveConversation: d,
1657
- onBlockParticipant: a,
1658
- CustomChannelEmptyState: f,
1658
+ onLeaveConversation: m,
1659
+ onBlockParticipant: r,
1660
+ CustomChannelEmptyState: h,
1659
1661
  showDeleteConversation: u,
1660
- onDeleteConversationClick: x,
1661
- onBlockParticipantClick: C,
1662
- onReportParticipantClick: E,
1663
- showStarButton: r,
1662
+ onDeleteConversationClick: b,
1663
+ onBlockParticipantClick: g,
1664
+ onReportParticipantClick: v,
1665
+ showStarButton: x,
1664
1666
  chatbotVotingEnabled: M,
1665
- onAttachmentUnlockClick: S,
1666
- onAttachmentDownloadClick: N,
1667
- onAttachmentUnlocked: w,
1668
- renderChannelBanner: R,
1669
- customProfileContent: g,
1670
- customChannelActions: m,
1671
- renderMessage: y
1667
+ renderChannelBanner: k,
1668
+ customProfileContent: S,
1669
+ customChannelActions: I,
1670
+ renderMessage: D
1672
1671
  }
1673
1672
  )
1674
1673
  }
@@ -1677,16 +1676,16 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1677
1676
  );
1678
1677
  }
1679
1678
  );
1680
- ct.displayName = "ChannelView";
1681
- function Ks({
1679
+ ht.displayName = "ChannelView";
1680
+ function tn({
1682
1681
  searchQuery: t,
1683
1682
  setSearchQuery: s,
1684
1683
  placeholder: n
1685
1684
  }) {
1686
- const o = ee(null);
1685
+ const o = Q(null);
1687
1686
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1688
1687
  /* @__PURE__ */ e(
1689
- os,
1688
+ rs,
1690
1689
  {
1691
1690
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1692
1691
  weight: "bold"
@@ -1704,7 +1703,7 @@ function Ks({
1704
1703
  }
1705
1704
  ),
1706
1705
  t && /* @__PURE__ */ e(
1707
- lt,
1706
+ ct,
1708
1707
  {
1709
1708
  label: "Clear search",
1710
1709
  onClick: () => {
@@ -1712,151 +1711,151 @@ function Ks({
1712
1711
  s(""), (l = o.current) == null || l.focus();
1713
1712
  },
1714
1713
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
1715
- children: /* @__PURE__ */ e(Be, { className: "h-4 w-4", weight: "bold" })
1714
+ children: /* @__PURE__ */ e(Ge, { className: "h-4 w-4", weight: "bold" })
1716
1715
  }
1717
1716
  )
1718
1717
  ] });
1719
1718
  }
1720
- const Qs = ({
1719
+ const sn = ({
1721
1720
  participantSource: t,
1722
1721
  onSelectParticipant: s,
1723
1722
  onClose: n,
1724
1723
  existingParticipantIds: o = /* @__PURE__ */ new Set(),
1725
1724
  participantLabel: l = "participants",
1726
- searchPlaceholder: d = "Search participants...",
1727
- className: a
1725
+ searchPlaceholder: m = "Search participants...",
1726
+ className: r
1728
1727
  }) => {
1729
- const { debug: c } = Me(), [f, u] = T(""), [x, C] = T([]), [E, h] = T(!1), [p, v] = T(null), [r, M] = T(
1728
+ const { debug: c } = ke(), [h, u] = T(""), [b, g] = T([]), [v, a] = T(!1), [w, N] = T(null), [x, M] = T(
1730
1729
  null
1731
- ), S = ee(!1);
1732
- X(() => {
1733
- S.current = !1;
1734
- }, [t]), X(() => {
1730
+ ), k = Q(!1);
1731
+ Z(() => {
1732
+ k.current = !1;
1733
+ }, [t]), Z(() => {
1735
1734
  if (t.loading) {
1736
1735
  c && console.log(
1737
1736
  "[ParticipantPicker] Waiting for participant source to finish loading..."
1738
1737
  );
1739
1738
  return;
1740
1739
  }
1741
- if (S.current) return;
1740
+ if (k.current) return;
1742
1741
  (async () => {
1743
- c && console.log("[ParticipantPicker] Loading initial participants..."), h(!0), v(null);
1742
+ c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), N(null);
1744
1743
  try {
1745
- const m = await t.loadParticipants({
1744
+ const d = await t.loadParticipants({
1746
1745
  search: "",
1747
1746
  // Load all participants initially
1748
1747
  limit: 100
1749
1748
  });
1750
- C(m.participants), S.current = !0, c && console.log(
1749
+ g(d.participants), k.current = !0, c && console.log(
1751
1750
  "[ParticipantPicker] Participants loaded successfully:",
1752
- m.participants.length
1751
+ d.participants.length
1753
1752
  );
1754
- } catch (m) {
1755
- const y = m instanceof Error ? m.message : "Failed to load participants";
1756
- v(y), console.error("[ParticipantPicker] Failed to load participants:", m);
1753
+ } catch (d) {
1754
+ const C = d instanceof Error ? d.message : "Failed to load participants";
1755
+ N(C), console.error("[ParticipantPicker] Failed to load participants:", d);
1757
1756
  } finally {
1758
- h(!1);
1757
+ a(!1);
1759
1758
  }
1760
1759
  })();
1761
1760
  }, [t, c]);
1762
- const N = x.filter((g) => !o.has(g.id)).filter((g) => {
1763
- var y;
1764
- if (!f) return !0;
1765
- const m = f.toLowerCase();
1766
- return g.name.toLowerCase().includes(m) || ((y = g.email) == null ? void 0 : y.toLowerCase().includes(m)) || !1;
1767
- }), w = U(
1768
- async (g) => {
1769
- if (!r) {
1770
- M(g.id);
1761
+ const S = b.filter((f) => !o.has(f.id)).filter((f) => {
1762
+ var C;
1763
+ if (!h) return !0;
1764
+ const d = h.toLowerCase();
1765
+ return f.name.toLowerCase().includes(d) || ((C = f.email) == null ? void 0 : C.toLowerCase().includes(d)) || !1;
1766
+ }), I = R(
1767
+ async (f) => {
1768
+ if (!x) {
1769
+ M(f.id);
1771
1770
  try {
1772
- await s(g);
1773
- } catch (m) {
1774
- console.error("[ParticipantPicker] Failed to start chat:", m), M(null);
1771
+ await s(f);
1772
+ } catch (d) {
1773
+ console.error("[ParticipantPicker] Failed to start chat:", d), M(null);
1775
1774
  }
1776
1775
  }
1777
1776
  },
1778
- [s, r]
1779
- ), R = (g, m) => {
1780
- (g.key === "Enter" || g.key === " ") && (g.preventDefault(), w(m));
1777
+ [s, x]
1778
+ ), D = (f, d) => {
1779
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), I(d));
1781
1780
  };
1782
- return /* @__PURE__ */ i("div", { className: A("flex flex-col h-full", a), children: [
1781
+ return /* @__PURE__ */ i("div", { className: A("flex flex-col h-full", r), children: [
1783
1782
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1784
1783
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1785
1784
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1786
- /* @__PURE__ */ e(it, { onClick: n })
1785
+ /* @__PURE__ */ e(dt, { onClick: n })
1787
1786
  ] }),
1788
1787
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1789
1788
  "Select a ",
1790
1789
  l.slice(0, -1),
1791
1790
  " to start messaging (",
1792
- N.length,
1791
+ S.length,
1793
1792
  " available)",
1794
1793
  t.totalCount !== void 0 && ` • ${t.totalCount} ${l} total`
1795
1794
  ] }),
1796
1795
  /* @__PURE__ */ e(
1797
- Ks,
1796
+ tn,
1798
1797
  {
1799
- searchQuery: f,
1798
+ searchQuery: h,
1800
1799
  setSearchQuery: u,
1801
- placeholder: d
1800
+ placeholder: m
1802
1801
  }
1803
1802
  )
1804
1803
  ] }),
1805
- p && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1804
+ w && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1806
1805
  "Error loading ",
1807
1806
  l,
1808
1807
  ": ",
1809
- p
1808
+ w
1810
1809
  ] }),
1811
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: E && N.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1810
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1812
1811
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1813
1812
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1814
1813
  "Loading ",
1815
1814
  l,
1816
1815
  "..."
1817
1816
  ] })
1818
- ] }) }) : N.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1819
- /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(qe, { className: "h-8 w-8 text-charcoal" }) }),
1820
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: f ? `No ${l} found` : x.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1821
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: f ? "Try a different search term" : x.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1817
+ ] }) }) : S.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1818
+ /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(We, { className: "h-8 w-8 text-charcoal" }) }),
1819
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1820
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1822
1821
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1823
- N.map((g) => {
1824
- const m = g.name || g.email || g.id, y = g.email && g.name ? g.email : g.phone;
1822
+ S.map((f) => {
1823
+ const d = f.name || f.email || f.id, C = f.email && f.name ? f.email : f.phone;
1825
1824
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1826
1825
  "button",
1827
1826
  {
1828
1827
  type: "button",
1829
- onClick: () => w(g),
1830
- onKeyDown: (b) => R(b, g),
1828
+ onClick: () => I(f),
1829
+ onKeyDown: (_) => D(_, f),
1831
1830
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1832
1831
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1833
1832
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1834
1833
  /* @__PURE__ */ e(
1835
1834
  ce,
1836
1835
  {
1837
- id: g.id,
1838
- name: m,
1839
- image: g.image,
1836
+ id: f.id,
1837
+ name: d,
1838
+ image: f.image,
1840
1839
  size: 40
1841
1840
  }
1842
1841
  ),
1843
1842
  /* @__PURE__ */ i("div", { className: "flex-1 min-w-0", children: [
1844
- /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: m }),
1845
- y && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: y })
1843
+ /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: d }),
1844
+ C && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: C })
1846
1845
  ] })
1847
1846
  ] }),
1848
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: r === g.id ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(qe, { className: "h-5 w-5 text-stone" }) })
1847
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: x === f.id ? /* @__PURE__ */ e(Ee, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(We, { className: "h-5 w-5 text-stone" }) })
1849
1848
  ] })
1850
1849
  }
1851
- ) }, g.id);
1850
+ ) }, f.id);
1852
1851
  }),
1853
- E && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1852
+ v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1854
1853
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1855
1854
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1856
1855
  ] }) })
1857
1856
  ] }) })
1858
1857
  ] });
1859
- }, en = ({ className: t }) => /* @__PURE__ */ i(
1858
+ }, nn = ({ className: t }) => /* @__PURE__ */ i(
1860
1859
  "svg",
1861
1860
  {
1862
1861
  width: "140",
@@ -1990,17 +1989,17 @@ const Qs = ({
1990
1989
  ] })
1991
1990
  ]
1992
1991
  }
1993
- ), dt = F.memo(
1992
+ ), ft = U.memo(
1994
1993
  ({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1995
- /* @__PURE__ */ e(en, {}),
1994
+ /* @__PURE__ */ e(nn, {}),
1996
1995
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1997
1996
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1998
1997
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1999
1998
  ] })
2000
1999
  ] }) })
2001
2000
  );
2002
- dt.displayName = "EmptyState";
2003
- const Se = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
2001
+ ft.displayName = "EmptyState";
2002
+ const Se = U.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
2004
2003
  /* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
2005
2004
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
2006
2005
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -2015,131 +2014,128 @@ const Se = F.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
2015
2014
  )
2016
2015
  ] }) }));
2017
2016
  Se.displayName = "ErrorState";
2018
- const mn = ({
2017
+ const gn = ({
2019
2018
  capabilities: t = {},
2020
2019
  className: s,
2021
2020
  renderMessageInputActions: n,
2022
2021
  renderConversationFooter: o,
2023
2022
  onChannelSelect: l,
2024
- onParticipantSelect: d,
2025
- initialParticipantFilter: a,
2023
+ onParticipantSelect: m,
2024
+ initialParticipantFilter: r,
2026
2025
  initialParticipantData: c,
2027
- CustomChannelEmptyState: f,
2026
+ CustomChannelEmptyState: h,
2028
2027
  showChannelList: u = !0,
2029
- filters: x,
2030
- channelRenderFilterFn: C,
2031
- channelListCustomEmptyStateIndicator: E,
2032
- onDeleteConversationClick: h,
2033
- onBlockParticipantClick: p,
2034
- onReportParticipantClick: v,
2035
- dmAgentEnabled: r,
2028
+ filters: b,
2029
+ channelRenderFilterFn: g,
2030
+ channelListCustomEmptyStateIndicator: v,
2031
+ onDeleteConversationClick: a,
2032
+ onBlockParticipantClick: w,
2033
+ onReportParticipantClick: N,
2034
+ dmAgentEnabled: x,
2036
2035
  messageMetadata: M,
2037
- onMessageSent: S,
2038
- showStarButton: N = !1,
2039
- chatbotVotingEnabled: w = !1,
2040
- renderMessagePreview: R,
2041
- renderChannelBanner: g,
2042
- customProfileContent: m,
2043
- customChannelActions: y,
2044
- renderMessage: b,
2045
- onAttachmentUnlockClick: _,
2046
- onAttachmentDownloadClick: k,
2047
- onAttachmentUnlocked: Y
2036
+ onMessageSent: k,
2037
+ showStarButton: S = !1,
2038
+ chatbotVotingEnabled: I = !1,
2039
+ renderMessagePreview: D,
2040
+ renderChannelBanner: f,
2041
+ customProfileContent: d,
2042
+ customChannelActions: C,
2043
+ renderMessage: _
2048
2044
  }) => {
2049
2045
  const {
2050
- service: G,
2051
- client: D,
2052
- isConnected: j,
2053
- isLoading: te,
2054
- error: Z,
2046
+ service: y,
2047
+ client: p,
2048
+ isConnected: F,
2049
+ isLoading: ee,
2050
+ error: Y,
2055
2051
  refreshConnection: J,
2056
- debug: P
2057
- } = ls(), [W, z] = T(null), [de, O] = T(!1), [L, H] = T(!1), [K, se] = T(!1), [xe, ne] = T(/* @__PURE__ */ new Set()), [re, je] = T(0), [q, me] = T(!1), [oe, le] = T(null), ae = ee(null), {
2058
- participantSource: fe,
2059
- participantLabel: ge = "participants",
2060
- showDeleteConversation: be = !0
2061
- } = t, Ce = F.useMemo(() => {
2062
- const I = D == null ? void 0 : D.userID;
2052
+ debug: L
2053
+ } = os(), [W, z] = T(null), [de, me] = T(!1), [te, ue] = T(!1), [G, O] = T(!1), [B, q] = T(/* @__PURE__ */ new Set()), [se, Te] = T(0), [V, H] = T(!1), [X, ne] = T(null), ae = Q(null), {
2054
+ participantSource: be,
2055
+ participantLabel: re = "participants",
2056
+ showDeleteConversation: De = !0
2057
+ } = t, xe = U.useMemo(() => {
2058
+ const E = p == null ? void 0 : p.userID;
2063
2059
  return {
2064
2060
  ...{
2065
2061
  type: "messaging",
2066
2062
  last_message_at: { $exists: !0 },
2067
- ...I && {
2068
- members: { $in: [I] },
2063
+ ...E && {
2064
+ members: { $in: [E] },
2069
2065
  hidden: !1
2070
2066
  }
2071
2067
  },
2072
- ...x
2068
+ ...b
2073
2069
  };
2074
- }, [x, D == null ? void 0 : D.userID]), ie = ee(null), Q = U(async () => {
2075
- if (!D || !j) return;
2076
- const I = D.userID;
2077
- if (I)
2070
+ }, [b, p == null ? void 0 : p.userID]), oe = Q(null), K = R(async () => {
2071
+ if (!p || !F) return;
2072
+ const E = p.userID;
2073
+ if (E)
2078
2074
  try {
2079
- P && console.log("[MessagingShell] Syncing channels for user:", I);
2080
- const V = await D.queryChannels(
2075
+ L && console.log("[MessagingShell] Syncing channels for user:", E);
2076
+ const j = await p.queryChannels(
2081
2077
  {
2082
2078
  type: "messaging",
2083
- members: { $in: [I] }
2079
+ members: { $in: [E] }
2084
2080
  },
2085
2081
  {},
2086
2082
  { limit: 100 }
2087
- ), B = /* @__PURE__ */ new Set();
2088
- V.forEach(($) => {
2089
- const Te = $.state.members;
2090
- Object.values(Te).forEach((ft) => {
2091
- var $e;
2092
- const De = ($e = ft.user) == null ? void 0 : $e.id;
2093
- De && De !== I && B.add(De);
2083
+ ), P = /* @__PURE__ */ new Set();
2084
+ j.forEach(($) => {
2085
+ const he = $.state.members;
2086
+ Object.values(he).forEach((gt) => {
2087
+ var je;
2088
+ const Re = (je = gt.user) == null ? void 0 : je.id;
2089
+ Re && Re !== E && P.add(Re);
2094
2090
  });
2095
- }), ne(($) => $.size === B.size && [...$].every((Te) => B.has(Te)) ? $ : B), O(V.length > 0), H(!0), ie.current = I, P && console.log("[MessagingShell] Channels synced successfully:", {
2096
- channelCount: V.length,
2097
- memberCount: B.size
2091
+ }), q(($) => $.size === P.size && [...$].every((he) => P.has(he)) ? $ : P), me(j.length > 0), ue(!0), oe.current = E, L && console.log("[MessagingShell] Channels synced successfully:", {
2092
+ channelCount: j.length,
2093
+ memberCount: P.size
2098
2094
  });
2099
- } catch (V) {
2100
- console.error("[MessagingShell] Failed to sync channels:", V);
2095
+ } catch (j) {
2096
+ console.error("[MessagingShell] Failed to sync channels:", j);
2101
2097
  }
2102
- }, [D, j, P]);
2103
- X(() => {
2104
- if (!D || !j) return;
2105
- const I = D.userID;
2106
- I && ie.current !== I && Q();
2107
- }, [D, j, Q]), X(() => {
2108
- if (!a || !D || !j) return;
2098
+ }, [p, F, L]);
2099
+ Z(() => {
2100
+ if (!p || !F) return;
2101
+ const E = p.userID;
2102
+ E && oe.current !== E && K();
2103
+ }, [p, F, K]), Z(() => {
2104
+ if (!r || !p || !F) return;
2109
2105
  (async () => {
2110
- const V = D.userID;
2111
- if (V)
2106
+ const j = p.userID;
2107
+ if (j)
2112
2108
  try {
2113
- P && console.log(
2109
+ L && console.log(
2114
2110
  "[MessagingShell] Loading initial conversation with:",
2115
- a
2111
+ r
2116
2112
  );
2117
- const B = await D.queryChannels(
2113
+ const P = await p.queryChannels(
2118
2114
  {
2119
2115
  type: "messaging",
2120
- members: { $eq: [V, a] }
2116
+ members: { $eq: [j, r] }
2121
2117
  },
2122
2118
  {},
2123
2119
  { limit: 1 }
2124
2120
  );
2125
- if (B.length > 0)
2126
- z(B[0]), me(!0), le(null), l && l(B[0]), P && console.log(
2121
+ if (P.length > 0)
2122
+ z(P[0]), H(!0), ne(null), l && l(P[0]), L && console.log(
2127
2123
  "[MessagingShell] Initial conversation loaded:",
2128
- B[0].id
2124
+ P[0].id
2129
2125
  );
2130
- else if (c && G) {
2131
- P && console.log(
2126
+ else if (c && y) {
2127
+ L && console.log(
2132
2128
  "[MessagingShell] No conversation found, creating one for:",
2133
2129
  c
2134
2130
  );
2135
2131
  try {
2136
- const $ = await G.startChannelWithParticipant({
2132
+ const $ = await y.startChannelWithParticipant({
2137
2133
  id: c.id,
2138
2134
  name: c.name,
2139
2135
  email: c.email,
2140
2136
  phone: c.phone
2141
2137
  });
2142
- z($), me(!0), le(null), l && l($), P && console.log(
2138
+ z($), H(!0), ne(null), l && l($), L && console.log(
2143
2139
  "[MessagingShell] Channel created and loaded:",
2144
2140
  $.id
2145
2141
  );
@@ -2147,90 +2143,90 @@ const mn = ({
2147
2143
  console.error(
2148
2144
  "[MessagingShell] Failed to create conversation:",
2149
2145
  $
2150
- ), le("Failed to create conversation");
2146
+ ), ne("Failed to create conversation");
2151
2147
  }
2152
2148
  } else
2153
- le(
2149
+ ne(
2154
2150
  "No conversation found with this account"
2155
- ), P && console.log(
2151
+ ), L && console.log(
2156
2152
  "[MessagingShell] No conversation found for:",
2157
- a
2153
+ r
2158
2154
  );
2159
- } catch (B) {
2155
+ } catch (P) {
2160
2156
  console.error(
2161
2157
  "[MessagingShell] Failed to load initial conversation:",
2162
- B
2163
- ), le("Failed to load conversation");
2158
+ P
2159
+ ), ne("Failed to load conversation");
2164
2160
  }
2165
2161
  })();
2166
2162
  }, [
2167
- a,
2163
+ r,
2168
2164
  c,
2169
- D,
2170
- j,
2171
- G,
2172
- P,
2165
+ p,
2166
+ F,
2167
+ y,
2168
+ L,
2173
2169
  l
2174
2170
  ]);
2175
- const Ne = U(
2176
- (I) => {
2177
- z(I), l == null || l(I);
2171
+ const Ce = R(
2172
+ (E) => {
2173
+ z(E), l == null || l(E);
2178
2174
  },
2179
2175
  [l]
2180
- ), ye = U(() => {
2181
- q || z(null);
2182
- }, [q]), pe = U(
2183
- async (I) => {
2184
- var V;
2185
- if (G)
2176
+ ), pe = R(() => {
2177
+ V || z(null);
2178
+ }, [V]), Ne = R(
2179
+ async (E) => {
2180
+ var j;
2181
+ if (y)
2186
2182
  try {
2187
- P && console.log(
2183
+ L && console.log(
2188
2184
  "[MessagingShell] Starting conversation with:",
2189
- I.id
2185
+ E.id
2190
2186
  );
2191
- const B = await G.startChannelWithParticipant({
2192
- id: I.id,
2193
- name: I.name,
2194
- email: I.email,
2195
- phone: I.phone
2187
+ const P = await y.startChannelWithParticipant({
2188
+ id: E.id,
2189
+ name: E.name,
2190
+ email: E.email,
2191
+ phone: E.phone
2196
2192
  });
2197
2193
  try {
2198
- await B.show();
2194
+ await P.show();
2199
2195
  } catch ($) {
2200
2196
  console.warn("[MessagingShell] Failed to unhide channel:", $);
2201
2197
  }
2202
- z(B), se(!1), (V = ae.current) == null || V.close(), d == null || d(I);
2203
- } catch (B) {
2204
- console.error("[MessagingShell] Failed to start conversation:", B);
2198
+ z(P), O(!1), (j = ae.current) == null || j.close(), m == null || m(E);
2199
+ } catch (P) {
2200
+ console.error("[MessagingShell] Failed to start conversation:", P);
2205
2201
  }
2206
2202
  },
2207
- [G, d, P]
2208
- ), ve = U(() => {
2209
- var I;
2210
- se(!1), (I = ae.current) == null || I.close();
2211
- }, []), mt = U(
2212
- (I) => {
2213
- I.target === ae.current && ve();
2203
+ [y, m, L]
2204
+ ), le = R(() => {
2205
+ var E;
2206
+ O(!1), (E = ae.current) == null || E.close();
2207
+ }, []), ye = R(
2208
+ (E) => {
2209
+ E.target === ae.current && le();
2214
2210
  },
2215
- [ve]
2216
- ), ut = U(
2217
- async (I) => {
2218
- P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), ie.current = null, await Q();
2211
+ [le]
2212
+ ), ve = R(
2213
+ async (E) => {
2214
+ L && console.log("[MessagingShell] Leaving conversation:", E.id), z(null), H(!1), oe.current = null, await K();
2219
2215
  },
2220
- [Q, P]
2221
- ), ht = U(
2222
- async (I) => {
2223
- P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), ie.current = null, await Q();
2216
+ [K, L]
2217
+ ), we = R(
2218
+ async (E) => {
2219
+ L && console.log("[MessagingShell] Blocking participant:", E), z(null), H(!1), oe.current = null, await K();
2224
2220
  },
2225
- [Q, P]
2226
- ), we = !!W;
2227
- return te ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, {}) }) : Z ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: Z, onBack: J }) }) : !j || !D ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
2221
+ [K, L]
2222
+ ), ie = !!W;
2223
+ return ee ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ie, {}) }) : Y ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: Y, onBack: J }) }) : !F || !p ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
2228
2224
  Se,
2229
2225
  {
2230
2226
  message: "Not connected to messaging service",
2231
2227
  onBack: J
2232
2228
  }
2233
- ) }) : oe ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: oe }) }) : /* @__PURE__ */ i(
2229
+ ) }) : X ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, { message: X }) }) : /* @__PURE__ */ i(
2234
2230
  "div",
2235
2231
  {
2236
2232
  className: A(
@@ -2245,22 +2241,22 @@ const mn = ({
2245
2241
  className: A(
2246
2242
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2247
2243
  {
2248
- "!hidden": u === !1 || q,
2244
+ "!hidden": u === !1 || V,
2249
2245
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2250
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !q && we,
2246
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": u !== !1 && !V && ie,
2251
2247
  // Show on mobile when no channel selected, use same wide width on desktop
2252
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !q && !we
2248
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": u !== !1 && !V && !ie
2253
2249
  }
2254
2250
  ),
2255
2251
  children: /* @__PURE__ */ e(
2256
- ot,
2252
+ it,
2257
2253
  {
2258
- onChannelSelect: Ne,
2254
+ onChannelSelect: Ce,
2259
2255
  selectedChannel: W || void 0,
2260
- filters: Ce,
2261
- channelRenderFilterFn: C,
2262
- customEmptyStateIndicator: E,
2263
- renderMessagePreview: R
2256
+ filters: xe,
2257
+ channelRenderFilterFn: g,
2258
+ customEmptyStateIndicator: v,
2259
+ renderMessagePreview: D
2264
2260
  }
2265
2261
  )
2266
2262
  }
@@ -2272,79 +2268,76 @@ const mn = ({
2272
2268
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2273
2269
  {
2274
2270
  // In direct conversation mode (or waiting for it), always show (full width)
2275
- flex: q || we || a,
2271
+ flex: V || ie || r,
2276
2272
  // Normal mode: hide on mobile when no channel selected
2277
- "hidden lg:flex": !q && !we && !a
2273
+ "hidden lg:flex": !V && !ie && !r
2278
2274
  }
2279
2275
  ),
2280
2276
  children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2281
- ct,
2277
+ ht,
2282
2278
  {
2283
2279
  channel: W,
2284
- onBack: ye,
2285
- showBackButton: !q,
2280
+ onBack: pe,
2281
+ showBackButton: !V,
2286
2282
  renderMessageInputActions: n,
2287
2283
  renderConversationFooter: o,
2288
- renderChannelBanner: g,
2289
- onLeaveConversation: ut,
2290
- onBlockParticipant: ht,
2291
- CustomChannelEmptyState: f,
2292
- showDeleteConversation: be,
2293
- onDeleteConversationClick: h,
2294
- onBlockParticipantClick: p,
2295
- onReportParticipantClick: v,
2296
- dmAgentEnabled: r,
2284
+ renderChannelBanner: f,
2285
+ onLeaveConversation: ve,
2286
+ onBlockParticipant: we,
2287
+ CustomChannelEmptyState: h,
2288
+ showDeleteConversation: De,
2289
+ onDeleteConversationClick: a,
2290
+ onBlockParticipantClick: w,
2291
+ onReportParticipantClick: N,
2292
+ dmAgentEnabled: x,
2297
2293
  messageMetadata: M,
2298
- onMessageSent: S,
2299
- showStarButton: N,
2300
- chatbotVotingEnabled: w,
2301
- customProfileContent: m,
2302
- customChannelActions: y,
2303
- renderMessage: b,
2304
- onAttachmentUnlockClick: _,
2305
- onAttachmentDownloadClick: k,
2306
- onAttachmentUnlocked: Y
2294
+ onMessageSent: k,
2295
+ showStarButton: S,
2296
+ chatbotVotingEnabled: I,
2297
+ customProfileContent: d,
2298
+ customChannelActions: C,
2299
+ renderMessage: _
2307
2300
  },
2308
2301
  W.id
2309
- ) }) : a ? (
2302
+ ) }) : r ? (
2310
2303
  // Show loading while creating/loading direct conversation channel
2311
2304
  /* @__PURE__ */ e(Ie, {})
2312
2305
  ) : /* @__PURE__ */ e(
2313
- dt,
2306
+ ft,
2314
2307
  {
2315
2308
  hasChannels: de,
2316
- channelsLoaded: L
2309
+ channelsLoaded: te
2317
2310
  }
2318
2311
  )
2319
2312
  }
2320
2313
  )
2321
2314
  ] }),
2322
- fe && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2315
+ be && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
2323
2316
  /* @__PURE__ */ e(
2324
2317
  "dialog",
2325
2318
  {
2326
2319
  ref: ae,
2327
2320
  className: "mes-dialog",
2328
- onClick: mt,
2329
- onClose: ve,
2321
+ onClick: ye,
2322
+ onClose: le,
2330
2323
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2331
- Qs,
2324
+ sn,
2332
2325
  {
2333
- participantSource: fe,
2334
- onSelectParticipant: pe,
2335
- onClose: ve,
2336
- existingParticipantIds: xe,
2337
- participantLabel: ge,
2338
- searchPlaceholder: `Search ${ge}...`
2326
+ participantSource: be,
2327
+ onSelectParticipant: Ne,
2328
+ onClose: le,
2329
+ existingParticipantIds: B,
2330
+ participantLabel: re,
2331
+ searchPlaceholder: `Search ${re}...`
2339
2332
  },
2340
- re
2333
+ se
2341
2334
  ) })
2342
2335
  }
2343
2336
  )
2344
2337
  ]
2345
2338
  }
2346
2339
  );
2347
- }, tn = ({
2340
+ }, an = ({
2348
2341
  question: t,
2349
2342
  onClick: s,
2350
2343
  loading: n = !1,
@@ -2366,23 +2359,23 @@ const mn = ({
2366
2359
  ),
2367
2360
  children: t
2368
2361
  }
2369
- ), un = ({
2362
+ ), xn = ({
2370
2363
  faqs: t,
2371
2364
  onFaqClick: s,
2372
2365
  loadingFaqId: n,
2373
2366
  headerText: o,
2374
2367
  className: l,
2375
- avatarImage: d,
2376
- avatarName: a
2368
+ avatarImage: m,
2369
+ avatarName: r
2377
2370
  }) => {
2378
- const c = t.filter((f) => f.enabled).sort((f, u) => (f.order ?? 0) - (u.order ?? 0));
2371
+ const c = t.filter((h) => h.enabled).sort((h, u) => (h.order ?? 0) - (u.order ?? 0));
2379
2372
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2380
- (d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2373
+ (m || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2381
2374
  ce,
2382
2375
  {
2383
- id: a || "account",
2384
- name: a || "Account",
2385
- image: d,
2376
+ id: r || "account",
2377
+ name: r || "Account",
2378
+ image: m,
2386
2379
  size: 24,
2387
2380
  shape: "circle"
2388
2381
  }
@@ -2394,76 +2387,78 @@ const mn = ({
2394
2387
  style: { backgroundColor: "#F1F0EE" },
2395
2388
  children: [
2396
2389
  o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2397
- c.map((f) => /* @__PURE__ */ e(
2398
- tn,
2390
+ c.map((h) => /* @__PURE__ */ e(
2391
+ an,
2399
2392
  {
2400
- question: f.question,
2401
- onClick: () => s(f.id),
2402
- loading: n === f.id
2393
+ question: h.question,
2394
+ onClick: () => s(h.id),
2395
+ loading: n === h.id
2403
2396
  },
2404
- f.id
2397
+ h.id
2405
2398
  ))
2406
2399
  ]
2407
2400
  }
2408
2401
  )
2409
2402
  ] }) });
2410
- }, hn = (t, s = {}) => {
2411
- const { initialSearch: n = "", pageSize: o = 20 } = s, [l, d] = T([]), [a, c] = T(!1), [f, u] = T(null), [x, C] = T(n), [E, h] = T(!0), [p, v] = T(), r = U(async (w = !1, R) => {
2412
- if (a) return;
2413
- const g = R !== void 0 ? R : x;
2403
+ }, bn = (t, s = {}) => {
2404
+ const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = T([]), [r, c] = T(!1), [h, u] = T(null), [b, g] = T(n), [v, a] = T(!0), [w, N] = T(), x = R(async (I = !1, D) => {
2405
+ if (r) return;
2406
+ const f = D !== void 0 ? D : b;
2414
2407
  c(!0), u(null);
2415
2408
  try {
2416
- const m = await t.loadParticipants({
2417
- search: g || void 0,
2409
+ const d = await t.loadParticipants({
2410
+ search: f || void 0,
2418
2411
  limit: o,
2419
- cursor: w ? void 0 : p
2412
+ cursor: I ? void 0 : w
2420
2413
  });
2421
- d(
2422
- (y) => w ? m.participants : [...y, ...m.participants]
2423
- ), h(m.hasMore), v(m.nextCursor);
2424
- } catch (m) {
2425
- const y = m instanceof Error ? m.message : "Failed to load participants";
2426
- u(y), console.error("[useParticipants] Load error:", m);
2414
+ m(
2415
+ (C) => I ? d.participants : [...C, ...d.participants]
2416
+ ), a(d.hasMore), N(d.nextCursor);
2417
+ } catch (d) {
2418
+ const C = d instanceof Error ? d.message : "Failed to load participants";
2419
+ u(C), console.error("[useParticipants] Load error:", d);
2427
2420
  } finally {
2428
2421
  c(!1);
2429
2422
  }
2430
- }, [t, x, p, o, a]), M = U(() => {
2431
- E && !a && r(!1);
2432
- }, [E, a, r]), S = U((w) => {
2433
- C(w), v(void 0), r(!0, w);
2434
- }, [r]), N = U(() => {
2435
- v(void 0), r(!0);
2436
- }, [r]);
2437
- return X(() => {
2438
- r(!0);
2423
+ }, [t, b, w, o, r]), M = R(() => {
2424
+ v && !r && x(!1);
2425
+ }, [v, r, x]), k = R((I) => {
2426
+ g(I), N(void 0), x(!0, I);
2427
+ }, [x]), S = R(() => {
2428
+ N(void 0), x(!0);
2429
+ }, [x]);
2430
+ return Z(() => {
2431
+ x(!0);
2439
2432
  }, [t.loadParticipants]), {
2440
2433
  participants: l,
2441
- loading: a,
2442
- error: f,
2443
- searchQuery: x,
2444
- hasMore: E,
2434
+ loading: r,
2435
+ error: h,
2436
+ searchQuery: b,
2437
+ hasMore: v,
2445
2438
  totalCount: t.totalCount,
2446
2439
  loadMore: M,
2447
- search: S,
2448
- refresh: N
2440
+ search: k,
2441
+ refresh: S
2449
2442
  };
2450
2443
  };
2451
2444
  export {
2452
2445
  _e as ActionButton,
2453
2446
  ce as Avatar,
2454
- qs as ChannelEmptyState,
2455
- ot as ChannelList,
2456
- ct as ChannelView,
2457
- un as FaqList,
2458
- tn as FaqListItem,
2459
- Is as LockedAttachment,
2460
- Ts as MessageVoteButtons,
2461
- dn as MessagingProvider,
2462
- mn as MessagingShell,
2463
- Qs as ParticipantPicker,
2464
- us as formatRelativeTime,
2465
- _s as useMessageVote,
2466
- ls as useMessaging,
2467
- hn as useParticipants
2447
+ Xs as ChannelEmptyState,
2448
+ it as ChannelList,
2449
+ ht as ChannelView,
2450
+ fn as CustomMessageProvider,
2451
+ xn as FaqList,
2452
+ an as FaqListItem,
2453
+ Je as LockedAttachment,
2454
+ As as MessageVoteButtons,
2455
+ hn as MessagingProvider,
2456
+ gn as MessagingShell,
2457
+ sn as ParticipantPicker,
2458
+ ms as formatRelativeTime,
2459
+ Ts as useCustomMessage,
2460
+ ws as useMessageVote,
2461
+ os as useMessaging,
2462
+ bn as useParticipants
2468
2463
  };
2469
2464
  //# sourceMappingURL=index.js.map