@graphysdk/viz-engine 1.8.1-beta.1786025839240 → 1.8.1-beta.1786352280463

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.
@@ -1,19 +1,19 @@
1
- import { differenceInDays as Re, isBefore as Ce, isValid as f, isWithinInterval as Le, parse as N } from "date-fns";
2
- import { isEqual as Ie, isInteger as Ve } from "lodash-es";
3
- import { desc as xe, op as re, table as O } from "arquero";
4
- var vr = (e) => e.length > 0;
5
- function ae(e) {
1
+ import { differenceInDays as Le, isBefore as Ce, isValid as f, isWithinInterval as Ie, parse as N } from "date-fns";
2
+ import { isEqual as Ve, isInteger as xe } from "lodash-es";
3
+ import { desc as Be, op as ae, table as O } from "arquero";
4
+ var Tr = (e) => e.length > 0;
5
+ function ne(e) {
6
6
  return e != null;
7
7
  }
8
- function Mr(e) {
8
+ function Ar(e) {
9
9
  if (e === null || typeof e != "object") return !1;
10
10
  const t = Object.getPrototypeOf(e);
11
11
  return t === Object.prototype || t === null;
12
12
  }
13
- var ne = "\0graphy\0_", c = (e) => `${ne}${e}`, Be = { x: c("constantX") }, se = {
13
+ var se = "\0graphy\0_", c = (e) => `${se}${e}`, je = { x: c("constantX") }, oe = {
14
14
  count: c("count"),
15
15
  mean: c("mean")
16
- }, je = { group: c("group") }, Pe = {
16
+ }, Ue = { group: c("group") }, Pe = {
17
17
  x: c("x"),
18
18
  y: c("y"),
19
19
  xMin: c("xMin"),
@@ -21,40 +21,43 @@ var ne = "\0graphy\0_", c = (e) => `${ne}${e}`, Be = { x: c("constantX") }, se =
21
21
  yMin: c("yMin"),
22
22
  yMax: c("yMax"),
23
23
  yRaw: c("yRaw")
24
- }, Ue = { role: c("stackRole") }, $e = {
24
+ }, $e = { role: c("stackRole") }, Ye = {
25
25
  color: c("color"),
26
26
  size: c("size"),
27
27
  alpha: c("alpha"),
28
28
  strokeWidth: c("strokeWidth"),
29
29
  lineType: c("lineType")
30
- }, Ye = {
30
+ }, ze = {
31
31
  y: c("ruleY"),
32
32
  x: c("ruleX")
33
- }, Er = {
34
- ...Be,
35
- ...se,
33
+ }, Fr = {
36
34
  ...je,
37
- ...Pe,
35
+ ...oe,
38
36
  ...Ue,
37
+ ...Pe,
39
38
  ...$e,
40
- ...Ye
41
- }, ze = new Set(Object.values(se)), _r = (e) => c(`scaled_${e}`), Tr = (e) => e.startsWith(ne), Ar = (e) => ze.has(e);
42
- function Fr(e) {
43
- return {
44
- type: "mapping",
45
- mapping: e
46
- };
47
- }
48
- function Dr(e) {
49
- return ae(e) ? typeof e == "string" ? e : "variable" in e ? e.variable : null : null;
39
+ ...Ye,
40
+ ...ze
41
+ }, We = new Set(Object.values(oe)), Dr = (e) => c(`scaled_${e}`), Nr = (e) => e.startsWith(se), wr = (e) => We.has(e);
42
+ function Ge(e) {
43
+ return ne(e) ? typeof e == "string" ? e : "variable" in e ? e.variable : null : null;
50
44
  }
51
- function Nr(e) {
52
- if (!(!ae(e) || typeof e == "string") && "value" in e)
45
+ function Ke(e) {
46
+ if (!(!ne(e) || typeof e == "string") && "value" in e)
53
47
  return e.value;
54
48
  }
55
- var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (e) => typeof e == "string", We = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e), Or = (e) => We(e) || e === null, oe = (e) => (Array.isArray(e) ? e : [e]).map((t) => t instanceof Date ? t.toISOString() : String(t ?? "<null>")).join("\0"), kr = (e, t) => e === t ? !0 : G(e) && G(t) ? e.getTime() === t.getTime() : !1, D = process.env.NODE_ENV !== "production", j = !0, Rr = (e) => {
49
+ function Sr(e, t) {
50
+ return [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].every((r) => X(e[r]) === X(t[r]));
51
+ }
52
+ function X(e) {
53
+ const t = Ge(e);
54
+ if (t !== null) return `variable:${t}`;
55
+ const r = Ke(e);
56
+ return r === void 0 ? "" : r === null ? "value:null" : r instanceof Date ? `value:date:${r.getTime()}` : `value:${typeof r}:${r}`;
57
+ }
58
+ var G = (e) => e instanceof Date && f(e), Or = (e) => G(e) || e === null, Rr = (e) => typeof e == "string", He = (e) => typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e), kr = (e) => He(e) || e === null, ie = (e) => (Array.isArray(e) ? e : [e]).map((t) => t instanceof Date ? t.toISOString() : String(t ?? "<null>")).join("\0"), Lr = (e, t) => e === t ? !0 : G(e) && G(t) ? e.getTime() === t.getTime() : !1, D = process.env.NODE_ENV !== "production", j = !0, Cr = (e) => {
56
59
  j = e;
57
- }, Cr = () => j, Lr = () => {
60
+ }, Ir = () => j, Vr = () => {
58
61
  let e = null;
59
62
  const t = {
60
63
  hits: 0,
@@ -63,7 +66,7 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
63
66
  return Object.assign((a, n) => {
64
67
  if (!j)
65
68
  return D && (t.misses += 1), n();
66
- if (e && ie(e.args, a))
69
+ if (e && le(e.args, a))
67
70
  return D && (t.hits += 1), e.out;
68
71
  D && (t.misses += 1);
69
72
  const s = n();
@@ -77,7 +80,7 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
77
80
  e = null;
78
81
  }
79
82
  });
80
- }, Ge = () => {
83
+ }, qe = () => {
81
84
  const e = /* @__PURE__ */ new WeakMap(), t = {
82
85
  hits: 0,
83
86
  misses: 0
@@ -87,7 +90,7 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
87
90
  return D && (t.misses += 1), s();
88
91
  const o = e.get(a);
89
92
  if (o) {
90
- for (const l of o) if (ie(l.args, n))
93
+ for (const l of o) if (le(l.args, n))
91
94
  return D && (t.hits += 1), l.out;
92
95
  }
93
96
  D && (t.misses += 1);
@@ -100,19 +103,19 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
100
103
  out: i
101
104
  }]), i;
102
105
  }, { stats: t });
103
- }, Ir = (...e) => e.reduce((t, r) => ({
106
+ }, xr = (...e) => e.reduce((t, r) => ({
104
107
  hits: t.hits + r.hits,
105
108
  misses: t.misses + r.misses
106
109
  }), {
107
110
  hits: 0,
108
111
  misses: 0
109
- }), ie = (e, t) => {
112
+ }), le = (e, t) => {
110
113
  if (e.length !== t.length) return !1;
111
114
  for (let r = 0; r < e.length; r += 1) if (e[r] !== t[r]) return !1;
112
115
  return !0;
113
- }, Ke = class {
116
+ }, Xe = class {
114
117
  constructor() {
115
- this.memo = Ge(), this.singletonKey = {};
118
+ this.memo = qe(), this.singletonKey = {};
116
119
  }
117
120
  get stats() {
118
121
  return this.memo.stats;
@@ -123,28 +126,28 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
123
126
  key(e) {
124
127
  return this.singletonKey;
125
128
  }
126
- }, le = class extends Error {
129
+ }, ue = class extends Error {
127
130
  constructor(e) {
128
131
  super(e.message, e.cause !== void 0 ? { cause: e.cause } : void 0), this.name = new.target.name, this.code = e.code, this.context = e.context, this.suggestion = e.suggestion;
129
132
  }
130
- }, B = class extends le {
133
+ }, B = class extends ue {
131
134
  constructor(e) {
132
135
  super(e), this.kind = "user-input";
133
136
  }
134
- }, v = class extends le {
137
+ }, v = class extends ue {
135
138
  constructor(e) {
136
139
  super({
137
140
  ...e,
138
141
  code: e.code ?? "INTERNAL_INVARIANT"
139
142
  }), this.kind = "internal";
140
143
  }
141
- }, ue = (e) => e.type === "lookup", He = (e) => e.type === "text", P = (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", qe = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", Vr = (e) => e.type === "currency", xr = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", ce = (e) => {
142
- if (ue(e)) return ce(e.fallback);
143
- if (P(e)) return "temporal";
144
- if (qe(e)) return "numeric";
145
- if (He(e)) return "categorical";
144
+ }, ce = (e) => e.type === "lookup", Qe = (e) => e.type === "text", U = (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", Je = (e) => e.type === "decimal" || e.type === "integer" || e.type === "percentage" || e.type === "duration" || e.type === "currency", Br = (e) => e.type === "currency", jr = (e) => e.type === "month" || e.type === "day_month" || e.type === "weekly_date_range", de = (e) => {
145
+ if (ce(e)) return de(e.fallback);
146
+ if (U(e)) return "temporal";
147
+ if (Je(e)) return "numeric";
148
+ if (Qe(e)) return "categorical";
146
149
  throw new v({ message: `No data type found for value format: ${e.type}` });
147
- }, Br = (e) => ue(e) ? e.fallback : e, Xe = {
150
+ }, Ur = (e) => ce(e) ? e.fallback : e, Ze = {
148
151
  k: 1e3,
149
152
  m: 1e6,
150
153
  b: 1e9,
@@ -154,7 +157,7 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
154
157
  "m",
155
158
  "b",
156
159
  "t"
157
- ], Qe = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${q.join("|")})?$`, "i"), Je = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, T = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? Qe.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${q.join("")}]`, "gi"), ""))) : !Number.isNaN(Number(e)), de = (e) => T(e) ? !0 : typeof e == "string" ? Je.test(e) : !1, ye = {
160
+ ], et = new RegExp(`^-?(\\d{1,3}(,\\d{3})*|\\d+)\\.?\\d*(${q.join("|")})?$`, "i"), tt = /^-?\d{1,3}(?:,\d{3})*(?:\.\d+)?%?$/, T = (e) => e === null || e instanceof Date || Array.isArray(e) || typeof e == "boolean" ? !1 : typeof e == "string" ? et.test(e) && !Number.isNaN(Number(e.replace(new RegExp(`[,${q.join("")}]`, "gi"), ""))) : !Number.isNaN(Number(e)), ye = (e) => T(e) ? !0 : typeof e == "string" ? tt.test(e) : !1, fe = {
158
161
  $: "usd",
159
162
  "£": "gbp",
160
163
  "€": "eur",
@@ -186,28 +189,28 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
186
189
  C$: "cad",
187
190
  NZ$: "nzd",
188
191
  MX$: "mxn"
189
- }, fe = (e) => {
192
+ }, me = (e) => {
190
193
  if (typeof e == "string") {
191
- const t = me(e);
194
+ const t = pe(e);
192
195
  return t.length ? T(t) : !1;
193
196
  }
194
197
  return T(e);
195
- }, Ze = (e) => {
196
- const t = pe(e), r = t ? ye[t] : void 0;
198
+ }, rt = (e) => {
199
+ const t = ge(e), r = t ? fe[t] : void 0;
197
200
  if (!r) throw new v({ message: "Could not get currency ISO" });
198
201
  return r;
199
- }, me = (e) => {
200
- const t = pe(e);
202
+ }, pe = (e) => {
203
+ const t = ge(e);
201
204
  let r = e;
202
205
  if (t) {
203
206
  const a = e.indexOf(t);
204
207
  a === 0 ? r = e.slice(t.length) : a === e.length - t.length ? r = e.slice(0, e.length - t.length) : e[0] === "-" && a === 1 && (r = `-${e.slice(t.length + 1)}`);
205
208
  }
206
209
  return T(r) ? r.split(",").join("") : "";
207
- }, pe = (e) => Object.keys(ye).sort((t, r) => r.length - t.length).find((t) => e.includes(t)), ge = (e) => {
210
+ }, ge = (e) => Object.keys(fe).sort((t, r) => r.length - t.length).find((t) => e.includes(t)), be = (e) => {
208
211
  const t = Object.entries(e);
209
- return !t.length || !t.some(([, r]) => !C(r));
210
- }, C = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", be = "en-GB", et = class {
212
+ return !t.length || !t.some(([, r]) => !L(r));
213
+ }, L = (e) => typeof e == "string" && e.trim() === "" || e === void 0 || e === null || e === "-", he = "en-GB", at = class {
211
214
  constructor() {
212
215
  this.currentYear = (/* @__PURE__ */ new Date()).getUTCFullYear(), this.previousDate = null, this.previousYear = null;
213
216
  }
@@ -216,7 +219,7 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
216
219
  const t = new Date(e.getTime());
217
220
  return t.setUTCFullYear(this.previousYear), this.previousDate = t, t;
218
221
  }
219
- }, tt = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, rt = /^\s*(19\d{2}|2[01]\d{2})\s*$/, at = [
222
+ }, nt = /^\d{4}-\d{2}-\d{2}(T|\s)\d{1,2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|\+00:00)?$/, st = /^\s*(19\d{2}|2[01]\d{2})\s*$/, ot = [
220
223
  [/\bJan\b/i, "January"],
221
224
  [/\bFeb\b/i, "February"],
222
225
  [/\bMar\b/i, "March"],
@@ -228,17 +231,17 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
228
231
  [/\bOct\b/i, "October"],
229
232
  [/\bNov\b/i, "November"],
230
233
  [/\bDec\b/i, "December"]
231
- ], nt = {
234
+ ], it = {
232
235
  "en-US": "MDY",
233
236
  "en-GB": "DMY",
234
237
  "pt-PT": "DMY",
235
238
  ar: "DMY"
236
- }, he = [
239
+ }, ve = [
237
240
  "/",
238
241
  "-",
239
242
  ".",
240
243
  " "
241
- ], X = [
244
+ ], Q = [
242
245
  [
243
246
  "d",
244
247
  "M",
@@ -309,7 +312,7 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
309
312
  "MMMM",
310
313
  "yyyy"
311
314
  ]
312
- ], Q = [
315
+ ], J = [
313
316
  [
314
317
  "M",
315
318
  "d",
@@ -380,7 +383,7 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
380
383
  "do",
381
384
  "yyyy"
382
385
  ]
383
- ], J = [
386
+ ], Z = [
384
387
  [
385
388
  "yyyy",
386
389
  "M",
@@ -416,14 +419,14 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
416
419
  "MMMM",
417
420
  "do"
418
421
  ]
419
- ], ve = [
422
+ ], Me = [
420
423
  ["d", "MMMM"],
421
424
  ["dd", "MMMM"],
422
425
  ["do", "MMMM"],
423
426
  ["MMMM", "d"],
424
427
  ["MMMM", "dd"],
425
428
  ["MMMM", "do"]
426
- ], st = [
429
+ ], lt = [
427
430
  {
428
431
  dateFormat: "MMMM d, yyyy",
429
432
  type: "date"
@@ -440,82 +443,82 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
440
443
  dateFormat: "yyyy-MM",
441
444
  type: "month_year"
442
445
  }
443
- ], Me = 1900, Ee = 2199, ot = 3, it = 6, lt = 5, ut = 1, ct = 28, dt = /\s*[–—]\s*|\s-\s/, yt = (e) => typeof e == "number" ? Number.isNaN(e) ? !1 : e >= Me && e <= Ee : typeof e == "string" ? rt.test(e) : !1, _e = (e, t) => {
444
- const r = R(e);
445
- return !t && T(r) ? pt(r) : typeof r == "string" ? t ? f(N(r, t, /* @__PURE__ */ new Date())) : !!Te(r) || U(r) && f(new Date(r)) : f(r);
446
- }, R = (e) => {
446
+ ], Ee = 1900, _e = 2199, ut = 3, ct = 6, dt = 5, yt = 1, ft = 28, mt = /\s*[–—]\s*|\s-\s/, pt = (e) => typeof e == "number" ? Number.isNaN(e) ? !1 : e >= Ee && e <= _e : typeof e == "string" ? st.test(e) : !1, Te = (e, t) => {
447
+ const r = k(e);
448
+ return !t && T(r) ? ht(r) : typeof r == "string" ? t ? f(N(r, t, /* @__PURE__ */ new Date())) : !!Ae(r) || P(r) && f(new Date(r)) : f(r);
449
+ }, k = (e) => {
447
450
  if (typeof e != "string") return e;
448
451
  let t = e;
449
- for (const [r, a] of at) t = t.replace(r, a);
452
+ for (const [r, a] of ot) t = t.replace(r, a);
450
453
  return t;
451
- }, Te = (e, t = be) => {
452
- const r = R(e);
453
- return U(r) ? { type: "datetime" } : Ae(t).find((a) => !P(a) || a.type === "month" && r.length < ot ? !1 : a.dateFormat && f(N(r, a.dateFormat, /* @__PURE__ */ new Date())));
454
- }, U = (e) => tt.test(e.trim()), jr = (e) => {
454
+ }, Ae = (e, t = he) => {
455
+ const r = k(e);
456
+ return P(r) ? { type: "datetime" } : Fe(t).find((a) => !U(a) || a.type === "month" && r.length < ut ? !1 : a.dateFormat && f(N(r, a.dateFormat, /* @__PURE__ */ new Date())));
457
+ }, P = (e) => nt.test(e.trim()), Pr = (e) => {
455
458
  if (e instanceof Date) return f(e) ? e : null;
456
- if (typeof e != "string" || !U(e)) return null;
459
+ if (typeof e != "string" || !P(e)) return null;
457
460
  const t = new Date(e.trim());
458
461
  return f(t) ? t : null;
459
- }, ft = (e, t = be) => {
460
- const [r, a] = e.split(dt);
462
+ }, gt = (e, t = he) => {
463
+ const [r, a] = e.split(mt);
461
464
  if (!r || !a) return;
462
- const n = R(r).trim(), s = R(a).trim();
463
- return mt(t).find((o) => {
464
- if (!P(o) || !o.dateFormat) return !1;
465
+ const n = k(r).trim(), s = k(a).trim();
466
+ return bt(t).find((o) => {
467
+ if (!U(o) || !o.dateFormat) return !1;
465
468
  const i = N(n, o.dateFormat, /* @__PURE__ */ new Date()), l = N(s, o.dateFormat, /* @__PURE__ */ new Date());
466
469
  if (!f(i) || !f(l)) return !1;
467
- const u = new et(), d = u.incrementYearIfNeeded(i), M = u.incrementYearIfNeeded(l), y = Re(M, d);
468
- return Le(new Date(d.getFullYear(), ut, ct), {
470
+ const u = new at(), d = u.incrementYearIfNeeded(i), M = u.incrementYearIfNeeded(l), y = Le(M, d);
471
+ return Ie(new Date(d.getFullYear(), yt, ft), {
469
472
  start: d,
470
473
  end: M
471
- }) && y === lt ? !0 : y === it;
474
+ }) && y === dt ? !0 : y === ct;
472
475
  });
473
- }, Ae = (e) => {
476
+ }, Fe = (e) => {
474
477
  const t = {
475
- date: Fe(e),
478
+ date: De(e),
476
479
  year: [["yyyy"]],
477
- day_month: ve,
480
+ day_month: Me,
478
481
  month_year: [["MMMM", "yyyy"], ["yyyy", "MMMM"]],
479
482
  month: [["MMMM"]],
480
483
  quarter: [["QQQ", "yyyy"], ["yyyy", "QQQ"]]
481
484
  };
482
- return [...st, ...Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => he.map((s) => ({
485
+ return [...lt, ...Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => ve.map((s) => ({
483
486
  dateFormat: n.join(s),
484
487
  type: r
485
488
  }))))];
486
- }, Fe = (e) => nt[e] === "MDY" ? [
489
+ }, De = (e) => it[e] === "MDY" ? [
490
+ ...J,
487
491
  ...Q,
488
- ...X,
489
- ...J
492
+ ...Z
490
493
  ] : [
491
- ...X,
492
494
  ...Q,
493
- ...J
494
- ], mt = (e) => {
495
+ ...J,
496
+ ...Z
497
+ ], bt = (e) => {
495
498
  const t = {
496
- weekly_date_range: ve,
497
- weekly_date_range_with_year: Fe(e)
499
+ weekly_date_range: Me,
500
+ weekly_date_range_with_year: De(e)
498
501
  };
499
- return Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => he.map((s) => ({
502
+ return Object.entries(t).flatMap(([r, a]) => a.flatMap((n) => ve.map((s) => ({
500
503
  dateFormat: n.join(s),
501
504
  type: r
502
505
  }))));
503
- }, pt = (e) => {
506
+ }, ht = (e) => {
504
507
  const t = Number(e);
505
- if (!Ve(t)) return !1;
506
- const r = new Date(t), a = /* @__PURE__ */ new Date(t * 1e3), n = (s) => f(s) && s.getFullYear() >= Me && s.getFullYear() <= Ee;
508
+ if (!xe(t)) return !1;
509
+ const r = new Date(t), a = /* @__PURE__ */ new Date(t * 1e3), n = (s) => f(s) && s.getFullYear() >= Ee && s.getFullYear() <= _e;
507
510
  return n(r) || n(a);
508
- }, gt = /\s*[–—]\s*|\s-\s/, bt = (e, t, r) => {
509
- if (C(e)) return null;
511
+ }, vt = /\s*[–—]\s*|\s-\s/, Mt = (e, t, r) => {
512
+ if (L(e)) return null;
510
513
  switch (t.type) {
511
514
  case "decimal":
512
515
  case "integer":
513
516
  case "duration":
514
- return Ne(e);
517
+ return we(e);
515
518
  case "percentage":
516
- return ht(e);
519
+ return Et(e);
517
520
  case "currency":
518
- return vt(e);
521
+ return _t(e);
519
522
  case "datetime":
520
523
  case "date":
521
524
  case "year":
@@ -524,80 +527,80 @@ var G = (e) => e instanceof Date && f(e), wr = (e) => G(e) || e === null, Sr = (
524
527
  case "day_month":
525
528
  case "quarter":
526
529
  case "time":
527
- return De(e, t.dateFormat, r);
530
+ return Ne(e, t.dateFormat, r);
528
531
  case "weekly_date_range":
529
532
  case "weekly_date_range_with_year":
530
- return Mt(e, t.dateFormat, r);
533
+ return Tt(e, t.dateFormat, r);
531
534
  case "text":
532
- return Et(e);
535
+ return At(e);
533
536
  case "lookup":
534
537
  throw new v({ message: "Cannot parse: lookup value formats are produced by transforms, not raw input" });
535
538
  default:
536
539
  throw new v({ message: `Unhandled value format: ${t.type}` });
537
540
  }
538
- }, De = (e, t, r) => {
541
+ }, Ne = (e, t, r) => {
539
542
  if (e instanceof Date) return f(e) ? e : null;
540
- const a = R(String(e).trim());
543
+ const a = k(String(e).trim());
541
544
  if (a.length === 0) return null;
542
545
  const n = /* @__PURE__ */ new Date();
543
546
  if (t) {
544
547
  const o = N(a, t, n);
545
548
  return f(o) ? Y(o) : null;
546
549
  }
547
- for (const o of Ae(r)) {
548
- if (!P(o) || !o.dateFormat) continue;
550
+ for (const o of Fe(r)) {
551
+ if (!U(o) || !o.dateFormat) continue;
549
552
  const i = N(a, o.dateFormat, n);
550
553
  if (f(i)) return Y(i);
551
554
  }
552
555
  const s = new Date(a);
553
- return _e(s) ? U(a) ? s : Y(s) : null;
554
- }, Ne = (e) => {
556
+ return Te(s) ? P(a) ? s : Y(s) : null;
557
+ }, we = (e) => {
555
558
  if (typeof e == "number") return Number.isNaN(e) ? null : e;
556
559
  if (typeof e != "string") return null;
557
560
  let t = e.trim();
558
561
  if (!T(t)) return null;
559
562
  let r = 1;
560
563
  for (const a of q) if (new RegExp(`${a}$`, "i").test(t)) {
561
- r = Xe[a], t = t.slice(0, -1);
564
+ r = Ze[a], t = t.slice(0, -1);
562
565
  break;
563
566
  }
564
567
  return Number(t.split(",").join("")) * r;
565
- }, ht = (e) => {
568
+ }, Et = (e) => {
566
569
  if (typeof e == "number") return Number.isNaN(e) ? null : e;
567
570
  if (typeof e != "string") return null;
568
571
  const t = e.trim();
569
- if (!de(t)) return null;
572
+ if (!ye(t)) return null;
570
573
  const r = Number(t.replace(/%/g, "").replace(/,/g, "")) / 100;
571
574
  return Number.isNaN(r) ? null : r;
572
- }, vt = (e) => {
575
+ }, _t = (e) => {
573
576
  if (typeof e == "number") return Number.isNaN(e) ? null : e;
574
577
  if (typeof e != "string") return null;
575
578
  const t = e.trim();
576
- return fe(t) ? Ne(me(t)) : null;
577
- }, Mt = (e, t, r) => {
578
- const a = String(e).trim().split(gt), [n, s] = [a[0]?.trim(), a[1]?.trim()];
579
- return !n || !s ? null : De(n, t, r);
580
- }, Et = (e) => String(e).trim(), Y = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), _t = /* @__PURE__ */ new Set([
579
+ return me(t) ? we(pe(t)) : null;
580
+ }, Tt = (e, t, r) => {
581
+ const a = String(e).trim().split(vt), [n, s] = [a[0]?.trim(), a[1]?.trim()];
582
+ return !n || !s ? null : Ne(n, t, r);
583
+ }, At = (e) => String(e).trim(), Y = (e) => new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), Ft = /* @__PURE__ */ new Set([
581
584
  "count",
582
585
  "sum",
583
586
  "mean",
584
587
  "median"
585
588
  ]);
586
- function we(e, t) {
587
- return _t.has(e) ? "numeric" : t;
589
+ function Se(e, t) {
590
+ return Ft.has(e) ? "numeric" : t;
588
591
  }
589
- var Tt = "value", Z = "\0__rowMaskIndex", k = {
592
+ var Dt = "value", ee = "\0__rowMaskIndex", R = {
590
593
  numeric: { type: "decimal" },
591
594
  categorical: { type: "text" },
592
595
  temporal: { type: "datetime" }
593
- }, At = {
596
+ }, Nt = {
594
597
  eq: (e, t) => e[t.__variableName] === t.__value,
595
598
  neq: (e, t) => e[t.__variableName] !== t.__value,
596
599
  gt: (e, t) => e[t.__variableName] > t.__value,
597
600
  gte: (e, t) => e[t.__variableName] >= t.__value,
598
601
  lt: (e, t) => e[t.__variableName] < t.__value,
599
602
  lte: (e, t) => e[t.__variableName] <= t.__value
600
- }, Se = (e, t) => e === "count" ? { type: "integer" } : t, K = class g {
603
+ }, Oe = (e, t) => e === "count" ? { type: "integer" } : t, K = class g {
601
604
  constructor(t = {}) {
602
605
  const { table: r, variableMetadata: a } = this.parseVariableMap(t);
603
606
  this.table = r, this.variableMetadata = a;
@@ -683,7 +686,7 @@ var Tt = "value", Z = "\0__rowMaskIndex", k = {
683
686
  return r?.distinct && (n = this.getDistinctValues(a, n)), r?.skipNulls && (n = this.skipNulls(n)), n;
684
687
  }
685
688
  filter(t, r, a) {
686
- const n = At[r], s = this.table.params({
689
+ const n = Nt[r], s = this.table.params({
687
690
  __variableName: t,
688
691
  __value: a
689
692
  }).filter(n);
@@ -691,14 +694,14 @@ var Tt = "value", Z = "\0__rowMaskIndex", k = {
691
694
  }
692
695
  filterByMask(t) {
693
696
  if (t.length !== this.size()) throw new v({ message: `Row mask length ${t.length} does not match dataset size ${this.size()}` });
694
- const r = Array.from({ length: t.length }, (n, s) => s), a = this.table.assign(O({ [Z]: r })).params({
695
- __indexColumnName: Z,
697
+ const r = Array.from({ length: t.length }, (n, s) => s), a = this.table.assign(O({ [ee]: r })).params({
698
+ __indexColumnName: ee,
696
699
  __mask: t
697
700
  }).filter((n, s) => s.__mask[n[s.__indexColumnName]] === 1).select(...this.table.columnNames());
698
701
  return g.fromTrusted(a, this.variableMetadata);
699
702
  }
700
703
  orderBy(t, r = "asc") {
701
- const a = this.table.orderby(r === "asc" ? t : xe(t));
704
+ const a = this.table.orderby(r === "asc" ? t : Be(t));
702
705
  return g.fromTrusted(a, this.variableMetadata);
703
706
  }
704
707
  getAt(t) {
@@ -719,20 +722,20 @@ var Tt = "value", Z = "\0__rowMaskIndex", k = {
719
722
  }
720
723
  groupBy(...t) {
721
724
  const r = this.table.groupby(...t);
722
- return new Ft(t, r, this.variableMetadata);
725
+ return new wt(t, r, this.variableMetadata);
723
726
  }
724
727
  rollup(t) {
725
- const r = this.table.rollup(Object.fromEntries(Object.entries(t).map(([n, s]) => [n, re[s.aggregation](s.variableName)]))), a = {};
728
+ const r = this.table.rollup(Object.fromEntries(Object.entries(t).map(([n, s]) => [n, ae[s.aggregation](s.variableName)]))), a = {};
726
729
  for (const [n, { variableName: s, aggregation: o }] of Object.entries(t)) {
727
- const i = this.variableMetadata[s], l = i?.type ?? "numeric", u = i?.valueFormat ?? k[l];
730
+ const i = this.variableMetadata[s], l = i?.type ?? "numeric", u = i?.valueFormat ?? R[l];
728
731
  a[n] = {
729
- type: we(o, l),
730
- valueFormat: Se(o, u)
732
+ type: Se(o, l),
733
+ valueFormat: Oe(o, u)
731
734
  };
732
735
  }
733
736
  return g.fromTrusted(r, a);
734
737
  }
735
- reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n = Tt } = {}) {
738
+ reshapeFromWideToLong({ keep: t, reshape: r, keyName: a = "key", valueName: n = Dt } = {}) {
736
739
  const { numeric: s, categorical: o, temporal: i } = this.groupVariableNamesByType(), l = t ?? [...o, ...i], u = r ?? s.filter((y) => !l.includes(y));
737
740
  if (l.includes(a) || l.includes(n)) throw new B({
738
741
  code: "INVALID_DATA_SHAPE",
@@ -772,7 +775,7 @@ var Tt = "value", Z = "\0__rowMaskIndex", k = {
772
775
  valueFormat: { type: "text" }
773
776
  }, M[n] = {
774
777
  type: "numeric",
775
- valueFormat: Dt(this.variableMetadata, u, a)
778
+ valueFormat: St(this.variableMetadata, u, a)
776
779
  }, g.fromTrusted(d, M);
777
780
  }
778
781
  print() {
@@ -784,14 +787,14 @@ var Tt = "value", Z = "\0__rowMaskIndex", k = {
784
787
  resolveAddedVariableFormat(t, r, a) {
785
788
  if (a !== void 0) return a;
786
789
  const n = this.variableMetadata[t];
787
- return n ? n.valueFormat : k[r];
790
+ return n ? n.valueFormat : R[r];
788
791
  }
789
792
  parseVariableMap(t) {
790
793
  const r = {}, a = {};
791
794
  for (const [n, { type: s, values: o, valueFormat: i }] of Object.entries(t))
792
795
  r[n] = o, a[n] = {
793
796
  type: s,
794
- valueFormat: i ?? k[s]
797
+ valueFormat: i ?? R[s]
795
798
  };
796
799
  return {
797
800
  table: O(r),
@@ -821,7 +824,7 @@ var Tt = "value", Z = "\0__rowMaskIndex", k = {
821
824
  }
822
825
  return s;
823
826
  }
824
- }, Ft = class {
827
+ }, wt = class {
825
828
  constructor(e, t, r) {
826
829
  this.groupedBy = e, this.grouped = t, this.variableMetadata = r;
827
830
  }
@@ -839,37 +842,37 @@ var Tt = "value", Z = "\0__rowMaskIndex", k = {
839
842
  }
840
843
  }
841
844
  rollup(e) {
842
- const t = this.grouped.rollup(Object.fromEntries(Object.entries(e).map(([a, n]) => [a, re[n.aggregation](n.variableName)]))), r = Object.fromEntries(this.groupedBy.map((a) => {
845
+ const t = this.grouped.rollup(Object.fromEntries(Object.entries(e).map(([a, n]) => [a, ae[n.aggregation](n.variableName)]))), r = Object.fromEntries(this.groupedBy.map((a) => {
843
846
  const n = this.variableMetadata[a], s = n?.type ?? "categorical";
844
847
  return [a, {
845
848
  type: s,
846
- valueFormat: n?.valueFormat ?? k[s]
849
+ valueFormat: n?.valueFormat ?? R[s]
847
850
  }];
848
851
  }));
849
852
  for (const [a, { variableName: n, aggregation: s }] of Object.entries(e)) {
850
- const o = this.variableMetadata[n], i = o?.type ?? "numeric", l = o?.valueFormat ?? k[i];
853
+ const o = this.variableMetadata[n], i = o?.type ?? "numeric", l = o?.valueFormat ?? R[i];
851
854
  r[a] = {
852
- type: we(s, i),
853
- valueFormat: Se(s, l)
855
+ type: Se(s, i),
856
+ valueFormat: Oe(s, l)
854
857
  };
855
858
  }
856
859
  return K.fromTrusted(t, r);
857
860
  }
858
861
  getStableKey(e, t) {
859
- return oe(e.map((r) => r.get(t)));
862
+ return ie(e.map((r) => r.get(t)));
860
863
  }
861
864
  };
862
- function Dt(e, t, r) {
865
+ function St(e, t, r) {
863
866
  const a = t.map((i) => e[i]?.valueFormat ?? { type: "decimal" }), [n, ...s] = a;
864
867
  if (!n) return { type: "decimal" };
865
868
  for (const i of a) if (i.type === "lookup") throw new B({
866
869
  code: "INVALID_DATA_SHAPE",
867
870
  message: "Cannot reshape: a source column has a lookup format and lookups cannot nest"
868
871
  });
869
- if (s.every((i) => Ie(i, n)) || n.type === "lookup") return n;
872
+ if (s.every((i) => Ve(i, n)) || n.type === "lookup") return n;
870
873
  const o = {};
871
874
  for (const [i, l] of t.entries()) {
872
- const u = oe([l]), d = a[i];
875
+ const u = ie([l]), d = a[i];
873
876
  d && d.type !== "lookup" && (o[u] = d);
874
877
  }
875
878
  return {
@@ -879,7 +882,7 @@ function Dt(e, t, r) {
879
882
  fallback: n
880
883
  };
881
884
  }
882
- var Nt = class {
885
+ var Ot = class {
883
886
  constructor(e) {
884
887
  this.label = e, this.items = /* @__PURE__ */ new Map();
885
888
  }
@@ -908,62 +911,62 @@ var Nt = class {
908
911
  has(e) {
909
912
  return this.items.has(e);
910
913
  }
911
- }, wt = (e, t) => {
914
+ }, Rt = (e, t) => {
912
915
  const r = typeof e == "string" ? e.trim() : e;
913
916
  if (T(r)) return { type: "decimal" };
914
- const a = typeof r == "string" && Te(r, t);
917
+ const a = typeof r == "string" && Ae(r, t);
915
918
  if (a) return a;
916
- const n = typeof r == "string" && ft(r, t);
917
- return n || (_e(e) ? { type: "date" } : de(e) ? { type: "percentage" } : fe(e) && typeof e == "string" ? {
919
+ const n = typeof r == "string" && gt(r, t);
920
+ return n || (Te(e) ? { type: "date" } : ye(e) ? { type: "percentage" } : me(e) && typeof e == "string" ? {
918
921
  type: "currency",
919
- iso: Ze(e)
922
+ iso: rt(e)
920
923
  } : { type: "text" });
921
- }, St = {
924
+ }, kt = {
922
925
  type: "year",
923
926
  dateFormat: "yyyy"
924
- }, Ot = (e) => {
925
- const t = e._metadata?.parsingLocale ?? "en-GB", r = {}, a = Ct(e), n = kt(e);
927
+ }, Lt = (e) => {
928
+ const t = e._metadata?.parsingLocale ?? "en-GB", r = {}, a = Vt(e), n = Ct(e);
926
929
  for (const [s, o] of e.columns.entries()) {
927
930
  if (o._metadata?.isHidden) continue;
928
931
  const i = a.get(o.key);
929
- if (C(i)) continue;
930
- const l = s === n ? St : wt(i, t), u = ce(l);
931
- r[o.key] = Rt(o.key, e.rows, l, u, t);
932
+ if (L(i)) continue;
933
+ const l = s === n ? kt : Rt(i, t), u = de(l);
934
+ r[o.key] = It(o.key, e.rows, l, u, t);
932
935
  }
933
936
  return new K(r);
934
- }, Pr = class extends Ke {
937
+ }, $r = class extends Xe {
935
938
  dependencies(e) {
936
939
  return [e];
937
940
  }
938
941
  run(e) {
939
- return Ot(e);
942
+ return Lt(e);
940
943
  }
941
- }, kt = (e) => {
942
- const t = Lt(e.rows, 5);
944
+ }, Ct = (e) => {
945
+ const t = xt(e.rows, 5);
943
946
  return e.columns.findIndex((r) => {
944
- const a = t.map((n) => n[r.key]).filter((n) => !C(n));
945
- return a.length >= 2 && a.every(yt);
947
+ const a = t.map((n) => n[r.key]).filter((n) => !L(n));
948
+ return a.length >= 2 && a.every(pt);
946
949
  });
947
- }, Rt = (e, t, r, a, n) => ({
950
+ }, It = (e, t, r, a, n) => ({
948
951
  type: a,
949
- values: t.reduce((s, o) => (ge(o) || s.push(bt(o[e], r, n)), s), []),
952
+ values: t.reduce((s, o) => (be(o) || s.push(Mt(o[e], r, n)), s), []),
950
953
  valueFormat: r
951
- }), Ct = (e) => {
954
+ }), Vt = (e) => {
952
955
  const t = /* @__PURE__ */ new Map(), r = new Set(e.columns.map((a) => a.key));
953
956
  for (const a of e.rows) {
954
957
  for (const n of r) {
955
958
  const s = a[n];
956
- C(s) || (t.set(n, s), r.delete(n));
959
+ L(s) || (t.set(n, s), r.delete(n));
957
960
  }
958
961
  if (r.size === 0) break;
959
962
  }
960
963
  return t;
961
- }, Lt = (e, t) => {
964
+ }, xt = (e, t) => {
962
965
  const r = [];
963
966
  for (const a of e)
964
- if (ge(a) || r.push(a), r.length === t) return r;
967
+ if (be(a) || r.push(a), r.length === t) return r;
965
968
  return r;
966
- }, It = class {
969
+ }, Bt = class {
967
970
  constructor() {
968
971
  this.transformType = "aggregate";
969
972
  }
@@ -975,7 +978,7 @@ var Nt = class {
975
978
  };
976
979
  return e.groupBy(...r.groupby).rollup(a);
977
980
  }
978
- }, Vt = class {
981
+ }, jt = class {
979
982
  constructor() {
980
983
  this.transformType = "constant";
981
984
  }
@@ -987,7 +990,7 @@ var Nt = class {
987
990
  const { options: t } = e;
988
991
  return [t.variableName];
989
992
  }
990
- }, xt = class {
993
+ }, Ut = class {
991
994
  constructor() {
992
995
  this.transformType = "filter";
993
996
  }
@@ -995,7 +998,7 @@ var Nt = class {
995
998
  const { options: r } = t;
996
999
  return e.filter(r.variableName, r.operator, r.value);
997
1000
  }
998
- }, Bt = class {
1001
+ }, Pt = class {
999
1002
  constructor() {
1000
1003
  this.transformType = "reshape";
1001
1004
  }
@@ -1012,7 +1015,7 @@ var Nt = class {
1012
1015
  const { options: t } = e;
1013
1016
  return [t.keyName ?? "key"];
1014
1017
  }
1015
- }, jt = class {
1018
+ }, $t = class {
1016
1019
  constructor() {
1017
1020
  this.transformType = "sort";
1018
1021
  }
@@ -1020,18 +1023,18 @@ var Nt = class {
1020
1023
  const { options: r } = t;
1021
1024
  return e.orderBy(r.variableName, r.direction ?? "asc");
1022
1025
  }
1023
- }, Pt = [
1024
- new It(),
1025
- new Vt(),
1026
- new xt(),
1026
+ }, Yt = [
1027
1027
  new Bt(),
1028
- new jt()
1029
- ], Ur = class extends Nt {
1028
+ new jt(),
1029
+ new Ut(),
1030
+ new Pt(),
1031
+ new $t()
1032
+ ], Yr = class extends Ot {
1030
1033
  constructor() {
1031
1034
  super("transform");
1032
- for (const e of Pt) this.register(e.transformType, e);
1035
+ for (const e of Yt) this.register(e.transformType, e);
1033
1036
  }
1034
- }, $r = [
1037
+ }, zr = [
1035
1038
  "grey",
1036
1039
  "red",
1037
1040
  "orange",
@@ -1041,7 +1044,7 @@ var Nt = class {
1041
1044
  "blue",
1042
1045
  "purple",
1043
1046
  "pink"
1044
- ], Yr = [
1047
+ ], Wr = [
1045
1048
  "cyan",
1046
1049
  "pink",
1047
1050
  "purple",
@@ -1050,7 +1053,7 @@ var Nt = class {
1050
1053
  "yellow",
1051
1054
  "green",
1052
1055
  "blue"
1053
- ], Oe = [
1056
+ ], Re = [
1054
1057
  "#B399FE",
1055
1058
  "#FC7E91",
1056
1059
  "#33B6E0",
@@ -1074,7 +1077,7 @@ var Nt = class {
1074
1077
  dark_purple: "#6D48D2",
1075
1078
  plum: "#C82184",
1076
1079
  pink: "#FC8497"
1077
- }, zr = [b.purple, b.dark_purple], Ut = [
1080
+ }, Gr = [b.purple, b.dark_purple], zt = [
1078
1081
  b.purple,
1079
1082
  b.pink,
1080
1083
  b.yellow,
@@ -1095,7 +1098,7 @@ var Nt = class {
1095
1098
  red: "#FFADAD",
1096
1099
  orange: "#FFDEB4",
1097
1100
  yellow: "#FDF7C3"
1098
- }, $t = [
1101
+ }, Wt = [
1099
1102
  h.green,
1100
1103
  h.purple,
1101
1104
  h.red,
@@ -1196,12 +1199,12 @@ var Nt = class {
1196
1199
  pink200: "#FED0F3",
1197
1200
  pink100: "#FFE8F9",
1198
1201
  pink50: "#FFF4FC"
1199
- }, Yt = [
1202
+ }, Gt = [
1200
1203
  H.grey200,
1201
1204
  h.green,
1202
1205
  h.red,
1203
1206
  H.grey200
1204
- ], ee = {
1207
+ ], te = {
1205
1208
  dark: {
1206
1209
  1: [500],
1207
1210
  2: [600, 400],
@@ -1318,7 +1321,7 @@ var Nt = class {
1318
1321
  p.yellow,
1319
1322
  p.green,
1320
1323
  p.blue
1321
- ], zt = [
1324
+ ], Kt = [
1322
1325
  p.cyan,
1323
1326
  p.green,
1324
1327
  p.red,
@@ -1328,12 +1331,12 @@ var Nt = class {
1328
1331
  positive: "#84FC89",
1329
1332
  negative: "#FC8497",
1330
1333
  total: "#84D1FC"
1331
- }, Wt = [
1334
+ }, Ht = [
1332
1335
  V.start,
1333
1336
  V.positive,
1334
1337
  V.negative,
1335
1338
  V.total
1336
- ], Wr = {
1339
+ ], Kr = {
1337
1340
  transform: "linear",
1338
1341
  reverse: !1,
1339
1342
  nice: !0,
@@ -1345,45 +1348,45 @@ var Nt = class {
1345
1348
  interpolate: "lab",
1346
1349
  domainMid: null,
1347
1350
  symmetric: !1
1348
- }, Gr = {
1351
+ }, Hr = {
1349
1352
  size: [4, 20],
1350
1353
  alpha: [0.1, 1],
1351
1354
  strokeWidth: [1, 4]
1352
- }, Kr = {
1355
+ }, qr = {
1353
1356
  domainMin: null,
1354
1357
  domainMax: null,
1355
1358
  nice: !1,
1356
1359
  reverse: !1
1357
- }, Hr = {
1360
+ }, Xr = {
1358
1361
  range: null,
1359
1362
  domain: null,
1360
1363
  padding: 0.1,
1361
1364
  reverse: !1
1362
- }, te = { palette: { type: "default" } };
1363
- function Gt(e, t = "light", r) {
1364
- return ((r !== void 0 ? ee[t][r] : void 0) ?? ee[t].default).map((a) => H[`${e}${a}`]);
1365
+ }, re = { palette: { type: "default" } };
1366
+ function qt(e, t = "light", r) {
1367
+ return ((r !== void 0 ? te[t][r] : void 0) ?? te[t].default).map((a) => H[`${e}${a}`]);
1365
1368
  }
1366
- function Kt(e) {
1369
+ function Xt(e) {
1367
1370
  const t = I.indexOf(p[e]);
1368
1371
  return t <= 0 ? I : [...I.slice(t), ...I.slice(0, t)];
1369
1372
  }
1370
- function qr(e, t) {
1373
+ function Qr(e, t) {
1371
1374
  switch (e.type) {
1372
1375
  case "default":
1373
- return Oe;
1376
+ return Re;
1374
1377
  case "graphy":
1375
- return e.variant === "waterfall" ? Wt : Ut;
1378
+ return e.variant === "waterfall" ? Ht : zt;
1376
1379
  case "pastel":
1377
- return e.variant === "waterfall" ? Yt : $t;
1380
+ return e.variant === "waterfall" ? Gt : Wt;
1378
1381
  case "neon":
1379
- return e.variant === "waterfall" ? zt : Kt(e.base);
1382
+ return e.variant === "waterfall" ? Kt : Xt(e.base);
1380
1383
  case "mono":
1381
- return Gt(e.base, e.variant ?? "light", t);
1384
+ return qt(e.base, e.variant ?? "light", t);
1382
1385
  case "custom":
1383
1386
  return e.colors;
1384
1387
  }
1385
1388
  }
1386
- function Xr(e, t) {
1389
+ function Jr(e, t) {
1387
1390
  if (!t) return e;
1388
1391
  const r = [...e];
1389
1392
  for (const [a, n] of Object.entries(t)) {
@@ -1394,7 +1397,7 @@ function Xr(e, t) {
1394
1397
  }
1395
1398
  return r;
1396
1399
  }
1397
- function Qr(e, t, r, a) {
1400
+ function Zr(e, t, r, a) {
1398
1401
  if (!t) return;
1399
1402
  const n = r?.type === "custom" ? a[r.id] : void 0, s = {};
1400
1403
  for (const [o, i] of Object.entries(t)) {
@@ -1420,8 +1423,8 @@ function Qr(e, t, r, a) {
1420
1423
  }
1421
1424
  return Object.keys(s).length > 0 ? s : void 0;
1422
1425
  }
1423
- function Jr(e, t, r) {
1424
- if (!t) return te.palette;
1426
+ function ea(e, t, r) {
1427
+ if (!t) return re.palette;
1425
1428
  if (t.type === "custom") {
1426
1429
  const a = r[t.id];
1427
1430
  if (!a)
@@ -1433,7 +1436,7 @@ function Jr(e, t, r) {
1433
1436
  available: Object.keys(r)
1434
1437
  },
1435
1438
  suggestion: "Register the palette in customPalettes, or reference an existing palette id."
1436
- }), te.palette;
1439
+ }), re.palette;
1437
1440
  const n = a.map((s) => s.hex);
1438
1441
  return {
1439
1442
  type: "custom",
@@ -1501,7 +1504,7 @@ function W(e, t) {
1501
1504
  options: t
1502
1505
  };
1503
1506
  }
1504
- function Ht(e, t = {}) {
1507
+ function Qt(e, t = {}) {
1505
1508
  return {
1506
1509
  type: "scale",
1507
1510
  scaledAesthetic: e,
@@ -1510,7 +1513,7 @@ function Ht(e, t = {}) {
1510
1513
  overrides: t.overrides
1511
1514
  };
1512
1515
  }
1513
- var qt = [
1516
+ var Jt = [
1514
1517
  "none",
1515
1518
  "xs",
1516
1519
  "sm",
@@ -1518,14 +1521,14 @@ var qt = [
1518
1521
  "lg",
1519
1522
  "xl",
1520
1523
  "full"
1521
- ], Zr = {
1522
- point: Xt,
1523
- line: Qt,
1524
- area: Jt,
1525
- bar: Zt,
1526
- rule: er
1527
- }, ea = (e) => typeof e == "string" && qt.includes(e);
1528
- function L(e, t) {
1524
+ ], ta = {
1525
+ point: Zt,
1526
+ line: er,
1527
+ area: tr,
1528
+ bar: rr,
1529
+ rule: ar
1530
+ }, ra = (e) => typeof e == "string" && Jt.includes(e);
1531
+ function C(e, t) {
1529
1532
  return {
1530
1533
  type: "layer",
1531
1534
  id: t.id,
@@ -1540,23 +1543,23 @@ function L(e, t) {
1540
1543
  dataLabels: t.dataLabels
1541
1544
  };
1542
1545
  }
1543
- function Xt(e = {}) {
1544
- return L("point", e);
1546
+ function Zt(e = {}) {
1547
+ return C("point", e);
1545
1548
  }
1546
- function Qt(e = {}) {
1547
- return L("line", e);
1549
+ function er(e = {}) {
1550
+ return C("line", e);
1548
1551
  }
1549
- function Jt(e = {}) {
1550
- return L("area", e);
1552
+ function tr(e = {}) {
1553
+ return C("area", e);
1551
1554
  }
1552
- function Zt(e = {}) {
1553
- return L("bar", e);
1555
+ function rr(e = {}) {
1556
+ return C("bar", e);
1554
1557
  }
1555
- function er(e = {}) {
1556
- return L("rule", e);
1558
+ function ar(e = {}) {
1559
+ return C("rule", e);
1557
1560
  }
1558
- var ta = ["dimmed", "hovered"], ra = (e) => typeof e == "object" && e !== null && typeof e.light == "string" && typeof e.dark == "string", aa = (e) => typeof e == "object" && e !== null && typeof e.token == "string";
1559
- function na(e) {
1561
+ var aa = ["dimmed", "hovered"], na = (e) => typeof e == "object" && e !== null && typeof e.light == "string" && typeof e.dark == "string", sa = (e) => typeof e == "object" && e !== null && typeof e.token == "string";
1562
+ function oa(e) {
1560
1563
  return {
1561
1564
  type: "styles",
1562
1565
  ...e
@@ -1627,14 +1630,14 @@ var A = (e) => {
1627
1630
  },
1628
1631
  declarations: e
1629
1632
  })
1630
- }) }, tr = Oe[0], rr = Object.freeze({
1633
+ }) }, nr = Re[0], sr = Object.freeze({
1631
1634
  light: "#1D2129",
1632
1635
  dark: "#FFFFFF"
1633
- }), ar = "#ffffff", nr = 0.4, sr = {
1634
- geomColor: tr,
1635
- ruleColor: rr,
1636
+ }), or = "#ffffff", ir = 0.4, ia = "sm", la = 1, ua = 2, lr = 0.3, ca = 8, ur = {
1637
+ geomColor: nr,
1638
+ ruleColor: sr,
1636
1639
  pointBorderColor: "#ffffff",
1637
- hoverAffordanceColor: ar
1640
+ hoverAffordanceColor: or
1638
1641
  }, ke = [
1639
1642
  E.geom({
1640
1643
  color: S("geomColor"),
@@ -1649,7 +1652,7 @@ var A = (e) => {
1649
1652
  lineType: "solid"
1650
1653
  }),
1651
1654
  E.geom.area({
1652
- alpha: 0.3,
1655
+ alpha: lr,
1653
1656
  strokeWidth: 2,
1654
1657
  lineType: "solid",
1655
1658
  strokeAlpha: 1
@@ -1664,7 +1667,7 @@ var A = (e) => {
1664
1667
  strokeWidth: 1,
1665
1668
  lineType: "dashed"
1666
1669
  }),
1667
- E.geom({ alpha: nr }, { state: "dimmed" }),
1670
+ E.geom({ alpha: ir }, { state: "dimmed" }),
1668
1671
  E.geom.point({ borderColor: S("hoverAffordanceColor") }, { state: "hovered" }),
1669
1672
  E.geom.bar({ borderColor: S("hoverAffordanceColor") }, { state: "hovered" })
1670
1673
  ];
@@ -1673,11 +1676,11 @@ for (const e of ke) {
1673
1676
  for (const t of Object.values(e.declarations)) typeof t == "object" && Object.freeze(t);
1674
1677
  Object.freeze(e.declarations), e.when !== void 0 && Object.freeze(e.when), Object.freeze(e);
1675
1678
  }
1676
- var sa = Object.freeze({
1677
- tokens: Object.freeze(sr),
1679
+ var da = Object.freeze({
1680
+ tokens: Object.freeze(ur),
1678
1681
  defaults: Object.freeze(ke),
1679
1682
  overrides: Object.freeze([])
1680
- }), oa = {
1683
+ }), ya = {
1681
1684
  cartesian: (e = {}) => ({
1682
1685
  type: "coord",
1683
1686
  coordType: "cartesian",
@@ -1693,7 +1696,7 @@ var sa = Object.freeze({
1693
1696
  coordType: "polar",
1694
1697
  params: e
1695
1698
  })
1696
- }, ia = {
1699
+ }, fa = {
1697
1700
  x: Object.assign((e) => W("x", e), {
1698
1701
  continuous: (e) => m("x", e),
1699
1702
  discrete: (e) => _("x", e),
@@ -1736,7 +1739,7 @@ var sa = Object.freeze({
1736
1739
  color: {
1737
1740
  continuous: (e) => m("color", e),
1738
1741
  discrete: (e) => _("color", e),
1739
- palette: (e) => Ht("color", e)
1742
+ palette: (e) => Qt("color", e)
1740
1743
  },
1741
1744
  size: {
1742
1745
  continuous: (e) => m("size", e),
@@ -1757,13 +1760,13 @@ var sa = Object.freeze({
1757
1760
  discrete: (e) => _("lineType", e),
1758
1761
  identity: (e) => x("lineType", e)
1759
1762
  }
1760
- }, la = {
1761
- identity: ir,
1762
- count: lr,
1763
- smooth: or,
1764
- mean: ur
1763
+ }, ma = {
1764
+ identity: dr,
1765
+ count: yr,
1766
+ smooth: cr,
1767
+ mean: fr
1765
1768
  };
1766
- function or(e) {
1769
+ function cr(e) {
1767
1770
  return {
1768
1771
  type: "smooth",
1769
1772
  method: e.method,
@@ -1771,58 +1774,58 @@ function or(e) {
1771
1774
  bandwidth: e.bandwidth
1772
1775
  };
1773
1776
  }
1774
- function ir() {
1777
+ function dr() {
1775
1778
  return { type: "identity" };
1776
1779
  }
1777
- function lr() {
1780
+ function yr() {
1778
1781
  return { type: "count" };
1779
1782
  }
1780
- function ur() {
1783
+ function fr() {
1781
1784
  return { type: "mean" };
1782
1785
  }
1783
- var ua = {
1784
- reshape: cr,
1785
- filter: dr,
1786
- sort: yr,
1787
- aggregate: fr,
1788
- constant: mr
1786
+ var pa = {
1787
+ reshape: mr,
1788
+ filter: pr,
1789
+ sort: gr,
1790
+ aggregate: br,
1791
+ constant: hr
1789
1792
  };
1790
- function cr(e = {}) {
1793
+ function mr(e = {}) {
1791
1794
  return {
1792
1795
  type: "transform",
1793
1796
  transformType: "reshape",
1794
1797
  options: e
1795
1798
  };
1796
1799
  }
1797
- function dr(e) {
1800
+ function pr(e) {
1798
1801
  return {
1799
1802
  type: "transform",
1800
1803
  transformType: "filter",
1801
1804
  options: e
1802
1805
  };
1803
1806
  }
1804
- function yr(e) {
1807
+ function gr(e) {
1805
1808
  return {
1806
1809
  type: "transform",
1807
1810
  transformType: "sort",
1808
1811
  options: e
1809
1812
  };
1810
1813
  }
1811
- function fr(e) {
1814
+ function br(e) {
1812
1815
  return {
1813
1816
  type: "transform",
1814
1817
  transformType: "aggregate",
1815
1818
  options: e
1816
1819
  };
1817
1820
  }
1818
- function mr(e) {
1821
+ function hr(e) {
1819
1822
  return {
1820
1823
  type: "transform",
1821
1824
  transformType: "constant",
1822
1825
  options: e
1823
1826
  };
1824
1827
  }
1825
- function pr(e) {
1828
+ function vr(e) {
1826
1829
  const t = e.layout?.gaps;
1827
1830
  if (t === void 0) return e;
1828
1831
  const r = {};
@@ -1838,7 +1841,7 @@ function pr(e) {
1838
1841
  }
1839
1842
  };
1840
1843
  }
1841
- var ca = [
1844
+ var ga = [
1842
1845
  "lilac",
1843
1846
  "neon_pink",
1844
1847
  "blackberry",
@@ -1852,100 +1855,105 @@ var ca = [
1852
1855
  "cool",
1853
1856
  "fresh"
1854
1857
  ];
1855
- function da(e) {
1858
+ function ba(e) {
1856
1859
  return {
1857
1860
  type: "config",
1858
- config: pr(e)
1861
+ config: vr(e)
1859
1862
  };
1860
1863
  }
1861
1864
  export {
1862
- qe as $,
1863
- qr as A,
1864
- Ar as At,
1865
- Pr as B,
1866
- x as C,
1867
- je as Ct,
1868
- Xr as D,
1869
- se as Dt,
1870
- m as E,
1871
- Ue as Et,
1872
- Oe as F,
1873
- Mr as Ft,
1874
- jr as G,
1875
- Nt as H,
1876
- zr as I,
1877
- Xe as J,
1878
- et as K,
1879
- $r as L,
1880
- Kr as M,
1881
- _r as Mt,
1882
- Hr as N,
1883
- ae as Nt,
1884
- Jr as O,
1885
- $e as Ot,
1886
- Gr as P,
1887
- vr as Pt,
1888
- ue as Q,
1889
- Yr as R,
1890
- W as S,
1891
- Be as St,
1892
- z as T,
1893
- Ye as Tt,
1894
- K as U,
1895
- Ot as V,
1896
- bt as W,
1897
- Vr as X,
1898
- He as Y,
1899
- xr as Z,
1900
- qt as _,
1901
- G as _t,
1902
- ia as a,
1903
- Ke as at,
1904
- ea as b,
1905
- Dr as bt,
1906
- nr as c,
1907
- Cr as ct,
1908
- ta as d,
1909
- D as dt,
1910
- P as et,
1911
- ra as f,
1912
- kr as ft,
1913
- S as g,
1914
- We as gt,
1915
- na as h,
1916
- Sr as ht,
1917
- la as i,
1918
- le as it,
1919
- Wr as j,
1920
- c as jt,
1921
- Qr as k,
1922
- Tr as kt,
1923
- tr as l,
1924
- Rr as lt,
1925
- E as m,
1926
- Or as mt,
1927
- da as n,
1928
- v as nt,
1929
- oa as o,
1930
- Ge as ot,
1931
- aa as p,
1932
- oe as pt,
1933
- be as q,
1934
- ua as r,
1935
- B as rt,
1936
- sa as s,
1937
- Lr as st,
1938
- ca as t,
1865
+ Ze as $,
1866
+ z as A,
1867
+ ze as At,
1868
+ Re as B,
1869
+ Ar as Bt,
1870
+ C,
1871
+ Or as Ct,
1872
+ W as D,
1873
+ je as Dt,
1874
+ Qt as E,
1875
+ Ge as Et,
1876
+ Qr as F,
1877
+ wr as Ft,
1878
+ $r as G,
1879
+ zr as H,
1880
+ Kr as I,
1881
+ c as It,
1882
+ K as J,
1883
+ Lt as K,
1884
+ qr as L,
1885
+ Dr as Lt,
1886
+ Jr as M,
1887
+ oe as Mt,
1888
+ ea as N,
1889
+ Ye as Nt,
1890
+ x as O,
1891
+ Ue as Ot,
1892
+ Zr as P,
1893
+ Nr as Pt,
1894
+ he as Q,
1895
+ Xr as R,
1896
+ ne as Rt,
1897
+ Jt as S,
1898
+ G as St,
1899
+ ra as T,
1900
+ Ke as Tt,
1901
+ Wr as U,
1902
+ Gr as V,
1903
+ Yr as W,
1904
+ Pr as X,
1905
+ Mt as Y,
1906
+ at as Z,
1907
+ na as _,
1908
+ Lr as _t,
1909
+ fa as a,
1910
+ U as at,
1911
+ oa as b,
1912
+ Rr as bt,
1913
+ lr as c,
1914
+ B as ct,
1915
+ ir as d,
1916
+ qe as dt,
1917
+ Qe as et,
1918
+ nr as f,
1919
+ Vr as ft,
1920
+ aa as g,
1921
+ D as gt,
1922
+ ua as h,
1923
+ xr as ht,
1924
+ ma as i,
1925
+ Je as it,
1926
+ m as j,
1927
+ $e as jt,
1928
+ _ as k,
1929
+ Pe as kt,
1930
+ ia as l,
1931
+ ue as lt,
1932
+ ca as m,
1933
+ Cr as mt,
1934
+ ba as n,
1935
+ jr as nt,
1936
+ ya as o,
1937
+ Ur as ot,
1938
+ or as p,
1939
+ Ir as pt,
1940
+ Ot as q,
1941
+ pa as r,
1942
+ ce as rt,
1943
+ da as s,
1944
+ v as st,
1945
+ ga as t,
1939
1946
  Br as tt,
1940
- ar as u,
1941
- Ir as ut,
1942
- L as v,
1943
- wr as vt,
1944
- _ as w,
1945
- Pe as wt,
1946
- Ht as x,
1947
- Fr as xt,
1948
- Zr as y,
1949
- Nr as yt,
1950
- Ur as z
1947
+ la as u,
1948
+ Xe as ut,
1949
+ sa as v,
1950
+ ie as vt,
1951
+ ta as w,
1952
+ Sr as wt,
1953
+ S as x,
1954
+ He as xt,
1955
+ E as y,
1956
+ kr as yt,
1957
+ Hr as z,
1958
+ Tr as zt
1951
1959
  };