@linktr.ee/messaging-react 1.22.0 โ†’ 1.22.1

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