@divami-artefacts/ai-design-system 1.0.54 → 1.0.55

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.js CHANGED
@@ -24,6 +24,7 @@ var u = {
24
24
  amber: "#EEBF3B",
25
25
  teal: "#69DFE9",
26
26
  tealDark: "#00818F",
27
+ barBg: "#7DB9DF",
27
28
  t1: "#F7F9FA",
28
29
  t2: "#B3B5B6",
29
30
  t3: "#94979C",
@@ -59,31 +60,43 @@ var u = {
59
60
  u.green,
60
61
  u.red
61
62
  ], m = [
62
- u.teal,
63
- u.purple,
64
- u.amber,
65
- u.blue,
66
- u.green
67
- ], h = {
63
+ d.teal,
64
+ d.mint,
65
+ d.sky,
66
+ d.blue,
67
+ d.royal,
68
+ d.purple,
69
+ d.violet,
70
+ d.magenta
71
+ ], h = [
72
+ f.teal,
73
+ f.mint,
74
+ f.sky,
75
+ f.blue,
76
+ f.royal,
77
+ f.purple,
78
+ f.violet,
79
+ f.magenta
80
+ ], g = {
68
81
  font: "400 16px 'Satoshi Variable', 'DM Sans', sans-serif",
69
82
  color: "#F7F7F7",
70
83
  letterSpacing: "0px"
71
- }, g = {
84
+ }, _ = {
72
85
  font: "500 16px 'Satoshi Variable', 'DM Sans', sans-serif",
73
86
  color: "#F7F7F7"
74
- }, _ = {
87
+ }, v = {
75
88
  font: "400 18px 'Satoshi Variable', 'DM Sans', sans-serif",
76
89
  color: "#B3B5B6",
77
90
  letterSpacing: "0px"
78
91
  };
79
- function v(e, t = 1) {
92
+ function y(e, t = 1) {
80
93
  let n = e.replace("#", "");
81
94
  return `rgba(${parseInt(n.substring(0, 2), 16)},${parseInt(n.substring(2, 4), 16)},${parseInt(n.substring(4, 6), 16)},${t})`;
82
95
  }
83
- function y(e, t, n) {
96
+ function b(e, t, n) {
84
97
  return e + (t - e) * n;
85
98
  }
86
- function b(e, t, n) {
99
+ function x(e, t, n) {
87
100
  let r = (e) => {
88
101
  let t = e.replace("#", "");
89
102
  return [
@@ -93,34 +106,34 @@ function b(e, t, n) {
93
106
  ];
94
107
  }, [i, a, o] = r(e), [s, c, l] = r(t), u = (e) => Math.max(0, Math.min(255, Math.round(e)));
95
108
  return [
96
- u(y(i, s, n)),
97
- u(y(a, c, n)),
98
- u(y(o, l, n))
109
+ u(b(i, s, n)),
110
+ u(b(a, c, n)),
111
+ u(b(o, l, n))
99
112
  ].map((e) => e.toString(16).padStart(2, "0")).join("").replace(/^/, "#");
100
113
  }
101
- function x(e, t, n, r = 2) {
114
+ function S(e, t, n, r = 2) {
102
115
  e.width = t * r, e.height = n * r;
103
116
  let i = e.getContext("2d");
104
117
  return i.scale(r, r), i;
105
118
  }
106
- function S(e, t, n, r, i, a = .3) {
119
+ function C(e, t, n, r, i, a = .3) {
107
120
  let o = e.createRadialGradient(t, n, 0, t, n, r);
108
- o.addColorStop(0, v(i, a)), o.addColorStop(1, v(i, 0)), e.fillStyle = o, e.beginPath(), e.arc(t, n, r, 0, Math.PI * 2), e.fill();
121
+ o.addColorStop(0, y(i, a)), o.addColorStop(1, y(i, 0)), e.fillStyle = o, e.beginPath(), e.arc(t, n, r, 0, Math.PI * 2), e.fill();
109
122
  }
110
- function C(e, t, n, r, i = 50, a = v(u.blue, .05)) {
123
+ function w(e, t, n, r, i = 50, a = y(u.blue, .05)) {
111
124
  for (let o = 0; o < i; o++) e.beginPath(), e.arc((Math.sin(r * .001 + o * 23) * .5 + .5) * t, (Math.cos(r * 8e-4 + o * 37) * .5 + .5) * n, .6, 0, Math.PI * 2), e.fillStyle = a, e.fill();
112
125
  }
113
- function w(e, t, n, r, i = .015) {
126
+ function T(e, t, n, r, i = .015) {
114
127
  e.fillStyle = `rgba(0,0,0,${i})`;
115
128
  let a = r * .5 % 6;
116
129
  for (let r = a; r < n; r += 3) e.fillRect(0, r, t, 1);
117
130
  }
118
- function T(e, t, n, r, i = v(u.t1, .08)) {
131
+ function E(e, t, n, r, i = y(u.t1, .08)) {
119
132
  e.strokeStyle = i, e.lineWidth = 1, e.setLineDash([3, 3]), e.beginPath(), e.moveTo(t, n), e.lineTo(t, r), e.stroke(), e.setLineDash([]);
120
133
  }
121
134
  //#endregion
122
135
  //#region src/canvas/CanvasTooltip.tsx
123
- function E({ visible: e, x: t, y: n, content: i, parentW: o, parentH: l }) {
136
+ function D({ visible: e, x: t, y: n, content: i, parentW: o, parentH: l }) {
124
137
  let d = a(null);
125
138
  if (r(() => {
126
139
  let r = d.current;
@@ -193,7 +206,7 @@ function E({ visible: e, x: t, y: n, content: i, parentW: o, parentH: l }) {
193
206
  }
194
207
  //#endregion
195
208
  //#region src/canvas/useCanvasInteraction.ts
196
- function D(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
209
+ function O(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
197
210
  let l = a({
198
211
  x: -1,
199
212
  y: -1,
@@ -273,7 +286,7 @@ function D(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
273
286
  hitZonesRef: d
274
287
  };
275
288
  }
276
- function O(e, t, n, r, i, a, o) {
289
+ function k(e, t, n, r, i, a, o) {
277
290
  e.push({
278
291
  id: t,
279
292
  data: a,
@@ -282,7 +295,7 @@ function O(e, t, n, r, i, a, o) {
282
295
  test: (e, t) => (e - n) ** 2 + (t - r) ** 2 <= i * i
283
296
  });
284
297
  }
285
- function k(e, t, n, r, i, a, o, s, c, l) {
298
+ function A(e, t, n, r, i, a, o, s, c, l) {
286
299
  e.push({
287
300
  id: t,
288
301
  data: o,
@@ -294,14 +307,14 @@ function k(e, t, n, r, i, a, o, s, c, l) {
294
307
  }
295
308
  //#endregion
296
309
  //#region src/canvas/easing.ts
297
- var A = (e) => 1 - (1 - e) ** 3, j = (e) => 1 - (1 - e) ** 4, M = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), N = (e) => {
310
+ var j = (e) => 1 - (1 - e) ** 3, M = (e) => 1 - (1 - e) ** 4, N = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), P = (e) => {
298
311
  let t = 1.70158;
299
312
  return 1 + (t + 1) * (e - 1) ** 3 + t * (e - 1) ** 2;
300
- }, P = (e, t = .04, n = .001) => Math.sin(e * t) * Math.exp(-Math.min(e * n, 4)), F = (e, t, n, r = A) => {
313
+ }, F = (e, t = .04, n = .001) => Math.sin(e * t) * Math.exp(-Math.min(e * n, 4)), I = (e, t, n, r = j) => {
301
314
  let i = Math.min(.06, .5 / n), a = t * i, o = 1 - (n - 1) * i;
302
315
  return r(Math.max(0, Math.min((e - a) / o, 1)));
303
316
  };
304
- function I(e, t, n = .12) {
317
+ function L(e, t, n = .12) {
305
318
  e.forEach((r, i) => {
306
319
  let a = i === t ? 1 : 0, o = r + (a - r) * n;
307
320
  Math.abs(o - a) < .005 ? a === 0 ? e.delete(i) : e.set(i, 1) : e.set(i, o);
@@ -309,66 +322,66 @@ function I(e, t, n = .12) {
309
322
  }
310
323
  //#endregion
311
324
  //#region src/components/common/SeriesChart.tsx
312
- var L = 760, R = 250;
313
- function z({ rows: e = [], variant: t, className: r, colors: i }) {
314
- let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), { mouseRef: p, hoveredRef: m, tooltip: h, hitZonesRef: g } = D(o, {
315
- width: L,
316
- height: R
325
+ var R = 760, z = 250;
326
+ function B({ rows: e = [], variant: t, className: r, colors: i }) {
327
+ let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), { mouseRef: p, hoveredRef: m, tooltip: h, hitZonesRef: g } = O(o, {
328
+ width: R,
329
+ height: z
317
330
  });
318
331
  return n(() => {
319
332
  let n = o.current;
320
333
  if (!n) return;
321
- let r = x(n, L, R);
334
+ let r = S(n, R, z);
322
335
  f.current = 0;
323
336
  let a = i?.line ?? u.blue, s = i?.point ?? u.blue, c = i?.axisLine ?? u.bd, l = i?.areaFill ?? u.blue, h = {
324
337
  top: 24,
325
338
  right: 24,
326
339
  bottom: 44,
327
340
  left: 24
328
- }, _ = L - h.left - h.right, y = R - h.top - h.bottom, b, C = () => {
341
+ }, _ = R - h.left - h.right, v = z - h.top - h.bottom, b, x = () => {
329
342
  f.current++;
330
343
  let n = f.current;
331
- if (r.clearRect(0, 0, L, R), e.length < 2) {
332
- b = requestAnimationFrame(C);
344
+ if (r.clearRect(0, 0, R, z), e.length < 2) {
345
+ b = requestAnimationFrame(x);
333
346
  return;
334
347
  }
335
- let i = e.map((e) => e.pricing ?? 0), o = Math.max(100, ...i), x = (t) => h.left + t / (e.length - 1) * _, w = (e) => h.top + (1 - e / o) * y, E = M(Math.min(n / 48, 1)), D = Math.max(2, Math.floor(E * e.length));
336
- I(d.current, m.current), g.current = [], r.strokeStyle = v(u.bd, .2), r.lineWidth = .5;
348
+ let i = e.map((e) => e.pricing ?? 0), o = Math.max(100, ...i), S = (t) => h.left + t / (e.length - 1) * _, w = (e) => h.top + (1 - e / o) * v, T = N(Math.min(n / 48, 1)), D = Math.max(2, Math.floor(T * e.length));
349
+ L(d.current, m.current), g.current = [], r.strokeStyle = y(u.bd, .2), r.lineWidth = .5;
337
350
  for (let e = 0; e <= 4; e++) {
338
- let t = h.top + e / 4 * y;
351
+ let t = h.top + e / 4 * v;
339
352
  r.beginPath(), r.moveTo(h.left, t), r.lineTo(h.left + _, t), r.stroke();
340
353
  }
341
- if (r.strokeStyle = v(c, .4), r.lineWidth = 1, r.setLineDash([]), r.beginPath(), r.moveTo(h.left, w(0)), r.lineTo(h.left + _, w(0)), r.stroke(), p.current.over && m.current) {
354
+ if (r.strokeStyle = y(c, .4), r.lineWidth = 1, r.setLineDash([]), r.beginPath(), r.moveTo(h.left, w(0)), r.lineTo(h.left + _, w(0)), r.stroke(), p.current.over && m.current) {
342
355
  let e = parseInt(m.current.split("-")[1]);
343
- isNaN(e) || T(r, x(e), h.top, h.top + y);
356
+ isNaN(e) || E(r, S(e), h.top, h.top + v);
344
357
  }
345
358
  if (t === "area" && D > 1) {
346
- let t = r.createLinearGradient(0, h.top, 0, h.top + y);
347
- t.addColorStop(0, v(l, .12)), t.addColorStop(1, v(l, 0)), r.fillStyle = t, r.beginPath(), r.moveTo(x(0), h.top + y);
348
- for (let t = 0; t < D; t++) r.lineTo(x(t), w(e[t].pricing ?? 0));
349
- r.lineTo(x(D - 1), h.top + y), r.closePath(), r.fill();
359
+ let t = r.createLinearGradient(0, h.top, 0, h.top + v);
360
+ t.addColorStop(0, y(l, .12)), t.addColorStop(1, y(l, 0)), r.fillStyle = t, r.beginPath(), r.moveTo(S(0), h.top + v);
361
+ for (let t = 0; t < D; t++) r.lineTo(S(t), w(e[t].pricing ?? 0));
362
+ r.lineTo(S(D - 1), h.top + v), r.closePath(), r.fill();
350
363
  }
351
364
  if (D > 1) {
352
- r.strokeStyle = v(a, .85), r.lineWidth = 2, r.setLineDash([]), r.beginPath();
365
+ r.strokeStyle = y(a, .85), r.lineWidth = 2, r.setLineDash([]), r.beginPath();
353
366
  for (let t = 0; t < D; t++) {
354
- let n = x(t), i = w(e[t].pricing ?? 0);
367
+ let n = S(t), i = w(e[t].pricing ?? 0);
355
368
  t === 0 ? r.moveTo(n, i) : r.lineTo(n, i);
356
369
  }
357
370
  r.stroke();
358
371
  }
359
372
  for (let i = 0; i < D; i++) {
360
- let a = x(i), o = w(e[i].pricing ?? 0), c = `sc-${i}`, l = d.current.get(c) ?? 0, f = i === e.length - 1;
361
- O(g.current, c, a, o, 12, {
373
+ let a = S(i), o = w(e[i].pricing ?? 0), c = `sc-${i}`, l = d.current.get(c) ?? 0, f = i === e.length - 1;
374
+ k(g.current, c, a, o, 12, {
362
375
  label: e[i].vendor,
363
376
  value: String(e[i].pricing ?? 0),
364
377
  color: f ? u.red : s
365
- }), l > 0 && S(r, a, o, 16 * l, s, .2 * l);
366
- let p = f ? P(n, .05, 5e-4) : 0, m = t === "area" ? 5 : 6;
367
- f ? (r.shadowColor = v(u.red, .5), r.shadowBlur = (8 + p * 4) * (1 + l * .5), r.fillStyle = u.red, r.beginPath(), r.arc(a, o, (m + p * 1.5) * (1 + l * .3), 0, Math.PI * 2), r.fill(), r.shadowBlur = 0) : (r.fillStyle = v(s, .7 + l * .3), r.beginPath(), r.arc(a, o, m + l * 2, 0, Math.PI * 2), r.fill()), r.font = "10px 'JetBrains Mono', monospace", r.fillStyle = v(u.t3, .6 + l * .3), r.textAlign = "center", r.fillText(e[i].vendor, a, R - 14);
378
+ }), l > 0 && C(r, a, o, 16 * l, s, .2 * l);
379
+ let p = f ? F(n, .05, 5e-4) : 0, m = t === "area" ? 5 : 6;
380
+ f ? (r.shadowColor = y(u.red, .5), r.shadowBlur = (8 + p * 4) * (1 + l * .5), r.fillStyle = u.red, r.beginPath(), r.arc(a, o, (m + p * 1.5) * (1 + l * .3), 0, Math.PI * 2), r.fill(), r.shadowBlur = 0) : (r.fillStyle = y(s, .7 + l * .3), r.beginPath(), r.arc(a, o, m + l * 2, 0, Math.PI * 2), r.fill()), r.font = "10px 'JetBrains Mono', monospace", r.fillStyle = y(u.t3, .6 + l * .3), r.textAlign = "center", r.fillText(e[i].vendor, a, z - 14);
368
381
  }
369
- b = requestAnimationFrame(C);
382
+ b = requestAnimationFrame(x);
370
383
  };
371
- return C(), () => cancelAnimationFrame(b);
384
+ return x(), () => cancelAnimationFrame(b);
372
385
  }, [
373
386
  e,
374
387
  t,
@@ -378,31 +391,31 @@ function z({ rows: e = [], variant: t, className: r, colors: i }) {
378
391
  children: /* @__PURE__ */ c("div", {
379
392
  style: {
380
393
  position: "relative",
381
- width: L,
382
- height: R
394
+ width: R,
395
+ height: z
383
396
  },
384
397
  children: [/* @__PURE__ */ s("canvas", {
385
398
  ref: o,
386
399
  role: "img",
387
400
  "aria-label": `${t} chart`,
388
401
  style: {
389
- width: L,
390
- height: R,
402
+ width: R,
403
+ height: z,
391
404
  display: "block",
392
405
  borderRadius: 8
393
406
  }
394
- }), /* @__PURE__ */ s(E, {
407
+ }), /* @__PURE__ */ s(D, {
395
408
  ...h,
396
- parentW: L,
397
- parentH: R
409
+ parentW: R,
410
+ parentH: z
398
411
  })]
399
412
  })
400
413
  });
401
414
  }
402
415
  //#endregion
403
416
  //#region src/components/areaChart/AreaChart.tsx
404
- function B({ rows: e = [], className: t, colors: n }) {
405
- return /* @__PURE__ */ s(z, {
417
+ function V({ rows: e = [], className: t, colors: n }) {
418
+ return /* @__PURE__ */ s(B, {
406
419
  rows: e,
407
420
  variant: "area",
408
421
  className: t,
@@ -411,69 +424,69 @@ function B({ rows: e = [], className: t, colors: n }) {
411
424
  }
412
425
  //#endregion
413
426
  //#region src/components/barChart/BarChart.tsx
414
- var V = 760, H = 280;
415
- function U({ rows: e = [], className: t, colors: r }) {
416
- let i = a(null), o = a(/* @__PURE__ */ new Map()), d = a(0), { hoveredRef: f, tooltip: m, hitZonesRef: h } = D(i, {
417
- width: V,
418
- height: H
427
+ var H = 760, U = 280;
428
+ function W({ rows: e = [], className: t, colors: r }) {
429
+ let i = a(null), o = a(/* @__PURE__ */ new Map()), d = a(0), { hoveredRef: f, tooltip: m, hitZonesRef: h } = O(i, {
430
+ width: H,
431
+ height: U
419
432
  });
420
433
  return n(() => {
421
434
  let t = i.current;
422
435
  if (!t) return;
423
- let n = x(t, V, H);
436
+ let n = S(t, H, U);
424
437
  d.current = 0;
425
438
  let a = r?.bars ?? p, s = r?.axisLine ?? u.bd, c = r?.valueLabel ?? u.t2, l = {
426
439
  top: 24,
427
440
  right: 24,
428
441
  bottom: 56,
429
442
  left: 24
430
- }, m = H - l.top - l.bottom, g = (V - l.left - l.right) / Math.max(e.length, 1), _ = Math.max(100, ...e.map((e) => e.pricing ?? 0)), y = l.top + m, b, C = () => {
443
+ }, m = U - l.top - l.bottom, g = (H - l.left - l.right) / Math.max(e.length, 1), _ = Math.max(100, ...e.map((e) => e.pricing ?? 0)), v = l.top + m, b, x = () => {
431
444
  d.current++;
432
445
  let t = d.current;
433
- n.clearRect(0, 0, V, H);
434
- let r = j(Math.min(t / 48, 1));
435
- I(o.current, f.current), h.current = [], n.strokeStyle = v(s, .4), n.lineWidth = 1, n.setLineDash([]), n.beginPath(), n.moveTo(l.left, y), n.lineTo(V - l.right, y), n.stroke(), e.forEach((t, i) => {
436
- let s = l.left + i * g, d = F(r, i, e.length, j), f = _ > 0 ? (t.pricing ?? 0) / _ * m : 0, p = Math.max(f > 0 ? 4 : 0, f * d), b = a[i % a.length], x = o.current.get(t.id ?? `bar-${i}`) ?? 0;
437
- k(h.current, t.id ?? `bar-${i}`, s + 4, y - p, g - 8, p, {
446
+ n.clearRect(0, 0, H, U);
447
+ let r = M(Math.min(t / 48, 1));
448
+ L(o.current, f.current), h.current = [], n.strokeStyle = y(s, .4), n.lineWidth = 1, n.setLineDash([]), n.beginPath(), n.moveTo(l.left, v), n.lineTo(H - l.right, v), n.stroke(), e.forEach((t, i) => {
449
+ let s = l.left + i * g, d = I(r, i, e.length, M), f = _ > 0 ? (t.pricing ?? 0) / _ * m : 0, p = Math.max(f > 0 ? 4 : 0, f * d), b = a[i % a.length], x = o.current.get(t.id ?? `bar-${i}`) ?? 0;
450
+ A(h.current, t.id ?? `bar-${i}`, s + 4, v - p, g - 8, p, {
438
451
  label: t.vendor,
439
452
  value: String(t.pricing ?? 0),
440
453
  color: b
441
- }), p > 0 && (x > 0 && S(n, s + g / 2, y - p / 2, g * .8, b, .12 * x), n.shadowColor = v(b, .2 * (x > 0 ? x : 0)), n.shadowBlur = x > 0 ? 6 : 0, n.fillStyle = v(b, .5 + x * .25), n.beginPath(), n.roundRect(s + 4, y - p, g - 8, p, [
454
+ }), p > 0 && (x > 0 && C(n, s + g / 2, v - p / 2, g * .8, b, .12 * x), n.shadowColor = y(b, .2 * (x > 0 ? x : 0)), n.shadowBlur = x > 0 ? 6 : 0, n.fillStyle = y(b, .5 + x * .25), n.beginPath(), n.roundRect(s + 4, v - p, g - 8, p, [
442
455
  4,
443
456
  4,
444
457
  0,
445
458
  0
446
- ]), n.fill(), n.shadowBlur = 0, x > 0 && (n.strokeStyle = v(b, .4 * x), n.lineWidth = 1, n.beginPath(), n.roundRect(s + 4, y - p, g - 8, p, [
459
+ ]), n.fill(), n.shadowBlur = 0, x > 0 && (n.strokeStyle = y(b, .4 * x), n.lineWidth = 1, n.beginPath(), n.roundRect(s + 4, v - p, g - 8, p, [
447
460
  4,
448
461
  4,
449
462
  0,
450
463
  0
451
- ]), n.stroke())), d > .5 && p > 0 && (n.globalAlpha = Math.min(1, (d - .5) * 2), n.font = "bold 10px 'JetBrains Mono', monospace", n.fillStyle = x > 0 ? b : v(c, .7), n.textAlign = "center", n.fillText(String(t.pricing ?? ""), s + g / 2, y - p - 6), n.globalAlpha = 1), n.font = `${x > 0 ? "bold " : ""}9px 'JetBrains Mono', monospace`, n.fillStyle = x > 0 ? b : v(u.t3, .6), n.textAlign = "center", n.fillText(t.vendor, s + g / 2, H - 14);
452
- }), b = requestAnimationFrame(C);
464
+ ]), n.stroke())), d > .5 && p > 0 && (n.globalAlpha = Math.min(1, (d - .5) * 2), n.font = "bold 10px 'JetBrains Mono', monospace", n.fillStyle = x > 0 ? b : y(c, .7), n.textAlign = "center", n.fillText(String(t.pricing ?? ""), s + g / 2, v - p - 6), n.globalAlpha = 1), n.font = `${x > 0 ? "bold " : ""}9px 'JetBrains Mono', monospace`, n.fillStyle = x > 0 ? b : y(u.t3, .6), n.textAlign = "center", n.fillText(t.vendor, s + g / 2, U - 14);
465
+ }), b = requestAnimationFrame(x);
453
466
  };
454
- return C(), () => cancelAnimationFrame(b);
467
+ return x(), () => cancelAnimationFrame(b);
455
468
  }, [e, r]), /* @__PURE__ */ s(l, {
456
469
  className: t,
457
470
  children: /* @__PURE__ */ c("div", {
458
471
  style: {
459
472
  position: "relative",
460
- width: V,
461
- height: H
473
+ width: H,
474
+ height: U
462
475
  },
463
476
  children: [/* @__PURE__ */ s("canvas", {
464
477
  ref: i,
465
478
  role: "img",
466
479
  "aria-label": "bar chart",
467
480
  style: {
468
- width: V,
469
- height: H,
481
+ width: H,
482
+ height: U,
470
483
  display: "block",
471
484
  borderRadius: 8
472
485
  }
473
- }), /* @__PURE__ */ s(E, {
486
+ }), /* @__PURE__ */ s(D, {
474
487
  ...m,
475
- parentW: V,
476
- parentH: H
488
+ parentW: H,
489
+ parentH: U
477
490
  })]
478
491
  })
479
492
  });
@@ -494,7 +507,7 @@ function ee(e) {
494
507
  }
495
508
  //#endregion
496
509
  //#region src/components/common/ChartEmptyState.tsx
497
- function W({ width: e, height: t, message: n = "No data available", testID: r }) {
510
+ function G({ width: e, height: t, message: n = "No data available", testID: r }) {
498
511
  return /* @__PURE__ */ s("div", {
499
512
  "data-testid": r,
500
513
  style: {
@@ -557,7 +570,7 @@ function te({ expanded: e, onToggle: t, labelExpanded: n = "View Less", labelCol
557
570
  }
558
571
  //#endregion
559
572
  //#region src/utils/numberFormat.ts
560
- var G = [
573
+ var ne = [
561
574
  {
562
575
  value: 0xe8d4a51000,
563
576
  suffix: "T",
@@ -581,79 +594,79 @@ var G = [
581
594
  ];
582
595
  function K(e, t = 1) {
583
596
  let n = Math.abs(e), r = e < 0 ? "-" : "";
584
- for (let e of G) if (n >= e.value) return `${r}${(n / e.divisor).toFixed(t)}${e.suffix}`;
597
+ for (let e of ne) if (n >= e.value) return `${r}${(n / e.divisor).toFixed(t)}${e.suffix}`;
585
598
  return `${r}${n.toFixed(0)}`;
586
599
  }
587
600
  //#endregion
588
601
  //#region src/components/progressRaceChart/ProgressRaceChart.tsx
589
- var ne = 660, q = 6, re = 30, ie = re / 2, ae = re / 2, oe = 8;
590
- function se(e, t, n) {
602
+ var re = 660, ie = 4, ae = 30, oe = ae / 2, se = ae / 2, ce = 8;
603
+ function le(e, t, n) {
591
604
  if (e.measureText(t).width <= n) return t;
592
605
  let r = t;
593
606
  for (; r.length > 0 && e.measureText(r + "…").width > n;) r = r.slice(0, -1);
594
607
  return r + "…";
595
608
  }
596
- function ce({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, colorOffset: f = 0, testID: p }) {
597
- let [_, y] = ee(ne), b = a(null), T = a(0), j = a(/* @__PURE__ */ new Map()), M = a(d);
609
+ function ue({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, colorOffset: f = 0, testID: p }) {
610
+ let [h, v] = ee(re), b = a(null), x = a(0), E = a(/* @__PURE__ */ new Map()), M = a(d);
598
611
  M.current = d;
599
612
  let N = a([]), P = t((e, t) => {
600
613
  let n = typeof t == "object" ? t.label ?? e : e, r = N.current.find((t) => t.id === e);
601
614
  l?.(e, n, r?.subentity);
602
- }, [l]), [F, I] = o(!1), L = !!(d && r?.[d]), R = L ? r[d] : e, z = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), B = i(() => R.filter((e) => typeof e == "object" && !!e), [R]), V = i(() => [...B].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [B]), H = i(() => F ? V : V.slice(0, oe), [V, F]);
615
+ }, [l]), [F, I] = o(!1), L = !!(d && r?.[d]), R = L ? r[d] : e, z = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), B = i(() => R.filter((e) => typeof e == "object" && !!e), [R]), V = i(() => [...B].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [B]), H = i(() => F ? V : V.slice(0, ce), [V, F]);
603
616
  N.current = H;
604
- let U = H.length, G = ie + ae + U * q + Math.max(0, U - 1) * re, { hoveredRef: ce, tooltip: le, hitZonesRef: ue } = D(b, {
605
- width: y,
606
- height: G,
617
+ let U = H.length, W = oe + se + U * ie + Math.max(0, U - 1) * ae, { hoveredRef: ne, tooltip: ue, hitZonesRef: de } = O(b, {
618
+ width: v,
619
+ height: W,
607
620
  onClick: l ? P : void 0
608
621
  });
609
622
  return n(() => {
610
623
  let e = b.current;
611
624
  if (!e) return;
612
- let t = x(e, y, G);
613
- T.current = 0, t.font = h.font, t.letterSpacing = h.letterSpacing;
625
+ let t = S(e, v, W);
626
+ x.current = 0, t.font = g.font, t.letterSpacing = g.letterSpacing;
614
627
  let n = H.reduce((e, n) => Math.max(e, t.measureText(n.name ?? n.abbreviation ?? "").width), 0);
615
- t.font = g.font;
616
- let r = H.reduce((e, n) => Math.max(e, t.measureText(K(n.total ?? 0)).width), 0), i = Math.max(Math.min(n + 20, y * .3), 40), a = Math.max(r + 20, 28), o = y - i - a, s = m[f % m.length], c, l = () => {
617
- T.current++;
618
- let e = T.current;
619
- t.clearRect(0, 0, y, G), t.letterSpacing = h.letterSpacing, ue.current = [], j.current.forEach((e, t) => {
620
- let n = t === ce.current ? 1 : 0, r = e + (n - e) * .12;
621
- Math.abs(r - n) < .005 ? n === 0 ? j.current.delete(t) : j.current.set(t, 1) : j.current.set(t, r);
622
- }), ce.current && !j.current.has(ce.current) && j.current.set(ce.current, 0), C(t, y, G, e, 40, v(u.blue, .04));
628
+ t.font = _.font;
629
+ let r = H.reduce((e, n) => Math.max(e, t.measureText(K(n.total ?? 0)).width), 0), i = Math.max(Math.min(n + 20, v * .3), 40), a = Math.max(r + 20, 28), o = v - i - a, [s, c] = m[f % m.length], l, d = () => {
630
+ x.current++;
631
+ let e = x.current;
632
+ t.clearRect(0, 0, v, W), t.letterSpacing = g.letterSpacing, de.current = [], E.current.forEach((e, t) => {
633
+ let n = t === ne.current ? 1 : 0, r = e + (n - e) * .12;
634
+ Math.abs(r - n) < .005 ? n === 0 ? E.current.delete(t) : E.current.set(t, 1) : E.current.set(t, r);
635
+ }), ne.current && !E.current.has(ne.current) && E.current.set(ne.current, 0), w(t, v, W, e, 40, y(c, .04));
623
636
  let n = Math.max(...H.map((e) => e.total ?? 0), 1);
624
- H.forEach((r, a) => {
625
- let c = j.current.get(r.id) ?? 0, l = !L && M.current && r.id !== M.current ? .2 : 1, d = ie + a * (q + re), f = t.createLinearGradient(i, 0, i + o, 0);
626
- f.addColorStop(0, v(u.tealDark, .55 + c * .1)), f.addColorStop(1, v(u.tealDark, .22 + c * .08)), t.fillStyle = f, t.beginPath(), t.rect(i, d, o, q), t.fill();
627
- let p = (r.total ?? 0) / n, m = i + o * Math.min(p, p * A(Math.min(1, e * .005)));
628
- if (m > i + 2) {
629
- let e = t.createLinearGradient(i, 0, m, 0);
630
- e.addColorStop(0, v(s, .55 * l)), e.addColorStop(1, v(s, .9 * l)), t.fillStyle = e, t.beginPath(), t.rect(i, d, m - i, q), t.fill();
637
+ H.forEach((a, l) => {
638
+ let d = E.current.get(a.id) ?? 0, f = !L && M.current && a.id !== M.current ? .6 : 1, p = oe + l * (ie + ae);
639
+ t.fillStyle = y(u.barBg, .2), t.beginPath(), t.rect(i, p, o, ie), t.fill();
640
+ let m = (a.total ?? 0) / n, h = i + o * Math.min(m, m * j(Math.min(1, e * .005)));
641
+ if (h > i + 2) {
642
+ let e = t.createLinearGradient(i, 0, h, 0);
643
+ e.addColorStop(0, y(s, .75 * f)), e.addColorStop(1, y(c, .95 * f)), t.fillStyle = e, t.beginPath(), t.rect(i, p, h - i, ie), t.fill();
631
644
  }
632
- c > 0 && S(t, m, d + q / 2, 12 * c, s, .35 * c);
633
- let _ = {
634
- label: r.name,
635
- sublabel: r.totalLabel ?? (r.total == null ? void 0 : K(r.total)),
636
- color: s
645
+ d > 0 && C(t, h, p + ie / 2, 12 * d, c, .35 * d);
646
+ let v = {
647
+ label: a.name,
648
+ sublabel: a.totalLabel ?? (a.total == null ? void 0 : K(a.total)),
649
+ color: c
637
650
  };
638
- k(ue.current, r.id, 0, d - re / 2, i + o, q + re, _), O(ue.current, r.id, m, d + q / 2, 10, _), t.font = g.font, t.fillStyle = c > 0 ? v(s, 1 * l) : v(u.t1, .85 * l), t.textAlign = "left", t.textBaseline = "middle", t.fillText(K(r.total ?? 0), i + o + 12, d + q / 2), t.font = h.font, t.fillStyle = c > 0 ? v(s, 1 * l) : v(u.t2, .85 * l), t.textAlign = "right", t.fillText(se(t, r.name ?? r.abbreviation ?? "", i - 16), i - 8, d + q / 2);
639
- }), w(t, y, G, e, .015), c = requestAnimationFrame(l);
651
+ A(de.current, a.id, 0, p - ae / 2, i + o, ie + ae, v, void 0, i + o + 12 + r + 14), k(de.current, a.id, h, p + ie / 2, 10, v), t.font = _.font, t.fillStyle = d > 0 ? y(c, 1 * f) : y(u.t1, .85 * f), t.textAlign = "left", t.textBaseline = "middle", t.fillText(K(a.total ?? 0), i + o + 12, p + ie / 2), t.font = g.font, t.fillStyle = d > 0 ? y(c, 1 * f) : y(u.t2, .85 * f), t.textAlign = "right", t.fillText(le(t, a.name ?? a.abbreviation ?? "", i - 16), i - 8, p + ie / 2);
652
+ }), T(t, v, W, e, .015), l = requestAnimationFrame(d);
640
653
  };
641
- return l(), () => cancelAnimationFrame(c);
654
+ return d(), () => cancelAnimationFrame(l);
642
655
  }, [
643
656
  H,
644
- G,
657
+ W,
645
658
  f,
646
- y
659
+ v
647
660
  ]), V.length === 0 ? /* @__PURE__ */ s("div", {
648
- ref: _,
661
+ ref: h,
649
662
  style: { width: "100%" },
650
- children: /* @__PURE__ */ s(W, {
651
- width: y,
663
+ children: /* @__PURE__ */ s(G, {
664
+ width: v,
652
665
  height: 160,
653
666
  testID: p
654
667
  })
655
668
  }) : /* @__PURE__ */ c("div", {
656
- ref: _,
669
+ ref: h,
657
670
  "data-testid": p,
658
671
  style: { width: "100%" },
659
672
  children: [/* @__PURE__ */ c("div", {
@@ -664,16 +677,16 @@ function ce({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, co
664
677
  "aria-label": "Commitment race — contractors ranked by commitment percentage",
665
678
  style: {
666
679
  width: "100%",
667
- height: G,
680
+ height: W,
668
681
  display: "block",
669
682
  borderRadius: 8
670
683
  }
671
- }), /* @__PURE__ */ s(E, {
672
- ...le,
673
- parentW: y,
674
- parentH: G
684
+ }), /* @__PURE__ */ s(D, {
685
+ ...ue,
686
+ parentW: v,
687
+ parentH: W
675
688
  })]
676
- }), z.length > oe && /* @__PURE__ */ s("div", {
689
+ }), z.length > ce && /* @__PURE__ */ s("div", {
677
690
  style: { marginTop: 8 },
678
691
  children: /* @__PURE__ */ s(te, {
679
692
  expanded: F,
@@ -684,14 +697,8 @@ function ce({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, co
684
697
  }
685
698
  //#endregion
686
699
  //#region src/components/semiCircularGaugeChart/SemiCircularGaugeChart.tsx
687
- var le = 480, ue = 310, de = 18, fe = [
688
- "#00818F",
689
- "#5C42B8",
690
- "#C87B0A",
691
- "#2563EB",
692
- "#166534"
693
- ];
694
- function pe(e, t, n) {
700
+ var de = 480, fe = 310, pe = 18;
701
+ function me(e, t, n) {
695
702
  let r = t.split(" "), i = [], a = "";
696
703
  for (let t of r) {
697
704
  let r = a ? `${a} ${t}` : t;
@@ -699,89 +706,89 @@ function pe(e, t, n) {
699
706
  }
700
707
  return a && i.push(a), i;
701
708
  }
702
- function me({ confirmed: e, total: r, label: i, colorOffset: o = 0, selectedId: l, selectedLabel: d, gaugeByEntity: f, onItemClick: p, subentity: g, testID: y }) {
703
- let b = a(null), C = a(0), w = l && f?.[l] ? f[l] : {
709
+ function he({ confirmed: e, total: r, label: i, colorOffset: o = 0, selectedId: l, selectedLabel: d, gaugeByEntity: f, onItemClick: p, subentity: h, testID: _ }) {
710
+ let b = a(null), x = a(0), w = l && f?.[l] ? f[l] : {
704
711
  confirmed: e,
705
712
  total: r
706
- }, T = w.confirmed, O = w.total, j = t(() => {
707
- p?.("confirmed", i ?? "confirmed", g);
713
+ }, T = w.confirmed, E = w.total, k = t(() => {
714
+ p?.("confirmed", i ?? "confirmed", h);
708
715
  }, [
709
716
  p,
710
717
  i,
711
- g
712
- ]), { tooltip: M, hitZonesRef: P } = D(b, {
713
- width: le,
714
- height: ue,
715
- onClick: p ? j : void 0
718
+ h
719
+ ]), { tooltip: M, hitZonesRef: N } = O(b, {
720
+ width: de,
721
+ height: fe,
722
+ onClick: p ? k : void 0
716
723
  });
717
724
  return n(() => {
718
725
  let e = b.current;
719
726
  if (!e) return;
720
- let t = x(e, le, ue);
721
- C.current = 0;
722
- let n = o % m.length, r = m[n], a = fe[n], s = le / 2, c = Math.PI, l = 2 * Math.PI, d = Math.PI, f, p = () => {
723
- C.current++;
724
- let e = C.current;
725
- t.clearRect(0, 0, le, ue), t.letterSpacing = h.letterSpacing, P.current = [], k(P.current, "confirmed", s - 148, 27, 296, 148, {
727
+ let t = S(e, de, fe);
728
+ x.current = 0;
729
+ let [n, r] = m[o % m.length], a = de / 2, s = Math.PI, c = 2 * Math.PI, l = Math.PI, d, f = () => {
730
+ x.current++;
731
+ let e = x.current;
732
+ t.clearRect(0, 0, de, fe), t.letterSpacing = g.letterSpacing, N.current = [], A(N.current, "confirmed", a - 148, 27, 296, 148, {
726
733
  label: i ?? "Confirmed",
727
- value: `${K(T ?? 0)} / ${K(O ?? 0)}`,
728
- sublabel: `${Math.round((T ?? 0) / (O || 1) * 100)}%`,
734
+ value: `${K(T ?? 0)} / ${K(E ?? 0)}`,
735
+ sublabel: `${Math.round((T ?? 0) / (E || 1) * 100)}%`,
729
736
  color: r
730
737
  });
731
- let n = A(Math.min(e / 80, 1)), o = N(Math.min(e / 72, 1)), m = Math.round((T ?? 0) / (O || 1) * 100), g = c + m / 100 * d * n;
732
- t.beginPath(), t.arc(s, 175, 148, c, l), t.strokeStyle = v(r, .28), t.lineWidth = 4, t.lineCap = "round", t.stroke(), t.lineCap = "butt", t.beginPath(), t.moveTo(s, 175), t.arc(s, 175, 133, c, g), t.closePath(), t.fillStyle = v(a, .35 * n), t.fill();
733
- let y = s + Math.cos(g) * 148, b = 175 + Math.sin(g) * 148;
734
- S(t, y, b, 10, r, .3 * n);
735
- let x = t.createLinearGradient(s + Math.cos(c) * 148, 175 + Math.sin(c) * 148, y, b);
736
- x.addColorStop(0, v(a, .9 * n)), x.addColorStop(1, v(r, 1 * n)), t.beginPath(), t.arc(s, 175, 148, c, g), t.strokeStyle = x, t.lineWidth = 4, t.lineCap = "round", t.stroke(), t.lineCap = "butt";
737
- let w = c + m / 100 * d * o, E = s + Math.cos(w) * 133, D = 175 + Math.sin(w) * 133, j = s - Math.cos(w) * 24, M = 175 - Math.sin(w) * 24, F = -Math.sin(w), I = Math.cos(w), L = 2.5 * o;
738
- t.beginPath(), t.moveTo(E, D), t.lineTo(s + F * L, 175 + I * L), t.lineTo(j + F * 1, M + I * 1), t.lineTo(j - F * 1, M - I * 1), t.lineTo(s - F * L, 175 - I * L), t.closePath(), t.fillStyle = v(u.t1, o), t.fill(), t.beginPath(), t.arc(s, 175, 11, 0, Math.PI * 2), t.strokeStyle = v(r, .85 * o), t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(s, 175, 9, 0, Math.PI * 2), t.fillStyle = u.t1, t.fill(), [
738
+ let o = j(Math.min(e / 80, 1)), p = P(Math.min(e / 72, 1)), m = Math.round((T ?? 0) / (E || 1) * 100), h = s + m / 100 * l * o;
739
+ t.beginPath(), t.arc(a, 175, 148, s, c), t.strokeStyle = y(r, .28), t.lineWidth = 4, t.lineCap = "round", t.stroke(), t.lineCap = "butt", t.beginPath(), t.moveTo(a, 175), t.arc(a, 175, 133, s, h), t.closePath(), t.fillStyle = y(n, .35 * o), t.fill();
740
+ let _ = a + Math.cos(h) * 148, b = 175 + Math.sin(h) * 148;
741
+ C(t, _, b, 10, r, .3 * o);
742
+ let S = t.createLinearGradient(a + Math.cos(s) * 148, 175 + Math.sin(s) * 148, _, b);
743
+ S.addColorStop(0, y(n, .9 * o)), S.addColorStop(1, y(r, 1 * o)), t.beginPath(), t.arc(a, 175, 148, s, h), t.strokeStyle = S, t.lineWidth = 4, t.lineCap = "round", t.stroke(), t.lineCap = "butt";
744
+ let w = s + m / 100 * l * p, D = a + Math.cos(w) * 133, O = 175 + Math.sin(w) * 133, k = a - Math.cos(w) * 24, M = 175 - Math.sin(w) * 24, F = -Math.sin(w), I = Math.cos(w), L = 2.5 * p;
745
+ t.beginPath(), t.moveTo(D, O), t.lineTo(a + F * L, 175 + I * L), t.lineTo(k + F * 1, M + I * 1), t.lineTo(k - F * 1, M - I * 1), t.lineTo(a - F * L, 175 - I * L), t.closePath(), t.fillStyle = y(u.t1, p), t.fill(), t.beginPath(), t.arc(a, 175, 11, 0, Math.PI * 2), t.strokeStyle = y(r, .85 * p), t.lineWidth = 2, t.stroke(), t.beginPath(), t.arc(a, 175, 9, 0, Math.PI * 2), t.fillStyle = u.t1, t.fill(), [
739
746
  [0, "0%"],
740
747
  [.5, "50%"],
741
748
  [1, "100%"]
742
749
  ].forEach(([e, n]) => {
743
- let r = c + e * d, i = e === 1 ? 184 : 168, a = s + Math.cos(r) * i, o = 175 + Math.sin(r) * i;
744
- t.font = h.font, t.fillStyle = h.color, t.textAlign = "center", t.fillText(n, a, o + 4);
745
- }), n > .4 && (t.globalAlpha = Math.min(1, (n - .4) / .4), t.font = "700 32px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.t1, t.textAlign = "center", t.fillText(`${Math.round(m * o)}%`, s, 247), t.globalAlpha = 1), n > .7 && i && (t.globalAlpha = Math.min(1, (n - .7) / .3), t.font = _.font, t.fillStyle = _.color, t.textAlign = "center", pe(t, `${K(T ?? 0)} of ${K(O ?? 0)} ${i}`, le - 40).forEach((e, n) => {
746
- t.fillText(e, s, 287 + n * de);
747
- }), t.globalAlpha = 1), f = requestAnimationFrame(p);
750
+ let r = s + e * l, i = e === 1 ? 184 : 168, o = a + Math.cos(r) * i, c = 175 + Math.sin(r) * i;
751
+ t.font = g.font, t.fillStyle = g.color, t.textAlign = "center", t.fillText(n, o, c + 4);
752
+ }), o > .4 && (t.globalAlpha = Math.min(1, (o - .4) / .4), t.font = "700 32px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.t1, t.textAlign = "center", t.fillText(`${Math.round(m * p)}%`, a, 247), t.globalAlpha = 1), o > .7 && i && (t.globalAlpha = Math.min(1, (o - .7) / .3), t.font = v.font, t.fillStyle = v.color, t.textAlign = "center", me(t, `${K(T ?? 0)} of ${K(E ?? 0)} ${i}`, de - 40).forEach((e, n) => {
753
+ t.fillText(e, a, 287 + n * pe);
754
+ }), t.globalAlpha = 1), d = requestAnimationFrame(f);
748
755
  };
749
- return p(), () => cancelAnimationFrame(f);
756
+ return f(), () => cancelAnimationFrame(d);
750
757
  }, [
751
758
  T,
752
- O,
759
+ E,
753
760
  i,
754
761
  o,
755
762
  l,
756
763
  d
757
764
  ]), /* @__PURE__ */ c("div", {
758
- "data-testid": y,
765
+ "data-testid": _,
759
766
  style: {
760
767
  position: "relative",
761
768
  width: "100%",
762
- maxWidth: le,
769
+ maxWidth: de,
763
770
  margin: "0 auto"
764
771
  },
765
772
  children: [/* @__PURE__ */ s("canvas", {
766
773
  ref: b,
767
774
  role: "img",
768
- "aria-label": `Compensation event gauge — ${Math.round((T ?? 0) / (O || 1) * 100)}% of NCEs confirmed as compensation events`,
775
+ "aria-label": `Compensation event gauge — ${Math.round((T ?? 0) / (E || 1) * 100)}% of NCEs confirmed as compensation events`,
769
776
  style: {
770
777
  width: "100%",
771
- aspectRatio: `${le} / ${ue}`,
778
+ aspectRatio: `${de} / ${fe}`,
772
779
  display: "block"
773
780
  }
774
- }), /* @__PURE__ */ s(E, {
781
+ }), /* @__PURE__ */ s(D, {
775
782
  ...M,
776
- parentW: le,
777
- parentH: ue
783
+ parentW: de,
784
+ parentH: fe
778
785
  })]
779
786
  });
780
787
  }
781
788
  //#endregion
782
789
  //#region src/canvas/useCanvasLoop.ts
783
- function he(e, t, r, i, o = !0, s = {}) {
784
- let c = a(0), { easing: l = A, durationFrames: u = 48 } = s;
790
+ function ge(e, t, r, i, o = !0, s = {}) {
791
+ let c = a(0), { easing: l = j, durationFrames: u = 48 } = s;
785
792
  n(() => {
786
793
  let n = e.current;
787
794
  if (!n || !t || !r) return;
@@ -812,7 +819,7 @@ function he(e, t, r, i, o = !0, s = {}) {
812
819
  }
813
820
  //#endregion
814
821
  //#region src/components/multiMetricConstellationChart/MultiMetricConstellationChart.tsx
815
- var ge = 780, _e = 234, ve = 130, ye = 52, be = [
822
+ var q = 780, _e = 234, ve = 130, ye = 52, be = [
816
823
  u.blue,
817
824
  u.amber,
818
825
  u.purple,
@@ -827,13 +834,13 @@ var ge = 780, _e = 234, ve = 130, ye = 52, be = [
827
834
  "Commit"
828
835
  ];
829
836
  function Ce({ items: e = [], testID: t }) {
830
- let n = a(null), r = a(/* @__PURE__ */ new Map()), { hoveredRef: o, tooltip: l, hitZonesRef: d } = D(n, {
831
- width: ge,
837
+ let n = a(null), r = a(/* @__PURE__ */ new Map()), { hoveredRef: o, tooltip: l, hitZonesRef: d } = O(n, {
838
+ width: q,
832
839
  height: _e
833
840
  }), f = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), p = i(() => {
834
841
  let e = Math.max(...f.map((e) => e.base ?? 0)), t = Math.max(...f.map((e) => e.variation ?? 0));
835
842
  return f.map((n, r) => {
836
- let i = ge * (.12 + r * .19), a = ve, o = Math.min(ge * .075, ye), s = be[r % be.length], c = [
843
+ let i = q * (.12 + r * .19), a = ve, o = Math.min(q * .075, ye), s = be[r % be.length], c = [
837
844
  (n.base ?? 0) / (e || 1) * 100,
838
845
  (n.variation ?? 0) / (t || 1) * 100,
839
846
  n.percentage ?? 0
@@ -865,37 +872,37 @@ function Ce({ items: e = [], testID: t }) {
865
872
  };
866
873
  });
867
874
  }, [f]);
868
- return he(n, ge, _e, (e, t, n) => {
869
- I(r.current, o.current), d.current = [], C(e, ge, _e, n, 30), p.forEach((t, i) => {
875
+ return ge(n, q, _e, (e, t, n) => {
876
+ L(r.current, o.current), d.current = [], w(e, q, _e, n, 30), p.forEach((t, i) => {
870
877
  let a = t.color, o = `constellation-${i}`, s = r.current.get(o) ?? 0;
871
- e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 5, 0, Math.PI * 2), e.strokeStyle = v(u.bd, .08 + .08 * s), e.lineWidth = .5, e.stroke(), e.beginPath(), t.stars.forEach((t, n) => {
878
+ e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 5, 0, Math.PI * 2), e.strokeStyle = y(u.bd, .08 + .08 * s), e.lineWidth = .5, e.stroke(), e.beginPath(), t.stars.forEach((t, n) => {
872
879
  n === 0 ? e.moveTo(t.x, t.y) : e.lineTo(t.x, t.y);
873
- }), e.closePath(), e.fillStyle = v(a, .04 + .03 * s), e.fill(), e.strokeStyle = v(a, .15 + .1 * s), e.lineWidth = .8, e.stroke(), t.stars.forEach((o, s) => {
874
- let c = P(n, .05, 5e-4) * .3 + .7, l = 3.5 * c, u = `star-${i}-${s}`, f = r.current.get(u) ?? 0, p = e.createRadialGradient(o.x, o.y, 0, o.x, o.y, l * 4);
875
- p.addColorStop(0, v(a, (.2 + .1 * f) * c)), p.addColorStop(1, v(a, 0)), e.fillStyle = p, e.beginPath(), e.arc(o.x, o.y, l * 4, 0, Math.PI * 2), e.fill(), e.beginPath(), e.arc(o.x, o.y, l + f * 2, 0, Math.PI * 2), e.fillStyle = v(a, (.8 + .2 * f) * c), e.fill();
880
+ }), e.closePath(), e.fillStyle = y(a, .04 + .03 * s), e.fill(), e.strokeStyle = y(a, .15 + .1 * s), e.lineWidth = .8, e.stroke(), t.stars.forEach((o, s) => {
881
+ let c = F(n, .05, 5e-4) * .3 + .7, l = 3.5 * c, u = `star-${i}-${s}`, f = r.current.get(u) ?? 0, p = e.createRadialGradient(o.x, o.y, 0, o.x, o.y, l * 4);
882
+ p.addColorStop(0, y(a, (.2 + .1 * f) * c)), p.addColorStop(1, y(a, 0)), e.fillStyle = p, e.beginPath(), e.arc(o.x, o.y, l * 4, 0, Math.PI * 2), e.fill(), e.beginPath(), e.arc(o.x, o.y, l + f * 2, 0, Math.PI * 2), e.fillStyle = y(a, (.8 + .2 * f) * c), e.fill();
876
883
  let m = Math.sin(o.angle) < -.3;
877
- e.textAlign = "center", e.textBaseline = "middle", m ? (e.font = h.font, e.fillStyle = v(a, .5 + .15 * f), e.fillText(o.short, o.x, o.y - 24), e.font = h.font, e.fillStyle = v(a, .8 + .15 * f), e.fillText(o.label, o.x, o.y - 11)) : (e.font = h.font, e.fillStyle = v(a, .5 + .15 * f), e.fillText(o.short, o.x, o.y + 11), e.font = h.font, e.fillStyle = v(a, .8 + .15 * f), e.fillText(o.label, o.x, o.y + 24)), O(d.current, u, o.x, o.y, l * 4 + 2, {
884
+ e.textAlign = "center", e.textBaseline = "middle", m ? (e.font = g.font, e.fillStyle = y(a, .5 + .15 * f), e.fillText(o.short, o.x, o.y - 24), e.font = g.font, e.fillStyle = y(a, .8 + .15 * f), e.fillText(o.label, o.x, o.y - 11)) : (e.font = g.font, e.fillStyle = y(a, .5 + .15 * f), e.fillText(o.short, o.x, o.y + 11), e.font = g.font, e.fillStyle = y(a, .8 + .15 * f), e.fillText(o.label, o.x, o.y + 24)), k(d.current, u, o.x, o.y, l * 4 + 2, {
878
885
  label: o.name,
879
886
  value: o.label,
880
887
  sublabel: t.abbreviation ?? t.name.slice(0, 6),
881
888
  color: a
882
889
  });
883
- }), s > 0 && S(e, t.cx, t.cy, 16 * s, a, .15 * s), e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 12, 0, Math.PI * 2), e.strokeStyle = v(a, .1 + P(n, .03, 5e-4) * .05), e.lineWidth = 1, e.stroke(), e.font = h.font, e.textAlign = "center", e.textBaseline = "alphabetic", e.fillStyle = s > 0 ? t.color : h.color, e.fillText(t.abbreviation ?? t.name.slice(0, 6), t.cx, t.cy + t.baseR + 26), O(d.current, o, t.cx, t.cy, t.baseR + 5, {
890
+ }), s > 0 && C(e, t.cx, t.cy, 16 * s, a, .15 * s), e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 12, 0, Math.PI * 2), e.strokeStyle = y(a, .1 + F(n, .03, 5e-4) * .05), e.lineWidth = 1, e.stroke(), e.font = g.font, e.textAlign = "center", e.textBaseline = "alphabetic", e.fillStyle = s > 0 ? t.color : g.color, e.fillText(t.abbreviation ?? t.name.slice(0, 6), t.cx, t.cy + t.baseR + 26), k(d.current, o, t.cx, t.cy, t.baseR + 5, {
884
891
  label: t.name,
885
892
  value: `${t.totalLabel ?? String(t.total ?? 0)} total`,
886
893
  sublabel: `${t.percentage ?? 0}% committed · scatter ${t.scatter.toFixed(1)}`,
887
894
  color: a
888
895
  });
889
- }), e.font = _.font, e.textAlign = "center", e.textBaseline = "middle", e.fillStyle = _.color, e.fillText("▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details", ge / 2, _e - 14), w(e, ge, _e, n, .012);
890
- }, !0), p.length === 0 ? /* @__PURE__ */ s(W, {
891
- width: ge,
896
+ }), e.font = v.font, e.textAlign = "center", e.textBaseline = "middle", e.fillStyle = v.color, e.fillText("▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details", q / 2, _e - 14), T(e, q, _e, n, .012);
897
+ }, !0), p.length === 0 ? /* @__PURE__ */ s(G, {
898
+ width: q,
892
899
  height: _e,
893
900
  testID: t
894
901
  }) : /* @__PURE__ */ c("div", {
895
902
  "data-testid": t,
896
903
  style: {
897
904
  position: "relative",
898
- width: ge,
905
+ width: q,
899
906
  height: _e
900
907
  },
901
908
  children: [/* @__PURE__ */ s("canvas", {
@@ -903,13 +910,13 @@ function Ce({ items: e = [], testID: t }) {
903
910
  role: "img",
904
911
  "aria-label": "Contract value breakdown per contractor — multi-KPI constellation chart",
905
912
  style: {
906
- width: ge,
913
+ width: q,
907
914
  height: _e,
908
915
  display: "block"
909
916
  }
910
- }), /* @__PURE__ */ s(E, {
917
+ }), /* @__PURE__ */ s(D, {
911
918
  ...l,
912
- parentW: ge,
919
+ parentW: q,
913
920
  parentH: _e
914
921
  })]
915
922
  });
@@ -933,15 +940,15 @@ function je(e) {
933
940
  return t >= 1e6 ? `${n}£${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${n}£${(t / 1e3).toFixed(1)}K` : `${n}£${t.toFixed(0)}`;
934
941
  }
935
942
  function Me({ data: e, dataByEntity: n, onItemClick: r, selectedId: i, testID: l }) {
936
- let [d, f] = ee(we), p = a(null), m = a(/* @__PURE__ */ new Map()), y = a(i);
937
- y.current = i;
943
+ let [d, f] = ee(we), p = a(null), m = a(/* @__PURE__ */ new Map()), h = a(i);
944
+ h.current = i;
938
945
  let b = t((e, t) => {
939
946
  let n = typeof t == "object" ? t.label ?? e : e, i = V.current.visibleItems.find((t) => t.id === e);
940
947
  r?.(e, n, i?.subentity);
941
- }, [r]), [x, C] = o(!1), w = !!(i && n?.[i]), { items: T = [], totals: O } = w ? n[i] : e, A = T.filter((e) => typeof e == "object" && !!e), M = [...A].sort((e, t) => (t.total ?? 0) - (e.total ?? 0)), N = x ? M : M.slice(0, Ee), P = N.length, L = Math.max(...M.map((e) => Math.abs(e.total ?? 0)), 1), R = P * ke + Math.max(0, P - 1) * 38, z = J.top + J.bottom + R, B = f - J.left - Oe - J.right, V = a({
948
+ }, [r]), [x, S] = o(!1), w = !!(i && n?.[i]), { items: T = [], totals: E } = w ? n[i] : e, k = T.filter((e) => typeof e == "object" && !!e), j = [...k].sort((e, t) => (t.total ?? 0) - (e.total ?? 0)), N = x ? j : j.slice(0, Ee), P = N.length, F = Math.max(...j.map((e) => Math.abs(e.total ?? 0)), 1), R = P * ke + Math.max(0, P - 1) * 38, z = J.top + J.bottom + R, B = f - J.left - Oe - J.right, V = a({
942
949
  visibleItems: N,
943
- maxCommitment: L,
944
- totals: O,
950
+ maxCommitment: F,
951
+ totals: E,
945
952
  barArea: B,
946
953
  BAR_GAP: 38,
947
954
  n: P,
@@ -950,41 +957,37 @@ function Me({ data: e, dataByEntity: n, onItemClick: r, selectedId: i, testID: l
950
957
  });
951
958
  V.current = {
952
959
  visibleItems: N,
953
- maxCommitment: L,
954
- totals: O,
960
+ maxCommitment: F,
961
+ totals: E,
955
962
  barArea: B,
956
963
  BAR_GAP: 38,
957
964
  n: P,
958
965
  dynamicH: z,
959
966
  isDrillMode: w
960
967
  };
961
- let H = (e.items ?? []).filter((e) => typeof e == "object" && !!e).length === 0, { hoveredRef: U, tooltip: G, hitZonesRef: K } = D(p, {
968
+ let H = (e.items ?? []).filter((e) => typeof e == "object" && !!e).length === 0, { hoveredRef: U, tooltip: W, hitZonesRef: ne } = O(p, {
962
969
  width: f,
963
970
  height: z,
964
971
  onClick: r ? b : void 0
965
972
  });
966
- return he(p, f, z, (e, t) => {
973
+ return ge(p, f, z, (e, t) => {
967
974
  let { visibleItems: n, maxCommitment: r, totals: i, barArea: a, BAR_GAP: o, n: s, dynamicH: c, isDrillMode: l } = V.current;
968
- I(m.current, U.current), K.current = [], n.forEach((n, i) => {
969
- let c = De[i % De.length], d = F(t, i, s, j), f = J.top + i * (ke + o), p = J.left + Oe, _ = m.current.get(n.id) ?? 0, b = !l && y.current && n.id !== y.current ? .2 : 1, x = Math.max(n.total ?? 0, 0) / r * a * d;
970
- if (e.font = h.font, e.fillStyle = _ > 0 ? c : h.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(Ae(e, n.name ?? "", Oe - 16), p - 8, f + ke / 2), k(K.current, n.id, 0, f, p, ke, {
975
+ L(m.current, U.current), ne.current = [], n.forEach((n, i) => {
976
+ let c = De[i % De.length], d = I(t, i, s, M), f = J.top + i * (ke + o), p = J.left + Oe, v = m.current.get(n.id) ?? 0, b = !l && h.current && n.id !== h.current ? .2 : 1, x = Math.max(n.total ?? 0, 0) / r * a * d;
977
+ if (e.font = g.font, e.fillStyle = v > 0 ? c : g.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(Ae(e, n.name ?? "", Oe - 16), p - 8, f + ke / 2), A(ne.current, n.id, 0, f, p, ke, {
971
978
  label: n.name,
972
979
  value: `${n.totalLabel ?? je(n.total ?? 0)} total`,
973
980
  sublabel: `Base ${n.baseLabel ?? je(n.base ?? 0)} + Var ${n.variationLabel ?? je(n.variation ?? 0)}`,
974
981
  color: c
975
982
  }), x > 0) {
976
- _ > 0 && S(e, p + x / 2, f + ke / 2, x * .15, u.teal, .12 * _);
983
+ v > 0 && C(e, p + x / 2, f + ke / 2, x * .15, u.teal, .12 * v);
977
984
  let t = e.createLinearGradient(p, 0, p + x, 0);
978
- t.addColorStop(0, v(u.tealDark, .85 * b)), t.addColorStop(1, v(u.teal, 1 * b)), e.fillStyle = t, e.beginPath(), e.rect(p, f, x, ke), e.fill();
985
+ t.addColorStop(0, y(u.tealDark, .85 * b)), t.addColorStop(1, y(u.teal, 1 * b)), e.fillStyle = t, e.beginPath(), e.rect(p, f, x, ke), e.fill();
979
986
  }
980
- let C = B * d, w = p + x, T = C - x;
981
- if (T > 2) {
982
- let t = e.createLinearGradient(w, 0, p + C, 0);
983
- t.addColorStop(0, v(u.tealDark, .55)), t.addColorStop(1, v(u.tealDark, .22)), e.fillStyle = t, e.beginPath(), e.rect(w, f, T, ke), e.fill();
984
- }
985
- if (x > 4) {
987
+ let S = B * d, w = p + x, T = S - x;
988
+ if (T > 2 && (e.fillStyle = y(u.barBg, .2), e.beginPath(), e.rect(w, f, T, ke), e.fill()), x > 4) {
986
989
  let t = p + x, n = f + ke;
987
- e.strokeStyle = v(u.t4, .9 * d), e.lineWidth = 4, e.beginPath(), e.moveTo(t, f), e.lineTo(t, n), e.stroke();
990
+ e.strokeStyle = y(u.t4, .9 * d), e.lineWidth = 4, e.beginPath(), e.moveTo(t, f), e.lineTo(t, n), e.stroke();
988
991
  let r = n + 3, i = {
989
992
  x: t,
990
993
  y: r
@@ -995,9 +998,9 @@ function Me({ data: e, dataByEntity: n, onItemClick: r, selectedId: i, testID: l
995
998
  x: t - 10,
996
999
  y: r + 12
997
1000
  };
998
- e.fillStyle = v(u.t1, d), e.beginPath(), e.moveTo((i.x + a.x) / 2, (i.y + a.y) / 2), e.arcTo(a.x, a.y, o.x, o.y, 1), e.arcTo(o.x, o.y, i.x, i.y, 1), e.arcTo(i.x, i.y, a.x, a.y, 1), e.closePath(), e.fill();
1001
+ e.fillStyle = y(u.t1, d), e.beginPath(), e.moveTo((i.x + a.x) / 2, (i.y + a.y) / 2), e.arcTo(a.x, a.y, o.x, o.y, 1), e.arcTo(o.x, o.y, i.x, i.y, 1), e.arcTo(i.x, i.y, a.x, a.y, 1), e.closePath(), e.fill();
999
1002
  }
1000
- d > .35 && (e.globalAlpha = Math.min(1, (d - .35) / .4) * b, e.font = g.font, e.fillStyle = _ > 0 ? c : g.color, e.textAlign = "left", e.textBaseline = "middle", e.fillText(n.totalLabel ?? je(n.total ?? 0), p + a + 28, f + ke / 2), e.globalAlpha = 1), k(K.current, n.id, p, f, Math.max(x, 1), ke, {
1003
+ d > .35 && (e.globalAlpha = Math.min(1, (d - .35) / .4) * b, e.font = _.font, e.fillStyle = v > 0 ? c : _.color, e.textAlign = "left", e.textBaseline = "middle", e.fillText(n.totalLabel ?? je(n.total ?? 0), p + a + 28, f + ke / 2), e.globalAlpha = 1), A(ne.current, n.id, p, f, Math.max(x, 1), ke, {
1001
1004
  label: n.name,
1002
1005
  value: n.totalLabel ?? je(n.total ?? 0),
1003
1006
  sublabel: `${n.baseLabel ?? je(n.base ?? 0)} + ${n.variationLabel ?? je(n.variation ?? 0)}`,
@@ -1005,13 +1008,13 @@ function Me({ data: e, dataByEntity: n, onItemClick: r, selectedId: i, testID: l
1005
1008
  });
1006
1009
  });
1007
1010
  let d = c - 14;
1008
- e.textBaseline = "middle", e.font = _.font, e.textAlign = "left";
1011
+ e.textBaseline = "middle", e.font = v.font, e.textAlign = "left";
1009
1012
  let p = e.createLinearGradient(J.left + Oe, 0, J.left + Oe + 14, 0);
1010
- p.addColorStop(0, v(u.tealDark, .85)), p.addColorStop(1, v(u.teal, 1)), e.fillStyle = p, e.beginPath(), e.rect(J.left + Oe, d - 6, 12, 12), e.fill(), e.fillStyle = _.color, e.fillText("base value", J.left + Oe + 16, d), e.fillStyle = v(u.teal, .35), e.beginPath(), e.rect(J.left + Oe + 160, d - 6, 12, 12), e.fill(), e.fillStyle = _.color, e.fillText("approved variations", J.left + Oe + 176, d), e.font = _.font, e.textAlign = "right", e.fillStyle = _.color, e.fillText(`Portfolio: ${je(i?.total ?? 0)}`, f - 8, d);
1011
- }, !0, { easing: j }), H ? /* @__PURE__ */ s("div", {
1013
+ p.addColorStop(0, y(u.tealDark, .85)), p.addColorStop(1, y(u.teal, 1)), e.fillStyle = p, e.beginPath(), e.rect(J.left + Oe, d - 6, 12, 12), e.fill(), e.fillStyle = v.color, e.fillText("base value", J.left + Oe + 16, d), e.fillStyle = y(u.teal, .35), e.beginPath(), e.rect(J.left + Oe + 160, d - 6, 12, 12), e.fill(), e.fillStyle = v.color, e.fillText("approved variations", J.left + Oe + 176, d), e.font = v.font, e.textAlign = "right", e.fillStyle = v.color, e.fillText(`Portfolio: ${je(i?.total ?? 0)}`, f - 8, d);
1014
+ }, !0, { easing: M }), H ? /* @__PURE__ */ s("div", {
1012
1015
  ref: d,
1013
1016
  style: { width: "100%" },
1014
- children: /* @__PURE__ */ s(W, {
1017
+ children: /* @__PURE__ */ s(G, {
1015
1018
  width: f,
1016
1019
  height: Te,
1017
1020
  message: "No contract data available",
@@ -1033,16 +1036,16 @@ function Me({ data: e, dataByEntity: n, onItemClick: r, selectedId: i, testID: l
1033
1036
  display: "block",
1034
1037
  borderRadius: 8
1035
1038
  }
1036
- }), /* @__PURE__ */ s(E, {
1037
- ...G,
1039
+ }), /* @__PURE__ */ s(D, {
1040
+ ...W,
1038
1041
  parentW: f,
1039
1042
  parentH: z
1040
1043
  })]
1041
- }), A.length > Ee && /* @__PURE__ */ s("div", {
1044
+ }), k.length > Ee && /* @__PURE__ */ s("div", {
1042
1045
  style: { marginTop: 8 },
1043
1046
  children: /* @__PURE__ */ s(te, {
1044
1047
  expanded: x,
1045
- onToggle: () => C((e) => !e)
1048
+ onToggle: () => S((e) => !e)
1046
1049
  })
1047
1050
  })]
1048
1051
  });
@@ -1051,57 +1054,57 @@ function Me({ data: e, dataByEntity: n, onItemClick: r, selectedId: i, testID: l
1051
1054
  //#region src/components/rankedCardLeaderboard/RankedCardLeaderboard.tsx
1052
1055
  var Ne = 780, Pe = 240, Fe = 12, Ie = 10, Le = 5;
1053
1056
  function Re({ items: e = [], onItemClick: r, testID: o }) {
1054
- let [l, d] = ee(Ne), f = a(null), m = a(0), _ = a(/* @__PURE__ */ new Map()), y = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), b = y.reduce((e, t) => e + (t.count ?? 0), 0), C = a(y);
1055
- C.current = y;
1056
- let T = t((e, t) => {
1057
- let n = typeof t == "object" ? t.label ?? e : e, i = C.current.find((t) => t.id === e);
1057
+ let [l, d] = ee(Ne), f = a(null), m = a(0), h = a(/* @__PURE__ */ new Map()), v = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), b = v.reduce((e, t) => e + (t.count ?? 0), 0), x = a(v);
1058
+ x.current = v;
1059
+ let w = t((e, t) => {
1060
+ let n = typeof t == "object" ? t.label ?? e : e, i = x.current.find((t) => t.id === e);
1058
1061
  r?.(e, n, i?.subentity);
1059
- }, [r]), O = Math.min(Le, y.length), A = O > 0 ? (d - 2 * Fe - (O - 1) * Ie) / O : (d - 2 * Fe) / Le, { hoveredRef: j, tooltip: M, hitZonesRef: N } = D(f, {
1062
+ }, [r]), E = Math.min(Le, v.length), k = E > 0 ? (d - 2 * Fe - (E - 1) * Ie) / E : (d - 2 * Fe) / Le, { hoveredRef: j, tooltip: M, hitZonesRef: N } = O(f, {
1060
1063
  width: d,
1061
1064
  height: Pe,
1062
- onClick: r ? T : void 0
1065
+ onClick: r ? w : void 0
1063
1066
  });
1064
1067
  return n(() => {
1065
1068
  let e = f.current;
1066
1069
  if (!e) return;
1067
- let t = x(e, d, Pe);
1070
+ let t = S(e, d, Pe);
1068
1071
  m.current = 0;
1069
1072
  let n = Pe * .84, r = Pe * .08, i = Fe, a, o = () => {
1070
1073
  m.current++;
1071
1074
  let e = m.current;
1072
- t.clearRect(0, 0, d, Pe), t.letterSpacing = h.letterSpacing, N.current = [], _.current.forEach((e, t) => {
1075
+ t.clearRect(0, 0, d, Pe), t.letterSpacing = g.letterSpacing, N.current = [], h.current.forEach((e, t) => {
1073
1076
  let n = t === j.current ? 1 : 0, r = e + (n - e) * .12;
1074
- Math.abs(r - n) < .005 ? n === 0 ? _.current.delete(t) : _.current.set(t, 1) : _.current.set(t, r);
1075
- }), j.current && !_.current.has(j.current) && _.current.set(j.current, 0), y.forEach((a, o) => {
1076
- let s = o === 0, c = o === 0 ? u.red : o === 1 ? u.amber : p[o % p.length], l = i + o * (A + Ie), d = _.current.get(a.id) ?? 0, f = d * 8, m = l - f / 2, h = A + f, y = s ? P(e, .04, 3e-4) * .06 + .06 : 0;
1077
- t.fillStyle = v(c, .08 + d * .07), t.beginPath(), t.roundRect(m, r, h, n, 6), t.fill(), t.strokeStyle = v(c, .2 + d * .4 + y), t.lineWidth = s ? 1.5 : 1, t.stroke(), (d > .01 || s) && S(t, m + h / 2, r + n / 2, h * .55, c, y + d * .14), t.font = g.font, t.textAlign = "left", t.textBaseline = "top", t.fillStyle = v(c, .5 + d * .35), t.fillText(`#${o + 1}`, m + 7, r + 6);
1078
- let x = Math.min(A * .28, n * .32, 72), C = m + h / 2, w = r + n * .38, T = t.createRadialGradient(C, w - x * .2, 0, C, w, x);
1079
- T.addColorStop(0, v(c, .5 + d * .2)), T.addColorStop(1, v(c, .2 + d * .1)), t.beginPath(), t.arc(C, w, x, 0, Math.PI * 2), t.fillStyle = T, t.fill(), t.strokeStyle = v(c, .4 + d * .3), t.lineWidth = 1, t.stroke(), t.font = g.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = v(u.t1, .9);
1077
+ Math.abs(r - n) < .005 ? n === 0 ? h.current.delete(t) : h.current.set(t, 1) : h.current.set(t, r);
1078
+ }), j.current && !h.current.has(j.current) && h.current.set(j.current, 0), v.forEach((a, o) => {
1079
+ let s = o === 0, c = o === 0 ? u.red : o === 1 ? u.amber : p[o % p.length], l = i + o * (k + Ie), d = h.current.get(a.id) ?? 0, f = d * 8, m = l - f / 2, g = k + f, v = s ? F(e, .04, 3e-4) * .06 + .06 : 0;
1080
+ t.fillStyle = y(c, .08 + d * .07), t.beginPath(), t.roundRect(m, r, g, n, 6), t.fill(), t.strokeStyle = y(c, .2 + d * .4 + v), t.lineWidth = s ? 1.5 : 1, t.stroke(), (d > .01 || s) && C(t, m + g / 2, r + n / 2, g * .55, c, v + d * .14), t.font = _.font, t.textAlign = "left", t.textBaseline = "top", t.fillStyle = y(c, .5 + d * .35), t.fillText(`#${o + 1}`, m + 7, r + 6);
1081
+ let x = Math.min(k * .28, n * .32, 72), S = m + g / 2, w = r + n * .38, T = t.createRadialGradient(S, w - x * .2, 0, S, w, x);
1082
+ T.addColorStop(0, y(c, .5 + d * .2)), T.addColorStop(1, y(c, .2 + d * .1)), t.beginPath(), t.arc(S, w, x, 0, Math.PI * 2), t.fillStyle = T, t.fill(), t.strokeStyle = y(c, .4 + d * .3), t.lineWidth = 1, t.stroke(), t.font = _.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = y(u.t1, .9);
1080
1083
  let E = a.abbreviation ?? a.name ?? "", D = x * 1.7, O = E;
1081
1084
  for (; t.measureText(O).width > D && O.length > 1;) O = O.slice(0, -1);
1082
- O !== E && (O = O.slice(0, -1) + "…"), t.fillText(O, C, w);
1085
+ O !== E && (O = O.slice(0, -1) + "…"), t.fillText(O, S, w);
1083
1086
  let j = a.count == null ? null : K(a.count), M = a.label ?? j;
1084
1087
  if (M) {
1085
- t.font = g.font, t.textBaseline = "alphabetic", t.fillStyle = v(c, .9 + d * .1);
1086
- let e = h - 16, i = M;
1088
+ t.font = _.font, t.textBaseline = "alphabetic", t.fillStyle = y(c, .9 + d * .1);
1089
+ let e = g - 16, i = M;
1087
1090
  for (; t.measureText(i).width > e && i.length > 1;) i = i.slice(0, -1);
1088
- i !== M && (i = i.slice(0, -1) + "…"), t.fillText(i, C, r + n * .74);
1091
+ i !== M && (i = i.slice(0, -1) + "…"), t.fillText(i, S, r + n * .74);
1089
1092
  }
1090
- let F = Math.round((a.count ?? 0) / (b || 1) * 100);
1091
- k(N.current, a.id, l, r, A, n, {
1093
+ let P = Math.round((a.count ?? 0) / (b || 1) * 100);
1094
+ A(N.current, a.id, l, r, k, n, {
1092
1095
  label: a.name,
1093
- value: `${M} · ${F}% of total`,
1096
+ value: `${M} · ${P}% of total`,
1094
1097
  sublabel: `Rank #${o + 1}`,
1095
1098
  color: c
1096
1099
  });
1097
- }), w(t, d, Pe, e, .015), a = requestAnimationFrame(o);
1100
+ }), T(t, d, Pe, e, .015), a = requestAnimationFrame(o);
1098
1101
  };
1099
1102
  return o(), () => cancelAnimationFrame(a);
1100
1103
  }, [
1101
- y,
1104
+ v,
1102
1105
  b,
1103
1106
  d
1104
- ]), y.length === 0 ? /* @__PURE__ */ s(W, {
1107
+ ]), v.length === 0 ? /* @__PURE__ */ s(G, {
1105
1108
  width: d,
1106
1109
  height: Pe,
1107
1110
  testID: o
@@ -1122,7 +1125,7 @@ function Re({ items: e = [], onItemClick: r, testID: o }) {
1122
1125
  display: "block",
1123
1126
  borderRadius: 8
1124
1127
  }
1125
- }), /* @__PURE__ */ s(E, {
1128
+ }), /* @__PURE__ */ s(D, {
1126
1129
  ...M,
1127
1130
  parentW: d,
1128
1131
  parentH: Pe
@@ -1133,43 +1136,43 @@ function Re({ items: e = [], onItemClick: r, testID: o }) {
1133
1136
  //#region src/components/dotMatrixChart/DotMatrixChart.tsx
1134
1137
  var ze = 680, Be = 260;
1135
1138
  function Ve({ items: e = [], testID: t }) {
1136
- let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: f, hitZonesRef: p } = D(r, {
1139
+ let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: f, hitZonesRef: p } = O(r, {
1137
1140
  width: ze,
1138
1141
  height: Be
1139
1142
  }), m = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
1140
1143
  return n(() => {
1141
1144
  let e = r.current;
1142
1145
  if (!e) return;
1143
- let t = x(e, ze, Be);
1146
+ let t = S(e, ze, Be);
1144
1147
  o.current = 0;
1145
- let n = m.length, i = Math.max(...m.map((e) => e.count), 1), a = i, s = ze * .05, c = Be * .1, f = ze * .9 / n, g = Be * .7 / a, _ = m.reduce((e, t) => e + t.count, 0), y, b = () => {
1148
+ let n = m.length, i = Math.max(...m.map((e) => e.count), 1), a = i, s = ze * .05, c = Be * .1, f = ze * .9 / n, h = Be * .7 / a, _ = m.reduce((e, t) => e + t.count, 0), v, b = () => {
1146
1149
  o.current++;
1147
1150
  let e = o.current;
1148
1151
  t.clearRect(0, 0, ze, Be), p.current = [], l.current.forEach((e, t) => {
1149
1152
  let n = t === d.current ? 1 : 0, r = e + (n - e) * .12;
1150
1153
  Math.abs(r - n) < .005 ? n === 0 ? l.current.delete(t) : l.current.set(t, 1) : l.current.set(t, r);
1151
- }), d.current && !l.current.has(d.current) && l.current.set(d.current, 0), C(t, ze, Be, e, 40, v(u.blue, .04)), m.forEach((n, r) => {
1154
+ }), d.current && !l.current.has(d.current) && l.current.set(d.current, 0), w(t, ze, Be, e, 40, y(u.blue, .04)), m.forEach((n, r) => {
1152
1155
  let o = n.count === i, d = u.blue, m = l.current.get(`${n.category}-col`) ?? 0;
1153
1156
  for (let u = 0; u < a; u++) {
1154
- let a = s + r * f + f / 2, h = c + u * g + g / 2, y = Math.min(f, g) * .38;
1157
+ let a = s + r * f + f / 2, g = c + u * h + h / 2, v = Math.min(f, h) * .38;
1155
1158
  if (u >= i - n.count) {
1156
- let i = y * (1 + (P(e, .04, 5e-4) + Math.sin(r * .6 + u * 1.2) * .3) * .12);
1157
- (o || m > .01) && S(t, a, h, i * 3, d, (o ? .2 : .1) + m * .1), t.beginPath(), t.arc(a, h, i, 0, Math.PI * 2), t.fillStyle = v(d, o ? .8 : .5 + m * .2), t.fill();
1159
+ let i = v * (1 + (F(e, .04, 5e-4) + Math.sin(r * .6 + u * 1.2) * .3) * .12);
1160
+ (o || m > .01) && C(t, a, g, i * 3, d, (o ? .2 : .1) + m * .1), t.beginPath(), t.arc(a, g, i, 0, Math.PI * 2), t.fillStyle = y(d, o ? .8 : .5 + m * .2), t.fill();
1158
1161
  let s = `${n.category}-${u}`;
1159
- O(p.current, s, a, h, y + 4, {
1162
+ k(p.current, s, a, g, v + 4, {
1160
1163
  label: n.fullName,
1161
1164
  value: `${n.count} Early Warnings`,
1162
1165
  sublabel: `${Math.round(n.count / _ * 100)}% of total`,
1163
1166
  color: d
1164
1167
  }), l.current.get(`${n.category}-col`);
1165
- } else t.beginPath(), t.arc(a, h, 1, 0, Math.PI * 2), t.fillStyle = v(d, .08), t.fill();
1168
+ } else t.beginPath(), t.arc(a, g, 1, 0, Math.PI * 2), t.fillStyle = y(d, .08), t.fill();
1166
1169
  }
1167
- let y = c + a * g + 16;
1168
- t.font = h.font, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = o ? u.blue : v(u.t2, .65), t.fillText(n.category, s + r * f + f / 2, y);
1169
- }), w(t, ze, Be, e, .015), y = requestAnimationFrame(b);
1170
+ let v = c + a * h + 16;
1171
+ t.font = g.font, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = o ? u.blue : y(u.t2, .65), t.fillText(n.category, s + r * f + f / 2, v);
1172
+ }), T(t, ze, Be, e, .015), v = requestAnimationFrame(b);
1170
1173
  };
1171
- return b(), () => cancelAnimationFrame(y);
1172
- }, [m]), m.length === 0 ? /* @__PURE__ */ s(W, {
1174
+ return b(), () => cancelAnimationFrame(v);
1175
+ }, [m]), m.length === 0 ? /* @__PURE__ */ s(G, {
1173
1176
  width: ze,
1174
1177
  height: Be,
1175
1178
  testID: t
@@ -1190,7 +1193,7 @@ function Ve({ items: e = [], testID: t }) {
1190
1193
  display: "block",
1191
1194
  borderRadius: 8
1192
1195
  }
1193
- }), /* @__PURE__ */ s(E, {
1196
+ }), /* @__PURE__ */ s(D, {
1194
1197
  ...f,
1195
1198
  parentW: ze,
1196
1199
  parentH: Be
@@ -1200,7 +1203,7 @@ function Ve({ items: e = [], testID: t }) {
1200
1203
  //#endregion
1201
1204
  //#region src/components/lineChart/LineChart.tsx
1202
1205
  function He({ rows: e = [], className: t, colors: n }) {
1203
- return /* @__PURE__ */ s(z, {
1206
+ return /* @__PURE__ */ s(B, {
1204
1207
  rows: e,
1205
1208
  variant: "line",
1206
1209
  className: t,
@@ -1325,103 +1328,103 @@ function Ge({ rows: e = [], className: t, colors: n }) {
1325
1328
  //#endregion
1326
1329
  //#region src/components/radialFanTreeChart/RadialFanTreeChart.tsx
1327
1330
  var Ke = 770, qe = 320, Je = 60, Ye = 28;
1328
- function Xe({ total: e = 0, totalLabel: r, items: o = [], dataByEntity: l, onItemClick: d, selectedId: f, colorOffset: p = 0, testID: _ }) {
1329
- let [y, b] = ee(Ke), C = a(null), w = a(/* @__PURE__ */ new Map()), T = a(0), k = a(f);
1330
- k.current = f;
1331
- let j = a([]), M = t((e, t) => {
1331
+ function Xe({ total: e = 0, totalLabel: r, items: o = [], dataByEntity: l, onItemClick: d, selectedId: f, colorOffset: p = 0, testID: m }) {
1332
+ let [v, b] = ee(Ke), x = a(null), w = a(/* @__PURE__ */ new Map()), T = a(0), E = a(f);
1333
+ E.current = f;
1334
+ let A = a([]), M = t((e, t) => {
1332
1335
  if (e === "__root__") return;
1333
- let n = typeof t == "object" ? t.label ?? e : e, r = j.current.find((t) => t.id === e);
1336
+ let n = typeof t == "object" ? t.label ?? e : e, r = A.current.find((t) => t.id === e);
1334
1337
  d?.(e, n, r?.subentity);
1335
- }, [d]), N = !!(f && l?.[f]), P = N ? l[f] : null, L = P ? P.total : e, R = P ? P.totalLabel : r, z = P ? P.items : o, B = i(() => z.filter((e) => typeof e == "object" && !!e), [z]);
1336
- j.current = B;
1337
- let V = i(() => Math.max(qe, Je + Math.max(0, B.length - 1) * Ye), [B.length]), H = V, { hoveredRef: U, tooltip: te, hitZonesRef: G } = D(C, {
1338
+ }, [d]), N = !!(f && l?.[f]), P = N ? l[f] : null, F = P ? P.total : e, R = P ? P.totalLabel : r, z = P ? P.items : o, B = i(() => z.filter((e) => typeof e == "object" && !!e), [z]);
1339
+ A.current = B;
1340
+ let V = i(() => Math.max(qe, Je + Math.max(0, B.length - 1) * Ye), [B.length]), H = V, { hoveredRef: U, tooltip: W, hitZonesRef: te } = O(x, {
1338
1341
  width: b,
1339
1342
  height: V,
1340
1343
  onClick: d ? M : void 0
1341
1344
  });
1342
1345
  return n(() => {
1343
- let e = C.current;
1346
+ let e = x.current;
1344
1347
  if (!e) return;
1345
- let t = x(e, b, H);
1348
+ let t = S(e, b, H);
1346
1349
  T.current = 0;
1347
- let n = V / 2, r = b - 140, i = Math.max(...B.map((e) => e.count ?? 0), 1), a = B.length > 1 ? (V - 60) / (B.length - 1) : 0, o = r + 22 + 10, s = B.map((e, t) => ({
1350
+ let n = V / 2, r = b - 140, i = Math.max(...B.map((e) => e.count ?? 0), 1), a = B.length > 1 ? (V - 60) / (B.length - 1) : 60, o = Math.min(22, a / 2 - 3), s = Math.min(8, Math.max(3, o - 6)), c = r + o + 10, l = B.map((e, t) => ({
1348
1351
  x: r,
1349
1352
  y: 30 + t * a
1350
- })), c, l = () => {
1353
+ })), d, f = () => {
1351
1354
  T.current++;
1352
1355
  let e = T.current;
1353
- t.clearRect(0, 0, b, H), t.letterSpacing = h.letterSpacing;
1354
- let a = A(Math.min(e / 72, 1));
1355
- I(w.current, U.current), G.current = [];
1356
- let d = m[p % m.length], f = 100 + 60 * Math.min(1, a * 2.5), _ = t.createLinearGradient(100, 0, f, 0);
1357
- _.addColorStop(0, v(d, .8)), _.addColorStop(1, v(d, .7)), t.beginPath(), t.moveTo(100, n), t.lineTo(f, n), t.strokeStyle = _, t.lineWidth = 1.33, t.stroke(), B.forEach((e, c) => {
1358
- let l = F(a, c, B.length, A), f = s[c], p = w.current.get(e.id) ?? 0, m = !N && k.current && e.id !== k.current ? .15 : 1;
1359
- if (l < .01) return;
1360
- let _ = 160 + (r - 160) * .35, y = n, x = 160 + (r - 160) * .65, C = f.y;
1356
+ t.clearRect(0, 0, b, H), t.letterSpacing = g.letterSpacing;
1357
+ let a = j(Math.min(e / 72, 1));
1358
+ L(w.current, U.current), te.current = [];
1359
+ let m = h[p % h.length], v = 100 + 60 * Math.min(1, a * 2.5), x = t.createLinearGradient(100, 0, v, 0);
1360
+ x.addColorStop(0, y(m, .8)), x.addColorStop(1, y(m, .7)), t.beginPath(), t.moveTo(100, n), t.lineTo(v, n), t.strokeStyle = x, t.lineWidth = 1.33, t.stroke(), B.forEach((e, d) => {
1361
+ let f = I(a, d, B.length, j), p = l[d], h = w.current.get(e.id) ?? 0, v = !N && E.current && e.id !== E.current ? .6 : 1;
1362
+ if (f < .01) return;
1363
+ let x = 160 + (r - 160) * .35, S = n, T = 160 + (r - 160) * .65, D = p.y;
1361
1364
  t.beginPath();
1362
1365
  for (let e = 0; e <= 40; e++) {
1363
- let r = e / 40 * l, i = (1 - r) ** 3 * 160 + 3 * (1 - r) ** 2 * r * _ + 3 * (1 - r) * r ** 2 * x + r ** 3 * f.x, a = (1 - r) ** 3 * n + 3 * (1 - r) ** 2 * r * y + 3 * (1 - r) * r ** 2 * C + r ** 3 * f.y;
1366
+ let r = e / 40 * f, i = (1 - r) ** 3 * 160 + 3 * (1 - r) ** 2 * r * x + 3 * (1 - r) * r ** 2 * T + r ** 3 * p.x, a = (1 - r) ** 3 * n + 3 * (1 - r) ** 2 * r * S + 3 * (1 - r) * r ** 2 * D + r ** 3 * p.y;
1364
1367
  e === 0 ? t.moveTo(i, a) : t.lineTo(i, a);
1365
1368
  }
1366
- let T = t.createLinearGradient(160, n, f.x, f.y);
1367
- if (T.addColorStop(0, v(d, (p > 0 ? 1 : .8) * m)), T.addColorStop(1, v(d, (p > 0 ? 1 : .7) * m)), t.strokeStyle = T, t.lineWidth = p > 0 ? 2 : 1.33, t.stroke(), l > .85) {
1368
- let n = Math.min(1, (l - .85) / .15), r = 8 + (e.count ?? 0) / i * 14;
1369
- S(t, f.x, f.y, r * 2, d, (.2 + p * .2) * n * m), t.beginPath(), t.arc(f.x, f.y, r * n, 0, Math.PI * 2), t.fillStyle = v(d, n * m), t.fill();
1369
+ let O = t.createLinearGradient(160, n, p.x, p.y);
1370
+ if (O.addColorStop(0, y(m, (h > 0 ? 1 : .8) * v)), O.addColorStop(1, y(m, (h > 0 ? 1 : .7) * v)), t.strokeStyle = O, t.lineWidth = h > 0 ? 2 : 1.33, t.stroke(), f > .85) {
1371
+ let n = Math.min(1, (f - .85) / .15), r = s + (e.count ?? 0) / i * (o - s);
1372
+ C(t, p.x, p.y, r * 2, m, (.2 + h * .2) * n * v), t.beginPath(), t.arc(p.x, p.y, r * n, 0, Math.PI * 2), t.fillStyle = y(m, n * v), t.fill();
1370
1373
  let a = K(e.count ?? 0);
1371
- O(G.current, e.id, f.x, f.y, r + 8, {
1374
+ k(te.current, e.id, p.x, p.y, r + 8, {
1372
1375
  label: e.name,
1373
1376
  value: a,
1374
- sublabel: `${Math.round((e.count ?? 0) / (L || 1) * 100)}% of total`,
1375
- color: d
1376
- }, b), t.globalAlpha = n * m, t.font = h.font, t.textAlign = "left";
1377
- let s = e.abbreviation ?? e.name?.slice(0, 6) ?? "", c = ` ${K(e.count ?? 0)}`, _ = f.y + 4;
1378
- t.fillStyle = p > 0 ? d : v(u.t2, .85), t.fillText(s, o, _);
1379
- let y = t.measureText(s).width;
1380
- t.font = g.font, t.fillStyle = p > 0 ? d : u.t1, t.fillText(c, o + y, _), t.globalAlpha = 1;
1377
+ sublabel: `${Math.round((e.count ?? 0) / (F || 1) * 100)}% of total`,
1378
+ color: m
1379
+ }, b), t.globalAlpha = n * v, t.font = g.font, t.textAlign = "left";
1380
+ let l = e.abbreviation ?? e.name?.slice(0, 6) ?? "", d = ` ${K(e.count ?? 0)}`, x = p.y + 4;
1381
+ t.fillStyle = h > 0 ? m : y(u.t2, .85), t.fillText(l, c, x);
1382
+ let S = t.measureText(l).width;
1383
+ t.font = _.font, t.fillStyle = h > 0 ? m : u.t1, t.fillText(d, c + S, x), t.globalAlpha = 1;
1381
1384
  }
1382
1385
  });
1383
- let y = 40 * a, x = t.createRadialGradient(60, n, 0, 60, n, y);
1384
- if (x.addColorStop(0, v(d, .02 * a)), x.addColorStop(.55, v(d, .02 * a)), x.addColorStop(1, v(d, .15 * a)), t.beginPath(), t.arc(60, n, y, 0, Math.PI * 2), t.fillStyle = x, t.fill(), t.beginPath(), t.arc(60, n, y, 0, Math.PI * 2), t.strokeStyle = v(d, .8 * a), t.lineWidth = 1, t.stroke(), a > .4) {
1386
+ let S = 40 * a, D = t.createRadialGradient(60, n, 0, 60, n, S);
1387
+ if (D.addColorStop(0, y(m, .02 * a)), D.addColorStop(.55, y(m, .02 * a)), D.addColorStop(1, y(m, .15 * a)), t.beginPath(), t.arc(60, n, S, 0, Math.PI * 2), t.fillStyle = D, t.fill(), t.beginPath(), t.arc(60, n, S, 0, Math.PI * 2), t.strokeStyle = y(m, .8 * a), t.lineWidth = 1, t.stroke(), a > .4) {
1385
1388
  t.globalAlpha = Math.min(1, (a - .4) / .4);
1386
- let e = R ?? K(L, 0);
1389
+ let e = R ?? K(F, 0);
1387
1390
  t.font = "500 16px 'Satoshi Variable', 'DM Sans', sans-serif";
1388
1391
  let r = e;
1389
1392
  for (; t.measureText(r).width > 68 && r.length > 1;) r = r.slice(0, -1);
1390
1393
  r !== e && (r = r.slice(0, -1) + "…"), t.fillStyle = u.t1, t.textAlign = "center", t.textBaseline = "middle", t.fillText(r, 60, n), t.textBaseline = "alphabetic", t.globalAlpha = 1;
1391
1394
  }
1392
- O(G.current, "__root__", 60, n, 40, {
1395
+ k(te.current, "__root__", 60, n, 40, {
1393
1396
  label: R ?? "Total",
1394
- value: K(L, 0),
1397
+ value: K(F, 0),
1395
1398
  sublabel: `${B.length} items`,
1396
- color: d
1397
- }), c = requestAnimationFrame(l);
1399
+ color: m
1400
+ }), d = requestAnimationFrame(f);
1398
1401
  };
1399
- return l(), () => cancelAnimationFrame(c);
1402
+ return f(), () => cancelAnimationFrame(d);
1400
1403
  }, [
1401
- L,
1404
+ F,
1402
1405
  R,
1403
1406
  B,
1404
1407
  V,
1405
1408
  b,
1406
1409
  N
1407
1410
  ]), B.length === 0 ? /* @__PURE__ */ s("div", {
1408
- ref: y,
1411
+ ref: v,
1409
1412
  style: { width: "100%" },
1410
- children: /* @__PURE__ */ s(W, {
1413
+ children: /* @__PURE__ */ s(G, {
1411
1414
  width: b,
1412
1415
  height: qe,
1413
- testID: _
1416
+ testID: m
1414
1417
  })
1415
1418
  }) : /* @__PURE__ */ c("div", {
1416
- ref: y,
1417
- "data-testid": _,
1419
+ ref: v,
1420
+ "data-testid": m,
1418
1421
  style: {
1419
1422
  position: "relative",
1420
1423
  width: "100%",
1421
1424
  height: H
1422
1425
  },
1423
1426
  children: [/* @__PURE__ */ s("canvas", {
1424
- ref: C,
1427
+ ref: x,
1425
1428
  role: "img",
1426
1429
  "aria-label": "NCE fault tree — NCEs per contractor as branching tree",
1427
1430
  style: {
@@ -1429,8 +1432,8 @@ function Xe({ total: e = 0, totalLabel: r, items: o = [], dataByEntity: l, onIte
1429
1432
  height: H,
1430
1433
  display: "block"
1431
1434
  }
1432
- }), /* @__PURE__ */ s(E, {
1433
- ...te,
1435
+ }), /* @__PURE__ */ s(D, {
1436
+ ...W,
1434
1437
  parentW: b,
1435
1438
  parentH: H
1436
1439
  })]
@@ -1440,36 +1443,36 @@ function Xe({ total: e = 0, totalLabel: r, items: o = [], dataByEntity: l, onIte
1440
1443
  //#region src/components/pieChart/PieChart.tsx
1441
1444
  var Ze = 192, Qe = Ze, $e = Ze + 80;
1442
1445
  function et({ rows: e = [], variant: t, className: r, colors: i }) {
1443
- let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), m = i?.slices ?? p, { hoveredRef: h, tooltip: g, hitZonesRef: _ } = D(o, {
1446
+ let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), m = i?.slices ?? p, { hoveredRef: h, tooltip: g, hitZonesRef: _ } = O(o, {
1444
1447
  width: Qe,
1445
1448
  height: $e
1446
1449
  });
1447
1450
  return n(() => {
1448
1451
  let n = o.current;
1449
1452
  if (!n) return;
1450
- let r = x(n, Qe, $e);
1453
+ let r = S(n, Qe, $e);
1451
1454
  f.current = 0;
1452
1455
  let i = Qe / 2, a = Ze / 2, s = Ze * .4, c = t === "donut" ? Ze * .21 : 0, l = e.reduce((e, t) => e + (t.pricing ?? 0), 0) || 1, p, g = () => {
1453
1456
  f.current++;
1454
1457
  let n = f.current;
1455
1458
  r.clearRect(0, 0, Qe, $e);
1456
1459
  let o = 1 - (1 - Math.min(n / 48, 1)) ** 3;
1457
- I(d.current, h.current), _.current = [];
1458
- let y = -Math.PI / 2;
1460
+ L(d.current, h.current), _.current = [];
1461
+ let v = -Math.PI / 2;
1459
1462
  e.forEach((e, t) => {
1460
- let f = (e.pricing ?? 0) / l, p = f * Math.PI * 2 * o, h = y + p, g = m[t % m.length], b = d.current.get(e.id ?? `sl-${t}`) ?? 0, x = y + p / 2, C = (s + c) / 2, w = i + Math.cos(x) * C, T = a + Math.sin(x) * C, E = (s - c) / 2 + 8;
1461
- O(_.current, e.id ?? `sl-${t}`, w, T, E, {
1463
+ let f = (e.pricing ?? 0) / l, p = f * Math.PI * 2 * o, h = v + p, g = m[t % m.length], b = d.current.get(e.id ?? `sl-${t}`) ?? 0, x = v + p / 2, S = (s + c) / 2, w = i + Math.cos(x) * S, T = a + Math.sin(x) * S, E = (s - c) / 2 + 8;
1464
+ k(_.current, e.id ?? `sl-${t}`, w, T, E, {
1462
1465
  label: e.vendor,
1463
1466
  value: `${e.pricing ?? 0} (${Math.round(f * 100)}%)`,
1464
1467
  color: g
1465
- }), b > 0 && S(r, w, T, E * 2 * b, g, .2 * b);
1466
- let D = P(n, .03, 3e-4), k = s + b * 6 + (b > 0 ? D * 2 : 0);
1467
- r.beginPath(), r.moveTo(i + Math.cos(y) * c, a + Math.sin(y) * c), r.arc(i, a, k, y, h), c > 0 ? r.arc(i, a, c, h, y, !0) : r.lineTo(i, a), r.closePath(), r.fillStyle = v(g, .7 + b * .2), r.fill(), r.strokeStyle = v(u.bg, .8), r.lineWidth = 1.5, r.stroke(), y = h;
1468
- }), t === "donut" && e.length > 0 && S(r, i, a, c * .8, u.blue, .06);
1469
- let x = Ze + 12;
1468
+ }), b > 0 && C(r, w, T, E * 2 * b, g, .2 * b);
1469
+ let D = F(n, .03, 3e-4), O = s + b * 6 + (b > 0 ? D * 2 : 0);
1470
+ r.beginPath(), r.moveTo(i + Math.cos(v) * c, a + Math.sin(v) * c), r.arc(i, a, O, v, h), c > 0 ? r.arc(i, a, c, h, v, !0) : r.lineTo(i, a), r.closePath(), r.fillStyle = y(g, .7 + b * .2), r.fill(), r.strokeStyle = y(u.bg, .8), r.lineWidth = 1.5, r.stroke(), v = h;
1471
+ }), t === "donut" && e.length > 0 && C(r, i, a, c * .8, u.blue, .06);
1472
+ let b = Ze + 12;
1470
1473
  e.forEach((e, t) => {
1471
- let n = m[t % m.length], i = (e.pricing ?? 0) / l, a = d.current.get(e.id ?? `sl-${t}`) ?? 0, o = x + t * 18;
1472
- r.fillStyle = v(n, .8 + a * .2), r.fillRect(4, o - 6, 12, 12), r.font = "9px 'JetBrains Mono', monospace", r.fillStyle = v(u.t2, .7 + a * .2), r.textAlign = "left", r.fillText(e.vendor, 18, o + 3.5), r.font = "bold 9px 'JetBrains Mono', monospace", r.fillStyle = b(u.t3, n, a), r.textAlign = "right", r.fillText(`${e.pricing ?? 0} (${Math.round(i * 100)}%)`, Qe - 4, o + 3.5);
1474
+ let n = m[t % m.length], i = (e.pricing ?? 0) / l, a = d.current.get(e.id ?? `sl-${t}`) ?? 0, o = b + t * 18;
1475
+ r.fillStyle = y(n, .8 + a * .2), r.fillRect(4, o - 6, 12, 12), r.font = "9px 'JetBrains Mono', monospace", r.fillStyle = y(u.t2, .7 + a * .2), r.textAlign = "left", r.fillText(e.vendor, 18, o + 3.5), r.font = "bold 9px 'JetBrains Mono', monospace", r.fillStyle = x(u.t3, n, a), r.textAlign = "right", r.fillText(`${e.pricing ?? 0} (${Math.round(i * 100)}%)`, Qe - 4, o + 3.5);
1473
1476
  }), p = requestAnimationFrame(g);
1474
1477
  };
1475
1478
  return g(), () => cancelAnimationFrame(p);
@@ -1496,7 +1499,7 @@ function et({ rows: e = [], variant: t, className: r, colors: i }) {
1496
1499
  display: "block",
1497
1500
  borderRadius: 8
1498
1501
  }
1499
- }), /* @__PURE__ */ s(E, {
1502
+ }), /* @__PURE__ */ s(D, {
1500
1503
  ...g,
1501
1504
  parentW: Qe,
1502
1505
  parentH: $e
@@ -1552,37 +1555,37 @@ function tt(e, t, n, r) {
1552
1555
  }), f;
1553
1556
  }
1554
1557
  function nt({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: d, selectedEntity: f, className: m, colors: h }) {
1555
- let g = a(null), _ = a(/* @__PURE__ */ new Map()), y = a(0), b = a([]), C = h?.nodes ?? p, T = h?.links ?? u.bd, A = h?.activeLinks ?? u.blue, j = h?.activeNodes ?? u.blue, M = i(() => tt(e, t, r, o), [
1558
+ let g = a(null), _ = a(/* @__PURE__ */ new Map()), v = a(0), b = a([]), x = h?.nodes ?? p, w = h?.links ?? u.bd, E = h?.activeLinks ?? u.blue, j = h?.activeNodes ?? u.blue, M = i(() => tt(e, t, r, o), [
1556
1559
  e,
1557
1560
  t,
1558
1561
  r,
1559
1562
  o
1560
- ]), { hoveredRef: N, tooltip: F, hitZonesRef: L } = D(g, {
1563
+ ]), { hoveredRef: N, tooltip: P, hitZonesRef: I } = O(g, {
1561
1564
  width: r,
1562
1565
  height: o
1563
1566
  });
1564
1567
  return n(() => {
1565
1568
  let n = g.current;
1566
1569
  if (!n) return;
1567
- let i = x(n, r, o);
1568
- y.current = 0, b.current = [];
1570
+ let i = S(n, r, o);
1571
+ v.current = 0, b.current = [];
1569
1572
  let a = t.length > 0 ? Math.max(...t.map((e) => e.value)) : 1, s, c = () => {
1570
- y.current++;
1571
- let n = y.current;
1573
+ v.current++;
1574
+ let n = v.current;
1572
1575
  i.clearRect(0, 0, r, o);
1573
1576
  let l = 1 - (1 - Math.min(n / 56, 1)) ** 3;
1574
- I(_.current, N.current), L.current = [], t.forEach((e, t) => {
1577
+ L(_.current, N.current), I.current = [], t.forEach((e, t) => {
1575
1578
  let r = M.get(e.source), o = M.get(e.target);
1576
1579
  if (!r || !o) return;
1577
- let s = !!f && (e.source === f || e.target === f), c = s ? A : T, d = s ? .5 : .2, p = Math.max(3, e.value / a * 36 * l), m = p / 2, h = r.x + r.w, g = r.y + r.h / 2, _ = o.x, y = o.y + o.h / 2, x = (h + _) / 2;
1580
+ let s = !!f && (e.source === f || e.target === f), c = s ? E : w, d = s ? .5 : .2, p = Math.max(3, e.value / a * 36 * l), m = p / 2, h = r.x + r.w, g = r.y + r.h / 2, _ = o.x, v = o.y + o.h / 2, x = (h + _) / 2;
1578
1581
  for (let e = 0; e < 30; e++) {
1579
- let r = e / 30, a = (e + 1) / 30, o = 1 - r, s = 1 - a, l = o * o * h + 2 * o * r * x + r * r * _, u = o * o * g + 2 * o * r * g + r * r * y, f = s * s * h + 2 * s * a * x + a * a * _, p = s * s * g + 2 * s * a * g + a * a * y, b = P(n + r * 120 + t * 40, .025, 3e-4) * 1.2;
1580
- i.beginPath(), i.moveTo(l, u - m + b), i.lineTo(f, p - m + b), i.lineTo(f, p + m + b), i.lineTo(l, u + m + b), i.closePath(), i.fillStyle = v(c, d * (.5 + r * .5)), i.fill();
1582
+ let r = e / 30, a = (e + 1) / 30, o = 1 - r, s = 1 - a, l = o * o * h + 2 * o * r * x + r * r * _, u = o * o * g + 2 * o * r * g + r * r * v, f = s * s * h + 2 * s * a * x + a * a * _, p = s * s * g + 2 * s * a * g + a * a * v, b = F(n + r * 120 + t * 40, .025, 3e-4) * 1.2;
1583
+ i.beginPath(), i.moveTo(l, u - m + b), i.lineTo(f, p - m + b), i.lineTo(f, p + m + b), i.lineTo(l, u + m + b), i.closePath(), i.fillStyle = y(c, d * (.5 + r * .5)), i.fill();
1581
1584
  }
1582
- O(L.current, `link-${t}`, x, (g + y) / 2, p + 6, {
1585
+ k(I.current, `link-${t}`, x, (g + v) / 2, p + 6, {
1583
1586
  label: `${e.source} → ${e.target}`,
1584
1587
  value: String(e.value),
1585
- color: s ? A : u.blue
1588
+ color: s ? E : u.blue
1586
1589
  }), Math.random() < .08 && b.current.push({
1587
1590
  linkIdx: t,
1588
1591
  prog: 0,
@@ -1593,16 +1596,16 @@ function nt({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: d,
1593
1596
  }), e.forEach((e, t) => {
1594
1597
  let r = M.get(e.id);
1595
1598
  if (!r) return;
1596
- let a = f === e.id, o = N.current === `node-${t}`, s = _.current.get(`node-${t}`) ?? 0, c = a ? j : C[t % C.length];
1597
- k(L.current, `node-${t}`, r.x, r.y, r.w, r.h, {
1599
+ let a = f === e.id, o = N.current === `node-${t}`, s = _.current.get(`node-${t}`) ?? 0, c = a ? j : x[t % x.length];
1600
+ A(I.current, `node-${t}`, r.x, r.y, r.w, r.h, {
1598
1601
  label: e.name,
1599
1602
  value: e.valueLabel ?? e.id,
1600
1603
  color: c
1601
- }), (s > 0 || a) && S(i, r.x + r.w / 2, r.y + r.h / 2, r.w * 2, c, .2 * Math.max(s, a ? .6 : 0));
1602
- let l = a ? P(n, .03, 3e-4) * .15 : 0;
1603
- i.fillStyle = v(c, .6 + s * .25 + l), i.beginPath(), i.roundRect(r.x, r.y, r.w, r.h, 4), i.fill(), (a || s > 0) && (i.strokeStyle = v(c, .5 * Math.max(s, a ? 1 : 0)), i.lineWidth = 1, i.beginPath(), i.roundRect(r.x, r.y, r.w, r.h, 4), i.stroke());
1604
+ }), (s > 0 || a) && C(i, r.x + r.w / 2, r.y + r.h / 2, r.w * 2, c, .2 * Math.max(s, a ? .6 : 0));
1605
+ let l = a ? F(n, .03, 3e-4) * .15 : 0;
1606
+ i.fillStyle = y(c, .6 + s * .25 + l), i.beginPath(), i.roundRect(r.x, r.y, r.w, r.h, 4), i.fill(), (a || s > 0) && (i.strokeStyle = y(c, .5 * Math.max(s, a ? 1 : 0)), i.lineWidth = 1, i.beginPath(), i.roundRect(r.x, r.y, r.w, r.h, 4), i.stroke());
1604
1607
  let d = r.x + r.w + 8;
1605
- i.font = `${a || o ? "bold " : ""}10px 'JetBrains Mono', monospace`, i.fillStyle = v(a ? c : u.t2, .7 + s * .2), i.textAlign = "left", i.fillText(e.name, d, r.y + r.h / 2 + 4), e.valueLabel && (i.font = "9px 'JetBrains Mono', monospace", i.fillStyle = v(c, .5 + s * .2), i.fillText(e.valueLabel, d, r.y + r.h / 2 + 17));
1608
+ i.font = `${a || o ? "bold " : ""}10px 'JetBrains Mono', monospace`, i.fillStyle = y(a ? c : u.t2, .7 + s * .2), i.textAlign = "left", i.fillText(e.name, d, r.y + r.h / 2 + 4), e.valueLabel && (i.font = "9px 'JetBrains Mono', monospace", i.fillStyle = y(c, .5 + s * .2), i.fillText(e.valueLabel, d, r.y + r.h / 2 + 17));
1606
1609
  }), b.current = b.current.filter((e) => {
1607
1610
  if (e.prog += e.speed, e.prog > 1) return !1;
1608
1611
  let n = t[e.linkIdx];
@@ -1610,8 +1613,8 @@ function nt({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: d,
1610
1613
  let r = M.get(n.source), a = M.get(n.target);
1611
1614
  if (!r || !a) return !1;
1612
1615
  let o = r.x + r.w, s = r.y + r.h / 2, c = a.x, l = a.y + a.h / 2, d = (o + c) / 2, f = 1 - e.prog, p = f * f * o + 2 * f * e.prog * d + e.prog * e.prog * c, m = f * f * s + 2 * f * e.prog * s + e.prog * e.prog * l + e.off, g = Math.sin(e.prog * Math.PI) * .5, _ = h?.links ?? u.blue;
1613
- return i.beginPath(), i.arc(p, m, e.sz, 0, Math.PI * 2), i.fillStyle = v(_, g), i.fill(), !0;
1614
- }), b.current.length > 150 && (b.current = b.current.slice(-150)), w(i, r, o, n, .01), s = requestAnimationFrame(c);
1616
+ return i.beginPath(), i.arc(p, m, e.sz, 0, Math.PI * 2), i.fillStyle = y(_, g), i.fill(), !0;
1617
+ }), b.current.length > 150 && (b.current = b.current.slice(-150)), T(i, r, o, n, .01), s = requestAnimationFrame(c);
1615
1618
  };
1616
1619
  return c(), () => {
1617
1620
  cancelAnimationFrame(s), b.current = [];
@@ -1642,8 +1645,8 @@ function nt({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: d,
1642
1645
  display: "block",
1643
1646
  borderRadius: 8
1644
1647
  }
1645
- }), /* @__PURE__ */ s(E, {
1646
- ...F,
1648
+ }), /* @__PURE__ */ s(D, {
1649
+ ...P,
1647
1650
  parentW: r,
1648
1651
  parentH: o
1649
1652
  })]
@@ -1739,13 +1742,13 @@ function ct(e, t) {
1739
1742
  };
1740
1743
  }
1741
1744
  function lt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntity: l }) {
1742
- let d = a(null), f = a(0), p = a([]), { hoveredRef: m, tooltip: h, hitZonesRef: g } = D(d, {
1745
+ let d = a(null), f = a(0), p = a([]), { hoveredRef: m, tooltip: h, hitZonesRef: g } = O(d, {
1743
1746
  width: r,
1744
1747
  height: o
1745
1748
  }), _ = i(() => {
1746
1749
  let t = /* @__PURE__ */ new Map();
1747
1750
  return e.forEach((e, n) => t.set(e.id, n)), t;
1748
- }, [e]), y = i(() => t.length > 0 ? Math.max(...t.map((e) => e.value)) : 100, [t]), T = (e) => y > 1 ? e / 100 : e, k = i(() => e.map((e, t) => {
1751
+ }, [e]), v = i(() => t.length > 0 ? Math.max(...t.map((e) => e.value)) : 100, [t]), b = (e) => v > 1 ? e / 100 : e, E = i(() => e.map((e, t) => {
1749
1752
  let n = rt[t % rt.length];
1750
1753
  return {
1751
1754
  id: e.id,
@@ -1760,24 +1763,24 @@ function lt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
1760
1763
  e,
1761
1764
  r,
1762
1765
  o
1763
- ]), j = i(() => t.map((e) => ({
1766
+ ]), A = i(() => t.map((e) => ({
1764
1767
  fromIdx: _.get(e.source) ?? -1,
1765
1768
  toIdx: _.get(e.target) ?? -1,
1766
- conf: T(e.value)
1769
+ conf: b(e.value)
1767
1770
  })).filter((e) => e.fromIdx >= 0 && e.toIdx >= 0), [t, _]);
1768
1771
  return n(() => {
1769
1772
  let e = d.current;
1770
1773
  if (!e) return;
1771
- let t = x(e, r, o);
1774
+ let t = S(e, r, o);
1772
1775
  f.current = 0, p.current = [];
1773
1776
  let n, i = () => {
1774
1777
  f.current++;
1775
1778
  let e = f.current;
1776
- if (t.clearRect(0, 0, r, o), g.current = [], C(t, r, o, e, 50, v(u.blue, .05)), j.forEach((e, n) => {
1777
- let r = k[e.fromIdx], i = k[e.toIdx];
1779
+ if (t.clearRect(0, 0, r, o), g.current = [], w(t, r, o, e, 50, y(u.blue, .05)), A.forEach((e, n) => {
1780
+ let r = E[e.fromIdx], i = E[e.toIdx];
1778
1781
  if (!r || !i) return;
1779
- let a = !!l && (r.id === l || i.id === l), o = b(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d = ct(r, i);
1780
- t.beginPath(), t.moveTo(d.p0.x, d.p0.y), t.bezierCurveTo(d.p1.x, d.p1.y, d.p2.x, d.p2.y, d.p3.x, d.p3.y), t.strokeStyle = v(o, s), t.lineWidth = 16, t.lineCap = "round", t.stroke(), t.strokeStyle = v(o, c), t.lineWidth = 1.5, t.stroke();
1782
+ let a = !!l && (r.id === l || i.id === l), o = x(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d = ct(r, i);
1783
+ t.beginPath(), t.moveTo(d.p0.x, d.p0.y), t.bezierCurveTo(d.p1.x, d.p1.y, d.p2.x, d.p2.y, d.p3.x, d.p3.y), t.strokeStyle = y(o, s), t.lineWidth = 16, t.lineCap = "round", t.stroke(), t.strokeStyle = y(o, c), t.lineWidth = 1.5, t.stroke();
1781
1784
  for (let t = 0; t < e.conf * 2.5; t++) Math.random() < .45 && p.current.push({
1782
1785
  edgeIdx: n,
1783
1786
  t: 0,
@@ -1788,42 +1791,42 @@ function lt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
1788
1791
  let f = ot(d, .5), m = `${Math.round(e.conf * 100)}%`;
1789
1792
  t.font = "bold 12px 'JetBrains Mono', monospace", t.textBaseline = "middle";
1790
1793
  let h = t.measureText(m).width + 14;
1791
- t.fillStyle = "rgba(10,16,24,0.88)", t.beginPath(), t.roundRect(f.x - h / 2, f.y - 11, h, 22, 6), t.fill(), t.strokeStyle = v(u.blue, .25), t.lineWidth = 1, t.stroke(), t.fillStyle = v(u.blue, .9), t.textAlign = "center", t.fillText(m, f.x, f.y);
1794
+ t.fillStyle = "rgba(10,16,24,0.88)", t.beginPath(), t.roundRect(f.x - h / 2, f.y - 11, h, 22, 6), t.fill(), t.strokeStyle = y(u.blue, .25), t.lineWidth = 1, t.stroke(), t.fillStyle = y(u.blue, .9), t.textAlign = "center", t.fillText(m, f.x, f.y);
1792
1795
  }), p.current = p.current.filter((e) => {
1793
1796
  if (e.t += e.speed, e.t > 1) return !1;
1794
- let n = j[e.edgeIdx];
1797
+ let n = A[e.edgeIdx];
1795
1798
  if (!n) return !1;
1796
- let r = k[n.fromIdx], i = k[n.toIdx];
1799
+ let r = E[n.fromIdx], i = E[n.toIdx];
1797
1800
  if (!r || !i) return !1;
1798
- let a = ct(r, i), o = ot(a, e.t), s = st(a, e.t), c = o.x + s.x * e.off, l = o.y + s.y * e.off, u = Math.sin(e.t * Math.PI) * .7, d = b(r.color, i.color, e.t);
1799
- return S(t, c, l, e.sz * 3, d, u * .1), t.beginPath(), t.arc(c, l, e.sz, 0, Math.PI * 2), t.fillStyle = v(d, u), t.fill(), !0;
1800
- }), p.current.length > 350 && (p.current = p.current.slice(-350)), k.forEach((n, r) => {
1801
- let i = l === n.id, a = m.current === `node-${r}`, o = P(e, .03, 3e-4) * .1 + 1, s = n.r * o * (i ? 1.15 : 1);
1802
- t.beginPath(), t.arc(n.x, n.y, s + 6, 0, Math.PI * 2), t.strokeStyle = v(n.color, i ? .3 : .1), t.lineWidth = i ? 1.5 : .7, t.stroke(), S(t, n.x, n.y, s * 3, n.color, i ? .22 : .12);
1801
+ let a = ct(r, i), o = ot(a, e.t), s = st(a, e.t), c = o.x + s.x * e.off, l = o.y + s.y * e.off, u = Math.sin(e.t * Math.PI) * .7, d = x(r.color, i.color, e.t);
1802
+ return C(t, c, l, e.sz * 3, d, u * .1), t.beginPath(), t.arc(c, l, e.sz, 0, Math.PI * 2), t.fillStyle = y(d, u), t.fill(), !0;
1803
+ }), p.current.length > 350 && (p.current = p.current.slice(-350)), E.forEach((n, r) => {
1804
+ let i = l === n.id, a = m.current === `node-${r}`, o = F(e, .03, 3e-4) * .1 + 1, s = n.r * o * (i ? 1.15 : 1);
1805
+ t.beginPath(), t.arc(n.x, n.y, s + 6, 0, Math.PI * 2), t.strokeStyle = y(n.color, i ? .3 : .1), t.lineWidth = i ? 1.5 : .7, t.stroke(), C(t, n.x, n.y, s * 3, n.color, i ? .22 : .12);
1803
1806
  let c = t.createRadialGradient(n.x, n.y - s * .2, 0, n.x, n.y, s);
1804
- if (c.addColorStop(0, v(n.color, i ? 1 : .85)), c.addColorStop(1, v(n.color, i ? .65 : .45)), t.fillStyle = c, t.beginPath(), t.arc(n.x, n.y, s, 0, Math.PI * 2), t.fill(), i || r === k.length - 1) {
1807
+ if (c.addColorStop(0, y(n.color, i ? 1 : .85)), c.addColorStop(1, y(n.color, i ? .65 : .45)), t.fillStyle = c, t.beginPath(), t.arc(n.x, n.y, s, 0, Math.PI * 2), t.fill(), i || r === E.length - 1) {
1805
1808
  let r = s + 16, i = e * .04, a = n.x + Math.cos(i) * r, o = n.y + Math.sin(i) * r;
1806
- S(t, a, o, 6, n.color, .3), t.beginPath(), t.arc(a, o, 2, 0, Math.PI * 2), t.fillStyle = v(n.color, .75), t.fill();
1809
+ C(t, a, o, 6, n.color, .3), t.beginPath(), t.arc(a, o, 2, 0, Math.PI * 2), t.fillStyle = y(n.color, .75), t.fill();
1807
1810
  }
1808
- O(g.current, `node-${r}`, n.x, n.y, s + 8, {
1811
+ k(g.current, `node-${r}`, n.x, n.y, s + 8, {
1809
1812
  label: n.label,
1810
1813
  value: n.sub || n.id,
1811
1814
  color: n.color
1812
- }), t.font = `${i || a ? "bold " : ""}12px 'DM Sans', sans-serif`, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = v(n.color, i ? 1 : .9), t.fillText(n.label, n.x, n.y + s + 18), n.sub && (t.font = "10px 'JetBrains Mono', monospace", t.fillStyle = v(u.t3, .65), t.fillText(n.sub, n.x, n.y + s + 32));
1813
- }), j.length >= 2) {
1814
- let n = j.reduce((e, t) => e * t.conf, 1), i = o * .92, a = r * .12, s = r * .76, c = A(Math.min(e * .008, 1));
1815
- t.fillStyle = v(u.bd, .35), t.beginPath(), t.roundRect(a, i, s, 5, 3), t.fill(), t.fillStyle = v(u.orange, .6), t.beginPath(), t.roundRect(a, i, s * n * c, 5, 3), t.fill(), t.font = "bold 12px 'JetBrains Mono', monospace", t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = v(u.orange, .85), t.fillText(`${Math.round(n * 100)}% compound confidence`, a + s * n * c + 10, i + 2);
1816
- let l = j.map((e) => e.conf.toFixed(2)).join(" × ");
1817
- t.textAlign = "right", t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = v(u.t4, .6), t.fillText(l, a - 6, i + 2);
1815
+ }), t.font = `${i || a ? "bold " : ""}12px 'DM Sans', sans-serif`, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = y(n.color, i ? 1 : .9), t.fillText(n.label, n.x, n.y + s + 18), n.sub && (t.font = "10px 'JetBrains Mono', monospace", t.fillStyle = y(u.t3, .65), t.fillText(n.sub, n.x, n.y + s + 32));
1816
+ }), A.length >= 2) {
1817
+ let n = A.reduce((e, t) => e * t.conf, 1), i = o * .92, a = r * .12, s = r * .76, c = j(Math.min(e * .008, 1));
1818
+ t.fillStyle = y(u.bd, .35), t.beginPath(), t.roundRect(a, i, s, 5, 3), t.fill(), t.fillStyle = y(u.orange, .6), t.beginPath(), t.roundRect(a, i, s * n * c, 5, 3), t.fill(), t.font = "bold 12px 'JetBrains Mono', monospace", t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = y(u.orange, .85), t.fillText(`${Math.round(n * 100)}% compound confidence`, a + s * n * c + 10, i + 2);
1819
+ let l = A.map((e) => e.conf.toFixed(2)).join(" × ");
1820
+ t.textAlign = "right", t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = y(u.t4, .6), t.fillText(l, a - 6, i + 2);
1818
1821
  }
1819
- w(t, r, o, e, .012), n = requestAnimationFrame(i);
1822
+ T(t, r, o, e, .012), n = requestAnimationFrame(i);
1820
1823
  };
1821
1824
  return i(), () => {
1822
1825
  cancelAnimationFrame(n), p.current = [];
1823
1826
  };
1824
1827
  }, [
1825
- k,
1826
- j,
1828
+ E,
1829
+ A,
1827
1830
  r,
1828
1831
  o,
1829
1832
  l
@@ -1843,7 +1846,7 @@ function lt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
1843
1846
  },
1844
1847
  role: "img",
1845
1848
  "aria-label": "causal flow diagram"
1846
- }), /* @__PURE__ */ s(E, {
1849
+ }), /* @__PURE__ */ s(D, {
1847
1850
  ...h,
1848
1851
  parentW: r,
1849
1852
  parentH: o
@@ -1895,37 +1898,37 @@ function dt({ rows: e = [], className: t, colors: n }) {
1895
1898
  //#region src/components/balanceScaleChart/BalanceScaleChart.tsx
1896
1899
  var ft = 780, pt = 420;
1897
1900
  function mt({ left: e, right: r, leftTitle: i = "Accepted", rightTitle: o = "Submitted", unit: l = "quotations", selectedId: d, dataByEntity: f, onItemClick: p, testID: m }) {
1898
- let g = a(null), _ = a(0), y = d && f?.[d] ? f[d] : {
1901
+ let h = a(null), _ = a(0), v = d && f?.[d] ? f[d] : {
1899
1902
  left: e,
1900
1903
  right: r
1901
- }, b = y.left, C = y.right, w = a({
1904
+ }, b = v.left, x = v.right, w = a({
1902
1905
  left: b,
1903
- right: C,
1906
+ right: x,
1904
1907
  leftTitle: i,
1905
1908
  rightTitle: o
1906
1909
  });
1907
1910
  w.current = {
1908
1911
  left: b,
1909
- right: C,
1912
+ right: x,
1910
1913
  leftTitle: i,
1911
1914
  rightTitle: o
1912
1915
  };
1913
1916
  let T = a(d);
1914
1917
  T.current = d;
1915
- let O = t((e, t) => {
1918
+ let E = t((e, t) => {
1916
1919
  let n = typeof t == "object" ? t.label ?? e : e, r = e === "left" ? w.current.left : w.current.right;
1917
1920
  p?.(e, n, r?.subentity);
1918
- }, [p]), { hitZonesRef: j, tooltip: M, hoveredRef: P } = D(g, {
1921
+ }, [p]), { hitZonesRef: k, tooltip: M, hoveredRef: N } = O(h, {
1919
1922
  width: ft,
1920
1923
  height: pt,
1921
- onClick: p ? O : void 0
1924
+ onClick: p ? E : void 0
1922
1925
  });
1923
1926
  return n(() => {
1924
- let e = g.current;
1927
+ let e = h.current;
1925
1928
  if (!e) return;
1926
- let t = x(e, ft, pt);
1929
+ let t = S(e, ft, pt);
1927
1930
  _.current = 0;
1928
- let n = ft / 2, r = Math.abs(b.value ?? 0), a = Math.abs(C.value ?? 0), s = Math.max(r, a, 1), c = (b.value - C.value) / (2 * s) * 14, d = Math.max(-14, Math.min(14, c)), f = (e, n, r, i, a) => {
1931
+ let n = ft / 2, r = Math.abs(b.value ?? 0), a = Math.abs(x.value ?? 0), s = Math.max(r, a, 1), c = (b.value - x.value) / (2 * s) * 14, d = Math.max(-14, Math.min(14, c)), f = (e, n, r, i, a) => {
1929
1932
  let o = n - 99 / 2, s = r + 30, c = [
1930
1933
  0,
1931
1934
  0,
@@ -1933,51 +1936,51 @@ function mt({ left: e, right: r, leftTitle: i = "Accepted", rightTitle: o = "Sub
1933
1936
  10
1934
1937
  ];
1935
1938
  t.save(), t.beginPath(), t.roundRect(o, s, 99, i, c), t.clip();
1936
- let l = v(e, .27 * a), d = v(e, 0), f = t.createLinearGradient(o, 0, o + 25, 0);
1939
+ let l = y(e, .27 * a), d = y(e, 0), f = t.createLinearGradient(o, 0, o + 25, 0);
1937
1940
  f.addColorStop(0, l), f.addColorStop(1, d), t.fillStyle = f, t.fillRect(o, s, 25, i);
1938
1941
  let p = t.createLinearGradient(o + 99, 0, o + 99 - 25, 0);
1939
1942
  p.addColorStop(0, l), p.addColorStop(1, d), t.fillStyle = p, t.fillRect(o + 99 - 25, s, 25, i);
1940
1943
  let m = t.createLinearGradient(0, s, 0, s + 25);
1941
1944
  m.addColorStop(0, l), m.addColorStop(1, d), t.fillStyle = m, t.fillRect(o, s, 99, 25);
1942
1945
  let h = t.createLinearGradient(0, s + i, 0, s + i - 25);
1943
- h.addColorStop(0, l), h.addColorStop(1, d), t.fillStyle = h, t.fillRect(o, s + i - 25, 99, 25), t.restore(), t.beginPath(), t.roundRect(o, s, 99, i, c), t.strokeStyle = v(e, 1 * a), t.lineWidth = 1, t.stroke();
1946
+ h.addColorStop(0, l), h.addColorStop(1, d), t.fillStyle = h, t.fillRect(o, s + i - 25, 99, 25), t.restore(), t.beginPath(), t.roundRect(o, s, 99, i, c), t.strokeStyle = y(e, 1 * a), t.lineWidth = 1, t.stroke();
1944
1947
  let g = o + 99 / 2, _ = s - 5;
1945
- t.strokeStyle = v(u.t2, .5 * a), t.lineWidth = 1, t.beginPath(), t.moveTo(n, r + 4), t.lineTo(g, _), t.stroke(), t.beginPath(), t.moveTo(g, _), t.lineTo(g - 10, s), t.stroke(), t.beginPath(), t.moveTo(g, _), t.lineTo(g + 10, s), t.stroke(), t.beginPath(), t.arc(n, r, 3, 0, Math.PI * 2), t.fillStyle = v(u.t2, .7 * a), t.fill();
1948
+ t.strokeStyle = y(u.t2, .5 * a), t.lineWidth = 1, t.beginPath(), t.moveTo(n, r + 4), t.lineTo(g, _), t.stroke(), t.beginPath(), t.moveTo(g, _), t.lineTo(g - 10, s), t.stroke(), t.beginPath(), t.moveTo(g, _), t.lineTo(g + 10, s), t.stroke(), t.beginPath(), t.arc(n, r, 3, 0, Math.PI * 2), t.fillStyle = y(u.t2, .7 * a), t.fill();
1946
1949
  }, p, m = () => {
1947
1950
  _.current++;
1948
1951
  let e = _.current;
1949
- t.clearRect(0, 0, ft, pt), t.letterSpacing = h.letterSpacing, j.current = [];
1950
- let c = A(Math.min(e / 80, 1)), g = d * N(Math.min(e / 80, 1)) * Math.PI / 180, y = {
1951
- x: n - Math.cos(g) * 240,
1952
- y: 100 + Math.sin(-g) * 240
1953
- }, x = {
1954
- x: n + Math.cos(g) * 240,
1955
- y: 100 + Math.sin(g) * 240
1952
+ t.clearRect(0, 0, ft, pt), t.letterSpacing = g.letterSpacing, k.current = [];
1953
+ let c = j(Math.min(e / 80, 1)), h = d * P(Math.min(e / 80, 1)) * Math.PI / 180, v = {
1954
+ x: n - Math.cos(h) * 240,
1955
+ y: 100 + Math.sin(-h) * 240
1956
+ }, S = {
1957
+ x: n + Math.cos(h) * 240,
1958
+ y: 100 + Math.sin(h) * 240
1956
1959
  };
1957
- t.strokeStyle = v(u.t2, .55 * c), t.lineWidth = 1.5, t.beginPath(), t.moveTo(y.x, y.y), t.lineTo(x.x, x.y), t.stroke(), S(t, n, 100, 18, u.t2, .14 * c), t.beginPath(), t.arc(n, 100, 9 * c, 0, Math.PI * 2), t.fillStyle = v(u.t2, .85 * c), t.fill();
1958
- let w = Math.max(20, r / s * 95 * c), E = Math.max(20, a / s * 95 * c), D = T.current === "right" ? .2 : 1, O = T.current === "left" ? .2 : 1;
1959
- f(u.green, y.x, y.y, w, c * D), f(u.amber, x.x, x.y, E, c * O);
1960
- let M = y.y + 30 + w, P = x.y + 30 + E;
1961
- if (k(j.current, "left", y.x - 99 / 2, y.y + 30, 99, w + 90, {
1960
+ t.strokeStyle = y(u.t2, .55 * c), t.lineWidth = 1.5, t.beginPath(), t.moveTo(v.x, v.y), t.lineTo(S.x, S.y), t.stroke(), C(t, n, 100, 18, u.t2, .14 * c), t.beginPath(), t.arc(n, 100, 9 * c, 0, Math.PI * 2), t.fillStyle = y(u.t2, .85 * c), t.fill();
1961
+ let w = Math.max(20, r / s * 95 * c), E = Math.max(20, a / s * 95 * c), D = T.current === "right" ? .6 : 1, O = T.current === "left" ? .6 : 1;
1962
+ f(u.green, v.x, v.y, w, c * D), f(u.amber, S.x, S.y, E, c * O);
1963
+ let M = v.y + 30 + w, N = S.y + 30 + E;
1964
+ if (A(k.current, "left", v.x - 99 / 2, v.y + 30, 99, w + 90, {
1962
1965
  label: i,
1963
1966
  value: b.label,
1964
1967
  sublabel: `${b.count} ${l}`,
1965
1968
  color: u.green
1966
- }, pt, y.x, M + 102), k(j.current, "right", x.x - 99 / 2, x.y + 30, 99, E + 90, {
1969
+ }, pt, v.x, M + 102), A(k.current, "right", S.x - 99 / 2, S.y + 30, 99, E + 90, {
1967
1970
  label: o,
1968
- value: C.label,
1969
- sublabel: `${C.count} ${l}`,
1971
+ value: x.label,
1972
+ sublabel: `${x.count} ${l}`,
1970
1973
  color: u.amber
1971
- }, pt, x.x, P + 102), c > .5) {
1974
+ }, pt, S.x, N + 102), c > .5) {
1972
1975
  let e = Math.min(1, (c - .5) / .5);
1973
1976
  t.textAlign = "center", t.textBaseline = "top";
1974
- let n = y.y + 30 + w + 14, r = x.y + 30 + E + 14;
1975
- t.globalAlpha = e * D, t.font = "700 34px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.t1, t.fillText(b.label, y.x, n), t.font = h.font, t.fillStyle = h.color, t.fillText(`${i} ${b.count} ${l}`, y.x, n + 42), t.globalAlpha = e * O, t.font = "700 34px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.t1, t.fillText(C.label, x.x, r), t.font = h.font, t.fillStyle = h.color, t.fillText(`${o} ${C.count} ${l}`, x.x, r + 42), t.globalAlpha = 1, t.textBaseline = "alphabetic";
1977
+ let n = v.y + 30 + w + 14, r = S.y + 30 + E + 14;
1978
+ t.globalAlpha = e * D, t.font = "700 34px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.t1, t.fillText(b.label, v.x, n), t.font = g.font, t.fillStyle = g.color, t.fillText(`${i} ${b.count} ${l}`, v.x, n + 42), t.globalAlpha = e * O, t.font = "700 34px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.t1, t.fillText(x.label, S.x, r), t.font = g.font, t.fillStyle = g.color, t.fillText(`${o} ${x.count} ${l}`, S.x, r + 42), t.globalAlpha = 1, t.textBaseline = "alphabetic";
1976
1979
  }
1977
1980
  p = requestAnimationFrame(m);
1978
1981
  };
1979
1982
  return m(), () => cancelAnimationFrame(p);
1980
- }, [b, C]), /* @__PURE__ */ c("div", {
1983
+ }, [b, x]), /* @__PURE__ */ c("div", {
1981
1984
  "data-testid": m,
1982
1985
  style: {
1983
1986
  position: "relative",
@@ -1985,7 +1988,7 @@ function mt({ left: e, right: r, leftTitle: i = "Accepted", rightTitle: o = "Sub
1985
1988
  maxWidth: ft
1986
1989
  },
1987
1990
  children: [/* @__PURE__ */ s("canvas", {
1988
- ref: g,
1991
+ ref: h,
1989
1992
  role: "img",
1990
1993
  "aria-label": "Quotation balance — accepted vs submitted quotation value",
1991
1994
  style: {
@@ -1994,7 +1997,7 @@ function mt({ left: e, right: r, leftTitle: i = "Accepted", rightTitle: o = "Sub
1994
1997
  display: "block",
1995
1998
  borderRadius: 8
1996
1999
  }
1997
- }), /* @__PURE__ */ s(E, {
2000
+ }), /* @__PURE__ */ s(D, {
1998
2001
  ...M,
1999
2002
  parentW: ft,
2000
2003
  parentH: pt
@@ -2005,25 +2008,25 @@ function mt({ left: e, right: r, leftTitle: i = "Accepted", rightTitle: o = "Sub
2005
2008
  //#region src/components/areaLineChart/AreaLineChart.tsx
2006
2009
  var ht = 780, gt = 360;
2007
2010
  function _t({ points: e = [], testID: t }) {
2008
- let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: f, hitZonesRef: p } = D(r, {
2011
+ let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: f, hitZonesRef: p } = O(r, {
2009
2012
  width: ht,
2010
2013
  height: gt
2011
2014
  }), m = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
2012
2015
  return n(() => {
2013
2016
  let e = r.current;
2014
2017
  if (!e) return;
2015
- let t = x(e, ht, gt);
2018
+ let t = S(e, ht, gt);
2016
2019
  l.current = 0;
2017
2020
  let n = ht - 64 - 48, i = gt - 48 - 68, a = Math.max(...m.map((e) => e.count), 1), s = m.length, c = s > 1 ? n / (s - 1) : n, f = m.map((e, t) => ({
2018
2021
  x: 64 + t * c,
2019
2022
  y: 48 + i - e.count / a * i,
2020
2023
  point: e
2021
- })), g, _ = () => {
2024
+ })), h, _ = () => {
2022
2025
  l.current++;
2023
2026
  let e = l.current;
2024
- t.clearRect(0, 0, ht, gt), t.letterSpacing = h.letterSpacing;
2025
- let r = A(Math.min(e / 72, 1));
2026
- I(o.current, d.current), p.current = [], [
2027
+ t.clearRect(0, 0, ht, gt), t.letterSpacing = g.letterSpacing;
2028
+ let r = j(Math.min(e / 72, 1));
2029
+ L(o.current, d.current), p.current = [], [
2027
2030
  0,
2028
2031
  .25,
2029
2032
  .5,
@@ -2031,8 +2034,8 @@ function _t({ points: e = [], testID: t }) {
2031
2034
  1
2032
2035
  ].forEach((e) => {
2033
2036
  let r = 48 + i - e * i;
2034
- t.strokeStyle = v(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(64, r), t.lineTo(64 + n, r), t.stroke(), t.setLineDash([]), t.font = h.font, t.fillStyle = h.color, t.textAlign = "right", t.fillText(String(Math.round(a * e)), 58, r + 3);
2035
- }), t.save(), t.translate(12, 48 + i / 2), t.rotate(-Math.PI / 2), t.font = h.font, t.fillStyle = h.color, t.textAlign = "center", t.fillText("Count", 0, 0), t.restore(), t.strokeStyle = v(u.bd, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(64, 48 + i), t.lineTo(64 + n, 48 + i), t.stroke();
2037
+ t.strokeStyle = y(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(64, r), t.lineTo(64 + n, r), t.stroke(), t.setLineDash([]), t.font = g.font, t.fillStyle = g.color, t.textAlign = "right", t.fillText(String(Math.round(a * e)), 58, r + 3);
2038
+ }), t.save(), t.translate(12, 48 + i / 2), t.rotate(-Math.PI / 2), t.font = g.font, t.fillStyle = g.color, t.textAlign = "center", t.fillText("Count", 0, 0), t.restore(), t.strokeStyle = y(u.bd, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(64, 48 + i), t.lineTo(64 + n, 48 + i), t.stroke();
2036
2039
  let c = r * (s - 1), m = Math.floor(c) + 1;
2037
2040
  if (m >= 2) {
2038
2041
  t.beginPath(), t.moveTo(f[0].x, 48 + i), t.lineTo(f[0].x, f[0].y);
@@ -2043,27 +2046,27 @@ function _t({ points: e = [], testID: t }) {
2043
2046
  let e = f[Math.min(m - 1, s - 1)];
2044
2047
  t.lineTo(e.x, 48 + i), t.closePath();
2045
2048
  let n = t.createLinearGradient(0, 48, 0, 48 + i);
2046
- n.addColorStop(0, v(u.teal, .12)), n.addColorStop(1, v(u.teal, .02)), t.fillStyle = n, t.fill();
2049
+ n.addColorStop(0, y(u.teal, .12)), n.addColorStop(1, y(u.teal, .02)), t.fillStyle = n, t.fill();
2047
2050
  }
2048
2051
  t.beginPath();
2049
2052
  for (let e = 0; e < m; e++) {
2050
2053
  let n = c - Math.floor(c), r = e === m - 1 && e > 0 && e === Math.ceil(c), i = e === 0 || e < m - 1 ? f[e].x : f[e - 1].x + (f[e].x - f[e - 1].x) * (r ? n : 1), a = e === 0 || e < m - 1 ? f[e].y : f[e - 1].y + (f[e].y - f[e - 1].y) * (r ? n : 1);
2051
2054
  e === 0 ? t.moveTo(i, a) : t.lineTo(i, a);
2052
2055
  }
2053
- t.strokeStyle = v(u.teal, .85), t.lineWidth = 2, t.stroke(), f.forEach((e, n) => {
2056
+ t.strokeStyle = y(u.teal, .85), t.lineWidth = 2, t.stroke(), f.forEach((e, n) => {
2054
2057
  if (n >= m) return;
2055
2058
  let r = `pt-${n}`, s = o.current.get(r) ?? 0;
2056
- O(p.current, r, e.x, e.y, 10, {
2059
+ k(p.current, r, e.x, e.y, 10, {
2057
2060
  label: e.point.week,
2058
2061
  value: String(e.point.count),
2059
2062
  color: u.teal
2060
- }), s > 0 && T(t, e.x, 48, 48 + i, v(u.teal, .15 * s));
2063
+ }), s > 0 && E(t, e.x, 48, 48 + i, y(u.teal, .15 * s));
2061
2064
  let c = e.point.count === a;
2062
- (s > 0 || c) && S(t, e.x, e.y, 14, u.teal, (c ? .3 : 0) + s * .25), t.beginPath(), t.arc(e.x, e.y, s > 0 ? 5 : 3.5, 0, Math.PI * 2), t.fillStyle = v(u.teal, s > 0 ? 1 : .8), t.fill(), (s > 0 || c) && (t.font = h.font, t.fillStyle = u.teal, t.textAlign = "center", t.fillText(String(e.point.count), e.x, e.y - 10)), t.font = h.font, t.fillStyle = s > 0 ? u.teal : h.color, t.textAlign = "center", t.fillText(e.point.week, e.x, gt - 68 + 14);
2063
- }), g = requestAnimationFrame(_);
2065
+ (s > 0 || c) && C(t, e.x, e.y, 14, u.teal, (c ? .3 : 0) + s * .25), t.beginPath(), t.arc(e.x, e.y, s > 0 ? 5 : 3.5, 0, Math.PI * 2), t.fillStyle = y(u.teal, s > 0 ? 1 : .8), t.fill(), (s > 0 || c) && (t.font = g.font, t.fillStyle = u.teal, t.textAlign = "center", t.fillText(String(e.point.count), e.x, e.y - 10)), t.font = g.font, t.fillStyle = s > 0 ? u.teal : g.color, t.textAlign = "center", t.fillText(e.point.week, e.x, gt - 68 + 14);
2066
+ }), h = requestAnimationFrame(_);
2064
2067
  };
2065
- return _(), () => cancelAnimationFrame(g);
2066
- }, [m]), m.length < 2 ? /* @__PURE__ */ s(W, {
2068
+ return _(), () => cancelAnimationFrame(h);
2069
+ }, [m]), m.length < 2 ? /* @__PURE__ */ s(G, {
2067
2070
  width: ht,
2068
2071
  height: gt,
2069
2072
  testID: t
@@ -2089,7 +2092,7 @@ function _t({ points: e = [], testID: t }) {
2089
2092
  height: gt,
2090
2093
  display: "block"
2091
2094
  }
2092
- }), /* @__PURE__ */ s(E, {
2095
+ }), /* @__PURE__ */ s(D, {
2093
2096
  ...f,
2094
2097
  parentW: ht,
2095
2098
  parentH: gt
@@ -2099,58 +2102,58 @@ function _t({ points: e = [], testID: t }) {
2099
2102
  }
2100
2103
  //#endregion
2101
2104
  //#region src/components/trend/Trend.tsx
2102
- var vt = 680, X = 280, yt = 80, bt = 48, xt = 64, St = h.font, Ct = 12, wt = Math.PI * 2, Tt = 72, Et = 20, Dt = 5e3;
2105
+ var vt = 680, X = 280, yt = 80, bt = 48, xt = 64, St = g.font, Ct = 12, wt = Math.PI * 2, Tt = 72, Et = 20, Dt = 5e3;
2103
2106
  function Ot({ points: e = [], selectedId: t, seriesByEntity: r, colorOffset: o = 0, testID: l }) {
2104
- let d = a(null), f = a(null), p = a(0), g = t && r?.[t] ? r[t] : e, _ = i(() => g.filter((e) => typeof e == "object" && !!e), [g]), y = i(() => {
2107
+ let d = a(null), f = a(null), p = a(0), m = t && r?.[t] ? r[t] : e, _ = i(() => m.filter((e) => typeof e == "object" && !!e), [m]), v = i(() => {
2105
2108
  if (_.length <= 1) return xt;
2106
2109
  let e = document.createElement("canvas").getContext("2d");
2107
2110
  if (!e) return xt;
2108
2111
  e.font = St;
2109
2112
  let t = Math.max(1, Math.ceil(_.length / Et)), n = Math.max(..._.filter((e, n) => n % t === 0).map((t) => e.measureText(t.week).width));
2110
2113
  return Math.max(xt, n + Ct);
2111
- }, [_]), b = Math.round(y / 2), S = bt + b + Math.max(0, _.length - 1) * y, C = Math.max(vt - yt, Math.min(S, Dt)), { tooltip: w, hitZonesRef: T } = D(d, {
2114
+ }, [_]), b = Math.round(v / 2), x = bt + b + Math.max(0, _.length - 1) * v, C = Math.max(vt - yt, Math.min(x, Dt)), { tooltip: w, hitZonesRef: T } = O(d, {
2112
2115
  width: C,
2113
2116
  height: X
2114
2117
  });
2115
2118
  return n(() => {
2116
2119
  let e = d.current;
2117
2120
  if (!e) return;
2118
- let t = x(e, C, X), n = f.current ? x(f.current, yt, X) : null;
2121
+ let t = S(e, C, X), n = f.current ? S(f.current, yt, X) : null;
2119
2122
  p.current = 0;
2120
- let r = m[o % m.length], i = _.length <= Tt ? Tt : Math.max(24, Math.round(Tt * (Tt / _.length))), a = C - bt, s = X - 42 - 54, c = _.length > 0 ? _.map((e) => e.count) : [0], l = Math.min(...c), g = Math.max(...c), S = g - l || 1, w = _.length, E = w > 1 ? (a - b) / (w - 1) : 0, D = Math.max(1, Math.ceil(y / E)), k = l < 0, j = k ? 42 + s - -l / S * s : 42 + s, M = b + (a - b) / 2, N = _.map((e, t) => ({
2123
+ let r = h[o % h.length], i = _.length <= Tt ? Tt : Math.max(24, Math.round(Tt * (Tt / _.length))), a = C - bt, s = X - 42 - 54, c = _.length > 0 ? _.map((e) => e.count) : [0], l = Math.min(...c), m = Math.max(...c), x = m - l || 1, w = _.length, E = w > 1 ? (a - b) / (w - 1) : 0, D = Math.max(1, Math.ceil(v / E)), O = l < 0, A = O ? 42 + s - -l / x * s : 42 + s, M = b + (a - b) / 2, N = _.map((e, t) => ({
2121
2124
  x: w === 1 ? M : b + t * E,
2122
- y: 42 + s - (k ? (e.count - l) / S : e.count / (g || 1)) * s,
2125
+ y: 42 + s - (O ? (e.count - l) / x : e.count / (m || 1)) * s,
2123
2126
  point: e
2124
2127
  }));
2125
2128
  if (n) {
2126
- n.clearRect(0, 0, yt, X), n.letterSpacing = h.letterSpacing;
2127
- let e = k ? [
2129
+ n.clearRect(0, 0, yt, X), n.letterSpacing = g.letterSpacing;
2130
+ let e = O ? [
2128
2131
  l,
2129
- l + S * .25,
2130
- l + S * .5,
2131
- l + S * .75,
2132
- g
2132
+ l + x * .25,
2133
+ l + x * .5,
2134
+ l + x * .75,
2135
+ m
2133
2136
  ] : [
2134
2137
  0,
2135
- g * .25,
2136
- g * .5,
2137
- g * .75,
2138
- g
2138
+ m * .25,
2139
+ m * .5,
2140
+ m * .75,
2141
+ m
2139
2142
  ];
2140
2143
  e.forEach((t, r) => {
2141
2144
  let i = r / (e.length - 1), a = 42 + s - i * s;
2142
- n.font = h.font, n.fillStyle = h.color, n.textAlign = "right", n.fillText(K(t), yt - 6, a + 3);
2143
- }), n.save(), n.translate(12, 42 + s / 2), n.rotate(-Math.PI / 2), n.font = h.font, n.fillStyle = h.color, n.textAlign = "center", n.fillText("Count", 0, 0), n.restore();
2145
+ n.font = g.font, n.fillStyle = g.color, n.textAlign = "right", n.fillText(K(t), yt - 6, a + 3);
2146
+ }), n.save(), n.translate(12, 42 + s / 2), n.rotate(-Math.PI / 2), n.font = g.font, n.fillStyle = g.color, n.textAlign = "center", n.fillText("Count", 0, 0), n.restore();
2144
2147
  }
2145
2148
  let P = t.createLinearGradient(0, 42, 0, 42 + s);
2146
- P.addColorStop(0, v(r, .12)), P.addColorStop(1, v(r, .02));
2149
+ P.addColorStop(0, y(r, .12)), P.addColorStop(1, y(r, .02));
2147
2150
  let F = 0, I, L = (e) => {
2148
- t.font = St, t.fillStyle = h.color, t.textAlign = "center";
2151
+ t.font = St, t.fillStyle = g.color, t.textAlign = "center";
2149
2152
  for (let n = 0; n < e; n++) n % D === 0 && t.fillText(N[n].point.week, N[n].x, X - 54 + 14);
2150
2153
  }, R = () => {
2151
2154
  p.current++;
2152
- let e = Math.min(p.current / i, 1), n = A(e), o = e >= 1;
2153
- t.clearRect(0, 0, C, X), t.letterSpacing = h.letterSpacing, (k ? [
2155
+ let e = Math.min(p.current / i, 1), n = j(e), o = e >= 1;
2156
+ t.clearRect(0, 0, C, X), t.letterSpacing = g.letterSpacing, (O ? [
2154
2157
  0,
2155
2158
  .25,
2156
2159
  .5,
@@ -2163,11 +2166,11 @@ function Ot({ points: e = [], selectedId: t, seriesByEntity: r, colorOffset: o =
2163
2166
  1
2164
2167
  ]).forEach((e) => {
2165
2168
  let n = 42 + s - e * s;
2166
- t.strokeStyle = v(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(0, n), t.lineTo(a, n), t.stroke(), t.setLineDash([]);
2167
- }), t.font = h.font, t.fillStyle = h.color, t.textAlign = "center", t.fillText("Period", b + (a - b) / 2, X - 6), t.strokeStyle = v(u.bd, k ? .5 : .3), t.lineWidth = k ? 2 : 1, t.beginPath(), t.moveTo(b, k ? j : 42 + s), t.lineTo(a, k ? j : 42 + s), t.stroke();
2169
+ t.strokeStyle = y(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(0, n), t.lineTo(a, n), t.stroke(), t.setLineDash([]);
2170
+ }), t.font = g.font, t.fillStyle = g.color, t.textAlign = "center", t.fillText("Period", b + (a - b) / 2, X - 6), t.strokeStyle = y(u.bd, O ? .5 : .3), t.lineWidth = O ? 2 : 1, t.beginPath(), t.moveTo(b, O ? A : 42 + s), t.lineTo(a, O ? A : 42 + s), t.stroke();
2168
2171
  let c = n * (w - 1), l = Math.floor(c) + 1;
2169
2172
  if (l >= 2) {
2170
- let e = k ? j : 42 + s;
2173
+ let e = O ? A : 42 + s;
2171
2174
  t.beginPath(), t.moveTo(N[0].x, e), t.lineTo(N[0].x, N[0].y);
2172
2175
  for (let e = 1; e < l; e++) {
2173
2176
  let n = c - Math.floor(c), r = e === l - 1 && e === Math.ceil(c) && n > 0, i = r ? N[e - 1].x + (N[e].x - N[e - 1].x) * n : N[e].x, a = r ? N[e - 1].y + (N[e].y - N[e - 1].y) * n : N[e].y;
@@ -2180,11 +2183,11 @@ function Ot({ points: e = [], selectedId: t, seriesByEntity: r, colorOffset: o =
2180
2183
  let n = c - Math.floor(c), r = e === l - 1 && e > 0 && e === Math.ceil(c) && n > 0, i = r ? N[e - 1].x + (N[e].x - N[e - 1].x) * n : N[e].x, a = r ? N[e - 1].y + (N[e].y - N[e - 1].y) * n : N[e].y;
2181
2184
  e === 0 ? t.moveTo(i, a) : t.lineTo(i, a);
2182
2185
  }
2183
- t.strokeStyle = v(r, .85), t.lineWidth = 2, t.stroke(), t.fillStyle = v(r, .8), t.beginPath();
2186
+ t.strokeStyle = y(r, .85), t.lineWidth = 2, t.stroke(), t.fillStyle = y(r, .8), t.beginPath();
2184
2187
  for (let e = 0; e < l; e++) t.moveTo(N[e].x + 3.5, N[e].y), t.arc(N[e].x, N[e].y, 3.5, 0, wt);
2185
2188
  if (t.fill(), l > F) {
2186
2189
  T.current = [];
2187
- for (let e = 0; e < l; e++) O(T.current, `pt-${e}`, N[e].x, N[e].y, 10, {
2190
+ for (let e = 0; e < l; e++) k(T.current, `pt-${e}`, N[e].x, N[e].y, 10, {
2188
2191
  label: N[e].point.week,
2189
2192
  value: String(N[e].point.count),
2190
2193
  color: r
@@ -2197,10 +2200,10 @@ function Ot({ points: e = [], selectedId: t, seriesByEntity: r, colorOffset: o =
2197
2200
  }, [
2198
2201
  _,
2199
2202
  C,
2200
- y,
2203
+ v,
2201
2204
  T,
2202
2205
  o
2203
- ]), _.length === 0 ? /* @__PURE__ */ s(W, {
2206
+ ]), _.length === 0 ? /* @__PURE__ */ s(G, {
2204
2207
  width: vt,
2205
2208
  height: X,
2206
2209
  testID: l
@@ -2242,7 +2245,7 @@ function Ot({ points: e = [], selectedId: t, seriesByEntity: r, colorOffset: o =
2242
2245
  height: X,
2243
2246
  display: "block"
2244
2247
  }
2245
- }), /* @__PURE__ */ s(E, {
2248
+ }), /* @__PURE__ */ s(D, {
2246
2249
  ...w,
2247
2250
  parentW: C,
2248
2251
  parentH: X
@@ -2261,57 +2264,57 @@ function Nt(e, t, n) {
2261
2264
  return `${r}…`;
2262
2265
  }
2263
2266
  function Pt({ severities: e = [], colorOffset: r = 0, onItemClick: o, testID: l }) {
2264
- let [d, f] = ee(kt), p = a(null), g = a(/* @__PURE__ */ new Map()), _ = a(0), y = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), b = a(y);
2265
- b.current = y;
2266
- let S = t((e, t) => {
2267
+ let [d, f] = ee(kt), p = a(null), m = a(/* @__PURE__ */ new Map()), _ = a(0), v = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), b = a(v);
2268
+ b.current = v;
2269
+ let x = t((e, t) => {
2267
2270
  let n = typeof t == "object" ? t.label ?? e : e, r = b.current.find((t) => t.severity === e);
2268
2271
  o?.(e, n, r?.subentity);
2269
- }, [o]), { hoveredRef: C, tooltip: w, hitZonesRef: T } = D(p, {
2272
+ }, [o]), { hoveredRef: C, tooltip: w, hitZonesRef: T } = O(p, {
2270
2273
  width: f,
2271
2274
  height: At,
2272
- onClick: o ? S : void 0
2275
+ onClick: o ? x : void 0
2273
2276
  });
2274
2277
  return n(() => {
2275
2278
  let e = p.current;
2276
2279
  if (!e) return;
2277
- let t = x(e, f, At);
2280
+ let t = S(e, f, At);
2278
2281
  _.current = 0;
2279
- let n = y.reduce((e, t) => e + (t.count ?? 0), 0), i = jt, a = jt, o = f - i - a, s = At - 54 - 54, c = o - Math.max(0, y.length - 1) * Mt, l = y.map((e) => (e.count ?? 0) / (n || 1) * c), d = m[r % m.length], b, S = () => {
2282
+ let n = v.reduce((e, t) => e + (t.count ?? 0), 0), i = jt, a = jt, o = f - i - a, s = At - 54 - 54, c = o - Math.max(0, v.length - 1) * Mt, l = v.map((e) => (e.count ?? 0) / (n || 1) * c), d = h[r % h.length], b, x = () => {
2280
2283
  _.current++;
2281
2284
  let e = _.current;
2282
- t.clearRect(0, 0, f, At), t.letterSpacing = h.letterSpacing;
2283
- let r = j(Math.min(e / 60, 1));
2284
- I(g.current, C.current), T.current = [];
2285
+ t.clearRect(0, 0, f, At), t.letterSpacing = g.letterSpacing;
2286
+ let r = M(Math.min(e / 60, 1));
2287
+ L(m.current, C.current), T.current = [];
2285
2288
  let a = i;
2286
- y.forEach((e, i) => {
2287
- let o = l[i] ?? 0, c = g.current.get(e.severity) ?? 0, f = a + o / 2, p = o * .78, m = o * r, _ = p * r, y = f - _ / 2;
2288
- if (m > 0) {
2289
+ v.forEach((e, i) => {
2290
+ let o = l[i] ?? 0, c = m.current.get(e.severity) ?? 0, f = a + o / 2, p = o * .78, h = o * r, _ = p * r, v = f - _ / 2;
2291
+ if (h > 0) {
2289
2292
  let e = () => {
2290
- t.beginPath(), t.moveTo(y, 54), t.lineTo(y + _, 54), t.lineTo(a + m, 54 + s), t.lineTo(a, 54 + s), t.closePath();
2293
+ t.beginPath(), t.moveTo(v, 54), t.lineTo(v + _, 54), t.lineTo(a + h, 54 + s), t.lineTo(a, 54 + s), t.closePath();
2291
2294
  }, n = a + o / 2, i = 54 + s / 2, l = Math.sqrt((o / 2) ** 2 + (s / 2) ** 2), u = t.createRadialGradient(n, i, 0, n, i, l);
2292
- u.addColorStop(0, v(d, (.03 + c * .02) * r)), u.addColorStop(.5, v(d, (.12 + c * .04) * r)), u.addColorStop(1, v(d, (.28 + c * .08) * r)), t.save(), e(), t.clip(), e(), t.fillStyle = u, t.fill(), t.restore(), e(), t.strokeStyle = v(d, .9 * r), t.lineWidth = 1, t.stroke();
2295
+ u.addColorStop(0, y(d, (.03 + c * .02) * r)), u.addColorStop(.5, y(d, (.12 + c * .04) * r)), u.addColorStop(1, y(d, (.28 + c * .08) * r)), t.save(), e(), t.clip(), e(), t.fillStyle = u, t.fill(), t.restore(), e(), t.strokeStyle = y(d, .9 * r), t.lineWidth = 1, t.stroke();
2293
2296
  }
2294
- if (k(T.current, e.severity, a, 54, o, s, {
2297
+ if (A(T.current, e.severity, a, 54, o, s, {
2295
2298
  label: e.severity,
2296
2299
  value: K(e.count ?? 0),
2297
2300
  sublabel: `${Math.round((e.count ?? 0) / (n || 1) * 100)}%`,
2298
2301
  color: d
2299
2302
  }), r > .5) {
2300
2303
  let i = Math.min(1, (r - .5) / .5), l = a + o / 2;
2301
- t.globalAlpha = i, t.font = h.font, t.fillStyle = c > 0 ? d : v(u.t1, .65), t.textAlign = "center", t.fillText(Nt(t, e.severity, o - 8), l, 40), t.font = "600 22px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = v(u.t1, .92 + c * .08), t.fillText(K(e.count ?? 0), l, 54 + s / 2 + 8), t.font = h.font, t.fillStyle = c > 0 ? d : v(u.t1, .5), t.fillText(`${Math.round((e.count ?? 0) / (n || 1) * 100)}%`, l, 54 + s + 22), t.globalAlpha = 1;
2304
+ t.globalAlpha = i, t.font = g.font, t.fillStyle = c > 0 ? d : y(u.t1, .65), t.textAlign = "center", t.fillText(Nt(t, e.severity, o - 8), l, 40), t.font = "600 22px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = y(u.t1, .92 + c * .08), t.fillText(K(e.count ?? 0), l, 54 + s / 2 + 8), t.font = g.font, t.fillStyle = c > 0 ? d : y(u.t1, .5), t.fillText(`${Math.round((e.count ?? 0) / (n || 1) * 100)}%`, l, 54 + s + 22), t.globalAlpha = 1;
2302
2305
  }
2303
2306
  a += o + Mt;
2304
- }), b = requestAnimationFrame(S);
2307
+ }), b = requestAnimationFrame(x);
2305
2308
  };
2306
- return S(), () => cancelAnimationFrame(b);
2309
+ return x(), () => cancelAnimationFrame(b);
2307
2310
  }, [
2308
- y,
2311
+ v,
2309
2312
  f,
2310
2313
  r
2311
- ]), y.length === 0 ? /* @__PURE__ */ s("div", {
2314
+ ]), v.length === 0 ? /* @__PURE__ */ s("div", {
2312
2315
  ref: d,
2313
2316
  style: { width: "100%" },
2314
- children: /* @__PURE__ */ s(W, {
2317
+ children: /* @__PURE__ */ s(G, {
2315
2318
  width: f,
2316
2319
  height: At,
2317
2320
  testID: l
@@ -2333,7 +2336,7 @@ function Pt({ severities: e = [], colorOffset: r = 0, onItemClick: o, testID: l
2333
2336
  height: At,
2334
2337
  display: "block"
2335
2338
  }
2336
- }), /* @__PURE__ */ s(E, {
2339
+ }), /* @__PURE__ */ s(D, {
2337
2340
  ...w,
2338
2341
  parentW: f,
2339
2342
  parentH: At
@@ -2348,33 +2351,33 @@ var Ft = 300, It = 280, Lt = 100, Rt = {
2348
2351
  Closed: u.green
2349
2352
  };
2350
2353
  function zt({ segments: e = [], title: t, unitLabel: r = "", testID: o }) {
2351
- let l = a(null), d = a(0), f = a(/* @__PURE__ */ new Map()), { hoveredRef: p, tooltip: m, hitZonesRef: _ } = D(l, {
2354
+ let l = a(null), d = a(0), f = a(/* @__PURE__ */ new Map()), { hoveredRef: p, tooltip: m, hitZonesRef: h } = O(l, {
2352
2355
  width: Ft,
2353
2356
  height: It
2354
- }), y = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
2357
+ }), v = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
2355
2358
  return n(() => {
2356
2359
  let e = l.current;
2357
2360
  if (!e) return;
2358
- let n = x(e, Ft, It);
2361
+ let n = S(e, Ft, It);
2359
2362
  d.current = 0;
2360
- let i = Ft * .5, a = It * .56, o = Lt, s = y.reduce((e, t) => e + (t.count ?? 0), 0), c = Math.max(...y.map((e) => e.count ?? 0), 1), m, b = () => {
2363
+ let i = Ft * .5, a = It * .56, o = Lt, s = v.reduce((e, t) => e + (t.count ?? 0), 0), c = Math.max(...v.map((e) => e.count ?? 0), 1), m, b = () => {
2361
2364
  d.current++;
2362
2365
  let e = d.current;
2363
- n.clearRect(0, 0, Ft, It), n.letterSpacing = h.letterSpacing, _.current = [], f.current.forEach((e, t) => {
2366
+ n.clearRect(0, 0, Ft, It), n.letterSpacing = g.letterSpacing, h.current = [], f.current.forEach((e, t) => {
2364
2367
  let n = t === p.current ? 1 : 0, r = e + (n - e) * .12;
2365
2368
  Math.abs(r - n) < .005 ? n === 0 ? f.current.delete(t) : f.current.set(t, 1) : f.current.set(t, r);
2366
- }), p.current && !f.current.has(p.current) && f.current.set(p.current, 0), C(n, Ft, It, e, 40, v(u.blue, .04)), y.forEach((t, r) => {
2369
+ }), p.current && !f.current.has(p.current) && f.current.set(p.current, 0), w(n, Ft, It, e, 40, y(u.blue, .04)), v.forEach((t, r) => {
2367
2370
  let s = r / 3 * Math.PI * 2 - Math.PI / 2, l = i + Math.cos(s) * o, d = a + Math.sin(s) * o, f = Rt[t.status] ?? u.blue, p = 2 + t.count / c * 8;
2368
- n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = v(f, .08), n.lineWidth = p * 2, n.stroke(), n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = v(f, .25), n.lineWidth = 1, n.stroke();
2369
- let m = (e * .005 + r * .33) % 1, h = i + (l - i) * m, _ = a + (d - a) * m;
2370
- S(n, h, _, 6, f, .4), n.beginPath(), n.arc(h, _, 2, 0, Math.PI * 2), n.fillStyle = v(f, .8), n.fill();
2371
- let y = (i + l) / 2, b = (a + d) / 2;
2372
- n.font = g.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = v(f, .85), n.fillText(String(t.count), y, b);
2373
- }), y.forEach((e, t) => {
2374
- let l = t / 3 * Math.PI * 2 - Math.PI / 2, d = i + Math.cos(l) * o, p = a + Math.sin(l) * o, m = Rt[e.status] ?? u.blue, g = 10 + e.count / c * 18, y = f.current.get(e.status) ?? 0;
2375
- S(n, d, p, g * 2.5, m, .2 + y * .15);
2376
- let b = n.createRadialGradient(d, p - g * .2, 0, d, p, g);
2377
- b.addColorStop(0, v(m, .8 + y * .2)), b.addColorStop(1, v(m, .4 + y * .1)), n.beginPath(), n.arc(d, p, g, 0, Math.PI * 2), n.fillStyle = b, n.fill(), n.font = "bold " + h.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = v(u.t1, .9), n.fillText(e.status, d, p), O(_.current, e.status, d, p, g + 6, {
2371
+ n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = y(f, .08), n.lineWidth = p * 2, n.stroke(), n.beginPath(), n.moveTo(i, a), n.lineTo(l, d), n.strokeStyle = y(f, .25), n.lineWidth = 1, n.stroke();
2372
+ let m = (e * .005 + r * .33) % 1, h = i + (l - i) * m, g = a + (d - a) * m;
2373
+ C(n, h, g, 6, f, .4), n.beginPath(), n.arc(h, g, 2, 0, Math.PI * 2), n.fillStyle = y(f, .8), n.fill();
2374
+ let v = (i + l) / 2, b = (a + d) / 2;
2375
+ n.font = _.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = y(f, .85), n.fillText(String(t.count), v, b);
2376
+ }), v.forEach((e, t) => {
2377
+ let l = t / 3 * Math.PI * 2 - Math.PI / 2, d = i + Math.cos(l) * o, p = a + Math.sin(l) * o, m = Rt[e.status] ?? u.blue, _ = 10 + e.count / c * 18, v = f.current.get(e.status) ?? 0;
2378
+ C(n, d, p, _ * 2.5, m, .2 + v * .15);
2379
+ let b = n.createRadialGradient(d, p - _ * .2, 0, d, p, _);
2380
+ b.addColorStop(0, y(m, .8 + v * .2)), b.addColorStop(1, y(m, .4 + v * .1)), n.beginPath(), n.arc(d, p, _, 0, Math.PI * 2), n.fillStyle = b, n.fill(), n.font = "bold " + g.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = y(u.t1, .9), n.fillText(e.status, d, p), k(h.current, e.status, d, p, _ + 6, {
2378
2381
  label: e.status,
2379
2382
  value: r ? `${e.count} ${r}` : String(e.count),
2380
2383
  sublabel: `${Math.round((e.count ?? 0) / (s || 1) * 100)}%`,
@@ -2382,20 +2385,20 @@ function zt({ segments: e = [], title: t, unitLabel: r = "", testID: o }) {
2382
2385
  });
2383
2386
  });
2384
2387
  let l = f.current.get("center") ?? 0;
2385
- S(n, i, a, 36, u.t2, .2 + l * .15);
2388
+ C(n, i, a, 36, u.t2, .2 + l * .15);
2386
2389
  let x = n.createRadialGradient(i, a - 4, 0, i, a, 22);
2387
- x.addColorStop(0, v(u.t2, .9)), x.addColorStop(1, v(u.t2, .5)), n.beginPath(), n.arc(i, a, 22, 0, Math.PI * 2), n.fillStyle = x, n.fill(), n.font = g.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = v(u.t1, .9), n.fillText(t ?? "", i, a - 4), n.font = "bold " + h.font, n.fillStyle = u.t1, n.fillText(String(s), i, a + 8), O(_.current, "center", i, a, 28, {
2390
+ x.addColorStop(0, y(u.t2, .9)), x.addColorStop(1, y(u.t2, .5)), n.beginPath(), n.arc(i, a, 22, 0, Math.PI * 2), n.fillStyle = x, n.fill(), n.font = _.font, n.textAlign = "center", n.textBaseline = "middle", n.fillStyle = y(u.t1, .9), n.fillText(t ?? "", i, a - 4), n.font = "bold " + g.font, n.fillStyle = u.t1, n.fillText(String(s), i, a + 8), k(h.current, "center", i, a, 28, {
2388
2391
  label: t ?? "Total",
2389
2392
  value: r ? `${s} ${r}` : String(s),
2390
2393
  color: u.t2
2391
- }), w(n, Ft, It, e, .015), m = requestAnimationFrame(b);
2394
+ }), T(n, Ft, It, e, .015), m = requestAnimationFrame(b);
2392
2395
  };
2393
2396
  return b(), () => cancelAnimationFrame(m);
2394
2397
  }, [
2395
- y,
2398
+ v,
2396
2399
  t,
2397
2400
  r
2398
- ]), y.length === 0 ? /* @__PURE__ */ s(W, {
2401
+ ]), v.length === 0 ? /* @__PURE__ */ s(G, {
2399
2402
  width: Ft,
2400
2403
  height: It,
2401
2404
  testID: o
@@ -2416,7 +2419,7 @@ function zt({ segments: e = [], title: t, unitLabel: r = "", testID: o }) {
2416
2419
  display: "block",
2417
2420
  borderRadius: 8
2418
2421
  }
2419
- }), /* @__PURE__ */ s(E, {
2422
+ }), /* @__PURE__ */ s(D, {
2420
2423
  ...m,
2421
2424
  parentW: Ft,
2422
2425
  parentH: It
@@ -2433,14 +2436,14 @@ function Ht({ points: e = [], className: t, colors: r }) {
2433
2436
  label: e,
2434
2437
  value: n ? Number(n[0]) : 0
2435
2438
  };
2436
- }), [e]), { mouseRef: m, hoveredRef: h, tooltip: g, hitZonesRef: _ } = D(o, {
2439
+ }), [e]), { mouseRef: m, hoveredRef: h, tooltip: g, hitZonesRef: _ } = O(o, {
2437
2440
  width: Bt,
2438
2441
  height: Vt
2439
2442
  });
2440
2443
  return n(() => {
2441
2444
  let e = o.current;
2442
2445
  if (!e) return;
2443
- let t = x(e, Bt, Vt);
2446
+ let t = S(e, Bt, Vt);
2444
2447
  f.current = 0;
2445
2448
  let n = r?.line ?? u.teal, i = r?.point ?? u.teal, a = r?.axisLine ?? u.bd, s, c = () => {
2446
2449
  f.current++;
@@ -2454,35 +2457,35 @@ function Ht({ points: e = [], className: t, colors: r }) {
2454
2457
  right: 12,
2455
2458
  top: 16,
2456
2459
  bottom: 20
2457
- }, o = Bt - r.left - r.right, l = Vt - r.top - r.bottom, g = p.map((e) => e.value), y = Math.min(...g), b = Math.max(...g) - y || 1, x = (e) => r.left + e / (p.length - 1) * o, C = (e) => r.top + (1 - (e - y) / b) * l, w = 1 - (1 - Math.min(e / 48, 1)) ** 3, E = Math.max(2, Math.floor(w * p.length));
2458
- if (I(d.current, h.current), _.current = [], t.strokeStyle = v(a, .3), t.lineWidth = .5, t.setLineDash([]), t.beginPath(), t.moveTo(r.left, Vt - r.bottom), t.lineTo(Bt - r.right, Vt - r.bottom), t.stroke(), t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = v(u.t4, .9), t.textAlign = "center", p.forEach((e, n) => {
2460
+ }, o = Bt - r.left - r.right, l = Vt - r.top - r.bottom, g = p.map((e) => e.value), v = Math.min(...g), b = Math.max(...g) - v || 1, x = (e) => r.left + e / (p.length - 1) * o, S = (e) => r.top + (1 - (e - v) / b) * l, w = 1 - (1 - Math.min(e / 48, 1)) ** 3, T = Math.max(2, Math.floor(w * p.length));
2461
+ if (L(d.current, h.current), _.current = [], t.strokeStyle = y(a, .3), t.lineWidth = .5, t.setLineDash([]), t.beginPath(), t.moveTo(r.left, Vt - r.bottom), t.lineTo(Bt - r.right, Vt - r.bottom), t.stroke(), t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = y(u.t4, .9), t.textAlign = "center", p.forEach((e, n) => {
2459
2462
  t.fillText(e.label.replace("Day ", "D"), x(n), Vt - 4);
2460
2463
  }), m.current.over && h.current) {
2461
2464
  let e = parseInt(h.current.split("-")[1]);
2462
- isNaN(e) || T(t, x(e), r.top, r.top + l);
2465
+ isNaN(e) || E(t, x(e), r.top, r.top + l);
2463
2466
  }
2464
- if (E > 1) {
2467
+ if (T > 1) {
2465
2468
  let e = t.createLinearGradient(0, r.top, 0, r.top + l);
2466
- e.addColorStop(0, v(n, .15)), e.addColorStop(1, v(n, 0)), t.fillStyle = e, t.beginPath(), t.moveTo(x(0), r.top + l);
2467
- for (let e = 0; e < E; e++) t.lineTo(x(e), C(p[e].value));
2468
- t.lineTo(x(E - 1), r.top + l), t.closePath(), t.fill(), t.strokeStyle = v(n, .8), t.lineWidth = 1.5, t.setLineDash([]), t.beginPath();
2469
- for (let e = 0; e < E; e++) {
2470
- let n = x(e), r = C(p[e].value);
2469
+ e.addColorStop(0, y(n, .15)), e.addColorStop(1, y(n, 0)), t.fillStyle = e, t.beginPath(), t.moveTo(x(0), r.top + l);
2470
+ for (let e = 0; e < T; e++) t.lineTo(x(e), S(p[e].value));
2471
+ t.lineTo(x(T - 1), r.top + l), t.closePath(), t.fill(), t.strokeStyle = y(n, .8), t.lineWidth = 1.5, t.setLineDash([]), t.beginPath();
2472
+ for (let e = 0; e < T; e++) {
2473
+ let n = x(e), r = S(p[e].value);
2471
2474
  e === 0 ? t.moveTo(n, r) : t.lineTo(n, r);
2472
2475
  }
2473
2476
  t.stroke();
2474
2477
  }
2475
- for (let e = 0; e < E; e++) {
2476
- let n = x(e), r = C(p[e].value), a = `tp-${e}`, o = d.current.get(a) ?? 0, s = e === p.length - 1;
2477
- O(_.current, a, n, r, 10, {
2478
+ for (let e = 0; e < T; e++) {
2479
+ let n = x(e), r = S(p[e].value), a = `tp-${e}`, o = d.current.get(a) ?? 0, s = e === p.length - 1;
2480
+ k(_.current, a, n, r, 10, {
2478
2481
  label: p[e].label,
2479
2482
  value: String(p[e].value),
2480
2483
  color: s ? u.red : i
2481
- }), o > 0 && !s && (S(t, n, r, 12 * o, i, .2 * o), t.fillStyle = v(i, .8), t.beginPath(), t.arc(n, r, 3 + o * 2, 0, Math.PI * 2), t.fill());
2484
+ }), o > 0 && !s && (C(t, n, r, 12 * o, i, .2 * o), t.fillStyle = y(i, .8), t.beginPath(), t.arc(n, r, 3 + o * 2, 0, Math.PI * 2), t.fill());
2482
2485
  }
2483
- if (E >= p.length) {
2484
- let n = p.length - 1, r = x(n), i = C(p[n].value), a = d.current.get(`tp-${n}`) ?? 0, o = P(e, .05, 5e-4), s = 1 + a * .5;
2485
- t.shadowColor = v(u.red, .5), t.shadowBlur = (8 + o * 4) * s, t.fillStyle = u.red, t.beginPath(), t.arc(r, i, (3.5 + o * 1.5) * s, 0, Math.PI * 2), t.fill(), t.shadowBlur = 0;
2486
+ if (T >= p.length) {
2487
+ let n = p.length - 1, r = x(n), i = S(p[n].value), a = d.current.get(`tp-${n}`) ?? 0, o = F(e, .05, 5e-4), s = 1 + a * .5;
2488
+ t.shadowColor = y(u.red, .5), t.shadowBlur = (8 + o * 4) * s, t.fillStyle = u.red, t.beginPath(), t.arc(r, i, (3.5 + o * 1.5) * s, 0, Math.PI * 2), t.fill(), t.shadowBlur = 0;
2486
2489
  }
2487
2490
  s = requestAnimationFrame(c);
2488
2491
  };
@@ -2505,7 +2508,7 @@ function Ht({ points: e = [], className: t, colors: r }) {
2505
2508
  display: "block",
2506
2509
  borderRadius: 8
2507
2510
  }
2508
- }), /* @__PURE__ */ s(E, {
2511
+ }), /* @__PURE__ */ s(D, {
2509
2512
  ...g,
2510
2513
  parentW: Bt,
2511
2514
  parentH: Vt
@@ -2521,82 +2524,82 @@ function Ut(e, t, n) {
2521
2524
  for (; r.length > 0 && e.measureText(r + "…").width > n;) r = r.slice(0, -1);
2522
2525
  return r + "…";
2523
2526
  }
2524
- var Wt = 680, Gt = 8, Z = 6, Kt = 8, qt = Z * 2 + Kt, Jt = 36, Yt = Jt / 2, Xt = 48;
2525
- function Zt({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, labelA: f = "Implemented", labelB: p = "Unimplemented", unit: m = "variations", testID: y }) {
2526
- let [b, C] = ee(Wt), w = a(null), T = a(/* @__PURE__ */ new Map()), O = a(0), A = a(d);
2527
- A.current = d;
2528
- let M = a([]), N = t((e, t) => {
2529
- let n = e.replace(/-impl$|-un$/, ""), r = typeof t == "object" ? t.label ?? n : n, i = M.current.find((e) => e.id === n);
2527
+ var Wt = 680, Gt = 8, Z = 4, Kt = 8, qt = Z * 2 + Kt, Jt = 36, Yt = Jt / 2, Xt = 48;
2528
+ function Zt({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, labelA: f = "Implemented", labelB: p = "Unimplemented", unit: m = "variations", testID: h }) {
2529
+ let [b, x] = ee(Wt), w = a(null), T = a(/* @__PURE__ */ new Map()), E = a(0), k = a(d);
2530
+ k.current = d;
2531
+ let j = a([]), N = t((e, t) => {
2532
+ let n = e.replace(/-impl$|-un$/, ""), r = typeof t == "object" ? t.label ?? n : n, i = j.current.find((e) => e.id === n);
2530
2533
  l?.(n, r, i?.subentity);
2531
- }, [l]), [P, L] = o(!1), R = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), z = !!(d && r?.[d]), B = z ? r[d] : e, V = i(() => B.filter((e) => typeof e == "object" && !!e), [B]), H = i(() => P ? V : V.slice(0, Gt), [V, P]);
2532
- M.current = H;
2533
- let U = Yt + Xt + H.length * (qt + Jt) - Jt, { hoveredRef: G, tooltip: ne, hitZonesRef: q } = D(w, {
2534
- width: C,
2534
+ }, [l]), [P, F] = o(!1), R = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), z = !!(d && r?.[d]), B = z ? r[d] : e, V = i(() => B.filter((e) => typeof e == "object" && !!e), [B]), H = i(() => P ? V : V.slice(0, Gt), [V, P]);
2535
+ j.current = H;
2536
+ let U = Yt + Xt + H.length * (qt + Jt) - Jt, { hoveredRef: W, tooltip: ne, hitZonesRef: re } = O(w, {
2537
+ width: x,
2535
2538
  height: U,
2536
2539
  onClick: l ? N : void 0
2537
2540
  });
2538
2541
  return n(() => {
2539
2542
  let e = w.current;
2540
2543
  if (!e) return;
2541
- let t = x(e, C, U);
2542
- O.current = 0, t.font = h.font;
2544
+ let t = S(e, x, U);
2545
+ E.current = 0, t.font = g.font;
2543
2546
  let n = H.reduce((e, n) => Math.max(e, t.measureText(n.abbreviation ?? n.name ?? "").width), 0);
2544
- t.font = g.font;
2545
- let r = H.reduce((e, n) => Math.max(e, t.measureText(K(n.implemented ?? 0)).width, t.measureText(K(n.unimplemented ?? 0)).width), 0), i = Math.max(Math.min(n + 20, C * .3), 40), a = Math.max(r + 24, 32), o = C - i - a, s = Math.max(...H.map((e) => e.implemented ?? 0), ...H.map((e) => e.unimplemented ?? 0), 1), c = H.length * (qt + Jt) - Jt, l = Yt + (U - Yt - Xt - c) / 2, d, y = () => {
2546
- O.current++;
2547
- let e = O.current;
2548
- t.clearRect(0, 0, C, U);
2549
- let n = j(Math.min(e / 60, 1));
2550
- I(T.current, G.current), q.current = [], H.forEach((e, r) => {
2551
- let a = F(n, r, H.length, j), c = l + r * (qt + Jt), d = c, _ = c + Z + Kt, y = `${e.id}-impl`, b = `${e.id}-un`, x = T.current.get(y) ?? 0, C = T.current.get(b) ?? 0, w = !z && A.current && e.id !== A.current ? .2 : 1, E = (e.implemented ?? 0) / s * o * a, D = (e.unimplemented ?? 0) / s * o * a;
2552
- if (t.font = h.font, t.fillStyle = x > 0 || C > 0 ? u.t1 : u.t2, t.textAlign = "right", t.textBaseline = "middle", t.fillText(Ut(t, e.abbreviation ?? e.name ?? "", i - 16), i - 8, c + qt / 2), t.textBaseline = "alphabetic", k(q.current, y, 0, c, i, qt, {
2547
+ t.font = _.font;
2548
+ let r = H.reduce((e, n) => Math.max(e, t.measureText(K(n.implemented ?? 0)).width, t.measureText(K(n.unimplemented ?? 0)).width), 0), i = Math.max(Math.min(n + 20, x * .3), 40), a = Math.max(r + 24, 32), o = x - i - a, s = Math.max(...H.map((e) => e.implemented ?? 0), ...H.map((e) => e.unimplemented ?? 0), 1), c = H.length * (qt + Jt) - Jt, l = Yt + (U - Yt - Xt - c) / 2, d, h = () => {
2549
+ E.current++;
2550
+ let e = E.current;
2551
+ t.clearRect(0, 0, x, U);
2552
+ let n = M(Math.min(e / 60, 1));
2553
+ L(T.current, W.current), re.current = [], H.forEach((e, a) => {
2554
+ let c = I(n, a, H.length, M), d = l + a * (qt + Jt), h = d, v = d + Z + Kt, b = `${e.id}-impl`, x = `${e.id}-un`, S = T.current.get(b) ?? 0, w = T.current.get(x) ?? 0, E = !z && k.current && e.id !== k.current ? .6 : 1, D = (e.implemented ?? 0) / s * o * c, O = (e.unimplemented ?? 0) / s * o * c;
2555
+ if (t.font = g.font, t.fillStyle = S > 0 || w > 0 ? u.t1 : u.t2, t.textAlign = "right", t.textBaseline = "middle", t.fillText(Ut(t, e.abbreviation ?? e.name ?? "", i - 16), i - 8, d + qt / 2), t.textBaseline = "alphabetic", A(re.current, b, 0, d, i, qt, {
2553
2556
  label: e.name ?? e.abbreviation ?? "",
2554
2557
  value: `${K((e.implemented ?? 0) + (e.unimplemented ?? 0))} total ${m}`,
2555
2558
  sublabel: `${f}: ${K(e.implemented ?? 0)} · ${p}: ${K(e.unimplemented ?? 0)}`,
2556
2559
  color: u.green
2557
- }), E > 0) {
2558
- x > 0 && S(t, i + E / 2, d + Z / 2, E * .15, u.green, .18 * x);
2559
- let e = t.createLinearGradient(i, 0, i + E, 0);
2560
- e.addColorStop(0, v(u.green, .7 * w)), e.addColorStop(1, v(u.green, 1 * w)), t.fillStyle = e, t.beginPath(), t.roundRect(i, d, E, Z, Z / 2), t.fill();
2560
+ }, void 0, i + Math.max(D, O) + 16 + r + 14), D > 0) {
2561
+ S > 0 && C(t, i + D / 2, h + Z / 2, D * .15, u.green, .18 * S);
2562
+ let e = t.createLinearGradient(i, 0, i + D, 0);
2563
+ e.addColorStop(0, y(u.green, .7 * E)), e.addColorStop(1, y(u.green, 1 * E)), t.fillStyle = e, t.beginPath(), t.roundRect(i, h, D, Z, Z / 2), t.fill();
2561
2564
  }
2562
- if (k(q.current, y, i, d, Math.max(E, 1), Z, {
2565
+ if (A(re.current, b, i, h, Math.max(D, 1), Z, {
2563
2566
  label: e.name,
2564
2567
  value: K(e.implemented ?? 0),
2565
2568
  color: u.green
2566
- }), a > .4 && (t.globalAlpha = Math.min(1, (a - .4) / .4), t.font = g.font, t.fillStyle = u.t1, t.textAlign = "left", t.textBaseline = "middle", t.fillText(K(e.implemented ?? 0), i + E + 16, d + Z / 2), t.globalAlpha = 1, t.textBaseline = "alphabetic"), D > 0) {
2567
- C > 0 && S(t, i + D / 2, _ + Z / 2, D * .15, u.amber, .18 * C);
2568
- let e = t.createLinearGradient(i, 0, i + D, 0);
2569
- e.addColorStop(0, v(u.amber, .5 * w)), e.addColorStop(1, v(u.amber, .9 * w)), t.fillStyle = e, t.beginPath(), t.roundRect(i, _, D, Z, Z / 2), t.fill();
2569
+ }, d + qt / 2, i + Math.max(D, O) + 16 + r + 14), c > .4 && (t.globalAlpha = Math.min(1, (c - .4) / .4), t.font = _.font, t.fillStyle = u.t1, t.textAlign = "left", t.textBaseline = "middle", t.fillText(K(e.implemented ?? 0), i + D + 16, h + Z / 2), t.globalAlpha = 1, t.textBaseline = "alphabetic"), O > 0) {
2570
+ w > 0 && C(t, i + O / 2, v + Z / 2, O * .15, u.amber, .18 * w);
2571
+ let e = t.createLinearGradient(i, 0, i + O, 0);
2572
+ e.addColorStop(0, y(u.amber, .5 * E)), e.addColorStop(1, y(u.amber, .9 * E)), t.fillStyle = e, t.beginPath(), t.roundRect(i, v, O, Z, Z / 2), t.fill();
2570
2573
  }
2571
- k(q.current, b, i, _, Math.max(D, 1), Z, {
2574
+ A(re.current, x, i, v, Math.max(O, 1), Z, {
2572
2575
  label: e.name,
2573
2576
  value: K(e.unimplemented ?? 0),
2574
2577
  color: u.amber
2575
- }), a > .4 && (t.globalAlpha = Math.min(1, (a - .4) / .4), t.font = g.font, t.fillStyle = u.t1, t.textAlign = "left", t.textBaseline = "middle", t.fillText(K(e.unimplemented ?? 0), i + D + 16, _ + Z / 2), t.globalAlpha = 1, t.textBaseline = "alphabetic");
2578
+ }, d + qt / 2, i + Math.max(D, O) + 16 + r + 14), c > .4 && (t.globalAlpha = Math.min(1, (c - .4) / .4), t.font = _.font, t.fillStyle = u.t1, t.textAlign = "left", t.textBaseline = "middle", t.fillText(K(e.unimplemented ?? 0), i + O + 16, v + Z / 2), t.globalAlpha = 1, t.textBaseline = "alphabetic");
2576
2579
  });
2577
- let r = l + c + 28;
2578
- t.font = _.font, t.textBaseline = "middle", t.textAlign = "left";
2579
- let a = t.measureText(f).width, b = t.measureText(p).width, x = 18 + a, w = 18 + b, E = (C - (x + 24 + w)) / 2, D = t.createLinearGradient(E, 0, E + 12, 0);
2580
- D.addColorStop(0, v(u.green, .7)), D.addColorStop(1, v(u.green, 1)), t.fillStyle = D, t.beginPath(), t.rect(E, r - 6, 12, 12), t.fill(), t.fillStyle = _.color, t.fillText(f, E + 12 + 6, r);
2581
- let M = E + x + 24, N = t.createLinearGradient(M, 0, M + 12, 0);
2582
- N.addColorStop(0, v(u.amber, .5)), N.addColorStop(1, v(u.amber, .9)), t.fillStyle = N, t.beginPath(), t.rect(M, r - 6, 12, 12), t.fill(), t.fillStyle = _.color, t.fillText(p, M + 12 + 6, r), t.textBaseline = "alphabetic", d = requestAnimationFrame(y);
2580
+ let a = l + c + 28;
2581
+ t.font = v.font, t.textBaseline = "middle", t.textAlign = "left";
2582
+ let b = t.measureText(f).width, S = t.measureText(p).width, w = 18 + b, D = 18 + S, O = (x - (w + 24 + D)) / 2, j = t.createLinearGradient(O, 0, O + 12, 0);
2583
+ j.addColorStop(0, y(u.green, .7)), j.addColorStop(1, y(u.green, 1)), t.fillStyle = j, t.beginPath(), t.rect(O, a - 6, 12, 12), t.fill(), t.fillStyle = v.color, t.fillText(f, O + 12 + 6, a);
2584
+ let N = O + w + 24, P = t.createLinearGradient(N, 0, N + 12, 0);
2585
+ P.addColorStop(0, y(u.amber, .5)), P.addColorStop(1, y(u.amber, .9)), t.fillStyle = P, t.beginPath(), t.rect(N, a - 6, 12, 12), t.fill(), t.fillStyle = v.color, t.fillText(p, N + 12 + 6, a), t.textBaseline = "alphabetic", d = requestAnimationFrame(h);
2583
2586
  };
2584
- return y(), () => cancelAnimationFrame(d);
2587
+ return h(), () => cancelAnimationFrame(d);
2585
2588
  }, [
2586
2589
  H,
2587
2590
  U,
2588
- C
2591
+ x
2589
2592
  ]), R.length === 0 ? /* @__PURE__ */ s("div", {
2590
2593
  ref: b,
2591
2594
  style: { width: "100%" },
2592
- children: /* @__PURE__ */ s(W, {
2593
- width: C,
2595
+ children: /* @__PURE__ */ s(G, {
2596
+ width: x,
2594
2597
  height: 160,
2595
- testID: y
2598
+ testID: h
2596
2599
  })
2597
2600
  }) : /* @__PURE__ */ c("div", {
2598
2601
  ref: b,
2599
- "data-testid": y,
2602
+ "data-testid": h,
2600
2603
  style: { width: "100%" },
2601
2604
  children: [/* @__PURE__ */ c("div", {
2602
2605
  style: {
@@ -2612,16 +2615,16 @@ function Zt({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, la
2612
2615
  height: U,
2613
2616
  display: "block"
2614
2617
  }
2615
- }), /* @__PURE__ */ s(E, {
2618
+ }), /* @__PURE__ */ s(D, {
2616
2619
  ...ne,
2617
- parentW: C,
2620
+ parentW: x,
2618
2621
  parentH: U
2619
2622
  })]
2620
2623
  }), R.length > Gt && /* @__PURE__ */ s("div", {
2621
2624
  style: { marginTop: 8 },
2622
2625
  children: /* @__PURE__ */ s(te, {
2623
2626
  expanded: P,
2624
- onToggle: () => L((e) => !e)
2627
+ onToggle: () => F((e) => !e)
2625
2628
  })
2626
2629
  })]
2627
2630
  });
@@ -2630,23 +2633,23 @@ function Zt({ items: e = [], itemsByEntity: r, onItemClick: l, selectedId: d, la
2630
2633
  //#region src/components/weeklyFlow/WeeklyFlow.tsx
2631
2634
  var Qt = 800, $t = 360;
2632
2635
  function en({ items: e = [], onItemClick: r, testID: i }) {
2633
- let [o, l] = ee(Qt), d = a(null), f = a(/* @__PURE__ */ new Map()), m = a(0), _ = a(e);
2634
- _.current = e;
2635
- let y = t((e, t) => {
2636
- let n = typeof t == "object" ? t.label ?? e : e, i = _.current.find((t) => t.id === e);
2636
+ let [o, l] = ee(Qt), d = a(null), f = a(/* @__PURE__ */ new Map()), m = a(0), h = a(e);
2637
+ h.current = e;
2638
+ let v = t((e, t) => {
2639
+ let n = typeof t == "object" ? t.label ?? e : e, i = h.current.find((t) => t.id === e);
2637
2640
  r?.(e, n, i?.subentity);
2638
- }, [r]), { hoveredRef: b, tooltip: C, hitZonesRef: w } = D(d, {
2641
+ }, [r]), { hoveredRef: b, tooltip: x, hitZonesRef: w } = O(d, {
2639
2642
  width: l,
2640
2643
  height: $t,
2641
- onClick: r ? y : void 0
2644
+ onClick: r ? v : void 0
2642
2645
  });
2643
2646
  return n(() => {
2644
2647
  let t = d.current;
2645
2648
  if (!t) return;
2646
- let n = x(t, l, $t);
2649
+ let n = S(t, l, $t);
2647
2650
  m.current = 0;
2648
- let r = Math.round(l * .125), i = Math.round(l * .525), a = Math.round(l * .9), o = Math.max(60, Math.round(l * .1375)), s = e.reduce((e, t) => e + (t.base ?? 0), 0), c = e.reduce((e, t) => e + (t.variation ?? 0), 0), _ = e.reduce((e, t) => e + (t.total ?? 0), 0), y = $t - 20 - 26, C = y - 6 * (e.length - 1), T = 20, E = e.map((e, t) => {
2649
- let n = Math.max(24, (e.total ?? 0) / (_ || 1) * C), i = {
2651
+ let r = Math.round(l * .125), i = Math.round(l * .525), a = Math.round(l * .9), o = Math.max(60, Math.round(l * .1375)), s = e.reduce((e, t) => e + (t.base ?? 0), 0), c = e.reduce((e, t) => e + (t.variation ?? 0), 0), h = e.reduce((e, t) => e + (t.total ?? 0), 0), v = $t - 20 - 26, x = v - 6 * (e.length - 1), T = 20, E = e.map((e, t) => {
2652
+ let n = Math.max(24, (e.total ?? 0) / (h || 1) * x), i = {
2650
2653
  x: r - o / 2,
2651
2654
  y: T,
2652
2655
  h: n,
@@ -2655,7 +2658,7 @@ function en({ items: e = [], onItemClick: r, testID: i }) {
2655
2658
  color: p[t % p.length]
2656
2659
  };
2657
2660
  return T += n + 6, i;
2658
- }), D = C - 14, O = Math.max(28, s / (_ || 1) * D), j = Math.max(18, c / (_ || 1) * D), M = 20 + (y - (O + j + 14)) / 2, N = {
2661
+ }), D = x - 14, O = Math.max(28, s / (h || 1) * D), k = Math.max(18, c / (h || 1) * D), M = 20 + (v - (O + k + 14)) / 2, N = {
2659
2662
  x: i - o / 2,
2660
2663
  y: M,
2661
2664
  h: O,
@@ -2663,26 +2666,26 @@ function en({ items: e = [], onItemClick: r, testID: i }) {
2663
2666
  }, P = {
2664
2667
  x: i - o / 2,
2665
2668
  y: M + O + 14,
2666
- h: j,
2667
- cy: M + O + 14 + j / 2
2668
- }, L = {
2669
+ h: k,
2670
+ cy: M + O + 14 + k / 2
2671
+ }, F = {
2669
2672
  x: a - o / 2,
2670
2673
  y: 20,
2671
- h: y,
2672
- cy: 20 + y / 2
2674
+ h: v,
2675
+ cy: 20 + v / 2
2673
2676
  }, R, z = () => {
2674
2677
  m.current++;
2675
2678
  let t = m.current;
2676
- n.clearRect(0, 0, l, $t), n.letterSpacing = h.letterSpacing;
2677
- let d = A(Math.min(t / 80, 1));
2678
- if (I(f.current, b.current), w.current = [], e.forEach((t, r) => {
2679
- let a = E[r], l = F(d, r, e.length, A), u = f.current.get(t.id) ?? 0;
2679
+ n.clearRect(0, 0, l, $t), n.letterSpacing = g.letterSpacing;
2680
+ let d = j(Math.min(t / 80, 1));
2681
+ if (L(f.current, b.current), w.current = [], e.forEach((t, r) => {
2682
+ let a = E[r], l = I(d, r, e.length, j), u = f.current.get(t.id) ?? 0;
2680
2683
  if (l < .01) return;
2681
- let p = (t.base ?? 0) / (t.total || 1), m = (t.variation ?? 0) / (t.total || 1), h = a.h * p, g = a.h * m, _ = a.y + h / 2, v = a.y + h + g / 2, y = Math.max(2, (t.base ?? 0) / s * O), b = Math.max(2, (t.variation ?? 0) / c * j), x = N.y + e.slice(0, r).reduce((e, t) => e + (t.base ?? 0) / s * O, 0) + y / 2, S = P.y + e.slice(0, r).reduce((e, t) => e + (t.variation ?? 0) / c * j, 0) + b / 2, C = u * .2 + .18;
2684
+ let p = (t.base ?? 0) / (t.total || 1), m = (t.variation ?? 0) / (t.total || 1), h = a.h * p, g = a.h * m, _ = a.y + h / 2, v = a.y + h + g / 2, y = Math.max(2, (t.base ?? 0) / s * O), b = Math.max(2, (t.variation ?? 0) / c * k), x = N.y + e.slice(0, r).reduce((e, t) => e + (t.base ?? 0) / s * O, 0) + y / 2, S = P.y + e.slice(0, r).reduce((e, t) => e + (t.variation ?? 0) / c * k, 0) + b / 2, C = u * .2 + .18;
2682
2685
  tn(n, a.x + o, _, i - o / 2, x, y * l, a.color, C), tn(n, a.x + o, v, i - o / 2, S, b * l, a.color, C * .75);
2683
2686
  }), d > .3) {
2684
- let e = Math.min(1, (d - .3) / .7), t = L.y + s / _ * y / 2, r = L.y + y - c / _ * y / 2;
2685
- tn(n, i + o / 2, N.cy, a - o / 2, t, O * e, u.blue, .25 * e), tn(n, i + o / 2, P.cy, a - o / 2, r, j * e, u.amber, .22 * e);
2687
+ let e = Math.min(1, (d - .3) / .7), t = F.y + s / h * v / 2, r = F.y + v - c / h * v / 2;
2688
+ tn(n, i + o / 2, N.cy, a - o / 2, t, O * e, u.blue, .25 * e), tn(n, i + o / 2, P.cy, a - o / 2, r, k * e, u.amber, .22 * e);
2686
2689
  }
2687
2690
  if ([
2688
2691
  "Contractors",
@@ -2694,22 +2697,22 @@ function en({ items: e = [], onItemClick: r, testID: i }) {
2694
2697
  i,
2695
2698
  a
2696
2699
  ][t];
2697
- n.font = h.font, n.fillStyle = h.color, n.textAlign = "center", n.fillText(e, o, $t - 8);
2700
+ n.font = g.font, n.fillStyle = g.color, n.textAlign = "center", n.fillText(e, o, $t - 8);
2698
2701
  }), e.forEach((t, r) => {
2699
- let i = E[r], a = F(d, r, e.length, A), s = f.current.get(t.id) ?? 0;
2700
- k(w.current, t.id, i.x, i.y, o, i.h, {
2702
+ let i = E[r], a = I(d, r, e.length, j), s = f.current.get(t.id) ?? 0;
2703
+ A(w.current, t.id, i.x, i.y, o, i.h, {
2701
2704
  label: t.name,
2702
2705
  value: t.totalLabel ?? String(t.total ?? 0),
2703
2706
  sublabel: `${t.baseLabel ?? String(t.base ?? 0)} + ${t.variationLabel ?? String(t.variation ?? 0)}`,
2704
2707
  color: i.color
2705
- }), s > 0 && S(n, i.x + o / 2, i.cy, o * .6, i.color, .12 * s), n.fillStyle = v(i.color, (.3 + s * .15) * a), n.strokeStyle = v(i.color, (.55 + s * .25) * a), n.lineWidth = 1, n.beginPath(), n.roundRect(i.x, i.y, o * a, i.h, 4), n.fill(), n.stroke(), a > .6 && i.h >= 24 && (n.globalAlpha = Math.min(1, (a - .6) / .4), n.font = h.font, n.fillStyle = s > 0 ? i.color : v(u.t2, .9), n.textAlign = "center", n.textBaseline = "middle", n.fillText(t.abbreviation ?? t.name?.slice(0, 6) ?? "", i.x + o / 2, i.h >= 36 ? i.cy - 5 : i.cy), i.h >= 36 && (n.font = "400 12px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = v(u.t3, .8), n.fillText(t.totalLabel ?? String(t.total ?? 0), i.x + o / 2, i.cy + 7)), n.globalAlpha = 1, n.textBaseline = "alphabetic");
2708
+ }), s > 0 && C(n, i.x + o / 2, i.cy, o * .6, i.color, .12 * s), n.fillStyle = y(i.color, (.3 + s * .15) * a), n.strokeStyle = y(i.color, (.55 + s * .25) * a), n.lineWidth = 1, n.beginPath(), n.roundRect(i.x, i.y, o * a, i.h, 4), n.fill(), n.stroke(), a > .6 && i.h >= 24 && (n.globalAlpha = Math.min(1, (a - .6) / .4), n.font = g.font, n.fillStyle = s > 0 ? i.color : y(u.t2, .9), n.textAlign = "center", n.textBaseline = "middle", n.fillText(t.abbreviation ?? t.name?.slice(0, 6) ?? "", i.x + o / 2, i.h >= 36 ? i.cy - 5 : i.cy), i.h >= 36 && (n.font = "400 12px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = y(u.t3, .8), n.fillText(t.totalLabel ?? String(t.total ?? 0), i.x + o / 2, i.cy + 7)), n.globalAlpha = 1, n.textBaseline = "alphabetic");
2706
2709
  }), d > .2) {
2707
2710
  let e = Math.min(1, (d - .2) / .4);
2708
- S(n, i, N.cy, 30, u.blue, .1 * e), n.fillStyle = v(u.blue, .3 * e), n.strokeStyle = v(u.blue, .5 * e), n.lineWidth = 1, n.beginPath(), n.roundRect(N.x, N.y, o, N.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = h.font, n.fillStyle = u.blue, n.textAlign = "center", n.fillText("Base Value", i, N.cy - 6), n.font = g.font, n.fillStyle = g.color, n.fillText(K(s), i, N.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic", S(n, i, P.cy, 24, u.amber, .1 * e), n.fillStyle = v(u.amber, .22 * e), n.strokeStyle = v(u.amber, .4 * e), n.beginPath(), n.roundRect(P.x, P.y, o, P.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = h.font, n.fillStyle = u.amber, n.textAlign = "center", n.fillText("Variations", i, P.cy - 4), n.font = g.font, n.fillStyle = g.color, n.fillText(K(c), i, P.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2711
+ C(n, i, N.cy, 30, u.blue, .1 * e), n.fillStyle = y(u.blue, .3 * e), n.strokeStyle = y(u.blue, .5 * e), n.lineWidth = 1, n.beginPath(), n.roundRect(N.x, N.y, o, N.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = g.font, n.fillStyle = u.blue, n.textAlign = "center", n.fillText("Base Value", i, N.cy - 6), n.font = _.font, n.fillStyle = _.color, n.fillText(K(s), i, N.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic", C(n, i, P.cy, 24, u.amber, .1 * e), n.fillStyle = y(u.amber, .22 * e), n.strokeStyle = y(u.amber, .4 * e), n.beginPath(), n.roundRect(P.x, P.y, o, P.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = g.font, n.fillStyle = u.amber, n.textAlign = "center", n.fillText("Variations", i, P.cy - 4), n.font = _.font, n.fillStyle = _.color, n.fillText(K(c), i, P.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2709
2712
  }
2710
2713
  if (d > .5) {
2711
2714
  let e = Math.min(1, (d - .5) / .5);
2712
- S(n, a, L.cy, 44, u.blue, .2 * e), n.fillStyle = v(u.blue, .25 * e), n.strokeStyle = v(u.blue, .6 * e), n.lineWidth = 1.5, n.beginPath(), n.roundRect(L.x, L.y, o, L.h * e, 6), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = h.font, n.fillStyle = u.t2, n.textAlign = "center", n.fillText("Total Commitment", a, L.cy - 12), n.font = g.font, n.fillStyle = u.blue, n.fillText(K(_), a, L.cy + 6), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2715
+ C(n, a, F.cy, 44, u.blue, .2 * e), n.fillStyle = y(u.blue, .25 * e), n.strokeStyle = y(u.blue, .6 * e), n.lineWidth = 1.5, n.beginPath(), n.roundRect(F.x, F.y, o, F.h * e, 6), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = g.font, n.fillStyle = u.t2, n.textAlign = "center", n.fillText("Total Commitment", a, F.cy - 12), n.font = _.font, n.fillStyle = u.blue, n.fillText(K(h), a, F.cy + 6), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2713
2716
  }
2714
2717
  R = requestAnimationFrame(z);
2715
2718
  };
@@ -2731,8 +2734,8 @@ function en({ items: e = [], onItemClick: r, testID: i }) {
2731
2734
  height: $t,
2732
2735
  display: "block"
2733
2736
  }
2734
- }), /* @__PURE__ */ s(E, {
2735
- ...C,
2737
+ }), /* @__PURE__ */ s(D, {
2738
+ ...x,
2736
2739
  parentW: l,
2737
2740
  parentH: $t
2738
2741
  })]
@@ -2740,7 +2743,7 @@ function en({ items: e = [], onItemClick: r, testID: i }) {
2740
2743
  }
2741
2744
  function tn(e, t, n, r, i, a, o, s) {
2742
2745
  let c = (t + r) / 2;
2743
- e.beginPath(), e.moveTo(t, n - a / 2), e.bezierCurveTo(c, n - a / 2, c, i - a / 2, r, i - a / 2), e.lineTo(r, i + a / 2), e.bezierCurveTo(c, i + a / 2, c, n + a / 2, t, n + a / 2), e.closePath(), e.fillStyle = v(o, s), e.fill();
2746
+ e.beginPath(), e.moveTo(t, n - a / 2), e.bezierCurveTo(c, n - a / 2, c, i - a / 2, r, i - a / 2), e.lineTo(r, i + a / 2), e.bezierCurveTo(c, i + a / 2, c, n + a / 2, t, n + a / 2), e.closePath(), e.fillStyle = y(o, s), e.fill();
2744
2747
  }
2745
2748
  //#endregion
2746
2749
  //#region src/components/horizontalBarChart/HorizontalBarChart.tsx
@@ -2761,38 +2764,38 @@ function dn(e, t) {
2761
2764
  return n >= 1e6 ? `${r}${t}${(n / 1e6).toFixed(1)}M` : n >= 1e3 ? `${r}${t}${(n / 1e3).toFixed(1)}K` : `${r}${t}${n.toFixed(0)}`;
2762
2765
  }
2763
2766
  function fn({ rows: e, valuePrefix: n = "$", onItemClick: r, testID: i }) {
2764
- let [l, d] = ee(nn), f = a(null), p = a(/* @__PURE__ */ new Map()), [m, _] = o(!1), y = a(e);
2765
- y.current = e;
2767
+ let [l, d] = ee(nn), f = a(null), p = a(/* @__PURE__ */ new Map()), [m, h] = o(!1), v = a(e);
2768
+ v.current = e;
2766
2769
  let b = t((e, t) => {
2767
- let n = typeof t == "object" ? t.label ?? e : e, i = y.current.find((t) => t.id === e);
2770
+ let n = typeof t == "object" ? t.label ?? e : e, i = v.current.find((t) => t.id === e);
2768
2771
  r?.(e, n, i?.subentity);
2769
- }, [r]), x = e.filter((e) => e != null && typeof e.value == "number"), C = m ? x : x.slice(0, ln), w = C.length, T = Math.max(...x.map((e) => Math.abs(e.value)), 1), O = d - an.left - on - an.right, A = w * cn, M = an.top + an.bottom + A, { hoveredRef: N, tooltip: P, hitZonesRef: L } = D(f, {
2772
+ }, [r]), x = e.filter((e) => e != null && typeof e.value == "number"), S = m ? x : x.slice(0, ln), w = S.length, T = Math.max(...x.map((e) => Math.abs(e.value)), 1), E = d - an.left - on - an.right, k = w * cn, j = an.top + an.bottom + k, { hoveredRef: N, tooltip: P, hitZonesRef: F } = O(f, {
2770
2773
  width: d,
2771
- height: M,
2774
+ height: j,
2772
2775
  onClick: r ? b : void 0
2773
2776
  });
2774
- return he(f, d, M, (e, t) => {
2775
- I(p.current, N.current), L.current = [], C.forEach((r, i) => {
2776
- let a = F(t, i, w, j), o = an.top + i * cn, s = o + (cn - sn) / 2, c = o + cn / 2, l = an.left + on, f = p.current.get(r.id) ?? 0, m = Math.abs(r.value) / T * O * a, _ = r.valueLabel ?? dn(r.value, n);
2777
- if (e.save(), e.font = h.font, e.fillStyle = f > 0 ? u.cyan : h.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(un(e, r.name, on - 16), l - 8, c), k(L.current, r.id, 0, o, l, cn, {
2777
+ return ge(f, d, j, (e, t) => {
2778
+ L(p.current, N.current), F.current = [], S.forEach((r, i) => {
2779
+ let a = I(t, i, w, M), o = an.top + i * cn, s = o + (cn - sn) / 2, c = o + cn / 2, l = an.left + on, f = p.current.get(r.id) ?? 0, m = Math.abs(r.value) / T * E * a, h = r.valueLabel ?? dn(r.value, n);
2780
+ if (e.save(), e.font = g.font, e.fillStyle = f > 0 ? u.cyan : g.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(un(e, r.name, on - 16), l - 8, c), A(F.current, r.id, 0, o, l, cn, {
2778
2781
  label: r.name,
2779
- value: _,
2782
+ value: h,
2780
2783
  color: u.cyan
2781
- }), e.fillStyle = v(u.cyan, .1), e.beginPath(), e.roundRect(l, s, O, sn, sn / 2), e.fill(), m > 0) {
2782
- f > 0 && S(e, l + m, s + sn / 2, m * .25, u.cyan, .14 * f);
2784
+ }), e.fillStyle = y(u.cyan, .1), e.beginPath(), e.roundRect(l, s, E, sn, sn / 2), e.fill(), m > 0) {
2785
+ f > 0 && C(e, l + m, s + sn / 2, m * .25, u.cyan, .14 * f);
2783
2786
  let t = e.createLinearGradient(l, s, l + m, s);
2784
- t.addColorStop(0, v(u.cyan, .2 + f * .05)), t.addColorStop(.55, v(u.cyan, .55 + f * .15)), t.addColorStop(1, v(u.cyan, .72 + f * .18)), e.fillStyle = t, e.beginPath(), e.roundRect(l, s, m, sn, sn / 2), e.fill();
2787
+ t.addColorStop(0, y(u.cyan, .2 + f * .05)), t.addColorStop(.55, y(u.cyan, .55 + f * .15)), t.addColorStop(1, y(u.cyan, .72 + f * .18)), e.fillStyle = t, e.beginPath(), e.roundRect(l, s, m, sn, sn / 2), e.fill();
2785
2788
  }
2786
- f > 0 && m > 0 && (e.strokeStyle = v(u.cyan, .6 * f), e.lineWidth = 1, e.beginPath(), e.roundRect(l, s, m, sn, sn / 2), e.stroke()), a > .35 && (e.globalAlpha = Math.min(1, (a - .35) / .4), e.font = g.font, e.fillStyle = f > 0 ? u.cyan : g.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(_, d - 8, c)), e.restore(), k(L.current, r.id, l, o, Math.max(m, 1), cn, {
2789
+ f > 0 && m > 0 && (e.strokeStyle = y(u.cyan, .6 * f), e.lineWidth = 1, e.beginPath(), e.roundRect(l, s, m, sn, sn / 2), e.stroke()), a > .35 && (e.globalAlpha = Math.min(1, (a - .35) / .4), e.font = _.font, e.fillStyle = f > 0 ? u.cyan : _.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(h, d - 8, c)), e.restore(), A(F.current, r.id, l, o, Math.max(m, 1), cn, {
2787
2790
  label: r.name,
2788
- value: _,
2791
+ value: h,
2789
2792
  color: u.cyan
2790
2793
  });
2791
2794
  });
2792
- }, !0, { easing: j }), x.length === 0 ? /* @__PURE__ */ s("div", {
2795
+ }, !0, { easing: M }), x.length === 0 ? /* @__PURE__ */ s("div", {
2793
2796
  ref: l,
2794
2797
  style: { width: "100%" },
2795
- children: /* @__PURE__ */ s(W, {
2798
+ children: /* @__PURE__ */ s(G, {
2796
2799
  width: d,
2797
2800
  height: rn,
2798
2801
  message: "No data available",
@@ -2810,20 +2813,20 @@ function fn({ rows: e, valuePrefix: n = "$", onItemClick: r, testID: i }) {
2810
2813
  "aria-label": "Horizontal bar chart",
2811
2814
  style: {
2812
2815
  width: "100%",
2813
- height: M,
2816
+ height: j,
2814
2817
  display: "block",
2815
2818
  borderRadius: 8
2816
2819
  }
2817
- }), /* @__PURE__ */ s(E, {
2820
+ }), /* @__PURE__ */ s(D, {
2818
2821
  ...P,
2819
2822
  parentW: d,
2820
- parentH: M
2823
+ parentH: j
2821
2824
  })]
2822
2825
  }), x.length > ln && /* @__PURE__ */ s("div", {
2823
2826
  style: { marginTop: 8 },
2824
2827
  children: /* @__PURE__ */ s(te, {
2825
2828
  expanded: m,
2826
- onToggle: () => _((e) => !e),
2829
+ onToggle: () => h((e) => !e),
2827
2830
  "data-testid": i ? `${i}-toggle` : void 0
2828
2831
  })
2829
2832
  })]
@@ -2837,11 +2840,11 @@ function pn({ config: e, className: t, colorOffset: n = 0, onItemClick: r, selec
2837
2840
  rows: e.rows,
2838
2841
  className: t
2839
2842
  });
2840
- if (e.type === Y.AREA) return /* @__PURE__ */ s(B, {
2843
+ if (e.type === Y.AREA) return /* @__PURE__ */ s(V, {
2841
2844
  rows: e.rows,
2842
2845
  className: t
2843
2846
  });
2844
- if (e.type === Y.BAR) return /* @__PURE__ */ s(U, {
2847
+ if (e.type === Y.BAR) return /* @__PURE__ */ s(W, {
2845
2848
  rows: e.rows,
2846
2849
  className: t
2847
2850
  });
@@ -2881,7 +2884,7 @@ function pn({ config: e, className: t, colorOffset: n = 0, onItemClick: r, selec
2881
2884
  });
2882
2885
  }
2883
2886
  if (e.type === Y.MULTI_METRIC_CONSTELLATION) return /* @__PURE__ */ s(Ce, { items: e.items });
2884
- if (e.type === Y.PROGRESS_RACE) return /* @__PURE__ */ s(ce, {
2887
+ if (e.type === Y.PROGRESS_RACE) return /* @__PURE__ */ s(ue, {
2885
2888
  items: a || e.items,
2886
2889
  itemsByEntity: e.itemsByEntity,
2887
2890
  colorOffset: n,
@@ -2917,7 +2920,7 @@ function pn({ config: e, className: t, colorOffset: n = 0, onItemClick: r, selec
2917
2920
  }
2918
2921
  if (e.type === Y.SEMI_CIRCULAR_GAUGE) {
2919
2922
  let t = Array.isArray(a) ? a[0] : void 0;
2920
- return /* @__PURE__ */ s(me, {
2923
+ return /* @__PURE__ */ s(he, {
2921
2924
  confirmed: t ? Number(t.confirmed ?? 0) : e.confirmed,
2922
2925
  total: t ? Number(t.total ?? 1) : e.total,
2923
2926
  label: e.label,
@@ -2928,7 +2931,7 @@ function pn({ config: e, className: t, colorOffset: n = 0, onItemClick: r, selec
2928
2931
  subentity: e.subentity
2929
2932
  });
2930
2933
  }
2931
- return e.type === Y.SEGMENTED_SPLIT_BAR ? /* @__PURE__ */ s(Zt, {
2934
+ if (e.type === Y.SEGMENTED_SPLIT_BAR) return /* @__PURE__ */ s(Zt, {
2932
2935
  items: a || e.items,
2933
2936
  itemsByEntity: e.itemsByEntity,
2934
2937
  labelA: e.labelA,
@@ -2936,16 +2939,36 @@ function pn({ config: e, className: t, colorOffset: n = 0, onItemClick: r, selec
2936
2939
  unit: e.unit,
2937
2940
  onItemClick: r,
2938
2941
  selectedId: o
2939
- }) : e.type === Y.BALANCE_SCALE ? /* @__PURE__ */ s(mt, {
2940
- left: e.left,
2941
- right: e.right,
2942
- leftTitle: e.leftTitle,
2943
- rightTitle: e.rightTitle,
2944
- unit: e.unit,
2945
- dataByEntity: e.dataByEntity,
2946
- onItemClick: r,
2947
- selectedId: o
2948
- }) : e.type === Y.AREA_LINE ? /* @__PURE__ */ s(_t, { points: e.points }) : e.type === Y.TREND_VIEW ? /* @__PURE__ */ s(Ot, {
2942
+ });
2943
+ if (e.type === Y.BALANCE_SCALE) {
2944
+ let t = e.left, n = e.right;
2945
+ if (a && !Array.isArray(a)) {
2946
+ let e = a;
2947
+ if (e.items?.length >= 2) {
2948
+ let r = Number(e.items[0].count ?? 0), i = Number(e.items[1].count ?? 0);
2949
+ t = {
2950
+ value: r,
2951
+ count: 1,
2952
+ label: "£" + K(r, 2)
2953
+ }, n = {
2954
+ value: i,
2955
+ count: 1,
2956
+ label: "£" + K(i, 2)
2957
+ };
2958
+ }
2959
+ }
2960
+ return /* @__PURE__ */ s(mt, {
2961
+ left: t,
2962
+ right: n,
2963
+ leftTitle: e.leftTitle,
2964
+ rightTitle: e.rightTitle,
2965
+ unit: e.unit,
2966
+ dataByEntity: e.dataByEntity,
2967
+ onItemClick: r,
2968
+ selectedId: o
2969
+ });
2970
+ }
2971
+ return e.type === Y.AREA_LINE ? /* @__PURE__ */ s(_t, { points: e.points }) : e.type === Y.TREND_VIEW ? /* @__PURE__ */ s(Ot, {
2949
2972
  points: (a && !Array.isArray(a) ? a.points ?? [] : void 0) ?? e.points,
2950
2973
  colorOffset: n
2951
2974
  }) : e.type === Y.WEEKLY_FLOW ? /* @__PURE__ */ s(en, {
@@ -3825,121 +3848,130 @@ function Ln({ text: e }) {
3825
3848
  });
3826
3849
  }
3827
3850
  //#endregion
3851
+ //#region src/assets/ArrowClockwise.svg
3852
+ var Rn = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3072_19126)'%3e%3cpath%20d='M14.375%208.125H18.125V4.375'%20stroke='%2369DFE9'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M14.7188%2015C13.736%2015.9274%2012.5017%2016.5446%2011.1701%2016.7745C9.83859%2017.0044%208.46881%2016.8368%207.23196%2016.2926C5.99511%2015.7485%204.94602%2014.852%204.21579%2013.715C3.48556%2012.5781%203.10656%2011.2511%203.12615%209.90004C3.14574%208.54893%203.56304%207.23355%204.32593%206.11825C5.08881%205.00295%206.16344%204.13719%207.41555%203.62914C8.66765%203.12109%2010.0417%202.99329%2011.366%203.26169C12.6904%203.5301%2013.9062%204.18281%2014.8617%205.13828L18.125%208.125'%20stroke='%2369DFE9'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_3072_19126'%3e%3crect%20width='20'%20height='20'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
3853
+ //#endregion
3828
3854
  //#region src/components/visualizationGroup/VisualizationGroup.tsx
3829
- function Rn(e) {
3855
+ function zn(e) {
3830
3856
  return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
3831
3857
  }
3832
- var zn = 56;
3833
- function Bn({ items: e, colorOffset: r = 0, title: i, "data-testid": l }) {
3834
- let [u, d] = o(void 0), [f, p] = o(void 0), [m, h] = o(null), [g, _] = o(null), [v, y] = o(null), [b, x] = o(null), [S, C] = o(null), [w, T] = o(0), [E, D] = o(0), O = a(null);
3858
+ var Bn = 56;
3859
+ function Vn({ items: e, colorOffset: i = 0, title: l, "data-testid": u }) {
3860
+ let [d, f] = o(void 0), [p, m] = o(void 0), [h, g] = o(null), [_, v] = o(null), [y, b] = o(null), [x, S] = o(null), [C, w] = o(null), [T, E] = o(0), [D, O] = o(0), k = a(null), A = a(null), j = a(null), M = a(null), N = a(null);
3835
3861
  n(() => {
3836
- let e = O.current;
3862
+ let e = k.current;
3837
3863
  if (!e) return;
3838
3864
  let t = (t) => {
3839
- let { centerClientY: n, centerClientX: r, sourceClientY: i } = t.detail, a = e.getBoundingClientRect();
3840
- y(n - a.top), x(r - a.left), C(i == null ? null : i - a.top), T(a.height), D(a.width);
3865
+ let { centerClientY: n, centerClientX: r, sourceClientY: i } = t.detail, a = e.getBoundingClientRect(), o = t.target, s = o.getBoundingClientRect();
3866
+ A.current = o, j.current = n - s.top, M.current = r - s.left, N.current = i == null ? null : i - s.top, b(n - a.top), S(r - a.left), w(i == null ? null : i - a.top), E(a.height), O(a.width);
3841
3867
  };
3842
3868
  return e.addEventListener("viz-item-click", t), () => e.removeEventListener("viz-item-click", t);
3843
- }, []);
3844
- let k = t((e, t, n, r) => {
3869
+ }, []), r(() => {
3870
+ if (!h || A.current === null || j.current === null) return;
3871
+ let e = k.current;
3872
+ if (!e) return;
3873
+ let t = A.current.getBoundingClientRect(), n = e.getBoundingClientRect();
3874
+ b(t.top - n.top + j.current), M.current !== null && S(t.left - n.left + M.current), N.current !== null && w(t.top - n.top + N.current), E(n.height), O(n.width);
3875
+ }, [h]);
3876
+ let P = t((e, t, n, r) => {
3845
3877
  if (!(r != null && (!Array.isArray(r) || r.length > 0))) return;
3846
- let i = Rn(t);
3847
- d((t) => {
3878
+ let i = zn(t);
3879
+ f((t) => {
3848
3880
  let a = t === i ? void 0 : i;
3849
- return p(a ? n : void 0), a ? (_(e), h(r)) : (h(null), _(null)), a;
3881
+ return m(a ? n : void 0), a ? (v(e), g(r)) : (g(null), v(null)), a;
3850
3882
  });
3851
- }, []), A = t(() => {
3852
- d(void 0), p(void 0), h(null), _(null), y(null), x(null), C(null);
3853
- }, []), j = g !== null && v !== null, M = v ?? w / 2, N = e.length - 1, P = E > 0 ? (E - N * zn) / e.length : null, F = (t) => j && g === t && e[t]?.type === Y.BALANCE_SCALE;
3883
+ }, []), F = t(() => {
3884
+ f(void 0), m(void 0), g(null), v(null), b(null), S(null), w(null), A.current = null, j.current = null, M.current = null, N.current = null;
3885
+ }, []), I = _ !== null && y !== null, L = y ?? T / 2, R = e.length - 1, z = D > 0 ? (D - R * Bn) / e.length : null, B = (t) => I && _ === t && e[t]?.type === Y.BALANCE_SCALE, V = _ !== null && e[_]?.type === Y.BALANCE_SCALE && I && x !== null && C !== null && z !== null;
3854
3886
  return /* @__PURE__ */ c("div", {
3855
3887
  className: "viz-group",
3856
- "data-testid": l,
3888
+ "data-testid": u,
3857
3889
  children: [
3858
- i && /* @__PURE__ */ s("div", {
3890
+ l && /* @__PURE__ */ s("div", {
3859
3891
  className: "viz-group__title",
3860
- children: i
3892
+ children: l
3861
3893
  }),
3862
3894
  /* @__PURE__ */ s("div", {
3863
3895
  className: "viz-group__bar",
3864
- children: u ? /* @__PURE__ */ s("button", {
3896
+ children: d ? /* @__PURE__ */ c("button", {
3865
3897
  type: "button",
3866
3898
  className: "viz-group__reset-btn",
3867
- onClick: A,
3899
+ onClick: F,
3868
3900
  "aria-label": "Reset selection",
3869
- children: " Reset"
3901
+ children: [/* @__PURE__ */ s("img", {
3902
+ src: Rn,
3903
+ alt: "",
3904
+ className: "viz-group__reset-icon"
3905
+ }), "Reset"]
3870
3906
  }) : /* @__PURE__ */ s("span", {
3871
3907
  className: "viz-group__hint",
3872
3908
  children: "↑ Click a row to drill down"
3873
3909
  })
3874
3910
  }),
3875
- /* @__PURE__ */ s("div", {
3876
- ref: O,
3911
+ /* @__PURE__ */ c("div", {
3912
+ ref: k,
3877
3913
  className: "viz-group__charts",
3878
- children: e.flatMap((t, n) => {
3879
- let i = g === null ? n === e.length - 1 : n !== g, a = F(n) && b !== null && S !== null && P !== null, o = /* @__PURE__ */ c("div", {
3880
- className: `viz-group__chart viz-group__chart--${t.type}${i ? " viz-group__chart--listener" : ""}`,
3881
- children: [
3882
- i && /* @__PURE__ */ s("div", {
3883
- className: "viz-group__listener-label",
3884
- children: g === null ? null : f
3885
- }),
3886
- /* @__PURE__ */ s(pn, {
3887
- config: t,
3888
- colorOffset: r + n,
3889
- onItemClick: (e, t, r) => k(n, e, t, r),
3890
- selectedId: u,
3891
- listenerItems: n !== g && m ? m : void 0
3892
- }),
3893
- a && /* @__PURE__ */ c("svg", {
3894
- className: "viz-group__route-svg",
3895
- xmlns: "http://www.w3.org/2000/svg",
3896
- "aria-hidden": "true",
3897
- children: [/* @__PURE__ */ s("line", {
3898
- x1: b - 7,
3899
- y1: S,
3900
- x2: b + 7,
3901
- y2: S,
3902
- className: "viz-group__connector-tick"
3903
- }), /* @__PURE__ */ s("path", {
3904
- d: `M ${b} ${S} L ${b} ${M} H ${P}`,
3905
- className: "viz-group__connector-path"
3906
- })]
3907
- })
3908
- ]
3914
+ children: [e.flatMap((t, n) => {
3915
+ let r = _ === null ? n === e.length - 1 : n !== _, a = B(n) && x !== null && C !== null && z !== null, o = /* @__PURE__ */ c("div", {
3916
+ className: `viz-group__chart viz-group__chart--${t.type}${r ? " viz-group__chart--listener" : ""}`,
3917
+ children: [r && /* @__PURE__ */ s("div", {
3918
+ className: "viz-group__listener-label",
3919
+ children: _ === null ? null : p
3920
+ }), /* @__PURE__ */ s(pn, {
3921
+ config: t,
3922
+ colorOffset: i + n,
3923
+ onItemClick: (e, t, r) => P(n, e, t, r),
3924
+ selectedId: d,
3925
+ listenerItems: n !== _ && h ? h : void 0
3926
+ })]
3909
3927
  }, n);
3910
3928
  if (n === e.length - 1) return [o];
3911
- let l = g !== null && g > n, d = l ? -.7 : zn + .7, p = l ? zn - 2 : 2, h = `M ${p} ${M} H ${d}`;
3929
+ let l = _ !== null && _ > n, u = l ? -.7 : Bn + .7, f = x !== null && z !== null ? x - z : l ? Bn + 20 : -20, m = `M ${a ? l ? Bn : 0 : f} ${L} H ${u}`;
3912
3930
  return [o, /* @__PURE__ */ s("div", {
3913
- className: `viz-group__connector${j ? " viz-group__connector--active" : ""}`,
3931
+ className: `viz-group__connector${I ? " viz-group__connector--active" : ""}`,
3914
3932
  children: /* @__PURE__ */ c("svg", {
3915
3933
  className: "viz-group__connector-svg",
3916
3934
  xmlns: "http://www.w3.org/2000/svg",
3917
3935
  "aria-hidden": "true",
3918
3936
  children: [
3919
3937
  !a && /* @__PURE__ */ s("line", {
3920
- x1: p,
3921
- y1: M - 7,
3922
- x2: p,
3923
- y2: M + 7,
3938
+ x1: f,
3939
+ y1: L - 7,
3940
+ x2: f,
3941
+ y2: L + 7,
3924
3942
  className: "viz-group__connector-tick"
3925
3943
  }),
3926
3944
  /* @__PURE__ */ s("path", {
3927
- d: h,
3945
+ d: m,
3928
3946
  className: "viz-group__connector-path"
3929
3947
  }),
3930
3948
  /* @__PURE__ */ s("circle", {
3931
- cx: d,
3932
- cy: M,
3949
+ cx: u,
3950
+ cy: L,
3933
3951
  r: "4",
3934
3952
  className: "viz-group__connector-dot"
3935
3953
  })
3936
3954
  ]
3937
3955
  })
3938
3956
  }, `connector-${n}`)];
3939
- })
3957
+ }), V && /* @__PURE__ */ c("svg", {
3958
+ className: "viz-group__route-svg",
3959
+ xmlns: "http://www.w3.org/2000/svg",
3960
+ "aria-hidden": "true",
3961
+ children: [/* @__PURE__ */ s("line", {
3962
+ x1: x - 7,
3963
+ y1: C,
3964
+ x2: x + 7,
3965
+ y2: C,
3966
+ className: "viz-group__connector-tick"
3967
+ }), /* @__PURE__ */ s("path", {
3968
+ d: `M ${x} ${C} L ${x} ${L} H ${z}`,
3969
+ className: "viz-group__connector-path"
3970
+ })]
3971
+ })]
3940
3972
  })
3941
3973
  ]
3942
3974
  });
3943
3975
  }
3944
3976
  //#endregion
3945
- export { B as AreaChart, U as BarChart, m as CHART_PALETTE, l as ChartFrame, yn as DonutChart, d as GRAD, Pn as KeyHighlights, He as LineChart, Ge as MiniBars, p as PALETTE, et as PieChart, ut as ProcessSankey, dt as RankingSankey, f as SOLID, nt as SankeySvg, z as SeriesChart, Ln as Takeaway, Ot as Trend, Ht as TrendChart, Bn as VisualizationGroup, pn as VisualizationRenderer, gn as cleanupVisualizationMounts, _n as hydrateVisualizationMounts, vn as serializeVisualizationConfig };
3977
+ export { V as AreaChart, W as BarChart, h as CHART_PALETTE, l as ChartFrame, yn as DonutChart, d as GRAD, Pn as KeyHighlights, He as LineChart, Ge as MiniBars, p as PALETTE, et as PieChart, ut as ProcessSankey, dt as RankingSankey, f as SOLID, nt as SankeySvg, B as SeriesChart, Ln as Takeaway, Ot as Trend, Ht as TrendChart, Vn as VisualizationGroup, pn as VisualizationRenderer, gn as cleanupVisualizationMounts, _n as hydrateVisualizationMounts, vn as serializeVisualizationConfig };