@divami-artefacts/ai-design-system 1.0.11 → 1.0.13

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
@@ -15,39 +15,43 @@ var u = {
15
15
  bgL: "#0C1420",
16
16
  sf: "#13161B",
17
17
  bd: "#22262F",
18
- blue: "#2970FF",
18
+ blue: "#4C93D9",
19
19
  cyan: "#36BFFA",
20
- orange: "#EF6820",
21
- red: "#EF6820",
22
- green: "#71B941",
23
- purple: "#7A5AF8",
24
- amber: "#FAC515",
25
- t1: "#F7F7F7",
26
- t2: "#C2C2C2",
20
+ orange: "#EC772A",
21
+ red: "#EC772A",
22
+ green: "#5DA537",
23
+ purple: "#818FF8",
24
+ amber: "#EEBF3B",
25
+ t1: "#F7F9FA",
26
+ t2: "#B3B5B6",
27
27
  t3: "#94979C",
28
28
  t4: "#334155"
29
29
  }, d = [
30
30
  u.blue,
31
- u.cyan,
32
31
  u.amber,
33
32
  u.purple,
34
33
  u.green,
35
34
  u.red
36
35
  ], f = {
37
36
  font: "400 14px 'Satoshi Variable', 'DM Sans', sans-serif",
38
- color: "#C2C2C2"
37
+ color: "#B3B5B6",
38
+ letterSpacing: "0px"
39
39
  }, p = {
40
- font: "400 14px 'Satoshi Variable', 'DM Sans', sans-serif",
41
- color: "#C2C2C2"
40
+ font: "500 14px 'Satoshi Variable', 'DM Sans', sans-serif",
41
+ color: "#F7F9FA"
42
+ }, m = {
43
+ font: "400 16px 'Satoshi Variable', 'DM Sans', sans-serif",
44
+ color: "#B3B5B6",
45
+ letterSpacing: "0px"
42
46
  };
43
- function m(e, t = 1) {
47
+ function h(e, t = 1) {
44
48
  let n = e.replace("#", "");
45
49
  return `rgba(${parseInt(n.substring(0, 2), 16)},${parseInt(n.substring(2, 4), 16)},${parseInt(n.substring(4, 6), 16)},${t})`;
46
50
  }
47
- function h(e, t, n) {
51
+ function g(e, t, n) {
48
52
  return e + (t - e) * n;
49
53
  }
50
- function g(e, t, n) {
54
+ function _(e, t, n) {
51
55
  let r = (e) => {
52
56
  let t = e.replace("#", "");
53
57
  return [
@@ -57,34 +61,34 @@ function g(e, t, n) {
57
61
  ];
58
62
  }, [i, a, o] = r(e), [s, c, l] = r(t), u = (e) => Math.max(0, Math.min(255, Math.round(e)));
59
63
  return [
60
- u(h(i, s, n)),
61
- u(h(a, c, n)),
62
- u(h(o, l, n))
64
+ u(g(i, s, n)),
65
+ u(g(a, c, n)),
66
+ u(g(o, l, n))
63
67
  ].map((e) => e.toString(16).padStart(2, "0")).join("").replace(/^/, "#");
64
68
  }
65
- function _(e, t, n, r = 2) {
69
+ function v(e, t, n, r = 2) {
66
70
  e.width = t * r, e.height = n * r;
67
71
  let i = e.getContext("2d");
68
72
  return i.scale(r, r), i;
69
73
  }
70
- function v(e, t, n, r, i, a = .3) {
74
+ function y(e, t, n, r, i, a = .3) {
71
75
  let o = e.createRadialGradient(t, n, 0, t, n, r);
72
- o.addColorStop(0, m(i, a)), o.addColorStop(1, m(i, 0)), e.fillStyle = o, e.beginPath(), e.arc(t, n, r, 0, Math.PI * 2), e.fill();
76
+ o.addColorStop(0, h(i, a)), o.addColorStop(1, h(i, 0)), e.fillStyle = o, e.beginPath(), e.arc(t, n, r, 0, Math.PI * 2), e.fill();
73
77
  }
74
- function y(e, t, n, r, i = 50, a = m(u.blue, .05)) {
78
+ function b(e, t, n, r, i = 50, a = h(u.blue, .05)) {
75
79
  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();
76
80
  }
77
- function b(e, t, n, r, i = .015) {
81
+ function x(e, t, n, r, i = .015) {
78
82
  e.fillStyle = `rgba(0,0,0,${i})`;
79
83
  let a = r * .5 % 6;
80
84
  for (let r = a; r < n; r += 3) e.fillRect(0, r, t, 1);
81
85
  }
82
- function x(e, t, n, r, i = m(u.t1, .08)) {
86
+ function S(e, t, n, r, i = h(u.t1, .08)) {
83
87
  e.strokeStyle = i, e.lineWidth = 1, e.setLineDash([3, 3]), e.beginPath(), e.moveTo(t, n), e.lineTo(t, r), e.stroke(), e.setLineDash([]);
84
88
  }
85
89
  //#endregion
86
90
  //#region src/canvas/CanvasTooltip.tsx
87
- function S({ visible: e, x: t, y: n, content: i, parentW: o }) {
91
+ function C({ visible: e, x: t, y: n, content: i, parentW: o }) {
88
92
  let l = a(null);
89
93
  if (r(() => {
90
94
  let r = l.current;
@@ -157,7 +161,7 @@ function S({ visible: e, x: t, y: n, content: i, parentW: o }) {
157
161
  }
158
162
  //#endregion
159
163
  //#region src/canvas/useCanvasInteraction.ts
160
- function C(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
164
+ function w(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
161
165
  let l = a({
162
166
  x: -1,
163
167
  y: -1,
@@ -229,14 +233,14 @@ function C(e, { width: r, height: i, onClick: s, enabled: c = !0 }) {
229
233
  hitZonesRef: d
230
234
  };
231
235
  }
232
- function w(e, t, n, r, i, a) {
236
+ function T(e, t, n, r, i, a) {
233
237
  e.push({
234
238
  id: t,
235
239
  data: a,
236
240
  test: (e, t) => (e - n) ** 2 + (t - r) ** 2 <= i * i
237
241
  });
238
242
  }
239
- function T(e, t, n, r, i, a, o) {
243
+ function E(e, t, n, r, i, a, o) {
240
244
  e.push({
241
245
  id: t,
242
246
  data: o,
@@ -245,14 +249,14 @@ function T(e, t, n, r, i, a, o) {
245
249
  }
246
250
  //#endregion
247
251
  //#region src/canvas/easing.ts
248
- var E = (e) => 1 - (1 - e) ** 3, D = (e) => 1 - (1 - e) ** 4, O = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), k = (e) => {
252
+ var D = (e) => 1 - (1 - e) ** 3, O = (e) => 1 - (1 - e) ** 4, k = (e) => e === 1 ? 1 : 1 - 2 ** (-10 * e), A = (e) => {
249
253
  let t = 1.70158;
250
254
  return 1 + (t + 1) * (e - 1) ** 3 + t * (e - 1) ** 2;
251
- }, A = (e, t = .04, n = .001) => Math.sin(e * t) * Math.exp(-Math.min(e * n, 4)), j = (e, t, n, r = E) => {
255
+ }, j = (e, t = .04, n = .001) => Math.sin(e * t) * Math.exp(-Math.min(e * n, 4)), M = (e, t, n, r = D) => {
252
256
  let i = Math.min(.06, .5 / n), a = t * i, o = 1 - (n - 1) * i;
253
257
  return r(Math.max(0, Math.min((e - a) / o, 1)));
254
258
  };
255
- function M(e, t, n = .12) {
259
+ function N(e, t, n = .12) {
256
260
  e.forEach((r, i) => {
257
261
  let a = i === t ? 1 : 0, o = r + (a - r) * n;
258
262
  Math.abs(o - a) < .005 ? a === 0 ? e.delete(i) : e.set(i, 1) : e.set(i, o);
@@ -260,66 +264,66 @@ function M(e, t, n = .12) {
260
264
  }
261
265
  //#endregion
262
266
  //#region src/components/common/SeriesChart.tsx
263
- var ee = 760, N = 250;
264
- function te({ rows: e = [], variant: t, className: r, colors: i }) {
265
- let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), { mouseRef: p, hoveredRef: h, tooltip: g, hitZonesRef: y } = C(o, {
266
- width: ee,
267
- height: N
267
+ var P = 760, F = 250;
268
+ function ee({ rows: e = [], variant: t, className: r, colors: i }) {
269
+ let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), { mouseRef: p, hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(o, {
270
+ width: P,
271
+ height: F
268
272
  });
269
273
  return n(() => {
270
274
  let n = o.current;
271
275
  if (!n) return;
272
- let r = _(n, ee, N);
276
+ let r = v(n, P, F);
273
277
  f.current = 0;
274
278
  let a = i?.line ?? u.blue, s = i?.point ?? u.blue, c = i?.axisLine ?? u.bd, l = i?.areaFill ?? u.blue, g = {
275
279
  top: 24,
276
280
  right: 24,
277
281
  bottom: 44,
278
282
  left: 24
279
- }, b = ee - g.left - g.right, S = N - g.top - g.bottom, C, T = () => {
283
+ }, b = P - g.left - g.right, x = F - g.top - g.bottom, C, w = () => {
280
284
  f.current++;
281
285
  let n = f.current;
282
- if (r.clearRect(0, 0, ee, N), e.length < 2) {
283
- C = requestAnimationFrame(T);
286
+ if (r.clearRect(0, 0, P, F), e.length < 2) {
287
+ C = requestAnimationFrame(w);
284
288
  return;
285
289
  }
286
- let i = e.map((e) => e.pricing ?? 0), o = Math.max(100, ...i), _ = (t) => g.left + t / (e.length - 1) * b, E = (e) => g.top + (1 - e / o) * S, D = O(Math.min(n / 48, 1)), k = Math.max(2, Math.floor(D * e.length));
287
- M(d.current, h.current), y.current = [], r.strokeStyle = m(u.bd, .2), r.lineWidth = .5;
290
+ let i = e.map((e) => e.pricing ?? 0), o = Math.max(100, ...i), v = (t) => g.left + t / (e.length - 1) * b, E = (e) => g.top + (1 - e / o) * x, D = k(Math.min(n / 48, 1)), O = Math.max(2, Math.floor(D * e.length));
291
+ N(d.current, m.current), _.current = [], r.strokeStyle = h(u.bd, .2), r.lineWidth = .5;
288
292
  for (let e = 0; e <= 4; e++) {
289
- let t = g.top + e / 4 * S;
293
+ let t = g.top + e / 4 * x;
290
294
  r.beginPath(), r.moveTo(g.left, t), r.lineTo(g.left + b, t), r.stroke();
291
295
  }
292
- if (r.strokeStyle = m(c, .4), r.lineWidth = 1, r.setLineDash([]), r.beginPath(), r.moveTo(g.left, E(0)), r.lineTo(g.left + b, E(0)), r.stroke(), p.current.over && h.current) {
293
- let e = parseInt(h.current.split("-")[1]);
294
- isNaN(e) || x(r, _(e), g.top, g.top + S);
296
+ if (r.strokeStyle = h(c, .4), r.lineWidth = 1, r.setLineDash([]), r.beginPath(), r.moveTo(g.left, E(0)), r.lineTo(g.left + b, E(0)), r.stroke(), p.current.over && m.current) {
297
+ let e = parseInt(m.current.split("-")[1]);
298
+ isNaN(e) || S(r, v(e), g.top, g.top + x);
295
299
  }
296
- if (t === "area" && k > 1) {
297
- let t = r.createLinearGradient(0, g.top, 0, g.top + S);
298
- t.addColorStop(0, m(l, .12)), t.addColorStop(1, m(l, 0)), r.fillStyle = t, r.beginPath(), r.moveTo(_(0), g.top + S);
299
- for (let t = 0; t < k; t++) r.lineTo(_(t), E(e[t].pricing ?? 0));
300
- r.lineTo(_(k - 1), g.top + S), r.closePath(), r.fill();
300
+ if (t === "area" && O > 1) {
301
+ let t = r.createLinearGradient(0, g.top, 0, g.top + x);
302
+ t.addColorStop(0, h(l, .12)), t.addColorStop(1, h(l, 0)), r.fillStyle = t, r.beginPath(), r.moveTo(v(0), g.top + x);
303
+ for (let t = 0; t < O; t++) r.lineTo(v(t), E(e[t].pricing ?? 0));
304
+ r.lineTo(v(O - 1), g.top + x), r.closePath(), r.fill();
301
305
  }
302
- if (k > 1) {
303
- r.strokeStyle = m(a, .85), r.lineWidth = 2, r.setLineDash([]), r.beginPath();
304
- for (let t = 0; t < k; t++) {
305
- let n = _(t), i = E(e[t].pricing ?? 0);
306
+ if (O > 1) {
307
+ r.strokeStyle = h(a, .85), r.lineWidth = 2, r.setLineDash([]), r.beginPath();
308
+ for (let t = 0; t < O; t++) {
309
+ let n = v(t), i = E(e[t].pricing ?? 0);
306
310
  t === 0 ? r.moveTo(n, i) : r.lineTo(n, i);
307
311
  }
308
312
  r.stroke();
309
313
  }
310
- for (let i = 0; i < k; i++) {
311
- let a = _(i), o = E(e[i].pricing ?? 0), c = `sc-${i}`, l = d.current.get(c) ?? 0, f = i === e.length - 1;
312
- w(y.current, c, a, o, 12, {
314
+ for (let i = 0; i < O; i++) {
315
+ let a = v(i), o = E(e[i].pricing ?? 0), c = `sc-${i}`, l = d.current.get(c) ?? 0, f = i === e.length - 1;
316
+ T(_.current, c, a, o, 12, {
313
317
  label: e[i].vendor,
314
318
  value: String(e[i].pricing ?? 0),
315
319
  color: f ? u.red : s
316
- }), l > 0 && v(r, a, o, 16 * l, s, .2 * l);
317
- let p = f ? A(n, .05, 5e-4) : 0, h = t === "area" ? 5 : 6;
318
- f ? (r.shadowColor = m(u.red, .5), r.shadowBlur = (8 + p * 4) * (1 + l * .5), r.fillStyle = u.red, r.beginPath(), r.arc(a, o, (h + p * 1.5) * (1 + l * .3), 0, Math.PI * 2), r.fill(), r.shadowBlur = 0) : (r.fillStyle = m(s, .7 + l * .3), r.beginPath(), r.arc(a, o, h + l * 2, 0, Math.PI * 2), r.fill()), r.font = "10px 'JetBrains Mono', monospace", r.fillStyle = m(u.t3, .6 + l * .3), r.textAlign = "center", r.fillText(e[i].vendor, a, N - 14);
320
+ }), l > 0 && y(r, a, o, 16 * l, s, .2 * l);
321
+ let p = f ? j(n, .05, 5e-4) : 0, m = t === "area" ? 5 : 6;
322
+ f ? (r.shadowColor = h(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 = h(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 = h(u.t3, .6 + l * .3), r.textAlign = "center", r.fillText(e[i].vendor, a, F - 14);
319
323
  }
320
- C = requestAnimationFrame(T);
324
+ C = requestAnimationFrame(w);
321
325
  };
322
- return T(), () => cancelAnimationFrame(C);
326
+ return w(), () => cancelAnimationFrame(C);
323
327
  }, [
324
328
  e,
325
329
  t,
@@ -329,31 +333,31 @@ function te({ rows: e = [], variant: t, className: r, colors: i }) {
329
333
  children: /* @__PURE__ */ c("div", {
330
334
  style: {
331
335
  position: "relative",
332
- width: ee,
333
- height: N
336
+ width: P,
337
+ height: F
334
338
  },
335
339
  children: [/* @__PURE__ */ s("canvas", {
336
340
  ref: o,
337
341
  role: "img",
338
342
  "aria-label": `${t} chart`,
339
343
  style: {
340
- width: ee,
341
- height: N,
344
+ width: P,
345
+ height: F,
342
346
  display: "block",
343
347
  borderRadius: 8
344
348
  }
345
- }), /* @__PURE__ */ s(S, {
349
+ }), /* @__PURE__ */ s(C, {
346
350
  ...g,
347
- parentW: ee,
348
- parentH: N
351
+ parentW: P,
352
+ parentH: F
349
353
  })]
350
354
  })
351
355
  });
352
356
  }
353
357
  //#endregion
354
358
  //#region src/components/areaChart/AreaChart.tsx
355
- function ne({ rows: e = [], className: t, colors: n }) {
356
- return /* @__PURE__ */ s(te, {
359
+ function te({ rows: e = [], className: t, colors: n }) {
360
+ return /* @__PURE__ */ s(ee, {
357
361
  rows: e,
358
362
  variant: "area",
359
363
  className: t,
@@ -362,44 +366,44 @@ function ne({ rows: e = [], className: t, colors: n }) {
362
366
  }
363
367
  //#endregion
364
368
  //#region src/components/barChart/BarChart.tsx
365
- var P = 760, re = 280;
369
+ var ne = 760, re = 280;
366
370
  function ie({ rows: e = [], className: t, colors: r }) {
367
- let i = a(null), o = a(/* @__PURE__ */ new Map()), f = a(0), { hoveredRef: p, tooltip: h, hitZonesRef: g } = C(i, {
368
- width: P,
371
+ let i = a(null), o = a(/* @__PURE__ */ new Map()), f = a(0), { hoveredRef: p, tooltip: m, hitZonesRef: g } = w(i, {
372
+ width: ne,
369
373
  height: re
370
374
  });
371
375
  return n(() => {
372
376
  let t = i.current;
373
377
  if (!t) return;
374
- let n = _(t, P, re);
378
+ let n = v(t, ne, re);
375
379
  f.current = 0;
376
380
  let a = r?.bars ?? d, s = r?.axisLine ?? u.bd, c = r?.valueLabel ?? u.t2, l = {
377
381
  top: 24,
378
382
  right: 24,
379
383
  bottom: 56,
380
384
  left: 24
381
- }, h = re - l.top - l.bottom, y = (P - l.left - l.right) / Math.max(e.length, 1), b = Math.max(100, ...e.map((e) => e.pricing ?? 0)), x = l.top + h, S, C = () => {
385
+ }, m = re - l.top - l.bottom, _ = (ne - l.left - l.right) / Math.max(e.length, 1), b = Math.max(100, ...e.map((e) => e.pricing ?? 0)), x = l.top + m, S, C = () => {
382
386
  f.current++;
383
387
  let t = f.current;
384
- n.clearRect(0, 0, P, re);
385
- let r = D(Math.min(t / 48, 1));
386
- M(o.current, p.current), g.current = [], n.strokeStyle = m(s, .4), n.lineWidth = 1, n.setLineDash([]), n.beginPath(), n.moveTo(l.left, x), n.lineTo(P - l.right, x), n.stroke(), e.forEach((t, i) => {
387
- let s = l.left + i * y, d = j(r, i, e.length, D), f = b > 0 ? (t.pricing ?? 0) / b * h : 0, p = Math.max(f > 0 ? 4 : 0, f * d), _ = a[i % a.length], S = o.current.get(t.id ?? `bar-${i}`) ?? 0;
388
- T(g.current, t.id ?? `bar-${i}`, s + 4, x - p, y - 8, p, {
388
+ n.clearRect(0, 0, ne, re);
389
+ let r = O(Math.min(t / 48, 1));
390
+ N(o.current, p.current), g.current = [], n.strokeStyle = h(s, .4), n.lineWidth = 1, n.setLineDash([]), n.beginPath(), n.moveTo(l.left, x), n.lineTo(ne - l.right, x), n.stroke(), e.forEach((t, i) => {
391
+ let s = l.left + i * _, d = M(r, i, e.length, O), f = b > 0 ? (t.pricing ?? 0) / b * m : 0, p = Math.max(f > 0 ? 4 : 0, f * d), v = a[i % a.length], S = o.current.get(t.id ?? `bar-${i}`) ?? 0;
392
+ E(g.current, t.id ?? `bar-${i}`, s + 4, x - p, _ - 8, p, {
389
393
  label: t.vendor,
390
394
  value: String(t.pricing ?? 0),
391
- color: _
392
- }), p > 0 && (S > 0 && v(n, s + y / 2, x - p / 2, y * .8, _, .12 * S), n.shadowColor = m(_, .2 * (S > 0 ? S : 0)), n.shadowBlur = S > 0 ? 6 : 0, n.fillStyle = m(_, .5 + S * .25), n.beginPath(), n.roundRect(s + 4, x - p, y - 8, p, [
395
+ color: v
396
+ }), p > 0 && (S > 0 && y(n, s + _ / 2, x - p / 2, _ * .8, v, .12 * S), n.shadowColor = h(v, .2 * (S > 0 ? S : 0)), n.shadowBlur = S > 0 ? 6 : 0, n.fillStyle = h(v, .5 + S * .25), n.beginPath(), n.roundRect(s + 4, x - p, _ - 8, p, [
393
397
  4,
394
398
  4,
395
399
  0,
396
400
  0
397
- ]), n.fill(), n.shadowBlur = 0, S > 0 && (n.strokeStyle = m(_, .4 * S), n.lineWidth = 1, n.beginPath(), n.roundRect(s + 4, x - p, y - 8, p, [
401
+ ]), n.fill(), n.shadowBlur = 0, S > 0 && (n.strokeStyle = h(v, .4 * S), n.lineWidth = 1, n.beginPath(), n.roundRect(s + 4, x - p, _ - 8, p, [
398
402
  4,
399
403
  4,
400
404
  0,
401
405
  0
402
- ]), n.stroke())), d > .5 && p > 0 && (n.globalAlpha = Math.min(1, (d - .5) * 2), n.font = "bold 10px 'JetBrains Mono', monospace", n.fillStyle = S > 0 ? _ : m(c, .7), n.textAlign = "center", n.fillText(String(t.pricing ?? ""), s + y / 2, x - p - 6), n.globalAlpha = 1), n.font = `${S > 0 ? "bold " : ""}9px 'JetBrains Mono', monospace`, n.fillStyle = S > 0 ? _ : m(u.t3, .6), n.textAlign = "center", n.fillText(t.vendor, s + y / 2, re - 14);
406
+ ]), n.stroke())), d > .5 && p > 0 && (n.globalAlpha = Math.min(1, (d - .5) * 2), n.font = "bold 10px 'JetBrains Mono', monospace", n.fillStyle = S > 0 ? v : h(c, .7), n.textAlign = "center", n.fillText(String(t.pricing ?? ""), s + _ / 2, x - p - 6), n.globalAlpha = 1), n.font = `${S > 0 ? "bold " : ""}9px 'JetBrains Mono', monospace`, n.fillStyle = S > 0 ? v : h(u.t3, .6), n.textAlign = "center", n.fillText(t.vendor, s + _ / 2, re - 14);
403
407
  }), S = requestAnimationFrame(C);
404
408
  };
405
409
  return C(), () => cancelAnimationFrame(S);
@@ -408,7 +412,7 @@ function ie({ rows: e = [], className: t, colors: r }) {
408
412
  children: /* @__PURE__ */ c("div", {
409
413
  style: {
410
414
  position: "relative",
411
- width: P,
415
+ width: ne,
412
416
  height: re
413
417
  },
414
418
  children: [/* @__PURE__ */ s("canvas", {
@@ -416,14 +420,14 @@ function ie({ rows: e = [], className: t, colors: r }) {
416
420
  role: "img",
417
421
  "aria-label": "bar chart",
418
422
  style: {
419
- width: P,
423
+ width: ne,
420
424
  height: re,
421
425
  display: "block",
422
426
  borderRadius: 8
423
427
  }
424
- }), /* @__PURE__ */ s(S, {
425
- ...h,
426
- parentW: P,
428
+ }), /* @__PURE__ */ s(C, {
429
+ ...m,
430
+ parentW: ne,
427
431
  parentH: re
428
432
  })]
429
433
  })
@@ -431,7 +435,7 @@ function ie({ rows: e = [], className: t, colors: r }) {
431
435
  }
432
436
  //#endregion
433
437
  //#region src/components/common/ChartEmptyState.tsx
434
- function F({ width: e, height: t, message: n = "No data available", "data-testid": r }) {
438
+ function I({ width: e, height: t, message: n = "No data available", "data-testid": r }) {
435
439
  return /* @__PURE__ */ s("div", {
436
440
  "data-testid": r,
437
441
  style: {
@@ -494,10 +498,9 @@ function ae({ expanded: e, onToggle: t, labelExpanded: n = "View Less", labelCol
494
498
  }
495
499
  //#endregion
496
500
  //#region src/components/progressRaceChart/ProgressRaceChart.tsx
497
- var I = 680, L = 42, oe = 10, se = 24, ce = 24, le = 8, ue = [
501
+ var L = 680, R = 42, oe = 10, se = 24, ce = 24, le = 8, ue = [
498
502
  u.green,
499
503
  u.blue,
500
- u.cyan,
501
504
  u.amber,
502
505
  u.red
503
506
  ];
@@ -506,47 +509,47 @@ function de(e) {
506
509
  return t >= 1e6 ? `${n}£${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${n}£${(t / 1e3).toFixed(1)}K` : `${n}£${t.toFixed(0)}`;
507
510
  }
508
511
  function fe({ items: e = [], "data-testid": t }) {
509
- let r = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), [p, h] = o(!1), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), x = i(() => [...g].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [g]), T = i(() => p ? x : x.slice(0, le), [x, p]), D = T.length, O = se + ce + D * L + Math.max(0, D - 1) * oe, { hoveredRef: k, tooltip: A, hitZonesRef: j } = C(r, {
510
- width: I,
511
- height: O
512
+ let r = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), [m, g] = o(!1), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), S = i(() => [..._].sort((e, t) => (t.percentage ?? 0) - (e.percentage ?? 0)), [_]), E = i(() => m ? S : S.slice(0, le), [S, m]), O = E.length, k = se + ce + O * R + Math.max(0, O - 1) * oe, { hoveredRef: A, tooltip: j, hitZonesRef: M } = w(r, {
513
+ width: L,
514
+ height: k
512
515
  });
513
516
  return n(() => {
514
517
  let e = r.current;
515
518
  if (!e) return;
516
- let t = _(e, I, O);
519
+ let t = v(e, L, k);
517
520
  l.current = 0;
518
- let n = I * .13, i = I * .08, a = I - n - i, o, s = () => {
521
+ let n = L * .13, i = L * .08, a = L - n - i, o, s = () => {
519
522
  l.current++;
520
523
  let e = l.current;
521
- t.clearRect(0, 0, I, O), j.current = [], d.current.forEach((e, t) => {
522
- let n = t === k.current ? 1 : 0, r = e + (n - e) * .12;
524
+ t.clearRect(0, 0, L, k), t.letterSpacing = f.letterSpacing, M.current = [], d.current.forEach((e, t) => {
525
+ let n = t === A.current ? 1 : 0, r = e + (n - e) * .12;
523
526
  Math.abs(r - n) < .005 ? n === 0 ? d.current.delete(t) : d.current.set(t, 1) : d.current.set(t, r);
524
- }), k.current && !d.current.has(k.current) && d.current.set(k.current, 0), y(t, I, O, e, 40, m(u.blue, .04)), T.forEach((r, i) => {
525
- let o = ue[i % ue.length], s = d.current.get(r.id) ?? 0, c = se + i * (L + oe);
526
- t.fillStyle = m(o, .04 + s * .04), t.beginPath(), t.roundRect(n, c, a, L, 3), t.fill(), t.strokeStyle = m(o, .08), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(n, c + L / 2), t.lineTo(n + a, c + L / 2), t.stroke(), t.setLineDash([]);
527
- let l = (r.percentage ?? 0) / 100, u = n + a * Math.min(l, l * E(Math.min(1, e * .005)));
527
+ }), A.current && !d.current.has(A.current) && d.current.set(A.current, 0), b(t, L, k, e, 40, h(u.blue, .04)), E.forEach((r, i) => {
528
+ let o = ue[i % ue.length], s = d.current.get(r.id) ?? 0, c = se + i * (R + oe);
529
+ t.fillStyle = h(o, .04 + s * .04), t.beginPath(), t.roundRect(n, c, a, R, 3), t.fill(), t.strokeStyle = h(o, .08), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(n, c + R / 2), t.lineTo(n + a, c + R / 2), t.stroke(), t.setLineDash([]);
530
+ let l = (r.percentage ?? 0) / 100, u = n + a * Math.min(l, l * D(Math.min(1, e * .005)));
528
531
  if (u > n + 4) {
529
532
  let e = t.createLinearGradient(n, 0, u, 0);
530
- e.addColorStop(0, m(o, .02)), e.addColorStop(1, m(o, .25 + s * .15)), t.fillStyle = e, t.beginPath(), t.roundRect(n, c + 2, u - n, L - 4, 2), t.fill();
533
+ e.addColorStop(0, h(o, .02)), e.addColorStop(1, h(o, .25 + s * .15)), t.fillStyle = e, t.beginPath(), t.roundRect(n, c + 2, u - n, R - 4, 2), t.fill();
531
534
  }
532
- v(t, u, c + L / 2, 18 + s * 8, o, .3 + s * .2), t.beginPath(), t.arc(u, c + L / 2, 5 + s * 2, 0, Math.PI * 2), t.fillStyle = m(o, .9), t.fill();
533
- let p = {
535
+ y(t, u, c + R / 2, 18 + s * 8, o, .3 + s * .2), t.beginPath(), t.arc(u, c + R / 2, 5 + s * 2, 0, Math.PI * 2), t.fillStyle = h(o, .9), t.fill();
536
+ let m = {
534
537
  label: r.name,
535
538
  value: `${r.percentage ?? 0}% commitment`,
536
539
  sublabel: `Base: ${de(r.base ?? 0)} · Variations: ${de(r.variation ?? 0)}`,
537
540
  color: o
538
541
  };
539
- w(j.current, r.id, u, c + L / 2, 14, p), t.font = "bold " + f.font, t.fillStyle = m(o, .9 + s * .1), t.textAlign = "left", t.textBaseline = "middle", t.fillText(`${r.percentage ?? 0}%`, u + 10, c + L / 2), t.font = `${s > 0 ? "bold " : ""}` + f.font, t.fillStyle = s > 0 ? o : f.color, t.textAlign = "right", t.fillText(r.abbreviation ?? r.name.slice(0, 6), n - 8, c + L / 2);
540
- }), t.strokeStyle = m(u.t3, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(n + a, se), t.lineTo(n + a, se + (D - 1) * (L + oe) + L), t.stroke(), b(t, I, O, e, .015), o = requestAnimationFrame(s);
542
+ T(M.current, r.id, u, c + R / 2, 14, m), t.font = p.font, t.fillStyle = h(o, .9 + s * .1), t.textAlign = "left", t.textBaseline = "middle", t.fillText(`${r.percentage ?? 0}%`, u + 10, c + R / 2), t.font = `${s > 0 ? "bold " : ""}` + f.font, t.fillStyle = s > 0 ? o : f.color, t.textAlign = "right", t.fillText(r.abbreviation ?? r.name.slice(0, 6), n - 8, c + R / 2);
543
+ }), t.strokeStyle = h(u.t3, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(n + a, se), t.lineTo(n + a, se + (O - 1) * (R + oe) + R), t.stroke(), x(t, L, k, e, .015), o = requestAnimationFrame(s);
541
544
  };
542
545
  return s(), () => cancelAnimationFrame(o);
543
- }, [T, O]), x.length === 0 ? /* @__PURE__ */ s(F, {
544
- width: I,
546
+ }, [E, k]), S.length === 0 ? /* @__PURE__ */ s(I, {
547
+ width: L,
545
548
  height: 160,
546
549
  "data-testid": t
547
550
  }) : /* @__PURE__ */ c("div", {
548
551
  "data-testid": t,
549
- style: { width: I },
552
+ style: { width: L },
550
553
  children: [/* @__PURE__ */ c("div", {
551
554
  style: { position: "relative" },
552
555
  children: [/* @__PURE__ */ s("canvas", {
@@ -554,21 +557,21 @@ function fe({ items: e = [], "data-testid": t }) {
554
557
  role: "img",
555
558
  "aria-label": "Commitment race — contractors ranked by commitment percentage",
556
559
  style: {
557
- width: I,
558
- height: O,
560
+ width: L,
561
+ height: k,
559
562
  display: "block",
560
563
  borderRadius: 8
561
564
  }
562
- }), /* @__PURE__ */ s(S, {
563
- ...A,
564
- parentW: I,
565
- parentH: O
565
+ }), /* @__PURE__ */ s(C, {
566
+ ...j,
567
+ parentW: L,
568
+ parentH: k
566
569
  })]
567
- }), g.length > le && /* @__PURE__ */ s("div", {
570
+ }), _.length > le && /* @__PURE__ */ s("div", {
568
571
  style: { marginTop: 8 },
569
572
  children: /* @__PURE__ */ s(ae, {
570
- expanded: p,
571
- onToggle: () => h((e) => !e)
573
+ expanded: m,
574
+ onToggle: () => g((e) => !e)
572
575
  })
573
576
  })]
574
577
  });
@@ -581,14 +584,14 @@ function he({ value: e, confirmed: t, total: r, "data-testid": i }) {
581
584
  return n(() => {
582
585
  let n = o.current;
583
586
  if (!n) return;
584
- let i = _(n, pe, me);
587
+ let i = v(n, pe, me);
585
588
  c.current = 0;
586
- let a = pe / 2, s = Math.PI, l = 2 * Math.PI, d = Math.PI, p, h = () => {
589
+ let a = pe / 2, s = Math.PI, l = 2 * Math.PI, d = Math.PI, p, g = () => {
587
590
  c.current++;
588
591
  let n = c.current;
589
- i.clearRect(0, 0, pe, me);
590
- let o = E(Math.min(n / 80, 1)), g = k(Math.min(n / 72, 1));
591
- i.beginPath(), i.arc(a, 220, 120, s, l), i.strokeStyle = m(u.bd, .35), i.lineWidth = 46, i.stroke(), [
592
+ i.clearRect(0, 0, pe, me), i.letterSpacing = f.letterSpacing;
593
+ let o = D(Math.min(n / 80, 1)), _ = A(Math.min(n / 72, 1));
594
+ i.beginPath(), i.arc(a, 220, 120, s, l), i.strokeStyle = h(u.bd, .35), i.lineWidth = 46, i.stroke(), [
592
595
  {
593
596
  start: 0,
594
597
  end: .33,
@@ -606,7 +609,7 @@ function he({ value: e, confirmed: t, total: r, "data-testid": i }) {
606
609
  }
607
610
  ].forEach((e) => {
608
611
  let t = s + e.start * d, n = s + e.end * d;
609
- i.beginPath(), i.arc(a, 220, 194 / 2, t, n), i.strokeStyle = m(e.color, .12), i.lineWidth = 42, i.stroke();
612
+ i.beginPath(), i.arc(a, 220, 194 / 2, t, n), i.strokeStyle = h(e.color, .12), i.lineWidth = 42, i.stroke();
610
613
  }), [
611
614
  {
612
615
  label: "Low",
@@ -622,22 +625,22 @@ function he({ value: e, confirmed: t, total: r, "data-testid": i }) {
622
625
  }
623
626
  ].forEach(({ label: e, angle: t }) => {
624
627
  let n = a + Math.cos(t) * 166, r = 220 + Math.sin(t) * 166;
625
- i.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = m(u.t2, .55), i.textAlign = "center", i.fillText(e, n, r + 3);
628
+ i.font = f.font, i.fillStyle = h(u.t2, .55), i.textAlign = "center", i.fillText(e, n, r + 3);
626
629
  });
627
- let _ = s + e / 100 * d * o, y = e >= 66 ? u.green : e >= 33 ? u.amber : u.red;
628
- v(i, a + Math.cos(_) * 194 / 2, 220 + Math.sin(_) * 194 / 2, 18, y, .35 * o), i.beginPath(), i.arc(a, 220, 194 / 2, s, _), i.strokeStyle = m(y, .7 * o), i.lineWidth = 38, i.lineCap = "round", i.stroke(), i.lineCap = "butt";
629
- let b = s + e / 100 * d * g, x = a + Math.cos(b) * 82, S = 220 + Math.sin(b) * 82, C = a - Math.cos(b) * 14, w = 220 - Math.sin(b) * 14;
630
- i.strokeStyle = m(y, .18 * g), i.lineWidth = 6, i.lineCap = "round", i.beginPath(), i.moveTo(C, w), i.lineTo(x, S), i.stroke(), i.strokeStyle = m(u.t1, .92 * g), i.lineWidth = 2, i.lineCap = "round", i.beginPath(), i.moveTo(C, w), i.lineTo(x, S), i.stroke(), i.beginPath(), i.arc(x, S, 3, 0, Math.PI * 2), i.fillStyle = m(y, .9 * g), i.fill(), v(i, a, 220, 20, y, .25 * g), i.beginPath(), i.arc(a, 220, 9, 0, Math.PI * 2), i.strokeStyle = m(y, .5 * g), i.lineWidth = 1.5, i.stroke(), i.beginPath(), i.arc(a, 220, 5, 0, Math.PI * 2), i.fillStyle = u.t1, i.fill(), o > .5 && (i.globalAlpha = Math.min(1, (o - .5) / .5), i.font = "500 24px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = y, i.textAlign = "center", i.fillText(`${Math.round(e * g)}%`, a, 182), i.globalAlpha = 1), o > .7 && (i.globalAlpha = Math.min(1, (o - .7) / .3), i.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = f.color, i.textAlign = "center", i.fillText("NCEs confirmed", a, 252), i.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = f.color, i.fillText(`${t} of ${r} NCEs are confirmed compensation events`, a, 272), i.globalAlpha = 1);
630
+ let v = s + e / 100 * d * o, b = e >= 66 ? u.green : e >= 33 ? u.amber : u.red;
631
+ y(i, a + Math.cos(v) * 194 / 2, 220 + Math.sin(v) * 194 / 2, 18, b, .35 * o), i.beginPath(), i.arc(a, 220, 194 / 2, s, v), i.strokeStyle = h(b, .7 * o), i.lineWidth = 38, i.lineCap = "round", i.stroke(), i.lineCap = "butt";
632
+ let x = s + e / 100 * d * _, S = a + Math.cos(x) * 82, C = 220 + Math.sin(x) * 82, w = a - Math.cos(x) * 14, T = 220 - Math.sin(x) * 14;
633
+ i.strokeStyle = h(b, .18 * _), i.lineWidth = 6, i.lineCap = "round", i.beginPath(), i.moveTo(w, T), i.lineTo(S, C), i.stroke(), i.strokeStyle = h(u.t1, .92 * _), i.lineWidth = 2, i.lineCap = "round", i.beginPath(), i.moveTo(w, T), i.lineTo(S, C), i.stroke(), i.beginPath(), i.arc(S, C, 3, 0, Math.PI * 2), i.fillStyle = h(b, .9 * _), i.fill(), y(i, a, 220, 20, b, .25 * _), i.beginPath(), i.arc(a, 220, 9, 0, Math.PI * 2), i.strokeStyle = h(b, .5 * _), i.lineWidth = 1.5, i.stroke(), i.beginPath(), i.arc(a, 220, 5, 0, Math.PI * 2), i.fillStyle = u.t1, i.fill(), o > .5 && (i.globalAlpha = Math.min(1, (o - .5) / .5), i.font = "500 24px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = b, i.textAlign = "center", i.fillText(`${Math.round(e * _)}%`, a, 182), i.globalAlpha = 1), o > .7 && (i.globalAlpha = Math.min(1, (o - .7) / .3), i.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = f.color, i.textAlign = "center", i.fillText("NCEs confirmed", a, 252), i.font = m.font, i.fillStyle = f.color, i.fillText(`${t} of ${r} NCEs are confirmed compensation events`, a, 272), i.globalAlpha = 1);
631
634
  for (let e = 0; e <= 10; e++) {
632
635
  let t = s + e / 10 * d;
633
- if (i.strokeStyle = m(u.bd, .5), i.lineWidth = e % 5 == 0 ? 1.5 : .8, i.beginPath(), i.moveTo(a + Math.cos(t) * 122, 220 + Math.sin(t) * 122), i.lineTo(a + Math.cos(t) * 128, 220 + Math.sin(t) * 128), i.stroke(), e % 5 == 0) {
636
+ if (i.strokeStyle = h(u.bd, .5), i.lineWidth = e % 5 == 0 ? 1.5 : .8, i.beginPath(), i.moveTo(a + Math.cos(t) * 122, 220 + Math.sin(t) * 122), i.lineTo(a + Math.cos(t) * 128, 220 + Math.sin(t) * 128), i.stroke(), e % 5 == 0) {
634
637
  let n = a + Math.cos(t) * 138, r = 220 + Math.sin(t) * 138;
635
- i.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", i.fillStyle = m(u.t3, .45), i.textAlign = "center", i.fillText(`${e * 10}%`, n, r + 3);
638
+ i.font = f.font, i.fillStyle = h(u.t3, .45), i.textAlign = "center", i.fillText(`${e * 10}%`, n, r + 3);
636
639
  }
637
640
  }
638
- p = requestAnimationFrame(h);
641
+ p = requestAnimationFrame(g);
639
642
  };
640
- return h(), () => cancelAnimationFrame(p);
643
+ return g(), () => cancelAnimationFrame(p);
641
644
  }, [
642
645
  e,
643
646
  t,
@@ -664,7 +667,7 @@ function he({ value: e, confirmed: t, total: r, "data-testid": i }) {
664
667
  //#endregion
665
668
  //#region src/canvas/useCanvasLoop.ts
666
669
  function ge(e, t, r, i, o = !0, s = {}) {
667
- let c = a(0), { easing: l = E, durationFrames: u = 48 } = s;
670
+ let c = a(0), { easing: l = D, durationFrames: u = 48 } = s;
668
671
  n(() => {
669
672
  let n = e.current;
670
673
  if (!n || !t || !r) return;
@@ -695,29 +698,28 @@ function ge(e, t, r, i, o = !0, s = {}) {
695
698
  }
696
699
  //#endregion
697
700
  //#region src/components/multiMetricConstellationChart/MultiMetricConstellationChart.tsx
698
- var R = 780, z = 234, _e = 130, ve = 52, ye = [
701
+ var z = 780, _e = 234, ve = 130, ye = 52, be = [
699
702
  u.blue,
700
- u.cyan,
701
703
  u.amber,
702
704
  u.purple,
703
705
  u.green
704
- ], be = [
706
+ ], xe = [
705
707
  "Base Value",
706
708
  "Variations",
707
709
  "Commitment"
708
- ], xe = [
710
+ ], Se = [
709
711
  "Base",
710
712
  "Var",
711
713
  "Commit"
712
714
  ];
713
- function Se({ items: e = [], "data-testid": t }) {
714
- let n = a(null), r = a(/* @__PURE__ */ new Map()), { hoveredRef: o, tooltip: l, hitZonesRef: d } = C(n, {
715
- width: R,
716
- height: z
717
- }), f = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), p = i(() => {
718
- let e = Math.max(...f.map((e) => e.base ?? 0)), t = Math.max(...f.map((e) => e.variation ?? 0));
719
- return f.map((n, r) => {
720
- let i = R * (.12 + r * .19), a = _e, o = Math.min(R * .075, ve), s = ye[r % ye.length], c = [
715
+ function Ce({ items: e = [], "data-testid": t }) {
716
+ let n = a(null), r = a(/* @__PURE__ */ new Map()), { hoveredRef: o, tooltip: l, hitZonesRef: d } = w(n, {
717
+ width: z,
718
+ height: _e
719
+ }), p = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), g = i(() => {
720
+ let e = Math.max(...p.map((e) => e.base ?? 0)), t = Math.max(...p.map((e) => e.variation ?? 0));
721
+ return p.map((n, r) => {
722
+ let i = z * (.12 + r * .19), a = ve, o = Math.min(z * .075, ye), s = be[r % be.length], c = [
721
723
  (n.base ?? 0) / (e || 1) * 100,
722
724
  (n.variation ?? 0) / (t || 1) * 100,
723
725
  n.percentage ?? 0
@@ -726,10 +728,10 @@ function Se({ items: e = [], "data-testid": t }) {
726
728
  `£${n.variation ?? 0}M`,
727
729
  `${n.percentage ?? 0}%`
728
730
  ], u = c.map((e, t) => {
729
- let n = -Math.PI / 2 + t / be.length * Math.PI * 2, r = e / 100, s = o * Math.max(.08, r);
731
+ let n = -Math.PI / 2 + t / xe.length * Math.PI * 2, r = e / 100, s = o * Math.max(.08, r);
730
732
  return {
731
- name: be[t],
732
- short: xe[t],
733
+ name: xe[t],
734
+ short: Se[t],
733
735
  label: l[t],
734
736
  val: Math.round(e),
735
737
  x: i + Math.cos(n) * s,
@@ -748,61 +750,60 @@ function Se({ items: e = [], "data-testid": t }) {
748
750
  color: s
749
751
  };
750
752
  });
751
- }, [f]);
752
- return ge(n, R, z, (e, t, n) => {
753
- M(r.current, o.current), d.current = [], y(e, R, z, n, 30), p.forEach((t, i) => {
753
+ }, [p]);
754
+ return ge(n, z, _e, (e, t, n) => {
755
+ N(r.current, o.current), d.current = [], b(e, z, _e, n, 30), g.forEach((t, i) => {
754
756
  let a = t.color, o = `constellation-${i}`, s = r.current.get(o) ?? 0;
755
- e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 5, 0, Math.PI * 2), e.strokeStyle = m(u.bd, .08 + .08 * s), e.lineWidth = .5, e.stroke(), e.beginPath(), t.stars.forEach((t, n) => {
757
+ e.beginPath(), e.arc(t.cx, t.cy, t.baseR + 5, 0, Math.PI * 2), e.strokeStyle = h(u.bd, .08 + .08 * s), e.lineWidth = .5, e.stroke(), e.beginPath(), t.stars.forEach((t, n) => {
756
758
  n === 0 ? e.moveTo(t.x, t.y) : e.lineTo(t.x, t.y);
757
- }), e.closePath(), e.fillStyle = m(a, .04 + .03 * s), e.fill(), e.strokeStyle = m(a, .15 + .1 * s), e.lineWidth = .8, e.stroke(), t.stars.forEach((o, s) => {
758
- let c = A(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);
759
- p.addColorStop(0, m(a, (.2 + .1 * f) * c)), p.addColorStop(1, m(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 = m(a, (.8 + .2 * f) * c), e.fill();
760
- let h = Math.sin(o.angle) < -.3;
761
- e.textAlign = "center", e.textBaseline = "middle", h ? (e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = m(a, .5 + .15 * f), e.fillText(o.short, o.x, o.y - 24), e.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = m(a, .8 + .15 * f), e.fillText(o.label, o.x, o.y - 11)) : (e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = m(a, .5 + .15 * f), e.fillText(o.short, o.x, o.y + 11), e.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = m(a, .8 + .15 * f), e.fillText(o.label, o.x, o.y + 24)), w(d.current, u, o.x, o.y, l * 4 + 2, {
759
+ }), e.closePath(), e.fillStyle = h(a, .04 + .03 * s), e.fill(), e.strokeStyle = h(a, .15 + .1 * s), e.lineWidth = .8, e.stroke(), t.stars.forEach((o, s) => {
760
+ let c = j(n, .05, 5e-4) * .3 + .7, l = 3.5 * c, u = `star-${i}-${s}`, p = r.current.get(u) ?? 0, m = e.createRadialGradient(o.x, o.y, 0, o.x, o.y, l * 4);
761
+ m.addColorStop(0, h(a, (.2 + .1 * p) * c)), m.addColorStop(1, h(a, 0)), e.fillStyle = m, 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 + p * 2, 0, Math.PI * 2), e.fillStyle = h(a, (.8 + .2 * p) * c), e.fill();
762
+ let g = Math.sin(o.angle) < -.3;
763
+ e.textAlign = "center", e.textBaseline = "middle", g ? (e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = h(a, .5 + .15 * p), e.fillText(o.short, o.x, o.y - 24), e.font = f.font, e.fillStyle = h(a, .8 + .15 * p), e.fillText(o.label, o.x, o.y - 11)) : (e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = h(a, .5 + .15 * p), e.fillText(o.short, o.x, o.y + 11), e.font = f.font, e.fillStyle = h(a, .8 + .15 * p), e.fillText(o.label, o.x, o.y + 24)), T(d.current, u, o.x, o.y, l * 4 + 2, {
762
764
  label: o.name,
763
765
  value: o.label,
764
766
  sublabel: t.abbreviation ?? t.name.slice(0, 6),
765
767
  color: a
766
768
  });
767
- }), s > 0 && v(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 = m(a, .1 + A(n, .03, 5e-4) * .05), e.lineWidth = 1, e.stroke(), e.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.textAlign = "center", e.textBaseline = "alphabetic", e.fillStyle = m(u.t2, .65 + s * .25), e.fillText(t.abbreviation ?? t.name.slice(0, 6), t.cx, t.cy + t.baseR + 26), w(d.current, o, t.cx, t.cy, t.baseR + 5, {
769
+ }), s > 0 && y(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 = h(a, .1 + j(n, .03, 5e-4) * .05), e.lineWidth = 1, e.stroke(), e.font = f.font, e.textAlign = "center", e.textBaseline = "alphabetic", e.fillStyle = s > 0 ? t.color : f.color, e.fillText(t.abbreviation ?? t.name.slice(0, 6), t.cx, t.cy + t.baseR + 26), T(d.current, o, t.cx, t.cy, t.baseR + 5, {
768
770
  label: t.name,
769
771
  value: `£${t.total ?? 0}M total`,
770
772
  sublabel: `${t.percentage ?? 0}% committed · scatter ${t.scatter.toFixed(1)}`,
771
773
  color: a
772
774
  });
773
- }), e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillStyle = u.t2, e.fillText("▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details", R / 2, z - 14), b(e, R, z, n, .012);
774
- }, !0), p.length === 0 ? /* @__PURE__ */ s(F, {
775
- width: R,
776
- height: z,
775
+ }), e.font = m.font, e.textAlign = "center", e.textBaseline = "middle", e.fillStyle = m.color, e.fillText("▲ top = Base value · ▼▸ lower-right = Variations · ◂▼ lower-left = Commitment % · hover stars for details", z / 2, _e - 14), x(e, z, _e, n, .012);
776
+ }, !0), g.length === 0 ? /* @__PURE__ */ s(I, {
777
+ width: z,
778
+ height: _e,
777
779
  "data-testid": t
778
780
  }) : /* @__PURE__ */ c("div", {
779
781
  "data-testid": t,
780
782
  style: {
781
783
  position: "relative",
782
- width: R,
783
- height: z
784
+ width: z,
785
+ height: _e
784
786
  },
785
787
  children: [/* @__PURE__ */ s("canvas", {
786
788
  ref: n,
787
789
  role: "img",
788
790
  "aria-label": "Contract value breakdown per contractor — multi-KPI constellation chart",
789
791
  style: {
790
- width: R,
791
- height: z,
792
+ width: z,
793
+ height: _e,
792
794
  display: "block"
793
795
  }
794
- }), /* @__PURE__ */ s(S, {
796
+ }), /* @__PURE__ */ s(C, {
795
797
  ...l,
796
- parentW: R,
797
- parentH: z
798
+ parentW: z,
799
+ parentH: _e
798
800
  })]
799
801
  });
800
802
  }
801
803
  //#endregion
802
804
  //#region src/components/stackedHorizontalBarChart/StackedHorizontalBarChart.tsx
803
- var Ce = 680, we = 220, Te = 8, Ee = [
805
+ var we = 680, Te = 220, Ee = 8, De = [
804
806
  u.blue,
805
- u.cyan,
806
807
  u.amber,
807
808
  u.purple,
808
809
  u.green
@@ -811,42 +812,42 @@ var Ce = 680, we = 220, Te = 8, Ee = [
811
812
  right: 80,
812
813
  top: 16,
813
814
  bottom: 38
814
- }, De = 88, V = 18;
815
- function Oe(e) {
815
+ }, Oe = 88, V = 18;
816
+ function ke(e) {
816
817
  let t = Math.abs(e), n = e < 0 ? "-" : "";
817
818
  return t >= 1e6 ? `${n}£${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${n}£${(t / 1e3).toFixed(1)}K` : `${n}£${t.toFixed(0)}`;
818
819
  }
819
- function ke({ data: e, "data-testid": t }) {
820
- let n = a(null), r = a(/* @__PURE__ */ new Map()), [i, l] = o(!1), { items: d = [], totals: h } = e, g = d.filter((e) => typeof e == "object" && !!e), _ = [...g].sort((e, t) => (t.total ?? 0) - (e.total ?? 0)), y = i ? _ : _.slice(0, Te), b = y.length, x = Math.max(..._.map((e) => Math.abs(e.total ?? 0)), 1), w = Math.max(we, B.top + B.bottom + b * V + Math.max(0, b - 1) * 8), E = Ce - B.left - De - B.right, O = b > 1 ? (w - B.top - B.bottom - b * V) / (b - 1) : 0, k = g.length === 0, { hoveredRef: A, tooltip: ee, hitZonesRef: N } = C(n, {
821
- width: Ce,
822
- height: w
820
+ function Ae({ data: e, "data-testid": t }) {
821
+ let n = a(null), r = a(/* @__PURE__ */ new Map()), [i, l] = o(!1), { items: d = [], totals: p } = e, g = d.filter((e) => typeof e == "object" && !!e), _ = [...g].sort((e, t) => (t.total ?? 0) - (e.total ?? 0)), v = i ? _ : _.slice(0, Ee), b = v.length, x = Math.max(..._.map((e) => Math.abs(e.total ?? 0)), 1), S = Math.max(Te, B.top + B.bottom + b * V + Math.max(0, b - 1) * 8), T = we - B.left - Oe - B.right, D = b > 1 ? (S - B.top - B.bottom - b * V) / (b - 1) : 0, k = g.length === 0, { hoveredRef: A, tooltip: j, hitZonesRef: P } = w(n, {
822
+ width: we,
823
+ height: S
823
824
  });
824
- return ge(n, Ce, w, (e, t) => {
825
- M(r.current, A.current), N.current = [], y.forEach((n, i) => {
826
- let a = Ee[i % Ee.length], o = j(t, i, b, D), s = B.top + i * (V + O), c = B.left + De, l = r.current.get(n.id) ?? 0, d = Math.max(n.base ?? 0, 0), p = Math.max(n.total ?? 0, 0), h = d / x * E * o, g = p / x * E * o, _ = g - h;
827
- e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(n.abbreviation ?? n.name.slice(0, 6), c - 8, s + V / 2), e.fillStyle = m(u.bd, .25), e.beginPath(), e.roundRect(c, s, E, V, 4), e.fill(), h > 0 && (l > 0 && v(e, c + h / 2, s + V / 2, h * .3, a, .1 * l), e.fillStyle = m(a, .5 + l * .15), e.beginPath(), e.roundRect(c, s, h, V, 4), e.fill()), _ > 2 && (e.fillStyle = m(a, .22 + l * .08), e.beginPath(), e.roundRect(c + h, s, _, V, [
825
+ return ge(n, we, S, (e, t) => {
826
+ N(r.current, A.current), P.current = [], v.forEach((n, i) => {
827
+ let a = De[i % De.length], o = M(t, i, b, O), s = B.top + i * (V + D), c = B.left + Oe, l = r.current.get(n.id) ?? 0, d = Math.max(n.base ?? 0, 0), p = Math.max(n.total ?? 0, 0), m = d / x * T * o, g = p / x * T * o, _ = g - m;
828
+ e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = l > 0 ? a : f.color, e.textAlign = "right", e.textBaseline = "middle", e.fillText(n.abbreviation ?? n.name.slice(0, 6), c - 8, s + V / 2), e.fillStyle = h(u.bd, .25), e.beginPath(), e.roundRect(c, s, T, V, 4), e.fill(), m > 0 && (l > 0 && y(e, c + m / 2, s + V / 2, m * .3, a, .1 * l), e.fillStyle = h(a, .5 + l * .15), e.beginPath(), e.roundRect(c, s, m, V, 4), e.fill()), _ > 2 && (e.fillStyle = h(a, .22 + l * .08), e.beginPath(), e.roundRect(c + m, s, _, V, [
828
829
  0,
829
830
  4,
830
831
  4,
831
832
  0
832
- ]), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = m(a, .55), e.lineWidth = 1, e.beginPath(), e.moveTo(c + h, s + 3), e.lineTo(c + h, s + V - 3), e.stroke(), e.setLineDash([])), l > 0 && g > 0 && (e.strokeStyle = m(a, .5 * l), e.lineWidth = 1, e.setLineDash([]), e.beginPath(), e.roundRect(c, s, g, V, 4), e.stroke()), o > .35 && (e.globalAlpha = Math.min(1, (o - .35) / .4), e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = l > 0 ? a : "#F7F9FA", e.textAlign = "left", e.textBaseline = "middle", e.fillText(Oe(n.total ?? 0), c + g + 6, s + V / 2), e.globalAlpha = 1), T(N.current, n.id, c, s, Math.max(g, 1), V, {
833
+ ]), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(a, .55), e.lineWidth = 1, e.beginPath(), e.moveTo(c + m, s + 3), e.lineTo(c + m, s + V - 3), e.stroke(), e.setLineDash([])), l > 0 && g > 0 && (e.strokeStyle = h(a, .5 * l), e.lineWidth = 1, e.setLineDash([]), e.beginPath(), e.roundRect(c, s, g, V, 4), e.stroke()), o > .35 && (e.globalAlpha = Math.min(1, (o - .35) / .4), e.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.fillStyle = l > 0 ? a : "#F7F9FA", e.textAlign = "left", e.textBaseline = "middle", e.fillText(ke(n.total ?? 0), c + g + 6, s + V / 2), e.globalAlpha = 1), E(P.current, n.id, c, s, Math.max(g, 1), V, {
833
834
  label: n.name,
834
- value: `${Oe(n.total ?? 0)} total`,
835
- sublabel: `Base ${Oe(n.base ?? 0)} + Var ${Oe(n.variation ?? 0)} · ${n.percentage ?? 0}% committed`,
835
+ value: `${ke(n.total ?? 0)} total`,
836
+ sublabel: `Base ${ke(n.base ?? 0)} + Var ${ke(n.variation ?? 0)} · ${n.percentage ?? 0}% committed`,
836
837
  color: a
837
838
  });
838
839
  });
839
- let n = w - 14;
840
- e.textBaseline = "middle", e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.textAlign = "left", e.fillStyle = m(u.cyan, .5), e.beginPath(), e.roundRect(B.left + De, n - 3, 14, 6, 2), e.fill(), e.fillStyle = p.color, e.fillText("base value", B.left + De + 18, n), e.fillStyle = m(u.cyan, .22), e.beginPath(), e.roundRect(B.left + De + 94, n - 3, 14, 6, 2), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = m(u.cyan, .5), e.lineWidth = .5, e.beginPath(), e.moveTo(B.left + De + 101, n - 3), e.lineTo(B.left + De + 101, n + 3), e.stroke(), e.setLineDash([]), e.fillStyle = p.color, e.fillText("approved variations", B.left + De + 112, n), e.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", e.textAlign = "right", e.fillStyle = p.color, e.fillText(`Portfolio: ${Oe(h?.total ?? 0)}`, Ce - 8, n);
841
- }, !0, { easing: D }), k ? /* @__PURE__ */ s(F, {
842
- width: Ce,
843
- height: we,
840
+ let n = S - 14;
841
+ e.textBaseline = "middle", e.font = m.font, e.textAlign = "left", e.fillStyle = h(u.blue, .5), e.beginPath(), e.roundRect(B.left + Oe, n - 3, 14, 6, 2), e.fill(), e.fillStyle = m.color, e.fillText("base value", B.left + Oe + 18, n), e.fillStyle = h(u.blue, .22), e.beginPath(), e.roundRect(B.left + Oe + 94, n - 3, 14, 6, 2), e.fill(), e.setLineDash([2, 3]), e.strokeStyle = h(u.blue, .5), e.lineWidth = .5, e.beginPath(), e.moveTo(B.left + Oe + 101, n - 3), e.lineTo(B.left + Oe + 101, n + 3), e.stroke(), e.setLineDash([]), e.fillStyle = m.color, e.fillText("approved variations", B.left + Oe + 112, n), e.font = m.font, e.textAlign = "right", e.fillStyle = m.color, e.fillText(`Portfolio: ${ke(p?.total ?? 0)}`, we - 8, n);
842
+ }, !0, { easing: O }), k ? /* @__PURE__ */ s(I, {
843
+ width: we,
844
+ height: Te,
844
845
  message: "No contract data available",
845
846
  "data-testid": t
846
847
  }) : /* @__PURE__ */ c("div", {
847
848
  "data-testid": t,
848
849
  style: {
849
- width: Ce,
850
+ width: we,
850
851
  transition: "all 0.25s ease"
851
852
  },
852
853
  children: [/* @__PURE__ */ c("div", {
@@ -856,17 +857,17 @@ function ke({ data: e, "data-testid": t }) {
856
857
  role: "img",
857
858
  "aria-label": "Total contract value per contractor — horizontal bar chart",
858
859
  style: {
859
- width: Ce,
860
- height: w,
860
+ width: we,
861
+ height: S,
861
862
  display: "block",
862
863
  borderRadius: 8
863
864
  }
864
- }), /* @__PURE__ */ s(S, {
865
- ...ee,
866
- parentW: Ce,
867
- parentH: w
865
+ }), /* @__PURE__ */ s(C, {
866
+ ...j,
867
+ parentW: we,
868
+ parentH: S
868
869
  })]
869
- }), g.length > Te && /* @__PURE__ */ s("div", {
870
+ }), g.length > Ee && /* @__PURE__ */ s("div", {
870
871
  style: { marginTop: 8 },
871
872
  children: /* @__PURE__ */ s(ae, {
872
873
  expanded: i,
@@ -877,53 +878,53 @@ function ke({ data: e, "data-testid": t }) {
877
878
  }
878
879
  //#endregion
879
880
  //#region src/components/rankedCardLeaderboard/RankedCardLeaderboard.tsx
880
- var Ae = 780, H = 240, je = 12, Me = 10, Ne = [
881
+ var je = 780, H = 240, Me = 12, Ne = 10, Pe = [
881
882
  "Highest exposure",
882
883
  "Elevated risk",
883
884
  "Moderate exposure",
884
885
  "Moderate exposure",
885
886
  "Low exposure"
886
887
  ];
887
- function Pe({ items: e = [], "data-testid": t }) {
888
- let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: p, tooltip: h, hitZonesRef: g } = C(r, {
889
- width: Ae,
888
+ function Fe({ items: e = [], "data-testid": t }) {
889
+ let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(r, {
890
+ width: je,
890
891
  height: H
891
- }), y = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), x = y.reduce((e, t) => e + (t.count ?? 0), 0);
892
+ }), b = [...i(() => e.filter((e) => typeof e == "object" && !!e), [e])].sort((e, t) => (t.count ?? 0) - (e.count ?? 0)).slice(0, 5), S = b.reduce((e, t) => e + (t.count ?? 0), 0);
892
893
  return n(() => {
893
894
  let e = r.current;
894
895
  if (!e) return;
895
- let t = _(e, Ae, H);
896
+ let t = v(e, je, H);
896
897
  o.current = 0;
897
- let n = Math.min(5, y.length), i = (Ae - 2 * je - (n - 1) * Me) / n, a = H * .84, s = H * .08, c, h = () => {
898
+ let n = Math.min(5, b.length), i = (je - 2 * Me - (n - 1) * Ne) / n, a = H * .84, s = H * .08, c, g = () => {
898
899
  o.current++;
899
900
  let e = o.current;
900
- t.clearRect(0, 0, Ae, H), g.current = [], l.current.forEach((e, t) => {
901
- let n = t === p.current ? 1 : 0, r = e + (n - e) * .12;
901
+ t.clearRect(0, 0, je, H), t.letterSpacing = f.letterSpacing, _.current = [], l.current.forEach((e, t) => {
902
+ let n = t === m.current ? 1 : 0, r = e + (n - e) * .12;
902
903
  Math.abs(r - n) < .005 ? n === 0 ? l.current.delete(t) : l.current.set(t, 1) : l.current.set(t, r);
903
- }), p.current && !l.current.has(p.current) && l.current.set(p.current, 0), y.forEach((n, r) => {
904
- let o = r === 0, c = r === 0 ? u.red : r === 1 ? u.amber : d[r % d.length], p = je + r * (i + Me), h = l.current.get(n.id) ?? 0, _ = h * 8, y = p - _ / 2, b = i + _, S = o ? A(e, .04, 3e-4) * .06 + .06 : 0;
905
- t.fillStyle = m(c, .08 + h * .07), t.beginPath(), t.roundRect(y, s, b, a, 6), t.fill(), t.strokeStyle = m(c, .2 + h * .4 + S), t.lineWidth = o ? 1.5 : 1, t.stroke(), (h > .01 || o) && v(t, y + b / 2, s + a / 2, b * .55, c, S + h * .14), t.font = "bold " + f.font, t.textAlign = "left", t.textBaseline = "top", t.fillStyle = m(c, .5 + h * .35), t.fillText(`#${r + 1}`, y + 7, s + 6);
906
- let C = Math.min(i * .28, a * .32, 72), w = y + b / 2, E = s + a * .38, D = t.createRadialGradient(w, E - C * .2, 0, w, E, C);
907
- D.addColorStop(0, m(c, .5 + h * .2)), D.addColorStop(1, m(c, .2 + h * .1)), t.beginPath(), t.arc(w, E, C, 0, Math.PI * 2), t.fillStyle = D, t.fill(), t.strokeStyle = m(c, .4 + h * .3), t.lineWidth = 1, t.stroke(), t.font = "bold " + f.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = m(u.t1, .9), t.fillText(n.abbreviation ?? n.name.slice(0, 6), w, E), t.font = "bold 14px 'Satoshi Variable', 'DM Sans', sans-serif", t.textBaseline = "alphabetic", t.fillStyle = m(c, .9 + h * .1), t.fillText(String(n.count ?? 0), w, s + a * .76), t.font = f.font, t.fillStyle = f.color, t.fillText("open EWs", w, s + a * .88);
908
- let O = Math.round((n.count ?? 0) / (x || 1) * 100), k = Ne[r] ?? "Low exposure";
909
- T(g.current, n.id, p, s, i, a, {
904
+ }), m.current && !l.current.has(m.current) && l.current.set(m.current, 0), b.forEach((n, r) => {
905
+ let o = r === 0, c = r === 0 ? u.red : r === 1 ? u.amber : d[r % d.length], m = Me + r * (i + Ne), g = l.current.get(n.id) ?? 0, v = g * 8, b = m - v / 2, x = i + v, C = o ? j(e, .04, 3e-4) * .06 + .06 : 0;
906
+ t.fillStyle = h(c, .08 + g * .07), t.beginPath(), t.roundRect(b, s, x, a, 6), t.fill(), t.strokeStyle = h(c, .2 + g * .4 + C), t.lineWidth = o ? 1.5 : 1, t.stroke(), (g > .01 || o) && y(t, b + x / 2, s + a / 2, x * .55, c, C + g * .14), t.font = p.font, t.textAlign = "left", t.textBaseline = "top", t.fillStyle = h(c, .5 + g * .35), t.fillText(`#${r + 1}`, b + 7, s + 6);
907
+ let w = Math.min(i * .28, a * .32, 72), T = b + x / 2, D = s + a * .38, O = t.createRadialGradient(T, D - w * .2, 0, T, D, w);
908
+ O.addColorStop(0, h(c, .5 + g * .2)), O.addColorStop(1, h(c, .2 + g * .1)), t.beginPath(), t.arc(T, D, w, 0, Math.PI * 2), t.fillStyle = O, t.fill(), t.strokeStyle = h(c, .4 + g * .3), t.lineWidth = 1, t.stroke(), t.font = p.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(u.t1, .9), t.fillText(n.abbreviation ?? n.name.slice(0, 6), T, D), t.font = p.font, t.textBaseline = "alphabetic", t.fillStyle = h(c, .9 + g * .1), t.fillText(String(n.count ?? 0), T, s + a * .76), t.font = f.font, t.fillStyle = f.color, t.fillText("open EWs", T, s + a * .88);
909
+ let k = Math.round((n.count ?? 0) / (S || 1) * 100), A = Pe[r] ?? "Low exposure";
910
+ E(_.current, n.id, m, s, i, a, {
910
911
  label: n.name,
911
- value: `${n.count ?? 0} open · ${O}% of total`,
912
- sublabel: `Rank #${r + 1} · ${k}`,
912
+ value: `${n.count ?? 0} open · ${k}% of total`,
913
+ sublabel: `Rank #${r + 1} · ${A}`,
913
914
  color: c
914
915
  });
915
- }), b(t, Ae, H, e, .015), c = requestAnimationFrame(h);
916
+ }), x(t, je, H, e, .015), c = requestAnimationFrame(g);
916
917
  };
917
- return h(), () => cancelAnimationFrame(c);
918
- }, [y, x]), y.length === 0 ? /* @__PURE__ */ s(F, {
919
- width: Ae,
918
+ return g(), () => cancelAnimationFrame(c);
919
+ }, [b, S]), b.length === 0 ? /* @__PURE__ */ s(I, {
920
+ width: je,
920
921
  height: H,
921
922
  "data-testid": t
922
923
  }) : /* @__PURE__ */ c("div", {
923
924
  "data-testid": t,
924
925
  style: {
925
926
  position: "relative",
926
- width: Ae,
927
+ width: je,
927
928
  height: H
928
929
  },
929
930
  children: [/* @__PURE__ */ s("canvas", {
@@ -931,14 +932,14 @@ function Pe({ items: e = [], "data-testid": t }) {
931
932
  role: "img",
932
933
  "aria-label": "Contractor rank — open EW count per contractor",
933
934
  style: {
934
- width: Ae,
935
+ width: je,
935
936
  height: H,
936
937
  display: "block",
937
938
  borderRadius: 8
938
939
  }
939
- }), /* @__PURE__ */ s(S, {
940
- ...h,
941
- parentW: Ae,
940
+ }), /* @__PURE__ */ s(C, {
941
+ ...g,
942
+ parentW: je,
942
943
  parentH: H
943
944
  })]
944
945
  });
@@ -946,44 +947,44 @@ function Pe({ items: e = [], "data-testid": t }) {
946
947
  //#endregion
947
948
  //#region src/components/dotMatrixChart/DotMatrixChart.tsx
948
949
  var U = 680, W = 260;
949
- function Fe({ items: e = [], "data-testid": t }) {
950
- let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: f, hitZonesRef: p } = C(r, {
950
+ function Ie({ items: e = [], "data-testid": t }) {
951
+ let r = a(null), o = a(0), l = a(/* @__PURE__ */ new Map()), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
951
952
  width: U,
952
953
  height: W
953
- }), h = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
954
+ }), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
954
955
  return n(() => {
955
956
  let e = r.current;
956
957
  if (!e) return;
957
- let t = _(e, U, W);
958
+ let t = v(e, U, W);
958
959
  o.current = 0;
959
- let n = h.length, i = Math.max(...h.map((e) => e.count), 1), a = i, s = U * .05, c = W * .1, f = U * .9 / n, g = W * .7 / a, x = h.reduce((e, t) => e + t.count, 0), S, C = () => {
960
+ let n = g.length, i = Math.max(...g.map((e) => e.count), 1), a = i, s = U * .05, c = W * .1, p = U * .9 / n, _ = W * .7 / a, S = g.reduce((e, t) => e + t.count, 0), C, w = () => {
960
961
  o.current++;
961
962
  let e = o.current;
962
- t.clearRect(0, 0, U, W), p.current = [], l.current.forEach((e, t) => {
963
+ t.clearRect(0, 0, U, W), m.current = [], l.current.forEach((e, t) => {
963
964
  let n = t === d.current ? 1 : 0, r = e + (n - e) * .12;
964
965
  Math.abs(r - n) < .005 ? n === 0 ? l.current.delete(t) : l.current.set(t, 1) : l.current.set(t, r);
965
- }), d.current && !l.current.has(d.current) && l.current.set(d.current, 0), y(t, U, W, e, 40, m(u.blue, .04)), h.forEach((n, r) => {
966
- let o = n.count === i, d = o ? u.cyan : u.blue, h = l.current.get(`${n.category}-col`) ?? 0;
966
+ }), d.current && !l.current.has(d.current) && l.current.set(d.current, 0), b(t, U, W, e, 40, h(u.blue, .04)), g.forEach((n, r) => {
967
+ let o = n.count === i, d = u.blue, g = l.current.get(`${n.category}-col`) ?? 0;
967
968
  for (let u = 0; u < a; u++) {
968
- let a = s + r * f + f / 2, _ = c + u * g + g / 2, y = Math.min(f, g) * .38;
969
+ let a = s + r * p + p / 2, f = c + u * _ + _ / 2, v = Math.min(p, _) * .38;
969
970
  if (u >= i - n.count) {
970
- let i = y * (1 + (A(e, .04, 5e-4) + Math.sin(r * .6 + u * 1.2) * .3) * .12);
971
- (o || h > .01) && v(t, a, _, i * 3, d, (o ? .2 : .1) + h * .1), t.beginPath(), t.arc(a, _, i, 0, Math.PI * 2), t.fillStyle = m(d, o ? .8 : .5 + h * .2), t.fill();
971
+ let i = v * (1 + (j(e, .04, 5e-4) + Math.sin(r * .6 + u * 1.2) * .3) * .12);
972
+ (o || g > .01) && y(t, a, f, i * 3, d, (o ? .2 : .1) + g * .1), t.beginPath(), t.arc(a, f, i, 0, Math.PI * 2), t.fillStyle = h(d, o ? .8 : .5 + g * .2), t.fill();
972
973
  let s = `${n.category}-${u}`;
973
- w(p.current, s, a, _, y + 4, {
974
+ T(m.current, s, a, f, v + 4, {
974
975
  label: n.fullName,
975
976
  value: `${n.count} Early Warnings`,
976
- sublabel: `${Math.round(n.count / x * 100)}% of total`,
977
+ sublabel: `${Math.round(n.count / S * 100)}% of total`,
977
978
  color: d
978
979
  }), l.current.get(`${n.category}-col`);
979
- } else t.beginPath(), t.arc(a, _, 1, 0, Math.PI * 2), t.fillStyle = m(d, .08), t.fill();
980
+ } else t.beginPath(), t.arc(a, f, 1, 0, Math.PI * 2), t.fillStyle = h(d, .08), t.fill();
980
981
  }
981
- let _ = c + a * g + 16;
982
- t.font = `${o ? "bold " : ""}14px 'Satoshi Variable', 'DM Sans', sans-serif`, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = o ? u.cyan : m(u.t2, .65), t.fillText(n.category, s + r * f + f / 2, _);
983
- }), b(t, U, W, e, .015), S = requestAnimationFrame(C);
982
+ let v = c + a * _ + 16;
983
+ t.font = f.font, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = o ? u.blue : h(u.t2, .65), t.fillText(n.category, s + r * p + p / 2, v);
984
+ }), x(t, U, W, e, .015), C = requestAnimationFrame(w);
984
985
  };
985
- return C(), () => cancelAnimationFrame(S);
986
- }, [h]), h.length === 0 ? /* @__PURE__ */ s(F, {
986
+ return w(), () => cancelAnimationFrame(C);
987
+ }, [g]), g.length === 0 ? /* @__PURE__ */ s(I, {
987
988
  width: U,
988
989
  height: W,
989
990
  "data-testid": t
@@ -1004,8 +1005,8 @@ function Fe({ items: e = [], "data-testid": t }) {
1004
1005
  display: "block",
1005
1006
  borderRadius: 8
1006
1007
  }
1007
- }), /* @__PURE__ */ s(S, {
1008
- ...f,
1008
+ }), /* @__PURE__ */ s(C, {
1009
+ ...p,
1009
1010
  parentW: U,
1010
1011
  parentH: W
1011
1012
  })]
@@ -1013,8 +1014,8 @@ function Fe({ items: e = [], "data-testid": t }) {
1013
1014
  }
1014
1015
  //#endregion
1015
1016
  //#region src/components/lineChart/LineChart.tsx
1016
- function Ie({ rows: e = [], className: t, colors: n }) {
1017
- return /* @__PURE__ */ s(te, {
1017
+ function Le({ rows: e = [], className: t, colors: n }) {
1018
+ return /* @__PURE__ */ s(ee, {
1018
1019
  rows: e,
1019
1020
  variant: "line",
1020
1021
  className: t,
@@ -1023,7 +1024,7 @@ function Ie({ rows: e = [], className: t, colors: n }) {
1023
1024
  }
1024
1025
  //#endregion
1025
1026
  //#region src/components/constants.ts
1026
- var Le = [
1027
+ var Re = [
1027
1028
  "#4C93D9",
1028
1029
  "#5DA537",
1029
1030
  "#F3862C",
@@ -1031,7 +1032,7 @@ var Le = [
1031
1032
  "#A0B724",
1032
1033
  "#EEBF3B",
1033
1034
  "#3C45D1"
1034
- ], Re = {
1035
+ ], ze = {
1035
1036
  nodes: [
1036
1037
  {
1037
1038
  id: "supplier-x",
@@ -1074,8 +1075,8 @@ var Le = [
1074
1075
  };
1075
1076
  //#endregion
1076
1077
  //#region src/components/miniBars/MiniBars.tsx
1077
- function ze({ rows: e = [], className: t, colors: n }) {
1078
- let r = n?.slices ?? Le;
1078
+ function Be({ rows: e = [], className: t, colors: n }) {
1079
+ let r = n?.slices ?? Re;
1079
1080
  return /* @__PURE__ */ s("div", {
1080
1081
  className: ["d3-mini-bars", t].filter(Boolean).join(" "),
1081
1082
  children: e.map(([e, t, n], i) => /* @__PURE__ */ c("div", {
@@ -1101,7 +1102,7 @@ function ze({ rows: e = [], className: t, colors: n }) {
1101
1102
  width: Math.max(0, Math.min(100, t)),
1102
1103
  height: "12",
1103
1104
  rx: "6",
1104
- className: `d3-mini-fill tone-${i % Le.length}`,
1105
+ className: `d3-mini-fill tone-${i % Re.length}`,
1105
1106
  fill: r[i % r.length]
1106
1107
  })]
1107
1108
  })
@@ -1113,107 +1114,115 @@ function ze({ rows: e = [], className: t, colors: n }) {
1113
1114
  }
1114
1115
  //#endregion
1115
1116
  //#region src/components/radialFanTreeChart/RadialFanTreeChart.tsx
1116
- var Be = 680, Ve = 320;
1117
- function He({ total: e = 0, items: t = [], "data-testid": r }) {
1118
- let o = a(null), l = a(/* @__PURE__ */ new Map()), p = a(0), { hoveredRef: h, tooltip: g, hitZonesRef: y } = C(o, {
1119
- width: Be,
1120
- height: Ve
1121
- }), b = i(() => t.filter((e) => typeof e == "object" && !!e), [t]);
1117
+ var Ve = 680, He = 320, Ue = 60, We = 28;
1118
+ function Ge({ total: e = 0, items: t = [], "data-testid": r }) {
1119
+ let o = a(null), l = a(/* @__PURE__ */ new Map()), m = a(0), g = i(() => t.filter((e) => typeof e == "object" && !!e), [t]), _ = i(() => Math.max(He, Ue + Math.max(0, g.length - 1) * We), [g.length]), { hoveredRef: b, tooltip: x, hitZonesRef: S } = w(o, {
1120
+ width: Ve,
1121
+ height: _
1122
+ });
1122
1123
  return n(() => {
1123
1124
  let t = o.current;
1124
1125
  if (!t) return;
1125
- let n = _(t, Be, Ve);
1126
- p.current = 0;
1127
- let r = Ve / 2, i = Be - 80, a = Math.max(...b.map((e) => e.count ?? 0)), s = (Ve - 60) / (b.length - 1), c = b.map((e, t) => ({
1126
+ let n = v(t, Ve, _);
1127
+ m.current = 0;
1128
+ let r = _ / 2, i = Ve - 80, a = Math.max(...g.map((e) => e.count ?? 0)), s = (_ - 60) / (g.length - 1), c = g.map((e, t) => ({
1128
1129
  x: i,
1129
1130
  y: 30 + t * s
1130
- })), g, x = () => {
1131
- p.current++;
1132
- let t = p.current;
1133
- n.clearRect(0, 0, Be, Ve);
1134
- let o = E(Math.min(t / 72, 1));
1135
- M(l.current, h.current), y.current = [], v(n, 88, r, 48 * o, u.blue, .15 * o), b.forEach((t, s) => {
1136
- let p = d[s % d.length], h = j(o, s, b.length, E), g = c[s], _ = l.current.get(t.id) ?? 0, x = Math.max(1.5, (t.count ?? 0) / a * 6);
1137
- if (h < .01) return;
1138
- let S = 88 + (i - 88) * .4, C = r, T = 88 + (i - 88) * .6, D = g.y, O = h;
1131
+ })), x, C = () => {
1132
+ m.current++;
1133
+ let t = m.current;
1134
+ n.clearRect(0, 0, Ve, _), n.letterSpacing = f.letterSpacing;
1135
+ let o = D(Math.min(t / 72, 1));
1136
+ N(l.current, b.current), S.current = [], y(n, 88, r, 48 * o, u.blue, .15 * o), g.forEach((t, s) => {
1137
+ let m = d[s % d.length], _ = M(o, s, g.length, D), v = c[s], b = l.current.get(t.id) ?? 0, x = Math.max(1.5, (t.count ?? 0) / a * 6);
1138
+ if (_ < .01) return;
1139
+ let C = 88 + (i - 88) * .4, w = r, E = 88 + (i - 88) * .6, O = v.y, k = _;
1139
1140
  n.beginPath();
1140
1141
  for (let e = 0; e <= 40; e++) {
1141
- let t = e / 40 * O, i = (1 - t) ** 3 * 88 + 3 * (1 - t) ** 2 * t * S + 3 * (1 - t) * t ** 2 * T + t ** 3 * g.x, a = (1 - t) ** 3 * r + 3 * (1 - t) ** 2 * t * C + 3 * (1 - t) * t ** 2 * D + t ** 3 * g.y;
1142
+ let t = e / 40 * k, i = (1 - t) ** 3 * 88 + 3 * (1 - t) ** 2 * t * C + 3 * (1 - t) * t ** 2 * E + t ** 3 * v.x, a = (1 - t) ** 3 * r + 3 * (1 - t) ** 2 * t * w + 3 * (1 - t) * t ** 2 * O + t ** 3 * v.y;
1142
1143
  e === 0 ? n.moveTo(i, a) : n.lineTo(i, a);
1143
1144
  }
1144
- if (n.strokeStyle = m(p, _ > 0 ? .8 : .45), n.lineWidth = x * (_ > 0 ? 1.3 : 1), n.stroke(), h > .85) {
1145
- let r = Math.min(1, (h - .85) / .15), i = 4 + (t.count ?? 0) / a * 12;
1146
- v(n, g.x, g.y, i * 2.5, p, (.25 + _ * .2) * r), n.beginPath(), n.arc(g.x, g.y, i * r, 0, Math.PI * 2), n.fillStyle = m(p, (.7 + _ * .2) * r), n.fill(), w(y.current, t.id, g.x, g.y, i + 8, {
1145
+ if (n.strokeStyle = h(m, b > 0 ? .8 : .45), n.lineWidth = x * (b > 0 ? 1.3 : 1), n.stroke(), _ > .85) {
1146
+ let r = Math.min(1, (_ - .85) / .15), i = 4 + (t.count ?? 0) / a * 12;
1147
+ y(n, v.x, v.y, i * 2.5, m, (.25 + b * .2) * r), n.beginPath(), n.arc(v.x, v.y, i * r, 0, Math.PI * 2), n.fillStyle = h(m, (.7 + b * .2) * r), n.fill(), T(S.current, t.id, v.x, v.y, i + 8, {
1147
1148
  label: t.name,
1148
1149
  value: `${t.count ?? 0} NCEs raised`,
1149
1150
  sublabel: `${Math.round((t.count ?? 0) / e * 100)}% of all NCEs`,
1150
- color: p
1151
- }), n.globalAlpha = r, n.font = f.font, n.fillStyle = _ > 0 ? p : m(u.t2, .85), n.textAlign = "left", n.fillText(t.abbreviation ?? t.name.slice(0, 6), g.x + i + 6, g.y - 3), n.font = f.font, n.fillStyle = _ > 0 ? p : u.t1, n.fillText(String(t.count ?? 0), g.x + i + 6, g.y + 10), n.globalAlpha = 1;
1151
+ color: m
1152
+ }), n.globalAlpha = r, n.font = f.font, n.textAlign = "left";
1153
+ let o = t.abbreviation ?? t.name.slice(0, 6), s = ` ${t.count ?? 0}`, c = v.x + i + 6, l = v.y + 4;
1154
+ n.fillStyle = b > 0 ? m : h(u.t2, .85), n.fillText(o, c, l);
1155
+ let d = n.measureText(o).width;
1156
+ n.font = p.font, n.fillStyle = b > 0 ? m : u.t1, n.fillText(s, c + d, l), n.globalAlpha = 1;
1152
1157
  }
1153
- }), n.beginPath(), n.arc(88, r, 32 * o, 0, Math.PI * 2), n.fillStyle = u.bgL, n.fill(), n.strokeStyle = m(u.blue, .6 * o), n.lineWidth = 2, n.stroke(), o > .4 && (n.globalAlpha = Math.min(1, (o - .4) / .4), n.font = "500 24px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.t1, n.textAlign = "center", n.fillText(String(e), 88, r + 5), n.font = f.font, n.fillStyle = f.color, n.fillText("NCEs", 88, r + 18), n.globalAlpha = 1), g = requestAnimationFrame(x);
1158
+ }), n.beginPath(), n.arc(88, r, 32 * o, 0, Math.PI * 2), n.fillStyle = u.bgL, n.fill(), n.strokeStyle = h(u.blue, .6 * o), n.lineWidth = 2, n.stroke(), o > .4 && (n.globalAlpha = Math.min(1, (o - .4) / .4), n.font = "500 24px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.t1, n.textAlign = "center", n.fillText(String(e), 88, r + 5), n.font = f.font, n.fillStyle = f.color, n.fillText("NCEs", 88, r + 18), n.globalAlpha = 1), x = requestAnimationFrame(C);
1154
1159
  };
1155
- return x(), () => cancelAnimationFrame(g);
1156
- }, [e, b]), b.length === 0 ? /* @__PURE__ */ s(F, {
1157
- width: Be,
1158
- height: Ve,
1160
+ return C(), () => cancelAnimationFrame(x);
1161
+ }, [
1162
+ e,
1163
+ g,
1164
+ _
1165
+ ]), g.length === 0 ? /* @__PURE__ */ s(I, {
1166
+ width: Ve,
1167
+ height: He,
1159
1168
  "data-testid": r
1160
1169
  }) : /* @__PURE__ */ c("div", {
1161
1170
  "data-testid": r,
1162
1171
  style: {
1163
1172
  position: "relative",
1164
- width: Be,
1165
- height: Ve
1173
+ width: Ve,
1174
+ height: _
1166
1175
  },
1167
1176
  children: [/* @__PURE__ */ s("canvas", {
1168
1177
  ref: o,
1169
1178
  role: "img",
1170
1179
  "aria-label": "NCE fault tree — NCEs per contractor as branching tree",
1171
1180
  style: {
1172
- width: Be,
1173
- height: Ve,
1181
+ width: Ve,
1182
+ height: _,
1174
1183
  display: "block"
1175
1184
  }
1176
- }), /* @__PURE__ */ s(S, {
1177
- ...g,
1178
- parentW: Be,
1179
- parentH: Ve
1185
+ }), /* @__PURE__ */ s(C, {
1186
+ ...x,
1187
+ parentW: Ve,
1188
+ parentH: _
1180
1189
  })]
1181
1190
  });
1182
1191
  }
1183
1192
  //#endregion
1184
1193
  //#region src/components/pieChart/PieChart.tsx
1185
- var Ue = 192, We = Ue, Ge = Ue + 80;
1186
- function Ke({ rows: e = [], variant: t, className: r, colors: i }) {
1187
- let o = a(null), f = a(/* @__PURE__ */ new Map()), p = a(0), h = i?.slices ?? d, { hoveredRef: y, tooltip: b, hitZonesRef: x } = C(o, {
1188
- width: We,
1189
- height: Ge
1194
+ var Ke = 192, qe = Ke, Je = Ke + 80;
1195
+ function Ye({ rows: e = [], variant: t, className: r, colors: i }) {
1196
+ let o = a(null), f = a(/* @__PURE__ */ new Map()), p = a(0), m = i?.slices ?? d, { hoveredRef: g, tooltip: b, hitZonesRef: x } = w(o, {
1197
+ width: qe,
1198
+ height: Je
1190
1199
  });
1191
1200
  return n(() => {
1192
1201
  let n = o.current;
1193
1202
  if (!n) return;
1194
- let r = _(n, We, Ge);
1203
+ let r = v(n, qe, Je);
1195
1204
  p.current = 0;
1196
- let i = We / 2, a = Ue / 2, s = Ue * .4, c = t === "donut" ? Ue * .21 : 0, l = e.reduce((e, t) => e + (t.pricing ?? 0), 0) || 1, d, b = () => {
1205
+ let i = qe / 2, a = Ke / 2, s = Ke * .4, c = t === "donut" ? Ke * .21 : 0, l = e.reduce((e, t) => e + (t.pricing ?? 0), 0) || 1, d, b = () => {
1197
1206
  p.current++;
1198
1207
  let n = p.current;
1199
- r.clearRect(0, 0, We, Ge);
1208
+ r.clearRect(0, 0, qe, Je);
1200
1209
  let o = 1 - (1 - Math.min(n / 48, 1)) ** 3;
1201
- M(f.current, y.current), x.current = [];
1202
- let _ = -Math.PI / 2;
1210
+ N(f.current, g.current), x.current = [];
1211
+ let v = -Math.PI / 2;
1203
1212
  e.forEach((e, t) => {
1204
- let d = (e.pricing ?? 0) / l, p = d * Math.PI * 2 * o, g = _ + p, y = h[t % h.length], b = f.current.get(e.id ?? `sl-${t}`) ?? 0, S = _ + p / 2, C = (s + c) / 2, T = i + Math.cos(S) * C, E = a + Math.sin(S) * C, D = (s - c) / 2 + 8;
1205
- w(x.current, e.id ?? `sl-${t}`, T, E, D, {
1213
+ let d = (e.pricing ?? 0) / l, p = d * Math.PI * 2 * o, g = v + p, _ = m[t % m.length], b = f.current.get(e.id ?? `sl-${t}`) ?? 0, S = v + p / 2, C = (s + c) / 2, w = i + Math.cos(S) * C, E = a + Math.sin(S) * C, D = (s - c) / 2 + 8;
1214
+ T(x.current, e.id ?? `sl-${t}`, w, E, D, {
1206
1215
  label: e.vendor,
1207
1216
  value: `${e.pricing ?? 0} (${Math.round(d * 100)}%)`,
1208
- color: y
1209
- }), b > 0 && v(r, T, E, D * 2 * b, y, .2 * b);
1210
- let O = A(n, .03, 3e-4), k = s + b * 6 + (b > 0 ? O * 2 : 0);
1211
- r.beginPath(), r.moveTo(i + Math.cos(_) * c, a + Math.sin(_) * c), r.arc(i, a, k, _, g), c > 0 ? r.arc(i, a, c, g, _, !0) : r.lineTo(i, a), r.closePath(), r.fillStyle = m(y, .7 + b * .2), r.fill(), r.strokeStyle = m(u.bg, .8), r.lineWidth = 1.5, r.stroke(), _ = g;
1212
- }), t === "donut" && e.length > 0 && v(r, i, a, c * .8, u.blue, .06);
1213
- let S = Ue + 12;
1217
+ color: _
1218
+ }), b > 0 && y(r, w, E, D * 2 * b, _, .2 * b);
1219
+ let O = j(n, .03, 3e-4), k = s + b * 6 + (b > 0 ? O * 2 : 0);
1220
+ r.beginPath(), r.moveTo(i + Math.cos(v) * c, a + Math.sin(v) * c), r.arc(i, a, k, v, g), c > 0 ? r.arc(i, a, c, g, v, !0) : r.lineTo(i, a), r.closePath(), r.fillStyle = h(_, .7 + b * .2), r.fill(), r.strokeStyle = h(u.bg, .8), r.lineWidth = 1.5, r.stroke(), v = g;
1221
+ }), t === "donut" && e.length > 0 && y(r, i, a, c * .8, u.blue, .06);
1222
+ let S = Ke + 12;
1214
1223
  e.forEach((e, t) => {
1215
- let n = h[t % h.length], i = (e.pricing ?? 0) / l, a = f.current.get(e.id ?? `sl-${t}`) ?? 0, o = S + t * 18;
1216
- r.beginPath(), r.arc(8, o, 4, 0, Math.PI * 2), r.fillStyle = m(n, .8 + a * .2), r.fill(), r.font = "9px 'JetBrains Mono', monospace", r.fillStyle = m(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 = g(u.t3, n, a), r.textAlign = "right", r.fillText(`${e.pricing ?? 0} (${Math.round(i * 100)}%)`, We - 4, o + 3.5);
1224
+ let n = m[t % m.length], i = (e.pricing ?? 0) / l, a = f.current.get(e.id ?? `sl-${t}`) ?? 0, o = S + t * 18;
1225
+ r.beginPath(), r.arc(8, o, 4, 0, Math.PI * 2), r.fillStyle = h(n, .8 + a * .2), r.fill(), r.font = "9px 'JetBrains Mono', monospace", r.fillStyle = h(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 = _(u.t3, n, a), r.textAlign = "right", r.fillText(`${e.pricing ?? 0} (${Math.round(i * 100)}%)`, qe - 4, o + 3.5);
1217
1226
  }), d = requestAnimationFrame(b);
1218
1227
  };
1219
1228
  return b(), () => cancelAnimationFrame(d);
@@ -1221,36 +1230,36 @@ function Ke({ rows: e = [], variant: t, className: r, colors: i }) {
1221
1230
  e,
1222
1231
  t,
1223
1232
  i,
1224
- h
1233
+ m
1225
1234
  ]), /* @__PURE__ */ s(l, {
1226
1235
  className: ["canvas-pie-frame", r].filter(Boolean).join(" "),
1227
1236
  children: /* @__PURE__ */ c("div", {
1228
1237
  style: {
1229
1238
  position: "relative",
1230
- width: We,
1231
- height: Ge
1239
+ width: qe,
1240
+ height: Je
1232
1241
  },
1233
1242
  children: [/* @__PURE__ */ s("canvas", {
1234
1243
  ref: o,
1235
1244
  role: "img",
1236
1245
  "aria-label": `${t} chart`,
1237
1246
  style: {
1238
- width: We,
1239
- height: Ge,
1247
+ width: qe,
1248
+ height: Je,
1240
1249
  display: "block",
1241
1250
  borderRadius: 8
1242
1251
  }
1243
- }), /* @__PURE__ */ s(S, {
1252
+ }), /* @__PURE__ */ s(C, {
1244
1253
  ...b,
1245
- parentW: We,
1246
- parentH: Ge
1254
+ parentW: qe,
1255
+ parentH: Je
1247
1256
  })]
1248
1257
  })
1249
1258
  });
1250
1259
  }
1251
1260
  //#endregion
1252
1261
  //#region src/components/sankey/SankeySvg.tsx
1253
- function qe(e, t, n, r) {
1262
+ function Xe(e, t, n, r) {
1254
1263
  let i = new Set(t.map((e) => e.source)), a = new Set(t.map((e) => e.target)), o = /* @__PURE__ */ new Map(), s = [];
1255
1264
  for (e.forEach((e) => {
1256
1265
  i.has(e.id) && !a.has(e.id) && s.push({
@@ -1295,38 +1304,38 @@ function qe(e, t, n, r) {
1295
1304
  });
1296
1305
  }), f;
1297
1306
  }
1298
- function Je({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f, selectedEntity: p, className: h, colors: g }) {
1299
- let y = a(null), x = a(/* @__PURE__ */ new Map()), E = a(0), D = a([]), O = g?.nodes ?? d, k = g?.links ?? u.bd, j = g?.activeLinks ?? u.blue, ee = g?.activeNodes ?? u.blue, N = i(() => qe(e, t, r, o), [
1307
+ function Ze({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f, selectedEntity: p, className: m, colors: g }) {
1308
+ let _ = a(null), b = a(/* @__PURE__ */ new Map()), S = a(0), D = a([]), O = g?.nodes ?? d, k = g?.links ?? u.bd, A = g?.activeLinks ?? u.blue, M = g?.activeNodes ?? u.blue, P = i(() => Xe(e, t, r, o), [
1300
1309
  e,
1301
1310
  t,
1302
1311
  r,
1303
1312
  o
1304
- ]), { hoveredRef: te, tooltip: ne, hitZonesRef: P } = C(y, {
1313
+ ]), { hoveredRef: F, tooltip: ee, hitZonesRef: te } = w(_, {
1305
1314
  width: r,
1306
1315
  height: o
1307
1316
  });
1308
1317
  return n(() => {
1309
- let n = y.current;
1318
+ let n = _.current;
1310
1319
  if (!n) return;
1311
- let i = _(n, r, o);
1312
- E.current = 0, D.current = [];
1320
+ let i = v(n, r, o);
1321
+ S.current = 0, D.current = [];
1313
1322
  let a = t.length > 0 ? Math.max(...t.map((e) => e.value)) : 1, s, c = () => {
1314
- E.current++;
1315
- let n = E.current;
1323
+ S.current++;
1324
+ let n = S.current;
1316
1325
  i.clearRect(0, 0, r, o);
1317
1326
  let l = 1 - (1 - Math.min(n / 56, 1)) ** 3;
1318
- M(x.current, te.current), P.current = [], t.forEach((e, t) => {
1319
- let r = N.get(e.source), o = N.get(e.target);
1327
+ N(b.current, F.current), te.current = [], t.forEach((e, t) => {
1328
+ let r = P.get(e.source), o = P.get(e.target);
1320
1329
  if (!r || !o) return;
1321
- let s = !!p && (e.source === p || e.target === p), c = s ? j : k, d = s ? .5 : .2, f = Math.max(3, e.value / a * 36 * l), h = f / 2, g = r.x + r.w, _ = r.y + r.h / 2, v = o.x, y = o.y + o.h / 2, b = (g + v) / 2;
1330
+ let s = !!p && (e.source === p || e.target === p), c = s ? A : k, d = s ? .5 : .2, f = Math.max(3, e.value / a * 36 * l), m = f / 2, g = r.x + r.w, _ = r.y + r.h / 2, v = o.x, y = o.y + o.h / 2, b = (g + v) / 2;
1322
1331
  for (let e = 0; e < 30; e++) {
1323
- let r = e / 30, a = (e + 1) / 30, o = 1 - r, s = 1 - a, l = o * o * g + 2 * o * r * b + r * r * v, u = o * o * _ + 2 * o * r * _ + r * r * y, f = s * s * g + 2 * s * a * b + a * a * v, p = s * s * _ + 2 * s * a * _ + a * a * y, x = A(n + r * 120 + t * 40, .025, 3e-4) * 1.2;
1324
- i.beginPath(), i.moveTo(l, u - h + x), i.lineTo(f, p - h + x), i.lineTo(f, p + h + x), i.lineTo(l, u + h + x), i.closePath(), i.fillStyle = m(c, d * (.5 + r * .5)), i.fill();
1332
+ let r = e / 30, a = (e + 1) / 30, o = 1 - r, s = 1 - a, l = o * o * g + 2 * o * r * b + r * r * v, u = o * o * _ + 2 * o * r * _ + r * r * y, f = s * s * g + 2 * s * a * b + a * a * v, p = s * s * _ + 2 * s * a * _ + a * a * y, x = j(n + r * 120 + t * 40, .025, 3e-4) * 1.2;
1333
+ i.beginPath(), i.moveTo(l, u - m + x), i.lineTo(f, p - m + x), i.lineTo(f, p + m + x), i.lineTo(l, u + m + x), i.closePath(), i.fillStyle = h(c, d * (.5 + r * .5)), i.fill();
1325
1334
  }
1326
- w(P.current, `link-${t}`, b, (_ + y) / 2, f + 6, {
1335
+ T(te.current, `link-${t}`, b, (_ + y) / 2, f + 6, {
1327
1336
  label: `${e.source} → ${e.target}`,
1328
1337
  value: String(e.value),
1329
- color: s ? j : u.blue
1338
+ color: s ? A : u.blue
1330
1339
  }), Math.random() < .08 && D.current.push({
1331
1340
  linkIdx: t,
1332
1341
  prog: 0,
@@ -1335,27 +1344,27 @@ function Je({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
1335
1344
  sz: 1 + Math.random()
1336
1345
  });
1337
1346
  }), e.forEach((e, t) => {
1338
- let r = N.get(e.id);
1347
+ let r = P.get(e.id);
1339
1348
  if (!r) return;
1340
- let a = p === e.id, o = te.current === `node-${t}`, s = x.current.get(`node-${t}`) ?? 0, c = a ? ee : O[t % O.length];
1341
- T(P.current, `node-${t}`, r.x, r.y, r.w, r.h, {
1349
+ let a = p === e.id, o = F.current === `node-${t}`, s = b.current.get(`node-${t}`) ?? 0, c = a ? M : O[t % O.length];
1350
+ E(te.current, `node-${t}`, r.x, r.y, r.w, r.h, {
1342
1351
  label: e.name,
1343
1352
  value: e.valueLabel ?? e.id,
1344
1353
  color: c
1345
- }), (s > 0 || a) && v(i, r.x + r.w / 2, r.y + r.h / 2, r.w * 2, c, .2 * Math.max(s, a ? .6 : 0));
1346
- let l = a ? A(n, .03, 3e-4) * .15 : 0;
1347
- i.fillStyle = m(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 = m(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());
1354
+ }), (s > 0 || a) && y(i, r.x + r.w / 2, r.y + r.h / 2, r.w * 2, c, .2 * Math.max(s, a ? .6 : 0));
1355
+ let l = a ? j(n, .03, 3e-4) * .15 : 0;
1356
+ i.fillStyle = h(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 = h(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());
1348
1357
  let d = r.x + r.w + 8;
1349
- i.font = `${a || o ? "bold " : ""}10px 'JetBrains Mono', monospace`, i.fillStyle = m(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 = m(c, .5 + s * .2), i.fillText(e.valueLabel, d, r.y + r.h / 2 + 17));
1358
+ i.font = `${a || o ? "bold " : ""}10px 'JetBrains Mono', monospace`, i.fillStyle = h(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 = h(c, .5 + s * .2), i.fillText(e.valueLabel, d, r.y + r.h / 2 + 17));
1350
1359
  }), D.current = D.current.filter((e) => {
1351
1360
  if (e.prog += e.speed, e.prog > 1) return !1;
1352
1361
  let n = t[e.linkIdx];
1353
1362
  if (!n) return !1;
1354
- let r = N.get(n.source), a = N.get(n.target);
1363
+ let r = P.get(n.source), a = P.get(n.target);
1355
1364
  if (!r || !a) return !1;
1356
- 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, h = f * f * s + 2 * f * e.prog * s + e.prog * e.prog * l + e.off, _ = Math.sin(e.prog * Math.PI) * .5, v = g?.links ?? u.cyan;
1357
- return i.beginPath(), i.arc(p, h, e.sz, 0, Math.PI * 2), i.fillStyle = m(v, _), i.fill(), !0;
1358
- }), D.current.length > 150 && (D.current = D.current.slice(-150)), b(i, r, o, n, .01), s = requestAnimationFrame(c);
1365
+ 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, _ = Math.sin(e.prog * Math.PI) * .5, v = g?.links ?? u.blue;
1366
+ return i.beginPath(), i.arc(p, m, e.sz, 0, Math.PI * 2), i.fillStyle = h(v, _), i.fill(), !0;
1367
+ }), D.current.length > 150 && (D.current = D.current.slice(-150)), x(i, r, o, n, .01), s = requestAnimationFrame(c);
1359
1368
  };
1360
1369
  return c(), () => {
1361
1370
  cancelAnimationFrame(s), D.current = [];
@@ -1367,9 +1376,9 @@ function Je({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
1367
1376
  o,
1368
1377
  p,
1369
1378
  g,
1370
- N
1379
+ P
1371
1380
  ]), /* @__PURE__ */ s(l, {
1372
- className: ["canvas-sankey-frame", h].filter(Boolean).join(" "),
1381
+ className: ["canvas-sankey-frame", m].filter(Boolean).join(" "),
1373
1382
  children: /* @__PURE__ */ c("div", {
1374
1383
  role: "img",
1375
1384
  "aria-label": f,
@@ -1379,15 +1388,15 @@ function Je({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
1379
1388
  height: o
1380
1389
  },
1381
1390
  children: [/* @__PURE__ */ s("canvas", {
1382
- ref: y,
1391
+ ref: _,
1383
1392
  style: {
1384
1393
  width: r,
1385
1394
  height: o,
1386
1395
  display: "block",
1387
1396
  borderRadius: 8
1388
1397
  }
1389
- }), /* @__PURE__ */ s(S, {
1390
- ...ne,
1398
+ }), /* @__PURE__ */ s(C, {
1399
+ ...ee,
1391
1400
  parentW: r,
1392
1401
  parentH: o
1393
1402
  })]
@@ -1396,7 +1405,7 @@ function Je({ nodes: e, links: t, width: r = 960, height: o = 280, ariaLabel: f,
1396
1405
  }
1397
1406
  //#endregion
1398
1407
  //#region src/canvas/CausalFlowCanvas.tsx
1399
- var Ye = [
1408
+ var Qe = [
1400
1409
  {
1401
1410
  x: .13,
1402
1411
  y: .48
@@ -1429,16 +1438,15 @@ var Ye = [
1429
1438
  x: .92,
1430
1439
  y: .22
1431
1440
  }
1432
- ], Xe = [
1441
+ ], $e = [
1433
1442
  u.blue,
1434
- u.cyan,
1435
1443
  u.orange,
1436
1444
  u.red,
1437
1445
  u.purple,
1438
1446
  u.green,
1439
1447
  u.amber,
1440
1448
  u.t2
1441
- ], Ze = [
1449
+ ], et = [
1442
1450
  26,
1443
1451
  24,
1444
1452
  24,
@@ -1448,21 +1456,21 @@ var Ye = [
1448
1456
  22,
1449
1457
  22
1450
1458
  ];
1451
- function Qe(e, t) {
1459
+ function tt(e, t) {
1452
1460
  let n = 1 - t;
1453
1461
  return {
1454
1462
  x: n * n * n * e.p0.x + 3 * n * n * t * e.p1.x + 3 * n * t * t * e.p2.x + t * t * t * e.p3.x,
1455
1463
  y: n * n * n * e.p0.y + 3 * n * n * t * e.p1.y + 3 * n * t * t * e.p2.y + t * t * t * e.p3.y
1456
1464
  };
1457
1465
  }
1458
- function $e(e, t) {
1466
+ function nt(e, t) {
1459
1467
  let n = 1 - t, r = 3 * n * n * (e.p1.x - e.p0.x) + 6 * n * t * (e.p2.x - e.p1.x) + 3 * t * t * (e.p3.x - e.p2.x), i = 3 * n * n * (e.p1.y - e.p0.y) + 6 * n * t * (e.p2.y - e.p1.y) + 3 * t * t * (e.p3.y - e.p2.y), a = Math.sqrt(r * r + i * i) || 1;
1460
1468
  return {
1461
1469
  x: -i / a,
1462
1470
  y: r / a
1463
1471
  };
1464
1472
  }
1465
- function et(e, t) {
1473
+ function rt(e, t) {
1466
1474
  let n = t.x - e.x, r = t.y - e.y;
1467
1475
  return {
1468
1476
  p0: {
@@ -1483,46 +1491,46 @@ function et(e, t) {
1483
1491
  }
1484
1492
  };
1485
1493
  }
1486
- function tt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntity: l }) {
1487
- let d = a(null), f = a(0), p = a([]), { hoveredRef: h, tooltip: x, hitZonesRef: T } = C(d, {
1494
+ function it({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntity: l }) {
1495
+ let d = a(null), f = a(0), p = a([]), { hoveredRef: m, tooltip: g, hitZonesRef: S } = w(d, {
1488
1496
  width: r,
1489
1497
  height: o
1490
- }), D = i(() => {
1498
+ }), E = i(() => {
1491
1499
  let t = /* @__PURE__ */ new Map();
1492
1500
  return e.forEach((e, n) => t.set(e.id, n)), t;
1493
- }, [e]), O = i(() => t.length > 0 ? Math.max(...t.map((e) => e.value)) : 100, [t]), k = (e) => O > 1 ? e / 100 : e, j = i(() => e.map((e, t) => {
1494
- let n = Ye[t % Ye.length];
1501
+ }, [e]), O = i(() => t.length > 0 ? Math.max(...t.map((e) => e.value)) : 100, [t]), k = (e) => O > 1 ? e / 100 : e, A = i(() => e.map((e, t) => {
1502
+ let n = Qe[t % Qe.length];
1495
1503
  return {
1496
1504
  id: e.id,
1497
1505
  label: e.name,
1498
1506
  sub: e.valueLabel ?? "",
1499
1507
  x: n.x * r,
1500
1508
  y: n.y * o,
1501
- r: Ze[t % Ze.length],
1502
- color: Xe[t % Xe.length]
1509
+ r: et[t % et.length],
1510
+ color: $e[t % $e.length]
1503
1511
  };
1504
1512
  }), [
1505
1513
  e,
1506
1514
  r,
1507
1515
  o
1508
1516
  ]), M = i(() => t.map((e) => ({
1509
- fromIdx: D.get(e.source) ?? -1,
1510
- toIdx: D.get(e.target) ?? -1,
1517
+ fromIdx: E.get(e.source) ?? -1,
1518
+ toIdx: E.get(e.target) ?? -1,
1511
1519
  conf: k(e.value)
1512
- })).filter((e) => e.fromIdx >= 0 && e.toIdx >= 0), [t, D]);
1520
+ })).filter((e) => e.fromIdx >= 0 && e.toIdx >= 0), [t, E]);
1513
1521
  return n(() => {
1514
1522
  let e = d.current;
1515
1523
  if (!e) return;
1516
- let t = _(e, r, o);
1524
+ let t = v(e, r, o);
1517
1525
  f.current = 0, p.current = [];
1518
1526
  let n, i = () => {
1519
1527
  f.current++;
1520
1528
  let e = f.current;
1521
- if (t.clearRect(0, 0, r, o), T.current = [], y(t, r, o, e, 50, m(u.blue, .05)), M.forEach((e, n) => {
1522
- let r = j[e.fromIdx], i = j[e.toIdx];
1529
+ if (t.clearRect(0, 0, r, o), S.current = [], b(t, r, o, e, 50, h(u.blue, .05)), M.forEach((e, n) => {
1530
+ let r = A[e.fromIdx], i = A[e.toIdx];
1523
1531
  if (!r || !i) return;
1524
- let a = !!l && (r.id === l || i.id === l), o = g(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d = et(r, i);
1525
- 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 = m(o, s), t.lineWidth = 16, t.lineCap = "round", t.stroke(), t.strokeStyle = m(o, c), t.lineWidth = 1.5, t.stroke();
1532
+ let a = !!l && (r.id === l || i.id === l), o = _(r.color, i.color, .5), s = a ? .18 : .05, c = a ? .25 : .1, d = rt(r, i);
1533
+ 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 = h(o, s), t.lineWidth = 16, t.lineCap = "round", t.stroke(), t.strokeStyle = h(o, c), t.lineWidth = 1.5, t.stroke();
1526
1534
  for (let t = 0; t < e.conf * 2.5; t++) Math.random() < .45 && p.current.push({
1527
1535
  edgeIdx: n,
1528
1536
  t: 0,
@@ -1530,44 +1538,44 @@ function tt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
1530
1538
  off: (Math.random() - .5) * 13,
1531
1539
  sz: .7 + Math.random() * 2
1532
1540
  });
1533
- let f = Qe(d, .5), h = `${Math.round(e.conf * 100)}%`;
1541
+ let f = tt(d, .5), m = `${Math.round(e.conf * 100)}%`;
1534
1542
  t.font = "bold 12px 'JetBrains Mono', monospace", t.textBaseline = "middle";
1535
- let _ = t.measureText(h).width + 14;
1536
- t.fillStyle = "rgba(10,16,24,0.88)", t.beginPath(), t.roundRect(f.x - _ / 2, f.y - 11, _, 22, 6), t.fill(), t.strokeStyle = m(u.cyan, .25), t.lineWidth = 1, t.stroke(), t.fillStyle = m(u.cyan, .9), t.textAlign = "center", t.fillText(h, f.x, f.y);
1543
+ let g = t.measureText(m).width + 14;
1544
+ t.fillStyle = "rgba(10,16,24,0.88)", t.beginPath(), t.roundRect(f.x - g / 2, f.y - 11, g, 22, 6), t.fill(), t.strokeStyle = h(u.blue, .25), t.lineWidth = 1, t.stroke(), t.fillStyle = h(u.blue, .9), t.textAlign = "center", t.fillText(m, f.x, f.y);
1537
1545
  }), p.current = p.current.filter((e) => {
1538
1546
  if (e.t += e.speed, e.t > 1) return !1;
1539
1547
  let n = M[e.edgeIdx];
1540
1548
  if (!n) return !1;
1541
- let r = j[n.fromIdx], i = j[n.toIdx];
1549
+ let r = A[n.fromIdx], i = A[n.toIdx];
1542
1550
  if (!r || !i) return !1;
1543
- let a = et(r, i), o = Qe(a, e.t), s = $e(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 = g(r.color, i.color, e.t);
1544
- return v(t, c, l, e.sz * 3, d, u * .1), t.beginPath(), t.arc(c, l, e.sz, 0, Math.PI * 2), t.fillStyle = m(d, u), t.fill(), !0;
1545
- }), p.current.length > 350 && (p.current = p.current.slice(-350)), j.forEach((n, r) => {
1546
- let i = l === n.id, a = h.current === `node-${r}`, o = A(e, .03, 3e-4) * .1 + 1, s = n.r * o * (i ? 1.15 : 1);
1547
- t.beginPath(), t.arc(n.x, n.y, s + 6, 0, Math.PI * 2), t.strokeStyle = m(n.color, i ? .3 : .1), t.lineWidth = i ? 1.5 : .7, t.stroke(), v(t, n.x, n.y, s * 3, n.color, i ? .22 : .12);
1551
+ let a = rt(r, i), o = tt(a, e.t), s = nt(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 = _(r.color, i.color, e.t);
1552
+ return y(t, c, l, e.sz * 3, d, u * .1), t.beginPath(), t.arc(c, l, e.sz, 0, Math.PI * 2), t.fillStyle = h(d, u), t.fill(), !0;
1553
+ }), p.current.length > 350 && (p.current = p.current.slice(-350)), A.forEach((n, r) => {
1554
+ let i = l === n.id, a = m.current === `node-${r}`, o = j(e, .03, 3e-4) * .1 + 1, s = n.r * o * (i ? 1.15 : 1);
1555
+ t.beginPath(), t.arc(n.x, n.y, s + 6, 0, Math.PI * 2), t.strokeStyle = h(n.color, i ? .3 : .1), t.lineWidth = i ? 1.5 : .7, t.stroke(), y(t, n.x, n.y, s * 3, n.color, i ? .22 : .12);
1548
1556
  let c = t.createRadialGradient(n.x, n.y - s * .2, 0, n.x, n.y, s);
1549
- if (c.addColorStop(0, m(n.color, i ? 1 : .85)), c.addColorStop(1, m(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 === j.length - 1) {
1557
+ if (c.addColorStop(0, h(n.color, i ? 1 : .85)), c.addColorStop(1, h(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 === A.length - 1) {
1550
1558
  let r = s + 16, i = e * .04, a = n.x + Math.cos(i) * r, o = n.y + Math.sin(i) * r;
1551
- v(t, a, o, 6, n.color, .3), t.beginPath(), t.arc(a, o, 2, 0, Math.PI * 2), t.fillStyle = m(n.color, .75), t.fill();
1559
+ y(t, a, o, 6, n.color, .3), t.beginPath(), t.arc(a, o, 2, 0, Math.PI * 2), t.fillStyle = h(n.color, .75), t.fill();
1552
1560
  }
1553
- w(T.current, `node-${r}`, n.x, n.y, s + 8, {
1561
+ T(S.current, `node-${r}`, n.x, n.y, s + 8, {
1554
1562
  label: n.label,
1555
1563
  value: n.sub || n.id,
1556
1564
  color: n.color
1557
- }), t.font = `${i || a ? "bold " : ""}12px 'DM Sans', sans-serif`, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = m(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 = m(u.t3, .65), t.fillText(n.sub, n.x, n.y + s + 32));
1565
+ }), t.font = `${i || a ? "bold " : ""}12px 'DM Sans', sans-serif`, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillStyle = h(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 = h(u.t3, .65), t.fillText(n.sub, n.x, n.y + s + 32));
1558
1566
  }), M.length >= 2) {
1559
- let n = M.reduce((e, t) => e * t.conf, 1), i = o * .92, a = r * .12, s = r * .76, c = E(Math.min(e * .008, 1));
1560
- t.fillStyle = m(u.bd, .35), t.beginPath(), t.roundRect(a, i, s, 5, 3), t.fill(), t.fillStyle = m(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 = m(u.orange, .85), t.fillText(`${Math.round(n * 100)}% compound confidence`, a + s * n * c + 10, i + 2);
1567
+ let n = M.reduce((e, t) => e * t.conf, 1), i = o * .92, a = r * .12, s = r * .76, c = D(Math.min(e * .008, 1));
1568
+ t.fillStyle = h(u.bd, .35), t.beginPath(), t.roundRect(a, i, s, 5, 3), t.fill(), t.fillStyle = h(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 = h(u.orange, .85), t.fillText(`${Math.round(n * 100)}% compound confidence`, a + s * n * c + 10, i + 2);
1561
1569
  let l = M.map((e) => e.conf.toFixed(2)).join(" × ");
1562
- t.textAlign = "right", t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = m(u.t4, .6), t.fillText(l, a - 6, i + 2);
1570
+ t.textAlign = "right", t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = h(u.t4, .6), t.fillText(l, a - 6, i + 2);
1563
1571
  }
1564
- b(t, r, o, e, .012), n = requestAnimationFrame(i);
1572
+ x(t, r, o, e, .012), n = requestAnimationFrame(i);
1565
1573
  };
1566
1574
  return i(), () => {
1567
1575
  cancelAnimationFrame(n), p.current = [];
1568
1576
  };
1569
1577
  }, [
1570
- j,
1578
+ A,
1571
1579
  M,
1572
1580
  r,
1573
1581
  o,
@@ -1588,8 +1596,8 @@ function tt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
1588
1596
  },
1589
1597
  role: "img",
1590
1598
  "aria-label": "causal flow diagram"
1591
- }), /* @__PURE__ */ s(S, {
1592
- ...x,
1599
+ }), /* @__PURE__ */ s(C, {
1600
+ ...g,
1593
1601
  parentW: r,
1594
1602
  parentH: o
1595
1603
  })]
@@ -1597,10 +1605,10 @@ function tt({ nodes: e, links: t, width: r = 960, height: o = 280, selectedEntit
1597
1605
  }
1598
1606
  //#endregion
1599
1607
  //#region src/components/sankey/ProcessSankey.tsx
1600
- function nt({ selectedEntity: e, colors: t }) {
1601
- return /* @__PURE__ */ s(tt, {
1602
- nodes: Re.nodes,
1603
- links: Re.links,
1608
+ function at({ selectedEntity: e, colors: t }) {
1609
+ return /* @__PURE__ */ s(it, {
1610
+ nodes: ze.nodes,
1611
+ links: ze.links,
1604
1612
  width: 960,
1605
1613
  height: 280,
1606
1614
  selectedEntity: e
@@ -1608,7 +1616,7 @@ function nt({ selectedEntity: e, colors: t }) {
1608
1616
  }
1609
1617
  //#endregion
1610
1618
  //#region src/components/sankey/RankingSankey.tsx
1611
- function rt({ rows: e = [], className: t, colors: n }) {
1619
+ function ot({ rows: e = [], className: t, colors: n }) {
1612
1620
  let { nodes: r, links: a } = i(() => {
1613
1621
  let t = e.slice(0, 5);
1614
1622
  return {
@@ -1626,7 +1634,7 @@ function rt({ rows: e = [], className: t, colors: n }) {
1626
1634
  }))
1627
1635
  };
1628
1636
  }, [e]);
1629
- return /* @__PURE__ */ s(Je, {
1637
+ return /* @__PURE__ */ s(Ze, {
1630
1638
  nodes: r,
1631
1639
  links: a,
1632
1640
  width: 760,
@@ -1638,62 +1646,62 @@ function rt({ rows: e = [], className: t, colors: n }) {
1638
1646
  }
1639
1647
  //#endregion
1640
1648
  //#region src/components/balanceScaleChart/BalanceScaleChart.tsx
1641
- var it = 500, at = 320;
1642
- function ot({ left: e, right: t, "data-testid": r }) {
1649
+ var st = 500, ct = 320;
1650
+ function lt({ left: e, right: t, "data-testid": r }) {
1643
1651
  let i = a(null), o = a(0);
1644
1652
  return n(() => {
1645
1653
  let n = i.current;
1646
1654
  if (!n) return;
1647
- let r = _(n, it, at);
1655
+ let r = v(n, st, ct);
1648
1656
  o.current = 0;
1649
- let a = it / 2, s = Math.max(e.value, t.value), c = (e.value - t.value) / s * 14, l, d = () => {
1657
+ let a = st / 2, s = Math.max(e.value, t.value), c = (e.value - t.value) / s * 14, l, d = () => {
1650
1658
  o.current++;
1651
1659
  let n = o.current;
1652
- r.clearRect(0, 0, it, at);
1653
- let i = E(Math.min(n / 80, 1)), p = c * k(Math.min(n / 80, 1)) * Math.PI / 180;
1654
- r.strokeStyle = m(u.bd, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(a, 100), r.lineTo(a, at - 80), r.stroke(), r.beginPath(), r.arc(a, 100, 5 * i, 0, Math.PI * 2), r.fillStyle = u.t2, r.fill();
1655
- let h = {
1656
- x: a - Math.cos(p) * 160,
1657
- y: 100 + Math.sin(-p) * 160
1658
- }, g = {
1659
- x: a + Math.cos(p) * 160,
1660
- y: 100 + Math.sin(p) * 160
1660
+ r.clearRect(0, 0, st, ct), r.letterSpacing = f.letterSpacing;
1661
+ let i = D(Math.min(n / 80, 1)), g = c * A(Math.min(n / 80, 1)) * Math.PI / 180;
1662
+ r.strokeStyle = h(u.bd, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(a, 100), r.lineTo(a, ct - 80), r.stroke(), r.beginPath(), r.arc(a, 100, 5 * i, 0, Math.PI * 2), r.fillStyle = u.t2, r.fill();
1663
+ let _ = {
1664
+ x: a - Math.cos(g) * 160,
1665
+ y: 100 + Math.sin(-g) * 160
1666
+ }, v = {
1667
+ x: a + Math.cos(g) * 160,
1668
+ y: 100 + Math.sin(g) * 160
1661
1669
  };
1662
- r.strokeStyle = m(u.t2, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(h.x, h.y), r.lineTo(g.x, g.y), r.stroke();
1663
- let _ = Math.max(20, e.value / s * 100 * i), y = h.y + 18;
1664
- v(r, h.x, y + _ / 2, 90 * .5, u.green, .18 * i), r.fillStyle = m(u.green, .5 * i), r.beginPath(), r.roundRect(h.x - 90 / 2, y, 90, _, [
1670
+ r.strokeStyle = h(u.t2, .5 * i), r.lineWidth = 2, r.beginPath(), r.moveTo(_.x, _.y), r.lineTo(v.x, v.y), r.stroke();
1671
+ let b = Math.max(20, e.value / s * 100 * i), x = _.y + 18;
1672
+ y(r, _.x, x + b / 2, 90 * .5, u.green, .18 * i), r.fillStyle = h(u.green, .5 * i), r.beginPath(), r.roundRect(_.x - 90 / 2, x, 90, b, [
1665
1673
  0,
1666
1674
  0,
1667
1675
  6,
1668
1676
  6
1669
- ]), r.fill(), r.strokeStyle = m(u.green, .7 * i), r.lineWidth = 1.5, r.stroke(), r.strokeStyle = m(u.t3, .35 * i), r.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
1670
- r.beginPath(), r.moveTo(h.x + e, h.y + 4), r.lineTo(h.x + e, y), r.stroke();
1671
- }), i > .5 && (r.globalAlpha = Math.min(1, (i - .5) / .5), r.font = "bold 14px 'Satoshi Variable', 'DM Sans', sans-serif", r.fillStyle = u.green, r.textAlign = "center", r.fillText(e.label, h.x, y + _ + 18), r.font = f.font, r.fillStyle = f.color, r.fillText("Accepted", h.x, y + _ + 32), r.fillText(`${e.count} quotations`, h.x, y + _ + 44), r.globalAlpha = 1);
1672
- let b = Math.max(20, t.value / s * 100 * i), x = g.y + 18;
1673
- r.fillStyle = m(u.amber, .3 * i), r.strokeStyle = m(u.amber, .5 * i), r.lineWidth = 1.5, r.beginPath(), r.roundRect(g.x - 90 / 2, x, 90, b, [
1677
+ ]), r.fill(), r.strokeStyle = h(u.green, .7 * i), r.lineWidth = 1.5, r.stroke(), r.strokeStyle = h(u.t3, .35 * i), r.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
1678
+ r.beginPath(), r.moveTo(_.x + e, _.y + 4), r.lineTo(_.x + e, x), r.stroke();
1679
+ }), i > .5 && (r.globalAlpha = Math.min(1, (i - .5) / .5), r.font = p.font, r.fillStyle = u.green, r.textAlign = "center", r.fillText(e.label, _.x, x + b + 18), r.font = f.font, r.fillStyle = f.color, r.fillText("Accepted", _.x, x + b + 32), r.fillText(`${e.count} quotations`, _.x, x + b + 44), r.globalAlpha = 1);
1680
+ let S = Math.max(20, t.value / s * 100 * i), C = v.y + 18;
1681
+ r.fillStyle = h(u.amber, .3 * i), r.strokeStyle = h(u.amber, .5 * i), r.lineWidth = 1.5, r.beginPath(), r.roundRect(v.x - 90 / 2, C, 90, S, [
1674
1682
  0,
1675
1683
  0,
1676
1684
  6,
1677
1685
  6
1678
- ]), r.fill(), r.stroke(), r.strokeStyle = m(u.t3, .35 * i), r.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
1679
- r.beginPath(), r.moveTo(g.x + e, g.y + 4), r.lineTo(g.x + e, x), r.stroke();
1680
- }), i > .5 && (r.globalAlpha = Math.min(1, (i - .5) / .5), r.font = "bold 14px 'Satoshi Variable', 'DM Sans', sans-serif", r.fillStyle = u.amber, r.textAlign = "center", r.fillText(t.label, g.x, x + b + 18), r.font = f.font, r.fillStyle = f.color, r.fillText("Submitted", g.x, x + b + 32), r.fillText(`${t.count} quotations`, g.x, x + b + 44), r.globalAlpha = 1), i > .85 && Math.abs(c) > 1 && (r.globalAlpha = Math.min(1, (i - .85) / .15) * .6, r.font = f.font, r.fillStyle = f.color, r.textAlign = "center", r.fillText(`${Math.abs(c).toFixed(1)}° tilt toward accepted`, a, at - 12), r.globalAlpha = 1), l = requestAnimationFrame(d);
1686
+ ]), r.fill(), r.stroke(), r.strokeStyle = h(u.t3, .35 * i), r.lineWidth = 1, [-90 / 3, 90 / 3].forEach((e) => {
1687
+ r.beginPath(), r.moveTo(v.x + e, v.y + 4), r.lineTo(v.x + e, C), r.stroke();
1688
+ }), i > .5 && (r.globalAlpha = Math.min(1, (i - .5) / .5), r.font = p.font, r.fillStyle = u.amber, r.textAlign = "center", r.fillText(t.label, v.x, C + S + 18), r.font = f.font, r.fillStyle = f.color, r.fillText("Submitted", v.x, C + S + 32), r.fillText(`${t.count} quotations`, v.x, C + S + 44), r.globalAlpha = 1), i > .85 && Math.abs(c) > 1 && (r.globalAlpha = Math.min(1, (i - .85) / .15) * .6, r.font = m.font, r.fillStyle = m.color, r.textAlign = "center", r.fillText(`${Math.abs(c).toFixed(1)}° tilt toward accepted`, a, ct - 12), r.globalAlpha = 1), l = requestAnimationFrame(d);
1681
1689
  };
1682
1690
  return d(), () => cancelAnimationFrame(l);
1683
1691
  }, [e, t]), /* @__PURE__ */ s("div", {
1684
1692
  "data-testid": r,
1685
1693
  style: {
1686
1694
  position: "relative",
1687
- width: it,
1688
- height: at
1695
+ width: st,
1696
+ height: ct
1689
1697
  },
1690
1698
  children: /* @__PURE__ */ s("canvas", {
1691
1699
  ref: i,
1692
1700
  role: "img",
1693
1701
  "aria-label": "Quotation balance — accepted vs submitted quotation value",
1694
1702
  style: {
1695
- width: it,
1696
- height: at,
1703
+ width: st,
1704
+ height: ct,
1697
1705
  display: "block"
1698
1706
  }
1699
1707
  })
@@ -1701,35 +1709,35 @@ function ot({ left: e, right: t, "data-testid": r }) {
1701
1709
  }
1702
1710
  //#endregion
1703
1711
  //#region src/components/areaLineChart/AreaLineChart.tsx
1704
- var st = 680, G = 280;
1705
- function ct({ points: e = [], "data-testid": t }) {
1706
- let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: p, hitZonesRef: h } = C(r, {
1707
- width: st,
1712
+ var ut = 680, G = 280;
1713
+ function dt({ points: e = [], "data-testid": t }) {
1714
+ let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: p, hitZonesRef: m } = w(r, {
1715
+ width: ut,
1708
1716
  height: G
1709
1717
  }), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
1710
1718
  return n(() => {
1711
1719
  let e = r.current;
1712
1720
  if (!e) return;
1713
- let t = _(e, st, G);
1721
+ let t = v(e, ut, G);
1714
1722
  l.current = 0;
1715
- let n = st - 54 - 28, i = G - 30 - 54, a = Math.max(...g.map((e) => e.count), 1), s = g.length, c = s > 1 ? n / (s - 1) : n, p = g.map((e, t) => ({
1723
+ let n = ut - 54 - 28, i = G - 30 - 54, a = Math.max(...g.map((e) => e.count), 1), s = g.length, c = s > 1 ? n / (s - 1) : n, p = g.map((e, t) => ({
1716
1724
  x: 54 + t * c,
1717
1725
  y: 30 + i - e.count / a * i,
1718
1726
  point: e
1719
- })), y, b = () => {
1727
+ })), _, b = () => {
1720
1728
  l.current++;
1721
1729
  let e = l.current;
1722
- t.clearRect(0, 0, st, G);
1723
- let r = E(Math.min(e / 72, 1));
1724
- M(o.current, d.current), h.current = [], [
1730
+ t.clearRect(0, 0, ut, G), t.letterSpacing = f.letterSpacing;
1731
+ let r = D(Math.min(e / 72, 1));
1732
+ N(o.current, d.current), m.current = [], [
1725
1733
  .25,
1726
1734
  .5,
1727
1735
  .75,
1728
1736
  1
1729
1737
  ].forEach((e) => {
1730
1738
  let r = 30 + i - e * i;
1731
- t.strokeStyle = m(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(54, r), t.lineTo(54 + n, r), t.stroke(), t.setLineDash([]), t.font = f.font, t.fillStyle = f.color, t.textAlign = "right", t.fillText(String(Math.round(a * e)), 48, r + 3);
1732
- }), t.save(), t.translate(12, 30 + i / 2), t.rotate(-Math.PI / 2), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Submissions", 0, 0), t.restore(), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Week", 54 + n / 2, G - 6), t.strokeStyle = m(u.bd, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(54, 30 + i), t.lineTo(54 + n, 30 + i), t.stroke();
1739
+ t.strokeStyle = h(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(54, r), t.lineTo(54 + n, r), t.stroke(), t.setLineDash([]), t.font = f.font, t.fillStyle = f.color, t.textAlign = "right", t.fillText(String(Math.round(a * e)), 48, r + 3);
1740
+ }), t.save(), t.translate(12, 30 + i / 2), t.rotate(-Math.PI / 2), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Submissions", 0, 0), t.restore(), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Week", 54 + n / 2, G - 6), t.strokeStyle = h(u.bd, .3), t.lineWidth = 1, t.setLineDash([]), t.beginPath(), t.moveTo(54, 30 + i), t.lineTo(54 + n, 30 + i), t.stroke();
1733
1741
  let c = r * (s - 1), g = Math.floor(c) + 1;
1734
1742
  if (g >= 2) {
1735
1743
  t.beginPath(), t.moveTo(p[0].x, 30 + i), t.lineTo(p[0].x, p[0].y);
@@ -1740,29 +1748,29 @@ function ct({ points: e = [], "data-testid": t }) {
1740
1748
  let e = p[Math.min(g - 1, s - 1)];
1741
1749
  t.lineTo(e.x, 30 + i), t.closePath();
1742
1750
  let n = t.createLinearGradient(0, 30, 0, 30 + i);
1743
- n.addColorStop(0, m(u.cyan, .22)), n.addColorStop(1, m(u.cyan, .02)), t.fillStyle = n, t.fill();
1751
+ n.addColorStop(0, h(u.blue, .22)), n.addColorStop(1, h(u.blue, .02)), t.fillStyle = n, t.fill();
1744
1752
  }
1745
1753
  t.beginPath();
1746
1754
  for (let e = 0; e < g; e++) {
1747
1755
  let n = c - Math.floor(c), r = e === g - 1 && e > 0 && e === Math.ceil(c), i = e === 0 || e < g - 1 ? p[e].x : p[e - 1].x + (p[e].x - p[e - 1].x) * (r ? n : 1), a = e === 0 || e < g - 1 ? p[e].y : p[e - 1].y + (p[e].y - p[e - 1].y) * (r ? n : 1);
1748
1756
  e === 0 ? t.moveTo(i, a) : t.lineTo(i, a);
1749
1757
  }
1750
- t.strokeStyle = m(u.cyan, .85), t.lineWidth = 2, t.stroke(), p.forEach((e, n) => {
1758
+ t.strokeStyle = h(u.blue, .85), t.lineWidth = 2, t.stroke(), p.forEach((e, n) => {
1751
1759
  if (n >= g) return;
1752
1760
  let r = `pt-${n}`, s = o.current.get(r) ?? 0;
1753
- w(h.current, r, e.x, e.y, 10, {
1761
+ T(m.current, r, e.x, e.y, 10, {
1754
1762
  label: e.point.week,
1755
1763
  value: `${e.point.count} quotations submitted`,
1756
1764
  sublabel: `£${e.point.value}M value`,
1757
- color: u.cyan
1758
- }), s > 0 && x(t, e.x, 30, 30 + i, m(u.cyan, .15 * s));
1765
+ color: u.blue
1766
+ }), s > 0 && S(t, e.x, 30, 30 + i, h(u.blue, .15 * s));
1759
1767
  let c = e.point.count === a;
1760
- (s > 0 || c) && v(t, e.x, e.y, 14, u.cyan, (c ? .3 : 0) + s * .25), t.beginPath(), t.arc(e.x, e.y, s > 0 ? 5 : 3.5, 0, Math.PI * 2), t.fillStyle = m(u.cyan, s > 0 ? 1 : .8), t.fill(), (s > 0 || c) && (t.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.cyan, t.textAlign = "center", t.fillText(String(e.point.count), e.x, e.y - 10)), t.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = s > 0 ? u.cyan : f.color, t.textAlign = "center", t.fillText(e.point.week, e.x, G - 54 + 14);
1761
- }), y = requestAnimationFrame(b);
1768
+ (s > 0 || c) && y(t, e.x, e.y, 14, u.blue, (c ? .3 : 0) + s * .25), t.beginPath(), t.arc(e.x, e.y, s > 0 ? 5 : 3.5, 0, Math.PI * 2), t.fillStyle = h(u.blue, s > 0 ? 1 : .8), t.fill(), (s > 0 || c) && (t.font = f.font, t.fillStyle = u.blue, t.textAlign = "center", t.fillText(String(e.point.count), e.x, e.y - 10)), t.font = f.font, t.fillStyle = s > 0 ? u.blue : f.color, t.textAlign = "center", t.fillText(e.point.week, e.x, G - 54 + 14);
1769
+ }), _ = requestAnimationFrame(b);
1762
1770
  };
1763
- return b(), () => cancelAnimationFrame(y);
1764
- }, [g]), g.length < 2 ? /* @__PURE__ */ s(F, {
1765
- width: st,
1771
+ return b(), () => cancelAnimationFrame(_);
1772
+ }, [g]), g.length < 2 ? /* @__PURE__ */ s(I, {
1773
+ width: ut,
1766
1774
  height: G,
1767
1775
  "data-testid": t
1768
1776
  }) : /* @__PURE__ */ s("div", {
@@ -1775,7 +1783,7 @@ function ct({ points: e = [], "data-testid": t }) {
1775
1783
  children: /* @__PURE__ */ c("div", {
1776
1784
  style: {
1777
1785
  position: "relative",
1778
- width: st,
1786
+ width: ut,
1779
1787
  height: G
1780
1788
  },
1781
1789
  children: [/* @__PURE__ */ s("canvas", {
@@ -1783,13 +1791,13 @@ function ct({ points: e = [], "data-testid": t }) {
1783
1791
  role: "img",
1784
1792
  "aria-label": "Trend chart — count over time",
1785
1793
  style: {
1786
- width: st,
1794
+ width: ut,
1787
1795
  height: G,
1788
1796
  display: "block"
1789
1797
  }
1790
- }), /* @__PURE__ */ s(S, {
1798
+ }), /* @__PURE__ */ s(C, {
1791
1799
  ...p,
1792
- parentW: st,
1800
+ parentW: ut,
1793
1801
  parentH: G
1794
1802
  })]
1795
1803
  })
@@ -1797,83 +1805,83 @@ function ct({ points: e = [], "data-testid": t }) {
1797
1805
  }
1798
1806
  //#endregion
1799
1807
  //#region src/components/trend/Trend.tsx
1800
- var lt = 680, K = 280, ut = 54, dt = 28, ft = 64, pt = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", mt = 12;
1801
- function ht({ points: e = [], "data-testid": t }) {
1808
+ var ft = 680, K = 280, pt = 54, mt = 28, ht = 64, gt = f.font, _t = 12;
1809
+ function vt({ points: e = [], "data-testid": t }) {
1802
1810
  let r = a(null), o = a(null), l = a(0), d = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), p = i(() => {
1803
- if (d.length <= 1) return ft;
1811
+ if (d.length <= 1) return ht;
1804
1812
  let e = document.createElement("canvas").getContext("2d");
1805
- if (!e) return ft;
1806
- e.font = pt;
1813
+ if (!e) return ht;
1814
+ e.font = gt;
1807
1815
  let t = Math.max(...d.map((t) => e.measureText(t.week).width));
1808
- return Math.max(ft, t + mt);
1809
- }, [d]), h = Math.max(lt - ut, dt + Math.max(0, d.length - 1) * p), { tooltip: g, hitZonesRef: v } = C(r, {
1810
- width: h,
1816
+ return Math.max(ht, t + _t);
1817
+ }, [d]), m = Math.max(ft - pt, mt + Math.max(0, d.length - 1) * p), { tooltip: g, hitZonesRef: _ } = w(r, {
1818
+ width: m,
1811
1819
  height: K
1812
1820
  });
1813
1821
  return n(() => {
1814
1822
  let e = r.current;
1815
1823
  if (!e) return;
1816
- let t = _(e, h, K), n = o.current ? _(o.current, ut, K) : null;
1824
+ let t = v(e, m, K), n = o.current ? v(o.current, pt, K) : null;
1817
1825
  l.current = 0;
1818
- let i = h - dt, a = K - 30 - 54, s = Math.max(...d.map((e) => e.count), 1), c = d.length, g = c > 1 ? Math.max(i / (c - 1), p) : i, y = d.map((e, t) => ({
1826
+ let i = m - mt, a = K - 30 - 54, s = Math.max(...d.map((e) => e.count), 1), c = d.length, g = c > 1 ? Math.max(i / (c - 1), p) : i, y = d.map((e, t) => ({
1819
1827
  x: t * g,
1820
1828
  y: 30 + a - e.count / s * a,
1821
1829
  point: e
1822
1830
  }));
1823
- n && (n.clearRect(0, 0, ut, K), n.fillStyle = u.bg, n.fillRect(0, 0, ut, K), [
1831
+ n && (n.clearRect(0, 0, pt, K), n.letterSpacing = f.letterSpacing, n.fillStyle = u.bg, n.fillRect(0, 0, pt, K), [
1824
1832
  .25,
1825
1833
  .5,
1826
1834
  .75,
1827
1835
  1
1828
1836
  ].forEach((e) => {
1829
1837
  let t = 30 + a - e * a;
1830
- n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(String(Math.round(s * e)), ut - 6, t + 3);
1838
+ n.font = f.font, n.fillStyle = f.color, n.textAlign = "right", n.fillText(String(Math.round(s * e)), pt - 6, t + 3);
1831
1839
  }), n.save(), n.translate(12, 30 + a / 2), n.rotate(-Math.PI / 2), n.font = f.font, n.fillStyle = f.color, n.textAlign = "center", n.fillText("Count", 0, 0), n.restore());
1832
1840
  let b, x = () => {
1833
1841
  l.current++;
1834
- let e = Math.min(l.current / 72, 1), n = E(e);
1835
- t.clearRect(0, 0, h, K), [
1842
+ let e = Math.min(l.current / 72, 1), n = D(e);
1843
+ t.clearRect(0, 0, m, K), t.letterSpacing = f.letterSpacing, [
1836
1844
  .25,
1837
1845
  .5,
1838
1846
  .75,
1839
1847
  1
1840
1848
  ].forEach((e) => {
1841
1849
  let n = 30 + a - e * a;
1842
- t.strokeStyle = m(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(0, n), t.lineTo(i, n), t.stroke(), t.setLineDash([]);
1843
- }), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Period", i / 2, K - 6), t.strokeStyle = m(u.bd, .3), t.lineWidth = 1, t.beginPath(), t.moveTo(0, 30 + a), t.lineTo(i, 30 + a), t.stroke();
1850
+ t.strokeStyle = h(u.bd, .18), t.lineWidth = 1, t.setLineDash([3, 5]), t.beginPath(), t.moveTo(0, n), t.lineTo(i, n), t.stroke(), t.setLineDash([]);
1851
+ }), t.font = f.font, t.fillStyle = f.color, t.textAlign = "center", t.fillText("Period", i / 2, K - 6), t.strokeStyle = h(u.bd, .3), t.lineWidth = 1, t.beginPath(), t.moveTo(0, 30 + a), t.lineTo(i, 30 + a), t.stroke();
1844
1852
  let r = n * (c - 1), o = Math.floor(r) + 1;
1845
1853
  if (o >= 2) {
1846
1854
  t.beginPath(), t.moveTo(y[0].x, 30 + a), t.lineTo(y[0].x, y[0].y);
1847
1855
  for (let e = 1; e < o; e++) {
1848
- let n = r - Math.floor(r), i = e === o - 1 && e === Math.ceil(r), a = i ? y[e - 1].x + (y[e].x - y[e - 1].x) * n : y[e].x, s = i ? y[e - 1].y + (y[e].y - y[e - 1].y) * n : y[e].y;
1856
+ let n = r - Math.floor(r), i = e === o - 1 && e === Math.ceil(r) && n > 0, a = i ? y[e - 1].x + (y[e].x - y[e - 1].x) * n : y[e].x, s = i ? y[e - 1].y + (y[e].y - y[e - 1].y) * n : y[e].y;
1849
1857
  t.lineTo(a, s);
1850
1858
  }
1851
1859
  t.lineTo(y[o - 1].x, 30 + a), t.closePath();
1852
1860
  let e = t.createLinearGradient(0, 30, 0, 30 + a);
1853
- e.addColorStop(0, m(u.cyan, .22)), e.addColorStop(1, m(u.cyan, .02)), t.fillStyle = e, t.fill();
1861
+ e.addColorStop(0, h(u.blue, .22)), e.addColorStop(1, h(u.blue, .02)), t.fillStyle = e, t.fill();
1854
1862
  }
1855
1863
  t.beginPath();
1856
1864
  for (let e = 0; e < o; e++) {
1857
- let n = r - Math.floor(r), i = e === o - 1 && e > 0 && e === Math.ceil(r), a = i ? y[e - 1].x + (y[e].x - y[e - 1].x) * n : y[e].x, s = i ? y[e - 1].y + (y[e].y - y[e - 1].y) * n : y[e].y;
1865
+ let n = r - Math.floor(r), i = e === o - 1 && e > 0 && e === Math.ceil(r) && n > 0, a = i ? y[e - 1].x + (y[e].x - y[e - 1].x) * n : y[e].x, s = i ? y[e - 1].y + (y[e].y - y[e - 1].y) * n : y[e].y;
1858
1866
  e === 0 ? t.moveTo(a, s) : t.lineTo(a, s);
1859
1867
  }
1860
- t.strokeStyle = m(u.cyan, .85), t.lineWidth = 2, t.stroke(), v.current = [], y.forEach((e, n) => {
1861
- n >= o || (w(v.current, `pt-${n}`, e.x, e.y, 10, {
1868
+ t.strokeStyle = h(u.blue, .85), t.lineWidth = 2, t.stroke(), _.current = [], y.forEach((e, n) => {
1869
+ n >= o || (T(_.current, `pt-${n}`, e.x, e.y, 10, {
1862
1870
  label: e.point.week,
1863
1871
  value: `${e.point.count} submissions`,
1864
1872
  sublabel: `£${e.point.value}M value`,
1865
- color: u.cyan
1866
- }), t.beginPath(), t.arc(e.x, e.y, 3.5, 0, Math.PI * 2), t.fillStyle = m(u.cyan, .8), t.fill(), t.font = pt, t.fillStyle = f.color, t.textAlign = "center", t.fillText(e.point.week, e.x, K - 54 + 14));
1873
+ color: u.blue
1874
+ }), t.beginPath(), t.arc(e.x, e.y, 3.5, 0, Math.PI * 2), t.fillStyle = h(u.blue, .8), t.fill(), t.font = gt, t.fillStyle = f.color, t.textAlign = n === 0 ? "left" : n === y.length - 1 ? "right" : "center", t.fillText(e.point.week, e.x, K - 54 + 14));
1867
1875
  }), e < 1 && (b = requestAnimationFrame(x));
1868
1876
  };
1869
1877
  return x(), () => cancelAnimationFrame(b);
1870
1878
  }, [
1871
1879
  d,
1872
- h,
1880
+ m,
1873
1881
  p,
1874
- v
1875
- ]), d.length < 2 ? /* @__PURE__ */ s(F, {
1876
- width: lt,
1882
+ _
1883
+ ]), d.length < 2 ? /* @__PURE__ */ s(I, {
1884
+ width: ft,
1877
1885
  height: K,
1878
1886
  "data-testid": t
1879
1887
  }) : /* @__PURE__ */ c("div", {
@@ -1887,7 +1895,7 @@ function ht({ points: e = [], "data-testid": t }) {
1887
1895
  ref: o,
1888
1896
  "aria-hidden": "true",
1889
1897
  style: {
1890
- width: ut,
1898
+ width: pt,
1891
1899
  height: K,
1892
1900
  display: "block",
1893
1901
  flexShrink: 0
@@ -1901,7 +1909,7 @@ function ht({ points: e = [], "data-testid": t }) {
1901
1909
  children: /* @__PURE__ */ c("div", {
1902
1910
  style: {
1903
1911
  position: "relative",
1904
- width: h,
1912
+ width: m,
1905
1913
  height: K
1906
1914
  },
1907
1915
  children: [/* @__PURE__ */ s("canvas", {
@@ -1909,13 +1917,13 @@ function ht({ points: e = [], "data-testid": t }) {
1909
1917
  role: "img",
1910
1918
  "aria-label": "Trend chart — count over time",
1911
1919
  style: {
1912
- width: h,
1920
+ width: m,
1913
1921
  height: K,
1914
1922
  display: "block"
1915
1923
  }
1916
- }), /* @__PURE__ */ s(S, {
1924
+ }), /* @__PURE__ */ s(C, {
1917
1925
  ...g,
1918
- parentW: h,
1926
+ parentW: m,
1919
1927
  parentH: K
1920
1928
  })]
1921
1929
  })
@@ -1924,60 +1932,67 @@ function ht({ points: e = [], "data-testid": t }) {
1924
1932
  }
1925
1933
  //#endregion
1926
1934
  //#region src/components/proportionalBandChart/ProportionalBandChart.tsx
1927
- var q = 680, gt = 240, _t = {
1935
+ var q = 680, yt = 240;
1936
+ function bt(e, t, n) {
1937
+ if (e.measureText(t).width <= n) return t;
1938
+ let r = t;
1939
+ for (; r.length > 0 && e.measureText(`${r}…`).width > n;) r = r.slice(0, -1);
1940
+ return `${r}…`;
1941
+ }
1942
+ var xt = {
1928
1943
  Critical: u.red,
1929
1944
  High: u.orange,
1930
1945
  Medium: u.amber,
1931
1946
  Low: u.green
1932
1947
  };
1933
- function vt({ severities: e = [], "data-testid": t }) {
1934
- let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: p, hitZonesRef: h } = C(r, {
1948
+ function St({ severities: e = [], "data-testid": t }) {
1949
+ let r = a(null), o = a(/* @__PURE__ */ new Map()), l = a(0), { hoveredRef: d, tooltip: m, hitZonesRef: g } = w(r, {
1935
1950
  width: q,
1936
- height: gt
1937
- }), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
1951
+ height: yt
1952
+ }), _ = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
1938
1953
  return n(() => {
1939
1954
  let e = r.current;
1940
1955
  if (!e) return;
1941
- let t = _(e, q, gt);
1956
+ let t = v(e, q, yt);
1942
1957
  l.current = 0;
1943
- let n = g.reduce((e, t) => e + t.count, 0), i = q - 28 - 28, a = gt - 50 - 52, s = g.map((e) => e.count / n * i), c, p = () => {
1958
+ let n = _.reduce((e, t) => e + t.count, 0), i = q - 28 - 28, a = yt - 50 - 52, s = _.map((e) => e.count / n * i), c, m = () => {
1944
1959
  l.current++;
1945
1960
  let e = l.current;
1946
- t.clearRect(0, 0, q, gt);
1947
- let r = D(Math.min(e / 60, 1));
1948
- M(o.current, d.current), h.current = [], t.strokeStyle = m(u.bd, .2), t.lineWidth = 1, t.beginPath(), t.rect(28, 50, i, a), t.stroke(), t.strokeStyle = m(u.t4, .15), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(q / 2, 50), t.lineTo(q / 2, 50 + a), t.stroke(), t.setLineDash([]);
1949
- let _ = 28;
1950
- g.forEach((e, i) => {
1951
- let c = _t[e.severity] ?? u.blue, l = s[i];
1961
+ t.clearRect(0, 0, q, yt), t.letterSpacing = f.letterSpacing;
1962
+ let r = O(Math.min(e / 60, 1));
1963
+ N(o.current, d.current), g.current = [], t.strokeStyle = h(u.bd, .2), t.lineWidth = 1, t.beginPath(), t.rect(28, 50, i, a), t.stroke(), t.strokeStyle = h(u.t4, .15), t.lineWidth = 1, t.setLineDash([4, 4]), t.beginPath(), t.moveTo(q / 2, 50), t.lineTo(q / 2, 50 + a), t.stroke(), t.setLineDash([]);
1964
+ let v = 28;
1965
+ _.forEach((e, i) => {
1966
+ let c = xt[e.severity] ?? u.blue, l = s[i];
1952
1967
  l * r;
1953
- let d = o.current.get(e.severity) ?? 0, p = _ + l / 2, g = l * .85;
1954
- p - g / 2;
1955
- let y = l * r, b = g * r, x = p - b / 2;
1956
- if (y > 0 && (d > 0 && v(t, _ + y / 2, 50 + a / 2, y * .4, c, .15 * d), t.beginPath(), t.moveTo(x, 50), t.lineTo(x + b, 50), t.lineTo(_ + y, 50 + a), t.lineTo(_, 50 + a), t.closePath(), t.fillStyle = m(c, .45 + d * .25), t.fill(), t.strokeStyle = m(c, (.5 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(x, 50), t.lineTo(x + b, 50), t.stroke(), t.strokeStyle = m(c, (.3 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(_, 50 + a), t.lineTo(_ + y, 50 + a), t.stroke()), T(h.current, e.severity, _, 50, l, a, {
1968
+ let d = o.current.get(e.severity) ?? 0, m = v + l / 2, _ = l * .85;
1969
+ m - _ / 2;
1970
+ let b = l * r, x = _ * r, S = m - x / 2;
1971
+ if (b > 0 && (d > 0 && y(t, v + b / 2, 50 + a / 2, b * .4, c, .15 * d), t.beginPath(), t.moveTo(S, 50), t.lineTo(S + x, 50), t.lineTo(v + b, 50 + a), t.lineTo(v, 50 + a), t.closePath(), t.fillStyle = h(c, .45 + d * .25), t.fill(), t.strokeStyle = h(c, (.5 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(S, 50), t.lineTo(S + x, 50), t.stroke(), t.strokeStyle = h(c, (.3 + d * .3) * r), t.lineWidth = d > 0 ? 2 : 1, t.beginPath(), t.moveTo(v, 50 + a), t.lineTo(v + b, 50 + a), t.stroke()), E(g.current, e.severity, v, 50, l, a, {
1957
1972
  label: e.severity,
1958
1973
  value: `${e.count} Early Warnings`,
1959
1974
  sublabel: `${Math.round(e.count / n * 100)}% of all EWs`,
1960
1975
  color: c
1961
1976
  }), r > .5) {
1962
- let i = Math.min(1, (r - .5) / .5), o = _ + l / 2;
1963
- t.globalAlpha = i, t.font = "bold " + f.font, t.fillStyle = d > 0 ? c : m(c, .9), t.textAlign = "center", t.fillText(e.severity, o, 38), t.font = "bold " + f.font, t.fillStyle = d > 0 ? u.t1 : m(u.t1, .85), t.fillText(String(e.count), o, 50 + a / 2 + 6), t.font = f.font, t.fillStyle = d > 0 ? c : f.color, t.fillText(`${Math.round(e.count / n * 100)}%`, o, 50 + a + 18), t.globalAlpha = 1;
1977
+ let i = Math.min(1, (r - .5) / .5), o = v + l / 2;
1978
+ t.globalAlpha = i, t.font = "bold " + f.font, t.fillStyle = d > 0 ? c : h(c, .9), t.textAlign = "center", t.fillText(bt(t, e.severity, l - 12), o, 38), t.font = p.font, t.fillStyle = d > 0 ? u.t1 : h(u.t1, .85), t.fillText(String(e.count), o, 50 + a / 2 + 6), t.font = f.font, t.fillStyle = d > 0 ? c : f.color, t.fillText(`${Math.round(e.count / n * 100)}%`, o, 50 + a + 18), t.globalAlpha = 1;
1964
1979
  }
1965
- _ += l;
1980
+ v += l;
1966
1981
  });
1967
- let y = t.createLinearGradient(28, 0, 28 + i, 0);
1968
- y.addColorStop(0, m(u.red, .03)), y.addColorStop(.33, m(u.orange, .03)), y.addColorStop(.66, m(u.amber, .03)), y.addColorStop(1, m(u.green, .03)), t.fillStyle = y, t.fillRect(28, 50, i * r, a), c = requestAnimationFrame(p);
1982
+ let b = t.createLinearGradient(28, 0, 28 + i, 0);
1983
+ b.addColorStop(0, h(u.red, .03)), b.addColorStop(.33, h(u.orange, .03)), b.addColorStop(.66, h(u.amber, .03)), b.addColorStop(1, h(u.green, .03)), t.fillStyle = b, t.fillRect(28, 50, i * r, a), c = requestAnimationFrame(m);
1969
1984
  };
1970
- return p(), () => cancelAnimationFrame(c);
1971
- }, [g]), g.length === 0 ? /* @__PURE__ */ s(F, {
1985
+ return m(), () => cancelAnimationFrame(c);
1986
+ }, [_]), _.length === 0 ? /* @__PURE__ */ s(I, {
1972
1987
  width: q,
1973
- height: gt,
1988
+ height: yt,
1974
1989
  "data-testid": t
1975
1990
  }) : /* @__PURE__ */ c("div", {
1976
1991
  "data-testid": t,
1977
1992
  style: {
1978
1993
  position: "relative",
1979
1994
  width: q,
1980
- height: gt
1995
+ height: yt
1981
1996
  },
1982
1997
  children: [/* @__PURE__ */ s("canvas", {
1983
1998
  ref: r,
@@ -1985,68 +2000,68 @@ function vt({ severities: e = [], "data-testid": t }) {
1985
2000
  "aria-label": "Early Warning severity distribution — prism spectrum bands",
1986
2001
  style: {
1987
2002
  width: q,
1988
- height: gt,
2003
+ height: yt,
1989
2004
  display: "block"
1990
2005
  }
1991
- }), /* @__PURE__ */ s(S, {
1992
- ...p,
2006
+ }), /* @__PURE__ */ s(C, {
2007
+ ...m,
1993
2008
  parentW: q,
1994
- parentH: gt
2009
+ parentH: yt
1995
2010
  })]
1996
2011
  });
1997
2012
  }
1998
2013
  //#endregion
1999
2014
  //#region src/components/hubAndSpokeRadialChart/HubAndSpokeRadialChart.tsx
2000
- var J = 460, Y = 300, yt = {
2015
+ var J = 460, Y = 300, Ct = {
2001
2016
  Open: u.red,
2002
2017
  Submitted: u.amber,
2003
2018
  Closed: u.green
2004
2019
  };
2005
- function bt({ segments: e = [], title: t, "data-testid": r }) {
2006
- let o = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), { hoveredRef: p, tooltip: h, hitZonesRef: g } = C(o, {
2020
+ function wt({ segments: e = [], title: t, "data-testid": r }) {
2021
+ let o = a(null), l = a(0), d = a(/* @__PURE__ */ new Map()), { hoveredRef: m, tooltip: g, hitZonesRef: _ } = w(o, {
2007
2022
  width: J,
2008
2023
  height: Y
2009
- }), x = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
2024
+ }), S = i(() => e.filter((e) => typeof e == "object" && !!e), [e]);
2010
2025
  return n(() => {
2011
2026
  let e = o.current;
2012
2027
  if (!e) return;
2013
- let t = _(e, J, Y);
2028
+ let t = v(e, J, Y);
2014
2029
  l.current = 0;
2015
- let n = J * .5, r = Y * .54, i = J * .22, a = x.reduce((e, t) => e + t.count, 0), s = Math.max(...x.map((e) => e.count), 1), c, h = () => {
2030
+ let n = J * .5, r = Y * .54, i = J * .22, a = S.reduce((e, t) => e + t.count, 0), s = Math.max(...S.map((e) => e.count), 1), c, g = () => {
2016
2031
  l.current++;
2017
2032
  let e = l.current;
2018
- t.clearRect(0, 0, J, Y), g.current = [], d.current.forEach((e, t) => {
2019
- let n = t === p.current ? 1 : 0, r = e + (n - e) * .12;
2033
+ t.clearRect(0, 0, J, Y), t.letterSpacing = f.letterSpacing, _.current = [], d.current.forEach((e, t) => {
2034
+ let n = t === m.current ? 1 : 0, r = e + (n - e) * .12;
2020
2035
  Math.abs(r - n) < .005 ? n === 0 ? d.current.delete(t) : d.current.set(t, 1) : d.current.set(t, r);
2021
- }), p.current && !d.current.has(p.current) && d.current.set(p.current, 0), y(t, J, Y, e, 40, m(u.blue, .04)), x.forEach((a, o) => {
2022
- let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, d = r + Math.sin(c) * i, p = yt[a.status] ?? u.blue, h = 2 + a.count / s * 8;
2023
- t.beginPath(), t.moveTo(n, r), t.lineTo(l, d), t.strokeStyle = m(p, .08), t.lineWidth = h * 2, t.stroke(), t.beginPath(), t.moveTo(n, r), t.lineTo(l, d), t.strokeStyle = m(p, .25), t.lineWidth = 1, t.stroke();
2024
- let g = (e * .005 + o * .33) % 1, _ = n + (l - n) * g, y = r + (d - r) * g;
2025
- v(t, _, y, 6, p, .4), t.beginPath(), t.arc(_, y, 2, 0, Math.PI * 2), t.fillStyle = m(p, .8), t.fill();
2036
+ }), m.current && !d.current.has(m.current) && d.current.set(m.current, 0), b(t, J, Y, e, 40, h(u.blue, .04)), S.forEach((a, o) => {
2037
+ let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, d = r + Math.sin(c) * i, f = Ct[a.status] ?? u.blue, m = 2 + a.count / s * 8;
2038
+ t.beginPath(), t.moveTo(n, r), t.lineTo(l, d), t.strokeStyle = h(f, .08), t.lineWidth = m * 2, t.stroke(), t.beginPath(), t.moveTo(n, r), t.lineTo(l, d), t.strokeStyle = h(f, .25), t.lineWidth = 1, t.stroke();
2039
+ let g = (e * .005 + o * .33) % 1, _ = n + (l - n) * g, v = r + (d - r) * g;
2040
+ y(t, _, v, 6, f, .4), t.beginPath(), t.arc(_, v, 2, 0, Math.PI * 2), t.fillStyle = h(f, .8), t.fill();
2026
2041
  let b = (n + l) / 2, x = (r + d) / 2;
2027
- t.font = "bold " + f.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = m(p, .85), t.fillText(String(a.count), b, x);
2028
- }), x.forEach((e, o) => {
2029
- let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, p = r + Math.sin(c) * i, h = yt[e.status] ?? u.blue, _ = 10 + e.count / s * 18, y = d.current.get(e.status) ?? 0;
2030
- v(t, l, p, _ * 2.5, h, .2 + y * .15);
2031
- let b = t.createRadialGradient(l, p - _ * .2, 0, l, p, _);
2032
- b.addColorStop(0, m(h, .8 + y * .2)), b.addColorStop(1, m(h, .4 + y * .1)), t.beginPath(), t.arc(l, p, _, 0, Math.PI * 2), t.fillStyle = b, t.fill(), t.font = "bold " + f.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = m(u.t1, .9), t.fillText(e.status, l, p), w(g.current, e.status, l, p, _ + 6, {
2042
+ t.font = p.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(f, .85), t.fillText(String(a.count), b, x);
2043
+ }), S.forEach((e, o) => {
2044
+ let c = o / 3 * Math.PI * 2 - Math.PI / 2, l = n + Math.cos(c) * i, p = r + Math.sin(c) * i, m = Ct[e.status] ?? u.blue, g = 10 + e.count / s * 18, v = d.current.get(e.status) ?? 0;
2045
+ y(t, l, p, g * 2.5, m, .2 + v * .15);
2046
+ let b = t.createRadialGradient(l, p - g * .2, 0, l, p, g);
2047
+ b.addColorStop(0, h(m, .8 + v * .2)), b.addColorStop(1, h(m, .4 + v * .1)), t.beginPath(), t.arc(l, p, g, 0, Math.PI * 2), t.fillStyle = b, t.fill(), t.font = "bold " + f.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(u.t1, .9), t.fillText(e.status, l, p), T(_.current, e.status, l, p, g + 6, {
2033
2048
  label: e.status,
2034
2049
  value: `${e.count} Early Warnings`,
2035
2050
  sublabel: `${Math.round(e.count / a * 100)}%`,
2036
- color: h
2051
+ color: m
2037
2052
  });
2038
2053
  });
2039
2054
  let o = d.current.get("center") ?? 0;
2040
- v(t, n, r, 36, u.t3, .2 + o * .15);
2041
- let _ = t.createRadialGradient(n, r - 4, 0, n, r, 22);
2042
- _.addColorStop(0, m(u.t2, .9)), _.addColorStop(1, m(u.t3, .5)), t.beginPath(), t.arc(n, r, 22, 0, Math.PI * 2), t.fillStyle = _, t.fill(), t.font = f.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = m(u.t1, .9), t.fillText("EW Status", n, r - 4), t.font = "bold " + f.font, t.fillStyle = u.t1, t.fillText(String(a), n, r + 8), w(g.current, "center", n, r, 28, {
2055
+ y(t, n, r, 36, u.t3, .2 + o * .15);
2056
+ let v = t.createRadialGradient(n, r - 4, 0, n, r, 22);
2057
+ v.addColorStop(0, h(u.t2, .9)), v.addColorStop(1, h(u.t3, .5)), t.beginPath(), t.arc(n, r, 22, 0, Math.PI * 2), t.fillStyle = v, t.fill(), t.font = p.font, t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = h(u.t1, .9), t.fillText("EW Status", n, r - 4), t.font = "bold " + f.font, t.fillStyle = u.t1, t.fillText(String(a), n, r + 8), T(_.current, "center", n, r, 28, {
2043
2058
  label: "Total EW Status",
2044
2059
  value: `${a} Early Warnings`,
2045
2060
  color: u.t3
2046
- }), b(t, J, Y, e, .015), c = requestAnimationFrame(h);
2061
+ }), x(t, J, Y, e, .015), c = requestAnimationFrame(g);
2047
2062
  };
2048
- return h(), () => cancelAnimationFrame(c);
2049
- }, [x, t]), x.length === 0 ? /* @__PURE__ */ s(F, {
2063
+ return g(), () => cancelAnimationFrame(c);
2064
+ }, [S, t]), S.length === 0 ? /* @__PURE__ */ s(I, {
2050
2065
  width: J,
2051
2066
  height: Y,
2052
2067
  "data-testid": r
@@ -2067,8 +2082,8 @@ function bt({ segments: e = [], title: t, "data-testid": r }) {
2067
2082
  display: "block",
2068
2083
  borderRadius: 8
2069
2084
  }
2070
- }), /* @__PURE__ */ s(S, {
2071
- ...h,
2085
+ }), /* @__PURE__ */ s(C, {
2086
+ ...g,
2072
2087
  parentW: J,
2073
2088
  parentH: Y
2074
2089
  })]
@@ -2076,27 +2091,27 @@ function bt({ segments: e = [], title: t, "data-testid": r }) {
2076
2091
  }
2077
2092
  //#endregion
2078
2093
  //#region src/components/trendChart/TrendChart.tsx
2079
- var xt = 280, X = 96;
2080
- function St({ points: e = [], className: t, colors: r }) {
2094
+ var Tt = 280, X = 96;
2095
+ function Et({ points: e = [], className: t, colors: r }) {
2081
2096
  let o = a(null), d = a(/* @__PURE__ */ new Map()), f = a(0), p = i(() => e.map(([e, t]) => {
2082
2097
  let n = String(t).match(/-?\d+(\.\d+)?/);
2083
2098
  return {
2084
2099
  label: e,
2085
2100
  value: n ? Number(n[0]) : 0
2086
2101
  };
2087
- }), [e]), { mouseRef: h, hoveredRef: g, tooltip: y, hitZonesRef: b } = C(o, {
2088
- width: xt,
2102
+ }), [e]), { mouseRef: m, hoveredRef: g, tooltip: _, hitZonesRef: b } = w(o, {
2103
+ width: Tt,
2089
2104
  height: X
2090
2105
  });
2091
2106
  return n(() => {
2092
2107
  let e = o.current;
2093
2108
  if (!e) return;
2094
- let t = _(e, xt, X);
2109
+ let t = v(e, Tt, X);
2095
2110
  f.current = 0;
2096
2111
  let n = r?.line ?? u.blue, i = r?.point ?? u.blue, a = r?.axisLine ?? u.bd, s, c = () => {
2097
2112
  f.current++;
2098
2113
  let e = f.current;
2099
- if (t.clearRect(0, 0, xt, X), p.length < 2) {
2114
+ if (t.clearRect(0, 0, Tt, X), p.length < 2) {
2100
2115
  s = requestAnimationFrame(c);
2101
2116
  return;
2102
2117
  }
@@ -2105,35 +2120,35 @@ function St({ points: e = [], className: t, colors: r }) {
2105
2120
  right: 12,
2106
2121
  top: 16,
2107
2122
  bottom: 20
2108
- }, o = xt - r.left - r.right, l = X - r.top - r.bottom, _ = p.map((e) => e.value), y = Math.min(..._), S = Math.max(..._) - y || 1, C = (e) => r.left + e / (p.length - 1) * o, T = (e) => r.top + (1 - (e - y) / S) * l, E = 1 - (1 - Math.min(e / 48, 1)) ** 3, D = Math.max(2, Math.floor(E * p.length));
2109
- if (M(d.current, g.current), b.current = [], t.strokeStyle = m(a, .3), t.lineWidth = .5, t.setLineDash([]), t.beginPath(), t.moveTo(r.left, X - r.bottom), t.lineTo(xt - r.right, X - r.bottom), t.stroke(), t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = m(u.t4, .9), t.textAlign = "center", p.forEach((e, n) => {
2123
+ }, o = Tt - r.left - r.right, l = X - r.top - r.bottom, _ = p.map((e) => e.value), v = Math.min(..._), x = Math.max(..._) - v || 1, C = (e) => r.left + e / (p.length - 1) * o, w = (e) => r.top + (1 - (e - v) / x) * l, E = 1 - (1 - Math.min(e / 48, 1)) ** 3, D = Math.max(2, Math.floor(E * p.length));
2124
+ if (N(d.current, g.current), b.current = [], t.strokeStyle = h(a, .3), t.lineWidth = .5, t.setLineDash([]), t.beginPath(), t.moveTo(r.left, X - r.bottom), t.lineTo(Tt - r.right, X - r.bottom), t.stroke(), t.font = "9px 'JetBrains Mono', monospace", t.fillStyle = h(u.t4, .9), t.textAlign = "center", p.forEach((e, n) => {
2110
2125
  t.fillText(e.label.replace("Day ", "D"), C(n), X - 4);
2111
- }), h.current.over && g.current) {
2126
+ }), m.current.over && g.current) {
2112
2127
  let e = parseInt(g.current.split("-")[1]);
2113
- isNaN(e) || x(t, C(e), r.top, r.top + l);
2128
+ isNaN(e) || S(t, C(e), r.top, r.top + l);
2114
2129
  }
2115
2130
  if (D > 1) {
2116
2131
  let e = t.createLinearGradient(0, r.top, 0, r.top + l);
2117
- e.addColorStop(0, m(n, .15)), e.addColorStop(1, m(n, 0)), t.fillStyle = e, t.beginPath(), t.moveTo(C(0), r.top + l);
2118
- for (let e = 0; e < D; e++) t.lineTo(C(e), T(p[e].value));
2119
- t.lineTo(C(D - 1), r.top + l), t.closePath(), t.fill(), t.strokeStyle = m(n, .8), t.lineWidth = 1.5, t.setLineDash([]), t.beginPath();
2132
+ e.addColorStop(0, h(n, .15)), e.addColorStop(1, h(n, 0)), t.fillStyle = e, t.beginPath(), t.moveTo(C(0), r.top + l);
2133
+ for (let e = 0; e < D; e++) t.lineTo(C(e), w(p[e].value));
2134
+ t.lineTo(C(D - 1), r.top + l), t.closePath(), t.fill(), t.strokeStyle = h(n, .8), t.lineWidth = 1.5, t.setLineDash([]), t.beginPath();
2120
2135
  for (let e = 0; e < D; e++) {
2121
- let n = C(e), r = T(p[e].value);
2136
+ let n = C(e), r = w(p[e].value);
2122
2137
  e === 0 ? t.moveTo(n, r) : t.lineTo(n, r);
2123
2138
  }
2124
2139
  t.stroke();
2125
2140
  }
2126
2141
  for (let e = 0; e < D; e++) {
2127
- let n = C(e), r = T(p[e].value), a = `tp-${e}`, o = d.current.get(a) ?? 0, s = e === p.length - 1;
2128
- w(b.current, a, n, r, 10, {
2142
+ let n = C(e), r = w(p[e].value), a = `tp-${e}`, o = d.current.get(a) ?? 0, s = e === p.length - 1;
2143
+ T(b.current, a, n, r, 10, {
2129
2144
  label: p[e].label,
2130
2145
  value: String(p[e].value),
2131
2146
  color: s ? u.red : i
2132
- }), o > 0 && !s && (v(t, n, r, 12 * o, i, .2 * o), t.fillStyle = m(i, .8), t.beginPath(), t.arc(n, r, 3 + o * 2, 0, Math.PI * 2), t.fill());
2147
+ }), o > 0 && !s && (y(t, n, r, 12 * o, i, .2 * o), t.fillStyle = h(i, .8), t.beginPath(), t.arc(n, r, 3 + o * 2, 0, Math.PI * 2), t.fill());
2133
2148
  }
2134
2149
  if (D >= p.length) {
2135
- let n = p.length - 1, r = C(n), i = T(p[n].value), a = d.current.get(`tp-${n}`) ?? 0, o = A(e, .05, 5e-4), s = 1 + a * .5;
2136
- t.shadowColor = m(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;
2150
+ let n = p.length - 1, r = C(n), i = w(p[n].value), a = d.current.get(`tp-${n}`) ?? 0, o = j(e, .05, 5e-4), s = 1 + a * .5;
2151
+ t.shadowColor = h(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;
2137
2152
  }
2138
2153
  s = requestAnimationFrame(c);
2139
2154
  };
@@ -2143,7 +2158,7 @@ function St({ points: e = [], className: t, colors: r }) {
2143
2158
  children: /* @__PURE__ */ c("div", {
2144
2159
  style: {
2145
2160
  position: "relative",
2146
- width: xt,
2161
+ width: Tt,
2147
2162
  height: X
2148
2163
  },
2149
2164
  children: [/* @__PURE__ */ s("canvas", {
@@ -2151,14 +2166,14 @@ function St({ points: e = [], className: t, colors: r }) {
2151
2166
  role: "img",
2152
2167
  "aria-label": "trend chart",
2153
2168
  style: {
2154
- width: xt,
2169
+ width: Tt,
2155
2170
  height: X,
2156
2171
  display: "block",
2157
2172
  borderRadius: 8
2158
2173
  }
2159
- }), /* @__PURE__ */ s(S, {
2160
- ...y,
2161
- parentW: xt,
2174
+ }), /* @__PURE__ */ s(C, {
2175
+ ..._,
2176
+ parentW: Tt,
2162
2177
  parentH: X
2163
2178
  })]
2164
2179
  })
@@ -2166,137 +2181,137 @@ function St({ points: e = [], className: t, colors: r }) {
2166
2181
  }
2167
2182
  //#endregion
2168
2183
  //#region src/components/segmentedSplitBarChart/SegmentedSplitBarChart.tsx
2169
- var Ct = 680, wt = 8, Tt = 26, Et = 14, Dt = 16, Ot = 32;
2170
- function kt({ items: e = [], "data-testid": t }) {
2171
- let r = a(null), l = a(/* @__PURE__ */ new Map()), d = a(0), [f, h] = o(!1), g = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), y = i(() => f ? g : g.slice(0, wt), [g, f]), b = Dt + Ot + y.length * (Tt + Et) - Et, { hoveredRef: x, tooltip: w, hitZonesRef: E } = C(r, {
2172
- width: Ct,
2173
- height: b
2184
+ var Dt = 680, Ot = 8, kt = 26, At = 14, jt = 16, Mt = 32;
2185
+ function Nt({ items: e = [], "data-testid": t }) {
2186
+ let r = a(null), l = a(/* @__PURE__ */ new Map()), d = a(0), [g, _] = o(!1), b = i(() => e.filter((e) => typeof e == "object" && !!e), [e]), x = i(() => g ? b : b.slice(0, Ot), [b, g]), S = jt + Mt + x.length * (kt + At) - At, { hoveredRef: T, tooltip: D, hitZonesRef: k } = w(r, {
2187
+ width: Dt,
2188
+ height: S
2174
2189
  });
2175
2190
  return n(() => {
2176
2191
  let e = r.current;
2177
2192
  if (!e) return;
2178
- let t = _(e, Ct, b);
2193
+ let t = v(e, Dt, S);
2179
2194
  d.current = 0;
2180
- let n = Dt, i = Ot, a = Tt, o = Et, s = Ct - 60 - 28, c = Math.max(...y.map((e) => (e.implemented ?? 0) + (e.unimplemented ?? 0))), f = y.length * (a + o) - o, h = n + (b - n - i - f) / 2, g, S = () => {
2195
+ let n = jt, i = Mt, a = kt, o = At, s = Dt - 60 - 28, c = Math.max(...x.map((e) => (e.implemented ?? 0) + (e.unimplemented ?? 0))), g = x.length * (a + o) - o, _ = n + (S - n - i - g) / 2, b, C = () => {
2181
2196
  d.current++;
2182
2197
  let e = d.current;
2183
- t.clearRect(0, 0, Ct, b);
2184
- let n = D(Math.min(e / 60, 1));
2185
- M(l.current, x.current), E.current = [], y.forEach((e, r) => {
2186
- let i = j(n, r, y.length, D), d = h + r * (a + o), f = (e.implemented ?? 0) + (e.unimplemented ?? 0), p = (e.implemented ?? 0) / c * s * i, g = (e.unimplemented ?? 0) / c * s * i, _ = `${e.id}-impl`, b = `${e.id}-un`, x = l.current.get(_) ?? 0, S = l.current.get(b) ?? 0;
2187
- T(E.current, _, 60, d, p || 1, a, {
2198
+ t.clearRect(0, 0, Dt, S);
2199
+ let n = O(Math.min(e / 60, 1));
2200
+ N(l.current, T.current), k.current = [], x.forEach((e, r) => {
2201
+ let i = M(n, r, x.length, O), d = _ + r * (a + o), m = (e.implemented ?? 0) + (e.unimplemented ?? 0), g = (e.implemented ?? 0) / c * s * i, v = (e.unimplemented ?? 0) / c * s * i, b = `${e.id}-impl`, S = `${e.id}-un`, C = l.current.get(b) ?? 0, w = l.current.get(S) ?? 0;
2202
+ E(k.current, b, 60, d, g || 1, a, {
2188
2203
  label: `${e.name} — Implemented`,
2189
2204
  value: `${e.implemented ?? 0} variations`,
2190
- sublabel: `${Math.round((e.implemented ?? 0) / (f || 1) * 100)}% complete`,
2205
+ sublabel: `${Math.round((e.implemented ?? 0) / (m || 1) * 100)}% complete`,
2191
2206
  color: u.green
2192
- }), T(E.current, b, 60 + p, d, g || 1, a, {
2207
+ }), E(k.current, S, 60 + g, d, v || 1, a, {
2193
2208
  label: `${e.name} — Unimplemented`,
2194
2209
  value: `${e.unimplemented ?? 0} variations`,
2195
- sublabel: `${Math.round((e.unimplemented ?? 0) / (f || 1) * 100)}% pending`,
2210
+ sublabel: `${Math.round((e.unimplemented ?? 0) / (m || 1) * 100)}% pending`,
2196
2211
  color: u.amber
2197
- }), t.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = u.t2, t.textAlign = "right", t.fillText(e.abbreviation ?? e.name.slice(0, 6), 52, d + a / 2 + 4), t.fillStyle = m(u.bd, .15), t.beginPath(), t.roundRect(60, d, f / c * s, a, 4), t.fill(), p > 0 && (x > 0 && v(t, 60 + p / 2, d + a / 2, p * .3, u.green, .12 * x), t.fillStyle = m(u.green, .6 + x * .2), t.beginPath(), t.roundRect(60, d, p, a, [
2212
+ }), t.font = f.font, t.fillStyle = u.t2, t.textAlign = "right", t.fillText(e.abbreviation ?? e.name.slice(0, 6), 52, d + a / 2 + 4), t.fillStyle = h(u.bd, .15), t.beginPath(), t.roundRect(60, d, m / c * s, a, 4), t.fill(), g > 0 && (C > 0 && y(t, 60 + g / 2, d + a / 2, g * .3, u.green, .12 * C), t.fillStyle = h(u.green, .6 + C * .2), t.beginPath(), t.roundRect(60, d, g, a, [
2198
2213
  4,
2199
2214
  0,
2200
2215
  0,
2201
2216
  4
2202
- ]), t.fill(), p > 28 && i > .5 && (t.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = x > 0 ? u.green : u.t2, t.textAlign = "center", t.fillText(String(e.implemented ?? 0), 60 + p / 2, d + a / 2 + 4))), g > 0 && (S > 0 && v(t, 60 + p + g / 2, d + a / 2, g * .3, u.amber, .12 * S), t.fillStyle = m(u.amber, .18 + S * .18), t.strokeStyle = m(u.amber, .3 + S * .3), t.lineWidth = 1, t.beginPath(), t.roundRect(60 + p, d, g, a, [
2217
+ ]), t.fill(), g > 28 && i > .5 && (t.font = p.font, t.fillStyle = C > 0 ? u.green : u.t2, t.textAlign = "center", t.fillText(String(e.implemented ?? 0), 60 + g / 2, d + a / 2 + 4))), v > 0 && (w > 0 && y(t, 60 + g + v / 2, d + a / 2, v * .3, u.amber, .12 * w), t.fillStyle = h(u.amber, .18 + w * .18), t.strokeStyle = h(u.amber, .3 + w * .3), t.lineWidth = 1, t.beginPath(), t.roundRect(60 + g, d, v, a, [
2203
2218
  0,
2204
2219
  4,
2205
2220
  4,
2206
2221
  0
2207
- ]), t.fill(), t.stroke(), g > 28 && i > .5 && (t.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", t.fillStyle = S > 0 ? u.amber : u.t2, t.textAlign = "center", t.fillText(String(e.unimplemented ?? 0), 60 + p + g / 2, d + a / 2 + 4))), p > 0 && g > 0 && (t.strokeStyle = m(u.bg, .7), t.lineWidth = 2, t.beginPath(), t.moveTo(60 + p, d), t.lineTo(60 + p, d + a), t.stroke());
2222
+ ]), t.fill(), t.stroke(), v > 28 && i > .5 && (t.font = p.font, t.fillStyle = w > 0 ? u.amber : u.t2, t.textAlign = "center", t.fillText(String(e.unimplemented ?? 0), 60 + g + v / 2, d + a / 2 + 4))), g > 0 && v > 0 && (t.strokeStyle = h(u.bg, .7), t.lineWidth = 2, t.beginPath(), t.moveTo(60 + g, d), t.lineTo(60 + g, d + a), t.stroke());
2208
2223
  });
2209
- let r = h + f + 24, i = 60 + s / 2;
2210
- t.font = "400 14px 'Satoshi Variable', 'DM Sans', sans-serif", t.textAlign = "right", t.fillStyle = u.green, t.fillText("■ Implemented", i - 10, r), t.textAlign = "left", t.fillStyle = p.color, t.fillText("■ Unimplemented", i + 10, r), g = requestAnimationFrame(S);
2224
+ let r = _ + g + 24, i = 60 + s / 2;
2225
+ t.font = m.font, t.textAlign = "right", t.fillStyle = u.green, t.fillText("■ Implemented", i - 10, r), t.textAlign = "left", t.fillStyle = m.color, t.fillText("■ Unimplemented", i + 10, r), b = requestAnimationFrame(C);
2211
2226
  };
2212
- return S(), () => cancelAnimationFrame(g);
2213
- }, [y, b]), g.length === 0 ? /* @__PURE__ */ s(F, {
2214
- width: Ct,
2227
+ return C(), () => cancelAnimationFrame(b);
2228
+ }, [x, S]), b.length === 0 ? /* @__PURE__ */ s(I, {
2229
+ width: Dt,
2215
2230
  height: 160,
2216
2231
  "data-testid": t
2217
2232
  }) : /* @__PURE__ */ c("div", {
2218
2233
  "data-testid": t,
2219
- style: { width: Ct },
2234
+ style: { width: Dt },
2220
2235
  children: [/* @__PURE__ */ c("div", {
2221
2236
  style: {
2222
2237
  position: "relative",
2223
- width: Ct,
2224
- height: b
2238
+ width: Dt,
2239
+ height: S
2225
2240
  },
2226
2241
  children: [/* @__PURE__ */ s("canvas", {
2227
2242
  ref: r,
2228
2243
  role: "img",
2229
2244
  "aria-label": "Implemented vs unimplemented variations per contractor — split bar",
2230
2245
  style: {
2231
- width: Ct,
2232
- height: b,
2246
+ width: Dt,
2247
+ height: S,
2233
2248
  display: "block"
2234
2249
  }
2235
- }), /* @__PURE__ */ s(S, {
2236
- ...w,
2237
- parentW: Ct,
2238
- parentH: b
2250
+ }), /* @__PURE__ */ s(C, {
2251
+ ...D,
2252
+ parentW: Dt,
2253
+ parentH: S
2239
2254
  })]
2240
- }), g.length > wt && /* @__PURE__ */ s("div", {
2255
+ }), b.length > Ot && /* @__PURE__ */ s("div", {
2241
2256
  style: { marginTop: 8 },
2242
2257
  children: /* @__PURE__ */ s(ae, {
2243
- expanded: f,
2244
- onToggle: () => h((e) => !e)
2258
+ expanded: g,
2259
+ onToggle: () => _((e) => !e)
2245
2260
  })
2246
2261
  })]
2247
2262
  });
2248
2263
  }
2249
2264
  //#endregion
2250
2265
  //#region src/components/weeklyFlow/WeeklyFlow.tsx
2251
- var At = 800, jt = 360;
2252
- function Mt({ items: e = [], "data-testid": t }) {
2253
- let r = a(null), i = a(/* @__PURE__ */ new Map()), o = a(0), { hoveredRef: l, tooltip: f, hitZonesRef: p } = C(r, {
2254
- width: At,
2255
- height: jt
2266
+ var Pt = 800, Ft = 360;
2267
+ function It({ items: e = [], "data-testid": t }) {
2268
+ let r = a(null), i = a(/* @__PURE__ */ new Map()), o = a(0), { hoveredRef: l, tooltip: m, hitZonesRef: g } = w(r, {
2269
+ width: Pt,
2270
+ height: Ft
2256
2271
  });
2257
2272
  return n(() => {
2258
2273
  let t = r.current;
2259
2274
  if (!t) return;
2260
- let n = _(t, At, jt);
2275
+ let n = v(t, Pt, Ft);
2261
2276
  o.current = 0;
2262
- let a = e.reduce((e, t) => e + (t.base ?? 0), 0), s = e.reduce((e, t) => e + (t.variation ?? 0), 0), c = e.reduce((e, t) => e + (t.total ?? 0), 0), f = jt - 20 - 26, h = f - 6 * (e.length - 1), g = 20, y = e.map((e, t) => {
2263
- let n = Math.max(24, (e.total ?? 0) / (c || 1) * h), r = {
2277
+ let a = e.reduce((e, t) => e + (t.base ?? 0), 0), s = e.reduce((e, t) => e + (t.variation ?? 0), 0), c = e.reduce((e, t) => e + (t.total ?? 0), 0), m = Ft - 20 - 26, _ = m - 6 * (e.length - 1), b = 20, x = e.map((e, t) => {
2278
+ let n = Math.max(24, (e.total ?? 0) / (c || 1) * _), r = {
2264
2279
  x: 100 - 110 / 2,
2265
- y: g,
2280
+ y: b,
2266
2281
  h: n,
2267
- cy: g + n / 2,
2282
+ cy: b + n / 2,
2268
2283
  c: e,
2269
2284
  color: d[t % d.length]
2270
2285
  };
2271
- return g += n + 6, r;
2272
- }), b = h - 14, x = Math.max(28, a / c * b), S = Math.max(18, s / c * b), C = 20 + (f - (x + S + 14)) / 2, w = {
2286
+ return b += n + 6, r;
2287
+ }), S = _ - 14, C = Math.max(28, a / c * S), w = Math.max(18, s / c * S), T = 20 + (m - (C + w + 14)) / 2, O = {
2273
2288
  x: 420 - 110 / 2,
2274
- y: C,
2275
- h: x,
2276
- cy: C + x / 2
2277
- }, D = {
2289
+ y: T,
2290
+ h: C,
2291
+ cy: T + C / 2
2292
+ }, k = {
2278
2293
  x: 420 - 110 / 2,
2279
- y: C + x + 14,
2280
- h: S,
2281
- cy: C + x + 14 + S / 2
2282
- }, O = {
2294
+ y: T + C + 14,
2295
+ h: w,
2296
+ cy: T + C + 14 + w / 2
2297
+ }, A = {
2283
2298
  x: 720 - 110 / 2,
2284
2299
  y: 20,
2285
- h: f,
2286
- cy: 20 + f / 2
2287
- }, k, A = () => {
2300
+ h: m,
2301
+ cy: 20 + m / 2
2302
+ }, j, P = () => {
2288
2303
  o.current++;
2289
2304
  let t = o.current;
2290
- n.clearRect(0, 0, At, jt);
2291
- let r = E(Math.min(t / 80, 1));
2292
- if (M(i.current, l.current), p.current = [], e.forEach((t, o) => {
2293
- let c = y[o], l = j(r, o, e.length, E), u = i.current.get(t.id) ?? 0;
2305
+ n.clearRect(0, 0, Pt, Ft), n.letterSpacing = f.letterSpacing;
2306
+ let r = D(Math.min(t / 80, 1));
2307
+ if (N(i.current, l.current), g.current = [], e.forEach((t, o) => {
2308
+ let c = x[o], l = M(r, o, e.length, D), u = i.current.get(t.id) ?? 0;
2294
2309
  if (l < .01) return;
2295
- let d = (t.base ?? 0) / (t.total || 1), f = (t.variation ?? 0) / (t.total || 1), p = c.h * d, m = c.h * f, h = c.y + p / 2, g = c.y + p + m / 2, _ = Math.max(2, (t.base ?? 0) / a * x), v = Math.max(2, (t.variation ?? 0) / s * S), b = w.y + e.slice(0, o).reduce((e, t) => e + (t.base ?? 0) / a * x, 0) + _ / 2, C = D.y + e.slice(0, o).reduce((e, t) => e + (t.variation ?? 0) / s * S, 0) + v / 2, T = u * .2 + .18;
2296
- Nt(n, c.x + 110, h, 420 - 110 / 2, b, _ * l, c.color, T), Nt(n, c.x + 110, g, 420 - 110 / 2, C, v * l, c.color, T * .75);
2310
+ let d = (t.base ?? 0) / (t.total || 1), f = (t.variation ?? 0) / (t.total || 1), p = c.h * d, m = c.h * f, h = c.y + p / 2, g = c.y + p + m / 2, _ = Math.max(2, (t.base ?? 0) / a * C), v = Math.max(2, (t.variation ?? 0) / s * w), y = O.y + e.slice(0, o).reduce((e, t) => e + (t.base ?? 0) / a * C, 0) + _ / 2, b = k.y + e.slice(0, o).reduce((e, t) => e + (t.variation ?? 0) / s * w, 0) + v / 2, S = u * .2 + .18;
2311
+ Lt(n, c.x + 110, h, 420 - 110 / 2, y, _ * l, c.color, S), Lt(n, c.x + 110, g, 420 - 110 / 2, b, v * l, c.color, S * .75);
2297
2312
  }), r > .3) {
2298
- let e = Math.min(1, (r - .3) / .7), t = O.y + a / c * f / 2, i = O.y + f - s / c * f / 2;
2299
- Nt(n, 475, w.cy, 720 - 110 / 2, t, x * e, u.blue, .25 * e), Nt(n, 475, D.cy, 720 - 110 / 2, i, S * e, u.amber, .22 * e);
2313
+ let e = Math.min(1, (r - .3) / .7), t = A.y + a / c * m / 2, i = A.y + m - s / c * m / 2;
2314
+ Lt(n, 475, O.cy, 720 - 110 / 2, t, C * e, u.blue, .25 * e), Lt(n, 475, k.cy, 720 - 110 / 2, i, w * e, u.amber, .22 * e);
2300
2315
  }
2301
2316
  if ([
2302
2317
  "Contractors",
@@ -2308,136 +2323,136 @@ function Mt({ items: e = [], "data-testid": t }) {
2308
2323
  420,
2309
2324
  720
2310
2325
  ][t];
2311
- n.font = "400 12px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = m(u.t3, .5), n.textAlign = "center", n.fillText(e, r, jt - 8);
2326
+ n.font = f.font, n.fillStyle = h(u.t3, .5), n.textAlign = "center", n.fillText(e, r, Ft - 8);
2312
2327
  }), e.forEach((t, a) => {
2313
- let o = y[a], s = j(r, a, e.length, E), c = i.current.get(t.id) ?? 0;
2314
- T(p.current, t.id, o.x, o.y, 110, o.h, {
2328
+ let o = x[a], s = M(r, a, e.length, D), c = i.current.get(t.id) ?? 0;
2329
+ E(g.current, t.id, o.x, o.y, 110, o.h, {
2315
2330
  label: t.name,
2316
2331
  value: `£${t.total ?? 0}M total commitment`,
2317
2332
  sublabel: `Base £${t.base ?? 0}M + Variations £${t.variation ?? 0}M`,
2318
2333
  color: o.color
2319
- }), c > 0 && v(n, o.x + 110 / 2, o.cy, 110 * .6, o.color, .12 * c), n.fillStyle = m(o.color, (.3 + c * .15) * s), n.strokeStyle = m(o.color, (.55 + c * .25) * s), n.lineWidth = 1, n.beginPath(), n.roundRect(o.x, o.y, 110 * s, o.h, 4), n.fill(), n.stroke(), s > .6 && o.h >= 24 && (n.globalAlpha = Math.min(1, (s - .6) / .4), n.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = c > 0 ? o.color : m(u.t2, .9), n.textAlign = "center", n.textBaseline = "middle", n.fillText(t.abbreviation ?? t.name.slice(0, 6), o.x + 110 / 2, o.h >= 36 ? o.cy - 5 : o.cy), o.h >= 36 && (n.font = "400 12px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = m(u.t3, .8), n.fillText(`£${t.total ?? 0}M`, o.x + 110 / 2, o.cy + 7)), n.globalAlpha = 1, n.textBaseline = "alphabetic");
2334
+ }), c > 0 && y(n, o.x + 110 / 2, o.cy, 110 * .6, o.color, .12 * c), n.fillStyle = h(o.color, (.3 + c * .15) * s), n.strokeStyle = h(o.color, (.55 + c * .25) * s), n.lineWidth = 1, n.beginPath(), n.roundRect(o.x, o.y, 110 * s, o.h, 4), n.fill(), n.stroke(), s > .6 && o.h >= 24 && (n.globalAlpha = Math.min(1, (s - .6) / .4), n.font = f.font, n.fillStyle = c > 0 ? o.color : h(u.t2, .9), n.textAlign = "center", n.textBaseline = "middle", n.fillText(t.abbreviation ?? t.name.slice(0, 6), o.x + 110 / 2, o.h >= 36 ? o.cy - 5 : o.cy), o.h >= 36 && (n.font = "400 12px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = h(u.t3, .8), n.fillText(`£${t.total ?? 0}M`, o.x + 110 / 2, o.cy + 7)), n.globalAlpha = 1, n.textBaseline = "alphabetic");
2320
2335
  }), r > .2) {
2321
2336
  let e = Math.min(1, (r - .2) / .4);
2322
- v(n, 420, w.cy, 30, u.blue, .1 * e), n.fillStyle = m(u.blue, .3 * e), n.strokeStyle = m(u.blue, .5 * e), n.lineWidth = 1, n.beginPath(), n.roundRect(w.x, w.y, 110, w.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.blue, n.textAlign = "center", n.fillText("Base Value", 420, w.cy - 6), n.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.t1, n.fillText(`£${a}M`, 420, w.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic", v(n, 420, D.cy, 24, u.amber, .1 * e), n.fillStyle = m(u.amber, .22 * e), n.strokeStyle = m(u.amber, .4 * e), n.beginPath(), n.roundRect(D.x, D.y, 110, D.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.amber, n.textAlign = "center", n.fillText("Variations", 420, D.cy - 4), n.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.t1, n.fillText(`£${s}M`, 420, D.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2337
+ y(n, 420, O.cy, 30, u.blue, .1 * e), n.fillStyle = h(u.blue, .3 * e), n.strokeStyle = h(u.blue, .5 * e), n.lineWidth = 1, n.beginPath(), n.roundRect(O.x, O.y, 110, O.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.blue, n.textAlign = "center", n.fillText("Base Value", 420, O.cy - 6), n.font = p.font, n.fillStyle = p.color, n.fillText(`£${a}M`, 420, O.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic", y(n, 420, k.cy, 24, u.amber, .1 * e), n.fillStyle = h(u.amber, .22 * e), n.strokeStyle = h(u.amber, .4 * e), n.beginPath(), n.roundRect(k.x, k.y, 110, k.h * e, 4), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.amber, n.textAlign = "center", n.fillText("Variations", 420, k.cy - 4), n.font = p.font, n.fillStyle = p.color, n.fillText(`£${s}M`, 420, k.cy + 8), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2323
2338
  }
2324
2339
  if (r > .5) {
2325
2340
  let e = Math.min(1, (r - .5) / .5);
2326
- v(n, 720, O.cy, 44, u.cyan, .2 * e), n.fillStyle = m(u.cyan, .25 * e), n.strokeStyle = m(u.cyan, .6 * e), n.lineWidth = 1.5, n.beginPath(), n.roundRect(O.x, O.y, 110, O.h * e, 6), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = "400 12px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.t2, n.textAlign = "center", n.fillText("Total Commitment", 720, O.cy - 12), n.font = "500 14px 'Satoshi Variable', 'DM Sans', sans-serif", n.fillStyle = u.cyan, n.fillText(`£${c}M`, 720, O.cy + 6), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2341
+ y(n, 720, A.cy, 44, u.blue, .2 * e), n.fillStyle = h(u.blue, .25 * e), n.strokeStyle = h(u.blue, .6 * e), n.lineWidth = 1.5, n.beginPath(), n.roundRect(A.x, A.y, 110, A.h * e, 6), n.fill(), n.stroke(), n.globalAlpha = e, n.textBaseline = "middle", n.font = f.font, n.fillStyle = u.t2, n.textAlign = "center", n.fillText("Total Commitment", 720, A.cy - 12), n.font = p.font, n.fillStyle = u.blue, n.fillText(`£${c}M`, 720, A.cy + 6), n.globalAlpha = 1, n.textBaseline = "alphabetic";
2327
2342
  }
2328
- k = requestAnimationFrame(A);
2343
+ j = requestAnimationFrame(P);
2329
2344
  };
2330
- return A(), () => cancelAnimationFrame(k);
2345
+ return P(), () => cancelAnimationFrame(j);
2331
2346
  }, [e]), /* @__PURE__ */ c("div", {
2332
2347
  "data-testid": t,
2333
2348
  style: {
2334
2349
  position: "relative",
2335
- width: At,
2336
- height: jt
2350
+ width: Pt,
2351
+ height: Ft
2337
2352
  },
2338
2353
  children: [/* @__PURE__ */ s("canvas", {
2339
2354
  ref: r,
2340
2355
  role: "img",
2341
2356
  "aria-label": "Weekly report flow — base value and variations per contractor flowing to total commitment",
2342
2357
  style: {
2343
- width: At,
2344
- height: jt,
2358
+ width: Pt,
2359
+ height: Ft,
2345
2360
  display: "block"
2346
2361
  }
2347
- }), /* @__PURE__ */ s(S, {
2348
- ...f,
2349
- parentW: At,
2350
- parentH: jt
2362
+ }), /* @__PURE__ */ s(C, {
2363
+ ...m,
2364
+ parentW: Pt,
2365
+ parentH: Ft
2351
2366
  })]
2352
2367
  });
2353
2368
  }
2354
- function Nt(e, t, n, r, i, a, o, s) {
2369
+ function Lt(e, t, n, r, i, a, o, s) {
2355
2370
  let c = (t + r) / 2;
2356
- 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 = m(o, s), e.fill();
2371
+ 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 = h(o, s), e.fill();
2357
2372
  }
2358
2373
  //#endregion
2359
2374
  //#region src/components/visualizationRenderer/VisualizationRenderer.tsx
2360
- function Pt({ config: e, className: t }) {
2361
- return e.type === "line" ? /* @__PURE__ */ s(Ie, {
2375
+ function Rt({ config: e, className: t }) {
2376
+ return e.type === "line" ? /* @__PURE__ */ s(Le, {
2362
2377
  rows: e.rows,
2363
2378
  className: t
2364
- }) : e.type === "area" ? /* @__PURE__ */ s(ne, {
2379
+ }) : e.type === "area" ? /* @__PURE__ */ s(te, {
2365
2380
  rows: e.rows,
2366
2381
  className: t
2367
2382
  }) : e.type === "bar" ? /* @__PURE__ */ s(ie, {
2368
2383
  rows: e.rows,
2369
2384
  className: t
2370
- }) : e.type === "pie" ? /* @__PURE__ */ s(Ke, {
2385
+ }) : e.type === "pie" ? /* @__PURE__ */ s(Ye, {
2371
2386
  rows: e.rows,
2372
2387
  variant: "pie",
2373
2388
  className: t
2374
- }) : e.type === "donut" ? /* @__PURE__ */ s(Ke, {
2389
+ }) : e.type === "donut" ? /* @__PURE__ */ s(Ye, {
2375
2390
  rows: e.rows,
2376
2391
  variant: "donut",
2377
2392
  className: t
2378
- }) : e.type === "sankey" ? /* @__PURE__ */ s(rt, {
2393
+ }) : e.type === "sankey" ? /* @__PURE__ */ s(ot, {
2379
2394
  rows: e.rows,
2380
2395
  className: t
2381
- }) : e.type === "flow" ? /* @__PURE__ */ s(nt, {
2396
+ }) : e.type === "flow" ? /* @__PURE__ */ s(at, {
2382
2397
  selectedEntity: e.selectedEntity,
2383
2398
  className: t
2384
- }) : e.type === "trend" ? /* @__PURE__ */ s(St, {
2399
+ }) : e.type === "trend" ? /* @__PURE__ */ s(Et, {
2385
2400
  points: e.points,
2386
2401
  className: t
2387
- }) : e.type === "mini-bars" ? /* @__PURE__ */ s(ze, {
2402
+ }) : e.type === "mini-bars" ? /* @__PURE__ */ s(Be, {
2388
2403
  rows: e.rows,
2389
2404
  className: t
2390
- }) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(ke, { data: e.data }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(Se, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(fe, { items: e.items }) : e.type === "hub-and-spoke-radial-chart" ? /* @__PURE__ */ s(bt, {
2405
+ }) : e.type === "stacked-horizontal-bar-chart" ? /* @__PURE__ */ s(Ae, { data: e.data }) : e.type === "multi-metric-constellation-chart" ? /* @__PURE__ */ s(Ce, { items: e.items }) : e.type === "progress-race-chart" ? /* @__PURE__ */ s(fe, { items: e.items }) : e.type === "hub-and-spoke-radial-chart" ? /* @__PURE__ */ s(wt, {
2391
2406
  segments: e.segments,
2392
2407
  title: e.title
2393
- }) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(Fe, { items: e.items }) : e.type === "ranked-card-leaderboard" ? /* @__PURE__ */ s(Pe, { items: e.items }) : e.type === "proportional-band-chart" ? /* @__PURE__ */ s(vt, { severities: e.severities }) : e.type === "radial-fan-tree-chart" ? /* @__PURE__ */ s(He, {
2408
+ }) : e.type === "dot-matrix-chart" ? /* @__PURE__ */ s(Ie, { items: e.items }) : e.type === "ranked-card-leaderboard" ? /* @__PURE__ */ s(Fe, { items: e.items }) : e.type === "proportional-band-chart" ? /* @__PURE__ */ s(St, { severities: e.severities }) : e.type === "radial-fan-tree-chart" ? /* @__PURE__ */ s(Ge, {
2394
2409
  total: e.total,
2395
2410
  items: e.items
2396
2411
  }) : e.type === "semi-circular-gauge-chart" ? /* @__PURE__ */ s(he, {
2397
2412
  value: e.value,
2398
2413
  confirmed: e.confirmed,
2399
2414
  total: e.total
2400
- }) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(kt, { items: e.items }) : e.type === "balance-scale-chart" ? /* @__PURE__ */ s(ot, {
2415
+ }) : e.type === "segmented-split-bar-chart" ? /* @__PURE__ */ s(Nt, { items: e.items }) : e.type === "balance-scale-chart" ? /* @__PURE__ */ s(lt, {
2401
2416
  left: e.left,
2402
2417
  right: e.right
2403
- }) : e.type === "area-line-chart" ? /* @__PURE__ */ s(ct, { points: e.points }) : e.type === "trend-view" ? /* @__PURE__ */ s(ht, { points: e.points }) : e.type === "weekly-flow" ? /* @__PURE__ */ s(Mt, { items: e.items }) : /* @__PURE__ */ s("div", {
2418
+ }) : e.type === "area-line-chart" ? /* @__PURE__ */ s(dt, { points: e.points }) : e.type === "trend-view" ? /* @__PURE__ */ s(vt, { points: e.points }) : e.type === "weekly-flow" ? /* @__PURE__ */ s(It, { items: e.items }) : /* @__PURE__ */ s("div", {
2404
2419
  className: "viz-empty",
2405
2420
  children: "Visualization unavailable"
2406
2421
  });
2407
2422
  }
2408
2423
  //#endregion
2409
2424
  //#region src/utils/mounts.tsx
2410
- var Ft = [];
2411
- function It(e) {
2425
+ var zt = [];
2426
+ function Bt(e) {
2412
2427
  try {
2413
2428
  return JSON.parse(decodeURIComponent(e));
2414
2429
  } catch {
2415
2430
  return null;
2416
2431
  }
2417
2432
  }
2418
- function Lt() {
2419
- for (; Ft.length;) {
2420
- let e = Ft.pop();
2433
+ function Vt() {
2434
+ for (; zt.length;) {
2435
+ let e = zt.pop();
2421
2436
  e && e.unmount();
2422
2437
  }
2423
2438
  }
2424
- function Rt() {
2425
- Lt(), document.querySelectorAll("[data-d3-viz]").forEach((t) => {
2439
+ function Ht() {
2440
+ Vt(), document.querySelectorAll("[data-d3-viz]").forEach((t) => {
2426
2441
  let n = t.dataset.d3Viz;
2427
2442
  if (!n) return;
2428
- let r = It(n);
2443
+ let r = Bt(n);
2429
2444
  if (!r) return;
2430
2445
  let i = e(t);
2431
- Ft.push(i), i.render(/* @__PURE__ */ s(Pt, { config: r }));
2446
+ zt.push(i), i.render(/* @__PURE__ */ s(Rt, { config: r }));
2432
2447
  });
2433
2448
  }
2434
- function zt(e) {
2449
+ function Ut(e) {
2435
2450
  return encodeURIComponent(JSON.stringify(e));
2436
2451
  }
2437
2452
  //#endregion
2438
2453
  //#region src/components/donutChart/DonutChart.tsx
2439
- function Bt({ rows: e = [], className: t, colors: n }) {
2440
- return /* @__PURE__ */ s(Ke, {
2454
+ function Wt({ rows: e = [], className: t, colors: n }) {
2455
+ return /* @__PURE__ */ s(Ye, {
2441
2456
  rows: e,
2442
2457
  variant: "donut",
2443
2458
  className: t,
@@ -2456,7 +2471,7 @@ var Z = {
2456
2471
  red: u.red,
2457
2472
  amber: u.amber,
2458
2473
  green: u.green
2459
- }, Q = "'Satoshi Variable', 'DM Sans', sans-serif", Vt = {
2474
+ }, Q = "'Satoshi Variable', 'DM Sans', sans-serif", Gt = {
2460
2475
  color: "#F7F7F7",
2461
2476
  fontFamily: Q,
2462
2477
  fontSize: 24,
@@ -2469,7 +2484,7 @@ var Z = {
2469
2484
  fontWeight: 400,
2470
2485
  lineHeight: "20px"
2471
2486
  };
2472
- function Ht({ chips: e = [] }) {
2487
+ function Kt({ chips: e = [] }) {
2473
2488
  return /* @__PURE__ */ s("div", {
2474
2489
  style: {
2475
2490
  display: "flex",
@@ -2491,7 +2506,7 @@ function Ht({ chips: e = [] }) {
2491
2506
  },
2492
2507
  children: [/* @__PURE__ */ s("span", {
2493
2508
  style: {
2494
- ...Vt,
2509
+ ...Gt,
2495
2510
  color: e.color ?? Z.t1
2496
2511
  },
2497
2512
  children: e.value
@@ -2505,7 +2520,7 @@ function Ht({ chips: e = [] }) {
2505
2520
  }, t))
2506
2521
  });
2507
2522
  }
2508
- function Ut({ items: e = [] }) {
2523
+ function qt({ items: e = [] }) {
2509
2524
  return /* @__PURE__ */ s("div", {
2510
2525
  style: {
2511
2526
  display: "flex",
@@ -2528,7 +2543,7 @@ function Ut({ items: e = [] }) {
2528
2543
  },
2529
2544
  children: [/* @__PURE__ */ s("div", {
2530
2545
  style: {
2531
- ...Vt,
2546
+ ...Gt,
2532
2547
  color: e.color ?? Z.t1
2533
2548
  },
2534
2549
  children: e.value
@@ -2539,7 +2554,7 @@ function Ut({ items: e = [] }) {
2539
2554
  }, t))
2540
2555
  });
2541
2556
  }
2542
- function Wt({ items: e = [] }) {
2557
+ function Jt({ items: e = [] }) {
2543
2558
  return /* @__PURE__ */ s("div", {
2544
2559
  style: {
2545
2560
  display: "flex",
@@ -2571,7 +2586,7 @@ function Wt({ items: e = [] }) {
2571
2586
  }),
2572
2587
  /* @__PURE__ */ s("span", {
2573
2588
  style: {
2574
- ...Vt,
2589
+ ...Gt,
2575
2590
  fontSize: 16,
2576
2591
  color: e.color ?? Z.t1,
2577
2592
  minWidth: 70,
@@ -2590,7 +2605,7 @@ function Wt({ items: e = [] }) {
2590
2605
  }, t))
2591
2606
  });
2592
2607
  }
2593
- function Gt({ items: e = [] }) {
2608
+ function Yt({ items: e = [] }) {
2594
2609
  return /* @__PURE__ */ s("div", {
2595
2610
  style: {
2596
2611
  display: "flex",
@@ -2613,7 +2628,7 @@ function Gt({ items: e = [] }) {
2613
2628
  },
2614
2629
  children: [/* @__PURE__ */ s("div", {
2615
2630
  style: {
2616
- ...Vt,
2631
+ ...Gt,
2617
2632
  color: e.color ?? Z.t1
2618
2633
  },
2619
2634
  children: e.value
@@ -2624,12 +2639,12 @@ function Gt({ items: e = [] }) {
2624
2639
  }, t))
2625
2640
  });
2626
2641
  }
2627
- var Kt = {
2642
+ var Xt = {
2628
2643
  red: Z.red,
2629
2644
  amber: Z.amber,
2630
2645
  green: Z.green
2631
2646
  };
2632
- function qt({ items: e = [] }) {
2647
+ function Zt({ items: e = [] }) {
2633
2648
  return /* @__PURE__ */ s("div", {
2634
2649
  style: {
2635
2650
  display: "flex",
@@ -2637,7 +2652,7 @@ function qt({ items: e = [] }) {
2637
2652
  gap: 5
2638
2653
  },
2639
2654
  children: e.map((e, t) => {
2640
- let n = Kt[e.severity];
2655
+ let n = Xt[e.severity];
2641
2656
  return /* @__PURE__ */ c("div", {
2642
2657
  style: {
2643
2658
  display: "flex",
@@ -2662,7 +2677,7 @@ function qt({ items: e = [] }) {
2662
2677
  })
2663
2678
  });
2664
2679
  }
2665
- function Jt({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
2680
+ function Qt({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
2666
2681
  let a = t - e;
2667
2682
  return /* @__PURE__ */ c("div", { children: [/* @__PURE__ */ c("div", {
2668
2683
  style: {
@@ -2772,10 +2787,10 @@ function Jt({ min: e, max: t, unit: n, dots: r = [], chips: i = [] }) {
2772
2787
  }, r);
2773
2788
  })
2774
2789
  ]
2775
- }), i && i.length > 0 && /* @__PURE__ */ s(Ht, { chips: i })] });
2790
+ }), i && i.length > 0 && /* @__PURE__ */ s(Kt, { chips: i })] });
2776
2791
  }
2777
- function Yt({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i, rightLabel: a, rightValue: o, rightColor: l, chips: d }) {
2778
- let f = r ?? u.blue, p = l ?? u.cyan;
2792
+ function $t({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i, rightLabel: a, rightValue: o, rightColor: l, chips: d }) {
2793
+ let f = r ?? u.blue, p = l ?? u.blue;
2779
2794
  return /* @__PURE__ */ c("div", { children: [
2780
2795
  /* @__PURE__ */ c("div", {
2781
2796
  style: {
@@ -2868,10 +2883,10 @@ function Yt({ leftPct: e, leftLabel: t, leftValue: n, leftColor: r, rightPct: i,
2868
2883
  })
2869
2884
  })]
2870
2885
  }),
2871
- d && d.length > 0 && /* @__PURE__ */ s(Ht, { chips: d })
2886
+ d && d.length > 0 && /* @__PURE__ */ s(Kt, { chips: d })
2872
2887
  ] });
2873
2888
  }
2874
- function Xt({ pct: e, label: t, color: n, chips: r }) {
2889
+ function en({ pct: e, label: t, color: n, chips: r }) {
2875
2890
  let i = n ?? u.blue, a = 2 * Math.PI * 30, o = a * (1 - e / 100);
2876
2891
  return /* @__PURE__ */ c("div", {
2877
2892
  style: {
@@ -2952,7 +2967,7 @@ function Xt({ pct: e, label: t, color: n, chips: r }) {
2952
2967
  },
2953
2968
  children: [/* @__PURE__ */ s("span", {
2954
2969
  style: {
2955
- ...Vt,
2970
+ ...Gt,
2956
2971
  color: e.color ?? Z.t1
2957
2972
  },
2958
2973
  children: e.value
@@ -2965,16 +2980,16 @@ function Xt({ pct: e, label: t, color: n, chips: r }) {
2965
2980
  })]
2966
2981
  });
2967
2982
  }
2968
- var Zt = {
2983
+ var tn = {
2969
2984
  green: "#34D39918",
2970
2985
  amber: "#FBBF2418",
2971
2986
  red: "#F0606018"
2972
- }, Qt = {
2987
+ }, nn = {
2973
2988
  green: "#34D399",
2974
2989
  amber: "#FBBF24",
2975
2990
  red: "#F06060"
2976
2991
  };
2977
- function $t({ items: e = [] }) {
2992
+ function rn({ items: e = [] }) {
2978
2993
  return /* @__PURE__ */ s("div", {
2979
2994
  style: {
2980
2995
  display: "flex",
@@ -3038,8 +3053,8 @@ function $t({ items: e = [] }) {
3038
3053
  style: {
3039
3054
  fontSize: 16,
3040
3055
  fontWeight: 600,
3041
- color: Qt[e.badgeSeverity],
3042
- background: Zt[e.badgeSeverity],
3056
+ color: nn[e.badgeSeverity],
3057
+ background: tn[e.badgeSeverity],
3043
3058
  padding: "2px 7px",
3044
3059
  borderRadius: 4,
3045
3060
  fontFamily: Q,
@@ -3062,12 +3077,12 @@ function $t({ items: e = [] }) {
3062
3077
  }, t))
3063
3078
  });
3064
3079
  }
3065
- var en = {
3080
+ var an = {
3066
3081
  red: Z.red,
3067
3082
  amber: Z.amber,
3068
3083
  green: Z.green
3069
3084
  };
3070
- function tn({ items: e = [] }) {
3085
+ function on({ items: e = [] }) {
3071
3086
  return /* @__PURE__ */ s("div", {
3072
3087
  style: {
3073
3088
  display: "flex",
@@ -3075,7 +3090,7 @@ function tn({ items: e = [] }) {
3075
3090
  gap: 5
3076
3091
  },
3077
3092
  children: e.map((e, t) => {
3078
- let n = en[e.severity];
3093
+ let n = an[e.severity];
3079
3094
  return /* @__PURE__ */ c("div", {
3080
3095
  style: {
3081
3096
  display: "flex",
@@ -3127,7 +3142,7 @@ function tn({ items: e = [] }) {
3127
3142
  })
3128
3143
  });
3129
3144
  }
3130
- function nn({ columns: e = [], rows: t = [] }) {
3145
+ function sn({ columns: e = [], rows: t = [] }) {
3131
3146
  return /* @__PURE__ */ c("div", {
3132
3147
  style: {
3133
3148
  display: "flex",
@@ -3190,7 +3205,7 @@ function nn({ columns: e = [], rows: t = [] }) {
3190
3205
  }, t))]
3191
3206
  });
3192
3207
  }
3193
- function rn({ text: e }) {
3208
+ function cn({ text: e }) {
3194
3209
  return /* @__PURE__ */ c("div", {
3195
3210
  style: {
3196
3211
  padding: "8px 12px",
@@ -3215,22 +3230,22 @@ function rn({ text: e }) {
3215
3230
  })]
3216
3231
  });
3217
3232
  }
3218
- function an({ block: e }) {
3233
+ function ln({ block: e }) {
3219
3234
  if (!e) return null;
3220
3235
  let t = (() => {
3221
3236
  switch (e.type) {
3222
- case "stats": return /* @__PURE__ */ s(Ut, { items: e.items });
3223
- case "ranked": return /* @__PURE__ */ s(Wt, { items: e.items });
3224
- case "chips": return /* @__PURE__ */ s(Gt, { items: e.items });
3225
- case "badges": return /* @__PURE__ */ s(qt, { items: e.items });
3226
- case "dot-strip": return /* @__PURE__ */ s(Jt, {
3237
+ case "stats": return /* @__PURE__ */ s(qt, { items: e.items });
3238
+ case "ranked": return /* @__PURE__ */ s(Jt, { items: e.items });
3239
+ case "chips": return /* @__PURE__ */ s(Yt, { items: e.items });
3240
+ case "badges": return /* @__PURE__ */ s(Zt, { items: e.items });
3241
+ case "dot-strip": return /* @__PURE__ */ s(Qt, {
3227
3242
  min: e.min,
3228
3243
  max: e.max,
3229
3244
  unit: e.unit,
3230
3245
  dots: e.dots,
3231
3246
  chips: e.chips
3232
3247
  });
3233
- case "proportion": return /* @__PURE__ */ s(Yt, {
3248
+ case "proportion": return /* @__PURE__ */ s($t, {
3234
3249
  leftPct: e.leftPct,
3235
3250
  leftLabel: e.leftLabel,
3236
3251
  leftValue: e.leftValue,
@@ -3241,15 +3256,15 @@ function an({ block: e }) {
3241
3256
  rightColor: e.rightColor,
3242
3257
  chips: e.chips
3243
3258
  });
3244
- case "ring": return /* @__PURE__ */ s(Xt, {
3259
+ case "ring": return /* @__PURE__ */ s(en, {
3245
3260
  pct: e.pct,
3246
3261
  label: e.label,
3247
3262
  color: e.color,
3248
3263
  chips: e.chips
3249
3264
  });
3250
- case "scorecard-rows": return /* @__PURE__ */ s($t, { items: e.items });
3251
- case "flags-list": return /* @__PURE__ */ s(tn, { items: e.items });
3252
- case "comparison-rows": return /* @__PURE__ */ s(nn, {
3265
+ case "scorecard-rows": return /* @__PURE__ */ s(rn, { items: e.items });
3266
+ case "flags-list": return /* @__PURE__ */ s(on, { items: e.items });
3267
+ case "comparison-rows": return /* @__PURE__ */ s(sn, {
3253
3268
  columns: e.columns,
3254
3269
  rows: e.rows
3255
3270
  });
@@ -3262,8 +3277,8 @@ function an({ block: e }) {
3262
3277
  flexDirection: "column",
3263
3278
  gap: 24
3264
3279
  },
3265
- children: [t, /* @__PURE__ */ s(rn, { text: e.takeaway })]
3280
+ children: [t, /* @__PURE__ */ s(cn, { text: e.takeaway })]
3266
3281
  }) : t;
3267
3282
  }
3268
3283
  //#endregion
3269
- export { ne as AreaChart, ie as BarChart, l as ChartFrame, Bt as DonutChart, an as KeyHighlights, Ie as LineChart, ze as MiniBars, Ke as PieChart, nt as ProcessSankey, rt as RankingSankey, Je as SankeySvg, te as SeriesChart, ht as Trend, St as TrendChart, Pt as VisualizationRenderer, Lt as cleanupVisualizationMounts, Rt as hydrateVisualizationMounts, zt as serializeVisualizationConfig };
3284
+ export { te as AreaChart, ie as BarChart, l as ChartFrame, Wt as DonutChart, ln as KeyHighlights, Le as LineChart, Be as MiniBars, Ye as PieChart, at as ProcessSankey, ot as RankingSankey, Ze as SankeySvg, ee as SeriesChart, vt as Trend, Et as TrendChart, Rt as VisualizationRenderer, Vt as cleanupVisualizationMounts, Ht as hydrateVisualizationMounts, Ut as serializeVisualizationConfig };