@vscode/component-explorer 0.1.1-17 → 0.1.1-19

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.
Files changed (35) hide show
  1. package/dist/components/ExplorerModel.d.ts +3 -0
  2. package/dist/components/ExplorerModel.d.ts.map +1 -1
  3. package/dist/components/FixturePreviewItem.d.ts +1 -0
  4. package/dist/components/FixturePreviewItem.d.ts.map +1 -1
  5. package/dist/components/LeftSidebar.d.ts.map +1 -1
  6. package/dist/components/PreviewArea.d.ts.map +1 -1
  7. package/dist/components/ReportComparisonRow.d.ts.map +1 -1
  8. package/dist/components/ScreenshotComparisonRow.d.ts.map +1 -1
  9. package/dist/components/SearchInput.d.ts +6 -0
  10. package/dist/components/SearchInput.d.ts.map +1 -0
  11. package/dist/components/TreeView.d.ts.map +1 -1
  12. package/dist/components/treeFilter.d.ts +3 -0
  13. package/dist/components/treeFilter.d.ts.map +1 -0
  14. package/dist/components/types.d.ts +1 -0
  15. package/dist/components/types.d.ts.map +1 -1
  16. package/dist/core/CliRuntime.d.ts +1 -0
  17. package/dist/core/CliRuntime.d.ts.map +1 -1
  18. package/dist/core/FixtureNode.d.ts +2 -0
  19. package/dist/core/FixtureNode.d.ts.map +1 -1
  20. package/dist/core/fixtureApi.d.ts +47 -1
  21. package/dist/core/fixtureApi.d.ts.map +1 -1
  22. package/dist/core/fixtureApiConsumer.d.ts +2 -0
  23. package/dist/core/fixtureApiConsumer.d.ts.map +1 -1
  24. package/dist/index-BsQr630j.js +80 -0
  25. package/dist/index-BsQr630j.js.map +1 -0
  26. package/dist/index.js +1 -1
  27. package/dist/lib/fixtureFocusTrap.d.ts +2 -0
  28. package/dist/lib/fixtureFocusTrap.d.ts.map +1 -0
  29. package/dist/lib/queryParamObservable.d.ts +4 -0
  30. package/dist/lib/queryParamObservable.d.ts.map +1 -0
  31. package/dist/viewer.js +1197 -899
  32. package/dist/viewer.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/index-DnRcKk60.js +0 -61
  35. package/dist/index-DnRcKk60.js.map +0 -1
package/dist/viewer.js CHANGED
@@ -1,34 +1,34 @@
1
- var mt = Object.defineProperty;
2
- var vt = (r, e, t) => e in r ? mt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var l = (r, e, t) => vt(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { f as we, a as Re, s as Te } from "./index-DnRcKk60.js";
5
- import { b as Dn, d as Fn, c as En, e as Bn, g as An } from "./index-DnRcKk60.js";
6
- import { createRoot as _t } from "react-dom/client";
7
- import { createContext as Pe, useReducer as bt, useState as yt, useContext as xt, useEffect as Ie, createElement as St } from "react";
8
- import { jsx as a, jsxs as f, Fragment as ge } from "react/jsx-runtime";
9
- import { unstable_batchedUpdates as We } from "react-dom";
10
- function me(r) {
11
- return typeof r == "object" && r !== null && Te in r && r[Te] === !0 && "_options" in r && typeof r._options == "object";
12
- }
13
- function ve(r) {
14
- return typeof r == "object" && r !== null && we in r && r[we] === !0 && "_entries" in r && typeof r._entries == "object";
1
+ var Nt = Object.defineProperty;
2
+ var Vt = (r, e, t) => e in r ? Nt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var c = (r, e, t) => Vt(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { f as Te, a as ke, s as Ie } from "./index-BsQr630j.js";
5
+ import { b as is, d as as, c as ds, e as ls, g as cs } from "./index-BsQr630j.js";
6
+ import { createRoot as Mt } from "react-dom/client";
7
+ import { createContext as et, useReducer as Ft, useState as Dt, useContext as Et, useEffect as Oe, createElement as Bt } from "react";
8
+ import { jsx as a, jsxs as m, Fragment as ve } from "react/jsx-runtime";
9
+ import { unstable_batchedUpdates as tt } from "react-dom";
10
+ function be(r) {
11
+ return typeof r == "object" && r !== null && Ie in r && r[Ie] === !0 && "_options" in r && typeof r._options == "object";
15
12
  }
16
13
  function _e(r) {
17
- return typeof r == "object" && r !== null && Re in r && r[Re] === !0 && "_variants" in r && typeof r._variants == "object";
14
+ return typeof r == "object" && r !== null && Te in r && r[Te] === !0 && "_entries" in r && typeof r._entries == "object";
18
15
  }
19
- function wn(r) {
20
- return me(r) ? { success: !0, data: r } : ve(r) ? { success: !0, data: r } : _e(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a valid fixture export (missing brand symbol or _options/_entries/_variants)" };
16
+ function ye(r) {
17
+ return typeof r == "object" && r !== null && ke in r && r[ke] === !0 && "_variants" in r && typeof r._variants == "object";
18
+ }
19
+ function Zn(r) {
20
+ return be(r) ? { success: !0, data: r } : _e(r) ? { success: !0, data: r } : ye(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a valid fixture export (missing brand symbol or _options/_entries/_variants)" };
21
21
  }
22
- function Rn(r) {
23
- return me(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a SingleFixtureExport" };
22
+ function Xn(r) {
23
+ return be(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a SingleFixtureExport" };
24
24
  }
25
- function Tn(r) {
26
- return ve(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureGroupExport" };
25
+ function Yn(r) {
26
+ return _e(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureGroupExport" };
27
27
  }
28
- function In(r) {
29
- return _e(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureVariantsExport" };
28
+ function es(r) {
29
+ return ye(r) ? { success: !0, data: r } : { success: !1, error: "Value is not a FixtureVariantsExport" };
30
30
  }
31
- function Oe(r, e, t) {
31
+ function Ne(r, e, t) {
32
32
  const n = r._options;
33
33
  return {
34
34
  id: e,
@@ -38,86 +38,131 @@ function Oe(r, e, t) {
38
38
  displayMode: n.displayMode ?? { type: "component" },
39
39
  styles: n.styles,
40
40
  background: n.background ?? "light",
41
+ labels: n.labels ?? [],
41
42
  properties: n.properties ?? [],
42
43
  render: n.render
43
44
  };
44
45
  }
45
- function On(r) {
46
+ function ts(r) {
46
47
  return typeof r == "object" && r !== null && "render" in r && typeof r.render == "function" && "id" in r && "name" in r;
47
48
  }
48
- const Ct = {
49
+ const At = {
49
50
  mobile: { width: 390, height: 844 },
50
51
  tablet: { width: 768, height: 1024 },
51
52
  desktop: { width: 1440, height: 900 }
52
53
  };
53
- function wt(r) {
54
- return typeof r == "string" ? { name: r, ...Ct[r] } : r;
54
+ function $t(r) {
55
+ return typeof r == "string" ? { name: r, ...At[r] } : r;
55
56
  }
56
- function Rt(r) {
57
+ function zt(r) {
57
58
  const e = {};
58
59
  for (const t of r)
59
60
  e[t.name] = t.defaultValue;
60
61
  return e;
61
62
  }
62
- function ie(r) {
63
+ function Ve(r) {
64
+ if (r.startsWith("/"))
65
+ throw new Error(`Fixture path cannot start with '/': ${r}`);
66
+ if (r.includes("//"))
67
+ throw new Error(`Fixture path cannot contain empty segments: ${r}`);
68
+ if (r === "")
69
+ throw new Error("Fixture path cannot be empty (use undefined for default)");
70
+ }
71
+ function Lt(r, e) {
72
+ const t = Ht(r);
73
+ if (e === void 0)
74
+ return [t];
75
+ if (e.endsWith("/")) {
76
+ const n = e.slice(0, -1);
77
+ if (n)
78
+ return Ve(n), [...n.split("/"), t];
79
+ throw new Error(`Fixture path cannot be just '/': ${e}`);
80
+ } else
81
+ return Ve(e), e.split("/");
82
+ }
83
+ function ae(r) {
63
84
  const e = {
64
85
  id: "",
65
86
  name: "Components",
66
87
  type: "folder",
67
- children: []
88
+ children: [],
89
+ labels: []
68
90
  };
69
91
  for (const [t, n] of r) {
70
- const s = Tt(t);
71
- Ge(e, [s], n);
92
+ const s = "_path" in n ? n._path : void 0, o = Lt(t, s);
93
+ rt(e, o, n);
72
94
  }
73
95
  return e;
74
96
  }
75
- function Tt(r) {
97
+ function Ht(r) {
76
98
  return (r.split("/").pop() ?? r).replace(/\.fixture\.(tsx?|jsx?)$/, "");
77
99
  }
78
- function Ge(r, e, t) {
79
- var n;
80
- if (me(t)) {
81
- const s = e.join("/"), o = e[e.length - 1], i = {
82
- id: s,
83
- name: o,
100
+ function rt(r, e, t, n = []) {
101
+ var l, h;
102
+ let s = r;
103
+ const o = [...n];
104
+ for (let u = 0; u < e.length - 1; u++) {
105
+ const g = e[u];
106
+ o.push(g);
107
+ const b = o.join("/");
108
+ let p = (l = s.children) == null ? void 0 : l.find(
109
+ (_) => _.type === "folder" && _.name === g
110
+ );
111
+ p || (p = {
112
+ id: b,
113
+ name: g,
114
+ type: "folder",
115
+ children: [],
116
+ labels: []
117
+ }, s.children || (s.children = []), s.children.push(p)), s = p;
118
+ }
119
+ const i = e[e.length - 1];
120
+ o.push(i);
121
+ const d = o.join("/");
122
+ if (be(t)) {
123
+ const u = Ne(t, d, i), g = {
124
+ id: d,
125
+ name: i,
84
126
  type: "component",
85
- component: Oe(t, s, o)
127
+ component: u,
128
+ labels: [...u.labels]
86
129
  };
87
- r.children || (r.children = []), r.children.push(i);
88
- } else if (ve(t)) {
89
- const s = e[e.length - 1], o = e.join("/");
90
- let i = (n = r.children) == null ? void 0 : n.find(
91
- (d) => d.type === "folder" && d.name === s
130
+ s.children || (s.children = []), s.children.push(g);
131
+ } else if (_e(t)) {
132
+ let u = (h = s.children) == null ? void 0 : h.find(
133
+ (g) => g.type === "folder" && g.name === i
92
134
  );
93
- i || (i = {
94
- id: o,
95
- name: s,
135
+ u || (u = {
136
+ id: d,
137
+ name: i,
96
138
  type: "folder",
97
- children: []
98
- }, r.children || (r.children = []), r.children.push(i));
99
- for (const [d, c] of Object.entries(t._entries))
100
- Ge(i, [...e, d], c);
101
- } else if (_e(t)) {
102
- const s = e[e.length - 1], i = {
103
- id: e.join("/"),
104
- name: s,
139
+ children: [],
140
+ labels: [...t._labels ?? []]
141
+ }, s.children || (s.children = []), s.children.push(u));
142
+ for (const [g, b] of Object.entries(t._entries))
143
+ rt(u, [g], b, o);
144
+ } else if (ye(t)) {
145
+ const u = {
146
+ id: d,
147
+ name: i,
105
148
  type: "variants",
106
- children: []
149
+ children: [],
150
+ labels: [...t._labels ?? []]
107
151
  };
108
- r.children || (r.children = []), r.children.push(i);
109
- for (const [d, c] of Object.entries(t._variants)) {
110
- const m = [...e, d].join("/"), v = {
111
- id: m,
112
- name: d,
152
+ s.children || (s.children = []), s.children.push(u);
153
+ for (const [g, b] of Object.entries(t._variants)) {
154
+ const p = [...o, g].join("/"), _ = {
155
+ id: p,
156
+ name: g,
113
157
  type: "component",
114
- component: Oe(c, m, d)
158
+ component: Ne(b, p, g),
159
+ labels: [...b._options.labels ?? []]
115
160
  };
116
- i.children.push(v);
161
+ u.children.push(_);
117
162
  }
118
163
  }
119
164
  }
120
- function ke(r, e) {
165
+ function Me(r, e) {
121
166
  if (e.length === 0)
122
167
  return r;
123
168
  let t = r;
@@ -128,29 +173,29 @@ function ke(r, e) {
128
173
  }
129
174
  return t;
130
175
  }
131
- function It(r) {
176
+ function Pt(r) {
132
177
  if (r.type === "component" && r.component)
133
178
  return [r.component];
134
179
  const e = [];
135
180
  for (const t of r.children ?? [])
136
- e.push(...It(t));
181
+ e.push(...Pt(t));
137
182
  return e;
138
183
  }
139
- let $;
140
- function Ot(r) {
141
- $ ? $ instanceof Ve ? $.loggers.push(r) : $ = new Ve([$, r]) : $ = r;
184
+ let L;
185
+ function jt(r) {
186
+ L ? L instanceof Fe ? L.loggers.push(r) : L = new Fe([L, r]) : L = r;
142
187
  }
143
- function S() {
144
- return $;
188
+ function w() {
189
+ return L;
145
190
  }
146
- let ae;
147
- function kt(r) {
148
- ae = r;
191
+ let de;
192
+ function Ut(r) {
193
+ de = r;
149
194
  }
150
- function Vt(r) {
151
- ae && ae(r);
195
+ function Wt(r) {
196
+ de && de(r);
152
197
  }
153
- class Ve {
198
+ class Fe {
154
199
  constructor(e) {
155
200
  this.loggers = e;
156
201
  }
@@ -219,23 +264,23 @@ var F;
219
264
  return;
220
265
  const i = Error, d = i.stackTraceLimit;
221
266
  i.stackTraceLimit = 3;
222
- const c = new Error().stack;
223
- return i.stackTraceLimit = d, be.fromStack(c, o + 1);
267
+ const l = new Error().stack;
268
+ return i.stackTraceLimit = d, xe.fromStack(l, o + 1);
224
269
  }
225
270
  r.ofNthCaller = s;
226
271
  })(F || (F = {}));
227
- class be {
272
+ class xe {
228
273
  static fromStack(e, t) {
229
274
  const n = e.split(`
230
- `), s = Nt(n[t + 1]);
275
+ `), s = Gt(n[t + 1]);
231
276
  if (s)
232
- return new be(s.fileName, s.line, s.column, s.id);
277
+ return new xe(s.fileName, s.line, s.column, s.id);
233
278
  }
234
279
  constructor(e, t, n, s) {
235
280
  this.fileName = e, this.line = t, this.column = n, this.id = s;
236
281
  }
237
282
  }
238
- function Nt(r) {
283
+ function Gt(r) {
239
284
  if (!r)
240
285
  return;
241
286
  const e = r.match(/\((.*):(\d+):(\d+)\)/);
@@ -260,27 +305,27 @@ class E {
260
305
  this.owner = e, this.debugNameSource = t, this.referenceFn = n;
261
306
  }
262
307
  getDebugName(e) {
263
- return Mt(e, this);
308
+ return qt(e, this);
264
309
  }
265
310
  }
266
- const Ne = /* @__PURE__ */ new Map(), de = /* @__PURE__ */ new WeakMap();
267
- function Mt(r, e) {
268
- const t = de.get(r);
311
+ const De = /* @__PURE__ */ new Map(), le = /* @__PURE__ */ new WeakMap();
312
+ function qt(r, e) {
313
+ const t = le.get(r);
269
314
  if (t)
270
315
  return t;
271
- const n = Dt(r, e);
316
+ const n = Kt(r, e);
272
317
  if (n) {
273
- let s = Ne.get(n) ?? 0;
274
- s++, Ne.set(n, s);
318
+ let s = De.get(n) ?? 0;
319
+ s++, De.set(n, s);
275
320
  const o = s === 1 ? n : `${n}#${s}`;
276
- return de.set(r, o), o;
321
+ return le.set(r, o), o;
277
322
  }
278
323
  }
279
- function Dt(r, e) {
280
- const t = de.get(r);
324
+ function Kt(r, e) {
325
+ const t = le.get(r);
281
326
  if (t)
282
327
  return t;
283
- const n = e.owner ? Et(e.owner) + "." : "";
328
+ const n = e.owner ? Qt(e.owner) + "." : "";
284
329
  let s;
285
330
  const o = e.debugNameSource;
286
331
  if (o !== void 0)
@@ -290,56 +335,56 @@ function Dt(r, e) {
290
335
  } else
291
336
  return n + o;
292
337
  const i = e.referenceFn;
293
- if (i !== void 0 && (s = ye(i), s !== void 0))
338
+ if (i !== void 0 && (s = Se(i), s !== void 0))
294
339
  return n + s;
295
340
  if (e.owner !== void 0) {
296
- const d = Ft(e.owner, r);
341
+ const d = Jt(e.owner, r);
297
342
  if (d !== void 0)
298
343
  return n + d;
299
344
  }
300
345
  }
301
- function Ft(r, e) {
346
+ function Jt(r, e) {
302
347
  for (const t in r)
303
348
  if (r[t] === e)
304
349
  return t;
305
350
  }
306
- const Me = /* @__PURE__ */ new Map(), De = /* @__PURE__ */ new WeakMap();
307
- function Et(r) {
308
- const e = De.get(r);
351
+ const Ee = /* @__PURE__ */ new Map(), Be = /* @__PURE__ */ new WeakMap();
352
+ function Qt(r) {
353
+ const e = Be.get(r);
309
354
  if (e)
310
355
  return e;
311
- const t = qe(r) ?? "Object";
312
- let n = Me.get(t) ?? 0;
313
- n++, Me.set(t, n);
356
+ const t = nt(r) ?? "Object";
357
+ let n = Ee.get(t) ?? 0;
358
+ n++, Ee.set(t, n);
314
359
  const s = n === 1 ? t : `${t}#${n}`;
315
- return De.set(r, s), s;
360
+ return Be.set(r, s), s;
316
361
  }
317
- function qe(r) {
362
+ function nt(r) {
318
363
  const e = r.constructor;
319
364
  if (e)
320
365
  return e.name === "Object" ? void 0 : e.name;
321
366
  }
322
- function ye(r) {
367
+ function Se(r) {
323
368
  const e = r.toString(), n = /\/\*\*\s*@description\s*([^*]*)\*\//.exec(e), s = n ? n[1] : void 0;
324
369
  return s == null ? void 0 : s.trim();
325
370
  }
326
371
  let ce;
327
- function Bt(r) {
372
+ function Zt(r) {
328
373
  ce = r;
329
374
  }
330
- let Ke;
331
- function At(r) {
332
- Ke = r;
375
+ let st;
376
+ function Xt(r) {
377
+ st = r;
333
378
  }
334
- let Je;
335
- function zt(r) {
336
- Je = r;
379
+ let ot;
380
+ function Yt(r) {
381
+ ot = r;
337
382
  }
338
- let Ze;
339
- function $t(r) {
340
- Ze = r;
383
+ let it;
384
+ function er(r) {
385
+ it = r;
341
386
  }
342
- class Lt {
387
+ class tr {
343
388
  get TChange() {
344
389
  return null;
345
390
  }
@@ -355,12 +400,12 @@ class Lt {
355
400
  return ce({
356
401
  owner: s,
357
402
  debugName: () => {
358
- const i = ye(o);
403
+ const i = Se(o);
359
404
  if (i !== void 0)
360
405
  return i;
361
- const c = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(o.toString());
362
- if (c)
363
- return `${this.debugName}.${c[2]}`;
406
+ const l = /^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(o.toString());
407
+ if (l)
408
+ return `${this.debugName}.${l[2]}`;
364
409
  if (!s)
365
410
  return `${this.debugName} (mapped)`;
366
411
  },
@@ -378,7 +423,7 @@ class Lt {
378
423
  }, (e) => this.read(e).read(e));
379
424
  }
380
425
  recomputeInitiallyAndOnChange(e, t) {
381
- return e.add(Ke(this, t)), this;
426
+ return e.add(st(this, t)), this;
382
427
  }
383
428
  /**
384
429
  * Ensures that this observable is observed. This keeps the cache alive.
@@ -386,29 +431,29 @@ class Lt {
386
431
  * Use `recomputeInitiallyAndOnChange` for eager evaluation.
387
432
  */
388
433
  keepObserved(e) {
389
- return e.add(Je(this)), this;
434
+ return e.add(ot(this)), this;
390
435
  }
391
436
  get debugValue() {
392
437
  return this.get();
393
438
  }
394
439
  debugGetDependencyGraph() {
395
- return Ze(this);
440
+ return it(this);
396
441
  }
397
442
  }
398
- class xe extends Lt {
443
+ class we extends tr {
399
444
  constructor(e) {
400
445
  var t;
401
- super(), this._observers = /* @__PURE__ */ new Set(), (t = S()) == null || t.handleObservableCreated(this, e);
446
+ super(), this._observers = /* @__PURE__ */ new Set(), (t = w()) == null || t.handleObservableCreated(this, e);
402
447
  }
403
448
  addObserver(e) {
404
449
  var n;
405
450
  const t = this._observers.size;
406
- this._observers.add(e), t === 0 && this.onFirstObserverAdded(), t !== this._observers.size && ((n = S()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
451
+ this._observers.add(e), t === 0 && this.onFirstObserverAdded(), t !== this._observers.size && ((n = w()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
407
452
  }
408
453
  removeObserver(e) {
409
454
  var n;
410
455
  const t = this._observers.delete(e);
411
- t && this._observers.size === 0 && this.onLastObserverRemoved(), t && ((n = S()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
456
+ t && this._observers.size === 0 && this.onLastObserverRemoved(), t && ((n = w()) == null || n.handleOnListenerCountChanged(this, this._observers.size));
412
457
  }
413
458
  onFirstObserverAdded() {
414
459
  }
@@ -416,27 +461,27 @@ class xe extends Lt {
416
461
  }
417
462
  log() {
418
463
  var t;
419
- const e = !!S();
420
- return Vt(this), e || (t = S()) == null || t.handleObservableCreated(this, F.ofCaller()), this;
464
+ const e = !!w();
465
+ return Wt(this), e || (t = w()) == null || t.handleObservableCreated(this, F.ofCaller()), this;
421
466
  }
422
467
  debugGetObservers() {
423
468
  return this._observers;
424
469
  }
425
470
  }
426
- function Xe(r) {
471
+ function at(r) {
427
472
  return {
428
473
  dispose: r
429
474
  };
430
475
  }
431
- class H extends Error {
476
+ class P extends Error {
432
477
  constructor(e) {
433
- super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, H.prototype);
478
+ super(e || "An unexpected bug occurred."), Object.setPrototypeOf(this, P.prototype);
434
479
  }
435
480
  }
436
- function re(r) {
481
+ function ne(r) {
437
482
  throw r;
438
483
  }
439
- function Ht(r) {
484
+ function rr(r) {
440
485
  console.error("Unexpected error:", r);
441
486
  }
442
487
  const X = (r, e) => r === e;
@@ -468,7 +513,7 @@ class Y {
468
513
  this.disposables = [];
469
514
  }
470
515
  }
471
- function jt(r) {
516
+ function nr(r) {
472
517
  switch (r) {
473
518
  case 0:
474
519
  return "initial";
@@ -482,7 +527,7 @@ function jt(r) {
482
527
  return "<unknown>";
483
528
  }
484
529
  }
485
- class j extends xe {
530
+ class j extends we {
486
531
  get debugName() {
487
532
  return this._debugNameData.getDebugName(this) ?? "(anonymous)";
488
533
  }
@@ -492,7 +537,7 @@ class j extends xe {
492
537
  }
493
538
  onLastObserverRemoved() {
494
539
  var e, t;
495
- this._state = 0, this._value = void 0, (e = S()) == null || e.handleDerivedCleared(this);
540
+ this._state = 0, this._value = void 0, (e = w()) == null || e.handleDerivedCleared(this);
496
541
  for (const n of this._dependencies)
497
542
  n.removeObserver(this);
498
543
  this._dependencies.clear(), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._delayedStore !== void 0 && (this._delayedStore.dispose(), this._delayedStore = void 0), (t = this._handleLastObserverRemoved) == null || t.call(this);
@@ -530,27 +575,27 @@ class j extends xe {
530
575
  try {
531
576
  const d = this._changeSummary;
532
577
  this._isReaderValid = !0, this._changeTracker && (this._isInBeforeUpdate = !0, (s = (n = this._changeTracker).beforeUpdate) == null || s.call(n, this, d), this._isInBeforeUpdate = !1, this._changeSummary = (o = this._changeTracker) == null ? void 0 : o.createChangeSummary(d));
533
- const c = this._state !== 0, h = this._value;
578
+ const l = this._state !== 0, h = this._value;
534
579
  this._state = 3;
535
- const m = this._delayedStore;
536
- m !== void 0 && (this._delayedStore = void 0);
580
+ const u = this._delayedStore;
581
+ u !== void 0 && (this._delayedStore = void 0);
537
582
  try {
538
583
  this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._value = this._computeFn(this, d);
539
584
  } finally {
540
585
  this._isReaderValid = !1;
541
- for (const v of this._dependenciesToBeRemoved)
542
- v.removeObserver(this);
543
- this._dependenciesToBeRemoved.clear(), m !== void 0 && m.dispose();
586
+ for (const g of this._dependenciesToBeRemoved)
587
+ g.removeObserver(this);
588
+ this._dependenciesToBeRemoved.clear(), u !== void 0 && u.dispose();
544
589
  }
545
- e = this._didReportChange || c && !this._equalityComparator(h, this._value), (i = S()) == null || i.handleObservableUpdated(this, {
590
+ e = this._didReportChange || l && !this._equalityComparator(h, this._value), (i = w()) == null || i.handleObservableUpdated(this, {
546
591
  oldValue: h,
547
592
  newValue: this._value,
548
593
  change: void 0,
549
594
  didChange: e,
550
- hadValue: c
595
+ hadValue: l
551
596
  });
552
597
  } catch (d) {
553
- re(d);
598
+ ne(d);
554
599
  }
555
600
  if (this._isComputing = !1, !this._didReportChange && e)
556
601
  for (const d of this._observers)
@@ -564,7 +609,7 @@ class j extends xe {
564
609
  // IObserver Implementation
565
610
  beginUpdate(e) {
566
611
  if (this._isUpdating)
567
- throw new H("Cyclic deriveds are not supported yet!");
612
+ throw new P("Cyclic deriveds are not supported yet!");
568
613
  this._updateCount++, this._isUpdating = !0;
569
614
  try {
570
615
  const t = this._updateCount === 1;
@@ -601,7 +646,7 @@ class j extends xe {
601
646
  handleChange(e, t) {
602
647
  var n;
603
648
  if (this._dependencies.has(e) && !this._dependenciesToBeRemoved.has(e) || this._isInBeforeUpdate) {
604
- (n = S()) == null || n.handleDerivedDependencyChanged(this, e, t);
649
+ (n = w()) == null || n.handleDerivedDependencyChanged(this, e, t);
605
650
  let s = !1;
606
651
  try {
607
652
  s = this._changeTracker ? this._changeTracker.handleChange({
@@ -610,7 +655,7 @@ class j extends xe {
610
655
  didChange: (i) => i === e
611
656
  }, this._changeSummary) : !0;
612
657
  } catch (i) {
613
- re(i);
658
+ ne(i);
614
659
  }
615
660
  const o = this._state === 3;
616
661
  if (s && (this._state === 1 || o) && (this._state = 2, o))
@@ -621,7 +666,7 @@ class j extends xe {
621
666
  // IReader Implementation
622
667
  _ensureReaderValid() {
623
668
  if (!this._isReaderValid)
624
- throw new H("The reader object cannot be used outside its compute function!");
669
+ throw new P("The reader object cannot be used outside its compute function!");
625
670
  }
626
671
  readObservable(e) {
627
672
  this._ensureReaderValid(), e.addObserver(this);
@@ -649,7 +694,7 @@ class j extends xe {
649
694
  debugGetState() {
650
695
  return {
651
696
  state: this._state,
652
- stateStr: jt(this._state),
697
+ stateStr: nr(this._state),
653
698
  updateCount: this._updateCount,
654
699
  isComputing: this._isComputing,
655
700
  dependencies: this._dependencies,
@@ -670,14 +715,14 @@ class j extends xe {
670
715
  o.handleChange(this, n);
671
716
  }
672
717
  }
673
- function D(r, e, t = F.ofCaller()) {
718
+ function V(r, e, t = F.ofCaller()) {
674
719
  return e !== void 0 ? new j(new E(r, void 0, e), e, void 0, void 0, X, t) : new j(new E(void 0, void 0, r), r, void 0, void 0, X, t);
675
720
  }
676
- function Ut(r, e, t = F.ofCaller()) {
721
+ function sr(r, e, t = F.ofCaller()) {
677
722
  return new j(new E(r.owner, r.debugName, r.debugReferenceFn), e, void 0, r.onLastObserverRemoved, r.equalsFn ?? X, t);
678
723
  }
679
- Bt(Ut);
680
- function Pt(r, e, t = F.ofCaller()) {
724
+ Zt(sr);
725
+ function or(r, e, t = F.ofCaller()) {
681
726
  let n, s;
682
727
  n = r, s = void 0;
683
728
  let o;
@@ -689,7 +734,7 @@ function Pt(r, e, t = F.ofCaller()) {
689
734
  o && (o.dispose(), o = void 0);
690
735
  }, X, t);
691
736
  }
692
- function Wt(r) {
737
+ function ir(r) {
693
738
  switch (r) {
694
739
  case 1:
695
740
  return "dependenciesMightHaveChanged";
@@ -701,13 +746,13 @@ function Wt(r) {
701
746
  return "<unknown>";
702
747
  }
703
748
  }
704
- class Ye {
749
+ class dt {
705
750
  get debugName() {
706
751
  return this._debugNameData.getDebugName(this) ?? "(anonymous)";
707
752
  }
708
753
  constructor(e, t, n, s) {
709
754
  var o, i;
710
- this._debugNameData = e, this._runFn = t, this._changeTracker = n, this._state = 2, this._updateCount = 0, this._disposed = !1, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = !1, this._store = void 0, this._delayedStore = void 0, this._changeSummary = (o = this._changeTracker) == null ? void 0 : o.createChangeSummary(void 0), (i = S()) == null || i.handleAutorunCreated(this, s), this._run();
755
+ this._debugNameData = e, this._runFn = t, this._changeTracker = n, this._state = 2, this._updateCount = 0, this._disposed = !1, this._dependencies = /* @__PURE__ */ new Set(), this._dependenciesToBeRemoved = /* @__PURE__ */ new Set(), this._isRunning = !1, this._store = void 0, this._delayedStore = void 0, this._changeSummary = (o = this._changeTracker) == null ? void 0 : o.createChangeSummary(void 0), (i = w()) == null || i.handleAutorunCreated(this, s), this._run();
711
756
  }
712
757
  dispose() {
713
758
  var e;
@@ -715,7 +760,7 @@ class Ye {
715
760
  this._disposed = !0;
716
761
  for (const t of this._dependencies)
717
762
  t.removeObserver(this);
718
- this._dependencies.clear(), this._store !== void 0 && this._store.dispose(), this._delayedStore !== void 0 && this._delayedStore.dispose(), (e = S()) == null || e.handleAutorunDisposed(this);
763
+ this._dependencies.clear(), this._store !== void 0 && this._store.dispose(), this._delayedStore !== void 0 && this._delayedStore.dispose(), (e = w()) == null || e.handleAutorunDisposed(this);
719
764
  }
720
765
  }
721
766
  _run() {
@@ -724,19 +769,19 @@ class Ye {
724
769
  this._dependenciesToBeRemoved = this._dependencies, this._dependencies = e, this._state = 3;
725
770
  try {
726
771
  if (!this._disposed) {
727
- (t = S()) == null || t.handleAutorunStarted(this);
772
+ (t = w()) == null || t.handleAutorunStarted(this);
728
773
  const i = this._changeSummary, d = this._delayedStore;
729
774
  d !== void 0 && (this._delayedStore = void 0);
730
775
  try {
731
776
  this._isRunning = !0, this._changeTracker && ((s = (n = this._changeTracker).beforeUpdate) == null || s.call(n, this, i), this._changeSummary = this._changeTracker.createChangeSummary(i)), this._store !== void 0 && (this._store.dispose(), this._store = void 0), this._runFn(this, i);
732
- } catch (c) {
733
- re(c);
777
+ } catch (l) {
778
+ ne(l);
734
779
  } finally {
735
780
  this._isRunning = !1, d !== void 0 && d.dispose();
736
781
  }
737
782
  }
738
783
  } finally {
739
- this._disposed || (o = S()) == null || o.handleAutorunFinished(this);
784
+ this._disposed || (o = w()) == null || o.handleAutorunFinished(this);
740
785
  for (const i of this._dependenciesToBeRemoved)
741
786
  i.removeObserver(this);
742
787
  this._dependenciesToBeRemoved.clear();
@@ -771,7 +816,7 @@ class Ye {
771
816
  handleChange(e, t) {
772
817
  var n;
773
818
  if (this._isDependency(e)) {
774
- (n = S()) == null || n.handleAutorunDependencyChanged(this, e, t);
819
+ (n = w()) == null || n.handleAutorunDependencyChanged(this, e, t);
775
820
  try {
776
821
  (this._changeTracker ? this._changeTracker.handleChange({
777
822
  changedObservable: e,
@@ -779,7 +824,7 @@ class Ye {
779
824
  didChange: (o) => o === e
780
825
  }, this._changeSummary) : !0) && (this._state = 2);
781
826
  } catch (s) {
782
- re(s);
827
+ ne(s);
783
828
  }
784
829
  }
785
830
  }
@@ -789,7 +834,7 @@ class Ye {
789
834
  // IReader implementation
790
835
  _ensureNoRunning() {
791
836
  if (!this._isRunning)
792
- throw new H("The reader object cannot be used outside its compute function!");
837
+ throw new P("The reader object cannot be used outside its compute function!");
793
838
  }
794
839
  readObservable(e) {
795
840
  if (this._ensureNoRunning(), this._disposed)
@@ -800,12 +845,12 @@ class Ye {
800
845
  }
801
846
  get store() {
802
847
  if (this._ensureNoRunning(), this._disposed)
803
- throw new H("Cannot access store after dispose");
848
+ throw new P("Cannot access store after dispose");
804
849
  return this._store === void 0 && (this._store = new Y()), this._store;
805
850
  }
806
851
  get delayedStore() {
807
852
  if (this._ensureNoRunning(), this._disposed)
808
- throw new H("Cannot access store after dispose");
853
+ throw new P("Cannot access store after dispose");
809
854
  return this._delayedStore === void 0 && (this._delayedStore = new Y()), this._delayedStore;
810
855
  }
811
856
  debugGetState() {
@@ -814,42 +859,42 @@ class Ye {
814
859
  updateCount: this._updateCount,
815
860
  dependencies: this._dependencies,
816
861
  state: this._state,
817
- stateStr: Wt(this._state)
862
+ stateStr: ir(this._state)
818
863
  };
819
864
  }
820
865
  debugRerun() {
821
866
  this._isRunning ? this._state = 2 : this._run();
822
867
  }
823
868
  }
824
- function Qe(r, e = F.ofCaller()) {
825
- return new Ye(new E(void 0, void 0, r), r, void 0, e);
869
+ function lt(r, e = F.ofCaller()) {
870
+ return new dt(new E(void 0, void 0, r), r, void 0, e);
826
871
  }
827
- function Fe(r) {
872
+ function Ae(r) {
828
873
  const e = new Error("BugIndicatingErrorRecovery: " + r);
829
- Ht(e), console.error("recovered from an error that indicates a bug", e);
874
+ rr(e), console.error("recovered from an error that indicates a bug", e);
830
875
  }
831
- function et(r, e) {
832
- const t = new tt(r, e);
876
+ function ct(r, e) {
877
+ const t = new ht(r, e);
833
878
  try {
834
879
  r(t);
835
880
  } finally {
836
881
  t.finish();
837
882
  }
838
883
  }
839
- function Gt(r, e, t) {
840
- r ? e(r) : et(e, t);
884
+ function ar(r, e, t) {
885
+ r ? e(r) : ct(e, t);
841
886
  }
842
- class tt {
887
+ class ht {
843
888
  constructor(e, t) {
844
889
  var n;
845
- this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n = S()) == null || n.handleBeginTransaction(this);
890
+ this._fn = e, this._getDebugName = t, this._updatingObservers = [], (n = w()) == null || n.handleBeginTransaction(this);
846
891
  }
847
892
  getDebugName() {
848
- return this._getDebugName ? this._getDebugName() : ye(this._fn);
893
+ return this._getDebugName ? this._getDebugName() : Se(this._fn);
849
894
  }
850
895
  updateObserver(e, t) {
851
896
  if (!this._updatingObservers) {
852
- Fe("Transaction already finished!"), et((n) => {
897
+ Ae("Transaction already finished!"), ct((n) => {
853
898
  n.updateObserver(e, t);
854
899
  });
855
900
  return;
@@ -860,30 +905,30 @@ class tt {
860
905
  var t;
861
906
  const e = this._updatingObservers;
862
907
  if (!e) {
863
- Fe("transaction.finish() has already been called!");
908
+ Ae("transaction.finish() has already been called!");
864
909
  return;
865
910
  }
866
911
  for (let n = 0; n < e.length; n++) {
867
912
  const { observer: s, observable: o } = e[n];
868
913
  s.endUpdate(o);
869
914
  }
870
- this._updatingObservers = null, (t = S()) == null || t.handleEndTransaction(this);
915
+ this._updatingObservers = null, (t = w()) == null || t.handleEndTransaction(this);
871
916
  }
872
917
  debugGetUpdatingObservers() {
873
918
  return this._updatingObservers;
874
919
  }
875
920
  }
876
- function w(r, e, t = F.ofCaller()) {
921
+ function C(r, e, t = F.ofCaller()) {
877
922
  let n;
878
- return typeof r == "string" ? n = new E(void 0, r, void 0) : n = new E(r, void 0, void 0), new rt(n, e, X, t);
923
+ return typeof r == "string" ? n = new E(void 0, r, void 0) : n = new E(r, void 0, void 0), new ut(n, e, X, t);
879
924
  }
880
- class rt extends xe {
925
+ class ut extends we {
881
926
  get debugName() {
882
927
  return this._debugNameData.getDebugName(this) ?? "ObservableValue";
883
928
  }
884
929
  constructor(e, t, n, s) {
885
930
  var o;
886
- super(s), this._debugNameData = e, this._equalityComparator = n, this._value = t, (o = S()) == null || o.handleObservableUpdated(this, { hadValue: !1, newValue: t, change: void 0, didChange: !0, oldValue: void 0 });
931
+ super(s), this._debugNameData = e, this._equalityComparator = n, this._value = t, (o = w()) == null || o.handleObservableUpdated(this, { hadValue: !1, newValue: t, change: void 0, didChange: !0, oldValue: void 0 });
887
932
  }
888
933
  get() {
889
934
  return this._value;
@@ -893,11 +938,11 @@ class rt extends xe {
893
938
  if (n === void 0 && this._equalityComparator(this._value, e))
894
939
  return;
895
940
  let s;
896
- t || (t = s = new tt(() => {
941
+ t || (t = s = new ht(() => {
897
942
  }, () => `Setting ${this.debugName}`));
898
943
  try {
899
944
  const i = this._value;
900
- this._setValue(e), (o = S()) == null || o.handleObservableUpdated(this, { oldValue: i, newValue: e, change: n, didChange: !0, hadValue: !0 });
945
+ this._setValue(e), (o = w()) == null || o.handleObservableUpdated(this, { oldValue: i, newValue: e, change: n, didChange: !0, hadValue: !0 });
901
946
  for (const d of this._observers)
902
947
  t.updateObserver(d, this), d.handleChange(this, n);
903
948
  } finally {
@@ -919,25 +964,25 @@ class rt extends xe {
919
964
  this._value = e;
920
965
  }
921
966
  }
922
- function Ee(...r) {
967
+ function $e(...r) {
923
968
  let e, t, n, s;
924
- return r.length === 2 ? [t, n] = r : [e, t, n, s] = r, new L(new E(e, void 0, n), t, n, () => L.globalTransaction, X, s ?? F.ofCaller());
969
+ return r.length === 2 ? [t, n] = r : [e, t, n, s] = r, new H(new E(e, void 0, n), t, n, () => H.globalTransaction, X, s ?? F.ofCaller());
925
970
  }
926
- class L extends xe {
971
+ class H extends we {
927
972
  constructor(e, t, n, s, o, i) {
928
973
  super(i), this._debugNameData = e, this.event = t, this._getValue = n, this._getTransaction = s, this._equalityComparator = o, this._hasValue = !1, this.handleEvent = (d) => {
929
- var R;
930
- const c = this._getValue(d), h = this._value, m = !this._hasValue || !this._equalityComparator(h, c);
931
- let v = !1;
932
- m && (this._value = c, this._hasValue && (v = !0, Gt(this._getTransaction(), (g) => {
974
+ var b;
975
+ const l = this._getValue(d), h = this._value, u = !this._hasValue || !this._equalityComparator(h, l);
976
+ let g = !1;
977
+ u && (this._value = l, this._hasValue && (g = !0, ar(this._getTransaction(), (p) => {
933
978
  var _;
934
- (_ = S()) == null || _.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
935
- for (const b of this._observers)
936
- g.updateObserver(b, this), b.handleChange(this, void 0);
979
+ (_ = w()) == null || _.handleObservableUpdated(this, { oldValue: h, newValue: l, change: void 0, didChange: u, hadValue: this._hasValue });
980
+ for (const x of this._observers)
981
+ p.updateObserver(x, this), x.handleChange(this, void 0);
937
982
  }, () => {
938
- const g = this.getDebugName();
939
- return "Event fired" + (g ? `: ${g}` : "");
940
- })), this._hasValue = !0), v || (R = S()) == null || R.handleObservableUpdated(this, { oldValue: h, newValue: c, change: void 0, didChange: m, hadValue: this._hasValue });
983
+ const p = this.getDebugName();
984
+ return "Event fired" + (p ? `: ${p}` : "");
985
+ })), this._hasValue = !0), g || (b = w()) == null || b.handleObservableUpdated(this, { oldValue: h, newValue: l, change: void 0, didChange: u, hadValue: this._hasValue });
941
986
  };
942
987
  }
943
988
  getDebugName() {
@@ -964,39 +1009,39 @@ class L extends xe {
964
1009
  }
965
1010
  }
966
1011
  (function(r) {
967
- r.Observer = L;
1012
+ r.Observer = H;
968
1013
  function e(t, n) {
969
1014
  let s = !1;
970
- L.globalTransaction === void 0 && (L.globalTransaction = t, s = !0);
1015
+ H.globalTransaction === void 0 && (H.globalTransaction = t, s = !0);
971
1016
  try {
972
1017
  n();
973
1018
  } finally {
974
- s && (L.globalTransaction = void 0);
1019
+ s && (H.globalTransaction = void 0);
975
1020
  }
976
1021
  }
977
1022
  r.batchEventsGlobally = e;
978
- })(Ee || (Ee = {}));
979
- function qt(r) {
980
- const e = new nt(!1, void 0);
981
- return r.addObserver(e), Xe(() => {
1023
+ })($e || ($e = {}));
1024
+ function dr(r) {
1025
+ const e = new pt(!1, void 0);
1026
+ return r.addObserver(e), at(() => {
982
1027
  r.removeObserver(e);
983
1028
  });
984
1029
  }
985
- zt(qt);
986
- function Kt(r, e) {
987
- const t = new nt(!0, e);
1030
+ Yt(dr);
1031
+ function lr(r, e) {
1032
+ const t = new pt(!0, e);
988
1033
  r.addObserver(t);
989
1034
  try {
990
1035
  t.beginUpdate(r);
991
1036
  } finally {
992
1037
  t.endUpdate(r);
993
1038
  }
994
- return Xe(() => {
1039
+ return at(() => {
995
1040
  r.removeObserver(t);
996
1041
  });
997
1042
  }
998
- At(Kt);
999
- class nt {
1043
+ Xt(lr);
1044
+ class pt {
1000
1045
  constructor(e, t) {
1001
1046
  this._forceRecompute = e, this._handleValue = t, this._counter = 0;
1002
1047
  }
@@ -1012,10 +1057,10 @@ class nt {
1012
1057
  }
1013
1058
  }
1014
1059
  let te;
1015
- function Jt(r) {
1016
- te || (te = new Zt(), Ot(te)), te.addFilteredObj(r);
1060
+ function cr(r) {
1061
+ te || (te = new hr(), jt(te)), te.addFilteredObj(r);
1017
1062
  }
1018
- class Zt {
1063
+ class hr {
1019
1064
  constructor() {
1020
1065
  this.indentation = 0, this.changedObservablesSets = /* @__PURE__ */ new WeakMap();
1021
1066
  }
@@ -1027,8 +1072,8 @@ class Zt {
1027
1072
  return ((t = this._filteredObjects) == null ? void 0 : t.has(e)) ?? !0;
1028
1073
  }
1029
1074
  textToConsoleArgs(e) {
1030
- return Xt([
1031
- U(tr("| ", this.indentation)),
1075
+ return ur([
1076
+ U(mr("| ", this.indentation)),
1032
1077
  e
1033
1078
  ]);
1034
1079
  }
@@ -1066,7 +1111,7 @@ class Zt {
1066
1111
  return;
1067
1112
  }
1068
1113
  console.log(...this.textToConsoleArgs([
1069
- P("observable value changed"),
1114
+ W("observable value changed"),
1070
1115
  I(e.debugName, { color: "BlueViolet" }),
1071
1116
  ...this.formatInfo(t)
1072
1117
  ]));
@@ -1085,7 +1130,7 @@ class Zt {
1085
1130
  return;
1086
1131
  const n = this.changedObservablesSets.get(e);
1087
1132
  n && (console.log(...this.textToConsoleArgs([
1088
- P("derived recomputed"),
1133
+ W("derived recomputed"),
1089
1134
  I(e.debugName, { color: "BlueViolet" }),
1090
1135
  ...this.formatInfo(t),
1091
1136
  this.formatChanges(n),
@@ -1094,13 +1139,13 @@ class Zt {
1094
1139
  }
1095
1140
  handleDerivedCleared(e) {
1096
1141
  this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1097
- P("derived cleared"),
1142
+ W("derived cleared"),
1098
1143
  I(e.debugName, { color: "BlueViolet" })
1099
1144
  ]));
1100
1145
  }
1101
1146
  handleFromEventObservableTriggered(e, t) {
1102
1147
  this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1103
- P("observable from event triggered"),
1148
+ W("observable from event triggered"),
1104
1149
  I(e.debugName, { color: "BlueViolet" }),
1105
1150
  ...this.formatInfo(t),
1106
1151
  { data: [{ fn: e._getValue }] }
@@ -1117,7 +1162,7 @@ class Zt {
1117
1162
  handleAutorunStarted(e) {
1118
1163
  const t = this.changedObservablesSets.get(e);
1119
1164
  t && (this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1120
- P("autorun"),
1165
+ W("autorun"),
1121
1166
  I(e.debugName, { color: "BlueViolet" }),
1122
1167
  this.formatChanges(t),
1123
1168
  { data: [{ fn: e._debugNameData.referenceFn ?? e._runFn }] }
@@ -1129,7 +1174,7 @@ class Zt {
1129
1174
  handleBeginTransaction(e) {
1130
1175
  let t = e.getDebugName();
1131
1176
  t === void 0 && (t = ""), this._isIncluded(e) && console.log(...this.textToConsoleArgs([
1132
- P("transaction"),
1177
+ W("transaction"),
1133
1178
  I(t, { color: "BlueViolet" }),
1134
1179
  { data: [{ fn: e._fn }] }
1135
1180
  ])), this.indentation++;
@@ -1138,7 +1183,7 @@ class Zt {
1138
1183
  this.indentation--;
1139
1184
  }
1140
1185
  }
1141
- function Xt(r) {
1186
+ function ur(r) {
1142
1187
  const e = new Array(), t = [];
1143
1188
  let n = "";
1144
1189
  function s(i) {
@@ -1154,8 +1199,8 @@ function Xt(r) {
1154
1199
  function U(r) {
1155
1200
  return I(r, { color: "black" });
1156
1201
  }
1157
- function P(r) {
1158
- return I(rr(`${r}: `, 10), { color: "black", bold: !0 });
1202
+ function W(r) {
1203
+ return I(vr(`${r}: `, 10), { color: "black", bold: !0 });
1159
1204
  }
1160
1205
  function I(r, e = {
1161
1206
  color: "black"
@@ -1173,12 +1218,12 @@ function I(r, e = {
1173
1218
  }
1174
1219
  function Z(r, e) {
1175
1220
  try {
1176
- return Yt(r, e);
1221
+ return pr(r, e);
1177
1222
  } catch {
1178
1223
  return "[[???]]";
1179
1224
  }
1180
1225
  }
1181
- function Yt(r, e) {
1226
+ function pr(r, e) {
1182
1227
  switch (typeof r) {
1183
1228
  case "number":
1184
1229
  return "" + r;
@@ -1189,7 +1234,7 @@ function Yt(r, e) {
1189
1234
  case "undefined":
1190
1235
  return "undefined";
1191
1236
  case "object":
1192
- return r === null ? "null" : Array.isArray(r) ? Qt(r, e) : er(r, e);
1237
+ return r === null ? "null" : Array.isArray(r) ? fr(r, e) : gr(r, e);
1193
1238
  case "symbol":
1194
1239
  return r.toString();
1195
1240
  case "function":
@@ -1198,7 +1243,7 @@ function Yt(r, e) {
1198
1243
  return "" + r;
1199
1244
  }
1200
1245
  }
1201
- function Qt(r, e) {
1246
+ function fr(r, e) {
1202
1247
  let t = "[ ", n = !0;
1203
1248
  for (const s of r) {
1204
1249
  if (n || (t += ", "), t.length - 5 > e) {
@@ -1209,7 +1254,7 @@ function Qt(r, e) {
1209
1254
  }
1210
1255
  return t += " ]", t;
1211
1256
  }
1212
- function er(r, e) {
1257
+ function gr(r, e) {
1213
1258
  try {
1214
1259
  if (typeof r.toString == "function" && r.toString !== Object.prototype.toString) {
1215
1260
  const i = r.toString();
@@ -1218,7 +1263,7 @@ function er(r, e) {
1218
1263
  } catch {
1219
1264
  return "[[Object]]";
1220
1265
  }
1221
- const t = qe(r);
1266
+ const t = nt(r);
1222
1267
  let n = t ? t + "(" : "{ ", s = !0, o;
1223
1268
  try {
1224
1269
  o = Object.entries(r);
@@ -1234,22 +1279,22 @@ function er(r, e) {
1234
1279
  }
1235
1280
  return n += t ? ")" : " }", n;
1236
1281
  }
1237
- function tr(r, e) {
1282
+ function mr(r, e) {
1238
1283
  let t = "";
1239
1284
  for (let n = 1; n <= e; n++)
1240
1285
  t += r;
1241
1286
  return t;
1242
1287
  }
1243
- function rr(r, e) {
1288
+ function vr(r, e) {
1244
1289
  for (; r.length < e; )
1245
1290
  r += " ";
1246
1291
  return r;
1247
1292
  }
1248
- function nr(r, e) {
1249
- const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((o) => o), n = k.from(r, t);
1250
- return n ? st(n, 0, /* @__PURE__ */ new Set()).trim() : "";
1293
+ function br(r, e) {
1294
+ const t = (e == null ? void 0 : e.debugNamePostProcessor) ?? ((o) => o), n = N.from(r, t);
1295
+ return n ? ft(n, 0, /* @__PURE__ */ new Set()).trim() : "";
1251
1296
  }
1252
- function st(r, e, t) {
1297
+ function ft(r, e, t) {
1253
1298
  const n = " ".repeat(e), s = [];
1254
1299
  if (t.has(r.sourceObj))
1255
1300
  return s.push(`${n}* ${r.type} ${r.name} (already listed)`), s.join(`
@@ -1257,43 +1302,43 @@ function st(r, e, t) {
1257
1302
  if (t.add(r.sourceObj), s.push(`${n}* ${r.type} ${r.name}:`), s.push(`${n} value: ${Z(r.value, 50)}`), s.push(`${n} state: ${r.state}`), r.dependencies.length > 0) {
1258
1303
  s.push(`${n} dependencies:`);
1259
1304
  for (const i of r.dependencies)
1260
- s.push(st(i, e + 1, t));
1305
+ s.push(ft(i, e + 1, t));
1261
1306
  }
1262
1307
  return s.join(`
1263
1308
  `);
1264
1309
  }
1265
- class k {
1310
+ class N {
1266
1311
  static from(e, t) {
1267
- if (e instanceof Ye) {
1312
+ if (e instanceof dt) {
1268
1313
  const n = e.debugGetState();
1269
- return new k(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((s) => k.from(s, t) || k.unknown(s)));
1314
+ return new N(e, t(e.debugName), "autorun", void 0, n.stateStr, Array.from(n.dependencies).map((s) => N.from(s, t) || N.unknown(s)));
1270
1315
  } else if (e instanceof j) {
1271
1316
  const n = e.debugGetState();
1272
- return new k(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((s) => k.from(s, t) || k.unknown(s)));
1273
- } else if (e instanceof rt) {
1317
+ return new N(e, t(e.debugName), "derived", n.value, n.stateStr, Array.from(n.dependencies).map((s) => N.from(s, t) || N.unknown(s)));
1318
+ } else if (e instanceof ut) {
1274
1319
  const n = e.debugGetState();
1275
- return new k(e, t(e.debugName), "observableValue", n.value, "upToDate", []);
1276
- } else if (e instanceof L) {
1320
+ return new N(e, t(e.debugName), "observableValue", n.value, "upToDate", []);
1321
+ } else if (e instanceof H) {
1277
1322
  const n = e.debugGetState();
1278
- return new k(e, t(e.debugName), "fromEvent", n.value, n.hasValue ? "upToDate" : "initial", []);
1323
+ return new N(e, t(e.debugName), "fromEvent", n.value, n.hasValue ? "upToDate" : "initial", []);
1279
1324
  }
1280
1325
  }
1281
1326
  static unknown(e) {
1282
- return new k(e, "(unknown)", "unknown", void 0, "unknown", []);
1327
+ return new N(e, "(unknown)", "unknown", void 0, "unknown", []);
1283
1328
  }
1284
1329
  constructor(e, t, n, s, o, i) {
1285
1330
  this.sourceObj = e, this.name = t, this.type = n, this.value = s, this.state = o, this.dependencies = i;
1286
1331
  }
1287
1332
  }
1288
- $t(nr);
1289
- kt(Jt);
1290
- class sr {
1333
+ er(br);
1334
+ Ut(cr);
1335
+ class _r {
1291
1336
  constructor() {
1292
- l(this, "_fixtures", w(this, /* @__PURE__ */ new Map()));
1337
+ c(this, "_fixtures", C(this, /* @__PURE__ */ new Map()));
1293
1338
  /** Observable root of the fixture tree */
1294
- l(this, "root", D(this, (e) => {
1339
+ c(this, "root", V(this, (e) => {
1295
1340
  const t = this._fixtures.read(e);
1296
- return ie(t);
1341
+ return ae(t);
1297
1342
  }));
1298
1343
  }
1299
1344
  /**
@@ -1324,25 +1369,25 @@ class sr {
1324
1369
  */
1325
1370
  getNode(e, t) {
1326
1371
  const n = this.root.read(e);
1327
- return ke(n, t);
1372
+ return Me(n, t);
1328
1373
  }
1329
1374
  /**
1330
1375
  * Gets a component by path (non-reactive, for use in preview iframe).
1331
1376
  * @param path Array of path segments (e.g., ['Button', 'Primary'])
1332
1377
  */
1333
1378
  getComponentByPath(e) {
1334
- const t = this._fixtures.get(), n = ie(t), s = ke(n, e);
1379
+ const t = this._fixtures.get(), n = ae(t), s = Me(n, e);
1335
1380
  return s == null ? void 0 : s.component;
1336
1381
  }
1337
1382
  }
1338
- class kn {
1383
+ class rs {
1339
1384
  constructor(e, t) {
1340
- l(this, "sessionId", Math.random().toString(36).slice(2));
1341
- l(this, "_updateVersion", 0);
1342
- l(this, "_root");
1343
- l(this, "_fixtureModules");
1344
- l(this, "_currentDisposable");
1345
- l(this, "_currentContainer");
1385
+ c(this, "sessionId", Math.random().toString(36).slice(2));
1386
+ c(this, "_updateVersion", 0);
1387
+ c(this, "_root");
1388
+ c(this, "_fixtureModules");
1389
+ c(this, "_currentDisposable");
1390
+ c(this, "_currentContainer");
1346
1391
  this._containerElement = e, this._fixtureModules = t, this._root = this._buildRegistry(), this._installGlobalApi();
1347
1392
  const n = this._flattenFixtures(this._root).length;
1348
1393
  console.log("[cli] CLI entry initialized, sessionId:", this.sessionId, "version:", this._updateVersion, "fixtures:", n);
@@ -1362,58 +1407,58 @@ class kn {
1362
1407
  return this._flattenFixtures(this._root);
1363
1408
  }
1364
1409
  async renderFixture(e) {
1365
- var R;
1410
+ var b;
1366
1411
  const t = this._findFixtureNode(this._root, e);
1367
1412
  if (!t || !t.component)
1368
1413
  throw new Error("Fixture not found: " + e);
1369
- (R = this._currentDisposable) != null && R.dispose && this._currentDisposable.dispose(), this._currentDisposable = void 0, this._currentContainer && (this._currentContainer.remove(), this._currentContainer = void 0);
1414
+ (b = this._currentDisposable) != null && b.dispose && this._currentDisposable.dispose(), this._currentDisposable = void 0, this._currentContainer && (this._currentContainer.remove(), this._currentContainer = void 0);
1370
1415
  const n = document.createElement("div");
1371
1416
  n.style.display = "inline-block", this._containerElement.appendChild(n), this._currentContainer = n;
1372
- const s = t.component, o = Rt(s.properties);
1417
+ const s = t.component, o = zt(s.properties);
1373
1418
  let i = n;
1374
1419
  if (s.isolation === "shadow-dom") {
1375
- const g = n.attachShadow({ mode: "open" });
1376
- i = document.createElement("div"), g.appendChild(i);
1420
+ const p = n.attachShadow({ mode: "open" });
1421
+ i = document.createElement("div"), p.appendChild(i);
1377
1422
  }
1378
- const d = [], c = console.error, h = console.warn;
1379
- console.error = (...g) => {
1380
- d.push({ kind: "console", level: "error", message: g.map(String).join(" ") }), c.apply(console, g);
1381
- }, console.warn = (...g) => {
1382
- d.push({ kind: "console", level: "warn", message: g.map(String).join(" ") }), h.apply(console, g);
1423
+ const d = [], l = console.error, h = console.warn;
1424
+ console.error = (...p) => {
1425
+ d.push({ kind: "console", level: "error", message: p.map(String).join(" ") }), l.apply(console, p);
1426
+ }, console.warn = (...p) => {
1427
+ d.push({ kind: "console", level: "warn", message: p.map(String).join(" ") }), h.apply(console, p);
1383
1428
  };
1384
- const m = (g) => {
1429
+ const u = (p) => {
1385
1430
  var _;
1386
- d.push({ kind: "exception", message: g.message, stack: (_ = g.error) == null ? void 0 : _.stack });
1387
- }, v = (g) => {
1388
- const _ = g.reason, b = _ instanceof Error ? _.message : String(_), y = _ instanceof Error ? _.stack : void 0;
1389
- d.push({ kind: "exception", message: b, stack: y });
1431
+ d.push({ kind: "exception", message: p.message, stack: (_ = p.error) == null ? void 0 : _.stack });
1432
+ }, g = (p) => {
1433
+ const _ = p.reason, x = _ instanceof Error ? _.message : String(_), y = _ instanceof Error ? _.stack : void 0;
1434
+ d.push({ kind: "exception", message: x, stack: y });
1390
1435
  };
1391
- window.addEventListener("error", m), window.addEventListener("unhandledrejection", v);
1436
+ window.addEventListener("error", u), window.addEventListener("unhandledrejection", g);
1392
1437
  try {
1393
- const g = new AbortController(), _ = 3e3;
1394
- let b = s.render(i, {
1438
+ const p = new AbortController(), _ = 3e3;
1439
+ let x = s.render(i, {
1395
1440
  props: o,
1396
- signal: g.signal
1441
+ signal: p.signal
1397
1442
  });
1398
- if (b instanceof Promise) {
1399
- const y = new Promise((x) => setTimeout(() => x("timeout"), _)), O = await Promise.race([b.then((x) => ({ resolved: x })), y]);
1400
- O === "timeout" ? (g.abort(), d.push({ kind: "exception", message: `Fixture render() timed out after ${_}ms` }), b.then((x) => {
1443
+ if (x instanceof Promise) {
1444
+ const y = new Promise((S) => setTimeout(() => S("timeout"), _)), T = await Promise.race([x.then((S) => ({ resolved: S })), y]);
1445
+ T === "timeout" ? (p.abort(), d.push({ kind: "exception", message: `Fixture render() timed out after ${_}ms` }), x.then((S) => {
1401
1446
  var ee;
1402
- return (ee = x == null ? void 0 : x.dispose) == null ? void 0 : ee.call(x);
1447
+ return (ee = S == null ? void 0 : S.dispose) == null ? void 0 : ee.call(S);
1403
1448
  }).catch(() => {
1404
- }), b = void 0) : b = O.resolved;
1449
+ }), x = void 0) : x = T.resolved;
1405
1450
  }
1406
- if (this._currentDisposable = b ?? void 0, b != null && b.ready) {
1407
- const y = new Promise((x) => setTimeout(() => x("timeout"), _));
1408
- await Promise.race([b.ready.then(() => "done"), y]) === "timeout" && (g.abort(), d.push({ kind: "exception", message: `Fixture ready promise timed out after ${_}ms` }));
1451
+ if (this._currentDisposable = x ?? void 0, x != null && x.ready) {
1452
+ const y = new Promise((S) => setTimeout(() => S("timeout"), _));
1453
+ await Promise.race([x.ready.then(() => "done"), y]) === "timeout" && (p.abort(), d.push({ kind: "exception", message: `Fixture ready promise timed out after ${_}ms` }));
1409
1454
  }
1410
- } catch (g) {
1411
- const _ = g instanceof Error ? g : new Error(String(g));
1455
+ } catch (p) {
1456
+ const _ = p instanceof Error ? p : new Error(String(p));
1412
1457
  d.push({ kind: "exception", message: _.message, stack: _.stack });
1413
1458
  } finally {
1414
- console.error = c, console.warn = h;
1459
+ console.error = l, console.warn = h;
1415
1460
  }
1416
- return await new Promise((g) => requestAnimationFrame(() => requestAnimationFrame(() => g()))), window.removeEventListener("error", m), window.removeEventListener("unhandledrejection", v), { errors: d };
1461
+ return await new Promise((p) => requestAnimationFrame(() => requestAnimationFrame(() => p()))), window.removeEventListener("error", u), window.removeEventListener("unhandledrejection", g), { errors: d };
1417
1462
  }
1418
1463
  _buildRegistry() {
1419
1464
  const e = /* @__PURE__ */ new Map();
@@ -1421,17 +1466,17 @@ class kn {
1421
1466
  const s = n.default;
1422
1467
  s && typeof s == "object" && e.set(t, s);
1423
1468
  }
1424
- return ie(e);
1425
- }
1426
- _flattenFixtures(e, t = []) {
1427
- var s;
1428
- const n = [];
1429
- e.type === "component" && n.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((s = e.component) == null ? void 0 : s.background) ?? "light" });
1430
- for (const o of e.children ?? []) {
1431
- const i = e.id ? [...t, e.name] : t;
1432
- n.push(...this._flattenFixtures(o, i));
1469
+ return ae(e);
1470
+ }
1471
+ _flattenFixtures(e, t = [], n = []) {
1472
+ var i;
1473
+ const s = n.length > 0 && e.labels.length > 0 ? [.../* @__PURE__ */ new Set([...n, ...e.labels])] : e.labels.length > 0 ? [...e.labels] : [...n], o = [];
1474
+ e.type === "component" && o.push({ fixtureId: e.id, fixtureName: e.name, groupPath: t, background: ((i = e.component) == null ? void 0 : i.background) ?? "light", labels: s });
1475
+ for (const d of e.children ?? []) {
1476
+ const l = e.id ? [...t, e.name] : t;
1477
+ o.push(...this._flattenFixtures(d, l, s));
1433
1478
  }
1434
- return n;
1479
+ return o;
1435
1480
  }
1436
1481
  _findFixtureNode(e, t) {
1437
1482
  if (e.id === t) return e;
@@ -1453,7 +1498,7 @@ class kn {
1453
1498
  });
1454
1499
  }
1455
1500
  }
1456
- class or {
1501
+ class yr {
1457
1502
  constructor(e) {
1458
1503
  this._run = e, this._changes = [], this._map = /* @__PURE__ */ new Map(), this._updateCounter = 0;
1459
1504
  }
@@ -1479,49 +1524,49 @@ class or {
1479
1524
  handleChange(e, t) {
1480
1525
  }
1481
1526
  }
1482
- function u() {
1483
- return le.instance;
1484
- }
1485
- function ir() {
1527
+ function f() {
1486
1528
  return he.instance;
1487
1529
  }
1488
- function ar() {
1530
+ function xr() {
1489
1531
  return ue.instance;
1490
1532
  }
1491
- u.const = ir;
1492
- u.obs = ar;
1493
- class le {
1533
+ function Sr() {
1534
+ return pe.instance;
1535
+ }
1536
+ f.const = xr;
1537
+ f.obs = Sr;
1538
+ class he {
1494
1539
  create(e) {
1495
- const t = D((n) => e(n));
1540
+ const t = V((n) => e(n));
1496
1541
  return { read: (n) => t };
1497
1542
  }
1498
1543
  }
1499
- le.instance = new le();
1500
- class he {
1544
+ he.instance = new he();
1545
+ class ue {
1501
1546
  create(e) {
1502
- const t = D((n) => e(n));
1547
+ const t = V((n) => e(n));
1503
1548
  return { read: (n) => t.read(n) };
1504
1549
  }
1505
1550
  }
1506
- he.instance = new he();
1507
- class ue {
1551
+ ue.instance = new ue();
1552
+ class pe {
1508
1553
  create(e) {
1509
- const t = D((n) => {
1554
+ const t = V((n) => {
1510
1555
  const s = e(n);
1511
- return dr(s) ? s.read(n) : s;
1556
+ return wr(s) ? s.read(n) : s;
1512
1557
  });
1513
1558
  return { read: (n) => t };
1514
1559
  }
1515
1560
  }
1516
- ue.instance = new ue();
1517
- function dr(r) {
1561
+ pe.instance = new pe();
1562
+ function wr(r) {
1518
1563
  return typeof r == "object" && r !== null && "read" in r;
1519
1564
  }
1520
- function K(r, e) {
1565
+ function J(r, e) {
1521
1566
  return Object.fromEntries(Object.entries(r).map(([t, n]) => [t, e(n, t)]));
1522
1567
  }
1523
- const se = Symbol("ViewModelContext");
1524
- class cr {
1568
+ const oe = Symbol("ViewModelContext");
1569
+ class Cr {
1525
1570
  constructor(e) {
1526
1571
  this._store = new Y(), this.props = e;
1527
1572
  }
@@ -1529,35 +1574,35 @@ class cr {
1529
1574
  this._store.dispose();
1530
1575
  }
1531
1576
  }
1532
- function lr(r) {
1533
- return r[se] || (r[se] = Pe(void 0)), r[se];
1577
+ function Rr(r) {
1578
+ return r[oe] || (r[oe] = et(void 0)), r[oe];
1534
1579
  }
1535
1580
  function B(r = {}) {
1536
1581
  var e;
1537
- return e = class extends cr {
1582
+ return e = class extends Cr {
1538
1583
  }, e._props = r, e;
1539
1584
  }
1540
1585
  let fe = 0;
1541
- const hr = new or((r) => {
1586
+ const Tr = new yr((r) => {
1542
1587
  for (const e of r)
1543
1588
  e.rendered = !1;
1544
1589
  if (fe > 0) {
1545
1590
  const e = r.find((t) => t.isRendering);
1546
1591
  e.itemsToRender = r;
1547
1592
  } else
1548
- We(() => {
1593
+ tt(() => {
1549
1594
  for (const e of r)
1550
1595
  e.rendered || e.forceUpdate();
1551
1596
  });
1552
1597
  });
1553
- let ur = 0;
1554
- class fr {
1598
+ let kr = 0;
1599
+ class Ir {
1555
1600
  constructor(e, t) {
1556
1601
  this.debugName = e, this.renderFactory = t, this._obsProps = void 0, this.forceUpdate = void 0, this._render = void 0, this._disposable = void 0, this.contextValues = /* @__PURE__ */ new Map(), this.cleanupEffect = () => () => {
1557
1602
  var n;
1558
1603
  (n = this._disposable) == null || n.dispose();
1559
1604
  }, this.itemsToRender = [], this.handleAfterRender = () => {
1560
- We(() => {
1605
+ tt(() => {
1561
1606
  for (const n of this.itemsToRender)
1562
1607
  n.rendered || n.forceUpdate();
1563
1608
  }), this.itemsToRender = [];
@@ -1567,38 +1612,38 @@ class fr {
1567
1612
  return this.debugName;
1568
1613
  }
1569
1614
  updateProps(e) {
1570
- this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = w(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = D(this, this._render), this._disposable = hr.addDependency(this.rendering, this));
1615
+ this._obsProps ? this._obsProps.set(e, void 0) : (this._obsProps = C(this, e), this._render = this.renderFactory(this._obsProps, () => this.contextValues), this.rendering = V(this, this._render), this._disposable = Tr.addDependency(this.rendering, this));
1571
1616
  }
1572
1617
  }
1573
- function Se(r, e, t) {
1574
- const n = (i) => i + 1, s = () => new fr(r + ++ur, e), o = function(i) {
1575
- const d = bt(n, 0)[1], c = yt(s)[0];
1618
+ function Ce(r, e, t) {
1619
+ const n = (i) => i + 1, s = () => new Ir(r + ++kr, e), o = function(i) {
1620
+ const d = Ft(n, 0)[1], l = Dt(s)[0];
1576
1621
  for (const h of t ?? [])
1577
- c.contextValues.set(h, xt(h));
1578
- if (Ie(c.cleanupEffect, []), Ie(c.handleAfterRender), c.isRendering)
1622
+ l.contextValues.set(h, Et(h));
1623
+ if (Oe(l.cleanupEffect, []), Oe(l.handleAfterRender), l.isRendering)
1579
1624
  throw new Error("Component is already rendering");
1580
- c.isRendering = !0, fe++;
1625
+ l.isRendering = !0, fe++;
1581
1626
  try {
1582
- c.forceUpdate = d, c.updateProps(i);
1583
- const h = c.rendering.get();
1584
- return c.rendered = !0, h;
1627
+ l.forceUpdate = d, l.updateProps(i);
1628
+ const h = l.rendering.get();
1629
+ return l.rendered = !0, h;
1585
1630
  } finally {
1586
- c.isRendering = !1, fe--;
1631
+ l.isRendering = !1, fe--;
1587
1632
  }
1588
1633
  };
1589
1634
  return o.displayName = r, o;
1590
1635
  }
1591
- Se("ObsView", (r) => (e) => r.read(e).children(e));
1592
- function V(r, e) {
1593
- return Se("view", (t) => {
1594
- const n = K(r, (s, o) => s.create((i) => t.read(i)[o], void 0));
1636
+ Ce("ObsView", (r) => (e) => r.read(e).children(e));
1637
+ function O(r, e) {
1638
+ return Ce("view", (t) => {
1639
+ const n = J(r, (s, o) => s.create((i) => t.read(i)[o], void 0));
1595
1640
  return (s) => {
1596
- const o = K(n, (i) => i.read(s));
1641
+ const o = J(n, (i) => i.read(s));
1597
1642
  return e(s, o);
1598
1643
  };
1599
1644
  });
1600
1645
  }
1601
- function pr(r) {
1646
+ function Or(r) {
1602
1647
  const e = [];
1603
1648
  for (const t of Object.values(r)) {
1604
1649
  const n = t._requiredContext;
@@ -1607,32 +1652,60 @@ function pr(r) {
1607
1652
  return e;
1608
1653
  }
1609
1654
  function A(r, e, t) {
1610
- const n = typeof e == "function" ? {} : e, s = typeof e == "function" ? e : t, o = "_props" in r ? r._props : {}, i = pr({ ...o, ...n }), d = lr(r), c = [...i, d];
1611
- return Se("viewWithModel", (h, m) => {
1612
- const v = m(), R = v.get(d), g = "_props" in r ? K(r._props, (y, O) => y.create((x) => h.read(x)[O], v.get(y._requiredContext))) : {}, _ = R ? { read: () => R, dispose: () => {
1613
- } } : Pt((y) => {
1614
- const O = K(g, (x) => x.read(y));
1615
- return new r(O);
1616
- }), b = K(n, (y, O) => y.create((x) => h.read(x)[O], v.get(y._requiredContext)));
1655
+ const n = typeof e == "function" ? {} : e, s = typeof e == "function" ? e : t, o = "_props" in r ? r._props : {}, i = Or({ ...o, ...n }), d = Rr(r), l = [...i, d];
1656
+ return Ce("viewWithModel", (h, u) => {
1657
+ const g = u(), b = g.get(d), p = "_props" in r ? J(r._props, (y, T) => y.create((S) => h.read(S)[T], g.get(y._requiredContext))) : {}, _ = b ? { read: () => b, dispose: () => {
1658
+ } } : or((y) => {
1659
+ const T = J(p, (S) => S.read(y));
1660
+ return new r(T);
1661
+ }), x = J(n, (y, T) => y.create((S) => h.read(S)[T], g.get(y._requiredContext)));
1617
1662
  return (y) => {
1618
- const O = _.read(y), x = K(b, (ee) => ee.read(y));
1619
- return s(y, O, x);
1663
+ const T = _.read(y), S = J(x, (ee) => ee.read(y));
1664
+ return s(y, T, S);
1620
1665
  };
1621
- }, c.length > 0 ? c : void 0);
1666
+ }, l.length > 0 ? l : void 0);
1622
1667
  }
1623
- V({ value: u.obs() }, (r, e) => e.value.read(r));
1624
- Pe(null);
1625
- function ot(r) {
1668
+ O({ value: f.obs() }, (r, e) => e.value.read(r));
1669
+ et(null);
1670
+ function gt(r) {
1626
1671
  var e;
1627
1672
  return {
1628
1673
  id: r.id,
1629
1674
  name: r.name,
1630
1675
  type: r.type,
1631
- children: (e = r.children) == null ? void 0 : e.map(ot),
1632
- component: r.component
1676
+ children: (e = r.children) == null ? void 0 : e.map(gt),
1677
+ component: r.component,
1678
+ labels: r.labels
1633
1679
  };
1634
1680
  }
1635
- function Q(r, e) {
1681
+ function Nr(r, e) {
1682
+ if (r.name.toLowerCase().includes(e)) return !0;
1683
+ for (const t of r.labels)
1684
+ if (t.toLowerCase().includes(e)) return !0;
1685
+ return !1;
1686
+ }
1687
+ function Vr(r, e) {
1688
+ if (!e) return r;
1689
+ const t = e.toLowerCase();
1690
+ return mt(r, t);
1691
+ }
1692
+ function mt(r, e) {
1693
+ const t = Nr(r, e);
1694
+ if (!r.children || r.children.length === 0)
1695
+ return t ? r : void 0;
1696
+ if (t) return r;
1697
+ const n = [];
1698
+ for (const s of r.children) {
1699
+ const o = mt(s, e);
1700
+ o && n.push(o);
1701
+ }
1702
+ if (n.length !== 0)
1703
+ return {
1704
+ ...r,
1705
+ children: n
1706
+ };
1707
+ }
1708
+ function re(r, e) {
1636
1709
  const {
1637
1710
  storageKey: t,
1638
1711
  defaultValue: n,
@@ -1645,84 +1718,104 @@ function Q(r, e) {
1645
1718
  h !== null && (i = o(h));
1646
1719
  } catch {
1647
1720
  }
1648
- const d = w(r, i), c = d.set.bind(d);
1649
- return d.set = (h, m) => {
1721
+ const d = C(r, i), l = d.set.bind(d);
1722
+ return d.set = (h, u) => {
1650
1723
  try {
1651
1724
  localStorage.setItem(t, s(h));
1652
1725
  } catch {
1653
1726
  }
1654
- c(h, m);
1727
+ l(h, u);
1655
1728
  }, d;
1656
1729
  }
1657
- class gr extends B({
1658
- registry: u.const(),
1659
- daemonModel: u.const(),
1660
- reportModel: u.const()
1730
+ function ze(r, e) {
1731
+ const n = new URLSearchParams(location.search).get(e) || void 0, s = C(r, n);
1732
+ window.addEventListener("popstate", () => {
1733
+ const i = new URLSearchParams(location.search);
1734
+ s.set(i.get(e) || void 0, void 0);
1735
+ });
1736
+ const o = s.set.bind(s);
1737
+ return s.set = (i, d) => {
1738
+ const l = new URLSearchParams(location.search);
1739
+ i ? l.set(e, i) : l.delete(e);
1740
+ const h = l.toString(), u = location.pathname + (h ? "?" + h : "") + location.hash;
1741
+ history.replaceState(history.state, "", u), o(i, d);
1742
+ }, s;
1743
+ }
1744
+ function vt(r, e) {
1745
+ const t = new URLSearchParams(location.search);
1746
+ return t.set(r, e), location.pathname + "?" + t.toString();
1747
+ }
1748
+ class Mr extends B({
1749
+ registry: f.const(),
1750
+ daemonModel: f.const(),
1751
+ reportModel: f.const()
1661
1752
  }) {
1662
1753
  constructor() {
1663
1754
  super(...arguments);
1664
- l(this, "leftSidebarVisible", Q(this, {
1755
+ c(this, "leftSidebarVisible", re(this, {
1665
1756
  storageKey: "component-explorer:leftSidebarVisible",
1666
1757
  defaultValue: !0
1667
1758
  }));
1668
- l(this, "rightSidebarVisible", Q(this, {
1759
+ c(this, "rightSidebarVisible", re(this, {
1669
1760
  storageKey: "component-explorer:rightSidebarVisible",
1670
1761
  defaultValue: !1
1671
1762
  }));
1672
- l(this, "isDarkTheme", Q(this, {
1763
+ c(this, "isDarkTheme", re(this, {
1673
1764
  storageKey: "component-explorer:isDarkTheme",
1674
1765
  defaultValue: !0
1675
1766
  }));
1676
- l(this, "selectedNodeId", Q(this, {
1677
- storageKey: "component-explorer:selectedNodeId",
1678
- defaultValue: void 0
1679
- }));
1680
- l(this, "expandedNodeIds", w(this, /* @__PURE__ */ new Set([""])));
1681
- l(this, "viewMode", Q(this, {
1767
+ c(this, "selectedNodeId", ze(this, "component"));
1768
+ c(this, "expandedNodeIds", C(this, this._initialExpandedNodes()));
1769
+ c(this, "viewMode", re(this, {
1682
1770
  storageKey: "component-explorer:viewMode",
1683
1771
  defaultValue: "session"
1684
1772
  }));
1773
+ c(this, "searchQuery", ze(this, "search"));
1685
1774
  /** The explorer's tree derived from the registry or report */
1686
- l(this, "tree", D(this, (t) => {
1775
+ c(this, "tree", V(this, (t) => {
1687
1776
  const n = this.props.reportModel;
1688
1777
  if (n)
1689
1778
  return n.buildTree(t);
1690
1779
  const s = this.props.registry.root.read(t);
1691
- return ot(s);
1780
+ return gt(s);
1692
1781
  }));
1693
- l(this, "selectedNode", D(this, (t) => {
1782
+ c(this, "filteredTree", V(this, (t) => {
1783
+ const n = this.tree.read(t), s = this.searchQuery.read(t);
1784
+ return Vr(n, s) ?? { ...n, children: [] };
1785
+ }));
1786
+ c(this, "selectedNode", V(this, (t) => {
1694
1787
  const n = this.selectedNodeId.read(t);
1695
1788
  if (n === void 0) return;
1696
- const s = this.tree.read(t);
1789
+ const s = this.filteredTree.read(t);
1697
1790
  return s.id === n ? s : this._findNode(s.children ?? [], n);
1698
1791
  }));
1699
1792
  /** List of preview rows to render based on current selection and view mode */
1700
- l(this, "selectedFixtures", D(this, (t) => {
1793
+ c(this, "selectedFixtures", V(this, (t) => {
1701
1794
  const n = this.selectedNode.read(t);
1702
1795
  return n ? this.isReportMode ? (this.props.reportModel.state.read(t), this._collectReportRows(n, n.name)) : this.viewMode.read(t) === "diff" && this.daemonAvailable && this.daemon.sessions.read(t).length > 1 ? this._collectDiffRows(n, n.name) : this._collectPreviewRows(n, n.name) : [];
1703
1796
  }));
1704
- l(this, "setViewMode", (t) => {
1797
+ c(this, "setViewMode", (t) => {
1705
1798
  this.viewMode.set(t, void 0);
1706
1799
  });
1707
- l(this, "navigateToSession", (t) => {
1800
+ c(this, "navigateToSession", (t) => {
1708
1801
  const n = this.props.daemonModel;
1709
1802
  if (!n) return;
1710
1803
  const s = n.getSessionExplorerUrl(t);
1711
1804
  s && (window.location.href = s);
1712
1805
  });
1713
- l(this, "toggleLeftSidebar", () => {
1806
+ c(this, "toggleLeftSidebar", () => {
1714
1807
  this.leftSidebarVisible.set(!this.leftSidebarVisible.get(), void 0);
1715
1808
  });
1716
- l(this, "toggleRightSidebar", () => {
1809
+ c(this, "toggleRightSidebar", () => {
1717
1810
  this.rightSidebarVisible.set(!this.rightSidebarVisible.get(), void 0);
1718
1811
  });
1719
- l(this, "toggleTheme", () => {
1812
+ c(this, "toggleTheme", () => {
1720
1813
  this.isDarkTheme.set(!this.isDarkTheme.get(), void 0);
1721
1814
  });
1722
- l(this, "selectNode", (t) => {
1815
+ c(this, "selectNode", (t) => {
1723
1816
  this.selectedNodeId.set(t, void 0);
1724
1817
  });
1725
- l(this, "toggleNodeExpanded", (t) => {
1818
+ c(this, "toggleNodeExpanded", (t) => {
1726
1819
  const n = this.expandedNodeIds.get(), s = new Set(n);
1727
1820
  s.has(t) ? s.delete(t) : s.add(t), this.expandedNodeIds.set(s, void 0);
1728
1821
  });
@@ -1740,7 +1833,15 @@ class gr extends B({
1740
1833
  return this.props.reportModel !== void 0;
1741
1834
  }
1742
1835
  isNodeExpanded(t, n) {
1743
- return this.expandedNodeIds.read(n).has(t);
1836
+ return this.searchQuery.read(n) ? !0 : this.expandedNodeIds.read(n).has(t);
1837
+ }
1838
+ _initialExpandedNodes() {
1839
+ const t = this.selectedNodeId.get();
1840
+ if (!t) return /* @__PURE__ */ new Set([""]);
1841
+ const n = t.split("/"), s = /* @__PURE__ */ new Set([""]);
1842
+ for (let o = 1; o <= n.length; o++)
1843
+ s.add(n.slice(0, o).join("/"));
1844
+ return s;
1744
1845
  }
1745
1846
  _findNode(t, n) {
1746
1847
  for (const s of t) {
@@ -1847,13 +1948,13 @@ class gr extends B({
1847
1948
  }
1848
1949
  const i = [];
1849
1950
  for (const d of t.children ?? []) {
1850
- const c = n ? `${n} / ${d.name}` : d.name;
1851
- i.push(...this._collectReportRows(d, c));
1951
+ const l = n ? `${n} / ${d.name}` : d.name;
1952
+ i.push(...this._collectReportRows(d, l));
1852
1953
  }
1853
1954
  return i;
1854
1955
  }
1855
1956
  }
1856
- const p = {
1957
+ const v = {
1857
1958
  container: {
1858
1959
  display: "flex",
1859
1960
  flexDirection: "row",
@@ -2042,16 +2143,16 @@ const p = {
2042
2143
  cursor: "pointer"
2043
2144
  }
2044
2145
  };
2045
- function Ce(...r) {
2146
+ function Re(...r) {
2046
2147
  return Object.assign({}, ...r.filter(Boolean));
2047
2148
  }
2048
- class mr extends B({
2049
- active: u()
2149
+ class Fr extends B({
2150
+ active: f()
2050
2151
  }) {
2051
2152
  constructor() {
2052
2153
  super(...arguments);
2053
- l(this, "isHovered", w(this, !1));
2054
- l(this, "setHovered", (t) => {
2154
+ c(this, "isHovered", C(this, !1));
2155
+ c(this, "setHovered", (t) => {
2055
2156
  this.isHovered.set(t, void 0);
2056
2157
  });
2057
2158
  }
@@ -2059,18 +2160,18 @@ class mr extends B({
2059
2160
  return this.props.active;
2060
2161
  }
2061
2162
  }
2062
- const oe = A(
2063
- mr,
2163
+ const ie = A(
2164
+ Fr,
2064
2165
  {
2065
- onClick: u.const(),
2066
- title: u.const(),
2067
- children: u.const()
2166
+ onClick: f.const(),
2167
+ title: f.const(),
2168
+ children: f.const()
2068
2169
  },
2069
2170
  (r, e, t) => {
2070
- const n = e.isHovered.read(r), s = e.active.read(r), o = Ce(
2071
- p.titleBarButton,
2072
- n && !s && p.titleBarButtonHover,
2073
- s && p.titleBarButtonActive
2171
+ const n = e.isHovered.read(r), s = e.active.read(r), o = Re(
2172
+ v.titleBarButton,
2173
+ n && !s && v.titleBarButtonHover,
2174
+ s && v.titleBarButtonActive
2074
2175
  );
2075
2176
  return /* @__PURE__ */ a(
2076
2177
  "button",
@@ -2084,20 +2185,20 @@ const oe = A(
2084
2185
  }
2085
2186
  );
2086
2187
  }
2087
- ), vr = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M5.7 13.7L5 13l4.6-4.6L5 3.7l.7-.7 5.3 5.4-5.3 5.3z" }) }), _r = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M11 5.5L6 10.5L5.3 9.8L9.6 5.5L5.3 1.2L6 0.5L11 5.5z", transform: "rotate(90 8 5.5)" }) }), br = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M14.5 2H9l-.35.15-.65.64-.65-.64L7 2H1.5l-.5.5v10l.5.5H7l.35-.15.65-.64.65.64.35.15h5.5l.5-.5v-10l-.5-.5zm-7 10H2V3h5v.86L5.85 5l1.15 1.14V10l-1.15-1.14L7 7.72V12zm6 0H8V7.72l1.15 1.14L8 10V6.14L9.15 5 8 3.86V3h5v9z" }) }), yr = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M14.5 3H7.71l-.85-.85L6.5 2h-5l-.5.5v11l.5.5h13l.5-.5v-10l-.5-.5zm-.5 10H2V6h12v7zm0-8H2V3h4.29l.85.85.36.15H14v1z" }) }), xr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm11 11H6V3h7v10zM3 3h2v10H3V3z" }) }), Sr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm6 11V3h5v10H8zM3 3h4v10H3V3z" }) }), Cr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" }) }), wr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) }), Rr = V(
2088
- { model: u.const() },
2188
+ ), Dr = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M5.7 13.7L5 13l4.6-4.6L5 3.7l.7-.7 5.3 5.4-5.3 5.3z" }) }), Er = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M11 5.5L6 10.5L5.3 9.8L9.6 5.5L5.3 1.2L6 0.5L11 5.5z", transform: "rotate(90 8 5.5)" }) }), Br = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M14.5 2H9l-.35.15-.65.64-.65-.64L7 2H1.5l-.5.5v10l.5.5H7l.35-.15.65-.64.65.64.35.15h5.5l.5-.5v-10l-.5-.5zm-7 10H2V3h5v.86L5.85 5l1.15 1.14V10l-1.15-1.14L7 7.72V12zm6 0H8V7.72l1.15 1.14L8 10V6.14L9.15 5 8 3.86V3h5v9z" }) }), Ar = ({ style: r }) => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", style: r, children: /* @__PURE__ */ a("path", { d: "M14.5 3H7.71l-.85-.85L6.5 2h-5l-.5.5v11l.5.5h13l.5-.5v-10l-.5-.5zm-.5 10H2V6h12v7zm0-8H2V3h4.29l.85.85.36.15H14v1z" }) }), $r = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm11 11H6V3h7v10zM3 3h2v10H3V3z" }) }), zr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M2 2v12h12V2H2zm6 11V3h5v10H8zM3 3h4v10H3V3z" }) }), Lr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z" }) }), Hr = () => /* @__PURE__ */ a("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z" }) }), Pr = O(
2189
+ { model: f.const() },
2089
2190
  (r, e) => {
2090
- var d, c;
2091
- const t = e.model, n = t.viewMode.read(r), s = ((d = t.daemon) == null ? void 0 : d.sessions.read(r)) ?? [], o = (c = t.daemon) == null ? void 0 : c.sessionName, i = s.filter((h) => h.name !== o);
2092
- return s.length <= 1 ? null : /* @__PURE__ */ f("div", { style: J.container, children: [
2093
- /* @__PURE__ */ f("div", { style: J.segmentedControl, children: [
2094
- /* @__PURE__ */ a(Be, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
2095
- /* @__PURE__ */ a(Be, { label: "Diff", mode: "diff", active: n === "diff", onClick: () => t.setViewMode("diff") })
2191
+ var d, l;
2192
+ const t = e.model, n = t.viewMode.read(r), s = ((d = t.daemon) == null ? void 0 : d.sessions.read(r)) ?? [], o = (l = t.daemon) == null ? void 0 : l.sessionName, i = s.filter((h) => h.name !== o);
2193
+ return s.length <= 1 ? null : /* @__PURE__ */ m("div", { style: Q.container, children: [
2194
+ /* @__PURE__ */ m("div", { style: Q.segmentedControl, children: [
2195
+ /* @__PURE__ */ a(Le, { label: "Live", mode: "session", active: n === "session", onClick: () => t.setViewMode("session") }),
2196
+ /* @__PURE__ */ a(Le, { label: "Diff", mode: "diff", active: n === "diff", onClick: () => t.setViewMode("diff") })
2096
2197
  ] }),
2097
- i.length > 0 && /* @__PURE__ */ a("div", { style: J.sessionLinks, children: i.map((h) => /* @__PURE__ */ f(
2198
+ i.length > 0 && /* @__PURE__ */ a("div", { style: Q.sessionLinks, children: i.map((h) => /* @__PURE__ */ m(
2098
2199
  "button",
2099
2200
  {
2100
- style: J.sessionLink,
2201
+ style: Q.sessionLink,
2101
2202
  onClick: () => t.navigateToSession(h.name),
2102
2203
  title: `Switch to ${h.name} session`,
2103
2204
  children: [
@@ -2110,63 +2211,63 @@ const oe = A(
2110
2211
  ] });
2111
2212
  }
2112
2213
  );
2113
- function Be({ label: r, mode: e, active: t, onClick: n }) {
2214
+ function Le({ label: r, mode: e, active: t, onClick: n }) {
2114
2215
  return /* @__PURE__ */ a(
2115
2216
  "button",
2116
2217
  {
2117
- style: t ? J.segmentActive : J.segment,
2218
+ style: t ? Q.segmentActive : Q.segment,
2118
2219
  onClick: n,
2119
2220
  children: r
2120
2221
  }
2121
2222
  );
2122
2223
  }
2123
- const Tr = V(
2224
+ const jr = O(
2124
2225
  {
2125
- model: u.const()
2226
+ model: f.const()
2126
2227
  },
2127
2228
  (r, e) => {
2128
2229
  const t = e.model, n = t.leftSidebarVisible.read(r), s = t.rightSidebarVisible.read(r), o = t.isDarkTheme.read(r), i = t.selectedNode.read(r);
2129
- return /* @__PURE__ */ f("div", { style: p.titleBar, children: [
2130
- /* @__PURE__ */ a("div", { style: p.titleBarSection, children: /* @__PURE__ */ a(
2131
- oe,
2230
+ return /* @__PURE__ */ m("div", { style: v.titleBar, children: [
2231
+ /* @__PURE__ */ a("div", { style: v.titleBarSection, children: /* @__PURE__ */ a(
2232
+ ie,
2132
2233
  {
2133
2234
  active: n,
2134
2235
  onClick: t.toggleLeftSidebar,
2135
2236
  title: "Toggle left sidebar",
2136
- children: /* @__PURE__ */ a(xr, {})
2237
+ children: /* @__PURE__ */ a($r, {})
2137
2238
  }
2138
2239
  ) }),
2139
- /* @__PURE__ */ f("div", { style: p.titleBarCenter, children: [
2140
- t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(Rr, { model: t }) : null,
2141
- i ? /* @__PURE__ */ f(ge, { children: [
2240
+ /* @__PURE__ */ m("div", { style: v.titleBarCenter, children: [
2241
+ t.isReportMode ? /* @__PURE__ */ a("span", { style: { fontSize: 12, color: "var(--vscode-descriptionForeground)" }, children: "Screenshot Report" }) : t.daemonAvailable ? /* @__PURE__ */ a(Pr, { model: t }) : null,
2242
+ i ? /* @__PURE__ */ m(ve, { children: [
2142
2243
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "<" }),
2143
2244
  /* @__PURE__ */ a("span", { children: i.name }),
2144
2245
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-textLink-foreground)" }, children: "/>" })
2145
2246
  ] }) : /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: "No component selected" })
2146
2247
  ] }),
2147
- /* @__PURE__ */ f("div", { style: p.titleBarSection, children: [
2248
+ /* @__PURE__ */ m("div", { style: v.titleBarSection, children: [
2148
2249
  /* @__PURE__ */ a(
2149
- oe,
2250
+ ie,
2150
2251
  {
2151
2252
  active: !1,
2152
2253
  onClick: t.toggleTheme,
2153
2254
  title: o ? "Switch to light theme" : "Switch to dark theme",
2154
- children: o ? /* @__PURE__ */ a(Cr, {}) : /* @__PURE__ */ a(wr, {})
2255
+ children: o ? /* @__PURE__ */ a(Lr, {}) : /* @__PURE__ */ a(Hr, {})
2155
2256
  }
2156
2257
  ),
2157
2258
  /* @__PURE__ */ a(
2158
- oe,
2259
+ ie,
2159
2260
  {
2160
2261
  active: s,
2161
2262
  onClick: t.toggleRightSidebar,
2162
2263
  title: "Toggle right sidebar",
2163
- children: /* @__PURE__ */ a(Sr, {})
2264
+ children: /* @__PURE__ */ a(zr, {})
2164
2265
  }
2165
2266
  )
2166
2267
  ] })
2167
2268
  ] });
2168
2269
  }
2169
- ), J = {
2270
+ ), Q = {
2170
2271
  container: {
2171
2272
  display: "flex",
2172
2273
  alignItems: "center",
@@ -2210,32 +2311,51 @@ const Tr = V(
2210
2311
  color: "var(--vscode-textLink-foreground)",
2211
2312
  cursor: "pointer"
2212
2313
  }
2213
- }, it = V(
2314
+ }, Ur = {
2315
+ display: "flex",
2316
+ gap: "3px",
2317
+ marginLeft: "6px",
2318
+ overflow: "hidden",
2319
+ flexShrink: 1,
2320
+ minWidth: 0
2321
+ }, Wr = {
2322
+ fontSize: "10px",
2323
+ lineHeight: "14px",
2324
+ padding: "0 4px",
2325
+ borderRadius: "2px",
2326
+ backgroundColor: "var(--vscode-badge-background)",
2327
+ color: "var(--vscode-badge-foreground)",
2328
+ whiteSpace: "nowrap",
2329
+ overflow: "hidden",
2330
+ textOverflow: "ellipsis",
2331
+ maxWidth: "60px",
2332
+ cursor: "pointer"
2333
+ }, bt = O(
2214
2334
  {
2215
- model: u.const(),
2216
- nodes: u.const(),
2217
- depth: u.const()
2335
+ model: f.const(),
2336
+ nodes: f.const(),
2337
+ depth: f.const()
2218
2338
  },
2219
- (r, e) => /* @__PURE__ */ a(ge, { children: e.nodes.map((t) => /* @__PURE__ */ a(Or, { model: e.model, node: t, depth: e.depth }, t.id)) })
2339
+ (r, e) => /* @__PURE__ */ a(ve, { children: e.nodes.map((t) => /* @__PURE__ */ a(qr, { model: e.model, node: t, depth: e.depth }, t.id)) })
2220
2340
  );
2221
- class Ir extends B({
2222
- model: u.const(),
2223
- node: u.const(),
2224
- depth: u.const()
2341
+ class Gr extends B({
2342
+ model: f.const(),
2343
+ node: f.const(),
2344
+ depth: f.const()
2225
2345
  }) {
2226
2346
  constructor() {
2227
2347
  super(...arguments);
2228
- l(this, "isHovered", w(this, !1));
2229
- l(this, "setHovered", (t) => {
2348
+ c(this, "isHovered", C(this, !1));
2349
+ c(this, "setHovered", (t) => {
2230
2350
  this.isHovered.set(t, void 0);
2231
2351
  });
2232
- l(this, "handleClick", () => {
2352
+ c(this, "handleClick", () => {
2233
2353
  this.props.model.selectNode(this.props.node.id);
2234
2354
  });
2235
- l(this, "handleDoubleClick", () => {
2355
+ c(this, "handleDoubleClick", () => {
2236
2356
  this._hasChildren && this.props.model.toggleNodeExpanded(this.props.node.id);
2237
2357
  });
2238
- l(this, "handleChevronClick", (t) => {
2358
+ c(this, "handleChevronClick", (t) => {
2239
2359
  t.stopPropagation(), this.props.model.toggleNodeExpanded(this.props.node.id);
2240
2360
  });
2241
2361
  }
@@ -2253,54 +2373,130 @@ class Ir extends B({
2253
2373
  return !!(this.props.node.children && this.props.node.children.length > 0);
2254
2374
  }
2255
2375
  }
2256
- const Or = A(Ir, {}, (r, e) => {
2257
- const t = e.explorerModel, n = e.treeNode, s = e.treeDepth, o = !!(n.children && n.children.length > 0), i = o ? t.isNodeExpanded(n.id, r) : !1, c = t.selectedNodeId.read(r) === n.id, h = e.isHovered.read(r), m = Ce(
2258
- p.treeItem,
2376
+ const qr = A(Gr, {}, (r, e) => {
2377
+ const t = e.explorerModel, n = e.treeNode, s = e.treeDepth, o = !!(n.children && n.children.length > 0), i = o ? t.isNodeExpanded(n.id, r) : !1, l = t.selectedNodeId.read(r) === n.id, h = e.isHovered.read(r), u = Re(
2378
+ v.treeItem,
2259
2379
  { paddingLeft: `${8 + s * 12}px` },
2260
- c && p.treeItemSelected,
2261
- !c && h && p.treeItemHover
2380
+ l && v.treeItemSelected,
2381
+ !l && h && v.treeItemHover
2262
2382
  );
2263
- return /* @__PURE__ */ f(ge, { children: [
2264
- /* @__PURE__ */ f(
2383
+ return /* @__PURE__ */ m(ve, { children: [
2384
+ /* @__PURE__ */ m(
2265
2385
  "div",
2266
2386
  {
2267
- style: m,
2387
+ style: u,
2268
2388
  onClick: e.handleClick,
2269
2389
  onDoubleClick: e.handleDoubleClick,
2270
2390
  onMouseEnter: () => e.setHovered(!0),
2271
2391
  onMouseLeave: () => e.setHovered(!1),
2272
2392
  children: [
2273
- o ? /* @__PURE__ */ a("div", { style: p.treeItemChevron, onClick: e.handleChevronClick, children: i ? /* @__PURE__ */ a(_r, {}) : /* @__PURE__ */ a(vr, {}) }) : /* @__PURE__ */ a("div", { style: p.treeItemChevronPlaceholder }),
2274
- /* @__PURE__ */ a("div", { style: p.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(yr, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(br, { style: { color: "#deb45b" } }) }),
2275
- /* @__PURE__ */ a("span", { style: p.treeItemLabel, children: n.name }),
2276
- o && /* @__PURE__ */ a("span", { style: p.treeItemCount, children: n.children.length })
2393
+ o ? /* @__PURE__ */ a("div", { style: v.treeItemChevron, onClick: e.handleChevronClick, children: i ? /* @__PURE__ */ a(Er, {}) : /* @__PURE__ */ a(Dr, {}) }) : /* @__PURE__ */ a("div", { style: v.treeItemChevronPlaceholder }),
2394
+ /* @__PURE__ */ a("div", { style: v.treeItemIcon, children: n.type === "folder" ? /* @__PURE__ */ a(Ar, { style: { color: "var(--vscode-symbolIcon-folderForeground)" } }) : /* @__PURE__ */ a(Br, { style: { color: "#deb45b" } }) }),
2395
+ /* @__PURE__ */ a("span", { style: v.treeItemLabel, children: n.name }),
2396
+ n.labels.some((g) => !g.startsWith(".")) && /* @__PURE__ */ a("span", { style: Ur, children: n.labels.filter((g) => !g.startsWith(".")).map((g) => /* @__PURE__ */ a(
2397
+ "span",
2398
+ {
2399
+ style: Wr,
2400
+ onClick: (b) => {
2401
+ b.stopPropagation(), t.searchQuery.set(g, void 0);
2402
+ },
2403
+ title: g,
2404
+ children: g
2405
+ },
2406
+ g
2407
+ )) }),
2408
+ o && /* @__PURE__ */ a("span", { style: v.treeItemCount, children: n.children.length })
2277
2409
  ]
2278
2410
  }
2279
2411
  ),
2280
- o && i && /* @__PURE__ */ a(it, { model: t, nodes: n.children, depth: s + 1 })
2412
+ o && i && /* @__PURE__ */ a(bt, { model: t, nodes: n.children, depth: s + 1 })
2281
2413
  ] });
2282
- }), kr = V(
2414
+ }), Kr = {
2415
+ padding: "4px 8px",
2416
+ borderBottom: "1px solid var(--vscode-panel-border)"
2417
+ }, Jr = {
2418
+ width: "100%",
2419
+ height: "24px",
2420
+ padding: "0 22px 0 6px",
2421
+ fontSize: "12px",
2422
+ color: "var(--vscode-input-foreground)",
2423
+ backgroundColor: "var(--vscode-input-background)",
2424
+ border: "1px solid var(--vscode-input-border, transparent)",
2425
+ borderRadius: "2px",
2426
+ outline: "none",
2427
+ boxSizing: "border-box"
2428
+ }, Qr = {
2429
+ position: "relative"
2430
+ }, Zr = {
2431
+ position: "absolute",
2432
+ right: "2px",
2433
+ top: "50%",
2434
+ transform: "translateY(-50%)",
2435
+ display: "flex",
2436
+ alignItems: "center",
2437
+ justifyContent: "center",
2438
+ width: "18px",
2439
+ height: "18px",
2440
+ border: "none",
2441
+ background: "transparent",
2442
+ color: "var(--vscode-input-foreground)",
2443
+ cursor: "pointer",
2444
+ borderRadius: "2px",
2445
+ fontSize: "14px",
2446
+ opacity: 0.7
2447
+ }, Xr = O(
2448
+ {
2449
+ model: f.const()
2450
+ },
2451
+ (r, e) => {
2452
+ const t = e.model.searchQuery.read(r);
2453
+ return /* @__PURE__ */ a("div", { style: Kr, children: /* @__PURE__ */ m("div", { style: Qr, children: [
2454
+ /* @__PURE__ */ a(
2455
+ "input",
2456
+ {
2457
+ type: "text",
2458
+ placeholder: "Filter (name or label)",
2459
+ style: Jr,
2460
+ value: t ?? "",
2461
+ onChange: (n) => e.model.searchQuery.set(n.target.value || void 0, void 0),
2462
+ onFocus: (n) => n.target.style.borderColor = "var(--vscode-focusBorder)",
2463
+ onBlur: (n) => n.target.style.borderColor = "var(--vscode-input-border, transparent)"
2464
+ }
2465
+ ),
2466
+ t && /* @__PURE__ */ a(
2467
+ "button",
2468
+ {
2469
+ style: Zr,
2470
+ onClick: () => e.model.searchQuery.set(void 0, void 0),
2471
+ title: "Clear filter",
2472
+ children: "×"
2473
+ }
2474
+ )
2475
+ ] }) });
2476
+ }
2477
+ ), Yr = O(
2283
2478
  {
2284
- model: u.const()
2479
+ model: f.const()
2285
2480
  },
2286
2481
  (r, e) => {
2287
- const t = e.model.tree.read(r);
2288
- return /* @__PURE__ */ f("div", { style: p.sidebar, children: [
2289
- /* @__PURE__ */ a("div", { style: p.sidebarHeader, children: "Explorer" }),
2290
- /* @__PURE__ */ a("div", { style: p.sidebarContent, children: /* @__PURE__ */ a(it, { model: e.model, nodes: [t], depth: 0 }) })
2482
+ const t = e.model.filteredTree.read(r);
2483
+ return /* @__PURE__ */ m("div", { style: v.sidebar, children: [
2484
+ /* @__PURE__ */ a("div", { style: v.sidebarHeader, children: "Explorer" }),
2485
+ /* @__PURE__ */ a(Xr, { model: e.model }),
2486
+ /* @__PURE__ */ a("div", { style: v.sidebarContent, children: /* @__PURE__ */ a(bt, { model: e.model, nodes: [t], depth: 0 }) })
2291
2487
  ] });
2292
2488
  }
2293
2489
  );
2294
- class Vr extends B({}) {
2490
+ class en extends B({}) {
2295
2491
  constructor() {
2296
2492
  super(...arguments);
2297
- l(this, "checked", w(this, !1));
2298
- l(this, "toggle", () => {
2493
+ c(this, "checked", C(this, !1));
2494
+ c(this, "toggle", () => {
2299
2495
  this.checked.set(!this.checked.get(), void 0);
2300
2496
  });
2301
2497
  }
2302
2498
  }
2303
- const Nr = A(Vr, {}, (r, e) => {
2499
+ const tn = A(en, {}, (r, e) => {
2304
2500
  const t = e.checked.read(r), n = {
2305
2501
  position: "relative",
2306
2502
  width: "36px",
@@ -2321,13 +2517,13 @@ const Nr = A(Vr, {}, (r, e) => {
2321
2517
  transition: "left 0.2s"
2322
2518
  };
2323
2519
  return /* @__PURE__ */ a("div", { style: n, onClick: e.toggle, children: /* @__PURE__ */ a("div", { style: s }) });
2324
- }), Mr = V(
2520
+ }), rn = O(
2325
2521
  {
2326
- node: u.const()
2522
+ node: f.const()
2327
2523
  },
2328
- (r, e) => e.node.type !== "component" ? /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component (not a folder) to view its properties" }) : /* @__PURE__ */ f("div", { style: p.propertiesPanel, children: [
2329
- /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2330
- /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2524
+ (r, e) => e.node.type !== "component" ? /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component (not a folder) to view its properties" }) : /* @__PURE__ */ m("div", { style: v.propertiesPanel, children: [
2525
+ /* @__PURE__ */ m("div", { style: v.propertyRow, children: [
2526
+ /* @__PURE__ */ m("div", { style: v.propertyLabel, children: [
2331
2527
  "children",
2332
2528
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : string" })
2333
2529
  ] }),
@@ -2335,82 +2531,90 @@ const Nr = A(Vr, {}, (r, e) => {
2335
2531
  "input",
2336
2532
  {
2337
2533
  type: "text",
2338
- style: p.propertyInput,
2534
+ style: v.propertyInput,
2339
2535
  defaultValue: "Click me",
2340
2536
  placeholder: "Enter text..."
2341
2537
  }
2342
2538
  ),
2343
- /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button text content" })
2539
+ /* @__PURE__ */ a("div", { style: v.propertyDescription, children: "Button text content" })
2344
2540
  ] }),
2345
- /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2346
- /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2541
+ /* @__PURE__ */ m("div", { style: v.propertyRow, children: [
2542
+ /* @__PURE__ */ m("div", { style: v.propertyLabel, children: [
2347
2543
  "variant",
2348
2544
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
2349
2545
  ] }),
2350
- /* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
2546
+ /* @__PURE__ */ m("select", { style: v.propertySelect, defaultValue: "default", children: [
2351
2547
  /* @__PURE__ */ a("option", { value: "default", children: "default" }),
2352
2548
  /* @__PURE__ */ a("option", { value: "primary", children: "primary" }),
2353
2549
  /* @__PURE__ */ a("option", { value: "secondary", children: "secondary" }),
2354
2550
  /* @__PURE__ */ a("option", { value: "destructive", children: "destructive" })
2355
2551
  ] }),
2356
- /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Visual style variant" })
2552
+ /* @__PURE__ */ a("div", { style: v.propertyDescription, children: "Visual style variant" })
2357
2553
  ] }),
2358
- /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2359
- /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2554
+ /* @__PURE__ */ m("div", { style: v.propertyRow, children: [
2555
+ /* @__PURE__ */ m("div", { style: v.propertyLabel, children: [
2360
2556
  "size",
2361
2557
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : select" })
2362
2558
  ] }),
2363
- /* @__PURE__ */ f("select", { style: p.propertySelect, defaultValue: "default", children: [
2559
+ /* @__PURE__ */ m("select", { style: v.propertySelect, defaultValue: "default", children: [
2364
2560
  /* @__PURE__ */ a("option", { value: "sm", children: "sm" }),
2365
2561
  /* @__PURE__ */ a("option", { value: "default", children: "default" }),
2366
2562
  /* @__PURE__ */ a("option", { value: "lg", children: "lg" })
2367
2563
  ] }),
2368
- /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Button size" })
2564
+ /* @__PURE__ */ a("div", { style: v.propertyDescription, children: "Button size" })
2369
2565
  ] }),
2370
- /* @__PURE__ */ f("div", { style: p.propertyRow, children: [
2371
- /* @__PURE__ */ f("div", { style: p.propertyLabel, children: [
2566
+ /* @__PURE__ */ m("div", { style: v.propertyRow, children: [
2567
+ /* @__PURE__ */ m("div", { style: v.propertyLabel, children: [
2372
2568
  "disabled",
2373
2569
  /* @__PURE__ */ a("span", { style: { color: "var(--vscode-descriptionForeground)" }, children: " : boolean" })
2374
2570
  ] }),
2375
- /* @__PURE__ */ a(Nr, {}),
2376
- /* @__PURE__ */ a("div", { style: p.propertyDescription, children: "Disable the button" })
2571
+ /* @__PURE__ */ a(tn, {}),
2572
+ /* @__PURE__ */ a("div", { style: v.propertyDescription, children: "Disable the button" })
2377
2573
  ] })
2378
2574
  ] })
2379
- ), Dr = V(
2575
+ ), nn = O(
2380
2576
  {
2381
- selectedNode: u.const()
2577
+ selectedNode: f.const()
2382
2578
  },
2383
- (r, e) => /* @__PURE__ */ f("div", { style: Ce(p.sidebar, p.sidebarRight), children: [
2384
- /* @__PURE__ */ f("div", { style: p.sidebarHeader, children: [
2579
+ (r, e) => /* @__PURE__ */ m("div", { style: Re(v.sidebar, v.sidebarRight), children: [
2580
+ /* @__PURE__ */ m("div", { style: v.sidebarHeader, children: [
2385
2581
  /* @__PURE__ */ a("span", { style: { marginRight: "6px", color: "var(--vscode-textLink-foreground)" }, children: "</>" }),
2386
2582
  "Props"
2387
2583
  ] }),
2388
- /* @__PURE__ */ a("div", { style: p.sidebarContent, children: e.selectedNode ? /* @__PURE__ */ a(Mr, { node: e.selectedNode }) : /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component to view its properties" }) })
2584
+ /* @__PURE__ */ a("div", { style: v.sidebarContent, children: e.selectedNode ? /* @__PURE__ */ a(rn, { node: e.selectedNode }) : /* @__PURE__ */ a("div", { style: { padding: "12px", color: "var(--vscode-descriptionForeground)", fontSize: "12px" }, children: "Select a component to view its properties" }) })
2389
2585
  ] })
2390
- );
2391
- class Fr extends B({
2392
- fixture: u.const(),
2393
- compact: u.const()
2586
+ ), _t = /* @__PURE__ */ new WeakSet(), He = HTMLElement.prototype.focus;
2587
+ HTMLElement.prototype.focus = function(r) {
2588
+ const e = this.getRootNode();
2589
+ e instanceof ShadowRoot && _t.has(e) && !(r != null && r.preventScroll) ? He.call(this, { ...r, preventScroll: !0 }) : He.call(this, r);
2590
+ };
2591
+ function sn(r) {
2592
+ _t.add(r);
2593
+ }
2594
+ class on extends B({
2595
+ fixture: f.const(),
2596
+ compact: f.const(),
2597
+ onSelect: f.const()
2394
2598
  }) {
2395
2599
  constructor() {
2396
2600
  super(...arguments);
2397
- l(this, "_containerRef", null);
2398
- l(this, "_shadowRoot", null);
2399
- l(this, "_renderContainer", null);
2400
- l(this, "_renderResult", null);
2401
- l(this, "_abortController", null);
2402
- l(this, "_resizeObserver", null);
2403
- l(this, "measuredWidth", w(this, void 0));
2404
- l(this, "measuredHeight", w(this, void 0));
2405
- l(this, "setContainerRef", (t) => {
2601
+ c(this, "_containerRef", null);
2602
+ c(this, "_shadowRoot", null);
2603
+ c(this, "_renderContainer", null);
2604
+ c(this, "_renderResult", null);
2605
+ c(this, "_abortController", null);
2606
+ c(this, "_resizeObserver", null);
2607
+ c(this, "measuredWidth", C(this, void 0));
2608
+ c(this, "measuredHeight", C(this, void 0));
2609
+ c(this, "setContainerRef", (t) => {
2406
2610
  if (t === this._containerRef || (this._cleanup(), this._containerRef = t, !t)) return;
2407
2611
  const n = this.fixture.component;
2408
2612
  n.isolation === "shadow-dom" ? this._renderInShadowDom(t, n) : this._renderDirect(t, n);
2409
2613
  const s = this._renderContainer ?? t;
2410
2614
  this._resizeObserver = new ResizeObserver((o) => {
2411
2615
  for (const i of o) {
2412
- const { width: d, height: c } = i.contentRect;
2413
- c > 0 && (this.measuredWidth.set(Math.round(d), void 0), this.measuredHeight.set(Math.round(c), void 0));
2616
+ const { width: d, height: l } = i.contentRect;
2617
+ l > 0 && (this.measuredWidth.set(Math.round(d), void 0), this.measuredHeight.set(Math.round(l), void 0));
2414
2618
  }
2415
2619
  }), this._resizeObserver.observe(s);
2416
2620
  });
@@ -2421,6 +2625,9 @@ class Fr extends B({
2421
2625
  get compact() {
2422
2626
  return this.props.compact ?? !1;
2423
2627
  }
2628
+ get onSelect() {
2629
+ return this.props.onSelect;
2630
+ }
2424
2631
  _renderInShadowDom(t, n) {
2425
2632
  if (t.shadowRoot) {
2426
2633
  for (this._shadowRoot = t.shadowRoot; this._shadowRoot.firstChild; )
@@ -2428,7 +2635,7 @@ class Fr extends B({
2428
2635
  this._shadowRoot.adoptedStyleSheets = [];
2429
2636
  } else
2430
2637
  this._shadowRoot = t.attachShadow({ mode: "open" });
2431
- if (n.styles)
2638
+ if (sn(this._shadowRoot), n.styles)
2432
2639
  for (const i of n.styles)
2433
2640
  if (i.type === "css") {
2434
2641
  const d = document.createElement("style");
@@ -2476,34 +2683,44 @@ class Fr extends B({
2476
2683
  this._cleanup();
2477
2684
  }
2478
2685
  }
2479
- const at = A(
2480
- Fr,
2686
+ const yt = A(
2687
+ on,
2481
2688
  {},
2482
2689
  (r, e) => {
2483
2690
  const t = e.fixture, n = t.component, s = n.displayMode, o = e.measuredWidth.read(r), i = e.measuredHeight.read(r), d = e.compact;
2484
- let c;
2691
+ let l;
2485
2692
  if (s.type === "page") {
2486
- const R = s.viewports[0], g = wt(R);
2487
- c = {
2488
- width: g.width,
2489
- height: g.height,
2693
+ const b = s.viewports[0], p = $t(b);
2694
+ l = {
2695
+ width: p.width,
2696
+ height: p.height,
2490
2697
  overflow: "auto"
2491
2698
  };
2492
2699
  } else
2493
- c = {
2700
+ l = {
2494
2701
  display: "inline-block"
2495
2702
  };
2496
- const h = o && i ? `${o} × ${i}` : "", m = d ? G.wrapperCompact : G.wrapper, v = d ? G.nameCompact : G.name;
2497
- return /* @__PURE__ */ f("div", { style: m, children: [
2498
- /* @__PURE__ */ f("div", { style: G.labelRow, children: [
2499
- /* @__PURE__ */ a("span", { style: v, children: t.name }),
2500
- !d && h && /* @__PURE__ */ a("span", { style: G.dimensions, children: h })
2703
+ const h = o && i ? `${o} × ${i}` : "", u = d ? q.wrapperCompact : q.wrapper, g = d ? q.nameCompact : q.name;
2704
+ return /* @__PURE__ */ m("div", { style: u, children: [
2705
+ /* @__PURE__ */ m("div", { style: q.labelRow, children: [
2706
+ d && /* @__PURE__ */ a(
2707
+ "a",
2708
+ {
2709
+ href: vt("component", t.id),
2710
+ style: { ...g, textDecoration: "none", color: "inherit" },
2711
+ onClick: (b) => {
2712
+ e.onSelect && (b.preventDefault(), e.onSelect(t.id));
2713
+ },
2714
+ children: t.name
2715
+ }
2716
+ ),
2717
+ !d && h && /* @__PURE__ */ a("span", { style: q.dimensions, children: h })
2501
2718
  ] }),
2502
- /* @__PURE__ */ a("div", { style: zr(n.background), children: /* @__PURE__ */ a("div", { ref: e.setContainerRef, style: c }) })
2719
+ /* @__PURE__ */ a("div", { style: cn(n.background), children: /* @__PURE__ */ a("div", { ref: e.setContainerRef, style: l }) })
2503
2720
  ] });
2504
2721
  }
2505
- ), W = 8;
2506
- function dt(r, e) {
2722
+ ), G = 8;
2723
+ function xt(r, e) {
2507
2724
  return `
2508
2725
  linear-gradient(45deg, ${e} 25%, transparent 25%),
2509
2726
  linear-gradient(-45deg, ${e} 25%, transparent 25%),
@@ -2511,31 +2728,31 @@ function dt(r, e) {
2511
2728
  linear-gradient(-45deg, transparent 75%, ${e} 75%)
2512
2729
  `;
2513
2730
  }
2514
- const Er = {
2731
+ const an = {
2515
2732
  backgroundColor: "#ffffff",
2516
- backgroundImage: dt("#ffffff", "#e5e5e5")
2517
- }, Br = {
2733
+ backgroundImage: xt("#ffffff", "#e5e5e5")
2734
+ }, dn = {
2518
2735
  backgroundColor: "#1e1e1e",
2519
- backgroundImage: dt("#1e1e1e", "#2d2d2d")
2520
- }, Ar = {
2736
+ backgroundImage: xt("#1e1e1e", "#2d2d2d")
2737
+ }, ln = {
2521
2738
  display: "inline-block",
2522
2739
  padding: "12px",
2523
2740
  borderRadius: "4px",
2524
- backgroundSize: `${W * 2}px ${W * 2}px`,
2525
- backgroundPosition: `0 0, 0 ${W}px, ${W}px -${W}px, -${W}px 0`,
2741
+ backgroundSize: `${G * 2}px ${G * 2}px`,
2742
+ backgroundPosition: `0 0, 0 ${G}px, ${G}px -${G}px, -${G}px 0`,
2526
2743
  boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)",
2527
2744
  overflow: "hidden",
2528
2745
  position: "relative"
2529
2746
  };
2530
- function zr(r) {
2531
- const e = r === "dark" ? Br : Er;
2747
+ function cn(r) {
2748
+ const e = r === "dark" ? dn : an;
2532
2749
  return {
2533
- ...Ar,
2750
+ ...ln,
2534
2751
  backgroundColor: e.backgroundColor,
2535
2752
  backgroundImage: e.backgroundImage
2536
2753
  };
2537
2754
  }
2538
- const G = {
2755
+ const q = {
2539
2756
  wrapper: {
2540
2757
  marginBottom: "32px"
2541
2758
  },
@@ -2564,16 +2781,16 @@ const G = {
2564
2781
  fontFamily: "var(--vscode-editor-font-family, monospace)"
2565
2782
  }
2566
2783
  };
2567
- class $r extends B({
2568
- fixtureId: u.const(),
2569
- sessionName: u.const(),
2570
- daemon: u.const()
2784
+ class hn extends B({
2785
+ fixtureId: f.const(),
2786
+ sessionName: f.const(),
2787
+ daemon: f.const()
2571
2788
  }) {
2572
2789
  constructor(t) {
2573
2790
  super(t);
2574
- l(this, "screenshot", w(this, { status: "idle" }));
2575
- l(this, "_fetchVersion", 0);
2576
- this._store.add(Qe((n) => {
2791
+ c(this, "screenshot", C(this, { status: "idle" }));
2792
+ c(this, "_fetchVersion", 0);
2793
+ this._store.add(lt((n) => {
2577
2794
  this.props.daemon.sourceTreeIds.read(n).get(this.props.sessionName) && this._fetchScreenshot();
2578
2795
  }));
2579
2796
  }
@@ -2591,26 +2808,26 @@ class $r extends B({
2591
2808
  }
2592
2809
  }
2593
2810
  }
2594
- const Ae = A(
2595
- $r,
2811
+ const Pe = A(
2812
+ hn,
2596
2813
  {},
2597
2814
  (r, e) => {
2598
2815
  const t = e.screenshot.read(r);
2599
2816
  if (t.status === "idle" || t.status === "loading")
2600
- return /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("div", { style: z.shimmer }) });
2817
+ return /* @__PURE__ */ a("div", { style: $.placeholder, children: /* @__PURE__ */ a("div", { style: $.shimmer }) });
2601
2818
  if (t.status === "error")
2602
- return /* @__PURE__ */ a("div", { style: z.error, children: /* @__PURE__ */ a("span", { style: z.errorText, children: "Screenshot failed" }) });
2819
+ return /* @__PURE__ */ a("div", { style: $.error, children: /* @__PURE__ */ a("span", { style: $.errorText, children: "Screenshot failed" }) });
2603
2820
  const { data: n } = t;
2604
2821
  return n.image ? /* @__PURE__ */ a(
2605
2822
  "img",
2606
2823
  {
2607
2824
  src: `data:image/png;base64,${n.image}`,
2608
- style: z.image,
2825
+ style: $.image,
2609
2826
  alt: `Screenshot of ${e.fixtureId}`
2610
2827
  }
2611
- ) : /* @__PURE__ */ a("div", { style: z.placeholder, children: /* @__PURE__ */ a("span", { style: z.hashText, children: n.hash.slice(0, 12) }) });
2828
+ ) : /* @__PURE__ */ a("div", { style: $.placeholder, children: /* @__PURE__ */ a("span", { style: $.hashText, children: n.hash.slice(0, 12) }) });
2612
2829
  }
2613
- ), z = {
2830
+ ), $ = {
2614
2831
  placeholder: {
2615
2832
  minHeight: 80,
2616
2833
  display: "flex",
@@ -2653,16 +2870,16 @@ const Ae = A(
2653
2870
  border: "1px solid var(--vscode-panel-border)"
2654
2871
  }
2655
2872
  };
2656
- class Lr extends B({
2657
- fixtureId: u.const(),
2658
- daemon: u.const(),
2659
- baselineSession: u.const(),
2660
- currentSession: u.const()
2873
+ class un extends B({
2874
+ fixtureId: f.const(),
2875
+ daemon: f.const(),
2876
+ baselineSession: f.const(),
2877
+ currentSession: f.const()
2661
2878
  }) {
2662
2879
  constructor(t) {
2663
2880
  super(t);
2664
- l(this, "comparisonStatus", w(this, { status: "loading" }));
2665
- this._store.add(Qe((n) => {
2881
+ c(this, "comparisonStatus", C(this, { status: "loading" }));
2882
+ this._store.add(lt((n) => {
2666
2883
  const s = this.props.daemon.sourceTreeIds.read(n), o = s.get(this.props.baselineSession), i = s.get(this.props.currentSession);
2667
2884
  o && i && this._fetchComparison();
2668
2885
  }));
@@ -2693,21 +2910,21 @@ class Lr extends B({
2693
2910
  }
2694
2911
  }
2695
2912
  }
2696
- const Hr = A(
2697
- Lr,
2913
+ const pn = A(
2914
+ un,
2698
2915
  {},
2699
2916
  (r, e) => {
2700
- const t = e.comparisonStatus.read(r), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: T.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: T.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: T.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: T.badgeChanged, children: "● changed" });
2701
- return /* @__PURE__ */ f("div", { style: T.fixtureRow, children: [
2702
- /* @__PURE__ */ f("div", { style: T.fixtureLabel, children: [
2703
- /* @__PURE__ */ a("span", { style: T.fixtureName, children: e.fixtureId }),
2917
+ const t = e.comparisonStatus.read(r), n = t.status === "loading" ? /* @__PURE__ */ a("span", { style: k.badgeLoading, children: "comparing..." }) : t.status === "error" ? /* @__PURE__ */ a("span", { style: k.badgeError, children: "error" }) : t.match ? /* @__PURE__ */ a("span", { style: k.badgeMatch, children: "✓ match" }) : /* @__PURE__ */ a("span", { style: k.badgeChanged, children: "● changed" });
2918
+ return /* @__PURE__ */ m("div", { style: k.fixtureRow, children: [
2919
+ /* @__PURE__ */ m("div", { style: k.fixtureLabel, children: [
2920
+ /* @__PURE__ */ a("span", { style: k.fixtureName, children: e.fixtureId }),
2704
2921
  n
2705
2922
  ] }),
2706
- /* @__PURE__ */ f("div", { style: T.sideBySide, children: [
2707
- /* @__PURE__ */ f("div", { style: T.screenshotColumn, children: [
2708
- /* @__PURE__ */ a("span", { style: T.columnLabel, children: "Current" }),
2923
+ /* @__PURE__ */ m("div", { style: k.sideBySide, children: [
2924
+ /* @__PURE__ */ m("div", { style: k.screenshotColumn, children: [
2925
+ /* @__PURE__ */ a("span", { style: k.columnLabel, children: "Current" }),
2709
2926
  /* @__PURE__ */ a(
2710
- Ae,
2927
+ Pe,
2711
2928
  {
2712
2929
  fixtureId: e.fixtureId,
2713
2930
  sessionName: e.currentSession,
@@ -2715,10 +2932,10 @@ const Hr = A(
2715
2932
  }
2716
2933
  )
2717
2934
  ] }),
2718
- /* @__PURE__ */ f("div", { style: T.screenshotColumn, children: [
2719
- /* @__PURE__ */ a("span", { style: T.columnLabel, children: "Baseline" }),
2935
+ /* @__PURE__ */ m("div", { style: k.screenshotColumn, children: [
2936
+ /* @__PURE__ */ a("span", { style: k.columnLabel, children: "Baseline" }),
2720
2937
  /* @__PURE__ */ a(
2721
- Ae,
2938
+ Pe,
2722
2939
  {
2723
2940
  fixtureId: e.fixtureId,
2724
2941
  sessionName: e.baselineSession,
@@ -2729,37 +2946,26 @@ const Hr = A(
2729
2946
  ] })
2730
2947
  ] });
2731
2948
  }
2732
- ), jr = V(
2949
+ ), fn = O(
2733
2950
  {
2734
- name: u.const(),
2735
- path: u.const(),
2736
- items: u.const(),
2737
- daemon: u.const(),
2738
- baselineSession: u.const(),
2739
- currentSession: u.const()
2740
- },
2741
- (r, e) => /* @__PURE__ */ f("div", { children: [
2742
- /* @__PURE__ */ a("div", { style: T.groupHeader, children: /* @__PURE__ */ a("span", { style: T.groupTitle, children: e.path }) }),
2743
- /* @__PURE__ */ a("div", { style: T.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
2744
- Hr,
2745
- {
2746
- fixtureId: t.fixtureId,
2747
- daemon: e.daemon,
2748
- baselineSession: e.baselineSession,
2749
- currentSession: e.currentSession
2750
- },
2751
- t.fixtureId
2752
- )) })
2753
- ] })
2754
- ), T = {
2755
- groupHeader: {
2756
- marginBottom: 12
2757
- },
2758
- groupTitle: {
2759
- fontSize: 13,
2760
- fontWeight: 500,
2761
- color: "var(--vscode-foreground)"
2762
- },
2951
+ name: f.const(),
2952
+ path: f.const(),
2953
+ items: f.const(),
2954
+ daemon: f.const(),
2955
+ baselineSession: f.const(),
2956
+ currentSession: f.const()
2957
+ },
2958
+ (r, e) => /* @__PURE__ */ a("div", { style: k.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
2959
+ pn,
2960
+ {
2961
+ fixtureId: t.fixtureId,
2962
+ daemon: e.daemon,
2963
+ baselineSession: e.baselineSession,
2964
+ currentSession: e.currentSession
2965
+ },
2966
+ t.fixtureId
2967
+ )) })
2968
+ ), k = {
2763
2969
  groupContent: {
2764
2970
  display: "flex",
2765
2971
  flexDirection: "column",
@@ -2819,8 +3025,8 @@ const Hr = A(
2819
3025
  color: "var(--vscode-errorForeground)",
2820
3026
  fontWeight: 500
2821
3027
  }
2822
- }, q = 8;
2823
- function ct(r, e) {
3028
+ }, K = 8;
3029
+ function St(r, e) {
2824
3030
  return `
2825
3031
  linear-gradient(45deg, ${e} 25%, transparent 25%),
2826
3032
  linear-gradient(-45deg, ${e} 25%, transparent 25%),
@@ -2828,48 +3034,48 @@ function ct(r, e) {
2828
3034
  linear-gradient(-45deg, transparent 75%, ${e} 75%)
2829
3035
  `;
2830
3036
  }
2831
- const Ur = {
3037
+ const gn = {
2832
3038
  backgroundColor: "#ffffff",
2833
- backgroundImage: ct("#ffffff", "#e5e5e5")
2834
- }, Pr = {
3039
+ backgroundImage: St("#ffffff", "#e5e5e5")
3040
+ }, mn = {
2835
3041
  backgroundColor: "#1e1e1e",
2836
- backgroundImage: ct("#1e1e1e", "#2d2d2d")
2837
- }, Wr = {
3042
+ backgroundImage: St("#1e1e1e", "#2d2d2d")
3043
+ }, vn = {
2838
3044
  display: "inline-block",
2839
3045
  padding: "12px",
2840
3046
  borderRadius: "4px",
2841
- backgroundSize: `${q * 2}px ${q * 2}px`,
2842
- backgroundPosition: `0 0, 0 ${q}px, ${q}px -${q}px, -${q}px 0`,
3047
+ backgroundSize: `${K * 2}px ${K * 2}px`,
3048
+ backgroundPosition: `0 0, 0 ${K}px, ${K}px -${K}px, -${K}px 0`,
2843
3049
  boxShadow: "0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08)"
2844
3050
  };
2845
- function Gr(r) {
2846
- const e = r === "dark" ? Pr : Ur;
3051
+ function bn(r) {
3052
+ const e = r === "dark" ? mn : gn;
2847
3053
  return {
2848
- ...Wr,
3054
+ ...vn,
2849
3055
  backgroundColor: e.backgroundColor,
2850
3056
  backgroundImage: e.backgroundImage
2851
3057
  };
2852
3058
  }
2853
- function ze({ src: r, alt: e, background: t }) {
2854
- return /* @__PURE__ */ a("div", { style: Gr(t), children: /* @__PURE__ */ a("img", { src: r, alt: e, style: C.image }) });
3059
+ function je({ src: r, alt: e, background: t }) {
3060
+ return /* @__PURE__ */ a("div", { style: bn(t), children: /* @__PURE__ */ a("img", { src: r, alt: e, style: R.image }) });
2855
3061
  }
2856
- const qr = V(
3062
+ const _n = O(
2857
3063
  {
2858
- item: u.const(),
2859
- reportModel: u.const()
3064
+ item: f.const(),
3065
+ reportModel: f.const()
2860
3066
  },
2861
3067
  (r, e) => {
2862
- const { item: t, reportModel: n } = e, { entry: s } = t, o = s.background ?? "light", i = s.status === "unchanged" ? /* @__PURE__ */ a("span", { style: C.badgeMatch, children: "✓ match" }) : s.status === "changed" ? /* @__PURE__ */ a("span", { style: C.badgeChanged, children: "● changed" }) : /* @__PURE__ */ a("span", { style: C.badgeAdded, children: "+ added" }), d = s.baselineScreenshot || s.currentScreenshot;
2863
- return /* @__PURE__ */ f("div", { style: C.fixtureRow, children: [
2864
- /* @__PURE__ */ f("div", { style: C.fixtureLabel, children: [
2865
- /* @__PURE__ */ a("span", { style: C.fixtureName, children: t.fixtureId }),
3068
+ const { item: t, reportModel: n } = e, { entry: s } = t, o = s.background ?? "light", i = s.status === "unchanged" ? /* @__PURE__ */ a("span", { style: R.badgeMatch, children: "✓ match" }) : s.status === "changed" ? /* @__PURE__ */ a("span", { style: R.badgeChanged, children: "● changed" }) : /* @__PURE__ */ a("span", { style: R.badgeAdded, children: "+ added" }), d = s.baselineScreenshot || s.currentScreenshot;
3069
+ return /* @__PURE__ */ m("div", { style: R.fixtureRow, children: [
3070
+ /* @__PURE__ */ m("div", { style: R.fixtureLabel, children: [
3071
+ /* @__PURE__ */ a("span", { style: R.fixtureName, children: t.fixtureId }),
2866
3072
  i
2867
3073
  ] }),
2868
- d && /* @__PURE__ */ f("div", { style: C.sideBySide, children: [
2869
- s.baselineScreenshot && /* @__PURE__ */ f("div", { style: C.screenshotColumn, children: [
2870
- /* @__PURE__ */ a("span", { style: C.columnLabel, children: "Baseline" }),
3074
+ d && /* @__PURE__ */ m("div", { style: R.sideBySide, children: [
3075
+ s.baselineScreenshot && /* @__PURE__ */ m("div", { style: R.screenshotColumn, children: [
3076
+ /* @__PURE__ */ a("span", { style: R.columnLabel, children: "Baseline" }),
2871
3077
  /* @__PURE__ */ a(
2872
- ze,
3078
+ je,
2873
3079
  {
2874
3080
  src: n.resolveScreenshotUrl(s.baselineScreenshot),
2875
3081
  alt: `Baseline screenshot of ${t.fixtureId}`,
@@ -2877,10 +3083,10 @@ const qr = V(
2877
3083
  }
2878
3084
  )
2879
3085
  ] }),
2880
- s.currentScreenshot && /* @__PURE__ */ f("div", { style: C.screenshotColumn, children: [
2881
- /* @__PURE__ */ a("span", { style: C.columnLabel, children: "Current" }),
3086
+ s.currentScreenshot && /* @__PURE__ */ m("div", { style: R.screenshotColumn, children: [
3087
+ /* @__PURE__ */ a("span", { style: R.columnLabel, children: "Current" }),
2882
3088
  /* @__PURE__ */ a(
2883
- ze,
3089
+ je,
2884
3090
  {
2885
3091
  src: n.resolveScreenshotUrl(s.currentScreenshot),
2886
3092
  alt: `Current screenshot of ${t.fixtureId}`,
@@ -2889,39 +3095,28 @@ const qr = V(
2889
3095
  )
2890
3096
  ] })
2891
3097
  ] }),
2892
- !d && s.status === "unchanged" && /* @__PURE__ */ a("div", { style: C.hashRow, children: /* @__PURE__ */ f("span", { style: C.hashText, children: [
3098
+ !d && s.status === "unchanged" && /* @__PURE__ */ a("div", { style: R.hashRow, children: /* @__PURE__ */ m("span", { style: R.hashText, children: [
2893
3099
  "hash: ",
2894
3100
  s.targetHash
2895
3101
  ] }) })
2896
3102
  ] });
2897
3103
  }
2898
- ), Kr = V(
3104
+ ), yn = O(
2899
3105
  {
2900
- name: u.const(),
2901
- path: u.const(),
2902
- items: u.const(),
2903
- reportModel: u.const()
2904
- },
2905
- (r, e) => /* @__PURE__ */ f("div", { children: [
2906
- /* @__PURE__ */ a("div", { style: C.groupHeader, children: /* @__PURE__ */ a("span", { style: C.groupTitle, children: e.path }) }),
2907
- /* @__PURE__ */ a("div", { style: C.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
2908
- qr,
2909
- {
2910
- item: t,
2911
- reportModel: e.reportModel
2912
- },
2913
- t.fixtureId
2914
- )) })
2915
- ] })
2916
- ), C = {
2917
- groupHeader: {
2918
- marginBottom: 12
2919
- },
2920
- groupTitle: {
2921
- fontSize: 13,
2922
- fontWeight: 500,
2923
- color: "var(--vscode-foreground)"
3106
+ name: f.const(),
3107
+ path: f.const(),
3108
+ items: f.const(),
3109
+ reportModel: f.const()
2924
3110
  },
3111
+ (r, e) => /* @__PURE__ */ a("div", { style: R.groupContent, children: e.items.map((t) => /* @__PURE__ */ a(
3112
+ _n,
3113
+ {
3114
+ item: t,
3115
+ reportModel: e.reportModel
3116
+ },
3117
+ t.fixtureId
3118
+ )) })
3119
+ ), R = {
2925
3120
  groupContent: {
2926
3121
  display: "flex",
2927
3122
  flexDirection: "column",
@@ -2985,72 +3180,89 @@ const qr = V(
2985
3180
  color: "var(--vscode-testing-iconQueued)",
2986
3181
  fontWeight: 500
2987
3182
  }
2988
- }, lt = "component-explorer:fixtureHeights", $e = 500;
3183
+ }, wt = "component-explorer:fixtureHeights", Ue = 500;
2989
3184
  let M = null;
2990
- function ht() {
3185
+ function Ct() {
2991
3186
  if (M !== null) return M;
2992
3187
  try {
2993
- const r = localStorage.getItem(lt);
3188
+ const r = localStorage.getItem(wt);
2994
3189
  if (r)
2995
3190
  return M = JSON.parse(r), M;
2996
3191
  } catch {
2997
3192
  }
2998
3193
  return M = {}, M;
2999
3194
  }
3000
- function Jr() {
3195
+ function xn() {
3001
3196
  if (M !== null)
3002
3197
  try {
3003
3198
  const r = Object.entries(M);
3004
- r.length > $e && (M = Object.fromEntries(r.slice(-$e))), localStorage.setItem(lt, JSON.stringify(M));
3199
+ r.length > Ue && (M = Object.fromEntries(r.slice(-Ue))), localStorage.setItem(wt, JSON.stringify(M));
3005
3200
  } catch {
3006
3201
  }
3007
3202
  }
3008
- function Zr(r, e) {
3009
- const t = ht();
3010
- t[r] = e, Jr();
3203
+ function Sn(r, e) {
3204
+ const t = Ct();
3205
+ t[r] = e, xn();
3206
+ }
3207
+ function wn() {
3208
+ return new Map(Object.entries(Ct()));
3209
+ }
3210
+ const Cn = 280, Rn = 32, se = 32, We = 400;
3211
+ let Rt = 0;
3212
+ function z(r, e) {
3213
+ const t = ++Rt, n = performance.now().toFixed(1);
3214
+ console.log(
3215
+ `%c[scroll #${t} @${n}ms] ${r}`,
3216
+ "color: #3b82f6; font-weight: bold",
3217
+ e
3218
+ );
3011
3219
  }
3012
- function Xr() {
3013
- return new Map(Object.entries(ht()));
3220
+ function Ge(r, e) {
3221
+ const t = ++Rt, n = performance.now().toFixed(1);
3222
+ console.warn(
3223
+ `[scroll #${t} @${n}ms] ${r}`,
3224
+ e
3225
+ );
3014
3226
  }
3015
- const Yr = 280, Qr = 32, ne = 32, Le = 400, ut = "component-explorer:scrollAnchors", He = 100;
3016
- function ft() {
3227
+ const Tt = "component-explorer:scrollAnchors", qe = 100;
3228
+ function kt() {
3017
3229
  try {
3018
- const r = localStorage.getItem(ut);
3230
+ const r = localStorage.getItem(Tt);
3019
3231
  if (r) return JSON.parse(r);
3020
3232
  } catch {
3021
3233
  }
3022
3234
  return {};
3023
3235
  }
3024
- function en(r, e) {
3236
+ function Tn(r, e) {
3025
3237
  try {
3026
- const t = ft();
3238
+ const t = kt();
3027
3239
  t[r] = e;
3028
- const n = Object.entries(t), s = n.length > He ? Object.fromEntries(n.slice(-He)) : t;
3029
- localStorage.setItem(ut, JSON.stringify(s));
3240
+ const n = Object.entries(t), s = n.length > qe ? Object.fromEntries(n.slice(-qe)) : t;
3241
+ localStorage.setItem(Tt, JSON.stringify(s));
3030
3242
  } catch {
3031
3243
  }
3032
3244
  }
3033
- function tn(r) {
3034
- return ft()[r];
3245
+ function kn(r) {
3246
+ return kt()[r];
3035
3247
  }
3036
- function pt(r) {
3248
+ function It(r) {
3037
3249
  return r.type === "single" ? r.fixture.id : r.id;
3038
3250
  }
3039
- function rn(r, e) {
3251
+ function In(r, e) {
3040
3252
  const t = new Array(r.length);
3041
- let n = ne;
3253
+ let n = se;
3042
3254
  for (let s = 0; s < r.length; s++) {
3043
- const o = e.get(pt(r[s])) ?? Yr;
3044
- t[s] = { top: n, height: o }, n += o + Qr;
3255
+ const o = e.get(It(r[s])) ?? Cn;
3256
+ t[s] = { top: n, height: o }, n += o + Rn;
3045
3257
  }
3046
3258
  return t;
3047
3259
  }
3048
- function nn(r) {
3260
+ function ge(r) {
3049
3261
  if (r.length === 0) return 0;
3050
3262
  const e = r[r.length - 1];
3051
- return e.top + e.height + ne;
3263
+ return e.top + e.height + se;
3052
3264
  }
3053
- function gt(r, e) {
3265
+ function Ot(r, e) {
3054
3266
  let t = 0, n = r.length;
3055
3267
  for (; t < n; ) {
3056
3268
  const s = t + n >> 1;
@@ -3058,76 +3270,139 @@ function gt(r, e) {
3058
3270
  }
3059
3271
  return t;
3060
3272
  }
3061
- function sn(r, e, t) {
3273
+ function On(r, e, t) {
3062
3274
  if (r.length === 0) return { start: 0, end: 0 };
3063
- const n = gt(r, e - Le);
3275
+ const n = Ot(r, e - We);
3064
3276
  let s = n;
3065
- const o = e + t + Le;
3277
+ const o = e + t + We;
3066
3278
  for (; s < r.length && r[s].top < o; )
3067
3279
  s++;
3068
3280
  return { start: n, end: s };
3069
3281
  }
3070
- function je(r, e) {
3282
+ function Ke(r, e) {
3071
3283
  if (r.length === 0) return;
3072
- const t = gt(r, e), n = Math.min(t, r.length - 1);
3284
+ const t = Ot(r, e), n = Math.min(t, r.length - 1);
3073
3285
  return {
3074
3286
  rowIndex: n,
3075
3287
  offsetFromViewport: r[n].top - e
3076
3288
  };
3077
3289
  }
3078
- function Ue(r, e) {
3290
+ function Je(r, e) {
3079
3291
  return e.rowIndex >= r.length ? 0 : r[e.rowIndex].top - e.offsetFromViewport;
3080
3292
  }
3081
- class on extends B({
3082
- model: u.const()
3293
+ function Qe(r) {
3294
+ return r.type === "single" ? r.fixture.path : r.path;
3295
+ }
3296
+ function Ze(r) {
3297
+ return r.split(" / ").slice(1);
3298
+ }
3299
+ function Nn(r, e, t) {
3300
+ const n = t.split("/"), s = n.length - r.length;
3301
+ for (let o = 0; o < r.length; o++)
3302
+ if (!e || o >= e.length || r[o] !== e[o])
3303
+ return r.slice(o).map((i, d) => ({
3304
+ depth: o + d,
3305
+ name: i,
3306
+ nodeId: n.slice(0, s + o + d + 1).join("/")
3307
+ }));
3308
+ return [];
3309
+ }
3310
+ const Xe = ["h1", "h2", "h3", "h4"];
3311
+ function Vn(r) {
3312
+ return Xe[Math.min(r, Xe.length - 1)];
3313
+ }
3314
+ const Ye = ["22px", "15px", "13px", "12px"];
3315
+ function Mn(r) {
3316
+ return {
3317
+ fontSize: Ye[Math.min(r, Ye.length - 1)],
3318
+ fontWeight: r <= 1 ? 600 : 500,
3319
+ color: "var(--vscode-foreground)",
3320
+ margin: 0,
3321
+ marginBottom: r === 0 ? "8px" : "4px",
3322
+ paddingBottom: r === 0 ? "6px" : void 0,
3323
+ borderBottom: r === 0 ? "1px solid var(--vscode-widget-border, var(--vscode-panel-border, rgba(128,128,128,0.35)))" : void 0
3324
+ };
3325
+ }
3326
+ class Fn extends B({
3327
+ model: f.const()
3083
3328
  }) {
3084
3329
  constructor() {
3085
3330
  super(...arguments);
3086
- l(this, "_rowHeights", w(this, Xr()));
3087
- l(this, "_scrollTop", w(this, 0));
3088
- l(this, "_viewportHeight", w(this, 0));
3089
- l(this, "_scrollContainerRef", null);
3090
- l(this, "_resizeObserver", null);
3091
- l(this, "_viewportResizeObserver", null);
3092
- l(this, "_currentNodeId");
3093
- l(this, "_scrollSaveTimeout", null);
3094
- l(this, "_suppressScrollHandler", !1);
3095
- l(this, "layout", D(this, (t) => {
3331
+ c(this, "_rowHeights", C(this, wn()));
3332
+ c(this, "_scrollTop", C(this, 0));
3333
+ c(this, "_viewportHeight", C(this, 0));
3334
+ c(this, "_scrollContainerRef", null);
3335
+ c(this, "_resizeObserver", null);
3336
+ c(this, "_viewportResizeObserver", null);
3337
+ c(this, "_currentNodeId");
3338
+ c(this, "_scrollSaveTimeout", null);
3339
+ c(this, "_suppressScrollHandler", !1);
3340
+ c(this, "layout", V(this, (t) => {
3096
3341
  const n = this.explorerModel.selectedFixtures.read(t), s = this._rowHeights.read(t);
3097
- return rn(n, s);
3342
+ return In(n, s);
3098
3343
  }));
3099
- l(this, "visibleRowRange", D(this, (t) => {
3344
+ c(this, "visibleRowRange", V(this, (t) => {
3100
3345
  const n = this.layout.read(t), s = this._scrollTop.read(t), o = this._viewportHeight.read(t);
3101
- return sn(n, s, o);
3346
+ return On(n, s, o);
3102
3347
  }));
3103
- l(this, "setScrollContainerRef", (t) => {
3348
+ c(this, "setScrollContainerRef", (t) => {
3104
3349
  var n;
3105
- this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef = t, t && (t.addEventListener("scroll", this._handleScroll, { passive: !0 }), this._viewportHeight.set(t.clientHeight, void 0), this._viewportResizeObserver = new ResizeObserver(([s]) => {
3106
- this._viewportHeight.set(Math.round(s.contentRect.height), void 0);
3350
+ this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef = t, t && (t.addEventListener("scroll", this._handleScroll, { passive: !0 }), this._viewportHeight.set(t.clientHeight, void 0), z("setScrollContainerRef", { clientHeight: t.clientHeight, scrollTop: t.scrollTop }), this._viewportResizeObserver = new ResizeObserver(([s]) => {
3351
+ const o = Math.round(s.contentRect.height), i = this._viewportHeight.get();
3352
+ o !== i && z("viewportResize", { prev: i, new: o }), this._viewportHeight.set(o, void 0);
3107
3353
  }), this._viewportResizeObserver.observe(t), this._restoreScrollPosition());
3108
3354
  });
3109
- l(this, "_handleScroll", () => {
3110
- this._scrollContainerRef && (this._scrollTop.set(this._scrollContainerRef.scrollTop, void 0), !(this._suppressScrollHandler || !this._currentNodeId) && (this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout), this._scrollSaveTimeout = setTimeout(() => {
3355
+ c(this, "_handleScroll", () => {
3356
+ if (!this._scrollContainerRef) return;
3357
+ const t = this._scrollTop.get(), n = this._scrollContainerRef.scrollTop, s = n - t;
3358
+ if (this._scrollTop.set(n, void 0), Math.abs(s) > 200 && Ge("handleScroll:LARGE_JUMP", {
3359
+ prevObsScrollTop: t,
3360
+ newScrollTop: n,
3361
+ delta: s,
3362
+ suppressed: this._suppressScrollHandler,
3363
+ stack: new Error().stack
3364
+ }), this._suppressScrollHandler || !this._currentNodeId) {
3365
+ this._suppressScrollHandler && z("handleScroll:suppressed", { newScrollTop: n, delta: s });
3366
+ return;
3367
+ }
3368
+ this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout), this._scrollSaveTimeout = setTimeout(() => {
3111
3369
  if (!this._currentNodeId) return;
3112
- const t = this.layout.get(), n = je(t, this._scrollTop.get());
3113
- n && en(this._currentNodeId, n);
3114
- }, 150)));
3370
+ const o = this.layout.get(), i = Ke(o, this._scrollTop.get());
3371
+ i && Tn(this._currentNodeId, i);
3372
+ }, 150);
3115
3373
  });
3116
- l(this, "observeRowElement", (t, n) => {
3374
+ c(this, "observeRowElement", (t, n) => {
3117
3375
  t && (this._resizeObserver || (this._resizeObserver = new ResizeObserver((s) => {
3118
3376
  const o = this._rowHeights.get();
3119
3377
  let i;
3120
- for (const d of s) {
3121
- const c = d.target.getAttribute("data-row-id");
3122
- if (!c) continue;
3123
- const h = Math.round(d.contentRect.height);
3124
- h > 0 && o.get(c) !== h && (i || (i = new Map(o)), i.set(c, h), Zr(c, h));
3378
+ const d = [];
3379
+ for (const l of s) {
3380
+ const h = l.target.getAttribute("data-row-id");
3381
+ if (!h) continue;
3382
+ const u = Math.round(l.contentRect.height);
3383
+ u > 0 && o.get(h) !== u && (d.push({ rid: h, oldH: o.get(h), newH: u }), i || (i = new Map(o)), i.set(h, u), Sn(h, u));
3125
3384
  }
3126
3385
  if (i) {
3127
- const d = this.layout.get(), c = je(d, this._scrollTop.get());
3128
- if (this._rowHeights.set(i, void 0), c && this._scrollContainerRef) {
3129
- const h = this.layout.get(), m = Ue(h, c);
3130
- this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = m, this._scrollTop.set(m, void 0), requestAnimationFrame(() => {
3386
+ const l = this.layout.get(), h = this._scrollTop.get(), u = Ke(l, h);
3387
+ this._rowHeights.set(i, void 0);
3388
+ const g = this.layout.get();
3389
+ if (u && this._scrollContainerRef) {
3390
+ const b = Je(g, u), p = b - h;
3391
+ Math.abs(p) > 2 && z("resizeObserver:reAnchor", {
3392
+ changedRows: d,
3393
+ anchor: u,
3394
+ scrollTopBefore: h,
3395
+ newScrollTop: b,
3396
+ delta: p,
3397
+ oldTotalHeight: ge(l),
3398
+ newTotalHeight: ge(g)
3399
+ }), Math.abs(p) > 200 && Ge("resizeObserver:LARGE_REANCHOR", {
3400
+ changedRows: d,
3401
+ anchor: u,
3402
+ scrollTopBefore: h,
3403
+ newScrollTop: b,
3404
+ delta: p
3405
+ }), this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = b, this._scrollTop.set(b, void 0), requestAnimationFrame(() => {
3131
3406
  this._suppressScrollHandler = !1;
3132
3407
  });
3133
3408
  }
@@ -3153,14 +3428,24 @@ class on extends B({
3153
3428
  return ((s = n.find((i) => i.sourceKind === "worktree")) == null ? void 0 : s.name) ?? ((o = n[1]) == null ? void 0 : o.name) ?? "baseline";
3154
3429
  }
3155
3430
  updateForSelection(t) {
3156
- this._currentNodeId !== t && (this._currentNodeId = t, this._restoreScrollPosition());
3431
+ this._currentNodeId !== t && (z("updateForSelection", { prev: this._currentNodeId, new: t }), this._currentNodeId = t, this._restoreScrollPosition());
3157
3432
  }
3158
3433
  _restoreScrollPosition() {
3159
3434
  if (!this._scrollContainerRef || !this._currentNodeId) return;
3160
- const t = tn(this._currentNodeId);
3161
- if (!t) return;
3162
- const n = this.layout.get(), s = Ue(n, t);
3163
- this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = s, this._scrollTop.set(s, void 0), requestAnimationFrame(() => {
3435
+ const t = kn(this._currentNodeId);
3436
+ if (!t) {
3437
+ z("restoreScroll:noAnchor", { nodeId: this._currentNodeId });
3438
+ return;
3439
+ }
3440
+ const n = this.layout.get(), s = Je(n, t), o = this._scrollContainerRef.scrollTop;
3441
+ z("restoreScroll", {
3442
+ nodeId: this._currentNodeId,
3443
+ anchor: t,
3444
+ prevScrollTop: o,
3445
+ targetScrollTop: s,
3446
+ delta: s - o,
3447
+ layoutLength: n.length
3448
+ }), this._suppressScrollHandler = !0, this._scrollContainerRef.scrollTop = s, this._scrollTop.set(s, void 0), requestAnimationFrame(() => {
3164
3449
  this._suppressScrollHandler = !1;
3165
3450
  });
3166
3451
  }
@@ -3169,67 +3454,83 @@ class on extends B({
3169
3454
  (t = this._resizeObserver) == null || t.disconnect(), (n = this._viewportResizeObserver) == null || n.disconnect(), this._scrollContainerRef && this._scrollContainerRef.removeEventListener("scroll", this._handleScroll), this._scrollSaveTimeout && clearTimeout(this._scrollSaveTimeout);
3170
3455
  }
3171
3456
  }
3172
- const an = A(
3173
- on,
3457
+ const Dn = A(
3458
+ Fn,
3174
3459
  {},
3175
3460
  (r, e) => {
3176
3461
  const t = e.explorerModel.selectedFixtures.read(r), n = e.explorerModel.selectedNodeId.read(r), s = e.layout.read(r), { start: o, end: i } = e.visibleRowRange.read(r);
3177
3462
  if (e.updateForSelection(n), t.length === 0) {
3178
- const c = e.explorerModel.reportModel;
3179
- if (c) {
3180
- const h = c.state.read(r);
3463
+ const l = e.explorerModel.reportModel;
3464
+ if (l) {
3465
+ const h = l.state.read(r);
3181
3466
  if (h.status === "loading")
3182
- return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Loading report..." }) });
3467
+ return /* @__PURE__ */ a("div", { style: D.emptyState, children: /* @__PURE__ */ a("span", { style: D.emptyText, children: "Loading report..." }) });
3183
3468
  if (h.status === "error")
3184
- return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ f("span", { style: { ...N.emptyText, color: "var(--vscode-errorForeground)" }, children: [
3469
+ return /* @__PURE__ */ a("div", { style: D.emptyState, children: /* @__PURE__ */ m("span", { style: { ...D.emptyText, color: "var(--vscode-errorForeground)" }, children: [
3185
3470
  "Failed to load report: ",
3186
3471
  h.message
3187
3472
  ] }) });
3188
3473
  }
3189
- return /* @__PURE__ */ a("div", { style: N.emptyState, children: /* @__PURE__ */ a("span", { style: N.emptyText, children: "Select a component or folder to preview" }) });
3474
+ return /* @__PURE__ */ a("div", { style: D.emptyState, children: /* @__PURE__ */ a("span", { style: D.emptyText, children: "Select a component or folder to preview" }) });
3190
3475
  }
3191
- const d = nn(s);
3192
- return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: N.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(o, i).map((c, h) => {
3193
- const m = o + h, { top: v } = s[m], R = pt(c);
3194
- return /* @__PURE__ */ a(
3476
+ const d = ge(s);
3477
+ return /* @__PURE__ */ a("div", { ref: e.setScrollContainerRef, style: D.scrollContainer, children: /* @__PURE__ */ a("div", { style: { position: "relative", height: d }, children: t.slice(o, i).map((l, h) => {
3478
+ const u = o + h, { top: g } = s[u], b = It(l), p = Ze(Qe(l)), _ = u > 0 ? Ze(Qe(t[u - 1])) : void 0, x = Nn(p, _, b);
3479
+ return /* @__PURE__ */ m(
3195
3480
  "div",
3196
3481
  {
3197
- ref: (g) => e.observeRowElement(g, R),
3198
- style: { position: "absolute", top: v, left: ne, right: ne },
3199
- children: c.type === "single" ? /* @__PURE__ */ a(at, { fixture: c.fixture, compact: !1 }) : c.type === "variants" ? /* @__PURE__ */ a(dn, { row: c }) : c.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
3200
- jr,
3201
- {
3202
- name: c.name,
3203
- path: c.path,
3204
- items: c.items,
3205
- daemon: e.explorerModel.daemon,
3206
- baselineSession: e.baselineSessionName,
3207
- currentSession: e.currentSessionName
3208
- }
3209
- ) : c.type === "report-comparison" && e.explorerModel.reportModel ? /* @__PURE__ */ a(
3210
- Kr,
3211
- {
3212
- name: c.name,
3213
- path: c.path,
3214
- items: c.items,
3215
- reportModel: e.explorerModel.reportModel
3216
- }
3217
- ) : null
3482
+ ref: (y) => e.observeRowElement(y, b),
3483
+ style: { position: "absolute", top: g, left: se, right: se },
3484
+ children: [
3485
+ x.map((y) => {
3486
+ const T = Vn(y.depth);
3487
+ return /* @__PURE__ */ a(T, { style: Mn(y.depth), children: /* @__PURE__ */ a(
3488
+ "a",
3489
+ {
3490
+ href: vt("component", y.nodeId),
3491
+ style: D.headingLink,
3492
+ onClick: (S) => {
3493
+ S.preventDefault(), e.explorerModel.selectNode(y.nodeId);
3494
+ },
3495
+ children: y.name
3496
+ }
3497
+ ) }, y.depth);
3498
+ }),
3499
+ l.type === "single" ? /* @__PURE__ */ a(yt, { fixture: l.fixture, compact: !1 }) : l.type === "variants" ? /* @__PURE__ */ a(En, { row: l, onSelect: e.explorerModel.selectNode }) : l.type === "screenshot-comparison" && e.explorerModel.daemon ? /* @__PURE__ */ a(
3500
+ fn,
3501
+ {
3502
+ name: l.name,
3503
+ path: l.path,
3504
+ items: l.items,
3505
+ daemon: e.explorerModel.daemon,
3506
+ baselineSession: e.baselineSessionName,
3507
+ currentSession: e.currentSessionName
3508
+ }
3509
+ ) : l.type === "report-comparison" && e.explorerModel.reportModel ? /* @__PURE__ */ a(
3510
+ yn,
3511
+ {
3512
+ name: l.name,
3513
+ path: l.path,
3514
+ items: l.items,
3515
+ reportModel: e.explorerModel.reportModel
3516
+ }
3517
+ ) : null
3518
+ ]
3218
3519
  },
3219
- R
3520
+ b
3220
3521
  );
3221
3522
  }) }) });
3222
3523
  }
3223
- ), dn = V(
3224
- { row: u.const() },
3524
+ ), En = O(
3525
+ {
3526
+ row: f.const(),
3527
+ onSelect: f.const()
3528
+ },
3225
3529
  (r, e) => {
3226
3530
  const t = e.row;
3227
- return /* @__PURE__ */ f("div", { children: [
3228
- /* @__PURE__ */ a("div", { style: N.variantsHeader, children: /* @__PURE__ */ a("span", { style: N.variantsTitle, children: t.path }) }),
3229
- /* @__PURE__ */ a("div", { style: N.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(at, { fixture: n, compact: !0 }, n.id)) })
3230
- ] });
3531
+ return /* @__PURE__ */ a("div", { style: D.variantsContent, children: t.fixtures.map((n) => /* @__PURE__ */ a(yt, { fixture: n, compact: !0, onSelect: e.onSelect }, n.id)) });
3231
3532
  }
3232
- ), N = {
3533
+ ), D = {
3233
3534
  scrollContainer: {
3234
3535
  flex: 1,
3235
3536
  overflow: "auto",
@@ -3246,55 +3547,51 @@ const an = A(
3246
3547
  color: "var(--vscode-descriptionForeground)",
3247
3548
  fontSize: "14px"
3248
3549
  },
3249
- variantsHeader: {
3250
- marginBottom: "12px"
3251
- },
3252
- variantsTitle: {
3253
- fontSize: "13px",
3254
- fontWeight: 500,
3255
- color: "var(--vscode-foreground)"
3256
- },
3257
3550
  variantsContent: {
3258
3551
  display: "flex",
3259
3552
  flexDirection: "row",
3260
3553
  flexWrap: "wrap",
3261
3554
  gap: "16px"
3555
+ },
3556
+ headingLink: {
3557
+ textDecoration: "none",
3558
+ color: "inherit"
3262
3559
  }
3263
- }, cn = A(
3264
- gr,
3265
- { daemonModel: u.const(), reportModel: u.const() },
3560
+ }, Bn = A(
3561
+ Mr,
3562
+ { daemonModel: f.const(), reportModel: f.const() },
3266
3563
  (r, e) => {
3267
3564
  const t = e.leftSidebarVisible.read(r), n = e.rightSidebarVisible.read(r), s = e.isDarkTheme.read(r), o = e.selectedNode.read(r);
3268
- return /* @__PURE__ */ f("div", { className: s ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: p.container, children: [
3269
- t && /* @__PURE__ */ a(kr, { model: e }),
3270
- /* @__PURE__ */ f("div", { style: p.centerArea, children: [
3271
- /* @__PURE__ */ a(Tr, { model: e }),
3272
- /* @__PURE__ */ a(an, { model: e })
3565
+ return /* @__PURE__ */ m("div", { className: s ? "vscode-theme default-dark-plus" : "vscode-theme default-light-plus", style: v.container, children: [
3566
+ t && /* @__PURE__ */ a(Yr, { model: e }),
3567
+ /* @__PURE__ */ m("div", { style: v.centerArea, children: [
3568
+ /* @__PURE__ */ a(jr, { model: e }),
3569
+ /* @__PURE__ */ a(Dn, { model: e })
3273
3570
  ] }),
3274
- n && /* @__PURE__ */ a(Dr, { selectedNode: o })
3571
+ n && /* @__PURE__ */ a(nn, { selectedNode: o })
3275
3572
  ] });
3276
3573
  }
3277
3574
  );
3278
- var ln = class pe {
3575
+ var An = class me {
3279
3576
  constructor(e) {
3280
3577
  this.iterator = e;
3281
3578
  }
3282
3579
  static fromIterable(e) {
3283
- return new pe(e[Symbol.asyncIterator]());
3580
+ return new me(e[Symbol.asyncIterator]());
3284
3581
  }
3285
3582
  static fromFn(e) {
3286
- return new pe(e());
3583
+ return new me(e());
3287
3584
  }
3288
3585
  [Symbol.asyncIterator]() {
3289
3586
  return this.iterator;
3290
3587
  }
3291
- }, hn = class extends Error {
3588
+ }, $n = class extends Error {
3292
3589
  constructor(r, e, t) {
3293
3590
  super(t), this.statusCode = r, this.method = e, this.name = "ApiError";
3294
3591
  }
3295
- }, un = class {
3592
+ }, zn = class {
3296
3593
  constructor(r) {
3297
- l(this, "methods", this._createProxy(""));
3594
+ c(this, "methods", this._createProxy(""));
3298
3595
  this._request = r;
3299
3596
  }
3300
3597
  _createProxy(r) {
@@ -3308,8 +3605,8 @@ var ln = class pe {
3308
3605
  });
3309
3606
  }
3310
3607
  };
3311
- function fn(r, e) {
3312
- return new un(async (t, n) => {
3608
+ function Ln(r, e) {
3609
+ return new zn(async (t, n) => {
3313
3610
  var d;
3314
3611
  const s = await fetch(`${r}/${t}`, {
3315
3612
  method: "POST",
@@ -3320,48 +3617,48 @@ function fn(r, e) {
3320
3617
  body: JSON.stringify(n)
3321
3618
  });
3322
3619
  if (s.status !== 200) {
3323
- const c = await s.json().catch(() => null);
3620
+ const l = await s.json().catch(() => null);
3324
3621
  let h;
3325
- throw c && typeof c == "object" && "errorMessage" in c ? h = `${c.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(c)} (Status: ${s.status}, Status Text: ${s.statusText})`, new hn(s.status, t, h);
3622
+ throw l && typeof l == "object" && "errorMessage" in l ? h = `${l.errorMessage}` : h = `Error calling API method ${t}: ${JSON.stringify(l)} (Status: ${s.status}, Status Text: ${s.statusText})`, new $n(s.status, t, h);
3326
3623
  }
3327
3624
  const o = s.headers.get("Content-Type");
3328
- return o != null && o.startsWith("application/jsonl") ? ln.fromFn(async function* () {
3329
- var R;
3330
- const c = (R = s.body) == null ? void 0 : R.getReader();
3331
- if (!c)
3625
+ return o != null && o.startsWith("application/jsonl") ? An.fromFn(async function* () {
3626
+ var b;
3627
+ const l = (b = s.body) == null ? void 0 : b.getReader();
3628
+ if (!l)
3332
3629
  return;
3333
3630
  let h = "";
3334
- const m = new TextDecoder("utf-8");
3631
+ const u = new TextDecoder("utf-8");
3335
3632
  for (; ; ) {
3336
- const { done: g, value: _ } = await c.read();
3337
- if (g)
3633
+ const { done: p, value: _ } = await l.read();
3634
+ if (p)
3338
3635
  break;
3339
- h += m.decode(_, { stream: !0 });
3340
- let b;
3341
- for (; (b = h.indexOf(`
3636
+ h += u.decode(_, { stream: !0 });
3637
+ let x;
3638
+ for (; (x = h.indexOf(`
3342
3639
  `)) >= 0; ) {
3343
- const y = h.slice(0, b).trim();
3344
- h = h.slice(b + 1), y.length > 0 && (yield JSON.parse(y));
3640
+ const y = h.slice(0, x).trim();
3641
+ h = h.slice(x + 1), y.length > 0 && (yield JSON.parse(y));
3345
3642
  }
3346
3643
  }
3347
- const v = h.trim();
3348
- v.length > 0 && (yield JSON.parse(v));
3644
+ const g = h.trim();
3645
+ g.length > 0 && (yield JSON.parse(g));
3349
3646
  }) : await s.json();
3350
3647
  });
3351
3648
  }
3352
- class pn {
3649
+ class Hn {
3353
3650
  constructor(e) {
3354
- l(this, "_sourceTreeIds", w(this, /* @__PURE__ */ new Map()));
3355
- l(this, "_sessions", w(this, []));
3356
- l(this, "_screenshotCache", /* @__PURE__ */ new Map());
3357
- l(this, "_client");
3358
- l(this, "_eventStreamAbort", null);
3359
- l(this, "sessionName");
3651
+ c(this, "_sourceTreeIds", C(this, /* @__PURE__ */ new Map()));
3652
+ c(this, "_sessions", C(this, []));
3653
+ c(this, "_screenshotCache", /* @__PURE__ */ new Map());
3654
+ c(this, "_client");
3655
+ c(this, "_eventStreamAbort", null);
3656
+ c(this, "sessionName");
3360
3657
  /** Observable map of sessionName → current sourceTreeId */
3361
- l(this, "sourceTreeIds", this._sourceTreeIds);
3658
+ c(this, "sourceTreeIds", this._sourceTreeIds);
3362
3659
  /** Observable list of sessions from the daemon */
3363
- l(this, "sessions", this._sessions);
3364
- this.config = e, this.sessionName = e.sessionName, this._client = fn("/__explorer/daemon-api");
3660
+ c(this, "sessions", this._sessions);
3661
+ this.config = e, this.sessionName = e.sessionName, this._client = Ln("/__explorer/daemon-api");
3365
3662
  }
3366
3663
  /**
3367
3664
  * Initializes the model: fetches initial session info and starts listening to events.
@@ -3459,13 +3756,13 @@ class pn {
3459
3756
  }
3460
3757
  }
3461
3758
  }
3462
- function gn() {
3759
+ function Pn() {
3463
3760
  return window.__EXPLORER_DAEMON__;
3464
3761
  }
3465
- class mn {
3762
+ class jn {
3466
3763
  constructor(e) {
3467
- l(this, "state", w(this, { status: "loading" }));
3468
- l(this, "_baseUrl");
3764
+ c(this, "state", C(this, { status: "loading" }));
3765
+ c(this, "_baseUrl");
3469
3766
  this.reportUrl = e;
3470
3767
  const t = e.lastIndexOf("/");
3471
3768
  this._baseUrl = t >= 0 ? e.slice(0, t + 1) : "", this._fetch();
@@ -3475,7 +3772,7 @@ class mn {
3475
3772
  }
3476
3773
  buildTree(e) {
3477
3774
  const t = this.state.read(e);
3478
- return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [] } : vn(t.report.fixtures);
3775
+ return t.status !== "ready" ? { id: "", name: "Report", type: "folder", children: [], labels: [] } : Un(t.report.fixtures);
3479
3776
  }
3480
3777
  async _fetch() {
3481
3778
  this.state.set({ status: "loading" }, void 0);
@@ -3490,35 +3787,36 @@ class mn {
3490
3787
  }
3491
3788
  }
3492
3789
  }
3493
- function vn(r) {
3494
- const e = { id: "", name: "Components", type: "folder", children: [] };
3790
+ function Un(r) {
3791
+ const e = { id: "", name: "Components", type: "folder", children: [], labels: [] };
3495
3792
  for (const [t, n] of Object.entries(r)) {
3496
3793
  const s = t.split("/");
3497
3794
  let o = e;
3498
3795
  for (let i = 0; i < s.length; i++) {
3499
- const d = s[i], c = i === s.length - 1, h = s.slice(0, i + 1).join("/");
3500
- if (c)
3796
+ const d = s[i], l = i === s.length - 1, h = s.slice(0, i + 1).join("/");
3797
+ if (l)
3501
3798
  o.children.push({
3502
3799
  id: h,
3503
3800
  name: d,
3504
3801
  type: "component",
3505
- reportEntry: n
3802
+ reportEntry: n,
3803
+ labels: []
3506
3804
  });
3507
3805
  else {
3508
- let m = o.children.find((v) => v.type === "folder" && v.name === d);
3509
- m || (m = { id: h, name: d, type: "folder", children: [] }, o.children.push(m)), o = m;
3806
+ let u = o.children.find((g) => g.type === "folder" && g.name === d);
3807
+ u || (u = { id: h, name: d, type: "folder", children: [], labels: [] }, o.children.push(u)), o = u;
3510
3808
  }
3511
3809
  }
3512
3810
  }
3513
3811
  return e;
3514
3812
  }
3515
- class Vn {
3813
+ class ns {
3516
3814
  constructor(e, t) {
3517
- l(this, "_root");
3518
- l(this, "_registry", new sr());
3519
- l(this, "_daemonModel");
3520
- l(this, "_reportModel");
3521
- this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root = _t(e), this._root.render(St(cn, {
3815
+ c(this, "_root");
3816
+ c(this, "_registry", new _r());
3817
+ c(this, "_daemonModel");
3818
+ c(this, "_reportModel");
3819
+ this._populateRegistry(t), this._reportModel = this._initializeReportModel(), this._daemonModel = this._reportModel ? void 0 : this._initializeDaemonModel(), this._root = Mt(e), this._root.render(Bt(Bn, {
3522
3820
  registry: this._registry,
3523
3821
  daemonModel: this._daemonModel,
3524
3822
  reportModel: this._reportModel
@@ -3527,13 +3825,13 @@ class Vn {
3527
3825
  _initializeReportModel() {
3528
3826
  const t = new URLSearchParams(location.search).get("report");
3529
3827
  if (t)
3530
- return new mn(t);
3828
+ return new jn(t);
3531
3829
  }
3532
3830
  _initializeDaemonModel() {
3533
- const e = gn();
3831
+ const e = Pn();
3534
3832
  if (!e)
3535
3833
  return;
3536
- const t = new pn(e);
3834
+ const t = new Hn(e);
3537
3835
  return t.initialize().catch((n) => {
3538
3836
  console.error("[ExplorerApp] Failed to initialize DaemonModel:", n);
3539
3837
  }), t;
@@ -3566,52 +3864,52 @@ class Vn {
3566
3864
  }
3567
3865
  }
3568
3866
  export {
3569
- _r as ChevronDownIcon,
3570
- vr as ChevronRightIcon,
3571
- kn as CliRuntime,
3572
- br as ComponentIcon,
3573
- pn as DaemonModel,
3574
- cn as Explorer,
3575
- Vn as ExplorerApp,
3576
- gr as ExplorerModel,
3577
- sr as FixtureRegistry,
3578
- yr as FolderIcon,
3579
- kr as LeftSidebar,
3580
- wr as MoonIcon,
3581
- xr as PanelLeftIcon,
3582
- Sr as PanelRightIcon,
3583
- mn as ReportModel,
3584
- Dr as RightSidebar,
3585
- Cr as SunIcon,
3586
- Tr as TitleBar,
3587
- oe as TitleBarButton,
3588
- Or as TreeItem,
3589
- it as TreeView,
3590
- Ct as VIEWPORT_SIZES,
3591
- Dn as asyncRender,
3592
- It as collectComponents,
3593
- Oe as createComponentDefinition,
3594
- ie as createFixtureTree,
3595
- Fn as defineFixture,
3596
- En as defineFixtureGroup,
3597
- Bn as defineFixtureVariants,
3598
- ke as findNodeByPath,
3599
- we as fixtureGroupBrand,
3600
- Re as fixtureVariantsBrand,
3601
- Rt as getDefaultPropertyValues,
3602
- On as isComponentDefinition,
3603
- ve as isFixtureGroup,
3604
- _e as isFixtureVariants,
3605
- me as isSingleFixture,
3606
- Ce as mergeStyles,
3607
- wn as parseFixtureExport,
3608
- Tn as parseFixtureGroup,
3609
- In as parseFixtureVariants,
3610
- Rn as parseSingleFixture,
3611
- wt as resolveViewport,
3612
- Te as singleFixtureBrand,
3613
- p as styles,
3614
- An as syncRender,
3615
- ot as toExplorerTree
3867
+ Er as ChevronDownIcon,
3868
+ Dr as ChevronRightIcon,
3869
+ rs as CliRuntime,
3870
+ Br as ComponentIcon,
3871
+ Hn as DaemonModel,
3872
+ Bn as Explorer,
3873
+ ns as ExplorerApp,
3874
+ Mr as ExplorerModel,
3875
+ _r as FixtureRegistry,
3876
+ Ar as FolderIcon,
3877
+ Yr as LeftSidebar,
3878
+ Hr as MoonIcon,
3879
+ $r as PanelLeftIcon,
3880
+ zr as PanelRightIcon,
3881
+ jn as ReportModel,
3882
+ nn as RightSidebar,
3883
+ Lr as SunIcon,
3884
+ jr as TitleBar,
3885
+ ie as TitleBarButton,
3886
+ qr as TreeItem,
3887
+ bt as TreeView,
3888
+ At as VIEWPORT_SIZES,
3889
+ is as asyncRender,
3890
+ Pt as collectComponents,
3891
+ Ne as createComponentDefinition,
3892
+ ae as createFixtureTree,
3893
+ as as defineFixture,
3894
+ ds as defineFixtureGroup,
3895
+ ls as defineFixtureVariants,
3896
+ Me as findNodeByPath,
3897
+ Te as fixtureGroupBrand,
3898
+ ke as fixtureVariantsBrand,
3899
+ zt as getDefaultPropertyValues,
3900
+ ts as isComponentDefinition,
3901
+ _e as isFixtureGroup,
3902
+ ye as isFixtureVariants,
3903
+ be as isSingleFixture,
3904
+ Re as mergeStyles,
3905
+ Zn as parseFixtureExport,
3906
+ Yn as parseFixtureGroup,
3907
+ es as parseFixtureVariants,
3908
+ Xn as parseSingleFixture,
3909
+ $t as resolveViewport,
3910
+ Ie as singleFixtureBrand,
3911
+ v as styles,
3912
+ cs as syncRender,
3913
+ gt as toExplorerTree
3616
3914
  };
3617
3915
  //# sourceMappingURL=viewer.js.map