@graphysdk/react-renderer 1.9.0-beta.1793621290212 → 1.9.0-beta.1793631379825

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,21 +1,21 @@
1
- import { $t as dr, An as ur, B as mr, Bt as Ge, Dn as hr, Dt as gr, En as pr, Ft as fr, Gt as Ie, Ht as vr, In as V, Kt as yr, Lt as z, M as Sr, Mn as Ce, Mt as br, N as Er, Nn as ne, Nt as Tr, On as Rr, Pn as De, Pt as Nr, Qt as Gr, R as Ir, Sn as Cr, Tn as Dr, Ut as wr, V as Lr, Vt as we, Wt as X, Xt as Le, Yt as Pr, _n as Q, a as qr, an as _r, at as kr, bn as J, cn as Hr, dn as $r, en as xr, fn as Se, gn as Pe, h as Mr, hn as qe, ht as Ar, i as Br, j as Or, jn as Fr, kn as Kr, kt as Ur, lt as jr, mn as be, n as Wr, ot as Yr, pn as B, r as zr, s as Vr, st as Xr, t as _e, tn as Qr, vn as Jr, vt as Zr, w as en, wn as tn, xn as Z, xt as rn, yn as ke, yt as nn, z as sn } from "./history-chords-BHE3wDew.js";
2
- import { COMPILER_STAGE_KEYS as se, DEFAULT_LOCALE as He, Geom as $e, GraphCompilationSession as xe, areEditTargetsEqual as Me, buildDiagnostic as ie, canonicalizeLocale as Ae, createAnchorResolver as Be, createCompiler as Oe, createDataLabelPlacementResolver as Fe, createSpecBuilder as Ke, createStyleResolver as Ee, findAnnotation as Ue, findIntlLocale as je, findLayerById as ce, isCompilerCachingEnabled as We, resolveDefinition as Ye, resolveGeomCornerRadiusPx as le, setCompilerCachingEnabled as ze, toPercent as W } from "@graphysdk/viz-engine";
3
- import { Component as Ve, useCallback as p, useEffect as H, useId as Xe, useImperativeHandle as Qe, useMemo as k, useRef as de, useState as S, useSyncExternalStore as Je } from "react";
4
- import { Fragment as Ze, jsx as c, jsxs as f } from "react/jsx-runtime";
1
+ import { $t as ur, An as mr, B as hr, Bt as Ne, Dn as gr, Dt as pr, En as fr, Ft as vr, Gt as Ie, Ht as yr, In as V, Kt as Sr, Lt as z, M as br, Mn as Ce, Mt as Er, N as Tr, Nn as ne, Nt as Rr, On as Gr, Pn as De, Pt as Nr, Qt as Ir, R as Cr, Sn as Dr, Tn as wr, Ut as Lr, V as Pr, Vt as we, Wt as X, Xt as Le, Yt as qr, _n as Q, a as _r, an as kr, at as Hr, bn as J, cn as $r, dn as xr, en as Mr, fn as Se, gn as Pe, h as Ar, hn as qe, ht as Br, i as Or, j as Fr, jn as Kr, kn as Ur, kt as jr, lt as Wr, mn as be, n as Yr, ot as zr, pn as B, r as Vr, s as Xr, st as Qr, t as _e, tn as Jr, vn as Zr, vt as en, w as tn, wn as rn, xn as Z, xt as nn, yn as ke, yt as sn, z as on } from "./history-chords-C93BbGsu.js";
2
+ import { COMPILER_STAGE_KEYS as se, DEFAULT_LOCALE as He, Geom as $e, GraphCompilationSession as xe, areEditTargetsEqual as Me, buildDiagnostic as ie, canonicalizeLocale as Ae, createAnchorResolver as Be, createCompiler as Oe, createDataLabelPlacementResolver as Fe, createSpecBuilder as Ke, createStyleResolver as Ee, findAnnotation as Ue, findIntlLocale as je, findLayerById as ce, foldGeomCornerRadii as We, isCompilerCachingEnabled as Ye, resolveDefinition as ze, resolveGeomCornerRadiusPx as le, setCompilerCachingEnabled as Ve, toPercent as W } from "@graphysdk/viz-engine";
3
+ import { Component as Xe, useCallback as p, useEffect as H, useId as Qe, useImperativeHandle as Je, useMemo as k, useRef as de, useState as S, useSyncExternalStore as Ze } from "react";
4
+ import { Fragment as et, jsx as c, jsxs as f } from "react/jsx-runtime";
5
5
  import { useStore as re } from "zustand";
6
6
  import { motion as ee } from "motion/react";
7
7
  import { createStore as oe } from "zustand/vanilla";
8
- import et from "clsx";
9
- import './index.css';var tt = "_1a5iqpb0", rt = "_1a5iqpb1";
10
- var nt = "_1a5iqpb3", st = "_1a5iqpb4", ot = "_1a5iqpb5";
8
+ import tt from "clsx";
9
+ import './index.css';var rt = "_1a5iqpb0", nt = "_1a5iqpb1";
10
+ var st = "_1a5iqpb3", ot = "_1a5iqpb4", at = "_1a5iqpb5";
11
11
  var ue = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
13
  return /* @__PURE__ */ f("div", {
14
14
  role: "alert",
15
- className: tt,
15
+ className: rt,
16
16
  children: [
17
17
  /* @__PURE__ */ c("strong", {
18
- className: rt,
18
+ className: nt,
19
19
  children: "This chart could not be rendered."
20
20
  }),
21
21
  t && /* @__PURE__ */ c(me, { diagnostic: t }),
@@ -26,14 +26,14 @@ var ue = ({ errors: e }) => {
26
26
  ]
27
27
  });
28
28
  }, me = ({ diagnostic: e }) => /* @__PURE__ */ f("div", {
29
- className: nt,
29
+ className: st,
30
30
  children: [
31
31
  /* @__PURE__ */ c("span", {
32
- className: st,
32
+ className: ot,
33
33
  children: e.code
34
34
  }),
35
35
  /* @__PURE__ */ c("p", {
36
- className: ot,
36
+ className: at,
37
37
  children: e.message
38
38
  }),
39
39
  e.suggestion && /* @__PURE__ */ c("p", {
@@ -42,10 +42,10 @@ var ue = ({ errors: e }) => {
42
42
  })
43
43
  ]
44
44
  });
45
- function at(e = [], t = []) {
45
+ function it(e = [], t = []) {
46
46
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
47
47
  }
48
- var it = class extends Ve {
48
+ var ct = class extends Xe {
49
49
  constructor(...e) {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
@@ -57,7 +57,7 @@ var it = class extends Ve {
57
57
  V([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
- this.state.caughtDiagnostic && !at(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
60
+ this.state.caughtDiagnostic && !it(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
61
61
  }
62
62
  render() {
63
63
  const { caughtDiagnostic: e } = this.state;
@@ -66,23 +66,23 @@ var it = class extends Ve {
66
66
  return t && t.length > 0 ? /* @__PURE__ */ c(ue, { errors: t }) : r;
67
67
  }
68
68
  }, Te = (e) => typeof e == "object" && "geom" in e && "render" in e, Re = (e) => {
69
- const t = Ye(e);
69
+ const t = ze(e);
70
70
  return t instanceof $e ? t : null;
71
- }, ct = (e, t) => {
72
- const r = e.filter((n) => lt(n, t));
71
+ }, lt = (e, t) => {
72
+ const r = e.filter((n) => dt(n, t));
73
73
  return r.length === e.length ? e : r;
74
- }, lt = (e, t) => e.kind === "annotation" ? Ue(t.annotations, e.id) !== null : e.kind === "observations" ? ce(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ce(t.layers, e.layerId) !== void 0 : !0, he = [], dt = () => oe((e) => ({
74
+ }, dt = (e, t) => e.kind === "annotation" ? Ue(t.annotations, e.id) !== null : e.kind === "observations" ? ce(t.layers, e.layerId) !== void 0 : e.kind === "layer" && e.layerId !== void 0 ? ce(t.layers, e.layerId) !== void 0 : !0, he = [], ut = () => oe((e) => ({
75
75
  selection: he,
76
- setSelection: (t) => e((r) => ut(r.selection, t) ? r : { selection: t }),
76
+ setSelection: (t) => e((r) => mt(r.selection, t) ? r : { selection: t }),
77
77
  clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: he })
78
- })), ut = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
78
+ })), mt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
79
79
  const s = t[n];
80
80
  return s !== void 0 && Me(r, s);
81
- }), mt = process.env.NODE_ENV !== "production", ht = 5, gt = (e) => {
82
- if (!mt) return {
81
+ }), ht = process.env.NODE_ENV !== "production", gt = 5, pt = (e) => {
82
+ if (!ht) return {
83
83
  emit: () => {
84
84
  },
85
- subscribe: () => ft,
85
+ subscribe: () => vt,
86
86
  getLastTrigger: () => null,
87
87
  getLastCompile: () => null,
88
88
  getCacheStats: () => e.getCacheStats()
@@ -94,7 +94,7 @@ var it = class extends Ve {
94
94
  const s = e.getLastCompile();
95
95
  if (s) {
96
96
  r = n;
97
- for (const i of t) i(n, s);
97
+ for (const o of t) o(n, s);
98
98
  }
99
99
  },
100
100
  subscribe: (n) => (t.add(n), () => {
@@ -104,7 +104,7 @@ var it = class extends Ve {
104
104
  getLastCompile: () => e.getLastCompile(),
105
105
  getCacheStats: () => e.getCacheStats()
106
106
  };
107
- }, pt = () => oe((e) => ({
107
+ }, ft = () => oe((e) => ({
108
108
  lastCompile: null,
109
109
  history: [],
110
110
  nextId: 1,
@@ -113,20 +113,20 @@ var it = class extends Ve {
113
113
  if (n.lastSnapshot === r) return n;
114
114
  const s = {
115
115
  id: n.nextId,
116
- label: vt(t),
116
+ label: yt(t),
117
117
  stages: r.stages,
118
118
  stageDurationsMs: r.stageDurationsMs,
119
119
  durationMs: r.durationMs
120
120
  };
121
121
  return {
122
122
  lastCompile: s,
123
- history: yt(n.history, s, ht),
123
+ history: St(n.history, s, gt),
124
124
  nextId: n.nextId + 1,
125
125
  lastSnapshot: r
126
126
  };
127
127
  })
128
- })), ft = () => {
129
- }, vt = (e) => {
128
+ })), vt = () => {
129
+ }, yt = (e) => {
130
130
  switch (e.kind) {
131
131
  case "init":
132
132
  return "init";
@@ -137,7 +137,7 @@ var it = class extends Ve {
137
137
  case "command":
138
138
  return e.command.metadata.description;
139
139
  }
140
- }, yt = (e, t, r) => {
140
+ }, St = (e, t, r) => {
141
141
  const n = e.length >= r ? e.length - (r - 1) : 0;
142
142
  return [...e.slice(n), t];
143
143
  };
@@ -157,18 +157,18 @@ function ge(e) {
157
157
  suggestion: `Add a render half for it: \`defineGeomRenderer(${d.type}Geom, { coord, render })\`, then include it in \`plugins\`.`
158
158
  }));
159
159
  }
160
- const i = /* @__PURE__ */ new Map();
160
+ const o = /* @__PURE__ */ new Map();
161
161
  for (const l of t) {
162
162
  if ("definition" in l) continue;
163
- const d = `${l.geom}|${l.coord}`, g = i.get(d);
164
- g ? g.count += 1 : i.set(d, {
163
+ const d = `${l.geom}|${l.coord}`, g = o.get(d);
164
+ g ? g.count += 1 : o.set(d, {
165
165
  geom: l.geom,
166
166
  coord: l.coord,
167
167
  count: 1
168
168
  });
169
169
  }
170
170
  const a = [];
171
- for (const { geom: l, coord: d, count: g } of i.values())
171
+ for (const { geom: l, coord: d, count: g } of o.values())
172
172
  g < 2 || a.push({
173
173
  kind: "userInput",
174
174
  severity: "warning",
@@ -180,15 +180,15 @@ function ge(e) {
180
180
  },
181
181
  suggestion: `Keep a single render-only override for ('${l}', '${d}').`
182
182
  });
183
- return a.push(...Ct(e)), {
183
+ return a.push(...Dt(e)), {
184
184
  errors: n,
185
185
  warnings: a
186
186
  };
187
187
  }
188
- function St(e, t) {
189
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
188
+ function bt(e, t) {
189
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
190
190
  for (const a of n)
191
- t(a.geom, r.type) !== null || s.has(a.geom) || (s.add(a.geom), i.push({
191
+ t(a.geom, r.type) !== null || s.has(a.geom) || (s.add(a.geom), o.push({
192
192
  kind: "userInput",
193
193
  severity: "warning",
194
194
  code: "MISSING_GEOM_RENDERER",
@@ -199,14 +199,14 @@ function St(e, t) {
199
199
  },
200
200
  suggestion: `Register a renderer for ('${a.geom}', '${r.type}') via \`defineGeomRenderer\`.`
201
201
  }));
202
- return i;
202
+ return o;
203
203
  }
204
- function bt(e, t) {
205
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
204
+ function Et(e, t) {
205
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
206
206
  for (const a of n) {
207
207
  if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
208
208
  const l = t(a.geom, r.type);
209
- l === null || l.hitTest || X(l) || (s.add(a.geom), i.push({
209
+ l === null || l.hitTest || X(l) || (s.add(a.geom), o.push({
210
210
  kind: "userInput",
211
211
  severity: "warning",
212
212
  code: "MISSING_RENDER_HIT_TEST",
@@ -218,9 +218,9 @@ function bt(e, t) {
218
218
  suggestion: `Add a \`hitTest\` factory (precomputed geometry) or a live render (\`{ fn, options: { live: true } }\`, live simulation) to the renderer for ('${a.geom}', '${r.type}').`
219
219
  }));
220
220
  }
221
- return i;
221
+ return o;
222
222
  }
223
- function Et(e) {
223
+ function Tt(e) {
224
224
  const t = /* @__PURE__ */ new Set(), r = [];
225
225
  for (const n of e.layers) {
226
226
  const s = n.identityKey;
@@ -238,12 +238,12 @@ function Et(e) {
238
238
  }
239
239
  return r;
240
240
  }
241
- function Tt(e, t) {
242
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
241
+ function Rt(e, t) {
242
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
243
243
  for (const a of n) {
244
244
  if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
245
245
  const l = t(a.geom, r.type);
246
- l === null || !l.hitTest || !X(l) || (s.add(a.geom), i.push({
246
+ l === null || !l.hitTest || !X(l) || (s.add(a.geom), o.push({
247
247
  kind: "userInput",
248
248
  severity: "warning",
249
249
  code: "CONFLICTING_RENDER_HIT_TEST",
@@ -255,9 +255,9 @@ function Tt(e, t) {
255
255
  suggestion: "Keep one: a `hitTest` factory for precomputed geometry, OR a live render (`{ fn, options: { live: true } }`) for a live simulation."
256
256
  }));
257
257
  }
258
- return i;
258
+ return o;
259
259
  }
260
- function Rt(e, t) {
260
+ function Gt(e, t) {
261
261
  const r = /* @__PURE__ */ new Set(), n = [];
262
262
  for (const s of e.layers)
263
263
  s.interactive !== !1 && (s.spatialKind !== "renderHitTest" || r.has(s.geom) || t.hasCapability(s.geom) || (r.add(s.geom), n.push({
@@ -274,11 +274,11 @@ function Rt(e, t) {
274
274
  return n;
275
275
  }
276
276
  function Nt(e, t) {
277
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), i = [];
277
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
278
278
  for (const a of n) {
279
279
  if (a.interactive === !1 || a.spatialKind === "renderHitTest" || s.has(a.geom)) continue;
280
280
  const l = t(a.geom, r.type);
281
- l === null || !X(l) || (s.add(a.geom), i.push({
281
+ l === null || !X(l) || (s.add(a.geom), o.push({
282
282
  kind: "userInput",
283
283
  severity: "warning",
284
284
  code: "LIVE_RENDER_REQUIRES_RENDER_HIT_TEST",
@@ -290,11 +290,11 @@ function Nt(e, t) {
290
290
  suggestion: "Have the geom's manifest yield spatialKind 'renderHitTest' so the scene layer carries the `byKey` index the live render's `pushHover` resolves against."
291
291
  }));
292
292
  }
293
- return i;
293
+ return o;
294
294
  }
295
- function Gt(e, t) {
295
+ function It(e, t) {
296
296
  let r;
297
- return e.layers.flatMap((n, s) => X(t(n.geom, e.coordSystem.type)) ? It(n) ? (r ??= Ee().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
297
+ return e.layers.flatMap((n, s) => X(t(n.geom, e.coordSystem.type)) ? Ct(n) ? (r ??= Ee().readers(e), (r.geom(n).get("overpaint", void 0, "hovered")?.length ?? 0) === 0 ? [] : [{
298
298
  kind: "userInput",
299
299
  severity: "warning",
300
300
  code: "INVALID_STYLE_RULE",
@@ -307,8 +307,8 @@ function Gt(e, t) {
307
307
  suggestion: "Remove the hovered overpaint, or paint the hover treatment in the geom's live render."
308
308
  }]) : [] : []);
309
309
  }
310
- var It = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
- function Ct(e) {
310
+ var Ct = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
+ function Dt(e) {
312
312
  const t = /* @__PURE__ */ new Set(), r = [];
313
313
  for (const n of e) {
314
314
  const s = Re(n);
@@ -326,58 +326,58 @@ function Ct(e) {
326
326
  }
327
327
  return r;
328
328
  }
329
- var Dt = (e) => oe((t) => ({
329
+ var wt = (e) => oe((t) => ({
330
330
  scene: e,
331
331
  setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
332
- })), wt = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: i, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: g }) => {
333
- const G = z(l), I = z(d), T = z(g), [{ session: u, compileBus: m, findGeom: R }] = S(() => {
334
- const o = Oe({
332
+ })), Lt = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: o, anchorResolver: a, onSpecChange: l, onError: d, onWarnings: g }) => {
333
+ const N = z(l), I = z(d), T = z(g), [{ session: u, compileBus: m, findGeom: R }] = S(() => {
334
+ const i = Oe({
335
335
  plugins: n,
336
336
  theme: s
337
337
  });
338
338
  return {
339
- session: new xe(o),
340
- compileBus: gt(o),
341
- findGeom: (h) => o.findGeom(h)
339
+ session: new xe(i),
340
+ compileBus: pt(i),
341
+ findGeom: (h) => i.findGeom(h)
342
342
  };
343
343
  }), [v] = S(() => {
344
- const o = ge(n ?? []), h = ge(s?.plugins ?? []);
344
+ const i = ge(n ?? []), h = ge(s?.plugins ?? []);
345
345
  return {
346
- errors: [...h.errors, ...o.errors],
347
- warnings: [...h.warnings, ...o.warnings]
346
+ errors: [...h.errors, ...i.errors],
347
+ warnings: [...h.warnings, ...i.warnings]
348
348
  };
349
- }), P = de(null), [y] = S(Lt), C = de(null), L = p((o) => v.errors.length === 0 ? o : [...v.errors, ...o ?? []], [v]), N = p((o) => {
350
- if (!o.ok) return o.errors;
351
- if (C.current) C.current.getState().setScene(o.scene);
349
+ }), P = de(null), [y] = S(Pt), C = de(null), L = p((i) => v.errors.length === 0 ? i : [...v.errors, ...i ?? []], [v]), G = p((i) => {
350
+ if (!i.ok) return i.errors;
351
+ if (C.current) C.current.getState().setScene(i.scene);
352
352
  else {
353
- const h = Dt(o.scene);
353
+ const h = wt(i.scene);
354
354
  h.subscribe(y.notify), C.current = h, y.notify();
355
355
  }
356
356
  return null;
357
357
  }, [y]), [O, $] = S(() => {
358
- const o = u.compile({
358
+ const i = u.compile({
359
359
  spec: e,
360
360
  data: t,
361
361
  colorScheme: r
362
362
  });
363
- return P.current = o, L(N(o));
364
- }), b = p((o) => o.ok ? [
365
- ...o.warnings,
366
- ...St(o.scene, i),
367
- ...bt(o.scene, i),
368
- ...Et(o.scene),
369
- ...Tt(o.scene, i),
370
- ...Nt(o.scene, i),
371
- ...Gt(o.scene, i),
372
- ...Rt(o.scene, a)
373
- ] : o.warnings, [i, a]), D = p((o) => {
374
- o.length !== 0 && (V(o), I.current?.(o));
375
- }, [I]), w = p((o) => {
376
- o.length !== 0 && (V(o), T.current?.(o));
363
+ return P.current = i, L(G(i));
364
+ }), b = p((i) => i.ok ? [
365
+ ...i.warnings,
366
+ ...bt(i.scene, o),
367
+ ...Et(i.scene, o),
368
+ ...Tt(i.scene),
369
+ ...Rt(i.scene, o),
370
+ ...Nt(i.scene, o),
371
+ ...It(i.scene, o),
372
+ ...Gt(i.scene, a)
373
+ ] : i.warnings, [o, a]), D = p((i) => {
374
+ i.length !== 0 && (V(i), I.current?.(i));
375
+ }, [I]), w = p((i) => {
376
+ i.length !== 0 && (V(i), T.current?.(i));
377
377
  }, [T]);
378
378
  H(() => {
379
- const o = P.current;
380
- o && (D([...v.errors, ...o.ok ? [] : o.errors]), w([...v.warnings, ...b(o)]), o.ok && m.emit({ kind: "init" }));
379
+ const i = P.current;
380
+ i && (D([...v.errors, ...i.ok ? [] : i.errors]), w([...v.warnings, ...b(i)]), i.ok && m.emit({ kind: "init" }));
381
381
  }, [
382
382
  m,
383
383
  D,
@@ -385,49 +385,49 @@ var Dt = (e) => oe((t) => ({
385
385
  v,
386
386
  b
387
387
  ]), H(() => {
388
- const o = u.update({
388
+ const i = u.update({
389
389
  spec: e,
390
390
  data: t,
391
391
  colorScheme: r
392
392
  });
393
- if (!o) return;
394
- o.committedSpec && G.current?.(o.committedSpec);
395
- const h = N(o.result);
396
- $(L(h)), h && D(h), w(b(o.result)), h || m.emit({ kind: o.hasSpecChange ? "spec" : "data" });
393
+ if (!i) return;
394
+ i.committedSpec && N.current?.(i.committedSpec);
395
+ const h = G(i.result);
396
+ $(L(h)), h && D(h), w(b(i.result)), h || m.emit({ kind: i.hasSpecChange ? "spec" : "data" });
397
397
  }, [
398
398
  e,
399
399
  t,
400
400
  r,
401
401
  u,
402
402
  m,
403
- N,
403
+ G,
404
404
  D,
405
405
  w,
406
406
  L,
407
407
  b,
408
- G
408
+ N
409
409
  ]);
410
- const x = p((o) => {
411
- $((h) => h === null ? h : L(null)), w(b(o));
410
+ const x = p((i) => {
411
+ $((h) => h === null ? h : L(null)), w(b(i));
412
412
  }, [
413
413
  L,
414
414
  w,
415
415
  b
416
- ]), F = p((o) => {
417
- o.scene && C.current?.getState().setScene(o.scene), o.result && x(o.result), o.command && m.emit({
416
+ ]), F = p((i) => {
417
+ i.scene && C.current?.getState().setScene(i.scene), i.result && x(i.result), i.command && m.emit({
418
418
  kind: "command",
419
- command: o.command
420
- }), o.spec && G.current?.(o.spec), o.errors && D([...o.errors]);
419
+ command: i.command
420
+ }), i.spec && N.current?.(i.spec), i.errors && D([...i.errors]);
421
421
  }, [
422
422
  x,
423
423
  m,
424
- G,
424
+ N,
425
425
  D
426
- ]), E = p((o) => {
427
- for (const h of o) F(h);
428
- return o.some((h) => !!h.scene);
429
- }, [F]), _ = p((o, h) => {
430
- E(u.applyCommand(o, h));
426
+ ]), E = p((i) => {
427
+ for (const h of i) F(h);
428
+ return i.some((h) => !!h.scene);
429
+ }, [F]), _ = p((i, h) => {
430
+ E(u.applyCommand(i, h));
431
431
  }, [u, E]), K = p(() => {
432
432
  E(u.commit());
433
433
  }, [u, E]), q = p(() => E(u.undo()), [u, E]), U = p(() => E(u.redo()), [u, E]), j = k(() => ({
@@ -450,7 +450,7 @@ var Dt = (e) => oe((t) => ({
450
450
  compileErrors: O,
451
451
  findGeom: R
452
452
  };
453
- }, Lt = () => {
453
+ }, Pt = () => {
454
454
  const e = /* @__PURE__ */ new Set();
455
455
  return {
456
456
  subscribe: (t) => (e.add(t), () => {
@@ -458,8 +458,8 @@ var Dt = (e) => oe((t) => ({
458
458
  }),
459
459
  notify: () => e.forEach((t) => t())
460
460
  };
461
- }, Pt = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: i, onSpecChange: a, onError: l, onWarnings: d, colorScheme: g = "light", children: G }) => {
462
- const I = qt(s, d), [T] = S(() => n), u = T?.colorScheme ?? g, [m] = S(() => we([...T?.plugins ?? [], ...r].filter(Te))), R = Xe(), [v] = S(() => Be(r)), [P] = S(() => Fe(r)), [y] = S(() => dt()), [C] = S(() => Ge()), L = k(() => Ee({ colorScheme: u }), [u]), { store: N, dispatch: O, commit: $, history: b, subscribe: D, getScene: w, compileBus: x, compileErrors: F, findGeom: E } = wt({
461
+ }, qt = ({ data: e, spec: t, plugins: r = [], theme: n, formattingLocale: s, handleRef: o, onSpecChange: a, onError: l, onWarnings: d, colorScheme: g = "light", children: N }) => {
462
+ const I = _t(s, d), [T] = S(() => n), u = T?.colorScheme ?? g, [m] = S(() => we([...T?.plugins ?? [], ...r].filter(Te))), R = Qe(), [v] = S(() => Be(r)), [P] = S(() => Fe(r)), [y] = S(() => ut()), [C] = S(() => Ne()), L = k(() => Ee({ colorScheme: u }), [u]), { store: G, dispatch: O, commit: $, history: b, subscribe: D, getScene: w, compileBus: x, compileErrors: F, findGeom: E } = Lt({
463
463
  spec: t,
464
464
  data: e,
465
465
  colorScheme: u,
@@ -472,18 +472,18 @@ var Dt = (e) => oe((t) => ({
472
472
  onWarnings: d
473
473
  });
474
474
  H(() => {
475
- if (N)
476
- return N.subscribe((q, U) => {
475
+ if (G)
476
+ return G.subscribe((q, U) => {
477
477
  if (q.scene.spec === U.scene.spec) return;
478
478
  const { selection: j, setSelection: te } = y.getState();
479
- j.length !== 0 && te(ct(j, q.scene.spec));
479
+ j.length !== 0 && te(lt(j, q.scene.spec));
480
480
  });
481
- }, [N, y]);
481
+ }, [G, y]);
482
482
  const _ = k(() => ({
483
483
  dispatch: O,
484
484
  commit: $
485
485
  }), [O, $]);
486
- Qe(i, () => ({
486
+ Je(o, () => ({
487
487
  commands: _,
488
488
  undo: b.undo,
489
489
  redo: b.redo,
@@ -504,9 +504,9 @@ var Dt = (e) => oe((t) => ({
504
504
  y,
505
505
  P
506
506
  ]);
507
- const K = k(() => N ? {
507
+ const K = k(() => G ? {
508
508
  chartId: R,
509
- store: N,
509
+ store: G,
510
510
  selectionStore: y,
511
511
  targetBoundaryStore: C,
512
512
  commands: _,
@@ -519,7 +519,7 @@ var Dt = (e) => oe((t) => ({
519
519
  findGeom: E
520
520
  } : null, [
521
521
  R,
522
- N,
522
+ G,
523
523
  y,
524
524
  C,
525
525
  _,
@@ -531,7 +531,7 @@ var Dt = (e) => oe((t) => ({
531
531
  v,
532
532
  E
533
533
  ]);
534
- return /* @__PURE__ */ c(it, {
534
+ return /* @__PURE__ */ c(ct, {
535
535
  forcedErrors: F,
536
536
  onError: l,
537
537
  resetKeys: [t, e],
@@ -543,13 +543,13 @@ var Dt = (e) => oe((t) => ({
543
543
  value: P,
544
544
  children: /* @__PURE__ */ c(B, {
545
545
  shapes: T?.shapes,
546
- children: G
546
+ children: N
547
547
  })
548
548
  })
549
549
  })
550
550
  }) : null
551
551
  });
552
- }, qt = (e, t) => {
552
+ }, _t = (e, t) => {
553
553
  const r = z(t);
554
554
  return H(() => {
555
555
  if (e === void 0 || je(e) !== void 0) return;
@@ -562,11 +562,11 @@ var Dt = (e) => oe((t) => ({
562
562
  V(n), r.current?.(n);
563
563
  }, [e, r]), e === void 0 ? void 0 : Ae(e);
564
564
  };
565
- function hn({ theme: e, ...t } = {}) {
565
+ function gn({ theme: e, ...t } = {}) {
566
566
  const r = Ke(t);
567
567
  return {
568
568
  ...r,
569
- GraphProvider: (s) => /* @__PURE__ */ c(Pt, {
569
+ GraphProvider: (s) => /* @__PURE__ */ c(qt, {
570
570
  ...s,
571
571
  plugins: r.plugins,
572
572
  theme: e
@@ -578,15 +578,15 @@ var A = (e, t) => {
578
578
  if (!e.endsWith("%")) return null;
579
579
  const r = Number.parseFloat(e);
580
580
  return Number.isFinite(r) ? r / 100 * t : null;
581
- }, gn = ({ x: e, y: t, width: r, height: n }, s) => {
582
- const i = A(e, s.width), a = A(t, s.height), l = A(r, s.width), d = A(n, s.height);
583
- return i === null || a === null || l === null || d === null ? null : {
584
- x: i,
581
+ }, pn = ({ x: e, y: t, width: r, height: n }, s) => {
582
+ const o = A(e, s.width), a = A(t, s.height), l = A(r, s.width), d = A(n, s.height);
583
+ return o === null || a === null || l === null || d === null ? null : {
584
+ x: o,
585
585
  y: a,
586
586
  width: l,
587
587
  height: d
588
588
  };
589
- }, _t = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...i }) => {
589
+ }, kt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...o }) => {
590
590
  const a = Z(s);
591
591
  return e ? /* @__PURE__ */ c(ee.circle, {
592
592
  initial: !1,
@@ -597,16 +597,16 @@ var A = (e, t) => {
597
597
  },
598
598
  transition: J,
599
599
  style: a,
600
- ...i
600
+ ...o
601
601
  }) : /* @__PURE__ */ c("circle", {
602
602
  cx: t,
603
603
  cy: r,
604
604
  r: n,
605
605
  style: a,
606
- ...i
606
+ ...o
607
607
  });
608
- }, kt = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: i, ...a }) => {
609
- const l = Z(i);
608
+ }, Ht = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: o, ...a }) => {
609
+ const l = Z(o);
610
610
  return e ? /* @__PURE__ */ c(ee.line, {
611
611
  initial: !1,
612
612
  animate: {
@@ -626,7 +626,7 @@ var A = (e, t) => {
626
626
  style: l,
627
627
  ...a
628
628
  });
629
- }, Ht = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: i, ry: a, effects: l, ...d }) => {
629
+ }, $t = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: o, ry: a, effects: l, ...d }) => {
630
630
  const g = Z(l);
631
631
  return e ? /* @__PURE__ */ c(ee.rect, {
632
632
  initial: !1,
@@ -635,8 +635,8 @@ var A = (e, t) => {
635
635
  attrY: r,
636
636
  width: n,
637
637
  height: s,
638
- ...i !== void 0 && a !== void 0 ? {
639
- rx: i,
638
+ ...o !== void 0 && a !== void 0 ? {
639
+ rx: o,
640
640
  ry: a
641
641
  } : {}
642
642
  },
@@ -648,55 +648,57 @@ var A = (e, t) => {
648
648
  y: r,
649
649
  width: n,
650
650
  height: s,
651
- rx: i,
651
+ rx: o,
652
652
  ry: a,
653
653
  style: g,
654
654
  ...d
655
655
  });
656
- }, $t = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
657
- const i = Z(n);
658
- return e ? /* @__PURE__ */ c(xt, {
656
+ }, xt = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
657
+ const o = Z(n);
658
+ return e ? /* @__PURE__ */ c(Mt, {
659
659
  d: t,
660
660
  source: r,
661
- style: i,
661
+ style: o,
662
662
  ...s
663
663
  }) : /* @__PURE__ */ c("path", {
664
664
  d: t,
665
- style: i,
665
+ style: o,
666
666
  ...s
667
667
  });
668
- }, pn = (e) => {
669
- const { Circle: t } = Q();
670
- return t === void 0 ? _t(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
671
668
  }, fn = (e) => {
672
- const { Line: t } = Q();
669
+ const { Circle: t } = Q();
673
670
  return t === void 0 ? kt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
674
- }, vn = ({ cornerRadius: e, ...t }) => {
675
- const { Rect: r } = Q(), n = be(), s = Pe(), i = {
671
+ }, vn = (e) => {
672
+ const { Line: t } = Q();
673
+ return t === void 0 ? Ht(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
674
+ }, yn = ({ cornerRadius: e, ...t }) => {
675
+ const { Rect: r } = Q(), n = be(), s = Pe(), o = {
676
676
  ...t,
677
- ...Mt(e, t, n, s)
677
+ ...At(e, t, n, s)
678
678
  };
679
- return r === void 0 ? Ht(i) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(r, { ...i }) });
680
- }, yn = (e) => {
679
+ return r === void 0 ? $t(o) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(r, { ...o }) });
680
+ }, Sn = (e) => {
681
681
  const { Path: t } = Q();
682
- return t === void 0 ? $t(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
683
- }, xt = ({ d: e, source: t, ...r }) => {
682
+ return t === void 0 ? xt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
683
+ }, Mt = ({ d: e, source: t, ...r }) => {
684
684
  const n = ke(e, J, t);
685
685
  return /* @__PURE__ */ c(ee.path, {
686
686
  d: n,
687
687
  ...r
688
688
  });
689
- }, Mt = (e, t, r, n) => {
689
+ }, At = (e, t, r, n) => {
690
690
  if (e === void 0) return {};
691
- const s = At(t, r, n);
692
- if (s === null)
693
- return e === "full" ? {} : fe(le({ cornerRadius: e }), n);
694
- const i = Math.min(le({
695
- cornerRadius: e,
696
- box: s
697
- }), Math.min(s.width, s.height) / 2);
698
- return fe(i, n);
699
- }, At = (e, t, r) => {
691
+ const s = We(e);
692
+ if (s === void 0) return {};
693
+ const o = Bt(t, r, n);
694
+ if (o === null)
695
+ return s === "full" ? {} : fe(le({ cornerRadius: s }), n);
696
+ const a = Math.min(le({
697
+ cornerRadius: s,
698
+ box: o
699
+ }), Math.min(o.width, o.height) / 2);
700
+ return fe(a, n);
701
+ }, Bt = (e, t, r) => {
700
702
  const n = pe(e.width, t?.width, r.x), s = pe(e.height, t?.height, r.y);
701
703
  return n === null || s === null ? null : {
702
704
  width: n,
@@ -713,7 +715,7 @@ var A = (e, t) => {
713
715
  } : {
714
716
  rx: e / t.x,
715
717
  ry: e / t.y
716
- }, Sn = ({ children: e, ...t }) => {
718
+ }, bn = ({ children: e, ...t }) => {
717
719
  const r = be();
718
720
  return /* @__PURE__ */ c("svg", {
719
721
  viewBox: "0 0 1 1",
@@ -728,8 +730,8 @@ var A = (e, t) => {
728
730
  children: e
729
731
  })
730
732
  });
731
- }, bn = ({ box: e, children: t }) => {
732
- const r = qe(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), i = k(() => n === null || s === null ? null : {
733
+ }, En = ({ box: e, children: t }) => {
734
+ const r = qe(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), o = k(() => n === null || s === null ? null : {
733
735
  width: n,
734
736
  height: s
735
737
  }, [n, s]);
@@ -741,57 +743,57 @@ var A = (e, t) => {
741
743
  overflow: "hidden",
742
744
  pointerEvents: "none",
743
745
  children: /* @__PURE__ */ c(Se, {
744
- size: i,
746
+ size: o,
745
747
  children: t
746
748
  })
747
749
  });
748
- }, Bt = "drqe3u0", Ot = "drqe3u1", Ft = "drqe3u2", Kt = "drqe3u3", M = "drqe3u4", Ut = "drqe3u5", jt = "drqe3u6", Wt = "drqe3u7", Y = "drqe3u8", Yt = "drqe3u9", zt = "drqe3ua";
749
- var Vt = "drqe3uc", Xt = "drqe3ud", Qt = "drqe3ue", Jt = "drqe3uf";
750
- var Zt = "drqe3uh", er = "drqe3ui", ve = {
750
+ }, Ot = "drqe3u0", Ft = "drqe3u1", Kt = "drqe3u2", Ut = "drqe3u3", M = "drqe3u4", jt = "drqe3u5", Wt = "drqe3u6", Yt = "drqe3u7", Y = "drqe3u8", zt = "drqe3u9", Vt = "drqe3ua";
751
+ var Xt = "drqe3uc", Qt = "drqe3ud", Jt = "drqe3ue", Zt = "drqe3uf";
752
+ var er = "drqe3uh", tr = "drqe3ui", ve = {
751
753
  enabled: "drqe3uk drqe3uj",
752
754
  disabled: "drqe3ul drqe3uj"
753
755
  }, ye = {
754
756
  ran: "drqe3un drqe3um",
755
757
  dim: "drqe3uo drqe3um"
756
- }, Ne = {
758
+ }, Ge = {
757
759
  ran: "drqe3uq drqe3up",
758
760
  cached: "drqe3ur drqe3up",
759
761
  untouched: "drqe3us drqe3up"
760
- }, En = ({ width: e = 440, style: t, className: r } = {}) => {
761
- const { compileBus: n } = ne(), [s] = S(() => pt()), [i, a] = S(!1), [l, d] = S(We);
762
+ }, Tn = ({ width: e = 440, style: t, className: r } = {}) => {
763
+ const { compileBus: n } = ne(), [s] = S(() => ft()), [o, a] = S(!1), [l, d] = S(Ye);
762
764
  H(() => {
763
765
  const { recordCompile: m } = s.getState(), R = n.getLastTrigger(), v = n.getLastCompile();
764
766
  return R && v && m(R, v), n.subscribe(m);
765
767
  }, [s, n]);
766
- const g = re(s, (m) => m.lastCompile), G = re(s, (m) => m.history), I = n.getCacheStats(), T = g === null && G.length === 0, u = () => {
768
+ const g = re(s, (m) => m.lastCompile), N = re(s, (m) => m.history), I = n.getCacheStats(), T = g === null && N.length === 0, u = () => {
767
769
  d((m) => {
768
770
  const R = !m;
769
- return ze(R), R;
771
+ return Ve(R), R;
770
772
  });
771
773
  };
772
774
  return /* @__PURE__ */ f("div", {
773
- className: et(zt, r),
775
+ className: tt(Vt, r),
774
776
  style: {
775
777
  width: e,
776
778
  ...t
777
779
  },
778
780
  children: [
779
781
  /* @__PURE__ */ f("div", {
780
- className: Bt,
782
+ className: Ot,
781
783
  children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ c("div", {
782
- className: Ot,
784
+ className: Ft,
783
785
  children: "compile cache"
784
786
  }), /* @__PURE__ */ c("div", {
785
- className: Qt,
787
+ className: Jt,
786
788
  children: T ? "production: stats disabled" : g ? `last: ${g.label} · ${ae(g.durationMs)}` : "awaiting first compile…"
787
789
  })] }), /* @__PURE__ */ c("button", {
788
790
  type: "button",
789
791
  onClick: () => a((m) => !m),
790
- className: Jt,
791
- children: i ? "▾" : "▴"
792
+ className: Zt,
793
+ children: o ? "▾" : "▴"
792
794
  })]
793
795
  }),
794
- !i && /* @__PURE__ */ f("div", {
796
+ !o && /* @__PURE__ */ f("div", {
795
797
  className: "drqe3ub",
796
798
  children: [/* @__PURE__ */ f("button", {
797
799
  type: "button",
@@ -804,20 +806,20 @@ var Zt = "drqe3uh", er = "drqe3ui", ve = {
804
806
  children: "next compile reflects this toggle"
805
807
  })]
806
808
  }),
807
- !i && !T && /* @__PURE__ */ f(Ze, { children: [/* @__PURE__ */ c(tr, {
809
+ !o && !T && /* @__PURE__ */ f(et, { children: [/* @__PURE__ */ c(rr, {
808
810
  delta: g?.stages,
809
811
  durations: g?.stageDurationsMs,
810
812
  cumulative: I
811
- }), /* @__PURE__ */ c(rr, { entries: G })] })
813
+ }), /* @__PURE__ */ c(nr, { entries: N })] })
812
814
  ]
813
815
  });
814
- }, tr = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
815
- className: Ft,
816
+ }, rr = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
817
+ className: Kt,
816
818
  children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ f("tr", {
817
- className: Zt,
819
+ className: er,
818
820
  children: [
819
821
  /* @__PURE__ */ c("th", {
820
- className: Kt,
822
+ className: Ut,
821
823
  children: "stage"
822
824
  }),
823
825
  /* @__PURE__ */ c("th", {
@@ -842,15 +844,15 @@ var Zt = "drqe3uh", er = "drqe3ui", ve = {
842
844
  })
843
845
  ]
844
846
  }) }), /* @__PURE__ */ c("tbody", { children: se.map((n) => {
845
- const s = e?.[n], i = nr(s);
847
+ const s = e?.[n], o = sr(s);
846
848
  return /* @__PURE__ */ f("tr", {
847
- className: Vt,
849
+ className: Xt,
848
850
  children: [
849
851
  /* @__PURE__ */ f("td", {
850
- className: Ut,
852
+ className: jt,
851
853
  children: [
852
854
  /* @__PURE__ */ c("span", {
853
- className: Ne[i],
855
+ className: Ge[o],
854
856
  "aria-hidden": !0
855
857
  }),
856
858
  " ",
@@ -859,10 +861,10 @@ var Zt = "drqe3uh", er = "drqe3ui", ve = {
859
861
  }),
860
862
  /* @__PURE__ */ c("td", {
861
863
  className: Y,
862
- children: t === void 0 || i === "untouched" ? "—" : ae(t[n])
864
+ children: t === void 0 || o === "untouched" ? "—" : ae(t[n])
863
865
  }),
864
866
  /* @__PURE__ */ c("td", {
865
- className: i === "ran" ? ye.ran : ye.dim,
867
+ className: o === "ran" ? ye.ran : ye.dim,
866
868
  children: s?.misses ?? 0
867
869
  }),
868
870
  /* @__PURE__ */ c("td", {
@@ -880,27 +882,27 @@ var Zt = "drqe3uh", er = "drqe3ui", ve = {
880
882
  ]
881
883
  }, n);
882
884
  }) })]
883
- }), rr = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
884
- className: Xt,
885
+ }), nr = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
886
+ className: Qt,
885
887
  children: [/* @__PURE__ */ c("div", {
886
- className: er,
888
+ className: tr,
887
889
  children: "recent compiles"
888
890
  }), e.map((t) => {
889
- const r = sr(t.stages, (i) => i.misses > 0), n = se.length;
891
+ const r = or(t.stages, (o) => o.misses > 0), n = se.length;
890
892
  return /* @__PURE__ */ f("div", {
891
- className: jt,
893
+ className: Wt,
892
894
  children: [
893
895
  /* @__PURE__ */ c("span", {
894
- className: Ne[r === 0 ? "cached" : "ran"],
896
+ className: Ge[r === 0 ? "cached" : "ran"],
895
897
  "aria-hidden": !0
896
898
  }),
897
899
  /* @__PURE__ */ c("span", {
898
- className: Wt,
900
+ className: Yt,
899
901
  title: t.label,
900
902
  children: t.label
901
903
  }),
902
904
  /* @__PURE__ */ f("span", {
903
- className: Yt,
905
+ className: zt,
904
906
  children: [
905
907
  r,
906
908
  "/",
@@ -912,12 +914,12 @@ var Zt = "drqe3uh", er = "drqe3ui", ve = {
912
914
  ]
913
915
  }, t.id);
914
916
  })]
915
- }), nr = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", sr = (e, t) => {
917
+ }), sr = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", or = (e, t) => {
916
918
  let r = 0;
917
919
  for (const n of se) t(e[n]) && (r += 1);
918
920
  return r;
919
- }, ae = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, Tn = () => {
920
- const { history: e } = ne(), { stack: t, undo: r, redo: n } = e, s = p((l) => t.subscribe(l), [t]), i = p(() => t.getSnapshot(), [t]), a = Je(s, i, i);
921
+ }, ae = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, Rn = () => {
922
+ const { history: e } = ne(), { stack: t, undo: r, redo: n } = e, s = p((l) => t.subscribe(l), [t]), o = p(() => t.getSnapshot(), [t]), a = Ze(s, o, o);
921
923
  return k(() => ({
922
924
  ...a,
923
925
  undo: r,
@@ -927,7 +929,7 @@ var Zt = "drqe3uh", er = "drqe3ui", ve = {
927
929
  r,
928
930
  n
929
931
  ]);
930
- }, or = /* @__PURE__ */ new Set([
932
+ }, ar = /* @__PURE__ */ new Set([
931
933
  "button",
932
934
  "checkbox",
933
935
  "color",
@@ -938,98 +940,98 @@ var Zt = "drqe3uh", er = "drqe3ui", ve = {
938
940
  "range",
939
941
  "reset",
940
942
  "submit"
941
- ]), Rn = (e, t = {}) => {
943
+ ]), Gn = (e, t = {}) => {
942
944
  const { target: r, enabled: n = !0 } = t;
943
945
  H(() => {
944
- const s = ar(r);
946
+ const s = ir(r);
945
947
  if (!n || !s) return;
946
- const i = (a) => {
947
- if (!ir(a) || a.defaultPrevented || cr(a.target)) return;
948
+ const o = (a) => {
949
+ if (!cr(a) || a.defaultPrevented || lr(a.target)) return;
948
950
  const l = _e(a);
949
951
  if (!l) return;
950
952
  const d = e.current;
951
953
  d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
952
954
  };
953
- return s.addEventListener("keydown", i), () => s.removeEventListener("keydown", i);
955
+ return s.addEventListener("keydown", o), () => s.removeEventListener("keydown", o);
954
956
  }, [
955
957
  e,
956
958
  r,
957
959
  n
958
960
  ]);
959
- }, ar = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, ir = (e) => "key" in e, cr = (e) => e instanceof HTMLInputElement ? !or.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Nn = () => {
961
+ }, ir = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, cr = (e) => "key" in e, lr = (e) => e instanceof HTMLInputElement ? !ar.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, Nn = () => {
960
962
  const { targetBoundaryStore: e } = ne();
961
963
  return re(e, (t) => t.boundary);
962
964
  };
963
965
  export {
964
- xr as CanvasTextMeasurer,
965
- sn as DefaultFooter,
966
- _t as DefaultGeomCircle,
967
- kt as DefaultGeomLine,
968
- $t as DefaultGeomPath,
969
- Ht as DefaultGeomRect,
970
- Vr as DefaultGrid,
971
- Ir as DefaultHeader,
972
- Pr as DefaultSwatch,
973
- Xr as DefaultTooltip,
974
- En as DevToolsPanel,
975
- gr as GRAPH_MODES,
976
- pn as GeomCircle,
977
- fn as GeomLine,
978
- Tr as GeomOverpaint,
979
- yn as GeomPath,
980
- vn as GeomRect,
981
- it as GraphErrorBoundary,
966
+ Mr as CanvasTextMeasurer,
967
+ on as DefaultFooter,
968
+ kt as DefaultGeomCircle,
969
+ Ht as DefaultGeomLine,
970
+ xt as DefaultGeomPath,
971
+ $t as DefaultGeomRect,
972
+ Xr as DefaultGrid,
973
+ Cr as DefaultHeader,
974
+ qr as DefaultSwatch,
975
+ Qr as DefaultTooltip,
976
+ Tn as DevToolsPanel,
977
+ pr as GRAPH_MODES,
978
+ fn as GeomCircle,
979
+ vn as GeomLine,
980
+ Rr as GeomOverpaint,
981
+ Sn as GeomPath,
982
+ yn as GeomRect,
983
+ ct as GraphErrorBoundary,
982
984
  ue as GraphErrorPanel,
983
- Pt as GraphProvider,
984
- qr as GraphRenderer,
985
- mr as GraphyBadge,
986
- fr as HoverProvider,
987
- rn as IntlProvider,
988
- yr as IntroFade,
989
- Jr as IntroWipeClip,
990
- Gr as TextMeasurerProvider,
991
- Ar as ThemeProvider,
992
- bn as UnitBoxSvg,
993
- Sn as UnitSpaceSvg,
994
- tn as buildDotsEditOutlineShapes,
995
- hn as createGraphyKit,
996
- Zr as darkTheme,
997
- vr as defineGeomRenderer,
998
- wr as getBuiltInEditOutlineShapes,
999
- nn as lightTheme,
1000
- _r as lightenCss,
1001
- pr as projectPointCartesian,
1002
- ct as pruneSelection,
985
+ qt as GraphProvider,
986
+ _r as GraphRenderer,
987
+ hr as GraphyBadge,
988
+ vr as HoverProvider,
989
+ nn as IntlProvider,
990
+ Sr as IntroFade,
991
+ Zr as IntroWipeClip,
992
+ Ir as TextMeasurerProvider,
993
+ Br as ThemeProvider,
994
+ En as UnitBoxSvg,
995
+ bn as UnitSpaceSvg,
996
+ rn as buildDotsEditOutlineShapes,
997
+ gn as createGraphyKit,
998
+ en as darkTheme,
999
+ yr as defineGeomRenderer,
1000
+ Lr as getBuiltInEditOutlineShapes,
1001
+ sn as lightTheme,
1002
+ kr as lightenCss,
1003
+ fr as projectPointCartesian,
1004
+ lt as pruneSelection,
1003
1005
  A as readPositionPixels,
1004
- gn as readRectPixels,
1005
- Lr as resolveGraphyBadgeVariant,
1006
- Cr as resolvePathStroke,
1007
- Dr as scalePointToPanel,
1008
- Or as stampAxisEditTarget,
1009
- Sr as stampGridEditTarget,
1010
- Er as stampLegendEditTarget,
1011
- Ur as useElementScreenRect,
1012
- kr as useFormattingLocale,
1006
+ pn as readRectPixels,
1007
+ Pr as resolveGraphyBadgeVariant,
1008
+ Dr as resolvePathStroke,
1009
+ wr as scalePointToPanel,
1010
+ Fr as stampAxisEditTarget,
1011
+ br as stampGridEditTarget,
1012
+ Tr as stampLegendEditTarget,
1013
+ jr as useElementScreenRect,
1014
+ Hr as useFormattingLocale,
1013
1015
  Nr as useGeomHitTest,
1014
- br as useGeomHover,
1016
+ Er as useGeomHover,
1015
1017
  qe as useGeomPanelSize,
1016
- hr as useGeomReaderTree,
1017
- Rr as useGeomStyleReader,
1018
- Wr as useGraphCommands,
1019
- Br as useGraphHandle,
1020
- Tn as useGraphHistory,
1021
- Rn as useGraphHistoryShortcuts,
1022
- Yr as useGraphLocale,
1023
- Mr as useGraphSelection,
1024
- en as useGuidesTakePress,
1025
- zr as useHandleScene,
1026
- jr as useHoverState,
1027
- $r as usePaintDefs,
1028
- Qr as useResolvedStyle,
1029
- Fr as useSceneSelector,
1030
- Kr as useStyleReaderTree,
1031
- ur as useStyleResolver,
1018
+ gr as useGeomReaderTree,
1019
+ Gr as useGeomStyleReader,
1020
+ Yr as useGraphCommands,
1021
+ Or as useGraphHandle,
1022
+ Rn as useGraphHistory,
1023
+ Gn as useGraphHistoryShortcuts,
1024
+ zr as useGraphLocale,
1025
+ Ar as useGraphSelection,
1026
+ tn as useGuidesTakePress,
1027
+ Vr as useHandleScene,
1028
+ Wr as useHoverState,
1029
+ xr as usePaintDefs,
1030
+ Jr as useResolvedStyle,
1031
+ Kr as useSceneSelector,
1032
+ Ur as useStyleReaderTree,
1033
+ mr as useStyleResolver,
1032
1034
  Nn as useTargetBoundary,
1033
- dr as useTextMeasurer,
1034
- Hr as vars
1035
+ ur as useTextMeasurer,
1036
+ $r as vars
1035
1037
  };