@linktr.ee/messaging-react 1.25.1 โ†’ 1.26.1

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