@nivaro/react 0.3.17 → 0.3.18

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.
@@ -1,47 +1,47 @@
1
- import { jsxs as a, jsx as e, Fragment as _e } from "react/jsx-runtime";
2
- import { useQuery as Ce, useQueryClient as Rt, useMutation as Ee } from "@tanstack/react-query";
3
- import { Search as Fn, Plus as Wa, Hash as _t, Lock as Fa, ChevronLeft as ct, X as dt, PinOff as za, Pin as St, Headphones as Ha, PlayCircle as Ga, MessageCircle as zn, Users as Tt, AtSign as Qa, AlarmClock as Ka, Sparkles as Ja, BellOff as Tn, PencilLine as Ya, Star as Za, ArchiveRestore as Va, Archive as Xa, Bell as es, LogOut as ts, Info as ns, MapPin as as, Check as At, ArrowUpDown as ss, MessageSquareReply as rs, Quote as ls, ClipboardPlus as os, NotebookPen as is, Bookmark as cs, Pencil as ds, Trash2 as us, AlertTriangle as ms, Paperclip as ps, Bot as hs, CheckCheck as fs, Plane as xs, FilePlus2 as bs } from "lucide-react";
4
- import { useState as T, useEffect as ae, useMemo as fe, useRef as oe, useContext as gs } from "react";
5
- import { toast as he } from "sonner";
1
+ import { jsxs as a, jsx as e, Fragment as ve } from "react/jsx-runtime";
2
+ import { useQuery as _e, useQueryClient as At, useMutation as Ee } from "@tanstack/react-query";
3
+ import { Search as Fn, Plus as Wa, Hash as _t, Lock as Fa, ChevronLeft as ct, X as dt, PinOff as za, Pin as St, Headphones as Ha, PlayCircle as Ga, MessageCircle as zn, Users as Tt, AtSign as Qa, AlarmClock as Ka, Sparkles as Ja, BellOff as Tn, PencilLine as Ya, Star as Za, ArchiveRestore as Va, Archive as Xa, Bell as es, LogOut as ts, Info as ns, MapPin as as, Check as Rt, ArrowUpDown as ss, MessageSquareReply as rs, Quote as ls, ClipboardPlus as os, NotebookPen as is, Bookmark as cs, Pencil as ds, Trash2 as us, AlertTriangle as ms, Paperclip as ps, Bot as hs, CheckCheck as fs, Plane as xs, FilePlus2 as bs } from "lucide-react";
4
+ import { useState as T, useEffect as ee, useMemo as be, useRef as ie, useContext as gs } from "react";
5
+ import { toast as xe } from "sonner";
6
6
  import { useItemEditAuth as ut, useNavigation as vs, useNivaroClient as Je } from "../../context.js";
7
- import { get as xe, post as Be, patch as ys } from "../../lib/commands.js";
7
+ import { get as ge, post as Be, patch as ys } from "../../lib/commands.js";
8
8
  import { useLiveRecord as ks, batchTouches as ws, LIVE_ASPECTS as Ns } from "../../lib/live.js";
9
9
  import { usePresenceOnlinePoll as Cs } from "../../lib/presence-live.js";
10
10
  import { presencePlaceHref as Un, stuckText as Dn, fullHref as $n } from "../../lib/presence-state.js";
11
11
  import { invalidateRecordTasks as _s } from "../../lib/record-tasks.js";
12
12
  import { userCardQuery as Ss } from "../../lib/user-cards.js";
13
- import { cn as b, getDisplayTimezone as Mt, formatRelative as Hn } from "../../lib/utils.js";
13
+ import { cn as g, getDisplayTimezone as Mt, formatRelative as Hn } from "../../lib/utils.js";
14
14
  import { CustomStatusEditor as Ts } from "../CustomStatusEditor.js";
15
15
  import { DoNotDisturbRow as Us } from "../DoNotDisturb.js";
16
16
  import { FilePreviewLightbox as Ds } from "../FilePreviewLightbox.js";
17
17
  import { UserChip as Ot } from "../item-edit/UserChip.js";
18
18
  import { StaleBuildChip as $s } from "../StaleBuildChip.js";
19
- import { UserAvatar as Rs } from "../UserAvatar.js";
19
+ import { UserAvatar as As } from "../UserAvatar.js";
20
20
  import { Popover as Ye, PopoverTrigger as Ze, PopoverContent as Ve } from "../ui/popover.js";
21
21
  import { SimpleSelect as Lt } from "../ui/SimpleSelect.js";
22
- import { useBotStream as As, BotStreamBubble as Ms } from "./BotStream.js";
22
+ import { useBotStream as Rs, BotStreamBubble as Ms } from "./BotStream.js";
23
23
  import { MembershipHistory as Os, ArchiveSuggestionBanner as Ls } from "./ChannelArchive.js";
24
24
  import { ChannelExtrasEditor as Ps, BulkInvitePanel as Is, ChannelAuditLog as js } from "./ChannelExtras.js";
25
25
  import { ChannelTile as Ke, ChannelLookPicker as Gn } from "./ChannelLook.js";
26
26
  import { MentionsView as Qn, ScheduledView as Kn, CatchUpView as Jn, useSearchFilterState as qs, FilterToggle as Es, ChatSettingsButton as Bs, SearchFilterBar as Ws } from "./ChatViews.js";
27
27
  import { ChatComposer as Fs } from "./Composer.js";
28
- import { useMyPreferences as Pt, useSetMyPreferences as Yn, useChatRoles as Zn, useChannelDirectory as zs, useRoomMembership as It, useCreateChannel as Hs, useChatConfig as Me, useChannelMembers as jt, useChannelAdmin as Vn, useUserSearch as qt, GENERAL_CHANNEL_ID as Xn, useChatRooms as ea, useArchivedRooms as ta, sortOnlineUsers as Gs, dmRoom as Ut, CHAT_DEFAULTS as it, ChatConfigContext as na, useChatBotInfo as Et, useChatSearch as Qs, dmPeer as Ne, useChatMessages as Ks, useOpenRoomRegistration as Js, useMarkRoomRead as Ys, useTypingIndicator as Zs, usePeerReadAt as Vs, useEntityRoomLink as Xs, useToggleReaction as er, useRoomPins as tr, useTogglePin as nr, useEditMessage as ar, useDeleteMessage as sr, useChatBotName as rr, useChatThread as lr, useRecordBrowserTimezone as or, chatInitials as ir, chatAvatarColor as cr, useCreateGroupDm as dr, canOpenDm as ur, openDmWith as mr, chatRoomTypesQuery as aa, REACTION_EMOJI as pr } from "./chat-core.js";
28
+ import { useMyPreferences as Pt, useSetMyPreferences as Yn, useChatRoles as Zn, useChannelDirectory as zs, useRoomMembership as It, useCreateChannel as Hs, useChatConfig as Me, useChannelMembers as jt, useChannelAdmin as Vn, useUserSearch as qt, GENERAL_CHANNEL_ID as Xn, useChatRooms as ea, useArchivedRooms as ta, sortOnlineUsers as Gs, dmRoom as Ut, CHAT_DEFAULTS as it, ChatConfigContext as na, useChatBotInfo as Et, useChatSearch as Qs, dmPeer as Ce, useChatMessages as Ks, useOpenRoomRegistration as Js, useMarkRoomRead as Ys, useTypingIndicator as Zs, usePeerReadAt as Vs, useEntityRoomLink as Xs, useToggleReaction as er, useRoomPins as tr, useTogglePin as nr, useEditMessage as ar, useDeleteMessage as sr, useChatBotName as rr, useChatThread as lr, useRecordBrowserTimezone as or, chatInitials as ir, chatAvatarColor as cr, useCreateGroupDm as dr, canOpenDm as ur, openDmWith as mr, chatRoomTypesQuery as aa, REACTION_EMOJI as pr } from "./chat-core.js";
29
29
  import { useDraftRooms as hr } from "./chat-drafts.js";
30
30
  import { useCustomEmoji as fr, EmojiButton as xr, EmojiGlyph as br } from "./chat-emoji.js";
31
31
  import { useRoomRecord as sa, useRecordFileTargets as gr } from "./chat-hooks.js";
32
32
  import { offHoursNote as vr } from "./chat-local-time.js";
33
33
  import { useMessageWindow as yr } from "./chat-window.js";
34
- import { HuddleFollowHost as Rn } from "./huddle/HuddleCollab.js";
34
+ import { HuddleFollowHost as An } from "./huddle/HuddleCollab.js";
35
35
  import { HuddleControls as kr } from "./huddle/HuddleControls.js";
36
36
  import { HuddleLiveBadge as wr } from "./huddle/HuddleLiveBadge.js";
37
37
  import { HuddleScheduleCard as Nr } from "./huddle/HuddleScheduleCard.js";
38
38
  import { HuddleScheduleForm as Cr } from "./huddle/HuddleScheduleForm.js";
39
39
  import { HuddleStage as _r } from "./huddle/HuddleStage.js";
40
40
  import { useHuddleLive as Sr } from "./huddle/huddle-live.js";
41
- import { stripHuddleRef as An, huddleRefOf as Mn } from "./huddle/huddle-schedule.js";
41
+ import { stripHuddleRef as Rn, huddleRefOf as Mn } from "./huddle/huddle-schedule.js";
42
42
  import { useHuddle as Tr } from "./huddle/useHuddle.js";
43
43
  import { useMessageActions as Ur, MessageActionsMenu as Dr, actionsForMessage as $r } from "./MessageActions.js";
44
- import { FormattedMessage as Rr, LinkPreviews as Ar } from "./MessageFormat.js";
44
+ import { FormattedMessage as Ar, LinkPreviews as Rr } from "./MessageFormat.js";
45
45
  import { PollCard as Mr } from "./PollCard.js";
46
46
  import { RoomStatusMarks as Or, headerIconIdle as On, headerIconButton as Ln, RoomHeaderMenu as Lr } from "./RoomHeaderMenu.js";
47
47
  import { MemberCountLine as Pr, ChannelIntro as Ir, WelcomeNote as jr, ThreadPane as qr, RoomInfoDrawer as Er } from "./RoomParts.js";
@@ -67,30 +67,30 @@ function co({
67
67
  collections: r,
68
68
  globalRoom: o = it.globalRoom,
69
69
  globalLabel: i = it.globalLabel,
70
- entityPattern: d = it.entityPattern,
71
- entityUrl: c = () => null,
72
- roomLabel: h,
70
+ entityPattern: m = it.entityPattern,
71
+ entityUrl: d = () => null,
72
+ roomLabel: b,
73
73
  recordUrl: f,
74
- sessionUrl: u,
75
- realtime: p,
76
- subscribeRooms: g,
74
+ sessionUrl: p,
75
+ realtime: x,
76
+ subscribeRooms: v,
77
77
  setTypingRoom: U,
78
78
  navigate: $,
79
79
  sound: C = !0,
80
80
  theme: S
81
81
  }) {
82
- const W = fe(
82
+ const E = be(
83
83
  () => ({
84
84
  collections: { ...it.collections, ...r },
85
85
  globalRoom: o,
86
86
  globalLabel: i,
87
- entityPattern: d,
88
- entityUrl: c,
89
- roomLabel: h,
87
+ entityPattern: m,
88
+ entityUrl: d,
89
+ roomLabel: b,
90
90
  recordUrl: f,
91
- sessionUrl: u,
92
- realtime: p,
93
- subscribeRooms: g,
91
+ sessionUrl: p,
92
+ realtime: x,
93
+ subscribeRooms: v,
94
94
  me: s,
95
95
  onlineUsers: l,
96
96
  setTypingRoom: U,
@@ -104,15 +104,15 @@ function co({
104
104
  r,
105
105
  o,
106
106
  i,
107
- d,
108
- p,
107
+ m,
108
+ x,
109
109
  U,
110
110
  C
111
111
  ]
112
112
  );
113
- return Bt.current = { ...oa, ...S }, /* @__PURE__ */ e(na.Provider, { value: W, children: n });
113
+ return Bt.current = { ...oa, ...S }, /* @__PURE__ */ e(na.Provider, { value: E, children: n });
114
114
  }
115
- function ie() {
115
+ function ce() {
116
116
  return Bt.current;
117
117
  }
118
118
  const Pn = /* @__PURE__ */ new WeakMap();
@@ -122,25 +122,25 @@ function Fr(n, s) {
122
122
  r || (r = { ids: /* @__PURE__ */ new Map(), timer: null }, Pn.set(n, r));
123
123
  const o = r;
124
124
  return new Promise((i) => {
125
- const d = o.ids.get(l) ?? [];
126
- d.push(i), o.ids.set(l, d), !o.timer && (o.timer = setTimeout(async () => {
127
- const c = new Map(o.ids);
125
+ const m = o.ids.get(l) ?? [];
126
+ m.push(i), o.ids.set(l, m), !o.timer && (o.timer = setTimeout(async () => {
127
+ const d = new Map(o.ids);
128
128
  o.ids.clear(), o.timer = null;
129
- const h = [...c.keys()], f = /* @__PURE__ */ new Map();
130
- for (let u = 0; u < h.length; u += 100)
129
+ const b = [...d.keys()], f = /* @__PURE__ */ new Map();
130
+ for (let p = 0; p < b.length; p += 100)
131
131
  try {
132
- const p = await n.request(
133
- xe("/presence/people", { ids: h.slice(u, u + 100).join(",") })
132
+ const x = await n.request(
133
+ ge("/presence/people", { ids: b.slice(p, p + 100).join(",") })
134
134
  );
135
- for (const g of p.data ?? []) f.set(String(g.user_id).toUpperCase(), g);
135
+ for (const v of x.data ?? []) f.set(String(v.user_id).toUpperCase(), v);
136
136
  } catch {
137
137
  }
138
- for (const [u, p] of c) for (const g of p) g(f.get(u) ?? null);
138
+ for (const [p, x] of d) for (const v of x) v(f.get(p) ?? null);
139
139
  }, 0));
140
140
  });
141
141
  }
142
142
  function Wt(n, s = !0) {
143
- const l = Je(), { data: r } = Ce({
143
+ const l = Je(), { data: r } = _e({
144
144
  queryKey: ["nvr-person-info", n ? String(n).toUpperCase() : null],
145
145
  queryFn: () => Fr(l, n),
146
146
  enabled: !!n && s,
@@ -156,8 +156,8 @@ function ca(n) {
156
156
  if (l.loaded) {
157
157
  const i = l.byUser.get(r);
158
158
  if (!i) return { state: "offline", title: "Offline", page: null };
159
- const d = i.page ?? ha(i.current_path);
160
- return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: Dt(i), page: d } : { state: "online", title: "Online", page: d };
159
+ const m = i.page ?? ha(i.current_path);
160
+ return i.away ? { state: "away", title: "Away", page: null } : i.is_idle ? { state: "idle", title: Dt(i), page: m } : { state: "online", title: "Online", page: m };
161
161
  }
162
162
  const o = s == null ? void 0 : s.onlineUsers.find((i) => String(i.user_id).toUpperCase() === r);
163
163
  return o ? o.is_idle ? { state: "idle", title: Dt(o), page: null } : { state: "online", title: "Online", page: null } : { state: "offline", title: "Offline", page: null };
@@ -171,42 +171,42 @@ function da(n) {
171
171
  })}` : "Out of office" : null;
172
172
  }
173
173
  function zr({ id: n, size: s }) {
174
- const { state: l, title: r, page: o } = ca(n), i = Wt(n), d = l === "offline" ? ia(i) : null, c = da(i), h = s >= 30 ? 10 : 8, f = [
175
- d ? `Offline · ${d}` : r,
174
+ const { state: l, title: r, page: o } = ca(n), i = Wt(n), m = l === "offline" ? ia(i) : null, d = da(i), b = s >= 30 ? 10 : 8, f = [
175
+ m ? `Offline · ${m}` : r,
176
176
  o && l !== "offline" ? `On ${o}` : null,
177
- c,
178
- c && (i != null && i.delegate) ? `${i.delegate.name} is covering` : null
177
+ d,
178
+ d && (i != null && i.delegate) ? `${i.delegate.name} is covering` : null
179
179
  ].filter(Boolean).join(" · ");
180
- return /* @__PURE__ */ a(_e, { children: [
180
+ return /* @__PURE__ */ a(ve, { children: [
181
181
  /* @__PURE__ */ e(
182
182
  "span",
183
183
  {
184
- className: b(
184
+ className: g(
185
185
  "absolute -bottom-0.5 -right-0.5 rounded-full border-2 border-white dark:border-card",
186
186
  l === "online" ? "bg-emerald-400" : l === "idle" || l === "away" ? "border-amber-400 bg-white dark:border-amber-400 dark:bg-card" : "bg-slate-300 dark:bg-slate-600"
187
187
  ),
188
- style: { width: h, height: h },
188
+ style: { width: b, height: b },
189
189
  "data-tip": f,
190
190
  title: f,
191
191
  "data-chat-presence": l
192
192
  }
193
193
  ),
194
- c && // Out of office is its own mark, top-right, so it reads beside any of
194
+ d && // Out of office is its own mark, top-right, so it reads beside any of
195
195
  // the four presence states rather than replacing one.
196
196
  /* @__PURE__ */ e(
197
197
  "span",
198
198
  {
199
199
  className: "absolute -right-1 -top-1 flex items-center justify-center rounded-full border-2 border-white bg-violet-600 text-white dark:border-card",
200
- style: { width: h + 2, height: h + 2 },
200
+ style: { width: b + 2, height: b + 2 },
201
201
  "data-chat-ooo": !0,
202
202
  title: f,
203
- "aria-label": c,
204
- children: /* @__PURE__ */ e(xs, { style: { width: h - 3, height: h - 3 }, strokeWidth: 2.5 })
203
+ "aria-label": d,
204
+ children: /* @__PURE__ */ e(xs, { style: { width: b - 3, height: b - 3 }, strokeWidth: 2.5 })
205
205
  }
206
206
  )
207
207
  ] });
208
208
  }
209
- function Z({
209
+ function Y({
210
210
  id: n,
211
211
  name: s,
212
212
  size: l = 32,
@@ -225,22 +225,22 @@ function Z({
225
225
  "aria-hidden": !0,
226
226
  children: ir(s)
227
227
  }
228
- ), d = /* @__PURE__ */ e(
229
- Rs,
228
+ ), m = /* @__PURE__ */ e(
229
+ As,
230
230
  {
231
231
  userId: n,
232
232
  fallback: i,
233
233
  style: { width: l, height: l },
234
234
  alt: s ?? ""
235
235
  }
236
- ), c = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(n).toUpperCase();
237
- return !r || c ? d : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
238
- d,
236
+ ), d = n === "__bot__" || !!o.bot_user_id && String(o.bot_user_id).toUpperCase() === String(n).toUpperCase();
237
+ return !r || d ? m : /* @__PURE__ */ a("span", { className: "relative inline-flex shrink-0", style: { width: l, height: l }, children: [
238
+ m,
239
239
  /* @__PURE__ */ e(zr, { id: n, size: l })
240
240
  ] });
241
241
  }
242
242
  function Hr({ peerId: n, name: s }) {
243
- const l = Et(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(Z, { id: n, name: s, size: 28 });
243
+ const l = Et(), r = n === "__bot__" || !!l.bot_user_id && String(l.bot_user_id).toUpperCase() === n.toUpperCase(), o = /* @__PURE__ */ e(Y, { id: n, name: s, size: 28 });
244
244
  return r ? /* @__PURE__ */ e("span", { className: "mr-1 inline-flex shrink-0", children: o }) : /* @__PURE__ */ e(Ot, { userId: n, children: /* @__PURE__ */ e(
245
245
  "button",
246
246
  {
@@ -253,41 +253,41 @@ function Hr({ peerId: n, name: s }) {
253
253
  ) });
254
254
  }
255
255
  function In({ token: n, url: s, mine: l }) {
256
- const r = Me(), o = ie(), i = Je(), { data: d } = Ce(aa(i)), { data: c } = Ce({
256
+ const r = Me(), o = ce(), i = Je(), { data: m } = _e(aa(i)), { data: d } = _e({
257
257
  queryKey: ["nvr-chat-entity-card", n],
258
258
  queryFn: async () => {
259
- var u, p, g, U;
260
- for (const $ of d ?? [])
259
+ var p, x, v, U;
260
+ for (const $ of m ?? [])
261
261
  try {
262
- const S = (p = (u = (await i.request(
263
- xe(`/items/${$.collection}`, {
262
+ const S = (x = (p = (await i.request(
263
+ ge(`/items/${$.collection}`, {
264
264
  limit: 1,
265
265
  fields: "id",
266
266
  filter: JSON.stringify({ [$.match_field]: { _eq: n } })
267
267
  })
268
- )).data) == null ? void 0 : u[0]) == null ? void 0 : p.id;
268
+ )).data) == null ? void 0 : p[0]) == null ? void 0 : x.id;
269
269
  if (S == null) continue;
270
- const M = (U = (g = (await i.request(
271
- xe(`/pipelines/instance/${$.collection}/${S}`)
272
- )).data) == null ? void 0 : g.instance) == null ? void 0 : U.current_state_obj;
270
+ const R = (U = (v = (await i.request(
271
+ ge(`/pipelines/instance/${$.collection}/${S}`)
272
+ )).data) == null ? void 0 : v.instance) == null ? void 0 : U.current_state_obj;
273
273
  return {
274
274
  collection: $.collection,
275
275
  id: S,
276
- state: (M == null ? void 0 : M.label) ?? null,
277
- color: (M == null ? void 0 : M.color) ?? null
276
+ state: (R == null ? void 0 : R.label) ?? null,
277
+ color: (R == null ? void 0 : R.color) ?? null
278
278
  };
279
279
  } catch {
280
280
  }
281
281
  return null;
282
282
  },
283
- enabled: ((d == null ? void 0 : d.length) ?? 0) > 0,
283
+ enabled: ((m == null ? void 0 : m.length) ?? 0) > 0,
284
284
  staleTime: 10 * 6e4
285
- }), h = Rt();
285
+ }), b = At();
286
286
  return ks(
287
- c == null ? void 0 : c.collection,
288
- c == null ? void 0 : c.id,
289
- (u) => {
290
- ws(u, Ns.state) && h.invalidateQueries({ queryKey: ["nvr-chat-entity-card", n] });
287
+ d == null ? void 0 : d.collection,
288
+ d == null ? void 0 : d.id,
289
+ (p) => {
290
+ ws(p, Ns.state) && b.invalidateQueries({ queryKey: ["nvr-chat-entity-card", n] });
291
291
  },
292
292
  { includeOwn: !0, debounceMs: 400 }
293
293
  ), /* @__PURE__ */ a(
@@ -295,32 +295,32 @@ function In({ token: n, url: s, mine: l }) {
295
295
  {
296
296
  type: "button",
297
297
  onClick: () => {
298
- var u, p;
299
- if (c) {
300
- const U = (r.recordUrl ?? (($, C) => `/collections/${$}/${C}`))(c.collection, c.id);
298
+ var p, x;
299
+ if (d) {
300
+ const U = (r.recordUrl ?? (($, C) => `/collections/${$}/${C}`))(d.collection, d.id);
301
301
  if (U) {
302
- (u = r.navigate) == null || u.call(r, U);
302
+ (p = r.navigate) == null || p.call(r, U);
303
303
  return;
304
304
  }
305
305
  }
306
- s && ((p = r.navigate) == null || p.call(r, s));
306
+ s && ((x = r.navigate) == null || x.call(r, s));
307
307
  },
308
- className: b(
308
+ className: g(
309
309
  "inline-flex max-w-full items-center gap-1 align-baseline font-medium underline-offset-2 hover:underline",
310
310
  l ? "underline" : o.accentText
311
311
  ),
312
312
  "data-chat-entity": n,
313
313
  children: [
314
314
  n,
315
- (c == null ? void 0 : c.state) && /* @__PURE__ */ e(
315
+ (d == null ? void 0 : d.state) && /* @__PURE__ */ e(
316
316
  "span",
317
317
  {
318
318
  className: "inline-flex items-center rounded-full px-1.5 py-px text-[9px] font-semibold leading-tight",
319
319
  style: {
320
- backgroundColor: c.color ? `${c.color}26` : "rgba(100,116,139,.15)",
321
- color: l ? void 0 : c.color ?? void 0
320
+ backgroundColor: d.color ? `${d.color}26` : "rgba(100,116,139,.15)",
321
+ color: l ? void 0 : d.color ?? void 0
322
322
  },
323
- children: c.state
323
+ children: d.state
324
324
  }
325
325
  )
326
326
  ]
@@ -332,7 +332,7 @@ function Gr(n) {
332
332
  return r.setDate(l.getDate() - 1), s.toDateString() === l.toDateString() ? "Today" : s.toDateString() === r.toDateString() ? "Yesterday" : s.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" });
333
333
  }
334
334
  function Qr({ botName: n }) {
335
- const s = ie(), l = [
335
+ const s = ce(), l = [
336
336
  {
337
337
  k: "@name",
338
338
  kind: "code",
@@ -381,7 +381,7 @@ function Qr({ botName: n }) {
381
381
  r.kind === "code" ? /* @__PURE__ */ e(
382
382
  "code",
383
383
  {
384
- className: b(
384
+ className: g(
385
385
  "h-fit w-fit self-start whitespace-nowrap rounded px-1.5 py-0.5 text-[10.5px] font-semibold",
386
386
  s.accentSoft
387
387
  ),
@@ -396,44 +396,44 @@ function Qr({ botName: n }) {
396
396
  ] });
397
397
  }
398
398
  function Kr({ room: n }) {
399
- const s = Me(), l = ie(), r = Je(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, d = o > 0 ? n.slice(o + 1) : null, c = !!i && !!d && n !== s.globalRoom && i !== "dm" && i !== "ch", h = Rt(), { data: f } = Ce({
399
+ const s = Me(), l = ce(), r = Je(), o = n.indexOf(":"), i = o > 0 ? n.slice(0, o) : null, m = o > 0 ? n.slice(o + 1) : null, d = !!i && !!m && n !== s.globalRoom && i !== "dm" && i !== "ch", b = At(), { data: f } = _e({
400
400
  queryKey: ["nvr-chat-room-card", n],
401
401
  queryFn: async () => {
402
- var R, G, H, V;
403
- const S = (await h.fetchQuery(aa(r))).find((se) => se.is_active && se.prefix === i);
402
+ var A, F, z, G;
403
+ const S = (await b.fetchQuery(aa(r))).find((te) => te.is_active && te.prefix === i);
404
404
  if (!S) return null;
405
- const M = (G = (R = (await r.request(
406
- xe(`/items/${S.collection}`, {
405
+ const R = (F = (A = (await r.request(
406
+ ge(`/items/${S.collection}`, {
407
407
  limit: 1,
408
408
  fields: "id",
409
- filter: JSON.stringify({ [S.match_field]: { _eq: d } })
409
+ filter: JSON.stringify({ [S.match_field]: { _eq: m } })
410
410
  })
411
- )).data) == null ? void 0 : R[0]) == null ? void 0 : G.id;
412
- if (M == null) return null;
413
- const B = (V = (H = (await r.request(
414
- xe(`/pipelines/instance/${S.collection}/${M}`)
415
- )).data) == null ? void 0 : H.instance) == null ? void 0 : V.current_state_obj;
411
+ )).data) == null ? void 0 : A[0]) == null ? void 0 : F.id;
412
+ if (R == null) return null;
413
+ const q = (G = (z = (await r.request(
414
+ ge(`/pipelines/instance/${S.collection}/${R}`)
415
+ )).data) == null ? void 0 : z.instance) == null ? void 0 : G.current_state_obj;
416
416
  return {
417
417
  collection: S.collection,
418
418
  type_label: S.label ?? S.collection.replace(/_/g, " "),
419
- id: M,
420
- state: (B == null ? void 0 : B.label) ?? null,
421
- color: (B == null ? void 0 : B.color) ?? null
419
+ id: R,
420
+ state: (q == null ? void 0 : q.label) ?? null,
421
+ color: (q == null ? void 0 : q.color) ?? null
422
422
  };
423
423
  },
424
- enabled: c,
424
+ enabled: d,
425
425
  staleTime: 6e4
426
- }), u = sa(n, c && !!f);
427
- if (!c || !f) return null;
428
- const g = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (u == null ? void 0 : u.sla) ?? null, $ = (U == null ? void 0 : U.status) === "breached" ? "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300" : (U == null ? void 0 : U.status) === "warning" ? "bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300" : "bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300";
426
+ }), p = sa(n, d && !!f);
427
+ if (!d || !f) return null;
428
+ const v = (s.recordUrl ?? ((C, S) => `/collections/${C}/${S}`))(f.collection, f.id), U = (p == null ? void 0 : p.sla) ?? null, $ = (U == null ? void 0 : U.status) === "breached" ? "bg-red-50 text-red-700 dark:bg-red-500/15 dark:text-red-300" : (U == null ? void 0 : U.status) === "warning" ? "bg-amber-50 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300" : "bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300";
429
429
  return /* @__PURE__ */ a(
430
430
  "div",
431
431
  {
432
- className: b("flex shrink-0 items-center gap-2 border-b px-3 py-1.5", l.divider),
432
+ className: g("flex shrink-0 items-center gap-2 border-b px-3 py-1.5", l.divider),
433
433
  "data-chat-room-card": !0,
434
434
  children: [
435
435
  /* @__PURE__ */ e("span", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: f.type_label }),
436
- /* @__PURE__ */ e("span", { className: "truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: d }),
436
+ /* @__PURE__ */ e("span", { className: "truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: m }),
437
437
  f.state && /* @__PURE__ */ e(
438
438
  "span",
439
439
  {
@@ -448,38 +448,38 @@ function Kr({ room: n }) {
448
448
  U && /* @__PURE__ */ e(
449
449
  "span",
450
450
  {
451
- className: b("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", $),
451
+ className: g("rounded-full px-1.5 py-0.5 text-[10px] font-semibold", $),
452
452
  title: U.due_hours != null ? `${Math.round(U.elapsed_hours ?? 0)}h in this state of ${U.due_hours}h allowed` : void 0,
453
453
  "data-chat-room-sla": U.status,
454
454
  children: U.status === "breached" ? "Past SLA" : U.status === "warning" ? "SLA soon" : "On time"
455
455
  }
456
456
  ),
457
- u && u.owners.length > 0 && /* @__PURE__ */ a(
457
+ p && p.owners.length > 0 && /* @__PURE__ */ a(
458
458
  "span",
459
459
  {
460
460
  className: "ml-auto flex -space-x-1.5",
461
- title: `Owners: ${u.owners.map((C) => C.name).join(", ")}`,
462
- "data-chat-room-owners": u.owners.length,
461
+ title: `Owners: ${p.owners.map((C) => C.name).join(", ")}`,
462
+ "data-chat-room-owners": p.owners.length,
463
463
  children: [
464
- u.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(Z, { id: C.id, name: C.name, size: 18, presence: !1 }, C.id)),
465
- u.owners.length > 4 && /* @__PURE__ */ a("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-slate-200 px-1 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-slate-300", children: [
464
+ p.owners.slice(0, 4).map((C) => /* @__PURE__ */ e(Y, { id: C.id, name: C.name, size: 18, presence: !1 }, C.id)),
465
+ p.owners.length > 4 && /* @__PURE__ */ a("span", { className: "flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-slate-200 px-1 text-[9px] font-semibold text-slate-600 dark:bg-muted dark:text-slate-300", children: [
466
466
  "+",
467
- u.owners.length - 4
467
+ p.owners.length - 4
468
468
  ] })
469
469
  ]
470
470
  }
471
471
  ),
472
- g && /* @__PURE__ */ e(
472
+ v && /* @__PURE__ */ e(
473
473
  "button",
474
474
  {
475
475
  type: "button",
476
476
  onClick: () => {
477
477
  var C;
478
- return (C = s.navigate) == null ? void 0 : C.call(s, g);
478
+ return (C = s.navigate) == null ? void 0 : C.call(s, v);
479
479
  },
480
- className: b(
480
+ className: g(
481
481
  "text-[11px] font-medium hover:underline",
482
- u != null && u.owners.length ? "ml-1.5" : "ml-auto",
482
+ p != null && p.owners.length ? "ml-1.5" : "ml-auto",
483
483
  l.accentText
484
484
  ),
485
485
  children: "Open"
@@ -494,20 +494,20 @@ function Jr(n, s) {
494
494
  const l = Mt() ?? Intl.DateTimeFormat().resolvedOptions().timeZone, r = /* @__PURE__ */ new Date();
495
495
  let o, i;
496
496
  try {
497
- const c = (h) => new Intl.DateTimeFormat("en-US", { timeZone: h, hour: "numeric", minute: "2-digit" }).format(
497
+ const d = (b) => new Intl.DateTimeFormat("en-US", { timeZone: b, hour: "numeric", minute: "2-digit" }).format(
498
498
  r
499
499
  );
500
- o = c(n), i = c(l);
500
+ o = d(n), i = d(l);
501
501
  } catch {
502
502
  return null;
503
503
  }
504
504
  if (o === i) return null;
505
- const d = s.split(/\s+/)[0] || s;
506
- return `${o} for ${d}`;
505
+ const m = s.split(/\s+/)[0] || s;
506
+ return `${o} for ${m}`;
507
507
  }
508
508
  function ua() {
509
509
  const [n, s] = T(0);
510
- return ae(() => {
510
+ return ee(() => {
511
511
  const l = setInterval(() => s((r) => r + 1), 6e4);
512
512
  return () => clearInterval(l);
513
513
  }, []), n;
@@ -517,32 +517,32 @@ function Yr({ peerId: n, name: s }) {
517
517
  const { state: l, title: r } = ca(n), o = Wt(n), i = l === "online" ? "Active now" : l === "offline" ? (() => {
518
518
  const f = ia(o);
519
519
  return f ? f.charAt(0).toUpperCase() + f.slice(1) : "Offline";
520
- })() : r, d = Jr((o == null ? void 0 : o.timezone) ?? null, s), c = da(o), h = c ? (o == null ? void 0 : o.delegate) ?? null : null;
520
+ })() : r, m = Jr((o == null ? void 0 : o.timezone) ?? null, s), d = da(o), b = d ? (o == null ? void 0 : o.delegate) ?? null : null;
521
521
  return /* @__PURE__ */ a(
522
522
  "p",
523
523
  {
524
524
  className: "flex min-w-0 items-center gap-1.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
525
525
  "data-chat-dm-peer-line": l,
526
526
  children: [
527
- c && /* @__PURE__ */ a(_e, { children: [
527
+ d && /* @__PURE__ */ a(ve, { children: [
528
528
  /* @__PURE__ */ e(
529
529
  "span",
530
530
  {
531
531
  className: "shrink-0 font-medium text-violet-700 dark:text-violet-300",
532
532
  "data-chat-dm-ooo": !0,
533
- children: c
533
+ children: d
534
534
  }
535
535
  ),
536
- h && ur() && /* @__PURE__ */ a(
536
+ b && ur() && /* @__PURE__ */ a(
537
537
  "button",
538
538
  {
539
539
  type: "button",
540
- onClick: () => mr(h.id, h.name),
540
+ onClick: () => mr(b.id, b.name),
541
541
  className: "shrink-0 font-medium text-slate-700 underline decoration-dotted underline-offset-2 hover:text-slate-900 dark:text-slate-200 dark:hover:text-white",
542
- "data-chat-dm-delegate": h.id,
542
+ "data-chat-dm-delegate": b.id,
543
543
  children: [
544
544
  "Message ",
545
- h.name,
545
+ b.name,
546
546
  " instead"
547
547
  ]
548
548
  }
@@ -550,9 +550,9 @@ function Yr({ peerId: n, name: s }) {
550
550
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" })
551
551
  ] }),
552
552
  /* @__PURE__ */ e("span", { className: "truncate", children: i }),
553
- d && /* @__PURE__ */ a(_e, { children: [
553
+ m && /* @__PURE__ */ a(ve, { children: [
554
554
  /* @__PURE__ */ e("span", { "aria-hidden": !0, children: "·" }),
555
- /* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (o == null ? void 0 : o.timezone) ?? void 0, children: d })
555
+ /* @__PURE__ */ e("span", { className: "shrink-0", "data-chat-dm-local-time": !0, title: (o == null ? void 0 : o.timezone) ?? void 0, children: m })
556
556
  ] })
557
557
  ]
558
558
  }
@@ -565,208 +565,208 @@ function jn({
565
565
  onOpenSettings: r,
566
566
  renderMessageBody: o,
567
567
  initialUnread: i,
568
- anchor: d = null,
569
- openThread: c = null
568
+ anchor: m = null,
569
+ openThread: d = null
570
570
  }) {
571
571
  var hn, fn, xn, bn, gn, vn, yn, kn, wn, Nn;
572
- const h = Me(), f = ie(), u = Je(), p = h.me, g = Tr(n), U = p ? Ne(n, p.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = Ce({
573
- ...Ss(u, U),
572
+ const b = Me(), f = ce(), p = Je(), x = b.me, v = Tr(n), U = x ? Ce(n, x.id) : null, $ = !s.trim() || s.toLowerCase() === n.toLowerCase() || /^dm:/i.test(s), { data: C } = _e({
573
+ ...Ss(p, U),
574
574
  enabled: !!U && $,
575
575
  staleTime: 12e4
576
- }), S = $ && U ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : s, [W, M] = T(d);
577
- ae(() => M(d), [d]);
578
- const { messages: v, loading: B, hasOlder: R, hasNewer: G, loadOlder: H, loadingOlder: V } = Ks(
576
+ }), S = $ && U ? [C == null ? void 0 : C.first_name, C == null ? void 0 : C.last_name].filter(Boolean).join(" ") || (C == null ? void 0 : C.email) || "Direct message" : s, [E, R] = T(m);
577
+ ee(() => R(m), [m]);
578
+ const { messages: y, loading: q, hasOlder: A, hasNewer: F, loadOlder: z, loadingOlder: G } = Ks(
579
579
  n,
580
- W
580
+ E
581
581
  );
582
582
  Js(n);
583
- const se = ra(n), ee = Ys(), te = Zs(n), be = Vs(n.startsWith("dm:") ? n : null), de = Xs(n), A = er(n), w = tr(n), P = nr(n), x = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== h.globalRoom && n.includes(":"), q = sa(n, x), ve = gr(n, !!q), Se = n.startsWith("ch:"), { data: ue = [] } = Ce({
583
+ const te = ra(n), me = Ys(), ne = Zs(n), ae = Vs(n.startsWith("dm:") ? n : null), le = Xs(n), se = er(n), de = tr(n), c = nr(n), L = !n.startsWith("dm:") && !n.startsWith("ch:") && n !== b.globalRoom && n.includes(":"), u = sa(n, L), Z = gr(n, !!u), Se = n.startsWith("ch:"), { data: pe = [] } = _e({
584
584
  queryKey: ["chat-read-marks", n],
585
- queryFn: () => u.request(
586
- xe(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
585
+ queryFn: () => p.request(
586
+ ge(`/chat/rooms/${encodeURIComponent(n)}/read-marks`)
587
587
  ).then((t) => t.data ?? []).catch(() => []),
588
588
  enabled: Se,
589
589
  refetchInterval: Se ? 3e4 : !1,
590
590
  staleTime: 15e3
591
- }), Oe = (t) => ue.filter(
592
- (m) => m.user !== String(t.sender ?? "") && new Date(m.last_read_at).getTime() >= new Date(t.date_created).getTime()
593
- ), ye = Rt(), { data: ke = [] } = Ce({
591
+ }), Oe = (t) => pe.filter(
592
+ (h) => h.user !== String(t.sender ?? "") && new Date(h.last_read_at).getTime() >= new Date(t.date_created).getTime()
593
+ ), ke = At(), { data: Te = [] } = _e({
594
594
  queryKey: ["chat-saved"],
595
- queryFn: () => u.request(xe("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
595
+ queryFn: () => p.request(ge("/chat/saved")).then((t) => t.data ?? []).catch(() => []),
596
596
  staleTime: 6e4
597
- }), $e = fe(() => new Set(ke.map((t) => t.id)), [ke]), k = Ee({
598
- mutationFn: (t) => u.request(Be(`/chat/messages/${t}/save`, {})),
599
- onSuccess: () => void ye.invalidateQueries({ queryKey: ["chat-saved"] })
600
- }), [O, I] = T(null), X = Ee({
601
- mutationFn: () => u.request(
597
+ }), we = be(() => new Set(Te.map((t) => t.id)), [Te]), k = Ee({
598
+ mutationFn: (t) => p.request(Be(`/chat/messages/${t}/save`, {})),
599
+ onSuccess: () => void ke.invalidateQueries({ queryKey: ["chat-saved"] })
600
+ }), [M, P] = T(null), V = Ee({
601
+ mutationFn: () => p.request(
602
602
  Be("/chat/rooms/summary", { room: n })
603
603
  ).then((t) => t.data),
604
- onSuccess: (t) => I((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
605
- onError: () => I("Summary unavailable.")
606
- }), Te = Ee({
604
+ onSuccess: (t) => P((t == null ? void 0 : t.summary) ?? "Not enough new messages to summarize."),
605
+ onError: () => P("Summary unavailable.")
606
+ }), Ue = Ee({
607
607
  mutationFn: async (t) => {
608
- if (!q || !p) throw new Error("no record");
609
- await u.request(
608
+ if (!u || !x) throw new Error("no record");
609
+ await p.request(
610
610
  Be("/tasks", {
611
- collection: q.collection,
612
- item: String(q.id),
611
+ collection: u.collection,
612
+ item: String(u.id),
613
613
  title: t.message.replace(/<[^>]*>/g, "").slice(0, 200),
614
- assignee: p.id
614
+ assignee: x.id
615
615
  })
616
616
  );
617
617
  },
618
618
  onSuccess: () => {
619
- q && _s(ye, q.collection, q.id), he.success("Task created from message — assigned to you");
619
+ u && _s(ke, u.collection, u.id), xe.success("Task created from message — assigned to you");
620
620
  },
621
- onError: () => he.error("Could not create a task")
621
+ onError: () => xe.error("Could not create a task")
622
622
  }), _ = Ee({
623
- mutationFn: (t) => u.request(Be(`/chat/messages/${t.id}/to-notes`, {})),
624
- onSuccess: () => he.success(`Copied to the Notes of ${(q == null ? void 0 : q.label) ?? "the record"}`),
623
+ mutationFn: (t) => p.request(Be(`/chat/messages/${t.id}/to-notes`, {})),
624
+ onSuccess: () => xe.success(`Copied to the Notes of ${(u == null ? void 0 : u.label) ?? "the record"}`),
625
625
  onError: (t) => {
626
- var m;
627
- return he.error(((m = t == null ? void 0 : t.response) == null ? void 0 : m.error) ?? "Could not copy it");
626
+ var h;
627
+ return xe.error(((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not copy it");
628
628
  }
629
- }), j = Ee({
630
- mutationFn: (t) => u.request(
629
+ }), I = Ee({
630
+ mutationFn: (t) => p.request(
631
631
  Be(`/chat/messages/${t.messageId}/attach-to-record`, {
632
632
  file_id: t.fileId,
633
633
  field: t.field
634
634
  })
635
635
  ),
636
- onSuccess: (t, m) => {
636
+ onSuccess: (t, h) => {
637
637
  var N;
638
- return he.success(
639
- `Attached to ${(q == null ? void 0 : q.label) ?? "the record"} — ${((N = ve.find((Q) => Q.field === m.field)) == null ? void 0 : N.label) ?? m.field}`
638
+ return xe.success(
639
+ `Attached to ${(u == null ? void 0 : u.label) ?? "the record"} — ${((N = Z.find((H) => H.field === h.field)) == null ? void 0 : N.label) ?? h.field}`
640
640
  );
641
641
  },
642
642
  onError: (t) => {
643
- var m;
644
- return he.error(
645
- ((m = t == null ? void 0 : t.response) == null ? void 0 : m.error) ?? "Could not attach it"
643
+ var h;
644
+ return xe.error(
645
+ ((h = t == null ? void 0 : t.response) == null ? void 0 : h.error) ?? "Could not attach it"
646
646
  );
647
647
  }
648
- }), E = Ee({
649
- mutationFn: (t) => u.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
650
- onSuccess: () => void ye.invalidateQueries({ queryKey: ["nvr-chat", n] })
651
- }), ne = ar(n), K = sr(n), { isAdmin: F } = ut(), { setMuted: J, setNotifyMode: fa, setArchived: xa, setStarred: ba, dismissWelcome: ga, leave: va } = It(), { rooms: ya, loading: ka } = ea(), zt = ya.find((t) => t.room === n) ?? null, { rooms: wa } = ta(!ka && !zt), y = zt ?? wa.find((t) => t.room === n) ?? null, Na = ma(y), Ht = y != null && y.muted ? "muted" : (y == null ? void 0 : y.notify_mode) === "mentions" ? "mentions" : "all", ce = rr(), [Xe, Ca] = T(!1), [et, Gt] = T(""), [_a, mt] = T(null), [Qt, Kt] = T(""), [Sa, pt] = T(null), Ta = Ur(n), [Ua, Jt] = T(null), [Yt, Zt] = T(null), [Vt, Le] = T(null), Xt = lr(c ? n : null, c), en = !!Xt.root && !Xt.root.deleted_at;
652
- ae(() => {
653
- c && en && Le(c);
654
- }, [c, en]);
655
- const [Da, tn] = T(null), [$a, nn] = T(null), [ht, We] = T(!1), [Ra, ft] = T(!1), [le, Fe] = T(null), [ze, tt] = T(
656
- d && "around" in d ? d.around : null
657
- ), [nt, xt] = T(null), He = As(n, (p == null ? void 0 : p.id) ?? null), an = oe(null), bt = oe(null), gt = oe(Math.max(0, i ?? 0)), Ue = oe(!1), Re = oe(null), sn = oe(null), re = oe(!d), Ge = oe(0), Qe = oe(null), vt = oe(0), at = () => {
658
- const t = Re.current;
648
+ }), j = Ee({
649
+ mutationFn: (t) => p.request(ys(`/chat/messages/${t}`, { no_preview: !0 })),
650
+ onSuccess: () => void ke.invalidateQueries({ queryKey: ["nvr-chat", n] })
651
+ }), X = ar(n), Q = sr(n), { isAdmin: B } = ut(), { setMuted: K, setNotifyMode: fa, setArchived: xa, setStarred: ba, dismissWelcome: ga, leave: va } = It(), { rooms: ya, loading: ka } = ea(), zt = ya.find((t) => t.room === n) ?? null, { rooms: wa } = ta(!ka && !zt), w = zt ?? wa.find((t) => t.room === n) ?? null, Na = ma(w), Ht = w != null && w.muted ? "muted" : (w == null ? void 0 : w.notify_mode) === "mentions" ? "mentions" : "all", ue = rr(), [Xe, Ca] = T(!1), [et, Gt] = T(""), [_a, mt] = T(null), [Qt, Kt] = T(""), [Sa, pt] = T(null), Ta = Ur(n), [Ua, Jt] = T(null), [Yt, Zt] = T(null), [Vt, Le] = T(null), Xt = lr(d ? n : null, d), en = !!Xt.root && !Xt.root.deleted_at;
652
+ ee(() => {
653
+ d && en && Le(d);
654
+ }, [d, en]);
655
+ const [Da, tn] = T(null), [$a, nn] = T(null), [ht, We] = T(!1), [Aa, ft] = T(!1), [oe, Fe] = T(null), [ze, tt] = T(
656
+ m && "around" in m ? m.around : null
657
+ ), [nt, xt] = T(null), He = Rs(n, (x == null ? void 0 : x.id) ?? null), an = ie(null), bt = ie(null), gt = ie(Math.max(0, i ?? 0)), De = ie(!1), Ae = ie(null), sn = ie(null), re = ie(!m), Ge = ie(0), Qe = ie(null), vt = ie(0), at = () => {
658
+ const t = Ae.current;
659
659
  t && (t.scrollTop = t.scrollHeight);
660
660
  }, yt = (t) => {
661
661
  var N;
662
- const m = (N = Re.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
663
- return m ? (m.scrollIntoView({ block: "center" }), re.current = !1, tt(t), !0) : ge.reveal(t) ? (re.current = !1, tt(t), !0) : !1;
662
+ const h = (N = Ae.current) == null ? void 0 : N.querySelector(`[data-chat-msg="${t}"]`);
663
+ return h ? (h.scrollIntoView({ block: "center" }), re.current = !1, tt(t), !0) : ye.reveal(t) ? (re.current = !1, tt(t), !0) : !1;
664
664
  }, rn = (t) => {
665
- We(!1), yt(t) || (Ue.current = !1, re.current = !1, tt(t), M({ around: t }));
665
+ We(!1), yt(t) || (De.current = !1, re.current = !1, tt(t), R({ around: t }));
666
666
  };
667
- ae(() => {
667
+ ee(() => {
668
668
  if (ze == null) return;
669
669
  const t = setTimeout(() => tt(null), 2400);
670
670
  return () => clearTimeout(t);
671
- }, [ze]), ae(() => {
672
- Ue.current = !1, Ge.current = 0, Fe(null);
673
- }, [n, W]), ae(() => {
674
- var Ae, je;
675
- const t = Re.current, m = ((Ae = v[0]) == null ? void 0 : Ae.id) ?? null;
676
- if (!Ue.current && v.length > 0) {
677
- if (Ue.current = !0, Ge.current = v.length, Qe.current = m, ze != null && yt(ze)) return;
678
- bt.current && !W ? (bt.current.scrollIntoView({ block: "center" }), re.current = !1) : W || (at(), re.current = !0);
671
+ }, [ze]), ee(() => {
672
+ De.current = !1, Ge.current = 0, Fe(null);
673
+ }, [n, E]), ee(() => {
674
+ var Re, je;
675
+ const t = Ae.current, h = ((Re = y[0]) == null ? void 0 : Re.id) ?? null;
676
+ if (!De.current && y.length > 0) {
677
+ if (De.current = !0, Ge.current = y.length, Qe.current = h, ze != null && yt(ze)) return;
678
+ bt.current && !E ? (bt.current.scrollIntoView({ block: "center" }), re.current = !1) : E || (at(), re.current = !0);
679
679
  return;
680
680
  }
681
- if (m !== Qe.current && Qe.current != null && t) {
682
- Qe.current = m, Ge.current = v.length;
681
+ if (h !== Qe.current && Qe.current != null && t) {
682
+ Qe.current = h, Ge.current = y.length;
683
683
  return;
684
684
  }
685
- Qe.current = m;
686
- const N = v.length - Ge.current;
687
- if (Ge.current = v.length, N <= 0) return;
688
- const Q = v[v.length - 1], Y = !!(Q != null && Q.sender) && Q.sender.toLowerCase() === ((je = p == null ? void 0 : p.id) == null ? void 0 : je.toLowerCase());
689
- if (re.current || Y)
685
+ Qe.current = h;
686
+ const N = y.length - Ge.current;
687
+ if (Ge.current = y.length, N <= 0) return;
688
+ const H = y[y.length - 1], J = !!(H != null && H.sender) && H.sender.toLowerCase() === ((je = x == null ? void 0 : x.id) == null ? void 0 : je.toLowerCase());
689
+ if (re.current || J)
690
690
  at(), re.current = !0, Fe(null);
691
691
  else {
692
- const De = v[v.length - N];
693
- Fe((pe) => ({ count: ((pe == null ? void 0 : pe.count) ?? 0) + N, firstId: (pe == null ? void 0 : pe.firstId) ?? De.id }));
692
+ const $e = y[y.length - N];
693
+ Fe((fe) => ({ count: ((fe == null ? void 0 : fe.count) ?? 0) + N, firstId: (fe == null ? void 0 : fe.firstId) ?? $e.id }));
694
694
  }
695
- }, [v]), ae(() => {
695
+ }, [y]), ee(() => {
696
696
  const t = sn.current;
697
697
  if (!t || typeof ResizeObserver > "u") return;
698
- const m = new ResizeObserver(() => {
698
+ const h = new ResizeObserver(() => {
699
699
  var N;
700
- re.current && at(), vt.current = ((N = Re.current) == null ? void 0 : N.scrollHeight) ?? 0;
700
+ re.current && at(), vt.current = ((N = Ae.current) == null ? void 0 : N.scrollHeight) ?? 0;
701
701
  });
702
- return m.observe(t), () => m.disconnect();
703
- }, []), ae(() => {
704
- var N, Q;
705
- const t = v[v.length - 1];
706
- if (!t || !Ue.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((Q = p == null ? void 0 : p.id) == null ? void 0 : Q.toLowerCase()))
702
+ return h.observe(t), () => h.disconnect();
703
+ }, []), ee(() => {
704
+ var N, H;
705
+ const t = y[y.length - 1];
706
+ if (!t || !De.current || ((N = t.sender) == null ? void 0 : N.toLowerCase()) === ((H = x == null ? void 0 : x.id) == null ? void 0 : H.toLowerCase()))
707
707
  return;
708
- const m = Date.now() - new Date(t.date_created).getTime();
709
- m > 0 && m < 5 * 6e4 && Math.random() < 0.2 && u.request(Be("/chat/health/delivery", { ms: m })).catch(() => {
708
+ const h = Date.now() - new Date(t.date_created).getTime();
709
+ h > 0 && h < 5 * 6e4 && Math.random() < 0.2 && p.request(Be("/chat/health/delivery", { ms: h })).catch(() => {
710
710
  });
711
- }, [(hn = v[v.length - 1]) == null ? void 0 : hn.id]), ae(() => {
712
- if (!nt || !ce) return;
713
- if (v.some(
714
- (N) => (N.sender_name ?? "").toLowerCase() === ce.toLowerCase() && new Date(N.date_created).getTime() >= nt - 5e3
711
+ }, [(hn = y[y.length - 1]) == null ? void 0 : hn.id]), ee(() => {
712
+ if (!nt || !ue) return;
713
+ if (y.some(
714
+ (N) => (N.sender_name ?? "").toLowerCase() === ue.toLowerCase() && new Date(N.date_created).getTime() >= nt - 5e3
715
715
  )) {
716
716
  xt(null);
717
717
  return;
718
718
  }
719
- const m = setTimeout(() => xt(null), 9e4);
720
- return () => clearTimeout(m);
721
- }, [nt, ce, v]);
722
- const st = fe(() => {
719
+ const h = setTimeout(() => xt(null), 9e4);
720
+ return () => clearTimeout(h);
721
+ }, [nt, ue, y]);
722
+ const st = be(() => {
723
723
  const t = /* @__PURE__ */ new Set();
724
- for (const m of v) for (const N of m.attachments ?? []) t.add(N);
724
+ for (const h of y) for (const N of h.attachments ?? []) t.add(N);
725
725
  return [...t];
726
- }, [v]), { data: kt } = Ce({
726
+ }, [y]), { data: kt } = _e({
727
727
  queryKey: ["nvr-chat-attachments", st.slice().sort().join("|")],
728
728
  queryFn: async () => {
729
- const t = await u.request(
730
- xe("/files", {
729
+ const t = await p.request(
730
+ ge("/files", {
731
731
  filter: JSON.stringify({ id: { _in: st } }),
732
732
  limit: String(st.length),
733
733
  fields: "id,filename_download,title,type,filesize,tags"
734
734
  })
735
735
  );
736
- return new Map((t.data ?? []).map((m) => [m.id, m]));
736
+ return new Map((t.data ?? []).map((h) => [h.id, h]));
737
737
  },
738
738
  enabled: st.length > 0,
739
739
  staleTime: 5 * 6e4
740
740
  });
741
- ae(() => {
742
- W || ee.mutate(n);
743
- }, [n, v.length, W]);
744
- const Aa = (t) => {
745
- if (re.current = !0, W && M(null), ce) {
746
- const m = ce.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
747
- new RegExp(`@\\[?${m}\\]?\\b`, "i").test(t) && xt(Date.now());
741
+ ee(() => {
742
+ E || me.mutate(n);
743
+ }, [n, y.length, E]);
744
+ const Ra = (t) => {
745
+ if (re.current = !0, E && R(null), ue) {
746
+ const h = ue.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
747
+ new RegExp(`@\\[?${h}\\]?\\b`, "i").test(t) && xt(Date.now());
748
748
  }
749
- }, Pe = (fn = p == null ? void 0 : p.id) == null ? void 0 : fn.toLowerCase(), me = Xe && et.trim().length > 0, we = fe(
750
- () => me ? v.filter((t) => t.message.toLowerCase().includes(et.trim().toLowerCase())) : v,
751
- [v, me, et]
752
- ), Ma = fe(() => {
749
+ }, Pe = (fn = x == null ? void 0 : x.id) == null ? void 0 : fn.toLowerCase(), he = Xe && et.trim().length > 0, Ne = be(
750
+ () => he ? y.filter((t) => t.message.toLowerCase().includes(et.trim().toLowerCase())) : y,
751
+ [y, he, et]
752
+ ), Ma = be(() => {
753
753
  var t;
754
- if (me) return -1;
755
- for (let m = we.length - 1; m >= 0; m--)
756
- if (((t = we[m].sender) == null ? void 0 : t.toLowerCase()) === Pe) return m;
754
+ if (he) return -1;
755
+ for (let h = Ne.length - 1; h >= 0; h--)
756
+ if (((t = Ne[h].sender) == null ? void 0 : t.toLowerCase()) === Pe) return h;
757
757
  return -1;
758
- }, [we, Pe, me]), ln = be ? new Date(be).getTime() : 0, Ie = Pt().chat_density === "compact" ? "compact" : "comfortable", on = oe(null), Oa = fe(() => we.map((t) => t.id), [we]), ge = yr({
759
- scrollerRef: Re,
758
+ }, [Ne, Pe, he]), ln = ae ? new Date(ae).getTime() : 0, Ie = Pt().chat_density === "compact" ? "compact" : "comfortable", on = ie(null), Oa = be(() => Ne.map((t) => t.id), [Ne]), ye = yr({
759
+ scrollerRef: Ae,
760
760
  listRef: on,
761
761
  ids: Oa,
762
762
  estimate: Ie === "compact" ? 40 : 72,
763
- resetKey: `${n}|${JSON.stringify(W)}|${me ? "search" : ""}`,
763
+ resetKey: `${n}|${JSON.stringify(E)}|${he ? "search" : ""}`,
764
764
  pinnedRef: re
765
- }), z = (y == null ? void 0 : y.channel) ?? null, cn = !!z && !!p && String(z.created_by ?? "").toUpperCase() === p.id.toUpperCase(), dn = z != null && z.announce && !cn && !F ? z.id === Xn ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, un = p ? Ne(n, p.id) : null, La = Wt(un);
765
+ }), W = (w == null ? void 0 : w.channel) ?? null, cn = !!W && !!x && String(W.created_by ?? "").toUpperCase() === x.id.toUpperCase(), dn = W != null && W.announce && !cn && !B ? W.id === Xn ? "Only admins post here. Hover a message and reply in its thread." : "Only the channel owner and admins post here. Hover a message and reply in its thread." : null, un = x ? Ce(n, x.id) : null, La = Wt(un);
766
766
  ua();
767
767
  const Pa = un ? vr(La, S, /* @__PURE__ */ new Date()) : null;
768
768
  or(), fr();
769
- const Ia = !!(z != null && z.welcome_note) && !!(y != null && y.joined) && !(y != null && y.welcome_seen_at) && !z.is_direct, ja = (t, m) => t.entity ? /* @__PURE__ */ e(In, { token: t.text, url: h.entityUrl(t.entity) }, m) : t.mention ? /* @__PURE__ */ e("span", { className: b("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), qa = (t, m) => t.entity ? /* @__PURE__ */ e(In, { token: t.text, url: h.entityUrl(t.entity), mine: !0 }, m) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, m) : /* @__PURE__ */ e("span", { children: t.text }, m), mn = (t, m = {}) => {
769
+ const Ia = !!(W != null && W.welcome_note) && !!(w != null && w.joined) && !(w != null && w.welcome_seen_at) && !W.is_direct, ja = (t, h) => t.entity ? /* @__PURE__ */ e(In, { token: t.text, url: b.entityUrl(t.entity) }, h) : t.mention ? /* @__PURE__ */ e("span", { className: g("rounded px-0.5 font-semibold", f.accentSoft), children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), qa = (t, h) => t.entity ? /* @__PURE__ */ e(In, { token: t.text, url: b.entityUrl(t.entity), mine: !0 }, h) : t.mention ? /* @__PURE__ */ e("span", { className: "rounded bg-black/15 px-0.5 font-semibold", children: t.text }, h) : /* @__PURE__ */ e("span", { children: t.text }, h), mn = (t, h = {}) => {
770
770
  var Cn, _n;
771
771
  const N = ((Cn = t.sender) == null ? void 0 : Cn.toLowerCase()) === Pe;
772
772
  if (t.is_system)
@@ -785,16 +785,16 @@ function jn({
785
785
  ] })
786
786
  }
787
787
  );
788
- const Q = m.isLastMine && ln > 0 && new Date(t.date_created).getTime() <= ln, Y = !!t.deleted_at, Ae = N && !Y && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, je = !Y && (N || F), De = _a === t.id, pe = /* @__PURE__ */ new Map();
788
+ const H = h.isLastMine && ln > 0 && new Date(t.date_created).getTime() <= ln, J = !!t.deleted_at, Re = N && !J && Date.now() - new Date(t.date_created).getTime() < 15 * 6e4, je = !J && (N || B), $e = _a === t.id, fe = /* @__PURE__ */ new Map();
789
789
  for (const D of t.reactions ?? []) {
790
- const L = pe.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
791
- L.count++, ((_n = D.user) == null ? void 0 : _n.toLowerCase()) === Pe && (L.mine = !0), D.user_name && L.names.push(D.user_name), pe.set(D.emoji, L);
790
+ const O = fe.get(D.emoji) ?? { count: 0, mine: !1, names: [] };
791
+ O.count++, ((_n = D.user) == null ? void 0 : _n.toLowerCase()) === Pe && (O.mine = !0), D.user_name && O.names.push(D.user_name), fe.set(D.emoji, O);
792
792
  }
793
793
  const qe = "rounded-full p-0.5 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200";
794
794
  return /* @__PURE__ */ a(
795
795
  "div",
796
796
  {
797
- className: b(
797
+ className: g(
798
798
  "group/msg flex gap-2 rounded-lg transition-colors",
799
799
  N && "flex-row-reverse",
800
800
  ze === t.id && "bg-nvr-cyan/[0.12]"
@@ -808,11 +808,11 @@ function jn({
808
808
  className: "h-fit shrink-0 rounded-full",
809
809
  "aria-label": `${t.sender_name ?? "Sender"} — profile`,
810
810
  "data-chat-avatar-card": !0,
811
- children: /* @__PURE__ */ e(Z, { id: t.sender, name: t.sender_name, size: Ie === "compact" ? 22 : 26 })
811
+ children: /* @__PURE__ */ e(Y, { id: t.sender, name: t.sender_name, size: Ie === "compact" ? 22 : 26 })
812
812
  }
813
813
  ) }),
814
- /* @__PURE__ */ a("div", { className: b("relative max-w-[78%]", N && "text-right"), children: [
815
- !N && m.showSender !== !1 && /* @__PURE__ */ a("p", { className: "mb-0.5 text-[10.5px] font-medium text-slate-500 dark:text-slate-400", children: [
814
+ /* @__PURE__ */ a("div", { className: g("relative max-w-[78%]", N && "text-right"), children: [
815
+ !N && h.showSender !== !1 && /* @__PURE__ */ a("p", { className: "mb-0.5 text-[10.5px] font-medium text-slate-500 dark:text-slate-400", children: [
816
816
  t.sender_name ?? "Unknown",
817
817
  t.masquerade_admin_name && /* @__PURE__ */ a(
818
818
  "span",
@@ -827,10 +827,10 @@ function jn({
827
827
  }
828
828
  )
829
829
  ] }),
830
- !Y && !De && /* @__PURE__ */ a(
830
+ !J && !$e && /* @__PURE__ */ a(
831
831
  "div",
832
832
  {
833
- className: b(
833
+ className: g(
834
834
  "absolute -top-3 z-10 hidden items-center gap-0.5 rounded-full border px-1 py-0.5 shadow-sm group-hover/msg:flex",
835
835
  Ua === t.id && "flex",
836
836
  f.surface,
@@ -843,7 +843,7 @@ function jn({
843
843
  "button",
844
844
  {
845
845
  type: "button",
846
- onClick: () => A.mutate({ messageId: t.id, emoji: D }),
846
+ onClick: () => se.mutate({ messageId: t.id, emoji: D }),
847
847
  className: "rounded-full px-0.5 text-[13px] leading-none transition-transform hover:scale-125",
848
848
  title: `React ${D}`,
849
849
  children: D
@@ -855,11 +855,11 @@ function jn({
855
855
  {
856
856
  label: "More reactions",
857
857
  className: qe,
858
- onPick: (D) => A.mutate({ messageId: t.id, emoji: D }),
858
+ onPick: (D) => se.mutate({ messageId: t.id, emoji: D }),
859
859
  onOpenChange: (D) => Jt(D ? t.id : null)
860
860
  }
861
861
  ),
862
- !m.inThread && !t.parent_id && /* @__PURE__ */ e(
862
+ !h.inThread && !t.parent_id && /* @__PURE__ */ e(
863
863
  "button",
864
864
  {
865
865
  type: "button",
@@ -877,19 +877,19 @@ function jn({
877
877
  {
878
878
  type: "button",
879
879
  title: "Quote",
880
- onClick: () => m.inThread ? nn(t) : tn(t),
880
+ onClick: () => h.inThread ? nn(t) : tn(t),
881
881
  className: qe,
882
882
  "data-chat-quote": !0,
883
883
  children: /* @__PURE__ */ e(ls, { className: "h-3 w-3" })
884
884
  }
885
885
  ),
886
- q && /* @__PURE__ */ a(_e, { children: [
886
+ u && /* @__PURE__ */ a(ve, { children: [
887
887
  /* @__PURE__ */ e(
888
888
  "button",
889
889
  {
890
890
  type: "button",
891
891
  title: "Make a task from this message",
892
- onClick: () => Te.mutate(t),
892
+ onClick: () => Ue.mutate(t),
893
893
  className: qe,
894
894
  children: /* @__PURE__ */ e(os, { className: "h-3 w-3" })
895
895
  }
@@ -898,7 +898,7 @@ function jn({
898
898
  "button",
899
899
  {
900
900
  type: "button",
901
- title: `Copy into the Notes of ${q.label}`,
901
+ title: `Copy into the Notes of ${u.label}`,
902
902
  onClick: () => _.mutate(t),
903
903
  className: qe,
904
904
  "data-chat-to-notes": !0,
@@ -910,11 +910,11 @@ function jn({
910
910
  "button",
911
911
  {
912
912
  type: "button",
913
- title: w.some((D) => D.id === t.id) ? "Unpin" : "Pin",
914
- onClick: () => P.mutate(t.id),
915
- className: b(
913
+ title: de.some((D) => D.id === t.id) ? "Unpin" : "Pin",
914
+ onClick: () => c.mutate(t.id),
915
+ className: g(
916
916
  "rounded-full p-0.5",
917
- w.some((D) => D.id === t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
917
+ de.some((D) => D.id === t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
918
918
  ),
919
919
  children: /* @__PURE__ */ e(St, { className: "h-3 w-3" })
920
920
  }
@@ -923,16 +923,16 @@ function jn({
923
923
  "button",
924
924
  {
925
925
  type: "button",
926
- title: $e.has(t.id) ? "Remove from saved" : "Save for later (personal bookmark)",
926
+ title: we.has(t.id) ? "Remove from saved" : "Save for later (personal bookmark)",
927
927
  onClick: () => k.mutate(t.id),
928
- className: b(
928
+ className: g(
929
929
  "rounded-full p-0.5",
930
- $e.has(t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
930
+ we.has(t.id) ? f.accentText : "text-slate-400 hover:text-slate-600 dark:hover:text-slate-200"
931
931
  ),
932
932
  children: /* @__PURE__ */ e(cs, { className: "h-3 w-3" })
933
933
  }
934
934
  ),
935
- Ae && /* @__PURE__ */ e(
935
+ Re && /* @__PURE__ */ e(
936
936
  "button",
937
937
  {
938
938
  type: "button",
@@ -950,7 +950,7 @@ function jn({
950
950
  type: "button",
951
951
  title: "Confirm delete",
952
952
  onClick: () => {
953
- K.mutate(t.id), pt(null);
953
+ Q.mutate(t.id), pt(null);
954
954
  },
955
955
  className: "rounded-full px-1 text-[10px] font-semibold text-red-500",
956
956
  children: "Sure?"
@@ -970,17 +970,17 @@ function jn({
970
970
  {
971
971
  messageId: t.id,
972
972
  actions: $r(Ta, t, Pe),
973
- navigate: h.navigate,
973
+ navigate: b.navigate,
974
974
  onOpenChange: (D) => Jt(D ? t.id : null)
975
975
  }
976
976
  )
977
977
  ]
978
978
  }
979
979
  ),
980
- t.urgent && !Y && /* @__PURE__ */ a(
980
+ t.urgent && !J && /* @__PURE__ */ a(
981
981
  "p",
982
982
  {
983
- className: b(
983
+ className: g(
984
984
  "mb-0.5 flex items-center gap-1 text-[10.5px] font-semibold text-red-600 dark:text-red-400",
985
985
  N && "justify-end"
986
986
  ),
@@ -991,14 +991,14 @@ function jn({
991
991
  ]
992
992
  }
993
993
  ),
994
- Y ? /* @__PURE__ */ e("div", { className: "inline-block rounded-2xl border border-dashed border-slate-200 px-3 py-1.5 text-left text-[11.5px] italic text-slate-500 dark:border-border", children: "Message removed" }) : De ? /* @__PURE__ */ a(
994
+ J ? /* @__PURE__ */ e("div", { className: "inline-block rounded-2xl border border-dashed border-slate-200 px-3 py-1.5 text-left text-[11.5px] italic text-slate-500 dark:border-border", children: "Message removed" }) : $e ? /* @__PURE__ */ a(
995
995
  "form",
996
996
  {
997
997
  className: "flex items-center gap-1",
998
998
  onSubmit: (D) => {
999
999
  D.preventDefault();
1000
- const L = Qt.trim();
1001
- L && L !== t.message && ne.mutate({ messageId: t.id, text: L }), mt(null);
1000
+ const O = Qt.trim();
1001
+ O && O !== t.message && X.mutate({ messageId: t.id, text: O }), mt(null);
1002
1002
  },
1003
1003
  children: [
1004
1004
  /* @__PURE__ */ e(
@@ -1010,7 +1010,7 @@ function jn({
1010
1010
  onKeyDown: (D) => {
1011
1011
  D.key === "Escape" && mt(null);
1012
1012
  },
1013
- className: b(
1013
+ className: g(
1014
1014
  "h-8 w-[240px] rounded-lg border px-2 text-[12px] outline-none",
1015
1015
  f.input
1016
1016
  ),
@@ -1021,7 +1021,7 @@ function jn({
1021
1021
  "button",
1022
1022
  {
1023
1023
  type: "submit",
1024
- className: b("rounded-md px-1.5 py-1 text-[11px] font-medium", f.accentText),
1024
+ className: g("rounded-md px-1.5 py-1 text-[11px] font-medium", f.accentText),
1025
1025
  children: "Save"
1026
1026
  }
1027
1027
  )
@@ -1030,10 +1030,10 @@ function jn({
1030
1030
  ) : /* @__PURE__ */ a(
1031
1031
  "div",
1032
1032
  {
1033
- className: b(
1033
+ className: g(
1034
1034
  "inline-block max-w-full rounded-2xl text-left leading-snug",
1035
1035
  Ie === "compact" ? "px-2.5 py-1 text-[12px]" : "px-3 py-1.5 text-[12.5px]",
1036
- N ? b("rounded-br-md", f.bubbleMine) : b("rounded-bl-md", f.bubbleOther),
1036
+ N ? g("rounded-br-md", f.bubbleMine) : g("rounded-bl-md", f.bubbleOther),
1037
1037
  t.urgent && "ring-2 ring-red-400/70"
1038
1038
  ),
1039
1039
  children: [
@@ -1042,7 +1042,7 @@ function jn({
1042
1042
  {
1043
1043
  type: "button",
1044
1044
  onClick: () => rn(t.quote.id),
1045
- className: b(
1045
+ className: g(
1046
1046
  "mb-1 block w-full rounded-md border-l-2 px-2 py-1 text-left text-[11px]",
1047
1047
  N ? "border-white/60 bg-black/10" : "border-slate-400 bg-white/70 dark:border-slate-500 dark:bg-black/20"
1048
1048
  ),
@@ -1053,15 +1053,15 @@ function jn({
1053
1053
  ]
1054
1054
  }
1055
1055
  ),
1056
- t.message && An(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
1057
- Rr,
1056
+ t.message && Rn(t.message) && (o ? o(t, { mine: N }) : /* @__PURE__ */ e(
1057
+ Ar,
1058
1058
  {
1059
- text: An(t.message),
1059
+ text: Rn(t.message),
1060
1060
  mine: N,
1061
1061
  renderToken: N ? qa : ja,
1062
- entityPattern: h.entityPattern,
1062
+ entityPattern: b.entityPattern,
1063
1063
  timeRefs: t.time_refs,
1064
- navigate: h.navigate
1064
+ navigate: b.navigate
1065
1065
  }
1066
1066
  )),
1067
1067
  Mn(t.message) != null && /* @__PURE__ */ e(
@@ -1069,30 +1069,30 @@ function jn({
1069
1069
  {
1070
1070
  id: Mn(t.message),
1071
1071
  mine: N,
1072
- renderAvatar: (D, L) => /* @__PURE__ */ e(Z, { id: D, name: L, size: 18, presence: !1 })
1072
+ renderAvatar: (D, O) => /* @__PURE__ */ e(Y, { id: D, name: O, size: 18, presence: !1 })
1073
1073
  }
1074
1074
  ),
1075
1075
  t.poll && /* @__PURE__ */ e(Mr, { poll: t.poll, room: t.room, mine: N }),
1076
- (t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: b("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((D) => {
1077
- const L = kt == null ? void 0 : kt.get(D), rt = (L == null ? void 0 : L.title) || (L == null ? void 0 : L.filename_download) || "Attachment", wt = u.fileUrl(D), Ea = ((L == null ? void 0 : L.type) ?? "").startsWith("image/"), lt = Br(L == null ? void 0 : L.tags, L == null ? void 0 : L.type), Sn = () => Zt({
1076
+ (t.attachments ?? []).length > 0 && /* @__PURE__ */ e("div", { className: g("flex flex-wrap gap-1.5", t.message && "mt-1.5"), children: (t.attachments ?? []).map((D) => {
1077
+ const O = kt == null ? void 0 : kt.get(D), rt = (O == null ? void 0 : O.title) || (O == null ? void 0 : O.filename_download) || "Attachment", wt = p.fileUrl(D), Ea = ((O == null ? void 0 : O.type) ?? "").startsWith("image/"), lt = Br(O == null ? void 0 : O.tags, O == null ? void 0 : O.type), Sn = () => Zt({
1078
1078
  id: D,
1079
1079
  url: wt,
1080
1080
  name: rt,
1081
- type: (L == null ? void 0 : L.type) ?? null,
1082
- size: (L == null ? void 0 : L.filesize) ?? null
1083
- }), ot = q && ve.length > 0 ? /* @__PURE__ */ e(
1081
+ type: (O == null ? void 0 : O.type) ?? null,
1082
+ size: (O == null ? void 0 : O.filesize) ?? null
1083
+ }), ot = u && Z.length > 0 ? /* @__PURE__ */ e(
1084
1084
  Vr,
1085
1085
  {
1086
- targets: ve,
1087
- recordLabel: q.label,
1088
- onPick: (Ba) => j.mutate({ messageId: t.id, fileId: D, field: Ba })
1086
+ targets: Z,
1087
+ recordLabel: u.label,
1088
+ onPick: (Ba) => I.mutate({ messageId: t.id, fileId: D, field: Ba })
1089
1089
  }
1090
1090
  ) : null;
1091
1091
  return lt ? /* @__PURE__ */ e(
1092
1092
  Wr,
1093
1093
  {
1094
1094
  url: wt,
1095
- poster: lt.poster ? u.fileUrl(lt.poster) : null,
1095
+ poster: lt.poster ? p.fileUrl(lt.poster) : null,
1096
1096
  name: rt,
1097
1097
  durationMs: lt.durationMs,
1098
1098
  action: ot
@@ -1123,7 +1123,7 @@ function jn({
1123
1123
  {
1124
1124
  type: "button",
1125
1125
  onClick: Sn,
1126
- className: b(
1126
+ className: g(
1127
1127
  "inline-flex max-w-[220px] items-center gap-1.5 rounded-lg border px-2 py-1 text-[11.5px]",
1128
1128
  N ? "border-white/30 bg-white/10" : "border-slate-200 bg-white dark:border-border dark:bg-card"
1129
1129
  ),
@@ -1139,51 +1139,51 @@ function jn({
1139
1139
  ]
1140
1140
  }
1141
1141
  ),
1142
- !Y && !De && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: b(N && "flex justify-end"), children: /* @__PURE__ */ e(
1143
- Ar,
1142
+ !J && !$e && t.message && !t.no_preview && /* @__PURE__ */ e("div", { className: g(N && "flex justify-end"), children: /* @__PURE__ */ e(
1143
+ Rr,
1144
1144
  {
1145
1145
  text: t.message,
1146
- navigate: h.navigate,
1147
- onDismiss: N ? () => E.mutate(t.id) : void 0
1146
+ navigate: b.navigate,
1147
+ onDismiss: N ? () => j.mutate(t.id) : void 0
1148
1148
  }
1149
1149
  ) }),
1150
- pe.size > 0 && /* @__PURE__ */ e(
1150
+ fe.size > 0 && /* @__PURE__ */ e(
1151
1151
  "div",
1152
1152
  {
1153
- className: b("mt-0.5 flex flex-wrap gap-1", N && "justify-end"),
1153
+ className: g("mt-0.5 flex flex-wrap gap-1", N && "justify-end"),
1154
1154
  "data-chat-reactions": !0,
1155
- children: [...pe.entries()].map(([D, L]) => /* @__PURE__ */ a(
1155
+ children: [...fe.entries()].map(([D, O]) => /* @__PURE__ */ a(
1156
1156
  "button",
1157
1157
  {
1158
1158
  type: "button",
1159
- title: L.names.join(", "),
1160
- onClick: () => A.mutate({ messageId: t.id, emoji: D }),
1161
- className: b(
1159
+ title: O.names.join(", "),
1160
+ onClick: () => se.mutate({ messageId: t.id, emoji: D }),
1161
+ className: g(
1162
1162
  "inline-flex items-center gap-0.5 rounded-full border px-1.5 py-px text-[10.5px] leading-tight transition-colors",
1163
- L.mine ? b("font-semibold", f.accentSoft, "border-transparent") : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300 dark:hover:bg-muted"
1163
+ O.mine ? g("font-semibold", f.accentSoft, "border-transparent") : "border-slate-200 bg-white text-slate-600 hover:bg-slate-50 dark:border-border dark:bg-card dark:text-slate-300 dark:hover:bg-muted"
1164
1164
  ),
1165
1165
  children: [
1166
1166
  /* @__PURE__ */ e(br, { value: D }),
1167
- /* @__PURE__ */ e("span", { className: "tabular-nums", children: L.count })
1167
+ /* @__PURE__ */ e("span", { className: "tabular-nums", children: O.count })
1168
1168
  ]
1169
1169
  },
1170
1170
  D
1171
1171
  ))
1172
1172
  }
1173
1173
  ),
1174
- !m.inThread && t.thread && t.thread.count > 0 && /* @__PURE__ */ a(
1174
+ !h.inThread && t.thread && t.thread.count > 0 && /* @__PURE__ */ a(
1175
1175
  "button",
1176
1176
  {
1177
1177
  type: "button",
1178
1178
  onClick: () => Le(t.id),
1179
- className: b(
1179
+ className: g(
1180
1180
  "mt-1 flex items-center gap-1.5 rounded-md px-1 py-0.5 text-[11px] font-medium hover:bg-slate-100 dark:hover:bg-muted",
1181
1181
  f.accentText,
1182
1182
  N && "ml-auto"
1183
1183
  ),
1184
1184
  "data-chat-thread-summary": t.thread.count,
1185
1185
  children: [
1186
- /* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((D) => /* @__PURE__ */ e(Z, { id: D.id, name: D.name, size: 16, presence: !1 }, D.id)) }),
1186
+ /* @__PURE__ */ e("span", { className: "flex -space-x-1.5", children: t.thread.people.slice(0, 3).map((D) => /* @__PURE__ */ e(Y, { id: D.id, name: D.name, size: 16, presence: !1 }, D.id)) }),
1187
1187
  t.thread.count,
1188
1188
  " ",
1189
1189
  t.thread.count === 1 ? "reply" : "replies",
@@ -1211,28 +1211,28 @@ function jn({
1211
1211
  ]
1212
1212
  }
1213
1213
  ),
1214
- t.edited_at && !Y && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
1214
+ t.edited_at && !J && /* @__PURE__ */ e("span", { className: "italic", children: "(edited)" }),
1215
1215
  new Date(t.date_created).toLocaleTimeString("en-US", {
1216
1216
  hour: "numeric",
1217
1217
  minute: "2-digit"
1218
1218
  }),
1219
- N && Se && !Y && (() => {
1220
- var L;
1219
+ N && Se && !J && (() => {
1220
+ var O;
1221
1221
  const D = Oe(t);
1222
1222
  return D.length === 0 ? null : /* @__PURE__ */ e(
1223
1223
  tl,
1224
1224
  {
1225
1225
  seen: D,
1226
- channelId: ((L = y == null ? void 0 : y.channel) == null ? void 0 : L.id) ?? null,
1226
+ channelId: ((O = w == null ? void 0 : w.channel) == null ? void 0 : O.id) ?? null,
1227
1227
  senderId: String(t.sender ?? "")
1228
1228
  }
1229
1229
  );
1230
1230
  })(),
1231
- m.isLastMine && n.startsWith("dm:") && (Q ? /* @__PURE__ */ a("span", { className: b("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
1231
+ h.isLastMine && n.startsWith("dm:") && (H ? /* @__PURE__ */ a("span", { className: g("inline-flex items-center gap-0.5 font-medium", f.accentText), children: [
1232
1232
  /* @__PURE__ */ e(fs, { className: "h-3 w-3", strokeWidth: 2.4 }),
1233
1233
  " Read"
1234
1234
  ] }) : /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-0.5", children: [
1235
- /* @__PURE__ */ e(At, { className: "h-3 w-3", strokeWidth: 2.2 }),
1235
+ /* @__PURE__ */ e(Rt, { className: "h-3 w-3", strokeWidth: 2.2 }),
1236
1236
  " Sent"
1237
1237
  ] }))
1238
1238
  ] })
@@ -1249,11 +1249,11 @@ function jn({
1249
1249
  parentId: t,
1250
1250
  quote: t ? $a : Da,
1251
1251
  onClearQuote: () => t ? nn(null) : tn(null),
1252
- onSent: Aa,
1252
+ onSent: Ra,
1253
1253
  disabledReason: t ? null : dn,
1254
1254
  quietNote: Pa,
1255
1255
  th: f,
1256
- renderAvatar: (m, N) => /* @__PURE__ */ e(Z, { id: m, name: N, size: 22, presence: m !== "__bot__" })
1256
+ renderAvatar: (h, N) => /* @__PURE__ */ e(Y, { id: h, name: N, size: 22, presence: h !== "__bot__" })
1257
1257
  }
1258
1258
  );
1259
1259
  return /* @__PURE__ */ a(
@@ -1268,11 +1268,11 @@ function jn({
1268
1268
  t.currentTarget.contains(t.relatedTarget) || ft(!1);
1269
1269
  },
1270
1270
  onDrop: (t) => {
1271
- var m;
1272
- t.dataTransfer.files.length && (t.preventDefault(), ft(!1), (m = an.current) == null || m.addFiles([...t.dataTransfer.files]));
1271
+ var h;
1272
+ t.dataTransfer.files.length && (t.preventDefault(), ft(!1), (h = an.current) == null || h.addFiles([...t.dataTransfer.files]));
1273
1273
  },
1274
1274
  children: [
1275
- Ra && /* @__PURE__ */ e(
1275
+ Aa && /* @__PURE__ */ e(
1276
1276
  "div",
1277
1277
  {
1278
1278
  className: "pointer-events-none absolute inset-2 z-30 flex items-center justify-center rounded-xl border-2 border-dashed border-nvr-cyan bg-white/85 text-[13px] font-semibold text-slate-700 dark:bg-card/90 dark:text-slate-100",
@@ -1280,7 +1280,7 @@ function jn({
1280
1280
  children: "Drop to attach to your message"
1281
1281
  }
1282
1282
  ),
1283
- /* @__PURE__ */ a("div", { className: b("flex shrink-0 items-center gap-1.5 border-b px-3 py-2", f.divider), children: [
1283
+ /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-1.5 border-b px-3 py-2", f.divider), children: [
1284
1284
  /* @__PURE__ */ e(
1285
1285
  "button",
1286
1286
  {
@@ -1291,13 +1291,13 @@ function jn({
1291
1291
  children: /* @__PURE__ */ e(ct, { className: "h-4 w-4", strokeWidth: 2 })
1292
1292
  }
1293
1293
  ),
1294
- ((y == null ? void 0 : y.kind) === "channel" && !((xn = y.channel) != null && xn.is_direct) || (y == null ? void 0 : y.kind) === "global" && (((bn = y.channel) == null ? void 0 : bn.icon) || ((gn = y.channel) == null ? void 0 : gn.color))) && /* @__PURE__ */ e(Ke, { icon: (vn = y == null ? void 0 : y.channel) == null ? void 0 : vn.icon, color: (yn = y == null ? void 0 : y.channel) == null ? void 0 : yn.color, size: 24 }),
1295
- p && Ne(n, p.id) && /* @__PURE__ */ e(Hr, { peerId: Ne(n, p.id), name: S }),
1294
+ ((w == null ? void 0 : w.kind) === "channel" && !((xn = w.channel) != null && xn.is_direct) || (w == null ? void 0 : w.kind) === "global" && (((bn = w.channel) == null ? void 0 : bn.icon) || ((gn = w.channel) == null ? void 0 : gn.color))) && /* @__PURE__ */ e(Ke, { icon: (vn = w == null ? void 0 : w.channel) == null ? void 0 : vn.icon, color: (yn = w == null ? void 0 : w.channel) == null ? void 0 : yn.color, size: 24 }),
1295
+ x && Ce(n, x.id) && /* @__PURE__ */ e(Hr, { peerId: Ce(n, x.id), name: S }),
1296
1296
  /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
1297
1297
  /* @__PURE__ */ a("p", { className: "flex items-center gap-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
1298
1298
  /* @__PURE__ */ e("span", { className: "truncate", children: S }),
1299
- y && /* @__PURE__ */ e(Or, { starred: !!y.starred, notify: Ht }),
1300
- (z == null ? void 0 : z.announce) && /* @__PURE__ */ e(
1299
+ w && /* @__PURE__ */ e(Or, { starred: !!w.starred, notify: Ht }),
1300
+ (W == null ? void 0 : W.announce) && /* @__PURE__ */ e(
1301
1301
  "span",
1302
1302
  {
1303
1303
  className: "shrink-0 rounded bg-slate-100 px-1.5 py-px text-[10.5px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
@@ -1306,12 +1306,12 @@ function jn({
1306
1306
  }
1307
1307
  )
1308
1308
  ] }),
1309
- p && Ne(n, p.id) ? /* @__PURE__ */ e(Yr, { peerId: Ne(n, p.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
1309
+ x && Ce(n, x.id) ? /* @__PURE__ */ e(Yr, { peerId: Ce(n, x.id), name: S }) : n.startsWith("ch:") ? /* @__PURE__ */ e(
1310
1310
  Pr,
1311
1311
  {
1312
1312
  room: n,
1313
- me: ((kn = h.me) == null ? void 0 : kn.id) ?? null,
1314
- renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 24 })
1313
+ me: ((kn = b.me) == null ? void 0 : kn.id) ?? null,
1314
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Y, { id: t, name: h, size: 24 })
1315
1315
  }
1316
1316
  ) : null
1317
1317
  ] }),
@@ -1320,8 +1320,8 @@ function jn({
1320
1320
  {
1321
1321
  room: n,
1322
1322
  roomLabel: S,
1323
- huddle: g,
1324
- renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 18, presence: !1 })
1323
+ huddle: v,
1324
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Y, { id: t, name: h, size: 18, presence: !1 })
1325
1325
  }
1326
1326
  ),
1327
1327
  /* @__PURE__ */ e(
@@ -1331,14 +1331,14 @@ function jn({
1331
1331
  onClick: () => {
1332
1332
  Ca((t) => !t), Gt("");
1333
1333
  },
1334
- className: b(Ln, Xe ? f.accentSoft : On),
1334
+ className: g(Ln, Xe ? f.accentSoft : On),
1335
1335
  "aria-label": "Search in this conversation",
1336
1336
  "aria-pressed": Xe,
1337
1337
  "data-tip": "Search this conversation",
1338
1338
  children: /* @__PURE__ */ e(Fn, { className: "h-3.5 w-3.5", strokeWidth: 2 })
1339
1339
  }
1340
1340
  ),
1341
- ((wn = y == null ? void 0 : y.channel) == null ? void 0 : wn.is_direct) && /* @__PURE__ */ e(nl, { channel: y.channel, onLeft: l }),
1341
+ ((wn = w == null ? void 0 : w.channel) == null ? void 0 : wn.is_direct) && /* @__PURE__ */ e(nl, { channel: w.channel, onLeft: l }),
1342
1342
  /* @__PURE__ */ e(
1343
1343
  "button",
1344
1344
  {
@@ -1346,7 +1346,7 @@ function jn({
1346
1346
  onClick: () => {
1347
1347
  Le(null), We((t) => !t);
1348
1348
  },
1349
- className: b(Ln, ht ? f.accentSoft : On),
1349
+ className: g(Ln, ht ? f.accentSoft : On),
1350
1350
  "aria-label": "Room info — members, pinned, files and links",
1351
1351
  "aria-pressed": ht,
1352
1352
  "data-tip": "Room info — members, pinned, files and links",
@@ -1358,48 +1358,48 @@ function jn({
1358
1358
  Lr,
1359
1359
  {
1360
1360
  th: f,
1361
- huddleSchedule: g.enabled ? (t) => /* @__PURE__ */ e(
1361
+ huddleSchedule: v.enabled ? (t) => /* @__PURE__ */ e(
1362
1362
  Cr,
1363
1363
  {
1364
1364
  room: n,
1365
- me: (p == null ? void 0 : p.id) ?? null,
1365
+ me: (x == null ? void 0 : x.id) ?? null,
1366
1366
  theme: { input: f.input },
1367
- renderAvatar: (m, N) => /* @__PURE__ */ e(Z, { id: m, name: N, size: 18, presence: !1 }),
1367
+ renderAvatar: (h, N) => /* @__PURE__ */ e(Y, { id: h, name: N, size: 18, presence: !1 }),
1368
1368
  onDone: t
1369
1369
  }
1370
1370
  ) : void 0,
1371
- starred: y ? !!y.starred : void 0,
1372
- onStar: y ? () => ba.mutate({ room: n, starred: !y.starred }) : void 0,
1373
- notify: y ? Ht : void 0,
1374
- onNotify: y ? (t) => {
1375
- t === "muted" ? J.mutate({ room: n, muted: !0 }) : (y.muted && J.mutate({ room: n, muted: !1 }), fa.mutate({ room: n, mode: t }));
1371
+ starred: w ? !!w.starred : void 0,
1372
+ onStar: w ? () => ba.mutate({ room: n, starred: !w.starred }) : void 0,
1373
+ notify: w ? Ht : void 0,
1374
+ onNotify: w ? (t) => {
1375
+ t === "muted" ? K.mutate({ room: n, muted: !0 }) : (w.muted && K.mutate({ room: n, muted: !1 }), fa.mutate({ room: n, mode: t }));
1376
1376
  } : void 0,
1377
1377
  onJump: (t) => {
1378
- Ue.current = !1, re.current = !1, M({ date: t });
1378
+ De.current = !1, re.current = !1, R({ date: t });
1379
1379
  },
1380
- onOpenRecord: de ? () => {
1380
+ onOpenRecord: le ? () => {
1381
1381
  var t;
1382
- return (t = h.navigate) == null ? void 0 : t.call(h, de);
1382
+ return (t = b.navigate) == null ? void 0 : t.call(b, le);
1383
1383
  } : void 0,
1384
- onTeamsCall: n.startsWith("dm:") || (Nn = y == null ? void 0 : y.channel) != null && Nn.is_direct ? async () => {
1385
- var t, m;
1384
+ onTeamsCall: n.startsWith("dm:") || (Nn = w == null ? void 0 : w.channel) != null && Nn.is_direct ? async () => {
1385
+ var t, h;
1386
1386
  try {
1387
1387
  let N = [];
1388
- if (n.startsWith("dm:") && p) {
1389
- const Q = Ne(n, p.id);
1390
- if (Q) {
1391
- const Y = await u.request(
1392
- xe(`/users/${Q}`)
1388
+ if (n.startsWith("dm:") && x) {
1389
+ const H = Ce(n, x.id);
1390
+ if (H) {
1391
+ const J = await p.request(
1392
+ ge(`/users/${H}`)
1393
1393
  );
1394
- (t = Y.data) != null && t.email && (N = [Y.data.email]);
1394
+ (t = J.data) != null && t.email && (N = [J.data.email]);
1395
1395
  }
1396
- } else (m = y == null ? void 0 : y.channel) != null && m.id && (N = (await u.request(
1397
- xe(
1398
- `/chat/channels/${y.channel.id}/members`
1396
+ } else (h = w == null ? void 0 : w.channel) != null && h.id && (N = (await p.request(
1397
+ ge(
1398
+ `/chat/channels/${w.channel.id}/members`
1399
1399
  )
1400
- )).data.filter((Y) => Y.email && Y.user.toUpperCase() !== (p == null ? void 0 : p.id.toUpperCase())).map((Y) => Y.email));
1400
+ )).data.filter((J) => J.email && J.user.toUpperCase() !== (x == null ? void 0 : x.id.toUpperCase())).map((J) => J.email));
1401
1401
  if (N.length === 0) {
1402
- he.error("No callable participants found");
1402
+ xe.error("No callable participants found");
1403
1403
  return;
1404
1404
  }
1405
1405
  window.open(
@@ -1408,16 +1408,16 @@ function jn({
1408
1408
  "noopener"
1409
1409
  );
1410
1410
  } catch {
1411
- he.error("Could not resolve participants");
1411
+ xe.error("Could not resolve participants");
1412
1412
  }
1413
1413
  } : void 0,
1414
1414
  onSettings: r,
1415
- archived: !!(y != null && y.archived),
1416
- onArchive: y && Na ? () => xa.mutate(
1417
- { room: n, archived: !y.archived },
1415
+ archived: !!(w != null && w.archived),
1416
+ onArchive: w && Na ? () => xa.mutate(
1417
+ { room: n, archived: !w.archived },
1418
1418
  {
1419
1419
  onSuccess: () => {
1420
- y.archived ? he.success("Moved back to your chats") : (he.success(
1420
+ w.archived ? xe.success("Moved back to your chats") : (xe.success(
1421
1421
  "Archived for you — others in the conversation still see it",
1422
1422
  {
1423
1423
  description: "Find it under the Archived tab."
@@ -1426,14 +1426,14 @@ function jn({
1426
1426
  }
1427
1427
  }
1428
1428
  ) : void 0,
1429
- onLeave: (y == null ? void 0 : y.kind) === "entity" && y.joined ? () => va.mutate(n, {
1429
+ onLeave: (w == null ? void 0 : w.kind) === "entity" && w.joined ? () => va.mutate(n, {
1430
1430
  onSuccess: () => {
1431
- he.success(`Left ${y.label}`, {
1431
+ xe.success(`Left ${w.label}`, {
1432
1432
  description: "Open the record's chat again to rejoin."
1433
1433
  }), l();
1434
1434
  }
1435
1435
  }) : void 0,
1436
- tips: /* @__PURE__ */ e(Qr, { botName: ce })
1436
+ tips: /* @__PURE__ */ e(Qr, { botName: ue })
1437
1437
  }
1438
1438
  )
1439
1439
  ] }),
@@ -1441,33 +1441,33 @@ function jn({
1441
1441
  _r,
1442
1442
  {
1443
1443
  room: n,
1444
- me: p,
1445
- huddle: g,
1446
- renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 18, presence: !1 })
1444
+ me: x,
1445
+ huddle: v,
1446
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Y, { id: t, name: h, size: 18, presence: !1 })
1447
1447
  }
1448
1448
  ),
1449
- Xe && /* @__PURE__ */ e("div", { className: b("shrink-0 border-b px-3 py-1.5", f.divider), children: /* @__PURE__ */ e(
1449
+ Xe && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1.5", f.divider), children: /* @__PURE__ */ e(
1450
1450
  "input",
1451
1451
  {
1452
1452
  autoFocus: !0,
1453
1453
  value: et,
1454
1454
  onChange: (t) => Gt(t.target.value),
1455
1455
  placeholder: "Search messages…",
1456
- className: b("h-7 w-full rounded-md border px-2 text-[12px] outline-none", f.input),
1456
+ className: g("h-7 w-full rounded-md border px-2 text-[12px] outline-none", f.input),
1457
1457
  "aria-label": "Search messages"
1458
1458
  }
1459
1459
  ) }),
1460
1460
  /* @__PURE__ */ e(Kr, { room: n }),
1461
- z && !z.is_direct && /* @__PURE__ */ e(
1461
+ W && !W.is_direct && /* @__PURE__ */ e(
1462
1462
  Ir,
1463
1463
  {
1464
- description: z.description,
1465
- links: z.links,
1464
+ description: W.description,
1465
+ links: W.links,
1466
1466
  th: f,
1467
- navigate: h.navigate
1467
+ navigate: b.navigate
1468
1468
  }
1469
1469
  ),
1470
- w.length > 0 && /* @__PURE__ */ e("div", { className: b("shrink-0 border-b px-3 py-1", f.divider), "data-chat-pins-strip": !0, children: /* @__PURE__ */ a(
1470
+ de.length > 0 && /* @__PURE__ */ e("div", { className: g("shrink-0 border-b px-3 py-1", f.divider), "data-chat-pins-strip": !0, children: /* @__PURE__ */ a(
1471
1471
  "button",
1472
1472
  {
1473
1473
  type: "button",
@@ -1477,24 +1477,24 @@ function jn({
1477
1477
  className: "flex w-full items-center gap-1.5 text-[11px] font-medium text-slate-500 dark:text-slate-400",
1478
1478
  children: [
1479
1479
  /* @__PURE__ */ e(St, { className: "h-3 w-3", strokeWidth: 2 }),
1480
- w.length,
1480
+ de.length,
1481
1481
  " pinned",
1482
1482
  /* @__PURE__ */ e(ct, { className: "ml-auto h-3 w-3 -rotate-90" })
1483
1483
  ]
1484
1484
  }
1485
1485
  ) }),
1486
- (z == null ? void 0 : z.archive_suggested_at) && z.id !== 0 && (cn || F) && /* @__PURE__ */ e(
1486
+ (W == null ? void 0 : W.archive_suggested_at) && W.id !== 0 && (cn || B) && /* @__PURE__ */ e(
1487
1487
  Ls,
1488
1488
  {
1489
- channelId: z.id,
1489
+ channelId: W.id,
1490
1490
  channelName: S,
1491
- suggestedAt: z.archive_suggested_at
1491
+ suggestedAt: W.archive_suggested_at
1492
1492
  }
1493
1493
  ),
1494
- Ia && (z == null ? void 0 : z.welcome_note) && /* @__PURE__ */ e(
1494
+ Ia && (W == null ? void 0 : W.welcome_note) && /* @__PURE__ */ e(
1495
1495
  jr,
1496
1496
  {
1497
- note: z.welcome_note,
1497
+ note: W.welcome_note,
1498
1498
  channelName: S,
1499
1499
  th: f,
1500
1500
  onDismiss: () => ga.mutate(n)
@@ -1503,57 +1503,57 @@ function jn({
1503
1503
  /* @__PURE__ */ e(
1504
1504
  "div",
1505
1505
  {
1506
- ref: Re,
1506
+ ref: Ae,
1507
1507
  onScroll: (t) => {
1508
- const m = t.currentTarget;
1509
- re.current = m.scrollHeight - m.scrollTop - m.clientHeight < 48, vt.current = m.scrollHeight, re.current && le && Fe(null), ge.onScroll(), m.scrollTop < 200 && R && !V && !me && Ue.current && H();
1508
+ const h = t.currentTarget;
1509
+ re.current = h.scrollHeight - h.scrollTop - h.clientHeight < 48, vt.current = h.scrollHeight, re.current && oe && Fe(null), ye.onScroll(), h.scrollTop < 200 && A && !G && !he && De.current && z();
1510
1510
  },
1511
1511
  className: "relative min-h-0 flex-1 overflow-y-auto px-3 py-3 [overflow-anchor:none]",
1512
1512
  "data-chat-messages": !0,
1513
1513
  children: /* @__PURE__ */ a("div", { ref: sn, className: Ie === "compact" ? "space-y-1" : "space-y-2.5", children: [
1514
- R && !me && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
1514
+ A && !he && /* @__PURE__ */ e("div", { className: "flex justify-center", children: /* @__PURE__ */ e(
1515
1515
  "button",
1516
1516
  {
1517
1517
  type: "button",
1518
- disabled: V,
1518
+ disabled: G,
1519
1519
  onClick: () => {
1520
1520
  var t;
1521
- vt.current = ((t = Re.current) == null ? void 0 : t.scrollHeight) ?? 0, H();
1521
+ vt.current = ((t = Ae.current) == null ? void 0 : t.scrollHeight) ?? 0, z();
1522
1522
  },
1523
1523
  className: "rounded-full border border-slate-200 px-2.5 py-0.5 text-[11px] font-medium text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:text-slate-300",
1524
1524
  "data-chat-load-older": !0,
1525
- children: V ? "Loading…" : "Load earlier messages"
1525
+ children: G ? "Loading…" : "Load earlier messages"
1526
1526
  }
1527
1527
  ) }),
1528
- B ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : we.length === 0 && se.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: me ? "No messages match." : W ? "Nothing was said around then." : /* @__PURE__ */ a(_e, { children: [
1528
+ q ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : Ne.length === 0 && te.length === 0 ? /* @__PURE__ */ e("div", { className: "py-6 text-center text-[12px] text-slate-500", children: he ? "No messages match." : E ? "Nothing was said around then." : /* @__PURE__ */ a(ve, { children: [
1529
1529
  /* @__PURE__ */ e("p", { children: "No messages yet — say hello." }),
1530
1530
  /* @__PURE__ */ a("p", { className: "mt-1 text-[11px]", children: [
1531
1531
  "Tip: @ mentions someone",
1532
- ce ? `, @${ce} asks the AI` : "",
1532
+ ue ? `, @${ue} asks the AI` : "",
1533
1533
  ", # inserts a record, and a record ID like AB26-12345 becomes a live link."
1534
1534
  ] })
1535
1535
  ] }) }) : /* @__PURE__ */ e(
1536
1536
  "div",
1537
1537
  {
1538
1538
  ref: on,
1539
- style: ge.windowed ? { paddingTop: ge.padTop, paddingBottom: ge.padBottom } : void 0,
1540
- "data-chat-rows": ge.windowed ? "windowed" : "all",
1541
- children: we.slice(ge.start, ge.end).map((t, m) => {
1542
- var De;
1543
- const N = ge.start + m, Q = we[N - 1], Y = N === 0 || Q && new Date(Q.date_created).toDateString() !== new Date(t.date_created).toDateString(), Ae = !me && !W && gt.current > 0 && N === Math.max(0, we.length - gt.current), je = Ie === "compact" && !Y && !!Q && Q.sender === t.sender && !Q.is_system && new Date(t.date_created).getTime() - new Date(Q.date_created).getTime() < 5 * 6e4;
1539
+ style: ye.windowed ? { paddingTop: ye.padTop, paddingBottom: ye.padBottom } : void 0,
1540
+ "data-chat-rows": ye.windowed ? "windowed" : "all",
1541
+ children: Ne.slice(ye.start, ye.end).map((t, h) => {
1542
+ var $e;
1543
+ const N = ye.start + h, H = Ne[N - 1], J = N === 0 || H && new Date(H.date_created).toDateString() !== new Date(t.date_created).toDateString(), Re = !he && !E && gt.current > 0 && N === Math.max(0, Ne.length - gt.current), je = Ie === "compact" && !J && !!H && H.sender === t.sender && !H.is_system && new Date(t.date_created).getTime() - new Date(H.date_created).getTime() < 5 * 6e4;
1544
1544
  return /* @__PURE__ */ a(
1545
1545
  "div",
1546
1546
  {
1547
- ref: ge.rowRef(t.id),
1547
+ ref: ye.rowRef(t.id),
1548
1548
  "data-chat-row": t.id,
1549
1549
  className: N > 0 ? Ie === "compact" ? "pt-1" : "pt-2.5" : void 0,
1550
1550
  children: [
1551
- Y && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
1551
+ J && /* @__PURE__ */ a("div", { className: "my-2 flex items-center gap-2", children: [
1552
1552
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" }),
1553
1553
  /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-slate-500 dark:text-slate-400", children: Gr(t.date_created) }),
1554
1554
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-slate-100 dark:bg-border" })
1555
1555
  ] }),
1556
- Ae && /* @__PURE__ */ a(
1556
+ Re && /* @__PURE__ */ a(
1557
1557
  "div",
1558
1558
  {
1559
1559
  ref: bt,
@@ -1566,19 +1566,19 @@ function jn({
1566
1566
  "button",
1567
1567
  {
1568
1568
  type: "button",
1569
- disabled: X.isPending,
1570
- onClick: () => X.mutate(),
1569
+ disabled: V.isPending,
1570
+ onClick: () => V.mutate(),
1571
1571
  className: "rounded-full border border-red-200 px-1.5 py-px text-[9.5px] font-medium text-red-500 hover:text-red-600 disabled:opacity-50 dark:border-red-500/40",
1572
- children: X.isPending ? "Summarizing…" : "✨ What did I miss?"
1572
+ children: V.isPending ? "Summarizing…" : "✨ What did I miss?"
1573
1573
  }
1574
1574
  ),
1575
1575
  /* @__PURE__ */ e("span", { className: "h-px flex-1 bg-red-300 dark:bg-red-500/50" })
1576
1576
  ]
1577
1577
  }
1578
1578
  ),
1579
- Ae && O && /* @__PURE__ */ e("div", { className: "my-1 rounded-md border border-nvr-cyan/25 bg-nvr-cyan/5 px-2.5 py-1.5 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: O }),
1579
+ Re && M && /* @__PURE__ */ e("div", { className: "my-1 rounded-md border border-nvr-cyan/25 bg-nvr-cyan/5 px-2.5 py-1.5 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: M }),
1580
1580
  mn(t, {
1581
- isLastMine: ((De = t.sender) == null ? void 0 : De.toLowerCase()) === Pe && N === Ma,
1581
+ isLastMine: (($e = t.sender) == null ? void 0 : $e.toLowerCase()) === Pe && N === Ma,
1582
1582
  showSender: !je
1583
1583
  })
1584
1584
  ]
@@ -1588,12 +1588,12 @@ function jn({
1588
1588
  })
1589
1589
  }
1590
1590
  ),
1591
- !me && !G && /* @__PURE__ */ e(la, { items: se, th: f }),
1592
- !me && !G && He.live && ce && /* @__PURE__ */ e(
1591
+ !he && !F && /* @__PURE__ */ e(la, { items: te, th: f }),
1592
+ !he && !F && He.live && ue && /* @__PURE__ */ e(
1593
1593
  Ms,
1594
1594
  {
1595
1595
  live: He.live,
1596
- botName: ce,
1596
+ botName: ue,
1597
1597
  bubbleClass: f.bubbleOther,
1598
1598
  accentClass: f.accentText,
1599
1599
  onStop: He.stop,
@@ -1603,26 +1603,26 @@ function jn({
1603
1603
  ] })
1604
1604
  }
1605
1605
  ),
1606
- (le || G) && /* @__PURE__ */ e("div", { className: "pointer-events-none relative z-10 -mt-9 flex h-9 shrink-0 items-center justify-center", children: /* @__PURE__ */ e(
1606
+ (oe || F) && /* @__PURE__ */ e("div", { className: "pointer-events-none relative z-10 -mt-9 flex h-9 shrink-0 items-center justify-center", children: /* @__PURE__ */ e(
1607
1607
  "button",
1608
1608
  {
1609
1609
  type: "button",
1610
1610
  onClick: () => {
1611
- if (G) {
1612
- Ue.current = !1, re.current = !0, M(null);
1611
+ if (F) {
1612
+ De.current = !1, re.current = !0, R(null);
1613
1613
  return;
1614
1614
  }
1615
- le && !yt(le.firstId) && at(), Fe(null);
1615
+ oe && !yt(oe.firstId) && at(), Fe(null);
1616
1616
  },
1617
- className: b(
1617
+ className: g(
1618
1618
  "pointer-events-auto rounded-full px-3 py-1 text-[11.5px] font-semibold shadow-md",
1619
1619
  f.pill
1620
1620
  ),
1621
- "data-chat-new-pill": (le == null ? void 0 : le.count) ?? 0,
1622
- children: G ? "Jump to the latest ↓" : `${le == null ? void 0 : le.count} new ${(le == null ? void 0 : le.count) === 1 ? "message" : "messages"} ↓`
1621
+ "data-chat-new-pill": (oe == null ? void 0 : oe.count) ?? 0,
1622
+ children: F ? "Jump to the latest ↓" : `${oe == null ? void 0 : oe.count} new ${(oe == null ? void 0 : oe.count) === 1 ? "message" : "messages"} ↓`
1623
1623
  }
1624
1624
  ) }),
1625
- /* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children: nt && ce && !He.live ? /* @__PURE__ */ a(
1625
+ /* @__PURE__ */ e("div", { className: "min-h-[18px] shrink-0 px-3.5", children: nt && ue && !He.live ? /* @__PURE__ */ a(
1626
1626
  "p",
1627
1627
  {
1628
1628
  className: "flex items-center gap-1.5 text-[11px] italic text-slate-500",
@@ -1633,11 +1633,11 @@ function jn({
1633
1633
  /* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:150ms]" }),
1634
1634
  /* @__PURE__ */ e("span", { className: "h-1 w-1 animate-bounce rounded-full bg-slate-400 [animation-delay:300ms]" })
1635
1635
  ] }),
1636
- ce,
1636
+ ue,
1637
1637
  " is thinking…"
1638
1638
  ]
1639
1639
  }
1640
- ) : te.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: te.typingText }) }),
1640
+ ) : ne.typingText && /* @__PURE__ */ e("p", { className: "text-[11px] italic text-slate-500", children: ne.typingText }) }),
1641
1641
  Yt && /* @__PURE__ */ e(Ds, { file: Yt, onClose: () => Zt(null) }),
1642
1642
  pn(null),
1643
1643
  Vt != null && /* @__PURE__ */ e(
@@ -1658,12 +1658,12 @@ function jn({
1658
1658
  room: n,
1659
1659
  label: S,
1660
1660
  th: f,
1661
- pins: w,
1661
+ pins: de,
1662
1662
  onClose: () => We(!1),
1663
1663
  onOpenMessage: rn,
1664
- onUnpin: (t) => P.mutate(t),
1665
- navigate: h.navigate,
1666
- renderAvatar: (t, m) => /* @__PURE__ */ e(Z, { id: t, name: m, size: 22 })
1664
+ onUnpin: (t) => c.mutate(t),
1665
+ navigate: b.navigate,
1666
+ renderAvatar: (t, h) => /* @__PURE__ */ e(Y, { id: t, name: h, size: 22 })
1667
1667
  }
1668
1668
  )
1669
1669
  ]
@@ -1741,18 +1741,18 @@ function tl({
1741
1741
  channelId: s,
1742
1742
  senderId: l
1743
1743
  }) {
1744
- const r = ie(), [o, i] = T(!1), { members: d } = jt(o ? s : null), c = new Set(n.map((u) => String(u.user).toUpperCase())), h = d.filter((u) => {
1745
- const p = String(u.user).toUpperCase();
1746
- return p !== l.toUpperCase() && !c.has(p);
1744
+ const r = ce(), [o, i] = T(!1), { members: m } = jt(o ? s : null), d = new Set(n.map((p) => String(p.user).toUpperCase())), b = m.filter((p) => {
1745
+ const x = String(p.user).toUpperCase();
1746
+ return x !== l.toUpperCase() && !d.has(x);
1747
1747
  }), f = [...n].sort(
1748
- (u, p) => new Date(u.last_read_at).getTime() - new Date(p.last_read_at).getTime()
1748
+ (p, x) => new Date(p.last_read_at).getTime() - new Date(x.last_read_at).getTime()
1749
1749
  );
1750
1750
  return /* @__PURE__ */ a(Ye, { open: o, onOpenChange: i, children: [
1751
1751
  /* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ a(
1752
1752
  "button",
1753
1753
  {
1754
1754
  type: "button",
1755
- className: b(
1755
+ className: g(
1756
1756
  "font-medium underline decoration-dotted underline-offset-2 hover:decoration-solid",
1757
1757
  r.accentText
1758
1758
  ),
@@ -1769,7 +1769,7 @@ function tl({
1769
1769
  {
1770
1770
  align: "end",
1771
1771
  sideOffset: 4,
1772
- className: b("w-[240px] p-0", r.surface),
1772
+ className: g("w-[240px] p-0", r.surface),
1773
1773
  "data-chat-seen-by-panel": !0,
1774
1774
  children: [
1775
1775
  /* @__PURE__ */ a("p", { className: "border-b border-slate-100 px-3 py-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400 dark:border-border", children: [
@@ -1777,29 +1777,29 @@ function tl({
1777
1777
  n.length
1778
1778
  ] }),
1779
1779
  /* @__PURE__ */ a("div", { className: "max-h-[260px] overflow-y-auto py-1", children: [
1780
- f.map((u) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
1781
- /* @__PURE__ */ e(Z, { id: u.user, name: u.name || null, size: 22 }),
1782
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: u.name || "Someone" }),
1780
+ f.map((p) => /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5", children: [
1781
+ /* @__PURE__ */ e(Y, { id: p.user, name: p.name || null, size: 22 }),
1782
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: p.name || "Someone" }),
1783
1783
  /* @__PURE__ */ e(
1784
1784
  "span",
1785
1785
  {
1786
1786
  className: "shrink-0 text-[10.5px] tabular-nums text-slate-400",
1787
- "data-tip": `Last read the conversation ${new Date(u.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
1788
- children: el(u.last_read_at)
1787
+ "data-tip": `Last read the conversation ${new Date(p.last_read_at).toLocaleString("en-US", { dateStyle: "medium", timeStyle: "short" })}`,
1788
+ children: el(p.last_read_at)
1789
1789
  }
1790
1790
  )
1791
- ] }, u.user)),
1792
- h.length > 0 && /* @__PURE__ */ a(_e, { children: [
1791
+ ] }, p.user)),
1792
+ b.length > 0 && /* @__PURE__ */ a(ve, { children: [
1793
1793
  /* @__PURE__ */ a("p", { className: "px-3 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1794
1794
  "Not seen yet · ",
1795
- h.length
1795
+ b.length
1796
1796
  ] }),
1797
- h.map((u) => {
1798
- const p = [u.first_name, u.last_name].filter(Boolean).join(" ") || u.email || "Someone";
1797
+ b.map((p) => {
1798
+ const x = [p.first_name, p.last_name].filter(Boolean).join(" ") || p.email || "Someone";
1799
1799
  return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-3 py-1.5 opacity-70", children: [
1800
- /* @__PURE__ */ e(Z, { id: u.user, name: p, size: 22 }),
1801
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300", children: p })
1802
- ] }, u.user);
1800
+ /* @__PURE__ */ e(Y, { id: p.user, name: x, size: 22 }),
1801
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-600 dark:text-slate-300", children: x })
1802
+ ] }, p.user);
1803
1803
  })
1804
1804
  ] })
1805
1805
  ] }),
@@ -1810,26 +1810,26 @@ function tl({
1810
1810
  ] });
1811
1811
  }
1812
1812
  function nl({ channel: n, onLeft: s }) {
1813
- var B;
1814
- const l = ie(), r = Me(), { isAdmin: o } = ut(), [i, d] = T(!1), { members: c, loading: h } = jt(n.id), { addMember: f, removeMember: u } = Vn(n.id), [p, g] = T(""), U = Ft(p, 250), $ = ((B = r.me) == null ? void 0 : B.id.toUpperCase()) ?? "", C = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: S } = qt(U, i && C && !!p.trim()), W = new Set(c.map((R) => String(R.user).toUpperCase())), M = (R) => [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.user, v = [...c].sort((R, G) => {
1815
- const H = String(R.user).toUpperCase(), V = String(G.user).toUpperCase();
1816
- return H === $ ? -1 : V === $ ? 1 : M(R).localeCompare(M(G));
1813
+ var q;
1814
+ const l = ce(), r = Me(), { isAdmin: o } = ut(), [i, m] = T(!1), { members: d, loading: b } = jt(n.id), { addMember: f, removeMember: p } = Vn(n.id), [x, v] = T(""), U = Ft(x, 250), $ = ((q = r.me) == null ? void 0 : q.id.toUpperCase()) ?? "", C = o || !!$ && String(n.created_by ?? "").toUpperCase() === $, { users: S } = qt(U, i && C && !!x.trim()), E = new Set(d.map((A) => String(A.user).toUpperCase())), R = (A) => [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.user, y = [...d].sort((A, F) => {
1815
+ const z = String(A.user).toUpperCase(), G = String(F.user).toUpperCase();
1816
+ return z === $ ? -1 : G === $ ? 1 : R(A).localeCompare(R(F));
1817
1817
  });
1818
- return /* @__PURE__ */ a(Ye, { open: i, onOpenChange: d, children: [
1818
+ return /* @__PURE__ */ a(Ye, { open: i, onOpenChange: m, children: [
1819
1819
  /* @__PURE__ */ e(Ze, { asChild: !0, children: /* @__PURE__ */ a(
1820
1820
  "button",
1821
1821
  {
1822
1822
  type: "button",
1823
1823
  title: "People in this conversation",
1824
1824
  "aria-label": "People in this conversation",
1825
- className: b(
1825
+ className: g(
1826
1826
  "flex items-center gap-1 rounded-md px-1 py-1 text-[11px] font-medium tabular-nums transition-colors",
1827
1827
  i ? l.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
1828
1828
  ),
1829
1829
  "data-chat-group-members": !0,
1830
1830
  children: [
1831
1831
  /* @__PURE__ */ e(Tt, { className: "h-3.5 w-3.5", strokeWidth: 2 }),
1832
- c.length > 0 && c.length
1832
+ d.length > 0 && d.length
1833
1833
  ]
1834
1834
  }
1835
1835
  ) }),
@@ -1838,86 +1838,86 @@ function nl({ channel: n, onLeft: s }) {
1838
1838
  {
1839
1839
  align: "end",
1840
1840
  sideOffset: 6,
1841
- className: b("w-[260px] p-0", l.surface),
1841
+ className: g("w-[260px] p-0", l.surface),
1842
1842
  "data-chat-group-members-panel": !0,
1843
1843
  children: [
1844
- /* @__PURE__ */ e("div", { className: b("border-b px-3 py-2", l.divider), children: /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1844
+ /* @__PURE__ */ e("div", { className: g("border-b px-3 py-2", l.divider), children: /* @__PURE__ */ a("p", { className: "text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
1845
1845
  "In this conversation ",
1846
- c.length > 0 && `· ${c.length}`
1846
+ d.length > 0 && `· ${d.length}`
1847
1847
  ] }) }),
1848
1848
  /* @__PURE__ */ a("div", { className: "max-h-[280px] overflow-y-auto py-1", children: [
1849
- h && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
1850
- v.map((R) => {
1851
- const G = String(R.user).toUpperCase(), H = M(R), V = G === $, se = String(n.created_by ?? "").toUpperCase() === G;
1849
+ b && /* @__PURE__ */ e("p", { className: "px-3 py-2 text-[12px] text-slate-400", children: "Loading…" }),
1850
+ y.map((A) => {
1851
+ const F = String(A.user).toUpperCase(), z = R(A), G = F === $, te = String(n.created_by ?? "").toUpperCase() === F;
1852
1852
  return /* @__PURE__ */ a(
1853
1853
  "div",
1854
1854
  {
1855
1855
  className: "group flex items-center gap-2 px-3 py-1.5",
1856
- "data-chat-group-member": R.user,
1856
+ "data-chat-group-member": A.user,
1857
1857
  children: [
1858
- /* @__PURE__ */ e(Z, { id: R.user, name: H, size: 26 }),
1858
+ /* @__PURE__ */ e(Y, { id: A.user, name: z, size: 26 }),
1859
1859
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
1860
1860
  /* @__PURE__ */ a("span", { className: "block truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
1861
- H,
1862
- V && /* @__PURE__ */ e("span", { className: "text-slate-400", children: " (you)" })
1861
+ z,
1862
+ G && /* @__PURE__ */ e("span", { className: "text-slate-400", children: " (you)" })
1863
1863
  ] }),
1864
- se && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
1864
+ te && /* @__PURE__ */ e("span", { className: "block text-[10.5px] text-slate-400", children: "Started the group" })
1865
1865
  ] }),
1866
- C && !V && /* @__PURE__ */ e(
1866
+ C && !G && /* @__PURE__ */ e(
1867
1867
  "button",
1868
1868
  {
1869
1869
  type: "button",
1870
- title: `Remove ${H}`,
1871
- "aria-label": `Remove ${H}`,
1872
- onClick: () => u.mutate(R.user),
1870
+ title: `Remove ${z}`,
1871
+ "aria-label": `Remove ${z}`,
1872
+ onClick: () => p.mutate(A.user),
1873
1873
  className: "rounded p-1 text-slate-400 opacity-0 transition-opacity hover:bg-slate-100 hover:text-red-500 focus:opacity-100 group-hover:opacity-100 dark:hover:bg-muted",
1874
1874
  children: /* @__PURE__ */ e(dt, { className: "h-3 w-3" })
1875
1875
  }
1876
1876
  )
1877
1877
  ]
1878
1878
  },
1879
- R.user
1879
+ A.user
1880
1880
  );
1881
1881
  })
1882
1882
  ] }),
1883
- C && /* @__PURE__ */ a("div", { className: b("border-t px-3 py-2", l.divider), children: [
1883
+ C && /* @__PURE__ */ a("div", { className: g("border-t px-3 py-2", l.divider), children: [
1884
1884
  /* @__PURE__ */ e(
1885
1885
  "input",
1886
1886
  {
1887
- value: p,
1888
- onChange: (R) => g(R.target.value),
1887
+ value: x,
1888
+ onChange: (A) => v(A.target.value),
1889
1889
  placeholder: "Add someone…",
1890
- className: b("h-7 w-full rounded-md px-2 text-[12px] outline-none", l.input),
1890
+ className: g("h-7 w-full rounded-md px-2 text-[12px] outline-none", l.input),
1891
1891
  "data-chat-group-add": !0
1892
1892
  }
1893
1893
  ),
1894
- p.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: S.filter((R) => !W.has(String(R.id).toUpperCase())).map((R) => {
1895
- const G = [R.first_name, R.last_name].filter(Boolean).join(" ") || R.email || R.id;
1894
+ x.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-36 overflow-y-auto", children: S.filter((A) => !E.has(String(A.id).toUpperCase())).map((A) => {
1895
+ const F = [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.id;
1896
1896
  return /* @__PURE__ */ a(
1897
1897
  "button",
1898
1898
  {
1899
1899
  type: "button",
1900
1900
  onClick: () => {
1901
- f.mutate(R.id), g("");
1901
+ f.mutate(A.id), v("");
1902
1902
  },
1903
1903
  className: "flex w-full items-center gap-2 rounded px-1 py-1 text-left hover:bg-muted",
1904
1904
  children: [
1905
- /* @__PURE__ */ e(Z, { id: R.id, name: G, size: 22 }),
1906
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: G })
1905
+ /* @__PURE__ */ e(Y, { id: A.id, name: F, size: 22 }),
1906
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12px] text-slate-700 dark:text-slate-200", children: F })
1907
1907
  ]
1908
1908
  },
1909
- R.id
1909
+ A.id
1910
1910
  );
1911
1911
  }) })
1912
1912
  ] }),
1913
- $ && W.has($) && /* @__PURE__ */ e("div", { className: b("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
1913
+ $ && E.has($) && /* @__PURE__ */ e("div", { className: g("border-t px-3 py-1.5", l.divider), children: /* @__PURE__ */ e(
1914
1914
  "button",
1915
1915
  {
1916
1916
  type: "button",
1917
1917
  onClick: () => {
1918
- u.mutate(r.me.id, {
1918
+ p.mutate(r.me.id, {
1919
1919
  onSuccess: () => {
1920
- d(!1), s();
1920
+ m(!1), s();
1921
1921
  }
1922
1922
  });
1923
1923
  },
@@ -1936,12 +1936,12 @@ function al({
1936
1936
  label: s,
1937
1937
  onBack: l
1938
1938
  }) {
1939
- const r = ie(), o = Me(), { isAdmin: i } = ut(), d = Zn(), { members: c, loading: h } = jt(n.id), { update: f, addMember: u, removeMember: p } = Vn(n.id), [g, U] = T(s), [$, C] = T(n.topic ?? ""), [S, W] = T(n.visibility), [M, v] = T(n.role ?? ""), [B, R] = T({
1939
+ const r = ce(), o = Me(), { isAdmin: i } = ut(), m = Zn(), { members: d, loading: b } = jt(n.id), { update: f, addMember: p, removeMember: x } = Vn(n.id), [v, U] = T(s), [$, C] = T(n.topic ?? ""), [S, E] = T(n.visibility), [R, y] = T(n.role ?? ""), [q, A] = T({
1940
1940
  icon: n.icon ?? null,
1941
1941
  color: n.color ?? null
1942
- }), [G, H] = T(""), V = Ft(G, 250), { users: se } = qt(V, S === "private"), ee = n.id === Xn, te = i || !ee && !!o.me && String(n.created_by ?? "") === String(o.me.id), be = new Set(c.map((A) => String(A.user).toUpperCase())), de = g !== s || $ !== (n.topic ?? "") || S !== n.visibility || B.icon !== (n.icon ?? null) || B.color !== (n.color ?? null) || S === "role" && M !== (n.role ?? "");
1942
+ }), [F, z] = T(""), G = Ft(F, 250), { users: te } = qt(G, S === "private"), [me, ne] = T(!1), ae = n.id === Xn, le = i || !ae && !!o.me && String(n.created_by ?? "") === String(o.me.id), se = new Set(d.map((c) => String(c.user).toUpperCase())), de = v !== s || $ !== (n.topic ?? "") || S !== n.visibility || q.icon !== (n.icon ?? null) || q.color !== (n.color ?? null) || S === "role" && R !== (n.role ?? "");
1943
1943
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-settings": !0, children: [
1944
- /* @__PURE__ */ a("div", { className: b("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
1944
+ /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3 py-2.5", r.divider), children: [
1945
1945
  /* @__PURE__ */ e(
1946
1946
  "button",
1947
1947
  {
@@ -1958,21 +1958,21 @@ function al({
1958
1958
  ] })
1959
1959
  ] }),
1960
1960
  /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 space-y-4 overflow-y-auto p-3", children: [
1961
- te ? /* @__PURE__ */ a(_e, { children: [
1961
+ le ? /* @__PURE__ */ a(ve, { children: [
1962
1962
  /* @__PURE__ */ a("label", { className: "block", children: [
1963
1963
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Name" }),
1964
1964
  /* @__PURE__ */ e(
1965
1965
  "input",
1966
1966
  {
1967
- value: g,
1968
- onChange: (A) => U(A.target.value),
1969
- className: b("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
1967
+ value: v,
1968
+ onChange: (c) => U(c.target.value),
1969
+ className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
1970
1970
  }
1971
1971
  )
1972
1972
  ] }),
1973
1973
  !n.is_direct && /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
1974
- /* @__PURE__ */ e(Ke, { icon: B.icon, color: B.color, size: 40 }),
1975
- /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Gn, { icon: B.icon, color: B.color, onChange: R }) })
1974
+ /* @__PURE__ */ e(Ke, { icon: q.icon, color: q.color, size: 40 }),
1975
+ /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ e(Gn, { icon: q.icon, color: q.color, onChange: A }) })
1976
1976
  ] }),
1977
1977
  /* @__PURE__ */ a("label", { className: "block", children: [
1978
1978
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Topic" }),
@@ -1980,43 +1980,43 @@ function al({
1980
1980
  "input",
1981
1981
  {
1982
1982
  value: $,
1983
- onChange: (A) => C(A.target.value),
1983
+ onChange: (c) => C(c.target.value),
1984
1984
  placeholder: "What this channel is for",
1985
- className: b("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
1985
+ className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
1986
1986
  }
1987
1987
  )
1988
1988
  ] }),
1989
- !ee && /* @__PURE__ */ a("div", { children: [
1989
+ !ae && /* @__PURE__ */ a("div", { children: [
1990
1990
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Who can see it" }),
1991
1991
  /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-1.5", children: [
1992
1992
  ["open", "Anyone"],
1993
1993
  ["role", "One role"],
1994
1994
  ["private", "Invite only"]
1995
- ].map(([A, w]) => /* @__PURE__ */ e(
1995
+ ].map(([c, L]) => /* @__PURE__ */ e(
1996
1996
  "button",
1997
1997
  {
1998
1998
  type: "button",
1999
- onClick: () => W(A),
2000
- className: b(
1999
+ onClick: () => E(c),
2000
+ className: g(
2001
2001
  "rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
2002
- S === A ? r.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2002
+ S === c ? r.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2003
2003
  ),
2004
- children: w
2004
+ children: L
2005
2005
  },
2006
- A
2006
+ c
2007
2007
  )) }),
2008
2008
  S === "role" && /* @__PURE__ */ e(
2009
2009
  Lt,
2010
2010
  {
2011
- value: M,
2012
- onChange: v,
2013
- className: b(
2011
+ value: R,
2012
+ onChange: y,
2013
+ className: g(
2014
2014
  "mt-2 h-8 w-full rounded-md px-2 text-[12.5px] outline-none",
2015
2015
  r.input
2016
2016
  ),
2017
2017
  options: [
2018
2018
  { value: "", label: "Choose a role…" },
2019
- ...d.map((A) => ({ value: A.id, label: A.name }))
2019
+ ...m.map((c) => ({ value: c.id, label: c.name }))
2020
2020
  ]
2021
2021
  }
2022
2022
  )
@@ -2026,109 +2026,160 @@ function al({
2026
2026
  "button",
2027
2027
  {
2028
2028
  type: "button",
2029
- disabled: !de || f.isPending || S === "role" && !M,
2029
+ disabled: !de || f.isPending || S === "role" && !R,
2030
2030
  onClick: () => f.mutate(
2031
- ee ? {
2032
- name: g.trim() || s,
2031
+ ae ? {
2032
+ name: v.trim() || s,
2033
2033
  topic: $.trim() || null,
2034
- icon: B.icon,
2035
- color: B.color
2034
+ icon: q.icon,
2035
+ color: q.color
2036
2036
  } : {
2037
- name: g.trim() || s,
2037
+ name: v.trim() || s,
2038
2038
  topic: $.trim() || null,
2039
2039
  visibility: S,
2040
- role: S === "role" ? M : null,
2041
- icon: B.icon,
2042
- color: B.color
2040
+ role: S === "role" ? R : null,
2041
+ icon: q.icon,
2042
+ color: q.color
2043
2043
  }
2044
2044
  ),
2045
- className: b(
2045
+ className: g(
2046
2046
  "rounded-md px-2.5 py-1 text-[12px] font-medium disabled:opacity-40",
2047
2047
  r.action
2048
2048
  ),
2049
2049
  children: f.isPending ? "Saving…" : "Save"
2050
2050
  }
2051
2051
  ),
2052
- ee ? /* @__PURE__ */ e("span", { className: "ml-auto text-[11px] text-slate-400", children: "Open to everyone · cannot be archived" }) : /* @__PURE__ */ e(
2052
+ ae ? /* @__PURE__ */ e("span", { className: "ml-auto text-[11px] text-slate-400", children: "Open to everyone · cannot be archived" }) : /* @__PURE__ */ e(
2053
2053
  "button",
2054
2054
  {
2055
2055
  type: "button",
2056
- onClick: () => f.mutate({ is_archived: !0 }),
2057
- className: "ml-auto rounded-md px-2 py-1 text-[11.5px] font-medium text-red-500 hover:bg-red-50 dark:hover:bg-red-950/40",
2058
- children: "Archive channel"
2056
+ onClick: () => ne(!0),
2057
+ disabled: me,
2058
+ className: "ml-auto rounded-md px-2 py-1 text-[11.5px] font-medium text-red-500 hover:bg-red-50 disabled:opacity-40 dark:hover:bg-red-950/40",
2059
+ "data-chat-archive-everyone": !0,
2060
+ children: "Archive for everyone"
2059
2061
  }
2060
2062
  )
2061
2063
  ] }),
2064
+ me && !ae && /* @__PURE__ */ a(
2065
+ "div",
2066
+ {
2067
+ className: "space-y-2 rounded-md border border-red-200 bg-red-50 p-2.5 text-[11.5px] leading-relaxed text-red-800 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",
2068
+ "data-chat-archive-confirm": !0,
2069
+ children: [
2070
+ /* @__PURE__ */ a("p", { children: [
2071
+ "Archive ",
2072
+ n.is_direct ? "this conversation" : `#${s}`,
2073
+ " for everyone? It closes for all ",
2074
+ d.length ? `${d.length} ` : "",
2075
+ "members: it leaves their chat lists and nobody can read or post in it any more.",
2076
+ " ",
2077
+ n.is_direct ? /* @__PURE__ */ a(ve, { children: [
2078
+ "To only hide it from your own list, use",
2079
+ " ",
2080
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: "Archive for me" }),
2081
+ " in the room's menu instead."
2082
+ ] }) : /* @__PURE__ */ a(ve, { children: [
2083
+ "To only stop hearing from it yourself, set",
2084
+ " ",
2085
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: "Notify me" }),
2086
+ " to Never in the room's menu instead."
2087
+ ] })
2088
+ ] }),
2089
+ /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
2090
+ /* @__PURE__ */ e(
2091
+ "button",
2092
+ {
2093
+ type: "button",
2094
+ disabled: f.isPending,
2095
+ onClick: () => f.mutate({ is_archived: !0 }),
2096
+ className: "h-7 rounded-md bg-red-600 px-2.5 text-[12px] font-medium text-white hover:bg-red-700 disabled:opacity-50",
2097
+ children: f.isPending ? "Archiving…" : "Archive for everyone"
2098
+ }
2099
+ ),
2100
+ /* @__PURE__ */ e(
2101
+ "button",
2102
+ {
2103
+ type: "button",
2104
+ onClick: () => ne(!1),
2105
+ className: "h-7 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 hover:bg-muted dark:border-border dark:bg-card dark:text-slate-200",
2106
+ children: "Cancel"
2107
+ }
2108
+ )
2109
+ ] })
2110
+ ]
2111
+ }
2112
+ ),
2062
2113
  f.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: f.error.message }),
2063
2114
  !n.is_direct && /* @__PURE__ */ e(Ps, { channel: n, th: r, isAdmin: i })
2064
2115
  ] }) : /* @__PURE__ */ a("p", { className: "text-[12px] leading-relaxed text-slate-500 dark:text-slate-400", children: [
2065
2116
  n.topic || "No topic set.",
2066
2117
  /* @__PURE__ */ e("br", {}),
2067
- ee ? "Everyone in the portal can find and join General." : n.visibility === "private" ? "Invite only — you were added by the channel owner." : n.visibility === "role" ? "Everyone with a particular role can see this channel." : "Anyone in the portal can find and join this channel."
2118
+ ae ? "Everyone in the portal can find and join General." : n.visibility === "private" ? "Invite only — you were added by the channel owner." : n.visibility === "role" ? "Everyone with a particular role can see this channel." : "Anyone in the portal can find and join this channel."
2068
2119
  ] }),
2069
2120
  /* @__PURE__ */ a("div", { children: [
2070
2121
  /* @__PURE__ */ a("p", { className: "mb-1.5 text-[11px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2071
2122
  "Members ",
2072
- c.length > 0 && `· ${c.length}`
2123
+ d.length > 0 && `· ${d.length}`
2073
2124
  ] }),
2074
- h && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Loading…" }),
2075
- c.map((A) => {
2076
- const w = [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.user;
2125
+ b && /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-400", children: "Loading…" }),
2126
+ d.map((c) => {
2127
+ const L = [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email || c.user;
2077
2128
  return /* @__PURE__ */ a("div", { className: "flex items-center gap-2 rounded-lg px-1 py-1", children: [
2078
- /* @__PURE__ */ e(Z, { id: A.user, name: w }),
2079
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: w }),
2080
- te && /* @__PURE__ */ e(
2129
+ /* @__PURE__ */ e(Y, { id: c.user, name: L }),
2130
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: L }),
2131
+ le && /* @__PURE__ */ e(
2081
2132
  "button",
2082
2133
  {
2083
2134
  type: "button",
2084
2135
  title: "Remove from channel",
2085
- onClick: () => p.mutate(A.user),
2136
+ onClick: () => x.mutate(c.user),
2086
2137
  className: "rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-red-500 dark:hover:bg-muted",
2087
2138
  children: /* @__PURE__ */ e(dt, { className: "h-3 w-3" })
2088
2139
  }
2089
2140
  )
2090
- ] }, A.user);
2141
+ ] }, c.user);
2091
2142
  }),
2092
- te && S === "private" && /* @__PURE__ */ a("div", { className: "mt-2", children: [
2143
+ le && S === "private" && /* @__PURE__ */ a("div", { className: "mt-2", children: [
2093
2144
  /* @__PURE__ */ e(
2094
2145
  "input",
2095
2146
  {
2096
- value: G,
2097
- onChange: (A) => H(A.target.value),
2147
+ value: F,
2148
+ onChange: (c) => z(c.target.value),
2098
2149
  placeholder: "Add someone…",
2099
- className: b("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
2150
+ className: g("h-8 w-full rounded-md px-2 text-[12.5px] outline-none", r.input)
2100
2151
  }
2101
2152
  ),
2102
- G.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: se.filter((A) => !be.has(String(A.id).toUpperCase())).map((A) => {
2103
- const w = [A.first_name, A.last_name].filter(Boolean).join(" ") || A.email || A.id;
2153
+ F.trim() && /* @__PURE__ */ e("div", { className: "mt-1 max-h-40 overflow-y-auto rounded-md border border-slate-200 dark:border-border", children: te.filter((c) => !se.has(String(c.id).toUpperCase())).map((c) => {
2154
+ const L = [c.first_name, c.last_name].filter(Boolean).join(" ") || c.email || c.id;
2104
2155
  return /* @__PURE__ */ a(
2105
2156
  "button",
2106
2157
  {
2107
2158
  type: "button",
2108
2159
  onClick: () => {
2109
- u.mutate(A.id), H("");
2160
+ p.mutate(c.id), z("");
2110
2161
  },
2111
2162
  className: "flex w-full items-center gap-2 px-2 py-1.5 text-left hover:bg-slate-50 dark:hover:bg-muted/50",
2112
2163
  children: [
2113
- /* @__PURE__ */ e(Z, { id: A.id, name: w }),
2114
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: w })
2164
+ /* @__PURE__ */ e(Y, { id: c.id, name: L }),
2165
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: L })
2115
2166
  ]
2116
2167
  },
2117
- A.id
2168
+ c.id
2118
2169
  );
2119
2170
  }) }),
2120
2171
  /* @__PURE__ */ e("p", { className: "mt-1 text-[11px] leading-snug text-slate-400", children: "Only members can see an invite-only channel — it is not listed to anyone else." })
2121
2172
  ] }),
2122
- te && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Is, { channelId: n.id, th: r }) })
2173
+ le && !n.is_direct && /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Is, { channelId: n.id, th: r }) })
2123
2174
  ] }),
2124
- te && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Os, { channelId: n.id, border: r.divider }),
2175
+ le && !n.is_direct && n.id !== 0 && /* @__PURE__ */ e(Os, { channelId: n.id, border: r.divider }),
2125
2176
  !n.is_direct && /* @__PURE__ */ e(js, { channelId: n.id, th: r })
2126
2177
  ] })
2127
2178
  ] });
2128
2179
  }
2129
2180
  function Ft(n, s) {
2130
2181
  const [l, r] = T(n);
2131
- return ae(() => {
2182
+ return ee(() => {
2132
2183
  const o = setTimeout(() => r(n), s);
2133
2184
  return () => clearTimeout(o);
2134
2185
  }, [n, s]), l;
@@ -2147,8 +2198,8 @@ function Bn(n) {
2147
2198
  return (s = n.lastMessage) != null && s.date_created ? new Date(n.lastMessage.date_created).getTime() : 0;
2148
2199
  }
2149
2200
  function sl(n, s) {
2150
- const l = (i, d) => i.label.localeCompare(d.label), r = (i, d) => Bn(d) - Bn(i) || l(i, d), o = [...n];
2151
- return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, d) => +(d.unread > 0) - +(i.unread > 0) || r(i, d)) : o.sort(r);
2201
+ const l = (i, m) => i.label.localeCompare(m.label), r = (i, m) => Bn(m) - Bn(i) || l(i, m), o = [...n];
2202
+ return s === "alpha" ? o.sort(l) : s === "unread" ? o.sort((i, m) => +(m.unread > 0) - +(i.unread > 0) || r(i, m)) : o.sort(r);
2152
2203
  }
2153
2204
  function rl({
2154
2205
  value: n,
@@ -2180,7 +2231,7 @@ function rl({
2180
2231
  "data-chat-sort-option": i.value,
2181
2232
  children: [
2182
2233
  i.label,
2183
- i.value === n && /* @__PURE__ */ e(At, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2234
+ i.value === n && /* @__PURE__ */ e(Rt, { className: "h-3.5 w-3.5", strokeWidth: 2 })
2184
2235
  ]
2185
2236
  },
2186
2237
  i.value
@@ -2196,24 +2247,24 @@ function Wn({
2196
2247
  loading: o = !1,
2197
2248
  onView: i
2198
2249
  }) {
2199
- const d = ie(), c = Me(), { setMuted: h, leave: f, setArchived: u, setStarred: p } = It(), g = qs(), U = fe(
2250
+ const m = ce(), d = Me(), { setMuted: b, leave: f, setArchived: p, setStarred: x } = It(), v = qs(), U = be(
2200
2251
  () => new Map(
2201
- c.onlineUsers.map((w) => [
2202
- String(w.user_id).toUpperCase(),
2203
- w.is_idle ? "idle" : "online"
2252
+ d.onlineUsers.map((c) => [
2253
+ String(c.user_id).toUpperCase(),
2254
+ c.is_idle ? "idle" : "online"
2204
2255
  ])
2205
2256
  ),
2206
- [c.onlineUsers]
2207
- ), $ = Et(), C = Sr(), [S, W] = T(""), M = Ft(S.trim(), 250), { hits: v, loading: B } = Qs(M, g.filters), R = M.length >= 2 || g.active, G = fe(() => {
2208
- const w = /* @__PURE__ */ new Map();
2209
- for (const P of v) w.set(P.room, [...w.get(P.room) ?? [], P]);
2210
- return [...w.entries()].sort((P, x) => x[1].length - P[1].length);
2211
- }, [v]), H = n.filter((w) => w.unread > 0 && !w.muted).length, V = hr(), se = fe(() => new Map(n.map((w) => [w.room, w])), [n]), ee = Pt(), te = Yn(), be = ee.chat_sidebar_sort === "unread" || ee.chat_sidebar_sort === "alpha" ? ee.chat_sidebar_sort : "recent", de = sl(
2212
- M ? n.filter((w) => w.label.toLowerCase().includes(M.toLowerCase())) : n,
2213
- be
2214
- ), A = (w) => {
2215
- var P;
2216
- return w.kind === "channel" && ((P = w.channel) == null ? void 0 : P.is_direct);
2257
+ [d.onlineUsers]
2258
+ ), $ = Et(), C = Sr(), [S, E] = T(""), R = Ft(S.trim(), 250), { hits: y, meaning: q, loading: A } = Qs(R, v.filters), F = R.length >= 2 || v.active, z = be(() => {
2259
+ const c = /* @__PURE__ */ new Map();
2260
+ for (const L of y) c.set(L.room, [...c.get(L.room) ?? [], L]);
2261
+ return [...c.entries()].sort((L, u) => u[1].length - L[1].length);
2262
+ }, [y]), G = n.filter((c) => c.unread > 0 && !c.muted).length, te = hr(), me = be(() => new Map(n.map((c) => [c.room, c])), [n]), ne = Pt(), ae = Yn(), le = ne.chat_sidebar_sort === "unread" || ne.chat_sidebar_sort === "alpha" ? ne.chat_sidebar_sort : "recent", se = sl(
2263
+ R ? n.filter((c) => c.label.toLowerCase().includes(R.toLowerCase())) : n,
2264
+ le
2265
+ ), de = (c) => {
2266
+ var L;
2267
+ return c.kind === "channel" && ((L = c.channel) == null ? void 0 : L.is_direct);
2217
2268
  };
2218
2269
  return /* @__PURE__ */ a("div", { className: "min-h-0 flex-1 overflow-y-auto p-2", "data-chat-room-list": !0, children: [
2219
2270
  /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
@@ -2221,22 +2272,22 @@ function Wn({
2221
2272
  "input",
2222
2273
  {
2223
2274
  value: S,
2224
- onChange: (w) => W(w.target.value),
2275
+ onChange: (c) => E(c.target.value),
2225
2276
  placeholder: "Search rooms & messages…",
2226
- className: b(
2277
+ className: g(
2227
2278
  "h-7 min-w-0 flex-1 rounded-md border px-2 text-[12px] outline-none",
2228
- d.input
2279
+ m.input
2229
2280
  ),
2230
2281
  "aria-label": "Search rooms and messages",
2231
2282
  "data-chat-global-search": !0
2232
2283
  }
2233
2284
  ),
2234
- !r && /* @__PURE__ */ e(Es, { open: g.open, active: g.active, onClick: () => g.setOpen(!g.open) }),
2285
+ !r && /* @__PURE__ */ e(Es, { open: v.open, active: v.active, onClick: () => v.setOpen(!v.open) }),
2235
2286
  /* @__PURE__ */ e(
2236
2287
  rl,
2237
2288
  {
2238
- value: be,
2239
- onChange: (w) => te.mutate({ chat_sidebar_sort: w === "recent" ? null : w })
2289
+ value: le,
2290
+ onChange: (c) => ae.mutate({ chat_sidebar_sort: c === "recent" ? null : c })
2240
2291
  }
2241
2292
  ),
2242
2293
  !r && /* @__PURE__ */ e(Bs, {}),
@@ -2252,8 +2303,8 @@ function Wn({
2252
2303
  }
2253
2304
  )
2254
2305
  ] }),
2255
- !r && g.open && /* @__PURE__ */ e(Ws, { filters: g.filters, onChange: g.setFilters, rooms: n, th: d }),
2256
- !r && i && !R && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
2306
+ !r && v.open && /* @__PURE__ */ e(Ws, { filters: v.filters, onChange: v.setFilters, rooms: n, th: m }),
2307
+ !r && i && !F && /* @__PURE__ */ a("div", { className: "mb-1 flex flex-wrap gap-1 px-1", "data-chat-view-links": !0, children: [
2257
2308
  /* @__PURE__ */ a(
2258
2309
  "button",
2259
2310
  {
@@ -2280,82 +2331,90 @@ function Wn({
2280
2331
  ]
2281
2332
  }
2282
2333
  ),
2283
- H > 1 && /* @__PURE__ */ a(
2334
+ G > 1 && /* @__PURE__ */ a(
2284
2335
  "button",
2285
2336
  {
2286
2337
  type: "button",
2287
2338
  onClick: () => i("catchup"),
2288
- className: b(
2339
+ className: g(
2289
2340
  "inline-flex h-6 items-center gap-1 rounded-full px-2 text-[11px] font-medium",
2290
- d.accentSoft
2341
+ m.accentSoft
2291
2342
  ),
2292
2343
  "data-chat-view": "catchup",
2293
2344
  children: [
2294
2345
  /* @__PURE__ */ e(Ja, { className: "h-3 w-3" }),
2295
2346
  " Catch up · ",
2296
- H,
2347
+ G,
2297
2348
  " rooms"
2298
2349
  ]
2299
2350
  }
2300
2351
  )
2301
2352
  ] }),
2302
- R && !r && /* @__PURE__ */ a("div", { className: "mb-1.5", "data-chat-search-results": !0, children: [
2353
+ F && !r && /* @__PURE__ */ a("div", { className: "mb-1.5", "data-chat-search-results": !0, children: [
2303
2354
  /* @__PURE__ */ a("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: [
2304
2355
  "Messages",
2305
- v.length ? ` · ${v.length}` : ""
2356
+ y.length ? ` · ${y.length}` : ""
2306
2357
  ] }),
2307
- B ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "Searching…" }) : v.length === 0 ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "No messages match." }) : G.map(([w, P]) => {
2308
- const x = se.get(w);
2309
- return /* @__PURE__ */ a("div", { className: "mb-1", "data-chat-search-group": w, children: [
2358
+ A ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "Searching…" }) : y.length === 0 ? /* @__PURE__ */ e("p", { className: "px-2.5 py-1 text-[11px] text-slate-400", children: "No messages match." }) : z.map(([c, L]) => {
2359
+ const u = me.get(c);
2360
+ return /* @__PURE__ */ a("div", { className: "mb-1", "data-chat-search-group": c, children: [
2310
2361
  /* @__PURE__ */ a("p", { className: "flex items-center gap-1.5 px-2.5 pb-0.5 pt-1 text-[11px] font-semibold text-slate-600 dark:text-slate-300", children: [
2311
- /* @__PURE__ */ e("span", { className: "truncate", children: (x == null ? void 0 : x.label) ?? w }),
2312
- /* @__PURE__ */ e("span", { className: "rounded-full bg-slate-100 px-1.5 text-[10px] font-medium tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: P.length })
2362
+ /* @__PURE__ */ e("span", { className: "truncate", children: (u == null ? void 0 : u.label) ?? c }),
2363
+ /* @__PURE__ */ e("span", { className: "rounded-full bg-slate-100 px-1.5 text-[10px] font-medium tabular-nums text-slate-500 dark:bg-muted dark:text-slate-400", children: L.length })
2313
2364
  ] }),
2314
- P.slice(0, 5).map((q) => /* @__PURE__ */ a(
2365
+ L.slice(0, 5).map((Z) => /* @__PURE__ */ a(
2315
2366
  "button",
2316
2367
  {
2317
2368
  type: "button",
2318
- disabled: !x,
2369
+ disabled: !u,
2319
2370
  onClick: () => {
2320
- x && s(x, { around: q.parent_id ?? q.id });
2371
+ u && s(u, { around: Z.parent_id ?? Z.id });
2321
2372
  },
2322
2373
  className: "flex w-full flex-col gap-0.5 rounded-lg px-2.5 py-1.5 text-left transition-colors hover:bg-slate-50 disabled:cursor-default dark:hover:bg-muted/50",
2323
- "data-chat-search-hit": q.id,
2374
+ "data-chat-search-hit": Z.id,
2324
2375
  children: [
2325
2376
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5 text-[10.5px] text-slate-400", children: [
2326
- /* @__PURE__ */ e("span", { className: "truncate", children: q.sender_name ?? "Someone" }),
2327
- /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(q.date_created).toLocaleDateString() })
2377
+ /* @__PURE__ */ e("span", { className: "truncate", children: Z.sender_name ?? "Someone" }),
2378
+ /* @__PURE__ */ e("span", { className: "ml-auto shrink-0", children: new Date(Z.date_created).toLocaleDateString() })
2328
2379
  ] }),
2329
- /* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: q.message })
2380
+ /* @__PURE__ */ e("span", { className: "line-clamp-2 text-[12px] text-slate-700 dark:text-slate-200", children: Z.message })
2330
2381
  ]
2331
2382
  },
2332
- q.id
2383
+ Z.id
2333
2384
  )),
2334
- P.length > 5 && x && /* @__PURE__ */ a(
2385
+ L.length > 5 && u && /* @__PURE__ */ a(
2335
2386
  "button",
2336
2387
  {
2337
2388
  type: "button",
2338
- onClick: () => g.setFilters({ ...g.filters, room: w }),
2339
- className: b("px-2.5 py-0.5 text-[11px] font-medium", d.accentText),
2389
+ onClick: () => v.setFilters({ ...v.filters, room: c }),
2390
+ className: g("px-2.5 py-0.5 text-[11px] font-medium", m.accentText),
2340
2391
  children: [
2341
2392
  "All ",
2342
- P.length,
2393
+ L.length,
2343
2394
  " in ",
2344
- x.label
2395
+ u.label
2345
2396
  ]
2346
2397
  }
2347
2398
  )
2348
- ] }, w);
2349
- })
2399
+ ] }, c);
2400
+ }),
2401
+ !A && q === "words" && /* @__PURE__ */ e(
2402
+ "p",
2403
+ {
2404
+ className: "px-2.5 pb-1 pt-1.5 text-[10.5px] leading-snug text-slate-400",
2405
+ "data-chat-search-meaning": "words",
2406
+ children: "Only messages that share words with your search are found. Matching by meaning needs an embedding model, which an admin can choose under Settings → AI Features."
2407
+ }
2408
+ )
2350
2409
  ] }),
2351
2410
  r && !o && n.length === 0 && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-[12px] leading-relaxed text-slate-400", children: "Nothing archived. Archiving is just for you: the conversation leaves your chat list and stops alerting you, while everyone else in it carries on as before. Archive from a room's header or its row in your chat list; writing in it again brings it back." }),
2352
2411
  r && o && /* @__PURE__ */ e("p", { className: "px-3 py-3 text-[12px] text-slate-400", children: "Loading…" }),
2353
- !r && $.bot_name && $.bot_user_id && c.me && /* @__PURE__ */ a(
2412
+ !r && $.bot_name && $.bot_user_id && d.me && /* @__PURE__ */ a(
2354
2413
  "button",
2355
2414
  {
2356
2415
  type: "button",
2357
2416
  onClick: () => s({
2358
- room: Ut(c.me.id, $.bot_user_id),
2417
+ room: Ut(d.me.id, $.bot_user_id),
2359
2418
  label: `@${$.bot_name}`,
2360
2419
  kind: "dm",
2361
2420
  lastMessage: null,
@@ -2371,9 +2430,9 @@ function Wn({
2371
2430
  /* @__PURE__ */ e(
2372
2431
  "span",
2373
2432
  {
2374
- className: b(
2433
+ className: g(
2375
2434
  "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg text-[13px] font-bold",
2376
- d.accentSoft
2435
+ m.accentSoft
2377
2436
  ),
2378
2437
  children: "@"
2379
2438
  }
@@ -2389,53 +2448,53 @@ function Wn({
2389
2448
  }
2390
2449
  ),
2391
2450
  [
2392
- ["Starred", de.filter((w) => w.starred)],
2451
+ ["Starred", se.filter((c) => c.starred)],
2393
2452
  [
2394
2453
  "Channels",
2395
- de.filter(
2396
- (w) => !w.starred && (w.kind === "global" || w.kind === "channel") && !A(w)
2454
+ se.filter(
2455
+ (c) => !c.starred && (c.kind === "global" || c.kind === "channel") && !de(c)
2397
2456
  )
2398
2457
  ],
2399
2458
  [
2400
2459
  "Direct messages",
2401
- de.filter((w) => !w.starred && (w.kind === "dm" || A(w)))
2460
+ se.filter((c) => !c.starred && (c.kind === "dm" || de(c)))
2402
2461
  ],
2403
- ["Records", de.filter((w) => !w.starred && w.kind === "entity")]
2462
+ ["Records", se.filter((c) => !c.starred && c.kind === "entity")]
2404
2463
  ].map(
2405
- ([w, P]) => P.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mb-1.5", children: [
2406
- /* @__PURE__ */ e("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: w }),
2407
- P.map((x) => {
2408
- var q, ve, Se, ue, Oe, ye;
2464
+ ([c, L]) => L.length === 0 ? null : /* @__PURE__ */ a("div", { className: "mb-1.5", children: [
2465
+ /* @__PURE__ */ e("p", { className: "px-2.5 pb-1 pt-2 text-[10px] font-semibold uppercase tracking-[0.08em] text-slate-400", children: c }),
2466
+ L.map((u) => {
2467
+ var Z, Se, pe, Oe, ke, Te;
2409
2468
  return /* @__PURE__ */ a("div", { className: "group/room relative", children: [
2410
2469
  /* @__PURE__ */ a(
2411
2470
  "button",
2412
2471
  {
2413
2472
  type: "button",
2414
- onClick: () => s(x),
2473
+ onClick: () => s(u),
2415
2474
  className: "flex w-full items-center gap-3 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
2416
2475
  children: [
2417
2476
  (() => {
2418
- const ke = x.kind === "dm" && c.me ? Ne(x.room, c.me.id) : null;
2419
- if (!ke) return null;
2420
- const $e = U.get(ke.toUpperCase()) ?? "offline";
2421
- return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": $e, children: /* @__PURE__ */ e(Z, { id: ke, name: x.label, size: 32 }) });
2477
+ const we = u.kind === "dm" && d.me ? Ce(u.room, d.me.id) : null;
2478
+ if (!we) return null;
2479
+ const k = U.get(we.toUpperCase()) ?? "offline";
2480
+ return /* @__PURE__ */ e("span", { className: "relative shrink-0", "data-chat-room-avatar": k, children: /* @__PURE__ */ e(Y, { id: we, name: u.label, size: 32 }) });
2422
2481
  })(),
2423
- x.kind === "channel" && !((q = x.channel) != null && q.is_direct) || x.kind === "global" && ((ve = x.channel) != null && ve.icon || (Se = x.channel) != null && Se.color) ? /* @__PURE__ */ e(Ke, { icon: (ue = x.channel) == null ? void 0 : ue.icon, color: (Oe = x.channel) == null ? void 0 : Oe.color, size: 32 }) : /* @__PURE__ */ e(
2482
+ u.kind === "channel" && !((Z = u.channel) != null && Z.is_direct) || u.kind === "global" && ((Se = u.channel) != null && Se.icon || (pe = u.channel) != null && pe.color) ? /* @__PURE__ */ e(Ke, { icon: (Oe = u.channel) == null ? void 0 : Oe.icon, color: (ke = u.channel) == null ? void 0 : ke.color, size: 32 }) : /* @__PURE__ */ e(
2424
2483
  "span",
2425
2484
  {
2426
- className: b(
2485
+ className: g(
2427
2486
  "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-slate-100 text-slate-500 dark:bg-muted dark:text-slate-400",
2428
- x.kind === "dm" && c.me && Ne(x.room, c.me.id) && "hidden"
2487
+ u.kind === "dm" && d.me && Ce(u.room, d.me.id) && "hidden"
2429
2488
  ),
2430
- children: x.kind === "dm" ? /* @__PURE__ */ e(zn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (ye = x.channel) != null && ye.is_direct ? /* @__PURE__ */ e(Tt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(_t, { className: "h-4 w-4", strokeWidth: 1.8 })
2489
+ children: u.kind === "dm" ? /* @__PURE__ */ e(zn, { className: "h-4 w-4", strokeWidth: 1.8 }) : (Te = u.channel) != null && Te.is_direct ? /* @__PURE__ */ e(Tt, { className: "h-4 w-4", strokeWidth: 1.8 }) : /* @__PURE__ */ e(_t, { className: "h-4 w-4", strokeWidth: 1.8 })
2431
2490
  }
2432
2491
  ),
2433
2492
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2434
2493
  /* @__PURE__ */ a("span", { className: "flex items-center gap-1.5", children: [
2435
- /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: x.label }),
2436
- x.muted && /* @__PURE__ */ e(Tn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
2437
- /* @__PURE__ */ e(wr, { count: C.countFor(x.room), label: x.label }),
2438
- V.has(x.room) && /* @__PURE__ */ e(
2494
+ /* @__PURE__ */ e("span", { className: "truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: u.label }),
2495
+ u.muted && /* @__PURE__ */ e(Tn, { className: "h-3 w-3 shrink-0 text-slate-300", strokeWidth: 2 }),
2496
+ /* @__PURE__ */ e(wr, { count: C.countFor(u.room), label: u.label }),
2497
+ te.has(u.room) && /* @__PURE__ */ e(
2439
2498
  Ya,
2440
2499
  {
2441
2500
  className: "h-3 w-3 shrink-0 text-slate-400",
@@ -2446,30 +2505,30 @@ function Wn({
2446
2505
  }
2447
2506
  )
2448
2507
  ] }),
2449
- x.lastMessage && /* @__PURE__ */ a("span", { className: "block truncate text-[11px] text-slate-400", children: [
2450
- x.lastMessage.sender_name ? `${x.lastMessage.sender_name}: ` : "",
2451
- x.lastMessage.message
2508
+ u.lastMessage && /* @__PURE__ */ a("span", { className: "block truncate text-[11px] text-slate-400", children: [
2509
+ u.lastMessage.sender_name ? `${u.lastMessage.sender_name}: ` : "",
2510
+ u.lastMessage.message
2452
2511
  ] })
2453
2512
  ] }),
2454
- (x.mentions ?? 0) > 0 && /* @__PURE__ */ e(
2513
+ (u.mentions ?? 0) > 0 && /* @__PURE__ */ e(
2455
2514
  "span",
2456
2515
  {
2457
2516
  className: "flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white",
2458
- title: `${x.mentions} mention you`,
2459
- "data-chat-room-mentions": x.mentions,
2517
+ title: `${u.mentions} mention you`,
2518
+ "data-chat-room-mentions": u.mentions,
2460
2519
  children: "@"
2461
2520
  }
2462
2521
  ),
2463
- x.unread > 0 && /* @__PURE__ */ e(
2522
+ u.unread > 0 && /* @__PURE__ */ e(
2464
2523
  "span",
2465
2524
  {
2466
- className: b(
2525
+ className: g(
2467
2526
  "flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-1.5 text-[10px] font-bold",
2468
2527
  // A muted room still counts, but quietly — it must not
2469
2528
  // read like something demanding attention.
2470
- x.muted ? "bg-slate-100 text-slate-400 dark:bg-muted dark:text-slate-500" : d.pill
2529
+ u.muted ? "bg-slate-100 text-slate-400 dark:bg-muted dark:text-slate-500" : m.pill
2471
2530
  ),
2472
- children: x.unread > 99 ? "99+" : x.unread
2531
+ children: u.unread > 99 ? "99+" : u.unread
2473
2532
  }
2474
2533
  )
2475
2534
  ]
@@ -2480,26 +2539,26 @@ function Wn({
2480
2539
  "button",
2481
2540
  {
2482
2541
  type: "button",
2483
- title: x.starred ? "Unstar" : "Star — keep it at the top",
2484
- "aria-label": x.starred ? `Unstar ${x.label}` : `Star ${x.label}`,
2485
- onClick: () => p.mutate({ room: x.room, starred: !x.starred }),
2542
+ title: u.starred ? "Unstar" : "Star — keep it at the top",
2543
+ "aria-label": u.starred ? `Unstar ${u.label}` : `Star ${u.label}`,
2544
+ onClick: () => x.mutate({ room: u.room, starred: !u.starred }),
2486
2545
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
2487
- "data-chat-row-star": x.starred ? "on" : "off",
2546
+ "data-chat-row-star": u.starred ? "on" : "off",
2488
2547
  children: /* @__PURE__ */ e(
2489
2548
  Za,
2490
2549
  {
2491
- className: b("h-3 w-3", x.starred && "fill-amber-400 text-amber-500")
2550
+ className: g("h-3 w-3", u.starred && "fill-amber-400 text-amber-500")
2492
2551
  }
2493
2552
  )
2494
2553
  }
2495
2554
  ),
2496
- ma(x) && /* @__PURE__ */ e(
2555
+ ma(u) && /* @__PURE__ */ e(
2497
2556
  "button",
2498
2557
  {
2499
2558
  type: "button",
2500
2559
  title: r ? "Unarchive — back to your chats" : "Archive for me — hides it from my list and stops my alerts. Others in the conversation are not affected.",
2501
- "aria-label": r ? `Unarchive ${x.label}` : `Archive ${x.label} for me`,
2502
- onClick: () => u.mutate({ room: x.room, archived: !r }),
2560
+ "aria-label": r ? `Unarchive ${u.label}` : `Archive ${u.label} for me`,
2561
+ onClick: () => p.mutate({ room: u.room, archived: !r }),
2503
2562
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
2504
2563
  "data-chat-row-archive": r ? "unarchive" : "archive",
2505
2564
  children: r ? /* @__PURE__ */ e(Va, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Xa, { className: "h-3 w-3" })
@@ -2509,28 +2568,28 @@ function Wn({
2509
2568
  "button",
2510
2569
  {
2511
2570
  type: "button",
2512
- title: x.muted ? "Unmute" : "Mute",
2513
- onClick: () => h.mutate({ room: x.room, muted: !x.muted }),
2571
+ title: u.muted ? "Unmute" : "Mute",
2572
+ onClick: () => b.mutate({ room: u.room, muted: !u.muted }),
2514
2573
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
2515
- children: x.muted ? /* @__PURE__ */ e(es, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Tn, { className: "h-3 w-3" })
2574
+ children: u.muted ? /* @__PURE__ */ e(es, { className: "h-3 w-3" }) : /* @__PURE__ */ e(Tn, { className: "h-3 w-3" })
2516
2575
  }
2517
2576
  ),
2518
- (x.kind === "channel" || x.kind === "global" || x.kind === "entity") && x.joined && /* @__PURE__ */ e(
2577
+ (u.kind === "channel" || u.kind === "global" || u.kind === "entity") && u.joined && /* @__PURE__ */ e(
2519
2578
  "button",
2520
2579
  {
2521
2580
  type: "button",
2522
- title: x.kind === "global" ? "Leave General" : x.kind === "entity" ? "Leave this record's chat — open it from the record again to rejoin" : "Leave channel",
2523
- "aria-label": `Leave ${x.label}`,
2581
+ title: u.kind === "global" ? "Leave General" : u.kind === "entity" ? "Leave this record's chat — open it from the record again to rejoin" : "Leave channel",
2582
+ "aria-label": `Leave ${u.label}`,
2524
2583
  "data-chat-row-leave": !0,
2525
- onClick: () => f.mutate(x.room),
2584
+ onClick: () => f.mutate(u.room),
2526
2585
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
2527
2586
  children: /* @__PURE__ */ e(ts, { className: "h-3 w-3" })
2528
2587
  }
2529
2588
  )
2530
2589
  ] })
2531
- ] }, x.room);
2590
+ ] }, u.room);
2532
2591
  })
2533
- ] }, w)
2592
+ ] }, c)
2534
2593
  )
2535
2594
  ] });
2536
2595
  }
@@ -2540,15 +2599,15 @@ function uo({
2540
2599
  onBack: l,
2541
2600
  onOpen: r
2542
2601
  }) {
2543
- const o = ie();
2602
+ const o = ce();
2544
2603
  return n === "mentions" ? /* @__PURE__ */ e(Qn, { th: o, onBack: l, onOpen: r }) : n === "scheduled" ? /* @__PURE__ */ e(
2545
2604
  Kn,
2546
2605
  {
2547
2606
  th: o,
2548
2607
  onBack: l,
2549
2608
  roomLabel: (i) => {
2550
- var d;
2551
- return ((d = s.find((c) => c.room === i)) == null ? void 0 : d.label) ?? i;
2609
+ var m;
2610
+ return ((m = s.find((d) => d.room === i)) == null ? void 0 : m.label) ?? i;
2552
2611
  }
2553
2612
  }
2554
2613
  ) : /* @__PURE__ */ e(Jn, { rooms: s, th: o, onBack: l, onOpen: r });
@@ -2556,10 +2615,10 @@ function uo({
2556
2615
  function ll({
2557
2616
  onOpen: n
2558
2617
  }) {
2559
- const s = ie(), [l, r] = T(""), [o, i] = T(!1), [d, c] = T(""), [h, f] = T("open"), [u, p] = T(""), [g, U] = T({
2618
+ const s = ce(), [l, r] = T(""), [o, i] = T(!1), [m, d] = T(""), [b, f] = T("open"), [p, x] = T(""), [v, U] = T({
2560
2619
  icon: null,
2561
2620
  color: null
2562
- }), $ = Zn(), { channels: C, loading: S } = zs(l), { join: W } = It(), M = Hs();
2621
+ }), $ = Zn(), { channels: C, loading: S } = zs(l), { join: E } = It(), R = Hs();
2563
2622
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col", "data-chat-directory": !0, children: [
2564
2623
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2 p-2", children: [
2565
2624
  /* @__PURE__ */ a("div", { className: "relative flex-1", children: [
@@ -2568,9 +2627,9 @@ function ll({
2568
2627
  "input",
2569
2628
  {
2570
2629
  value: l,
2571
- onChange: (v) => r(v.target.value),
2630
+ onChange: (y) => r(y.target.value),
2572
2631
  placeholder: "Search channels…",
2573
- className: b("h-8 w-full rounded-md pl-8 pr-2 text-[12.5px] outline-none", s.input)
2632
+ className: g("h-8 w-full rounded-md pl-8 pr-2 text-[12.5px] outline-none", s.input)
2574
2633
  }
2575
2634
  )
2576
2635
  ] }),
@@ -2578,8 +2637,8 @@ function ll({
2578
2637
  "button",
2579
2638
  {
2580
2639
  type: "button",
2581
- onClick: () => i((v) => !v),
2582
- className: b(
2640
+ onClick: () => i((y) => !y),
2641
+ className: g(
2583
2642
  "flex h-8 shrink-0 items-center gap-1 rounded-md px-2.5 text-[12px] font-medium",
2584
2643
  s.action
2585
2644
  ),
@@ -2594,80 +2653,80 @@ function ll({
2594
2653
  "form",
2595
2654
  {
2596
2655
  className: "flex flex-col gap-2 border-b border-slate-100 p-2 dark:border-border/60",
2597
- onSubmit: (v) => {
2598
- v.preventDefault(), d.trim() && (h === "role" && !u || M.mutate(
2656
+ onSubmit: (y) => {
2657
+ y.preventDefault(), m.trim() && (b === "role" && !p || R.mutate(
2599
2658
  {
2600
- name: d.trim(),
2601
- visibility: h,
2602
- role: h === "role" ? u : null,
2603
- icon: g.icon,
2604
- color: g.color
2659
+ name: m.trim(),
2660
+ visibility: b,
2661
+ role: b === "role" ? p : null,
2662
+ icon: v.icon,
2663
+ color: v.color
2605
2664
  },
2606
2665
  {
2607
2666
  onSuccess: () => {
2608
- c(""), U({ icon: null, color: null }), i(!1);
2667
+ d(""), U({ icon: null, color: null }), i(!1);
2609
2668
  }
2610
2669
  }
2611
2670
  ));
2612
2671
  },
2613
2672
  children: [
2614
2673
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2615
- /* @__PURE__ */ e(Ke, { icon: g.icon, color: g.color, size: 32 }),
2674
+ /* @__PURE__ */ e(Ke, { icon: v.icon, color: v.color, size: 32 }),
2616
2675
  /* @__PURE__ */ e(
2617
2676
  "input",
2618
2677
  {
2619
- value: d,
2620
- onChange: (v) => c(v.target.value),
2678
+ value: m,
2679
+ onChange: (y) => d(y.target.value),
2621
2680
  placeholder: "Channel name",
2622
- className: b(
2681
+ className: g(
2623
2682
  "h-8 min-w-0 flex-1 rounded-md px-2 text-[12.5px] outline-none",
2624
2683
  s.input
2625
2684
  )
2626
2685
  }
2627
2686
  )
2628
2687
  ] }),
2629
- /* @__PURE__ */ e(Gn, { icon: g.icon, color: g.color, onChange: U }),
2688
+ /* @__PURE__ */ e(Gn, { icon: v.icon, color: v.color, onChange: U }),
2630
2689
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2631
2690
  [
2632
2691
  ["open", "Anyone"],
2633
2692
  ["role", "One role"],
2634
2693
  ["private", "Invite only"]
2635
- ].map(([v, B]) => /* @__PURE__ */ e(
2694
+ ].map(([y, q]) => /* @__PURE__ */ e(
2636
2695
  "button",
2637
2696
  {
2638
2697
  type: "button",
2639
- onClick: () => f(v),
2640
- className: b(
2698
+ onClick: () => f(y),
2699
+ className: g(
2641
2700
  "rounded-md px-2 py-1 text-[11.5px] font-medium transition-colors",
2642
- h === v ? s.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2701
+ b === y ? s.accentSoft : "text-slate-500 hover:bg-slate-100 dark:hover:bg-muted"
2643
2702
  ),
2644
- children: B
2703
+ children: q
2645
2704
  },
2646
- v
2705
+ y
2647
2706
  )),
2648
2707
  /* @__PURE__ */ e(
2649
2708
  "button",
2650
2709
  {
2651
2710
  type: "submit",
2652
- disabled: !d.trim() || M.isPending || h === "role" && !u,
2653
- className: b("ml-auto rounded-md px-2.5 py-1 text-[12px] font-medium", s.action),
2654
- children: M.isPending ? "Creating…" : "Create"
2711
+ disabled: !m.trim() || R.isPending || b === "role" && !p,
2712
+ className: g("ml-auto rounded-md px-2.5 py-1 text-[12px] font-medium", s.action),
2713
+ children: R.isPending ? "Creating…" : "Create"
2655
2714
  }
2656
2715
  )
2657
2716
  ] }),
2658
- h === "role" && /* @__PURE__ */ e(
2717
+ b === "role" && /* @__PURE__ */ e(
2659
2718
  Lt,
2660
2719
  {
2661
- value: u,
2662
- onChange: p,
2663
- className: b("h-8 w-auto rounded-md px-2 text-[12.5px] outline-none", s.input),
2720
+ value: p,
2721
+ onChange: x,
2722
+ className: g("h-8 w-auto rounded-md px-2 text-[12.5px] outline-none", s.input),
2664
2723
  options: [
2665
2724
  { value: "", label: "Choose a role…" },
2666
- ...$.map((v) => ({ value: v.id, label: v.name }))
2725
+ ...$.map((y) => ({ value: y.id, label: y.name }))
2667
2726
  ]
2668
2727
  }
2669
2728
  ),
2670
- M.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: M.error.message })
2729
+ R.isError && /* @__PURE__ */ e("p", { className: "text-[11.5px] text-red-500", children: R.error.message })
2671
2730
  ]
2672
2731
  }
2673
2732
  ),
@@ -2678,7 +2737,7 @@ function ll({
2678
2737
  /* @__PURE__ */ e("p", { className: "mt-2 text-[12.5px] font-medium text-slate-600 dark:text-slate-300", children: l ? `No channel matches “${l}”` : "No channels yet" }),
2679
2738
  /* @__PURE__ */ e("p", { className: "mt-1 text-[11.5px] leading-relaxed text-slate-400", children: "Channels and General are shared rooms you join to follow. Record conversations appear on their own once someone posts on a record." })
2680
2739
  ] }),
2681
- C.map((v) => /* @__PURE__ */ a(
2740
+ C.map((y) => /* @__PURE__ */ a(
2682
2741
  "div",
2683
2742
  {
2684
2743
  className: "flex items-center gap-2.5 rounded-lg px-2.5 py-2 hover:bg-slate-50 dark:hover:bg-muted/50",
@@ -2686,21 +2745,21 @@ function ll({
2686
2745
  /* @__PURE__ */ e(
2687
2746
  Ke,
2688
2747
  {
2689
- icon: v.icon,
2690
- color: v.color,
2748
+ icon: y.icon,
2749
+ color: y.color,
2691
2750
  size: 32,
2692
- fallback: v.visibility === "private" ? Fa : _t
2751
+ fallback: y.visibility === "private" ? Fa : _t
2693
2752
  }
2694
2753
  ),
2695
2754
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
2696
- /* @__PURE__ */ e("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: v.name }),
2697
- /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: v.topic || `${v.members} member${v.members === 1 ? "" : "s"}` })
2755
+ /* @__PURE__ */ e("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: y.name }),
2756
+ /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: y.topic || `${y.members} member${y.members === 1 ? "" : "s"}` })
2698
2757
  ] }),
2699
- v.joined ? /* @__PURE__ */ e(
2758
+ y.joined ? /* @__PURE__ */ e(
2700
2759
  "button",
2701
2760
  {
2702
2761
  type: "button",
2703
- onClick: () => n(v.room, v.name, qn(v)),
2762
+ onClick: () => n(y.room, y.name, qn(y)),
2704
2763
  className: "shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium text-slate-500 hover:bg-slate-100 dark:hover:bg-muted",
2705
2764
  children: "Open"
2706
2765
  }
@@ -2708,16 +2767,16 @@ function ll({
2708
2767
  "button",
2709
2768
  {
2710
2769
  type: "button",
2711
- onClick: () => W.mutate(v.room, {
2712
- onSuccess: () => n(v.room, v.name, qn(v))
2770
+ onClick: () => E.mutate(y.room, {
2771
+ onSuccess: () => n(y.room, y.name, qn(y))
2713
2772
  }),
2714
- className: b("shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium", s.action),
2773
+ className: g("shrink-0 rounded-md px-2 py-1 text-[11.5px] font-medium", s.action),
2715
2774
  children: "Join"
2716
2775
  }
2717
2776
  )
2718
2777
  ]
2719
2778
  },
2720
- v.key
2779
+ y.key
2721
2780
  ))
2722
2781
  ] })
2723
2782
  ] });
@@ -2727,11 +2786,11 @@ function ol() {
2727
2786
  return n.setHours(23, 59, 59, 999), n;
2728
2787
  }
2729
2788
  function il() {
2730
- const n = Pt(), s = Yn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), d = (h) => {
2789
+ const n = Pt(), s = Yn(), [l, r] = T(!1), o = n.presence_override, i = !!o && o.mode === "away" && !(o.until && new Date(o.until).getTime() < Date.now()), m = (b) => {
2731
2790
  s.mutate({
2732
- presence_override: h === "off" ? null : { mode: "away", until: (h == null ? void 0 : h.toISOString()) ?? null }
2791
+ presence_override: b === "off" ? null : { mode: "away", until: (b == null ? void 0 : b.toISOString()) ?? null }
2733
2792
  }), r(!1);
2734
- }, c = i && (o != null && o.until) ? `until ${new Date(o.until).toLocaleString("en-US", {
2793
+ }, d = i && (o != null && o.until) ? `until ${new Date(o.until).toLocaleString("en-US", {
2735
2794
  weekday: "short",
2736
2795
  hour: "numeric",
2737
2796
  minute: "2-digit",
@@ -2746,19 +2805,19 @@ function il() {
2746
2805
  /* @__PURE__ */ e(
2747
2806
  "span",
2748
2807
  {
2749
- className: b(
2808
+ className: g(
2750
2809
  "h-2.5 w-2.5 shrink-0 rounded-full border-2",
2751
2810
  i ? "border-amber-400 bg-white dark:bg-card" : "border-emerald-400 bg-emerald-400"
2752
2811
  ),
2753
2812
  "aria-hidden": !0
2754
2813
  }
2755
2814
  ),
2756
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: i ? `Appearing away ${c}` : "You appear online" }),
2815
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-slate-600 dark:text-slate-300", children: i ? `Appearing away ${d}` : "You appear online" }),
2757
2816
  i ? /* @__PURE__ */ e(
2758
2817
  "button",
2759
2818
  {
2760
2819
  type: "button",
2761
- onClick: () => d("off"),
2820
+ onClick: () => m("off"),
2762
2821
  className: "shrink-0 rounded px-1.5 py-0.5 text-[11px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
2763
2822
  "data-chat-appear-away-off": !0,
2764
2823
  children: "Back online"
@@ -2780,16 +2839,16 @@ function il() {
2780
2839
  ["4 hours", () => new Date(Date.now() + 4 * 36e5)],
2781
2840
  ["The rest of today", ol],
2782
2841
  ["Until I switch it off", () => null]
2783
- ].map(([h, f]) => /* @__PURE__ */ e(
2842
+ ].map(([b, f]) => /* @__PURE__ */ e(
2784
2843
  "button",
2785
2844
  {
2786
2845
  type: "button",
2787
- onClick: () => d(f()),
2846
+ onClick: () => m(f()),
2788
2847
  className: "flex w-full rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
2789
- "data-chat-appear-away-option": h,
2790
- children: h
2848
+ "data-chat-appear-away-option": b,
2849
+ children: b
2791
2850
  },
2792
- h
2851
+ b
2793
2852
  ))
2794
2853
  ] })
2795
2854
  ] })
@@ -2798,7 +2857,7 @@ function il() {
2798
2857
  );
2799
2858
  }
2800
2859
  function cl({ myStatus: n }) {
2801
- const s = ie();
2860
+ const s = ce();
2802
2861
  return /* @__PURE__ */ e(
2803
2862
  Ts,
2804
2863
  {
@@ -2809,24 +2868,24 @@ function cl({ myStatus: n }) {
2809
2868
  );
2810
2869
  }
2811
2870
  function pa() {
2812
- var i, d, c;
2813
- const n = Je(), s = Cs(15e3), { data: l, isFetched: r } = Ce({
2871
+ var i, m, d;
2872
+ const n = Je(), s = Cs(15e3), { data: l, isFetched: r } = _e({
2814
2873
  queryKey: ["presence-online"],
2815
- queryFn: () => n.request(xe("/presence/online")),
2874
+ queryFn: () => n.request(ge("/presence/online")),
2816
2875
  // Matches the presence heartbeat cadence without a live socket — the page someone is on
2817
2876
  // should track them around the app. Live, presence:changed carries it and this is 60 s.
2818
2877
  refetchInterval: s,
2819
2878
  staleTime: 5e3
2820
2879
  });
2821
2880
  return {
2822
- byUser: fe(() => {
2823
- const h = /* @__PURE__ */ new Map();
2824
- for (const f of (l == null ? void 0 : l.data) ?? []) h.set(String(f.user_id).toUpperCase(), f);
2825
- return h;
2881
+ byUser: be(() => {
2882
+ const b = /* @__PURE__ */ new Map();
2883
+ for (const f of (l == null ? void 0 : l.data) ?? []) b.set(String(f.user_id).toUpperCase(), f);
2884
+ return b;
2826
2885
  }, [l]),
2827
2886
  fields: ((i = l == null ? void 0 : l.config) == null ? void 0 : i.fields) ?? ["role", "page"],
2828
- adminUrl: ((d = l == null ? void 0 : l.config) == null ? void 0 : d.admin_url) ?? null,
2829
- dimensions: ((c = l == null ? void 0 : l.config) == null ? void 0 : c.dimensions) ?? [],
2887
+ adminUrl: ((m = l == null ? void 0 : l.config) == null ? void 0 : m.admin_url) ?? null,
2888
+ dimensions: ((d = l == null ? void 0 : l.config) == null ? void 0 : d.dimensions) ?? [],
2830
2889
  loaded: r
2831
2890
  };
2832
2891
  }
@@ -2835,13 +2894,13 @@ function ha(n) {
2835
2894
  const s = n.split("/").filter(Boolean);
2836
2895
  if (s.length === 0) return "Home";
2837
2896
  const l = /* @__PURE__ */ new Set(["records", "collections", "p"]), r = s.filter((o) => !l.has(o));
2838
- return r.length === 0 ? "Home" : r.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (d) => d.toUpperCase()) : o).join(" › ");
2897
+ return r.length === 0 ? "Home" : r.map((o, i) => i === 0 ? o.replace(/[-_]/g, " ").replace(/\b\w/g, (m) => m.toUpperCase()) : o).join(" › ");
2839
2898
  }
2840
2899
  function dl({
2841
2900
  onClose: n,
2842
2901
  onCreated: s
2843
2902
  }) {
2844
- const l = ie(), [r, o] = T(""), [i, d] = T(""), [c, h] = T(/* @__PURE__ */ new Map()), { users: f } = qt(r, !0), u = dr(), p = (g) => [g.first_name, g.last_name].filter(Boolean).join(" ") || (g.email ?? "Unknown");
2903
+ const l = ce(), [r, o] = T(""), [i, m] = T(""), [d, b] = T(/* @__PURE__ */ new Map()), { users: f } = qt(r, !0), p = dr(), x = (v) => [v.first_name, v.last_name].filter(Boolean).join(" ") || (v.email ?? "Unknown");
2845
2904
  return /* @__PURE__ */ a("div", { className: "flex min-h-0 flex-1 flex-col p-3", "data-chat-group-dialog": !0, children: [
2846
2905
  /* @__PURE__ */ a("div", { className: "mb-2 flex items-center gap-2", children: [
2847
2906
  /* @__PURE__ */ e(
@@ -2856,10 +2915,10 @@ function dl({
2856
2915
  ),
2857
2916
  /* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: "New group conversation" })
2858
2917
  ] }),
2859
- c.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...c.entries()].map(([g, U]) => /* @__PURE__ */ a(
2918
+ d.size > 0 && /* @__PURE__ */ e("div", { className: "mb-2 flex flex-wrap gap-1", children: [...d.entries()].map(([v, U]) => /* @__PURE__ */ a(
2860
2919
  "span",
2861
2920
  {
2862
- className: b(
2921
+ className: g(
2863
2922
  "inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-medium",
2864
2923
  l.accentSoft
2865
2924
  ),
@@ -2869,9 +2928,9 @@ function dl({
2869
2928
  "button",
2870
2929
  {
2871
2930
  type: "button",
2872
- onClick: () => h(($) => {
2931
+ onClick: () => b(($) => {
2873
2932
  const C = new Map($);
2874
- return C.delete(g), C;
2933
+ return C.delete(v), C;
2875
2934
  }),
2876
2935
  "aria-label": `Remove ${U}`,
2877
2936
  children: /* @__PURE__ */ e(dt, { className: "h-3 w-3" })
@@ -2879,49 +2938,49 @@ function dl({
2879
2938
  )
2880
2939
  ]
2881
2940
  },
2882
- g
2941
+ v
2883
2942
  )) }),
2884
2943
  /* @__PURE__ */ e(
2885
2944
  "input",
2886
2945
  {
2887
2946
  value: r,
2888
- onChange: (g) => o(g.target.value),
2947
+ onChange: (v) => o(v.target.value),
2889
2948
  placeholder: "Find people…",
2890
- className: b("mb-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none", l.input),
2949
+ className: g("mb-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none", l.input),
2891
2950
  "aria-label": "Find people",
2892
2951
  autoFocus: !0
2893
2952
  }
2894
2953
  ),
2895
- /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((g) => {
2896
- const U = c.has(g.id);
2954
+ /* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto", children: f.map((v) => {
2955
+ const U = d.has(v.id);
2897
2956
  return /* @__PURE__ */ a(
2898
2957
  "button",
2899
2958
  {
2900
2959
  type: "button",
2901
- onClick: () => h(($) => {
2960
+ onClick: () => b(($) => {
2902
2961
  const C = new Map($);
2903
- return U ? C.delete(g.id) : C.set(g.id, p(g)), C;
2962
+ return U ? C.delete(v.id) : C.set(v.id, x(v)), C;
2904
2963
  }),
2905
- className: b(
2964
+ className: g(
2906
2965
  "flex w-full items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[12.5px] transition-colors",
2907
2966
  U ? l.accentSoft : "hover:bg-slate-50 dark:hover:bg-muted/50"
2908
2967
  ),
2909
2968
  children: [
2910
- /* @__PURE__ */ e(Z, { id: g.id, name: p(g), size: 22 }),
2911
- /* @__PURE__ */ e("span", { className: "truncate", children: p(g) }),
2912
- U && /* @__PURE__ */ e(At, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
2969
+ /* @__PURE__ */ e(Y, { id: v.id, name: x(v), size: 22 }),
2970
+ /* @__PURE__ */ e("span", { className: "truncate", children: x(v) }),
2971
+ U && /* @__PURE__ */ e(Rt, { className: "ml-auto h-3.5 w-3.5 shrink-0" })
2913
2972
  ]
2914
2973
  },
2915
- g.id
2974
+ v.id
2916
2975
  );
2917
2976
  }) }),
2918
2977
  /* @__PURE__ */ e(
2919
2978
  "input",
2920
2979
  {
2921
2980
  value: i,
2922
- onChange: (g) => d(g.target.value),
2981
+ onChange: (v) => m(v.target.value),
2923
2982
  placeholder: "Group name (optional)",
2924
- className: b(
2983
+ className: g(
2925
2984
  "mb-2 mt-1.5 h-8 rounded-md border px-2.5 text-[12.5px] outline-none",
2926
2985
  l.input
2927
2986
  ),
@@ -2932,16 +2991,16 @@ function dl({
2932
2991
  "button",
2933
2992
  {
2934
2993
  type: "button",
2935
- disabled: c.size === 0 || u.isPending,
2936
- onClick: () => u.mutate(
2937
- { user_ids: [...c.keys()], name: i.trim() || void 0 },
2938
- { onSuccess: (g) => s(g.room, g.name) }
2994
+ disabled: d.size === 0 || p.isPending,
2995
+ onClick: () => p.mutate(
2996
+ { user_ids: [...d.keys()], name: i.trim() || void 0 },
2997
+ { onSuccess: (v) => s(v.room, v.name) }
2939
2998
  ),
2940
- className: b(
2999
+ className: g(
2941
3000
  "flex h-9 items-center justify-center rounded-lg text-[12.5px] font-semibold transition-[filter] hover:brightness-110 disabled:opacity-40",
2942
3001
  l.action
2943
3002
  ),
2944
- children: u.isPending ? "Creating…" : `Start conversation${c.size ? ` (${c.size + 1})` : ""}`
3003
+ children: p.isPending ? "Creating…" : `Start conversation${d.size ? ` (${d.size + 1})` : ""}`
2945
3004
  }
2946
3005
  )
2947
3006
  ] });
@@ -2961,7 +3020,7 @@ function ml() {
2961
3020
  return typeof window < "u" && !!((r = window.matchMedia) != null && r.call(window, n).matches);
2962
3021
  }
2963
3022
  );
2964
- return ae(() => {
3023
+ return ee(() => {
2965
3024
  var i;
2966
3025
  const r = (i = window.matchMedia) == null ? void 0 : i.call(window, n);
2967
3026
  if (!r) return;
@@ -2976,104 +3035,105 @@ function mo({
2976
3035
  requestedDm: r,
2977
3036
  requestedRoom: o
2978
3037
  }) {
2979
- var $e;
2980
- const i = Me(), d = ie(), c = i.me, [h, f] = T(ul), u = ml(), p = h && u, g = () => {
2981
- const k = !h;
3038
+ var we;
3039
+ const i = Me(), m = ce(), d = i.me, [b, f] = T(ul), p = ml(), x = b && p, v = () => {
3040
+ const k = !b;
2982
3041
  f(k);
2983
3042
  try {
2984
3043
  k ? window.localStorage.setItem($t, "1") : window.localStorage.removeItem($t);
2985
3044
  } catch {
2986
3045
  }
2987
3046
  };
2988
- ae(() => {
2989
- if (!n || !p) return;
2990
- const k = document.body, O = k.style.paddingRight;
3047
+ ee(() => {
3048
+ if (!n || !x) return;
3049
+ const k = document.body, M = k.style.paddingRight;
2991
3050
  k.style.paddingRight = `${Ct}px`, k.dataset.nvrChatPinned = "1";
2992
- const I = document.createElement("style");
2993
- return I.dataset.nvrChatPinnedStyle = "", I.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
2994
- body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, document.head.appendChild(I), () => {
2995
- k.style.paddingRight = O, delete k.dataset.nvrChatPinned, I.remove();
3051
+ const P = document.createElement("style");
3052
+ return P.dataset.nvrChatPinnedStyle = "", P.textContent = `body[data-nvr-chat-pinned] [data-sonner-toaster][data-x-position="right"],
3053
+ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, document.head.appendChild(P), () => {
3054
+ k.style.paddingRight = M, delete k.dataset.nvrChatPinned, P.remove();
2996
3055
  };
2997
- }, [n, p]);
2998
- const [U, $] = T("online"), [C, S] = T(null), [W, M] = T(null), v = (k, O, I) => {
2999
- const X = ee.find((Te) => Te.room === k);
3000
- H(!1), S({ room: k, label: (X == null ? void 0 : X.label) ?? O, channel: X == null ? void 0 : X.channel, anchor: I });
3001
- }, [B, R] = T(!1), [G, H] = T(!1), [V, se] = T(null), { rooms: ee, totalUnread: te } = ea(), be = ta(U === "archived"), de = (k, O, I) => {
3002
- var Te, _;
3003
- if (!O) return [{ key: "all", label: null, users: k }];
3004
- const X = /* @__PURE__ */ new Map();
3005
- for (const j of k) {
3006
- const E = I.get(String(j.user_id).toUpperCase()), ne = O === "__role__" ? [En((E == null ? void 0 : E.role_name) ?? j.role_name) || "No role"] : (_ = (Te = E == null ? void 0 : E.scopes_by_dimension) == null ? void 0 : Te[O]) != null && _.length ? E.scopes_by_dimension[O] : ["Unassigned"], K = [...new Set(ne)].sort((F, J) => F.localeCompare(J)).join(", ");
3007
- X.set(K, [...X.get(K) ?? [], j]);
3056
+ }, [n, x]);
3057
+ const [U, $] = T("online"), [C, S] = T(null), [E, R] = T(null), y = (k, M, P) => {
3058
+ const V = me.find((Ue) => Ue.room === k);
3059
+ z(!1), S({ room: k, label: (V == null ? void 0 : V.label) ?? M, channel: V == null ? void 0 : V.channel, anchor: P });
3060
+ }, [q, A] = T(!1), [F, z] = T(!1), [G, te] = T(null), { rooms: me, totalUnread: ne } = ea(), ae = ta(U === "archived"), le = (k, M, P) => {
3061
+ var Ue, _;
3062
+ if (!M) return [{ key: "all", label: null, users: k }];
3063
+ const V = /* @__PURE__ */ new Map();
3064
+ for (const I of k) {
3065
+ const j = P.get(String(I.user_id).toUpperCase()), X = M === "__role__" ? [En((j == null ? void 0 : j.role_name) ?? I.role_name) || "No role"] : (_ = (Ue = j == null ? void 0 : j.scopes_by_dimension) == null ? void 0 : Ue[M]) != null && _.length ? j.scopes_by_dimension[M] : ["Unassigned"], Q = [...new Set(X)].sort((B, K) => B.localeCompare(K)).join(", ");
3066
+ V.set(Q, [...V.get(Q) ?? [], I]);
3008
3067
  }
3009
- return [...X.entries()].sort((j, E) => j[0] === "Unassigned" ? 1 : E[0] === "Unassigned" ? -1 : j[0].localeCompare(E[0])).map(([j, E]) => ({ key: j, label: j, users: E }));
3010
- }, [A, w] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), P = pa(), x = P.loaded ? Gs(
3011
- i.onlineUsers.filter((k) => P.byUser.has(String(k.user_id).toUpperCase()))
3012
- ) : [], q = fe(
3013
- () => de(x, A, P.byUser),
3068
+ return [...V.entries()].sort((I, j) => I[0] === "Unassigned" ? 1 : j[0] === "Unassigned" ? -1 : I[0].localeCompare(j[0])).map(([I, j]) => ({ key: I, label: I, users: j }));
3069
+ }, [se, de] = T(() => typeof window > "u" ? "" : localStorage.getItem("nvr_chat_group_by") ?? ""), c = pa(), L = c.loaded ? Gs(
3070
+ i.onlineUsers.filter((k) => c.byUser.has(String(k.user_id).toUpperCase()))
3071
+ ) : [], u = be(
3072
+ () => le(L, se, c.byUser),
3014
3073
  // biome-ignore lint/correctness/useExhaustiveDependencies: builder is pure
3015
- [x, A, P.byUser]
3016
- ), { isAdmin: ve } = ut(), { navigate: Se } = vs(), ue = (k) => {
3074
+ [L, se, c.byUser]
3075
+ ), { isAdmin: Z } = ut(), { navigate: Se } = vs(), pe = (k) => {
3017
3076
  /^https?:\/\//i.test(k) ? window.open(k, "_blank", "noopener") : Se(k);
3018
3077
  }, Oe = (k) => {
3019
- c && ($("chat"), S({ room: Ut(c.id, k.user_id), label: k.display_name ?? "Direct message" }));
3020
- }, ye = oe(0);
3021
- ae(() => {
3022
- !r || !c || r.nonce === ye.current || (ye.current = r.nonce, $("chat"), H(!1), S({
3023
- room: Ut(c.id, r.userId),
3078
+ d && ($("chat"), S({ room: Ut(d.id, k.user_id), label: k.display_name ?? "Direct message" }));
3079
+ }, ke = ie(0);
3080
+ ee(() => {
3081
+ !r || !d || r.nonce === ke.current || (ke.current = r.nonce, $("chat"), z(!1), S({
3082
+ room: Ut(d.id, r.userId),
3024
3083
  label: r.name ?? "Direct message"
3025
3084
  }));
3026
- }, [r, c]);
3027
- const ke = oe(0);
3028
- return ae(() => {
3029
- !o || o.nonce === ke.current || (ke.current = o.nonce, $("chat"), H(!1), S({ room: o.room, label: o.label ?? o.room }));
3085
+ }, [r, d]);
3086
+ const Te = ie(0);
3087
+ return ee(() => {
3088
+ !o || o.nonce === Te.current || (Te.current = o.nonce, $("chat"), z(!1), S({ room: o.room, label: o.label ?? o.room }));
3030
3089
  }, [o]), n ? /* @__PURE__ */ a(
3031
3090
  "div",
3032
3091
  {
3033
- className: p ? (
3092
+ className: x ? (
3034
3093
  // No backdrop: the rest of the page stays usable.
3035
3094
  "pointer-events-none fixed inset-y-0 right-0 z-40"
3036
3095
  ) : "fixed inset-0 z-40 bg-black/40 animate-in fade-in duration-150",
3037
- style: p ? { width: Ct } : void 0,
3038
- onClick: p ? void 0 : s,
3096
+ style: x ? { width: Ct } : void 0,
3097
+ onClick: x ? void 0 : s,
3039
3098
  "data-chat-panel": !0,
3040
3099
  "data-nvr-recording-hide": !0,
3041
- "data-chat-pinned": p ? "1" : void 0,
3100
+ "data-chat-pinned": x ? "1" : void 0,
3042
3101
  children: [
3043
- /* @__PURE__ */ e(Rn, {}),
3102
+ /* @__PURE__ */ e(An, {}),
3044
3103
  /* @__PURE__ */ a(
3045
3104
  "aside",
3046
3105
  {
3047
- className: b(
3106
+ className: g(
3048
3107
  "pointer-events-auto absolute right-0 top-0 flex h-full w-full flex-col border-l",
3049
- p ? "max-w-none" : "max-w-[400px] shadow-2xl animate-in slide-in-from-right duration-200",
3050
- d.surface,
3108
+ x ? "max-w-none" : "max-w-[400px] shadow-2xl animate-in slide-in-from-right duration-200",
3109
+ m.surface,
3051
3110
  "border-slate-200 dark:border-border"
3052
3111
  ),
3053
3112
  onClick: (k) => k.stopPropagation(),
3054
3113
  "aria-label": "Team",
3055
3114
  children: [
3056
- /* @__PURE__ */ a("div", { className: b("flex shrink-0 items-center gap-2 border-b px-3.5 py-2.5", d.divider), children: [
3115
+ /* @__PURE__ */ a("div", { className: g("flex shrink-0 items-center gap-2 border-b px-3.5 py-2.5", m.divider), children: [
3057
3116
  /* @__PURE__ */ e("div", { className: "flex gap-0.5 rounded-lg border border-slate-200 p-0.5 dark:border-border", children: ["online", "chat", "browse", "archived"].map((k) => /* @__PURE__ */ a(
3058
3117
  "button",
3059
3118
  {
3060
3119
  type: "button",
3061
3120
  onClick: () => $(k),
3062
- className: b(
3121
+ "data-tip": k === "archived" ? "Conversations you archived for yourself. Everyone else still sees them." : void 0,
3122
+ className: g(
3063
3123
  "flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] font-medium transition-colors",
3064
- U === k ? d.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
3124
+ U === k ? m.accentSoft : "text-slate-500 hover:text-slate-700 dark:hover:text-slate-300"
3065
3125
  ),
3066
3126
  children: [
3067
- k === "online" ? `Online · ${x.length}` : k === "chat" ? "Chat" : k === "browse" ? "Browse" : "Archived",
3068
- k === "chat" && te > 0 && /* @__PURE__ */ e(
3127
+ k === "online" ? `Online · ${L.length}` : k === "chat" ? "Chat" : k === "browse" ? "Browse" : "Archived",
3128
+ k === "chat" && ne > 0 && /* @__PURE__ */ e(
3069
3129
  "span",
3070
3130
  {
3071
- className: b(
3131
+ className: g(
3072
3132
  "flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-[9.5px] font-bold leading-none",
3073
- d.pill
3133
+ m.pill
3074
3134
  ),
3075
- title: `${te} unread`,
3076
- children: te > 99 ? "99+" : te
3135
+ title: `${ne} unread`,
3136
+ children: ne > 99 ? "99+" : ne
3077
3137
  }
3078
3138
  )
3079
3139
  ]
@@ -3084,16 +3144,16 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
3084
3144
  "button",
3085
3145
  {
3086
3146
  type: "button",
3087
- onClick: g,
3088
- "aria-pressed": h,
3089
- title: h ? "Unpin — go back to opening chat over the page" : "Pin — keep chat open beside the page while you work",
3090
- "aria-label": h ? "Unpin chat panel" : "Pin chat panel",
3091
- className: b(
3147
+ onClick: v,
3148
+ "aria-pressed": b,
3149
+ title: b ? "Unpin — go back to opening chat over the page" : "Pin — keep chat open beside the page while you work",
3150
+ "aria-label": b ? "Unpin chat panel" : "Pin chat panel",
3151
+ className: g(
3092
3152
  "ml-auto hidden rounded-md p-1.5 transition-colors lg:flex",
3093
- h ? d.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
3153
+ b ? m.accentSoft : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100"
3094
3154
  ),
3095
- "data-chat-pin": h ? "on" : "off",
3096
- children: h ? /* @__PURE__ */ e(za, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(St, { className: "h-4 w-4", strokeWidth: 2 })
3155
+ "data-chat-pin": b ? "on" : "off",
3156
+ children: b ? /* @__PURE__ */ e(za, { className: "h-4 w-4", strokeWidth: 2 }) : /* @__PURE__ */ e(St, { className: "h-4 w-4", strokeWidth: 2 })
3097
3157
  }
3098
3158
  ),
3099
3159
  /* @__PURE__ */ e(
@@ -3111,19 +3171,19 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
3111
3171
  /* @__PURE__ */ e(
3112
3172
  cl,
3113
3173
  {
3114
- myStatus: c ? (($e = P.byUser.get(String(c.id).toUpperCase())) == null ? void 0 : $e.custom_status) ?? null : null
3174
+ myStatus: d ? ((we = c.byUser.get(String(d.id).toUpperCase())) == null ? void 0 : we.custom_status) ?? null : null
3115
3175
  }
3116
3176
  ),
3117
3177
  /* @__PURE__ */ e(il, {}),
3118
3178
  /* @__PURE__ */ e(Us, {}),
3119
- x.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
3179
+ L.length > 0 && /* @__PURE__ */ a("div", { className: "mb-1.5 flex items-center gap-1.5 px-1", children: [
3120
3180
  /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "Group by" }),
3121
3181
  /* @__PURE__ */ e(
3122
3182
  Lt,
3123
3183
  {
3124
- value: A,
3184
+ value: se,
3125
3185
  onChange: (k) => {
3126
- w(k);
3186
+ de(k);
3127
3187
  try {
3128
3188
  localStorage.setItem("nvr_chat_group_by", k);
3129
3189
  } catch {
@@ -3134,92 +3194,92 @@ body[data-nvr-chat-pinned] [data-nvr-dock-aware] { margin-right: ${Ct}px; }`, do
3134
3194
  options: [
3135
3195
  { value: "", label: "No grouping" },
3136
3196
  { value: "__role__", label: "Role" },
3137
- ...P.dimensions.map((k) => ({ value: k.name, label: k.label }))
3197
+ ...c.dimensions.map((k) => ({ value: k.name, label: k.label }))
3138
3198
  ]
3139
3199
  }
3140
3200
  )
3141
3201
  ] }),
3142
- x.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12px] text-slate-400", children: "No one else is online right now." }) : q.map((k) => /* @__PURE__ */ a("div", { "data-chat-online-group": k.key, children: [
3202
+ L.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 py-8 text-center text-[12px] text-slate-400", children: "No one else is online right now." }) : u.map((k) => /* @__PURE__ */ a("div", { "data-chat-online-group": k.key, children: [
3143
3203
  k.label !== null && /* @__PURE__ */ a("div", { className: "sticky top-0 z-[1] flex items-center gap-1.5 bg-white/95 px-2 py-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-400 backdrop-blur dark:bg-card/95", children: [
3144
3204
  k.label,
3145
3205
  /* @__PURE__ */ e("span", { className: "font-normal normal-case text-slate-300", children: k.users.length })
3146
3206
  ] }),
3147
- k.users.map((O) => {
3148
- const I = P.byUser.get(String(O.user_id).toUpperCase()), X = (I == null ? void 0 : I.is_idle) ?? O.is_idle, Te = I ?? O;
3207
+ k.users.map((M) => {
3208
+ const P = c.byUser.get(String(M.user_id).toUpperCase()), V = (P == null ? void 0 : P.is_idle) ?? M.is_idle, Ue = P ?? M;
3149
3209
  return /* @__PURE__ */ a(
3150
3210
  "div",
3151
3211
  {
3152
3212
  className: "flex w-full items-center rounded-lg pl-2.5 transition-colors hover:bg-slate-50 dark:hover:bg-muted/50",
3153
3213
  "data-chat-online-row": !0,
3154
3214
  children: [
3155
- /* @__PURE__ */ e(Ot, { userId: O.user_id, children: /* @__PURE__ */ e(
3215
+ /* @__PURE__ */ e(Ot, { userId: M.user_id, children: /* @__PURE__ */ e(
3156
3216
  "button",
3157
3217
  {
3158
3218
  type: "button",
3159
3219
  className: "shrink-0 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
3160
- "aria-label": `${O.display_name ?? "Unknown user"} — profile`,
3220
+ "aria-label": `${M.display_name ?? "Unknown user"} — profile`,
3161
3221
  "data-chat-online-avatar": !0,
3162
- children: /* @__PURE__ */ e(Z, { id: O.user_id, name: O.display_name })
3222
+ children: /* @__PURE__ */ e(Y, { id: M.user_id, name: M.display_name })
3163
3223
  }
3164
3224
  ) }),
3165
3225
  /* @__PURE__ */ a(
3166
3226
  "button",
3167
3227
  {
3168
3228
  type: "button",
3169
- onClick: () => Oe(O),
3229
+ onClick: () => Oe(M),
3170
3230
  title: "Send a direct message",
3171
3231
  className: "flex min-w-0 flex-1 items-center gap-3 py-2 pl-3 pr-2.5 text-left",
3172
3232
  children: [
3173
3233
  /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
3174
3234
  /* @__PURE__ */ a("span", { className: "block truncate text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
3175
- O.display_name ?? "Unknown user",
3176
- X && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: I != null && I.away ? "Away" : Dt(Te) }),
3177
- !X && (I == null ? void 0 : I.stuck) && (() => {
3178
- const _ = I.stuck, j = P.fields.includes("page"), E = Un(
3179
- I.current_path,
3180
- I.app,
3181
- P.adminUrl,
3235
+ M.display_name ?? "Unknown user",
3236
+ V && /* @__PURE__ */ e("span", { className: "ml-1.5 rounded-full bg-amber-500/10 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: P != null && P.away ? "Away" : Dt(Ue) }),
3237
+ !V && (P == null ? void 0 : P.stuck) && (() => {
3238
+ const _ = P.stuck, I = c.fields.includes("page"), j = Un(
3239
+ P.current_path,
3240
+ P.app,
3241
+ c.adminUrl,
3182
3242
  i.recordUrl,
3183
3243
  typeof window > "u" ? null : window.location.origin
3184
- ), ne = `${Dn(_)} — at the keyboard, on the same page, nothing saved for ten minutes${E ? `
3185
- ${$n(E)}` : ""}`, K = Dn(
3186
- j ? { ..._, label: null } : _
3187
- ), F = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
3188
- return E ? (
3244
+ ), X = `${Dn(_)} — at the keyboard, on the same page, nothing saved for ten minutes${j ? `
3245
+ ${$n(j)}` : ""}`, Q = Dn(
3246
+ I ? { ..._, label: null } : _
3247
+ ), B = "ml-1.5 rounded-full bg-orange-500/10 px-1.5 py-px text-[10px] font-medium text-orange-700 dark:text-orange-400";
3248
+ return j ? (
3189
3249
  // biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
3190
3250
  /* @__PURE__ */ e(
3191
3251
  "span",
3192
3252
  {
3193
3253
  role: "link",
3194
3254
  tabIndex: 0,
3195
- className: b(F, "cursor-pointer hover:underline"),
3255
+ className: g(B, "cursor-pointer hover:underline"),
3196
3256
  "data-chat-stuck": _.minutes,
3197
- "data-tip": ne,
3198
- "aria-label": `${K}: open the page`,
3199
- onClick: (J) => {
3200
- J.stopPropagation(), ue(E);
3257
+ "data-tip": X,
3258
+ "aria-label": `${Q}: open the page`,
3259
+ onClick: (K) => {
3260
+ K.stopPropagation(), pe(j);
3201
3261
  },
3202
- onKeyDown: (J) => {
3203
- (J.key === "Enter" || J.key === " ") && (J.preventDefault(), J.stopPropagation(), ue(E));
3262
+ onKeyDown: (K) => {
3263
+ (K.key === "Enter" || K.key === " ") && (K.preventDefault(), K.stopPropagation(), pe(j));
3204
3264
  },
3205
- children: K
3265
+ children: Q
3206
3266
  }
3207
3267
  )
3208
3268
  ) : /* @__PURE__ */ e(
3209
3269
  "span",
3210
3270
  {
3211
- className: F,
3271
+ className: B,
3212
3272
  "data-chat-stuck": _.minutes,
3213
- "data-tip": ne,
3214
- children: K
3273
+ "data-tip": X,
3274
+ children: Q
3215
3275
  }
3216
3276
  );
3217
3277
  })(),
3218
3278
  (() => {
3219
- var j;
3220
- const _ = (j = P.byUser.get(
3221
- String(O.user_id).toUpperCase()
3222
- )) == null ? void 0 : j.masquerade;
3279
+ var I;
3280
+ const _ = (I = c.byUser.get(
3281
+ String(M.user_id).toUpperCase()
3282
+ )) == null ? void 0 : I.masquerade;
3223
3283
  return _ ? /* @__PURE__ */ a(
3224
3284
  "span",
3225
3285
  {
@@ -3233,11 +3293,11 @@ ${$n(E)}` : ""}`, K = Dn(
3233
3293
  }
3234
3294
  ) : null;
3235
3295
  })(),
3236
- ve && /* @__PURE__ */ e($s, { builds: I == null ? void 0 : I.stale_build })
3296
+ Z && /* @__PURE__ */ e($s, { builds: P == null ? void 0 : P.stale_build })
3237
3297
  ] }),
3238
3298
  (() => {
3239
- const _ = P.byUser.get(String(O.user_id).toUpperCase()), j = _ == null ? void 0 : _.custom_status;
3240
- return !j && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
3299
+ const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = _ == null ? void 0 : _.custom_status;
3300
+ return !I && !(_ != null && _.in_huddle) ? null : /* @__PURE__ */ a(
3241
3301
  "span",
3242
3302
  {
3243
3303
  className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
@@ -3251,55 +3311,55 @@ ${$n(E)}` : ""}`, K = Dn(
3251
3311
  "data-tip": "In a huddle right now",
3252
3312
  children: [
3253
3313
  /* @__PURE__ */ e(Ha, { className: "h-3 w-3", strokeWidth: 2 }),
3254
- !j && "In a huddle"
3314
+ !I && "In a huddle"
3255
3315
  ]
3256
3316
  }
3257
3317
  ),
3258
- j && /* @__PURE__ */ a("span", { className: "truncate italic", children: [
3259
- j.emoji ? `${j.emoji} ` : "",
3260
- j.text
3318
+ I && /* @__PURE__ */ a("span", { className: "truncate italic", children: [
3319
+ I.emoji ? `${I.emoji} ` : "",
3320
+ I.text
3261
3321
  ] })
3262
3322
  ]
3263
3323
  }
3264
3324
  );
3265
3325
  })(),
3266
3326
  (() => {
3267
- const _ = P.byUser.get(String(O.user_id).toUpperCase()), j = [];
3268
- let E = null;
3269
- for (const K of P.fields)
3270
- if (K === "role") {
3271
- const F = En((_ == null ? void 0 : _.role_name) ?? O.role_name);
3272
- F && j.push(F);
3273
- } else if (K === "scopes") {
3274
- const F = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
3275
- F && j.push(F);
3276
- } else if (K === "page") {
3277
- const F = (_ == null ? void 0 : _.page) ?? O.page ?? ha((_ == null ? void 0 : _.current_path) ?? O.current_path), J = (_ == null ? void 0 : _.app) ?? O.app;
3278
- E = (J ? `${F ?? ""}${F ? " · " : ""}${J}`.trim() : F) || null;
3327
+ const _ = c.byUser.get(String(M.user_id).toUpperCase()), I = [];
3328
+ let j = null;
3329
+ for (const Q of c.fields)
3330
+ if (Q === "role") {
3331
+ const B = En((_ == null ? void 0 : _.role_name) ?? M.role_name);
3332
+ B && I.push(B);
3333
+ } else if (Q === "scopes") {
3334
+ const B = ((_ == null ? void 0 : _.scopes) ?? []).join(", ");
3335
+ B && I.push(B);
3336
+ } else if (Q === "page") {
3337
+ const B = (_ == null ? void 0 : _.page) ?? M.page ?? ha((_ == null ? void 0 : _.current_path) ?? M.current_path), K = (_ == null ? void 0 : _.app) ?? M.app;
3338
+ j = (K ? `${B ?? ""}${B ? " · " : ""}${K}`.trim() : B) || null;
3279
3339
  }
3280
- const ne = j.join(" · ");
3281
- return !ne && !E ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(_e, { children: [
3282
- ne && /* @__PURE__ */ e(
3340
+ const X = I.join(" · ");
3341
+ return !X && !j ? /* @__PURE__ */ e("span", { className: "block truncate text-[11px] text-slate-400", children: "Online" }) : /* @__PURE__ */ a(ve, { children: [
3342
+ X && /* @__PURE__ */ e(
3283
3343
  "span",
3284
3344
  {
3285
3345
  className: "block truncate text-[11px] text-slate-400",
3286
3346
  "data-chat-online-meta": !0,
3287
- title: ne,
3288
- children: ne
3347
+ title: X,
3348
+ children: X
3289
3349
  }
3290
3350
  ),
3291
- E && (() => {
3292
- const K = Un(
3351
+ j && (() => {
3352
+ const Q = Un(
3293
3353
  _ == null ? void 0 : _.current_path,
3294
3354
  _ == null ? void 0 : _.app,
3295
- P.adminUrl,
3355
+ c.adminUrl,
3296
3356
  i.recordUrl,
3297
3357
  typeof window > "u" ? null : window.location.origin
3298
- ), F = /* @__PURE__ */ a(_e, { children: [
3358
+ ), B = /* @__PURE__ */ a(ve, { children: [
3299
3359
  /* @__PURE__ */ e(as, { className: "mt-[2px] h-3 w-3 shrink-0 text-slate-400" }),
3300
- /* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: E })
3360
+ /* @__PURE__ */ e("span", { className: "line-clamp-2 min-w-0 break-words", children: j })
3301
3361
  ] });
3302
- return K ? (
3362
+ return Q ? (
3303
3363
  // biome-ignore lint/a11y/useSemanticElements: inside the row's DM button, where a nested <a> is invalid
3304
3364
  /* @__PURE__ */ e(
3305
3365
  "span",
@@ -3308,16 +3368,16 @@ ${$n(E)}` : ""}`, K = Dn(
3308
3368
  tabIndex: 0,
3309
3369
  className: "-mx-1 flex w-fit max-w-full cursor-pointer items-start gap-1 rounded px-1 text-[11px] text-slate-500 hover:bg-slate-100 hover:text-nvr-cyan hover:underline dark:text-slate-300 dark:hover:bg-muted",
3310
3370
  "data-chat-online-page": !0,
3311
- "data-chat-online-page-href": K,
3312
- "data-tip": $n(K),
3313
- "aria-label": `${E}: open the page`,
3314
- onClick: (J) => {
3315
- J.stopPropagation(), ue(K);
3371
+ "data-chat-online-page-href": Q,
3372
+ "data-tip": $n(Q),
3373
+ "aria-label": `${j}: open the page`,
3374
+ onClick: (K) => {
3375
+ K.stopPropagation(), pe(Q);
3316
3376
  },
3317
- onKeyDown: (J) => {
3318
- (J.key === "Enter" || J.key === " ") && (J.preventDefault(), J.stopPropagation(), ue(K));
3377
+ onKeyDown: (K) => {
3378
+ (K.key === "Enter" || K.key === " ") && (K.preventDefault(), K.stopPropagation(), pe(Q));
3319
3379
  },
3320
- children: F
3380
+ children: B
3321
3381
  }
3322
3382
  )
3323
3383
  ) : /* @__PURE__ */ e(
@@ -3325,8 +3385,8 @@ ${$n(E)}` : ""}`, K = Dn(
3325
3385
  {
3326
3386
  className: "flex items-start gap-1 text-[11px] text-slate-500 dark:text-slate-300",
3327
3387
  "data-chat-online-page": !0,
3328
- "data-tip": (_ == null ? void 0 : _.current_path) ?? E,
3329
- children: F
3388
+ "data-tip": (_ == null ? void 0 : _.current_path) ?? j,
3389
+ children: B
3330
3390
  }
3331
3391
  );
3332
3392
  })()
@@ -3334,21 +3394,21 @@ ${$n(E)}` : ""}`, K = Dn(
3334
3394
  })()
3335
3395
  ] }),
3336
3396
  (() => {
3337
- var K;
3338
- const _ = P.byUser.get(String(O.user_id).toUpperCase());
3339
- if (!ve || !(_ != null && _.recording_id)) return null;
3340
- const j = ((K = P.adminUrl) == null ? void 0 : K.replace(/\/$/, "")) ?? "", E = !!j && (typeof window > "u" || new URL(j, window.location.origin).origin !== window.location.origin), ne = i.sessionUrl ? i.sessionUrl(_.recording_id, String(O.user_id)) : E ? `${j}/session-replays?recording=${_.recording_id}` : null;
3341
- return ne ? /* @__PURE__ */ e(
3397
+ var Q;
3398
+ const _ = c.byUser.get(String(M.user_id).toUpperCase());
3399
+ if (!Z || !(_ != null && _.recording_id)) return null;
3400
+ const I = ((Q = c.adminUrl) == null ? void 0 : Q.replace(/\/$/, "")) ?? "", j = !!I && (typeof window > "u" || new URL(I, window.location.origin).origin !== window.location.origin), X = i.sessionUrl ? i.sessionUrl(_.recording_id, String(M.user_id)) : j ? `${I}/session-replays?recording=${_.recording_id}` : null;
3401
+ return X ? /* @__PURE__ */ e(
3342
3402
  "span",
3343
3403
  {
3344
3404
  role: "link",
3345
3405
  tabIndex: 0,
3346
3406
  title: "Watch this session",
3347
- onClick: (F) => {
3348
- F.stopPropagation(), ue(ne);
3407
+ onClick: (B) => {
3408
+ B.stopPropagation(), pe(X);
3349
3409
  },
3350
- onKeyDown: (F) => {
3351
- (F.key === "Enter" || F.key === " ") && (F.stopPropagation(), ue(ne));
3410
+ onKeyDown: (B) => {
3411
+ (B.key === "Enter" || B.key === " ") && (B.stopPropagation(), pe(X));
3352
3412
  },
3353
3413
  className: "shrink-0 rounded p-1 text-slate-300 transition-colors hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-muted",
3354
3414
  children: /* @__PURE__ */ e(Ga, { className: "h-4 w-4", strokeWidth: 1.8 })
@@ -3367,25 +3427,26 @@ ${$n(E)}` : ""}`, K = Dn(
3367
3427
  )
3368
3428
  ]
3369
3429
  },
3370
- O.user_id
3430
+ M.user_id
3371
3431
  );
3372
3432
  })
3373
3433
  ] }, k.key))
3374
- ] }) : U === "archived" ? V ? /* @__PURE__ */ e(
3434
+ ] }) : U === "archived" ? G ? /* @__PURE__ */ e(
3375
3435
  jn,
3376
3436
  {
3377
- room: V.room,
3378
- label: V.label,
3379
- onBack: () => se(null),
3437
+ room: G.room,
3438
+ label: G.label,
3439
+ onBack: () => te(null),
3380
3440
  renderMessageBody: l
3381
- }
3441
+ },
3442
+ G.room
3382
3443
  ) : /* @__PURE__ */ e(
3383
3444
  Wn,
3384
3445
  {
3385
- rooms: be.rooms,
3386
- loading: be.loading,
3446
+ rooms: ae.rooms,
3447
+ loading: ae.loading,
3387
3448
  archivedView: !0,
3388
- onOpen: (k) => se({ room: k.room, label: k.label })
3449
+ onOpen: (k) => te({ room: k.room, label: k.label })
3389
3450
  }
3390
3451
  ) : U === "browse" ? (
3391
3452
  // The tab is checked BEFORE the open room: leaving it last meant
@@ -3394,70 +3455,71 @@ ${$n(E)}` : ""}`, K = Dn(
3394
3455
  /* @__PURE__ */ e(
3395
3456
  ll,
3396
3457
  {
3397
- onOpen: (k, O, I) => {
3398
- H(!1), S({ room: k, label: O, channel: I }), $("chat");
3458
+ onOpen: (k, M, P) => {
3459
+ z(!1), S({ room: k, label: M, channel: P }), $("chat");
3399
3460
  }
3400
3461
  }
3401
3462
  )
3402
- ) : B ? /* @__PURE__ */ e(
3463
+ ) : q ? /* @__PURE__ */ e(
3403
3464
  dl,
3404
3465
  {
3405
- onClose: () => R(!1),
3406
- onCreated: (k, O) => {
3407
- R(!1), S({ room: k, label: O });
3466
+ onClose: () => A(!1),
3467
+ onCreated: (k, M) => {
3468
+ A(!1), S({ room: k, label: M });
3408
3469
  }
3409
3470
  }
3410
- ) : C && G && C.channel ? /* @__PURE__ */ e(
3471
+ ) : C && F && C.channel ? /* @__PURE__ */ e(
3411
3472
  al,
3412
3473
  {
3413
3474
  channel: C.channel,
3414
3475
  label: C.label,
3415
- onBack: () => H(!1)
3476
+ onBack: () => z(!1)
3416
3477
  }
3417
3478
  ) : C ? /* @__PURE__ */ e(
3418
3479
  jn,
3419
3480
  {
3420
3481
  room: C.room,
3421
3482
  label: C.label,
3422
- onOpenSettings: C.channel && !C.channel.is_direct ? () => H(!0) : void 0,
3483
+ onOpenSettings: C.channel && !C.channel.is_direct ? () => z(!0) : void 0,
3423
3484
  onBack: () => S(null),
3424
3485
  renderMessageBody: l,
3425
3486
  initialUnread: C.unread,
3426
3487
  anchor: C.anchor ?? null
3427
- }
3428
- ) : W === "mentions" ? /* @__PURE__ */ e(Qn, { th: d, onBack: () => M(null), onOpen: v }) : W === "scheduled" ? /* @__PURE__ */ e(
3488
+ },
3489
+ C.room
3490
+ ) : E === "mentions" ? /* @__PURE__ */ e(Qn, { th: m, onBack: () => R(null), onOpen: y }) : E === "scheduled" ? /* @__PURE__ */ e(
3429
3491
  Kn,
3430
3492
  {
3431
- th: d,
3432
- onBack: () => M(null),
3493
+ th: m,
3494
+ onBack: () => R(null),
3433
3495
  roomLabel: (k) => {
3434
- var O;
3435
- return ((O = ee.find((I) => I.room === k)) == null ? void 0 : O.label) ?? k;
3496
+ var M;
3497
+ return ((M = me.find((P) => P.room === k)) == null ? void 0 : M.label) ?? k;
3436
3498
  }
3437
3499
  }
3438
- ) : W === "catchup" ? /* @__PURE__ */ e(
3500
+ ) : E === "catchup" ? /* @__PURE__ */ e(
3439
3501
  Jn,
3440
3502
  {
3441
- rooms: ee,
3442
- th: d,
3443
- onBack: () => M(null),
3444
- onOpen: v
3503
+ rooms: me,
3504
+ th: m,
3505
+ onBack: () => R(null),
3506
+ onOpen: y
3445
3507
  }
3446
3508
  ) : /* @__PURE__ */ e(
3447
3509
  Wn,
3448
3510
  {
3449
- rooms: ee,
3450
- onOpen: (k, O) => {
3451
- H(!1), S({
3511
+ rooms: me,
3512
+ onOpen: (k, M) => {
3513
+ z(!1), S({
3452
3514
  room: k.room,
3453
3515
  label: k.label,
3454
3516
  channel: k.channel,
3455
3517
  unread: k.unread,
3456
- anchor: O
3518
+ anchor: M
3457
3519
  });
3458
3520
  },
3459
- onNewGroup: () => R(!0),
3460
- onView: M
3521
+ onNewGroup: () => A(!0),
3522
+ onView: R
3461
3523
  }
3462
3524
  )
3463
3525
  ]
@@ -3465,7 +3527,7 @@ ${$n(E)}` : ""}`, K = Dn(
3465
3527
  )
3466
3528
  ]
3467
3529
  }
3468
- ) : /* @__PURE__ */ e(Rn, {});
3530
+ ) : /* @__PURE__ */ e(An, {});
3469
3531
  }
3470
3532
  export {
3471
3533
  il as ChatAppearAwayRow,