@hachej/boring-workspace 0.1.32 → 0.1.33

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.
@@ -53,39 +53,39 @@ function He(e) {
53
53
  return [...e];
54
54
  }
55
55
  function Zn(e = {}) {
56
- const t = [], n = [], r = [], o = [], i = [], a = [], l = [], c = /* @__PURE__ */ new Map(), d = (s, f) => {
57
- const p = `${s}:${f}`, h = c.get(p);
56
+ const t = [], n = [], r = [], o = [], i = [], a = [], l = [], c = /* @__PURE__ */ new Map(), f = (s, d) => {
57
+ const p = `${s}:${d}`, h = c.get(p);
58
58
  if (h !== void 0) {
59
59
  const g = e.pluginId ?? "<plugin>";
60
60
  throw new Ut(
61
61
  "duplicate-id",
62
- `plugin "${g}" registers ${s} "${f}" twice (first as ${h}, then again). If you are composing kits, two of them are registering the same id — namespace one of them.`
62
+ `plugin "${g}" registers ${s} "${d}" twice (first as ${h}, then again). If you are composing kits, two of them are registering the same id — namespace one of them.`
63
63
  );
64
64
  }
65
- c.set(p, `${s} "${f}"`);
65
+ c.set(p, `${s} "${d}"`);
66
66
  };
67
67
  return {
68
68
  registerProvider(s) {
69
- d("provider", s.id), t.push(s);
69
+ f("provider", s.id), t.push(s);
70
70
  },
71
71
  registerBinding(s) {
72
- d("binding", s.id), n.push(s);
72
+ f("binding", s.id), n.push(s);
73
73
  },
74
74
  registerCatalog(s) {
75
- d("catalog", s.id), r.push(s);
75
+ f("catalog", s.id), r.push(s);
76
76
  },
77
77
  registerPanel(s) {
78
- d("panel", s.id), o.push(s);
78
+ f("panel", s.id), o.push(s);
79
79
  },
80
80
  registerPanelCommand(s) {
81
- d("command", s.id), i.push(s);
81
+ f("command", s.id), i.push(s);
82
82
  },
83
83
  registerLeftTab(s) {
84
- d("left-tab", s.id), a.push(s);
84
+ f("left-tab", s.id), a.push(s);
85
85
  },
86
86
  registerSurfaceResolver(s) {
87
- const f = s.id ?? `${e.pluginId ?? "anon"}:${s.kind}`;
88
- d("surface-resolver", f), s.id === void 0 && (s.id = f), l.push(s);
87
+ const d = s.id ?? `${e.pluginId ?? "anon"}:${s.kind}`;
88
+ f("surface-resolver", d), s.id === void 0 && (s.id = d), l.push(s);
89
89
  },
90
90
  flush() {
91
91
  return {
@@ -335,9 +335,9 @@ class tr {
335
335
  let n, r = -1 / 0, o = !1, i = -1;
336
336
  return this.registrationOrder.forEach((a, l) => {
337
337
  const c = this.resolvers.get(a);
338
- let d;
338
+ let f;
339
339
  try {
340
- d = c.resolve(t);
340
+ f = c.resolve(t);
341
341
  } catch (p) {
342
342
  console.warn(
343
343
  `[SurfaceResolverRegistry] resolver "${a}" failed:`,
@@ -345,9 +345,9 @@ class tr {
345
345
  );
346
346
  return;
347
347
  }
348
- if (!d) return;
349
- const s = d.score ?? 0, f = c.source === "app";
350
- (s > r || s === r && f && !o || s === r && f === o && l >= i) && (n = d, r = s, o = f, i = l);
348
+ if (!f) return;
349
+ const s = f.score ?? 0, d = c.source === "app";
350
+ (s > r || s === r && d && !o || s === r && d === o && l >= i) && (n = f, r = s, o = d, i = l);
351
351
  }), n;
352
352
  }
353
353
  emit() {
@@ -365,7 +365,7 @@ function ii({
365
365
  }) {
366
366
  const i = T(null), a = T(null);
367
367
  i.current || (i.current = new er()), a.current || (a.current = new tr());
368
- const l = n ?? i.current, c = r ?? a.current, d = H(
368
+ const l = n ?? i.current, c = r ?? a.current, f = H(
369
369
  () => ({
370
370
  panelRegistry: e,
371
371
  commandRegistry: t,
@@ -374,7 +374,7 @@ function ii({
374
374
  }),
375
375
  [e, t, l, c]
376
376
  );
377
- return /* @__PURE__ */ u(dt.Provider, { value: d, children: o });
377
+ return /* @__PURE__ */ u(dt.Provider, { value: f, children: o });
378
378
  }
379
379
  function At() {
380
380
  const e = se(dt);
@@ -524,15 +524,15 @@ function Si(e) {
524
524
  function o() {
525
525
  return { seq: r(), status: "ok" };
526
526
  }
527
- function i(c, d) {
528
- return { seq: r(), status: "error", error: { code: c, message: d } };
527
+ function i(c, f) {
528
+ return { seq: r(), status: "error", error: { code: c, message: f } };
529
529
  }
530
- function a(c, d) {
530
+ function a(c, f) {
531
531
  const s = n.get(c);
532
532
  if (s)
533
- for (const f of [...s])
533
+ for (const d of [...s])
534
534
  try {
535
- f(d);
535
+ d(f);
536
536
  } catch (p) {
537
537
  console.error(`[bridge] listener for "${String(c)}" threw:`, p);
538
538
  }
@@ -550,19 +550,19 @@ function Si(e) {
550
550
  getVisibleFiles() {
551
551
  return e.getState().visibleFiles;
552
552
  },
553
- async openFile(c, d) {
554
- const s = hi.safeParse({ path: c, mode: d == null ? void 0 : d.mode });
553
+ async openFile(c, f) {
554
+ const s = hi.safeParse({ path: c, mode: f == null ? void 0 : f.mode });
555
555
  if (!s.success) return i("VALIDATION", s.error.issues[0].message);
556
- const f = e.getState(), p = s.data.mode ?? "edit", h = `file:${c}`;
557
- if (f.panels.find((v) => v.id === h)) {
558
- const v = f.activePanel;
559
- return f.activatePanel(h), f.visibleFiles.includes(c) || f.openFile(c, h), a("panel:activated", { panelId: h, previousPanelId: v }), o();
556
+ const d = e.getState(), p = s.data.mode ?? "edit", h = `file:${c}`;
557
+ if (d.panels.find((v) => v.id === h)) {
558
+ const v = d.activePanel;
559
+ return d.activatePanel(h), d.visibleFiles.includes(c) || d.openFile(c, h), a("panel:activated", { panelId: h, previousPanelId: v }), o();
560
560
  }
561
- return f.panels.length >= ht ? i("MAX_PANELS", `cannot exceed ${ht} open panels`) : (f.openFile(c, h), f.openPanel({ id: h, component: "editor", params: { path: c, mode: p } }), a("file:opened", { path: c, mode: p }), a("panel:opened", { panelId: h, params: { path: c, mode: p } }), o());
561
+ return d.panels.length >= ht ? i("MAX_PANELS", `cannot exceed ${ht} open panels`) : (d.openFile(c, h), d.openPanel({ id: h, component: "editor", params: { path: c, mode: p } }), a("file:opened", { path: c, mode: p }), a("panel:opened", { panelId: h, params: { path: c, mode: p } }), o());
562
562
  },
563
563
  async openPanel(c) {
564
- const d = gi.safeParse(c);
565
- if (!d.success) return i("VALIDATION", d.error.issues[0].message);
564
+ const f = gi.safeParse(c);
565
+ if (!f.success) return i("VALIDATION", f.error.issues[0].message);
566
566
  const s = e.getState();
567
567
  if (s.panels.find((p) => p.id === c.id)) {
568
568
  const p = s.activePanel;
@@ -575,31 +575,31 @@ function Si(e) {
575
575
  }), a("panel:opened", { panelId: c.id, params: c.params ?? {} }), o());
576
576
  },
577
577
  async closePanel(c) {
578
- const d = vi.safeParse({ id: c });
579
- if (!d.success) return i("VALIDATION", d.error.issues[0].message);
580
- const s = e.getState(), f = s.panels.find((p) => p.id === c);
581
- return f ? f.essential ? i("ESSENTIAL", `panel ${c} is essential and cannot be closed`) : (s.closePanel(c), a("panel:closed", { panelId: c }), o()) : i("NOT_FOUND", `panel ${c} not found`);
578
+ const f = vi.safeParse({ id: c });
579
+ if (!f.success) return i("VALIDATION", f.error.issues[0].message);
580
+ const s = e.getState(), d = s.panels.find((p) => p.id === c);
581
+ return d ? d.essential ? i("ESSENTIAL", `panel ${c} is essential and cannot be closed`) : (s.closePanel(c), a("panel:closed", { panelId: c }), o()) : i("NOT_FOUND", `panel ${c} not found`);
582
582
  },
583
583
  async closeWorkbenchLeftPane() {
584
584
  return e.getState().setSidebar({ collapsed: !0 }), a("sidebar:toggled", { collapsed: !0 }), o();
585
585
  },
586
- async showNotification(c, d = "info") {
587
- const s = yi.safeParse({ msg: c, level: d });
586
+ async showNotification(c, f = "info") {
587
+ const s = yi.safeParse({ msg: c, level: f });
588
588
  if (!s.success) return i("VALIDATION", s.error.issues[0].message);
589
- const f = s.data.level ?? "info", p = f === "warn" ? "warning" : f;
590
- return e.getState().showNotification({ message: s.data.msg, type: p }), a("notification:shown", { message: s.data.msg, level: f }), o();
589
+ const d = s.data.level ?? "info", p = d === "warn" ? "warning" : d;
590
+ return e.getState().showNotification({ message: s.data.msg, type: p }), a("notification:shown", { message: s.data.msg, level: d }), o();
591
591
  },
592
- async navigateToLine(c, d) {
593
- const s = wi.safeParse({ file: c, line: d });
592
+ async navigateToLine(c, f) {
593
+ const s = wi.safeParse({ file: c, line: f });
594
594
  if (!s.success) return i("VALIDATION", s.error.issues[0].message);
595
- const f = await l.openFile(c);
596
- return f.status === "error" ? f : (e.getState().navigateToLine(c, s.data.line), o());
595
+ const d = await l.openFile(c);
596
+ return d.status === "error" ? d : (e.getState().navigateToLine(c, s.data.line), o());
597
597
  },
598
598
  async expandToFile(c) {
599
- const d = bi.safeParse({ path: c });
600
- if (!d.success) return i("VALIDATION", d.error.issues[0].message);
599
+ const f = bi.safeParse({ path: c });
600
+ if (!f.success) return i("VALIDATION", f.error.issues[0].message);
601
601
  const s = e.getState();
602
- return s.sidebar.collapsed && (s.setSidebar({ collapsed: !1 }), a("sidebar:toggled", { collapsed: !1 })), a("tree:expand", { path: d.data.path }), o();
602
+ return s.sidebar.collapsed && (s.setSidebar({ collapsed: !1 }), a("sidebar:toggled", { collapsed: !1 })), a("tree:expand", { path: f.data.path }), o();
603
603
  },
604
604
  markDirty(c) {
605
605
  e.getState().markDirty(c, "bridge"), a("file:dirty", { path: c, dirty: !0 });
@@ -607,17 +607,17 @@ function Si(e) {
607
607
  markClean(c) {
608
608
  e.getState().markClean(c), a("file:dirty", { path: c, dirty: !1 });
609
609
  },
610
- subscribe(c, d) {
610
+ subscribe(c, f) {
611
611
  let s = n.get(c);
612
612
  s || (s = /* @__PURE__ */ new Set(), n.set(c, s));
613
- const f = d;
614
- return s.add(f), () => s.delete(f);
613
+ const d = f;
614
+ return s.add(d), () => s.delete(d);
615
615
  },
616
- select(c, d) {
616
+ select(c, f) {
617
617
  let s = c(e.getState());
618
- return e.subscribe((f) => {
619
- const p = c(f);
620
- Object.is(p, s) || (s = p, d(p));
618
+ return e.subscribe((d) => {
619
+ const p = c(d);
620
+ Object.is(p, s) || (s = p, f(p));
621
621
  });
622
622
  }
623
623
  };
@@ -695,11 +695,11 @@ function Ci(e) {
695
695
  pollInterval: a = ki,
696
696
  onAuthError: l,
697
697
  onVersionMismatch: c,
698
- onConnectionChange: d
698
+ onConnectionChange: f
699
699
  } = e;
700
- let s = null, f = null, p = null, h = null, g = !1, v = !1, w = 0;
700
+ let s = null, d = null, p = null, h = null, g = !1, v = !1, w = 0;
701
701
  function S(N) {
702
- v || g !== N && (g = N, d == null || d(N));
702
+ v || g !== N && (g = N, f == null || f(N));
703
703
  }
704
704
  async function _(N) {
705
705
  if (v) return;
@@ -810,10 +810,10 @@ function Ci(e) {
810
810
  }
811
811
  return {
812
812
  connect() {
813
- v = !1, !i && typeof EventSource < "u" ? F() : (I(), f = setInterval(I, a)), x();
813
+ v = !1, !i && typeof EventSource < "u" ? F() : (I(), d = setInterval(I, a)), x();
814
814
  },
815
815
  disconnect() {
816
- s && (s.close(), s = null), f !== null && (clearInterval(f), f = null), p !== null && (clearTimeout(p), p = null), h && (h(), h = null), S(!1), v = !0;
816
+ s && (s.close(), s = null), d !== null && (clearInterval(d), d = null), p !== null && (clearTimeout(p), p = null), h && (h(), h = null), S(!1), v = !0;
817
817
  },
818
818
  pushState(N) {
819
819
  _(N);
@@ -909,10 +909,10 @@ function qt(e, t) {
909
909
  const l = (c) => {
910
910
  try {
911
911
  c.openPanel(i);
912
- } catch (d) {
912
+ } catch (f) {
913
913
  console.warn(
914
914
  "[uiCommandDispatcher] openPanel dispatch failed:",
915
- d instanceof Error ? d.message : d
915
+ f instanceof Error ? f.message : f
916
916
  );
917
917
  }
918
918
  };
@@ -1003,21 +1003,21 @@ function vn(e, t) {
1003
1003
  }
1004
1004
  function Bi(e) {
1005
1005
  const t = e.endpoint ?? "", n = e.ctx, r = e.query, o = e.eventSourceCtor === null ? null : e.eventSourceCtor ?? (typeof EventSource < "u" ? EventSource : null), i = e.fetcher ?? (typeof fetch < "u" ? fetch : null), a = e.reconnectDelayMs ?? zi, l = e.maxReconnects ?? ji, c = e.pollIntervalMs ?? Wi;
1006
- let d = !1, s = null, f = null, p = null, h = null, g = 0, v = !1;
1006
+ let f = !1, s = null, d = null, p = null, h = null, g = 0, v = !1;
1007
1007
  function w(L) {
1008
1008
  L && typeof L == "object" && typeof L.kind == "string" && qt(L, n);
1009
1009
  }
1010
1010
  function S() {
1011
- if (d || v || !i) return;
1011
+ if (f || v || !i) return;
1012
1012
  v = !0;
1013
1013
  const L = async () => {
1014
- if (!d) {
1014
+ if (!f) {
1015
1015
  p = new AbortController();
1016
1016
  try {
1017
1017
  const m = await i(vn(`${t}/api/v1/ui/commands/next?poll=true`, r), {
1018
1018
  signal: p.signal
1019
1019
  });
1020
- if (d) return;
1020
+ if (f) return;
1021
1021
  if (m.ok) {
1022
1022
  const F = await m.json();
1023
1023
  if (Array.isArray(F)) for (const I of F) w(I);
@@ -1026,13 +1026,13 @@ function Bi(e) {
1026
1026
  } finally {
1027
1027
  p = null;
1028
1028
  }
1029
- d || (f = setTimeout(L, c));
1029
+ f || (d = setTimeout(L, c));
1030
1030
  }
1031
1031
  };
1032
1032
  L();
1033
1033
  }
1034
1034
  function _() {
1035
- if (!d) {
1035
+ if (!f) {
1036
1036
  if (!o) {
1037
1037
  S();
1038
1038
  return;
@@ -1047,7 +1047,7 @@ function Bi(e) {
1047
1047
  }), s.addEventListener("init", () => {
1048
1048
  g = 0;
1049
1049
  }), s.addEventListener("error", () => {
1050
- if (!d) {
1050
+ if (!f) {
1051
1051
  if (s == null || s.close(), s = null, g += 1, g > l) {
1052
1052
  S();
1053
1053
  return;
@@ -1058,7 +1058,7 @@ function Bi(e) {
1058
1058
  }
1059
1059
  }
1060
1060
  return _(), () => {
1061
- d = !0, s && (s.close(), s = null), f && (clearTimeout(f), f = null), p && (p.abort(), p = null), h && (clearTimeout(h), h = null);
1061
+ f = !0, s && (s.close(), s = null), d && (clearTimeout(d), d = null), p && (p.abort(), p = null), h && (clearTimeout(h), h = null);
1062
1062
  };
1063
1063
  }
1064
1064
  const Ui = 1e4, qi = 3, Vi = 1e3;
@@ -1084,20 +1084,20 @@ class Hi {
1084
1084
  this.headers = n, this.onAuthError = t.onAuthError, this.onTimeout = t.onTimeout, this.timeout = t.timeout ?? Ui, this.maxRetries = t.maxRetries ?? qi, this.retryBaseMs = t.retryBaseMs ?? Vi;
1085
1085
  }
1086
1086
  async request(t, n, r, o, i) {
1087
- var c, d;
1087
+ var c, f;
1088
1088
  const a = o ?? this.timeout;
1089
1089
  let l = null;
1090
1090
  for (let s = 0; s <= this.maxRetries; s++) {
1091
1091
  s > 0 && await Ki(this.retryBaseMs * 2 ** (s - 1));
1092
- const f = new AbortController(), p = () => f.abort();
1092
+ const d = new AbortController(), p = () => d.abort();
1093
1093
  i == null || i.addEventListener("abort", p, { once: !0 });
1094
- const h = setTimeout(() => f.abort(), a);
1094
+ const h = setTimeout(() => d.abort(), a);
1095
1095
  try {
1096
1096
  const g = r != null, v = await fetch(`${this.baseUrl}${n}`, {
1097
1097
  method: t,
1098
1098
  headers: g ? { ...this.headers, "Content-Type": "application/json" } : this.headers,
1099
1099
  body: g ? JSON.stringify(r) : void 0,
1100
- signal: f.signal
1100
+ signal: d.signal
1101
1101
  });
1102
1102
  if (clearTimeout(h), i == null || i.removeEventListener("abort", p), v.status === 401 || v.status === 403)
1103
1103
  throw (c = this.onAuthError) == null || c.call(this, v.status), new je(v.status, `Auth error: ${v.status}`);
@@ -1120,7 +1120,7 @@ class Hi {
1120
1120
  if (g instanceof DOMException && g.name === "AbortError") {
1121
1121
  if (i != null && i.aborted)
1122
1122
  throw g;
1123
- (d = this.onTimeout) == null || d.call(this, n), l = new je(0, `Request timeout after ${a}ms: ${n}`);
1123
+ (f = this.onTimeout) == null || f.call(this, n), l = new je(0, `Request timeout after ${a}ms: ${n}`);
1124
1124
  continue;
1125
1125
  }
1126
1126
  if (g instanceof TypeError) {
@@ -1270,7 +1270,7 @@ function ns() {
1270
1270
  } catch {
1271
1271
  return;
1272
1272
  }
1273
- const d = (h) => {
1273
+ const f = (h) => {
1274
1274
  if (a.has(h)) return !1;
1275
1275
  if (a.add(h), l.push(h), l.length > c) {
1276
1276
  const g = l.shift();
@@ -1284,14 +1284,14 @@ function ns() {
1284
1284
  } catch {
1285
1285
  return;
1286
1286
  }
1287
- typeof (g == null ? void 0 : g.eventId) != "string" || typeof g.change != "object" || g.change == null || d(g.eventId) && rs(g.change);
1288
- }, f = () => {
1287
+ typeof (g == null ? void 0 : g.eventId) != "string" || typeof g.change != "object" || g.change == null || f(g.eventId) && rs(g.change);
1288
+ }, d = () => {
1289
1289
  i = !0, o == null || o.close();
1290
1290
  }, p = () => {
1291
1291
  a.clear(), l.length = 0, n.invalidateQueries({ predicate: (h) => os(h.queryKey) });
1292
1292
  };
1293
- return o.addEventListener("change", s), o.addEventListener("unsupported", f), o.addEventListener("resync-required", p), () => {
1294
- o && (o.removeEventListener("change", s), o.removeEventListener("unsupported", f), o.removeEventListener("resync-required", p), i || o.close(), o = null);
1293
+ return o.addEventListener("change", s), o.addEventListener("unsupported", d), o.addEventListener("resync-required", p), () => {
1294
+ o && (o.removeEventListener("change", s), o.removeEventListener("unsupported", d), o.removeEventListener("resync-required", p), i || o.close(), o = null);
1295
1295
  };
1296
1296
  }, [e, t, n]);
1297
1297
  }
@@ -1353,7 +1353,7 @@ function as({
1353
1353
  defaultOptions: {
1354
1354
  queries: {
1355
1355
  retry: 3,
1356
- retryDelay: (d) => Math.min(1e3 * 2 ** d, 3e4)
1356
+ retryDelay: (f) => Math.min(1e3 * 2 ** f, 3e4)
1357
1357
  }
1358
1358
  }
1359
1359
  }));
@@ -1635,13 +1635,13 @@ class Ps {
1635
1635
  const r = this, o = function(a) {
1636
1636
  var h;
1637
1637
  nt(r.subscribe, r.getSnapshot, r.getSnapshot);
1638
- const l = r.get(t), c = r.generation, d = !!(l && r.satisfiesCapabilities(l)), s = H(() => !l || !r.satisfiesCapabilities(l) ? () => null : l.lazy ? r.getLazyComponent(t, l.component) : l.component, [l == null ? void 0 : l.component, l == null ? void 0 : l.lazy, l == null ? void 0 : l.requiresCapabilities, c]);
1639
- if (!d) return null;
1640
- const f = (l == null ? void 0 : l.pluginId) ?? (l == null ? void 0 : l.id) ?? t, p = typeof ((h = a == null ? void 0 : a.api) == null ? void 0 : h.id) == "string" ? a.api.id : void 0;
1638
+ const l = r.get(t), c = r.generation, f = !!(l && r.satisfiesCapabilities(l)), s = H(() => !l || !r.satisfiesCapabilities(l) ? () => null : l.lazy ? r.getLazyComponent(t, l.component) : l.component, [l == null ? void 0 : l.component, l == null ? void 0 : l.lazy, l == null ? void 0 : l.requiresCapabilities, c]);
1639
+ if (!f) return null;
1640
+ const d = (l == null ? void 0 : l.pluginId) ?? (l == null ? void 0 : l.id) ?? t, p = typeof ((h = a == null ? void 0 : a.api) == null ? void 0 : h.id) == "string" ? a.api.id : void 0;
1641
1641
  return de(
1642
1642
  ks,
1643
1643
  {
1644
- pluginId: f,
1644
+ pluginId: d,
1645
1645
  panelId: t,
1646
1646
  panelInstanceId: p,
1647
1647
  revision: l == null ? void 0 : l.pluginRevision,
@@ -1882,7 +1882,7 @@ function Ls(e) {
1882
1882
  }
1883
1883
  return document.addEventListener("pointerdown", m), () => document.removeEventListener("pointerdown", m);
1884
1884
  }, [i]);
1885
- const c = r.endsWith(" ●"), d = c ? r.slice(0, -2) : r, s = Cs(d), f = Ts(e.params, "path") ?? As(t.id), p = Ns(e).map(Rs).filter((m) => m.id !== t.id && m.close), [h, g] = M(!1);
1885
+ const c = r.endsWith(" ●"), f = c ? r.slice(0, -2) : r, s = Cs(f), d = Ts(e.params, "path") ?? As(t.id), p = Ns(e).map(Rs).filter((m) => m.id !== t.id && m.close), [h, g] = M(!1);
1886
1886
  Vt(ve.editorSaveStart, (m) => {
1887
1887
  m.panelId === t.id && g(!0);
1888
1888
  }), Vt(ve.editorSaveEnd, (m) => {
@@ -1891,7 +1891,7 @@ function Ls(e) {
1891
1891
  const v = (m) => {
1892
1892
  m.preventDefault(), m.stopPropagation(), n && m.nativeEvent.stopImmediatePropagation(), t.close(), n && Ds();
1893
1893
  }, w = (m) => {
1894
- !f && p.length === 0 || (m.preventDefault(), m.stopPropagation(), a({ x: m.clientX, y: m.clientY }));
1894
+ !d && p.length === 0 || (m.preventDefault(), m.stopPropagation(), a({ x: m.clientX, y: m.clientY }));
1895
1895
  }, S = (m) => {
1896
1896
  a(null), Fs(m);
1897
1897
  }, _ = () => {
@@ -1911,13 +1911,13 @@ function Ls(e) {
1911
1911
  m.preventDefault(), m.stopPropagation();
1912
1912
  },
1913
1913
  children: [
1914
- f ? /* @__PURE__ */ u(
1914
+ d ? /* @__PURE__ */ u(
1915
1915
  "button",
1916
1916
  {
1917
1917
  type: "button",
1918
1918
  role: "menuitem",
1919
1919
  className: "flex w-full items-center rounded-sm px-2 py-1.5 text-left text-xs hover:bg-accent hover:text-accent-foreground",
1920
- onClick: () => S(f),
1920
+ onClick: () => S(d),
1921
1921
  children: "Copy path"
1922
1922
  }
1923
1923
  ) : null,
@@ -1945,7 +1945,7 @@ function Ls(e) {
1945
1945
  "text-[12.5px] leading-none tracking-tight",
1946
1946
  "cursor-pointer transition-colors"
1947
1947
  ),
1948
- title: c ? `${d} (unsaved changes)` : d,
1948
+ title: c ? `${f} (unsaved changes)` : f,
1949
1949
  onPointerDown: (m) => {
1950
1950
  m.button === 2 && w(m);
1951
1951
  },
@@ -1969,7 +1969,7 @@ function Ls(e) {
1969
1969
  strokeWidth: 1.5
1970
1970
  }
1971
1971
  ),
1972
- /* @__PURE__ */ u("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: d }),
1972
+ /* @__PURE__ */ u("span", { className: "min-w-0 flex-1 overflow-hidden text-ellipsis whitespace-nowrap", children: f }),
1973
1973
  /* @__PURE__ */ P("div", { className: "flex shrink-0 items-center gap-1", children: [
1974
1974
  c ? /* @__PURE__ */ u(
1975
1975
  "span",
@@ -1998,7 +1998,7 @@ function Ls(e) {
1998
1998
  // dockview's native row click listener (see handleClose).
1999
1999
  { onClickCapture: v }
2000
2000
  ) : { onClick: v },
2001
- "aria-label": `Close ${d}`,
2001
+ "aria-label": `Close ${f}`,
2002
2002
  children: /* @__PURE__ */ u(Hn, { className: "h-3 w-3", strokeWidth: 2.25 })
2003
2003
  }
2004
2004
  )
@@ -2076,17 +2076,17 @@ function Ms(e) {
2076
2076
  if (!i) return;
2077
2077
  const a = i.view.contentComponent, l = i.params, c = i.title;
2078
2078
  o.removePanel(i);
2079
- const d = { id: n, component: a, params: l, title: c };
2079
+ const f = { id: n, component: a, params: l, title: c };
2080
2080
  if ("groupId" in r) {
2081
- const s = o.groups.find((f) => f.id === r.groupId);
2081
+ const s = o.groups.find((d) => d.id === r.groupId);
2082
2082
  o.addPanel({
2083
- ...d,
2083
+ ...f,
2084
2084
  position: s ? { referenceGroup: s } : void 0
2085
2085
  });
2086
2086
  } else {
2087
2087
  const s = o.getPanel(r.referencePanelId);
2088
2088
  o.addPanel({
2089
- ...d,
2089
+ ...f,
2090
2090
  position: s ? { referencePanel: s, direction: r.direction } : void 0
2091
2091
  });
2092
2092
  }
@@ -2144,58 +2144,58 @@ function zs(e, t, n, r, o, i) {
2144
2144
  a.fromJSON(n);
2145
2145
  else {
2146
2146
  let s = !1;
2147
- for (const f of t.groups)
2148
- if (f.panel) {
2149
- if (!r.has(f.panel)) {
2147
+ for (const d of t.groups)
2148
+ if (d.panel) {
2149
+ if (!r.has(d.panel)) {
2150
2150
  console.error(
2151
- `[DockviewShell] Panel "${f.panel}" not found in registry. Available: ${r.list().map((p) => p.id).join(", ")}`
2151
+ `[DockviewShell] Panel "${d.panel}" not found in registry. Available: ${r.list().map((p) => p.id).join(", ")}`
2152
2152
  );
2153
2153
  continue;
2154
2154
  }
2155
2155
  a.addPanel({
2156
- id: f.panel,
2157
- component: f.panel,
2158
- params: f.params,
2159
- position: s ? { direction: Os(f.position) } : void 0
2156
+ id: d.panel,
2157
+ component: d.panel,
2158
+ params: d.params,
2159
+ position: s ? { direction: Os(d.position) } : void 0
2160
2160
  }), s = !0;
2161
2161
  }
2162
2162
  }
2163
2163
  for (const s of t.groups) {
2164
- const f = a.getPanel(s.panel ?? s.id);
2165
- f != null && f.group && (s.locked && (f.group.locked = "no-drop-target"), s.hideHeader && (f.group.header.hidden = !0), xn(a, s));
2164
+ const d = a.getPanel(s.panel ?? s.id);
2165
+ d != null && d.group && (s.locked && (d.group.locked = "no-drop-target"), s.hideHeader && (d.group.header.hidden = !0), xn(a, s));
2166
2166
  }
2167
2167
  const l = t.groups.filter(
2168
2168
  (s) => {
2169
- var f;
2170
- return typeof ((f = s.constraints) == null ? void 0 : f.maxWidthViewportRatio) == "number";
2169
+ var d;
2170
+ return typeof ((d = s.constraints) == null ? void 0 : d.maxWidthViewportRatio) == "number";
2171
2171
  }
2172
2172
  );
2173
2173
  let c;
2174
2174
  if (l.length > 0) {
2175
2175
  const s = () => {
2176
- for (const f of l)
2177
- xn(a, f);
2176
+ for (const d of l)
2177
+ xn(a, d);
2178
2178
  };
2179
2179
  window.addEventListener("resize", s), c = () => window.removeEventListener("resize", s);
2180
2180
  }
2181
- let d;
2181
+ let f;
2182
2182
  if (o) {
2183
2183
  let s = null;
2184
- const f = () => {
2184
+ const d = () => {
2185
2185
  s && clearTimeout(s), s = setTimeout(() => {
2186
2186
  o(a.toJSON());
2187
2187
  }, $s);
2188
- }, p = a.onDidLayoutChange(f), h = () => {
2188
+ }, p = a.onDidLayoutChange(d), h = () => {
2189
2189
  s && (clearTimeout(s), o(a.toJSON()));
2190
2190
  };
2191
- window.addEventListener("beforeunload", h), d = () => {
2191
+ window.addEventListener("beforeunload", h), f = () => {
2192
2192
  h(), p.dispose(), window.removeEventListener("beforeunload", h), c == null || c();
2193
2193
  };
2194
2194
  } else
2195
- d = () => {
2195
+ f = () => {
2196
2196
  c == null || c();
2197
2197
  };
2198
- return d;
2198
+ return f;
2199
2199
  }
2200
2200
  function js({
2201
2201
  layout: e,
@@ -2208,27 +2208,27 @@ function js({
2208
2208
  rightHeaderActions: l,
2209
2209
  watermarkComponent: c
2210
2210
  }) {
2211
- const d = At(), s = nt(d.subscribe, d.getSnapshot, d.getSnapshot), f = Es(), p = T(null), h = T(null), g = T(void 0), v = T(null), w = H(() => {
2212
- const m = d.getComponents(), F = o ? Object.fromEntries(Object.entries(m).filter(([x]) => o.includes(x))) : m, I = v.current;
2211
+ const f = At(), s = nt(f.subscribe, f.getSnapshot, f.getSnapshot), d = Es(), p = T(null), h = T(null), g = T(void 0), v = T(null), w = H(() => {
2212
+ const m = f.getComponents(), F = o ? Object.fromEntries(Object.entries(m).filter(([x]) => o.includes(x))) : m, I = v.current;
2213
2213
  if (I) {
2214
2214
  const x = Object.keys(I), D = Object.keys(F);
2215
2215
  if (x.length === D.length && D.every((N) => I[N] === F[N]))
2216
2216
  return I;
2217
2217
  }
2218
2218
  return v.current = F, F;
2219
- }, [d, s, o]), S = H(() => Ms(p), []), _ = k(
2219
+ }, [f, s, o]), S = H(() => Ms(p), []), _ = k(
2220
2220
  (m) => {
2221
2221
  var F;
2222
2222
  (F = g.current) == null || F.call(g), g.current = zs(
2223
2223
  m,
2224
2224
  e,
2225
2225
  t,
2226
- d,
2226
+ f,
2227
2227
  r,
2228
2228
  p
2229
2229
  ), n == null || n(m.api);
2230
2230
  },
2231
- [e, t, d, r, n]
2231
+ [e, t, f, r, n]
2232
2232
  );
2233
2233
  $(() => () => {
2234
2234
  var m;
@@ -2254,17 +2254,17 @@ function js({
2254
2254
  }, []);
2255
2255
  const L = k(
2256
2256
  (m) => {
2257
- if (!f) {
2257
+ if (!d) {
2258
2258
  h.current = m;
2259
2259
  return;
2260
2260
  }
2261
2261
  _(m);
2262
2262
  },
2263
- [f, _]
2263
+ [d, _]
2264
2264
  );
2265
2265
  return $(() => {
2266
- f && h.current && (_(h.current), h.current = null);
2267
- }, [f, _]), f ? /* @__PURE__ */ u(br.Provider, { value: S, children: /* @__PURE__ */ u(
2266
+ d && h.current && (_(h.current), h.current = null);
2267
+ }, [d, _]), d ? /* @__PURE__ */ u(br.Provider, { value: S, children: /* @__PURE__ */ u(
2268
2268
  qo,
2269
2269
  {
2270
2270
  className: `dv-shell ${i ?? ""}`,
@@ -2418,7 +2418,7 @@ async function Gs(e) {
2418
2418
  }
2419
2419
  if (!n) throw new Error("Clipboard not available");
2420
2420
  }
2421
- const xr = () => import("./FileTree-BltQETt9.js").then((e) => ({ default: e.FileTree }));
2421
+ const xr = () => import("./FileTree-SmsE0Raq.js").then((e) => ({ default: e.FileTree }));
2422
2422
  function Js() {
2423
2423
  xr();
2424
2424
  }
@@ -2441,7 +2441,7 @@ function Pn({
2441
2441
  className: i
2442
2442
  }) {
2443
2443
  var dn;
2444
- const a = Me(), { data: l, error: c, isLoading: d } = mr(e), [s, f] = M(/* @__PURE__ */ new Map()), p = Ot(e), h = H(
2444
+ const a = Me(), { data: l, error: c, isLoading: f } = mr(e), [s, d] = M(/* @__PURE__ */ new Map()), p = Ot(e), h = H(
2445
2445
  () => Mt(l, s.get(p)),
2446
2446
  [l, s, p]
2447
2447
  ), g = H(
@@ -2563,12 +2563,12 @@ function Pn({
2563
2563
  };
2564
2564
  }, [n, Re, be]);
2565
2565
  const Ke = k((b, R) => {
2566
- f((A) => {
2566
+ d((A) => {
2567
2567
  const U = Ot(b), Y = new Map(A), ee = Mt(Y.get(U), [R]) ?? [R];
2568
2568
  return Y.set(U, ee), Y;
2569
2569
  });
2570
2570
  }, []), De = k((b, R) => {
2571
- f((A) => {
2571
+ d((A) => {
2572
2572
  const U = Ot(b), Y = A.get(U);
2573
2573
  if (!(Y != null && Y.length)) return A;
2574
2574
  const ee = Y.filter((Te) => Te.path !== R), Pe = new Map(A);
@@ -2738,7 +2738,7 @@ function Pn({
2738
2738
  ref: I,
2739
2739
  className: "min-h-0 flex-1 overflow-hidden",
2740
2740
  onContextMenu: Z,
2741
- children: d ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((b, R) => /* @__PURE__ */ u(
2741
+ children: f ? /* @__PURE__ */ u("div", { className: "space-y-1 p-2", "data-testid": "tree-skeleton", children: Array.from({ length: 8 }).map((b, R) => /* @__PURE__ */ u(
2742
2742
  vo,
2743
2743
  {
2744
2744
  className: "h-5",
@@ -2846,7 +2846,7 @@ function Xs({
2846
2846
  chromeless: a = !1,
2847
2847
  className: l
2848
2848
  }) {
2849
- const c = (e == null ? void 0 : e.rootDir) ?? t, d = (e == null ? void 0 : e.bridge) ?? o, s = (e == null ? void 0 : e.chromeless) ?? a, f = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, h = r ?? i, [g, v] = M(""), [w, S] = M(""), _ = T(void 0);
2849
+ const c = (e == null ? void 0 : e.rootDir) ?? t, f = (e == null ? void 0 : e.bridge) ?? o, s = (e == null ? void 0 : e.chromeless) ?? a, d = (e == null ? void 0 : e.revealFileTreeRequest) ?? null, p = (e == null ? void 0 : e.searchQuery) ?? (e == null ? void 0 : e.query) ?? n, h = r ?? i, [g, v] = M(""), [w, S] = M(""), _ = T(void 0);
2850
2850
  $(() => (clearTimeout(_.current), _.current = setTimeout(() => S(g), 200), () => clearTimeout(_.current)), [g]);
2851
2851
  const L = p !== void 0 ? p || void 0 : w || void 0;
2852
2852
  return s ? /* @__PURE__ */ u(
@@ -2854,8 +2854,8 @@ function Xs({
2854
2854
  {
2855
2855
  rootDir: c,
2856
2856
  searchQuery: L,
2857
- bridge: d,
2858
- revealFileTreeRequest: f,
2857
+ bridge: f,
2858
+ revealFileTreeRequest: d,
2859
2859
  className: oe("px-1 pt-1 [&_[role=treeitem]]:!indent-0", l)
2860
2860
  }
2861
2861
  ) : /* @__PURE__ */ u(qs, { title: "Files", panelApi: h, children: /* @__PURE__ */ P("div", { className: "flex h-full flex-col", children: [
@@ -2874,8 +2874,8 @@ function Xs({
2874
2874
  {
2875
2875
  rootDir: c,
2876
2876
  searchQuery: L,
2877
- bridge: d,
2878
- revealFileTreeRequest: f,
2877
+ bridge: f,
2878
+ revealFileTreeRequest: d,
2879
2879
  className: l
2880
2880
  }
2881
2881
  ) })
@@ -2972,7 +2972,7 @@ function oa() {
2972
2972
  }
2973
2973
  const ia = 250, sa = 3e3, aa = 3e4;
2974
2974
  function ca(e, t) {
2975
- const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, l] = M(!1), [c, d] = M(!1), [s, f] = M(null), [p, h] = M(!1), [g, v] = M(!1), w = T(void 0), S = T(null), _ = T(0), L = T(null), m = T(0), F = T(void 0), I = T(o);
2975
+ const { adapter: n, panelId: r, onDirtyChange: o, serverMtime: i } = t, [a, l] = M(!1), [c, f] = M(!1), [s, d] = M(null), [p, h] = M(!1), [g, v] = M(!1), w = T(void 0), S = T(null), _ = T(0), L = T(null), m = T(0), F = T(void 0), I = T(o);
2976
2976
  I.current = o;
2977
2977
  const x = T(n);
2978
2978
  x.current = n;
@@ -2984,7 +2984,7 @@ function ca(e, t) {
2984
2984
  let G = null;
2985
2985
  return G = (async () => {
2986
2986
  var me;
2987
- d(!0), q.emit(ve.editorSaveStart, { panelId: r });
2987
+ f(!0), q.emit(ve.editorSaveStart, { panelId: r });
2988
2988
  let ue;
2989
2989
  const Ie = new Promise((he) => {
2990
2990
  ue = setTimeout(() => he("timeout"), aa);
@@ -2995,12 +2995,12 @@ function ca(e, t) {
2995
2995
  Ie
2996
2996
  ]);
2997
2997
  if (m.current !== J) return;
2998
- he === "saved" && (_.current = Date.now(), f(Date.now()), l(!1), (me = I.current) == null || me.call(I, e, !1));
2998
+ he === "saved" && (_.current = Date.now(), d(Date.now()), l(!1), (me = I.current) == null || me.call(I, e, !1));
2999
2999
  } catch {
3000
3000
  if (m.current !== J) return;
3001
3001
  } finally {
3002
3002
  if (ue && clearTimeout(ue), S.current === G && (S.current = null), m.current !== J) return;
3003
- q.emit(ve.editorSaveEnd, { panelId: r }), d(!1);
3003
+ q.emit(ve.editorSaveEnd, { panelId: r }), f(!1);
3004
3004
  }
3005
3005
  })(), S.current = G, G;
3006
3006
  }, [e, r]), N = k(() => {
@@ -3038,7 +3038,7 @@ function ca(e, t) {
3038
3038
  F.current = e;
3039
3039
  return;
3040
3040
  }
3041
- F.current !== e && (F.current = e, m.current += 1, clearTimeout(w.current), S.current && q.emit(ve.editorSaveEnd, { panelId: r }), S.current = null, L.current = null, _.current = 0, l(!1), d(!1), h(!1), v(!1));
3041
+ F.current !== e && (F.current = e, m.current += 1, clearTimeout(w.current), S.current && q.emit(ve.editorSaveEnd, { panelId: r }), S.current = null, L.current = null, _.current = 0, l(!1), f(!1), h(!1), v(!1));
3042
3042
  }, [e]), $(() => () => clearTimeout(w.current), []), {
3043
3043
  isDirty: a,
3044
3044
  isSaving: c,
@@ -3085,7 +3085,7 @@ function Hl(e) {
3085
3085
  }
3086
3086
  let da = 0;
3087
3087
  function Cr(e) {
3088
- const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i = T(n ?? `file-pane:${da++}`), a = n ?? i.current, { data: l, isLoading: c, error: d, refetch: s } = fs(o), { mutateAsync: f } = hr(), [p, h] = M(r), g = T(""), v = T(!1), w = T(null), S = T(null), _ = T(null), L = T(0), [m, F] = M(null);
3088
+ const { path: t, panelId: n, initialContent: r = null } = e, o = /\S/.test(t) ? t : null, i = T(n ?? `file-pane:${da++}`), a = n ?? i.current, { data: l, isLoading: c, error: f, refetch: s } = fs(o), { mutateAsync: d } = hr(), [p, h] = M(r), g = T(""), v = T(!1), w = T(null), S = T(null), _ = T(null), L = T(0), [m, F] = M(null);
3089
3089
  $(() => {
3090
3090
  w.current !== t && (h(r), g.current = r ?? "", v.current = !1, S.current = null, L.current += 1, F(null), w.current = t);
3091
3091
  }, [t, r]), $(() => {
@@ -3097,7 +3097,7 @@ function Cr(e) {
3097
3097
  var J;
3098
3098
  const z = ++L.current;
3099
3099
  try {
3100
- const G = await f({
3100
+ const G = await d({
3101
3101
  path: o,
3102
3102
  content: g.current,
3103
3103
  expectedMtimeMs: S.current ?? void 0
@@ -3144,19 +3144,19 @@ function Cr(e) {
3144
3144
  const z = ++L.current;
3145
3145
  try {
3146
3146
  if (!o) return;
3147
- const G = g.current, ue = await f({ path: o, content: G });
3147
+ const G = g.current, ue = await d({ path: o, content: G });
3148
3148
  if (L.current !== z) return;
3149
3149
  typeof ue.mtimeMs == "number" && (S.current = ue.mtimeMs, (J = _.current) == null || J.call(_, ue.mtimeMs)), v.current = !1, F(null);
3150
3150
  } catch {
3151
3151
  }
3152
- }, [o, f]), B = k(async () => {
3152
+ }, [o, d]), B = k(async () => {
3153
3153
  !I || !v.current || await I.save();
3154
3154
  }, [I]), ie = k(async () => {
3155
3155
  await x.flushSave();
3156
3156
  }, [x]);
3157
3157
  return {
3158
3158
  isLoading: c,
3159
- error: d,
3159
+ error: f,
3160
3160
  content: p,
3161
3161
  isDirty: x.isDirty,
3162
3162
  conflict: m,
@@ -3204,15 +3204,15 @@ function Er({
3204
3204
  onReload: a,
3205
3205
  onOverwrite: l,
3206
3206
  editorComponent: c,
3207
- editorProps: d = {},
3207
+ editorProps: f = {},
3208
3208
  loadingFallback: s,
3209
- errorMessage: f,
3209
+ errorMessage: d,
3210
3210
  className: p
3211
3211
  }) {
3212
3212
  if (!/\S/.test(e))
3213
3213
  return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(Xn, { className: "min-h-0 border-0", title: "No file selected", description: "Choose a file from the file tree to open an editor." }) });
3214
3214
  if (r)
3215
- return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(tt, { title: "Failed to load file", description: f ?? r.message }) });
3215
+ return /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(tt, { title: "Failed to load file", description: d ?? r.message }) });
3216
3216
  const h = s ?? /* @__PURE__ */ P("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3217
3217
  /* @__PURE__ */ u(Rt, { className: "size-3.5" }),
3218
3218
  /* @__PURE__ */ u("span", { children: "Loading file..." })
@@ -3231,8 +3231,8 @@ function Er({
3231
3231
  {
3232
3232
  content: t,
3233
3233
  onChange: i,
3234
- className: d.className,
3235
- ...d
3234
+ className: f.className,
3235
+ ...f
3236
3236
  }
3237
3237
  ) })
3238
3238
  ] });
@@ -3272,11 +3272,11 @@ function Cn({ params: e, api: t, className: n }) {
3272
3272
  error: a,
3273
3273
  conflict: l,
3274
3274
  setContent: c,
3275
- onReloadFromServer: d,
3275
+ onReloadFromServer: f,
3276
3276
  onOverwrite: s,
3277
- tabTitle: f
3277
+ tabTitle: d
3278
3278
  } = Cr({ path: r, panelId: t == null ? void 0 : t.id });
3279
- t && f && t.setTitle(f);
3279
+ t && d && t.setTitle(d);
3280
3280
  const p = ma(r);
3281
3281
  return /* @__PURE__ */ u(
3282
3282
  Er,
@@ -3287,7 +3287,7 @@ function Cn({ params: e, api: t, className: n }) {
3287
3287
  error: a,
3288
3288
  conflict: l,
3289
3289
  onChange: c,
3290
- onReload: d,
3290
+ onReload: f,
3291
3291
  onOverwrite: s,
3292
3292
  editorComponent: pa,
3293
3293
  editorProps: { language: p, wordWrap: !0, className: n }
@@ -3295,7 +3295,7 @@ function Cn({ params: e, api: t, className: n }) {
3295
3295
  );
3296
3296
  }
3297
3297
  const ha = ut(
3298
- () => import("./MarkdownEditor-heUJdK4j.js").then((e) => ({ default: e.MarkdownEditor }))
3298
+ () => import("./MarkdownEditor-zbp8ezds.js").then((e) => ({ default: e.MarkdownEditor }))
3299
3299
  );
3300
3300
  function ga({ params: e, api: t, className: n }) {
3301
3301
  const r = typeof (e == null ? void 0 : e.path) == "string" ? e.path : "", {
@@ -3304,11 +3304,11 @@ function ga({ params: e, api: t, className: n }) {
3304
3304
  error: a,
3305
3305
  conflict: l,
3306
3306
  setContent: c,
3307
- onReloadFromServer: d,
3307
+ onReloadFromServer: f,
3308
3308
  onOverwrite: s,
3309
- tabTitle: f
3309
+ tabTitle: d
3310
3310
  } = Cr({ path: r, panelId: t == null ? void 0 : t.id });
3311
- return t && f && t.setTitle(f), /* @__PURE__ */ u(
3311
+ return t && d && t.setTitle(d), /* @__PURE__ */ u(
3312
3312
  Er,
3313
3313
  {
3314
3314
  path: r,
@@ -3317,7 +3317,7 @@ function ga({ params: e, api: t, className: n }) {
3317
3317
  error: a,
3318
3318
  conflict: l,
3319
3319
  onChange: c,
3320
- onReload: d,
3320
+ onReload: f,
3321
3321
  onOverwrite: s,
3322
3322
  editorComponent: ha,
3323
3323
  editorProps: { className: n, documentPath: r }
@@ -3331,7 +3331,7 @@ function Ze(e) {
3331
3331
  return e.split("/").pop() ?? e;
3332
3332
  }
3333
3333
  function ya({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3334
- const i = Ye(), a = Xe(), [l, c] = M(null), [d, s] = M(null), [f, p] = M(!0), h = H(() => {
3334
+ const i = Ye(), a = Xe(), [l, c] = M(null), [f, s] = M(null), [d, p] = M(!0), h = H(() => {
3335
3335
  const g = new URLSearchParams({ path: e });
3336
3336
  return n > 0 && g.set("reload", String(n)), va(i, `/api/v1/files/raw?${g.toString()}`);
3337
3337
  }, [i, e, n]);
@@ -3384,10 +3384,10 @@ function ya({ path: e, kind: t, reloadKey: n = 0, onReload: r, className: o }) {
3384
3384
  ) : null
3385
3385
  ] })
3386
3386
  ] }),
3387
- /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: f ? /* @__PURE__ */ P("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3387
+ /* @__PURE__ */ u("div", { className: "flex min-h-0 flex-1 items-center justify-center overflow-auto p-4", children: d ? /* @__PURE__ */ P("div", { className: "flex items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3388
3388
  /* @__PURE__ */ u(Rt, { className: "size-3.5" }),
3389
3389
  /* @__PURE__ */ u("span", { children: "Loading preview..." })
3390
- ] }) : d || !l ? /* @__PURE__ */ u(tt, { title: "Failed to load preview", description: d ?? "Preview unavailable." }) : t === "image" ? /* @__PURE__ */ u(
3390
+ ] }) : f || !l ? /* @__PURE__ */ u(tt, { title: "Failed to load preview", description: f ?? "Preview unavailable." }) : t === "image" ? /* @__PURE__ */ u(
3391
3391
  "img",
3392
3392
  {
3393
3393
  src: l,
@@ -3506,24 +3506,24 @@ async function Nr(e, t, n) {
3506
3506
  async function Ea(e) {
3507
3507
  const { html: t, path: n, apiBaseUrl: r, headers: o, workspaceRequestId: i, signal: a } = e, l = new DOMParser().parseFromString(t, "text/html");
3508
3508
  await Promise.all(
3509
- Array.from(l.querySelectorAll('link[rel~="stylesheet"][href]')).map(async (d) => {
3510
- const s = d.getAttribute("href");
3509
+ Array.from(l.querySelectorAll('link[rel~="stylesheet"][href]')).map(async (f) => {
3510
+ const s = f.getAttribute("href");
3511
3511
  if (!s) return;
3512
- const f = Rr(n, s);
3513
- if (f)
3512
+ const d = Rr(n, s);
3513
+ if (d)
3514
3514
  try {
3515
- const p = await Nr(an(r, f, i), o, a), h = l.createElement("style");
3516
- h.setAttribute("data-boring-html-viewer-href", s), h.textContent = Wt(p, f, r, i), d.replaceWith(h);
3515
+ const p = await Nr(an(r, d, i), o, a), h = l.createElement("style");
3516
+ h.setAttribute("data-boring-html-viewer-href", s), h.textContent = Wt(p, d, r, i), f.replaceWith(h);
3517
3517
  } catch {
3518
- d.setAttribute("href", lt(r, n, s, i));
3518
+ f.setAttribute("href", lt(r, n, s, i));
3519
3519
  }
3520
3520
  })
3521
3521
  );
3522
- for (const d of Array.from(l.querySelectorAll("style")))
3523
- d.hasAttribute("data-boring-html-viewer-href") || (d.textContent = Wt(d.textContent ?? "", n, r, i));
3524
- for (const d of Array.from(l.querySelectorAll("[style]"))) {
3525
- const s = d.getAttribute("style");
3526
- s && d.setAttribute("style", Wt(s, n, r, i));
3522
+ for (const f of Array.from(l.querySelectorAll("style")))
3523
+ f.hasAttribute("data-boring-html-viewer-href") || (f.textContent = Wt(f.textContent ?? "", n, r, i));
3524
+ for (const f of Array.from(l.querySelectorAll("[style]"))) {
3525
+ const s = f.getAttribute("style");
3526
+ s && f.setAttribute("style", Wt(s, n, r, i));
3527
3527
  }
3528
3528
  const c = [
3529
3529
  ["img", "src"],
@@ -3537,28 +3537,28 @@ async function Ea(e) {
3537
3537
  ["embed", "src"],
3538
3538
  ["link", "href"]
3539
3539
  ];
3540
- for (const [d, s] of c)
3541
- for (const f of Array.from(l.querySelectorAll(`${d}[${s}]`))) {
3542
- const p = f.getAttribute(s);
3543
- p && f.setAttribute(s, lt(r, n, p, i));
3540
+ for (const [f, s] of c)
3541
+ for (const d of Array.from(l.querySelectorAll(`${f}[${s}]`))) {
3542
+ const p = d.getAttribute(s);
3543
+ p && d.setAttribute(s, lt(r, n, p, i));
3544
3544
  }
3545
- for (const d of Array.from(l.querySelectorAll("[srcset]"))) {
3546
- const s = d.getAttribute("srcset");
3547
- s && d.setAttribute("srcset", Ca(s, n, r, i));
3545
+ for (const f of Array.from(l.querySelectorAll("[srcset]"))) {
3546
+ const s = f.getAttribute("srcset");
3547
+ s && f.setAttribute("srcset", Ca(s, n, r, i));
3548
3548
  }
3549
3549
  return `<!doctype html>
3550
3550
  ${l.documentElement.outerHTML}`;
3551
3551
  }
3552
3552
  function Ia({ path: e, className: t }) {
3553
- const n = Ye(), r = Xe(), [o, i] = M(null), [a, l] = M(null), [c, d] = M(!0), s = H(
3553
+ const n = Ye(), r = Xe(), [o, i] = M(null), [a, l] = M(null), [c, f] = M(!0), s = H(
3554
3554
  () => an(n, e, r),
3555
3555
  [n, e, r]
3556
- ), [f, p] = M(0), h = k(() => {
3556
+ ), [d, p] = M(0), h = k(() => {
3557
3557
  p((g) => g + 1);
3558
3558
  }, []);
3559
3559
  return $(() => {
3560
3560
  const g = new AbortController();
3561
- d(!0), l(null), i(null);
3561
+ f(!0), l(null), i(null);
3562
3562
  const v = {};
3563
3563
  return r && (v["x-boring-workspace-id"] = r), Nr(s, v, g.signal).then(async (w) => {
3564
3564
  i(await Ea({
@@ -3572,9 +3572,9 @@ function Ia({ path: e, className: t }) {
3572
3572
  }).catch((w) => {
3573
3573
  g.signal.aborted || l(w instanceof Error ? w.message : "Failed to load HTML preview");
3574
3574
  }).finally(() => {
3575
- g.signal.aborted || d(!1);
3575
+ g.signal.aborted || f(!1);
3576
3576
  }), () => g.abort();
3577
- }, [n, e, s, r, f]), e ? c ? /* @__PURE__ */ P("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3577
+ }, [n, e, s, r, d]), e ? c ? /* @__PURE__ */ P("div", { className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground", children: [
3578
3578
  /* @__PURE__ */ u(Rt, { className: "size-3.5" }),
3579
3579
  /* @__PURE__ */ u("span", { children: "Loading HTML preview..." })
3580
3580
  ] }) : a || o === null ? /* @__PURE__ */ u("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ u(tt, { title: "Failed to load HTML preview", description: a ?? "Preview unavailable." }) }) : /* @__PURE__ */ P("div", { className: oe("flex h-full min-h-0 flex-col bg-background", t), children: [
@@ -4053,7 +4053,7 @@ function nc(e) {
4053
4053
  function Fr(e = {}) {
4054
4054
  const t = e.storageKey ?? (e.workspaceId ? `boring-ui-v2:layout:${e.workspaceId}` : "boring-ui-v2:layout"), n = "boring-ui-v2:preferences", r = e.persistenceEnabled === !1, o = r ? { theme: "light" } : nc(n), i = zo()(
4055
4055
  jo(
4056
- (c, d) => ({
4056
+ (c, f) => ({
4057
4057
  hydrationComplete: !1,
4058
4058
  layout: null,
4059
4059
  sidebar: { collapsed: !1, width: 260 },
@@ -4067,41 +4067,41 @@ function Fr(e = {}) {
4067
4067
  notifications: [],
4068
4068
  setHydrationComplete: (s) => c({ hydrationComplete: s }),
4069
4069
  setLayout: (s) => c({ layout: s }),
4070
- setSidebar: (s) => c({ sidebar: { ...d().sidebar, ...s } }),
4071
- setPanelSize: (s, f) => c({ panelSizes: { ...d().panelSizes, [s]: f } }),
4070
+ setSidebar: (s) => c({ sidebar: { ...f().sidebar, ...s } }),
4071
+ setPanelSize: (s, d) => c({ panelSizes: { ...f().panelSizes, [s]: d } }),
4072
4072
  setTheme: (s) => {
4073
4073
  c({ preferences: { theme: s } }), r || Dn(
4074
4074
  n,
4075
4075
  JSON.stringify({ state: { theme: s }, version: 0 })
4076
4076
  );
4077
4077
  },
4078
- openPanel: (s) => c((f) => ({
4079
- panels: f.panels.some((h) => h.id === s.id) ? f.panels : [...f.panels, s],
4078
+ openPanel: (s) => c((d) => ({
4079
+ panels: d.panels.some((h) => h.id === s.id) ? d.panels : [...d.panels, s],
4080
4080
  activePanel: s.id
4081
4081
  })),
4082
- closePanel: (s) => c((f) => ({
4083
- panels: f.panels.filter((p) => p.id !== s),
4084
- activePanel: f.activePanel === s ? null : f.activePanel
4082
+ closePanel: (s) => c((d) => ({
4083
+ panels: d.panels.filter((p) => p.id !== s),
4084
+ activePanel: d.activePanel === s ? null : d.activePanel
4085
4085
  })),
4086
4086
  activatePanel: (s) => c({ activePanel: s }),
4087
- openFile: (s, f) => c((p) => ({
4087
+ openFile: (s, d) => c((p) => ({
4088
4088
  activeFile: s,
4089
4089
  visibleFiles: p.visibleFiles.includes(s) ? p.visibleFiles : [...p.visibleFiles, s],
4090
- activePanel: f ?? p.activePanel
4090
+ activePanel: d ?? p.activePanel
4091
4091
  })),
4092
- markDirty: (s, f) => c((p) => ({
4092
+ markDirty: (s, d) => c((p) => ({
4093
4093
  dirtyFiles: {
4094
4094
  ...p.dirtyFiles,
4095
- [s]: { panelId: f, savedAt: null }
4095
+ [s]: { panelId: d, savedAt: null }
4096
4096
  }
4097
4097
  })),
4098
- markClean: (s) => c((f) => {
4099
- const { [s]: p, ...h } = f.dirtyFiles;
4098
+ markClean: (s) => c((d) => {
4099
+ const { [s]: p, ...h } = d.dirtyFiles;
4100
4100
  return { dirtyFiles: h };
4101
4101
  }),
4102
- showNotification: (s) => c((f) => ({
4102
+ showNotification: (s) => c((d) => ({
4103
4103
  notifications: [
4104
- ...f.notifications,
4104
+ ...d.notifications,
4105
4105
  {
4106
4106
  ...s,
4107
4107
  id: crypto.randomUUID(),
@@ -4109,10 +4109,10 @@ function Fr(e = {}) {
4109
4109
  }
4110
4110
  ]
4111
4111
  })),
4112
- dismissNotification: (s) => c((f) => ({
4113
- notifications: f.notifications.filter((p) => p.id !== s)
4112
+ dismissNotification: (s) => c((d) => ({
4113
+ notifications: d.notifications.filter((p) => p.id !== s)
4114
4114
  })),
4115
- navigateToLine: (s, f) => c({ activeFile: s }),
4115
+ navigateToLine: (s, d) => c({ activeFile: s }),
4116
4116
  resetLayout: () => {
4117
4117
  localStorage.removeItem(t), c({
4118
4118
  layout: null,
@@ -4136,22 +4136,22 @@ function Fr(e = {}) {
4136
4136
  } } : {
4137
4137
  getItem: (c) => {
4138
4138
  try {
4139
- const d = localStorage.getItem(c);
4140
- if (!d) return null;
4141
- const s = JSON.parse(d);
4139
+ const f = localStorage.getItem(c);
4140
+ if (!f) return null;
4141
+ const s = JSON.parse(f);
4142
4142
  if ((s == null ? void 0 : s.version) !== void 0 && String(s.version) !== An)
4143
4143
  return e.onLayoutVersionMismatch ? e.onLayoutVersionMismatch() : localStorage.removeItem(c), null;
4144
- const f = ec(s == null ? void 0 : s.state);
4145
- return f ? { ...s, state: f } : (console.error("Layout restored with defaults"), null);
4144
+ const d = ec(s == null ? void 0 : s.state);
4145
+ return d ? { ...s, state: d } : (console.error("Layout restored with defaults"), null);
4146
4146
  } catch {
4147
4147
  return console.error("Layout restored with defaults"), null;
4148
4148
  }
4149
4149
  },
4150
- setItem: (c, d) => {
4151
- const s = { ...d, version: An }, f = JSON.stringify(s);
4152
- f.length > Tn && console.warn(
4153
- `Workspace state serialized to ${f.length} bytes (budget: <${Tn})`
4154
- ), Dn(c, f);
4150
+ setItem: (c, f) => {
4151
+ const s = { ...f, version: An }, d = JSON.stringify(s);
4152
+ d.length > Tn && console.warn(
4153
+ `Workspace state serialized to ${d.length} bytes (budget: <${Tn})`
4154
+ ), Dn(c, d);
4155
4155
  },
4156
4156
  removeItem: (c) => {
4157
4157
  localStorage.removeItem(c);
@@ -4257,19 +4257,19 @@ function sc({
4257
4257
  searchQuery: r,
4258
4258
  close: o
4259
4259
  }) {
4260
- const i = H(() => n || r ? [] : oc(cn(), e, t), [n, r, e, t]), a = k((d, s) => {
4261
- $n(d.id, s), d.onSelect(s), o();
4260
+ const i = H(() => n || r ? [] : oc(cn(), e, t), [n, r, e, t]), a = k((f, s) => {
4261
+ $n(f.id, s), f.onSelect(s), o();
4262
4262
  }, [o]), l = k(
4263
- (d) => {
4264
- _n(d.id, d.title), d.run(), o();
4263
+ (f) => {
4264
+ _n(f.id, f.title), f.run(), o();
4265
4265
  },
4266
4266
  [o]
4267
- ), c = k((d) => {
4268
- if (d.type === "catalog") {
4269
- const s = e.find((f) => f.id === d.catalogId);
4270
- s && ($n(s.id, d.rowSnapshot), s.onSelect(d.rowSnapshot));
4267
+ ), c = k((f) => {
4268
+ if (f.type === "catalog") {
4269
+ const s = e.find((d) => d.id === f.catalogId);
4270
+ s && ($n(s.id, f.rowSnapshot), s.onSelect(f.rowSnapshot));
4271
4271
  } else {
4272
- const s = t.find((f) => f.id === d.commandId);
4272
+ const s = t.find((d) => d.id === f.commandId);
4273
4273
  s && (_n(s.id, s.title), s.run());
4274
4274
  }
4275
4275
  o();
@@ -4326,20 +4326,20 @@ function ac({
4326
4326
  }
4327
4327
  l.current = e;
4328
4328
  }, [e, r, o]);
4329
- const d = k((p) => {
4329
+ const f = k((p) => {
4330
4330
  r(p), o((h) => h.replace(/^>\s*/, "")), requestAnimationFrame(() => {
4331
4331
  var h;
4332
4332
  return (h = i.current) == null ? void 0 : h.focus();
4333
4333
  });
4334
4334
  }, [r, o]), s = k(() => {
4335
- d(n === "commands" ? "catalogs" : "commands");
4336
- }, [n, d]), f = k((p) => {
4335
+ f(n === "commands" ? "catalogs" : "commands");
4336
+ }, [n, f]), d = k((p) => {
4337
4337
  p.key === "Tab" && (p.preventDefault(), p.stopPropagation(), s());
4338
4338
  }, [s]);
4339
4339
  return {
4340
4340
  inputRef: i,
4341
- switchMode: d,
4342
- handleInputKeyDown: f
4341
+ switchMode: f,
4342
+ handleInputKeyDown: d
4343
4343
  };
4344
4344
  }
4345
4345
  function cc({
@@ -4362,9 +4362,9 @@ function cc({
4362
4362
  }
4363
4363
  const l = new AbortController(), c = [...e];
4364
4364
  a((s) => {
4365
- const f = new Map(s.map((p) => [p.catalog.id, p]));
4365
+ const d = new Map(s.map((p) => [p.catalog.id, p]));
4366
4366
  return c.map((p) => {
4367
- const h = f.get(p.id);
4367
+ const h = d.get(p.id);
4368
4368
  return {
4369
4369
  catalog: p,
4370
4370
  rows: (h == null ? void 0 : h.rows) ?? [],
@@ -4372,42 +4372,42 @@ function cc({
4372
4372
  };
4373
4373
  });
4374
4374
  });
4375
- const d = (s, f) => {
4375
+ const f = (s, d) => {
4376
4376
  l.signal.aborted || a(
4377
4377
  (p) => p.map(
4378
- (h) => h.catalog.id === s.id ? { catalog: s, ...f } : h
4378
+ (h) => h.catalog.id === s.id ? { catalog: s, ...d } : h
4379
4379
  )
4380
4380
  );
4381
4381
  };
4382
4382
  for (const s of c)
4383
4383
  try {
4384
- const f = s.adapter.search({
4384
+ const d = s.adapter.search({
4385
4385
  query: r,
4386
4386
  filters: {},
4387
4387
  limit: Ct,
4388
4388
  offset: 0,
4389
4389
  signal: l.signal
4390
4390
  });
4391
- Promise.resolve(f).then(
4391
+ Promise.resolve(d).then(
4392
4392
  (p) => {
4393
- d(s, {
4393
+ f(s, {
4394
4394
  rows: p.items.slice(0, Ct),
4395
4395
  loading: !1
4396
4396
  });
4397
4397
  },
4398
4398
  (p) => {
4399
- d(s, {
4399
+ f(s, {
4400
4400
  rows: [],
4401
4401
  loading: !1,
4402
4402
  error: Ln(p)
4403
4403
  });
4404
4404
  }
4405
4405
  );
4406
- } catch (f) {
4407
- d(s, {
4406
+ } catch (d) {
4407
+ f(s, {
4408
4408
  rows: [],
4409
4409
  loading: !1,
4410
- error: Ln(f)
4410
+ error: Ln(d)
4411
4411
  });
4412
4412
  }
4413
4413
  return () => {
@@ -4416,14 +4416,14 @@ function cc({
4416
4416
  }, [e, r, t]), i;
4417
4417
  }
4418
4418
  function lc(e) {
4419
- const [t, n] = M(!1), [r, o] = M(""), [i, a] = M("catalogs"), l = ai(), c = si(), d = pl(), s = H(() => {
4419
+ const [t, n] = M(!1), [r, o] = M(""), [i, a] = M("catalogs"), l = ai(), c = si(), f = pl(), s = H(() => {
4420
4420
  const x = {};
4421
- for (const D of (d == null ? void 0 : d.registeredPlugins) ?? [])
4421
+ for (const D of (f == null ? void 0 : f.registeredPlugins) ?? [])
4422
4422
  D.label && (x[D.id] = D.label);
4423
4423
  return x;
4424
- }, [d == null ? void 0 : d.registeredPlugins]), f = i === "commands", p = r.trim(), h = cc({
4424
+ }, [f == null ? void 0 : f.registeredPlugins]), d = i === "commands", p = r.trim(), h = cc({
4425
4425
  catalogs: l,
4426
- isCommandMode: f,
4426
+ isCommandMode: d,
4427
4427
  searchQuery: p
4428
4428
  }), { inputRef: g, switchMode: v, handleInputKeyDown: w } = ac({
4429
4429
  open: t,
@@ -4437,7 +4437,7 @@ function lc(e) {
4437
4437
  return;
4438
4438
  }
4439
4439
  o(x);
4440
- }, []), _ = H(() => f ? rc(c, p) : [], [c, f, p]), {
4440
+ }, []), _ = H(() => d ? rc(c, p) : [], [c, d, p]), {
4441
4441
  recentEntries: L,
4442
4442
  handleCatalogSelect: m,
4443
4443
  handleCommandSelect: F,
@@ -4445,7 +4445,7 @@ function lc(e) {
4445
4445
  } = sc({
4446
4446
  catalogs: l,
4447
4447
  commands: c,
4448
- isCommandMode: f,
4448
+ isCommandMode: d,
4449
4449
  searchQuery: p,
4450
4450
  close: () => n(!1)
4451
4451
  });
@@ -4467,12 +4467,12 @@ function lc(e) {
4467
4467
  uc,
4468
4468
  {
4469
4469
  inputRef: g,
4470
- isCommandMode: f,
4470
+ isCommandMode: d,
4471
4471
  query: r,
4472
4472
  onQueryChange: S,
4473
4473
  onInputKeyDown: w,
4474
4474
  onSwitchMode: v,
4475
- loading: !f && h.some((x) => x.loading)
4475
+ loading: !d && h.some((x) => x.loading)
4476
4476
  }
4477
4477
  ),
4478
4478
  /* @__PURE__ */ P(
@@ -4481,11 +4481,11 @@ function lc(e) {
4481
4481
  className: "min-h-0 flex-1 overflow-y-auto py-1",
4482
4482
  style: { maxHeight: "none" },
4483
4483
  children: [
4484
- /* @__PURE__ */ u(Do, { className: "py-10 text-center text-sm text-muted-foreground", children: f ? "No matching commands" : "No catalog results" }),
4484
+ /* @__PURE__ */ u(Do, { className: "py-10 text-center text-sm text-muted-foreground", children: d ? "No matching commands" : "No catalog results" }),
4485
4485
  /* @__PURE__ */ u(
4486
4486
  dc,
4487
4487
  {
4488
- isCommandMode: f,
4488
+ isCommandMode: d,
4489
4489
  recentEntries: L,
4490
4490
  searchQuery: p,
4491
4491
  onRecentSelect: I
@@ -4495,7 +4495,7 @@ function lc(e) {
4495
4495
  fc,
4496
4496
  {
4497
4497
  catalogGroups: h,
4498
- isCommandMode: f,
4498
+ isCommandMode: d,
4499
4499
  onCatalogSelect: m
4500
4500
  }
4501
4501
  ),
@@ -4503,7 +4503,7 @@ function lc(e) {
4503
4503
  mc,
4504
4504
  {
4505
4505
  commandResults: _,
4506
- isCommandMode: f,
4506
+ isCommandMode: d,
4507
4507
  pluginLabelMap: s,
4508
4508
  onCommandSelect: F
4509
4509
  }
@@ -4511,7 +4511,7 @@ function lc(e) {
4511
4511
  ]
4512
4512
  }
4513
4513
  ),
4514
- /* @__PURE__ */ u(hc, { isCommandMode: f })
4514
+ /* @__PURE__ */ u(hc, { isCommandMode: d })
4515
4515
  ] })
4516
4516
  ]
4517
4517
  }
@@ -4742,7 +4742,7 @@ function yc(e) {
4742
4742
  openWorkbenchSources: a,
4743
4743
  closeWorkbench: l,
4744
4744
  bridgeEndpoint: c,
4745
- ...d
4745
+ ...f
4746
4746
  } = e, s = k(
4747
4747
  (w) => {
4748
4748
  var S;
@@ -4752,12 +4752,12 @@ function yc(e) {
4752
4752
  ), (S = e.onOpenArtifact) == null || S.call(e, w);
4753
4753
  },
4754
4754
  [r, o, i, a, l, e.onOpenArtifact]
4755
- ), f = gc(d.requestHeaders), p = n.filter((w) => !w.sessionId || w.sessionId === d.sessionId);
4755
+ ), d = gc(f.requestHeaders), p = n.filter((w) => !w.sessionId || w.sessionId === f.sessionId);
4756
4756
  $(() => {
4757
4757
  if (!(c === null || !r || !o || !i))
4758
4758
  return Bi({
4759
4759
  endpoint: vc(c),
4760
- query: f ? { workspaceId: f } : void 0,
4760
+ query: d ? { workspaceId: d } : void 0,
4761
4761
  ctx: {
4762
4762
  surface: r,
4763
4763
  isWorkbenchOpen: o,
@@ -4766,14 +4766,14 @@ function yc(e) {
4766
4766
  closeWorkbench: l
4767
4767
  }
4768
4768
  });
4769
- }, [c, r, o, i, a, l, f]);
4769
+ }, [c, r, o, i, a, l, d]);
4770
4770
  const h = k(() => {
4771
4771
  var w;
4772
- window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: d.sessionId } })), (w = e.onComposerStop) == null || w.call(e);
4773
- }, [d.sessionId, e.onComposerStop]), g = k(
4772
+ window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: f.sessionId } })), (w = e.onComposerStop) == null || w.call(e);
4773
+ }, [f.sessionId, e.onComposerStop]), g = k(
4774
4774
  (w, S) => {
4775
4775
  if (S === "cancel") {
4776
- window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: d.sessionId } }));
4776
+ window.dispatchEvent(new CustomEvent("boring:workspace-composer-stop", { detail: { sessionId: f.sessionId } }));
4777
4777
  return;
4778
4778
  }
4779
4779
  S !== "open" || !w.surfaceKind || r && o && i && qt(
@@ -4781,7 +4781,7 @@ function yc(e) {
4781
4781
  { surface: r, isWorkbenchOpen: o, openWorkbench: i, openWorkbenchSources: a, closeWorkbench: l }
4782
4782
  );
4783
4783
  },
4784
- [d.sessionId, l, r, o, i, a]
4784
+ [f.sessionId, l, r, o, i, a]
4785
4785
  ), v = k(
4786
4786
  (w) => {
4787
4787
  var S;
@@ -4793,7 +4793,7 @@ function yc(e) {
4793
4793
  t,
4794
4794
  {
4795
4795
  chrome: !1,
4796
- ...d,
4796
+ ...f,
4797
4797
  onOpenArtifact: s,
4798
4798
  onData: v,
4799
4799
  composerBlockers: p,
@@ -4824,11 +4824,11 @@ function Wn(e) {
4824
4824
  return t.setHours(0, 0, 0, 0), t.getTime();
4825
4825
  }
4826
4826
  function Sc(e) {
4827
- const n = Wn(/* @__PURE__ */ new Date()), r = n - Mn, o = n - 7 * Mn, i = [], a = [], l = [], c = [], d = [];
4827
+ const n = Wn(/* @__PURE__ */ new Date()), r = n - Mn, o = n - 7 * Mn, i = [], a = [], l = [], c = [], f = [];
4828
4828
  for (const p of e) {
4829
4829
  const h = xt(p.updatedAt);
4830
4830
  if (!h) {
4831
- d.push(p);
4831
+ f.push(p);
4832
4832
  continue;
4833
4833
  }
4834
4834
  const g = Wn(h);
@@ -4838,8 +4838,8 @@ function Sc(e) {
4838
4838
  var w, S;
4839
4839
  const g = ((w = xt(p.updatedAt)) == null ? void 0 : w.getTime()) ?? 0;
4840
4840
  return (((S = xt(h.updatedAt)) == null ? void 0 : S.getTime()) ?? 0) - g;
4841
- }, f = [];
4842
- return i.length && f.push({ key: "today", label: "Today", items: i.sort(s) }), a.length && f.push({ key: "yesterday", label: "Yesterday", items: a.sort(s) }), l.length && f.push({ key: "week", label: "This week", items: l.sort(s) }), c.length && f.push({ key: "earlier", label: "Earlier", items: c.sort(s) }), d.length && f.push({ key: "undated", label: "Other", items: d }), f;
4841
+ }, d = [];
4842
+ return i.length && d.push({ key: "today", label: "Today", items: i.sort(s) }), a.length && d.push({ key: "yesterday", label: "Yesterday", items: a.sort(s) }), l.length && d.push({ key: "week", label: "This week", items: l.sort(s) }), c.length && d.push({ key: "earlier", label: "Earlier", items: c.sort(s) }), f.length && d.push({ key: "undated", label: "Other", items: f }), d;
4843
4843
  }
4844
4844
  function xc(e) {
4845
4845
  const t = xt(e);
@@ -4863,17 +4863,20 @@ function kc({
4863
4863
  onSwitch: n,
4864
4864
  onCreate: r,
4865
4865
  onDelete: o,
4866
- onClose: i,
4867
- className: a
4866
+ onLoadMore: i,
4867
+ hasMore: a = !1,
4868
+ loadingMore: l = !1,
4869
+ onClose: c,
4870
+ className: f
4868
4871
  }) {
4869
- const l = H(() => Sc(e), [e]);
4872
+ const s = H(() => Sc(e), [e]);
4870
4873
  return /* @__PURE__ */ P(
4871
4874
  "div",
4872
4875
  {
4873
4876
  "data-boring-workspace-part": "session-list",
4874
4877
  className: oe(
4875
4878
  "flex h-full min-h-0 flex-col bg-[color:oklch(from_var(--background)_calc(l-0.01)_c_h)]",
4876
- a
4879
+ f
4877
4880
  ),
4878
4881
  role: "navigation",
4879
4882
  "aria-label": "Session history",
@@ -4882,7 +4885,7 @@ function kc({
4882
4885
  /* @__PURE__ */ u("span", { className: "text-[12px] font-medium tracking-tight text-foreground/70", children: "Sessions" }),
4883
4886
  /* @__PURE__ */ P("div", { className: "flex items-center gap-0.5", children: [
4884
4887
  r && /* @__PURE__ */ u(ge, { type: "button", variant: "ghost", size: "icon-xs", onClick: r, "aria-label": "New session", title: "New chat", children: /* @__PURE__ */ u(po, { className: "h-3.5 w-3.5", strokeWidth: 1.75 }) }),
4885
- i && /* @__PURE__ */ u(ge, { type: "button", variant: "ghost", size: "icon-xs", onClick: i, "aria-label": "Close sessions", title: "Close sessions (⌘1)", children: /* @__PURE__ */ u(Gn, { className: "h-4 w-4", strokeWidth: 1.75 }) })
4888
+ c && /* @__PURE__ */ u(ge, { type: "button", variant: "ghost", size: "icon-xs", onClick: c, "aria-label": "Close sessions", title: "Close sessions (⌘1)", children: /* @__PURE__ */ u(Gn, { className: "h-4 w-4", strokeWidth: 1.75 }) })
4886
4889
  ] })
4887
4890
  ] }),
4888
4891
  /* @__PURE__ */ P("div", { className: "flex-1 overflow-y-auto py-2.5", children: [
@@ -4891,22 +4894,32 @@ function kc({
4891
4894
  /* @__PURE__ */ u("br", {}),
4892
4895
  "Start a new chat to begin."
4893
4896
  ] }),
4894
- l.map((c, d) => /* @__PURE__ */ P("section", { className: oe(d > 0 && "mt-4"), children: [
4897
+ s.map((d, p) => /* @__PURE__ */ P("section", { className: oe(p > 0 && "mt-4"), children: [
4895
4898
  /* @__PURE__ */ P("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: [
4896
- /* @__PURE__ */ u("span", { children: c.label }),
4897
- /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: c.items.length })
4899
+ /* @__PURE__ */ u("span", { children: d.label }),
4900
+ /* @__PURE__ */ u("span", { "aria-hidden": "true", className: "text-[10.5px] tabular-nums text-muted-foreground/40", children: d.items.length })
4898
4901
  ] }),
4899
- /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: c.items.map((s) => /* @__PURE__ */ u(
4902
+ /* @__PURE__ */ u("ul", { role: "list", className: "flex flex-col", children: d.items.map((h) => /* @__PURE__ */ u(
4900
4903
  Pc,
4901
4904
  {
4902
- session: s,
4903
- active: s.id === t,
4905
+ session: h,
4906
+ active: h.id === t,
4904
4907
  onSwitch: n,
4905
4908
  onDelete: o
4906
4909
  },
4907
- s.id
4910
+ h.id
4908
4911
  )) })
4909
- ] }, c.key))
4912
+ ] }, d.key)),
4913
+ a && i ? /* @__PURE__ */ u("div", { className: "px-3 py-3", children: /* @__PURE__ */ u(
4914
+ "button",
4915
+ {
4916
+ type: "button",
4917
+ onClick: i,
4918
+ disabled: l,
4919
+ className: "w-full rounded-md border border-border/60 px-2.5 py-1.5 text-[12px] font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-60",
4920
+ children: l ? "Loading…" : "Load more"
4921
+ }
4922
+ ) }) : null
4910
4923
  ] })
4911
4924
  ]
4912
4925
  }
@@ -4970,6 +4983,9 @@ function Cc({ params: e }) {
4970
4983
  onSwitch: e == null ? void 0 : e.onSwitch,
4971
4984
  onCreate: e == null ? void 0 : e.onCreate,
4972
4985
  onDelete: e == null ? void 0 : e.onDelete,
4986
+ onLoadMore: e == null ? void 0 : e.onLoadMore,
4987
+ hasMore: e == null ? void 0 : e.hasMore,
4988
+ loadingMore: e == null ? void 0 : e.loadingMore,
4973
4989
  onClose: e == null ? void 0 : e.onClose
4974
4990
  });
4975
4991
  }
@@ -4994,12 +5010,12 @@ function Wr({
4994
5010
  l.subscribe,
4995
5011
  l.getSnapshot,
4996
5012
  l.getSnapshot
4997
- ), d = H(
5013
+ ), f = H(
4998
5014
  () => c.filter((B) => B.placement === "left-tab"),
4999
5015
  [c]
5000
5016
  ), s = H(() => {
5001
5017
  const B = [];
5002
- for (const ie of d) {
5018
+ for (const ie of f) {
5003
5019
  const z = ie.icon;
5004
5020
  B.push({
5005
5021
  id: ie.id,
@@ -5009,13 +5025,13 @@ function Wr({
5009
5025
  });
5010
5026
  }
5011
5027
  return B;
5012
- }, [d]), [f, p] = M(n ?? ""), h = s.some((B) => B.id === f) ? f : ((te = s[0]) == null ? void 0 : te.id) ?? "", [g, v] = M(!1), [w, S] = M(""), [_, L] = M(""), m = T(null), F = T(void 0);
5028
+ }, [f]), [d, p] = M(n ?? ""), h = s.some((B) => B.id === d) ? d : ((te = s[0]) == null ? void 0 : te.id) ?? "", [g, v] = M(!1), [w, S] = M(""), [_, L] = M(""), m = T(null), F = T(void 0);
5013
5029
  $(() => (clearTimeout(F.current), F.current = setTimeout(() => L(w), 180), () => clearTimeout(F.current)), [w]), $(() => {
5014
5030
  var B;
5015
5031
  g && ((B = m.current) == null || B.focus());
5016
5032
  }, [g]), $(() => {
5017
- s.length > 0 && !s.some((B) => B.id === f) && p(s[0].id);
5018
- }, [f, s]), $(() => {
5033
+ s.length > 0 && !s.some((B) => B.id === d) && p(s[0].id);
5034
+ }, [d, s]), $(() => {
5019
5035
  r && s.some((B) => B.id === zn) && p(zn);
5020
5036
  }, [r, s]);
5021
5037
  const I = k(() => {
@@ -5196,9 +5212,9 @@ function jr({
5196
5212
  prefixHeaderActions: a,
5197
5213
  rightHeaderActions: l,
5198
5214
  watermarkComponent: c,
5199
- className: d
5215
+ className: f
5200
5216
  }) {
5201
- const s = !!(o || r), f = (n == null ? void 0 : n.slice().sort().join("\0")) ?? "*", p = H(() => {
5217
+ const s = !!(o || r), d = (n == null ? void 0 : n.slice().sort().join("\0")) ?? "*", p = H(() => {
5202
5218
  if (!s)
5203
5219
  return $c(t, n ? new Set(n) : void 0);
5204
5220
  }, [n, s, t]), h = k(
@@ -5218,7 +5234,7 @@ function jr({
5218
5234
  return e ? /* @__PURE__ */ u(
5219
5235
  "div",
5220
5236
  {
5221
- className: oe("h-full w-full", d),
5237
+ className: oe("h-full w-full", f),
5222
5238
  "data-testid": "artifact-surface",
5223
5239
  children: /* @__PURE__ */ u(
5224
5240
  js,
@@ -5232,7 +5248,7 @@ function jr({
5232
5248
  rightHeaderActions: l,
5233
5249
  watermarkComponent: c
5234
5250
  },
5235
- `${t}:${s ? "ext" : "auto"}:${f}`
5251
+ `${t}:${s ? "ext" : "auto"}:${d}`
5236
5252
  )
5237
5253
  }
5238
5254
  ) : null;
@@ -5293,9 +5309,9 @@ function Oc({
5293
5309
  onChange: a,
5294
5310
  onClose: l,
5295
5311
  extraPanels: c,
5296
- defaultLeftTab: d,
5312
+ defaultLeftTab: f,
5297
5313
  initialPanels: s,
5298
- className: f
5314
+ className: d
5299
5315
  }) {
5300
5316
  const [p, h] = M(() => {
5301
5317
  if (!o) return !1;
@@ -5591,7 +5607,7 @@ function Oc({
5591
5607
  {
5592
5608
  ref: S,
5593
5609
  "data-boring-workspace-part": "surface",
5594
- className: oe("flex h-full min-h-0 w-full bg-background", f),
5610
+ className: oe("flex h-full min-h-0 w-full bg-background", d),
5595
5611
  "data-testid": "surface-shell",
5596
5612
  children: [
5597
5613
  p ? null : /* @__PURE__ */ P(_e, { children: [
@@ -5608,7 +5624,7 @@ function Oc({
5608
5624
  {
5609
5625
  rootDir: e,
5610
5626
  bridge: Ve,
5611
- defaultTab: d,
5627
+ defaultTab: f,
5612
5628
  revealFileTreeRequest: F,
5613
5629
  onOpenPanel: he,
5614
5630
  onCollapse: () => h(!0)
@@ -5882,11 +5898,11 @@ function nl(e, t, n) {
5882
5898
  ...c.chromeless !== void 0 ? { chromeless: c.chromeless } : {}
5883
5899
  });
5884
5900
  for (const c of n.leftTabs) {
5885
- const d = o.get(c.panelId);
5901
+ const f = o.get(c.panelId);
5886
5902
  r.push({
5887
5903
  id: c.id,
5888
5904
  title: c.title,
5889
- component: c.component ?? (d == null ? void 0 : d.component) ?? (() => null),
5905
+ component: c.component ?? (f == null ? void 0 : f.component) ?? (() => null),
5890
5906
  placement: "left-tab",
5891
5907
  source: c.source ?? "plugin",
5892
5908
  pluginId: e,
@@ -5913,9 +5929,9 @@ function nl(e, t, n) {
5913
5929
  id: c.id ?? `${e}:${c.kind}`,
5914
5930
  source: c.source ?? "plugin",
5915
5931
  pluginId: e,
5916
- resolve(d) {
5917
- if (d.kind === c.kind)
5918
- return c.resolve(d) ?? void 0;
5932
+ resolve(f) {
5933
+ if (f.kind === c.kind)
5934
+ return c.resolve(f) ?? void 0;
5919
5935
  }
5920
5936
  }));
5921
5937
  return { panels: r, commands: i, catalogs: a, surfaceResolvers: l };
@@ -5974,14 +5990,14 @@ function al(e) {
5974
5990
  return typeof t != "string" || !t.startsWith("boring.plugin.");
5975
5991
  }
5976
5992
  function cl(e) {
5977
- const t = At(), n = Zt(), r = Ft(), o = nr(), i = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Set()), [c, d] = M(0), s = T(!1);
5993
+ const t = At(), n = Zt(), r = Ft(), o = nr(), i = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Set()), [c, f] = M(0), s = T(!1);
5978
5994
  $(() => {
5979
5995
  if (e.enabled === !1 || typeof EventSource > "u") return;
5980
- const f = (p) => {
5996
+ const d = (p) => {
5981
5997
  const h = p.detail;
5982
- al(h) && (s.current = !0, d((g) => g + 1));
5998
+ al(h) && (s.current = !0, f((g) => g + 1));
5983
5999
  };
5984
- return window.addEventListener(Ee, f), () => window.removeEventListener(Ee, f);
6000
+ return window.addEventListener(Ee, d), () => window.removeEventListener(Ee, d);
5985
6001
  }, [e.enabled]), $(() => {
5986
6002
  if (e.enabled === !1 || typeof EventSource > "u") return;
5987
6003
  if (s.current && (s.current = !1, i.current.clear(), a.current.clear()), Qc(e.authHeaders)) {
@@ -5990,12 +6006,12 @@ function cl(e) {
5990
6006
  );
5991
6007
  return;
5992
6008
  }
5993
- let f = !1;
6009
+ let d = !1;
5994
6010
  const p = Yc(t, n, r, o), h = Hc(Vr(e.apiBaseUrl ?? "", "/api/v1/agent-plugins/events"), e.workspaceId), g = new EventSource(h, { withCredentials: !0 }), v = (L) => {
5995
6011
  (async () => {
5996
6012
  let m, F = !1;
5997
6013
  try {
5998
- if (m = JSON.parse(L.data), f || m.workspaceId && e.workspaceId && m.workspaceId !== e.workspaceId) return;
6014
+ if (m = JSON.parse(L.data), d || m.workspaceId && e.workspaceId && m.workspaceId !== e.workspaceId) return;
5999
6015
  m.replay && l.current.add(m.id);
6000
6016
  const I = i.current.get(m.id) ?? 0, x = a.current.get(m.id) ?? 0;
6001
6017
  if (m.revision <= Math.max(I, x)) return;
@@ -6019,7 +6035,7 @@ function cl(e) {
6019
6035
  error: O
6020
6036
  };
6021
6037
  }
6022
- if (f || a.current.get(m.id) !== m.revision || m.revision <= (i.current.get(m.id) ?? 0)) return;
6038
+ if (d || a.current.get(m.id) !== m.revision || m.revision <= (i.current.get(m.id) ?? 0)) return;
6023
6039
  if (!N) {
6024
6040
  yt(m.id, p), i.current.set(m.id, m.revision), window.dispatchEvent(new CustomEvent(Ee, { detail: m }));
6025
6041
  return;
@@ -6036,7 +6052,7 @@ function cl(e) {
6036
6052
  } catch (I) {
6037
6053
  m && a.current.get(m.id) === m.revision && a.current.delete(m.id);
6038
6054
  const x = typeof I == "object" && I && "stage" in I && I.stage === "register" ? "register" : "import", D = typeof I == "object" && I && "error" in I ? I.error : I;
6039
- if (f) return;
6055
+ if (d) return;
6040
6056
  const N = (m == null ? void 0 : m.id) ?? "<malformed>", O = D instanceof Error ? D.message : String(D);
6041
6057
  console.error(`[boring-ui] failed to load plugin ${N}; keeping previous version`, D), m && window.dispatchEvent(new CustomEvent(Ee, {
6042
6058
  detail: {
@@ -6063,7 +6079,7 @@ function cl(e) {
6063
6079
  }
6064
6080
  })();
6065
6081
  }, w = (L) => {
6066
- if (!f)
6082
+ if (!d)
6067
6083
  try {
6068
6084
  const m = JSON.parse(L.data);
6069
6085
  if (m.workspaceId && e.workspaceId && m.workspaceId !== e.workspaceId) return;
@@ -6074,7 +6090,7 @@ function cl(e) {
6074
6090
  console.error("[boring-ui] failed to process plugin unload event", m);
6075
6091
  }
6076
6092
  }, S = (L) => {
6077
- if (!f)
6093
+ if (!d)
6078
6094
  try {
6079
6095
  const m = JSON.parse(L.data);
6080
6096
  if (m.workspaceId && e.workspaceId && m.workspaceId !== e.workspaceId) return;
@@ -6091,7 +6107,7 @@ function cl(e) {
6091
6107
  console.error("[boring-ui] failed to process plugin error event", m);
6092
6108
  }
6093
6109
  }, _ = (L) => {
6094
- if (!f)
6110
+ if (!d)
6095
6111
  try {
6096
6112
  const m = JSON.parse(L.data);
6097
6113
  if (m.workspaceId && e.workspaceId && m.workspaceId !== e.workspaceId) return;
@@ -6112,7 +6128,7 @@ function cl(e) {
6112
6128
  }
6113
6129
  };
6114
6130
  return g.addEventListener("boring.plugin.load", v), g.addEventListener("boring.plugin.unload", w), g.addEventListener("boring.plugin.error", S), g.addEventListener("boring.plugin.replay-complete", _), () => {
6115
- f = !0;
6131
+ d = !0;
6116
6132
  for (const L of i.current.keys()) yt(L, p);
6117
6133
  i.current.clear(), a.current.clear(), l.current.clear(), g.close();
6118
6134
  };
@@ -6141,19 +6157,19 @@ function Xl() {
6141
6157
  function Ql({ children: e, defaultTheme: t, onThemeChange: n }) {
6142
6158
  const r = T(null);
6143
6159
  if (!r.current) {
6144
- const d = Fr({ persistenceEnabled: !1 });
6145
- wr(d);
6160
+ const f = Fr({ persistenceEnabled: !1 });
6161
+ wr(f);
6146
6162
  const s = t ?? Kr();
6147
- s !== "light" && d.getState().setTheme(s), r.current = d;
6163
+ s !== "light" && f.getState().setTheme(s), r.current = f;
6148
6164
  }
6149
6165
  const o = r.current, i = k(
6150
- (d) => {
6151
- o.getState().setTheme(d), n == null || n(d);
6166
+ (f) => {
6167
+ o.getState().setTheme(f), n == null || n(f);
6152
6168
  },
6153
6169
  [o, n]
6154
6170
  ), a = k(() => {
6155
- const d = o.getState().preferences.theme === "light" ? "dark" : "light";
6156
- i(d);
6171
+ const f = o.getState().preferences.theme === "light" ? "dark" : "light";
6172
+ i(f);
6157
6173
  }, [o, i]), l = sn();
6158
6174
  $(() => (document.documentElement.setAttribute("data-theme", l), () => {
6159
6175
  document.documentElement.removeAttribute("data-theme");
@@ -6261,8 +6277,8 @@ function wl({
6261
6277
  }) {
6262
6278
  return e.flatMap(
6263
6279
  (l) => l.registrations.providers.map((c) => ({ plugin: l, provider: c }))
6264
- ).reduceRight((l, { plugin: c, provider: d }) => {
6265
- const s = d.component;
6280
+ ).reduceRight((l, { plugin: c, provider: f }) => {
6281
+ const s = f.component;
6266
6282
  return /* @__PURE__ */ u(
6267
6283
  s,
6268
6284
  {
@@ -6272,7 +6288,7 @@ function wl({
6272
6288
  apiTimeout: o,
6273
6289
  children: l
6274
6290
  },
6275
- `${c.id}:provider:${d.id}`
6291
+ `${c.id}:provider:${f.id}`
6276
6292
  );
6277
6293
  }, i);
6278
6294
  }
@@ -6299,9 +6315,9 @@ function eu({
6299
6315
  catalogs: a,
6300
6316
  capabilities: l,
6301
6317
  apiBaseUrl: c = "",
6302
- authHeaders: d,
6318
+ authHeaders: f,
6303
6319
  apiTimeout: s,
6304
- defaultTheme: f,
6320
+ defaultTheme: d,
6305
6321
  onThemeChange: p,
6306
6322
  workspaceId: h,
6307
6323
  storageKey: g,
@@ -6321,11 +6337,11 @@ function eu({
6321
6337
  persistenceEnabled: v
6322
6338
  });
6323
6339
  wr(X);
6324
- const ae = f ?? Kr();
6340
+ const ae = d ?? Kr();
6325
6341
  ae !== "light" && !v ? X.getState().setTheme(ae) : ae !== "light" && (typeof localStorage < "u" && localStorage.getItem("boring-ui-v2:preferences") !== null || X.getState().setTheme(ae)), I.current = X;
6326
6342
  }
6327
- const x = I.current, D = T(null), N = T(d);
6328
- N.current = d;
6343
+ const x = I.current, D = T(null), N = T(f);
6344
+ N.current = f;
6329
6345
  const O = T(S);
6330
6346
  O.current = S, $(() => () => {
6331
6347
  var X;
@@ -6400,8 +6416,8 @@ function eu({
6400
6416
  () => ({ setTheme: G, toggleTheme: ue }),
6401
6417
  [G, ue]
6402
6418
  ), he = H(
6403
- () => Sl(h, d),
6404
- [d, h]
6419
+ () => Sl(h, f),
6420
+ [f, h]
6405
6421
  ), [ke, Ue] = M(!1), qe = H(
6406
6422
  () => ({ connected: ke }),
6407
6423
  [ke]