@orangelogic/design-system 2.69.0 → 2.70.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/library/chunks/AxisLabelRadial.BTpA5dYy.js +11 -0
  2. package/library/chunks/BaseColumnSeries.hIO71GLG.js +304 -0
  3. package/library/chunks/CandlestickSeries.w9C0GR9v.js +362 -0
  4. package/library/chunks/Circle.tOnnO-F-.js +17 -0
  5. package/library/chunks/ColumnSeries.Ckz75x1M.js +54 -0
  6. package/library/chunks/EditableAxisLabel.CCMTJT7K.js +445 -0
  7. package/library/chunks/EditableLabel.DPmicdjK.js +119 -0
  8. package/library/chunks/Gradient.BrDBLm8v.js +40 -0
  9. package/library/chunks/LinearGradient.CxfXxvMw.js +37 -0
  10. package/library/chunks/MonotoneXTension.CJMEHHj3.js +139 -0
  11. package/library/chunks/Picture.BNASYM-P.js +49 -0
  12. package/library/chunks/Polygon.Dr-GV2hn.js +70 -0
  13. package/library/chunks/ProgressPie.4mPA6xqm.js +234 -0
  14. package/library/chunks/RadialLabel.HfsGiN4x.js +88 -0
  15. package/library/chunks/Scrollbar.Bgg-RhjP.js +118 -0
  16. package/library/chunks/Slice.Dm56LTKj.js +120 -0
  17. package/library/chunks/Slider.FKJwoPq2.js +19 -0
  18. package/library/chunks/SpriteResizer.-qJDgug8.js +446 -0
  19. package/library/chunks/Triangle.BECgi7mc.js +21 -0
  20. package/library/chunks/ZoomTools.cgwuIB0e.js +199 -0
  21. package/library/chunks/___vite-browser-external_commonjs-proxy.C2tf3HsQ.js +8 -0
  22. package/library/chunks/{_baseUniq.Df-fLIBx.js → _baseUniq.BUihBa8c.js} +56 -53
  23. package/library/chunks/{_commonjsHelpers.ByX85dGu.js → _commonjsHelpers.DQNKXVTB.js} +2 -2
  24. package/library/chunks/accessors.BHk36ecy.js +11 -0
  25. package/library/chunks/am-chart.oZVBmpnn.js +18435 -0
  26. package/library/chunks/{animation.DfUHRQry.js → animation.DU8t6mrk.js} +1 -1
  27. package/library/chunks/{button.SoX-7UYy.js → button.CAAJPQFu.js} +3 -3
  28. package/library/chunks/{capitalize.WSkCXkNE.js → capitalize.CNStXZBq.js} +1 -1
  29. package/library/chunks/cardinal.BCA_LB0u.js +64 -0
  30. package/library/chunks/{color-swatch-group.Dx1fbSJx.js → color-swatch-group.CKHyWM8K.js} +6 -6
  31. package/library/chunks/{color-swatch.B7XXHxx1.js → color-swatch.BkpPCXd6.js} +2 -2
  32. package/library/chunks/colorPicker.C4w_vDjh.js +527 -0
  33. package/library/chunks/{confirm-popover.327ATuQH.js → confirm-popover.ZD74yDWw.js} +3 -3
  34. package/library/chunks/{content-builder.Bxi6k2LA.js → content-builder.B4Tqoc6M.js} +40 -34
  35. package/library/chunks/{cropper.BraEEykE.js → cropper.CQB3_qqG.js} +6937 -6935
  36. package/library/chunks/{dialog.eN3RUbwx.js → dialog.qSV5AjOE.js} +2 -2
  37. package/library/chunks/{dom.CZrJ64Dm.js → dom.BQVKDNd8.js} +1 -1
  38. package/library/chunks/{dot-pagination.Bek4w4zz.js → dot-pagination.BN_0ljfc.js} +2 -2
  39. package/library/chunks/exporting.BdjsEGF8.js +1407 -0
  40. package/library/chunks/{file-on-demand.BiC4cymk.js → file-on-demand.CXE4zf0J.js} +448 -386
  41. package/library/chunks/flow.D0FqdfOy.js +1594 -0
  42. package/library/chunks/{folder-select.DVEFgexx.js → folder-select.CPALQK22.js} +4 -4
  43. package/library/chunks/{form.CO12-VK0.js → form.DgwYWi0O.js} +1 -1
  44. package/library/chunks/gantt.DfUM7Gvb.js +2459 -0
  45. package/library/chunks/{header.Da5yvwdy.js → header.DXZ_5gLY.js} +2 -2
  46. package/library/chunks/hierarchy.5kfBCoGt.js +3561 -0
  47. package/library/chunks/{hub-connection.CfARlehM.js → hub-connection.Ot2odiCz.js} +1 -1
  48. package/library/chunks/{i18n.BMRLOAZR.js → i18n.C0iakJkV.js} +19 -11
  49. package/library/chunks/{iframe.BJizUE1A.js → iframe.BlzVfeBc.js} +2 -2
  50. package/library/chunks/{image.bndP5q2c.js → image.B3WjaCXP.js} +2 -2
  51. package/library/chunks/index.BkoLctE9.js +533 -0
  52. package/library/chunks/index.CZJTjkLp.js +142 -0
  53. package/library/chunks/{index.Bhnf0N8Q.js → index.CmVKj_wl.js} +7 -7
  54. package/library/chunks/index.DU0XUO4k.js +176 -0
  55. package/library/chunks/index.DcjJFMlq.js +1520 -0
  56. package/library/chunks/isObjectLike.z36Fu426.js +34 -0
  57. package/library/chunks/{isSymbol.huJ_Cvxt.js → isSymbol.L0C2ND_U.js} +1 -1
  58. package/library/chunks/json.BjaT7cyo.js +119 -0
  59. package/library/chunks/{list-editor.Du1h2Ms0.js → list-editor.CIAAFPco.js} +251 -222
  60. package/library/chunks/map.DbgNAGxD.js +3037 -0
  61. package/library/chunks/markerjs2.esm.B_9kjmye.js +1912 -0
  62. package/library/chunks/{option.Ce_wlnZj.js → option.ByVbmxUQ.js} +2 -2
  63. package/library/chunks/{pagination.DXu-mFAk.js → pagination.DPQn2fKX.js} +4 -4
  64. package/library/chunks/pdfmake.Bs7cMDH0.js +41224 -0
  65. package/library/chunks/percent.DO4FjAdu.js +902 -0
  66. package/library/chunks/{purify.es.BGaRrCfO.js → purify.es.BIuh5IAZ.js} +115 -115
  67. package/library/chunks/radar.Dd5fJVMg.js +789 -0
  68. package/library/chunks/{responsive.DgQTIrna.js → responsive.DL-wBD4P.js} +1 -1
  69. package/library/chunks/sliceGrouper.DA3aeuJ-.js +93 -0
  70. package/library/chunks/stock.BfI5MUyK.js +12684 -0
  71. package/library/chunks/{string.Cp_XNbnV.js → string.B_rEG27K.js} +1 -1
  72. package/library/chunks/{tab-group.B2pW__9H.js → tab-group.1h51o_Ly.js} +4 -4
  73. package/library/chunks/{table.5eWm9FfN.js → table.wVHv1Xze.js} +348 -327
  74. package/library/chunks/timeline.BxMLjB5J.js +837 -0
  75. package/library/chunks/timer.B39XOBYL.js +123 -0
  76. package/library/chunks/{toString.CRT5zqEU.js → toString.CL_lYXbK.js} +3 -3
  77. package/library/chunks/transform.BuqENXeT.js +50 -0
  78. package/library/chunks/{tree.Zls5YZ8z.js → tree.Bx0IGsWm.js} +2 -2
  79. package/library/chunks/venn.CxFupTb9.js +966 -0
  80. package/library/chunks/vfs_fonts.VJpdcrR6.js +9 -0
  81. package/library/chunks/watch.BCJD77bD.js +547 -0
  82. package/library/chunks/wc.ThQubbN2.js +255 -0
  83. package/library/chunks/xlsx.v-qkA-dg.js +25118 -0
  84. package/library/chunks/xy.q6e68du3.js +333 -0
  85. package/library/components/alert.js +2 -2
  86. package/library/components/am-chart.d.ts +3 -0
  87. package/library/components/am-chart.js +11 -0
  88. package/library/components/animated-image.js +1 -1
  89. package/library/components/animation.js +2 -2
  90. package/library/components/array-line-clamp.js +1 -1
  91. package/library/components/asset-link-format.js +7 -7
  92. package/library/components/atoms.js +166 -162
  93. package/library/components/avatar.js +1 -1
  94. package/library/components/border-input-group.js +1 -1
  95. package/library/components/breadcrumb-item.js +1 -1
  96. package/library/components/breadcrumb.js +1 -1
  97. package/library/components/button.js +4 -4
  98. package/library/components/checkbox.js +2 -2
  99. package/library/components/color-picker.js +4 -4
  100. package/library/components/color-swatch-group.js +7 -7
  101. package/library/components/color-swatch.js +3 -3
  102. package/library/components/confirm-popover.js +4 -4
  103. package/library/components/copy-button.js +2 -2
  104. package/library/components/corner-position-input-group.js +2 -2
  105. package/library/components/cropper.js +1 -1
  106. package/library/components/details.js +3 -2
  107. package/library/components/dialog.js +3 -3
  108. package/library/components/divider.js +1 -1
  109. package/library/components/dot-pagination.js +3 -3
  110. package/library/components/drawer.js +3 -3
  111. package/library/components/dropdown.js +2 -2
  112. package/library/components/dynamic-select.js +32 -30
  113. package/library/components/e-chart.d.ts +3 -0
  114. package/library/components/e-chart.js +47908 -0
  115. package/library/components/element-clamp.js +3 -3
  116. package/library/components/file-on-demand.js +10 -10
  117. package/library/components/folder-select.js +4 -4
  118. package/library/components/format-bytes.js +1 -1
  119. package/library/components/format-date.js +1 -1
  120. package/library/components/format-number.js +1 -1
  121. package/library/components/format-time.js +2 -2
  122. package/library/components/grid-item.js +1 -1
  123. package/library/components/header.js +3 -3
  124. package/library/components/hub-connection.js +2 -2
  125. package/library/components/icon-button.js +1 -1
  126. package/library/components/icon.js +1 -1
  127. package/library/components/iframe.js +3 -3
  128. package/library/components/image-comparer.js +2 -2
  129. package/library/components/image.js +3 -3
  130. package/library/components/include.js +1 -1
  131. package/library/components/input.js +3 -3
  132. package/library/components/line-clamp.js +1 -1
  133. package/library/components/list-editor.js +11 -8
  134. package/library/components/markdown.js +2 -2
  135. package/library/components/masonry.js +2 -2
  136. package/library/components/menu-item.js +2 -2
  137. package/library/components/menu.js +1 -1
  138. package/library/components/molecules.js +5 -5
  139. package/library/components/mutation-observer.js +1 -1
  140. package/library/components/option.js +3 -3
  141. package/library/components/organisms.js +2 -2
  142. package/library/components/pagination.js +5 -5
  143. package/library/components/popup.js +1 -1
  144. package/library/components/position-picker.js +1 -1
  145. package/library/components/progress-bar.js +1 -1
  146. package/library/components/progress-ring.js +1 -1
  147. package/library/components/qr-code.js +1 -1
  148. package/library/components/radio-button.js +1 -1
  149. package/library/components/radio-card.js +1 -1
  150. package/library/components/radio-group.js +2 -2
  151. package/library/components/radio.js +1 -1
  152. package/library/components/range.js +3 -3
  153. package/library/components/rating.js +2 -2
  154. package/library/components/relative-time.js +1 -1
  155. package/library/components/resize-observer.js +1 -1
  156. package/library/components/select.js +4 -4
  157. package/library/components/share-option-list.js +3 -3
  158. package/library/components/sidebar.js +1 -1
  159. package/library/components/size-input-group.js +2 -2
  160. package/library/components/spinner.js +1 -1
  161. package/library/components/split-panel.js +2 -2
  162. package/library/components/stepper.js +1 -1
  163. package/library/components/switch.js +2 -2
  164. package/library/components/tab-group.js +5 -5
  165. package/library/components/tab-panel.js +1 -1
  166. package/library/components/tab.js +2 -2
  167. package/library/components/table.js +5 -5
  168. package/library/components/tag.js +1 -1
  169. package/library/components/textarea.js +2 -2
  170. package/library/components/timecode.js +2 -2
  171. package/library/components/tooltip.js +2 -2
  172. package/library/components/tree-item.js +3 -3
  173. package/library/components/tree.js +3 -3
  174. package/library/components/typeface.js +2 -2
  175. package/library/components/types.js +27684 -27970
  176. package/library/components/video.js +1107 -1110
  177. package/library/package.json +1 -1
  178. package/library/packages/atoms/src/components/am-chart/am-chart.d.ts +45 -0
  179. package/library/packages/atoms/src/components/am-chart/am-chart.styles.d.ts +2 -0
  180. package/library/packages/atoms/src/components/am-chart/am-chart.utils.d.ts +23 -0
  181. package/library/packages/atoms/src/components/e-chart/e-chart-controller.d.ts +30 -0
  182. package/library/packages/atoms/src/components/e-chart/e-chart.d.ts +38 -0
  183. package/library/packages/atoms/src/components/e-chart/e-chart.styles.d.ts +2 -0
  184. package/library/packages/atoms/src/components/table/table.d.ts +21 -0
  185. package/library/packages/atoms/src/components/table/tabulator-tables/core/Tabulator.d.ts +1 -0
  186. package/library/packages/atoms/src/components/table/tabulator-tables/core/tools/DataLoader.d.ts +3 -1
  187. package/library/packages/atoms/src/index.d.ts +2 -0
  188. package/library/packages/events/src/cx-chart-plan-change.d.ts +10 -0
  189. package/library/packages/events/src/cx-dashboard-filter-change.d.ts +6 -0
  190. package/library/packages/events/src/cx-dashboard-table-load-more.d.ts +9 -0
  191. package/library/packages/events/src/cx-e-chart-drill-down.d.ts +16 -0
  192. package/library/packages/events/src/events.d.ts +4 -0
  193. package/library/packages/molecules/src/index.d.ts +1 -0
  194. package/library/packages/molecules/src/list-editor/list-editor.d.ts +7 -0
  195. package/library/packages/molecules/src/stat-card/stat-card.d.ts +81 -0
  196. package/library/packages/molecules/src/stat-card/stat-card.styles.d.ts +2 -0
  197. package/library/packages/molecules/src/storybook/storybook.d.ts +1 -0
  198. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +1 -1
  199. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-builder.d.ts +88 -0
  200. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-builder.styles.d.ts +2 -0
  201. package/library/packages/organisms/src/content-builder/components/chart-plan-builder/chart-plan-schema.d.ts +100 -0
  202. package/library/packages/organisms/src/content-builder/styleController.d.ts +2 -2
  203. package/library/packages/organisms/src/dashboard-filter/dashboard-filter.d.ts +83 -0
  204. package/library/packages/organisms/src/dashboard-filter/dashboard-filter.styles.d.ts +2 -0
  205. package/library/packages/organisms/src/dashboard-table/dashboard-table.d.ts +45 -0
  206. package/library/packages/organisms/src/dashboard-table/dashboard-table.styles.d.ts +2 -0
  207. package/library/packages/organisms/src/index.d.ts +3 -0
  208. package/library/packages/services/src/api/endpoints.d.ts +3 -0
  209. package/library/packages/types/src/am-chart.d.ts +22 -0
  210. package/library/packages/types/src/content-builder.d.ts +1 -0
  211. package/library/packages/types/src/stat-card.d.ts +19 -0
  212. package/library/packages/types/src/table.d.ts +4 -0
  213. package/library/packages/utils/src/custom-element/i18n.d.ts +8 -0
  214. package/library/react-web-component.d.ts +280 -4
  215. package/library/utils.js +8 -8
  216. package/package.json +1 -1
  217. package/library/chunks/_baseRest.ClTMQtN1.js +0 -67
  218. package/library/chunks/identity.ByMq8VxU.js +0 -6
  219. package/library/chunks/isObjectLike.D3cpZO39.js +0 -81
  220. package/library/chunks/watch.q1sEjPWL.js +0 -501
@@ -0,0 +1,3561 @@
1
+ import { D as yi, F as mi, al as xi, x as Zt, I as _i, q as O, am as V, H as qt, C as yt, L as Z, T as K, b as Ue, R as ce, m as G, J as Ke, e as P, a2 as ke, aq as wi, a as X, _ as Ne, G as Ze, bi as Di, a4 as be, ap as Qt, r as ut, b1 as ki, o as Ae, h as Ni, j as bi, aZ as Pe } from "./am-chart.oZVBmpnn.js";
2
+ import { N as Ai, h as Pi } from "./index.CZJTjkLp.js";
3
+ import { C as Jt } from "./Circle.tOnnO-F-.js";
4
+ import { t as Ci, d as Ri } from "./timer.B39XOBYL.js";
5
+ import { c as mt, a as xt, i as Ti } from "./index.DU0XUO4k.js";
6
+ import { S as zi } from "./Slice.Dm56LTKj.js";
7
+ import { R as Li } from "./RadialLabel.HfsGiN4x.js";
8
+ import { r as Si } from "./accessors.BHk36ecy.js";
9
+ import { P as Mi } from "./Polygon.Dr-GV2hn.js";
10
+ import { a as Hi } from "./_commonjsHelpers.DQNKXVTB.js";
11
+ import { r as Wi } from "./___vite-browser-external_commonjs-proxy.C2tf3HsQ.js";
12
+ function Qe(s) {
13
+ s.x0 = Math.round(s.x0), s.y0 = Math.round(s.y0), s.x1 = Math.round(s.x1), s.y1 = Math.round(s.y1);
14
+ }
15
+ function Ft(s, t, e, i, n) {
16
+ for (var a = s.children, o, h = -1, r = a.length, l = s.value && (i - t) / s.value; ++h < r; )
17
+ o = a[h], o.y0 = e, o.y1 = n, o.x0 = t, o.x1 = t += o.value * l;
18
+ }
19
+ function Je() {
20
+ var s = 1, t = 1, e = 0, i = !1;
21
+ function n(o) {
22
+ var h = o.height + 1;
23
+ return o.x0 = o.y0 = e, o.x1 = s, o.y1 = t / h, o.eachBefore(a(t, h)), i && o.eachBefore(Qe), o;
24
+ }
25
+ function a(o, h) {
26
+ return function(r) {
27
+ r.children && Ft(r, r.x0, o * (r.depth + 1) / h, r.x1, o * (r.depth + 2) / h);
28
+ var l = r.x0, u = r.y0, f = r.x1 - e, c = r.y1 - e;
29
+ f < l && (l = f = (l + f) / 2), c < u && (u = c = (u + c) / 2), r.x0 = l, r.y0 = u, r.x1 = f, r.y1 = c;
30
+ };
31
+ }
32
+ return n.round = function(o) {
33
+ return arguments.length ? (i = !!o, n) : i;
34
+ }, n.size = function(o) {
35
+ return arguments.length ? (s = +o[0], t = +o[1], n) : [s, t];
36
+ }, n.padding = function(o) {
37
+ return arguments.length ? (e = +o, n) : e;
38
+ }, n;
39
+ }
40
+ function Ii(s, t) {
41
+ return s.parent === t.parent ? 1 : 2;
42
+ }
43
+ function Yt(s) {
44
+ var t = s.children;
45
+ return t ? t[0] : s.t;
46
+ }
47
+ function Gt(s) {
48
+ var t = s.children;
49
+ return t ? t[t.length - 1] : s.t;
50
+ }
51
+ function Bi(s, t, e) {
52
+ var i = e / (t.i - s.i);
53
+ t.c -= i, t.s += e, s.c += i, t.z += e, t.m += e;
54
+ }
55
+ function Oi(s) {
56
+ for (var t = 0, e = 0, i = s.children, n = i.length, a; --n >= 0; )
57
+ a = i[n], a.z += t, a.m += t, t += a.s + (e += a.c);
58
+ }
59
+ function Ei(s, t, e) {
60
+ return s.a.parent === t.parent ? s.a : e;
61
+ }
62
+ function At(s, t) {
63
+ this._ = s, 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;
64
+ }
65
+ At.prototype = Object.create(Ai.prototype);
66
+ function Fi(s) {
67
+ for (var t = new At(s, 0), e, i = [t], n, a, o, h; e = i.pop(); )
68
+ if (a = e._.children)
69
+ for (e.children = new Array(h = a.length), o = h - 1; o >= 0; --o)
70
+ i.push(n = e.children[o] = new At(a[o], o)), n.parent = e;
71
+ return (t.parent = new At(null, 0)).children = [t], t;
72
+ }
73
+ function Vi() {
74
+ var s = Ii, t = 1, e = 1, i = null;
75
+ function n(l) {
76
+ var u = Fi(l);
77
+ if (u.eachAfter(a), u.parent.m = -u.z, u.eachBefore(o), i) l.eachBefore(r);
78
+ else {
79
+ var f = l, c = l, g = l;
80
+ l.eachBefore(function(m) {
81
+ m.x < f.x && (f = m), m.x > c.x && (c = m), m.depth > g.depth && (g = m);
82
+ });
83
+ var v = f === c ? 1 : s(f, c) / 2, d = v - f.x, p = t / (c.x + v + d), y = e / (g.depth || 1);
84
+ l.eachBefore(function(m) {
85
+ m.x = (m.x + d) * p, m.y = m.depth * y;
86
+ });
87
+ }
88
+ return l;
89
+ }
90
+ function a(l) {
91
+ var u = l.children, f = l.parent.children, c = l.i ? f[l.i - 1] : null;
92
+ if (u) {
93
+ Oi(l);
94
+ var g = (u[0].z + u[u.length - 1].z) / 2;
95
+ c ? (l.z = c.z + s(l._, c._), l.m = l.z - g) : l.z = g;
96
+ } else c && (l.z = c.z + s(l._, c._));
97
+ l.parent.A = h(l, c, l.parent.A || f[0]);
98
+ }
99
+ function o(l) {
100
+ l._.x = l.z + l.parent.m, l.m += l.parent.m;
101
+ }
102
+ function h(l, u, f) {
103
+ if (u) {
104
+ for (var c = l, g = l, v = u, d = c.parent.children[0], p = c.m, y = g.m, m = v.m, _ = d.m, x; v = Gt(v), c = Yt(c), v && c; )
105
+ d = Yt(d), g = Gt(g), g.a = l, x = v.z + m - c.z - p + s(v._, c._), x > 0 && (Bi(Ei(v, l, f), l, x), p += x, y += x), m += v.m, p += c.m, _ += d.m, y += g.m;
106
+ v && !Gt(g) && (g.t = v, g.m += m - y), c && !Yt(d) && (d.t = c, d.m += p - _, f = l);
107
+ }
108
+ return f;
109
+ }
110
+ function r(l) {
111
+ l.x *= t, l.y = l.depth * e;
112
+ }
113
+ return n.separation = function(l) {
114
+ return arguments.length ? (s = l, n) : s;
115
+ }, n.size = function(l) {
116
+ return arguments.length ? (i = !1, t = +l[0], e = +l[1], n) : i ? null : [t, e];
117
+ }, n.nodeSize = function(l) {
118
+ return arguments.length ? (i = !0, t = +l[0], e = +l[1], n) : i ? [t, e] : null;
119
+ }, n;
120
+ }
121
+ function ue(s, t, e, i, n) {
122
+ for (var a = s.children, o, h = -1, r = a.length, l = s.value && (n - e) / s.value; ++h < r; )
123
+ o = a[h], o.x0 = t, o.x1 = i, o.y0 = e, o.y1 = e += o.value * l;
124
+ }
125
+ var Xi = (1 + Math.sqrt(5)) / 2;
126
+ function qi(s, t, e, i, n, a) {
127
+ for (var o = [], h = t.children, r, l, u = 0, f = 0, c = h.length, g, v, d = t.value, p, y, m, _, x, w, k; u < c; ) {
128
+ g = n - e, v = a - i;
129
+ do
130
+ p = h[f++].value;
131
+ while (!p && f < c);
132
+ for (y = m = p, w = Math.max(v / g, g / v) / (d * s), k = p * p * w, x = Math.max(m / k, k / y); f < c; ++f) {
133
+ if (p += l = h[f].value, l < y && (y = l), l > m && (m = l), k = p * p * w, _ = Math.max(m / k, k / y), _ > x) {
134
+ p -= l;
135
+ break;
136
+ }
137
+ x = _;
138
+ }
139
+ o.push(r = { value: p, dice: g < v, children: h.slice(u, f) }), r.dice ? Ft(r, e, i, n, d ? i += v * p / d : a) : ue(r, e, i, d ? e += g * p / d : n, a), d -= p, u = f;
140
+ }
141
+ return o;
142
+ }
143
+ const te = function s(t) {
144
+ function e(i, n, a, o, h) {
145
+ qi(t, i, n, a, o, h);
146
+ }
147
+ return e.ratio = function(i) {
148
+ return s((i = +i) > 1 ? i : 1);
149
+ }, e;
150
+ }(Xi);
151
+ function Ce() {
152
+ var s = te, t = !1, e = 1, i = 1, n = [0], a = mt, o = mt, h = mt, r = mt, l = mt;
153
+ function u(c) {
154
+ return c.x0 = c.y0 = 0, c.x1 = e, c.y1 = i, c.eachBefore(f), n = [0], t && c.eachBefore(Qe), c;
155
+ }
156
+ function f(c) {
157
+ var g = n[c.depth], v = c.x0 + g, d = c.y0 + g, p = c.x1 - g, y = c.y1 - g;
158
+ p < v && (v = p = (v + p) / 2), y < d && (d = y = (d + y) / 2), c.x0 = v, c.y0 = d, c.x1 = p, c.y1 = y, c.children && (g = n[c.depth + 1] = a(c) / 2, v += l(c) - g, d += o(c) - g, p -= h(c) - g, y -= r(c) - g, p < v && (v = p = (v + p) / 2), y < d && (d = y = (d + y) / 2), s(c, v, d, p, y));
159
+ }
160
+ return u.round = function(c) {
161
+ return arguments.length ? (t = !!c, u) : t;
162
+ }, u.size = function(c) {
163
+ return arguments.length ? (e = +c[0], i = +c[1], u) : [e, i];
164
+ }, u.tile = function(c) {
165
+ return arguments.length ? (s = Si(c), u) : s;
166
+ }, u.padding = function(c) {
167
+ return arguments.length ? u.paddingInner(c).paddingOuter(c) : u.paddingInner();
168
+ }, u.paddingInner = function(c) {
169
+ return arguments.length ? (a = typeof c == "function" ? c : xt(+c), u) : a;
170
+ }, u.paddingOuter = function(c) {
171
+ return arguments.length ? u.paddingTop(c).paddingRight(c).paddingBottom(c).paddingLeft(c) : u.paddingTop();
172
+ }, u.paddingTop = function(c) {
173
+ return arguments.length ? (o = typeof c == "function" ? c : xt(+c), u) : o;
174
+ }, u.paddingRight = function(c) {
175
+ return arguments.length ? (h = typeof c == "function" ? c : xt(+c), u) : h;
176
+ }, u.paddingBottom = function(c) {
177
+ return arguments.length ? (r = typeof c == "function" ? c : xt(+c), u) : r;
178
+ }, u.paddingLeft = function(c) {
179
+ return arguments.length ? (l = typeof c == "function" ? c : xt(+c), u) : l;
180
+ }, u;
181
+ }
182
+ function Yi(s, t, e, i, n) {
183
+ var a = s.children, o, h = a.length, r, l = new Array(h + 1);
184
+ for (l[0] = r = o = 0; o < h; ++o)
185
+ l[o + 1] = r += a[o].value;
186
+ u(0, h, s.value, t, e, i, n);
187
+ function u(f, c, g, v, d, p, y) {
188
+ if (f >= c - 1) {
189
+ var m = a[f];
190
+ m.x0 = v, m.y0 = d, m.x1 = p, m.y1 = y;
191
+ return;
192
+ }
193
+ for (var _ = l[f], x = g / 2 + _, w = f + 1, k = c - 1; w < k; ) {
194
+ var A = w + k >>> 1;
195
+ l[A] < x ? w = A + 1 : k = A;
196
+ }
197
+ x - l[w - 1] < l[w] - x && f + 1 < w && --w;
198
+ var N = l[w] - _, C = g - N;
199
+ if (p - v > y - d) {
200
+ var b = g ? (v * C + p * N) / g : p;
201
+ u(f, w, N, v, d, b, y), u(w, c, C, b, d, p, y);
202
+ } else {
203
+ var S = g ? (d * C + y * N) / g : y;
204
+ u(f, w, N, v, d, p, S), u(w, c, C, v, S, p, y);
205
+ }
206
+ }
207
+ }
208
+ function Gi(s, t, e, i, n) {
209
+ (s.depth & 1 ? ue : Ft)(s, t, e, i, n);
210
+ }
211
+ function ji(s) {
212
+ const t = +this._x.call(null, s), e = +this._y.call(null, s);
213
+ return ti(this.cover(t, e), t, e, s);
214
+ }
215
+ function ti(s, t, e, i) {
216
+ if (isNaN(t) || isNaN(e)) return s;
217
+ var n, a = s._root, o = { data: i }, h = s._x0, r = s._y0, l = s._x1, u = s._y1, f, c, g, v, d, p, y, m;
218
+ if (!a) return s._root = o, s;
219
+ for (; a.length; )
220
+ if ((d = t >= (f = (h + l) / 2)) ? h = f : l = f, (p = e >= (c = (r + u) / 2)) ? r = c : u = c, n = a, !(a = a[y = p << 1 | d])) return n[y] = o, s;
221
+ if (g = +s._x.call(null, a.data), v = +s._y.call(null, a.data), t === g && e === v) return o.next = a, n ? n[y] = o : s._root = o, s;
222
+ do
223
+ n = n ? n[y] = new Array(4) : s._root = new Array(4), (d = t >= (f = (h + l) / 2)) ? h = f : l = f, (p = e >= (c = (r + u) / 2)) ? r = c : u = c;
224
+ while ((y = p << 1 | d) === (m = (v >= c) << 1 | g >= f));
225
+ return n[m] = a, n[y] = o, s;
226
+ }
227
+ function $i(s) {
228
+ var t, e, i = s.length, n, a, o = new Array(i), h = new Array(i), r = 1 / 0, l = 1 / 0, u = -1 / 0, f = -1 / 0;
229
+ for (e = 0; e < i; ++e)
230
+ isNaN(n = +this._x.call(null, t = s[e])) || isNaN(a = +this._y.call(null, t)) || (o[e] = n, h[e] = a, n < r && (r = n), n > u && (u = n), a < l && (l = a), a > f && (f = a));
231
+ if (r > u || l > f) return this;
232
+ for (this.cover(r, l).cover(u, f), e = 0; e < i; ++e)
233
+ ti(this, o[e], h[e], s[e]);
234
+ return this;
235
+ }
236
+ function Ui(s, t) {
237
+ if (isNaN(s = +s) || isNaN(t = +t)) return this;
238
+ var e = this._x0, i = this._y0, n = this._x1, a = this._y1;
239
+ if (isNaN(e))
240
+ n = (e = Math.floor(s)) + 1, a = (i = Math.floor(t)) + 1;
241
+ else {
242
+ for (var o = n - e || 1, h = this._root, r, l; e > s || s >= n || i > t || t >= a; )
243
+ switch (l = (t < i) << 1 | s < e, r = new Array(4), r[l] = h, h = r, o *= 2, l) {
244
+ case 0:
245
+ n = e + o, a = i + o;
246
+ break;
247
+ case 1:
248
+ e = n - o, a = i + o;
249
+ break;
250
+ case 2:
251
+ n = e + o, i = a - o;
252
+ break;
253
+ case 3:
254
+ e = n - o, i = a - o;
255
+ break;
256
+ }
257
+ this._root && this._root.length && (this._root = h);
258
+ }
259
+ return this._x0 = e, this._y0 = i, this._x1 = n, this._y1 = a, this;
260
+ }
261
+ function Ki() {
262
+ var s = [];
263
+ return this.visit(function(t) {
264
+ if (!t.length) do
265
+ s.push(t.data);
266
+ while (t = t.next);
267
+ }), s;
268
+ }
269
+ function Zi(s) {
270
+ return arguments.length ? this.cover(+s[0][0], +s[0][1]).cover(+s[1][0], +s[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
271
+ }
272
+ function Y(s, t, e, i, n) {
273
+ this.node = s, this.x0 = t, this.y0 = e, this.x1 = i, this.y1 = n;
274
+ }
275
+ function Qi(s, t, e) {
276
+ var i, n = this._x0, a = this._y0, o, h, r, l, u = this._x1, f = this._y1, c = [], g = this._root, v, d;
277
+ for (g && c.push(new Y(g, n, a, u, f)), e == null ? e = 1 / 0 : (n = s - e, a = t - e, u = s + e, f = t + e, e *= e); v = c.pop(); )
278
+ if (!(!(g = v.node) || (o = v.x0) > u || (h = v.y0) > f || (r = v.x1) < n || (l = v.y1) < a))
279
+ if (g.length) {
280
+ var p = (o + r) / 2, y = (h + l) / 2;
281
+ c.push(
282
+ new Y(g[3], p, y, r, l),
283
+ new Y(g[2], o, y, p, l),
284
+ new Y(g[1], p, h, r, y),
285
+ new Y(g[0], o, h, p, y)
286
+ ), (d = (t >= y) << 1 | s >= p) && (v = c[c.length - 1], c[c.length - 1] = c[c.length - 1 - d], c[c.length - 1 - d] = v);
287
+ } else {
288
+ var m = s - +this._x.call(null, g.data), _ = t - +this._y.call(null, g.data), x = m * m + _ * _;
289
+ if (x < e) {
290
+ var w = Math.sqrt(e = x);
291
+ n = s - w, a = t - w, u = s + w, f = t + w, i = g.data;
292
+ }
293
+ }
294
+ return i;
295
+ }
296
+ function Ji(s) {
297
+ if (isNaN(u = +this._x.call(null, s)) || isNaN(f = +this._y.call(null, s))) return this;
298
+ var t, e = this._root, i, n, a, o = this._x0, h = this._y0, r = this._x1, l = this._y1, u, f, c, g, v, d, p, y;
299
+ if (!e) return this;
300
+ if (e.length) for (; ; ) {
301
+ if ((v = u >= (c = (o + r) / 2)) ? o = c : r = c, (d = f >= (g = (h + l) / 2)) ? h = g : l = g, t = e, !(e = e[p = d << 1 | v])) return this;
302
+ if (!e.length) break;
303
+ (t[p + 1 & 3] || t[p + 2 & 3] || t[p + 3 & 3]) && (i = t, y = p);
304
+ }
305
+ for (; e.data !== s; ) if (n = e, !(e = e.next)) return this;
306
+ return (a = e.next) && delete e.next, n ? (a ? n.next = a : delete n.next, this) : t ? (a ? t[p] = a : delete t[p], (e = t[0] || t[1] || t[2] || t[3]) && e === (t[3] || t[2] || t[1] || t[0]) && !e.length && (i ? i[y] = e : this._root = e), this) : (this._root = a, this);
307
+ }
308
+ function tn(s) {
309
+ for (var t = 0, e = s.length; t < e; ++t) this.remove(s[t]);
310
+ return this;
311
+ }
312
+ function en() {
313
+ return this._root;
314
+ }
315
+ function nn() {
316
+ var s = 0;
317
+ return this.visit(function(t) {
318
+ if (!t.length) do
319
+ ++s;
320
+ while (t = t.next);
321
+ }), s;
322
+ }
323
+ function sn(s) {
324
+ var t = [], e, i = this._root, n, a, o, h, r;
325
+ for (i && t.push(new Y(i, this._x0, this._y0, this._x1, this._y1)); e = t.pop(); )
326
+ if (!s(i = e.node, a = e.x0, o = e.y0, h = e.x1, r = e.y1) && i.length) {
327
+ var l = (a + h) / 2, u = (o + r) / 2;
328
+ (n = i[3]) && t.push(new Y(n, l, u, h, r)), (n = i[2]) && t.push(new Y(n, a, u, l, r)), (n = i[1]) && t.push(new Y(n, l, o, h, u)), (n = i[0]) && t.push(new Y(n, a, o, l, u));
329
+ }
330
+ return this;
331
+ }
332
+ function rn(s) {
333
+ var t = [], e = [], i;
334
+ for (this._root && t.push(new Y(this._root, this._x0, this._y0, this._x1, this._y1)); i = t.pop(); ) {
335
+ var n = i.node;
336
+ if (n.length) {
337
+ var a, o = i.x0, h = i.y0, r = i.x1, l = i.y1, u = (o + r) / 2, f = (h + l) / 2;
338
+ (a = n[0]) && t.push(new Y(a, o, h, u, f)), (a = n[1]) && t.push(new Y(a, u, h, r, f)), (a = n[2]) && t.push(new Y(a, o, f, u, l)), (a = n[3]) && t.push(new Y(a, u, f, r, l));
339
+ }
340
+ e.push(i);
341
+ }
342
+ for (; i = e.pop(); )
343
+ s(i.node, i.x0, i.y0, i.x1, i.y1);
344
+ return this;
345
+ }
346
+ function an(s) {
347
+ return s[0];
348
+ }
349
+ function on(s) {
350
+ return arguments.length ? (this._x = s, this) : this._x;
351
+ }
352
+ function ln(s) {
353
+ return s[1];
354
+ }
355
+ function hn(s) {
356
+ return arguments.length ? (this._y = s, this) : this._y;
357
+ }
358
+ function fe(s, t, e) {
359
+ var i = new ge(t ?? an, e ?? ln, NaN, NaN, NaN, NaN);
360
+ return s == null ? i : i.addAll(s);
361
+ }
362
+ function ge(s, t, e, i, n, a) {
363
+ this._x = s, this._y = t, this._x0 = e, this._y0 = i, this._x1 = n, this._y1 = a, this._root = void 0;
364
+ }
365
+ function Re(s) {
366
+ for (var t = { data: s.data }, e = t; s = s.next; ) e = e.next = { data: s.data };
367
+ return t;
368
+ }
369
+ var U = fe.prototype = ge.prototype;
370
+ U.copy = function() {
371
+ var s = new ge(this._x, this._y, this._x0, this._y0, this._x1, this._y1), t = this._root, e, i;
372
+ if (!t) return s;
373
+ if (!t.length) return s._root = Re(t), s;
374
+ for (e = [{ source: t, target: s._root = new Array(4) }]; t = e.pop(); )
375
+ for (var n = 0; n < 4; ++n)
376
+ (i = t.source[n]) && (i.length ? e.push({ source: i, target: t.target[n] = new Array(4) }) : t.target[n] = Re(i));
377
+ return s;
378
+ };
379
+ U.add = ji;
380
+ U.addAll = $i;
381
+ U.cover = Ui;
382
+ U.data = Ki;
383
+ U.extent = Zi;
384
+ U.find = Qi;
385
+ U.remove = Ji;
386
+ U.removeAll = tn;
387
+ U.root = en;
388
+ U.size = nn;
389
+ U.visit = sn;
390
+ U.visitAfter = rn;
391
+ U.x = on;
392
+ U.y = hn;
393
+ function j(s) {
394
+ return function() {
395
+ return s;
396
+ };
397
+ }
398
+ function st(s) {
399
+ return (s() - 0.5) * 1e-6;
400
+ }
401
+ function cn(s) {
402
+ return s.x + s.vx;
403
+ }
404
+ function un(s) {
405
+ return s.y + s.vy;
406
+ }
407
+ function fn(s) {
408
+ var t, e, i, n = 1, a = 1;
409
+ typeof s != "function" && (s = j(s == null ? 1 : +s));
410
+ function o() {
411
+ for (var l, u = t.length, f, c, g, v, d, p, y = 0; y < a; ++y)
412
+ for (f = fe(t, cn, un).visitAfter(h), l = 0; l < u; ++l)
413
+ c = t[l], d = e[c.index], p = d * d, g = c.x + c.vx, v = c.y + c.vy, f.visit(m);
414
+ function m(_, x, w, k, A) {
415
+ var N = _.data, C = _.r, b = d + C;
416
+ if (N) {
417
+ if (N.index > c.index) {
418
+ var S = g - N.x - N.vx, W = v - N.y - N.vy, B = S * S + W * W;
419
+ B < b * b && (S === 0 && (S = st(i), B += S * S), W === 0 && (W = st(i), B += W * W), B = (b - (B = Math.sqrt(B))) / B * n, c.vx += (S *= B) * (b = (C *= C) / (p + C)), c.vy += (W *= B) * b, N.vx -= S * (b = 1 - b), N.vy -= W * b);
420
+ }
421
+ return;
422
+ }
423
+ return x > g + b || k < g - b || w > v + b || A < v - b;
424
+ }
425
+ }
426
+ function h(l) {
427
+ if (l.data) return l.r = e[l.data.index];
428
+ for (var u = l.r = 0; u < 4; ++u)
429
+ l[u] && l[u].r > l.r && (l.r = l[u].r);
430
+ }
431
+ function r() {
432
+ if (t) {
433
+ var l, u = t.length, f;
434
+ for (e = new Array(u), l = 0; l < u; ++l) f = t[l], e[f.index] = +s(f, l, t);
435
+ }
436
+ }
437
+ return o.initialize = function(l, u) {
438
+ t = l, i = u, r();
439
+ }, o.iterations = function(l) {
440
+ return arguments.length ? (a = +l, o) : a;
441
+ }, o.strength = function(l) {
442
+ return arguments.length ? (n = +l, o) : n;
443
+ }, o.radius = function(l) {
444
+ return arguments.length ? (s = typeof l == "function" ? l : j(+l), r(), o) : s;
445
+ }, o;
446
+ }
447
+ function gn(s) {
448
+ return s.index;
449
+ }
450
+ function Te(s, t) {
451
+ var e = s.get(t);
452
+ if (!e) throw new Error("node not found: " + t);
453
+ return e;
454
+ }
455
+ function jt(s) {
456
+ var t = gn, e = f, i, n = j(30), a, o, h, r, l, u = 1;
457
+ s == null && (s = []);
458
+ function f(p) {
459
+ return 1 / Math.min(h[p.source.index], h[p.target.index]);
460
+ }
461
+ function c(p) {
462
+ for (var y = 0, m = s.length; y < u; ++y)
463
+ for (var _ = 0, x, w, k, A, N, C, b; _ < m; ++_)
464
+ x = s[_], w = x.source, k = x.target, A = k.x + k.vx - w.x - w.vx || st(l), N = k.y + k.vy - w.y - w.vy || st(l), C = Math.sqrt(A * A + N * N), C = (C - a[_]) / C * p * i[_], A *= C, N *= C, k.vx -= A * (b = r[_]), k.vy -= N * b, w.vx += A * (b = 1 - b), w.vy += N * b;
465
+ }
466
+ function g() {
467
+ if (o) {
468
+ var p, y = o.length, m = s.length, _ = new Map(o.map((w, k) => [t(w, k, o), w])), x;
469
+ for (p = 0, h = new Array(y); p < m; ++p)
470
+ x = s[p], x.index = p, typeof x.source != "object" && (x.source = Te(_, x.source)), typeof x.target != "object" && (x.target = Te(_, x.target)), h[x.source.index] = (h[x.source.index] || 0) + 1, h[x.target.index] = (h[x.target.index] || 0) + 1;
471
+ for (p = 0, r = new Array(m); p < m; ++p)
472
+ x = s[p], r[p] = h[x.source.index] / (h[x.source.index] + h[x.target.index]);
473
+ i = new Array(m), v(), a = new Array(m), d();
474
+ }
475
+ }
476
+ function v() {
477
+ if (o)
478
+ for (var p = 0, y = s.length; p < y; ++p)
479
+ i[p] = +e(s[p], p, s);
480
+ }
481
+ function d() {
482
+ if (o)
483
+ for (var p = 0, y = s.length; p < y; ++p)
484
+ a[p] = +n(s[p], p, s);
485
+ }
486
+ return c.initialize = function(p, y) {
487
+ o = p, l = y, g();
488
+ }, c.links = function(p) {
489
+ return arguments.length ? (s = p, g(), c) : s;
490
+ }, c.id = function(p) {
491
+ return arguments.length ? (t = p, c) : t;
492
+ }, c.iterations = function(p) {
493
+ return arguments.length ? (u = +p, c) : u;
494
+ }, c.strength = function(p) {
495
+ return arguments.length ? (e = typeof p == "function" ? p : j(+p), v(), c) : e;
496
+ }, c.distance = function(p) {
497
+ return arguments.length ? (n = typeof p == "function" ? p : j(+p), d(), c) : n;
498
+ }, c;
499
+ }
500
+ const dn = 1664525, pn = 1013904223, ze = 4294967296;
501
+ function vn() {
502
+ let s = 1;
503
+ return () => (s = (dn * s + pn) % ze) / ze;
504
+ }
505
+ function yn(s) {
506
+ return s.x;
507
+ }
508
+ function mn(s) {
509
+ return s.y;
510
+ }
511
+ var xn = 10, _n = Math.PI * (3 - Math.sqrt(5));
512
+ function wn(s) {
513
+ var t, e = 1, i = 1e-3, n = 1 - Math.pow(i, 1 / 300), a = 0, o = 0.6, h = /* @__PURE__ */ new Map(), r = Ci(f), l = Ri("tick", "end"), u = vn();
514
+ s == null && (s = []);
515
+ function f() {
516
+ c(), l.call("tick", t), e < i && (r.stop(), l.call("end", t));
517
+ }
518
+ function c(d) {
519
+ var p, y = s.length, m;
520
+ d === void 0 && (d = 1);
521
+ for (var _ = 0; _ < d; ++_)
522
+ for (e += (a - e) * n, h.forEach(function(x) {
523
+ x(e);
524
+ }), p = 0; p < y; ++p)
525
+ m = s[p], m.fx == null ? m.x += m.vx *= o : (m.x = m.fx, m.vx = 0), m.fy == null ? m.y += m.vy *= o : (m.y = m.fy, m.vy = 0);
526
+ return t;
527
+ }
528
+ function g() {
529
+ for (var d = 0, p = s.length, y; d < p; ++d) {
530
+ if (y = s[d], y.index = d, y.fx != null && (y.x = y.fx), y.fy != null && (y.y = y.fy), isNaN(y.x) || isNaN(y.y)) {
531
+ var m = xn * Math.sqrt(0.5 + d), _ = d * _n;
532
+ y.x = m * Math.cos(_), y.y = m * Math.sin(_);
533
+ }
534
+ (isNaN(y.vx) || isNaN(y.vy)) && (y.vx = y.vy = 0);
535
+ }
536
+ }
537
+ function v(d) {
538
+ return d.initialize && d.initialize(s, u), d;
539
+ }
540
+ return g(), t = {
541
+ tick: c,
542
+ restart: function() {
543
+ return r.restart(f), t;
544
+ },
545
+ stop: function() {
546
+ return r.stop(), t;
547
+ },
548
+ nodes: function(d) {
549
+ return arguments.length ? (s = d, g(), h.forEach(v), t) : s;
550
+ },
551
+ alpha: function(d) {
552
+ return arguments.length ? (e = +d, t) : e;
553
+ },
554
+ alphaMin: function(d) {
555
+ return arguments.length ? (i = +d, t) : i;
556
+ },
557
+ alphaDecay: function(d) {
558
+ return arguments.length ? (n = +d, t) : +n;
559
+ },
560
+ alphaTarget: function(d) {
561
+ return arguments.length ? (a = +d, t) : a;
562
+ },
563
+ velocityDecay: function(d) {
564
+ return arguments.length ? (o = 1 - d, t) : 1 - o;
565
+ },
566
+ randomSource: function(d) {
567
+ return arguments.length ? (u = d, h.forEach(v), t) : u;
568
+ },
569
+ force: function(d, p) {
570
+ return arguments.length > 1 ? (p == null ? h.delete(d) : h.set(d, v(p)), t) : h.get(d);
571
+ },
572
+ find: function(d, p, y) {
573
+ var m = 0, _ = s.length, x, w, k, A, N;
574
+ for (y == null ? y = 1 / 0 : y *= y, m = 0; m < _; ++m)
575
+ A = s[m], x = d - A.x, w = p - A.y, k = x * x + w * w, k < y && (N = A, y = k);
576
+ return N;
577
+ },
578
+ on: function(d, p) {
579
+ return arguments.length > 1 ? (l.on(d, p), t) : l.on(d);
580
+ }
581
+ };
582
+ }
583
+ function Dn() {
584
+ var s, t, e, i, n = j(-30), a, o = 1, h = 1 / 0, r = 0.81;
585
+ function l(g) {
586
+ var v, d = s.length, p = fe(s, yn, mn).visitAfter(f);
587
+ for (i = g, v = 0; v < d; ++v) t = s[v], p.visit(c);
588
+ }
589
+ function u() {
590
+ if (s) {
591
+ var g, v = s.length, d;
592
+ for (a = new Array(v), g = 0; g < v; ++g) d = s[g], a[d.index] = +n(d, g, s);
593
+ }
594
+ }
595
+ function f(g) {
596
+ var v = 0, d, p, y = 0, m, _, x;
597
+ if (g.length) {
598
+ for (m = _ = x = 0; x < 4; ++x)
599
+ (d = g[x]) && (p = Math.abs(d.value)) && (v += d.value, y += p, m += p * d.x, _ += p * d.y);
600
+ g.x = m / y, g.y = _ / y;
601
+ } else {
602
+ d = g, d.x = d.data.x, d.y = d.data.y;
603
+ do
604
+ v += a[d.data.index];
605
+ while (d = d.next);
606
+ }
607
+ g.value = v;
608
+ }
609
+ function c(g, v, d, p) {
610
+ if (!g.value) return !0;
611
+ var y = g.x - t.x, m = g.y - t.y, _ = p - v, x = y * y + m * m;
612
+ if (_ * _ / r < x)
613
+ return x < h && (y === 0 && (y = st(e), x += y * y), m === 0 && (m = st(e), x += m * m), x < o && (x = Math.sqrt(o * x)), t.vx += y * g.value * i / x, t.vy += m * g.value * i / x), !0;
614
+ if (g.length || x >= h) return;
615
+ (g.data !== t || g.next) && (y === 0 && (y = st(e), x += y * y), m === 0 && (m = st(e), x += m * m), x < o && (x = Math.sqrt(o * x)));
616
+ do
617
+ g.data !== t && (_ = a[g.data.index] * i / x, t.vx += y * _, t.vy += m * _);
618
+ while (g = g.next);
619
+ }
620
+ return l.initialize = function(g, v) {
621
+ s = g, e = v, u();
622
+ }, l.strength = function(g) {
623
+ return arguments.length ? (n = typeof g == "function" ? g : j(+g), u(), l) : n;
624
+ }, l.distanceMin = function(g) {
625
+ return arguments.length ? (o = g * g, l) : Math.sqrt(o);
626
+ }, l.distanceMax = function(g) {
627
+ return arguments.length ? (h = g * g, l) : Math.sqrt(h);
628
+ }, l.theta = function(g) {
629
+ return arguments.length ? (r = g * g, l) : Math.sqrt(r);
630
+ }, l;
631
+ }
632
+ function kn(s) {
633
+ var t = j(0.1), e, i, n;
634
+ typeof s != "function" && (s = j(s == null ? 0 : +s));
635
+ function a(h) {
636
+ for (var r = 0, l = e.length, u; r < l; ++r)
637
+ u = e[r], u.vx += (n[r] - u.x) * i[r] * h;
638
+ }
639
+ function o() {
640
+ if (e) {
641
+ var h, r = e.length;
642
+ for (i = new Array(r), n = new Array(r), h = 0; h < r; ++h)
643
+ i[h] = isNaN(n[h] = +s(e[h], h, e)) ? 0 : +t(e[h], h, e);
644
+ }
645
+ }
646
+ return a.initialize = function(h) {
647
+ e = h, o();
648
+ }, a.strength = function(h) {
649
+ return arguments.length ? (t = typeof h == "function" ? h : j(+h), o(), a) : t;
650
+ }, a.x = function(h) {
651
+ return arguments.length ? (s = typeof h == "function" ? h : j(+h), o(), a) : s;
652
+ }, a;
653
+ }
654
+ function Nn(s) {
655
+ var t = j(0.1), e, i, n;
656
+ typeof s != "function" && (s = j(s == null ? 0 : +s));
657
+ function a(h) {
658
+ for (var r = 0, l = e.length, u; r < l; ++r)
659
+ u = e[r], u.vy += (n[r] - u.y) * i[r] * h;
660
+ }
661
+ function o() {
662
+ if (e) {
663
+ var h, r = e.length;
664
+ for (i = new Array(r), n = new Array(r), h = 0; h < r; ++h)
665
+ i[h] = isNaN(n[h] = +s(e[h], h, e)) ? 0 : +t(e[h], h, e);
666
+ }
667
+ }
668
+ return a.initialize = function(h) {
669
+ e = h, o();
670
+ }, a.strength = function(h) {
671
+ return arguments.length ? (t = typeof h == "function" ? h : j(+h), o(), a) : t;
672
+ }, a.y = function(h) {
673
+ return arguments.length ? (s = typeof h == "function" ? h : j(+h), o(), a) : s;
674
+ }, a;
675
+ }
676
+ class ei extends yi {
677
+ setupDefaultRules() {
678
+ super.setupDefaultRules();
679
+ const t = this._root.interfaceColors, e = this._root.gridLayout, i = this.rule.bind(this);
680
+ i("Hierarchy").setAll({
681
+ legendLabelText: "{category}",
682
+ legendValueText: "{sum.formatNumber('#.#')}",
683
+ width: Zt,
684
+ height: Zt,
685
+ colors: xi.new(this._root, { step: 2 }),
686
+ downDepth: 1,
687
+ initialDepth: 5,
688
+ singleBranchOnly: !0,
689
+ maskContent: !0,
690
+ animationEasing: mi(_i)
691
+ }), i("HierarchyNode").setAll({
692
+ toggleKey: "disabled",
693
+ setStateOnChildren: !0,
694
+ position: "absolute",
695
+ isMeasured: !1,
696
+ cursorOverStyle: "pointer",
697
+ tooltipText: "{category}: {sum}"
698
+ }), i("HierarchyNode", ["last"]).setAll({
699
+ cursorOverStyle: "default"
700
+ });
701
+ {
702
+ const n = i("Label", ["hierarchy", "node"]);
703
+ n.setAll({
704
+ centerX: O,
705
+ centerY: O,
706
+ position: "absolute",
707
+ paddingBottom: 1,
708
+ paddingTop: 1,
709
+ paddingRight: 4,
710
+ paddingLeft: 4,
711
+ text: "{category}",
712
+ populateText: !0,
713
+ oversizedBehavior: "fit",
714
+ minScale: 0.3
715
+ }), V(n, "fill", t, "alternativeText");
716
+ }
717
+ {
718
+ const n = i("HierarchyLink");
719
+ n.setAll({
720
+ isMeasured: !1,
721
+ position: "absolute",
722
+ strokeWidth: 1,
723
+ strokeOpacity: 1,
724
+ strength: 0.9,
725
+ distance: 1.1
726
+ }), V(n, "stroke", t, "grid");
727
+ }
728
+ i("Circle", ["linkedhierarchy", "shape"]).setAll({
729
+ position: "absolute",
730
+ fillOpacity: 1,
731
+ strokeOpacity: 0,
732
+ radius: 15,
733
+ tooltipY: 0
734
+ }), i("Circle", ["linkedhierarchy", "shape", "outer"]).setAll({
735
+ position: "absolute",
736
+ opacity: 1,
737
+ fillOpacity: 0,
738
+ strokeDasharray: 0,
739
+ strokeOpacity: 1,
740
+ radius: 15,
741
+ scale: 1.1,
742
+ interactive: !1
743
+ }), i("Circle", ["linkedhierarchy", "shape", "outer"]).states.create("disabled", { opacity: 1, scale: 1.1, strokeDasharray: 2 }), i("Circle", ["linkedhierarchy", "shape", "outer"]).states.create("hoverDisabled", { scale: 1.2, opacity: 1, strokeDasharray: 2 }), i("Circle", ["linkedhierarchy", "shape", "outer"]).states.create("hover", { scale: 1.05, strokeDasharray: 0 }), i("Circle", ["linkedhierarchy", "shape", "outer"]).states.create("hidden", { opacity: 0, strokeDasharray: 0 }), i("BreadcrumbBar").setAll({
744
+ paddingLeft: 8,
745
+ layout: e
746
+ });
747
+ {
748
+ const n = i("Label", ["breadcrumb"]);
749
+ n.setAll({
750
+ paddingRight: 4,
751
+ paddingLeft: 4,
752
+ cursorOverStyle: "pointer",
753
+ populateText: !0,
754
+ text: "{category}:"
755
+ }), V(n, "fill", t, "primaryButton");
756
+ }
757
+ {
758
+ const n = i("Label", ["breadcrumb"]).states.create("hover", {});
759
+ V(n, "fill", t, "primaryButtonHover");
760
+ }
761
+ {
762
+ const n = i("Label", ["breadcrumb"]).states.create("down", { stateAnimationDuration: 0 });
763
+ V(n, "fill", t, "primaryButtonDown");
764
+ }
765
+ {
766
+ const n = i("Label", ["breadcrumb", "last"]);
767
+ n.setAll({
768
+ populateText: !0,
769
+ text: "{category}",
770
+ fontWeight: "bold",
771
+ cursorOverStyle: "default"
772
+ }), V(n, "fill", t, "primaryButton");
773
+ }
774
+ {
775
+ const n = i("RoundedRectangle", ["breadcrumb", "label", "background"]);
776
+ n.setAll({
777
+ fillOpacity: 0
778
+ }), V(n, "fill", t, "background");
779
+ }
780
+ i("Partition").setAll({
781
+ downDepth: 1,
782
+ upDepth: 0,
783
+ initialDepth: 5
784
+ }), i("HierarchyNode", ["partition"]).setAll({
785
+ setStateOnChildren: !1
786
+ }), i("HierarchyNode", ["partition"]).states.create("hidden", {
787
+ opacity: 1,
788
+ visible: !0
789
+ });
790
+ {
791
+ const n = i("Label", ["partition", "node"]);
792
+ n.setAll({
793
+ x: O,
794
+ y: O,
795
+ centerY: O,
796
+ centerX: O,
797
+ paddingBottom: 1,
798
+ paddingTop: 1,
799
+ paddingLeft: 1,
800
+ paddingRight: 1,
801
+ rotation: 90,
802
+ populateText: !0,
803
+ text: "{category}",
804
+ oversizedBehavior: "fit",
805
+ minScale: 0.4
806
+ }), V(n, "fill", t, "alternativeText");
807
+ }
808
+ i("Label", ["horizontal", "partition", "node"]).setAll({
809
+ rotation: 0
810
+ });
811
+ {
812
+ const n = i("RoundedRectangle", ["partition", "node", "shape"]);
813
+ n.setAll({
814
+ strokeOpacity: 1,
815
+ strokeWidth: 1,
816
+ cornerRadiusBR: 0,
817
+ cornerRadiusTR: 0,
818
+ cornerRadiusBL: 0,
819
+ cornerRadiusTL: 0
820
+ }), V(n, "stroke", t, "background");
821
+ }
822
+ i("RoundedRectangle", ["partition", "node", "shape", "last"]).setAll({
823
+ fillOpacity: 0.75
824
+ }), i("Sunburst").setAll({
825
+ singleBranchOnly: !0
826
+ }), i("HierarchyNode", ["sunburst"]).setAll({
827
+ setStateOnChildren: !1
828
+ }), i("HierarchyNode", ["sunburst"]).states.create("hidden", {
829
+ opacity: 0,
830
+ visible: !1
831
+ });
832
+ {
833
+ const n = i("Slice", ["sunburst", "node", "shape"]);
834
+ n.setAll({
835
+ strokeOpacity: 1,
836
+ strokeWidth: 1,
837
+ cornerRadius: 0
838
+ }), V(n, "stroke", t, "background");
839
+ }
840
+ i("Slice", ["sunburst", "node", "shape", "last"]).setAll({
841
+ fillOpacity: 0.75
842
+ });
843
+ {
844
+ const n = i("RadialLabel", ["sunburst", "node"]);
845
+ n.setAll({
846
+ x: 0,
847
+ y: 0,
848
+ textType: "radial",
849
+ paddingBottom: 1,
850
+ paddingTop: 1,
851
+ paddingLeft: 1,
852
+ paddingRight: 1,
853
+ centerX: O,
854
+ populateText: !0,
855
+ text: "{category}",
856
+ oversizedBehavior: "fit",
857
+ minScale: 0.4,
858
+ baseRadius: O,
859
+ rotation: 0
860
+ }), V(n, "fill", t, "alternativeText");
861
+ }
862
+ i("ForceDirected").setAll({
863
+ minRadius: qt(1),
864
+ maxRadius: qt(8),
865
+ initialFrames: 500,
866
+ centerStrength: 0.8,
867
+ manyBodyStrength: -14,
868
+ velocityDecay: 0.5,
869
+ linkWithStrength: 0.5,
870
+ showOnFrame: 10,
871
+ singleBranchOnly: !1,
872
+ upDepth: 1 / 0,
873
+ downDepth: 1,
874
+ initialDepth: 5,
875
+ topDepth: 0
876
+ }), i("Tree").setAll({
877
+ orientation: "vertical",
878
+ paddingLeft: 20,
879
+ paddingRight: 20,
880
+ paddingTop: 20,
881
+ paddingBottom: 20,
882
+ singleBranchOnly: !1,
883
+ upDepth: 1 / 0,
884
+ downDepth: 1,
885
+ initialDepth: 5,
886
+ topDepth: 0
887
+ }), i("Pack").setAll({
888
+ paddingLeft: 20,
889
+ paddingTop: 20,
890
+ paddingBottom: 20,
891
+ paddingRight: 20,
892
+ nodePadding: 0
893
+ });
894
+ {
895
+ const n = i("Label", ["pack", "node"]);
896
+ n.setAll({
897
+ centerY: O,
898
+ centerX: O,
899
+ paddingBottom: 1,
900
+ paddingTop: 1,
901
+ paddingLeft: 1,
902
+ paddingRight: 1,
903
+ populateText: !0,
904
+ text: "{category}",
905
+ oversizedBehavior: "fit",
906
+ minScale: 0.4
907
+ }), V(n, "fill", t, "alternativeText");
908
+ }
909
+ {
910
+ const n = i("Circle", ["pack", "node", "shape"]);
911
+ n.setAll({
912
+ strokeOpacity: 0.5,
913
+ fillOpacity: 0.8,
914
+ strokeWidth: 1
915
+ }), V(n, "stroke", t, "background");
916
+ }
917
+ i("LinkedHierarchyNode").setAll({
918
+ draggable: !0
919
+ }), i("LinkedHierarchyNode").states.create("hidden", { scale: 0, opacity: 0, visible: !1 }), i("Treemap").setAll({
920
+ upDepth: 0,
921
+ layoutAlgorithm: "squarify"
922
+ });
923
+ {
924
+ const n = i("Label", ["treemap", "node"]);
925
+ n.setAll({
926
+ x: O,
927
+ y: O,
928
+ centerY: O,
929
+ centerX: O,
930
+ paddingBottom: 1,
931
+ paddingTop: 1,
932
+ paddingLeft: 1,
933
+ paddingRight: 1,
934
+ populateText: !0,
935
+ text: "{category}",
936
+ oversizedBehavior: "fit",
937
+ minScale: 0.4
938
+ }), V(n, "fill", t, "alternativeText");
939
+ }
940
+ i("HierarchyNode", ["treemap", "node"]).setAll({
941
+ tooltipY: qt(40),
942
+ isMeasured: !1,
943
+ position: "absolute",
944
+ cursorOverStyle: "pointer"
945
+ }), i("HierarchyNode", ["treemap", "node", "last"]).setAll({
946
+ cursorOverStyle: "default"
947
+ });
948
+ {
949
+ const n = i("RoundedRectangle", ["treemap", "node", "shape"]);
950
+ n.setAll({
951
+ strokeOpacity: 1,
952
+ strokeWidth: 1,
953
+ cornerRadiusBR: 0,
954
+ cornerRadiusTR: 0,
955
+ cornerRadiusBL: 0,
956
+ cornerRadiusTL: 0,
957
+ fillOpacity: 1
958
+ }), V(n, "stroke", t, "background");
959
+ }
960
+ i("VoronoiTreemap").setAll({
961
+ type: "polygon",
962
+ minWeightRatio: 5e-3,
963
+ convergenceRatio: 5e-3,
964
+ maxIterationCount: 100,
965
+ singleBranchOnly: !0
966
+ });
967
+ {
968
+ const n = i("Graphics", ["voronoitreemap", "node", "shape"]);
969
+ n.setAll({
970
+ strokeOpacity: 1,
971
+ strokeWidth: 1,
972
+ fillOpacity: 1
973
+ }), V(n, "stroke", t, "background");
974
+ }
975
+ i("Polygon", ["hierarchy", "node", "shape", "depth1"]).setAll({
976
+ strokeWidth: 3
977
+ });
978
+ {
979
+ const n = i("Label", ["voronoitreemap"]);
980
+ n.setAll({
981
+ centerY: O,
982
+ centerX: O,
983
+ paddingBottom: 1,
984
+ paddingTop: 1,
985
+ paddingLeft: 1,
986
+ paddingRight: 1,
987
+ populateText: !0,
988
+ text: "{category}",
989
+ oversizedBehavior: "fit",
990
+ minScale: 0.4,
991
+ layer: 30
992
+ }), V(n, "fill", t, "alternativeText");
993
+ }
994
+ }
995
+ }
996
+ class ee extends yt {
997
+ constructor() {
998
+ super(...arguments), this.labels = this.addDisposer(new Z(K.new({}), () => Ue._new(this._root, {
999
+ themeTags: G(this.labels.template.get("themeTags", []), ["label"]),
1000
+ background: ce.new(this._root, {
1001
+ themeTags: ["background"]
1002
+ })
1003
+ }, [this.labels.template])));
1004
+ }
1005
+ /**
1006
+ * @ignore
1007
+ */
1008
+ makeLabel(t) {
1009
+ const e = this.labels.make();
1010
+ return e._setDataItem(t), e.states.create("hover", {}), e.states.create("down", {}), e.events.on("click", () => {
1011
+ const i = this.get("series");
1012
+ i && i.selectDataItem(t);
1013
+ }), this.labels.push(e), e;
1014
+ }
1015
+ _afterNew() {
1016
+ this._defaultThemes.push(ei.new(this._root)), this._settings.themeTags = G(this._settings.themeTags, ["breadcrumb"]), super._afterNew();
1017
+ }
1018
+ _changed() {
1019
+ if (super._changed(), this.isDirty("series")) {
1020
+ const t = this.get("series"), e = this._prevSettings.series;
1021
+ t != e ? this._disposer = t.events.on("dataitemselected", (i) => {
1022
+ this._handleDataItem(i.dataItem);
1023
+ }) : e && this._disposer && this._disposer.dispose(), this._handleDataItem(t.get("selectedDataItem"));
1024
+ }
1025
+ }
1026
+ _handleDataItem(t) {
1027
+ if (this.set("minHeight", this.height()), this.children.clear(), this.labels.clear(), t) {
1028
+ let e = t;
1029
+ for (; e; ) {
1030
+ let i = this.makeLabel(e);
1031
+ e == t && i.addTag("last"), this.children.moveValue(i, 0), e = e.get("parent");
1032
+ }
1033
+ }
1034
+ }
1035
+ }
1036
+ ee.className = "BreadcrumbBar";
1037
+ ee.classNames = yt.classNames.concat([ee.className]);
1038
+ class dt extends yt {
1039
+ _afterNew() {
1040
+ super._afterNew(), this.states.create("disabled", {}), this.states.create("hover", {}), this.states.create("hoverDisabled", {}), this.on("disabled", () => {
1041
+ const t = this.dataItem;
1042
+ if (!t.get("children")) {
1043
+ this.set("disabled", !0);
1044
+ return;
1045
+ }
1046
+ const e = this.get("disabled"), i = this.series;
1047
+ t && i && t.get("disabled") != e && (e ? i.disableDataItem(t) : i.enableDataItem(t, i.get("downDepth", 1), 0));
1048
+ });
1049
+ }
1050
+ _changed() {
1051
+ super._changed(), this.isDirty("toggleKey") && (this.get("toggleKey") == "disabled" ? this._clickDisposer = this.events.on("click", () => {
1052
+ if (!this._isDragging) {
1053
+ let e = this.series;
1054
+ e && e.selectDataItem(this.dataItem);
1055
+ }
1056
+ }) : this._clickDisposer && this._clickDisposer.dispose());
1057
+ }
1058
+ }
1059
+ dt.className = "HierarchyNode";
1060
+ dt.classNames = yt.classNames.concat([dt.className]);
1061
+ class Q extends Ke {
1062
+ constructor() {
1063
+ super(...arguments), this.nodesContainer = this.children.push(yt.new(this._root, { isMeasured: !1 })), this._index = 0, this._tag = "hierarchy", this.nodes = this.addDisposer(new Z(K.new({}), () => dt.new(this._root, {
1064
+ themeTags: G(this.nodes.template.get("themeTags", []), [this._tag, "hierarchy", "node"])
1065
+ }, this.nodes.template))), this.labels = this.addDisposer(new Z(K.new({}), () => Ue.new(this._root, {
1066
+ themeTags: G(this.labels.template.get("themeTags", []), [this._tag])
1067
+ }, this.labels.template)));
1068
+ }
1069
+ _applyThemes(t = !1) {
1070
+ const e = this.get("colors");
1071
+ return e && e.reset(), super._applyThemes(t);
1072
+ }
1073
+ /**
1074
+ * @ignore
1075
+ */
1076
+ makeNode(t) {
1077
+ const e = t.get("childData"), i = this.nodes.make();
1078
+ i.series = this, i._setDataItem(t), this.nodes.push(i), t.setRaw("node", i);
1079
+ const n = this.labels.make();
1080
+ n._setDataItem(t), t.setRaw("label", n), this.labels.push(n), (!e || e.length == 0) && i.addTag("last");
1081
+ const a = t.get("depth");
1082
+ return i.addTag("depth" + a), this.nodesContainer.children.push(i), i.children.push(n), i;
1083
+ }
1084
+ _afterNew() {
1085
+ this._defaultThemes.push(ei.new(this._root)), this.fields.push("category", "childData", "disabled", "fill"), this.children.push(this.bulletsContainer), super._afterNew();
1086
+ }
1087
+ _prepareChildren() {
1088
+ if (super._prepareChildren(), this._valuesDirty) {
1089
+ this._treeData = {};
1090
+ const t = this.dataItems[0];
1091
+ if (t && (this._makeHierarchyData(this._treeData, t), this._index = 0, this._rootNode = Pi(this._treeData), this._rootNode)) {
1092
+ this._rootNode.sum((i) => i.value);
1093
+ const e = this.get("sort");
1094
+ e == "descending" ? this._rootNode.sort((i, n) => n.value - i.value) : e == "ascending" && this._rootNode.sort((i, n) => i.value - n.value), this.setPrivateRaw("valueLow", 1 / 0), this.setPrivateRaw("valueHigh", -1 / 0), this.setPrivateRaw("maxDepth", 0), this._updateValues(this._rootNode);
1095
+ }
1096
+ }
1097
+ if ((this._valuesDirty || this._sizeDirty) && this._updateVisuals(), this._sizeDirty) {
1098
+ const t = this.get("selectedDataItem");
1099
+ t && this._zoom(t);
1100
+ }
1101
+ }
1102
+ _changed() {
1103
+ super._changed(), this.isDirty("selectedDataItem") && this._selectDataItem(this.get("selectedDataItem"));
1104
+ }
1105
+ _updateVisuals() {
1106
+ this._rootNode && this._updateNodes(this._rootNode);
1107
+ }
1108
+ _updateNodes(t) {
1109
+ const e = t.data.dataItem;
1110
+ if (e) {
1111
+ this._updateNode(e), this.bullets.length > 0 && !e.bullets && this._makeBullets(e);
1112
+ const i = t.children;
1113
+ i && P(i, (n) => {
1114
+ this._updateNodes(n);
1115
+ });
1116
+ }
1117
+ }
1118
+ _updateNode(t) {
1119
+ }
1120
+ /**
1121
+ * Looks up and returns a data item by its ID.
1122
+ *
1123
+ * @param id ID
1124
+ * @return Data item
1125
+ */
1126
+ getDataItemById(t) {
1127
+ return this._getDataItemById(this.dataItems, t);
1128
+ }
1129
+ _getDataItemById(t, e) {
1130
+ let i;
1131
+ return P(t, (n) => {
1132
+ n.get("id") == e && (i = n);
1133
+ const a = n.get("children");
1134
+ if (a) {
1135
+ let o = this._getDataItemById(a, e);
1136
+ o && (i = o);
1137
+ }
1138
+ }), i;
1139
+ }
1140
+ _handleBullets(t) {
1141
+ P(t, (e) => {
1142
+ const i = e.bullets;
1143
+ i && (P(i, (a) => {
1144
+ a.dispose();
1145
+ }), e.bullets = void 0);
1146
+ const n = e.get("children");
1147
+ n && this._handleBullets(n);
1148
+ }), this._updateVisuals();
1149
+ }
1150
+ _onDataClear() {
1151
+ super._onDataClear();
1152
+ const t = this.get("colors");
1153
+ t && t.reset();
1154
+ const e = this.get("patterns");
1155
+ e && e.reset();
1156
+ }
1157
+ processDataItem(t) {
1158
+ super.processDataItem(t);
1159
+ const e = t.get("childData"), i = this.get("colors"), n = this.get("patterns"), a = this.get("topDepth", 0);
1160
+ t.get("parent") || (t.setRaw("depth", 0), i && a == 0 && t.get("fill") == null && (t.setRaw("fill", i.next()), n && t.setRaw("fillPattern", n.next())));
1161
+ let o = t.get("depth");
1162
+ const h = this.get("initialDepth", 1);
1163
+ if (this.makeNode(t), this._processDataItem(t), e) {
1164
+ const l = [];
1165
+ t.setRaw("children", l), P(e, (u) => {
1166
+ const f = new ke(this, u, this._makeDataItem(u));
1167
+ l.push(f), f.setRaw("parent", t), f.setRaw("depth", o + 1), this.dataItems.length == 1 && o == 0 ? (i && f.get("fill") == null && f.setRaw("fill", i.next()), n && f.get("fillPattern") == null && f.setRaw("fillPattern", n.next())) : (f.get("fill") == null && f.setRaw("fill", t.get("fill")), f.get("fillPattern") == null && f.setRaw("fillPattern", t.get("fillPattern"))), this.processDataItem(f);
1168
+ });
1169
+ }
1170
+ const r = t.get("children");
1171
+ (!r || r.length == 0) && t.get("node").setAll({ toggleKey: void 0 }), t.get("disabled") == null && o >= a + h && this.disableDataItem(t, 0);
1172
+ }
1173
+ /**
1174
+ * Adds children data to the target data item.
1175
+ *
1176
+ * @see {@link https://www.amcharts.com/docs/v5/charts/hierarchy/hierarchy-api/#Dynamically_adding_child_nodes} for more info
1177
+ * @since 5.4.5
1178
+ */
1179
+ addChildData(t, e) {
1180
+ const i = t.dataContext, n = this.get("childDataField");
1181
+ let a = i[n];
1182
+ a ? a.push(...e) : (a = e, i[n] = a);
1183
+ let o = t.get("children");
1184
+ o || (o = [], t.set("children", o));
1185
+ const h = t.get("node");
1186
+ h && h.set("toggleKey", this.nodes.template.get("toggleKey", "disabled"));
1187
+ let r = t.get("depth");
1188
+ P(a, (l) => {
1189
+ let u = !1;
1190
+ if (wi(o, (f) => f.dataContext == l ? (u = !0, !1) : !0), !u) {
1191
+ const f = new ke(this, l, this._makeDataItem(l));
1192
+ if (o.push(f), f.setRaw("parent", t), f.setRaw("depth", r + 1), f.get("fill") == null) {
1193
+ let c = t.get("fill");
1194
+ if (c == null) {
1195
+ const g = this.get("colors");
1196
+ g && (c = g.next());
1197
+ }
1198
+ f.setRaw("fill", c);
1199
+ }
1200
+ this.processDataItem(f);
1201
+ }
1202
+ });
1203
+ }
1204
+ _processDataItem(t) {
1205
+ }
1206
+ _updateValues(t) {
1207
+ const e = t.data.dataItem;
1208
+ if (t.depth > this.getPrivate("maxDepth") && this.setPrivateRaw("maxDepth", t.depth), e) {
1209
+ e.setRaw("d3HierarchyNode", t), t.index = this._index, this._index++, this.root.events.once("frameended", () => {
1210
+ e.get("node").set("disabled", e.get("disabled"));
1211
+ });
1212
+ let n = t.data.value, a = t.value;
1213
+ if (n != null && (a = n, t.value = a), X(a)) {
1214
+ e.setRaw("sum", a), e.setRaw("valuePercentTotal", a / this.dataItems[0].get("sum") * 100);
1215
+ let o = 100;
1216
+ const h = e.get("parent");
1217
+ h && (o = a / h.get("sum") * 100), e.get("label").text.markDirtyText(), e.setRaw("valuePercent", o);
1218
+ const r = this.getPrivate("valueLow");
1219
+ r != null && r > a && this.setPrivateRaw("valueLow", a);
1220
+ const l = this.getPrivate("valueHigh");
1221
+ l != null && l < a && this.setPrivateRaw("valueHigh", a);
1222
+ }
1223
+ this.updateLegendValue(e);
1224
+ }
1225
+ const i = t.children;
1226
+ i && P(i, (n) => {
1227
+ this._updateValues(n);
1228
+ });
1229
+ }
1230
+ _makeHierarchyData(t, e) {
1231
+ t.dataItem = e;
1232
+ const i = e.get("children");
1233
+ if (i) {
1234
+ const n = [];
1235
+ t.children = n, P(i, (o) => {
1236
+ const h = {};
1237
+ n.push(h), this._makeHierarchyData(h, o);
1238
+ });
1239
+ const a = e.get("valueWorking");
1240
+ X(a) && (t.value = a);
1241
+ } else {
1242
+ const n = e.get("valueWorking");
1243
+ X(n) && (t.value = n);
1244
+ }
1245
+ }
1246
+ /**
1247
+ * @ignore
1248
+ */
1249
+ disposeDataItem(t) {
1250
+ super.disposeDataItem(t);
1251
+ const e = t.get("node");
1252
+ e && (this.nodes.removeValue(e), e.dispose());
1253
+ const i = t.get("label");
1254
+ i && (this.labels.removeValue(i), i.dispose());
1255
+ const n = t.get("children");
1256
+ n && P(n, (a) => {
1257
+ this.disposeDataItem(a);
1258
+ });
1259
+ }
1260
+ /**
1261
+ * Hides hierarchy's data item.
1262
+ *
1263
+ * @param dataItem Data item
1264
+ * @param duration Animation duration in milliseconds
1265
+ * @return Promise
1266
+ */
1267
+ hideDataItem(t, e) {
1268
+ const i = Object.create(null, {
1269
+ hideDataItem: { get: () => super.hideDataItem }
1270
+ });
1271
+ return Ne(this, void 0, void 0, function* () {
1272
+ const n = [i.hideDataItem.call(this, t, e)], a = this.states.create("hidden", {});
1273
+ if (!X(e)) {
1274
+ const u = "stateAnimationDuration";
1275
+ e = a.get(u, this.get(u, 0));
1276
+ }
1277
+ const o = "stateAnimationEasing", h = a.get(o, this.get(o)), r = t.get("children");
1278
+ (!r || r.length == 0) && X(t.get("value")) && n.push(t.animate({ key: "valueWorking", to: 0, duration: e, easing: h }).waitForStop());
1279
+ const l = t.get("node");
1280
+ l.hide(), l.hideTooltip(), r && P(r, (u) => {
1281
+ n.push(this.hideDataItem(u));
1282
+ }), yield Promise.all(n);
1283
+ });
1284
+ }
1285
+ /**
1286
+ * Shows hierarchy's data item.
1287
+ *
1288
+ * @param dataItem Data item
1289
+ * @param duration Animation duration in milliseconds
1290
+ * @return Promise
1291
+ */
1292
+ showDataItem(t, e) {
1293
+ const i = Object.create(null, {
1294
+ showDataItem: { get: () => super.showDataItem }
1295
+ });
1296
+ return Ne(this, void 0, void 0, function* () {
1297
+ const n = [i.showDataItem.call(this, t, e)];
1298
+ X(e) || (e = this.get("stateAnimationDuration", 0));
1299
+ const a = this.get("stateAnimationEasing"), o = t.get("children");
1300
+ (!o || o.length == 0) && X(t.get("value")) && n.push(t.animate({ key: "valueWorking", to: t.get("value"), duration: e, easing: a }).waitForStop()), t.get("node").show(), o && P(o, (r) => {
1301
+ n.push(this.showDataItem(r));
1302
+ }), yield Promise.all(n);
1303
+ });
1304
+ }
1305
+ /**
1306
+ * Enables a disabled data item.
1307
+ *
1308
+ * @param dataItem Target data item
1309
+ * @param duration Animation duration in milliseconds
1310
+ */
1311
+ enableDataItem(t, e, i, n) {
1312
+ i == null && (i = 0), e == null && (e = 1), t.set("disabled", !1), t.get("node").set("disabled", !1), t.isHidden() || t.get("node").show(n);
1313
+ const a = this.get("topDepth", 0);
1314
+ if (t.get("depth") < a && t.get("node").hide(0), i == 0) {
1315
+ const h = this.get("upDepth", 1 / 0);
1316
+ let r = t, l = 0;
1317
+ for (; r !== void 0; )
1318
+ l > h && r.get("node").hide(), r = r.get("parent"), l++;
1319
+ }
1320
+ let o = t.get("children");
1321
+ o && (i < e - 1 ? P(o, (h) => {
1322
+ const r = this.get("disabledField");
1323
+ r ? h.dataContext[r] != !0 ? this.enableDataItem(h, e, i + 1, n) : this.disableDataItem(h) : this.enableDataItem(h, e, i + 1, n);
1324
+ }) : P(o, (h) => {
1325
+ h.isHidden() || (h.get("node").show(n), h.get("node").states.applyAnimate("disabled"), h.set("disabled", !0), this.disableDataItem(h));
1326
+ }));
1327
+ }
1328
+ /**
1329
+ * Disables a data item.
1330
+ *
1331
+ * @param dataItem Target data item
1332
+ * @param duration Animation duration in milliseconds
1333
+ */
1334
+ disableDataItem(t, e) {
1335
+ t.set("disabled", !0);
1336
+ let i = t.get("children");
1337
+ i && P(i, (n) => {
1338
+ this.disableDataItem(n, e), n.get("node").hide(e);
1339
+ });
1340
+ }
1341
+ _selectDataItem(t, e, i) {
1342
+ if (t) {
1343
+ if (!i) {
1344
+ const l = "dataitemselected";
1345
+ this.events.dispatch(l, { type: l, target: this, dataItem: t });
1346
+ }
1347
+ let n = this.getPrivate("maxDepth", 1);
1348
+ const a = this.get("topDepth", 0);
1349
+ e == null && (e = Math.min(this.get("downDepth", 1), n - t.get("depth")));
1350
+ const o = t.get("d3HierarchyNode");
1351
+ let h = o.depth;
1352
+ this.inited || (e = Math.min(this.get("initialDepth", 1), n - a), e = Math.max(0, e)), this._currentDownDepth = e, h + e > n && (e = n - h), h < a && (e += a - h, h = a);
1353
+ const r = t.get("children");
1354
+ r && r.length > 0 ? (e > 0 ? this.enableDataItem(t, e) : (t.get("node").show(), P(r, (l) => {
1355
+ l.get("node").hide();
1356
+ })), o.depth < a && t.get("node").hide(0), this.get("singleBranchOnly") && this._handleSingle(t)) : this.enableDataItem(t, e), this._root.events.once("frameended", () => {
1357
+ this._zoom(t);
1358
+ });
1359
+ }
1360
+ }
1361
+ _zoom(t) {
1362
+ }
1363
+ _handleSingle(t) {
1364
+ const e = t.get("parent");
1365
+ if (e) {
1366
+ const i = e.get("children");
1367
+ i && P(i, (n) => {
1368
+ n != t && this.disableDataItem(n);
1369
+ });
1370
+ }
1371
+ }
1372
+ /**
1373
+ * Selects specific data item.
1374
+ *
1375
+ * @param dataItem Target data item
1376
+ */
1377
+ selectDataItem(t) {
1378
+ const e = t.get("parent"), i = this.getPrivate("maxDepth", 1);
1379
+ if (this.get("selectedDataItem") == t)
1380
+ if (e)
1381
+ this.set("selectedDataItem", e);
1382
+ else {
1383
+ let n = Math.min(this.get("downDepth", 1), i - t.get("depth"));
1384
+ this._currentDownDepth == n && (n = Math.min(this.get("initialDepth", 1), i - this.get("topDepth", 0))), this._selectDataItem(t, n);
1385
+ }
1386
+ else
1387
+ this.set("selectedDataItem", t);
1388
+ }
1389
+ _makeBullet(t, e, i) {
1390
+ const n = super._makeBullet(t, e, i);
1391
+ if (n) {
1392
+ const a = n.get("sprite"), o = t.get("node");
1393
+ a && (o.children.push(a), o.on("width", () => {
1394
+ this._positionBullet(n);
1395
+ }), o.on("height", () => {
1396
+ this._positionBullet(n);
1397
+ }));
1398
+ }
1399
+ return n;
1400
+ }
1401
+ _positionBullet(t) {
1402
+ const e = t.get("sprite");
1403
+ if (e) {
1404
+ const i = e.dataItem, n = t.get("locationX", 0.5), a = t.get("locationY", 0.5), o = i.get("node");
1405
+ e.set("x", o.width() * n), e.set("y", o.height() * a);
1406
+ }
1407
+ }
1408
+ /**
1409
+ * Triggers hover on a series data item.
1410
+ *
1411
+ * @since 5.0.7
1412
+ * @param dataItem Target data item
1413
+ */
1414
+ hoverDataItem(t) {
1415
+ const e = t.get("node");
1416
+ e && !e.isHidden() && e.hover();
1417
+ }
1418
+ /**
1419
+ * Triggers un-hover on a series data item.
1420
+ *
1421
+ * @since 5.0.7
1422
+ * @param dataItem Target data item
1423
+ */
1424
+ unhoverDataItem(t) {
1425
+ const e = t.get("node");
1426
+ e && e.unhover();
1427
+ }
1428
+ }
1429
+ Q.className = "Hierarchy";
1430
+ Q.classNames = Ke.classNames.concat([Q.className]);
1431
+ class It extends dt {
1432
+ _afterNew() {
1433
+ super._afterNew(), this.states.create("disabled", {}), this.states.create("hover", {}), this.states.create("hoverDisabled", {});
1434
+ }
1435
+ _updateLinks(t) {
1436
+ const e = this.dataItem;
1437
+ if (e) {
1438
+ let i = e.get("links");
1439
+ P(i, (n) => {
1440
+ let a = n.get("source"), o = n.get("target");
1441
+ a && o && (a.get("node").isHidden() || o.get("node").isHidden() ? n.hide(t) : n.show(t));
1442
+ });
1443
+ }
1444
+ }
1445
+ _prepareChildren() {
1446
+ super._prepareChildren(), this.isDirty("disabled") && this._updateLinks();
1447
+ }
1448
+ _onHide(t) {
1449
+ super._onHide(t), this._updateLinks(t);
1450
+ }
1451
+ _onShow(t) {
1452
+ super._onShow(t), this._updateLinks(t);
1453
+ }
1454
+ }
1455
+ It.className = "LinkedHierarchyNode";
1456
+ It.classNames = dt.classNames.concat([It.className]);
1457
+ class Bt extends Ze {
1458
+ constructor() {
1459
+ super(...arguments), this.bullets = [];
1460
+ }
1461
+ _handleBullets(t) {
1462
+ P(this.bullets, (e) => {
1463
+ e.dispose();
1464
+ }), t.each((e) => {
1465
+ const i = e(this._root, this.get("source"), this.get("target"));
1466
+ if (i) {
1467
+ this.bullets.push(i);
1468
+ const n = i.get("sprite");
1469
+ if (this.addDisposer(i.on("locationX", () => {
1470
+ this._clear = !0, this.markDirty();
1471
+ })), n) {
1472
+ const a = this.series;
1473
+ a && a.linksContainer.children.push(n);
1474
+ }
1475
+ }
1476
+ });
1477
+ }
1478
+ _changed() {
1479
+ var t, e;
1480
+ if (super._changed(), this._clear) {
1481
+ let i = this.get("source"), n = this.get("target");
1482
+ if (i && n) {
1483
+ const a = i.get("node"), o = n.get("node"), h = a.x(), r = a.y(), l = o.x(), u = o.y();
1484
+ this._display.moveTo(h, r), this._display.lineTo(l, u);
1485
+ const f = (t = a.dataItem) === null || t === void 0 ? void 0 : t.get("outerCircle").get("radius", 0), c = (e = o.dataItem) === null || e === void 0 ? void 0 : e.get("outerCircle").get("radius", 0), g = Math.hypot(l - h, u - r), v = g - f - c;
1486
+ P(this.bullets, (d) => {
1487
+ const p = d.get("sprite");
1488
+ if (p) {
1489
+ const y = d.get("locationX", 0.5);
1490
+ p.set("x", h + f / g * (l - h) + v / g * (l - h) * y), p.set("y", r + f / g * (u - r) + v / g * (u - r) * y), d.get("autoRotate") && p.set("rotation", Math.atan2(u - r, l - h) * 180 / Math.PI + d.get("autoRotateAngle", 0));
1491
+ }
1492
+ });
1493
+ }
1494
+ }
1495
+ }
1496
+ hide(t) {
1497
+ return P(this.bullets, (e) => {
1498
+ if (e) {
1499
+ const i = e.get("sprite");
1500
+ i && i.hide(t);
1501
+ }
1502
+ }), super.hide();
1503
+ }
1504
+ show(t) {
1505
+ return P(this.bullets, (e) => {
1506
+ if (e) {
1507
+ const i = e.get("sprite");
1508
+ i && i.show(t);
1509
+ }
1510
+ }), super.show();
1511
+ }
1512
+ _beforeChanged() {
1513
+ if (super._beforeChanged(), this.isDirty("source")) {
1514
+ const t = this.get("source");
1515
+ t && t.get("node").events.on("positionchanged", () => {
1516
+ this._markDirtyKey("stroke");
1517
+ });
1518
+ }
1519
+ if (this.isDirty("target")) {
1520
+ const t = this.get("target");
1521
+ t && t.get("node").events.on("positionchanged", () => {
1522
+ this._markDirtyKey("stroke");
1523
+ });
1524
+ }
1525
+ }
1526
+ _dispose() {
1527
+ super._dispose(), P(this.bullets, (t) => {
1528
+ t.dispose();
1529
+ }), this.bullets = [];
1530
+ }
1531
+ }
1532
+ Bt.className = "HierarchyLink";
1533
+ Bt.classNames = Ze.classNames.concat([Bt.className]);
1534
+ class lt extends Q {
1535
+ constructor() {
1536
+ super(...arguments), this.linkBullets = new Di(), this.nodes = this.addDisposer(new Z(K.new({}), () => It._new(this._root, {
1537
+ themeTags: G(this.nodes.template.get("themeTags", []), [this._tag, "linkedhierarchy", "hierarchy", "node"]),
1538
+ x: this.width() / 2,
1539
+ y: this.height() / 2
1540
+ }, [this.nodes.template]))), this.circles = this.addDisposer(new Z(K.new({}), () => Jt._new(this._root, {
1541
+ themeTags: G(this.circles.template.get("themeTags", []), [this._tag, "shape"])
1542
+ }, [this.circles.template]))), this.outerCircles = this.addDisposer(new Z(K.new({}), () => Jt._new(this._root, {
1543
+ themeTags: G(this.outerCircles.template.get("themeTags", []), [this._tag, "outer", "shape"])
1544
+ }, [this.outerCircles.template]))), this.links = this.addDisposer(new Z(K.new({}), () => Bt._new(this._root, {
1545
+ themeTags: G(this.links.template.get("themeTags", []), [this._tag, "linkedhierarchy", "hierarchy", "link"])
1546
+ }, [this.links.template]))), this.linksContainer = this.children.moveValue(yt.new(this._root, {}), 0);
1547
+ }
1548
+ _afterNew() {
1549
+ this.fields.push("linkWith", "x", "y"), this._disposers.push(this.linkBullets.events.onAll(() => {
1550
+ this.links.each((t) => {
1551
+ t._handleBullets(this.linkBullets);
1552
+ });
1553
+ })), super._afterNew();
1554
+ }
1555
+ /**
1556
+ * @ignore
1557
+ */
1558
+ makeNode(t) {
1559
+ const e = super.makeNode(t), i = e.children.moveValue(this.circles.make(), 0);
1560
+ this.circles.push(i), e.setPrivate("tooltipTarget", i), t.setRaw("circle", i);
1561
+ const n = e.children.moveValue(this.outerCircles.make(), 0);
1562
+ this.outerCircles.push(n), t.setRaw("outerCircle", n);
1563
+ const a = t.get("label");
1564
+ i.on("radius", () => {
1565
+ const h = i.get("radius", this.width()) * 2;
1566
+ a.setAll({ maxWidth: h, maxHeight: h }), n.set("radius", h / 2), this._handleRadiusChange();
1567
+ });
1568
+ const o = i.get("radius", this.width()) * 2;
1569
+ return a.setAll({ maxWidth: o, maxHeight: o }), i._setDataItem(t), n._setDataItem(t), e;
1570
+ }
1571
+ _handleRadiusChange() {
1572
+ }
1573
+ processDataItem(t) {
1574
+ t.setRaw("childLinks", []), t.setRaw("links", []), super.processDataItem(t);
1575
+ }
1576
+ _processDataItem(t) {
1577
+ super._processDataItem(t);
1578
+ const e = t.get("parent");
1579
+ if (e && e.get("depth") >= this.get("topDepth")) {
1580
+ const n = this.linkDataItems(e, t);
1581
+ t.setRaw("parentLink", n);
1582
+ }
1583
+ const i = t.get("node");
1584
+ this.updateLinkWith(this.dataItems), i._updateLinks(0);
1585
+ }
1586
+ /**
1587
+ * @ignore
1588
+ */
1589
+ updateLinkWith(t) {
1590
+ P(t, (e) => {
1591
+ const i = e.get("linkWith");
1592
+ i && P(i, (a) => {
1593
+ const o = this._getDataItemById(this.dataItems, a);
1594
+ o && this.linkDataItems(e, o);
1595
+ });
1596
+ const n = e.get("children");
1597
+ n && this.updateLinkWith(n);
1598
+ });
1599
+ }
1600
+ _getPoint(t) {
1601
+ return { x: t.x, y: t.y };
1602
+ }
1603
+ _animatePositions(t) {
1604
+ const e = t.get("node"), i = t.get("d3HierarchyNode"), n = this._getPoint(i), a = this.get("animationDuration", 0), o = this.get("animationEasing");
1605
+ e.animate({ key: "x", to: n.x, duration: a, easing: o }), e.animate({ key: "y", to: n.y, duration: a, easing: o });
1606
+ }
1607
+ _updateNode(t) {
1608
+ super._updateNode(t), this._animatePositions(t);
1609
+ const i = t.get("d3HierarchyNode").children;
1610
+ i && P(i, (l) => {
1611
+ this._updateNodes(l);
1612
+ });
1613
+ const n = t.get("fill"), a = t.get("fillPattern"), o = t.get("circle"), h = t.get("children");
1614
+ o && (o._setDefault("fill", n), o._setDefault("fillPattern", a), o._setDefault("stroke", n));
1615
+ const r = t.get("outerCircle");
1616
+ r && (r._setDefault("fill", n), r._setDefault("stroke", n), !h || h.length == 0 ? r.setPrivate("visible", !1) : r.setPrivate("visible", !0));
1617
+ }
1618
+ /**
1619
+ * Link two data items with a link element.
1620
+ *
1621
+ * @param source Source node data item
1622
+ * @param target Target node data item
1623
+ * @param strength Link strength
1624
+ * @return Link element
1625
+ */
1626
+ linkDataItems(t, e, i) {
1627
+ let n;
1628
+ const a = t.get("links");
1629
+ a && P(a, (h) => {
1630
+ h.get("target") == e && (n = h);
1631
+ });
1632
+ const o = e.get("links");
1633
+ return o && P(o, (h) => {
1634
+ h.get("target") == t && (n = h);
1635
+ }), n || (n = this.links.make(), n.series = this, this.links.push(n), this.linksContainer.children.push(n), n.set("source", t), n.set("target", e), n._setDataItem(t), n._handleBullets(this.linkBullets), n.set("stroke", t.get("fill")), i != null && n.set("strength", i), t.get("childLinks").push(n), be(t.get("links"), n), be(e.get("links"), n), this._processLink(n, t, e)), n;
1636
+ }
1637
+ /**
1638
+ * Unlink two linked data items.
1639
+ *
1640
+ * @param source Source node data item
1641
+ * @param target Target node data item
1642
+ */
1643
+ unlinkDataItems(t, e) {
1644
+ let i;
1645
+ const n = t.get("links");
1646
+ n && P(n, (o) => {
1647
+ o && o.get("target") == e && (i = o, Qt(n, i));
1648
+ });
1649
+ const a = e.get("links");
1650
+ a && P(a, (o) => {
1651
+ o && o.get("target") == t && (i = o, Qt(a, i));
1652
+ }), i && this._disposeLink(i), this._handleUnlink();
1653
+ }
1654
+ _handleUnlink() {
1655
+ }
1656
+ _disposeLink(t) {
1657
+ this.links.removeValue(t), t.dispose();
1658
+ }
1659
+ /**
1660
+ * Returns `true` if two nodes are linked with each other.
1661
+ */
1662
+ areLinked(t, e) {
1663
+ const i = t.get("links");
1664
+ let n = !1;
1665
+ i && P(i, (o) => {
1666
+ o.get("target") == e && (n = !0);
1667
+ });
1668
+ const a = e.get("links");
1669
+ return a && P(a, (o) => {
1670
+ o.get("target") == t && (n = !0);
1671
+ }), n;
1672
+ }
1673
+ _processLink(t, e, i) {
1674
+ }
1675
+ /**
1676
+ * @ignore
1677
+ */
1678
+ disposeDataItem(t) {
1679
+ super.disposeDataItem(t);
1680
+ const e = t.get("links");
1681
+ e && P(e, (i) => {
1682
+ this._disposeLink(i);
1683
+ });
1684
+ }
1685
+ /**
1686
+ * Select a data item.
1687
+ * @param dataItem Data item
1688
+ */
1689
+ selectDataItem(t) {
1690
+ const e = t.get("parent");
1691
+ if (!t.get("disabled"))
1692
+ this.set("selectedDataItem", t);
1693
+ else if (e) {
1694
+ this.setRaw("selectedDataItem", e);
1695
+ const i = "dataitemselected";
1696
+ this.events.dispatch(i, { type: i, target: this, dataItem: e }), this.disableDataItem(t);
1697
+ }
1698
+ }
1699
+ }
1700
+ lt.className = "LinkedHierarchy";
1701
+ lt.classNames = Q.classNames.concat([lt.className]);
1702
+ class ie extends lt {
1703
+ constructor() {
1704
+ super(...arguments), this._tag = "forcedirected", this.d3forceSimulation = wn(), this.collisionForce = fn(20), this.linkForce = jt(), this._nodes = [], this._links = [], this._tick = 0, this._nodesDirty = !1;
1705
+ }
1706
+ _afterNew() {
1707
+ super._afterNew(), this.d3forceSimulation.on("tick", () => {
1708
+ this._tick++, this.updateNodePositions();
1709
+ });
1710
+ }
1711
+ _prepareChildren() {
1712
+ super._prepareChildren(), this.isDirty("showOnFrame") && this.get("showOnFrame") > this._tick && (this.nodesContainer.setPrivate("visible", !1), this.linksContainer.setPrivate("visible", !1));
1713
+ const t = this.d3forceSimulation;
1714
+ this.isDirty("velocityDecay") && t.velocityDecay(this.get("velocityDecay", 0)), this.isDirty("initialFrames") && t.alphaDecay(1 - Math.pow(1e-3, 1 / this.get("initialFrames", 500)));
1715
+ }
1716
+ /**
1717
+ * @ignore
1718
+ */
1719
+ restartSimulation(t) {
1720
+ const e = this.d3forceSimulation;
1721
+ e.alpha() < 0.25 && (e.alpha(t), e.restart());
1722
+ }
1723
+ _handleRadiusChange() {
1724
+ this._updateForces();
1725
+ }
1726
+ processDataItem(t) {
1727
+ const e = { index: this._index, x: this.innerWidth() / 2, y: this.innerHeight() / 2, dataItem: t }, i = this._nodes.push(e) - 1;
1728
+ e.index = i, this.d3forceSimulation.nodes(this._nodes), t.set("d3ForceNode", e), super.processDataItem(t);
1729
+ const n = t.get("node");
1730
+ n.set("x", -1e4), n.on("scale", () => {
1731
+ this._updateForces();
1732
+ }), n.events.on("dragged", () => {
1733
+ e.fx = n.x(), e.fy = n.y(), this._updateForces();
1734
+ }), n.events.on("dragstop", () => {
1735
+ t.get("x") == null && (e.fx = void 0), t.get("y") == null && (e.fy = void 0);
1736
+ });
1737
+ }
1738
+ _updateValues(t) {
1739
+ super._updateValues(t), this._nodesDirty = !0;
1740
+ const e = this.d3forceSimulation;
1741
+ e.force("collision", this.collisionForce), e.nodes(this._nodes), this.linkForce = jt(this._links), e.force("link", this.linkForce);
1742
+ }
1743
+ _updateVisuals() {
1744
+ super._updateVisuals(), this.restartSimulation(0.3);
1745
+ }
1746
+ _updateChildren() {
1747
+ super._updateChildren();
1748
+ const t = this.d3forceSimulation;
1749
+ if (this._sizeDirty) {
1750
+ let e = Math.max(50, this.innerWidth()), i = Math.max(50, this.innerHeight()), n = this.get("paddingTop", 0), a = this.get("paddingLeft", 0), o = this.get("centerStrength", 1);
1751
+ t.force("x", kn().x(e / 2 + a).strength(o * 100 / e)), t.force("y", Nn().y(i / 2 + n).strength(o * 100 / i));
1752
+ }
1753
+ this._nodesDirty && this._updateForces();
1754
+ }
1755
+ _updateForces() {
1756
+ this.d3forceSimulation.force("manybody", Dn().strength((e) => {
1757
+ let i = e.dataItem, n = i.get("node"), a = i.get("circle"), o = this.get("manyBodyStrength", -15);
1758
+ return a ? a.get("radius", 1) * n.get("scale", 1) * o : 0;
1759
+ })), this.collisionForce.radius((e) => {
1760
+ let i = e.dataItem, n = i.get("node"), a = i.get("circle"), o = i.get("outerCircle");
1761
+ if (a && o) {
1762
+ let h = a.get("radius", 1);
1763
+ return o.isHidden() || (h = h * o.get("scale", 1.1)), h *= n.get("scale", 1), h + this.get("nodePadding", 0);
1764
+ }
1765
+ }), this.restartSimulation(0.3);
1766
+ }
1767
+ _animatePositions(t) {
1768
+ }
1769
+ _clearDirty() {
1770
+ super._clearDirty(), this._nodesDirty = !1;
1771
+ }
1772
+ /**
1773
+ * @ignore
1774
+ */
1775
+ updateNodePositions() {
1776
+ const t = this.linkForce;
1777
+ t && (t.distance((i) => this.getDistance(i)), t.strength((i) => this.getStrength(i))), this._tick == this.get("showOnFrame") && (this.nodesContainer.setPrivate("visible", !0), this.linksContainer.setPrivate("visible", !0));
1778
+ let e = this.d3forceSimulation.nodes();
1779
+ P(e, (i) => {
1780
+ const a = i.dataItem.get("node");
1781
+ a.set("x", i.x), a.set("y", i.y);
1782
+ });
1783
+ }
1784
+ /**
1785
+ * @ignore
1786
+ */
1787
+ updateLinkWith(t) {
1788
+ P(t, (e) => {
1789
+ const i = e.get("linkWith");
1790
+ i && P(i, (a) => {
1791
+ const o = this._getDataItemById(this.dataItems, a);
1792
+ o && this.linkDataItems(e, o, this.get("linkWithStrength"));
1793
+ });
1794
+ const n = e.get("children");
1795
+ n && this.updateLinkWith(n);
1796
+ });
1797
+ }
1798
+ /**
1799
+ * @ignore
1800
+ */
1801
+ getDistance(t) {
1802
+ let e = t.sourceDataItem, i = t.targetDataItem, n = 0;
1803
+ if (e && i) {
1804
+ const a = i.get("node");
1805
+ if (a.isHidden())
1806
+ return 0;
1807
+ let o = t.link;
1808
+ o && (n = o.get("distance", 1));
1809
+ const h = e.get("node");
1810
+ return a.isHidden() && (n = 1), n * (e.get("circle").get("radius", 1) * h.get("scale", 1) + i.get("circle").get("radius", 1) * a.get("scale", 1));
1811
+ }
1812
+ return n;
1813
+ }
1814
+ /**
1815
+ * @ignore
1816
+ */
1817
+ getStrength(t) {
1818
+ let e = 0, i = t.link;
1819
+ i && (e = i.get("strength", 1));
1820
+ const n = t.targetDataItem;
1821
+ return e *= n.get("node").get("scale"), e;
1822
+ }
1823
+ _updateNode(t) {
1824
+ super._updateNode(t), this._updateRadius(t);
1825
+ const e = t.get("x"), i = t.get("y"), n = t.get("d3ForceNode");
1826
+ e != null ? n.fx = ut(e, this.innerWidth()) : n.fx = void 0, i != null ? n.fy = ut(i, this.innerHeight()) : n.fx = void 0;
1827
+ }
1828
+ _updateRadius(t) {
1829
+ let e = (this.innerWidth() + this.innerHeight()) / 2, i = ut(this.get("minRadius", 1), e), n = ut(this.get("maxRadius", 5), e), a = t.get("sum"), o = n;
1830
+ const h = this.getPrivate("valueLow", 0), r = this.getPrivate("valueHigh", 0);
1831
+ r > 0 && (o = i + (a - h) / (r - h) * (n - i)), X(o) || (o = i);
1832
+ const l = this.get("animationDuration", 0), u = this.get("animationEasing");
1833
+ t.get("circle").animate({ key: "radius", to: o, duration: l, easing: u });
1834
+ }
1835
+ _processLink(t, e, i) {
1836
+ const n = { link: t, source: e.get("d3ForceNode").index, target: i.get("d3ForceNode").index, sourceDataItem: e, targetDataItem: i };
1837
+ this._links.push(n), t.setPrivate("d3Link", n), this.linkForce = jt(this._links), this.d3forceSimulation.force("link", this.linkForce), this.restartSimulation(0.5);
1838
+ }
1839
+ _disposeLink(t) {
1840
+ super._disposeLink(t), Qt(this._links, t.getPrivate("d3Link"));
1841
+ }
1842
+ _handleUnlink() {
1843
+ this.restartSimulation(0.5);
1844
+ }
1845
+ _onDataClear() {
1846
+ super._onDataClear(), this._nodes = [], this._links = [];
1847
+ }
1848
+ }
1849
+ ie.className = "ForceDirected";
1850
+ ie.classNames = lt.classNames.concat([ie.className]);
1851
+ class ne extends Q {
1852
+ constructor() {
1853
+ super(...arguments), this._tag = "pack", this._packLayout = Ti(), this.circles = this.addDisposer(new Z(K.new({}), () => Jt._new(this._root, {
1854
+ themeTags: G(this.circles.template.get("themeTags", []), [this._tag, "shape"])
1855
+ }, [this.circles.template])));
1856
+ }
1857
+ _afterNew() {
1858
+ super._afterNew(), this.setPrivate("scaleR", 1);
1859
+ }
1860
+ _prepareChildren() {
1861
+ super._prepareChildren(), this.isPrivateDirty("scaleR") && this._rootNode && this._updateNodesScale(this._rootNode);
1862
+ }
1863
+ _updateVisuals() {
1864
+ if (this._rootNode) {
1865
+ const t = this._packLayout;
1866
+ t.size([this.innerWidth(), this.innerHeight()]), t(this._rootNode), t.padding(this.get("nodePadding", 0)), this._updateNodes(this._rootNode);
1867
+ }
1868
+ }
1869
+ _updateNode(t) {
1870
+ super._updateNode(t);
1871
+ const e = t.get("node"), i = t.get("circle"), n = t.get("d3HierarchyNode"), a = this.getPrivate("scaleR", 1), o = n.x * a, h = n.y * a, r = n.r * a, l = this.get("animationDuration", 0), u = this.get("animationEasing");
1872
+ if (e.animate({ key: "x", to: o, duration: l, easing: u }), e.animate({ key: "y", to: h, duration: l, easing: u }), i) {
1873
+ const f = t.get("fill"), c = t.get("fillPattern");
1874
+ i.animate({ key: "radius", to: r, duration: l, easing: u }), i._setDefault("fill", f), i._setDefault("fillPattern", c), i._setDefault("stroke", f);
1875
+ }
1876
+ }
1877
+ _updateNodesScale(t) {
1878
+ const e = t.data.dataItem;
1879
+ if (e) {
1880
+ const i = e.get("node"), n = e.get("circle"), a = this.getPrivate("scaleR", 1), o = t.x * a, h = t.y * a, r = t.r * a;
1881
+ i.setAll({ x: o, y: h }), n.set("radius", r);
1882
+ const l = t.children;
1883
+ l && P(l, (u) => {
1884
+ this._updateNodesScale(u);
1885
+ });
1886
+ }
1887
+ }
1888
+ /**
1889
+ * @ignore
1890
+ */
1891
+ makeNode(t) {
1892
+ const e = super.makeNode(t), i = e.children.moveValue(this.circles.make(), 0);
1893
+ e.setPrivate("tooltipTarget", i), this.circles.push(i), t.setRaw("circle", i);
1894
+ const n = t.get("label");
1895
+ return i.on("radius", () => {
1896
+ const a = i.get("radius", this.width()) * 2;
1897
+ n.setAll({ maxWidth: a, maxHeight: a });
1898
+ }), e;
1899
+ }
1900
+ _zoom(t) {
1901
+ const e = t.get("d3HierarchyNode");
1902
+ let i = e.x, n = e.y, a = e.r, o = Math.min(this.innerWidth(), this.innerHeight()) / (a * 2);
1903
+ const h = this.get("animationEasing");
1904
+ let r = this.get("animationDuration", 0);
1905
+ this.inited || (r = 0), this.animatePrivate({ key: "scaleR", to: o, duration: r, easing: h });
1906
+ const l = this.nodesContainer;
1907
+ l.animate({ key: "x", from: l.x(), to: this.width() / 2 - i * o, duration: r, easing: h }), l.animate({ key: "y", from: l.y(), to: this.height() / 2 - n * o, duration: r, easing: h });
1908
+ }
1909
+ }
1910
+ ne.className = "Pack";
1911
+ ne.classNames = Q.classNames.concat([ne.className]);
1912
+ class kt extends Q {
1913
+ constructor() {
1914
+ super(...arguments), this._tag = "partition", this.rectangles = this.addDisposer(new Z(K.new({}), () => ce._new(this._root, {
1915
+ themeTags: G(this.rectangles.template.get("themeTags", []), [this._tag, "shape"])
1916
+ }, [this.rectangles.template]))), this._partitionLayout = Je();
1917
+ }
1918
+ _afterNew() {
1919
+ this._settings.themeTags = G(this._settings.themeTags, ["partition", this._settings.orientation || "vertical"]), super._afterNew(), this.setPrivate("scaleX", 1), this.setPrivate("scaleY", 1);
1920
+ }
1921
+ _prepareChildren() {
1922
+ super._prepareChildren(), this.isDirty("nodePadding") && this._rootNode && this._updateNodes(this._rootNode), (this.isPrivateDirty("scaleX") || this.isPrivateDirty("scaleY")) && this._rootNode && this._updateNodesScale(this._rootNode), this.isDirty("orientation") && this._updateVisuals();
1923
+ }
1924
+ _updateVisuals() {
1925
+ if (this._rootNode) {
1926
+ const t = this._partitionLayout;
1927
+ let e = this.innerWidth(), i = this.innerHeight();
1928
+ this.get("orientation") == "horizontal" && ([e, i] = [i, e]), t.size([e, i]);
1929
+ const n = this.get("nodePadding");
1930
+ X(n) && t.padding(n), t(this._rootNode), this._updateNodes(this._rootNode);
1931
+ }
1932
+ }
1933
+ _updateNode(t) {
1934
+ super._updateNode(t);
1935
+ const e = t.get("node"), i = t.get("rectangle"), n = t.get("d3HierarchyNode"), a = this.getPrivate("scaleX", 1), o = this.getPrivate("scaleY", 1);
1936
+ let h, r, l, u;
1937
+ this.get("orientation") == "horizontal" ? (h = n.y0 * a, r = n.y1 * a, l = n.x0 * o, u = n.x1 * o) : (h = n.x0 * a, r = n.x1 * a, l = n.y0 * o, u = n.y1 * o);
1938
+ let f = r - h, c = u - l;
1939
+ const g = this.get("animationDuration", 0), v = this.get("animationEasing");
1940
+ if (e.animate({ key: "x", to: h, duration: g, easing: v }), e.animate({ key: "y", to: l, duration: g, easing: v }), e.animate({ key: "width", to: f, duration: g, easing: v }), e.animate({ key: "height", to: c, duration: g, easing: v }), i) {
1941
+ const d = t.get("fill"), p = t.get("fillPattern");
1942
+ i.animate({ key: "width", to: f, duration: g, easing: v }), i.animate({ key: "height", to: c, duration: g, easing: v }), i._setDefault("fill", d), i._setDefault("fillPattern", p), i._setDefault("stroke", d);
1943
+ }
1944
+ }
1945
+ _updateNodesScale(t) {
1946
+ const e = t.data.dataItem;
1947
+ if (e) {
1948
+ const i = e.get("node"), n = e.get("rectangle"), a = this.getPrivate("scaleX", 1), o = this.getPrivate("scaleY", 1);
1949
+ let h, r, l, u;
1950
+ this.get("orientation") == "horizontal" ? (h = t.y0 * a, r = t.y1 * a, l = t.x0 * o, u = t.x1 * o) : (h = t.x0 * a, r = t.x1 * a, l = t.y0 * o, u = t.y1 * o);
1951
+ const f = r - h, c = u - l;
1952
+ i.setAll({ x: h, y: l, width: f, height: c }), n.setAll({ width: f, height: c });
1953
+ const g = t.children;
1954
+ g && P(g, (v) => {
1955
+ this._updateNodesScale(v);
1956
+ });
1957
+ }
1958
+ }
1959
+ /**
1960
+ * @ignore
1961
+ */
1962
+ makeNode(t) {
1963
+ const e = super.makeNode(t);
1964
+ return this._makeNode(t, e), e;
1965
+ }
1966
+ _makeNode(t, e) {
1967
+ const i = e.children.moveValue(this.rectangles.make(), 0);
1968
+ e.setPrivate("tooltipTarget", i), t.setRaw("rectangle", i), i._setDataItem(t);
1969
+ const n = t.get("label");
1970
+ i.on("width", () => {
1971
+ n.set("maxWidth", i.width());
1972
+ }), i.on("height", () => {
1973
+ n.set("maxHeight", i.height());
1974
+ });
1975
+ }
1976
+ _zoom(t) {
1977
+ let e = 0, i = 0, n = 0, a = 0;
1978
+ const o = this.get("upDepth", 0) + 1, h = this.get("topDepth", 0), r = this.innerWidth(), l = this.innerHeight(), u = this.getPrivate("maxDepth", 1), f = l / (u + 1), c = r / (u + 1), g = Math.min(this.get("initialDepth", 1), u);
1979
+ let v = this._currentDownDepth;
1980
+ if (v == null && (v = this.get("downDepth", 1)), t) {
1981
+ const _ = t.get("d3HierarchyNode");
1982
+ let x = _.depth;
1983
+ this.get("orientation") == "horizontal" ? (e = _.y0, i = _.y1, n = _.x0, a = _.x1, e = i - c * o, i = e + c * (v + 1), x < h && (n = 0, a = l, e = c * h, i = e + c * g)) : (e = _.x0, i = _.x1, n = _.y0, a = _.y1, n = a - f * o, a = n + f * (v + 1), x < h && (e = 0, i = r, n = f * h, a = n + f * g));
1984
+ }
1985
+ let d = r / (i - e), p = l / (a - n);
1986
+ const y = this.get("animationEasing");
1987
+ let m = this.get("animationDuration", 0);
1988
+ this.inited || (m = 0), this.animatePrivate({ key: "scaleX", to: d, duration: m, easing: y }), this.animatePrivate({ key: "scaleY", to: p, duration: m, easing: y }), this.animate({ key: "_d", from: 0, to: 1, duration: m, easing: y }), this.nodesContainer.animate({ key: "x", to: -e * d, duration: m, easing: y }), this.nodesContainer.animate({ key: "y", to: -n * p, duration: m, easing: y });
1989
+ }
1990
+ }
1991
+ kt.className = "Partition";
1992
+ kt.classNames = Q.classNames.concat([kt.className]);
1993
+ class se extends kt {
1994
+ constructor() {
1995
+ super(...arguments), this._tag = "sunburst", this._partitionLayout = Je(), this.slices = this.addDisposer(new Z(K.new({}), () => zi._new(this._root, {
1996
+ themeTags: G(this.slices.template.get("themeTags", []), [this._tag, "hierarchy", "node", "shape"])
1997
+ }, [this.slices.template]))), this.labels = this.addDisposer(new Z(K.new({}), () => Li._new(this._root, {
1998
+ themeTags: G(this.labels.template.get("themeTags", []), [this._tag])
1999
+ }, [this.labels.template])));
2000
+ }
2001
+ _afterNew() {
2002
+ super._afterNew(), this.nodesContainer.setAll({ x: O, y: O }), this.setPrivateRaw("dx", 0), this.setPrivateRaw("dr", 0);
2003
+ }
2004
+ _prepareChildren() {
2005
+ super._prepareChildren(), (this.isPrivateDirty("dr") || this.isPrivateDirty("dx")) && this._rootNode && this._updateNodesScale(this._rootNode);
2006
+ }
2007
+ _updateVisuals() {
2008
+ if (this._rootNode) {
2009
+ const t = this._partitionLayout;
2010
+ let e = ki(0, 0, this.get("startAngle", 0), this.get("endAngle", 360), 1), i = this.innerWidth(), n = this.innerHeight();
2011
+ const a = i / (e.right - e.left), o = n / (e.bottom - e.top);
2012
+ let h = Math.min(a, o), r = ut(this.get("radius", Zt), h), l = ut(this.get("innerRadius", 0), r);
2013
+ l < 0 && (l = r + l), h = r - l, this.setPrivateRaw("innerRadius", l), this.setPrivateRaw("hierarchySize", h), t.size([h, h]), this.nodesContainer.setAll({
2014
+ dy: -r * (e.bottom + e.top) / 2,
2015
+ dx: -r * (e.right + e.left) / 2
2016
+ });
2017
+ const u = this.get("nodePadding");
2018
+ X(u) && t.padding(u), t(this._rootNode), this._updateNodes(this._rootNode);
2019
+ }
2020
+ }
2021
+ _updateNode(t) {
2022
+ super._updateNode(t);
2023
+ const e = t.get("d3HierarchyNode");
2024
+ t.get("node").setAll({ x: 0, y: 0 });
2025
+ const n = this.get("animationDuration", 0), a = this.get("animationEasing"), o = this.getPrivate("scaleX", 1), h = this.getPrivate("scaleY", 1), r = this.getPrivate("dr", 0), l = this.getPrivate("dx", 0), u = e.x0 * o + l, f = e.x1 * o + l, c = e.y0 * h, g = e.y1 * h, v = this.getPrivate("innerRadius"), d = this.getPrivate("hierarchySize", 0), p = t.get("slice");
2026
+ if (p) {
2027
+ const y = this.get("startAngle", -90), m = this.get("endAngle", 270), _ = y + u / d * (m - y), x = y + f / d * (m - y) - _;
2028
+ let w = v + c, k = v + g;
2029
+ w -= r, k -= r, k = Math.max(0, k), w = Math.max(0, w), p.animate({ key: "radius", to: k, duration: n, easing: a }), p.animate({ key: "innerRadius", to: w, duration: n, easing: a }), p.animate({ key: "startAngle", to: _, duration: n, easing: a }), p.animate({ key: "arc", to: x, duration: n, easing: a });
2030
+ const A = t.get("fill"), N = t.get("fillPattern");
2031
+ p._setDefault("fill", A), p._setDefault("fillPattern", N), p._setDefault("stroke", A);
2032
+ }
2033
+ }
2034
+ _updateNodesScale(t) {
2035
+ const e = t.data.dataItem;
2036
+ if (e) {
2037
+ const i = this.getPrivate("scaleX", 1), n = this.getPrivate("scaleY", 1), a = this.getPrivate("dr", 0), o = this.getPrivate("dx", 0), h = t.x0 * i + o, r = t.x1 * i + o, l = t.y0 * n, u = t.y1 * n, f = this.getPrivate("innerRadius"), c = this.getPrivate("hierarchySize", 0), g = e.get("slice");
2038
+ if (g) {
2039
+ const d = this.get("startAngle", -90), p = this.get("endAngle", 270), y = d + h / c * (p - d), m = d + r / c * (p - d) - y;
2040
+ let _ = f + l, x = f + u;
2041
+ _ -= a, x -= a, x = Math.max(0, x), _ = Math.max(0, _), g.setAll({ radius: x, innerRadius: _, startAngle: y, arc: m });
2042
+ }
2043
+ const v = t.children;
2044
+ v && P(v, (d) => {
2045
+ this._updateNodesScale(d);
2046
+ });
2047
+ }
2048
+ }
2049
+ _makeNode(t, e) {
2050
+ const i = e.children.moveValue(this.slices.make(), 0);
2051
+ e.setPrivate("tooltipTarget", i), t.setRaw("slice", i), i._setDataItem(t), i.on("arc", () => {
2052
+ this._updateLabel(t);
2053
+ }), i.on("innerRadius", () => {
2054
+ this._updateLabel(t);
2055
+ }), i.on("radius", () => {
2056
+ this._updateLabel(t);
2057
+ });
2058
+ }
2059
+ _updateLabel(t) {
2060
+ const e = t.get("slice"), i = t.get("label");
2061
+ if (e && i) {
2062
+ let n = e.get("innerRadius", 0), a = e.get("radius", 0), o = e.get("startAngle", 0), h = Math.abs(e.get("arc", 0)), r = o + h / 2, l = i.get("textType"), u = a - n, f = a * h * Ae;
2063
+ n == 0 && h >= 360 && l == "radial" && (a = 1, r = 0, u *= 2, f = u), Math.round(h) >= 360 && l == "radial" && (r = 0), l == "circular" && (u = h * Ae * (n + (a - n) / 2) - 10), i.setAll({ labelAngle: r }), i.setPrivate("radius", a), i.setPrivate("innerRadius", n), i.setAll({
2064
+ maxHeight: f,
2065
+ maxWidth: u
2066
+ });
2067
+ }
2068
+ }
2069
+ _zoom(t) {
2070
+ let e = 0, i = 0, n = this.getPrivate("hierarchySize", 0);
2071
+ const a = t.get("d3HierarchyNode");
2072
+ let o = this.get("upDepth", 0), h = this.get("topDepth", 0), r = a.depth, l = this.getPrivate("maxDepth", 1), u = this._currentDownDepth;
2073
+ u == null && (u = this.get("downDepth", 1));
2074
+ const f = n / (l + 1);
2075
+ r < h && (r = h), r - o < 0 && (o = r), e = a.x0, i = a.x1;
2076
+ let c = u + o + 1;
2077
+ c > l - h + 1 && (c = l - h + 1);
2078
+ let g = n / (i - e), v = n / (f * c), d = Math.max(r - o, h) * f * v;
2079
+ const p = this.get("animationEasing");
2080
+ let y = this.get("animationDuration", 0);
2081
+ this.inited || (y = 0);
2082
+ let m = -e * g;
2083
+ this.animatePrivate({ key: "scaleX", to: g, duration: y, easing: p }), this.animatePrivate({ key: "scaleY", to: v, duration: y, easing: p }), this.animatePrivate({ key: "dr", to: d, duration: y, easing: p }), this.animatePrivate({ key: "dx", to: m, duration: y, easing: p });
2084
+ }
2085
+ _handleSingle(t) {
2086
+ const e = t.get("parent");
2087
+ if (e) {
2088
+ const i = e.get("children");
2089
+ i && P(i, (n) => {
2090
+ n != t && (this.disableDataItem(n), n.get("node").hide());
2091
+ }), this._handleSingle(e);
2092
+ }
2093
+ }
2094
+ _positionBullet(t) {
2095
+ const e = t.get("sprite");
2096
+ if (e) {
2097
+ const i = e.dataItem, n = t.get("locationX", 0.5), a = t.get("locationY", 0.5), o = i.get("slice"), h = o.get("arc", 0), r = o.get("startAngle", 0) + o.get("arc", 0) * n, l = o.get("innerRadius", 0), u = l + (o.get("radius", 0) - l) * a;
2098
+ let f = Ni(r) * u, c = bi(r) * u;
2099
+ Pe(h, 5) === 360 && Pe(l, 2) === 0 && (f = 0, c = 0), e.set("x", f), e.set("y", c);
2100
+ }
2101
+ }
2102
+ _makeBullet(t, e, i) {
2103
+ const n = super._makeBullet(t, e, i);
2104
+ if (n) {
2105
+ const a = n.get("sprite"), o = t.get("slice");
2106
+ return a && o && (o.on("arc", () => {
2107
+ this._positionBullet(n);
2108
+ }), o.on("radius", () => {
2109
+ this._positionBullet(n);
2110
+ })), n;
2111
+ }
2112
+ }
2113
+ }
2114
+ se.className = "Sunburst";
2115
+ se.classNames = kt.classNames.concat([se.className]);
2116
+ class re extends lt {
2117
+ constructor() {
2118
+ super(...arguments), this._tag = "tree", this._hierarchyLayout = Vi();
2119
+ }
2120
+ _prepareChildren() {
2121
+ super._prepareChildren(), (this.isDirty("orientation") || this.isDirty("inversed")) && this._updateVisuals();
2122
+ }
2123
+ _updateVisuals() {
2124
+ if (this._rootNode) {
2125
+ const t = this._hierarchyLayout;
2126
+ this.get("orientation") == "vertical" ? t.size([this.innerWidth(), this.innerHeight()]) : t.size([this.innerHeight(), this.innerWidth()]), t(this._rootNode);
2127
+ }
2128
+ super._updateVisuals();
2129
+ }
2130
+ _getPoint(t) {
2131
+ const e = this.get("inversed");
2132
+ return this.get("orientation") == "vertical" ? e ? { x: t.x, y: this.innerHeight() - t.y } : { x: t.x, y: t.y } : e ? { x: this.innerWidth() - t.y, y: t.x } : { x: t.y, y: t.x };
2133
+ }
2134
+ }
2135
+ re.className = "Tree";
2136
+ re.classNames = lt.classNames.concat([re.className]);
2137
+ class ae extends Q {
2138
+ constructor() {
2139
+ super(...arguments), this._tag = "treemap", this.rectangleTemplate = K.new({}), this._treemapLayout = Ce().tile(te), this.rectangles = this.addDisposer(new Z(K.new({}), () => ce._new(this._root, {
2140
+ themeTags: G(this.rectangles.template.get("themeTags", []), [this._tag, "shape"])
2141
+ }, [this.rectangles.template])));
2142
+ }
2143
+ _afterNew() {
2144
+ super._afterNew(), this.setPrivate("scaleX", 1), this.setPrivate("scaleY", 1), this.nodes.template.setPrivate("trustBounds", !0);
2145
+ }
2146
+ _prepareChildren() {
2147
+ if (super._prepareChildren(), this.isDirty("layoutAlgorithm")) {
2148
+ let t;
2149
+ switch (this.get("layoutAlgorithm")) {
2150
+ case "squarify":
2151
+ t = te;
2152
+ break;
2153
+ case "binary":
2154
+ t = Yi;
2155
+ break;
2156
+ case "slice":
2157
+ t = ue;
2158
+ break;
2159
+ case "dice":
2160
+ t = Ft;
2161
+ break;
2162
+ case "sliceDice":
2163
+ t = Gi;
2164
+ break;
2165
+ }
2166
+ if (t) {
2167
+ this._treemapLayout = Ce().tile(t), this._updateVisuals();
2168
+ const e = this.get("selectedDataItem");
2169
+ e && this._zoom(e);
2170
+ }
2171
+ }
2172
+ (this.isDirty("nodePaddingRight") || this.isDirty("nodePaddingLeft") || this.isDirty("nodePaddingTop") || this.isDirty("nodePaddingBottom") || this.isDirty("nodePaddingOuter") || this.isDirty("nodePaddingInner")) && this._rootNode && this._updateNodes(this._rootNode), (this.isPrivateDirty("scaleX") || this.isPrivateDirty("scaleY")) && this._rootNode && this._updateNodesScale(this._rootNode);
2173
+ }
2174
+ _updateVisuals() {
2175
+ if (this._rootNode) {
2176
+ const t = this._treemapLayout;
2177
+ t.size([this.innerWidth(), this.innerHeight()]);
2178
+ const e = this.get("nodePaddingLeft"), i = this.get("nodePaddingRight"), n = this.get("nodePaddingTop"), a = this.get("nodePaddingBottom"), o = this.get("nodePaddingInner"), h = this.get("nodePaddingOuter");
2179
+ X(e) && t.paddingLeft(e), X(i) && t.paddingRight(i), X(n) && t.paddingTop(n), X(a) && t.paddingBottom(a), X(o) && t.paddingInner(o), X(h) && t.paddingOuter(h), t(this._rootNode), this._updateNodes(this._rootNode);
2180
+ }
2181
+ }
2182
+ _updateNode(t) {
2183
+ super._updateNode(t);
2184
+ const e = t.get("node"), i = t.get("rectangle"), n = t.get("d3HierarchyNode"), a = this.getPrivate("scaleX", 1), o = this.getPrivate("scaleY", 1), h = n.x0 * a, r = n.x1 * a, l = n.y0 * o, u = n.y1 * o, f = r - h, c = u - l, g = this.get("animationDuration", 0), v = this.get("animationEasing");
2185
+ if (e.animate({ key: "x", to: h, duration: g, easing: v }), e.animate({ key: "y", to: l, duration: g, easing: v }), e.animate({ key: "width", to: f, duration: g, easing: v }), e.animate({ key: "height", to: c, duration: g, easing: v }), i) {
2186
+ const d = t.get("fill"), p = t.get("fillPattern");
2187
+ i.animate({ key: "width", to: f, duration: g, easing: v }), i.animate({ key: "height", to: c, duration: g, easing: v }), i._setDefault("fill", d), i._setDefault("fillPattern", p), i._setDefault("stroke", d);
2188
+ }
2189
+ }
2190
+ _updateNodesScale(t) {
2191
+ const e = t.data.dataItem;
2192
+ if (e) {
2193
+ const i = e.get("node"), n = e.get("rectangle"), a = this.getPrivate("scaleX", 1), o = this.getPrivate("scaleY", 1), h = t.x0 * a, r = t.x1 * a, l = t.y0 * o, u = t.y1 * o, f = r - h, c = u - l;
2194
+ i.setAll({ x: h, y: l, width: f, height: c }), n.setAll({ width: f, height: c });
2195
+ const g = t.children;
2196
+ g && P(g, (v) => {
2197
+ this._updateNodesScale(v);
2198
+ });
2199
+ }
2200
+ }
2201
+ /**
2202
+ * @ignore
2203
+ */
2204
+ makeNode(t) {
2205
+ const e = super.makeNode(t), i = e.children.moveValue(this.rectangles.make(), 0);
2206
+ e.setPrivate("tooltipTarget", i), t.setRaw("rectangle", i);
2207
+ const n = t.get("label");
2208
+ return i.on("width", () => {
2209
+ n.setPrivate("maxWidth", i.width());
2210
+ }), i.on("height", () => {
2211
+ n.setPrivate("maxHeight", i.height());
2212
+ }), e;
2213
+ }
2214
+ _zoom(t) {
2215
+ if (this.width() > 0 && this.height() > 0) {
2216
+ const e = t.get("d3HierarchyNode"), i = this.get("nodePaddingOuter", 0);
2217
+ let n = e.x0 + i, a = e.x1 - i, o = e.y0 + i, h = e.y1 - i, r = (this.innerWidth() - i * 2) / (a - n), l = (this.innerHeight() - i * 2) / (h - o);
2218
+ const u = this.get("animationEasing");
2219
+ let f = this.get("animationDuration", 0);
2220
+ this.inited || (f = 0), this.animatePrivate({ key: "scaleX", to: r, duration: f, easing: u }), this.animatePrivate({ key: "scaleY", to: l, duration: f, easing: u }), this.nodesContainer.animate({ key: "x", to: i - n * r, duration: f, easing: u }), this.nodesContainer.animate({ key: "y", to: i - o * l, duration: f, easing: u });
2221
+ }
2222
+ }
2223
+ _selectDataItem(t, e, i) {
2224
+ if (super._selectDataItem(t, e, i), t) {
2225
+ let n = this.get("downDepth", 1) + t.get("depth");
2226
+ this.inited || (n = this.get("initialDepth", 1));
2227
+ const a = this._getVisibleNodes(t, n);
2228
+ this.nodes.each((o) => {
2229
+ a.indexOf(o.dataItem) == -1 ? o.setPrivate("focusable", !1) : o.removePrivate("focusable");
2230
+ });
2231
+ }
2232
+ this._root._invalidateTabindexes();
2233
+ }
2234
+ _getVisibleNodes(t, e) {
2235
+ const i = t.get("children");
2236
+ let n = [];
2237
+ return i && P(i, (a) => {
2238
+ a.get("depth") == e || !a.get("children") ? n.push(a) : n = n.concat(this._getVisibleNodes(a, e));
2239
+ }), n;
2240
+ }
2241
+ }
2242
+ ae.className = "Treemap";
2243
+ ae.classNames = Q.classNames.concat([ae.className]);
2244
+ function Pt(s) {
2245
+ for (var t = -1, e = s.length, i, n = s[e - 1], a = 0; ++t < e; )
2246
+ i = n, n = s[t], a += i[1] * n[0] - i[0] * n[1];
2247
+ return a / 2;
2248
+ }
2249
+ function bn(s) {
2250
+ for (var t = -1, e = s.length, i = 0, n = 0, a, o = s[e - 1], h, r = 0; ++t < e; )
2251
+ a = o, o = s[t], r += h = a[0] * o[1] - o[0] * a[1], i += (a[0] + o[0]) * h, n += (a[1] + o[1]) * h;
2252
+ return r *= 3, [i / r, n / r];
2253
+ }
2254
+ function ii(s, t) {
2255
+ for (var e = s.length, i = s[e - 1], n = t[0], a = t[1], o = i[0], h = i[1], r, l, u = !1, f = 0; f < e; ++f)
2256
+ i = s[f], r = i[0], l = i[1], l > a != h > a && n < (o - r) * (a - l) / (h - l) + r && (u = !u), o = r, h = l;
2257
+ return u;
2258
+ }
2259
+ var pt = 0, wt = 0, _t = 0, ni = 1e3, Ot, Dt, Et = 0, ht = 0, Vt = 0, Nt = typeof performance == "object" && performance.now ? performance : Date, si = typeof window == "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(s) {
2260
+ setTimeout(s, 17);
2261
+ };
2262
+ function ri() {
2263
+ return ht || (si(An), ht = Nt.now() + Vt);
2264
+ }
2265
+ function An() {
2266
+ ht = 0;
2267
+ }
2268
+ function oe() {
2269
+ this._call = this._time = this._next = null;
2270
+ }
2271
+ oe.prototype = ai.prototype = {
2272
+ constructor: oe,
2273
+ restart: function(s, t, e) {
2274
+ if (typeof s != "function") throw new TypeError("callback is not a function");
2275
+ e = (e == null ? ri() : +e) + (t == null ? 0 : +t), !this._next && Dt !== this && (Dt ? Dt._next = this : Ot = this, Dt = this), this._call = s, this._time = e, le();
2276
+ },
2277
+ stop: function() {
2278
+ this._call && (this._call = null, this._time = 1 / 0, le());
2279
+ }
2280
+ };
2281
+ function ai(s, t, e) {
2282
+ var i = new oe();
2283
+ return i.restart(s, t, e), i;
2284
+ }
2285
+ function Pn() {
2286
+ ri(), ++pt;
2287
+ for (var s = Ot, t; s; )
2288
+ (t = ht - s._time) >= 0 && s._call.call(null, t), s = s._next;
2289
+ --pt;
2290
+ }
2291
+ function Le() {
2292
+ ht = (Et = Nt.now()) + Vt, pt = wt = 0;
2293
+ try {
2294
+ Pn();
2295
+ } finally {
2296
+ pt = 0, Rn(), ht = 0;
2297
+ }
2298
+ }
2299
+ function Cn() {
2300
+ var s = Nt.now(), t = s - Et;
2301
+ t > ni && (Vt -= t, Et = s);
2302
+ }
2303
+ function Rn() {
2304
+ for (var s, t = Ot, e, i = 1 / 0; t; )
2305
+ t._call ? (i > t._time && (i = t._time), s = t, t = t._next) : (e = t._next, t._next = null, t = s ? s._next = e : Ot = e);
2306
+ Dt = s, le(i);
2307
+ }
2308
+ function le(s) {
2309
+ if (!pt) {
2310
+ wt && (wt = clearTimeout(wt));
2311
+ var t = s - ht;
2312
+ t > 24 ? (s < 1 / 0 && (wt = setTimeout(Le, s - Nt.now() - Vt)), _t && (_t = clearInterval(_t))) : (_t || (Et = Nt.now(), _t = setInterval(Cn, ni)), pt = 1, si(Le));
2313
+ }
2314
+ }
2315
+ var Tn = { value: () => {
2316
+ } };
2317
+ function oi() {
2318
+ for (var s = 0, t = arguments.length, e = {}, i; s < t; ++s) {
2319
+ if (!(i = arguments[s] + "") || i in e || /[\s.]/.test(i)) throw new Error("illegal type: " + i);
2320
+ e[i] = [];
2321
+ }
2322
+ return new Ct(e);
2323
+ }
2324
+ function Ct(s) {
2325
+ this._ = s;
2326
+ }
2327
+ function zn(s, t) {
2328
+ return s.trim().split(/^|\s+/).map(function(e) {
2329
+ var i = "", n = e.indexOf(".");
2330
+ if (n >= 0 && (i = e.slice(n + 1), e = e.slice(0, n)), e && !t.hasOwnProperty(e)) throw new Error("unknown type: " + e);
2331
+ return { type: e, name: i };
2332
+ });
2333
+ }
2334
+ Ct.prototype = oi.prototype = {
2335
+ constructor: Ct,
2336
+ on: function(s, t) {
2337
+ var e = this._, i = zn(s + "", e), n, a = -1, o = i.length;
2338
+ if (arguments.length < 2) {
2339
+ for (; ++a < o; ) if ((n = (s = i[a]).type) && (n = Ln(e[n], s.name))) return n;
2340
+ return;
2341
+ }
2342
+ if (t != null && typeof t != "function") throw new Error("invalid callback: " + t);
2343
+ for (; ++a < o; )
2344
+ if (n = (s = i[a]).type) e[n] = Se(e[n], s.name, t);
2345
+ else if (t == null) for (n in e) e[n] = Se(e[n], s.name, null);
2346
+ return this;
2347
+ },
2348
+ copy: function() {
2349
+ var s = {}, t = this._;
2350
+ for (var e in t) s[e] = t[e].slice();
2351
+ return new Ct(s);
2352
+ },
2353
+ call: function(s, t) {
2354
+ if ((n = arguments.length - 2) > 0) for (var e = new Array(n), i = 0, n, a; i < n; ++i) e[i] = arguments[i + 2];
2355
+ if (!this._.hasOwnProperty(s)) throw new Error("unknown type: " + s);
2356
+ for (a = this._[s], i = 0, n = a.length; i < n; ++i) a[i].value.apply(t, e);
2357
+ },
2358
+ apply: function(s, t, e) {
2359
+ if (!this._.hasOwnProperty(s)) throw new Error("unknown type: " + s);
2360
+ for (var i = this._[s], n = 0, a = i.length; n < a; ++n) i[n].value.apply(t, e);
2361
+ }
2362
+ };
2363
+ function Ln(s, t) {
2364
+ for (var e = 0, i = s.length, n; e < i; ++e)
2365
+ if ((n = s[e]).name === t)
2366
+ return n.value;
2367
+ }
2368
+ function Se(s, t, e) {
2369
+ for (var i = 0, n = s.length; i < n; ++i)
2370
+ if (s[i].name === t) {
2371
+ s[i] = Tn, s = s.slice(0, i).concat(s.slice(i + 1));
2372
+ break;
2373
+ }
2374
+ return e != null && s.push({ name: t, value: e }), s;
2375
+ }
2376
+ function Me(s, t) {
2377
+ let e, i;
2378
+ for (const n of s)
2379
+ n != null && (e === void 0 ? n >= n && (e = i = n) : (e > n && (e = n), i < n && (i = n)));
2380
+ return [e, i];
2381
+ }
2382
+ function Sn(s, t, e) {
2383
+ return (t[0] - s[0]) * (e[1] - s[1]) - (t[1] - s[1]) * (e[0] - s[0]);
2384
+ }
2385
+ function Mn(s, t) {
2386
+ return s[0] - t[0] || s[1] - t[1];
2387
+ }
2388
+ function He(s) {
2389
+ const t = s.length, e = [0, 1];
2390
+ let i = 2, n;
2391
+ for (n = 2; n < t; ++n) {
2392
+ for (; i > 1 && Sn(s[e[i - 2]], s[e[i - 1]], s[n]) <= 0; ) --i;
2393
+ e[i++] = n;
2394
+ }
2395
+ return e.slice(0, i);
2396
+ }
2397
+ function Hn(s) {
2398
+ if ((e = s.length) < 3) return null;
2399
+ var t, e, i = new Array(e), n = new Array(e);
2400
+ for (t = 0; t < e; ++t) i[t] = [+s[t][0], +s[t][1], t];
2401
+ for (i.sort(Mn), t = 0; t < e; ++t) n[t] = [i[t][0], -i[t][1]];
2402
+ var a = He(i), o = He(n), h = o[0] === a[0], r = o[o.length - 1] === a[a.length - 1], l = [];
2403
+ for (t = a.length - 1; t >= 0; --t) l.push(s[i[a[t]][2]]);
2404
+ for (t = +h; t < o.length - r; ++t) l.push(s[i[o[t]][2]]);
2405
+ return l;
2406
+ }
2407
+ function Wn(s) {
2408
+ for (var t = -1, e = s.length, i = s[e - 1], n, a, o = i[0], h = i[1], r = 0; ++t < e; )
2409
+ n = o, a = h, i = s[t], o = i[0], h = i[1], n -= o, a -= h, r += Math.hypot(n, a);
2410
+ return r;
2411
+ }
2412
+ var rt = 1e-10;
2413
+ function Rt(s) {
2414
+ return s <= rt && s >= -rt;
2415
+ }
2416
+ function vt(s, t) {
2417
+ return s.x * t.x + s.y * t.y + s.z * t.z;
2418
+ }
2419
+ function We(s, t) {
2420
+ return Rt(s.x * t.y - s.y * t.x) && Rt(s.y * t.z - s.z * t.y) && Rt(s.z * t.x - s.x * t.z);
2421
+ }
2422
+ function In(s) {
2423
+ var t, e, i, n, a, o, h, r;
2424
+ if (i = s[s.length - 2], n = s[s.length - 1], a = s[0], o = bt(i, n), h = bt(n, a), e = $t(o, h), t = Math.sign(e), i = n, n = a, a = s[1], o = h, h = bt(n, a), e = $t(o, h), Math.sign(e) === t) {
2425
+ for (r = 2; r < s.length - 1; r++)
2426
+ if (i = n, n = a, a = s[r], o = h, h = bt(n, a), e = $t(o, h), Math.sign(e) !== t)
2427
+ return;
2428
+ return t;
2429
+ }
2430
+ }
2431
+ function bt(s, t) {
2432
+ return [t[0] - s[0], t[1] - s[1]];
2433
+ }
2434
+ function $t(s, t) {
2435
+ return s[0] * t[1] - s[1] * t[0];
2436
+ }
2437
+ function Bn(s, t) {
2438
+ this.face = s, this.vert = t, this.nextf = null, this.prevf = null, this.nextv = null, this.prevv = null;
2439
+ }
2440
+ function at(s) {
2441
+ this.forFace = s, this.head = null;
2442
+ }
2443
+ at.prototype.add = function(s) {
2444
+ this.head === null ? this.head = s : this.forFace ? (this.head.prevv = s, s.nextv = this.head, this.head = s) : (this.head.prevf = s, s.nextf = this.head, this.head = s);
2445
+ };
2446
+ at.prototype.isEmpty = function() {
2447
+ return this.head === null;
2448
+ };
2449
+ at.prototype.fill = function(s) {
2450
+ if (!this.forFace) {
2451
+ var t = this.head;
2452
+ do
2453
+ s.push(t.face), t.face.marked = !0, t = t.nextf;
2454
+ while (t !== null);
2455
+ }
2456
+ };
2457
+ at.prototype.removeAll = function() {
2458
+ if (this.forFace) {
2459
+ var s = this.head;
2460
+ do
2461
+ s.prevf === null ? s.nextf === null ? s.vert.conflicts.head = null : (s.nextf.prevf = null, s.vert.conflicts.head = s.nextf) : (s.nextf != null && (s.nextf.prevf = s.prevf), s.prevf.nextf = s.nextf), s = s.nextv, s != null && (s.prevv = null);
2462
+ while (s != null);
2463
+ } else {
2464
+ var s = this.head;
2465
+ do
2466
+ s.prevv == null ? s.nextv == null ? s.face.conflicts.head = null : (s.nextv.prevv = null, s.face.conflicts.head = s.nextv) : (s.nextv != null && (s.nextv.prevv = s.prevv), s.prevv.nextv = s.nextv), s = s.nextf, s != null && (s.prevf = null);
2467
+ while (s != null);
2468
+ }
2469
+ };
2470
+ at.prototype.getVertices = function() {
2471
+ for (var s = [], t = this.head; t !== null; )
2472
+ s.push(t.vert), t = t.nextv;
2473
+ return s;
2474
+ };
2475
+ function et(s, t, e, i, n, a) {
2476
+ this.x = s, this.y = t, this.weight = rt, this.index = 0, this.conflicts = new at(!1), this.neighbours = null, this.nonClippedPolygon = null, this.polygon = null, this.originalObject = null, this.isDummy = !1, n !== void 0 && (this.originalObject = n), a != null && (this.isDummy = a), i != null && (this.weight = i), e != null ? this.z = e : this.z = this.projectZ(this.x, this.y, this.weight);
2477
+ }
2478
+ et.prototype.projectZ = function(s, t, e) {
2479
+ return s * s + t * t - e;
2480
+ };
2481
+ et.prototype.setWeight = function(s) {
2482
+ this.weight = s, this.z = this.projectZ(this.x, this.y, this.weight);
2483
+ };
2484
+ et.prototype.subtract = function(s) {
2485
+ return new et(s.x - this.x, s.y - this.y, s.z - this.z);
2486
+ };
2487
+ et.prototype.crossproduct = function(s) {
2488
+ return new et(this.y * s.z - this.z * s.y, this.z * s.x - this.x * s.z, this.x * s.y - this.y * s.x);
2489
+ };
2490
+ et.prototype.equals = function(s) {
2491
+ return this.x === s.x && this.y === s.y && this.z === s.z;
2492
+ };
2493
+ function de(s) {
2494
+ var t = s.verts[0], e = s.verts[1], i = s.verts[2];
2495
+ this.a = t.y * (e.z - i.z) + e.y * (i.z - t.z) + i.y * (t.z - e.z), this.b = t.z * (e.x - i.x) + e.z * (i.x - t.x) + i.z * (t.x - e.x), this.c = t.x * (e.y - i.y) + e.x * (i.y - t.y) + i.x * (t.y - e.y), this.d = -1 * (t.x * (e.y * i.z - i.y * e.z) + e.x * (i.y * t.z - t.y * i.z) + i.x * (t.y * e.z - e.y * t.z));
2496
+ }
2497
+ de.prototype.getNormZPlane = function() {
2498
+ return [
2499
+ -1 * (this.a / this.c),
2500
+ -1 * (this.b / this.c),
2501
+ -1 * (this.d / this.c)
2502
+ ];
2503
+ };
2504
+ de.prototype.getDualPointMappedToPlane = function() {
2505
+ var s = this.getNormZPlane(), t = new On(s[0] / 2, s[1] / 2);
2506
+ return t;
2507
+ };
2508
+ function On(s, t) {
2509
+ this.x = s, this.y = t;
2510
+ }
2511
+ function pe(s, t, e) {
2512
+ this.x = s, this.y = t, this.z = e;
2513
+ }
2514
+ pe.prototype.negate = function() {
2515
+ this.x *= -1, this.y *= -1, this.z *= -1;
2516
+ };
2517
+ pe.prototype.normalize = function() {
2518
+ var s = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
2519
+ s > 0 && (this.x /= s, this.y /= s, this.z /= s);
2520
+ };
2521
+ function gt(s, t, e) {
2522
+ this.next = null, this.prev = null, this.twin = null, this.orig = s, this.dest = t, this.iFace = e;
2523
+ }
2524
+ gt.prototype.isHorizon = function() {
2525
+ return this.twin !== null && !this.iFace.marked && this.twin.iFace.marked;
2526
+ };
2527
+ gt.prototype.findHorizon = function(s) {
2528
+ if (this.isHorizon()) {
2529
+ if (s.length > 0 && this === s[0])
2530
+ return;
2531
+ s.push(this), this.next.findHorizon(s);
2532
+ } else
2533
+ this.twin !== null && this.twin.next.findHorizon(s);
2534
+ };
2535
+ gt.prototype.isEqual = function(s, t) {
2536
+ return this.orig.equals(s) && this.dest.equals(t) || this.orig.equals(t) && this.dest.equals(s);
2537
+ };
2538
+ function ot(s) {
2539
+ this.message = s, this.stack = new Error().stack;
2540
+ }
2541
+ ot.prototype.name = "d3WeightedVoronoiError";
2542
+ ot.prototype = new Error();
2543
+ function $(s, t, e, i) {
2544
+ this.conflicts = new at(!0), this.verts = [s, t, e], this.marked = !1;
2545
+ var n = s.subtract(t).crossproduct(t.subtract(e));
2546
+ this.normal = new pe(-n.x, -n.y, -n.z), this.normal.normalize(), this.createEdges(), this.dualPoint = null, i != null && this.orient(i);
2547
+ }
2548
+ $.prototype.getDualPoint = function() {
2549
+ if (this.dualPoint == null) {
2550
+ var s = new de(this);
2551
+ this.dualPoint = s.getDualPointMappedToPlane();
2552
+ }
2553
+ return this.dualPoint;
2554
+ };
2555
+ $.prototype.isVisibleFromBelow = function() {
2556
+ return this.normal.z < -14259414393190911e-25;
2557
+ };
2558
+ $.prototype.createEdges = function() {
2559
+ this.edges = [], this.edges[0] = new gt(this.verts[0], this.verts[1], this), this.edges[1] = new gt(this.verts[1], this.verts[2], this), this.edges[2] = new gt(this.verts[2], this.verts[0], this), this.edges[0].next = this.edges[1], this.edges[0].prev = this.edges[2], this.edges[1].next = this.edges[2], this.edges[1].prev = this.edges[0], this.edges[2].next = this.edges[0], this.edges[2].prev = this.edges[1];
2560
+ };
2561
+ $.prototype.orient = function(s) {
2562
+ if (!(vt(this.normal, s) < vt(this.normal, this.verts[0]))) {
2563
+ var t = this.verts[1];
2564
+ this.verts[1] = this.verts[2], this.verts[2] = t, this.normal.negate(), this.createEdges();
2565
+ }
2566
+ };
2567
+ $.prototype.getEdge = function(s, t) {
2568
+ for (var e = 0; e < 3; e++)
2569
+ if (this.edges[e].isEqual(s, t))
2570
+ return this.edges[e];
2571
+ return null;
2572
+ };
2573
+ $.prototype.link = function(s, t, e) {
2574
+ if (s instanceof $) {
2575
+ var i = s.getEdge(t, e);
2576
+ if (i === null)
2577
+ throw new ot("when linking, twin is null");
2578
+ var n = this.getEdge(t, e);
2579
+ if (n === null)
2580
+ throw new ot("when linking, twin is null");
2581
+ i.twin = n, n.twin = i;
2582
+ } else {
2583
+ var i = s, n = this.getEdge(i.orig, i.dest);
2584
+ i.twin = n, n.twin = i;
2585
+ }
2586
+ };
2587
+ $.prototype.conflict = function(s) {
2588
+ return vt(this.normal, s) > vt(this.normal, this.verts[0]) + rt;
2589
+ };
2590
+ $.prototype.getHorizon = function() {
2591
+ for (var s = 0; s < 3; s++)
2592
+ if (this.edges[s].twin !== null && this.edges[s].twin.isHorizon())
2593
+ return this.edges[s];
2594
+ return null;
2595
+ };
2596
+ $.prototype.removeConflict = function() {
2597
+ this.conflicts.removeAll();
2598
+ };
2599
+ function it() {
2600
+ this.points = [], this.facets = [], this.created = [], this.horizon = [], this.visible = [], this.current = 0;
2601
+ }
2602
+ it.prototype.init = function(s, t) {
2603
+ this.points = [];
2604
+ for (var e = 0; e < t.length; e++)
2605
+ this.points[e] = new et(t[e].x, t[e].y, t[e].z, null, t[e], !1);
2606
+ this.points = this.points.concat(s);
2607
+ };
2608
+ it.prototype.permutate = function() {
2609
+ for (var s = this.points.length, t = s - 1; t > 0; t--) {
2610
+ var e = Math.floor(Math.random() * t), i = this.points[e];
2611
+ i.index = t;
2612
+ var n = this.points[t];
2613
+ n.index = e, this.points.splice(e, 1, n), this.points.splice(t, 1, i);
2614
+ }
2615
+ };
2616
+ it.prototype.prep = function() {
2617
+ if (this.points.length <= 3)
2618
+ throw new ot("Less than 4 points");
2619
+ for (var s = 0; s < this.points.length; s++)
2620
+ this.points[s].index = s;
2621
+ var t, e, i, n, a, o, h, r;
2622
+ t = this.points[0], e = this.points[1], i = n = null;
2623
+ for (var s = 2; s < this.points.length; s++)
2624
+ if (!(We(t, this.points[s]) && We(e, this.points[s]))) {
2625
+ i = this.points[s], i.index = 2, this.points[2].index = s, this.points.splice(s, 1, this.points[2]), this.points.splice(2, 1, i);
2626
+ break;
2627
+ }
2628
+ if (i === null)
2629
+ throw new ot("Not enough non-planar Points (v2 is null)");
2630
+ r = new $(t, e, i);
2631
+ for (var s = 3; s < this.points.length; s++)
2632
+ if (!Rt(vt(r.normal, r.verts[0]) - vt(r.normal, this.points[s]))) {
2633
+ n = this.points[s], n.index = 3, this.points[3].index = s, this.points.splice(s, 1, this.points[3]), this.points.splice(3, 1, n);
2634
+ break;
2635
+ }
2636
+ if (n === null)
2637
+ throw new ot("Not enough non-planar Points (v3 is null)");
2638
+ r.orient(n), a = new $(t, i, n, e), o = new $(t, e, n, i), h = new $(e, i, n, t), this.addFacet(r), this.addFacet(a), this.addFacet(o), this.addFacet(h), r.link(a, t, i), r.link(o, t, e), r.link(h, e, i), a.link(o, t, n), a.link(h, i, n), o.link(h, n, e), this.current = 4;
2639
+ for (var l, s = this.current; s < this.points.length; s++)
2640
+ l = this.points[s], r.conflict(l) && this.addConflict(r, l), a.conflict(l) && this.addConflict(a, l), o.conflict(l) && this.addConflict(o, l), h.conflict(l) && this.addConflict(h, l);
2641
+ }, // IN: Faces old1 old2 and fn
2642
+ it.prototype.addConflicts = function(s, t, e) {
2643
+ var i = s.conflicts.getVertices(), n = t.conflicts.getVertices(), a = [], o, h, r, l;
2644
+ for (r = l = 0; r < i.length || l < n.length; )
2645
+ r < i.length && l < n.length ? (o = i[r], h = n[l], o.index === h.index ? (a.push(o), r++, l++) : o.index > h.index ? (a.push(o), r++) : (a.push(h), l++)) : r < i.length ? a.push(i[r++]) : a.push(n[l++]);
2646
+ for (var r = a.length - 1; r >= 0; r--)
2647
+ o = a[r], e.conflict(o) && this.addConflict(e, o);
2648
+ };
2649
+ it.prototype.addConflict = function(s, t) {
2650
+ var e = new Bn(s, t);
2651
+ s.conflicts.add(e), t.conflicts.add(e);
2652
+ };
2653
+ it.prototype.removeConflict = function(s) {
2654
+ s.removeConflict();
2655
+ var t = s.index;
2656
+ if (s.index = -1, t === this.facets.length - 1) {
2657
+ this.facets.splice(this.facets.length - 1, 1);
2658
+ return;
2659
+ }
2660
+ if (!(t >= this.facets.length || t < 0)) {
2661
+ var e = this.facets.splice(this.facets.length - 1, 1);
2662
+ e[0].index = t, this.facets.splice(t, 1, e[0]);
2663
+ }
2664
+ };
2665
+ it.prototype.addFacet = function(s) {
2666
+ s.index = this.facets.length, this.facets.push(s);
2667
+ };
2668
+ it.prototype.compute = function() {
2669
+ for (this.prep(); this.current < this.points.length; ) {
2670
+ var s = this.points[this.current];
2671
+ if (s.conflicts.isEmpty()) {
2672
+ this.current++;
2673
+ continue;
2674
+ }
2675
+ this.created = [], this.horizon = [], this.visible = [], s.conflicts.fill(this.visible);
2676
+ for (var t, e = 0; e < this.visible.length; e++)
2677
+ if (t = this.visible[e].getHorizon(), t !== null) {
2678
+ t.findHorizon(this.horizon);
2679
+ break;
2680
+ }
2681
+ for (var i = null, n = null, a = 0; a < this.horizon.length; a++) {
2682
+ var o = this.horizon[a], h = new $(s, o.orig, o.dest, o.twin.next.dest);
2683
+ h.conflicts = new at(!0), this.addFacet(h), this.created.push(h), this.addConflicts(o.iFace, o.twin.iFace, h), h.link(o), i !== null && h.link(i, s, o.orig), i = h, n === null && (n = h);
2684
+ }
2685
+ if (n !== null && i !== null && i.link(n, s, this.horizon[0].orig), this.created.length != 0) {
2686
+ for (var r = 0; r < this.visible.length; r++)
2687
+ this.removeConflict(this.visible[r]);
2688
+ this.current++, this.created = [];
2689
+ }
2690
+ }
2691
+ return this.facets;
2692
+ };
2693
+ it.prototype.clear = function() {
2694
+ this.points = [], this.facets = [], this.created = [], this.horizon = [], this.visible = [], this.current = 0;
2695
+ };
2696
+ function En(s, t) {
2697
+ for (var e, i = Be(t), n = -1, a = s.length - Be(s), o, h, r = s[a - 1], l, u, f, c; ++n < a; ) {
2698
+ for (e = t.slice(), t.length = 0, l = s[n], u = e[(h = e.length - i) - 1], o = -1; ++o < h; )
2699
+ f = e[o], Ut(f, r, l) ? (Ut(u, r, l) || (c = Ie(u, f, r, l), isFinite(c[0]) && t.push(c)), t.push(f)) : Ut(u, r, l) && (c = Ie(u, f, r, l), isFinite(c[0]) && t.push(c)), u = f;
2700
+ i && t.push(t[0]), r = l;
2701
+ }
2702
+ return t;
2703
+ }
2704
+ function Ut(s, t, e) {
2705
+ return (e[0] - t[0]) * (s[1] - t[1]) < (e[1] - t[1]) * (s[0] - t[0]);
2706
+ }
2707
+ function Ie(s, t, e, i) {
2708
+ var n = s[0], a = e[0], o = t[0] - n, h = i[0] - a, r = s[1], l = e[1], u = t[1] - r, f = i[1] - l, c = (h * (r - l) - f * (n - a)) / (f * o - h * u);
2709
+ return [n + c * o, r + c * u];
2710
+ }
2711
+ function Be(s) {
2712
+ var t = s[0], e = s[s.length - 1];
2713
+ return !(t[0] - e[0] || t[1] - e[1]);
2714
+ }
2715
+ function Fn(s) {
2716
+ var t = [], e = s, i = s.dest, n = i.originalObject, a = [];
2717
+ do {
2718
+ e = e.twin.prev;
2719
+ var o = e.orig.originalObject;
2720
+ o.isDummy || a.push(o);
2721
+ var h = e.iFace;
2722
+ h.isVisibleFromBelow() && t.push(h);
2723
+ } while (e !== s);
2724
+ return n.neighbours = a, t;
2725
+ }
2726
+ function Vn(s, t, e) {
2727
+ var i = new it();
2728
+ i.clear(), i.init(t, s);
2729
+ for (var n = i.compute(s), a = [], o = [], h = n.length, r = 0; r < h; r++) {
2730
+ var l = n[r];
2731
+ if (l.isVisibleFromBelow())
2732
+ for (var u = 0; u < 3; u++) {
2733
+ var f = l.edges[u], c = f.dest, g = c.originalObject;
2734
+ if (!o[c.index]) {
2735
+ if (o[c.index] = !0, g.isDummy)
2736
+ continue;
2737
+ for (var v = Fn(f), d = [], p = null, y = null, m = 1, _ = 1, x = 0; x < v.length; x++) {
2738
+ var w = v[x].getDualPoint(), k = w.x, A = w.y;
2739
+ p !== null && (m = p - k, _ = y - A, m < 0 && (m = -m), _ < 0 && (_ = -_)), (m > rt || _ > rt) && (d.push([k, A]), p = k, y = A);
2740
+ }
2741
+ if (g.nonClippedPolygon = d.reverse(), !g.isDummy && Wn(g.nonClippedPolygon) > 0) {
2742
+ var N = En(e, g.nonClippedPolygon);
2743
+ g.polygon = N, N.site = g, N.length > 0 && a.push(N);
2744
+ }
2745
+ }
2746
+ }
2747
+ }
2748
+ return a;
2749
+ }
2750
+ function Xn() {
2751
+ var s = function(r) {
2752
+ return r.x;
2753
+ }, t = function(r) {
2754
+ return r.y;
2755
+ }, e = function(r) {
2756
+ return r.weight;
2757
+ }, i = [
2758
+ [0, 0],
2759
+ [0, 1],
2760
+ [1, 1],
2761
+ [1, 0]
2762
+ ], n = [
2763
+ [0, 0],
2764
+ [1, 1]
2765
+ ], a = [1, 1];
2766
+ function o(r) {
2767
+ var l;
2768
+ return l = r.map(function(u) {
2769
+ return new et(s(u), t(u), null, e(u), u, !1);
2770
+ }), Vn(l, h(), i);
2771
+ }
2772
+ o.x = function(r) {
2773
+ return arguments.length ? (s = r, o) : s;
2774
+ }, o.y = function(r) {
2775
+ return arguments.length ? (t = r, o) : t;
2776
+ }, o.weight = function(r) {
2777
+ return arguments.length ? (e = r, o) : e;
2778
+ }, o.clip = function(r) {
2779
+ var l, u, f;
2780
+ return arguments.length ? (u = Me(
2781
+ r.map(function(c) {
2782
+ return c[0];
2783
+ })
2784
+ ), f = Me(
2785
+ r.map(function(c) {
2786
+ return c[1];
2787
+ })
2788
+ ), l = In(r), l === void 0 ? i = Hn(r) : l === 1 ? i = r.reverse() : i = r, n = [
2789
+ [u[0], f[0]],
2790
+ [u[1], f[1]]
2791
+ ], a = [u[1] - u[0], f[1] - f[0]], o) : i;
2792
+ }, o.extent = function(r) {
2793
+ return arguments.length ? (i = [r[0], [r[0][0], r[1][1]], r[1], [r[1][0], r[0][1]]], n = r, a = [r[1][0] - r[0][0], r[1][1] - r[0][1]], o) : n;
2794
+ }, o.size = function(r) {
2795
+ return arguments.length ? (i = [
2796
+ [0, 0],
2797
+ [0, r[1]],
2798
+ [r[0], r[1]],
2799
+ [r[0], 0]
2800
+ ], n = [[0, 0], r], a = r, o) : a;
2801
+ };
2802
+ function h() {
2803
+ var r, l, u, f, c, g, v, d, p, y, m = [], _ = [];
2804
+ r = n[0][0], l = n[1][0], u = n[0][1], f = n[1][1], c = l - r, g = f - u, v = r - c, d = l + c, p = u - g, y = f + g, m[0] = [v, p], m[1] = [v, y], m[2] = [d, y], m[3] = [d, p];
2805
+ for (var x = 0; x < 4; x++)
2806
+ _.push(
2807
+ new et(
2808
+ m[x][0],
2809
+ m[x][1],
2810
+ null,
2811
+ rt,
2812
+ new et(m[x][0], m[x][1], null, rt, null, !0),
2813
+ !0
2814
+ )
2815
+ );
2816
+ return _;
2817
+ }
2818
+ return o;
2819
+ }
2820
+ function ct() {
2821
+ this.growthChangesLength = li, this.totalAvailableArea = NaN, this.lastAreaError = NaN, this.lastGrowth = NaN, this.growthChanges = [], this.growthChangeWeights = ve(this.growthChangesLength), this.growthChangeWeightsSum = ye(this.growthChangeWeights);
2822
+ }
2823
+ var li = 10;
2824
+ function qn(s, t) {
2825
+ return s >= t ? 1 : -1;
2826
+ }
2827
+ function ve(s) {
2828
+ for (var t = 3, e = 1, i = 1, n = t, a = [], o = 0; o < s; o++)
2829
+ a.push(n), n -= e, n < i && (n = i);
2830
+ return a;
2831
+ }
2832
+ function ye(s) {
2833
+ for (var t = 0, e = 0; e < s.length; e++)
2834
+ t += s[e];
2835
+ return t;
2836
+ }
2837
+ ct.prototype.reset = function() {
2838
+ return this.lastAreaError = NaN, this.lastGrowth = NaN, this.growthChanges = [], this.growthChangesLength = li, this.growthChangeWeights = ve(this.growthChangesLength), this.growthChangeWeightsSum = ye(this.growthChangeWeights), this.totalAvailableArea = NaN, this;
2839
+ };
2840
+ ct.prototype.clear = function() {
2841
+ return this.lastAreaError = NaN, this.lastGrowth = NaN, this.growthChanges = [], this;
2842
+ };
2843
+ ct.prototype.length = function(s) {
2844
+ return arguments.length ? (parseInt(s) > 0 ? (this.growthChangesLength = Math.floor(parseInt(s)), this.growthChangeWeights = ve(this.growthChangesLength), this.growthChangeWeightsSum = ye(this.growthChangeWeights)) : console.warn("FlickeringMitigation.length() accepts only positive integers; unable to handle " + s), this) : this.growthChangesLength;
2845
+ };
2846
+ ct.prototype.totalArea = function(s) {
2847
+ return arguments.length ? (parseFloat(s) > 0 ? this.totalAvailableArea = parseFloat(s) : console.warn("FlickeringMitigation.totalArea() accepts only positive numbers; unable to handle " + s), this) : this.totalAvailableArea;
2848
+ };
2849
+ ct.prototype.add = function(s) {
2850
+ var t, e;
2851
+ return t = this.lastAreaError, this.lastAreaError = s, isNaN(t) || (e = this.lastGrowth, this.lastGrowth = qn(this.lastAreaError, t)), isNaN(e) || this.growthChanges.unshift(this.lastGrowth != e), this.growthChanges.length > this.growthChangesLength && this.growthChanges.pop(), this;
2852
+ };
2853
+ ct.prototype.ratio = function() {
2854
+ var s = 0, t;
2855
+ if (this.growthChanges.length < this.growthChangesLength || this.lastAreaError > this.totalAvailableArea / 10)
2856
+ return 0;
2857
+ for (var e = 0; e < this.growthChangesLength; e++)
2858
+ this.growthChanges[e] && (s += this.growthChangeWeights[e]);
2859
+ return t = s / this.growthChangeWeightsSum, t;
2860
+ };
2861
+ function Yn() {
2862
+ var s, t, e, i, n, a, o, h;
2863
+ function r(u, f, c, g) {
2864
+ var v = !1, d, p;
2865
+ for (s !== g.clip() && (s = g.clip(), t = g.extent(), v = !0), v && l(), d = e + o * g.prng()(), p = n + h * g.prng()(); !ii(s, [d, p]); )
2866
+ d = e + o * g.prng()(), p = n + h * g.prng()();
2867
+ return [d, p];
2868
+ }
2869
+ function l() {
2870
+ e = t[0][0], i = t[1][0], n = t[0][1], a = t[1][1], o = i - e, h = a - n;
2871
+ }
2872
+ return r;
2873
+ }
2874
+ function Gn() {
2875
+ var s, t, e, i, n;
2876
+ function a(h, r, l, u) {
2877
+ var f = !1;
2878
+ return s !== u.clip() && (s = u.clip(), f |= !0), t !== l && (t = l, f |= !0), f && o(), n;
2879
+ }
2880
+ function o() {
2881
+ e = t.length, i = Pt(s), n = i / e / 2;
2882
+ }
2883
+ return a;
2884
+ }
2885
+ function ft(s) {
2886
+ this.message = s, this.stack = new Error().stack;
2887
+ }
2888
+ ft.prototype.name = "d3VoronoiMapError";
2889
+ ft.prototype = new Error();
2890
+ function Oe(s) {
2891
+ var t = 0.01, e = 50, i = 0.01, n = Math.random, a = Yn(), o = Gn(), h = 1e-10, r = function(D) {
2892
+ return D.weight;
2893
+ }, l = t, u = e, f = i, c = n, g = a, v = o, d = Xn(), p = new ct(), y = !0, m, _, x, w, k, A, N, C, b, S = ai(xe), W = oi("tick", "end");
2894
+ const B = 1, J = 1e3;
2895
+ var tt;
2896
+ function nt(D) {
2897
+ return Math.pow(D, 2);
2898
+ }
2899
+ function me(D, H) {
2900
+ return nt(H.x - D.x) + nt(H.y - D.y);
2901
+ }
2902
+ b = {
2903
+ tick: _e,
2904
+ restart: function() {
2905
+ return S.restart(xe), b;
2906
+ },
2907
+ stop: function() {
2908
+ return S.stop(), b;
2909
+ },
2910
+ weight: function(D) {
2911
+ return arguments.length ? (r = D, y = !0, b) : r;
2912
+ },
2913
+ convergenceRatio: function(D) {
2914
+ return arguments.length ? (l = D, y = !0, b) : l;
2915
+ },
2916
+ maxIterationCount: function(D) {
2917
+ return arguments.length ? (u = D, b) : u;
2918
+ },
2919
+ minWeightRatio: function(D) {
2920
+ return arguments.length ? (f = D, y = !0, b) : f;
2921
+ },
2922
+ clip: function(D) {
2923
+ return arguments.length ? (d.clip(D), y = !0, b) : d.clip();
2924
+ },
2925
+ extent: function(D) {
2926
+ return arguments.length ? (d.extent(D), y = !0, b) : d.extent();
2927
+ },
2928
+ size: function(D) {
2929
+ return arguments.length ? (d.size(D), y = !0, b) : d.size();
2930
+ },
2931
+ prng: function(D) {
2932
+ return arguments.length ? (c = D, y = !0, b) : c;
2933
+ },
2934
+ initialPosition: function(D) {
2935
+ return arguments.length ? (g = D, y = !0, b) : g;
2936
+ },
2937
+ initialWeight: function(D) {
2938
+ return arguments.length ? (v = D, y = !0, b) : v;
2939
+ },
2940
+ state: function() {
2941
+ return y && we(), {
2942
+ ended: C,
2943
+ iterationCount: w,
2944
+ convergenceRatio: A / _,
2945
+ polygons: k
2946
+ };
2947
+ },
2948
+ on: function(D, H) {
2949
+ return arguments.length === 1 ? W.on(D) : (W.on(D, H), b);
2950
+ }
2951
+ };
2952
+ function xe() {
2953
+ _e(), W.call("tick", b), C && (S.stop(), W.call("end", b));
2954
+ }
2955
+ function _e() {
2956
+ C || (y && we(), k = ui(k, p.ratio()), w++, A = pi(k), p.add(A), N = A < x, C = N || w >= u);
2957
+ }
2958
+ function we() {
2959
+ vi(), m = s.length, _ = Math.abs(Pt(d.clip())), x = l * _, p.clear().totalArea(_), w = 0, N = !1, k = hi(s, b), C = !1, y = !1;
2960
+ }
2961
+ function hi(D, H) {
2962
+ var M = D.reduce(function(L, I) {
2963
+ return Math.max(L, r(I));
2964
+ }, -1 / 0), T = M * f, R, z;
2965
+ return R = D.map(function(L, I, E) {
2966
+ return {
2967
+ index: I,
2968
+ weight: Math.max(r(L), T),
2969
+ initialPosition: g(L, I, E, H),
2970
+ initialWeight: v(L, I, E, H),
2971
+ originalData: L
2972
+ };
2973
+ }), z = ci(R, H), tt(z), d(z);
2974
+ }
2975
+ function ci(D, H) {
2976
+ var M = D.reduce(function(R, z) {
2977
+ return R += z.weight;
2978
+ }, 0), T;
2979
+ return D.map(function(R, z, L) {
2980
+ return T = R.initialPosition, ii(d.clip(), T) || (T = a(R, z, L, H)), {
2981
+ index: R.index,
2982
+ targetedArea: _ * R.weight / M,
2983
+ data: R,
2984
+ x: T[0],
2985
+ y: T[1],
2986
+ weight: R.initialWeight
2987
+ // ArlindNocaj/Voronoi-Treemap-Library uses an epsilonesque initial weight; using heavier initial weights allows faster weight adjustements, hence faster stabilization
2988
+ };
2989
+ });
2990
+ }
2991
+ function ui(D, H) {
2992
+ var M;
2993
+ if (fi(D, H), M = D.map(function(T) {
2994
+ return T.site.originalObject;
2995
+ }), D = d(M), D.length < m)
2996
+ throw new ft("at least 1 site has no area, which is not supposed to arise");
2997
+ if (gi(D, H), M = D.map(function(T) {
2998
+ return T.site.originalObject;
2999
+ }), D = d(M), D.length < m)
3000
+ throw new ft("at least 1 site has no area, which is not supposed to arise");
3001
+ return D;
3002
+ }
3003
+ function fi(D, H) {
3004
+ var M = [], T = 0.5, R, z, L, I, E, F, q;
3005
+ R = T * H, z = 1 - R;
3006
+ for (var Xt = 0; Xt < m; Xt++)
3007
+ L = D[Xt], I = L.site.originalObject, E = bn(L), F = E[0] - I.x, q = E[1] - I.y, F *= z, q *= z, I.x += F, I.y += q, M.push(I);
3008
+ tt(M);
3009
+ }
3010
+ function gi(D, H) {
3011
+ var M = [], T = 0.1, R, z, L, I, E, F;
3012
+ R = T * H;
3013
+ for (var q = 0; q < m; q++)
3014
+ z = D[q], L = z.site.originalObject, I = Pt(z), E = L.targetedArea / I, E = Math.max(E, 1 - T + R), E = Math.min(E, 1 + T - R), F = L.weight * E, F = Math.max(F, h), L.weight = F, M.push(L);
3015
+ tt(M);
3016
+ }
3017
+ function De(D) {
3018
+ var H = 0, M, T, R, z, L, I, E;
3019
+ do {
3020
+ if (H > J)
3021
+ throw new ft("handleOverweighted0 is looping too much");
3022
+ M = !1;
3023
+ for (var F = 0; F < m; F++) {
3024
+ T = D[F];
3025
+ for (var q = F + 1; q < m; q++)
3026
+ if (R = D[q], T.weight > R.weight ? (z = T, L = R) : (z = R, L = T), I = me(T, R), I < z.weight - L.weight) {
3027
+ E = I + L.weight / 2, E = Math.max(E, h), z.weight = E, M = !0, H++;
3028
+ break;
3029
+ }
3030
+ if (M)
3031
+ break;
3032
+ }
3033
+ } while (M);
3034
+ }
3035
+ function di(D) {
3036
+ var H = 0, M, T, R, z, L, I, E;
3037
+ do {
3038
+ if (H > J)
3039
+ throw new ft("handleOverweighted1 is looping too much");
3040
+ M = !1;
3041
+ for (var F = 0; F < m; F++) {
3042
+ T = D[F];
3043
+ for (var q = F + 1; q < m; q++)
3044
+ if (R = D[q], T.weight > R.weight ? (z = T, L = R) : (z = R, L = T), I = me(T, R), I < z.weight - L.weight) {
3045
+ E = z.weight - L.weight - I, L.weight += E + h, M = !0, H++;
3046
+ break;
3047
+ }
3048
+ if (M)
3049
+ break;
3050
+ }
3051
+ } while (M);
3052
+ }
3053
+ function pi(D) {
3054
+ for (var H = 0, M, T, R, z = 0; z < m; z++)
3055
+ M = D[z], T = M.site.originalObject, R = Pt(M), H += Math.abs(T.targetedArea - R);
3056
+ return H;
3057
+ }
3058
+ function vi() {
3059
+ switch (B) {
3060
+ case 0:
3061
+ tt = De;
3062
+ break;
3063
+ case 1:
3064
+ tt = di;
3065
+ break;
3066
+ default:
3067
+ console.error("unknown 'handleOverweighted' variant; using variant #1"), tt = De;
3068
+ }
3069
+ }
3070
+ return b;
3071
+ }
3072
+ function jn() {
3073
+ var s = 0.01, t = 50, e = 0.01, i = Math.random, n = [
3074
+ [0, 0],
3075
+ [0, 1],
3076
+ [1, 1],
3077
+ [1, 0]
3078
+ ], a = [
3079
+ [0, 0],
3080
+ [1, 1]
3081
+ ], o = [1, 1], h = s, r = t, l = e, u = i, f = [
3082
+ {
3083
+ weight: 1
3084
+ },
3085
+ {
3086
+ weight: 1
3087
+ }
3088
+ ], c = Oe(f).stop();
3089
+ function g(d) {
3090
+ v(n, d);
3091
+ }
3092
+ g.convergenceRatio = function(d) {
3093
+ return arguments.length ? (h = d, g) : h;
3094
+ }, g.maxIterationCount = function(d) {
3095
+ return arguments.length ? (r = d, g) : r;
3096
+ }, g.minWeightRatio = function(d) {
3097
+ return arguments.length ? (l = d, g) : l;
3098
+ }, g.clip = function(d) {
3099
+ return arguments.length ? (c.clip(d), n = c.clip(), a = c.extent(), o = c.size(), g) : n;
3100
+ }, g.extent = function(d) {
3101
+ return arguments.length ? (c.extent(d), n = c.clip(), a = c.extent(), o = c.size(), g) : a;
3102
+ }, g.size = function(d) {
3103
+ return arguments.length ? (c.size(d), n = c.clip(), a = c.extent(), o = c.size(), g) : o;
3104
+ }, g.prng = function(d) {
3105
+ return arguments.length ? (u = d, g) : u;
3106
+ };
3107
+ function v(d, p) {
3108
+ var y;
3109
+ if (p.polygon = d, p.height != 0) {
3110
+ y = Oe(p.children).clip(d).weight(function(_) {
3111
+ return _.value;
3112
+ }).convergenceRatio(h).maxIterationCount(r).minWeightRatio(l).prng(u).stop();
3113
+ for (var m = y.state(); !m.ended; )
3114
+ y.tick(), m = y.state();
3115
+ m.polygons.forEach(function(_) {
3116
+ v(_, _.site.originalObject.data.originalData);
3117
+ });
3118
+ }
3119
+ }
3120
+ return g;
3121
+ }
3122
+ var Tt = { exports: {} }, $n = Tt.exports, Ee;
3123
+ function Un() {
3124
+ return Ee || (Ee = 1, function(s) {
3125
+ (function(t, e, i) {
3126
+ function n(r) {
3127
+ var l = this, u = h();
3128
+ l.next = function() {
3129
+ var f = 2091639 * l.s0 + l.c * 23283064365386963e-26;
3130
+ return l.s0 = l.s1, l.s1 = l.s2, l.s2 = f - (l.c = f | 0);
3131
+ }, l.c = 1, l.s0 = u(" "), l.s1 = u(" "), l.s2 = u(" "), l.s0 -= u(r), l.s0 < 0 && (l.s0 += 1), l.s1 -= u(r), l.s1 < 0 && (l.s1 += 1), l.s2 -= u(r), l.s2 < 0 && (l.s2 += 1), u = null;
3132
+ }
3133
+ function a(r, l) {
3134
+ return l.c = r.c, l.s0 = r.s0, l.s1 = r.s1, l.s2 = r.s2, l;
3135
+ }
3136
+ function o(r, l) {
3137
+ var u = new n(r), f = l && l.state, c = u.next;
3138
+ return c.int32 = function() {
3139
+ return u.next() * 4294967296 | 0;
3140
+ }, c.double = function() {
3141
+ return c() + (c() * 2097152 | 0) * 11102230246251565e-32;
3142
+ }, c.quick = c, f && (typeof f == "object" && a(f, u), c.state = function() {
3143
+ return a(u, {});
3144
+ }), c;
3145
+ }
3146
+ function h() {
3147
+ var r = 4022871197, l = function(u) {
3148
+ u = String(u);
3149
+ for (var f = 0; f < u.length; f++) {
3150
+ r += u.charCodeAt(f);
3151
+ var c = 0.02519603282416938 * r;
3152
+ r = c >>> 0, c -= r, c *= r, r = c >>> 0, c -= r, r += c * 4294967296;
3153
+ }
3154
+ return (r >>> 0) * 23283064365386963e-26;
3155
+ };
3156
+ return l;
3157
+ }
3158
+ e && e.exports ? e.exports = o : this.alea = o;
3159
+ })(
3160
+ $n,
3161
+ s
3162
+ );
3163
+ }(Tt)), Tt.exports;
3164
+ }
3165
+ var zt = { exports: {} }, Kn = zt.exports, Fe;
3166
+ function Zn() {
3167
+ return Fe || (Fe = 1, function(s) {
3168
+ (function(t, e, i) {
3169
+ function n(h) {
3170
+ var r = this, l = "";
3171
+ r.x = 0, r.y = 0, r.z = 0, r.w = 0, r.next = function() {
3172
+ var f = r.x ^ r.x << 11;
3173
+ return r.x = r.y, r.y = r.z, r.z = r.w, r.w ^= r.w >>> 19 ^ f ^ f >>> 8;
3174
+ }, h === (h | 0) ? r.x = h : l += h;
3175
+ for (var u = 0; u < l.length + 64; u++)
3176
+ r.x ^= l.charCodeAt(u) | 0, r.next();
3177
+ }
3178
+ function a(h, r) {
3179
+ return r.x = h.x, r.y = h.y, r.z = h.z, r.w = h.w, r;
3180
+ }
3181
+ function o(h, r) {
3182
+ var l = new n(h), u = r && r.state, f = function() {
3183
+ return (l.next() >>> 0) / 4294967296;
3184
+ };
3185
+ return f.double = function() {
3186
+ do
3187
+ var c = l.next() >>> 11, g = (l.next() >>> 0) / 4294967296, v = (c + g) / (1 << 21);
3188
+ while (v === 0);
3189
+ return v;
3190
+ }, f.int32 = l.next, f.quick = f, u && (typeof u == "object" && a(u, l), f.state = function() {
3191
+ return a(l, {});
3192
+ }), f;
3193
+ }
3194
+ e && e.exports ? e.exports = o : this.xor128 = o;
3195
+ })(
3196
+ Kn,
3197
+ s
3198
+ );
3199
+ }(zt)), zt.exports;
3200
+ }
3201
+ var Lt = { exports: {} }, Qn = Lt.exports, Ve;
3202
+ function Jn() {
3203
+ return Ve || (Ve = 1, function(s) {
3204
+ (function(t, e, i) {
3205
+ function n(h) {
3206
+ var r = this, l = "";
3207
+ r.next = function() {
3208
+ var f = r.x ^ r.x >>> 2;
3209
+ return r.x = r.y, r.y = r.z, r.z = r.w, r.w = r.v, (r.d = r.d + 362437 | 0) + (r.v = r.v ^ r.v << 4 ^ (f ^ f << 1)) | 0;
3210
+ }, r.x = 0, r.y = 0, r.z = 0, r.w = 0, r.v = 0, h === (h | 0) ? r.x = h : l += h;
3211
+ for (var u = 0; u < l.length + 64; u++)
3212
+ r.x ^= l.charCodeAt(u) | 0, u == l.length && (r.d = r.x << 10 ^ r.x >>> 4), r.next();
3213
+ }
3214
+ function a(h, r) {
3215
+ return r.x = h.x, r.y = h.y, r.z = h.z, r.w = h.w, r.v = h.v, r.d = h.d, r;
3216
+ }
3217
+ function o(h, r) {
3218
+ var l = new n(h), u = r && r.state, f = function() {
3219
+ return (l.next() >>> 0) / 4294967296;
3220
+ };
3221
+ return f.double = function() {
3222
+ do
3223
+ var c = l.next() >>> 11, g = (l.next() >>> 0) / 4294967296, v = (c + g) / (1 << 21);
3224
+ while (v === 0);
3225
+ return v;
3226
+ }, f.int32 = l.next, f.quick = f, u && (typeof u == "object" && a(u, l), f.state = function() {
3227
+ return a(l, {});
3228
+ }), f;
3229
+ }
3230
+ e && e.exports ? e.exports = o : this.xorwow = o;
3231
+ })(
3232
+ Qn,
3233
+ s
3234
+ );
3235
+ }(Lt)), Lt.exports;
3236
+ }
3237
+ var St = { exports: {} }, ts = St.exports, Xe;
3238
+ function es() {
3239
+ return Xe || (Xe = 1, function(s) {
3240
+ (function(t, e, i) {
3241
+ function n(h) {
3242
+ var r = this;
3243
+ r.next = function() {
3244
+ var u = r.x, f = r.i, c, g;
3245
+ return c = u[f], c ^= c >>> 7, g = c ^ c << 24, c = u[f + 1 & 7], g ^= c ^ c >>> 10, c = u[f + 3 & 7], g ^= c ^ c >>> 3, c = u[f + 4 & 7], g ^= c ^ c << 7, c = u[f + 7 & 7], c = c ^ c << 13, g ^= c ^ c << 9, u[f] = g, r.i = f + 1 & 7, g;
3246
+ };
3247
+ function l(u, f) {
3248
+ var c, g = [];
3249
+ if (f === (f | 0))
3250
+ g[0] = f;
3251
+ else
3252
+ for (f = "" + f, c = 0; c < f.length; ++c)
3253
+ g[c & 7] = g[c & 7] << 15 ^ f.charCodeAt(c) + g[c + 1 & 7] << 13;
3254
+ for (; g.length < 8; ) g.push(0);
3255
+ for (c = 0; c < 8 && g[c] === 0; ++c) ;
3256
+ for (c == 8 ? g[7] = -1 : g[c], u.x = g, u.i = 0, c = 256; c > 0; --c)
3257
+ u.next();
3258
+ }
3259
+ l(r, h);
3260
+ }
3261
+ function a(h, r) {
3262
+ return r.x = h.x.slice(), r.i = h.i, r;
3263
+ }
3264
+ function o(h, r) {
3265
+ h == null && (h = +/* @__PURE__ */ new Date());
3266
+ var l = new n(h), u = r && r.state, f = function() {
3267
+ return (l.next() >>> 0) / 4294967296;
3268
+ };
3269
+ return f.double = function() {
3270
+ do
3271
+ var c = l.next() >>> 11, g = (l.next() >>> 0) / 4294967296, v = (c + g) / (1 << 21);
3272
+ while (v === 0);
3273
+ return v;
3274
+ }, f.int32 = l.next, f.quick = f, u && (u.x && a(u, l), f.state = function() {
3275
+ return a(l, {});
3276
+ }), f;
3277
+ }
3278
+ e && e.exports ? e.exports = o : this.xorshift7 = o;
3279
+ })(
3280
+ ts,
3281
+ s
3282
+ );
3283
+ }(St)), St.exports;
3284
+ }
3285
+ var Mt = { exports: {} }, is = Mt.exports, qe;
3286
+ function ns() {
3287
+ return qe || (qe = 1, function(s) {
3288
+ (function(t, e, i) {
3289
+ function n(h) {
3290
+ var r = this;
3291
+ r.next = function() {
3292
+ var u = r.w, f = r.X, c = r.i, g, v;
3293
+ return r.w = u = u + 1640531527 | 0, v = f[c + 34 & 127], g = f[c = c + 1 & 127], v ^= v << 13, g ^= g << 17, v ^= v >>> 15, g ^= g >>> 12, v = f[c] = v ^ g, r.i = c, v + (u ^ u >>> 16) | 0;
3294
+ };
3295
+ function l(u, f) {
3296
+ var c, g, v, d, p, y = [], m = 128;
3297
+ for (f === (f | 0) ? (g = f, f = null) : (f = f + "\0", g = 0, m = Math.max(m, f.length)), v = 0, d = -32; d < m; ++d)
3298
+ f && (g ^= f.charCodeAt((d + 32) % f.length)), d === 0 && (p = g), g ^= g << 10, g ^= g >>> 15, g ^= g << 4, g ^= g >>> 13, d >= 0 && (p = p + 1640531527 | 0, c = y[d & 127] ^= g + p, v = c == 0 ? v + 1 : 0);
3299
+ for (v >= 128 && (y[(f && f.length || 0) & 127] = -1), v = 127, d = 512; d > 0; --d)
3300
+ g = y[v + 34 & 127], c = y[v = v + 1 & 127], g ^= g << 13, c ^= c << 17, g ^= g >>> 15, c ^= c >>> 12, y[v] = g ^ c;
3301
+ u.w = p, u.X = y, u.i = v;
3302
+ }
3303
+ l(r, h);
3304
+ }
3305
+ function a(h, r) {
3306
+ return r.i = h.i, r.w = h.w, r.X = h.X.slice(), r;
3307
+ }
3308
+ function o(h, r) {
3309
+ h == null && (h = +/* @__PURE__ */ new Date());
3310
+ var l = new n(h), u = r && r.state, f = function() {
3311
+ return (l.next() >>> 0) / 4294967296;
3312
+ };
3313
+ return f.double = function() {
3314
+ do
3315
+ var c = l.next() >>> 11, g = (l.next() >>> 0) / 4294967296, v = (c + g) / (1 << 21);
3316
+ while (v === 0);
3317
+ return v;
3318
+ }, f.int32 = l.next, f.quick = f, u && (u.X && a(u, l), f.state = function() {
3319
+ return a(l, {});
3320
+ }), f;
3321
+ }
3322
+ e && e.exports ? e.exports = o : this.xor4096 = o;
3323
+ })(
3324
+ is,
3325
+ // window object or global
3326
+ s
3327
+ );
3328
+ }(Mt)), Mt.exports;
3329
+ }
3330
+ var Ht = { exports: {} }, ss = Ht.exports, Ye;
3331
+ function rs() {
3332
+ return Ye || (Ye = 1, function(s) {
3333
+ (function(t, e, i) {
3334
+ function n(h) {
3335
+ var r = this, l = "";
3336
+ r.next = function() {
3337
+ var f = r.b, c = r.c, g = r.d, v = r.a;
3338
+ return f = f << 25 ^ f >>> 7 ^ c, c = c - g | 0, g = g << 24 ^ g >>> 8 ^ v, v = v - f | 0, r.b = f = f << 20 ^ f >>> 12 ^ c, r.c = c = c - g | 0, r.d = g << 16 ^ c >>> 16 ^ v, r.a = v - f | 0;
3339
+ }, r.a = 0, r.b = 0, r.c = -1640531527, r.d = 1367130551, h === Math.floor(h) ? (r.a = h / 4294967296 | 0, r.b = h | 0) : l += h;
3340
+ for (var u = 0; u < l.length + 20; u++)
3341
+ r.b ^= l.charCodeAt(u) | 0, r.next();
3342
+ }
3343
+ function a(h, r) {
3344
+ return r.a = h.a, r.b = h.b, r.c = h.c, r.d = h.d, r;
3345
+ }
3346
+ function o(h, r) {
3347
+ var l = new n(h), u = r && r.state, f = function() {
3348
+ return (l.next() >>> 0) / 4294967296;
3349
+ };
3350
+ return f.double = function() {
3351
+ do
3352
+ var c = l.next() >>> 11, g = (l.next() >>> 0) / 4294967296, v = (c + g) / (1 << 21);
3353
+ while (v === 0);
3354
+ return v;
3355
+ }, f.int32 = l.next, f.quick = f, u && (typeof u == "object" && a(u, l), f.state = function() {
3356
+ return a(l, {});
3357
+ }), f;
3358
+ }
3359
+ e && e.exports ? e.exports = o : this.tychei = o;
3360
+ })(
3361
+ ss,
3362
+ s
3363
+ );
3364
+ }(Ht)), Ht.exports;
3365
+ }
3366
+ var Wt = { exports: {} }, as = Wt.exports, Ge;
3367
+ function os() {
3368
+ return Ge || (Ge = 1, function(s) {
3369
+ (function(t, e, i) {
3370
+ var n = 256, a = 6, o = 52, h = "random", r = i.pow(n, a), l = i.pow(2, o), u = l * 2, f = n - 1, c;
3371
+ function g(x, w, k) {
3372
+ var A = [];
3373
+ w = w == !0 ? { entropy: !0 } : w || {};
3374
+ var N = y(p(
3375
+ w.entropy ? [x, _(e)] : x ?? m(),
3376
+ 3
3377
+ ), A), C = new v(A), b = function() {
3378
+ for (var S = C.g(a), W = r, B = 0; S < l; )
3379
+ S = (S + B) * n, W *= n, B = C.g(1);
3380
+ for (; S >= u; )
3381
+ S /= 2, W /= 2, B >>>= 1;
3382
+ return (S + B) / W;
3383
+ };
3384
+ return b.int32 = function() {
3385
+ return C.g(4) | 0;
3386
+ }, b.quick = function() {
3387
+ return C.g(4) / 4294967296;
3388
+ }, b.double = b, y(_(C.S), e), (w.pass || k || function(S, W, B, J) {
3389
+ return J && (J.S && d(J, C), S.state = function() {
3390
+ return d(C, {});
3391
+ }), B ? (i[h] = S, W) : S;
3392
+ })(
3393
+ b,
3394
+ N,
3395
+ "global" in w ? w.global : this == i,
3396
+ w.state
3397
+ );
3398
+ }
3399
+ function v(x) {
3400
+ var w, k = x.length, A = this, N = 0, C = A.i = A.j = 0, b = A.S = [];
3401
+ for (k || (x = [k++]); N < n; )
3402
+ b[N] = N++;
3403
+ for (N = 0; N < n; N++)
3404
+ b[N] = b[C = f & C + x[N % k] + (w = b[N])], b[C] = w;
3405
+ (A.g = function(S) {
3406
+ for (var W, B = 0, J = A.i, tt = A.j, nt = A.S; S--; )
3407
+ W = nt[J = f & J + 1], B = B * n + nt[f & (nt[J] = nt[tt = f & tt + W]) + (nt[tt] = W)];
3408
+ return A.i = J, A.j = tt, B;
3409
+ })(n);
3410
+ }
3411
+ function d(x, w) {
3412
+ return w.i = x.i, w.j = x.j, w.S = x.S.slice(), w;
3413
+ }
3414
+ function p(x, w) {
3415
+ var k = [], A = typeof x, N;
3416
+ if (w && A == "object")
3417
+ for (N in x)
3418
+ try {
3419
+ k.push(p(x[N], w - 1));
3420
+ } catch {
3421
+ }
3422
+ return k.length ? k : A == "string" ? x : x + "\0";
3423
+ }
3424
+ function y(x, w) {
3425
+ for (var k = x + "", A, N = 0; N < k.length; )
3426
+ w[f & N] = f & (A ^= w[f & N] * 19) + k.charCodeAt(N++);
3427
+ return _(w);
3428
+ }
3429
+ function m() {
3430
+ try {
3431
+ var x;
3432
+ return c && (x = c.randomBytes) ? x = x(n) : (x = new Uint8Array(n), (t.crypto || t.msCrypto).getRandomValues(x)), _(x);
3433
+ } catch {
3434
+ var w = t.navigator, k = w && w.plugins;
3435
+ return [+/* @__PURE__ */ new Date(), t, k, t.screen, _(e)];
3436
+ }
3437
+ }
3438
+ function _(x) {
3439
+ return String.fromCharCode.apply(0, x);
3440
+ }
3441
+ if (y(i.random(), e), s.exports) {
3442
+ s.exports = g;
3443
+ try {
3444
+ c = Wi;
3445
+ } catch {
3446
+ }
3447
+ } else
3448
+ i["seed" + h] = g;
3449
+ })(
3450
+ // global: `self` in browsers (including strict mode and web workers),
3451
+ // otherwise `this` in Node and other environments
3452
+ typeof self < "u" ? self : as,
3453
+ [],
3454
+ // pool: entropy pool starts empty
3455
+ Math
3456
+ // math: package containing random, pow, and seedrandom
3457
+ );
3458
+ }(Wt)), Wt.exports;
3459
+ }
3460
+ var Kt, je;
3461
+ function ls() {
3462
+ if (je) return Kt;
3463
+ je = 1;
3464
+ var s = Un(), t = Zn(), e = Jn(), i = es(), n = ns(), a = rs(), o = os();
3465
+ return o.alea = s, o.xor128 = t, o.xorwow = e, o.xorshift7 = i, o.xor4096 = n, o.tychei = a, Kt = o, Kt;
3466
+ }
3467
+ var hs = ls();
3468
+ const $e = /* @__PURE__ */ Hi(hs);
3469
+ class he extends Q {
3470
+ constructor() {
3471
+ super(...arguments), this._tag = "voronoitreemap", this.polygons = this.addDisposer(new Z(K.new({}), () => Mi._new(this._root, {
3472
+ themeTags: G(this.polygons.template.get("themeTags", []), [this._tag, "shape"])
3473
+ }, [this.polygons.template]))), this.voronoi = jn();
3474
+ }
3475
+ _afterNew() {
3476
+ this.nodesContainer.setAll({
3477
+ x: O,
3478
+ y: O,
3479
+ centerX: O,
3480
+ centerY: O
3481
+ }), this.nodes.template.setPrivate("trustBounds", !0), super._afterNew();
3482
+ }
3483
+ _prepareChildren() {
3484
+ super._prepareChildren();
3485
+ const t = this.innerWidth() / 2, e = this.innerHeight() / 2;
3486
+ let i = this._rootNode;
3487
+ const n = this.get("selectedDataItem");
3488
+ n && (i = n.get("d3HierarchyNode")), this.voronoi.convergenceRatio(this.get("convergenceRatio", 5e-3)), this.voronoi.maxIterationCount(this.get("maxIterationCount", 100)), this.voronoi.minWeightRatio(this.get("minWeightRatio", 5e-3)), this.isDirty("type") && this.get("type") == "polygon" && (this.voronoi.clip(this.getCirclePolygon(1)), this._updateVisuals()), this._sizeDirty && this.get("type") == "rectangle" && (this.voronoi.prng($e("X")), this.voronoi.clip([[-t, -e], [-t, e], [t, e], [t, -e]])(i), this._updateVisuals()), (this._valuesDirty || this.isDirty("selectedDataItem")) && i && (this.voronoi.prng($e("X")), this.voronoi(i), this._updateVisuals());
3489
+ }
3490
+ _updateNode(t) {
3491
+ const e = t.get("d3HierarchyNode").polygon, i = t.get("polygon");
3492
+ if (e && i) {
3493
+ let n = [], a = 1;
3494
+ this.get("type") == "polygon" && (a = Math.min(this.innerWidth(), this.innerHeight()) / 2);
3495
+ let o = 1 / 0, h = -1 / 0;
3496
+ for (let f = 0, c = e.length; f < c; f++) {
3497
+ const g = e[f];
3498
+ let v = g[0] * a, d = g[1] * a;
3499
+ n.push([v, d]), o = Math.min(o, v), h = Math.max(h, v);
3500
+ }
3501
+ i.set("coordinates", n);
3502
+ const r = t.get("fill"), l = t.get("fillPattern");
3503
+ i._setDefault("fill", r), i._setDefault("fillPattern", l);
3504
+ const u = t.get("label");
3505
+ if (u) {
3506
+ const f = e.site;
3507
+ f && u.setAll({
3508
+ x: f.x * a,
3509
+ y: f.y * a,
3510
+ maxWidth: Math.abs(h - o)
3511
+ });
3512
+ }
3513
+ }
3514
+ }
3515
+ _handleSingle(t) {
3516
+ const e = t.get("parent");
3517
+ if (e) {
3518
+ const i = e.get("children");
3519
+ i && P(i, (n) => {
3520
+ n != t && (this.disableDataItem(n), n.get("node").hide());
3521
+ }), this._handleSingle(e);
3522
+ }
3523
+ }
3524
+ /**
3525
+ * @ignore
3526
+ */
3527
+ makeNode(t) {
3528
+ const e = super.makeNode(t);
3529
+ return this._makeNode(t, e), e;
3530
+ }
3531
+ _makeNode(t, e) {
3532
+ const i = e.children.moveValue(this.polygons.make(), 0);
3533
+ e.setPrivate("tooltipTarget", i), t.setRaw("polygon", i), i._setDataItem(t);
3534
+ }
3535
+ getCirclePolygon(t) {
3536
+ const e = this.get("cornerCount", 120), i = Math.PI * 2 / e, n = [];
3537
+ for (let a = 0; a < e; a++) {
3538
+ let o = a * i;
3539
+ n.push([t * Math.cos(o), t * Math.sin(o)]);
3540
+ }
3541
+ return n;
3542
+ }
3543
+ }
3544
+ he.className = "VoronoiTreemap";
3545
+ he.classNames = Q.classNames.concat([he.className]);
3546
+ export {
3547
+ ee as BreadcrumbBar,
3548
+ ei as DefaultTheme,
3549
+ ie as ForceDirected,
3550
+ Q as Hierarchy,
3551
+ Bt as HierarchyLink,
3552
+ dt as HierarchyNode,
3553
+ lt as LinkedHierarchy,
3554
+ It as LinkedHierarchyNode,
3555
+ ne as Pack,
3556
+ kt as Partition,
3557
+ se as Sunburst,
3558
+ re as Tree,
3559
+ ae as Treemap,
3560
+ he as VoronoiTreemap
3561
+ };