@hachej/boring-workspace 0.1.10 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/workspace.js CHANGED
@@ -1,24 +1,24 @@
1
- var qe = Object.defineProperty;
2
- var _e = (e, t, r) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var ne = (e, t, r) => _e(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { d as ae, u as Ne, p as Be, P as Ae, a as $e, b as Ke, D as Ve } from "./CommandPalette-D5KPKtKA.js";
5
- import { A as xr, C as yr, c as br, e as vr, f as Sr, F as Nr, g as Cr, M as Tr, h as Pr, i as kr, j as Er, k as wr, l as Mr, R as Dr, S as Ir, m as Rr, n as Or, T as Fr, W as Lr, o as zr, q as qr, r as _r, s as Br, t as Ar, v as $r, w as Kr, x as Vr, y as Qr, z as jr, B as Gr, E as Hr, G as Wr, H as Ur, I as Xr, J as Jr, K as Yr, L as Zr, N as ea, O as ta, Q as ra, U as aa, V as na, X as la, Y as oa, Z as sa, _ as ca, $ as ia, a0 as ua, a1 as da, a2 as pa, a3 as fa, a4 as ma, a5 as ga, a6 as ha, a7 as xa, a8 as ya, a9 as ba, aa as va, ab as Sa, ac as Na, ad as Ca, ae as Ta, af as Pa, ag as ka, ah as Ea } from "./CommandPalette-D5KPKtKA.js";
6
- import { jsxs as h, jsx as a, Fragment as Qe } from "react/jsx-runtime";
7
- import { useSyncExternalStore as je, useState as V, useEffect as U, useRef as w, useCallback as S, useReducer as Ge, useMemo as Z, Suspense as He, Component as We } from "react";
8
- import { FilterIcon as Ue, XIcon as Xe, ChevronDownIcon as Ce, ChevronRightIcon as Te, Database as Je, BarChart3 as pe, MenuIcon as Ye, PanelLeftOpenIcon as Ze, PanelLeftCloseIcon as et, PinIcon as tt } from "lucide-react";
9
- import { EmptyState as Pe, Toolbar as rt, Input as ke, Popover as at, PopoverTrigger as nt, PopoverContent as lt, Button as J, Spinner as ot, ChipButton as st, Chip as ct, Sheet as it, SheetContent as ut, SheetHeader as dt, SheetTitle as pt, SheetDescription as ft, Kbd as le, ErrorState as mt, IconButton as Ee } from "@hachej/boring-ui-kit";
10
- import { Toaster as Ma, dismissToast as Da, toast as Ia } from "@hachej/boring-ui-kit";
1
+ var $e = Object.defineProperty;
2
+ var Ke = (e, t, r) => t in e ? $e(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var ne = (e, t, r) => Ke(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { d as ae, u as ke, p as Ve, P as je, a as Ge, b as Qe, D as He } from "./CommandPalette-Dme9em28.js";
5
+ import { A as yr, C as br, c as vr, e as Nr, f as Sr, F as Cr, g as Tr, M as Pr, h as kr, i as Er, j as wr, k as Ir, l as Mr, R as Dr, S as Rr, m as Or, n as Fr, T as Lr, W as zr, o as qr, q as _r, r as Br, s as Ar, t as $r, v as Kr, w as Vr, x as jr, y as Gr, z as Qr, B as Hr, E as Wr, G as Ur, H as Xr, I as Jr, J as Yr, K as Zr, L as ea, N as ta, O as ra, Q as aa, U as na, V as la, X as oa, Y as sa, Z as ca, _ as ia, $ as ua, a0 as da, a1 as pa, a2 as fa, a3 as ma, a4 as ga, a5 as ha, a6 as xa, a7 as ya, a8 as ba, a9 as va, aa as Na, ab as Sa, ac as Ca, ad as Ta, ae as Pa, af as ka, ag as Ea, ah as wa } from "./CommandPalette-Dme9em28.js";
6
+ import { jsxs as h, jsx as a, Fragment as We } from "react/jsx-runtime";
7
+ import { useSyncExternalStore as Ue, useState as V, useEffect as Y, useRef as I, useCallback as v, useReducer as Xe, useMemo as ee, Suspense as Je, Component as Ye } from "react";
8
+ import { SearchIcon as Ze, XIcon as pe, FilterIcon as et, ChevronDownIcon as Ee, ChevronRightIcon as we, Database as tt, BarChart3 as fe, MenuIcon as rt, PanelLeftOpenIcon as at, PanelLeftCloseIcon as nt, PinIcon as lt } from "lucide-react";
9
+ import { EmptyState as Ie, Toolbar as ot, Popover as me, PopoverTrigger as ge, PopoverContent as he, Input as Me, Button as J, Spinner as st, ChipButton as ct, Chip as it, Sheet as ut, SheetContent as dt, SheetHeader as pt, SheetTitle as ft, SheetDescription as mt, Kbd as le, ErrorState as gt, IconButton as De } from "@hachej/boring-ui-kit";
10
+ import { Toaster as Ma, dismissToast as Da, toast as Ra } from "@hachej/boring-ui-kit";
11
11
  import { c as H } from "./utils-B6yFEsav.js";
12
- import { d as we } from "./panel-DnvDNQac.js";
13
- import { C as Oa, T as Fa, W as La, b as za } from "./WorkspaceLoadingState-J8XVhEyL.js";
14
- import { C as _a, c as Ba } from "./CodeEditor-DQqOn4xz.js";
15
- import { FileTree as $a } from "./FileTree-CwC01Ijr.js";
16
- import { MarkdownEditor as Va } from "./MarkdownEditor-CB7nfhN9.js";
12
+ import { d as Re } from "./panel-DnvDNQac.js";
13
+ import { C as Fa, T as La, W as za, b as qa } from "./WorkspaceLoadingState-BjZGQLS_.js";
14
+ import { C as Ba, c as Aa } from "./CodeEditor-DQqOn4xz.js";
15
+ import { FileTree as Ka } from "./FileTree-BVfqs3rR.js";
16
+ import { MarkdownEditor as ja } from "./MarkdownEditor-CcCDF65H.js";
17
17
  function re(e, t) {
18
18
  const { pluginId: r, ...n } = e;
19
19
  return t ? { ...n, pluginId: t } : n;
20
20
  }
21
- function fe(e, t) {
21
+ function xe(e, t) {
22
22
  const r = [];
23
23
  for (const n of e.panels ?? [])
24
24
  r.push(re({ type: "panel", panel: n }, t));
@@ -34,15 +34,15 @@ function fe(e, t) {
34
34
  r.push(re(n, t));
35
35
  return r;
36
36
  }
37
- function gt(e) {
37
+ function ht(e) {
38
38
  return e.map((r) => r == null ? void 0 : r.trim()).filter((r) => !!r).join(`
39
39
 
40
40
  `) || void 0;
41
41
  }
42
- function er(e) {
42
+ function tr(e) {
43
43
  const t = e.adoptOutputs !== !1, r = e.plugins.flatMap(
44
- (l) => fe(l, t ? void 0 : l.id)
45
- ), n = fe(
44
+ (l) => xe(l, t ? void 0 : l.id)
45
+ ), n = xe(
46
46
  {
47
47
  id: e.id,
48
48
  panels: e.panels,
@@ -56,74 +56,74 @@ function er(e) {
56
56
  return ae({
57
57
  id: e.id,
58
58
  label: e.label,
59
- systemPrompt: gt([
59
+ systemPrompt: ht([
60
60
  ...e.plugins.map((l) => l.systemPrompt),
61
61
  e.systemPrompt
62
62
  ]),
63
63
  outputs: [...r, ...n]
64
64
  });
65
65
  }
66
- function tr() {
67
- const e = Ne();
68
- return je(e.subscribe, e.getSnapshot);
66
+ function rr() {
67
+ const e = ke();
68
+ return Ue(e.subscribe, e.getSnapshot);
69
69
  }
70
- function me(e) {
70
+ function ye(e) {
71
71
  return typeof window > "u" ? !1 : window.innerWidth < e;
72
72
  }
73
- function ge(e = 1024) {
74
- const [t, r] = V(() => me(e));
75
- return U(() => {
73
+ function be(e = 1024) {
74
+ const [t, r] = V(() => ye(e));
75
+ return Y(() => {
76
76
  const n = () => {
77
- r(me(e));
77
+ r(ye(e));
78
78
  };
79
79
  return n(), window.addEventListener("resize", n), () => {
80
80
  window.removeEventListener("resize", n);
81
81
  };
82
82
  }, [e]), t;
83
83
  }
84
- function ht({
84
+ function xt({
85
85
  isNarrowViewport: e,
86
86
  isCollapsed: t,
87
87
  setCollapsed: r
88
88
  }) {
89
- const n = w(t), l = w(!1), o = w(null);
90
- return U(() => {
89
+ const n = I(t), l = I(!1), o = I(null);
90
+ return Y(() => {
91
91
  n.current = t;
92
- }, [t]), U(() => {
93
- const p = o.current, c = p !== !0 && e, s = p === !0 && !e;
92
+ }, [t]), Y(() => {
93
+ const d = o.current, c = d !== !0 && e, s = d === !0 && !e;
94
94
  if (o.current = e, e && c && !n.current) {
95
95
  l.current = !0, r(!0);
96
96
  return;
97
97
  }
98
98
  s && l.current && (l.current = !1, r(!1));
99
- }, [e, r]), S(() => {
99
+ }, [e, r]), v(() => {
100
100
  l.current = !1;
101
101
  }, []);
102
102
  }
103
- function rr(e) {
104
- const [t, r] = V([]), n = w(t);
105
- n.current = t, U(() => {
103
+ function ar(e) {
104
+ const [t, r] = V([]), n = I(t);
105
+ n.current = t, Y(() => {
106
106
  if (!e) {
107
107
  r([]);
108
108
  return;
109
109
  }
110
110
  function s() {
111
111
  try {
112
- const d = e.toJSON(), x = [];
113
- if (d && typeof d == "object" && "panels" in d) {
114
- const T = d;
115
- if (T.panels)
116
- for (const [, v] of Object.entries(T.panels))
117
- v.id && x.push({
118
- id: v.id,
119
- component: v.contentComponent ?? v.id,
120
- params: v.params
112
+ const u = e.toJSON(), x = [];
113
+ if (u && typeof u == "object" && "panels" in u) {
114
+ const C = u;
115
+ if (C.panels)
116
+ for (const [, y] of Object.entries(C.panels))
117
+ y.id && x.push({
118
+ id: y.id,
119
+ component: y.contentComponent ?? y.id,
120
+ params: y.params
121
121
  });
122
122
  }
123
- const u = n.current;
124
- (u.length !== x.length || u.some((T, v) => {
125
- var C;
126
- return T.id !== ((C = x[v]) == null ? void 0 : C.id);
123
+ const g = n.current;
124
+ (g.length !== x.length || g.some((C, y) => {
125
+ var P;
126
+ return C.id !== ((P = x[y]) == null ? void 0 : P.id);
127
127
  })) && r(x);
128
128
  } catch {
129
129
  }
@@ -132,7 +132,7 @@ function rr(e) {
132
132
  const i = setInterval(s, 500);
133
133
  return () => clearInterval(i);
134
134
  }, [e]);
135
- const l = S(
135
+ const l = v(
136
136
  (s) => {
137
137
  e == null || e.addPanel("artifacts", {
138
138
  id: s.id,
@@ -141,39 +141,39 @@ function rr(e) {
141
141
  });
142
142
  },
143
143
  [e]
144
- ), o = S(
144
+ ), o = v(
145
145
  (s) => {
146
146
  e == null || e.removePanel(s);
147
147
  },
148
148
  [e]
149
- ), p = S(
149
+ ), d = v(
150
150
  (s) => {
151
151
  e == null || e.activatePanel(s);
152
152
  },
153
153
  [e]
154
- ), c = S(
154
+ ), c = v(
155
155
  (s) => n.current.some((i) => i.id === s),
156
156
  []
157
157
  );
158
- return { panels: t, open: l, close: o, activate: p, isOpen: c };
158
+ return { panels: t, open: l, close: o, activate: d, isOpen: c };
159
159
  }
160
- function ar(e, t = {}) {
161
- const r = t.toolPanelMap ?? {}, n = S(
160
+ function nr(e, t = {}) {
161
+ const r = t.toolPanelMap ?? {}, n = v(
162
162
  (o) => r[o],
163
163
  [r]
164
164
  );
165
- return { openForTool: S(
166
- (o, p) => {
165
+ return { openForTool: v(
166
+ (o, d) => {
167
167
  const c = r[o];
168
168
  if (!c) return;
169
- const s = `artifact-${p.path}`;
170
- e.isOpen(s) ? e.activate(s) : e.open({ id: s, component: c, params: p });
169
+ const s = `artifact-${d.path}`;
170
+ e.isOpen(s) ? e.activate(s) : e.open({ id: s, component: c, params: d });
171
171
  },
172
172
  [r, e]
173
173
  ), resolvePanel: n };
174
174
  }
175
175
  const ce = { items: [], total: 0, hasMore: !1, loading: !1 };
176
- function xt(e, t) {
176
+ function yt(e, t) {
177
177
  switch (t.type) {
178
178
  case "setPendingQuery":
179
179
  return { ...e, pendingQuery: t.query };
@@ -240,7 +240,7 @@ function xt(e, t) {
240
240
  return { ...e, loading: t.loading };
241
241
  }
242
242
  }
243
- const yt = {
243
+ const bt = {
244
244
  query: "",
245
245
  pendingQuery: "",
246
246
  filters: {},
@@ -256,181 +256,181 @@ const yt = {
256
256
  function oe(e) {
257
257
  return e instanceof DOMException && e.name === "AbortError";
258
258
  }
259
- function bt(e) {
259
+ function vt(e) {
260
260
  const {
261
261
  adapter: t,
262
262
  facets: r,
263
263
  groupBy: n,
264
264
  pageSize: l = 50,
265
265
  debounceMs: o = 200,
266
- query: p
267
- } = e, c = p !== void 0, [s, i] = Ge(xt, yt), d = w(s);
268
- d.current = s;
269
- const x = w(t);
266
+ query: d
267
+ } = e, c = d !== void 0, [s, i] = Xe(yt, bt), u = I(s);
268
+ u.current = s;
269
+ const x = I(t);
270
270
  x.current = t;
271
- const u = w({ pageSize: l, groupBy: n, hasFacets: !!(r != null && r.length) });
272
- u.current = { pageSize: l, groupBy: n, hasFacets: !!(r != null && r.length) };
273
- const P = w(null), T = w(/* @__PURE__ */ new Map()), v = w(null), C = w(null), I = w(!0), j = S(
274
- async (f) => {
275
- var D;
276
- (D = P.current) == null || D.abort();
271
+ const g = I({ pageSize: l, groupBy: n, hasFacets: !!(r != null && r.length) });
272
+ g.current = { pageSize: l, groupBy: n, hasFacets: !!(r != null && r.length) };
273
+ const m = I(null), C = I(/* @__PURE__ */ new Map()), y = I(null), P = I(null), O = I(!0), j = v(
274
+ async (p) => {
275
+ var R;
276
+ (R = m.current) == null || R.abort();
277
277
  const N = new AbortController();
278
- P.current = N, i({ type: "loading", loading: !0 });
278
+ m.current = N, i({ type: "loading", loading: !0 });
279
279
  const b = {
280
- query: f.query,
281
- filters: f.filters,
282
- offset: f.offset,
283
- limit: u.current.pageSize,
280
+ query: p.query,
281
+ filters: p.filters,
282
+ offset: p.offset,
283
+ limit: g.current.pageSize,
284
284
  signal: N.signal
285
285
  };
286
286
  try {
287
- const k = await x.current.search(b);
288
- if (!I.current || N.signal.aborted) return;
287
+ const E = await x.current.search(b);
288
+ if (!O.current || N.signal.aborted) return;
289
289
  i({
290
290
  type: "topResolved",
291
- items: k.items,
292
- total: k.total,
293
- hasMore: k.hasMore,
294
- offset: f.offset,
295
- append: f.append
291
+ items: E.items,
292
+ total: E.total,
293
+ hasMore: E.hasMore,
294
+ offset: p.offset,
295
+ append: p.append
296
296
  });
297
- } catch (k) {
298
- if (oe(k)) return;
299
- console.error("DataExplorer: search failed", k);
297
+ } catch (E) {
298
+ if (oe(E)) return;
299
+ console.error("DataExplorer: search failed", E);
300
300
  } finally {
301
- I.current && P.current === N && i({ type: "loading", loading: !1 });
301
+ O.current && m.current === N && i({ type: "loading", loading: !1 });
302
302
  }
303
303
  },
304
304
  []
305
- ), L = S(
306
- async (f) => {
307
- var k;
308
- const N = u.current.groupBy;
305
+ ), F = v(
306
+ async (p) => {
307
+ var E;
308
+ const N = g.current.groupBy;
309
309
  if (!N) return;
310
- (k = T.current.get(f.groupValue)) == null || k.abort();
310
+ (E = C.current.get(p.groupValue)) == null || E.abort();
311
311
  const b = new AbortController();
312
- T.current.set(f.groupValue, b), i({ type: "groupLoading", value: f.groupValue, loading: !0 });
313
- const D = {
314
- query: f.query,
315
- filters: f.filters,
316
- group: { key: N, value: f.groupValue },
317
- offset: f.offset,
318
- limit: u.current.pageSize,
312
+ C.current.set(p.groupValue, b), i({ type: "groupLoading", value: p.groupValue, loading: !0 });
313
+ const R = {
314
+ query: p.query,
315
+ filters: p.filters,
316
+ group: { key: N, value: p.groupValue },
317
+ offset: p.offset,
318
+ limit: g.current.pageSize,
319
319
  signal: b.signal
320
320
  };
321
321
  try {
322
- const W = await x.current.search(D);
323
- if (!I.current || b.signal.aborted) return;
322
+ const X = await x.current.search(R);
323
+ if (!O.current || b.signal.aborted) return;
324
324
  i({
325
325
  type: "groupResolved",
326
- value: f.groupValue,
327
- items: W.items,
328
- total: W.total,
329
- hasMore: W.hasMore,
330
- append: f.append
326
+ value: p.groupValue,
327
+ items: X.items,
328
+ total: X.total,
329
+ hasMore: X.hasMore,
330
+ append: p.append
331
331
  });
332
- } catch (W) {
333
- if (oe(W)) return;
334
- console.error("DataExplorer: group search failed", W), I.current && i({ type: "groupLoading", value: f.groupValue, loading: !1 });
332
+ } catch (X) {
333
+ if (oe(X)) return;
334
+ console.error("DataExplorer: group search failed", X), O.current && i({ type: "groupLoading", value: p.groupValue, loading: !1 });
335
335
  }
336
336
  },
337
337
  []
338
- ), z = S(async (f) => {
339
- var D;
340
- if (!u.current.hasFacets) return;
338
+ ), _ = v(async (p) => {
339
+ var R;
340
+ if (!g.current.hasFacets) return;
341
341
  const N = x.current.fetchFacets;
342
342
  if (!N) return;
343
- (D = v.current) == null || D.abort();
343
+ (R = y.current) == null || R.abort();
344
344
  const b = new AbortController();
345
- v.current = b;
345
+ y.current = b;
346
346
  try {
347
- const k = await N({ filters: f, signal: b.signal });
348
- if (!I.current || b.signal.aborted) return;
349
- i({ type: "facetsResolved", facets: k });
350
- } catch (k) {
351
- if (oe(k)) return;
352
- console.error("DataExplorer: fetchFacets failed", k);
347
+ const E = await N({ filters: p, signal: b.signal });
348
+ if (!O.current || b.signal.aborted) return;
349
+ i({ type: "facetsResolved", facets: E });
350
+ } catch (E) {
351
+ if (oe(E)) return;
352
+ console.error("DataExplorer: fetchFacets failed", E);
353
353
  }
354
- }, []), g = S(
355
- (f, N) => {
356
- j({ query: f, filters: N, offset: 0, append: !1 }), z(N);
354
+ }, []), S = v(
355
+ (p, N) => {
356
+ j({ query: p, filters: N, offset: 0, append: !1 }), _(N);
357
357
  },
358
- [j, z]
359
- ), R = w(c);
360
- R.current = c;
361
- const Q = S(
362
- (f) => {
363
- R.current || (i({ type: "setPendingQuery", query: f }), C.current && clearTimeout(C.current), C.current = setTimeout(() => {
364
- i({ type: "applyQuery", query: f }), g(f, d.current.filters);
358
+ [j, _]
359
+ ), z = I(c);
360
+ z.current = c;
361
+ const k = v(
362
+ (p) => {
363
+ z.current || (i({ type: "setPendingQuery", query: p }), P.current && clearTimeout(P.current), P.current = setTimeout(() => {
364
+ i({ type: "applyQuery", query: p }), S(p, u.current.filters);
365
365
  }, o));
366
366
  },
367
- [o, g]
368
- ), O = S(
369
- (f, N) => {
370
- const b = d.current.filters[f] ?? [], D = b.includes(N) ? b.filter((W) => W !== N) : [...b, N], k = { ...d.current.filters };
371
- D.length ? k[f] = D : delete k[f], i({ type: "setFilters", filters: k }), g(d.current.query, k);
367
+ [o, S]
368
+ ), L = v(
369
+ (p, N) => {
370
+ const b = u.current.filters[p] ?? [], R = b.includes(N) ? b.filter((X) => X !== N) : [...b, N], E = { ...u.current.filters };
371
+ R.length ? E[p] = R : delete E[p], i({ type: "setFilters", filters: E }), S(u.current.query, E);
372
372
  },
373
- [g]
374
- ), q = S(() => {
375
- i({ type: "setFilters", filters: {} }), g(d.current.query, {});
376
- }, [g]), y = S(
377
- (f) => {
373
+ [S]
374
+ ), B = v(() => {
375
+ i({ type: "setFilters", filters: {} }), S(u.current.query, {});
376
+ }, [S]), T = v(
377
+ (p) => {
378
378
  var b;
379
- const N = (((b = d.current.groups[f]) == null ? void 0 : b.items.length) ?? 0) > 0;
380
- i({ type: "expandGroup", value: f }), N || L({
381
- groupValue: f,
382
- query: d.current.query,
383
- filters: d.current.filters,
379
+ const N = (((b = u.current.groups[p]) == null ? void 0 : b.items.length) ?? 0) > 0;
380
+ i({ type: "expandGroup", value: p }), N || F({
381
+ groupValue: p,
382
+ query: u.current.query,
383
+ filters: u.current.filters,
384
384
  offset: 0,
385
385
  append: !1
386
386
  });
387
387
  },
388
- [L]
389
- ), _ = S((f) => {
390
- i({ type: "collapseGroup", value: f });
391
- }, []), B = S(() => {
392
- const f = d.current;
393
- f.topHasMore && j({
394
- query: f.query,
395
- filters: f.filters,
396
- offset: f.topOffset,
388
+ [F]
389
+ ), G = v((p) => {
390
+ i({ type: "collapseGroup", value: p });
391
+ }, []), D = v(() => {
392
+ const p = u.current;
393
+ p.topHasMore && j({
394
+ query: p.query,
395
+ filters: p.filters,
396
+ offset: p.topOffset,
397
397
  append: !0
398
398
  });
399
- }, [j]), X = S(
400
- (f) => {
401
- const N = d.current, b = N.groups[f];
402
- b != null && b.hasMore && L({
403
- groupValue: f,
399
+ }, [j]), Q = v(
400
+ (p) => {
401
+ const N = u.current, b = N.groups[p];
402
+ b != null && b.hasMore && F({
403
+ groupValue: p,
404
404
  query: N.query,
405
405
  filters: N.filters,
406
406
  offset: b.items.length,
407
407
  append: !0
408
408
  });
409
409
  },
410
- [L]
410
+ [F]
411
411
  );
412
- U(() => {
413
- I.current = !0;
414
- const f = R.current ? p ?? "" : "";
415
- return f && i({ type: "applyQuery", query: f }), g(f, {}), () => {
412
+ Y(() => {
413
+ O.current = !0;
414
+ const p = z.current ? d ?? "" : "";
415
+ return p && i({ type: "applyQuery", query: p }), S(p, {}), () => {
416
416
  var N, b;
417
- I.current = !1, C.current && clearTimeout(C.current), (N = P.current) == null || N.abort(), (b = v.current) == null || b.abort();
418
- for (const D of T.current.values()) D.abort();
419
- T.current.clear();
417
+ O.current = !1, P.current && clearTimeout(P.current), (N = m.current) == null || N.abort(), (b = y.current) == null || b.abort();
418
+ for (const R of C.current.values()) R.abort();
419
+ C.current.clear();
420
420
  };
421
421
  }, []);
422
- const ee = w(p);
423
- U(() => {
424
- if (!c || ee.current === p) return;
425
- ee.current = p;
426
- const f = p ?? "";
427
- i({ type: "applyQuery", query: f }), g(f, d.current.filters);
428
- }, [c, p, g]);
429
- const te = S(
430
- (f) => s.groups[f] ?? ce,
422
+ const U = I(d);
423
+ Y(() => {
424
+ if (!c || U.current === d) return;
425
+ U.current = d;
426
+ const p = d ?? "";
427
+ i({ type: "applyQuery", query: p }), S(p, u.current.filters);
428
+ }, [c, d, S]);
429
+ const te = v(
430
+ (p) => s.groups[p] ?? ce,
431
431
  [s.groups]
432
- ), Y = S(
433
- (f) => !!s.expanded[f],
432
+ ), Z = v(
433
+ (p) => !!s.expanded[p],
434
434
  [s.expanded]
435
435
  );
436
436
  return {
@@ -442,14 +442,14 @@ function bt(e) {
442
442
  topHasMore: s.topHasMore,
443
443
  loading: s.loading,
444
444
  getGroup: te,
445
- isExpanded: Y,
446
- setQuery: Q,
447
- toggleFilter: O,
448
- clearFilters: q,
449
- expandGroup: y,
450
- collapseGroup: _,
451
- loadMoreTop: B,
452
- loadMoreGroup: X
445
+ isExpanded: Z,
446
+ setQuery: k,
447
+ toggleFilter: L,
448
+ clearFilters: B,
449
+ expandGroup: T,
450
+ collapseGroup: G,
451
+ loadMoreTop: D,
452
+ loadMoreGroup: Q
453
453
  };
454
454
  }
455
455
  function ie({
@@ -459,107 +459,132 @@ function ie({
459
459
  onActivate: n,
460
460
  getDragPayload: l,
461
461
  emptyState: o = "No results",
462
- searchPlaceholder: p = "Search…",
462
+ searchPlaceholder: d = "Search…",
463
463
  searchable: c = !0,
464
464
  query: s,
465
- pageSize: i,
466
- debounceMs: d,
467
- className: x
465
+ onQueryChange: i,
466
+ pageSize: u,
467
+ debounceMs: x,
468
+ className: g
468
469
  }) {
469
- const u = bt({
470
+ const m = vt({
470
471
  adapter: e,
471
472
  facets: t,
472
473
  groupBy: r,
473
- pageSize: i,
474
- debounceMs: d,
474
+ pageSize: u,
475
+ debounceMs: x,
475
476
  query: s
476
- }), T = c && !(s !== void 0), v = (s ?? u.query ?? "").length > 0, C = !!r && !v, I = Object.values(u.filters).some((g) => g.length > 0), j = Object.values(u.filters).reduce((g, R) => g + R.length, 0), L = Z(() => {
477
- var O, q;
478
- if (!C || !r) return [];
479
- const g = t == null ? void 0 : t.find((y) => y.key === r), Q = [...((O = u.facets) == null ? void 0 : O[r]) ?? []];
480
- if ((q = g == null ? void 0 : g.order) != null && q.length) {
481
- const y = (_) => {
482
- const B = g.order.indexOf(_);
483
- return B === -1 ? Number.MAX_SAFE_INTEGER : B;
477
+ }), C = s !== void 0, y = c && (!C || !!i), P = C && i ? i : m.setQuery, O = (s ?? m.query ?? "").length > 0, j = Object.values(m.filters).some((k) => k.length > 0), F = !!r && !O && !j, _ = Object.values(m.filters).reduce((k, L) => k + L.length, 0), S = ee(() => {
478
+ var T, G;
479
+ if (!F || !r) return [];
480
+ const k = t == null ? void 0 : t.find((D) => D.key === r), B = [...((T = m.facets) == null ? void 0 : T[r]) ?? []];
481
+ if ((G = k == null ? void 0 : k.order) != null && G.length) {
482
+ const D = (Q) => {
483
+ const U = k.order.indexOf(Q);
484
+ return U === -1 ? Number.MAX_SAFE_INTEGER : U;
484
485
  };
485
- Q.sort((_, B) => y(_.value) - y(B.value));
486
+ B.sort((Q, U) => D(Q.value) - D(U.value));
486
487
  }
487
- return Q.map((y) => ({
488
- value: y.value,
489
- count: y.count,
490
- label: g != null && g.formatValue ? g.formatValue(y.value) : y.value
488
+ return B.map((D) => ({
489
+ value: D.value,
490
+ count: D.count,
491
+ label: k != null && k.formatValue ? k.formatValue(D.value) : D.value
491
492
  }));
492
- }, [C, r, t, u.facets]), z = !u.loading && !C && u.topItems.length === 0 && u.query.length === 0 && !I;
493
- return /* @__PURE__ */ h("div", { className: H("flex h-full flex-col", x), "data-slot": "data-explorer", children: [
494
- T || t != null && t.length ? /* @__PURE__ */ a(
495
- vt,
493
+ }, [F, r, t, m.facets]), z = !m.loading && !F && m.topItems.length === 0 && m.query.length === 0 && !j;
494
+ return /* @__PURE__ */ h("div", { className: H("flex h-full flex-col", g), "data-slot": "data-explorer", children: [
495
+ y || t != null && t.length ? /* @__PURE__ */ a(
496
+ Nt,
496
497
  {
497
- searchable: T,
498
- searchPlaceholder: p,
499
- query: u.query,
500
- onQueryChange: u.setQuery,
498
+ searchable: y,
499
+ searchPlaceholder: d,
500
+ query: m.query,
501
+ onQueryChange: P,
501
502
  facetConfigs: t,
502
- facets: u.facets,
503
- filters: u.filters,
504
- filterCount: j,
505
- onToggleFilter: u.toggleFilter,
506
- onClearFilters: u.clearFilters,
507
- total: C ? null : u.topTotal
503
+ facets: m.facets,
504
+ filters: m.filters,
505
+ filterCount: _,
506
+ onToggleFilter: m.toggleFilter,
507
+ onClearFilters: m.clearFilters,
508
+ total: F ? null : m.topTotal
508
509
  }
509
510
  ) : null,
510
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "data-explorer-list", children: z ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center px-4 py-8", children: /* @__PURE__ */ a(Pe, { className: "min-h-0 border-0", description: o }) }) : C ? /* @__PURE__ */ a(
511
- Ct,
511
+ /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "data-explorer-list", children: z ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center px-4 py-8", children: /* @__PURE__ */ a(Ie, { className: "min-h-0 border-0", description: o }) }) : F ? /* @__PURE__ */ a(
512
+ Tt,
512
513
  {
513
- entries: L,
514
- isExpanded: u.isExpanded,
515
- getGroup: u.getGroup,
516
- onExpand: u.expandGroup,
517
- onCollapse: u.collapseGroup,
518
- onLoadMoreGroup: u.loadMoreGroup,
514
+ entries: S,
515
+ isExpanded: m.isExpanded,
516
+ getGroup: m.getGroup,
517
+ onExpand: m.expandGroup,
518
+ onCollapse: m.collapseGroup,
519
+ onLoadMoreGroup: m.loadMoreGroup,
519
520
  onActivate: n,
520
521
  getDragPayload: l
521
522
  }
522
523
  ) : /* @__PURE__ */ a(
523
- Nt,
524
+ Ct,
524
525
  {
525
- items: u.topItems,
526
- hasMore: u.topHasMore,
527
- loading: u.loading,
528
- onLoadMore: u.loadMoreTop,
526
+ items: m.topItems,
527
+ hasMore: m.topHasMore,
528
+ loading: m.loading,
529
+ onLoadMore: m.loadMoreTop,
529
530
  onActivate: n,
530
531
  getDragPayload: l
531
532
  }
532
533
  ) })
533
534
  ] });
534
535
  }
535
- function vt({
536
+ function Nt({
536
537
  searchable: e,
537
538
  searchPlaceholder: t,
538
539
  query: r,
539
540
  onQueryChange: n,
540
541
  facetConfigs: l,
541
542
  facets: o,
542
- filters: p,
543
+ filters: d,
543
544
  filterCount: c,
544
545
  onToggleFilter: s,
545
546
  onClearFilters: i,
546
- total: d
547
+ total: u
547
548
  }) {
548
- return /* @__PURE__ */ h(rt, { className: "border-b border-border/60 px-2 py-1.5", children: [
549
- e ? /* @__PURE__ */ a(
550
- ke,
551
- {
552
- "aria-label": "Search",
553
- placeholder: t,
554
- value: r,
555
- onChange: (x) => n(x.target.value),
556
- className: "h-7 flex-1 rounded-sm border-transparent bg-muted/40 px-2 text-[12.5px] shadow-none focus-visible:bg-background focus-visible:ring-1"
557
- }
558
- ) : null,
559
- d != null ? /* @__PURE__ */ a("span", { className: "px-1 font-mono text-[10.5px] uppercase tracking-[0.05em] text-muted-foreground/80", children: d.toLocaleString() }) : null,
560
- l != null && l.length ? /* @__PURE__ */ h(at, { children: [
549
+ return /* @__PURE__ */ h(ot, { className: "border-b border-border/60 px-2 py-1.5", children: [
550
+ u != null ? /* @__PURE__ */ a("span", { className: "px-1 font-mono text-[10.5px] uppercase tracking-[0.05em] text-muted-foreground/80", children: u.toLocaleString() }) : null,
551
+ /* @__PURE__ */ a("div", { className: "flex-1" }),
552
+ e ? /* @__PURE__ */ h(me, { children: [
553
+ /* @__PURE__ */ h(
554
+ ge,
555
+ {
556
+ "aria-label": "Search",
557
+ className: H(
558
+ "inline-flex h-7 items-center gap-1 rounded-sm px-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground",
559
+ r.length > 0 && "bg-muted text-foreground"
560
+ ),
561
+ children: [
562
+ /* @__PURE__ */ a(Ze, { size: 12 }),
563
+ r.length > 0 ? /* @__PURE__ */ a("span", { className: "max-w-20 truncate text-[11px]", children: r }) : null
564
+ ]
565
+ }
566
+ ),
567
+ /* @__PURE__ */ h(he, { side: "right", align: "start", sideOffset: 8, className: "w-64 p-3", children: [
568
+ /* @__PURE__ */ a(
569
+ Me,
570
+ {
571
+ "aria-label": "Search",
572
+ autoFocus: !0,
573
+ placeholder: t,
574
+ value: r,
575
+ onChange: (x) => n(x.target.value),
576
+ className: "h-8 rounded-sm text-[12.5px]"
577
+ }
578
+ ),
579
+ r.length > 0 ? /* @__PURE__ */ h(J, { type: "button", variant: "ghost", size: "xs", onClick: () => n(""), className: "mt-2 gap-1 text-[11px] text-muted-foreground hover:text-foreground", children: [
580
+ /* @__PURE__ */ a(pe, { size: 11 }),
581
+ " Clear search"
582
+ ] }) : null
583
+ ] })
584
+ ] }) : null,
585
+ l != null && l.length ? /* @__PURE__ */ h(me, { children: [
561
586
  /* @__PURE__ */ h(
562
- nt,
587
+ ge,
563
588
  {
564
589
  "aria-label": "Filters",
565
590
  className: H(
@@ -567,16 +592,17 @@ function vt({
567
592
  c > 0 && "bg-muted text-foreground"
568
593
  ),
569
594
  children: [
570
- /* @__PURE__ */ a(Ue, { size: 12 }),
595
+ /* @__PURE__ */ a(et, { size: 12 }),
571
596
  c > 0 ? /* @__PURE__ */ a("span", { className: "font-mono text-[10px]", children: c }) : null
572
597
  ]
573
598
  }
574
599
  ),
575
600
  /* @__PURE__ */ h(
576
- lt,
601
+ he,
577
602
  {
578
- align: "end",
579
- sideOffset: 6,
603
+ side: "right",
604
+ align: "start",
605
+ sideOffset: 8,
580
606
  className: "w-64 space-y-3 p-3 text-[12px]",
581
607
  children: [
582
608
  l.map((x) => /* @__PURE__ */ a(
@@ -584,13 +610,13 @@ function vt({
584
610
  {
585
611
  config: x,
586
612
  values: (o == null ? void 0 : o[x.key]) ?? [],
587
- selected: p[x.key] ?? [],
613
+ selected: d[x.key] ?? [],
588
614
  onToggle: s
589
615
  },
590
616
  x.key
591
617
  )),
592
618
  c > 0 ? /* @__PURE__ */ h(J, { type: "button", variant: "ghost", size: "xs", onClick: i, className: "gap-1 text-[11px] text-muted-foreground hover:text-foreground", children: [
593
- /* @__PURE__ */ a(Xe, { size: 11 }),
619
+ /* @__PURE__ */ a(pe, { size: 11 }),
594
620
  " Clear all"
595
621
  ] }) : null
596
622
  ]
@@ -606,19 +632,19 @@ function St({
606
632
  onToggle: n
607
633
  }) {
608
634
  if (!t.length) return null;
609
- const l = e.order ? [...t].sort((o, p) => {
610
- const c = e.order.indexOf(o.value), s = e.order.indexOf(p.value);
635
+ const l = e.order ? [...t].sort((o, d) => {
636
+ const c = e.order.indexOf(o.value), s = e.order.indexOf(d.value);
611
637
  return (c === -1 ? 999 : c) - (s === -1 ? 999 : s);
612
638
  }) : t;
613
639
  return /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
614
640
  /* @__PURE__ */ a("div", { className: "font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground", children: e.label }),
615
641
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: l.map((o) => {
616
- const p = r.includes(o.value), c = e.formatValue ? e.formatValue(o.value) : o.value;
642
+ const d = r.includes(o.value), c = e.formatValue ? e.formatValue(o.value) : o.value;
617
643
  return /* @__PURE__ */ h(
618
- st,
644
+ ct,
619
645
  {
620
646
  type: "button",
621
- selected: p,
647
+ selected: d,
622
648
  onClick: () => n(e.key, o.value),
623
649
  className: "gap-1 rounded-sm text-[11px]",
624
650
  children: [
@@ -631,7 +657,7 @@ function St({
631
657
  }) })
632
658
  ] });
633
659
  }
634
- function Nt({
660
+ function Ct({
635
661
  items: e,
636
662
  hasMore: t,
637
663
  loading: r,
@@ -640,30 +666,30 @@ function Nt({
640
666
  getDragPayload: o
641
667
  }) {
642
668
  return /* @__PURE__ */ h("ul", { className: "flex flex-col px-1 py-1", children: [
643
- e.map((p) => /* @__PURE__ */ a(
644
- Me,
669
+ e.map((d) => /* @__PURE__ */ a(
670
+ Oe,
645
671
  {
646
- row: p,
672
+ row: d,
647
673
  onActivate: l,
648
674
  getDragPayload: o
649
675
  },
650
- p.id
676
+ d.id
651
677
  )),
652
678
  t ? /* @__PURE__ */ a("li", { className: "px-3 py-2", children: /* @__PURE__ */ a(J, { type: "button", variant: "ghost", size: "xs", onClick: n, disabled: r, className: "w-full justify-start text-[11px] text-muted-foreground hover:text-foreground", children: r ? "Loading…" : "Load more" }) }) : null
653
679
  ] });
654
680
  }
655
- function Ct({
681
+ function Tt({
656
682
  entries: e,
657
683
  isExpanded: t,
658
684
  getGroup: r,
659
685
  onExpand: n,
660
686
  onCollapse: l,
661
687
  onLoadMoreGroup: o,
662
- onActivate: p,
688
+ onActivate: d,
663
689
  getDragPayload: c
664
690
  }) {
665
691
  return /* @__PURE__ */ a("ul", { className: "flex flex-col py-1", children: e.map((s) => {
666
- const i = t(s.value), d = r(s.value);
692
+ const i = t(s.value), u = r(s.value);
667
693
  return /* @__PURE__ */ h("li", { children: [
668
694
  /* @__PURE__ */ h(
669
695
  J,
@@ -675,33 +701,33 @@ function Ct({
675
701
  onClick: () => i ? l(s.value) : n(s.value),
676
702
  className: "group mx-1 h-auto w-[calc(100%-0.5rem)] justify-start gap-1.5 px-1.5 py-1 text-left hover:bg-muted/40",
677
703
  children: [
678
- i ? /* @__PURE__ */ a(Ce, { size: 11, className: "text-muted-foreground/80" }) : /* @__PURE__ */ a(Te, { size: 11, className: "text-muted-foreground/80" }),
704
+ i ? /* @__PURE__ */ a(Ee, { size: 11, className: "text-muted-foreground/80" }) : /* @__PURE__ */ a(we, { size: 11, className: "text-muted-foreground/80" }),
679
705
  /* @__PURE__ */ a("span", { className: "text-[12.5px] font-medium text-foreground", children: s.label }),
680
706
  /* @__PURE__ */ a("span", { className: "ml-auto font-mono text-[10.5px] text-muted-foreground/80", children: s.count.toLocaleString() })
681
707
  ]
682
708
  }
683
709
  ),
684
710
  i ? /* @__PURE__ */ h("ul", { className: "flex flex-col", children: [
685
- d.items.map((x) => /* @__PURE__ */ a(
686
- Me,
711
+ u.items.map((x) => /* @__PURE__ */ a(
712
+ Oe,
687
713
  {
688
714
  row: x,
689
715
  indent: !0,
690
- onActivate: p,
716
+ onActivate: d,
691
717
  getDragPayload: c
692
718
  },
693
719
  x.id
694
720
  )),
695
- d.loading && d.items.length === 0 ? /* @__PURE__ */ h("li", { className: "flex items-center gap-1.5 pl-7 pr-3 py-1.5 text-[11px] text-muted-foreground/80", children: [
696
- /* @__PURE__ */ a(ot, { className: "size-3" }),
721
+ u.loading && u.items.length === 0 ? /* @__PURE__ */ h("li", { className: "flex items-center gap-1.5 pl-7 pr-3 py-1.5 text-[11px] text-muted-foreground/80", children: [
722
+ /* @__PURE__ */ a(st, { className: "size-3" }),
697
723
  "Loading…"
698
724
  ] }) : null,
699
- d.hasMore ? /* @__PURE__ */ a("li", { className: "pl-7 pr-3 py-1", children: /* @__PURE__ */ a(J, { type: "button", variant: "ghost", size: "xs", onClick: () => o(s.value), disabled: d.loading, className: "text-[11px] text-muted-foreground hover:text-foreground", children: d.loading ? "Loading…" : "Load more" }) }) : null
725
+ u.hasMore ? /* @__PURE__ */ a("li", { className: "pl-7 pr-3 py-1", children: /* @__PURE__ */ a(J, { type: "button", variant: "ghost", size: "xs", onClick: () => o(s.value), disabled: u.loading, className: "text-[11px] text-muted-foreground hover:text-foreground", children: u.loading ? "Loading…" : "Load more" }) }) : null
700
726
  ] }) : null
701
727
  ] }, s.value);
702
728
  }) });
703
729
  }
704
- function Me({
730
+ function Oe({
705
731
  row: e,
706
732
  indent: t,
707
733
  onActivate: r,
@@ -712,11 +738,11 @@ function Me({
712
738
  return /* @__PURE__ */ h(
713
739
  "li",
714
740
  {
715
- ...l ? { role: "button", tabIndex: 0, onClick: () => r == null ? void 0 : r(e), onKeyDown: (d) => {
716
- l && (d.key === "Enter" || d.key === " ") && (d.preventDefault(), r == null || r(e));
741
+ ...l ? { role: "button", tabIndex: 0, onClick: () => r == null ? void 0 : r(e), onKeyDown: (u) => {
742
+ l && (u.key === "Enter" || u.key === " ") && (u.preventDefault(), r == null || r(e));
717
743
  } } : {},
718
- ...!!o ? { draggable: !0, onDragStart: (d) => {
719
- o && (d.dataTransfer.setData(o.mimeType, o.value), d.dataTransfer.setData("text/plain", o.value), d.dataTransfer.effectAllowed = "copy");
744
+ ...!!o ? { draggable: !0, onDragStart: (u) => {
745
+ o && (u.dataTransfer.setData(o.mimeType, o.value), u.dataTransfer.setData("text/plain", o.value), u.dataTransfer.effectAllowed = "copy");
720
746
  } } : {},
721
747
  className: H(
722
748
  "group mx-1 flex items-start gap-2 rounded-md px-1.5 py-1",
@@ -726,20 +752,20 @@ function Me({
726
752
  ),
727
753
  title: e.title,
728
754
  children: [
729
- e.leading ? /* @__PURE__ */ a(he, { badge: e.leading }) : null,
755
+ e.leading ? /* @__PURE__ */ a(ve, { badge: e.leading }) : null,
730
756
  /* @__PURE__ */ h("span", { className: "flex min-w-0 flex-1 flex-col", children: [
731
757
  /* @__PURE__ */ a("span", { className: "truncate text-[12.5px] font-medium leading-tight text-foreground", children: e.title }),
732
758
  e.subtitle ? /* @__PURE__ */ a("span", { className: "truncate text-[11.5px] leading-snug text-muted-foreground/85", children: e.subtitle }) : null
733
759
  ] }),
734
- (i = e.trailing) != null && i.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((d, x) => /* @__PURE__ */ a(he, { badge: d }, x)) }) : null,
760
+ (i = e.trailing) != null && i.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((u, x) => /* @__PURE__ */ a(ve, { badge: u }, x)) }) : null,
735
761
  e.meta ? /* @__PURE__ */ a("span", { className: "shrink-0 self-center font-mono text-[10.5px] text-muted-foreground/80", children: e.meta }) : null
736
762
  ]
737
763
  }
738
764
  );
739
765
  }
740
- function he({ badge: e }) {
766
+ function ve({ badge: e }) {
741
767
  return /* @__PURE__ */ a(
742
- ct,
768
+ it,
743
769
  {
744
770
  "aria-hidden": "true",
745
771
  title: e.tooltip,
@@ -748,12 +774,12 @@ function he({ badge: e }) {
748
774
  }
749
775
  );
750
776
  }
751
- const nr = "explorer";
752
- function Tt(e) {
777
+ const lr = "explorer";
778
+ function Pt(e) {
753
779
  return e.mode ? e.mode : e.sectionedAdapter ? "sectioned" : e.groupBy ? "grouped" : "flat";
754
780
  }
755
- function Pt(e) {
756
- const t = Tt(e);
781
+ function kt(e) {
782
+ const t = Pt(e);
757
783
  if (t === "sectioned") {
758
784
  if (!e.sectionedAdapter)
759
785
  throw new Error(`explorer "${e.id}" requires sectionedAdapter for sectioned mode`);
@@ -790,26 +816,26 @@ function Pt(e) {
790
816
  className: e.className
791
817
  };
792
818
  }
793
- function xe(e) {
819
+ function Ne(e) {
794
820
  if (e.mode === "sectioned") {
795
821
  const {
796
822
  sectionedAdapter: l,
797
823
  mode: o,
798
- adapter: p,
824
+ adapter: d,
799
825
  facets: c,
800
826
  groupBy: s,
801
827
  ...i
802
828
  } = e;
803
- return /* @__PURE__ */ a(Et, { adapter: l, ...i });
829
+ return /* @__PURE__ */ a(wt, { adapter: l, ...i });
804
830
  }
805
831
  const { mode: t, sectionedAdapter: r, ...n } = e;
806
832
  return /* @__PURE__ */ a(ie, { ...n });
807
833
  }
808
- function kt(e) {
809
- const t = [], r = e.label ?? "Explorer", n = Pt(e), l = e.source ?? "app";
834
+ function Et(e) {
835
+ const t = [], r = e.label ?? "Explorer", n = kt(e), l = e.source ?? "app";
810
836
  function o({ params: c, className: s }) {
811
837
  return /* @__PURE__ */ a(
812
- xe,
838
+ Ne,
813
839
  {
814
840
  ...n,
815
841
  query: (c == null ? void 0 : c.searchQuery) ?? (c == null ? void 0 : c.query) ?? n.query,
@@ -817,8 +843,8 @@ function kt(e) {
817
843
  }
818
844
  );
819
845
  }
820
- function p({ className: c }) {
821
- return /* @__PURE__ */ a(xe, { ...n, className: c ?? n.className ?? "h-full" });
846
+ function d({ className: c }) {
847
+ return /* @__PURE__ */ a(Ne, { ...n, className: c ?? n.className ?? "h-full" });
822
848
  }
823
849
  if (e.leftTab !== !1) {
824
850
  const c = e.leftTab ?? {};
@@ -833,11 +859,11 @@ function kt(e) {
833
859
  });
834
860
  }
835
861
  if (e.panel) {
836
- const c = we({
862
+ const c = Re({
837
863
  id: e.panel.id ?? `${e.id}-panel`,
838
864
  title: e.panel.title ?? e.panel.label ?? r,
839
865
  icon: e.panel.icon,
840
- component: p,
866
+ component: d,
841
867
  placement: "center",
842
868
  source: l
843
869
  });
@@ -857,40 +883,40 @@ function kt(e) {
857
883
  }
858
884
  return t;
859
885
  }
860
- function lr(e) {
886
+ function or(e) {
861
887
  return ae({
862
888
  id: e.pluginId ?? e.id,
863
889
  label: e.label ?? "Explorer",
864
- outputs: kt(e)
890
+ outputs: Et(e)
865
891
  });
866
892
  }
867
893
  function se(e) {
868
894
  return e instanceof DOMException && e.name === "AbortError";
869
895
  }
870
- function Et({
896
+ function wt({
871
897
  adapter: e,
872
898
  onActivate: t,
873
899
  getDragPayload: r,
874
900
  emptyState: n = "No results",
875
901
  searchPlaceholder: l = "Search…",
876
902
  searchable: o = !0,
877
- query: p,
903
+ query: d,
878
904
  pageSize: c = 50,
879
905
  className: s
880
906
  }) {
881
- const i = p !== void 0, [d, x] = V(p ?? ""), [u, P] = V([]), [T, v] = V({}), [C, I] = V({}), [j, L] = V({}), [z, g] = V(!1), [R, Q] = V({}), [O, q] = V({}), [y, _] = V({}), [B, X] = V({}), ee = w(null), te = w(/* @__PURE__ */ new Map()), Y = p ?? d, f = w(T);
882
- f.current = T;
883
- const N = w(O);
884
- N.current = O;
885
- const b = S(
886
- async (m, M, E) => {
907
+ const i = d !== void 0, [u, x] = V(d ?? ""), [g, m] = V([]), [C, y] = V({}), [P, O] = V({}), [j, F] = V({}), [_, S] = V(!1), [z, k] = V({}), [L, B] = V({}), [T, G] = V({}), [D, Q] = V({}), U = I(null), te = I(/* @__PURE__ */ new Map()), Z = d ?? u, p = I(C);
908
+ p.current = C;
909
+ const N = I(L);
910
+ N.current = L;
911
+ const b = v(
912
+ async (f, M, w) => {
887
913
  var $;
888
- ($ = te.current.get(m)) == null || $.abort();
914
+ ($ = te.current.get(f)) == null || $.abort();
889
915
  const A = new AbortController();
890
- te.current.set(m, A), Q((K) => ({ ...K, [m]: !0 }));
916
+ te.current.set(f, A), k((K) => ({ ...K, [f]: !0 }));
891
917
  try {
892
- const K = y[m] ?? {}, F = await e.searchSection(m, {
893
- query: Y,
918
+ const K = T[f] ?? {}, q = await e.searchSection(f, {
919
+ query: Z,
894
920
  globalFilters: {},
895
921
  filters: K,
896
922
  limit: c,
@@ -898,145 +924,145 @@ function Et({
898
924
  signal: A.signal
899
925
  });
900
926
  if (A.signal.aborted) return;
901
- v((G) => ({
902
- ...G,
903
- [m]: E ? [...G[m] ?? [], ...F.items] : F.items
904
- })), I((G) => ({ ...G, [m]: F.total })), L((G) => ({ ...G, [m]: F.hasMore }));
927
+ y((W) => ({
928
+ ...W,
929
+ [f]: w ? [...W[f] ?? [], ...q.items] : q.items
930
+ })), O((W) => ({ ...W, [f]: q.total })), F((W) => ({ ...W, [f]: q.hasMore }));
905
931
  } catch (K) {
906
932
  se(K) || console.error("Explorer: section search failed", K);
907
933
  } finally {
908
- te.current.get(m) === A && Q((K) => ({ ...K, [m]: !1 }));
934
+ te.current.get(f) === A && k((K) => ({ ...K, [f]: !1 }));
909
935
  }
910
936
  },
911
- [e, Y, c, y]
912
- ), D = S(
913
- async (m) => {
937
+ [e, Z, c, T]
938
+ ), R = v(
939
+ async (f) => {
914
940
  if (e.fetchSectionFacets)
915
941
  try {
916
- const M = await e.fetchSectionFacets(m, {
917
- query: Y,
942
+ const M = await e.fetchSectionFacets(f, {
943
+ query: Z,
918
944
  globalFilters: {},
919
- filters: y[m] ?? {}
945
+ filters: T[f] ?? {}
920
946
  });
921
- X((E) => ({ ...E, [m]: M }));
947
+ Q((w) => ({ ...w, [f]: M }));
922
948
  } catch (M) {
923
949
  se(M) || console.error("Explorer: section facets failed", M);
924
950
  }
925
951
  },
926
- [e, Y, y]
927
- ), k = w(b), W = w(D);
928
- k.current = b, W.current = D, U(() => {
952
+ [e, Z, T]
953
+ ), E = I(b), X = I(R);
954
+ E.current = b, X.current = R, Y(() => {
929
955
  var M;
930
- (M = ee.current) == null || M.abort();
931
- const m = new AbortController();
932
- return ee.current = m, g(!0), e.sections({ query: Y, globalFilters: {}, signal: m.signal }).then((E) => {
933
- if (m.signal.aborted) return;
934
- P(E);
956
+ (M = U.current) == null || M.abort();
957
+ const f = new AbortController();
958
+ return U.current = f, S(!0), e.sections({ query: Z, globalFilters: {}, signal: f.signal }).then((w) => {
959
+ if (f.signal.aborted) return;
960
+ m(w);
935
961
  const A = {};
936
- for (const $ of E) A[$.id] = !!$.defaultExpanded;
937
- q(A), v({}), L({}), I({});
938
- for (const $ of E)
939
- $.defaultExpanded && (W.current($.id), k.current($.id, 0, !1));
940
- }).catch((E) => {
941
- se(E) || console.error("Explorer: sections failed", E);
962
+ for (const $ of w) A[$.id] = !!$.defaultExpanded;
963
+ B(A), y({}), F({}), O({});
964
+ for (const $ of w)
965
+ $.defaultExpanded && (X.current($.id), E.current($.id, 0, !1));
966
+ }).catch((w) => {
967
+ se(w) || console.error("Explorer: sections failed", w);
942
968
  }).finally(() => {
943
- ee.current === m && g(!1);
944
- }), () => m.abort();
945
- }, [e, Y]);
946
- const Oe = S(
947
- (m) => {
948
- q((M) => {
949
- const E = !M[m];
950
- return E && !(m in f.current) && (D(m), b(m, 0, !1)), { ...M, [m]: E };
969
+ U.current === f && S(!1);
970
+ }), () => f.abort();
971
+ }, [e, Z]);
972
+ const qe = v(
973
+ (f) => {
974
+ B((M) => {
975
+ const w = !M[f];
976
+ return w && !(f in p.current) && (R(f), b(f, 0, !1)), { ...M, [f]: w };
951
977
  });
952
978
  },
953
- [D, b]
954
- ), Fe = S(
955
- (m, M, E) => {
956
- _((A) => {
957
- const $ = A[m] ?? {}, K = $[M] ?? [], F = K.includes(E) ? K.filter((ze) => ze !== E) : [...K, E], G = { ...$ };
958
- return F.length ? G[M] = F : delete G[M], { ...A, [m]: G };
959
- }), v((A) => ({ ...A, [m]: [] }));
979
+ [R, b]
980
+ ), _e = v(
981
+ (f, M, w) => {
982
+ G((A) => {
983
+ const $ = A[f] ?? {}, K = $[M] ?? [], q = K.includes(w) ? K.filter((Ae) => Ae !== w) : [...K, w], W = { ...$ };
984
+ return q.length ? W[M] = q : delete W[M], { ...A, [f]: W };
985
+ }), y((A) => ({ ...A, [f]: [] }));
960
986
  },
961
987
  []
962
988
  );
963
- U(() => {
964
- for (const m of Object.keys(y))
965
- N.current[m] && (D(m), b(m, 0, !1));
966
- }, [y, D, b]);
967
- const Le = !z && u.length === 0;
989
+ Y(() => {
990
+ for (const f of Object.keys(T))
991
+ N.current[f] && (R(f), b(f, 0, !1));
992
+ }, [T, R, b]);
993
+ const Be = !_ && g.length === 0;
968
994
  return /* @__PURE__ */ h("div", { className: H("flex h-full flex-col", s), "data-slot": "sectioned-explorer", children: [
969
995
  o && !i ? /* @__PURE__ */ a("div", { className: "border-b border-border/60 px-2 py-1.5", children: /* @__PURE__ */ a(
970
- ke,
996
+ Me,
971
997
  {
972
998
  "aria-label": "Search",
973
999
  placeholder: l,
974
- value: d,
975
- onChange: (m) => x(m.target.value),
1000
+ value: u,
1001
+ onChange: (f) => x(f.target.value),
976
1002
  className: "h-7 rounded-sm border-transparent bg-muted/40 px-2 text-[12.5px] shadow-none focus-visible:bg-background focus-visible:ring-1"
977
1003
  }
978
1004
  ) }) : null,
979
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "sectioned-explorer-list", children: Le ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center px-4 py-8 text-[12px] text-muted-foreground", children: n }) : /* @__PURE__ */ a("ul", { className: "flex flex-col py-1", children: u.map((m) => {
980
- const M = !!O[m.id], E = T[m.id] ?? [], A = Object.fromEntries(
981
- (m.filters ?? []).map((F) => [F.key, F.values ?? []])
982
- ), $ = B[m.id] ?? A, K = y[m.id] ?? {};
1005
+ /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto", "data-slot": "sectioned-explorer-list", children: Be ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center px-4 py-8 text-[12px] text-muted-foreground", children: n }) : /* @__PURE__ */ a("ul", { className: "flex flex-col py-1", children: g.map((f) => {
1006
+ const M = !!L[f.id], w = C[f.id] ?? [], A = Object.fromEntries(
1007
+ (f.filters ?? []).map((q) => [q.key, q.values ?? []])
1008
+ ), $ = D[f.id] ?? A, K = T[f.id] ?? {};
983
1009
  return /* @__PURE__ */ h("li", { children: [
984
1010
  /* @__PURE__ */ h(
985
1011
  "button",
986
1012
  {
987
1013
  type: "button",
988
1014
  "aria-expanded": M,
989
- onClick: () => Oe(m.id),
1015
+ onClick: () => qe(f.id),
990
1016
  className: H(
991
1017
  "group mx-1 flex w-[calc(100%-0.5rem)] items-center gap-1.5 rounded-md px-1.5 py-1 text-left",
992
1018
  "transition-colors duration-120 ease-[cubic-bezier(0.22,1,0.36,1)] hover:bg-muted/40"
993
1019
  ),
994
1020
  children: [
995
- M ? /* @__PURE__ */ a(Ce, { size: 11 }) : /* @__PURE__ */ a(Te, { size: 11 }),
996
- /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground", children: m.title }),
997
- /* @__PURE__ */ a("span", { className: "font-mono text-[10.5px] text-muted-foreground/80", children: (C[m.id] ?? m.count ?? 0).toLocaleString() })
1021
+ M ? /* @__PURE__ */ a(Ee, { size: 11 }) : /* @__PURE__ */ a(we, { size: 11 }),
1022
+ /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium text-foreground", children: f.title }),
1023
+ /* @__PURE__ */ a("span", { className: "font-mono text-[10.5px] text-muted-foreground/80", children: (P[f.id] ?? f.count ?? 0).toLocaleString() })
998
1024
  ]
999
1025
  }
1000
1026
  ),
1001
1027
  M ? /* @__PURE__ */ h("div", { children: [
1002
1028
  /* @__PURE__ */ a(
1003
- wt,
1029
+ It,
1004
1030
  {
1005
- configs: m.filters ?? [],
1031
+ configs: f.filters ?? [],
1006
1032
  facets: $,
1007
1033
  selected: K,
1008
- onToggle: (F, G) => Fe(m.id, F, G)
1034
+ onToggle: (q, W) => _e(f.id, q, W)
1009
1035
  }
1010
1036
  ),
1011
1037
  /* @__PURE__ */ h("ul", { className: "flex flex-col", children: [
1012
- E.map((F) => /* @__PURE__ */ a(
1038
+ w.map((q) => /* @__PURE__ */ a(
1013
1039
  Mt,
1014
1040
  {
1015
- row: F,
1041
+ row: q,
1016
1042
  indent: !0,
1017
1043
  onActivate: t,
1018
1044
  getDragPayload: r
1019
1045
  },
1020
- F.id
1046
+ q.id
1021
1047
  )),
1022
- R[m.id] && E.length === 0 ? /* @__PURE__ */ a("li", { className: "py-1.5 pl-7 pr-3 text-[11px] text-muted-foreground/80", children: "Loading…" }) : null,
1023
- j[m.id] ? /* @__PURE__ */ a("li", { className: "py-1 pl-7 pr-3", children: /* @__PURE__ */ a(
1048
+ z[f.id] && w.length === 0 ? /* @__PURE__ */ a("li", { className: "py-1.5 pl-7 pr-3 text-[11px] text-muted-foreground/80", children: "Loading…" }) : null,
1049
+ j[f.id] ? /* @__PURE__ */ a("li", { className: "py-1 pl-7 pr-3", children: /* @__PURE__ */ a(
1024
1050
  "button",
1025
1051
  {
1026
1052
  type: "button",
1027
- onClick: () => b(m.id, E.length, !0),
1028
- disabled: R[m.id],
1053
+ onClick: () => b(f.id, w.length, !0),
1054
+ disabled: z[f.id],
1029
1055
  className: "text-[11px] text-muted-foreground hover:text-foreground disabled:opacity-60",
1030
- children: R[m.id] ? "Loading…" : "Load more"
1056
+ children: z[f.id] ? "Loading…" : "Load more"
1031
1057
  }
1032
1058
  ) }) : null
1033
1059
  ] })
1034
1060
  ] }) : null
1035
- ] }, m.id);
1061
+ ] }, f.id);
1036
1062
  }) }) })
1037
1063
  ] });
1038
1064
  }
1039
- function wt({
1065
+ function It({
1040
1066
  configs: e,
1041
1067
  facets: t,
1042
1068
  selected: r,
@@ -1044,24 +1070,24 @@ function wt({
1044
1070
  }) {
1045
1071
  return e.length ? /* @__PURE__ */ a("div", { className: "space-y-1 px-7 py-1", children: e.map((l) => {
1046
1072
  const o = t[l.key] ?? l.values ?? [];
1047
- return o.length ? /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: o.map((p) => {
1073
+ return o.length ? /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-1", children: o.map((d) => {
1048
1074
  var i;
1049
- const c = ((i = r[l.key]) == null ? void 0 : i.includes(p.value)) ?? !1, s = l.formatValue ? l.formatValue(p.value) : p.value;
1075
+ const c = ((i = r[l.key]) == null ? void 0 : i.includes(d.value)) ?? !1, s = l.formatValue ? l.formatValue(d.value) : d.value;
1050
1076
  return /* @__PURE__ */ h(
1051
1077
  "button",
1052
1078
  {
1053
1079
  type: "button",
1054
- onClick: () => n(l.key, p.value),
1080
+ onClick: () => n(l.key, d.value),
1055
1081
  className: H(
1056
1082
  "rounded border px-1.5 py-0.5 text-[10.5px] transition-colors",
1057
1083
  c ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/70 text-muted-foreground hover:text-foreground"
1058
1084
  ),
1059
1085
  children: [
1060
1086
  s,
1061
- /* @__PURE__ */ a("span", { className: "ml-1 font-mono opacity-70", children: p.count })
1087
+ /* @__PURE__ */ a("span", { className: "ml-1 font-mono opacity-70", children: d.count })
1062
1088
  ]
1063
1089
  },
1064
- p.value
1090
+ d.value
1065
1091
  );
1066
1092
  }) }, l.key) : null;
1067
1093
  }) }) : null;
@@ -1091,18 +1117,18 @@ function Mt({
1091
1117
  ),
1092
1118
  title: e.title,
1093
1119
  children: [
1094
- e.leading ? /* @__PURE__ */ a(ye, { badge: e.leading }) : null,
1120
+ e.leading ? /* @__PURE__ */ a(Se, { badge: e.leading }) : null,
1095
1121
  /* @__PURE__ */ h("span", { className: "flex min-w-0 flex-1 flex-col", children: [
1096
1122
  /* @__PURE__ */ a("span", { className: "truncate text-[12.5px] font-medium leading-tight text-foreground", children: e.title }),
1097
1123
  e.subtitle ? /* @__PURE__ */ a("span", { className: "truncate text-[11.5px] leading-snug text-muted-foreground/85", children: e.subtitle }) : null
1098
1124
  ] }),
1099
- (s = e.trailing) != null && s.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((i, d) => /* @__PURE__ */ a(ye, { badge: i }, d)) }) : null,
1125
+ (s = e.trailing) != null && s.length ? /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center gap-1", children: e.trailing.map((i, u) => /* @__PURE__ */ a(Se, { badge: i }, u)) }) : null,
1100
1126
  e.meta ? /* @__PURE__ */ a("span", { className: "shrink-0 self-center font-mono text-[10.5px] text-muted-foreground/80", children: e.meta }) : null
1101
1127
  ]
1102
1128
  }
1103
1129
  );
1104
1130
  }
1105
- function ye({ badge: e }) {
1131
+ function Se({ badge: e }) {
1106
1132
  return /* @__PURE__ */ a(
1107
1133
  "span",
1108
1134
  {
@@ -1113,21 +1139,21 @@ function ye({ badge: e }) {
1113
1139
  }
1114
1140
  );
1115
1141
  }
1116
- const ue = "data-catalog", or = "query_data_catalog", de = "data-catalog.open-row";
1142
+ const ue = "data-catalog", sr = "query_data_catalog", de = "data-catalog.open-row";
1117
1143
  function Dt(e) {
1118
1144
  let t = 2166136261;
1119
1145
  for (let r = 0; r < e.length; r++)
1120
1146
  t ^= e.charCodeAt(r), t = Math.imul(t, 16777619);
1121
1147
  return (t >>> 0).toString(36);
1122
1148
  }
1123
- function be(e) {
1149
+ function Ce(e) {
1124
1150
  return e.trim().replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 32) || "row";
1125
1151
  }
1126
- function It(e, t = "data") {
1127
- const r = Dt(e), n = be(e), l = be(t), o = `${n}-${r}`, p = Math.max(0, 64 - o.length - 1), c = l.slice(0, p);
1152
+ function Rt(e, t = "data") {
1153
+ const r = Dt(e), n = Ce(e), l = Ce(t), o = `${n}-${r}`, d = Math.max(0, 64 - o.length - 1), c = l.slice(0, d);
1128
1154
  return c ? `${c}-${o}` : o.slice(0, 64);
1129
1155
  }
1130
- function De(e, t) {
1156
+ function Fe(e, t) {
1131
1157
  const r = {
1132
1158
  ...t.params ?? {},
1133
1159
  // Keep routing keys authoritative even when callers pass extra params.
@@ -1135,7 +1161,7 @@ function De(e, t) {
1135
1161
  catalogId: t.catalogId,
1136
1162
  ...t.title ? { title: t.title } : {}
1137
1163
  };
1138
- Be({
1164
+ Ve({
1139
1165
  kind: "openSurface",
1140
1166
  params: {
1141
1167
  kind: t.surfaceKind ?? de,
@@ -1144,65 +1170,65 @@ function De(e, t) {
1144
1170
  }
1145
1171
  });
1146
1172
  }
1147
- function Rt(e) {
1148
- return (t) => De(t, e);
1149
- }
1150
1173
  function Ot(e) {
1174
+ return (t) => Fe(t, e);
1175
+ }
1176
+ function Ft(e) {
1151
1177
  if (!e || typeof e != "object") return !1;
1152
1178
  const t = e;
1153
1179
  return typeof t.id == "string" && typeof t.title == "string";
1154
1180
  }
1155
- function ve(e, t) {
1181
+ function Te(e, t) {
1156
1182
  const r = e[t];
1157
1183
  return typeof r == "string" && r.length > 0 ? r : void 0;
1158
1184
  }
1159
- function Ft(e) {
1185
+ function Lt(e) {
1160
1186
  const t = e.surfaceKind ?? de, r = e.panelIdPrefix ?? e.id;
1161
1187
  return {
1162
1188
  id: e.surfaceResolverId ?? `${e.id}-row`,
1163
1189
  source: e.source,
1164
1190
  resolve(n) {
1165
1191
  if (n.kind !== t) return;
1166
- const l = n.meta ?? {}, o = ve(l, "catalogId");
1192
+ const l = n.meta ?? {}, o = Te(l, "catalogId");
1167
1193
  if (o && o !== e.catalogId) return;
1168
- const p = Ot(l.row) ? l.row : void 0, {
1194
+ const d = Ft(l.row) ? l.row : void 0, {
1169
1195
  catalogId: c,
1170
1196
  row: s,
1171
1197
  title: i,
1172
- ...d
1198
+ ...u
1173
1199
  } = l;
1174
1200
  return {
1175
- id: It(n.target, r),
1201
+ id: Rt(n.target, r),
1176
1202
  component: e.visualizationPanelId,
1177
- title: ve(l, "title") ?? (p == null ? void 0 : p.title) ?? e.visualizationTitle,
1203
+ title: Te(l, "title") ?? (d == null ? void 0 : d.title) ?? e.visualizationTitle,
1178
1204
  params: {
1179
- ...d,
1180
- ...p ? { row: p } : { query: n.target }
1205
+ ...u,
1206
+ ...d ? { row: d } : { query: n.target }
1181
1207
  },
1182
1208
  score: 0
1183
1209
  };
1184
1210
  }
1185
1211
  };
1186
1212
  }
1187
- function Lt(e) {
1213
+ function zt(e) {
1188
1214
  if (!e || typeof e != "object") return;
1189
1215
  const t = e;
1190
1216
  if (!(typeof t.id != "string" || typeof t.title != "string"))
1191
1217
  return t;
1192
1218
  }
1193
- function Ie(e) {
1219
+ function Le(e) {
1194
1220
  if (e) {
1195
1221
  if ("searchQuery" in e && typeof e.searchQuery == "string")
1196
1222
  return e.searchQuery;
1197
1223
  if ("query" in e && typeof e.query == "string") return e.query;
1198
1224
  }
1199
1225
  }
1200
- function zt(e) {
1201
- const t = Ie(e);
1226
+ function qt(e) {
1227
+ const t = Le(e);
1202
1228
  return { query: t, controlled: t !== void 0 };
1203
1229
  }
1204
- function qt(e, t) {
1205
- const r = Lt(e == null ? void 0 : e.row), n = Ie(e) ?? (r == null ? void 0 : r.id);
1230
+ function _t(e, t) {
1231
+ const r = zt(e == null ? void 0 : e.row), n = Le(e) ?? (r == null ? void 0 : r.id);
1206
1232
  return {
1207
1233
  row: r,
1208
1234
  query: n,
@@ -1210,68 +1236,68 @@ function qt(e, t) {
1210
1236
  title: (r == null ? void 0 : r.title) ?? t
1211
1237
  };
1212
1238
  }
1213
- function _t(e) {
1214
- return Z(() => zt(e), [e]);
1239
+ function Bt(e) {
1240
+ return ee(() => qt(e), [e]);
1215
1241
  }
1216
- function Bt(e, t) {
1217
- return Z(
1218
- () => qt(e, t),
1242
+ function At(e, t) {
1243
+ return ee(
1244
+ () => _t(e, t),
1219
1245
  [t, e]
1220
1246
  );
1221
1247
  }
1222
- function sr(e) {
1248
+ function cr(e) {
1223
1249
  const { catalogId: t, surfaceKind: r, title: n, params: l } = e;
1224
- return S(
1225
- (o) => De(o, { catalogId: t, surfaceKind: r, title: n, params: l }),
1250
+ return v(
1251
+ (o) => Fe(o, { catalogId: t, surfaceKind: r, title: n, params: l }),
1226
1252
  [t, r, n, l]
1227
1253
  );
1228
1254
  }
1229
- function Re(e) {
1230
- const t = e.id ?? ue, r = e.label ?? "Data", n = e.catalogId ?? t, l = e.catalogLabel ?? r, o = e.leftTabId ?? `${t}-tab`, p = e.leftTabTitle ?? r, c = e.visualizationPanelId ?? `${t}-visualization`, s = e.visualizationTitle ?? `${r} View`, i = e.surfaceKind ?? de, d = e.source ?? "app", x = e.includeVisualizationPanel ?? !0, u = e.includeLeftTab ?? !0, P = e.includeCatalog ?? !0, T = e.includeSurfaceResolver ?? (x && !e.onSelect), v = e.emptyState ?? "No data found", C = e.searchPlaceholder ?? `Search ${r.toLowerCase()}...`, I = e.onSelect ?? (x ? Rt({
1255
+ function ze(e) {
1256
+ const t = e.id ?? ue, r = e.label ?? "Data", n = e.catalogId ?? t, l = e.catalogLabel ?? r, o = e.leftTabId ?? `${t}-tab`, d = e.leftTabTitle ?? r, c = e.visualizationPanelId ?? `${t}-visualization`, s = e.visualizationTitle ?? `${r} View`, i = e.surfaceKind ?? de, u = e.source ?? "app", x = e.includeVisualizationPanel ?? !0, g = e.includeLeftTab ?? !0, m = e.includeCatalog ?? !0, C = e.includeSurfaceResolver ?? (x && !e.onSelect), y = e.emptyState ?? "No data found", P = e.searchPlaceholder ?? `Search ${r.toLowerCase()}...`, O = e.onSelect ?? (x ? Ot({
1231
1257
  catalogId: n,
1232
1258
  surfaceKind: i
1233
1259
  }) : () => {
1234
1260
  });
1235
- function j({ params: g, className: R }) {
1236
- const { query: Q, controlled: O } = _t(g), q = g == null ? void 0 : g.bridge, y = (_) => I(_, { params: g, bridge: q });
1261
+ function j({ params: S, className: z }) {
1262
+ const { query: k, controlled: L } = Bt(S), B = S == null ? void 0 : S.bridge, T = (G) => O(G, { params: S, bridge: B });
1237
1263
  return /* @__PURE__ */ a(
1238
1264
  ie,
1239
1265
  {
1240
1266
  adapter: e.adapter,
1241
1267
  facets: e.facets,
1242
1268
  groupBy: e.groupBy,
1243
- onActivate: y,
1269
+ onActivate: T,
1244
1270
  getDragPayload: e.getDragPayload,
1245
- emptyState: v,
1246
- searchPlaceholder: C,
1247
- query: O ? Q : void 0,
1248
- searchable: !O,
1271
+ emptyState: y,
1272
+ searchPlaceholder: P,
1273
+ query: L ? k : void 0,
1274
+ searchable: !L,
1249
1275
  pageSize: e.pageSize,
1250
1276
  debounceMs: e.debounceMs,
1251
- className: R ?? "h-full"
1277
+ className: z ?? "h-full"
1252
1278
  }
1253
1279
  );
1254
1280
  }
1255
- function L({
1256
- params: g,
1257
- api: R,
1258
- className: Q
1281
+ function F({
1282
+ params: S,
1283
+ api: z,
1284
+ className: k
1259
1285
  }) {
1260
- const { row: O, query: q, controlled: y, title: _ } = Bt(
1261
- g,
1286
+ const { row: L, query: B, controlled: T, title: G } = At(
1287
+ S,
1262
1288
  s
1263
- ), B = (X) => I(X, {});
1289
+ ), D = (Q) => O(Q, {});
1264
1290
  return /* @__PURE__ */ h(
1265
- Ae,
1291
+ je,
1266
1292
  {
1267
- title: _,
1268
- icon: e.visualizationIcon ?? pe,
1269
- panelApi: R,
1270
- className: Q,
1293
+ title: G,
1294
+ icon: e.visualizationIcon ?? fe,
1295
+ panelApi: z,
1296
+ className: k,
1271
1297
  children: [
1272
- O ? /* @__PURE__ */ h("div", { className: "border-b border-border/60 px-3 py-2", children: [
1273
- /* @__PURE__ */ a("div", { className: "truncate text-sm font-medium text-foreground", children: O.title }),
1274
- /* @__PURE__ */ a("div", { className: "truncate text-xs text-muted-foreground", children: O.subtitle ?? O.id })
1298
+ L ? /* @__PURE__ */ h("div", { className: "border-b border-border/60 px-3 py-2", children: [
1299
+ /* @__PURE__ */ a("div", { className: "truncate text-sm font-medium text-foreground", children: L.title }),
1300
+ /* @__PURE__ */ a("div", { className: "truncate text-xs text-muted-foreground", children: L.subtitle ?? L.id })
1275
1301
  ] }) : null,
1276
1302
  /* @__PURE__ */ a(
1277
1303
  ie,
@@ -1279,12 +1305,12 @@ function Re(e) {
1279
1305
  adapter: e.adapter,
1280
1306
  facets: e.facets,
1281
1307
  groupBy: e.groupBy,
1282
- onActivate: B,
1308
+ onActivate: D,
1283
1309
  getDragPayload: e.getDragPayload,
1284
- emptyState: v,
1285
- searchPlaceholder: C,
1286
- query: y ? q : void 0,
1287
- searchable: !y,
1310
+ emptyState: y,
1311
+ searchPlaceholder: P,
1312
+ query: T ? B : void 0,
1313
+ searchable: !T,
1288
1314
  pageSize: e.pageSize,
1289
1315
  debounceMs: e.debounceMs,
1290
1316
  className: "h-full"
@@ -1294,41 +1320,41 @@ function Re(e) {
1294
1320
  }
1295
1321
  );
1296
1322
  }
1297
- const z = [];
1298
- if (u && z.push({
1323
+ const _ = [];
1324
+ if (g && _.push({
1299
1325
  type: "left-tab",
1300
1326
  id: o,
1301
- title: p,
1302
- icon: e.leftTabIcon ?? Je,
1327
+ title: d,
1328
+ icon: e.leftTabIcon ?? tt,
1303
1329
  component: j,
1304
- source: d,
1330
+ source: u,
1305
1331
  chromeless: !0
1306
1332
  }), x) {
1307
- const g = we({
1333
+ const S = Re({
1308
1334
  id: c,
1309
1335
  title: s,
1310
- icon: e.visualizationIcon ?? pe,
1311
- component: e.visualizationComponent ?? L,
1336
+ icon: e.visualizationIcon ?? fe,
1337
+ component: e.visualizationComponent ?? F,
1312
1338
  placement: "center",
1313
- source: d
1339
+ source: u
1314
1340
  });
1315
- z.push({
1341
+ _.push({
1316
1342
  type: "panel",
1317
- panel: g
1343
+ panel: S
1318
1344
  });
1319
1345
  }
1320
- if (P) {
1321
- const g = {
1346
+ if (m) {
1347
+ const S = {
1322
1348
  id: n,
1323
1349
  label: l,
1324
1350
  adapter: e.adapter,
1325
- onSelect: (R) => I(R, {})
1351
+ onSelect: (z) => O(z, {})
1326
1352
  };
1327
- z.push({ type: "catalog", catalog: g });
1353
+ _.push({ type: "catalog", catalog: S });
1328
1354
  }
1329
- return T && z.push({
1355
+ return C && _.push({
1330
1356
  type: "surface-resolver",
1331
- resolver: Ft({
1357
+ resolver: Lt({
1332
1358
  id: t,
1333
1359
  catalogId: n,
1334
1360
  visualizationPanelId: c,
@@ -1336,25 +1362,25 @@ function Re(e) {
1336
1362
  panelIdPrefix: t,
1337
1363
  surfaceKind: i,
1338
1364
  surfaceResolverId: e.surfaceResolverId,
1339
- source: d
1365
+ source: u
1340
1366
  })
1341
- }), z;
1367
+ }), _;
1342
1368
  }
1343
- function cr(e) {
1369
+ function ir(e) {
1344
1370
  const t = e.pluginId ?? e.id ?? ue;
1345
1371
  return ae({
1346
1372
  id: t,
1347
1373
  label: e.label ?? "Data Catalog",
1348
- outputs: Re(e)
1374
+ outputs: ze(e)
1349
1375
  });
1350
1376
  }
1351
- function ir(e, t) {
1377
+ function ur(e, t) {
1352
1378
  return ae({
1353
1379
  ...e,
1354
- outputs: [...e.outputs ?? [], ...Re(t)]
1380
+ outputs: [...e.outputs ?? [], ...ze(t)]
1355
1381
  });
1356
1382
  }
1357
- function ur(e) {
1383
+ function dr(e) {
1358
1384
  return {
1359
1385
  id: e.catalogId ?? e.id ?? ue,
1360
1386
  label: e.catalogLabel ?? e.label ?? "Data",
@@ -1365,64 +1391,64 @@ function ur(e) {
1365
1391
  }
1366
1392
  };
1367
1393
  }
1368
- const At = 768, $t = 1024;
1369
- function Kt(e) {
1394
+ const $t = 768, Kt = 1024;
1395
+ function Vt(e) {
1370
1396
  return {
1371
1397
  ...e,
1372
1398
  groups: e.groups.filter((t) => t.id !== "sidebar")
1373
1399
  };
1374
1400
  }
1375
- function Vt({
1401
+ function jt({
1376
1402
  layout: e,
1377
1403
  className: t
1378
1404
  }) {
1379
- var q;
1380
- const r = Ne(), n = $e(), l = Ke(), o = ge(At), p = ge($t), c = p && !o, s = Z(
1381
- () => e.groups.find((y) => y.id === "sidebar" && y.panel),
1405
+ var B;
1406
+ const r = ke(), n = Ge(), l = Qe(), o = be($t), d = be(Kt), c = d && !o, s = ee(
1407
+ () => e.groups.find((T) => T.id === "sidebar" && T.panel),
1382
1408
  [e]
1383
- ), i = s == null ? void 0 : s.panel, d = !!i, x = ht({
1384
- isNarrowViewport: d && p,
1409
+ ), i = s == null ? void 0 : s.panel, u = !!i, x = xt({
1410
+ isNarrowViewport: u && d,
1385
1411
  isCollapsed: n.collapsed,
1386
- setCollapsed: (y) => l({ collapsed: y })
1387
- }), [u, P] = V(!1);
1388
- U(() => {
1389
- (!d || !o && !c) && P(!1);
1390
- }, [d, o, c]);
1391
- const T = d && (o || c && n.collapsed), v = d && !o && (!c || !n.collapsed), C = Z(
1392
- () => v ? e : Kt(e),
1393
- [v, e]
1394
- ), I = Z(() => {
1395
- const y = v ? "inline-sidebar" : "overlay-sidebar", _ = C.groups.map((B) => {
1396
- let X = "";
1412
+ setCollapsed: (T) => l({ collapsed: T })
1413
+ }), [g, m] = V(!1);
1414
+ Y(() => {
1415
+ (!u || !o && !c) && m(!1);
1416
+ }, [u, o, c]);
1417
+ const C = u && (o || c && n.collapsed), y = u && !o && (!c || !n.collapsed), P = ee(
1418
+ () => y ? e : Vt(e),
1419
+ [y, e]
1420
+ ), O = ee(() => {
1421
+ const T = y ? "inline-sidebar" : "overlay-sidebar", G = P.groups.map((D) => {
1422
+ let Q = "";
1397
1423
  try {
1398
- X = JSON.stringify(B.params ?? null);
1424
+ Q = JSON.stringify(D.params ?? null);
1399
1425
  } catch {
1400
- X = "unserializable";
1426
+ Q = "unserializable";
1401
1427
  }
1402
- return `${B.id}:${B.panel ?? ""}:${X}`;
1428
+ return `${D.id}:${D.panel ?? ""}:${Q}`;
1403
1429
  }).join(",");
1404
- return `${C.version}:${y}:${_}`;
1405
- }, [C, v]), j = Z(() => r.getComponents(), [r]), L = i ? j[i] : null, z = i ? ((q = r.get(i)) == null ? void 0 : q.title) ?? "Sidebar" : "Sidebar", g = S(() => {
1406
- P(!0);
1407
- }, []), R = S(() => {
1408
- x(), l({ collapsed: !1 }), P(!1);
1409
- }, [x, l]), Q = S(() => {
1410
- x(), l({ collapsed: !0 }), P(!1);
1411
- }, [x, l]), O = S(
1412
- (y) => {
1413
- y.target.closest("[role='treeitem']") && P(!1);
1430
+ return `${P.version}:${T}:${G}`;
1431
+ }, [P, y]), j = ee(() => r.getComponents(), [r]), F = i ? j[i] : null, _ = i ? ((B = r.get(i)) == null ? void 0 : B.title) ?? "Sidebar" : "Sidebar", S = v(() => {
1432
+ m(!0);
1433
+ }, []), z = v(() => {
1434
+ x(), l({ collapsed: !1 }), m(!1);
1435
+ }, [x, l]), k = v(() => {
1436
+ x(), l({ collapsed: !0 }), m(!1);
1437
+ }, [x, l]), L = v(
1438
+ (T) => {
1439
+ T.target.closest("[role='treeitem']") && m(!1);
1414
1440
  },
1415
1441
  []
1416
1442
  );
1417
1443
  return /* @__PURE__ */ h("div", { className: "relative h-full w-full", children: [
1418
- c && d && n.collapsed && /* @__PURE__ */ a(
1444
+ c && u && n.collapsed && /* @__PURE__ */ a(
1419
1445
  "div",
1420
1446
  {
1421
1447
  className: "pointer-events-none absolute inset-y-0 left-0 z-20 w-10 border-r border-border bg-background/95",
1422
1448
  "aria-hidden": "true"
1423
1449
  }
1424
1450
  ),
1425
- T && /* @__PURE__ */ a(
1451
+ C && /* @__PURE__ */ a(
1426
1452
  "div",
1427
1453
  {
1428
1454
  className: H(
@@ -1435,45 +1461,45 @@ function Vt({
1435
1461
  type: "button",
1436
1462
  variant: "outline",
1437
1463
  size: "icon-sm",
1438
- onClick: g,
1464
+ onClick: S,
1439
1465
  "aria-label": o ? "Open sidebar menu" : "Open collapsed sidebar",
1440
- children: o ? /* @__PURE__ */ a(Ye, { className: "h-4 w-4" }) : /* @__PURE__ */ a(Ze, { className: "h-4 w-4" })
1466
+ children: o ? /* @__PURE__ */ a(rt, { className: "h-4 w-4" }) : /* @__PURE__ */ a(at, { className: "h-4 w-4" })
1441
1467
  }
1442
1468
  )
1443
1469
  }
1444
1470
  ),
1445
- c && d && !n.collapsed && /* @__PURE__ */ a("div", { className: "absolute left-2 top-2 z-30", children: /* @__PURE__ */ a(
1471
+ c && u && !n.collapsed && /* @__PURE__ */ a("div", { className: "absolute left-2 top-2 z-30", children: /* @__PURE__ */ a(
1446
1472
  J,
1447
1473
  {
1448
1474
  type: "button",
1449
1475
  variant: "outline",
1450
1476
  size: "icon-sm",
1451
- onClick: Q,
1477
+ onClick: k,
1452
1478
  "aria-label": "Collapse sidebar",
1453
- children: /* @__PURE__ */ a(et, { className: "h-4 w-4" })
1479
+ children: /* @__PURE__ */ a(nt, { className: "h-4 w-4" })
1454
1480
  }
1455
1481
  ) }),
1456
1482
  /* @__PURE__ */ a(
1457
- Ve,
1483
+ He,
1458
1484
  {
1459
- layout: C,
1485
+ layout: P,
1460
1486
  className: H(
1461
1487
  t,
1462
- c && d && n.collapsed && "pl-10"
1488
+ c && u && n.collapsed && "pl-10"
1463
1489
  )
1464
1490
  },
1465
- I
1491
+ O
1466
1492
  ),
1467
- T && /* @__PURE__ */ a(it, { open: u, onOpenChange: P, children: /* @__PURE__ */ h(
1468
- ut,
1493
+ C && /* @__PURE__ */ a(ut, { open: g, onOpenChange: m, children: /* @__PURE__ */ h(
1494
+ dt,
1469
1495
  {
1470
1496
  side: "left",
1471
1497
  className: "w-[85vw] max-w-sm p-0",
1472
1498
  children: [
1473
- /* @__PURE__ */ h(dt, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
1499
+ /* @__PURE__ */ h(pt, { className: "flex flex-row items-center justify-between border-b border-border px-4 py-3", children: [
1474
1500
  /* @__PURE__ */ h("div", { children: [
1475
- /* @__PURE__ */ a(pt, { children: z }),
1476
- /* @__PURE__ */ a(ft, { className: "sr-only", children: "Responsive sidebar panel" })
1501
+ /* @__PURE__ */ a(ft, { children: _ }),
1502
+ /* @__PURE__ */ a(mt, { className: "sr-only", children: "Responsive sidebar panel" })
1477
1503
  ] }),
1478
1504
  c && /* @__PURE__ */ h(
1479
1505
  J,
@@ -1481,10 +1507,10 @@ function Vt({
1481
1507
  type: "button",
1482
1508
  variant: "outline",
1483
1509
  size: "sm",
1484
- onClick: R,
1510
+ onClick: z,
1485
1511
  "aria-label": "Pin sidebar open",
1486
1512
  children: [
1487
- /* @__PURE__ */ a(tt, { className: "h-4 w-4" }),
1513
+ /* @__PURE__ */ a(lt, { className: "h-4 w-4" }),
1488
1514
  "Pin"
1489
1515
  ]
1490
1516
  }
@@ -1494,8 +1520,8 @@ function Vt({
1494
1520
  "div",
1495
1521
  {
1496
1522
  className: "h-full min-h-0 overflow-auto",
1497
- onClickCapture: O,
1498
- children: L ? /* @__PURE__ */ a(He, { fallback: /* @__PURE__ */ a(Se, {}), children: /* @__PURE__ */ a(L, {}) }) : /* @__PURE__ */ a(Se, {})
1523
+ onClickCapture: L,
1524
+ children: F ? /* @__PURE__ */ a(Je, { fallback: /* @__PURE__ */ a(Pe, {}), children: /* @__PURE__ */ a(F, {}) }) : /* @__PURE__ */ a(Pe, {})
1499
1525
  }
1500
1526
  )
1501
1527
  ]
@@ -1503,10 +1529,10 @@ function Vt({
1503
1529
  ) })
1504
1530
  ] });
1505
1531
  }
1506
- function Se() {
1532
+ function Pe() {
1507
1533
  return /* @__PURE__ */ a("div", { className: "flex h-full min-h-[240px] items-center justify-center text-sm text-muted-foreground", children: "Loading sidebar..." });
1508
1534
  }
1509
- function Qt(e = {}) {
1535
+ function Gt(e = {}) {
1510
1536
  const { sidebar: t = "filetree", center: r = "empty", right: n } = e, l = [
1511
1537
  {
1512
1538
  id: "sidebar",
@@ -1534,12 +1560,12 @@ function Qt(e = {}) {
1534
1560
  constraints: { minWidth: 250 }
1535
1561
  }), { version: "2.0", groups: l };
1536
1562
  }
1537
- function dr(e) {
1538
- return /* @__PURE__ */ a(Vt, { layout: Qt(e), className: e.className });
1563
+ function pr(e) {
1564
+ return /* @__PURE__ */ a(jt, { layout: Gt(e), className: e.className });
1539
1565
  }
1540
- function pr({ className: e, onOpenFile: t }) {
1566
+ function fr({ className: e, onOpenFile: t }) {
1541
1567
  return /* @__PURE__ */ a(
1542
- Pe,
1568
+ Ie,
1543
1569
  {
1544
1570
  className: H("h-full border-0 text-muted-foreground", e),
1545
1571
  title: "No file open",
@@ -1562,7 +1588,7 @@ function pr({ className: e, onOpenFile: t }) {
1562
1588
  }
1563
1589
  );
1564
1590
  }
1565
- class fr extends We {
1591
+ class mr extends Ye {
1566
1592
  constructor() {
1567
1593
  super(...arguments);
1568
1594
  ne(this, "state", { hasError: !1, error: null });
@@ -1584,11 +1610,11 @@ class fr extends We {
1584
1610
  render() {
1585
1611
  var r;
1586
1612
  return this.state.hasError ? /* @__PURE__ */ a("div", { className: "flex h-full items-center justify-center p-6", children: /* @__PURE__ */ a(
1587
- mt,
1613
+ gt,
1588
1614
  {
1589
1615
  className: "w-full max-w-md",
1590
1616
  title: "Something went wrong",
1591
- description: /* @__PURE__ */ h(Qe, { children: [
1617
+ description: /* @__PURE__ */ h(We, { children: [
1592
1618
  "Panel ",
1593
1619
  /* @__PURE__ */ a("code", { className: "rounded bg-muted px-1 py-0.5 text-xs", children: this.props.panelId }),
1594
1620
  " ",
@@ -1600,7 +1626,7 @@ class fr extends We {
1600
1626
  ) }) : this.props.children;
1601
1627
  }
1602
1628
  }
1603
- function mr({
1629
+ function gr({
1604
1630
  sessions: e,
1605
1631
  activeId: t,
1606
1632
  onSwitch: r,
@@ -1608,42 +1634,42 @@ function mr({
1608
1634
  onDelete: l,
1609
1635
  className: o
1610
1636
  }) {
1611
- const [p, c] = V(null), s = w({}), i = Z(() => e.map((u) => u.id), [e]);
1612
- U(() => {
1637
+ const [d, c] = V(null), s = I({}), i = ee(() => e.map((g) => g.id), [e]);
1638
+ Y(() => {
1613
1639
  if (i.length === 0) {
1614
1640
  c(null);
1615
1641
  return;
1616
1642
  }
1617
- c((u) => u && i.includes(u) ? u : t && i.includes(t) ? t : i[0] ?? null);
1643
+ c((g) => g && i.includes(g) ? g : t && i.includes(t) ? t : i[0] ?? null);
1618
1644
  }, [i, t]);
1619
- const d = S((u) => {
1620
- var P;
1621
- c(u), (P = s.current[u]) == null || P.focus();
1622
- }, []), x = S(
1623
- (u, P) => {
1624
- if (u.target !== u.currentTarget) return;
1625
- if (u.key === "Enter" || u.key === " ") {
1626
- u.preventDefault(), r == null || r(P);
1645
+ const u = v((g) => {
1646
+ var m;
1647
+ c(g), (m = s.current[g]) == null || m.focus();
1648
+ }, []), x = v(
1649
+ (g, m) => {
1650
+ if (g.target !== g.currentTarget) return;
1651
+ if (g.key === "Enter" || g.key === " ") {
1652
+ g.preventDefault(), r == null || r(m);
1627
1653
  return;
1628
1654
  }
1629
- const T = i.indexOf(P);
1630
- if (T < 0) return;
1631
- let v = T;
1632
- if (u.key === "ArrowDown")
1633
- v = Math.min(T + 1, i.length - 1);
1634
- else if (u.key === "ArrowUp")
1635
- v = Math.max(T - 1, 0);
1636
- else if (u.key === "Home")
1637
- v = 0;
1638
- else if (u.key === "End")
1639
- v = i.length - 1;
1655
+ const C = i.indexOf(m);
1656
+ if (C < 0) return;
1657
+ let y = C;
1658
+ if (g.key === "ArrowDown")
1659
+ y = Math.min(C + 1, i.length - 1);
1660
+ else if (g.key === "ArrowUp")
1661
+ y = Math.max(C - 1, 0);
1662
+ else if (g.key === "Home")
1663
+ y = 0;
1664
+ else if (g.key === "End")
1665
+ y = i.length - 1;
1640
1666
  else
1641
1667
  return;
1642
- u.preventDefault();
1643
- const C = i[v];
1644
- C && d(C);
1668
+ g.preventDefault();
1669
+ const P = i[y];
1670
+ P && u(P);
1645
1671
  },
1646
- [d, r, i]
1672
+ [u, r, i]
1647
1673
  );
1648
1674
  return /* @__PURE__ */ h(
1649
1675
  "div",
@@ -1655,7 +1681,7 @@ function mr({
1655
1681
  children: [
1656
1682
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [
1657
1683
  /* @__PURE__ */ a("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Sessions" }),
1658
- n && /* @__PURE__ */ a(Ee, { type: "button", variant: "ghost", size: "icon-xs", onClick: n, "aria-label": "New session", children: /* @__PURE__ */ a(
1684
+ n && /* @__PURE__ */ a(De, { type: "button", variant: "ghost", size: "icon-xs", onClick: n, "aria-label": "New session", children: /* @__PURE__ */ a(
1659
1685
  "svg",
1660
1686
  {
1661
1687
  width: "16",
@@ -1671,35 +1697,35 @@ function mr({
1671
1697
  ] }),
1672
1698
  /* @__PURE__ */ h("div", { className: "flex-1 overflow-y-auto", role: "list", "aria-label": "Session list", children: [
1673
1699
  e.length === 0 && /* @__PURE__ */ a("div", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: "No sessions" }),
1674
- e.map((u) => /* @__PURE__ */ a(
1675
- jt,
1700
+ e.map((g) => /* @__PURE__ */ a(
1701
+ Qt,
1676
1702
  {
1677
- session: u,
1678
- isActive: u.id === t,
1679
- isFocused: u.id === p,
1703
+ session: g,
1704
+ isActive: g.id === t,
1705
+ isFocused: g.id === d,
1680
1706
  onSwitch: r,
1681
1707
  onDelete: l,
1682
- onFocus: () => c(u.id),
1708
+ onFocus: () => c(g.id),
1683
1709
  onKeyDown: x,
1684
- rowRef: (P) => {
1685
- s.current[u.id] = P;
1710
+ rowRef: (m) => {
1711
+ s.current[g.id] = m;
1686
1712
  }
1687
1713
  },
1688
- u.id
1714
+ g.id
1689
1715
  ))
1690
1716
  ] })
1691
1717
  ]
1692
1718
  }
1693
1719
  );
1694
1720
  }
1695
- function jt({
1721
+ function Qt({
1696
1722
  session: e,
1697
1723
  isActive: t,
1698
1724
  isFocused: r,
1699
1725
  onSwitch: n,
1700
1726
  onDelete: l,
1701
1727
  onFocus: o,
1702
- onKeyDown: p,
1728
+ onKeyDown: d,
1703
1729
  rowRef: c
1704
1730
  }) {
1705
1731
  return /* @__PURE__ */ h(
@@ -1717,7 +1743,7 @@ function jt({
1717
1743
  ),
1718
1744
  onClick: () => n == null ? void 0 : n(e.id),
1719
1745
  onFocus: o,
1720
- onKeyDown: (s) => p(s, e.id),
1746
+ onKeyDown: (s) => d(s, e.id),
1721
1747
  tabIndex: r ? 0 : -1,
1722
1748
  "aria-current": t ? "true" : void 0,
1723
1749
  children: [
@@ -1730,7 +1756,7 @@ function jt({
1730
1756
  }
1731
1757
  ),
1732
1758
  l && /* @__PURE__ */ a(
1733
- Ee,
1759
+ De,
1734
1760
  {
1735
1761
  type: "button",
1736
1762
  variant: "ghost",
@@ -1761,124 +1787,124 @@ function jt({
1761
1787
  );
1762
1788
  }
1763
1789
  export {
1764
- xr as ArtifactSurfacePane,
1765
- yr as CatalogRegistry,
1766
- Oa as ChatLayout,
1767
- _a as CodeEditor,
1768
- br as CodeEditorPane,
1769
- vr as CommandPalette,
1790
+ yr as ArtifactSurfacePane,
1791
+ br as CatalogRegistry,
1792
+ Fa as ChatLayout,
1793
+ Ba as CodeEditor,
1794
+ vr as CodeEditorPane,
1795
+ Nr as CommandPalette,
1770
1796
  Sr as CommandRegistry,
1771
- or as DATA_CATALOG_DEFAULT_TOOL_NAME,
1797
+ sr as DATA_CATALOG_DEFAULT_TOOL_NAME,
1772
1798
  ue as DATA_CATALOG_PLUGIN_ID,
1773
1799
  de as DATA_CATALOG_ROW_SURFACE_KIND,
1774
1800
  ie as DataExplorer,
1775
- Ve as DockviewShell,
1776
- nr as EXPLORER_PLUGIN_ID,
1777
- pr as EmptyPane,
1778
- xe as ExplorerView,
1779
- $a as FileTree,
1780
- Nr as FileTreePane,
1781
- Cr as FileTreeView,
1782
- dr as IdeLayout,
1783
- Tr as MAX_PANELS,
1784
- Va as MarkdownEditor,
1785
- Pr as MarkdownEditorPane,
1786
- fr as PanelErrorBoundary,
1787
- kr as PanelRegistry,
1788
- Er as PluginError,
1789
- wr as PluginErrorBoundary,
1801
+ He as DockviewShell,
1802
+ lr as EXPLORER_PLUGIN_ID,
1803
+ fr as EmptyPane,
1804
+ Ne as ExplorerView,
1805
+ Ka as FileTree,
1806
+ Cr as FileTreePane,
1807
+ Tr as FileTreeView,
1808
+ pr as IdeLayout,
1809
+ Pr as MAX_PANELS,
1810
+ ja as MarkdownEditor,
1811
+ kr as MarkdownEditorPane,
1812
+ mr as PanelErrorBoundary,
1813
+ Er as PanelRegistry,
1814
+ wr as PluginError,
1815
+ Ir as PluginErrorBoundary,
1790
1816
  Mr as PluginErrorProvider,
1791
1817
  Dr as RegistryProvider,
1792
- Vt as ResponsiveDockviewShell,
1793
- Ir as SessionBrowser,
1794
- mr as SessionList,
1795
- Rr as SurfaceResolverRegistry,
1796
- Or as SurfaceShell,
1797
- Fr as ThemeProvider,
1818
+ jt as ResponsiveDockviewShell,
1819
+ Rr as SessionBrowser,
1820
+ gr as SessionList,
1821
+ Or as SurfaceResolverRegistry,
1822
+ Fr as SurfaceShell,
1823
+ Lr as ThemeProvider,
1798
1824
  Ma as Toaster,
1799
- Fa as TopBar,
1800
- Lr as WORKSPACE_OPEN_PATH_SURFACE_KIND,
1801
- zr as WorkbenchLeftPane,
1802
- La as WorkspaceLoadingState,
1803
- qr as WorkspaceProvider,
1804
- _r as agentMeta,
1805
- ir as appendDataCatalogOutputs,
1806
- Br as bindStore,
1807
- Ar as bootstrap,
1808
- za as buildChatLayout,
1809
- Qt as buildIdeLayout,
1810
- $r as closePanelSchema,
1825
+ La as TopBar,
1826
+ zr as WORKSPACE_OPEN_PATH_SURFACE_KIND,
1827
+ qr as WorkbenchLeftPane,
1828
+ za as WorkspaceLoadingState,
1829
+ _r as WorkspaceProvider,
1830
+ Br as agentMeta,
1831
+ ur as appendDataCatalogOutputs,
1832
+ Ar as bindStore,
1833
+ $r as bootstrap,
1834
+ qa as buildChatLayout,
1835
+ Gt as buildIdeLayout,
1836
+ Kr as closePanelSchema,
1811
1837
  H as cn,
1812
- er as composePlugins,
1813
- Kr as createBridge,
1814
- Vr as createBridgeClient,
1815
- ur as createDataCatalogCatalog,
1816
- Rt as createDataCatalogOpenHandler,
1817
- Re as createDataCatalogOutputs,
1818
- cr as createDataCatalogPlugin,
1819
- Ft as createDataCatalogSurfaceResolver,
1820
- kt as createExplorerOutputs,
1821
- lr as createExplorerPlugin,
1822
- Ba as createShadcnTheme,
1823
- Qr as createWorkspaceStore,
1824
- It as dataCatalogPanelInstanceId,
1838
+ tr as composePlugins,
1839
+ Vr as createBridge,
1840
+ jr as createBridgeClient,
1841
+ dr as createDataCatalogCatalog,
1842
+ Ot as createDataCatalogOpenHandler,
1843
+ ze as createDataCatalogOutputs,
1844
+ ir as createDataCatalogPlugin,
1845
+ Lt as createDataCatalogSurfaceResolver,
1846
+ Et as createExplorerOutputs,
1847
+ or as createExplorerPlugin,
1848
+ Aa as createShadcnTheme,
1849
+ Gr as createWorkspaceStore,
1850
+ Rt as dataCatalogPanelInstanceId,
1825
1851
  ae as defineFrontPlugin,
1826
- we as definePanel,
1852
+ Re as definePanel,
1827
1853
  Da as dismissToast,
1828
- jr as emitAgentData,
1829
- Gr as emitFilesystemAgentFileChange,
1830
- Hr as events,
1831
- Wr as expandToFileSchema,
1832
- Ur as filesystemEvents,
1833
- Xr as filesystemPlugin,
1834
- Jr as formatShortcut,
1835
- Yr as getFileIcon,
1836
- Zr as navigateToLineSchema,
1837
- ea as notificationSchema,
1838
- ta as onFilesystemChanged,
1839
- De as openDataCatalogVisualization,
1840
- ra as openFileSchema,
1841
- aa as openPanelSchema,
1842
- Be as postUiCommand,
1843
- Lt as readDataCatalogRow,
1844
- zt as resolveDataCatalogControlledQuery,
1845
- Ie as resolveDataCatalogQuery,
1846
- qt as resolveDataCatalogVisualizationState,
1847
- Ia as toast,
1848
- na as useActiveFile,
1849
- la as useActivePanel,
1850
- tr as useActivePanels,
1851
- rr as useArtifactPanels,
1852
- ar as useArtifactRouting,
1853
- oa as useAutoOpenAgentFiles,
1854
- sa as useCatalogRegistry,
1855
- ca as useCatalogs,
1856
- ia as useCommandRegistry,
1857
- ua as useCommands,
1858
- sr as useDataCatalogOpenVisualization,
1859
- _t as useDataCatalogQuery,
1860
- Bt as useDataCatalogVisualizationState,
1861
- da as useDirtyFiles,
1862
- pa as useDockviewApi,
1863
- fa as useEditorLifecycle,
1864
- ma as useEvent,
1865
- bt as useExplorerState,
1866
- ga as useHydrationComplete,
1867
- ha as useKeyboardShortcuts,
1868
- xa as useOpenPanels,
1869
- ya as usePluginErrors,
1870
- Ne as useRegistry,
1871
- ba as useResetLayout,
1872
- ht as useResponsiveSidebarCollapse,
1873
- Ke as useSetSidebar,
1874
- $e as useSidebarState,
1875
- va as useSurfaceResolverRegistry,
1854
+ Qr as emitAgentData,
1855
+ Hr as emitFilesystemAgentFileChange,
1856
+ Wr as events,
1857
+ Ur as expandToFileSchema,
1858
+ Xr as filesystemEvents,
1859
+ Jr as filesystemPlugin,
1860
+ Yr as formatShortcut,
1861
+ Zr as getFileIcon,
1862
+ ea as navigateToLineSchema,
1863
+ ta as notificationSchema,
1864
+ ra as onFilesystemChanged,
1865
+ Fe as openDataCatalogVisualization,
1866
+ aa as openFileSchema,
1867
+ na as openPanelSchema,
1868
+ Ve as postUiCommand,
1869
+ zt as readDataCatalogRow,
1870
+ qt as resolveDataCatalogControlledQuery,
1871
+ Le as resolveDataCatalogQuery,
1872
+ _t as resolveDataCatalogVisualizationState,
1873
+ Ra as toast,
1874
+ la as useActiveFile,
1875
+ oa as useActivePanel,
1876
+ rr as useActivePanels,
1877
+ ar as useArtifactPanels,
1878
+ nr as useArtifactRouting,
1879
+ sa as useAutoOpenAgentFiles,
1880
+ ca as useCatalogRegistry,
1881
+ ia as useCatalogs,
1882
+ ua as useCommandRegistry,
1883
+ da as useCommands,
1884
+ cr as useDataCatalogOpenVisualization,
1885
+ Bt as useDataCatalogQuery,
1886
+ At as useDataCatalogVisualizationState,
1887
+ pa as useDirtyFiles,
1888
+ fa as useDockviewApi,
1889
+ ma as useEditorLifecycle,
1890
+ ga as useEvent,
1891
+ vt as useExplorerState,
1892
+ ha as useHydrationComplete,
1893
+ xa as useKeyboardShortcuts,
1894
+ ya as useOpenPanels,
1895
+ ba as usePluginErrors,
1896
+ ke as useRegistry,
1897
+ va as useResetLayout,
1898
+ xt as useResponsiveSidebarCollapse,
1899
+ Qe as useSetSidebar,
1900
+ Ge as useSidebarState,
1901
+ Na as useSurfaceResolverRegistry,
1876
1902
  Sa as useTheme,
1877
- Na as useThemePreference,
1878
- ge as useViewportBreakpoint,
1879
- Ca as useWorkspaceBridge,
1880
- Ta as useWorkspaceChatPanel,
1881
- Pa as useWorkspaceContext,
1882
- ka as useWorkspaceContextOptional,
1883
- Ea as userMeta
1903
+ Ca as useThemePreference,
1904
+ be as useViewportBreakpoint,
1905
+ Ta as useWorkspaceBridge,
1906
+ Pa as useWorkspaceChatPanel,
1907
+ ka as useWorkspaceContext,
1908
+ Ea as useWorkspaceContextOptional,
1909
+ wa as userMeta
1884
1910
  };