@hachej/boring-workspace 0.1.20 → 0.1.23

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,7 +1,7 @@
1
1
  var Or = Object.defineProperty;
2
2
  var Mr = (e, t, n) => t in e ? Or(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var j = (e, t, n) => Mr(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { jsx as u, jsxs as w, Fragment as Pe } from "react/jsx-runtime";
4
+ import { jsx as l, jsxs as w, Fragment as Pe } from "react/jsx-runtime";
5
5
  import { useRef as A, useMemo as H, useContext as ue, createContext as xe, useSyncExternalStore as je, useState as _, useCallback as S, Component as Wr, useEffect as L, lazy as Ze, createElement as Se, Suspense as ht } from "react";
6
6
  import { AlertTriangleIcon as zr, ImageIcon as Ae, FileTextIcon as fe, FileJsonIcon as Qt, FileCodeIcon as re, FileIcon as gt, Loader2 as jr, X as An, FolderTree as ft, TerminalIcon as Mt, ClockIcon as Br, ArrowUp as Ur, ArrowDown as qr, CornerDownLeft as Vr, Plus as Hr, ChevronLeft as Rn, PanelLeft as Kr, Search as Zt, ChevronRight as Dn } from "lucide-react";
7
7
  import { Notice as Fn, IconButton as pe, LoadingState as Gr, Input as $n, toast as be, ErrorState as ze, Skeleton as Jr, Spinner as vt, Button as Ce, AlertDialog as Yr, AlertDialogContent as Xr, AlertDialogHeader as Qr, AlertDialogTitle as Zr, AlertDialogDescription as eo, AlertDialogFooter as to, AlertDialogCancel as no, AlertDialogAction as ro, EmptyState as Ln, Kbd as Me, Dialog as oo, DialogContent as so, DialogHeader as io, DialogTitle as ao, DialogDescription as co, Command as lo, CommandList as uo, CommandEmpty as fo, CommandInput as po, CommandGroup as Wt, CommandItem as yt, CommandShortcut as mo, Tabs as ho, TabsList as go, TabsTrigger as vo, Toaster as yo } from "@hachej/boring-ui-kit";
@@ -9,7 +9,7 @@ import { useStore as Ee, create as wo } from "zustand";
9
9
  import { persist as bo } from "zustand/middleware";
10
10
  import { z as q } from "zod";
11
11
  import { useQueryClient as _n, QueryClient as So, QueryClientProvider as xo, useQuery as zt, useMutation as wt } from "@tanstack/react-query";
12
- import { c as se } from "./utils-B6yFEsav.js";
12
+ import { c as oe } from "./utils-B6yFEsav.js";
13
13
  import { DockviewReact as ko } from "dockview-react";
14
14
  import "dockview-react/dist/styles/dockview.css";
15
15
  class At extends Error {
@@ -47,16 +47,16 @@ function $e(e) {
47
47
  return [...e];
48
48
  }
49
49
  function On(e = {}) {
50
- const t = [], n = [], r = [], o = [], s = [], i = [], f = [], c = /* @__PURE__ */ new Map(), d = (a, l) => {
51
- const p = `${a}:${l}`, h = c.get(p);
50
+ const t = [], n = [], r = [], o = [], s = [], i = [], f = [], c = /* @__PURE__ */ new Map(), d = (a, u) => {
51
+ const p = `${a}:${u}`, h = c.get(p);
52
52
  if (h !== void 0) {
53
53
  const g = e.pluginId ?? "<plugin>";
54
54
  throw new At(
55
55
  "duplicate-id",
56
- `plugin "${g}" registers ${a} "${l}" twice (first as ${h}, then again). If you are composing kits, two of them are registering the same id — namespace one of them.`
56
+ `plugin "${g}" registers ${a} "${u}" twice (first as ${h}, then again). If you are composing kits, two of them are registering the same id — namespace one of them.`
57
57
  );
58
58
  }
59
- c.set(p, `${a} "${l}"`);
59
+ c.set(p, `${a} "${u}"`);
60
60
  };
61
61
  return {
62
62
  registerProvider(a) {
@@ -78,8 +78,8 @@ function On(e = {}) {
78
78
  d("left-tab", a.id), i.push(a);
79
79
  },
80
80
  registerSurfaceResolver(a) {
81
- const l = a.id ?? `${e.pluginId ?? "anon"}:${a.kind}`;
82
- d("surface-resolver", l), a.id === void 0 && (a.id = l), f.push(a);
81
+ const u = a.id ?? `${e.pluginId ?? "anon"}:${a.kind}`;
82
+ d("surface-resolver", u), a.id === void 0 && (a.id = u), f.push(a);
83
83
  },
84
84
  flush() {
85
85
  return {
@@ -339,8 +339,8 @@ class Wn {
339
339
  return;
340
340
  }
341
341
  if (!d) return;
342
- const a = d.score ?? 0, l = c.source === "app";
343
- (a > r || a === r && l && !o || a === r && l === o && f >= s) && (n = d, r = a, o = l, s = f);
342
+ const a = d.score ?? 0, u = c.source === "app";
343
+ (a > r || a === r && u && !o || a === r && u === o && f >= s) && (n = d, r = a, o = u, s = f);
344
344
  }), n;
345
345
  }
346
346
  emit() {
@@ -367,7 +367,7 @@ function $o({
367
367
  }),
368
368
  [e, t, f, c]
369
369
  );
370
- return /* @__PURE__ */ u(et.Provider, { value: d, children: o });
370
+ return /* @__PURE__ */ l(et.Provider, { value: d, children: o });
371
371
  }
372
372
  function bt() {
373
373
  const e = ue(et);
@@ -398,11 +398,11 @@ function _o() {
398
398
  return je(e.subscribe, e.getSnapshot);
399
399
  }
400
400
  function Oo({ pluginId: e, message: t, kind: n }) {
401
- return /* @__PURE__ */ u(
401
+ return /* @__PURE__ */ l(
402
402
  Fn,
403
403
  {
404
404
  tone: "error",
405
- icon: /* @__PURE__ */ u(zr, { className: "size-4" }),
405
+ icon: /* @__PURE__ */ l(zr, { className: "size-4" }),
406
406
  className: "py-2",
407
407
  description: /* @__PURE__ */ w("span", { className: "block min-w-0 truncate", children: [
408
408
  /* @__PURE__ */ w("span", { className: "font-medium", children: [
@@ -426,7 +426,7 @@ function Mo({ children: e }) {
426
426
  () => ({ errors: t, reportPluginError: r }),
427
427
  [t, r]
428
428
  );
429
- return /* @__PURE__ */ u(Bt.Provider, { value: o, children: e });
429
+ return /* @__PURE__ */ l(Bt.Provider, { value: o, children: e });
430
430
  }
431
431
  function Wc() {
432
432
  const e = ue(Bt);
@@ -454,7 +454,7 @@ class xt extends Wr {
454
454
  (s = this.context) == null || s.reportPluginError(o);
455
455
  }
456
456
  render() {
457
- return this.state.error ? /* @__PURE__ */ u(
457
+ return this.state.error ? /* @__PURE__ */ l(
458
458
  Oo,
459
459
  {
460
460
  pluginId: this.props.pluginId,
@@ -514,9 +514,9 @@ function Yo(e) {
514
514
  function i(c, d) {
515
515
  const a = n.get(c);
516
516
  if (a)
517
- for (const l of [...a])
517
+ for (const u of [...a])
518
518
  try {
519
- l(d);
519
+ u(d);
520
520
  } catch (p) {
521
521
  console.error(`[bridge] listener for "${String(c)}" threw:`, p);
522
522
  }
@@ -537,12 +537,12 @@ function Yo(e) {
537
537
  async openFile(c, d) {
538
538
  const a = qo.safeParse({ path: c, mode: d == null ? void 0 : d.mode });
539
539
  if (!a.success) return s("VALIDATION", a.error.issues[0].message);
540
- const l = e.getState(), p = a.data.mode ?? "edit", h = `file:${c}`;
541
- if (l.panels.find((m) => m.id === h)) {
542
- const m = l.activePanel;
543
- return l.activatePanel(h), l.visibleFiles.includes(c) || l.openFile(c, h), i("panel:activated", { panelId: h, previousPanelId: m }), o();
540
+ const u = e.getState(), p = a.data.mode ?? "edit", h = `file:${c}`;
541
+ if (u.panels.find((m) => m.id === h)) {
542
+ const m = u.activePanel;
543
+ return u.activatePanel(h), u.visibleFiles.includes(c) || u.openFile(c, h), i("panel:activated", { panelId: h, previousPanelId: m }), o();
544
544
  }
545
- return l.panels.length >= ot ? s("MAX_PANELS", `cannot exceed ${ot} open panels`) : (l.openFile(c, h), l.openPanel({ id: h, component: "editor", params: { path: c, mode: p } }), i("file:opened", { path: c, mode: p }), i("panel:opened", { panelId: h, params: { path: c, mode: p } }), o());
545
+ return u.panels.length >= ot ? s("MAX_PANELS", `cannot exceed ${ot} open panels`) : (u.openFile(c, h), u.openPanel({ id: h, component: "editor", params: { path: c, mode: p } }), i("file:opened", { path: c, mode: p }), i("panel:opened", { panelId: h, params: { path: c, mode: p } }), o());
546
546
  },
547
547
  async openPanel(c) {
548
548
  const d = Vo.safeParse(c);
@@ -561,8 +561,8 @@ function Yo(e) {
561
561
  async closePanel(c) {
562
562
  const d = Ho.safeParse({ id: c });
563
563
  if (!d.success) return s("VALIDATION", d.error.issues[0].message);
564
- const a = e.getState(), l = a.panels.find((p) => p.id === c);
565
- return l ? l.essential ? s("ESSENTIAL", `panel ${c} is essential and cannot be closed`) : (a.closePanel(c), i("panel:closed", { panelId: c }), o()) : s("NOT_FOUND", `panel ${c} not found`);
564
+ const a = e.getState(), u = a.panels.find((p) => p.id === c);
565
+ return u ? u.essential ? s("ESSENTIAL", `panel ${c} is essential and cannot be closed`) : (a.closePanel(c), i("panel:closed", { panelId: c }), o()) : s("NOT_FOUND", `panel ${c} not found`);
566
566
  },
567
567
  async closeWorkbenchLeftPane() {
568
568
  return e.getState().setSidebar({ collapsed: !0 }), i("sidebar:toggled", { collapsed: !0 }), o();
@@ -570,14 +570,14 @@ function Yo(e) {
570
570
  async showNotification(c, d = "info") {
571
571
  const a = Ko.safeParse({ msg: c, level: d });
572
572
  if (!a.success) return s("VALIDATION", a.error.issues[0].message);
573
- const l = a.data.level ?? "info", p = l === "warn" ? "warning" : l;
574
- return e.getState().showNotification({ message: a.data.msg, type: p }), i("notification:shown", { message: a.data.msg, level: l }), o();
573
+ const u = a.data.level ?? "info", p = u === "warn" ? "warning" : u;
574
+ return e.getState().showNotification({ message: a.data.msg, type: p }), i("notification:shown", { message: a.data.msg, level: u }), o();
575
575
  },
576
576
  async navigateToLine(c, d) {
577
577
  const a = Go.safeParse({ file: c, line: d });
578
578
  if (!a.success) return s("VALIDATION", a.error.issues[0].message);
579
- const l = await f.openFile(c);
580
- return l.status === "error" ? l : (e.getState().navigateToLine(c, a.data.line), o());
579
+ const u = await f.openFile(c);
580
+ return u.status === "error" ? u : (e.getState().navigateToLine(c, a.data.line), o());
581
581
  },
582
582
  async expandToFile(c) {
583
583
  const d = Jo.safeParse({ path: c });
@@ -594,13 +594,13 @@ function Yo(e) {
594
594
  subscribe(c, d) {
595
595
  let a = n.get(c);
596
596
  a || (a = /* @__PURE__ */ new Set(), n.set(c, a));
597
- const l = d;
598
- return a.add(l), () => a.delete(l);
597
+ const u = d;
598
+ return a.add(u), () => a.delete(u);
599
599
  },
600
600
  select(c, d) {
601
601
  let a = c(e.getState());
602
- return e.subscribe((l) => {
603
- const p = c(l);
602
+ return e.subscribe((u) => {
603
+ const p = c(u);
604
604
  Object.is(p, a) || (a = p, d(p));
605
605
  });
606
606
  }
@@ -681,7 +681,7 @@ function es(e) {
681
681
  onVersionMismatch: c,
682
682
  onConnectionChange: d
683
683
  } = e;
684
- let a = null, l = null, p = null, h = null, g = !1, m = !1, b = 0;
684
+ let a = null, u = null, p = null, h = null, g = !1, m = !1, b = 0;
685
685
  function E(D) {
686
686
  m || g !== D && (g = D, d == null || d(D));
687
687
  }
@@ -794,10 +794,10 @@ function es(e) {
794
794
  }
795
795
  return {
796
796
  connect() {
797
- m = !1, !s && typeof EventSource < "u" ? B() : (I(), l = setInterval(I, i)), M();
797
+ m = !1, !s && typeof EventSource < "u" ? B() : (I(), u = setInterval(I, i)), M();
798
798
  },
799
799
  disconnect() {
800
- a && (a.close(), a = null), l !== null && (clearInterval(l), l = null), p !== null && (clearTimeout(p), p = null), h && (h(), h = null), E(!1), m = !0;
800
+ a && (a.close(), a = null), u !== null && (clearInterval(u), u = null), p !== null && (clearTimeout(p), p = null), h && (h(), h = null), E(!1), m = !0;
801
801
  },
802
802
  pushState(D) {
803
803
  W(D);
@@ -968,7 +968,7 @@ function rn(e, t) {
968
968
  }
969
969
  function vs(e) {
970
970
  const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), s = e.fetcher ?? (typeof fetch < "u" ? fetch : null), i = e.reconnectDelayMs ?? hs, f = e.maxReconnects ?? gs, c = e.pollIntervalMs ?? ms;
971
- let d = !1, a = null, l = null, p = null, h = null, g = 0, m = !1;
971
+ let d = !1, a = null, u = null, p = null, h = null, g = 0, m = !1;
972
972
  function b(P) {
973
973
  P && typeof P == "object" && typeof P.kind == "string" && Rt(P, n);
974
974
  }
@@ -991,7 +991,7 @@ function vs(e) {
991
991
  } finally {
992
992
  p = null;
993
993
  }
994
- d || (l = setTimeout(P, c));
994
+ d || (u = setTimeout(P, c));
995
995
  }
996
996
  };
997
997
  P();
@@ -1023,7 +1023,7 @@ function vs(e) {
1023
1023
  }
1024
1024
  }
1025
1025
  return W(), () => {
1026
- d = !0, a && (a.close(), a = null), l && (clearTimeout(l), l = null), p && (p.abort(), p = null), h && (clearTimeout(h), h = null);
1026
+ d = !0, a && (a.close(), a = null), u && (clearTimeout(u), u = null), p && (p.abort(), p = null), h && (clearTimeout(h), h = null);
1027
1027
  };
1028
1028
  }
1029
1029
  const ys = 1e4, ws = 3, bs = 1e3;
@@ -1054,15 +1054,15 @@ class xs {
1054
1054
  let f = null;
1055
1055
  for (let a = 0; a <= this.maxRetries; a++) {
1056
1056
  a > 0 && await Ss(this.retryBaseMs * 2 ** (a - 1));
1057
- const l = new AbortController(), p = () => l.abort();
1057
+ const u = new AbortController(), p = () => u.abort();
1058
1058
  s == null || s.addEventListener("abort", p, { once: !0 });
1059
- const h = setTimeout(() => l.abort(), i);
1059
+ const h = setTimeout(() => u.abort(), i);
1060
1060
  try {
1061
1061
  const g = r != null, m = await fetch(`${this.baseUrl}${n}`, {
1062
1062
  method: t,
1063
1063
  headers: g ? { ...this.headers, "Content-Type": "application/json" } : this.headers,
1064
1064
  body: g ? JSON.stringify(r) : void 0,
1065
- signal: l.signal
1065
+ signal: u.signal
1066
1066
  });
1067
1067
  if (clearTimeout(h), s == null || s.removeEventListener("abort", p), m.status === 401 || m.status === 403)
1068
1068
  throw (c = this.onAuthError) == null || c.call(this, m.status), new De(m.status, `Auth error: ${m.status}`);
@@ -1250,13 +1250,13 @@ function As() {
1250
1250
  return;
1251
1251
  }
1252
1252
  typeof (g == null ? void 0 : g.eventId) != "string" || typeof g.change != "object" || g.change == null || d(g.eventId) && Rs(g.change);
1253
- }, l = () => {
1253
+ }, u = () => {
1254
1254
  s = !0, o == null || o.close();
1255
1255
  }, p = () => {
1256
1256
  i.clear(), f.length = 0, n.invalidateQueries({ predicate: (h) => Ds(h.queryKey) });
1257
1257
  };
1258
- return o.addEventListener("change", a), o.addEventListener("unsupported", l), o.addEventListener("resync-required", p), () => {
1259
- o && (o.removeEventListener("change", a), o.removeEventListener("unsupported", l), o.removeEventListener("resync-required", p), s || o.close(), o = null);
1258
+ return o.addEventListener("change", a), o.addEventListener("unsupported", u), o.addEventListener("resync-required", p), () => {
1259
+ o && (o.removeEventListener("change", a), o.removeEventListener("unsupported", u), o.removeEventListener("resync-required", p), s || o.close(), o = null);
1260
1260
  };
1261
1261
  }, [e, t, n]);
1262
1262
  }
@@ -1323,8 +1323,8 @@ function Ls({
1323
1323
  () => o ?? new xs({ apiBaseUrl: e, authHeaders: t, onAuthError: n, timeout: r }),
1324
1324
  [o, e, t, n, r]
1325
1325
  ), c = (t == null ? void 0 : t["x-boring-workspace-id"]) ?? (t == null ? void 0 : t["X-Boring-Workspace-Id"]) ?? null;
1326
- return /* @__PURE__ */ u(xo, { client: i.current, children: /* @__PURE__ */ u(Xn.Provider, { value: e, children: /* @__PURE__ */ u(Qn.Provider, { value: c, children: /* @__PURE__ */ w(Yn.Provider, { value: f, children: [
1327
- /* @__PURE__ */ u(_s, {}),
1326
+ return /* @__PURE__ */ l(xo, { client: i.current, children: /* @__PURE__ */ l(Xn.Provider, { value: e, children: /* @__PURE__ */ l(Qn.Provider, { value: c, children: /* @__PURE__ */ w(Yn.Provider, { value: f, children: [
1327
+ /* @__PURE__ */ l(_s, {}),
1328
1328
  s
1329
1329
  ] }) }) }) });
1330
1330
  }
@@ -1696,10 +1696,10 @@ function Gs(e) {
1696
1696
  var p;
1697
1697
  const a = () => r(t.title ?? t.id);
1698
1698
  a();
1699
- const l = (p = t.onDidTitleChange) == null ? void 0 : p.call(t, a);
1699
+ const u = (p = t.onDidTitleChange) == null ? void 0 : p.call(t, a);
1700
1700
  return () => {
1701
1701
  var h;
1702
- return (h = l == null ? void 0 : l.dispose) == null ? void 0 : h.call(l);
1702
+ return (h = u == null ? void 0 : u.dispose) == null ? void 0 : h.call(u);
1703
1703
  };
1704
1704
  }, [t]);
1705
1705
  const o = n.endsWith(" ●"), s = o ? n.slice(0, -2) : n, i = Hs(s), [f, c] = _(!1);
@@ -1714,14 +1714,14 @@ function Gs(e) {
1714
1714
  return /* @__PURE__ */ w(
1715
1715
  "div",
1716
1716
  {
1717
- className: se(
1717
+ className: oe(
1718
1718
  "group relative flex h-full w-full min-w-0 items-center gap-1.5 pl-2.5 pr-7 select-none",
1719
1719
  "text-[12.5px] leading-none tracking-tight",
1720
1720
  "cursor-pointer transition-colors"
1721
1721
  ),
1722
1722
  title: o ? `${s} (unsaved changes)` : s,
1723
1723
  children: [
1724
- f ? /* @__PURE__ */ u(
1724
+ f ? /* @__PURE__ */ l(
1725
1725
  jr,
1726
1726
  {
1727
1727
  "data-testid": "tab-saving-spinner",
@@ -1729,34 +1729,34 @@ function Gs(e) {
1729
1729
  className: "h-3.5 w-3.5 shrink-0 animate-spin text-[color:var(--accent)]",
1730
1730
  strokeWidth: 2
1731
1731
  }
1732
- ) : /* @__PURE__ */ u(
1732
+ ) : /* @__PURE__ */ l(
1733
1733
  i,
1734
1734
  {
1735
- className: se(
1735
+ className: oe(
1736
1736
  "h-3.5 w-3.5 shrink-0 text-muted-foreground/70",
1737
1737
  "[.dv-active-tab_&]:text-[color:var(--accent)] [.active-tab_&]:text-[color:var(--accent)]"
1738
1738
  ),
1739
1739
  strokeWidth: 1.5
1740
1740
  }
1741
1741
  ),
1742
- /* @__PURE__ */ u("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: s }),
1743
- o ? /* @__PURE__ */ u(
1742
+ /* @__PURE__ */ l("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: s }),
1743
+ o ? /* @__PURE__ */ l(
1744
1744
  "span",
1745
1745
  {
1746
1746
  "aria-hidden": "true",
1747
- className: se(
1747
+ className: oe(
1748
1748
  "mr-1 h-1.5 w-1.5 shrink-0 rounded-full bg-foreground/35",
1749
1749
  "[.dv-active-tab_&]:bg-foreground/45 [.active-tab_&]:bg-foreground/45"
1750
1750
  )
1751
1751
  }
1752
1752
  ) : null,
1753
- /* @__PURE__ */ u(
1753
+ /* @__PURE__ */ l(
1754
1754
  pe,
1755
1755
  {
1756
1756
  type: "button",
1757
1757
  variant: "ghost",
1758
1758
  size: "icon-xs",
1759
- className: se(
1759
+ className: oe(
1760
1760
  "absolute right-1 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground opacity-0",
1761
1761
  "focus-visible:opacity-100 group-hover:opacity-100",
1762
1762
  "[.dv-active-tab_&]:opacity-50 [.active-tab_&]:opacity-50",
@@ -1764,7 +1764,7 @@ function Gs(e) {
1764
1764
  ),
1765
1765
  onClick: d,
1766
1766
  "aria-label": `Close ${s}`,
1767
- children: /* @__PURE__ */ u(An, { className: "h-3 w-3", strokeWidth: 2.25 })
1767
+ children: /* @__PURE__ */ l(An, { className: "h-3 w-3", strokeWidth: 2.25 })
1768
1768
  }
1769
1769
  )
1770
1770
  ]
@@ -1835,7 +1835,7 @@ function Qs(e) {
1835
1835
  o.removePanel(s);
1836
1836
  const d = { id: n, component: i, params: f, title: c };
1837
1837
  if ("groupId" in r) {
1838
- const a = o.groups.find((l) => l.id === r.groupId);
1838
+ const a = o.groups.find((u) => u.id === r.groupId);
1839
1839
  o.addPanel({
1840
1840
  ...d,
1841
1841
  position: a ? { referenceGroup: a } : void 0
@@ -1901,48 +1901,48 @@ function ei(e, t, n, r, o, s) {
1901
1901
  i.fromJSON(n);
1902
1902
  else {
1903
1903
  let a = !1;
1904
- for (const l of t.groups)
1905
- if (l.panel) {
1906
- if (!r.has(l.panel)) {
1904
+ for (const u of t.groups)
1905
+ if (u.panel) {
1906
+ if (!r.has(u.panel)) {
1907
1907
  console.error(
1908
- `[DockviewShell] Panel "${l.panel}" not found in registry. Available: ${r.list().map((p) => p.id).join(", ")}`
1908
+ `[DockviewShell] Panel "${u.panel}" not found in registry. Available: ${r.list().map((p) => p.id).join(", ")}`
1909
1909
  );
1910
1910
  continue;
1911
1911
  }
1912
1912
  i.addPanel({
1913
- id: l.panel,
1914
- component: l.panel,
1915
- params: l.params,
1916
- position: a ? { direction: Xs(l.position) } : void 0
1913
+ id: u.panel,
1914
+ component: u.panel,
1915
+ params: u.params,
1916
+ position: a ? { direction: Xs(u.position) } : void 0
1917
1917
  }), a = !0;
1918
1918
  }
1919
1919
  }
1920
1920
  for (const a of t.groups) {
1921
- const l = i.getPanel(a.panel ?? a.id);
1922
- l != null && l.group && (a.locked && (l.group.locked = "no-drop-target"), a.hideHeader && (l.group.header.hidden = !0), ln(i, a));
1921
+ const u = i.getPanel(a.panel ?? a.id);
1922
+ u != null && u.group && (a.locked && (u.group.locked = "no-drop-target"), a.hideHeader && (u.group.header.hidden = !0), ln(i, a));
1923
1923
  }
1924
1924
  const f = t.groups.filter(
1925
1925
  (a) => {
1926
- var l;
1927
- return typeof ((l = a.constraints) == null ? void 0 : l.maxWidthViewportRatio) == "number";
1926
+ var u;
1927
+ return typeof ((u = a.constraints) == null ? void 0 : u.maxWidthViewportRatio) == "number";
1928
1928
  }
1929
1929
  );
1930
1930
  let c;
1931
1931
  if (f.length > 0) {
1932
1932
  const a = () => {
1933
- for (const l of f)
1934
- ln(i, l);
1933
+ for (const u of f)
1934
+ ln(i, u);
1935
1935
  };
1936
1936
  window.addEventListener("resize", a), c = () => window.removeEventListener("resize", a);
1937
1937
  }
1938
1938
  let d;
1939
1939
  if (o) {
1940
1940
  let a = null;
1941
- const l = () => {
1941
+ const u = () => {
1942
1942
  a && clearTimeout(a), a = setTimeout(() => {
1943
1943
  o(i.toJSON());
1944
1944
  }, Js);
1945
- }, p = i.onDidLayoutChange(l), h = () => {
1945
+ }, p = i.onDidLayoutChange(u), h = () => {
1946
1946
  a && (clearTimeout(a), o(i.toJSON()));
1947
1947
  };
1948
1948
  window.addEventListener("beforeunload", h), d = () => {
@@ -1965,7 +1965,7 @@ function ti({
1965
1965
  rightHeaderActions: f,
1966
1966
  watermarkComponent: c
1967
1967
  }) {
1968
- const d = bt(), a = je(d.subscribe, d.getSnapshot, d.getSnapshot), l = Ks(), p = A(null), h = A(null), g = A(void 0), m = A(null), b = H(() => {
1968
+ const d = bt(), a = je(d.subscribe, d.getSnapshot, d.getSnapshot), u = Ks(), p = A(null), h = A(null), g = A(void 0), m = A(null), b = H(() => {
1969
1969
  const N = d.getComponents(), B = o ? Object.fromEntries(Object.entries(N).filter(([M]) => o.includes(M))) : N, I = m.current;
1970
1970
  if (I) {
1971
1971
  const M = Object.keys(I), R = Object.keys(B);
@@ -2011,17 +2011,17 @@ function ti({
2011
2011
  }, []);
2012
2012
  const P = S(
2013
2013
  (N) => {
2014
- if (!l) {
2014
+ if (!u) {
2015
2015
  h.current = N;
2016
2016
  return;
2017
2017
  }
2018
2018
  W(N);
2019
2019
  },
2020
- [l, W]
2020
+ [u, W]
2021
2021
  );
2022
2022
  return L(() => {
2023
- l && h.current && (W(h.current), h.current = null);
2024
- }, [l, W]), l ? /* @__PURE__ */ u(ir.Provider, { value: E, children: /* @__PURE__ */ u(
2023
+ u && h.current && (W(h.current), h.current = null);
2024
+ }, [u, W]), u ? /* @__PURE__ */ l(ir.Provider, { value: E, children: /* @__PURE__ */ l(
2025
2025
  ko,
2026
2026
  {
2027
2027
  className: `dv-shell ${s ?? ""}`,
@@ -2032,10 +2032,10 @@ function ti({
2032
2032
  watermarkComponent: c,
2033
2033
  onReady: P
2034
2034
  }
2035
- ) }) : /* @__PURE__ */ u(ni, {});
2035
+ ) }) : /* @__PURE__ */ l(ni, {});
2036
2036
  }
2037
2037
  function ni() {
2038
- return /* @__PURE__ */ u(Gr, { centered: !0, className: "bg-background", label: "Loading workspace..." });
2038
+ return /* @__PURE__ */ l(Gr, { centered: !0, className: "bg-background", label: "Loading workspace..." });
2039
2039
  }
2040
2040
  function ri(e) {
2041
2041
  return {
@@ -2070,12 +2070,12 @@ function oi({
2070
2070
  return H(
2071
2071
  () => s ? ri(s) : null,
2072
2072
  [s]
2073
- ), /* @__PURE__ */ w("div", { className: se("flex h-full flex-col overflow-hidden", o), children: [
2073
+ ), /* @__PURE__ */ w("div", { className: oe("flex h-full flex-col overflow-hidden", o), children: [
2074
2074
  /* @__PURE__ */ w("div", { className: "flex h-9 shrink-0 items-center gap-2 border-b border-border bg-muted/50 px-3", children: [
2075
- t && /* @__PURE__ */ u(t, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
2076
- /* @__PURE__ */ u("span", { className: "truncate text-sm font-medium", children: e }),
2077
- /* @__PURE__ */ u("div", { className: "flex-1" }),
2078
- !n && s && /* @__PURE__ */ u(
2075
+ t && /* @__PURE__ */ l(t, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
2076
+ /* @__PURE__ */ l("span", { className: "truncate text-sm font-medium", children: e }),
2077
+ /* @__PURE__ */ l("div", { className: "flex-1" }),
2078
+ !n && s && /* @__PURE__ */ l(
2079
2079
  pe,
2080
2080
  {
2081
2081
  type: "button",
@@ -2084,7 +2084,7 @@ function oi({
2084
2084
  className: "h-5 w-5 text-muted-foreground",
2085
2085
  onClick: () => s.close(),
2086
2086
  "aria-label": `Close ${e}`,
2087
- children: /* @__PURE__ */ u(
2087
+ children: /* @__PURE__ */ l(
2088
2088
  "svg",
2089
2089
  {
2090
2090
  className: "h-3 w-3",
@@ -2092,13 +2092,13 @@ function oi({
2092
2092
  fill: "none",
2093
2093
  stroke: "currentColor",
2094
2094
  strokeWidth: "2",
2095
- children: /* @__PURE__ */ u("path", { d: "M18 6 6 18M6 6l12 12" })
2095
+ children: /* @__PURE__ */ l("path", { d: "M18 6 6 18M6 6l12 12" })
2096
2096
  }
2097
2097
  )
2098
2098
  }
2099
2099
  )
2100
2100
  ] }),
2101
- /* @__PURE__ */ u("div", { className: "flex-1 overflow-auto", children: r })
2101
+ /* @__PURE__ */ l("div", { className: "flex-1 overflow-auto", children: r })
2102
2102
  ] });
2103
2103
  }
2104
2104
  const si = [
@@ -2175,7 +2175,7 @@ async function ci(e) {
2175
2175
  }
2176
2176
  if (!n) throw new Error("Clipboard not available");
2177
2177
  }
2178
- const cr = () => import("./FileTree-DHVB9rpk.js").then((e) => ({ default: e.FileTree }));
2178
+ const cr = () => import("./FileTree-D8Rmj8Bo.js").then((e) => ({ default: e.FileTree }));
2179
2179
  function li() {
2180
2180
  cr();
2181
2181
  }
@@ -2188,9 +2188,9 @@ function un({
2188
2188
  className: o
2189
2189
  }) {
2190
2190
  var Xt;
2191
- const s = Ne(), { data: i, error: f, isLoading: c } = tr(e), [d, a] = _(/* @__PURE__ */ new Map()), l = Pt(e), p = H(
2192
- () => Et(i, d.get(l)),
2193
- [i, d, l]
2191
+ const s = Ne(), { data: i, error: f, isLoading: c } = tr(e), [d, a] = _(/* @__PURE__ */ new Map()), u = Pt(e), p = H(
2192
+ () => Et(i, d.get(u)),
2193
+ [i, d, u]
2194
2194
  ), h = H(
2195
2195
  () => ii(p, r),
2196
2196
  [p, r]
@@ -2198,12 +2198,12 @@ function un({
2198
2198
  if (d.size === 0) return W;
2199
2199
  const y = new Map(W);
2200
2200
  for (const [k, $] of d) {
2201
- if (k === l) continue;
2201
+ if (k === u) continue;
2202
2202
  const Y = Et(y.get(k), $);
2203
2203
  Y && y.set(k, Y);
2204
2204
  }
2205
2205
  return y;
2206
- }, [W, d, l]), B = A(null), [I, M] = _(400), [R, D] = _(null), [z, F] = _(null), C = A(null), [K, G] = _(
2206
+ }, [W, d, u]), B = A(null), [I, M] = _(400), [R, D] = _(null), [z, F] = _(null), C = A(null), [K, G] = _(
2207
2207
  ((Xt = n == null ? void 0 : n.getActiveFile) == null ? void 0 : Xt.call(n)) ?? null
2208
2208
  ), [ne, ce] = _(null), [le, ye] = _(null), de = A(0), Te = ((t == null ? void 0 : t.trim().length) ?? 0) > 0, { data: Fe } = js(
2209
2209
  Te ? ar(t ?? "") : "",
@@ -2297,7 +2297,7 @@ function un({
2297
2297
  const $ = new Set(k);
2298
2298
  return $.delete(y), $;
2299
2299
  });
2300
- }, []), oe = S(
2300
+ }, []), se = S(
2301
2301
  (y, k) => {
2302
2302
  D({ node: k, x: y.clientX, y: y.clientY });
2303
2303
  },
@@ -2431,7 +2431,7 @@ function un({
2431
2431
  x
2432
2432
  ]), _r = !Te && ((t == null ? void 0 : t.length) ?? 0) > 0 ? t : void 0;
2433
2433
  return /* @__PURE__ */ w("div", { className: "flex h-full min-h-0 flex-col", children: [
2434
- f && /* @__PURE__ */ u(
2434
+ f && /* @__PURE__ */ l(
2435
2435
  ze,
2436
2436
  {
2437
2437
  className: "m-2 rounded-md p-3",
@@ -2439,27 +2439,27 @@ function un({
2439
2439
  description: f.message
2440
2440
  }
2441
2441
  ),
2442
- /* @__PURE__ */ u(
2442
+ /* @__PURE__ */ l(
2443
2443
  "div",
2444
2444
  {
2445
2445
  ref: B,
2446
2446
  className: "min-h-0 flex-1 overflow-hidden",
2447
2447
  onContextMenu: X,
2448
- children: c ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((y, k) => /* @__PURE__ */ u(
2448
+ children: c ? /* @__PURE__ */ l("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((y, k) => /* @__PURE__ */ l(
2449
2449
  Jr,
2450
2450
  {
2451
2451
  className: "h-5",
2452
2452
  style: { width: `${60 + k * 13 % 30}%` }
2453
2453
  },
2454
2454
  k
2455
- )) }) : /* @__PURE__ */ u(
2455
+ )) }) : /* @__PURE__ */ l(
2456
2456
  ht,
2457
2457
  {
2458
2458
  fallback: /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2459
- /* @__PURE__ */ u(vt, { className: "size-3.5" }),
2460
- /* @__PURE__ */ u("span", { children: "Loading..." })
2459
+ /* @__PURE__ */ l(vt, { className: "size-3.5" }),
2460
+ /* @__PURE__ */ l("span", { children: "Loading..." })
2461
2461
  ] }),
2462
- children: /* @__PURE__ */ u(
2462
+ children: /* @__PURE__ */ l(
2463
2463
  ui,
2464
2464
  {
2465
2465
  files: Ve,
@@ -2474,12 +2474,12 @@ function un({
2474
2474
  pendingPaths: T,
2475
2475
  onSelect: ee,
2476
2476
  onExpand: ie,
2477
- onContextMenu: oe,
2477
+ onContextMenu: se,
2478
2478
  onSubmitEdit: Dr,
2479
2479
  onCancelEdit: Fr,
2480
2480
  onDragDrop: he,
2481
2481
  height: I,
2482
- className: se(o)
2482
+ className: oe(o)
2483
2483
  }
2484
2484
  )
2485
2485
  }
@@ -2494,11 +2494,11 @@ function un({
2494
2494
  className: "fixed z-50 min-w-[10rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
2495
2495
  style: { left: R.x, top: R.y },
2496
2496
  children: [
2497
- /* @__PURE__ */ u(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: kt, children: "New file" }),
2498
- /* @__PURE__ */ u(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Ar, children: "New folder" }),
2497
+ /* @__PURE__ */ l(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: kt, children: "New file" }),
2498
+ /* @__PURE__ */ l(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Ar, children: "New folder" }),
2499
2499
  !R.isBackground && /* @__PURE__ */ w(Pe, { children: [
2500
- /* @__PURE__ */ u(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Rr, children: "Rename" }),
2501
- /* @__PURE__ */ u(
2500
+ /* @__PURE__ */ l(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: Rr, children: "Rename" }),
2501
+ /* @__PURE__ */ l(
2502
2502
  Ce,
2503
2503
  {
2504
2504
  type: "button",
@@ -2512,12 +2512,12 @@ function un({
2512
2512
  children: "Delete"
2513
2513
  }
2514
2514
  ),
2515
- /* @__PURE__ */ u(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: $r, children: "Copy path" })
2515
+ /* @__PURE__ */ l(Ce, { type: "button", role: "menuitem", variant: "ghost", size: "sm", className: "w-full justify-start", onClick: $r, children: "Copy path" })
2516
2516
  ] })
2517
2517
  ]
2518
2518
  }
2519
2519
  ),
2520
- /* @__PURE__ */ u(
2520
+ /* @__PURE__ */ l(
2521
2521
  Yr,
2522
2522
  {
2523
2523
  open: z !== null,
@@ -2531,11 +2531,11 @@ function un({
2531
2531
  z == null ? void 0 : z.name,
2532
2532
  "?"
2533
2533
  ] }),
2534
- /* @__PURE__ */ u(eo, { children: "This action cannot be undone." })
2534
+ /* @__PURE__ */ l(eo, { children: "This action cannot be undone." })
2535
2535
  ] }),
2536
2536
  /* @__PURE__ */ w(to, { children: [
2537
- /* @__PURE__ */ u(no, { children: "Cancel" }),
2538
- /* @__PURE__ */ u(ro, { onClick: Lr, children: "Delete" })
2537
+ /* @__PURE__ */ l(no, { children: "Cancel" }),
2538
+ /* @__PURE__ */ l(ro, { onClick: Lr, children: "Delete" })
2539
2539
  ] })
2540
2540
  ] })
2541
2541
  }
@@ -2552,29 +2552,29 @@ function di({
2552
2552
  chromeless: i = !1,
2553
2553
  className: f
2554
2554
  }) {
2555
- const c = (e == null ? void 0 : e.rootDir) ?? t, d = (e == null ? void 0 : e.bridge) ?? o, a = (e == null ? void 0 : e.chromeless) ?? i, l = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, p = r ?? s, [h, g] = _(""), [m, b] = _(""), E = A(void 0);
2555
+ const c = (e == null ? void 0 : e.rootDir) ?? t, d = (e == null ? void 0 : e.bridge) ?? o, a = (e == null ? void 0 : e.chromeless) ?? i, u = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, p = r ?? s, [h, g] = _(""), [m, b] = _(""), E = A(void 0);
2556
2556
  L(() => (clearTimeout(E.current), E.current = setTimeout(() => b(h), 200), () => clearTimeout(E.current)), [h]);
2557
- const W = l !== void 0 ? l || void 0 : m || void 0;
2558
- return a ? /* @__PURE__ */ u(
2557
+ const W = u !== void 0 ? u || void 0 : m || void 0;
2558
+ return a ? /* @__PURE__ */ l(
2559
2559
  un,
2560
2560
  {
2561
2561
  rootDir: c,
2562
2562
  searchQuery: W,
2563
2563
  bridge: d,
2564
- className: se("px-1 pt-1 [&_[role=treeitem]]:!indent-0", f)
2564
+ className: oe("px-1 pt-1 [&_[role=treeitem]]:!indent-0", f)
2565
2565
  }
2566
- ) : /* @__PURE__ */ u(oi, { title: "Files", panelApi: p, children: /* @__PURE__ */ w("div", { className: "flex h-full flex-col", children: [
2567
- /* @__PURE__ */ u("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ u(
2566
+ ) : /* @__PURE__ */ l(oi, { title: "Files", panelApi: p, children: /* @__PURE__ */ w("div", { className: "flex h-full flex-col", children: [
2567
+ /* @__PURE__ */ l("div", { className: "border-b border-border px-2 py-1.5", children: /* @__PURE__ */ l(
2568
2568
  $n,
2569
2569
  {
2570
2570
  placeholder: "Search files...",
2571
- value: l ?? h,
2571
+ value: u ?? h,
2572
2572
  onChange: (P) => g(P.target.value),
2573
2573
  className: "h-7 text-xs",
2574
2574
  "aria-label": "Search files"
2575
2575
  }
2576
2576
  ) }),
2577
- /* @__PURE__ */ u("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ u(
2577
+ /* @__PURE__ */ l("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ l(
2578
2578
  un,
2579
2579
  {
2580
2580
  rootDir: c,
@@ -2672,7 +2672,7 @@ function yi() {
2672
2672
  }
2673
2673
  const wi = 250, bi = 3e3, Si = 3e4;
2674
2674
  function xi(e, t) {
2675
- const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: s } = t, [i, f] = _(!1), [c, d] = _(!1), [a, l] = _(null), [p, h] = _(!1), [g, m] = _(!1), b = A(void 0), E = A(null), W = A(0), P = A(null), N = A(o);
2675
+ const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: s } = t, [i, f] = _(!1), [c, d] = _(!1), [a, u] = _(null), [p, h] = _(!1), [g, m] = _(!1), b = A(void 0), E = A(null), W = A(0), P = A(null), N = A(o);
2676
2676
  N.current = o;
2677
2677
  const B = A(n);
2678
2678
  B.current = n;
@@ -2691,7 +2691,7 @@ function xi(e, t) {
2691
2691
  await Promise.race([
2692
2692
  K.save().then(() => "saved"),
2693
2693
  ce
2694
- ]) === "saved" && (W.current = Date.now(), l(Date.now()), f(!1), (le = N.current) == null || le.call(N, e, !1));
2694
+ ]) === "saved" && (W.current = Date.now(), u(Date.now()), f(!1), (le = N.current) == null || le.call(N, e, !1));
2695
2695
  } catch {
2696
2696
  } finally {
2697
2697
  ne && clearTimeout(ne), V.emit(me.editorSaveEnd, { panelId: r }), d(!1), E.current = null;
@@ -2769,14 +2769,14 @@ function Yc(e) {
2769
2769
  return n.push(r[e.key] ?? e.key.toUpperCase()), n.join(t ? "" : "+");
2770
2770
  }
2771
2771
  function ur(e) {
2772
- const { path: t, panelId: n = t, initialContent: r = null } = e, { data: o, isLoading: s, error: i } = zs(t), { mutateAsync: f } = nr(), [c, d] = _(r), a = A(""), l = A(!1), p = A(null), h = A(null), g = A(null), m = A(0), [b, E] = _(null);
2772
+ const { path: t, panelId: n = t, initialContent: r = null } = e, { data: o, isLoading: s, error: i } = zs(t), { mutateAsync: f } = nr(), [c, d] = _(r), a = A(""), u = A(!1), p = A(null), h = A(null), g = A(null), m = A(0), [b, E] = _(null);
2773
2773
  L(() => {
2774
- p.current !== t && (d(r), a.current = r ?? "", l.current = !1, h.current = null, E(null), p.current = t);
2774
+ p.current !== t && (d(r), a.current = r ?? "", u.current = !1, h.current = null, E(null), p.current = t);
2775
2775
  }, [t, r]), L(() => {
2776
2776
  (o == null ? void 0 : o.content) != null && c === null && (d(o.content), a.current = o.content, h.current = o.mtimeMs ?? null);
2777
2777
  }, [o, c]);
2778
2778
  const W = t && c != null ? {
2779
- isDirty: () => l.current,
2779
+ isDirty: () => u.current,
2780
2780
  save: async () => {
2781
2781
  var K;
2782
2782
  const C = ++m.current;
@@ -2787,7 +2787,7 @@ function ur(e) {
2787
2787
  expectedMtimeMs: h.current ?? void 0
2788
2788
  });
2789
2789
  if (m.current !== C) return;
2790
- typeof G.mtimeMs == "number" && (h.current = G.mtimeMs, (K = g.current) == null || K.call(g, G.mtimeMs)), l.current = !1, E(null);
2790
+ typeof G.mtimeMs == "number" && (h.current = G.mtimeMs, (K = g.current) == null || K.call(g, G.mtimeMs)), u.current = !1, E(null);
2791
2791
  } catch (G) {
2792
2792
  throw m.current !== C || G instanceof Xe && (typeof G.currentMtimeMs == "number" && (h.current = G.currentMtimeMs), E(G)), G;
2793
2793
  }
@@ -2800,11 +2800,11 @@ function ur(e) {
2800
2800
  });
2801
2801
  g.current = P.notifySaved, L(() => {
2802
2802
  if (!(!P.shouldSync || (o == null ? void 0 : o.content) == null)) {
2803
- if (l.current) {
2803
+ if (u.current) {
2804
2804
  P.ackSync();
2805
2805
  return;
2806
2806
  }
2807
- d(o.content), a.current = o.content, h.current = o.mtimeMs ?? null, l.current = !1, P.ackSync();
2807
+ d(o.content), a.current = o.content, h.current = o.mtimeMs ?? null, u.current = !1, P.ackSync();
2808
2808
  }
2809
2809
  }, [P.shouldSync, P, o, d]), L(() => {
2810
2810
  !P.externalChangeWhileDirty || (o == null ? void 0 : o.mtimeMs) == null || (E(new Xe(t, o.mtimeMs, h.current)), h.current = o.mtimeMs, P.ackExternalChange());
@@ -2815,21 +2815,21 @@ function ur(e) {
2815
2815
  I(C);
2816
2816
  }, [N, P.isDirty, n]);
2817
2817
  const M = S((C) => {
2818
- d(C), a.current = C, l.current = !0, P.markDirty();
2818
+ d(C), a.current = C, u.current = !0, P.markDirty();
2819
2819
  }, [d, P]), R = S(async () => {
2820
2820
  var C;
2821
- o && (d(o.content), a.current = o.content, h.current = o.mtimeMs ?? null, l.current = !1, typeof o.mtimeMs == "number" && ((C = g.current) == null || C.call(g, o.mtimeMs)), E(null));
2821
+ o && (d(o.content), a.current = o.content, h.current = o.mtimeMs ?? null, u.current = !1, typeof o.mtimeMs == "number" && ((C = g.current) == null || C.call(g, o.mtimeMs)), E(null));
2822
2822
  }, [o, d]), D = S(async () => {
2823
2823
  var K;
2824
2824
  const C = ++m.current;
2825
2825
  try {
2826
2826
  const G = a.current, ne = await f({ path: t, content: G });
2827
2827
  if (m.current !== C) return;
2828
- typeof ne.mtimeMs == "number" && (h.current = ne.mtimeMs, (K = g.current) == null || K.call(g, ne.mtimeMs)), l.current = !1, E(null);
2828
+ typeof ne.mtimeMs == "number" && (h.current = ne.mtimeMs, (K = g.current) == null || K.call(g, ne.mtimeMs)), u.current = !1, E(null);
2829
2829
  } catch {
2830
2830
  }
2831
2831
  }, [t, f]), z = S(async () => {
2832
- !W || !l.current || await W.save();
2832
+ !W || !u.current || await W.save();
2833
2833
  }, [W]), F = S(async () => {
2834
2834
  await P.flushSave();
2835
2835
  }, [P]);
@@ -2849,16 +2849,16 @@ function ur(e) {
2849
2849
  };
2850
2850
  }
2851
2851
  function Pi({ conflict: e, onReload: t, onOverwrite: n }) {
2852
- return /* @__PURE__ */ u(
2852
+ return /* @__PURE__ */ l(
2853
2853
  Fn,
2854
2854
  {
2855
2855
  role: "alert",
2856
2856
  tone: "accent",
2857
2857
  className: "rounded-none border-x-0 border-t-0",
2858
- description: /* @__PURE__ */ u(Pe, { children: "This file has been modified outside the editor. Your unsaved changes will be lost if you reload, or will overwrite the latest version on disk if you save." }),
2858
+ description: /* @__PURE__ */ l(Pe, { children: "This file has been modified outside the editor. Your unsaved changes will be lost if you reload, or will overwrite the latest version on disk if you save." }),
2859
2859
  actions: /* @__PURE__ */ w(Pe, { children: [
2860
- /* @__PURE__ */ u(Ce, { type: "button", variant: "outline", size: "xs", onClick: () => void t(), children: "Reload" }),
2861
- /* @__PURE__ */ u(
2860
+ /* @__PURE__ */ l(Ce, { type: "button", variant: "outline", size: "xs", onClick: () => void t(), children: "Reload" }),
2861
+ /* @__PURE__ */ l(
2862
2862
  Ce,
2863
2863
  {
2864
2864
  type: "button",
@@ -2868,7 +2868,7 @@ function Pi({ conflict: e, onReload: t, onOverwrite: n }) {
2868
2868
  children: "Overwrite"
2869
2869
  }
2870
2870
  ),
2871
- /* @__PURE__ */ u("span", { className: "sr-only", children: e.path })
2871
+ /* @__PURE__ */ l("span", { className: "sr-only", children: e.path })
2872
2872
  ] })
2873
2873
  }
2874
2874
  );
@@ -2885,19 +2885,19 @@ function dr({
2885
2885
  editorComponent: c,
2886
2886
  editorProps: d = {},
2887
2887
  loadingFallback: a,
2888
- errorMessage: l,
2888
+ errorMessage: u,
2889
2889
  className: p
2890
2890
  }) {
2891
2891
  if (!e)
2892
- return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(Ln, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
2892
+ return /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(Ln, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
2893
2893
  if (r)
2894
- return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(ze, { title: "Failed to load file", description: l ?? r.message }) });
2894
+ return /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(ze, { title: "Failed to load file", description: u ?? r.message }) });
2895
2895
  const h = a ?? /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
2896
- /* @__PURE__ */ u(vt, { className: "size-3.5" }),
2897
- /* @__PURE__ */ u("span", { children: "Loading file..." })
2896
+ /* @__PURE__ */ l(vt, { className: "size-3.5" }),
2897
+ /* @__PURE__ */ l("span", { children: "Loading file..." })
2898
2898
  ] });
2899
2899
  return /* @__PURE__ */ w("div", { className: `flex h-full min-h-0 flex-col ${p ?? ""}`, children: [
2900
- o && /* @__PURE__ */ u(
2900
+ o && /* @__PURE__ */ l(
2901
2901
  Pi,
2902
2902
  {
2903
2903
  conflict: o,
@@ -2905,7 +2905,7 @@ function dr({
2905
2905
  onOverwrite: f
2906
2906
  }
2907
2907
  ),
2908
- /* @__PURE__ */ u(ht, { fallback: h, children: n || t === null ? h : /* @__PURE__ */ u(
2908
+ /* @__PURE__ */ l(ht, { fallback: h, children: n || t === null ? h : /* @__PURE__ */ l(
2909
2909
  c,
2910
2910
  {
2911
2911
  content: t,
@@ -2953,11 +2953,11 @@ function dn({ params: e, api: t, className: n }) {
2953
2953
  setContent: c,
2954
2954
  onReloadFromServer: d,
2955
2955
  onOverwrite: a,
2956
- tabTitle: l
2956
+ tabTitle: u
2957
2957
  } = ur({ path: r, panelId: t == null ? void 0 : t.id });
2958
- t && l && t.setTitle(l);
2958
+ t && u && t.setTitle(u);
2959
2959
  const p = Ni(r);
2960
- return /* @__PURE__ */ u(
2960
+ return /* @__PURE__ */ l(
2961
2961
  dr,
2962
2962
  {
2963
2963
  path: r,
@@ -2974,7 +2974,7 @@ function dn({ params: e, api: t, className: n }) {
2974
2974
  );
2975
2975
  }
2976
2976
  const Ii = Ze(
2977
- () => import("./MarkdownEditor-L1KDH0bM.js").then((e) => ({ default: e.MarkdownEditor }))
2977
+ () => import("./MarkdownEditor-DKC4gNT4.js").then((e) => ({ default: e.MarkdownEditor }))
2978
2978
  );
2979
2979
  function Ti({ params: e, api: t, className: n }) {
2980
2980
  const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
@@ -2985,9 +2985,9 @@ function Ti({ params: e, api: t, className: n }) {
2985
2985
  setContent: c,
2986
2986
  onReloadFromServer: d,
2987
2987
  onOverwrite: a,
2988
- tabTitle: l
2988
+ tabTitle: u
2989
2989
  } = ur({ path: r, panelId: t == null ? void 0 : t.id });
2990
- return t && l && t.setTitle(l), /* @__PURE__ */ u(
2990
+ return t && u && t.setTitle(u), /* @__PURE__ */ l(
2991
2991
  dr,
2992
2992
  {
2993
2993
  path: r,
@@ -3010,7 +3010,7 @@ function st(e) {
3010
3010
  return e.split("/").pop() ?? e;
3011
3011
  }
3012
3012
  function Ri({ path: e, kind: t, className: n }) {
3013
- const r = _e(), o = Oe(), [s, i] = _(null), [f, c] = _(null), [d, a] = _(!0), l = H(
3013
+ const r = _e(), o = Oe(), [s, i] = _(null), [f, c] = _(null), [d, a] = _(!0), u = H(
3014
3014
  () => Ai(r, `/api/v1/files/raw?path=${encodeURIComponent(e)}`),
3015
3015
  [r, e]
3016
3016
  );
@@ -3019,7 +3019,7 @@ function Ri({ path: e, kind: t, className: n }) {
3019
3019
  let h = null;
3020
3020
  a(!0), c(null), i(null);
3021
3021
  const g = {};
3022
- return o && (g["x-boring-workspace-id"] = o), fetch(l, {
3022
+ return o && (g["x-boring-workspace-id"] = o), fetch(u, {
3023
3023
  credentials: "include",
3024
3024
  headers: g,
3025
3025
  signal: p.signal
@@ -3034,13 +3034,13 @@ function Ri({ path: e, kind: t, className: n }) {
3034
3034
  }), () => {
3035
3035
  p.abort(), h && URL.revokeObjectURL(h);
3036
3036
  };
3037
- }, [l, o]), e ? d ? /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3038
- /* @__PURE__ */ u(vt, { className: "size-3.5" }),
3039
- /* @__PURE__ */ u("span", { children: "Loading preview..." })
3040
- ] }) : f || !s ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(ze, { title: "Failed to load preview", description: f ?? "Preview unavailable." }) }) : /* @__PURE__ */ w("div", { className: se("flex h-full min-h-0 flex-col bg-background", n), children: [
3037
+ }, [u, o]), e ? d ? /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3038
+ /* @__PURE__ */ l(vt, { className: "size-3.5" }),
3039
+ /* @__PURE__ */ l("span", { children: "Loading preview..." })
3040
+ ] }) : f || !s ? /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(ze, { title: "Failed to load preview", description: f ?? "Preview unavailable." }) }) : /* @__PURE__ */ w("div", { className: oe("flex h-full min-h-0 flex-col bg-background", n), children: [
3041
3041
  /* @__PURE__ */ w("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3042
- /* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: st(e) }),
3043
- /* @__PURE__ */ u(
3042
+ /* @__PURE__ */ l("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: st(e) }),
3043
+ /* @__PURE__ */ l(
3044
3044
  "a",
3045
3045
  {
3046
3046
  href: s,
@@ -3050,14 +3050,14 @@ function Ri({ path: e, kind: t, className: n }) {
3050
3050
  }
3051
3051
  )
3052
3052
  ] }),
3053
- /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: t === "image" ? /* @__PURE__ */ u(
3053
+ /* @__PURE__ */ l("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: t === "image" ? /* @__PURE__ */ l(
3054
3054
  "img",
3055
3055
  {
3056
3056
  src: s,
3057
3057
  alt: st(e),
3058
3058
  className: "max-h-full max-w-full rounded-md object-contain shadow-sm"
3059
3059
  }
3060
- ) : /* @__PURE__ */ u(
3060
+ ) : /* @__PURE__ */ l(
3061
3061
  "iframe",
3062
3062
  {
3063
3063
  src: s,
@@ -3065,14 +3065,14 @@ function Ri({ path: e, kind: t, className: n }) {
3065
3065
  className: "h-full min-h-[480px] w-full rounded-md border border-border bg-background"
3066
3066
  }
3067
3067
  ) })
3068
- ] }) : /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(ze, { title: "No file selected", description: "Choose an image or PDF from the file tree." }) });
3068
+ ] }) : /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(ze, { title: "No file selected", description: "Choose an image or PDF from the file tree." }) });
3069
3069
  }
3070
3070
  function Di(e, t) {
3071
3071
  return t || (e.toLowerCase().endsWith(".pdf") ? "pdf" : "image");
3072
3072
  }
3073
3073
  function fn({ params: e, className: t }) {
3074
3074
  const n = (e == null ? void 0 : e.path) ?? "";
3075
- return /* @__PURE__ */ u(Ri, { path: n, kind: Di(n, e == null ? void 0 : e.kind), className: t });
3075
+ return /* @__PURE__ */ l(Ri, { path: n, kind: Di(n, e == null ? void 0 : e.kind), className: t });
3076
3076
  }
3077
3077
  function Fi(e, t) {
3078
3078
  return `${e.replace(/\/$/, "")}${t}`;
@@ -3145,11 +3145,11 @@ async function Oi(e) {
3145
3145
  Array.from(f.querySelectorAll('link[rel~="stylesheet"][href]')).map(async (d) => {
3146
3146
  const a = d.getAttribute("href");
3147
3147
  if (!a) return;
3148
- const l = pr(n, a);
3149
- if (l)
3148
+ const u = pr(n, a);
3149
+ if (u)
3150
3150
  try {
3151
- const p = await mr(Kt(r, l, s), o, i), h = f.createElement("style");
3152
- h.setAttribute("data-boring-html-viewer-href", a), h.textContent = Nt(p, l, r, s), d.replaceWith(h);
3151
+ const p = await mr(Kt(r, u, s), o, i), h = f.createElement("style");
3152
+ h.setAttribute("data-boring-html-viewer-href", a), h.textContent = Nt(p, u, r, s), d.replaceWith(h);
3153
3153
  } catch {
3154
3154
  d.setAttribute("href", Qe(r, n, a, s));
3155
3155
  }
@@ -3174,9 +3174,9 @@ async function Oi(e) {
3174
3174
  ["link", "href"]
3175
3175
  ];
3176
3176
  for (const [d, a] of c)
3177
- for (const l of Array.from(f.querySelectorAll(`${d}[${a}]`))) {
3178
- const p = l.getAttribute(a);
3179
- p && l.setAttribute(a, Qe(r, n, p, s));
3177
+ for (const u of Array.from(f.querySelectorAll(`${d}[${a}]`))) {
3178
+ const p = u.getAttribute(a);
3179
+ p && u.setAttribute(a, Qe(r, n, p, s));
3180
3180
  }
3181
3181
  for (const d of Array.from(f.querySelectorAll("[srcset]"))) {
3182
3182
  const a = d.getAttribute("srcset");
@@ -3191,30 +3191,30 @@ function Mi({ path: e, className: t }) {
3191
3191
  [n, e, r]
3192
3192
  );
3193
3193
  return L(() => {
3194
- const l = new AbortController();
3194
+ const u = new AbortController();
3195
3195
  d(!0), f(null), s(null);
3196
3196
  const p = {};
3197
- return r && (p["x-boring-workspace-id"] = r), mr(a, p, l.signal).then(async (h) => {
3197
+ return r && (p["x-boring-workspace-id"] = r), mr(a, p, u.signal).then(async (h) => {
3198
3198
  s(await Oi({
3199
3199
  html: h,
3200
3200
  path: e,
3201
3201
  apiBaseUrl: n,
3202
3202
  headers: p,
3203
3203
  workspaceRequestId: r,
3204
- signal: l.signal
3204
+ signal: u.signal
3205
3205
  }));
3206
3206
  }).catch((h) => {
3207
- l.signal.aborted || f(h instanceof Error ? h.message : "Failed to load HTML preview");
3207
+ u.signal.aborted || f(h instanceof Error ? h.message : "Failed to load HTML preview");
3208
3208
  }).finally(() => {
3209
- l.signal.aborted || d(!1);
3210
- }), () => l.abort();
3209
+ u.signal.aborted || d(!1);
3210
+ }), () => u.abort();
3211
3211
  }, [n, e, a, r]), e ? c ? /* @__PURE__ */ w("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3212
- /* @__PURE__ */ u(vt, { className: "size-3.5" }),
3213
- /* @__PURE__ */ u("span", { children: "Loading HTML preview..." })
3214
- ] }) : i || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(ze, { title: "Failed to load HTML preview", description: i ?? "Preview unavailable." }) }) : /* @__PURE__ */ w("div", { className: se("flex h-full min-h-0 flex-col bg-background", t), children: [
3212
+ /* @__PURE__ */ l(vt, { className: "size-3.5" }),
3213
+ /* @__PURE__ */ l("span", { children: "Loading HTML preview..." })
3214
+ ] }) : i || o === null ? /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(ze, { title: "Failed to load HTML preview", description: i ?? "Preview unavailable." }) }) : /* @__PURE__ */ w("div", { className: oe("flex h-full min-h-0 flex-col bg-background", t), children: [
3215
3215
  /* @__PURE__ */ w("div", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border/60 px-3 py-2", children: [
3216
- /* @__PURE__ */ u("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: pn(e) }),
3217
- /* @__PURE__ */ u(
3216
+ /* @__PURE__ */ l("div", { className: "min-w-0 truncate text-xs font-medium text-muted-foreground", title: e, children: pn(e) }),
3217
+ /* @__PURE__ */ l(
3218
3218
  "a",
3219
3219
  {
3220
3220
  href: a,
@@ -3225,7 +3225,7 @@ function Mi({ path: e, className: t }) {
3225
3225
  }
3226
3226
  )
3227
3227
  ] }),
3228
- /* @__PURE__ */ u(
3228
+ /* @__PURE__ */ l(
3229
3229
  "iframe",
3230
3230
  {
3231
3231
  srcDoc: o,
@@ -3234,20 +3234,20 @@ function Mi({ path: e, className: t }) {
3234
3234
  className: "min-h-0 flex-1 border-0 bg-white"
3235
3235
  }
3236
3236
  )
3237
- ] }) : /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(ze, { title: "No file selected", description: "Choose an HTML file from the file tree." }) });
3237
+ ] }) : /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ l(ze, { title: "No file selected", description: "Choose an HTML file from the file tree." }) });
3238
3238
  }
3239
3239
  function Wi({ params: e, className: t }) {
3240
- return /* @__PURE__ */ u(Mi, { path: (e == null ? void 0 : e.path) ?? "", className: t });
3240
+ return /* @__PURE__ */ l(Mi, { path: (e == null ? void 0 : e.path) ?? "", className: t });
3241
3241
  }
3242
3242
  function zi({ params: e }) {
3243
3243
  const { path: t } = e, n = t.includes(".") ? t.split(".").pop() : void 0;
3244
- return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-8", children: /* @__PURE__ */ u(
3244
+ return /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center p-8", children: /* @__PURE__ */ l(
3245
3245
  Ln,
3246
3246
  {
3247
3247
  className: "border-0",
3248
3248
  title: "No editor available",
3249
3249
  description: n ? `Install or enable a plugin that handles *.${n} files.` : "Install or enable a plugin that handles this file type.",
3250
- children: /* @__PURE__ */ u(Me, { children: t })
3250
+ children: /* @__PURE__ */ l(Me, { children: t })
3251
3251
  }
3252
3252
  ) });
3253
3253
  }
@@ -3661,40 +3661,40 @@ function hr(e = {}) {
3661
3661
  setHydrationComplete: (a) => c({ hydrationComplete: a }),
3662
3662
  setLayout: (a) => c({ layout: a }),
3663
3663
  setSidebar: (a) => c({ sidebar: { ...d().sidebar, ...a } }),
3664
- setPanelSize: (a, l) => c({ panelSizes: { ...d().panelSizes, [a]: l } }),
3664
+ setPanelSize: (a, u) => c({ panelSizes: { ...d().panelSizes, [a]: u } }),
3665
3665
  setTheme: (a) => {
3666
3666
  c({ preferences: { theme: a } }), r || bn(
3667
3667
  n,
3668
3668
  JSON.stringify({ state: { theme: a }, version: 0 })
3669
3669
  );
3670
3670
  },
3671
- openPanel: (a) => c((l) => ({
3672
- panels: l.panels.some((h) => h.id === a.id) ? l.panels : [...l.panels, a],
3671
+ openPanel: (a) => c((u) => ({
3672
+ panels: u.panels.some((h) => h.id === a.id) ? u.panels : [...u.panels, a],
3673
3673
  activePanel: a.id
3674
3674
  })),
3675
- closePanel: (a) => c((l) => ({
3676
- panels: l.panels.filter((p) => p.id !== a),
3677
- activePanel: l.activePanel === a ? null : l.activePanel
3675
+ closePanel: (a) => c((u) => ({
3676
+ panels: u.panels.filter((p) => p.id !== a),
3677
+ activePanel: u.activePanel === a ? null : u.activePanel
3678
3678
  })),
3679
3679
  activatePanel: (a) => c({ activePanel: a }),
3680
- openFile: (a, l) => c((p) => ({
3680
+ openFile: (a, u) => c((p) => ({
3681
3681
  activeFile: a,
3682
3682
  visibleFiles: p.visibleFiles.includes(a) ? p.visibleFiles : [...p.visibleFiles, a],
3683
- activePanel: l ?? p.activePanel
3683
+ activePanel: u ?? p.activePanel
3684
3684
  })),
3685
- markDirty: (a, l) => c((p) => ({
3685
+ markDirty: (a, u) => c((p) => ({
3686
3686
  dirtyFiles: {
3687
3687
  ...p.dirtyFiles,
3688
- [a]: { panelId: l, savedAt: null }
3688
+ [a]: { panelId: u, savedAt: null }
3689
3689
  }
3690
3690
  })),
3691
- markClean: (a) => c((l) => {
3692
- const { [a]: p, ...h } = l.dirtyFiles;
3691
+ markClean: (a) => c((u) => {
3692
+ const { [a]: p, ...h } = u.dirtyFiles;
3693
3693
  return { dirtyFiles: h };
3694
3694
  }),
3695
- showNotification: (a) => c((l) => ({
3695
+ showNotification: (a) => c((u) => ({
3696
3696
  notifications: [
3697
- ...l.notifications,
3697
+ ...u.notifications,
3698
3698
  {
3699
3699
  ...a,
3700
3700
  id: crypto.randomUUID(),
@@ -3702,10 +3702,10 @@ function hr(e = {}) {
3702
3702
  }
3703
3703
  ]
3704
3704
  })),
3705
- dismissNotification: (a) => c((l) => ({
3706
- notifications: l.notifications.filter((p) => p.id !== a)
3705
+ dismissNotification: (a) => c((u) => ({
3706
+ notifications: u.notifications.filter((p) => p.id !== a)
3707
3707
  })),
3708
- navigateToLine: (a, l) => c({ activeFile: a }),
3708
+ navigateToLine: (a, u) => c({ activeFile: a }),
3709
3709
  resetLayout: () => {
3710
3710
  localStorage.removeItem(t), c({
3711
3711
  layout: null,
@@ -3734,17 +3734,17 @@ function hr(e = {}) {
3734
3734
  const a = JSON.parse(d);
3735
3735
  if ((a == null ? void 0 : a.version) !== void 0 && String(a.version) !== yn)
3736
3736
  return e.onLayoutVersionMismatch ? e.onLayoutVersionMismatch() : localStorage.removeItem(c), null;
3737
- const l = ca(a == null ? void 0 : a.state);
3738
- return l ? { ...a, state: l } : (console.error("Layout restored with defaults"), null);
3737
+ const u = ca(a == null ? void 0 : a.state);
3738
+ return u ? { ...a, state: u } : (console.error("Layout restored with defaults"), null);
3739
3739
  } catch {
3740
3740
  return console.error("Layout restored with defaults"), null;
3741
3741
  }
3742
3742
  },
3743
3743
  setItem: (c, d) => {
3744
- const a = { ...d, version: yn }, l = JSON.stringify(a);
3745
- l.length > vn && console.warn(
3746
- `Workspace state serialized to ${l.length} bytes (budget: <${vn})`
3747
- ), bn(c, l);
3744
+ const a = { ...d, version: yn }, u = JSON.stringify(a);
3745
+ u.length > vn && console.warn(
3746
+ `Workspace state serialized to ${u.length} bytes (budget: <${vn})`
3747
+ ), bn(c, u);
3748
3748
  },
3749
3749
  removeItem: (c) => {
3750
3750
  localStorage.removeItem(c);
@@ -3859,10 +3859,10 @@ function ma({
3859
3859
  [o]
3860
3860
  ), c = S((d) => {
3861
3861
  if (d.type === "catalog") {
3862
- const a = e.find((l) => l.id === d.catalogId);
3862
+ const a = e.find((u) => u.id === d.catalogId);
3863
3863
  a && (xn(a.id, d.rowSnapshot), a.onSelect(d.rowSnapshot));
3864
3864
  } else {
3865
- const a = t.find((l) => l.id === d.commandId);
3865
+ const a = t.find((u) => u.id === d.commandId);
3866
3866
  a && (kn(a.id, a.title), a.run());
3867
3867
  }
3868
3868
  o();
@@ -3926,13 +3926,13 @@ function ha({
3926
3926
  });
3927
3927
  }, [r, o]), a = S(() => {
3928
3928
  d(n === "commands" ? "catalogs" : "commands");
3929
- }, [n, d]), l = S((p) => {
3929
+ }, [n, d]), u = S((p) => {
3930
3930
  p.key === "Tab" && (p.preventDefault(), p.stopPropagation(), a());
3931
3931
  }, [a]);
3932
3932
  return {
3933
3933
  inputRef: s,
3934
3934
  switchMode: d,
3935
- handleInputKeyDown: l
3935
+ handleInputKeyDown: u
3936
3936
  };
3937
3937
  }
3938
3938
  function ga({
@@ -3955,9 +3955,9 @@ function ga({
3955
3955
  }
3956
3956
  const f = new AbortController(), c = [...e];
3957
3957
  i((a) => {
3958
- const l = new Map(a.map((p) => [p.catalog.id, p]));
3958
+ const u = new Map(a.map((p) => [p.catalog.id, p]));
3959
3959
  return c.map((p) => {
3960
- const h = l.get(p.id);
3960
+ const h = u.get(p.id);
3961
3961
  return {
3962
3962
  catalog: p,
3963
3963
  rows: (h == null ? void 0 : h.rows) ?? [],
@@ -3965,23 +3965,23 @@ function ga({
3965
3965
  };
3966
3966
  });
3967
3967
  });
3968
- const d = (a, l) => {
3968
+ const d = (a, u) => {
3969
3969
  f.signal.aborted || i(
3970
3970
  (p) => p.map(
3971
- (h) => h.catalog.id === a.id ? { catalog: a, ...l } : h
3971
+ (h) => h.catalog.id === a.id ? { catalog: a, ...u } : h
3972
3972
  )
3973
3973
  );
3974
3974
  };
3975
3975
  for (const a of c)
3976
3976
  try {
3977
- const l = a.adapter.search({
3977
+ const u = a.adapter.search({
3978
3978
  query: r,
3979
3979
  filters: {},
3980
3980
  limit: mt,
3981
3981
  offset: 0,
3982
3982
  signal: f.signal
3983
3983
  });
3984
- Promise.resolve(l).then(
3984
+ Promise.resolve(u).then(
3985
3985
  (p) => {
3986
3986
  d(a, {
3987
3987
  rows: p.items.slice(0, mt),
@@ -3996,11 +3996,11 @@ function ga({
3996
3996
  });
3997
3997
  }
3998
3998
  );
3999
- } catch (l) {
3999
+ } catch (u) {
4000
4000
  d(a, {
4001
4001
  rows: [],
4002
4002
  loading: !1,
4003
- error: Sn(l)
4003
+ error: Sn(u)
4004
4004
  });
4005
4005
  }
4006
4006
  return () => {
@@ -4014,9 +4014,9 @@ function va(e) {
4014
4014
  for (const R of (d == null ? void 0 : d.registeredPlugins) ?? [])
4015
4015
  R.label && (M[R.id] = R.label);
4016
4016
  return M;
4017
- }, [d == null ? void 0 : d.registeredPlugins]), l = s === "commands", p = r.trim(), h = ga({
4017
+ }, [d == null ? void 0 : d.registeredPlugins]), u = s === "commands", p = r.trim(), h = ga({
4018
4018
  catalogs: f,
4019
- isCommandMode: l,
4019
+ isCommandMode: u,
4020
4020
  searchQuery: p
4021
4021
  }), { inputRef: g, switchMode: m, handleInputKeyDown: b } = ha({
4022
4022
  open: t,
@@ -4030,7 +4030,7 @@ function va(e) {
4030
4030
  return;
4031
4031
  }
4032
4032
  o(M);
4033
- }, []), W = H(() => l ? da(c, p) : [], [c, l, p]), {
4033
+ }, []), W = H(() => u ? da(c, p) : [], [c, u, p]), {
4034
4034
  recentEntries: P,
4035
4035
  handleCatalogSelect: N,
4036
4036
  handleCommandSelect: B,
@@ -4038,11 +4038,11 @@ function va(e) {
4038
4038
  } = ma({
4039
4039
  catalogs: f,
4040
4040
  commands: c,
4041
- isCommandMode: l,
4041
+ isCommandMode: u,
4042
4042
  searchQuery: p,
4043
4043
  close: () => n(!1)
4044
4044
  });
4045
- return /* @__PURE__ */ u(oo, { open: t, onOpenChange: n, children: /* @__PURE__ */ w(
4045
+ return /* @__PURE__ */ l(oo, { open: t, onOpenChange: n, children: /* @__PURE__ */ w(
4046
4046
  so,
4047
4047
  {
4048
4048
  className: "cmdk-shell flex flex-col gap-0 overflow-hidden border-border/60 p-0 shadow-2xl backdrop-blur-md [&>button.dialog-close]:hidden",
@@ -4052,20 +4052,20 @@ function va(e) {
4052
4052
  onEscapeKeyDown: () => n(!1),
4053
4053
  children: [
4054
4054
  /* @__PURE__ */ w(io, { className: "sr-only", children: [
4055
- /* @__PURE__ */ u(ao, { children: "Command Palette" }),
4056
- /* @__PURE__ */ u(co, { children: "Search catalogs or switch to commands" })
4055
+ /* @__PURE__ */ l(ao, { children: "Command Palette" }),
4056
+ /* @__PURE__ */ l(co, { children: "Search catalogs or switch to commands" })
4057
4057
  ] }),
4058
4058
  /* @__PURE__ */ w(lo, { shouldFilter: !1, className: "flex min-h-0 flex-1 flex-col bg-transparent", children: [
4059
- /* @__PURE__ */ u(
4059
+ /* @__PURE__ */ l(
4060
4060
  ya,
4061
4061
  {
4062
4062
  inputRef: g,
4063
- isCommandMode: l,
4063
+ isCommandMode: u,
4064
4064
  query: r,
4065
4065
  onQueryChange: E,
4066
4066
  onInputKeyDown: b,
4067
4067
  onSwitchMode: m,
4068
- loading: !l && h.some((M) => M.loading)
4068
+ loading: !u && h.some((M) => M.loading)
4069
4069
  }
4070
4070
  ),
4071
4071
  /* @__PURE__ */ w(
@@ -4074,29 +4074,29 @@ function va(e) {
4074
4074
  className: "min-h-0 flex-1 overflow-y-auto py-1",
4075
4075
  style: { maxHeight: "none" },
4076
4076
  children: [
4077
- /* @__PURE__ */ u(fo, { className: "py-10 text-center text-sm text-muted-foreground", children: l ? "No matching commands" : "No catalog results" }),
4078
- /* @__PURE__ */ u(
4077
+ /* @__PURE__ */ l(fo, { className: "py-10 text-center text-sm text-muted-foreground", children: u ? "No matching commands" : "No catalog results" }),
4078
+ /* @__PURE__ */ l(
4079
4079
  wa,
4080
4080
  {
4081
- isCommandMode: l,
4081
+ isCommandMode: u,
4082
4082
  recentEntries: P,
4083
4083
  searchQuery: p,
4084
4084
  onRecentSelect: I
4085
4085
  }
4086
4086
  ),
4087
- /* @__PURE__ */ u(
4087
+ /* @__PURE__ */ l(
4088
4088
  ba,
4089
4089
  {
4090
4090
  catalogGroups: h,
4091
- isCommandMode: l,
4091
+ isCommandMode: u,
4092
4092
  onCatalogSelect: N
4093
4093
  }
4094
4094
  ),
4095
- /* @__PURE__ */ u(
4095
+ /* @__PURE__ */ l(
4096
4096
  xa,
4097
4097
  {
4098
4098
  commandResults: W,
4099
- isCommandMode: l,
4099
+ isCommandMode: u,
4100
4100
  pluginLabelMap: a,
4101
4101
  onCommandSelect: B
4102
4102
  }
@@ -4104,7 +4104,7 @@ function va(e) {
4104
4104
  ]
4105
4105
  }
4106
4106
  ),
4107
- /* @__PURE__ */ u(ka, { isCommandMode: l })
4107
+ /* @__PURE__ */ l(ka, { isCommandMode: u })
4108
4108
  ] })
4109
4109
  ]
4110
4110
  }
@@ -4128,20 +4128,20 @@ function ya({
4128
4128
  "aria-label": "Palette mode",
4129
4129
  className: "my-2 ml-3 inline-flex shrink-0 self-center rounded-md border border-border/60 bg-muted/40 p-0.5",
4130
4130
  children: [
4131
- /* @__PURE__ */ u(
4131
+ /* @__PURE__ */ l(
4132
4132
  Cn,
4133
4133
  {
4134
4134
  active: !t,
4135
- icon: /* @__PURE__ */ u(gt, { className: "size-3" }),
4135
+ icon: /* @__PURE__ */ l(gt, { className: "size-3" }),
4136
4136
  label: gr,
4137
4137
  onClick: () => s("catalogs")
4138
4138
  }
4139
4139
  ),
4140
- /* @__PURE__ */ u(
4140
+ /* @__PURE__ */ l(
4141
4141
  Cn,
4142
4142
  {
4143
4143
  active: t,
4144
- icon: /* @__PURE__ */ u(Mt, { className: "size-3" }),
4144
+ icon: /* @__PURE__ */ l(Mt, { className: "size-3" }),
4145
4145
  label: "Commands",
4146
4146
  onClick: () => s("commands")
4147
4147
  }
@@ -4149,7 +4149,7 @@ function ya({
4149
4149
  ]
4150
4150
  }
4151
4151
  ),
4152
- /* @__PURE__ */ u(
4152
+ /* @__PURE__ */ l(
4153
4153
  po,
4154
4154
  {
4155
4155
  ref: e,
@@ -4161,7 +4161,7 @@ function ya({
4161
4161
  }
4162
4162
  )
4163
4163
  ] }),
4164
- /* @__PURE__ */ u(
4164
+ /* @__PURE__ */ l(
4165
4165
  "div",
4166
4166
  {
4167
4167
  "aria-hidden": "true",
@@ -4176,21 +4176,21 @@ function wa({
4176
4176
  searchQuery: n,
4177
4177
  onRecentSelect: r
4178
4178
  }) {
4179
- return e || t.length === 0 || n ? null : /* @__PURE__ */ u(Wt, { heading: "Recent", children: t.map((o) => {
4179
+ return e || t.length === 0 || n ? null : /* @__PURE__ */ l(Wt, { heading: "Recent", children: t.map((o) => {
4180
4180
  const s = o.type === "catalog" ? `recent:catalog:${o.catalogId}:${o.rowId}` : `recent:command:${o.commandId}`;
4181
- return /* @__PURE__ */ u(
4181
+ return /* @__PURE__ */ l(
4182
4182
  yt,
4183
4183
  {
4184
4184
  value: s,
4185
4185
  onSelect: () => r(o),
4186
4186
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
4187
4187
  children: o.type === "catalog" ? /* @__PURE__ */ w(Pe, { children: [
4188
- /* @__PURE__ */ u(Br, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4189
- /* @__PURE__ */ u(Sr, { row: o.rowSnapshot })
4188
+ /* @__PURE__ */ l(Br, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4189
+ /* @__PURE__ */ l(Sr, { row: o.rowSnapshot })
4190
4190
  ] }) : /* @__PURE__ */ w(Pe, { children: [
4191
- /* @__PURE__ */ u(Mt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4192
- /* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.titleSnapshot }),
4193
- /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "command" })
4191
+ /* @__PURE__ */ l(Mt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4192
+ /* @__PURE__ */ l("span", { className: "flex-1 truncate", children: o.titleSnapshot }),
4193
+ /* @__PURE__ */ l("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: "command" })
4194
4194
  ] })
4195
4195
  },
4196
4196
  s
@@ -4202,9 +4202,9 @@ function ba({
4202
4202
  isCommandMode: t,
4203
4203
  onCatalogSelect: n
4204
4204
  }) {
4205
- return t ? null : /* @__PURE__ */ u(Pe, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ w(Wt, { heading: r.catalog.label, children: [
4206
- r.error ? /* @__PURE__ */ u(Sa, { catalogId: r.catalog.id, error: r.error }) : null,
4207
- r.rows.map((o) => /* @__PURE__ */ u(
4205
+ return t ? null : /* @__PURE__ */ l(Pe, { children: e.filter((r) => r.error || r.rows.length > 0).map((r) => /* @__PURE__ */ w(Wt, { heading: r.catalog.label, children: [
4206
+ r.error ? /* @__PURE__ */ l(Sa, { catalogId: r.catalog.id, error: r.error }) : null,
4207
+ r.rows.map((o) => /* @__PURE__ */ l(
4208
4208
  yt,
4209
4209
  {
4210
4210
  value: `${r.catalog.id}:${o.id}`,
@@ -4217,8 +4217,8 @@ function ba({
4217
4217
  contributionKind: "catalog-row",
4218
4218
  contributionId: o.id,
4219
4219
  children: [
4220
- /* @__PURE__ */ u(gt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4221
- /* @__PURE__ */ u(Sr, { row: o })
4220
+ /* @__PURE__ */ l(gt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4221
+ /* @__PURE__ */ l(Sr, { row: o })
4222
4222
  ]
4223
4223
  }
4224
4224
  )
@@ -4235,8 +4235,8 @@ function Sa({ catalogId: e, error: t }) {
4235
4235
  disabled: !0,
4236
4236
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm",
4237
4237
  children: [
4238
- /* @__PURE__ */ u(gt, { className: "size-4 shrink-0 text-destructive/70" }),
4239
- /* @__PURE__ */ u("span", { className: "text-destructive", children: t })
4238
+ /* @__PURE__ */ l(gt, { className: "size-4 shrink-0 text-destructive/70" }),
4239
+ /* @__PURE__ */ l("span", { className: "text-destructive", children: t })
4240
4240
  ]
4241
4241
  }
4242
4242
  );
@@ -4247,17 +4247,17 @@ function xa({
4247
4247
  pluginLabelMap: n,
4248
4248
  onCommandSelect: r
4249
4249
  }) {
4250
- return !t || e.length === 0 ? null : /* @__PURE__ */ u(Wt, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ w(
4250
+ return !t || e.length === 0 ? null : /* @__PURE__ */ l(Wt, { heading: "Commands", children: e.map((o) => /* @__PURE__ */ w(
4251
4251
  yt,
4252
4252
  {
4253
4253
  value: o.title,
4254
4254
  onSelect: () => r(o),
4255
4255
  className: "group flex items-center gap-3 rounded-md px-3 py-2 text-sm aria-selected:bg-[color:oklch(from_var(--accent)_l_c_h/0.10)] aria-selected:text-foreground",
4256
4256
  children: [
4257
- /* @__PURE__ */ u(Mt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4258
- /* @__PURE__ */ u("span", { className: "flex-1 truncate", children: o.title }),
4259
- n[o.pluginId ?? ""] && /* @__PURE__ */ u("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: n[o.pluginId ?? ""] }),
4260
- o.shortcut && /* @__PURE__ */ u(mo, { children: o.shortcut })
4257
+ /* @__PURE__ */ l(Mt, { className: "size-4 shrink-0 text-muted-foreground/70 group-aria-selected:text-[color:var(--accent)]" }),
4258
+ /* @__PURE__ */ l("span", { className: "flex-1 truncate", children: o.title }),
4259
+ n[o.pluginId ?? ""] && /* @__PURE__ */ l("span", { className: "shrink-0 rounded bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground", children: n[o.pluginId ?? ""] }),
4260
+ o.shortcut && /* @__PURE__ */ l(mo, { children: o.shortcut })
4261
4261
  ]
4262
4262
  },
4263
4263
  o.id
@@ -4265,24 +4265,24 @@ function xa({
4265
4265
  }
4266
4266
  function ka({ isCommandMode: e }) {
4267
4267
  return /* @__PURE__ */ w("div", { className: "flex items-center justify-between border-t border-border/50 bg-muted/30 px-3 py-2 text-[11px] text-muted-foreground", children: [
4268
- /* @__PURE__ */ u("span", { className: "font-medium tracking-wide uppercase", children: e ? "Commands" : gr }),
4268
+ /* @__PURE__ */ l("span", { className: "font-medium tracking-wide uppercase", children: e ? "Commands" : gr }),
4269
4269
  /* @__PURE__ */ w("div", { className: "flex items-center gap-3", children: [
4270
4270
  /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4271
- /* @__PURE__ */ u(Me, { children: "tab" }),
4272
- /* @__PURE__ */ u("span", { children: "switch" })
4271
+ /* @__PURE__ */ l(Me, { children: "tab" }),
4272
+ /* @__PURE__ */ l("span", { children: "switch" })
4273
4273
  ] }),
4274
4274
  /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4275
- /* @__PURE__ */ u(Me, { children: /* @__PURE__ */ u(Ur, { className: "size-3" }) }),
4276
- /* @__PURE__ */ u(Me, { children: /* @__PURE__ */ u(qr, { className: "size-3" }) }),
4277
- /* @__PURE__ */ u("span", { children: "navigate" })
4275
+ /* @__PURE__ */ l(Me, { children: /* @__PURE__ */ l(Ur, { className: "size-3" }) }),
4276
+ /* @__PURE__ */ l(Me, { children: /* @__PURE__ */ l(qr, { className: "size-3" }) }),
4277
+ /* @__PURE__ */ l("span", { children: "navigate" })
4278
4278
  ] }),
4279
4279
  /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4280
- /* @__PURE__ */ u(Me, { children: /* @__PURE__ */ u(Vr, { className: "size-3" }) }),
4281
- /* @__PURE__ */ u("span", { children: "open" })
4280
+ /* @__PURE__ */ l(Me, { children: /* @__PURE__ */ l(Vr, { className: "size-3" }) }),
4281
+ /* @__PURE__ */ l("span", { children: "open" })
4282
4282
  ] }),
4283
4283
  /* @__PURE__ */ w("span", { className: "flex items-center gap-1", children: [
4284
- /* @__PURE__ */ u(Me, { children: "esc" }),
4285
- /* @__PURE__ */ u("span", { children: "close" })
4284
+ /* @__PURE__ */ l(Me, { children: "esc" }),
4285
+ /* @__PURE__ */ l("span", { children: "close" })
4286
4286
  ] })
4287
4287
  ] })
4288
4288
  ] });
@@ -4314,9 +4314,9 @@ function Cn({
4314
4314
  }
4315
4315
  function Sr({ row: e }) {
4316
4316
  return /* @__PURE__ */ w("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 truncate", children: [
4317
- /* @__PURE__ */ u("span", { className: "truncate font-medium text-foreground", children: e.title }),
4318
- e.subtitle ? /* @__PURE__ */ u("span", { className: "truncate text-xs text-muted-foreground/70", children: e.subtitle }) : null,
4319
- e.meta ? /* @__PURE__ */ u("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground/70", children: e.meta }) : null
4317
+ /* @__PURE__ */ l("span", { className: "truncate font-medium text-foreground", children: e.title }),
4318
+ e.subtitle ? /* @__PURE__ */ l("span", { className: "truncate text-xs text-muted-foreground/70", children: e.subtitle }) : null,
4319
+ e.meta ? /* @__PURE__ */ l("span", { className: "ml-auto shrink-0 text-xs text-muted-foreground/70", children: e.meta }) : null
4320
4320
  ] });
4321
4321
  }
4322
4322
  function Ca(e) {
@@ -4344,7 +4344,7 @@ function Ea(e) {
4344
4344
  ), (b = e.onOpenArtifact) == null || b.call(e, m);
4345
4345
  },
4346
4346
  [r, o, s, i, e.onOpenArtifact]
4347
- ), a = Ca(c.requestHeaders), l = n.filter((m) => !m.sessionId || m.sessionId === c.sessionId);
4347
+ ), a = Ca(c.requestHeaders), u = n.filter((m) => !m.sessionId || m.sessionId === c.sessionId);
4348
4348
  L(() => {
4349
4349
  if (!(f === null || !r || !o || !s))
4350
4350
  return vs({
@@ -4380,14 +4380,14 @@ function Ea(e) {
4380
4380
  },
4381
4381
  [e.onData]
4382
4382
  );
4383
- return /* @__PURE__ */ u(
4383
+ return /* @__PURE__ */ l(
4384
4384
  t,
4385
4385
  {
4386
4386
  chrome: !1,
4387
4387
  ...c,
4388
4388
  onOpenArtifact: d,
4389
4389
  onData: g,
4390
- composerBlockers: l,
4390
+ composerBlockers: u,
4391
4391
  onComposerStop: p,
4392
4392
  onComposerBlockerAction: h
4393
4393
  }
@@ -4429,8 +4429,8 @@ function Ta(e) {
4429
4429
  var b, E;
4430
4430
  const g = ((b = dt(p.updatedAt)) == null ? void 0 : b.getTime()) ?? 0;
4431
4431
  return (((E = dt(h.updatedAt)) == null ? void 0 : E.getTime()) ?? 0) - g;
4432
- }, l = [];
4433
- return s.length && l.push({ key: "today", label: "Today", items: s.sort(a) }), i.length && l.push({ key: "yesterday", label: "Yesterday", items: i.sort(a) }), f.length && l.push({ key: "week", label: "This week", items: f.sort(a) }), c.length && l.push({ key: "earlier", label: "Earlier", items: c.sort(a) }), d.length && l.push({ key: "undated", label: "Other", items: d }), l;
4432
+ }, u = [];
4433
+ return s.length && u.push({ key: "today", label: "Today", items: s.sort(a) }), i.length && u.push({ key: "yesterday", label: "Yesterday", items: i.sort(a) }), f.length && u.push({ key: "week", label: "This week", items: f.sort(a) }), c.length && u.push({ key: "earlier", label: "Earlier", items: c.sort(a) }), d.length && u.push({ key: "undated", label: "Other", items: d }), u;
4434
4434
  }
4435
4435
  function Aa(e) {
4436
4436
  const t = dt(e);
@@ -4462,33 +4462,32 @@ function Ra({
4462
4462
  "div",
4463
4463
  {
4464
4464
  "data-boring-workspace-part": "session-list",
4465
- className: se("flex h-full min-h-0 flex-col bg-background", i),
4465
+ className: oe(
4466
+ "flex h-full min-h-0 flex-col bg-[color:oklch(from_var(--background)_calc(l-0.01)_c_h)]",
4467
+ i
4468
+ ),
4466
4469
  role: "navigation",
4467
4470
  "aria-label": "Session history",
4468
4471
  children: [
4469
- /* @__PURE__ */ w(
4470
- "div",
4471
- {
4472
- className: "flex items-center justify-between border-b border-[color:oklch(from_var(--border)_l_c_h/0.25)] px-3",
4473
- style: { height: 44 },
4474
- children: [
4475
- /* @__PURE__ */ u("span", { className: "text-[10.5px] font-medium uppercase tracking-[0.12em] text-muted-foreground/70", children: "Sessions" }),
4476
- /* @__PURE__ */ w("div", { className: "flex items-center gap-0.5", children: [
4477
- r && /* @__PURE__ */ u(pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: r, "aria-label": "New session", title: "New chat", children: /* @__PURE__ */ u(Hr, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
4478
- s && /* @__PURE__ */ u(pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: s, "aria-label": "Close sessions", title: "Close sessions (⌘1)", children: /* @__PURE__ */ u(Rn, { className: "h-4 w-4", strokeWidth: 1.75 }) })
4479
- ] })
4480
- ]
4481
- }
4482
- ),
4483
- /* @__PURE__ */ w("div", { className: "flex-1 overflow-y-auto py-2", children: [
4472
+ /* @__PURE__ */ w("div", { className: "flex h-11 items-center justify-between border-b border-border/60 px-3.5", children: [
4473
+ /* @__PURE__ */ l("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
4474
+ /* @__PURE__ */ w("div", { className: "flex items-center gap-0.5", children: [
4475
+ r && /* @__PURE__ */ l(pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: r, "aria-label": "New session", title: "New chat", children: /* @__PURE__ */ l(Hr, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
4476
+ s && /* @__PURE__ */ l(pe, { type: "button", variant: "ghost", size: "icon-xs", onClick: s, "aria-label": "Close sessions", title: "Close sessions (⌘1)", children: /* @__PURE__ */ l(Rn, { className: "h-4 w-4", strokeWidth: 1.75 }) })
4477
+ ] })
4478
+ ] }),
4479
+ /* @__PURE__ */ w("div", { className: "flex-1 overflow-y-auto py-2.5", children: [
4484
4480
  e.length === 0 && /* @__PURE__ */ w("div", { className: "px-3 py-8 text-center text-[13px] text-muted-foreground", children: [
4485
4481
  "No sessions yet.",
4486
- /* @__PURE__ */ u("br", {}),
4482
+ /* @__PURE__ */ l("br", {}),
4487
4483
  "Start a new chat to begin."
4488
4484
  ] }),
4489
- f.map((c, d) => /* @__PURE__ */ w("section", { className: se(d > 0 && "mt-2"), children: [
4490
- /* @__PURE__ */ u("div", { className: "px-4 pb-1 pt-2 text-[10.5px] font-medium uppercase tracking-[0.14em] text-muted-foreground/70", children: c.label }),
4491
- /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: c.items.map((a) => /* @__PURE__ */ u(
4485
+ f.map((c, d) => /* @__PURE__ */ w("section", { className: oe(d > 0 && "mt-4"), children: [
4486
+ /* @__PURE__ */ w("div", { className: "flex items-baseline justify-between gap-2 px-3.5 pb-2 pt-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
4487
+ /* @__PURE__ */ l("span", { children: c.label }),
4488
+ /* @__PURE__ */ l("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: c.items.length })
4489
+ ] }),
4490
+ /* @__PURE__ */ l("ul", { role: "list", className: "flex flex-col", children: c.items.map((a) => /* @__PURE__ */ l(
4492
4491
  Da,
4493
4492
  {
4494
4493
  session: a,
@@ -4517,21 +4516,27 @@ function Da({
4517
4516
  role: "listitem",
4518
4517
  "data-boring-workspace-part": "session-row",
4519
4518
  "data-boring-state": t ? "selected" : void 0,
4520
- className: se(
4521
- "group relative mx-2 flex items-center gap-2 rounded-md px-2 py-1.5 text-[13px] transition-colors duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",
4519
+ className: oe(
4520
+ "group relative mx-2 mt-px flex items-center gap-2 rounded-md px-2.5 py-1.5 text-[13px] transition-colors duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",
4522
4521
  "cursor-pointer hover:bg-foreground/[0.04]",
4523
- t && "border-l-2 border-accent bg-foreground/[0.06] text-foreground"
4522
+ t && "bg-foreground/[0.06] text-foreground"
4524
4523
  ),
4525
4524
  onClick: () => n == null ? void 0 : n(e.id),
4526
4525
  children: [
4527
4526
  /* @__PURE__ */ w("span", { className: "min-w-0 flex-1 truncate leading-5", title: e.title, children: [
4528
- /* @__PURE__ */ u("span", { className: se(t ? "font-medium text-foreground" : "text-foreground/90"), children: e.title || "Untitled" }),
4529
- o && /* @__PURE__ */ w("span", { className: "ml-1.5 text-muted-foreground/70 tabular-nums", children: [
4530
- "· ",
4531
- o
4532
- ] })
4527
+ /* @__PURE__ */ l("span", { className: oe(t ? "font-medium text-foreground" : "text-foreground/90"), children: e.title || "Untitled" }),
4528
+ o && /* @__PURE__ */ l(
4529
+ "span",
4530
+ {
4531
+ className: oe(
4532
+ "ml-1.5 tabular-nums text-[11px]",
4533
+ t ? "text-[color:var(--accent)]" : "text-muted-foreground/60"
4534
+ ),
4535
+ children: o
4536
+ }
4537
+ )
4533
4538
  ] }),
4534
- r && /* @__PURE__ */ u(
4539
+ r && /* @__PURE__ */ l(
4535
4540
  pe,
4536
4541
  {
4537
4542
  type: "button",
@@ -4542,7 +4547,7 @@ function Da({
4542
4547
  s.stopPropagation(), r(e.id);
4543
4548
  },
4544
4549
  "aria-label": `Delete ${e.title || "session"}`,
4545
- children: /* @__PURE__ */ u("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ u("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" }) })
4550
+ children: /* @__PURE__ */ l("svg", { width: "12", height: "12", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ l("path", { d: "M3.5 3.5l7 7M10.5 3.5l-7 7" }) })
4546
4551
  }
4547
4552
  )
4548
4553
  ]
@@ -4588,12 +4593,12 @@ function xr({
4588
4593
  C.push({
4589
4594
  id: K.id,
4590
4595
  title: K.title,
4591
- icon: G ? /* @__PURE__ */ u(G, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ u(Kr, { className: "h-3.5 w-3.5" }),
4596
+ icon: G ? /* @__PURE__ */ l(G, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ l(Kr, { className: "h-3.5 w-3.5" }),
4592
4597
  panel: K
4593
4598
  });
4594
4599
  }
4595
4600
  return C;
4596
- }, [f]), [d, a] = _(n ?? ""), l = c.some((C) => C.id === d) ? d : ((z = c[0]) == null ? void 0 : z.id) ?? "", [p, h] = _(!1), [g, m] = _(""), [b, E] = _(""), W = A(null), P = A(void 0);
4601
+ }, [f]), [d, a] = _(n ?? ""), u = c.some((C) => C.id === d) ? d : ((z = c[0]) == null ? void 0 : z.id) ?? "", [p, h] = _(!1), [g, m] = _(""), [b, E] = _(""), W = A(null), P = A(void 0);
4597
4602
  L(() => (clearTimeout(P.current), P.current = setTimeout(() => E(g), 180), () => clearTimeout(P.current)), [g]), L(() => {
4598
4603
  var C;
4599
4604
  p && ((C = W.current) == null || C.focus());
@@ -4604,7 +4609,7 @@ function xr({
4604
4609
  h((C) => (C && m(""), !C));
4605
4610
  }, []), B = S((C) => {
4606
4611
  C.key === "Escape" && (C.preventDefault(), h(!1), m(""));
4607
- }, []), I = c.find((C) => C.id === l), R = !!!((F = I == null ? void 0 : I.panel) != null && F.chromeless), D = H(
4612
+ }, []), I = c.find((C) => C.id === u), R = !!!((F = I == null ? void 0 : I.panel) != null && F.chromeless), D = H(
4608
4613
  () => ({
4609
4614
  rootDir: e,
4610
4615
  bridge: t,
@@ -4614,34 +4619,34 @@ function xr({
4614
4619
  }),
4615
4620
  [t, b, e]
4616
4621
  );
4617
- return /* @__PURE__ */ w("div", { "data-boring-workspace-part": "workbench-left", className: se("workbench-left-root flex h-full min-h-0 flex-col", o), children: [
4618
- /* @__PURE__ */ w("div", { className: "flex h-11 items-center gap-1 border-b border-[color:oklch(from_var(--border)_l_c_h/0.25)] px-2", children: [
4619
- /* @__PURE__ */ u(ho, { value: l, onValueChange: a, className: "min-w-0 flex-1 overflow-hidden", "aria-label": "Workbench sources", children: /* @__PURE__ */ u(go, { variant: "line", className: "h-auto min-w-0 max-w-full gap-0.5 overflow-x-auto p-0 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: c.map((C) => /* @__PURE__ */ w(
4622
+ return /* @__PURE__ */ w("div", { "data-boring-workspace-part": "workbench-left", className: oe("workbench-left-root flex h-full min-h-0 flex-col", o), children: [
4623
+ /* @__PURE__ */ w("div", { className: "flex h-11 items-center gap-1 border-b border-border/60 px-2.5", children: [
4624
+ /* @__PURE__ */ l(ho, { value: u, onValueChange: a, className: "min-w-0 flex-1 overflow-hidden", "aria-label": "Workbench sources", children: /* @__PURE__ */ l(go, { variant: "line", className: "h-auto min-w-0 max-w-full gap-0.5 overflow-x-auto p-0 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: c.map((C) => /* @__PURE__ */ w(
4620
4625
  vo,
4621
4626
  {
4622
4627
  value: C.id,
4623
4628
  className: "h-8 flex-none gap-1.5 px-2 py-1 text-[12px] data-[state=active]:text-foreground data-[state=active]:after:bg-[color:var(--accent)]",
4624
4629
  children: [
4625
- /* @__PURE__ */ u("span", { className: "data-[state=active]:text-[color:var(--accent)]", children: C.icon }),
4626
- /* @__PURE__ */ u("span", { className: "tracking-tight", children: C.title })
4630
+ /* @__PURE__ */ l("span", { className: "data-[state=active]:text-[color:var(--accent)]", children: C.icon }),
4631
+ /* @__PURE__ */ l("span", { className: "tracking-tight", children: C.title })
4627
4632
  ]
4628
4633
  },
4629
4634
  C.id
4630
4635
  )) }) }),
4631
- R && /* @__PURE__ */ u(
4636
+ R && /* @__PURE__ */ l(
4632
4637
  pe,
4633
4638
  {
4634
4639
  type: "button",
4635
4640
  variant: "ghost",
4636
4641
  size: "icon-xs",
4637
4642
  onClick: N,
4638
- className: se(p && "bg-foreground/5 text-foreground"),
4643
+ className: oe(p && "bg-foreground/5 text-foreground"),
4639
4644
  "aria-label": "Search",
4640
4645
  title: "Search",
4641
- children: /* @__PURE__ */ u(Zt, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
4646
+ children: /* @__PURE__ */ l(Zt, { className: "h-3.5 w-3.5", strokeWidth: 1.75 })
4642
4647
  }
4643
4648
  ),
4644
- r && /* @__PURE__ */ u(
4649
+ r && /* @__PURE__ */ l(
4645
4650
  pe,
4646
4651
  {
4647
4652
  type: "button",
@@ -4650,13 +4655,13 @@ function xr({
4650
4655
  onClick: r,
4651
4656
  "aria-label": "Hide sources",
4652
4657
  title: "Hide sources",
4653
- children: /* @__PURE__ */ u(Rn, { className: "h-4 w-4", strokeWidth: 1.75 })
4658
+ children: /* @__PURE__ */ l(Rn, { className: "h-4 w-4", strokeWidth: 1.75 })
4654
4659
  }
4655
4660
  )
4656
4661
  ] }),
4657
4662
  R && p && /* @__PURE__ */ w("div", { className: "flex items-center gap-1 border-b border-border/60 px-2 py-1.5", children: [
4658
- /* @__PURE__ */ u(Zt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
4659
- /* @__PURE__ */ u(
4663
+ /* @__PURE__ */ l(Zt, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
4664
+ /* @__PURE__ */ l(
4660
4665
  $n,
4661
4666
  {
4662
4667
  ref: W,
@@ -4668,7 +4673,7 @@ function xr({
4668
4673
  className: "h-7 flex-1 border-0 bg-transparent px-0 py-0 text-xs shadow-none focus-visible:ring-0 dark:bg-transparent"
4669
4674
  }
4670
4675
  ),
4671
- g && /* @__PURE__ */ u(
4676
+ g && /* @__PURE__ */ l(
4672
4677
  pe,
4673
4678
  {
4674
4679
  type: "button",
@@ -4676,11 +4681,11 @@ function xr({
4676
4681
  size: "icon-xs",
4677
4682
  onClick: () => m(""),
4678
4683
  "aria-label": "Clear search",
4679
- children: /* @__PURE__ */ u(An, { className: "h-3 w-3" })
4684
+ children: /* @__PURE__ */ l(An, { className: "h-3 w-3" })
4680
4685
  }
4681
4686
  )
4682
4687
  ] }),
4683
- /* @__PURE__ */ u("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ u(Ma, { panel: I == null ? void 0 : I.panel, params: D }) })
4688
+ /* @__PURE__ */ l("div", { className: "min-h-0 flex-1 overflow-hidden", children: /* @__PURE__ */ l(Ma, { panel: I == null ? void 0 : I.panel, params: D }) })
4684
4689
  ] });
4685
4690
  }
4686
4691
  const La = { dispose() {
@@ -4700,16 +4705,16 @@ function Ma({ panel: e, params: t }) {
4700
4705
  const n = H(() => e ? e.lazy ? Ze(
4701
4706
  e.component
4702
4707
  ) : e.component : null, [e]);
4703
- return !e || !n ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center px-4 text-center text-[12px] text-muted-foreground", children: "No workbench source registered." }) : /* @__PURE__ */ u(
4708
+ return !e || !n ? /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center px-4 text-center text-[12px] text-muted-foreground", children: "No workbench source registered." }) : /* @__PURE__ */ l(
4704
4709
  xt,
4705
4710
  {
4706
4711
  pluginId: e.pluginId ?? e.id,
4707
4712
  contributionKind: "panel",
4708
4713
  contributionId: e.id,
4709
- children: /* @__PURE__ */ u(
4714
+ children: /* @__PURE__ */ l(
4710
4715
  ht,
4711
4716
  {
4712
- fallback: /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center px-4 text-center text-[12px] text-muted-foreground", children: "Loading source..." }),
4717
+ fallback: /* @__PURE__ */ l("div", { className: "flex h-full items-center justify-center px-4 text-center text-[12px] text-muted-foreground", children: "Loading source..." }),
4713
4718
  children: Se(n, {
4714
4719
  params: t,
4715
4720
  api: _a,
@@ -4776,7 +4781,7 @@ function Cr({
4776
4781
  watermarkComponent: c,
4777
4782
  className: d
4778
4783
  }) {
4779
- const a = !!(o || r), l = H(() => {
4784
+ const a = !!(o || r), u = H(() => {
4780
4785
  if (!a)
4781
4786
  return Ua(t, n ? new Set(n) : void 0);
4782
4787
  }, [a, t, n]), p = S(
@@ -4793,16 +4798,16 @@ function Cr({
4793
4798
  },
4794
4799
  [o, t]
4795
4800
  );
4796
- return e ? /* @__PURE__ */ u(
4801
+ return e ? /* @__PURE__ */ l(
4797
4802
  "div",
4798
4803
  {
4799
- className: se("h-full w-full", d),
4804
+ className: oe("h-full w-full", d),
4800
4805
  "data-testid": "artifact-surface",
4801
- children: /* @__PURE__ */ u(
4806
+ children: /* @__PURE__ */ l(
4802
4807
  ti,
4803
4808
  {
4804
4809
  layout: Ba,
4805
- persistedLayout: r ?? l,
4810
+ persistedLayout: r ?? u,
4806
4811
  onLayoutChange: p,
4807
4812
  onReady: s,
4808
4813
  allowedPanels: n,
@@ -4860,7 +4865,7 @@ function Va({
4860
4865
  defaultLeftTab: d,
4861
4866
  className: a
4862
4867
  }) {
4863
- const [l, p] = _(() => {
4868
+ const [u, p] = _(() => {
4864
4869
  if (!o) return !1;
4865
4870
  try {
4866
4871
  return localStorage.getItem(`${o}:sidebarCollapsed`) === "1";
@@ -4913,13 +4918,13 @@ function Va({
4913
4918
  console.warn(`[SurfaceShell] openFile: resolver returned unknown panel "${U.component}" for "${T}"`);
4914
4919
  return;
4915
4920
  }
4916
- const oe = Tt(O, U), X = x.getPanel(oe);
4921
+ const se = Tt(O, U), X = x.getPanel(se);
4917
4922
  if (X) {
4918
4923
  U.params && X.api.updateParameters(U.params), X.api.setActive();
4919
4924
  return;
4920
4925
  }
4921
4926
  x.addPanel({
4922
- id: oe,
4927
+ id: se,
4923
4928
  component: U.component,
4924
4929
  title: U.title ?? T.split("/").pop() ?? T,
4925
4930
  params: U.params ?? { path: T }
@@ -4998,12 +5003,12 @@ function Va({
4998
5003
  closeWorkbenchLeftPane: () => p(!0),
4999
5004
  getSnapshot: le
5000
5005
  }), [le, G, ce, ne]), de = S(() => {
5001
- var te, oe;
5006
+ var te, se;
5002
5007
  const v = m.current, x = v ? v.panels.map((X) => ({
5003
5008
  id: X.id,
5004
5009
  component: String(X.component ?? ""),
5005
5010
  params: X.params ?? void 0
5006
- })) : [], T = ((te = v == null ? void 0 : v.activePanel) == null ? void 0 : te.id) ?? null, O = ((oe = v == null ? void 0 : v.activePanel) == null ? void 0 : oe.params) ?? void 0, U = typeof (O == null ? void 0 : O.path) == "string" ? O.path : null;
5011
+ })) : [], T = ((te = v == null ? void 0 : v.activePanel) == null ? void 0 : te.id) ?? null, O = ((se = v == null ? void 0 : v.activePanel) == null ? void 0 : se.params) ?? void 0, U = typeof (O == null ? void 0 : O.path) == "string" ? O.path : null;
5007
5012
  return {
5008
5013
  hydrationComplete: !0,
5009
5014
  layout: null,
@@ -5047,9 +5052,9 @@ function Va({
5047
5052
  "NO_SURFACE_PANEL",
5048
5053
  `surface resolver "${O.kind}" returned unknown panel "${U.component}"`
5049
5054
  );
5050
- const oe = Tt(O, U), X = x.getPanel(oe);
5055
+ const se = Tt(O, U), X = x.getPanel(se);
5051
5056
  return X ? (U.params && X.api.updateParameters(U.params), X.api.setActive(), ke()) : (x.addPanel({
5052
- id: oe,
5057
+ id: se,
5053
5058
  component: U.component,
5054
5059
  title: U.title ?? T.split("/").pop() ?? T,
5055
5060
  params: U.params ?? { path: T }
@@ -5091,10 +5096,10 @@ function Va({
5091
5096
  }
5092
5097
  }), [Ue, de]), Ve = S(
5093
5098
  (v) => {
5094
- if (l) return;
5099
+ if (u) return;
5095
5100
  v.preventDefault(), v.currentTarget.setPointerCapture(v.pointerId), E.current = { startX: v.clientX, startWidth: h };
5096
5101
  },
5097
- [l, h]
5102
+ [u, h]
5098
5103
  ), ee = S(
5099
5104
  (v) => {
5100
5105
  const x = E.current;
@@ -5107,11 +5112,11 @@ function Va({
5107
5112
  E.current && (E.current = null, v.currentTarget.releasePointerCapture(v.pointerId));
5108
5113
  }, []), ae = S(
5109
5114
  (v) => {
5110
- if (l) return;
5115
+ if (u) return;
5111
5116
  const x = v.shiftKey ? 32 : 16;
5112
5117
  v.key === "ArrowLeft" ? (v.preventDefault(), g((T) => Math.max(n, T - x))) : v.key === "ArrowRight" ? (v.preventDefault(), g((T) => Math.min(r, T + x))) : v.key === "Home" ? (v.preventDefault(), g(n)) : v.key === "End" && (v.preventDefault(), g(r));
5113
5118
  },
5114
- [l, n, r]
5119
+ [u, n, r]
5115
5120
  );
5116
5121
  return L(() => {
5117
5122
  if (o)
@@ -5122,19 +5127,19 @@ function Va({
5122
5127
  }, [o, h]), L(() => {
5123
5128
  if (o)
5124
5129
  try {
5125
- localStorage.setItem(`${o}:sidebarCollapsed`, l ? "1" : "0");
5130
+ localStorage.setItem(`${o}:sidebarCollapsed`, u ? "1" : "0");
5126
5131
  } catch {
5127
5132
  }
5128
- }, [o, l]), /* @__PURE__ */ w(
5133
+ }, [o, u]), /* @__PURE__ */ w(
5129
5134
  "div",
5130
5135
  {
5131
5136
  ref: b,
5132
5137
  "data-boring-workspace-part": "surface",
5133
- className: se("flex h-full min-h-0 w-full bg-background", a),
5138
+ className: oe("flex h-full min-h-0 w-full bg-background", a),
5134
5139
  "data-testid": "surface-shell",
5135
5140
  children: [
5136
- l ? null : /* @__PURE__ */ w(Pe, { children: [
5137
- /* @__PURE__ */ u(
5141
+ u ? null : /* @__PURE__ */ w(Pe, { children: [
5142
+ /* @__PURE__ */ l(
5138
5143
  "aside",
5139
5144
  {
5140
5145
  "data-boring-workspace-part": "surface-sidebar",
@@ -5142,7 +5147,7 @@ function Va({
5142
5147
  className: "flex h-full min-h-0 flex-col",
5143
5148
  style: { width: h, minWidth: h, maxWidth: h },
5144
5149
  "aria-label": "Workbench left pane",
5145
- children: /* @__PURE__ */ u(
5150
+ children: /* @__PURE__ */ l(
5146
5151
  xr,
5147
5152
  {
5148
5153
  rootDir: e,
@@ -5153,7 +5158,7 @@ function Va({
5153
5158
  )
5154
5159
  }
5155
5160
  ),
5156
- /* @__PURE__ */ u(
5161
+ /* @__PURE__ */ l(
5157
5162
  "div",
5158
5163
  {
5159
5164
  role: "separator",
@@ -5165,34 +5170,34 @@ function Va({
5165
5170
  onPointerUp: ie,
5166
5171
  onPointerCancel: ie,
5167
5172
  onKeyDown: ae,
5168
- className: se(
5173
+ className: oe(
5169
5174
  "relative w-px shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-primary/40",
5170
5175
  "focus-visible:outline-none focus-visible:bg-primary/50"
5171
5176
  ),
5172
- children: /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "absolute inset-y-0 -left-1.5 -right-1.5" })
5177
+ children: /* @__PURE__ */ l("span", { "aria-hidden": "true", className: "absolute inset-y-0 -left-1.5 -right-1.5" })
5173
5178
  }
5174
5179
  )
5175
5180
  ] }),
5176
5181
  /* @__PURE__ */ w("div", { className: "relative min-w-0 flex-1", children: [
5177
- /* @__PURE__ */ u(
5182
+ /* @__PURE__ */ l(
5178
5183
  "div",
5179
5184
  {
5180
5185
  "data-boring-workspace-part": "surface-tabs",
5181
- "data-boring-state": l ? "collapsed" : "expanded",
5186
+ "data-boring-state": u ? "collapsed" : "expanded",
5182
5187
  className: "workbench-dockview h-full",
5183
- "data-collapsed-sources": l ? "true" : void 0,
5184
- children: /* @__PURE__ */ u(
5188
+ "data-collapsed-sources": u ? "true" : void 0,
5189
+ children: /* @__PURE__ */ l(
5185
5190
  Cr,
5186
5191
  {
5187
5192
  storageKey: o,
5188
5193
  onReady: Fe,
5189
5194
  allowedPanels: K,
5190
- rightHeaderActions: f ? () => /* @__PURE__ */ u(Ha, { onClose: f }) : void 0
5195
+ rightHeaderActions: f ? () => /* @__PURE__ */ l(Ha, { onClose: f }) : void 0
5191
5196
  }
5192
5197
  )
5193
5198
  }
5194
5199
  ),
5195
- l && /* @__PURE__ */ u("div", { className: "pointer-events-none absolute left-0 top-0 z-20 flex items-center", style: { height: 44 }, children: /* @__PURE__ */ u(
5200
+ u && /* @__PURE__ */ l("div", { className: "pointer-events-none absolute left-0 top-0 z-20 flex items-center", style: { height: 44 }, children: /* @__PURE__ */ l(
5196
5201
  pe,
5197
5202
  {
5198
5203
  type: "button",
@@ -5202,14 +5207,14 @@ function Va({
5202
5207
  className: "pointer-events-auto ml-2",
5203
5208
  "aria-label": "Show sources",
5204
5209
  title: "Show sources",
5205
- children: /* @__PURE__ */ u(ft, { className: "h-4 w-4", strokeWidth: 1.75 })
5210
+ children: /* @__PURE__ */ l(ft, { className: "h-4 w-4", strokeWidth: 1.75 })
5206
5211
  }
5207
5212
  ) }),
5208
- /* @__PURE__ */ u(
5213
+ /* @__PURE__ */ l(
5209
5214
  Ka,
5210
5215
  {
5211
5216
  api: W,
5212
- collapsed: l,
5217
+ collapsed: u,
5213
5218
  onExpandFiles: () => p(!1),
5214
5219
  onClose: f
5215
5220
  }
@@ -5220,7 +5225,7 @@ function Va({
5220
5225
  );
5221
5226
  }
5222
5227
  function Ha({ onClose: e }) {
5223
- return /* @__PURE__ */ u(
5228
+ return /* @__PURE__ */ l(
5224
5229
  pe,
5225
5230
  {
5226
5231
  type: "button",
@@ -5230,7 +5235,7 @@ function Ha({ onClose: e }) {
5230
5235
  className: "mx-1",
5231
5236
  "aria-label": "Close workbench",
5232
5237
  title: "Close workbench (⌘2)",
5233
- children: /* @__PURE__ */ u(Dn, { className: "h-4 w-4", strokeWidth: 1.75 })
5238
+ children: /* @__PURE__ */ l(Dn, { className: "h-4 w-4", strokeWidth: 1.75 })
5234
5239
  }
5235
5240
  );
5236
5241
  }
@@ -5251,7 +5256,7 @@ function Ka({
5251
5256
  };
5252
5257
  }, [e]), o ? /* @__PURE__ */ w(Pe, { children: [
5253
5258
  /* @__PURE__ */ w("div", { className: "pointer-events-none absolute inset-x-0 top-0 flex items-center gap-0.5 border-b border-[color:oklch(from_var(--border)_l_c_h/0.4)] bg-background px-1", style: { height: 44 }, children: [
5254
- t && /* @__PURE__ */ u(
5259
+ t && /* @__PURE__ */ l(
5255
5260
  pe,
5256
5261
  {
5257
5262
  type: "button",
@@ -5261,11 +5266,11 @@ function Ka({
5261
5266
  className: "pointer-events-auto mx-1",
5262
5267
  "aria-label": "Show sources",
5263
5268
  title: "Show sources",
5264
- children: /* @__PURE__ */ u(ft, { className: "h-4 w-4", strokeWidth: 1.75 })
5269
+ children: /* @__PURE__ */ l(ft, { className: "h-4 w-4", strokeWidth: 1.75 })
5265
5270
  }
5266
5271
  ),
5267
- /* @__PURE__ */ u("div", { className: "flex-1" }),
5268
- r && /* @__PURE__ */ u(
5272
+ /* @__PURE__ */ l("div", { className: "flex-1" }),
5273
+ r && /* @__PURE__ */ l(
5269
5274
  pe,
5270
5275
  {
5271
5276
  type: "button",
@@ -5275,17 +5280,17 @@ function Ka({
5275
5280
  className: "pointer-events-auto mx-1",
5276
5281
  "aria-label": "Close workbench",
5277
5282
  title: "Close workbench (⌘2)",
5278
- children: /* @__PURE__ */ u(Dn, { className: "h-4 w-4", strokeWidth: 1.75 })
5283
+ children: /* @__PURE__ */ l(Dn, { className: "h-4 w-4", strokeWidth: 1.75 })
5279
5284
  }
5280
5285
  )
5281
5286
  ] }),
5282
- /* @__PURE__ */ w("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-3 px-6 pt-12 pb-10 text-center", children: [
5283
- /* @__PURE__ */ w("div", { className: "flex items-center gap-2 text-[10.5px] font-medium uppercase tracking-[0.16em] text-muted-foreground", children: [
5284
- /* @__PURE__ */ u("span", { className: "inline-block h-px w-4 bg-[color:var(--accent)]", "aria-hidden": "true" }),
5287
+ /* @__PURE__ */ w("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-start justify-center gap-2 px-6 pt-12 pb-10", children: [
5288
+ /* @__PURE__ */ w("div", { className: "flex items-center gap-2 text-[11px] font-medium tracking-tight text-muted-foreground/75", children: [
5289
+ /* @__PURE__ */ l("span", { className: "inline-block h-px w-3 bg-[color:var(--accent)]", "aria-hidden": "true" }),
5285
5290
  "Workbench"
5286
5291
  ] }),
5287
- /* @__PURE__ */ u("div", { className: "text-[15px] font-medium tracking-tight text-foreground", children: "Nothing open yet" }),
5288
- /* @__PURE__ */ u("p", { className: "max-w-[280px] text-[12.5px] leading-relaxed text-muted-foreground", children: "Open a source item, or let the agent produce an artifact here." }),
5292
+ /* @__PURE__ */ l("div", { className: "text-[15px] font-medium tracking-tight text-foreground", children: "Nothing open yet" }),
5293
+ /* @__PURE__ */ l("p", { className: "max-w-[280px] text-[12.5px] leading-relaxed text-muted-foreground/85", children: "Open a source item, or let the agent produce an artifact here." }),
5289
5294
  t && /* @__PURE__ */ w(
5290
5295
  Ce,
5291
5296
  {
@@ -5295,7 +5300,7 @@ function Ka({
5295
5300
  onClick: n,
5296
5301
  className: "pointer-events-auto mt-2 gap-1.5 text-[12px] hover:border-[color:var(--accent)]/40 hover:text-[color:var(--accent)]",
5297
5302
  children: [
5298
- /* @__PURE__ */ u(ft, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }),
5303
+ /* @__PURE__ */ l(ft, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }),
5299
5304
  "Show sources"
5300
5305
  ]
5301
5306
  }
@@ -5336,7 +5341,7 @@ function Za({ children: e }) {
5336
5341
  () => ({ blockers: t, addBlocker: r, removeBlocker: o }),
5337
5342
  [t, r, o]
5338
5343
  );
5339
- return /* @__PURE__ */ u(Er.Provider, { value: s, children: e });
5344
+ return /* @__PURE__ */ l(Er.Provider, { value: s, children: e });
5340
5345
  }
5341
5346
  const Je = "boring-ui:agent-plugins-reloaded";
5342
5347
  function Nr(e, t) {
@@ -5508,7 +5513,7 @@ function mc(e) {
5508
5513
  return;
5509
5514
  }
5510
5515
  let f = !1;
5511
- const c = rc(t, n, r, o), d = ec(Nr(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), a = new EventSource(d, { withCredentials: !0 }), l = (g) => {
5516
+ const c = rc(t, n, r, o), d = ec(Nr(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), a = new EventSource(d, { withCredentials: !0 }), u = (g) => {
5512
5517
  (async () => {
5513
5518
  let m;
5514
5519
  try {
@@ -5561,7 +5566,7 @@ function mc(e) {
5561
5566
  console.error("[boring-ui] failed to process plugin error event", m);
5562
5567
  }
5563
5568
  };
5564
- return a.addEventListener("boring.plugin.load", l), a.addEventListener("boring.plugin.unload", p), a.addEventListener("boring.plugin.error", h), () => {
5569
+ return a.addEventListener("boring.plugin.load", u), a.addEventListener("boring.plugin.unload", p), a.addEventListener("boring.plugin.error", h), () => {
5565
5570
  f = !0, i.current.clear(), a.close();
5566
5571
  };
5567
5572
  }, [e.apiBaseUrl, e.workspaceId, e.enabled, e.authHeaders, e.importFront, t, n, r, o]);
@@ -5607,7 +5612,7 @@ function Qc({ children: e, defaultTheme: t, onThemeChange: n }) {
5607
5612
  document.documentElement.removeAttribute("data-theme");
5608
5613
  }), [f]);
5609
5614
  const c = H(() => ({ setTheme: s, toggleTheme: i }), [s, i]);
5610
- return /* @__PURE__ */ u(Jt.Provider, { value: c, children: e });
5615
+ return /* @__PURE__ */ l(Jt.Provider, { value: c, children: e });
5611
5616
  }
5612
5617
  const Tr = xe(null);
5613
5618
  function Zc() {
@@ -5692,10 +5697,10 @@ function kc({
5692
5697
  }, [t, e]), null;
5693
5698
  }
5694
5699
  function Cc({ plugins: e }) {
5695
- return /* @__PURE__ */ u(Pe, { children: e.flatMap(
5700
+ return /* @__PURE__ */ l(Pe, { children: e.flatMap(
5696
5701
  (t) => t.registrations.bindings.map((n) => {
5697
5702
  const r = n.component;
5698
- return /* @__PURE__ */ u(r, {}, `${t.id}:${n.id}`);
5703
+ return /* @__PURE__ */ l(r, {}, `${t.id}:${n.id}`);
5699
5704
  })
5700
5705
  ) });
5701
5706
  }
@@ -5711,7 +5716,7 @@ function Pc({
5711
5716
  (f) => f.registrations.providers.map((c) => ({ plugin: f, provider: c }))
5712
5717
  ).reduceRight((f, { plugin: c, provider: d }) => {
5713
5718
  const a = d.component;
5714
- return /* @__PURE__ */ u(
5719
+ return /* @__PURE__ */ l(
5715
5720
  a,
5716
5721
  {
5717
5722
  apiBaseUrl: t,
@@ -5746,7 +5751,7 @@ function el({
5746
5751
  apiBaseUrl: c = "",
5747
5752
  authHeaders: d,
5748
5753
  apiTimeout: a,
5749
- defaultTheme: l,
5754
+ defaultTheme: u,
5750
5755
  onThemeChange: p,
5751
5756
  workspaceId: h,
5752
5757
  storageKey: g,
@@ -5765,7 +5770,7 @@ function el({
5765
5770
  persistenceEnabled: m
5766
5771
  });
5767
5772
  sr(ee);
5768
- const ie = l ?? Ir();
5773
+ const ie = u ?? Ir();
5769
5774
  ie !== "light" && !m ? ee.getState().setTheme(ie) : ie !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || ee.getState().setTheme(ie)), B.current = ee;
5770
5775
  }
5771
5776
  const I = B.current, M = A(null), R = A(d);
@@ -5794,8 +5799,8 @@ function el({
5794
5799
  }, [b, I]);
5795
5800
  const { panelRegistry: z, commandRegistry: F, catalogRegistry: C, surfaceResolverRegistry: K, pluginMetas: G, pluginsWithBindings: ne } = H(() => {
5796
5801
  const ee = new Vs(f), ie = new Qi(), ae = new Mn(), v = new Wn();
5797
- for (const oe of Ya) {
5798
- const { id: X, ...he } = oe;
5802
+ for (const se of Ya) {
5803
+ const { id: X, ...he } = se;
5799
5804
  ee.register(X, he);
5800
5805
  }
5801
5806
  const T = new Set(r ?? []).has(gn.pluginId) ? [] : [gn], U = Do({
@@ -5807,14 +5812,14 @@ function el({
5807
5812
  }), te = [
5808
5813
  { id: "workspace:chat-layout", label: "Layout" },
5809
5814
  { id: "agent:chat-layout", label: "Layout" },
5810
- ...U.plugins.map((oe) => ({
5811
- id: oe.id,
5812
- label: oe.label
5815
+ ...U.plugins.map((se) => ({
5816
+ id: se.id,
5817
+ label: se.label
5813
5818
  }))
5814
5819
  ];
5815
5820
  if (o)
5816
- for (const oe of o) {
5817
- const { id: X, ...he } = oe;
5821
+ for (const se of o) {
5822
+ const { id: X, ...he } = se;
5818
5823
  ee.register(X, he);
5819
5824
  }
5820
5825
  return {
@@ -5850,7 +5855,7 @@ function el({
5850
5855
  () => ({ chatPanel: t ?? null, registeredPlugins: G, debug: P }),
5851
5856
  [t, G, P]
5852
5857
  );
5853
- return /* @__PURE__ */ u(Yt.Provider, { value: Ve, children: /* @__PURE__ */ u(Jt.Provider, { value: Te, children: /* @__PURE__ */ u(Tr.Provider, { value: qe, children: /* @__PURE__ */ u(Za, { children: /* @__PURE__ */ u(Mo, { children: /* @__PURE__ */ u(
5858
+ return /* @__PURE__ */ l(Yt.Provider, { value: Ve, children: /* @__PURE__ */ l(Jt.Provider, { value: Te, children: /* @__PURE__ */ l(Tr.Provider, { value: qe, children: /* @__PURE__ */ l(Za, { children: /* @__PURE__ */ l(Mo, { children: /* @__PURE__ */ l(
5854
5859
  $o,
5855
5860
  {
5856
5861
  panelRegistry: z,
@@ -5866,19 +5871,19 @@ function el({
5866
5871
  onAuthError: E,
5867
5872
  apiTimeout: a,
5868
5873
  children: [
5869
- /* @__PURE__ */ u(Cc, { plugins: ne }),
5870
- /* @__PURE__ */ u(gc, { apiBaseUrl: c, workspaceId: h, mode: N, authHeaders: d }),
5871
- /* @__PURE__ */ u(Ec, { onOpenFile: W }),
5872
- /* @__PURE__ */ u(xc, { commands: s }),
5873
- /* @__PURE__ */ u(
5874
+ /* @__PURE__ */ l(Cc, { plugins: ne }),
5875
+ /* @__PURE__ */ l(gc, { apiBaseUrl: c, workspaceId: h, mode: N, authHeaders: d }),
5876
+ /* @__PURE__ */ l(Ec, { onOpenFile: W }),
5877
+ /* @__PURE__ */ l(xc, { commands: s }),
5878
+ /* @__PURE__ */ l(
5874
5879
  kc,
5875
5880
  {
5876
5881
  catalogs: i
5877
5882
  }
5878
5883
  ),
5879
- /* @__PURE__ */ u(Sc, { store: I }),
5880
- /* @__PURE__ */ u(va, {}),
5881
- /* @__PURE__ */ u(yo, {}),
5884
+ /* @__PURE__ */ l(Sc, { store: I }),
5885
+ /* @__PURE__ */ l(va, {}),
5886
+ /* @__PURE__ */ l(yo, {}),
5882
5887
  e,
5883
5888
  typeof import.meta < "u" && !1
5884
5889
  ]