@linktr.ee/messaging-react 1.24.4 โ†’ 1.25.0

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