@linktr.ee/messaging-react 1.11.1 → 1.11.3

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,9 +1,9 @@
1
- import { jsx as e, jsxs as c, Fragment as he } from "react/jsx-runtime";
2
- import R from "classnames";
3
- import q, { createContext as Se, useContext as ke, useCallback as _, useState as E, useRef as B, useEffect as H } from "react";
4
- import { StreamChatService as Re } from "@linktr.ee/messaging-core";
5
- import { Chat as pe, ChannelList as Fe, useMessageComposer as Te, useStateStore as De, MessageInput as _e, useMessageInputContext as Me, useMessageComposerHasSendableData as Pe, SimpleAttachmentSelector as Le, QuotedMessagePreview as Ue, AttachmentPreviewList as Oe, TextareaComposer as je, MessageTimestamp as Ae, Channel as ze, useChannelStateContext as fe, Window as Be, MessageList as He } from "stream-chat-react";
6
- import { XIcon as le, ArrowUpIcon as $e, ArrowLeftIcon as ae, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as Ge, ProhibitInsetIcon as ce, FlagIcon as Ve, MagnifyingGlassIcon as We, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
1
+ import { jsx as e, jsxs as o, Fragment as he } from "react/jsx-runtime";
2
+ import p from "classnames";
3
+ import Z, { createContext as Se, useContext as ke, useCallback as F, useState as E, useRef as z, useEffect as G } from "react";
4
+ import { StreamChatService as pe } from "@linktr.ee/messaging-core";
5
+ import { Chat as Re, ChannelList as De, useMessageComposer as _e, useStateStore as Me, MessageInput as Fe, useMessageInputContext as Te, useMessageComposerHasSendableData as Pe, SimpleAttachmentSelector as Le, QuotedMessagePreview as Ue, AttachmentPreviewList as Oe, TextareaComposer as je, MessageTimestamp as Ae, Channel as Be, useChannelStateContext as fe, Window as ze, MessageList as Ge } from "stream-chat-react";
6
+ import { XIcon as le, ArrowUpIcon as He, ArrowLeftIcon as oe, DotsThreeIcon as ie, SpinnerGapIcon as ee, SignOutIcon as $e, ProhibitInsetIcon as ce, FlagIcon as Ve, MagnifyingGlassIcon as We, ChatCircleDotsIcon as de } from "@phosphor-icons/react";
7
7
  import { LinkPreviewsManager as ue } from "stream-chat";
8
8
  const ge = Se({
9
9
  service: null,
@@ -15,32 +15,32 @@ const ge = Se({
15
15
  refreshConnection: async () => {
16
16
  },
17
17
  debug: !1
18
- }), se = () => ke(ge), ys = ({
18
+ }), se = () => ke(ge), Is = ({
19
19
  children: t,
20
20
  user: s,
21
21
  serviceConfig: n,
22
22
  apiKey: l,
23
- capabilities: o = {},
24
- debug: a = !1
23
+ capabilities: a = {},
24
+ debug: i = !1
25
25
  }) => {
26
- const r = _(
26
+ const r = F(
27
27
  (u, ...N) => {
28
- a && console.log(`🔥 [MessagingProvider] ${u}`, ...N);
28
+ i && console.log(`🔥 [MessagingProvider] ${u}`, ...N);
29
29
  },
30
- [a]
30
+ [i]
31
31
  );
32
32
  r("🔄 RENDER START", {
33
33
  userId: s == null ? void 0 : s.id,
34
34
  apiKey: (l == null ? void 0 : l.substring(0, 8)) + "...",
35
35
  serviceConfig: !!n,
36
- capabilities: Object.keys(o)
36
+ capabilities: Object.keys(a)
37
37
  });
38
- const [i, m] = E(null), [x, k] = E(null), [h, f] = E(!1), [y, g] = E(!1), [C, w] = E(null), v = B(!1), I = B({
38
+ const [c, m] = E(null), [x, k] = E(null), [h, f] = E(!1), [y, g] = E(!1), [v, w] = E(null), b = z(!1), I = z({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: l,
41
41
  serviceConfig: n,
42
- capabilities: o
43
- }), S = B(0);
42
+ capabilities: a
43
+ }), S = z(0);
44
44
  S.current++, r("📊 RENDER INFO", {
45
45
  renderCount: S.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (l == null ? void 0 : l.substring(0, 8)) + "..." },
@@ -48,14 +48,14 @@ const ge = Se({
48
48
  userChanged: I.current.userId !== (s == null ? void 0 : s.id),
49
49
  apiKeyChanged: I.current.apiKey !== l,
50
50
  serviceConfigChanged: I.current.serviceConfig !== n,
51
- capabilitiesChanged: I.current.capabilities !== o
51
+ capabilitiesChanged: I.current.capabilities !== a
52
52
  }
53
53
  }), I.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: l,
56
56
  serviceConfig: n,
57
- capabilities: o
58
- }, H(() => {
57
+ capabilities: a
58
+ }, G(() => {
59
59
  const u = S.current;
60
60
  if (r("🔧 SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
@@ -79,10 +79,10 @@ const ge = Se({
79
79
  apiKey: (l == null ? void 0 : l.substring(0, 8)) + "...",
80
80
  serviceConfigChanged: I.current.serviceConfig !== n
81
81
  });
82
- const N = new Re({
82
+ const N = new pe({
83
83
  ...n,
84
84
  apiKey: l,
85
- debug: a
85
+ debug: i
86
86
  });
87
87
  return m(N), r("✅ SERVICE SET", {
88
88
  renderCount: u,
@@ -93,26 +93,26 @@ const ge = Se({
93
93
  reason: "Effect cleanup"
94
94
  }), N.disconnectUser().catch(console.error);
95
95
  };
96
- }, [l, n, a, r]);
97
- const p = B(null);
98
- H(() => {
96
+ }, [l, n, i, r]);
97
+ const R = z(null);
98
+ G(() => {
99
99
  var N, j;
100
100
  if (r("🔗 USER CONNECTION EFFECT TRIGGERED", {
101
- hasService: !!i,
101
+ hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
- isConnecting: v.current,
104
+ isConnecting: b.current,
105
105
  isConnected: h,
106
- dependencies: { service: !!i, userId: s == null ? void 0 : s.id }
107
- }), !i || !s) {
106
+ dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
+ }), !c || !s) {
108
108
  r("⚠️ USER CONNECTION SKIPPED", "Missing service or user");
109
109
  return;
110
110
  }
111
- if (v.current) {
111
+ if (b.current) {
112
112
  r("⚠️ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((N = p.current) == null ? void 0 : N.serviceId) === i && ((j = p.current) == null ? void 0 : j.userId) === s.id) {
115
+ if (((N = R.current) == null ? void 0 : N.serviceId) === c && ((j = R.current) == null ? void 0 : j.userId) === s.id) {
116
116
  r(
117
117
  "⚠️ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,11 +120,11 @@ const ge = Se({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- r("🚀 STARTING USER CONNECTION", { userId: s.id }), v.current = !0, g(!0), w(null);
123
+ r("🚀 STARTING USER CONNECTION", { userId: s.id }), b.current = !0, g(!0), w(null);
124
124
  try {
125
125
  r("📞 CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
- const A = await i.connectUser(s);
127
- k(A), f(!0), p.current = { serviceId: i, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
126
+ const A = await c.connectUser(s);
127
+ k(A), f(!0), R.current = { serviceId: c, userId: s.id }, r("✅ USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: A.userID
130
130
  });
@@ -135,36 +135,36 @@ const ge = Se({
135
135
  error: W
136
136
  });
137
137
  } finally {
138
- g(!1), v.current = !1, r("🔄 USER CONNECTION FINISHED", {
138
+ g(!1), b.current = !1, r("🔄 USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
140
  isConnected: h
141
141
  });
142
142
  }
143
143
  })();
144
- }, [i, s, r, h]), H(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
145
- hasService: !!i,
144
+ }, [c, s, r, h]), G(() => (r("🔌 CLEANUP EFFECT REGISTERED", {
145
+ hasService: !!c,
146
146
  isConnected: h
147
147
  }), () => {
148
- i && h ? (r(
148
+ c && h ? (r(
149
149
  "🧹 CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
- ), p.current = null, i.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
152
- hasService: !!i,
151
+ ), R.current = null, c.disconnectUser().catch(console.error)) : r("🔇 CLEANUP EFFECT SKIPPED", {
152
+ hasService: !!c,
153
153
  isConnected: h
154
154
  });
155
- }), [i, h, r]);
156
- const T = _(async () => {
155
+ }), [c, h, r]);
156
+ const _ = F(async () => {
157
157
  if (r("🔄 REFRESH CONNECTION CALLED", {
158
- hasService: !!i,
158
+ hasService: !!c,
159
159
  hasUser: !!s
160
- }), !i || !s) {
160
+ }), !c || !s) {
161
161
  r("⚠️ REFRESH CONNECTION SKIPPED", "Missing service or user");
162
162
  return;
163
163
  }
164
164
  r("🚀 STARTING CONNECTION REFRESH", { userId: s.id }), g(!0);
165
165
  try {
166
- r("🔌 DISCONNECTING FOR REFRESH"), await i.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
167
- const u = await i.connectUser(s);
166
+ r("🔌 DISCONNECTING FOR REFRESH"), await c.disconnectUser(), r("📞 RECONNECTING FOR REFRESH");
167
+ const u = await c.connectUser(s);
168
168
  k(u), f(!0), w(null), r("✅ CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (u) {
170
170
  const N = u instanceof Error ? u.message : "Refresh failed";
@@ -175,50 +175,59 @@ const ge = Se({
175
175
  } finally {
176
176
  g(!1), r("🔄 CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [i, s, r]), d = q.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
179
- hasService: !!i,
178
+ }, [c, s, r]), d = Z.useMemo(() => (r("💫 CONTEXT VALUE MEMOIZATION", {
179
+ hasService: !!c,
180
180
  hasClient: !!x,
181
181
  isConnected: h,
182
182
  isLoading: y,
183
- hasError: !!C,
184
- capabilitiesKeys: Object.keys(o)
183
+ hasError: !!v,
184
+ capabilitiesKeys: Object.keys(a)
185
185
  }), {
186
- service: i,
186
+ service: c,
187
187
  client: x,
188
188
  isConnected: h,
189
189
  isLoading: y,
190
- error: C,
191
- capabilities: o,
192
- refreshConnection: T,
193
- debug: a
190
+ error: v,
191
+ capabilities: a,
192
+ refreshConnection: _,
193
+ debug: i
194
194
  }), [
195
- i,
195
+ c,
196
196
  x,
197
197
  h,
198
198
  y,
199
- C,
200
- o,
201
- T,
199
+ v,
202
200
  a,
201
+ _,
202
+ i,
203
203
  r
204
204
  ]);
205
205
  return r("🔄 RENDER END", {
206
206
  renderCount: S.current,
207
207
  willRenderChat: !!(x && h),
208
208
  contextValueReady: !!d
209
- }), /* @__PURE__ */ e(ge.Provider, { value: d, children: x && h ? /* @__PURE__ */ e(pe, { client: x, children: t }) : t });
210
- }, qe = () => se(), Ye = (t, s) => {
209
+ }), /* @__PURE__ */ e(ge.Provider, { value: d, children: x && h ? /* @__PURE__ */ e(
210
+ Re,
211
+ {
212
+ client: x,
213
+ customClasses: {
214
+ channelList: "str-chat__channel-list str-chat__channel-list-react bg-transparent lg:border-r-2 border-r-0 border-[#0000000A]"
215
+ },
216
+ children: t
217
+ }
218
+ ) : t });
219
+ }, Ze = () => se(), qe = (t, s) => {
211
220
  const n = new Date(
212
221
  Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())
213
- ), o = new Date(
222
+ ), a = new Date(
214
223
  Date.UTC(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate())
215
224
  ).getTime() - n.getTime();
216
- return Math.floor(o / (1e3 * 60 * 60 * 24));
217
- }, Je = (t) => {
225
+ return Math.floor(a / (1e3 * 60 * 60 * 24));
226
+ }, Ye = (t) => {
218
227
  const s = /* @__PURE__ */ new Date();
219
228
  if (Math.floor((s.getTime() - t.getTime()) / 1e3) < 60)
220
229
  return "Just now";
221
- const l = Ye(t, s);
230
+ const l = qe(t, s);
222
231
  return l === 0 ? t.toLocaleTimeString([], {
223
232
  hour: "numeric",
224
233
  minute: "2-digit"
@@ -255,7 +264,7 @@ const ge = Se({
255
264
  "🍈"
256
265
  // Melon
257
266
  ];
258
- function Qe(t) {
267
+ function Je(t) {
259
268
  let s = 0;
260
269
  for (let n = 0; n < t.length; n++) {
261
270
  const l = t.charCodeAt(n);
@@ -263,25 +272,25 @@ function Qe(t) {
263
272
  }
264
273
  return Math.abs(s);
265
274
  }
266
- function Xe(t) {
267
- const n = Qe(t) % me.length;
275
+ function Qe(t) {
276
+ const n = Je(t) % me.length;
268
277
  return me[n];
269
278
  }
270
- const Y = ({
279
+ const q = ({
271
280
  id: t,
272
281
  image: s,
273
282
  size: n = 40,
274
283
  className: l,
275
- shape: o = "squircle"
284
+ shape: a = "squircle"
276
285
  }) => {
277
- const a = Xe(t), i = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", m = o === "circle" ? { borderRadius: "50%" } : {
286
+ const i = Qe(t), c = n < 32 ? "text-xs" : n < 56 ? "text-sm" : "text-lg", m = a === "circle" ? { borderRadius: "50%" } : {
278
287
  borderRadius: "33%",
279
288
  "corner-shape": "superellipse(1.3)"
280
289
  };
281
290
  return /* @__PURE__ */ e(
282
291
  "div",
283
292
  {
284
- className: R("flex-shrink-0 overflow-hidden", l),
293
+ className: p("flex-shrink-0 overflow-hidden", l),
285
294
  style: {
286
295
  width: `${n}px`,
287
296
  height: `${n}px`,
@@ -298,76 +307,76 @@ const Y = ({
298
307
  "div",
299
308
  {
300
309
  "aria-hidden": "true",
301
- className: R(
310
+ className: p(
302
311
  "avatar-fallback flex h-full w-full items-center justify-center font-semibold bg-[#E6E5E3] select-none transition-colors",
303
- i
312
+ c
304
313
  ),
305
- children: a
314
+ children: i
306
315
  }
307
316
  )
308
317
  }
309
318
  );
310
- }, Ze = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: l = !1, unread: o }) => {
311
- var w, v, I, S, p, T;
312
- const a = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), r = () => {
319
+ }, Xe = ({ channel: t, selectedChannel: s, onChannelSelect: n, debug: l = !1, unread: a }) => {
320
+ var w, b, I, S, R, _;
321
+ const i = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), r = () => {
313
322
  t && n(t);
314
323
  }, m = Object.values(((w = t == null ? void 0 : t.state) == null ? void 0 : w.members) || {}).find(
315
324
  (d) => {
316
325
  var u, N;
317
326
  return ((u = d.user) == null ? void 0 : u.id) && d.user.id !== ((N = t == null ? void 0 : t._client) == null ? void 0 : N.userID);
318
327
  }
319
- ), x = ((v = m == null ? void 0 : m.user) == null ? void 0 : v.name) || "Conversation", k = (I = m == null ? void 0 : m.user) == null ? void 0 : I.image, h = (p = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : p[t.state.messages.length - 1], y = (() => {
328
+ ), x = ((b = m == null ? void 0 : m.user) == null ? void 0 : b.name) || "Conversation", k = (I = m == null ? void 0 : m.user) == null ? void 0 : I.image, h = (R = (S = t == null ? void 0 : t.state) == null ? void 0 : S.messages) == null ? void 0 : R[t.state.messages.length - 1], y = (() => {
320
329
  var u;
321
330
  if (h != null && h.text) return h.text;
322
331
  const d = (u = h == null ? void 0 : h.attachments) == null ? void 0 : u[0];
323
332
  return d != null && d.asset_url ? d.asset_url : d != null && d.image_url ? d.image_url : d != null && d.og_scrape_url ? d.og_scrape_url : d != null && d.thumb_url ? d.thumb_url : "No messages yet";
324
- })(), g = h != null && h.created_at ? Je(new Date(h.created_at)) : "", C = o ?? 0;
333
+ })(), g = h != null && h.created_at ? Ye(new Date(h.created_at)) : "", v = a ?? 0;
325
334
  return l && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
326
335
  channelId: t == null ? void 0 : t.id,
327
- isSelected: a,
336
+ isSelected: i,
328
337
  participantName: x,
329
- unreadCount: C,
338
+ unreadCount: v,
330
339
  hasTimestamp: !!g
331
340
  }), /* @__PURE__ */ e(
332
341
  "button",
333
342
  {
334
343
  type: "button",
335
344
  onClick: r,
336
- className: R(
337
- "group w-full px-4 py-3 transition-colors border-b border-sand text-left max-w-full overflow-hidden focus-ring",
345
+ className: p(
346
+ "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
338
347
  {
339
- "bg-primary-alt/10 border-l-4 border-l-primary": a,
340
- "hover:bg-sand": !a
348
+ "bg-primary-alt/10 border-l-4 border-l-primary": i,
349
+ "hover:bg-sand": !i
341
350
  }
342
351
  ),
343
- children: /* @__PURE__ */ c("div", { className: "flex items-start gap-3", children: [
352
+ children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
344
353
  /* @__PURE__ */ e(
345
- Y,
354
+ q,
346
355
  {
347
- id: ((T = m == null ? void 0 : m.user) == null ? void 0 : T.id) || t.id || "unknown",
356
+ id: ((_ = m == null ? void 0 : m.user) == null ? void 0 : _.id) || t.id || "unknown",
348
357
  name: x,
349
358
  image: k,
350
359
  size: 44,
351
360
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
352
361
  }
353
362
  ),
354
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
355
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2", children: [
363
+ /* @__PURE__ */ o("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
364
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2", children: [
356
365
  /* @__PURE__ */ e(
357
366
  "h3",
358
367
  {
359
- className: R(
368
+ className: p(
360
369
  "text-sm font-medium truncate",
361
- a ? "text-primary" : "text-charcoal"
370
+ i ? "text-primary" : "text-charcoal"
362
371
  ),
363
372
  children: x
364
373
  }
365
374
  ),
366
375
  g && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: g })
367
376
  ] }),
368
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
377
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
369
378
  /* @__PURE__ */ e("p", { className: "text-xs text-stone mr-2 flex-1 line-clamp-2", children: y }),
370
- C > 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: C > 99 ? "99+" : C })
379
+ v > 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: v > 99 ? "99+" : v })
371
380
  ] })
372
381
  ] })
373
382
  ] })
@@ -378,48 +387,48 @@ const Y = ({
378
387
  selectedChannel: s,
379
388
  filters: n,
380
389
  className: l,
381
- customEmptyStateIndicator: o
390
+ customEmptyStateIndicator: a
382
391
  }) => {
383
- const a = q.useRef(0);
384
- a.current++;
392
+ const i = Z.useRef(0);
393
+ i.current++;
385
394
  const { debug: r = !1 } = se();
386
395
  return r && console.log("📺 [ChannelList] 🔄 RENDER START", {
387
- renderCount: a.current,
396
+ renderCount: i.current,
388
397
  selectedChannelId: s == null ? void 0 : s.id,
389
398
  filters: n
390
399
  }), /* @__PURE__ */ e(
391
400
  "div",
392
401
  {
393
- className: R(
402
+ className: p(
394
403
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
395
404
  l
396
405
  ),
397
406
  children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: (r && console.log("📺 [ChannelList] 🎬 RENDERING STREAM CHANNEL LIST", {
398
- renderCount: a.current,
407
+ renderCount: i.current,
399
408
  filters: n
400
409
  }), /* @__PURE__ */ e(
401
- Fe,
410
+ De,
402
411
  {
403
412
  filters: n,
404
413
  sort: { last_message_at: -1 },
405
414
  options: { limit: 30 },
406
- Preview: (i) => {
415
+ Preview: (c) => {
407
416
  var m, x;
408
417
  return r && console.log("📺 [ChannelList] 📋 CHANNEL PREVIEW RENDER", {
409
- channelId: (m = i.channel) == null ? void 0 : m.id,
418
+ channelId: (m = c.channel) == null ? void 0 : m.id,
410
419
  selectedChannelId: s == null ? void 0 : s.id,
411
- isSelected: (s == null ? void 0 : s.id) === ((x = i.channel) == null ? void 0 : x.id)
420
+ isSelected: (s == null ? void 0 : s.id) === ((x = c.channel) == null ? void 0 : x.id)
412
421
  }), /* @__PURE__ */ e(
413
- Ze,
422
+ Xe,
414
423
  {
415
- ...i,
424
+ ...c,
416
425
  selectedChannel: s,
417
426
  onChannelSelect: t,
418
427
  debug: r
419
428
  }
420
429
  );
421
430
  },
422
- EmptyStateIndicator: o
431
+ EmptyStateIndicator: a
423
432
  },
424
433
  JSON.stringify(n)
425
434
  )) })
@@ -434,7 +443,7 @@ const Y = ({
434
443
  "button",
435
444
  {
436
445
  type: "button",
437
- className: R(
446
+ className: p(
438
447
  "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",
439
448
  t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
440
449
  s
@@ -444,11 +453,11 @@ const Y = ({
444
453
  }
445
454
  );
446
455
  function xe({ label: t, className: s, children: n, ...l }) {
447
- return /* @__PURE__ */ c(
456
+ return /* @__PURE__ */ o(
448
457
  "button",
449
458
  {
450
459
  type: "button",
451
- className: R(
460
+ className: p(
452
461
  "rounded-full p-2 transition-colors focus-ring",
453
462
  {
454
463
  "cursor-not-allowed opacity-50": l.disabled,
@@ -475,8 +484,8 @@ const es = (t) => ({
475
484
  link: t,
476
485
  onDismiss: s
477
486
  }) => {
478
- const { og_scrape_url: n, title: l, image_url: o } = t;
479
- return /* @__PURE__ */ c(
487
+ const { og_scrape_url: n, title: l, image_url: a } = t;
488
+ return /* @__PURE__ */ o(
480
489
  "a",
481
490
  {
482
491
  href: n,
@@ -484,10 +493,10 @@ const es = (t) => ({
484
493
  rel: "noopener noreferrer",
485
494
  className: "relative w-full block rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90",
486
495
  children: [
487
- o && /* @__PURE__ */ e(
496
+ a && /* @__PURE__ */ e(
488
497
  "img",
489
498
  {
490
- src: o,
499
+ src: a,
491
500
  alt: l || "",
492
501
  className: "h-[148px] w-full rounded-[20px] object-cover"
493
502
  }
@@ -504,7 +513,7 @@ const es = (t) => ({
504
513
  children: /* @__PURE__ */ e(le, { className: "size-4 text-black/90" })
505
514
  }
506
515
  ),
507
- /* @__PURE__ */ c("div", { className: "p-2", children: [
516
+ /* @__PURE__ */ o("div", { className: "p-2", children: [
508
517
  l && /* @__PURE__ */ e("div", { className: "text-[14px] font-medium leading-5 text-white", children: l }),
509
518
  /* @__PURE__ */ e("div", { className: "text-[12px] leading-4 text-white/55", children: n })
510
519
  ] })
@@ -512,33 +521,33 @@ const es = (t) => ({
512
521
  }
513
522
  );
514
523
  }, ts = () => {
515
- const { linkPreviewsManager: t } = Te(), { linkPreviews: s } = De(
524
+ const { linkPreviewsManager: t } = _e(), { linkPreviews: s } = Me(
516
525
  t.state,
517
526
  es
518
- ), n = (o) => {
519
- t.dismissPreview(o);
527
+ ), n = (a) => {
528
+ t.dismissPreview(a);
520
529
  };
521
- return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((o) => /* @__PURE__ */ e(
530
+ return s.length > 0 ? /* @__PURE__ */ e("div", { className: "str-chat__link-preview-list p-0 gap-2 mb-4", children: s.map((a) => /* @__PURE__ */ e(
522
531
  ss,
523
532
  {
524
- link: o,
533
+ link: a,
525
534
  onDismiss: n
526
535
  },
527
- o.og_scrape_url
536
+ a.og_scrape_url
528
537
  )) }) : null;
529
538
  }, ns = () => {
530
- const { handleSubmit: t } = Me(), s = Pe();
531
- return /* @__PURE__ */ c(he, { children: [
539
+ const { handleSubmit: t } = Te(), s = Pe();
540
+ return /* @__PURE__ */ o(he, { children: [
532
541
  /* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(Le, {}) }),
533
- /* @__PURE__ */ c("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-lg 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: [
542
+ /* @__PURE__ */ o("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: [
534
543
  /* @__PURE__ */ e(Ue, {}),
535
544
  /* @__PURE__ */ e(ts, {}),
536
545
  /* @__PURE__ */ e(Oe, {}),
537
- /* @__PURE__ */ c("div", { className: "flex", children: [
538
- /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4", children: /* @__PURE__ */ e(
546
+ /* @__PURE__ */ o("div", { className: "flex", children: [
547
+ /* @__PURE__ */ e("div", { className: "w-full ml-2 mr-4 self-center leading-[0]", children: /* @__PURE__ */ e(
539
548
  je,
540
549
  {
541
- className: "align-middle w-full resize-none outline-none",
550
+ className: "w-full resize-none outline-none leading-6",
542
551
  maxRows: 4
543
552
  }
544
553
  ) }),
@@ -551,7 +560,7 @@ const es = (t) => ({
551
560
  disabled: !s,
552
561
  onClick: t,
553
562
  type: "button",
554
- children: /* @__PURE__ */ e($e, { className: "size-4" })
563
+ children: /* @__PURE__ */ e(He, { className: "size-4" })
555
564
  }
556
565
  )
557
566
  ] })
@@ -559,51 +568,51 @@ const es = (t) => ({
559
568
  ] });
560
569
  }, rs = ({
561
570
  renderActions: t
562
- }) => /* @__PURE__ */ c("div", { className: "message-input flex items-center gap-2 p-4", children: [
571
+ }) => /* @__PURE__ */ o("div", { className: "message-input flex items-center gap-2 p-4", children: [
563
572
  t && (t == null ? void 0 : t()),
564
- /* @__PURE__ */ e(_e, { Input: ns })
573
+ /* @__PURE__ */ e(Fe, { Input: ns })
565
574
  ] }), ls = (t) => {
566
575
  const s = t.message.hide_date === !0;
567
- return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
568
- /* @__PURE__ */ c("div", { className: "str-chat__message--system__text", children: [
576
+ return /* @__PURE__ */ o("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
577
+ /* @__PURE__ */ o("div", { className: "str-chat__message--system__text", children: [
569
578
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" }),
570
579
  /* @__PURE__ */ e("p", { children: t.message.text }),
571
580
  /* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
572
581
  ] }),
573
582
  !s && /* @__PURE__ */ e(Ae, { message: t.message })
574
583
  ] });
575
- }, be = () => /* @__PURE__ */ e("div", { className: "messaging-channel-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
584
+ }, Ce = () => /* @__PURE__ */ e("div", { className: "messaging-channel-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ o("div", { className: "text-center max-w-sm", children: [
576
585
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "No messages yet 👀" }),
577
586
  /* @__PURE__ */ e("p", { className: "text-stone text-xs", children: "Share to social media to generate more conversations" })
578
- ] }) }), os = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: l }) => {
587
+ ] }) }), as = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: l }) => {
579
588
  var m, x, k, h, f;
580
- const { channel: o } = fe(), a = q.useMemo(() => Object.values(o.state.members || {}).find(
589
+ const { channel: a } = fe(), i = Z.useMemo(() => Object.values(a.state.members || {}).find(
581
590
  (g) => {
582
- var C;
583
- return ((C = g.user) == null ? void 0 : C.id) && g.user.id !== o._client.userID;
591
+ var v;
592
+ return ((v = g.user) == null ? void 0 : v.id) && g.user.id !== a._client.userID;
584
593
  }
585
- ), [o._client.userID, o.state.members]), r = ((m = a == null ? void 0 : a.user) == null ? void 0 : m.name) || ((x = a == null ? void 0 : a.user) == null ? void 0 : x.id) || "Unknown member", i = (k = a == null ? void 0 : a.user) == null ? void 0 : k.image;
586
- return /* @__PURE__ */ c("div", { className: "@container", children: [
587
- /* @__PURE__ */ c("div", { className: "flex justify-between items-center @md:hidden", children: [
594
+ ), [a._client.userID, a.state.members]), r = ((m = i == null ? void 0 : i.user) == null ? void 0 : m.name) || ((x = i == null ? void 0 : i.user) == null ? void 0 : x.id) || "Unknown member", c = (k = i == null ? void 0 : i.user) == null ? void 0 : k.image;
595
+ return /* @__PURE__ */ o("div", { className: "@container", children: [
596
+ /* @__PURE__ */ o("div", { className: "flex justify-between items-center @lg:hidden", children: [
588
597
  /* @__PURE__ */ e(
589
598
  "button",
590
599
  {
591
- className: R(
600
+ className: p(
592
601
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
593
602
  !s && "invisible"
594
603
  ),
595
604
  onClick: t || (() => {
596
605
  }),
597
- children: /* @__PURE__ */ e(ae, { className: "size-5 text-black/90" })
606
+ children: /* @__PURE__ */ e(oe, { className: "size-5 text-black/90" })
598
607
  }
599
608
  ),
600
- /* @__PURE__ */ c("div", { className: "flex flex-col gap-1 items-center", children: [
609
+ /* @__PURE__ */ o("div", { className: "flex flex-col gap-1 items-center", children: [
601
610
  /* @__PURE__ */ e(
602
- Y,
611
+ q,
603
612
  {
604
- id: ((h = a == null ? void 0 : a.user) == null ? void 0 : h.id) || o.id || "unknown",
613
+ id: ((h = i == null ? void 0 : i.user) == null ? void 0 : h.id) || a.id || "unknown",
605
614
  name: r,
606
- image: i,
615
+ image: c,
607
616
  size: 40
608
617
  }
609
618
  ),
@@ -612,7 +621,7 @@ const es = (t) => ({
612
621
  /* @__PURE__ */ e(
613
622
  "button",
614
623
  {
615
- className: R(
624
+ className: p(
616
625
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
617
626
  ),
618
627
  onClick: n || (() => {
@@ -621,8 +630,8 @@ const es = (t) => ({
621
630
  }
622
631
  )
623
632
  ] }),
624
- /* @__PURE__ */ c("div", { className: "hidden @md:flex items-center justify-between gap-3 min-h-12", children: [
625
- /* @__PURE__ */ c("div", { className: "flex items-center gap-4 min-w-0", children: [
633
+ /* @__PURE__ */ o("div", { className: "hidden @lg:flex items-center justify-between gap-3 min-h-12", children: [
634
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-4 min-w-0", children: [
626
635
  s && t && /* @__PURE__ */ e(
627
636
  "button",
628
637
  {
@@ -630,15 +639,15 @@ const es = (t) => ({
630
639
  onClick: t,
631
640
  className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
632
641
  "aria-label": "Back to conversations",
633
- children: /* @__PURE__ */ e(ae, { className: "size-5 text-black/90" })
642
+ children: /* @__PURE__ */ e(oe, { className: "size-5 text-black/90" })
634
643
  }
635
644
  ),
636
645
  /* @__PURE__ */ e(
637
- Y,
646
+ q,
638
647
  {
639
- id: ((f = a == null ? void 0 : a.user) == null ? void 0 : f.id) || o.id || "unknown",
648
+ id: ((f = i == null ? void 0 : i.user) == null ? void 0 : f.id) || a.id || "unknown",
640
649
  name: r,
641
- image: i,
650
+ image: c,
642
651
  size: 40
643
652
  }
644
653
  ),
@@ -647,7 +656,7 @@ const es = (t) => ({
647
656
  l && n && /* @__PURE__ */ e(
648
657
  "button",
649
658
  {
650
- className: R(
659
+ className: p(
651
660
  "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
652
661
  ),
653
662
  onClick: n,
@@ -656,80 +665,80 @@ const es = (t) => ({
656
665
  )
657
666
  ] })
658
667
  ] });
659
- }, as = ({
668
+ }, os = ({
660
669
  isOpen: t,
661
670
  onClose: s,
662
671
  participant: n,
663
672
  channel: l,
664
- followerStatusLabel: o,
665
- onLeaveConversation: a,
673
+ followerStatusLabel: a,
674
+ onLeaveConversation: i,
666
675
  onBlockParticipant: r
667
676
  }) => {
668
- var W, O, G, J, $, V, Q;
669
- const { service: i, debug: m } = se(), x = B(null), [k, h] = E(!1), [f, y] = E(!1), [g, C] = E(!1);
670
- H(() => {
671
- const F = x.current;
672
- F && (t ? F.showModal() : F.close());
677
+ var W, O, $, Y, H, V, J;
678
+ const { service: c, debug: m } = se(), x = z(null), [k, h] = E(!1), [f, y] = E(!1), [g, v] = E(!1);
679
+ G(() => {
680
+ const D = x.current;
681
+ D && (t ? D.showModal() : D.close());
673
682
  }, [t]);
674
- const w = _(async () => {
675
- var F;
676
- if (!(!i || !((F = n == null ? void 0 : n.user) != null && F.id)))
683
+ const w = F(async () => {
684
+ var D;
685
+ if (!(!c || !((D = n == null ? void 0 : n.user) != null && D.id)))
677
686
  try {
678
- const P = (await i.getBlockedUsers()).some(
687
+ const P = (await c.getBlockedUsers()).some(
679
688
  (L) => {
680
- var X;
681
- return L.blocked_user_id === ((X = n == null ? void 0 : n.user) == null ? void 0 : X.id);
689
+ var Q;
690
+ return L.blocked_user_id === ((Q = n == null ? void 0 : n.user) == null ? void 0 : Q.id);
682
691
  }
683
692
  );
684
693
  h(P);
685
- } catch (M) {
694
+ } catch (T) {
686
695
  console.error(
687
696
  "[ChannelInfoDialog] Failed to check blocked status:",
688
- M
697
+ T
689
698
  );
690
699
  }
691
- }, [i, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
692
- H(() => {
700
+ }, [c, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
701
+ G(() => {
693
702
  t && w();
694
703
  }, [t, w]);
695
- const v = async () => {
696
- var F;
704
+ const b = async () => {
705
+ var D;
697
706
  if (!f) {
698
707
  m && console.log("[ChannelInfoDialog] Leave conversation", l.cid), y(!0);
699
708
  try {
700
- const M = ((F = l._client) == null ? void 0 : F.userID) ?? null;
701
- await l.hide(M, !1), a && await a(l), s();
702
- } catch (M) {
703
- console.error("[ChannelInfoDialog] Failed to leave conversation", M);
709
+ const T = ((D = l._client) == null ? void 0 : D.userID) ?? null;
710
+ await l.hide(T, !1), i && await i(l), s();
711
+ } catch (T) {
712
+ console.error("[ChannelInfoDialog] Failed to leave conversation", T);
704
713
  } finally {
705
714
  y(!1);
706
715
  }
707
716
  }
708
717
  }, I = async () => {
709
- var F, M, P;
710
- if (!(g || !i)) {
711
- m && console.log("[ChannelInfoDialog] Block member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), C(!0);
718
+ var D, T, P;
719
+ if (!(g || !c)) {
720
+ m && console.log("[ChannelInfoDialog] Block member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), v(!0);
712
721
  try {
713
- await i.blockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), r && await r((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
722
+ await c.blockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), r && await r((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
714
723
  } catch (L) {
715
724
  console.error("[ChannelInfoDialog] Failed to block member", L);
716
725
  } finally {
717
- C(!1);
726
+ v(!1);
718
727
  }
719
728
  }
720
729
  }, S = async () => {
721
- var F, M, P;
722
- if (!(g || !i)) {
723
- m && console.log("[ChannelInfoDialog] Unblock member", (F = n == null ? void 0 : n.user) == null ? void 0 : F.id), C(!0);
730
+ var D, T, P;
731
+ if (!(g || !c)) {
732
+ m && console.log("[ChannelInfoDialog] Unblock member", (D = n == null ? void 0 : n.user) == null ? void 0 : D.id), v(!0);
724
733
  try {
725
- await i.unBlockUser((M = n == null ? void 0 : n.user) == null ? void 0 : M.id), r && await r((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
734
+ await c.unBlockUser((T = n == null ? void 0 : n.user) == null ? void 0 : T.id), r && await r((P = n == null ? void 0 : n.user) == null ? void 0 : P.id), s();
726
735
  } catch (L) {
727
736
  console.error("[ChannelInfoDialog] Failed to unblock member", L);
728
737
  } finally {
729
- C(!1);
738
+ v(!1);
730
739
  }
731
740
  }
732
- }, p = () => {
741
+ }, R = () => {
733
742
  s(), window.open(
734
743
  "https://linktr.ee/s/about/trust-center/report",
735
744
  "_blank",
@@ -737,75 +746,75 @@ const es = (t) => ({
737
746
  );
738
747
  };
739
748
  if (!n) return null;
740
- const T = ((O = n.user) == null ? void 0 : O.name) || ((G = n.user) == null ? void 0 : G.id) || "Unknown member", d = (J = n.user) == null ? void 0 : J.image, u = ($ = n.user) == null ? void 0 : $.email, N = (V = n.user) == null ? void 0 : V.username, j = u || (N ? `linktr.ee/${N}` : void 0), A = ((Q = n.user) == null ? void 0 : Q.id) || "unknown";
749
+ const _ = ((O = n.user) == null ? void 0 : O.name) || (($ = n.user) == null ? void 0 : $.id) || "Unknown member", d = (Y = n.user) == null ? void 0 : Y.image, u = (H = n.user) == null ? void 0 : H.email, N = (V = n.user) == null ? void 0 : V.username, j = u || (N ? `linktr.ee/${N}` : void 0), A = ((J = n.user) == null ? void 0 : J.id) || "unknown";
741
750
  return (
742
751
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
743
752
  /* @__PURE__ */ e(
744
753
  "dialog",
745
754
  {
746
755
  ref: x,
747
- className: "mes-dialog",
756
+ className: "mes-dialog group",
748
757
  onClose: s,
749
- onClick: (F) => {
750
- F.target === x.current && s();
758
+ onClick: (D) => {
759
+ D.target === x.current && s();
751
760
  },
752
- children: /* @__PURE__ */ c("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-max-elevation-light", children: [
753
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
761
+ children: /* @__PURE__ */ o("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: [
762
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
754
763
  /* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
755
764
  /* @__PURE__ */ e(Ne, { onClick: s })
756
765
  ] }),
757
- /* @__PURE__ */ c("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
766
+ /* @__PURE__ */ o("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
758
767
  /* @__PURE__ */ e(
759
768
  "div",
760
769
  {
761
770
  className: "flex flex-col items-center gap-3 self-stretch px-4 py-2 mt-6 rounded-lg border border-black/[0.04]",
762
771
  style: { backgroundColor: "#FBFAF9" },
763
- children: /* @__PURE__ */ c("div", { className: "flex items-center gap-3 w-full", children: [
772
+ children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3 w-full", children: [
764
773
  /* @__PURE__ */ e(
765
- Y,
774
+ q,
766
775
  {
767
776
  id: A,
768
- name: T,
777
+ name: _,
769
778
  image: d,
770
779
  size: 88,
771
780
  shape: "circle"
772
781
  }
773
782
  ),
774
- /* @__PURE__ */ c("div", { className: "flex flex-col min-w-0 flex-1", children: [
775
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: T }),
783
+ /* @__PURE__ */ o("div", { className: "flex flex-col min-w-0 flex-1", children: [
784
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: _ }),
776
785
  j && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: j }),
777
- o && /* @__PURE__ */ e(
786
+ a && /* @__PURE__ */ e(
778
787
  "span",
779
788
  {
780
789
  className: "mt-1 rounded-full text-xs font-normal w-fit",
781
790
  style: {
782
791
  padding: "4px 8px",
783
- backgroundColor: o === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
784
- color: o === "Subscribed to you" ? "#008236" : "#78716C",
792
+ backgroundColor: a === "Subscribed to you" ? "#DCFCE7" : "#F5F5F4",
793
+ color: a === "Subscribed to you" ? "#008236" : "#78716C",
785
794
  lineHeight: "133.333%",
786
795
  letterSpacing: "0.21px"
787
796
  },
788
- children: o
797
+ children: a
789
798
  }
790
799
  )
791
800
  ] })
792
801
  ] })
793
802
  }
794
803
  ),
795
- /* @__PURE__ */ c("ul", { className: "flex flex-col gap-2 mt-2", children: [
796
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(
804
+ /* @__PURE__ */ o("ul", { className: "flex flex-col gap-2 mt-2", children: [
805
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(
797
806
  K,
798
807
  {
799
- onClick: v,
808
+ onClick: b,
800
809
  disabled: f,
801
810
  "aria-busy": f,
802
811
  children: [
803
- f ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ge, { className: "h-5 w-5" }),
812
+ f ? /* @__PURE__ */ e(ee, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e($e, { className: "h-5 w-5" }),
804
813
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
805
814
  ]
806
815
  }
807
816
  ) }),
808
- /* @__PURE__ */ e("li", { children: k ? /* @__PURE__ */ c(
817
+ /* @__PURE__ */ e("li", { children: k ? /* @__PURE__ */ o(
809
818
  K,
810
819
  {
811
820
  onClick: S,
@@ -816,7 +825,7 @@ const es = (t) => ({
816
825
  /* @__PURE__ */ e("span", { children: "Unblock" })
817
826
  ]
818
827
  }
819
- ) : /* @__PURE__ */ c(
828
+ ) : /* @__PURE__ */ o(
820
829
  K,
821
830
  {
822
831
  onClick: I,
@@ -828,7 +837,7 @@ const es = (t) => ({
828
837
  ]
829
838
  }
830
839
  ) }),
831
- /* @__PURE__ */ e("li", { children: /* @__PURE__ */ c(K, { variant: "danger", onClick: p, children: [
840
+ /* @__PURE__ */ e("li", { children: /* @__PURE__ */ o(K, { variant: "danger", onClick: R, children: [
832
841
  /* @__PURE__ */ e(Ve, { className: "h-5 w-5" }),
833
842
  /* @__PURE__ */ e("span", { children: "Report" })
834
843
  ] }) })
@@ -843,26 +852,26 @@ const es = (t) => ({
843
852
  showBackButton: s,
844
853
  renderMessageInputActions: n,
845
854
  onLeaveConversation: l,
846
- onBlockParticipant: o,
847
- CustomChannelEmptyState: a = be
855
+ onBlockParticipant: a,
856
+ CustomChannelEmptyState: i = Ce
848
857
  }) => {
849
858
  var f, y;
850
- const { channel: r } = fe(), [i, m] = E(!1), x = (((y = (f = r == null ? void 0 : r.state) == null ? void 0 : f.messages) == null ? void 0 : y.length) ?? 0) > 0, k = q.useMemo(() => Object.values(r.state.members || {}).find(
851
- (C) => {
859
+ const { channel: r } = fe(), [c, m] = E(!1), x = (((y = (f = r == null ? void 0 : r.state) == null ? void 0 : f.messages) == null ? void 0 : y.length) ?? 0) > 0, k = Z.useMemo(() => Object.values(r.state.members || {}).find(
860
+ (v) => {
852
861
  var w;
853
- return ((w = C.user) == null ? void 0 : w.id) && C.user.id !== r._client.userID;
862
+ return ((w = v.user) == null ? void 0 : w.id) && v.user.id !== r._client.userID;
854
863
  }
855
- ), [r._client.userID, r.state.members]), h = q.useMemo(() => {
864
+ ), [r._client.userID, r.state.members]), h = Z.useMemo(() => {
856
865
  const g = r.data ?? {};
857
866
  if (g.followerStatus)
858
867
  return String(g.followerStatus);
859
868
  if (g.isFollower !== void 0)
860
869
  return g.isFollower ? "Subscribed to you" : "Not subscribed";
861
870
  }, [r.data]);
862
- return /* @__PURE__ */ c(he, { children: [
863
- /* @__PURE__ */ c(Be, { children: [
871
+ return /* @__PURE__ */ o(he, { children: [
872
+ /* @__PURE__ */ o(ze, { children: [
864
873
  /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
865
- os,
874
+ as,
866
875
  {
867
876
  onBack: t,
868
877
  showBackButton: s,
@@ -870,16 +879,16 @@ const es = (t) => ({
870
879
  canShowInfo: !!k
871
880
  }
872
881
  ) }),
873
- /* @__PURE__ */ c("div", { className: "flex-1 overflow-hidden relative", children: [
882
+ /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden relative", children: [
874
883
  /* @__PURE__ */ e(
875
- He,
884
+ Ge,
876
885
  {
877
886
  hideDeletedMessages: !0,
878
887
  hideNewMessageSeparator: !1,
879
888
  messageActions: []
880
889
  }
881
890
  ),
882
- !x && a && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(a, {}) })
891
+ !x && i && /* @__PURE__ */ e("div", { className: "absolute inset-0 w-full h-full", children: /* @__PURE__ */ e(i, {}) })
883
892
  ] }),
884
893
  /* @__PURE__ */ e(
885
894
  rs,
@@ -889,15 +898,15 @@ const es = (t) => ({
889
898
  )
890
899
  ] }),
891
900
  /* @__PURE__ */ e(
892
- as,
901
+ os,
893
902
  {
894
- isOpen: i,
903
+ isOpen: c,
895
904
  onClose: () => m(!1),
896
905
  participant: k,
897
906
  channel: r,
898
907
  followerStatusLabel: h,
899
908
  onLeaveConversation: l,
900
- onBlockParticipant: o
909
+ onBlockParticipant: a
901
910
  }
902
911
  )
903
912
  ] });
@@ -906,26 +915,26 @@ const es = (t) => ({
906
915
  onBack: s,
907
916
  showBackButton: n = !1,
908
917
  renderMessageInputActions: l,
909
- onLeaveConversation: o,
910
- onBlockParticipant: a,
918
+ onLeaveConversation: a,
919
+ onBlockParticipant: i,
911
920
  className: r,
912
- CustomChannelEmptyState: i = be
921
+ CustomChannelEmptyState: c = Ce
913
922
  }) => /* @__PURE__ */ e(
914
923
  "div",
915
924
  {
916
- className: R(
917
- "messaging-channel-view h-full flex flex-col bg-[#FBFAF9]",
925
+ className: p(
926
+ "messaging-channel-view h-full flex flex-col",
918
927
  r
919
928
  ),
920
- children: /* @__PURE__ */ e(ze, { channel: t, MessageSystem: ls, children: /* @__PURE__ */ e(
929
+ children: /* @__PURE__ */ e(Be, { channel: t, MessageSystem: ls, children: /* @__PURE__ */ e(
921
930
  is,
922
931
  {
923
932
  onBack: s,
924
933
  showBackButton: n,
925
934
  renderMessageInputActions: l,
926
- onLeaveConversation: o,
927
- onBlockParticipant: a,
928
- CustomChannelEmptyState: i
935
+ onLeaveConversation: a,
936
+ onBlockParticipant: i,
937
+ CustomChannelEmptyState: c
929
938
  }
930
939
  ) })
931
940
  }
@@ -935,8 +944,8 @@ function ds({
935
944
  setSearchQuery: s,
936
945
  placeholder: n
937
946
  }) {
938
- const l = B(null);
939
- return /* @__PURE__ */ c("div", { className: "relative", children: [
947
+ const l = z(null);
948
+ return /* @__PURE__ */ o("div", { className: "relative", children: [
940
949
  /* @__PURE__ */ e(
941
950
  We,
942
951
  {
@@ -951,7 +960,7 @@ function ds({
951
960
  type: "text",
952
961
  placeholder: n,
953
962
  value: t,
954
- onChange: (o) => s(o.target.value),
963
+ onChange: (a) => s(a.target.value),
955
964
  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"
956
965
  }
957
966
  ),
@@ -960,8 +969,8 @@ function ds({
960
969
  {
961
970
  label: "Clear search",
962
971
  onClick: () => {
963
- var o;
964
- s(""), (o = l.current) == null || o.focus();
972
+ var a;
973
+ s(""), (a = l.current) == null || a.focus();
965
974
  },
966
975
  className: "absolute right-3 top-1/2 -translate-y-1/2 p-1 text-stone hover:text-charcoal",
967
976
  children: /* @__PURE__ */ e(le, { className: "h-4 w-4", weight: "bold" })
@@ -974,115 +983,115 @@ const us = ({
974
983
  onSelectParticipant: s,
975
984
  onClose: n,
976
985
  existingParticipantIds: l = /* @__PURE__ */ new Set(),
977
- participantLabel: o = "participants",
978
- searchPlaceholder: a = "Search participants...",
986
+ participantLabel: a = "participants",
987
+ searchPlaceholder: i = "Search participants...",
979
988
  className: r
980
989
  }) => {
981
- const { debug: i } = se(), [m, x] = E(""), [k, h] = E([]), [f, y] = E(!1), [g, C] = E(null), [w, v] = E(
990
+ const { debug: c } = se(), [m, x] = E(""), [k, h] = E([]), [f, y] = E(!1), [g, v] = E(null), [w, b] = E(
982
991
  null
983
- ), I = B(!1);
984
- H(() => {
992
+ ), I = z(!1);
993
+ G(() => {
985
994
  if (t.loading) {
986
- i && console.log(
995
+ c && console.log(
987
996
  "[ParticipantPicker] Waiting for participant source to finish loading..."
988
997
  );
989
998
  return;
990
999
  }
991
1000
  if (I.current) return;
992
1001
  (async () => {
993
- i && console.log("[ParticipantPicker] Loading initial participants..."), y(!0), C(null);
1002
+ c && console.log("[ParticipantPicker] Loading initial participants..."), y(!0), v(null);
994
1003
  try {
995
1004
  const u = await t.loadParticipants({
996
1005
  search: "",
997
1006
  // Load all participants initially
998
1007
  limit: 100
999
1008
  });
1000
- h(u.participants), I.current = !0, i && console.log(
1009
+ h(u.participants), I.current = !0, c && console.log(
1001
1010
  "[ParticipantPicker] Participants loaded successfully:",
1002
1011
  u.participants.length
1003
1012
  );
1004
1013
  } catch (u) {
1005
1014
  const N = u instanceof Error ? u.message : "Failed to load participants";
1006
- C(N), console.error("[ParticipantPicker] Failed to load participants:", u);
1015
+ v(N), console.error("[ParticipantPicker] Failed to load participants:", u);
1007
1016
  } finally {
1008
1017
  y(!1);
1009
1018
  }
1010
1019
  })();
1011
- }, [t.loading, i]);
1020
+ }, [t.loading, c]);
1012
1021
  const S = k.filter((d) => !l.has(d.id)).filter((d) => {
1013
1022
  var N;
1014
1023
  if (!m) return !0;
1015
1024
  const u = m.toLowerCase();
1016
1025
  return d.name.toLowerCase().includes(u) || ((N = d.email) == null ? void 0 : N.toLowerCase().includes(u)) || !1;
1017
- }), p = _(
1026
+ }), R = F(
1018
1027
  async (d) => {
1019
1028
  if (!w) {
1020
- v(d.id);
1029
+ b(d.id);
1021
1030
  try {
1022
1031
  await s(d);
1023
1032
  } catch (u) {
1024
- console.error("[ParticipantPicker] Failed to start chat:", u), v(null);
1033
+ console.error("[ParticipantPicker] Failed to start chat:", u), b(null);
1025
1034
  }
1026
1035
  }
1027
1036
  },
1028
1037
  [s, w]
1029
- ), T = (d, u) => {
1030
- (d.key === "Enter" || d.key === " ") && (d.preventDefault(), p(u));
1038
+ ), _ = (d, u) => {
1039
+ (d.key === "Enter" || d.key === " ") && (d.preventDefault(), R(u));
1031
1040
  };
1032
- return /* @__PURE__ */ c("div", { className: R("flex flex-col h-full", r), children: [
1033
- /* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1034
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
1041
+ return /* @__PURE__ */ o("div", { className: p("flex flex-col h-full", r), children: [
1042
+ /* @__PURE__ */ o("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
1043
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-3", children: [
1035
1044
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
1036
1045
  /* @__PURE__ */ e(Ne, { onClick: n })
1037
1046
  ] }),
1038
- /* @__PURE__ */ c("p", { className: "text-xs text-stone mb-3", children: [
1047
+ /* @__PURE__ */ o("p", { className: "text-xs text-stone mb-3", children: [
1039
1048
  "Select a ",
1040
- o.slice(0, -1),
1049
+ a.slice(0, -1),
1041
1050
  " to start messaging (",
1042
1051
  S.length,
1043
1052
  " available)",
1044
- t.totalCount !== void 0 && ` • ${t.totalCount} ${o} total`
1053
+ t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
1045
1054
  ] }),
1046
1055
  /* @__PURE__ */ e(
1047
1056
  ds,
1048
1057
  {
1049
1058
  searchQuery: m,
1050
1059
  setSearchQuery: x,
1051
- placeholder: a
1060
+ placeholder: i
1052
1061
  }
1053
1062
  )
1054
1063
  ] }),
1055
- g && /* @__PURE__ */ c("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1064
+ g && /* @__PURE__ */ o("div", { className: "p-4 text-sm text-danger bg-danger-alt", children: [
1056
1065
  "Error loading ",
1057
- o,
1066
+ a,
1058
1067
  ": ",
1059
1068
  g
1060
1069
  ] }),
1061
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: f && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1070
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: f && S.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1062
1071
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1063
- /* @__PURE__ */ c("span", { className: "text-sm text-stone", children: [
1072
+ /* @__PURE__ */ o("span", { className: "text-sm text-stone", children: [
1064
1073
  "Loading ",
1065
- o,
1074
+ a,
1066
1075
  "..."
1067
1076
  ] })
1068
- ] }) }) : S.length === 0 ? /* @__PURE__ */ c("div", { className: "p-6 text-center", children: [
1077
+ ] }) }) : S.length === 0 ? /* @__PURE__ */ o("div", { className: "p-6 text-center", children: [
1069
1078
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(de, { className: "h-8 w-8 text-charcoal" }) }),
1070
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: m ? `No ${o} found` : k.length > 0 ? `Already chatting with all ${o}` : `No ${o} yet` }),
1071
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: m ? "Try a different search term" : k.length > 0 ? `You have existing conversations with all your ${o}` : `${o.charAt(0).toUpperCase() + o.slice(1)} will appear here` })
1072
- ] }) : /* @__PURE__ */ c("ul", { className: "space-y-0", children: [
1079
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: m ? `No ${a} found` : k.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
1080
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: m ? "Try a different search term" : k.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
1081
+ ] }) : /* @__PURE__ */ o("ul", { className: "space-y-0", children: [
1073
1082
  S.map((d) => {
1074
1083
  const u = d.name || d.email || d.id, N = d.email && d.name ? d.email : d.phone;
1075
1084
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1076
1085
  "button",
1077
1086
  {
1078
1087
  type: "button",
1079
- onClick: () => p(d),
1080
- onKeyDown: (j) => T(j, d),
1088
+ onClick: () => R(d),
1089
+ onKeyDown: (j) => _(j, d),
1081
1090
  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",
1082
- children: /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
1083
- /* @__PURE__ */ c("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1091
+ children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
1092
+ /* @__PURE__ */ o("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1084
1093
  /* @__PURE__ */ e(
1085
- Y,
1094
+ q,
1086
1095
  {
1087
1096
  id: d.id,
1088
1097
  name: u,
@@ -1090,7 +1099,7 @@ const us = ({
1090
1099
  size: 40
1091
1100
  }
1092
1101
  ),
1093
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
1102
+ /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
1094
1103
  /* @__PURE__ */ e("h4", { className: "text-sm font-medium text-charcoal truncate", children: u }),
1095
1104
  N && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: N })
1096
1105
  ] })
@@ -1100,17 +1109,153 @@ const us = ({
1100
1109
  }
1101
1110
  ) }, d.id);
1102
1111
  }),
1103
- f && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1112
+ f && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
1104
1113
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1105
1114
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1106
1115
  ] }) })
1107
1116
  ] }) })
1108
1117
  ] });
1109
- }, ms = ({ hasChannels: t }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
1110
- /* @__PURE__ */ e("div", { className: "w-24 h-24 bg-primary-alt/10 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "💬" }) }),
1111
- /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal", children: "Welcome to Messages" }),
1112
- /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t ? "Choose a conversation from the list." : "No conversations yet." })
1113
- ] }) }), re = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ c("div", { className: "text-center max-w-sm", children: [
1118
+ }, ms = ({ className: t }) => /* @__PURE__ */ o(
1119
+ "svg",
1120
+ {
1121
+ width: "140",
1122
+ height: "120",
1123
+ viewBox: "44 -2 144 126",
1124
+ fill: "none",
1125
+ xmlns: "http://www.w3.org/2000/svg",
1126
+ className: t,
1127
+ children: [
1128
+ /* @__PURE__ */ o("g", { clipPath: "url(#clip0_empty_state)", children: [
1129
+ /* @__PURE__ */ e(
1130
+ "path",
1131
+ {
1132
+ d: "M123.68 82.1932C123.383 103.675 105.839 121 84.2417 121C77.4724 121 71.0986 119.297 65.5327 116.299L52.5873 119.687L53.8036 106.673C48.1776 99.8701 44.7994 91.1453 44.7994 81.6356C44.7994 59.8965 62.4554 42.2754 84.2374 42.2754C89.1328 42.2754 93.8175 43.1633 98.1413 44.789",
1133
+ fill: "#D7D4CE"
1134
+ }
1135
+ ),
1136
+ /* @__PURE__ */ e(
1137
+ "path",
1138
+ {
1139
+ d: "M84.2458 86.0364C82.2851 86.0364 80.6957 84.4501 80.6957 82.4933C80.6957 80.5365 82.2851 78.9502 84.2458 78.9502C86.2065 78.9502 87.7959 80.5365 87.7959 82.4933C87.7959 84.4501 86.2065 86.0364 84.2458 86.0364Z",
1140
+ fill: "white"
1141
+ }
1142
+ ),
1143
+ /* @__PURE__ */ e(
1144
+ "path",
1145
+ {
1146
+ d: "M68.3044 86.0364C66.3437 86.0364 64.7543 84.4501 64.7543 82.4933C64.7543 80.5365 66.3437 78.9502 68.3044 78.9502C70.2651 78.9502 71.8545 80.5365 71.8545 82.4933C71.8545 84.4501 70.2651 86.0364 68.3044 86.0364Z",
1147
+ fill: "white"
1148
+ }
1149
+ ),
1150
+ /* @__PURE__ */ e(
1151
+ "path",
1152
+ {
1153
+ d: "M100.183 86.0364C98.2226 86.0364 96.6332 84.4501 96.6332 82.4933C96.6332 80.5365 98.2226 78.9502 100.183 78.9502C102.144 78.9502 103.733 80.5365 103.733 82.4933C103.733 84.4501 102.144 86.0364 100.183 86.0364Z",
1154
+ fill: "white"
1155
+ }
1156
+ ),
1157
+ /* @__PURE__ */ o("g", { filter: "url(#filter0_empty_state)", children: [
1158
+ /* @__PURE__ */ e(
1159
+ "path",
1160
+ {
1161
+ d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
1162
+ fill: "white"
1163
+ }
1164
+ ),
1165
+ /* @__PURE__ */ e(
1166
+ "path",
1167
+ {
1168
+ d: "M171.522 68.7154C177.443 61.4539 181 52.1488 181 42C181 18.8027 162.421 0 139.5 0C116.579 0 98 18.8027 98 42C98 65.1973 116.579 84 139.5 84C146.622 84 153.328 82.1857 159.184 78.9829L172.801 82.5993L171.522 68.7154Z",
1169
+ stroke: "#D7D4CE",
1170
+ strokeWidth: "2",
1171
+ strokeMiterlimit: "10"
1172
+ }
1173
+ )
1174
+ ] }),
1175
+ /* @__PURE__ */ e(
1176
+ "path",
1177
+ {
1178
+ d: "M139.502 45.5431C137.541 45.5431 135.952 43.9568 135.952 42C135.952 40.0432 137.541 38.4569 139.502 38.4569C141.462 38.4569 143.052 40.0432 143.052 42C143.052 43.9568 141.462 45.5431 139.502 45.5431Z",
1179
+ fill: "#D7D4CE"
1180
+ }
1181
+ ),
1182
+ /* @__PURE__ */ e(
1183
+ "path",
1184
+ {
1185
+ d: "M123.561 45.5431C121.601 45.5431 120.011 43.9568 120.011 42C120.011 40.0432 121.601 38.4569 123.561 38.4569C125.522 38.4569 127.111 40.0432 127.111 42C127.111 43.9568 125.522 45.5431 123.561 45.5431Z",
1186
+ fill: "#D7D4CE"
1187
+ }
1188
+ ),
1189
+ /* @__PURE__ */ e(
1190
+ "path",
1191
+ {
1192
+ d: "M155.439 45.5431C153.478 45.5431 151.889 43.9568 151.889 42C151.889 40.0432 153.478 38.4569 155.439 38.4569C157.4 38.4569 158.989 40.0432 158.989 42C158.989 43.9568 157.4 45.5431 155.439 45.5431Z",
1193
+ fill: "#D7D4CE"
1194
+ }
1195
+ )
1196
+ ] }),
1197
+ /* @__PURE__ */ o("defs", { children: [
1198
+ /* @__PURE__ */ o(
1199
+ "filter",
1200
+ {
1201
+ id: "filter0_empty_state",
1202
+ x: "97",
1203
+ y: "-1",
1204
+ width: "89",
1205
+ height: "90",
1206
+ filterUnits: "userSpaceOnUse",
1207
+ colorInterpolationFilters: "sRGB",
1208
+ children: [
1209
+ /* @__PURE__ */ e("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }),
1210
+ /* @__PURE__ */ e(
1211
+ "feColorMatrix",
1212
+ {
1213
+ in: "SourceAlpha",
1214
+ type: "matrix",
1215
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",
1216
+ result: "hardAlpha"
1217
+ }
1218
+ ),
1219
+ /* @__PURE__ */ e("feOffset", { dx: "4", dy: "4" }),
1220
+ /* @__PURE__ */ e("feComposite", { in2: "hardAlpha", operator: "out" }),
1221
+ /* @__PURE__ */ e(
1222
+ "feColorMatrix",
1223
+ {
1224
+ type: "matrix",
1225
+ values: "0 0 0 0 0.8428 0 0 0 0 0.830064 0 0 0 0 0.8095 0 0 0 1 0"
1226
+ }
1227
+ ),
1228
+ /* @__PURE__ */ e(
1229
+ "feBlend",
1230
+ {
1231
+ mode: "normal",
1232
+ in2: "BackgroundImageFix",
1233
+ result: "effect1_dropShadow"
1234
+ }
1235
+ ),
1236
+ /* @__PURE__ */ e(
1237
+ "feBlend",
1238
+ {
1239
+ mode: "normal",
1240
+ in: "SourceGraphic",
1241
+ in2: "effect1_dropShadow",
1242
+ result: "shape"
1243
+ }
1244
+ )
1245
+ ]
1246
+ }
1247
+ ),
1248
+ /* @__PURE__ */ e("clipPath", { id: "clip0_empty_state", children: /* @__PURE__ */ e("rect", { width: "233", height: "233", fill: "white" }) })
1249
+ ] })
1250
+ ]
1251
+ }
1252
+ ), hs = ({ hasChannels: t }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
1253
+ /* @__PURE__ */ e(ms, {}),
1254
+ !t && /* @__PURE__ */ o("div", { className: "mt-8", children: [
1255
+ /* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
1256
+ /* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
1257
+ ] })
1258
+ ] }) }), re = ({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ o("div", { className: "text-center max-w-sm", children: [
1114
1259
  /* @__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: "⚠️" }) }),
1115
1260
  /* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
1116
1261
  /* @__PURE__ */ e("p", { className: "text-stone text-sm mb-6", children: t }),
@@ -1123,12 +1268,12 @@ const us = ({
1123
1268
  children: "Go Back"
1124
1269
  }
1125
1270
  )
1126
- ] }) }), hs = ({ className: t, message: s }) => /* @__PURE__ */ c(
1271
+ ] }) }), fs = ({ className: t, message: s }) => /* @__PURE__ */ o(
1127
1272
  "div",
1128
1273
  {
1129
- className: R("flex items-center justify-center h-full", t),
1274
+ className: p("flex items-center justify-center h-full", t),
1130
1275
  children: [
1131
- /* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1276
+ /* @__PURE__ */ o("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
1132
1277
  /* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
1133
1278
  "animateTransform",
1134
1279
  {
@@ -1166,18 +1311,18 @@ const us = ({
1166
1311
  s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
1167
1312
  ]
1168
1313
  }
1169
- ), fs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ c("div", { className: "flex items-center", children: [
1170
- /* @__PURE__ */ e(hs, { className: "w-6 h-6" }),
1314
+ ), gs = () => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ o("div", { className: "flex items-center", children: [
1315
+ /* @__PURE__ */ e(fs, { className: "w-6 h-6" }),
1171
1316
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
1172
- ] }) }), Is = ({
1317
+ ] }) }), Ss = ({
1173
1318
  capabilities: t = {},
1174
1319
  className: s,
1175
1320
  renderMessageInputActions: n,
1176
1321
  onChannelSelect: l,
1177
- onParticipantSelect: o,
1178
- initialParticipantFilter: a,
1322
+ onParticipantSelect: a,
1323
+ initialParticipantFilter: i,
1179
1324
  initialParticipantData: r,
1180
- CustomChannelEmptyState: i,
1325
+ CustomChannelEmptyState: c,
1181
1326
  showChannelList: m = !0,
1182
1327
  filters: x,
1183
1328
  channelListCustomEmptyStateIndicator: k
@@ -1187,205 +1332,205 @@ const us = ({
1187
1332
  client: f,
1188
1333
  isConnected: y,
1189
1334
  isLoading: g,
1190
- error: C,
1335
+ error: v,
1191
1336
  refreshConnection: w,
1192
- debug: v
1193
- } = qe(), [I, S] = E(null), [p, T] = E(!1), [d, u] = E(!1), [N, j] = E(/* @__PURE__ */ new Set()), [A, W] = E(0), [O, G] = E(!1), [J, $] = E(null), V = B(null), { participantSource: Q, participantLabel: F = "participants" } = t, M = q.useMemo(() => {
1194
- const b = f == null ? void 0 : f.userID;
1337
+ debug: b
1338
+ } = Ze(), [I, S] = E(null), [R, _] = E(!1), [d, u] = E(!1), [N, j] = E(/* @__PURE__ */ new Set()), [A, W] = E(0), [O, $] = E(!1), [Y, H] = E(null), V = z(null), { participantSource: J, participantLabel: D = "participants" } = t, T = Z.useMemo(() => {
1339
+ const C = f == null ? void 0 : f.userID;
1195
1340
  return {
1196
1341
  ...{
1197
1342
  type: "messaging",
1198
1343
  last_message_at: { $exists: !0 },
1199
- ...b && {
1200
- members: { $in: [b] },
1344
+ ...C && {
1345
+ members: { $in: [C] },
1201
1346
  hidden: !1
1202
1347
  }
1203
1348
  },
1204
1349
  ...x
1205
1350
  };
1206
- }, [x, f == null ? void 0 : f.userID]), P = B(null), L = _(async () => {
1351
+ }, [x, f == null ? void 0 : f.userID]), P = z(null), L = F(async () => {
1207
1352
  if (!f || !y) return;
1208
- const b = f.userID;
1209
- if (b)
1353
+ const C = f.userID;
1354
+ if (C)
1210
1355
  try {
1211
- v && console.log("[MessagingShell] Syncing channels for user:", b);
1356
+ b && console.log("[MessagingShell] Syncing channels for user:", C);
1212
1357
  const U = await f.queryChannels(
1213
1358
  {
1214
1359
  type: "messaging",
1215
- members: { $in: [b] }
1360
+ members: { $in: [C] }
1216
1361
  },
1217
1362
  {},
1218
1363
  { limit: 100 }
1219
- ), D = /* @__PURE__ */ new Set();
1220
- U.forEach((z) => {
1221
- const ye = z.state.members;
1364
+ ), M = /* @__PURE__ */ new Set();
1365
+ U.forEach((B) => {
1366
+ const ye = B.state.members;
1222
1367
  Object.values(ye).forEach((Ie) => {
1223
- var oe;
1224
- const ne = (oe = Ie.user) == null ? void 0 : oe.id;
1225
- ne && ne !== b && D.add(ne);
1368
+ var ae;
1369
+ const ne = (ae = Ie.user) == null ? void 0 : ae.id;
1370
+ ne && ne !== C && M.add(ne);
1226
1371
  });
1227
- }), j(D), T(U.length > 0), P.current = b, v && console.log("[MessagingShell] Channels synced successfully:", {
1372
+ }), j(M), _(U.length > 0), P.current = C, b && console.log("[MessagingShell] Channels synced successfully:", {
1228
1373
  channelCount: U.length,
1229
- memberCount: D.size
1374
+ memberCount: M.size
1230
1375
  });
1231
1376
  } catch (U) {
1232
1377
  console.error("[MessagingShell] Failed to sync channels:", U);
1233
1378
  }
1234
- }, [f, y, v]);
1235
- H(() => {
1379
+ }, [f, y, b]);
1380
+ G(() => {
1236
1381
  if (!f || !y) return;
1237
- const b = f.userID;
1238
- b && P.current !== b && L();
1239
- }, [f, y, L]), H(() => {
1240
- if (!a || !f || !y) return;
1382
+ const C = f.userID;
1383
+ C && P.current !== C && L();
1384
+ }, [f, y, L]), G(() => {
1385
+ if (!i || !f || !y) return;
1241
1386
  (async () => {
1242
1387
  const U = f.userID;
1243
1388
  if (U)
1244
1389
  try {
1245
- v && console.log(
1390
+ b && console.log(
1246
1391
  "[MessagingShell] Loading initial conversation with:",
1247
- a
1392
+ i
1248
1393
  );
1249
- const D = await f.queryChannels(
1394
+ const M = await f.queryChannels(
1250
1395
  {
1251
1396
  type: "messaging",
1252
- members: { $eq: [U, a] }
1397
+ members: { $eq: [U, i] }
1253
1398
  },
1254
1399
  {},
1255
1400
  { limit: 1 }
1256
1401
  );
1257
- if (D.length > 0)
1258
- S(D[0]), G(!0), $(null), l && l(D[0]), v && console.log(
1402
+ if (M.length > 0)
1403
+ S(M[0]), $(!0), H(null), l && l(M[0]), b && console.log(
1259
1404
  "[MessagingShell] Initial conversation loaded:",
1260
- D[0].id
1405
+ M[0].id
1261
1406
  );
1262
1407
  else if (r && h) {
1263
- v && console.log(
1408
+ b && console.log(
1264
1409
  "[MessagingShell] No conversation found, creating one for:",
1265
1410
  r
1266
1411
  );
1267
1412
  try {
1268
- const z = await h.startChannelWithParticipant({
1413
+ const B = await h.startChannelWithParticipant({
1269
1414
  id: r.id,
1270
1415
  name: r.name,
1271
1416
  email: r.email,
1272
1417
  phone: r.phone
1273
1418
  });
1274
- S(z), G(!0), $(null), l && l(z), v && console.log(
1419
+ S(B), $(!0), H(null), l && l(B), b && console.log(
1275
1420
  "[MessagingShell] Channel created and loaded:",
1276
- z.id
1421
+ B.id
1277
1422
  );
1278
- } catch (z) {
1423
+ } catch (B) {
1279
1424
  console.error(
1280
1425
  "[MessagingShell] Failed to create conversation:",
1281
- z
1282
- ), $("Failed to create conversation");
1426
+ B
1427
+ ), H("Failed to create conversation");
1283
1428
  }
1284
1429
  } else
1285
- $(
1430
+ H(
1286
1431
  "No conversation found with this account"
1287
- ), v && console.log(
1432
+ ), b && console.log(
1288
1433
  "[MessagingShell] No conversation found for:",
1289
- a
1434
+ i
1290
1435
  );
1291
- } catch (D) {
1436
+ } catch (M) {
1292
1437
  console.error(
1293
1438
  "[MessagingShell] Failed to load initial conversation:",
1294
- D
1295
- ), $("Failed to load conversation");
1439
+ M
1440
+ ), H("Failed to load conversation");
1296
1441
  }
1297
1442
  })();
1298
1443
  }, [
1299
- a,
1444
+ i,
1300
1445
  r,
1301
1446
  f,
1302
1447
  y,
1303
1448
  h,
1304
- v,
1449
+ b,
1305
1450
  l
1306
1451
  ]);
1307
- const X = _(
1308
- (b) => {
1309
- S(b), l == null || l(b);
1452
+ const Q = F(
1453
+ (C) => {
1454
+ S(C), l == null || l(C);
1310
1455
  },
1311
1456
  [l]
1312
- ), ve = _(() => {
1457
+ ), be = F(() => {
1313
1458
  O || S(null);
1314
- }, [O]), Ce = _(
1315
- async (b) => {
1459
+ }, [O]), ve = F(
1460
+ async (C) => {
1316
1461
  var U;
1317
1462
  if (h)
1318
1463
  try {
1319
- v && console.log(
1464
+ b && console.log(
1320
1465
  "[MessagingShell] Starting conversation with:",
1321
- b.id
1466
+ C.id
1322
1467
  );
1323
- const D = await h.startChannelWithParticipant({
1324
- id: b.id,
1325
- name: b.name,
1326
- email: b.email,
1327
- phone: b.phone
1468
+ const M = await h.startChannelWithParticipant({
1469
+ id: C.id,
1470
+ name: C.name,
1471
+ email: C.email,
1472
+ phone: C.phone
1328
1473
  });
1329
1474
  try {
1330
- await D.show();
1331
- } catch (z) {
1332
- console.warn("[MessagingShell] Failed to unhide channel:", z);
1475
+ await M.show();
1476
+ } catch (B) {
1477
+ console.warn("[MessagingShell] Failed to unhide channel:", B);
1333
1478
  }
1334
- S(D), u(!1), (U = V.current) == null || U.close(), o == null || o(b);
1335
- } catch (D) {
1336
- console.error("[MessagingShell] Failed to start conversation:", D);
1479
+ S(M), u(!1), (U = V.current) == null || U.close(), a == null || a(C);
1480
+ } catch (M) {
1481
+ console.error("[MessagingShell] Failed to start conversation:", M);
1337
1482
  }
1338
1483
  },
1339
- [h, o, v]
1340
- ), te = _(() => {
1341
- var b;
1342
- u(!1), (b = V.current) == null || b.close();
1343
- }, []), we = _(
1344
- async (b) => {
1345
- v && console.log("[MessagingShell] Leaving conversation:", b.id), S(null), G(!1), P.current = null, await L();
1484
+ [h, a, b]
1485
+ ), te = F(() => {
1486
+ var C;
1487
+ u(!1), (C = V.current) == null || C.close();
1488
+ }, []), we = F(
1489
+ async (C) => {
1490
+ b && console.log("[MessagingShell] Leaving conversation:", C.id), S(null), $(!1), P.current = null, await L();
1346
1491
  },
1347
- [L, v]
1348
- ), Ee = _(
1349
- async (b) => {
1350
- v && console.log("[MessagingShell] Blocking participant:", b), S(null), G(!1), P.current = null, await L();
1492
+ [L, b]
1493
+ ), Ee = F(
1494
+ async (C) => {
1495
+ b && console.log("[MessagingShell] Blocking participant:", C), S(null), $(!1), P.current = null, await L();
1351
1496
  },
1352
- [L, v]
1353
- ), Z = !!I;
1354
- return g ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(fs, {}) }) : C ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(re, { message: C, onBack: w }) }) : !y || !f ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
1497
+ [L, b]
1498
+ ), X = !!I;
1499
+ return g ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(gs, {}) }) : v ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(re, { message: v, onBack: w }) }) : !y || !f ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
1355
1500
  re,
1356
1501
  {
1357
1502
  message: "Not connected to messaging service",
1358
1503
  onBack: w
1359
1504
  }
1360
- ) }) : J ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(re, { message: J }) }) : /* @__PURE__ */ c(
1505
+ ) }) : Y ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(re, { message: Y }) }) : /* @__PURE__ */ o(
1361
1506
  "div",
1362
1507
  {
1363
- className: R(
1364
- "messaging-shell h-full bg-white overflow-hidden",
1508
+ className: p(
1509
+ "messaging-shell h-full bg-background-secondary overflow-hidden",
1365
1510
  s
1366
1511
  ),
1367
1512
  children: [
1368
- /* @__PURE__ */ c("div", { className: "flex h-full min-h-0", children: [
1513
+ /* @__PURE__ */ o("div", { className: "flex h-full min-h-0", children: [
1369
1514
  /* @__PURE__ */ e(
1370
1515
  "div",
1371
1516
  {
1372
- className: R(
1373
- "messaging-channel-list-sidebar min-h-0 min-w-0 bg-white lg:bg-chalk lg:flex lg:flex-col lg:border-r lg:border-sand",
1517
+ className: p(
1518
+ "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
1374
1519
  {
1375
1520
  // Explicitly hidden via prop or in direct conversation mode
1376
1521
  "!hidden": m === !1 || O,
1377
1522
  // Normal mode: hide on mobile when channel selected, show on desktop
1378
- "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": m !== !1 && !O && Z,
1523
+ "hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": m !== !1 && !O && X,
1379
1524
  // Normal mode: show when no channel selected
1380
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !O && !Z
1525
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": m !== !1 && !O && !X
1381
1526
  }
1382
1527
  ),
1383
1528
  children: /* @__PURE__ */ e(
1384
1529
  Ke,
1385
1530
  {
1386
- onChannelSelect: X,
1531
+ onChannelSelect: Q,
1387
1532
  selectedChannel: I || void 0,
1388
- filters: M,
1533
+ filters: T,
1389
1534
  customEmptyStateIndicator: k
1390
1535
  }
1391
1536
  )
@@ -1394,50 +1539,50 @@ const us = ({
1394
1539
  /* @__PURE__ */ e(
1395
1540
  "div",
1396
1541
  {
1397
- className: R(
1542
+ className: p(
1398
1543
  "messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
1399
1544
  {
1400
1545
  // In direct conversation mode, always show (full width)
1401
- flex: O || Z,
1546
+ flex: O || X,
1402
1547
  // Normal mode: hide on mobile when no channel selected
1403
- "hidden lg:flex": !O && !Z
1548
+ "hidden lg:flex": !O && !X
1404
1549
  }
1405
1550
  ),
1406
1551
  children: I ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
1407
1552
  cs,
1408
1553
  {
1409
1554
  channel: I,
1410
- onBack: ve,
1555
+ onBack: be,
1411
1556
  showBackButton: !O,
1412
1557
  renderMessageInputActions: n,
1413
1558
  onLeaveConversation: we,
1414
1559
  onBlockParticipant: Ee,
1415
- CustomChannelEmptyState: i
1560
+ CustomChannelEmptyState: c
1416
1561
  },
1417
1562
  I.id
1418
- ) }) : /* @__PURE__ */ e(ms, { hasChannels: p })
1563
+ ) }) : /* @__PURE__ */ e(hs, { hasChannels: R })
1419
1564
  }
1420
1565
  )
1421
1566
  ] }),
1422
- Q && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1567
+ J && // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1423
1568
  /* @__PURE__ */ e(
1424
1569
  "dialog",
1425
1570
  {
1426
1571
  ref: V,
1427
1572
  className: "mes-dialog",
1428
- onClick: (b) => {
1429
- b.target === V.current && te();
1573
+ onClick: (C) => {
1574
+ C.target === V.current && te();
1430
1575
  },
1431
1576
  onClose: te,
1432
1577
  children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
1433
1578
  us,
1434
1579
  {
1435
- participantSource: Q,
1436
- onSelectParticipant: Ce,
1580
+ participantSource: J,
1581
+ onSelectParticipant: ve,
1437
1582
  onClose: te,
1438
1583
  existingParticipantIds: N,
1439
- participantLabel: F,
1440
- searchPlaceholder: `Search ${F}...`
1584
+ participantLabel: D,
1585
+ searchPlaceholder: `Search ${D}...`
1441
1586
  },
1442
1587
  A
1443
1588
  ) })
@@ -1446,7 +1591,7 @@ const us = ({
1446
1591
  ]
1447
1592
  }
1448
1593
  );
1449
- }, gs = ({
1594
+ }, xs = ({
1450
1595
  question: t,
1451
1596
  onClick: s,
1452
1597
  loading: n = !1,
@@ -1458,7 +1603,7 @@ const us = ({
1458
1603
  onClick: s,
1459
1604
  disabled: n,
1460
1605
  style: { backgroundColor: "#E6E5E3" },
1461
- className: R(
1606
+ className: p(
1462
1607
  "w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors",
1463
1608
  {
1464
1609
  "hover:brightness-95 active:brightness-90": !n,
@@ -1468,36 +1613,36 @@ const us = ({
1468
1613
  ),
1469
1614
  children: t
1470
1615
  }
1471
- ), Ss = ({
1616
+ ), ks = ({
1472
1617
  faqs: t,
1473
1618
  onFaqClick: s,
1474
1619
  loadingFaqId: n,
1475
1620
  headerText: l,
1476
- className: o,
1477
- avatarImage: a,
1621
+ className: a,
1622
+ avatarImage: i,
1478
1623
  avatarName: r
1479
1624
  }) => {
1480
- const i = t.filter((m) => m.enabled).sort((m, x) => (m.order ?? 0) - (x.order ?? 0));
1481
- return i.length === 0 ? null : /* @__PURE__ */ e("div", { className: o, children: /* @__PURE__ */ c("div", { className: "flex gap-3 items-end", children: [
1482
- (a || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1483
- Y,
1625
+ const c = t.filter((m) => m.enabled).sort((m, x) => (m.order ?? 0) - (x.order ?? 0));
1626
+ return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: a, children: /* @__PURE__ */ o("div", { className: "flex gap-3 items-end", children: [
1627
+ (i || r) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
1628
+ q,
1484
1629
  {
1485
1630
  id: r || "account",
1486
1631
  name: r || "Account",
1487
- image: a,
1632
+ image: i,
1488
1633
  size: 24,
1489
1634
  shape: "circle"
1490
1635
  }
1491
1636
  ) }),
1492
- /* @__PURE__ */ c(
1637
+ /* @__PURE__ */ o(
1493
1638
  "div",
1494
1639
  {
1495
1640
  className: "flex-1 flex flex-col gap-3 rounded-lg p-4",
1496
1641
  style: { backgroundColor: "#F1F0EE" },
1497
1642
  children: [
1498
1643
  l && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: l }),
1499
- i.map((m) => /* @__PURE__ */ e(
1500
- gs,
1644
+ c.map((m) => /* @__PURE__ */ e(
1645
+ xs,
1501
1646
  {
1502
1647
  question: m.question,
1503
1648
  onClick: () => s(m.id),
@@ -1509,59 +1654,59 @@ const us = ({
1509
1654
  }
1510
1655
  )
1511
1656
  ] }) });
1512
- }, ks = (t, s = {}) => {
1513
- const { initialSearch: n = "", pageSize: l = 20 } = s, [o, a] = E([]), [r, i] = E(!1), [m, x] = E(null), [k, h] = E(n), [f, y] = E(!0), [g, C] = E(), w = _(async (p = !1, T) => {
1657
+ }, ps = (t, s = {}) => {
1658
+ const { initialSearch: n = "", pageSize: l = 20 } = s, [a, i] = E([]), [r, c] = E(!1), [m, x] = E(null), [k, h] = E(n), [f, y] = E(!0), [g, v] = E(), w = F(async (R = !1, _) => {
1514
1659
  if (r) return;
1515
- const d = T !== void 0 ? T : k;
1516
- i(!0), x(null);
1660
+ const d = _ !== void 0 ? _ : k;
1661
+ c(!0), x(null);
1517
1662
  try {
1518
1663
  const u = await t.loadParticipants({
1519
1664
  search: d || void 0,
1520
1665
  limit: l,
1521
- cursor: p ? void 0 : g
1666
+ cursor: R ? void 0 : g
1522
1667
  });
1523
- a(
1524
- (N) => p ? u.participants : [...N, ...u.participants]
1525
- ), y(u.hasMore), C(u.nextCursor);
1668
+ i(
1669
+ (N) => R ? u.participants : [...N, ...u.participants]
1670
+ ), y(u.hasMore), v(u.nextCursor);
1526
1671
  } catch (u) {
1527
1672
  const N = u instanceof Error ? u.message : "Failed to load participants";
1528
1673
  x(N), console.error("[useParticipants] Load error:", u);
1529
1674
  } finally {
1530
- i(!1);
1675
+ c(!1);
1531
1676
  }
1532
- }, [t, k, g, l, r]), v = _(() => {
1677
+ }, [t, k, g, l, r]), b = F(() => {
1533
1678
  f && !r && w(!1);
1534
- }, [f, r, w]), I = _((p) => {
1535
- h(p), C(void 0), w(!0, p);
1536
- }, [w]), S = _(() => {
1537
- C(void 0), w(!0);
1679
+ }, [f, r, w]), I = F((R) => {
1680
+ h(R), v(void 0), w(!0, R);
1681
+ }, [w]), S = F(() => {
1682
+ v(void 0), w(!0);
1538
1683
  }, [w]);
1539
- return H(() => {
1684
+ return G(() => {
1540
1685
  w(!0);
1541
1686
  }, [t.loadParticipants]), {
1542
- participants: o,
1687
+ participants: a,
1543
1688
  loading: r,
1544
1689
  error: m,
1545
1690
  searchQuery: k,
1546
1691
  hasMore: f,
1547
1692
  totalCount: t.totalCount,
1548
- loadMore: v,
1693
+ loadMore: b,
1549
1694
  search: I,
1550
1695
  refresh: S
1551
1696
  };
1552
1697
  };
1553
1698
  export {
1554
- Y as Avatar,
1555
- be as ChannelEmptyState,
1699
+ q as Avatar,
1700
+ Ce as ChannelEmptyState,
1556
1701
  Ke as ChannelList,
1557
1702
  cs as ChannelView,
1558
- Ss as FaqList,
1559
- gs as FaqListItem,
1560
- ys as MessagingProvider,
1561
- Is as MessagingShell,
1703
+ ks as FaqList,
1704
+ xs as FaqListItem,
1705
+ Is as MessagingProvider,
1706
+ Ss as MessagingShell,
1562
1707
  us as ParticipantPicker,
1563
- Je as formatRelativeTime,
1564
- qe as useMessaging,
1565
- ks as useParticipants
1708
+ Ye as formatRelativeTime,
1709
+ Ze as useMessaging,
1710
+ ps as useParticipants
1566
1711
  };
1567
1712
  //# sourceMappingURL=index.js.map