@linktr.ee/messaging-react 1.25.0-rc-1774238116 โ†’ 1.25.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.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as e, jsxs as i, Fragment as me } from "react/jsx-runtime";
2
- import D from "classnames";
3
- import $, { createContext as ot, useContext as lt, useCallback as P, useState as k, useRef as Q, useEffect as X, useMemo as _e } from "react";
4
- import { StreamChatService as it } from "@linktr.ee/messaging-core";
5
- import { Chat as ct, ChannelList as dt, DateSeparator as ut, useChannelStateContext as Me, useChatContext as $e, areMessageUIPropsEqual as mt, useMessageReminder as ht, useComponentContext as ft, Attachment as gt, EditMessageModal as xt, MessageBlocked as bt, MessageBouncePrompt as Ct, MessageDeleted as Nt, MessageIsThreadReplyInChannelButtonIndicator as vt, MessageRepliesCountButton as wt, ReminderNotification as pt, StreamedMessageText as yt, messageHasAttachments as _t, messageHasReactions as Et, isDateSeparatorMessage as It, isMessageBlocked as St, isMessageBounced as Mt, MessageBounceModal as kt, Poll as Tt, MessageText as Dt, MessageErrorIcon as Rt, useMessageContext as je, useMessageComposer as Lt, useStateStore as Pt, MessageInput as Ut, useMessageInputContext as Ot, useMessageComposerHasSendableData as Ft, SimpleAttachmentSelector as At, QuotedMessagePreview as Bt, AttachmentPreviewList as $t, TextareaComposer as jt, MessageTimestamp as Re, Channel as Gt, WithComponents as zt, Window as Vt, MessageList as Ht } from "stream-chat-react";
6
- import { StarIcon as Ee, GiftIcon as Wt, XIcon as ke, SpinnerGapIcon as be, SignOutIcon as qt, ProhibitInsetIcon as Le, FlagIcon as Yt, ArrowUpIcon as Zt, SparkleIcon as Jt, ArrowLeftIcon as Pe, DotsThreeIcon as Ue, MagnifyingGlassIcon as Qt, ChatCircleDotsIcon as Oe } from "@phosphor-icons/react";
2
+ import R from "classnames";
3
+ import B, { createContext as lt, useContext as it, useCallback as P, useState as T, useRef as Q, useEffect as X, useMemo as _e } from "react";
4
+ import { StreamChatService as ct } from "@linktr.ee/messaging-core";
5
+ import { Chat as dt, ChannelList as ut, DateSeparator as mt, useChannelStateContext as Me, useChatContext as $e, areMessageUIPropsEqual as ht, useMessageReminder as ft, useComponentContext as gt, Attachment as xt, EditMessageModal as bt, MessageBlocked as Ct, MessageBouncePrompt as Nt, MessageDeleted as vt, MessageIsThreadReplyInChannelButtonIndicator as wt, MessageRepliesCountButton as pt, ReminderNotification as yt, StreamedMessageText as _t, messageHasAttachments as Et, messageHasReactions as St, isDateSeparatorMessage as It, isMessageBlocked as Mt, isMessageBounced as kt, MessageBounceModal as Tt, Poll as Dt, MessageText as Rt, MessageErrorIcon as Lt, useMessageContext as je, useMessageComposer as Pt, useStateStore as Ut, MessageInput as Ot, useMessageInputContext as Ft, useMessageComposerHasSendableData as At, SimpleAttachmentSelector as Bt, QuotedMessagePreview as $t, AttachmentPreviewList as jt, TextareaComposer as Gt, MessageTimestamp as Re, Channel as zt, WithComponents as Vt, Window as Ht, MessageList as Wt } from "stream-chat-react";
6
+ import { StarIcon as Ee, GiftIcon as qt, XIcon as ke, SpinnerGapIcon as be, SignOutIcon as Yt, ProhibitInsetIcon as Le, FlagIcon as Zt, ArrowUpIcon as Jt, SparkleIcon as Qt, ArrowLeftIcon as Pe, DotsThreeIcon as Ue, MagnifyingGlassIcon as Xt, ChatCircleDotsIcon as Oe } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as Fe } from "stream-chat";
8
- const Ge = ot({
8
+ const Ge = lt({
9
9
  service: null,
10
10
  client: null,
11
11
  isConnected: !1,
@@ -15,7 +15,7 @@ const Ge = ot({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), ve = () => lt(Ge), Vs = ({
18
+ }), ve = () => it(Ge), Hs = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
@@ -23,191 +23,191 @@ const Ge = ot({
23
23
  capabilities: l = {},
24
24
  debug: m = !1
25
25
  }) => {
26
- const r = P(
26
+ const a = P(
27
27
  (u, ...N) => {
28
28
  m && console.log(`๐Ÿ”ฅ [MessagingProvider] ${u}`, ...N);
29
29
  },
30
30
  [m]
31
31
  );
32
- r("๐Ÿ”„ RENDER START", {
32
+ a("๐Ÿ”„ 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, x] = k(null), [h, b] = k(null), [g, _] = k(!1), [a, E] = k(!1), [I, C] = k(null), M = Q(!1), p = Q({
38
+ const [c, g] = T(null), [h, b] = T(null), [x, w] = T(!1), [r, y] = T(!1), [_, C] = T(null), M = Q(!1), E = Q({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: o,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), v = Q(0);
44
- v.current++, r("๐Ÿ“Š RENDER INFO", {
45
- renderCount: v.current,
43
+ }), p = Q(0);
44
+ p.current++, a("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: p.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: p.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: p.current.apiKey !== o,
50
- serviceConfigChanged: p.current.serviceConfig !== n,
51
- capabilitiesChanged: p.current.capabilities !== l
48
+ userChanged: E.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: E.current.apiKey !== o,
50
+ serviceConfigChanged: E.current.serviceConfig !== n,
51
+ capabilitiesChanged: E.current.capabilities !== l
52
52
  }
53
- }), p.current = {
53
+ }), E.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: o,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
58
  }, X(() => {
59
- const u = v.current;
60
- if (r("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
59
+ const u = p.current;
60
+ if (a("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
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: p.current.serviceConfig === n,
68
- apiKeyStable: p.current.apiKey === o
67
+ serviceConfigStable: E.current.serviceConfig === n,
68
+ apiKeyStable: E.current.apiKey === o
69
69
  }
70
70
  }), !o || !n) {
71
- r("โš ๏ธ SERVICE INIT SKIPPED", {
71
+ a("โš ๏ธ SERVICE INIT SKIPPED", {
72
72
  renderCount: u,
73
73
  reason: "Missing apiKey or serviceConfig"
74
74
  });
75
75
  return;
76
76
  }
77
- r("๐Ÿš€ CREATING NEW SERVICE", {
77
+ a("๐Ÿš€ CREATING NEW SERVICE", {
78
78
  renderCount: u,
79
79
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
- serviceConfigChanged: p.current.serviceConfig !== n
80
+ serviceConfigChanged: E.current.serviceConfig !== n
81
81
  });
82
- const N = new it({
82
+ const N = new ct({
83
83
  ...n,
84
84
  apiKey: o,
85
85
  debug: m
86
86
  });
87
- return x(N), r("โœ… SERVICE SET", {
87
+ return g(N), a("โœ… SERVICE SET", {
88
88
  renderCount: u,
89
89
  serviceInstance: !!N
90
90
  }), () => {
91
- r("๐Ÿงน SERVICE CLEANUP", {
91
+ a("๐Ÿงน SERVICE CLEANUP", {
92
92
  renderCount: u,
93
93
  reason: "Effect cleanup"
94
94
  }), N.disconnectUser().catch(console.error);
95
95
  };
96
- }, [o, n, m, r]);
97
- const w = Q(null);
96
+ }, [o, n, m, a]);
97
+ const S = Q(null);
98
98
  X(() => {
99
- var N, U;
100
- if (r("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
99
+ var N, v;
100
+ if (a("๐Ÿ”— 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: g,
105
+ isConnected: x,
106
106
  dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
107
  }), !c || !s) {
108
- r("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
108
+ a("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
111
  if (M.current) {
112
- r("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
112
+ a("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((N = w.current) == null ? void 0 : N.serviceId) === c && ((U = w.current) == null ? void 0 : U.userId) === s.id) {
116
- r(
115
+ if (((N = S.current) == null ? void 0 : N.serviceId) === c && ((v = S.current) == null ? void 0 : v.userId) === s.id) {
116
+ a(
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
- r("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), M.current = !0, E(!0), C(null);
123
+ a("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), M.current = !0, y(!0), C(null);
124
124
  try {
125
- r("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
125
+ a("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
126
  const f = await c.connectUser(s);
127
- b(f), _(!0), w.current = { serviceId: c, userId: s.id }, r("โœ… USER CONNECTION SUCCESS", {
127
+ b(f), w(!0), S.current = { serviceId: c, userId: s.id }, a("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: f.userID
130
130
  });
131
131
  } catch (f) {
132
- const y = f instanceof Error ? f.message : "Connection failed";
133
- C(y), r("โŒ USER CONNECTION ERROR", {
132
+ const k = f instanceof Error ? f.message : "Connection failed";
133
+ C(k), a("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
- error: y
135
+ error: k
136
136
  });
137
137
  } finally {
138
- E(!1), M.current = !1, r("๐Ÿ”„ USER CONNECTION FINISHED", {
138
+ y(!1), M.current = !1, a("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: g
140
+ isConnected: x
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, r, g]), X(() => (r("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, a, x]), X(() => (a("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
- isConnected: g
146
+ isConnected: x
147
147
  }), () => {
148
- c && g ? (r(
148
+ c && x ? (a(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), w.current = null, c.disconnectUser().catch(console.error)) : r("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
151
+ ), S.current = null, c.disconnectUser().catch(console.error)) : a("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!c,
153
- isConnected: g
153
+ isConnected: x
154
154
  });
155
- }), [c, g, r]);
156
- const R = P(async () => {
157
- if (r("๐Ÿ”„ REFRESH CONNECTION CALLED", {
155
+ }), [c, x, a]);
156
+ const L = P(async () => {
157
+ if (a("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
159
159
  hasUser: !!s
160
160
  }), !c || !s) {
161
- r("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
161
+ a("โš ๏ธ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
- r("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), E(!0);
164
+ a("๐Ÿš€ STARTING CONNECTION REFRESH", { userId: s.id }), y(!0);
165
165
  try {
166
- r("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("๐Ÿ“ž RECONNECTING FOR REFRESH");
166
+ a("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
167
  const u = await c.connectUser(s);
168
- b(u), _(!0), C(null), r("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
168
+ b(u), w(!0), C(null), a("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (u) {
170
170
  const N = u instanceof Error ? u.message : "Refresh failed";
171
- C(N), r("โŒ CONNECTION REFRESH ERROR", {
171
+ C(N), a("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
173
  error: N
174
174
  });
175
175
  } finally {
176
- E(!1), r("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
176
+ y(!1), a("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, r]), d = $.useMemo(() => (r("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, a]), d = B.useMemo(() => (a("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
180
  hasClient: !!h,
181
- isConnected: g,
182
- isLoading: a,
183
- hasError: !!I,
181
+ isConnected: x,
182
+ isLoading: r,
183
+ hasError: !!_,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: c,
187
187
  client: h,
188
- isConnected: g,
189
- isLoading: a,
190
- error: I,
188
+ isConnected: x,
189
+ isLoading: r,
190
+ error: _,
191
191
  capabilities: l,
192
- refreshConnection: R,
192
+ refreshConnection: L,
193
193
  debug: m
194
194
  }), [
195
195
  c,
196
196
  h,
197
- g,
198
- a,
199
- I,
197
+ x,
198
+ r,
199
+ _,
200
200
  l,
201
- R,
201
+ L,
202
202
  m,
203
- r
203
+ a
204
204
  ]);
205
- return r("๐Ÿ”„ RENDER END", {
206
- renderCount: v.current,
207
- willRenderChat: !!(h && g),
205
+ return a("๐Ÿ”„ RENDER END", {
206
+ renderCount: p.current,
207
+ willRenderChat: !!(h && x),
208
208
  contextValueReady: !!d
209
- }), /* @__PURE__ */ e(Ge.Provider, { value: d, children: h && g ? /* @__PURE__ */ e(
210
- ct,
209
+ }), /* @__PURE__ */ e(Ge.Provider, { value: d, children: h && x ? /* @__PURE__ */ e(
210
+ dt,
211
211
  {
212
212
  client: h,
213
213
  customClasses: {
@@ -216,24 +216,46 @@ const Ge = ot({
216
216
  children: t
217
217
  }
218
218
  ) : t });
219
- }, Xt = () => ve(), ze = $.createContext({
219
+ }, Kt = () => ve(), ze = B.createContext({
220
220
  selectedChannel: void 0,
221
221
  onChannelSelect: () => {
222
222
  },
223
223
  debug: !1,
224
224
  renderMessagePreview: void 0
225
- }), Kt = ze.Provider, es = () => $.useContext(ze), ts = (t, s) => {
225
+ }), es = ze.Provider, ts = () => B.useContext(ze), Ve = (t) => {
226
+ var o, l;
227
+ const [s, n] = T(
228
+ !!((l = (o = t == null ? void 0 : t.state) == null ? void 0 : o.membership) != null && l.pinned_at)
229
+ );
230
+ return X(() => {
231
+ var a;
232
+ if (!t) {
233
+ n(!1);
234
+ return;
235
+ }
236
+ n(!!((a = t.state.membership) != null && a.pinned_at));
237
+ const m = (c) => {
238
+ var g;
239
+ n(
240
+ c != null && c.member ? !!c.member.pinned_at : !!((g = t.state.membership) != null && g.pinned_at)
241
+ );
242
+ };
243
+ return t.on("member.updated", m), () => {
244
+ t.off("member.updated", m);
245
+ };
246
+ }, [t]), s;
247
+ }, ss = (t, s) => {
226
248
  const n = new Date(
227
249
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
228
250
  ), l = new Date(
229
251
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
230
252
  ).getTime() - n.getTime();
231
253
  return Math.floor(l / (1e3 * 60 * 60 * 24));
232
- }, ss = (t) => {
254
+ }, ns = (t) => {
233
255
  const s = /* @__PURE__ */ new Date();
234
256
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
235
257
  return "Just now";
236
- const o = ts(t, s);
258
+ const o = ss(t, s);
237
259
  return o === 0 ? t.toLocaleTimeString([], {
238
260
  hour: "numeric",
239
261
  minute: "2-digit",
@@ -271,7 +293,7 @@ const Ge = ot({
271
293
  "๐Ÿˆ"
272
294
  // Melon
273
295
  ];
274
- function ns(t) {
296
+ function as(t) {
275
297
  let s = 0;
276
298
  for (let n = 0; n < t.length; n++) {
277
299
  const o = t.charCodeAt(n);
@@ -279,8 +301,8 @@ function ns(t) {
279
301
  }
280
302
  return Math.abs(s);
281
303
  }
282
- function as(t) {
283
- const n = ns(t) % Ae.length;
304
+ function rs(t) {
305
+ const n = as(t) % Ae.length;
284
306
  return Ae[n];
285
307
  }
286
308
  const se = ({
@@ -291,14 +313,14 @@ const se = ({
291
313
  starred: l = !1,
292
314
  shape: m = "squircle"
293
315
  }) => {
294
- const r = as(t), x = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = m === "circle" ? { borderRadius: "50%" } : {
316
+ const a = rs(t), g = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", h = m === "circle" ? { borderRadius: "50%" } : {
295
317
  borderRadius: "33%",
296
318
  "corner-shape": "superellipse(1.3)"
297
319
  };
298
320
  return /* @__PURE__ */ i(
299
321
  "div",
300
322
  {
301
- className: D("relative flex-shrink-0", o),
323
+ className: R("relative flex-shrink-0", o),
302
324
  style: {
303
325
  width: `${n}px`,
304
326
  height: `${n}px`
@@ -323,17 +345,17 @@ const se = ({
323
345
  "div",
324
346
  {
325
347
  "aria-hidden": "true",
326
- className: D(
348
+ className: R(
327
349
  "avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
328
- x
350
+ g
329
351
  ),
330
- children: r
352
+ children: a
331
353
  }
332
354
  ) })
333
355
  ]
334
356
  }
335
357
  );
336
- }, rs = ({ size: t = 15 }) => /* @__PURE__ */ e(
358
+ }, os = ({ size: t = 15 }) => /* @__PURE__ */ e(
337
359
  "svg",
338
360
  {
339
361
  width: t,
@@ -350,81 +372,81 @@ const se = ({
350
372
  }
351
373
  )
352
374
  }
353
- ), os = (t) => {
375
+ ), ls = (t) => {
354
376
  var s;
355
377
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_TIP";
356
- }, ls = (t) => {
378
+ }, is = (t) => {
357
379
  var s;
358
380
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_PAID";
359
381
  }, Te = (t) => {
360
382
  var s;
361
383
  return ((s = t.metadata) == null ? void 0 : s.custom_type) === "MESSAGE_CHATBOT";
362
- }, Ve = (t) => os(t) || ls(t), is = (t) => {
384
+ }, He = (t) => ls(t) || is(t), cs = (t) => {
363
385
  var s;
364
- return Ve(t) && !((s = t.text) != null && s.trim());
386
+ return He(t) && !((s = t.text) != null && s.trim());
365
387
  }, ye = ({
366
388
  message: t,
367
389
  standalone: s = !1,
368
390
  isMyMessage: n = !1,
369
391
  hasAttachment: o = !1
370
392
  }) => {
371
- var g;
372
- const l = Ve(t), m = Te(t);
393
+ var x;
394
+ const l = He(t), m = Te(t);
373
395
  if (!l && !m)
374
396
  return null;
375
397
  if (l) {
376
- const _ = (g = t.metadata) == null ? void 0 : g.amount_text;
377
- if (!_) return null;
378
- const a = s ? "message-tip-standalone" : "message-tag message-tag--tip", E = s ? `${_} tip` : `Delivered with ${_} tip`;
379
- return /* @__PURE__ */ i("div", { className: a, children: [
380
- /* @__PURE__ */ e(Wt, { size: s ? 14 : 12 }),
381
- /* @__PURE__ */ e("span", { children: E })
398
+ const w = (x = t.metadata) == null ? void 0 : x.amount_text;
399
+ if (!w) return null;
400
+ const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", y = s ? `${w} tip` : `Delivered with ${w} tip`;
401
+ return /* @__PURE__ */ i("div", { className: r, children: [
402
+ /* @__PURE__ */ e(qt, { size: s ? 14 : 12 }),
403
+ /* @__PURE__ */ e("span", { children: y })
382
404
  ] });
383
405
  }
384
- const r = n && o, c = r ? "Sent with AI" : "Sent with DM Agent", x = [
406
+ const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
385
407
  "message-chatbot-indicator",
386
408
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
387
- r ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
388
- ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(rs, { size: r ? 12 : 15 }) });
389
- return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !r ? /* @__PURE__ */ i(me, { children: [
409
+ a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
410
+ ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(os, { size: a ? 12 : 15 }) });
411
+ return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(me, { children: [
390
412
  h,
391
413
  b
392
414
  ] }) : /* @__PURE__ */ i(me, { children: [
393
415
  b,
394
416
  h
395
417
  ] }) });
396
- }, He = $.memo(
418
+ }, We = B.memo(
397
419
  ({ channel: t, unread: s }) => {
398
- var R, d, u, N, U;
399
- const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } = es(), r = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
420
+ var L, d, u, N;
421
+ const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } = ts(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
400
422
  t && o(t);
401
- }, x = (f) => {
402
- const y = f.key === "Enter" || f.key === " ", L = f.repeat;
403
- !y || L || (f.preventDefault(), c());
404
- }, b = Object.values(((R = t == null ? void 0 : t.state) == null ? void 0 : R.members) || {}).find(
405
- (f) => {
406
- var y, L;
407
- return ((y = f.user) == null ? void 0 : y.id) && f.user.id !== ((L = t == null ? void 0 : t._client) == null ? void 0 : L.userID);
423
+ }, g = (v) => {
424
+ const f = v.key === "Enter" || v.key === " ", k = v.repeat;
425
+ !f || k || (v.preventDefault(), c());
426
+ }, b = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
427
+ (v) => {
428
+ var f, k;
429
+ return ((f = v.user) == null ? void 0 : f.id) && v.user.id !== ((k = t == null ? void 0 : t._client) == null ? void 0 : k.userID);
408
430
  }
409
- ), g = ((d = b == null ? void 0 : b.user) == null ? void 0 : d.name) || "Conversation", _ = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, a = (() => {
410
- var y;
411
- const f = (y = t == null ? void 0 : t.state) == null ? void 0 : y.messages;
412
- if (f != null && f.length) {
413
- for (let L = f.length - 1; L >= 0; L--)
414
- if (f[L].type !== "system") return f[L];
431
+ ), x = ((d = b == null ? void 0 : b.user) == null ? void 0 : d.name) || "Conversation", w = (u = b == null ? void 0 : b.user) == null ? void 0 : u.image, r = (() => {
432
+ var f;
433
+ const v = (f = t == null ? void 0 : t.state) == null ? void 0 : f.messages;
434
+ if (v != null && v.length) {
435
+ for (let k = v.length - 1; k >= 0; k--)
436
+ if (v[k].type !== "system") return v[k];
415
437
  }
416
- })(), I = (() => {
417
- var L, G;
418
- if (a != null && a.text) return a.text;
419
- if (((L = a == null ? void 0 : a.metadata) == null ? void 0 : L.custom_type) === "MESSAGE_TIP") return "๐Ÿ’ต Sent a tip";
420
- const y = (G = a == null ? void 0 : a.attachments) == null ? void 0 : G[0];
421
- 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";
422
- })(), C = a != null && a.created_at ? ss(new Date(a.created_at)) : "", M = a ? Te(a) : !1, p = m ? m(a, I) : `${M ? "โœจ " : ""}${I}`, v = !!((N = t.state.membership) != null && N.pinned_at), w = s ?? 0;
438
+ })(), _ = (() => {
439
+ var k, H;
440
+ if (r != null && r.text) return r.text;
441
+ if (((k = r == null ? void 0 : r.metadata) == null ? void 0 : k.custom_type) === "MESSAGE_TIP") return "๐Ÿ’ต Sent a tip";
442
+ const f = (H = r == null ? void 0 : r.attachments) == null ? void 0 : H[0];
443
+ return f ? f.og_scrape_url ? f.og_scrape_url : f.type === "image" ? "๐Ÿ“ท Sent an image" : f.type === "video" ? "๐ŸŽฅ Sent a video" : f.type === "audio" ? "๐ŸŽต Sent audio" : f.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
444
+ })(), C = r != null && r.created_at ? ns(new Date(r.created_at)) : "", M = r ? Te(r) : !1, E = m ? m(r, _) : `${M ? "โœจ " : ""}${_}`, p = Ve(t), S = s ?? 0;
423
445
  return l && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
424
446
  channelId: t == null ? void 0 : t.id,
425
- isSelected: r,
426
- participantName: g,
427
- unreadCount: w,
447
+ isSelected: a,
448
+ participantName: x,
449
+ unreadCount: S,
428
450
  hasTimestamp: !!C
429
451
  }), /* @__PURE__ */ e(
430
452
  "div",
@@ -432,23 +454,23 @@ const se = ({
432
454
  role: "button",
433
455
  tabIndex: 0,
434
456
  onClick: c,
435
- onKeyDown: x,
436
- className: D(
457
+ onKeyDown: g,
458
+ className: R(
437
459
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
438
460
  {
439
- "bg-primary-alt/10 border-l-4 border-l-primary": r,
440
- "hover:bg-sand": !r
461
+ "bg-primary-alt/10 border-l-4 border-l-primary": a,
462
+ "hover:bg-sand": !a
441
463
  }
442
464
  ),
443
465
  children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
444
466
  /* @__PURE__ */ e(
445
467
  se,
446
468
  {
447
- id: ((U = b == null ? void 0 : b.user) == null ? void 0 : U.id) || t.id || "unknown",
448
- name: g,
449
- image: _,
469
+ id: ((N = b == null ? void 0 : b.user) == null ? void 0 : N.id) || t.id || "unknown",
470
+ name: x,
471
+ image: w,
450
472
  size: 44,
451
- starred: v,
473
+ starred: p,
452
474
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
453
475
  }
454
476
  ),
@@ -457,21 +479,21 @@ const se = ({
457
479
  /* @__PURE__ */ i(
458
480
  "h3",
459
481
  {
460
- className: D(
482
+ className: R(
461
483
  "text-sm font-medium truncate",
462
- r ? "text-primary" : "text-charcoal"
484
+ a ? "text-primary" : "text-charcoal"
463
485
  ),
464
486
  children: [
465
- v && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
466
- g
487
+ p && /* @__PURE__ */ e("span", { className: "sr-only", children: "Starred conversation. " }),
488
+ x
467
489
  ]
468
490
  }
469
491
  ),
470
492
  C && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: C })
471
493
  ] }),
472
494
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
473
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: p }),
474
- 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 })
495
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: E }),
496
+ S > 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: S > 99 ? "99+" : S })
475
497
  ] })
476
498
  ] })
477
499
  ] })
@@ -479,8 +501,8 @@ const se = ({
479
501
  );
480
502
  }
481
503
  );
482
- He.displayName = "CustomChannelPreview";
483
- const cs = { last_message_at: -1 }, We = $.memo(
504
+ We.displayName = "CustomChannelPreview";
505
+ const ds = { last_message_at: -1 }, qe = B.memo(
484
506
  ({
485
507
  onChannelSelect: t,
486
508
  selectedChannel: s,
@@ -488,54 +510,54 @@ const cs = { last_message_at: -1 }, We = $.memo(
488
510
  allowNewMessagesFromUnfilteredChannels: o = !1,
489
511
  onMessageNew: l,
490
512
  onAddedToChannel: m,
491
- sort: r = cs,
513
+ sort: a = ds,
492
514
  className: c,
493
- customEmptyStateIndicator: x,
515
+ customEmptyStateIndicator: g,
494
516
  renderMessagePreview: h
495
517
  }) => {
496
- const b = $.useRef(0);
518
+ const b = B.useRef(0);
497
519
  b.current++;
498
- const { debug: g = !1 } = ve();
499
- g && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
520
+ const { debug: x = !1 } = ve();
521
+ x && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
500
522
  renderCount: b.current,
501
523
  selectedChannelId: s == null ? void 0 : s.id,
502
524
  filters: n
503
525
  });
504
- const _ = $.useMemo(
526
+ const w = B.useMemo(
505
527
  () => ({
506
528
  selectedChannel: s,
507
529
  onChannelSelect: t,
508
- debug: g,
530
+ debug: x,
509
531
  renderMessagePreview: h
510
532
  }),
511
- [s, t, g, h]
533
+ [s, t, x, h]
512
534
  );
513
535
  return /* @__PURE__ */ e(
514
536
  "div",
515
537
  {
516
- className: D(
538
+ className: R(
517
539
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
518
540
  c
519
541
  ),
520
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Kt, { value: _, children: /* @__PURE__ */ e(
521
- dt,
542
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(es, { value: w, children: /* @__PURE__ */ e(
543
+ ut,
522
544
  {
523
545
  filters: n,
524
- sort: r,
546
+ sort: a,
525
547
  options: { limit: 30 },
526
548
  allowNewMessagesFromUnfilteredChannels: o,
527
549
  onMessageNew: l,
528
550
  onAddedToChannel: m,
529
- Preview: He,
530
- EmptyStateIndicator: x
551
+ Preview: We,
552
+ EmptyStateIndicator: g
531
553
  },
532
- `${JSON.stringify(n)}:${JSON.stringify(r)}`
554
+ `${JSON.stringify(n)}:${JSON.stringify(a)}`
533
555
  ) }) })
534
556
  }
535
557
  );
536
558
  }
537
559
  );
538
- We.displayName = "ChannelList";
560
+ qe.displayName = "ChannelList";
539
561
  const xe = ({
540
562
  variant: t = "default",
541
563
  className: s,
@@ -545,7 +567,7 @@ const xe = ({
545
567
  "button",
546
568
  {
547
569
  type: "button",
548
- className: D(
570
+ className: R(
549
571
  "flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
550
572
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
551
573
  s
@@ -554,12 +576,12 @@ const xe = ({
554
576
  children: n
555
577
  }
556
578
  );
557
- function qe({ label: t, className: s, children: n, ...o }) {
579
+ function Ye({ label: t, className: s, children: n, ...o }) {
558
580
  return /* @__PURE__ */ i(
559
581
  "button",
560
582
  {
561
583
  type: "button",
562
- className: D(
584
+ className: R(
563
585
  "rounded-full p-2 transition-colors focus-ring",
564
586
  {
565
587
  "cursor-not-allowed opacity-50": o.disabled,
@@ -575,84 +597,84 @@ function qe({ label: t, className: s, children: n, ...o }) {
575
597
  }
576
598
  );
577
599
  }
578
- function Ye({ onClick: t }) {
579
- return /* @__PURE__ */ e(qe, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone", weight: "bold" }) });
600
+ function Ze({ onClick: t }) {
601
+ return /* @__PURE__ */ e(Ye, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ke, { className: "h-5 w-5 text-stone", weight: "bold" }) });
580
602
  }
581
- const ds = ({
603
+ const us = ({
582
604
  dialogRef: t,
583
605
  onClose: s,
584
606
  participant: n,
585
607
  channel: o,
586
608
  followerStatusLabel: l,
587
609
  onLeaveConversation: m,
588
- onBlockParticipant: r,
610
+ onBlockParticipant: a,
589
611
  showDeleteConversation: c = !0,
590
- onDeleteConversationClick: x,
612
+ onDeleteConversationClick: g,
591
613
  onBlockParticipantClick: h,
592
614
  onReportParticipantClick: b,
593
- customProfileContent: g,
594
- customChannelActions: _
615
+ customProfileContent: x,
616
+ customChannelActions: w
595
617
  }) => {
596
- var q, z, ne, ae, V, K, re;
597
- const { service: a, debug: E } = ve(), [I, C] = k(!1), [M, p] = k(!1), [v, w] = k(!1), R = P(async () => {
598
- var O;
599
- if (!(!a || !((O = n == null ? void 0 : n.user) != null && O.id)))
618
+ var W, j, ne, ae, G, K, re;
619
+ const { service: r, debug: y } = ve(), [_, C] = T(!1), [M, E] = T(!1), [p, S] = T(!1), L = P(async () => {
620
+ var U;
621
+ if (!(!r || !((U = n == null ? void 0 : n.user) != null && U.id)))
600
622
  try {
601
- const B = (await a.getBlockedUsers()).some(
602
- (H) => {
623
+ const A = (await r.getBlockedUsers()).some(
624
+ (z) => {
603
625
  var ce;
604
- return H.blocked_user_id === ((ce = n == null ? void 0 : n.user) == null ? void 0 : ce.id);
626
+ return z.blocked_user_id === ((ce = n == null ? void 0 : n.user) == null ? void 0 : ce.id);
605
627
  }
606
628
  );
607
- C(B);
608
- } catch (F) {
629
+ C(A);
630
+ } catch (O) {
609
631
  console.error(
610
632
  "[ChannelInfoDialog] Failed to check blocked status:",
611
- F
633
+ O
612
634
  );
613
635
  }
614
- }, [a, (q = n == null ? void 0 : n.user) == null ? void 0 : q.id]);
636
+ }, [r, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
615
637
  X(() => {
616
- R();
617
- }, [R]);
638
+ L();
639
+ }, [L]);
618
640
  const d = async () => {
619
- var O;
641
+ var U;
620
642
  if (!M) {
621
- x == null || x(), E && console.log("[ChannelInfoDialog] Leave conversation", o.cid), p(!0);
643
+ g == null || g(), y && console.log("[ChannelInfoDialog] Leave conversation", o.cid), E(!0);
622
644
  try {
623
- const F = ((O = o._client) == null ? void 0 : O.userID) ?? null;
624
- await o.hide(F, !1), m && await m(o), s();
625
- } catch (F) {
626
- console.error("[ChannelInfoDialog] Failed to leave conversation", F);
645
+ const O = ((U = o._client) == null ? void 0 : U.userID) ?? null;
646
+ await o.hide(O, !1), m && await m(o), s();
647
+ } catch (O) {
648
+ console.error("[ChannelInfoDialog] Failed to leave conversation", O);
627
649
  } finally {
628
- p(!1);
650
+ E(!1);
629
651
  }
630
652
  }
631
653
  }, u = async () => {
632
- var O, F, B;
633
- if (!(v || !a)) {
634
- h == null || h(), E && console.log("[ChannelInfoDialog] Block member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
654
+ var U, O, A;
655
+ if (!(p || !r)) {
656
+ h == null || h(), y && console.log("[ChannelInfoDialog] Block member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), S(!0);
635
657
  try {
636
- await a.blockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
637
- } catch (H) {
638
- console.error("[ChannelInfoDialog] Failed to block member", H);
658
+ await r.blockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
659
+ } catch (z) {
660
+ console.error("[ChannelInfoDialog] Failed to block member", z);
639
661
  } finally {
640
- w(!1);
662
+ S(!1);
641
663
  }
642
664
  }
643
665
  }, N = async () => {
644
- var O, F, B;
645
- if (!(v || !a)) {
646
- h == null || h(), E && console.log("[ChannelInfoDialog] Unblock member", (O = n == null ? void 0 : n.user) == null ? void 0 : O.id), w(!0);
666
+ var U, O, A;
667
+ if (!(p || !r)) {
668
+ h == null || h(), y && console.log("[ChannelInfoDialog] Unblock member", (U = n == null ? void 0 : n.user) == null ? void 0 : U.id), S(!0);
647
669
  try {
648
- await a.unBlockUser((F = n == null ? void 0 : n.user) == null ? void 0 : F.id), r && await r((B = n == null ? void 0 : n.user) == null ? void 0 : B.id), s();
649
- } catch (H) {
650
- console.error("[ChannelInfoDialog] Failed to unblock member", H);
670
+ await r.unBlockUser((O = n == null ? void 0 : n.user) == null ? void 0 : O.id), a && await a((A = n == null ? void 0 : n.user) == null ? void 0 : A.id), s();
671
+ } catch (z) {
672
+ console.error("[ChannelInfoDialog] Failed to unblock member", z);
651
673
  } finally {
652
- w(!1);
674
+ S(!1);
653
675
  }
654
676
  }
655
- }, U = () => {
677
+ }, v = () => {
656
678
  b == null || b(), s(), window.open(
657
679
  "https://linktr.ee/s/about/trust-center/report",
658
680
  "_blank",
@@ -660,7 +682,7 @@ const ds = ({
660
682
  );
661
683
  };
662
684
  if (!n) return null;
663
- const f = ((z = n.user) == null ? void 0 : z.name) || ((ne = n.user) == null ? void 0 : ne.id) || "Unknown member", y = (ae = n.user) == null ? void 0 : ae.image, L = (V = n.user) == null ? void 0 : V.email, G = (K = n.user) == null ? void 0 : K.username, Z = L || (G ? `linktr.ee/${G}` : void 0), T = ((re = n.user) == null ? void 0 : re.id) || "unknown";
685
+ const f = ((j = n.user) == null ? void 0 : j.name) || ((ne = n.user) == null ? void 0 : ne.id) || "Unknown member", k = (ae = n.user) == null ? void 0 : ae.image, H = (G = n.user) == null ? void 0 : G.email, Z = (K = n.user) == null ? void 0 : K.username, Y = H || (Z ? `linktr.ee/${Z}` : void 0), D = ((re = n.user) == null ? void 0 : re.id) || "unknown";
664
686
  return (
665
687
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
666
688
  /* @__PURE__ */ e(
@@ -669,13 +691,13 @@ const ds = ({
669
691
  ref: t,
670
692
  className: "mes-dialog group",
671
693
  onClose: s,
672
- onClick: (O) => {
673
- O.target === t.current && s();
694
+ onClick: (U) => {
695
+ U.target === t.current && s();
674
696
  },
675
697
  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: [
676
698
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
677
699
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
678
- /* @__PURE__ */ e(Ye, { onClick: s })
700
+ /* @__PURE__ */ e(Ze, { onClick: s })
679
701
  ] }),
680
702
  /* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
681
703
  /* @__PURE__ */ e(
@@ -687,17 +709,17 @@ const ds = ({
687
709
  /* @__PURE__ */ e(
688
710
  se,
689
711
  {
690
- id: T,
712
+ id: D,
691
713
  name: f,
692
- image: y,
714
+ image: k,
693
715
  size: 88,
694
716
  shape: "circle"
695
717
  }
696
718
  ),
697
719
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
698
720
  /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: f }),
699
- Z && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Z }),
700
- l && !g && /* @__PURE__ */ e(
721
+ Y && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: Y }),
722
+ l && !x && /* @__PURE__ */ e(
701
723
  "span",
702
724
  {
703
725
  className: "mt-1 rounded-full text-xs font-normal w-fit",
@@ -711,7 +733,7 @@ const ds = ({
711
733
  children: l
712
734
  }
713
735
  ),
714
- g
736
+ x
715
737
  ] })
716
738
  ] })
717
739
  }
@@ -724,19 +746,19 @@ const ds = ({
724
746
  disabled: M,
725
747
  "aria-busy": M,
726
748
  children: [
727
- M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(qt, { className: "h-5 w-5" }),
749
+ M ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
728
750
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
729
751
  ]
730
752
  }
731
753
  ) }),
732
- /* @__PURE__ */ e("li", { children: I ? /* @__PURE__ */ i(
754
+ /* @__PURE__ */ e("li", { children: _ ? /* @__PURE__ */ i(
733
755
  xe,
734
756
  {
735
757
  onClick: N,
736
- disabled: v,
737
- "aria-busy": v,
758
+ disabled: p,
759
+ "aria-busy": p,
738
760
  children: [
739
- v ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
761
+ p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
740
762
  /* @__PURE__ */ e("span", { children: "Unblock" })
741
763
  ]
742
764
  }
@@ -744,39 +766,39 @@ const ds = ({
744
766
  xe,
745
767
  {
746
768
  onClick: u,
747
- disabled: v,
748
- "aria-busy": v,
769
+ disabled: p,
770
+ "aria-busy": p,
749
771
  children: [
750
- v ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
772
+ p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Le, { className: "h-5 w-5" }),
751
773
  /* @__PURE__ */ e("span", { children: "Block" })
752
774
  ]
753
775
  }
754
776
  ) }),
755
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: U, children: [
756
- /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
777
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ i(xe, { variant: "danger", onClick: v, children: [
778
+ /* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
757
779
  /* @__PURE__ */ e("span", { children: "Report" })
758
780
  ] }) }),
759
- _
781
+ w
760
782
  ] })
761
783
  ] })
762
784
  ] })
763
785
  }
764
786
  )
765
787
  );
766
- }, us = (t) => /* @__PURE__ */ e(ut, { ...t, position: "center" }), Ie = "vote_up", Se = "vote_down";
767
- function ms(t) {
768
- return t != null && t.length ? t.some((s) => s.type === Se) ? "down" : t.some((s) => s.type === Ie) ? "up" : null : null;
769
- }
788
+ }, ms = (t) => /* @__PURE__ */ e(mt, { ...t, position: "center" }), Se = "vote_up", Ie = "vote_down";
770
789
  function hs(t) {
790
+ return t != null && t.length ? t.some((s) => s.type === Ie) ? "down" : t.some((s) => s.type === Se) ? "up" : null : null;
791
+ }
792
+ function fs(t) {
771
793
  const { channel: s } = Me(), { client: n } = $e("useMessageVote"), o = _e(
772
- () => ms(t.own_reactions),
794
+ () => hs(t.own_reactions),
773
795
  [t.own_reactions]
774
796
  ), l = P(async () => {
775
797
  if (n != null && n.userID)
776
798
  try {
777
- o === "up" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
799
+ o === "up" ? await s.deleteReaction(t.id, Se) : await s.sendReaction(
778
800
  t.id,
779
- { type: Ie },
801
+ { type: Se },
780
802
  { enforce_unique: !0, skip_push: !0 }
781
803
  );
782
804
  } catch {
@@ -784,9 +806,9 @@ function hs(t) {
784
806
  }, [s, n == null ? void 0 : n.userID, t.id, o]), m = P(async () => {
785
807
  if (n != null && n.userID)
786
808
  try {
787
- o === "down" ? await s.deleteReaction(t.id, Se) : await s.sendReaction(
809
+ o === "down" ? await s.deleteReaction(t.id, Ie) : await s.sendReaction(
788
810
  t.id,
789
- { type: Se },
811
+ { type: Ie },
790
812
  { enforce_unique: !0, skip_push: !0 }
791
813
  );
792
814
  } catch {
@@ -794,7 +816,7 @@ function hs(t) {
794
816
  }, [s, n == null ? void 0 : n.userID, t.id, o]);
795
817
  return { selected: o, voteUp: l, voteDown: m };
796
818
  }
797
- const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
819
+ const gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
798
820
  "path",
799
821
  {
800
822
  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",
@@ -804,7 +826,7 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
804
826
  strokeLinejoin: "round",
805
827
  fill: t ? "currentColor" : "none"
806
828
  }
807
- ) }), gs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
829
+ ) }), xs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
808
830
  "path",
809
831
  {
810
832
  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",
@@ -814,7 +836,7 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
814
836
  strokeLinejoin: "round",
815
837
  fill: t ? "currentColor" : "none"
816
838
  }
817
- ) }), xs = ({
839
+ ) }), bs = ({
818
840
  selected: t,
819
841
  onVoteUp: s,
820
842
  onVoteDown: n
@@ -827,7 +849,7 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
827
849
  onClick: s,
828
850
  "aria-label": "Helpful",
829
851
  "aria-pressed": t === "up",
830
- children: /* @__PURE__ */ e(fs, { filled: t === "up" })
852
+ children: /* @__PURE__ */ e(gs, { filled: t === "up" })
831
853
  }
832
854
  ),
833
855
  /* @__PURE__ */ e(
@@ -838,10 +860,10 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
838
860
  onClick: n,
839
861
  "aria-label": "Not helpful",
840
862
  "aria-pressed": t === "down",
841
- children: /* @__PURE__ */ e(gs, { filled: t === "down" })
863
+ children: /* @__PURE__ */ e(xs, { filled: t === "down" })
842
864
  }
843
865
  )
844
- ] }), bs = (t) => {
866
+ ] }), Cs = (t) => {
845
867
  var de, ue;
846
868
  const {
847
869
  additionalMessageInputProps: s,
@@ -849,61 +871,61 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
849
871
  editing: o,
850
872
  endOfGroup: l,
851
873
  firstOfGroup: m,
852
- groupedByUser: r,
874
+ groupedByUser: a,
853
875
  handleAction: c,
854
- handleOpenThread: x,
876
+ handleOpenThread: g,
855
877
  handleRetry: h,
856
878
  highlighted: b,
857
- isMessageAIGenerated: g,
858
- isMyMessage: _,
859
- message: a,
860
- renderText: E,
861
- threadList: I
862
- } = t, { client: C } = $e("CustomMessage"), [M, p] = k(!1), v = ht(a.id), { selected: w, voteUp: R, voteDown: d } = hs(a), {
863
- Attachment: u = gt,
864
- EditMessageModal: N = xt,
865
- MessageBlocked: U = bt,
866
- MessageBouncePrompt: f = Ct,
867
- MessageDeleted: y = Nt,
868
- MessageIsThreadReplyInChannelButtonIndicator: L = vt,
869
- MessageRepliesCountButton: G = wt,
870
- ReminderNotification: Z = pt,
871
- StreamedMessageText: T = yt,
872
- PinIndicator: q
873
- } = ft("CustomMessage"), z = _t(a), ne = Et(a), ae = _e(
874
- () => g == null ? void 0 : g(a),
875
- [g, a]
876
- ), V = _e(
877
- () => !a.shared_location && !a.attachments ? [] : a.shared_location ? [a.shared_location, ...a.attachments ?? []] : a.attachments,
878
- [a]
879
+ isMessageAIGenerated: x,
880
+ isMyMessage: w,
881
+ message: r,
882
+ renderText: y,
883
+ threadList: _
884
+ } = t, { client: C } = $e("CustomMessage"), [M, E] = T(!1), p = ft(r.id), { selected: S, voteUp: L, voteDown: d } = fs(r), {
885
+ Attachment: u = xt,
886
+ EditMessageModal: N = bt,
887
+ MessageBlocked: v = Ct,
888
+ MessageBouncePrompt: f = Nt,
889
+ MessageDeleted: k = vt,
890
+ MessageIsThreadReplyInChannelButtonIndicator: H = wt,
891
+ MessageRepliesCountButton: Z = pt,
892
+ ReminderNotification: Y = yt,
893
+ StreamedMessageText: D = _t,
894
+ PinIndicator: W
895
+ } = gt("CustomMessage"), j = Et(r), ne = St(r), ae = _e(
896
+ () => x == null ? void 0 : x(r),
897
+ [x, r]
898
+ ), G = _e(
899
+ () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
900
+ [r]
879
901
  );
880
- if (It(a))
902
+ if (It(r))
881
903
  return null;
882
- if (a.deleted_at || a.type === "deleted")
883
- return /* @__PURE__ */ e(y, { message: a });
884
- if (St(a))
885
- return /* @__PURE__ */ e(U, {});
886
- const K = !I && !!a.reply_count, re = !I && a.show_in_channel && a.parent_id, O = a.status === "failed" && ((de = a.error) == null ? void 0 : de.status) !== 403, F = Mt(a);
887
- let B;
888
- O ? B = () => h(a) : F && (B = () => p(!0));
889
- const H = _(), ce = D(
904
+ if (r.deleted_at || r.type === "deleted")
905
+ return /* @__PURE__ */ e(k, { message: r });
906
+ if (Mt(r))
907
+ return /* @__PURE__ */ e(v, {});
908
+ const K = !_ && !!r.reply_count, re = !_ && r.show_in_channel && r.parent_id, U = r.status === "failed" && ((de = r.error) == null ? void 0 : de.status) !== 403, O = kt(r);
909
+ let A;
910
+ U ? A = () => h(r) : O && (A = () => E(!0));
911
+ const z = w(), ce = R(
890
912
  "str-chat__message str-chat__message-simple",
891
- `str-chat__message--${a.type}`,
892
- `str-chat__message--${a.status}`,
893
- H ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
894
- a.text ? "str-chat__message--has-text" : "has-no-text",
913
+ `str-chat__message--${r.type}`,
914
+ `str-chat__message--${r.status}`,
915
+ z ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
916
+ r.text ? "str-chat__message--has-text" : "has-no-text",
895
917
  {
896
- "str-chat__message--has-attachment": z,
918
+ "str-chat__message--has-attachment": j,
897
919
  "str-chat__message--highlighted": b,
898
- "str-chat__message--pinned pinned-message": a.pinned,
920
+ "str-chat__message--pinned pinned-message": r.pinned,
899
921
  "str-chat__message--with-reactions": ne,
900
- "str-chat__message-send-can-be-retried": (a == null ? void 0 : a.status) === "failed" && ((ue = a == null ? void 0 : a.error) == null ? void 0 : ue.status) !== 403,
922
+ "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((ue = r == null ? void 0 : r.error) == null ? void 0 : ue.status) !== 403,
901
923
  "str-chat__message-with-thread-link": K || re,
902
924
  "str-chat__virtual-message__wrapper--end": l,
903
925
  "str-chat__virtual-message__wrapper--first": m,
904
- "str-chat__virtual-message__wrapper--group": r
926
+ "str-chat__virtual-message__wrapper--group": a
905
927
  }
906
- ), Y = a.poll_id && C.polls.fromState(a.poll_id), oe = is(a), ee = Te(a), J = !!(V != null && V.length && !a.quoted_message), te = ee && H && J;
928
+ ), q = r.poll_id && C.polls.fromState(r.poll_id), oe = cs(r), ee = Te(r), J = !!(G != null && G.length && !r.quoted_message), te = ee && z && J;
907
929
  return /* @__PURE__ */ i(me, { children: [
908
930
  o && /* @__PURE__ */ e(
909
931
  N,
@@ -912,36 +934,36 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
912
934
  }
913
935
  ),
914
936
  M && /* @__PURE__ */ e(
915
- kt,
937
+ Tt,
916
938
  {
917
939
  MessageBouncePrompt: f,
918
- onClose: () => p(!1),
940
+ onClose: () => E(!1),
919
941
  open: M
920
942
  }
921
943
  ),
922
944
  /* @__PURE__ */ i("div", { className: ce, children: [
923
- q && /* @__PURE__ */ e(q, {}),
924
- !!v && /* @__PURE__ */ e(Z, { reminder: v }),
925
- a.user && /* @__PURE__ */ e(
945
+ W && /* @__PURE__ */ e(W, {}),
946
+ !!p && /* @__PURE__ */ e(Y, { reminder: p }),
947
+ r.user && /* @__PURE__ */ e(
926
948
  se,
927
949
  {
928
950
  className: "str-chat__avatar str-chat__message-sender-avatar",
929
- id: a.user.id,
930
- image: a.user.image,
931
- name: a.user.name || a.user.id
951
+ id: r.user.id,
952
+ image: r.user.image,
953
+ name: r.user.name || r.user.id
932
954
  }
933
955
  ),
934
956
  /* @__PURE__ */ e(
935
957
  "div",
936
958
  {
937
- className: D("str-chat__message-inner", {
938
- "str-chat__simple-message--error-failed": O || F
959
+ className: R("str-chat__message-inner", {
960
+ "str-chat__simple-message--error-failed": U || O
939
961
  }),
940
962
  "data-testid": "message-inner",
941
- onClick: B,
942
- onKeyDown: B,
943
- role: B ? "button" : void 0,
944
- tabIndex: B ? 0 : void 0,
963
+ onClick: A,
964
+ onKeyDown: A,
965
+ role: A ? "button" : void 0,
966
+ tabIndex: A ? 0 : void 0,
945
967
  style: {
946
968
  // Force margins to 0 to prevent hover layout shift
947
969
  // Stream Chat CSS sets margin-inline-end/start to 78px, then 0 on hover
@@ -950,47 +972,47 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
950
972
  },
951
973
  children: oe ? (
952
974
  /* Tip-only messages render as a standalone bubble */
953
- /* @__PURE__ */ e(ye, { message: a, standalone: !0 })
975
+ /* @__PURE__ */ e(ye, { message: r, standalone: !0 })
954
976
  ) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
955
977
  /* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
956
978
  ee && !te && /* @__PURE__ */ e(
957
979
  ye,
958
980
  {
959
- message: a,
981
+ message: r,
960
982
  hasAttachment: J,
961
- isMyMessage: H
983
+ isMyMessage: z
962
984
  }
963
985
  ),
964
- Y && /* @__PURE__ */ e(Tt, { poll: Y }),
965
- V != null && V.length && !a.quoted_message ? /* @__PURE__ */ e(
986
+ q && /* @__PURE__ */ e(Dt, { poll: q }),
987
+ G != null && G.length && !r.quoted_message ? /* @__PURE__ */ e(
966
988
  u,
967
989
  {
968
990
  actionHandler: c,
969
- attachments: V
991
+ attachments: G
970
992
  }
971
993
  ) : null,
972
994
  ae ? /* @__PURE__ */ e(
973
- T,
995
+ D,
974
996
  {
975
- message: a,
976
- renderText: E
997
+ message: r,
998
+ renderText: y
977
999
  }
978
- ) : /* @__PURE__ */ e(Dt, { message: a, renderText: E }),
979
- /* @__PURE__ */ e(Rt, {})
1000
+ ) : /* @__PURE__ */ e(Rt, { message: r, renderText: y }),
1001
+ /* @__PURE__ */ e(Lt, {})
980
1002
  ] }),
981
1003
  (!ee || te) && /* @__PURE__ */ e(
982
1004
  ye,
983
1005
  {
984
- message: a,
1006
+ message: r,
985
1007
  hasAttachment: J,
986
- isMyMessage: H
1008
+ isMyMessage: z
987
1009
  }
988
1010
  ),
989
1011
  n && ee && /* @__PURE__ */ e(
990
- xs,
1012
+ bs,
991
1013
  {
992
- selected: w,
993
- onVoteUp: R,
1014
+ selected: S,
1015
+ onVoteUp: L,
994
1016
  onVoteDown: d
995
1017
  }
996
1018
  )
@@ -998,26 +1020,26 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
998
1020
  }
999
1021
  ),
1000
1022
  K && /* @__PURE__ */ e(
1001
- G,
1023
+ Z,
1002
1024
  {
1003
- onClick: x,
1004
- reply_count: a.reply_count
1025
+ onClick: g,
1026
+ reply_count: r.reply_count
1005
1027
  }
1006
1028
  ),
1007
- re && /* @__PURE__ */ e(L, {})
1008
- ] }, a.id)
1029
+ re && /* @__PURE__ */ e(H, {})
1030
+ ] }, r.id)
1009
1031
  ] });
1010
- }, Cs = $.memo(
1011
- bs,
1012
- mt
1013
- ), Ns = (t) => {
1032
+ }, Ns = B.memo(
1033
+ Cs,
1034
+ ht
1035
+ ), vs = (t) => {
1014
1036
  const s = je("CustomMessage");
1015
- return /* @__PURE__ */ e(Cs, { ...s, ...t });
1016
- }, vs = (t) => ({
1037
+ return /* @__PURE__ */ e(Ns, { ...s, ...t });
1038
+ }, ws = (t) => ({
1017
1039
  linkPreviews: Array.from(t.previews.values()).filter(
1018
1040
  (s) => Fe.previewIsLoaded(s) || Fe.previewIsLoading(s)
1019
1041
  )
1020
- }), ws = ({
1042
+ }), ps = ({
1021
1043
  link: t,
1022
1044
  onDismiss: s
1023
1045
  }) => {
@@ -1042,8 +1064,8 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1042
1064
  "button",
1043
1065
  {
1044
1066
  type: "button",
1045
- onClick: (r) => {
1046
- r.preventDefault(), s(n);
1067
+ onClick: (a) => {
1068
+ a.preventDefault(), s(n);
1047
1069
  },
1048
1070
  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",
1049
1071
  "aria-label": "Close link preview",
@@ -1057,32 +1079,32 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1057
1079
  ]
1058
1080
  }
1059
1081
  );
1060
- }, ps = () => {
1061
- const { linkPreviewsManager: t } = Lt(), { linkPreviews: s } = Pt(
1082
+ }, ys = () => {
1083
+ const { linkPreviewsManager: t } = Pt(), { linkPreviews: s } = Ut(
1062
1084
  t.state,
1063
- vs
1085
+ ws
1064
1086
  ), n = (l) => {
1065
1087
  t.dismissPreview(l);
1066
1088
  };
1067
1089
  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(
1068
- ws,
1090
+ ps,
1069
1091
  {
1070
1092
  link: l,
1071
1093
  onDismiss: n
1072
1094
  },
1073
1095
  l.og_scrape_url
1074
1096
  )) }) : null;
1075
- }, ys = () => {
1076
- const { handleSubmit: t } = Ot(), s = Ft();
1097
+ }, _s = () => {
1098
+ const { handleSubmit: t } = Ft(), s = At();
1077
1099
  return /* @__PURE__ */ i(me, { children: [
1078
- /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(At, {}) }),
1100
+ /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Bt, {}) }),
1079
1101
  /* @__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: [
1080
- /* @__PURE__ */ e(Bt, {}),
1081
- /* @__PURE__ */ e(ps, {}),
1082
1102
  /* @__PURE__ */ e($t, {}),
1103
+ /* @__PURE__ */ e(ys, {}),
1104
+ /* @__PURE__ */ e(jt, {}),
1083
1105
  /* @__PURE__ */ i("div", { className: "flex", children: [
1084
1106
  /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
1085
- jt,
1107
+ Gt,
1086
1108
  {
1087
1109
  className: "w-full resize-none outline-none leading-6",
1088
1110
  autoFocus: !0,
@@ -1098,24 +1120,24 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1098
1120
  disabled: !s,
1099
1121
  onClick: t,
1100
1122
  type: "button",
1101
- children: /* @__PURE__ */ e(Zt, { className: "size-4" })
1123
+ children: /* @__PURE__ */ e(Jt, { className: "size-4" })
1102
1124
  }
1103
1125
  )
1104
1126
  ] })
1105
1127
  ] })
1106
1128
  ] });
1107
- }, _s = ({
1129
+ }, Es = ({
1108
1130
  renderActions: t
1109
1131
  }) => /* @__PURE__ */ i("div", { className: "message-input flex items-center gap-2 p-4", children: [
1110
1132
  t && (t == null ? void 0 : t()),
1111
- /* @__PURE__ */ e(Ut, { Input: ys })
1112
- ] }), Es = [
1133
+ /* @__PURE__ */ e(Ot, { Input: _s })
1134
+ ] }), Ss = [
1113
1135
  "SYSTEM_DM_AGENT_PAUSED",
1114
1136
  "SYSTEM_DM_AGENT_RESUMED"
1115
1137
  ], Is = {
1116
1138
  SYSTEM_DM_AGENT_PAUSED: "DM Agent has left the conversation",
1117
1139
  SYSTEM_DM_AGENT_RESUMED: "DM Agent has rejoined the conversation"
1118
- }, Be = (t) => Es.includes(t), Ss = (t) => {
1140
+ }, Be = (t) => Ss.includes(t), Ms = (t) => {
1119
1141
  var o;
1120
1142
  const s = (o = t.metadata) == null ? void 0 : o.custom_type;
1121
1143
  if (Be(s))
@@ -1123,9 +1145,9 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1123
1145
  const n = t.dm_agent_system_type;
1124
1146
  if (Be(n))
1125
1147
  return n;
1126
- }, Ms = (t) => {
1148
+ }, ks = (t) => {
1127
1149
  var o;
1128
- const s = t.message.hide_date === !0, n = Ss(t.message);
1150
+ const s = t.message.hide_date === !0, n = Ms(t.message);
1129
1151
  if (n) {
1130
1152
  const l = ((o = t.message.text) == null ? void 0 : o.trim()) || Is[n];
1131
1153
  return /* @__PURE__ */ i("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
@@ -1137,7 +1159,7 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1137
1159
  "data-dm-agent-system-type": n,
1138
1160
  children: [
1139
1161
  /* @__PURE__ */ e(
1140
- Jt,
1162
+ Qt,
1141
1163
  {
1142
1164
  size: 16,
1143
1165
  weight: "regular",
@@ -1160,10 +1182,10 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1160
1182
  ] }),
1161
1183
  !s && /* @__PURE__ */ e(Re, { message: t.message })
1162
1184
  ] });
1163
- }, ks = () => null, Ts = ({ className: t, message: s }) => /* @__PURE__ */ i(
1185
+ }, Ts = () => null, Ds = ({ className: t, message: s }) => /* @__PURE__ */ i(
1164
1186
  "div",
1165
1187
  {
1166
- className: D("flex items-center justify-center h-full", t),
1188
+ className: R("flex items-center justify-center h-full", t),
1167
1189
  children: [
1168
1190
  /* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1169
1191
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
@@ -1203,45 +1225,31 @@ const fs = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
1203
1225
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1204
1226
  ]
1205
1227
  }
1206
- ), Ne = $.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1207
- /* @__PURE__ */ e(Ts, { className: "w-6 h-6" }),
1228
+ ), Ne = B.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
1229
+ /* @__PURE__ */ e(Ds, { className: "w-6 h-6" }),
1208
1230
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1209
1231
  ] }) }));
1210
1232
  Ne.displayName = "LoadingState";
1211
- const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Ds = ({
1233
+ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-center justify-center transition-colors duration-150 focus-ring", Rs = ({
1212
1234
  onBack: t,
1213
1235
  showBackButton: s,
1214
1236
  onShowInfo: n,
1215
1237
  canShowInfo: o,
1216
1238
  showStarButton: l = !1
1217
1239
  }) => {
1218
- var _, a, E, I, C, M;
1219
- const { channel: m } = Me(), r = $.useMemo(() => Object.values(m.state.members || {}).find(
1220
- (v) => {
1221
- var w;
1222
- return ((w = v.user) == null ? void 0 : w.id) && v.user.id !== m._client.userID;
1240
+ var x, w, r, y, _;
1241
+ const { channel: m } = Me(), a = B.useMemo(() => Object.values(m.state.members || {}).find(
1242
+ (M) => {
1243
+ var E;
1244
+ return ((E = M.user) == null ? void 0 : E.id) && M.user.id !== m._client.userID;
1223
1245
  }
1224
- ), [m._client.userID, m.state.members]), c = ((_ = r == null ? void 0 : r.user) == null ? void 0 : _.name) || ((a = r == null ? void 0 : r.user) == null ? void 0 : a.id) || "Unknown member", x = (E = r == null ? void 0 : r.user) == null ? void 0 : E.image, [h, b] = k(
1225
- !!((I = m.state.membership) != null && I.pinned_at)
1226
- );
1227
- X(() => {
1228
- const p = (v) => {
1229
- var w;
1230
- b(
1231
- v != null && v.member ? !!v.member.pinned_at : !!((w = m.state.membership) != null && w.pinned_at)
1232
- );
1233
- };
1234
- return m.on("member.updated", p), () => {
1235
- m.off("member.updated", p);
1236
- };
1237
- }, [m]);
1238
- const g = async () => {
1246
+ ), [m._client.userID, m.state.members]), c = ((x = a == null ? void 0 : a.user) == null ? void 0 : x.name) || ((w = a == null ? void 0 : a.user) == null ? void 0 : w.id) || "Unknown member", g = (r = a == null ? void 0 : a.user) == null ? void 0 : r.image, h = Ve(m), b = async () => {
1239
1247
  try {
1240
1248
  h ? await m.unpin() : await m.pin();
1241
- } catch (p) {
1249
+ } catch (C) {
1242
1250
  console.error(
1243
1251
  "[CustomChannelHeader] Failed to update pinned status:",
1244
- p
1252
+ C
1245
1253
  );
1246
1254
  }
1247
1255
  };
@@ -1262,9 +1270,10 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1262
1270
  /* @__PURE__ */ e(
1263
1271
  se,
1264
1272
  {
1265
- id: ((C = r == null ? void 0 : r.user) == null ? void 0 : C.id) || m.id || "unknown",
1273
+ id: ((y = a == null ? void 0 : a.user) == null ? void 0 : y.id) || m.id || "unknown",
1266
1274
  name: c,
1267
- image: x,
1275
+ image: g,
1276
+ starred: h,
1268
1277
  size: 40
1269
1278
  }
1270
1279
  ),
@@ -1275,13 +1284,13 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1275
1284
  "button",
1276
1285
  {
1277
1286
  className: ie,
1278
- onClick: g,
1287
+ onClick: b,
1279
1288
  type: "button",
1280
1289
  "aria-label": h ? "Unstar conversation" : "Star conversation",
1281
1290
  children: /* @__PURE__ */ e(
1282
1291
  Ee,
1283
1292
  {
1284
- className: D("size-5", {
1293
+ className: R("size-5", {
1285
1294
  "text-yellow-600": h,
1286
1295
  "text-black/90": !h
1287
1296
  }),
@@ -1317,9 +1326,10 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1317
1326
  /* @__PURE__ */ e(
1318
1327
  se,
1319
1328
  {
1320
- id: ((M = r == null ? void 0 : r.user) == null ? void 0 : M.id) || m.id || "unknown",
1329
+ id: ((_ = a == null ? void 0 : a.user) == null ? void 0 : _.id) || m.id || "unknown",
1321
1330
  name: c,
1322
- image: x,
1331
+ image: g,
1332
+ starred: h,
1323
1333
  size: 40
1324
1334
  }
1325
1335
  ),
@@ -1330,13 +1340,13 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1330
1340
  "button",
1331
1341
  {
1332
1342
  className: ie,
1333
- onClick: g,
1343
+ onClick: b,
1334
1344
  type: "button",
1335
1345
  "aria-label": h ? "Unstar conversation" : "Star conversation",
1336
1346
  children: /* @__PURE__ */ e(
1337
1347
  Ee,
1338
1348
  {
1339
- className: D("size-5", {
1349
+ className: R("size-5", {
1340
1350
  "text-yellow-600": h,
1341
1351
  "text-black/90": !h
1342
1352
  }),
@@ -1358,72 +1368,72 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1358
1368
  ] })
1359
1369
  ] })
1360
1370
  ] });
1361
- }, Rs = ({
1371
+ }, Ls = ({
1362
1372
  onBack: t,
1363
1373
  showBackButton: s,
1364
1374
  renderMessageInputActions: n,
1365
1375
  renderConversationFooter: o,
1366
1376
  onLeaveConversation: l,
1367
1377
  onBlockParticipant: m,
1368
- showDeleteConversation: r = !0,
1378
+ showDeleteConversation: a = !0,
1369
1379
  onDeleteConversationClick: c,
1370
- onBlockParticipantClick: x,
1380
+ onBlockParticipantClick: g,
1371
1381
  onReportParticipantClick: h,
1372
1382
  showStarButton: b = !1,
1373
- chatbotVotingEnabled: g = !1,
1374
- renderChannelBanner: _,
1375
- customProfileContent: a,
1376
- customChannelActions: E,
1377
- renderMessage: I
1383
+ chatbotVotingEnabled: x = !1,
1384
+ renderChannelBanner: w,
1385
+ customProfileContent: r,
1386
+ customChannelActions: y,
1387
+ renderMessage: _
1378
1388
  }) => {
1379
- const { channel: C } = Me(), M = Q(null), p = $.useMemo(() => Object.values(C.state.members || {}).find(
1389
+ const { channel: C } = Me(), M = Q(null), E = B.useMemo(() => Object.values(C.state.members || {}).find(
1380
1390
  (u) => {
1381
1391
  var N;
1382
1392
  return ((N = u.user) == null ? void 0 : N.id) && u.user.id !== C._client.userID;
1383
1393
  }
1384
- ), [C._client.userID, C.state.members]), v = $.useMemo(() => {
1394
+ ), [C._client.userID, C.state.members]), p = B.useMemo(() => {
1385
1395
  const d = C.data ?? {};
1386
1396
  if (d.followerStatus)
1387
1397
  return String(d.followerStatus);
1388
1398
  if (d.isFollower !== void 0)
1389
1399
  return d.isFollower ? "Subscribed to you" : "Not subscribed";
1390
- }, [C.data]), w = P(() => {
1400
+ }, [C.data]), S = P(() => {
1391
1401
  var d;
1392
1402
  (d = M.current) == null || d.showModal();
1393
- }, []), R = P(() => {
1403
+ }, []), L = P(() => {
1394
1404
  var d;
1395
1405
  (d = M.current) == null || d.close();
1396
1406
  }, []);
1397
1407
  return /* @__PURE__ */ i(me, { children: [
1398
1408
  /* @__PURE__ */ e(
1399
- zt,
1409
+ Vt,
1400
1410
  {
1401
1411
  overrides: {
1402
1412
  Message: (d) => {
1403
1413
  const { message: u } = je("ChannelView"), N = /* @__PURE__ */ e(
1404
- Ns,
1414
+ vs,
1405
1415
  {
1406
1416
  ...d,
1407
- chatbotVotingEnabled: g
1417
+ chatbotVotingEnabled: x
1408
1418
  }
1409
1419
  );
1410
- return !I || !u ? N : I(N, u);
1420
+ return !_ || !u ? N : _(N, u);
1411
1421
  }
1412
1422
  },
1413
- children: /* @__PURE__ */ i(Vt, { children: [
1423
+ children: /* @__PURE__ */ i(Ht, { children: [
1414
1424
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
1415
- Ds,
1425
+ Rs,
1416
1426
  {
1417
1427
  onBack: t,
1418
1428
  showBackButton: s,
1419
- onShowInfo: w,
1420
- canShowInfo: !!p,
1429
+ onShowInfo: S,
1430
+ canShowInfo: !!E,
1421
1431
  showStarButton: b
1422
1432
  }
1423
1433
  ) }),
1424
- _ == null ? void 0 : _(),
1434
+ w == null ? void 0 : w(),
1425
1435
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1426
- Ht,
1436
+ Wt,
1427
1437
  {
1428
1438
  hideDeletedMessages: !0,
1429
1439
  hideNewMessageSeparator: !1,
@@ -1432,7 +1442,7 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1432
1442
  ) }),
1433
1443
  o == null ? void 0 : o(C),
1434
1444
  /* @__PURE__ */ e(
1435
- _s,
1445
+ Es,
1436
1446
  {
1437
1447
  renderActions: () => n == null ? void 0 : n(C)
1438
1448
  }
@@ -1441,25 +1451,25 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1441
1451
  }
1442
1452
  ),
1443
1453
  /* @__PURE__ */ e(
1444
- ds,
1454
+ us,
1445
1455
  {
1446
1456
  dialogRef: M,
1447
- onClose: R,
1448
- participant: p,
1457
+ onClose: L,
1458
+ participant: E,
1449
1459
  channel: C,
1450
- followerStatusLabel: v,
1460
+ followerStatusLabel: p,
1451
1461
  onLeaveConversation: l,
1452
1462
  onBlockParticipant: m,
1453
- showDeleteConversation: r,
1463
+ showDeleteConversation: a,
1454
1464
  onDeleteConversationClick: c,
1455
- onBlockParticipantClick: x,
1465
+ onBlockParticipantClick: g,
1456
1466
  onReportParticipantClick: h,
1457
- customProfileContent: a,
1458
- customChannelActions: E
1467
+ customProfileContent: r,
1468
+ customChannelActions: y
1459
1469
  }
1460
1470
  )
1461
1471
  ] });
1462
- }, Ze = $.memo(
1472
+ }, Je = B.memo(
1463
1473
  ({
1464
1474
  channel: t,
1465
1475
  onBack: s,
@@ -1467,79 +1477,79 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1467
1477
  renderMessageInputActions: o,
1468
1478
  renderConversationFooter: l,
1469
1479
  onLeaveConversation: m,
1470
- onBlockParticipant: r,
1480
+ onBlockParticipant: a,
1471
1481
  className: c,
1472
- CustomChannelEmptyState: x = ks,
1482
+ CustomChannelEmptyState: g = Ts,
1473
1483
  showDeleteConversation: h = !0,
1474
1484
  onDeleteConversationClick: b,
1475
- onBlockParticipantClick: g,
1476
- onReportParticipantClick: _,
1477
- dmAgentEnabled: a,
1478
- messageMetadata: E,
1479
- onMessageSent: I,
1485
+ onBlockParticipantClick: x,
1486
+ onReportParticipantClick: w,
1487
+ dmAgentEnabled: r,
1488
+ messageMetadata: y,
1489
+ onMessageSent: _,
1480
1490
  showStarButton: C = !1,
1481
1491
  chatbotVotingEnabled: M = !1,
1482
- renderChannelBanner: p,
1483
- customProfileContent: v,
1484
- customChannelActions: w,
1485
- renderMessage: R
1492
+ renderChannelBanner: E,
1493
+ customProfileContent: p,
1494
+ customChannelActions: S,
1495
+ renderMessage: L
1486
1496
  }) => {
1487
1497
  const d = P(
1488
- async (u, N, U) => {
1489
- var T;
1490
- const f = ((T = t.data) == null ? void 0 : T.chatbot_paused) === !0, y = a && !f, L = {
1498
+ async (u, N, v) => {
1499
+ var D;
1500
+ const f = ((D = t.data) == null ? void 0 : D.chatbot_paused) === !0, k = r && !f, H = {
1491
1501
  ...N,
1492
- ...y && { silent: !0 },
1493
- ...E && {
1502
+ ...k && { silent: !0 },
1503
+ ...y && {
1494
1504
  metadata: {
1495
1505
  ...N.metadata ?? {},
1496
- ...E
1506
+ ...y
1497
1507
  }
1498
1508
  }
1499
- }, G = {
1500
- ...U,
1501
- ...y && { skip_push: !0 }
1502
- }, Z = await t.sendMessage(L, G);
1503
- return I == null || I(Z), Z;
1509
+ }, Z = {
1510
+ ...v,
1511
+ ...k && { skip_push: !0 }
1512
+ }, Y = await t.sendMessage(H, Z);
1513
+ return _ == null || _(Y), Y;
1504
1514
  },
1505
- [t, a, E, I]
1515
+ [t, r, y, _]
1506
1516
  );
1507
1517
  return /* @__PURE__ */ e(
1508
1518
  "div",
1509
1519
  {
1510
- className: D(
1520
+ className: R(
1511
1521
  "messaging-channel-view h-full flex flex-col",
1512
1522
  c
1513
1523
  ),
1514
1524
  children: /* @__PURE__ */ e(
1515
- Gt,
1525
+ zt,
1516
1526
  {
1517
1527
  channel: t,
1518
- MessageSystem: Ms,
1519
- EmptyStateIndicator: x,
1528
+ MessageSystem: ks,
1529
+ EmptyStateIndicator: g,
1520
1530
  LoadingIndicator: Ne,
1521
- DateSeparator: us,
1531
+ DateSeparator: ms,
1522
1532
  doSendMessageRequest: d,
1523
1533
  children: /* @__PURE__ */ e(
1524
- Rs,
1534
+ Ls,
1525
1535
  {
1526
1536
  onBack: s,
1527
1537
  showBackButton: n,
1528
1538
  renderMessageInputActions: o,
1529
1539
  renderConversationFooter: l,
1530
1540
  onLeaveConversation: m,
1531
- onBlockParticipant: r,
1532
- CustomChannelEmptyState: x,
1541
+ onBlockParticipant: a,
1542
+ CustomChannelEmptyState: g,
1533
1543
  showDeleteConversation: h,
1534
1544
  onDeleteConversationClick: b,
1535
- onBlockParticipantClick: g,
1536
- onReportParticipantClick: _,
1545
+ onBlockParticipantClick: x,
1546
+ onReportParticipantClick: w,
1537
1547
  showStarButton: C,
1538
1548
  chatbotVotingEnabled: M,
1539
- renderChannelBanner: p,
1540
- customProfileContent: v,
1541
- customChannelActions: w,
1542
- renderMessage: R
1549
+ renderChannelBanner: E,
1550
+ customProfileContent: p,
1551
+ customChannelActions: S,
1552
+ renderMessage: L
1543
1553
  }
1544
1554
  )
1545
1555
  }
@@ -1548,8 +1558,8 @@ const ie = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1548
1558
  );
1549
1559
  }
1550
1560
  );
1551
- Ze.displayName = "ChannelView";
1552
- function Ls({
1561
+ Je.displayName = "ChannelView";
1562
+ function Ps({
1553
1563
  searchQuery: t,
1554
1564
  setSearchQuery: s,
1555
1565
  placeholder: n
@@ -1557,7 +1567,7 @@ function Ls({
1557
1567
  const o = Q(null);
1558
1568
  return /* @__PURE__ */ i("div", { className: "relative", children: [
1559
1569
  /* @__PURE__ */ e(
1560
- Qt,
1570
+ Xt,
1561
1571
  {
1562
1572
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-stone",
1563
1573
  weight: "bold"
@@ -1575,7 +1585,7 @@ function Ls({
1575
1585
  }
1576
1586
  ),
1577
1587
  t && /* @__PURE__ */ e(
1578
- qe,
1588
+ Ye,
1579
1589
  {
1580
1590
  label: "Clear search",
1581
1591
  onClick: () => {
@@ -1588,18 +1598,18 @@ function Ls({
1588
1598
  )
1589
1599
  ] });
1590
1600
  }
1591
- const Ps = ({
1601
+ const Us = ({
1592
1602
  participantSource: t,
1593
1603
  onSelectParticipant: s,
1594
1604
  onClose: n,
1595
1605
  existingParticipantIds: o = /* @__PURE__ */ new Set(),
1596
1606
  participantLabel: l = "participants",
1597
1607
  searchPlaceholder: m = "Search participants...",
1598
- className: r
1608
+ className: a
1599
1609
  }) => {
1600
- const { debug: c } = ve(), [x, h] = k(""), [b, g] = k([]), [_, a] = k(!1), [E, I] = k(null), [C, M] = k(
1610
+ const { debug: c } = ve(), [g, h] = T(""), [b, x] = T([]), [w, r] = T(!1), [y, _] = T(null), [C, M] = T(
1601
1611
  null
1602
- ), p = Q(!1);
1612
+ ), E = Q(!1);
1603
1613
  X(() => {
1604
1614
  if (t.loading) {
1605
1615
  c && console.log(
@@ -1607,33 +1617,33 @@ const Ps = ({
1607
1617
  );
1608
1618
  return;
1609
1619
  }
1610
- if (p.current) return;
1620
+ if (E.current) return;
1611
1621
  (async () => {
1612
- c && console.log("[ParticipantPicker] Loading initial participants..."), a(!0), I(null);
1622
+ c && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), _(null);
1613
1623
  try {
1614
1624
  const u = await t.loadParticipants({
1615
1625
  search: "",
1616
1626
  // Load all participants initially
1617
1627
  limit: 100
1618
1628
  });
1619
- g(u.participants), p.current = !0, c && console.log(
1629
+ x(u.participants), E.current = !0, c && console.log(
1620
1630
  "[ParticipantPicker] Participants loaded successfully:",
1621
1631
  u.participants.length
1622
1632
  );
1623
1633
  } catch (u) {
1624
1634
  const N = u instanceof Error ? u.message : "Failed to load participants";
1625
- I(N), console.error("[ParticipantPicker] Failed to load participants:", u);
1635
+ _(N), console.error("[ParticipantPicker] Failed to load participants:", u);
1626
1636
  } finally {
1627
- a(!1);
1637
+ r(!1);
1628
1638
  }
1629
1639
  })();
1630
1640
  }, [t.loading, c]);
1631
- const v = b.filter((d) => !o.has(d.id)).filter((d) => {
1641
+ const p = b.filter((d) => !o.has(d.id)).filter((d) => {
1632
1642
  var N;
1633
- if (!x) return !0;
1634
- const u = x.toLowerCase();
1643
+ if (!g) return !0;
1644
+ const u = g.toLowerCase();
1635
1645
  return d.name.toLowerCase().includes(u) || ((N = d.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
1636
- }), w = P(
1646
+ }), S = P(
1637
1647
  async (d) => {
1638
1648
  if (!C) {
1639
1649
  M(d.id);
@@ -1645,58 +1655,58 @@ const Ps = ({
1645
1655
  }
1646
1656
  },
1647
1657
  [s, C]
1648
- ), R = (d, u) => {
1649
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), w(u));
1658
+ ), L = (d, u) => {
1659
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), S(u));
1650
1660
  };
1651
- return /* @__PURE__ */ i("div", { className: D("flex flex-col h-full", r), children: [
1661
+ return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
1652
1662
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1653
1663
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
1654
1664
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1655
- /* @__PURE__ */ e(Ye, { onClick: n })
1665
+ /* @__PURE__ */ e(Ze, { onClick: n })
1656
1666
  ] }),
1657
1667
  /* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
1658
1668
  "Select a ",
1659
1669
  l.slice(0, -1),
1660
1670
  " to start messaging (",
1661
- v.length,
1671
+ p.length,
1662
1672
  " available)",
1663
1673
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${l} total`
1664
1674
  ] }),
1665
1675
  /* @__PURE__ */ e(
1666
- Ls,
1676
+ Ps,
1667
1677
  {
1668
- searchQuery: x,
1678
+ searchQuery: g,
1669
1679
  setSearchQuery: h,
1670
1680
  placeholder: m
1671
1681
  }
1672
1682
  )
1673
1683
  ] }),
1674
- E && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1684
+ y && /* @__PURE__ */ i("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1675
1685
  "Error loading ",
1676
1686
  l,
1677
1687
  ": ",
1678
- E
1688
+ y
1679
1689
  ] }),
1680
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: _ && v.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: [
1690
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: w && p.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: [
1681
1691
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1682
1692
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1683
1693
  "Loading ",
1684
1694
  l,
1685
1695
  "..."
1686
1696
  ] })
1687
- ] }) }) : v.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1697
+ ] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1688
1698
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Oe, { className: "h-8 w-8 text-charcoal" }) }),
1689
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1690
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "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` })
1699
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1700
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "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` })
1691
1701
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1692
- v.map((d) => {
1702
+ p.map((d) => {
1693
1703
  const u = d.name || d.email || d.id, N = d.email && d.name ? d.email : d.phone;
1694
1704
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1695
1705
  "button",
1696
1706
  {
1697
1707
  type: "button",
1698
- onClick: () => w(d),
1699
- onKeyDown: (U) => R(U, d),
1708
+ onClick: () => S(d),
1709
+ onKeyDown: (v) => L(v, d),
1700
1710
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1701
1711
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1702
1712
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
@@ -1719,13 +1729,13 @@ const Ps = ({
1719
1729
  }
1720
1730
  ) }, d.id);
1721
1731
  }),
1722
- _ && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1732
+ w && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1723
1733
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1724
1734
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1725
1735
  ] }) })
1726
1736
  ] }) })
1727
1737
  ] });
1728
- }, Us = ({ className: t }) => /* @__PURE__ */ i(
1738
+ }, Os = ({ className: t }) => /* @__PURE__ */ i(
1729
1739
  "svg",
1730
1740
  {
1731
1741
  width: "140",
@@ -1859,17 +1869,17 @@ const Ps = ({
1859
1869
  ] })
1860
1870
  ]
1861
1871
  }
1862
- ), Je = $.memo(
1872
+ ), Qe = B.memo(
1863
1873
  ({ 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: [
1864
- /* @__PURE__ */ e(Us, {}),
1874
+ /* @__PURE__ */ e(Os, {}),
1865
1875
  s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
1866
1876
  /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1867
1877
  /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1868
1878
  ] })
1869
1879
  ] }) })
1870
1880
  );
1871
- Je.displayName = "EmptyState";
1872
- const Ce = $.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: [
1881
+ Qe.displayName = "EmptyState";
1882
+ const Ce = B.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: [
1873
1883
  /* @__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: "โš ๏ธ" }) }),
1874
1884
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1875
1885
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1884,221 +1894,221 @@ const Ce = $.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
1884
1894
  )
1885
1895
  ] }) }));
1886
1896
  Ce.displayName = "ErrorState";
1887
- const Hs = ({
1897
+ const Ws = ({
1888
1898
  capabilities: t = {},
1889
1899
  className: s,
1890
1900
  renderMessageInputActions: n,
1891
1901
  renderConversationFooter: o,
1892
1902
  onChannelSelect: l,
1893
1903
  onParticipantSelect: m,
1894
- initialParticipantFilter: r,
1904
+ initialParticipantFilter: a,
1895
1905
  initialParticipantData: c,
1896
- CustomChannelEmptyState: x,
1906
+ CustomChannelEmptyState: g,
1897
1907
  showChannelList: h = !0,
1898
1908
  filters: b,
1899
- channelListCustomEmptyStateIndicator: g,
1900
- onDeleteConversationClick: _,
1901
- onBlockParticipantClick: a,
1902
- onReportParticipantClick: E,
1903
- dmAgentEnabled: I,
1909
+ channelListCustomEmptyStateIndicator: x,
1910
+ onDeleteConversationClick: w,
1911
+ onBlockParticipantClick: r,
1912
+ onReportParticipantClick: y,
1913
+ dmAgentEnabled: _,
1904
1914
  messageMetadata: C,
1905
1915
  onMessageSent: M,
1906
- showStarButton: p = !1,
1907
- chatbotVotingEnabled: v = !1,
1908
- renderMessagePreview: w,
1909
- renderChannelBanner: R,
1916
+ showStarButton: E = !1,
1917
+ chatbotVotingEnabled: p = !1,
1918
+ renderMessagePreview: S,
1919
+ renderChannelBanner: L,
1910
1920
  customProfileContent: d,
1911
1921
  customChannelActions: u,
1912
1922
  renderMessage: N
1913
1923
  }) => {
1914
1924
  const {
1915
- service: U,
1925
+ service: v,
1916
1926
  client: f,
1917
- isConnected: y,
1918
- isLoading: L,
1919
- error: G,
1920
- refreshConnection: Z,
1921
- debug: T
1922
- } = Xt(), [q, z] = k(null), [ne, ae] = k(!1), [V, K] = k(!1), [re, O] = k(!1), [F, B] = k(/* @__PURE__ */ new Set()), [H, ce] = k(0), [Y, oe] = k(!1), [ee, J] = k(null), te = Q(null), {
1927
+ isConnected: k,
1928
+ isLoading: H,
1929
+ error: Z,
1930
+ refreshConnection: Y,
1931
+ debug: D
1932
+ } = Kt(), [W, j] = T(null), [ne, ae] = T(!1), [G, K] = T(!1), [re, U] = T(!1), [O, A] = T(/* @__PURE__ */ new Set()), [z, ce] = T(0), [q, oe] = T(!1), [ee, J] = T(null), te = Q(null), {
1923
1933
  participantSource: de,
1924
1934
  participantLabel: ue = "participants",
1925
- showDeleteConversation: Qe = !0
1926
- } = t, Xe = $.useMemo(() => {
1927
- const S = f == null ? void 0 : f.userID;
1935
+ showDeleteConversation: Xe = !0
1936
+ } = t, Ke = B.useMemo(() => {
1937
+ const I = f == null ? void 0 : f.userID;
1928
1938
  return {
1929
1939
  ...{
1930
1940
  type: "messaging",
1931
1941
  last_message_at: { $exists: !0 },
1932
- ...S && {
1933
- members: { $in: [S] },
1942
+ ...I && {
1943
+ members: { $in: [I] },
1934
1944
  hidden: !1
1935
1945
  }
1936
1946
  },
1937
1947
  ...b
1938
1948
  };
1939
1949
  }, [b, f == null ? void 0 : f.userID]), he = Q(null), le = P(async () => {
1940
- if (!f || !y) return;
1941
- const S = f.userID;
1942
- if (S)
1950
+ if (!f || !k) return;
1951
+ const I = f.userID;
1952
+ if (I)
1943
1953
  try {
1944
- T && console.log("[MessagingShell] Syncing channels for user:", S);
1945
- const W = await f.queryChannels(
1954
+ D && console.log("[MessagingShell] Syncing channels for user:", I);
1955
+ const V = await f.queryChannels(
1946
1956
  {
1947
1957
  type: "messaging",
1948
- members: { $in: [S] }
1958
+ members: { $in: [I] }
1949
1959
  },
1950
1960
  {},
1951
1961
  { limit: 100 }
1952
- ), A = /* @__PURE__ */ new Set();
1953
- W.forEach((j) => {
1954
- const we = j.state.members;
1955
- Object.values(we).forEach((rt) => {
1962
+ ), F = /* @__PURE__ */ new Set();
1963
+ V.forEach(($) => {
1964
+ const we = $.state.members;
1965
+ Object.values(we).forEach((ot) => {
1956
1966
  var De;
1957
- const pe = (De = rt.user) == null ? void 0 : De.id;
1958
- pe && pe !== S && A.add(pe);
1967
+ const pe = (De = ot.user) == null ? void 0 : De.id;
1968
+ pe && pe !== I && F.add(pe);
1959
1969
  });
1960
- }), B((j) => j.size === A.size && [...j].every((we) => A.has(we)) ? j : A), ae(W.length > 0), K(!0), he.current = S, T && console.log("[MessagingShell] Channels synced successfully:", {
1961
- channelCount: W.length,
1962
- memberCount: A.size
1970
+ }), A(($) => $.size === F.size && [...$].every((we) => F.has(we)) ? $ : F), ae(V.length > 0), K(!0), he.current = I, D && console.log("[MessagingShell] Channels synced successfully:", {
1971
+ channelCount: V.length,
1972
+ memberCount: F.size
1963
1973
  });
1964
- } catch (W) {
1965
- console.error("[MessagingShell] Failed to sync channels:", W);
1974
+ } catch (V) {
1975
+ console.error("[MessagingShell] Failed to sync channels:", V);
1966
1976
  }
1967
- }, [f, y, T]);
1977
+ }, [f, k, D]);
1968
1978
  X(() => {
1969
- if (!f || !y) return;
1970
- const S = f.userID;
1971
- S && he.current !== S && le();
1972
- }, [f, y, le]), X(() => {
1973
- if (!r || !f || !y) return;
1979
+ if (!f || !k) return;
1980
+ const I = f.userID;
1981
+ I && he.current !== I && le();
1982
+ }, [f, k, le]), X(() => {
1983
+ if (!a || !f || !k) return;
1974
1984
  (async () => {
1975
- const W = f.userID;
1976
- if (W)
1985
+ const V = f.userID;
1986
+ if (V)
1977
1987
  try {
1978
- T && console.log(
1988
+ D && console.log(
1979
1989
  "[MessagingShell] Loading initial conversation with:",
1980
- r
1990
+ a
1981
1991
  );
1982
- const A = await f.queryChannels(
1992
+ const F = await f.queryChannels(
1983
1993
  {
1984
1994
  type: "messaging",
1985
- members: { $eq: [W, r] }
1995
+ members: { $eq: [V, a] }
1986
1996
  },
1987
1997
  {},
1988
1998
  { limit: 1 }
1989
1999
  );
1990
- if (A.length > 0)
1991
- z(A[0]), oe(!0), J(null), l && l(A[0]), T && console.log(
2000
+ if (F.length > 0)
2001
+ j(F[0]), oe(!0), J(null), l && l(F[0]), D && console.log(
1992
2002
  "[MessagingShell] Initial conversation loaded:",
1993
- A[0].id
2003
+ F[0].id
1994
2004
  );
1995
- else if (c && U) {
1996
- T && console.log(
2005
+ else if (c && v) {
2006
+ D && console.log(
1997
2007
  "[MessagingShell] No conversation found, creating one for:",
1998
2008
  c
1999
2009
  );
2000
2010
  try {
2001
- const j = await U.startChannelWithParticipant({
2011
+ const $ = await v.startChannelWithParticipant({
2002
2012
  id: c.id,
2003
2013
  name: c.name,
2004
2014
  email: c.email,
2005
2015
  phone: c.phone
2006
2016
  });
2007
- z(j), oe(!0), J(null), l && l(j), T && console.log(
2017
+ j($), oe(!0), J(null), l && l($), D && console.log(
2008
2018
  "[MessagingShell] Channel created and loaded:",
2009
- j.id
2019
+ $.id
2010
2020
  );
2011
- } catch (j) {
2021
+ } catch ($) {
2012
2022
  console.error(
2013
2023
  "[MessagingShell] Failed to create conversation:",
2014
- j
2024
+ $
2015
2025
  ), J("Failed to create conversation");
2016
2026
  }
2017
2027
  } else
2018
2028
  J(
2019
2029
  "No conversation found with this account"
2020
- ), T && console.log(
2030
+ ), D && console.log(
2021
2031
  "[MessagingShell] No conversation found for:",
2022
- r
2032
+ a
2023
2033
  );
2024
- } catch (A) {
2034
+ } catch (F) {
2025
2035
  console.error(
2026
2036
  "[MessagingShell] Failed to load initial conversation:",
2027
- A
2037
+ F
2028
2038
  ), J("Failed to load conversation");
2029
2039
  }
2030
2040
  })();
2031
2041
  }, [
2032
- r,
2042
+ a,
2033
2043
  c,
2034
2044
  f,
2035
- y,
2036
- U,
2037
- T,
2045
+ k,
2046
+ v,
2047
+ D,
2038
2048
  l
2039
2049
  ]);
2040
- const Ke = P(
2041
- (S) => {
2042
- z(S), l == null || l(S);
2050
+ const et = P(
2051
+ (I) => {
2052
+ j(I), l == null || l(I);
2043
2053
  },
2044
2054
  [l]
2045
- ), et = P(() => {
2046
- Y || z(null);
2047
- }, [Y]), tt = P(
2048
- async (S) => {
2049
- var W;
2050
- if (U)
2055
+ ), tt = P(() => {
2056
+ q || j(null);
2057
+ }, [q]), st = P(
2058
+ async (I) => {
2059
+ var V;
2060
+ if (v)
2051
2061
  try {
2052
- T && console.log(
2062
+ D && console.log(
2053
2063
  "[MessagingShell] Starting conversation with:",
2054
- S.id
2064
+ I.id
2055
2065
  );
2056
- const A = await U.startChannelWithParticipant({
2057
- id: S.id,
2058
- name: S.name,
2059
- email: S.email,
2060
- phone: S.phone
2066
+ const F = await v.startChannelWithParticipant({
2067
+ id: I.id,
2068
+ name: I.name,
2069
+ email: I.email,
2070
+ phone: I.phone
2061
2071
  });
2062
2072
  try {
2063
- await A.show();
2064
- } catch (j) {
2065
- console.warn("[MessagingShell] Failed to unhide channel:", j);
2073
+ await F.show();
2074
+ } catch ($) {
2075
+ console.warn("[MessagingShell] Failed to unhide channel:", $);
2066
2076
  }
2067
- z(A), O(!1), (W = te.current) == null || W.close(), m == null || m(S);
2068
- } catch (A) {
2069
- console.error("[MessagingShell] Failed to start conversation:", A);
2077
+ j(F), U(!1), (V = te.current) == null || V.close(), m == null || m(I);
2078
+ } catch (F) {
2079
+ console.error("[MessagingShell] Failed to start conversation:", F);
2070
2080
  }
2071
2081
  },
2072
- [U, m, T]
2082
+ [v, m, D]
2073
2083
  ), fe = P(() => {
2074
- var S;
2075
- O(!1), (S = te.current) == null || S.close();
2076
- }, []), st = P(
2077
- (S) => {
2078
- S.target === te.current && fe();
2084
+ var I;
2085
+ U(!1), (I = te.current) == null || I.close();
2086
+ }, []), nt = P(
2087
+ (I) => {
2088
+ I.target === te.current && fe();
2079
2089
  },
2080
2090
  [fe]
2081
- ), nt = P(
2082
- async (S) => {
2083
- T && console.log("[MessagingShell] Leaving conversation:", S.id), z(null), oe(!1), he.current = null, await le();
2084
- },
2085
- [le, T]
2086
2091
  ), at = P(
2087
- async (S) => {
2088
- T && console.log("[MessagingShell] Blocking participant:", S), z(null), oe(!1), he.current = null, await le();
2092
+ async (I) => {
2093
+ D && console.log("[MessagingShell] Leaving conversation:", I.id), j(null), oe(!1), he.current = null, await le();
2094
+ },
2095
+ [le, D]
2096
+ ), rt = P(
2097
+ async (I) => {
2098
+ D && console.log("[MessagingShell] Blocking participant:", I), j(null), oe(!1), he.current = null, await le();
2089
2099
  },
2090
- [le, T]
2091
- ), ge = !!q;
2092
- return L ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : G ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ce, { message: G, onBack: Z }) }) : !y || !f ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(
2100
+ [le, D]
2101
+ ), ge = !!W;
2102
+ return H ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: Z, onBack: Y }) }) : !k || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
2093
2103
  Ce,
2094
2104
  {
2095
2105
  message: "Not connected to messaging service",
2096
- onBack: Z
2106
+ onBack: Y
2097
2107
  }
2098
- ) }) : ee ? /* @__PURE__ */ e("div", { className: D("h-full", s), children: /* @__PURE__ */ e(Ce, { message: ee }) }) : /* @__PURE__ */ i(
2108
+ ) }) : ee ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: ee }) }) : /* @__PURE__ */ i(
2099
2109
  "div",
2100
2110
  {
2101
- className: D(
2111
+ className: R(
2102
2112
  "messaging-shell h-full bg-background-primary overflow-hidden",
2103
2113
  s
2104
2114
  ),
@@ -2107,24 +2117,24 @@ const Hs = ({
2107
2117
  /* @__PURE__ */ e(
2108
2118
  "div",
2109
2119
  {
2110
- className: D(
2120
+ className: R(
2111
2121
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2112
2122
  {
2113
- "!hidden": h === !1 || Y,
2123
+ "!hidden": h === !1 || q,
2114
2124
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2115
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !Y && ge,
2125
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && ge,
2116
2126
  // Show on mobile when no channel selected, use same wide width on desktop
2117
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !Y && !ge
2127
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !ge
2118
2128
  }
2119
2129
  ),
2120
2130
  children: /* @__PURE__ */ e(
2121
- We,
2131
+ qe,
2122
2132
  {
2123
- onChannelSelect: Ke,
2124
- selectedChannel: q || void 0,
2125
- filters: Xe,
2126
- customEmptyStateIndicator: g,
2127
- renderMessagePreview: w
2133
+ onChannelSelect: et,
2134
+ selectedChannel: W || void 0,
2135
+ filters: Ke,
2136
+ customEmptyStateIndicator: x,
2137
+ renderMessagePreview: S
2128
2138
  }
2129
2139
  )
2130
2140
  }
@@ -2132,49 +2142,49 @@ const Hs = ({
2132
2142
  /* @__PURE__ */ e(
2133
2143
  "div",
2134
2144
  {
2135
- className: D(
2145
+ className: R(
2136
2146
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
2137
2147
  {
2138
2148
  // In direct conversation mode (or waiting for it), always show (full width)
2139
- flex: Y || ge || r,
2149
+ flex: q || ge || a,
2140
2150
  // Normal mode: hide on mobile when no channel selected
2141
- "hidden lg:flex": !Y && !ge && !r
2151
+ "hidden lg:flex": !q && !ge && !a
2142
2152
  }
2143
2153
  ),
2144
- children: q ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2145
- Ze,
2154
+ children: W ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
2155
+ Je,
2146
2156
  {
2147
- channel: q,
2148
- onBack: et,
2149
- showBackButton: !Y,
2157
+ channel: W,
2158
+ onBack: tt,
2159
+ showBackButton: !q,
2150
2160
  renderMessageInputActions: n,
2151
2161
  renderConversationFooter: o,
2152
- renderChannelBanner: R,
2153
- onLeaveConversation: nt,
2154
- onBlockParticipant: at,
2155
- CustomChannelEmptyState: x,
2156
- showDeleteConversation: Qe,
2157
- onDeleteConversationClick: _,
2158
- onBlockParticipantClick: a,
2159
- onReportParticipantClick: E,
2160
- dmAgentEnabled: I,
2162
+ renderChannelBanner: L,
2163
+ onLeaveConversation: at,
2164
+ onBlockParticipant: rt,
2165
+ CustomChannelEmptyState: g,
2166
+ showDeleteConversation: Xe,
2167
+ onDeleteConversationClick: w,
2168
+ onBlockParticipantClick: r,
2169
+ onReportParticipantClick: y,
2170
+ dmAgentEnabled: _,
2161
2171
  messageMetadata: C,
2162
2172
  onMessageSent: M,
2163
- showStarButton: p,
2164
- chatbotVotingEnabled: v,
2173
+ showStarButton: E,
2174
+ chatbotVotingEnabled: p,
2165
2175
  customProfileContent: d,
2166
2176
  customChannelActions: u,
2167
2177
  renderMessage: N
2168
2178
  },
2169
- q.id
2170
- ) }) : r ? (
2179
+ W.id
2180
+ ) }) : a ? (
2171
2181
  // Show loading while creating/loading direct conversation channel
2172
2182
  /* @__PURE__ */ e(Ne, {})
2173
2183
  ) : /* @__PURE__ */ e(
2174
- Je,
2184
+ Qe,
2175
2185
  {
2176
2186
  hasChannels: ne,
2177
- channelsLoaded: V
2187
+ channelsLoaded: G
2178
2188
  }
2179
2189
  )
2180
2190
  }
@@ -2186,26 +2196,26 @@ const Hs = ({
2186
2196
  {
2187
2197
  ref: te,
2188
2198
  className: "mes-dialog",
2189
- onClick: st,
2199
+ onClick: nt,
2190
2200
  onClose: fe,
2191
2201
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
2192
- Ps,
2202
+ Us,
2193
2203
  {
2194
2204
  participantSource: de,
2195
- onSelectParticipant: tt,
2205
+ onSelectParticipant: st,
2196
2206
  onClose: fe,
2197
- existingParticipantIds: F,
2207
+ existingParticipantIds: O,
2198
2208
  participantLabel: ue,
2199
2209
  searchPlaceholder: `Search ${ue}...`
2200
2210
  },
2201
- H
2211
+ z
2202
2212
  ) })
2203
2213
  }
2204
2214
  )
2205
2215
  ]
2206
2216
  }
2207
2217
  );
2208
- }, Os = ({
2218
+ }, Fs = ({
2209
2219
  question: t,
2210
2220
  onClick: s,
2211
2221
  loading: n = !1,
@@ -2217,7 +2227,7 @@ const Hs = ({
2217
2227
  onClick: s,
2218
2228
  disabled: n,
2219
2229
  style: { backgroundColor: "#E6E5E3" },
2220
- className: D(
2230
+ className: R(
2221
2231
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
2222
2232
  {
2223
2233
  "hover:brightness-95 active:brightness-90": !n,
@@ -2227,22 +2237,22 @@ const Hs = ({
2227
2237
  ),
2228
2238
  children: t
2229
2239
  }
2230
- ), Ws = ({
2240
+ ), qs = ({
2231
2241
  faqs: t,
2232
2242
  onFaqClick: s,
2233
2243
  loadingFaqId: n,
2234
2244
  headerText: o,
2235
2245
  className: l,
2236
2246
  avatarImage: m,
2237
- avatarName: r
2247
+ avatarName: a
2238
2248
  }) => {
2239
- const c = t.filter((x) => x.enabled).sort((x, h) => (x.order ?? 0) - (h.order ?? 0));
2249
+ const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
2240
2250
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2241
- (m || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2251
+ (m || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2242
2252
  se,
2243
2253
  {
2244
- id: r || "account",
2245
- name: r || "Account",
2254
+ id: a || "account",
2255
+ name: a || "Account",
2246
2256
  image: m,
2247
2257
  size: 24,
2248
2258
  shape: "circle"
@@ -2255,75 +2265,75 @@ const Hs = ({
2255
2265
  style: { backgroundColor: "#F1F0EE" },
2256
2266
  children: [
2257
2267
  o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2258
- c.map((x) => /* @__PURE__ */ e(
2259
- Os,
2268
+ c.map((g) => /* @__PURE__ */ e(
2269
+ Fs,
2260
2270
  {
2261
- question: x.question,
2262
- onClick: () => s(x.id),
2263
- loading: n === x.id
2271
+ question: g.question,
2272
+ onClick: () => s(g.id),
2273
+ loading: n === g.id
2264
2274
  },
2265
- x.id
2275
+ g.id
2266
2276
  ))
2267
2277
  ]
2268
2278
  }
2269
2279
  )
2270
2280
  ] }) });
2271
- }, qs = (t, s = {}) => {
2272
- const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = k([]), [r, c] = k(!1), [x, h] = k(null), [b, g] = k(n), [_, a] = k(!0), [E, I] = k(), C = P(async (w = !1, R) => {
2273
- if (r) return;
2274
- const d = R !== void 0 ? R : b;
2281
+ }, Ys = (t, s = {}) => {
2282
+ const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = T([]), [a, c] = T(!1), [g, h] = T(null), [b, x] = T(n), [w, r] = T(!0), [y, _] = T(), C = P(async (S = !1, L) => {
2283
+ if (a) return;
2284
+ const d = L !== void 0 ? L : b;
2275
2285
  c(!0), h(null);
2276
2286
  try {
2277
2287
  const u = await t.loadParticipants({
2278
2288
  search: d || void 0,
2279
2289
  limit: o,
2280
- cursor: w ? void 0 : E
2290
+ cursor: S ? void 0 : y
2281
2291
  });
2282
2292
  m(
2283
- (N) => w ? u.participants : [...N, ...u.participants]
2284
- ), a(u.hasMore), I(u.nextCursor);
2293
+ (N) => S ? u.participants : [...N, ...u.participants]
2294
+ ), r(u.hasMore), _(u.nextCursor);
2285
2295
  } catch (u) {
2286
2296
  const N = u instanceof Error ? u.message : "Failed to load participants";
2287
2297
  h(N), console.error("[useParticipants] Load error:", u);
2288
2298
  } finally {
2289
2299
  c(!1);
2290
2300
  }
2291
- }, [t, b, E, o, r]), M = P(() => {
2292
- _ && !r && C(!1);
2293
- }, [_, r, C]), p = P((w) => {
2294
- g(w), I(void 0), C(!0, w);
2295
- }, [C]), v = P(() => {
2296
- I(void 0), C(!0);
2301
+ }, [t, b, y, o, a]), M = P(() => {
2302
+ w && !a && C(!1);
2303
+ }, [w, a, C]), E = P((S) => {
2304
+ x(S), _(void 0), C(!0, S);
2305
+ }, [C]), p = P(() => {
2306
+ _(void 0), C(!0);
2297
2307
  }, [C]);
2298
2308
  return X(() => {
2299
2309
  C(!0);
2300
2310
  }, [t.loadParticipants]), {
2301
2311
  participants: l,
2302
- loading: r,
2303
- error: x,
2312
+ loading: a,
2313
+ error: g,
2304
2314
  searchQuery: b,
2305
- hasMore: _,
2315
+ hasMore: w,
2306
2316
  totalCount: t.totalCount,
2307
2317
  loadMore: M,
2308
- search: p,
2309
- refresh: v
2318
+ search: E,
2319
+ refresh: p
2310
2320
  };
2311
2321
  };
2312
2322
  export {
2313
2323
  xe as ActionButton,
2314
2324
  se as Avatar,
2315
- ks as ChannelEmptyState,
2316
- We as ChannelList,
2317
- Ze as ChannelView,
2318
- Ws as FaqList,
2319
- Os as FaqListItem,
2320
- xs as MessageVoteButtons,
2321
- Vs as MessagingProvider,
2322
- Hs as MessagingShell,
2323
- Ps as ParticipantPicker,
2324
- ss as formatRelativeTime,
2325
- hs as useMessageVote,
2326
- Xt as useMessaging,
2327
- qs as useParticipants
2325
+ Ts as ChannelEmptyState,
2326
+ qe as ChannelList,
2327
+ Je as ChannelView,
2328
+ qs as FaqList,
2329
+ Fs as FaqListItem,
2330
+ bs as MessageVoteButtons,
2331
+ Hs as MessagingProvider,
2332
+ Ws as MessagingShell,
2333
+ Us as ParticipantPicker,
2334
+ ns as formatRelativeTime,
2335
+ fs as useMessageVote,
2336
+ Kt as useMessaging,
2337
+ Ys as useParticipants
2328
2338
  };
2329
2339
  //# sourceMappingURL=index.js.map