@graphysdk/react-renderer 1.9.0-beta.1793705178615 → 1.9.0-beta.1793707591025

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 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-DFaoLzYd.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";
1
+ import { $t as fr, A as pr, B as vr, Bn as Ie, Bt as Ce, Dn as Pe, En as Le, Et as yr, Fn as Sr, Ft as br, Gt as we, Hn as X, Ht as Er, In as Tr, Kt as Rr, L as Gr, Ln as Nr, Lt as V, M as Ir, Mn as Cr, Nn as Pr, Nt as Lr, On as wr, Pn as Dr, Pt as qr, Qt as kr, R as _r, Rn as De, Sn as Hr, Tn as $r, Ut as xr, Vt as qe, Wt as Q, Xt as ke, Yt as Mr, _n as J, _t as Ar, a as Br, an as Or, at as Fr, bn as F, bt as Kr, cn as jr, ct as Ur, dn as Wr, en as zr, fn as be, gn as _e, h as Yr, hn as He, i as Vr, it as Xr, j as Qr, jn as $e, jt as Jr, kn as xe, kt as Zr, mn as Ee, mt as en, n as tn, ot as rn, pn as K, r as nn, s as sn, t as Me, tn as on, vn as an, vt as cn, w as ln, wn as dn, xn as j, yn as Ae, z as un, zn as ne } from "./history-chords-CZhXsP_q.js";
2
+ import { COMPILER_STAGE_KEYS as se, DEFAULT_LOCALE as Be, Geom as Oe, GraphCompilationSession as Fe, areEditTargetsEqual as Ke, buildDiagnostic as ie, canonicalizeLocale as je, createAnchorResolver as Ue, createCompiler as We, createDataLabelPlacementResolver as ze, createSpecBuilder as Ye, createStyleResolver as Te, findAnnotation as Ve, findIntlLocale as Xe, findLayerById as ce, foldGeomCornerRadii as Qe, isCompilerCachingEnabled as Je, resolveDefinition as Ze, resolveGeomCornerRadiusPx as le, setCompilerCachingEnabled as et, toPercent as z } from "@graphysdk/viz-engine";
3
+ import { Component as tt, useCallback as f, useEffect as H, useId as rt, useImperativeHandle as nt, useMemo as _, useRef as de, useState as y, useSyncExternalStore as st } from "react";
4
+ import { Fragment as ot, jsx as c, jsxs as p } from "react/jsx-runtime";
5
5
  import { useStore as re } from "zustand";
6
- import { motion as ee } from "motion/react";
6
+ import { motion as Z } from "motion/react";
7
7
  import { createStore as oe } from "zustand/vanilla";
8
- import tt from "clsx";
9
- import './index.css';var rt = "_1a5iqpb0", nt = "_1a5iqpb1";
10
- var st = "_1a5iqpb3", ot = "_1a5iqpb4", at = "_1a5iqpb5";
8
+ import at from "clsx";
9
+ import './index.css';var it = "_1a5iqpb0", ct = "_1a5iqpb1";
10
+ var lt = "_1a5iqpb3", dt = "_1a5iqpb4", ut = "_1a5iqpb5";
11
11
  var ue = ({ errors: e }) => {
12
12
  const [t, ...r] = e;
13
- return /* @__PURE__ */ f("div", {
13
+ return /* @__PURE__ */ p("div", {
14
14
  role: "alert",
15
- className: rt,
15
+ className: it,
16
16
  children: [
17
17
  /* @__PURE__ */ c("strong", {
18
- className: nt,
18
+ className: ct,
19
19
  children: "This chart could not be rendered."
20
20
  }),
21
21
  t && /* @__PURE__ */ c(me, { diagnostic: t }),
@@ -25,15 +25,15 @@ var ue = ({ errors: e }) => {
25
25
  })
26
26
  ]
27
27
  });
28
- }, me = ({ diagnostic: e }) => /* @__PURE__ */ f("div", {
29
- className: st,
28
+ }, me = ({ diagnostic: e }) => /* @__PURE__ */ p("div", {
29
+ className: lt,
30
30
  children: [
31
31
  /* @__PURE__ */ c("span", {
32
- className: ot,
32
+ className: dt,
33
33
  children: e.code
34
34
  }),
35
35
  /* @__PURE__ */ c("p", {
36
- className: at,
36
+ className: ut,
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 it(e = [], t = []) {
45
+ function mt(e = [], t = []) {
46
46
  return e.length === t.length && e.every((r, n) => Object.is(r, t[n]));
47
47
  }
48
- var ct = class extends Xe {
48
+ var ht = class extends tt {
49
49
  constructor(...e) {
50
50
  super(...e), this.state = { caughtDiagnostic: null };
51
51
  }
@@ -54,10 +54,10 @@ var ct = class extends Xe {
54
54
  }
55
55
  componentDidCatch(e, t) {
56
56
  const r = ie(e);
57
- V([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
57
+ X([r]), this.props.onError?.([r]), console.error("Chart render component stack:", t.componentStack);
58
58
  }
59
59
  componentDidUpdate(e) {
60
- this.state.caughtDiagnostic && !it(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
60
+ this.state.caughtDiagnostic && !mt(e.resetKeys, this.props.resetKeys) && this.setState({ caughtDiagnostic: null });
61
61
  }
62
62
  render() {
63
63
  const { caughtDiagnostic: e } = this.state;
@@ -65,24 +65,24 @@ var ct = class extends Xe {
65
65
  const { forcedErrors: t, children: r } = this.props;
66
66
  return t && t.length > 0 ? /* @__PURE__ */ c(ue, { errors: t }) : r;
67
67
  }
68
- }, Te = (e) => typeof e == "object" && "geom" in e && "render" in e, Re = (e) => {
69
- const t = ze(e);
70
- return t instanceof $e ? t : null;
71
- }, lt = (e, t) => {
72
- const r = e.filter((n) => dt(n, t));
68
+ }, Re = (e) => typeof e == "object" && "geom" in e && "render" in e, Ge = (e) => {
69
+ const t = Ze(e);
70
+ return t instanceof Oe ? t : null;
71
+ }, gt = (e, t) => {
72
+ const r = e.filter((n) => ft(n, t));
73
73
  return r.length === e.length ? e : r;
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) => ({
74
+ }, ft = (e, t) => e.kind === "annotation" ? Ve(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 = [], pt = () => oe((e) => ({
75
75
  selection: he,
76
- setSelection: (t) => e((r) => mt(r.selection, t) ? r : { selection: t }),
76
+ setSelection: (t) => e((r) => vt(r.selection, t) ? r : { selection: t }),
77
77
  clearSelection: () => e((t) => t.selection.length === 0 ? t : { selection: he })
78
- })), mt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
78
+ })), vt = (e, t) => e === t ? !0 : e.length !== t.length ? !1 : e.every((r, n) => {
79
79
  const s = t[n];
80
- return s !== void 0 && Me(r, s);
81
- }), ht = process.env.NODE_ENV !== "production", gt = 5, pt = (e) => {
82
- if (!ht) return {
80
+ return s !== void 0 && Ke(r, s);
81
+ }), yt = 5, St = (e) => {
82
+ if (!$e) return {
83
83
  emit: () => {
84
84
  },
85
- subscribe: () => vt,
85
+ subscribe: () => Et,
86
86
  getLastTrigger: () => null,
87
87
  getLastCompile: () => null,
88
88
  getCacheStats: () => e.getCacheStats()
@@ -94,7 +94,7 @@ var ct = class extends Xe {
94
94
  const s = e.getLastCompile();
95
95
  if (s) {
96
96
  r = n;
97
- for (const o of t) o(n, s);
97
+ for (const a of t) a(n, s);
98
98
  }
99
99
  },
100
100
  subscribe: (n) => (t.add(n), () => {
@@ -104,7 +104,7 @@ var ct = class extends Xe {
104
104
  getLastCompile: () => e.getLastCompile(),
105
105
  getCacheStats: () => e.getCacheStats()
106
106
  };
107
- }, ft = () => oe((e) => ({
107
+ }, bt = () => oe((e) => ({
108
108
  lastCompile: null,
109
109
  history: [],
110
110
  nextId: 1,
@@ -113,20 +113,20 @@ var ct = class extends Xe {
113
113
  if (n.lastSnapshot === r) return n;
114
114
  const s = {
115
115
  id: n.nextId,
116
- label: yt(t),
116
+ label: Tt(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: St(n.history, s, gt),
123
+ history: Rt(n.history, s, yt),
124
124
  nextId: n.nextId + 1,
125
125
  lastSnapshot: r
126
126
  };
127
127
  })
128
- })), vt = () => {
129
- }, yt = (e) => {
128
+ })), Et = () => {
129
+ }, Tt = (e) => {
130
130
  switch (e.kind) {
131
131
  case "init":
132
132
  return "init";
@@ -137,14 +137,14 @@ var ct = class extends Xe {
137
137
  case "command":
138
138
  return e.command.metadata.description;
139
139
  }
140
- }, St = (e, t, r) => {
140
+ }, Rt = (e, t, r) => {
141
141
  const n = e.length >= r ? e.length - (r - 1) : 0;
142
142
  return [...e.slice(n), t];
143
143
  };
144
144
  function ge(e) {
145
- const t = e.filter(Te), r = /* @__PURE__ */ new Set([...Object.keys(Ie), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
145
+ const t = e.filter(Re), r = /* @__PURE__ */ new Set([...Object.keys(we), ...t.map((l) => l.geom)]), n = [], s = /* @__PURE__ */ new Set();
146
146
  for (const l of e) {
147
- const d = Re(l);
147
+ const d = Ge(l);
148
148
  d === null || r.has(d.type) || s.has(d.type) || (s.add(d.type), n.push({
149
149
  kind: "userInput",
150
150
  severity: "error",
@@ -157,70 +157,70 @@ 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 o = /* @__PURE__ */ new Map();
160
+ const a = /* @__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 = o.get(d);
164
- g ? g.count += 1 : o.set(d, {
163
+ const d = `${l.geom}|${l.coord}`, h = a.get(d);
164
+ h ? h.count += 1 : a.set(d, {
165
165
  geom: l.geom,
166
166
  coord: l.coord,
167
167
  count: 1
168
168
  });
169
169
  }
170
- const a = [];
171
- for (const { geom: l, coord: d, count: g } of o.values())
172
- g < 2 || a.push({
170
+ const i = [];
171
+ for (const { geom: l, coord: d, count: h } of a.values())
172
+ h < 2 || i.push({
173
173
  kind: "userInput",
174
174
  severity: "warning",
175
175
  code: "DUPLICATE_REGISTERED_TYPE",
176
- message: `Multiple render-only overrides register ('${l}', '${d}') (${g} entries); the last in the array wins.`,
176
+ message: `Multiple render-only overrides register ('${l}', '${d}') (${h} entries); the last in the array wins.`,
177
177
  context: {
178
178
  requested: `${l}@${d}`,
179
179
  kind: "geom-renderer"
180
180
  },
181
181
  suggestion: `Keep a single render-only override for ('${l}', '${d}').`
182
182
  });
183
- return a.push(...Dt(e)), {
183
+ return i.push(...qt(e)), {
184
184
  errors: n,
185
- warnings: a
185
+ warnings: i
186
186
  };
187
187
  }
188
- function bt(e, t) {
189
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
190
- for (const a of n)
191
- t(a.geom, r.type) !== null || s.has(a.geom) || (s.add(a.geom), o.push({
188
+ function Gt(e, t) {
189
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), a = [];
190
+ for (const i of n)
191
+ t(i.geom, r.type) !== null || s.has(i.geom) || (s.add(i.geom), a.push({
192
192
  kind: "userInput",
193
193
  severity: "warning",
194
194
  code: "MISSING_GEOM_RENDERER",
195
- message: `No renderer for geom '${a.geom}' under ${r.type} coords; the layer is not painted.`,
195
+ message: `No renderer for geom '${i.geom}' under ${r.type} coords; the layer is not painted.`,
196
196
  context: {
197
- requested: a.geom,
197
+ requested: i.geom,
198
198
  kind: "geom-renderer"
199
199
  },
200
- suggestion: `Register a renderer for ('${a.geom}', '${r.type}') via \`defineGeomRenderer\`.`
200
+ suggestion: `Register a renderer for ('${i.geom}', '${r.type}') via \`defineGeomRenderer\`.`
201
201
  }));
202
- return o;
202
+ return a;
203
203
  }
204
- function Et(e, t) {
205
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
206
- for (const a of n) {
207
- if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
208
- const l = t(a.geom, r.type);
209
- l === null || l.hitTest || X(l) || (s.add(a.geom), o.push({
204
+ function Nt(e, t) {
205
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), a = [];
206
+ for (const i of n) {
207
+ if (i.interactive === !1 || i.spatialKind !== "renderHitTest" || s.has(i.geom)) continue;
208
+ const l = t(i.geom, r.type);
209
+ l === null || l.hitTest || Q(l) || (s.add(i.geom), a.push({
210
210
  kind: "userInput",
211
211
  severity: "warning",
212
212
  code: "MISSING_RENDER_HIT_TEST",
213
- message: `Geom '${a.geom}' declares spatialKind 'renderHitTest' but its renderer provides no hit-test; the layer has no hover.`,
213
+ message: `Geom '${i.geom}' declares spatialKind 'renderHitTest' but its renderer provides no hit-test; the layer has no hover.`,
214
214
  context: {
215
- requested: a.geom,
215
+ requested: i.geom,
216
216
  kind: "geom-renderer"
217
217
  },
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}').`
218
+ suggestion: `Add a \`hitTest\` factory (precomputed geometry) or a live render (\`{ fn, options: { live: true } }\`, live simulation) to the renderer for ('${i.geom}', '${r.type}').`
219
219
  }));
220
220
  }
221
- return o;
221
+ return a;
222
222
  }
223
- function Tt(e) {
223
+ function It(e) {
224
224
  const t = /* @__PURE__ */ new Set(), r = [];
225
225
  for (const n of e.layers) {
226
226
  const s = n.identityKey;
@@ -238,26 +238,26 @@ function Tt(e) {
238
238
  }
239
239
  return r;
240
240
  }
241
- function Rt(e, t) {
242
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
243
- for (const a of n) {
244
- if (a.interactive === !1 || a.spatialKind !== "renderHitTest" || s.has(a.geom)) continue;
245
- const l = t(a.geom, r.type);
246
- l === null || !l.hitTest || !X(l) || (s.add(a.geom), o.push({
241
+ function Ct(e, t) {
242
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), a = [];
243
+ for (const i of n) {
244
+ if (i.interactive === !1 || i.spatialKind !== "renderHitTest" || s.has(i.geom)) continue;
245
+ const l = t(i.geom, r.type);
246
+ l === null || !l.hitTest || !Q(l) || (s.add(i.geom), a.push({
247
247
  kind: "userInput",
248
248
  severity: "warning",
249
249
  code: "CONFLICTING_RENDER_HIT_TEST",
250
- message: `Geom '${a.geom}' declares both a \`hitTest\` factory and a live render; these are alternatives, so only the live render is used.`,
250
+ message: `Geom '${i.geom}' declares both a \`hitTest\` factory and a live render; these are alternatives, so only the live render is used.`,
251
251
  context: {
252
- requested: a.geom,
252
+ requested: i.geom,
253
253
  kind: "geom-renderer"
254
254
  },
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 o;
258
+ return a;
259
259
  }
260
- function Gt(e, t) {
260
+ function Pt(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({
@@ -273,28 +273,28 @@ function Gt(e, t) {
273
273
  })));
274
274
  return n;
275
275
  }
276
- function Nt(e, t) {
277
- const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), o = [];
278
- for (const a of n) {
279
- if (a.interactive === !1 || a.spatialKind === "renderHitTest" || s.has(a.geom)) continue;
280
- const l = t(a.geom, r.type);
281
- l === null || !X(l) || (s.add(a.geom), o.push({
276
+ function Lt(e, t) {
277
+ const { coordSystem: r, layers: n } = e, s = /* @__PURE__ */ new Set(), a = [];
278
+ for (const i of n) {
279
+ if (i.interactive === !1 || i.spatialKind === "renderHitTest" || s.has(i.geom)) continue;
280
+ const l = t(i.geom, r.type);
281
+ l === null || !Q(l) || (s.add(i.geom), a.push({
282
282
  kind: "userInput",
283
283
  severity: "warning",
284
284
  code: "LIVE_RENDER_REQUIRES_RENDER_HIT_TEST",
285
- message: `Geom '${a.geom}' declares a live render but its layer's spatialKind is '${a.spatialKind}', not 'renderHitTest'; its push-path hover resolves to nothing.`,
285
+ message: `Geom '${i.geom}' declares a live render but its layer's spatialKind is '${i.spatialKind}', not 'renderHitTest'; its push-path hover resolves to nothing.`,
286
286
  context: {
287
- requested: a.geom,
287
+ requested: i.geom,
288
288
  kind: "geom-renderer"
289
289
  },
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 o;
293
+ return a;
294
294
  }
295
- function It(e, t) {
295
+ function wt(e, t) {
296
296
  let r;
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 ? [] : [{
297
+ return e.layers.flatMap((n, s) => Q(t(n.geom, e.coordSystem.type)) ? Dt(n) ? (r ??= Te().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,11 +307,11 @@ function It(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 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) {
310
+ var Dt = (e) => [e.styles.defaults, e.styles.overrides].some((t) => t.some((r) => r.state === "hovered" && (r.declarations.overpaint?.length ?? 0) > 0));
311
+ function qt(e) {
312
312
  const t = /* @__PURE__ */ new Set(), r = [];
313
313
  for (const n of e) {
314
- const s = Re(n);
314
+ const s = Ge(n);
315
315
  s === null || t.has(s.type) || s.dataLabelCoordTypes.length === 0 || s.getDataLabelPlacements !== void 0 || (t.add(s.type), r.push({
316
316
  kind: "userInput",
317
317
  severity: "warning",
@@ -326,131 +326,131 @@ function Dt(e) {
326
326
  }
327
327
  return r;
328
328
  }
329
- var wt = (e) => oe((t) => ({
329
+ var kt = (e) => oe((t) => ({
330
330
  scene: e,
331
331
  setScene: (r) => t((n) => n.scene === r ? n : { scene: r })
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({
332
+ })), _t = ({ spec: e, data: t, colorScheme: r, plugins: n, theme: s, resolveRenderer: a, anchorResolver: i, onSpecChange: l, onError: d, onWarnings: h }) => {
333
+ const N = V(l), D = V(d), G = V(h), [{ session: g, compileBus: m, findGeom: S }] = y(() => {
334
+ const o = We({
335
335
  plugins: n,
336
336
  theme: s
337
337
  });
338
338
  return {
339
- session: new xe(i),
340
- compileBus: pt(i),
341
- findGeom: (h) => i.findGeom(h)
339
+ session: new Fe(o),
340
+ compileBus: St(o),
341
+ findGeom: (u) => o.findGeom(u)
342
342
  };
343
- }), [v] = S(() => {
344
- const i = ge(n ?? []), h = ge(s?.plugins ?? []);
343
+ }), [b] = y(() => {
344
+ const o = ge(n ?? []), u = ge(s?.plugins ?? []);
345
345
  return {
346
- errors: [...h.errors, ...i.errors],
347
- warnings: [...h.warnings, ...i.warnings]
346
+ errors: [...u.errors, ...o.errors],
347
+ warnings: [...u.warnings, ...o.warnings]
348
348
  };
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);
349
+ }), $ = de(null), [L] = y(Ht), T = de(null), v = f((o) => b.errors.length === 0 ? o : [...b.errors, ...o ?? []], [b]), q = f((o) => {
350
+ if (!o.ok) return o.errors;
351
+ if (T.current) T.current.getState().setScene(o.scene);
352
352
  else {
353
- const h = wt(i.scene);
354
- h.subscribe(y.notify), C.current = h, y.notify();
353
+ const u = kt(o.scene);
354
+ u.subscribe(L.notify), T.current = u, L.notify();
355
355
  }
356
356
  return null;
357
- }, [y]), [O, $] = S(() => {
358
- const i = u.compile({
357
+ }, [L]), [U, I] = y(() => {
358
+ const o = g.compile({
359
359
  spec: e,
360
360
  data: t,
361
361
  colorScheme: r
362
362
  });
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
- }, [T]);
363
+ return $.current = o, v(q(o));
364
+ }), C = f((o) => o.ok ? [
365
+ ...o.warnings,
366
+ ...Gt(o.scene, a),
367
+ ...Nt(o.scene, a),
368
+ ...It(o.scene),
369
+ ...Ct(o.scene, a),
370
+ ...Lt(o.scene, a),
371
+ ...wt(o.scene, a),
372
+ ...Pt(o.scene, i)
373
+ ] : o.warnings, [a, i]), P = f((o) => {
374
+ o.length !== 0 && (X(o), D.current?.(o));
375
+ }, [D]), E = f((o) => {
376
+ o.length !== 0 && (X(o), G.current?.(o));
377
+ }, [G]);
378
378
  H(() => {
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" }));
379
+ const o = $.current;
380
+ o && (P([...b.errors, ...o.ok ? [] : o.errors]), E([...b.warnings, ...C(o)]), o.ok && m.emit({ kind: "init" }));
381
381
  }, [
382
382
  m,
383
- D,
384
- w,
385
- v,
386
- b
383
+ P,
384
+ E,
385
+ b,
386
+ C
387
387
  ]), H(() => {
388
- const i = u.update({
388
+ const o = g.update({
389
389
  spec: e,
390
390
  data: t,
391
391
  colorScheme: r
392
392
  });
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" });
393
+ if (!o) return;
394
+ o.committedSpec && N.current?.(o.committedSpec);
395
+ const u = q(o.result);
396
+ I(v(u)), u && P(u), E(C(o.result)), u || m.emit({ kind: o.hasSpecChange ? "spec" : "data" });
397
397
  }, [
398
398
  e,
399
399
  t,
400
400
  r,
401
- u,
401
+ g,
402
402
  m,
403
- G,
404
- D,
405
- w,
406
- L,
407
- b,
403
+ q,
404
+ P,
405
+ E,
406
+ v,
407
+ C,
408
408
  N
409
409
  ]);
410
- const x = p((i) => {
411
- $((h) => h === null ? h : L(null)), w(b(i));
410
+ const x = f((o) => {
411
+ I((u) => u === null ? u : v(null)), E(C(o));
412
412
  }, [
413
- L,
414
- w,
415
- b
416
- ]), F = p((i) => {
417
- i.scene && C.current?.getState().setScene(i.scene), i.result && x(i.result), i.command && m.emit({
413
+ v,
414
+ E,
415
+ C
416
+ ]), M = f((o) => {
417
+ o.scene && T.current?.getState().setScene(o.scene), o.result && x(o.result), o.command && m.emit({
418
418
  kind: "command",
419
- command: i.command
420
- }), i.spec && N.current?.(i.spec), i.errors && D([...i.errors]);
419
+ command: o.command
420
+ }), o.spec && N.current?.(o.spec), o.errors && P([...o.errors]);
421
421
  }, [
422
422
  x,
423
423
  m,
424
424
  N,
425
- D
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
- }, [u, E]), K = p(() => {
432
- E(u.commit());
433
- }, [u, E]), q = p(() => E(u.undo()), [u, E]), U = p(() => E(u.redo()), [u, E]), j = k(() => ({
434
- stack: u.history,
435
- undo: q,
436
- redo: U
425
+ P
426
+ ]), R = f((o) => {
427
+ for (const u of o) M(u);
428
+ return o.some((u) => !!u.scene);
429
+ }, [M]), ee = f((o, u) => {
430
+ R(g.applyCommand(o, u));
431
+ }, [g, R]), W = f(() => {
432
+ R(g.commit());
433
+ }, [g, R]), w = f(() => R(g.undo()), [g, R]), A = f(() => R(g.redo()), [g, R]), k = _(() => ({
434
+ stack: g.history,
435
+ undo: w,
436
+ redo: A
437
437
  }), [
438
- u,
439
- q,
440
- U
441
- ]), te = p(() => C.current?.getState().scene ?? null, []);
438
+ g,
439
+ w,
440
+ A
441
+ ]), te = f(() => T.current?.getState().scene ?? null, []);
442
442
  return {
443
- store: C.current,
444
- dispatch: _,
445
- commit: K,
446
- history: j,
447
- subscribe: y.subscribe,
443
+ store: T.current,
444
+ dispatch: ee,
445
+ commit: W,
446
+ history: k,
447
+ subscribe: L.subscribe,
448
448
  getScene: te,
449
449
  compileBus: m,
450
- compileErrors: O,
451
- findGeom: R
450
+ compileErrors: U,
451
+ findGeom: S
452
452
  };
453
- }, Pt = () => {
453
+ }, Ht = () => {
454
454
  const e = /* @__PURE__ */ new Set();
455
455
  return {
456
456
  subscribe: (t) => (e.add(t), () => {
@@ -458,156 +458,162 @@ var wt = (e) => oe((t) => ({
458
458
  }),
459
459
  notify: () => e.forEach((t) => t())
460
460
  };
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({
461
+ }, $t = ({ data: e, spec: t, plugins: r = [], theme: n, glyphs: s, formattingLocale: a, handleRef: i, onSpecChange: l, onError: d, onWarnings: h, colorScheme: N = "light", children: D }) => {
462
+ const G = xt(a, h), [g] = y(() => n), [m] = y(() => xe(n?.glyphs, s)), S = g?.colorScheme ?? N, [b] = y(() => qe([...g?.plugins ?? [], ...r].filter(Re))), $ = rt(), [L] = y(() => Ue(r)), [T] = y(() => ze(r)), [v] = y(() => pt()), [q] = y(() => Ce()), U = _(() => Te({ colorScheme: S }), [S]), { store: I, dispatch: C, commit: P, history: E, subscribe: x, getScene: M, compileBus: R, compileErrors: ee, findGeom: W } = _t({
463
463
  spec: t,
464
464
  data: e,
465
- colorScheme: u,
465
+ colorScheme: S,
466
466
  plugins: r,
467
- theme: T,
468
- resolveRenderer: m,
469
- anchorResolver: v,
470
- onSpecChange: a,
471
- onError: l,
472
- onWarnings: d
467
+ theme: g,
468
+ resolveRenderer: b,
469
+ anchorResolver: L,
470
+ onSpecChange: l,
471
+ onError: d,
472
+ onWarnings: h
473
473
  });
474
474
  H(() => {
475
- if (G)
476
- return G.subscribe((q, U) => {
477
- if (q.scene.spec === U.scene.spec) return;
478
- const { selection: j, setSelection: te } = y.getState();
479
- j.length !== 0 && te(lt(j, q.scene.spec));
475
+ if (I)
476
+ return I.subscribe((k, te) => {
477
+ if (k.scene.spec === te.scene.spec) return;
478
+ const { selection: o, setSelection: u } = v.getState();
479
+ o.length !== 0 && u(gt(o, k.scene.spec));
480
480
  });
481
- }, [G, y]);
482
- const _ = k(() => ({
483
- dispatch: O,
484
- commit: $
485
- }), [O, $]);
486
- Je(o, () => ({
487
- commands: _,
488
- undo: b.undo,
489
- redo: b.redo,
490
- subscribe: D,
491
- getScene: w,
492
- formattingLocale: I,
493
- getSelection: () => y.getState().selection,
494
- setSelection: (q) => y.getState().setSelection(q),
495
- subscribeSelection: y.subscribe,
496
- canPlaceDataLabels: P.hasCapability,
497
- canFormatDataLabelsAsPercentages: P.hasPercentageFormat
481
+ }, [I, v]);
482
+ const w = _(() => ({
483
+ dispatch: C,
484
+ commit: P
485
+ }), [C, P]);
486
+ nt(i, () => ({
487
+ commands: w,
488
+ undo: E.undo,
489
+ redo: E.redo,
490
+ subscribe: x,
491
+ getScene: M,
492
+ formattingLocale: G,
493
+ getSelection: () => v.getState().selection,
494
+ setSelection: (k) => v.getState().setSelection(k),
495
+ subscribeSelection: v.subscribe,
496
+ canPlaceDataLabels: T.hasCapability,
497
+ canFormatDataLabelsAsPercentages: T.hasPercentageFormat,
498
+ getGlyphs: () => m
498
499
  }), [
499
- _,
500
- b,
501
- D,
502
500
  w,
503
- I,
504
- y,
505
- P
501
+ E,
502
+ x,
503
+ M,
504
+ G,
505
+ v,
506
+ T,
507
+ m
506
508
  ]);
507
- const K = k(() => G ? {
508
- chartId: R,
509
- store: G,
510
- selectionStore: y,
511
- targetBoundaryStore: C,
512
- commands: _,
513
- history: b,
514
- formattingLocale: I,
515
- compileBus: x,
516
- colorScheme: u,
517
- styleResolver: L,
518
- anchorResolver: v,
519
- findGeom: E
509
+ const A = _(() => I ? {
510
+ chartId: $,
511
+ store: I,
512
+ selectionStore: v,
513
+ targetBoundaryStore: q,
514
+ commands: w,
515
+ history: E,
516
+ formattingLocale: G,
517
+ compileBus: R,
518
+ colorScheme: S,
519
+ styleResolver: U,
520
+ anchorResolver: L,
521
+ findGeom: W
520
522
  } : null, [
521
- R,
522
- G,
523
- y,
524
- C,
525
- _,
526
- b,
523
+ $,
527
524
  I,
528
- x,
529
- u,
530
- L,
531
525
  v,
532
- E
526
+ q,
527
+ w,
528
+ E,
529
+ G,
530
+ R,
531
+ S,
532
+ U,
533
+ L,
534
+ W
533
535
  ]);
534
- return /* @__PURE__ */ c(ct, {
535
- forcedErrors: F,
536
- onError: l,
536
+ return /* @__PURE__ */ c(ht, {
537
+ forcedErrors: ee,
538
+ onError: d,
537
539
  resetKeys: [t, e],
538
- children: K ? /* @__PURE__ */ c(Ce.Provider, {
539
- value: K,
540
- children: /* @__PURE__ */ c(Le, {
541
- value: m,
542
- children: /* @__PURE__ */ c(De, {
543
- value: P,
544
- children: /* @__PURE__ */ c(B, {
545
- shapes: T?.shapes,
546
- children: N
540
+ children: A ? /* @__PURE__ */ c(De.Provider, {
541
+ value: A,
542
+ children: /* @__PURE__ */ c(ke, {
543
+ value: b,
544
+ children: /* @__PURE__ */ c(Ie, {
545
+ value: T,
546
+ children: /* @__PURE__ */ c(K, {
547
+ shapes: g?.shapes,
548
+ children: /* @__PURE__ */ c(Pe, {
549
+ glyphs: m,
550
+ children: D
551
+ })
547
552
  })
548
553
  })
549
554
  })
550
555
  }) : null
551
556
  });
552
- }, _t = (e, t) => {
553
- const r = z(t);
557
+ }, xt = (e, t) => {
558
+ const r = V(t);
554
559
  return H(() => {
555
- if (e === void 0 || je(e) !== void 0) return;
560
+ if (e === void 0 || Xe(e) !== void 0) return;
556
561
  const n = [{
557
562
  severity: "warning",
558
563
  kind: "userInput",
559
564
  code: "INVALID_FORMATTING_LOCALE",
560
- message: `formattingLocale '${e}' is not a tag Intl can format in, so the chart formats in ${He}.`
565
+ message: `formattingLocale '${e}' is not a tag Intl can format in, so the chart formats in ${Be}.`
561
566
  }];
562
- V(n), r.current?.(n);
563
- }, [e, r]), e === void 0 ? void 0 : Ae(e);
567
+ X(n), r.current?.(n);
568
+ }, [e, r]), e === void 0 ? void 0 : je(e);
564
569
  };
565
- function gn({ theme: e, ...t } = {}) {
566
- const r = Ke(t);
570
+ function Sn({ theme: e, glyphs: t, ...r } = {}) {
571
+ const n = Ye(r);
567
572
  return {
568
- ...r,
569
- GraphProvider: (s) => /* @__PURE__ */ c(qt, {
570
- ...s,
571
- plugins: r.plugins,
572
- theme: e
573
+ ...n,
574
+ GraphProvider: (a) => /* @__PURE__ */ c($t, {
575
+ ...a,
576
+ plugins: n.plugins,
577
+ theme: e,
578
+ glyphs: t
573
579
  })
574
580
  };
575
581
  }
576
- var A = (e, t) => {
582
+ var O = (e, t) => {
577
583
  if (typeof e == "number") return Number.isFinite(e) ? e : null;
578
584
  if (!e.endsWith("%")) return null;
579
585
  const r = Number.parseFloat(e);
580
586
  return Number.isFinite(r) ? r / 100 * t : null;
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
- y: a,
587
+ }, bn = ({ x: e, y: t, width: r, height: n }, s) => {
588
+ const a = O(e, s.width), i = O(t, s.height), l = O(r, s.width), d = O(n, s.height);
589
+ return a === null || i === null || l === null || d === null ? null : {
590
+ x: a,
591
+ y: i,
586
592
  width: l,
587
593
  height: d
588
594
  };
589
- }, kt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...o }) => {
590
- const a = Z(s);
591
- return e ? /* @__PURE__ */ c(ee.circle, {
595
+ }, Mt = ({ animateTransitions: e, cx: t, cy: r, r: n, effects: s, ...a }) => {
596
+ const i = j(s);
597
+ return e ? /* @__PURE__ */ c(Z.circle, {
592
598
  initial: !1,
593
599
  animate: {
594
600
  cx: t,
595
601
  cy: r,
596
602
  r: n
597
603
  },
598
- transition: J,
599
- style: a,
600
- ...o
604
+ transition: F,
605
+ style: i,
606
+ ...a
601
607
  }) : /* @__PURE__ */ c("circle", {
602
608
  cx: t,
603
609
  cy: r,
604
610
  r: n,
605
- style: a,
606
- ...o
611
+ style: i,
612
+ ...a
607
613
  });
608
- }, Ht = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: o, ...a }) => {
609
- const l = Z(o);
610
- return e ? /* @__PURE__ */ c(ee.line, {
614
+ }, At = ({ animateTransitions: e, x1: t, y1: r, x2: n, y2: s, effects: a, ...i }) => {
615
+ const l = j(a);
616
+ return e ? /* @__PURE__ */ c(Z.line, {
611
617
  initial: !1,
612
618
  animate: {
613
619
  x1: t,
@@ -615,90 +621,110 @@ var A = (e, t) => {
615
621
  x2: n,
616
622
  y2: s
617
623
  },
618
- transition: J,
624
+ transition: F,
619
625
  style: l,
620
- ...a
626
+ ...i
621
627
  }) : /* @__PURE__ */ c("line", {
622
628
  x1: t,
623
629
  y1: r,
624
630
  x2: n,
625
631
  y2: s,
626
632
  style: l,
627
- ...a
633
+ ...i
628
634
  });
629
- }, $t = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: o, ry: a, effects: l, ...d }) => {
630
- const g = Z(l);
631
- return e ? /* @__PURE__ */ c(ee.rect, {
635
+ }, Bt = ({ animateTransitions: e, x: t, y: r, width: n, height: s, rx: a, ry: i, effects: l, ...d }) => {
636
+ const h = j(l);
637
+ return e ? /* @__PURE__ */ c(Z.rect, {
632
638
  initial: !1,
633
639
  animate: {
634
640
  attrX: t,
635
641
  attrY: r,
636
642
  width: n,
637
643
  height: s,
638
- ...o !== void 0 && a !== void 0 ? {
639
- rx: o,
640
- ry: a
644
+ ...a !== void 0 && i !== void 0 ? {
645
+ rx: a,
646
+ ry: i
641
647
  } : {}
642
648
  },
643
- transition: J,
644
- style: g,
649
+ transition: F,
650
+ style: h,
645
651
  ...d
646
652
  }) : /* @__PURE__ */ c("rect", {
647
653
  x: t,
648
654
  y: r,
649
655
  width: n,
650
656
  height: s,
651
- rx: o,
652
- ry: a,
653
- style: g,
657
+ rx: a,
658
+ ry: i,
659
+ style: h,
654
660
  ...d
655
661
  });
656
- }, xt = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
657
- const o = Z(n);
658
- return e ? /* @__PURE__ */ c(Mt, {
662
+ }, Ot = ({ animateTransitions: e, d: t, source: r, effects: n, ...s }) => {
663
+ const a = j(n);
664
+ return e ? /* @__PURE__ */ c(Ft, {
659
665
  d: t,
660
666
  source: r,
661
- style: o,
667
+ style: a,
662
668
  ...s
663
669
  }) : /* @__PURE__ */ c("path", {
664
670
  d: t,
665
- style: o,
671
+ style: a,
666
672
  ...s
667
673
  });
668
- }, fn = (e) => {
669
- const { Circle: t } = Q();
670
- return t === void 0 ? kt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
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 = {
674
+ }, En = (e) => {
675
+ const { Circle: t } = J(), { symbol: r, ...n } = e;
676
+ return r !== void 0 && r !== "circle" ? /* @__PURE__ */ c("g", {
677
+ style: j(e.effects),
678
+ "data-testid": e["data-testid"],
679
+ children: /* @__PURE__ */ c(Le, {
680
+ symbol: r,
681
+ cx: fe(e.cx),
682
+ cy: fe(e.cy),
683
+ size: e.r * 2,
684
+ fill: e.fill ?? "currentColor",
685
+ fillOpacity: e.fillOpacity,
686
+ opacity: e.opacity,
687
+ stroke: e.stroke,
688
+ strokeOpacity: e.strokeOpacity,
689
+ strokeWidth: e.strokeWidth,
690
+ motion: e.animateTransitions ? {
691
+ transition: F,
692
+ intro: !1,
693
+ fadesIn: !1
694
+ } : null
695
+ })
696
+ }) : t === void 0 ? Mt(n) : /* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(t, { ...n }) });
697
+ }, Tn = (e) => {
698
+ const { Line: t } = J();
699
+ return t === void 0 ? At(e) : /* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(t, { ...e }) });
700
+ }, Rn = ({ cornerRadius: e, ...t }) => {
701
+ const { Rect: r } = J(), n = Ee(), s = _e(), a = {
676
702
  ...t,
677
- ...At(e, t, n, s)
703
+ ...Kt(e, t, n, s)
678
704
  };
679
- return r === void 0 ? $t(o) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(r, { ...o }) });
680
- }, Sn = (e) => {
681
- const { Path: t } = Q();
682
- return t === void 0 ? xt(e) : /* @__PURE__ */ c(B, { children: /* @__PURE__ */ c(t, { ...e }) });
683
- }, Mt = ({ d: e, source: t, ...r }) => {
684
- const n = ke(e, J, t);
685
- return /* @__PURE__ */ c(ee.path, {
705
+ return r === void 0 ? Bt(a) : /* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(r, { ...a }) });
706
+ }, Gn = (e) => {
707
+ const { Path: t } = J();
708
+ return t === void 0 ? Ot(e) : /* @__PURE__ */ c(K, { children: /* @__PURE__ */ c(t, { ...e }) });
709
+ }, fe = (e) => typeof e == "number" ? `${e}px` : e, Ft = ({ d: e, source: t, ...r }) => {
710
+ const n = Ae(e, F, t);
711
+ return /* @__PURE__ */ c(Z.path, {
686
712
  d: n,
687
713
  ...r
688
714
  });
689
- }, At = (e, t, r, n) => {
715
+ }, Kt = (e, t, r, n) => {
690
716
  if (e === void 0) return {};
691
- const s = We(e);
717
+ const s = Qe(e);
692
718
  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({
719
+ const a = jt(t, r, n);
720
+ if (a === null)
721
+ return s === "full" ? {} : ve(le({ cornerRadius: s }), n);
722
+ const i = Math.min(le({
697
723
  cornerRadius: s,
698
- box: o
699
- }), Math.min(o.width, o.height) / 2);
700
- return fe(a, n);
701
- }, Bt = (e, t, r) => {
724
+ box: a
725
+ }), Math.min(a.width, a.height) / 2);
726
+ return ve(i, n);
727
+ }, jt = (e, t, r) => {
702
728
  const n = pe(e.width, t?.width, r.x), s = pe(e.height, t?.height, r.y);
703
729
  return n === null || s === null ? null : {
704
730
  width: n,
@@ -707,16 +733,16 @@ var A = (e, t) => {
707
733
  }, pe = (e, t, r) => {
708
734
  if (typeof e == "number") return Number.isFinite(e) ? Math.abs(e) * r : null;
709
735
  if (t === void 0) return null;
710
- const n = A(e, t);
736
+ const n = O(e, t);
711
737
  return n === null ? null : Math.abs(n);
712
- }, fe = (e, t) => t.x <= 0 || t.y <= 0 ? {
738
+ }, ve = (e, t) => t.x <= 0 || t.y <= 0 ? {
713
739
  rx: 0,
714
740
  ry: 0
715
741
  } : {
716
742
  rx: e / t.x,
717
743
  ry: e / t.y
718
- }, bn = ({ children: e, ...t }) => {
719
- const r = be();
744
+ }, Nn = ({ children: e, ...t }) => {
745
+ const r = Ee();
720
746
  return /* @__PURE__ */ c("svg", {
721
747
  viewBox: "0 0 1 1",
722
748
  preserveAspectRatio: "none",
@@ -724,81 +750,81 @@ var A = (e, t) => {
724
750
  height: "100%",
725
751
  pointerEvents: "none",
726
752
  ...t,
727
- children: /* @__PURE__ */ c(Se, {
753
+ children: /* @__PURE__ */ c(be, {
728
754
  size: r,
729
755
  space: "unit",
730
756
  children: e
731
757
  })
732
758
  });
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 : {
759
+ }, In = ({ box: e, children: t }) => {
760
+ const r = He(), n = r === null ? null : r.width * (e.x1 - e.x0), s = r === null ? null : r.height * (e.y1 - e.y0), a = _(() => n === null || s === null ? null : {
735
761
  width: n,
736
762
  height: s
737
763
  }, [n, s]);
738
764
  return /* @__PURE__ */ c("svg", {
739
- x: W(e.x0),
740
- y: W(e.y0),
741
- width: W(e.x1 - e.x0),
742
- height: W(e.y1 - e.y0),
765
+ x: z(e.x0),
766
+ y: z(e.y0),
767
+ width: z(e.x1 - e.x0),
768
+ height: z(e.y1 - e.y0),
743
769
  overflow: "hidden",
744
770
  pointerEvents: "none",
745
- children: /* @__PURE__ */ c(Se, {
746
- size: o,
771
+ children: /* @__PURE__ */ c(be, {
772
+ size: a,
747
773
  children: t
748
774
  })
749
775
  });
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 = {
776
+ }, Ut = "drqe3u0", Wt = "drqe3u1", zt = "drqe3u2", Yt = "drqe3u3", B = "drqe3u4", Vt = "drqe3u5", Xt = "drqe3u6", Qt = "drqe3u7", Y = "drqe3u8", Jt = "drqe3u9", Zt = "drqe3ua";
777
+ var er = "drqe3uc", tr = "drqe3ud", rr = "drqe3ue", nr = "drqe3uf";
778
+ var sr = "drqe3uh", or = "drqe3ui", ye = {
753
779
  enabled: "drqe3uk drqe3uj",
754
780
  disabled: "drqe3ul drqe3uj"
755
- }, ye = {
781
+ }, Se = {
756
782
  ran: "drqe3un drqe3um",
757
783
  dim: "drqe3uo drqe3um"
758
- }, Ge = {
784
+ }, Ne = {
759
785
  ran: "drqe3uq drqe3up",
760
786
  cached: "drqe3ur drqe3up",
761
787
  untouched: "drqe3us drqe3up"
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);
788
+ }, Cn = ({ width: e = 440, style: t, className: r } = {}) => {
789
+ const { compileBus: n } = ne(), [s] = y(() => bt()), [a, i] = y(!1), [l, d] = y(Je);
764
790
  H(() => {
765
- const { recordCompile: m } = s.getState(), R = n.getLastTrigger(), v = n.getLastCompile();
766
- return R && v && m(R, v), n.subscribe(m);
791
+ const { recordCompile: m } = s.getState(), S = n.getLastTrigger(), b = n.getLastCompile();
792
+ return S && b && m(S, b), n.subscribe(m);
767
793
  }, [s, n]);
768
- const g = re(s, (m) => m.lastCompile), N = re(s, (m) => m.history), I = n.getCacheStats(), T = g === null && N.length === 0, u = () => {
794
+ const h = re(s, (m) => m.lastCompile), N = re(s, (m) => m.history), D = n.getCacheStats(), G = h === null && N.length === 0, g = () => {
769
795
  d((m) => {
770
- const R = !m;
771
- return Ve(R), R;
796
+ const S = !m;
797
+ return et(S), S;
772
798
  });
773
799
  };
774
- return /* @__PURE__ */ f("div", {
775
- className: tt(Vt, r),
800
+ return /* @__PURE__ */ p("div", {
801
+ className: at(Zt, r),
776
802
  style: {
777
803
  width: e,
778
804
  ...t
779
805
  },
780
806
  children: [
781
- /* @__PURE__ */ f("div", {
782
- className: Ot,
783
- children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ c("div", {
784
- className: Ft,
807
+ /* @__PURE__ */ p("div", {
808
+ className: Ut,
809
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ c("div", {
810
+ className: Wt,
785
811
  children: "compile cache"
786
812
  }), /* @__PURE__ */ c("div", {
787
- className: Jt,
788
- children: T ? "production: stats disabled" : g ? `last: ${g.label} · ${ae(g.durationMs)}` : "awaiting first compile…"
813
+ className: rr,
814
+ children: G ? "production: stats disabled" : h ? `last: ${h.label} · ${ae(h.durationMs)}` : "awaiting first compile…"
789
815
  })] }), /* @__PURE__ */ c("button", {
790
816
  type: "button",
791
- onClick: () => a((m) => !m),
792
- className: Zt,
793
- children: o ? "▾" : "▴"
817
+ onClick: () => i((m) => !m),
818
+ className: nr,
819
+ children: a ? "▾" : "▴"
794
820
  })]
795
821
  }),
796
- !o && /* @__PURE__ */ f("div", {
822
+ !a && /* @__PURE__ */ p("div", {
797
823
  className: "drqe3ub",
798
- children: [/* @__PURE__ */ f("button", {
824
+ children: [/* @__PURE__ */ p("button", {
799
825
  type: "button",
800
- onClick: u,
801
- className: l ? ve.enabled : ve.disabled,
826
+ onClick: g,
827
+ className: l ? ye.enabled : ye.disabled,
802
828
  "aria-pressed": l,
803
829
  children: ["cache ", l ? "enabled" : "disabled"]
804
830
  }), /* @__PURE__ */ c("span", {
@@ -806,53 +832,53 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
806
832
  children: "next compile reflects this toggle"
807
833
  })]
808
834
  }),
809
- !o && !T && /* @__PURE__ */ f(et, { children: [/* @__PURE__ */ c(rr, {
810
- delta: g?.stages,
811
- durations: g?.stageDurationsMs,
812
- cumulative: I
813
- }), /* @__PURE__ */ c(nr, { entries: N })] })
835
+ !a && !G && /* @__PURE__ */ p(ot, { children: [/* @__PURE__ */ c(ar, {
836
+ delta: h?.stages,
837
+ durations: h?.stageDurationsMs,
838
+ cumulative: D
839
+ }), /* @__PURE__ */ c(ir, { entries: N })] })
814
840
  ]
815
841
  });
816
- }, rr = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ f("table", {
817
- className: Kt,
818
- children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ f("tr", {
819
- className: er,
842
+ }, ar = ({ delta: e, durations: t, cumulative: r }) => /* @__PURE__ */ p("table", {
843
+ className: zt,
844
+ children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ p("tr", {
845
+ className: sr,
820
846
  children: [
821
847
  /* @__PURE__ */ c("th", {
822
- className: Ut,
848
+ className: Yt,
823
849
  children: "stage"
824
850
  }),
825
851
  /* @__PURE__ */ c("th", {
826
- className: M,
852
+ className: B,
827
853
  children: "time"
828
854
  }),
829
855
  /* @__PURE__ */ c("th", {
830
- className: M,
856
+ className: B,
831
857
  children: "Δ miss"
832
858
  }),
833
859
  /* @__PURE__ */ c("th", {
834
- className: M,
860
+ className: B,
835
861
  children: "Δ hit"
836
862
  }),
837
863
  /* @__PURE__ */ c("th", {
838
- className: M,
864
+ className: B,
839
865
  children: "total miss"
840
866
  }),
841
867
  /* @__PURE__ */ c("th", {
842
- className: M,
868
+ className: B,
843
869
  children: "total hit"
844
870
  })
845
871
  ]
846
872
  }) }), /* @__PURE__ */ c("tbody", { children: se.map((n) => {
847
- const s = e?.[n], o = sr(s);
848
- return /* @__PURE__ */ f("tr", {
849
- className: Xt,
873
+ const s = e?.[n], a = cr(s);
874
+ return /* @__PURE__ */ p("tr", {
875
+ className: er,
850
876
  children: [
851
- /* @__PURE__ */ f("td", {
852
- className: jt,
877
+ /* @__PURE__ */ p("td", {
878
+ className: Vt,
853
879
  children: [
854
880
  /* @__PURE__ */ c("span", {
855
- className: Ge[o],
881
+ className: Ne[a],
856
882
  "aria-hidden": !0
857
883
  }),
858
884
  " ",
@@ -861,10 +887,10 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
861
887
  }),
862
888
  /* @__PURE__ */ c("td", {
863
889
  className: Y,
864
- children: t === void 0 || o === "untouched" ? "—" : ae(t[n])
890
+ children: t === void 0 || a === "untouched" ? "—" : ae(t[n])
865
891
  }),
866
892
  /* @__PURE__ */ c("td", {
867
- className: o === "ran" ? ye.ran : ye.dim,
893
+ className: a === "ran" ? Se.ran : Se.dim,
868
894
  children: s?.misses ?? 0
869
895
  }),
870
896
  /* @__PURE__ */ c("td", {
@@ -882,27 +908,27 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
882
908
  ]
883
909
  }, n);
884
910
  }) })]
885
- }), nr = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ f("div", {
886
- className: Qt,
911
+ }), ir = ({ entries: e }) => e.length === 0 ? null : /* @__PURE__ */ p("div", {
912
+ className: tr,
887
913
  children: [/* @__PURE__ */ c("div", {
888
- className: tr,
914
+ className: or,
889
915
  children: "recent compiles"
890
916
  }), e.map((t) => {
891
- const r = or(t.stages, (o) => o.misses > 0), n = se.length;
892
- return /* @__PURE__ */ f("div", {
893
- className: Wt,
917
+ const r = lr(t.stages, (a) => a.misses > 0), n = se.length;
918
+ return /* @__PURE__ */ p("div", {
919
+ className: Xt,
894
920
  children: [
895
921
  /* @__PURE__ */ c("span", {
896
- className: Ge[r === 0 ? "cached" : "ran"],
922
+ className: Ne[r === 0 ? "cached" : "ran"],
897
923
  "aria-hidden": !0
898
924
  }),
899
925
  /* @__PURE__ */ c("span", {
900
- className: Yt,
926
+ className: Qt,
901
927
  title: t.label,
902
928
  children: t.label
903
929
  }),
904
- /* @__PURE__ */ f("span", {
905
- className: zt,
930
+ /* @__PURE__ */ p("span", {
931
+ className: Jt,
906
932
  children: [
907
933
  r,
908
934
  "/",
@@ -914,22 +940,22 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
914
940
  ]
915
941
  }, t.id);
916
942
  })]
917
- }), sr = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", or = (e, t) => {
943
+ }), cr = (e) => !e || e.hits === 0 && e.misses === 0 ? "untouched" : e.misses > 0 ? "ran" : "cached", lr = (e, t) => {
918
944
  let r = 0;
919
945
  for (const n of se) t(e[n]) && (r += 1);
920
946
  return r;
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);
923
- return k(() => ({
924
- ...a,
947
+ }, ae = (e) => e < 0.1 ? "<0.1ms" : e >= 10 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`, Pn = () => {
948
+ const { history: e } = ne(), { stack: t, undo: r, redo: n } = e, s = f((l) => t.subscribe(l), [t]), a = f(() => t.getSnapshot(), [t]), i = st(s, a, a);
949
+ return _(() => ({
950
+ ...i,
925
951
  undo: r,
926
952
  redo: n
927
953
  }), [
928
- a,
954
+ i,
929
955
  r,
930
956
  n
931
957
  ]);
932
- }, ar = /* @__PURE__ */ new Set([
958
+ }, dr = /* @__PURE__ */ new Set([
933
959
  "button",
934
960
  "checkbox",
935
961
  "color",
@@ -940,98 +966,99 @@ var er = "drqe3uh", tr = "drqe3ui", ve = {
940
966
  "range",
941
967
  "reset",
942
968
  "submit"
943
- ]), Gn = (e, t = {}) => {
969
+ ]), Ln = (e, t = {}) => {
944
970
  const { target: r, enabled: n = !0 } = t;
945
971
  H(() => {
946
- const s = ir(r);
972
+ const s = ur(r);
947
973
  if (!n || !s) return;
948
- const o = (a) => {
949
- if (!cr(a) || a.defaultPrevented || lr(a.target)) return;
950
- const l = _e(a);
974
+ const a = (i) => {
975
+ if (!mr(i) || i.defaultPrevented || hr(i.target)) return;
976
+ const l = Me(i);
951
977
  if (!l) return;
952
978
  const d = e.current;
953
- d && (l === "undo" ? d.undo() : d.redo()) && a.preventDefault();
979
+ d && (l === "undo" ? d.undo() : d.redo()) && i.preventDefault();
954
980
  };
955
- return s.addEventListener("keydown", o), () => s.removeEventListener("keydown", o);
981
+ return s.addEventListener("keydown", a), () => s.removeEventListener("keydown", a);
956
982
  }, [
957
983
  e,
958
984
  r,
959
985
  n
960
986
  ]);
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 = () => {
987
+ }, ur = (e) => e === void 0 ? window : e !== null && "current" in e ? e.current : e, mr = (e) => "key" in e, hr = (e) => e instanceof HTMLInputElement ? !dr.has(e.type) : e instanceof HTMLElement ? e.isContentEditable || e.tagName === "TEXTAREA" : !1, wn = () => {
962
988
  const { targetBoundaryStore: e } = ne();
963
989
  return re(e, (t) => t.boundary);
964
990
  };
965
991
  export {
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,
992
+ zr as CanvasTextMeasurer,
993
+ _r as DefaultFooter,
994
+ Mt as DefaultGeomCircle,
995
+ At as DefaultGeomLine,
996
+ Ot as DefaultGeomPath,
997
+ Bt as DefaultGeomRect,
998
+ sn as DefaultGrid,
999
+ Gr as DefaultHeader,
1000
+ Mr as DefaultSwatch,
1001
+ rn as DefaultTooltip,
1002
+ Cn as DevToolsPanel,
1003
+ Jr as GRAPH_MODES,
1004
+ En as GeomCircle,
1005
+ Tn as GeomLine,
1006
+ Lr as GeomOverpaint,
1007
+ Gn as GeomPath,
1008
+ Rn as GeomRect,
1009
+ ht as GraphErrorBoundary,
984
1010
  ue as GraphErrorPanel,
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,
1005
- A as readPositionPixels,
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,
1015
- Nr as useGeomHitTest,
1016
- Er as useGeomHover,
1017
- qe as useGeomPanelSize,
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,
1034
- Nn as useTargetBoundary,
1035
- ur as useTextMeasurer,
1036
- $r as vars
1011
+ $t as GraphProvider,
1012
+ Br as GraphRenderer,
1013
+ un as GraphyBadge,
1014
+ br as HoverProvider,
1015
+ Kr as IntlProvider,
1016
+ Rr as IntroFade,
1017
+ an as IntroWipeClip,
1018
+ kr as TextMeasurerProvider,
1019
+ en as ThemeProvider,
1020
+ In as UnitBoxSvg,
1021
+ Nn as UnitSpaceSvg,
1022
+ dn as buildDotsEditOutlineShapes,
1023
+ Sn as createGraphyKit,
1024
+ Ar as darkTheme,
1025
+ Er as defineGeomRenderer,
1026
+ wr as defineGlyph,
1027
+ xr as getBuiltInEditOutlineShapes,
1028
+ cn as lightTheme,
1029
+ Or as lightenCss,
1030
+ Cr as projectPointCartesian,
1031
+ gt as pruneSelection,
1032
+ O as readPositionPixels,
1033
+ bn as readRectPixels,
1034
+ vr as resolveGraphyBadgeVariant,
1035
+ Hr as resolvePathStroke,
1036
+ $r as scalePointToPanel,
1037
+ pr as stampAxisEditTarget,
1038
+ Qr as stampGridEditTarget,
1039
+ Ir as stampLegendEditTarget,
1040
+ yr as useElementScreenRect,
1041
+ Xr as useFormattingLocale,
1042
+ qr as useGeomHitTest,
1043
+ Zr as useGeomHover,
1044
+ He as useGeomPanelSize,
1045
+ Pr as useGeomReaderTree,
1046
+ Dr as useGeomStyleReader,
1047
+ tn as useGraphCommands,
1048
+ Vr as useGraphHandle,
1049
+ Pn as useGraphHistory,
1050
+ Ln as useGraphHistoryShortcuts,
1051
+ Fr as useGraphLocale,
1052
+ Yr as useGraphSelection,
1053
+ ln as useGuidesTakePress,
1054
+ nn as useHandleScene,
1055
+ Ur as useHoverState,
1056
+ Wr as usePaintDefs,
1057
+ on as useResolvedStyle,
1058
+ Nr as useSceneSelector,
1059
+ Sr as useStyleReaderTree,
1060
+ Tr as useStyleResolver,
1061
+ wn as useTargetBoundary,
1062
+ fr as useTextMeasurer,
1063
+ jr as vars
1037
1064
  };