@astrato-io/visualizations 0.6.4 → 0.7.0

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.
Files changed (220) hide show
  1. package/CHANGELOG.md +0 -0
  2. package/README.md +32 -2
  3. package/THIRD_PARTY_NOTICES.md +68 -205
  4. package/VISUALIZATION_DEFINITIONS.md +68 -114
  5. package/chunks/Button-BrGKp9Nm.js +110 -0
  6. package/chunks/DefaultPropsProvider-BsfB7QTn.js +257 -0
  7. package/chunks/FieldTypeIcon-Drs6hSJF.js +22 -0
  8. package/chunks/{LinearProgress-CUZ0D8_t.js → LinearProgress-VtfFx2vJ.js} +51 -51
  9. package/chunks/MenuOption-ByRqhRdX.js +3934 -0
  10. package/chunks/Title-CO5dP1ma.js +1691 -0
  11. package/chunks/ToggleButton-KOBAimC1.js +112 -0
  12. package/chunks/app-filter-bar.compiler-TwVTeoj5.js +64 -0
  13. package/chunks/bar.compiler-DuQg8EUb.js +374 -0
  14. package/chunks/builder-DEDvNq1k.js +201 -0
  15. package/chunks/{color-settings-ZIvgNTq1.js → color-rules-CN7TcGrC.js} +2 -6
  16. package/chunks/color-settings-3VRlf_Vw.js +6 -0
  17. package/chunks/colorManipulator-D8Pjy1pf.js +45 -0
  18. package/chunks/coloring-CncX_JRX.js +278 -0
  19. package/chunks/{src-BC7cGcJ-.js → definitions-BPJQTx16.js} +650 -464
  20. package/chunks/{escobar-BGqT1EsE.js → escobar-DRhRMYRE.js} +6282 -4931
  21. package/chunks/event-bus-CrLB-Y8z.js +3 -0
  22. package/chunks/extend-preset-CUFNpmPe.js +4398 -0
  23. package/chunks/filter.compiler-w27dlv0C.js +70 -0
  24. package/chunks/filtering-cc7WqWpg.js +1153 -0
  25. package/chunks/handlers-TOT-7INo.js +12871 -0
  26. package/chunks/icon-picker-styles-CoJmwTRi.js +2246 -0
  27. package/chunks/isEqual-B8loyPsC.js +12 -0
  28. package/chunks/label-format-type-weq1XfcX.js +8 -0
  29. package/chunks/line.compiler-Ct1WhN2p.js +198 -0
  30. package/chunks/logger-DpQtYQnX.js +1163 -0
  31. package/chunks/lookup-BWllin0q.js +36 -0
  32. package/chunks/{metadata-CPXdYoln.js → metadata-WABZrt7Y.js} +1 -1
  33. package/chunks/number.compiler-D8TPly-4.js +53 -0
  34. package/chunks/{src-C0LgoUWY.js → operations-Dh4v1Ovt.js} +7716 -7541
  35. package/chunks/{range-DrzdfBX4.js → range-Bi-7zT0k.js} +2 -2
  36. package/chunks/registry-KervaxqJ.js +31 -0
  37. package/chunks/render-wrappers-OEmtaM8g.js +2 -0
  38. package/chunks/{registry-CExpGJ1N.js → requirements-PAoRaJyb.js} +294 -326
  39. package/chunks/responsive.styles-DSiOGD7u.js +82 -0
  40. package/chunks/shared-Bn4N5QcZ.js +1218 -0
  41. package/chunks/src-77e3mC7i.js +391 -0
  42. package/chunks/standalone-B55oyW6c.js +689 -0
  43. package/chunks/{standalone-CY57qwZ-.js → standalone-BDhPQtzQ.js} +386 -352
  44. package/chunks/{standalone-BDCwI6Hn.js → standalone-BGkmozIb.js} +1108 -953
  45. package/chunks/standalone-BMTCb10X.js +179 -0
  46. package/chunks/standalone-BXKRE_Se.js +468 -0
  47. package/chunks/standalone-Bes8srx1.js +354 -0
  48. package/chunks/standalone-BjZp0QMe.js +2 -0
  49. package/chunks/{standalone-BH5NqDwp.js → standalone-BlMIwpEe.js} +687 -573
  50. package/chunks/{standalone-CCNtaJ7s.js → standalone-C8ZAEutO.js} +44 -43
  51. package/chunks/standalone-C8qAelL4.js +2 -0
  52. package/chunks/standalone-CJvIXsQE.js +743 -0
  53. package/chunks/standalone-CLmGb7nn2.js +355 -0
  54. package/chunks/{ui-D1HQNIBy.js → standalone-CM5XcAN5.js} +15946 -17658
  55. package/chunks/standalone-CXNP6-xD.js +420 -0
  56. package/chunks/{standalone-BYm1UjLr.js → standalone-D5Q5ngsD.js} +59 -57
  57. package/chunks/standalone-DLlyRIE6.js +287 -0
  58. package/chunks/standalone-DMcI1afI.js +396 -0
  59. package/chunks/{standalone-jiz0L2Dg.js → standalone-DN4S1MjT.js} +1113 -1094
  60. package/chunks/{standalone-QJ1kKMnO.js → standalone-DT0wKji7.js} +2 -2
  61. package/chunks/{standalone-D5vnf-9y.js → standalone-DVTJwsTY.js} +1110 -1035
  62. package/chunks/standalone-DW6NT205.js +518 -0
  63. package/chunks/standalone-DYQIQH4c.js +2095 -0
  64. package/chunks/standalone-D__XCp-h.js +1003 -0
  65. package/chunks/standalone-XTgSsTAa.js +354 -0
  66. package/chunks/standalone-XuGksArp.js +68 -0
  67. package/chunks/{standalone-CNyNHKVx.js → standalone-we5D5MIn.js} +176 -172
  68. package/chunks/table.compiler-DMeeHxb6.js +222 -0
  69. package/chunks/useFieldName-Cjn9KCVp.js +7 -0
  70. package/chunks/useSlotProps-DLbQp4lc.js +166 -0
  71. package/chunks/{utils-Ba9T0TqC.js → utils-vdmi_2PK.js} +6266 -6517
  72. package/chunks/{src-DvX5LU9T.js → view-BuwQugKb.js} +2893 -5956
  73. package/chunks/visualization-filters-Cc4KU-l-.js +7455 -0
  74. package/chunks/web-components-DqClFkgO.js +1185 -0
  75. package/chunks/with-html-element-D0uY2zjI.js +7328 -0
  76. package/definitions.js +3 -3
  77. package/docs/operations/astrato-app-filter-bar.md +17 -17
  78. package/docs/operations/bar.md +1006 -1071
  79. package/docs/operations/combo.md +717 -738
  80. package/docs/operations/date-picker.md +27 -27
  81. package/docs/operations/distribution-gauge.md +471 -607
  82. package/docs/operations/dot.md +787 -879
  83. package/docs/operations/filter.md +139 -163
  84. package/docs/operations/gauge.md +491 -627
  85. package/docs/operations/heatMap.md +834 -916
  86. package/docs/operations/histogram.md +166 -180
  87. package/docs/operations/iframe.md +5 -5
  88. package/docs/operations/image.md +16 -16
  89. package/docs/operations/index.md +12 -12
  90. package/docs/operations/line.md +811 -888
  91. package/docs/operations/number.md +470 -536
  92. package/docs/operations/pie.md +825 -958
  93. package/docs/operations/radar.md +599 -679
  94. package/docs/operations/sankey.md +462 -584
  95. package/docs/operations/scatter.md +823 -929
  96. package/docs/operations/shape.md +34 -34
  97. package/docs/operations/simpleTextObject.md +18 -25
  98. package/docs/operations/slider.md +33 -43
  99. package/docs/operations/table.md +1177 -1150
  100. package/docs/operations/tree.md +404 -397
  101. package/docs/operations/treemap.md +595 -673
  102. package/docs/operations/waterfall.md +369 -379
  103. package/docs/operations/word-cloud.md +512 -583
  104. package/getters.js +7 -7
  105. package/index.js +3 -1183
  106. package/metadata.js +18 -18
  107. package/operations.js +13 -13
  108. package/package.json +133 -88
  109. package/render.js +10 -0
  110. package/src/charts/bar.d.ts +1 -0
  111. package/src/charts/combo.d.ts +1 -0
  112. package/src/charts/dot.d.ts +1 -0
  113. package/src/charts/gauge-distribution.d.ts +1 -0
  114. package/src/charts/gauge.d.ts +1 -0
  115. package/src/charts/heat-map.d.ts +1 -0
  116. package/src/charts/histogram.d.ts +1 -0
  117. package/src/charts/line.d.ts +1 -0
  118. package/src/charts/pie.d.ts +1 -0
  119. package/src/charts/radar.d.ts +1 -0
  120. package/src/charts/sankey.d.ts +1 -0
  121. package/src/charts/scatter.d.ts +1 -0
  122. package/src/charts/table.d.ts +1 -0
  123. package/src/charts/tree.d.ts +1 -0
  124. package/src/charts/treemap.d.ts +1 -0
  125. package/src/charts/waterfall.d.ts +1 -0
  126. package/src/charts/word-cloud.d.ts +1 -0
  127. package/src/definitions/index.d.ts +2 -2
  128. package/src/definitions/{shared/lib → model/definitions}/available-fields.d.ts +0 -1
  129. package/src/definitions/{shared/lib/compilers/index.d.ts → model/definitions/compilers/compile.d.ts} +1 -1
  130. package/src/definitions/model/definitions/data-item-resolution.d.ts +19 -0
  131. package/src/definitions/model/definitions/descriptors/descriptor-metadata.d.ts +1364 -0
  132. package/src/definitions/model/definitions/descriptors/json-schema.d.ts +2 -0
  133. package/src/definitions/model/definitions/diagnostics.d.ts +5 -0
  134. package/src/definitions/model/definitions/field-suggestions.d.ts +2 -0
  135. package/src/definitions/model/definitions/index.d.ts +23 -0
  136. package/src/definitions/{shared/lib → model/definitions}/registry/compile.d.ts +1 -1
  137. package/src/definitions/model/definitions/registry/descriptor-registry.d.ts +3 -0
  138. package/src/definitions/model/definitions/schema-registry.d.ts +660 -0
  139. package/src/definitions/{shared/lib → model/definitions}/schemas/broad-chart.schema.d.ts +1 -1
  140. package/src/definitions/{shared/lib → model/definitions}/schemas/common.schema.d.ts +0 -1
  141. package/src/definitions/model/definitions/schemas/index.d.ts +9 -0
  142. package/src/definitions/{shared/lib → model/definitions}/schemas/object.schema.d.ts +8 -8
  143. package/src/definitions/{shared/lib → model/definitions}/types/compilation.types.d.ts +10 -0
  144. package/src/definitions/{shared/lib → model/definitions}/types/definition.types.d.ts +1 -1
  145. package/src/definitions/model/definitions/types/index.d.ts +3 -0
  146. package/src/definitions/{shared/lib/registry → model/definitions}/validation.d.ts +1 -1
  147. package/src/getters/index.d.ts +3 -3
  148. package/src/index.d.ts +1 -1
  149. package/src/objects/app-filter-bar.d.ts +1 -0
  150. package/src/objects/date-picker.d.ts +1 -0
  151. package/src/objects/filter.d.ts +1 -0
  152. package/src/objects/iframe.d.ts +1 -0
  153. package/src/objects/image.d.ts +1 -0
  154. package/src/objects/number.d.ts +1 -0
  155. package/src/objects/shape.d.ts +1 -0
  156. package/src/objects/slider.d.ts +1 -0
  157. package/src/objects/text.d.ts +1 -0
  158. package/src/operations/index.d.ts +3 -3
  159. package/src/registry/create-visualization-registry.d.ts +5 -0
  160. package/src/render/index.d.ts +34 -0
  161. package/src/runtime/index.d.ts +2 -2
  162. package/src/types.d.ts +9 -4
  163. package/src/web-components/index.d.ts +3 -3
  164. package/chunks/Radio-Ciu-F4CU.js +0 -957
  165. package/chunks/ToggleButton-BCJc3Jlc.js +0 -153
  166. package/chunks/_baseFlatten-DPXPOrea.js +0 -7076
  167. package/chunks/app-filter-bar.compiler-j_CVoWTa.js +0 -55
  168. package/chunks/bar.compiler-oqaPzIut.js +0 -370
  169. package/chunks/coloring-C16AUZEi.js +0 -663
  170. package/chunks/data-item-resolution-1lvYB5ln.js +0 -53
  171. package/chunks/event-bus-KiSiCJrC.js +0 -2683
  172. package/chunks/events-WZut5Ow6.js +0 -4
  173. package/chunks/filter.compiler-CuLtc_02.js +0 -60
  174. package/chunks/filtering-Yq4DEa0t.js +0 -953
  175. package/chunks/gauge-target-type-BkKXAqkX.js +0 -4
  176. package/chunks/grouping-type-BX_9Ix5q.js +0 -3
  177. package/chunks/interfaces-VUY4_yVO.js +0 -8742
  178. package/chunks/line-settings-DfYTUyPz.js +0 -4
  179. package/chunks/line.compiler-BpA_6Tc7.js +0 -188
  180. package/chunks/number.compiler-DbkWcG4S.js +0 -44
  181. package/chunks/pie-uv42Eqal.js +0 -10
  182. package/chunks/requirements-DNhuShLS.js +0 -6
  183. package/chunks/shared-CKDL4hx9.js +0 -1171
  184. package/chunks/src-Cum_2NLV.js +0 -12145
  185. package/chunks/src-Dun_jXtz.js +0 -10295
  186. package/chunks/standalone-87YV_m9n.js +0 -687
  187. package/chunks/standalone-BLVAWLNJ.js +0 -385
  188. package/chunks/standalone-BPomtAVs.js +0 -2
  189. package/chunks/standalone-BXyBcUOQ.js +0 -2
  190. package/chunks/standalone-BllF4rDp.js +0 -383
  191. package/chunks/standalone-BmfMt74U.js +0 -726
  192. package/chunks/standalone-BqWyrnZI.js +0 -281
  193. package/chunks/standalone-C85u7U6I.js +0 -340
  194. package/chunks/standalone-CDQnr6qT.js +0 -345
  195. package/chunks/standalone-CZynjFG7.js +0 -12979
  196. package/chunks/standalone-DFPva_ku.js +0 -299
  197. package/chunks/standalone-DQxxNwF8.js +0 -675
  198. package/chunks/standalone-DS9T0FZ-.js +0 -830
  199. package/chunks/standalone-Dx3MLlrO.js +0 -512
  200. package/chunks/standalone-DzixzZAL.js +0 -411
  201. package/chunks/standalone-lBm9hQ-q.js +0 -179
  202. package/chunks/standalone-rJ45Zfl1.js +0 -68
  203. package/chunks/table.compiler-BrXkm4Fz.js +0 -213
  204. package/chunks/toInteger-DVZr-D1j.js +0 -11
  205. package/chunks/treemap-x_zmJoG7.js +0 -23
  206. package/chunks/types-dVVCsDWD.js +0 -4
  207. package/chunks/useFieldName-oqQ3bvnO.js +0 -7
  208. package/chunks/view-CLqWMV7Z.js +0 -156
  209. package/src/definitions/shared/index.d.ts +0 -5
  210. package/src/definitions/shared/lib/registry/descriptor-registry.d.ts +0 -587
  211. package/src/definitions/shared/lib/registry/index.d.ts +0 -3
  212. package/src/definitions/shared/lib/schemas/index.d.ts +0 -9
  213. package/src/definitions/shared/lib/types/index.d.ts +0 -3
  214. package/src/definitions/{shared/lib → model/definitions}/schemas/app-filter-bar.schema.d.ts +0 -0
  215. package/src/definitions/{shared/lib → model/definitions}/schemas/bar.schema.d.ts +0 -0
  216. package/src/definitions/{shared/lib → model/definitions}/schemas/filter.schema.d.ts +0 -0
  217. package/src/definitions/{shared/lib → model/definitions}/schemas/line.schema.d.ts +0 -0
  218. package/src/definitions/{shared/lib → model/definitions}/schemas/number.schema.d.ts +0 -0
  219. package/src/definitions/{shared/lib → model/definitions}/schemas/table.schema.d.ts +4 -4
  220. /package/src/definitions/{shared/lib → model/definitions}/types/descriptor.types.d.ts +0 -0
@@ -1,27 +1,39 @@
1
1
  import { o as e } from "./rolldown-runtime-DleVn1XH.js";
2
- import { Fi as t, Kn as n, Mi as r, Ni as i, Ns as a, Oa as o, Os as s, Ti as c, d as l, ds as u, i as d, pc as f, za as p } from "./interfaces-VUY4_yVO.js";
3
- import { B as m, Ki as h, M as g, N as _, Pr as v, Un as y, Zt as b, a as x, hn as S, s as C, u as ee, wi as w, xn as te } from "./utils-Ba9T0TqC.js";
4
- import { Oi as ne } from "./src-Dun_jXtz.js";
5
- import { C as T, E as re, Gt as ie, Ht as ae, Jt as E, O as oe, T as se, a as ce, d as le, f as ue, g as de, k as D, m as fe, u as pe, v as me, x as he, y as ge } from "./escobar-BGqT1EsE.js";
6
- import { p as _e } from "./ui-D1HQNIBy.js";
7
- import { _t as ve, l as ye } from "./_baseFlatten-DPXPOrea.js";
8
- import { t as be } from "./ToggleButton-BCJc3Jlc.js";
9
- import { c as xe, m as Se } from "./coloring-C16AUZEi.js";
10
- import { f as Ce, r as we, t as Te, u as Ee, y as De } from "./src-D9XogOrc.js";
11
- import { a as Oe, i as ke, r as Ae, t as je } from "./accessors-DemrDevR.js";
12
- import { r as Me, t as Ne } from "./src-BOS6SqkZ.js";
13
- var O = /* @__PURE__ */ e(h()), Pe = ({ vTheme: e, vSpec: n, id: a, layout: s }) => {
14
- let c = e?.fonts?.general.fontFamily ?? "Roboto", l = {
15
- ...r,
16
- ...n.treeChartSettings?.nodeLayout?.border
17
- };
18
- l.enabled === !1 && (l.borderWidth = 0);
19
- let u = {
20
- ...i,
21
- ...n.treeChartSettings?.nodeLayout.hoverStyle
22
- }, d = n.treeChartSettings?.nodeLayout?.backgroundColor ?? t.backgroundColor, f = new ye(d).isLight() ? o.grey1 : o.grey5;
2
+ import { Hi as t, Kr as n, Ui as r, Us as i, Wi as a, Wo as o, Yo as s, Yr as c, fn as l, qr as u, ta as d, xs as f, zr as p } from "./visualization-filters-Cc4KU-l-.js";
3
+ import { Ei as m, M as h, Rn as g, Xt as _, a as v, bn as y, j as b, mn as x, ri as S, s as C, u as ee, xr as te, z as ne } from "./utils-vdmi_2PK.js";
4
+ import { Oi as re } from "./handlers-TOT-7INo.js";
5
+ import { n as w } from "./isEqual-B8loyPsC.js";
6
+ import { s as ie } from "./logger-DpQtYQnX.js";
7
+ import { A as ae, C as oe, D as se, M as ce, N as le, S as ue, T as de, Xt as fe, a as pe, b as me, g as he, h as ge, in as T, k as _e, m as ve, qt as ye, v as be } from "./escobar-DRhRMYRE.js";
8
+ import { M as xe, _ as Se } from "./MenuOption-ByRqhRdX.js";
9
+ import { t as Ce } from "./ToggleButton-KOBAimC1.js";
10
+ import "./coloring-CncX_JRX.js";
11
+ import { s as we, t as Te } from "./src-77e3mC7i.js";
12
+ import { f as Ee, r as De, t as Oe, u as ke, y as Ae } from "./src-D9XogOrc.js";
13
+ import { a as je, i as Me, r as Ne, t as Pe } from "./accessors-DemrDevR.js";
14
+ import { r as Fe, t as Ie } from "./src-BOS6SqkZ.js";
15
+ var E = S(), Le = ({ fillColor: e = t.grey2 }) => /* @__PURE__ */ (0, E.jsx)("svg", {
16
+ width: "16",
17
+ height: "16",
18
+ viewBox: "0 0 24 24",
19
+ fill: "none",
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ children: /* @__PURE__ */ (0, E.jsx)("path", {
22
+ d: "M3 17.46V20.5C3 20.78 3.22 21 3.5 21H6.54C6.67 21 6.8 20.95 6.89 20.85L17.81 9.94L14.06 6.19L3.15 17.1C3.05 17.2 3 17.32 3 17.46ZM20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C17.98 2.9 17.35 2.9 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04Z",
23
+ fill: e
24
+ })
25
+ }), D = /* @__PURE__ */ e(m()), Re = ({ vTheme: e, vSpec: r, id: i, layout: a }) => {
26
+ let o = e?.fonts?.general.fontFamily ?? "Roboto", s = {
27
+ ...n,
28
+ ...r.treeChartSettings?.nodeLayout?.border
29
+ };
30
+ s.enabled === !1 && (s.borderWidth = 0);
31
+ let l = {
32
+ ...u,
33
+ ...r.treeChartSettings?.nodeLayout.hoverStyle
34
+ }, d = r.treeChartSettings?.nodeLayout?.backgroundColor ?? c.backgroundColor, f = new Se(d).isLight() ? t.grey1 : t.grey5;
23
35
  return `
24
- #${a} {
36
+ #${i} {
25
37
  &[data-mode="view"] .tree-toolbar {
26
38
  display: none;
27
39
  }
@@ -29,19 +41,19 @@ var O = /* @__PURE__ */ e(h()), Pe = ({ vTheme: e, vSpec: n, id: a, layout: s })
29
41
  display: flex;
30
42
  }
31
43
 
32
- --link-color: ${o.grey3};
44
+ --link-color: ${t.grey3};
33
45
 
34
- --border-color: ${l.borderColor};
35
- --border-width: ${l.borderWidth}px;
36
- --border-color-edit: ${o.secondaryPurple};
37
- --border-radius: ${l.borderRadius}px;
38
- --border-color-selected: ${o.grey2};
46
+ --border-color: ${s.borderColor};
47
+ --border-width: ${s.borderWidth}px;
48
+ --border-color-edit: ${t.secondaryPurple};
49
+ --border-radius: ${s.borderRadius}px;
50
+ --border-color-selected: ${t.grey2};
39
51
 
40
- --border-hover-width: ${u.borderWidth}px;
41
- --border-hover-color: ${u.borderColor || l.borderColor};
52
+ --border-hover-width: ${l.borderWidth}px;
53
+ --border-hover-color: ${l.borderColor || s.borderColor};
42
54
 
43
55
  --node-background: ${d};
44
- --node-background-highlight: ${o.grey2};
56
+ --node-background-highlight: ${t.grey2};
45
57
  --font-color: ${f};
46
58
 
47
59
  .links-wrapper path {
@@ -68,14 +80,14 @@ var O = /* @__PURE__ */ e(h()), Pe = ({ vTheme: e, vSpec: n, id: a, layout: s })
68
80
 
69
81
  .button-content {
70
82
  border:1px solid var(--border-color);
71
- border-radius: ${Math.ceil(l.borderRadius / 2)}px;
83
+ border-radius: ${Math.ceil(s.borderRadius / 2)}px;
72
84
  padding:1px 3px;
73
85
  font-size:9px;
74
86
  margin:auto auto;
75
87
  background-color: var(--node-background);
76
88
  }
77
89
  &:hover .button-content {
78
- background-color: ${o.grey5};
90
+ background-color: ${t.grey5};
79
91
  }
80
92
  }
81
93
 
@@ -93,7 +105,7 @@ var O = /* @__PURE__ */ e(h()), Pe = ({ vTheme: e, vSpec: n, id: a, layout: s })
93
105
  .node-content {
94
106
  color: var(--font-color);
95
107
  font-size: 12px;
96
- font-family: ${c}, sans-serif;
108
+ font-family: ${o}, sans-serif;
97
109
  width: 100%;
98
110
  height: 100%;
99
111
  border: var(--border-width) solid var(--border-color);
@@ -131,7 +143,7 @@ var O = /* @__PURE__ */ e(h()), Pe = ({ vTheme: e, vSpec: n, id: a, layout: s })
131
143
  }
132
144
 
133
145
  .dragging-active .drop-target .node-content::after {
134
- background-color: ${o.feedbackBlue};
146
+ background-color: ${t.feedbackBlue};
135
147
  opacity: 1;
136
148
  }
137
149
 
@@ -150,7 +162,7 @@ var O = /* @__PURE__ */ e(h()), Pe = ({ vTheme: e, vSpec: n, id: a, layout: s })
150
162
  width: 100%;
151
163
  height: 100%;
152
164
  border-radius: var(--border-radius);
153
- background-color: ${o.grey2};
165
+ background-color: ${t.grey2};
154
166
  opacity: 0.2;
155
167
  }
156
168
  .node-excluded .node-foreign-object-div {
@@ -158,27 +170,27 @@ var O = /* @__PURE__ */ e(h()), Pe = ({ vTheme: e, vSpec: n, id: a, layout: s })
158
170
  }
159
171
  }
160
172
 
161
- ${s.getCSS(a, n)}`;
162
- }, Fe = { depth: -1 }, Ie = {}, Le = {};
163
- function Re(e) {
173
+ ${a.getCSS(i, r)}`;
174
+ }, ze = { depth: -1 }, Be = {}, Ve = {};
175
+ function He(e) {
164
176
  return e.id;
165
177
  }
166
- function ze(e) {
178
+ function Ue(e) {
167
179
  return e.parentId;
168
180
  }
169
- function Be() {
170
- var e = Re, t = ze, n;
181
+ function We() {
182
+ var e = He, t = Ue, n;
171
183
  function r(r) {
172
184
  var i = Array.from(r), a = e, o = t, s, c, l, u, d, f, p, m, h = /* @__PURE__ */ new Map();
173
185
  if (n != null) {
174
- let e = i.map((e, t) => Ve(n(e, t, r))), t = e.map(He), s = new Set(e).add("");
175
- for (let n of t) s.has(n) || (s.add(n), e.push(n), t.push(He(n)), i.push(Le));
186
+ let e = i.map((e, t) => Ge(n(e, t, r))), t = e.map(Ke), s = new Set(e).add("");
187
+ for (let n of t) s.has(n) || (s.add(n), e.push(n), t.push(Ke(n)), i.push(Ve));
176
188
  a = (t, n) => e[n], o = (e, n) => t[n];
177
189
  }
178
- for (l = 0, s = i.length; l < s; ++l) c = i[l], f = i[l] = new Ae(c), (p = a(c, l, r)) != null && (p += "") && (m = f.id = p, h.set(m, h.has(m) ? Ie : f)), (p = o(c, l, r)) != null && (p += "") && (f.parent = p);
190
+ for (l = 0, s = i.length; l < s; ++l) c = i[l], f = i[l] = new Ne(c), (p = a(c, l, r)) != null && (p += "") && (m = f.id = p, h.set(m, h.has(m) ? Be : f)), (p = o(c, l, r)) != null && (p += "") && (f.parent = p);
179
191
  for (l = 0; l < s; ++l) if (f = i[l], p = f.parent) {
180
192
  if (d = h.get(p), !d) throw Error("missing: " + p);
181
- if (d === Ie) throw Error("ambiguous: " + p);
193
+ if (d === Be) throw Error("ambiguous: " + p);
182
194
  d.children ? d.children.push(f) : d.children = [f], f.parent = d;
183
195
  } else {
184
196
  if (u) throw Error("multiple roots");
@@ -186,34 +198,34 @@ function Be() {
186
198
  }
187
199
  if (!u) throw Error("no root");
188
200
  if (n != null) {
189
- for (; u.data === Le && u.children.length === 1;) u = u.children[0], --s;
190
- for (let e = i.length - 1; e >= 0 && (f = i[e], f.data === Le); --e) f.data = null;
201
+ for (; u.data === Ve && u.children.length === 1;) u = u.children[0], --s;
202
+ for (let e = i.length - 1; e >= 0 && (f = i[e], f.data === Ve); --e) f.data = null;
191
203
  }
192
- if (u.parent = Fe, u.eachBefore(function(e) {
204
+ if (u.parent = ze, u.eachBefore(function(e) {
193
205
  e.depth = e.parent.depth + 1, --s;
194
- }).eachBefore(ke), u.parent = null, s > 0) throw Error("cycle");
206
+ }).eachBefore(Me), u.parent = null, s > 0) throw Error("cycle");
195
207
  return u;
196
208
  }
197
209
  return r.id = function(t) {
198
- return arguments.length ? (e = je(t), r) : e;
210
+ return arguments.length ? (e = Pe(t), r) : e;
199
211
  }, r.parentId = function(e) {
200
- return arguments.length ? (t = je(e), r) : t;
212
+ return arguments.length ? (t = Pe(e), r) : t;
201
213
  }, r.path = function(e) {
202
- return arguments.length ? (n = je(e), r) : n;
214
+ return arguments.length ? (n = Pe(e), r) : n;
203
215
  }, r;
204
216
  }
205
- function Ve(e) {
217
+ function Ge(e) {
206
218
  e = `${e}`;
207
219
  let t = e.length;
208
- return Ue(e, t - 1) && !Ue(e, t - 2) && (e = e.slice(0, -1)), e[0] === "/" ? e : `/${e}`;
220
+ return qe(e, t - 1) && !qe(e, t - 2) && (e = e.slice(0, -1)), e[0] === "/" ? e : `/${e}`;
209
221
  }
210
- function He(e) {
222
+ function Ke(e) {
211
223
  let t = e.length;
212
224
  if (t < 2) return "";
213
- for (; --t > 1 && !Ue(e, t););
225
+ for (; --t > 1 && !qe(e, t););
214
226
  return e.slice(0, t);
215
227
  }
216
- function Ue(e, t) {
228
+ function qe(e, t) {
217
229
  if (e[t] === "/") {
218
230
  let n = 0;
219
231
  for (; t > 0 && e[--t] === "\\";) ++n;
@@ -221,39 +233,39 @@ function Ue(e, t) {
221
233
  }
222
234
  return !1;
223
235
  }
224
- function We(e, t) {
236
+ function Je(e, t) {
225
237
  return e.parent === t.parent ? 1 : 2;
226
238
  }
227
- function Ge(e) {
239
+ function Ye(e) {
228
240
  var t = e.children;
229
241
  return t ? t[0] : e.t;
230
242
  }
231
- function Ke(e) {
243
+ function Xe(e) {
232
244
  var t = e.children;
233
245
  return t ? t[t.length - 1] : e.t;
234
246
  }
235
- function qe(e, t, n) {
247
+ function Ze(e, t, n) {
236
248
  var r = n / (t.i - e.i);
237
249
  t.c -= r, t.s += n, e.c += r, t.z += n, t.m += n;
238
250
  }
239
- function Je(e) {
251
+ function Qe(e) {
240
252
  for (var t = 0, n = 0, r = e.children, i = r.length, a; --i >= 0;) a = r[i], a.z += t, a.m += t, t += a.s + (n += a.c);
241
253
  }
242
- function Ye(e, t, n) {
254
+ function $e(e, t, n) {
243
255
  return e.a.parent === t.parent ? e.a : n;
244
256
  }
245
- function Xe(e, t) {
257
+ function et(e, t) {
246
258
  this._ = e, this.parent = null, this.children = null, this.A = null, this.a = this, this.z = 0, this.m = 0, this.c = 0, this.s = 0, this.t = null, this.i = t;
247
259
  }
248
- Xe.prototype = Object.create(Ae.prototype);
249
- function Ze(e) {
250
- for (var t = new Xe(e, 0), n, r = [t], i, a, o, s; n = r.pop();) if (a = n._.children) for (n.children = Array(s = a.length), o = s - 1; o >= 0; --o) r.push(i = n.children[o] = new Xe(a[o], o)), i.parent = n;
251
- return (t.parent = new Xe(null, 0)).children = [t], t;
260
+ et.prototype = Object.create(Ne.prototype);
261
+ function tt(e) {
262
+ for (var t = new et(e, 0), n, r = [t], i, a, o, s; n = r.pop();) if (a = n._.children) for (n.children = Array(s = a.length), o = s - 1; o >= 0; --o) r.push(i = n.children[o] = new et(a[o], o)), i.parent = n;
263
+ return (t.parent = new et(null, 0)).children = [t], t;
252
264
  }
253
- function Qe() {
254
- var e = We, t = 1, n = 1, r = null;
265
+ function nt() {
266
+ var e = Je, t = 1, n = 1, r = null;
255
267
  function i(i) {
256
- var s = Ze(i);
268
+ var s = tt(i);
257
269
  if (s.eachAfter(a), s.parent.m = -s.z, s.eachBefore(o), r) i.eachBefore(c);
258
270
  else {
259
271
  var l = i, u = i, d = i;
@@ -270,7 +282,7 @@ function Qe() {
270
282
  function a(t) {
271
283
  var n = t.children, r = t.parent.children, i = t.i ? r[t.i - 1] : null;
272
284
  if (n) {
273
- Je(t);
285
+ Qe(t);
274
286
  var a = (n[0].z + n[n.length - 1].z) / 2;
275
287
  i ? (t.z = i.z + e(t._, i._), t.m = t.z - a) : t.z = a;
276
288
  } else i && (t.z = i.z + e(t._, i._));
@@ -281,8 +293,8 @@ function Qe() {
281
293
  }
282
294
  function s(t, n, r) {
283
295
  if (n) {
284
- for (var i = t, a = t, o = n, s = i.parent.children[0], c = i.m, l = a.m, u = o.m, d = s.m, f; o = Ke(o), i = Ge(i), o && i;) s = Ge(s), a = Ke(a), a.a = t, f = o.z + u - i.z - c + e(o._, i._), f > 0 && (qe(Ye(o, t, r), t, f), c += f, l += f), u += o.m, c += i.m, d += s.m, l += a.m;
285
- o && !Ke(a) && (a.t = o, a.m += u - l), i && !Ge(s) && (s.t = i, s.m += c - d, r = t);
296
+ for (var i = t, a = t, o = n, s = i.parent.children[0], c = i.m, l = a.m, u = o.m, d = s.m, f; o = Xe(o), i = Ye(i), o && i;) s = Ye(s), a = Xe(a), a.a = t, f = o.z + u - i.z - c + e(o._, i._), f > 0 && (Ze($e(o, t, r), t, f), c += f, l += f), u += o.m, c += i.m, d += s.m, l += a.m;
297
+ o && !Xe(a) && (a.t = o, a.m += u - l), i && !Ye(s) && (s.t = i, s.m += c - d, r = t);
286
298
  }
287
299
  return r;
288
300
  }
@@ -297,14 +309,14 @@ function Qe() {
297
309
  return arguments.length ? (r = !0, t = +e[0], n = +e[1], i) : r ? [t, n] : null;
298
310
  }, i;
299
311
  }
300
- var k = "__root__", $e = "__total__", et = (e) => `__dimension__${JSON.stringify(e)}`, tt = (e, t) => {
312
+ var O = "__root__", rt = "__total__", it = (e) => `__dimension__${JSON.stringify(e)}`, at = (e, t) => {
301
313
  let n = e[t];
302
314
  return n == null ? ["nil"] : [
303
315
  "value",
304
316
  typeof n,
305
317
  n
306
318
  ];
307
- }, nt = (e, t) => {
319
+ }, k = (e, t) => {
308
320
  if (t?.indicator !== "custom") return;
309
321
  let n = t?.indicatorThreshold;
310
322
  if (!n || e == null) return {
@@ -330,148 +342,150 @@ var k = "__root__", $e = "__total__", et = (e) => `__dimension__${JSON.stringify
330
342
  color: null,
331
343
  icon: void 0
332
344
  };
333
- }, rt = (e, t, n, r) => {
334
- let i = {};
345
+ }, ot = (e, t, n, r) => {
346
+ let a = {};
335
347
  return e.slots?.forEach((n) => {
336
348
  if (n.key === "main") return;
337
- let a = {
349
+ let o = {
338
350
  enabled: n.enabled === !0,
339
351
  label: "-",
340
352
  value: null,
341
353
  indicator: n.indicator ?? null
342
354
  };
343
- if (a.enabled) {
344
- let i = e.formatter;
355
+ if (o.enabled) {
356
+ let a = e.formatter;
345
357
  if (n.source === "field") {
346
- let o = r?.find((t) => t.parentId === e.dataItem.uniqueSignature && t.role === `tree-${n.key}`);
347
- if (o) {
348
- let e = f(o.dataItem);
349
- o.formatter && (i = o.formatter), e && (a.value = t?.[e], a.label = a.value === null ? "-" : S(i?.format, a.value) ?? "-");
358
+ let s = r?.find((t) => t.parentId === e.dataItem.uniqueSignature && t.role === `tree-${n.key}`);
359
+ if (s) {
360
+ let e = i(s.dataItem);
361
+ s.formatter && (a = s.formatter), e && (o.value = t?.[e], o.label = o.value === null ? "-" : x(a?.format, o.value) ?? "-");
350
362
  }
351
- } else n.source === "variable" && (a.value = n.propertyValue, a.label = a.value === null ? "-" : S(i?.format, a.value) ?? "-");
352
- a.customIndicator = nt(a.value, n);
363
+ } else n.source === "variable" && (o.value = n.propertyValue, o.label = o.value === null ? "-" : x(a?.format, o.value) ?? "-");
364
+ o.customIndicator = k(o.value, n);
353
365
  }
354
- i[n.key] = { ...a };
355
- }), i;
356
- }, it = (e, t, n, r = !1) => {
366
+ a[n.key] = { ...o };
367
+ }), a;
368
+ }, st = (e, t, n, r = !1) => {
357
369
  if (n === 0 || e.data.id === "__total__") return !0;
358
370
  let i = t ?? 2;
359
371
  return e.depth - +!!r < i;
360
- }, at = (e, t, r) => {
361
- let i = [{
362
- id: k,
372
+ }, ct = (e, t, n) => {
373
+ let r = [{
374
+ id: O,
363
375
  parentId: null,
364
376
  disabled: !1
365
377
  }], a = /* @__PURE__ */ new Set();
366
378
  e.measures.forEach((e) => {
367
379
  a.add(e.dataItem.uniqueSignature);
368
380
  });
369
- let o = e.measures.filter((e) => c(e));
381
+ let o = e.measures.filter((e) => p(e));
370
382
  e.measures.forEach((e) => {
371
- let t = e.dataItem.uniqueSignature, n = e.parentId && a.has(e.parentId) ? e.parentId : k;
372
- i.push({
383
+ let t = e.dataItem.uniqueSignature, n = e.parentId && a.has(e.parentId) ? e.parentId : O;
384
+ r.push({
373
385
  id: t,
374
386
  parentId: n,
375
- disabled: !c(e)
387
+ disabled: !p(e)
376
388
  });
377
389
  });
378
- let s = Be().id((e) => e.id).parentId((e) => e.parentId)(i), l = [];
390
+ let s = We().id((e) => e.id).parentId((e) => e.parentId)(r), c = [];
379
391
  s.descendants().forEach((e) => {
380
392
  if (e.data.disabled) return;
381
393
  let t = e.ancestors().slice(1).find((e) => !e.data.disabled);
382
- t ? l.push({
394
+ t ? c.push({
383
395
  id: e.data.id,
384
396
  parentId: t.data.id
385
- }) : l.push({
397
+ }) : c.push({
386
398
  id: e.data.id,
387
399
  parentId: null
388
400
  });
389
401
  });
390
- let u = l.map((r) => {
391
- if (r.id === "__root__") return {
392
- id: r.id,
402
+ let u = c.flatMap((n) => {
403
+ if (n.id === "__root__") return [{
404
+ id: n.id,
393
405
  parentId: null,
394
406
  label: "Dummy Root",
395
407
  value: {
396
408
  label: "-",
397
409
  value: null
398
410
  }
399
- };
400
- let i = o.find((e) => e.dataItem.uniqueSignature === r.id), a = f(i.dataItem), s = t[0].items?.[0], c = i ? rt(i, s, o, e.supportingMeasures) : {}, l = s?.[a], u = i?.slots?.find((e) => e.key === "main");
401
- return {
402
- id: r.id,
403
- parentId: r.parentId,
404
- label: n(i),
411
+ }];
412
+ let r = o.find((e) => e.dataItem.uniqueSignature === n.id);
413
+ if (!r) return [];
414
+ let a = i(r.dataItem), s = t[0].items?.[0], c = r ? ot(r, s, o, e.supportingMeasures) : {}, u = s?.[a], d = r?.slots?.find((e) => e.key === "main");
415
+ return [{
416
+ id: n.id,
417
+ parentId: n.parentId,
418
+ label: l(r),
405
419
  value: {
406
- label: S(i.formatter?.format, t[0].items?.[0]?.[a]) ?? "-",
407
- value: l
420
+ label: x(r.formatter?.format, t[0].items?.[0]?.[a]) ?? "-",
421
+ value: u
408
422
  },
409
- indicator: u?.indicator ?? null,
410
- customIndicator: nt(l, u),
423
+ indicator: d?.indicator ?? null,
424
+ customIndicator: k(u, d),
411
425
  brush: {
412
- key: [ie.sourceKey, ie.field].join("/"),
413
- value: ae(i)
426
+ key: [fe.sourceKey, fe.field].join("/"),
427
+ value: ye(r)
414
428
  },
415
429
  ...c
416
- };
417
- }), d = Be().id((e) => e.id).parentId((e) => e.parentId)(u), p = o.map((e) => e.dataItem.uniqueSignature);
418
- return d.sort((e, t) => p.indexOf(e.data.id) - p.indexOf(t.data.id)), d.descendants().forEach((e) => {
430
+ }];
431
+ }), d = We().id((e) => e.id).parentId((e) => e.parentId)(u), f = o.map((e) => e.dataItem.uniqueSignature);
432
+ return d.sort((e, t) => f.indexOf(e.data.id) - f.indexOf(t.data.id)), d.descendants().forEach((e) => {
419
433
  let t = !1;
420
- t = e.data.id in r ? r[e.data.id] === !1 : e.data.expanded?.enabled ? e.data.expanded.value === !1 : !1, t && (e._children = e.children, e.children = null);
434
+ t = e.data.id in n ? n[e.data.id] === !1 : e.data.expanded?.enabled ? e.data.expanded.value === !1 : !1, t && (e._children = e.children, e.children = void 0);
421
435
  }), d;
422
- }, ot = (e, t, n) => {
436
+ }, lt = (e, t, n) => {
423
437
  if (t.itemsNotAffectedByFiltering?.pattern?.length && e.staticFilters.ignoreGlobalFilters && e.staticFilters.showGlobalFiltersEffect) {
424
438
  let e = [0, ...t.itemsNotAffectedByFiltering.pattern.map((e) => n[e]).filter((e) => e !== null)].join("-");
425
439
  return !t.itemsNotAffectedByFiltering.itemsMap?.[e];
426
440
  }
427
441
  return !1;
428
- }, st = (e, t, n, r, i, a) => {
429
- let { id: o, parentId: s, prop: c, measureProp: l, dataItemIdx: u, engineKey: d } = a, f = n?.slots?.find((e) => e.key === "main"), p = i && n ? rt(n, r, [n], e.supportingMeasures) : {};
442
+ }, ut = (e, t, n, r, i, a) => {
443
+ let { id: o, parentId: s, prop: c, measureProp: l, dataItemIdx: u, engineKey: d } = a, f = n?.slots?.find((e) => e.key === "main"), p = i && n ? ot(n, r, [n], e.supportingMeasures) : {};
430
444
  return {
431
445
  id: o,
432
446
  parentId: s,
433
447
  label: String(r[c]),
434
448
  row: +u,
435
- value: i ? {
436
- label: S(n.formatter?.format, r[l]) ?? "-",
449
+ value: i && n && l ? {
450
+ label: x(n.formatter?.format, r[l]) ?? "-",
437
451
  value: r[l]
438
452
  } : null,
439
453
  indicator: f?.indicator ?? null,
440
- customIndicator: nt(r[l], f),
454
+ customIndicator: k(l ? r[l] : null, f),
441
455
  brush: {
442
456
  key: d,
443
457
  value: r[c]
444
458
  },
445
- _excluded: ot(e, t, r),
459
+ _excluded: lt(e, t, r),
446
460
  ...p
447
461
  };
448
462
  };
449
- function ct(e, t, n) {
450
- let r = t[0], i = e.dimensions.filter((e) => c(e)), a = {}, o = i.map((t) => [f(t.dataItem), s(e.referencedData, t.dataItem.internalKey)]), l = e.measures.filter((e) => c(e))[0], u = l ? f(l.dataItem) : null, d = e.totals?.enabled ?? !1, p = l?.slots?.find((e) => e.key === "main"), m, h, g = /* @__PURE__ */ new Set(), _ = r.groupings ? Object.keys(r.groupings) : void 0;
451
- _ && _.forEach((t) => {
452
- let n = r.groupings[t], i = r.items[+t], s = o.filter(([e]) => n[e] === 0);
453
- if (!s.length) {
463
+ function dt(e, t, n) {
464
+ let r = t[0], a = e.dimensions.filter((e) => p(e)), s = {}, c = a.map((t) => [i(t.dataItem), o(e.referencedData, t.dataItem.internalKey) ?? i(t.dataItem)]), l = e.measures.filter((e) => p(e))[0], u = l ? i(l.dataItem) : null, d = e.totals?.enabled ?? !1, f = l?.slots?.find((e) => e.key === "main"), m, h, g = /* @__PURE__ */ new Set(), _ = r.groupings, v = _ ? Object.keys(_) : void 0;
465
+ _ && v && v.forEach((t) => {
466
+ let n = _[t], i = r.items[+t], a = c.filter(([e]) => n[e] === 0);
467
+ if (!a.length) {
454
468
  m = u ? i[u] : void 0, h = i;
455
469
  return;
456
470
  }
457
- let [c, f] = s.length ? s[s.length - 1] : ["", ""], p = et(s.map((e) => tt(i, e[0]))), _ = s.slice(0, -1), v = _.length ? et(_.map((e) => tt(i, e[0]))) : d ? $e : k;
458
- s.length < o.length && g.add(p), a[p] || (a[p] = st(e, r, l, i, !!l, {
471
+ let [o, f] = a.length ? a[a.length - 1] : ["", ""], p = it(a.map((e) => at(i, e[0]))), v = a.slice(0, -1), y = v.length ? it(v.map((e) => at(i, e[0]))) : d ? rt : O;
472
+ a.length < c.length && g.add(p), s[p] || (s[p] = ut(e, r, l, i, !!l, {
459
473
  engineKey: f,
460
474
  id: p,
461
- parentId: v,
475
+ parentId: y,
462
476
  measureProp: u,
463
- prop: c,
477
+ prop: o,
464
478
  dataItemIdx: +t
465
479
  }));
466
480
  }), r.items.forEach((t, n) => {
467
- _?.includes(String(n)) || o.forEach(([i, o], s, c) => {
481
+ v?.includes(String(n)) || c.forEach(([i, a], o, c) => {
468
482
  if (t[i] === void 0) {
469
483
  console.warn(`Dimension property ${i} is missing in data item at index ${n}, skipping this dimension for this item`);
470
484
  return;
471
485
  }
472
- let f = et(c.slice(0, s + 1).map((e) => tt(t, e[0]))), p = s === 0 ? d ? $e : k : et(c.slice(0, s).map((e) => tt(t, e[0])));
473
- a[f] || (a[f] = st(e, r, l, t, s === c.length - 1 && !!l, {
474
- engineKey: o,
486
+ let f = it(c.slice(0, o + 1).map((e) => at(t, e[0]))), p = o === 0 ? d ? rt : O : it(c.slice(0, o).map((e) => at(t, e[0])));
487
+ s[f] || (s[f] = ut(e, r, l, t, o === c.length - 1 && !!l, {
488
+ engineKey: a,
475
489
  dataItemIdx: n,
476
490
  id: f,
477
491
  parentId: p,
@@ -480,42 +494,42 @@ function ct(e, t, n) {
480
494
  }));
481
495
  });
482
496
  });
483
- let v = m ?? Object.values(a).reduce((e, t) => e + (g.has(t.id) ? 0 : t.value?.value ?? 0), 0), y = h ?? r.totals, b = Object.values(a);
484
- d && b.unshift({
485
- id: $e,
486
- parentId: k,
497
+ let y = m ?? Object.values(s).reduce((e, t) => e + (g.has(t.id) ? 0 : t.value?.value ?? 0), 0), b = h ?? r.totals, S = Object.values(s);
498
+ d && S.unshift({
499
+ id: rt,
500
+ parentId: O,
487
501
  label: "Total",
488
502
  row: -1,
489
503
  value: l ? {
490
- label: S(l.formatter?.format, v) ?? "-",
491
- value: v
504
+ label: x(l.formatter?.format, y) ?? "-",
505
+ value: y
492
506
  } : null,
493
- indicator: p?.indicator ?? null,
494
- customIndicator: nt(v, p),
495
- ...l ? rt(l, y, [l], e.supportingMeasures) : {}
496
- }), b.unshift({
497
- id: k,
507
+ indicator: f?.indicator ?? null,
508
+ customIndicator: k(y, f),
509
+ ...l ? ot(l, b, [l], e.supportingMeasures) : {}
510
+ }), S.unshift({
511
+ id: O,
498
512
  parentId: null,
499
513
  label: "Dummy Root",
500
514
  row: -1,
501
515
  value: null
502
516
  });
503
- let x = Be().id((e) => e.id).parentId((e) => e.parentId)(b);
504
- return x.sort((e, t) => e.data.row - t.data.row), x.descendants().forEach((t) => {
517
+ let C = We().id((e) => e.id).parentId((e) => e.parentId)(S);
518
+ return C.sort((e, t) => (e.data.row ?? 0) - (t.data.row ?? 0)), C.descendants().forEach((t) => {
505
519
  if (t.data.id === "__total__") return;
506
520
  let r = !1;
507
- r = t.data.id in n ? n[t.data.id] === !1 : !it(t, e.treeChartSettings?.initialExpandedLevels, i.length, d), r && (t._children = t.children, t.children = null);
508
- }), x;
521
+ r = t.data.id in n ? n[t.data.id] === !1 : !st(t, e.treeChartSettings?.initialExpandedLevels, a.length, d), r && (t._children = t.children, t.children = void 0);
522
+ }), C;
509
523
  }
510
- var lt = ({ vSpec: e, data: t, nodeExpandState: n }) => {
511
- let r = e.dimensions.filter(c).length, [i, a] = (0, O.useState)(null);
512
- return (0, O.useEffect)(() => {
524
+ var ft = ({ vSpec: e, data: t, nodeExpandState: n }) => {
525
+ let r = e.dimensions.filter(p).length, [i, a] = (0, D.useState)(null);
526
+ return (0, D.useEffect)(() => {
513
527
  if (r > 0) {
514
- let r = ct(e, t, n.current);
528
+ let r = dt(e, t, n.current);
515
529
  a(r);
516
530
  return;
517
531
  }
518
- let i = at(e, t, n.current);
532
+ let i = ct(e, t, n.current);
519
533
  a(i);
520
534
  }, [
521
535
  t,
@@ -525,117 +539,117 @@ var lt = ({ vSpec: e, data: t, nodeExpandState: n }) => {
525
539
  e.treeChartSettings?.nodeExpandState,
526
540
  e.totals?.enabled
527
541
  ]), i;
528
- }, ut = {
542
+ }, pt = {
529
543
  svg: "http://www.w3.org/2000/svg",
530
544
  xhtml: "http://www.w3.org/1999/xhtml",
531
545
  xlink: "http://www.w3.org/1999/xlink",
532
546
  xml: "http://www.w3.org/XML/1998/namespace",
533
547
  xmlns: "http://www.w3.org/2000/xmlns/"
534
548
  };
535
- function dt(e) {
549
+ function mt(e) {
536
550
  var t = e += "", n = t.indexOf(":");
537
- return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), ut.hasOwnProperty(t) ? {
538
- space: ut[t],
551
+ return n >= 0 && (t = e.slice(0, n)) !== "xmlns" && (e = e.slice(n + 1)), pt.hasOwnProperty(t) ? {
552
+ space: pt[t],
539
553
  local: e
540
554
  } : e;
541
555
  }
542
- function ft(e) {
556
+ function ht(e) {
543
557
  return function() {
544
558
  var t = this.ownerDocument, n = this.namespaceURI;
545
559
  return n === "http://www.w3.org/1999/xhtml" && t.documentElement.namespaceURI === "http://www.w3.org/1999/xhtml" ? t.createElement(e) : t.createElementNS(n, e);
546
560
  };
547
561
  }
548
- function pt(e) {
562
+ function gt(e) {
549
563
  return function() {
550
564
  return this.ownerDocument.createElementNS(e.space, e.local);
551
565
  };
552
566
  }
553
- function mt(e) {
554
- var t = dt(e);
555
- return (t.local ? pt : ft)(t);
567
+ function _t(e) {
568
+ var t = mt(e);
569
+ return (t.local ? gt : ht)(t);
556
570
  }
557
- function ht() {}
558
- function gt(e) {
559
- return e == null ? ht : function() {
571
+ function vt() {}
572
+ function yt(e) {
573
+ return e == null ? vt : function() {
560
574
  return this.querySelector(e);
561
575
  };
562
576
  }
563
- function _t(e) {
564
- typeof e != "function" && (e = gt(e));
577
+ function bt(e) {
578
+ typeof e != "function" && (e = yt(e));
565
579
  for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = Array(o), c, l, u = 0; u < o; ++u) (c = a[u]) && (l = e.call(c, c.__data__, u, a)) && ("__data__" in c && (l.__data__ = c.__data__), s[u] = l);
566
580
  return new j(r, this._parents);
567
581
  }
568
- function vt(e) {
582
+ function xt(e) {
569
583
  return e == null ? [] : Array.isArray(e) ? e : Array.from(e);
570
584
  }
571
- function yt() {
585
+ function St() {
572
586
  return [];
573
587
  }
574
- function bt(e) {
575
- return e == null ? yt : function() {
588
+ function Ct(e) {
589
+ return e == null ? St : function() {
576
590
  return this.querySelectorAll(e);
577
591
  };
578
592
  }
579
- function xt(e) {
593
+ function wt(e) {
580
594
  return function() {
581
- return vt(e.apply(this, arguments));
595
+ return xt(e.apply(this, arguments));
582
596
  };
583
597
  }
584
- function St(e) {
585
- e = typeof e == "function" ? xt(e) : bt(e);
598
+ function Tt(e) {
599
+ e = typeof e == "function" ? wt(e) : Ct(e);
586
600
  for (var t = this._groups, n = t.length, r = [], i = [], a = 0; a < n; ++a) for (var o = t[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && (r.push(e.call(c, c.__data__, l, o)), i.push(c));
587
601
  return new j(r, i);
588
602
  }
589
- function Ct(e) {
603
+ function Et(e) {
590
604
  return function() {
591
605
  return this.matches(e);
592
606
  };
593
607
  }
594
- function wt(e) {
608
+ function Dt(e) {
595
609
  return function(t) {
596
610
  return t.matches(e);
597
611
  };
598
612
  }
599
- var Tt = Array.prototype.find;
600
- function Et(e) {
613
+ var Ot = Array.prototype.find;
614
+ function kt(e) {
601
615
  return function() {
602
- return Tt.call(this.children, e);
616
+ return Ot.call(this.children, e);
603
617
  };
604
618
  }
605
- function Dt() {
619
+ function At() {
606
620
  return this.firstElementChild;
607
621
  }
608
- function Ot(e) {
609
- return this.select(e == null ? Dt : Et(typeof e == "function" ? e : wt(e)));
622
+ function jt(e) {
623
+ return this.select(e == null ? At : kt(typeof e == "function" ? e : Dt(e)));
610
624
  }
611
- var kt = Array.prototype.filter;
612
- function At() {
625
+ var Mt = Array.prototype.filter;
626
+ function Nt() {
613
627
  return Array.from(this.children);
614
628
  }
615
- function jt(e) {
629
+ function Pt(e) {
616
630
  return function() {
617
- return kt.call(this.children, e);
631
+ return Mt.call(this.children, e);
618
632
  };
619
633
  }
620
- function Mt(e) {
621
- return this.selectAll(e == null ? At : jt(typeof e == "function" ? e : wt(e)));
634
+ function Ft(e) {
635
+ return this.selectAll(e == null ? Nt : Pt(typeof e == "function" ? e : Dt(e)));
622
636
  }
623
- function Nt(e) {
624
- typeof e != "function" && (e = Ct(e));
637
+ function It(e) {
638
+ typeof e != "function" && (e = Et(e));
625
639
  for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = [], c, l = 0; l < o; ++l) (c = a[l]) && e.call(c, c.__data__, l, a) && s.push(c);
626
640
  return new j(r, this._parents);
627
641
  }
628
- function Pt(e) {
642
+ function Lt(e) {
629
643
  return Array(e.length);
630
644
  }
631
- function Ft() {
632
- return new j(this._enter || this._groups.map(Pt), this._parents);
645
+ function Rt() {
646
+ return new j(this._enter || this._groups.map(Lt), this._parents);
633
647
  }
634
- function It(e, t) {
648
+ function zt(e, t) {
635
649
  this.ownerDocument = e.ownerDocument, this.namespaceURI = e.namespaceURI, this._next = null, this._parent = e, this.__data__ = t;
636
650
  }
637
- It.prototype = {
638
- constructor: It,
651
+ zt.prototype = {
652
+ constructor: zt,
639
653
  appendChild: function(e) {
640
654
  return this._parent.insertBefore(e, this._next);
641
655
  },
@@ -649,30 +663,30 @@ It.prototype = {
649
663
  return this._parent.querySelectorAll(e);
650
664
  }
651
665
  };
652
- function Lt(e) {
666
+ function Bt(e) {
653
667
  return function() {
654
668
  return e;
655
669
  };
656
670
  }
657
- function Rt(e, t, n, r, i, a) {
658
- for (var o = 0, s, c = t.length, l = a.length; o < l; ++o) (s = t[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new It(e, a[o]);
671
+ function Vt(e, t, n, r, i, a) {
672
+ for (var o = 0, s, c = t.length, l = a.length; o < l; ++o) (s = t[o]) ? (s.__data__ = a[o], r[o] = s) : n[o] = new zt(e, a[o]);
659
673
  for (; o < c; ++o) (s = t[o]) && (i[o] = s);
660
674
  }
661
- function zt(e, t, n, r, i, a, o) {
675
+ function Ht(e, t, n, r, i, a, o) {
662
676
  var s, c, l = /* @__PURE__ */ new Map(), u = t.length, d = a.length, f = Array(u), p;
663
677
  for (s = 0; s < u; ++s) (c = t[s]) && (f[s] = p = o.call(c, c.__data__, s, t) + "", l.has(p) ? i[s] = c : l.set(p, c));
664
- for (s = 0; s < d; ++s) p = o.call(e, a[s], s, a) + "", (c = l.get(p)) ? (r[s] = c, c.__data__ = a[s], l.delete(p)) : n[s] = new It(e, a[s]);
678
+ for (s = 0; s < d; ++s) p = o.call(e, a[s], s, a) + "", (c = l.get(p)) ? (r[s] = c, c.__data__ = a[s], l.delete(p)) : n[s] = new zt(e, a[s]);
665
679
  for (s = 0; s < u; ++s) (c = t[s]) && l.get(f[s]) === c && (i[s] = c);
666
680
  }
667
- function Bt(e) {
681
+ function Ut(e) {
668
682
  return e.__data__;
669
683
  }
670
- function Vt(e, t) {
671
- if (!arguments.length) return Array.from(this, Bt);
672
- var n = t ? zt : Rt, r = this._parents, i = this._groups;
673
- typeof e != "function" && (e = Lt(e));
684
+ function Wt(e, t) {
685
+ if (!arguments.length) return Array.from(this, Ut);
686
+ var n = t ? Ht : Vt, r = this._parents, i = this._groups;
687
+ typeof e != "function" && (e = Bt(e));
674
688
  for (var a = i.length, o = Array(a), s = Array(a), c = Array(a), l = 0; l < a; ++l) {
675
- var u = r[l], d = i[l], f = d.length, p = Ht(e.call(u, u && u.__data__, l, r)), m = p.length, h = s[l] = Array(m), g = o[l] = Array(m);
689
+ var u = r[l], d = i[l], f = d.length, p = Gt(e.call(u, u && u.__data__, l, r)), m = p.length, h = s[l] = Array(m), g = o[l] = Array(m);
676
690
  n(u, d, h, g, c[l] = Array(f), p, t);
677
691
  for (var _ = 0, v = 0, y, b; _ < m; ++_) if (y = h[_]) {
678
692
  for (_ >= v && (v = _ + 1); !(b = g[v]) && ++v < m;);
@@ -681,27 +695,27 @@ function Vt(e, t) {
681
695
  }
682
696
  return o = new j(o, r), o._enter = s, o._exit = c, o;
683
697
  }
684
- function Ht(e) {
698
+ function Gt(e) {
685
699
  return typeof e == "object" && "length" in e ? e : Array.from(e);
686
700
  }
687
- function Ut() {
688
- return new j(this._exit || this._groups.map(Pt), this._parents);
701
+ function Kt() {
702
+ return new j(this._exit || this._groups.map(Lt), this._parents);
689
703
  }
690
- function Wt(e, t, n) {
704
+ function qt(e, t, n) {
691
705
  var r = this.enter(), i = this, a = this.exit();
692
706
  return typeof e == "function" ? (r = e(r), r &&= r.selection()) : r = r.append(e + ""), t != null && (i = t(i), i &&= i.selection()), n == null ? a.remove() : n(a), r && i ? r.merge(i).order() : i;
693
707
  }
694
- function Gt(e) {
708
+ function Jt(e) {
695
709
  for (var t = e.selection ? e.selection() : e, n = this._groups, r = t._groups, i = n.length, a = r.length, o = Math.min(i, a), s = Array(i), c = 0; c < o; ++c) for (var l = n[c], u = r[c], d = l.length, f = s[c] = Array(d), p, m = 0; m < d; ++m) (p = l[m] || u[m]) && (f[m] = p);
696
710
  for (; c < i; ++c) s[c] = n[c];
697
711
  return new j(s, this._parents);
698
712
  }
699
- function Kt() {
713
+ function Yt() {
700
714
  for (var e = this._groups, t = -1, n = e.length; ++t < n;) for (var r = e[t], i = r.length - 1, a = r[i], o; --i >= 0;) (o = r[i]) && (a && o.compareDocumentPosition(a) ^ 4 && a.parentNode.insertBefore(o, a), a = o);
701
715
  return this;
702
716
  }
703
- function qt(e) {
704
- e ||= Jt;
717
+ function Xt(e) {
718
+ e ||= Zt;
705
719
  function t(t, n) {
706
720
  return t && n ? e(t.__data__, n.__data__) : !t - !n;
707
721
  }
@@ -711,129 +725,129 @@ function qt(e) {
711
725
  }
712
726
  return new j(i, this._parents).order();
713
727
  }
714
- function Jt(e, t) {
728
+ function Zt(e, t) {
715
729
  return e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
716
730
  }
717
- function Yt() {
731
+ function Qt() {
718
732
  var e = arguments[0];
719
733
  return arguments[0] = this, e.apply(null, arguments), this;
720
734
  }
721
- function Xt() {
735
+ function $t() {
722
736
  return Array.from(this);
723
737
  }
724
- function Zt() {
738
+ function en() {
725
739
  for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length; i < a; ++i) {
726
740
  var o = r[i];
727
741
  if (o) return o;
728
742
  }
729
743
  return null;
730
744
  }
731
- function Qt() {
745
+ function tn() {
732
746
  let e = 0;
733
747
  for (let t of this) ++e;
734
748
  return e;
735
749
  }
736
- function $t() {
750
+ function nn() {
737
751
  return !this.node();
738
752
  }
739
- function en(e) {
753
+ function rn(e) {
740
754
  for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var i = t[n], a = 0, o = i.length, s; a < o; ++a) (s = i[a]) && e.call(s, s.__data__, a, i);
741
755
  return this;
742
756
  }
743
- function tn(e) {
757
+ function an(e) {
744
758
  return function() {
745
759
  this.removeAttribute(e);
746
760
  };
747
761
  }
748
- function nn(e) {
762
+ function on(e) {
749
763
  return function() {
750
764
  this.removeAttributeNS(e.space, e.local);
751
765
  };
752
766
  }
753
- function rn(e, t) {
767
+ function sn(e, t) {
754
768
  return function() {
755
769
  this.setAttribute(e, t);
756
770
  };
757
771
  }
758
- function an(e, t) {
772
+ function cn(e, t) {
759
773
  return function() {
760
774
  this.setAttributeNS(e.space, e.local, t);
761
775
  };
762
776
  }
763
- function on(e, t) {
777
+ function ln(e, t) {
764
778
  return function() {
765
779
  var n = t.apply(this, arguments);
766
780
  n == null ? this.removeAttribute(e) : this.setAttribute(e, n);
767
781
  };
768
782
  }
769
- function sn(e, t) {
783
+ function un(e, t) {
770
784
  return function() {
771
785
  var n = t.apply(this, arguments);
772
786
  n == null ? this.removeAttributeNS(e.space, e.local) : this.setAttributeNS(e.space, e.local, n);
773
787
  };
774
788
  }
775
- function cn(e, t) {
776
- var n = dt(e);
789
+ function dn(e, t) {
790
+ var n = mt(e);
777
791
  if (arguments.length < 2) {
778
792
  var r = this.node();
779
793
  return n.local ? r.getAttributeNS(n.space, n.local) : r.getAttribute(n);
780
794
  }
781
- return this.each((t == null ? n.local ? nn : tn : typeof t == "function" ? n.local ? sn : on : n.local ? an : rn)(n, t));
795
+ return this.each((t == null ? n.local ? on : an : typeof t == "function" ? n.local ? un : ln : n.local ? cn : sn)(n, t));
782
796
  }
783
- function ln(e) {
797
+ function fn(e) {
784
798
  return e.ownerDocument && e.ownerDocument.defaultView || e.document && e || e.defaultView;
785
799
  }
786
- function un(e) {
800
+ function pn(e) {
787
801
  return function() {
788
802
  this.style.removeProperty(e);
789
803
  };
790
804
  }
791
- function dn(e, t, n) {
805
+ function mn(e, t, n) {
792
806
  return function() {
793
807
  this.style.setProperty(e, t, n);
794
808
  };
795
809
  }
796
- function fn(e, t, n) {
810
+ function hn(e, t, n) {
797
811
  return function() {
798
812
  var r = t.apply(this, arguments);
799
813
  r == null ? this.style.removeProperty(e) : this.style.setProperty(e, r, n);
800
814
  };
801
815
  }
802
- function pn(e, t, n) {
803
- return arguments.length > 1 ? this.each((t == null ? un : typeof t == "function" ? fn : dn)(e, t, n ?? "")) : A(this.node(), e);
816
+ function gn(e, t, n) {
817
+ return arguments.length > 1 ? this.each((t == null ? pn : typeof t == "function" ? hn : mn)(e, t, n ?? "")) : A(this.node(), e);
804
818
  }
805
819
  function A(e, t) {
806
- return e.style.getPropertyValue(t) || ln(e).getComputedStyle(e, null).getPropertyValue(t);
820
+ return e.style.getPropertyValue(t) || fn(e).getComputedStyle(e, null).getPropertyValue(t);
807
821
  }
808
- function mn(e) {
822
+ function _n(e) {
809
823
  return function() {
810
824
  delete this[e];
811
825
  };
812
826
  }
813
- function hn(e, t) {
827
+ function vn(e, t) {
814
828
  return function() {
815
829
  this[e] = t;
816
830
  };
817
831
  }
818
- function gn(e, t) {
832
+ function yn(e, t) {
819
833
  return function() {
820
834
  var n = t.apply(this, arguments);
821
835
  n == null ? delete this[e] : this[e] = n;
822
836
  };
823
837
  }
824
- function _n(e, t) {
825
- return arguments.length > 1 ? this.each((t == null ? mn : typeof t == "function" ? gn : hn)(e, t)) : this.node()[e];
838
+ function bn(e, t) {
839
+ return arguments.length > 1 ? this.each((t == null ? _n : typeof t == "function" ? yn : vn)(e, t)) : this.node()[e];
826
840
  }
827
- function vn(e) {
841
+ function xn(e) {
828
842
  return e.trim().split(/^|\s+/);
829
843
  }
830
- function yn(e) {
831
- return e.classList || new bn(e);
844
+ function Sn(e) {
845
+ return e.classList || new Cn(e);
832
846
  }
833
- function bn(e) {
834
- this._node = e, this._names = vn(e.getAttribute("class") || "");
847
+ function Cn(e) {
848
+ this._node = e, this._names = xn(e.getAttribute("class") || "");
835
849
  }
836
- bn.prototype = {
850
+ Cn.prototype = {
837
851
  add: function(e) {
838
852
  this._names.indexOf(e) < 0 && (this._names.push(e), this._node.setAttribute("class", this._names.join(" ")));
839
853
  },
@@ -845,123 +859,123 @@ bn.prototype = {
845
859
  return this._names.indexOf(e) >= 0;
846
860
  }
847
861
  };
848
- function xn(e, t) {
849
- for (var n = yn(e), r = -1, i = t.length; ++r < i;) n.add(t[r]);
862
+ function wn(e, t) {
863
+ for (var n = Sn(e), r = -1, i = t.length; ++r < i;) n.add(t[r]);
850
864
  }
851
- function Sn(e, t) {
852
- for (var n = yn(e), r = -1, i = t.length; ++r < i;) n.remove(t[r]);
865
+ function Tn(e, t) {
866
+ for (var n = Sn(e), r = -1, i = t.length; ++r < i;) n.remove(t[r]);
853
867
  }
854
- function Cn(e) {
868
+ function En(e) {
855
869
  return function() {
856
- xn(this, e);
870
+ wn(this, e);
857
871
  };
858
872
  }
859
- function wn(e) {
873
+ function Dn(e) {
860
874
  return function() {
861
- Sn(this, e);
875
+ Tn(this, e);
862
876
  };
863
877
  }
864
- function Tn(e, t) {
878
+ function On(e, t) {
865
879
  return function() {
866
- (t.apply(this, arguments) ? xn : Sn)(this, e);
880
+ (t.apply(this, arguments) ? wn : Tn)(this, e);
867
881
  };
868
882
  }
869
- function En(e, t) {
870
- var n = vn(e + "");
883
+ function kn(e, t) {
884
+ var n = xn(e + "");
871
885
  if (arguments.length < 2) {
872
- for (var r = yn(this.node()), i = -1, a = n.length; ++i < a;) if (!r.contains(n[i])) return !1;
886
+ for (var r = Sn(this.node()), i = -1, a = n.length; ++i < a;) if (!r.contains(n[i])) return !1;
873
887
  return !0;
874
888
  }
875
- return this.each((typeof t == "function" ? Tn : t ? Cn : wn)(n, t));
889
+ return this.each((typeof t == "function" ? On : t ? En : Dn)(n, t));
876
890
  }
877
- function Dn() {
891
+ function An() {
878
892
  this.textContent = "";
879
893
  }
880
- function On(e) {
894
+ function jn(e) {
881
895
  return function() {
882
896
  this.textContent = e;
883
897
  };
884
898
  }
885
- function kn(e) {
899
+ function Mn(e) {
886
900
  return function() {
887
901
  var t = e.apply(this, arguments);
888
902
  this.textContent = t ?? "";
889
903
  };
890
904
  }
891
- function An(e) {
892
- return arguments.length ? this.each(e == null ? Dn : (typeof e == "function" ? kn : On)(e)) : this.node().textContent;
905
+ function Nn(e) {
906
+ return arguments.length ? this.each(e == null ? An : (typeof e == "function" ? Mn : jn)(e)) : this.node().textContent;
893
907
  }
894
- function jn() {
908
+ function Pn() {
895
909
  this.innerHTML = "";
896
910
  }
897
- function Mn(e) {
911
+ function Fn(e) {
898
912
  return function() {
899
913
  this.innerHTML = e;
900
914
  };
901
915
  }
902
- function Nn(e) {
916
+ function In(e) {
903
917
  return function() {
904
918
  var t = e.apply(this, arguments);
905
919
  this.innerHTML = t ?? "";
906
920
  };
907
921
  }
908
- function Pn(e) {
909
- return arguments.length ? this.each(e == null ? jn : (typeof e == "function" ? Nn : Mn)(e)) : this.node().innerHTML;
922
+ function Ln(e) {
923
+ return arguments.length ? this.each(e == null ? Pn : (typeof e == "function" ? In : Fn)(e)) : this.node().innerHTML;
910
924
  }
911
- function Fn() {
925
+ function Rn() {
912
926
  this.nextSibling && this.parentNode.appendChild(this);
913
927
  }
914
- function In() {
915
- return this.each(Fn);
928
+ function zn() {
929
+ return this.each(Rn);
916
930
  }
917
- function Ln() {
931
+ function Bn() {
918
932
  this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
919
933
  }
920
- function Rn() {
921
- return this.each(Ln);
934
+ function Vn() {
935
+ return this.each(Bn);
922
936
  }
923
- function zn(e) {
924
- var t = typeof e == "function" ? e : mt(e);
937
+ function Hn(e) {
938
+ var t = typeof e == "function" ? e : _t(e);
925
939
  return this.select(function() {
926
940
  return this.appendChild(t.apply(this, arguments));
927
941
  });
928
942
  }
929
- function Bn() {
943
+ function Un() {
930
944
  return null;
931
945
  }
932
- function Vn(e, t) {
933
- var n = typeof e == "function" ? e : mt(e), r = t == null ? Bn : typeof t == "function" ? t : gt(t);
946
+ function Wn(e, t) {
947
+ var n = typeof e == "function" ? e : _t(e), r = t == null ? Un : typeof t == "function" ? t : yt(t);
934
948
  return this.select(function() {
935
949
  return this.insertBefore(n.apply(this, arguments), r.apply(this, arguments) || null);
936
950
  });
937
951
  }
938
- function Hn() {
952
+ function Gn() {
939
953
  var e = this.parentNode;
940
954
  e && e.removeChild(this);
941
955
  }
942
- function Un() {
943
- return this.each(Hn);
956
+ function Kn() {
957
+ return this.each(Gn);
944
958
  }
945
- function Wn() {
959
+ function qn() {
946
960
  var e = this.cloneNode(!1), t = this.parentNode;
947
961
  return t ? t.insertBefore(e, this.nextSibling) : e;
948
962
  }
949
- function Gn() {
963
+ function Jn() {
950
964
  var e = this.cloneNode(!0), t = this.parentNode;
951
965
  return t ? t.insertBefore(e, this.nextSibling) : e;
952
966
  }
953
- function Kn(e) {
954
- return this.select(e ? Gn : Wn);
967
+ function Yn(e) {
968
+ return this.select(e ? Jn : qn);
955
969
  }
956
- function qn(e) {
970
+ function Xn(e) {
957
971
  return arguments.length ? this.property("__data__", e) : this.node().__data__;
958
972
  }
959
- function Jn(e) {
973
+ function Zn(e) {
960
974
  return function(t) {
961
975
  e.call(this, t, this.__data__);
962
976
  };
963
977
  }
964
- function Yn(e) {
978
+ function Qn(e) {
965
979
  return e.trim().split(/^|\s+/).map(function(e) {
966
980
  var t = "", n = e.indexOf(".");
967
981
  return n >= 0 && (t = e.slice(n + 1), e = e.slice(0, n)), {
@@ -970,7 +984,7 @@ function Yn(e) {
970
984
  };
971
985
  });
972
986
  }
973
- function Xn(e) {
987
+ function $n(e) {
974
988
  return function() {
975
989
  var t = this.__on;
976
990
  if (t) {
@@ -979,9 +993,9 @@ function Xn(e) {
979
993
  }
980
994
  };
981
995
  }
982
- function Zn(e, t, n) {
996
+ function er(e, t, n) {
983
997
  return function() {
984
- var r = this.__on, i, a = Jn(t);
998
+ var r = this.__on, i, a = Zn(t);
985
999
  if (r) {
986
1000
  for (var o = 0, s = r.length; o < s; ++o) if ((i = r[o]).type === e.type && i.name === e.name) {
987
1001
  this.removeEventListener(i.type, i.listener, i.options), this.addEventListener(i.type, i.listener = a, i.options = n), i.value = t;
@@ -997,8 +1011,8 @@ function Zn(e, t, n) {
997
1011
  }, r ? r.push(i) : this.__on = [i];
998
1012
  };
999
1013
  }
1000
- function Qn(e, t, n) {
1001
- var r = Yn(e + ""), i, a = r.length, o;
1014
+ function tr(e, t, n) {
1015
+ var r = Qn(e + ""), i, a = r.length, o;
1002
1016
  if (arguments.length < 2) {
1003
1017
  var s = this.node().__on;
1004
1018
  if (s) {
@@ -1006,87 +1020,87 @@ function Qn(e, t, n) {
1006
1020
  }
1007
1021
  return;
1008
1022
  }
1009
- for (s = t ? Zn : Xn, i = 0; i < a; ++i) this.each(s(r[i], t, n));
1023
+ for (s = t ? er : $n, i = 0; i < a; ++i) this.each(s(r[i], t, n));
1010
1024
  return this;
1011
1025
  }
1012
- function $n(e, t, n) {
1013
- var r = ln(e), i = r.CustomEvent;
1026
+ function nr(e, t, n) {
1027
+ var r = fn(e), i = r.CustomEvent;
1014
1028
  typeof i == "function" ? i = new i(t, n) : (i = r.document.createEvent("Event"), n ? (i.initEvent(t, n.bubbles, n.cancelable), i.detail = n.detail) : i.initEvent(t, !1, !1)), e.dispatchEvent(i);
1015
1029
  }
1016
- function er(e, t) {
1030
+ function rr(e, t) {
1017
1031
  return function() {
1018
- return $n(this, e, t);
1032
+ return nr(this, e, t);
1019
1033
  };
1020
1034
  }
1021
- function tr(e, t) {
1035
+ function ir(e, t) {
1022
1036
  return function() {
1023
- return $n(this, e, t.apply(this, arguments));
1037
+ return nr(this, e, t.apply(this, arguments));
1024
1038
  };
1025
1039
  }
1026
- function nr(e, t) {
1027
- return this.each((typeof t == "function" ? tr : er)(e, t));
1040
+ function ar(e, t) {
1041
+ return this.each((typeof t == "function" ? ir : rr)(e, t));
1028
1042
  }
1029
- function* rr() {
1043
+ function* or() {
1030
1044
  for (var e = this._groups, t = 0, n = e.length; t < n; ++t) for (var r = e[t], i = 0, a = r.length, o; i < a; ++i) (o = r[i]) && (yield o);
1031
1045
  }
1032
- var ir = [null];
1046
+ var sr = [null];
1033
1047
  function j(e, t) {
1034
1048
  this._groups = e, this._parents = t;
1035
1049
  }
1036
1050
  function M() {
1037
- return new j([[document.documentElement]], ir);
1051
+ return new j([[document.documentElement]], sr);
1038
1052
  }
1039
- function ar() {
1053
+ function cr() {
1040
1054
  return this;
1041
1055
  }
1042
1056
  j.prototype = M.prototype = {
1043
1057
  constructor: j,
1044
- select: _t,
1045
- selectAll: St,
1046
- selectChild: Ot,
1047
- selectChildren: Mt,
1048
- filter: Nt,
1049
- data: Vt,
1050
- enter: Ft,
1051
- exit: Ut,
1052
- join: Wt,
1053
- merge: Gt,
1054
- selection: ar,
1055
- order: Kt,
1056
- sort: qt,
1057
- call: Yt,
1058
- nodes: Xt,
1059
- node: Zt,
1060
- size: Qt,
1061
- empty: $t,
1062
- each: en,
1063
- attr: cn,
1064
- style: pn,
1065
- property: _n,
1066
- classed: En,
1067
- text: An,
1068
- html: Pn,
1069
- raise: In,
1070
- lower: Rn,
1071
- append: zn,
1072
- insert: Vn,
1073
- remove: Un,
1074
- clone: Kn,
1075
- datum: qn,
1076
- on: Qn,
1077
- dispatch: nr,
1078
- [Symbol.iterator]: rr
1058
+ select: bt,
1059
+ selectAll: Tt,
1060
+ selectChild: jt,
1061
+ selectChildren: Ft,
1062
+ filter: It,
1063
+ data: Wt,
1064
+ enter: Rt,
1065
+ exit: Kt,
1066
+ join: qt,
1067
+ merge: Jt,
1068
+ selection: cr,
1069
+ order: Yt,
1070
+ sort: Xt,
1071
+ call: Qt,
1072
+ nodes: $t,
1073
+ node: en,
1074
+ size: tn,
1075
+ empty: nn,
1076
+ each: rn,
1077
+ attr: dn,
1078
+ style: gn,
1079
+ property: bn,
1080
+ classed: kn,
1081
+ text: Nn,
1082
+ html: Ln,
1083
+ raise: zn,
1084
+ lower: Vn,
1085
+ append: Hn,
1086
+ insert: Wn,
1087
+ remove: Kn,
1088
+ clone: Yn,
1089
+ datum: Xn,
1090
+ on: tr,
1091
+ dispatch: ar,
1092
+ [Symbol.iterator]: or
1079
1093
  };
1080
1094
  function N(e) {
1081
- return typeof e == "string" ? new j([[document.querySelector(e)]], [document.documentElement]) : new j([[e]], ir);
1095
+ return typeof e == "string" ? new j([[document.querySelector(e)]], [document.documentElement]) : new j([[e]], sr);
1082
1096
  }
1083
- function or(e) {
1097
+ function lr(e) {
1084
1098
  let t;
1085
1099
  for (; t = e.sourceEvent;) e = t;
1086
1100
  return e;
1087
1101
  }
1088
1102
  function P(e, t) {
1089
- if (e = or(e), t === void 0 && (t = e.currentTarget), t) {
1103
+ if (e = lr(e), t === void 0 && (t = e.currentTarget), t) {
1090
1104
  var n = t.ownerSVGElement || t;
1091
1105
  if (n.createSVGPoint) {
1092
1106
  var r = n.createSVGPoint();
@@ -1099,62 +1113,62 @@ function P(e, t) {
1099
1113
  }
1100
1114
  return [e.pageX, e.pageY];
1101
1115
  }
1102
- function sr(e) {
1103
- return typeof e == "string" ? new j([document.querySelectorAll(e)], [document.documentElement]) : new j([vt(e)], ir);
1116
+ function ur(e) {
1117
+ return typeof e == "string" ? new j([document.querySelectorAll(e)], [document.documentElement]) : new j([xt(e)], sr);
1104
1118
  }
1105
- var cr = /* @__PURE__ */ e(ve()), F = d[p.KPIChange], I = F.slots, lr = "#577f56", ur = "#9e4d53", L = (e) => typeof e == "number" && Number.isFinite(e), dr = (e, t) => {
1106
- let n = new cr.default(e);
1107
- return (new cr.default(t).isLight() ? n.lighten(.5).alpha(.5) : n.darken(.5).alpha(.5)).rgb().string();
1108
- }, fr = (e, t) => {
1119
+ var dr = /* @__PURE__ */ e(xe()), F = r[d.KPIChange], I = F.slots, fr = "#577f56", pr = "#9e4d53", L = (e) => typeof e == "number" && Number.isFinite(e), mr = (e, t) => {
1120
+ let n = new dr.default(e);
1121
+ return (new dr.default(t).isLight() ? n.lighten(.5).alpha(.5) : n.darken(.5).alpha(.5)).rgb().string();
1122
+ }, hr = (e, t) => {
1109
1123
  if (!e.enabled) return "";
1110
1124
  let n = L(e.value) ? e.value : null, r = n === null ? "" : n < 0 ? "negative" : "positive", i = "", a = "";
1111
1125
  if (e.indicator === "inverse") r = r === "negative" ? "positive" : "negative";
1112
1126
  else if (e.indicator === "none") r = "";
1113
1127
  else if (e.indicator === "custom") {
1114
1128
  r = "";
1115
- let n = e.customIndicator?.color ? dr(e.customIndicator.color, t) : "inherit";
1116
- i = `color: ${e.customIndicator?.color ?? "inherit"}; background-color: ${n};`, e.customIndicator?.icon && (a = `<span class="footer-icon">${y.sanitize(e.customIndicator.icon)}</span>`);
1129
+ let n = e.customIndicator?.color ? mr(e.customIndicator.color, t) : "inherit";
1130
+ i = `color: ${e.customIndicator?.color ?? "inherit"}; background-color: ${n};`, e.customIndicator?.icon && (a = `<span class="footer-icon">${g.sanitize(e.customIndicator.icon)}</span>`);
1117
1131
  }
1118
- return `<div class="footer ${r}" style="${i}"><span class="footer-label">${y.sanitize(e.label)}</span>${a}</div>`;
1119
- }, pr = (e, t) => {
1132
+ return `<div class="footer ${r}" style="${i}"><span class="footer-label">${g.sanitize(e.label ?? "-")}</span>${a}</div>`;
1133
+ }, gr = (e, t) => {
1120
1134
  if (!e.enabled) return "";
1121
1135
  let n = e.indicator, r = L(e.value) ? e.value : null, i = r === null ? "neutral" : r < 0 ? "negative" : "positive", a = "", o = r === null ? "" : r < 0 ? "arrow_downward" : "arrow_upward";
1122
1136
  if (n === "inverse") i = i === "negative" ? "positive" : "negative";
1123
1137
  else if (n === "none") i = "", o = void 0;
1124
1138
  else if (n === "custom") {
1125
1139
  i = "";
1126
- let n = e.customIndicator?.color ? dr(e.customIndicator.color, t) : "inherit";
1140
+ let n = e.customIndicator?.color ? mr(e.customIndicator.color, t) : "inherit";
1127
1141
  a = `color: ${e.customIndicator?.color ?? "inherit"}; background-color: ${n};`, o = e.customIndicator?.icon;
1128
1142
  }
1129
- let s = o ? `<span class="pill-icon">${y.sanitize(o)}</span>` : "";
1130
- return `<div class="pill ${i}" style="${a}"><span class="pill-label">${y.sanitize(e.label)}</span>${s}</div>`;
1131
- }, mr = (e, t) => {
1143
+ let s = o ? `<span class="pill-icon">${g.sanitize(o)}</span>` : "";
1144
+ return `<div class="pill ${i}" style="${a}"><span class="pill-label">${g.sanitize(e.label ?? "-")}</span>${s}</div>`;
1145
+ }, _r = (e, t) => {
1132
1146
  let n = e.value ?? {
1133
1147
  label: "-",
1134
1148
  value: null,
1135
1149
  enabled: !1
1136
1150
  }, r = "", i = "";
1137
- return e.indicator === "custom" && (e.customIndicator?.color && (r = `color: ${e.customIndicator.color};`), e.customIndicator?.icon && (i = `<span class="value-icon">${y.sanitize(e.customIndicator.icon)}</span>`)), `<div class="value ${t ? "value-space" : ""}" style="${r}"><span class="value-label">${y.sanitize(n.label)}</span>${i}</div>`;
1138
- }, hr = (e, t) => {
1139
- let n = e.data.diff ?? I.diff.defaults, r = e.data.change ?? I.change.defaults, i = t.config.nodeDefaultBackground ?? "#ffffff", a = mr(e.data, !r.enabled), o = fr(n, i), s = pr(r, i), c = [];
1140
- return e.data._upToTheRootHighlighted && c.push("node-highlight"), `
1141
- <div class="node-content layout-a ${c.join(" ")}">
1142
- <div class="label">${y.sanitize(e.data.label)}</div>
1151
+ return e.indicator === "custom" && (e.customIndicator?.color && (r = `color: ${e.customIndicator.color};`), e.customIndicator?.icon && (i = `<span class="value-icon">${g.sanitize(e.customIndicator.icon)}</span>`)), `<div class="value ${t ? "value-space" : ""}" style="${r}"><span class="value-label">${g.sanitize(n.label)}</span>${i}</div>`;
1152
+ }, vr = (e, t) => {
1153
+ let n = e.data.diff ?? a.diff.defaults, r = e.data.change ?? a.change.defaults, i = t.config.nodeDefaultBackground ?? "#ffffff", o = _r(e.data, !r.enabled), s = hr(n, i), c = gr(r, i), l = [];
1154
+ return e.data._upToTheRootHighlighted && l.push("node-highlight"), `
1155
+ <div class="node-content layout-a ${l.join(" ")}">
1156
+ <div class="label">${g.sanitize(e.data.label)}</div>
1143
1157
  <div class="flex-row">
1144
- ${a}
1145
- ${s}
1158
+ ${o}
1159
+ ${c}
1146
1160
  </div>
1147
- ${o}
1161
+ ${s}
1148
1162
 
1149
1163
  </div>
1150
1164
  `;
1151
- }, gr = ({ node: e, config: t }) => e.data?.id === "__root__" ? null : `<div class="button-content"> ${{
1165
+ }, yr = ({ node: e, config: t }) => e.data?.id === "__root__" ? null : `<div class="button-content"> ${{
1152
1166
  left: (e) => e ? "◀" : "▶",
1153
1167
  bottom: (e) => e ? "▼" : "▲",
1154
1168
  right: (e) => e ? "▶" : "◀",
1155
1169
  top: (e) => e ? "▲" : "▼"
1156
1170
  }[t.layout](e.children)} </div>`;
1157
- function _r(e) {
1171
+ function br(e) {
1158
1172
  if (e.data._upToTheRootHighlighted) {
1159
1173
  N(this).style("stroke-width", "var(--border-hover-width)").style("stroke", "var(--border-hover-color)");
1160
1174
  return;
@@ -1163,26 +1177,30 @@ function _r(e) {
1163
1177
  N(this).style("stroke-width", null).style("stroke", null);
1164
1178
  return;
1165
1179
  }
1166
- let t = (L(e.data.diff?.value) ? e.data.diff.value : null) ?? (L(I.diff.defaults.value) ? I.diff.defaults.value : 0), n = e.parent?.children?.flatMap((t) => t.id === e.id || !t.data.diff?.enabled || !L(t.data.diff?.value) ? [] : [Math.abs(t.data.diff.value)]) ?? [], r = n.length ? Math.max(...n) : 0, i = Math.abs(t) > r, a = t < 0, o = a ? ur : lr, s = e.data.diff?.indicator;
1167
- s === "inverse" ? o = a ? lr : ur : s === "none" ? o = "var(--link-color)" : s === "custom" && (o = e.data.diff?.customIndicator?.color ?? "var(--link-color)");
1168
- let c = i ? 2 : 1;
1169
- N(this).style("stroke", o).style("stroke-width", c);
1180
+ let t = (L(e.data.diff?.value) ? e.data.diff.value : null) ?? (L(a.diff.defaults.value) ? a.diff.defaults.value : 0), n = e.parent?.children?.flatMap((t) => t.id === e.id || !t.data.diff?.enabled || !L(t.data.diff?.value) ? [] : [Math.abs(t.data.diff.value)]) ?? [], r = n.length ? Math.max(...n) : 0, i = Math.abs(t) > r, o = t < 0, s = o ? pr : fr, c = e.data.diff?.indicator;
1181
+ c === "inverse" ? s = o ? fr : pr : c === "none" ? s = "var(--link-color)" : c === "custom" && (s = e.data.diff?.customIndicator?.color ?? "var(--link-color)");
1182
+ let l = i ? 2 : 1;
1183
+ N(this).style("stroke", s).style("stroke-width", l);
1170
1184
  }
1171
- var vr = (e, t) => {
1185
+ var xr = (e, t) => {
1172
1186
  let n = {
1173
1187
  ...F.labelStyle,
1174
- ...t.treeChartSettings.nodeLayout?.labelStyle
1188
+ ...t.treeChartSettings.nodeLayout?.labelStyle,
1189
+ fontSize: t.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? F.labelStyle?.fontSize
1175
1190
  }, r = {
1176
1191
  ...F.valueStyle,
1177
- ...t.treeChartSettings.nodeLayout?.valueStyle
1192
+ ...t.treeChartSettings.nodeLayout?.valueStyle,
1193
+ fontSize: t.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? F.valueStyle?.fontSize
1178
1194
  }, i = {
1179
- ...I.change.styling,
1180
- ...I.change.styling.fontStyle,
1181
- ...t.treeChartSettings.nodeLayout?.slots?.change
1195
+ ...I.change?.styling,
1196
+ ...I.change?.styling?.fontStyle,
1197
+ ...t.treeChartSettings.nodeLayout?.slots?.change,
1198
+ fontSize: t.treeChartSettings.nodeLayout?.slots?.change?.fontSize ?? I.change?.styling?.fontSize
1182
1199
  }, a = {
1183
- ...I.diff.styling,
1184
- ...I.diff.styling.fontStyle,
1185
- ...t.treeChartSettings.nodeLayout?.slots?.diff
1200
+ ...I.diff?.styling,
1201
+ ...I.diff?.styling?.fontStyle,
1202
+ ...t.treeChartSettings.nodeLayout?.slots?.diff,
1203
+ fontSize: t.treeChartSettings.nodeLayout?.slots?.diff?.fontSize ?? I.diff?.styling?.fontSize
1186
1204
  };
1187
1205
  return `
1188
1206
  #${e} {
@@ -1310,63 +1328,68 @@ var vr = (e, t) => {
1310
1328
  }
1311
1329
 
1312
1330
  .positive {
1313
- color: ${lr};
1331
+ color: ${fr};
1314
1332
  background-color: #e4fae8;
1315
1333
  }
1316
1334
 
1317
1335
  .negative {
1318
- color: ${ur};
1336
+ color: ${pr};
1319
1337
  background-color: #fcecec;
1320
1338
  }
1321
1339
  }
1322
1340
  }`;
1323
- }, yr = {
1341
+ }, Sr = {
1324
1342
  name: "KPI Change",
1325
1343
  ...F,
1326
- getNodeContent: hr,
1327
- getButtonContent: gr,
1328
- linkUpdate: _r,
1329
- getCSS: vr,
1344
+ getNodeContent: vr,
1345
+ getButtonContent: yr,
1346
+ linkUpdate: br,
1347
+ getCSS: xr,
1330
1348
  width: 180,
1331
1349
  sizes: (e) => {
1332
1350
  let t = {
1333
- ...I.diff.styling,
1334
- ...I.diff.styling.fontStyle,
1335
- ...e.treeChartSettings.nodeLayout?.slots?.diff
1351
+ ...I.diff?.styling,
1352
+ ...I.diff?.styling?.fontStyle,
1353
+ ...e.treeChartSettings.nodeLayout?.slots?.diff,
1354
+ fontSize: e.treeChartSettings.nodeLayout?.slots?.diff?.fontSize ?? I.diff?.styling?.fontSize
1336
1355
  }, n = {
1337
1356
  ...F.labelStyle,
1338
- ...e.treeChartSettings.nodeLayout?.labelStyle
1357
+ ...e.treeChartSettings.nodeLayout?.labelStyle,
1358
+ fontSize: e.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? F.labelStyle?.fontSize
1339
1359
  }, r = {
1340
1360
  ...F.valueStyle,
1341
- ...e.treeChartSettings.nodeLayout?.valueStyle
1361
+ ...e.treeChartSettings.nodeLayout?.valueStyle,
1362
+ fontSize: e.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? F.valueStyle?.fontSize
1342
1363
  };
1343
1364
  return {
1344
- label: Math.ceil(E(n.fontSize)) + 8,
1345
- value: Math.ceil(E(r.fontSize)) + 8,
1346
- diff: Math.ceil(E(t.fontSize)) + 16
1365
+ label: Math.ceil(T(n.fontSize)) + 8,
1366
+ value: Math.ceil(T(r.fontSize)) + 8,
1367
+ diff: Math.ceil(T(t.fontSize)) + 16
1347
1368
  };
1348
1369
  },
1349
1370
  height: (e, t) => {
1350
1371
  let n = 20;
1351
- return n += t?.label ?? 0, n += t?.value ?? 0, (e.data.diff ?? I.diff.defaults)?.enabled && (n += t?.diff ?? 0), n;
1372
+ return n += t?.label ?? 0, n += t?.value ?? 0, (e.data.diff ?? a.diff.defaults)?.enabled && (n += t?.diff ?? 0), n;
1352
1373
  }
1353
- }, R = d[p.Basic], br = (e) => {
1374
+ }, R = r[d.Basic], Cr = (e) => {
1354
1375
  if (e.id === "__root__") return null;
1355
1376
  let t = "", n = "";
1356
- e.data.indicator === "custom" && (e.data.customIndicator?.color && (t = `color: ${e.data.customIndicator.color};`), e.data.customIndicator?.icon && (n = `<span class="value-icon">${y.sanitize(e.data.customIndicator.icon)}</span>`));
1357
- let r = e.data.value ? `<div class="value" style="${t}"><span class="value-label">${y.sanitize(e.data.value.label)}</span>${n}</div>` : "", i = [];
1377
+ e.data.indicator === "custom" && (e.data.customIndicator?.color && (t = `color: ${e.data.customIndicator.color};`), e.data.customIndicator?.icon && (n = `<span class="value-icon">${g.sanitize(e.data.customIndicator.icon)}</span>`));
1378
+ let r = e.data.value ? `<div class="value" style="${t}"><span class="value-label">${g.sanitize(e.data.value.label)}</span>${n}</div>` : "", i = [];
1358
1379
  return e.data._upToTheRootHighlighted && i.push("node-highlight"), `
1359
1380
  <div class="node-content layout-b ${i.join(" ")}">
1360
- <div class="label">${y.sanitize(e.data.label)}</div>
1381
+ <div class="label">${g.sanitize(e.data.label)}</div>
1361
1382
  ${r}
1362
1383
  </div>`;
1363
- }, xr = (e, t) => {
1384
+ }, wr = (e, t) => {
1364
1385
  let n = {
1365
1386
  ...R.labelStyle,
1366
- ...t.treeChartSettings.nodeLayout?.labelStyle
1387
+ ...t.treeChartSettings.nodeLayout?.labelStyle,
1388
+ fontSize: t.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? R.labelStyle?.fontSize
1367
1389
  }, r = {
1368
1390
  ...R.valueStyle,
1369
- ...t.treeChartSettings.nodeLayout?.valueStyle
1391
+ ...t.treeChartSettings.nodeLayout?.valueStyle,
1392
+ fontSize: t.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? R.valueStyle?.fontSize
1370
1393
  };
1371
1394
  return `
1372
1395
  #${e} {
@@ -1410,54 +1433,56 @@ var vr = (e, t) => {
1410
1433
  }
1411
1434
  }
1412
1435
  }`;
1413
- }, Sr = {
1436
+ }, Tr = {
1414
1437
  name: "Basic",
1415
1438
  ...R,
1416
- getNodeContent: br,
1417
- getCSS: xr,
1439
+ getNodeContent: Cr,
1440
+ getCSS: wr,
1418
1441
  width: 140,
1419
1442
  sizes: (e) => {
1420
1443
  let t = {
1421
1444
  ...R.labelStyle,
1422
- ...e.treeChartSettings.nodeLayout?.labelStyle
1445
+ ...e.treeChartSettings.nodeLayout?.labelStyle,
1446
+ fontSize: e.treeChartSettings.nodeLayout?.labelStyle?.fontSize ?? R.labelStyle?.fontSize
1423
1447
  }, n = {
1424
1448
  ...R.valueStyle,
1425
- ...e.treeChartSettings.nodeLayout?.valueStyle
1449
+ ...e.treeChartSettings.nodeLayout?.valueStyle,
1450
+ fontSize: e.treeChartSettings.nodeLayout?.valueStyle?.fontSize ?? R.valueStyle?.fontSize
1426
1451
  };
1427
1452
  return {
1428
- label: E(t.fontSize) + 8,
1429
- value: E(n.fontSize) + 8
1453
+ label: T(t.fontSize) + 8,
1454
+ value: T(n.fontSize) + 8
1430
1455
  };
1431
1456
  },
1432
1457
  height: (e, t) => {
1433
- let n = 8 + t.label;
1434
- return e.data.value && (n += 8 + t.value), n;
1458
+ let n = 8 + (t?.label ?? 0);
1459
+ return e.data.value && (n += 8 + (t?.value ?? 0)), n;
1435
1460
  }
1436
- }, Cr = {
1437
- [p.KPIChange]: yr,
1438
- [p.Basic]: Sr
1439
- }, wr = { passive: !1 }, z = {
1461
+ }, Er = {
1462
+ [d.KPIChange]: Sr,
1463
+ [d.Basic]: Tr
1464
+ }, Dr = { passive: !1 }, z = {
1440
1465
  capture: !0,
1441
1466
  passive: !1
1442
1467
  };
1443
- function Tr(e) {
1468
+ function Or(e) {
1444
1469
  e.stopImmediatePropagation();
1445
1470
  }
1446
1471
  function B(e) {
1447
1472
  e.preventDefault(), e.stopImmediatePropagation();
1448
1473
  }
1449
- function Er(e) {
1474
+ function kr(e) {
1450
1475
  var t = e.document.documentElement, n = N(e).on("dragstart.drag", B, z);
1451
1476
  "onselectstart" in t ? n.on("selectstart.drag", B, z) : (t.__noselect = t.style.MozUserSelect, t.style.MozUserSelect = "none");
1452
1477
  }
1453
- function Dr(e, t) {
1478
+ function Ar(e, t) {
1454
1479
  var n = e.document.documentElement, r = N(e).on("dragstart.drag", null);
1455
1480
  t && (r.on("click.drag", B, z), setTimeout(function() {
1456
1481
  r.on("click.drag", null);
1457
1482
  }, 0)), "onselectstart" in n ? r.on("selectstart.drag", null) : (n.style.MozUserSelect = n.__noselect, delete n.__noselect);
1458
1483
  }
1459
- var Or = (e) => () => e;
1460
- function kr(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
1484
+ var V = (e) => () => e;
1485
+ function jr(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a, x: o, y: s, dx: c, dy: l, dispatch: u }) {
1461
1486
  Object.defineProperties(this, {
1462
1487
  type: {
1463
1488
  value: e,
@@ -1512,34 +1537,34 @@ function kr(e, { sourceEvent: t, subject: n, target: r, identifier: i, active: a
1512
1537
  _: { value: u }
1513
1538
  });
1514
1539
  }
1515
- kr.prototype.on = function() {
1540
+ jr.prototype.on = function() {
1516
1541
  var e = this._.on.apply(this._, arguments);
1517
1542
  return e === this._ ? this : e;
1518
- }, Ne();
1519
- function Ar(e) {
1543
+ }, Ie();
1544
+ function Mr(e) {
1520
1545
  return !e.ctrlKey && !e.button;
1521
1546
  }
1522
- function jr() {
1547
+ function Nr() {
1523
1548
  return this.parentNode;
1524
1549
  }
1525
- function Mr(e, t) {
1550
+ function Pr(e, t) {
1526
1551
  return t ?? {
1527
1552
  x: e.x,
1528
1553
  y: e.y
1529
1554
  };
1530
1555
  }
1531
- function Nr() {
1556
+ function Fr() {
1532
1557
  return navigator.maxTouchPoints || "ontouchstart" in this;
1533
1558
  }
1534
- function Pr() {
1535
- var e = Ar, t = jr, n = Mr, r = Nr, i = {}, a = Me("start", "drag", "end"), o = 0, s, c, l, u, d = 0;
1559
+ function Ir() {
1560
+ var e = Mr, t = Nr, n = Pr, r = Fr, i = {}, a = Fe("start", "drag", "end"), o = 0, s, c, l, u, d = 0;
1536
1561
  function f(e) {
1537
- e.on("mousedown.drag", p).filter(r).on("touchstart.drag", g).on("touchmove.drag", _, wr).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1562
+ e.on("mousedown.drag", p).filter(r).on("touchstart.drag", g).on("touchmove.drag", _, Dr).on("touchend.drag touchcancel.drag", v).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
1538
1563
  }
1539
1564
  function p(n, r) {
1540
1565
  if (!(u || !e.call(this, n, r))) {
1541
1566
  var i = y(this, t.call(this, n, r), n, r, "mouse");
1542
- i && (N(n.view).on("mousemove.drag", m, z).on("mouseup.drag", h, z), Er(n.view), Tr(n), l = !1, s = n.clientX, c = n.clientY, i("start", n));
1567
+ i && (N(n.view).on("mousemove.drag", m, z).on("mouseup.drag", h, z), kr(n.view), Or(n), l = !1, s = n.clientX, c = n.clientY, i("start", n));
1543
1568
  }
1544
1569
  }
1545
1570
  function m(e) {
@@ -1550,12 +1575,12 @@ function Pr() {
1550
1575
  i.mouse("drag", e);
1551
1576
  }
1552
1577
  function h(e) {
1553
- N(e.view).on("mousemove.drag mouseup.drag", null), Dr(e.view, l), B(e), i.mouse("end", e);
1578
+ N(e.view).on("mousemove.drag mouseup.drag", null), Ar(e.view, l), B(e), i.mouse("end", e);
1554
1579
  }
1555
1580
  function g(n, r) {
1556
1581
  if (e.call(this, n, r)) {
1557
1582
  var i = n.changedTouches, a = t.call(this, n, r), o = i.length, s, c;
1558
- for (s = 0; s < o; ++s) (c = y(this, a, n, r, i[s].identifier, i[s])) && (Tr(n), c("start", n, i[s]));
1583
+ for (s = 0; s < o; ++s) (c = y(this, a, n, r, i[s].identifier, i[s])) && (Or(n), c("start", n, i[s]));
1559
1584
  }
1560
1585
  }
1561
1586
  function _(e) {
@@ -1566,11 +1591,11 @@ function Pr() {
1566
1591
  var t = e.changedTouches, n = t.length, r, a;
1567
1592
  for (u && clearTimeout(u), u = setTimeout(function() {
1568
1593
  u = null;
1569
- }, 500), r = 0; r < n; ++r) (a = i[t[r].identifier]) && (Tr(e), a("end", e, t[r]));
1594
+ }, 500), r = 0; r < n; ++r) (a = i[t[r].identifier]) && (Or(e), a("end", e, t[r]));
1570
1595
  }
1571
1596
  function y(e, t, r, s, c, l) {
1572
1597
  var u = a.copy(), d = P(l || r, t), p, m, h;
1573
- if ((h = n.call(e, new kr("beforestart", {
1598
+ if ((h = n.call(e, new jr("beforestart", {
1574
1599
  sourceEvent: r,
1575
1600
  target: f,
1576
1601
  identifier: c,
@@ -1591,7 +1616,7 @@ function Pr() {
1591
1616
  d = P(l || a, t), _ = o;
1592
1617
  break;
1593
1618
  }
1594
- u.call(r, e, new kr(r, {
1619
+ u.call(r, e, new jr(r, {
1595
1620
  sourceEvent: a,
1596
1621
  subject: h,
1597
1622
  target: f,
@@ -1606,13 +1631,13 @@ function Pr() {
1606
1631
  };
1607
1632
  }
1608
1633
  return f.filter = function(t) {
1609
- return arguments.length ? (e = typeof t == "function" ? t : Or(!!t), f) : e;
1634
+ return arguments.length ? (e = typeof t == "function" ? t : V(!!t), f) : e;
1610
1635
  }, f.container = function(e) {
1611
- return arguments.length ? (t = typeof e == "function" ? e : Or(e), f) : t;
1636
+ return arguments.length ? (t = typeof e == "function" ? e : V(e), f) : t;
1612
1637
  }, f.subject = function(e) {
1613
- return arguments.length ? (n = typeof e == "function" ? e : Or(e), f) : n;
1638
+ return arguments.length ? (n = typeof e == "function" ? e : V(e), f) : n;
1614
1639
  }, f.touchable = function(e) {
1615
- return arguments.length ? (r = typeof e == "function" ? e : Or(!!e), f) : r;
1640
+ return arguments.length ? (r = typeof e == "function" ? e : V(!!e), f) : r;
1616
1641
  }, f.on = function() {
1617
1642
  var e = a.on.apply(a, arguments);
1618
1643
  return e === a ? f : e;
@@ -1620,74 +1645,74 @@ function Pr() {
1620
1645
  return arguments.length ? (d = (e = +e) * e, f) : Math.sqrt(d);
1621
1646
  }, f;
1622
1647
  }
1623
- var V = 0, Fr = 0, Ir = 0, Lr = 1e3, Rr, H, zr = 0, U = 0, Br = 0, W = typeof performance == "object" && performance.now ? performance : Date, Vr = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
1648
+ var H = 0, Lr = 0, Rr = 0, zr = 1e3, Br, U, Vr = 0, W = 0, Hr = 0, G = typeof performance == "object" && performance.now ? performance : Date, Ur = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(e) {
1624
1649
  setTimeout(e, 17);
1625
1650
  };
1626
- function Hr() {
1627
- return U ||= (Vr(Ur), W.now() + Br);
1651
+ function Wr() {
1652
+ return W ||= (Ur(Gr), G.now() + Hr);
1628
1653
  }
1629
- function Ur() {
1630
- U = 0;
1654
+ function Gr() {
1655
+ W = 0;
1631
1656
  }
1632
- function Wr() {
1657
+ function Kr() {
1633
1658
  this._call = this._time = this._next = null;
1634
1659
  }
1635
- Wr.prototype = Gr.prototype = {
1636
- constructor: Wr,
1660
+ Kr.prototype = qr.prototype = {
1661
+ constructor: Kr,
1637
1662
  restart: function(e, t, n) {
1638
1663
  if (typeof e != "function") throw TypeError("callback is not a function");
1639
- n = (n == null ? Hr() : +n) + (t == null ? 0 : +t), !this._next && H !== this && (H ? H._next = this : Rr = this, H = this), this._call = e, this._time = n, Xr();
1664
+ n = (n == null ? Wr() : +n) + (t == null ? 0 : +t), !this._next && U !== this && (U ? U._next = this : Br = this, U = this), this._call = e, this._time = n, Qr();
1640
1665
  },
1641
1666
  stop: function() {
1642
- this._call && (this._call = null, this._time = Infinity, Xr());
1667
+ this._call && (this._call = null, this._time = Infinity, Qr());
1643
1668
  }
1644
1669
  };
1645
- function Gr(e, t, n) {
1646
- var r = new Wr();
1670
+ function qr(e, t, n) {
1671
+ var r = new Kr();
1647
1672
  return r.restart(e, t, n), r;
1648
1673
  }
1649
- function Kr() {
1650
- Hr(), ++V;
1651
- for (var e = Rr, t; e;) (t = U - e._time) >= 0 && e._call.call(void 0, t), e = e._next;
1652
- --V;
1674
+ function Jr() {
1675
+ Wr(), ++H;
1676
+ for (var e = Br, t; e;) (t = W - e._time) >= 0 && e._call.call(void 0, t), e = e._next;
1677
+ --H;
1653
1678
  }
1654
- function qr() {
1655
- U = (zr = W.now()) + Br, V = Fr = 0;
1679
+ function Yr() {
1680
+ W = (Vr = G.now()) + Hr, H = Lr = 0;
1656
1681
  try {
1657
- Kr();
1682
+ Jr();
1658
1683
  } finally {
1659
- V = 0, Yr(), U = 0;
1684
+ H = 0, Zr(), W = 0;
1660
1685
  }
1661
1686
  }
1662
- function Jr() {
1663
- var e = W.now(), t = e - zr;
1664
- t > Lr && (Br -= t, zr = e);
1687
+ function Xr() {
1688
+ var e = G.now(), t = e - Vr;
1689
+ t > zr && (Hr -= t, Vr = e);
1665
1690
  }
1666
- function Yr() {
1667
- for (var e, t = Rr, n, r = Infinity; t;) t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Rr = n);
1668
- H = e, Xr(r);
1691
+ function Zr() {
1692
+ for (var e, t = Br, n, r = Infinity; t;) t._call ? (r > t._time && (r = t._time), e = t, t = t._next) : (n = t._next, t._next = null, t = e ? e._next = n : Br = n);
1693
+ U = e, Qr(r);
1669
1694
  }
1670
- function Xr(e) {
1671
- V || (Fr &&= clearTimeout(Fr), e - U > 24 ? (e < Infinity && (Fr = setTimeout(qr, e - W.now() - Br)), Ir &&= clearInterval(Ir)) : (Ir ||= (zr = W.now(), setInterval(Jr, Lr)), V = 1, Vr(qr)));
1695
+ function Qr(e) {
1696
+ H || (Lr &&= clearTimeout(Lr), e - W > 24 ? (e < Infinity && (Lr = setTimeout(Yr, e - G.now() - Hr)), Rr &&= clearInterval(Rr)) : (Rr ||= (Vr = G.now(), setInterval(Xr, zr)), H = 1, Ur(Yr)));
1672
1697
  }
1673
- function Zr(e, t, n) {
1674
- var r = new Wr();
1698
+ function $r(e, t, n) {
1699
+ var r = new Kr();
1675
1700
  return t = t == null ? 0 : +t, r.restart((n) => {
1676
1701
  r.stop(), e(n + t);
1677
1702
  }, t, n), r;
1678
1703
  }
1679
- xe(), fe(), Ne();
1680
- var Qr = Me("start", "end", "cancel", "interrupt"), $r = [];
1681
- function ei(e, t, n, r, i, a) {
1704
+ Te(), be(), Ie();
1705
+ var ei = Fe("start", "end", "cancel", "interrupt"), ti = [];
1706
+ function ni(e, t, n, r, i, a) {
1682
1707
  var o = e.__transition;
1683
1708
  if (!o) e.__transition = {};
1684
1709
  else if (n in o) return;
1685
- ni(e, n, {
1710
+ ii(e, n, {
1686
1711
  name: t,
1687
1712
  index: r,
1688
1713
  group: i,
1689
- on: Qr,
1690
- tween: $r,
1714
+ on: ei,
1715
+ tween: ti,
1691
1716
  time: a.time,
1692
1717
  delay: a.delay,
1693
1718
  duration: a.duration,
@@ -1696,24 +1721,24 @@ function ei(e, t, n, r, i, a) {
1696
1721
  state: 0
1697
1722
  });
1698
1723
  }
1699
- function ti(e, t) {
1700
- var n = K(e, t);
1724
+ function ri(e, t) {
1725
+ var n = q(e, t);
1701
1726
  if (n.state > 0) throw Error("too late; already scheduled");
1702
1727
  return n;
1703
1728
  }
1704
- function G(e, t) {
1705
- var n = K(e, t);
1729
+ function K(e, t) {
1730
+ var n = q(e, t);
1706
1731
  if (n.state > 3) throw Error("too late; already running");
1707
1732
  return n;
1708
1733
  }
1709
- function K(e, t) {
1734
+ function q(e, t) {
1710
1735
  var n = e.__transition;
1711
1736
  if (!n || !(n = n[t])) throw Error("transition not found");
1712
1737
  return n;
1713
1738
  }
1714
- function ni(e, t, n) {
1739
+ function ii(e, t, n) {
1715
1740
  var r = e.__transition, i;
1716
- r[t] = n, n.timer = Gr(a, 0, n.time);
1741
+ r[t] = n, n.timer = qr(a, 0, n.time);
1717
1742
  function a(e) {
1718
1743
  n.state = 1, n.timer.restart(o, n.delay, n.time), n.delay <= e && o(e - n.delay);
1719
1744
  }
@@ -1721,10 +1746,10 @@ function ni(e, t, n) {
1721
1746
  var l, u, d, f;
1722
1747
  if (n.state !== 1) return c();
1723
1748
  for (l in r) if (f = r[l], f.name === n.name) {
1724
- if (f.state === 3) return Zr(o);
1749
+ if (f.state === 3) return $r(o);
1725
1750
  f.state === 4 ? (f.state = 6, f.timer.stop(), f.on.call("interrupt", e, e.__data__, f.index, f.group), delete r[l]) : +l < t && (f.state = 6, f.timer.stop(), f.on.call("cancel", e, e.__data__, f.index, f.group), delete r[l]);
1726
1751
  }
1727
- if (Zr(function() {
1752
+ if ($r(function() {
1728
1753
  n.state === 3 && (n.state = 4, n.timer.restart(s, n.delay, n.time), s(a));
1729
1754
  }), n.state = 2, n.on.call("start", e, e.__data__, n.index, n.group), n.state === 2) {
1730
1755
  for (n.state = 3, i = Array(d = n.tween.length), l = 0, u = -1; l < d; ++l) (f = n.tween[l].value.call(e, e.__data__, n.index, n.group)) && (i[++u] = f);
@@ -1740,7 +1765,7 @@ function ni(e, t, n) {
1740
1765
  delete e.__transition;
1741
1766
  }
1742
1767
  }
1743
- function ri(e, t) {
1768
+ function ai(e, t) {
1744
1769
  var n = e.__transition, r, i, a = !0, o;
1745
1770
  if (n) {
1746
1771
  for (o in t = t == null ? null : t + "", n) {
@@ -1753,15 +1778,15 @@ function ri(e, t) {
1753
1778
  a && delete e.__transition;
1754
1779
  }
1755
1780
  }
1756
- function ii(e) {
1781
+ function oi(e) {
1757
1782
  return this.each(function() {
1758
- ri(this, e);
1783
+ ai(this, e);
1759
1784
  });
1760
1785
  }
1761
- function ai(e, t) {
1786
+ function si(e, t) {
1762
1787
  var n, r;
1763
1788
  return function() {
1764
- var i = G(this, e), a = i.tween;
1789
+ var i = K(this, e), a = i.tween;
1765
1790
  if (a !== n) {
1766
1791
  r = n = a;
1767
1792
  for (var o = 0, s = r.length; o < s; ++o) if (r[o].name === t) {
@@ -1772,11 +1797,11 @@ function ai(e, t) {
1772
1797
  i.tween = r;
1773
1798
  };
1774
1799
  }
1775
- function oi(e, t, n) {
1800
+ function ci(e, t, n) {
1776
1801
  var r, i;
1777
1802
  if (typeof n != "function") throw Error();
1778
1803
  return function() {
1779
- var a = G(this, e), o = a.tween;
1804
+ var a = K(this, e), o = a.tween;
1780
1805
  if (o !== r) {
1781
1806
  i = (r = o).slice();
1782
1807
  for (var s = {
@@ -1791,388 +1816,388 @@ function oi(e, t, n) {
1791
1816
  a.tween = i;
1792
1817
  };
1793
1818
  }
1794
- function si(e, t) {
1819
+ function li(e, t) {
1795
1820
  var n = this._id;
1796
1821
  if (e += "", arguments.length < 2) {
1797
- for (var r = K(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === e) return o.value;
1822
+ for (var r = q(this.node(), n).tween, i = 0, a = r.length, o; i < a; ++i) if ((o = r[i]).name === e) return o.value;
1798
1823
  return null;
1799
1824
  }
1800
- return this.each((t == null ? ai : oi)(n, e, t));
1825
+ return this.each((t == null ? si : ci)(n, e, t));
1801
1826
  }
1802
- function ci(e, t, n) {
1827
+ function ui(e, t, n) {
1803
1828
  var r = e._id;
1804
1829
  return e.each(function() {
1805
- var e = G(this, r);
1830
+ var e = K(this, r);
1806
1831
  (e.value ||= {})[t] = n.apply(this, arguments);
1807
1832
  }), function(e) {
1808
- return K(e, r).value[t];
1833
+ return q(e, r).value[t];
1809
1834
  };
1810
1835
  }
1811
- function li(e, t) {
1836
+ function di(e, t) {
1812
1837
  var n;
1813
- return (typeof t == "number" ? T : t instanceof Se ? se : (n = Se(t)) ? (t = n, se) : he)(e, t);
1838
+ return (typeof t == "number" ? se : t instanceof we ? _e : (n = we(t)) ? (t = n, _e) : de)(e, t);
1814
1839
  }
1815
- fe();
1816
- function ui(e) {
1840
+ be();
1841
+ function fi(e) {
1817
1842
  return function() {
1818
1843
  this.removeAttribute(e);
1819
1844
  };
1820
1845
  }
1821
- function di(e) {
1846
+ function pi(e) {
1822
1847
  return function() {
1823
1848
  this.removeAttributeNS(e.space, e.local);
1824
1849
  };
1825
1850
  }
1826
- function fi(e, t, n) {
1851
+ function mi(e, t, n) {
1827
1852
  var r, i = n + "", a;
1828
1853
  return function() {
1829
1854
  var o = this.getAttribute(e);
1830
1855
  return o === i ? null : o === r ? a : a = t(r = o, n);
1831
1856
  };
1832
1857
  }
1833
- function pi(e, t, n) {
1858
+ function hi(e, t, n) {
1834
1859
  var r, i = n + "", a;
1835
1860
  return function() {
1836
1861
  var o = this.getAttributeNS(e.space, e.local);
1837
1862
  return o === i ? null : o === r ? a : a = t(r = o, n);
1838
1863
  };
1839
1864
  }
1840
- function mi(e, t, n) {
1865
+ function gi(e, t, n) {
1841
1866
  var r, i, a;
1842
1867
  return function() {
1843
1868
  var o, s = n(this), c;
1844
1869
  return s == null ? void this.removeAttribute(e) : (o = this.getAttribute(e), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s)));
1845
1870
  };
1846
1871
  }
1847
- function hi(e, t, n) {
1872
+ function _i(e, t, n) {
1848
1873
  var r, i, a;
1849
1874
  return function() {
1850
1875
  var o, s = n(this), c;
1851
1876
  return s == null ? void this.removeAttributeNS(e.space, e.local) : (o = this.getAttributeNS(e.space, e.local), c = s + "", o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s)));
1852
1877
  };
1853
1878
  }
1854
- function gi(e, t) {
1855
- var n = dt(e), r = n === "transform" ? ge : li;
1856
- return this.attrTween(e, typeof t == "function" ? (n.local ? hi : mi)(n, r, ci(this, "attr." + e, t)) : t == null ? (n.local ? di : ui)(n) : (n.local ? pi : fi)(n, r, t));
1879
+ function vi(e, t) {
1880
+ var n = mt(e), r = n === "transform" ? oe : di;
1881
+ return this.attrTween(e, typeof t == "function" ? (n.local ? _i : gi)(n, r, ui(this, "attr." + e, t)) : t == null ? (n.local ? pi : fi)(n) : (n.local ? hi : mi)(n, r, t));
1857
1882
  }
1858
- function _i(e, t) {
1883
+ function yi(e, t) {
1859
1884
  return function(n) {
1860
1885
  this.setAttribute(e, t.call(this, n));
1861
1886
  };
1862
1887
  }
1863
- function vi(e, t) {
1888
+ function bi(e, t) {
1864
1889
  return function(n) {
1865
1890
  this.setAttributeNS(e.space, e.local, t.call(this, n));
1866
1891
  };
1867
1892
  }
1868
- function yi(e, t) {
1893
+ function xi(e, t) {
1869
1894
  var n, r;
1870
1895
  function i() {
1871
1896
  var i = t.apply(this, arguments);
1872
- return i !== r && (n = (r = i) && vi(e, i)), n;
1897
+ return i !== r && (n = (r = i) && bi(e, i)), n;
1873
1898
  }
1874
1899
  return i._value = t, i;
1875
1900
  }
1876
- function bi(e, t) {
1901
+ function Si(e, t) {
1877
1902
  var n, r;
1878
1903
  function i() {
1879
1904
  var i = t.apply(this, arguments);
1880
- return i !== r && (n = (r = i) && _i(e, i)), n;
1905
+ return i !== r && (n = (r = i) && yi(e, i)), n;
1881
1906
  }
1882
1907
  return i._value = t, i;
1883
1908
  }
1884
- function xi(e, t) {
1909
+ function Ci(e, t) {
1885
1910
  var n = "attr." + e;
1886
1911
  if (arguments.length < 2) return (n = this.tween(n)) && n._value;
1887
1912
  if (t == null) return this.tween(n, null);
1888
1913
  if (typeof t != "function") throw Error();
1889
- var r = dt(e);
1890
- return this.tween(n, (r.local ? yi : bi)(r, t));
1914
+ var r = mt(e);
1915
+ return this.tween(n, (r.local ? xi : Si)(r, t));
1891
1916
  }
1892
- function Si(e, t) {
1917
+ function wi(e, t) {
1893
1918
  return function() {
1894
- ti(this, e).delay = +t.apply(this, arguments);
1919
+ ri(this, e).delay = +t.apply(this, arguments);
1895
1920
  };
1896
1921
  }
1897
- function Ci(e, t) {
1922
+ function Ti(e, t) {
1898
1923
  return t = +t, function() {
1899
- ti(this, e).delay = t;
1924
+ ri(this, e).delay = t;
1900
1925
  };
1901
1926
  }
1902
- function wi(e) {
1927
+ function Ei(e) {
1903
1928
  var t = this._id;
1904
- return arguments.length ? this.each((typeof e == "function" ? Si : Ci)(t, e)) : K(this.node(), t).delay;
1929
+ return arguments.length ? this.each((typeof e == "function" ? wi : Ti)(t, e)) : q(this.node(), t).delay;
1905
1930
  }
1906
- function Ti(e, t) {
1931
+ function Di(e, t) {
1907
1932
  return function() {
1908
- G(this, e).duration = +t.apply(this, arguments);
1933
+ K(this, e).duration = +t.apply(this, arguments);
1909
1934
  };
1910
1935
  }
1911
- function Ei(e, t) {
1936
+ function Oi(e, t) {
1912
1937
  return t = +t, function() {
1913
- G(this, e).duration = t;
1938
+ K(this, e).duration = t;
1914
1939
  };
1915
1940
  }
1916
- function Di(e) {
1941
+ function ki(e) {
1917
1942
  var t = this._id;
1918
- return arguments.length ? this.each((typeof e == "function" ? Ti : Ei)(t, e)) : K(this.node(), t).duration;
1943
+ return arguments.length ? this.each((typeof e == "function" ? Di : Oi)(t, e)) : q(this.node(), t).duration;
1919
1944
  }
1920
- function Oi(e, t) {
1945
+ function Ai(e, t) {
1921
1946
  if (typeof t != "function") throw Error();
1922
1947
  return function() {
1923
- G(this, e).ease = t;
1948
+ K(this, e).ease = t;
1924
1949
  };
1925
1950
  }
1926
- function ki(e) {
1951
+ function ji(e) {
1927
1952
  var t = this._id;
1928
- return arguments.length ? this.each(Oi(t, e)) : K(this.node(), t).ease;
1953
+ return arguments.length ? this.each(Ai(t, e)) : q(this.node(), t).ease;
1929
1954
  }
1930
- function Ai(e, t) {
1955
+ function Mi(e, t) {
1931
1956
  return function() {
1932
1957
  var n = t.apply(this, arguments);
1933
1958
  if (typeof n != "function") throw Error();
1934
- G(this, e).ease = n;
1959
+ K(this, e).ease = n;
1935
1960
  };
1936
1961
  }
1937
- function ji(e) {
1962
+ function Ni(e) {
1938
1963
  if (typeof e != "function") throw Error();
1939
- return this.each(Ai(this._id, e));
1964
+ return this.each(Mi(this._id, e));
1940
1965
  }
1941
- function Mi(e) {
1942
- typeof e != "function" && (e = Ct(e));
1966
+ function Pi(e) {
1967
+ typeof e != "function" && (e = Et(e));
1943
1968
  for (var t = this._groups, n = t.length, r = Array(n), i = 0; i < n; ++i) for (var a = t[i], o = a.length, s = r[i] = [], c, l = 0; l < o; ++l) (c = a[l]) && e.call(c, c.__data__, l, a) && s.push(c);
1944
- return new q(r, this._parents, this._name, this._id);
1969
+ return new J(r, this._parents, this._name, this._id);
1945
1970
  }
1946
- function Ni(e) {
1971
+ function Fi(e) {
1947
1972
  if (e._id !== this._id) throw Error();
1948
1973
  for (var t = this._groups, n = e._groups, r = t.length, i = n.length, a = Math.min(r, i), o = Array(r), s = 0; s < a; ++s) for (var c = t[s], l = n[s], u = c.length, d = o[s] = Array(u), f, p = 0; p < u; ++p) (f = c[p] || l[p]) && (d[p] = f);
1949
1974
  for (; s < r; ++s) o[s] = t[s];
1950
- return new q(o, this._parents, this._name, this._id);
1975
+ return new J(o, this._parents, this._name, this._id);
1951
1976
  }
1952
- function Pi(e) {
1977
+ function Ii(e) {
1953
1978
  return (e + "").trim().split(/^|\s+/).every(function(e) {
1954
1979
  var t = e.indexOf(".");
1955
1980
  return t >= 0 && (e = e.slice(0, t)), !e || e === "start";
1956
1981
  });
1957
1982
  }
1958
- function Fi(e, t, n) {
1959
- var r, i, a = Pi(t) ? ti : G;
1983
+ function Li(e, t, n) {
1984
+ var r, i, a = Ii(t) ? ri : K;
1960
1985
  return function() {
1961
1986
  var o = a(this, e), s = o.on;
1962
1987
  s !== r && (i = (r = s).copy()).on(t, n), o.on = i;
1963
1988
  };
1964
1989
  }
1965
- function Ii(e, t) {
1990
+ function Ri(e, t) {
1966
1991
  var n = this._id;
1967
- return arguments.length < 2 ? K(this.node(), n).on.on(e) : this.each(Fi(n, e, t));
1992
+ return arguments.length < 2 ? q(this.node(), n).on.on(e) : this.each(Li(n, e, t));
1968
1993
  }
1969
- function Li(e) {
1994
+ function zi(e) {
1970
1995
  return function() {
1971
1996
  var t = this.parentNode;
1972
1997
  for (var n in this.__transition) if (+n !== e) return;
1973
1998
  t && t.removeChild(this);
1974
1999
  };
1975
2000
  }
1976
- function Ri() {
1977
- return this.on("end.remove", Li(this._id));
2001
+ function Bi() {
2002
+ return this.on("end.remove", zi(this._id));
1978
2003
  }
1979
- function zi(e) {
2004
+ function Vi(e) {
1980
2005
  var t = this._name, n = this._id;
1981
- typeof e != "function" && (e = gt(e));
1982
- for (var r = this._groups, i = r.length, a = Array(i), o = 0; o < i; ++o) for (var s = r[o], c = s.length, l = a[o] = Array(c), u, d, f = 0; f < c; ++f) (u = s[f]) && (d = e.call(u, u.__data__, f, s)) && ("__data__" in u && (d.__data__ = u.__data__), l[f] = d, ei(l[f], t, n, f, l, K(u, n)));
1983
- return new q(a, this._parents, t, n);
2006
+ typeof e != "function" && (e = yt(e));
2007
+ for (var r = this._groups, i = r.length, a = Array(i), o = 0; o < i; ++o) for (var s = r[o], c = s.length, l = a[o] = Array(c), u, d, f = 0; f < c; ++f) (u = s[f]) && (d = e.call(u, u.__data__, f, s)) && ("__data__" in u && (d.__data__ = u.__data__), l[f] = d, ni(l[f], t, n, f, l, q(u, n)));
2008
+ return new J(a, this._parents, t, n);
1984
2009
  }
1985
- function Bi(e) {
2010
+ function Hi(e) {
1986
2011
  var t = this._name, n = this._id;
1987
- typeof e != "function" && (e = bt(e));
2012
+ typeof e != "function" && (e = Ct(e));
1988
2013
  for (var r = this._groups, i = r.length, a = [], o = [], s = 0; s < i; ++s) for (var c = r[s], l = c.length, u, d = 0; d < l; ++d) if (u = c[d]) {
1989
- for (var f = e.call(u, u.__data__, d, c), p, m = K(u, n), h = 0, g = f.length; h < g; ++h) (p = f[h]) && ei(p, t, n, h, f, m);
2014
+ for (var f = e.call(u, u.__data__, d, c), p, m = q(u, n), h = 0, g = f.length; h < g; ++h) (p = f[h]) && ni(p, t, n, h, f, m);
1990
2015
  a.push(f), o.push(u);
1991
2016
  }
1992
- return new q(a, o, t, n);
2017
+ return new J(a, o, t, n);
1993
2018
  }
1994
- var Vi = M.prototype.constructor;
1995
- function Hi() {
1996
- return new Vi(this._groups, this._parents);
2019
+ var Ui = M.prototype.constructor;
2020
+ function Wi() {
2021
+ return new Ui(this._groups, this._parents);
1997
2022
  }
1998
- fe();
1999
- function Ui(e, t) {
2023
+ be();
2024
+ function Gi(e, t) {
2000
2025
  var n, r, i;
2001
2026
  return function() {
2002
2027
  var a = A(this, e), o = (this.style.removeProperty(e), A(this, e));
2003
2028
  return a === o ? null : a === n && o === r ? i : i = t(n = a, r = o);
2004
2029
  };
2005
2030
  }
2006
- function Wi(e) {
2031
+ function Ki(e) {
2007
2032
  return function() {
2008
2033
  this.style.removeProperty(e);
2009
2034
  };
2010
2035
  }
2011
- function Gi(e, t, n) {
2036
+ function qi(e, t, n) {
2012
2037
  var r, i = n + "", a;
2013
2038
  return function() {
2014
2039
  var o = A(this, e);
2015
2040
  return o === i ? null : o === r ? a : a = t(r = o, n);
2016
2041
  };
2017
2042
  }
2018
- function Ki(e, t, n) {
2043
+ function Ji(e, t, n) {
2019
2044
  var r, i, a;
2020
2045
  return function() {
2021
2046
  var o = A(this, e), s = n(this), c = s + "";
2022
2047
  return s ?? (c = s = (this.style.removeProperty(e), A(this, e))), o === c ? null : o === r && c === i ? a : (i = c, a = t(r = o, s));
2023
2048
  };
2024
2049
  }
2025
- function qi(e, t) {
2050
+ function Yi(e, t) {
2026
2051
  var n, r, i, a = "style." + t, o = "end." + a, s;
2027
2052
  return function() {
2028
- var c = G(this, e), l = c.on, u = c.value[a] == null ? s ||= Wi(t) : void 0;
2053
+ var c = K(this, e), l = c.on, u = c.value[a] == null ? s ||= Ki(t) : void 0;
2029
2054
  (l !== n || i !== u) && (r = (n = l).copy()).on(o, i = u), c.on = r;
2030
2055
  };
2031
2056
  }
2032
- function Ji(e, t, n) {
2033
- var r = (e += "") == "transform" ? me : li;
2034
- return t == null ? this.styleTween(e, Ui(e, r)).on("end.style." + e, Wi(e)) : typeof t == "function" ? this.styleTween(e, Ki(e, r, ci(this, "style." + e, t))).each(qi(this._id, e)) : this.styleTween(e, Gi(e, r, t), n).on("end.style." + e, null);
2057
+ function Xi(e, t, n) {
2058
+ var r = (e += "") == "transform" ? ue : di;
2059
+ return t == null ? this.styleTween(e, Gi(e, r)).on("end.style." + e, Ki(e)) : typeof t == "function" ? this.styleTween(e, Ji(e, r, ui(this, "style." + e, t))).each(Yi(this._id, e)) : this.styleTween(e, qi(e, r, t), n).on("end.style." + e, null);
2035
2060
  }
2036
- function Yi(e, t, n) {
2061
+ function Zi(e, t, n) {
2037
2062
  return function(r) {
2038
2063
  this.style.setProperty(e, t.call(this, r), n);
2039
2064
  };
2040
2065
  }
2041
- function Xi(e, t, n) {
2066
+ function Qi(e, t, n) {
2042
2067
  var r, i;
2043
2068
  function a() {
2044
2069
  var a = t.apply(this, arguments);
2045
- return a !== i && (r = (i = a) && Yi(e, a, n)), r;
2070
+ return a !== i && (r = (i = a) && Zi(e, a, n)), r;
2046
2071
  }
2047
2072
  return a._value = t, a;
2048
2073
  }
2049
- function Zi(e, t, n) {
2074
+ function $i(e, t, n) {
2050
2075
  var r = "style." + (e += "");
2051
2076
  if (arguments.length < 2) return (r = this.tween(r)) && r._value;
2052
2077
  if (t == null) return this.tween(r, null);
2053
2078
  if (typeof t != "function") throw Error();
2054
- return this.tween(r, Xi(e, t, n ?? ""));
2079
+ return this.tween(r, Qi(e, t, n ?? ""));
2055
2080
  }
2056
- function Qi(e) {
2081
+ function ea(e) {
2057
2082
  return function() {
2058
2083
  this.textContent = e;
2059
2084
  };
2060
2085
  }
2061
- function $i(e) {
2086
+ function ta(e) {
2062
2087
  return function() {
2063
2088
  var t = e(this);
2064
2089
  this.textContent = t ?? "";
2065
2090
  };
2066
2091
  }
2067
- function ea(e) {
2068
- return this.tween("text", typeof e == "function" ? $i(ci(this, "text", e)) : Qi(e == null ? "" : e + ""));
2092
+ function na(e) {
2093
+ return this.tween("text", typeof e == "function" ? ta(ui(this, "text", e)) : ea(e == null ? "" : e + ""));
2069
2094
  }
2070
- function ta(e) {
2095
+ function ra(e) {
2071
2096
  return function(t) {
2072
2097
  this.textContent = e.call(this, t);
2073
2098
  };
2074
2099
  }
2075
- function na(e) {
2100
+ function ia(e) {
2076
2101
  var t, n;
2077
2102
  function r() {
2078
2103
  var r = e.apply(this, arguments);
2079
- return r !== n && (t = (n = r) && ta(r)), t;
2104
+ return r !== n && (t = (n = r) && ra(r)), t;
2080
2105
  }
2081
2106
  return r._value = e, r;
2082
2107
  }
2083
- function ra(e) {
2108
+ function aa(e) {
2084
2109
  var t = "text";
2085
2110
  if (arguments.length < 1) return (t = this.tween(t)) && t._value;
2086
2111
  if (e == null) return this.tween(t, null);
2087
2112
  if (typeof e != "function") throw Error();
2088
- return this.tween(t, na(e));
2113
+ return this.tween(t, ia(e));
2089
2114
  }
2090
- function ia() {
2091
- for (var e = this._name, t = this._id, n = ca(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) if (c = o[l]) {
2092
- var u = K(c, t);
2093
- ei(c, e, n, l, o, {
2115
+ function oa() {
2116
+ for (var e = this._name, t = this._id, n = ua(), r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) if (c = o[l]) {
2117
+ var u = q(c, t);
2118
+ ni(c, e, n, l, o, {
2094
2119
  time: u.time + u.delay + u.duration,
2095
2120
  delay: 0,
2096
2121
  duration: u.duration,
2097
2122
  ease: u.ease
2098
2123
  });
2099
2124
  }
2100
- return new q(r, this._parents, e, n);
2125
+ return new J(r, this._parents, e, n);
2101
2126
  }
2102
- function aa() {
2127
+ function sa() {
2103
2128
  var e, t, n = this, r = n._id, i = n.size();
2104
2129
  return new Promise(function(a, o) {
2105
2130
  var s = { value: o }, c = { value: function() {
2106
2131
  --i === 0 && a();
2107
2132
  } };
2108
2133
  n.each(function() {
2109
- var n = G(this, r), i = n.on;
2134
+ var n = K(this, r), i = n.on;
2110
2135
  i !== e && (t = (e = i).copy(), t._.cancel.push(s), t._.interrupt.push(s), t._.end.push(c)), n.on = t;
2111
2136
  }), i === 0 && a();
2112
2137
  });
2113
2138
  }
2114
- var oa = 0;
2115
- function q(e, t, n, r) {
2139
+ var ca = 0;
2140
+ function J(e, t, n, r) {
2116
2141
  this._groups = e, this._parents = t, this._name = n, this._id = r;
2117
2142
  }
2118
- function sa(e) {
2143
+ function la(e) {
2119
2144
  return M().transition(e);
2120
2145
  }
2121
- function ca() {
2122
- return ++oa;
2123
- }
2124
- var J = M.prototype;
2125
- q.prototype = sa.prototype = {
2126
- constructor: q,
2127
- select: zi,
2128
- selectAll: Bi,
2129
- selectChild: J.selectChild,
2130
- selectChildren: J.selectChildren,
2131
- filter: Mi,
2132
- merge: Ni,
2133
- selection: Hi,
2134
- transition: ia,
2135
- call: J.call,
2136
- nodes: J.nodes,
2137
- node: J.node,
2138
- size: J.size,
2139
- empty: J.empty,
2140
- each: J.each,
2141
- on: Ii,
2142
- attr: gi,
2143
- attrTween: xi,
2144
- style: Ji,
2145
- styleTween: Zi,
2146
- text: ea,
2147
- textTween: ra,
2148
- remove: Ri,
2149
- tween: si,
2150
- delay: wi,
2151
- duration: Di,
2152
- ease: ki,
2153
- easeVarying: ji,
2154
- end: aa,
2155
- [Symbol.iterator]: J[Symbol.iterator]
2156
- }, le();
2157
- var la = {
2146
+ function ua() {
2147
+ return ++ca;
2148
+ }
2149
+ var Y = M.prototype;
2150
+ J.prototype = la.prototype = {
2151
+ constructor: J,
2152
+ select: Vi,
2153
+ selectAll: Hi,
2154
+ selectChild: Y.selectChild,
2155
+ selectChildren: Y.selectChildren,
2156
+ filter: Pi,
2157
+ merge: Fi,
2158
+ selection: Wi,
2159
+ transition: oa,
2160
+ call: Y.call,
2161
+ nodes: Y.nodes,
2162
+ node: Y.node,
2163
+ size: Y.size,
2164
+ empty: Y.empty,
2165
+ each: Y.each,
2166
+ on: Ri,
2167
+ attr: vi,
2168
+ attrTween: Ci,
2169
+ style: Xi,
2170
+ styleTween: $i,
2171
+ text: na,
2172
+ textTween: aa,
2173
+ remove: Bi,
2174
+ tween: li,
2175
+ delay: Ei,
2176
+ duration: ki,
2177
+ ease: ji,
2178
+ easeVarying: Ni,
2179
+ end: sa,
2180
+ [Symbol.iterator]: Y[Symbol.iterator]
2181
+ }, ge();
2182
+ var da = {
2158
2183
  time: null,
2159
2184
  delay: 0,
2160
2185
  duration: 250,
2161
- ease: ue
2186
+ ease: he
2162
2187
  };
2163
- function ua(e, t) {
2188
+ function fa(e, t) {
2164
2189
  for (var n; !(n = e.__transition) || !(n = n[t]);) if (!(e = e.parentNode)) throw Error(`transition ${t} not found`);
2165
2190
  return n;
2166
2191
  }
2167
- function da(e) {
2192
+ function pa(e) {
2168
2193
  var t, n;
2169
- e instanceof q ? (t = e._id, e = e._name) : (t = ca(), (n = la).time = Hr(), e = e == null ? null : e + "");
2170
- for (var r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && ei(c, e, t, l, o, n || ua(c, t));
2171
- return new q(r, this._parents, e, t);
2194
+ e instanceof J ? (t = e._id, e = e._name) : (t = ua(), (n = da).time = Wr(), e = e == null ? null : e + "");
2195
+ for (var r = this._groups, i = r.length, a = 0; a < i; ++a) for (var o = r[a], s = o.length, c, l = 0; l < s; ++l) (c = o[l]) && ni(c, e, t, l, o, n || fa(c, t));
2196
+ return new J(r, this._parents, e, t);
2172
2197
  }
2173
- M.prototype.interrupt = ii, M.prototype.transition = da;
2174
- var fa = (e) => () => e;
2175
- function pa(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
2198
+ M.prototype.interrupt = oi, M.prototype.transition = pa;
2199
+ var ma = (e) => () => e;
2200
+ function ha(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
2176
2201
  Object.defineProperties(this, {
2177
2202
  type: {
2178
2203
  value: e,
@@ -2197,16 +2222,16 @@ function pa(e, { sourceEvent: t, target: n, transform: r, dispatch: i }) {
2197
2222
  _: { value: i }
2198
2223
  });
2199
2224
  }
2200
- function Y(e, t, n) {
2225
+ function X(e, t, n) {
2201
2226
  this.k = e, this.x = t, this.y = n;
2202
2227
  }
2203
- Y.prototype = {
2204
- constructor: Y,
2228
+ X.prototype = {
2229
+ constructor: X,
2205
2230
  scale: function(e) {
2206
- return e === 1 ? this : new Y(this.k * e, this.x, this.y);
2231
+ return e === 1 ? this : new X(this.k * e, this.x, this.y);
2207
2232
  },
2208
2233
  translate: function(e, t) {
2209
- return e === 0 & t === 0 ? this : new Y(this.k, this.x + this.k * e, this.y + this.k * t);
2234
+ return e === 0 & t === 0 ? this : new X(this.k, this.x + this.k * e, this.y + this.k * t);
2210
2235
  },
2211
2236
  apply: function(e) {
2212
2237
  return [e[0] * this.k + this.x, e[1] * this.k + this.y];
@@ -2236,47 +2261,47 @@ Y.prototype = {
2236
2261
  return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
2237
2262
  }
2238
2263
  };
2239
- var ma = new Y(1, 0, 0);
2240
- ha.prototype = Y.prototype;
2241
- function ha(e) {
2242
- for (; !e.__zoom;) if (!(e = e.parentNode)) return ma;
2264
+ var ga = new X(1, 0, 0);
2265
+ _a.prototype = X.prototype;
2266
+ function _a(e) {
2267
+ for (; !e.__zoom;) if (!(e = e.parentNode)) return ga;
2243
2268
  return e.__zoom;
2244
2269
  }
2245
- function ga(e) {
2270
+ function va(e) {
2246
2271
  e.stopImmediatePropagation();
2247
2272
  }
2248
- function X(e) {
2273
+ function Z(e) {
2249
2274
  e.preventDefault(), e.stopImmediatePropagation();
2250
2275
  }
2251
- Ne(), fe();
2252
- function _a(e) {
2276
+ Ie(), be();
2277
+ function ya(e) {
2253
2278
  return (!e.ctrlKey || e.type === "wheel") && !e.button;
2254
2279
  }
2255
- function va() {
2280
+ function ba() {
2256
2281
  var e = this;
2257
2282
  return e instanceof SVGElement ? (e = e.ownerSVGElement || e, e.hasAttribute("viewBox") ? (e = e.viewBox.baseVal, [[e.x, e.y], [e.x + e.width, e.y + e.height]]) : [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]) : [[0, 0], [e.clientWidth, e.clientHeight]];
2258
2283
  }
2259
- function ya() {
2260
- return this.__zoom || ma;
2284
+ function xa() {
2285
+ return this.__zoom || ga;
2261
2286
  }
2262
- function ba(e) {
2287
+ function Sa(e) {
2263
2288
  return -e.deltaY * (e.deltaMode === 1 ? .05 : e.deltaMode ? 1 : .002) * (e.ctrlKey ? 10 : 1);
2264
2289
  }
2265
- function xa() {
2290
+ function Ca() {
2266
2291
  return navigator.maxTouchPoints || "ontouchstart" in this;
2267
2292
  }
2268
- function Sa(e, t, n) {
2293
+ function wa(e, t, n) {
2269
2294
  var r = e.invertX(t[0][0]) - n[0][0], i = e.invertX(t[1][0]) - n[1][0], a = e.invertY(t[0][1]) - n[0][1], o = e.invertY(t[1][1]) - n[1][1];
2270
2295
  return e.translate(i > r ? (r + i) / 2 : Math.min(0, r) || Math.max(0, i), o > a ? (a + o) / 2 : Math.min(0, a) || Math.max(0, o));
2271
2296
  }
2272
- function Ca() {
2273
- var e = _a, t = va, n = Sa, r = ba, i = xa, a = [0, Infinity], o = [[-Infinity, -Infinity], [Infinity, Infinity]], s = 250, c = de, l = Me("start", "zoom", "end"), u, d, f, p = 500, m = 150, h = 0, g = 10;
2297
+ function Ta() {
2298
+ var e = ya, t = ba, n = wa, r = Sa, i = Ca, a = [0, Infinity], o = [[-Infinity, -Infinity], [Infinity, Infinity]], s = 250, c = me, l = Fe("start", "zoom", "end"), u, d, f, p = 500, m = 150, h = 0, g = 10;
2274
2299
  function _(e) {
2275
- e.property("__zoom", ya).on("wheel.zoom", ee, { passive: !1 }).on("mousedown.zoom", w).on("dblclick.zoom", te).filter(i).on("touchstart.zoom", ne).on("touchmove.zoom", T).on("touchend.zoom touchcancel.zoom", re).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2300
+ e.property("__zoom", xa).on("wheel.zoom", ee, { passive: !1 }).on("mousedown.zoom", te).on("dblclick.zoom", ne).filter(i).on("touchstart.zoom", re).on("touchmove.zoom", w).on("touchend.zoom touchcancel.zoom", ie).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
2276
2301
  }
2277
2302
  _.transform = function(e, t, n, r) {
2278
2303
  var i = e.selection ? e.selection() : e;
2279
- i.property("__zoom", ya), e === i ? i.interrupt().each(function() {
2304
+ i.property("__zoom", xa), e === i ? i.interrupt().each(function() {
2280
2305
  S(this, arguments).event(r).start().zoom(null, typeof t == "function" ? t.apply(this, arguments) : t).end();
2281
2306
  }) : x(e, t, n, r);
2282
2307
  }, _.scaleBy = function(e, t, n, r) {
@@ -2295,15 +2320,15 @@ function Ca() {
2295
2320
  }, _.translateTo = function(e, r, i, a, s) {
2296
2321
  _.transform(e, function() {
2297
2322
  var e = t.apply(this, arguments), s = this.__zoom, c = a == null ? b(e) : typeof a == "function" ? a.apply(this, arguments) : a;
2298
- return n(ma.translate(c[0], c[1]).scale(s.k).translate(typeof r == "function" ? -r.apply(this, arguments) : -r, typeof i == "function" ? -i.apply(this, arguments) : -i), e, o);
2323
+ return n(ga.translate(c[0], c[1]).scale(s.k).translate(typeof r == "function" ? -r.apply(this, arguments) : -r, typeof i == "function" ? -i.apply(this, arguments) : -i), e, o);
2299
2324
  }, a, s);
2300
2325
  };
2301
2326
  function v(e, t) {
2302
- return t = Math.max(a[0], Math.min(a[1], t)), t === e.k ? e : new Y(t, e.x, e.y);
2327
+ return t = Math.max(a[0], Math.min(a[1], t)), t === e.k ? e : new X(t, e.x, e.y);
2303
2328
  }
2304
2329
  function y(e, t, n) {
2305
2330
  var r = t[0] - n[0] * e.k, i = t[1] - n[1] * e.k;
2306
- return r === e.x && i === e.y ? e : new Y(e.k, r, i);
2331
+ return r === e.x && i === e.y ? e : new X(e.k, r, i);
2307
2332
  }
2308
2333
  function b(e) {
2309
2334
  return [(+e[0][0] + +e[1][0]) / 2, (+e[0][1] + +e[1][1]) / 2];
@@ -2319,7 +2344,7 @@ function Ca() {
2319
2344
  if (e === 1) e = f;
2320
2345
  else {
2321
2346
  var t = p(e), n = u / t[2];
2322
- e = new Y(n, l[0] - t[0] * n, l[1] - t[1] * n);
2347
+ e = new X(n, l[0] - t[0] * n, l[1] - t[1] * n);
2323
2348
  }
2324
2349
  o.zoom(null, e);
2325
2350
  };
@@ -2346,7 +2371,7 @@ function Ca() {
2346
2371
  },
2347
2372
  emit: function(e) {
2348
2373
  var t = N(this.that).datum();
2349
- l.call(e, this.that, new pa(e, {
2374
+ l.call(e, this.that, new ha(e, {
2350
2375
  sourceEvent: this.sourceEvent,
2351
2376
  target: _,
2352
2377
  type: e,
@@ -2360,50 +2385,50 @@ function Ca() {
2360
2385
  var s = S(this, i).event(t), c = this.__zoom, l = Math.max(a[0], Math.min(a[1], c.k * 2 ** r.apply(this, arguments))), u = P(t);
2361
2386
  if (s.wheel) (s.mouse[0][0] !== u[0] || s.mouse[0][1] !== u[1]) && (s.mouse[1] = c.invert(s.mouse[0] = u)), clearTimeout(s.wheel);
2362
2387
  else if (c.k === l) return;
2363
- else s.mouse = [u, c.invert(u)], ri(this), s.start();
2364
- X(t), s.wheel = setTimeout(d, m), s.zoom("mouse", n(y(v(c, l), s.mouse[0], s.mouse[1]), s.extent, o));
2388
+ else s.mouse = [u, c.invert(u)], ai(this), s.start();
2389
+ Z(t), s.wheel = setTimeout(d, m), s.zoom("mouse", n(y(v(c, l), s.mouse[0], s.mouse[1]), s.extent, o));
2365
2390
  function d() {
2366
2391
  s.wheel = null, s.end();
2367
2392
  }
2368
2393
  }
2369
- function w(t, ...r) {
2394
+ function te(t, ...r) {
2370
2395
  if (f || !e.apply(this, arguments)) return;
2371
2396
  var i = t.currentTarget, a = S(this, r, !0).event(t), s = N(t.view).on("mousemove.zoom", d, !0).on("mouseup.zoom", p, !0), c = P(t, i), l = t.clientX, u = t.clientY;
2372
- Er(t.view), ga(t), a.mouse = [c, this.__zoom.invert(c)], ri(this), a.start();
2397
+ kr(t.view), va(t), a.mouse = [c, this.__zoom.invert(c)], ai(this), a.start();
2373
2398
  function d(e) {
2374
- if (X(e), !a.moved) {
2399
+ if (Z(e), !a.moved) {
2375
2400
  var t = e.clientX - l, r = e.clientY - u;
2376
2401
  a.moved = t * t + r * r > h;
2377
2402
  }
2378
2403
  a.event(e).zoom("mouse", n(y(a.that.__zoom, a.mouse[0] = P(e, i), a.mouse[1]), a.extent, o));
2379
2404
  }
2380
2405
  function p(e) {
2381
- s.on("mousemove.zoom mouseup.zoom", null), Dr(e.view, a.moved), X(e), a.event(e).end();
2406
+ s.on("mousemove.zoom mouseup.zoom", null), Ar(e.view, a.moved), Z(e), a.event(e).end();
2382
2407
  }
2383
2408
  }
2384
- function te(r, ...i) {
2409
+ function ne(r, ...i) {
2385
2410
  if (e.apply(this, arguments)) {
2386
2411
  var a = this.__zoom, c = P(r.changedTouches ? r.changedTouches[0] : r, this), l = a.invert(c), u = a.k * (r.shiftKey ? .5 : 2), d = n(y(v(a, u), c, l), t.apply(this, i), o);
2387
- X(r), s > 0 ? N(this).transition().duration(s).call(x, d, c, r) : N(this).call(_.transform, d, c, r);
2412
+ Z(r), s > 0 ? N(this).transition().duration(s).call(x, d, c, r) : N(this).call(_.transform, d, c, r);
2388
2413
  }
2389
2414
  }
2390
- function ne(t, ...n) {
2415
+ function re(t, ...n) {
2391
2416
  if (e.apply(this, arguments)) {
2392
2417
  var r = t.touches, i = r.length, a = S(this, n, t.changedTouches.length === i).event(t), o, s, c, l;
2393
- for (ga(t), s = 0; s < i; ++s) c = r[s], l = P(c, this), l = [
2418
+ for (va(t), s = 0; s < i; ++s) c = r[s], l = P(c, this), l = [
2394
2419
  l,
2395
2420
  this.__zoom.invert(l),
2396
2421
  c.identifier
2397
2422
  ], a.touch0 ? !a.touch1 && a.touch0[2] !== l[2] && (a.touch1 = l, a.taps = 0) : (a.touch0 = l, o = !0, a.taps = 1 + !!u);
2398
2423
  u &&= clearTimeout(u), o && (a.taps < 2 && (d = l[0], u = setTimeout(function() {
2399
2424
  u = null;
2400
- }, p)), ri(this), a.start());
2425
+ }, p)), ai(this), a.start());
2401
2426
  }
2402
2427
  }
2403
- function T(e, ...t) {
2428
+ function w(e, ...t) {
2404
2429
  if (this.__zooming) {
2405
2430
  var r = S(this, t).event(e), i = e.changedTouches, a = i.length, s, c, l, u;
2406
- for (X(e), s = 0; s < a; ++s) c = i[s], l = P(c, this), r.touch0 && r.touch0[2] === c.identifier ? r.touch0[0] = l : r.touch1 && r.touch1[2] === c.identifier && (r.touch1[0] = l);
2431
+ for (Z(e), s = 0; s < a; ++s) c = i[s], l = P(c, this), r.touch0 && r.touch0[2] === c.identifier ? r.touch0[0] = l : r.touch1 && r.touch1[2] === c.identifier && (r.touch1[0] = l);
2407
2432
  if (c = r.that.__zoom, r.touch1) {
2408
2433
  var d = r.touch0[0], f = r.touch0[1], p = r.touch1[0], m = r.touch1[1], h = (h = p[0] - d[0]) * h + (h = p[1] - d[1]) * h, g = (g = m[0] - f[0]) * g + (g = m[1] - f[1]) * g;
2409
2434
  c = v(c, Math.sqrt(h / g)), l = [(d[0] + p[0]) / 2, (d[1] + p[1]) / 2], u = [(f[0] + m[0]) / 2, (f[1] + m[1]) / 2];
@@ -2412,10 +2437,10 @@ function Ca() {
2412
2437
  r.zoom("touch", n(y(c, l, u), r.extent, o));
2413
2438
  }
2414
2439
  }
2415
- function re(e, ...t) {
2440
+ function ie(e, ...t) {
2416
2441
  if (this.__zooming) {
2417
2442
  var n = S(this, t).event(e), r = e.changedTouches, i = r.length, a, o;
2418
- for (ga(e), f && clearTimeout(f), f = setTimeout(function() {
2443
+ for (va(e), f && clearTimeout(f), f = setTimeout(function() {
2419
2444
  f = null;
2420
2445
  }, p), a = 0; a < i; ++a) o = r[a], n.touch0 && n.touch0[2] === o.identifier ? delete n.touch0 : n.touch1 && n.touch1[2] === o.identifier && delete n.touch1;
2421
2446
  if (n.touch1 && !n.touch0 && (n.touch0 = n.touch1, delete n.touch1), n.touch0) n.touch0[1] = this.__zoom.invert(n.touch0[0]);
@@ -2426,13 +2451,13 @@ function Ca() {
2426
2451
  }
2427
2452
  }
2428
2453
  return _.wheelDelta = function(e) {
2429
- return arguments.length ? (r = typeof e == "function" ? e : fa(+e), _) : r;
2454
+ return arguments.length ? (r = typeof e == "function" ? e : ma(+e), _) : r;
2430
2455
  }, _.filter = function(t) {
2431
- return arguments.length ? (e = typeof t == "function" ? t : fa(!!t), _) : e;
2456
+ return arguments.length ? (e = typeof t == "function" ? t : ma(!!t), _) : e;
2432
2457
  }, _.touchable = function(e) {
2433
- return arguments.length ? (i = typeof e == "function" ? e : fa(!!e), _) : i;
2458
+ return arguments.length ? (i = typeof e == "function" ? e : ma(!!e), _) : i;
2434
2459
  }, _.extent = function(e) {
2435
- return arguments.length ? (t = typeof e == "function" ? e : fa([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), _) : t;
2460
+ return arguments.length ? (t = typeof e == "function" ? e : ma([[+e[0][0], +e[0][1]], [+e[1][0], +e[1][1]]]), _) : t;
2436
2461
  }, _.scaleExtent = function(e) {
2437
2462
  return arguments.length ? (a[0] = +e[0], a[1] = +e[1], _) : [a[0], a[1]];
2438
2463
  }, _.translateExtent = function(e) {
@@ -2452,8 +2477,8 @@ function Ca() {
2452
2477
  return arguments.length ? (g = +e, _) : g;
2453
2478
  }, _;
2454
2479
  }
2455
- re();
2456
- var wa = (e) => ({
2480
+ ae();
2481
+ var Ea = (e) => ({
2457
2482
  left: {
2458
2483
  nodeLeftX: () => 0,
2459
2484
  nodeRightX: (e) => e.width,
@@ -2467,10 +2492,10 @@ var wa = (e) => ({
2467
2492
  linkY: (e) => e.y,
2468
2493
  linkCompactXStart: (e) => e.x + e.width / 2,
2469
2494
  linkCompactYStart: (e) => e.y + (e.compactEven ? e.height / 2 : -e.height / 2),
2470
- compactLinkMidX: (e) => e.firstCompactNode.x,
2471
- compactLinkMidY: (e, t) => e.firstCompactNode.y + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2472
- linkParentX: (e) => e.parent.x + e.parent.width,
2473
- linkParentY: (e) => e.parent.y,
2495
+ compactLinkMidX: (e) => e.firstCompactNode?.x ?? e.x,
2496
+ compactLinkMidY: (e, t) => (e.firstCompactNode?.y ?? e.y) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2497
+ linkParentX: (e) => (e.parent?.x ?? e.x) + (e.parent?.width ?? 0),
2498
+ linkParentY: (e) => e.parent?.y ?? e.y,
2474
2499
  buttonX: (e) => e.width,
2475
2500
  buttonY: (e) => e.height / 2,
2476
2501
  centerTransform: ({ rootMargin: e, centerY: t, scale: n }) => `translate(${e},${t}) scale(${n})`,
@@ -2499,8 +2524,8 @@ var wa = (e) => ({
2499
2524
  linkJoinY: (e) => e.y + e.height,
2500
2525
  linkCompactXStart: (e) => e.x + (e.compactEven ? e.width / 2 : -e.width / 2),
2501
2526
  linkCompactYStart: (e) => e.y + e.height / 2,
2502
- compactLinkMidX: (e, t) => e.firstCompactNode.x + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2503
- compactLinkMidY: (e) => e.firstCompactNode.y,
2527
+ compactLinkMidX: (e, t) => (e.firstCompactNode?.x ?? e.x) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2528
+ compactLinkMidY: (e) => e.firstCompactNode?.y ?? e.y,
2504
2529
  compactDimension: {
2505
2530
  sizeColumn: (e) => e.width,
2506
2531
  sizeRow: (e) => e.height,
@@ -2508,8 +2533,8 @@ var wa = (e) => ({
2508
2533
  },
2509
2534
  linkX: (e) => e.x,
2510
2535
  linkY: (e) => e.y,
2511
- linkParentX: (e) => e.parent.x,
2512
- linkParentY: (e) => e.parent.y + e.parent.height,
2536
+ linkParentX: (e) => e.parent?.x ?? e.x,
2537
+ linkParentY: (e) => (e.parent?.y ?? e.y) + (e.parent?.height ?? 0),
2513
2538
  buttonX: (e) => e.width / 2,
2514
2539
  buttonY: (e) => e.height,
2515
2540
  centerTransform: ({ rootMargin: e, scale: t, centerX: n }) => `translate(${n},${e}) scale(${t})`,
@@ -2530,8 +2555,8 @@ var wa = (e) => ({
2530
2555
  linkJoinY: (e) => e.y - e.height,
2531
2556
  linkCompactXStart: (e) => e.x + (e.compactEven ? e.width / 2 : -e.width / 2),
2532
2557
  linkCompactYStart: (e) => e.y - e.height / 2,
2533
- compactLinkMidX: (e, t) => e.firstCompactNode.x + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2534
- compactLinkMidY: (e) => e.firstCompactNode.y,
2558
+ compactLinkMidX: (e, t) => (e.firstCompactNode?.x ?? e.x) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2559
+ compactLinkMidY: (e) => e.firstCompactNode?.y ?? e.y,
2535
2560
  linkX: (e) => e.x,
2536
2561
  linkY: (e) => e.y,
2537
2562
  compactDimension: {
@@ -2539,8 +2564,8 @@ var wa = (e) => ({
2539
2564
  sizeRow: (e) => e.height,
2540
2565
  reverse: (e) => e
2541
2566
  },
2542
- linkParentX: (e) => e.parent.x,
2543
- linkParentY: (e) => e.parent.y - e.parent.height,
2567
+ linkParentX: (e) => e.parent?.x ?? e.x,
2568
+ linkParentY: (e) => (e.parent?.y ?? e.y) - (e.parent?.height ?? 0),
2544
2569
  buttonX: (e) => e.width / 2,
2545
2570
  buttonY: () => 0,
2546
2571
  centerTransform: ({ rootMargin: e, scale: t, centerX: n, chartHeight: r }) => `translate(${n},${r - e}) scale(${t})`,
@@ -2563,14 +2588,14 @@ var wa = (e) => ({
2563
2588
  linkJoinY: (e) => e.y,
2564
2589
  linkX: (e) => e.x,
2565
2590
  linkY: (e) => e.y,
2566
- linkParentX: (e) => e.parent.x - e.parent.width,
2567
- linkParentY: (e) => e.parent.y,
2591
+ linkParentX: (e) => (e.parent?.x ?? e.x) - (e.parent?.width ?? 0),
2592
+ linkParentY: (e) => e.parent?.y ?? e.y,
2568
2593
  buttonX: () => 0,
2569
2594
  buttonY: (e) => e.height / 2,
2570
2595
  linkCompactXStart: (e) => e.x - e.width / 2,
2571
2596
  linkCompactYStart: (e) => e.y + (e.compactEven ? e.height / 2 : -e.height / 2),
2572
- compactLinkMidX: (e) => e.firstCompactNode.x,
2573
- compactLinkMidY: (e, t) => e.firstCompactNode.y + e.firstCompactNode.flexCompactDim[0] / 4 + t.compactMarginPair(e) / 4,
2597
+ compactLinkMidX: (e) => e.firstCompactNode?.x ?? e.x,
2598
+ compactLinkMidY: (e, t) => (e.firstCompactNode?.y ?? e.y) + (e.firstCompactNode?.flexCompactDim?.[0] ?? 0) / 4 + t.compactMarginPair(e) / 4,
2574
2599
  centerTransform: ({ rootMargin: e, centerY: t, scale: n, chartWidth: r }) => `translate(${r - e},${t}) scale(${n})`,
2575
2600
  nodeFlexSize: ({ height: e, width: t, siblingsMargin: n, childrenMargin: r, config: i, node: a }) => i.compact && a.flexCompactDim ? [a.flexCompactDim[0], a.flexCompactDim[1]] : [e + n, t + r],
2576
2601
  compactDimension: {
@@ -2587,7 +2612,7 @@ var wa = (e) => ({
2587
2612
  nodeUpdateTransform: ({ x: e, y: t, width: n, height: r }) => `translate(${e - n},${t - r / 2})`
2588
2613
  }
2589
2614
  });
2590
- function Ta(e, t, n) {
2615
+ function Da(e, t, n) {
2591
2616
  let r = e.x, i = e.y, a = t.x, o = t.y, s = n && n.x != null ? n.x : r, c = n && n.y != null ? n.y : i, l = a - r < 0 ? -1 : 1, u = o - i < 0 ? -1 : 1, d = Math.abs(a - r) / 2 < 35 ? Math.abs(a - r) / 2 : 35;
2592
2617
  d = Math.abs(o - i) / 2 < d ? Math.abs(o - i) / 2 : d;
2593
2618
  let f = Math.abs(a - r) / 2 - d;
@@ -2605,7 +2630,7 @@ function Ta(e, t, n) {
2605
2630
  ${a - f * l} ${o}
2606
2631
  L ${a} ${o}`;
2607
2632
  }
2608
- function Ea(e, t, n, r = { sy: 0 }) {
2633
+ function Oa(e, t, n, r = { sy: 0 }) {
2609
2634
  let i = e.x, a = e.y, o = t.x, s = t.y, c = n && n.x != null ? n.x : i, l = n && n.y != null ? n.y : a, u = o - i < 0 ? -1 : 1, d = s - a < 0 ? -1 : 1;
2610
2635
  a += r.sy;
2611
2636
  let f = Math.abs(o - i) / 2 < 15 ? Math.abs(o - i) / 2 : 15;
@@ -2621,7 +2646,7 @@ function Ea(e, t, n, r = { sy: 0 }) {
2621
2646
  C ${o} ${a + p * d + f * d} ${o} ${a + p * d + f * d} ${o} ${s - p * d}
2622
2647
  L ${o} ${s}`;
2623
2648
  }
2624
- function Da({ node: e, config: t }) {
2649
+ function ka({ node: e, config: t }) {
2625
2650
  return e.data?.id === "__root__" ? null : `<div class="button-content"> ${{
2626
2651
  left: (t) => t ? `<div style="display:flex;"><span style="align-items:center;display:flex;"><svg width="8" height="8" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2627
2652
  <path d="M14.283 3.50094L6.51 11.4749C6.37348 11.615 6.29707 11.8029 6.29707 11.9984C6.29707 12.194 6.37348 12.3819 6.51 12.5219L14.283 20.4989C14.3466 20.5643 14.4226 20.6162 14.5066 20.6516C14.5906 20.6871 14.6808 20.7053 14.772 20.7053C14.8632 20.7053 14.9534 20.6871 15.0374 20.6516C15.1214 20.6162 15.1974 20.5643 15.261 20.4989C15.3918 20.365 15.4651 20.1852 15.4651 19.9979C15.4651 19.8107 15.3918 19.6309 15.261 19.4969L7.9515 11.9984L15.261 4.50144C15.3914 4.36756 15.4643 4.18807 15.4643 4.00119C15.4643 3.81431 15.3914 3.63482 15.261 3.50094C15.1974 3.43563 15.1214 3.38371 15.0374 3.34827C14.9534 3.31282 14.8632 3.29456 14.772 3.29456C14.6808 3.29456 14.5906 3.31282 14.5066 3.34827C14.4226 3.38371 14.3466 3.43563 14.283 3.50094V3.50094Z" fill="#716E7B" stroke="#716E7B"/>
@@ -2649,8 +2674,9 @@ function Da({ node: e, config: t }) {
2649
2674
  `
2650
2675
  }[t.layout](e.children)} </div>`;
2651
2676
  }
2652
- function Oa(e, t, n, r) {
2653
- let i = r.pagingStep(e.parent), a = e.parent.data._pagingStep, o = e.parent.data._directSubordinatesPaging - a;
2677
+ function Aa(e, t, n, r) {
2678
+ if (!e.parent) return "";
2679
+ let i = r.pagingStep(e.parent), a = e.parent.data._pagingStep ?? 0, o = (e.parent.data._directSubordinatesPaging ?? 0) - a;
2654
2680
  return `
2655
2681
  <div style="margin-top:90px;">
2656
2682
  <div style="display:flex;width:170px;border-radius:20px;padding:5px 15px; padding-bottom:4px;;background-color:#E5E9F2">
@@ -2661,7 +2687,7 @@ function Oa(e, t, n, r) {
2661
2687
  </div>
2662
2688
  `;
2663
2689
  }
2664
- var ka = () => {
2690
+ var ja = () => {
2665
2691
  let e = {
2666
2692
  svgWidth: 800,
2667
2693
  svgHeight: window.innerHeight - 100,
@@ -2695,13 +2721,14 @@ var ka = () => {
2695
2721
  pagingStep: () => 5,
2696
2722
  minPagingVisibleNodes: () => 2e3,
2697
2723
  scaleExtent: [.05, 2.5],
2724
+ minFitScale: 0,
2698
2725
  duration: 400,
2699
2726
  setActiveNodeCentered: !0,
2700
2727
  layout: "top",
2701
2728
  compact: !0,
2702
2729
  gridEnabled: !1,
2703
2730
  gridRows: 0,
2704
- createZoom: () => Ca(),
2731
+ createZoom: () => Ta(),
2705
2732
  onZoomStart: () => {},
2706
2733
  onZoom: () => {},
2707
2734
  onZoomEnd: () => {},
@@ -2715,10 +2742,10 @@ var ka = () => {
2715
2742
  onNodeParentChange() {},
2716
2743
  onExpandOrCollapse: (e) => e,
2717
2744
  nodeContent: (e) => e.id === "__root__" ? null : "<div class=\"node-content\"></div>",
2718
- buttonContent: Da,
2719
- pagingButton: Oa,
2745
+ buttonContent: ka,
2746
+ pagingButton: Aa,
2720
2747
  nodeUpdate: function() {
2721
- N(this).select(".node-rect").attr("stroke", void 0).attr("stroke-width", void 0);
2748
+ N(this).select(".node-rect").attr("stroke", null).attr("stroke-width", null);
2722
2749
  },
2723
2750
  nodeEnter: (e) => e,
2724
2751
  nodeExit: (e) => e,
@@ -2727,137 +2754,154 @@ var ka = () => {
2727
2754
  N(this).style("stroke-width", "var(--border-hover-width)").style("stroke", "var(--border-hover-color)");
2728
2755
  return;
2729
2756
  }
2730
- N(this).style("stroke", void 0).style("stroke-width", void 0), e.data._upToTheRootHighlighted && N(this).raise();
2757
+ N(this).style("stroke", null).style("stroke-width", null), e.data._upToTheRootHighlighted && N(this).raise();
2731
2758
  },
2732
- hdiagonal: Ta,
2733
- diagonal: Ea,
2734
- linkGroupArc: oe().x((e) => e.x).y((e) => e.y)
2735
- };
2736
- return e.layoutBindings = wa(e), e;
2737
- }, Aa = (e, n, a) => {
2738
- let o = (0, O.useRef)(e.treeChartSettings?.transform), s = (0, O.useRef)(null);
2739
- return s.current = (n) => {
2740
- let o = ka(), s = n.treeOptions, c = {
2741
- linkUpdate: o.linkUpdate,
2742
- getButtonContent: o.buttonContent,
2743
- ...Cr[s.layoutPreset]
2744
- }, l = c.sizes ? c.sizes(e) : {}, u = {
2745
- ...r,
2759
+ hdiagonal: Da,
2760
+ diagonal: Oa,
2761
+ linkGroupArc: ce().x((e) => e.x).y((e) => e.y)
2762
+ };
2763
+ return e.layoutBindings = Ea(e), e;
2764
+ }, Ma = (e) => Math.min(1, 9 / e), Na = (e, t, n, r) => {
2765
+ if (r === void 0 || t - e <= n) return (e + t) / 2;
2766
+ let i = n / 2;
2767
+ return Math.min(t - i, Math.max(e + i, r));
2768
+ }, Pa = ({ bounds: e, viewport: t, scaleExtent: n, minScale: r = 0, scale: i, focus: a }) => {
2769
+ let { x0: o, x1: s, y0: c, y1: l } = e, { width: u, height: d } = t, [f, p] = n, m = 1 / Math.max((s - o) / u, (l - c) / d), h = i ?? Math.min(p, Math.max(Math.max(f, Math.min(r, p)), m));
2770
+ return {
2771
+ k: h,
2772
+ x: u / 2 - h * Na(o, s, u / h, a?.x),
2773
+ y: d / 2 - h * Na(c, l, d / h, a?.y)
2774
+ };
2775
+ }, Fa = (e, t, r) => {
2776
+ let i = (0, D.useRef)(e.treeChartSettings?.transform), a = (0, D.useRef)(null);
2777
+ return a.current = (t) => {
2778
+ let i = ja(), a = t.treeOptions, o = {
2779
+ linkUpdate: i.linkUpdate,
2780
+ getButtonContent: i.buttonContent,
2781
+ ...Er[a.layoutPreset]
2782
+ }, s = o.sizes ? o.sizes(e) : {}, l = {
2783
+ ...o.labelStyle,
2784
+ ...e.treeChartSettings?.nodeLayout?.labelStyle,
2785
+ fontSize: e.treeChartSettings?.nodeLayout?.labelStyle?.fontSize ?? o.labelStyle?.fontSize
2786
+ }, d = {
2787
+ ...n,
2746
2788
  ...e.treeChartSettings?.nodeLayout?.border
2747
2789
  };
2748
- u.enabled === !1 && (u.borderWidth = 0);
2749
- let d = {
2750
- ...i,
2790
+ d.enabled === !1 && (d.borderWidth = 0);
2791
+ let f = {
2792
+ ...u,
2751
2793
  ...e.treeChartSettings?.nodeLayout.hoverStyle
2752
- }, f = d.enabled ? d.borderWidth : 0;
2753
- a.nodeWidth((e) => (s.nodeWidth ? s.nodeWidth : typeof c.width == "function" ? c.width(e) : c.width) + (u.borderWidth ?? 0) * 2).nodeHeight((e) => (e.id === "__root__" ? 0 : typeof c.height == "function" ? c.height(e, l) : c.height) + (u.borderWidth ?? 0) * 2).nodeDefaultBackground(e.treeChartSettings?.nodeLayout?.backgroundColor ?? t.backgroundColor).compact(s.compact).layout(s.directionOrigin).padding({
2754
- top: f,
2755
- right: f,
2756
- bottom: f,
2757
- left: f
2758
- }).gridEnabled(s.gridLayoutEnabled).gridRows(s.gridLayoutRows).forceAutoFit(s.forceAutoFit).setActiveNodeCentered(!s.forceAutoFit).duration(s.animate === !1 ? 0 : 400).root(n.root).linkUpdate(c.linkUpdate).buttonContent(c.getButtonContent).container(n.container).nodeContent((e) => c.getNodeContent(e, { config: a.getConfig() })).render({
2759
- zoomToFit: n.zoomToFit ?? !1,
2760
- transform: n.transform
2794
+ }, p = f.enabled ? f.borderWidth : 0;
2795
+ r.nodeWidth((e) => (a.nodeWidth ? a.nodeWidth : typeof o.width == "function" ? o.width(e) : o.width) + (d.borderWidth ?? 0) * 2).nodeHeight((e) => (e.id === "__root__" ? 0 : typeof o.height == "function" ? o.height(e, s) : o.height) + (d.borderWidth ?? 0) * 2).nodeDefaultBackground(e.treeChartSettings?.nodeLayout?.backgroundColor ?? c.backgroundColor).compact(a.compact).layout(a.directionOrigin).padding({
2796
+ top: p,
2797
+ right: p,
2798
+ bottom: p,
2799
+ left: p
2800
+ }).gridEnabled(a.gridLayoutEnabled).gridRows(a.gridLayoutRows).forceAutoFit(a.forceAutoFit).minFitScale(a.keepFitReadable ? Ma(T(l.fontSize)) : 0).setActiveNodeCentered(!a.forceAutoFit).duration(a.animate === !1 ? 0 : 400).root(t.root).linkUpdate(o.linkUpdate).buttonContent(o.getButtonContent).container(t.container).nodeContent((e) => o.getNodeContent(e, { config: r.getConfig() })).render({
2801
+ zoomToFit: t.zoomToFit ?? !1,
2802
+ transform: t.transform
2761
2803
  });
2762
- }, (0, O.useCallback)((e, t) => {
2763
- s.current({
2804
+ }, (0, D.useCallback)((e, n) => {
2805
+ !e || !t.current || a.current?.({
2764
2806
  root: e,
2765
- container: n.current,
2766
- treeOptions: t,
2807
+ container: t.current,
2808
+ treeOptions: n,
2767
2809
  zoomToFit: !0,
2768
- transform: o.current ?? void 0
2810
+ transform: i.current ?? void 0
2769
2811
  });
2770
2812
  }, []);
2771
- }, ja = {
2813
+ }, Ia = {
2772
2814
  directionOrigin: "top",
2773
2815
  compact: !1,
2774
- layoutPreset: p.Basic,
2816
+ layoutPreset: d.Basic,
2775
2817
  forceAutoFit: !1,
2818
+ keepFitReadable: !0,
2776
2819
  animate: !0,
2777
2820
  interactive: !0,
2778
2821
  gridLayoutEnabled: !1,
2779
2822
  gridLayoutRows: 0
2780
- }, Ma = (e, t) => {
2781
- let n = {
2782
- directionOrigin: e.treeChartSettings?.directionOrigin ?? ja.directionOrigin,
2783
- compact: e.treeChartSettings?.compact ?? ja.compact,
2784
- layoutPreset: e.treeChartSettings?.nodeLayout?.preset ?? ja.layoutPreset,
2785
- forceAutoFit: e.treeChartSettings?.forceAutoFit ?? ja.forceAutoFit,
2823
+ }, La = (e, t) => {
2824
+ let n = t?.isPrintMode ?? !1, r = e.treeChartSettings?.forceAutoFit ?? Ia.forceAutoFit, i = {
2825
+ directionOrigin: e.treeChartSettings?.directionOrigin ?? Ia.directionOrigin,
2826
+ compact: e.treeChartSettings?.compact ?? Ia.compact,
2827
+ layoutPreset: e.treeChartSettings?.nodeLayout?.preset ?? Ia.layoutPreset,
2828
+ forceAutoFit: r,
2829
+ keepFitReadable: !r && !n,
2786
2830
  nodeWidth: e.treeChartSettings?.nodeLayout?.width,
2787
- animate: !(t?.isPrintMode ?? !1),
2831
+ animate: !n,
2788
2832
  interactive: t.disable?.interactions !== !0,
2789
2833
  gridLayoutEnabled: e.treeChartSettings.gridLayout?.enabled ?? !1,
2790
2834
  gridLayoutRows: e.treeChartSettings.gridLayout?.rows ?? 0
2791
2835
  };
2792
2836
  return {
2793
- treeSettings: n,
2794
- layout: Cr[n.layoutPreset || p.Basic]
2837
+ treeSettings: i,
2838
+ layout: Er[i.layoutPreset || d.Basic]
2795
2839
  };
2796
2840
  };
2797
- function Na(e) {
2841
+ function Ra(e) {
2798
2842
  var t = 0, n = e.children, r = n && n.length;
2799
2843
  if (!r) t = 1;
2800
2844
  else for (; --r >= 0;) t += n[r].value;
2801
2845
  e.value = t;
2802
2846
  }
2803
- function Pa() {
2804
- return this.eachAfter(Na);
2847
+ function za() {
2848
+ return this.eachAfter(Ra);
2805
2849
  }
2806
- function Fa(e) {
2850
+ function Ba(e) {
2807
2851
  var t = this, n, r = [t], i, a, o;
2808
2852
  do
2809
2853
  for (n = r.reverse(), r = []; t = n.pop();) if (e(t), i = t.children, i) for (a = 0, o = i.length; a < o; ++a) r.push(i[a]);
2810
2854
  while (r.length);
2811
2855
  return this;
2812
2856
  }
2813
- function Ia(e) {
2857
+ function Va(e) {
2814
2858
  for (var t = this, n = [t], r, i; t = n.pop();) if (e(t), r = t.children, r) for (i = r.length - 1; i >= 0; --i) n.push(r[i]);
2815
2859
  return this;
2816
2860
  }
2817
- function La(e) {
2861
+ function Ha(e) {
2818
2862
  for (var t = this, n = [t], r = [], i, a, o; t = n.pop();) if (r.push(t), i = t.children, i) for (a = 0, o = i.length; a < o; ++a) n.push(i[a]);
2819
2863
  for (; t = r.pop();) e(t);
2820
2864
  return this;
2821
2865
  }
2822
- function Ra(e) {
2866
+ function Ua(e) {
2823
2867
  return this.eachAfter(function(t) {
2824
2868
  for (var n = +e(t.data) || 0, r = t.children, i = r && r.length; --i >= 0;) n += r[i].value;
2825
2869
  t.value = n;
2826
2870
  });
2827
2871
  }
2828
- function za(e) {
2872
+ function Wa(e) {
2829
2873
  return this.eachBefore(function(t) {
2830
2874
  t.children && t.children.sort(e);
2831
2875
  });
2832
2876
  }
2833
- function Ba(e) {
2834
- for (var t = this, n = Va(t, e), r = [t]; t !== n;) t = t.parent, r.push(t);
2877
+ function Ga(e) {
2878
+ for (var t = this, n = Ka(t, e), r = [t]; t !== n;) t = t.parent, r.push(t);
2835
2879
  for (var i = r.length; e !== n;) r.splice(i, 0, e), e = e.parent;
2836
2880
  return r;
2837
2881
  }
2838
- function Va(e, t) {
2882
+ function Ka(e, t) {
2839
2883
  if (e === t) return e;
2840
2884
  var n = e.ancestors(), r = t.ancestors(), i = null;
2841
2885
  for (e = n.pop(), t = r.pop(); e === t;) i = e, e = n.pop(), t = r.pop();
2842
2886
  return i;
2843
2887
  }
2844
- function Ha() {
2888
+ function qa() {
2845
2889
  for (var e = this, t = [e]; e = e.parent;) t.push(e);
2846
2890
  return t;
2847
2891
  }
2848
- function Ua() {
2892
+ function Ja() {
2849
2893
  var e = [];
2850
2894
  return this.each(function(t) {
2851
2895
  e.push(t);
2852
2896
  }), e;
2853
2897
  }
2854
- function Wa() {
2898
+ function Ya() {
2855
2899
  var e = [];
2856
2900
  return this.eachBefore(function(t) {
2857
2901
  t.children || e.push(t);
2858
2902
  }), e;
2859
2903
  }
2860
- function Ga() {
2904
+ function Xa() {
2861
2905
  var e = this, t = [];
2862
2906
  return e.each(function(n) {
2863
2907
  n !== e && t.push({
@@ -2866,47 +2910,47 @@ function Ga() {
2866
2910
  });
2867
2911
  }), t;
2868
2912
  }
2869
- function Ka(e, t) {
2870
- var n = new Za(e), r = +e.value && (n.value = e.value), i, a = [n], o, s, c, l;
2871
- for (t ??= Ja; i = a.pop();) if (r && (i.value = +i.data.value), (s = t(i.data)) && (l = s.length)) for (i.children = Array(l), c = l - 1; c >= 0; --c) a.push(o = i.children[c] = new Za(s[c])), o.parent = i, o.depth = i.depth + 1;
2872
- return n.eachBefore(Xa);
2913
+ function Za(e, t) {
2914
+ var n = new no(e), r = +e.value && (n.value = e.value), i, a = [n], o, s, c, l;
2915
+ for (t ??= $a; i = a.pop();) if (r && (i.value = +i.data.value), (s = t(i.data)) && (l = s.length)) for (i.children = Array(l), c = l - 1; c >= 0; --c) a.push(o = i.children[c] = new no(s[c])), o.parent = i, o.depth = i.depth + 1;
2916
+ return n.eachBefore(to);
2873
2917
  }
2874
- function qa() {
2875
- return Ka(this).eachBefore(Ya);
2918
+ function Qa() {
2919
+ return Za(this).eachBefore(eo);
2876
2920
  }
2877
- function Ja(e) {
2921
+ function $a(e) {
2878
2922
  return e.children;
2879
2923
  }
2880
- function Ya(e) {
2924
+ function eo(e) {
2881
2925
  e.data = e.data.data;
2882
2926
  }
2883
- function Xa(e) {
2927
+ function to(e) {
2884
2928
  var t = 0;
2885
2929
  do
2886
2930
  e.height = t;
2887
2931
  while ((e = e.parent) && e.height < ++t);
2888
2932
  }
2889
- function Za(e) {
2933
+ function no(e) {
2890
2934
  this.data = e, this.depth = this.height = 0, this.parent = null;
2891
2935
  }
2892
- Za.prototype = Ka.prototype = {
2893
- constructor: Za,
2894
- count: Pa,
2895
- each: Fa,
2896
- eachAfter: La,
2897
- eachBefore: Ia,
2898
- sum: Ra,
2899
- sort: za,
2900
- path: Ba,
2901
- ancestors: Ha,
2902
- descendants: Ua,
2903
- leaves: Wa,
2904
- links: Ga,
2905
- copy: qa
2936
+ no.prototype = Za.prototype = {
2937
+ constructor: no,
2938
+ count: za,
2939
+ each: Ba,
2940
+ eachAfter: Ha,
2941
+ eachBefore: Va,
2942
+ sum: Ua,
2943
+ sort: Wa,
2944
+ path: Ga,
2945
+ ancestors: qa,
2946
+ descendants: Ja,
2947
+ leaves: Ya,
2948
+ links: Xa,
2949
+ copy: Qa
2906
2950
  };
2907
- var Qa = u();
2908
- Te();
2909
- var { version: $a } = {
2951
+ var ro = ie();
2952
+ Oe();
2953
+ var { version: io } = {
2910
2954
  name: "d3-flextree",
2911
2955
  version: "2.1.2",
2912
2956
  main: "build/d3-flextree.js",
@@ -2967,13 +3011,13 @@ var { version: $a } = {
2967
3011
  "rollup-plugin-uglify": "^3.0.0",
2968
3012
  "uglify-es": "^3.3.9"
2969
3013
  }
2970
- }, eo = Object.freeze({
3014
+ }, ao = Object.freeze({
2971
3015
  children: (e) => e.children,
2972
3016
  nodeSize: (e) => e.data.size,
2973
3017
  spacing: 0
2974
3018
  });
2975
- function to(e) {
2976
- let t = Object.assign({}, eo, e);
3019
+ function oo(e) {
3020
+ let t = Object.assign({}, ao, e);
2977
3021
  function n(e) {
2978
3022
  let n = t[e];
2979
3023
  return typeof n == "function" ? n : () => n;
@@ -2984,7 +3028,7 @@ function to(e) {
2984
3028
  }
2985
3029
  function i() {
2986
3030
  let e = n("nodeSize"), t = n("spacing");
2987
- return class n extends Ka.prototype.constructor {
3031
+ return class n extends Za.prototype.constructor {
2988
3032
  constructor(e) {
2989
3033
  super(e);
2990
3034
  }
@@ -3097,7 +3141,7 @@ function to(e) {
3097
3141
  this.data.y = e;
3098
3142
  }
3099
3143
  update() {
3100
- return no(this), ro(this), this;
3144
+ return so(this), co(this), this;
3101
3145
  }
3102
3146
  };
3103
3147
  }
@@ -3141,52 +3185,52 @@ function to(e) {
3141
3185
  }
3142
3186
  }), r;
3143
3187
  }
3144
- to.version = $a;
3145
- var no = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3188
+ oo.version = io;
3189
+ var so = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3146
3190
  let [r, i] = t;
3147
- no(n, e.y + e.ySize);
3191
+ so(n, e.y + e.ySize);
3148
3192
  let a = (r === 0 ? n.lExt : n.rExt).bottom;
3149
- r !== 0 && ao(e, r, i);
3150
- let o = mo(a, r, i);
3193
+ r !== 0 && uo(e, r, i);
3194
+ let o = yo(a, r, i);
3151
3195
  return [r + 1, o];
3152
- }, [0, null]), io(e), po(e), e), ro = (e, t, n) => {
3196
+ }, [0, null]), lo(e), vo(e), e), co = (e, t, n) => {
3153
3197
  t === void 0 && (t = -e.relX - e.prelim, n = 0);
3154
3198
  let r = t + e.relX;
3155
- return e.relX = r + e.prelim - n, e.prelim = 0, e.x = n + e.relX, (e.children || []).forEach((t) => ro(t, r, e.x)), e;
3156
- }, io = (e) => {
3199
+ return e.relX = r + e.prelim - n, e.prelim = 0, e.x = n + e.relX, (e.children || []).forEach((t) => co(t, r, e.x)), e;
3200
+ }, lo = (e) => {
3157
3201
  (e.children || []).reduce((e, t) => {
3158
3202
  let [n, r] = e, i = n + t.shift, a = r + i + t.change;
3159
3203
  return t.relX += a, [i, a];
3160
3204
  }, [0, 0]);
3161
- }, ao = (e, t, n) => {
3205
+ }, uo = (e, t, n) => {
3162
3206
  let r = e.children[t - 1], i = e.children[t], a = r, o = r.relX, s = i, c = i.relX, l = !0;
3163
3207
  for (; a && s;) {
3164
3208
  a.bottom > n.lowY && (n = n.next);
3165
3209
  let r = o + a.prelim - (c + s.prelim) + a.xSize / 2 + s.xSize / 2 + a.spacing(s);
3166
- (r > 0 || r < 0 && l) && (c += r, oo(i, r), so(e, t, n.index, r)), l = !1;
3210
+ (r > 0 || r < 0 && l) && (c += r, fo(i, r), po(e, t, n.index, r)), l = !1;
3167
3211
  let u = a.bottom, d = s.bottom;
3168
- u <= d && (a = lo(a), a && (o += a.relX)), u >= d && (s = co(s), s && (c += s.relX));
3212
+ u <= d && (a = ho(a), a && (o += a.relX)), u >= d && (s = mo(s), s && (c += s.relX));
3169
3213
  }
3170
- !a && s ? uo(e, t, s, c) : a && !s && fo(e, t, a, o);
3171
- }, oo = (e, t) => {
3214
+ !a && s ? go(e, t, s, c) : a && !s && _o(e, t, a, o);
3215
+ }, fo = (e, t) => {
3172
3216
  e.relX += t, e.lExtRelX += t, e.rExtRelX += t;
3173
- }, so = (e, t, n, r) => {
3217
+ }, po = (e, t, n, r) => {
3174
3218
  let i = e.children[t], a = t - n;
3175
3219
  if (a > 1) {
3176
3220
  let t = r / a;
3177
3221
  e.children[n + 1].shift += t, i.shift -= t, i.change -= r - t;
3178
3222
  }
3179
- }, co = (e) => e.hasChildren ? e.firstChild : e.lThr, lo = (e) => e.hasChildren ? e.lastChild : e.rThr, uo = (e, t, n, r) => {
3223
+ }, mo = (e) => e.hasChildren ? e.firstChild : e.lThr, ho = (e) => e.hasChildren ? e.lastChild : e.rThr, go = (e, t, n, r) => {
3180
3224
  let i = e.firstChild, a = i.lExt, o = e.children[t];
3181
3225
  a.lThr = n;
3182
3226
  let s = r - n.relX - i.lExtRelX;
3183
3227
  a.relX += s, a.prelim -= s, i.lExt = o.lExt, i.lExtRelX = o.lExtRelX;
3184
- }, fo = (e, t, n, r) => {
3228
+ }, _o = (e, t, n, r) => {
3185
3229
  let i = e.children[t], a = i.rExt, o = e.children[t - 1];
3186
3230
  a.rThr = n;
3187
3231
  let s = r - n.relX - i.rExtRelX;
3188
3232
  a.relX += s, a.prelim -= s, i.rExt = o.rExt, i.rExtRelX = o.rExtRelX;
3189
- }, po = (e) => {
3233
+ }, vo = (e) => {
3190
3234
  if (e.hasChildren) {
3191
3235
  let t = e.firstChild, n = e.lastChild, r = (t.prelim + t.relX - t.xSize / 2 + n.relX + n.prelim + n.xSize / 2) / 2;
3192
3236
  Object.assign(e, {
@@ -3197,7 +3241,7 @@ var no = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3197
3241
  rExtRelX: n.rExtRelX
3198
3242
  });
3199
3243
  }
3200
- }, mo = (e, t, n) => {
3244
+ }, yo = (e, t, n) => {
3201
3245
  for (; n !== null && e >= n.lowY;) n = n.next;
3202
3246
  return {
3203
3247
  lowY: e,
@@ -3205,22 +3249,25 @@ var no = (e, t = 0) => (e.y = t, (e.children || []).reduce((t, n) => {
3205
3249
  next: n
3206
3250
  };
3207
3251
  };
3208
- re();
3209
- var Z = {
3252
+ ae();
3253
+ var Q = {
3210
3254
  selection: M,
3211
3255
  select: N,
3212
- max: Ce,
3213
- min: Ee,
3214
- sum: we,
3215
- cumsum: De,
3216
- tree: Qe,
3217
- stratify: Be,
3218
- zoom: Ca,
3219
- zoomIdentity: ma,
3220
- linkHorizontal: oe,
3221
- flextree: to
3222
- }, ho = class {
3256
+ max: Ee,
3257
+ min: ke,
3258
+ sum: De,
3259
+ cumsum: Ae,
3260
+ tree: nt,
3261
+ stratify: We,
3262
+ zoom: Ta,
3263
+ zoomIdentity: ga,
3264
+ linkHorizontal: ce,
3265
+ flextree: oo
3266
+ }, bo = class {
3223
3267
  stateInternal = {
3268
+ allNodes: [],
3269
+ dragStartX: 0,
3270
+ dragStartY: 0,
3224
3271
  root: null,
3225
3272
  lastTransform: {
3226
3273
  x: 0,
@@ -3231,17 +3278,15 @@ var Z = {
3231
3278
  };
3232
3279
  getConfig;
3233
3280
  constructor() {
3234
- let e = ka();
3281
+ let e = ja();
3235
3282
  this.getConfig = () => e, Object.keys(e).forEach((t) => {
3236
- this[t] = function(n) {
3237
- if (arguments.length) e[t] = n;
3238
- else return e[t];
3239
- return this;
3240
- };
3283
+ Object.assign(this, { [t]: function(...n) {
3284
+ return n.length ? (e[t] = n[0], this) : e[t];
3285
+ } });
3241
3286
  }), this.initializeEnterExitUpdatePattern(), this.extendHierarchyNodePrototype();
3242
3287
  }
3243
3288
  init() {
3244
- let e = this.getChartState(), t = this.getConfig(), n = Z.select(t.container), r = n.node().getBoundingClientRect();
3289
+ let e = this.getChartState(), t = this.getConfig(), n = Q.select(t.container), r = t.container.getBoundingClientRect();
3245
3290
  e.containerRect = r;
3246
3291
  let i = n.patternify({
3247
3292
  tag: "svg",
@@ -3267,10 +3312,10 @@ var Z = {
3267
3312
  o &&= (t.onNodeLeave(o), null);
3268
3313
  }).on("mousemove", (e) => {
3269
3314
  let n = e.target.closest("g.node"), r = null;
3270
- n && ([...e.target.classList].includes("node-button-foreign-object") || (r = Z.select(n).datum(), r.parent || (r = null))), o && o !== r && t.onNodeLeave(o), r && o !== r && t.onNodeHover(r), o = r;
3315
+ n && ([...e.target.classList].includes("node-button-foreign-object") || (r = Q.select(n).datum(), r.parent || (r = null))), o && o !== r && t.onNodeLeave(o), r && o !== r && t.onNodeHover(r), o = r;
3271
3316
  }), e.chart = a;
3272
- let s = { zoom: null }, c = !1;
3273
- s.zoom = t.createZoom().clickDistance(10).on("start", (e) => {
3317
+ let s = { zoom: t.createZoom() }, c = !1;
3318
+ s.zoom = s.zoom.clickDistance(10).on("start", (e) => {
3274
3319
  t.onZoomStart(e);
3275
3320
  }).on("end", (n) => {
3276
3321
  c && (e.userTransform = {
@@ -3286,7 +3331,8 @@ var Z = {
3286
3331
  let l = i.on("mousedown.zoom");
3287
3332
  i.on("mousedown.zoom", null), i.on("mousedown.zoom", (e) => {
3288
3333
  c = !0, setTimeout(() => {
3289
- l?.call(i.node(), e);
3334
+ let t = i.node();
3335
+ t && l?.call(t, e, void 0);
3290
3336
  }, 0);
3291
3337
  });
3292
3338
  }
@@ -3294,13 +3340,13 @@ var Z = {
3294
3340
  return this.stateInternal;
3295
3341
  }
3296
3342
  initializeEnterExitUpdatePattern() {
3297
- Z.selection.prototype.patternify = function(e) {
3298
- let t = e.selector, n = e.tag, r = e.data || [t], i = this.selectAll("." + t).data(r, (e, t) => typeof e == "object" && e.id ? e.id : t);
3343
+ Q.selection.prototype.patternify = function(e) {
3344
+ let t = e.selector, n = e.tag, r = e.data ?? [t], i = this.selectAll("." + t).data(r, (e, t) => e && typeof e == "object" && "id" in e && typeof e.id == "string" ? e.id : t);
3299
3345
  return i.exit().remove(), i = i.enter().append(n).merge(i), i.attr("class", t), i;
3300
3346
  };
3301
3347
  }
3302
3348
  extendHierarchyNodePrototype() {
3303
- Oe.prototype.allDescendants || (Oe.prototype.allDescendants = function() {
3349
+ je.prototype.allDescendants || (je.prototype.allDescendants = function() {
3304
3350
  let e = [];
3305
3351
  this.each((t) => {
3306
3352
  e.push(t);
@@ -3327,13 +3373,13 @@ var Z = {
3327
3373
  render(e = {}) {
3328
3374
  let t = this.getConfig(), n = this.getChartState();
3329
3375
  if (!t.root?.children || t.root.children.length == 0) return this;
3330
- let r = Z.select(t.container).node().getBoundingClientRect();
3376
+ let r = t.container.getBoundingClientRect();
3331
3377
  if (n.containerRect = r, !r.width || !r.height) return this;
3332
3378
  let i = {
3333
3379
  chartWidth: r.width,
3334
3380
  chartHeight: r.height
3335
3381
  };
3336
- return n.calc = i, n.calc.centerX = i.chartWidth / 2, n.calc.centerY = i.chartHeight / 2, n.flexTreeLayout = to({ nodeSize: (e) => {
3382
+ n.calc = i, n.calc.centerX = i.chartWidth / 2, n.calc.centerY = i.chartHeight / 2, n.flexTreeLayout = oo({ nodeSize: (e) => {
3337
3383
  let n = t.nodeWidth(e), r = t.nodeHeight(e), i = t.siblingsMargin(e), a = t.childrenMargin(e);
3338
3384
  return t.layoutBindings[t.layout].nodeFlexSize({
3339
3385
  config: t,
@@ -3343,16 +3389,16 @@ var Z = {
3343
3389
  siblingsMargin: i,
3344
3390
  childrenMargin: a
3345
3391
  });
3346
- } }).spacing((e, n) => e.parent == n.parent ? 0 : t.neighbourMargin(e, n)), this.setLayouts(), n.svg.attr("width", r.width).attr("height", r.height), this.update(n.root, e), this;
3392
+ } }).spacing((e, n) => e.parent == n.parent ? 0 : t.neighbourMargin(e, n)), this.setLayouts();
3393
+ let a = n.svg;
3394
+ return !a || !n.root ? this : (a.attr("width", r.width).attr("height", r.height), this.update(n.root, e), this);
3347
3395
  }
3348
3396
  groupBy(e, t, n) {
3349
3397
  let r = {};
3350
3398
  return e.forEach((e) => {
3351
3399
  let n = t(e);
3352
3400
  r[n] || (r[n] = []), r[n].push(e);
3353
- }), Object.keys(r).forEach((e) => {
3354
- r[e] = n(r[e]);
3355
- }), Object.entries(r);
3401
+ }), Object.entries(r).map(([e, t]) => [e, n(t)]);
3356
3402
  }
3357
3403
  calculateCompactFlexDimensions(e) {
3358
3404
  let t = this.getConfig();
@@ -3365,7 +3411,7 @@ var Z = {
3365
3411
  n.forEach((e, t) => {
3366
3412
  t || (e.firstCompact = !0), t % 2 ? e.compactEven = !1 : e.compactEven = !0, e.row = Math.floor(t / 2);
3367
3413
  });
3368
- let r = Z.max(n.filter((e) => e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), i = Z.max(n.filter((e) => !e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), a = Math.max(r, i) * 2, o = this.groupBy(n, (e) => e.row, (e) => Z.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e) + t.compactMarginBetween())), s = Z.sum(o.map((e) => e[1]));
3414
+ let r = Q.max(n.filter((e) => e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), i = Q.max(n.filter((e) => !e.compactEven), t.layoutBindings[t.layout].compactDimension.sizeColumn), a = Math.max(r ?? 0, i ?? 0) * 2, o = this.groupBy(n, (e) => e.row, (e) => Q.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e) + t.compactMarginBetween()) ?? 0), s = Q.sum(o.map((e) => e[1]));
3369
3415
  n.forEach((e) => {
3370
3416
  e.firstCompactNode = n[0], e.firstCompact ? e.flexCompactDim = [a + t.compactMarginPair(e), s - t.compactMarginBetween()] : e.flexCompactDim = [0, 0];
3371
3417
  }), e.flexCompactDim = null;
@@ -3377,17 +3423,18 @@ var Z = {
3377
3423
  e.eachBefore((e) => {
3378
3424
  if (e.children) {
3379
3425
  let n = e.children.filter((e) => e.flexCompactDim), r = n[0];
3380
- if (!r) return;
3426
+ if (!r?.flexCompactDim) return;
3427
+ let i = r.flexCompactDim[0];
3381
3428
  n.forEach((e, n) => {
3382
- n == 0 && (r.x -= r.flexCompactDim[0] / 2), n & n % 2 - 1 ? e.x = r.x + r.flexCompactDim[0] * .25 - t.compactMarginPair(e) / 4 : n && (e.x = r.x + r.flexCompactDim[0] * .75 + t.compactMarginPair(e) / 4);
3429
+ n == 0 && (r.x -= i / 2), n & n % 2 - 1 ? e.x = r.x + i * .25 - t.compactMarginPair(e) / 4 : n && (e.x = r.x + i * .75 + t.compactMarginPair(e) / 4);
3383
3430
  });
3384
- let i = r.x + r.flexCompactDim[0] * .5;
3385
- r.x = r.x + r.flexCompactDim[0] * .25 - t.compactMarginPair(r) / 4;
3386
- let a = e.x - i;
3387
- Math.abs(a) < 10 && n.forEach((e) => e.x += a);
3388
- let o = this.groupBy(n, (e) => e.row, (e) => Z.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e))), s = Z.cumsum(o.map((e) => e[1] + t.compactMarginBetween()));
3431
+ let a = r.x + i * .5;
3432
+ r.x = r.x + i * .25 - t.compactMarginPair(r) / 4;
3433
+ let o = e.x - a;
3434
+ Math.abs(o) < 10 && n.forEach((e) => e.x += o);
3435
+ let s = this.groupBy(n, (e) => e.row, (e) => Q.max(e, (e) => t.layoutBindings[t.layout].compactDimension.sizeRow(e)) ?? 0), c = Q.cumsum(s.map((e) => e[1] + t.compactMarginBetween()));
3389
3436
  n.forEach((e) => {
3390
- e.row ? e.y = r.y + s[e.row - 1] : e.y = r.y;
3437
+ e.row ? e.y = r.y + c[e.row - 1] : e.y = r.y;
3391
3438
  });
3392
3439
  }
3393
3440
  });
@@ -3395,7 +3442,7 @@ var Z = {
3395
3442
  calculateGridLayout(e) {
3396
3443
  let t = this.getChartState(), n = this.getConfig(), r = e.descendants().slice(1);
3397
3444
  if (e.x = 0, e.y = 0, !r.length) return e;
3398
- let i = Z.max(r, (e) => e.width) ?? 0, a = Z.max(r, (e) => e.height) ?? 0, o = Z.max(r, (e) => n.siblingsMargin(e)) ?? 0, s = Math.max(1, i + o), c = Math.max(1, a + o), l = Math.max(1, Math.floor((t.calc?.chartWidth ?? s) / s)), u = n.layout === "top" || n.layout === "bottom", d = Math.max(0, Math.floor(n.gridRows)), f = d === 0 ? l : u ? Math.ceil(r.length / d) : d, p = Math.ceil(r.length / f);
3445
+ let i = Q.max(r, (e) => e.width) ?? 0, a = Q.max(r, (e) => e.height) ?? 0, o = Q.max(r, (e) => n.siblingsMargin(e)) ?? 0, s = Math.max(1, i + o), c = Math.max(1, a + o), l = Math.max(1, Math.floor((t.calc?.chartWidth ?? s) / s)), u = n.layout === "top" || n.layout === "bottom", d = Math.max(0, Math.floor(n.gridRows)), f = d === 0 ? l : u ? Math.ceil(r.length / d) : d, p = Math.ceil(r.length / f);
3399
3446
  return r.forEach((e, t) => {
3400
3447
  let i, a;
3401
3448
  if (u) {
@@ -3424,12 +3471,13 @@ var Z = {
3424
3471
  }
3425
3472
  update({ x0: e, y0: t }, n = {}) {
3426
3473
  let r = this.getChartState(), i = this.getConfig();
3474
+ if (!r.root || !r.flexTreeLayout || !r.svg || !r.zoomBehavior || !r.linksWrapper || !r.nodesWrapper) return;
3427
3475
  i.compact && !i.gridEnabled && this.calculateCompactFlexDimensions(r.root);
3428
3476
  let a = i.gridEnabled ? this.calculateGridLayout(r.root) : r.flexTreeLayout(r.root);
3429
3477
  i.compact && !i.gridEnabled && this.calculateCompactFlexPositions(r.root), i.forceAutoFit ? (r.svg.attr("cursor", "default"), r.zoomBehavior.filter(() => !1)) : (r.svg.attr("cursor", "grab"), r.zoomBehavior.filter(() => !0));
3430
3478
  let o = a.descendants().slice(1), s = r.root.children?.length || 0, c = i.gridEnabled ? [] : a.descendants().slice(s + 1);
3431
3479
  i.gridEnabled || o.forEach((e) => i.layoutBindings[i.layout].swap(e));
3432
- let l = r.linksWrapper.selectAll("path.link").data(c, (e) => i.nodeId(e.data)), u = l.enter().insert("path", "g").attr("class", "link").attr("d", (e) => {
3480
+ let l = r.linksWrapper.selectAll("path.link").data(c, (e) => i.nodeId(e.data) ?? ""), u = l.enter().insert("path", "g").attr("class", "link").attr("d", (e) => {
3433
3481
  let t = {
3434
3482
  x: i.layoutBindings[i.layout].linkJoinX(e.parent || e),
3435
3483
  y: i.layoutBindings[i.layout].linkJoinY(e.parent || e)
@@ -3458,13 +3506,10 @@ var Z = {
3458
3506
  };
3459
3507
  return i.layoutBindings[i.layout].diagonal(t, t, null, { sy: i.linkYOffset });
3460
3508
  }).remove();
3461
- let d = this, f = r.nodesWrapper.selectAll("g.node").data(o, ({ data: e }) => i.nodeId(e)), p = f.enter().append("g").attr("data-brush", (e) => {
3462
- let t = e.data;
3463
- if (t.brush) return t.brush.key;
3464
- }).attr("class", "node").attr("transform", (n) => n == r.root ? `translate(${e},${t})` : `translate(${i.layoutBindings[i.layout].nodeJoinX(n.parent || n)},${i.layoutBindings[i.layout].nodeJoinY(n.parent || n)})`).classed("draggable droppable", !0).on("click.node", (e, t) => {
3509
+ let d = this, f = r.nodesWrapper.selectAll("g.node").data(o, ({ data: e }) => i.nodeId(e) ?? ""), p = f.enter().append("g").attr("data-brush", (e) => e.data.brush?.key ?? null).attr("class", "node").attr("transform", (n) => n == r.root ? `translate(${e},${t})` : `translate(${i.layoutBindings[i.layout].nodeJoinX(n.parent || n)},${i.layoutBindings[i.layout].nodeJoinY(n.parent || n)})`).classed("draggable droppable", !0).on("click.node", (e, t) => {
3465
3510
  [...e.srcElement.classList].includes("node-button-foreign-object") || i.onNodeClick(t);
3466
- }).call(Pr().filter(function(e, t) {
3467
- return r.dragEnabled && t.depth > 0;
3511
+ }).call(Ir().filter(function(e, t) {
3512
+ return r.dragEnabled === !0 && t.depth > 0;
3468
3513
  }).on("start", function(e, t) {
3469
3514
  d.onDragStart(this, e, t);
3470
3515
  }).on("drag", function(e) {
@@ -3509,18 +3554,15 @@ var Z = {
3509
3554
  })},${i.layoutBindings[i.layout].buttonY({
3510
3555
  width: e,
3511
3556
  height: t
3512
- })})`).attr("display", ({ data: e }) => !i.gridEnabled && e._directSubordinates > 0 ? null : "none").attr("opacity", ({ children: e, _children: t }) => e || t ? 1 : 0), m.select(".node-button-foreign-object .node-button-div").html((e) => i.buttonContent({
3557
+ })})`).attr("display", ({ data: e }) => !i.gridEnabled && (e._directSubordinates ?? 0) > 0 ? null : "none").attr("opacity", ({ children: e, _children: t }) => e || t ? 1 : 0), m.select(".node-button-foreign-object .node-button-div").html((e) => i.buttonContent({
3513
3558
  node: e,
3514
3559
  config: i
3515
- })), m.attr("data-value", (e) => {
3516
- let t = e.data;
3517
- if (t.brush) return t.brush.value;
3518
- }), m.each(i.nodeUpdate);
3560
+ })), m.attr("data-value", (e) => e.data.brush?.value ?? null), m.each(i.nodeUpdate);
3519
3561
  let h = f.exit();
3520
3562
  h.each(i.nodeExit);
3521
3563
  let g = h.data().reduce((e, t) => e.depth < t.depth ? e : t, { depth: Infinity });
3522
3564
  h.attr("opacity", 1).transition().duration(i.duration).attr("transform", () => {
3523
- let { x: e, y: t, width: n, height: r } = g.parent || {};
3565
+ let { x: e, y: t, width: n, height: r } = g.parent ?? g;
3524
3566
  return `translate(${i.layoutBindings[i.layout].nodeJoinX({
3525
3567
  x: e,
3526
3568
  y: t,
@@ -3533,7 +3575,7 @@ var Z = {
3533
3575
  height: r
3534
3576
  })})`;
3535
3577
  }).on("end", function() {
3536
- Z.select(this).remove();
3578
+ Q.select(this).remove();
3537
3579
  }).attr("opacity", 0), o.forEach((e) => {
3538
3580
  e.x0 = e.x, e.y0 = e.y;
3539
3581
  });
@@ -3543,7 +3585,7 @@ var Z = {
3543
3585
  _.data._centeredWithDescendants && (e = i.compact ? _.descendants().filter((e, t) => t < 7) : _.descendants().filter((e, t, n) => {
3544
3586
  let r = Math.round(n.length / 2);
3545
3587
  return n.length % 2 ? t > r - 2 && t < r + 2 - 1 : t > r - 2 && t < r + 2;
3546
- })), _.data._centeredWithDescendants = null, _.data._centered = null, this.fit({
3588
+ })), _.data._centeredWithDescendants = !1, _.data._centered = !1, this.fit({
3547
3589
  animate: !0,
3548
3590
  scale: !1,
3549
3591
  nodes: e
@@ -3564,21 +3606,21 @@ var Z = {
3564
3606
  }
3565
3607
  restyleForeignObjectElements(e) {
3566
3608
  let t = this.getChartState(), n = this.getConfig();
3567
- t.svg.selectAll(".node-foreign-object").filter((t) => !e || e.has(t)).classed("node-excluded", (e) => e.data._excluded).attr("width", ({ width: e }) => e).attr("height", ({ height: e }) => e).attr("x", () => 0).attr("y", () => 0), t.svg.selectAll(".node-foreign-object-div").filter((t) => !e || e.has(t)).style("width", ({ width: e }) => `${e}px`).style("height", ({ height: e }) => `${e}px`).html(function(e, r, i) {
3568
- return n.nodeContent.bind(this)(e, r, i, t);
3609
+ t.svg?.selectAll(".node-foreign-object").filter((t) => !e || e.has(t)).classed("node-excluded", (e) => e.data._excluded === !0).attr("width", ({ width: e }) => e).attr("height", ({ height: e }) => e).attr("x", () => 0).attr("y", () => 0), t.svg?.selectAll(".node-foreign-object-div").filter((t) => !e || e.has(t)).style("width", ({ width: e }) => `${e}px`).style("height", ({ height: e }) => `${e}px`).html(function(e, t, r) {
3610
+ return n.nodeContent.call(this, e, t, r, n);
3569
3611
  });
3570
3612
  }
3571
3613
  onButtonClick(e, t) {
3572
3614
  let n = this.getConfig();
3573
- t.parent && (n.setActiveNodeCentered && (t.data._centered = !0, t.data._centeredWithDescendants = !0), t.children ? (t._children = t.children, t.children = null) : (t.children = t._children, t._children = null), this.updateNodesState(), e.stopPropagation(), n.onExpandOrCollapse(t));
3615
+ t.parent && (n.setActiveNodeCentered && (t.data._centered = !0, t.data._centeredWithDescendants = !0), t.children ? (t._children = t.children, t.children = void 0) : (t.children = t._children, t._children = void 0), this.updateNodesState(), e.stopPropagation(), n.onExpandOrCollapse(t));
3574
3616
  }
3575
3617
  updateNodesState() {
3576
3618
  let e = this.getChartState();
3577
- this.setLayouts(), this.update(e.root);
3619
+ this.setLayouts(), e.root && this.update(e.root);
3578
3620
  }
3579
3621
  setLayouts() {
3580
3622
  let e = this.getChartState(), t = this.getConfig();
3581
- e.root = t.root, e.root.each((e) => {
3623
+ e.root = t.root, e.root && (e.root.each((e) => {
3582
3624
  let n = e._hierarchyHeight || e.height, r = t.nodeWidth(e), i = t.nodeHeight(e);
3583
3625
  Object.assign(e, {
3584
3626
  width: r,
@@ -3591,13 +3633,13 @@ var Z = {
3591
3633
  _directSubordinatesPaging: (e.children || e._children || []).length,
3592
3634
  _totalSubordinates: e.allDescendants().length - 1
3593
3635
  });
3594
- });
3636
+ }));
3595
3637
  }
3596
3638
  collapse(e) {
3597
- e.children &&= (e._children = e.children, e._children.forEach((e) => this.collapse(e)), null);
3639
+ e.children &&= (e._children = e.children, e._children.forEach((e) => this.collapse(e)), void 0);
3598
3640
  }
3599
3641
  expand(e) {
3600
- e._children &&= (e.children = e._children, e.children.forEach((e) => this.expand(e)), null);
3642
+ e._children &&= (e.children = e._children, e.children.forEach((e) => this.expand(e)), void 0);
3601
3643
  }
3602
3644
  enableDrag() {
3603
3645
  let e = this.getChartState();
@@ -3611,7 +3653,7 @@ var Z = {
3611
3653
  let r = this.getChartState();
3612
3654
  r.dragNode = n;
3613
3655
  let i = t.subject.width / 2;
3614
- r.dragStartX = t.x - i, r.dragStartY = parseFloat(t.y), r.isDragStarting = !0, N(e).classed("dragging", !0);
3656
+ r.dragStartX = t.x - i, r.dragStartY = t.y, r.isDragStarting = !0, N(e).classed("dragging", !0);
3615
3657
  }
3616
3658
  onDrag(e, t) {
3617
3659
  let n = this.getChartState(), r = this.getConfig();
@@ -3620,7 +3662,7 @@ var Z = {
3620
3662
  if (n.isDragStarting) {
3621
3663
  n.isDragStarting = !1, r.container.classList.add("dragging-active"), i.raise();
3622
3664
  let e = t.subject.descendants(), a = [...e || [], t.subject], o = e.filter((e) => e.data.id !== t.subject.id);
3623
- n.linksWrapper.selectAll("path.link").data(a, (e) => r.nodeId(e.data)).remove(), o && n.nodesWrapper.selectAll("g.node").data(o, (e) => r.nodeId(e.data)).remove();
3665
+ n.linksWrapper?.selectAll("path.link").data(a, (e) => r.nodeId(e.data) ?? "").remove(), o && n.nodesWrapper?.selectAll("g.node").data(o, (e) => r.nodeId(e.data) ?? "").remove();
3624
3666
  }
3625
3667
  n.dropNode = null;
3626
3668
  let a = {
@@ -3632,7 +3674,7 @@ var Z = {
3632
3674
  bottom: t.y + t.subject.height,
3633
3675
  midX: t.x + t.subject.width / 2,
3634
3676
  midY: t.y + t.subject.height / 2
3635
- }, o = sr("g.node:not(.dragging)");
3677
+ }, o = ur("g.node:not(.dragging)");
3636
3678
  o.classed("drop-target", !1), o.filter(function(e) {
3637
3679
  let t = {
3638
3680
  left: e.x,
@@ -3640,9 +3682,8 @@ var Z = {
3640
3682
  top: e.y,
3641
3683
  bottom: e.y + e.height
3642
3684
  };
3643
- if (n.dragNode.parent === e) return !1;
3644
- if (a.midX > t.left && a.midX < t.right && a.midY > t.top && a.midY < t.bottom && this.classList.contains("droppable")) return n.dropNode = e, !!e;
3645
- }).classed("drop-target", !0), n.dragStartX += parseFloat(t.dx), n.dragStartY += parseFloat(t.dy), i.attr("transform", "translate(" + n.dragStartX + "," + n.dragStartY + ")");
3685
+ return n.dragNode?.parent === e ? !1 : a.midX > t.left && a.midX < t.right && a.midY > t.top && a.midY < t.bottom && this.classList.contains("droppable") ? (n.dropNode = e, !0) : !1;
3686
+ }).classed("drop-target", !0), n.dragStartX += t.dx, n.dragStartY += t.dy, i.attr("transform", "translate(" + n.dragStartX + "," + n.dragStartY + ")");
3646
3687
  }
3647
3688
  onDragEnd(e, t) {
3648
3689
  this.getConfig().container.classList.remove("dragging-active");
@@ -3652,11 +3693,11 @@ var Z = {
3652
3693
  this.render();
3653
3694
  return;
3654
3695
  }
3655
- if (t.subject.parent.id === n.dropNode.id) {
3696
+ if (t.subject.parent?.id === n.dropNode.id) {
3656
3697
  this.render();
3657
3698
  return;
3658
3699
  }
3659
- N(e).remove(), n.dragNode.parent = n.dropNode, n.dragNode.parent && (n.dragNode.parent.children = n.dragNode.parent.children?.filter((e) => e.id !== n.dragNode?.id) || null), this.getConfig().onNodeParentChange?.(n.dragNode), n.dropNode = null, n.dragNode = null, this.render();
3700
+ N(e).remove(), n.dragNode.parent = n.dropNode, n.dragNode.parent && (n.dragNode.parent.children = n.dragNode.parent.children?.filter((e) => e.id !== n.dragNode?.id) || void 0), this.getConfig().onNodeParentChange?.(n.dragNode), n.dropNode = null, n.dragNode = null, this.render();
3660
3701
  }
3661
3702
  }
3662
3703
  zoomed(e) {
@@ -3665,32 +3706,57 @@ var Z = {
3665
3706
  let r = e.transform;
3666
3707
  t.lastTransform = r, n.attr("transform", r.toString());
3667
3708
  }
3668
- zoomTreeBounds({ x0: e, x1: t, y0: n, y1: r, params: i = {
3709
+ zoomTreeBounds({ x0: e, x1: t, y0: n, y1: r, focus: i, params: a = {
3669
3710
  animate: !0,
3670
3711
  scale: !0,
3671
3712
  onCompleted: void 0
3672
3713
  } }) {
3673
- let { width: a, height: o } = this.getChartState().containerRect, { svg: s, zoomBehavior: c, lastTransform: l } = this.getChartState(), { duration: u, scaleExtent: d } = this.getConfig(), f = Math.min(d[1], Math.max(d[0], 1 / Math.max((t - e) / a, (r - n) / o))), p = Z.zoomIdentity.translate(a / 2, o / 2);
3674
- p = p.scale(i.scale ? f : l.k), p = p.translate(-(e + t) / 2, -(n + r) / 2), s.transition().duration(i.animate ? u : 0).call(c.transform, p);
3714
+ let { svg: o, zoomBehavior: s, lastTransform: c, containerRect: l } = this.getChartState();
3715
+ if (!o || !s || !l) return;
3716
+ let { width: u, height: d } = l, { duration: f, scaleExtent: p, minFitScale: m } = this.getConfig(), { k: h, x: g, y: _ } = Pa({
3717
+ bounds: {
3718
+ x0: e,
3719
+ x1: t,
3720
+ y0: n,
3721
+ y1: r
3722
+ },
3723
+ viewport: {
3724
+ width: u,
3725
+ height: d
3726
+ },
3727
+ scaleExtent: p,
3728
+ minScale: m,
3729
+ scale: a.scale ? void 0 : c.k,
3730
+ focus: i
3731
+ }), v = Q.zoomIdentity.translate(g, _).scale(h);
3732
+ o.transition().duration(a.animate ? f : 0).call(s.transform, v);
3675
3733
  }
3676
3734
  applyTransform(e, t = !1) {
3677
3735
  let { zoomBehavior: n, lastTransform: r, svg: i } = this.getChartState(), { duration: a } = this.getConfig();
3678
3736
  if (e.k === r.k && e.x === r.x && e.y === r.y) return;
3679
- let o = Z.zoomIdentity.translate(e.x, e.y).scale(e.k);
3680
- i && i.transition().duration(t ? 0 : a).call(n.transform, o);
3737
+ let o = Q.zoomIdentity.translate(e.x, e.y).scale(e.k);
3738
+ i && n && i.transition().duration(t ? 0 : a).call(n.transform, o);
3681
3739
  }
3682
3740
  fit({ animate: e = !0, nodes: t, scale: n = !0, onCompleted: r } = {}) {
3683
- let i = this.getChartState(), a = this.getConfig(), { root: o } = i, s = t || (a.gridEnabled ? o.descendants().slice(1) : o.descendants()), c = Z.min(s, (e) => e.x + a.layoutBindings[a.layout].nodeLeftX(e)), l = Z.max(s, (e) => e.x + a.layoutBindings[a.layout].nodeRightX(e)), u = Z.min(s, (e) => e.y + a.layoutBindings[a.layout].nodeTopY(e)), d = Z.max(s, (e) => e.y + a.layoutBindings[a.layout].nodeBottomY(e));
3741
+ let i = this.getChartState(), a = this.getConfig(), { root: o } = i;
3742
+ if (!o) return this;
3743
+ let s = a.layoutBindings[a.layout], c = t || (a.gridEnabled ? o.descendants().slice(1) : o.descendants()), l = Q.min(c, (e) => e.x + s.nodeLeftX(e)), u = Q.max(c, (e) => e.x + s.nodeRightX(e)), d = Q.min(c, (e) => e.y + s.nodeTopY(e)), f = Q.max(c, (e) => e.y + s.nodeBottomY(e));
3744
+ if (l === void 0 || u === void 0 || d === void 0 || f === void 0) return this;
3745
+ let p = t ? void 0 : o.id === "__root__" ? o.children?.[0] : o;
3684
3746
  return this.zoomTreeBounds({
3685
3747
  params: {
3686
3748
  animate: e,
3687
3749
  scale: n,
3688
3750
  onCompleted: r
3689
3751
  },
3690
- x0: c - a.padding.left,
3691
- x1: l + a.padding.right,
3692
- y0: u - a.padding.top,
3693
- y1: d + a.padding.bottom
3752
+ x0: l - a.padding.left,
3753
+ x1: u + a.padding.right,
3754
+ y0: d - a.padding.top,
3755
+ y1: f + a.padding.bottom,
3756
+ focus: p ? {
3757
+ x: p.x + (s.nodeLeftX(p) + s.nodeRightX(p)) / 2,
3758
+ y: p.y + (s.nodeTopY(p) + s.nodeBottomY(p)) / 2
3759
+ } : void 0
3694
3760
  }), this;
3695
3761
  }
3696
3762
  unsetUserTransform() {
@@ -3699,21 +3765,24 @@ var Z = {
3699
3765
  }
3700
3766
  zoomIn() {
3701
3767
  let { svg: e, zoomBehavior: t } = this.getChartState();
3702
- e.transition().call(t.scaleBy, 1.3);
3768
+ e && t && e.transition().call(t.scaleBy, 1.3);
3703
3769
  }
3704
3770
  zoomOut() {
3705
3771
  let { svg: e, zoomBehavior: t } = this.getChartState();
3706
- e.transition().call(t.scaleBy, .78);
3772
+ e && t && e.transition().call(t.scaleBy, .78);
3707
3773
  }
3708
3774
  destroy() {
3709
3775
  let e = this.getChartState();
3710
3776
  e.svg && (e.svg.selectAll("*").remove(), e.svg = null, e.chart = null);
3711
3777
  }
3712
- }, Q = pe(), go = (e, t, n) => {
3713
- let r = te(), i = (0, O.useCallback)((t) => {
3714
- t.data.brush && r.daedalus.emitEvent(D.Brush, {
3778
+ }, $ = ve(), xo = (e, t, n) => {
3779
+ let r = String(n);
3780
+ return Array.from(e.querySelectorAll(".node[data-brush][data-value]")).find((e) => e.getAttribute("data-brush") === t && e.getAttribute("data-value") === r);
3781
+ }, So = (e, t, n) => {
3782
+ let r = y(), i = (0, D.useCallback)((t) => {
3783
+ t.data.brush && r.daedalus.emitEvent(le.Brush, {
3715
3784
  data: {
3716
- action: Q.BrushEventAction.Hover,
3785
+ action: $.BrushEventAction.Hover,
3717
3786
  data: [{
3718
3787
  id: t.data.brush.key,
3719
3788
  values: [t.data.brush.value]
@@ -3721,10 +3790,10 @@ var Z = {
3721
3790
  },
3722
3791
  emitter: e
3723
3792
  });
3724
- }, [r, e]), a = (0, O.useCallback)((t) => {
3725
- t.data.brush && r.daedalus.emitEvent(D.Brush, {
3793
+ }, [r, e]), a = (0, D.useCallback)((t) => {
3794
+ t.data.brush && r.daedalus.emitEvent(le.Brush, {
3726
3795
  data: {
3727
- action: Q.BrushEventAction.Blur,
3796
+ action: $.BrushEventAction.Blur,
3728
3797
  data: [{
3729
3798
  id: t.data.brush.key,
3730
3799
  values: [t.data.brush.value]
@@ -3732,50 +3801,50 @@ var Z = {
3732
3801
  },
3733
3802
  emitter: e
3734
3803
  });
3735
- }, [r, e]), o = (0, O.useRef)({});
3736
- return o.current[D.Brush] = (r) => {
3804
+ }, [r, e]), o = (0, D.useRef)();
3805
+ return o.current = (r) => {
3737
3806
  if (r.emitter !== e && !(!t || !n.interactive)) switch (r.data.action) {
3738
- case Q.BrushEventAction.Hover:
3807
+ case $.BrushEventAction.Hover:
3739
3808
  r.data.data.forEach(({ id: e, values: n }) => {
3740
3809
  n.forEach((n) => {
3741
- t.querySelector(`.node[data-brush="${e}"][data-value="${n}"]`)?.classList.add("hovered");
3810
+ xo(t, e, n)?.classList.add("hovered");
3742
3811
  });
3743
3812
  });
3744
3813
  break;
3745
- case Q.BrushEventAction.Blur:
3814
+ case $.BrushEventAction.Blur:
3746
3815
  r.data.data.forEach(({ id: e, values: n }) => {
3747
3816
  n.forEach((n) => {
3748
- t.querySelector(`.node[data-brush="${e}"][data-value="${n}"]`)?.classList.remove("hovered");
3817
+ xo(t, e, n)?.classList.remove("hovered");
3749
3818
  });
3750
3819
  });
3751
3820
  break;
3752
- case Q.BrushEventAction.End:
3821
+ case $.BrushEventAction.End:
3753
3822
  t.querySelectorAll(".node.hovered").forEach((e) => e.classList.remove("hovered"));
3754
3823
  break;
3755
3824
  }
3756
- }, g({
3757
- action: D.Brush,
3758
- handler: ({ payload: e }) => e && o.current[D.Brush](e)
3825
+ }, b({
3826
+ action: le.Brush,
3827
+ handler: ({ payload: e }) => e && o.current?.(e)
3759
3828
  }, []), {
3760
3829
  onTreeNodeHover: i,
3761
3830
  onTreeNodeLeave: a
3762
3831
  };
3763
- }, _o = (e) => {
3764
- let { variables: t, variablesFetched: n, updateVariable: r } = x();
3832
+ }, Co = (e) => {
3833
+ let { variables: t, variablesFetched: n, updateVariable: r } = v();
3765
3834
  return {
3766
- variables: (0, O.useMemo)(() => {
3835
+ variables: (0, D.useMemo)(() => {
3767
3836
  let n = {};
3768
3837
  return e.measures?.forEach((e) => {
3769
- !e.slots || !c(e) || Object.values(e.slots).filter((e) => e.enabled && e.source === "variable" && e.propertyValue?.type === "variable").forEach((r) => {
3770
- let i = r.propertyValue.variableName;
3771
- if (!i) return;
3772
- let a = t.find((e) => e.name === i);
3773
- n[i] || (n[i] = {
3774
- id: a?.id ?? null,
3838
+ !e.slots || !p(e) || Object.values(e.slots).filter((e) => e.enabled && e.source === "variable" && e.propertyValue?.type === "variable").forEach((r) => {
3839
+ let a = r.propertyValue.variableName;
3840
+ if (!a) return;
3841
+ let o = t.find((e) => e.name === a);
3842
+ n[a] || (n[a] = {
3843
+ id: o?.id ?? null,
3775
3844
  measureId: []
3776
3845
  });
3777
- let o = f(e.dataItem);
3778
- n[i].measureId.includes(o) || n[i].measureId.push(o);
3846
+ let s = i(e.dataItem);
3847
+ n[a].measureId.includes(s) || n[a].measureId.push(s);
3779
3848
  });
3780
3849
  }), n;
3781
3850
  }, [
@@ -3786,122 +3855,125 @@ var Z = {
3786
3855
  updateVariable: r,
3787
3856
  variablesFetched: n
3788
3857
  };
3789
- }, vo = (e, t) => {
3790
- let n = e.dimensions.filter(c), r = n.map((e) => f(e.dataItem)), i = n.length, a = (0, O.useMemo)(() => C(n.map((e) => ({
3858
+ }, wo = (e, t) => {
3859
+ let n = e.dimensions.filter(p), r = n.map((e) => i(e.dataItem)), a = n.length, o = (0, D.useMemo)(() => C(n.map((e) => ({
3791
3860
  dataItem: e.dataItem,
3792
3861
  dateLevel: void 0,
3793
3862
  datePart: void 0,
3794
- operator: Qa.FilterOperator.InList
3795
- })), { ignoreApplied: !0 }), [r]), o = (0, O.useCallback)((e) => {
3796
- if (!i || !a?.length || !e.data.brush) return;
3797
- let { key: t, value: n } = e.data.brush, r = a.find((e) => e.fieldKey === t && ce(e.operators));
3863
+ operator: ro.FilterOperator.InList
3864
+ })), { ignoreApplied: !0 }), [r]), s = (0, D.useCallback)((e) => {
3865
+ if (!a || !o?.length || !e.data.brush) return;
3866
+ let { key: t, value: n } = e.data.brush, r = o.find((e) => e.fieldKey === t && pe(e.operators));
3798
3867
  if (!r) return;
3799
- let o = (r.operators.pending ?? r.operators.applied ?? r.operators.initial) === Qa.FilterOperator.NotInList ? "off" : "on";
3800
- r.state.pending && r.state.pending.includes(n) && (o = o === "off" ? "on" : "off"), r.onClick(n, { [o]: !0 });
3801
- }, [a, r]);
3802
- return (0, O.useEffect)(() => {
3803
- t && (t.querySelectorAll(".node.selected").forEach((e) => e.classList.remove("selected")), a.forEach(({ fieldKey: e, state: n }) => {
3868
+ let i = (r.operators.pending ?? r.operators.applied ?? r.operators.initial) === ro.FilterOperator.NotInList ? "off" : "on";
3869
+ r.state.pending && r.state.pending.includes(n) && (i = i === "off" ? "on" : "off"), r.onClick(n, { [i]: !0 });
3870
+ }, [o, r]);
3871
+ return (0, D.useEffect)(() => {
3872
+ t && (t.querySelectorAll(".node.selected").forEach((e) => e.classList.remove("selected")), o.forEach(({ fieldKey: e, state: n }) => {
3804
3873
  n.pending !== null && n.pending.forEach((n) => {
3805
- t.querySelector(`.node[data-brush="${e}"][data-value="${n}"]`)?.classList.add("selected");
3874
+ e && xo(t, e, n)?.classList.add("selected");
3806
3875
  });
3807
3876
  }));
3808
- }, [t, JSON.stringify(a)]), { onTreeNodeClick: o };
3809
- }, yo = (e, t) => {
3877
+ }, [t, JSON.stringify(o)]), { onTreeNodeClick: s };
3878
+ }, To = (e, t) => {
3810
3879
  e.next({
3811
- action: l.SaveLocalVSpec,
3880
+ action: w.SaveLocalVSpec,
3812
3881
  payload: { vSpecChange: { treeChartSettings: { ...t } } },
3813
3882
  mergeWith(e, t, n) {
3814
3883
  if (n === "nodeExpandState") return t;
3815
3884
  }
3816
3885
  });
3817
- }, bo = 80, xo = (e, t, n, r) => {
3818
- let i = (0, O.useRef)(e.treeChartSettings?.nodeExpandState ?? {}), a = r.forceAutoFit, o = ee(), s = _o(o), l = _(), u = m(), d = e.dimensions.filter(c), p = d.length, [h] = (0, O.useState)(e.treeChartSettings?.transform ?? null), [g, v] = (0, O.useState)(h ?? {
3886
+ }, Eo = 80, Do = (e, t, n, r) => {
3887
+ let a = (0, D.useRef)(e.treeChartSettings?.nodeExpandState ?? {}), o = r.forceAutoFit, s = ee(), c = Co(s), l = h(), u = ne(), d = e.dimensions.filter(p), f = d.length, [m] = (0, D.useState)(e.treeChartSettings?.transform ?? null), [g, _] = (0, D.useState)(m ?? {
3819
3888
  k: 1,
3820
3889
  x: 0,
3821
3890
  y: 0
3822
- }), y = (0, O.useRef)(e.treeChartSettings?.transform), { onTreeNodeHover: b, onTreeNodeLeave: x } = go(n, t.current, r), { onTreeNodeClick: S } = vo(e, t.current), C = (0, O.useRef)(new ho()), w = (0, O.useRef)(null), te = !e.treeChartSettings.gridLayout?.enabled && e.treeChartSettings?.nodeLayout?.hoverStyle?.enabled, T = (0, O.useCallback)(() => {
3823
- w.current &&= (clearTimeout(w.current), null);
3891
+ }), v = (0, D.useRef)(e.treeChartSettings?.transform), { onTreeNodeHover: y, onTreeNodeLeave: b } = So(n, t.current, r), { onTreeNodeClick: x } = wo(e, t.current), S = (0, D.useRef)(new bo()), C = (0, D.useRef)(null), te = !e.treeChartSettings.gridLayout?.enabled && e.treeChartSettings?.nodeLayout?.hoverStyle?.enabled, w = (0, D.useCallback)(() => {
3892
+ C.current &&= (clearTimeout(C.current), null);
3824
3893
  }, []);
3825
- return C.current.onNodeHover((e) => {
3826
- r.interactive && b(e), te && (T(), C.current.highlight(e));
3894
+ return S.current.onNodeHover((e) => {
3895
+ r.interactive && y(e), te && (w(), S.current.highlight(e));
3827
3896
  }).onNodeLeave((e) => {
3828
- r.interactive && x(e), te && (T(), w.current = setTimeout(() => {
3829
- C.current.highlight(null), w.current = null;
3830
- }, bo));
3897
+ r.interactive && b(e), te && (w(), C.current = setTimeout(() => {
3898
+ S.current.highlight(null), C.current = null;
3899
+ }, Eo));
3831
3900
  }).onNodeClick((e) => {
3832
- r.interactive && S(e);
3901
+ r.interactive && x(e);
3833
3902
  }).onNodeParentChange((t) => {
3834
- if (p > 0) return;
3903
+ if (f > 0) return;
3835
3904
  let n = e.measures.find((e) => e.dataItem.uniqueSignature === t.data.id);
3836
- n && ne(u, e.measures, f(n.dataItem), !t.parent || t.parent.data.id === "__root__" ? null : t.parent.data.id);
3905
+ n && re(u, e.measures, i(n.dataItem), !t.parent || t.parent.data.id === "__root__" ? void 0 : t.parent.data.id);
3837
3906
  }).onExpandOrCollapse((t) => {
3838
- let n = it(t, e.treeChartSettings?.initialExpandedLevels, d.length, e.totals?.enabled ?? !1), r = !(t._children?.length > 0 && !t.children?.length);
3839
- r === n ? delete i.current[t.data.id] : i.current[t.data.id] = r, yo(l, { nodeExpandState: i.current }), !(p > 0) && Object.values(s.variables).filter((e) => e.measureId.includes(t.data.id)).forEach((e) => {
3840
- s.updateVariable(e.id, r, Qa.VariableType.boolean);
3907
+ let n = st(t, e.treeChartSettings?.initialExpandedLevels, d.length, e.totals?.enabled ?? !1), r = !((t._children?.length ?? 0) > 0 && !t.children?.length);
3908
+ r === n ? delete a.current[t.data.id] : a.current[t.data.id] = r, To(l, { nodeExpandState: a.current }), !(f > 0) && Object.values(c.variables).filter((e) => e.measureId.includes(t.data.id)).forEach((e) => {
3909
+ e.id && c.updateVariable(e.id, r, ro.VariableType.boolean);
3841
3910
  });
3842
3911
  }).onUserZoom(() => {
3843
- y.current = null;
3912
+ v.current = null;
3844
3913
  }).onZoomEnd((e) => {
3845
- if (a) return;
3914
+ if (o) return;
3846
3915
  let t = {
3847
3916
  k: e.transform.k,
3848
3917
  x: e.transform.x,
3849
3918
  y: e.transform.y
3850
3919
  };
3851
- t.k === g.k && t.x === g.x && t.y === g.y || (v(t), yo(l, {
3852
- nodeExpandState: i.current,
3920
+ t.k === g.k && t.x === g.x && t.y === g.y || (_(t), To(l, {
3921
+ nodeExpandState: a.current,
3853
3922
  transform: t
3854
3923
  }));
3855
- }), (0, O.useEffect)(() => () => T(), [T]), (0, O.useEffect)(() => {
3856
- e.treeChartSettings?.nodeExpandState && (i.current = e.treeChartSettings.nodeExpandState ?? {});
3857
- }, [e.treeChartSettings?.nodeExpandState]), (0, O.useEffect)(() => {
3858
- o.treeChartSettings?.nodeExpandState || (i.current = {});
3859
- }, [o.treeChartSettings?.initialExpandedLevels]), (0, O.useEffect)(() => {
3860
- y.current = e.treeChartSettings?.transform, C.current && C.current.unsetUserTransform(), !(!e.treeChartSettings?.transform || !C.current) && C.current.applyTransform(e.treeChartSettings.transform);
3924
+ }), (0, D.useEffect)(() => () => w(), [w]), (0, D.useEffect)(() => {
3925
+ e.treeChartSettings?.nodeExpandState && (a.current = e.treeChartSettings.nodeExpandState ?? {});
3926
+ }, [e.treeChartSettings?.nodeExpandState]), (0, D.useEffect)(() => {
3927
+ s.treeChartSettings?.nodeExpandState || (a.current = {});
3928
+ }, [s.treeChartSettings?.initialExpandedLevels]), (0, D.useEffect)(() => {
3929
+ v.current = e.treeChartSettings?.transform, S.current && S.current.unsetUserTransform(), !(!e.treeChartSettings?.transform || !S.current) && S.current.applyTransform(e.treeChartSettings.transform);
3861
3930
  }, [e.treeChartSettings?.transform]), {
3862
- chart: C.current,
3863
- expandedState: i
3864
- };
3865
- }, $ = w(), So = ({ vSpec: e, vTheme: t, data: n, elementSize: r, vizProperties: i }) => {
3866
- let o = i?.isEditMode ?? !1, s = i?.isPrintMode ?? !1, l = e?.treeChartSettings?.gridLayout?.enabled, u = e.dimensions.filter(c).length, d = e.measures.filter(c), f = (0, O.useRef)("tree-" + a(10)), p = (0, O.useRef)(null), m = e.treeChartSettings?.forceAutoFit === !0, { layout: h, treeSettings: g } = Ma(e, i), { chart: _, expandedState: y } = xo(e, p, f.current, g), b = Aa(e, p, _), x = lt({
3931
+ chart: S.current,
3932
+ expandedState: a
3933
+ };
3934
+ }, Oo = ({ vSpec: e, vTheme: t, data: n, elementSize: r = {
3935
+ width: 0,
3936
+ height: 0
3937
+ }, vizProperties: i }) => {
3938
+ let a = i?.isEditMode ?? !1, o = i?.isPrintMode ?? !1, c = e?.treeChartSettings?.gridLayout?.enabled, l = e.dimensions.filter(p).length, u = e.measures.filter(p), d = (0, D.useRef)("tree-" + s(10)), f = (0, D.useRef)(null), m = e.treeChartSettings?.forceAutoFit === !0, { layout: h, treeSettings: g } = La(e, i), { chart: _, expandedState: v } = Do(e, f, d.current, g), y = Fa(e, f, _), b = ft({
3867
3939
  vSpec: e,
3868
3940
  data: n,
3869
- nodeExpandState: y
3870
- }), [S, C] = (0, O.useState)(!1);
3871
- (0, O.useLayoutEffect)(() => (_ && _.init(), () => {
3941
+ nodeExpandState: v
3942
+ }), [x, S] = (0, D.useState)(!1);
3943
+ (0, D.useLayoutEffect)(() => (_ && _.init(), () => {
3872
3944
  _?.destroy();
3873
- }), [p.current]), (0, O.useEffect)(() => {
3874
- S ? _.enableDrag() : _.disableDrag();
3875
- }, [S]), (0, O.useEffect)(() => {
3876
- !p.current || !_ || !r.width || !r.height || b(x, g);
3945
+ }), [f.current]), (0, D.useEffect)(() => {
3946
+ x ? _.enableDrag() : _.disableDrag();
3947
+ }, [x]), (0, D.useEffect)(() => {
3948
+ !f.current || !_ || !r.width || !r.height || y(b, g);
3877
3949
  }, [
3878
3950
  r.width,
3879
3951
  r.height,
3880
- b
3952
+ y
3881
3953
  ]);
3882
- let ee = o && u === 0 && !l;
3883
- (0, O.useEffect)(() => {
3884
- p.current && b(x, g);
3954
+ let C = a && l === 0 && !c;
3955
+ (0, D.useEffect)(() => {
3956
+ f.current && y(b, g);
3885
3957
  }, [
3886
- x,
3958
+ b,
3887
3959
  JSON.stringify(g),
3888
- b
3960
+ y
3889
3961
  ]);
3890
- let w = Pe({
3962
+ let ee = Re({
3891
3963
  vTheme: t,
3892
3964
  vSpec: e,
3893
- id: f.current,
3965
+ id: d.current,
3894
3966
  layout: h
3895
3967
  });
3896
- return /* @__PURE__ */ (0, $.jsxs)("div", {
3968
+ return /* @__PURE__ */ (0, E.jsxs)("div", {
3897
3969
  style: {
3898
3970
  width: "100%",
3899
3971
  height: "100%"
3900
3972
  },
3901
- id: f.current,
3902
- "data-mode": o ? "edit" : "view",
3973
+ id: d.current,
3974
+ "data-mode": a ? "edit" : "view",
3903
3975
  children: [
3904
- !s && /* @__PURE__ */ (0, $.jsxs)("div", {
3976
+ !o && /* @__PURE__ */ (0, E.jsxs)("div", {
3905
3977
  className: "tree-toolbar",
3906
3978
  style: {
3907
3979
  position: "absolute",
@@ -3911,33 +3983,36 @@ var Z = {
3911
3983
  top: 0,
3912
3984
  gap: 10
3913
3985
  },
3914
- children: [ee && /* @__PURE__ */ (0, $.jsx)(be, {
3986
+ children: [C && /* @__PURE__ */ (0, E.jsx)(Ce, {
3915
3987
  size: "small",
3916
3988
  value: "organize",
3917
- selected: S,
3918
- onChange: () => C(!S),
3919
- disabled: d.length < 2,
3920
- children: /* @__PURE__ */ (0, $.jsx)(_e, {})
3921
- }), !m && /* @__PURE__ */ (0, $.jsx)(be, {
3989
+ selected: x,
3990
+ onChange: () => S(!x),
3991
+ disabled: u.length < 2,
3992
+ children: /* @__PURE__ */ (0, E.jsx)(Le, {})
3993
+ }), !m && /* @__PURE__ */ (0, E.jsx)(Ce, {
3922
3994
  value: "",
3923
3995
  size: "small",
3924
3996
  onClick: () => _?.fit(),
3925
- children: /* @__PURE__ */ (0, $.jsx)(v, {})
3997
+ children: /* @__PURE__ */ (0, E.jsx)(te, {})
3926
3998
  })]
3927
3999
  }),
3928
- /* @__PURE__ */ (0, $.jsx)("style", { children: w }),
3929
- /* @__PURE__ */ (0, $.jsx)("div", {
4000
+ /* @__PURE__ */ (0, E.jsx)("style", { children: ee }),
4001
+ /* @__PURE__ */ (0, E.jsx)("div", {
3930
4002
  style: {
3931
4003
  width: "100%",
3932
4004
  height: "100%"
3933
4005
  },
3934
- ref: p
4006
+ ref: f
3935
4007
  })
3936
4008
  ]
3937
4009
  });
3938
- }, Co = b(class extends O.Component {
3939
- render() {
3940
- return /* @__PURE__ */ (0, $.jsx)(So, { ...this.props });
3941
- }
4010
+ }, ko = _((e) => {
4011
+ let { vSpec: t, data: n } = e;
4012
+ return !t || !n || !f(t) ? null : /* @__PURE__ */ (0, E.jsx)(Oo, {
4013
+ ...e,
4014
+ vSpec: t,
4015
+ data: n
4016
+ });
3942
4017
  });
3943
- export { Co as Tree };
4018
+ export { ko as Tree };