@graphysdk/viz-engine 0.0.1-experimental.1 → 0.0.1-experimental.3

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,17 +1,17 @@
1
- import { isValid as K, isBefore as Qo, parse as ze, differenceInDays as Zo, isWithinInterval as Jo, addDays as fs } from "date-fns";
2
- import { table as Ne, desc as ea, op as hs } from "arquero";
3
- import { isEqual as ta, isInteger as na, merge as Ee } from "lodash-es";
4
- import { utcYear as ra, utcMonth as sa, utcMonday as oa, utcDay as aa, utcHour as ia } from "d3-time";
5
- import { differenceInDays as ca } from "date-fns/differenceInDays";
6
- import { scaleBand as ys, scaleLog as la, scaleSqrt as ua, scaleLinear as da, scaleUtc as pa, scaleOrdinal as gs } from "d3-scale";
1
+ import { isValid as K, isBefore as Zo, parse as ze, differenceInDays as Jo, isWithinInterval as ea, addDays as fs } from "date-fns";
2
+ import { table as Ne, desc as ta, op as hs } from "arquero";
3
+ import { isEqual as na, isInteger as ra, merge as Ee } from "lodash-es";
4
+ import { utcYear as sa, utcMonth as oa, utcMonday as aa, utcDay as ia, utcHour as ca } from "d3-time";
5
+ import { differenceInDays as la } from "date-fns/differenceInDays";
6
+ import { scaleBand as ys, scaleLog as ua, scaleSqrt as da, scaleLinear as pa, scaleUtc as ma, scaleOrdinal as gs } from "d3-scale";
7
7
  import bs from "lodash-es/merge";
8
- import { regressionLoess as ma, regressionPoly as fa, regressionPow as ha, regressionQuad as ya, regressionLog as ga, regressionExp as ba, regressionLinear as va } from "d3-regression";
9
- import xa from "humanize-duration";
8
+ import { regressionLoess as fa, regressionPoly as ha, regressionPow as ya, regressionQuad as ga, regressionLog as ba, regressionExp as va, regressionLinear as xa } from "d3-regression";
9
+ import Sa from "humanize-duration";
10
10
  import "@graphysdk/i18n";
11
- import { curveCatmullRom as Sa, curveLinear as wa, area as Aa, line as vs, arc as Ta } from "d3-shape";
12
- import { Delaunay as Ma } from "d3-delaunay";
13
- import La from "lodash-es/isEqual";
14
- typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.vizEngine = "0.0.1-experimental.1");
11
+ import { curveCatmullRom as wa, curveLinear as Aa, area as Ta, line as vs, arc as Ma } from "d3-shape";
12
+ import { Delaunay as La } from "d3-delaunay";
13
+ import Va from "lodash-es/isEqual";
14
+ typeof window < "u" && (window.__GRAPHY_SDK__ ??= {}, window.__GRAPHY_SDK__.vizEngine = "0.0.1-experimental.3");
15
15
  const pn = (e) => e.length > 0;
16
16
  function h(e) {
17
17
  return e != null;
@@ -60,7 +60,7 @@ function Lt(e) {
60
60
  let Vt = !0;
61
61
  const Zy = (e) => {
62
62
  Vt = e;
63
- }, Jy = () => Vt, Va = () => {
63
+ }, Jy = () => Vt, Ea = () => {
64
64
  let e = null;
65
65
  const t = { hits: 0, misses: 0 };
66
66
  return Object.assign((r, s) => {
@@ -92,7 +92,7 @@ const Zy = (e) => {
92
92
  const i = o();
93
93
  return a ? a.push({ args: s, out: i }) : e.set(r, [{ args: s, out: i }]), i;
94
94
  }, { stats: t });
95
- }, Ea = (...e) => e.reduce((t, n) => ({ hits: t.hits + n.hits, misses: t.misses + n.misses }), {
95
+ }, ka = (...e) => e.reduce((t, n) => ({ hits: t.hits + n.hits, misses: t.misses + n.misses }), {
96
96
  hits: 0,
97
97
  misses: 0
98
98
  }), ws = (e, t) => {
@@ -119,7 +119,7 @@ class ce {
119
119
  return this.singletonKey;
120
120
  }
121
121
  }
122
- const O = (e) => e instanceof Date && K(e), ka = (e) => O(e) || e === null, Ue = (e) => typeof e == "string", I = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e);
122
+ const O = (e) => e instanceof Date && K(e), Ia = (e) => O(e) || e === null, Ue = (e) => typeof e == "string", I = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e);
123
123
  function eg(e) {
124
124
  return { type: "mapping", mapping: e };
125
125
  }
@@ -160,7 +160,7 @@ const As = "\0graphy\0_", A = (e) => `${As}${e}`, rn = {
160
160
  ...f,
161
161
  ...ye
162
162
  });
163
- const Ia = new Set(Object.values(Ge)), Ca = (e) => e.startsWith(As), Da = (e) => Ia.has(e), ke = (e) => e[W.group];
163
+ const Ca = new Set(Object.values(Ge)), Da = (e) => e.startsWith(As), Fa = (e) => Ca.has(e), ke = (e) => e[W.group];
164
164
  function G(e) {
165
165
  return e[f.x];
166
166
  }
@@ -179,7 +179,7 @@ function se(e) {
179
179
  function H(e) {
180
180
  return e[f.yMax];
181
181
  }
182
- function Fa(e) {
182
+ function _a(e) {
183
183
  return e[f.yRaw];
184
184
  }
185
185
  function mn(e) {
@@ -188,13 +188,13 @@ function mn(e) {
188
188
  function tg(e) {
189
189
  return e[ye.alpha];
190
190
  }
191
- function _a(e) {
191
+ function Ra(e) {
192
192
  return e[ye.size];
193
193
  }
194
- function Ra(e) {
194
+ function Na(e) {
195
195
  return e[ye.strokeWidth];
196
196
  }
197
- function Na(e) {
197
+ function Pa(e) {
198
198
  return e[ye.lineType] ?? "solid";
199
199
  }
200
200
  const sn = (e, t, n) => {
@@ -205,7 +205,7 @@ const sn = (e, t, n) => {
205
205
  const o = v(r.mapping.y);
206
206
  for (const a of r.data) {
207
207
  if (a[s] !== e.anchorValue || ke(a) !== e.groupValue) continue;
208
- const i = Pa(a, r.geom, n);
208
+ const i = Oa(a, r.geom, n);
209
209
  if (i === null) continue;
210
210
  const c = o !== null ? a[o] ?? null : null;
211
211
  if (I(c))
@@ -213,12 +213,12 @@ const sn = (e, t, n) => {
213
213
  }
214
214
  }
215
215
  return null;
216
- }, Pa = (e, t, n) => {
216
+ }, Oa = (e, t, n) => {
217
217
  if (n.type === "polar")
218
- return t !== "bar" ? null : $a(e);
219
- const r = Oa(e, t, n.mainAxis);
218
+ return t !== "bar" ? null : Ba(e);
219
+ const r = $a(e, t, n.mainAxis);
220
220
  return r === null ? null : { ...r, geom: t };
221
- }, Oa = (e, t, n) => {
221
+ }, $a = (e, t, n) => {
222
222
  if (t === "line") {
223
223
  const a = G(e), i = C(e);
224
224
  return a === null || i === null ? null : { x: a, y: i };
@@ -229,19 +229,19 @@ const sn = (e, t, n) => {
229
229
  }
230
230
  const r = se(e), s = H(e), o = ie(e) ?? G(e);
231
231
  return r === null || s === null || o === null ? null : { x: o, y: (r + s) / 2 };
232
- }, $a = (e) => {
232
+ }, Ba = (e) => {
233
233
  const t = ge(e), n = ie(e), r = se(e), s = H(e);
234
234
  if (t === null || n === null || r === null || s === null) return null;
235
235
  const o = (t + n) / 2, a = (r + s) / 2, i = 0.5 + 0.5 * a * Math.sin(o), c = 0.5 - 0.5 * a * Math.cos(o);
236
236
  return { x: i, y: c, geom: "polar-bar" };
237
237
  };
238
- class Ba extends ce {
238
+ class za extends ce {
239
239
  dependencies(t) {
240
240
  return [t.annotations, t.layers, t.coordSystem];
241
241
  }
242
242
  run(t) {
243
243
  return {
244
- differenceArrows: za(t),
244
+ differenceArrows: Ga(t),
245
245
  shapes: t.annotations.shapes,
246
246
  freeformArrows: t.annotations.freeformArrows,
247
247
  textAnnotations: t.annotations.textAnnotations,
@@ -258,7 +258,7 @@ const Pt = (e, t, n) => {
258
258
  o !== null && r.push({ ...s, anchor: o });
259
259
  }
260
260
  return r;
261
- }, za = ({
261
+ }, Ga = ({
262
262
  annotations: e,
263
263
  layers: t,
264
264
  coordSystem: n
@@ -266,29 +266,29 @@ const Pt = (e, t, n) => {
266
266
  if (n.type !== "cartesian") return [];
267
267
  const r = [];
268
268
  for (const s of e.differenceArrows) {
269
- if (Ga(s.start, s.end)) continue;
269
+ if (Wa(s.start, s.end)) continue;
270
270
  const o = sn(s.start, t, n), a = sn(s.end, t, n);
271
271
  o === null || a === null || r.push({
272
272
  id: s.id,
273
273
  start: o,
274
274
  end: a,
275
- color: Wa(s, o, a),
275
+ color: Ya(s, o, a),
276
276
  size: s.size,
277
277
  label: s.label,
278
278
  labelCrossPosition: s.labelCrossPosition
279
279
  });
280
280
  }
281
281
  return r;
282
- }, Ga = (e, t) => e.layerId === t.layerId && e.anchorValue === t.anchorValue && e.groupValue === t.groupValue, Wa = (e, t, n) => e.color !== null ? e.color : e.start.groupValue !== e.end.groupValue || t.color === void 0 || t.color !== n.color ? null : t.color;
283
- function Ya(e, t) {
284
- const n = Ka(t);
282
+ }, Wa = (e, t) => e.layerId === t.layerId && e.anchorValue === t.anchorValue && e.groupValue === t.groupValue, Ya = (e, t, n) => e.color !== null ? e.color : e.start.groupValue !== e.end.groupValue || t.color === void 0 || t.color !== n.color ? null : t.color;
283
+ function Ha(e, t) {
284
+ const n = Xa(t);
285
285
  return {
286
286
  ...e,
287
- background: Ha(e.background, n),
288
- border: Ua(e.border, n)
287
+ background: Ua(e.background, n),
288
+ border: Ka(e.border, n)
289
289
  };
290
290
  }
291
- function Ha(e, t) {
291
+ function Ua(e, t) {
292
292
  if (e.type === "tinted") {
293
293
  const n = e.color ?? t;
294
294
  if (!n)
@@ -297,7 +297,7 @@ function Ha(e, t) {
297
297
  }
298
298
  return e;
299
299
  }
300
- function Ua(e, t) {
300
+ function Ka(e, t) {
301
301
  if (e.type === "tinted" || e.type === "gradient") {
302
302
  const n = e.color ?? t;
303
303
  if (!n)
@@ -306,7 +306,7 @@ function Ua(e, t) {
306
306
  }
307
307
  return e;
308
308
  }
309
- function Ka(e) {
309
+ function Xa(e) {
310
310
  const t = e.color, n = t?.domain[0];
311
311
  if (!n)
312
312
  return;
@@ -314,7 +314,7 @@ function Ka(e) {
314
314
  if (typeof r == "string")
315
315
  return r;
316
316
  }
317
- class Xa extends ce {
317
+ class ja extends ce {
318
318
  dependencies(t) {
319
319
  return [t.scales, t.config];
320
320
  }
@@ -322,11 +322,11 @@ class Xa extends ce {
322
322
  const { scales: n, config: r } = t;
323
323
  return {
324
324
  ...r,
325
- appearance: Ya(r.appearance, n)
325
+ appearance: Ha(r.appearance, n)
326
326
  };
327
327
  }
328
328
  }
329
- class ja extends ce {
329
+ class qa extends ce {
330
330
  dependencies(t) {
331
331
  return [t.data, t.mapping];
332
332
  }
@@ -337,18 +337,18 @@ class ja extends ce {
337
337
  const o = ae(r[s]);
338
338
  if (o === void 0) continue;
339
339
  const a = A(`const_${s}`);
340
- n = n.addConstantVariable(a, qa(o), o), r = { ...r, [s]: a };
340
+ n = n.addConstantVariable(a, Qa(o), o), r = { ...r, [s]: a };
341
341
  }
342
342
  return { data: n, mapping: r };
343
343
  }
344
344
  }
345
- const qa = (e) => typeof e == "number" ? "numeric" : e instanceof Date ? "temporal" : "categorical";
345
+ const Qa = (e) => typeof e == "number" ? "numeric" : e instanceof Date ? "temporal" : "categorical";
346
346
  class Ie {
347
347
  constructor() {
348
- this.perLayerMemo = Ss(), this.listMemo = Va();
348
+ this.perLayerMemo = Ss(), this.listMemo = Ea();
349
349
  }
350
350
  get stats() {
351
- return Ea(this.perLayerMemo.stats, this.listMemo.stats);
351
+ return ka(this.perLayerMemo.stats, this.listMemo.stats);
352
352
  }
353
353
  compile(t) {
354
354
  const n = this.dependencies(t), r = t.layers.map(
@@ -357,7 +357,7 @@ class Ie {
357
357
  return this.listMemo(r, () => r);
358
358
  }
359
359
  }
360
- class Qa extends ce {
360
+ class Za extends ce {
361
361
  constructor(t) {
362
362
  super(), this.registry = t;
363
363
  }
@@ -368,7 +368,7 @@ class Qa extends ce {
368
368
  return this.registry.get(t.coordSpec.coordType).setup(t);
369
369
  }
370
370
  }
371
- class Za extends Ie {
371
+ class Ja extends Ie {
372
372
  constructor(t) {
373
373
  super(), this.registry = t;
374
374
  }
@@ -382,9 +382,9 @@ class Za extends Ie {
382
382
  return s;
383
383
  }
384
384
  }
385
- class Ja {
385
+ class ei {
386
386
  constructor(t) {
387
- this.setupStage = new Qa(t), this.transformStage = new Za(t);
387
+ this.setupStage = new Za(t), this.transformStage = new Ja(t);
388
388
  }
389
389
  get setupStats() {
390
390
  return this.setupStage.stats;
@@ -429,7 +429,7 @@ class Ce {
429
429
  return this.items.has(t);
430
430
  }
431
431
  }
432
- class ei {
432
+ class ti {
433
433
  constructor() {
434
434
  this.coordType = "cartesian";
435
435
  }
@@ -452,7 +452,7 @@ class ei {
452
452
  return t.layers;
453
453
  }
454
454
  }
455
- class ti {
455
+ class ni {
456
456
  constructor() {
457
457
  this.coordType = "flip";
458
458
  }
@@ -468,18 +468,18 @@ class ti {
468
468
  y: { position: "bottom", geometry: "linear" }
469
469
  }
470
470
  },
471
- scales: ri(t.scales, t.layers)
471
+ scales: si(t.scales, t.layers)
472
472
  };
473
473
  }
474
474
  transform(t) {
475
- return t.layers.map((n) => oi(n));
475
+ return t.layers.map((n) => ai(n));
476
476
  }
477
477
  }
478
- const ni = [
478
+ const ri = [
479
479
  [f.x, f.y],
480
480
  [f.xMin, f.yMin],
481
481
  [f.xMax, f.yMax]
482
- ], Ar = A("flipSwap"), ri = (e, t) => si(t) ? e.map((n) => n.scaledAesthetic !== "x" || n.scaleType !== "continuous" && n.scaleType !== "datetime" && n.scaleType !== "discrete" ? n : { ...n, reverse: !n.reverse }) : e, si = (e) => {
482
+ ], Ar = A("flipSwap"), si = (e, t) => oi(t) ? e.map((n) => n.scaledAesthetic !== "x" || n.scaleType !== "continuous" && n.scaleType !== "datetime" && n.scaleType !== "discrete" ? n : { ...n, reverse: !n.reverse }) : e, oi = (e) => {
483
483
  for (const t of e) {
484
484
  const n = v(t.mapping.x);
485
485
  if (!n || !t.data.hasVariable(n)) continue;
@@ -487,15 +487,15 @@ const ni = [
487
487
  if (r === "categorical" || r === "temporal") return !0;
488
488
  }
489
489
  return !1;
490
- }, oi = (e) => {
490
+ }, ai = (e) => {
491
491
  let t = e.data;
492
- for (const [n, r] of ni) {
492
+ for (const [n, r] of ri) {
493
493
  const s = t.hasVariable(n), o = t.hasVariable(r);
494
494
  s && o ? t = t.renameVariable(n, Ar).renameVariable(r, n).renameVariable(Ar, r) : s ? t = t.renameVariable(n, r) : o && (t = t.renameVariable(r, n));
495
495
  }
496
496
  return { ...e, data: t };
497
497
  };
498
- class ai {
498
+ class ii {
499
499
  constructor() {
500
500
  this.coordType = "polar";
501
501
  }
@@ -515,27 +515,27 @@ class ai {
515
515
  transform(t) {
516
516
  if (t.coordSpec.coordType !== "polar")
517
517
  throw new Error(`Invalid coordinate type: ${t.coordSpec.coordType}`);
518
- const { params: n } = t.coordSpec, r = ci(n), s = li(n);
518
+ const { params: n } = t.coordSpec, r = li(n), s = ui(n);
519
519
  return t.layers.map((o) => {
520
- const a = n.theta === "y" ? di(o) : o;
521
- return ui(a, r, s);
520
+ const a = n.theta === "y" ? pi(o) : o;
521
+ return di(a, r, s);
522
522
  });
523
523
  }
524
524
  }
525
- const ii = [
525
+ const ci = [
526
526
  [f.x, f.y],
527
527
  [f.xMin, f.yMin],
528
528
  [f.xMax, f.yMax]
529
529
  ];
530
- function ci(e) {
530
+ function li(e) {
531
531
  const t = e.startAngle * (Math.PI / 180);
532
532
  return (n) => n * 2 * Math.PI + t;
533
533
  }
534
- function li(e) {
534
+ function ui(e) {
535
535
  const { innerRadius: t } = e;
536
536
  return (n) => t + n * (1 - t);
537
537
  }
538
- function ui(e, t, n) {
538
+ function di(e, t, n) {
539
539
  let r = e.data;
540
540
  return r = be(r, f.x, t), r = be(r, f.xMin, t), r = be(r, f.xMax, t), r = be(r, f.y, n), r = be(r, f.yMin, n), r = be(r, f.yMax, n), { ...e, data: r };
541
541
  }
@@ -544,9 +544,9 @@ function be(e, t, n) {
544
544
  const s = e.getValues(t, { type: "numeric" }).map((o) => o === null ? null : n(o));
545
545
  return e.addVariable(t, "numeric", s);
546
546
  }
547
- function di(e) {
547
+ function pi(e) {
548
548
  let t = e.data;
549
- for (const [n, r] of ii) {
549
+ for (const [n, r] of ci) {
550
550
  const s = t.hasVariable(n), o = t.hasVariable(r);
551
551
  if (!s && !o) continue;
552
552
  const a = s ? t.getValues(n) : null, i = o ? t.getValues(r) : null;
@@ -554,20 +554,20 @@ function di(e) {
554
554
  }
555
555
  return { ...e, data: t };
556
556
  }
557
- class pi extends Ce {
557
+ class mi extends Ce {
558
558
  constructor() {
559
- super("coord"), this.register("cartesian", new ei()), this.register("flip", new ti()), this.register("polar", new ai());
559
+ super("coord"), this.register("cartesian", new ti()), this.register("flip", new ni()), this.register("polar", new ii());
560
560
  }
561
561
  }
562
- const mi = /* @__PURE__ */ new Set(["count", "sum", "mean", "median"]);
562
+ const fi = /* @__PURE__ */ new Set(["count", "sum", "mean", "median"]);
563
563
  function Ts(e, t) {
564
- return mi.has(e) ? "numeric" : t;
564
+ return fi.has(e) ? "numeric" : t;
565
565
  }
566
- const V = (e) => (Array.isArray(e) ? e : [e]).map((n) => n instanceof Date ? n.toISOString() : String(n ?? "<null>")).join("\0"), fi = "key", hi = "value", Tr = "\0__rowMaskIndex", $e = {
566
+ const V = (e) => (Array.isArray(e) ? e : [e]).map((n) => n instanceof Date ? n.toISOString() : String(n ?? "<null>")).join("\0"), hi = "key", yi = "value", Tr = "\0__rowMaskIndex", $e = {
567
567
  numeric: { type: "decimal" },
568
568
  categorical: { type: "text" },
569
569
  temporal: { type: "datetime" }
570
- }, yi = {
570
+ }, gi = {
571
571
  eq: (e, t) => e[t.__variableName] === t.__value,
572
572
  neq: (e, t) => e[t.__variableName] !== t.__value,
573
573
  // @ts-expect-error — Arquero table expression; TS can't verify the comparison types
@@ -717,7 +717,7 @@ class E {
717
717
  * Filters the dataset using a declarative predicate.
718
718
  */
719
719
  filter(t, n, r) {
720
- const s = yi[n], o = this.table.params({ __variableName: t, __value: r }).filter(s);
720
+ const s = gi[n], o = this.table.params({ __variableName: t, __value: r }).filter(s);
721
721
  return E.fromTrusted(o, this.variableMetadata);
722
722
  }
723
723
  /**
@@ -735,7 +735,7 @@ class E {
735
735
  * Orders the dataset by a variable, in ascending (default) or descending order.
736
736
  */
737
737
  orderBy(t, n = "asc") {
738
- const r = this.table.orderby(n === "asc" ? t : ea(t));
738
+ const r = this.table.orderby(n === "asc" ? t : ta(t));
739
739
  return E.fromTrusted(r, this.variableMetadata);
740
740
  }
741
741
  /**
@@ -765,7 +765,7 @@ class E {
765
765
  */
766
766
  groupBy(...t) {
767
767
  const n = this.table.groupby(...t);
768
- return new gi(t, n, this.variableMetadata);
768
+ return new bi(t, n, this.variableMetadata);
769
769
  }
770
770
  /**
771
771
  * Aggregates the dataset.
@@ -824,8 +824,8 @@ class E {
824
824
  reshapeFromWideToLong({
825
825
  keep: t,
826
826
  reshape: n,
827
- keyName: r = fi,
828
- valueName: s = hi
827
+ keyName: r = hi,
828
+ valueName: s = yi
829
829
  } = {}) {
830
830
  const { numeric: o, categorical: a, temporal: i } = this.groupVariableNamesByType(), c = t ?? [...a, ...i], l = n ?? o.filter((y) => !c.includes(y));
831
831
  if (c.includes(r) || c.includes(s))
@@ -849,7 +849,7 @@ class E {
849
849
  }
850
850
  return m[r] = { type: "categorical", valueFormat: { type: "text" } }, m[s] = {
851
851
  type: "numeric",
852
- valueFormat: bi(this.variableMetadata, l, r)
852
+ valueFormat: vi(this.variableMetadata, l, r)
853
853
  }, E.fromTrusted(p, m);
854
854
  }
855
855
  /**
@@ -916,7 +916,7 @@ class E {
916
916
  return o;
917
917
  }
918
918
  }
919
- class gi {
919
+ class bi {
920
920
  constructor(t, n, r) {
921
921
  this.groupedBy = t, this.grouped = n, this.variableMetadata = r;
922
922
  }
@@ -968,13 +968,13 @@ class gi {
968
968
  return V(t.map((r) => r.get(n)));
969
969
  }
970
970
  }
971
- function bi(e, t, n) {
971
+ function vi(e, t, n) {
972
972
  const r = t.map((c) => e[c]?.valueFormat ?? { type: "decimal" }), [s, ...o] = r;
973
973
  if (!s) return { type: "decimal" };
974
974
  for (const c of r)
975
975
  if (c.type === "lookup")
976
976
  throw new Error("Cannot reshape: a source column has a lookup format and lookups cannot nest");
977
- if (o.every((c) => ta(c, s)) || s.type === "lookup") return s;
977
+ if (o.every((c) => na(c, s)) || s.type === "lookup") return s;
978
978
  const i = {};
979
979
  for (const [c, l] of t.entries()) {
980
980
  const u = V([l]), d = r[c];
@@ -996,7 +996,7 @@ class Ls {
996
996
  */
997
997
  incrementYearIfNeeded(t) {
998
998
  this.previousYear === null ? this.previousYear = t.getUTCFullYear() : this.previousDate !== null && // Compares the current date with the previous date, but ignores the year.
999
- Qo(
999
+ Zo(
1000
1000
  new Date(this.currentYear, t.getUTCMonth(), t.getUTCDate()),
1001
1001
  new Date(this.currentYear, this.previousDate.getUTCMonth(), this.previousDate.getUTCDate())
1002
1002
  ) && this.previousYear++;
@@ -1007,11 +1007,11 @@ class Ls {
1007
1007
  const Vs = (e) => {
1008
1008
  const t = Object.entries(e);
1009
1009
  return !t.length || !t.some(([, n]) => !Ke(n));
1010
- }, Ke = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", fn = "en-GB", vi = (e) => e.type === "lookup", xi = (e) => e.type === "text", Xe = (e) => e.type === "date" || e.type === "datetime" || e.type === "year" || e.type === "month_year" || e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range" || e.type === "weekly_date_range_with_year" || e.type === "quarter" || e.type === "time", Es = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", ks = (e) => e.type === "currency", Is = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", Cs = (e) => {
1011
- if (vi(e)) return Cs(e.fallback);
1010
+ }, Ke = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", fn = "en-GB", xi = (e) => e.type === "lookup", Si = (e) => e.type === "text", Xe = (e) => e.type === "date" || e.type === "datetime" || e.type === "year" || e.type === "month_year" || e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range" || e.type === "weekly_date_range_with_year" || e.type === "quarter" || e.type === "time", Es = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", ks = (e) => e.type === "currency", Is = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", Cs = (e) => {
1011
+ if (xi(e)) return Cs(e.fallback);
1012
1012
  if (Xe(e)) return "temporal";
1013
1013
  if (Es(e)) return "numeric";
1014
- if (xi(e)) return "categorical";
1014
+ if (Si(e)) return "categorical";
1015
1015
  const t = e;
1016
1016
  throw new Error(`No data type found for value format: ${t.type}`);
1017
1017
  }, Be = {
@@ -1019,7 +1019,7 @@ const Vs = (e) => {
1019
1019
  m: 1e6,
1020
1020
  b: 1e9,
1021
1021
  t: 1e12
1022
- }, hn = ["k", "m", "b", "t"], Si = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${hn.join("|")})?$`, "i"), wi = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, me = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? Si.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${hn.join("")}]`, "gi"), ""))) : !Number.isNaN(Number(e)), Ds = (e) => me(e) ? !0 : typeof e == "string" ? wi.test(e) : !1, Ai = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, Ti = /^\s*(19\d{2}|2[01]\d{2})\s*$/, Mi = [
1022
+ }, hn = ["k", "m", "b", "t"], wi = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${hn.join("|")})?$`, "i"), Ai = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, me = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? wi.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${hn.join("")}]`, "gi"), ""))) : !Number.isNaN(Number(e)), Ds = (e) => me(e) ? !0 : typeof e == "string" ? Ai.test(e) : !1, Ti = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, Mi = /^\s*(19\d{2}|2[01]\d{2})\s*$/, Li = [
1023
1023
  [/\bJan\b/i, "January"],
1024
1024
  [/\bFeb\b/i, "February"],
1025
1025
  [/\bMar\b/i, "March"],
@@ -1032,7 +1032,7 @@ const Vs = (e) => {
1032
1032
  [/\bOct\b/i, "October"],
1033
1033
  [/\bNov\b/i, "November"],
1034
1034
  [/\bDec\b/i, "December"]
1035
- ], Li = {
1035
+ ], Vi = {
1036
1036
  "en-US": "MDY",
1037
1037
  "en-GB": "DMY",
1038
1038
  "pt-PT": "DMY",
@@ -1123,7 +1123,7 @@ const Vs = (e) => {
1123
1123
  // February 01
1124
1124
  ["MMMM", "do"]
1125
1125
  // February 1st
1126
- ], Vi = [
1126
+ ], Ei = [
1127
1127
  { dateFormat: "MMMM d, yyyy", type: "date" },
1128
1128
  // February 1, 2022
1129
1129
  { dateFormat: "MMMM dd, yyyy", type: "date" },
@@ -1132,31 +1132,31 @@ const Vs = (e) => {
1132
1132
  // February 1st, 2022
1133
1133
  { dateFormat: "yyyy-MM", type: "month_year" }
1134
1134
  // 2022-02 (this format seems to be the most common format ChatGPT uses when generating sample data)
1135
- ], Rs = 1900, Ns = 2199, Ei = 3, ki = 6, Ii = 5, Ci = 1, Di = 28, Fi = /\s*[–—]\s*|\s-\s/, _i = (e) => typeof e == "number" ? Number.isNaN(e) ? !1 : e >= Rs && e <= Ns : typeof e == "string" ? Ti.test(e) : !1, Ps = (e, t) => {
1135
+ ], Rs = 1900, Ns = 2199, ki = 3, Ii = 6, Ci = 5, Di = 1, Fi = 28, _i = /\s*[–—]\s*|\s-\s/, Ri = (e) => typeof e == "number" ? Number.isNaN(e) ? !1 : e >= Rs && e <= Ns : typeof e == "string" ? Mi.test(e) : !1, Ps = (e, t) => {
1136
1136
  const n = We(e);
1137
- return me(n) ? Pi(n) : typeof n == "string" ? !!Os(n) || yn(n) && K(new Date(n)) : K(n);
1137
+ return me(n) ? Oi(n) : typeof n == "string" ? !!Os(n) || yn(n) && K(new Date(n)) : K(n);
1138
1138
  }, We = (e) => {
1139
1139
  if (typeof e != "string") return e;
1140
1140
  let t = e;
1141
- for (const [n, r] of Mi)
1141
+ for (const [n, r] of Li)
1142
1142
  t = t.replace(n, r);
1143
1143
  return t;
1144
1144
  }, Os = (e, t = fn) => {
1145
1145
  const n = We(e);
1146
- return yn(n) ? { type: "datetime" } : $s(t).find((r) => !Xe(r) || r.type === "month" && n.length < Ei ? !1 : r.dateFormat && K(ze(n, r.dateFormat, /* @__PURE__ */ new Date())));
1147
- }, yn = (e) => Ai.test(e.trim()), Ri = (e, t = fn) => {
1148
- const [n, r] = e.split(Fi);
1146
+ return yn(n) ? { type: "datetime" } : $s(t).find((r) => !Xe(r) || r.type === "month" && n.length < ki ? !1 : r.dateFormat && K(ze(n, r.dateFormat, /* @__PURE__ */ new Date())));
1147
+ }, yn = (e) => Ti.test(e.trim()), Ni = (e, t = fn) => {
1148
+ const [n, r] = e.split(_i);
1149
1149
  if (!n || !r) return;
1150
1150
  const s = We(n).trim(), o = We(r).trim();
1151
- return Ni(t).find((a) => {
1151
+ return Pi(t).find((a) => {
1152
1152
  if (!Xe(a) || !a.dateFormat) return !1;
1153
1153
  const i = ze(s, a.dateFormat, /* @__PURE__ */ new Date()), c = ze(o, a.dateFormat, /* @__PURE__ */ new Date());
1154
1154
  if (!K(i) || !K(c)) return !1;
1155
- const l = new Ls(), u = l.incrementYearIfNeeded(i), d = l.incrementYearIfNeeded(c), p = Zo(d, u);
1156
- return Jo(new Date(u.getFullYear(), Ci, Di), {
1155
+ const l = new Ls(), u = l.incrementYearIfNeeded(i), d = l.incrementYearIfNeeded(c), p = Jo(d, u);
1156
+ return ea(new Date(u.getFullYear(), Di, Fi), {
1157
1157
  start: u,
1158
1158
  end: d
1159
- }) && p === Ii ? !0 : p === ki;
1159
+ }) && p === Ci ? !0 : p === Ii;
1160
1160
  });
1161
1161
  }, $s = (e) => {
1162
1162
  const t = {
@@ -1186,18 +1186,18 @@ const Vs = (e) => {
1186
1186
  ]
1187
1187
  };
1188
1188
  return [
1189
- ...Vi,
1189
+ ...Ei,
1190
1190
  ...Object.entries(t).flatMap(([n, r]) => r.flatMap((s) => Fs.map((o) => ({ dateFormat: s.join(o), type: n }))))
1191
1191
  ];
1192
- }, Bs = (e) => Li[e] === "MDY" ? [...Lr, ...Mr, ...Vr] : [...Mr, ...Lr, ...Vr], Ni = (e) => {
1192
+ }, Bs = (e) => Vi[e] === "MDY" ? [...Lr, ...Mr, ...Vr] : [...Mr, ...Lr, ...Vr], Pi = (e) => {
1193
1193
  const t = {
1194
1194
  weekly_date_range: _s,
1195
1195
  weekly_date_range_with_year: Bs(e)
1196
1196
  };
1197
1197
  return Object.entries(t).flatMap(([n, r]) => r.flatMap((s) => Fs.map((o) => ({ dateFormat: s.join(o), type: n }))));
1198
- }, Pi = (e) => {
1198
+ }, Oi = (e) => {
1199
1199
  const t = Number(e);
1200
- if (!na(t)) return !1;
1200
+ if (!ra(t)) return !1;
1201
1201
  const n = new Date(t), r = new Date(t * 1e3), s = (o) => K(o) && o.getFullYear() >= Rs && o.getFullYear() <= Ns;
1202
1202
  return s(n) || s(r);
1203
1203
  }, zs = {
@@ -1238,7 +1238,7 @@ const Vs = (e) => {
1238
1238
  return t.length ? me(t) : !1;
1239
1239
  }
1240
1240
  return me(e);
1241
- }, Oi = (e) => {
1241
+ }, $i = (e) => {
1242
1242
  const t = Ys(e), n = t ? zs[t] : void 0;
1243
1243
  if (!n) throw new Error("Could not get currency ISO");
1244
1244
  return n;
@@ -1250,15 +1250,15 @@ const Vs = (e) => {
1250
1250
  r === 0 ? n = e.slice(t.length) : r === e.length - t.length ? n = e.slice(0, e.length - t.length) : e[0] === "-" && r === 1 && (n = `-${e.slice(t.length + 1)}`);
1251
1251
  }
1252
1252
  return me(n) ? n.split(",").join("") : "";
1253
- }, Ys = (e) => Object.keys(zs).sort((n, r) => r.length - n.length).find((n) => e.includes(n)), $i = (e, t) => {
1253
+ }, Ys = (e) => Object.keys(zs).sort((n, r) => r.length - n.length).find((n) => e.includes(n)), Bi = (e, t) => {
1254
1254
  const n = typeof e == "string" ? e.trim() : e;
1255
1255
  if (me(n))
1256
1256
  return { type: "decimal" };
1257
1257
  const r = typeof n == "string" && Os(n, t);
1258
1258
  if (r) return r;
1259
- const s = typeof n == "string" && Ri(n, t);
1260
- return s || (Ps(e) ? { type: "date" } : Ds(e) ? { type: "percentage" } : Gs(e) && typeof e == "string" ? { type: "currency", iso: Oi(e) } : { type: "text" });
1261
- }, Bi = /\s*[–—]\s*|\s-\s/, zi = (e, t, n) => {
1259
+ const s = typeof n == "string" && Ni(n, t);
1260
+ return s || (Ps(e) ? { type: "date" } : Ds(e) ? { type: "percentage" } : Gs(e) && typeof e == "string" ? { type: "currency", iso: $i(e) } : { type: "text" });
1261
+ }, zi = /\s*[–—]\s*|\s-\s/, Gi = (e, t, n) => {
1262
1262
  if (Ke(e)) return null;
1263
1263
  switch (t.type) {
1264
1264
  case "decimal":
@@ -1266,9 +1266,9 @@ const Vs = (e) => {
1266
1266
  case "duration":
1267
1267
  return Hs(e);
1268
1268
  case "percentage":
1269
- return Gi(e);
1270
- case "currency":
1271
1269
  return Wi(e);
1270
+ case "currency":
1271
+ return Yi(e);
1272
1272
  case "datetime":
1273
1273
  case "date":
1274
1274
  case "year":
@@ -1280,9 +1280,9 @@ const Vs = (e) => {
1280
1280
  return gn(e, t.dateFormat, n);
1281
1281
  case "weekly_date_range":
1282
1282
  case "weekly_date_range_with_year":
1283
- return Yi(e, t.dateFormat, n);
1283
+ return Hi(e, t.dateFormat, n);
1284
1284
  case "text":
1285
- return Hi(e);
1285
+ return Ui(e);
1286
1286
  case "lookup":
1287
1287
  throw new Error("Cannot parse: lookup value formats are produced by transforms, not raw input");
1288
1288
  default: {
@@ -1320,7 +1320,7 @@ const Vs = (e) => {
1320
1320
  break;
1321
1321
  }
1322
1322
  return Number(t.split(",").join("")) * n;
1323
- }, Gi = (e) => {
1323
+ }, Wi = (e) => {
1324
1324
  if (typeof e == "number")
1325
1325
  return Number.isNaN(e) ? null : e;
1326
1326
  if (typeof e != "string") return null;
@@ -1328,16 +1328,16 @@ const Vs = (e) => {
1328
1328
  if (!Ds(t)) return null;
1329
1329
  const n = Number(t.replace(/%/g, "").replace(/,/g, "")) / 100;
1330
1330
  return Number.isNaN(n) ? null : n;
1331
- }, Wi = (e) => {
1331
+ }, Yi = (e) => {
1332
1332
  if (typeof e == "number")
1333
1333
  return Number.isNaN(e) ? null : e;
1334
1334
  if (typeof e != "string") return null;
1335
1335
  const t = e.trim();
1336
1336
  return Gs(t) ? Hs(Ws(t)) : null;
1337
- }, Yi = (e, t, n) => {
1338
- const r = String(e).trim().split(Bi), [s, o] = [r[0]?.trim(), r[1]?.trim()];
1337
+ }, Hi = (e, t, n) => {
1338
+ const r = String(e).trim().split(zi), [s, o] = [r[0]?.trim(), r[1]?.trim()];
1339
1339
  return !s || !o ? null : gn(s, t, n);
1340
- }, Hi = (e) => String(e).trim(), Ot = (e) => new Date(
1340
+ }, Ui = (e) => String(e).trim(), Ot = (e) => new Date(
1341
1341
  Date.UTC(
1342
1342
  e.getFullYear(),
1343
1343
  e.getMonth(),
@@ -1347,37 +1347,37 @@ const Vs = (e) => {
1347
1347
  e.getSeconds(),
1348
1348
  e.getMilliseconds()
1349
1349
  )
1350
- ), Ui = { type: "year", dateFormat: "yyyy" };
1351
- class Ki extends ce {
1350
+ ), Ki = { type: "year", dateFormat: "yyyy" };
1351
+ class Xi extends ce {
1352
1352
  dependencies(t) {
1353
1353
  return [t];
1354
1354
  }
1355
1355
  run(t) {
1356
- const n = t._metadata?.parsingLocale ?? fn, r = {}, s = qi(t), o = Xi(t);
1356
+ const n = t._metadata?.parsingLocale ?? fn, r = {}, s = Qi(t), o = ji(t);
1357
1357
  for (const [a, i] of t.columns.entries()) {
1358
1358
  if (i._metadata?.isHidden) continue;
1359
1359
  const c = s.get(i.key);
1360
1360
  if (Ke(c)) continue;
1361
- const l = a === o ? Ui : $i(c, n), u = Cs(l);
1362
- r[i.key] = ji(i.key, t.rows, l, u, n);
1361
+ const l = a === o ? Ki : Bi(c, n), u = Cs(l);
1362
+ r[i.key] = qi(i.key, t.rows, l, u, n);
1363
1363
  }
1364
1364
  return new E(r);
1365
1365
  }
1366
1366
  }
1367
- const Xi = (e) => {
1368
- const t = Qi(e.rows, 5);
1367
+ const ji = (e) => {
1368
+ const t = Zi(e.rows, 5);
1369
1369
  return e.columns.findIndex((n) => {
1370
1370
  const r = t.map((s) => s[n.key]).filter((s) => !Ke(s));
1371
- return r.length >= 2 && r.every(_i);
1371
+ return r.length >= 2 && r.every(Ri);
1372
1372
  });
1373
- }, ji = (e, t, n, r, s) => {
1373
+ }, qi = (e, t, n, r, s) => {
1374
1374
  const o = new Ls(), a = t.reduce((i, c) => {
1375
1375
  if (Vs(c)) return i;
1376
- const l = zi(c[e], n, s);
1376
+ const l = Gi(c[e], n, s);
1377
1377
  return Is(n) && O(l) ? i.push(o.incrementYearIfNeeded(l)) : i.push(l), i;
1378
1378
  }, []);
1379
1379
  return { type: r, values: a, valueFormat: n };
1380
- }, qi = (e) => {
1380
+ }, Qi = (e) => {
1381
1381
  const t = /* @__PURE__ */ new Map(), n = new Set(e.columns.map((r) => r.key));
1382
1382
  for (const r of e.rows) {
1383
1383
  for (const s of n) {
@@ -1388,14 +1388,14 @@ const Xi = (e) => {
1388
1388
  break;
1389
1389
  }
1390
1390
  return t;
1391
- }, Qi = (e, t) => {
1391
+ }, Zi = (e, t) => {
1392
1392
  const n = [];
1393
1393
  for (const r of e)
1394
1394
  if (Vs(r) || n.push(r), n.length === t)
1395
1395
  return n;
1396
1396
  return n;
1397
1397
  };
1398
- class Zi {
1398
+ class Ji {
1399
1399
  constructor(t) {
1400
1400
  this.registry = t;
1401
1401
  }
@@ -1412,7 +1412,7 @@ const bn = (e, t) => {
1412
1412
  const n = v(t.x);
1413
1413
  return !n || !["numeric", "temporal"].includes(e.getType(n)) ? e : e.orderBy(n, "asc");
1414
1414
  };
1415
- class Ji extends je {
1415
+ class ec extends je {
1416
1416
  constructor() {
1417
1417
  super(...arguments), this.type = "area", this.requiredAesthetics = ["x", "y"];
1418
1418
  }
@@ -1424,8 +1424,8 @@ class Ji extends je {
1424
1424
  return { data: t, mapping: {} };
1425
1425
  }
1426
1426
  }
1427
- const Us = 0.7, ec = 0.1;
1428
- class tc extends je {
1427
+ const Us = 0.7, tc = 0.1;
1428
+ class nc extends je {
1429
1429
  constructor() {
1430
1430
  super(...arguments), this.type = "bar";
1431
1431
  }
@@ -1438,7 +1438,7 @@ class tc extends je {
1438
1438
  return t = t.addConstantVariable(f.xMin, "numeric", -r).addConstantVariable(f.xMax, "numeric", r), { data: t, mapping: {} };
1439
1439
  }
1440
1440
  }
1441
- class nc extends je {
1441
+ class rc extends je {
1442
1442
  constructor() {
1443
1443
  super(...arguments), this.type = "line", this.requiredAesthetics = ["x", "y"];
1444
1444
  }
@@ -1446,7 +1446,7 @@ class nc extends je {
1446
1446
  return { data: bn(t.data, t.mapping), mapping: {} };
1447
1447
  }
1448
1448
  }
1449
- class rc extends je {
1449
+ class sc extends je {
1450
1450
  constructor() {
1451
1451
  super(...arguments), this.type = "point", this.requiredAesthetics = ["x", "y"];
1452
1452
  }
@@ -1454,7 +1454,7 @@ class rc extends je {
1454
1454
  return { data: t, mapping: {} };
1455
1455
  }
1456
1456
  }
1457
- class sc extends je {
1457
+ class oc extends je {
1458
1458
  constructor() {
1459
1459
  super(...arguments), this.type = "rule";
1460
1460
  }
@@ -1474,13 +1474,13 @@ const Er = (e, t) => {
1474
1474
  const n = ae(e);
1475
1475
  if (I(n)) return { value: n, sourceFormat: void 0 };
1476
1476
  const r = v(e);
1477
- if (r === null || !Da(r) || !t.hasVariable(r)) return null;
1477
+ if (r === null || !Fa(r) || !t.hasVariable(r)) return null;
1478
1478
  const [s] = t.getValues(r);
1479
1479
  return I(s) ? { value: s, sourceFormat: t.getValueFormat(r) } : null;
1480
1480
  };
1481
- class oc extends Ce {
1481
+ class ac extends Ce {
1482
1482
  constructor() {
1483
- super("geom"), this.register("bar", new tc()), this.register("point", new rc()), this.register("line", new nc()), this.register("area", new Ji()), this.register("rule", new sc());
1483
+ super("geom"), this.register("bar", new nc()), this.register("point", new sc()), this.register("line", new rc()), this.register("area", new ec()), this.register("rule", new oc());
1484
1484
  }
1485
1485
  }
1486
1486
  const vn = (e, t) => {
@@ -1499,7 +1499,7 @@ const vn = (e, t) => {
1499
1499
  }
1500
1500
  return [...r];
1501
1501
  };
1502
- class ac {
1502
+ class ic {
1503
1503
  compute({ data: t, mapping: n }) {
1504
1504
  const r = vn(t, n);
1505
1505
  if (r.length === 0)
@@ -1520,20 +1520,20 @@ const Ks = /* @__PURE__ */ new Set([
1520
1520
  "alpha",
1521
1521
  "strokeWidth",
1522
1522
  "lineType"
1523
- ]), Et = (e) => Ks.has(e), ic = (e) => xn.has(e), cc = (e) => Et(e) || ic(e);
1523
+ ]), Et = (e) => Ks.has(e), cc = (e) => xn.has(e), lc = (e) => Et(e) || cc(e);
1524
1524
  function qe(e) {
1525
1525
  return e === "secondary" ? "ySecondary" : "y";
1526
1526
  }
1527
1527
  function Z(e) {
1528
1528
  return e === "ySecondary" ? "y" : e;
1529
1529
  }
1530
- const lc = (e) => {
1530
+ const uc = (e) => {
1531
1531
  if (e === void 0) return {};
1532
1532
  const t = {};
1533
1533
  for (const n of e.columns)
1534
1534
  n.label !== void 0 && (t[n.key] = n.label);
1535
1535
  return t;
1536
- }, uc = (e, t, n) => {
1536
+ }, dc = (e, t, n) => {
1537
1537
  const r = fe(t, "color");
1538
1538
  return r === null ? {} : (e?.columns ?? []).some((a) => a.key === r) ? {} : n;
1539
1539
  };
@@ -1545,7 +1545,7 @@ function fe(e, t) {
1545
1545
  }
1546
1546
  return null;
1547
1547
  }
1548
- const Sn = (e, t) => e === null ? null : t[e] ?? e, dc = (e, t) => e === null ? null : t[String(e)] ?? null, he = ({
1548
+ const Sn = (e, t) => e === null ? null : t[e] ?? e, pc = (e, t) => e === null ? null : t[String(e)] ?? null, he = ({
1549
1549
  layers: e,
1550
1550
  scaleType: t,
1551
1551
  variableName: n
@@ -1554,10 +1554,10 @@ const Sn = (e, t) => e === null ? null : t[e] ?? e, dc = (e, t) => e === null ?
1554
1554
  for (const r of e) {
1555
1555
  if (!r.data.hasVariable(n)) continue;
1556
1556
  const s = r.data.getValueFormat(n), o = s.type === "lookup" ? s.fallback : s;
1557
- return mc(o, t) ? o : $t(t);
1557
+ return fc(o, t) ? o : $t(t);
1558
1558
  }
1559
1559
  return $t(t);
1560
- }, pc = (e, t) => t !== "y" && t !== "ySecondary" ? !1 : Xs(t, e).some((n) => n.position === "fill");
1560
+ }, mc = (e, t) => t !== "y" && t !== "ySecondary" ? !1 : Xs(t, e).some((n) => n.position === "fill");
1561
1561
  function Xs(e, t) {
1562
1562
  return e === "ySecondary" ? t.filter((n) => n.yScaleType === "secondary") : e === "y" ? t.filter((n) => n.yScaleType === "primary") : t;
1563
1563
  }
@@ -1572,7 +1572,7 @@ const $t = (e) => {
1572
1572
  case "identity":
1573
1573
  return { type: "text" };
1574
1574
  }
1575
- }, mc = (e, t) => {
1575
+ }, fc = (e, t) => {
1576
1576
  switch (t) {
1577
1577
  case "continuous":
1578
1578
  return Es(e);
@@ -1583,7 +1583,7 @@ const $t = (e) => {
1583
1583
  case "identity":
1584
1584
  return !0;
1585
1585
  }
1586
- }, fc = [
1586
+ }, hc = [
1587
1587
  { unit: "year", step: 1e3 },
1588
1588
  { unit: "year", step: 100 },
1589
1589
  { unit: "year", step: 50 },
@@ -1610,16 +1610,16 @@ const $t = (e) => {
1610
1610
  week: 3,
1611
1611
  day: 4,
1612
1612
  hour: 5
1613
- }, ve = 40, hc = (e, t, n) => {
1613
+ }, ve = 40, yc = (e, t, n) => {
1614
1614
  const r = n.unit === "quarter" ? n.step * 3 : n.step;
1615
- return vc(n.unit).range(e, new Date(t.valueOf() + 1), r);
1616
- }, yc = ({
1615
+ return xc(n.unit).range(e, new Date(t.valueOf() + 1), r);
1616
+ }, gc = ({
1617
1617
  unit: e,
1618
1618
  step: t,
1619
1619
  start: n,
1620
1620
  stop: r
1621
1621
  }) => {
1622
- const s = ca(r, n);
1622
+ const s = la(r, n);
1623
1623
  switch (e) {
1624
1624
  case "hour":
1625
1625
  return 24 * s / t > ve;
@@ -1634,7 +1634,7 @@ const $t = (e) => {
1634
1634
  case "year":
1635
1635
  return s / (365 * t) > ve;
1636
1636
  }
1637
- }, gc = (e, t) => {
1637
+ }, bc = (e, t) => {
1638
1638
  const n = !Is(t);
1639
1639
  switch (e.unit) {
1640
1640
  case "year":
@@ -1650,24 +1650,24 @@ const $t = (e) => {
1650
1650
  case "hour":
1651
1651
  return n ? { type: "datetime" } : { type: "time" };
1652
1652
  }
1653
- }, bc = (e, t) => {
1654
- const n = xc(t);
1653
+ }, vc = (e, t) => {
1654
+ const n = Sc(t);
1655
1655
  return n === null ? !1 : kr[e] > kr[n];
1656
- }, vc = (e) => {
1656
+ }, xc = (e) => {
1657
1657
  switch (e) {
1658
1658
  case "hour":
1659
- return ia;
1659
+ return ca;
1660
1660
  case "day":
1661
- return aa;
1661
+ return ia;
1662
1662
  case "week":
1663
- return oa;
1663
+ return aa;
1664
1664
  case "month":
1665
1665
  case "quarter":
1666
- return sa;
1666
+ return oa;
1667
1667
  case "year":
1668
- return ra;
1668
+ return sa;
1669
1669
  }
1670
- }, xc = (e) => {
1670
+ }, Sc = (e) => {
1671
1671
  switch (e.type) {
1672
1672
  case "year":
1673
1673
  return "year";
@@ -1693,24 +1693,24 @@ const $t = (e) => {
1693
1693
  right: "left",
1694
1694
  top: "bottom",
1695
1695
  bottom: "top"
1696
- }, Sc = { x: !0, y: !0, ySecondary: !1 }, wc = {
1696
+ }, wc = { x: !0, y: !0, ySecondary: !1 }, Ac = {
1697
1697
  bar: {
1698
1698
  cartesian: { hideGridX: !0 },
1699
1699
  flip: { hideGridX: !0 },
1700
1700
  polar: { hideGridX: !0, hideGridY: !0 }
1701
1701
  }
1702
- }, Ac = 20, Ir = /* @__PURE__ */ new Set(["top", "bottom"]), Tc = { type: "percentage" };
1703
- function Mc(e, t) {
1702
+ }, Tc = 20, Ir = /* @__PURE__ */ new Set(["top", "bottom"]), Mc = { type: "percentage" };
1703
+ function Lc(e, t) {
1704
1704
  const { scales: n, config: r, layers: s, coordSystem: o, variableLabels: a } = e;
1705
1705
  if (o.type === "polar") return [];
1706
- const i = Vc(s, o.type, r), c = new Set(t.map((d) => d.position)), l = kc(
1706
+ const i = Ec(s, o.type, r), c = new Set(t.map((d) => d.position)), l = Ic(
1707
1707
  qs(r.axes.y.position, o.axisMapping.y.position),
1708
1708
  c
1709
1709
  ), u = [];
1710
1710
  for (const d of Ks) {
1711
1711
  const p = n[d];
1712
1712
  if (!h(p) || p.kind !== "position") continue;
1713
- const m = Lc({
1713
+ const m = Vc({
1714
1714
  scaleAestheticKey: d,
1715
1715
  scale: p,
1716
1716
  config: r,
@@ -1724,26 +1724,26 @@ function Mc(e, t) {
1724
1724
  }
1725
1725
  return u;
1726
1726
  }
1727
- function Lc(e) {
1728
- const { scaleAestheticKey: t, scale: n, config: r, layers: s, axisMapping: o, resolvedYPosition: a, gridOverrides: i, variableLabels: c } = e, l = Z(t), { axisConfig: u, position: d } = Ec(t, r, o, a), p = fe(s, t), m = pc(s, t) ? Tc : he({ layers: s, scaleType: n.spec.scaleType, variableName: p }), y = Sn(p, c);
1727
+ function Vc(e) {
1728
+ const { scaleAestheticKey: t, scale: n, config: r, layers: s, axisMapping: o, resolvedYPosition: a, gridOverrides: i, variableLabels: c } = e, l = Z(t), { axisConfig: u, position: d } = kc(t, r, o, a), p = fe(s, t), m = mc(s, t) ? Mc : he({ layers: s, scaleType: n.spec.scaleType, variableName: p }), y = Sn(p, c);
1729
1729
  return {
1730
1730
  scaleAestheticKey: t,
1731
1731
  aesthetic: l,
1732
1732
  position: d,
1733
1733
  label: u.label ?? y,
1734
1734
  isVisible: u.isVisible,
1735
- tickCandidates: Cc(n, m),
1735
+ tickCandidates: Dc(n, m),
1736
1736
  valueFormat: m,
1737
1737
  tickMode: u.ticks.mode,
1738
1738
  ticksVisible: u.ticks.isVisible,
1739
- gridVisible: Ic(u, i, t),
1739
+ gridVisible: Cc(u, i, t),
1740
1740
  scaleType: n.spec.scaleType,
1741
1741
  bandwidth: n.bandwidth ?? void 0
1742
1742
  };
1743
1743
  }
1744
- function Vc(e, t, n) {
1744
+ function Ec(e, t, n) {
1745
1745
  const r = e.flatMap((i) => {
1746
- const c = wc[i.geom]?.[t];
1746
+ const c = Ac[i.geom]?.[t];
1747
1747
  return c ? [c] : [];
1748
1748
  }), s = r.some((i) => i.hideGridX), o = r.some((i) => i.hideGridY), a = r.some((i) => i.hideBorder);
1749
1749
  return {
@@ -1756,7 +1756,7 @@ function Cr(e, t) {
1756
1756
  if (e && t === null)
1757
1757
  return !1;
1758
1758
  }
1759
- function Ec(e, t, n, r) {
1759
+ function kc(e, t, n, r) {
1760
1760
  switch (e) {
1761
1761
  case "x":
1762
1762
  return {
@@ -1789,24 +1789,24 @@ function Ec(e, t, n, r) {
1789
1789
  function qs(e, t) {
1790
1790
  return Ir.has(e) === Ir.has(t) ? e : t;
1791
1791
  }
1792
- function kc(e, t) {
1792
+ function Ic(e, t) {
1793
1793
  return t.has(e) ? js[e] : e;
1794
1794
  }
1795
- function Ic(e, t, n) {
1795
+ function Cc(e, t, n) {
1796
1796
  const { gridVisible: r } = n === "x" ? t.x : t.y;
1797
- return r ?? e.grid.isVisible ?? Sc[n];
1797
+ return r ?? e.grid.isVisible ?? wc[n];
1798
1798
  }
1799
- const Cc = (e, t) => {
1799
+ const Dc = (e, t) => {
1800
1800
  if (e.spec.scaleType === "continuous") {
1801
1801
  const r = /* @__PURE__ */ new Set(), s = [];
1802
- for (let o = 1; o <= Ac; o++) {
1802
+ for (let o = 1; o <= Tc; o++) {
1803
1803
  const a = e.generateTicks({ count: o }), i = V(a);
1804
1804
  r.has(i) || (r.add(i), s.push({ ticks: a.map((c) => xt(e, c)) }));
1805
1805
  }
1806
1806
  return s;
1807
1807
  }
1808
- return e.spec.scaleType === "datetime" ? Dc(e, t) : [{ ticks: e.generateTicks().map((r) => xt(e, r)) }];
1809
- }, Dc = (e, t) => {
1808
+ return e.spec.scaleType === "datetime" ? Fc(e, t) : [{ ticks: e.generateTicks().map((r) => xt(e, r)) }];
1809
+ }, Fc = (e, t) => {
1810
1810
  const [n, r] = e.domain;
1811
1811
  if (!O(n) || !O(r))
1812
1812
  return [{ ticks: e.generateTicks().map((c) => xt(e, c)) }];
@@ -1818,8 +1818,8 @@ const Cc = (e, t) => {
1818
1818
  valueFormat: c
1819
1819
  }));
1820
1820
  };
1821
- for (const i of fc)
1822
- yc({ ...i, start: n, stop: r }) || bc(i.unit, t) || a(e.generateTicks({ interval: i }), gc(i, t));
1821
+ for (const i of hc)
1822
+ gc({ ...i, start: n, stop: r }) || vc(i.unit, t) || a(e.generateTicks({ interval: i }), bc(i, t));
1823
1823
  return a(e.generateTicks({ atInputs: !0 })), o.sort((i, c) => i.ticks.length - c.ticks.length), o;
1824
1824
  }, xt = (e, t) => ({ value: t, position: e.map(t) });
1825
1825
  function St(e, t) {
@@ -1842,14 +1842,14 @@ function Qs({
1842
1842
  layers: n,
1843
1843
  coordSystem: r
1844
1844
  }) {
1845
- const s = Fc({ layers: n, coordSystem: r, aesthetics: t }), o = Zs({ layers: n, aesthetics: t });
1845
+ const s = _c({ layers: n, coordSystem: r, aesthetics: t }), o = Zs({ layers: n, aesthetics: t });
1846
1846
  return e.domain.map((a) => ({
1847
1847
  value: a,
1848
1848
  swatchShape: s(a),
1849
1849
  owner: o(a)
1850
1850
  }));
1851
1851
  }
1852
- function Fc({
1852
+ function _c({
1853
1853
  layers: e,
1854
1854
  coordSystem: t,
1855
1855
  aesthetics: n
@@ -1884,7 +1884,7 @@ const wn = (e) => {
1884
1884
  const t = e.spec.scaleType;
1885
1885
  return t !== "continuous" && t !== "datetime";
1886
1886
  };
1887
- function _c({ scales: e, layers: t, coordSystem: n, valueLabels: r }) {
1887
+ function Rc({ scales: e, layers: t, coordSystem: n, valueLabels: r }) {
1888
1888
  const s = e.color;
1889
1889
  if (s === void 0 || !wn(s)) return [];
1890
1890
  if (!t.some((u) => h(u.mapping.color))) return [];
@@ -1892,8 +1892,8 @@ function _c({ scales: e, layers: t, coordSystem: n, valueLabels: r }) {
1892
1892
  if (Js({
1893
1893
  colorVariableName: o,
1894
1894
  xVariableName: fe(t, "x"),
1895
- mapsColorAcrossMultipleLayers: Nc(t) > 1,
1896
- isMergedWithAnotherAesthetic: Rc(e, t, o)
1895
+ mapsColorAcrossMultipleLayers: Pc(t) > 1,
1896
+ isMergedWithAnotherAesthetic: Nc(e, t, o)
1897
1897
  })) return [];
1898
1898
  const i = s.spec.scaleType, c = t.findIndex((u) => h(u.mapping.color));
1899
1899
  return Qs({ scale: s, aesthetics: ["color"], layers: t, coordSystem: n }).map(({ value: u, swatchShape: d, owner: p }) => {
@@ -1908,7 +1908,7 @@ function _c({ scales: e, layers: t, coordSystem: n, valueLabels: r }) {
1908
1908
  scaleType: i,
1909
1909
  variableName: g
1910
1910
  }),
1911
- label: dc(u, r)
1911
+ label: pc(u, r)
1912
1912
  };
1913
1913
  });
1914
1914
  }
@@ -1917,8 +1917,8 @@ const Js = ({
1917
1917
  xVariableName: t,
1918
1918
  mapsColorAcrossMultipleLayers: n,
1919
1919
  isMergedWithAnotherAesthetic: r
1920
- }) => r ? !1 : e === null || Ca(e) ? !n : t !== null && e === t;
1921
- function Rc(e, t, n) {
1920
+ }) => r ? !1 : e === null || Da(e) ? !n : t !== null && e === t;
1921
+ function Nc(e, t, n) {
1922
1922
  if (n === null) return !1;
1923
1923
  for (const r of xn) {
1924
1924
  if (r === "color") continue;
@@ -1928,8 +1928,8 @@ function Rc(e, t, n) {
1928
1928
  }
1929
1929
  return !1;
1930
1930
  }
1931
- const Nc = (e) => e.filter((t) => h(t.mapping.color)).length, eo = ["bar", "line", "area", "point"];
1932
- function Pc(e, t, n) {
1931
+ const Pc = (e) => e.filter((t) => h(t.mapping.color)).length, eo = ["bar", "line", "area", "point"];
1932
+ function Oc(e, t, n) {
1933
1933
  const r = t.findIndex((s) => eo.includes(s.geom));
1934
1934
  if (r === -1) return [];
1935
1935
  if (e.length < 2) {
@@ -1957,7 +1957,7 @@ function Dr(e, t, n) {
1957
1957
  const r = V(n);
1958
1958
  return e.filter((s, o) => V(t[o] ?? null) === r);
1959
1959
  }
1960
- const Oc = (e, t) => {
1960
+ const $c = (e, t) => {
1961
1961
  switch (t) {
1962
1962
  case "total": {
1963
1963
  const { sum: n, count: r } = Fr(e);
@@ -1970,7 +1970,7 @@ const Oc = (e, t) => {
1970
1970
  case "current":
1971
1971
  return e.at(-1) ?? null;
1972
1972
  }
1973
- }, $c = (e, t) => {
1973
+ }, Bc = (e, t) => {
1974
1974
  if (e.length < 2) return null;
1975
1975
  const n = e.at(-1), r = t === "previous" ? e.at(-2) : e.at(0);
1976
1976
  return n === void 0 || r === void 0 || n.cross === null || r.cross === null || r.cross === 0 ? null : {
@@ -1984,11 +1984,11 @@ const Oc = (e, t) => {
1984
1984
  },
1985
1985
  { sum: 0, count: 0 }
1986
1986
  );
1987
- function Bc(e) {
1987
+ function zc(e) {
1988
1988
  const { config: t, coordSystem: n } = e, r = t.headline.show;
1989
- return r === "none" || r === "conversion" ? null : n.type === "polar" ? zc(e, r) : Gc(e, r);
1989
+ return r === "none" || r === "conversion" ? null : n.type === "polar" ? Gc(e, r) : Wc(e, r);
1990
1990
  }
1991
- function zc(e, t) {
1991
+ function Gc(e, t) {
1992
1992
  if (t !== "total") return null;
1993
1993
  const { scales: n, layers: r } = e, s = r.find((c) => c.geom === "bar");
1994
1994
  if (s === void 0) return null;
@@ -2003,15 +2003,15 @@ function zc(e, t) {
2003
2003
  });
2004
2004
  return { kind: "grandTotal", value: o, valueFormat: i };
2005
2005
  }
2006
- function Gc(e, t) {
2006
+ function Wc(e, t) {
2007
2007
  const { config: n, scales: r, layers: s, variableLabels: o, colorGroups: a } = e;
2008
2008
  if (!s.some((l) => eo.includes(l.geom))) return null;
2009
- const i = Pc(a, s, o);
2009
+ const i = Oc(a, s, o);
2010
2010
  if (i.length === 0) return null;
2011
- const c = i.map((l) => Wc({ group: l, show: t, compareWith: n.headline.compareWith, layers: s, scales: r })).filter((l) => l !== null);
2011
+ const c = i.map((l) => Yc({ group: l, show: t, compareWith: n.headline.compareWith, layers: s, scales: r })).filter((l) => l !== null);
2012
2012
  return c.length === 0 ? null : { kind: "perGroup", items: c };
2013
2013
  }
2014
- function Wc({ group: e, show: t, compareWith: n, layers: r, scales: s }) {
2014
+ function Yc({ group: e, show: t, compareWith: n, layers: r, scales: s }) {
2015
2015
  const o = r[e.layerIndex];
2016
2016
  if (o === void 0) return null;
2017
2017
  const a = v(o.mapping.y);
@@ -2020,24 +2020,24 @@ function Wc({ group: e, show: t, compareWith: n, layers: r, scales: s }) {
2020
2020
  layers: [o],
2021
2021
  scaleType: l?.spec.scaleType ?? "continuous",
2022
2022
  variableName: a
2023
- }), d = Uc(o.data, i), p = he({
2023
+ }), d = Kc(o.data, i), p = he({
2024
2024
  layers: [o],
2025
2025
  scaleType: d ? "datetime" : s.x?.spec.scaleType ?? "discrete",
2026
2026
  variableName: i
2027
- }), m = Kc(o.data, i), y = m.getValues(a, { type: "numeric" }), g = i !== null ? m.getValues(i) : [], b = c !== null ? m.getValues(c) : null, x = Dr(y, b, e.value), S = Dr(g, b, e.value);
2027
+ }), m = Xc(o.data, i), y = m.getValues(a, { type: "numeric" }), g = i !== null ? m.getValues(i) : [], b = c !== null ? m.getValues(c) : null, x = Dr(y, b, e.value), S = Dr(g, b, e.value);
2028
2028
  return {
2029
2029
  value: e.value,
2030
2030
  swatch: e.swatch,
2031
- aggregate: Oc(x, t),
2031
+ aggregate: $c(x, t),
2032
2032
  valueFormat: u,
2033
2033
  groupLabelFormat: e.groupLabelFormat,
2034
2034
  mainValueFormat: p,
2035
2035
  label: e.label,
2036
- observationLabel: Yc(t, d, S),
2037
- comparison: Hc(t, n, d, S, x)
2036
+ observationLabel: Hc(t, d, S),
2037
+ comparison: Uc(t, n, d, S, x)
2038
2038
  };
2039
2039
  }
2040
- function Yc(e, t, n) {
2040
+ function Hc(e, t, n) {
2041
2041
  if (e === "current") {
2042
2042
  const o = n.at(-1);
2043
2043
  return o === void 0 ? null : { kind: "point", value: o };
@@ -2046,26 +2046,26 @@ function Yc(e, t, n) {
2046
2046
  const r = n.at(0), s = n.at(-1);
2047
2047
  return r === void 0 || s === void 0 ? null : { kind: "range", from: r, to: s };
2048
2048
  }
2049
- function Hc(e, t, n, r, s) {
2049
+ function Uc(e, t, n, r, s) {
2050
2050
  if (e !== "current" || !n) return null;
2051
2051
  const o = t === "none" ? "first" : t, a = r.map((i, c) => ({ main: i, cross: s[c] ?? null }));
2052
- return $c(a, o);
2052
+ return Bc(a, o);
2053
2053
  }
2054
- function Uc(e, t) {
2054
+ function Kc(e, t) {
2055
2055
  return t !== null && e.hasVariable(t) && e.getType(t) === "temporal";
2056
2056
  }
2057
- function Kc(e, t) {
2057
+ function Xc(e, t) {
2058
2058
  return t === null || !["numeric", "temporal"].includes(e.getType(t)) ? e : e.orderBy(t);
2059
2059
  }
2060
2060
  function J(e) {
2061
2061
  return e === "stack" || e === "fill";
2062
2062
  }
2063
- const Xc = 3, jc = {
2063
+ const jc = 3, qc = {
2064
2064
  line: { stack: !0, dodge: !0, identity: !0, fill: !0 },
2065
2065
  area: { stack: !0, dodge: !0, identity: !0, fill: !0 },
2066
2066
  bar: { stack: !0, fill: !0 }
2067
2067
  };
2068
- function qc({
2068
+ function Qc({
2069
2069
  scales: e,
2070
2070
  config: t,
2071
2071
  layers: n,
@@ -2074,25 +2074,25 @@ function qc({
2074
2074
  colorGroups: o
2075
2075
  }) {
2076
2076
  if (t.legend.position === "none") return [];
2077
- const a = new Map(o.map((g) => [V(g.value), g])), i = Jc({ scales: e, layers: n }), c = rl(i), l = fe(n, "x"), u = c.map((g) => {
2078
- if (tl(g, l, n)) return null;
2079
- const b = ol({ group: g, variableLabels: s, layers: n, coordSystem: r, colorGroupsByValue: a });
2077
+ const a = new Map(o.map((g) => [V(g.value), g])), i = el({ scales: e, layers: n }), c = sl(i), l = fe(n, "x"), u = c.map((g) => {
2078
+ if (nl(g, l, n)) return null;
2079
+ const b = al({ group: g, variableLabels: s, layers: n, coordSystem: r, colorGroupsByValue: a });
2080
2080
  return b.items.length === 0 ? null : { group: g, built: b };
2081
2081
  }).filter(h);
2082
2082
  if (u.length === 0) return [];
2083
- const d = Qc(u);
2084
- if (t.legend.position === "auto" && ul(d, n, r))
2083
+ const d = Zc(u);
2084
+ if (t.legend.position === "auto" && dl(d, n, r))
2085
2085
  return [];
2086
- const p = dl(t.legend.position, d, n, r), m = ml(t.legend.display, p, n, r), y = m === "direct" ? yl(n) : null;
2087
- return u.map(({ built: g }) => Zc(g, p, m, y));
2086
+ const p = pl(t.legend.position, d, n, r), m = fl(t.legend.display, p, n, r), y = m === "direct" ? gl(n) : null;
2087
+ return u.map(({ built: g }) => Jc(g, p, m, y));
2088
2088
  }
2089
- function Qc(e) {
2089
+ function Zc(e) {
2090
2090
  return e.reduce((t, { group: n, built: r }) => {
2091
2091
  const s = n.some((o) => o.guideType !== "discrete");
2092
2092
  return t + (s ? 1 : r.items.length);
2093
2093
  }, 0);
2094
2094
  }
2095
- function Zc(e, t, n, r) {
2095
+ function Jc(e, t, n, r) {
2096
2096
  return n !== "direct" || r === null ? { ...e, position: t, display: n } : {
2097
2097
  ...e,
2098
2098
  position: t,
@@ -2103,42 +2103,42 @@ function Zc(e, t, n, r) {
2103
2103
  }))
2104
2104
  };
2105
2105
  }
2106
- function Jc(e) {
2106
+ function el(e) {
2107
2107
  const { scales: t, layers: n } = e, r = [];
2108
2108
  for (const s of xn) {
2109
2109
  const o = t[s];
2110
- if (o === void 0 || o.kind === "identity" || !el(s, n)) continue;
2111
- const a = fe(n, s), i = hl(s, o);
2110
+ if (o === void 0 || o.kind === "identity" || !tl(s, n)) continue;
2111
+ const a = fe(n, s), i = yl(s, o);
2112
2112
  r.push({ scaleAestheticKey: s, scale: o, variableName: a, guideType: i });
2113
2113
  }
2114
2114
  return r;
2115
2115
  }
2116
- function el(e, t) {
2116
+ function tl(e, t) {
2117
2117
  const n = Z(e);
2118
2118
  return t.some((r) => h(r.mapping[n]));
2119
2119
  }
2120
- function tl(e, t, n) {
2120
+ function nl(e, t, n) {
2121
2121
  const [r] = e;
2122
2122
  return r.scaleAestheticKey !== "color" ? !1 : Js({
2123
2123
  colorVariableName: r.variableName,
2124
2124
  xVariableName: t,
2125
- mapsColorAcrossMultipleLayers: nl(r.scaleAestheticKey, n),
2125
+ mapsColorAcrossMultipleLayers: rl(r.scaleAestheticKey, n),
2126
2126
  isMergedWithAnotherAesthetic: e.length > 1
2127
2127
  });
2128
2128
  }
2129
- function nl(e, t) {
2129
+ function rl(e, t) {
2130
2130
  const n = Z(e);
2131
2131
  return t.filter((r) => h(r.mapping[n])).length > 1;
2132
2132
  }
2133
- function rl(e) {
2133
+ function sl(e) {
2134
2134
  const t = /* @__PURE__ */ new Map();
2135
2135
  for (const n of e) {
2136
- const r = fl(n), s = t.get(r);
2136
+ const r = hl(n), s = t.get(r);
2137
2137
  s ? s.push(n) : t.set(r, [n]);
2138
2138
  }
2139
2139
  return [...t.values()];
2140
2140
  }
2141
- function sl(e, t, n) {
2141
+ function ol(e, t, n) {
2142
2142
  if (t === "lineType") {
2143
2143
  e.lineType = n;
2144
2144
  return;
@@ -2149,7 +2149,7 @@ function sl(e, t, n) {
2149
2149
  }
2150
2150
  e[t] = n;
2151
2151
  }
2152
- function ol({
2152
+ function al({
2153
2153
  group: e,
2154
2154
  variableLabels: t,
2155
2155
  layers: n,
@@ -2164,37 +2164,37 @@ function ol({
2164
2164
  return {
2165
2165
  aesthetics: e.map((u) => u.scaleAestheticKey),
2166
2166
  title: c,
2167
- items: i.map((u) => al(u, e, a, l, s))
2167
+ items: i.map((u) => il(u, e, a, l, s))
2168
2168
  };
2169
2169
  }
2170
- function al(e, t, n, r, s) {
2170
+ function il(e, t, n, r, s) {
2171
2171
  const o = {};
2172
2172
  for (const i of t)
2173
- sl(o, i.scaleAestheticKey, i.scale.map(e.value));
2174
- const a = cl(e, t, n, r, s);
2173
+ ol(o, i.scaleAestheticKey, i.scale.map(e.value));
2174
+ const a = ll(e, t, n, r, s);
2175
2175
  return {
2176
2176
  value: e.value,
2177
- label: il(t, e, s),
2177
+ label: cl(t, e, s),
2178
2178
  visual: o,
2179
2179
  normalizedY: null,
2180
2180
  swatchShape: e.swatchShape,
2181
2181
  valueFormat: a
2182
2182
  };
2183
2183
  }
2184
- function il(e, t, n) {
2184
+ function cl(e, t, n) {
2185
2185
  return e[0].scaleAestheticKey !== "color" ? null : n.get(V(t.value))?.label ?? null;
2186
2186
  }
2187
- function cl(e, t, n, r, s) {
2187
+ function ll(e, t, n, r, s) {
2188
2188
  if (t[0].scaleAestheticKey === "color")
2189
2189
  return s.get(V(e.value))?.valueFormat ?? r;
2190
- const o = e.owner?.layer, a = ll(o, n);
2190
+ const o = e.owner?.layer, a = ul(o, n);
2191
2191
  return o === void 0 || a === null ? r : he({
2192
2192
  layers: [o],
2193
2193
  scaleType: t[0].scale.spec.scaleType,
2194
2194
  variableName: a
2195
2195
  });
2196
2196
  }
2197
- function ll(e, t) {
2197
+ function ul(e, t) {
2198
2198
  if (e === void 0) return null;
2199
2199
  for (const n of t) {
2200
2200
  const r = e.mapping[n];
@@ -2204,23 +2204,23 @@ function ll(e, t) {
2204
2204
  }
2205
2205
  return null;
2206
2206
  }
2207
- function ul(e, t, n) {
2207
+ function dl(e, t, n) {
2208
2208
  if (e > 1) return !1;
2209
2209
  const r = n.type === "polar";
2210
2210
  return mt(t, ["line", "area", "bar"]) || r;
2211
2211
  }
2212
- function dl(e, t, n, r) {
2212
+ function pl(e, t, n, r) {
2213
2213
  if (e !== "auto") return e;
2214
2214
  if (r.type === "polar") return "top";
2215
- const s = mt(n, ["line", "area"]), o = mt(n, ["bar"]), a = mt(n, ["bar"], (c) => J(c.position)), i = t >= Xc;
2215
+ const s = mt(n, ["line", "area"]), o = mt(n, ["bar"]), a = mt(n, ["bar"], (c) => J(c.position)), i = t >= jc;
2216
2216
  return s && o ? "top" : s ? i ? "right" : "top" : a ? to(r) ? "top" : i ? "right" : "top" : "top";
2217
2217
  }
2218
- function pl(e) {
2218
+ function ml(e) {
2219
2219
  if (e.length !== 1) return !1;
2220
2220
  const t = e[0];
2221
- return t ? jc[t.geom]?.[t.position] === !0 : !1;
2221
+ return t ? qc[t.geom]?.[t.position] === !0 : !1;
2222
2222
  }
2223
- function ml(e, t, n, r) {
2223
+ function fl(e, t, n, r) {
2224
2224
  if (!(t === "right" && !to(r))) return "pill";
2225
2225
  switch (e) {
2226
2226
  case "pill":
@@ -2228,7 +2228,7 @@ function ml(e, t, n, r) {
2228
2228
  case "direct":
2229
2229
  return "direct";
2230
2230
  case "auto":
2231
- return pl(n) ? "direct" : "pill";
2231
+ return ml(n) ? "direct" : "pill";
2232
2232
  }
2233
2233
  }
2234
2234
  function to(e) {
@@ -2237,14 +2237,14 @@ function to(e) {
2237
2237
  function mt(e, t, n) {
2238
2238
  return e.some((r) => t.includes(r.geom) && (n?.(r) ?? !0));
2239
2239
  }
2240
- function fl(e) {
2240
+ function hl(e) {
2241
2241
  const t = e.scale.domain.map(V);
2242
2242
  return JSON.stringify([e.variableName, e.guideType, ...t]);
2243
2243
  }
2244
- function hl(e, t) {
2244
+ function yl(e, t) {
2245
2245
  return wn(t) ? "discrete" : `continuous:${e}`;
2246
2246
  }
2247
- function yl(e) {
2247
+ function gl(e) {
2248
2248
  const t = e[0];
2249
2249
  if (!t) return /* @__PURE__ */ new Map();
2250
2250
  const n = /* @__PURE__ */ new Map();
@@ -2261,7 +2261,7 @@ function yl(e) {
2261
2261
  n.set(String(o), c);
2262
2262
  }), n;
2263
2263
  }
2264
- class gl extends ce {
2264
+ class bl extends ce {
2265
2265
  dependencies(t) {
2266
2266
  return [
2267
2267
  t.scales,
@@ -2275,11 +2275,11 @@ class gl extends ce {
2275
2275
  ];
2276
2276
  }
2277
2277
  run(t) {
2278
- const n = lc(t.originalData), r = _c({
2278
+ const n = uc(t.originalData), r = Rc({
2279
2279
  scales: t.scales,
2280
2280
  layers: t.layers,
2281
2281
  coordSystem: t.coordSystem,
2282
- valueLabels: uc(t.originalData, t.layers, n)
2282
+ valueLabels: dc(t.originalData, t.layers, n)
2283
2283
  }), s = {
2284
2284
  scales: t.scales,
2285
2285
  config: t.config,
@@ -2287,9 +2287,9 @@ class gl extends ce {
2287
2287
  coordSystem: t.coordSystem,
2288
2288
  variableLabels: n,
2289
2289
  colorGroups: r
2290
- }, o = Bc(s), a = bl(o, qc(s));
2290
+ }, o = zc(s), a = vl(o, Qc(s));
2291
2291
  return {
2292
- axes: Mc(s, a),
2292
+ axes: Lc(s, a),
2293
2293
  legends: a,
2294
2294
  headline: o,
2295
2295
  panel: { border: { isVisible: t.config.panel.border.isVisible } },
@@ -2297,7 +2297,7 @@ class gl extends ce {
2297
2297
  };
2298
2298
  }
2299
2299
  }
2300
- const bl = (e, t) => e?.kind !== "perGroup" || t.some((r) => r.display === "direct") ? t : [], vl = (e) => V([ke(e)]), An = (e, t) => {
2300
+ const vl = (e, t) => e?.kind !== "perGroup" || t.some((r) => r.display === "direct") ? t : [], xl = (e) => V([ke(e)]), An = (e, t) => {
2301
2301
  const n = t !== null ? e[t] ?? null : null;
2302
2302
  return V([n]);
2303
2303
  }, ee = (e, t) => {
@@ -2318,14 +2318,14 @@ const bl = (e, t) => e?.kind !== "perGroup" || t.some((r) => r.display === "dire
2318
2318
  return null;
2319
2319
  }
2320
2320
  } : () => null;
2321
- }, Tn = (e, t) => ee(e, t.x), xl = (e, t) => ee(e, t.y), ng = (e, t) => ee(e, t.label), Sl = (e, t) => ee(e, t.color), rg = (e, t) => ee(e, t.size), sg = (e, t) => ee(e, t.alpha), og = (e, t) => ee(e, t.group), ag = (e, t) => ee(e, t.strokeWidth), _r = { variable: f.yRaw };
2321
+ }, Tn = (e, t) => ee(e, t.x), Sl = (e, t) => ee(e, t.y), ng = (e, t) => ee(e, t.label), wl = (e, t) => ee(e, t.color), rg = (e, t) => ee(e, t.size), sg = (e, t) => ee(e, t.alpha), og = (e, t) => ee(e, t.group), ag = (e, t) => ee(e, t.strokeWidth), _r = { variable: f.yRaw };
2322
2322
  function Mn(e, t) {
2323
2323
  return J(e) ? _r : t.y ?? _r;
2324
2324
  }
2325
2325
  function Ln(e) {
2326
2326
  return ee(e.data, Mn(e.position, e.mapping));
2327
2327
  }
2328
- const wl = ["lt", "lte", "gt", "gte", "range"];
2328
+ const Al = ["lt", "lte", "gt", "gte", "range"];
2329
2329
  function ft(e, t) {
2330
2330
  if ("and" in e) {
2331
2331
  const n = e.and.map((r) => ft(r, t));
@@ -2345,7 +2345,7 @@ function ft(e, t) {
2345
2345
  const n = ft(e.not, t);
2346
2346
  return (r) => !n(r);
2347
2347
  }
2348
- return Al(e, t);
2348
+ return Tl(e, t);
2349
2349
  }
2350
2350
  function ht(e, t) {
2351
2351
  if ("and" in e) {
@@ -2360,14 +2360,14 @@ function ht(e, t) {
2360
2360
  ht(e.not, t);
2361
2361
  return;
2362
2362
  }
2363
- const n = Tl(e);
2363
+ const n = Ml(e);
2364
2364
  if (n !== null && t.hasVariable(e.variable) && t.getType(e.variable) === "categorical")
2365
2365
  throw new Error(
2366
2366
  `Highlight predicate uses ordering operator '${n}' on categorical variable '${e.variable}'. Use 'eq' or 'oneOf' instead.`
2367
2367
  );
2368
2368
  }
2369
2369
  const Rr = () => !1;
2370
- function Al(e, t) {
2370
+ function Tl(e, t) {
2371
2371
  if (!t.hasVariable(e.variable)) return Rr;
2372
2372
  const n = t.getType(e.variable);
2373
2373
  if ("eq" in e) {
@@ -2413,8 +2413,8 @@ function Al(e, t) {
2413
2413
  }
2414
2414
  return Rr;
2415
2415
  }
2416
- function Tl(e) {
2417
- for (const t of wl)
2416
+ function Ml(e) {
2417
+ for (const t of Al)
2418
2418
  if (t in e) return t;
2419
2419
  return null;
2420
2420
  }
@@ -2432,21 +2432,21 @@ function Nr(e, t) {
2432
2432
  function oe(e, t, n) {
2433
2433
  return t !== "temporal" || !Ue(e) ? e : gn(e, void 0, n);
2434
2434
  }
2435
- const Ml = {
2435
+ const Ll = {
2436
2436
  bar: "observation-rerender",
2437
2437
  rule: null,
2438
2438
  line: "overlay-anchor",
2439
2439
  area: "overlay-anchor",
2440
2440
  point: "overlay-anchor"
2441
2441
  };
2442
- function Ll(e) {
2443
- const t = Ml[e];
2442
+ function Vl(e) {
2443
+ const t = Ll[e];
2444
2444
  return t === null ? null : { strategy: t, composition: no() };
2445
2445
  }
2446
2446
  function no() {
2447
2447
  return { isDimmed: !1, matchedLayer: null, overlayCandidates: [] };
2448
2448
  }
2449
- class Vl extends Ie {
2449
+ class El extends Ie {
2450
2450
  dependencies(t) {
2451
2451
  return [t.highlights, t.config.parsingLocale];
2452
2452
  }
@@ -2455,7 +2455,7 @@ class Vl extends Ie {
2455
2455
  if (r === null) return t;
2456
2456
  const s = n.highlights.filter(({ layerId: a }) => a === void 0 || a === t.id);
2457
2457
  if (s.length === 0) return t;
2458
- const o = El({
2458
+ const o = kl({
2459
2459
  layer: t,
2460
2460
  highlights: s,
2461
2461
  parsingLocale: n.config.parsingLocale,
@@ -2464,7 +2464,7 @@ class Vl extends Ie {
2464
2464
  return { ...t, highlight: { ...r, composition: o } };
2465
2465
  }
2466
2466
  }
2467
- function El({
2467
+ function kl({
2468
2468
  layer: e,
2469
2469
  highlights: t,
2470
2470
  parsingLocale: n,
@@ -2472,7 +2472,7 @@ function El({
2472
2472
  }) {
2473
2473
  for (const T of t)
2474
2474
  ht(T.predicate, e.data);
2475
- const s = v(e.mapping.x), o = kl(e, n), a = t.map(
2475
+ const s = v(e.mapping.x), o = Il(e, n), a = t.map(
2476
2476
  (T) => ({
2477
2477
  predicate: ft(T.predicate, o),
2478
2478
  scope: T.scope
@@ -2481,7 +2481,7 @@ function El({
2481
2481
  let x = !1, S = 0;
2482
2482
  for (const T of e.data) {
2483
2483
  let te, ue;
2484
- d !== null && (te = vl(T), d[S] = te), p !== null && (ue = An(T, s), p[S] = ue), m !== null && (m[S] = T);
2484
+ d !== null && (te = xl(T), d[S] = te), p !== null && (ue = An(T, s), p[S] = ue), m !== null && (m[S] = T);
2485
2485
  for (const { predicate: nt, scope: rt } of a)
2486
2486
  if (nt(T))
2487
2487
  switch (rt) {
@@ -2515,7 +2515,7 @@ function El({
2515
2515
  const X = $ > 0 ? { ...e, data: e.data.filterByMask(w) } : null;
2516
2516
  return { isDimmed: (r === "observation-rerender" || g.size > 0) && X !== null, matchedLayer: X, overlayCandidates: k };
2517
2517
  }
2518
- function kl(e, t) {
2518
+ function Il(e, t) {
2519
2519
  const n = v(e.mapping.y), r = Ln(e);
2520
2520
  return {
2521
2521
  hasVariable: (s) => e.data.hasVariable(s),
@@ -2524,7 +2524,7 @@ function kl(e, t) {
2524
2524
  parsingLocale: t
2525
2525
  };
2526
2526
  }
2527
- class Il extends Ie {
2527
+ class Cl extends Ie {
2528
2528
  constructor(t, n, r, s, o) {
2529
2529
  super(), this.transformCompiler = t, this.statCompiler = n, this.groupCompiler = r, this.geomCompiler = s, this.positionAdjusterCompiler = o;
2530
2530
  }
@@ -2568,7 +2568,7 @@ class Il extends Ie {
2568
2568
  interactive: t.interactive,
2569
2569
  dataLabels: t.dataLabels,
2570
2570
  summary: {},
2571
- highlight: Ll(t.geom)
2571
+ highlight: Vl(t.geom)
2572
2572
  };
2573
2573
  }
2574
2574
  }
@@ -2583,7 +2583,7 @@ class ro extends Error {
2583
2583
  ${n}`), this.issues = t, this.name = "SpecValidationError";
2584
2584
  }
2585
2585
  }
2586
- class Cl {
2586
+ class Dl {
2587
2587
  constructor(t, n) {
2588
2588
  this.transformCompiler = t, this.validator = n;
2589
2589
  }
@@ -2606,7 +2606,7 @@ class Cl {
2606
2606
  throw new ro(n);
2607
2607
  }
2608
2608
  }
2609
- class Dl {
2609
+ class Fl {
2610
2610
  constructor(t, n) {
2611
2611
  this.geomRegistry = t, this.statRegistry = n;
2612
2612
  }
@@ -2694,7 +2694,7 @@ class Dl {
2694
2694
  ] : [];
2695
2695
  }
2696
2696
  }
2697
- class Fl {
2697
+ class _l {
2698
2698
  constructor(t) {
2699
2699
  this.registry = t;
2700
2700
  }
@@ -2704,7 +2704,7 @@ class Fl {
2704
2704
  }
2705
2705
  class kt {
2706
2706
  }
2707
- class _l extends kt {
2707
+ class Rl extends kt {
2708
2708
  constructor() {
2709
2709
  super(...arguments), this.type = "dodge";
2710
2710
  }
@@ -2718,7 +2718,7 @@ class _l extends kt {
2718
2718
  });
2719
2719
  if (s.length === 0)
2720
2720
  return { data: t, mapping: {} };
2721
- const o = t.size(), a = t.getValues(W.group, { type: "categorical" }), i = Us / 2, c = s.length > 1 ? ec : 0, l = ys().domain(s.map(String)).range([-i, i]).paddingInner(c).paddingOuter(0), u = l.bandwidth(), d = new Array(o).fill(null), p = new Array(o).fill(null);
2721
+ const o = t.size(), a = t.getValues(W.group, { type: "categorical" }), i = Us / 2, c = s.length > 1 ? tc : 0, l = ys().domain(s.map(String)).range([-i, i]).paddingInner(c).paddingOuter(0), u = l.bandwidth(), d = new Array(o).fill(null), p = new Array(o).fill(null);
2722
2722
  for (let y = 0; y < o; y++) {
2723
2723
  const g = a[y];
2724
2724
  if (!h(g)) continue;
@@ -2745,7 +2745,7 @@ const Or = A("__ungrouped__"), so = (e, t) => {
2745
2745
  }
2746
2746
  return { yValues: c, observationIndexByXAndGroup: d, uniqueGroupKeys: a, observationCount: u };
2747
2747
  };
2748
- class Rl extends kt {
2748
+ class Nl extends kt {
2749
2749
  constructor() {
2750
2750
  super(...arguments), this.type = "fill";
2751
2751
  }
@@ -2784,7 +2784,7 @@ class Rl extends kt {
2784
2784
  return { data: t.addVariable(f.yMin, "numeric", l).addVariable(f.yMax, "numeric", c).addVariable(f.yRaw, "numeric", s), mapping: {} };
2785
2785
  }
2786
2786
  }
2787
- class Nl extends kt {
2787
+ class Pl extends kt {
2788
2788
  constructor() {
2789
2789
  super(...arguments), this.type = "identity";
2790
2790
  }
@@ -2795,7 +2795,7 @@ class Nl extends kt {
2795
2795
  };
2796
2796
  }
2797
2797
  }
2798
- class Pl extends kt {
2798
+ class Ol extends kt {
2799
2799
  constructor() {
2800
2800
  super(...arguments), this.type = "stack";
2801
2801
  }
@@ -2824,12 +2824,12 @@ class Pl extends kt {
2824
2824
  return d !== null && (u = u.addVariable(d, "numeric", c)), { data: u, mapping: {} };
2825
2825
  }
2826
2826
  }
2827
- class Ol extends Ce {
2827
+ class $l extends Ce {
2828
2828
  constructor() {
2829
- super("position"), this.register("identity", new Nl()), this.register("stack", new Pl()), this.register("fill", new Rl()), this.register("dodge", new _l());
2829
+ super("position"), this.register("identity", new Pl()), this.register("stack", new Ol()), this.register("fill", new Nl()), this.register("dodge", new Rl());
2830
2830
  }
2831
2831
  }
2832
- class $l {
2832
+ class Bl {
2833
2833
  map({ data: t, layer: n, getPositionScale: r }) {
2834
2834
  const s = v(n.mapping.x), o = r("x");
2835
2835
  if (!s || !o) return t;
@@ -2837,7 +2837,7 @@ class $l {
2837
2837
  return t.addVariable(f.x, "numeric", i);
2838
2838
  }
2839
2839
  }
2840
- class Bl {
2840
+ class zl {
2841
2841
  map({ data: t, getPositionScale: n }) {
2842
2842
  const r = n("x");
2843
2843
  if (!r?.bandwidth || !t.hasVariable(f.x) || !t.hasVariable(f.xMin) || !t.hasVariable(f.xMax))
@@ -2850,7 +2850,7 @@ class Bl {
2850
2850
  return t.addVariable(f.xMin, "numeric", c).addVariable(f.xMax, "numeric", l);
2851
2851
  }
2852
2852
  }
2853
- class zl {
2853
+ class Gl {
2854
2854
  map({ data: t, layer: n, getPositionScale: r }) {
2855
2855
  const s = v(n.mapping.y), o = qe(n.yScaleType), a = r(o);
2856
2856
  if (!s || !a) return t;
@@ -2858,7 +2858,7 @@ class zl {
2858
2858
  return t.addVariable(f.y, "numeric", c);
2859
2859
  }
2860
2860
  }
2861
- class Gl {
2861
+ class Wl {
2862
2862
  map({ data: t, layer: n, getPositionScale: r }) {
2863
2863
  const s = qe(n.yScaleType), o = r(s);
2864
2864
  if (!o || !t.hasVariable(f.yMin) || !t.hasVariable(f.yMax))
@@ -2871,33 +2871,33 @@ class Gl {
2871
2871
  return t.addVariable(f.yMin, "numeric", l).addVariable(f.yMax, "numeric", u);
2872
2872
  }
2873
2873
  }
2874
- const Wl = [
2875
- new $l(),
2876
- new zl(),
2877
- // Extent mappers must come after their primary mappers (they read the previously mapped x and y values).
2874
+ const Yl = [
2878
2875
  new Bl(),
2879
- new Gl()
2876
+ new Gl(),
2877
+ // Extent mappers must come after their primary mappers (they read the previously mapped x and y values).
2878
+ new zl(),
2879
+ new Wl()
2880
2880
  ];
2881
- function Yl(e, t) {
2881
+ function Hl(e, t) {
2882
2882
  const n = e[t];
2883
2883
  return n?.kind === "position" ? n : null;
2884
2884
  }
2885
- class Hl extends Ie {
2886
- constructor(t = Wl) {
2885
+ class Ul extends Ie {
2886
+ constructor(t = Yl) {
2887
2887
  super(), this.mappers = t;
2888
2888
  }
2889
2889
  dependencies(t) {
2890
2890
  return [t.scales.x, t.scales.y, t.scales.ySecondary];
2891
2891
  }
2892
2892
  compileLayer(t, n) {
2893
- const r = (o) => Yl(n.scales, o);
2893
+ const r = (o) => Hl(n.scales, o);
2894
2894
  let s = t.data;
2895
2895
  for (const o of this.mappers)
2896
2896
  s = o.map({ data: s, layer: t, getPositionScale: r });
2897
2897
  return { ...t, data: s };
2898
2898
  }
2899
2899
  }
2900
- class Ul extends ce {
2900
+ class Kl extends ce {
2901
2901
  constructor(t) {
2902
2902
  super(), this.registry = t;
2903
2903
  }
@@ -2958,7 +2958,7 @@ class Ul extends ce {
2958
2958
  for (const s of t)
2959
2959
  for (const [o, a] of Object.entries(s.mapping)) {
2960
2960
  const i = o, c = i === "y" ? qe(s.yScaleType) : i;
2961
- if (!cc(c) || !n.has(c)) continue;
2961
+ if (!lc(c) || !n.has(c)) continue;
2962
2962
  const l = this.resolveVariables(i, a, s.data);
2963
2963
  this.collectFromVariables(s.data, l, c, r);
2964
2964
  }
@@ -3006,7 +3006,7 @@ class Qe {
3006
3006
  };
3007
3007
  }
3008
3008
  }
3009
- class Kl extends Qe {
3009
+ class Xl extends Qe {
3010
3010
  constructor() {
3011
3011
  super(...arguments), this.compatibleDataTypes = ["numeric"];
3012
3012
  }
@@ -3024,7 +3024,7 @@ class Kl extends Qe {
3024
3024
  }
3025
3025
  createD3Scale(t, n, r) {
3026
3026
  let s = [r.domainMin ?? t[0], r.domainMax ?? t[1]];
3027
- const o = r.transform === "log" && Xl(s), a = o ? la() : r.transform === "sqrt" ? ua() : da();
3027
+ const o = r.transform === "log" && jl(s), a = o ? ua() : r.transform === "sqrt" ? da() : pa();
3028
3028
  return r.nice && !o && (s = a.copy().domain(s).nice().domain()), a.domain([r.domainMin ?? s[0], r.domainMax ?? s[1]]).range(n).clamp(r.clamp);
3029
3029
  }
3030
3030
  buildPositionScale(t, n) {
@@ -3045,11 +3045,11 @@ class Kl extends Qe {
3045
3045
  });
3046
3046
  }
3047
3047
  }
3048
- const Xl = (e) => {
3048
+ const jl = (e) => {
3049
3049
  const [t, n] = e;
3050
3050
  return t > 0 && n > 0 || t < 0 && n < 0;
3051
3051
  };
3052
- class jl extends Qe {
3052
+ class ql extends Qe {
3053
3053
  constructor() {
3054
3054
  super(...arguments), this.compatibleDataTypes = ["temporal"];
3055
3055
  }
@@ -3085,7 +3085,7 @@ class jl extends Qe {
3085
3085
  return n === 1 / 0 ? [] : [new Date(n), new Date(r)];
3086
3086
  }
3087
3087
  createD3Scale(t, n, r) {
3088
- const s = ql(t) ? t : [], o = pa().domain(s).range(n).clamp(r.clamp);
3088
+ const s = Ql(t) ? t : [], o = ma().domain(s).range(n).clamp(r.clamp);
3089
3089
  if (r.nice && o.nice(), h(r.domainMin) || h(r.domainMax)) {
3090
3090
  const [a, i] = o.domain();
3091
3091
  a !== void 0 && i !== void 0 && o.domain([r.domainMin ?? a, r.domainMax ?? i]);
@@ -3098,11 +3098,11 @@ class jl extends Qe {
3098
3098
  map: o,
3099
3099
  domain: o.domain(),
3100
3100
  bandwidth: null,
3101
- generateTicks: (l) => l && "atInputs" in l ? c : l && "interval" in l ? a && i ? hc(a, i, l.interval) : [] : o.ticks(l?.count)
3101
+ generateTicks: (l) => l && "atInputs" in l ? c : l && "interval" in l ? a && i ? yc(a, i, l.interval) : [] : o.ticks(l?.count)
3102
3102
  });
3103
3103
  }
3104
3104
  }
3105
- const ql = (e) => e.length === 2 && O(e[0]) && O(e[1]), Se = {
3105
+ const Ql = (e) => e.length === 2 && O(e[0]) && O(e[1]), Se = {
3106
3106
  transform: "linear",
3107
3107
  reverse: !1,
3108
3108
  nice: !0,
@@ -3126,10 +3126,10 @@ const ql = (e) => e.length === 2 && O(e[0]) && O(e[1]), Se = {
3126
3126
  domain: null,
3127
3127
  padding: 0.1,
3128
3128
  reverse: !1
3129
- }, Ql = {
3129
+ }, Zl = {
3130
3130
  palette: { type: "default" }
3131
3131
  };
3132
- class Zl extends Qe {
3132
+ class Jl extends Qe {
3133
3133
  constructor() {
3134
3134
  super(...arguments), this.compatibleDataTypes = ["categorical", "numeric", "temporal"];
3135
3135
  }
@@ -3171,7 +3171,7 @@ class Zl extends Qe {
3171
3171
  });
3172
3172
  }
3173
3173
  }
3174
- class Jl extends Qe {
3174
+ class eu extends Qe {
3175
3175
  constructor() {
3176
3176
  super(...arguments), this.compatibleDataTypes = ["numeric", "categorical", "temporal"];
3177
3177
  }
@@ -3188,7 +3188,7 @@ class Jl extends Qe {
3188
3188
  };
3189
3189
  }
3190
3190
  }
3191
- const eu = ["grey", "red", "orange", "yellow", "green", "cyan", "blue", "purple", "pink"], tu = ["cyan", "pink", "purple", "red", "orange", "yellow", "green", "blue"], oo = [
3191
+ const tu = ["grey", "red", "orange", "yellow", "green", "cyan", "blue", "purple", "pink"], nu = ["cyan", "pink", "purple", "red", "orange", "yellow", "green", "blue"], oo = [
3192
3192
  "#B399FE",
3193
3193
  "#FC7E91",
3194
3194
  "#33B6E0",
@@ -3212,7 +3212,7 @@ const eu = ["grey", "red", "orange", "yellow", "green", "cyan", "blue", "purple"
3212
3212
  dark_purple: "#6D48D2",
3213
3213
  plum: "#C82184",
3214
3214
  pink: "#FC8497"
3215
- }, nu = [
3215
+ }, ru = [
3216
3216
  j.purple,
3217
3217
  j.pink,
3218
3218
  j.yellow,
@@ -3233,7 +3233,7 @@ const eu = ["grey", "red", "orange", "yellow", "green", "cyan", "blue", "purple"
3233
3233
  red: "#FFADAD",
3234
3234
  orange: "#FFDEB4",
3235
3235
  yellow: "#FDF7C3"
3236
- }, ru = [
3236
+ }, su = [
3237
3237
  U.green,
3238
3238
  U.purple,
3239
3239
  U.red,
@@ -3334,7 +3334,7 @@ const eu = ["grey", "red", "orange", "yellow", "green", "cyan", "blue", "purple"
3334
3334
  pink200: "#FED0F3",
3335
3335
  pink100: "#FFE8F9",
3336
3336
  pink50: "#FFF4FC"
3337
- }, su = [
3337
+ }, ou = [
3338
3338
  on.grey200,
3339
3339
  U.green,
3340
3340
  U.red,
@@ -3378,7 +3378,7 @@ const eu = ["grey", "red", "orange", "yellow", "green", "cyan", "blue", "purple"
3378
3378
  B.yellow,
3379
3379
  B.green,
3380
3380
  B.blue
3381
- ], ou = [
3381
+ ], au = [
3382
3382
  B.cyan,
3383
3383
  B.green,
3384
3384
  B.red,
@@ -3388,36 +3388,36 @@ const eu = ["grey", "red", "orange", "yellow", "green", "cyan", "blue", "purple"
3388
3388
  positive: "#84FC89",
3389
3389
  negative: "#FC8497",
3390
3390
  total: "#84D1FC"
3391
- }, au = [
3391
+ }, iu = [
3392
3392
  it.start,
3393
3393
  it.positive,
3394
3394
  it.negative,
3395
3395
  it.total
3396
3396
  ];
3397
- function iu(e, t = "light", n) {
3397
+ function cu(e, t = "light", n) {
3398
3398
  return ((n !== void 0 ? Br[t][n] : void 0) ?? Br[t].default).map((s) => on[`${e}${s}`]);
3399
3399
  }
3400
- function cu(e) {
3400
+ function lu(e) {
3401
3401
  const t = at.indexOf(B[e]);
3402
3402
  return t <= 0 ? at : [...at.slice(t), ...at.slice(0, t)];
3403
3403
  }
3404
- function lu(e, t) {
3404
+ function uu(e, t) {
3405
3405
  switch (e.type) {
3406
3406
  case "default":
3407
3407
  return oo;
3408
3408
  case "graphy":
3409
- return e.variant === "waterfall" ? au : nu;
3409
+ return e.variant === "waterfall" ? iu : ru;
3410
3410
  case "pastel":
3411
- return e.variant === "waterfall" ? su : ru;
3411
+ return e.variant === "waterfall" ? ou : su;
3412
3412
  case "neon":
3413
- return e.variant === "waterfall" ? ou : cu(e.base);
3413
+ return e.variant === "waterfall" ? au : lu(e.base);
3414
3414
  case "mono":
3415
- return iu(e.base, e.variant ?? "light", t);
3415
+ return cu(e.base, e.variant ?? "light", t);
3416
3416
  case "custom":
3417
3417
  return e.colors;
3418
3418
  }
3419
3419
  }
3420
- function uu(e, t) {
3420
+ function du(e, t) {
3421
3421
  if (!t) return e;
3422
3422
  const n = [...e];
3423
3423
  for (const [r, s] of Object.entries(t)) {
@@ -3428,7 +3428,7 @@ function uu(e, t) {
3428
3428
  }
3429
3429
  return n;
3430
3430
  }
3431
- function du(e, t, n) {
3431
+ function pu(e, t, n) {
3432
3432
  if (!e) return;
3433
3433
  const r = t?.type === "custom" ? n[t.id] : void 0, s = {};
3434
3434
  for (const [o, a] of Object.entries(e)) {
@@ -3448,9 +3448,9 @@ function du(e, t, n) {
3448
3448
  }
3449
3449
  return Object.keys(s).length > 0 ? s : void 0;
3450
3450
  }
3451
- function pu(e, t) {
3451
+ function mu(e, t) {
3452
3452
  if (!e)
3453
- return Ql.palette;
3453
+ return Zl.palette;
3454
3454
  if (e.type === "custom") {
3455
3455
  const n = t[e.id];
3456
3456
  if (!n)
@@ -3460,14 +3460,14 @@ function pu(e, t) {
3460
3460
  }
3461
3461
  return e;
3462
3462
  }
3463
- class mu extends Qe {
3463
+ class fu extends Qe {
3464
3464
  constructor() {
3465
3465
  super(...arguments), this.compatibleDataTypes = ["categorical", "temporal"];
3466
3466
  }
3467
3467
  compile(t, n) {
3468
3468
  if (t.scaleType !== "palette")
3469
3469
  throw new Error("PaletteScale.compile received non-palette spec");
3470
- const r = this.computeDomain(n), s = lu(t.palette, r.length), o = s.length > 0 ? s : [...oo], a = uu(o, t.overrides), i = gs().domain(r.map(String)).range(a).unknown(a[0]);
3470
+ const r = this.computeDomain(n), s = uu(t.palette, r.length), o = s.length > 0 ? s : [...oo], a = du(o, t.overrides), i = gs().domain(r.map(String)).range(a).unknown(a[0]);
3471
3471
  return this.createVisualScale(t, {
3472
3472
  map: (c) => i(String(c)),
3473
3473
  domain: r,
@@ -3481,19 +3481,19 @@ class mu extends Qe {
3481
3481
  return r;
3482
3482
  }
3483
3483
  }
3484
- class fu extends Ce {
3484
+ class hu extends Ce {
3485
3485
  constructor() {
3486
- super("scale"), this.register("continuous", new Kl()), this.register("discrete", new Zl()), this.register("datetime", new jl()), this.register("identity", new Jl()), this.register("palette", new mu());
3486
+ super("scale"), this.register("continuous", new Xl()), this.register("discrete", new Jl()), this.register("datetime", new ql()), this.register("identity", new eu()), this.register("palette", new fu());
3487
3487
  }
3488
3488
  }
3489
- const hu = (e) => !("layers" in e), F = {
3490
- point: yu,
3491
- line: gu,
3492
- area: bu,
3493
- bar: vu,
3494
- rule: xu
3489
+ const yu = (e) => !("layers" in e), F = {
3490
+ point: gu,
3491
+ line: bu,
3492
+ area: vu,
3493
+ bar: xu,
3494
+ rule: Su
3495
3495
  };
3496
- function yu(e = {}) {
3496
+ function gu(e = {}) {
3497
3497
  return {
3498
3498
  type: "layer",
3499
3499
  geom: "point",
@@ -3507,7 +3507,7 @@ function yu(e = {}) {
3507
3507
  dataLabels: e.dataLabels
3508
3508
  };
3509
3509
  }
3510
- function gu(e = {}) {
3510
+ function bu(e = {}) {
3511
3511
  return {
3512
3512
  type: "layer",
3513
3513
  geom: "line",
@@ -3521,7 +3521,7 @@ function gu(e = {}) {
3521
3521
  dataLabels: e.dataLabels
3522
3522
  };
3523
3523
  }
3524
- function bu(e = {}) {
3524
+ function vu(e = {}) {
3525
3525
  return {
3526
3526
  type: "layer",
3527
3527
  geom: "area",
@@ -3535,7 +3535,7 @@ function bu(e = {}) {
3535
3535
  dataLabels: e.dataLabels
3536
3536
  };
3537
3537
  }
3538
- function vu(e = {}) {
3538
+ function xu(e = {}) {
3539
3539
  return {
3540
3540
  type: "layer",
3541
3541
  geom: "bar",
@@ -3549,7 +3549,7 @@ function vu(e = {}) {
3549
3549
  dataLabels: e.dataLabels
3550
3550
  };
3551
3551
  }
3552
- function xu(e = {}) {
3552
+ function Su(e = {}) {
3553
3553
  return {
3554
3554
  type: "layer",
3555
3555
  geom: "rule",
@@ -3564,12 +3564,12 @@ function xu(e = {}) {
3564
3564
  };
3565
3565
  }
3566
3566
  const ao = {
3567
- identity: wu,
3568
- count: Au,
3569
- smooth: Su,
3570
- mean: Tu
3567
+ identity: Au,
3568
+ count: Tu,
3569
+ smooth: wu,
3570
+ mean: Mu
3571
3571
  };
3572
- function Su(e) {
3572
+ function wu(e) {
3573
3573
  return {
3574
3574
  type: "smooth",
3575
3575
  method: e.method,
@@ -3577,45 +3577,45 @@ function Su(e) {
3577
3577
  bandwidth: e.bandwidth
3578
3578
  };
3579
3579
  }
3580
- function wu() {
3580
+ function Au() {
3581
3581
  return { type: "identity" };
3582
3582
  }
3583
- function Au() {
3583
+ function Tu() {
3584
3584
  return { type: "count" };
3585
3585
  }
3586
- function Tu() {
3586
+ function Mu() {
3587
3587
  return { type: "mean" };
3588
3588
  }
3589
- const Me = { reshape: Mu, filter: Lu, sort: Vu, aggregate: Eu, constant: ku };
3590
- function Mu(e = {}) {
3589
+ const Me = { reshape: Lu, filter: Vu, sort: Eu, aggregate: ku, constant: Iu };
3590
+ function Lu(e = {}) {
3591
3591
  return {
3592
3592
  type: "transform",
3593
3593
  transformType: "reshape",
3594
3594
  options: e
3595
3595
  };
3596
3596
  }
3597
- function Lu(e) {
3597
+ function Vu(e) {
3598
3598
  return {
3599
3599
  type: "transform",
3600
3600
  transformType: "filter",
3601
3601
  options: e
3602
3602
  };
3603
3603
  }
3604
- function Vu(e) {
3604
+ function Eu(e) {
3605
3605
  return {
3606
3606
  type: "transform",
3607
3607
  transformType: "sort",
3608
3608
  options: e
3609
3609
  };
3610
3610
  }
3611
- function Eu(e) {
3611
+ function ku(e) {
3612
3612
  return {
3613
3613
  type: "transform",
3614
3614
  transformType: "aggregate",
3615
3615
  options: e
3616
3616
  };
3617
3617
  }
3618
- function ku(e) {
3618
+ function Iu(e) {
3619
3619
  return {
3620
3620
  type: "transform",
3621
3621
  transformType: "constant",
@@ -3630,36 +3630,36 @@ const zr = "#%_ENCODED_%#", io = (e) => {
3630
3630
  } catch {
3631
3631
  return e;
3632
3632
  }
3633
- }, Iu = ({ annotations: e, dataset: t, mapping: n }) => {
3633
+ }, Cu = ({ annotations: e, dataset: t, mapping: n }) => {
3634
3634
  const r = [], s = [], o = [], a = [], i = [], c = [], l = [], u = v(n.x);
3635
3635
  for (const d of e ?? [])
3636
3636
  switch (d.type) {
3637
3637
  case "difference-arrow": {
3638
- const p = Cu(d, u, t);
3638
+ const p = Du(d, u, t);
3639
3639
  p !== null && r.push(p);
3640
3640
  break;
3641
3641
  }
3642
3642
  case "shape": {
3643
- s.push(Du(d));
3643
+ s.push(Fu(d));
3644
3644
  break;
3645
3645
  }
3646
3646
  case "arrow": {
3647
- o.push(Nu(d));
3647
+ o.push(Pu(d));
3648
3648
  break;
3649
3649
  }
3650
3650
  case "highlight":
3651
3651
  break;
3652
3652
  case "text": {
3653
- a.push(Fu(d));
3653
+ a.push(_u(d));
3654
3654
  break;
3655
3655
  }
3656
3656
  case "sticker": {
3657
- const p = _u(d, u, t);
3657
+ const p = Ru(d, u, t);
3658
3658
  p !== null && i.push(p);
3659
3659
  break;
3660
3660
  }
3661
3661
  case "tooltip": {
3662
- const p = Ru(d, u, t);
3662
+ const p = Nu(d, u, t);
3663
3663
  if (p === null) break;
3664
3664
  p.kind === "pinnedNumber" ? c.push(p.value) : l.push(p.value);
3665
3665
  break;
@@ -3670,7 +3670,7 @@ const zr = "#%_ENCODED_%#", io = (e) => {
3670
3670
  }
3671
3671
  }
3672
3672
  return { differenceArrows: r, shapes: s, freeformArrows: o, textAnnotations: a, stickers: i, pinnedNumbers: c, comments: l };
3673
- }, Cu = (e, t, n) => {
3673
+ }, Du = (e, t, n) => {
3674
3674
  const r = wt({ dataset: n, input: e.start, anchorVariable: t }), s = wt({ dataset: n, input: e.end, anchorVariable: t });
3675
3675
  return r === null || s === null ? null : {
3676
3676
  id: e.id,
@@ -3681,7 +3681,7 @@ const zr = "#%_ENCODED_%#", io = (e) => {
3681
3681
  size: e.size,
3682
3682
  labelCrossPosition: e.labelPosition
3683
3683
  };
3684
- }, Du = (e) => ({
3684
+ }, Fu = (e) => ({
3685
3685
  id: e.id,
3686
3686
  kind: e.shape,
3687
3687
  zOrder: e.layer === "abovePlot" ? "foreground" : "background",
@@ -3693,7 +3693,7 @@ const zr = "#%_ENCODED_%#", io = (e) => {
3693
3693
  fillOpacity: e.fillOpacity,
3694
3694
  strokeWidth: e.strokeWidth,
3695
3695
  strokeColor: e.fillColor
3696
- }), Fu = (e) => ({
3696
+ }), _u = (e) => ({
3697
3697
  id: e.id,
3698
3698
  content: e.content,
3699
3699
  x: e.x,
@@ -3701,13 +3701,13 @@ const zr = "#%_ENCODED_%#", io = (e) => {
3701
3701
  width: e.width,
3702
3702
  backgroundColor: e.backgroundColor ?? null,
3703
3703
  backgroundColorStyle: e.backgroundColorStyle
3704
- }), _u = (e, t, n) => {
3704
+ }), Ru = (e, t, n) => {
3705
3705
  const r = wt({ dataset: n, input: e, anchorVariable: t });
3706
3706
  return r === null ? null : { id: e.id, anchor: r, sticker: e.sticker };
3707
- }, Ru = (e, t, n) => {
3707
+ }, Nu = (e, t, n) => {
3708
3708
  const r = wt({ dataset: n, input: e, anchorVariable: t });
3709
3709
  return r === null ? null : e.caption === null || e.caption === void 0 ? { kind: "pinnedNumber", value: { id: e.id, anchor: r } } : { kind: "comment", value: { id: e.id, anchor: r, content: e.caption } };
3710
- }, Nu = (e) => ({
3710
+ }, Pu = (e) => ({
3711
3711
  id: e.id,
3712
3712
  start: { x: e.startX, y: e.startY },
3713
3713
  end: { x: e.endX, y: e.endY },
@@ -3723,9 +3723,9 @@ const zr = "#%_ENCODED_%#", io = (e) => {
3723
3723
  anchorVariable: n
3724
3724
  }) => {
3725
3725
  if (!h(t) || !h(t.columnKey)) return null;
3726
- const r = Pu(t, n, e);
3726
+ const r = Ou(t, n, e);
3727
3727
  return r === null ? null : { anchorValue: r, groupValue: io(t.columnKey) };
3728
- }, Pu = (e, t, n) => e.rowValue !== void 0 ? e.rowValue : t === null || !h(e.rowIndex) || !n.hasVariable(t) ? null : n.getValues(t)[e.rowIndex] ?? null, Ou = [
3728
+ }, Ou = (e, t, n) => e.rowValue !== void 0 ? e.rowValue : t === null || !h(e.rowIndex) || !n.hasVariable(t) ? null : n.getValues(t)[e.rowIndex] ?? null, $u = [
3729
3729
  "lilac",
3730
3730
  "neon_pink",
3731
3731
  "blackberry",
@@ -3739,47 +3739,47 @@ const zr = "#%_ENCODED_%#", io = (e) => {
3739
3739
  "cool",
3740
3740
  "fresh"
3741
3741
  ];
3742
- function $u(e) {
3742
+ function Bu(e) {
3743
3743
  return {
3744
3744
  type: "config",
3745
3745
  config: e
3746
3746
  };
3747
3747
  }
3748
- const Bu = "#E5E5E5", zu = { x: "top", y: "left" }, Gu = /* @__PURE__ */ new Set(["pie", "donut"]);
3749
- function Wu(e) {
3750
- return $u({
3751
- legend: Xu(e.legend),
3752
- axes: qu(e.axes),
3753
- headline: Qu(e),
3754
- numberFormat: Zu(e.appearance),
3755
- content: Ju(e.content),
3756
- appearance: Yu(e.appearance, e.themeOverrides)
3748
+ const zu = "#E5E5E5", Gu = { x: "top", y: "left" }, Wu = /* @__PURE__ */ new Set(["pie", "donut"]);
3749
+ function Yu(e) {
3750
+ return Bu({
3751
+ legend: ju(e.legend),
3752
+ axes: Qu(e.axes),
3753
+ headline: Zu(e),
3754
+ numberFormat: Ju(e.appearance),
3755
+ content: ed(e.content),
3756
+ appearance: Hu(e.appearance, e.themeOverrides)
3757
3757
  }).config;
3758
3758
  }
3759
- function Yu(e, t) {
3760
- const n = Ku(e?.border), r = e?.hasRoundedCorners === !1 ? 0 : void 0, s = Hu(e, t), o = {};
3759
+ function Hu(e, t) {
3760
+ const n = Xu(e?.border), r = e?.hasRoundedCorners === !1 ? 0 : void 0, s = Uu(e, t), o = {};
3761
3761
  return e?.textScale !== void 0 && (o.textScale = e.textScale), n !== void 0 && (o.border = n), r !== void 0 && (o.cornerRadius = r), s !== void 0 && (o.background = s), e?.highlightStyle !== void 0 && (o.highlightStyle = e.highlightStyle === "grey" ? "desaturate" : "dim"), Object.keys(o).length > 0 ? o : void 0;
3762
3762
  }
3763
- function Hu(e, t) {
3763
+ function Uu(e, t) {
3764
3764
  if (e?.backgroundModifier === "tint")
3765
3765
  return { type: "tinted" };
3766
3766
  const n = t?.graphBackground;
3767
3767
  if (typeof n == "string")
3768
3768
  return { type: "solid", color: n };
3769
3769
  }
3770
- const Uu = (e) => Ou.includes(e);
3771
- function Ku(e) {
3770
+ const Ku = (e) => $u.includes(e);
3771
+ function Xu(e) {
3772
3772
  if (!e?.style) return;
3773
3773
  if (e.style === "none") return { type: "none" };
3774
3774
  const t = e.width ?? 0;
3775
3775
  if (e.style === "grey")
3776
- return { type: "solid", color: Bu, width: t };
3776
+ return { type: "solid", color: zu, width: t };
3777
3777
  if (e.style === "preset")
3778
- return e.color === void 0 || !Uu(e.color) ? void 0 : { type: "preset", preset: e.color, width: t };
3778
+ return e.color === void 0 || !Ku(e.color) ? void 0 : { type: "preset", preset: e.color, width: t };
3779
3779
  if (e.color !== void 0)
3780
3780
  return e.style === "custom" ? { type: "solid", color: e.color, width: t } : { type: e.style, color: e.color, width: t };
3781
3781
  }
3782
- function Xu(e) {
3782
+ function ju(e) {
3783
3783
  if (e)
3784
3784
  return {
3785
3785
  position: e.position
@@ -3789,45 +3789,45 @@ function Gr(e, t, n) {
3789
3789
  return !t && n === void 0 ? {} : {
3790
3790
  ...t?.isHidden !== void 0 ? { isVisible: !t.isHidden } : void 0,
3791
3791
  ...t?.label !== void 0 ? { label: t.label } : void 0,
3792
- ...t?.isReversed ? { position: zu[e] } : void 0,
3792
+ ...t?.isReversed ? { position: Gu[e] } : void 0,
3793
3793
  ...t?.tickDisplayMode ? { labels: { mode: t.tickDisplayMode } } : void 0,
3794
3794
  ...n !== void 0 ? { grid: { isVisible: n } } : void 0
3795
3795
  };
3796
3796
  }
3797
- function ju(e) {
3797
+ function qu(e) {
3798
3798
  return {
3799
3799
  ...e.label !== void 0 ? { label: e.label } : void 0
3800
3800
  };
3801
3801
  }
3802
- function qu(e) {
3802
+ function Qu(e) {
3803
3803
  if (e)
3804
3804
  return {
3805
3805
  x: Gr("x", e.x, e.showGridLines),
3806
3806
  y: Gr("y", e.y, e.showGridLines),
3807
- ...e.y2 ? { ySecondary: ju(e.y2) } : void 0
3807
+ ...e.y2 ? { ySecondary: qu(e.y2) } : void 0
3808
3808
  };
3809
3809
  }
3810
- function Qu(e) {
3811
- const { headlineNumbers: t, options: n, type: r } = e, s = r !== void 0 && Gu.has(r) ? n?.pieTotalPosition : void 0;
3810
+ function Zu(e) {
3811
+ const { headlineNumbers: t, options: n, type: r } = e, s = r !== void 0 && Wu.has(r) ? n?.pieTotalPosition : void 0;
3812
3812
  if (t === void 0 && s === void 0) return;
3813
3813
  const o = {};
3814
3814
  return t?.show !== void 0 && (o.show = t.show), t?.compareWith !== void 0 && (o.compareWith = t.compareWith), t?.size !== void 0 && (o.size = t.size), s !== void 0 && (o.show = "total", o.position = s === "center" ? "center" : "above"), o;
3815
3815
  }
3816
- function Zu(e) {
3816
+ function Ju(e) {
3817
3817
  if (e?.numberFormat)
3818
3818
  return {
3819
3819
  decimals: e.numberFormat.decimalPlaces,
3820
3820
  abbreviation: e.numberFormat.abbreviation
3821
3821
  };
3822
3822
  }
3823
- function Ju(e) {
3823
+ function ed(e) {
3824
3824
  if (!e) return;
3825
3825
  const t = {};
3826
3826
  e.title !== void 0 && (t.title = e.title), e.isTitleHidden !== void 0 && (t.isTitleVisible = !e.isTitleHidden), e.subtitle !== void 0 && (t.subtitle = e.subtitle), e.isSubtitleHidden !== void 0 && (t.isSubtitleVisible = !e.isSubtitleHidden), e.caption !== void 0 && (t.caption = e.caption), e.isCaptionHidden !== void 0 && (t.isCaptionVisible = !e.isCaptionHidden);
3827
- const n = ed(e.source);
3827
+ const n = td(e.source);
3828
3828
  return n !== void 0 && (t.source = n), e.isSourceHidden !== void 0 && (t.isSourceVisible = !e.isSourceHidden), t;
3829
3829
  }
3830
- function ed(e) {
3830
+ function td(e) {
3831
3831
  if (!e) return;
3832
3832
  const t = {};
3833
3833
  return e.label !== void 0 && (t.label = e.label), e.url !== void 0 && (t.url = e.url), Object.keys(t).length === 0 ? void 0 : t;
@@ -3867,7 +3867,7 @@ const z = {
3867
3867
  coordType: "polar",
3868
3868
  params: e
3869
3869
  })
3870
- }, td = {
3870
+ }, nd = {
3871
3871
  showDataLabels: !1,
3872
3872
  format: "absolute",
3873
3873
  showStackTotals: !1,
@@ -3907,8 +3907,8 @@ const z = {
3907
3907
  labelPosition: "start"
3908
3908
  }
3909
3909
  }, Ze = "primary";
3910
- function nd(e, t) {
3911
- const n = { ...td };
3910
+ function rd(e, t) {
3911
+ const n = { ...nd };
3912
3912
  return e === "bar" && t === "polar" && (n.format = "percentage"), n;
3913
3913
  }
3914
3914
  function D(e, t = {}) {
@@ -4019,7 +4019,7 @@ const Le = {
4019
4019
  discrete: (e) => q("lineType", e),
4020
4020
  identity: (e) => Oe("lineType", e)
4021
4021
  }
4022
- }, Y = "key", re = "value", Wr = A("lineSeriesLabel"), Yr = A("barSeriesLabel"), At = A("constantY"), rd = (e, t, n, r) => ud[t](e, n, r), Vn = (e) => {
4022
+ }, Y = "key", re = "value", Wr = A("lineSeriesLabel"), Yr = A("barSeriesLabel"), At = A("constantY"), sd = (e, t, n, r) => dd[t](e, n, r), Vn = (e) => {
4023
4023
  const { numeric: t, categorical: n, temporal: r } = e.groupVariableNamesByType();
4024
4024
  return h(r[0]) ? r[0] : h(n[0]) ? n[0] : h(t[0]) ? t[0] : "";
4025
4025
  }, En = (e) => {
@@ -4053,7 +4053,7 @@ const Le = {
4053
4053
  mapping: { lineType: Y },
4054
4054
  scales: [Le.lineType.discrete({ domain: e.seriesVariables, range: r })]
4055
4055
  };
4056
- }, sd = (e) => {
4056
+ }, od = (e) => {
4057
4057
  const { categorical: t, temporal: n, numeric: r } = e.groupVariableNamesByType(), s = r[0];
4058
4058
  if (!h(s))
4059
4059
  throw new Error("No first numeric variable found");
@@ -4072,7 +4072,7 @@ const Le = {
4072
4072
  }),
4073
4073
  mapping: { x: s, y: re, label: t[0], color: Y }
4074
4074
  };
4075
- }, od = (e) => {
4075
+ }, ad = (e) => {
4076
4076
  const { categorical: t, temporal: n, numeric: r } = e.groupVariableNamesByType();
4077
4077
  let s, o;
4078
4078
  if (h(t[0]) && h(r[0]))
@@ -4107,7 +4107,7 @@ const Le = {
4107
4107
  scales: a.scales,
4108
4108
  seriesVariables: o
4109
4109
  };
4110
- }, ad = (e, t, n) => {
4110
+ }, id = (e, t, n) => {
4111
4111
  const { dataset: r, mapping: s, seriesVariables: o } = En(e.dataset), a = kn({ appearance: n, seriesVariables: o }), i = [
4112
4112
  F.area({
4113
4113
  position: "stack",
@@ -4155,11 +4155,11 @@ const Le = {
4155
4155
  dataset: e.dataset,
4156
4156
  layers: [F.bar({ position: "fill" })],
4157
4157
  coords: z.polar({ theta: "y", innerRadius: t === "donut" ? 0.55 : 0 }),
4158
- mapping: od(e.dataset),
4158
+ mapping: ad(e.dataset),
4159
4159
  scales: [],
4160
4160
  seriesVariables: []
4161
- }), id = (e) => {
4162
- const { dataset: t, mapping: n } = sd(e.dataset);
4161
+ }), cd = (e) => {
4162
+ const { dataset: t, mapping: n } = od(e.dataset);
4163
4163
  return {
4164
4164
  dataset: t,
4165
4165
  layers: [F.point()],
@@ -4168,7 +4168,7 @@ const Le = {
4168
4168
  scales: [],
4169
4169
  seriesVariables: []
4170
4170
  };
4171
- }, cd = (e) => {
4171
+ }, ld = (e) => {
4172
4172
  const { numeric: t, categorical: n } = e.dataset.groupVariableNamesByType(), r = t[0];
4173
4173
  if (!h(r))
4174
4174
  throw new Error("No first numeric variable found");
@@ -4192,7 +4192,7 @@ const Le = {
4192
4192
  },
4193
4193
  ...t ? { yScaleType: "secondary" } : void 0
4194
4194
  });
4195
- }, ld = (e, t, n) => {
4195
+ }, ud = (e, t, n) => {
4196
4196
  const { numeric: r, categorical: s, temporal: o } = e.dataset.groupVariableNamesByType(), a = Vn(e.dataset), i = [...s, ...o], c = r.filter((b) => b !== a), l = t?.comboType ?? "grouped-bars", u = l === "lines";
4197
4197
  if (c.length === 1)
4198
4198
  return u ? lo(e, t, n) : de(e, "dodge", z.cartesian(), t, n);
@@ -4266,9 +4266,9 @@ const Le = {
4266
4266
  };
4267
4267
  }, uo = (e = "auto") => e === "auto" ? yt.params.size : e, _e = (e) => () => {
4268
4268
  throw new Error(`Unsupported graph type: ${e}`);
4269
- }, ud = {
4269
+ }, dd = {
4270
4270
  line: (e, t, n) => lo(e, t, n),
4271
- areaStacked: (e, t, n) => ad(e, t, n),
4271
+ areaStacked: (e, t, n) => id(e, t, n),
4272
4272
  bar: (e, t, n) => de(e, "dodge", z.flip(), t, n),
4273
4273
  barStacked: (e, t, n) => de(e, "stack", z.flip(), t, n),
4274
4274
  barStackedFill: (e, t, n) => de(e, "fill", z.flip(), t, n),
@@ -4277,9 +4277,9 @@ const Le = {
4277
4277
  columnStackedFill: (e, t, n) => de(e, "fill", z.cartesian(), t, n),
4278
4278
  pie: (e) => Hr(e, "pie"),
4279
4279
  donut: (e) => Hr(e, "donut"),
4280
- scatter: (e) => id(e),
4281
- bubble: (e) => cd(e),
4282
- combo: (e, t, n) => ld(e, t, n),
4280
+ scatter: (e) => cd(e),
4281
+ bubble: (e) => ld(e),
4282
+ combo: (e, t, n) => ud(e, t, n),
4283
4283
  funnel: _e("funnel"),
4284
4284
  heatmap: _e("heatmap"),
4285
4285
  waterfall: _e("waterfall"),
@@ -4290,11 +4290,11 @@ const Le = {
4290
4290
  A("lineSeriesLabel"),
4291
4291
  A("barSeriesLabel")
4292
4292
  ];
4293
- function dd(e) {
4294
- const t = e.annotations ?? [], n = pd(e.mapping), r = hd(e.convertedDataset, e.layers), s = [];
4293
+ function pd(e) {
4294
+ const t = e.annotations ?? [], n = md(e.mapping), r = yd(e.convertedDataset, e.layers), s = [];
4295
4295
  for (const o of t) {
4296
4296
  if (o.type !== "highlight") continue;
4297
- const a = md({
4297
+ const a = fd({
4298
4298
  annotation: o,
4299
4299
  rowIdentityVariable: n,
4300
4300
  dataset: e.dataset,
@@ -4304,11 +4304,11 @@ function dd(e) {
4304
4304
  }
4305
4305
  return s;
4306
4306
  }
4307
- function pd(e) {
4307
+ function md(e) {
4308
4308
  const t = v(e.x);
4309
4309
  return t !== null && t !== "" ? t : v(e.color);
4310
4310
  }
4311
- function md({
4311
+ function fd({
4312
4312
  annotation: e,
4313
4313
  rowIdentityVariable: t,
4314
4314
  dataset: n,
@@ -4327,28 +4327,28 @@ function md({
4327
4327
  }
4328
4328
  function Ur(e, t, n) {
4329
4329
  if (t === null) return null;
4330
- const r = yd(e, t, n);
4330
+ const r = gd(e, t, n);
4331
4331
  return r === null ? null : { variable: t, eq: r };
4332
4332
  }
4333
4333
  function Kr(e, t) {
4334
- if (!fd(t)) return null;
4334
+ if (!hd(t)) return null;
4335
4335
  const n = e.columnKey;
4336
4336
  return h(n) ? { or: po.map((r) => ({ variable: r, eq: n })) } : null;
4337
4337
  }
4338
- function fd(e) {
4338
+ function hd(e) {
4339
4339
  return po.some((t) => e.includes(t));
4340
4340
  }
4341
- function hd(e, t) {
4341
+ function yd(e, t) {
4342
4342
  const n = [...e.getVariableNames()];
4343
4343
  for (const r of t)
4344
4344
  for (const s of r.transforms ?? [])
4345
4345
  s.transformType === "reshape" ? n.push(s.options.keyName ?? Y) : s.transformType === "constant" && n.push(s.options.variableName);
4346
4346
  return n;
4347
4347
  }
4348
- function yd(e, t, n) {
4348
+ function gd(e, t, n) {
4349
4349
  return e.rowValue !== void 0 ? e.rowValue : !h(e.rowIndex) || !n.getVariableNames().includes(t) ? null : n.getValues(t)[e.rowIndex] ?? null;
4350
4350
  }
4351
- function gd(e, t, n) {
4351
+ function bd(e, t, n) {
4352
4352
  const { theme: r, customPalettes: s } = n;
4353
4353
  if (s && e && s[e])
4354
4354
  return {
@@ -4362,12 +4362,12 @@ function gd(e, t, n) {
4362
4362
  const i = "preset:mono:";
4363
4363
  if (e?.startsWith(i)) {
4364
4364
  const l = e.slice(i.length);
4365
- if (bd(l)) return { type: "mono", base: l, variant: r };
4365
+ if (vd(l)) return { type: "mono", base: l, variant: r };
4366
4366
  }
4367
4367
  const c = "preset:neon:";
4368
4368
  if (e?.startsWith(c)) {
4369
4369
  const l = e.slice(c.length);
4370
- if (vd(l)) return { type: "neon", base: l, variant: Yt(t) };
4370
+ if (xd(l)) return { type: "neon", base: l, variant: Yt(t) };
4371
4371
  }
4372
4372
  return {
4373
4373
  type: "default"
@@ -4377,13 +4377,13 @@ function Yt(e) {
4377
4377
  if (e === "waterfall")
4378
4378
  return "waterfall";
4379
4379
  }
4380
- function bd(e) {
4381
- return eu.includes(e);
4382
- }
4383
4380
  function vd(e) {
4384
4381
  return tu.includes(e);
4385
4382
  }
4386
4383
  function xd(e) {
4384
+ return nu.includes(e);
4385
+ }
4386
+ function Sd(e) {
4387
4387
  if (!e) return;
4388
4388
  const t = {};
4389
4389
  for (const [n, r] of Object.entries(e)) {
@@ -4398,10 +4398,10 @@ function xd(e) {
4398
4398
  }
4399
4399
  return Object.keys(t).length > 0 ? t : void 0;
4400
4400
  }
4401
- function Sd(e, t, n, r = {}) {
4401
+ function wd(e, t, n, r = {}) {
4402
4402
  const s = [];
4403
4403
  s.push(Xr("x", t?.x)), s.push(Xr("y", t?.y));
4404
- const o = gd(n?.paletteId, e, r), a = xd(n?.seriesStyles);
4404
+ const o = bd(n?.paletteId, e, r), a = Sd(n?.seriesStyles);
4405
4405
  return s.push(Le.color.palette({ palette: o, overrides: a })), s;
4406
4406
  }
4407
4407
  function Xr(e, t) {
@@ -4413,7 +4413,7 @@ function Xr(e, t) {
4413
4413
  domainMax: t.max ?? void 0
4414
4414
  }) : Le[e]();
4415
4415
  }
4416
- const wd = /* @__PURE__ */ new Set([
4416
+ const Ad = /* @__PURE__ */ new Set([
4417
4417
  "column",
4418
4418
  "columnStacked",
4419
4419
  "columnStackedFill",
@@ -4426,7 +4426,7 @@ const wd = /* @__PURE__ */ new Set([
4426
4426
  "bubble",
4427
4427
  "funnel",
4428
4428
  "combo"
4429
- ]), Ad = /* @__PURE__ */ new Set([
4429
+ ]), Td = /* @__PURE__ */ new Set([
4430
4430
  "column",
4431
4431
  "columnStacked",
4432
4432
  "columnStackedFill",
@@ -4437,37 +4437,37 @@ const wd = /* @__PURE__ */ new Set([
4437
4437
  "areaStacked",
4438
4438
  "combo"
4439
4439
  ]);
4440
- function Td(e, t, n) {
4441
- const r = t.type ?? "column", s = { dataset: e, axes: t.axes }, o = rd(s, r, t.options ?? void 0, t.appearance ?? void 0);
4440
+ function Md(e, t, n) {
4441
+ const r = t.type ?? "column", s = { dataset: e, axes: t.axes }, o = sd(s, r, t.options ?? void 0, t.appearance ?? void 0);
4442
4442
  return {
4443
4443
  data: o.dataset,
4444
4444
  mapping: o.mapping,
4445
- layers: Md(r, t, o.layers, o.coords, o.mapping, o.seriesVariables),
4446
- scales: [...Sd(r, t.axes, t.appearance, n), ...o.scales],
4445
+ layers: Ld(r, t, o.layers, o.coords, o.mapping, o.seriesVariables),
4446
+ scales: [...wd(r, t.axes, t.appearance, n), ...o.scales],
4447
4447
  transforms: o.transforms ?? [],
4448
- highlights: dd({
4448
+ highlights: pd({
4449
4449
  annotations: t.annotations,
4450
4450
  dataset: e,
4451
4451
  mapping: o.mapping,
4452
4452
  convertedDataset: o.dataset,
4453
4453
  layers: o.layers
4454
4454
  }),
4455
- annotations: Iu({
4455
+ annotations: Cu({
4456
4456
  annotations: t.annotations,
4457
4457
  dataset: e,
4458
4458
  mapping: o.mapping
4459
4459
  }),
4460
4460
  coords: o.coords,
4461
- config: Wu(t)
4461
+ config: Yu(t)
4462
4462
  };
4463
4463
  }
4464
- function Md(e, t, n, r, s, o) {
4465
- const a = Id(t.dataLabels), i = a === void 0 ? n : n.filter((l) => l.interactive !== !1).map((l) => ({ ...l, dataLabels: { ...a, ...l.dataLabels } })), c = t.axes?.hasDualYAxis ?? !1;
4464
+ function Ld(e, t, n, r, s, o) {
4465
+ const a = Cd(t.dataLabels), i = a === void 0 ? n : n.filter((l) => l.interactive !== !1).map((l) => ({ ...l, dataLabels: { ...a, ...l.dataLabels } })), c = t.axes?.hasDualYAxis ?? !1;
4466
4466
  return [
4467
4467
  ...i,
4468
- ...Ld({ type: e, trendline: t.referenceLines?.trendline, coords: r }),
4469
- ...Vd({ type: e, hasDualYAxis: c, goalLine: t.referenceLines?.goalLine, coords: r }),
4470
- ...kd({
4468
+ ...Vd({ type: e, trendline: t.referenceLines?.trendline, coords: r }),
4469
+ ...Ed({ type: e, hasDualYAxis: c, goalLine: t.referenceLines?.goalLine, coords: r }),
4470
+ ...Id({
4471
4471
  type: e,
4472
4472
  hasDualYAxis: c,
4473
4473
  averageLine: t.referenceLines?.averageLine,
@@ -4477,12 +4477,12 @@ function Md(e, t, n, r, s, o) {
4477
4477
  })
4478
4478
  ];
4479
4479
  }
4480
- function Ld({
4480
+ function Vd({
4481
4481
  type: e,
4482
4482
  trendline: t,
4483
4483
  coords: n
4484
4484
  }) {
4485
- return t === void 0 ? [] : wd.has(e) ? n.coordType === "polar" ? [] : [
4485
+ return t === void 0 ? [] : Ad.has(e) ? n.coordType === "polar" ? [] : [
4486
4486
  F.line({
4487
4487
  aes: { lineType: { value: "dashed" } },
4488
4488
  stat: ao.smooth({ method: t }),
@@ -4490,13 +4490,13 @@ function Ld({
4490
4490
  })
4491
4491
  ] : [];
4492
4492
  }
4493
- function Vd({
4493
+ function Ed({
4494
4494
  type: e,
4495
4495
  hasDualYAxis: t,
4496
4496
  goalLine: n,
4497
4497
  coords: r
4498
4498
  }) {
4499
- if (!Ed(n)) return [];
4499
+ if (!kd(n)) return [];
4500
4500
  if (r.coordType === "polar") return [];
4501
4501
  const s = r.coordType === "flip" ? "end" : "start";
4502
4502
  return [
@@ -4511,10 +4511,10 @@ function Vd({
4511
4511
  })
4512
4512
  ];
4513
4513
  }
4514
- function Ed(e) {
4514
+ function kd(e) {
4515
4515
  return e !== void 0 && Number.isFinite(e.target);
4516
4516
  }
4517
- function kd({
4517
+ function Id({
4518
4518
  type: e,
4519
4519
  hasDualYAxis: t,
4520
4520
  averageLine: n,
@@ -4523,7 +4523,7 @@ function kd({
4523
4523
  seriesVariables: o
4524
4524
  }) {
4525
4525
  if (n === void 0) return [];
4526
- if (!Ad.has(e)) return [];
4526
+ if (!Td.has(e)) return [];
4527
4527
  if (r.coordType === "polar") return [];
4528
4528
  const a = io(n.columnKey);
4529
4529
  if (!o.includes(a)) return [];
@@ -4542,7 +4542,7 @@ function kd({
4542
4542
  })
4543
4543
  ];
4544
4544
  }
4545
- function Id(e) {
4545
+ function Cd(e) {
4546
4546
  if (!e) return;
4547
4547
  const t = {};
4548
4548
  return e.showDataLabels !== void 0 && (t.showDataLabels = e.showDataLabels), e.dataLabelFormat !== void 0 && (t.format = e.dataLabelFormat), e.showStackTotals !== void 0 && (t.showStackTotals = e.showStackTotals), e.showCategoryLabels !== void 0 && (t.showCategoryLabels = e.showCategoryLabels), Object.keys(t).length === 0 ? void 0 : t;
@@ -4568,15 +4568,15 @@ const Ht = {
4568
4568
  endArrowheadStyle: "line-arrow",
4569
4569
  lineStyle: "solid",
4570
4570
  hasStickerStyle: !1
4571
- }, Cd = (e, t) => ({
4572
- differenceArrows: (e?.differenceArrows ?? []).map((n) => Fd(n, t)),
4573
- shapes: (e?.shapes ?? []).map(Pd),
4574
- freeformArrows: (e?.freeformArrows ?? []).map(Od),
4575
- textAnnotations: (e?.textAnnotations ?? []).map(Dd),
4576
- stickers: (e?.stickers ?? []).map((n) => _d(n, t)),
4577
- pinnedNumbers: (e?.pinnedNumbers ?? []).map((n) => Rd(n, t)),
4578
- comments: (e?.comments ?? []).map((n) => Nd(n, t))
4579
- }), Dd = (e) => ({
4571
+ }, Dd = (e, t) => ({
4572
+ differenceArrows: (e?.differenceArrows ?? []).map((n) => _d(n, t)),
4573
+ shapes: (e?.shapes ?? []).map(Od),
4574
+ freeformArrows: (e?.freeformArrows ?? []).map($d),
4575
+ textAnnotations: (e?.textAnnotations ?? []).map(Fd),
4576
+ stickers: (e?.stickers ?? []).map((n) => Rd(n, t)),
4577
+ pinnedNumbers: (e?.pinnedNumbers ?? []).map((n) => Nd(n, t)),
4578
+ comments: (e?.comments ?? []).map((n) => Pd(n, t))
4579
+ }), Fd = (e) => ({
4580
4580
  id: e.id ?? crypto.randomUUID(),
4581
4581
  content: e.content,
4582
4582
  x: e.x,
@@ -4584,7 +4584,7 @@ const Ht = {
4584
4584
  width: e.width,
4585
4585
  backgroundColor: e.backgroundColor ?? jr.backgroundColor,
4586
4586
  backgroundColorStyle: e.backgroundColorStyle ?? jr.backgroundColorStyle
4587
- }), Fd = (e, t) => ({
4587
+ }), _d = (e, t) => ({
4588
4588
  id: e.id ?? crypto.randomUUID(),
4589
4589
  start: Ye(e.start, t),
4590
4590
  end: Ye(e.end, t),
@@ -4601,18 +4601,18 @@ const Ht = {
4601
4601
  `Annotation references layerIndex ${e.layerIndex} but only ${t.length} layer(s) are defined.`
4602
4602
  );
4603
4603
  return { layerId: n, anchorValue: e.anchorValue, groupValue: e.groupValue };
4604
- }, _d = (e, t) => ({
4604
+ }, Rd = (e, t) => ({
4605
4605
  id: e.id ?? crypto.randomUUID(),
4606
4606
  anchor: Ye(e.anchor, t),
4607
4607
  sticker: e.sticker
4608
- }), Rd = (e, t) => ({
4608
+ }), Nd = (e, t) => ({
4609
4609
  id: e.id ?? crypto.randomUUID(),
4610
4610
  anchor: Ye(e.anchor, t)
4611
- }), Nd = (e, t) => ({
4611
+ }), Pd = (e, t) => ({
4612
4612
  id: e.id ?? crypto.randomUUID(),
4613
4613
  anchor: Ye(e.anchor, t),
4614
4614
  content: e.content
4615
- }), Pd = (e) => ({
4615
+ }), Od = (e) => ({
4616
4616
  id: e.id ?? crypto.randomUUID(),
4617
4617
  kind: e.kind ?? we.kind,
4618
4618
  zOrder: e.zOrder ?? we.zOrder,
@@ -4624,7 +4624,7 @@ const Ht = {
4624
4624
  fillOpacity: e.fillOpacity ?? we.fillOpacity,
4625
4625
  strokeWidth: e.strokeWidth ?? we.strokeWidth,
4626
4626
  strokeColor: e.strokeColor ?? we.strokeColor
4627
- }), Od = (e) => ({
4627
+ }), $d = (e) => ({
4628
4628
  id: e.id ?? crypto.randomUUID(),
4629
4629
  start: e.start,
4630
4630
  end: e.end,
@@ -4634,7 +4634,7 @@ const Ht = {
4634
4634
  endArrowheadStyle: e.endArrowheadStyle ?? Ae.endArrowheadStyle,
4635
4635
  lineStyle: e.lineStyle ?? Ae.lineStyle,
4636
4636
  hasStickerStyle: e.hasStickerStyle ?? Ae.hasStickerStyle
4637
- }), $d = {
4637
+ }), Bd = {
4638
4638
  parsingLocale: "en-US",
4639
4639
  legend: {
4640
4640
  position: "auto",
@@ -4687,10 +4687,10 @@ const Ht = {
4687
4687
  highlightStyle: "dim"
4688
4688
  }
4689
4689
  };
4690
- function Bd(e) {
4691
- return Ee({}, $d, e);
4690
+ function zd(e) {
4691
+ return Ee({}, Bd, e);
4692
4692
  }
4693
- const zd = {
4693
+ const Gd = {
4694
4694
  xLimits: null,
4695
4695
  yLimits: null
4696
4696
  }, Ut = {
@@ -4698,8 +4698,8 @@ const zd = {
4698
4698
  startAngle: 0,
4699
4699
  innerRadius: 0
4700
4700
  };
4701
- function Gd(e) {
4702
- const t = e ?? { type: "coord", coordType: "cartesian" }, n = bs({}, zd, t.params ?? {});
4701
+ function Wd(e) {
4702
+ const t = e ?? { type: "coord", coordType: "cartesian" }, n = bs({}, Gd, t.params ?? {});
4703
4703
  switch (t.coordType) {
4704
4704
  case "cartesian":
4705
4705
  case "flip":
@@ -4716,7 +4716,7 @@ function Gd(e) {
4716
4716
  };
4717
4717
  }
4718
4718
  }
4719
- function Wd(e, t) {
4719
+ function Yd(e, t) {
4720
4720
  return e.map((n) => {
4721
4721
  const r = n.layerIndex !== void 0 ? t[n.layerIndex]?.id : void 0;
4722
4722
  if (n.layerIndex !== void 0 && r === void 0)
@@ -4732,16 +4732,16 @@ function Wd(e, t) {
4732
4732
  };
4733
4733
  });
4734
4734
  }
4735
- const Yd = "linear", Hd = 3, Ud = 0.3;
4735
+ const Hd = "linear", Ud = 3, Kd = 0.3;
4736
4736
  function Je(e, t) {
4737
4737
  const n = e ?? t, r = typeof n == "string" ? n : n.type;
4738
4738
  if (r === "smooth") {
4739
4739
  const s = typeof n == "string" ? void 0 : n;
4740
4740
  return {
4741
4741
  type: "smooth",
4742
- method: s?.method ?? Yd,
4743
- order: s?.order ?? Hd,
4744
- bandwidth: s?.bandwidth ?? Ud
4742
+ method: s?.method ?? Hd,
4743
+ order: s?.order ?? Ud,
4744
+ bandwidth: s?.bandwidth ?? Kd
4745
4745
  };
4746
4746
  }
4747
4747
  return { type: r };
@@ -4749,30 +4749,30 @@ function Je(e, t) {
4749
4749
  function mo(e, t, n) {
4750
4750
  switch (n.geom) {
4751
4751
  case "point":
4752
- return jd(e, t, n);
4753
- case "line":
4754
4752
  return qd(e, t, n);
4755
- case "area":
4753
+ case "line":
4756
4754
  return Qd(e, t, n);
4757
- case "bar":
4755
+ case "area":
4758
4756
  return Zd(e, t, n);
4759
- case "rule":
4757
+ case "bar":
4760
4758
  return Jd(e, t, n);
4759
+ case "rule":
4760
+ return ep(e, t, n);
4761
4761
  }
4762
4762
  }
4763
- function Kd(e, t, n) {
4763
+ function Xd(e, t, n) {
4764
4764
  const r = n.map((s) => mo(e, t, s));
4765
- return ep(r);
4765
+ return tp(r);
4766
4766
  }
4767
- const Xd = (e, t, n) => n.label !== void 0 ? n.label : tp(e, t, n), et = (e, t, n, r) => {
4768
- const s = { ...e, ...t.mapping }, o = Xd(t.geom, n, s);
4767
+ const jd = (e, t, n) => n.label !== void 0 ? n.label : np(e, t, n), et = (e, t, n, r) => {
4768
+ const s = { ...e, ...t.mapping }, o = jd(t.geom, n, s);
4769
4769
  return {
4770
- ...nd(t.geom, r),
4770
+ ...rd(t.geom, r),
4771
4771
  ...t.dataLabels,
4772
4772
  labelSource: o
4773
4773
  };
4774
4774
  };
4775
- function jd(e, t, n) {
4775
+ function qd(e, t, n) {
4776
4776
  const r = n.position ?? yt.position;
4777
4777
  return {
4778
4778
  id: n.id ?? crypto.randomUUID(),
@@ -4788,7 +4788,7 @@ function jd(e, t, n) {
4788
4788
  dataLabels: et(e, n, r, t)
4789
4789
  };
4790
4790
  }
4791
- function qd(e, t, n) {
4791
+ function Qd(e, t, n) {
4792
4792
  const r = n.position ?? Bt.position;
4793
4793
  return {
4794
4794
  id: n.id ?? crypto.randomUUID(),
@@ -4804,7 +4804,7 @@ function qd(e, t, n) {
4804
4804
  dataLabels: et(e, n, r, t)
4805
4805
  };
4806
4806
  }
4807
- function Qd(e, t, n) {
4807
+ function Zd(e, t, n) {
4808
4808
  const r = Ee({}, zt.params, n.params);
4809
4809
  r.missingValues === "gap" && (r.missingValues = "zero");
4810
4810
  const s = n.position ?? zt.position;
@@ -4822,7 +4822,7 @@ function Qd(e, t, n) {
4822
4822
  dataLabels: et(e, n, s, t)
4823
4823
  };
4824
4824
  }
4825
- function Zd(e, t, n) {
4825
+ function Jd(e, t, n) {
4826
4826
  const r = n.position ?? Gt.position;
4827
4827
  return {
4828
4828
  id: n.id ?? crypto.randomUUID(),
@@ -4838,7 +4838,7 @@ function Zd(e, t, n) {
4838
4838
  dataLabels: et(e, n, r, t)
4839
4839
  };
4840
4840
  }
4841
- function Jd(e, t, n) {
4841
+ function ep(e, t, n) {
4842
4842
  const r = n.position ?? Fe.position;
4843
4843
  return {
4844
4844
  id: n.id ?? crypto.randomUUID(),
@@ -4854,7 +4854,7 @@ function Jd(e, t, n) {
4854
4854
  dataLabels: et(e, n, r, t)
4855
4855
  };
4856
4856
  }
4857
- const ep = (e) => {
4857
+ const tp = (e) => {
4858
4858
  const t = /* @__PURE__ */ new Set();
4859
4859
  for (const n of e)
4860
4860
  n.position === "fill" && t.add(n.yScaleType);
@@ -4865,7 +4865,7 @@ const ep = (e) => {
4865
4865
  const s = Math.min(1, Math.max(0, r));
4866
4866
  return { ...n, mapping: { ...n.mapping, y: { value: s } } };
4867
4867
  });
4868
- }, tp = (e, t, n) => {
4868
+ }, np = (e, t, n) => {
4869
4869
  if (e === "point") {
4870
4870
  const r = v(n.size);
4871
4871
  if (r !== null) return { variable: r };
@@ -4887,7 +4887,7 @@ function In(e, t, n) {
4887
4887
  const s = e.layers.map((o, a) => a === r ? n : o);
4888
4888
  return { ...e, layers: s };
4889
4889
  }
4890
- function np(e, t) {
4890
+ function rp(e, t) {
4891
4891
  const n = e.layers.findIndex((s) => s.id === t);
4892
4892
  if (n === -1 || e.layers.length <= 1) return e;
4893
4893
  const r = e.layers.filter((s, o) => o !== n);
@@ -4902,7 +4902,7 @@ const fo = {
4902
4902
  alpha: "continuous-range",
4903
4903
  strokeWidth: "continuous-range",
4904
4904
  lineType: "discrete-only"
4905
- }, rp = {
4905
+ }, sp = {
4906
4906
  numeric: {
4907
4907
  position: "continuous",
4908
4908
  "color-range": "continuous",
@@ -4928,7 +4928,7 @@ const fo = {
4928
4928
  function ho(e, t, n, r, s) {
4929
4929
  switch (e.scaleType) {
4930
4930
  case "inferred": {
4931
- const o = ap(e, t, n, r);
4931
+ const o = ip(e, t, n, r);
4932
4932
  return ho(o, t, n, r, s);
4933
4933
  }
4934
4934
  case "continuous": {
@@ -4973,8 +4973,8 @@ function ho(e, t, n, r, s) {
4973
4973
  type: e.type,
4974
4974
  scaledAesthetic: e.scaledAesthetic,
4975
4975
  scaleType: e.scaleType,
4976
- palette: pu(e.palette, s),
4977
- overrides: du(e.overrides, e.palette, s)
4976
+ palette: mu(e.palette, s),
4977
+ overrides: pu(e.overrides, e.palette, s)
4978
4978
  };
4979
4979
  case "identity":
4980
4980
  return {
@@ -4988,16 +4988,16 @@ function ho(e, t, n, r, s) {
4988
4988
  }
4989
4989
  }
4990
4990
  }
4991
- function sp(e, t, n, r, s, o) {
4992
- const a = cp(t, n), i = lp(a), c = /* @__PURE__ */ new Map();
4991
+ function op(e, t, n, r, s, o) {
4992
+ const a = lp(t, n), i = up(a), c = /* @__PURE__ */ new Map();
4993
4993
  for (const u of i)
4994
4994
  c.set(u.scaledAesthetic, u);
4995
4995
  const l = [...c.values()].map((u) => ho(u, e, n, r, o));
4996
- return s.coordType === "polar" ? op(l) : l;
4996
+ return s.coordType === "polar" ? ap(l) : l;
4997
4997
  }
4998
- const op = (e) => e.map((t) => t.scaleType === "discrete" ? { ...t, padding: 0 } : t);
4999
- function ap(e, t, n, r) {
5000
- const s = Z(e.scaledAesthetic), o = e.scaledAesthetic === "ySecondary" ? ip(n, r) : r[s], a = tt(n, "bar");
4998
+ const ap = (e) => e.map((t) => t.scaleType === "discrete" ? { ...t, padding: 0 } : t);
4999
+ function ip(e, t, n, r) {
5000
+ const s = Z(e.scaledAesthetic), o = e.scaledAesthetic === "ySecondary" ? cp(n, r) : r[s], a = tt(n, "bar");
5001
5001
  if (e.scaledAesthetic === "x" && a)
5002
5002
  return q(e.scaledAesthetic, e.options);
5003
5003
  if (a && e.scaledAesthetic === (a.yScaleType === "secondary" ? "ySecondary" : "y")) {
@@ -5008,7 +5008,7 @@ function ap(e, t, n, r) {
5008
5008
  if (!h(i) || !t.hasVariable(i))
5009
5009
  return D(e.scaledAesthetic, e.options);
5010
5010
  const c = t.getType(i), l = fo[e.scaledAesthetic];
5011
- switch (rp[c][l]) {
5011
+ switch (sp[c][l]) {
5012
5012
  case "discrete":
5013
5013
  return q(e.scaledAesthetic, e.options);
5014
5014
  case "datetime":
@@ -5020,18 +5020,18 @@ function ap(e, t, n, r) {
5020
5020
  return Oe(e.scaledAesthetic);
5021
5021
  }
5022
5022
  }
5023
- function ip(e, t) {
5023
+ function cp(e, t) {
5024
5024
  const n = e.find((r) => r.yScaleType === "secondary");
5025
5025
  return n ? n.mapping.y ?? t.y : t.y;
5026
5026
  }
5027
- function cp(e, t) {
5027
+ function lp(e, t) {
5028
5028
  return !t.some((s) => s.yScaleType === "secondary") || e.some((s) => s.scaledAesthetic === "ySecondary") ? e : [...e, bt("ySecondary")];
5029
5029
  }
5030
- function lp(e) {
5030
+ function up(e) {
5031
5031
  return e.some((n) => n.scaledAesthetic === "color") ? e : [...e, co("color")];
5032
5032
  }
5033
5033
  function qr(e, t) {
5034
- const n = Gd(e.coords), r = Kd(e.mapping, n.coordType, e.layers), s = sp(e.data, e.scales, r, e.mapping, n, t), o = Bd(e.config), a = Wd(e.highlights, r), i = Cd(e.annotations, r);
5034
+ const n = Wd(e.coords), r = Xd(e.mapping, n.coordType, e.layers), s = op(e.data, e.scales, r, e.mapping, n, t), o = zd(e.config), a = Yd(e.highlights, r), i = Dd(e.annotations, r);
5035
5035
  return {
5036
5036
  data: e.data,
5037
5037
  mapping: e.mapping,
@@ -5044,17 +5044,17 @@ function qr(e, t) {
5044
5044
  config: o
5045
5045
  };
5046
5046
  }
5047
- class up {
5047
+ class dp {
5048
5048
  /**
5049
5049
  * Resolve user input into a fully defaulted {@link Spec}. Accepts either a viz-engine
5050
5050
  * `SpecInput` or a legacy `GraphConfig`, converting the latter before resolution.
5051
5051
  */
5052
5052
  compile({ input: t, dataset: n, ctx: r }) {
5053
5053
  const s = r.customPalettes ?? {};
5054
- return hu(t) ? qr(Td(n, t, r), s) : qr({ ...t, data: n }, s);
5054
+ return yu(t) ? qr(Md(n, t, r), s) : qr({ ...t, data: n }, s);
5055
5055
  }
5056
5056
  }
5057
- class dp {
5057
+ class pp {
5058
5058
  constructor(t) {
5059
5059
  this.registry = t;
5060
5060
  }
@@ -5072,7 +5072,7 @@ class Dt {
5072
5072
  return t.data.size() === 0 ? { data: t.data, mapping: {} } : this.computeStat(t);
5073
5073
  }
5074
5074
  }
5075
- class pp extends Dt {
5075
+ class mp extends Dt {
5076
5076
  constructor() {
5077
5077
  super(...arguments), this.type = "count", this.computedVariables = /* @__PURE__ */ new Set(["y"]);
5078
5078
  }
@@ -5089,7 +5089,7 @@ class pp extends Dt {
5089
5089
  };
5090
5090
  }
5091
5091
  }
5092
- class mp extends Dt {
5092
+ class fp extends Dt {
5093
5093
  constructor() {
5094
5094
  super(...arguments), this.type = "identity", this.computedVariables = /* @__PURE__ */ new Set();
5095
5095
  }
@@ -5097,7 +5097,7 @@ class mp extends Dt {
5097
5097
  return { data: t, mapping: {} };
5098
5098
  }
5099
5099
  }
5100
- class fp extends Dt {
5100
+ class hp extends Dt {
5101
5101
  constructor() {
5102
5102
  super(...arguments), this.type = "mean", this.computedVariables = /* @__PURE__ */ new Set(["y"]);
5103
5103
  }
@@ -5111,8 +5111,8 @@ class fp extends Dt {
5111
5111
  };
5112
5112
  }
5113
5113
  }
5114
- const hp = 2, yo = 1440 * 60 * 1e3;
5115
- class yp extends Dt {
5114
+ const yp = 2, yo = 1440 * 60 * 1e3;
5115
+ class gp extends Dt {
5116
5116
  constructor() {
5117
5117
  super(...arguments), this.type = "smooth", this.computedVariables = /* @__PURE__ */ new Set();
5118
5118
  }
@@ -5127,9 +5127,9 @@ class yp extends Dt {
5127
5127
  const i = t.getType(o), c = t.getType(a);
5128
5128
  if (c !== "numeric")
5129
5129
  throw new Error(`'smooth' stat requires a numeric 'y' (got '${c}' for variable '${a}')`);
5130
- const l = vn(t, n), u = Ap(o, i, a, l, t);
5130
+ const l = vn(t, n), u = Tp(o, i, a, l, t);
5131
5131
  return l.length === 0 ? Qr({ data: t, xVariable: o, xType: i, yVariable: a, spec: r, output: u, groupObservation: {}, xScaleIsDiscrete: s }) : t.groupBy(...l).forEach((d) => {
5132
- const p = Tp(d, l);
5132
+ const p = Mp(d, l);
5133
5133
  Qr({
5134
5134
  data: d,
5135
5135
  xVariable: o,
@@ -5153,23 +5153,23 @@ const Qr = ({
5153
5153
  groupObservation: a,
5154
5154
  xScaleIsDiscrete: i
5155
5155
  }) => {
5156
- const { observations: c, temporalOrigin: l } = gp({ data: e, xVariable: t, yVariable: r, xType: n });
5157
- c.length < hp || (i ? wp({ observations: c, spec: s, output: o, groupObservation: a }) : xp({ observations: c, xType: n, temporalOrigin: l, spec: s, output: o, groupObservation: a }));
5158
- }, gp = ({
5156
+ const { observations: c, temporalOrigin: l } = bp({ data: e, xVariable: t, yVariable: r, xType: n });
5157
+ c.length < yp || (i ? Ap({ observations: c, spec: s, output: o, groupObservation: a }) : Sp({ observations: c, xType: n, temporalOrigin: l, spec: s, output: o, groupObservation: a }));
5158
+ }, bp = ({
5159
5159
  data: e,
5160
5160
  xVariable: t,
5161
5161
  yVariable: n,
5162
5162
  xType: r
5163
5163
  }) => {
5164
- const s = e.getValues(t), o = e.getValues(n, { type: "numeric" }), a = r === "temporal" ? bp(s) : null, i = [], c = /* @__PURE__ */ new Map();
5164
+ const s = e.getValues(t), o = e.getValues(n, { type: "numeric" }), a = r === "temporal" ? vp(s) : null, i = [], c = /* @__PURE__ */ new Map();
5165
5165
  for (let l = 0; l < s.length; l++) {
5166
5166
  const u = s[l], d = o[l];
5167
5167
  if (!h(u) || !h(d) || !Number.isFinite(d)) continue;
5168
- const p = vp({ xValue: u, xType: r, categoryRank: c, temporalOrigin: a });
5168
+ const p = xp({ xValue: u, xType: r, categoryRank: c, temporalOrigin: a });
5169
5169
  p !== null && i.push({ x: p, y: d, originalX: u });
5170
5170
  }
5171
5171
  return { observations: i, temporalOrigin: a };
5172
- }, bp = (e) => {
5172
+ }, vp = (e) => {
5173
5173
  let t = null;
5174
5174
  for (const n of e) {
5175
5175
  if (!O(n)) continue;
@@ -5177,7 +5177,7 @@ const Qr = ({
5177
5177
  (t === null || r < t) && (t = r);
5178
5178
  }
5179
5179
  return t;
5180
- }, vp = ({
5180
+ }, xp = ({
5181
5181
  xValue: e,
5182
5182
  xType: t,
5183
5183
  categoryRank: n,
@@ -5203,7 +5203,7 @@ const Qr = ({
5203
5203
  throw new Error(`Unexpected xType: ${s}`);
5204
5204
  }
5205
5205
  }
5206
- }, xp = ({
5206
+ }, Sp = ({
5207
5207
  observations: e,
5208
5208
  xType: t,
5209
5209
  temporalOrigin: n,
@@ -5214,10 +5214,10 @@ const Qr = ({
5214
5214
  const a = go(r, e);
5215
5215
  for (const [i, c] of a) {
5216
5216
  if (!Number.isFinite(i) || !Number.isFinite(c)) continue;
5217
- const l = t === "temporal" ? Sp(i, n) : i;
5217
+ const l = t === "temporal" ? wp(i, n) : i;
5218
5218
  s.push({ x: l, y: c, groupObservation: o });
5219
5219
  }
5220
- }, Sp = (e, t) => t === null ? new Date(e) : new Date((e - 1) * yo + t), wp = ({
5220
+ }, wp = (e, t) => t === null ? new Date(e) : new Date((e - 1) * yo + t), Ap = ({
5221
5221
  observations: e,
5222
5222
  spec: t,
5223
5223
  output: n,
@@ -5242,25 +5242,25 @@ const Qr = ({
5242
5242
  const c = s.get(i), l = a.predict(i);
5243
5243
  c === void 0 || !Number.isFinite(l) || n.push({ x: c, y: l, groupObservation: r });
5244
5244
  }
5245
- }, go = (e, t) => e.method === "loess" ? ma().x((r) => r.x).y((r) => r.y).bandwidth(e.bandwidth)(t) : bo(e, t), bo = (e, t) => {
5245
+ }, go = (e, t) => e.method === "loess" ? fa().x((r) => r.x).y((r) => r.y).bandwidth(e.bandwidth)(t) : bo(e, t), bo = (e, t) => {
5246
5246
  const n = (s) => s.x, r = (s) => s.y;
5247
5247
  switch (e.method) {
5248
5248
  case "linear":
5249
- return va().x(n).y(r)(t);
5249
+ return xa().x(n).y(r)(t);
5250
5250
  case "exponential":
5251
- return ba().x(n).y(r)(t);
5251
+ return va().x(n).y(r)(t);
5252
5252
  case "logarithmic":
5253
- return ga().x(n).y(r)(t);
5253
+ return ba().x(n).y(r)(t);
5254
5254
  case "quadratic":
5255
- return ya().x(n).y(r)(t);
5255
+ return ga().x(n).y(r)(t);
5256
5256
  case "power":
5257
- return ha().x(n).y(r)(t);
5257
+ return ya().x(n).y(r)(t);
5258
5258
  case "polynomial":
5259
- return fa().x(n).y(r).order(e.order)(t);
5259
+ return ha().x(n).y(r).order(e.order)(t);
5260
5260
  case "loess":
5261
5261
  throw new Error("'loess' does not expose a 'predict' function");
5262
5262
  }
5263
- }, Ap = (e, t, n, r, s) => {
5263
+ }, Tp = (e, t, n, r, s) => {
5264
5264
  const o = [], a = [], i = Object.fromEntries(
5265
5265
  r.map((c) => [c, []])
5266
5266
  );
@@ -5284,7 +5284,7 @@ const Qr = ({
5284
5284
  return new E(c);
5285
5285
  }
5286
5286
  };
5287
- }, Tp = (e, t) => {
5287
+ }, Mp = (e, t) => {
5288
5288
  const n = {};
5289
5289
  for (const r of t) {
5290
5290
  const s = e.getValues(r);
@@ -5292,12 +5292,12 @@ const Qr = ({
5292
5292
  }
5293
5293
  return n;
5294
5294
  };
5295
- class Mp extends Ce {
5295
+ class Lp extends Ce {
5296
5296
  constructor() {
5297
- super("stat"), this.register("identity", new mp()), this.register("count", new pp()), this.register("smooth", new yp()), this.register("mean", new fp());
5297
+ super("stat"), this.register("identity", new fp()), this.register("count", new mp()), this.register("smooth", new gp()), this.register("mean", new hp());
5298
5298
  }
5299
5299
  }
5300
- const Lp = ({ layer: e }) => {
5300
+ const Vp = ({ layer: e }) => {
5301
5301
  if (e.geom !== "bar" || e.position === "stack") return;
5302
5302
  const t = v(e.mapping.y);
5303
5303
  if (t === null) return;
@@ -5307,14 +5307,14 @@ const Lp = ({ layer: e }) => {
5307
5307
  I(o) && (n += o, r += Math.abs(o));
5308
5308
  }
5309
5309
  return { grandTotal: n, absoluteGrandTotal: r };
5310
- }, Vp = ({ layer: e }) => {
5310
+ }, Ep = ({ layer: e }) => {
5311
5311
  if (e.geom !== "bar" || e.position !== "stack") return;
5312
5312
  const t = v(e.mapping.x);
5313
5313
  if (t === null || !e.data.hasVariable(f.yMin) || !e.data.hasVariable(f.yMax))
5314
5314
  return;
5315
5315
  const n = /* @__PURE__ */ new Map();
5316
5316
  for (const s of e.data) {
5317
- const o = s[t], a = se(s), i = H(s), c = ge(s), l = ie(s), u = Fa(s);
5317
+ const o = s[t], a = se(s), i = H(s), c = ge(s), l = ie(s), u = _a(s);
5318
5318
  if (!h(o) || !h(a) || !h(i) || !h(c) || !h(l) || !h(u))
5319
5319
  continue;
5320
5320
  const d = u >= 0;
@@ -5349,18 +5349,18 @@ const Lp = ({ layer: e }) => {
5349
5349
  }
5350
5350
  return r;
5351
5351
  };
5352
- class Ep extends Ie {
5352
+ class kp extends Ie {
5353
5353
  dependencies() {
5354
5354
  return [];
5355
5355
  }
5356
5356
  compileLayer(t) {
5357
- const n = {}, r = Vp({ layer: t });
5357
+ const n = {}, r = Ep({ layer: t });
5358
5358
  r !== void 0 && (n.stackTotals = r);
5359
- const s = Lp({ layer: t });
5359
+ const s = Vp({ layer: t });
5360
5360
  return s !== void 0 && (n.grandTotal = s.grandTotal, n.absoluteGrandTotal = s.absoluteGrandTotal), { ...t, summary: n };
5361
5361
  }
5362
5362
  }
5363
- class kp extends ce {
5363
+ class Ip extends ce {
5364
5364
  constructor(t) {
5365
5365
  super(), this.registry = t;
5366
5366
  }
@@ -5374,7 +5374,7 @@ class kp extends ce {
5374
5374
  return t.transforms.reduce((n, r) => this.registry.get(r.transformType).apply(n, r), t.data);
5375
5375
  }
5376
5376
  }
5377
- class Ip {
5377
+ class Cp {
5378
5378
  constructor() {
5379
5379
  this.transformType = "aggregate";
5380
5380
  }
@@ -5388,7 +5388,7 @@ class Ip {
5388
5388
  return t.groupBy(...r.groupby).rollup(s);
5389
5389
  }
5390
5390
  }
5391
- class Cp {
5391
+ class Dp {
5392
5392
  constructor() {
5393
5393
  this.transformType = "constant";
5394
5394
  }
@@ -5397,7 +5397,7 @@ class Cp {
5397
5397
  return t.addConstantVariable(r.variableName, r.type, r.value);
5398
5398
  }
5399
5399
  }
5400
- class Dp {
5400
+ class Fp {
5401
5401
  constructor() {
5402
5402
  this.transformType = "filter";
5403
5403
  }
@@ -5406,7 +5406,7 @@ class Dp {
5406
5406
  return t.filter(r.variableName, r.operator, r.value);
5407
5407
  }
5408
5408
  }
5409
- class Fp {
5409
+ class _p {
5410
5410
  constructor() {
5411
5411
  this.transformType = "reshape";
5412
5412
  }
@@ -5420,7 +5420,7 @@ class Fp {
5420
5420
  });
5421
5421
  }
5422
5422
  }
5423
- class _p {
5423
+ class Rp {
5424
5424
  constructor() {
5425
5425
  this.transformType = "sort";
5426
5426
  }
@@ -5429,9 +5429,9 @@ class _p {
5429
5429
  return t.orderBy(r.variableName, r.direction ?? "asc");
5430
5430
  }
5431
5431
  }
5432
- class Rp extends Ce {
5432
+ class Np extends Ce {
5433
5433
  constructor() {
5434
- super("transform"), this.register("aggregate", new Ip()), this.register("constant", new Cp()), this.register("filter", new Dp()), this.register("reshape", new Fp()), this.register("sort", new _p());
5434
+ super("transform"), this.register("aggregate", new Cp()), this.register("constant", new Dp()), this.register("filter", new Fp()), this.register("reshape", new _p()), this.register("sort", new Rp());
5435
5435
  }
5436
5436
  }
5437
5437
  const Zr = {
@@ -5440,16 +5440,16 @@ const Zr = {
5440
5440
  alpha: "numeric",
5441
5441
  strokeWidth: "numeric",
5442
5442
  lineType: "categorical"
5443
- }, Np = [
5443
+ }, Pp = [
5444
5444
  "color",
5445
5445
  "size",
5446
5446
  "alpha",
5447
5447
  "strokeWidth",
5448
5448
  "lineType"
5449
5449
  ];
5450
- class Pp extends Ie {
5450
+ class Op extends Ie {
5451
5451
  dependencies(t) {
5452
- return Np.map((n) => t.scales[n]);
5452
+ return Pp.map((n) => t.scales[n]);
5453
5453
  }
5454
5454
  compileLayer(t, n) {
5455
5455
  let r = t.data;
@@ -5462,13 +5462,13 @@ class Pp extends Ie {
5462
5462
  }
5463
5463
  const c = v(t.mapping[o]), l = n.scales[o];
5464
5464
  if (!l || l.kind !== "visual") continue;
5465
- const u = Op(o, c, l);
5465
+ const u = $p(o, c, l);
5466
5466
  u && (r = r.deriveVariable(a, Zr[o], u));
5467
5467
  }
5468
5468
  return { ...t, data: r };
5469
5469
  }
5470
5470
  }
5471
- const Op = (e, t, n) => {
5471
+ const $p = (e, t, n) => {
5472
5472
  if (!t) {
5473
5473
  if (e !== "color" || n.spec.scaleType !== "palette") return null;
5474
5474
  const r = n.map(null);
@@ -5491,7 +5491,7 @@ const Op = (e, t, n) => {
5491
5491
  "config",
5492
5492
  "annotations"
5493
5493
  ];
5494
- class $p {
5494
+ class Bp {
5495
5495
  constructor(t, n, r, s, o, a, i, c, l, u, d, p, m, y, g) {
5496
5496
  this.dataCompiler = t, this.specCompiler = n, this.transformCompiler = r, this.constantMappingCompiler = s, this.layerValidationCheck = o, this.layerCompiler = a, this.scaleCompiler = i, this.coordCompiler = c, this.positionMapperCompiler = l, this.visualMapperCompiler = u, this.guideCompiler = d, this.summariseCompiler = p, this.highlightsCompiler = m, this.configCompiler = y, this.annotationsCompiler = g, this.lastCompile = null, this.lastData = void 0, this.stages = [
5497
5497
  { name: "data", getStats: () => this.dataCompiler.stats },
@@ -5629,29 +5629,29 @@ class $p {
5629
5629
  }
5630
5630
  }
5631
5631
  const cg = () => {
5632
- const e = new Mp(), t = new fu(), n = new oc(), r = new kp(new Rp());
5633
- return new $p(
5634
- new Ki(),
5635
- new up(),
5632
+ const e = new Lp(), t = new hu(), n = new ac(), r = new Ip(new Np());
5633
+ return new Bp(
5634
+ new Xi(),
5635
+ new dp(),
5636
5636
  r,
5637
- new ja(),
5638
- new Cl(r, new Dl(n, e)),
5639
- new Il(
5637
+ new qa(),
5638
+ new Dl(r, new Fl(n, e)),
5639
+ new Cl(
5640
5640
  r,
5641
- new dp(e),
5642
- new ac(),
5643
- new Zi(n),
5644
- new Fl(new Ol())
5641
+ new pp(e),
5642
+ new ic(),
5643
+ new Ji(n),
5644
+ new _l(new $l())
5645
5645
  ),
5646
- new Ul(t),
5647
- new Ja(new pi()),
5648
- new Hl(),
5649
- new Pp(),
5650
- new gl(),
5651
- new Ep(),
5652
- new Vl(),
5653
- new Xa(),
5654
- new Ba()
5646
+ new Kl(t),
5647
+ new ei(new mi()),
5648
+ new Ul(),
5649
+ new Op(),
5650
+ new bl(),
5651
+ new kp(),
5652
+ new El(),
5653
+ new ja(),
5654
+ new za()
5655
5655
  );
5656
5656
  };
5657
5657
  function lg(e, t) {
@@ -5665,7 +5665,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5665
5665
  } catch {
5666
5666
  return vo;
5667
5667
  }
5668
- }, le = (e) => (t) => I(t) ? e(t) : Cn, Dn = (e) => (t) => Ue(t) ? t : Cn, Bp = 2, zp = 3, Gp = 2, Wp = 0, Yp = 1, Hp = 2, Up = xa.humanizer({
5668
+ }, le = (e) => (t) => I(t) ? e(t) : Cn, Dn = (e) => (t) => Ue(t) ? t : Cn, zp = 2, Gp = 3, Wp = 2, Yp = 0, Hp = 1, Up = 2, Kp = Sa.humanizer({
5669
5669
  language: "en",
5670
5670
  spacer: "",
5671
5671
  delimiter: " ",
@@ -5687,7 +5687,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5687
5687
  numberFormat: n,
5688
5688
  intlOptions: r
5689
5689
  }) => le((s) => {
5690
- const o = typeof n.decimals == "number" ? n.decimals : Bp, a = Nn(s, o), { base: i, suffix: c } = Rn(s, n.abbreviation), l = {
5690
+ const o = typeof n.decimals == "number" ? n.decimals : zp, a = Nn(s, o), { base: i, suffix: c } = Rn(s, n.abbreviation), l = {
5691
5691
  ...a,
5692
5692
  ...ks(e) ? { style: "currency", currencyDisplay: "narrowSymbol", currency: e.iso } : {},
5693
5693
  ...r
@@ -5700,7 +5700,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5700
5700
  }) => le((r) => {
5701
5701
  const { base: s, suffix: o } = Rn(r, t.abbreviation), i = { ...Nn(s, t.decimals), ...n };
5702
5702
  return `${Intl.NumberFormat(e, i).format(s)}${o}`;
5703
- }), _n = (e) => le((t) => Up(t)), So = ({ locale: e, intlOptions: t }) => le(
5703
+ }), _n = (e) => le((t) => Kp(t)), So = ({ locale: e, intlOptions: t }) => le(
5704
5704
  (n) => Intl.NumberFormat(e, { maximumFractionDigits: 0, ...t }).format(n)
5705
5705
  ), wo = ({
5706
5706
  locale: e,
@@ -5714,7 +5714,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5714
5714
  case "none":
5715
5715
  return { base: e, suffix: "" };
5716
5716
  case "auto": {
5717
- const n = Kp(e);
5717
+ const n = Xp(e);
5718
5718
  return Rn(e, n);
5719
5719
  }
5720
5720
  default:
@@ -5723,24 +5723,24 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5723
5723
  }, Nn = (e, t) => {
5724
5724
  if (typeof t == "number")
5725
5725
  return { minimumFractionDigits: t, maximumFractionDigits: t };
5726
- const n = Math.ceil(Math.log10(Math.abs(e))), r = n >= zp ? Wp : n === Gp ? Yp : Hp;
5726
+ const n = Math.ceil(Math.log10(Math.abs(e))), r = n >= Gp ? Yp : n === Wp ? Hp : Up;
5727
5727
  return {
5728
5728
  minimumFractionDigits: t === "auto" ? 0 : r,
5729
5729
  maximumFractionDigits: r
5730
5730
  };
5731
- }, Kp = (e) => {
5731
+ }, Xp = (e) => {
5732
5732
  const t = Math.abs(e);
5733
5733
  return t >= Be.b ? "b" : t >= Be.m ? "m" : t >= Be.k ? "k" : "none";
5734
- }, Xp = ({ locale: e, intlOptions: t }) => R(
5734
+ }, jp = ({ locale: e, intlOptions: t }) => R(
5735
5735
  (n) => Intl.DateTimeFormat(e, { dateStyle: "medium", ...N, ...t }).format(n)
5736
- ), jp = ({ locale: e, intlOptions: t }) => R((n) => {
5736
+ ), qp = ({ locale: e, intlOptions: t }) => R((n) => {
5737
5737
  const r = Intl.DateTimeFormat(e, {
5738
5738
  dateStyle: "medium",
5739
5739
  timeStyle: "medium",
5740
5740
  ...N,
5741
5741
  ...t
5742
5742
  }).formatToParts(n);
5743
- return qp(r.map(Qp));
5743
+ return Qp(r.map(Zp));
5744
5744
  }), Ao = ({ locale: e, intlOptions: t }) => R(
5745
5745
  (n) => Intl.DateTimeFormat(e, {
5746
5746
  day: "numeric",
@@ -5784,7 +5784,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5784
5784
  (n) => Intl.DateTimeFormat(e, { year: "numeric", ...N, ...t }).format(n)
5785
5785
  ), Vo = ({ locale: e, intlOptions: t }) => R(
5786
5786
  (n) => Intl.DateTimeFormat(e, { timeStyle: "short", ...N, ...t }).format(n)
5787
- ), qp = (e) => e.map((t) => t.value).join(""), Qp = (e) => e.type !== "literal" || e.value !== ", " ? e : { type: "literal", value: " • " }, Zp = 1, Jp = 4, em = 1, Jr = 1e3, tm = ({
5787
+ ), Qp = (e) => e.map((t) => t.value).join(""), Zp = (e) => e.type !== "literal" || e.value !== ", " ? e : { type: "literal", value: " • " }, Jp = 1, em = 4, tm = 1, Jr = 1e3, nm = ({
5788
5788
  valueFormat: e,
5789
5789
  locale: t,
5790
5790
  tickValues: n,
@@ -5797,14 +5797,14 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5797
5797
  ...r
5798
5798
  };
5799
5799
  return Bn(s, t, a);
5800
- }), nm = ({
5800
+ }), rm = ({
5801
5801
  locale: e,
5802
5802
  tickValues: t,
5803
5803
  intlOptions: n
5804
5804
  }) => le((r) => {
5805
5805
  const o = { ...zn(r, t), notation: "compact", ...n };
5806
5806
  return Bn(r, e, o);
5807
- }), rm = ({
5807
+ }), sm = ({
5808
5808
  locale: e,
5809
5809
  tickValues: t,
5810
5810
  intlOptions: n
@@ -5816,11 +5816,11 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5816
5816
  style: "percent"
5817
5817
  };
5818
5818
  return Bn(r, e, o);
5819
- }), Bn = (e, t, n) => Intl.NumberFormat(t, n).formatToParts(e).map((s) => s.type === "compact" ? s.value.toLowerCase() : s.value).join(""), Eo = (e) => Math.abs(e) > Jr ? Eo(e / Jr) : Number.isInteger(e), sm = (e) => {
5819
+ }), Bn = (e, t, n) => Intl.NumberFormat(t, n).formatToParts(e).map((s) => s.type === "compact" ? s.value.toLowerCase() : s.value).join(""), Eo = (e) => Math.abs(e) > Jr ? Eo(e / Jr) : Number.isInteger(e), om = (e) => {
5820
5820
  if (e.length < 2) return !1;
5821
5821
  const [t, n] = e;
5822
- return typeof t != "number" || typeof n != "number" ? !1 : Math.abs(n - t) < Zp;
5823
- }, zn = (e, t) => Eo(e) ? { minimumFractionDigits: 0, maximumFractionDigits: 0 } : sm(t) ? { minimumFractionDigits: 0, maximumFractionDigits: Jp } : { minimumFractionDigits: 0, maximumFractionDigits: em }, om = ({
5822
+ return typeof t != "number" || typeof n != "number" ? !1 : Math.abs(n - t) < Jp;
5823
+ }, zn = (e, t) => Eo(e) ? { minimumFractionDigits: 0, maximumFractionDigits: 0 } : om(t) ? { minimumFractionDigits: 0, maximumFractionDigits: em } : { minimumFractionDigits: 0, maximumFractionDigits: tm }, am = ({
5824
5824
  locale: e,
5825
5825
  intlOptions: t
5826
5826
  }) => R(
@@ -5830,12 +5830,12 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5830
5830
  ...N,
5831
5831
  ...t
5832
5832
  }).format(n)
5833
- ), am = ({
5833
+ ), im = ({
5834
5834
  locale: e,
5835
5835
  intlOptions: t
5836
5836
  }) => R(
5837
5837
  (n) => Intl.DateTimeFormat(e, { month: "short", ...N, ...t }).format(n)
5838
- ), im = ({
5838
+ ), cm = ({
5839
5839
  locale: e,
5840
5840
  intlOptions: t
5841
5841
  }) => R(
@@ -5845,7 +5845,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5845
5845
  ...N,
5846
5846
  ...t
5847
5847
  }).format(n)
5848
- ), cm = ({
5848
+ ), lm = ({
5849
5849
  locale: e,
5850
5850
  intlOptions: t
5851
5851
  }) => R(
@@ -5854,31 +5854,31 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5854
5854
  const { valueFormat: t } = e;
5855
5855
  switch (t.type) {
5856
5856
  case "currency":
5857
- return tm(e);
5857
+ return nm(e);
5858
5858
  case "date":
5859
5859
  case "datetime":
5860
- return om(e);
5860
+ return am(e);
5861
5861
  case "day_month":
5862
5862
  case "weekly_date_range":
5863
5863
  case "weekly_date_range_with_year":
5864
- return im(e);
5864
+ return cm(e);
5865
5865
  case "decimal":
5866
5866
  case "integer":
5867
- return nm(e);
5867
+ return rm(e);
5868
5868
  case "duration":
5869
5869
  return _n();
5870
5870
  case "month":
5871
- return am(e);
5871
+ return im(e);
5872
5872
  case "month_year":
5873
5873
  return Pn(e);
5874
5874
  case "percentage":
5875
- return rm(e);
5875
+ return sm(e);
5876
5876
  case "quarter":
5877
5877
  return On();
5878
5878
  case "text":
5879
5879
  return Dn();
5880
5880
  case "time":
5881
- return cm(e);
5881
+ return lm(e);
5882
5882
  case "year":
5883
5883
  return $n(e);
5884
5884
  case "lookup":
@@ -5888,7 +5888,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5888
5888
  throw new Error(`Unhandled value format: ${n.type}`);
5889
5889
  }
5890
5890
  }
5891
- }, lm = 40, um = 60, es = 8, dm = 50, pm = 1 / 3, mm = 1 / 4, Kt = "…", fm = (e, t, n) => {
5891
+ }, um = 40, dm = 60, es = 8, pm = 50, mm = 1 / 3, fm = 1 / 4, Kt = "…", hm = (e, t, n) => {
5892
5892
  if (t <= 0 || e.length === 0) return "";
5893
5893
  if (n(e) <= t) return e;
5894
5894
  if (n(Kt) > t) return "";
@@ -5898,7 +5898,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5898
5898
  n(i) <= t ? (o = a, r = a + 1) : s = a - 1;
5899
5899
  }
5900
5900
  return e.slice(0, o) + Kt;
5901
- }, hm = (e) => e.formattedAxis.position === "top" || e.formattedAxis.position === "bottom" ? ym(e) : gm(e), ym = ({
5901
+ }, ym = (e) => e.formattedAxis.position === "top" || e.formattedAxis.position === "bottom" ? gm(e) : bm(e), gm = ({
5902
5902
  formattedAxis: e,
5903
5903
  bandwidthPx: t,
5904
5904
  panelRect: n,
@@ -5907,7 +5907,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5907
5907
  const { widths: s, maxWidth: o, maxHeight: a } = ko(e.ticks, r), i = t - es;
5908
5908
  if (o <= i)
5909
5909
  return { ...e, labelRotation: 0, labelMaxWidthPx: null };
5910
- if (t >= dm) {
5910
+ if (t >= pm) {
5911
5911
  const l = cn(i);
5912
5912
  return {
5913
5913
  ...e,
@@ -5918,14 +5918,14 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5918
5918
  }
5919
5919
  if (a + es > t)
5920
5920
  return { ...e, ticks: [], labelRotation: 0, labelMaxWidthPx: null };
5921
- const c = cn(n.height * pm);
5921
+ const c = cn(n.height * mm);
5922
5922
  return {
5923
5923
  ...e,
5924
5924
  ticks: an(e.ticks, s, c, r),
5925
5925
  labelRotation: -90,
5926
5926
  labelMaxWidthPx: c
5927
5927
  };
5928
- }, gm = ({
5928
+ }, bm = ({
5929
5929
  formattedAxis: e,
5930
5930
  bandwidthPx: t,
5931
5931
  panelRect: n,
@@ -5934,7 +5934,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5934
5934
  const { widths: s, maxWidth: o, maxHeight: a } = ko(e.ticks, r);
5935
5935
  if (a > t)
5936
5936
  return { ...e, ticks: [], labelRotation: 0, labelMaxWidthPx: null };
5937
- const i = cn(n.width * mm);
5937
+ const i = cn(n.width * fm);
5938
5938
  return o <= i ? { ...e, labelRotation: 0, labelMaxWidthPx: null } : {
5939
5939
  ...e,
5940
5940
  ticks: an(e.ticks, s, i, r),
@@ -5951,17 +5951,17 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5951
5951
  return { widths: n, maxWidth: r, maxHeight: s };
5952
5952
  }, an = (e, t, n, r) => {
5953
5953
  const s = (o) => r(o).width;
5954
- return e.map((o, a) => (t[a] ?? 0) <= n ? o : { ...o, formattedLabel: fm(o.formattedLabel, n, s) });
5955
- }, cn = (e) => Math.max(0, Math.floor(e)), bm = (e, t, n, r) => {
5954
+ return e.map((o, a) => (t[a] ?? 0) <= n ? o : { ...o, formattedLabel: hm(o.formattedLabel, n, s) });
5955
+ }, cn = (e) => Math.max(0, Math.floor(e)), vm = (e, t, n, r) => {
5956
5956
  if (e.length === 0) return !0;
5957
- const s = t === "top" || t === "bottom", o = s ? um : lm;
5957
+ const s = t === "top" || t === "bottom", o = s ? dm : um;
5958
5958
  let a = n - (e.length - 1) * o;
5959
5959
  for (const i of e) {
5960
5960
  const { width: c, height: l } = r(i);
5961
5961
  if (a -= s ? c : l, a < 0) return !1;
5962
5962
  }
5963
5963
  return !0;
5964
- }, vm = ({
5964
+ }, xm = ({
5965
5965
  axis: e,
5966
5966
  availableSpacePx: t,
5967
5967
  measureLabel: n,
@@ -5972,16 +5972,16 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
5972
5972
  const a = /* @__PURE__ */ new Map(), i = (d) => {
5973
5973
  const p = a.get(d);
5974
5974
  if (p) return p;
5975
- const m = s[d], y = m ? xm(m.ticks, r(m)) : [];
5975
+ const m = s[d], y = m ? Sm(m.ticks, r(m)) : [];
5976
5976
  return a.set(d, y), y;
5977
5977
  };
5978
5978
  let c = 0, l = s.length - 1, u = -1;
5979
5979
  for (; c <= l; ) {
5980
5980
  const d = c + l >>> 1, m = i(d).map((y) => y.formattedLabel);
5981
- bm(m, o, t, n) ? (u = d, c = d + 1) : l = d - 1;
5981
+ vm(m, o, t, n) ? (u = d, c = d + 1) : l = d - 1;
5982
5982
  }
5983
5983
  return u >= 0 ? i(u) : i(0);
5984
- }, xm = (e, t) => e.map((n) => ({ ...n, formattedLabel: t(n.value) })), Xt = 6, jt = 6, qt = 15, Qt = 5, Zt = 15, Io = (e, t) => {
5984
+ }, Sm = (e, t) => e.map((n) => ({ ...n, formattedLabel: t(n.value) })), Xt = 6, jt = 6, qt = 15, Qt = 5, Zt = 15, Io = (e, t) => {
5985
5985
  switch (e) {
5986
5986
  case "small":
5987
5987
  return {
@@ -6026,7 +6026,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6026
6026
  labelFontWeight: 600
6027
6027
  };
6028
6028
  }
6029
- }, Sm = (e) => {
6029
+ }, wm = (e) => {
6030
6030
  const t = P({ ...e, valueFormat: e.valueFormat.fallback }), n = {};
6031
6031
  for (const [s, o] of Object.entries(e.valueFormat.cases))
6032
6032
  n[s] = P({ ...e, valueFormat: o });
@@ -6042,9 +6042,9 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6042
6042
  case "currency":
6043
6043
  return xo(e);
6044
6044
  case "date":
6045
- return Xp(e);
6046
- case "datetime":
6047
6045
  return jp(e);
6046
+ case "datetime":
6047
+ return qp(e);
6048
6048
  case "day_month":
6049
6049
  return Ao(e);
6050
6050
  case "decimal":
@@ -6072,7 +6072,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6072
6072
  case "time":
6073
6073
  return Vo(e);
6074
6074
  case "lookup":
6075
- return Sm({ ...e, valueFormat: e.valueFormat });
6075
+ return wm({ ...e, valueFormat: e.valueFormat });
6076
6076
  default: {
6077
6077
  const t = e.valueFormat;
6078
6078
  throw new Error(`Unhandled value format: ${t.type}`);
@@ -6109,16 +6109,16 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6109
6109
  })(s)}x`;
6110
6110
  }
6111
6111
  }
6112
- }, wm = (e) => {
6112
+ }, Am = (e) => {
6113
6113
  const t = e.padding ?? 0, n = ts(e.rows, t), r = ts(e.cols, t);
6114
6114
  return {
6115
6115
  rows: n.tracks,
6116
6116
  cols: r.tracks,
6117
- placements: Lm(e.placements, n.nameToIndex, r.nameToIndex),
6117
+ placements: Vm(e.placements, n.nameToIndex, r.nameToIndex),
6118
6118
  width: e.containerSize.width,
6119
6119
  height: e.containerSize.height
6120
6120
  };
6121
- }, Am = (e) => {
6121
+ }, Tm = (e) => {
6122
6122
  const t = ns(e.rows, e.height), n = ns(e.cols, e.width), r = rs(t), s = rs(n), o = /* @__PURE__ */ new Map();
6123
6123
  for (const a of e.placements) {
6124
6124
  const i = a.rowSpan ?? 1, c = a.colSpan ?? 1, l = s[a.col] ?? 0, u = r[a.row] ?? 0, d = ss(n, a.col, c), p = ss(t, a.row, i);
@@ -6131,20 +6131,20 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6131
6131
  for (let s = 0; s < e.length; s++) {
6132
6132
  const o = e[s];
6133
6133
  if (!o) continue;
6134
- r.set(o.name, n.length), n.push(Tm(o));
6135
- const a = Mm(e, s);
6134
+ r.set(o.name, n.length), n.push(Mm(o));
6135
+ const a = Lm(e, s);
6136
6136
  if (Do(o) && a) {
6137
6137
  const i = o.gaps?.after ?? 0, c = a.gaps?.before ?? 0, l = Math.max(i, c);
6138
6138
  l > 0 && n.push({ type: "fixed", pixels: l });
6139
6139
  }
6140
6140
  }
6141
6141
  return t > 0 && n.push({ type: "fixed", pixels: t }), { tracks: n, nameToIndex: r };
6142
- }, Tm = (e) => typeof e.size == "number" ? { type: "fixed", pixels: e.size } : { type: "flex", weight: e.size.flex }, Do = (e) => typeof e.size == "number" ? e.size > 0 : e.size.flex > 0, Mm = (e, t) => {
6142
+ }, Mm = (e) => typeof e.size == "number" ? { type: "fixed", pixels: e.size } : { type: "flex", weight: e.size.flex }, Do = (e) => typeof e.size == "number" ? e.size > 0 : e.size.flex > 0, Lm = (e, t) => {
6143
6143
  for (let n = t + 1; n < e.length; n++) {
6144
6144
  const r = e[n];
6145
6145
  if (r && Do(r)) return r;
6146
6146
  }
6147
- }, Lm = (e, t, n) => {
6147
+ }, Vm = (e, t, n) => {
6148
6148
  const r = [];
6149
6149
  for (const s of e) {
6150
6150
  const o = t.get(s.row), a = n.get(s.col);
@@ -6177,7 +6177,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6177
6177
  for (let o = t; o < s; o++)
6178
6178
  r += e[o] ?? 0;
6179
6179
  return r;
6180
- }, Vm = 24, ne = {
6180
+ }, Fo = 24, ne = {
6181
6181
  header: { after: 10, before: 0 },
6182
6182
  headline: { after: 4, before: 0 },
6183
6183
  topLegend: { after: 16, before: 0 },
@@ -6192,14 +6192,14 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6192
6192
  leftAxis: { after: 4, before: 0 },
6193
6193
  panel: { after: 4, before: 0 },
6194
6194
  rightAxis: { after: 10, before: 0 }
6195
- }, Wn = { top: 0, right: 0, bottom: 0, left: 0 }, Em = (e, t, n, r = Wn) => {
6196
- const o = n.axes.top > 0 || n.axesLabels.top > 0 ? n.axesLabels.top : Math.max(n.axesLabels.top, n.axesLabels.left, n.axesLabels.right);
6197
- return wm({
6195
+ }, Wn = { top: 0, right: 0, bottom: 0, left: 0 }, Em = (e, t, n, r = Wn, s = Fo) => {
6196
+ const a = n.axes.top > 0 || n.axesLabels.top > 0 ? n.axesLabels.top : Math.max(n.axesLabels.top, n.axesLabels.left, n.axesLabels.right);
6197
+ return Am({
6198
6198
  rows: [
6199
6199
  { name: "header", size: t.headerSize.height, gaps: ne.header },
6200
6200
  { name: "topLegend", size: n.legends.top, gaps: ne.topLegend },
6201
6201
  { name: "headline", size: n.headline, gaps: ne.headline },
6202
- { name: "topAxisLabel", size: o, gaps: ne.topAxisLabel },
6202
+ { name: "topAxisLabel", size: a, gaps: ne.topAxisLabel },
6203
6203
  { name: "topAxis", size: n.axes.top, gaps: ne.topAxis },
6204
6204
  { name: "topAnnotation", size: r.top },
6205
6205
  { name: "panel", size: { flex: 1 }, gaps: ne.panel },
@@ -6233,7 +6233,7 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6233
6233
  ...Cm(n.legends)
6234
6234
  ],
6235
6235
  containerSize: e,
6236
- padding: Vm
6236
+ padding: s
6237
6237
  });
6238
6238
  }, km = (e) => {
6239
6239
  const t = [];
@@ -6320,8 +6320,8 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6320
6320
  containerSize: t,
6321
6321
  measurer: n
6322
6322
  }) => {
6323
- if (Fo(e)) return 0;
6324
- const r = _o(e, t.width, n);
6323
+ if (_o(e)) return 0;
6324
+ const r = Ro(e, t.width, n);
6325
6325
  return n.measureHeadline(e.formatted, r).height;
6326
6326
  }, ug = ({
6327
6327
  headline: e,
@@ -6330,15 +6330,15 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6330
6330
  measurer: r,
6331
6331
  itemGap: s
6332
6332
  }) => {
6333
- if (Fo(e)) {
6333
+ if (_o(e)) {
6334
6334
  const i = Om(t.panel, e.innerRadius), c = Rm({
6335
6335
  size: e.size,
6336
6336
  availableWidth: i.width,
6337
- measureStripWidth: Ro(e, r)
6337
+ measureStripWidth: No(e, r)
6338
6338
  });
6339
6339
  return c === null ? null : { rect: i, resolvedSize: c, visibleItemCount: 1 };
6340
6340
  }
6341
- const o = _o(e, n.width, r);
6341
+ const o = Ro(e, n.width, r);
6342
6342
  if (e.formatted.kind !== "perGroup") return { rect: t.headline, resolvedSize: o, visibleItemCount: 1 };
6343
6343
  const a = Nm({
6344
6344
  itemWidths: r.measureHeadlineItemWidths(e.formatted, o),
@@ -6346,10 +6346,10 @@ const Cn = "–", vo = "n/a", N = { timeZone: "UTC" }, R = (e) => (t) => {
6346
6346
  availableWidth: t.headline.width
6347
6347
  });
6348
6348
  return a === 0 ? null : { rect: t.headline, resolvedSize: o, visibleItemCount: a };
6349
- }, Fo = (e) => e.formatted.kind === "grandTotal" && e.position === "center" && e.innerRadius > 0, Om = (e, t) => {
6349
+ }, _o = (e) => e.formatted.kind === "grandTotal" && e.position === "center" && e.innerRadius > 0, Om = (e, t) => {
6350
6350
  const n = Math.min(e.width, e.height) / 2, r = t * n * Math.SQRT2, s = e.x + e.width / 2, o = e.y + e.height / 2;
6351
6351
  return { x: s - r / 2, y: o - r / 2, width: r, height: r };
6352
- }, _o = (e, t, n) => _m({ size: e.size, availableWidth: t, measureStripWidth: Ro(e, n) }), Ro = (e, t) => (n) => t.measureHeadline(e.formatted, n).width, Re = { x: 0, y: 0, width: 0, height: 0 }, $m = "0000";
6352
+ }, Ro = (e, t, n) => _m({ size: e.size, availableWidth: t, measureStripWidth: No(e, n) }), No = (e, t) => (n) => t.measureHeadline(e.formatted, n).width, Re = { x: 0, y: 0, width: 0, height: 0 }, $m = "0000";
6353
6353
  class dg {
6354
6354
  constructor(t) {
6355
6355
  this.measurer = t;
@@ -6363,48 +6363,80 @@ class dg {
6363
6363
  externalMeasurements: t.externalMeasurements,
6364
6364
  annotationOverflow: Wn,
6365
6365
  headline: t.headline,
6366
- locale: t.formattingLocale ?? t.parsingLocale
6366
+ locale: t.formattingLocale ?? t.parsingLocale,
6367
+ padding: t.padding ?? Fo
6367
6368
  }).pipe(({ axes: n, numberFormat: r, locale: s }) => ({
6368
6369
  axisBundles: n.map((o) => ({
6369
6370
  axis: o,
6370
6371
  resolveFormatter: Bm(o, s, r),
6371
6372
  formatted: this.seedAxis(o)
6372
6373
  }))
6373
- })).pipe(({ axisBundles: n, formattedLegends: r, containerSize: s, externalMeasurements: o, annotationOverflow: a, headline: i }) => ({
6374
- layout: this.resolveLayout({
6375
- axes: n.map((c) => c.formatted),
6374
+ })).pipe(
6375
+ ({
6376
+ axisBundles: n,
6376
6377
  formattedLegends: r,
6377
6378
  containerSize: s,
6378
6379
  externalMeasurements: o,
6379
6380
  annotationOverflow: a,
6380
- headline: i
6381
+ headline: i,
6382
+ padding: c
6383
+ }) => ({
6384
+ layout: this.resolveLayout({
6385
+ axes: n.map((l) => l.formatted),
6386
+ formattedLegends: r,
6387
+ containerSize: s,
6388
+ externalMeasurements: o,
6389
+ annotationOverflow: a,
6390
+ headline: i,
6391
+ padding: c
6392
+ })
6381
6393
  })
6382
- })).pipe(({ axisBundles: n, layout: r }) => ({
6394
+ ).pipe(({ axisBundles: n, layout: r }) => ({
6383
6395
  axisBundles: n.map(
6384
6396
  (s) => is(s.axis.position) ? { ...s, formatted: this.finalizeAxis(s.axis, s.resolveFormatter, r.panel) } : s
6385
6397
  )
6386
- })).pipe(({ axisBundles: n, formattedLegends: r, containerSize: s, externalMeasurements: o, annotationOverflow: a, headline: i }) => ({
6387
- layout: this.resolveLayout({
6388
- axes: n.map((c) => c.formatted),
6398
+ })).pipe(
6399
+ ({
6400
+ axisBundles: n,
6389
6401
  formattedLegends: r,
6390
6402
  containerSize: s,
6391
6403
  externalMeasurements: o,
6392
6404
  annotationOverflow: a,
6393
- headline: i
6405
+ headline: i,
6406
+ padding: c
6407
+ }) => ({
6408
+ layout: this.resolveLayout({
6409
+ axes: n.map((l) => l.formatted),
6410
+ formattedLegends: r,
6411
+ containerSize: s,
6412
+ externalMeasurements: o,
6413
+ annotationOverflow: a,
6414
+ headline: i,
6415
+ padding: c
6416
+ })
6394
6417
  })
6395
- })).pipe(({ axisBundles: n, layout: r }) => ({
6418
+ ).pipe(({ axisBundles: n, layout: r }) => ({
6396
6419
  formattedAxes: n.map(
6397
6420
  (s) => is(s.axis.position) ? s.formatted : this.finalizeAxis(s.axis, s.resolveFormatter, r.panel)
6398
6421
  )
6399
6422
  })).pipe(
6400
- ({ formattedAxes: n, formattedLegends: r, containerSize: s, externalMeasurements: o, annotationOverflow: a, headline: i }) => ({
6423
+ ({
6424
+ formattedAxes: n,
6425
+ formattedLegends: r,
6426
+ containerSize: s,
6427
+ externalMeasurements: o,
6428
+ annotationOverflow: a,
6429
+ headline: i,
6430
+ padding: c
6431
+ }) => ({
6401
6432
  layout: this.resolveLayout({
6402
6433
  axes: n,
6403
6434
  formattedLegends: r,
6404
6435
  containerSize: s,
6405
6436
  externalMeasurements: o,
6406
6437
  annotationOverflow: a,
6407
- headline: i
6438
+ headline: i,
6439
+ padding: c
6408
6440
  })
6409
6441
  })
6410
6442
  ).pipe(
@@ -6416,18 +6448,20 @@ class dg {
6416
6448
  layout: a,
6417
6449
  annotationOverflow: i,
6418
6450
  headline: c,
6419
- locale: l
6451
+ locale: l,
6452
+ padding: u
6420
6453
  }) => {
6421
- const u = this.measureAnnotationOverflow(t, a.panel, l, i);
6422
- return u === i ? { formattedAxes: n, layout: a } : {
6454
+ const d = this.measureAnnotationOverflow(t, a.panel, l, i);
6455
+ return d === i ? { formattedAxes: n, layout: a } : {
6423
6456
  formattedAxes: n,
6424
6457
  layout: this.resolveLayout({
6425
6458
  axes: n,
6426
6459
  formattedLegends: r,
6427
6460
  containerSize: s,
6428
6461
  externalMeasurements: o,
6429
- annotationOverflow: u,
6430
- headline: c
6462
+ annotationOverflow: d,
6463
+ headline: c,
6464
+ padding: u
6431
6465
  })
6432
6466
  };
6433
6467
  }
@@ -6463,7 +6497,7 @@ class dg {
6463
6497
  };
6464
6498
  }
6465
6499
  finalizeAxis(t, n, r) {
6466
- const o = t.position === "top" || t.position === "bottom" ? r.width : r.height, a = vm({
6500
+ const o = t.position === "top" || t.position === "bottom" ? r.width : r.height, a = xm({
6467
6501
  axis: t,
6468
6502
  availableSpacePx: o,
6469
6503
  measureLabel: this.measurer.measureTickLabel,
@@ -6471,7 +6505,7 @@ class dg {
6471
6505
  }), { tickCandidates: i, ...c } = t, l = { ...c, ticks: a, labelRotation: 0, labelMaxWidthPx: null };
6472
6506
  if (t.scaleType === "discrete" && t.bandwidth !== void 0) {
6473
6507
  const u = t.bandwidth * o;
6474
- return hm({
6508
+ return ym({
6475
6509
  formattedAxis: l,
6476
6510
  bandwidthPx: u,
6477
6511
  panelRect: r,
@@ -6486,18 +6520,19 @@ class dg {
6486
6520
  containerSize: r,
6487
6521
  externalMeasurements: s,
6488
6522
  annotationOverflow: o,
6489
- headline: a
6523
+ headline: a,
6524
+ padding: i
6490
6525
  }) {
6491
- const i = this.measureGuides(t, n, a, r), c = Em(r, s, i, o), l = Am(c);
6526
+ const c = this.measureGuides(t, n, a, r), l = Em(r, s, c, o, i), u = Tm(l);
6492
6527
  return {
6493
- header: l.get("header") ?? Re,
6494
- headline: l.get("headline") ?? Re,
6495
- footer: l.get("footer") ?? Re,
6496
- plot: l.get("plot") ?? Re,
6497
- panel: l.get("panel") ?? Re,
6498
- axes: en(l, "Axis"),
6499
- axisLabels: en(l, "AxisLabel"),
6500
- legends: en(l, "Legend")
6528
+ header: u.get("header") ?? Re,
6529
+ headline: u.get("headline") ?? Re,
6530
+ footer: u.get("footer") ?? Re,
6531
+ plot: u.get("plot") ?? Re,
6532
+ panel: u.get("panel") ?? Re,
6533
+ axes: en(u, "Axis"),
6534
+ axisLabels: en(u, "AxisLabel"),
6535
+ legends: en(u, "Legend")
6501
6536
  };
6502
6537
  }
6503
6538
  /**
@@ -6687,18 +6722,18 @@ const Te = (e) => `${Number.parseFloat((e * 100).toFixed(4))}%`, Hn = 12, Wm = 4
6687
6722
  if (d === null) continue;
6688
6723
  const p = s(u);
6689
6724
  if (p === "") continue;
6690
- const { width: m, height: y } = r("dataLabel", p), g = No(d, n);
6725
+ const { width: m, height: y } = r("dataLabel", p), g = Po(d, n);
6691
6726
  m > g.width && (c = !0);
6692
6727
  const b = l === null ? null : u[l], x = I(b) && b < 0;
6693
6728
  i.push({ key: a(u), isNegative: x, text: p, labelWidth: m, labelHeight: y, bounds: g });
6694
6729
  }
6695
6730
  return { entries: i, shouldRotate: !o && c };
6696
- }, No = (e, t) => ({
6731
+ }, Po = (e, t) => ({
6697
6732
  x: e.x * t.width,
6698
6733
  y: e.y * t.height,
6699
6734
  width: e.width * t.width,
6700
6735
  height: e.height * t.height
6701
- }), Po = (e, t, n, r, s) => {
6736
+ }), Oo = (e, t, n, r, s) => {
6702
6737
  if (e === "x") {
6703
6738
  let i = 1 - s, c = s - r;
6704
6739
  return c < 0 && (i += c, c = -c), { x: t, y: i, width: n - t, height: c };
@@ -6707,11 +6742,11 @@ const Te = (e) => `${Number.parseFloat((e * 100).toFixed(4))}%`, Hn = 12, Wm = 4
6707
6742
  return a < 0 && (o += a, a = -a), { x: o, y: 1 - s, width: a, height: s - r };
6708
6743
  }, jm = (e, t) => {
6709
6744
  const n = ge(t), r = ie(t), s = se(t), o = H(t) ?? C(t);
6710
- return n === null || r === null || s === null || o === null ? null : Po(e, n, r, s, o);
6745
+ return n === null || r === null || s === null || o === null ? null : Oo(e, n, r, s, o);
6711
6746
  }, qm = (e, t) => {
6712
6747
  const { xMin: n, xMax: r, yMin: s, yMax: o } = t.anchor;
6713
- return Po(e, n, r, s, o);
6714
- }, Qm = (e, t) => e === "x" ? t ? "bottom" : "top" : t ? "left" : "right", Oo = (e, t, n) => n ? { width: t, height: e } : { width: e, height: t }, Zm = (e) => e.isStacked ? Jm({
6748
+ return Oo(e, n, r, s, o);
6749
+ }, Qm = (e, t) => e === "x" ? t ? "bottom" : "top" : t ? "left" : "right", $o = (e, t, n) => n ? { width: t, height: e } : { width: e, height: t }, Zm = (e) => e.isStacked ? Jm({
6715
6750
  bounds: e.bounds,
6716
6751
  labelWidth: e.labelWidth,
6717
6752
  labelHeight: e.labelHeight,
@@ -6730,7 +6765,7 @@ const Te = (e) => `${Number.parseFloat((e * 100).toFixed(4))}%`, Hn = 12, Wm = 4
6730
6765
  labelHeight: n,
6731
6766
  isRotated: r
6732
6767
  }) => {
6733
- const s = Oo(t, n, r);
6768
+ const s = $o(t, n, r);
6734
6769
  return s.width > e.width || s.height > e.height ? null : { x: e.x + e.width / 2, y: e.y + e.height / 2, isRotated: r, position: "inside" };
6735
6770
  }, ef = (e, t, n, r) => {
6736
6771
  switch (e) {
@@ -6752,7 +6787,7 @@ const Te = (e) => `${Number.parseFloat((e * 100).toFixed(4))}%`, Hn = 12, Wm = 4
6752
6787
  panelWidth: o,
6753
6788
  panelHeight: a
6754
6789
  }) => {
6755
- const i = e === "top" || e === "bottom", c = t.x + t.width / 2, l = t.y + t.height / 2, u = Oo(n, r, s), d = i ? u.height : u.width, p = i ? u.width : u.height, m = i ? t.height : t.width, y = i ? t.width : t.height, g = d / 2, { edgeCoord: b, outwardSign: x, panelExtent: S } = ef(e, t, o, a);
6790
+ const i = e === "top" || e === "bottom", c = t.x + t.width / 2, l = t.y + t.height / 2, u = $o(n, r, s), d = i ? u.height : u.width, p = i ? u.width : u.height, m = i ? t.height : t.width, y = i ? t.width : t.height, g = d / 2, { edgeCoord: b, outwardSign: x, panelExtent: S } = ef(e, t, o, a);
6756
6791
  if (d + tn < m) {
6757
6792
  if (p > y) return null;
6758
6793
  if (s) return { x: c, y: l, isRotated: !0, position: "inside" };
@@ -6780,7 +6815,7 @@ const Te = (e) => `${Number.parseFloat((e * 100).toFixed(4))}%`, Hn = 12, Wm = 4
6780
6815
  if (a === void 0 || a.length === 0) return o;
6781
6816
  const i = t === "y";
6782
6817
  for (const c of a) {
6783
- const l = No(qm(t, c), n), u = s(c.total), { width: d, height: p } = r("stackTotal", u), m = c.anchor.direction === "positive";
6818
+ const l = Po(qm(t, c), n), u = s(c.total), { width: d, height: p } = r("stackTotal", u), m = c.anchor.direction === "positive";
6784
6819
  let y, g;
6785
6820
  i ? (y = m ? l.x + l.width + lt + d / 2 : l.x - lt - d / 2, g = l.y + l.height / 2) : (y = l.x + l.width / 2, g = m ? l.y - lt - p / 2 : l.y + l.height + lt + p / 2), o.push({
6786
6821
  layerId: e.id,
@@ -6830,7 +6865,7 @@ const Te = (e) => `${Number.parseFloat((e * 100).toFixed(4))}%`, Hn = 12, Wm = 4
6830
6865
  if (r === null || s === null || r < 0 || r > 1 || s < 0 || s > 1) continue;
6831
6866
  const o = e.formatLabel(n);
6832
6867
  if (o === "") continue;
6833
- const { width: a, height: i } = e.measureDataLabel("dataLabel", o), c = (_a(n) ?? e.layer.params.size) / 2, l = r * e.panelRect.width, u = (1 - s) * e.panelRect.height - c - Hn - i / 2;
6868
+ const { width: a, height: i } = e.measureDataLabel("dataLabel", o), c = (Ra(n) ?? e.layer.params.size) / 2, l = r * e.panelRect.width, u = (1 - s) * e.panelRect.height - c - Hn - i / 2;
6834
6869
  t.push({
6835
6870
  layerId: e.layer.id,
6836
6871
  key: e.getObservationKey(n),
@@ -6892,7 +6927,7 @@ const uf = " · ", df = (e) => typeof e == "string" ? e : e instanceof Date ? e.
6892
6927
  place: mf,
6893
6928
  getPercentageValueStrategy: () => "absoluteGrandTotal"
6894
6929
  }, hf = { type: "decimal" };
6895
- function $o({
6930
+ function Bo({
6896
6931
  layer: e,
6897
6932
  numberFormat: t,
6898
6933
  locale: n
@@ -6910,7 +6945,7 @@ const yf = ({
6910
6945
  formattingLocale: a,
6911
6946
  percentageValueStrategy: i
6912
6947
  }) => {
6913
- const c = $o({
6948
+ const c = Bo({
6914
6949
  layer: e,
6915
6950
  numberFormat: r,
6916
6951
  locale: a
@@ -6986,7 +7021,7 @@ const yf = ({
6986
7021
  valueFormat: { type: "percentage" },
6987
7022
  locale: r,
6988
7023
  numberFormat: t
6989
- }), u = e.dataLabels.format === "percentage" && Bo(e);
7024
+ }), u = e.dataLabels.format === "percentage" && zo(e);
6990
7025
  return (d) => {
6991
7026
  const p = a(d);
6992
7027
  if (p === null) return "";
@@ -7003,7 +7038,7 @@ const yf = ({
7003
7038
  }) => {
7004
7039
  const o = e.dataLabels.labelSource, a = v(o);
7005
7040
  if (a !== null) {
7006
- if (Bo(e)) return s;
7041
+ if (zo(e)) return s;
7007
7042
  const i = Af(e, n, t, r, a);
7008
7043
  if (i !== null) return i;
7009
7044
  }
@@ -7012,7 +7047,7 @@ const yf = ({
7012
7047
  locale: r,
7013
7048
  numberFormat: t
7014
7049
  });
7015
- }, Bo = (e) => {
7050
+ }, zo = (e) => {
7016
7051
  const t = v(e.dataLabels.labelSource);
7017
7052
  return t === null ? !1 : t === v(Mn(e.position, e.mapping));
7018
7053
  }, Af = (e, t, n, r, s) => {
@@ -7027,7 +7062,7 @@ const yf = ({
7027
7062
  }, Tf = (e, t) => {
7028
7063
  const n = ae(t);
7029
7064
  if (n !== void 0)
7030
- return typeof n == "number" ? { type: "decimal" } : ka(n) ? { type: "date" } : { type: "text" };
7065
+ return typeof n == "number" ? { type: "decimal" } : Ia(n) ? { type: "date" } : { type: "text" };
7031
7066
  const r = v(t);
7032
7067
  return r === null || !e.hasVariable(r) ? { type: "text" } : e.getValueFormat(r);
7033
7068
  }, Mf = {
@@ -7233,7 +7268,7 @@ function xg(e, t) {
7233
7268
  const Sg = ({ guides: e, numberFormat: t, layer: n, locale: r }) => {
7234
7269
  const s = n.data.getFirst();
7235
7270
  if (!s) return null;
7236
- const o = n.mapping.y !== void 0, i = (o ? xl : Tn)(n.data, n.mapping)(s);
7271
+ const o = n.mapping.y !== void 0, i = (o ? Sl : Tn)(n.data, n.mapping)(s);
7237
7272
  if (i === null) return null;
7238
7273
  const c = o ? qe(n.yScaleType) : "x", l = Un(e, c)?.valueFormat ?? { type: "decimal" };
7239
7274
  return P({ valueFormat: l, locale: r, numberFormat: t })(i);
@@ -7322,7 +7357,7 @@ const Sg = ({ guides: e, numberFormat: t, layer: n, locale: r }) => {
7322
7357
  dashOffset: th(s, c),
7323
7358
  arrowheadExtent: d
7324
7359
  };
7325
- }, rh = (e, t) => Math.min(e, t * e / nh), sh = 2, zo = (e) => e === "catmull-rom" ? Sa : wa, Tg = (e) => {
7360
+ }, rh = (e, t) => Math.min(e, t * e / nh), sh = 2, Go = (e) => e === "catmull-rom" ? wa : Aa, Tg = (e) => {
7326
7361
  switch (e) {
7327
7362
  case "dashed":
7328
7363
  return "8 4";
@@ -7331,8 +7366,8 @@ const Sg = ({ guides: e, numberFormat: t, layer: n, locale: r }) => {
7331
7366
  case "solid":
7332
7367
  return;
7333
7368
  }
7334
- }, Mg = (e, t) => t.lineWidth !== "auto" ? t.lineWidth : Ra(e) ?? sh, Lg = (e, t) => {
7335
- const n = zo(t.interpolate), r = Aa().curve(n), s = vs().curve(n);
7369
+ }, Mg = (e, t) => t.lineWidth !== "auto" ? t.lineWidth : Na(e) ?? sh, Lg = (e, t) => {
7370
+ const n = Go(t.interpolate), r = Ta().curve(n), s = vs().curve(n);
7336
7371
  if (e.mainAxis === "y") {
7337
7372
  const o = (c) => Ve(C(c) ?? 0), a = (c) => ge(c) ?? 0, i = (c) => ie(c) ?? G(c) ?? 0;
7338
7373
  r.y(o).x0(a).x1(i), s.y(o).x(i);
@@ -7355,16 +7390,16 @@ const Sg = ({ guides: e, numberFormat: t, layer: n, locale: r }) => {
7355
7390
  let a = n, i = r - n;
7356
7391
  return i < 0 && (a += i, i = -i), { x: a, y: 1 - o, width: i, height: o - s };
7357
7392
  }, kg = (e) => {
7358
- const t = vs().x((n) => G(n) ?? 0).y((n) => Ve(C(n) ?? 0)).curve(zo(e.interpolate));
7393
+ const t = vs().x((n) => G(n) ?? 0).y((n) => Ve(C(n) ?? 0)).curve(Go(e.interpolate));
7359
7394
  return e.missingValues === "gap" && t.defined((n) => G(n) !== null && C(n) !== null), t;
7360
- }, Ig = (e, t) => t !== "connect" ? e : e.filter((n) => G(n) !== null && C(n) !== null), oh = Ta(), Cg = (e) => oh(e), Dg = (e, t, n) => {
7395
+ }, Ig = (e, t) => t !== "connect" ? e : e.filter((n) => G(n) !== null && C(n) !== null), oh = Ma(), Cg = (e) => oh(e), Dg = (e, t, n) => {
7361
7396
  const r = Tn(e, t);
7362
7397
  return (s) => {
7363
7398
  const o = ke(s) ?? "default", a = r(s);
7364
7399
  return `${n}-${o}${a !== null && a !== "" ? `-${a}` : ""}`;
7365
7400
  };
7366
7401
  }, Fg = () => (e, t) => mn(e) ?? `default-${t}`;
7367
- function Go(e, t) {
7402
+ function Wo(e, t) {
7368
7403
  return Kn(e.buckets, t, (n) => n.main);
7369
7404
  }
7370
7405
  function ah(e, t) {
@@ -7483,7 +7518,7 @@ function yh(e, t, n) {
7483
7518
  function gh(e, t, n) {
7484
7519
  switch (t.kind) {
7485
7520
  case "buckets": {
7486
- const r = Go(t, He(t.mainAxis, n));
7521
+ const r = Wo(t, He(t.mainAxis, n));
7487
7522
  if (!r) return;
7488
7523
  const s = vt(e, t.layerId);
7489
7524
  for (const o of r.entries)
@@ -7650,10 +7685,10 @@ function Th(e, t) {
7650
7685
  delaunay: null,
7651
7686
  delaunayAspectRatio: null
7652
7687
  };
7653
- return Wo(n, t), n;
7688
+ return Yo(n, t), n;
7654
7689
  }
7655
- function Wo(e, t) {
7656
- e.delaunay && e.delaunayAspectRatio === t || (e.delaunay = Ma.from(
7690
+ function Yo(e, t) {
7691
+ e.delaunay && e.delaunayAspectRatio === t || (e.delaunay = La.from(
7657
7692
  e.points,
7658
7693
  (n) => n.x * t,
7659
7694
  (n) => n.y
@@ -7781,7 +7816,7 @@ function Dh(e, t) {
7781
7816
  }
7782
7817
  function Fh(e, t, n) {
7783
7818
  if (e.buckets.length === 0) return null;
7784
- const { main: r, cross: s } = Gm(e.mainAxis, t), o = Go(e, r), a = o?.entries ?? [];
7819
+ const { main: r, cross: s } = Gm(e.mainAxis, t), o = Wo(e, r), a = o?.entries ?? [];
7785
7820
  if (!o || !pn(a)) return null;
7786
7821
  const i = Ph(a, s, e.mainAxis);
7787
7822
  return {
@@ -7817,7 +7852,7 @@ function _h(e, t, n) {
7817
7852
  // Distance to the rect itself (not the centroid): zero when the cursor is inside, else the
7818
7853
  // aspect-corrected Euclidean distance to the nearest rect edge. Matches hit-test's intent
7819
7854
  // that a dense bar should win over a line whose nearest point is also near the cursor.
7820
- distance: Yo(a, t, n)
7855
+ distance: Ho(a, t, n)
7821
7856
  };
7822
7857
  }
7823
7858
  function Rh(e, t, n) {
@@ -7825,7 +7860,7 @@ function Rh(e, t, n) {
7825
7860
  return qn(e, (o) => Oh(o, n, r), { shortCircuitOnZero: !0 });
7826
7861
  }
7827
7862
  function Nh(e, t, n) {
7828
- return qn(e, (s) => Yo(s, t, n));
7863
+ return qn(e, (s) => Ho(s, t, n));
7829
7864
  }
7830
7865
  function Ph(e, t, n) {
7831
7866
  return qn(e, (s) => Math.abs(Yn(n, s) - t));
@@ -7842,7 +7877,7 @@ function qn(e, t, { shortCircuitOnZero: n = !1 } = {}) {
7842
7877
  }
7843
7878
  return r;
7844
7879
  }
7845
- function Yo(e, t, n) {
7880
+ function Ho(e, t, n) {
7846
7881
  const r = dn(t.x, e.xMin, e.xMax), s = dn(t.y, e.yMin, e.yMax);
7847
7882
  return Xn(r, s, n);
7848
7883
  }
@@ -7945,7 +7980,7 @@ class _g {
7945
7980
  setViewport(t) {
7946
7981
  this.aspectRatio = t.width / t.height;
7947
7982
  for (const n of this.layerIndexes)
7948
- n.kind === "points" && Wo(n, this.aspectRatio);
7983
+ n.kind === "points" && Yo(n, this.aspectRatio);
7949
7984
  }
7950
7985
  /**
7951
7986
  * Synchronous query. The `cursor` is the pointer normalized to `[0, 1]` against the **same rect
@@ -8141,13 +8176,13 @@ function Qh(e) {
8141
8176
  for (const s of e.layers) {
8142
8177
  const o = Zh(s, e.hover);
8143
8178
  if (o.length === 0) continue;
8144
- const a = Sl(s.data, s.mapping), i = Jh(o, s, n, a), c = $o({
8179
+ const a = wl(s.data, s.mapping), i = Jh(o, s, n, a), c = Bo({
8145
8180
  layer: s,
8146
8181
  numberFormat: e.numberFormat,
8147
8182
  locale: e.locale
8148
8183
  }), l = ty(e.guides, s), u = Ln(s), d = s.mapping.color !== void 0, p = St(s.geom, e.coordSystem);
8149
8184
  for (const m of i) {
8150
- const y = d ? a(m.observation) : null, g = mn(m.observation) ?? null, b = Na(m.observation), x = d && y !== null ? r(y) : l, S = u(m.observation), w = S === null ? "" : c(S, m.observation);
8185
+ const y = d ? a(m.observation) : null, g = mn(m.observation) ?? null, b = Pa(m.observation), x = d && y !== null ? r(y) : l, S = u(m.observation), w = S === null ? "" : c(S, m.observation);
8151
8186
  t.push({
8152
8187
  swatchColor: g,
8153
8188
  swatchShape: p,
@@ -8231,15 +8266,15 @@ function zg(...e) {
8231
8266
  highlights: [],
8232
8267
  config: {}
8233
8268
  };
8234
- return n.reduce((a, i) => Ho(a, i), o);
8269
+ return n.reduce((a, i) => Uo(a, i), o);
8235
8270
  }
8236
8271
  function Gg(e, ...t) {
8237
- return t.reduce((n, r) => Ho(n, r), e);
8272
+ return t.reduce((n, r) => Uo(n, r), e);
8238
8273
  }
8239
8274
  function ny(e) {
8240
8275
  return typeof e == "object" && e !== null && "type" in e;
8241
8276
  }
8242
- function Ho(e, t) {
8277
+ function Uo(e, t) {
8243
8278
  switch (t.type) {
8244
8279
  case "scale":
8245
8280
  return { ...e, scales: [...e.scales, t] };
@@ -8703,14 +8738,14 @@ class Mt {
8703
8738
  const r = this.findAssociatedPointLayer(t, n);
8704
8739
  if (!r)
8705
8740
  return null;
8706
- const s = np(t, r.id), o = new Mt(
8741
+ const s = rp(t, r.id), o = new Mt(
8707
8742
  { layerId: n.id, showPoints: !0, removedLayer: r },
8708
8743
  this.metadata
8709
8744
  );
8710
8745
  return { spec: s, revert: o };
8711
8746
  }
8712
8747
  findAssociatedPointLayer(t, n) {
8713
- return t.layers.find((r) => r.geom === "point" && La(r.mapping, n.mapping));
8748
+ return t.layers.find((r) => r.geom === "point" && Va(r.mapping, n.mapping));
8714
8749
  }
8715
8750
  }
8716
8751
  const Vy = {
@@ -8987,7 +9022,7 @@ class Yg {
8987
9022
  }
8988
9023
  }
8989
9024
  }
8990
- const Uo = 500, Ko = "normal", Xo = {
9025
+ const Ko = 500, Xo = "normal", jo = {
8991
9026
  thin: 100,
8992
9027
  hairline: 100,
8993
9028
  extraLight: 200,
@@ -9006,9 +9041,9 @@ const Uo = 500, Ko = "normal", Xo = {
9006
9041
  extraBlack: 950,
9007
9042
  ultraBlack: 950
9008
9043
  }, Hg = (e) => {
9009
- const t = e.style ?? Ko, n = e.weight ?? Uo, r = e.family.includes(",") ? e.family : `'${e.family}'`;
9044
+ const t = e.style ?? Xo, n = e.weight ?? Ko, r = e.family.includes(",") ? e.family : `'${e.family}'`;
9010
9045
  return `${t} ${n} ${e.size}px ${r}`;
9011
- }, Ug = (e) => typeof e == "string" ? e : jo(e), jo = (e) => e.text !== void 0 ? e.text : e.content ? e.content.map(jo).join("") : "", qo = (e) => typeof e != "string" ? e ?? Uo : Xo[e], Fy = "\0";
9046
+ }, Ug = (e) => typeof e == "string" ? e : qo(e), qo = (e) => e.text !== void 0 ? e.text : e.content ? e.content.map(qo).join("") : "", Qo = (e) => typeof e != "string" ? e ?? Ko : jo[e], Fy = "\0";
9012
9047
  class Kg {
9013
9048
  constructor(t) {
9014
9049
  this.inner = t, this.cache = /* @__PURE__ */ new Map();
@@ -9021,7 +9056,7 @@ class Kg {
9021
9056
  return this.cache.set(r, o), o;
9022
9057
  }
9023
9058
  getCacheKey(t, n) {
9024
- return [n.family, n.size, qo(n.weight), n.style ?? Ko, t].join(Fy);
9059
+ return [n.family, n.size, Qo(n.weight), n.style ?? Xo, t].join(Fy);
9025
9060
  }
9026
9061
  }
9027
9062
  const _y = {
@@ -9126,7 +9161,7 @@ class Xg {
9126
9161
  let r = 0;
9127
9162
  for (const i of t)
9128
9163
  r += (_y[i] ?? Ry) * n.size;
9129
- qo(n.weight) >= Xo.semiBold && (r *= Ny);
9164
+ Qo(n.weight) >= jo.semiBold && (r *= Ny);
9130
9165
  const o = Py * n.size, a = Oy * n.size;
9131
9166
  return {
9132
9167
  width: r,
@@ -9137,15 +9172,15 @@ class Xg {
9137
9172
  }
9138
9173
  }
9139
9174
  export {
9140
- Ou as BORDER_PRESETS,
9175
+ $u as BORDER_PRESETS,
9141
9176
  $g as BORDER_PRESET_GRADIENTS,
9142
9177
  ig as COMPILER_STAGE_KEYS,
9143
9178
  Kg as CachedTextMeasurer,
9144
9179
  Dy as CommandRegistry,
9145
9180
  Yg as CommandStackManager,
9146
- $p as Compiler,
9147
- Ko as DEFAULT_FONT_STYLE,
9148
- Uo as DEFAULT_FONT_WEIGHT,
9181
+ Bp as Compiler,
9182
+ Xo as DEFAULT_FONT_STYLE,
9183
+ Ko as DEFAULT_FONT_WEIGHT,
9149
9184
  sh as DEFAULT_LINE_WIDTH,
9150
9185
  fn as DEFAULT_LOCALE,
9151
9186
  E as Dataset,
@@ -9157,11 +9192,11 @@ export {
9157
9192
  Gf as HEADLINE_VALUE_LABEL_GAP,
9158
9193
  Xg as HeuristicTextMeasurer,
9159
9194
  _g as HoverEngine,
9160
- Vm as LAYOUT_PADDING,
9195
+ Fo as LAYOUT_PADDING,
9161
9196
  dg as LayoutCompiler,
9162
- eu as MONO_BASES,
9163
- Xo as NAMED_WEIGHTS,
9164
- tu as NEON_BASES,
9197
+ tu as MONO_BASES,
9198
+ jo as NAMED_WEIGHTS,
9199
+ nu as NEON_BASES,
9165
9200
  f as POSITION_VARIABLES,
9166
9201
  pt as RESTING_HOVER_STATE,
9167
9202
  Jn as SetAxisPositionCommand,
@@ -9171,26 +9206,26 @@ export {
9171
9206
  cr as SetHeadlineShowCommand,
9172
9207
  fr as SetLineWidthCommand,
9173
9208
  yr as SetScaleDomainCommand,
9174
- up as SpecResolver,
9209
+ dp as SpecResolver,
9175
9210
  ye as VISUAL_VARIABLES,
9176
9211
  pg as buildAverageLineSymbols,
9177
9212
  hg as buildDataLabelsContent,
9178
9213
  Hg as buildFontString,
9179
- $o as buildLayerYValueFormatter,
9214
+ Bo as buildLayerYValueFormatter,
9180
9215
  Cg as buildPolarBarArcPath,
9181
9216
  Og as buildTooltipContent,
9182
9217
  L as commandRegistry,
9183
9218
  yg as computeDifferenceArrow,
9184
9219
  gg as computeDirectLabelsLayout,
9185
9220
  Ag as computeFreeformArrow,
9186
- $u as config,
9221
+ Bu as config,
9187
9222
  Wg as convertSpecToInput,
9188
9223
  z as coord,
9189
9224
  sg as createAlphaValueReader,
9190
9225
  Lg as createAreaPathGenerators,
9191
- Sl as createColorValueReader,
9226
+ wl as createColorValueReader,
9192
9227
  cg as createCompiler,
9193
- Ll as createEmptyHighlight,
9228
+ Vl as createEmptyHighlight,
9194
9229
  og as createGroupValueReader,
9195
9230
  wg as createHeadlineItemRows,
9196
9231
  ng as createLabelValueReader,
@@ -9203,7 +9238,7 @@ export {
9203
9238
  ag as createStrokeWidthValueReader,
9204
9239
  P as createValueFormatter,
9205
9240
  Tn as createXValueReader,
9206
- xl as createYValueReader,
9241
+ Sl as createYValueReader,
9207
9242
  Ug as extractPlainText,
9208
9243
  Un as findAxisGuide,
9209
9244
  xg as findLegendForAesthetic,
@@ -9216,36 +9251,36 @@ export {
9216
9251
  Eg as getBarRectBounds,
9217
9252
  mn as getColor,
9218
9253
  Yn as getCrossAxisCoordinate,
9219
- zo as getCurve,
9254
+ Go as getCurve,
9220
9255
  Tg as getDashArray,
9221
9256
  Io as getDifferenceArrowDimensions,
9222
9257
  ke as getGroup,
9223
9258
  Rg as getHoverGuideLineProps,
9224
9259
  Ng as getHoverGuideRectProps,
9225
- Na as getLineType,
9260
+ Pa as getLineType,
9226
9261
  He as getMainAxisCoordinate,
9227
- qo as getNumericWeight,
9262
+ Qo as getNumericWeight,
9228
9263
  lf as getRadiusExtent,
9229
- _a as getSize,
9264
+ Ra as getSize,
9230
9265
  Fg as getStablePolarBarKeyGenerator,
9231
- Ra as getStrokeWidth,
9266
+ Na as getStrokeWidth,
9232
9267
  G as getX,
9233
9268
  ie as getXMax,
9234
9269
  ge as getXMin,
9235
9270
  C as getY,
9236
9271
  H as getYMax,
9237
9272
  se as getYMin,
9238
- Fa as getYRaw,
9273
+ _a as getYRaw,
9239
9274
  Bg as highlight,
9240
9275
  mg as isCartesian,
9241
- xi as isCategoricalValueFormat,
9276
+ Si as isCategoricalValueFormat,
9242
9277
  Jy as isCompilerCachingEnabled,
9243
9278
  ks as isCurrencyValueFormat,
9244
9279
  Is as isDateWithoutYearValueFormat,
9245
9280
  h as isDefined,
9246
- hu as isGraphConfig,
9281
+ yu as isGraphConfig,
9247
9282
  lg as isLayerOf,
9248
- vi as isLookupValueFormat,
9283
+ xi as isLookupValueFormat,
9249
9284
  Es as isNumericValueFormat,
9250
9285
  Pg as isSafeUrl,
9251
9286
  J as isStackedPosition,