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

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
@@ -35,28 +35,28 @@ const Ge = rt({
35
35
  serviceConfig: !!n,
36
36
  capabilities: Object.keys(l)
37
37
  });
38
- const [c, g] = k(null), [f, N] = k(null), [b, y] = k(!1), [r, S] = k(!1), [v, w] = k(null), D = J(!1), C = J({
38
+ const [c, x] = k(null), [h, b] = k(null), [g, v] = k(!1), [r, S] = k(!1), [w, p] = k(null), D = J(!1), N = J({
39
39
  userId: s == null ? void 0 : s.id,
40
40
  apiKey: o,
41
41
  serviceConfig: n,
42
42
  capabilities: l
43
- }), p = J(0);
44
- p.current++, a("๐Ÿ“Š RENDER INFO", {
45
- renderCount: p.current,
43
+ }), y = J(0);
44
+ y.current++, a("๐Ÿ“Š RENDER INFO", {
45
+ renderCount: y.current,
46
46
  currentProps: { userId: s == null ? void 0 : s.id, apiKey: (o == null ? void 0 : o.substring(0, 8)) + "..." },
47
47
  propChanges: {
48
- userChanged: C.current.userId !== (s == null ? void 0 : s.id),
49
- apiKeyChanged: C.current.apiKey !== o,
50
- serviceConfigChanged: C.current.serviceConfig !== n,
51
- capabilitiesChanged: C.current.capabilities !== l
48
+ userChanged: N.current.userId !== (s == null ? void 0 : s.id),
49
+ apiKeyChanged: N.current.apiKey !== o,
50
+ serviceConfigChanged: N.current.serviceConfig !== n,
51
+ capabilitiesChanged: N.current.capabilities !== l
52
52
  }
53
- }), C.current = {
53
+ }), N.current = {
54
54
  userId: s == null ? void 0 : s.id,
55
55
  apiKey: o,
56
56
  serviceConfig: n,
57
57
  capabilities: l
58
58
  }, Q(() => {
59
- const u = p.current;
59
+ const u = y.current;
60
60
  if (a("๐Ÿ”ง SERVICE INIT EFFECT TRIGGERED", {
61
61
  renderCount: u,
62
62
  apiKey: !!o,
@@ -64,8 +64,8 @@ const Ge = rt({
64
64
  dependencies: {
65
65
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
66
66
  serviceConfigRef: n,
67
- serviceConfigStable: C.current.serviceConfig === n,
68
- apiKeyStable: C.current.apiKey === o
67
+ serviceConfigStable: N.current.serviceConfig === n,
68
+ apiKeyStable: N.current.apiKey === o
69
69
  }
70
70
  }), !o || !n) {
71
71
  a("โš ๏ธ SERVICE INIT SKIPPED", {
@@ -77,14 +77,14 @@ const Ge = rt({
77
77
  a("๐Ÿš€ CREATING NEW SERVICE", {
78
78
  renderCount: u,
79
79
  apiKey: (o == null ? void 0 : o.substring(0, 8)) + "...",
80
- serviceConfigChanged: C.current.serviceConfig !== n
80
+ serviceConfigChanged: N.current.serviceConfig !== n
81
81
  });
82
82
  const d = new lt({
83
83
  ...n,
84
84
  apiKey: o,
85
85
  debug: m
86
86
  });
87
- return g(d), a("โœ… SERVICE SET", {
87
+ return x(d), a("โœ… SERVICE SET", {
88
88
  renderCount: u,
89
89
  serviceInstance: !!d
90
90
  }), () => {
@@ -96,13 +96,13 @@ const Ge = rt({
96
96
  }, [o, n, m, a]);
97
97
  const E = J(null);
98
98
  Q(() => {
99
- var d, x;
99
+ var d, C;
100
100
  if (a("๐Ÿ”— USER CONNECTION EFFECT TRIGGERED", {
101
101
  hasService: !!c,
102
102
  hasUser: !!s,
103
103
  userId: s == null ? void 0 : s.id,
104
104
  isConnecting: D.current,
105
- isConnected: b,
105
+ isConnected: g,
106
106
  dependencies: { service: !!c, userId: s == null ? void 0 : s.id }
107
107
  }), !c || !s) {
108
108
  a("โš ๏ธ USER CONNECTION SKIPPED", "Missing service or user");
@@ -112,7 +112,7 @@ const Ge = rt({
112
112
  a("โš ๏ธ USER CONNECTION SKIPPED", "Already connecting");
113
113
  return;
114
114
  }
115
- if (((d = E.current) == null ? void 0 : d.serviceId) === c && ((x = E.current) == null ? void 0 : x.userId) === s.id) {
115
+ if (((d = E.current) == null ? void 0 : d.serviceId) === c && ((C = E.current) == null ? void 0 : C.userId) === s.id) {
116
116
  a(
117
117
  "โš ๏ธ USER CONNECTION SKIPPED",
118
118
  "Already connected this user with this service"
@@ -120,39 +120,39 @@ const Ge = rt({
120
120
  return;
121
121
  }
122
122
  (async () => {
123
- a("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), D.current = !0, S(!0), w(null);
123
+ a("๐Ÿš€ STARTING USER CONNECTION", { userId: s.id }), D.current = !0, S(!0), p(null);
124
124
  try {
125
125
  a("๐Ÿ“ž CALLING SERVICE.CONNECTUSER", { userId: s.id });
126
126
  const M = await c.connectUser(s);
127
- N(M), y(!0), E.current = { serviceId: c, userId: s.id }, a("โœ… USER CONNECTION SUCCESS", {
127
+ b(M), v(!0), E.current = { serviceId: c, userId: s.id }, a("โœ… USER CONNECTION SUCCESS", {
128
128
  userId: s.id,
129
129
  clientId: M.userID
130
130
  });
131
131
  } catch (M) {
132
132
  const H = M instanceof Error ? M.message : "Connection failed";
133
- w(H), a("โŒ USER CONNECTION ERROR", {
133
+ p(H), a("โŒ USER CONNECTION ERROR", {
134
134
  userId: s.id,
135
135
  error: H
136
136
  });
137
137
  } finally {
138
138
  S(!1), D.current = !1, a("๐Ÿ”„ USER CONNECTION FINISHED", {
139
139
  userId: s.id,
140
- isConnected: b
140
+ isConnected: g
141
141
  });
142
142
  }
143
143
  })();
144
- }, [c, s, a, b]), Q(() => (a("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
144
+ }, [c, s, a, g]), Q(() => (a("๐Ÿ”Œ CLEANUP EFFECT REGISTERED", {
145
145
  hasService: !!c,
146
- isConnected: b
146
+ isConnected: g
147
147
  }), () => {
148
- c && b ? (a(
148
+ c && g ? (a(
149
149
  "๐Ÿงน CLEANUP EFFECT TRIGGERED",
150
150
  "Cleaning up connection on unmount"
151
151
  ), E.current = null, c.disconnectUser().catch(console.error)) : a("๐Ÿ”‡ CLEANUP EFFECT SKIPPED", {
152
152
  hasService: !!c,
153
- isConnected: b
153
+ isConnected: g
154
154
  });
155
- }), [c, b, a]);
155
+ }), [c, g, a]);
156
156
  const _ = L(async () => {
157
157
  if (a("๐Ÿ”„ REFRESH CONNECTION CALLED", {
158
158
  hasService: !!c,
@@ -165,51 +165,51 @@ const Ge = rt({
165
165
  try {
166
166
  a("๐Ÿ”Œ DISCONNECTING FOR REFRESH"), await c.disconnectUser(), a("๐Ÿ“ž RECONNECTING FOR REFRESH");
167
167
  const u = await c.connectUser(s);
168
- N(u), y(!0), w(null), a("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
168
+ b(u), v(!0), p(null), a("โœ… CONNECTION REFRESH SUCCESS", { userId: s.id });
169
169
  } catch (u) {
170
170
  const d = u instanceof Error ? u.message : "Refresh failed";
171
- w(d), a("โŒ CONNECTION REFRESH ERROR", {
171
+ p(d), a("โŒ CONNECTION REFRESH ERROR", {
172
172
  userId: s.id,
173
173
  error: d
174
174
  });
175
175
  } finally {
176
176
  S(!1), a("๐Ÿ”„ CONNECTION REFRESH FINISHED", { userId: s.id });
177
177
  }
178
- }, [c, s, a]), h = F.useMemo(() => (a("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
178
+ }, [c, s, a]), f = F.useMemo(() => (a("๐Ÿ’ซ CONTEXT VALUE MEMOIZATION", {
179
179
  hasService: !!c,
180
- hasClient: !!f,
181
- isConnected: b,
180
+ hasClient: !!h,
181
+ isConnected: g,
182
182
  isLoading: r,
183
- hasError: !!v,
183
+ hasError: !!w,
184
184
  capabilitiesKeys: Object.keys(l)
185
185
  }), {
186
186
  service: c,
187
- client: f,
188
- isConnected: b,
187
+ client: h,
188
+ isConnected: g,
189
189
  isLoading: r,
190
- error: v,
190
+ error: w,
191
191
  capabilities: l,
192
192
  refreshConnection: _,
193
193
  debug: m
194
194
  }), [
195
195
  c,
196
- f,
197
- b,
196
+ h,
197
+ g,
198
198
  r,
199
- v,
199
+ w,
200
200
  l,
201
201
  _,
202
202
  m,
203
203
  a
204
204
  ]);
205
205
  return a("๐Ÿ”„ RENDER END", {
206
- renderCount: p.current,
207
- willRenderChat: !!(f && b),
208
- contextValueReady: !!h
209
- }), /* @__PURE__ */ e(Ge.Provider, { value: h, children: f && b ? /* @__PURE__ */ e(
206
+ renderCount: y.current,
207
+ willRenderChat: !!(h && g),
208
+ contextValueReady: !!f
209
+ }), /* @__PURE__ */ e(Ge.Provider, { value: f, children: h && g ? /* @__PURE__ */ e(
210
210
  it,
211
211
  {
212
- client: f,
212
+ client: h,
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
  },
@@ -290,7 +290,7 @@ const te = ({
290
290
  className: o,
291
291
  shape: l = "squircle"
292
292
  }) => {
293
- const m = ns(t), c = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", g = l === "circle" ? { borderRadius: "50%" } : {
293
+ const m = ns(t), c = n < 32 ? "text-xs" : n < 56 ? "text-sm" : n < 120 ? "text-lg" : "text-4xl", x = l === "circle" ? { borderRadius: "50%" } : {
294
294
  borderRadius: "33%",
295
295
  "corner-shape": "superellipse(1.3)"
296
296
  };
@@ -301,7 +301,7 @@ const te = ({
301
301
  style: {
302
302
  width: `${n}px`,
303
303
  height: `${n}px`,
304
- ...g
304
+ ...x
305
305
  },
306
306
  children: s ? /* @__PURE__ */ e(
307
307
  "img",
@@ -358,70 +358,70 @@ const te = ({
358
358
  isMyMessage: n = !1,
359
359
  hasAttachment: o = !1
360
360
  }) => {
361
- var b;
361
+ var g;
362
362
  const l = He(t), m = ke(t);
363
363
  if (!l && !m)
364
364
  return null;
365
365
  if (l) {
366
- const y = (b = t.metadata) == null ? void 0 : b.amount_text;
367
- if (!y) return null;
368
- const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", S = s ? `${y} tip` : `Delivered with ${y} tip`;
366
+ const v = (g = t.metadata) == null ? void 0 : g.amount_text;
367
+ if (!v) return null;
368
+ const r = s ? "message-tip-standalone" : "message-tag message-tag--tip", S = s ? `${v} tip` : `Delivered with ${v} tip`;
369
369
  return /* @__PURE__ */ i("div", { className: r, children: [
370
370
  /* @__PURE__ */ e(zt, { size: s ? 14 : 12 }),
371
371
  /* @__PURE__ */ e("span", { children: S })
372
372
  ] });
373
373
  }
374
- const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", g = [
374
+ const a = n && o, c = a ? "Sent with AI" : "Sent with DM Agent", x = [
375
375
  "message-chatbot-indicator",
376
376
  n ? "message-chatbot-indicator--sender" : "message-chatbot-indicator--receiver",
377
377
  a ? "message-chatbot-indicator--attachment" : "message-chatbot-indicator--text"
378
- ].join(" "), f = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), N = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(as, { size: a ? 12 : 15 }) });
379
- return /* @__PURE__ */ e("div", { className: g, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(de, { children: [
380
- f,
381
- N
378
+ ].join(" "), h = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__label", children: c }), b = /* @__PURE__ */ e("span", { className: "message-chatbot-indicator__icon", children: /* @__PURE__ */ e(as, { size: a ? 12 : 15 }) });
379
+ return /* @__PURE__ */ e("div", { className: x, "data-testid": "message-chatbot-indicator", children: n && !a ? /* @__PURE__ */ i(de, { children: [
380
+ h,
381
+ b
382
382
  ] }) : /* @__PURE__ */ i(de, { children: [
383
- N,
384
- f
383
+ b,
384
+ h
385
385
  ] }) });
386
386
  }, ze = F.memo(
387
387
  ({ channel: t, unread: s }) => {
388
- var E, _, h, u;
388
+ var E, _, f, u;
389
389
  const { selectedChannel: n, onChannelSelect: o, debug: l, renderMessagePreview: m } = Kt(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
390
390
  t && o(t);
391
- }, g = (d) => {
392
- const x = d.key === "Enter" || d.key === " ", M = d.repeat;
393
- !x || M || (d.preventDefault(), c());
394
- }, N = Object.values(((E = t == null ? void 0 : t.state) == null ? void 0 : E.members) || {}).find(
391
+ }, x = (d) => {
392
+ const C = d.key === "Enter" || d.key === " ", M = d.repeat;
393
+ !C || M || (d.preventDefault(), c());
394
+ }, b = Object.values(((E = t == null ? void 0 : t.state) == null ? void 0 : E.members) || {}).find(
395
395
  (d) => {
396
- var x, M;
397
- return ((x = d.user) == null ? void 0 : x.id) && d.user.id !== ((M = t == null ? void 0 : t._client) == null ? void 0 : M.userID);
396
+ var C, M;
397
+ return ((C = d.user) == null ? void 0 : C.id) && d.user.id !== ((M = t == null ? void 0 : t._client) == null ? void 0 : M.userID);
398
398
  }
399
- ), b = ((_ = N == null ? void 0 : N.user) == null ? void 0 : _.name) || "Conversation", y = (h = N == null ? void 0 : N.user) == null ? void 0 : h.image, r = (() => {
400
- var x;
401
- const d = (x = t == null ? void 0 : t.state) == null ? void 0 : x.messages;
399
+ ), g = ((_ = b == null ? void 0 : b.user) == null ? void 0 : _.name) || "Conversation", v = (f = b == null ? void 0 : b.user) == null ? void 0 : f.image, r = (() => {
400
+ var C;
401
+ const d = (C = t == null ? void 0 : t.state) == null ? void 0 : C.messages;
402
402
  if (d != null && d.length) {
403
403
  for (let M = d.length - 1; M >= 0; M--)
404
404
  if (d[M].type !== "system") return d[M];
405
405
  }
406
- })(), v = (() => {
407
- var x;
406
+ })(), w = (() => {
407
+ var C;
408
408
  if (r != null && r.text) return r.text;
409
- const d = (x = r == null ? void 0 : r.attachments) == null ? void 0 : x[0];
409
+ const d = (C = r == null ? void 0 : r.attachments) == null ? void 0 : C[0];
410
410
  return d ? d.og_scrape_url ? d.og_scrape_url : d.type === "image" ? "๐Ÿ“ท Sent an image" : d.type === "video" ? "๐ŸŽฅ Sent a video" : d.type === "audio" ? "๐ŸŽต Sent audio" : d.type === "file" ? "๐Ÿ“Ž Sent a file" : "๐Ÿ“Ž Sent an attachment" : "No messages yet";
411
- })(), w = r != null && r.created_at ? ts(new Date(r.created_at)) : "", D = r ? ke(r) : !1, C = m ? m(r, v) : `${D ? "โœจ " : ""}${v}`, p = s ?? 0;
411
+ })(), p = r != null && r.created_at ? ts(new Date(r.created_at)) : "", D = r ? ke(r) : !1, N = m ? m(r, w) : `${D ? "โœจ " : ""}${w}`, y = s ?? 0;
412
412
  return l && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ“‹ CHANNEL PREVIEW RENDER", {
413
413
  channelId: t == null ? void 0 : t.id,
414
414
  isSelected: a,
415
- participantName: b,
416
- unreadCount: p,
417
- hasTimestamp: !!w
415
+ participantName: g,
416
+ unreadCount: y,
417
+ hasTimestamp: !!p
418
418
  }), /* @__PURE__ */ e(
419
419
  "div",
420
420
  {
421
421
  role: "button",
422
422
  tabIndex: 0,
423
423
  onClick: c,
424
- onKeyDown: g,
424
+ onKeyDown: x,
425
425
  className: R(
426
426
  "group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
427
427
  {
@@ -433,9 +433,9 @@ const te = ({
433
433
  /* @__PURE__ */ e(
434
434
  te,
435
435
  {
436
- id: ((u = N == null ? void 0 : N.user) == null ? void 0 : u.id) || t.id || "unknown",
437
- name: b,
438
- image: y,
436
+ id: ((u = b == null ? void 0 : b.user) == null ? void 0 : u.id) || t.id || "unknown",
437
+ name: g,
438
+ image: v,
439
439
  size: 44,
440
440
  className: "[&_.avatar-fallback]:group-hover:bg-[#eeeeee]"
441
441
  }
@@ -449,14 +449,14 @@ const te = ({
449
449
  "text-sm font-medium truncate",
450
450
  a ? "text-primary" : "text-charcoal"
451
451
  ),
452
- children: b
452
+ children: g
453
453
  }
454
454
  ),
455
- w && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: w })
455
+ p && /* @__PURE__ */ e("span", { className: "text-xs text-stone flex-shrink-0", children: p })
456
456
  ] }),
457
457
  /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 min-w-0", children: [
458
- /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: C }),
459
- p > 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: p > 99 ? "99+" : p })
458
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone flex-1 line-clamp-1", children: N }),
459
+ y > 0 && /* @__PURE__ */ e("span", { className: "bg-[#7f22fe] text-white text-xs px-2 py-0.5 rounded-full min-w-[20px] text-center flex-shrink-0", children: y > 99 ? "99+" : y })
460
460
  ] })
461
461
  ] })
462
462
  ] })
@@ -470,46 +470,51 @@ const is = { last_message_at: -1 }, We = F.memo(
470
470
  onChannelSelect: t,
471
471
  selectedChannel: s,
472
472
  filters: n,
473
- sort: o = is,
474
- className: l,
475
- customEmptyStateIndicator: m,
476
- renderMessagePreview: a
473
+ allowNewMessagesFromUnfilteredChannels: o = !1,
474
+ onMessageNew: l,
475
+ onAddedToChannel: m,
476
+ sort: a = is,
477
+ className: c,
478
+ customEmptyStateIndicator: x,
479
+ renderMessagePreview: h
477
480
  }) => {
478
- const c = F.useRef(0);
479
- c.current++;
481
+ const b = F.useRef(0);
482
+ b.current++;
480
483
  const { debug: g = !1 } = ve();
481
484
  g && console.log("๐Ÿ“บ [ChannelList] ๐Ÿ”„ RENDER START", {
482
- renderCount: c.current,
485
+ renderCount: b.current,
483
486
  selectedChannelId: s == null ? void 0 : s.id,
484
487
  filters: n
485
488
  });
486
- const f = F.useMemo(
489
+ const v = F.useMemo(
487
490
  () => ({
488
491
  selectedChannel: s,
489
492
  onChannelSelect: t,
490
493
  debug: g,
491
- renderMessagePreview: a
494
+ renderMessagePreview: h
492
495
  }),
493
- [s, t, g, a]
496
+ [s, t, g, h]
494
497
  );
495
498
  return /* @__PURE__ */ e(
496
499
  "div",
497
500
  {
498
501
  className: R(
499
502
  "messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
500
- l
503
+ c
501
504
  ),
502
- children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Xt, { value: f, children: /* @__PURE__ */ e(
505
+ children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Xt, { value: v, children: /* @__PURE__ */ e(
503
506
  ct,
504
507
  {
505
508
  filters: n,
506
- sort: o,
509
+ sort: a,
507
510
  options: { limit: 30 },
508
- allowNewMessagesFromUnfilteredChannels: !1,
511
+ allowNewMessagesFromUnfilteredChannels: o,
512
+ onMessageNew: l,
513
+ onAddedToChannel: m,
509
514
  Preview: ze,
510
- EmptyStateIndicator: m
515
+ EmptyStateIndicator: x
511
516
  },
512
- `${JSON.stringify(n)}:${JSON.stringify(o)}`
517
+ `${JSON.stringify(n)}:${JSON.stringify(a)}`
513
518
  ) }) })
514
519
  }
515
520
  );
@@ -646,18 +651,18 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
646
651
  firstOfGroup: m,
647
652
  groupedByUser: a,
648
653
  handleAction: c,
649
- handleOpenThread: g,
650
- handleRetry: f,
651
- highlighted: N,
652
- isMessageAIGenerated: b,
653
- isMyMessage: y,
654
+ handleOpenThread: x,
655
+ handleRetry: h,
656
+ highlighted: b,
657
+ isMessageAIGenerated: g,
658
+ isMyMessage: v,
654
659
  message: r,
655
660
  renderText: S,
656
- threadList: v
657
- } = t, { client: w } = $e("CustomMessage"), [D, C] = k(!1), p = mt(r.id), { selected: E, voteUp: _, voteDown: h } = us(r), {
661
+ threadList: w
662
+ } = t, { client: p } = $e("CustomMessage"), [D, N] = k(!1), y = mt(r.id), { selected: E, voteUp: _, voteDown: f } = us(r), {
658
663
  Attachment: u = ft,
659
664
  EditMessageModal: d = gt,
660
- MessageBlocked: x = xt,
665
+ MessageBlocked: C = xt,
661
666
  MessageBouncePrompt: M = bt,
662
667
  MessageDeleted: H = Ct,
663
668
  MessageIsThreadReplyInChannelButtonIndicator: Z = Nt,
@@ -666,8 +671,8 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
666
671
  StreamedMessageText: W = pt,
667
672
  PinIndicator: B
668
673
  } = ht("CustomMessage"), se = yt(r), ne = Et(r), ae = Ee(
669
- () => b == null ? void 0 : b(r),
670
- [b, r]
674
+ () => g == null ? void 0 : g(r),
675
+ [g, r]
671
676
  ), j = Ee(
672
677
  () => !r.shared_location && !r.attachments ? [] : r.shared_location ? [r.shared_location, ...r.attachments ?? []] : r.attachments,
673
678
  [r]
@@ -677,11 +682,11 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
677
682
  if (r.deleted_at || r.type === "deleted")
678
683
  return /* @__PURE__ */ e(H, { message: r });
679
684
  if (It(r))
680
- return /* @__PURE__ */ e(x, {});
681
- const re = !v && !!r.reply_count, P = !v && r.show_in_channel && r.parent_id, U = r.status === "failed" && ((ce = r.error) == null ? void 0 : ce.status) !== 403, G = St(r);
685
+ return /* @__PURE__ */ e(C, {});
686
+ const re = !w && !!r.reply_count, P = !w && r.show_in_channel && r.parent_id, U = r.status === "failed" && ((ce = r.error) == null ? void 0 : ce.status) !== 403, G = St(r);
682
687
  let A;
683
- U ? A = () => f(r) : G && (A = () => C(!0));
684
- const X = y(), q = R(
688
+ U ? A = () => h(r) : G && (A = () => N(!0));
689
+ const X = v(), q = R(
685
690
  "str-chat__message str-chat__message-simple",
686
691
  `str-chat__message--${r.type}`,
687
692
  `str-chat__message--${r.status}`,
@@ -689,7 +694,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
689
694
  r.text ? "str-chat__message--has-text" : "has-no-text",
690
695
  {
691
696
  "str-chat__message--has-attachment": se,
692
- "str-chat__message--highlighted": N,
697
+ "str-chat__message--highlighted": b,
693
698
  "str-chat__message--pinned pinned-message": r.pinned,
694
699
  "str-chat__message--with-reactions": ne,
695
700
  "str-chat__message-send-can-be-retried": (r == null ? void 0 : r.status) === "failed" && ((me = r == null ? void 0 : r.error) == null ? void 0 : me.status) !== 403,
@@ -698,7 +703,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
698
703
  "str-chat__virtual-message__wrapper--first": m,
699
704
  "str-chat__virtual-message__wrapper--group": a
700
705
  }
701
- ), ee = r.poll_id && w.polls.fromState(r.poll_id), ue = ls(r), Y = ke(r), K = !!(j != null && j.length && !r.quoted_message), ie = Y && X && K;
706
+ ), ee = r.poll_id && p.polls.fromState(r.poll_id), ue = ls(r), Y = ke(r), K = !!(j != null && j.length && !r.quoted_message), ie = Y && X && K;
702
707
  return /* @__PURE__ */ i(de, { children: [
703
708
  o && /* @__PURE__ */ e(
704
709
  d,
@@ -710,13 +715,13 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
710
715
  Mt,
711
716
  {
712
717
  MessageBouncePrompt: M,
713
- onClose: () => C(!1),
718
+ onClose: () => N(!1),
714
719
  open: D
715
720
  }
716
721
  ),
717
722
  /* @__PURE__ */ i("div", { className: q, children: [
718
723
  B && /* @__PURE__ */ e(B, {}),
719
- !!p && /* @__PURE__ */ e(T, { reminder: p }),
724
+ !!y && /* @__PURE__ */ e(T, { reminder: y }),
720
725
  r.user && /* @__PURE__ */ e(
721
726
  te,
722
727
  {
@@ -786,7 +791,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
786
791
  {
787
792
  selected: E,
788
793
  onVoteUp: _,
789
- onVoteDown: h
794
+ onVoteDown: f
790
795
  }
791
796
  )
792
797
  ] })
@@ -795,7 +800,7 @@ const ms = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
795
800
  re && /* @__PURE__ */ e(
796
801
  z,
797
802
  {
798
- onClick: g,
803
+ onClick: x,
799
804
  reply_count: r.reply_count
800
805
  }
801
806
  ),
@@ -1010,33 +1015,33 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1010
1015
  canShowInfo: o,
1011
1016
  showStarButton: l = !1
1012
1017
  }) => {
1013
- var y, r, S, v, w, D;
1018
+ var v, r, S, w, p, D;
1014
1019
  const { channel: m } = Se(), a = F.useMemo(() => Object.values(m.state.members || {}).find(
1015
- (p) => {
1020
+ (y) => {
1016
1021
  var E;
1017
- return ((E = p.user) == null ? void 0 : E.id) && p.user.id !== m._client.userID;
1022
+ return ((E = y.user) == null ? void 0 : E.id) && y.user.id !== m._client.userID;
1018
1023
  }
1019
- ), [m._client.userID, m.state.members]), c = ((y = a == null ? void 0 : a.user) == null ? void 0 : y.name) || ((r = a == null ? void 0 : a.user) == null ? void 0 : r.id) || "Unknown member", g = (S = a == null ? void 0 : a.user) == null ? void 0 : S.image, [f, N] = k(
1020
- !!((v = m.state.membership) != null && v.pinned_at)
1024
+ ), [m._client.userID, m.state.members]), c = ((v = a == null ? void 0 : a.user) == null ? void 0 : v.name) || ((r = a == null ? void 0 : a.user) == null ? void 0 : r.id) || "Unknown member", x = (S = a == null ? void 0 : a.user) == null ? void 0 : S.image, [h, b] = k(
1025
+ !!((w = m.state.membership) != null && w.pinned_at)
1021
1026
  );
1022
1027
  Q(() => {
1023
- const C = (p) => {
1028
+ const N = (y) => {
1024
1029
  var E;
1025
- N(
1026
- p != null && p.member ? !!p.member.pinned_at : !!((E = m.state.membership) != null && E.pinned_at)
1030
+ b(
1031
+ y != null && y.member ? !!y.member.pinned_at : !!((E = m.state.membership) != null && E.pinned_at)
1027
1032
  );
1028
1033
  };
1029
- return m.on("member.updated", C), () => {
1030
- m.off("member.updated", C);
1034
+ return m.on("member.updated", N), () => {
1035
+ m.off("member.updated", N);
1031
1036
  };
1032
1037
  }, [m]);
1033
- const b = async () => {
1038
+ const g = async () => {
1034
1039
  try {
1035
- f ? await m.unpin() : await m.pin();
1036
- } catch (C) {
1040
+ h ? await m.unpin() : await m.pin();
1041
+ } catch (N) {
1037
1042
  console.error(
1038
1043
  "[CustomChannelHeader] Failed to update pinned status:",
1039
- C
1044
+ N
1040
1045
  );
1041
1046
  }
1042
1047
  };
@@ -1057,9 +1062,9 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1057
1062
  /* @__PURE__ */ e(
1058
1063
  te,
1059
1064
  {
1060
- id: ((w = a == null ? void 0 : a.user) == null ? void 0 : w.id) || m.id || "unknown",
1065
+ id: ((p = a == null ? void 0 : a.user) == null ? void 0 : p.id) || m.id || "unknown",
1061
1066
  name: c,
1062
- image: g,
1067
+ image: x,
1063
1068
  size: 40
1064
1069
  }
1065
1070
  ),
@@ -1070,17 +1075,17 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1070
1075
  "button",
1071
1076
  {
1072
1077
  className: le,
1073
- onClick: b,
1078
+ onClick: g,
1074
1079
  type: "button",
1075
- "aria-label": f ? "Unstar conversation" : "Star conversation",
1080
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
1076
1081
  children: /* @__PURE__ */ e(
1077
1082
  Le,
1078
1083
  {
1079
1084
  className: R("size-5", {
1080
- "text-yellow-600": f,
1081
- "text-black/90": !f
1085
+ "text-yellow-600": h,
1086
+ "text-black/90": !h
1082
1087
  }),
1083
- weight: f ? "duotone" : "regular"
1088
+ weight: h ? "duotone" : "regular"
1084
1089
  }
1085
1090
  )
1086
1091
  }
@@ -1114,7 +1119,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1114
1119
  {
1115
1120
  id: ((D = a == null ? void 0 : a.user) == null ? void 0 : D.id) || m.id || "unknown",
1116
1121
  name: c,
1117
- image: g,
1122
+ image: x,
1118
1123
  size: 40
1119
1124
  }
1120
1125
  ),
@@ -1125,17 +1130,17 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1125
1130
  "button",
1126
1131
  {
1127
1132
  className: le,
1128
- onClick: b,
1133
+ onClick: g,
1129
1134
  type: "button",
1130
- "aria-label": f ? "Unstar conversation" : "Star conversation",
1135
+ "aria-label": h ? "Unstar conversation" : "Star conversation",
1131
1136
  children: /* @__PURE__ */ e(
1132
1137
  Le,
1133
1138
  {
1134
1139
  className: R("size-5", {
1135
- "text-yellow-600": f,
1136
- "text-black/90": !f
1140
+ "text-yellow-600": h,
1141
+ "text-black/90": !h
1137
1142
  }),
1138
- weight: f ? "duotone" : "regular"
1143
+ weight: h ? "duotone" : "regular"
1139
1144
  }
1140
1145
  )
1141
1146
  }
@@ -1162,37 +1167,37 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1162
1167
  onLeaveConversation: m,
1163
1168
  onBlockParticipant: a,
1164
1169
  showDeleteConversation: c = !0,
1165
- onDeleteConversationClick: g,
1166
- onBlockParticipantClick: f,
1167
- onReportParticipantClick: N,
1168
- customChannelActions: b
1170
+ onDeleteConversationClick: x,
1171
+ onBlockParticipantClick: h,
1172
+ onReportParticipantClick: b,
1173
+ customChannelActions: g
1169
1174
  }) => {
1170
1175
  var W, B, se, ne, ae, j, re;
1171
- const { service: y, debug: r } = ve(), [S, v] = k(!1), [w, D] = k(!1), [C, p] = k(!1), E = L(async () => {
1176
+ const { service: v, debug: r } = ve(), [S, w] = k(!1), [p, D] = k(!1), [N, y] = k(!1), E = L(async () => {
1172
1177
  var P;
1173
- if (!(!y || !((P = n == null ? void 0 : n.user) != null && P.id)))
1178
+ if (!(!v || !((P = n == null ? void 0 : n.user) != null && P.id)))
1174
1179
  try {
1175
- const G = (await y.getBlockedUsers()).some(
1180
+ const G = (await v.getBlockedUsers()).some(
1176
1181
  (A) => {
1177
1182
  var X;
1178
1183
  return A.blocked_user_id === ((X = n == null ? void 0 : n.user) == null ? void 0 : X.id);
1179
1184
  }
1180
1185
  );
1181
- v(G);
1186
+ w(G);
1182
1187
  } catch (U) {
1183
1188
  console.error(
1184
1189
  "[ChannelInfoDialog] Failed to check blocked status:",
1185
1190
  U
1186
1191
  );
1187
1192
  }
1188
- }, [y, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
1193
+ }, [v, (W = n == null ? void 0 : n.user) == null ? void 0 : W.id]);
1189
1194
  Q(() => {
1190
1195
  E();
1191
1196
  }, [E]);
1192
1197
  const _ = async () => {
1193
1198
  var P;
1194
- if (!w) {
1195
- g == null || g(), r && console.log("[ChannelInfoDialog] Leave conversation", o.cid), D(!0);
1199
+ if (!p) {
1200
+ x == null || x(), r && console.log("[ChannelInfoDialog] Leave conversation", o.cid), D(!0);
1196
1201
  try {
1197
1202
  const U = ((P = o._client) == null ? void 0 : P.userID) ?? null;
1198
1203
  await o.hide(U, !1), m && await m(o), s();
@@ -1202,39 +1207,39 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1202
1207
  D(!1);
1203
1208
  }
1204
1209
  }
1205
- }, h = async () => {
1210
+ }, f = async () => {
1206
1211
  var P, U, G;
1207
- if (!(C || !y)) {
1208
- f == null || f(), r && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), p(!0);
1212
+ if (!(N || !v)) {
1213
+ h == null || h(), r && console.log("[ChannelInfoDialog] Block member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), y(!0);
1209
1214
  try {
1210
- await y.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1215
+ await v.blockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1211
1216
  } catch (A) {
1212
1217
  console.error("[ChannelInfoDialog] Failed to block member", A);
1213
1218
  } finally {
1214
- p(!1);
1219
+ y(!1);
1215
1220
  }
1216
1221
  }
1217
1222
  }, u = async () => {
1218
1223
  var P, U, G;
1219
- if (!(C || !y)) {
1220
- f == null || f(), r && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), p(!0);
1224
+ if (!(N || !v)) {
1225
+ h == null || h(), r && console.log("[ChannelInfoDialog] Unblock member", (P = n == null ? void 0 : n.user) == null ? void 0 : P.id), y(!0);
1221
1226
  try {
1222
- await y.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1227
+ await v.unBlockUser((U = n == null ? void 0 : n.user) == null ? void 0 : U.id), a && await a((G = n == null ? void 0 : n.user) == null ? void 0 : G.id), s();
1223
1228
  } catch (A) {
1224
1229
  console.error("[ChannelInfoDialog] Failed to unblock member", A);
1225
1230
  } finally {
1226
- p(!1);
1231
+ y(!1);
1227
1232
  }
1228
1233
  }
1229
1234
  }, d = () => {
1230
- N == null || N(), s(), window.open(
1235
+ b == null || b(), s(), window.open(
1231
1236
  "https://linktr.ee/s/about/trust-center/report",
1232
1237
  "_blank",
1233
1238
  "noopener,noreferrer"
1234
1239
  );
1235
1240
  };
1236
1241
  if (!n) return null;
1237
- const x = ((B = n.user) == null ? void 0 : B.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", M = (ne = n.user) == null ? void 0 : ne.image, H = (ae = n.user) == null ? void 0 : ae.email, Z = (j = n.user) == null ? void 0 : j.username, z = H || (Z ? `linktr.ee/${Z}` : void 0), T = ((re = n.user) == null ? void 0 : re.id) || "unknown";
1242
+ const C = ((B = n.user) == null ? void 0 : B.name) || ((se = n.user) == null ? void 0 : se.id) || "Unknown member", M = (ne = n.user) == null ? void 0 : ne.image, H = (ae = n.user) == null ? void 0 : ae.email, Z = (j = n.user) == null ? void 0 : j.username, z = H || (Z ? `linktr.ee/${Z}` : void 0), T = ((re = n.user) == null ? void 0 : re.id) || "unknown";
1238
1243
  return (
1239
1244
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
1240
1245
  /* @__PURE__ */ e(
@@ -1262,14 +1267,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1262
1267
  te,
1263
1268
  {
1264
1269
  id: T,
1265
- name: x,
1270
+ name: C,
1266
1271
  image: M,
1267
1272
  size: 88,
1268
1273
  shape: "circle"
1269
1274
  }
1270
1275
  ),
1271
1276
  /* @__PURE__ */ i("div", { className: "flex flex-col min-w-0 flex-1", children: [
1272
- /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: x }),
1277
+ /* @__PURE__ */ e("p", { className: "truncate text-base font-semibold text-charcoal", children: C }),
1273
1278
  z && /* @__PURE__ */ e("p", { className: "truncate text-sm text-[#00000055]", children: z }),
1274
1279
  l && /* @__PURE__ */ e(
1275
1280
  "span",
@@ -1294,10 +1299,10 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1294
1299
  xe,
1295
1300
  {
1296
1301
  onClick: _,
1297
- disabled: w,
1298
- "aria-busy": w,
1302
+ disabled: p,
1303
+ "aria-busy": p,
1299
1304
  children: [
1300
- w ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
1305
+ p ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Yt, { className: "h-5 w-5" }),
1301
1306
  /* @__PURE__ */ e("span", { children: "Delete Conversation" })
1302
1307
  ]
1303
1308
  }
@@ -1306,21 +1311,21 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1306
1311
  xe,
1307
1312
  {
1308
1313
  onClick: u,
1309
- disabled: C,
1310
- "aria-busy": C,
1314
+ disabled: N,
1315
+ "aria-busy": N,
1311
1316
  children: [
1312
- C ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
1317
+ N ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
1313
1318
  /* @__PURE__ */ e("span", { children: "Unblock" })
1314
1319
  ]
1315
1320
  }
1316
1321
  ) : /* @__PURE__ */ i(
1317
1322
  xe,
1318
1323
  {
1319
- onClick: h,
1320
- disabled: C,
1321
- "aria-busy": C,
1324
+ onClick: f,
1325
+ disabled: N,
1326
+ "aria-busy": N,
1322
1327
  children: [
1323
- C ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
1328
+ N ? /* @__PURE__ */ e(be, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(Ue, { className: "h-5 w-5" }),
1324
1329
  /* @__PURE__ */ e("span", { children: "Block" })
1325
1330
  ]
1326
1331
  }
@@ -1329,7 +1334,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1329
1334
  /* @__PURE__ */ e(Zt, { className: "h-5 w-5" }),
1330
1335
  /* @__PURE__ */ e("span", { children: "Report" })
1331
1336
  ] }) }),
1332
- b
1337
+ g
1333
1338
  ] })
1334
1339
  ] })
1335
1340
  ] })
@@ -1345,31 +1350,31 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1345
1350
  onBlockParticipant: m,
1346
1351
  showDeleteConversation: a = !0,
1347
1352
  onDeleteConversationClick: c,
1348
- onBlockParticipantClick: g,
1349
- onReportParticipantClick: f,
1350
- showStarButton: N = !1,
1351
- chatbotVotingEnabled: b = !1,
1352
- renderChannelBanner: y,
1353
+ onBlockParticipantClick: x,
1354
+ onReportParticipantClick: h,
1355
+ showStarButton: b = !1,
1356
+ chatbotVotingEnabled: g = !1,
1357
+ renderChannelBanner: v,
1353
1358
  customChannelActions: r,
1354
1359
  renderMessage: S
1355
1360
  }) => {
1356
- const { channel: v } = Se(), w = J(null), D = F.useMemo(() => Object.values(v.state.members || {}).find(
1357
- (h) => {
1361
+ const { channel: w } = Se(), p = J(null), D = F.useMemo(() => Object.values(w.state.members || {}).find(
1362
+ (f) => {
1358
1363
  var u;
1359
- return ((u = h.user) == null ? void 0 : u.id) && h.user.id !== v._client.userID;
1364
+ return ((u = f.user) == null ? void 0 : u.id) && f.user.id !== w._client.userID;
1360
1365
  }
1361
- ), [v._client.userID, v.state.members]), C = F.useMemo(() => {
1362
- const _ = v.data ?? {};
1366
+ ), [w._client.userID, w.state.members]), N = F.useMemo(() => {
1367
+ const _ = w.data ?? {};
1363
1368
  if (_.followerStatus)
1364
1369
  return String(_.followerStatus);
1365
1370
  if (_.isFollower !== void 0)
1366
1371
  return _.isFollower ? "Subscribed to you" : "Not subscribed";
1367
- }, [v.data]), p = L(() => {
1372
+ }, [w.data]), y = L(() => {
1368
1373
  var _;
1369
- (_ = w.current) == null || _.showModal();
1374
+ (_ = p.current) == null || _.showModal();
1370
1375
  }, []), E = L(() => {
1371
1376
  var _;
1372
- (_ = w.current) == null || _.close();
1377
+ (_ = p.current) == null || _.close();
1373
1378
  }, []);
1374
1379
  return /* @__PURE__ */ i(de, { children: [
1375
1380
  /* @__PURE__ */ e(
@@ -1377,14 +1382,14 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1377
1382
  {
1378
1383
  overrides: {
1379
1384
  Message: (_) => {
1380
- const { message: h } = je("ChannelView"), u = /* @__PURE__ */ e(
1385
+ const { message: f } = je("ChannelView"), u = /* @__PURE__ */ e(
1381
1386
  bs,
1382
1387
  {
1383
1388
  ..._,
1384
- chatbotVotingEnabled: b
1389
+ chatbotVotingEnabled: g
1385
1390
  }
1386
1391
  );
1387
- return !S || !h ? u : S(u, h);
1392
+ return !S || !f ? u : S(u, f);
1388
1393
  }
1389
1394
  },
1390
1395
  children: /* @__PURE__ */ i(Vt, { children: [
@@ -1393,12 +1398,12 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1393
1398
  {
1394
1399
  onBack: t,
1395
1400
  showBackButton: s,
1396
- onShowInfo: p,
1401
+ onShowInfo: y,
1397
1402
  canShowInfo: !!D,
1398
- showStarButton: N
1403
+ showStarButton: b
1399
1404
  }
1400
1405
  ) }),
1401
- y == null ? void 0 : y(),
1406
+ v == null ? void 0 : v(),
1402
1407
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden relative", children: /* @__PURE__ */ e(
1403
1408
  Ht,
1404
1409
  {
@@ -1407,11 +1412,11 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1407
1412
  messageActions: void 0
1408
1413
  }
1409
1414
  ) }),
1410
- o == null ? void 0 : o(v),
1415
+ o == null ? void 0 : o(w),
1411
1416
  /* @__PURE__ */ e(
1412
1417
  ps,
1413
1418
  {
1414
- renderActions: () => n == null ? void 0 : n(v)
1419
+ renderActions: () => n == null ? void 0 : n(w)
1415
1420
  }
1416
1421
  )
1417
1422
  ] })
@@ -1420,17 +1425,17 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1420
1425
  /* @__PURE__ */ e(
1421
1426
  Ds,
1422
1427
  {
1423
- dialogRef: w,
1428
+ dialogRef: p,
1424
1429
  onClose: E,
1425
1430
  participant: D,
1426
- channel: v,
1427
- followerStatusLabel: C,
1431
+ channel: w,
1432
+ followerStatusLabel: N,
1428
1433
  onLeaveConversation: l,
1429
1434
  onBlockParticipant: m,
1430
1435
  showDeleteConversation: a,
1431
1436
  onDeleteConversationClick: c,
1432
- onBlockParticipantClick: g,
1433
- onReportParticipantClick: f,
1437
+ onBlockParticipantClick: x,
1438
+ onReportParticipantClick: h,
1434
1439
  customChannelActions: r
1435
1440
  }
1436
1441
  )
@@ -1445,24 +1450,24 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1445
1450
  onLeaveConversation: m,
1446
1451
  onBlockParticipant: a,
1447
1452
  className: c,
1448
- CustomChannelEmptyState: g = Ss,
1449
- showDeleteConversation: f = !0,
1450
- onDeleteConversationClick: N,
1451
- onBlockParticipantClick: b,
1452
- onReportParticipantClick: y,
1453
+ CustomChannelEmptyState: x = Ss,
1454
+ showDeleteConversation: h = !0,
1455
+ onDeleteConversationClick: b,
1456
+ onBlockParticipantClick: g,
1457
+ onReportParticipantClick: v,
1453
1458
  dmAgentEnabled: r,
1454
1459
  messageMetadata: S,
1455
- onMessageSent: v,
1456
- showStarButton: w = !1,
1460
+ onMessageSent: w,
1461
+ showStarButton: p = !1,
1457
1462
  chatbotVotingEnabled: D = !1,
1458
- renderChannelBanner: C,
1459
- customChannelActions: p,
1463
+ renderChannelBanner: N,
1464
+ customChannelActions: y,
1460
1465
  renderMessage: E
1461
1466
  }) => {
1462
1467
  const _ = L(
1463
- async (h, u, d) => {
1468
+ async (f, u, d) => {
1464
1469
  var T;
1465
- const x = ((T = t.data) == null ? void 0 : T.chatbot_paused) === !0, M = r && !x, H = {
1470
+ const C = ((T = t.data) == null ? void 0 : T.chatbot_paused) === !0, M = r && !C, H = {
1466
1471
  ...u,
1467
1472
  ...M && { silent: !0 },
1468
1473
  ...S && {
@@ -1475,9 +1480,9 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1475
1480
  ...d,
1476
1481
  ...M && { skip_push: !0 }
1477
1482
  }, z = await t.sendMessage(H, Z);
1478
- return v == null || v(z), z;
1483
+ return w == null || w(z), z;
1479
1484
  },
1480
- [t, r, S, v]
1485
+ [t, r, S, w]
1481
1486
  );
1482
1487
  return /* @__PURE__ */ e(
1483
1488
  "div",
@@ -1491,7 +1496,7 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1491
1496
  {
1492
1497
  channel: t,
1493
1498
  MessageSystem: Is,
1494
- EmptyStateIndicator: g,
1499
+ EmptyStateIndicator: x,
1495
1500
  LoadingIndicator: Ne,
1496
1501
  DateSeparator: cs,
1497
1502
  doSendMessageRequest: _,
@@ -1504,15 +1509,15 @@ const le = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
1504
1509
  renderConversationFooter: l,
1505
1510
  onLeaveConversation: m,
1506
1511
  onBlockParticipant: a,
1507
- CustomChannelEmptyState: g,
1508
- showDeleteConversation: f,
1509
- onDeleteConversationClick: N,
1510
- onBlockParticipantClick: b,
1511
- onReportParticipantClick: y,
1512
- showStarButton: w,
1512
+ CustomChannelEmptyState: x,
1513
+ showDeleteConversation: h,
1514
+ onDeleteConversationClick: b,
1515
+ onBlockParticipantClick: g,
1516
+ onReportParticipantClick: v,
1517
+ showStarButton: p,
1513
1518
  chatbotVotingEnabled: D,
1514
- renderChannelBanner: C,
1515
- customChannelActions: p,
1519
+ renderChannelBanner: N,
1520
+ customChannelActions: y,
1516
1521
  renderMessage: E
1517
1522
  }
1518
1523
  )
@@ -1571,9 +1576,9 @@ const Ls = ({
1571
1576
  searchPlaceholder: m = "Search participants...",
1572
1577
  className: a
1573
1578
  }) => {
1574
- const { debug: c } = ve(), [g, f] = k(""), [N, b] = k([]), [y, r] = k(!1), [S, v] = k(null), [w, D] = k(
1579
+ const { debug: c } = ve(), [x, h] = k(""), [b, g] = k([]), [v, r] = k(!1), [S, w] = k(null), [p, D] = k(
1575
1580
  null
1576
- ), C = J(!1);
1581
+ ), N = J(!1);
1577
1582
  Q(() => {
1578
1583
  if (t.loading) {
1579
1584
  c && console.log(
@@ -1581,46 +1586,46 @@ const Ls = ({
1581
1586
  );
1582
1587
  return;
1583
1588
  }
1584
- if (C.current) return;
1589
+ if (N.current) return;
1585
1590
  (async () => {
1586
- c && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), v(null);
1591
+ c && console.log("[ParticipantPicker] Loading initial participants..."), r(!0), w(null);
1587
1592
  try {
1588
1593
  const u = await t.loadParticipants({
1589
1594
  search: "",
1590
1595
  // Load all participants initially
1591
1596
  limit: 100
1592
1597
  });
1593
- b(u.participants), C.current = !0, c && console.log(
1598
+ g(u.participants), N.current = !0, c && console.log(
1594
1599
  "[ParticipantPicker] Participants loaded successfully:",
1595
1600
  u.participants.length
1596
1601
  );
1597
1602
  } catch (u) {
1598
1603
  const d = u instanceof Error ? u.message : "Failed to load participants";
1599
- v(d), console.error("[ParticipantPicker] Failed to load participants:", u);
1604
+ w(d), console.error("[ParticipantPicker] Failed to load participants:", u);
1600
1605
  } finally {
1601
1606
  r(!1);
1602
1607
  }
1603
1608
  })();
1604
1609
  }, [t.loading, c]);
1605
- const p = N.filter((h) => !o.has(h.id)).filter((h) => {
1610
+ const y = b.filter((f) => !o.has(f.id)).filter((f) => {
1606
1611
  var d;
1607
- if (!g) return !0;
1608
- const u = g.toLowerCase();
1609
- return h.name.toLowerCase().includes(u) || ((d = h.email) == null ? void 0 : d.toLowerCase().includes(u)) || !1;
1612
+ if (!x) return !0;
1613
+ const u = x.toLowerCase();
1614
+ return f.name.toLowerCase().includes(u) || ((d = f.email) == null ? void 0 : d.toLowerCase().includes(u)) || !1;
1610
1615
  }), E = L(
1611
- async (h) => {
1612
- if (!w) {
1613
- D(h.id);
1616
+ async (f) => {
1617
+ if (!p) {
1618
+ D(f.id);
1614
1619
  try {
1615
- await s(h);
1620
+ await s(f);
1616
1621
  } catch (u) {
1617
1622
  console.error("[ParticipantPicker] Failed to start chat:", u), D(null);
1618
1623
  }
1619
1624
  }
1620
1625
  },
1621
- [s, w]
1622
- ), _ = (h, u) => {
1623
- (h.key === "Enter" || h.key === " ") && (h.preventDefault(), E(u));
1626
+ [s, p]
1627
+ ), _ = (f, u) => {
1628
+ (f.key === "Enter" || f.key === " ") && (f.preventDefault(), E(u));
1624
1629
  };
1625
1630
  return /* @__PURE__ */ i("div", { className: R("flex flex-col h-full", a), children: [
1626
1631
  /* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
@@ -1632,15 +1637,15 @@ const Ls = ({
1632
1637
  "Select a ",
1633
1638
  l.slice(0, -1),
1634
1639
  " to start messaging (",
1635
- p.length,
1640
+ y.length,
1636
1641
  " available)",
1637
1642
  t.totalCount !== void 0 && ` โ€ข ${t.totalCount} ${l} total`
1638
1643
  ] }),
1639
1644
  /* @__PURE__ */ e(
1640
1645
  Rs,
1641
1646
  {
1642
- searchQuery: g,
1643
- setSearchQuery: f,
1647
+ searchQuery: x,
1648
+ setSearchQuery: h,
1644
1649
  placeholder: m
1645
1650
  }
1646
1651
  )
@@ -1651,35 +1656,35 @@ const Ls = ({
1651
1656
  ": ",
1652
1657
  S
1653
1658
  ] }),
1654
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: y && p.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1659
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-auto", children: v && y.length === 0 ? /* @__PURE__ */ e("div", { className: "h-32 flex items-center justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1655
1660
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1656
1661
  /* @__PURE__ */ i("span", { className: "text-sm text-stone", children: [
1657
1662
  "Loading ",
1658
1663
  l,
1659
1664
  "..."
1660
1665
  ] })
1661
- ] }) }) : p.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1666
+ ] }) }) : y.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
1662
1667
  /* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Oe, { className: "h-8 w-8 text-charcoal" }) }),
1663
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: g ? `No ${l} found` : N.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1664
- /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: g ? "Try a different search term" : N.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1668
+ /* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: x ? `No ${l} found` : b.length > 0 ? `Already chatting with all ${l}` : `No ${l} yet` }),
1669
+ /* @__PURE__ */ e("p", { className: "text-xs text-stone", children: x ? "Try a different search term" : b.length > 0 ? `You have existing conversations with all your ${l}` : `${l.charAt(0).toUpperCase() + l.slice(1)} will appear here` })
1665
1670
  ] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
1666
- p.map((h) => {
1667
- const u = h.name || h.email || h.id, d = h.email && h.name ? h.email : h.phone;
1671
+ y.map((f) => {
1672
+ const u = f.name || f.email || f.id, d = f.email && f.name ? f.email : f.phone;
1668
1673
  return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
1669
1674
  "button",
1670
1675
  {
1671
1676
  type: "button",
1672
- onClick: () => E(h),
1673
- onKeyDown: (x) => _(x, h),
1677
+ onClick: () => E(f),
1678
+ onKeyDown: (C) => _(C, f),
1674
1679
  className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
1675
1680
  children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
1676
1681
  /* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
1677
1682
  /* @__PURE__ */ e(
1678
1683
  te,
1679
1684
  {
1680
- id: h.id,
1685
+ id: f.id,
1681
1686
  name: u,
1682
- image: h.image,
1687
+ image: f.image,
1683
1688
  size: 40
1684
1689
  }
1685
1690
  ),
@@ -1688,12 +1693,12 @@ const Ls = ({
1688
1693
  d && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: d })
1689
1694
  ] })
1690
1695
  ] }),
1691
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: w === h.id ? /* @__PURE__ */ e(be, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone" }) })
1696
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: p === f.id ? /* @__PURE__ */ e(be, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Oe, { className: "h-5 w-5 text-stone" }) })
1692
1697
  ] })
1693
1698
  }
1694
- ) }, h.id);
1699
+ ) }, f.id);
1695
1700
  }),
1696
- y && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1701
+ v && /* @__PURE__ */ e("li", { className: "p-4 flex justify-center", children: /* @__PURE__ */ i("div", { className: "flex items-center space-x-2", children: [
1697
1702
  /* @__PURE__ */ e("div", { className: "w-4 h-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
1698
1703
  /* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading more..." })
1699
1704
  ] }) })
@@ -1867,26 +1872,26 @@ const Hs = ({
1867
1872
  onParticipantSelect: m,
1868
1873
  initialParticipantFilter: a,
1869
1874
  initialParticipantData: c,
1870
- CustomChannelEmptyState: g,
1871
- showChannelList: f = !0,
1872
- filters: N,
1873
- channelListCustomEmptyStateIndicator: b,
1874
- onDeleteConversationClick: y,
1875
+ CustomChannelEmptyState: x,
1876
+ showChannelList: h = !0,
1877
+ filters: b,
1878
+ channelListCustomEmptyStateIndicator: g,
1879
+ onDeleteConversationClick: v,
1875
1880
  onBlockParticipantClick: r,
1876
1881
  onReportParticipantClick: S,
1877
- dmAgentEnabled: v,
1878
- messageMetadata: w,
1882
+ dmAgentEnabled: w,
1883
+ messageMetadata: p,
1879
1884
  onMessageSent: D,
1880
- showStarButton: C = !1,
1881
- chatbotVotingEnabled: p = !1,
1885
+ showStarButton: N = !1,
1886
+ chatbotVotingEnabled: y = !1,
1882
1887
  renderMessagePreview: E,
1883
1888
  renderChannelBanner: _,
1884
- customChannelActions: h,
1889
+ customChannelActions: f,
1885
1890
  renderMessage: u
1886
1891
  }) => {
1887
1892
  const {
1888
1893
  service: d,
1889
- client: x,
1894
+ client: C,
1890
1895
  isConnected: M,
1891
1896
  isLoading: H,
1892
1897
  error: Z,
@@ -1897,7 +1902,7 @@ const Hs = ({
1897
1902
  participantLabel: ce = "participants",
1898
1903
  showDeleteConversation: me = !0
1899
1904
  } = t, Qe = F.useMemo(() => {
1900
- const I = x == null ? void 0 : x.userID;
1905
+ const I = C == null ? void 0 : C.userID;
1901
1906
  return {
1902
1907
  ...{
1903
1908
  type: "messaging",
@@ -1907,15 +1912,15 @@ const Hs = ({
1907
1912
  hidden: !1
1908
1913
  }
1909
1914
  },
1910
- ...N
1915
+ ...b
1911
1916
  };
1912
- }, [N, x == null ? void 0 : x.userID]), he = J(null), oe = L(async () => {
1913
- if (!x || !M) return;
1914
- const I = x.userID;
1917
+ }, [b, C == null ? void 0 : C.userID]), he = J(null), oe = L(async () => {
1918
+ if (!C || !M) return;
1919
+ const I = C.userID;
1915
1920
  if (I)
1916
1921
  try {
1917
1922
  T && console.log("[MessagingShell] Syncing channels for user:", I);
1918
- const V = await x.queryChannels(
1923
+ const V = await C.queryChannels(
1919
1924
  {
1920
1925
  type: "messaging",
1921
1926
  members: { $in: [I] }
@@ -1937,22 +1942,22 @@ const Hs = ({
1937
1942
  } catch (V) {
1938
1943
  console.error("[MessagingShell] Failed to sync channels:", V);
1939
1944
  }
1940
- }, [x, M, T]);
1945
+ }, [C, M, T]);
1941
1946
  Q(() => {
1942
- if (!x || !M) return;
1943
- const I = x.userID;
1947
+ if (!C || !M) return;
1948
+ const I = C.userID;
1944
1949
  I && he.current !== I && oe();
1945
- }, [x, M, oe]), Q(() => {
1946
- if (!a || !x || !M) return;
1950
+ }, [C, M, oe]), Q(() => {
1951
+ if (!a || !C || !M) return;
1947
1952
  (async () => {
1948
- const V = x.userID;
1953
+ const V = C.userID;
1949
1954
  if (V)
1950
1955
  try {
1951
1956
  T && console.log(
1952
1957
  "[MessagingShell] Loading initial conversation with:",
1953
1958
  a
1954
1959
  );
1955
- const O = await x.queryChannels(
1960
+ const O = await C.queryChannels(
1956
1961
  {
1957
1962
  type: "messaging",
1958
1963
  members: { $eq: [V, a] }
@@ -2004,7 +2009,7 @@ const Hs = ({
2004
2009
  }, [
2005
2010
  a,
2006
2011
  c,
2007
- x,
2012
+ C,
2008
2013
  M,
2009
2014
  d,
2010
2015
  T,
@@ -2062,7 +2067,7 @@ const Hs = ({
2062
2067
  },
2063
2068
  [oe, T]
2064
2069
  ), ge = !!W;
2065
- return H ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: Z, onBack: z }) }) : !M || !x ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
2070
+ return H ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ne, {}) }) : Z ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(Ce, { message: Z, onBack: z }) }) : !M || !C ? /* @__PURE__ */ e("div", { className: R("h-full", s), children: /* @__PURE__ */ e(
2066
2071
  Ce,
2067
2072
  {
2068
2073
  message: "Not connected to messaging service",
@@ -2083,11 +2088,11 @@ const Hs = ({
2083
2088
  className: R(
2084
2089
  "messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
2085
2090
  {
2086
- "!hidden": f === !1 || q,
2091
+ "!hidden": h === !1 || q,
2087
2092
  // Hide on mobile when channel selected, show on desktop with consistent wide width
2088
- "hidden lg:flex lg:flex-1 lg:max-w-2xl": f !== !1 && !q && ge,
2093
+ "hidden lg:flex lg:flex-1 lg:max-w-2xl": h !== !1 && !q && ge,
2089
2094
  // Show on mobile when no channel selected, use same wide width on desktop
2090
- "flex flex-col w-full lg:flex-1 lg:max-w-2xl": f !== !1 && !q && !ge
2095
+ "flex flex-col w-full lg:flex-1 lg:max-w-2xl": h !== !1 && !q && !ge
2091
2096
  }
2092
2097
  ),
2093
2098
  children: /* @__PURE__ */ e(
@@ -2096,7 +2101,7 @@ const Hs = ({
2096
2101
  onChannelSelect: Xe,
2097
2102
  selectedChannel: W || void 0,
2098
2103
  filters: Qe,
2099
- customEmptyStateIndicator: b,
2104
+ customEmptyStateIndicator: g,
2100
2105
  renderMessagePreview: E
2101
2106
  }
2102
2107
  )
@@ -2125,17 +2130,17 @@ const Hs = ({
2125
2130
  renderChannelBanner: _,
2126
2131
  onLeaveConversation: st,
2127
2132
  onBlockParticipant: nt,
2128
- CustomChannelEmptyState: g,
2133
+ CustomChannelEmptyState: x,
2129
2134
  showDeleteConversation: me,
2130
- onDeleteConversationClick: y,
2135
+ onDeleteConversationClick: v,
2131
2136
  onBlockParticipantClick: r,
2132
2137
  onReportParticipantClick: S,
2133
- dmAgentEnabled: v,
2134
- messageMetadata: w,
2138
+ dmAgentEnabled: w,
2139
+ messageMetadata: p,
2135
2140
  onMessageSent: D,
2136
- showStarButton: C,
2137
- chatbotVotingEnabled: p,
2138
- customChannelActions: h,
2141
+ showStarButton: N,
2142
+ chatbotVotingEnabled: y,
2143
+ customChannelActions: f,
2139
2144
  renderMessage: u
2140
2145
  },
2141
2146
  W.id
@@ -2208,7 +2213,7 @@ const Hs = ({
2208
2213
  avatarImage: m,
2209
2214
  avatarName: a
2210
2215
  }) => {
2211
- const c = t.filter((g) => g.enabled).sort((g, f) => (g.order ?? 0) - (f.order ?? 0));
2216
+ const c = t.filter((x) => x.enabled).sort((x, h) => (x.order ?? 0) - (h.order ?? 0));
2212
2217
  return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
2213
2218
  (m || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
2214
2219
  te,
@@ -2227,58 +2232,58 @@ const Hs = ({
2227
2232
  style: { backgroundColor: "#F1F0EE" },
2228
2233
  children: [
2229
2234
  o && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: o }),
2230
- c.map((g) => /* @__PURE__ */ e(
2235
+ c.map((x) => /* @__PURE__ */ e(
2231
2236
  Us,
2232
2237
  {
2233
- question: g.question,
2234
- onClick: () => s(g.id),
2235
- loading: n === g.id
2238
+ question: x.question,
2239
+ onClick: () => s(x.id),
2240
+ loading: n === x.id
2236
2241
  },
2237
- g.id
2242
+ x.id
2238
2243
  ))
2239
2244
  ]
2240
2245
  }
2241
2246
  )
2242
2247
  ] }) });
2243
2248
  }, Ws = (t, s = {}) => {
2244
- const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = k([]), [a, c] = k(!1), [g, f] = k(null), [N, b] = k(n), [y, r] = k(!0), [S, v] = k(), w = L(async (E = !1, _) => {
2249
+ const { initialSearch: n = "", pageSize: o = 20 } = s, [l, m] = k([]), [a, c] = k(!1), [x, h] = k(null), [b, g] = k(n), [v, r] = k(!0), [S, w] = k(), p = L(async (E = !1, _) => {
2245
2250
  if (a) return;
2246
- const h = _ !== void 0 ? _ : N;
2247
- c(!0), f(null);
2251
+ const f = _ !== void 0 ? _ : b;
2252
+ c(!0), h(null);
2248
2253
  try {
2249
2254
  const u = await t.loadParticipants({
2250
- search: h || void 0,
2255
+ search: f || void 0,
2251
2256
  limit: o,
2252
2257
  cursor: E ? void 0 : S
2253
2258
  });
2254
2259
  m(
2255
2260
  (d) => E ? u.participants : [...d, ...u.participants]
2256
- ), r(u.hasMore), v(u.nextCursor);
2261
+ ), r(u.hasMore), w(u.nextCursor);
2257
2262
  } catch (u) {
2258
2263
  const d = u instanceof Error ? u.message : "Failed to load participants";
2259
- f(d), console.error("[useParticipants] Load error:", u);
2264
+ h(d), console.error("[useParticipants] Load error:", u);
2260
2265
  } finally {
2261
2266
  c(!1);
2262
2267
  }
2263
- }, [t, N, S, o, a]), D = L(() => {
2264
- y && !a && w(!1);
2265
- }, [y, a, w]), C = L((E) => {
2266
- b(E), v(void 0), w(!0, E);
2267
- }, [w]), p = L(() => {
2268
- v(void 0), w(!0);
2269
- }, [w]);
2268
+ }, [t, b, S, o, a]), D = L(() => {
2269
+ v && !a && p(!1);
2270
+ }, [v, a, p]), N = L((E) => {
2271
+ g(E), w(void 0), p(!0, E);
2272
+ }, [p]), y = L(() => {
2273
+ w(void 0), p(!0);
2274
+ }, [p]);
2270
2275
  return Q(() => {
2271
- w(!0);
2276
+ p(!0);
2272
2277
  }, [t.loadParticipants]), {
2273
2278
  participants: l,
2274
2279
  loading: a,
2275
- error: g,
2276
- searchQuery: N,
2277
- hasMore: y,
2280
+ error: x,
2281
+ searchQuery: b,
2282
+ hasMore: v,
2278
2283
  totalCount: t.totalCount,
2279
2284
  loadMore: D,
2280
- search: C,
2281
- refresh: p
2285
+ search: N,
2286
+ refresh: y
2282
2287
  };
2283
2288
  };
2284
2289
  export {