@antv/g2 5.0.0-beta.7 → 5.0.0-beta.9

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 (473) hide show
  1. package/dist/g2-lite.min.js +3 -3
  2. package/dist/g2.min.js +4 -4
  3. package/esm/animation/morphing.js +22 -2
  4. package/esm/animation/morphing.js.map +1 -1
  5. package/esm/api/chart.d.ts +8 -3
  6. package/esm/api/chart.js +35 -16
  7. package/esm/api/chart.js.map +1 -1
  8. package/esm/api/composition/base.d.ts +18 -1
  9. package/esm/api/composition/base.js +44 -1
  10. package/esm/api/composition/base.js.map +1 -1
  11. package/esm/api/mark/base.d.ts +22 -0
  12. package/esm/api/mark/base.js +54 -0
  13. package/esm/api/mark/base.js.map +1 -0
  14. package/esm/api/mark/mark.d.ts +1 -7
  15. package/esm/api/mark/mark.js +1 -13
  16. package/esm/api/mark/mark.js.map +1 -1
  17. package/esm/api/props.js +0 -20
  18. package/esm/api/props.js.map +1 -1
  19. package/esm/component/axis.d.ts +5 -7
  20. package/esm/component/axis.js +126 -94
  21. package/esm/component/axis.js.map +1 -1
  22. package/esm/component/axisArc.d.ts +7 -0
  23. package/esm/component/axisArc.js +9 -0
  24. package/esm/component/axisArc.js.map +1 -0
  25. package/esm/component/axisRadar.d.ts +9 -0
  26. package/esm/component/axisRadar.js +46 -0
  27. package/esm/component/axisRadar.js.map +1 -0
  28. package/esm/component/axisX.d.ts +2 -1
  29. package/esm/component/axisX.js +5 -4
  30. package/esm/component/axisX.js.map +1 -1
  31. package/esm/component/axisY.d.ts +1 -1
  32. package/esm/component/axisY.js +4 -4
  33. package/esm/component/axisY.js.map +1 -1
  34. package/esm/component/index.d.ts +8 -0
  35. package/esm/component/index.js +5 -0
  36. package/esm/component/index.js.map +1 -1
  37. package/esm/component/legendCategory.d.ts +5 -3
  38. package/esm/component/legendCategory.js +80 -36
  39. package/esm/component/legendCategory.js.map +1 -1
  40. package/esm/component/legendContinuous.d.ts +4 -2
  41. package/esm/component/legendContinuous.js +76 -24
  42. package/esm/component/legendContinuous.js.map +1 -1
  43. package/esm/component/legendContinuousBlock.d.ts +4 -0
  44. package/esm/component/legendContinuousBlock.js +6 -0
  45. package/esm/component/legendContinuousBlock.js.map +1 -0
  46. package/esm/component/legendContinuousBlockSize.d.ts +4 -0
  47. package/esm/component/legendContinuousBlockSize.js +6 -0
  48. package/esm/component/legendContinuousBlockSize.js.map +1 -0
  49. package/esm/component/legendContinuousSize.d.ts +4 -0
  50. package/esm/component/legendContinuousSize.js +10 -0
  51. package/esm/component/legendContinuousSize.js.map +1 -0
  52. package/esm/component/scrollbar.js +1 -1
  53. package/esm/component/scrollbar.js.map +1 -1
  54. package/esm/component/slider.js +1 -1
  55. package/esm/component/slider.js.map +1 -1
  56. package/esm/component/title.js +1 -1
  57. package/esm/component/title.js.map +1 -1
  58. package/esm/component/utils.d.ts +12 -0
  59. package/esm/component/utils.js +35 -0
  60. package/esm/component/utils.js.map +1 -1
  61. package/esm/composition/facetCircle.js +1 -1
  62. package/esm/composition/facetCircle.js.map +1 -1
  63. package/esm/coordinate/index.d.ts +3 -3
  64. package/esm/coordinate/index.js +3 -3
  65. package/esm/coordinate/index.js.map +1 -1
  66. package/esm/coordinate/polar.d.ts +6 -0
  67. package/esm/coordinate/polar.js +18 -6
  68. package/esm/coordinate/polar.js.map +1 -1
  69. package/esm/coordinate/radial.d.ts +6 -0
  70. package/esm/coordinate/radial.js +17 -5
  71. package/esm/coordinate/radial.js.map +1 -1
  72. package/esm/coordinate/theta.d.ts +7 -0
  73. package/esm/coordinate/theta.js +16 -4
  74. package/esm/coordinate/theta.js.map +1 -1
  75. package/esm/interaction/builtin/elementHighlight.d.ts +2 -0
  76. package/esm/interaction/builtin/elementHighlightByColor.d.ts +2 -0
  77. package/esm/interaction/builtin/elementHighlightByX.d.ts +2 -0
  78. package/esm/interaction/index.d.ts +2 -0
  79. package/esm/interaction/index.js +2 -0
  80. package/esm/interaction/index.js.map +1 -1
  81. package/esm/interaction/native/brushAxisHighlight.js +6 -1
  82. package/esm/interaction/native/brushAxisHighlight.js.map +1 -1
  83. package/esm/interaction/native/brushFilter.js +1 -1
  84. package/esm/interaction/native/brushFilter.js.map +1 -1
  85. package/esm/interaction/native/elementHighlight.d.ts +7 -2
  86. package/esm/interaction/native/elementHighlight.js +72 -19
  87. package/esm/interaction/native/elementHighlight.js.map +1 -1
  88. package/esm/interaction/native/elementHighlightByColor.d.ts +4 -1
  89. package/esm/interaction/native/elementHighlightByColor.js +19 -3
  90. package/esm/interaction/native/elementHighlightByColor.js.map +1 -1
  91. package/esm/interaction/native/elementHighlightByX.d.ts +3 -3
  92. package/esm/interaction/native/elementHighlightByX.js +19 -3
  93. package/esm/interaction/native/elementHighlightByX.js.map +1 -1
  94. package/esm/interaction/native/elementSelect.d.ts +1 -1
  95. package/esm/interaction/native/elementSelect.js +42 -21
  96. package/esm/interaction/native/elementSelect.js.map +1 -1
  97. package/esm/interaction/native/elementSelectByColor.js +3 -2
  98. package/esm/interaction/native/elementSelectByColor.js.map +1 -1
  99. package/esm/interaction/native/elementSelectByX.js +3 -2
  100. package/esm/interaction/native/elementSelectByX.js.map +1 -1
  101. package/esm/interaction/native/legendFilter.d.ts +6 -0
  102. package/esm/interaction/native/legendFilter.js +26 -7
  103. package/esm/interaction/native/legendFilter.js.map +1 -1
  104. package/esm/interaction/native/legendHighlight.d.ts +4 -0
  105. package/esm/interaction/native/legendHighlight.js +93 -0
  106. package/esm/interaction/native/legendHighlight.js.map +1 -0
  107. package/esm/interaction/native/poptip.d.ts +5 -0
  108. package/esm/interaction/native/poptip.js +91 -0
  109. package/esm/interaction/native/poptip.js.map +1 -0
  110. package/esm/interaction/native/utils.d.ts +13 -2
  111. package/esm/interaction/native/utils.js +151 -26
  112. package/esm/interaction/native/utils.js.map +1 -1
  113. package/esm/label-transform/overlapDodgeY.js +0 -8
  114. package/esm/label-transform/overlapDodgeY.js.map +1 -1
  115. package/esm/mark/area.js +1 -1
  116. package/esm/mark/area.js.map +1 -1
  117. package/esm/mark/pack.js +0 -1
  118. package/esm/mark/pack.js.map +1 -1
  119. package/esm/mark/treemap.js +0 -1
  120. package/esm/mark/treemap.js.map +1 -1
  121. package/esm/runtime/component.d.ts +3 -0
  122. package/esm/runtime/component.js +246 -103
  123. package/esm/runtime/component.js.map +1 -1
  124. package/esm/runtime/coordinate.d.ts +11 -0
  125. package/esm/runtime/coordinate.js +23 -16
  126. package/esm/runtime/coordinate.js.map +1 -1
  127. package/esm/runtime/layout.d.ts +1 -1
  128. package/esm/runtime/layout.js +145 -76
  129. package/esm/runtime/layout.js.map +1 -1
  130. package/esm/runtime/plot.js +5 -4
  131. package/esm/runtime/plot.js.map +1 -1
  132. package/esm/runtime/render.js +18 -13
  133. package/esm/runtime/render.js.map +1 -1
  134. package/esm/runtime/scale.d.ts +2 -1
  135. package/esm/runtime/scale.js +35 -0
  136. package/esm/runtime/scale.js.map +1 -1
  137. package/esm/runtime/transform.js +1 -1
  138. package/esm/runtime/transform.js.map +1 -1
  139. package/esm/runtime/types/common.d.ts +11 -2
  140. package/esm/runtime/types/component.d.ts +9 -7
  141. package/esm/runtime/types/options.d.ts +8 -6
  142. package/esm/runtime/types/scale.d.ts +18 -0
  143. package/esm/runtime/types/scale.js +19 -0
  144. package/esm/runtime/types/scale.js.map +1 -0
  145. package/esm/runtime/types/theme.d.ts +2 -1
  146. package/esm/shape/area/hv.d.ts +3 -0
  147. package/esm/shape/area/hv.js +9 -0
  148. package/esm/shape/area/hv.js.map +1 -0
  149. package/esm/shape/area/hvh.d.ts +3 -0
  150. package/esm/shape/area/{step.js → hvh.js} +3 -3
  151. package/esm/shape/area/hvh.js.map +1 -0
  152. package/esm/shape/area/vh.d.ts +3 -0
  153. package/esm/shape/area/vh.js +9 -0
  154. package/esm/shape/area/vh.js.map +1 -0
  155. package/esm/shape/connector/connector.js +1 -1
  156. package/esm/shape/index.d.ts +6 -2
  157. package/esm/shape/index.js +3 -1
  158. package/esm/shape/index.js.map +1 -1
  159. package/esm/shape/interval/color.d.ts +1 -0
  160. package/esm/shape/interval/color.js +65 -53
  161. package/esm/shape/interval/color.js.map +1 -1
  162. package/esm/shape/utils.js.map +1 -1
  163. package/esm/spec/composition.d.ts +0 -3
  164. package/esm/spec/geometry.d.ts +1 -1
  165. package/esm/spec/interaction.d.ts +33 -15
  166. package/esm/spec/transform.d.ts +13 -3
  167. package/esm/stdlib/index.js +4 -9
  168. package/esm/stdlib/index.js.map +1 -1
  169. package/esm/theme/academy.js +10 -4
  170. package/esm/theme/academy.js.map +1 -1
  171. package/esm/theme/dark.js +10 -4
  172. package/esm/theme/dark.js.map +1 -1
  173. package/esm/theme/light.js +12 -4
  174. package/esm/theme/light.js.map +1 -1
  175. package/esm/transform/sample.js +42 -26
  176. package/esm/transform/sample.js.map +1 -1
  177. package/esm/transform/utils/lttb.d.ts +5 -0
  178. package/esm/transform/utils/lttb.js +56 -0
  179. package/esm/transform/utils/lttb.js.map +1 -0
  180. package/esm/utils/angle.d.ts +2 -0
  181. package/esm/utils/angle.js +7 -0
  182. package/esm/utils/angle.js.map +1 -0
  183. package/esm/utils/array.d.ts +8 -0
  184. package/esm/utils/array.js +35 -0
  185. package/esm/utils/array.js.map +1 -1
  186. package/esm/utils/coordinate.d.ts +4 -0
  187. package/esm/utils/coordinate.js +19 -0
  188. package/esm/utils/coordinate.js.map +1 -1
  189. package/esm/utils/event.d.ts +0 -2
  190. package/esm/utils/event.js +0 -18
  191. package/esm/utils/event.js.map +1 -1
  192. package/esm/utils/scale.d.ts +1 -0
  193. package/esm/utils/scale.js +3 -3
  194. package/esm/utils/scale.js.map +1 -1
  195. package/esm/utils/vector.d.ts +1 -1
  196. package/esm/utils/vector.js +1 -1
  197. package/lib/animation/morphing.js +22 -2
  198. package/lib/animation/morphing.js.map +1 -1
  199. package/lib/api/chart.d.ts +8 -3
  200. package/lib/api/chart.js +37 -15
  201. package/lib/api/chart.js.map +1 -1
  202. package/lib/api/composition/base.d.ts +18 -1
  203. package/lib/api/composition/base.js +44 -1
  204. package/lib/api/composition/base.js.map +1 -1
  205. package/lib/api/mark/base.d.ts +22 -0
  206. package/lib/api/mark/base.js +58 -0
  207. package/lib/api/mark/base.js.map +1 -0
  208. package/lib/api/mark/mark.d.ts +1 -7
  209. package/lib/api/mark/mark.js +28 -41
  210. package/lib/api/mark/mark.js.map +1 -1
  211. package/lib/api/props.js +0 -20
  212. package/lib/api/props.js.map +1 -1
  213. package/lib/component/axis.d.ts +5 -7
  214. package/lib/component/axis.js +127 -96
  215. package/lib/component/axis.js.map +1 -1
  216. package/lib/component/axisArc.d.ts +7 -0
  217. package/lib/component/axisArc.js +13 -0
  218. package/lib/component/axisArc.js.map +1 -0
  219. package/lib/component/axisRadar.d.ts +9 -0
  220. package/lib/component/axisRadar.js +50 -0
  221. package/lib/component/axisRadar.js.map +1 -0
  222. package/lib/component/axisX.d.ts +2 -1
  223. package/lib/component/axisX.js +6 -4
  224. package/lib/component/axisX.js.map +1 -1
  225. package/lib/component/axisY.d.ts +1 -1
  226. package/lib/component/axisY.js +3 -3
  227. package/lib/component/axisY.js.map +1 -1
  228. package/lib/component/index.d.ts +8 -0
  229. package/lib/component/index.js +12 -1
  230. package/lib/component/index.js.map +1 -1
  231. package/lib/component/legendCategory.d.ts +5 -3
  232. package/lib/component/legendCategory.js +79 -35
  233. package/lib/component/legendCategory.js.map +1 -1
  234. package/lib/component/legendContinuous.d.ts +4 -2
  235. package/lib/component/legendContinuous.js +75 -23
  236. package/lib/component/legendContinuous.js.map +1 -1
  237. package/lib/component/legendContinuousBlock.d.ts +4 -0
  238. package/lib/component/legendContinuousBlock.js +10 -0
  239. package/lib/component/legendContinuousBlock.js.map +1 -0
  240. package/lib/component/legendContinuousBlockSize.d.ts +4 -0
  241. package/lib/component/legendContinuousBlockSize.js +10 -0
  242. package/lib/component/legendContinuousBlockSize.js.map +1 -0
  243. package/lib/component/legendContinuousSize.d.ts +4 -0
  244. package/lib/component/legendContinuousSize.js +14 -0
  245. package/lib/component/legendContinuousSize.js.map +1 -0
  246. package/lib/component/scrollbar.js +1 -1
  247. package/lib/component/scrollbar.js.map +1 -1
  248. package/lib/component/slider.js +1 -1
  249. package/lib/component/slider.js.map +1 -1
  250. package/lib/component/title.js +1 -1
  251. package/lib/component/title.js.map +1 -1
  252. package/lib/component/utils.d.ts +12 -0
  253. package/lib/component/utils.js +39 -1
  254. package/lib/component/utils.js.map +1 -1
  255. package/lib/composition/facetCircle.js +1 -1
  256. package/lib/composition/facetCircle.js.map +1 -1
  257. package/lib/coordinate/index.d.ts +3 -3
  258. package/lib/coordinate/index.js +4 -1
  259. package/lib/coordinate/index.js.map +1 -1
  260. package/lib/coordinate/polar.d.ts +6 -0
  261. package/lib/coordinate/polar.js +20 -7
  262. package/lib/coordinate/polar.js.map +1 -1
  263. package/lib/coordinate/radial.d.ts +6 -0
  264. package/lib/coordinate/radial.js +19 -6
  265. package/lib/coordinate/radial.js.map +1 -1
  266. package/lib/coordinate/theta.d.ts +7 -0
  267. package/lib/coordinate/theta.js +18 -5
  268. package/lib/coordinate/theta.js.map +1 -1
  269. package/lib/interaction/builtin/elementHighlight.d.ts +2 -0
  270. package/lib/interaction/builtin/elementHighlightByColor.d.ts +2 -0
  271. package/lib/interaction/builtin/elementHighlightByX.d.ts +2 -0
  272. package/lib/interaction/index.d.ts +2 -0
  273. package/lib/interaction/index.js +5 -1
  274. package/lib/interaction/index.js.map +1 -1
  275. package/lib/interaction/native/brushAxisHighlight.js +6 -1
  276. package/lib/interaction/native/brushAxisHighlight.js.map +1 -1
  277. package/lib/interaction/native/brushFilter.js +1 -1
  278. package/lib/interaction/native/brushFilter.js.map +1 -1
  279. package/lib/interaction/native/elementHighlight.d.ts +7 -2
  280. package/lib/interaction/native/elementHighlight.js +71 -18
  281. package/lib/interaction/native/elementHighlight.js.map +1 -1
  282. package/lib/interaction/native/elementHighlightByColor.d.ts +4 -1
  283. package/lib/interaction/native/elementHighlightByColor.js +18 -2
  284. package/lib/interaction/native/elementHighlightByColor.js.map +1 -1
  285. package/lib/interaction/native/elementHighlightByX.d.ts +3 -3
  286. package/lib/interaction/native/elementHighlightByX.js +18 -2
  287. package/lib/interaction/native/elementHighlightByX.js.map +1 -1
  288. package/lib/interaction/native/elementSelect.d.ts +1 -1
  289. package/lib/interaction/native/elementSelect.js +41 -20
  290. package/lib/interaction/native/elementSelect.js.map +1 -1
  291. package/lib/interaction/native/elementSelectByColor.js +2 -1
  292. package/lib/interaction/native/elementSelectByColor.js.map +1 -1
  293. package/lib/interaction/native/elementSelectByX.js +2 -1
  294. package/lib/interaction/native/elementSelectByX.js.map +1 -1
  295. package/lib/interaction/native/legendFilter.d.ts +6 -0
  296. package/lib/interaction/native/legendFilter.js +31 -6
  297. package/lib/interaction/native/legendFilter.js.map +1 -1
  298. package/lib/interaction/native/legendHighlight.d.ts +4 -0
  299. package/lib/interaction/native/legendHighlight.js +97 -0
  300. package/lib/interaction/native/legendHighlight.js.map +1 -0
  301. package/lib/interaction/native/poptip.d.ts +5 -0
  302. package/lib/interaction/native/poptip.js +95 -0
  303. package/lib/interaction/native/poptip.js.map +1 -0
  304. package/lib/interaction/native/utils.d.ts +13 -2
  305. package/lib/interaction/native/utils.js +154 -27
  306. package/lib/interaction/native/utils.js.map +1 -1
  307. package/lib/label-transform/overlapDodgeY.js +0 -8
  308. package/lib/label-transform/overlapDodgeY.js.map +1 -1
  309. package/lib/mark/area.js +1 -1
  310. package/lib/mark/area.js.map +1 -1
  311. package/lib/mark/pack.js +0 -1
  312. package/lib/mark/pack.js.map +1 -1
  313. package/lib/mark/treemap.js +0 -1
  314. package/lib/mark/treemap.js.map +1 -1
  315. package/lib/runtime/component.d.ts +3 -0
  316. package/lib/runtime/component.js +250 -107
  317. package/lib/runtime/component.js.map +1 -1
  318. package/lib/runtime/coordinate.d.ts +11 -0
  319. package/lib/runtime/coordinate.js +26 -17
  320. package/lib/runtime/coordinate.js.map +1 -1
  321. package/lib/runtime/layout.d.ts +1 -1
  322. package/lib/runtime/layout.js +146 -77
  323. package/lib/runtime/layout.js.map +1 -1
  324. package/lib/runtime/plot.js +4 -3
  325. package/lib/runtime/plot.js.map +1 -1
  326. package/lib/runtime/render.js +20 -12
  327. package/lib/runtime/render.js.map +1 -1
  328. package/lib/runtime/scale.d.ts +2 -1
  329. package/lib/runtime/scale.js +37 -1
  330. package/lib/runtime/scale.js.map +1 -1
  331. package/lib/runtime/transform.js +1 -1
  332. package/lib/runtime/transform.js.map +1 -1
  333. package/lib/runtime/types/common.d.ts +11 -2
  334. package/lib/runtime/types/component.d.ts +9 -7
  335. package/lib/runtime/types/options.d.ts +8 -6
  336. package/lib/runtime/types/scale.d.ts +18 -0
  337. package/lib/runtime/types/scale.js +22 -0
  338. package/lib/runtime/types/scale.js.map +1 -0
  339. package/lib/runtime/types/theme.d.ts +2 -1
  340. package/lib/shape/area/hv.d.ts +3 -0
  341. package/lib/shape/area/hv.js +13 -0
  342. package/lib/shape/area/hv.js.map +1 -0
  343. package/lib/shape/area/hvh.d.ts +3 -0
  344. package/lib/shape/area/{step.js → hvh.js} +5 -5
  345. package/lib/shape/area/hvh.js.map +1 -0
  346. package/lib/shape/area/vh.d.ts +3 -0
  347. package/lib/shape/area/vh.js +13 -0
  348. package/lib/shape/area/vh.js.map +1 -0
  349. package/lib/shape/connector/connector.js +1 -1
  350. package/lib/shape/index.d.ts +6 -2
  351. package/lib/shape/index.js +7 -3
  352. package/lib/shape/index.js.map +1 -1
  353. package/lib/shape/interval/color.d.ts +1 -0
  354. package/lib/shape/interval/color.js +67 -54
  355. package/lib/shape/interval/color.js.map +1 -1
  356. package/lib/shape/utils.js.map +1 -1
  357. package/lib/spec/composition.d.ts +0 -3
  358. package/lib/spec/geometry.d.ts +1 -1
  359. package/lib/spec/interaction.d.ts +33 -15
  360. package/lib/spec/transform.d.ts +13 -3
  361. package/lib/stdlib/index.js +1 -1
  362. package/lib/stdlib/index.js.map +1 -1
  363. package/lib/theme/academy.js +10 -4
  364. package/lib/theme/academy.js.map +1 -1
  365. package/lib/theme/dark.js +10 -4
  366. package/lib/theme/dark.js.map +1 -1
  367. package/lib/theme/light.js +12 -4
  368. package/lib/theme/light.js.map +1 -1
  369. package/lib/transform/sample.js +42 -26
  370. package/lib/transform/sample.js.map +1 -1
  371. package/lib/transform/utils/lttb.d.ts +5 -0
  372. package/lib/transform/utils/lttb.js +60 -0
  373. package/lib/transform/utils/lttb.js.map +1 -0
  374. package/lib/utils/angle.d.ts +2 -0
  375. package/lib/utils/angle.js +12 -0
  376. package/lib/utils/angle.js.map +1 -0
  377. package/lib/utils/array.d.ts +8 -0
  378. package/lib/utils/array.js +38 -1
  379. package/lib/utils/array.js.map +1 -1
  380. package/lib/utils/coordinate.d.ts +4 -0
  381. package/lib/utils/coordinate.js +24 -1
  382. package/lib/utils/coordinate.js.map +1 -1
  383. package/lib/utils/event.d.ts +0 -2
  384. package/lib/utils/event.js +1 -21
  385. package/lib/utils/event.js.map +1 -1
  386. package/lib/utils/scale.d.ts +1 -0
  387. package/lib/utils/scale.js +5 -4
  388. package/lib/utils/scale.js.map +1 -1
  389. package/lib/utils/vector.d.ts +1 -1
  390. package/lib/utils/vector.js +1 -1
  391. package/package.json +7 -7
  392. package/src/animation/morphing.ts +23 -2
  393. package/src/api/chart.ts +43 -20
  394. package/src/api/composition/base.ts +46 -1
  395. package/src/api/mark/base.ts +58 -0
  396. package/src/api/mark/mark.ts +1 -20
  397. package/src/api/props.ts +0 -23
  398. package/src/component/axis.ts +199 -118
  399. package/src/component/axisArc.ts +16 -0
  400. package/src/component/axisRadar.ts +73 -0
  401. package/src/component/axisX.ts +7 -4
  402. package/src/component/axisY.ts +4 -4
  403. package/src/component/index.ts +8 -0
  404. package/src/component/legendCategory.ts +156 -35
  405. package/src/component/legendContinuous.ts +133 -32
  406. package/src/component/legendContinuousBlock.ts +17 -0
  407. package/src/component/legendContinuousBlockSize.ts +22 -0
  408. package/src/component/legendContinuousSize.ts +27 -0
  409. package/src/component/scrollbar.ts +1 -1
  410. package/src/component/slider.ts +1 -1
  411. package/src/component/title.ts +1 -1
  412. package/src/component/utils.ts +46 -0
  413. package/src/composition/facetCircle.ts +1 -1
  414. package/src/coordinate/index.ts +3 -3
  415. package/src/coordinate/polar.ts +19 -11
  416. package/src/coordinate/radial.ts +19 -10
  417. package/src/coordinate/theta.ts +18 -9
  418. package/src/interaction/index.ts +2 -0
  419. package/src/interaction/native/brushAxisHighlight.ts +9 -1
  420. package/src/interaction/native/brushFilter.ts +1 -1
  421. package/src/interaction/native/elementHighlight.ts +78 -12
  422. package/src/interaction/native/elementHighlightByColor.ts +9 -4
  423. package/src/interaction/native/elementHighlightByX.ts +9 -5
  424. package/src/interaction/native/elementSelect.ts +58 -15
  425. package/src/interaction/native/elementSelectByColor.ts +4 -1
  426. package/src/interaction/native/elementSelectByX.ts +4 -1
  427. package/src/interaction/native/legendFilter.ts +29 -7
  428. package/src/interaction/native/legendHighlight.ts +86 -0
  429. package/src/interaction/native/poptip.ts +87 -0
  430. package/src/interaction/native/utils.ts +183 -26
  431. package/src/label-transform/overlapDodgeY.ts +0 -7
  432. package/src/mark/area.ts +1 -1
  433. package/src/mark/pack.ts +0 -1
  434. package/src/mark/treemap.ts +0 -1
  435. package/src/runtime/component.ts +335 -124
  436. package/src/runtime/coordinate.ts +29 -16
  437. package/src/runtime/layout.ts +206 -97
  438. package/src/runtime/plot.ts +5 -4
  439. package/src/runtime/render.ts +26 -13
  440. package/src/runtime/scale.ts +41 -0
  441. package/src/runtime/transform.ts +3 -0
  442. package/src/runtime/types/common.ts +23 -10
  443. package/src/runtime/types/component.ts +19 -10
  444. package/src/runtime/types/options.ts +24 -16
  445. package/src/runtime/types/scale.ts +20 -0
  446. package/src/runtime/types/theme.ts +2 -1
  447. package/src/shape/area/hv.ts +20 -0
  448. package/src/shape/area/{step.ts → hvh.ts} +3 -3
  449. package/src/shape/area/vh.ts +20 -0
  450. package/src/shape/connector/connector.ts +1 -1
  451. package/src/shape/index.ts +7 -2
  452. package/src/shape/interval/color.ts +86 -54
  453. package/src/shape/utils.ts +2 -0
  454. package/src/spec/composition.ts +0 -1
  455. package/src/spec/geometry.ts +3 -1
  456. package/src/spec/interaction.ts +51 -19
  457. package/src/spec/transform.ts +27 -2
  458. package/src/stdlib/index.ts +22 -6
  459. package/src/theme/academy.ts +10 -4
  460. package/src/theme/dark.ts +10 -4
  461. package/src/theme/light.ts +12 -4
  462. package/src/transform/sample.ts +54 -18
  463. package/src/transform/utils/lttb.ts +73 -0
  464. package/src/utils/angle.ts +7 -0
  465. package/src/utils/array.ts +39 -0
  466. package/src/utils/coordinate.ts +29 -0
  467. package/src/utils/event.ts +0 -26
  468. package/src/utils/scale.ts +4 -4
  469. package/src/utils/vector.ts +1 -1
  470. package/esm/shape/area/step.d.ts +0 -3
  471. package/esm/shape/area/step.js.map +0 -1
  472. package/lib/shape/area/step.d.ts +0 -3
  473. package/lib/shape/area/step.js.map +0 -1
package/dist/g2.min.js CHANGED
@@ -1,10 +1,10 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(p){"use strict";const y="main-layer",et="label-layer",nt="element",Y="view",rt="plot",it="component",at="label",ot="area";var N="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function j(t,e,n,r,i){!function t(e,n,r,i,a){for(;r<i;){600<i-r&&(o=i-r+1,u=n-r+1,l=Math.log(o),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(o-s)/o)*(u-o/2<0?-1:1),c=Math.max(r,Math.floor(n-u*s/o+l)),u=Math.min(i,Math.floor(n+(o-u)*s/o+l)),t(e,n,c,u,a));var o,s,l,c,u,h=e[n],f=r,d=i;for(I(e,r,n),0<a(e[i],h)&&I(e,r,i);f<d;){for(I(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?I(e,r,d):I(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||B)}function I(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function B(t,e){return t<e?-1:e<t?1:0}function D(t,e){z(t,0,t.children.length,e,t)}function z(t,e,n,r,i){(i=i||$(null)).minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];G(i,t.leaf?r(o):o)}return i}function G(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function W(t,e){return t.minX-e.minX}function V(t,e){return t.minY-e.minY}function H(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function q(t){return t.maxX-t.minX+(t.maxY-t.minY)}function U(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function X(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function $(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(j(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(e=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}).prototype.all=function(){return this._all(this.data,[])},e.prototype.search=function(t){var e=this.data,n=[];if(X(t,e))for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;X(t,s)&&(e.leaf?n.push(o):U(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},e.prototype.collides=function(t){var e=this.data;if(X(t,e))for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(X(t,a)){if(e.leaf||U(t,a))return!0;n.push(i)}}e=n.pop()}return!1},e.prototype.load=function(t){if(t&&t.length)if(t.length<this._minEntries)for(var e=0;e<t.length;e++)this.insert(t[e]);else{var n,r=this._build(t.slice(),0,t.length-1,0);this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(n=this.data,this.data=r,r=n),this._insert(r,this.data.height-r.height-1,!0)):this.data=r}return this},e.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},e.prototype.clear=function(){return this.data=$([]),this},e.prototype.remove=function(t,e){if(t)for(var n,r,i,a=this.data,o=this.toBBox(t),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],n=l.pop(),i=!0),a.leaf){var c=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,a.children,e);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}i||a.leaf||!U(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(s.push(a),l.push(n),a=(r=a).children[n=0])}return this},e.prototype.toBBox=function(t){return t},e.prototype.compareMinX=function(t,e){return t.minX-e.minX},e.prototype.compareMinY=function(t,e){return t.minY-e.minY},e.prototype.toJSON=function(){return this.data},e.prototype.fromJSON=function(t){return this.data=t,this},e.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},e.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)D(i=$(t.slice(e,n+1)),this.toBBox);else{r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(i=$([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));K(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);K(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,r-1))}}D(i,this.toBBox)}return i},e.prototype._chooseSubtree=function(t,e,n,r){for(;;){if(r.push(e),e.leaf||r.length-1===n)break;for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=H(l),u=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.minY))-c);u<a?(a=u,i=c<i?c:i,o=l):u===a&&c<i&&(i=c,o=l)}e=o||e.children[0]}var h,u;return e},e.prototype._insert=function(t,e,n){var n=n?t:this.toBBox(t),r=[],i=this._chooseSubtree(n,this.data,e,r);for(i.children.push(t),G(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},e.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=$(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,D(n,this.toBBox),D(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},e.prototype._splitRoot=function(t,e){this.data=$([t,e]),this.data.height=t.height+1,this.data.leaf=!1,D(this.data,this.toBBox)},e.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=z(t,0,c,this.toBBox),h=z(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=H(u)+H(h);f<s?(s=f,r=c,l=d<l?d:l):f===s&&d<l&&(l=d,r=c)}return r||n-e},e.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:W,i=t.leaf?this.compareMinY:V;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},e.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=z(t,0,e,i),o=z(t,n-e,n,i),s=q(a)+q(o),l=e;l<n-e;l++){var c=t.children[l];G(a,t.leaf?i(c):c),s+=q(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];G(o,t.leaf?i(h):h),s+=q(o)}return s},e.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)G(e[r],t)},e.prototype._condense=function(t){for(var e=t.length-1,n=void 0;0<=e;e--)0===t[e].children.length?0<e?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():D(t[e],this.toBBox)};var Z=e,st=1e-6,lt="undefined"!=typeof Float32Array?Float32Array:Array;function ct(){var t=new lt(9);return lt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ut=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],e=e[8],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],m=n[6],v=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*l+d*e,t[3]=p*r+g*o+y*c,t[4]=p*i+g*s+y*u,t[5]=p*a+g*l+y*e,t[6]=m*r+v*o+n*c,t[7]=m*i+v*s+n*u,t[8]=m*a+v*l+n*e,t};function ht(){var t=new lt(16);return lt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ft(t){var e=new lt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function pt(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function gt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yt(t,e){var n,r,i,a,o,s;return t===e?(n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s):(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]),t}function mt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15],m=n*s-r*o,v=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,k=i*c-a*l,E=u*g-h*p,M=u*y-f*p,O=u*e-d*p,S=h*y-f*g,_=h*e-d*g,A=f*e-d*y,T=m*A-v*_+b*S+x*O-w*M+k*E;return T?(t[0]=(s*A-l*_+c*S)*(T=1/T),t[1]=(i*_-r*A-a*S)*T,t[2]=(g*k-y*w+e*x)*T,t[3]=(f*w-h*k-d*x)*T,t[4]=(l*O-o*A-c*M)*T,t[5]=(n*A-i*O+a*M)*T,t[6]=(y*b-p*k-e*v)*T,t[7]=(u*k-f*b+d*v)*T,t[8]=(o*_-s*O+c*E)*T,t[9]=(r*O-n*_-a*E)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*M-o*S-l*E)*T,t[13]=(n*S-r*M+i*E)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function vt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function bt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=e[14],e=e[15],v=n[0],b=n[1],x=n[2],w=n[3];return t[0]=v*r+b*s+x*h+w*g,t[1]=v*i+b*l+x*f+w*y,t[2]=v*a+b*c+x*d+w*m,t[3]=v*o+b*u+x*p+w*e,v=n[4],b=n[5],x=n[6],w=n[7],t[4]=v*r+b*s+x*h+w*g,t[5]=v*i+b*l+x*f+w*y,t[6]=v*a+b*c+x*d+w*m,t[7]=v*o+b*u+x*p+w*e,v=n[8],b=n[9],x=n[10],w=n[11],t[8]=v*r+b*s+x*h+w*g,t[9]=v*i+b*l+x*f+w*y,t[10]=v*a+b*c+x*d+w*m,t[11]=v*o+b*u+x*p+w*e,v=n[12],b=n[13],x=n[14],w=n[15],t[12]=v*r+b*s+x*h+w*g,t[13]=v*i+b*l+x*f+w*y,t[14]=v*a+b*c+x*d+w*m,t[15]=v*o+b*u+x*p+w*e,t}function xt(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g=n[0],y=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*n+e[12],t[13]=e[1]*g+e[5]*y+e[9]*n+e[13],t[14]=e[2]*g+e[6]*y+e[10]*n+e[14],t[15]=e[3]*g+e[7]*y+e[11]*n+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*y+h*n+e[12],t[13]=i*g+l*y+f*n+e[13],t[14]=a*g+c*y+d*n+e[14],t[15]=o*g+u*y+p*n+e[15]),t}function wt(t,e,n){var r=n[0],i=n[1],n=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function kt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*n+l*r,t[5]=a*n+c*r,t[6]=o*n+u*r,t[7]=s*n+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function Et(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n-l*r,t[1]=a*n-c*r,t[2]=o*n-u*r,t[3]=s*n-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function Mt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function St(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=r+r,s=i+i,l=a+a,c=r*o,u=r*s,r=r*l,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+a),t[1]=u+e,t[2]=r-s,t[3]=0,t[4]=u-e,t[5]=1-(c+a),t[6]=i+o,t[7]=0,t[8]=r+s,t[9]=i-o,t[10]=1-(c+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function _t(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function At(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],e=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,c,e),t}function Tt(t,e){var n=new lt(3),r=(At(n,e),1/n[0]),i=1/n[1],n=1/n[2],a=e[0]*r,o=e[1]*i,s=e[2]*n,l=e[4]*r,c=e[5]*i,u=e[6]*n,r=e[8]*r,i=e[9]*i,e=e[10]*n,n=a+c+e,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function Pt(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],e=e[3],l=a+a,c=o+o,u=s+s,h=a*l,f=a*c,a=a*u,d=o*c,o=o*u,s=s*u,l=e*l,c=e*c,e=e*u,u=r[0],p=r[1],r=r[2],g=i[0],y=i[1],i=i[2],m=(1-(d+s))*u,v=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=m,t[1]=v,t[2]=u,t[3]=0,t[4]=f,t[5]=e,t[6]=s,t[7]=0,t[8]=p,t[9]=a,t[10]=c,t[11]=0,t[12]=n[0]+g-(m*g+f*y+p*i),t[13]=n[1]+y-(v*g+e*y+a*i),t[14]=n[2]+i-(u*g+s*y+c*i),t[15]=1,t}function Lt(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n+n,o=r+r,s=i+i,n=n*a,l=r*a,r=r*o,c=i*a,u=i*o,i=i*s,a=e*a,o=e*o,e=e*s;return t[0]=1-r-i,t[1]=l+e,t[2]=c-o,t[3]=0,t[4]=l-e,t[5]=1-n-i,t[6]=u+a,t[7]=0,t[8]=c+o,t[9]=u-a,t[10]=1-n-r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ct(t,e,n,r,i){e=1/Math.tan(e/2);return t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(n=1/(r-i)),t[14]=2*i*r*n):(t[10]=-1,t[14]=-2*r),t}function Nt(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*c,t[15]=1,t}var jt=Nt;function Rt(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<st&&Math.abs(c-d)<st&&Math.abs(e-n)<st?gt(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,t[3]=0,t[4]=r,t[5]=a,t[6]=d,t[7]=0,t[8]=u,t[9]=o,t[10]=n,t[11]=0,t[12]=-(i*l+r*c+u*e),t[13]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function Ft(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var It=Object.freeze({__proto__:null,create:ht,clone:ft,copy:dt,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new lt(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=l,y[9]=c,y[10]=u,y[11]=h,y[12]=f,y[13]=d,y[14]=p,y[15]=g,y},set:pt,identity:gt,transpose:yt,invert:mt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15];return t[0]=s*(f*e-d*y)-h*(l*e-c*y)+g*(l*d-c*f),t[1]=-(r*(f*e-d*y)-h*(i*e-a*y)+g*(i*d-a*f)),t[2]=r*(l*e-c*y)-s*(i*e-a*y)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*y)-u*(l*e-c*y)+p*(l*d-c*f)),t[5]=n*(f*e-d*y)-u*(i*e-a*y)+p*(i*d-a*f),t[6]=-(n*(l*e-c*y)-o*(i*e-a*y)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*y-f*g)-u*(s*y-l*g)+p*(s*f-l*h)),t[13]=n*(h*y-f*g)-u*(r*y-i*g)+p*(r*f-i*h),t[14]=-(n*(s*y-l*g)-o*(r*y-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:vt,multiply:bt,translate:xt,scale:wt,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,k,E,M=r[0],O=r[1],r=r[2],S=Math.hypot(M,O,r);return S<st?null:(M*=S=1/S,O*=S,r*=S,S=Math.sin(n),n=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],y=e[11],v=M*O*(i=1-n)-r*S,b=O*O*i+n,x=r*O*i+M*S,w=M*r*i+O*S,k=O*r*i-M*S,E=r*r*i+n,t[0]=a*(n=M*M*i+n)+c*(m=O*M*i+r*S)+d*(r=r*M*i-O*S),t[1]=o*n+u*m+p*r,t[2]=s*n+h*m+g*r,t[3]=l*n+f*m+y*r,t[4]=a*v+c*b+d*x,t[5]=o*v+u*b+p*x,t[6]=s*v+h*b+g*x,t[7]=l*v+f*b+y*x,t[8]=a*w+c*k+d*E,t[9]=o*w+u*k+p*E,t[10]=s*w+h*k+g*E,t[11]=l*w+f*k+y*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:kt,rotateY:Et,rotateZ:function(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n+l*r,t[1]=a*n+c*r,t[2]=o*n+u*r,t[3]=s*n+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:Mt,fromScaling:Ot,fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<st?null:(i*=o=1/o,a*=o,n*=o,o=Math.sin(e),e=Math.cos(e),t[0]=i*i*(r=1-e)+e,t[1]=a*i*r+n*o,t[2]=n*i*r-a*o,t[3]=0,t[4]=i*a*r-n*o,t[5]=a*a*r+e,t[6]=n*a*r+i*o,t[7]=0,t[8]=i*n*r+a*o,t[9]=a*n*r-i*o,t[10]=n*n*r+e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:St,fromQuat2:function(t,e){var n=new lt(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(n[0]=2*(s*o+u*r+l*a-c*i),n[1]=2*(l*o+u*i+c*r-s*a),n[2]=2*(c*o+u*a+s*i-l*r)),St(t,e,n),t},getTranslation:_t,getScaling:At,getRotation:Tt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],e=e[3],s=i*(u=i+i),l=i*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,t[3]=0,t[4]=(l-e)*d,t[5]=(1-(s+o))*d,t[6]=(a+u)*d,t[7]=0,t[8]=(i+h)*r,t[9]=(a-u)*r,t[10]=(1-(s+c))*r,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Pt,fromQuat:Lt,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Ct,perspective:Ct,perspectiveZO:function(t,e,n,r,i){return e=1/Math.tan(e/2),t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(n=1/(r-i)),t[14]=i*r*n):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),e=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+e),l=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-e)*s*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Nt,ortho:jt,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),o=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=o,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=a*o,t[15]=1,t},lookAt:Rt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],e=e[2],o=r[0],s=r[1],r=r[2],l=i-n[0],c=a-n[1],n=e-n[2],u=l*l+c*c+n*n,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,t[7]=0,t[8]=l,t[9]=c,t[10]=n,t[11]=0,t[12]=i,t[13]=a,t[14]=e,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Ft,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],y=t[14],t=t[15],m=e[0],v=e[1],b=e[2],x=e[3],w=e[4],k=e[5],E=e[6],M=e[7],O=e[8],S=e[9],_=e[10],A=e[11],T=e[12],P=e[13],L=e[14],e=e[15];return Math.abs(n-m)<=st*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=st*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=st*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=st*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=st*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-k)<=st*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-E)<=st*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-M)<=st*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(u-O)<=st*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-S)<=st*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-_)<=st*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(d-A)<=st*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-T)<=st*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=st*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-L)<=st*Math.max(1,Math.abs(y),Math.abs(L))&&Math.abs(t-e)<=st*Math.max(1,Math.abs(t),Math.abs(e))},mul:bt,sub:Ft});function m(){var t=new lt(3);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Bt(t){var e=new lt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Dt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function k(t,e,n){var r=new lt(3);return r[0]=t,r[1]=e,r[2]=n,r}function zt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Gt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Wt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Yt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Vt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Ht(t,e){var n=e[0],r=e[1],i=e[2],n=n*n+r*r+i*i;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function qt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ut(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[0],o=n[1],n=n[2];t[0]=i*n-e*o,t[1]=e*a-r*n,t[2]=r*o-i*a}function Xt(t,e,n,r){var i=e[0],a=e[1],e=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=e+r*(n[2]-e)}function $t(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[3]*r+n[7]*i+n[11]*e+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*e+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*e+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*e+n[14])/a,t}function Kt(t,e,n){var r=e[0],i=e[1],e=e[2];t[0]=r*n[0]+i*n[3]+e*n[6],t[1]=r*n[1]+i*n[4]+e*n[7],t[2]=r*n[2]+i*n[5]+e*n[8]}function Zt(t,e){var n=t[0],r=t[1],t=t[2],i=e[0],a=e[1],e=e[2];return Math.abs(n-i)<=st*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=st*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=st*Math.max(1,Math.abs(t),Math.abs(e))}var Jt=Yt,Qt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],e=e[2]-t[2];return Math.hypot(n,r,e)},te=Dt;function ee(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ne(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*e,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*e,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*e,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*e,t}function re(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ie(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function ae(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=n[0],s=n[1],l=n[2],n=n[3];return t[0]=r*n+e*o+i*l-a*s,t[1]=i*n+e*s+a*o-r*l,t[2]=a*n+e*l+r*s-i*o,t[3]=e*n-r*o-i*s-a*l,t}function oe(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e,a=a?1/a:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t}function se(t,e,n,r){var i=.5*Math.PI/180,i=(e*=i,n*=i,r*=i,Math.sin(e)),e=Math.cos(e),a=Math.sin(n),n=Math.cos(n),o=Math.sin(r),r=Math.cos(r);t[0]=i*n*r-e*a*o,t[1]=e*a*r+i*n*o,t[2]=e*n*o-i*a*r,t[3]=e*n*r+i*a*o}m(),ee();var le=function(t,e,n,r){var i=new lt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ce=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ue=ae,he=function(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e;return 0<a&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=e*a,t};function fe(t,e){var n=new lt(2);return n[0]=t,n[1]=e,n}function de(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function pe(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ge(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ye(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function me(t,e){var n=e[0]-t[0],e=e[1]-t[1];return Math.hypot(n,e)}function ve(t,e){var n=e[0],r=e[1],n=n*n+r*r;return 0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t}function be(t,e){return t[0]*e[0]+t[1]*e[1]}function xe(t,e){return t[0]===e[0]&&t[1]===e[1]}m(),k(1,0,0),k(0,1,0),re(),re(),ct();var we=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};function ke(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}e=new lt(2),lt!=Float32Array&&(e[0]=0,e[1]=0);var Ee=function(t,e){return(Ee=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function Me(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ee(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return(v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function J(t,e){var n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function t(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}function Oe(t,o,s,l){return new(s=s||Promise)(function(n,e){function r(t){try{a(l.next(t))}catch(t){e(t)}}function i(t){try{a(l.throw(t))}catch(t){e(t)}}function a(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,i)}a((l=l.apply(t,o||[])).next())})}function x(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function b(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Se(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t===e&&r:e.has(t))return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}var _e={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var Ae={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Te(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return Ae[e]===t.length-1&&"achlmqstvz".includes(e)})}function Pe(t){return Te(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function Le(t){return Pe(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function Ce(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Ae[n]&&("m"===n&&2<r.length?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Ae[n]))),Ae[n]););}function Ne(t){return 48<=t&&t<=57}function je(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||5760<=e&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Re(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=Ae[s[l].toLowerCase()];if(t.segmentStart=l,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return 1;default:return}}(c)){if(t.index+=1,je(t),t.data=[],u)for(;;){for(var h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?function(t){var e,n,r=t.max,i=t.pathValue,a=t.index,o=a,s=!1,l=!1,c=!1;if(r<=o)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(Ne(n=43!==(n=i.charCodeAt(o))&&45!==n?n:i.charCodeAt(o+=1))||46===n){if(46!==n){if(e=48===n,n=i.charCodeAt(o+=1),e&&o<r&&n&&Ne(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&Ne(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;Ne(i.charCodeAt(o));)o+=1,l=!0;n=i.charCodeAt(o)}if(101===n||69===n){if(c&&!s&&!l)return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid float exponent';if(43!==(n=i.charCodeAt(o+=1))&&45!==n||(o+=1),!(o<r&&Ne(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&Ne(i.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(a,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" is not a number'}(t):(a=i=r=void 0,r=(n=t).index,i=n.pathValue,48===(a=i.charCodeAt(r))?(n.param=0,n.index+=1):49===a?(n.param=1,n.index+=1):n.err='[path-util]: invalid Arc flag "'+i[r]+'", expecting 0 or 1 at index '+r),t.err.length)return;t.data.push(t.param),je(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,je(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}Ce(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var Fe=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Ie(t){var o,s,l,c;return Pe(t)?ke(t):(t=function(t){if(Te(t))return ke(t);var e=new Fe(t);for(je(e);e.index<e.max&&!e.err.length;)Re(e);return e.err||e.segments}(t),c=l=s=o=0,t.map(function(t){var e=t.slice(1).map(Number),t=t[0],n=t.toUpperCase();if("M"===t)return o=e[0],s=e[1],["M",l=o,c=s];if(t!==n)switch(n){case"A":i=[n,e[0],e[1],e[2],e[3],e[4],e[5]+o,e[6]+s];break;case"V":i=[n,e[0]+s];break;case"H":i=[n,e[0]+o];break;default:var r=e.map(function(t,e){return t+(e%2?s:o)}),i=[n].concat(r)}else i=[n].concat(e);var a=i.length;switch(n){case"Z":o=l,s=c;break;case"H":o=i[1];break;case"V":s=i[1];break;default:o=i[a-2],s=i[a-1],"M"===n&&(l=o,c=s)}return i}))}function Be(t){if(Le(t))return ke(t);for(var e,n,r,i,a,o,s,l=Ie(t),c=v({},_e),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=n.y2,o=e.slice(1).map(Number),s=e,"TQ".includes(r)||(n.qx=null,n.qy=null),"H"===r?s=["L",e[1],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function De(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function ze(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],m=c[2],v=c[3]):(t=(g=De(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=De(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,y=r*r,m=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*y-d*g*g-y*p*p)/(d*g*g+y*p*p))))*n*g/r+(t+s)/2,v=a*-r*p/n+(e+l)/2,b=Math.asin(((e-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<m?Math.PI-b:b,x=s<m?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(y=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=ze(s=m+n*Math.cos(x),l=v+r*Math.sin(x),n,r,i,0,o,g,a,[x,y,m,v])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,y=4/3*r*g,m=[t,e],v=[t+a*u,e-y*p],b=[s+a*o,l-y*i],x=[s,l];if(v[0]=2*m[0]-v[0],v[1]=2*m[1]-v[1],c)return v.concat(b,x,f);for(var w=[],k=0,E=(f=v.concat(b,x,f)).length;k<E;k+=1)w[k]=k%2?De(f[k-1],f[k],h).y:De(f[k],f[k+1],h).x;return w}function Ge(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function We(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ye(t,e,n,r,i){var a=We([t,e],[n,r]),o={x:0,y:0};return{length:a,point:o="number"==typeof i?i<=0?{x:t,y:e}:a<=i?{x:n,y:r}:{x:(i=Ge([t,e],[n,r],i/a))[0],y:i[1]}:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ve(t,e,n,r){var t=[t,e],e=[n,r],i=Ge(t,e,.5),e=Ge(e,i,.5),a=Ge(i,e,.5),o=Ge(e,a,.5),s=Ge(a,o,.5),t=Ye(t[0],t[1],i[0],i[1],a[0]).point,i=Ye(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function He(t,e){var n;if(void 0===e&&(e=!1),Le(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=ke(t),e?[n,[]]:n;for(var r,i=Be(t),a=v({},_e),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=function(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=e.x1,d=e.y1,p=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=h,t;case"A":return s=[f,d].concat(c),["C"].concat(ze(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=u,e.qy=h,s=[f,d].concat(c),["C"].concat((n=s[0],r=s[1],i=s[2],a=s[3],o=s[4],s=s[5],[1/3*n+2/3*i,1/3*r+2/3*a,1/3*o+2/3*i,1/3*s+2/3*a,o,s]));case"L":return["C"].concat(Ve(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(Ve(f,d,p,g))}return t}(i[u],a),f=(i[u]=h,y=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],y=p;g.length;)d[p]="A",f.splice(y+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function qe(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function Ue(t,e,n,r,i,F,I,a,o,s,l){var c=l.bbox,B=void 0===c||c,c=l.length,D=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],y=[f,d],m={x:0,y:0},v=[{x:f,y:d}];h&&s<=0&&(m={x:f,y:d});for(var b,x,w,k,E,M,O,S,_,A,T,P,L,C,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,k=r,E=i,M=F,O=I,S=a,_=o,A=R/u,P=j=N=C=L=P=T=void 0,P=Math.abs,L=Math.sin,C=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(k),k=j/180*((E%360+360)%360),f=(T=b===S&&x===_?{x:b,y:x}:0===w||0===P?Ye(b,x,S,_,A).point:(E=(b-S)/2,T=(x-_)/2,E={x:C(k)*E+L(k)*T,y:-L(k)*E+C(k)*T},1<(T=Math.pow(E.x,2)/Math.pow(w,2)+Math.pow(E.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(E.y,2)-Math.pow(P,2)*Math.pow(E.x,2))/(Math.pow(w,2)*Math.pow(E.y,2)+Math.pow(P,2)*Math.pow(E.x,2)),M=(M!==O?1:-1)*N(T<0?0:T),N=w*E.y/P*M,T=-P*E.x/w*M,M=C(k)*N-L(k)*T+(b+S)/2,b=L(k)*N+C(k)*T+(x+_)/2,x=qe({x:1,y:0},S={x:(E.x-N)/w,y:(E.y-T)/P}),_=qe(S,{x:(-E.x-N)/w,y:(-E.y-T)/P}),!O&&0<_?_-=2*j:O&&_<0&&(_+=2*j),S=x+(_%=2*j)*A,N=w*C(S),E=P*L(S),{x:C(k)*N-L(k)*E+M,y:L(k)*N+C(k)*E+b})).x,d=T.y,B&&v.push({x:f,y:d}),D&&(p+=We(y,[f,d])),y=[f,d],h&&s<=p&&s>g[2]&&(O=(p-s)/(p-g[2]),m={x:y[0]*(1-O)+g[0]*O,y:y[1]*(1-O)+g[1]*O}),g=[f,d,p];return{length:p,point:m=h&&p<=s?{x:a,y:o}:m,min:{x:Math.min.apply(null,v.map(function(t){return t.x})),y:Math.min.apply(null,v.map(function(t){return t.y}))},max:{x:Math.max.apply(null,v.map(function(t){return t.x})),y:Math.max.apply(null,v.map(function(t){return t.y}))}}}function Xe(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,y=e,m=0,v=[g,y,m],b=[g,y],x={x:0,y:0},w=[{x:g,y:y}];p&&l<=0&&(x={x:g,y:y});for(var k,E,M,O,S,_,A,T,P,L,C=0;C<=d;C+=1)k=t,E=e,M=n,O=r,S=i,_=a,A=o,T=s,L=void 0,L=1-(P=C/d),g=(k={x:Math.pow(L,3)*k+3*Math.pow(L,2)*P*M+3*L*Math.pow(P,2)*S+Math.pow(P,3)*A,y:Math.pow(L,3)*E+3*Math.pow(L,2)*P*O+3*L*Math.pow(P,2)*_+Math.pow(P,3)*T}).x,y=k.y,h&&w.push({x:g,y:y}),f&&(m+=We(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(M=(m-l)/(m-v[2]),x={x:b[0]*(1-M)+v[0]*M,y:b[1]*(1-M)+v[1]*M}),v=[g,y,m];return{length:m,point:x=p&&m<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function $e(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,y=[d,p,g],m=[d,p],v={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(v={x:d,y:p});for(var x,w,k,E,M,O,S,_,A=0;A<=h;A+=1)x=t,w=e,k=n,E=r,M=i,O=a,_=void 0,_=1-(S=A/h),d=(x={x:Math.pow(_,2)*x+2*_*S*k+Math.pow(S,2)*M,y:Math.pow(_,2)*w+2*_*S*E+Math.pow(S,2)*O}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=We(m,[d,p])),m=[d,p],f&&o<=g&&o>y[2]&&(k=(g-o)/(g-y[2]),v={x:m[0]*(1-k)+y[0]*k,y:m[1]*(1-k)+y[1]*k}),y=[d,p,g];return{length:g,point:v=f&&g<=o?{x:i,y:a}:v,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ke(t,e,n){for(var r,i,a,o=Be(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,y={x:0,y:0},m=y,v=y,b=y,x=0,w=0,k=o.length;w<k;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(m=y={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=y)):"L"===i?(g=(r=Ye(l[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point):"A"===i?(g=(r=Ue(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"C"===i?(g=(r=Xe(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Q"===i?(g=(r=$e(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Z"===i&&(g=(r=Ye((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point),s&&x<e&&e<=x+g&&(b=v),p.push(m),d.push(y),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Ze(t){return(c=l=s=0)<=He(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function Je(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?Xe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=Ge(n,i,r),i=Ge(i,a,r),a=Ge(a,e,r),o=Ge(n,i,r),i=Ge(i,a,r),r=Ge(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Qe=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},tn=function(t){return"function"==typeof t},_=function(t){return null==t},en={}.toString,nn=function(t,e){return en.call(t)==="[object "+e+"]"},rn=function(t){return Array.isArray?Array.isArray(t):nn(t,"Array")},an=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};function on(t,e){if(t)if(rn(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(an(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var sn=function(t){return"object"==typeof t&&null!==t},ln=function(t){if(!sn(t)||!nn(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},cn=function(t){if(rn(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},un=function(t){if(rn(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},hn=function(t){return nn(t,"String")},fn=function(t,e,n){return t<e?e:n<t?n:t},dn=function(t){return nn(t,"Number")};var pn=function(t,e){return(t%e+e)%e},gn=Object.values?function(t){return Object.values(t)}:function(n){var r=[];return on(n,function(t,e){tn(n)&&"prototype"===e||r.push(t)}),r};var yn=function(t){return nn(t,"Boolean")},mn=function(t){return void 0===t},vn=function(t){return t instanceof Element||t instanceof HTMLDocument};function bn(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function xn(t,e,n,r){return e&&bn(t,e),n&&bn(t,n),r&&bn(t,r),t}function wn(t){if("object"!=typeof t||null===t)return t;if(rn(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=wn(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=wn(t[i]):e[i]=t[i];return e}var kn=wn;function En(a,o){var s;if(tn(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map,s;throw new TypeError("Expected a function")}var Mn=5;function On(t,e){if(t===e)return!0;if(t&&e&&!hn(t)&&!hn(e)){if(Qe(t)||Qe(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=On(t[r],e[r]));r++);return n}if(sn(t)||sn(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=On(t[i[r]],e[i[r]]));r++);return n}}return!1}function Sn(t,e,n){for(var r=0,i=hn(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t}function _n(e,t){var n;return null!==e&&ln(e)?(n={},on(t,function(t){Ln.call(e,t)&&(n[t]=e[t])}),n):{}}function An(){}var Tn=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||Mn,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&ln(o)?(ln(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):rn(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},Pn=On,Ln=Object.prototype.hasOwnProperty;function Cn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function Nn(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function jn(){}var e="\\s*([+-]?\\d+)\\s*",n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rn=/^#([0-9a-f]{3,8})$/,Fn=new RegExp("^rgb\\("+[e,e,e]+"\\)$"),In=new RegExp("^rgb\\("+[r,r,r]+"\\)$"),Bn=new RegExp("^rgba\\("+[e,e,e,n]+"\\)$"),Dn=new RegExp("^rgba\\("+[r,r,r,n]+"\\)$"),zn=new RegExp("^hsl\\("+[n,r,r]+"\\)$"),Gn=new RegExp("^hsla\\("+[n,r,r,n]+"\\)$"),Wn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Yn(){return this.rgb().formatHex()}function Vn(){return this.rgb().formatRgb()}function Hn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Rn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?qn(e):3===n?new Xn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Un(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Un(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Fn.exec(t))?new Xn(e[1],e[2],e[3],1):(e=In.exec(t))?new Xn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Bn.exec(t))?Un(e[1],e[2],e[3],e[4]):(e=Dn.exec(t))?Un(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=zn.exec(t))?Jn(e[1],e[2]/100,e[3]/100,1):(e=Gn.exec(t))?Jn(e[1],e[2]/100,e[3]/100,e[4]):Wn.hasOwnProperty(t)?qn(Wn[t]):"transparent"===t?new Xn(NaN,NaN,NaN,0):null}function qn(t){return new Xn(t>>16&255,t>>8&255,255&t,1)}function Un(t,e,n,r){return new Xn(t=r<=0?e=n=NaN:t,e,n,r)}function Xn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function $n(){return"#"+Zn(this.r)+Zn(this.g)+Zn(this.b)}function Kn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Zn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Jn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new tr(t,e,n,r)}function Qn(t){var e,n,r,i,a,o,s,l;return t instanceof tr?new tr(t.h,t.s,t.l,t.opacity):(t=t instanceof jn?t:Hn(t))?t instanceof tr?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new tr(o,s,l,t.opacity)):new tr}function tr(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function er(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function nr(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function rr(t,e){return Math.abs(t-e)<.001}function ir(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function ar(t){return(t+2*Math.PI)%(2*Math.PI)}Cn(jn,Hn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Yn,formatHex:Yn,formatHsl:function(){return Qn(this).formatHsl()},formatRgb:Vn,toString:Vn}),Cn(Xn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof jn?i:Hn(i))?new Xn((i=i.rgb()).r,i.g,i.b,i.opacity):new Xn:new Xn(t,e,n,null==r?1:r);var i},Nn(jn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Xn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Xn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:$n,formatHex:$n,formatRgb:Kn,toString:Kn})),Cn(tr,function(t,e,n,r){return 1===arguments.length?Qn(t):new tr(t,e,n,null==r?1:r)},Nn(jn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new tr(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new tr(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new Xn(er(240<=t?t-240:120+t,n,e),er(t,n,e),er(t<120?240+t:t-120,n,e),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var or={box:function(t,e,n,r){return ir([t,n],[e,r])},length:nr,pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return o<0?nr(t,e,i,a):(n-t)*(n-t)+(r-e)*(r-e)<o?nr(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){n=[n-t,r-e];return xe(n,[0,0])?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(ve(r=[-n[1],n[0]],r),Math.abs(be([i-t,a-e],r)))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function sr(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=nr(l[0],l[1],p[0],p[1]);p<s&&(o=d,s=p)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(var s=1/0,g=0;g<32&&!(h<1e-4);g++){var y=o-h,m=o+h,v=[i.apply(void 0,t.concat([y])),i.apply(void 0,e.concat([y]))],v=nr(l[0],l[1],v[0],v[1]);0<=y&&v<s?(o=y,s=v):(y=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],v=nr(l[0],l[1],y[0],y[1]),m<=1&&v<s?(o=m,s=v):h*=.5)}return{x:i.apply(void 0,t.concat([o])),y:i.apply(void 0,e.concat([o]))}}function lr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function cr(t,e,n){n=t+n-2*e;return rr(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function ur(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function hr(t,e,n,r,i,a,o){var s=lr(t,n,i,o),l=lr(e,r,a,o),c=or.pointAt(t,e,n,r,o),n=or.pointAt(n,r,i,a,o);return[[t,e,c.x,c.y,s,l],[s,l,n.x,n.y,i,a]]}function fr(t,e,n,r,i,a,o){return 0===o?(nr(t,e,n,r)+nr(n,r,i,a)+nr(t,e,i,a))/2:(e=(t=hr(t,e,n,r,i,a,.5))[0],n=t[1],e.push(o-1),n.push(o-1),fr.apply(void 0,e)+fr.apply(void 0,n))}var dr={box:function(t,e,n,r,i,a){var o=cr(t,n,i)[0],s=cr(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push(lr(t,n,i,o)),void 0!==s&&c.push(lr(e,r,a,s)),ir(l,c)},length:function(t,e,n,r,i,a){return fr(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,a,o,s){return sr([t,n,i],[e,r,a],o,s,lr)},pointDistance:function(t,e,n,r,i,a,o,s){t=this.nearestPoint(t,e,n,r,i,a,o,s);return nr(t.x,t.y,o,s)},interpolationAt:lr,pointAt:function(t,e,n,r,i,a,o){return{x:lr(t,n,i,o),y:lr(e,r,a,o)}},divide:hr,tangentAngle:function(t,e,n,r,i,a,o){t=ur(t,n,i,o),n=ur(e,r,a,o);return ar(Math.atan2(n,t))}};function pr(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function gr(t,e,n,r,i){var a=1-i;return 3*(a*a*(e-t)+2*a*i*(n-e)+i*i*(r-n))}function yr(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return rr(r,0)?rr(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):rr(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function mr(t,e,n,r,i,a,o,s,l){var c=pr(t,n,i,o,l),u=pr(e,r,a,s,l),h=or.pointAt(t,e,n,r,l),n=or.pointAt(n,r,i,a,l),r=or.pointAt(i,a,o,s,l),i=or.pointAt(h.x,h.y,n.x,n.y,l),a=or.pointAt(n.x,n.y,r.x,r.y,l);return[[t,e,h.x,h.y,i.x,i.y,c,u],[c,u,a.x,a.y,r.x,r.y,o,s]]}function vr(t,e,n,r,i,a,o,s,l){if(0===l){for(var c=[t,n,i,o],u=[e,r,a,s],h=0,f=c.length,d=0;d<f;d++)h+=nr(c[d],u[d],c[(d+1)%f],u[(d+1)%f]);return h/2}t=mr(t,e,n,r,i,a,o,s,.5),e=[].concat(t[0],[l-1]),n=[].concat(t[1],[l-1]);return vr.apply(void 0,e)+vr.apply(void 0,n)}var br={extrema:yr,box:function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=yr(t,n,i,o),h=yr(e,r,a,s),f=0;f<u.length;f++)l.push(pr(t,n,i,o,u[f]));for(var d=0;d<h.length;d++)c.push(pr(e,r,a,s,h[d]));return ir(l,c)},length:function(t,e,n,r,i,a,o,s){return vr(t,e,n,r,i,a,o,s,3)},nearestPoint:function(t,e,n,r,i,a,o,s,l,c,u){return sr([t,n,i,o],[e,r,a,s],l,c,pr,u)},pointDistance:function(t,e,n,r,i,a,o,s,l,c,u){t=this.nearestPoint(t,e,n,r,i,a,o,s,l,c,u);return nr(t.x,t.y,l,c)},interpolationAt:pr,pointAt:function(t,e,n,r,i,a,o,s,l){return{x:pr(t,n,i,o,l),y:pr(e,r,a,s,l)}},divide:mr,tangentAngle:function(t,e,n,r,i,a,o,s,l){t=gr(t,n,i,o,l),n=gr(e,r,a,s,l);return ar(Math.atan2(n,t))}};function xr(t,e){t=Math.abs(t);return 0<e?t:-1*t}var wr=function(t,e,n,r,i,a){var o=n,s=r;if(0===o||0===s)return{x:t,y:e};for(var n=i-t,r=a-e,l=Math.abs(n),c=Math.abs(r),u=o*o,h=s*s,f=Math.PI/4,d=0,p=0,g=0;g<4;g++){var d=o*Math.cos(f),p=s*Math.sin(f),y=(u-h)*Math.pow(Math.cos(f),3)/o,m=(h-u)*Math.pow(Math.sin(f),3)/s,v=d-y,b=p-m,y=l-y,m=c-m,x=Math.hypot(b,v),w=Math.hypot(m,y);f+=x*Math.asin((v*m-b*y)/(x*w))/Math.sqrt(u+h-d*d-p*p),f=Math.min(Math.PI/2,Math.max(0,f))}return{x:t+xr(d,n),y:e+xr(p,r)}};function kr(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function Er(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Mr(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function Or(t,e,n){var r=Math.cos(n),n=Math.sin(n);return[t*r-e*n,t*n+e*r]}var Sr={box:function(t,e,n,r,i,a,o){for(var s=Math.atan(-r/n*Math.tan(i)),l=1/0,c=-1/0,u=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d=0;d<u.length;d++){var p=kr(t,0,n,r,i,u[d]);p<l&&(l=p),c<p&&(c=p)}for(var g=Math.atan(r/(n*Math.tan(i))),y=1/0,m=-1/0,v=[a,o],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;a<o?a<x&&x<o&&v.push(x):o<x&&x<a&&v.push(x)}for(var w=0;w<v.length;w++){var k=Er(0,e,n,r,i,v[w]);k<y&&(y=k),m<k&&(m=k)}return{x:l,y:y,width:c-l,height:m-y}},length:function(t,e,n,r,i,a,o){},nearestPoint:function(t,e,n,r,i,a,o,s,l){var s=Or(s-t,l-e,-i),l=s[0],s=s[1],l=wr(0,0,n,r,l,s),c=(s=l.x,c=l.y,(Math.atan2(c*n,s*r)+2*Math.PI)%(2*Math.PI)),s=(c<a?l=Mr(n,r,a):o<c&&(l=Mr(n,r,o)),Or(l.x,l.y,i));return{x:s[0]+t,y:s[1]+e}},pointDistance:function(t,e,n,r,i,a,o,s,l){t=this.nearestPoint(t,e,n,r,i,a,o,s,l);return nr(t.x,t.y,s,l)},pointAt:function(t,e,n,r,i,a,o,s){o=(o-a)*s+a;return{x:kr(t,0,n,r,i,o),y:Er(0,e,n,r,i,o)}},tangentAngle:function(t,e,n,r,i,a,o,s){var l,o=(o-a)*s+a,s=(s=r,a=i,l=o,-1*n*Math.cos(a)*Math.sin(l)-s*Math.sin(a)*Math.cos(l)),i=(a=r,l=i,r=o,-1*n*Math.sin(l)*Math.sin(r)+a*Math.cos(l)*Math.cos(r));return ar(Math.atan2(i,s))}};function _r(t){for(var e=0,n=[],r=0;r<t.length-1;r++){var i=t[r],a=t[r+1],o=nr(i[0],i[1],a[0],a[1]);n.push({from:i,to:a,length:o}),e+=o}return{segments:n,totalLength:e}}var Ar,Tr,Pr={box:function(t){for(var e=[],n=[],r=0;r<t.length;r++){var i=t[r];e.push(i[0]),n.push(i[1])}return ir(e,n)},length:function(t){var e=t;if(e.length<2)return 0;for(var n=0,r=0;r<e.length-1;r++){var i=e[r],a=e[r+1];n+=nr(i[0],i[1],a[0],a[1])}return n},pointAt:function(t,e){var n=e;if(1<n||n<0||t.length<2)return null;var e=_r(t),r=e.segments,i=e.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var a=0,o=null,s=0;s<r.length;s++){var l=r[s],c=l.from,u=l.to,l=l.length/i;if(a<=n&&n<=a+l){o=or.pointAt(c[0],c[1],u[0],u[1],(n-a)/l);break}a+=l}return o},pointDistance:function(t,e,n){for(var r=t,i=e,a=n,o=1/0,s=0;s<r.length-1;s++){var l=r[s],c=r[s+1],l=or.pointDistance(l[0],l[1],c[0],c[1],i,a);l<o&&(o=l)}return o},tangentAngle:function(t,e){var n=e;if(1<n||n<0||t.length<2)return 0;for(var r=(t=_r(t)).segments,i=t.totalLength,a=0,o=0,s=0;s<r.length;s++){var l=r[s],c=l.from,u=l.to,l=l.length/i;if(a<=n&&n<=a+l){o=Math.atan2(u[1]-c[1],u[0]-c[0]);break}a+=l}return o}},e={exports:{}};function Lr(){}function Cr(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function Nr(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new Cr(n,r||t,i),r=Tr?Tr+e:e;return t._events[r]?t._events[r].fn?t._events[r]=[t._events[r],n]:t._events[r].push(n):(t._events[r]=n,t._eventsCount++),t}function jr(t,e){0==--t._eventsCount?t._events=new Lr:delete t._events[e]}function Rr(){this._events=new Lr,this._eventsCount=0}r=e,Ar=Object.prototype.hasOwnProperty,Tr="~",Object.create&&(Lr.prototype=Object.create(null),(new Lr).__proto__||(Tr=!1)),Rr.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)Ar.call(t,e)&&n.push(Tr?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},Rr.prototype.listeners=function(t){var t=Tr?Tr+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=e[n].fn;return i},Rr.prototype.listenerCount=function(t){t=Tr?Tr+t:t,t=this._events[t];return t?t.fn?1:t.length:0},Rr.prototype.emit=function(t,e,n,r,i,a){var o=Tr?Tr+t:t;if(!this._events[o])return!1;var s,l=this._events[o],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,a),!0}for(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].context,e,n,r);break;default:if(!s)for(u=1,s=new Array(c-1);u<c;u++)s[u-1]=arguments[u];l[f].fn.apply(l[f].context,s)}return!0},Rr.prototype.on=function(t,e,n){return Nr(this,t,e,n,!1)},Rr.prototype.once=function(t,e,n){return Nr(this,t,e,n,!0)},Rr.prototype.removeListener=function(t,e,n,r){t=Tr?Tr+t:t;if(this._events[t])if(e){var i=this._events[t];if(i.fn)i.fn!==e||r&&!i.once||n&&i.context!==n||jr(this,t);else{for(var a=0,o=[],s=i.length;a<s;a++)(i[a].fn!==e||r&&!i[a].once||n&&i[a].context!==n)&&o.push(i[a]);o.length?this._events[t]=1===o.length?o[0]:o:jr(this,t)}}else jr(this,t);return this},Rr.prototype.removeAllListeners=function(t){return t?(t=Tr?Tr+t:t,this._events[t]&&jr(this,t)):(this._events=new Lr,this._eventsCount=0),this},Rr.prototype.off=Rr.prototype.removeListener,Rr.prototype.addListener=Rr.prototype.on,Rr.prefixed=Tr,r.exports=Rr.EventEmitter=Rr;var i,Fr,E,Ir=e.exports,Br=((n=i=i||{}).COORDINATE="<coordinate>",n.COLOR="<color>",n.PAINT="<paint>",n.NUMBER="<number>",n.ANGLE="<angle>",n.OPACITY_VALUE="<opacity-value>",n.SHADOW_BLUR="<shadow-blur>",n.LENGTH="<length>",n.PERCENTAGE="<percentage>",n.LENGTH_PERCENTAGE="<length> | <percentage>",n.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",n.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",n.LIST_OF_POINTS="<list-of-points>",n.PATH="<path>",n.FILTER="<filter>",n.Z_INDEX="<z-index>",n.OFFSET_DISTANCE="<offset-distance>",n.DEFINED_PATH="<defined-path>",n.MARKER="<marker>",n.TRANSFORM="<transform>",n.TRANSFORM_ORIGIN="<transform-origin>",n.TEXT="<text>",n.TEXT_TRANSFORM="<text-transform>",function(){function y(t,e){void 0===t&&(t=[0,0,0]),void 0===e&&(e=[0,0,0]),this.center=m(),this.halfExtents=m(),this.min=m(),this.max=m(),this.update(t,e)}y.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var t=y.prototype;return t.update=function(t,e){zt(this.center,t),zt(this.halfExtents,e),Jt(this.min,this.center,this.halfExtents),Wt(this.max,this.center,this.halfExtents)},t.setMinMax=function(t,e){Wt(this.center,e,t),Vt(this.center,this.center,.5),Jt(this.halfExtents,e,t),Vt(this.halfExtents,this.halfExtents,.5),zt(this.min,t),zt(this.max,e)},t.getMin=function(){return this.min},t.getMax=function(){return this.max},t.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;y.isEmpty(t)||(y.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f:o)),e[1]=.5*(s+d),e[2]=.5*(u+p),r[0]=.5*(o-a),r[1]=.5*(d-s),r[2]=.5*(p-u),this.min[0]=a,this.min[1]=s,this.min[2]=u,this.max[0]=o,this.max[1]=d,this.max[2]=p))},t.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,t=t.halfExtents,a=e[0],o=e[4],s=e[8],l=e[1],c=e[5],u=e[9],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),y=Math.abs(s),m=Math.abs(l),v=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),k=Math.abs(d);Gt(n,e[12]+a*i[0]+o*i[1]+s*i[2],e[13]+l*i[0]+c*i[1]+u*i[2],e[14]+h*i[0]+f*i[1]+d*i[2]),Gt(r,p*t[0]+g*t[1]+y*t[2],m*t[0]+v*t[1]+b*t[2],x*t[0]+w*t[1]+k*t[2]),this.min=Jt(this.min,n,r),this.max=Wt(this.max,n,r)},t.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),t=t.getMin();return n[0]<=r[0]&&e[0]>=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},t.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new y,i=m(),n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=m(),i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},t.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])},t.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?zt(m(),this.min):272===t.pnVertexFlag?k(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?k(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?k(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?k(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?k(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?k(this.max[0],this.max[1],this.min[2]):k(this.max[0],this.max[1],this.max[2])},t.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?zt(m(),this.max):272===t.pnVertexFlag?k(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?k(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?k(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?k(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?k(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?k(this.min[0],this.min[1],this.max[2]):k(this.min[0],this.min[1],this.min[2])},y}()),Dr=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||k(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},e.distanceToPoint=function(t){return qt(t,this.normal)-this.distance},e.normalize=function(){var t=1/te(this.normal);Vt(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),r=r/(r-this.distanceToPoint(e)),i=0<=r&&r<=1;return i&&n&&Xt(n,t,e,r),i},t}(),zr=((r=Fr=Fr||{})[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE",function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Dr)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];Gt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,Gt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,Gt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,Gt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,Gt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,Gt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})},t}()),Gr=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Wr=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}();function Yr(o,s){if("function"!=typeof o||null!=s&&"function"!=typeof s)throw new TypeError("Expected a function");function l(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=s?s.apply(this,e):e[0],a=l.cache;return a.has(i)?a.get(i):(r=o.apply(this,e),l.cache=a.set(i,r)||a,r)}return l.cache=new(Yr.Cache||Map),l}(e=E=E||{}).GROUP="g",e.CIRCLE="circle",e.ELLIPSE="ellipse",e.IMAGE="image",e.RECT="rect",e.LINE="line",e.POLYLINE="polyline",e.POLYGON="polygon",e.TEXT="text",e.PATH="path",e.HTML="html",e.MESH="mesh",Yr.Cache=Map;var Vr=Yr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function Hr(t){if(!t)throw new Error}function qr(t,e){if(t===e)throw new Error}function Ur(t){return"function"==typeof t}var Xr={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},$r=Yr(function(t){var t=Vr(t),e=Xr[t];return(null==e?void 0:e.alias)||t}),Kr={},Zr=0;var Jr="undefined"!=typeof window&&void 0!==window.document;function Qr(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function ti(t){var e,n=t;do{if(null==(e=n.style)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function ei(t,e){if(Jr)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var g,ni,ri,ii,ai="Method not implemented.",oi="Use document.documentElement instead.",si={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function M(){M=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function li(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function ci(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){li(r,e,n,i,a,"next",t)}function a(t){li(r,e,n,i,a,"throw",t)}i(void 0)})}}function ui(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(r.key),r)}}function hi(t,e,n){e&&ui(t.prototype,e),n&&ui(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function fi(){return(fi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){t.prototype=Object.create(e.prototype),di(t.prototype.constructor=t,e)}function di(t,e){return(di=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function pi(t,e){if(null==t)return{};for(var n,r={},i=Object.keys(t),a=0;a<i.length;a++)n=i[a],0<=e.indexOf(n)||(r[n]=t[n]);return r}function gi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function yi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mi(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?yi(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yi(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n=g=g||{})[n.kUnknown=0]="kUnknown",n[n.kNumber=1]="kNumber",n[n.kPercentage=2]="kPercentage",n[n.kEms=3]="kEms",n[n.kPixels=4]="kPixels",n[n.kRems=5]="kRems",n[n.kDegrees=6]="kDegrees",n[n.kRadians=7]="kRadians",n[n.kGradians=8]="kGradians",n[n.kTurns=9]="kTurns",n[n.kMilliseconds=10]="kMilliseconds",n[n.kSeconds=11]="kSeconds",n[n.kInteger=12]="kInteger",(r=ni=ni||{})[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",(e=ri=ri||{})[e.kYes=0]="kYes",e[e.kNo=1]="kNo",(n=ii=ii||{})[n.kYes=0]="kYes",n[n.kNo=1]="kNo";function vi(t){return t?"number"===t?g.kNumber:"percent"===t||"%"===t?g.kPercentage:(e=t,Oi.find(function(t){return t.name===e}).unit_type):g.kUnknown;var e}function bi(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function xi(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var wi,ki,Ei,Mi,Oi=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],e=((r=wi=wi||{})[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",function(){function t(){}t.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},t.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},t.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},t.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds};var e=t.prototype;return e.toString=function(){return this.buildCSSText(ri.kNo,ii.kNo,"")},e.isNumericValue=function(){return this.getType()>=wi.kUnitType&&this.getType()<=wi.kClampType},t}()),n=function(n){function t(t){var e=n.call(this)||this;return e.colorSpace=void 0,e.colorSpace=t,e}s(t,n);var e=t.prototype;return e.getType=function(){return wi.kColorType},e.to=function(t){return this},t}(e),Si=((r=ki=ki||{})[r.Constant=0]="Constant",r[r.LinearGradient=1]="LinearGradient",r[r.RadialGradient=2]="RadialGradient",function(r){function t(t,e){var n=r.call(this)||this;return n.type=void 0,n.value=void 0,n.type=t,n.value=e,n}s(t,r);var e=t.prototype;return e.clone=function(){return new t(this.type,this.value)},e.buildCSSText=function(t,e,n){return n},e.getType=function(){return wi.kColorType},t}(e)),_i=function(n){function t(t){var e=n.call(this)||this;return e.value=void 0,e.value=t,e}s(t,n);var e=t.prototype;return e.clone=function(){return new t(this.value)},e.getType=function(){return wi.kKeywordType},e.buildCSSText=function(t,e,n){return n+this.value},t}(e);(r=Ei=Ei||{}).kAdd="+",r.kSubtract="-",r.kMultiply="*",r.kDivide="/",r.kMin="min",r.kMax="max",r.kClamp="clamp",r.kInvalid="",(r=Mi=Mi||{})[r.kLength=0]="kLength",r[r.kAngle=1]="kAngle",r[r.kTime=2]="kTime",r[r.kFrequency=3]="kFrequency",r[r.kResolution=4]="kResolution",r[r.kFlex=5]="kFlex",r[r.kPercent=6]="kPercent",r[r.kNumBaseTypes=7]="kNumBaseTypes";function Ai(t){return"number"==typeof t?new Fi(t,g.kNumber):t}var Ti=function(){function t(t,e){void 0===t&&(t=g.kNumber),void 0===e&&(e=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=Mi.kPercent,this.hasPercentHint=!1,this.exponents=new Array(Mi.kNumBaseTypes).fill(0),t!==g.kNumber&&this.setExponent(function(t){switch(qr(t,g.kNumber),t){case g.kEms:case g.kPixels:case g.kRems:return Mi.kLength;case g.kMilliseconds:case g.kSeconds:return Mi.kTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return Mi.kAngle;case g.kPercentage:return Mi.kPercent;default:return Mi.kLength}}(t),e)}var e=t.prototype;return e.applyPercentHint=function(t){qr(t,Mi.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(Mi.kPercent)),this.setExponent(Mi.kPercent,0),this.percentHint=t,this.hasPercentHint=!0},e.hasNonZeroEntries=function(){return 0<this.numNonZeroEntries},e.isOnlyNonZeroEntry=function(t,e){return qr(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},e.exponent=function(t){return this.exponents[t]},e.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},t.negateExponents=function(t){return t.exponents.forEach(function(t){return-1*t}),t},e.matchesBaseType=function(t){return qr(t,Mi.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint},e.matchesPercentage=function(){return this.isOnlyNonZeroEntry(Mi.kPercent,1)},e.matchesBaseTypePercentage=function(t){return qr(t,Mi.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(Mi.kPercent,1)},e.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},e.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(Mi.kPercent,1)},t.add=function(t,e,n){if(!t.hasPercentHint||!e.hasPercentHint||t.percentHint==e.percentHint){t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);var r=t.percentHint,i=e.percentHint;if(r!==i)throw new Error;for(var a=0;a<Mi.kNumBaseTypes;++a){var o=a;if(t.exponents[a]!==e.exponents[a]&&(o!==Mi.kPercent&&(t.applyPercentHint(o),e.applyPercentHint(o)),t.exponents[a]!==e.exponents[a]))return t}}return t},t.multiply=function(t,e,n){if(!t.hasPercentHint||!e.hasPercentHint||t.percentHint==e.percentHint){t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;r<Mi.kNumBaseTypes;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}}return t},t}(),r=function(n){function d(t){var e=n.call(this)||this;return e.type_=void 0,e.type_=t,e}s(d,n);var t=d.prototype;return t.getType=function(){return wi.kUnknownType},t.equals=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Pi(n).every(function(t){return e.equals(t)})},t.add=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Pi(e),i=(Li(wi.kSumType,r,this),Ni(r,Ei.kAdd));return i||Yi.create(r)},t.sub=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=(r=Pi(e)).map(function(t){return t.negate()}),i=(Li(wi.kSumType,r,this),Ni(r,Ei.kAdd));return i||Yi.create(r)},t.mul=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Pi(e),i=(Li(wi.kProductType,r,this),ji(r));return i||Vi.create(r)},t.div=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=(r=Pi(e)).map(function(t){return t.invert()}),i=(Li(wi.kProductType,r,this),ji(r));return i||Vi.create(r)},t.min=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Pi(e),i=(Li(wi.kMinType,r,this),Ni(r,Ei.kMin));return i||Gi.create(r)},t.max=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Pi(e),i=(Li(wi.kMaxType,r,this),Ni(r,Ei.kMax));return i||Wi.create(r)},t.to=function(t){var e=this.sumValue();return 0!==e.length&&1===e.length&&(e=Ci(e[0]))?(t="string"==typeof t?vi(t):t,e.convertTo(t)):null},t.toSum=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!d.isValidUnit(vi(a)))return null}var o=this.sumValue();if(!o.length)return null;for(var s=[],l=mi(o);!(c=l()).done;){var c=Ci(c.value);if(!c)return null;s.push(c)}if(0===e.length)return s.sort(function(t,e){return t.unit-e.unit}),Hr(!!(o=Yi.create(s))),o;for(var u=[],h=0,f=e;h<f.length;h++)!function(){var t=f[h],r=vi(t),t=(Hr(d.isValidUnit(r)),s.reduce(function(t,e,n){return e&&(e=e.convertTo(r))&&(t+=e.value,s[n]=null),t},0));u.push(new Fi(t,r))}();if(s.some(function(t){return!!t}))throw new Error("There were leftover terms that were not converted");return Yi.create(u)},t.type=function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(Mi.kLength);return e&&(t.length=e),(e=this.type_.exponent(Mi.kAngle))&&(t.angle=e),(e=this.type_.exponent(Mi.kTime))&&(t.time=e),(e=this.type_.exponent(Mi.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(Mi.kResolution))&&(t.resolution=e),(e=this.type_.exponent(Mi.kFlex))&&(t.flex=e),(e=this.type_.exponent(Mi.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case Mi.kLength:return"length";case Mi.kAngle:return"angle";case Mi.kTime:return"time";case Mi.kFrequency:return"frequency";case Mi.kResolution:return"resolution";case Mi.kFlex:return"flex";case Mi.kPercent:return"percent"}return""}(this.type_.percentHint)),t},d.isValidUnit=function(t){return!!(t===g.kNumber||t==g.kPercentage||this.isLength(t)||this.isAngle(t)||this.isTime(t))},t.negate=function(){return Bi.create(this)},t.invert=function(){return Ii.create(this)},d}(e);function Pi(t){return t.map(Ai)}function Li(t,e,n){Hr(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function Ci(t){return 0===Object.keys(t.units).length?new Fi(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Fi(t.value,Number(Object.keys(t.units)[0])):null}function Ni(t,e){Hr(!!t.length);var n=t[0]instanceof Fi?t[0]:null;if(!n)return null;for(var r=n.value,i=1;i<t.length;i++){var a=t[i]instanceof Fi?t[i]:null;if(!a||a.unit!==n.unit)return null;e===Ei.kAdd?r+=a.value:e===Ei.kMax?r=Math.max(r,a.value):e===Ei.kMin&&(r=Math.min(r,a.value))}return new Fi(r,n.unit)}function ji(t){Hr(!!t.length);for(var e=g.kNumber,n=1,r=0;r<t.length;r++){var i=t[r]instanceof Fi?t[r]:null;if(!i)return null;if(i.unit!==g.kNumber){if(e!==g.kNumber)return null;e=i.unit}n*=i.value}return new Fi(n,e)}function Ri(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return ni.kUNumber;case g.kPercentage:return ni.kUPercent;case g.kPixels:return ni.kULength;case g.kMilliseconds:case g.kSeconds:return ni.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return ni.kUAngle;default:return ni.kUOther}}(t)){case ni.kUNumber:return g.kNumber;case ni.kULength:return g.kPixels;case ni.kUPercent:return g.kPercentage;case ni.kUTime:return g.kSeconds;case ni.kUAngle:return g.kDegrees;default:return g.kUnknown}}var Fi=function(r){function n(t,e){var n,e="string"==typeof(e=void 0===e?g.kNumber:e)?vi(e):e;return(n=r.call(this,new Ti(e))||this).unit=void 0,n.value=void 0,n.unit=e,n.value=t,n}s(n,r);var t=n.prototype;return t.clone=function(){return new n(this.value,this.unit)},t.convertTo=function(t){var e;return this.unit===t?new n(this.value,this.unit):(e=Ri(this.unit))!==Ri(t)||e===g.kUnknown?null:(e=bi(this.unit)/bi(t),new n(this.value*e,t))},t.equals=function(t){return this.value===t.value&&this.unit===t.unit},t.getType=function(){return wi.kUnitType},t.sumValue=function(){var t,e,n=[],r={};return this.unit!==g.kNumber&&(r[t=this.unit,(e=Ri(t))===g.kUnknown?t:e]=1),n.push({value:this.value*bi(this.unit),units:r}),n},t.negate=function(){return new n(-this.value,this.unit)},t.invert=function(){return this.unit===g.kNumber?0===this.value?null:new n(1/this.value,this.unit):Ii.create(this)},t.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=xi(this.unit);i=a<-999999||999999<a?(r=xi(this.unit),!Number.isFinite(a)||Number.isNaN(a)?function(t,e){void 0===e&&(e="");return(Number.isFinite(t)?(Hr(Number.isNaN(t)),"NaN"):0<t?"infinity":"-infinity")+e}(a,r):a+(r||"")):""+a+o}return n+=i},n}(r),e=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.isUnitValue=function(){return!1},e}(r),Ii=function(n){function e(t,e){e=n.call(this,e)||this;return e.value=void 0,e.operator="invert",e.value=t,e}s(e,n),e.create=function(t){return new e(t,Ti.negateExponents(t.type_))};var t=e.prototype;return t.clone=function(){return new e(this.value,this.type_)},t.getType=function(){return wi.kInvertType},t.equals=function(t){return t.getType()===wi.kInvertType&&this.value.equals(t.value)},t.sumValue=function(){var e=this.value.sumValue();return 0===e.length||1!==e.length||0===e[0].value?null:(Object.keys(e[0].units).forEach(function(t){e[0].units[t]*=-1}),e[0].value=1/e[0].value,e)},t.buildCSSText=function(t,e,n){return e==ii.kNo&&(n+=t===ri.kYes?"(":"calc("),n=this.value.buildCSSText(ri.kYes,ii.kNo,n+="1 / "),e===ii.kNo&&(n+=")"),n},e}(e),Bi=function(n){function e(t,e){e=n.call(this,e)||this;return e.value=void 0,e.operator="negate",e.value=t,e}s(e,n),e.create=function(t){return new e(t,t.type_)};var t=e.prototype;return t.clone=function(){return new e(this.value,this.type_)},t.getType=function(){return wi.kNegateType},t.equals=function(t){return t.getType()===wi.kNegateType&&this.value.equals(t.value)},t.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach(function(t){t.value*=-1}),t)},t.buildCSSText=function(t,e,n){return e==ii.kNo&&(n+=t===ri.kYes?"(":"calc("),n=this.value.buildCSSText(ri.kYes,ii.kNo,n+="-"),e===ii.kNo&&(n+=")"),n},e}(e);function Di(t,e){for(var n=t[0].type_,r=1;r<t.length;r++)n=e(n,t[r].type_,!1);return n}function zi(t){return Ki[t]||(Ki[t]=new _i(t)),Ki[t]}var r=function(n){function t(t,e){e=n.call(this,e)||this;return e.values=void 0,e.values=t,e}s(t,n);var e=t.prototype;return e.numericValues=function(){return this.values},e.equals=function(n){return this.getType()===n.getType()&&this.values.every(function(t,e){return t.equals(n.values[e])})},t}(e),Gi=function(i){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="min",t}s(e,i),e.create=function(t){return new e(t,Di(t,Ti.add))};var t=e.prototype;return t.clone=function(){return new e(this.values,this.type_)},t.getType=function(){return wi.kMinType},t.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e=mi(this.numericValues());!(n=e()).done;){var n=n.value.sumValue();if(!n.length||JSON.stringify(n[0].units)!==JSON.stringify(t[0].units))return null;n[0].value<t[0].value&&(t=n)}return t},t.buildCSSText=function(t,e,n){n+="min(";for(var r,i=!0,a=mi(this.numericValues());!(r=a()).done;)i||(n+=", "),i=!1,n=r.value.buildCSSText(ri.kYes,ii.kYes,n);return n+=")"},e}(r),Wi=function(i){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="max",t}s(e,i),e.create=function(t){return new e(t,Di(t,Ti.add))};var t=e.prototype;return t.clone=function(){return new e(this.values,this.type_)},t.getType=function(){return wi.kMaxType},t.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e=mi(this.numericValues());!(n=e()).done;){var n=n.value.sumValue();if(!n.length||JSON.stringify(n[0].units)!==JSON.stringify(t[0].units))return null;n[0].value<t[0].value&&(t=n)}return t},t.buildCSSText=function(t,e,n){n+="max(";for(var r,i=!0,a=mi(this.numericValues());!(r=a()).done;)i||(n+=", "),i=!1,n=r.value.buildCSSText(ri.kYes,ii.kYes,n);return n+=")"},e}(r),Yi=function(i){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="sum",t}s(e,i),e.create=function(t){return new e(t,Di(t,Ti.add))},e.numericTypeFromUnitMap=function(n){var r=new Ti;return Object.keys(n).forEach(function(t){var e=n[t];r=Ti.multiply(r,new Ti(Number(t),e),!1),Hr(!0)}),r},e.canCreateNumericTypeFromSumValue=function(t){var e=this,n=(Hr(!!t.length),this.numericTypeFromUnitMap(t[0].units));return t.every(function(t){return Ti.add(n,e.numericTypeFromUnitMap(t.units),!1),!0})};var t=e.prototype;return t.clone=function(){return new e(this.values,this.type_)},t.getType=function(){return wi.kSumType},t.sumValue=function(){var n=[];return this.numericValues().forEach(function(t){t=t.sumValue();if(!t.length)return null;t.forEach(function(e){var t=n.findIndex(function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)});-1===t?n.push(fi({},e)):n[t].value+=e.value})}),e.canCreateNumericTypeFromSumValue(n)?n:null},t.buildCSSText=function(t,e,n){e==ii.kNo&&(n+=t===ri.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(ri.kYes,ii.kNo,n);for(var i=1;i<r.length;i++){var a=r[i];n=(a.getType()===wi.kNegateType?(n+=" - ",a.value):(n+=" + ",a)).buildCSSText(ri.kYes,ii.kNo,n)}return e===ii.kNo&&(n+=")"),n},e}(r),Vi=function(i){function a(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="product",t}s(a,i),a.create=function(t){return new a(t,Di(t,Ti.multiply))},a.multiplyUnitMaps=function(n,r){return Object.keys(r).forEach(function(t){qr(r[t].value,0);var e=t in n?n[t].value:0;e+r[t].value===0?delete n[t]:n[t]=e+r[t].value}),n};var t=a.prototype;return t.clone=function(){return new a(this.values,this.type_)},t.getType=function(){return wi.kProductType},t.sumValue=function(){var e=[{value:1,units:{}}];return this.numericValues().forEach(function(t){var n=t.sumValue();if(!n.length)return null;var r=[];e.forEach(function(e){n.forEach(function(t){r.push({value:e.value*t.value,units:a.multiplyUnitMaps(e.units,t.units)})})}),e=r}),e},t.buildCSSText=function(t,e,n){e==ii.kNo&&(n+=t===ri.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(ri.kYes,ii.kNo,n);for(var i=1;i<r.length;i++){var a=r[i];n=(a.getType()===wi.kInvertType?(n+=" / ",a.value):(n+=" * ",a)).buildCSSText(ri.kYes,ii.kNo,n)}return e===ii.kNo&&(n+=")"),n},a}(r),Hi=new Fi(0,"px"),qi=(new Fi(1,"px"),new Fi(0,"deg")),Ui=function(o){function t(t,e,n,r,i){var a;return void 0===r&&(r=1),void 0===i&&(i=!1),(a=o.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}s(t,o);var e=t.prototype;return e.clone=function(){return new t(this.r,this.g,this.b,this.alpha)},e.buildCSSText=function(t,e,n){return n+("rgba("+this.r+","+this.g+","+this.b+","+this.alpha)+")"},t}(n),Xi=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;O.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},$i=new _i("unset"),e=new _i("initial"),r=new _i("inherit"),Ki={"":$i,unset:$i,initial:e,inherit:r},Zi=new Ui(0,0,0,0,!0),Ji=new Ui(0,0,0,0),Qi=Yr(function(t,e,n,r){return new Ui(t,e,n,r)},function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"}),ta=Yr(function(t,e){return void 0===e&&(e=g.kNumber),new Fi(t,e)},function(t,e){return""+t+(e=void 0===e?g.kNumber:e)}),ea=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,na=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ra=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ia=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var aa={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},oa=Yr(function(t){t="angular"===t.type?Number(t.value):aa[t.value]||0;return ta(t,"deg")}),sa=Yr(function(t){var e,n=50,r=50,i="%",a="%";return"position"===(null==t?void 0:t.type)&&(e=(t=t.value).x,t=t.y,"position-keyword"===(null==e?void 0:e.type)&&("left"===e.value?n=0:"center"===e.value?n=50:"right"===e.value?n=100:"top"===e.value?r=0:"bottom"===e.value&&(r=100)),"position-keyword"===(null==t?void 0:t.type)&&("left"===t.value?n=0:"center"===t.value?r=50:"right"===t.value?n=100:"top"===t.value?r=0:"bottom"===t.value&&(r=100)),"px"!==(null==e?void 0:e.type)&&"%"!==(null==e?void 0:e.type)&&"em"!==(null==e?void 0:e.type)||(i=null==e?void 0:e.type,n=Number(e.value)),"px"!==(null==t?void 0:t.type)&&"%"!==(null==t?void 0:t.type)&&"em"!==(null==t?void 0:t.type)||(a=null==t?void 0:t.type,r=Number(t.value))),{cx:ta(n,i),cy:ta(r,a)}}),la=Yr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return Ms(t).map(function(t){for(var e=t.type,n=t.orientation,t=t.colorStops,r=t,i=r.length,a=(r[i-1].length=null!=(f=r[i-1].length)?f:{type:"%",value:"100"},1<i&&(r[0].length=null!=(f=r[0].length)?f:{type:"%",value:"0"}),0),o=Number(r[0].length.value),s=1;s<i;s++){var l,c=null==(l=r[s].length)?void 0:l.value;if(!_(c)&&!_(o)){for(var u=1;u<s-a;u++)r[a+u].length={type:"%",value:""+(o+(Number(c)-o)*u/(s-a))};a=s,o=Number(c)}}var h,f=t.map(function(t){return{offset:ta(t.length.value,"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#"+t:"literal"===e?t:"rgb"===e?"rgb("+t.join(",")+")":"rgba("+t.join(",")+")")};var e});return"linear-gradient"===e?new Si(ki.LinearGradient,{angle:n?oa(n):qi,steps:f}):"radial-gradient"===e&&"shape"===(n=n||[{type:"shape",value:"circle"}])[0].type&&"circle"===n[0].value?(e=(t=sa(n[0].at)).cx,t=t.cy,n[0].style&&(h=(n=n[0].style).type,n=n.value,h="extent-keyword"===h?zi(n):ta(n,h)),new Si(ki.RadialGradient,{cx:e,cy:t,size:h,steps:f})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=ea.exec(t);if(n)return r=(null==(r=n[2].match(ia))?void 0:r.map(function(t){return t.split(":")}))||[],[new Si(ki.LinearGradient,{angle:ta(parseFloat(n[1]),"deg"),steps:r.map(function(t){var e=t[0],t=t[1];return{offset:ta(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=na.exec(t);if(t)return t=(null==(t=t[4].match(ia))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:ta(50,"%"),cy:ta(50,"%"),steps:t.map(function(t){var e=t[0],t=t[1];return{offset:ta(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!hn(n))return[new Si(ki.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ra.exec(r)){var i=r[1],r=r[2];switch(i){case"a":i="repeat";break;case"x":i="repeat-x";break;case"y":i="repeat-y";break;default:i="no-repeat"}return{image:r,repetition:i}}return null}});function ca(t){return an(t)&&t.image}function ua(t){return an(t)&&!_(t.r)&&!_(t.g)&&!_(t.b)}var ha=Yr(function(t){var e;return ca(t)?fi({repetition:"repeat"},t):"transparent"===(t=_(t)?"":t)?Ji:la(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=Hn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),Qi.apply(void 0,e))});function fa(t,e){if(ua(t)&&ua(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(fn(e[n],0,255));return e[3]=fn(e[3],0,1),"rgba("+e.join(",")+")"}]}function da(t,e){if(_(e))return ta(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return ta(Number(e),"px");if(0<="deg".search(t))return ta(Number(e),"deg")}var n=[],r=(e=e.replace(t,function(t){return n.push(t),"U"+t}),"U("+t.source+")");return n.map(function(t){return ta(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var pa=Yr(function(t){return da(new RegExp("px","g"),t)}),ga=(Yr(function(t){return da(new RegExp("%","g"),t)}),Yr(function(t){return dn(t)||isFinite(Number(t))?ta(Number(t),"px"):da(new RegExp("px|%|em|rem","g"),t)})),ya=Yr(function(t){return da(new RegExp("deg|rad|grad|turn","g"),t)});function ma(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=fs(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function va(t){return hn(t)?t.split(" ").map(function(t){return ga(t)}):t.map(function(t){return ga(t.toString())})}function ba(t,e,n){var r;return t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===E.GROUP?n.getLocalBounds():n.getGeometryBounds(),r=0,Br.isEmpty(n)||(r=2*n.halfExtents[e]),Number(t.value)/100*r):0}var xa=function(t){return da(/deg|rad|grad|turn|px|%/g,t)},wa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ka(t){if("none"!==(t=(t=void 0===t?"":t).toLowerCase().trim()))for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,-1<wa.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return xa(t)||ha(t)})}),n.lastIndex===t.length)return r}return[]}function Ea(t){return t.toString()}var Ma=Yr(function(t){return"number"==typeof t?ta(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ta(Number(t)):ta(0)});function Oa(t,e){return[t,e,Ea]}function Sa(n,r){return function(t,e){return[t,e,function(t){return Ea(fn(t,n,r))}]}}function _a(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}Yr(function(t){return(hn(t)?t.split(" "):t).map(Ma)});var Aa=function(e){if(""===e||Array.isArray(e)&&0===e.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var n;try{n=Be(e)}catch(t){n=Be(""),console.error("[g]: Invalid SVG Path definition: "+e)}var e=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),t=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}0<r.length&&n.push(r);return{polygons:e,polylines:n}}(n),r=t.polygons,t=t.polylines,i=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s],c=(r=t[s+1],l[0]),u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=s;break;case"A":var h=function(t,e){var n=e[1],r=e[2],i=pn(hs(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],e=e[7],u=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-e)/2,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=tl([1,0],p),h=tl(p,u);Qs(p,u)<=-1&&(h=Math.PI);1<=Qs(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:qs(t,[c,e])?0:n,ry:qs(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"Z"===c?(n=i,r=t[a+1]):(v=l.length,n=[l[v-2],l[v-1]]),r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&qs(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,y,m,v=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=v,u.prePoint);["L","H","V"].includes(c)?(u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]]):"Q"===c?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(d=Xs((f=e[s-1]).currentPoint,b),"Q"===f.command?(u.command="Q",u.startTangent=[b[0]-d[0],b[1]-d[1]],u.endTangent=[n[0]-d[0],n[1]-d[1]]):(u.command="TL",u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]])):"C"===c?(d=[l[1],l[2]],p=[l[3],l[4]],u.startTangent=[b[0]-d[0],b[1]-d[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[d[0]-p[0],d[1]-p[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[p[0]-d[0],p[1]-d[1]])):"S"===c?(g=Xs((p=e[s-1]).currentPoint,b),y=[l[1],l[2]],"C"===p.command?(u.command="C",u.startTangent=[b[0]-g[0],b[1]-g[1]]):(u.command="SQ",u.startTangent=[b[0]-y[0],b[1]-y[1]]),u.endTangent=[n[0]-y[0],n[1]-y[1]]):"A"===c&&(g=Zs(u,0),b=g.x,y=g.y,c=Zs(u,1,!1),m=c.x,c=c.y,u.startTangent=[b,y],u.endTangent=[m,c]),e.push(u)}return e}(n),a=function(t,e){for(var n=[],r=[],i=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,l=o.params,c=o.prePoint,u=void 0;switch(o.command){case"Q":u=dr.box(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=br.box(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=o.arcParams;u=Sr.box(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(o.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),r=r.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0});var f=un(n),d=un(r),p=cn(n),g=cn(r);if(0!==i.length)for(var y=0;y<i.length;y++){var m=i[y],v=m.currentPoint,b=void 0;v[0]===f?(b=Us(m,e),f-=b.xExtra):v[0]===p&&(b=Us(m,e),p+=b.xExtra),v[1]===d?(b=Us(m,e),d-=b.yExtra):v[1]===g&&(b=Us(m,e),g+=b.yExtra)}return{x:f,y:d,width:p-f,height:g-d}}(i,0),o=a.x,s=a.y,l=a.width,a=a.height;return{absolutePath:n,hasArc:e,segments:i,polygons:r,polylines:t,totalLength:0,rect:{x:Number.isFinite(o)?o:0,y:Number.isFinite(s)?s:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(a)?a:0}}},Ta=Yr(Aa);function Pa(t,e){t=(hn(t)?Ta:Aa)(t);return e&&(e.parsedStyle.defX=t.rect.x,e.parsedStyle.defY=t.rect.y),t}function La(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=He(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=He(e.absolutePath,!1),e.curve=d),[f,d]),f=Ze((t=f.length!==d.length?function t(e,n,r){var i,e=Je(e),n=Je(n),a=e.length,o=n.length,s=e.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).length,s=e.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,c=r||Math.max(a,o),u=[s,l],h=[c-a,c-o],r=[e,n].map(function(t,n){return t.l===c?t.map(function(t){return t.s}):t.map(function(t,e){return i=e&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Ze(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):ke(t[0]);return[f,(i=t[1],a=f,c=i.length-1,u=[],h=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){h+=We(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Ca(t,e){var n,r,i=hn(t)?t.split(" ").map(function(t){var t=t.split(","),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=Pr.length(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=or.length(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,i.map(function(t){return t[0]}))),l=Math.min.apply(Math,i.map(function(t){return t[1]}));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}var Na=null;function ja(t){return function(e){var n=0;return t.map(function(t){return t===Na?e[n++]:t})}}function Ra(t){return t}var Fa={matrix:["NNNNNN",[Na,Na,0,0,Na,Na,0,0,0,0,1,0,Na,Na,0,1],Ra],matrix3d:["NNNNNNNNNNNNNNNN",Ra],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ja([Na,Na,new Fi(1)]),Ra],scalex:["N",ja([Na,new Fi(1),new Fi(1)]),ja([Na,new Fi(1)])],scaley:["N",ja([new Fi(1),Na,new Fi(1)]),ja([new Fi(1),Na])],scalez:["N",ja([new Fi(1),new Fi(1),Na])],scale3d:["NNN",Ra],skew:["Aa",null,Ra],skewx:["A",null,ja([Na,qi])],skewy:["A",null,ja([qi,Na])],translate:["Tt",ja([Na,Na,Hi]),Ra],translatex:["T",ja([Na,Hi,Hi]),ja([Na,Hi])],translatey:["T",ja([Hi,Na,Hi]),ja([Hi,Na])],translatez:["L",ja([Hi,Hi,Na])],translate3d:["TTL",Ra]};function Ia(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=Fa[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?qi:ya(t)},N:Ma,T:ga,L:pa}[f.toUpperCase()](h):{a:qi,n:c[0],t:Hi}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function Ba(t){switch(t.t){case"rotatex":return i=hs(ma(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=hs(ma(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=hs(ma(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":var e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=hs(ma(t.d[3])),a=e*e+n*n+r*r,a=(0==a?(e=1,r=n=0):1!=a&&(e/=a=Math.sqrt(a),n/=a,r/=a),Math.sin(i/2)),o=a*Math.cos(i/2),a=a*a;return[1-2*(n*n+r*r)*a,2*(e*n*a+r*o),2*(e*r*a-n*o),0,2*(e*n*a-r*o),1-2*(e*e+r*r)*a,2*(n*r*a+e*o),0,2*(e*r*a+n*o),2*(n*r*a-e*o),1-2*(e*e+n*n)*a,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":o=hs(ma(t.d[0])),a=hs(ma(t.d[1]));return[1,Math.tan(a),0,0,Math.tan(o),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=hs(ma(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=hs(ma(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ba(t.d[0],0,null)||0,n=ba(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ba(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=ba(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=ba(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ba(t.d[0],0,null)||0,n=ba(t.d[1],0,null)||0,r=ba(t.d[2],0,null)||0,1];case"perspective":a=ba(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,a?-1/a:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(t){return t.value})}}function Da(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function za(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return 1}(gs,t))return;if(dt(ys,gs),ys[3]=0,ys[7]=0,ys[11]=0,ys[15]=1,Math.abs(vt(ys))<1e-8)return;var t=gs[3],o=gs[7],s=gs[11],l=gs[12],c=gs[13],u=gs[14],h=gs[15];if(0!==t||0!==o||0!==s){if(ms[0]=t,ms[1]=o,ms[2]=s,ms[3]=h,!mt(ys,ys))return;yt(ys,ys),ne(i,ms,ys)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(d,gs),n[0]=Dt(d[0]),Ht(d[0],d[0]),r[0]=qt(d[0],d[1]),bs(d[1],d[1],d[0],1,-r[0]),n[1]=Dt(d[1]),Ht(d[1],d[1]),r[0]/=n[1],r[1]=qt(d[0],d[2]),bs(d[2],d[2],d[0],1,-r[1]),r[2]=qt(d[1],d[2]),bs(d[2],d[2],d[1],1,-r[2]),n[2]=Dt(d[2]),Ht(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Ut(vs,d[1],d[2]),qt(d[0],vs)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(a[0]=-a[0]);d[0][2]>d[2][0]&&(a[1]=-a[1]);d[1][0]>d[0][1]&&(a[2]=-a[2])}(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ba).reduce(Da),e,n,r,i,a),[[e,n,r,a,i]]}var Ga=function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)a[o][3]=i[o];for(var s=0;s<3;s++)for(var l=0;l<3;l++)a[3][s]+=t[l]*a[l][s];var c=r[0],u=r[1],h=r[2],r=r[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],h=(f[0][0]=1-2*(u*u+h*h),f[0][1]=2*(c*u-h*r),f[0][2]=2*(c*h+u*r),f[1][0]=2*(c*u+h*r),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(u*h-c*r),f[2][0]=2*(c*h-u*r),f[2][1]=2*(u*h+c*r),f[2][2]=1-2*(c*c+u*u),a=Wa(a,f),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);n[2]&&(h[2][1]=n[2],a=Wa(a,h)),n[1]&&(h[2][1]=0,h[2][0]=n[0],a=Wa(a,h)),n[0]&&(h[2][0]=0,h[1][0]=n[0],a=Wa(a,h));for(var d=0;d<3;d++)for(var p=0;p<3;p++)a[d][p]*=e[d];return 0==(r=a)[0][2]&&0==r[0][3]&&0==r[1][2]&&0==r[1][3]&&0==r[2][0]&&0==r[2][1]&&1==r[2][2]&&0==r[2][3]&&0==r[3][2]&&1==r[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])};function Wa(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}function Ya(t){return t.toFixed(6).replace(".000000","")}function Va(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=za(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=za(n)),null===r[0]||null===i[0]?[[!1],[!0],function(t){return(t?n:e)[0].d}]:(r[0].push(0),i[0].push(1),[r,i,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e),i=(r=fn(r,-1,1),[]);if(1===r)i=t;else for(var a=Math.acos(r),o=+Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(r[0][3],i[0][3],t[5]);return Ga(t[0],t[1],t[2],e,t[4]).map(Ya).join(",")}])}function Ha(t){return t.replace(/[xy]/,"")}function qa(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var Ua=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function Xa(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var n=0;n<r.length;n++)!function(t){var t=r[t],e=t.t,t=t.d,n="scale"===e.substring(0,5)?1:0;i.push({t:e,d:t.map(function(t){return"number"==typeof t?ta(n):ta(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)var l=Va(r,i),a=[l[0]],o=[l[1]],s=[["matrix",[l[2]]]];else for(var c=0;c<r.length;c++){var u=r[c].t,h=i[c].t,f=r[c].d,d=i[c].d,p=Fa[u],g=Fa[h],y=void 0;if(Ua(u,h)){var m=Va([r[c]],[i[c]]);a.push(m[0]),o.push(m[1]),s.push(["matrix",[m[2]]])}else{if(u===h)y=u;else if(p[2]&&g[2]&&Ha(u)===Ha(h))y=Ha(u),f=p[2](f),d=g[2](d);else{if(!p[1]||!g[1]||qa(u)!==qa(h)){m=Va(r,i);a=[m[0]],o=[m[1]],s=[["matrix",[m[2]]]];break}y=qa(u),f=p[1](f),d=g[1](d)}for(var v=[],b=[],x=[],w=0;w<f.length;w++){var k=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=Ri(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=xi(t.unit)):(Fi.isLength(t.unit)||Fi.isLength(e.unit))&&(o=ba(t,i,n),s=ba(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(f[w],d[w],t,!1,w);v[w]=k[0],b[w]=k[1],x.push(k[2])}a.push(v),o.push(b),s.push([y,x])}}return e&&(l=a,a=o,o=l),[a,o,function(t){return t.map(function(t,n){t=t.map(function(t,e){return s[n][1][e](t)}).join(",");return"matrix"===s[n][0]&&16===t.split(",").length&&(s[n][0]="matrix3d"),"matrix3d"===s[n][0]&&6===t.split(",").length&&(s[n][0]="matrix"),s[n][0]+"("+t+")"}).join(" ")}]}var $a=Yr(function(t){var e;return hn(t)?"text-anchor"===t?[ta(0,"px"),ta(0,"px")]:(1===(e=t.split(" ")).length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[ga(Ka(e[0])),ga(Ka(e[1]))]):[ta(t[0]||0,"px"),ta(t[1]||0,"px")]});function Ka(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var n=function(){function t(){this.parser=ya,this.mixer=Oa}return t.prototype.calculator=function(t,e,n,r){return ma(n)},t}(),e=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof _i&&(n=null),O.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&O.sceneGraphService.dirtifyToRoot(t)}),n},t}(),r=function(){function t(){this.parser=ha,this.mixer=fa}return t.prototype.calculator=function(t,e,n,r){return n instanceof _i?"none"===n.value?Zi:Ji:n},t}(),Za=function(){function t(){this.parser=ka}return t.prototype.calculator=function(t,e,n){return n instanceof _i?[]:n},t}();function Ja(t){t=t.parsedStyle.fontSize;return _(t)?null:t}function Qa(){this.parser=$a}var to=function(){function t(){this.parser=ga,this.mixer=Oa}return t.prototype.calculator=function(t,e,n,r,i){if(!Fi.isRelativeUnit(n.unit))return n.value;if(n.unit===g.kPercentage)return 0;if(n.unit===g.kEms){if(r.parentNode){var a=Ja(r.parentNode);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}if(n.unit===g.kRems){if(null!=r&&null!=(a=r.ownerDocument)&&a.documentElement){a=Ja(r.ownerDocument.documentElement);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}},t}(),eo=function(){function t(){this.mixer=_a}var e=t.prototype;return e.parser=function(t){t=va(dn(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},e.calculator=function(t,e,n){return n.map(function(t){return t.value})},t}(),no=function(){function t(){this.mixer=_a}var e=t.prototype;return e.parser=function(t){t=va(dn(t)?[t]:t),t=1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]];return t},e.calculator=function(t,e,n){return n.map(function(t){return t.value})},t}(),ro=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.postProcessor=function(t){var e,n,r;switch(t.nodeName){case E.CIRCLE:case E.ELLIPSE:var i=t.parsedStyle,a=i.cx,i=i.cy;_(a)||(l=a),_(i)||(c=i);break;case E.LINE:var a=t.parsedStyle,i=a.x1,o=a.x2,s=a.y1,a=a.y2,l=Math.min(i,o),c=Math.min(s,a),u=0;break;case E.RECT:case E.IMAGE:case E.GROUP:case E.HTML:case E.TEXT:case E.MESH:_(t.parsedStyle.x)||(l=t.parsedStyle.x),_(t.parsedStyle.y)||(c=t.parsedStyle.y)}t.nodeName!==E.PATH&&t.nodeName!==E.POLYLINE&&t.nodeName!==E.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),_(l)&&_(c)&&_(u)||(e=(r=t.getLocalPosition())[0],n=r[1],r=r[2],t.setLocalPosition(_(l)?e:l,_(c)?n:c,_(u)?r:u))},e}(to),io=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n=null==(n=n=n instanceof _i?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n},t}(),ao=function(){function t(){this.mixer=Oa,this.parser=Ma}return t.prototype.calculator=function(t,e,n){return n.value},t}(),oo=function(){function t(){this.parser=Ma,this.mixer=Sa(0,1)}var e=t.prototype;return e.calculator=function(t,e,n){return n.value},e.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==E.LINE&&e!==E.PATH&&e!==E.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))},t}(),so=function(){function t(){this.parser=Ma,this.mixer=Sa(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),lo=function(){function t(){this.parser=Pa,this.mixer=La}var e=t.prototype;return e.calculator=function(t,e,n){return n instanceof _i&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Wr(0,0,0,0)}:n},e.postProcessor=function(t){var e,n;t.nodeName===E.PATH&&(e=(n=t.parsedStyle).defX,n=n.defY,t.setLocalPosition(void 0===e?0:e,void 0===n?0:n))},t}(),co=function(){function t(){this.parser=Ca}return t.prototype.postProcessor=function(t){var e,n;t.nodeName!==E.POLYGON&&t.nodeName!==E.POLYLINE||(e=(n=t.parsedStyle).defX,n=n.defY,t.setLocalPosition(e,n))},t}(),uo=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).mixer=Sa(0,1/0),t}return s(t,i),t}(to),a=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof _i?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),ho=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i,a=r.getAttribute("text");return a&&(i=a,"capitalize"===n.value?i=a.charAt(0).toUpperCase()+a.slice(1):"lowercase"===n.value?i=a.toLowerCase():"uppercase"===n.value&&(i=a.toUpperCase()),r.parsedStyle.text=i),n.value},t}(),fo=function(){function t(){this.parser=Ia,this.mixer=Xa}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof _i?[]:n},e.postProcessor=function(t){ws(t.parsedStyle.transform,t)},t}(),po=function(){function t(){this.parser=Ma}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){var e;t.parentNode&&(e=(t=t.parentNode).renderable,t=t.sortable,e&&(e.dirty=!0),t)&&(t.dirty=!0)},t}(),go=function(){function t(){this.registry={},this.define(E.CIRCLE,Bo),this.define(E.ELLIPSE,Vo),this.define(E.RECT,os),this.define(E.IMAGE,Ko),this.define(E.LINE,Jo),this.define(E.GROUP,qo),this.define(E.PATH,ts),this.define(E.POLYGON,ns),this.define(E.POLYLINE,is),this.define(E.TEXT,ls),this.define(E.HTML,Xo)}var e=t.prototype;return e.define=function(t,e){this.registry[t]=e},e.get=function(t){return this.registry[t]},t}();var yo,w,mo=function(){function e(t){this.type=void 0,this.eventPhase=e.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Gr,this.page=new Gr,this.canvas=new Gr,this.viewport=new Gr,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}var t=e.prototype;return t.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},t.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.stopPropagation=function(){this.propagationStopped=!0},t.initEvent=function(){},t.initUIEvent=function(){},t.clone=function(){throw new Error(ai)},hi(e,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),e}(),vo=function(r){function t(t,e){var n=r.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(gi(n),e),n}return s(t,r),t}(mo),bo=function(){function t(){this.emitter=new Ir}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r,i,a,o=yn(n)&&n||an(n)&&n.capture,n=an(n)&&n.once,s=Ur(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=t.split(":"))[0],t=r[1],c=i,l=!0),t=o?t+"capture":t,e=Ur(e)?e:e.handleEvent,l&&(a=e,e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(null==(t=n[0].target)?void 0:t.name)===c&&a.apply(void 0,n)}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,n=yn(n)&&n||an(n)&&n.capture,i=Ur(e)?void 0:e;return e=Ur(e)?e:null==(r=e)?void 0:r.handleEvent,this.emitter.off(t=n?t+"capture":t,e,i),this},e.emit=function(t,e){this.dispatchEvent(new vo(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(n=this.document?this:this.defaultView||(null==(n=this.ownerDocument)?void 0:n.defaultView)){if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null!=(n=t.manager)&&n.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),xo=function(i){function d(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}s(d,i),d.isNode=function(t){return!!t.childNodes};var t=d.prototype;return t.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},t.hasChildNodes=function(){return 0<this.childNodes.length},t.isDefaultNamespace=function(t){throw new Error(ai)},t.lookupNamespaceURI=function(t){throw new Error(ai)},t.lookupPrefix=function(t){throw new Error(ai)},t.normalize=function(){throw new Error(ai)},t.isEqualNode=function(t){return this===t},t.isSameNode=function(t){return this.isEqualNode(t)},t.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof d))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=[i=t],n=[a=this];null!=(r=i.parentNode)?r:a.parentNode;)var r,i=i.parentNode?(e.push(i.parentNode),i.parentNode):i,a=a.parentNode?(n.push(a.parentNode),a.parentNode):a;if(i!==a)return d.DOCUMENT_POSITION_DISCONNECTED|d.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|d.DOCUMENT_POSITION_PRECEDING;var o=n.length<e.length?e:n,s=o===e?n:e;if(o[o.length-s.length]===s[0])return o===e?d.DOCUMENT_POSITION_CONTAINED_BY|d.DOCUMENT_POSITION_FOLLOWING:d.DOCUMENT_POSITION_CONTAINS|d.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?s===e?d.DOCUMENT_POSITION_PRECEDING:d.DOCUMENT_POSITION_FOLLOWING:o===e?d.DOCUMENT_POSITION_PRECEDING:d.DOCUMENT_POSITION_FOLLOWING}return d.DOCUMENT_POSITION_FOLLOWING},t.contain=function(t){return this.contains(t)},t.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},t.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},t.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},hi(d,[{key:"textContent",get:function(){var t="";this.nodeName===E.TEXT&&(t+=this.style.text);for(var e=mi(this.childNodes);!(n=e()).done;){var n=n.value;n.nodeName===E.TEXT?t+=n.nodeValue:t+=n.textContent}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===E.TEXT&&(this.style.text=""+t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return 0<this.childNodes.length?this.childNodes[0]:null}},{key:"lastChild",get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null}}]),d}(bo),wo=(xo.DOCUMENT_POSITION_DISCONNECTED=1,xo.DOCUMENT_POSITION_PRECEDING=2,xo.DOCUMENT_POSITION_FOLLOWING=4,xo.DOCUMENT_POSITION_CONTAINS=8,xo.DOCUMENT_POSITION_CONTAINED_BY=16,xo.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,function(e){function t(){var t=e.call(this)||this;t.defaultView=null,t.documentElement=void 0,t.timeline=void 0,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new O.AnimationTimeline(gi(t))}catch(t){}var r={};return Gl.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=Ur(t)?t(E.GROUP):t)}),t.documentElement=new qo({id:"g-root",style:r}),t.documentElement.ownerDocument=gi(t),t.documentElement.parentNode=gi(t),t.childNodes=[t.documentElement],t}s(t,e);var n=t.prototype;return n.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?ls:qo),(t=new n(e)).ownerDocument=this,t)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error(ai)},n.destroy=function(){try{this.documentElement.childNodes.slice().forEach(function(t){t.forEach(function(t){t.destroy()},!0)}),this.timeline.destroy()}catch(t){}},n.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.id,t=O.displayObjectPool.getByEntity(t),e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},n.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},n.elementFromPoint=function(){var n=ci(M().mark(function t(e,n){var r,i,a,o,s,l;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,i=i.y,o=this.defaultView.getConfig(),a=o.width,o=o.height,r<0||i<0||a<r||o<i)return t.abrupt("return",null);t.next=4;break;case 4:return a=this.defaultView.viewport2Client({x:r,y:i}),o=a.x,s=a.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:i,clientX:o,clientY:s},picked:[]});case 7:return s=t.sent,l=s.picked,t.abrupt("return",l&&l[0]||this.documentElement);case 10:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}(),n.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},n.elementsFromPoint=function(){var n=ci(M().mark(function t(e,n){var r,i,a,o,s,l;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,i=i.y,o=this.defaultView.getConfig(),a=o.width,o=o.height,r<0||i<0||a<r||o<i)return t.abrupt("return",[]);t.next=4;break;case 4:return a=this.defaultView.viewport2Client({x:r,y:i}),o=a.x,s=a.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:i,clientX:o,clientY:s},picked:[]});case 7:return s=t.sent,(l=s.picked)[l.length-1]!==this.documentElement&&l.push(this.documentElement),t.abrupt("return",l);case 11:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error(oi)},n.insertBefore=function(t,e){throw new Error(oi)},n.removeChild=function(t,e){throw new Error(oi)},n.replaceChild=function(t,e,n){throw new Error(oi)},n.append=function(){throw new Error(oi)},n.prepend=function(){throw new Error(oi)},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},hi(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),t}(xo)),ko=(yo=yo||{},yo[yo.Standard=0]="Standard",(Ao=w=w||{}).DESTROY="destroy",Ao.ATTR_MODIFIED="DOMAttrModified",Ao.INSERTED="DOMNodeInserted",Ao.REMOVED="removed",Ao.MOUNTED="DOMNodeInsertedIntoDocument",Ao.UNMOUNTED="DOMNodeRemovedFromDocument",Ao.BOUNDS_CHANGED="bounds-changed",Ao.RENDER_ORDER_CHANGED="render-order-changed",Ao.CULLED="culled",function(c){function t(t,e,n,r,i,a,o,s){var l=c.call(this,null)||this;return l.relatedNode=void 0,l.prevValue=void 0,l.newValue=void 0,l.attrName=void 0,l.attrChange=void 0,l.prevParsedValue=void 0,l.newParsedValue=void 0,l.relatedNode=e,l.prevValue=n,l.newValue=r,l.attrName=i,l.attrChange=a,l.prevParsedValue=o,l.newParsedValue=s,l.type=t,l}return s(t,c),t}(mo)),Eo=(ko.ADDITION=2,ko.MODIFICATION=1,ko.REMOVAL=3,0),Mo=new ko(w.INSERTED,null,"","","",0,"",""),Oo=new ko(w.REMOVED,null,"","","",0,"",""),So=new vo(w.DESTROY),_o=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).entity=Eo++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:yo.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:k(0,0,0),localRotation:le(0,0,0,1),localScale:k(1,1,1),localTransform:ht(),localSkew:fe(0,0),position:k(0,0,0),rotation:le(0,0,0,1),scaling:k(1,1,1),worldTransform:ht(),origin:k(0,0,0)},t.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},t.geometry={contentBounds:void 0,renderBounds:void 0},t.rBushNode={aabb:void 0},t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={anchor:$i,opacity:$i,fillOpacity:$i,strokeOpacity:$i,fill:$i,stroke:$i,transform:$i,transformOrigin:$i,visibility:$i,pointerEvents:$i,lineWidth:$i,lineCap:$i,lineJoin:$i,increasedLineWidthForHitTesting:$i,fontSize:$i,fontFamily:$i,fontStyle:$i,fontWeight:$i,fontVariant:$i,textAlign:$i,textBaseline:$i,textTransform:$i,zIndex:$i,filter:$i,shadowType:$i},t.parsedStyle={},t.attributes={},t}s(t,i),t.isElement=function(t){return!!t.getAttribute};var e=t.prototype;return e.cloneNode=function(t){throw new Error(ai)},e.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return O.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Mo.relatedNode=this,t.dispatchEvent(Mo),t},e.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},e.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.removeChild=function(t){var e;return Oo.relatedNode=this,t.dispatchEvent(Oo),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),O.sceneGraphService.detach(t),t},e.removeChildren=function(){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)})},e.destroyChildren=function(){this.childNodes.slice().forEach(function(t){t.destroyChildren(),t.destroy()})},e.matches=function(t){return O.sceneGraphService.matches(t,this)},e.getElementById=function(t){return O.sceneGraphService.querySelector("#"+t,this)},e.getElementsByName=function(t){return O.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},e.getElementsByClassName=function(t){return O.sceneGraphService.querySelectorAll("."+t,this)},e.getElementsByTagName=function(t){return O.sceneGraphService.querySelectorAll(t,this)},e.querySelector=function(t){return O.sceneGraphService.querySelector(t,this)},e.querySelectorAll=function(t){return O.sceneGraphService.querySelectorAll(t,this)},e.closest=function(t){var e=this;do{if(O.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},e.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},e.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},e.after=function(){var r=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(t,e){var n;return null==(n=r.parentNode)?void 0:n.appendChild(t,i+e+1)})}},e.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,a)}},e.replaceWith=function(){this.after.apply(this,arguments),this.remove()},e.append=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach(function(t){return e.appendChild(t)})},e.prepend=function(){for(var n=this,t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t,e){return n.appendChild(t,e)})},e.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},e.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.destroy=function(){this.dispatchEvent(So),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.getGeometryBounds=function(){return O.sceneGraphService.getGeometryBounds(this)},e.getRenderBounds=function(){return O.sceneGraphService.getBounds(this,!0)},e.getBounds=function(){return O.sceneGraphService.getBounds(this)},e.getLocalBounds=function(){return O.sceneGraphService.getLocalBounds(this)},e.getBoundingClientRect=function(){return O.sceneGraphService.getBoundingClientRect(this)},e.getClientRects=function(){return[this.getBoundingClientRect()]},e.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.getAttributeNames=function(){return Object.keys(this.attributes)},e.getAttribute=function(t){var e;return"symbol"==typeof t||void 0===(e=this.attributes[t])&&(t=$r(t),e=this.attributes[t],_(e))?null:e},e.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.hasAttributes=function(){return!!this.getAttributeNames().length},e.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.setAttribute=function(t,e,n){this.attributes[t]=e},e.getAttributeNS=function(t,e){throw new Error(ai)},e.getAttributeNode=function(t){throw new Error(ai)},e.getAttributeNodeNS=function(t,e){throw new Error(ai)},e.hasAttributeNS=function(t,e){throw new Error(ai)},e.removeAttributeNS=function(t,e){throw new Error(ai)},e.removeAttributeNode=function(t){throw new Error(ai)},e.setAttributeNS=function(t,e,n){throw new Error(ai)},e.setAttributeNode=function(t){throw new Error(ai)},e.setAttributeNodeNS=function(t){throw new Error(ai)},e.toggleAttribute=function(t,e){throw new Error(ai)},hi(t,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null}},{key:"previousSibling",get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null}}]),t}(xo),Ao=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).altKey=void 0,t.button=void 0,t.buttons=void 0,t.ctrlKey=void 0,t.metaKey=void 0,t.relatedTarget=void 0,t.shiftKey=void 0,t.client=new Gr,t.movement=new Gr,t.offset=new Gr,t.global=new Gr,t.screen=new Gr,t}s(t,i);var e=t.prototype;return e.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.initMouseEvent=function(){throw new Error(ai)},hi(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),t}(mo),To=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).pointerId=void 0,t.width=0,t.height=0,t.isPrimary=!1,t.pointerType=void 0,t.pressure=void 0,t.tangentialPressure=void 0,t.tiltX=void 0,t.tiltY=void 0,t.twist=void 0,t}s(t,i);var e=t.prototype;return e.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.clone=function(){return this.manager.clonePointerEvent(this)},t}(Ao),Po=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).deltaMode=void 0,t.deltaX=void 0,t.deltaY=void 0,t.deltaZ=void 0,t.DOM_DELTA_LINE=0,t.DOM_DELTA_PAGE=1,t.DOM_DELTA_PIXEL=2,t}return s(t,i),t.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},t}(Ao);function Lo(t){return null!=t&&t.nodeName}var Co=new ko(w.ATTR_MODIFIED,null,null,null,null,ko.MODIFICATION,null,null),No={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},jo={anchor:[0,0],fill:Zi,stroke:Zi,transform:[],zIndex:0,filter:[],shadowType:"outer"},Ro=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),Fo=function(i){function t(t){var r=i.call(this)||this;return r.config=void 0,r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=t,r.config.interactive=null!=(t=r.config.capture)?t:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||E.GROUP,r.config.style=fi({},r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,jo,r.config.initialParsedStyle),Object.assign(r.attributes,No),r.initAttributes(r.config.style),r.style=new Proxy({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}}),O.displayObjectPool.add(r.entity,gi(r)),r}s(t,i);var e=t.prototype;return e.destroy=function(){i.prototype.destroy.call(this),O.displayObjectPool.remove(this.entity),this.getAnimations().forEach(function(t){t.cancel()})},e.cloneNode=function(e,t){var n,r=fi({},this.attributes);for(n in r){var i=r[n];Lo(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},e.initAttributes=function(t){var e=this.renderable;O.styleValueRegistry.processProperties(this,t=void 0===t?{}:t,{forceUpdateGeometry:!0,usedAttributes:Ro}),e.dirty=!0},e.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=$r(t);mn(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),i.prototype.setAttribute.call(this,t,e))},e.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(O.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Co.relatedNode=this,Co.prevValue=i,Co.newValue=e,Co.attrName=t,Co.prevParsedValue=a,Co.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Co):(Co.target=this).ownerDocument.defaultView.dispatchEvent(Co,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},e.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],e=e[1],t=t.getMax(),r=t[0],t=t[1];return new Wr(n,e,r-n,t-e)},e.setOrigin=function(t,e,n){return O.sceneGraphService.setOrigin(this,us(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getOrigin=function(){return O.sceneGraphService.getOrigin(this)},e.setPosition=function(t,e,n){return O.sceneGraphService.setPosition(this,us(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.setLocalPosition=function(t,e,n){return O.sceneGraphService.setLocalPosition(this,us(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translate=function(t,e,n){return O.sceneGraphService.translate(this,us(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translateLocal=function(t,e,n){return O.sceneGraphService.translateLocal(this,us(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getPosition=function(){return O.sceneGraphService.getPosition(this)},e.getLocalPosition=function(){return O.sceneGraphService.getLocalPosition(this)},e.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=us(t,e=e||t,n=n||t)),O.sceneGraphService.scaleLocal(this,t),this},e.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=us(t,e=e||t,n=n||t)),O.sceneGraphService.setLocalScale(this,t),this},e.getLocalScale=function(){return O.sceneGraphService.getLocalScale(this)},e.getScale=function(){return O.sceneGraphService.getScale(this)},e.getEulerAngles=function(){return fs(ds(m(),O.sceneGraphService.getWorldTransform(this))[2])},e.getLocalEulerAngles=function(){return fs(ds(m(),O.sceneGraphService.getLocalRotation(this))[2])},e.setEulerAngles=function(t){return O.sceneGraphService.setEulerAngles(this,0,0,t),this},e.setLocalEulerAngles=function(t){return O.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.rotateLocal=function(t,e,n){return _(e)&&_(n)?O.sceneGraphService.rotateLocal(this,0,0,t):O.sceneGraphService.rotateLocal(this,t,e,n),this},e.rotate=function(t,e,n){return _(e)&&_(n)?O.sceneGraphService.rotate(this,0,0,t):O.sceneGraphService.rotate(this,t,e,n),this},e.setRotation=function(t,e,n,r){return O.sceneGraphService.setRotation(this,t,e,n,r),this},e.setLocalRotation=function(t,e,n,r){return O.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.setLocalSkew=function(t,e){return O.sceneGraphService.setLocalSkew(this,t,e),this},e.getRotation=function(){return O.sceneGraphService.getRotation(this)},e.getLocalRotation=function(){return O.sceneGraphService.getLocalRotation(this)},e.getLocalSkew=function(){return O.sceneGraphService.getLocalSkew(this)},e.getLocalTransform=function(){return O.sceneGraphService.getLocalTransform(this)},e.getWorldTransform=function(){return O.sceneGraphService.getWorldTransform(this)},e.setLocalTransform=function(t){return O.sceneGraphService.setLocalTransform(this,t),this},e.resetLocalTransform=function(){O.sceneGraphService.resetLocalTransform(this)},e.getAnimations=function(){return this.activeAnimations},e.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},e.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},e.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},e.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map(function(t){return Number(t.style.zIndex)}))+1),this},e.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map(function(t){return Number(t.style.zIndex)}))-1),this},e.getConfig=function(){return this.config},e.attr=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?an(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes},e.getMatrix=function(t){var t=t||this.getWorldTransform(),e=_t(m(),t),n=e[0],e=e[1],r=At(m(),t),i=r[0],r=r[1],t=Tt(re(),t),t=ds(m(),t),a=t[0],t=t[2],o=(a=a||t,t=n,n=e,e=i,i=r,r=Math.cos(a),a=Math.sin(a),e*r),s=i*a,l=0,e=-e*a,a=i*r,i=0,r=t,t=n,n=1,c=new lt(9);return c[0]=o,c[1]=s,c[2]=l,c[3]=e,c[4]=a,c[5]=i,c[6]=r,c[7]=t,c[8]=n,c},e.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.setMatrix=function(t){var t=ps(t),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},e.setLocalMatrix=function(t){var t=ps(t),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},e.show=function(){this.style.visibility="visible"},e.hide=function(){this.style.visibility="hidden"},e.getCount=function(){return this.childElementCount},e.getParent=function(){return this.parentElement},e.getChildren=function(){return this.children},e.getFirst=function(){return this.firstElementChild},e.getLast=function(){return this.lastElementChild},e.getChildByIndex=function(t){return this.children[t]||null},e.add=function(t,e){return this.appendChild(t,e)},e.setClip=function(t){this.style.clipPath=t},e.set=function(t,e){this.config[t]=e},e.get=function(t){return this.config[t]},e.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},e.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},e.setZIndex=function(t){return this.style.zIndex=t,this},hi(t,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),t}(_o),Io=["style"],Bo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,Io);return n.call(this,fi({type:E.CIRCLE,style:fi({cx:"",cy:"",r:""},e),initialParsedStyle:{anchor:[.5,.5]}},t))||this}return s(t,n),t}(Fo),Do=["style"],zo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,Do),e=n.call(this,fi({style:fi({x:"",y:""},e)},t))||this;return e.isCustomElement=!0,e}return s(t,n),t}(Fo),Go={},Wo=[],Ao=function(){function t(){}var e=t.prototype;return e.getByEntity=function(t){return Go[t]},e.getAll=function(){return Object.keys(Go).map(function(t){return Go[t]})},e.add=function(t,e){(Go[t]=e).nodeName===E.HTML&&Wo.push(e)},e.remove=function(t){var e=Go[t];e&&(delete Go[t],e.nodeName===E.HTML)&&(t=Wo.indexOf(e),Wo.splice(t,1))},e.getHTMLs=function(){return Wo},t}(),Yo=["style"],Vo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,Yo);return n.call(this,fi({type:E.ELLIPSE,style:fi({cx:"",cy:"",rx:"",ry:""},e),initialParsedStyle:{anchor:[.5,.5]}},t))||this}return s(t,n),t}(Fo),Ho=["style"],qo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,Ho);return n.call(this,fi({type:E.GROUP,style:fi({x:"",y:"",width:"",height:""},e)},t))||this}return s(t,n),t}(Fo),Uo=["style"],Xo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,Uo),e=n.call(this,fi({type:E.HTML,style:fi({x:"",y:"",width:"auto",height:"auto",innerHTML:""},e)},t))||this;return e.cullable.enable=!1,e}s(t,n);var e=t.prototype;return e.getDomElement=function(){return this.parsedStyle.$el},e.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},e.getClientRects=function(){return[this.getBoundingClientRect()]},e.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null==(r=this.ownerDocument)||null==(r=r.defaultView)?void 0:r.getContextService().getBoundingClientRect();return r?(t=n.left-r.left,r=n.top-r.top,(e=new Br).setMinMax(k(t,r,0),k(t+n.width,r+n.height,0)),e):null},e.getLocalBounds=function(){if(this.parentNode){var t,e=mt(ht(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Br.isEmpty(n))return(t=new Br).setFromTransformedAABB(n,e),t}return this.getBounds()},t}(Fo),$o=["style"],Ko=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,$o);return n.call(this,fi({type:E.IMAGE,style:fi({x:"",y:"",img:"",width:"",height:""},e)},t))||this}return s(t,n),t}(Fo),Zo=["style"],Jo=function(r){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,Zo),e=r.call(this,fi({type:E.LINE,style:fi({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},e)},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),n=t.markerStart,t=t.markerEnd;return n&&Lo(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Lo(t)&&(e.markerEndAngle=t.getLocalEulerAngles(),e.appendChild(t)),e.transformMarker(!0),e.transformMarker(!1),e}s(t,r);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Lo(r)&&(this.markerStartAngle=0,r.remove()),i&&Lo(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Lo(r)&&(this.markerEndAngle=0,r.remove()),i)&&Lo(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&Lo(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},e.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=or.pointAt(r,i,a,o,t),i=r.x,a=r.y,o=$t(m(),k(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new Gr(o[0],o[1])},e.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.getTotalLength=function(){var t=this.parsedStyle,e=t.x1,n=t.y1,r=t.x2,t=t.y2;return or.length(e,n,r,t)},t}(Fo),Qo=["style"],ts=function(i){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,Qo),e=i.call(this,fi({type:E.PATH,style:fi({path:"",miterLimit:""},e)},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),n=t.markerStart,r=t.markerEnd,t=t.markerMid;return n&&Lo(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Lo(t)&&e.placeMarkerMid(t),r&&Lo(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}s(t,i);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Lo(r)&&(this.markerStartAngle=0,r.remove()),i&&Lo(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Lo(r)&&(this.markerEndAngle=0,r.remove()),i&&Lo(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.defX,o=o.defY,s=t?s:l;s&&Lo(s)&&(l=0,h=t?(i=(t=this.getStartTangent())[0],e=(t=t[1])[0]-h,n=t[1]-o,r=i[0]-t[0],i=i[1]-t[1],a=c||0,this.markerStartAngle):(c=(t=this.getEndTangent())[0],e=(t=t[1])[0]-h,n=t[1]-o,r=c[0]-t[0],i=c[1]-t[1],a=u||0,this.markerEndAngle),l=Math.atan2(i,r),s.setLocalEulerAngles(180*l/Math.PI+h),s.setLocalPosition(e+Math.cos(l)*a,n+Math.sin(l)*a))},e.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Lo(t))for(var a=1;a<n.length-1;a++){var o=n[a].currentPoint,s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},e.getTotalLength=function(){return Hs(this)},e.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Ke(n.path.absolutePath,t,v(v({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=$t(m(),k(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Gr(n[0],n[1])},e.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Hs(this),e)},e.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},e.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i},t}(Fo),es=["style"],ns=function(i){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,es),e=i.call(this,fi({type:E.POLYGON,style:fi({points:"",miterLimit:"",isClosed:!0},e)},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),n=t.markerStart,r=t.markerEnd,t=t.markerMid;return n&&Lo(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Lo(t)&&e.placeMarkerMid(t),r&&Lo(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}s(t,i);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Lo(r)&&(this.markerStartAngle=0,r.remove()),i&&Lo(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Lo(r)&&(this.markerEndAngle=0,r.remove()),i&&Lo(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&Lo(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.style.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},e.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Lo(t))for(var a=1;a<(this.style.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}},t}(Fo),rs=["style"],is=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,rs);return n.call(this,fi({type:E.POLYLINE,style:fi({points:"",miterLimit:"",isClosed:!1},e)},t))||this}s(t,n);var e=t.prototype;return e.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),or.pointAt(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=$t(m(),k(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new Gr(a[0],a[1])},e.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},t}(ns),as=["style"],os=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,as);return n.call(this,fi({type:E.RECT,style:fi({x:"",y:"",width:"",height:"",radius:""},e)},t))||this}return s(t,n),t}(Fo),ss=["style"],ls=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=pi(t,ss);return n.call(this,fi({type:E.TEXT,style:fi({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},e)},t))||this}s(t,n);var e=t.prototype;return e.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},e.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},e.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},t}(Fo);function cs(t){return void 0===t?0:360<t||t<-360?t%360:t}function us(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),dn(t)?k(t,e,n):Array.isArray(t)&&3===t.length?Bt(t):k(t[0],t[1]||e,t[2]||n)}function hs(t){return t*(Math.PI/180)}function fs(t){return t*(180/Math.PI)}function ds(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=At(m(),r))[0],l=c[1],c=c[2],(u=Math.asin(-r[2]/s))<o?-o<u?(i=Math.atan2(r[6]/l,r[10]/c),a=Math.atan2(r[1]/s,r[0]/s)):(a=0,i=-Math.atan2(r[4]/l,r[5]/l)):(a=0,i=Math.atan2(r[4]/l,r[5]/l)),n[0]=i,n[1]=u,n[2]=a,n):(o=t,s=(c=e)[0],r=c[1],l=c[2],c=c[3],.499995*(n=s*s+(i=r*r)+(u=l*l)+(a=c*c))<(t=s*c-r*l)?(o[0]=Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):t<-.499995*n?(o[0]=-Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):(o[0]=Math.asin(2*(s*l-c*r)),o[1]=Math.atan2(2*(s*c+r*l),1-2*(u+a)),o[2]=Math.atan2(2*(s*r+l*c),1-2*(i+u))),o);var n,r,i,a,o,s,l,c,u}function ps(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?a=-a:o=-o),a&&(e*=1/a,n*=1/a);r=fs(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var gs=ht(),ys=ht(),ms=ee(),d=[m(),m(),m()],vs=m();function bs(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var xs=ht();function ws(t,l){var c,u;return t&&t.length&&(u=c=0,l?(c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0,l.resetLocalTransform(),l.setLocalPosition(c,u)):l=new Fo({}),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?(o=t||[Hi,Hi],l.translateLocal(o[0].value,o[1].value,0)):"translatex"===s?(o=t||[Hi],l.translateLocal(o[0].value,0,0)):"translatey"===s?(o=t||[Hi],l.translateLocal(0,o[0].value,0)):"translatez"===s?(o=t||[Hi],l.translateLocal(0,0,o[0].value)):"translate3d"===s?(o=t||[Hi,Hi,Hi],l.translateLocal(o[0].value,o[1].value,o[2].value)):"rotate"===s?(o=t||[qi],l.rotateLocal(0,0,o[0].value)):"rotatex"===s?(o=t||[qi],l.rotateLocal(o[0].value,0,0)):"rotatey"===s?(o=t||[qi],l.rotateLocal(0,o[0].value,0)):"rotatez"===s?(o=t||[qi],l.rotateLocal(0,0,o[0].value)):"rotate3d"!==s&&("skew"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(hs(o[0]),hs(o[1]))):"skewx"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(hs(o[0]),l.getLocalSkew()[1])):"skewy"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],hs(o[0]))):"matrix"===s?(e=(o=t.map(function(t){return t.value}))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(pt(xs,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(pt.apply(It,[xs].concat(t.map(function(t){return t.value}))),xs[12]+=c,xs[13]+=u,l.setLocalTransform(xs)))})),l.getLocalTransform()}ks={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},Es="";var ks,Es,Ms=function(t){return Es=t,Ss()};function Os(t){throw new Error(Es+": "+t)}function Ss(){var t=Fs(_s);return 0<Es.length&&Os("Invalid input not EOF"),t}function _s(){return As("linear-gradient",ks.linearGradient,Ps)||As("repeating-linear-gradient",ks.repeatingLinearGradient,Ps)||As("radial-gradient",ks.radialGradient,Ls)||As("repeating-radial-gradient",ks.repeatingRadialGradient,Ls)||As("conic-gradient",ks.conicGradient,Ls)}function As(n,t,r){return Ts(t,function(t){var e=r();return e&&!Ys(ks.comma)&&Os("Missing comma before color stops"),{type:n,orientation:e,colorStops:Fs(Is)}})}function Ts(t,e){t=Ys(t);if(t)return Ys(ks.startCall)||Os("Missing ("),e=e(t),Ys(ks.endCall)||Os("Missing )"),e}function Ps(){return Ws("directional",ks.sideOrCorner,1)||Ws("angular",ks.angleValue,1)}function Ls(){var t,e,n=Cs();return n&&((t=[]).push(n),e=Es,Ys(ks.comma))&&((n=Cs())?t.push(n):Es=e),t}function Cs(){var t,e=function(){var t=Ws("shape",/^(circle)/i,0);t&&(t.style=Gs()||Ns());return t}()||function(){var t=Ws("shape",/^(ellipse)/i,0);t&&(t.style=Ds()||Ns());return t}();return e?e.at=js():(t=Ns())?(e=t,(t=js())&&(e.at=t)):(t=Rs())&&(e={type:"default-radial",at:t}),e}function Ns(){return Ws("extent-keyword",ks.extentKeywords,1)}function js(){var t;if(Ws("position",/^at/,0))return(t=Rs())||Os("Missing positioning value"),t}function Rs(){var t={x:Ds(),y:Ds()};if(t.x||t.y)return{type:"position",value:t}}function Fs(t){var e=t(),n=[];if(e)for(n.push(e);Ys(ks.comma);)(e=t())?n.push(e):Os("One extra comma");return n}function Is(){var t=Ws("hex",ks.hexColor,1)||Ts(ks.rgbaColor,function(){return{type:"rgba",value:Fs(Bs)}})||Ts(ks.rgbColor,function(){return{type:"rgb",value:Fs(Bs)}})||Ws("literal",ks.literalColor,0);return t||Os("Expected color definition"),t.length=Ds(),t}function Bs(){return Ys(ks.number)[1]}function Ds(){return Ws("%",ks.percentageValue,1)||zs()||Gs()}function zs(){return Ws("position-keyword",ks.positionKeywords,1)}function Gs(){return Ws("px",ks.pixelValue,1)||Ws("em",ks.emValue,1)}function Ws(t,e,n){e=Ys(e);if(e)return{type:t,value:e[n]}}function Ys(t){var e=/^[\n\r\t\s]+/.exec(Es),e=(e&&Vs(e[0].length),t.exec(Es));return e&&Vs(e[0].length),e}function Vs(t){Es=Es.substring(t)}function Hs(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Ke(t.parsedStyle.path.absolutePath,void 0,v(v({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function qs(t,e){return t[0]===e[0]&&t[1]===e[1]}function Us(t,e){var n,r=t.prePoint,i=t.currentPoint,t=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),o=Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2),r=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),r=Math.acos((a+o-r)/(2*Math.sqrt(a)*Math.sqrt(o)));return!r||0===Math.sin(r)||(void(a=0)===n&&(n=1e-5),Math.abs(r-a)<n)?{xExtra:0,yExtra:0}:(o=Math.abs(Math.atan2(t[1]-i[1],t[0]-i[0])),a=Math.abs(Math.atan2(t[0]-i[0],t[1]-i[1])),o=o>Math.PI/2?Math.PI-o:o,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(r/2-o)*(e/2*(1/Math.sin(r/2)))-e/2||0,yExtra:Math.cos(a-r/2)*(e/2*(1/Math.sin(r/2)))-e/2||0})}function Xs(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function $s(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=hs(r=pn(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=Ks({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=Ks(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0<o?o-=2*Math.PI:a&&o<0&&(o+=2*Math.PI),c=l+(o%=2*Math.PI)*s,u=e*Math.cos(c),i=n*Math.sin(c),{x:Math.cos(r)*u-Math.sin(r)*i+t.x,y:Math.sin(r)*u+Math.cos(r)*i+t.y,ellipticalArcStartAngle:l,ellipticalArcEndAngle:l+o,ellipticalArcAngle:c,ellipticalArcCenter:t,resultantRx:e,resultantRy:n})}var Ks=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)};function Zs(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,i=void 0===i?0:i,a=r.ry,a=void 0===a?0:a,o=r.xRotation,s=r.arcFlag,r=r.sweepFlag,l=$s({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=$s({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),a=i.x-l.x,o=i.y-l.y,s=Math.sqrt(a*a+o*o);return{x:-a/s,y:-o/s}}function Js(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Qs(t,e){return Js(t)*Js(e)?(t[0]*e[0]+t[1]*e[1])/(Js(t)*Js(e)):1}function tl(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Qs(t,e))}function el(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function nl(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d=[];switch(t.nodeName){case E.LINE:var p=t.parsedStyle,d=[["M",p.x1,p.y1],["L",p.x2,p.y2]];break;case E.CIRCLE:var p=t.parsedStyle,g=p.r;d=el(g,g,p.cx,p.cy);break;case E.ELLIPSE:var g=t.parsedStyle;d=el(g.rx,g.ry,g.cx,g.cy);break;case E.POLYLINE:case E.POLYGON:p=t.parsedStyle.points;g=p.points,p=t.nodeName===E.POLYGON,g=g.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),p&&g.push(["Z"]),d=g;break;case E.RECT:var y=t.parsedStyle,m=y.width,v=y.height,b=y.x,x=y.y,y=y.radius,w=y&&y.some(function(t){return 0!==t});n=m,r=v,b=b,x=x,d=(w=w&&y.map(function(t){return fn(t,0,Math.min(Math.abs(m)/2,Math.abs(v)/2))}))?(s=(y=0<n?1:-1)+(o=0<r?1:-1)!=0?1:0,[["M",y*(i=w[0])+b,x],["L",n-y*(a=w[1])+b,x],a?["A",a,a,0,0,s,n+b,o*a+x]:null,["L",n+b,r-o*(a=w[2])+x],a?["A",a,a,0,0,s,n+b-y*a,r+x]:null,["L",b+y*(a=w[3]),r+x],a?["A",a,a,0,0,s,b,r+x-o*a]:null,["L",b,o*i+x],i?["A",i,i,0,0,s,y*i+b,x]:null,["Z"]].filter(function(t){return t})):[["M",b,x],["L",b+n,x],["L",b+n,x+r],["L",b,x+r],["Z"]];break;case E.PATH:w=t.parsedStyle.path.absolutePath;d=[].concat(w)}if(d.length)return l=d,c=e,u=(e=(e=t).parsedStyle).defX,h=void 0===u?0:u,f=void 0===(u=e.defY)?0:u,l.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=k(e[1]-h,e[2]-f,0),c&&$t(n,n,c),a=""+e[0]+n[0]+","+n[1]):"Z"===e[0]?a=e[0]:"C"===e[0]?(n=k(e[1]-h,e[2]-f,0),r=k(e[3]-h,e[4]-f,0),i=k(e[5]-h,e[6]-f,0),c&&($t(n,n,c),$t(r,r,c),$t(i,i,c)),a=""+e[0]+n[0]+","+n[1]+","+r[0]+","+r[1]+","+i[0]+","+i[1]):"A"===e[0]?(n=k(e[6]-h,e[7]-f,0),c&&$t(n,n,c),a=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+n[0]+","+n[1]):"Q"===e[0]&&(r=k(e[1]-h,e[2]-f,0),i=k(e[3]-h,e[4]-f,0),c&&($t(r,r,c),$t(i,i,c)),a=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"),t+a},"")}function rl(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}function il(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)}function al(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)}function ol(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)}function sl(t){return yl.setup(this,t),yl.create(t)}function ll(t){return vl.setup(this,t),vl.create(t)}function cl(){throw new Error("tapAsync is not supported on a SyncHook")}function ul(){throw new Error("tapPromise is not supported on a SyncHook")}function hl(t){return xl.setup(this,t),xl.create(t)}function fl(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")}function dl(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")}function pl(t){return kl.setup(this,t),kl.create(t)}var gl=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=il,this.call=il,this._callAsync=al,this.callAsync=al,this._promise=ol,this.promise=ol,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e=mi(this.interceptors);!(n=e()).done;){var n=n.value;n.register&&void 0!==(n=n.register(t))&&(t=n)}return t},e.withOptions=function(e){function n(t){return Object.assign({},e,"string"==typeof t?{name:t}:t)}var r=this;return{name:this.name,tap:function(t,e){return r.tap(n(t),e)},tapAsync:function(t,e){return r.tapAsync(n(t),e)},tapPromise:function(t,e){return r.tapPromise(n(t),e)},isUsed:function(){return r.isUsed()},withOptions:function(t){return r.withOptions(n(t))}}},e.isUsed=function(){return 0<this.taps.length||0<this.interceptors.length},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));for(var e,n=0,r=("number"==typeof t.stage&&(n=t.stage),this.taps.length);0<r;){r--;var i=this.taps[r],a=(this.taps[r+1]=i).stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(0<e.size)continue}if(!(n<a)){r++;break}}this.taps[r]=t},t}(),o=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="",i=(i+='"use strict";\n')+this.header()+"return new Promise((function(_resolve, _reject) {\n";n&&(i+="var _sync = true;\nfunction _error(_err) {\nif(_sync)\n_resolve(Promise.resolve().then((function() { throw _err; })));\nelse\n_reject(_err);\n};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=new Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map(function(t){return t.fn})},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var r=this;if(0<this.options.interceptors.length){for(var i=t.onError,a=t.onResult,n=t.onDone,e="",o=0;o<this.options.interceptors.length;o++){var s=this.options.interceptors[o];s.call&&(e+=this.getInterceptor(o)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return e+=this.content(Object.assign(t,{onError:i&&function(t){for(var e="",n=0;n<r.options.interceptors.length;n++)r.options.interceptors[n].error&&(e+=r.getInterceptor(n)+".error("+t+");\n");return e+=i(t)},onResult:a&&function(t){for(var e="",n=0;n<r.options.interceptors.length;n++)r.options.interceptors[n].result&&(e+=r.getInterceptor(n)+".result("+t+");\n");return e+=a(t)},onDone:n&&function(){for(var t="",e=0;e<r.options.interceptors.length;e++)r.options.interceptors[e].done&&(t+=r.getInterceptor(e)+".done();\n");return t+=n()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",0<this.options.interceptors.length&&(t+="var _taps = this.taps;\nvar _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=mi(this.options.taps);!(t=e()).done;)if(t.value.context)return!0;return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,a=e.rethrowIfPossible,o="",s=!1,l=0;l<this.options.interceptors.length;l++){var c=this.options.interceptors[l];c.tap&&(s||(o+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),o+=this.getInterceptor(l)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}o+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var u=this.options.taps[t];switch(u.type){case"sync":a||(o=o+"var _hasError"+t+" = false;\ntry {\n"),o+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:u.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:u.context?"_context":void 0})+");\n",a||(o=(o=(o=o+"} catch(_err) {\n_hasError"+t+" = true;\n")+n("_err"))+"}\nif(!_hasError"+t+") {\n"),r&&(o+=r("_result"+t)),i&&(o+=i()),a||(o+="}\n");break;case"async":var h=(h=(h="")+(r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n")+("if(_err"+t+") {\n"))+n("_err"+t)+"} else {\n";r&&(h+=r("_result"+t)),i&&(h+=i()),o+="_fn"+t+"("+this.args({before:u.context?"_context":void 0,after:h=h+"}\n"+"})"})+");\n";break;case"promise":o=(o=(o=(o+="var _hasResult"+t+" = false;\n")+("var _promise"+t+" = _fn"+t+"("+this.args({before:u.context?"_context":void 0})+");\n"))+("if (!_promise"+t+" || !_promise"+t+".then)\n")+(" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n"))+("_promise"+t+".then((function(_result"+t+") {\n")+("_hasResult"+t+" = true;\n"),r&&(o+=r("_result"+t)),i&&(o+=i()),o=(o=o+("}), function(_err"+t+") {\n")+("if(_hasResult"+t+") throw _err"+t+";\n"))+n("_err"+t)+"});\n"}return o},e.callTapsSeries=function(t){var a=this,o=t.onError,s=t.onResult,e=t.resultReturns,l=t.onDone,n=t.doneReturns,c=t.rethrowIfPossible;if(0===this.options.taps.length)return l();for(var u=this.options.taps.findIndex(function(t){return"sync"!==t.type}),h=e||n,f="",d=l,p=0,r=function(t){function e(t){return t?"":l()}var n=t,r=(d!==l&&("sync"!==a.options.taps[n].type||20<p++)&&(p=0,f=(f+="function _next"+n+"() {\n")+d()+"}\n",d=function(){return(h?"return ":"")+"_next"+n+"();\n"}),d),i=a.callTap(n,{onError:function(t){return o(n,t,r,e)},onResult:s&&function(t){return s(n,t,r,e)},onDone:!s&&r,rethrowIfPossible:c&&(u<0||n<u)});d=function(){return i}},i=this.options.taps.length-1;0<=i;i--)r(i);return f+=d()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,t=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var a=this.options.taps.every(function(t){return"sync"===t.type}),r="";a||(r+="var _looper = (function() {\nvar _loopAsync = false;\n");for(var r=(r+="var _loop;\n")+"do {\n"+"_loop = false;\n",i=0;i<this.options.interceptors.length;i++){var o=this.options.interceptors[i];o.loop&&(r+=this.getInterceptor(i)+".loop("+this.args({before:o.context?"_context":void 0})+");\n")}return r=r+this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var i=(i="")+("if("+e+" !== undefined) {\n")+"_loop = true;\n";return a||(i+="if(_loopAsync) _looper();\n"),i=(i=i+r(!0)+"} else {\n")+n()+"}\n"},onDone:n&&function(){var t="";return(t+="if(!_loop) {\n")+n()+"}\n"},rethrowIfPossible:t&&a})+"} while(_loop);\n",a||(r+="_loopAsync = true;\n});\n_looper();\n"),r},e.callTapsParallel=function(t){var e=this,a=t.onError,o=t.onResult,s=t.onDone,l=t.rethrowIfPossible,t=t.onTap,c=void 0===t?function(t,e){return e()}:t;if(this.options.taps.length<=1)return this.callTapsSeries({onError:a,onResult:o,onDone:s,rethrowIfPossible:l});for(var u="",n=(u=(u+="do {\n")+("var _counter = "+this.options.taps.length+";\n"),s&&(u=(u+="var _done = (function() {\n")+s()+"});\n"),function(n){function r(){return s?"if(--_counter === 0) _done();\n":"--_counter;"}function i(t){return t||!s?"_counter = 0;\n":"_counter = 0;\n_done();\n"}u=(u+="if(_counter <= 0) break;\n")+c(n,function(){return e.callTap(n,{onError:function(t){var e="";return(e+="if(_counter > 0) {\n")+a(n,t,r,i)+"}\n"},onResult:o&&function(t){var e="";return(e+="if(_counter > 0) {\n")+o(n,t,r,i)+"}\n"},onDone:!o&&r,rethrowIfPossible:l})},r,i)}),r=0;r<this.options.taps.length;r++)n(r);return u+="} while(false);\n"},e.args=function(t){var t=void 0===t?{}:t,e=t.before,t=t.after,n=this._args;return e&&(n=[e].concat(n)),0===(n=t?n.concat(t):n).length?"":n.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),yl=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var i=t.onError,t=t.onDone;return this.callTapsParallel({onError:function(t,e,n,r){return i(e)+r(!0)},onDone:t})},e}(o)),ml=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).compile=sl,t._call=void 0,t.call=void 0,t}return s(t,n),t}(gl),vl=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var i=this,a=t.onError,e=t.onResult;return t.onDone,this.callTapsSeries({onError:function(t,e,n,r){return a(e)+r(!0)},onResult:function(t,e,n){var r="";return(r+="if("+e+" !== undefined) {\n")+(i._args[0]+" = "+e+";\n")+"}\n"+n()},onDone:function(){return e(i._args[0])}})},e}(o)),bl=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).compile=ll,t._call=void 0,t.call=void 0,t}return s(t,n),t}(gl),xl=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var n=t.onError,e=t.onDone,t=t.rethrowIfPossible;return this.callTapsSeries({onError:function(t,e){return n(e)},onDone:e,rethrowIfPossible:t})},e}(o)),wl=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).tapAsync=cl,t.tapPromise=ul,t.compile=hl,t}return s(t,n),t}(gl),kl=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var i=this,n=t.onError,e=t.onResult,r=t.resultReturns,t=t.rethrowIfPossible;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,e,n){var r="";return(r+="if("+e+" !== undefined) {\n")+(i._args[0]+" = "+e+";\n")+"}\n"+n()},onDone:function(){return e(i._args[0])},doneReturns:r,rethrowIfPossible:t})},e}(o)),El=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).tapAsync=fl,t.tapPromise=dl,t.compile=pl,t}return s(t,n),t}(wl),Ml=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ol=/([\"\'])[^\'\"]+\1/;function Sl(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-Bl)?0:16-e,r=Nl();return Il[r]=t,1<Object.keys(Il).length||setTimeout(function(){Bl=n;var e=Il;Il={},Object.keys(e).forEach(function(t){return e[t](Fl())})},e),r}function _l(t){delete Il[t]}function Al(t){return"string"!=typeof t?Sl:""===t?jl.requestAnimationFrame:jl[t+"RequestAnimationFrame"]}var Tl,Pl,Ll,Cl=1,Nl=function(){return Cl++},jl="object"==typeof self&&self.self==self?self:"object"==typeof N&&N.global==N?N:{},Rl=Date.now(),Fl=function(){return jl.performance&&"function"==typeof jl.performance.now?jl.performance.now():Date.now()-Rl},Il={},Bl=Date.now(),gl=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],Al),Dl=Al(gl),zl="string"!=typeof(o=gl)?_l:""===o?jl.cancelAnimationFrame:jl[o+"CancelAnimationFrame"]||jl[o+"CancelRequestAnimationFrame"],Gl=(jl.requestAnimationFrame=Dl,jl.cancelAnimationFrame=zl,[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:i.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:i.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:i.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:i.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:i.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:i.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:i.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:i.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:i.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:i.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:i.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:i.FILTER},{n:"clipPath",syntax:i.DEFINED_PATH},{n:"textPath",syntax:i.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:i.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===E.CIRCLE||t===E.ELLIPSE?"center":t===E.TEXT?"text-anchor":"left top"},l:!0,syntax:i.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===E.CIRCLE||t===E.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:i.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:i.COORDINATE},{n:"cy",int:!0,d:"0",syntax:i.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:i.COORDINATE},{n:"y",int:!0,d:"0",syntax:i.COORDINATE},{n:"z",int:!0,d:"0",syntax:i.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:i.COORDINATE},{n:"y1",int:!0,l:!0,syntax:i.COORDINATE},{n:"z1",int:!0,l:!0,syntax:i.COORDINATE},{n:"x2",int:!0,l:!0,syntax:i.COORDINATE},{n:"y2",int:!0,l:!0,syntax:i.COORDINATE},{n:"z2",int:!0,l:!0,syntax:i.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:i.PATH,p:50},{n:"points",l:!0,syntax:i.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:i.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:i.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:i.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:i.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:i.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:i.NUMBER,d:function(t){return t===E.PATH||t===E.POLYGON||t===E.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:i.MARKER},{n:"markerEnd",syntax:i.MARKER},{n:"markerMid",syntax:i.MARKER},{n:"markerStartOffset",syntax:i.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:i.LENGTH,l:!0,int:!0,d:"0"}]),Wl={},Yl=new WeakMap,Vl=m(),Hl=m(),ql=m(),gl=function(){function t(){var e=this;Gl.forEach(function(t){e.registerMetadata(t)})}var e=t.prototype;return e.registerMetadata=function(e){[e.n].concat(e.a||[]).forEach(function(t){Wl[t]=e})},e.unregisterMetadata=function(t){delete Wl[t]},e.getPropertySyntax=function(t){return O.CSSPropertySyntaxFactory[t]},e.processProperties=function(n,r,t){var i=this,t=t=void 0===t?{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}:t,a=t.skipUpdateAttribute,e=t.skipParse,o=t.forceUpdateGeometry,t=t.usedAttributes,s=o,l=Object.keys(r);l.forEach(function(t){var e=$r(t);a||(n.attributes[e]=r[t]),!s&&null!=(t=Wl[e])&&t.l&&(s=!0)}),e||l.forEach(function(t){n.computedStyle[t]=i.parseProperty(t,n.attributes[t],n)}),null!=t&&t.length&&(l=Array.from(new Set(l.concat(t)))),["path","points","text","textTransform","anchor","transform","transformOrigin"].forEach(function(t){var e=l.indexOf(t);-1<e&&(l.splice(e,1),l.push(t))}),l.forEach(function(t){t in n.computedStyle&&(n.parsedStyle[t]=i.computeProperty(t,n.computedStyle[t],n))}),s&&this.updateGeometry(n),l.forEach(function(t){t in n.parsedStyle&&i.postProcessProperty(t,n)}),n.children.length&&l.forEach(function(e){e in n.parsedStyle&&i.isPropertyInheritable(e)&&n.children.forEach(function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})})})},e.parseProperty=function(t,e,n){var r,t=Wl[t],i=e;return"unset"===(e=""!==e&&!_(e)?e:"unset")||"initial"===e||"inherit"===e?i=zi(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=zi(e):t&&t.parser&&(i=t.parser(e,n))),i},e.computeProperty=function(t,e,n){var r=Wl[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof _i){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))_(r)||(e=this.parseProperty(t,Ur(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),_(s)?void this.addUnresolveProperty(n,t):s}i=o&&this.getPropertySyntax(o);a=i&&i.calculator?(r=n.parsedStyle[t],i.calculator(t,r,e,n,this)):e instanceof _i?e.value:e}return a},e.postProcessProperty=function(t,e){var t=Wl[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e)},e.addUnresolveProperty=function(t,e){var n=Yl.get(t);n||(Yl.set(t,[]),n=Yl.get(t)),-1===n.indexOf(e)&&n.push(e)},e.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=Yl.get(t);return!t||0===t.length||t.includes(e)}(t.parentElement,e)))return"unset"===(n=t.parentElement.parsedStyle[e])||"initial"===n||"inherit"===n?void 0:n},e.recalc=function(e){var n,t=Yl.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),Yl.delete(e))},e.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,y,m,v=O.geometryUpdaterFactory[t.nodeName];v&&((s=t.geometry).contentBounds||(s.contentBounds=new Br),s.renderBounds||(s.renderBounds=new Br),e=t.parsedStyle,d=(v=v.update(e,t)).width,f=v.height,p=void 0===(p=v.depth)?0:p,h=void 0===(h=v.offsetX)?0:h,m=void 0===(m=v.offsetY)?0:m,v=void 0===(v=v.offsetZ)?0:v,n=d<0,r=f<0,p=Gt(Vl,Math.abs(d)/2,Math.abs(f)/2,p/2),l=e.stroke,c=e.lineWidth,u=e.increasedLineWidthForHitTesting,y=e.shadowType,g=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,t.nodeName===E.TEXT&&delete e.anchor,d=Gt(Hl,(1-2*(o&&o[0]||0))*d/2+h,(1-2*(o&&o[1]||0))*f/2+m,(1-2*(o&&o[2]||0))*p[2]+v),s.contentBounds.update(d,p),h=t.nodeName===E.POLYLINE||t.nodeName===E.POLYGON||t.nodeName===E.PATH?Math.SQRT2:.5,l&&!l.isNone&&Wt(p,p,Gt(ql,f=((c||0)+(u||0))*h,f,0)),s.renderBounds.update(d,p),g&&y&&"inner"!==y&&(v=(m=s.renderBounds).min,l=m.max,c=e.shadowBlur||0,u=e.shadowOffsetX||0,h=e.shadowOffsetY||0,f=v[0]-c+u,d=l[0]+c+u,p=v[1]-c+h,g=l[1]+c+h,v[0]=Math.min(v[0],f),l[0]=Math.max(l[0],d),v[1]=Math.min(v[1],p),l[1]=Math.max(l[1],g),s.renderBounds.setMinMax(v,l)),i.forEach(function(t){var e,n,r,i,a,o=t.name,t=t.params;"blur"===o?(i=t[0].value,s.renderBounds.update(s.renderBounds.center,Wt(s.renderBounds.halfExtents,s.renderBounds.halfExtents,k(i,i,0)))):"drop-shadow"===o&&(i=t[0].value,o=t[1].value,t=t[2].value,e=(n=s.renderBounds).min,n=n.max,r=e[0]-t+i,i=n[0]+t+i,a=e[1]-t+o,t=n[1]+t+o,e[0]=Math.min(e[0],r),n[0]=Math.max(n[0],i),e[1]=Math.min(e[1],a),n[1]=Math.max(n[1],t),s.renderBounds.setMinMax(e,n))}),o=e.anchor,y=(n?-1:1)*ba(a[0],0,t),m=(r?-1:1)*ba(a[1],1,t),y-=(n?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,m-=(r?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(y,m),O.sceneGraphService.dirtifyToRoot(t))},e.isPropertyInheritable=function(t){t=Wl[t];return!!t&&t.inh},t}();(o=Tl=Tl||{})[o.ORBITING=0]="ORBITING",o[o.EXPLORING=1]="EXPLORING",o[o.TRACKING=2]="TRACKING",(o=Pl=Pl||{})[o.DEFAULT=0]="DEFAULT",o[o.ROTATIONAL=1]="ROTATIONAL",o[o.TRANSLATIONAL=2]="TRANSLATIONAL",o[o.CINEMATIC=3]="CINEMATIC",(o=Ll=Ll||{})[o.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",o[o.PERSPECTIVE=1]="PERSPECTIVE";var Ul,Xl="updated",o=function(){function t(){this.canvas=void 0,this.eventEmitter=new Ir,this.matrix=ht(),this.right=k(1,0,0),this.up=k(0,1,0),this.forward=k(0,0,1),this.position=k(0,0,1),this.focalPoint=k(0,0,0),this.distanceVector=k(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=ht(),this.projectionMatrixInverse=ht(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=Tl.EXPLORING,this.trackingMode=Pl.DEFAULT,this.projectionMode=Ll.PERSPECTIVE,this.frustum=new zr,this.orthoMatrix=ht()}var e=t.prototype;return e.isOrtho=function(){return this.projectionMode===Ll.ORTHOGRAPHIC},e.getProjectionMode=function(){return this.projectionMode},e.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.getFrustum=function(){return this.frustum},e.getPosition=function(){return this.position},e.getFocalPoint=function(){return this.focalPoint},e.getDollyingStep=function(){return this.dollyingStep},e.getNear=function(){return this.near},e.getFar=function(){return this.far},e.getZoom=function(){return this.zoom},e.getOrthoMatrix=function(){return this.orthoMatrix},e.getView=function(){return this.view},e.setEnableUpdate=function(t){this.enableUpdate=t},e.setType=function(t,e){return this.type=t,this.type===Tl.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Tl.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},e.setProjectionMode=function(t){return this.projectionMode=t,this},e.setTrackingMode=function(t){if(this.type!==Tl.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.getViewTransform=function(){return mt(ht(),this.matrix)},e.getWorldTransform=function(){return this.matrix},e.jitterProjectionMatrix=function(t,e){t=Mt(ht(),[t,e,0]);this.jitteredProjectionMatrix=bt(ht(),t,this.projectionMatrix)},e.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.setMatrix=function(t){return this.matrix=t,this._update(),this},e.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.setNear=function(t){return this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.setFar=function(t){return this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.setViewOffset=function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.setZoom=function(t){return this.zoom=t,this.projectionMode===Ll.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ll.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,n=n.y,i=this.roll,t=(this.rotate(0,0,-i),this.setPosition(r,n),this.setFocalPoint(r,n),this.setZoom(t),this.rotate(0,0,i),this.canvas.viewport2Canvas({x:e[0],y:e[1]})),i=k(t.x-r,t.y-n,0),e=qt(i,this.right)/Dt(this.right),r=qt(i,this.up)/Dt(this.up);return this.pan(-e,-r),this},e.setPerspective=function(t,e,n,r){this.projectionMode=Ll.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,n=this.near*Math.tan(hs(.5*this.fov))/this.zoom,e=2*n,r=this.aspect*e,l=-.5*r;return null!=(i=this.view)&&i.enabled&&(i=this.view.fullWidth,a=this.view.fullHeight,l+=this.view.offsetX*r/i,n-=this.view.offsetY*e/a,r*=this.view.width/i,e*=this.view.height/a),i=this.projectionMatrix,l=(a=l)+r,n=(r=n)-e,e=this.far,o=2*t/(r-n),s=(l+a)/(l-a),r=(r+n)/(r-n),n=-(e+t)/(e-t),e=-2*e*t/(e-t),i[0]=2*t/(l-a),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=s,i[9]=r,i[10]=n,i[11]=-1,i[12]=0,i[13]=0,i[14]=e,i[15]=0,wt(this.projectionMatrix,this.projectionMatrix,k(1,-1,1)),mt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Ll.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var o,e=(this.rright-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.rright+this.left)/2,r=(this.top+this.bottom)/2,s=n-e,n=n+e,e=r+t,r=r-t;return null!=(t=this.view)&&t.enabled&&(t=(this.rright-this.left)/this.view.fullWidth/this.zoom,o=(this.top-this.bottom)/this.view.fullHeight/this.zoom,n=(s+=t*this.view.offsetX)+t*this.view.width,r=(e-=o*this.view.offsetY)-o*this.view.height),jt(this.projectionMatrix,s,n,r,e,i,a),wt(this.projectionMatrix,this.projectionMatrix,k(1,-1,1)),mt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.setPosition=function(t,e,n){t=us(t,e=void 0===e?this.position[1]:e,n=void 0===n?this.position[2]:n);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=k(0,1,0);return this.focalPoint=us(t,e,n),this.trackingMode===Pl.CINEMATIC&&(t=(r=Yt(m(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Dt(r),e=fs(Math.asin(e/r)),r=90+fs(Math.atan2(n,t)),Et(n=ht(),n,hs(r)),kt(n,n,hs(e)),i=$t(m(),[0,1,0],n)),mt(this.matrix,Rt(ht(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.getDistance=function(){return this.distance},e.getDistanceVector=function(){return this.distanceVector},e.setDistance=function(t){var e,n,r;return this.distance===t||t<0||(this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100,e=m(),t=this.distance,n=this.forward,r=this.focalPoint,e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate()),this},e.setMaxDistance=function(t){return this.maxDistance=t,this},e.setMinDistance=function(t){return this.minDistance=t,this},e.setAzimuth=function(t){return this.azimuth=cs(t),this.computeMatrix(),this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getAzimuth=function(){return this.azimuth},e.setElevation=function(t){return this.elevation=cs(t),this.computeMatrix(),this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getElevation=function(){return this.elevation},e.setRoll=function(t){return this.roll=cs(t),this.computeMatrix(),this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getRoll=function(){return this.roll},e._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.computeMatrix=function(){var t=ie(re(),[0,0,1],hs(this.roll)),e=(gt(this.matrix),ie(re(),[1,0,0],hs((this.rotateWorld&&this.type!==Tl.TRACKING||this.type===Tl.TRACKING?1:-1)*this.elevation))),n=ie(re(),[0,1,0],hs((this.rotateWorld&&this.type!==Tl.TRACKING||this.type===Tl.TRACKING?1:-1)*this.azimuth)),n=ae(re(),n,e),n=ae(re(),n,t),e=Lt(ht(),n);this.type===Tl.ORBITING||this.type===Tl.EXPLORING?(xt(this.matrix,this.matrix,this.focalPoint),bt(this.matrix,this.matrix,e),xt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Tl.TRACKING&&(xt(this.matrix,this.matrix,this.position),bt(this.matrix,this.matrix,e))},e._setPosition=function(t,e,n){this.position=us(t,e,n);t=this.matrix;t[12]=this.position[0],t[13]=this.position[1],t[14]=this.position[2],t[15]=1,this._getOrthoMatrix()},e._getAxes=function(){zt(this.right,us(ne(ee(),[1,0,0,0],this.matrix))),zt(this.up,us(ne(ee(),[0,1,0,0],this.matrix))),zt(this.forward,us(ne(ee(),[0,0,1,0],this.matrix))),Ht(this.right,this.right),Ht(this.up,this.up),Ht(this.forward,this.forward)},e._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Dt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===Tl.TRACKING||this.rotateWorld?(this.elevation=fs(Math.asin(e/r)),this.azimuth=fs(Math.atan2(-t,-n))):(this.elevation=-fs(Math.asin(e/r)),this.azimuth=-fs(Math.atan2(-t,-n)))},e._getPosition=function(){zt(this.position,us(ne(ee(),[0,0,0,1],this.matrix))),this._getDistance()},e._getFocalPoint=function(){var t,e;Kt(this.distanceVector,[0,0,-this.distance],(t=ct(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),Wt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e._getDistance=function(){this.distanceVector=Yt(m(),this.focalPoint,this.position),this.distance=Dt(this.distanceVector),this.dollyingStep=this.distance/100},e._getOrthoMatrix=function(){var t,e;this.projectionMode===Ll.ORTHOGRAPHIC&&(t=this.position,e=ie(re(),[0,0,1],-this.roll*Math.PI/180),Pt(this.orthoMatrix,e,k((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),k(this.zoom,this.zoom,1),t))},e.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=bt(ht(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(Xl))},e.rotate=function(t,e,n){throw new Error(ai)},e.pan=function(t,e){throw new Error(ai)},e.dolly=function(t){throw new Error(ai)},e.createLandmark=function(t,e){throw new Error(ai)},e.gotoLandmark=function(t,e){throw new Error(ai)},t}(),$l=function(){function t(){}return t.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}},t}(),l=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Kl=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,t=t.y2,i=Math.min(e,r),e=Math.max(e,r),r=Math.min(n,t);return{width:e-i,height:Math.max(n,t)-r}},t}(),Zl=function(){function t(){}return t.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}},t}(),Jl=function(){function t(){}return t.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,t.map(function(t){return t[0]})),n=Math.max.apply(Math,t.map(function(t){return t[0]})),r=Math.min.apply(Math,t.map(function(t){return t[1]}));return{width:n-e,height:Math.max.apply(Math,t.map(function(t){return t[1]}))-r}},t}(),Ql=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,r=void 0===r?0:r,i=void 0===i?0:i;return n&&!hn(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}},t}(),tc=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,a=t.fontSize,o=t.fontStyle,s=t.fontWeight,l=t.fontVariant,t=t.lineWidth;return n&&a&&o&&s&&l&&r&&i&&!_(t)},e.update=function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,l=t.dx,c=t.dy,u=((null==e||null==(u=e.ownerDocument)||null==(u=u.defaultView)?void 0:u.getConfig())||{}).offscreenCanvas;return this.isReadyToMeasure(t,e)?(e=this.globalRuntime.textService.measureText(i,t,u),i=(t.metrics=e).width,u=e.height,n=e.lineHeight,e=e.fontProperties,i=[i/2,u/2,0],u=[0,1],r=0,"center"===a||"middle"===a?(r=o/2,u=[.5,1]):"right"!==a&&"end"!==a||(r=o,u=[1,1]),a=0,"middle"===s?a=i[1]:"top"===s||"hanging"===s?a=2*i[1]:"alphabetic"===s?a=n-e.ascent:"bottom"!==s&&"ideographic"!==s||(a=0),l&&(r+=l),c&&(a+=c),t.anchor=[u[0],u[1],0],{width:2*i[0],height:2*i[1],offsetX:r,offsetY:a}):(t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0})},t}(),ec=function(){function t(t,e){var f=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new Ir,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=ht(),this.tmpVec3=m(),this.onPointerDown=function(){var e=ci(M().mark(function t(e){var n,r;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.createPointerEvent(e);case 2:n=t.sent,f.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType?f.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(r=2===n.button,f.dispatchEvent(n,r?"rightdown":"mousedown")),f.trackingData(e.pointerId).pressTargetsByButton[e.button]=n.composedPath(),f.freeEvent(n);case 8:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerUp=function(){var e=ci(M().mark(function t(e){var n,r,i,a,o,s,l;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=performance.now(),t.next=3,f.createPointerEvent(e);case 3:if(r=t.sent,f.dispatchEvent(r,"pointerup"),"touch"===r.pointerType?f.dispatchEvent(r,"touchend"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||(i=2===r.button,f.dispatchEvent(r,i?"rightup":"mouseup")),i=f.trackingData(e.pointerId),s=f.findMountedTarget(i.pressTargetsByButton[e.button]),(l=s)&&!r.composedPath().includes(s)){for(a=s;a&&!r.composedPath().includes(a);)r.currentTarget=a,f.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?f.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||(o=2===r.button,f.notifyTarget(r,o?"rightupoutside":"mouseupoutside")),xo.isNode(a)&&(a=a.parentNode);delete i.pressTargetsByButton[e.button],l=a}l&&((s=f.clonePointerEvent(r,"click")).target=l,s.path=[],i.clicksByButton[e.button]||(i.clicksByButton[e.button]={clickCount:0,target:s.target,timeStamp:n}),(l=i.clicksByButton[e.button]).target===s.target&&n-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=s.target,l.timeStamp=n,s.detail=l.clickCount,null!=(l=r.detail)&&l.preventClick||("mouse"!==s.pointerType&&"touch"!==s.pointerType||f.dispatchEvent(s,"click"),f.dispatchEvent(s,"pointertap")),f.freeEvent(s)),f.freeEvent(r);case 12:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerMove=function(){var e=ci(M().mark(function t(e){var n,r,i,a,o,s,l,c,u,h;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.createPointerEvent(e);case 2:if(n=t.sent,r="mouse"===n.pointerType||"pen"===n.pointerType,i=f.trackingData(e.pointerId),a=f.findMountedTarget(i.overTargets),i.overTargets&&a!==n.target)return l="mousemove"===e.type?"mouseout":"pointerout",t.next=10,f.createPointerEvent(e,l,a||void 0);t.next=21;break;case 10:if(o=t.sent,f.dispatchEvent(o,"pointerout"),r&&f.dispatchEvent(o,"mouseout"),n.composedPath().includes(a)){t.next=20;break}return t.next=16,f.createPointerEvent(e,"pointerleave",a||void 0);case 16:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&!n.composedPath().includes(s.target);)s.currentTarget=s.target,f.notifyTarget(s),r&&f.notifyTarget(s,"mouseleave"),xo.isNode(s.target)&&(s.target=s.target.parentNode);f.freeEvent(s);case 20:f.freeEvent(o);case 21:if(a===n.target){t.next=36;break}l="mousemove"===e.type?"mouseover":"pointerover",c=f.clonePointerEvent(n,l),f.dispatchEvent(c,"pointerover"),r&&f.dispatchEvent(c,"mouseover"),u=a&&xo.isNode(a)&&a.parentNode;case 27:if(u&&u!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode)){if(u===n.target)return t.abrupt("break",33);t.next=30}else t.next=33;break;case 30:u=u.parentNode,t.next=27;break;case 33:if(!u||u===(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode)){for((h=f.clonePointerEvent(n,"pointerenter")).eventPhase=h.AT_TARGET;h.target&&h.target!==a&&h.target!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode);)h.currentTarget=h.target,f.notifyTarget(h),r&&f.notifyTarget(h,"mouseenter"),xo.isNode(h.target)&&(h.target=h.target.parentNode);f.freeEvent(h)}f.freeEvent(c);case 36:f.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&f.dispatchEvent(n,"touchmove"),r&&(f.dispatchEvent(n,"mousemove"),f.cursor=f.getCursor(n.target)),i.overTargets=n.composedPath(),f.freeEvent(n);case 41:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerOut=function(){var e=ci(M().mark(function t(e){var n,r,i,a,o;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((n=f.trackingData(e.pointerId)).overTargets)return r="mouse"===e.pointerType||"pen"===e.pointerType,i=f.findMountedTarget(n.overTargets),t.next=6,f.createPointerEvent(e,"pointerout",i||void 0);t.next=17;break;case 6:return a=t.sent,f.dispatchEvent(a),r&&f.dispatchEvent(a,"mouseout"),t.next=11,f.createPointerEvent(e,"pointerleave",i||void 0);case 11:for((o=t.sent).eventPhase=o.AT_TARGET;o.target&&o.target!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode);)o.currentTarget=o.target,f.notifyTarget(o),r&&f.notifyTarget(o,"mouseleave"),xo.isNode(o.target)&&(o.target=o.target.parentNode);n.overTargets=null,f.freeEvent(a),f.freeEvent(o);case 17:f.cursor=null;case 18:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerOver=function(){var e=ci(M().mark(function t(e){var n,r,i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.trackingData(e.pointerId),t.next=3,f.createPointerEvent(e);case 3:for(r=t.sent,i="mouse"===r.pointerType||"pen"===r.pointerType,f.dispatchEvent(r,"pointerover"),i&&f.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(f.cursor=f.getCursor(r.target)),(a=f.clonePointerEvent(r,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode);)a.currentTarget=a.target,f.notifyTarget(a),i&&f.notifyTarget(a,"mouseenter"),xo.isNode(a.target)&&(a.target=a.target.parentNode);n.overTargets=r.composedPath(),f.freeEvent(r),f.freeEvent(a);case 14:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var e=ci(M().mark(function t(e){var n,r,i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.trackingData(e.pointerId),r=f.findMountedTarget(n.pressTargetsByButton[e.button]),t.next=4,f.createPointerEvent(e);case 4:if(i=t.sent,r){for(a=r;a;)i.currentTarget=a,f.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||f.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),xo.isNode(a)&&(a=a.parentNode);delete n.pressTargetsByButton[e.button]}f.freeEvent(i);case 7:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onWheel=function(){var e=ci(M().mark(function t(e){var n;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.createWheelEvent(e);case 2:n=t.sent,f.dispatchEvent(n),f.freeEvent(n);case 5:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Gr(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Gr(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=bt(this.tmpMatrix,n,a),a=Gt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return $t(a,a,n),new Gr(a[0],a[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=bt(this.tmpMatrix,n,e),e=Gt(this.tmpVec3,t.x,t.y,0),t=($t(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new Gr((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})},e.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},e.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)xo.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},e.hitTest=function(){var e=ci(M().mark(function t(e){var n,r,i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.viewportX,r=e.viewportY,a=this.context.config,i=a.width,a=a.height,n<0||r<0||i<n||a<r)return t.abrupt("return",null);t.next=4;break;case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e=mi(this.globalRuntime.displayObjectPool.getHTMLs());!(n=e()).done;){var n=n.value;if(-1<t.nativeEvent.composedPath().indexOf(n))return n}return null},e.pickTarget=function(){var e=ci(M().mark(function t(e){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.createPointerEvent=function(){var r=ci(M().mark(function t(e,n,r){var i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=this.allocateEvent(To),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,a=this.getExistedHTML(i),null==r?t.next=11:(t.t0=r,t.next=20);break;case 11:if(t.t1=a,t.t1)t.next=19;else{if(t.t2=this.isNativeEventFromCanvas(i),t.t2)return t.next=17,this.pickTarget(i);t.next=18}break;case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}},t,this)}));return function(t,e,n){return r.apply(this,arguments)}}(),e.createWheelEvent=function(){var e=ci(M().mark(function t(e){var n,r;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Po),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0)t.next=15;else{if(t.t1=this.isNativeEventFromCanvas(n),t.t1)return t.next=13,this.pickTarget(n);t.next=14}break;case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(Po);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(To);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},e.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},e.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.notifyTarget=function(t,e){e=null!=(n=e)?n:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},e.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||xo.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=_o.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=xo.isNode(e)&&e.parentNode}},t}(),nc=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(!this.canvas){if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}this.canvas.width=10,this.canvas.height=10}return this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}(),rc=((ac=Ul=Ul||{})[ac.CAMERA_CHANGED=0]="CAMERA_CHANGED",ac[ac.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",ac[ac.NONE=2]="NONE",function(){function t(t,e){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new vo(w.RENDER_ORDER_CHANGED),this.hooks={init:new ml,dirtycheck:new El(["object"]),cull:new El(["object","camera"]),beginFrame:new wl([]),beforeRender:new wl(["objectToRender"]),render:new wl(["objectToRender"]),afterRender:new wl(["objectToRender"]),endFrame:new wl([]),destroy:new wl([]),pick:new bl(["result"]),pickSync:new El(["result"]),pointerDown:new wl(["event"]),pointerUp:new wl(["event"]),pointerMove:new wl(["event"]),pointerOut:new wl(["event"]),pointerOver:new wl(["event"]),pointerWheel:new wl(["event"]),pointerCancel:new wl(["event"])},this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){var t=ci(M().mark(function t(){var e;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=fi({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach(function(t){t.apply(e,O)}),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),e.getStats=function(){return this.stats},e.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Ul.CAMERA_CHANGED)},e.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach(function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)}),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},e.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable),i=!1;a.dirty&&(a.sorted=t.childNodes.slice().sort(Qr),a.dirty=!(i=!0)),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)}),i&&t.forEach(function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)})},e.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.dirtify=function(){this.context.renderingContext.renderReasons.add(Ul.DISPLAY_OBJECT_CHANGED)},t}()),ic=/\[\s*(.*)=(.*)\s*\]/,ac=function(){function t(){}var e=t.prototype;return e.selectOne=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.find(function(t){return-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.find(function(t){return t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.find(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):null):n.find(function(t){return n!==t&&t.nodeName===e})},e.selectAll=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.findAll(function(t){return n!==t&&-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.findAll(function(t){return n!==t&&t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.findAll(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):[]):n.findAll(function(t){return n!==t&&t.nodeName===e})},e.is=function(t,e){var n,r;return t.startsWith(".")?e.className===this.getIdOrClassname(t):t.startsWith("#")?e.id===this.getIdOrClassname(t):t.startsWith("[")?(n=(r=this.getAttribute(t)).name,r=r.value,"name"===n?e.name===r:this.attributeToString(e,n)===r):e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var t=t.match(ic),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},e.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!_(t))&&t.toString?t.toString():""},t}();function oc(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var sc,lc=function(){function t(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new vo(w.BOUNDS_CHANGED),this.rotate=(o=re(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(se(r=re(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),ce(o,a),oe(o,o),ae(r,o,r),ae(n.localRotation,r,i),he(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=re(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;se(i,e[0],e[1],e[2]),ue(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=re(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(se(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),ce(a,oe(re(),r)),ue(n.localRotation,n.localRotation,a),g.dirtifyLocal(t,n)):g.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Zt(e,m())||(i=r=e,a=n.localRotation,o=a[0],s=a[1],l=a[2],a=a[3],c=i[0],u=i[1],i=i[2],p=s*(d=o*u-s*c)-l*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,Wt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=ht(),s=m(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Zt(g.getPosition(t),s)||(zt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,dt(r,e.worldTransform),mt(r,r),$t(n.localPosition,s,r)):zt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=m(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Zt(n.localPosition,l)||(zt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=m(),u=m(),h=m(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Zt(e="number"==typeof e?Gt(u,e,n,r):e,c)||(Wt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=re();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=le(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),ce(o,n),oe(o,o),ae(a.localRotation,o,e),he(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=ht(),f=m(),d=le(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(Pt(t.localTransform,t.localRotation,t.localPosition,k(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=gt(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),bt(t.localTransform,t.localTransform,e)),e=Pt(n,d,f,t.localScale,t.origin),bt(t.localTransform,t.localTransform,e)):Pt(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)}),this.runtime=t}var e=t.prototype;return e.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},e.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},e.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},e.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,_(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);n=e.sortable,(null!=n&&null!=(e=n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(n.dirty=!0),e=t.transformable;e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t)},e.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(n=t.parentNode.sortable)&&null!=(r=n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(n.dirty=!0),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},e.getOrigin=function(t){return t.transformable.origin},e.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;Zt(e,n.origin)||((r=n.origin)[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n))},e.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;se(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},e.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=k(e[0],e[1],e[2]||1),n[0]=r[0]*e[0],n[1]=r[1]*e[1],n[2]=r[2]*e[2],this.dirtifyLocal(t,i)},e.setLocalScale=function(t,e){var n=t.transformable,e=k(e[0],e[1],e[2]||n.localScale[2]);Zt(e,n.localScale)||(zt(n.localScale,e),this.dirtifyLocal(t,n))},e.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=le(e,n,r,i));n=t.transformable;ce(n.localRotation,e),this.dirtifyLocal(t,n)},e.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=fe(e,n));var r,n=t.transformable;r=n.localSkew,e=e,r[0]=e[0],r[1]=e[1],this.dirtifyLocal(t,n)},e.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},e.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},e.triggerPendingEvents=function(){function r(t,e){t.isConnected&&!i.has(t.entity)&&(n.boundsChangedEvent.detail=e,(n.boundsChangedEvent.target=t).isMutationObserved?t.dispatchEvent(n.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0),i.add(t.entity))}var n=this,i=new Set;this.pendingEvents.forEach(function(t){var e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},e.clearPendingEvents=function(){this.pendingEvents=[]},e.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)oc(n),n=n.parentNode;e&&t.forEach(function(t){oc(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},e.updateDisplayObjectDependency=function(t,e,n,r){var i;e&&e!==n&&(e=this.displayObjectDependencyMap.get(e))&&e[t]&&(i=e[t].indexOf(r),e[t].splice(i,1)),n&&((e=this.displayObjectDependencyMap.get(n))||(this.displayObjectDependencyMap.set(n,{}),e=this.displayObjectDependencyMap.get(n)),e[t]||(e[t]=[]),e[t].push(r))},e.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){n.dirtifyToRoot(t,!0),t.dispatchEvent(new ko(w.ATTR_MODIFIED,t,n,n,e,ko.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},e.getPosition=function(t){var e=t.transformable;return _t(e.position,this.getWorldTransform(t,e))},e.getRotation=function(t){var e=t.transformable;return Tt(e.rotation,this.getWorldTransform(t,e))},e.getScale=function(t){var e=t.transformable;return At(e.scaling,this.getWorldTransform(t,e))},e.getWorldTransform=function(t,e){return((e=void 0===e?t.transformable:e).localDirtyFlag||e.dirtyFlag)&&(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e)),e.worldTransform},e.getLocalPosition=function(t){return t.transformable.localPosition},e.getLocalRotation=function(t){return t.transformable.localRotation},e.getLocalScale=function(t){return t.transformable.localScale},e.getLocalSkew=function(t){return t.transformable.localSkew},e.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},e.setLocalTransform=function(t,e){var n=_t(m(),e),r=Tt(re(),e),e=At(m(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},e.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},e.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return Br.isEmpty(e)?null:((n=n||new Br).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},e.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new Br},e.getBounds=function(t,e){var n,r,i=this,a=(void 0===e&&(e=!1),t.renderable);return a.boundsDirty||e||!a.bounds?!a.renderBoundsDirty&&e&&a.renderBounds?a.renderBounds:(n=e?a.renderBounds:a.bounds,r=this.getTransformedGeometryBounds(t,e,n),t.childNodes.forEach(function(t){t=i.getBounds(t,e);t&&(r?r.add(t):(r=n||new Br).update(t.center,t.halfExtents))}),e&&(t=ti(t))&&(t=t.style.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Br)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},e.getLocalBounds=function(t){if(t.parentNode){var e,n=ht(),r=(t.parentNode.transformable&&(n=mt(ht(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Br.isEmpty(r))return(e=new Br).setFromTransformedAABB(r,n),e}return this.getBounds(t)},e.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Br.isEmpty(i)||(r=new Br).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(i=t.ownerDocument)||null==(t=i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=r.getMin())[0],t=t[1],n=(r=r.getMax())[0],r=r[1],new Wr(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Wr((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},e.dirtifyWorldInternal=function(t,e){var n=this;!e.dirtyFlag&&(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach(function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}),e=t.renderable)&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)},e.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},e.sync=function(t,e){var n;e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag&&(n=(t=t.parentNode)&&t.transformable,null!==t&&n?bt(e.worldTransform,n.worldTransform,e.localTransform):dt(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},e.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),cc={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},uc=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,hc=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),fc=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),dc=function(){function t(t){var n=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!fc.exec(e)&&!hc.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=[].concat(t),r=n[n.length-2];return r?(e=r[r.length-1],n[n.length-2]=r.slice(0,-1),n[n.length-1]=e+n[n.length-1],n):t},this.runtime=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];for(var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),e=this.runtime.offscreenCanvas.getOrCreateContext(e),i=(e.font=t,cc.MetricsString+cc.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(cc.BaselineSymbol).width),s=cc.HeightMultiplier*o,o=o*cc.BaselineMultiplier|0,l=(r.width=a,r.height=s,e.fillStyle="#f00",e.fillRect(0,0,a,s),e.font=t,e.textBaseline="alphabetic",e.fillStyle="#000",e.fillText(i,0,o),e.getImageData(0,0,a||1,s||1).data),r=l.length,c=4*a,u=0,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(var p=0;p<c;p+=4)if(255!==l[h+p]){f=!0;break}if(f)break;h-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,l=e.textAlign,c=e.letterSpacing,u=e.textPath,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=dn(e)&&e+"px"||"16px",a=hn(n)?n.split(","):[n],o=a.length-1;0<=o;o--){var s=a[o].trim();!Ol.test(s)&&Ml.indexOf(s)<0&&(s='"'+s+'"'),a[o]=s}return r+" "+i+" "+t+" "+e+" "+a.join(",")}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvas.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),m=0;if(!u){for(var v=0;v<g.length;v++){var b=p.measureText(g[v]).width+(g[v].length-1)*c;y[v]=b,m=Math.max(m,b)}var r=m+o,x=a||d.fontSize+o,i=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-i/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-i:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:r,height:i,lines:g,lineWidths:y,lineHeight:x+=h,maxLineWidth:m,fontProperties:d,lineMetrics:y.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new Wr(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var k=0;k<g.length;k++)p.measureText(g[k]).width,g[k].length},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){for(var r=this,i=e.wordWrapWidth,i=void 0===i?0:i,a=e.letterSpacing,o=e.maxLines,s=void 0===o?1/0:o,o=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),c=i+a,u="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},y=Array.from(u).reduce(function(t,e){return t+g(e)},0),m=Array.from(t),v=0;v<m.length;v++){var b=m[v],x=t[v-1],w=t[v+1],k=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+k){if(s<=f+1){if(e.isOverflowing=!0,0<y&&y<=c){for(var E=h[f].length,M=0,O=E,S=0;S<E;S++){var _=g(h[f][S]);if(c<M+_+y){O=S;break}M+=_}h[f]=(h[f]||"").slice(0,O)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=k,h[f]=(h[f]||"")+b}}return h.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&0<=cc.BreakingSpaces.indexOf(t.charCodeAt(0))},e.isNewline=function(t){return"string"==typeof t&&0<=cc.Newlines.indexOf(t.charCodeAt(0))},e.trimToBreakable=function(t){var e,t=[].concat(t),n=t[t.length-2],r=this.findBreakableIndex(n);return-1!==r&&n&&(e=n.slice(r,r+1),e=r+(this.isBreakingSpace(e)?0:1),t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,e)),t},e.canBreakInLastChar=function(t){return!t||!uc.test(t)},e.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(t,e){if(n[e])return t+n[e];throw Error("cannot count the word without cache")},0)},e.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!uc.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];return"number"!=typeof i&&(e=t.length*e,i=r.measureText(t).width+e,n[t]=i),i},t}(),O={},$l=(Ql=new Ql,Jl=new Jl,(fw={})[E.CIRCLE]=new $l,fw[E.ELLIPSE]=new l,fw[E.RECT]=Ql,fw[E.IMAGE]=Ql,fw[E.GROUP]=Ql,fw[E.LINE]=new Kl,fw[E.TEXT]=new tc(O),fw[E.POLYLINE]=Jl,fw[E.POLYGON]=Jl,fw[E.PATH]=new Zl,fw[E.HTML]=null,fw[E.MESH]=null,fw),tc=(l=new r,Ql=new to,(Kl={})[i.PERCENTAGE]=null,Kl[i.NUMBER]=new ao,Kl[i.ANGLE]=new n,Kl[i.DEFINED_PATH]=new e,Kl[i.PAINT]=l,Kl[i.COLOR]=l,Kl[i.FILTER]=new Za,Kl[i.LENGTH]=Ql,Kl[i.LENGTH_PERCENTAGE]=Ql,Kl[i.LENGTH_PERCENTAGE_12]=new eo,Kl[i.LENGTH_PERCENTAGE_14]=new no,Kl[i.COORDINATE]=new ro,Kl[i.OFFSET_DISTANCE]=new oo,Kl[i.OPACITY_VALUE]=new so,Kl[i.PATH]=new lo,Kl[i.LIST_OF_POINTS]=new co,Kl[i.SHADOW_BLUR]=new uo,Kl[i.TEXT]=new a,Kl[i.TEXT_TRANSFORM]=new ho,Kl[i.TRANSFORM]=new fo,Kl[i.TRANSFORM_ORIGIN]=new Qa,Kl[i.Z_INDEX]=new po,Kl[i.MARKER]=new io,Kl),Jl=(O.CameraContribution=o,O.AnimationTimeline=null,O.EasingFunction=null,O.offscreenCanvas=new nc,O.displayObjectPool=new Ao,O.sceneGraphSelector=new ac,O.sceneGraphService=new lc(O),O.textService=new dc(O),O.geometryUpdaterFactory=$l,O.CSSPropertySyntaxFactory=tc,O.styleValueRegistry=new gl,O.layoutRegistry=null,O.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==N)return N;throw new Error("Unable to locate global `this`")}(),function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},t}()),Zl=function(){function t(t){this.plugins=[],this.config=void 0,this.config=fi({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},e.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),pc=function(){function a(t){this.strategies=void 0,this.strategies=t}return a.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(a.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new vo(w.CULLED)),null))}),e.hooks.afterRender.tap(a.tag,function(t){t.cullable.visibilityPlaneMask=-1})},a}(),gc=(pc.tag="Culling",function(){function n(){}return n.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(n.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},n}()),yc=(gc.tag="DirtyCheck",function(){function e(){var a=this;this.autoPreventDefault=!1,this.rootPointerEvent=new To(null),this.rootWheelEvent=new Po(null),this.context=void 0,this.onPointerMove=function(t){var e,n=null==(e=a.context.renderingContext.root)||null==(e=e.ownerDocument)?void 0:e.defaultView;if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var r=mi(a.normalizeToPointerEvent(t,n));!(i=r()).done;){var i=i.value,i=a.bootstrapEvent(a.rootPointerEvent,i,n);a.context.eventService.mapEvent(i)}a.setCursor(a.context.eventService.cursor)}}}var t=e.prototype;return t.apply=function(t){var a=this,t=(this.context=t).renderingService,o=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(){var e=ci(M().mark(function t(e){var n;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0});case 2:return n=t.sent,n=n.picked,t.abrupt("return",n[0]||null);case 5:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()),t.hooks.pointerWheel.tap(e.tag,function(t){t=a.normalizeWheelEvent(t);a.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(e.tag,function(t){if(!o.supportsTouchEvents||"touch"!==t.pointerType){var e=a.normalizeToPointerEvent(t,o);!a.autoPreventDefault||!e[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();for(var n=mi(e);!(r=n()).done;){var r=r.value,r=a.bootstrapEvent(a.rootPointerEvent,r,o);a.context.eventService.mapEvent(r)}a.setCursor(a.context.eventService.cursor)}}),t.hooks.pointerUp.tap(e.tag,function(t){if(!o.supportsTouchEvents||"touch"!==t.pointerType){var e=a.context.contextService.getDomElement(),n="outside";try{n=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}for(var r=mi(a.normalizeToPointerEvent(t,o));!(i=r()).done;){var i=i.value,i=a.bootstrapEvent(a.rootPointerEvent,i,o);i.type+=n,a.context.eventService.mapEvent(i)}a.setCursor(a.context.eventService.cursor)}}),t.hooks.pointerMove.tap(e.tag,this.onPointerMove),t.hooks.pointerOver.tap(e.tag,this.onPointerMove),t.hooks.pointerOut.tap(e.tag,this.onPointerMove)},t.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||_(n)||_(r)?(e=(i=this.context.eventService.client2Viewport(new Gr(i,t))).x,i.y):(e=n,r),{x:e,y:t}},t.bootstrapEvent=function(t,e,n){t.view=n,t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.getViewportXY(e),r=n.x,n=n.y,r=(t.viewport.x=r,t.viewport.y=n,this.context.eventService.viewport2Canvas(t.viewport)),n=r.x,r=r.y;return t.canvas.x=n,t.canvas.y=r,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=si[t.type]||t.type),t},t.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,this.getViewportXY(t)),r=n.x,n=n.y,r=(e.viewport.x=r,e.viewport.y=n,this.context.eventService.viewport2Canvas(e.viewport)),n=r.x,r=r.y;return e.canvas.x=n,e.canvas.y=r,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];mn(i.button)&&(i.button=0),mn(i.buttons)&&(i.buttons=1),mn(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),mn(i.width)&&(i.width=i.radiusX||1),mn(i.height)&&(i.height=i.radiusY||1),mn(i.tiltX)&&(i.tiltX=0),mn(i.tiltY)&&(i.tiltY=0),mn(i.pointerType)&&(i.pointerType="touch"),mn(i.pointerId)&&(i.pointerId=i.identifier||0),mn(i.pressure)&&(i.pressure=i.force||.5),mn(i.twist)&&(i.twist=0),mn(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(mn((e=t).isPrimary)&&(e.isPrimary=!0),mn(e.width)&&(e.width=1),mn(e.height)&&(e.height=1),mn(e.tiltX)&&(e.tiltX=0),mn(e.tiltY)&&(e.tiltY=0),mn(e.pointerType)&&(e.pointerType="mouse"),mn(e.pointerId)&&(e.pointerId=1),mn(e.pressure)&&(e.pressure=.5),mn(e.twist)&&(e.twist=0),mn(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},e}()),mc=(yc.tag="Event",[E.CIRCLE,E.ELLIPSE,E.IMAGE,E.RECT,E.LINE,E.POLYLINE,E.POLYGON,E.TEXT,E.PATH,E.HTML]),vc=function(){function t(){}var e=t.prototype;return e.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Br.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=e.parentNode)||null==(r=r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||Fr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Fr.OUTSIDE,i.visible))},e.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Fr.OUTSIDE||n===Fr.INSIDE)return n;for(var i=Fr.INSIDE,a=-1<mc.indexOf(t.nodeName),o=0,s=r.length;o<s;++o){var l=1<<o;if(0!=(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,c=c.distance;if(qt(u,e.getPositiveFarPoint(r[o]))+c<0)return Fr.OUTSIDE;qt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},t}(),bc=function(){function c(){this.rBush=void 0,this.toSync=new Set}var t=c.prototype;return t.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,O.styleValueRegistry.recalc(t),O.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),O.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tapPromise(c.tag,ci(M().mark(function t(){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:l.addEventListener(w.MOUNTED,r),l.addEventListener(w.UNMOUNTED,i),l.addEventListener(w.ATTR_MODIFIED,e),l.addEventListener(w.BOUNDS_CHANGED,n);case 4:case"end":return t.stop()}},t)}))),o.hooks.destroy.tap(c.tag,function(){l.removeEventListener(w.MOUNTED,r),l.removeEventListener(w.UNMOUNTED,i),l.removeEventListener(w.ATTR_MODIFIED,e),l.removeEventListener(w.BOUNDS_CHANGED,n)}),o.hooks.endFrame.tap(c.tag,function(){a.syncRTree()})},t.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=a.getMin())[0],n=n[1],r=(a=a.getMax())[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.id=t.entity,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},c}(),xc=(bc.tag="Prepare",(fw=sc=sc||{}).READY="ready",fw.BEFORE_RENDER="beforerender",fw.RERENDER="rerender",fw.AFTER_RENDER="afterrender",fw.BEFORE_DESTROY="beforedestroy",fw.AFTER_DESTROY="afterdestroy",fw.RESIZE="resize",fw.DIRTY_RECTANGLE="dirtyrectangle",new vo(w.MOUNTED)),wc=new vo(w.UNMOUNTED),kc=new vo(sc.BEFORE_RENDER),Ec=new vo(sc.RERENDER),Mc=new vo(sc.AFTER_RENDER),Oc=function(k){function t(t){var e=k.call(this)||this,n=(e.document=void 0,e.customElements=void 0,e.requestAnimationFrame=void 0,e.cancelAnimationFrame=void 0,e.devicePixelRatio=void 0,e.supportsPointerEvents=void 0,e.supportsTouchEvents=void 0,e.isTouchEvent=void 0,e.isMouseEvent=void 0,e.Element=Fo,e.frameId=void 0,e.inited=!1,e.readyPromise=void 0,e.resolveReadyPromise=void 0,e.context={},e.document=new wo,e.document.defaultView=gi(e),e.customElements=new go,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,y=t.supportsTouchEvents,m=t.supportsCSSTransform,v=t.isTouchEvent,t=t.isMouseEvent,b=(b=n,x=gi(e),b&&(b="string"==typeof b?b:b.id||Zr++,Kr[b]&&Kr[b].destroy(),Kr[b]=x),a),x=o,w=s;return r&&(w=1<=(w=s||Jr&&window.devicePixelRatio||1)?Math.ceil(w):1,b=a||("auto"===(a=ei(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/w,x=o||("auto"===(a=ei(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/w),e.devicePixelRatio=w,e.requestAnimationFrame=null!=f?f:Dl.bind(O.globalThis),e.cancelAnimationFrame=null!=d?d:zl.bind(O.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in O.globalThis,e.supportsPointerEvents=null!=g?g:!!O.globalThis.PointerEvent,e.isTouchEvent=null!=v?v:function(t){return e.supportsTouchEvents&&t instanceof O.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!O.globalThis.MouseEvent||t instanceof O.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof O.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:b,height:x,renderer:l,offscreenCanvas:i,devicePixelRatio:w,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:m}),e.initDefaultCamera(b,x),ci(M().mark(function t(){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.initRenderer(l);case 2:e.dispatchEvent(new vo(sc.READY)),e.readyPromise&&e.resolveReadyPromise();case 4:case"end":return t.stop()}},t)}))(),e}s(t,k);var e=t.prototype;return e.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.initDefaultCamera=function(t,e){var n=this,r=new O.CameraContribution;r.setType(Tl.EXPLORING,Pl.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(Xl,function(){n.context.renderingContext.renderReasons.add(Ul.CAMERA_CHANGED)}),this.context.camera=r},e.getConfig=function(){return this.context.config},e.getRoot=function(){return this.document.documentElement},e.getCamera=function(){return this.context.camera},e.getContextService=function(){return this.context.contextService},e.getEventService=function(){return this.context.eventService},e.getRenderingService=function(){return this.context.renderingService},e.getRenderingContext=function(){return this.context.renderingContext},e.getStats=function(){return this.getRenderingService().getStats()},e.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new vo(sc.BEFORE_DESTROY)),this.frameId&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new vo(sc.AFTER_DESTROY))},e.changeSize=function(t,e){this.resize(t,e)},e.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===Ll.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new vo(sc.RESIZE,{width:t,height:e}))},e.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.removeChildren=function(){this.document.documentElement.removeChildren()},e.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.render=function(){var t=this;this.dispatchEvent(kc),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(Ec)}),this.dispatchEvent(Mc)},e.run=function(){var e=this;(function t(){e.render(),e.frameId=requestAnimationFrame(t)})()},e.initRenderer=function(){var e=ci(M().mark(function t(e){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Z,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new yc,new bc,new gc,new pc([new vc])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(fi({},O,this.context)),this.context.renderingService=new rc(O,this.context),this.context.eventService=new ec(O,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(O)})},e.setRenderer=function(){var e=ci(M().mark(function t(e){var n,r;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer===e)return t.abrupt("return");t.next=3;break;case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach(function(t){t.destroy(O)}),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(wc):(wc.target=t,this.dispatchEvent(wc,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(xc):(xc.target=t,this.dispatchEvent(xc,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach(function(t){e.mountChildren(t)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},hi(t,[{key:"ready",get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),t}(bo);function Sc(t,e){return(Sc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}r=function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).landmarks=[],t.landmarkAnimationID=void 0,t}t=i,(n=e).prototype=Object.create(t.prototype),Sc(n.prototype.constructor=n,t);var n=e.prototype;return n.rotate=function(t,e,n){if(this.relElevation=cs(e),this.relAzimuth=cs(t),this.relRoll=cs(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Tl.EXPLORING){e=ie(re(),[1,0,0],hs((this.rotateWorld?1:-1)*this.relElevation)),t=ie(re(),[0,1,0],hs((this.rotateWorld?1:-1)*this.relAzimuth)),n=ie(re(),[0,0,1],hs(this.relRoll)),t=ae(re(),t,e),t=ae(re(),t,n),e=Lt(ht(),t);xt(this.matrix,this.matrix,[0,0,-this.distance]),bt(this.matrix,this.matrix,e),xt(this.matrix,this.matrix,[0,0,this.distance])}else{if(90<Math.abs(this.elevation))return this;this.computeMatrix()}return this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this._update(),this},n.pan=function(t,e){t=us(t,e,0),e=Bt(this.position);return Wt(e,e,Vt(m(),this.right,t[0])),Wt(e,e,Vt(m(),this.up,t[1])),this._setPosition(e),this.triggerUpdate(),this},n.dolly=function(t){var e=this.forward,n=Bt(this.position),t=(this.dollyingStep,this.distance+t*this.dollyingStep),t=Math.max(Math.min(t,this.maxDistance),this.minDistance)-this.distance;return n[0]+=t*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getDistance():this.type===Tl.TRACKING&&Wt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},n.createLandmark=function(t,e){var e=e=void 0===e?{}:e,n=e.position,n=void 0===n?this.position:n,r=e.focalPoint,r=void 0===r?this.focalPoint:r,i=e.roll,e=e.zoom,a=new O.CameraContribution,n=(a.setType(this.type,void 0),a.setPosition(n[0],n[1]||this.position[1],n[2]||this.position[2]),a.setFocalPoint(r[0],r[1]||this.focalPoint[1],r[2]||this.focalPoint[2]),a.setRoll(i||this.roll),a.setZoom(e||this.zoom),{name:t,matrix:ft(a.getWorldTransform()),right:Bt(a.right),up:Bt(a.up),forward:Bt(a.forward),position:Bt(a.getPosition()),focalPoint:Bt(a.getFocalPoint()),distanceVector:Bt(a.getDistanceVector()),distance:a.getDistance(),dollyingStep:a.getDollyingStep(),azimuth:a.getAzimuth(),elevation:a.getElevation(),roll:a.getRoll(),relAzimuth:a.relAzimuth,relElevation:a.relElevation,relRoll:a.relRoll,zoom:a.getZoom()});return this.landmarks.push(n),n},n.gotoLandmark=function(e,t){var n,s,r,i,l,c,u,h,f,d,p,g,y=this,a=(void 0===t&&(t={}),hn(e)?this.landmarks.find(function(t){return t.name===e}):e);a&&(n=void 0===(n=(t=dn(t)?{duration:t}:t).easing)?"linear":n,r=t.duration,s=void 0===r?100:r,r=void 0===(r=t.easingFunction)?void 0:r,t=t.onfinish,i=void 0===t?void 0:t,l=.01,0===s?(this.syncFromLandmark(a),i&&i()):(void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID),c=a.position,u=a.focalPoint,h=a.zoom,f=a.roll,d=r||O.EasingFunction(n),g=function(){y.setFocalPoint(u),y.setPosition(c),y.setRoll(f),y.setZoom(h),y.computeMatrix(),y.triggerUpdate(),i&&i()},this.canvas.requestAnimationFrame(function t(e){var n,r,i,a,o,e=e-(p=void 0===p?e:p);s<e||(n=d(e/s),r=m(),i=m(),a=1,o=0,Xt(r,y.focalPoint,u,n),Xt(i,y.position,c,n),o=y.roll*(1-n)+f*n,a=y.zoom*(1-n)+h*n,y.setFocalPoint(r),y.setPosition(i),y.setRoll(o),y.setZoom(a),Qt(r,u)+Qt(i,c)<=l)?g():(y.computeMatrix(),y.triggerUpdate(),e<s&&(y.landmarkAnimationID=y.canvas.requestAnimationFrame(t)))})))},n.syncFromLandmark=function(t){this.matrix=dt(this.matrix,t.matrix),this.right=zt(this.right,t.right),this.up=zt(this.up,t.up),this.forward=zt(this.forward,t.forward),this.position=zt(this.position,t.position),this.focalPoint=zt(this.focalPoint,t.focalPoint),this.distanceVector=zt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(o);function _c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(r.key),r)}}function Ac(t,e,n){e&&_c(t.prototype,e),n&&_c(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function Tc(t,e){return(Tc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}O.CameraContribution=r;function Pc(b,e,x,n){if(!(0<=b&&b<=1&&0<=x&&x<=1))throw new Error("bezier x values must be in [0, 1] range");if(b===e&&x===n)return function(t){return t};for(var w=new(tu?Float32Array:Array)(11),t=0;t<11;++t)w[t]=iu(.1*t,b,x);function r(t){for(var e=0,n=1;10!==n&&w[n]<=t;++n)e+=.1;var r=e+.1*((t-w[--n])/(w[n+1]-w[n])),i=au(r,b,x);if(.001<=i){for(var a=t,o=r,s=b,l=x,c=0;c<Zc;++c){var u=au(o,s,l);if(0===u)return o;o-=(iu(o,s,l)-a)/u}return o}if(0===i)return r;for(var h,f,d=t,p=e,g=e+.1,y=b,m=x,v=0;0<(h=iu(f=p+(g-p)/2,y,m)-d)?g=f:p=f,Math.abs(h)>Jc&&++v<Qc;);return f}return function(t){return 0===t||1===t?t:iu(r(t),e,n)}}function Lc(t){return Math.pow(t,2)}function Cc(t){return Math.pow(t,3)}function Nc(t){return Math.pow(t,4)}function jc(t){return Math.pow(t,5)}function Rc(t){return Math.pow(t,6)}function Fc(t){return 1-Math.cos(t*Math.PI/2)}function Ic(t){return 1-Math.sqrt(1-t*t)}function Bc(t){return t*t*(3*t-2)}function Dc(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}function zc(t,e){var n=(e=e=void 0===e?[]:e)[0],e=void 0===(e=e[1])?.5:e,n=fn(Number(void 0===n?1:n),1,10),e=fn(Number(e),.1,2);return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-e/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/e)}function Gc(t,e,n){var r=(e=e=void 0===e?[]:e)[0],i=void 0===(i=e[1])?100:i,a=void 0===(a=e[2])?10:a,e=void 0===(e=e[3])?0:e,r=fn(void 0===r?1:r,.1,1e3),i=fn(i,.1,1e3),a=fn(a,.1,1e3),e=fn(e,.1,1e3),o=Math.sqrt(i/r),i=(a=a/(2*Math.sqrt(i*r)))<1?o*Math.sqrt(1-a*a):0,r=a<1?(a*o-e)/i:-e+o,e=n?n*t/1e3:t,e=a<1?Math.exp(-e*a*o)*(+Math.cos(i*e)+r*Math.sin(i*e)):(1+r*e)*Math.exp(-e*o);return 0===t||1===t?t:1-e}function Wc(t,e){var e=e=void 0===e?[]:e,n=void 0===(n=e[0])?10:n;return("start"==e[1]?Math.ceil:Math.floor)(fn(t,0,1)*n)/n}function Yc(t,e){var n=(e=e=void 0===e?[]:e)[0],r=e[1],i=e[2],e=e[3];return Pc(n,r,i,e)(t)}function Vc(r){return function(t,e,n){return 1-r(1-t,e=void 0===e?[]:e,n)}}function Hc(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?r(2*t,e,n)/2:1-r(-2*t+2,e,n)/2}}function qc(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?(1-r(1-2*t,e,n))/2:(r(2*t-1,e,n)+1)/2}}function Uc(t){return t}var Xc=function(i){var t,e;function n(t,e,n,r){t=i.call(this,t)||this;return t.currentTime=void 0,t.timelineTime=void 0,t.currentTime=n,t.timelineTime=r,t.target=e,t.type="finish",t.bubbles=!1,t.currentTarget=e,t.defaultPrevented=!1,t.eventPhase=t.AT_TARGET,t.timeStamp=Date.now(),t.currentTime=n,t.timelineTime=r,t}return e=i,(t=n).prototype=Object.create(e.prototype),Tc(t.prototype.constructor=t,e),n}(mo),$c=0,Kc=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,((this.effect=t).animation=this).timeline=e,this.id=""+$c++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null==(t=this.effect)?void 0:t.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=0<this._playbackRate?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null==(t=this.effect)?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(0<=this.playbackRate)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},e.persist=function(){throw new Error(ai)},e.addEventListener=function(t,e,n){throw new Error(ai)},e.removeEventListener=function(t,e,n){throw new Error(ai)},e.dispatchEvent=function(t){throw new Error(ai)},e.commitStyles=function(){throw new Error(ai)},e.ensureAlive=function(){var t;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null==(t=this.effect)||!t.update(-1)):this._inEffect=!(null==(t=this.effect)||!t.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=0<this._playbackRate?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e,n=this;this._isFinished?this._finishedFlag||(this.onfinish&&(e=new Xc(null,this,this.currentTime,t),setTimeout(function(){n.onfinish&&n.onfinish(e)})),this._finishedFlag=!0):(this.onframe&&"running"===this.playState&&(t=new Xc(null,this,this.currentTime,t),this.onframe(t)),this._finishedFlag=!1)},Ac(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var n=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){n.resolveReadyPromise=function(){t(n)},n.rejectReadyPromise=function(){e(new Error)}}),this.pending)||this.resolveReadyPromise(),this.readyPromise}},{key:"finished",get:function(){var n=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){n.resolveFinishedPromise=function(){t(n)},n.rejectFinishedPromise=function(){e(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null==(e=this.timeline)?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))}},{key:"startTime",get:function(){return this._startTime},set:function(t){null!==t&&(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle||(this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()))}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){var e;t!==this._playbackRate&&(this.updatePromises(),e=this.currentTime,this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises())}},{key:"_isFinished",get:function(){return!this._idle&&(0<this._playbackRate&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}(),Zc=4,Jc=1e-7,Qc=10,tu="function"==typeof Float32Array,eu=function(t,e){return 1-3*e+3*t},nu=function(t,e){return 3*e-6*t},ru=function(t){return 3*t},iu=function(t,e,n){return((eu(e,n)*t+nu(e,n))*t+ru(e))*t},au=function(t,e,n){return 3*eu(e,n)*t*t+2*nu(e,n)*t+ru(e)},to=Pc(.42,0,1,1),ou={steps:Wc,"step-start":function(t){return Wc(t,[1,"start"])},"step-end":function(t){return Wc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Yc,ease:function(t){return Yc(t,[.25,.1,.25,1])},in:to,out:Vc(to),"in-out":Hc(to),"out-in":qc(to),"in-quad":Lc,"out-quad":Vc(Lc),"in-out-quad":Hc(Lc),"out-in-quad":qc(Lc),"in-cubic":Cc,"out-cubic":Vc(Cc),"in-out-cubic":Hc(Cc),"out-in-cubic":qc(Cc),"in-quart":Nc,"out-quart":Vc(Nc),"in-out-quart":Hc(Nc),"out-in-quart":qc(Nc),"in-quint":jc,"out-quint":Vc(jc),"in-out-quint":Hc(jc),"out-in-quint":qc(jc),"in-expo":Rc,"out-expo":Vc(Rc),"in-out-expo":Hc(Rc),"out-in-expo":qc(Rc),"in-sine":Fc,"out-sine":Vc(Fc),"in-out-sine":Hc(Fc),"out-in-sine":qc(Fc),"in-circ":Ic,"out-circ":Vc(Ic),"in-out-circ":Hc(Ic),"out-in-circ":qc(Ic),"in-back":Bc,"out-back":Vc(Bc),"in-out-back":Hc(Bc),"out-in-back":qc(Bc),"in-bounce":Dc,"out-bounce":Vc(Dc),"in-out-bounce":Hc(Dc),"out-in-bounce":qc(Dc),"in-elastic":zc,"out-elastic":Vc(zc),"in-out-elastic":Hc(zc),"out-in-elastic":qc(zc),spring:Gc,"spring-in":Gc,"spring-out":Vc(Gc),"spring-in-out":Hc(Gc),"spring-out-in":qc(Gc)},su=function(t){return("-"===(t=(t=t).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()};function lu(n,r){return function(t){var e;return 1<=t?1:(t+=r*(e=1/n))-t%e}}var ao="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",cu=new RegExp("cubic-bezier\\("+ao+","+ao+","+ao+","+ao+"\\)"),uu=/steps\(\s*(\d+)\s*\)/,hu=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function fu(t){var e=cu.exec(t);return e?Pc.apply(void 0,e.slice(1).map(Number)):(e=uu.exec(t))?lu(Number(e[1]),0):(e=hu.exec(t))?lu(Number(e[1]),{start:1,middle:.5,end:0}[e[2]]):ou[su(t)]||ou.linear}function du(t){return Math.abs((0!==(e=t).duration&&0!==e.iterations?("auto"===e.duration?0:Number(e.duration))*(null!=(e=e.iterations)?e:1):0)/(t.playbackRate||1));var e}var pu=0,gu=1,yu=2,mu=3;function vu(t,e,n){c=t,i=n;var r,i,a,o,s,l=null===(l=e)?pu:(r=i.endTime,l<Math.min(i.delay,r)?gu:l>=Math.min(i.delay+c+i.endDelay,r)?yu:mu),c=function(t,e,n,r,i){switch(r){case gu:return"backwards"===e||"both"===e?0:null;case mu:return n-i;case yu:return"forwards"===e||"both"===e?t:null;case pu:return null}}(t,n.fill,e,l,n.delay);return null===c?null:(i="auto"===n.duration?0:n.duration,r=i,t=l,e=n.iterations,o=c,s=n.iterationStart,0===r?t!==gu&&(s+=e):s+=o/r,e=t=s,o=n.iterationStart,s=l,a=n.iterations,c=c,i=i,e=o=0!==(o=e===1/0?o%1:e%1)||s!==yu||0===a||0===c&&0!==i?o:1,s=n.iterations,a=e,c=t,i=l===yu&&s===1/0?1/0:1===a?Math.floor(c)-1:Math.floor(c),o=n.direction,t=i,l=e,a="normal"===(s="normal"!==(s=o)&&"reverse"!==o&&(t=t,"alternate-reverse"===o&&(t+=1),s="normal",t!==1/0)&&t%2!=0?"reverse":s)?l:1-l,n.currentIteration=i,n.progress=a,n.easingFunction(a))}function bu(t,e,n){var a=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r]){var a;xu(i)&&(a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:fu(t[r].easing)||e.easingFunction,value:t[r][i]},n[i]=n[i]||[],n[i].push(a))}return n}(t,e),o=function(t,e){var n,r=[];for(n in t)for(var i=t[n],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,h=c;0===a&&(u=-1/0,0===c)&&(s=o),a===i.length-2&&(h=1/0,1===l)&&(o=s),r.push({applyFrom:u,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:n,interpolation:function(t,e,n,r){var i=Wl[t];if(i&&i.syntax&&i.int){i=O.styleValueRegistry.getPropertySyntax(i.syntax);if(i){var a,o=O.styleValueRegistry.parseProperty(t,e,r),s=O.styleValueRegistry.parseProperty(t,n,r),o=O.styleValueRegistry.computeProperty(t,o,r),t=O.styleValueRegistry.computeProperty(t,s,r),s=i.mixer(o,t,r);if(s)return a=wu.apply(void 0,s),function(t){return 0===t?e:1===t?n:a(t)}}}return wu(!1,!0,function(t){return t?n:e})}(n,i[o].value,i[s].value,e)})}return r.sort(function(t,e){return t.startOffset-e.startOffset}),r}(a,n);return function(r,i){if(null!==i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(t){var e=i-t.startOffset,n=t.endOffset-t.startOffset,e=0==n?0:t.easingFunction(e/n);r.style[t.property]=t.interpolation(e)});else for(var t in a)xu(t)&&(r.style[t]=null)}}function xu(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var wu=function(e,n,r){return function(t){return r(function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)&&e.length===n.length){for(var i=[],a=0;a<e.length;a++)i.push(t(e[a],n[a],r));return i}throw new Error("Mismatched interpolation arguments "+e+":"+n)}(e,n,t))}};var ku=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Uc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return Ac(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=fu(t),this._easing=t}}]),t}();function Eu(t,i){if(null===t)return[];for(var e=(t=Array.isArray(t)?t:function(t){var e,n=[];for(e in t)if(!(e in["easing","offset","composite"]))for(var r,i=t[e],a=(i=Array.isArray(i)?i:[i]).length,o=0;o<a;o++)n[o]||(r={},"offset"in t&&(r.offset=Number(t.offset)),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),n[o]=r),void 0!==i[o]&&null!==i[o]&&(n[o][e]=i[o]);return n.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),n}(t)).map(function(t){var e,n={};for(e in null!=i&&i.composite&&(n.composite="auto"),t){var r=t[e];if("offset"===e){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||1<r)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===e&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error(r+" compositing is not supported");n[e]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==i?void 0:i.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),n=!0,r=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(_(o))n=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}if(e=e.filter(function(t){return 0<=Number(t.offset)&&Number(t.offset)<=1}),!n)for(var s=e.length,l=(e[s-1].computedOffset=Number(null!=(t=e[s-1].offset)?t:1),1<s&&(e[0].computedOffset=Number(null!=(t=e[0].offset)?t:0)),0),c=Number(e[0].computedOffset),u=1;u<s;u++){var h=e[u].computedOffset;if(!_(h)&&!_(c)){for(var f=1;f<u-l;f++)e[l+f].computedOffset=c+(Number(h)-c)*f/(u-l);l=u,c=Number(h)}}return e}var Mu="backwards|forwards|both|none".split("|"),Ou="reverse|alternate|alternate-reverse".split("|");function Su(t,e){var n,r,i;return t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=(r=t)?r:{duration:"auto"}),n=t,r=e,i=new ku,r&&(i.fill="both",i.duration="auto"),"number"!=typeof n||isNaN(n)?void 0!==n&&Object.keys(n).forEach(function(t){void 0===n[t]||null===n[t]||"auto"===n[t]||!("number"!=typeof i[t]&&"duration"!==t||"number"==typeof n[t]&&!isNaN(n[t]))||"fill"===t&&-1===Mu.indexOf(n[t])||"direction"===t&&-1===Ou.indexOf(n[t])||(i[t]=n[t])}):i.duration=n,i}var _u=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=Su(n,!1),(this.timing.effect=this).timing.activeDuration=du(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Eu(e,this.timing),this.interpolations=bu(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=vu(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Eu(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(t){n.timing[t]=e[t]})},t}();function Au(t,e){return Number(t.id)-Number(e.id)}n=function(){function t(t){var n=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],e<Number(n.currentTime)&&(e=Number(n.currentTime)),n.animations.sort(Au),n.animations=n.tick(e,!0,n.animations)[0],t.forEach(function(t){t[1](e)}),n.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t,e,n){t=new _u(t,e,n),e=new Kc(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;this.inTick||(t.markTarget(),(t=t.targetAnimations()).sort(Au),this.tick(Number(this.currentTime),!1,t.slice())[1].forEach(function(t){t=e.animations.indexOf(t);-1!==t&&e.animations.splice(t,1)}),this.applyPendingEffects())},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){null!=t&&t.applyInterpolations()}),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(e){var n=this;return this.rAF(function(t){n.updateAnimationsPromises(),e(t),n.updateAnimationsPromises()})},e.tick=function(n,r,t){var i=this,a=(this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=n,this.ticking=!1,[]),o=[],s=[],l=[];return t.forEach(function(t){t.tick(n,r),t._inEffect?(o.push(t.effect),t.markTarget()):(a.push(t.effect),t.unmarkTarget()),t._needsTick&&(i.ticking=!0);var e=t._inEffect||t._needsTick;((t._inTimeline=e)?s:l).push(t)}),(t=this.pendingEffects).push.apply(t,a),(t=this.pendingEffects).push.apply(t,o),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,l]},t}();function Tu(t,e){return(Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Pu(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function Lu(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(0,0,n,0,2*Math.PI))}function Cu(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,y=0,m=0;u&&Lo(u)&&f&&(n=o-i,r=s-a,m=Math.atan2(r,n),d=Math.cos(m)*(f||0),p=Math.sin(m)*(f||0)),h&&Lo(h)&&e&&(n=i-o,r=a-s,m=Math.atan2(r,n),g=Math.cos(m)*(e||0),y=Math.sin(m)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+y)}function Nu(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,e=e.path,u=e.absolutePath,h=e.segments,f=0,d=0,p=0,g=0,e=0;i&&Lo(i)&&l&&(r=(i=i.parentNode.getStartTangent())[0],i=i[1],n=r[0]-i[0],r=r[1]-i[1],e=Math.atan2(r,n),f=Math.cos(e)*(l||0),d=Math.sin(e)*(l||0)),s&&Lo(s)&&c&&(l=(i=s.parentNode.getEndTangent())[0],s=i[1],n=l[0]-s[0],r=l[1]-s[1],e=Math.atan2(r,n),p=Math.cos(e)*(c||0),g=Math.sin(e)*(c||0));for(var y=0;y<u.length;y++){var m=u[y],v=m[0],b=u[y+1],x=0===y&&(0!==f||0!==d),w=(y===u.length-1||b&&("M"===b[0]||"Z"===b[0]))&&0!==p&&0!==g;switch(v){case"M":x?(t.moveTo(m[1]-a+f,m[2]-o+d),t.lineTo(m[1]-a,m[2]-o)):t.moveTo(m[1]-a,m[2]-o);break;case"L":w?t.lineTo(m[1]-a+p,m[2]-o+g):t.lineTo(m[1]-a,m[2]-o);break;case"Q":t.quadraticCurveTo(m[1]-a,m[2]-o,m[3]-a,m[4]-o),w&&t.lineTo(m[3]-a+p,m[4]-o+g);break;case"C":t.bezierCurveTo(m[1]-a,m[2]-o,m[3]-a,m[4]-o,m[5]-a,m[6]-o),w&&t.lineTo(m[5]-a+p,m[6]-o+g);break;case"A":var k,E,M=h[y].arcParams,O=M.cx,S=M.cy,_=M.rx,A=M.ry,T=M.startAngle,P=M.endAngle,L=M.xRotation,M=M.sweepFlag;t.ellipse?t.ellipse(O-a,S-o,_,A,L,T,P,!!(1-M)):(k=A<_?_:A,E=A<_?1:_/A,A=A<_?A/_:1,t.translate(O-a,S-o),t.rotate(L),t.scale(E,A),t.arc(0,0,k,T,P,!!(1-M)),t.scale(1/E,1/A),t.rotate(-L),t.translate(-(O-a),-(S-o))),w&&t.lineTo(m[6]-a+p,m[7]-o+g);break;case"Z":t.closePath()}}}function ju(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&Lo(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&Lo(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+(g||m),f+(y||v));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function Ru(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&Lo(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&Lo(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+g,f+y);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+m,p+v)}function Fu(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=o.map(function(t){return fn(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}O.EasingFunction=fu,O.AnimationTimeline=n;var Iu=function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="canvas-path-generator",t}t=i,(n=e).prototype=Object.create(t.prototype),Tu(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){(t={})[E.CIRCLE]=Pu,t[E.ELLIPSE]=Lu,t[E.RECT]=Fu,t[E.LINE]=Cu,t[E.POLYLINE]=Ru,t[E.POLYGON]=ju,t[E.PATH]=Nu,t[E.TEXT]=void 0,t[E.GROUP]=void 0,t[E.IMAGE]=void 0,t[E.HTML]=void 0,t[E.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},n.destroy=function(){delete this.context.pathGeneratorFactory},e}(Jl);function Bu(){Bu=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Du(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function zu(t,e){return(zu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Gu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Wu(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?Gu(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gu(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Yu=m(),Vu=m(),Hu=m(),qu=ht(),Uu=function(){function s(){var s=this;this.canvasConfig=void 0,this.pathGeneratorFactory=void 0,this.pointInPathPickerFactory=void 0,this.isHit=function(t,e,n,r,i){var a=s.pointInPathPickerFactory[t.nodeName];if(a){var n=mt(qu,n),e=$t(Vu,Gt(Hu,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,o=t.parsedStyle.anchor;if(e[0]+=(o&&o[0]||0)*n[0]*2,e[1]+=(o&&o[1]||0)*n[1]*2,a(t,new Gr(e[0],e[1]),r,s.isPointInPath,i))return!0}return!1},this.isPointInPath=function(t,e,n){var t=t.offscreenCanvas.getOrCreateContext(s.canvasConfig.offscreenCanvas),r=s.pathGeneratorFactory[e.nodeName];return r&&(t.beginPath(),r(t,e.parsedStyle),t.closePath()),t.isPointInPath(n.x,n.y)}}var t=s.prototype;return t.apply=function(t,n){var r=this,e=t.config,i=t.renderingService,a=t.renderingContext,o=t.pathGeneratorFactory,t=t.pointInPathPickerFactory,l=(this.canvasConfig=e,this.pathGeneratorFactory=o,this.pointInPathPickerFactory=t,null==(e=a.root)?void 0:e.ownerDocument);i.hooks.pick.tapPromise(s.tag,function(){s=Bu().mark(function t(e){return Bu().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.pick(l,e,n));case 1:case"end":return t.stop()}},t)});var s,e=function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Du(r,e,n,i,a,"next",t)}function a(t){Du(r,e,n,i,a,"throw",t)}i(void 0)})};return function(t){return e.apply(this,arguments)}}()),i.hooks.pickSync.tap(s.tag,function(t){return r.pick(l,t,n)})},t.pick=function(t,e,n){for(var r=e.topmost,i=e.position,a=i.x,i=i.y,o=Gt(Yu,a,i,0),s=[],l=Wu(t.elementsFromBBox(o[0],o[1],o[0],o[1]));!(c=l()).done;){var c=c.value,u=c.getWorldTransform();if(this.isHit(c,o,u,!1,n)){u=ti(c);if(u){u=u.parsedStyle.clipPath;if(this.isHit(u,o,u.getWorldTransform(),!0,n)){if(r)return e.picked=[c],e;s.push(c)}}else{if(r)return e.picked=[c],e;s.push(c)}}}return e.picked=s,e},s}();function Xu(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function $u(t,e){return Math.abs(t-e)<.001}function Ku(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function Zu(t){return(t+2*Math.PI)%(2*Math.PI)}Uu.tag="CanvasPicker";var Ju={box:function(t,e,n,r){return Ku([t,n],[e,r])},length:Xu,pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return o<0?Xu(t,e,i,a):(n-t)*(n-t)+(r-e)*(r-e)<o?Xu(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){n=[n-t,r-e];return xe(n,[0,0])?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(ve(r=[-n[1],n[0]],r),Math.abs(be([i-t,a-e],r)))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Qu(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=Xu(l[0],l[1],p[0],p[1]);p<s&&(o=d,s=p)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(var s=1/0,g=0;g<32&&!(h<1e-4);g++){var y=o-h,m=o+h,v=[i.apply(void 0,t.concat([y])),i.apply(void 0,e.concat([y]))],v=Xu(l[0],l[1],v[0],v[1]);0<=y&&v<s?(o=y,s=v):(y=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],v=Xu(l[0],l[1],y[0],y[1]),m<=1&&v<s?(o=m,s=v):h*=.5)}return{x:i.apply(void 0,t.concat([o])),y:i.apply(void 0,e.concat([o]))}}function th(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function eh(t,e,n){n=t+n-2*e;return $u(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function nh(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function rh(t,e,n,r,i,a,o){var s=th(t,n,i,o),l=th(e,r,a,o),c=Ju.pointAt(t,e,n,r,o),n=Ju.pointAt(n,r,i,a,o);return[[t,e,c.x,c.y,s,l],[s,l,n.x,n.y,i,a]]}function ih(t,e,n,r,i,a,o){return 0===o?(Xu(t,e,n,r)+Xu(n,r,i,a)+Xu(t,e,i,a))/2:(e=(t=rh(t,e,n,r,i,a,.5))[0],n=t[1],e.push(o-1),n.push(o-1),ih.apply(void 0,e)+ih.apply(void 0,n))}var ah={box:function(t,e,n,r,i,a){var o=eh(t,n,i)[0],s=eh(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push(th(t,n,i,o)),void 0!==s&&c.push(th(e,r,a,s)),Ku(l,c)},length:function(t,e,n,r,i,a){return ih(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,a,o,s){return Qu([t,n,i],[e,r,a],o,s,th)},pointDistance:function(t,e,n,r,i,a,o,s){t=this.nearestPoint(t,e,n,r,i,a,o,s);return Xu(t.x,t.y,o,s)},interpolationAt:th,pointAt:function(t,e,n,r,i,a,o){return{x:th(t,n,i,o),y:th(e,r,a,o)}},divide:rh,tangentAngle:function(t,e,n,r,i,a,o){t=nh(t,n,i,o),n=nh(e,r,a,o);return Zu(Math.atan2(n,t))}};function oh(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function sh(t,e,n,r,i){var a=1-i;return 3*(a*a*(e-t)+2*a*i*(n-e)+i*i*(r-n))}function lh(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return $u(r,0)?$u(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):$u(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function ch(t,e,n,r,i,a,o,s,l){var c=oh(t,n,i,o,l),u=oh(e,r,a,s,l),h=Ju.pointAt(t,e,n,r,l),n=Ju.pointAt(n,r,i,a,l),r=Ju.pointAt(i,a,o,s,l),i=Ju.pointAt(h.x,h.y,n.x,n.y,l),a=Ju.pointAt(n.x,n.y,r.x,r.y,l);return[[t,e,h.x,h.y,i.x,i.y,c,u],[c,u,a.x,a.y,r.x,r.y,o,s]]}function uh(t,e,n,r,i,a,o,s,l){if(0===l){for(var c=[t,n,i,o],u=[e,r,a,s],h=0,f=c.length,d=0;d<f;d++)h+=Xu(c[d],u[d],c[(d+1)%f],u[(d+1)%f]);return h/2}t=ch(t,e,n,r,i,a,o,s,.5),e=[].concat(t[0],[l-1]),n=[].concat(t[1],[l-1]);return uh.apply(void 0,e)+uh.apply(void 0,n)}var hh={extrema:lh,box:function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=lh(t,n,i,o),h=lh(e,r,a,s),f=0;f<u.length;f++)l.push(oh(t,n,i,o,u[f]));for(var d=0;d<h.length;d++)c.push(oh(e,r,a,s,h[d]));return Ku(l,c)},length:function(t,e,n,r,i,a,o,s){return uh(t,e,n,r,i,a,o,s,3)},nearestPoint:function(t,e,n,r,i,a,o,s,l,c,u){return Qu([t,n,i,o],[e,r,a,s],l,c,oh,u)},pointDistance:function(t,e,n,r,i,a,o,s,l,c,u){t=this.nearestPoint(t,e,n,r,i,a,o,s,l,c,u);return Xu(t.x,t.y,l,c)},interpolationAt:oh,pointAt:function(t,e,n,r,i,a,o,s,l){return{x:oh(t,n,i,o,l),y:oh(e,r,a,s,l)}},divide:ch,tangentAngle:function(t,e,n,r,i,a,o,s,l){t=sh(t,n,i,o,l),n=sh(e,r,a,s,l);return Zu(Math.atan2(n,t))}};function fh(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function dh(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function ph(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return fh(t.x,t.y,o,s)<=a/2}function gh(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&Ju.pointToLine(t,e,n,r,a,o)<=i/2}function yh(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(gh(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(gh(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var mh=1e-6;function vh(t){return Math.abs(t)<mh?0:t<0?-1:1}function bh(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<vh(c[1]-n)!=0<vh(u[1]-n)&&vh(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function xh(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=bh(t[i],e,n));i++);return r}function wh(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=fh(r,r,e.x,e.y),e=rl(t,i,a),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function kh(t,e,n,r){return t/(n*n)+e/(r*r)}function Eh(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=rl(t,a,o),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?kh(s,l,r+t,i+t)<=1:a?kh(s,l,r,i)<=1:!!o&&1<=kh(s,l,r-t,i-t)&&kh(s,l,r+t,i+t)<=1}function Mh(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,u=t.defY;return!(!rl(t.pointerEvents,t.fill,t.stroke)[1]&&!n||!s)&&gh(r,i,a,o,(s||0)+(l||0),e.x+(void 0===c?0:c),e.y+(void 0===u?0:u))}function Oh(t,e,n,r,i){var a=t.parsedStyle,o=a.lineWidth,s=a.increasedLineWidthForHitTesting,l=a.stroke,c=a.fill,u=a.defX,u=void 0===u?0:u,h=a.defY,h=void 0===h?0:h,f=a.path,a=rl(a.pointerEvents,c,l),c=a[0],l=a[1],a=f.segments,d=f.hasArc,p=f.polylines,f=f.polygons,g=Hs(t),y=!1;return c||n?d?r(i,t,e):xh(f,e.x+u,e.y+h)||xh(p,e.x+u,e.y+h):l||n?function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||dh(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=gh(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=ah.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=hh.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=ze(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var y=hh.pointDistance(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=y<=e/2)return!0}}}return a}(a,(o||0)+(s||0),e.x+u,e.y+h,g):y}function Sh(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=rl(t.pointerEvents,i,r),i=t[0],r=!1;return r=(r=t[1]||n?yh(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:bh(s.points,e.x+l,e.y+c)}function _h(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,s=t.defY;return!(!rl(t.pointerEvents,t.fill,t.stroke)[1]&&!n||!r)&&yh(a.points,(r||0)+(i||0),e.x+(void 0===o?0:o),e.y+(void 0===s?0:s),!1)}function Ah(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,y=p.fill,m=p.stroke,v=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=rl(p.pointerEvents,y,m),y=p[0],m=p[1],p=(v||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(v=!1,(m||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return fn(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,f=g[0],s=g[1],c=g[2],g=g[3],v=gh(b+f,h,b+l-s,h,d,a,o)||gh(b+l,h+s,b+l,h+u-c,d,a,o)||gh(b+l-c,h+u,b+g,h+u,d,a,o)||gh(b,h+u-g,b,h+f,d,a,o)||ph(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||ph(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||ph(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||ph(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),v||!y&&!n?v:r(i,t,e)):(s=p/2,y&&m||n?dh(0-s,0-s,x+s,w+s,e.x,e.y):y?dh(0,0,x,w,e.x,e.y):!!m&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,dh(l-(d=b/2),c-d,u,b,h,f)||dh(l+u-d,c-d,b,g,h,f)||dh(l+d,c+g-d,u,b,h,f)||dh(l-d,c+d,b,g,h,f)))}var Th=function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="canvas-picker",t}t=i,(n=e).prototype=Object.create(t.prototype),zu(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){function t(){return!0}(e={})[E.CIRCLE]=wh,e[E.ELLIPSE]=Eh,e[E.RECT]=Ah,e[E.LINE]=Mh,e[E.POLYLINE]=_h,e[E.POLYGON]=Sh,e[E.PATH]=Oh,e[E.TEXT]=t,e[E.GROUP]=null,e[E.IMAGE]=t,e[E.HTML]=null,e[E.MESH]=null;var e;this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new Uu)},n.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Jl);function Ph(){Ph=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Lh(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ch(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Lh(r,e,n,i,a,"next",t)}function a(t){Lh(r,e,n,i,a,"throw",t)}i(void 0)})}}function Nh(){return(Nh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function jh(t,e){return(jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Rh=function(){function r(t){this.canvasRendererPluginOptions=void 0,this.context=void 0,this.pathGeneratorFactory=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=ht(),this.dprMatrix=ht(),this.tmpMat4=ht(),this.vec3a=m(),this.vec3b=m(),this.vec3c=m(),this.vec3d=m(),this.canvasRendererPluginOptions=t}var t=r.prototype;return t.apply=function(t,c){function a(t){(t=t.target.rBushNode).aabb&&h.removedRBushNodeAABBs.push(t.aabb)}function o(t){(t=t.target.rBushNode).aabb&&h.removedRBushNodeAABBs.push(t.aabb)}function u(t,e){t.isVisible()&&!t.isCulled()&&(h.renderDisplayObject(t,e,h.context,h.restoreStack,c),h.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){u(t,e)})}var h=this,f=(this.context=t).config,d=t.camera,l=t.renderingService,p=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,g=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),y=p.root.ownerDocument.defaultView;l.hooks.init.tapPromise(r.tag,Ch(Ph().mark(function t(){var e,n,r,i;return Ph().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:y.addEventListener(w.UNMOUNTED,a),y.addEventListener(w.CULLED,o),e=g.getDPR(),n=f.width,r=f.height,i=g.getContext(),h.clearRect(i,0,0,n*e,r*e,f.background);case 6:case"end":return t.stop()}},t)}))),l.hooks.destroy.tap(r.tag,function(){y.removeEventListener(w.UNMOUNTED,a),y.removeEventListener(w.CULLED,o)}),l.hooks.beginFrame.tap(r.tag,function(){var t=g.getContext(),e=g.getDPR(),n=f.width,r=f.height,i=h.canvasRendererPluginOptions,a=i.dirtyObjectNumThreshold,i=i.dirtyObjectRatioThreshold,o=l.getStats(),s=o.total,o=o.rendered,s=o/s;h.clearFullScreen=l.disableDirtyRectangleRendering()||a<o&&i<s,t&&(t.resetTransform(),h.clearFullScreen)&&h.clearRect(t,0,0,n*e,r*e,f.background)});l.hooks.endFrame.tap(r.tag,function(){var e=g.getContext(),t=g.getDPR();if(Ot(h.dprMatrix,k(t,t,1)),bt(h.vpMatrix,h.dprMatrix,d.getOrthoMatrix()),h.clearFullScreen)u(p.root,e);else{t=h.safeMergeAABB.apply(h,[h.mergeDirtyAABBs(h.renderQueue)].concat(h.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Br;return i.setMinMax(k(e,n,0),k(r,t,0)),i})));if(h.removedRBushNodeAABBs=[],Br.isEmpty(t))return void(h.renderQueue=[]);var n=h.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=$t(h.vec3a,k(r,i,0),h.vpMatrix),s=$t(h.vec3b,k(r+a,i,0),h.vpMatrix),l=$t(h.vec3c,k(r,i+n,0),h.vpMatrix),r=$t(h.vec3d,k(r+a,i+n,0),h.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),h.clearRect(e,s,r,l,n,f.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(h.vpMatrix[0],h.vpMatrix[1],h.vpMatrix[4],h.vpMatrix[5],h.vpMatrix[12],h.vpMatrix[13]),f.renderer.getConfig().enableDirtyRectangleRenderingDebug&&y.dispatchEvent(new vo(sc.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),h.searchDirtyObjects(c,t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&h.renderDisplayObject(t,e,h.context,h.restoreStack,c)}),e.restore(),h.renderQueue.forEach(function(t){h.saveDirtyAABB(t)}),h.renderQueue=[]}h.restoreStack.forEach(function(){e.restore()}),h.restoreStack=[]}),l.hooks.render.tap(r.tag,function(t){h.clearFullScreen||h.renderQueue.push(t)})},t.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},t.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==E.LINE)&&t.nodeName!==E.PATH&&t.nodeName!==E.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},t.mergeDirtyAABBs=function(t){var n=new Br;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},t.searchDirtyObjects=function(e,t){var n=t.getMin(),r=n[0],n=n[1],t=t.getMax(),i=t[0],t=t[1];return this.rBush.search({minX:r,minY:n,maxX:i,maxY:t}).map(function(t){t=t.id;return e.displayObjectPool.getByEntity(t)})},t.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Br),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},t.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,a=n.opacity,o=n.lineDash,n=n.lineDashOffset;o&&t.setLineDash(o),_(n)||(t.lineDashOffset=n),_(a)||(t.globalAlpha*=a),_(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),_(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.getGeometryBounds())&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(dt(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,xt(this.tmpMat4,this.tmpMat4,this.vec3a),bt(this.tmpMat4,n,this.tmpMat4)):(dt(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,xt(this.tmpMat4,this.tmpMat4,this.vec3a)),bt(this.tmpMat4,this.vpMatrix,this.tmpMat4),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.safeMergeAABB=function(){for(var e=new Br,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){e.add(t)}),e},r}(),Fh=(Rh.tag="CanvasRenderer",function(){function t(t){this.imagePool=void 0,this.imagePool=t}var e=t.prototype;return e.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,y=e.shadowColor,m=e.shadowBlur,v=e.filter,e=e.miterLimit,b=!_(o)&&!o.isNone,x=!_(u)&&!u.isNone&&0<f,w=0===o.alpha,v=!(!v||!v.length),y=!_(y)&&0<m,m=n.nodeName,g="inner"===g,m=x&&y&&(m===E.PATH||m===E.LINE||m===E.POLYLINE||w||g);b&&(t.globalAlpha=l*c,m||Ih(n,t,y),this.fill(t,n,o,s,r,i,a),m||this.clearShadowAndFilter(t,v,y)),x&&(t.globalAlpha=l*h,t.lineWidth=f,_(e)||(t.miterLimit=e),_(d)||(t.lineCap=d),_(p)||(t.lineJoin=p),m&&(g&&(t.globalCompositeOperation="source-atop"),Ih(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,v,!0)),this.stroke(t,n,u,r,i,a))},e.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!_(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},e.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),e.fill(r)}):(ca(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),e.fill(r))},e.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(ca(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},e.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvas.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvas.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},e.getColor=function(t,e,n){var r;return t.type!==ki.LinearGradient&&t.type!==ki.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(Nh({type:t.type},t.value,{width:r,height:e}),n)),r},t}());function Ih(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}var Bh=function(){function t(t){this.imagePool=void 0,this.imagePool=t}return t.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=hn(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){Ih(n,t,!_(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}},t}(),Dh=function(){function t(){}var e=t.prototype;return e.render=function(t,e,n){var r=e.lineWidth,i=e.textAlign,a=e.textBaseline,o=e.lineJoin,s=e.miterLimit,l=e.letterSpacing,c=e.stroke,u=e.fill,h=e.fillOpacity,f=e.strokeOpacity,d=e.opacity,p=e.metrics,g=e.dx,y=e.dy,m=e.shadowColor,e=e.shadowBlur,v=p.font,b=p.lines,x=p.height,w=p.lineHeight,k=p.lineMetrics,E=(t.font=v,t.lineWidth=r,t.textAlign="middle"===i?"center":i,t.textBaseline=a,t.lineJoin=o,_(s)||(t.miterLimit=s),0),M=("middle"===a?E=-x/2-w/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?E=-x:"top"!==a&&"hanging"!==a||(E=-w),g||0);E+=y||0,Ih(n,t,!_(m)&&0<e);for(var O=0;O<b.length;O++){var S=r/2+M;E+=w,_(c)||c.isNone||!r||this.drawLetterSpacing(t,b[O],k[O],i,S,E,l,h,f,d,!0),_(u)||this.drawLetterSpacing(t,b[O],k[O],i,S,E,l,h,f,d)}},e.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var y=d[g];u?this.strokeText(t,y,f,a,l):this.fillText(t,y,f,a,s,c),f+=p-(y=t.measureText(e.substring(g+1)).width)+o,p=y}t.textAlign=h}},e.fillText=function(t,e,n,r,i,a){var o,s=!_(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},e.strokeText=function(t,e,n,r,i){var a,o=!_(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)},t}(),zh=function(n){var t;function e(t){var e;return void 0===t&&(t={}),(e=n.call(this)||this).options=void 0,e.name="canvas-renderer",e.options=t,e}t=n,(r=e).prototype=Object.create(t.prototype),jh(r.prototype.constructor=r,t);var r=e.prototype;return r.init=function(){var t,e=Nh({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new Fh(n),n=((t={})[E.CIRCLE]=r,t[E.ELLIPSE]=r,t[E.RECT]=r,t[E.IMAGE]=new Bh(n),t[E.TEXT]=new Dh,t[E.LINE]=r,t[E.POLYLINE]=r,t[E.POLYGON]=r,t[E.PATH]=r,t[E.GROUP]=void 0,t[E.HTML]=void 0,t[E.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new Rh(e))},r.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Jl);function Gh(){Gh=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Wh(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function Yh(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Wh(r,e,n,i,a,"next",t)}function a(t){Wh(r,e,n,i,a,"throw",t)}i(void 0)})}}function Vh(t,e){return(Vh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Hh=function(){function r(){this.context=void 0}return r.prototype.apply=function(t,i){function a(t){e.hooks.pointerWheel.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=(this.context=t,n.root.ownerDocument.defaultView),l=function(t){e.hooks.pointerMove.call(t)},c=function(t){e.hooks.pointerUp.call(t)},u=function(t){e.hooks.pointerDown.call(t)},h=function(t){e.hooks.pointerOver.call(t)},f=function(t){e.hooks.pointerOut.call(t)},d=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tapPromise(r.tag,Yh(Gh().mark(function t(){var r;return Gh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=o.context.contextService.getDomElement(),i.globalThis.navigator.msPointerEnabled?(r.style.msContentZooming="none",r.style.msTouchAction="none"):s.supportsPointerEvents&&(r.style.touchAction="none"),s.supportsPointerEvents?(n=r,i.globalThis.document.addEventListener("pointermove",l,!0),n.addEventListener("pointerdown",u,!0),n.addEventListener("pointerleave",f,!0),n.addEventListener("pointerover",h,!0),i.globalThis.addEventListener("pointerup",c,!0)):(n=r,i.globalThis.document.addEventListener("mousemove",l,!0),n.addEventListener("mousedown",u,!0),n.addEventListener("mouseout",f,!0),n.addEventListener("mouseover",h,!0),i.globalThis.addEventListener("mouseup",c,!0)),s.supportsTouchEvents&&((e=r).addEventListener("touchstart",u,!0),e.addEventListener("touchend",c,!0),e.addEventListener("touchmove",l,!0),e.addEventListener("touchcancel",d,!0)),r.addEventListener("wheel",a,{passive:!0,capture:!0});case 5:case"end":return t.stop()}var e,n},t)}))),e.hooks.destroy.tap(r.tag,function(){var t,e,n=o.context.contextService.getDomElement();i.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):s.supportsPointerEvents&&(n.style.touchAction=""),s.supportsPointerEvents?(t=n,i.globalThis.document.removeEventListener("pointermove",l,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",f,!0),t.removeEventListener("pointerover",h,!0),i.globalThis.removeEventListener("pointerup",c,!0)):(t=n,i.globalThis.document.removeEventListener("mousemove",l,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",f,!0),t.removeEventListener("mouseover",h,!0),i.globalThis.removeEventListener("mouseup",c,!0)),s.supportsTouchEvents&&((e=n).removeEventListener("touchstart",u,!0),e.removeEventListener("touchend",c,!0),e.removeEventListener("touchmove",l,!0),e.removeEventListener("touchcancel",d,!0)),n.removeEventListener("wheel",a,!0)})},r}(),qh=(Hh.tag="DOMInteraction",function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="dom-interaction",t}t=i,(n=e).prototype=Object.create(t.prototype),Vh(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.addRenderingPlugin(new Hh)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(Jl));function Uh(){Uh=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Xh(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function $h(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Xh(r,e,n,i,a,"next",t)}function a(t){Xh(r,e,n,i,a,"throw",t)}i(void 0)})}}function Kh(t,e){return(Kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Zh=function(){function d(){this.context=void 0,this.$camera=void 0}var t=d.prototype;return t.joinTransformMatrix=function(t){return"matrix("+[t[0],t[1],t[4],t[5],t[12],t[13]].join(",")+")"},t.apply=function(t){function i(t,e){e.style.transform=s.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===E.HTML&&(s.$camera||(s.$camera=s.createCamera(l)),e=s.getOrCreateEl(r),s.$camera.appendChild(e),n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]}),Object.keys(r.attributes).forEach(function(t){s.updateAttribute(t,r)}),i(r,e))}function n(t){(t=t.target).nodeName===E.HTML&&s.$camera&&(t=s.getOrCreateEl(t))&&t.remove()}function r(t){var e=t.target;e.nodeName===E.HTML&&(t=t.attrName,s.updateAttribute(t,e))}function a(t){var e;(t=t.target).nodeName===E.HTML&&(e=s.getOrCreateEl(t),i(t,e))}function o(){var t,e;s.$camera&&(t=(e=s.context.config).width,e=e.height,s.$camera.style.width=(t||0)+"px",s.$camera.style.height=(e||0)+"px")}var s=this,l=t.camera,c=t.renderingContext,u=t.renderingService,h=t.displayObjectPool,f=(this.context=t,c.root.ownerDocument.defaultView);u.hooks.init.tapPromise(d.tag,$h(Uh().mark(function t(){return Uh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:h.getHTMLs().length&&(s.$camera=s.createCamera(l)),f.addEventListener(sc.RESIZE,o),f.addEventListener(w.MOUNTED,e),f.addEventListener(w.UNMOUNTED,n),f.addEventListener(w.ATTR_MODIFIED,r),f.addEventListener(w.BOUNDS_CHANGED,a);case 6:case"end":return t.stop()}},t)}))),u.hooks.endFrame.tap(d.tag,function(){s.$camera&&c.renderReasons.has(Ul.CAMERA_CHANGED)&&(s.$camera.style.transform=s.joinTransformMatrix(l.getOrthoMatrix()))}),u.hooks.destroy.tap(d.tag,function(){s.$camera&&s.$camera.remove(),f.removeEventListener(sc.RESIZE,o),f.removeEventListener(w.MOUNTED,e),f.removeEventListener(w.UNMOUNTED,n),f.removeEventListener(w.ATTR_MODIFIED,r),f.removeEventListener(w.BOUNDS_CHANGED,a)})},t.getId=function(t){return t.id||"g-html-"+t.entity},t.createCamera=function(t){var e,n,r=this.context.config,i=r.document,a=r.width,r=r.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=i=(i||document).createElement("div")).id=e,i.style.position="absolute",i.style.left=(o.offsetLeft||0)+"px",i.style.top=(o.offsetTop||0)+"px",i.style.transformOrigin="left top",i.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),i.style.overflow="hidden",i.style.pointerEvents="none",i.style.width=(a||0)+"px",i.style.height=(r||0)+"px",s.appendChild(i)),n):null},t.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),(t.parsedStyle.$el=r).id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},t.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;hn(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":r=e.parsedStyle.transformOrigin;n.style["transform-origin"]=r[0].value+" "+r[1].value;break;case"width":r=e.computedStyleMap().get("width");n.style.width=r.toString();break;case"height":r=e.computedStyleMap().get("height");n.style.height=r.toString();break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]=""+r;break;case"visibility":r=e.parsedStyle.visibility;n.style.visibility=r;break;case"pointerEvents":r=e.parsedStyle.pointerEvents;n.style.pointerEvents=r;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity=""+r;break;case"fill":var r=e.parsedStyle.fill,i="";ua(r)?i=r.isNone?"transparent":e.getAttribute("fill"):Array.isArray(r)?i=e.getAttribute("fill"):ca(r),n.style.background=i;break;case"stroke":r=e.parsedStyle.stroke,i="";ua(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):ca(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":r=e.parsedStyle.lineWidth;n.style["border-width"]=(r||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":i=e.style.filter;n.style.filter=i}},d}(),Jh=(Zh.tag="HTMLRendering",function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="html-renderer",t}t=i,(n=e).prototype=Object.create(t.prototype),Kh(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.addRenderingPlugin(new Zh)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(Jl));function Qh(){Qh=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function tf(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function ef(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){tf(r,e,n,i,a,"next",t)}function a(t){tf(r,e,n,i,a,"throw",t)}i(void 0)})}}function nf(t,e){return(nf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var rf="undefined"!=typeof Float32Array?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var af=function(){function t(t){this.canvasConfig=void 0,this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=t}var e=t.prototype;return e.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},e.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):Jr&&(n=new window.Image),n&&(n.onload=function(){t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r,a.imageCache[r]=n)}))},e.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(l=t.image,s=t.repetition,t=t.transform,a=!1,hn(l)?o=this.getImageSync(l,i):n?(o=n,a=!0):o=l,(i=o&&e.createPattern(o,s))&&(e=t?ws(Ia(t)):(n=new rf(16),rf!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,(l=n)[0]=1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l),a&&(s=o=e,n=(t=[1/r,1/r,1])[0],l=t[1],t=t[2],o[0]=s[0]*n,o[1]=s[1]*n,o[2]=s[2]*n,o[3]=s[3]*n,o[4]=s[4]*l,o[5]=s[5]*l,o[6]=s[6]*l,o[7]=s[7]*l,o[8]=s[8]*t,o[9]=s[9]*t,o[10]=s[10]*t,o[11]=s[11]*t,o[12]=s[12],o[13]=s[13],o[14]=s[14],o[15]=s[15]),i.setTransform({a:e[0],b:e[1],c:e[4],d:e[5],e:e[12],f:e[13]})),c&&i&&(this.patternCache[c]=i),i)},e.getOrCreateGradient=function(t,e){var r,n,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(r=null,l===ki.LinearGradient?(n=u,i=h,f=hs((f=f).value),a=0+n/2,o=0+i/2,n=Math.abs(n*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*n/2,y1:o-Math.sin(f)*n/2,x2:a+Math.cos(f)*n/2,y2:o+Math.sin(f)*n/2},r=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===ki.RadialGradient&&(a=u,o=h,f=p,n=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(We([0,0],[l,u]),We([0,o],[l,u]),We([a,o],[l,u]),We([a,0],[l,u])),n&&(n instanceof Fi?i=n.value:n instanceof _i&&("closest-side"===n.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===n.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===n.value&&(i=Math.min(We([0,0],[l,u]),We([0,o],[l,u]),We([a,o],[l,u]),We([a,0],[l,u]))))),r=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),r&&(c.forEach(function(t){var e,n=t.offset,t=t.color;n.unit===g.kPercentage&&null!=(e=r)&&e.addColorStop(n.value/100,t.toString())}),this.gradientCache[s]=r)),this.gradientCache[s]},e.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-"+e+"-"+((null==a?void 0:a.toString())||0)+"-"+((null==o?void 0:o.toString())||0)+"-"+((null==s?void 0:s.toString())||0)+"-"+((null==t?void 0:t.toString())||0)+"-"+n+"-"+r+"-"+i.map(function(t){return""+t.offset+t.color}).join("-")},e.generatePatternKey=function(t){var e=t.image,t=t.repetition;return hn(e)?"pattern-"+e+"-"+t:"rect"===e.nodeName?"pattern-"+e.entity+"-"+t:void 0},t}(),of=function(){function s(){}return s.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===E.IMAGE&&(t=n.img,hn(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===E.IMAGE&&"img"===n&&hn(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tapPromise(s.tag,ef(Qh().mark(function t(){return Qh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:o.addEventListener(w.MOUNTED,e),o.addEventListener(w.ATTR_MODIFIED,n);case 2:case"end":return t.stop()}},t)}))),r.hooks.destroy.tap(s.tag,function(){o.removeEventListener(w.MOUNTED,e),o.removeEventListener(w.ATTR_MODIFIED,n)})},s}(),sf=(of.tag="LoadImage",function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="image-loader",t}t=i,(n=e).prototype=Object.create(t.prototype),nf(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.context.imagePool=new af(this.context.config),this.addRenderingPlugin(new of)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(Jl));function lf(){lf=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function cf(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function uf(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){cf(r,e,n,i,a,"next",t)}function a(t){cf(r,e,n,i,a,"throw",t)}i(void 0)})}}function hf(t,e){t.prototype=Object.create(e.prototype),ff(t.prototype.constructor=t,e)}function ff(t,e){return(ff=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var df=function(){function t(t){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0,this.renderingContext=void 0,this.renderingContext=t.renderingContext,this.canvasConfig=t.config}var e=t.prototype;return e.init=function(){var t=uf(lf().mark(function t(){var e,n;return lf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=this.canvasConfig,e=n.container,(n=n.canvas)?(this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=hn(e)?document.getElementById(e):e,this.$container)&&(n=document.createElement("canvas"),this.$container.appendChild(n),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=n),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height);case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),e.getContext=function(){return this.context},e.getDomElement=function(){return this.$canvas},e.getDPR=function(){return this.dpr},e.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},e.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},e.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||Jr&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,Jr)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(Ul.CAMERA_CHANGED)},e.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},e.toDataURL=function(){var e=uf(lf().mark(function t(e){var n,r;return lf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(r=e=void 0===e?{}:e).type,r=r.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 3:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),t}(),pf=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="canvas-context-register",t}hf(t,i);var e=t.prototype;return e.init=function(){this.context.ContextService=df},e.destroy=function(){delete this.context.ContextService},t}(Jl),gf=function(e){function t(t){t=e.call(this,t)||this;return t.registerPlugin(new pf),t.registerPlugin(new sf),t.registerPlugin(new Iu),t.registerPlugin(new zh),t.registerPlugin(new qh),t.registerPlugin(new Th),t.registerPlugin(new Jh),t}return hf(t,e),t}(Zl);function yf(){yf=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function m(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},m(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},m(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function mf(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function vf(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){mf(r,e,n,i,a,"next",t)}function a(t){mf(r,e,n,i,a,"throw",t)}i(void 0)})}}function bf(){return(bf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function xf(t,e){return(xf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function wf(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function kf(t){return _f(t,"Function")}function Ef(t){return null==t}var Mf=function(){function i(t){this.dragndropPluginOptions=void 0,this.dragndropPluginOptions=t}return i.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,h=u===p,f=h&&d.dragndropPluginOptions.isDocumentDraggable?p:u.closest&&u.closest("[draggable=true]");f&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],e=function(){var e=vf(yf().mark(function t(e){var n,r,i;return yf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a)t.next=8;else{if(n=e.timeStamp-o,r=We([e.clientX,e.clientY],s),n<=d.dragndropPluginOptions.dragstartTimeThreshold||r<=d.dragndropPluginOptions.dragstartDistanceThreshold)return t.abrupt("return");t.next=5}break;case 5:e.type="dragstart",f.dispatchEvent(e),a=!0;case 8:if(e.type="drag",e.dx=e.clientX-c[0],e.dy=e.clientY-c[1],f.dispatchEvent(e),c=[e.clientX,e.clientY],h){t.next=21;break}return n="pointer"===d.dragndropPluginOptions.overlap?[e.canvasX,e.canvasY]:u.getBounds().center,t.next=17,p.elementsFromPoint(n[0],n[1]);case 17:r=t.sent,i=r[r.indexOf(u)+1],i=(null==i?void 0:i.closest("[droppable=true]"))||(d.dragndropPluginOptions.isDocumentDroppable?p:null),l!==i&&(l&&(e.type="dragleave",(e.target=l).dispatchEvent(e)),i&&(e.type="dragenter",(e.target=i).dispatchEvent(e)),l=i)&&(e.type="dragover",(e.target=l).dispatchEvent(e));case 21:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),r.addEventListener("pointermove",e),u.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),l&&(t.type="drop",(t.target=l).dispatchEvent(t)),t.type="dragend",f.dispatchEvent(t),a=!1),r.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var d=this,n=t.renderingService,p=t.renderingContext.root.ownerDocument,r=p.defaultView;n.hooks.init.tapPromise(i.tag,vf(yf().mark(function t(){return yf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r.addEventListener("pointerdown",e);case 1:case"end":return t.stop()}},t)}))),n.hooks.destroy.tap(i.tag,function(){r.removeEventListener("pointerdown",e)})},i}(),Of=(Mf.tag="Dragndrop",function(n){var t;function e(t){var e;return void 0===t&&(t={}),(e=n.call(this)||this).options=void 0,e.name="dragndrop",e.options=t,e}t=n,(r=e).prototype=Object.create(t.prototype),xf(r.prototype.constructor=r,t);var r=e.prototype;return r.init=function(){this.addRenderingPlugin(new Mf(bf({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},r.destroy=function(){this.removeAllRenderingPlugins()},r.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(Jl)),Sf={}.toString,_f=function(t,e){return Sf.call(t)==="[object "+e+"]"},Af=function(t){return Array.isArray?Array.isArray(t):_f(t,"Array")};function Tf(t){if(!Lf(t)||!_f(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Pf(t){return(t=jf(t)).charAt(0).toLowerCase()+t.substring(1)}var Lf=function(t){return"object"==typeof t&&null!==t},Cf=function(t){return _f(t,"Number")},Nf=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){kf(n)&&"prototype"===e||r.push(t)};if(e)if(Af(e))for(var a=0,o=e.length;a<o&&!1!==i(e[a],a);a++);else if(t=typeof e,null!==e&&"object"==t||"function"==t)for(var s in e)if(e.hasOwnProperty(s)&&!1===i(e[s],s))break;return r},jf=function(t){return Ef(t)?"":t.toString()},Rf=function(t){t=jf(t);return t.charAt(0).toUpperCase()+t.substring(1)};var Ff=5;function If(t){return t}var Bf,R=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||Ff,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Tf(o)?(Tf(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Af(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},Df=function(t,e){if(!wf(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},zf=function(n,r,i){function a(){u=!1===i.leading?0:Date.now(),o=null,c=n.apply(s,l),o||(s=l=null)}function t(){var t=Date.now(),e=(u||!1!==i.leading||(u=t),r-(t-u));return s=this,l=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),u=t,c=n.apply(s,l),o||(s=l=null)):o||!1===i.trailing||(o=setTimeout(a,e)),c}var o,s,l,c,u=0;i=i||{};return t.cancel=function(){clearTimeout(o),u=0,o=s=l=null},t};function Gf(t){return Ef(t)?0:(wf(t)?t:Object.keys(t)).length}!function(a,o){var s;if(kf(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map;throw new TypeError("Expected a function")}(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(Bf=Bf||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),Bf.measureText(_f(t,"String")?t:"").width},function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}([t],Nf(e=void 0===e?{}:e)).join("")});const Wf=()=>[["cartesian"]],Yf=(Wf.props={},({startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1})=>[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]),Vf=(Yf.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),Hf=(Vf.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),qf=(Hf.props={},()=>[["translate",.5,.5],["reflect"],["translate",-.5,-.5]]),Uf=(qf.props={},()=>[["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Xf=(Uf.props={},()=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5]]),$f=(Xf.props={},({startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1})=>[...Hf(),...Yf({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]),Kf=($f.props={},({startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1})=>[["transpose"],...qf(),...Yf({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]),Zf=(Kf.props={},()=>[["parallel",0,1,0,1]]),Jf=(Zf.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,isVisual:i=!1})=>[["fisheye",t,e,n,r,i]]),Qf=(Jf.props={},({focusX:t=0,distortionX:e=2,isVisual:n=!1})=>[["fisheye.x",t,e,n]]),td=(Qf.props={},({focusY:t=0,distortionY:e=2,isVisual:n=!1})=>[["fisheye.x",t,e,n]]),ed=(td.props={},({value:e})=>t=>t.map(()=>e)),nd=(ed.props={},({value:e})=>t=>t.map(e)),rd=(nd.props={},({value:e})=>t=>t.map(t=>t[e])),id=(rd.props={},({value:t})=>()=>t);function ad(t,e){return t.parent===e.parent?1:2}function od(t,e){return t+e.x}function sd(t,e){return Math.max(t,e.y)}function ld(){var s=ad,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(od,0)/e.length,t.y=1+n.reduce(sd,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function cd(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function ud(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=fd)):void 0===e&&(e=hd);for(var n,r,i,a,o,t=new gd(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new gd(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(pd)}function hd(t){return t.children}function fd(t){return Array.isArray(t)?t[1]:null}function dd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function pd(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function gd(t){this.data=t,this.depth=this.height=0,this.parent=null}function yd(t){return null==t?null:md(t)}function md(t){if("function"!=typeof t)throw new Error;return t}function vd(){return 0}function bd(t){return function(){return t}}id.props={},gd.prototype=ud.prototype={constructor:gd,count:function(){return this.eachAfter(cd)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i,a=[this],o=-1;n=a.pop();)if(t.call(e,n,++o,this),r=n.children)for(i=r.length-1;0<=i;--i)a.push(r[i]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;0<=--r;)e+=n[r].value;t.value=e})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n},copy:function(){return ud(this).eachBefore(dd)},[Symbol.iterator]:function*(){var t,e,n,r,i,a=[this];do{for(e=a.reverse(),a=[];t=e.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length)}};const xd=4294967296;function wd(t,e){for(var n,r,i=0,a=(t=function(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(Array.from(t),e)).length,o=[];i<a;)n=t[i],r&&Ed(r,n)?++i:(r=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return Od(t[0],t[1]);case 3:return Sd(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(Md(e,t))return[e];for(n=0;n<t.length;++n)if(kd(e,t[n])&&Md(Od(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(kd(Od(t[n],t[r]),e)&&kd(Od(t[n],e),t[r])&&kd(Od(t[r],e),t[n])&&Md(Sd(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function kd(t,e){var n=t.r-e.r,r=e.x-t.x,e=e.y-t.y;return n<0||n*n<r*r+e*e}function Ed(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Md(t,e){for(var n=0;n<e.length;++n)if(!Ed(t,e[n]))return;return 1}function Od(t,e){var n=t.x,r=t.y,t=t.r,i=e.x,a=e.y,e=e.r,o=i-n,s=a-r,l=e-t,c=Math.sqrt(o*o+s*s);return{x:(n+i+o/c*l)/2,y:(r+a+s/c*l)/2,r:(c+t+e)/2}}function Sd(t,e,n){var r=t.x,i=t.y,t=t.r,a=e.x,o=e.y,e=e.r,s=n.x,l=n.y,n=n.r,c=r-a,u=r-s,h=i-o,f=i-l,d=e-t,p=n-t,g=r*r+i*i-t*t,a=g-a*a-o*o+e*e,o=g-s*s-l*l+n*n,e=u*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function _d(t,e,n){var r,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+n.r,o=t.r+n.r,(o*=o)<(i*=i)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*l,n.y=t.y-r*l+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*l,n.y=e.y+r*l+a*s)):(n.x=e.x+n.r,n.y=e.y)}function Ad(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Td(t){var e=t._,t=t.next._,n=e.r+t.r,r=(e.x*t.r+t.x*e.r)/n,t=(e.y*t.r+t.y*e.r)/n;return r*r+t*t}function Pd(t){this._=t,this.next=null,this.previous=null}function Ld(t,e){if(!(a=(t="object"==typeof(n=t)&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,a,o,s,l,c,u,h,f,d=t[0];if(d.x=0,d.y=0,!(1<a))return d.r;if(r=t[1],d.x=-r.r,r.x=d.r,r.y=0,!(2<a))return d.r+r.r;_d(r,d,i=t[2]),d=new Pd(d),r=new Pd(r),i=new Pd(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){_d(d._,r._,i=t[l]),i=new Pd(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(Ad(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(Ad(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=Td(d);(i=i.next)!==r;)(s=Td(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=wd(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function Cd(t){return Math.sqrt(t.value)}function Nd(){var n=null,r=1,i=1,a=vd;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%xd)/xd}();return t.x=r/2,t.y=i/2,n?t.eachBefore(jd(n)).eachAfter(Rd(a,.5,e)).eachBefore(Fd(1)):t.eachBefore(jd(Cd)).eachAfter(Rd(vd,1,e)).eachAfter(Rd(a,t.r/Math.min(r,i),e)).eachBefore(Fd(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=yd(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:bd(+t),e):a},e}function jd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Rd(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n<i;++n)e[n].r+=a;if(r=Ld(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function Fd(n){return function(t){var e=t.parent;t.r*=n,e&&(t.x=e.x+n*t.x,t.y=e.y+n*t.y)}}function Id(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Bd(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(r-e)/t.value;++s<l;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var Dd={depth:-1},zd={},Gd={};function Wd(t){return t.id}function Yd(t){return t.parentId}function Vd(){var y,m=Wd,v=Yd;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=m,h=v,f=new Map;if(null!=y){const p=c.map((t,e)=>{t=y(t,e,n),e=(t=""+t).length;return"/"===(t=qd(t,e-1)&&!qd(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(Hd);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(Hd(r)),c.push(Gd));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new gd(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?zd:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===zd)throw new Error("ambiguous: "+s);a.children?a.children.push(o):a.children=[o],o.parent=a}else{if(i)throw new Error("multiple roots");i=o}if(!i)throw new Error("no root");if(null!=y){for(;i.data===Gd&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===Gd;--t)o.data=null}if(i.parent=Dd,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(pd),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=yd(t),e):m},e.parentId=function(t){return arguments.length?(v=yd(t),e):v},e.path=function(t){return arguments.length?(y=yd(t),e):y},e}function Hd(t){let e=t.length;if(e<2)return"";for(;1<--e&&!qd(t,e););return t.slice(0,e)}function qd(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function Ud(t,e){return t.parent===e.parent?1:2}function Xd(t){var e=t.children;return e?e[0]:t.t}function $d(t){var e=t.children;return e?e[e.length-1]:t.t}function Kd(t,e){this._=t,this.parent=null,this.children=null,this.A=null,(this.a=this).z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Zd(){var f=Ud,l=1,c=1,u=null;function e(t){var e,n,r,i,a,o,s=function(t){for(var e,n,r,i,a,o=[t=new Kd(t,0)];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;0<=i;--i)o.push(n=e.children[i]=new Kd(r[i],i)),n.parent=e;return(t.parent=new Kd(null,0)).children=[t],t}(t);return s.eachAfter(h),s.parent.m=-s.z,s.eachBefore(d),u?t.eachBefore(p):((r=n=e=t).eachBefore(function(t){t.x<e.x&&(e=t),t.x>n.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:f(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function h(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,h=s.m;o=$d(o),i=Xd(i),o&&i;)s=Xd(s),(a=$d(a)).a=t,0<(r=o.z+u-i.z-l+f(o._,i._))&&(function(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}(function(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,h+=s.m,c+=a.m;o&&!$d(a)&&(a.t=o,a.m+=u-c),i&&!Xd(s)&&(s.t=i,s.m+=l-h,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(f=t,e):f},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function Jd(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}Kd.prototype=Object.create(gd.prototype);e=(1+Math.sqrt(5))/2;function Qd(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,y,m=[],v=e.children,b=0,x=0,w=v.length,k=e.value;b<w;){for(l=i-n,c=a-r;!(u=v[x++].value)&&x<w;);for(y=(h=f=u)*u*(g=Math.max(c/l,l/c)/(k*t)),p=Math.max(f/y,y/h);x<w;++x){if(u+=s=v[x].value,s<h&&(h=s),f<s&&(f=s),y=u*u*g,p<(d=Math.max(f/y,y/h))){u-=s;break}p=d}m.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?Bd(o,n,r,i,k?r+=c*u/k:a):Jd(o,n,r,k?n+=l*u/k:i,a),k-=u,b=x}return m}var tp=function e(a){function t(t,e,n,r,i){Qd(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(e);function ep(t,e,n,r,i){var a,o,g=t.children,s=g.length,y=new Array(s+1);for(y[0]=o=a=0;a<s;++a)y[a+1]=o+=g[a].value;!function t(e,n,r,i,a,o,s){if(n-1<=e)return(l=g[e]).x0=i,l.y0=a,l.x1=o,void(l.y1=s);var l=y[e],c=r/2+l,u=e+1,h=n-1;for(;u<h;){var f=u+h>>>1;y[f]<c?u=1+f:h=f}c-y[u-1]<y[u]-c&&e+1<u&&--u;var l=y[u]-l,d=r-l;{var p;s-a<o-i?(t(e,u,l,i,a,p=r?(i*d+o*l)/r:o,s),t(u,n,d,p,a,o,s)):(t(e,u,l,i,a,o,p=r?(a*d+s*l)/r:s),t(u,n,d,i,p,o,s))}}(0,s,t.value,e,n,r,i)}function np(t,e,n,r,i){(1&t.depth?Jd:Bd)(t,e,n,r,i)}var rp=function e(d){function t(t,e,n,r,i){if((a=t._squarify)&&a.ratio===d)for(var a,o,s,l,c,u=-1,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?Bd(o,e,n,r,f?n+=(i-n)*o.value/f:i):Jd(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=Qd(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(e);function ip(t={}){t=t.shapes;return[{name:"color"},{name:"opacity"},{name:"shape",range:t},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function ap(t={}){return[...ip(t),{name:"title",scale:"identity"},{name:"tooltip",scale:"identity",independent:!0}]}function op(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function sp(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function lp(t={}){return ip(t)}function cp(){return[{type:"maybeKey"}]}function up(t,e){return t.getBandWidth(t.invert(e))}function hp(t,e,n={}){const{x:a,y:o,series:s}=e,{x:l,y:c,series:u}=t,{style:{bandOffset:r=u?0:.5,bandOffsetX:h=r,bandOffsetY:f=r}={}}=n,d=!(null===l||void 0===l||!l.getBandWidth),p=!(null===c||void 0===c||!c.getBandWidth),g=!(null===u||void 0===u||!u.getBandWidth);return d||p?(t,e)=>{const n=d?up(l,a[e]):0;var r=p?up(c,o[e]):0,e=g&&s?(up(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function fp(t){return parseFloat(t)/100}function dp(t,e,n,r){const{x:i,y:a}=n,{width:o,height:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?fp(e)*o:+e,"string"==typeof t?fp(t)*s:+t]]})]}function pp(e){return"function"==typeof e?e:t=>t[e]}function gp(t,e){return Array.from(t,pp(e))}function yp(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=gp(t,e),o=gp(t,n),s=gp(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}function mp(t,e){return t.getBandWidth(t.invert(e))}const vp=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=mp(c,a[t]),n=e*(u?mp(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};vp.props={defaultShape:"rect",defaultLabelShape:"label",channels:[...ap({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...cp(),...sp()],interaction:{shareTooltip:!0}};const bp=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};function xp(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function wp(n){let a,o,i;function s(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<0?n=1+i:r=i}while(n<r)}return n}return i=2!==n.length?(a=xp,o=(t,e)=>xp(n(t),e),(t,e)=>n(t)-e):(a=n===xp||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:kp,o=n),{left:s,center:function(t,e,n=0,r=t.length){return r=s(t,e,n,r-1),n<r&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<=0?n=1+i:r=i}while(n<r)}return n}}}function kp(){return 0}bp.props={defaultShape:"rect",defaultLabelShape:"label",channels:[...ap({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeZeroY1"}],postInference:[...cp(),...sp()],interaction:{shareTooltip:!0}};l=wp(xp);const Ep=l.right,Mp=l.left,Op=wp(function(t){return null===t?NaN:+t}).center;function Sp(e,n){let r=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function _p(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1<r)return o/(r-1)}(t,e);return t&&Math.sqrt(t)}function Ap(e,n){let r,i;if(void 0===n)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(void 0===r?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}return[r,i]}class Tp{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){var n=this._partials;let r=0;for(let t=0;t<this._n&&t<32;t++){var i=n[t],a=e+i,i=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);i&&(n[r++]=i),e=a}return n[r]=e,this._n=r+1,this}valueOf(){var t=this._partials;let e=this._n,n,r,i,a=0;if(0<e){for(a=t[--e];0<e&&(n=a,r=t[--e],a=n+r,!(i=r-(a-n))););0<e&&(i<0&&t[e-1]<0||0<i&&0<t[e-1])&&(r=2*i,n=a+r,r==n-a)&&(a=n)}return a}}class Pp extends Map{constructor(t,e=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Lp(this,t))}has(t){return super.has(Lp(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):(t.set(e,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){e=e(n);t.has(e)&&(n=t.get(e),t.delete(e));return n}(this,t))}}function Lp({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function Cp(t){return t}function Np(t,...e){return Fp(t,Cp,Cp,e)}function jp(t,e,...n){return Fp(t,Cp,e,n)}function Rp(t,e,...n){return Fp(t,Array.from,e,n)}function Fp(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Pp,i=f[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function Ip(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1<i.length?(t=Uint32Array.from(e,(t,e)=>e),1<i.length?(i=i.map(t=>e.map(t)),t.sort((t,e)=>{for(const r of i){var n=Dp(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>Dp(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(Bp(n))}function Bp(r=xp){if(r===xp)return Dp;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function Dp(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var zp=Array.prototype.slice;function Gp(t){return()=>t}var Wp=Math.sqrt(50),Yp=Math.sqrt(10),Vp=Math.sqrt(2);function Hp(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/Math.pow(10,t);return 0<=t?(Wp<=n?10:Yp<=n?5:Vp<=n?2:1)*Math.pow(10,t):-Math.pow(10,-t)/(Wp<=n?10:Yp<=n?5:Vp<=n?2:1)}function qp(t){return Math.ceil(Math.log(Sp(t))/Math.LN2)+1}function Up(){var m=Cp,v=Ap,b=qp;function e(t){for(var e,n,r=(t=Array.isArray(t)?t:Array.from(t)).length,i=new Array(r),a=0;a<r;++a)i[a]=m(t[a],a,t);var o=v(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(v===Ap&&([s,l]=function(t,e,n){let r;for(;;){var i=Hp(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];0<i?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(s,l,u)),(c=function(n,r,t){var e,i,a,o,s=-1;if(t=+t,(n=+n)===(r=+r)&&0<t)return[n];if((e=r<n)&&(i=n,n=r,r=i),0===(o=Hp(n,r,t))||!isFinite(o))return[];if(0<o){let t=Math.round(n/o),e=Math.round(r/o);for(t*o<n&&++t,e*o>r&&--e,a=new Array(i=e-t+1);++s<i;)a[s]=(t+s)*o}else{o=-o;let t=Math.round(n*o),e=Math.round(r*o);for(t/o<n&&++t,e/o>r&&--e,a=new Array(i=e-t+1);++s<i;)a[s]=(t+s)/o}return e&&a.reverse(),a}(s,l,u))[0]<=s&&(n=Hp(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===Ap){const n=Hp(s,l,u);isFinite(n)&&(0<n?l=(Math.floor(l/n)+1)*n:n<0&&(l=(Math.ceil(l*-n)+1)/-n))}else c.pop()}for(var h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,y=new Array(h+1);for(a=0;a<=h;++a)(p=y[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Math.min(h,Math.floor((e-s)/n))].push(t[a]);else if(n<0)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&(g=Math.floor((s-e)*n),y[Math.min(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Ep(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:Gp(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:Gp([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:Gp(Array.isArray(t)?zp.call(t):t),e):b},e}function Xp(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function $p(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function Kp(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function Zp(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Jp(t,e,n){var r;if((n=(t=Float64Array.from(function*(e,n){if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?Kp(t):1<=e?Xp(t):(n=(n-1)*e,(r=Xp(function n(r,i,a=0,o=1/0,s){if(i=Math.floor(i),a=Math.floor(Math.max(0,a)),o=Math.floor(Math.min(r.length-1,o)),a<=i&&i<=o)for(s=void 0===s?Dp:Bp(s);a<o;){600<o-a&&(l=o-a+1,c=i-a+1,h=Math.log(l),u=.5*Math.exp(2*h/3),h=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),n(r,i,Math.max(a,Math.floor(i-c*u/l+h)),Math.min(o,Math.floor(i+(l-c)*u/l+h)),s));var l,c,u,h,f=r[i];let t=a,e=o;for(Zp(r,a,i),0<s(r[o],f)&&Zp(r,a,o);t<e;){for(Zp(r,t,e),++t,--e;s(r[t],f)<0;)++t;for(;0<s(r[e],f);)--e}0===s(r[a],f)?Zp(r,a,e):Zp(r,++e,o),e<=i&&(a=e+1),i<=e&&(o=e-1)}return r}(t,e=Math.floor(n)).subarray(0,e+1)))+(Kp(t.subarray(e+1))-r)*(n-e))}function Qp(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function t0(t,e){return Jp(t,.5,e)}function e0(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function n0(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function r0(e,n){let r=0;if(void 0===n)for(var t of e)(t=+t)&&(r+=t);else{let t=-1;for(var i of e)(i=+n(i,++t,e))&&(r+=i)}return r}function i0(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function a0(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function o0(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function s0(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function l0(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function c0(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function u0(t){return s0(t)||a0(t)}const h0=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(Np(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},f0=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t<n.length;t+=2)r.push([n[t],n[t+1]]);return r})]},d0=()=>(t,e,n,r)=>{return(l0(r)?f0:h0)(t,e,n,r)};d0.props={defaultShape:"line",defaultLabelShape:"label",channels:[...ap({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[{type:"maybeSeries"},{type:"maybeGradient"}],postInference:[...cp(),...sp(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const p0=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=hp(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/h,r=r/f,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};p0.props={defaultShape:"hollow",defaultLabelShape:"label",channels:[...ap({shapes:["hollow","hollowDiamond","hollowHexagon","hollowSquare","hollowTriangleDown","hollowTriangle","hollowBowtie","point","plus","diamond","square","triangle","hexagon","cross","bowtie","hyphen","line","tick","triangleDown"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",scale:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...cp(),{type:"maybeSize"},...op()]};const g0=s=>{const{cartesian:l=!1}=s;return l?dp:(t,e,n,r)=>{if(l)return dp(t,0,n,r);const{x:i,y:a}=n,o=hp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};g0.props={defaultShape:"text",defaultLabelShape:"label",channels:[...ap({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...cp(),...op()]};const y0=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};y0.props={defaultShape:"cell",defaultLabelShape:"label",channels:[...ap({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...cp(),...op()]};const m0=()=>(t,e,n,a)=>{const{x:o,y:s,y1:l,series:r}=n;n=r?Array.from(Np(t,t=>r[t]).values()):[t];return[n.map(t=>t[0]),Array.from(n,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t<e.length;t++){var i=e[t];r[t]=a.map([+o[i],+s[i]]),r[n+t]=a.map([+o[i],+l[i]])}return r}),n]};m0.props={defaultShape:"area",defaultLabelShape:"label",channels:[...ap({shapes:["area","smooth","step"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[...cp(),...sp()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const v0=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=hp(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};v0.props={defaultShape:"link",defaultLabelShape:"label",channels:[...ap({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...cp(),...op()]};const b0=s=>{var t=s["cartesian"];return t?dp:(t,e,n,r)=>{const{x:i,y:a}=n,o=hp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};b0.props={defaultShape:"image",defaultLabelShape:"label",channels:[...ap({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...cp(),...op()]};const x0=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t<o.length;t++){var r=o[t][e];if(void 0===r)break;var i=s[t][e];n.push(a.map([+r,+i]))}return n});return[t,n]};x0.props={defaultShape:"polygon",defaultLabelShape:"label",channels:[...ap({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[],postInference:[...cp(),...op()]};const w0=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,y4:d,series:p}=n,g=e.x,y=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(y?y.getBandWidth(y.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+h[t],+f[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]},k0=(w0.props={defaultShape:"box",defaultLabelShape:"label",channels:[...ap({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[{type:"maybeZeroX"}],postInference:[...cp(),...sp()],interaction:{shareTooltip:!0}},()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]});k0.props={defaultShape:"vector",defaultLabelShape:"label",channels:[...ap({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[],postInference:[...cp(),...op()]};const E0=()=>(t,e,n,r)=>{const i=n["y"];return[t,Array.from(t,t=>{return[[0,i[t]],[1,i[t]]].map(t=>r.map(t))})]};E0.props={defaultShape:"line",defaultLabelShape:"label",channels:[...lp({shapes:["line"]}),{name:"y",required:!0}],preInference:[{type:"maybeTupleY"}],postInference:[...cp()]};const M0=()=>(t,e,n,r)=>{const i=n["x"];return[t,Array.from(t,t=>{return[[i[t],1],[i[t],0]].map(t=>r.map(t))})]};M0.props={defaultShape:"line",defaultLabelShape:"label",channels:[...lp({shapes:["line"]}),{name:"x",required:!0}],preInference:[{type:"maybeTupleX"}],postInference:[...cp()]};const O0=(...t)=>v0(...t);function S0(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function _0(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=S0("x",r,n,e.x),o=S0("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}O0.props={defaultShape:"connector",defaultLabelShape:"label",channels:[...lp({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[],postInference:[...cp()]};const A0=()=>_0();A0.props={defaultShape:"range",defaultLabelShape:"label",channels:[...lp({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[],postInference:[...cp()]};const T0=()=>_0({extendY:!0});T0.props={defaultShape:"range",defaultLabelShape:"label",channels:[...lp({shapes:["range"]}),{name:"x",required:!0}],preInference:[],postInference:[...cp()]};const P0=()=>_0({extendX:!0});function L0(t){return t.target.depth}function C0(t,e){return t.sourceLinks.length?t.depth:e-1}function N0(t){return function(){return t}}function j0(t,e){return F0(t.source,e.source)||t.index-e.index}function R0(t,e){return F0(t.target,e.target)||t.index-e.index}function F0(t,e){return t.y0-e.y0}function I0(t){return t.value}function B0(t){return t.index}function D0(t){return t.nodes}function z0(t){return t.links}function G0(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function W0({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function Y0(){let x=0,w=0,k=1,E=1,M=24,O=8,S,_=B0,A=C0,T,P,L,C=D0,N=z0,j=6;function e(e){e={nodes:C(e),links:N(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[_(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=G0(g,n)),"object"!=typeof r&&(r=t.target=G0(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=L)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(L),r.sort(L)}t=e.nodes;for(const y of t)y.value=void 0===y.fixedValue?Math.max(r0(y.sourceLinks,I0),r0(y.targetLinks,I0)):y.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(T){var s,l=Math.max(Xp(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.call(null,s,l)}}{var c=(i=e.nodes).length;let t=new Set(i),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(Xp(t,t=>t.depth)+1,0),n=(k-x-M)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(A.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+M,r[i]?r[i].push(a):r[i]=[a]}if(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(O,(E-w)/(Xp(u,t=>t.length)-1)),u),h=Kp(t,t=>(E-w-(t.length-1)*S)/r0(t,I0));for(const m of t){let e=w;for(const v of m){v.y0=e,v.y1=e+v.value*h,e=v.y1+S;for(const b of v.sourceLinks)b.width=b.value*h}e=(E-e+S)/(m.length+1);for(let t=0;t<m.length;++t){var f=m[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===L)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(R0),n.sort(j0)}(m)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!function(n,r,i){for(let t=n.length,e=t-2;0<=e;--e){var a,o=n[e];for(const c of o){let t=0,e=0;for(var{target:s,value:l}of c.sourceLinks){l=l*(s.layer-c.layer);t+=function(t,e){let n=e.y0-(e.targetLinks.length-1)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}for(var{target:a,width:o}of t.sourceLinks){if(a===e)break;n-=o}return n}(c,s)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,F(c))}void 0===P&&o.sort(F0),o.length&&R(o,i)}}(u,d,p),!function(n,r,i){for(let t=1,e=n.length;t<e;++t){var a,o=n[t];for(const c of o){let t=0,e=0;for(var{source:s,value:l}of c.targetLinks){l=l*(c.layer-s.layer);t+=function(t,e){let n=t.y0-(t.sourceLinks.length-1)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}for(var{source:a,width:o}of e.targetLinks){if(a===t)break;n-=o}return n}(s,c)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,F(c))}void 0===P&&o.sort(F0),o.length&&R(o,i)}}(u,d,p)}return W0(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,1+n,e),a(t,E,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;n<t.length;++n){var i=t[n],a=(e-i.y0)*r;1e-6<a&&(i.y0+=a,i.y1+=a),e=i.y1+S}}function a(t,e,n,r){for(;0<=n;--n){var i=t[n],a=(i.y1-e)*r;1e-6<a&&(i.y0-=a,i.y1-=a),e=i.y0-S}}function F({sourceLinks:t,targetLinks:e}){if(void 0===L){for(const{source:{sourceLinks:t}}of e)t.sort(R0);for(const{target:{targetLinks:e}}of t)e.sort(j0)}}return e.update=function(t){return W0(t),t},e.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:N0(t),e):_},e.nodeAlign=function(t){return arguments.length?(A="function"==typeof t?t:N0(t),e):A},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(M=+t,e):M},e.nodePadding=function(t){return arguments.length?(O=S=+t,e):O},e.nodes=function(t){return arguments.length?(C="function"==typeof t?t:N0(t),e):C},e.links=function(t){return arguments.length?(N="function"==typeof t?t:N0(t),e):N},e.linkSort=function(t){return arguments.length?(L=t,e):L},e.size=function(t){return arguments.length?(x=w=0,k=+t[0],E=+t[1],e):[k-x,E-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],k=+t[1][0],w=+t[0][1],E=+t[1][1],e):[[x,w],[k,E]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}P0.props={defaultShape:"range",defaultLabelShape:"label",channels:[...lp({shapes:["range"]}),{name:"y",required:!0}],preInference:[],postInference:[...cp()]};const V0={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},H0={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Kp(t.sourceLinks,L0)-1:0},justify:C0};const q0=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},V0,h),l=Y0().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?H0[n]||C0:"function"==c?n:C0).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}};function U0(t){return t}function X0(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function $0(t=""){throw new Error(t)}function K0(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function Z0(t){return null!=t&&!Number.isNaN(t)}function Q(t,e){return J0(t,e)||{}}function J0(t,n){t=Object.entries(t).filter(([t])=>t.startsWith(n)).map(([t,e])=>[Pf(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function Q0(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function tg(t){return"object"==typeof t&&!(t instanceof Date)&&null!==t}q0.props={};const eg=y=>{const m={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},v={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},b={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:null}},x={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10};return()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={}}=y,{links:t,nodes:l}=yp(t,e),c=Q(e,"node"),e=Q(e,"link"),{key:u=t=>t.key,color:h=u}=c,{links:i,nodes:t}=q0(Object.assign(Object.assign(Object.assign({},m),{nodeId:pp(u)}),i))({links:t,nodes:l});const f=Q(r,"label"),{text:d=u,spacing:p=5}=f,g=J(f,["text","spacing"]);return[R({},v,{data:t,encode:Object.assign(Object.assign({},c),{color:h}),scale:n,style:Q(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},x),{text:d,dx:t=>t.x[0]<.5?p:-p}),g),...a],animate:"object"==typeof s?Q(s,"node"):s,axis:!1}),R({},b,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa"},Q(r,"link")),animate:"object"==typeof s?Q(s,"link"):s})]}},ng=(eg.props={composite:!0},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);ng.props={defaultShape:"path",defaultLabelShape:"label",channels:[...ap({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[],postInference:[...cp()]};const rg=t=>t?parseInt(t):0;function ig(t,e,n,r){var i;return e?(e=t,t=getComputedStyle(e),i=e.clientWidth||rg(t.width),e=e.clientHeight||rg(t.height),{width:(i={width:i-(rg(t.paddingLeft)+rg(t.paddingRight)),height:e-(rg(t.paddingTop)+rg(t.paddingBottom))}).width,height:i.height}):{width:n,height:r}}function ag(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t;return{width:e-r-i-s-l-h-f,height:t-a-n-c-o-d-u}}function og(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:ep,treemapDice:Bd,treemapSlice:Jd,treemapSliceDice:np,treemapSquarify:tp,treemapResquarify:rp};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?Vd().path(p):Vd():ud)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(Id),t}function y(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;i<n&&(n=i=(n+i)/2),a<r&&(r=a=(r+a)/2),t.x0=n,t.y0=r,t.x1=i,t.y1=a,t.children&&(e=l[t.depth+1]=c(t)/2,n+=d(t)-e,r+=u(t)-e,(i-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:t[r]).sort(e.sort):p.count(),o=tp,i=!1,s=a=1,l=[0],d=f=h=u=c=vd,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=md(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:bd(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:bd(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:bd(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:bd(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:bd(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}const sg=u=>t=>{var{width:t,height:e}=ag(t),{data:n,encode:r={},scale:i,style:a={},layout:o={},labels:s=[]}=u,l=J(u,["data","encode","scale","style","layout","labels"]),c={tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0},t={type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"}},e=og(n,R({},c,o),r),n=Q(a,"label");return[R({},t,Object.assign(Object.assign({data:e,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0,lineHeight:t=>t.y1-t.y0}),n),...s]},l),{axis:!1}))]},lg=(sg.props={composite:!0},u=>t=>{var{width:t,height:e}=ag(t),{data:n,encode:r={},scale:i={},style:a={},layout:o={},labels:s=[]}=u,l=J(u,["data","encode","scale","style","layout","labels"]),c={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:r.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:r.color?void 0:t=>0===t.height?"":"#000"}},n=((t,e,n)=>{const r=n["value"];n=(Af(t)?Vd().path(e.path):ud)(t);return r?n.sum(t=>t[r]).sort(e.sort):n.count(),Nd().size(e.size).padding(e.padding)(n),n.descendants()})(n,R({},{size:[t,e],padding:0,sort:(t,e)=>e.value-t.value},o),R({},c.encode,r)),t=Q(a,"label");return[R({},c,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r,lineHeight:t=>2*t.r}),t),...s]},l),{axis:!1}))]});function cg(t,e){return Kp(t,t=>e[t])}function ug(t,e){return Xp(t,t=>e[t])}function hg(t,e){const n=2.5*fg(t,e)-1.5*pg(t,e);return Kp(t,t=>e[t]>=n?e[t]:NaN)}function fg(t,e){return Jp(t,.25,t=>e[t])}function dg(t,e){return Jp(t,.5,t=>e[t])}function pg(t,e){return Jp(t,.75,t=>e[t])}function gg(t,e){const n=2.5*pg(t,e)-1.5*fg(t,e);return Xp(t,t=>e[t]<=n?e[t]:NaN)}function yg(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(Np(t,t=>a[+t]).values()).flatMap(t=>{const e=hg(t,i),n=gg(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}lg.props={composite:!0};const mg=s=>()=>{var{data:t,encode:e,style:n={}}=s,r=J(s,["data","encode","style"]),{extend:i=!1}=n,n=J(n,["extend"]),a=e["y"],a={y:a,y1:a,y2:a,y3:a,y4:a},o={y1:fg,y2:dg,y3:pg};return i?[Object.assign({type:"box",data:t,transform:[Object.assign(Object.assign({type:"groupX",y:cg},o),{y4:ug})],encode:Object.assign(Object.assign({},e),a),style:n},r)]:(i=Q(n,"box"),n=Q(n,"point"),[Object.assign({type:"box",data:t,transform:[Object.assign(Object.assign({type:"groupX",y:hg},o),{y4:gg})],encode:Object.assign(Object.assign({},e),a),style:i},r),{type:"point",data:t,transform:[{type:yg}],encode:e,style:Object.assign({},n)}])},vg=(mg.props={composite:!0},s=>{var t=s["cartesian"];return t?dp:(t,e,n,r)=>{const{x:i,y:a}=n,o=hp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function bg(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,!(d=(i=d)[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function xg(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function wg(t){return t[0]}function kg(t){return t[1]}function Eg(t,e,n){e=new Mg(null==e?wg:e,null==n?kg:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function Mg(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Og(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}vg.props={defaultShape:"shape",defaultLabelShape:"label",channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};Za=Eg.prototype=Mg.prototype;function Sg(t){return function(){return t}}function _g(t){return 1e-6*(t()-.5)}function Ag(t){return t.index}function Tg(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function Pg(c){var u,h,a,o,f,d,s=Ag,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=Sg(30),p=1;function e(t){for(var e=0,n=c.length;e<p;++e)for(var r,i,a,o,s,l=0;l<n;++l)r=(i=c[l]).source,a=(i=i.target).x+i.vx-r.x-r.vx||_g(d),o=i.y+i.vy-r.y-r.vy||_g(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[l]),i.vy-=o*s,r.vx+=a*(s=1-s),r.vy+=o*s}function i(){if(a){var t,e=a.length,n=c.length,r=new Map(a.map((t,e)=>[s(t,e,a),t])),i=0;for(o=new Array(e);i<n;++i)(t=c[i]).index=i,"object"!=typeof t.source&&(t.source=Tg(r,t.source)),"object"!=typeof t.target&&(t.target=Tg(r,t.target)),o[t.source.index]=(o[t.source.index]||0)+1,o[t.target.index]=(o[t.target.index]||0)+1;for(i=0,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=new Array(n),g()}}function l(){if(a)for(var t=0,e=c.length;t<e;++t)u[t]=+n(c[t],t,c)}function g(){if(a)for(var t=0,e=c.length;t<e;++t)h[t]=+r(c[t],t,c)}return null==c&&(c=[]),e.initialize=function(t,e){a=t,d=e,i()},e.links=function(t){return arguments.length?(c=t,i(),e):c},e.id=function(t){return arguments.length?(s=t,e):s},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(n="function"==typeof t?t:Sg(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:Sg(+t),g(),e):r},e}Za.copy=function(){var t,e,n=new Mg(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(r)if(r.length)for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Og(e));else n._root=Og(r);return n},Za.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return bg(this.cover(e,n),e,n,t)},Za.addAll=function(t){for(var e,n,r=t.length,i=new Array(r),a=new Array(r),o=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<r;++u)isNaN(e=+this._x.call(null,n=t[u]))||isNaN(n=+this._y.call(null,n))||((i[u]=e)<o&&(o=e),l<e&&(l=e),(a[u]=n)<s&&(s=n),c<n&&(c=n));if(!(l<o||c<s))for(this.cover(o,s).cover(l,c),u=0;u<r;++u)bg(this,i[u],a[u],t[u]);return this},Za.cover=function(t,e){if(!isNaN(t=+t)&&!isNaN(e=+e)){var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;t<n||i<=t||e<r||a<=e;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}this._x0=n,this._y0=r,this._x1=i,this._y1=a}return this},Za.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},Za.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Za.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],y=this._root;for(y&&g.push(new xg(y,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(y=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<h||(i=r.y1)<f||(y.length?(g.push(new xg(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new xg(y[2],s,c,a,i),new xg(y[1],a,l,o,c),new xg(y[0],s,l,a,c)),(i=(c<=e)<<1|a<=t)&&(r=g[g.length-1],g[g.length-1]=g[g.length-1-i],g[g.length-1-i]=r)):(l=(o=t-+this._x.call(null,y.data))*o+(s=e-+this._y.call(null,y.data))*s)<n&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=y.data));return u},Za.remove=function(t){if(!isNaN(a=+this._x.call(null,t))&&!isNaN(o=+this._y.call(null,t))){var e,n,r,i,a,o,s,l,c,u,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,y=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+y)/2))?p=s:y=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},Za.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Za.root=function(){return this._root},Za.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},Za.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new xg(c,this._x0,this._y0,this._x1,this._y1));a=l.pop();)!t(c=a.node,n=a.x0,r=a.y0,i=a.x1,a=a.y1)&&c.length&&(o=(n+i)/2,s=(r+a)/2,(e=c[3])&&l.push(new xg(e,o,s,i,a)),(e=c[2])&&l.push(new xg(e,n,s,o,a)),(e=c[1])&&l.push(new xg(e,o,r,i,s)),e=c[0])&&l.push(new xg(e,n,r,o,s));return this},Za.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new xg(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new xg(i,a,o,c,u)),(i=h[1])&&n.push(new xg(i,c,o,s,u)),(i=h[2])&&n.push(new xg(i,a,u,c,l)),i=h[3])&&n.push(new xg(i,c,u,s,l)),r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Za.x=function(t){return arguments.length?(this._x=t,this):this._x},Za.y=function(t){return arguments.length?(this._y=t,this):this._y};var Lg={value:()=>{}};function Cg(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Ng(r)}function Ng(t){this._=t}function jg(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Lg,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Ng.prototype=Cg.prototype={constructor:Ng,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(0<=n&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=jg(i[n],t.name,e);else if(null==e)for(n in i)i[n]=jg(i[n],t.name,null);return this}for(;++o<s;)if(n=(n=(t=a[o]).type)&&function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(i[n],t.name))return n},copy:function(){var t,e={},n=this._;for(t in n)e[t]=n[t].slice();return new Ng(e)},call:function(t,e){if(0<(n=arguments.length-2))for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var Rg,Fg,Ig=0,Bg=0,Dg=0,zg=1e3,Gg=0,Wg=0,Yg=0,Vg="object"==typeof performance&&performance.now?performance:Date,Hg="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function qg(){return Wg||(Hg(Ug),Wg=Vg.now()+Yg)}function Ug(){Wg=0}function Xg(){this._call=this._time=this._next=null}function $g(t,e,n){var r=new Xg;return r.restart(t,e,n),r}function Kg(){Wg=(Gg=Vg.now())+Yg,Ig=Bg=0;try{qg(),++Ig;for(var t,e=Rg;e;)0<=(t=Wg-e._time)&&e._call.call(void 0,t),e=e._next;--Ig}finally{for(var n,r,i=Rg,a=1/(Ig=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:Rg=r);Fg=n,Jg(a),Wg=0}}function Zg(){var t=Vg.now(),e=t-Gg;zg<e&&(Yg-=e,Gg=t)}function Jg(t){Ig||(Bg=Bg&&clearTimeout(Bg),24<t-Wg?(t<1/0&&(Bg=setTimeout(Kg,t-Vg.now()-Yg)),Dg=Dg&&clearInterval(Dg)):(Dg||(Gg=Vg.now(),Dg=setInterval(Zg,zg)),Ig=1,Hg(Kg)))}Xg.prototype=$g.prototype={constructor:Xg,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?qg():+n)+(null==e?0:+e),this._next||Fg===this||(Fg?Fg._next=this:Rg=this,Fg=this),this._call=t,this._time=n,Jg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jg())}};const Qg=4294967296;function t1(t){return t.x}function e1(t){return t.y}var n1=10,r1=Math.PI*(3-Math.sqrt(5));function i1(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=$g(i),n=Cg("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Qg)/Qg}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.forEach(function(t){t(o)}),e=0;e<r;++e)null==(n=l[e]).fx?n.x+=n.vx*=u:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=u:(n.y=n.fy,n.vy=0);return a}function d(){for(var t,e,n,r=0,i=l.length;r<i;++r)(n=l[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),(isNaN(n.x)||isNaN(n.y))&&(t=n1*Math.sqrt(.5+r),e=r*r1,n.x=t*Math.cos(e),n.y=t*Math.sin(e)),(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}function p(t){return t.initialize&&t.initialize(l,r),t}return null==l&&(l=[]),d(),a={tick:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.forEach(p),a):l},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(e=+t,a):e},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(c=+t,a):c},velocityDecay:function(t){return arguments.length?(u=1-t,a):1-u},randomSource:function(t){return arguments.length?(r=t,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.get(t)},find:function(t,e,n){var r,i,a,o=0,s=l.length;for(null==n?n=1/0:n*=n,o=0;o<s;++o)(r=(r=t-(i=l[o]).x)*r+(r=e-i.y)*r)<n&&(a=i,n=r);return a},on:function(t,e){return 1<arguments.length?(n.on(t,e),a):n.on(t)}}}function a1(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,F=(r=Sg(-30),d=(f=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,I()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:Sg(+t),I(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=Eg(i,t1,e1).visitAfter(B);for(u=t,e=0;e<n;++e)l=i[e],r.visit(D)}function I(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function B(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else for((e=t).x=e.data.x,e.y=e.data.y;o+=h[e.data.index],e=e.next;);t.value=o}function D(t,e,n,r){if(!t.value)return!0;var i=t.x-l.x,a=t.y-l.y,o=r-e,s=i*i+a*a;if(o*o/p<s)return s<d&&(0===i&&(s+=(i=_g(c))*i),0===a&&(s+=(a=_g(c))*a),s<f&&(s=Math.sqrt(f*s)),l.vx+=i*t.value*u/s,l.vy+=a*t.value*u/s),!0;if(!(t.length||d<=s))for((t.data!==l||t.next)&&(0===i&&(s+=(i=_g(c))*i),0===a&&(s+=(a=_g(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var y,m,v,b,x,w,k,E,M,O,S,_,A,T,n=Pg(a).id(pp(n)),P=("function"==typeof o&&F.strength(o),"function"==typeof s&&n.strength(s),i1(t).force("link",n).force("charge",F));function L(t){for(var e,n=0,r=m.length;n<r;++n)(e=m[n]).vy+=(b[n]-e.y)*v[n]*t}function C(){if(m){var t,e=m.length;for(v=new Array(e),b=new Array(e),t=0;t<e;++t)v[t]=isNaN(b[t]=+y(m[t],t,m))?0:+x(m[t],t,m)}}function N(t){for(var e,n=0,r=k.length;n<r;++n)(e=k[n]).vx+=(M[n]-e.x)*E[n]*t}function j(){if(k){var t,e=k.length;for(E=new Array(e),M=new Array(e),t=0;t<e;++t)E[t]=isNaN(M[t]=+w(k[t],t,k))?0:+O(k[t],t,k)}}function R(){for(var t,e=A.length,n=0,r=0,i=0;i<e;++i)n+=(t=A[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-_)*T,i=0;i<e;++i)(t=A[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==_&&(_=0),R.initialize=function(t){A=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(_=+t,R):_},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(O=Sg(.1),"function"!=typeof w&&(w=Sg(null==w?0:+w)),N.initialize=function(t){k=t,j()},N.strength=function(t){return arguments.length?(O="function"==typeof t?t:Sg(+t),j(),N):O},N.x=function(t){return arguments.length?(w="function"==typeof t?t:Sg(+t),j(),N):w},N)).force("y",(x=Sg(.1),"function"!=typeof y&&(y=Sg(null==y?0:+y)),L.initialize=function(t){m=t,C()},L.strength=function(t){return arguments.length?(x="function"==typeof t?t:Sg(+t),C(),L):x},L.y=function(t){return arguments.length?(y="function"==typeof t?t:Sg(+t),C(),L):y},L)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const o1=h=>()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={}}=h,l=Q(e,"node"),c=Q(e,"link"),{links:t,nodes:u}=yp(t,e),{nodesData:t,linksData:u}=a1({links:t,nodes:u},R({},{joint:!0},i),e);return[R({},{type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},{data:u,encode:c,labels:o,style:Q(r,"link"),animate:"object"==typeof s?Q(s,"link"):s}),R({},{type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},{data:t,encode:Object.assign({},l),scale:n,style:Q(r,"node"),labels:[Object.assign(Object.assign({},{text:""}),Q(r,"label")),...a],animate:"object"==typeof s?Q(s,"node"):s})]},s1=(o1.props={composite:!0},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=ud(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),l1=t=>s1(ld)(t),c1=(l1.props={},t=>s1(Zd)(t)),u1=(c1.props={},c=>{const u={sortBy:(t,e)=>e.value-t.value},h={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},f={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},d={text:"",fontSize:10};return()=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={}}=c,l=null==e?void 0:e.value,{nodes:i,edges:l}=c1(Object.assign(Object.assign(Object.assign({},u),i),{field:l}))(t);return[R({},f,{data:l,encode:Q(e,"link"),scale:Q(n,"link"),labels:o,style:Object.assign({stroke:"#999"},Q(r,"link")),animate:"object"==typeof s?Q(s,"link"):s}),R({},h,{data:i,scale:Q(n,"node"),encode:Q(e,"node"),labels:[Object.assign(Object.assign({},d),Q(r,"label")),...a],style:Object.assign({},Q(r,"node")),animate:"object"==typeof s?Q(s,"node"):s})]}});u1.props={composite:!0};var h1={},f1={},d1=34,p1=10,g1=13;function y1(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function m1(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function v1(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function b1(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+v1(-e,6):9999<e?"+"+v1(e,6):v1(e,4))+"-"+v1(t.getUTCMonth()+1,2)+"-"+v1(t.getUTCDate(),2)+(a?"T"+v1(n,2)+":"+v1(r,2)+":"+v1(i,2)+"."+v1(a,3)+"Z":i?"T"+v1(n,2)+":"+v1(r,2)+":"+v1(i,2)+"Z":r||n?"T"+v1(n,2)+":"+v1(r,2)+"Z":"")}function x1(r){var e=new RegExp('["'+r+"\n\r]"),h=r.charCodeAt(0);function n(r,t){var e,n=[],i=r.length,a=0,o=0,s=i<=0,l=!1;function c(){if(s)return f1;if(l)return l=!1,h1;var t,e,n=a;if(r.charCodeAt(n)===d1){for(;a++<i&&r.charCodeAt(a)!==d1||r.charCodeAt(++a)===d1;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===p1?l=!0:e===g1&&(l=!0,r.charCodeAt(a)===p1)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===p1)l=!0;else if(e===g1)l=!0,r.charCodeAt(a)===p1&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===p1&&--i,r.charCodeAt(i-1)===g1&&--i;(e=c())!==f1;){for(var u=[];e!==h1&&e!==f1;)u.push(e),e=c();t&&null==(u=t(u,o++))||n.push(u)}return n}function i(t,n){return t.map(function(e){return n.map(function(t){return o(e[t])}).join(r)})}function a(t){return t.map(o).join(r)}function o(t){return null==t?"":t instanceof Date?b1(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,a){var o,s;return(t=n(t,function(t,e){if(o)return o(t,e-1);var n,r,i;s=t,o=a?(r=a,i=y1(n=t),function(t,e){return r(i(t),e,n)}):y1(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?m1(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?m1(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function w1(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;k1&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const k1=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),E1=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>Oe(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),x1(i).parse(t,a?w1:U0);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};E1.props={};const M1=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};M1.props={};const O1=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},S1=(O1.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});S1.props={};const _1=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};_1.props={};const A1=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};A1.props={};const T1=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]<i[e]?-1:+(r[e]!==i[e]):r[e]>i[e]?-1:+(r[e]!==i[e]),0))}},P1=(T1.props={},t=>{const e=t["value"];return()=>e}),L1=(P1.props={},t=>{const{callback:e=U0}=t;return t=>e(t)}),C1=(L1.props={},t=>{const{callback:e=U0}=t;return t=>Array.isArray(t)?t.map(e):t});C1.props={};var N1=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const j1={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function R1(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:y,targetWeight:m,sortBy:v}=Object.assign(Object.assign({},j1),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=y(t),t.targetWeight=m(t)});const i=Np(r,t=>t.source),a=Np(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=r0(e,t=>t.sourceWeight)+r0(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:N1[v])&&r.sort(n),!(n=(r=e).length))throw $0("Invalid nodes: it's empty!");if(h){const o=f/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-f),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!h)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=Np(e,t=>t.source),l=Np(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const F1=e=>t=>R1(e)(t),I1=(F1.props={},Math.PI/180),B1=64,D1=2048;function z1(t){return t.text}function G1(){return"serif"}function W1(){return"normal"}function Y1(t){return t.value}function V1(){return 90*~~(2*Math.random())}function H1(){return 1}function q1(){}function U1(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(B1<<5)/c,D1/c);let i=0,a=0,n=0;var u,h,f,d,e=r.length;for(--s;++s<e;){o=r[s],l.save(),l.font=o.style+" "+o.weight+" "+~~((o.size+1)/c)+"px "+o.font;let t=l.measureText(o.text+"m").width*c,e=o.size<<1;if(o.rotate?(d=Math.sin(o.rotate*I1),f=Math.cos(o.rotate*I1),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=B1<<5&&(i=0,a+=n,n=0),a+e>=D1)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*I1),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(B1<<5)/c,D1/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var y=o.width,m=y>>5;let n=o.y1-o.y0;for(let t=0;t<n*m;t++)g[t]=0;if(null==(i=o.xoff))return;a=o.yoff;let r=0,t=-1;for(let e=0;e<n;e++){for(let t=0;t<y;t++){var v=m*e+(t>>5),b=p[(a+e)*(B1<<5)+(i+t)<<2]?1<<31-t%32:0;g[v]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*m)}}}function X1(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function $1(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function K1(){return document.createElement("canvas")}function Z1(t){return"function"==typeof t?t:function(){return t}}const J1={archimedean:X1,rectangular:function(t){const n=4*t[0]/t[1];let r=0,i=0;return function(t){var e=t<0?-1:1;switch(Math.sqrt(1+4*e*t)-e&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};function Q1(){let b=[256,256],r=z1,i=G1,p=Y1,g=W1,y=V1,m=H1,x=X1,w=Math.random,v=q1,k=[],E=null,M=1/0;const O=W1,S=K1,_={};return _.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(B1<<5)/e,t.height=D1/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=_.board||$1((b[0]>>5)*b[1]),c=k.length,u=[],h=k.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=O.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=y.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=m.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=_.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<M&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,U1(s,i,h,f),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e<l;e++){for(let t=u=0;t<=a;t++)if((u<<s|(t<a?(u=i[e*a+t])>>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}(t,e))){var f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),y=127&g,m=32-y,v=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<v;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<m|(t<d?(n=f[e*d+t])>>>y:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:_,word:i}),u.push(i),d?_.hasImage||(t=d,e=i,n=void 0,n=t[0],t=t[1],e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}_._tags=u,_._bounds=d,f>=c&&(_.stop(),v.call(null,"end",{cloud:_,words:u,bounds:d}))}return E&&clearInterval(E),E=setInterval(n,0),n(),_},_.stop=function(){return E&&(clearInterval(E),E=null),_},_.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=$1((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e<r;e++)for(let t=0;t<n;t++){var s=i*e+(t>>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}_.board=a,_.hasImage=!0}},_.timeInterval=function(t){M=null==t?1/0:t},_.words=function(t){k=t},_.size=function(t=[]){b=[+t[0],+t[1]]},_.text=function(t){r=Z1(t)},_.font=function(t){i=Z1(t)},_.fontWeight=function(t){g=Z1(t)},_.rotate=function(t){y=Z1(t)},_.spiral=function(t){x=J1[t]||t},_.fontSize=function(t){p=Z1(t)},_.padding=function(t){m=Z1(t)},_.random=function(t){w=Z1(t)},_.on=function(t){v=Z1(t)},_}const ty={size:[500,500],fontSize:[14,28]};function ey(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const ny=f=>h=>Oe(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},ty,f),e=Q1(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return Oe(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=h.map(t=>t.value),n=t,t=[Kp(e),Xp(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",ey,e.createMask),e.words([...h]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=J(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function ry(e){return"string"==typeof e?t=>t[e]:e}ny.props={};const iy=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=ry(r),l=ry(t),c=jp(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},ay=(iy.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});ay.props={};const oy=u=>c=>Oe(void 0,void 0,void 0,function*(){var{width:t,height:e}=ag(c),{data:n,encode:r={},scale:i,style:a={},layout:o={}}=u,s=J(u,["data","encode","scale","style","layout"]),l={size:[t,e]},t={axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},e=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(n,r),n=yield ny(Object.assign(Object.assign({},l),o))(e);return[R({},t,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a},s),{axis:!1}))]}),sy=(oy.props={composite:!0},()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"]),ly=(sy.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),cy=(ly.props={},()=>["#95F0FF","#78D3F8","#5AB8DB","#3A9DBF","#0A82A4","#00698A","#005170","#003958","#002440"]),uy=(cy.props={},()=>["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"]),hy=(uy.props={},()=>["#9DF5CA","#61DDAA","#42C090","#19A576","#008A5D","#006F45","#00562F","#003E19","#002800"]),fy=(hy.props={},()=>["#8CF4F2","#6FD8D6","#52BCBA","#31A09F","#008685","#006C6C","#005354","#003B3D","#002627"]),dy=(fy.props={},()=>["#D0E4FF","#B4C8ED","#99ADD1","#7E92B5","#65789B","#4C6080","#334867","#1B324F","#021D38"]),py=(dy.props={},()=>["#FFC771","#FFAB57","#F6903D","#D77622","#B85C00","#9B4300","#7D2A00","#601000","#450000"]),gy=(py.props={},()=>["#FFC2EC","#FFA6D0","#F08BB4","#D37099","#B65680","#9A3C67","#7E214F","#630038","#490022"]),yy=(gy.props={},()=>["#FFBB95","#FF9E7B","#FF8362","#E8684A","#C84D32","#AA311C","#8C1104","#6F0000","#510000"]),my=(yy.props={},()=>["#FFD83B","#F6BD16","#D7A100","#B98700","#9C6E00","#7F5600","#633F00","#482900","#2F1400"]),vy=(my.props={},()=>["#FFCCFF","#EBB0FF","#CE95F5","#B27AD8","#9661BC","#7B48A1","#613086","#48186C","#2E0054"]),by=(vy.props={},()=>["#FDEDBE","#FFDF80","#FFCB33","#FFB200","#FF8C00","#FF6500","#E6450F","#B22C00","#661900"]),xy=(by.props={},()=>["#FFEBB0","#FFDF80","#FACA3E","#E6B80B","#B5AC23","#6A9A48","#20876B","#06746B","#044E48"]),wy=(xy.props={},()=>["#FFEBB0","#FFDF80","#FACA3E","#E6B80B","#B5AC23","#6A9A48","#20876B","#06746B","#044E48"]),ky=(wy.props={},()=>["#D2EDC8","#A9DACC","#75C6D1","#42B3D5","#3993C2","#3073AE","#27539B","#1E3388","#171E6D"]),Ey=(ky.props={},()=>["#003F7F","#004C99","#0059B2","#0072E5","#1A8CFF","#4DA6FF","#80BFFF","#B3D9FF","#EAE9EB","#FFD5B1","#FFC08C","#FFAB66","#FF963E","#F17F0B","#D16A0C","#A45411","#794012"]),My=(Ey.props={},()=>["#661900","#B22C00","#E6450F","#FF6500","#FF8C00","#FFB200","#FFCB33","#FFDF80","#E0F2EB","#66D8FF","#1AC5FF","#007FFF","#0059FF","#0040FF","#002CB2","#FFDF80","#001F7F"]),Oy=(My.props={},()=>["#014c63","#10686c","#168575","#16a37e","#0bc286","#65cf9b","#96dcb0","#c1e8c5","#F2EAEA","#FFC5AC","#FFA884","#FF895D","#FF6836","#F3470D","#D13808","#A4300C","#7A270E"]),Sy=(Oy.props={},()=>["#661900","#B22C00","#E6450F","#FF6500","#FF8C00","#FFB200","#FFCB33","#FFDF80","#FFE2DC","#EAACFF","#DD78FF","#C53FFF","#A700FF","#8500FF","#620BE1","#3607C2","#27029A"]);function _y(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function Ay(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function Ty(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);a<o;){var l=Math.floor((a+o)/2);s(t[l])>e?o=l:a=l+1}return a}Sy.props={};const Py=Math.sqrt(50),Ly=Math.sqrt(10),Cy=Math.sqrt(2);function Ny(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=Py?10:n>=Ly?5:n>=Cy?2:1)*10**t:-(10**-t)/(n>=Py?10:n>=Ly?5:n>=Cy?2:1)}function jy(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=Py?r*=10:n>=Ly?r*=5:n>=Cy&&(r*=2),e<t?-r:r}const Ry=(t,e,n=5)=>{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o<a&&([a,o]=[o,a],[r,i]=[i,r]),0<(s=Ny(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=Ny(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=Ny(a,o,n)),0<s?(t[r]=Math.floor(a/s)*s,t[i]=Math.ceil(o/s)*s):s<0&&(t[r]=Math.ceil(a*s)/s,t[i]=Math.floor(o*s)/s),t},Fy=36e5,Iy=864e5,By=7*Iy;Iy,Iy;function Dy(t,n,s,r){const i=(t,e)=>{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}Ql=Dy(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),eo=Dy(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),no=Dy(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),ro=Dy(Fy,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Fy*e)},t=>t.getHours()),oo=Dy(Iy,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Iy*e)},t=>t.getDate()-1);const zy=Dy(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());so=Dy(By,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+By*e)},t=>{var e=zy.floor(t),t=new Date(+t);return Math.floor((+t-+e)/By)}),lo=Dy(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const Gy={millisecond:Ql,second:eo,minute:no,hour:ro,day:oo,week:so,month:zy,year:lo};co=Dy(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),uo=Dy(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),a=Dy(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),ho=Dy(Fy,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Fy*e)},t=>t.getUTCHours()),fo=Dy(Iy,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Iy*e)},t=>t.getUTCDate()-1);const Wy=Dy(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());po=Dy(By,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+By*e)},t=>{var e=Wy.floor(t),t=new Date(+t);return Math.floor((+t-+e)/By)}),io=Dy(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const Yy={millisecond:co,second:uo,minute:a,hour:ho,day:fo,week:po,month:Wy,year:io};function Vy(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?Yy:Gy;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=Ty(i,l,0,c,s);let h;return h=u===c?[a,jy(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1])<s(i[u])/l?i[u-1]:i[u],[c,r?Math.ceil(r/c.duration):a]):[o,Math.max(jy(t,e,n),1)]}const Hy=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Vy(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function qy(t){return null!=t&&!Number.isNaN(t)}const Uy=e=>t=>-e(-t),Xy=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:t=>Math.log(t)/n;return e?Uy(t):t},$y=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?Uy(n):n},Ky=(t,e,n,r)=>{var i=t<0,a=Xy(r,i),r=$y(r,i),i=e<t,o=i?t:e,e=[r(Math.floor(a(i?e:t))),r(Math.ceil(a(o)))];return i?e.reverse():e};function Zy(e,o){return t=>{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return Cf(t)?Math.round(t):t}):i;this.output=_y(a,r,e,t)},t.prototype.invert=void 0}}var Jy,Kl={exports:{}},nc={exports:{}},Qy=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},tm=Array.prototype.concat,em=Array.prototype.slice,nm=nc.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];Qy(i)?e=tm.call(e,em.call(i)):e.push(i)}return e},rm=(nm.wrap=function(t){return function(){return t(nm(arguments))}},{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),im=nc.exports,am=Object.hasOwnProperty,om=Object.create(null);for(Jy in rm)am.call(rm,Jy)&&(om[rm[Jy]]=Jy);var sm=Kl.exports={to:{},get:{}};function lm(t,e,n){return Math.min(Math.max(e,t),n)}function cm(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}sm.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=sm.get.hsl(t),n="hsl";break;case"hwb":e=sm.get.hwb(t),n="hwb";break;default:e=sm.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},sm.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(e.slice(a,2+a),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:am.call(rm,e[1])?((i=rm[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]))}e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=lm(i[n],0,255);return i[3]=lm(i[3],0,1),i},sm.get.hsl=function(t){var e;return(t=t&&t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,lm(parseFloat(t[2]),0,100),lm(parseFloat(t[3]),0,100),lm(isNaN(e)?1:e,0,1)]):null},sm.get.hwb=function(t){var e;return(t=t&&t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,lm(parseFloat(t[2]),0,100),lm(parseFloat(t[3]),0,100),lm(isNaN(e)?1:e,0,1)]):null},sm.to.hex=function(){var t=im(arguments);return"#"+cm(t[0])+cm(t[1])+cm(t[2])+(t[3]<1?cm(Math.round(255*t[3])):"")},sm.to.rgb=function(){var t=im(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},sm.to.rgb.percent=function(){var t=im(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},sm.to.hsl=function(){var t=im(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},sm.to.hwb=function(){var t=im(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},sm.to.keyword=function(t){return om[t.slice(0,3)]};var um=Kl.exports;function hm(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function fm(t){var e,n,r,t=um.get(t);return t?({model:t,value:e}=t,"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*hm(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*hm(n,r,e),255*hm(n,r,e-1/3),t]):null):null}const dm=(e,n)=>t=>e*(1-t)+n*t,pm=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return dm(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=fm(n),c=fm(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},gm=(t,e)=>{const n=dm(t,e);return t=>Math.round(n(t))};function ym({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function mm(t){return"object"==typeof t?t.valueOf():t}class vm extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=mm,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(ym({map:this.map,initKey:this.initKey},t))}has(t){return super.has(ym({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class bm{constructor(t){this.options=R({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=R({},this.options,t),this.rescale(t)}rescale(t){}}const xm=Symbol("defaultUnknown");function wm(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function km(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==xm)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function Em(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Mm extends bm{constructor(t){super(t)}getDefaultOptions(){return{domain:[],range:[],unknown:xm}}map(t){return 0===this.domainIndexMap.size&&wm(this.domainIndexMap,this.getDomain(),this.domainKey),km({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&wm(this.rangeIndexMap,this.getRange(),this.rangeKey),km({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=Em(e),this.rangeKey=Em(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new Mm(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function Om(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new vm(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new vm(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let y=o?Math.round(t):t;var m=new Array(l);for(let t=0;t<l;t+=1){m[t]=(v=y,Math.round(1e12*v)/1e12);var v=e[t];y+=g.get(v)}return{valueBandWidth:c,valueStep:g,adjustedRange:m}}class Sm extends Mm{constructor(t){super(t)}getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:xm,flex:[]}}clone(){return new Sm(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t["domain"];if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!(null==(n=t.flex)||!n.length))return Om(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:a}=t;let o,s,l=n[0];return n=n[1]-l,o=n/Math.max(1,2*t+(e-r)),i&&(o=Math.floor(o)),l+=(n-o*(e-r))*a,s=o*(1-r),i&&(l=Math.round(l),s=Math.round(s)),t=new Array(e).fill(0).map((t,e)=>l+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const _m=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=Ny(a,o,n);if(0===s||!Number.isFinite(s))return[];if(0<s){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i};function Am(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Tm=[1,5,2,2.5,4,3],Pm=100*Number.EPSILON;const Lm=(n,r,t=5,i=!0,a=Tm,o=[.25,.2,.5,.05])=>{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,h,f,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let y=1;for(;y<1/0;){for(let t=0;t<a.length;t+=1){var m=a[t],v=(h=m,f=a,d=y,p=void 0,p=Gf(f),1-Df(f,h)/(p-1)-d+1);if(o[0]*v+o[1]+o[2]+o[3]<g.score){y=1/0;break}let e=2;for(;e<1/0;){x=e;var b=(u=s)<=x?2-(x-1)/(u-1):1;if(o[0]*v+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/y/m;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=y*m*10**t,k=(M=r,k=w*(e-1),(M-=n)<k?1-((k-M)/2)**2/(.1*M)**2:1);if(o[0]*v+o[1]*k+o[2]*b+o[3]<g.score)break;var E=Math.floor(r/w)*y-(e-1)*y,M=Math.ceil(n/w)*y;if(E<=M){var O=M-E;for(let t=0;t<=O;t+=1){var S=(E+t)*(w/y),_=S+w*(e-1),A=w,T=function(t,e,n,r,i,a){var o=Gf(e),e=Df(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<Pm||a-t<Pm)&&r<=0&&0<=i?1:s)}(m,a,y,S,_,A),P=1-.5*((r-_)**2+(n-S)**2)/(.1*(r-n))**2,L=(l=e,L=n,l=(l-1)/(_-(C=S)),c=((c=s)-1)/(Math.max(_,r)-Math.min(L,C)),2-Math.max(l/c,c/l)),C=o[0]*T+o[1]*P+o[2]*L+ +o[3];g.score<C&&(!i||S<=n&&r<=_)&&(g.lmin=S,g.lmax=_,g.lstep=A,g.score=C)}}t+=1}e+=1}}y+=1}var t=Am(g.lmax),e=Am(g.lmin),N=Am(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=Am(e);for(let t=1;t<j;t+=1)R[t]=Am(R[t-1]+N);return R};class Cm extends bm{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Lm}}map(t){return qy(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Cm(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Cf(t)&&Cf(r)?n(t,r,e):[]}}const Nm=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return _y(o=t<r?(a=Ay(t,r),n(e,i)):(a=Ay(r,t),n(i,e)),a)},jm=(r,t,e)=>{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t<i;t+=1)a[t]=Ay(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=Ty(r,t,1,i)-1,n=a[e];return _y(o[e],n)(t)}},Rm=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?jm:Nm)(t,e,r?gm:n)};class Fm extends bm{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:dm,tickCount:5}}map(t){return qy(t)?this.output(t):this.options.unknown}invert(t){return qy(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options["tickMethod"],[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Ry}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,t=this.options.domain.map(t),n=Math.min(t.length,n.length);if(e){e=t[0],t=t[n-1];const r=t<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return If}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=Rm(n.map(t),r,a,i);this.output=_y(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=Rm(i,r.map(t),dm);this.input=_y(e,n,i)}}class Im extends Fm{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:pm,tickMethod:_m,tickCount:5}}chooseTransforms(){return[If,If]}clone(){return new Im(this.options)}}class Bm extends Sm{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:xm,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Bm(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Dm=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class zm extends Fm{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:pm,tickMethod:_m,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[If,If]:(t=.5===r?Dm:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new zm(this.options)}}class Gm extends zm{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:pm,tickMethod:_m,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Gm(this.options)}}class Wm extends bm{constructor(t){super(t)}getDefaultOptions(){return{domain:[.5],range:[0,1]}}map(t){return qy(t)?(t=Ty(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new Wm(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const Ym=(t,e,n,r=10)=>{var i=t<0,a=$y(r,i),o=Xy(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var y=g*t;if(c<y)break;l<=y&&f.push(y)}}2*f.length<n&&(f=_m(l,c,n))}else f=_m(u,h,Math.min(h-u,n)).map(a);return s?f.reverse():f};class Vm extends Fm{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:pm,tickMethod:Ym,tickCount:5}}chooseNice(){return Ky}getTickMethodOptions(){var{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){var{base:t,domain:e}=this.options,e=e[0]<0;return[Xy(t,e),$y(t,e)]}clone(){return new Vm(this.options)}}class Hm extends Wm{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Lm}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=Ry(n,t,e))}getTicks(){var t=this.options["tickMethod"],[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();var{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){var[t,e]=super.invert(t),[n,r]=this.options.domain;return void 0===t&&void 0===e?[t,e]:[t||n,e||r]}getThresholds(){return this.thresholds}clone(){return new Hm(this.options)}}function qm(t,e,n=!1){var r=t,i=(n||r.sort((t,e)=>t-e),[]);for(let t=1;t<e;t+=1)i.push(function(t,e){var n,r=t.length;if(r)return r<2?t[r-1]:(r=(r-1)*e,(n=t[e=Math.floor(r)])+(t[e+1]-n)*(r-e))}(r,t/e));return i}class Um extends Wm{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Lm}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=qm(t,this.n+1,!1)}invert(t){var[t,e]=super.invert(t),n=this.options["domain"],r=n[0],n=n[n.length-1];return void 0===t&&void 0===e?[t,e]:[t||r,e||n]}getThresholds(){return this.thresholds}clone(){return new Um(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Xm=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,$m=/\[([^]*?)\]/gm;function Km(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Zm(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a,o=i[r];for(a in o)t[a]=o[a]}return t}function Jm(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var Qm,Ao=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ac=["January","February","March","April","May","June","July","August","September","October","November","December"],lc=Km(ac,3),tv=Zm({},{dayNamesShort:Km(Ao,3),dayNames:Ao,monthNamesShort:lc,monthNames:ac,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),ev={D:function(t){return String(t.getDate())},DD:function(t){return Jm(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Jm(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Jm(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Jm(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Jm(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Jm(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Jm(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Jm(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Jm(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Jm(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Jm(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return(t.getHours()<12?e.amPm[0]:e.amPm[1]).toUpperCase()},ZZ:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+Jm(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+Jm(Math.floor(Math.abs(t)/60),2)+":"+Jm(Math.abs(t)%60,2)}},nv={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const rv=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Vy(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function iv(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class av extends Fm{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:rv,interpolate:dm,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Hy}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?Yy:Gy,s=t?iv:If;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t)<t?".SSS":n.floor(t)<t?":ss":r.floor(t)<t?"hh:mm":i.floor(t)<t?"hh A":o.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":s.floor(t)<t?"MMMM":"YYYY"}(t,o),n=void 0;if(void 0===t&&(t=nv.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var r=[],i=(t=(t=nv[t]||t).replace($m,function(t,e){return r.push(e),"@@@"}),Zm(Zm({},tv),n));return(t=t.replace(Xm,function(t){return ev[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new av(this.options)}}var ov;let sv=Qm=class extends Im{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:If,tickMethod:_m,tickCount:5}}constructor(t){super(t)}clone(){return new Qm(this.options)}};sv=Qm=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([Zy(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return _y(dm(0,1),Ay(t,e))})],sv);let lv=ov=class extends Im{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:If,tickMethod:_m,tickCount:5}}constructor(t){super(t)}clone(){return new ov(this.options)}};lv=ov=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([Zy(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=_y(dm(0,.5),Ay(e,n)),a=_y(dm(.5,1),Ay(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],lv);const cv=t=>new Sm(t),uv=(cv.props={},t=>new Im(t)),hv=(uv.props={},t=>new Mm(t)),fv=(hv.props={},t=>new Cm(t)),dv=(fv.props={},t=>new Bm(t)),pv=(dv.props={},t=>new av(t)),gv=(pv.props={},t=>new Vm(t)),yv=(gv.props={},t=>new zm(t)),mv=(yv.props={},t=>new Wm(t)),vv=(mv.props={},t=>new Um(t)),bv=(vv.props={},t=>new Hm(t)),xv=(bv.props={},t=>new Gm(t)),wv=(xv.props={},t=>new sv(t));function kv(t){return function(){return t}}wv.props={};const Ev=Math.abs,Mv=Math.atan2,Ov=Math.cos,Sv=Math.max,_v=Math.min,Av=Math.sin,Tv=Math.sqrt,Pv=1e-12,Lv=Math.PI,Cv=Lv/2,Nv=2*Lv;function jv(t){return 1<=t?Cv:t<=-1?-Cv:Math.asin(t)}const Rv=Math.PI,Fv=2*Rv,Iv=1e-6,Bv=Fv-Iv;function Dv(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class zv{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Dv:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return Dv;const r=10**e;return function(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=Math.round(arguments[t]*r)/r+n[t]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: "+i);var a,o,s=this._x1,l=this._y1,c=n-t,u=r-e,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>Iv&&(Math.abs(f*c-u*h)>Iv&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((Rv-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>Iv&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*n)},${this._x1=t+r*c},${this._y1=e+r*u}`):this._append`L${this._x1=t},${this._y1=e}`)}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error("negative radius: "+n);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Iv||Math.abs(this._y1-c)>Iv)&&this._append`L${l},${c}`,n&&((h=h<0?h%Fv+Fv:h)>Bv?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>Iv&&this._append`A${n},${n},0,${+(h>=Rv)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Gv(){return new zv}function Wv(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new zv(r)}function Yv(t){return t.innerRadius}function Vv(t){return t.outerRadius}function Hv(t){return t.startAngle}function qv(t){return t.endAngle}function Uv(t){return t&&t.padAngle}function Xv(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/Tv(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*Tv(Sv(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function $v(){var A=Yv,T=Vv,P=kv(0),L=null,C=Hv,N=qv,j=Uv,R=null,F=Wv(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,k=+A.apply(this,arguments),E=+T.apply(this,arguments),M=C.apply(this,arguments)-Cv,O=N.apply(this,arguments)-Cv,S=Ev(O-M),_=M<O;if(R=R||(t=F()),E<k&&(e=E,E=k,k=e),E>Pv?S>Nv-Pv?(R.moveTo(E*Ov(M),E*Av(M)),R.arc(0,0,E,M,O,!_),k>Pv&&(R.moveTo(k*Ov(O),k*Av(O)),R.arc(0,0,k,O,M,_))):(r=e=M,i=n=O,o=a=S,f=(u=j.apply(this,arguments)/2)>Pv&&(L?+L.apply(this,arguments):Tv(k*k+E*E)),w=x=s=_v(Ev(E-k)/2,+P.apply(this,arguments)),f>Pv&&(h=jv(f/k*Av(u)),f=jv(f/E*Av(u)),(a-=2*h)>Pv?(r+=h*=_?1:-1,i-=h):(a=0,r=i=(M+O)/2),(o-=2*f)>Pv?(e+=f*=_?1:-1,n-=f):(o=0,e=n=(M+O)/2)),u=E*Ov(e),h=E*Av(e),f=k*Ov(i),M=k*Av(i),s>Pv&&(d=E*Ov(n),p=E*Av(n),g=k*Ov(r),y=k*Av(r),S<Lv)&&((O=function(t,e,n,r,i,a,o,s){var l=(s=s-a)*(n=n-t)-(o=o-i)*(r=r-e);if(!(l*l<Pv))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,M))?(S=u-O[0],v=h-O[1],b=d-O[0],m=p-O[1],v=1/Av((1<(S=(S*b+v*m)/(Tv(S*S+v*v)*Tv(b*b+m*m)))?0:S<-1?Lv:Math.acos(S))/2),b=Tv(O[0]*O[0]+O[1]*O[1]),x=_v(s,(k-b)/(v-1)),w=_v(s,(E-b)/(1+v))):x=w=0),o>Pv?w>Pv?(l=Xv(g,y,u,h,E,w,_),c=Xv(d,p,f,M,E,w,_),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,Mv(l.y01,l.x01),Mv(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,w,Mv(l.y01,l.x01),Mv(l.y11,l.x11),!_),R.arc(0,0,E,Mv(l.cy+l.y11,l.cx+l.x11),Mv(c.cy+c.y11,c.cx+c.x11),!_),R.arc(c.cx,c.cy,w,Mv(c.y11,c.x11),Mv(c.y01,c.x01),!_))):(R.moveTo(u,h),R.arc(0,0,E,e,n,!_)):R.moveTo(u,h),k>Pv&&a>Pv?x>Pv?(l=Xv(f,M,d,p,k,-x,_),c=Xv(u,h,g,y,k,-x,_),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,Mv(l.y01,l.x01),Mv(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,x,Mv(l.y01,l.x01),Mv(l.y11,l.x11),!_),R.arc(0,0,k,Mv(l.cy+l.y11,l.cx+l.x11),Mv(c.cy+c.y11,c.cx+c.x11),_),R.arc(c.cx,c.cy,x,Mv(c.y11,c.x11),Mv(c.y01,c.x01),!_))):R.arc(0,0,k,i,r,_):R.lineTo(f,M)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+A.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+C.apply(this,arguments)+ +N.apply(this,arguments))/2-Lv/2;return[Ov(e)*t,Av(e)*t]},e.innerRadius=function(t){return arguments.length?(A="function"==typeof t?t:kv(+t),e):A},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:kv(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:kv(+t),e):P},e.padRadius=function(t){return arguments.length?(L=null==t?null:"function"==typeof t?t:kv(+t),e):L},e.startAngle=function(t){return arguments.length?(C="function"==typeof t?t:kv(+t),e):C},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:kv(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:kv(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function Kv(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Zv(t){this._context=t}function Jv(t){return new Zv(t)}function Qv(t){return t[0]}function tb(t){return t[1]}function eb(o,s){var l=kv(!0),c=null,u=Jv,h=null,f=Wv(e);function e(t){var e,n,r,i=(t=Kv(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?Qv:kv(o),s="function"==typeof s?s:void 0===s?tb:kv(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:kv(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:kv(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:kv(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function nb(u,h,f){var d=null,p=kv(!0),g=null,y=Jv,m=null,v=Wv(e);function e(t){var e,n,r,i,a,o=(t=Kv(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(m=y(a=v())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),r=e-1;n<=r;--r)m.point(l[r],c[r]);m.lineEnd(),m.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),m.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return m=null,a+""||null}function t(){return eb().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?Qv:kv(+u),h="function"==typeof h?h:kv(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?tb:kv(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:kv(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:kv(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:kv(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:kv(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:kv(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:kv(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:kv(!!t),e):p},e.curve=function(t){return arguments.length?(y=t,null!=g&&(m=y(g)),e):y},e.context=function(t){return arguments.length?(null==t?g=m=null:m=y(g=t),e):g},e}Gv.prototype=zv.prototype,Zv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var rb=ab(Jv);function ib(t){this._curve=t}function ab(e){function t(t){return new ib(e(t))}return t._curve=e,t}function ob(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(ab(t)):e()._curve},t}function sb(){}function lb(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function cb(t,e){this._context=t,this._k=(1-e)/6}function ub(t,e){this._context=t,this._k=(1-e)/6}function hb(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>Pv&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>Pv&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function fb(t,e){this._context=t,this._alpha=e}ib.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},cb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:lb(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:lb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new cb(t,n)}return t.tension=function(t){return e(+t)},t}(0),ub.prototype={areaStart:sb,areaEnd:sb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:lb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new ub(t,n)}return t.tension=function(t){return e(+t)},t}(0),fb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:hb(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var db=function e(n){function t(t){return n?new fb(t,n):new cb(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function pb(t,e){this._context=t,this._alpha=e}pb.prototype={areaStart:sb,areaEnd:sb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:hb(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gb=function e(n){function t(t){return n?new pb(t,n):new ub(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function yb(t){this._context=t}function mb(t){return new yb(t)}function vb(t,e){this._context=t,this._t=e}function bb(t){return new vb(t,.5)}function xb(t){return new vb(t,0)}function wb(t){return new vb(t,1)}function tt(t){return new kb([t],null,t,t.ownerDocument)}yb.prototype={areaStart:sb,areaEnd:sb,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},vb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),0<=this._line&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:var n;this._t<=0?(this._context.lineTo(this._x,e),this._context.lineTo(t,e)):(n=this._x*(1-this._t)+t*this._t,this._context.lineTo(n,this._y),this._context.lineTo(n,e))}this._x=t,this._y=e}};class kb{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}selectAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new kb(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new kb(this._elements,null,this._parent,this._document,void 0,void 0,t)}select(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new kb([t],null,t,this._document)}append(t){var e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){var r=this._data[t],[r,i]=Array.isArray(r)?r:[r,null],a=e(r,t);a.__data__=r,null!==i&&(a.__fromElements__=i),this._parent.appendChild(a),n.push(a)}return new kb(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){var o=this._elements[t],s=e(o.__data__,t);o.appendChild(s),n.push(s)}return new kb(n,null,n[0],this._document)}maybeAppend(t,e){var n=this._elements[0],r=n.getElementById(t);return r||((r="string"==typeof e?this.createElement(e):e()).id=t,n.appendChild(r)),new kb([r],null,this._parent,this._document)}data(e,n=t=>t,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),h=Np(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const Np=h.get(d);s.push([f,Np]);for(const y of Np)o.delete(y);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new kb([],i,this._parent,this._document),new kb(a,null,this._parent,this._document),new kb(o,null,this._parent,this._document),new kb([],s,this._parent,this._document),new kb(l,null,this._parent,this._document)];return new kb(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new kb(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=kb.registry[t])?new e:$0("Unknown node type: "+t)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;t<this._elements.length;t++){const n=this._elements[t];var e=this._transitions[t];e?(Array.isArray(e)?e:[e]).map(t=>t.finished.then(()=>n.remove())):n.remove()}return new kb([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;t<this._elements.length;t++){var n=this._elements[t],r=n.__data__;e.call(n,r,t)}return this}attr(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function Eb([t,e],[n,r]){return[t-n,e-r]}function Mb([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Ob([t,e]){return Math.atan2(e,t)}function Sb([t,e]){return Ob([t,e])+Math.PI/2}function _b(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(var[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);var t=n-e,s=i-r;return[e,r,t,s]}function Ab([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Tb(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function Pb(t){return t.map((t,e)=>e)}function F(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function Lb(t,e,n){var n=n["arrowSize"],n="string"==typeof n?+parseFloat(n)/100*Mb(t,e):n,r=Math.PI/6,t=Math.atan2(e[1]-t[1],e[0]-t[0]),i=Math.PI/2-t-r,t=t-r;return[[e[0]-n*Math.sin(i),e[1]-n*Math.cos(i)],[e[0]-n*Math.cos(t),e[1]-n*Math.sin(t)]]}function Cb(t,e,n,r,i){e=Ob(Eb(r,e))+Math.PI,n=Ob(Eb(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function Nb(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=Pb(a),[r,o]=Ap(t,t=>a[t]);const s=new Im({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function jb(t){var[t,e,n,r]=t;return[r,t,e,n]}function Rb(t,e,n){var[e,r,,i]=i0(t)?jb(e):e,[n,a]=n,t=t.getCenter(),o=Sb(Eb(e,t)),r=Sb(Eb(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:Mb(i,t),outerRadius:Mb(e,t)}}function Fb(t,e,n,r){var i=t["defaultColor"],t=t[e]||{},e=t[n]||t[r];return Object.assign({defaultColor:i},e)}function Ib(t){var{opacityAttribute:t="fill"}=t;return t+"Opacity"}function Bb(t,e){return a0(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}kb.registry={g:qo,rect:os,circle:Bo,path:ts,text:ls,ellipse:Vo,image:Ko,line:Jo,polygon:ns,polyline:is,html:Xo};const Db=P=>{const{colorAttribute:L,first:C=!0,last:N=!0}=P,j=J(P,["colorAttribute","opacityAttribute","first","last"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),{defaultColor:i,radius:a=0}=r,o=J(r,["defaultColor","radius"]),r=o.lineWidth||1,{stroke:s,radius:a=a,radiusTopLeft:l=a,radiusTopRight:c=a,radiusBottomRight:u=a,radiusBottomLeft:h=a,innerRadius:f=0,innerRadiusTopLeft:d=f,innerRadiusTopRight:p=f,innerRadiusBottomRight:g=f,innerRadiusBottomLeft:f=f,inset:y=0,insetLeft:m=y,insetRight:v=y,insetBottom:b=y,insetTop:x=y,lineWidth:r="stroke"===L||s?r:0}=j,w=J(j,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","inset","insetLeft","insetRight","insetBottom","insetTop","lineWidth"]),{color:i=i,opacity:k}=e;if(!a0(n)&&!s0(n)){var[E,,M]=!!i0(n)?jb(t):t;const[T,_]=E;var[M,E]=Eb(M,E),O=(0<M?T:T+M)+m,S=(0<E?_:_+E)+x,M=Math.abs(M)-(m+v),m=Math.abs(E)-(x+b);return tt(new os({})).call(F,o).style("lineWidth",r).style("x",O).style("y",S).style("width",M).style("height",m).style("stroke",void 0===s?i:s).style(Ib(P),k).style(L,i).style("radius",[C?l:d,C?c:p,N?u:g,N?h:f]).call(F,w).node()}const{y:_,y1:A}=e;v=n.getCenter(),E=Rb(n,t,[_,A]),x=$v().cornerRadius(a).padAngle(y*Math.PI/180);return tt(new ts({})).call(F,o).style("path",x(E)).style("transform",`translate(${v[0]}, ${v[1]})`).style("stroke",i||s).style("lineWidth",r).style(L,i).style(Ib(P),k).call(F,j).node()}},zb=(Db.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>Db(Object.assign({colorAttribute:"fill"},t))),Gb=(zb.props=Object.assign({},Db.props),t=>Db(Object.assign({colorAttribute:"stroke"},t)));Gb.props=Object.assign({},Db.props);const Wb=t=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(i0(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,l=J(t,["adjustPoints"]);return(t,e,n,r,i,...a)=>{var o=e["index"],o=i[o+1],t=s(t,o,n);return Db(Object.assign({colorAttribute:"fill"},l))(t,e,n,r,i,...a)}};function Yb(t,e,n){var[t,r,i,a]=t;if(i0(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}Wb.props=Object.assign({},Db.props);const Vb=t=>Wb(Object.assign({adjustPoints:Yb},t));function Hb(t){const e="function"==typeof t?t:t.render;return class extends zo{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Vb.props=Object.assign({},Db.props);const qb=Hb(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;tt(t).maybeAppend("line",()=>new ts({})).style("d",e).call(F,r),tt(t).maybeAppend("line1",()=>new ts({})).style("d",n).call(F,i)});const Ub=t=>{const{curve:h,gradient:f=!1,gradientColor:d="between",defined:p=t=>!Number.isNaN(t)&&null!=t,connectNulls:g=!1}=t,y=J(t,["curve","gradient","gradientColor","defined","connectNulls"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=J(r,["defaultColor","lineWidth"]),{color:r=i,size:i=a,seriesColor:a,seriesX:s,seriesY:l}=e,a=f&&a?Nb(a,s,l,f,d):r,s=Bb(n,e),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),a&&{stroke:a}),i&&{lineWidth:i}),s&&{transform:s}),y);let c;if(a0(n)){const u=n.getCenter();c=n=>ob(eb().curve(rb)).angle((t,e)=>Sb(Eb(n[e],u))).radius((t,e)=>Mb(n[e],u)).defined(([t,e])=>p(t)&&p(e)).curve(h)(n)}else c=eb().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>p(t)&&p(e)).curve(h);var[r,e]=function(t,e){var n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,p),o=Q(l,"connect"),a=!!e.length;return(!a||g&&!Object.keys(o).length?tt(new ts({})).style("d",c(r)).call(F,l):a&&!g?tt(new ts({})).style("d",c(t)).call(F,l):tt(new qb).style("style1",Object.assign(Object.assign({},l),o)).style("style2",l).style("d1",e.map(c).join(",")).style("d2",c(t))).node()}},Xb=(Ub.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=a0(n)?mb:Jv;return Ub(Object.assign({curve:i},a))(t,e,n,r)}),$b=(Xb.props=Object.assign({},Ub.props),t=>{const{alpha:a=.5}=t,o=J(t,["alpha"]);return(t,e,n,r)=>{var i=a0(n)?gb:db;return Ub(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),Kb=($b.props=Object.assign({},Ub.props),t=>Ub(Object.assign({curve:wb},t))),Zb=(Kb.props=Object.assign({},Ub.props),t=>Ub(Object.assign({curve:xb},t))),Jb=(Zb.props=Object.assign({},Ub.props),t=>Ub(Object.assign({curve:bb},t)));function Qb(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]}Jb.props=Object.assign({},Ub.props);var t2,e2=Object.freeze({__proto__:null,point:Qb,square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},triangleDown:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]},hexagon:function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]},bowtie:function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]},line:function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},cross:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]},tick:function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]},plus:function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]},hyphen:function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}});const c=f=>{const{colorAttribute:d,symbol:t,mode:p="auto"}=f,g=J(f,["colorAttribute","symbol","mode"]),y=e2[t]||Qb;return(t,e,n,r)=>{var i,{mark:a,shape:o,defaultShape:s}=e,r=Fb(r,a,o,s),{defaultColor:a,lineWidth:o}=r,s=J(r,["defaultColor","lineWidth"]),r=g.stroke?o||1:o,{color:o=a,transform:a,opacity:l}=e,[c,u]=1===(c=t).length?c[0]:([[c,h],[u,i]]=c,[(c+u)/2,(h+i)/2]),h=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||c0(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(p,t,e,n)||g.r||s.r;return tt(new ts).call(F,s).style("d",y(c,u,h)).style("lineWidth",r).style("transform",a).style("stroke",o).style(Ib(f),l).style(d,o).call(F,g).node()}},n2=(c.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>c(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t))),r2=(n2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"cross"},t))),i2=(r2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"fill",symbol:"diamond"},t))),a2=(i2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t))),o2=(a2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t))),s2=(o2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t))),l2=(s2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t))),c2=(l2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"point"},t))),u2=(c2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"square"},t))),h2=(u2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t))),f2=(h2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t))),d2=(f2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t))),p2=(d2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"line"},t))),g2=(p2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"plus"},t))),y2=(g2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"fill",symbol:"point"},t))),m2=(y2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"fill",symbol:"square"},t))),v2=(m2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"stroke",symbol:"tick"},t))),b2=(v2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"fill",symbol:"triangle"},t))),x2=(b2.props=Object.assign({},c.props),t=>c(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t))),w2=(x2.props=Object.assign({},c.props),t=>{const{arrowSize:u="40%"}=t,h=J(t,["arrowSize"]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=Fb(r,e,i,a),e=r["defaultColor"],i=J(r,["defaultColor"]),[a,r]=t,[t,l]=Lb(a,r,{arrowSize:u}),c=Gv();return c.moveTo(...a),c.lineTo(...r),c.moveTo(...r),c.lineTo(...t),c.moveTo(...r),c.lineTo(...l),tt(new ts).call(F,i).style("d",c.toString()).style("stroke",o||e).style("fill",o||e).style("transform",s).call(F,h).node()}});function k2(t,e,n,r){this.message=t,this.expected=e,this.found=n,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,k2)}function E2(){this.constructor=t2}w2.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t2=k2,dc=Error,E2.prototype=dc.prototype,t2.prototype=new E2,k2.buildMessage=function(t,e){var a={literal:function(t){return'"'+r(t.text)+'"'},class:function(t){for(var e="",n=0;n<t.parts.length;n++)e+=t.parts[n]instanceof Array?i(t.parts[n][0])+"-"+i(t.parts[n][1]):i(t.parts[n]);return"["+(t.inverted?"^":"")+e+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function r(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+n(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+n(t)})}function i(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+n(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+n(t)})}return"Expected "+function(t){for(var e,n,r=new Array(t.length),i=0;i<t.length;i++)r[i]=(n=t[i],a[n.type](n));if(r.sort(),0<r.length){for(e=i=1;i<r.length;i++)r[i-1]!==r[i]&&(r[e]=r[i],e++);r.length=e}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(t)+" but "+((t=e)?'"'+r(t)+'"':"end of input")+" found."};var M2;function O2(t,e,n,r){var i,a,o,s=S2(r=void 0===r?"...":r,n),l=hn(t)?t:_(i=t)?"":i.toString(),c=e,u=[];if(S2(t,n)<=e)return t;for(;;){if(a=l.substr(0,16),c<(o=S2(a,n))+s)break;if(u.push(a),c-=o,!(l=l.substr(16)))return u.join("")}for(;;){if(a=l.substr(0,1),c<(o=S2(a,n))+s)break;if(u.push(a),c-=o,!(l=l.substr(1)))return u.join("")}return"".concat(u.join("")).concat(r)}var S2=En(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(M2=M2||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(n,"px"),r].join(" "),M2.measureText(hn(t)?t:"").width},function(t,e){return b([t],x(gn(e=void 0===e?{}:e)),!1).join("")});function _2(t,e){return"string"==typeof t?S2(t,e):t}function A2(t,e){return"capitalize"===e?t.toLowerCase().replace(/( |^)[a-z]/g,function(t){return t.toUpperCase()}):"lowercase"===e?t.toLowerCase():"uppercase"===e?t.toUpperCase():t}function T2(t,e){e=Math.pow(10,e);return~~(t*e)/e}function P2(t){if(dn(t))return[t,t,t,t];if(rn(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}var L2=["default","active","selected","disabled","inactive"],C2={fontSize:"16px",fontFamily:"sans-serif",fontWeight:"normal",fontVariant:"normal",fontStyle:"normal",textAlign:"start",textBaseline:"alphabetic"};function N2(t){var e;return t?null==t?void 0:t.default:(e=kn(t)||{},L2.forEach(function(t){t in e&&delete e[t]}),e)}function j2(t,e,n){return void 0===n&&(n=!1),e?(e=Sn(t,e),n?Tn({},N2(t),e):e):N2(t)||{}}function R2(r,i,a){void 0===a&&(a=!1);return Object.keys(r).reduce(function(t,e){var n;return n=e,new RegExp("^".concat(i,"[A-Z].*")).test(n)!==a&&(a?t[e]=r[e]:t[(n=e.slice(i.length)).charAt(0).toLowerCase()+n.slice(1)]=r[e]),t},{})}function F2(t,r){var i=t,t=Object.keys(t).reduce(function(t,e,n){return n>=r.length||(n=r[n],t.push(R2(i,n)),i=R2(i,n,!0)),t},[]);return t.push(i),t}function I2(r,i){return Object.keys(r).reduce(function(t,e){var n;return t["".concat(i).concat((n=e).charAt(0).toUpperCase()+n.slice(1))]=r[e],t},{})}function B2(t,n){void 0===n&&(n=["x","y","class"]);var r=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},a={};return Object.entries(t).forEach(function(t){var t=x(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function D2(t){var e=t.canvas,n=t.touches,r=t.offsetX,t=t.offsetY;return e?[e.x,e.y]:n?[(e=n[0]).clientX,e.clientY]:r&&t?[r,t]:[0,0]}S.prototype.selectAll=function(t){return new S("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},S.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new S(this._elements,null,this._parent,this._document,void 0,void 0,t)},S.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new S([t],null,t,this._document)},S.prototype.append=function(t){var e=this,n="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var i=0;i<this._data.length;i++){var a=this._data[i],a=x(Array.isArray(a)?a:[a,null],2),o=a[0],a=a[1];(l=n(o,i)).__data__=o,null!==a&&(l.__fromElements__=a),this._parent.appendChild(l),r.push(l)}return new S(r,null,this._parent,this._document)}for(i=0;i<this._elements.length;i++){var s=this._elements[i],l=n(o=s.__data__,i);s.appendChild(l),r.push(l)}return new S(r,null,r[0],this._document)},S.prototype.maybeAppend=function(t,e){e=Se(this,z2,"m",G2).call(this,t.startsWith("#")?t:"#".concat(t),e);return e.attr("id",t),e},S.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=Se(this,z2,"m",G2).call(this,t.startsWith(".")?t:".".concat(t),e);return e.attr("className",t),e},S.prototype.maybeAppendByName=function(t,e){e=Se(this,z2,"m",G2).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},S.prototype.data=function(t,n,e){void 0===n&&(n=function(t){return t}),void 0===e&&(e=function(){return null});for(var r,i,a=[],o=[],s=new Set(this._elements),l=[],c=new Set,u=new Map(this._elements.map(function(t,e){return[n(t.__data__,e),t]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=Np(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),y=e(p,d);if(u.has(g))(x=u.get(g)).__data__=p,x.__facet__=!1,o.push(x),s.delete(x),u.delete(g);else if(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var m=f.get(g);l.push([p,m]);try{r=void 0;for(var v=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(m),b=v.next();!b.done;b=v.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}f.delete(g)}else u.has(y)?((x=u.get(y)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new S([],a,this._parent,this._document),new S(o,null,this._parent,this._document),new S(s,null,this._parent,this._document),new S([],l,this._parent,this._document),new S(c,null,this._parent,this._document)];return new S(this._elements,null,this._parent,this._document,w)},S.prototype.merge=function(t){var e=b(b([],x(this._elements),!1),x(t._elements),!1),t=b(b([],x(this._transitions),!1),x(t._transitions),!1);return new S(e,null,this._parent,this._document,void 0,t)},S.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=S.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},S.prototype.join=function(t,e,n,r,i){void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});t=(t=void 0===t?function(t){return t}:t)(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)},S.prototype.remove=function(){for(var n=this,t=0;t<this._elements.length;t++)!function(t){var e=n._elements[t],t=n._transitions[t];t?t.then(function(){return e.remove()}):e.remove()}(t);return new S([],null,this._parent,this._document,void 0,this._transitions)},S.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},S.prototype.attr=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})},S.prototype.style=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})},S.prototype.styles=function(e){return this.each(function(i,a){var o=this,t=Object.entries(e).reduce(function(t,e){var e=x(e,2),n=e[0],r=e[1],e="function"!=typeof r?function(){return r}:r;return void 0!==r&&(t[n]=e.call(o,i,a)),t},{});this.attr(t)})},S.prototype.update=function(n){var r="function"!=typeof n?function(){return n}:n;return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},S.prototype.transition=function(t){var n="function"!=typeof t?function(){return t}:t,r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},S.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},S.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,b([this._parent,this],x(e),!1)),this},S.prototype.node=function(){return this._elements[0]},S.prototype.nodes=function(){return this._elements},S.prototype.transitions=function(){return this._transitions},S.prototype.parent=function(){return this._parent},z2=new WeakSet,G2=function(t,e){var n=this._elements[0],t=n.querySelector(t);return t||(t="string"==typeof e?this.createElement(e):e(),n.appendChild(t)),new S([t],null,this._parent,this._document)},S.registry={g:qo,rect:os,circle:Bo,path:ts,text:ls,ellipse:Vo,image:Ko,line:Jo,polygon:ns,polyline:is,html:Xo};var z2,G2,W2=S;function S(t,e,n,r,i,a,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===o&&(o=[]),z2.add(this),this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}function A(t){return new W2([t],null,t,t.ownerDocument)}function Y2(t,e,n){return t.querySelector(e)?A(t).select(e):A(t).append(n)}function V2(t){var e,t=t&&t.getRenderBounds();return t?(e=t.getMax(),t=t.getMin(),{width:e[0]-t[0],height:e[1]-t[1]}):{width:0,height:0}}function H2(t){var t=t.getLocalBounds(),t=x([t.min,t.max],2),e=x(t[0],2),n=e[0],e=e[1],t=x(t[1],2),r=t[0],t=t[1];return{x:n,y:e,width:r-n,height:t-e,left:n,bottom:t,top:e,right:r}}function q2(t,e){var t=x(t,2),n=t[0],t=t[1],e=x(e,2),n=e[0]-n,e=e[1]-t;return Math.sqrt(n*n+e*e)}function U2(t){var e,n;return"string"==typeof t?(e=t,(n=document.createElement("div")).innerHTML=e,n.firstChild):t}function X2(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)K2(t,e[r]);return t}var $2=5,K2=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=$2),Object.entries(i).forEach(function(t){var t=x(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?ln(t)?(ln(r[e])||(n[e]={}),a<o?K2(r[e],t,a+1,o):n[e]=i[e]):rn(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})};function Z2(t,e,n,r,i,a){return(t===e||Math.min(t,e)<=i&&i<=Math.max(t,e))&&(n===r||Math.min(n,r)<=a&&a<=Math.max(n,r))}function J2(t,e,n){var r=t;(!t.length||e<t[0]||e===t[0]&&n<t[1])&&(r[0]=e,r[1]=n)}function Q2(t,e){var t=x(t,2),n=t[0],t=t[1],e=x(e,2),r=e[0],e=e[1];return Math.pow(Math.pow(n-r,2)+Math.pow(t-e,2),.5)}function tx(a,o){return void 0===a&&(a=0),void 0===o&&(o=!1),function(t,e,n){var r,i=n.value;"function"==typeof i&&(n.value=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(t=this,o&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},a))})}}var ex,nx=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)};function rx(t){return hn(t)||dn(t)?new ls({style:{text:String(t)}}):t}function ix(t){return t*Math.PI/180}function ax(t){return Number((180*t/Math.PI).toPrecision(5))}function ox(t,e){var t=(t instanceof Fo?t:t.node()).computedStyleMap().get("transform");return!t||"unset"===t.value||null==(t=null==t?void 0:t.find(function(t){return t.t===e}))?void 0:t.d.map(function(t){return t.value})}function sx(t,e){if(e)try{var o=t instanceof Fo?t:t.node(),n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(t,e,n){return"translate(".concat((e=e,n=n,i=(r=((r=o)instanceof Fo?r:r.node()).getBBox()).width,a=r.height,[(r=x([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null==(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))?void 0:n[0])||"0")/100*(0===e?i:a):t}),2))[0],r[1]]),")");var r,i,a});o.attr("transform",n)}catch(t){}}function lx(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}function cx(t,e){return tn(t)?t.apply(void 0,b([],x(e),!1)):t}function ux(t,e,n,r,i){void 0===r&&(r=!0),void 0===i&&(i=function(t){t instanceof W2?t.node().removeChildren():t instanceof Fo?t.removeChildren():t instanceof HTMLElement&&(t.innerHTML="")}),t?n(e):r&&i(e)}function hx(){return null!==ex&&ex.apply(this,arguments)||this}function fx(e,n){return Me(t,r=zo),t.prototype.connectedCallback=function(){var t,e;null!=(t=(e=this.descriptor).render)&&t.call(e,this.attributes,this),null!=(e=(t=this.descriptor).bindEvents)&&e.call(t,this.attributes,this)},t.prototype.update=function(t){var e;this.attr(Tn({},this.attributes,t=void 0===t?{}:t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)},t.prototype.attributeChangedCallback=function(){var t,e;null!=(e=null==(t=this.descriptor)?void 0:t.render)&&e.call(t,this.attributes,this)},t;function t(t){t=r.call(this,X2({},{style:n},t))||this;return t.descriptor=e,t}var r}Me(hx,ex=zo);function dx(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=x(t,2),e=t[0],t=t[1],n=r(t);return[e,{name:n,class:".".concat(n),id:"#".concat(n),toString:function(){return n}}]})),Object.assign(t,{prefix:r}),t}function px(t){var r=v({},t),i=new RegExp(/^(f|[\S]+F)(ilter|iltrate)$/),a={},o={iltrate:"ilter",ilter:"iltrate"};return Object.entries(t).forEach(function(t){var t=x(t,2),e=t[0],t=t[1];i.test(e)&&(a[e]=t)}),Object.keys(a).forEach(function(t){delete r[t]}),Object.keys(a).forEach(function(t){var e,n;(t.endsWith("iltrate")&&"function"!=typeof a[t]||t.endsWith("ilter")&&"function"==typeof a[t])&&(n=t.replace(i,function(t,e,n){return"".concat(e).concat(o[n])}),Object.assign(r,((e={})[n]=a[t],e)))}),r}function gx(t,e,n){void 0===n&&(n="...");t=t instanceof ls?t:t.node();"text"===t.nodeName&&t.attr({wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function yx(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,r=r.height,e=e/Math.max(i,r);n&&t.scale(e)}function mx(r,t,e,n,i){function a(){return"update"in r?r.update(t):r.attr(t),Promise.resolve()}void 0===e&&(e={}),void 0===n&&(n=!0),void 0===i&&(i=50);var o={},s={},l=["x","y","width","height","opacity","radius"];Object.entries(t).forEach(function(t){var t=x(t,2),e=t[0],t=t[1],n=r.attr(e);l.includes(e)&&!_(t)&&!_(n)&&n!==t&&Math.abs(+n-+t)>=i&&(o[e]=n,s[e]=t)});return n?0<Object.keys(o).length?(null==(n=r.animate([o,s],v({fill:"both"},e)))?void 0:n.finished.then(a))||Promise.resolve():void Promise.resolve():a()}Me(bx,vx=zo),bx.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},bx.prototype.update=function(t){this.attr(X2({},this.attributes,t=void 0===t?{}:t)),null!=(t=this.render)&&t.call(this,this.attributes,this)},bx.prototype.clear=function(){this.removeChildren()},bx.prototype.destroy=function(){this.removeAllEventListeners(),this.removeChildren(),this.remove()},bx.prototype.attributeChangedCallback=function(){},bx.prototype.bindEvents=function(t,e){};var vx,$l=bx;function bx(t){return vx.call(this,t)||this}function xx(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]}function wx(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function kx(t,e,n){return[["M",t-n,e],["L",t+n,e]]}tc=xx,gl=kx;function Ex(t){n="default",an(e=t)&&e instanceof Image?n="image":tn(e)?n="symbol":hn(e)&&(r=new RegExp("data:(image|text)"),n=e.match(r)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?"url":"symbol");var e,n,r=n;return["base64","url","image"].includes(r)?"image":t&&"symbol"===r?"path":null}Me(Sx,Mx=$l),Sx.prototype.render=function(t,e){var r=t.x,i=t.y,a=t.symbol,n=t.size,o=void 0===n?16:n,s=J(t,["x","y","symbol","size"]),l=Ex(a);l?Y2(e,".".concat(l,"-marker"),l).attr("className","marker ".concat(l,"-marker")).call(function(t){var e,n;"image"===l?t.styles({img:a,width:e=2*o,height:e,x:-o,y:-o}):(e=o/2,n=tn(a)?a:Sx.getSymbol(a),t.styles(v({path:null==n?void 0:n(r,i,e)},s)))}):(null!=(n=this.querySelector(".marker"))&&n.remove(),this.removeChildren())},Sx.MARKER_SYMBOL_MAP=new Map,Sx.registerSymbol=function(t,e){Sx.MARKER_SYMBOL_MAP.set(t,e)},Sx.getSymbol=function(t){return Sx.MARKER_SYMBOL_MAP.get(t)};var Mx,Ox=Sx;function Sx(){return null!==Mx&&Mx.apply(this,arguments)||this}Ox.registerSymbol("cross",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]}),Ox.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),Ox.registerSymbol("line",wx),Ox.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),Ox.registerSymbol("tick",function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]}),Ox.registerSymbol("circle",xx),Ox.registerSymbol("point",tc),Ox.registerSymbol("bowtie",function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),Ox.registerSymbol("hexagon",function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),Ox.registerSymbol("square",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]}),Ox.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),Ox.registerSymbol("triangle",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),Ox.registerSymbol("triangle-down",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),Ox.registerSymbol("line",wx),Ox.registerSymbol("dot",kx),Ox.registerSymbol("dash",gl),Ox.registerSymbol("smooth",function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}),Ox.registerSymbol("hv",function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]}),Ox.registerSymbol("vh",function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]}),Ox.registerSymbol("hvh",function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]}),Ox.registerSymbol("vhv",function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]});Me(Tx,_x=$l),Tx.prototype.render=function(t,e){var n,r,i=t.padding,a=t.marker,o=t.text,s=t.textStyle,l=t.radius,c=t.backgroundStyle,u=t.spacing,h=t.align,t=t.verticalAlign,i=x(P2(void 0===i?0:i),4),f=i[0],d=i[1],p=i[2],i=i[3],g=Y2(e,".tag-content","g").attr("className","tag-content").node(),y=Y2(g,".tag-marker",function(){return new Ox({})}).attr("className","tag-marker").call(function(t){t.node().clear(),t.node().update(a||{symbol:"triangle",size:0,x:0})}).node(),u=(u=u,{x:(m=(y=y).getLocalBounds()).halfExtents[0]?m.max[0]+(u||0):y.style.x,y:m.halfExtents[1]?(m.min[1]+m.max[1])/2:y.style.y}),m=u.x,y=u.y,y=(A(g).maybeAppendByClassName("tag-text","text").styles(v(v({fontFamily:"sans-serif",fontSize:12,text:_(o)?"":"".concat(o),x:m,y:y},s),{textBaseline:"middle"})).call(function(t){o||t.remove()}),u=i,m=f,y=h||"start",s=t||"top",t=(h=g).getLocalBounds(),r=n=0,"start"===y&&(n=u),"center"===y&&(n=-t.halfExtents[0]),"end"===y&&(n=-u-2*t.halfExtents[0]),"top"===s&&(r=m+t.halfExtents[1]),"middle"===s&&(r=0),"bottom"===s&&(r=m-2*t.halfExtents[1]),h.setLocalPosition([n,r]),g.getLocalBounds());A(e).maybeAppendByClassName("tag-background","rect").styles(v({zIndex:(g.style.zIndex||0)-1,y:y.min[1]-f,x:y.min[0]-i,width:null!==c?i+d+2*y.halfExtents[0]:0,height:null!==c?f+p+2*y.halfExtents[1]:0,radius:null!=l?l:2,fill:"#fafafa",stroke:"#d9d9d9",lineWidth:1},c))},Tx.tag="tag",Tx.defaultOptions={style:{padding:4,spacing:4}};var _x,Ax=Tx;function Tx(t){return _x.call(this,Tn({},Tx.defaultOptions,t))||this}var Px,Lx,Cx={small:{textStyle:{fontSize:10},buttonStyle:{width:40,height:20},markerStyle:{size:8}},middle:{textStyle:{fontSize:12},buttonStyle:{width:60,height:30},markerStyle:{size:12}},large:{textStyle:{fontSize:16},buttonStyle:{width:80,height:40},markerStyle:{size:16}}},Nx={primary:{textStyle:{default:{fill:"#fff"},active:{}},buttonStyle:{default:{fill:"#1890ff",lineWidth:0},active:{fill:"#40a9ff"}},markerStyle:{default:{fill:"#1890ff"},active:{fill:"#40a9ff"}}},dashed:{textStyle:{default:{},active:{}},buttonStyle:{default:{fill:"transparent",stroke:"#bbb",lineDash:[5,5]},active:{}},markerStyle:{}},link:{textStyle:{default:{fill:"#1890ff"},active:{}},buttonStyle:{default:{fill:"transparent",lineWidth:0},active:{}},markerStyle:{default:{fill:"#1890ff"}}},text:{textStyle:{default:{fill:"#000"},active:{}},buttonStyle:{default:{fill:"transparent",lineWidth:0},active:{}},markerStyle:{default:{stroke:"#000"}}},default:{textStyle:{default:{fill:"#000"},active:{fill:"#1890ff"}},buttonStyle:{default:{fill:"transparent",stroke:"#bbb"},active:{stroke:"#1890ff"}},markerStyle:{default:{stroke:"#bbb",lineWidth:1},active:{stroke:"#1890ff"}}}},jx={strict:{textStyle:{fill:"#b8b8b8"},buttonStyle:{},markerStyle:{}},textStyle:{},buttonStyle:{stroke:"#d9d9d9",fill:"#f5f5f5"},markerStyle:{stroke:"#d9d9d9"}};function Rx(t){var n=Px.call(this,X2({},Rx.defaultOptions,t))||this;return n.state="default",n.clickEvents=function(){var t=n.attributes,e=t.onClick;"disabled"!==t.state&&null!=e&&e.call(n,n)},n.mouseenterEvent=function(){"disabled"!==n.attributes.state&&(n.state="active",n.render(n.attributes,n))},n.mouseleaveEvent=function(){var t=n.attributes.state;n.state=void 0===t?"default":t,n.render(n.attributes,n)},n}function Fx(t){return Lx.call(this,Tn({},Fx.defaultOptions,t))||this}Me(Rx,Px=$l),Object.defineProperty(Rx.prototype,"markerSize",{get:function(){var t=this.attributes.marker,e=this.getStyle("markerStyle");return t?(null==e?void 0:e.size)||2:0},enumerable:!1,configurable:!0}),Object.defineProperty(Rx.prototype,"text",{get:function(){var t,e=this.attributes.text;return""===e?e:(t=this.textAvailableWidth,O2(e,t))},enumerable:!1,configurable:!0}),Object.defineProperty(Rx.prototype,"textAvailableWidth",{get:function(){var t=this.attributes,e=t.marker,n=t.padding,r=t.ellipsis,i=t.width,t=t.markerSpacing;return r?(r=mn(i)?this.getStyle("buttonStyle").width:i,e?r-2*n-t-this.markerSize:r-2*n):1/0},enumerable:!1,configurable:!0}),Object.defineProperty(Rx.prototype,"buttonHeight",{get:function(){var t=this.attributes.height;return t||this.getStyle("buttonStyle").height},enumerable:!1,configurable:!0}),Rx.prototype.getStyle=function(e){var t=this.attributes,n=t.size,t=t.type,r=this.state,i=Tn({},Sn(Cx,[n,e]),j2(Sn(Nx,[t,e]),r),j2(Sn(this.attributes,e),r,!0));return"disabled"===r&&(Object.keys(i).forEach(function(t){t in jx[e]&&(i[t]=Sn(jx,[e,t]))}),Object.keys(jx.strict[e]).forEach(function(t){i[t]=Sn(jx,["strict",e,t])}),Tn(i,j2(Sn(this.attributes,e),"disabled"))),i},Rx.prototype.render=function(t,e){var n=t.padding,n=void 0===n?0:n,r=t.marker,t=t.markerSpacing,t=void 0===t?0:t,n=(e.attr("cursor","disabled"===this.state?"not-allowed":"pointer"),x(P2(n),4)),i=(n[0],n[1]),a=(n[2],n[3]),o=this.buttonHeight,s=this.getStyle("markerStyle"),l=this.markerSize,n=Y2(e,".marker",function(){return new Ox({className:"marker",style:{symbol:"circle"}})}).call(function(t){t.node().update(v(v({},s),{symbol:r,x:a+l/2,y:o/2,size:l}))}).node().getLocalBounds(),c=this.text,c=void 0===c?"":c,u=this.getStyle("textStyle"),n=(this.textShape=Y2(e,".text","text").attr("className","text").styles(v({x:l?n.max[0]+t:a,y:o/2,text:c,textAlign:"left",textBaseline:"middle"},u)).node(),this.textShape.getLocalBounds()),c=this.getStyle("buttonStyle");A(e).maybeAppendByClassName(".background","rect").styles(v(v({zIndex:-1},c),{height:o,width:a+(l?l+t:0)+2*n.halfExtents[0]+i}))},Rx.prototype.update=function(t){this.attr(Tn({},this.attributes,t=void 0===t?{}:t));t=this.attributes.state;this.state=void 0===t?"default":t,this.render(this.attributes,this)},Rx.prototype.setState=function(t){this.update({state:t})},Rx.prototype.hide=function(){this.style.visibility="hidden"},Rx.prototype.show=function(){this.style.visibility="visible"},Rx.prototype.bindEvents=function(){this.addEventListener("click",this.clickEvents),this.addEventListener("mouseenter",this.mouseenterEvent),this.addEventListener("mouseleave",this.mouseleaveEvent)},Rx.tag="button",Rx.defaultOptions={style:{cursor:"pointer",padding:10,size:"middle",type:"default",text:"",markerAlign:"left",markerSpacing:5,textStyle:{default:{},active:{}},buttonStyle:{default:{lineWidth:1,radius:5},active:{}},markerStyle:{default:{}}}},Me(Fx,Lx=$l),Fx.prototype.render=function(t,e){for(var n=t.x,r=t.y,s=t.items,l=t.textStyle,i=t.padding,c=t.width,u=t.separator,t=x(P2(void 0===i?0:i),3),i=t[0],h=t[1],t=t[2],f=Y2(e,".container","g").styles({className:"container",x:n+t,y:r+i}),d=0,p=0,g=(f.node().removeChildren(),this),a=0;a<s.length;a++)!function(t){var e,n=s[t],r=new Ax({className:"breadcrumb-item",style:v(v({x:d,y:p,text:_(n.text)?n.id:n.text,textStyle:l},_n(n,["marker"])),{padding:0,backgroundStyle:null})}),i=(f.append(function(){return r}),r.getLocalBounds()),a=2*i.halfExtents[0],i=2*i.halfExtents[1],a=(d+=a,_(c)||c-h<d&&(r.attr({x:0,y:p+i}),d=a,p+=i),g.bindInnerEvents(r,n),u||{}),n=a.spacing,n=void 0===n?0:n,o=a.text,o=void 0===o?"/":o,a=a.style;t!==s.length-1&&(e=new ls({className:"".concat(Fx.tag,"-separator"),id:"".concat(Fx.tag,"-separator-").concat(t),style:v(v(v(v({},C2),{x:d+n,y:p+i/2}),a),{text:o,textAlign:"end",textBaseline:"middle"})}),f.append(function(){return e}),t=e.getLocalBounds(),d+=2*t.halfExtents[0]+n)}(a)},Fx.prototype.update=function(t){this.attr(Tn({},this.attributes,t)),this.render(this.attributes,this)},Fx.prototype.bindInnerEvents=function(t,e){var n=this.attributes,r=n.items,i=n.onClick;i&&t.addEventListener("click",function(){i.call(t,e.id,e,r)})},Fx.tag="breadcrumb",Fx.defaultOptions={style:{separator:{text:"/",style:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},spacing:8},textStyle:{default:v(v({},C2),{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"}),active:{fill:"#5468ff",cursor:"pointer"}},padding:[8,8,8,8]}};Me(Dx,Ix=Fo),Dx.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.createLines(e),t&&this.createAreas(t)},Dx.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},Dx.prototype.update=function(t){var e=t.lines,t=t.areas;this.clear(),e&&this.setAttribute("lines",e),t&&this.setAttribute("areas",t),this.render()},Dx.prototype.createLines=function(t){A(this.linesGroup).selectAll("line").data(t).join(function(t){return t.append("path").each(function(t){A(this).styles(t)})},function(t){return t.each(function(t){A(this).styles(t)})},function(t){return t.remove()})},Dx.prototype.createAreas=function(t){A(this.linesGroup).selectAll("area").data(t).join(function(t){return t.append("path").each(function(t){A(this).styles(t)})},function(t){return t.each(function(t){A(this).styles(t)})},function(t){return t.remove()})};var Ix,Bx=Dx;function Dx(t){var e=this,n=t.style,t=J(t,["style"]);return(e=Ix.call(this,Tn({},{type:"lines",style:{width:0,height:0}},v({style:n},t)))||this).linesGroup=e.appendChild(new qo({name:"lines"})),e.areasGroup=e.appendChild(new qo({name:"areas"})),e.render(),e}Me(Wx,zx=Fo),Wx.prototype.render=function(){var t=this.attributes.columns;A(this.columnsGroup).selectAll("column-group").data(t.flat()).join(function(t){return t.append("rect").each(function(t){A(this).styles(t)})},function(t){return t.each(function(t){A(this).styles(t)})},function(t){return t.remove()})},Wx.prototype.update=function(t){this.attr(Tn({},this.attributes,t)),t.columns&&(this.clear(),this.render())},Wx.prototype.clear=function(){this.removeChildren()};var zx,Gx=Wx;function Wx(t){var e=this,n=t.style,t=J(t,["style"]);return(e=zx.call(this,Tn({},{type:"column",style:{width:0,height:0}},v({style:n},t)))||this).columnsGroup=new qo({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}function Yx(t){return 0===t.length?[0,0]:[un(function(t,e){if(rn(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=tn(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return un(t)||0})),cn(function(t,e){if(rn(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=tn(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return cn(t)||0}))]}function Vx(t){for(var e=kn(t),n=e[0].length,t=x([Array(n).fill(0),Array(n).fill(0)],2),r=t[0],i=t[1],a=0;a<e.length;a+=1)for(var o=e[a],s=0;s<n;s+=1)0<=o[s]?(o[s]+=r[s],r[s]=o[s]):(o[s]+=i[s],i[s]=o[s]);return e}function Hx(t,e,n){void 0===n&&(n=[[0,0],[1,1]]);for(var e=!!(e=void 0===e?!1:e),r=[],i=0,a=t.length;i<a;i+=2)r.push([t[i],t[i+1]]);for(var o,s,l,c=function(t,e,n,r){var i,a=[],o=!!r;if(o){c=r[0],u=r[1];for(var s=0,l=t.length;s<l;s+=1)var c=pe([0,0],c,x=t[s]),u=ge([0,0],u,x)}for(var s=0,h=t.length;s<h;s+=1){var f,d,p,g,y,m,v,b,x=t[s];0!==s||n?s!==h-1||n?(f=t[[s?s-1:h-1,s-1][n?0:1]],d=t[n?(s+1)%h:s+1],m=ye(m=we([0,0],d,f),m,e),0!==(y=(p=me(x,f))+(g=me(x,d)))&&(p/=y,g/=y),y=ye([0,0],m,-p),m=ye([0,0],m,g),v=de([0,0],x,y),b=pe([0,0],b=de([0,0],x,m),ge([0,0],d,x)),b=ge([0,0],b,pe([0,0],d,x)),v=pe([0,0],v=de([0,0],x,y=ye([0,0],y=we([0,0],b,x),-p/g)),ge([0,0],f,x)),v=ge([0,0],v,pe([0,0],f,x)),b=de([0,0],x,m=ye([0,0],m=we([0,0],x,v),g/p)),o&&(v=pe([0,0],v=ge([0,0],v,c),u),b=pe([0,0],b=ge([0,0],b,c),u)),a.push(i),a.push(v),i=b):(v=x,a.push(i),a.push(v)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[i+1])[0],l[1]]);return e&&(o=c[u],s=c[u+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[0])[0],l[1]])),h}function qx(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return b([e===n?"M":"L"],x(t),!1)});return e?t.reverse():t}function Ux(t,e){if(void 0===e&&(e=!1),t.length<=2)return qx(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];Pn(a,n.slice(-2))||n.push.apply(n,b([],x(a),!1))}var o=Hx(n,!1);return e?o.unshift(b(["M"],x(t[r-1]),!1)):o.unshift(b(["M"],x(t[0]),!1)),o}function Xx(t,e,n){t=kn(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}Me(Zx,$x=$l),Object.defineProperty(Zx.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=kn(t),dn(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(Zx.prototype,"data",{get:function(){return this.attributes.isStack?Vx(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(Zx.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(Zx.prototype,"baseline",{get:function(){var t=this.scales.y,e=x(t.getOptions().domain||[0,0],2),n=e[0],e=e[1];return e<0?t.map(e):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(Zx.prototype,"containerCfg",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(Zx.prototype,"linesCfg",{get:function(){var n=this;if("line"!==this.attributes.type)throw new Error("linesCfg can only be used in line type");var t,r,i,a,o,e,s,l,c,u=this.attributes,h=u.isStack,f=u.smooth,d=R2(this.attributes,"area"),p=R2(this.attributes,"line"),u=this.containerCfg.width,g=this.data;return 0===g[0].length?{lines:[],areas:[]}:(t=this.scales,e=t.x,t=t.y,g=g,r=(e={type:"line",x:e,y:t}).x,i=e.y,a=(e=x(i.getOptions().range||[0,0],2))[0],o=e[1],a<o&&(e=x([a,o],2),o=e[0],a=e[1]),t=g.map(function(t){return t.map(function(t,e){return[r.map(e),fn(i.map(t),o,a)]})}),e=[],d&&(g=this.baseline,e=h?(f?function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=t[i],s=Ux(o),l=void 0,l=0===i?Xx(s,e,n):(a=Ux(t[i-1],!0),o=o[0],a[0][0]="L",b(b(b([],x(s),!1),x(a),!1),[b(["M"],x(o),!1),["Z"]],!1));r.push(l)}return r}:function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=qx(t[i]),s=void 0,s=0===i?Xx(o,e,n):((a=qx(t[i-1],!0))[0][0]="L",b(b(b([],x(o),!1),x(a),!1),[["Z"]],!1));r.push(s)}return r})(t,u,g):(s=f,l=u,c=g,t.map(function(t){return Xx((s?Ux:qx)(t),l,c)}))),{lines:t.map(function(t,e){return v({stroke:n.getColor(e),path:(f?Ux:qx)(t)},p)}),areas:e.map(function(t,e){return v({path:t,fill:n.getColor(e)},d)})})},enumerable:!1,configurable:!0}),Object.defineProperty(Zx.prototype,"columnsCfg",{get:function(){var i=this;if("column"!==this.attributes.type)throw new Error("columnsCfg can only be used in column type");var a=R2(this.attributes,"column"),o=this.attributes.isStack,t=this.containerCfg.height,s=this.rawData;if(!s)return{columns:[]};o&&(s=Vx(s));var e=this.createScales(s),l=e.x,c=e.y,e=x(Yx(s),2),n=e[0],e=e[1],u=new Im({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return v(v({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[r][e])}:{x:l.map(e)+n*r,y:0<=t?c.map(t):c.map(0),width:n,height:u.map(Math.abs(t))})})})}},enumerable:!1,configurable:!0}),Zx.prototype.render=function(t,e){this.containerShape=Y2(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesCfg:this.columnsCfg;this.sparkShape=Y2(e,".".concat(r),function(){return new("line"===n?Bx:Gx)({className:r,style:i})}).styles(i).node()},Zx.prototype.update=function(t){this.attr(Tn({},this.attributes,t)),this.render(this.attributes,this)},Zx.prototype.clear=function(){this.removeChild(this.sparkShape),this.sparkShape.clear(),this.sparkShape.destroy()},Zx.prototype.getColor=function(t){var e=this.attributes.color;return rn(e)?e[t%e.length]:tn(e)?e.call(null,t):e},Zx.prototype.createScales=function(t){var e,n=this.attributes,r=n.type,n=n.range,n=void 0===n?[]:n,i=this.containerCfg,a=i.width,i=i.height,o=x(Yx(t),2),s=o[0],o=o[1],s=new Im({domain:[null!=(e=n[0])?e:s,null!=(e=n[1])?e:o],range:[i,0]});return"line"===r?{type:r,x:new Im({domain:[0,t[0].length-1],range:[0,a]}),y:s}:(e=(n=this.attributes).isGroup,o=n.spacing,{type:r,x:new Sm({domain:t[0].map(function(t,e){return e}),range:[0,a],paddingInner:e?o:0}),y:s})},Zx.tag="sparkline",Zx.defaultOptions={style:{type:"line",width:200,height:20,isStack:!1,nice:!0,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",columnPadding:.1}};var $x,Kx=Zx;function Zx(t){return $x.call(this,Tn({},Zx.defaultOptions,t))||this}var Jx,Qx={fill:"#fff",stroke:"#bfbfbf",lineWidth:1,size:10,radius:2,strokeOpacity:1},tw={fontSize:12,fill:"#000",fillOpacity:.45,textAlign:"center",textBaseline:"middle"},ew={orient:"horizontal",type:"start",showLabel:!0},nw=dx({labelGroup:"label-group",label:"label",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),rw=fx({render:function(t,e){var n=t.size,n=void 0===n?10:n,r=t.radius,r=void 0===r?n/4:r,i=t.orient,t=(t.class,J(t,["size","radius","orient","class"])),a=2.4*n,r=A(e).maybeAppendByClassName(nw.iconRect,"rect").styles(v(v({},t),{width:n,height:a,radius:r,x:-n/2,y:-a/2})),o=1/3*n,s=2/3*n,l=.25*a,c=.75*a;r.maybeAppendByClassName("".concat(nw.iconLine,"-1"),"line").styles(v({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(nw.iconLine,"-2"),"line").styles(v({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)}}),iw=(Me(aw,Jx=$l),aw.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=x(B2(R2(this.attributes,"label"),[]),2),i=r[0],r=r[1];ux(!!n,A(t).maybeAppendByClassName(nw.labelGroup,"g").styles(r),function(t){e.label=t.maybeAppendByClassName(nw.label,"text").styles(v(v({},tw),i)),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},aw.prototype.renderIcon=function(t){var e=this.attributes,n=e.iconShape,n=void 0===n?function(){return new rw({style:r})}:n,e=e.orient,r=v(v({orient:e},Qx),R2(this.attributes,"icon"));this.icon=A(t).maybeAppendByClassName(nw.icon,n).update(r)},aw.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},aw);function aw(t){return Jx.call(this,X2({},{style:ew},t))||this}Me(lw,ow=$l),Object.defineProperty(lw.prototype,"values",{get:function(){return this.getAttribute("values")},set:function(t){this.setAttribute("values",this.clampValues(t))},enumerable:!1,configurable:!0}),Object.defineProperty(lw.prototype,"sparklineShapeCfg",{get:function(){var t,e,n,r,i,a,o,s;return"horizontal"!==this.attributes.orient?null:(i=(t=R2(this.attributes,"sparkline")).padding,t=J(t,["padding"]),e=(i=x(P2(i),4))[0],n=i[1],r=i[2],i=i[3],a=(o=this.availableSpace).width,o=o.height,s=this.attributes.trackLineWidth,v(v({x:(s=+(void 0===s?0:s))/2+i,y:s/2+e},t),{zIndex:0,width:a-s-i-n,height:o-s-e-r}))},enumerable:!1,configurable:!0}),Object.defineProperty(lw.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=x(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(lw.prototype,"availableSpace",{get:function(){var t=x(P2(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],t=t[3],i=this.shape;return{x:t,y:e,width:i.width-(t+n),height:i.height-(e+r)}},enumerable:!1,configurable:!0}),lw.prototype.getValues=function(){return this.values},lw.prototype.setValues=function(t,e){void 0===e&&(e=!1),this.attr("values",t=void 0===t?[0,0]:t),mx(this.selectionShape.node(),this.selectionCfg,this.animation,e),mx(this.startHandle.node(),this.getHandleShapeCfg("start"),this.animation,e),mx(this.endHandle.node(),this.getHandleShapeCfg("end"),this.animation,e)},lw.prototype.innerSetValues=function(t,e){void 0===e&&(e=!1);var n=this.values,t=this.clampValues(t=void 0===t?[0,0]:t);this.update({values:t}),e&&this.onValueChange(n)},lw.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=R2(this.attributes,"track");this.trackShape=A(t).maybeAppendByClassName("slider-track","rect").styles(v(v(v({},this.shape),n),{cursor:e?"crosshair":"default"}))},lw.prototype.renderSparkline=function(t){var n=this;ux("horizontal"===this.attributes.orient,A(t).maybeAppendByClassName("slider-sparkline-group","g"),function(t){var e=n.sparklineShapeCfg;t.maybeAppendByClassName("slider-sparkline",function(){return new Kx({style:e})}).call(function(t){t.node().update(e)})})},Object.defineProperty(lw.prototype,"selectionCfg",{get:function(){var t=R2(this.attributes,"selection");return v(v({},t),this.calcMask())},enumerable:!1,configurable:!0}),lw.prototype.renderSelection=function(t){function e(t){var e="".concat(t,"-handle"),n=r.getHandleShapeCfg(t);return r.foregroundGroup.maybeAppendByClassName(e,function(){return new iw({style:n})}).style("type",t).update(n)}var r=this;this.foregroundGroup=A(t).maybeAppendByClassName("slider-foreground","g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName("slider-selection","rect").styles(this.selectionCfg);this.startHandle=e("start"),this.endHandle=e("end")},lw.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},lw.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=x(this.range,2),r=n[0],n=n[1],i=x(this.getValues().map(function(t){return T2(t,e)}),2),a=i[0],i=i[1],t=x((t||[a,i]).map(function(t){return T2(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=x([t,o],2))[0],t=s[1]),t-o);return n-r<s?[r,n]:o<r?a===r&&i===t?[r,t]:[r,s+r]:n<t?i===n&&a===o?[o,n]:[n-s,n]:[o,t]},lw.prototype.calcMask=function(t){var t=x(this.clampValues(t),2),e=t[0],t=t[1],n=this.availableSpace,r=n.x,i=n.y,a=n.width,n=n.height;return this.getOrientVal([{y:i,height:n,x:e*a+r,width:(t-e)*a},{x:r,width:a,y:e*n+i,height:(t-e)*n}])},lw.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.width,e=e.height,r=x(this.clampValues(),2),i=r[0],r=r[1],t=("start"===t?i:r)*this.getOrientVal([n,e]);return{x:this.getOrientVal([t,n/2]),y:this.getOrientVal([e/2,t])}},lw.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.orient,n=n.formatter,i=R2(this.attributes,"handle"),a=R2(i,"label"),i=i.spacing,o=this.getHandleSize(),s=this.clampValues(),l=this.availableSpace,c=l.width,l=l.height,u=this.calcMask(),h=u.x,f=u.y,d=u.width,u=u.height,n=n("start"===t?s[0]:s[1]),s=this.appendChild(new ls({style:v(v(v({visibility:"hidden"},C2),a),{text:n})})),a=s.getBBox(),p=a.width,a=a.height,s=(s.destroy(),0),g=0;return"horizontal"===r?(e=(r=i+o)+p/2,s="start"===t?0<h-r-p?-e:e:p<c-h-d-r?e:-e):(e=i+o,g="start"===t?a<f-o?-e:e:a<l-f-u-o?e:-e),{x:s,y:g,text:n}},lw.prototype.getHandleLabelShapeCfg=function(t){var e;return this.attributes.showLabel?(e=R2(this.attributes,"handleLabel"),v(v({},e),this.calcHandleText(t))):{}},lw.prototype.getHandleIconShapeCfg=function(){var t=this.attributes,e=t.orient,t=t.handleIconShape,n=R2(this.attributes,"handleIcon"),r=this.getOrientVal(["ew-resize","ns-resize"]),i=this.getHandleSize();return v(v({},n),{shape:t,orient:e,cursor:r,size:i})},lw.prototype.getHandleShapeCfg=function(t){var e=this.attributes,n=e.showHandle,e=e.showLabel,r=this.calcHandlePosition(t),i=r.x,r=r.y,a=this.calcHandleText(t);return v(v(v({zIndex:3,showLabel:e,visibility:n?"visible":"hidden"},I2(this.getHandleIconShapeCfg(),"icon")),I2(v(v({},this.getHandleLabelShapeCfg(t)),a),"label")),{x:i,y:r})},lw.prototype.getHandleSize=function(){var t,e=this.attributes.handleIconSize;return e||(t=(e=this.attributes).width,e=e.height,Math.floor((this.getOrientVal([+e,+t])+4)/2.4))},lw.prototype.getOrientVal=function(t){var t=x(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orient?e:t},lw.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=x(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},lw.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},lw.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new vo(n,{detail:t}))})},lw.prototype.bindEvents=function(){var n=this,t=this.selectionShape,t=(this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick"),[this.startHandle,this.endHandle].forEach(function(t){var e=t.node().attr("type");t.on("mousedown",function(t){n.onDragStart(e)(t)}),t.on("touchstart",function(t){n.onDragStart(e)(t)})}),this.trackShape);this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(t,"mouseleave","trackMouseleave"),t.on("mousedown",this.onDragStart("track")),t.on("touchstart",this.onDragStart("track"))},lw.prototype.onScroll=function(t){var e;this.attributes.scrollable&&(e=t.deltaX,t=t.deltaY,t=this.getRatio(t||e),this.setValuesOffset(t,t,!0))},lw.tag="slider",lw.defaultOptions={style:v(v(v({values:[0,1],trackLength:200,trackSize:20,slidable:!0,brushable:!0,scrollable:!0,orient:"horizontal",trackZIndex:-1,trackFill:"#416180",trackOpacity:.05,selectionCursor:"move",selectionZIndex:2,selectionFill:"#5B8FF9",selectionFillOpacity:.45,sparklinePadding:1,padding:0,showHandle:!0,showLabel:!0,handleSpacing:2,formatter:function(t){return t}},I2(ew,"handle")),I2(Qx,"handleIcon")),I2(tw,"handleLabel"))};var ow,sw=lw;function lw(t){var a=ow.call(this,Tn({},lw.defaultOptions,t))||this;return a.range=[0,1],a.animation={duration:100,fill:"both"},a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(D2(t));var t=a.availableSpace,e=t.x,t=t.y,n=a.attributes,r=n.x,n=n.y;a.selectionStartPos=a.getRatio(a.prevPos-a.getOrientVal([e,t])-a.getOrientVal([+r,+n])),a.selectionWidth=0,document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd)}},a.onDragging=function(t){var e=a.attributes,n=e.slidable,r=e.brushable,e=(t.stopPropagation(),a.getOrientVal(D2(t))),t=e-a.prevPos;if(t){var i=a.getRatio(t);switch(a.target){case"start":n&&a.setValuesOffset(i);break;case"end":n&&a.setValuesOffset(0,i);break;case"selection":n&&a.setValuesOffset(i,i);break;case"track":if(!r)return;a.selectionWidth+=i,a.innerSetValues([a.selectionStartPos,a.selectionStartPos+a.selectionWidth].sort(),!0)}a.prevPos=e}},a.onDragEnd=function(){document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a.onValueChange=function(t){t=new vo("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}Me(hw,cw=$l),Object.defineProperty(hw.prototype,"padding",{get:function(){return P2(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(hw.prototype,"value",{get:function(){var t=this.attributes.value,e=x(this.range,2),n=e[0],e=e[1];return fn(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(hw.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,t=t.trackLength;return void 0===t?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(hw.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=x(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=x(this.getOrientVal([[e,t],[t,e]]),2);return{x:n,y:r,width:+t[0]-(n+i),height:+t[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(hw.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,t=t.trackSize;return e?t/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(hw.prototype,"thumbRadius",{get:function(){var t,e;return this.attributes.isRound?(t=(e=this.availableSpace).width,e=e.height,this.attributes.thumbRadius||this.getOrientVal([e,t])/2):0},enumerable:!1,configurable:!0}),hw.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=x(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},hw.prototype.getValue=function(){return this.value},hw.prototype.renderSlider=function(t){var e=this.attributes,n=e.orient,r=e.trackSize,i=e.padding,e=e.slidable,a=x(F2(this.attributes,["track","thumb"]),2),o=a[0],a=a[1],s=v(v({orient:n,padding:i,slidable:e,trackSize:r,brushable:!1,showHandle:!1,values:this.getValues(),trackLength:this.trackLength,trackRadius:this.trackRadius,selectionRadius:this.thumbRadius},I2(o,"track")),I2(a,"selection"));this.slider=A(t).maybeAppendByClassName("scrollbar",function(){return new sw({style:s})}).update(s).node()},hw.prototype.render=function(t,e){this.renderSlider(e)},hw.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.style.value,r=x(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(fn(t,i,r)),e),this.onValueChange(n)},hw.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},hw.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orient?t[0]:t[1]},hw.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},hw.tag="scrollbar",hw.defaultOptions={style:{value:0,trackSize:10,isRound:!0,slidable:!0,scrollable:!0,orient:"vertical",padding:[2,2,2,2]}};var cw,uw=hw;function hw(t){var a=cw.call(this,Tn({},hw.defaultOptions,t))||this;return a.range=[0,1],a.onValueChange=function(t){var e=a.style.value;t!==e&&(a.dispatchEvent(new vo("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new vo("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=x(a.getLocalPosition(),2))[0],e=e[1],n=(i=x(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(D2(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new vo("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new vo("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new vo("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new vo("trackMouseleave",{detail:t.detail}))},a}var fw={style:{data:[],dataThreshold:100,showTitle:!0,titlePosition:"lb",titleFill:"black",titleFontSize:12,titleTextAlign:"center",titleSpacing:0,titleTextBaseline:"middle",showLine:!0,lineLineWidth:1,lineStroke:"black",lineArrow:new ts({style:{path:"M 10,10 L -10,0 L 10,-10 L0,0 L10,10Z",anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}}),lineArrowOffset:15,lineArrowSize:10,showTick:!0,tickDirection:"positive",tickStroke:"black",tickLength:5,tickLineWidth:1,tickStrokeOpacity:.65,showLabel:!0,labelSpacing:0,labelDirection:"positive",labelAlign:"parallel",labelTransforms:[],showGrid:!0,gridType:"segment",gridConnect:"line",gridDirection:"positive",gridLength:0,gridControlAngles:[]}},dw=(Tn({},fw,{style:{type:"arc"}}),Tn({},fw,{style:{}}),dx({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"));function pw(t,e,n,r){var i=n[e].data,n=n.map(function(t){return t.data}),i="function"==typeof r?r.call(null,i,e,n):r;t.attr(i||{})}function gw(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=x(t,2);return[t[0],cx(t[1],e)]}))}function yw(t,e){return e&&tn(e)?t.filter(e):t}function mw(t){return t.reduce(function(t,e,n){return"".concat(t).concat(0===n?"M":" L").concat(e[0],",").concat(e[1])},"")}function vw(t,e,n){var r,i,a,o;return"surround"===e.type?(r=t,n=n,o=(e=e).connect,e=e.center,"line"===(void 0===o?"line":o)?mw(r):e?(i=q2(r[0],e),a=n?0:1,r.reduce(function(t,e,n){var e=x(e,2),r=e[0],e=e[1];return(0===n?"M":"".concat(t,"A").concat(i,",").concat(i,",0,0,").concat(a,",")).concat(r,",").concat(e)},"")):""):mw(t)}function bw(t,e,n){function r(t,e){return"".concat(l," ").concat(t," ").concat(c," ").concat(e," ").concat(s)}var i=n.type,a=n.connect,o=n.center,s=n.closed?" Z":"",n=x([vw(t,n),vw(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=x([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r("L".concat(e.join()),"L".concat(t.join()));if(o)return a=(n=x([q2(e,o),q2(t,o)],2))[0],i=n[1],r("A".concat(a,",").concat(a,",0,0,1,").concat(e.join(" ")," L").concat(e.join()),"A".concat(i,",").concat(i,",0,0,0,").concat(t.join(" ")));throw new Error("Arc grid need to specified center")}function xw(t,e,n){n.type,n.center;var r=n.connect,i=n.areaFill;if(n.closed,!(e.length<2)&&i&&r){for(var a=Array.isArray(i)?i:[i,"transparent"],o=[],s=0;s<e.length-1;s++){var l=x([e[s].points,e[s+1].points],2),l=bw(l[0],l[1],n);o.push({path:l,fill:a[s%a.length]})}A(t).selectAll(".grid-region").data(o,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){pw(this,e,o,t)}).attr("className","grid-region")},function(t){return t.each(function(t,e){pw(this,e,o,t)})},function(t){return t.remove()})}}Me(Ew,ww=$l),Ew.prototype.render=function(t,e){t.className;var n,r,i,a,o=t.items,o=void 0===o?[]:o,s=(t.type,t.center,t.areaFill,t.closed,J(t,["className","items","type","center","areaFill","closed"])),o=(o=o,t.closed?o.map(function(t){var e=t.points,n=x(e),r=n[0];return n.slice(1),v(v({},t),{points:b(b([],x(e),!1),[r],!1)})}):o);n=e,r=t,i=s,a=o.map(function(t,e){return{id:t.id||"grid-line-".concat(e),path:vw(t.points,r)}}),A(n).selectAll(".grid-line").data(a,function(t){return t.id}).join(function(t){return t.append("path").styles({stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]}).each(function(t,e){t=t.path;pw(this,e,a,v({path:t},i))}).attr("className","grid-line")},function(t){return t.each(function(t,e){pw(this,e,a,t)})},function(t){return t.remove()}),xw(e,o,t)};var ww,kw=Ew;function Ew(){return null!==ww&&ww.apply(this,arguments)||this}var Mw=En(function(t,e){var e=x(e.angleRange,2),n=e[0];return(e[1]-n)*t+n},function(t,e){return b([t],x(e.angleRange),!1).join()}),Ow=En(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=x(e.startPos,2))[0],n=n[1],i=x(e.endPos,2),ve([0,0],[(r=x([i[0]-r,i[1]-n],2))[0],r[1]])):(i=ix(Mw(t,e)),[-Math.sin(i),Math.cos(i)])},function(t,e){var n="linear"===(n=e).type?b(b([],x(n.startPos),!1),x(n.endPos),!1):b(b(b([],x(n.angleRange),!1),x(n.center),!1),[n.radius],!1);return"arc"===e.type&&n.push(t),n.join()});function Sw(t,e,n){var t=Ow(t,n);return n=[],t=t,"positive"!==e?(n[0]=t[1],n[1]=-1*t[0]):(n[0]=-1*t[1],n[1]=t[0]),n}var _w=En(function(t,e){var n=x(e.startPos,2),r=n[0],n=n[1],e=x(e.endPos,2),e=x([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return b(b([t],x(e.startPos),!1),x(e.endPos),!1).join()}),Aw=En(function(t,e){var n=e.radius,r=x(e.center,2),i=r[0],r=r[1],t=ix(Mw(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return b(b(b([t],x(e.angleRange),!1),[e.radius],!1),x(e.center),!1).join()});function Tw(t,e){return("linear"===e.type?_w:Aw)(t,e)}function Pw(a,t,o){function e(t,e){var e=x(e,2),n=(r=x(e[0],2))[0],r=r[1],i=(e=x(e[1],2))[0],e=e[1];a.maybeAppendByClassName(t,"line").attr("className","".concat(dw.line.name," ").concat(t)).styles(v(v({},o),{x1:n,y1:r,x2:i,y2:e}))}var n,r,i,s=t.startPos,l=t.endPos,c=t.truncRange,u=t.lineExtension,h=x([s,l],2),f=x(h[0],2),d=f[0],f=f[1],h=x(h[1],2),p=h[0],h=h[1],l=x(u?(s=x([s=s,l=l,u=void 0===(u=u)?[0,0]:u],3),u=(l=x(s[0],2))[0],l=l[1],g=(n=x(s[1],2))[0],n=n[1],y=(s=x(s[2],2))[0],s=s[1],u=(g=x([g-u,n-l],2))[0],n=g[1],l=Math.sqrt(Math.pow(u,2)+Math.pow(n,2)),y=(g=x([-y/l,s/l],2))[0],s=g[1],[y*u,y*n,s*u,s*n]):new Array(4).fill(0),4),g=l[0],y=l[1],u=l[2],s=l[3];a.node().removeChildren();c?(l=(n=x(c,2))[0],c=n[1],i=(l=x([d+(p-d)*l,f+(h-f)*l],2))[0],l=l[1],r=(c=x([d+(p-d)*c,f+(h-f)*c],2))[0],c=c[1],e(dw.lineFirst.name,[[d+g,f+y],[i,l]]),e(dw.lineSecond.name,[[r,c],[p+u,h+s]]),i=a,t.truncRange,t.truncShape,t.lineExtension,i.select(dw.lineFirst.class).node(),i.select(dw.lineSecond.class).node()):e("axis-line",[[d+g,f+y],[p+u,h+s]])}function Lw(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g,y=e.type;"linear"===y?Pw(t,e,n):(r=t,a=n,u=(c=x((i=e).angleRange,2))[0],c=c[1],o=(s=x(i.center,2))[0],s=s[1],i=i.radius,console.assert(u<c,"end angle should be greater than start angle"),360==(l=c-u)?r.maybeAppendByClassName(dw.line,"circle").styles(v({cx:o,cy:s,r:i},a)):(d=(p=x([i,i],2))[0],p=p[1],h=(g=x([u*Math.PI/180,c*Math.PI/180],2))[0],g=g[1],f=(h=x([o+i*Math.cos(h),s+i*Math.sin(h)],2))[0],h=h[1],s=(o=x([o+i*Math.cos(g),s+i*Math.sin(g)],2))[0],i=o[1],g=180<l?1:0,o=c<u?0:1,l="M".concat(f,",").concat(h,",A").concat(d,",").concat(p,",0,").concat(g,",").concat(o,",").concat(s,",").concat(i),r.maybeAppendByClassName(dw.line,"path").styles(v({path:l},a)))),c=t,u=y,f=n,d=(h=e).lineArrow,p=e.truncRange,g=void 0===(g=e.lineArrowOffset)?0:g,h=e.lineArrowSize,d&&((d=rx(d)).attr(f),yx(d,h,!0),("arc"!==u&&p?c.select(dw.lineSecond.class):c.select(dw.line.class)).style("markerEnd",d).style("markerEndOffset",-g))}function Cw(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Nw(t,r){var e=r.gridLength,i=void 0===e?0:e;return t.map(function(t){var t=t.value,e=x(Tw(t,r),2),n=e[0],e=e[1],t=x(ye([0,0],Sw(t,r.gridDirection,r),i),2);return{points:[[n,e],[n+t[0],e+t[1]]]}})}function jw(t,e,n,r){var i=r.type,a=r.closed,o=r.areaFill,s=r.connect,l=Cw(n),c=yw(e,n.gridFilter),e="segment"===i?Nw(c,n):function(t,o,e){var s,l,c=e.controlAngles;if(!(e=Cw(o)))throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(c&&0!==c.length)return e=x(e,2),s=e[0],l=e[1],t.map(function(t){var t=x(Tw(t.value,o),2),e=t[0],t=t[1],n=x([e-s,t-l],2),r=n[0],i=n[1],a=[[e,t]];return c.forEach(function(t){var t=ix(t),t=x([Math.cos(t),Math.sin(t)],2),e=t[0],t=t[1];a.push([r*e-i*t+s,r*t+i*e+l])}),{points:a}});throw new Error("Invalid gridControlAngles")}(c,n,r);t.maybeAppendByClassName(dw.grid,function(){return new kw({})}).update(v(v({type:i,connect:s,closed:a,center:l},r),{items:e,areaFill:tn(o)?c.map(function(t,e){return cx(o,[t,e,c])}):o}))}Object.defineProperty(Fw.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(Fw.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(Fw.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(Fw.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(Fw.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Fw.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),Fw.prototype.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},Fw.prototype.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},Fw.prototype.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},Fw.prototype.rotate=function(t,e,n){t=this.rotatedPoints(t,e,n);return this.clear().add(t[0],t[1]).add(t[2],t[3]).add(t[4],t[5]).add(t[6],t[7])},Fw.prototype.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),t=Math.sin(t),l=e-e*s+n*t,e=n-e*t-n*s;return[[s*r-t*i+l,t*r+s*i+e],[s*r-t*o+l,t*r+s*o+e],[s*a-t*o+l,t*a+s*o+e],[s*a-t*i+l,t*a+s*i+e]].flat(1)},Fw.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},Fw.prototype.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},Fw.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var Rw=Fw;function Fw(t){var t=t||{},e=t.left,n=t.top,r=t.right,t=t.bottom;this.x1=null!=e?e:+Number.MAX_VALUE,this.x2=null!=r?r:-Number.MAX_VALUE,this.y1=null!=n?n:+Number.MAX_VALUE,this.y2=null!=t?t:-Number.MAX_VALUE}function Iw(t,c){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(function(t){return t=t,n=(e=x(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=x(t,4))[0],o=t[1],i-=n,e-=r,s=t[2]-a,t=t[3]-o,0!=(l=i*t-s*e)&&(o=i*(i=r-o)-e*(r=n-a))<0!=(e=0<l)&&(n=s*i-t*r)<0!=e&&l<o!=e&&l<n!=e;var e,n,r,i,a,o,s,l})}function Bw(t,e,n){void 0===n&&(n=[0,0,0,0]);var r=e.getEulerAngles()||0,i=(e.setEulerAngles(0),e.getLocalBounds()),a=i.min,o=i.max,i=i.halfExtents,s=a[0],l=2*i[0],i=2*i[1],a=a[1],c=o[0],o=o[1],u=0,h=0,f=s,d=a,p=("text"===e.tagName&&(i-=1.5,p=e.style.textAlign,g=e.style.textBaseline,u=+e.style.dx,h=+e.style.dy,"center"===p?f=(s+c)/2:"right"!==p&&"end"!==p||(f=c),"middle"===g?d=(a+o)/2:"bottom"!==g&&"baseline"!==g||(d=o)),x(n,4)),c=p[0],g=void 0===c?0:c,o=p[1],n=void 0===o?0:o,c=p[2],o=p[3];return t.set((u+=s)-(void 0===o?n:o),(h+=a)-g,u+l+n,h+i+(void 0===c?g:c)),e.setEulerAngles(r),t.rotatedPoints(ix(r),f,d)}function Dw(t,a){var o;return b([],x(t.reduce(function(t,e,n){return n&&o&&(n=o,r=e,i=a,n=Bw(new Rw,n,i),Iw(r=Bw(new Rw,r,i),[n[0],n[1],n[2],n[3]])||Iw(r,[n[0],n[1],n[4],n[5]])||Iw(r,[n[4],n[5],n[6],n[7]])||Iw(r,[n[2],n[3],n[6],n[7]]))?(t.add(o),t.add(e)):o=e,t;var r,i},new Set)),!1)}var zw=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(t.style.visibility="hidden"))})};var Gw=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,l,c,u=zw,h=2,f=t.slice(),d=t.slice(),p=Date.now(),g=Math.min.apply(Math,b([1],x(t.map(function(t){return t.getBBox().width})),!1));for("linear"!==n.type||0!==Ow(0,n)[1]&&0!==Ow(0,n)[0]||(n=H2(t[0]).left,t=H2(t[i-1]).right,t=Math.abs(t-n)||1,h=Math.max(Math.floor(i*g/t),h)),a&&(s=f.splice(0,1)[0]),o&&(l=f.splice(-1,1)[0],f.reverse());Dw((l?b(b([l],x(d),!1),[s],!1):b([s],x(d),!1)).filter(function(t){return nx(t)}),null==e?void 0:e.margin).length;)if((l&&!s&&h%2==0||l&&s)&&f.splice(0,1).forEach(r.hide),d=u(((c=f).forEach(r.show),c),{seq:h}),h++,200<Date.now()-p)return}}],["rotate",function(t,e,n,r){function i(){return Dw(t,s).length<1}function a(n){t.forEach(function(t,e){e=rn(n)?n[e]:n;_(e)||r.rotate(t,e)})}var o=void 0===(l=e.optionalAngles)?[0,45,90]:l,s=e.margin,e=void 0===(l=e.recoverWhenFailed)||l,l=t.map(function(t){return+(ox(t,"rotate")||0)});if(!i()){for(var c=0;c<o.length;c++)if(a(o[c]),i())return;e&&a(l)}}],["ellipsis",function(t,e,n,r){if(!(t.length<=1))for(var i,a,o=void 0===(s=e.suffix)?"...":s,s=e.minLength,l=e.maxLength,c=e.step,u=void 0===(e=e.margin)?[0,0,0,0]:e,e=(e=r.getTextShape(t[0]),d=e.style.fontFamily||"sans-serif",y=e.style.fontWeight||"normal",i=e.style.fontStyle||"normal",a=e.style.fontVariant,{fontSize:"object"==typeof(e=e.style.fontSize)?e.value:e,fontFamily:d,fontWeight:y,fontStyle:i,fontVariant:a}),h=_2(c,e)||1,f=_2(s,e)||1,d=_2(l,e),p=(!_(d)&&d!==1/0||(d=Math.max.apply(null,t.map(function(t){return t.getBBox().width}))),Date.now()),g=t.slice(),y=x(u,4),m=(y[0],y[1],y[2],y[3],d);f+h<m;m-=h){var v=function(e){return g.forEach(function(t){r.ellipsis(r.getTextShape(t),e,o)}),(g=Dw(t,u)).length<1||300<Date.now()-p?{value:void 0}:void 0}(m);if("object"==typeof v)return v.value}}]]);function Ww(i,a,o){var t=a.labelTransforms,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e,n=t.type,r=Gw.get(n);e=i,n=n,a.labelTransforms&&("ellipsis"!==n||1<e.map(function(t){return t.querySelector("text")}).length)&&null!=r&&r(i,t,a,o)})}function Yw(t){for(var e=t;e<0;)e+=360;return e%360}var Vw=En(function(t,e){var t=x(t,2),n=t[0],t=t[1],e=x(e,2),r=e[0],e=e[1],n=x([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return b(b([],x(t),!1),x(e),!1).join()});function Hw(t,e){return Sw(t,e.labelDirection,e)}function qw(t,e,n){var r,i=n.labelAlign,e=ox(e,"rotate");return e?+e%180:(e=0,r=Hw(t.value,n),t=Ow(t.value,n),"horizontal"===i?0:(e="perpendicular"===i?Vw([1,0],r):Vw([t[0]<0?-1:1,0],t),lx(n=((n=ax(e))+360)%180,-90,90)||(n+=180),n))}function Uw(t,e,n){e.setLocalEulerAngles(+t);t=function(t,e,n){var r=n.type,i=n.labelAlign,t=Hw(t,n),n=Yw(e),e=Yw(ax(Vw([1,0],t)));if([90,270].includes(e)&&!n)return"middle";if(!(e%180)&&[90,270].includes(n))return"middle";if("linear"!==r)return"parallel"===i?"middle":lx(n,90,270)?lx(e,90,270)?"start":"end":lx(e,90,270)?"end":"start";if(0===e){if(lx(n,0,90,!1,!0))return"start";if(lx(n,0,90)||lx(n,270,360))return"start"}if(90===e){if(lx(n,0,90,!1,!0))return"start";if(lx(n,90,180)||lx(n,270,360))return"end"}if(270===e){if(lx(n,0,90,!1,!0))return"end";if(lx(n,90,180)||lx(n,270,360))return"start"}if(180===e){if(90===n)return"start";if(lx(n,0,90)||lx(n,270,360))return"end"}return"start"}(e.__data__.value,t,n),n=e.querySelector(".axis-label-item");"text"===(null==n?void 0:n.nodeName)&&A(n).style("textAlign",t)}function Xw(t,e,n,r){var i=r.showTick,a=r.tickLength,o=r.tickDirection,s=r.labelDirection,l=cx(r.labelSpacing,[t,e,n]),s=x([Hw(t.value,r),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*("positive"===e?-1:1)},1)}(s,o)],2),o=x(de([0,0],ye([0,0],s[0],l+(1===s[1]?cx(i?a:0,[t,e,n]):0)),Tw(t.value,r)),2);return{x:o[0],y:o[1]}}function $w(t,e,n,r,i){var a=i.labelFormatter,o=Hw(e.value,i),i=function(){return rx(e.label||"")};return hn(a)?i=function(){return rx(a)}:tn(a)&&(i=function(){return rx(cx(a,[e,n,r,o]))}),t.append(i).attr("className",dw.labelItem.name)}function Kw(t,e,n,r,i,a){var o=null==(o=r.getElementsByClassName(dw.labelItem.toString()))?void 0:o[0],a=x(B2(gw(a,[t,e,n])),2),s=a[0],a=a[1],l=a.transform,a=J(a,["transform"]);"text"===(null==o?void 0:o.nodeName)&&o.attr(v({fontSize:12,fontFamily:"sans-serif",fontWeight:"normal",textBaseline:"middle"},s)),r.attr(v(v({},Xw(t,e,n,i)),a)),sx(r,l),Uw(qw(t,r,i),r,i)}function Zw(n){Ww(this.node().childNodes,n,{hide:function(t){t.style.visibility="hidden"},show:function(t){t.style.visibility="visible"},rotate:function(t,e){Uw(+e,t,n)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&gx(t,e,n)},getTextShape:function(t){return t.querySelector("text")}})}function Jw(t,e){return Sw(t,e.tickDirection,e)}var Qw=En(function(t,e){t=x(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return b(b([],x(t),!1),[e],!1).join()});function tk(t,e,n,r,i){var a=i.tickFormatter,o=Jw(e.value,i),i="line";return a instanceof Fo?i=function(){return a}:tn(a)&&(i=function(){return cx(a,[e,n,r,o])}),t.append(i).attr("className",dw.tickItem.name)}function ek(t,e,n,r,i,a,o){var s=Jw(t.value,a),l=(u=t,h=e,f=n,s=s,l=(a=a).tickLength,c=(a=x(Tw(u.value,a),2))[0],a=a[1],s=x(Qw(s,cx(l,[u,h,f])),2),u=(l=x(s[0],2))[0],h=l[1],f=x(s[1],2),{x:c,y:a,x1:u,x2:f[0],y1:h,y2:f[1]}),s=l.x1,c=l.x2,a=l.y1,u=l.y2,h=l.x,f=l.y,l=x(B2(gw(o,[t,e,n])),2),o=l[0],t=l[1];"line"===r.node().nodeName&&r.styles(v({x1:s,x2:c,y1:a,y2:u},o)),i.attr(v({x:h,y:f},t)),r.styles(o)}var nk={text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"left-top"},rk=dx({text:"text"},"title");function ik(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}).join(""):2<t.length?t[0]:t}function ak(r,t){t=Object.entries(t).reduce(function(t,e){var e=x(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}Me(lk,ok=$l),lk.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,t=t.inset,a=this.querySelector(rk.text.class);if(!a)return{x:0,y:0,width:+e,height:+n};var a=a.getBBox().height,i=x(P2(i),3),o=i[0],i=i[2],s=x([0,+n-a],2),l=s[0],s=s[1],r=ik(r);if("i"===r)return{x:0,y:l,width:+e,height:+n};r.includes("t")&&(l=(o=x([a+o,+n-a-o],2))[0],s=o[1]),r.includes("b")&&(s=x([+n-a-i],1)[0]);o=x(P2(t),4),r=o[0],n=o[1],a=o[2],i=o[3],t=x([i+n,r+a],2);return{x:i,y:l+r,width:+e-t[0],height:s-t[1]}},lk.prototype.render=function(t,e){t.width,t.height,t.position,t.spacing,t.class;var n,r,i,a=J(t,["width","height","position","spacing","class"]),o=x(B2(a),1)[0],s=(s=(t=t).width,l=t.height,t=t.position,n=x([+s/2,+l/2],2),u=(n=x([+n[0],+n[1],"center","middle"],4))[0],r=n[1],i=n[2],n=n[3],(t=ik(t)).includes("l")&&(u=(c=x([0,"start"],2))[0],i=c[1]),t.includes("r")&&(u=(c=x([+s,"end"],2))[0],i=c[1]),t.includes("t")&&(r=(s=x([0,"top"],2))[0],n=s[1]),t.includes("b")&&(r=(c=x([+l,"bottom"],2))[0],n=c[1]),{x:u,y:r,textAlign:i,textBaseline:n}),t=s.x,l=s.y,c=s.textAlign,u=s.textBaseline;a.text?A(e).maybeAppendByClassName(rk.text,"text").styles(o).call(ak,{x:t,y:l,textAlign:c,textBaseline:u}):e.removeChildren()};var ok,sk=lk;function lk(t){return ok.call(this,X2({},{style:nk},t=void 0===t?{}:t))||this}function ck(t,e,n){var r,i,a,o,s,t=t.select(dw.mainGroup.class);return t=t,e=e,r=(n=n).titlePosition,n=void 0===(n=n.titleSpacing)?0:n,r=ik(void 0===r?"lb":r),i=(a=t.node().getBBox()).x,a=a.y,o=(t=x(t.node().getBounds().halfExtents,2))[0],t=t[1],s=(e=x(e.node().getBounds().halfExtents,2))[0],e=e[1],i=x([i+o,a+t],2),i=(a=x([i[0],i[1]],2))[0],a=a[1],r.includes("l")&&(i-=o+s+n),r.includes("r")&&(i+=o+s+n),r.includes("t")&&(a-=t+e+n),r.includes("b")&&(a+=t+e+n),{x:i,y:a}}function uk(t,e,n,r){var i,a,o,s;n.title&&(a=(t=x((t=t,i=(a=n).title,a=t.maybeAppendByClassName(dw.title,function(){return rx(i)}),[t,a]),2))[0],t=t[1],a=a,e=e,n=n,o=(r=x(B2(r=r),2))[0],r=r[1],s=void 0===(s=r.transform)?"":s,r=J(r,["transform"]),t.styles(o),e=(o=ck(e,a,n)).x,n=o.y,a.styles(r),a.node().setPosition(e,n),sx(t,s))}var hk,fk=fx({render:function(n,e){var t=px(n),r=t.type,i=t.data,a=(t.class,t.dataThreshold),a=void 0===a?100:a,o=(t.crossSize,t.animation,t.title,t.showTitle),s=(t.titleSpacing,t.truncRange),l=(t.truncShape,t.showLine),c=(t.lineExtension,t.lineArrow,t.lineArrowOffset,t.lineArrowSize,t.showTick),u=(t.tickDirection,t.tickLength,t.tickFilter,t.tickFormatter,t.showLabel),h=(t.labelAlign,t.labelDirection,t.labelSpacing,t.labelFilter,t.labelFormatter,t.labelTransforms,t.showGrid),t=(t.gridFilter,t.gridLength,J(t,["type","data","class","dataThreshold","crossSize","animation","title","showTitle","titleSpacing","truncRange","truncShape","showLine","lineExtension","lineArrow","lineArrowOffset","lineArrowSize","showTick","tickDirection","tickLength","tickFilter","tickFormatter","showLabel","labelAlign","labelDirection","labelSpacing","labelFilter","labelFormatter","labelTransforms","showGrid","gridFilter","gridLength"])),r=x(F2("linear"===r?(t.startPos,t.endPos,J(t,["startPos","endPos"])):(t.angleRange,t.radius,t.center,J(t,["angleRange","radius","center"])),["title","line","tick","label","grid"]),5),f=r[0],d=r[1],p=r[2],g=r[3],y=r[4],m=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(i,a).filter(function(t){t=t.value;return!(s&&t>s[0]&&t<s[1])}),t=(ux(h,A(e).maybeAppendByClassName(dw.gridGroup,"g"),function(t){jw(t,m,n,y)}),A(e).maybeAppendByClassName(dw.mainGroup,"g")),r=(ux(l,t.maybeAppendByClassName(dw.lineGroup,"g"),function(t){Lw(t,n,d)}),t.maybeAppendByClassName(dw.tickGroup,"g")),i=(ux(c,r,function(t){var r,i,a;t=t,i=p,a=yw(m,(r=n).tickFilter),t.selectAll(".axis-tick").data(a).join(function(t){return t.append("g").attr("className",dw.tick.name).each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=tk.apply(void 0,b(b([A(this)],x(t),!1),[a,r],!1));ek.apply(void 0,b(b([],x(t),!1),[a,n,this,r,i],!1))})},function(t){return t.each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.removeChildren();var n=tk.apply(void 0,b(b([A(this)],x(t),!1),[a,r],!1));ek.apply(void 0,b(b([],x(t),!1),[a,n,this,r,i],!1))})},function(t){return t.remove()})}),t.maybeAppendByClassName(dw.labelGroup,"g")),a=(ux(u,i,function(t){var e,r,i,a;e=t,i=g,a=yw(m,(r=n).labelFilter),e.selectAll(dw.label.class).data(a).join(function(t){return t.append("g").attr("className",dw.label.name).each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];$w.apply(void 0,b(b([A(this)],x(t),!1),[a,r],!1)),Kw.apply(void 0,b(b([],x(t),!1),[a,this,r,i],!1))}).call(function(){Zw.call(e,r)})},function(t){return t.each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=A(this);n.node().removeChildren(),$w.apply(void 0,b(b([n],x(t),!1),[a,r],!1)),Kw.apply(void 0,b(b([],x(t),!1),[a,this,r,i],!1))}).call(function(){Zw.call(e,r)})},function(t){return t.remove()})}),A(e).maybeAppendByClassName(dw.titleGroup,"g"));ux(o,a,function(t){uk(t,A(e),n,f)})}},v({},fw.style)),dk={effect:"linear",duration:200,orient:"horizontal",initPage:0,loop:!1,buttonPath:[["M",(bo=0)-(o=6),(r=0)-o],["L",bo+o,r],["L",bo-o,r+o],["Z"]],buttonFill:"black",buttonSize:12,buttonCursor:"pointer",formatter:function(t,e){return"".concat(t,"/").concat(e)},pageNumFontSize:12,pageNumFill:"black",pageNumTextAlign:"start",pageNumTextBaseline:"middle",controllerPadding:5,controllerSpacing:5},pk=dx({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),gk=(Me(yk,hk=$l),Object.defineProperty(yk.prototype,"defaultPage",{get:function(){var t=this.attributes.initPage;return fn(void 0===t?0:t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(yk.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(yk.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=x((n=t.map(function(t){t=t.getBBox();return[t.width,t.height]}),((null==(t=n[0])?void 0:t.map(function(t,e){return n.map(function(t){return t[e]})}))||[]).map(function(t){return Math.max.apply(Math,b([],x(t),!1))})),2),e=t[0],t=t[1],r=this.attributes,i=r.pageWidth,r=r.pageHeight;return{pageWidth:void 0===i?e:i,pageHeight:void 0===r?t:r}},enumerable:!1,configurable:!0}),yk.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(yk.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),Object.defineProperty(yk.prototype,"finished",{get:function(){var t,e=this;return this.finishedPromise||(this.finishedPromise=new Promise(function(t){e.resolveFinishedPromise=function(){e.finishedPromise=null,t(e.currPage)}})),"idle"===this.playState&&null!=(t=this.resolveFinishedPromise)&&t.call(this),this.finishedPromise},enumerable:!1,configurable:!0}),yk.prototype.goTo=function(e){var n=this,t=this.attributes,r=t.duration,t=t.effect,i=this.currPage,a=this.playState,o=(this.finished,this.playWindow),s=this.pageViews;return"idle"!==a||e<0||s.length<=0||e>=s.length||(s[i].setLocalPosition(0,0),this.prepareFollowingPage(e),a={duration:r,easing:t,fill:"both"},i=(s=x(this.getFollowingPageDiff(e),2))[0],r=s[1],this.playState="running",Promise.all([o.animate([{transform:"translate(0, 0)"},{transform:"translate(".concat(-i,", ").concat(-r,")")}],a)].map(function(t){return null==t?void 0:t.finished})).then(function(){var t;n.innerCurrPage=e,n.playState="idle",n.setVisiblePages([e]),n.updatePageInfo(),null!=(t=n.resolveFinishedPromise)&&t.call(n)})),{finished:this.finished}},yk.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?{finished:this.finished}:(t=t?(n-1+e)%e:fn(n-1,0,e),this.goTo(t))},yk.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?{finished:this.finished}:(t=t?(n+1)%e:fn(n+1,0,e),this.goTo(t))},yk.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;this.clipPath=t.maybeAppendByClassName(pk.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())},yk.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){n.includes(e)?t.attr("visibility","visible"):t.attr("visibility","hidden")})},yk.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orient,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,x("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=x(i.offset,3),o=x(a[0],2),s=o[0],c=o[1],l=x(a[1],2),r=l[0],o=l[1],l=x(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},yk.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(pk.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},yk.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orient,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t<i?-1:1,"horizontal"===e?[t*n,0]:[0,t*r])},yk.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=x(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},yk.prototype.renderController=function(t){var e,n,r,i,a,o=this,s=this.attributes.controllerSpacing,l=this.pageShape,c=l.pageWidth,l=l.pageHeight,u=2<=this.pageViews.length,t=t.maybeAppendByClassName(pk.controller,"g").style("visibility",u?"visible":"hidden");u&&(i=(u=x(F2(this.attributes,["button","pageNum"]),2))[0],u=u[1],r=(i=x(B2(i),2))[0],i=i[1],e=r.size,n=J(r,["size"]),r=t.maybeAppendByClassName(pk.prevBtnGroup,"g").styles(i),this.prevBtnGroup=r.node(),a=r.maybeAppendByClassName(pk.prevBtn,"path"),i=t.maybeAppendByClassName(pk.nextBtnGroup,"g").styles(i),this.nextBtnGroup=i.node(),[a,i.maybeAppendByClassName(pk.nextBtn,"path")].forEach(function(t){t.styles(v(v({},n),{transformOrigin:"center"})),yx(t.node(),e,!0)}),a=t.maybeAppendByClassName(pk.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(pk.pageInfo,"text").styles(v(v({},C2),u)),this.updatePageInfo(),t.node().setLocalPosition(c+s,l/2),r.on("click",function(){o.prev()}),i.on("click",function(){o.next()}))},yk.prototype.render=function(t,e){e=A(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},yk.prototype.bindEvents=function(){function t(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}var r,i,a,o,e=this;r=function(){return e.render(e.attributes,e)},i=50;this.playWindow.addEventListener(w.INSERTED,t),this.playWindow.addEventListener(w.REMOVED,t)},yk);function yk(t){t=hk.call(this,X2({},{style:dk},t))||this;return t.finishedPromise=null,t.resolveFinishedPromise=null,t.playState="idle",t.contentGroup=t.appendChild(new qo({class:pk.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new qo({class:pk.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function mk(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}Ox.registerSymbol("hiddenHandle",function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]}),Ox.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+(n=n/6)],["L",t+r-2,e+n],["M",a,e-n],["L",t+r-2,e-n]]}),Ox.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-(n=n/6),a],["L",t-n,e+r-2],["M",t+n,a],["L",t+n,e+r-2]]});var vk,bk=dx({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),xk={span:[1,1],marker:"path",markerD:xx(6,6,6),markerFill:"#d3d2d3",markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelFontFamily:"sans-serif",valueFontFamily:"sans-serif",labelTextAlign:"start",valueTextAlign:"start",labelTextBaseline:"middle",valueTextBaseline:"middle"},wk=(Me(kk,vk=$l),Object.defineProperty(kk.prototype,"showValue",{get:function(){var t=this.attributes.value;return!!t&&(hn(t)||dn(t)?""!==t:""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(kk.prototype,"actualSpace",{get:function(){var t=this.markerGroup,e=this.labelGroup,n=this.valueGroup,t=t.node().getBBox(),r=t.width,t=t.height,e=e.node().getBBox(),i=e.width,e=e.height,n=n.node().getBBox(),a=n.width,n=n.height;return{markerWidth:r,labelWidth:i,valueWidth:a,height:Math.max(t,e,n)}},enumerable:!1,configurable:!0}),Object.defineProperty(kk.prototype,"span",{get:function(){var t,e=this.attributes;return"span"in e?(t=(e=x(P2(e.span),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(kk.prototype,"shape",{get:function(){var t=this.attributes,e=t.markerSize,t=t.width,n=this.actualSpace,r=n.markerWidth,n=n.height,i=this.actualSpace,a=i.labelWidth,i=i.valueWidth,o=x(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=x(this.span,2),a=(e=x([e[0]*t,e[1]*t],2))[0],i=e[1]),{width:r+a+i+s+o,height:n,markerWidth:r,labelWidth:a,valueWidth:i}},enumerable:!1,configurable:!0}),Object.defineProperty(kk.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=x(P2(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(kk.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=x(this.spacing,2),o=a[0];return{height:t,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+o,e+n+o+a[1]]}},enumerable:!1,configurable:!0}),kk.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.marker,i=n.markerSize,a=R2(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(bk.markerGroup,"g"),ux(!!r,this.markerGroup,function(){e.markerGroup.maybeAppendByClassName(bk.marker,r).styles(v({anchor:"0.5 0.5"},a)),yx(e.markerGroup.node(),i,!0)})},kk.prototype.renderLabel=function(t){var e=this.attributes.label,n=R2(this.attributes,"label");this.labelGroup=t.maybeAppendByClassName(bk.labelGroup,"g"),this.labelGroup.maybeAppendByClassName(bk.label,function(){return rx(e)}).styles(n)},kk.prototype.renderValue=function(t){var e=this,n=this.attributes.value,r=R2(this.attributes,"value");this.valueGroup=t.maybeAppendByClassName(bk.valueGroup,"g"),ux(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(bk.value,function(){return rx(n)}).styles(r)})},kk.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=R2(this.attributes,"background");this.background=t.maybeAppendByClassName(bk.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(bk.background,"rect").styles(v({width:n,height:e},r))},kk.prototype.adjustLayout=function(){var t=this.layout,e=(t.markerWidth,t.labelWidth),n=t.valueWidth,r=(t.width,t.height),t=x(t.position,3),i=t[0],a=t[1],t=t[2],r=r/2;this.markerGroup.styles({x:i,y:r}),this.labelGroup.styles({x:a,y:r}),gx(this.labelGroup.select(bk.label.class),e),this.showValue&&(this.valueGroup.styles({x:t,y:r}),gx(this.valueGroup.select(bk.value.class),n))},kk.prototype.render=function(t,e){e=A(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()},kk);function kk(t){return vk.call(this,X2({},{style:xk},t))||this}function Ek(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var Mk,Ok=dx({page:"item-page",navigator:"navigator",item:"item"},"items"),Sk={data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orient:"horizontal",click:An,mouseenter:An,mouseleave:An},_k=(Me(Ak,Mk=$l),Object.defineProperty(Ak.prototype,"attrs",{get:function(){return px(this.attributes)},enumerable:!1,configurable:!0}),Object.defineProperty(Ak.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(Ak.prototype,"grid",{get:function(){var t=this.attrs,e=t.gridRow,n=t.gridCol,t=t.data;if(e||n)return e&&n?[e,n]:e?[e,t.length]:[t.length,n];throw new Error("gridRow and gridCol can not be set null at the same time")},enumerable:!1,configurable:!0}),Object.defineProperty(Ak.prototype,"renderData",{get:function(){var t=this.attrs,a=t.data,o=t.layout,s=R2(this.attrs,"item");return a.map(function(e,n){var t=e.id,r=e.label,i=e.value;return{id:"".concat(void 0===t?n:t),index:n,style:v({layout:o,label:r,value:i},Object.fromEntries(Object.entries(s).map(function(t){t=x(t,2);return[t[0],cx(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),Ak.prototype.getGridLayout=function(){var u=this,t=this.attrs,h=t.orient,f=t.width,d=t.rowPadding,p=t.colPadding,g=x(this.navigatorShape,1)[0],t=x(this.grid,2),y=t[0],m=t[1],v=m*y,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/v),i=e%v,a=u.ifHorizontal(m,y),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),x(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=x([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=x([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=x([a*(s+p),b],2))[0],l=n[1],o===y-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},Ak.prototype.getFlexLayout=function(){var t=this.attrs,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=x(this.navigatorShape,1)[0],r=x(this.grid,2),s=r[0],l=r[1],r=x([e-t,n],2),c=r[0],u=r[1],e=x([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],y=e[5],m=e[6],v=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===m?0:o,i=m+r+n;return i<=c&&Ek(g,function(t){return t<l})?(r=x([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=x([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&Ek(y,function(t){return t<s})?(r=x([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=x([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],m=i[2],v=i[3],d=i[4],p=i[5],y=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:y,col:g++}})},Object.defineProperty(Ak.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return 0<e.slice(-1)[0].page?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),Ak.prototype.ifHorizontal=function(t,e){return mk(this.attrs.orient,t,e)},Ak.prototype.flattenPage=function(e){e.querySelectorAll(Ok.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(Ok.page.class).forEach(function(t){e.removeChild(t).destroy()})},Ak.prototype.renderItems=function(t){var e=this.attrs,n=e.click,r=e.mouseenter,i=e.mouseleave,a=(this.flattenPage(t),this.dispatchCustomEvent.bind(this));A(t).selectAll(Ok.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new wk({style:t})}).attr("className",Ok.item.name).on("click",function(){null!=n&&n(this),a("itemClick",{item:this})}).on("mouseenter",function(){null!=r&&r(this),a("itemMouseenter",{item:this})}).on("mouseleave",function(){null!=i&&i(this),a("itemMouseleave",{item:this})})},function(t){return t.each(function(t){t=t.style;this.update(t)})},function(t){return t.remove()})},Ak.prototype.relayoutNavigator=function(){var t=this.attrs,e=t.layout,t=t.width,n=(null==(n=this.pageViews.children[0])?void 0:n.getBBox().height)||0,r=x(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update(v({},"grid"===e?{pageWidth:t-i,pageHeight:n-r}:{}))},Ak.prototype.adjustLayout=function(){var n,e=this,t=Object.entries((t=this.itemsLayout,n="page",t.reduce(function(t,e){return(t[e[n]]=t[e[n]]||[]).push(e),t},{}))).map(function(t){t=x(t,2);return{page:t[0],layouts:t[1]}}),u=b([],x(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new qo({className:Ok.page.name}));t.forEach(function(t){var n,r,i,e=t.x,a=t.y,o=t.index,s=t.width,l=t.height,o=u[o];c.appendChild(o),n=t,r=o,(i=hn(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(an(r[t])||(r[t]=dn(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},Ak.prototype.renderNavigator=function(t){var e=this.attrs.orient,n=R2(this.attrs,"nav"),n=v(v({},n),{orient:e});return this.navigator=t.maybeAppendByClassName(Ok.navigator,function(){return new gk({})}).update(n).node(),this.navigator},Ak.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(A(e)),this.renderItems(n.getContainer()),this.adjustLayout())},Ak.prototype.dispatchCustomEvent=function(t,e){t=new vo(t,{detail:e});this.dispatchEvent(t)},Ak);function Ak(t){t=Mk.call(this,X2({},{style:Sk},t))||this;return t.navigatorShape=[0,0],t}var Tk,mo={style:{padding:0,orient:"horizontal",backgroundFill:"transparent",titleText:"",showTitle:!0,titleSpacing:4,titlePosition:"left-top",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12}},Pk=Tn({},mo,{style:{type:"category",items:[],maxCols:void 0,maxRows:void 0,spacing:[8,2],itemBackground:{padding:0,style:{fill:"transparent",active:{cursor:"pointer"}}},reverse:!1}}),Lk=Tn({},mo,{style:{type:"continuous",color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],slidable:!0,showHandle:!0,showLabel:!0,showIndicator:!0,labelSpacing:5,indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorBackgroundFill:"#262626"}}),Ck=dx({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),Nk=(Me(jk,Tk=$l),jk.prototype.renderTitle=function(t,n,r){var e=this.attributes.showTitle,i=x(B2(R2(this.attributes,"title")),2),a=i[0],i=i[1];this.titleGroup=t.maybeAppendByClassName(Ck.titleGroup,"g").styles(i),ux(!!e,this.titleGroup,function(t){var e=v({width:n,height:r},a);t.maybeAppendByClassName(Ck.title,function(){return new sk({style:e})}).update(e)})},jk.prototype.renderItems=function(t,e,n){var r=this,i=x(F2(this.attributes,["title"]),2),i=x(B2(i[1]),2),a=i[0],i=i[1],a=v(v({},a),{width:e,height:n});this.itemsGroup=t.maybeAppendByClassName(Ck.itemsGroup,"g").styles(i),this.itemsGroup.maybeAppendByClassName(Ck.items,function(){return new _k({style:{data:[]}})}).update(a),Object.entries(a).forEach(function(t){var t=x(t,2),e=t[0],t=t[1];return r.itemsGroup.attr(e,t)})},jk.prototype.adjustLayout=function(){var t,e;this.attributes.showTitle&&(t=(e=this.titleGroup.select(Ck.title.class).node().getAvailableSpace()).x,e=e.y,this.itemsGroup.node().setLocalPosition(t,e))},Object.defineProperty(jk.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?[(e=this.titleGroup.select(Ck.title.class).node().getAvailableSpace()).width,e.height]:[n,t]},enumerable:!1,configurable:!0}),jk.prototype.render=function(t,e){var n=t.width,t=t.height,e=A(e);this.renderTitle(e,n,t),this.renderItems.apply(this,b([e],x(this.availableSpace),!1)),this.adjustLayout()},jk);function jk(t){return Tk.call(this,X2({},Pk,t))||this}var Rk,Fk={formatter:function(t){return t},padding:[2,4],position:"right",labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",backgroundZIndex:-1,backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333"},Ik=dx({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Bk=(Me(Dk,Rk=$l),Dk.prototype.renderBackground=function(){var t=this.style,e=t.position,t=x(P2(t.padding),4),n=t[0],r=t[1],i=t[2],t=t[3],a=this.label.node().getLocalBounds(),o=a.min,a=a.max,t=[[o[0]-t,o[1]-n],[a[0]+r,a[1]+i]],o=this.getPath(e,t),n=R2(this.attributes,"background");this.background=A(this.group).maybeAppendByClassName(Ik.background,"path").styles(v(v({},n),{path:o})),this.group.appendChild(this.label.node())},Dk.prototype.renderLabel=function(){var t=this.attributes,e=t.value,n=t.formatter,t=x(B2(R2(this.attributes,"label")),2),r=t[0],t=t[1];this.label=A(this.group).maybeAppendByClassName(Ik.labelGroup,"g").styles(t),e&&this.label.maybeAppendByClassName(Ik.label,function(){return rx(n(e))}).style("text",n(e).toString()).selectAll("text").styles(v(v({},C2),r))},Dk.prototype.adjustLayout=function(){var t=x(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},Dk.prototype.getPath=function(n,t){var r=this,t=x(t,2),e=x(t[0],2),i=e[0],e=e[1],t=x(t[1],2),a=t[0],t=t[1],o={top:"bottom",right:"left",bottom:"top",left:"right"},a=Object.entries({top:[[i,e],[a,e]],right:[[a,e],[a,t]],bottom:[[a,t],[i,t]],left:[[i,t],[i,e]]}).map(function(t){var t=x(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[b(["M"],x(t[0]),!1),b(["L"],x(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},Dk.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=x(t,2))[0],t=t[1],r=(e=x(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,b([],x(t),!1)),t=x(t,2),r=x(t[0],2),i=r[0],r=r[1],t=x(t[1],2),a=t[0],t=t[1],a=x(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=x(a[1],2),o=a[0],a=a[1],s=t/2,e=e*(t/Math.abs(t)),t=e/2,e=e*Math.sqrt(3)/2*.8,o=x([o,o+s-t,o+s,o+s+t,a],5),s=o[0],t=o[1],a=o[2],l=o[3],o=o[4];return n?(this.point=[a,r-e],[["M",s,r],["L",t,r],["L",a,r-e],["L",l,r],["L",o,r]]):(this.point=[i+e,a],[["M",i,s],["L",i,t],["L",i+e,a],["L",i,l],["L",i,o]])},Dk.prototype.bindEvents=function(){this.label.on(w.BOUNDS_CHANGED,this.renderBackground)},Dk.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},Dk);function Dk(t){void 0===t&&(t={});t=Rk.call(this,X2({},{style:v({visibility:"hidden"},Fk)},t))||this;return t.point=[0,0],t.group=t.appendChild(new qo({})),t}var zk=dx({marker:"marker",labelGroup:"labelGroup",label:"label"},"handle"),Gk=fx({render:function(t,e){var a,o=t.orient,n=t.visibility,r=t.spacing,s=void 0===r?0:r,r=t.showLabel,l=t.formatter,i=t.markerSymbol,i=void 0===i?mk(o,"horizontalHandle","verticalHandle"):i,t=x(F2(t,["label","marker"]),2),c=t[0],t=t[1],u=c.text,h=J(c,["text"]);i&&"hidden"!==n?(c=v({symbol:i},t),a=A(e).maybeAppend(zk.marker.name,function(){return new Ox({})}).update(c),ux(r,A(e).maybeAppendByClassName(zk.labelGroup,"g"),function(t){var t=t.maybeAppendByClassName(zk.label,"text").styles(v({text:l(u).toString()},h)),e=a.node().getBBox(),n=e.width,e=e.height,e=x(mk(o,[0,e+s,"center","top"],[n+s,0,"start","middle"]),4),n=e[0],r=e[1],i=e[2],e=e[3];t.node().setLocalPosition(n,r),t.style("textAlign",i).style("textBaseline",e)})):(null!=(n=e.querySelector(zk.marker.class))&&n.remove(),null!=(i=e.querySelector(zk.label.class))&&i.remove())}},v({},{markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orient:"vertical",spacing:0,showLabel:!0,formatter:function(t){return t.toString()}}));function Wk(t,e){var t=x(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(r<=e&&e<=i)return[r,i]}return[e,e]}(t,e),2),n=t[0],t=t[1];return{tick:(n+t)/2<e?t:n,range:[n,t]}}var Yk=dx({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Vk(t){var e=t.orient,n=t.size,t=t.len;return mk(e,[t,n],[n,t])}function Hk(t){var e=t.type,t=x(Vk(t),2),n=t[0],t=t[1];return"size"===e?[["M",0,t],["L",0+n,0],["L",0+n,t],["Z"]]:[["M",0,t],["L",0,0],["L",0+n,0],["L",0+n,t],["Z"]]}function qk(t){var e,n,i,a,r=t.orient,o=t.color,s=t.block,t=t.blocks,l=(e=tn(o)?new Array(20).fill(0).map(function(t,e,n){return o(e/(n.length-1))}):o).length;return l?s?(s=t,t=e,n=r,i=Array.from(t),a=s+1,new Array(a).fill(0).reduce(function(t,e,n){var r=i[n%i.length];return t+" ".concat(n/(a-1),":").concat(r).concat(n<a-1?" ".concat((n+1)/(a-1),":").concat(r):"")},"l(".concat("horizontal"===n?"0":"270",")"))):e.reduce(function(t,e,n){return t+" ".concat(n/(l-1),":").concat(e)},"l(".concat(mk(r,"0","270"),")")):""}function Uk(t,e,n){var r,i,a,o=qk(e),t=t.maybeAppendByClassName(Yk.selection,"path").styles(v({path:Hk(e),fill:o},n)),n=t.maybeAppendByClassName(Yk.clipPath,"path").styles({path:(n=(o=e).orient,(e=o.range)?(i=(o=x(Vk(o),2))[0],o=o[1],r=(e=x(e,2))[0],e=e[1],a=mk(n,r*i,0),r=mk(n,0,r*o),i=mk(n,e*i,i),[["M",a,r],["L",a,a=mk(n,o,e*o)],["L",i,a],["L",i,r],["Z"]]):[])}).node();t.style("clip-path",n)}var Xk,$k,Kk,Zk,Jk=fx({render:function(t,e){var n,r=x(F2(t,["selection","track"]),2),i=r[0],r=r[1],a=A(e).maybeAppendByClassName(Yk.trackGroup,"g");n=t,r=r,a.maybeAppendByClassName(Yk.track,"path").styles(v({path:Hk(n)},r)),Uk(A(e).maybeAppendByClassName(Yk.selectionGroup,"g"),t,i)}},v({},{type:"color",orient:"horizontal",size:30,range:[0,1],len:200,block:!1,blocks:0,color:["#fff","#000"],trackFill:"#e5e5e5"})),Qk=En(function(t){return{min:Math.min.apply(Math,b([],x(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,b([],x(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),t5=(Me(e5,Xk=$l),e5.prototype.render=function(t,e){var n=this,r=(t.data,t.width),i=t.height,a=(t.orient,t.defaultValue,t.color,t.block,t.type,t.slidable,t.step,t.showTitle),o=(t.showHandle,t.showLabel),t=(t.showIndicator,x(F2(px(t),["title","label","indicator","ribbon","handle"]),5)),s=t[0],l=(t[1],t[2]),c=t[3],t=(t[4],A(e).maybeAppendByClassName(Ck.title,function(){return new sk({style:v({width:r,height:i},s)})})),a=(ux(a,A(e),function(t){}),t.node().getAvailableSpace()),t=a.x,u=a.y,a=(a.width,a.height,A(e).maybeAppendByClassName(Ck.contentGroup,"g").styles({x:t,y:u})),h=a.maybeAppendByClassName(Ck.ribbonGroup,"g");this.renderRibbon(h,c),this.handlesGroup=h.maybeAppendByClassName(Ck.handlesGroup,"g"),this.renderHandles(),this.renderIndicator(a,l),ux(o,A(e).maybeAppendByClassName(Ck.labelGroup,"g").styles({x:t,y:u}),function(t){n.renderLabel(t)})},Object.defineProperty(e5.prototype,"range",{get:function(){var t=this.attributes.data;return Qk(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e5.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,t=t.max;return this.innerRibbonScale.update({domain:[e,t],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e5.prototype,"ribbonRange",{get:function(){var t=x(this.selection,2),e=t[0],t=t[1],n=this.ribbonScale;return[n.map(e),n.map(t)]},enumerable:!1,configurable:!0}),Object.defineProperty(e5.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=x(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),e5.prototype.ifHorizontal=function(t,e){return mk(this.style.orient,"function"==typeof t?t():t,"function"==typeof e?e():e)},e5.prototype.renderRibbon=function(t,e){var n=this.attributes,r=n.type,i=n.orient,a=n.color,o=n.block,n=n.data;this.ribbon=t.maybeAppendByClassName(Ck.ribbon,function(){return new Jk({})}).update(v({type:r,orient:i,color:a,block:o,blocks:n.length-1,range:this.ribbonRange},e))},e5.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.slidable,n=x(this.selection,2),r=n[0],n=n[1];this.startHandle=this.renderHandle("start",r),this.endHandle=this.renderHandle("end",n),e&&t?this.handlesGroup.style("visibility","visible"):this.handlesGroup.style("visibility","hidden")},e5.prototype.renderHandle=function(t,e){var n=this.attributes.orient,r=R2(this.attributes,"handle"),r=(r.formatter,J(r,["formatter"])),n=this.handlesGroup.maybeAppendByClassName(Ck.prefix("".concat(t,"-handle")),function(){return new Gk({})}).styles(v({orient:n,labelText:e},r));return this.setHandlePosition(t,e),n},e5.prototype.setHandlePosition=function(t,e){var n=this.attributes,r=n.ribbonSize,n=n.handleFormatter,e=this.getOffset(e),r=x(this.ifHorizontal([e,.7*r],[r/2,e]),2),e=r[0],r=r[1],t=this.handlesGroup.select(".".concat(Ck.prefix("".concat(t,"-handle")))).node(),n=(null!=t&&t.attr("formatter",n),x(t.getLocalPosition(),2)),i=n[0],n=n[1];Math.abs(e+r-i-n)<100?null!=t&&t.setLocalPosition(e,r):null!=t&&t.animate([{transform:"translate(".concat(t.getLocalPosition().slice(0,2).join(","),")")},{transform:"translate(".concat(e,", ").concat(r,")")}],{duration:200,fill:"both"})},e5.prototype.renderIndicator=function(t,e){this.indicator=t.maybeAppendByClassName(Ck.indicator,function(){return new Bk({style:e})}).update(e)},Object.defineProperty(e5.prototype,"labelData",{get:function(){var o=this,t=this.attributes,e=t.data,s=t.labelAlign;return e.reduce(function(t,e,n,r){var i,a=null!=(a=null==e?void 0:e.id)?a:n.toString();return"value"===s?t.push(v(v({},e),{id:a,label:null!=(i=null==e?void 0:e.label)?i:e.value.toString(),value:o.ribbonScale.map(e.value)})):n<r.length-1&&(i=r[n+1],r=((n=(r=x([e.value,i.value],2))[0])+(i=r[1]))/2,t.push(v(v({},e),{id:a,range:[n,i],label:[n,i].join("~"),value:o.ribbonScale.map(r)}))),t},[])},enumerable:!1,configurable:!0}),Object.defineProperty(e5.prototype,"labelStyle",{get:function(){var t=this.attributes,e=t.orient,t=t.labelDirection,t=void 0===t?"positive":t,n=x(["center","middle"],2),r=n[0],n=n[1];return"horizontal"===e?n="positive"===t?"top":"bottom":r="positive"===t?"end":"start",{labelTextAlign:r,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e5.prototype.renderLabel=function(t){var e=this.attributes,n=e.ribbonSize,e=e.ribbonLen,r=R2(this.attributes,"label"),i=r.spacing,a=(r.align,r.formatter),o=r.filter,r=J(r,["spacing","align","formatter","filter"]),e=x(this.ifHorizontal([[0,n/2],[e,n/2]],[[n/2,0],[n/2,e]]),2),s=e[0],e=e[1],l=v(v({type:"linear",startPos:s,endPos:e,data:this.labelData,showLine:!1,showGrid:!1,showTick:!1,labelSpacing:i+n/2,labelTransform:"rotate(0)"},this.labelStyle),Object.fromEntries(Object.entries(r).map(function(t){var t=x(t,2),e=t[0],t=t[1];return["label".concat((e=e).charAt(0).toUpperCase()+e.slice(1)),t]}))),s=t.maybeAppendByClassName(Ck.label,function(){return new fk({style:l})}).styles(l).node();s.attr("labelFormatter",a),s.attr("labelFilter",o)},e5.prototype.bindEvents=function(){var n=this,t=new Map;t.set("ribbon",this.ribbon),t.set("start",this.startHandle),t.set("end",this.endHandle),t.forEach(function(t,e){null!=t&&t.on("mousedown",n.onDragStart(e)),null!=t&&t.on("touchstart",n.onDragStart(e))}),null!=(t=this.startHandle)&&t.on("mouseover",function(){return n.updateMouse()}),null!=(t=this.endHandle)&&t.on("mouseover",function(){return n.updateMouse()}),this.ribbon.on("mousemove",this.onHovering),this.addEventListener("mouseout",this.hideIndicator)},e5.prototype.showIndicator=function(t,e){void 0===e&&(e="".concat(t));var n,r=this.attributes,i=r.orient;r.showIndicator&&"number"==typeof t?(n=(r=this.range).min,r=r.max,t=fn(t,n,r),n=[this.getOffset(t),0],"vertical"===i&&n.reverse(),this.indicator.update({visibility:"visible",position:this.ifHorizontal("top","left"),value:e}),(r=this.indicator.node()).setLocalPosition.apply(r,b([],x(n),!1))):this.hideIndicator()},e5.prototype.hideIndicator=function(){var t;null!=(t=this.indicator)&&t.style("visibility","hidden")},e5.prototype.updateMouse=function(){this.style.slidable&&(this.style.cursor="grabbing")},e5.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e5.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=x(this.selection,2),c=l[0],l=l[1],t=x([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=x((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=x(n,2))[0],n=n[1],a=(c=x(c,2))[0],c=c[1],o=(l=x(l,2))[0],l=l[1],c=(a=x([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=x([a,c],2))[0],a=u[1]),n-i<s?[i,n]:c<i?o===i&&l===a?[i,a]:[i,s+i]:n<a?l===n&&o===c?[c,n]:[n-s,n]:[T2(c,r),T2(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(e5.prototype,"step",{get:function(){var t=this.attributes.step,t=void 0===t?1:t,e=this.range,n=e.min,e=e.max;return mn(t)?T2(.01*(e-n),0):t},enumerable:!1,configurable:!0}),e5.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?Wk(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},e5.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=x(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,b([],x(D2(t)),!1));return fn(this.getOffset(i-a,!0)+r,r,n)},e5.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,n=n.max,i=this.attributes.ribbonLen,a=this.eventToOffsetScale;return a.update({domain:[r,n],range:[0,i]}),e?a.invert(t):a.map(t)},e5.prototype.dispatchSelection=function(){var t=new vo("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e5.prototype.dispatchIndicated=function(t,e){t=new vo("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},t([tx(100)],e5.prototype,"dispatchSelection",null),t([tx(100)],e5.prototype,"dispatchIndicated",null),e5);function e5(t){var a=Xk.call(this,X2({},Lk,t))||this;return a.eventToOffsetScale=new Im({}),a.innerRibbonScale=new Im({}),a.onHovering=function(t){var e=a.attributes,n=e.data,e=e.block,t=(t.stopPropagation(),a.getValueByCanvasPoint(t));e?(e=Wk(n.map(function(t){return t.value}),t).range,a.showIndicator((e[0]+e[1])/2,"".concat(e[0],"-").concat(e[1])),a.dispatchIndicated(t,e)):(n=a.getTickValue(t),a.showIndicator(n),a.dispatchIndicated(n))},a.onDragStart=function(e){return function(t){t.stopPropagation(),a.attributes.slidable&&(a.target=e,a.prevValue=a.getTickValue(a.getValueByCanvasPoint(t)),document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseleave",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd))}},a.onDragging=function(t){var e=a.target,n=(a.updateMouse(),x(a.selection,2)),r=n[0],n=n[1],t=a.getTickValue(a.getValueByCanvasPoint(t)),i=t-a.prevValue;"start"===e?r!==t&&a.updateSelection(t,n):"end"===e?n!==t&&a.updateSelection(r,t):"ribbon"===e&&0!=i&&(a.prevValue=t,a.updateSelection(i,i,!0))},a.onDragEnd=function(){a.style.cursor="default",document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("touchmove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a}function n5(t){$k||($k=document.createElement("table"),Zk=document.createElement("tr"),Kk=/^\s*<(\w+|!)[^>]*>/,Zk={tr:document.createElement("tbody"),tbody:$k,thead:$k,tfoot:$k,td:Zk,th:Zk,"*":document.createElement("div")});var e=Kk.test(t)&&RegExp.$1,e=(e&&e in Zk||(e="*"),Zk[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}var r5,to="tooltip",i5="tooltip-title",a5="tooltip-list",ao="tooltip-list-item",n="tooltip-list-item-name",Zl="tooltip-list-item-marker",Jl="tooltip-list-item-name-label",e="tooltip-list-item-value",l="tooltip-crosshair-x",Za="tooltip-crosshair-y",Ql={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"},no=((eo={})[".".concat(to)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},eo[".".concat(i5)]={color:"rgba(0, 0, 0, 0.45)"},eo[".".concat(a5)]={margin:"0px","list-style-type":"none",padding:"0px"},eo[".".concat(ao)]={"list-style-type":"none","margin-top":"12px",display:"flex","line-height":"1em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},eo[".".concat(Zl)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},eo[".".concat(n)]={display:"flex","align-items":"center","max-width":"216px"},eo[".".concat(Jl)]=v({flex:1},Ql),eo[".".concat(e)]=v({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Ql),eo[".".concat(l)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},eo[".".concat(Za)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},eo),o5=(Me(s5,r5=$l),Object.defineProperty(s5.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),s5.prototype.getContainer=function(){return this.element},Object.defineProperty(s5.prototype,"position",{set:function(t){var t=x(t,2),e=t[0],t=t[1];this.attr({x:e,y:t}),this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(s5.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(s5.prototype,"items",{get:function(){return this.attributes.items.map(function(t,e){var n=t.name,n=void 0===n?"":n,r=t.value,i=t.color,i=void 0===i?"black":i,a=t.index,t=J(t,["name","value","color","index"]);return v({name:n,value:r,color:i,index:null!=a?a:e},t)})},enumerable:!1,configurable:!0}),Object.defineProperty(s5.prototype,"HTMLTooltipItemsElements",{get:function(){var r=this.attributes.template,i=[];return this.items.forEach(function(t){var e,n;i.push(n5((e=r.item,n=t,e&&n?e.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):e)))}),i},enumerable:!1,configurable:!0}),Object.defineProperty(s5.prototype,"customContent",{get:function(){var t=this.attributes.customContent;return hn(t)?U2(t):vn(t)?t:void 0},enumerable:!1,configurable:!0}),s5.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},s5.prototype.update=function(t){this.attr(Tn({},this.attributes,t)),this.render(this.attributes,this)},s5.prototype.clear=function(){this.element.innerHTML=""},s5.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),null!=(t=this.customContent)&&t.remove()},s5.prototype.show=function(){this.visibility="visible",this.element.style.visibility="visible"},s5.prototype.hide=function(){this.visibility="hidden",this.element.style.visibility="hidden"},s5.prototype.initShape=function(){var t=this.attributes.template;this.element=n5(t.container),this.id&&this.element.setAttribute("id",this.id)},s5.prototype.renderHTMLTooltipElement=function(){var e,r,t=this.attributes,n=t.title,t=t.enterable,i=this.element,a=this.customContent,a=(this.element.style.pointerEvents=t?"auto":"none",this.clear(),a?i.appendChild(a):(t=this.attributes.template,n?(i.innerHTML=t.title,i.getElementsByClassName(i5)[0].innerHTML=n):null!=(t=null==(a=i.getElementsByClassName(i5))?void 0:a[0])&&t.remove(),n=this.HTMLTooltipItemsElements,(e=document.createElement("ul")).className=a5,n.forEach(function(t){e.appendChild(t)}),this.element.appendChild(e)),this.attributes.style);r=i,Object.entries(a).forEach(function(t){var t=x(t,2),e=t[0],n=t[1];b([r],x(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})}),this.element.style.visibility=this.visibility},s5.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=x(l,2),n=e[0],e=e[1],t=x(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},s5.prototype.setOffsetPosition=function(t){var t=x(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat((void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(i+n+t,"px")},s5.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},s5.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=x(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.autoPosition,c=c.bounding;return f?(e=(f=this.element).offsetWidth,f=f.offsetHeight,h=(u=x([u+l,h+t],2))[0],u=u[1],n=this.attributes.position,r={left:"right",right:"left",top:"bottom",bottom:"top"},s=c.x,i=c.y,a={left:h<s,right:s+c.width<h+e,top:u<i,bottom:i+c.height<u+f},o=[],n.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},s5.tag="tooltip",s5.defaultOptions={style:{x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],follow:!0,enterable:!1,autoPosition:!0,items:[],container:{x:0,y:0},bounding:{x:0,y:0,width:0,height:0},template:{container:'<div class="'.concat(to,'"></div>'),title:'<div class="'.concat(i5,'"></div>'),item:'<li class="'.concat(ao,'" data-index={index}>\n <span class="').concat(n,'">\n <span class="').concat(Zl,'" style="background:{color}"></span>\n <span class="').concat(Jl,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(e,'" title="{value}">{value}</span>\n </li>')},style:no}},t([tx(100)],s5.prototype,"updatePosition",null),s5);function s5(t){t=r5.call(this,Tn({},s5.defaultOptions,t))||this;return t.visibility="visible",t.initShape(),t.render(t.attributes,t),t}var l5,c5={default:{sizeStyle:{width:44,height:22,radius:11},tagStyle:{textStyle:{fontSize:12,lineHeight:16,fill:"#fff"},padding:0},markerStyle:{size:11}},small:{sizeStyle:{width:28,height:16,radius:8},tagStyle:{textStyle:{fontSize:10,lineHeight:14,fill:"#fff"},padding:0},markerStyle:{size:8}},mini:{sizeStyle:{width:20,height:14,radius:7},tagStyle:{textStyle:{fontSize:7,lineHeight:10,fill:"#fff"},padding:0},markerStyle:{size:7}}};function u5(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!0);var r=Number(t.style.height)-2*e;return{x:n?Number(t.style.width)+Number(t.style.x)-e-r:Number(t.style.x)+e,y:Number(t.style.y)+e,width:r,height:r,radius:r/2}}function h5(t){return l5.call(this,Tn({},h5.defaultOptions,t))||this}Me(h5,l5=$l),h5.prototype.render=function(t,e){var i=this,n=t.size,n=void 0===n?"default":n,a=t.spacing,r=t.disabled,o=t.checked,s=t.unCheckedChildren,t=t.checkedChildren,e=A(e).maybeAppendByClassName("switch-content","g").node(),l=e.getLocalBounds(),n=Sn(c5,n,c5.default),c=n.sizeStyle,u=n.tagStyle,h=r?"no-drop":"pointer",n=o?"#1890FF":"#00000040",f=c,d=o?t:s,p=((t||s)&&A(e).maybeAppendByClassName("switch-tag",function(){return new Ax({})}).call(function(t){var e,t=t.node(),n=(t.update(Tn({cursor:h,backgroundStyle:null,text:!1,marker:!1},u,d)),null==t?void 0:t.getLocalBounds()),r=n.max,n=n.min,i=r[0]-n[0]+c.radius,r=r[1]-n[1],n=Math.max(i+c.height+2,c.width);f=v(v({},c),{width:n}),t.update((t={x:l.min[0],y:l.min[1],width:n,height:f.height},n={width:i,height:r},i=f.radius,r=o,e=n.width,n=n.height,void 0===i&&(i=0),{x:(r=void 0===o?!0:r)?Number(t.x)+i:Number(t.width)+Number(t.x)-e,y:Number(t.y)+(Number(t.height)-n)/2}))}),A(e).maybeAppendByClassName("switch-background","rect").styles(v({zIndex:(e.style.zIndex||0)-1,x:l.min[0],y:l.min[1],fill:n,cursor:h,fillOpacity:r?.4:1},f)).node()),g=A(e).maybeAppendByClassName("switch-background-stroke","rect").styles(v({zIndex:(e.style.zIndex||0)-2,x:l.min[0],y:l.min[1],stroke:n,lineWidth:0},f)).node();A(e).maybeAppendByClassName("switch-handle","rect").styles({fill:"#fff",cursor:h}).call(function(t){var e,t=t.node(),n=u5(p,a,o),r=u5(p,a,!o);t.attr("x")&&!Pn(n,r)&&i.checked!==o?(t.attr(r),null!=(e=t.getAnimations()[0])&&e.cancel(),null!=(e=g.getAnimations()[0])&&e.cancel(),t.animate([{x:r.x},{x:n.x}],{duration:120,fill:"both"}),g.animate([{lineWidth:0,strokeOpacity:.5},{lineWidth:14,strokeOpacity:0}],{duration:400,easing:"ease-on"})):t.attr(n)}),this.checked=!!o},h5.tag="switch",h5.defaultOptions={style:{x:0,y:0,spacing:2,checked:!0,disabled:!1}};var f5,d5,p5,g5,ro={tagText:"",lineStroke:"#416180",lineStrokeOpacity:.45,lineLineWidth:1,lineLineDash:[5,5]},oo=X2({},ro,{type:"line",tagPosition:"start",tagAlign:"center",tagVerticalAlign:"bottom"}),so=X2({},ro,{type:"circle",defaultRadius:0}),lo=X2({},ro,{type:"polygon",defaultRadius:0,startAngle:0}),co=(Me(y5,f5=$l),Object.defineProperty(y5.prototype,"localPointer",{get:function(){var t=x(this.getPosition(),2),e=t[0],t=t[1],n=x(this.pointer,2);return[n[0]-e,n[1]-t]},enumerable:!1,configurable:!0}),Object.defineProperty(y5.prototype,"tagCfg",{get:function(){var t=R2(this.attributes,"tag");return t.position,J(t,["position"])},enumerable:!1,configurable:!0}),Object.defineProperty(y5.prototype,"crosshairCfg",{get:function(){var t=R2(this.attributes,"line");return v(v({},t),{path:this.crosshairPath})},enumerable:!1,configurable:!0}),y5.prototype.render=function(t,e){var n=this,e=A(e).maybeAppendByClassName(".crosshair-group","g").node();this.shapesGroup=e,this.tagShape=A(e).maybeAppend(".crosshair-tag",function(){return new Ax({className:"crosshair-tag",style:n.tagCfg})}).node(),this.crosshairShape=A(e).maybeAppendByClassName(".crosshair-path","path").node().attr(this.crosshairCfg),this.adjustLayout()},y5.prototype.update=function(t){this.attr(Tn({},this.attributes,t=void 0===t?{}:t)),this.render(this.attributes,this)},y5.prototype.setPointer=function(t){this.pointer=t},y5.tag="crosshair-base",y5.defaultOptions={style:ro},y5);function y5(t){return f5.call(this,Tn({},y5.defaultOptions,t))||this}function m5(t){return d5.call(this,X2({},m5.defaultOptions,t))||this}function v5(t){return p5.call(this,X2({},v5.defaultOptions,t))||this}function b5(t){return g5.call(this,X2({},b5.defaultOptions,t))||this}Me(m5,d5=co),Object.defineProperty(m5.prototype,"crosshairPath",{get:function(){var t=this.attributes,e=x(t.startPos,2),n=e[0],e=e[1],t=x(t.endPos,2);return[["M",0,0],["L",t[0]-n,t[1]-e],["Z"]]},enumerable:!1,configurable:!0}),Object.defineProperty(m5.prototype,"localPointer",{get:function(){var t,e,n;return this.pointer?(t=(e=x(this.getPosition(),2))[0],e=e[1],[(n=x(this.pointer,2))[0]-t,n[1]-e]):this.attributes.startPos},enumerable:!1,configurable:!0}),Object.defineProperty(m5.prototype,"isVertical",{get:function(){var t=this.attributes,e=x(t.startPos,2),n=e[0],e=e[1],t=x(t.endPos,2),r=t[0],t=t[1];return n===r&&e!==t},enumerable:!1,configurable:!0}),Object.defineProperty(m5.prototype,"tagShapeSpace",{get:function(){var t=V2(this.tagShape);return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),m5.prototype.update=function(t){d5.prototype.update.call(this,t)},m5.prototype.setPointer=function(t){d5.prototype.setPointer.call(this,t),this.adjustPosition()},m5.prototype.setText=function(t){this.tagShape.update({text:t}),this.adjustTag()},m5.prototype.adjustLayout=function(){this.adjustPosition(),this.adjustTag()},m5.prototype.adjustPosition=function(){var t=x(this.localPointer,2),e=t[0],t=t[1],n=x(this.attributes.startPos,2),r=n[0],n=n[1],r=this.getOrientVal([r,t],[e,n]);this.shapesGroup.setLocalPosition(r)},m5.prototype.adjustTag=function(){var t,e=this.attributes,n=e.tagText,r=e.tagPosition,i=x(e.startPos,2),a=i[0],i=i[1],e=x(e.endPos,2),o=e[0],e=e[1];n&&""!==n?(this.tagShape.show(),t=(n=this.tagShapeSpace).width,n=n.height,a=(o=x(this.getOrientVal({start:[-t/2,n/2],end:[o-a+t/2,n/2]},{start:[0,0],end:[0,e-i+n]})[r],2))[0],t=o[1],this.tagShape.setLocalPosition(a,t)):this.tagShape.hide()},m5.prototype.getOrientVal=function(t,e){return this.isVertical?e:t},m5.tag="line-crosshair",m5.defaultOptions={style:oo},t([tx(20)],m5.prototype,"setPointer",null),Me(v5,p5=co),Object.defineProperty(v5.prototype,"crosshairPath",{get:function(){return this.createCirclePath()},enumerable:!1,configurable:!0}),v5.prototype.update=function(t){p5.prototype.update.call(this,t)},v5.prototype.setPointer=function(t){var t=x(t,2),e=t[0],t=t[1],e=(p5.prototype.setPointer.call(this,[e,t]),x(this.localPointer,2)),t=e[0],e=e[1],n=x(this.attributes.center,2),r=n[0],n=n[1],t=this.createCirclePath(Math.pow(Math.pow(t-r,2)+Math.pow(e-n,2),.5));this.crosshairShape.attr({path:t})},v5.prototype.adjustLayout=function(){this.tagShape.hide()},v5.prototype.createCirclePath=function(t){var e=this.attributes,n=x(e.center,2),r=n[0],n=n[1],e=e.defaultRadius;return xx(r,n,t||e)},v5.tag="circle-crosshair",v5.defaultOptions={style:so},t([tx(20)],v5.prototype,"setPointer",null),Me(b5,g5=co),Object.defineProperty(b5.prototype,"crosshairPath",{get:function(){return this.createPolygonPath()},enumerable:!1,configurable:!0}),b5.prototype.update=function(t){g5.prototype.update.call(this,t)},Object.defineProperty(b5.prototype,"points",{get:function(){for(var t,e,n,r,i,a,o=this.attributes,s=o.startAngle,l=o.sides,c=2*Math.PI/l,u=[1,0],h=[],f=0;f<l;f+=1)h.push((t=[0,0],e=u,n=[0,0],r=s/180*Math.PI+c*f,a=i=void 0,i=e[0]-n[0],e=e[1]-n[1],a=Math.sin(r),r=Math.cos(r),t[0]=i*r-e*a+n[0],t[1]=i*a+e*r+n[1],t));return h},enumerable:!1,configurable:!0}),b5.prototype.setPointer=function(t){var t=x(t,2),e=t[0],t=t[1],e=(g5.prototype.setPointer.call(this,[e,t]),x(this.localPointer,2)),t=e[0],e=e[1],n=this.attributes.center,r=x(this.intersection([t,e]),2),i=r[0],r=r[1];i&&r&&(t=Q2(n,[t,e])/Q2(n,[i,r]),e=this.createPolygonPath(t),this.crosshairShape.attr({path:e}))},b5.prototype.adjustLayout=function(){this.tagShape.hide()},b5.prototype.createPolygonPath=function(r){var t=this.attributes,i=t.defaultRadius,t=x(t.center,2),a=t[0],o=t[1],t=this.points.map(function(t,e){var t=x(t,2),t=x(ye([0,0],[t[0],t[1]],r||i),2),n=t[0],t=t[1];return[0===e?"M":"L",a+n,o+t]});return t.push(["Z"]),t},b5.prototype.intersection=function(t){for(var e,n,r,i,a,o,s,l,t=x(t,2),c=t[0],u=t[1],h=this.points,t=x(this.attributes.center,2),f=t[0],d=t[1],p=1;p<=h.length;p+=1){var g=x(h[p-1],2),y=g[0],g=g[1],m=x(h[p%h.length],2),v=m[0],m=m[1],y=(i=[f,d],y=[y+f,g+d],g=[v+f,m+d],l=s=o=a=m=v=void 0,m=(r=x(r=[c,u],2))[0],r=r[1],a=(i=x(i,2))[0],i=i[1],o=(y=x(y,2))[0],y=y[1],s=(g=x(g,2))[0],g=g[1],l=[],(g-y)*(a-m)==(i-r)*(s-o)?(i-r)*(o-m)==(y-r)*(a-m)&&(Z2(m,a,r,i,o,y)&&J2(l,o,y),Z2(m,a,r,i,s,g)&&J2(l,s,g),Z2(o,s,y,g,m,r)&&J2(l,m,r),Z2(o,s,y,g,a,i))&&J2(l,a,i):(v=(m*(i-r)+y*(a-m)-r*(a-m)-o*(i-r))/((s-o)*(i-r)-(a-m)*(g-y)),0<=(g=(o*(g-y)+r*(s-o)-y*(s-o)-m*(g-y))/((a-m)*(g-y)-(s-o)*(i-r)))&&g<=1&&0<=v&&v<=1&&(l[0]=m+g*(a-m),l[1]=r+g*(i-r))),l);0!==y.length&&(e=(s=x(y,2))[0],n=s[1])}return[e,n]},b5.tag="polygon-crosshair",b5.defaultOptions={style:lo},t([tx(20)],b5.prototype,"setPointer",null);Me(E5,x5=Fo),Object.defineProperty(E5.prototype,"decorationType",{get:function(){var t=this.attributes.type;return t&&"none"!==t&&rn(t)?t.map(function(t){return rn(t)?t:[t,"solid"]}):"none"},enumerable:!1,configurable:!0}),Object.defineProperty(E5.prototype,"doubleSpacing",{get:function(){return 2*this.attributes.style.lineWidth},enumerable:!1,configurable:!0}),Object.defineProperty(E5.prototype,"hangingRate",{get:function(){return this.attributes.hangingRate},enumerable:!1,configurable:!0}),Object.defineProperty(E5.prototype,"dashedCfg",{get:function(){var t=this.attributes.style.lineWidth;return{lineDash:[2*t,t]}},enumerable:!1,configurable:!0}),Object.defineProperty(E5.prototype,"dottedCfg",{get:function(){var t=this.attributes.style.lineWidth;return{lineDash:[t,t]}},enumerable:!1,configurable:!0}),Object.defineProperty(E5.prototype,"solidCfg",{get:function(){return{lineDash:[0,0]}},enumerable:!1,configurable:!0}),Object.defineProperty(E5.prototype,"decorationCfg",{get:function(){var r=this,i=this.attributes.style,t=this.decorationType;return"none"===t?[]:t.map(function(t){var e,t=x(t,2),n=t[0],t=t[1];return"wavy"===t?v({path:r.getWavyPath(n)},i):"double"===t?v({path:r.getDoubleLinePath(n)},i):(e={solid:r.solidCfg,dashed:r.dashedCfg,dotted:r.dottedCfg},v(v({path:r.getLinePath(n)},i),e[t]))})},enumerable:!1,configurable:!0}),E5.prototype.update=function(t){var e=this;this.attr(X2({},this.attributes,t)),this.clear(),this.decorationCfg.forEach(function(t){e.appendChild(new ts({style:t}))})},E5.prototype.clear=function(){this.removeChildren()},E5.prototype.getLinePos=function(t){var e=x(this.hangingRate,3),n=e[0],r=e[1],e=e[2],i=this.attributes,a=i.height,i=i.fontSize,o=x([0,0],2),s=o[0],o=o[1],o=("overline"===t?(s=(n=x([0,a*n-i/2],2))[0],n):"line-through"===t?(s=(n=x([0,a*r],2))[0],n):(s=(t=x([0,a*e+i/2],2))[0],t))[1];return[s,o]},E5.prototype.getLinePath=function(t){var e=this.attributes.width,t=x(this.getLinePos(t),2),n=t[0],t=t[1];return[["M",n,t],["L",n+e,t]]},E5.prototype.getDoubleLinePath=function(t){var e,n=this.doubleSpacing,r=this.attributes.width,i=x(this.getLinePos(t),2),a=i[0],i=i[1],o=x([0,0],2),s=o[0],o=o[1];return"line-through"===t&&(s=(e=x([-.5,.5],2))[0],o=e[1]),"underline"===t?(s=(e=x([0,1],2))[0],o=e[1]):"overline"===t&&(s=(e=x([1,0],2))[0],o=e[1]),[["M",a,i+n*s],["L",a+r,i+n*s],["M",a,i+n*o],["L",a+r,i+n*o]]},E5.prototype.getWavyPath=function(t){return[]},E5.tag="decoration",E5.defaultOptions={style:{width:0,height:0,type:"none",hangingRate:[.5,.55,.5],style:{lineWidth:1,stroke:"#000"}}};var x5,w5,k5=E5;function E5(t){t=x5.call(this,X2({},E5.defaultOptions,t))||this;return t.update({}),t}function M5(t){t=w5.call(this,X2({},M5.defaultOptions,t))||this;return t.init(),t}Me(M5,w5=$l),Object.defineProperty(M5.prototype,"textWidth",{get:function(){var e=this;return cn(this.renderText.split("\n").map(function(t){return S2(t,e.font)}))||0},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"textHeight",{get:function(){return V2(this.textShape).height},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"width",{get:function(){var t=this.attributes.width;return"auto"===t||void 0===t||0===t?this.textWidth:t},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"height",{get:function(){var t=this.attributes.height;return dn(t)&&0!==t?t:V2(this.textShape).height},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"lineHeight",{get:function(){var t=this.attributes,e=t.lineHeight,t=t.fontSize;return e&&0!==e?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"capitalizeWord",{get:function(){return this.attributes.text.split("\n").map(function(t){return t.split(" ").map(function(t){return A2(t,"capitalize")}).join(" ")}).join("\n")},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"text",{get:function(){var t=this.attributes,e=t.transform,t=t.text;return"capitalize"===e?this.capitalizeWord:A2(t,e)},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"ellipsisText",{get:function(){var e=this,t=this.text,n=this.attributes,r=n.width,n=n.overflow,i="ellipsis"===n?"...":n;return t.split("\n").map(function(t){return O2(t,dn(r)?r:1/0,e.font,i)}).join("\n")},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"renderText",{get:function(){var t=this.attributes.width,e=this.attributes.overflow;return e&&!["none","clip","wrap"].includes(e)&&dn(t)?this.ellipsisText:this.text},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"verticalAlign",{get:function(){return this.attributes.verticalAlign},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"font",{get:function(){return _n(this.attributes,["fontSize","fontFamily","fontWeight","fontStyle","fontVariant","letterSpacing","leading"])},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"fontColor",{get:function(){return this.attributes.fontColor},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"wordWrap",{get:function(){return"wrap"===this.attributes.overflow},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"wordWrapWidth",{get:function(){var t=this.width;return this.wordWrap?t:1/0},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"textCfg",{get:function(){var t=this.renderText,e=this.lineHeight,n=this.wordWrap,r=this.wordWrapWidth,i=this.fontColor;return v(v(v({},C2),this.font),{fill:i,wordWrap:n,lineHeight:e,wordWrapWidth:r,text:t,textAlign:"start",textBaseline:"middle"})},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"backgroundCfg",{get:function(){var t=this.width,e=this.height,n=this.attributes.backgroundStyle;return v({x:0,y:0,width:t,height:e},n)},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"decorationLineWidth",{get:function(){var t=this.attributes.fontSize;return Math.floor(2*Math.log10(t))},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"decorationCfg",{get:function(){var t=this.attributes,e=t.decoration,n=t.fontSize,r=this.decorationLineWidth,i=this.fontColor;return this.textShape.getLineBoundingRects().map(function(t){return X2({},{fontSize:n,style:{stroke:i,lineWidth:r}},e,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(M5.prototype,"clipRectCfg",{get:function(){var t=this.height;return{width:this.attributes.width,height:t}},enumerable:!1,configurable:!0}),M5.prototype.init=function(){this.initShape(),this.update({})},M5.prototype.update=function(t){this.attr(X2({},this.attributes,t)),this.render()},M5.prototype.render=function(){var e=this;this.clear(),this.backgroundShape.attr(this.backgroundCfg),this.textShape.attr(this.textCfg),this.layout(),this.decorationGroup.removeChildren(),this.decorationCfg.forEach(function(t){e.decorationGroup.appendChild(new k5({style:t}))})},M5.prototype.clear=function(){var t;(this.backgroundShape.style.clipPath=null)!=(t=this.clipRect)&&t.destroy()},M5.prototype.initShape=function(){this.backgroundShape=new os({name:"background",style:{width:0,height:0}}),this.decorationGroup=new qo({name:"decoration-group"}),this.textShape=new ls({name:"text",style:this.textCfg}),this.textShape.appendChild(this.decorationGroup),this.backgroundShape.appendChild(this.textShape),this.appendChild(this.backgroundShape)},M5.prototype.overflow=function(){var t=this.wordWrap,e=this.attributes,n=e.width,e=e.overflow;e&&"none"!==e&&!t&&dn(n)&&"clip"===e&&(this.clipRect=new os({name:"clip-rect",style:this.clipRectCfg}),this.backgroundShape.style.clipPath=this.clipRect,this.backgroundShape.appendChild(this.clipRect))},M5.prototype.adjustTextAlign=function(){var t=this.textWidth,e=this.attributes,n=e.width,e=e.textAlign;dn(n)&&(n=0,n="start"===e?0:"center"===e?(this.width-t)/2:this.width-t,this.textShape.attr({x:n}))},M5.prototype.adjustVerticalAlign=function(){var t=this.verticalAlign,e=this.textHeight,n=0,n="top"===t?e/2:"middle"===t?this.height/2:this.height-e/2;this.textShape.attr({y:n})},M5.prototype.layout=function(){this.adjustTextAlign(),this.adjustVerticalAlign(),this.overflow()},M5.tag="paragraph",M5.defaultOptions={style:{text:"",fontColor:"#000",fontFamily:"sans-serif",fontSize:12,fontWeight:"normal",fontVariant:"normal",letterSpacing:0,leading:0,fontStyle:"normal",decoration:{type:"none",style:{}},overflow:"none",backgroundStyle:{},transform:"none",tooltip:!1,tooltipWait:300}};var O5,uo=v(v({},C2),{fill:"rgba(0,0,0,0.45)",fontSize:10,textAlign:"start",textBaseline:"middle",overflow:"clip"}),S5={default:{width:12,height:12,radius:2,stroke:"#dadada",lineWidth:1,fill:"#ffffff",cursor:"pointer"},selected:{width:12,height:12,radius:2,stroke:"#3471F9",lineWidth:1,fill:"#3471F9",cursor:"pointer"}},_5={path:[["M",3,6],["L","5","8.5"],["L","8.5","4"]],lineWidth:1,cursor:"pointer"};function A5(t){return O5.call(this,Tn({},A5.defaultOptions,t))||this}Me(A5,O5=$l),A5.prototype.render=function(t,e){var n=t.label,r=t.boxStyle,i=t.checkedStyle,a=t.checked,t=t.spacing,a=(this.checked=!!a,Y2(e,".checkbox-content","g").attr("className","checkbox-content").node()),e=xn({},this.checked?S5.selected:S5.default,r),r=xn({},_5,i),t=(this.checkboxBoxShape=Y2(a,".checkbox-box","rect").styles(v({className:"checkbox-box",zIndex:(a.style.zIndex||0)-1},e)).node(),Y2(this.checkboxBoxShape,".checkbox-checked","path").styles(v({className:"checkbox-box-checked",stroke:"#fff"},r)),i=this.checkboxBoxShape,e=Number(t),{x:(r=i.getLocalBounds()).halfExtents[0]?r.max[0]+(e||0):i.style.x,y:r.halfExtents[1]?(r.min[1]+r.max[1])/2:i.style.y}),e=t.x,r=t.y;Y2(a,".checkbox-label","text").styles(v({className:"checkbox-label",x:e,y:r},n))},A5.tag="checkbox",A5.defaultOptions={style:{x:0,y:0,label:v({text:""},uo),spacing:4,checked:!1}};var T5="gui-poptip",P5="gui-poptip-arrow",L5="gui-poptip-text",C5=((a={})[".".concat(T5)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},a[".".concat(L5)]={"text-align":"center"},a[".".concat(T5,"[data-position='top']")]={transform:"translate(-50%, -100%)"},a[".".concat(T5,"[data-position='left']")]={transform:"translate(-100%, -50%)"},a[".".concat(T5,"[data-position='right']")]={transform:"translate(0, -50%)"},a[".".concat(T5,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},a[".".concat(T5,"[data-position='top-left']")]={transform:"translate(0,-100%)"},a[".".concat(T5,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},a[".".concat(T5,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},a[".".concat(T5,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},a[".".concat(T5,"[data-position='right-top']")]={transform:"translate(0, 0)"},a[".".concat(T5,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},a[".".concat(T5,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},a[".".concat(T5,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},a[".".concat(P5)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},a[".".concat(T5,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},a["[data-position='top'] .".concat(P5)]={bottom:"-2px"},a[".".concat(T5,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},a["[data-position='left'] .".concat(P5)]={right:"-2px"},a[".".concat(T5,"[data-position='right']")]={transform:"translate(5px, -50%)"},a["[data-position='right'] .".concat(P5)]={left:"-2px"},a[".".concat(T5,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},a["[data-position='bottom'] .".concat(P5)]={top:"-2px"},a[".".concat(T5,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},a["[data-position='top-left'] .".concat(P5)]={left:"10px",bottom:"-2px"},a[".".concat(T5,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},a["[data-position='top-right'] .".concat(P5)]={right:"10px",bottom:"-2px"},a[".".concat(T5,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},a["[data-position='left-top'] .".concat(P5)]={right:"-2px",top:"8px"},a[".".concat(T5,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},a["[data-position='left-bottom'] .".concat(P5)]={right:"-2px",bottom:"8px"},a[".".concat(T5,"[data-position='right-top']")]={transform:"translate(5px, 0)"},a["[data-position='right-top'] .".concat(P5)]={left:"-2px",top:"8px"},a[".".concat(T5,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},a["[data-position='right-bottom'] .".concat(P5)]={left:"-2px",bottom:"8px"},a[".".concat(T5,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},a["[data-position='bottom-left'] .".concat(P5)]={top:"-2px",left:"8px"},a[".".concat(T5,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},a["[data-position='bottom-right'] .".concat(P5)]={top:"-2px",right:"8px"},a),N5=void 0;var j5;function R5(t){var e=t&&document.getElementById(t);return e||((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),e}function F5(t){var n,r;return n=R5,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r=r||n.apply(N5,t)}(t)}function I5(t){t=j5.call(this,Tn({style:{id:"gui-poptip"}},I5.defaultOptions,t))||this;return t.visibility="visible",t.map=new Map,t.domStyles="",t.initShape(),t.render(t.attributes,t),t}Me(I5,j5=$l),Object.defineProperty(I5.prototype,"visible",{get:function(){return"visible"===this.visibility},enumerable:!1,configurable:!0}),I5.prototype.render=function(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()},I5.prototype.update=function(t){this.attr(Tn({},this.style,t)),this.render(this.attributes,this)},I5.prototype.bind=function(s,l){var c,t,e,u=this;s&&(c=this.style.text,e=function(){u.hideTip()},s.addEventListener("mousemove",t=function(t){var e=s,n=u.style,r=c,i=(l&&(o=(i="function"==typeof l?l.call(null,t):l).html,a=i.target,i=J(i,["html","target"]),n=xn({},u.style,i),!a&&!1!==a||(e=a),"string"==typeof o)&&(r=o),n.position),a=n.arrowPointAtCenter,o=n.follow,n=n.offset;e?(e=(t=x(function(t,e,n,r,i,a){if(void 0===i&&(i=!1),a=void 0===a?!1:a)return[t,e];var o=(a=n.getBoundingClientRect()).x,s=a.y,l=a.width,c=a.height;switch(r){case"top":return i?[o+l/2,s]:[t,s];case"left":return i?[o,s+c/2]:[o,e];case"bottom":return i?[o+l/2,s+c]:[t,s+c];case"right":return i?[o+l,s+c/2]:[o+l,e];case"top-right":case"right-top":return[o+l,s];case"left-bottom":case"bottom-left":return[o,s+c];case"right-bottom":case"bottom-right":return[o+l,s+c];default:return[o,s]}}(t.clientX,t.clientY,e,i,a,o),2))[0],a=t[1],u.showTip(e,a,{text:r,position:i,offset:n})):u.hideTip()}),s.addEventListener("mouseleave",e),this.map.set(s,[t,e]))},I5.prototype.unbind=function(t){var e,n;this.map.has(t)&&(e=(n=x(this.map.get(t)||[],2))[0],n=n[1],e&&t.removeEventListener("mousemove",e),n&&t.removeEventListener("mouseleave",n),this.map.delete(t))},I5.prototype.clear=function(){this.container.innerHTML=""},I5.prototype.destroy=function(){var t,e=this;b([],x(this.map.keys()),!1).forEach(function(t){return e.unbind(t)}),null!=(t=this.container)&&t.remove()},I5.prototype.showTip=function(t,e,n){var r,i=Sn(n,"text");i&&"string"!=typeof i||(this.applyStyles(),t&&e&&n&&(r=n.offset,(n=n.position)&&this.container.setAttribute("data-position",n),this.setOffsetPosition(t,e,r),"string"==typeof i&&(n=this.container.querySelector(".".concat(L5)))&&(n.innerHTML=i),this.visibility="visible",this.container.style.visibility="visible"))},I5.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},I5.prototype.getContainer=function(){return this.container},I5.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(T5).concat(t?" ".concat(t):"")},I5.prototype.initShape=function(){var t=this,e=this.style.id;this.container=F5(e),this.container.setAttribute("class",this.getClassName()),this.container.addEventListener("mousemove",function(){return t.showTip()}),this.container.addEventListener("mouseleave",function(){return t.hideTip()})},I5.prototype.updatePoptipElement=function(){var t=this.container,e=(this.clear(),this.style),n=e.id,r=e.template,e=e.text,n=(this.container.setAttribute("id",n),this.container.setAttribute("class",this.getClassName()),'<span class="'.concat(P5,'"></span>'));t.innerHTML=n,hn(r)?t.innerHTML+=r:r&&vn(r)&&t.appendChild(r),e&&(t.getElementsByClassName(L5)[0].textContent=e),this.applyStyles(),this.container.style.visibility=this.visibility},I5.prototype.applyStyles=function(){var t,e=X2({},C5,this.style.domStyles),e=Object.entries(e).reduce(function(t,e){var e=x(e,2),n=e[0],e=e[1],e=Object.entries(e).reduce(function(t,e){var e=x(e,2),n=e[0],e=e[1];return"".concat(t).concat(n,": ").concat(e,";")},"");return"".concat(t).concat(n,"{").concat(e,"}")},"");this.domStyles!==e&&(this.domStyles=e,(t=this.container.querySelector("style"))&&this.container.removeChild(t),(t=document.createElement("style")).innerHTML=e,this.container.appendChild(t))},I5.prototype.setOffsetPosition=function(t,e,n){var n=x(n=void 0===n?this.style.offset:n,2),r=n[0],n=n[1],n=void 0===n?0:n;this.container.style.left="".concat(t+(void 0===r?0:r),"px"),this.container.style.top="".concat(e+n,"px")},I5.tag="poptip",I5.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:C5,template:'<div class="'.concat(L5,'"></div>')}};function B5(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0<t&&(i=t),n<0&&(i=n),0<e&&(a=e),r<0&&(a=r),[i,a]}(r);if(t===a&&i===o)return eb()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[0,0]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=Mb(l,t),t=Mb(t,i),i=Mb(i,l),0<(Math.pow(e,2)+Math.pow(t,2)-Math.pow(i,2))/(2*e*t)&&(a=(()=>{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]<c[0]?Math.min(e[0],n):Math.max(t[0],n)})(),s.splice(1,1,[a,0])),eb()(s)}const D5=Hb(t=>{var e=t.attributes,{x:n,y:r,x0:i=n,y0:a=r,background:o,connector:s,startMarker:l,endMarker:c,coordCenter:u}=e,e=J(e,["class","transform","rotate","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]),h=Q(e,"background"),f=h["padding"],h=J(h,["padding"]),d=Q(e,"connector"),{points:p=[]}=d,d=J(d,["points"]),i=[[+i,+a],[+n,+r]],a=tt(t).maybeAppend("text","text").call(F,e).node(),n=B5(tt(t).maybeAppend("background","rect").style("zIndex",-1).call(F,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(a,f)).call(F,o?h:{}).node(),i,p,u),r=l&&new Ox({id:"startMarker",style:Object.assign({x:0,y:0},Q(e,"startMarker"))}),a=c&&new Ox({id:"endMarker",style:Object.assign({x:0,y:0},Q(e,"endMarker"))});tt(t).maybeAppend("connector","path").style("path",n).style("markerStart",r).style("markerEnd",a).call(F,s?d:{})}),z5=t=>{const l=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=J(Fb(r,i,a,o),[]),{color:i,text:a="",fontSize:o,rotate:e=0,transform:s=""}=e,a={text:String(a),stroke:i,fill:i,fontSize:o},[[i,o]]=t;return tt(new D5).style("x",i).style("y",o).call(F,r).style("transform",s+`rotate(${+e}deg)`).style("coordCenter",n.getCenter()).call(F,a).call(F,l).node()}};z5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const G5=Hb(t=>{var e=J(t.attributes,["class","x","y"]);const n=Q(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(tt(t).maybeAppend("marker",()=>new Ox({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());tt(t).maybeAppend("text","text").style("x",i).style("y",a).call(F,e)}),W5=t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o,text:r=""}=e,e={text:String(r),stroke:o||i,fill:o||i},[[r,o]]=t;return tt(new G5).call(F,a).style("x",r).style("y",o).call(F,e).call(F,s).node()}},Y5=(W5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},Hb(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;tt(t).maybeAppend("connect-path",()=>new ts({})).style("d",n).call(F,i),tt(t).maybeAppend("area-path",()=>new ts({})).style("d",e).call(F,r)}));const V5=t=>{const{curve:u,gradient:l=!1,defined:h=t=>!Number.isNaN(t)&&null!=t,connectNulls:f=!1}=t,d=J(t,["curve","gradient","defined","connectNulls"]);return(t,e,c,n)=>{var{mark:r,shape:i,defaultShape:a}=e,n=Fb(n,r,i,a),r=n["defaultColor"],i=J(n,["defaultColor"]),{color:a=r,seriesColor:n,seriesX:r,seriesY:o}=e,e=Bb(c,e),n=l&&n?Nb(n,r,o,l):a;const s=Object.assign(Object.assign(Object.assign(Object.assign({},i),{stroke:n,fill:n}),e&&{transform:e}),d);var[r,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t<l;t++){var c,u,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,h),a=Q(s,"connect"),i=!!o.length,n=t=>tt(new ts({})).style("d",t).call(F,s).node();return a0(c)?(e=t=>{const n=c.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=nb().curve(rb),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return ob(a())},delete t.lineX0,t.lineEndAngle=function(){return ob(o())},delete t.lineX1,t.lineInnerRadius=function(){return ob(s())},delete t.lineY0,t.lineOuterRadius=function(){return ob(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(ab(t)):e()._curve},t.angle((t,e)=>Sb(Eb(r[e],n))).outerRadius((t,e)=>Mb(r[e],n)).innerRadius((t,e)=>Mb(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(h)).curve(u)(i);var e,a,o,s,l},!i||f&&!Object.keys(a).length?n(e(r)):i&&!f?n(e(t)):tt(new Y5).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(i0(c)?nb().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(h)):nb().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(h))).curve(u)(n)},!i||f&&!Object.keys(a).length?n(e(r)):i&&!f?n(e(t)):tt(new Y5).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},H5=(V5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=a0(n)?mb:Jv;return V5(Object.assign({curve:i},a))(t,e,n,r)}),q5=(H5.props=Object.assign({},V5.props),t=>{const{alpha:a=.5}=t,o=J(t,["alpha"]);return(t,e,n,r)=>{var i=a0(n)?gb:db;return V5(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),U5=(q5.props=Object.assign({},V5.props),i=>(t,e,n,r)=>V5(Object.assign({curve:bb},i))(t,e,n,r)),X5=(U5.props=Object.assign({},V5.props),t=>{const l=t["arrowSize"],c=J(t,["arrowSize"]);return(t,e,n,r)=>{var i,{mark:a,shape:o,defaultShape:s}=e,r=Fb(r,a,o,s),a=r["defaultColor"],o=J(r,["defaultColor"]),{color:s=a,transform:r}=e,[e,a]=t,t=Gv();return t.moveTo(...e),t.lineTo(...a),l&&([e,i]=Lb(e,a,{arrowSize:l}),t.moveTo(...a),t.lineTo(...e),t.moveTo(...a),t.lineTo(...i)),tt(new ts).call(F,o).style("d",t.toString()).style("stroke",s).style("transform",r).call(F,c).node()}}),$5=(X5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=Gv();return t.moveTo(e[0],e[1]),t.bezierCurveTo(e[0]/2+i[0]/2,e[1],e[0]/2+i[0]/2,i[1],i[0],i[1]),tt(new ts).call(F,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(F,s).node()}});$5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const K5=t=>{const{cornerRatio:u=1/3}=t,h=J(t,["cornerRatio"]);return(t,e,n,r)=>{var i,a,{mark:o,shape:s,defaultShape:l}=e,r=Fb(r,o,s,l),o=r["defaultColor"],s=J(r,["defaultColor"]),{color:l=o,transform:r}=e,[e,o]=t,c=(t=e,e=o,o=n,n=u,a=Gv(),a0(o)?(i=Mb(t,c=o.getCenter()),i=(Mb(e,c)-i)*n+i,a.moveTo(t[0],t[1]),Cb(a,t,e,c,i)):i0(o)?(a.moveTo(t[0],t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,e[1])):(a.moveTo(t[0],t[1]),a.lineTo(t[0],t[1]+(e[1]-t[1])*n),a.lineTo(e[0],t[1]+(e[1]-t[1])*n)),a.lineTo(e[0],e[1]),a);return tt(new ts).call(F,s).style("d",c.toString()).style("stroke",l).style("transform",r).call(F,h).node()}},Z5=(K5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=Gv();return t.moveTo(e[0],e[1]),a0(n)?(n=n.getCenter(),t.quadraticCurveTo(n[0],n[1],i[0],i[1])):Cb(t,e,i,Ab(e,i),Mb(e,i)/2),tt(new ts).call(F,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(F,s).node()}}),J5=(Z5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const u=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o=i,src:r="",size:e=32,transform:i=""}=e,{width:s=e,height:l=e}=u,[[t,c]]=t,t=t-Number(s)/2,s=c-Number(l)/2;return tt(new Ko).call(F,a).style("x",t).style("y",s).style("width",e).style("height",e).style("img",r).style("stroke",o).style("transform",i).call(F,u).node()}});J5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Q5=t=>{const l=J(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=Fb(r,e,i,a),e=r["defaultColor"],i=J(r,["defaultColor"]),a=function(i,t){const a=Gv();if(a0(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>Mb(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?Cb(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,n);return tt(new ts).call(F,i).style("d",a.toString()).style("stroke",o||e).style("fill",o||e).style("transform",s).call(F,l).node()}};Q5.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tE=t=>{const l=J(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=Fb(r,e,i,a),e=r["defaultColor"],i=J(r,["defaultColor"]),a=function(t,e){var n,[t,r,i,a]=t,o=Gv();return a0(e)?(n=Mb(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),Cb(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),Cb(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(t[0],t[1]),o.closePath()),o}(t,n);return tt(new ts).call(F,i).style("d",a.toString()).style("fill",o||e).style("stroke",o||e).style("transform",s).call(F,l).node()}};tE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eE=t=>{const y=J(t,[]);return(t,e,n,r)=>{var i,a,o,s,l,c,u,{mark:e,shape:h,defaultShape:f,color:d,transform:p}=e,r=Fb(r,e,h,f),{defaultColor:e,fill:h=e,stroke:f=e}=r,e=J(r,["defaultColor","fill","stroke"]),g=(r=t,t=n,n=Gv(),a0(t)?([i,a]=t=t.getCenter(),o=Ob(Eb(r[0],t)),s=Ob(Eb(r[1],t)),g=Mb(t,r[2]),l=Mb(t,r[3]),c=Mb(t,r[8]),u=Mb(t,r[10]),t=Mb(t,r[11]),n.moveTo(...r[0]),n.arc(i,a,g,o,s),n.arc(i,a,g,s,o,!0),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.arc(i,a,l,o,s),n.lineTo(...r[6]),n.arc(i,a,u,s,o,!0),n.closePath(),n.moveTo(...r[8]),n.arc(i,a,c,o,s),n.arc(i,a,c,s,o,!0),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.arc(i,a,t,o,s),n.arc(i,a,t,s,o,!0)):(n.moveTo(...r[0]),n.lineTo(...r[1]),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.lineTo(...r[5]),n.lineTo(...r[6]),n.lineTo(...r[7]),n.closePath(),n.moveTo(...r[8]),n.lineTo(...r[9]),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.lineTo(...r[13])),n);return tt(new ts).call(F,e).style("d",g.toString()).style("stroke",f).style("fill",d||h).style("transform",p).call(F,y).node()}};eE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nE=t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=J(r,["defaultColor","lineWidth"]),{color:r=i,size:i=a}=e,t=(a=t,a0(t=n)?(t=t.getCenter(),$v()({startAngle:0,endAngle:2*Math.PI,outerRadius:Mb(a[0],t),innerRadius:Mb(a[1],t)})):eb().x(t=>t[0]).y(t=>t[1])(a)),a=(a=n,n=e.transform,a0(a)?([a,e]=a.getCenter(),`translate(${a}, ${e}) `+(n||"")):n);return tt(new ts({})).call(F,o).style("d",t).style("stroke",r).style("lineWidth",i).style("transform",a).call(F,s).node()}};function rE(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}nE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iE=Hb(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=J(e,["points","class","endMarker","direction"]),i=Q(e,"endMarker"),n=(n=n,eb().x(t=>t[0]).y(t=>t[1])(n));tt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new Ox({className:"marker",style:Object.assign(Object.assign({},i),{symbol:rE})}):null).call(F,e)});const aE=t=>{const{offset:s=0,connectLength1:l}=t,c=J(t,["offset","connectLength1"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Fb(r,i,a,o),{defaultColor:i,connectLength1:a=l}=r,o=J(r,["defaultColor","connectLength1"]),{color:r,transform:e}=e,n=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(i0(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(n,t,s,a);return tt(new iE).call(F,o).style("points",n).style("stroke",r||i).style("transform",e).call(F,c).node()}};function oE(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=Q0(a.x,c),i=Q0(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function sE(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:h}=Rb(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=cE(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?lE(s,f,n):Ab(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function lE(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function cE(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function uE(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Rb(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:cE(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=lE(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function hE(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function fE(t,e,n,r){var i=n["bounds"];return 1===i.length?hE(0,0,n):(o0(r)?sE:u0(r)?uE:oE)(t,e,n,r)}function dE(t,e,n){var{innerRadius:n,outerRadius:t}=Rb(n,t,[e.y,e.y1]);return n+(t-n)}function pE(t,e,n){var{startAngle:n,endAngle:t}=Rb(n,t,[e.y,e.y1]);return(n+t)/2}function gE(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,h=r.getCenter(),f=pE(e,n,r),d=0<Math.sin(f)?1:-1,i=cE(f,i,a),a={textAlign:0<d||o0(r)?"start":"end",textBaseline:"middle",rotate:i},i=dE(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=lE(t,e,n),[t,r]=lE(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}aE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var yE=Object.freeze({__proto__:null,area:function(t,e,n,r){var i=e.length/2;const a=e.slice(0,i),o=e.slice(i);var e=$p(a,(t,e)=>Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=Ob(Eb(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l}deg)`,textAlign:"center",textBaseline:"middle"}},bottom:fE,bottomLeft:fE,bottomRight:fE,inside:fE,left:fE,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?hE(0,0,n):(o0(r)?sE:u0(r)?gE:oE)(t,e,n,r)},right:fE,spider:function(t,e,n,r){var i,a,o,s,l,c;return u0(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=J(gE(0,e,n,r),[]),s=r.getCenter(),l=dE(e,n,r),e=pE(e,n,r),n=l+c+i,r=0<Math.sin(e)?1:-1,l=o["x"],c=s[0]+(n+ +a)*r-l,o.x+=c,o.connectorPoints[0][0]-=c,o):{}},surround:function(t,e,n,r){var i,a,o,s,l;return u0(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=J(gE(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(u0(t)){var[e,n]=t.getSize(),t=t.getOptions().transformations.find(t=>"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=Sb([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=lE(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:fE,topLeft:fE,topRight:fE});function mE(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:u0(o)?"inside":i0(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=yE[a.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const vE=o=>(t,e,n,r)=>{var i=e["text"],a=J(e,["text","x","y"]),t=mE(t,e,n,r,o),{rotate:e=0,transform:r=""}=t,t=J(t,["rotate","transform"]);return tt(new D5).call(F,t).style("text",""+i).style("transform",r+`rotate(${+e}deg)`).style("coordCenter",n.getCenter()).call(F,a).node()},bE=(vE.props={},t=>{const s=t["colorAttribute"],l=J(t,["arrow","colorAttribute"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=J(Fb(r,i,a,o),["stroke"]),{d:i,color:a}=e;return tt(new ts).call(F,r).style("d",i).style(s,a).call(F,l).node()}}),xE=(bE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>bE(Object.assign({colorAttribute:"fill"},t))),wE=(xE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>bE(Object.assign({fill:"none",colorAttribute:"stroke"},t))),kE=(wE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const a=t["render"],o=J(t,["render"]);return(t,e,n,r)=>{var[[t,i]]=t;return a(Object.assign(Object.assign({},o),{x:t,y:i}))}}),EE=(kE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),ME=t=>{var e="#5B8FF9",e={defaultColor:e,defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:EE.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:EE.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:EE.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:EE.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:EE.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:EE.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:EE.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:EE.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:EE.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:EE.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:EE.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:EE.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{titleFill:EE.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,lineStroke:EE.BLACK,lineStrokeOpacity:.45,lineLineWidth:.5,lineArrow:null,tickStroke:EE.BLACK,tickStrokeOpacity:.25,tickLineWidth:1,tickLength:4,labelFill:EE.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,labelAlign:"horizontal",gridStroke:EE.BLACK,gridStrokeOpacity:.05,gridLineWidth:.5,gridLineDash:[0,0],titleTransformOrigin:"center"},axisTop:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:8,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisBottom:{titleSpacing:10,titleTextBaseline:"bottom",labelSpacing:12,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisLeft:{titleTextBaseline:"middle",titleSpacing:10,titlePosition:"left",titleTransformOrigin:"center",titleTransform:"translate(50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"positive",labelAutoRotate:!1,tickDirection:"positive",gridDirection:"negative"},axisRight:{titleTextBaseline:"top",titleSpacing:0,titlePosition:"right",titleTransformOrigin:"center",titleTransform:"translate(-50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisArcY:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"bottom",gridDirection:"negative",gridConnect:"arc",gridControlAngles:[90,180,360],gridType:"surround",girdClosed:!0},legend:{padding:8,showTitle:!1,titleFill:EE.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,itemMarkerFill:e,itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemLabelFill:EE.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemValueFill:EE.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",itemBackgroundFill:"transparent",navButtonFill:EE.BLACK,navButtonFillOpacity:.65,navPageNumFill:EE.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,backgroundFill:"transparent"},continuousLegend:{labelFill:EE.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal",handleWidth:10,handleHeight:12,handleMarkerFill:EE.BLACK,handleMarkerFillOpacity:.6,handleMarkerStroke:EE.BLACK,handleMarkerStrokeOpacity:.25,handleMarkerLineWidth:1,handleLabelFill:EE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},label:{fill:EE.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:null,offset:12,connectorStroke:EE.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:EE.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:null,offset:0},slider:{trackSize:16,backgroundFill:EE.STROKE,backgroundFillOpacity:1,selectionFill:e,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:EE.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:EE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,trackStroke:"none",thumbFill:"#000",thumbFillOpacity:.15,thumbStroke:"none",thumbHighlightedFillOpacity:.2},title:{titleFill:EE.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:EE.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},u=(ME.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),OE=t=>{var e="#5B8FF9",e={defaultColor:e,defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:u.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:u.BLACK,lineWidth:1}},text:{text:{fill:u.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:u.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:u.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:u.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:u.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:u.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:u.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:u.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{titleFill:u.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,lineStroke:u.BLACK,lineStrokeOpacity:.45,lineLineWidth:.5,lineArrow:null,tickStroke:u.BLACK,tickStrokeOpacity:.25,tickLineWidth:1,tickLength:4,labelFill:u.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,labelAlign:"horizontal",gridStroke:u.BLACK,gridStrokeOpacity:.05,gridLineWidth:.5,gridLineDash:[0,0],titleTransformOrigin:"center"},axisTop:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:8,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisBottom:{titleSpacing:10,titleTextBaseline:"bottom",labelSpacing:12,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisLeft:{titleTextBaseline:"middle",titleSpacing:10,titlePosition:"left",titleTransformOrigin:"center",titleTransform:"translate(50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"positive",labelAutoRotate:!1,tickDirection:"positive",gridDirection:"negative"},axisRight:{titleTextBaseline:"top",titleSpacing:0,titlePosition:"right",titleTransformOrigin:"center",titleTransform:"translate(-50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisArcY:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"bottom",gridDirection:"negative",gridConnect:"arc",gridControlAngles:[90,180,360],gridType:"surround",girdClosed:!0},legend:{padding:8,showTitle:!1,titleFill:u.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,itemMarkerFill:e,itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemLabelFill:u.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemValueFill:u.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",itemBackgroundFill:"transparent",navButtonFill:u.BLACK,navButtonFillOpacity:.45,navPageNumFill:u.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,backgroundFill:"transparent"},continuousLegend:{labelFill:u.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal",handleWidth:10,handleHeight:12,handleMarkerFill:u.BLACK,handleMarkerFillOpacity:.6,handleMarkerStroke:u.BLACK,handleMarkerStrokeOpacity:.25,handleMarkerLineWidth:1,handleLabelFill:u.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},label:{fill:u.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:null,offset:12,connectorStroke:u.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:u.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:null,offset:0},slider:{trackSize:16,backgroundFill:u.STROKE,backgroundFillOpacity:1,selectionFill:e,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:u.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:u.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:u.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:u.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},SE=(OE.props={},OE.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),_E=t=>{var e="#4e79a7",e={defaultColor:e,defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:SE.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0,connectFill:SE.BLACK,connectFillOpacity:.1}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:SE.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:SE.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:SE.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:SE.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:SE.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:SE.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:SE.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:SE.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:SE.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:SE.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{titleFill:SE.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,line:!0,lineStroke:"#888",lineStrokeOpacity:1,lineLineWidth:1,lineArrow:null,tickStroke:SE.STROKE,tickStrokeOpacity:1,tickLineWidth:1,tickLength:5,labelFill:SE.BLACK,labelFillOpacity:1,labelFontSize:10,labelAutoRotate:!1,labelFontWeight:"normal",labelSpacing:4,labelAlign:"horizontal",gridStroke:"#ddd",gridStrokeOpacity:1,gridLineWidth:1,gridLineDash:[0,0],titleTransformOrigin:"center"},axisTop:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisBottom:{titleSpacing:4,titleTextBaseline:"bottom",labelSpacing:8,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisLeft:{titleTextBaseline:"middle",titleSpacing:4,titlePosition:"left",titleTransformOrigin:"center",titleTransform:"translate(50%, 0) rotate(-90) translate(0, -50%)",labelSpacing:4,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisRight:{titleTextBaseline:"top",titleSpacing:0,titlePosition:"right",titleTransformOrigin:"center",titleTransform:"translate(-50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisArcY:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"bottom",gridDirection:"negative",gridConnect:"arc",gridControlAngles:[90,180,360],gridType:"surround",girdClosed:!0},legend:{padding:8,showTitle:!1,titleFill:SE.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,itemMarkerFill:e,itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemLabelFill:SE.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemValueFill:SE.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",itemBackgroundFill:"transparent",navButtonFill:SE.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:SE.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,backgroundFill:"transparent"},continuousLegend:{showTitle:!1,labelFill:SE.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",handleWidth:10,handleHeight:12,handleMarkerFill:SE.BLACK,handleMarkerFillOpacity:.6,handleMarkerStroke:SE.BLACK,handleMarkerStrokeOpacity:.25,handleMarkerLineWidth:1,handleLabelFill:SE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},label:{fill:SE.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:null,offset:12,connectorStroke:SE.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:SE.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:null,offset:0},slider:{trackSize:16,backgroundFill:SE.STROKE,backgroundFillOpacity:.05,selectionFill:e,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:SE.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:SE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:SE.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:SE.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function AE(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}_E.props={};var TE,PE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function LE(t){var e;if(e=PE.exec(t))return new CE({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});throw new Error("invalid format: "+t)}function CE(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function NE(t,e){var n,e=AE(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}LE.prototype=CE.prototype,CE.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var jE={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>NE(100*t,e),r:NE,s:function(t,e){var n,r,i=AE(t,e);return i?(n=i[0],(i=(i=i[1])-(TE=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+AE(t,Math.max(0,e+i-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function RE(t){return t}var FE,IE,BE=Array.prototype.map,DE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zE(t){var e,s,l,k=void 0===t.grouping||void 0===t.thousands?RE:(s=BE.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0<n&&0<a&&(e<o+a+1&&(a=Math.max(1,e-o)),r.push(t.substring(n-=a,n+a)),!((o+=a+1)>e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",E=void 0===t.decimal?".":t.decimal+"",M=void 0===t.numerals?RE:(e=BE.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",O=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=LE(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,y=t.trim,m=t.type,v=("n"===m?(p=!0,m="g"):jE[m]||(void 0===g&&(g=12),y=!0,m="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),b="$"===e?i:/[%p]/.test(m)?a:"",x=jE[m],w=/[defgprs%]/.test(m);function n(t){var e,n,r,i=v,a=b;if("c"===m)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S:x(Math.abs(t),g),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;0<i&&(i=0)}return 0<i?t.slice(0,i)+t.slice(e+1):t}(t)),i=((o=o&&0==+t&&"+"!==h?!1:o)?"("===h?h:O:"-"===h||"("===h?"":h)+i,a=("s"===m?DE[8+TE/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?E+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!f&&(t=k(t,1/0));var s=i.length+t.length+a.length,l=s<d?new Array(d-s+1).join(c):"";switch(p&&f&&(t=k(l+t,l.length?d-a.length:1/0),l=""),u){case"<":t=i+t+a+l;break;case"=":t=i+l+t+a;break;case"^":t=l.slice(0,s=l.length>>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return M(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=LE(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=AE(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=DE[8+e/3];return function(t){return n(r*t)+i}}}}function GE(t,e,n){return t.querySelector(e)?tt(t).select(e):tt(t).append(n)}function WE(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function YE(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function VE(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=Ap(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=(null==(l=a.getFormatter)?void 0:l.call(a))||n,h=function(t,e){var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new Im({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),f=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return c0(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new Im({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new Im({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return a0(s)||i0(s)?(i=c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=h(a.map(t)+i);return{value:i0(s)&&null!=(r=a.getTicks)&&r.call(a)?1-i:i,label:u(t,e,n),id:String(e)}}),o0(s)&&"arcY"===o?i.map(t=>{var e=t["value"],t=J(t,["value"]);return Object.assign({value:1-e},t)}):i):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0;return{value:f(h(a.map(t)+r)),label:""+u("number"!=typeof(r=t)||Math.abs(r)<1e-15?r:parseFloat(r.toFixed(15)),e,n),id:String(e)}})}function HE(t,e,n){var r;return!(a0(r=e)&&i0(r)||l0(e))&&(void 0===t?!!n.getTicks:t)}ho=zE({thousands:",",grouping:[3],currency:["$",""]}),FE=ho.format,ho.formatPrefix;const qE=t=>{const{position:c,labelFormatter:u=t=>""+t,tickFilter:h,tickCount:f,tickMethod:d,title:p,grid:g=!1}=t,y=J(t,["order","size","position","labelFormatter","tickFilter","tickCount","tickMethod","title","grid"]);return(t,e,n,r)=>{var{domain:e,bbox:i}=e,{x:i,y:a,width:o,height:s}=i,i=[i+o/2,a+s/2],a=VE(t,e,f,u,h,d,c,n),t=Math.min(o,s)/2,[e,o]=function(t){var[,t,e]=(t=t.getOptions()["transformations"]).find(t=>"polar"===t[0]);return[180*+t/Math.PI,180*+e/Math.PI]}(n),[s,l]=function(t){var[,,,t,e]=(t=t.getOptions()["transformations"]).find(t=>"polar"===t[0]);return[+t,+e]}(n),s=function(t,e,n,r){var[i,a]=YE(r),n={titleFillOpacity:0,titlePosition:"inner",showLine:!1,showTick:!0,gridLength:(n-e)*(Math.min(i,a)/2)};return"arcInner"===t?(YE(r),Object.assign(Object.assign({},n),{labelAlign:"perpendicular",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},n),{labelAlign:"parallel",labelDirection:"negative",labelSpacing:8,tickDirection:"negative",gridDirection:"positive"})}(c,s,l,n),l=r["axis"];return new fk({style:R({},l,s,Object.assign({type:"arc",center:i,radius:t,angleRange:[e,o],data:a,title:WE(p),showGrid:g},y))})}};const UE=t=>{const{position:h,title:f,labelFormatter:d=t=>""+t,direction:p="left",tickCount:g,tickFilter:y,tickMethod:m}=t,v=J(t,["order","size","transform","position","title","labelFormatter","direction","tickCount","tickFilter","tickMethod"]);return(t,e,n,r)=>{var{domain:e,bbox:i}=e,e=VE(t,e,g,d,y,m,h,n),a=(a=t,r=r,o=h,s=p,r=Object.assign({},r.axis,r["axis"+X0("centerVertical"===o?"left":o)]||r.axisTop),"bottom"===o?Object.assign(Object.assign({},r),{titlePosition:a.getTicks?"right-bottom":"bottom",titleTransformOrigin:"center",titleTransform:a.getTicks?"translate(-100%, 0)":void 0}):"arcY"===o?Object.assign(Object.assign({},r),{labelDirection:"right"===s?"negative":"positive",labelTransform:"center"===s?"translate(50%, 0)":"",tickDirection:"right"===s?"negative":"positive",labelSpacing:"center"===s?0:4,tick:"center"!==s&&void 0}):r),{labelAutoRotate:o=!0,labelAutoHide:s=!1,label:r=!0,tick:l=!0,line:c=!1,grid:u}=Object.assign({},a,v),u=HE(u,n,t),t=function(t,e){var[e,n]=YE(e);return"bottom"===t||"top"===t?n:e}(h,n),i=function(t,e,n){var[,n]=n.getCenter(),{x:r,y:i,width:a,height:o}=e;return"bottom"===t?{startPos:[r,i],endPos:[r+a,i]}:"left"===t||"centerVertical"===t?{startPos:[r+a,i],endPos:[r+a,i+o],showLine:"centerVertical"===t||void 0}:"right"===t?{endPos:[r,i+o],startPos:[r,i]}:"arcY"===t?{startPos:[r,i],endPos:[r+a,i+o],gridCenter:[e.x,n+e.y]}:{startPos:[r,i+o],endPos:[r+a,i+o],showLine:"centerHorizontal"===t||void 0}}(h,i,n),{showLine:n=c}=i,c=J(i,["showLine"]),e=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),{type:"linear",data:e,title:WE(f),showLabel:r,labelTransforms:(i=o,a=[],s&&a.push({type:"hide"}),i&&a.push({type:"rotate",optionalAngles:[0,30,45,60,90]}),a),showGrid:u,showTick:l,gridLength:t}),v),{showLine:!0}),n?null:{lineOpacity:0}),c);return new fk({className:"axis",style:Object.assign(Object.assign({},e),{horizontal:function(t){switch(t){case"top":case"bottom":case"centerHorizontal":return!0;default:return!1}}(h)})})}},XE=t=>{const{position:i,labelFormatter:e=t=>""+t}=t;var n="string"==typeof e?FE(e):e;const a=Object.assign(Object.assign({},t),{labelFormatter:n});return(t,e,n,r)=>("arc"===i||"arcInner"===i?qE:UE)(a)(t,e,n,r)},$E=(XE.props={defaultPosition:"left",defaultSize:45,defaultOrder:0},t=>XE(t)),KE=($E.props=Object.assign(Object.assign({},XE.props),{defaultPosition:"bottom"}),t=>XE(t));KE.props=Object.assign(Object.assign({},XE.props),{defaultPosition:"left"});const ZE=t=>{const{position:u,labelFormatter:h=t=>""+t,dx:f=0,dy:d=0,title:p,gridCol:g,gridRow:y}=t,m=J(t,["order","size","position","labelFormatter","dx","dy","title","gridCol","gridRow"]);return(e,t,n,r)=>{var{domain:t,bbox:i}=t,{x:i,y:a,width:o,height:s}=i,t=t.map(t=>({id:t,label:h(t),value:"",color:e.map(t)})),[l,c]=function(t,e,n){var[r,i]=[e||100,n||100];return{top:[1,i],bottom:[1,i],left:[r,1],right:[r,1],arcCenter:[r,1]}[t]||[e,n]}(u,y,g),t={data:t,x:i+f,y:a+d,orient:["right","left","arcCenter"].includes(u)?"vertical":"horizontal",width:o,height:s,gridCol:c,gridRow:l,rowPadding:0,colPadding:8,titleText:WE(p),itemMarkerFill:t=>t?t.color:"#fff"},{legend:i={}}=r;return new Nk({className:"legend-category",style:Object.assign({},i,t,m)})}},JE=(ZE.props={defaultPosition:"top",defaultOrder:1,defaultSize:40},t=>{const l=t["title"],c=J(t,["title"]);return(e,t,n,r)=>{var{domain:t,bbox:i}=t,{x:i,y:a}=i,[o,s]=t,{continuousLegend:r={}}=r;return new t5({style:Object.assign({},r,{x:i,y:a,width:400,height:300,data:[{value:o},{value:s}],titleText:WE(l),titleFontSize:12,ribbonLen:120,ribbonSize:12,ribbonColor:t.map(t=>e.map(t)),showHandle:!1,showIndicator:!1,labelAlign:"value"},c)})}});function QE(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}JE.props={defaultPosition:"top",defaultOrder:1,defaultSize:40};IE={render(t,e){const{y:n,width:r,title:i,subtitle:a,spacing:o=2,align:s="left"}=t,l=J(t,["x","y","width","title","subtitle","spacing","align"]);t=Q(l,"title");const c=Q(l,"subtitle"),u=GE(e,".title","text").attr("className","title").call(F,Object.assign(Object.assign(Object.assign({},QE(0,n,r,s)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();GE(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},QE(0,u.max[1]+o,r,s)),{fontSize:12,textBaseline:"top",text:a}),c))})}};const tM=class extends zo{constructor(t){super(t),this.descriptor=IE}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(R({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},eM=s=>(t,e,n,r)=>{var{x:e,y:i,width:a,height:o}=e.bbox;return new tM({style:R({},{style:r.title},Object.assign({x:e,y:i,width:a,height:o},s))})};function nM(t){return t.getBandWidth}function rM(t,e,n){if(!nM(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=Mp(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function iM(t,e){var n,r;return nM(t)?(t=t.getOptions()["domain"],[n,r]=e,n=t.indexOf(n),r=t.indexOf(r),t.slice(n,r+1)):Ip(e)}eM.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const aM=t=>{const{orient:u,labelFormatter:h}=t,f=J(t,["orient","labelFormatter","size"]);return(e,t,n,r)=>{var i,t=t["bbox"],{x:t,y:a,width:o,height:s}=t,{slider:r={}}=r;const l=(null==(i=e.getFormatter)?void 0:i.call(e))||(t=>t),c="string"==typeof h?FE(h):h;return new sw({className:"slider",style:Object.assign({},r,Object.assign({x:t,y:a,trackLength:"horizontal"===u?o:s,orient:u,formatter:t=>{return(c||l)(rM(e,t,!0))}},f))})}},oM=(aM.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>aM(Object.assign(Object.assign({},t),{orient:"horizontal"}))),sM=(oM.props=Object.assign(Object.assign({},aM.props),{defaultPosition:"bottom"}),t=>aM(Object.assign(Object.assign({},t),{orient:"vertical"}))),lM=(sM.props=Object.assign(Object.assign({},aM.props),{defaultPosition:"left"}),t=>{const s=t["orient"],l=J(t,["orient","labelFormatter"]);return(t,e,n,r)=>{var e=e["bbox"],{x:e,y:i,width:a,height:o}=e,{scrollbar:r={}}=r;return new uw({className:"scrollbar",style:Object.assign({},r,Object.assign(Object.assign({x:e,y:i,trackLength:"horizontal"===s?a:o},l),{orient:s,value:0,contentLength:1500,viewportLength:"horizontal"===s?a:o}))})}}),cM=(lM.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>lM(Object.assign(Object.assign({},t),{orient:"horizontal"}))),uM=(cM.props=Object.assign(Object.assign({},lM.props),{defaultPosition:"bottom"}),t=>lM(Object.assign(Object.assign({},t),{orient:"vertical"})));uM.props=Object.assign(Object.assign({},lM.props),{defaultPosition:"left"});class hM{constructor(t){this.$value=t}static of(t){return new hM(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}function fM(t,e,n){return hM.of({}).call(dM,t).call(dM,e).call(dM,n).value()}function dM(t,e){for(var[n,r]of Object.entries(e))void 0!==r&&(t[n]=e[n]);return t}function pM(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}const gM=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"],yM=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=i0(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,fM(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},mM=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=i0(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,fM(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},vM=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=i0(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,fM(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},bM=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=i0(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,fM(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},xM=l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a,strokeOpacity:o,opacity:s}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}],fM(i,n,l))},wM=(xM.props={},l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a,strokeOpacity:o,opacity:s}=t.style;return t.animate([{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}],fM(i,n,l))});function kM(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function EM(t,e){var[n,r,i,t]=kM(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0<c;){var u=Math.min(c,a),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(p){"use strict";const y="main-layer",et="label-layer",nt="element",W="view",rt="plot",it="component",at="label",ot="area";var j="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function F(t,e,n,r,i){!function t(e,n,r,i,a){for(;r<i;){600<i-r&&(o=i-r+1,u=n-r+1,l=Math.log(o),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(o-s)/o)*(u-o/2<0?-1:1),c=Math.max(r,Math.floor(n-u*s/o+l)),u=Math.min(i,Math.floor(n+(o-u)*s/o+l)),t(e,n,c,u,a));var o,s,l,c,u,h=e[n],f=r,d=i;for(B(e,r,n),0<a(e[i],h)&&B(e,r,i);f<d;){for(B(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?B(e,r,d):B(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||I)}function B(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function I(t,e){return t<e?-1:e<t?1:0}function D(t,e){z(t,0,t.children.length,e,t)}function z(t,e,n,r,i){(i=i||$(null)).minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];G(i,t.leaf?r(o):o)}return i}function G(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function H(t,e){return t.minX-e.minX}function V(t,e){return t.minY-e.minY}function Y(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function q(t){return t.maxX-t.minX+(t.maxY-t.minY)}function U(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function X(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function $(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(F(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(e=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}).prototype.all=function(){return this._all(this.data,[])},e.prototype.search=function(t){var e=this.data,n=[];if(X(t,e))for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;X(t,s)&&(e.leaf?n.push(o):U(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},e.prototype.collides=function(t){var e=this.data;if(X(t,e))for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(X(t,a)){if(e.leaf||U(t,a))return!0;n.push(i)}}e=n.pop()}return!1},e.prototype.load=function(t){if(t&&t.length)if(t.length<this._minEntries)for(var e=0;e<t.length;e++)this.insert(t[e]);else{var n,r=this._build(t.slice(),0,t.length-1,0);this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(n=this.data,this.data=r,r=n),this._insert(r,this.data.height-r.height-1,!0)):this.data=r}return this},e.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},e.prototype.clear=function(){return this.data=$([]),this},e.prototype.remove=function(t,e){if(t)for(var n,r,i,a=this.data,o=this.toBBox(t),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],n=l.pop(),i=!0),a.leaf){var c=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,a.children,e);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}i||a.leaf||!U(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(s.push(a),l.push(n),a=(r=a).children[n=0])}return this},e.prototype.toBBox=function(t){return t},e.prototype.compareMinX=function(t,e){return t.minX-e.minX},e.prototype.compareMinY=function(t,e){return t.minY-e.minY},e.prototype.toJSON=function(){return this.data},e.prototype.fromJSON=function(t){return this.data=t,this},e.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},e.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)D(i=$(t.slice(e,n+1)),this.toBBox);else{r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(i=$([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));K(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);K(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,r-1))}}D(i,this.toBBox)}return i},e.prototype._chooseSubtree=function(t,e,n,r){for(;;){if(r.push(e),e.leaf||r.length-1===n)break;for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=Y(l),u=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.minY))-c);u<a?(a=u,i=c<i?c:i,o=l):u===a&&c<i&&(i=c,o=l)}e=o||e.children[0]}var h,u;return e},e.prototype._insert=function(t,e,n){var n=n?t:this.toBBox(t),r=[],i=this._chooseSubtree(n,this.data,e,r);for(i.children.push(t),G(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},e.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=$(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,D(n,this.toBBox),D(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},e.prototype._splitRoot=function(t,e){this.data=$([t,e]),this.data.height=t.height+1,this.data.leaf=!1,D(this.data,this.toBBox)},e.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=z(t,0,c,this.toBBox),h=z(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=Y(u)+Y(h);f<s?(s=f,r=c,l=d<l?d:l):f===s&&d<l&&(l=d,r=c)}return r||n-e},e.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:H,i=t.leaf?this.compareMinY:V;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},e.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=z(t,0,e,i),o=z(t,n-e,n,i),s=q(a)+q(o),l=e;l<n-e;l++){var c=t.children[l];G(a,t.leaf?i(c):c),s+=q(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];G(o,t.leaf?i(h):h),s+=q(o)}return s},e.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)G(e[r],t)},e.prototype._condense=function(t){for(var e=t.length-1,n=void 0;0<=e;e--)0===t[e].children.length?0<e?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():D(t[e],this.toBBox)};var Z=e,st=1e-6,lt="undefined"!=typeof Float32Array?Float32Array:Array;function ct(){var t=new lt(9);return lt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ut=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],e=e[8],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],v=n[6],m=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*l+d*e,t[3]=p*r+g*o+y*c,t[4]=p*i+g*s+y*u,t[5]=p*a+g*l+y*e,t[6]=v*r+m*o+n*c,t[7]=v*i+m*s+n*u,t[8]=v*a+m*l+n*e,t};function ht(){var t=new lt(16);return lt!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function ft(t){var e=new lt(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function pt(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function gt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function yt(t,e){var n,r,i,a,o,s;return t===e?(n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s):(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]),t}function vt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15],v=n*s-r*o,m=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,k=i*c-a*l,E=u*g-h*p,M=u*y-f*p,O=u*e-d*p,S=h*y-f*g,_=h*e-d*g,A=f*e-d*y,T=v*A-m*_+b*S+x*O-w*M+k*E;return T?(t[0]=(s*A-l*_+c*S)*(T=1/T),t[1]=(i*_-r*A-a*S)*T,t[2]=(g*k-y*w+e*x)*T,t[3]=(f*w-h*k-d*x)*T,t[4]=(l*O-o*A-c*M)*T,t[5]=(n*A-i*O+a*M)*T,t[6]=(y*b-p*k-e*m)*T,t[7]=(u*k-f*b+d*m)*T,t[8]=(o*_-s*O+c*E)*T,t[9]=(r*O-n*_-a*E)*T,t[10]=(p*w-g*b+e*v)*T,t[11]=(h*b-u*w-d*v)*T,t[12]=(s*M-o*S-l*E)*T,t[13]=(n*S-r*M+i*E)*T,t[14]=(g*m-p*x-y*v)*T,t[15]=(u*x-h*m+f*v)*T,t):null}function mt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function bt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],y=e[13],v=e[14],e=e[15],m=n[0],b=n[1],x=n[2],w=n[3];return t[0]=m*r+b*s+x*h+w*g,t[1]=m*i+b*l+x*f+w*y,t[2]=m*a+b*c+x*d+w*v,t[3]=m*o+b*u+x*p+w*e,m=n[4],b=n[5],x=n[6],w=n[7],t[4]=m*r+b*s+x*h+w*g,t[5]=m*i+b*l+x*f+w*y,t[6]=m*a+b*c+x*d+w*v,t[7]=m*o+b*u+x*p+w*e,m=n[8],b=n[9],x=n[10],w=n[11],t[8]=m*r+b*s+x*h+w*g,t[9]=m*i+b*l+x*f+w*y,t[10]=m*a+b*c+x*d+w*v,t[11]=m*o+b*u+x*p+w*e,m=n[12],b=n[13],x=n[14],w=n[15],t[12]=m*r+b*s+x*h+w*g,t[13]=m*i+b*l+x*f+w*y,t[14]=m*a+b*c+x*d+w*v,t[15]=m*o+b*u+x*p+w*e,t}function xt(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g=n[0],y=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*n+e[12],t[13]=e[1]*g+e[5]*y+e[9]*n+e[13],t[14]=e[2]*g+e[6]*y+e[10]*n+e[14],t[15]=e[3]*g+e[7]*y+e[11]*n+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*y+h*n+e[12],t[13]=i*g+l*y+f*n+e[13],t[14]=a*g+c*y+d*n+e[14],t[15]=o*g+u*y+p*n+e[15]),t}function wt(t,e,n){var r=n[0],i=n[1],n=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function kt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*n+l*r,t[5]=a*n+c*r,t[6]=o*n+u*r,t[7]=s*n+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function Et(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[8],c=e[9],u=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n-l*r,t[1]=a*n-c*r,t[2]=o*n-u*r,t[3]=s*n-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function Mt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Ot(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function St(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=r+r,s=i+i,l=a+a,c=r*o,u=r*s,r=r*l,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+a),t[1]=u+e,t[2]=r-s,t[3]=0,t[4]=u-e,t[5]=1-(c+a),t[6]=i+o,t[7]=0,t[8]=r+s,t[9]=i-o,t[10]=1-(c+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function _t(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function At(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],e=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,c,e),t}function Tt(t,e){var n=new lt(3),r=(At(n,e),1/n[0]),i=1/n[1],n=1/n[2],a=e[0]*r,o=e[1]*i,s=e[2]*n,l=e[4]*r,c=e[5]*i,u=e[6]*n,r=e[8]*r,i=e[9]*i,e=e[10]*n,n=a+c+e,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function Pt(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],e=e[3],l=a+a,c=o+o,u=s+s,h=a*l,f=a*c,a=a*u,d=o*c,o=o*u,s=s*u,l=e*l,c=e*c,e=e*u,u=r[0],p=r[1],r=r[2],g=i[0],y=i[1],i=i[2],v=(1-(d+s))*u,m=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=v,t[1]=m,t[2]=u,t[3]=0,t[4]=f,t[5]=e,t[6]=s,t[7]=0,t[8]=p,t[9]=a,t[10]=c,t[11]=0,t[12]=n[0]+g-(v*g+f*y+p*i),t[13]=n[1]+y-(m*g+e*y+a*i),t[14]=n[2]+i-(u*g+s*y+c*i),t[15]=1,t}function Lt(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n+n,o=r+r,s=i+i,n=n*a,l=r*a,r=r*o,c=i*a,u=i*o,i=i*s,a=e*a,o=e*o,e=e*s;return t[0]=1-r-i,t[1]=l+e,t[2]=c-o,t[3]=0,t[4]=l-e,t[5]=1-n-i,t[6]=u+a,t[7]=0,t[8]=c+o,t[9]=u-a,t[10]=1-n-r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ct(t,e,n,r,i){e=1/Math.tan(e/2);return t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(n=1/(r-i)),t[14]=2*i*r*n):(t[10]=-1,t[14]=-2*r),t}function Nt(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*c,t[15]=1,t}var jt=Nt;function Rt(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<st&&Math.abs(c-d)<st&&Math.abs(e-n)<st?gt(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,t[3]=0,t[4]=r,t[5]=a,t[6]=d,t[7]=0,t[8]=u,t[9]=o,t[10]=n,t[11]=0,t[12]=-(i*l+r*c+u*e),t[13]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function Ft(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var Bt=Object.freeze({__proto__:null,create:ht,clone:ft,copy:dt,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new lt(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=l,y[9]=c,y[10]=u,y[11]=h,y[12]=f,y[13]=d,y[14]=p,y[15]=g,y},set:pt,identity:gt,transpose:yt,invert:vt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15];return t[0]=s*(f*e-d*y)-h*(l*e-c*y)+g*(l*d-c*f),t[1]=-(r*(f*e-d*y)-h*(i*e-a*y)+g*(i*d-a*f)),t[2]=r*(l*e-c*y)-s*(i*e-a*y)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*y)-u*(l*e-c*y)+p*(l*d-c*f)),t[5]=n*(f*e-d*y)-u*(i*e-a*y)+p*(i*d-a*f),t[6]=-(n*(l*e-c*y)-o*(i*e-a*y)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*y-f*g)-u*(s*y-l*g)+p*(s*f-l*h)),t[13]=n*(h*y-f*g)-u*(r*y-i*g)+p*(r*f-i*h),t[14]=-(n*(s*y-l*g)-o*(r*y-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:mt,multiply:bt,translate:xt,scale:wt,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,y,v,m,b,x,w,k,E,M=r[0],O=r[1],r=r[2],S=Math.hypot(M,O,r);return S<st?null:(M*=S=1/S,O*=S,r*=S,S=Math.sin(n),n=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],y=e[11],m=M*O*(i=1-n)-r*S,b=O*O*i+n,x=r*O*i+M*S,w=M*r*i+O*S,k=O*r*i-M*S,E=r*r*i+n,t[0]=a*(n=M*M*i+n)+c*(v=O*M*i+r*S)+d*(r=r*M*i-O*S),t[1]=o*n+u*v+p*r,t[2]=s*n+h*v+g*r,t[3]=l*n+f*v+y*r,t[4]=a*m+c*b+d*x,t[5]=o*m+u*b+p*x,t[6]=s*m+h*b+g*x,t[7]=l*m+f*b+y*x,t[8]=a*w+c*k+d*E,t[9]=o*w+u*k+p*E,t[10]=s*w+h*k+g*E,t[11]=l*w+f*k+y*E,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:kt,rotateY:Et,rotateZ:function(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],c=e[5],u=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n+l*r,t[1]=a*n+c*r,t[2]=o*n+u*r,t[3]=s*n+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:Mt,fromScaling:Ot,fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<st?null:(i*=o=1/o,a*=o,n*=o,o=Math.sin(e),e=Math.cos(e),t[0]=i*i*(r=1-e)+e,t[1]=a*i*r+n*o,t[2]=n*i*r-a*o,t[3]=0,t[4]=i*a*r-n*o,t[5]=a*a*r+e,t[6]=n*a*r+i*o,t[7]=0,t[8]=i*n*r+a*o,t[9]=a*n*r-i*o,t[10]=n*n*r+e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:St,fromQuat2:function(t,e){var n=new lt(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(n[0]=2*(s*o+u*r+l*a-c*i),n[1]=2*(l*o+u*i+c*r-s*a),n[2]=2*(c*o+u*a+s*i-l*r)),St(t,e,n),t},getTranslation:_t,getScaling:At,getRotation:Tt,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],e=e[3],s=i*(u=i+i),l=i*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,t[3]=0,t[4]=(l-e)*d,t[5]=(1-(s+o))*d,t[6]=(a+u)*d,t[7]=0,t[8]=(i+h)*r,t[9]=(a-u)*r,t[10]=(1-(s+c))*r,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Pt,fromQuat:Lt,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Ct,perspective:Ct,perspectiveZO:function(t,e,n,r,i){return e=1/Math.tan(e/2),t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(n=1/(r-i)),t[14]=i*r*n):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),e=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+e),l=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-e)*s*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Nt,ortho:jt,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),o=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=o,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=a*o,t[15]=1,t},lookAt:Rt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],e=e[2],o=r[0],s=r[1],r=r[2],l=i-n[0],c=a-n[1],n=e-n[2],u=l*l+c*c+n*n,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,t[7]=0,t[8]=l,t[9]=c,t[10]=n,t[11]=0,t[12]=i,t[13]=a,t[14]=e,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Ft,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],y=t[14],t=t[15],v=e[0],m=e[1],b=e[2],x=e[3],w=e[4],k=e[5],E=e[6],M=e[7],O=e[8],S=e[9],_=e[10],A=e[11],T=e[12],P=e[13],L=e[14],e=e[15];return Math.abs(n-v)<=st*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-m)<=st*Math.max(1,Math.abs(r),Math.abs(m))&&Math.abs(i-b)<=st*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=st*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=st*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-k)<=st*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-E)<=st*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-M)<=st*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(u-O)<=st*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-S)<=st*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-_)<=st*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(d-A)<=st*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-T)<=st*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=st*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-L)<=st*Math.max(1,Math.abs(y),Math.abs(L))&&Math.abs(t-e)<=st*Math.max(1,Math.abs(t),Math.abs(e))},mul:bt,sub:Ft});function v(){var t=new lt(3);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function It(t){var e=new lt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Dt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function k(t,e,n){var r=new lt(3);return r[0]=t,r[1]=e,r[2]=n,r}function zt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Gt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Wt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Ht(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Vt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Yt(t,e){var n=e[0],r=e[1],i=e[2],n=n*n+r*r+i*i;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function qt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ut(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[0],o=n[1],n=n[2];t[0]=i*n-e*o,t[1]=e*a-r*n,t[2]=r*o-i*a}function Xt(t,e,n,r){var i=e[0],a=e[1],e=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=e+r*(n[2]-e)}function $t(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[3]*r+n[7]*i+n[11]*e+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*e+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*e+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*e+n[14])/a,t}function Kt(t,e,n){var r=e[0],i=e[1],e=e[2];t[0]=r*n[0]+i*n[3]+e*n[6],t[1]=r*n[1]+i*n[4]+e*n[7],t[2]=r*n[2]+i*n[5]+e*n[8]}function Zt(t,e){var n=t[0],r=t[1],t=t[2],i=e[0],a=e[1],e=e[2];return Math.abs(n-i)<=st*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=st*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=st*Math.max(1,Math.abs(t),Math.abs(e))}var Jt=Ht,Qt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],e=e[2]-t[2];return Math.hypot(n,r,e)},te=Dt;function ee(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ne(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*e,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*e,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*e,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*e,t}function re(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ie(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function ae(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=n[0],s=n[1],l=n[2],n=n[3];return t[0]=r*n+e*o+i*l-a*s,t[1]=i*n+e*s+a*o-r*l,t[2]=a*n+e*l+r*s-i*o,t[3]=e*n-r*o-i*s-a*l,t}function oe(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e,a=a?1/a:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t}function se(t,e,n,r){var i=.5*Math.PI/180,i=(e*=i,n*=i,r*=i,Math.sin(e)),e=Math.cos(e),a=Math.sin(n),n=Math.cos(n),o=Math.sin(r),r=Math.cos(r);t[0]=i*n*r-e*a*o,t[1]=e*a*r+i*n*o,t[2]=e*n*o-i*a*r,t[3]=e*n*r+i*a*o}v(),ee();var le=function(t,e,n,r){var i=new lt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ce=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ue=ae,he=function(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e;return 0<a&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=e*a,t};function fe(t,e){var n=new lt(2);return n[0]=t,n[1]=e,n}function de(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function pe(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ge(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ye(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function ve(t,e){var n=e[0]-t[0],e=e[1]-t[1];return Math.hypot(n,e)}function me(t,e){var n=e[0],r=e[1],n=n*n+r*r;return 0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t}function be(t,e){return t[0]*e[0]+t[1]*e[1]}function xe(t,e){return t[0]===e[0]&&t[1]===e[1]}v(),k(1,0,0),k(0,1,0),re(),re(),ct();var we=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};function ke(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}e=new lt(2),lt!=Float32Array&&(e[0]=0,e[1]=0);var Ee=function(t,e){return(Ee=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function Me(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ee(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var m=function(){return(m=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function J(t,e){var n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function t(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}function Oe(t,o,s,l){return new(s=s||Promise)(function(n,e){function r(t){try{a(l.next(t))}catch(t){e(t)}}function i(t){try{a(l.throw(t))}catch(t){e(t)}}function a(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,i)}a((l=l.apply(t,o||[])).next())})}function Se(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function b(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function _e(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t===e&&r:e.has(t))return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}var Ae={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var Te={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Pe(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return Te[e]===t.length-1&&"achlmqstvz".includes(e)})}function Le(t){return Pe(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function Ce(t){return Le(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function Ne(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Te[n]&&("m"===n&&2<r.length?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Te[n]))),Te[n]););}function je(t){return 48<=t&&t<=57}function Re(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||5760<=e&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Fe(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=Te[s[l].toLowerCase()];if(t.segmentStart=l,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return 1;default:return}}(c)){if(t.index+=1,Re(t),t.data=[],u)for(;;){for(var h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?function(t){var e,n,r=t.max,i=t.pathValue,a=t.index,o=a,s=!1,l=!1,c=!1;if(r<=o)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(je(n=43!==(n=i.charCodeAt(o))&&45!==n?n:i.charCodeAt(o+=1))||46===n){if(46!==n){if(e=48===n,n=i.charCodeAt(o+=1),e&&o<r&&n&&je(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&je(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;je(i.charCodeAt(o));)o+=1,l=!0;n=i.charCodeAt(o)}if(101===n||69===n){if(c&&!s&&!l)return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid float exponent';if(43!==(n=i.charCodeAt(o+=1))&&45!==n||(o+=1),!(o<r&&je(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&je(i.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(a,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" is not a number'}(t):(a=i=r=void 0,r=(n=t).index,i=n.pathValue,48===(a=i.charCodeAt(r))?(n.param=0,n.index+=1):49===a?(n.param=1,n.index+=1):n.err='[path-util]: invalid Arc flag "'+i[r]+'", expecting 0 or 1 at index '+r),t.err.length)return;t.data.push(t.param),Re(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,Re(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}Ne(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var Be=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Ie(t){var o,s,l,c;return Le(t)?ke(t):(t=function(t){if(Pe(t))return ke(t);var e=new Be(t);for(Re(e);e.index<e.max&&!e.err.length;)Fe(e);return e.err||e.segments}(t),c=l=s=o=0,t.map(function(t){var e=t.slice(1).map(Number),t=t[0],n=t.toUpperCase();if("M"===t)return o=e[0],s=e[1],["M",l=o,c=s];if(t!==n)switch(n){case"A":i=[n,e[0],e[1],e[2],e[3],e[4],e[5]+o,e[6]+s];break;case"V":i=[n,e[0]+s];break;case"H":i=[n,e[0]+o];break;default:var r=e.map(function(t,e){return t+(e%2?s:o)}),i=[n].concat(r)}else i=[n].concat(e);var a=i.length;switch(n){case"Z":o=l,s=c;break;case"H":o=i[1];break;case"V":s=i[1];break;default:o=i[a-2],s=i[a-1],"M"===n&&(l=o,c=s)}return i}))}function De(t){if(Ce(t))return ke(t);for(var e,n,r,i,a,o,s,l=Ie(t),c=m({},Ae),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=n.y2,o=e.slice(1).map(Number),s=e,"TQ".includes(r)||(n.qx=null,n.qy=null),"H"===r?s=["L",e[1],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function ze(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ge(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],v=c[2],m=c[3]):(t=(g=ze(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=ze(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,y=r*r,v=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*y-d*g*g-y*p*p)/(d*g*g+y*p*p))))*n*g/r+(t+s)/2,m=a*-r*p/n+(e+l)/2,b=Math.asin(((e-m)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-m)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<v?Math.PI-b:b,x=s<v?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(y=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=Ge(s=v+n*Math.cos(x),l=m+r*Math.sin(x),n,r,i,0,o,g,a,[x,y,v,m])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,y=4/3*r*g,v=[t,e],m=[t+a*u,e-y*p],b=[s+a*o,l-y*i],x=[s,l];if(m[0]=2*v[0]-m[0],m[1]=2*v[1]-m[1],c)return m.concat(b,x,f);for(var w=[],k=0,E=(f=m.concat(b,x,f)).length;k<E;k+=1)w[k]=k%2?ze(f[k-1],f[k],h).y:ze(f[k],f[k+1],h).x;return w}function We(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function He(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ve(t,e,n,r,i){var a=He([t,e],[n,r]),o={x:0,y:0};return{length:a,point:o="number"==typeof i?i<=0?{x:t,y:e}:a<=i?{x:n,y:r}:{x:(i=We([t,e],[n,r],i/a))[0],y:i[1]}:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ye(t,e,n,r){var t=[t,e],e=[n,r],i=We(t,e,.5),e=We(e,i,.5),a=We(i,e,.5),o=We(e,a,.5),s=We(a,o,.5),t=Ve(t[0],t[1],i[0],i[1],a[0]).point,i=Ve(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function qe(t,e){var n;if(void 0===e&&(e=!1),Ce(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=ke(t),e?[n,[]]:n;for(var r,i=De(t),a=m({},Ae),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=function(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=e.x1,d=e.y1,p=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=h,t;case"A":return s=[f,d].concat(c),["C"].concat(Ge(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=u,e.qy=h,s=[f,d].concat(c),["C"].concat((n=s[0],r=s[1],i=s[2],a=s[3],o=s[4],s=s[5],[1/3*n+2/3*i,1/3*r+2/3*a,1/3*o+2/3*i,1/3*s+2/3*a,o,s]));case"L":return["C"].concat(Ye(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(Ye(f,d,p,g))}return t}(i[u],a),f=(i[u]=h,y=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],y=p;g.length;)d[p]="A",f.splice(y+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function Ue(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function Xe(t,e,n,r,i,F,B,a,o,s,l){var c=l.bbox,I=void 0===c||c,c=l.length,D=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],y=[f,d],v={x:0,y:0},m=[{x:f,y:d}];h&&s<=0&&(v={x:f,y:d});for(var b,x,w,k,E,M,O,S,_,A,T,P,L,C,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,k=r,E=i,M=F,O=B,S=a,_=o,A=R/u,P=j=N=C=L=P=T=void 0,P=Math.abs,L=Math.sin,C=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(k),k=j/180*((E%360+360)%360),f=(T=b===S&&x===_?{x:b,y:x}:0===w||0===P?Ve(b,x,S,_,A).point:(E=(b-S)/2,T=(x-_)/2,E={x:C(k)*E+L(k)*T,y:-L(k)*E+C(k)*T},1<(T=Math.pow(E.x,2)/Math.pow(w,2)+Math.pow(E.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(E.y,2)-Math.pow(P,2)*Math.pow(E.x,2))/(Math.pow(w,2)*Math.pow(E.y,2)+Math.pow(P,2)*Math.pow(E.x,2)),M=(M!==O?1:-1)*N(T<0?0:T),N=w*E.y/P*M,T=-P*E.x/w*M,M=C(k)*N-L(k)*T+(b+S)/2,b=L(k)*N+C(k)*T+(x+_)/2,x=Ue({x:1,y:0},S={x:(E.x-N)/w,y:(E.y-T)/P}),_=Ue(S,{x:(-E.x-N)/w,y:(-E.y-T)/P}),!O&&0<_?_-=2*j:O&&_<0&&(_+=2*j),S=x+(_%=2*j)*A,N=w*C(S),E=P*L(S),{x:C(k)*N-L(k)*E+M,y:L(k)*N+C(k)*E+b})).x,d=T.y,I&&m.push({x:f,y:d}),D&&(p+=He(y,[f,d])),y=[f,d],h&&s<=p&&s>g[2]&&(O=(p-s)/(p-g[2]),v={x:y[0]*(1-O)+g[0]*O,y:y[1]*(1-O)+g[1]*O}),g=[f,d,p];return{length:p,point:v=h&&p<=s?{x:a,y:o}:v,min:{x:Math.min.apply(null,m.map(function(t){return t.x})),y:Math.min.apply(null,m.map(function(t){return t.y}))},max:{x:Math.max.apply(null,m.map(function(t){return t.x})),y:Math.max.apply(null,m.map(function(t){return t.y}))}}}function $e(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,y=e,v=0,m=[g,y,v],b=[g,y],x={x:0,y:0},w=[{x:g,y:y}];p&&l<=0&&(x={x:g,y:y});for(var k,E,M,O,S,_,A,T,P,L,C=0;C<=d;C+=1)k=t,E=e,M=n,O=r,S=i,_=a,A=o,T=s,L=void 0,L=1-(P=C/d),g=(k={x:Math.pow(L,3)*k+3*Math.pow(L,2)*P*M+3*L*Math.pow(P,2)*S+Math.pow(P,3)*A,y:Math.pow(L,3)*E+3*Math.pow(L,2)*P*O+3*L*Math.pow(P,2)*_+Math.pow(P,3)*T}).x,y=k.y,h&&w.push({x:g,y:y}),f&&(v+=He(b,[g,y])),b=[g,y],p&&l<=v&&l>m[2]&&(M=(v-l)/(v-m[2]),x={x:b[0]*(1-M)+m[0]*M,y:b[1]*(1-M)+m[1]*M}),m=[g,y,v];return{length:v,point:x=p&&v<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Ke(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,y=[d,p,g],v=[d,p],m={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(m={x:d,y:p});for(var x,w,k,E,M,O,S,_,A=0;A<=h;A+=1)x=t,w=e,k=n,E=r,M=i,O=a,_=void 0,_=1-(S=A/h),d=(x={x:Math.pow(_,2)*x+2*_*S*k+Math.pow(S,2)*M,y:Math.pow(_,2)*w+2*_*S*E+Math.pow(S,2)*O}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=He(v,[d,p])),v=[d,p],f&&o<=g&&o>y[2]&&(k=(g-o)/(g-y[2]),m={x:v[0]*(1-k)+y[0]*k,y:v[1]*(1-k)+y[1]*k}),y=[d,p,g];return{length:g,point:m=f&&g<=o?{x:i,y:a}:m,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ze(t,e,n){for(var r,i,a,o=De(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,y={x:0,y:0},v=y,m=y,b=y,x=0,w=0,k=o.length;w<k;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(v=y={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=y)):"L"===i?(g=(r=Ve(l[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,v=r.max,m=r.point):"A"===i?(g=(r=Xe(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,y=r.min,v=r.max,m=r.point):"C"===i?(g=(r=$e(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,y=r.min,v=r.max,m=r.point):"Q"===i?(g=(r=Ke(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,y=r.min,v=r.max,m=r.point):"Z"===i&&(g=(r=Ve((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,v=r.max,m=r.point),s&&x<e&&e<=x+g&&(b=m),p.push(v),d.push(y),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Je(t){return(c=l=s=0)<=qe(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function Qe(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?$e(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=We(n,i,r),i=We(i,a,r),a=We(a,e,r),o=We(n,i,r),i=We(i,a,r),r=We(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var tn=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},en=function(t){return"function"==typeof t},_=function(t){return null==t},nn={}.toString,rn=function(t,e){return nn.call(t)==="[object "+e+"]"},an=function(t){return Array.isArray?Array.isArray(t):rn(t,"Array")},on=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};function sn(t,e){if(t)if(an(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(on(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var ln=function(t){return"object"==typeof t&&null!==t},cn=function(t){if(!ln(t)||!rn(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},un=function(t){if(an(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},hn=function(t){if(an(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},fn=function(t){return rn(t,"String")},dn=function(t,e,n){return t<e?e:n<t?n:t},pn=function(t){return rn(t,"Number")};var gn=function(t,e){return(t%e+e)%e},yn=Object.values?function(t){return Object.values(t)}:function(n){var r=[];return sn(n,function(t,e){en(n)&&"prototype"===e||r.push(t)}),r};var vn=function(t){return rn(t,"Boolean")},mn=function(t){return void 0===t},bn=function(t){return t instanceof Element||t instanceof HTMLDocument};function xn(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function wn(t,e,n,r){return e&&xn(t,e),n&&xn(t,n),r&&xn(t,r),t}function kn(t){if("object"!=typeof t||null===t)return t;if(an(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=kn(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=kn(t[i]):e[i]=t[i];return e}var En=kn;function Mn(a,o){var s;if(en(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map,s;throw new TypeError("Expected a function")}var On=5;function Sn(t,e){if(t===e)return!0;if(t&&e&&!fn(t)&&!fn(e)){if(tn(t)||tn(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=Sn(t[r],e[r]));r++);return n}if(ln(t)||ln(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=Sn(t[i[r]],e[i[r]]));r++);return n}}return!1}function _n(t,e,n){for(var r=0,i=fn(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t}function An(e,t){var n;return null!==e&&cn(e)?(n={},sn(t,function(t){Cn.call(e,t)&&(n[t]=e[t])}),n):{}}function Tn(){}var Pn=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||On,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&cn(o)?(cn(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):an(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},Ln=Sn,Cn=Object.prototype.hasOwnProperty;function Nn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function jn(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function Rn(){}var e="\\s*([+-]?\\d+)\\s*",n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fn=/^#([0-9a-f]{3,8})$/,Bn=new RegExp("^rgb\\("+[e,e,e]+"\\)$"),In=new RegExp("^rgb\\("+[r,r,r]+"\\)$"),Dn=new RegExp("^rgba\\("+[e,e,e,n]+"\\)$"),zn=new RegExp("^rgba\\("+[r,r,r,n]+"\\)$"),Gn=new RegExp("^hsl\\("+[n,r,r]+"\\)$"),Wn=new RegExp("^hsla\\("+[n,r,r,n]+"\\)$"),Hn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Vn(){return this.rgb().formatHex()}function Yn(){return this.rgb().formatRgb()}function qn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Fn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Un(e):3===n?new $n(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Xn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Xn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Bn.exec(t))?new $n(e[1],e[2],e[3],1):(e=In.exec(t))?new $n(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Dn.exec(t))?Xn(e[1],e[2],e[3],e[4]):(e=zn.exec(t))?Xn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Gn.exec(t))?Qn(e[1],e[2]/100,e[3]/100,1):(e=Wn.exec(t))?Qn(e[1],e[2]/100,e[3]/100,e[4]):Hn.hasOwnProperty(t)?Un(Hn[t]):"transparent"===t?new $n(NaN,NaN,NaN,0):null}function Un(t){return new $n(t>>16&255,t>>8&255,255&t,1)}function Xn(t,e,n,r){return new $n(t=r<=0?e=n=NaN:t,e,n,r)}function $n(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Kn(){return"#"+Jn(this.r)+Jn(this.g)+Jn(this.b)}function Zn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Jn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Qn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new er(t,e,n,r)}function tr(t){var e,n,r,i,a,o,s,l;return t instanceof er?new er(t.h,t.s,t.l,t.opacity):(t=t instanceof Rn?t:qn(t))?t instanceof er?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new er(o,s,l,t.opacity)):new er}function er(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function nr(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function rr(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function ir(t,e){return Math.abs(t-e)<.001}function ar(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function or(t){return(t+2*Math.PI)%(2*Math.PI)}Nn(Rn,qn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Vn,formatHex:Vn,formatHsl:function(){return tr(this).formatHsl()},formatRgb:Yn,toString:Yn}),Nn($n,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof Rn?i:qn(i))?new $n((i=i.rgb()).r,i.g,i.b,i.opacity):new $n:new $n(t,e,n,null==r?1:r);var i},jn(Rn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new $n(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new $n(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Kn,formatHex:Kn,formatRgb:Zn,toString:Zn})),Nn(er,function(t,e,n,r){return 1===arguments.length?tr(t):new er(t,e,n,null==r?1:r)},jn(Rn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new er(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new er(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new $n(nr(240<=t?t-240:120+t,n,e),nr(t,n,e),nr(t<120?240+t:t-120,n,e),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var sr={box:function(t,e,n,r){return ar([t,n],[e,r])},length:rr,pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return o<0?rr(t,e,i,a):(n-t)*(n-t)+(r-e)*(r-e)<o?rr(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){n=[n-t,r-e];return xe(n,[0,0])?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(me(r=[-n[1],n[0]],r),Math.abs(be([i-t,a-e],r)))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function lr(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=rr(l[0],l[1],p[0],p[1]);p<s&&(o=d,s=p)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(var s=1/0,g=0;g<32&&!(h<1e-4);g++){var y=o-h,v=o+h,m=[i.apply(void 0,t.concat([y])),i.apply(void 0,e.concat([y]))],m=rr(l[0],l[1],m[0],m[1]);0<=y&&m<s?(o=y,s=m):(y=[i.apply(void 0,t.concat([v])),i.apply(void 0,e.concat([v]))],m=rr(l[0],l[1],y[0],y[1]),v<=1&&m<s?(o=v,s=m):h*=.5)}return{x:i.apply(void 0,t.concat([o])),y:i.apply(void 0,e.concat([o]))}}function cr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function ur(t,e,n){n=t+n-2*e;return ir(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function hr(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function fr(t,e,n,r,i,a,o){var s=cr(t,n,i,o),l=cr(e,r,a,o),c=sr.pointAt(t,e,n,r,o),n=sr.pointAt(n,r,i,a,o);return[[t,e,c.x,c.y,s,l],[s,l,n.x,n.y,i,a]]}function dr(t,e,n,r,i,a,o){return 0===o?(rr(t,e,n,r)+rr(n,r,i,a)+rr(t,e,i,a))/2:(e=(t=fr(t,e,n,r,i,a,.5))[0],n=t[1],e.push(o-1),n.push(o-1),dr.apply(void 0,e)+dr.apply(void 0,n))}var pr={box:function(t,e,n,r,i,a){var o=ur(t,n,i)[0],s=ur(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push(cr(t,n,i,o)),void 0!==s&&c.push(cr(e,r,a,s)),ar(l,c)},length:function(t,e,n,r,i,a){return dr(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,a,o,s){return lr([t,n,i],[e,r,a],o,s,cr)},pointDistance:function(t,e,n,r,i,a,o,s){t=this.nearestPoint(t,e,n,r,i,a,o,s);return rr(t.x,t.y,o,s)},interpolationAt:cr,pointAt:function(t,e,n,r,i,a,o){return{x:cr(t,n,i,o),y:cr(e,r,a,o)}},divide:fr,tangentAngle:function(t,e,n,r,i,a,o){t=hr(t,n,i,o),n=hr(e,r,a,o);return or(Math.atan2(n,t))}};function gr(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function yr(t,e,n,r,i){var a=1-i;return 3*(a*a*(e-t)+2*a*i*(n-e)+i*i*(r-n))}function vr(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return ir(r,0)?ir(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):ir(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function mr(t,e,n,r,i,a,o,s,l){var c=gr(t,n,i,o,l),u=gr(e,r,a,s,l),h=sr.pointAt(t,e,n,r,l),n=sr.pointAt(n,r,i,a,l),r=sr.pointAt(i,a,o,s,l),i=sr.pointAt(h.x,h.y,n.x,n.y,l),a=sr.pointAt(n.x,n.y,r.x,r.y,l);return[[t,e,h.x,h.y,i.x,i.y,c,u],[c,u,a.x,a.y,r.x,r.y,o,s]]}function br(t,e,n,r,i,a,o,s,l){if(0===l){for(var c=[t,n,i,o],u=[e,r,a,s],h=0,f=c.length,d=0;d<f;d++)h+=rr(c[d],u[d],c[(d+1)%f],u[(d+1)%f]);return h/2}t=mr(t,e,n,r,i,a,o,s,.5),e=[].concat(t[0],[l-1]),n=[].concat(t[1],[l-1]);return br.apply(void 0,e)+br.apply(void 0,n)}var xr={extrema:vr,box:function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=vr(t,n,i,o),h=vr(e,r,a,s),f=0;f<u.length;f++)l.push(gr(t,n,i,o,u[f]));for(var d=0;d<h.length;d++)c.push(gr(e,r,a,s,h[d]));return ar(l,c)},length:function(t,e,n,r,i,a,o,s){return br(t,e,n,r,i,a,o,s,3)},nearestPoint:function(t,e,n,r,i,a,o,s,l,c,u){return lr([t,n,i,o],[e,r,a,s],l,c,gr,u)},pointDistance:function(t,e,n,r,i,a,o,s,l,c,u){t=this.nearestPoint(t,e,n,r,i,a,o,s,l,c,u);return rr(t.x,t.y,l,c)},interpolationAt:gr,pointAt:function(t,e,n,r,i,a,o,s,l){return{x:gr(t,n,i,o,l),y:gr(e,r,a,s,l)}},divide:mr,tangentAngle:function(t,e,n,r,i,a,o,s,l){t=yr(t,n,i,o,l),n=yr(e,r,a,s,l);return or(Math.atan2(n,t))}};function wr(t,e){t=Math.abs(t);return 0<e?t:-1*t}var kr=function(t,e,n,r,i,a){var o=n,s=r;if(0===o||0===s)return{x:t,y:e};for(var n=i-t,r=a-e,l=Math.abs(n),c=Math.abs(r),u=o*o,h=s*s,f=Math.PI/4,d=0,p=0,g=0;g<4;g++){var d=o*Math.cos(f),p=s*Math.sin(f),y=(u-h)*Math.pow(Math.cos(f),3)/o,v=(h-u)*Math.pow(Math.sin(f),3)/s,m=d-y,b=p-v,y=l-y,v=c-v,x=Math.hypot(b,m),w=Math.hypot(v,y);f+=x*Math.asin((m*v-b*y)/(x*w))/Math.sqrt(u+h-d*d-p*p),f=Math.min(Math.PI/2,Math.max(0,f))}return{x:t+wr(d,n),y:e+wr(p,r)}};function Er(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function Mr(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Or(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function Sr(t,e,n){var r=Math.cos(n),n=Math.sin(n);return[t*r-e*n,t*n+e*r]}var _r={box:function(t,e,n,r,i,a,o){for(var s=Math.atan(-r/n*Math.tan(i)),l=1/0,c=-1/0,u=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d=0;d<u.length;d++){var p=Er(t,0,n,r,i,u[d]);p<l&&(l=p),c<p&&(c=p)}for(var g=Math.atan(r/(n*Math.tan(i))),y=1/0,v=-1/0,m=[a,o],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;a<o?a<x&&x<o&&m.push(x):o<x&&x<a&&m.push(x)}for(var w=0;w<m.length;w++){var k=Mr(0,e,n,r,i,m[w]);k<y&&(y=k),v<k&&(v=k)}return{x:l,y:y,width:c-l,height:v-y}},length:function(t,e,n,r,i,a,o){},nearestPoint:function(t,e,n,r,i,a,o,s,l){var s=Sr(s-t,l-e,-i),l=s[0],s=s[1],l=kr(0,0,n,r,l,s),c=(s=l.x,c=l.y,(Math.atan2(c*n,s*r)+2*Math.PI)%(2*Math.PI)),s=(c<a?l=Or(n,r,a):o<c&&(l=Or(n,r,o)),Sr(l.x,l.y,i));return{x:s[0]+t,y:s[1]+e}},pointDistance:function(t,e,n,r,i,a,o,s,l){t=this.nearestPoint(t,e,n,r,i,a,o,s,l);return rr(t.x,t.y,s,l)},pointAt:function(t,e,n,r,i,a,o,s){o=(o-a)*s+a;return{x:Er(t,0,n,r,i,o),y:Mr(0,e,n,r,i,o)}},tangentAngle:function(t,e,n,r,i,a,o,s){var l,o=(o-a)*s+a,s=(s=r,a=i,l=o,-1*n*Math.cos(a)*Math.sin(l)-s*Math.sin(a)*Math.cos(l)),i=(a=r,l=i,r=o,-1*n*Math.sin(l)*Math.sin(r)+a*Math.cos(l)*Math.cos(r));return or(Math.atan2(i,s))}};function Ar(t){for(var e=0,n=[],r=0;r<t.length-1;r++){var i=t[r],a=t[r+1],o=rr(i[0],i[1],a[0],a[1]);n.push({from:i,to:a,length:o}),e+=o}return{segments:n,totalLength:e}}var Tr,Pr,Lr={box:function(t){for(var e=[],n=[],r=0;r<t.length;r++){var i=t[r];e.push(i[0]),n.push(i[1])}return ar(e,n)},length:function(t){var e=t;if(e.length<2)return 0;for(var n=0,r=0;r<e.length-1;r++){var i=e[r],a=e[r+1];n+=rr(i[0],i[1],a[0],a[1])}return n},pointAt:function(t,e){var n=e;if(1<n||n<0||t.length<2)return null;var e=Ar(t),r=e.segments,i=e.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var a=0,o=null,s=0;s<r.length;s++){var l=r[s],c=l.from,u=l.to,l=l.length/i;if(a<=n&&n<=a+l){o=sr.pointAt(c[0],c[1],u[0],u[1],(n-a)/l);break}a+=l}return o},pointDistance:function(t,e,n){for(var r=t,i=e,a=n,o=1/0,s=0;s<r.length-1;s++){var l=r[s],c=r[s+1],l=sr.pointDistance(l[0],l[1],c[0],c[1],i,a);l<o&&(o=l)}return o},tangentAngle:function(t,e){var n=e;if(1<n||n<0||t.length<2)return 0;for(var r=(t=Ar(t)).segments,i=t.totalLength,a=0,o=0,s=0;s<r.length;s++){var l=r[s],c=l.from,u=l.to,l=l.length/i;if(a<=n&&n<=a+l){o=Math.atan2(u[1]-c[1],u[0]-c[0]);break}a+=l}return o}},e={exports:{}};function Cr(){}function Nr(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function jr(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new Nr(n,r||t,i),r=Pr?Pr+e:e;return t._events[r]?t._events[r].fn?t._events[r]=[t._events[r],n]:t._events[r].push(n):(t._events[r]=n,t._eventsCount++),t}function Rr(t,e){0==--t._eventsCount?t._events=new Cr:delete t._events[e]}function Fr(){this._events=new Cr,this._eventsCount=0}r=e,Tr=Object.prototype.hasOwnProperty,Pr="~",Object.create&&(Cr.prototype=Object.create(null),(new Cr).__proto__||(Pr=!1)),Fr.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)Tr.call(t,e)&&n.push(Pr?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},Fr.prototype.listeners=function(t){var t=Pr?Pr+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=e[n].fn;return i},Fr.prototype.listenerCount=function(t){t=Pr?Pr+t:t,t=this._events[t];return t?t.fn?1:t.length:0},Fr.prototype.emit=function(t,e,n,r,i,a){var o=Pr?Pr+t:t;if(!this._events[o])return!1;var s,l=this._events[o],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,a),!0}for(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].context,e,n,r);break;default:if(!s)for(u=1,s=new Array(c-1);u<c;u++)s[u-1]=arguments[u];l[f].fn.apply(l[f].context,s)}return!0},Fr.prototype.on=function(t,e,n){return jr(this,t,e,n,!1)},Fr.prototype.once=function(t,e,n){return jr(this,t,e,n,!0)},Fr.prototype.removeListener=function(t,e,n,r){t=Pr?Pr+t:t;if(this._events[t])if(e){var i=this._events[t];if(i.fn)i.fn!==e||r&&!i.once||n&&i.context!==n||Rr(this,t);else{for(var a=0,o=[],s=i.length;a<s;a++)(i[a].fn!==e||r&&!i[a].once||n&&i[a].context!==n)&&o.push(i[a]);o.length?this._events[t]=1===o.length?o[0]:o:Rr(this,t)}}else Rr(this,t);return this},Fr.prototype.removeAllListeners=function(t){return t?(t=Pr?Pr+t:t,this._events[t]&&Rr(this,t)):(this._events=new Cr,this._eventsCount=0),this},Fr.prototype.off=Fr.prototype.removeListener,Fr.prototype.addListener=Fr.prototype.on,Fr.prefixed=Pr,r.exports=Fr.EventEmitter=Fr;var i,Br,E,Ir=e.exports,Dr=((n=i=i||{}).COORDINATE="<coordinate>",n.COLOR="<color>",n.PAINT="<paint>",n.NUMBER="<number>",n.ANGLE="<angle>",n.OPACITY_VALUE="<opacity-value>",n.SHADOW_BLUR="<shadow-blur>",n.LENGTH="<length>",n.PERCENTAGE="<percentage>",n.LENGTH_PERCENTAGE="<length> | <percentage>",n.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",n.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",n.LIST_OF_POINTS="<list-of-points>",n.PATH="<path>",n.FILTER="<filter>",n.Z_INDEX="<z-index>",n.OFFSET_DISTANCE="<offset-distance>",n.DEFINED_PATH="<defined-path>",n.MARKER="<marker>",n.TRANSFORM="<transform>",n.TRANSFORM_ORIGIN="<transform-origin>",n.TEXT="<text>",n.TEXT_TRANSFORM="<text-transform>",function(){function y(t,e){void 0===t&&(t=[0,0,0]),void 0===e&&(e=[0,0,0]),this.center=v(),this.halfExtents=v(),this.min=v(),this.max=v(),this.update(t,e)}y.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var t=y.prototype;return t.update=function(t,e){zt(this.center,t),zt(this.halfExtents,e),Jt(this.min,this.center,this.halfExtents),Wt(this.max,this.center,this.halfExtents)},t.setMinMax=function(t,e){Wt(this.center,e,t),Vt(this.center,this.center,.5),Jt(this.halfExtents,e,t),Vt(this.halfExtents,this.halfExtents,.5),zt(this.min,t),zt(this.max,e)},t.getMin=function(){return this.min},t.getMax=function(){return this.max},t.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;y.isEmpty(t)||(y.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f:o)),e[1]=.5*(s+d),e[2]=.5*(u+p),r[0]=.5*(o-a),r[1]=.5*(d-s),r[2]=.5*(p-u),this.min[0]=a,this.min[1]=s,this.min[2]=u,this.max[0]=o,this.max[1]=d,this.max[2]=p))},t.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,t=t.halfExtents,a=e[0],o=e[4],s=e[8],l=e[1],c=e[5],u=e[9],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),y=Math.abs(s),v=Math.abs(l),m=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),k=Math.abs(d);Gt(n,e[12]+a*i[0]+o*i[1]+s*i[2],e[13]+l*i[0]+c*i[1]+u*i[2],e[14]+h*i[0]+f*i[1]+d*i[2]),Gt(r,p*t[0]+g*t[1]+y*t[2],v*t[0]+m*t[1]+b*t[2],x*t[0]+w*t[1]+k*t[2]),this.min=Jt(this.min,n,r),this.max=Wt(this.max,n,r)},t.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),t=t.getMin();return n[0]<=r[0]&&e[0]>=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},t.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new y,i=v(),n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=v(),i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},t.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(t[0]<e[0]||t[0]>n[0]||t[1]<e[1]||t[1]>n[1]||t[2]<e[2]||t[2]>n[2])},t.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?zt(v(),this.min):272===t.pnVertexFlag?k(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?k(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?k(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?k(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?k(this.max[0],this.min[1],this.max[2]):1===t.pnVertexFlag?k(this.max[0],this.max[1],this.min[2]):k(this.max[0],this.max[1],this.max[2])},t.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?zt(v(),this.max):272===t.pnVertexFlag?k(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?k(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?k(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?k(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?k(this.min[0],this.max[1],this.min[2]):1===t.pnVertexFlag?k(this.min[0],this.min[1],this.max[2]):k(this.min[0],this.min[1],this.min[2])},y}()),zr=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||k(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},e.distanceToPoint=function(t){return qt(t,this.normal)-this.distance},e.normalize=function(){var t=1/te(this.normal);Vt(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),r=r/(r-this.distanceToPoint(e)),i=0<=r&&r<=1;return i&&n&&Xt(n,t,e,r),i},t}(),Gr=((r=Br=Br||{})[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE",function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new zr)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];Gt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,Gt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,Gt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,Gt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,Gt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,Gt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})},t}()),Wr=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Hr=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}();function Vr(o,s){if("function"!=typeof o||null!=s&&"function"!=typeof s)throw new TypeError("Expected a function");function l(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=s?s.apply(this,e):e[0],a=l.cache;return a.has(i)?a.get(i):(r=o.apply(this,e),l.cache=a.set(i,r)||a,r)}return l.cache=new(Vr.Cache||Map),l}(e=E=E||{}).GROUP="g",e.CIRCLE="circle",e.ELLIPSE="ellipse",e.IMAGE="image",e.RECT="rect",e.LINE="line",e.POLYLINE="polyline",e.POLYGON="polygon",e.TEXT="text",e.PATH="path",e.HTML="html",e.MESH="mesh",Vr.Cache=Map;var Yr=Vr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function qr(t){if(!t)throw new Error}function Ur(t,e){if(t===e)throw new Error}function Xr(t){return"function"==typeof t}var $r={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Kr=Vr(function(t){var t=Yr(t),e=$r[t];return(null==e?void 0:e.alias)||t}),Zr={},Jr=0;var Qr="undefined"!=typeof window&&void 0!==window.document;function ti(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function ei(t){var e,n=t;do{if(null==(e=n.style)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function ni(t,e){if(Qr)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var g,ri,ii,ai,oi="Method not implemented.",si="Use document.documentElement instead.",li={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function M(){M=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function ci(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function ui(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){ci(r,e,n,i,a,"next",t)}function a(t){ci(r,e,n,i,a,"throw",t)}i(void 0)})}}function hi(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(r.key),r)}}function fi(t,e,n){e&&hi(t.prototype,e),n&&hi(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function di(){return(di=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function s(t,e){t.prototype=Object.create(e.prototype),pi(t.prototype.constructor=t,e)}function pi(t,e){return(pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function gi(t,e){if(null==t)return{};for(var n,r={},i=Object.keys(t),a=0;a<i.length;a++)n=i[a],0<=e.indexOf(n)||(r[n]=t[n]);return r}function yi(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mi(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?vi(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vi(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n=g=g||{})[n.kUnknown=0]="kUnknown",n[n.kNumber=1]="kNumber",n[n.kPercentage=2]="kPercentage",n[n.kEms=3]="kEms",n[n.kPixels=4]="kPixels",n[n.kRems=5]="kRems",n[n.kDegrees=6]="kDegrees",n[n.kRadians=7]="kRadians",n[n.kGradians=8]="kGradians",n[n.kTurns=9]="kTurns",n[n.kMilliseconds=10]="kMilliseconds",n[n.kSeconds=11]="kSeconds",n[n.kInteger=12]="kInteger",(r=ri=ri||{})[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",(e=ii=ii||{})[e.kYes=0]="kYes",e[e.kNo=1]="kNo",(n=ai=ai||{})[n.kYes=0]="kYes",n[n.kNo=1]="kNo";function bi(t){return t?"number"===t?g.kNumber:"percent"===t||"%"===t?g.kPercentage:(e=t,Si.find(function(t){return t.name===e}).unit_type):g.kUnknown;var e}function xi(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function wi(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var ki,Ei,Mi,Oi,Si=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],e=((r=ki=ki||{})[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",function(){function t(){}t.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},t.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},t.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},t.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds};var e=t.prototype;return e.toString=function(){return this.buildCSSText(ii.kNo,ai.kNo,"")},e.isNumericValue=function(){return this.getType()>=ki.kUnitType&&this.getType()<=ki.kClampType},t}()),n=function(n){function t(t){var e=n.call(this)||this;return e.colorSpace=void 0,e.colorSpace=t,e}s(t,n);var e=t.prototype;return e.getType=function(){return ki.kColorType},e.to=function(t){return this},t}(e),_i=((r=Ei=Ei||{})[r.Constant=0]="Constant",r[r.LinearGradient=1]="LinearGradient",r[r.RadialGradient=2]="RadialGradient",function(r){function t(t,e){var n=r.call(this)||this;return n.type=void 0,n.value=void 0,n.type=t,n.value=e,n}s(t,r);var e=t.prototype;return e.clone=function(){return new t(this.type,this.value)},e.buildCSSText=function(t,e,n){return n},e.getType=function(){return ki.kColorType},t}(e)),Ai=function(n){function t(t){var e=n.call(this)||this;return e.value=void 0,e.value=t,e}s(t,n);var e=t.prototype;return e.clone=function(){return new t(this.value)},e.getType=function(){return ki.kKeywordType},e.buildCSSText=function(t,e,n){return n+this.value},t}(e);(r=Mi=Mi||{}).kAdd="+",r.kSubtract="-",r.kMultiply="*",r.kDivide="/",r.kMin="min",r.kMax="max",r.kClamp="clamp",r.kInvalid="",(r=Oi=Oi||{})[r.kLength=0]="kLength",r[r.kAngle=1]="kAngle",r[r.kTime=2]="kTime",r[r.kFrequency=3]="kFrequency",r[r.kResolution=4]="kResolution",r[r.kFlex=5]="kFlex",r[r.kPercent=6]="kPercent",r[r.kNumBaseTypes=7]="kNumBaseTypes";function Ti(t){return"number"==typeof t?new Bi(t,g.kNumber):t}var Pi=function(){function t(t,e){void 0===t&&(t=g.kNumber),void 0===e&&(e=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=Oi.kPercent,this.hasPercentHint=!1,this.exponents=new Array(Oi.kNumBaseTypes).fill(0),t!==g.kNumber&&this.setExponent(function(t){switch(Ur(t,g.kNumber),t){case g.kEms:case g.kPixels:case g.kRems:return Oi.kLength;case g.kMilliseconds:case g.kSeconds:return Oi.kTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return Oi.kAngle;case g.kPercentage:return Oi.kPercent;default:return Oi.kLength}}(t),e)}var e=t.prototype;return e.applyPercentHint=function(t){Ur(t,Oi.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(Oi.kPercent)),this.setExponent(Oi.kPercent,0),this.percentHint=t,this.hasPercentHint=!0},e.hasNonZeroEntries=function(){return 0<this.numNonZeroEntries},e.isOnlyNonZeroEntry=function(t,e){return Ur(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},e.exponent=function(t){return this.exponents[t]},e.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},t.negateExponents=function(t){return t.exponents.forEach(function(t){return-1*t}),t},e.matchesBaseType=function(t){return Ur(t,Oi.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint},e.matchesPercentage=function(){return this.isOnlyNonZeroEntry(Oi.kPercent,1)},e.matchesBaseTypePercentage=function(t){return Ur(t,Oi.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(Oi.kPercent,1)},e.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},e.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(Oi.kPercent,1)},t.add=function(t,e,n){if(!t.hasPercentHint||!e.hasPercentHint||t.percentHint==e.percentHint){t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);var r=t.percentHint,i=e.percentHint;if(r!==i)throw new Error;for(var a=0;a<Oi.kNumBaseTypes;++a){var o=a;if(t.exponents[a]!==e.exponents[a]&&(o!==Oi.kPercent&&(t.applyPercentHint(o),e.applyPercentHint(o)),t.exponents[a]!==e.exponents[a]))return t}}return t},t.multiply=function(t,e,n){if(!t.hasPercentHint||!e.hasPercentHint||t.percentHint==e.percentHint){t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;r<Oi.kNumBaseTypes;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}}return t},t}(),r=function(n){function d(t){var e=n.call(this)||this;return e.type_=void 0,e.type_=t,e}s(d,n);var t=d.prototype;return t.getType=function(){return ki.kUnknownType},t.equals=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Li(n).every(function(t){return e.equals(t)})},t.add=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Li(e),i=(Ci(ki.kSumType,r,this),ji(r,Mi.kAdd));return i||Vi.create(r)},t.sub=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=(r=Li(e)).map(function(t){return t.negate()}),i=(Ci(ki.kSumType,r,this),ji(r,Mi.kAdd));return i||Vi.create(r)},t.mul=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Li(e),i=(Ci(ki.kProductType,r,this),Ri(r));return i||Yi.create(r)},t.div=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=(r=Li(e)).map(function(t){return t.invert()}),i=(Ci(ki.kProductType,r,this),Ri(r));return i||Yi.create(r)},t.min=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Li(e),i=(Ci(ki.kMinType,r,this),ji(r,Mi.kMin));return i||Wi.create(r)},t.max=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=Li(e),i=(Ci(ki.kMaxType,r,this),ji(r,Mi.kMax));return i||Hi.create(r)},t.to=function(t){var e=this.sumValue();return 0!==e.length&&1===e.length&&(e=Ni(e[0]))?(t="string"==typeof t?bi(t):t,e.convertTo(t)):null},t.toSum=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a=i[r];if(!d.isValidUnit(bi(a)))return null}var o=this.sumValue();if(!o.length)return null;for(var s=[],l=mi(o);!(c=l()).done;){var c=Ni(c.value);if(!c)return null;s.push(c)}if(0===e.length)return s.sort(function(t,e){return t.unit-e.unit}),qr(!!(o=Vi.create(s))),o;for(var u=[],h=0,f=e;h<f.length;h++)!function(){var t=f[h],r=bi(t),t=(qr(d.isValidUnit(r)),s.reduce(function(t,e,n){return e&&(e=e.convertTo(r))&&(t+=e.value,s[n]=null),t},0));u.push(new Bi(t,r))}();if(s.some(function(t){return!!t}))throw new Error("There were leftover terms that were not converted");return Vi.create(u)},t.type=function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(Oi.kLength);return e&&(t.length=e),(e=this.type_.exponent(Oi.kAngle))&&(t.angle=e),(e=this.type_.exponent(Oi.kTime))&&(t.time=e),(e=this.type_.exponent(Oi.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(Oi.kResolution))&&(t.resolution=e),(e=this.type_.exponent(Oi.kFlex))&&(t.flex=e),(e=this.type_.exponent(Oi.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case Oi.kLength:return"length";case Oi.kAngle:return"angle";case Oi.kTime:return"time";case Oi.kFrequency:return"frequency";case Oi.kResolution:return"resolution";case Oi.kFlex:return"flex";case Oi.kPercent:return"percent"}return""}(this.type_.percentHint)),t},d.isValidUnit=function(t){return!!(t===g.kNumber||t==g.kPercentage||this.isLength(t)||this.isAngle(t)||this.isTime(t))},t.negate=function(){return Di.create(this)},t.invert=function(){return Ii.create(this)},d}(e);function Li(t){return t.map(Ti)}function Ci(t,e,n){qr(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function Ni(t){return 0===Object.keys(t.units).length?new Bi(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Bi(t.value,Number(Object.keys(t.units)[0])):null}function ji(t,e){qr(!!t.length);var n=t[0]instanceof Bi?t[0]:null;if(!n)return null;for(var r=n.value,i=1;i<t.length;i++){var a=t[i]instanceof Bi?t[i]:null;if(!a||a.unit!==n.unit)return null;e===Mi.kAdd?r+=a.value:e===Mi.kMax?r=Math.max(r,a.value):e===Mi.kMin&&(r=Math.min(r,a.value))}return new Bi(r,n.unit)}function Ri(t){qr(!!t.length);for(var e=g.kNumber,n=1,r=0;r<t.length;r++){var i=t[r]instanceof Bi?t[r]:null;if(!i)return null;if(i.unit!==g.kNumber){if(e!==g.kNumber)return null;e=i.unit}n*=i.value}return new Bi(n,e)}function Fi(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return ri.kUNumber;case g.kPercentage:return ri.kUPercent;case g.kPixels:return ri.kULength;case g.kMilliseconds:case g.kSeconds:return ri.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return ri.kUAngle;default:return ri.kUOther}}(t)){case ri.kUNumber:return g.kNumber;case ri.kULength:return g.kPixels;case ri.kUPercent:return g.kPercentage;case ri.kUTime:return g.kSeconds;case ri.kUAngle:return g.kDegrees;default:return g.kUnknown}}var Bi=function(r){function n(t,e){var n,e="string"==typeof(e=void 0===e?g.kNumber:e)?bi(e):e;return(n=r.call(this,new Pi(e))||this).unit=void 0,n.value=void 0,n.unit=e,n.value=t,n}s(n,r);var t=n.prototype;return t.clone=function(){return new n(this.value,this.unit)},t.convertTo=function(t){var e;return this.unit===t?new n(this.value,this.unit):(e=Fi(this.unit))!==Fi(t)||e===g.kUnknown?null:(e=xi(this.unit)/xi(t),new n(this.value*e,t))},t.equals=function(t){return this.value===t.value&&this.unit===t.unit},t.getType=function(){return ki.kUnitType},t.sumValue=function(){var t,e,n=[],r={};return this.unit!==g.kNumber&&(r[t=this.unit,(e=Fi(t))===g.kUnknown?t:e]=1),n.push({value:this.value*xi(this.unit),units:r}),n},t.negate=function(){return new n(-this.value,this.unit)},t.invert=function(){return this.unit===g.kNumber?0===this.value?null:new n(1/this.value,this.unit):Ii.create(this)},t.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=wi(this.unit);i=a<-999999||999999<a?(r=wi(this.unit),!Number.isFinite(a)||Number.isNaN(a)?function(t,e){void 0===e&&(e="");return(Number.isFinite(t)?(qr(Number.isNaN(t)),"NaN"):0<t?"infinity":"-infinity")+e}(a,r):a+(r||"")):""+a+o}return n+=i},n}(r),e=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.isUnitValue=function(){return!1},e}(r),Ii=function(n){function e(t,e){e=n.call(this,e)||this;return e.value=void 0,e.operator="invert",e.value=t,e}s(e,n),e.create=function(t){return new e(t,Pi.negateExponents(t.type_))};var t=e.prototype;return t.clone=function(){return new e(this.value,this.type_)},t.getType=function(){return ki.kInvertType},t.equals=function(t){return t.getType()===ki.kInvertType&&this.value.equals(t.value)},t.sumValue=function(){var e=this.value.sumValue();return 0===e.length||1!==e.length||0===e[0].value?null:(Object.keys(e[0].units).forEach(function(t){e[0].units[t]*=-1}),e[0].value=1/e[0].value,e)},t.buildCSSText=function(t,e,n){return e==ai.kNo&&(n+=t===ii.kYes?"(":"calc("),n=this.value.buildCSSText(ii.kYes,ai.kNo,n+="1 / "),e===ai.kNo&&(n+=")"),n},e}(e),Di=function(n){function e(t,e){e=n.call(this,e)||this;return e.value=void 0,e.operator="negate",e.value=t,e}s(e,n),e.create=function(t){return new e(t,t.type_)};var t=e.prototype;return t.clone=function(){return new e(this.value,this.type_)},t.getType=function(){return ki.kNegateType},t.equals=function(t){return t.getType()===ki.kNegateType&&this.value.equals(t.value)},t.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach(function(t){t.value*=-1}),t)},t.buildCSSText=function(t,e,n){return e==ai.kNo&&(n+=t===ii.kYes?"(":"calc("),n=this.value.buildCSSText(ii.kYes,ai.kNo,n+="-"),e===ai.kNo&&(n+=")"),n},e}(e);function zi(t,e){for(var n=t[0].type_,r=1;r<t.length;r++)n=e(n,t[r].type_,!1);return n}function Gi(t){return Zi[t]||(Zi[t]=new Ai(t)),Zi[t]}var r=function(n){function t(t,e){e=n.call(this,e)||this;return e.values=void 0,e.values=t,e}s(t,n);var e=t.prototype;return e.numericValues=function(){return this.values},e.equals=function(n){return this.getType()===n.getType()&&this.values.every(function(t,e){return t.equals(n.values[e])})},t}(e),Wi=function(i){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="min",t}s(e,i),e.create=function(t){return new e(t,zi(t,Pi.add))};var t=e.prototype;return t.clone=function(){return new e(this.values,this.type_)},t.getType=function(){return ki.kMinType},t.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e=mi(this.numericValues());!(n=e()).done;){var n=n.value.sumValue();if(!n.length||JSON.stringify(n[0].units)!==JSON.stringify(t[0].units))return null;n[0].value<t[0].value&&(t=n)}return t},t.buildCSSText=function(t,e,n){n+="min(";for(var r,i=!0,a=mi(this.numericValues());!(r=a()).done;)i||(n+=", "),i=!1,n=r.value.buildCSSText(ii.kYes,ai.kYes,n);return n+=")"},e}(r),Hi=function(i){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="max",t}s(e,i),e.create=function(t){return new e(t,zi(t,Pi.add))};var t=e.prototype;return t.clone=function(){return new e(this.values,this.type_)},t.getType=function(){return ki.kMaxType},t.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e=mi(this.numericValues());!(n=e()).done;){var n=n.value.sumValue();if(!n.length||JSON.stringify(n[0].units)!==JSON.stringify(t[0].units))return null;n[0].value<t[0].value&&(t=n)}return t},t.buildCSSText=function(t,e,n){n+="max(";for(var r,i=!0,a=mi(this.numericValues());!(r=a()).done;)i||(n+=", "),i=!1,n=r.value.buildCSSText(ii.kYes,ai.kYes,n);return n+=")"},e}(r),Vi=function(i){function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="sum",t}s(e,i),e.create=function(t){return new e(t,zi(t,Pi.add))},e.numericTypeFromUnitMap=function(n){var r=new Pi;return Object.keys(n).forEach(function(t){var e=n[t];r=Pi.multiply(r,new Pi(Number(t),e),!1),qr(!0)}),r},e.canCreateNumericTypeFromSumValue=function(t){var e=this,n=(qr(!!t.length),this.numericTypeFromUnitMap(t[0].units));return t.every(function(t){return Pi.add(n,e.numericTypeFromUnitMap(t.units),!1),!0})};var t=e.prototype;return t.clone=function(){return new e(this.values,this.type_)},t.getType=function(){return ki.kSumType},t.sumValue=function(){var n=[];return this.numericValues().forEach(function(t){t=t.sumValue();if(!t.length)return null;t.forEach(function(e){var t=n.findIndex(function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)});-1===t?n.push(di({},e)):n[t].value+=e.value})}),e.canCreateNumericTypeFromSumValue(n)?n:null},t.buildCSSText=function(t,e,n){e==ai.kNo&&(n+=t===ii.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(ii.kYes,ai.kNo,n);for(var i=1;i<r.length;i++){var a=r[i];n=(a.getType()===ki.kNegateType?(n+=" - ",a.value):(n+=" + ",a)).buildCSSText(ii.kYes,ai.kNo,n)}return e===ai.kNo&&(n+=")"),n},e}(r),Yi=function(i){function a(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).operator="product",t}s(a,i),a.create=function(t){return new a(t,zi(t,Pi.multiply))},a.multiplyUnitMaps=function(n,r){return Object.keys(r).forEach(function(t){Ur(r[t].value,0);var e=t in n?n[t].value:0;e+r[t].value===0?delete n[t]:n[t]=e+r[t].value}),n};var t=a.prototype;return t.clone=function(){return new a(this.values,this.type_)},t.getType=function(){return ki.kProductType},t.sumValue=function(){var e=[{value:1,units:{}}];return this.numericValues().forEach(function(t){var n=t.sumValue();if(!n.length)return null;var r=[];e.forEach(function(e){n.forEach(function(t){r.push({value:e.value*t.value,units:a.multiplyUnitMaps(e.units,t.units)})})}),e=r}),e},t.buildCSSText=function(t,e,n){e==ai.kNo&&(n+=t===ii.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(ii.kYes,ai.kNo,n);for(var i=1;i<r.length;i++){var a=r[i];n=(a.getType()===ki.kInvertType?(n+=" / ",a.value):(n+=" * ",a)).buildCSSText(ii.kYes,ai.kNo,n)}return e===ai.kNo&&(n+=")"),n},a}(r),qi=new Bi(0,"px"),Ui=(new Bi(1,"px"),new Bi(0,"deg")),Xi=function(o){function t(t,e,n,r,i){var a;return void 0===r&&(r=1),void 0===i&&(i=!1),(a=o.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}s(t,o);var e=t.prototype;return e.clone=function(){return new t(this.r,this.g,this.b,this.alpha)},e.buildCSSText=function(t,e,n){return n+("rgba("+this.r+","+this.g+","+this.b+","+this.alpha)+")"},t}(n),$i=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;O.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},Ki=new Ai("unset"),e=new Ai("initial"),r=new Ai("inherit"),Zi={"":Ki,unset:Ki,initial:e,inherit:r},Ji=new Xi(0,0,0,0,!0),Qi=new Xi(0,0,0,0),ta=Vr(function(t,e,n,r){return new Xi(t,e,n,r)},function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"}),ea=Vr(function(t,e){return void 0===e&&(e=g.kNumber),new Bi(t,e)},function(t,e){return""+t+(e=void 0===e?g.kNumber:e)}),na=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ra=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ia=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,aa=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var oa={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},sa=Vr(function(t){t="angular"===t.type?Number(t.value):oa[t.value]||0;return ea(t,"deg")}),la=Vr(function(t){var e,n=50,r=50,i="%",a="%";return"position"===(null==t?void 0:t.type)&&(e=(t=t.value).x,t=t.y,"position-keyword"===(null==e?void 0:e.type)&&("left"===e.value?n=0:"center"===e.value?n=50:"right"===e.value?n=100:"top"===e.value?r=0:"bottom"===e.value&&(r=100)),"position-keyword"===(null==t?void 0:t.type)&&("left"===t.value?n=0:"center"===t.value?r=50:"right"===t.value?n=100:"top"===t.value?r=0:"bottom"===t.value&&(r=100)),"px"!==(null==e?void 0:e.type)&&"%"!==(null==e?void 0:e.type)&&"em"!==(null==e?void 0:e.type)||(i=null==e?void 0:e.type,n=Number(e.value)),"px"!==(null==t?void 0:t.type)&&"%"!==(null==t?void 0:t.type)&&"em"!==(null==t?void 0:t.type)||(a=null==t?void 0:t.type,r=Number(t.value))),{cx:ea(n,i),cy:ea(r,a)}}),ca=Vr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return Es(t).map(function(t){for(var e=t.type,n=t.orientation,t=t.colorStops,r=t,i=r.length,a=(r[i-1].length=null!=(f=r[i-1].length)?f:{type:"%",value:"100"},1<i&&(r[0].length=null!=(f=r[0].length)?f:{type:"%",value:"0"}),0),o=Number(r[0].length.value),s=1;s<i;s++){var l,c=null==(l=r[s].length)?void 0:l.value;if(!_(c)&&!_(o)){for(var u=1;u<s-a;u++)r[a+u].length={type:"%",value:""+(o+(Number(c)-o)*u/(s-a))};a=s,o=Number(c)}}var h,f=t.map(function(t){return{offset:ea(t.length.value,"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#"+t:"literal"===e?t:"rgb"===e?"rgb("+t.join(",")+")":"rgba("+t.join(",")+")")};var e});return"linear-gradient"===e?new _i(Ei.LinearGradient,{angle:n?sa(n):Ui,steps:f}):"radial-gradient"===e&&"shape"===(n=n||[{type:"shape",value:"circle"}])[0].type&&"circle"===n[0].value?(e=(t=la(n[0].at)).cx,t=t.cy,n[0].style&&(h=(n=n[0].style).type,n=n.value,h="extent-keyword"===h?Gi(n):ea(n,h)),new _i(Ei.RadialGradient,{cx:e,cy:t,size:h,steps:f})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=na.exec(t);if(n)return r=(null==(r=n[2].match(aa))?void 0:r.map(function(t){return t.split(":")}))||[],[new _i(Ei.LinearGradient,{angle:ea(parseFloat(n[1]),"deg"),steps:r.map(function(t){var e=t[0],t=t[1];return{offset:ea(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=ra.exec(t);if(t)return t=(null==(t=t[4].match(aa))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:ea(50,"%"),cy:ea(50,"%"),steps:t.map(function(t){var e=t[0],t=t[1];return{offset:ea(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!fn(n))return[new _i(Ei.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ia.exec(r)){var i=r[1],r=r[2];switch(i){case"a":i="repeat";break;case"x":i="repeat-x";break;case"y":i="repeat-y";break;default:i="no-repeat"}return{image:r,repetition:i}}return null}});function ua(t){return on(t)&&t.image}function ha(t){return on(t)&&!_(t.r)&&!_(t.g)&&!_(t.b)}var fa=Vr(function(t){var e;return ua(t)?di({repetition:"repeat"},t):"transparent"===(t=_(t)?"":t)?Qi:ca(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=qn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),ta.apply(void 0,e))});function da(t,e){if(ha(t)&&ha(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(dn(e[n],0,255));return e[3]=dn(e[3],0,1),"rgba("+e.join(",")+")"}]}function pa(t,e){if(_(e))return ea(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return ea(Number(e),"px");if(0<="deg".search(t))return ea(Number(e),"deg")}var n=[],r=(e=e.replace(t,function(t){return n.push(t),"U"+t}),"U("+t.source+")");return n.map(function(t){return ea(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var ga=Vr(function(t){return pa(new RegExp("px","g"),t)}),ya=(Vr(function(t){return pa(new RegExp("%","g"),t)}),Vr(function(t){return pn(t)||isFinite(Number(t))?ea(Number(t),"px"):pa(new RegExp("px|%|em|rem","g"),t)})),va=Vr(function(t){return pa(new RegExp("deg|rad|grad|turn","g"),t)});function ma(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=hs(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function ba(t){return fn(t)?t.split(" ").map(function(t){return ya(t)}):t.map(function(t){return ya(t.toString())})}function xa(t,e,n){var r;return t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===E.GROUP?n.getLocalBounds():n.getGeometryBounds(),r=0,Dr.isEmpty(n)||(r=2*n.halfExtents[e]),Number(t.value)/100*r):0}var wa=function(t){return pa(/deg|rad|grad|turn|px|%/g,t)},ka=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ea(t){if("none"!==(t=(t=void 0===t?"":t).toLowerCase().trim()))for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,-1<ka.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return wa(t)||fa(t)})}),n.lastIndex===t.length)return r}return[]}function Ma(t){return t.toString()}var Oa=Vr(function(t){return"number"==typeof t?ea(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ea(Number(t)):ea(0)});function Sa(t,e){return[t,e,Ma]}function _a(n,r){return function(t,e){return[t,e,function(t){return Ma(dn(t,n,r))}]}}function Aa(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}Vr(function(t){return(fn(t)?t.split(" "):t).map(Oa)});var Ta=function(e){if(""===e||Array.isArray(e)&&0===e.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var n;try{n=De(e)}catch(t){n=De(""),console.error("[g]: Invalid SVG Path definition: "+e)}var e=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),t=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}0<r.length&&n.push(r);return{polygons:e,polylines:n}}(n),r=t.polygons,t=t.polylines,i=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s],c=(r=t[s+1],l[0]),u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=s;break;case"A":var h=function(t,e){var n=e[1],r=e[2],i=gn(us(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],e=e[7],u=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-e)/2,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=Qs([1,0],p),h=Qs(p,u);Js(p,u)<=-1&&(h=Math.PI);1<=Js(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:Ys(t,[c,e])?0:n,ry:Ys(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"Z"===c?(n=i,r=t[a+1]):(m=l.length,n=[l[m-2],l[m-1]]),r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&Ys(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,y,v,m=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=m,u.prePoint);["L","H","V"].includes(c)?(u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]]):"Q"===c?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(d=Us((f=e[s-1]).currentPoint,b),"Q"===f.command?(u.command="Q",u.startTangent=[b[0]-d[0],b[1]-d[1]],u.endTangent=[n[0]-d[0],n[1]-d[1]]):(u.command="TL",u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]])):"C"===c?(d=[l[1],l[2]],p=[l[3],l[4]],u.startTangent=[b[0]-d[0],b[1]-d[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[d[0]-p[0],d[1]-p[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[p[0]-d[0],p[1]-d[1]])):"S"===c?(g=Us((p=e[s-1]).currentPoint,b),y=[l[1],l[2]],"C"===p.command?(u.command="C",u.startTangent=[b[0]-g[0],b[1]-g[1]]):(u.command="SQ",u.startTangent=[b[0]-y[0],b[1]-y[1]]),u.endTangent=[n[0]-y[0],n[1]-y[1]]):"A"===c&&(g=Ks(u,0),b=g.x,y=g.y,c=Ks(u,1,!1),v=c.x,c=c.y,u.startTangent=[b,y],u.endTangent=[v,c]),e.push(u)}return e}(n),a=function(t,e){for(var n=[],r=[],i=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,l=o.params,c=o.prePoint,u=void 0;switch(o.command){case"Q":u=pr.box(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=xr.box(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=o.arcParams;u=_r.box(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(o.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),r=r.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0});var f=hn(n),d=hn(r),p=un(n),g=un(r);if(0!==i.length)for(var y=0;y<i.length;y++){var v=i[y],m=v.currentPoint,b=void 0;m[0]===f?(b=qs(v,e),f-=b.xExtra):m[0]===p&&(b=qs(v,e),p+=b.xExtra),m[1]===d?(b=qs(v,e),d-=b.yExtra):m[1]===g&&(b=qs(v,e),g+=b.yExtra)}return{x:f,y:d,width:p-f,height:g-d}}(i,0),o=a.x,s=a.y,l=a.width,a=a.height;return{absolutePath:n,hasArc:e,segments:i,polygons:r,polylines:t,totalLength:0,rect:{x:Number.isFinite(o)?o:0,y:Number.isFinite(s)?s:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(a)?a:0}}},Pa=Vr(Ta);function La(t,e){t=(fn(t)?Pa:Ta)(t);return e&&(e.parsedStyle.defX=t.rect.x,e.parsedStyle.defY=t.rect.y),t}function Ca(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=qe(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=qe(e.absolutePath,!1),e.curve=d),[f,d]),f=Je((t=f.length!==d.length?function t(e,n,r){var i,e=Qe(e),n=Qe(n),a=e.length,o=n.length,s=e.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).length,s=e.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,c=r||Math.max(a,o),u=[s,l],h=[c-a,c-o],r=[e,n].map(function(t,n){return t.l===c?t.map(function(t){return t.s}):t.map(function(t,e){return i=e&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Je(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):ke(t[0]);return[f,(i=t[1],a=f,c=i.length-1,u=[],h=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){h+=He(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Na(t,e){var n,r,i=fn(t)?t.split(" ").map(function(t){var t=t.split(","),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=Lr.length(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=sr.length(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,i.map(function(t){return t[0]}))),l=Math.min.apply(Math,i.map(function(t){return t[1]}));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}var ja=null;function Ra(t){return function(e){var n=0;return t.map(function(t){return t===ja?e[n++]:t})}}function Fa(t){return t}var Ba={matrix:["NNNNNN",[ja,ja,0,0,ja,ja,0,0,0,0,1,0,ja,ja,0,1],Fa],matrix3d:["NNNNNNNNNNNNNNNN",Fa],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ra([ja,ja,new Bi(1)]),Fa],scalex:["N",Ra([ja,new Bi(1),new Bi(1)]),Ra([ja,new Bi(1)])],scaley:["N",Ra([new Bi(1),ja,new Bi(1)]),Ra([new Bi(1),ja])],scalez:["N",Ra([new Bi(1),new Bi(1),ja])],scale3d:["NNN",Fa],skew:["Aa",null,Fa],skewx:["A",null,Ra([ja,Ui])],skewy:["A",null,Ra([Ui,ja])],translate:["Tt",Ra([ja,ja,qi]),Fa],translatex:["T",Ra([ja,qi,qi]),Ra([ja,qi])],translatey:["T",Ra([qi,ja,qi]),Ra([qi,ja])],translatez:["L",Ra([qi,qi,ja])],translate3d:["TTL",Fa]};function Ia(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=Ba[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?Ui:va(t)},N:Oa,T:ya,L:ga}[f.toUpperCase()](h):{a:Ui,n:c[0],t:qi}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function Da(t){switch(t.t){case"rotatex":return i=us(ma(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=us(ma(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=us(ma(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":var e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=us(ma(t.d[3])),a=e*e+n*n+r*r,a=(0==a?(e=1,r=n=0):1!=a&&(e/=a=Math.sqrt(a),n/=a,r/=a),Math.sin(i/2)),o=a*Math.cos(i/2),a=a*a;return[1-2*(n*n+r*r)*a,2*(e*n*a+r*o),2*(e*r*a-n*o),0,2*(e*n*a-r*o),1-2*(e*e+r*r)*a,2*(n*r*a+e*o),0,2*(e*r*a+n*o),2*(n*r*a-e*o),1-2*(e*e+n*n)*a,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":o=us(ma(t.d[0])),a=us(ma(t.d[1]));return[1,Math.tan(a),0,0,Math.tan(o),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=us(ma(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=us(ma(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xa(t.d[0],0,null)||0,n=xa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xa(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=xa(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=xa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xa(t.d[0],0,null)||0,n=xa(t.d[1],0,null)||0,r=xa(t.d[2],0,null)||0,1];case"perspective":a=xa(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,a?-1/a:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(t){return t.value})}}function za(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Ga(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return 1}(ps,t))return;if(dt(gs,ps),gs[3]=0,gs[7]=0,gs[11]=0,gs[15]=1,Math.abs(mt(gs))<1e-8)return;var t=ps[3],o=ps[7],s=ps[11],l=ps[12],c=ps[13],u=ps[14],h=ps[15];if(0!==t||0!==o||0!==s){if(ys[0]=t,ys[1]=o,ys[2]=s,ys[3]=h,!vt(gs,gs))return;yt(gs,gs),ne(i,ys,gs)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(d,ps),n[0]=Dt(d[0]),Yt(d[0],d[0]),r[0]=qt(d[0],d[1]),ms(d[1],d[1],d[0],1,-r[0]),n[1]=Dt(d[1]),Yt(d[1],d[1]),r[0]/=n[1],r[1]=qt(d[0],d[2]),ms(d[2],d[2],d[0],1,-r[1]),r[2]=qt(d[1],d[2]),ms(d[2],d[2],d[1],1,-r[2]),n[2]=Dt(d[2]),Yt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Ut(vs,d[1],d[2]),qt(d[0],vs)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(a[0]=-a[0]);d[0][2]>d[2][0]&&(a[1]=-a[1]);d[1][0]>d[0][1]&&(a[2]=-a[2])}(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Da).reduce(za),e,n,r,i,a),[[e,n,r,a,i]]}var Wa=function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)a[o][3]=i[o];for(var s=0;s<3;s++)for(var l=0;l<3;l++)a[3][s]+=t[l]*a[l][s];var c=r[0],u=r[1],h=r[2],r=r[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],h=(f[0][0]=1-2*(u*u+h*h),f[0][1]=2*(c*u-h*r),f[0][2]=2*(c*h+u*r),f[1][0]=2*(c*u+h*r),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(u*h-c*r),f[2][0]=2*(c*h-u*r),f[2][1]=2*(u*h+c*r),f[2][2]=1-2*(c*c+u*u),a=Ha(a,f),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);n[2]&&(h[2][1]=n[2],a=Ha(a,h)),n[1]&&(h[2][1]=0,h[2][0]=n[0],a=Ha(a,h)),n[0]&&(h[2][0]=0,h[1][0]=n[0],a=Ha(a,h));for(var d=0;d<3;d++)for(var p=0;p<3;p++)a[d][p]*=e[d];return 0==(r=a)[0][2]&&0==r[0][3]&&0==r[1][2]&&0==r[1][3]&&0==r[2][0]&&0==r[2][1]&&1==r[2][2]&&0==r[2][3]&&0==r[3][2]&&1==r[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])};function Ha(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}function Va(t){return t.toFixed(6).replace(".000000","")}function Ya(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=Ga(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=Ga(n)),null===r[0]||null===i[0]?[[!1],[!0],function(t){return(t?n:e)[0].d}]:(r[0].push(0),i[0].push(1),[r,i,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e),i=(r=dn(r,-1,1),[]);if(1===r)i=t;else for(var a=Math.acos(r),o=+Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(r[0][3],i[0][3],t[5]);return Wa(t[0],t[1],t[2],e,t[4]).map(Va).join(",")}])}function qa(t){return t.replace(/[xy]/,"")}function Ua(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var Xa=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function $a(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var n=0;n<r.length;n++)!function(t){var t=r[t],e=t.t,t=t.d,n="scale"===e.substring(0,5)?1:0;i.push({t:e,d:t.map(function(t){return"number"==typeof t?ea(n):ea(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)var l=Ya(r,i),a=[l[0]],o=[l[1]],s=[["matrix",[l[2]]]];else for(var c=0;c<r.length;c++){var u=r[c].t,h=i[c].t,f=r[c].d,d=i[c].d,p=Ba[u],g=Ba[h],y=void 0;if(Xa(u,h)){var v=Ya([r[c]],[i[c]]);a.push(v[0]),o.push(v[1]),s.push(["matrix",[v[2]]])}else{if(u===h)y=u;else if(p[2]&&g[2]&&qa(u)===qa(h))y=qa(u),f=p[2](f),d=g[2](d);else{if(!p[1]||!g[1]||Ua(u)!==Ua(h)){v=Ya(r,i);a=[v[0]],o=[v[1]],s=[["matrix",[v[2]]]];break}y=Ua(u),f=p[1](f),d=g[1](d)}for(var m=[],b=[],x=[],w=0;w<f.length;w++){var k=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=Fi(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=wi(t.unit)):(Bi.isLength(t.unit)||Bi.isLength(e.unit))&&(o=xa(t,i,n),s=xa(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(f[w],d[w],t,!1,w);m[w]=k[0],b[w]=k[1],x.push(k[2])}a.push(m),o.push(b),s.push([y,x])}}return e&&(l=a,a=o,o=l),[a,o,function(t){return t.map(function(t,n){t=t.map(function(t,e){return s[n][1][e](t)}).join(",");return"matrix"===s[n][0]&&16===t.split(",").length&&(s[n][0]="matrix3d"),"matrix3d"===s[n][0]&&6===t.split(",").length&&(s[n][0]="matrix"),s[n][0]+"("+t+")"}).join(" ")}]}var Ka=Vr(function(t){var e;return fn(t)?"text-anchor"===t?[ea(0,"px"),ea(0,"px")]:(1===(e=t.split(" ")).length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[ya(Za(e[0])),ya(Za(e[1]))]):[ea(t[0]||0,"px"),ea(t[1]||0,"px")]});function Za(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var n=function(){function t(){this.parser=va,this.mixer=Sa}return t.prototype.calculator=function(t,e,n,r){return ma(n)},t}(),e=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ai&&(n=null),O.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&O.sceneGraphService.dirtifyToRoot(t)}),n},t}(),r=function(){function t(){this.parser=fa,this.mixer=da}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ai?"none"===n.value?Ji:Qi:n},t}(),Ja=function(){function t(){this.parser=Ea}return t.prototype.calculator=function(t,e,n){return n instanceof Ai?[]:n},t}();function Qa(t){t=t.parsedStyle.fontSize;return _(t)?null:t}function to(){this.parser=Ka}var eo=function(){function t(){this.parser=ya,this.mixer=Sa}return t.prototype.calculator=function(t,e,n,r,i){if(!Bi.isRelativeUnit(n.unit))return n.value;if(n.unit===g.kPercentage)return 0;if(n.unit===g.kEms){if(r.parentNode){var a=Qa(r.parentNode);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}if(n.unit===g.kRems){if(null!=r&&null!=(a=r.ownerDocument)&&a.documentElement){a=Qa(r.ownerDocument.documentElement);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}},t}(),a=function(){function t(){this.mixer=Aa}var e=t.prototype;return e.parser=function(t){t=ba(pn(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},e.calculator=function(t,e,n){return n.map(function(t){return t.value})},t}(),no=function(){function t(){this.mixer=Aa}var e=t.prototype;return e.parser=function(t){t=ba(pn(t)?[t]:t),t=1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]];return t},e.calculator=function(t,e,n){return n.map(function(t){return t.value})},t}(),ro=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.postProcessor=function(t){var e,n,r;switch(t.nodeName){case E.CIRCLE:case E.ELLIPSE:var i=t.parsedStyle,a=i.cx,i=i.cy;_(a)||(l=a),_(i)||(c=i);break;case E.LINE:var a=t.parsedStyle,i=a.x1,o=a.x2,s=a.y1,a=a.y2,l=Math.min(i,o),c=Math.min(s,a),u=0;break;case E.RECT:case E.IMAGE:case E.GROUP:case E.HTML:case E.TEXT:case E.MESH:_(t.parsedStyle.x)||(l=t.parsedStyle.x),_(t.parsedStyle.y)||(c=t.parsedStyle.y)}t.nodeName!==E.PATH&&t.nodeName!==E.POLYLINE&&t.nodeName!==E.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),_(l)&&_(c)&&_(u)||(e=(r=t.getLocalPosition())[0],n=r[1],r=r[2],t.setLocalPosition(_(l)?e:l,_(c)?n:c,_(u)?r:u))},e}(eo),io=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n=null==(n=n=n instanceof Ai?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n},t}(),ao=function(){function t(){this.mixer=Sa,this.parser=Oa}return t.prototype.calculator=function(t,e,n){return n.value},t}(),oo=function(){function t(){this.parser=Oa,this.mixer=_a(0,1)}var e=t.prototype;return e.calculator=function(t,e,n){return n.value},e.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==E.LINE&&e!==E.PATH&&e!==E.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))},t}(),so=function(){function t(){this.parser=Oa,this.mixer=_a(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),lo=function(){function t(){this.parser=La,this.mixer=Ca}var e=t.prototype;return e.calculator=function(t,e,n){return n instanceof Ai&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Hr(0,0,0,0)}:n},e.postProcessor=function(t){var e,n;t.nodeName===E.PATH&&(e=(n=t.parsedStyle).defX,n=n.defY,t.setLocalPosition(void 0===e?0:e,void 0===n?0:n))},t}(),co=function(){function t(){this.parser=Na}return t.prototype.postProcessor=function(t){var e,n;t.nodeName!==E.POLYGON&&t.nodeName!==E.POLYLINE||(e=(n=t.parsedStyle).defX,n=n.defY,t.setLocalPosition(e,n))},t}(),uo=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).mixer=_a(0,1/0),t}return s(t,i),t}(eo),o=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Ai?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),ho=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i,a=r.getAttribute("text");return a&&(i=a,"capitalize"===n.value?i=a.charAt(0).toUpperCase()+a.slice(1):"lowercase"===n.value?i=a.toLowerCase():"uppercase"===n.value&&(i=a.toUpperCase()),r.parsedStyle.text=i),n.value},t}(),fo=function(){function t(){this.parser=Ia,this.mixer=$a}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Ai?[]:n},e.postProcessor=function(t){xs(t.parsedStyle.transform,t)},t}(),po=function(){function t(){this.parser=Oa}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){var e;t.parentNode&&(e=(t=t.parentNode).renderable,t=t.sortable,e&&(e.dirty=!0),t)&&(t.dirty=!0)},t}(),go=function(){function t(){this.registry={},this.define(E.CIRCLE,Bo),this.define(E.ELLIPSE,Ho),this.define(E.RECT,as),this.define(E.IMAGE,$o),this.define(E.LINE,Zo),this.define(E.GROUP,Yo),this.define(E.PATH,Qo),this.define(E.POLYGON,es),this.define(E.POLYLINE,rs),this.define(E.TEXT,ss),this.define(E.HTML,Uo)}var e=t.prototype;return e.define=function(t,e){this.registry[t]=e},e.get=function(t){return this.registry[t]},t}();var yo,w,vo=function(){function e(t){this.type=void 0,this.eventPhase=e.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Wr,this.page=new Wr,this.canvas=new Wr,this.viewport=new Wr,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}var t=e.prototype;return t.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},t.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.stopPropagation=function(){this.propagationStopped=!0},t.initEvent=function(){},t.initUIEvent=function(){},t.clone=function(){throw new Error(oi)},fi(e,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),e}(),mo=function(r){function t(t,e){var n=r.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(yi(n),e),n}return s(t,r),t}(vo),bo=function(){function t(){this.emitter=new Ir}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r,i,a,o=vn(n)&&n||on(n)&&n.capture,n=on(n)&&n.once,s=Xr(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=t.split(":"))[0],t=r[1],c=i,l=!0),t=o?t+"capture":t,e=Xr(e)?e:e.handleEvent,l&&(a=e,e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(null==(t=n[0].target)?void 0:t.name)===c&&a.apply(void 0,n)}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,n=vn(n)&&n||on(n)&&n.capture,i=Xr(e)?void 0:e;return e=Xr(e)?e:null==(r=e)?void 0:r.handleEvent,this.emitter.off(t=n?t+"capture":t,e,i),this},e.emit=function(t,e){this.dispatchEvent(new mo(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(n=this.document?this:this.defaultView||(null==(n=this.ownerDocument)?void 0:n.defaultView)){if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null!=(n=t.manager)&&n.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),xo=function(i){function d(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}s(d,i),d.isNode=function(t){return!!t.childNodes};var t=d.prototype;return t.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},t.hasChildNodes=function(){return 0<this.childNodes.length},t.isDefaultNamespace=function(t){throw new Error(oi)},t.lookupNamespaceURI=function(t){throw new Error(oi)},t.lookupPrefix=function(t){throw new Error(oi)},t.normalize=function(){throw new Error(oi)},t.isEqualNode=function(t){return this===t},t.isSameNode=function(t){return this.isEqualNode(t)},t.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof d))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=[i=t],n=[a=this];null!=(r=i.parentNode)?r:a.parentNode;)var r,i=i.parentNode?(e.push(i.parentNode),i.parentNode):i,a=a.parentNode?(n.push(a.parentNode),a.parentNode):a;if(i!==a)return d.DOCUMENT_POSITION_DISCONNECTED|d.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|d.DOCUMENT_POSITION_PRECEDING;var o=n.length<e.length?e:n,s=o===e?n:e;if(o[o.length-s.length]===s[0])return o===e?d.DOCUMENT_POSITION_CONTAINED_BY|d.DOCUMENT_POSITION_FOLLOWING:d.DOCUMENT_POSITION_CONTAINS|d.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?s===e?d.DOCUMENT_POSITION_PRECEDING:d.DOCUMENT_POSITION_FOLLOWING:o===e?d.DOCUMENT_POSITION_PRECEDING:d.DOCUMENT_POSITION_FOLLOWING}return d.DOCUMENT_POSITION_FOLLOWING},t.contain=function(t){return this.contains(t)},t.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},t.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},t.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},fi(d,[{key:"textContent",get:function(){var t="";this.nodeName===E.TEXT&&(t+=this.style.text);for(var e=mi(this.childNodes);!(n=e()).done;){var n=n.value;n.nodeName===E.TEXT?t+=n.nodeValue:t+=n.textContent}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===E.TEXT&&(this.style.text=""+t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return 0<this.childNodes.length?this.childNodes[0]:null}},{key:"lastChild",get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null}}]),d}(bo),wo=(xo.DOCUMENT_POSITION_DISCONNECTED=1,xo.DOCUMENT_POSITION_PRECEDING=2,xo.DOCUMENT_POSITION_FOLLOWING=4,xo.DOCUMENT_POSITION_CONTAINS=8,xo.DOCUMENT_POSITION_CONTAINED_BY=16,xo.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,function(e){function t(){var t=e.call(this)||this;t.defaultView=null,t.documentElement=void 0,t.timeline=void 0,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new O.AnimationTimeline(yi(t))}catch(t){}var r={};return Gl.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=Xr(t)?t(E.GROUP):t)}),t.documentElement=new Yo({id:"g-root",style:r}),t.documentElement.ownerDocument=yi(t),t.documentElement.parentNode=yi(t),t.childNodes=[t.documentElement],t}s(t,e);var n=t.prototype;return n.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?ss:Yo),(t=new n(e)).ownerDocument=this,t)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error(oi)},n.destroy=function(){try{this.documentElement.childNodes.slice().forEach(function(t){t.forEach(function(t){t.destroy()},!0)}),this.timeline.destroy()}catch(t){}},n.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.id,t=O.displayObjectPool.getByEntity(t),e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},n.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},n.elementFromPoint=function(){var n=ui(M().mark(function t(e,n){var r,i,a,o,s,l;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,i=i.y,o=this.defaultView.getConfig(),a=o.width,o=o.height,r<0||i<0||a<r||o<i)return t.abrupt("return",null);t.next=4;break;case 4:return a=this.defaultView.viewport2Client({x:r,y:i}),o=a.x,s=a.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:i,clientX:o,clientY:s},picked:[]});case 7:return s=t.sent,l=s.picked,t.abrupt("return",l&&l[0]||this.documentElement);case 10:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}(),n.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},n.elementsFromPoint=function(){var n=ui(M().mark(function t(e,n){var r,i,a,o,s,l;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,i=i.y,o=this.defaultView.getConfig(),a=o.width,o=o.height,r<0||i<0||a<r||o<i)return t.abrupt("return",[]);t.next=4;break;case 4:return a=this.defaultView.viewport2Client({x:r,y:i}),o=a.x,s=a.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:i,clientX:o,clientY:s},picked:[]});case 7:return s=t.sent,(l=s.picked)[l.length-1]!==this.documentElement&&l.push(this.documentElement),t.abrupt("return",l);case 11:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error(si)},n.insertBefore=function(t,e){throw new Error(si)},n.removeChild=function(t,e){throw new Error(si)},n.replaceChild=function(t,e,n){throw new Error(si)},n.append=function(){throw new Error(si)},n.prepend=function(){throw new Error(si)},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},fi(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),t}(xo)),ko=(yo=yo||{},yo[yo.Standard=0]="Standard",(l=w=w||{}).DESTROY="destroy",l.ATTR_MODIFIED="DOMAttrModified",l.INSERTED="DOMNodeInserted",l.REMOVED="removed",l.MOUNTED="DOMNodeInsertedIntoDocument",l.UNMOUNTED="DOMNodeRemovedFromDocument",l.BOUNDS_CHANGED="bounds-changed",l.RENDER_ORDER_CHANGED="render-order-changed",l.CULLED="culled",function(c){function t(t,e,n,r,i,a,o,s){var l=c.call(this,null)||this;return l.relatedNode=void 0,l.prevValue=void 0,l.newValue=void 0,l.attrName=void 0,l.attrChange=void 0,l.prevParsedValue=void 0,l.newParsedValue=void 0,l.relatedNode=e,l.prevValue=n,l.newValue=r,l.attrName=i,l.attrChange=a,l.prevParsedValue=o,l.newParsedValue=s,l.type=t,l}return s(t,c),t}(vo)),Eo=(ko.ADDITION=2,ko.MODIFICATION=1,ko.REMOVAL=3,0),Mo=new ko(w.INSERTED,null,"","","",0,"",""),Oo=new ko(w.REMOVED,null,"","","",0,"",""),So=new mo(w.DESTROY),_o=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).entity=Eo++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:yo.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:k(0,0,0),localRotation:le(0,0,0,1),localScale:k(1,1,1),localTransform:ht(),localSkew:fe(0,0),position:k(0,0,0),rotation:le(0,0,0,1),scaling:k(1,1,1),worldTransform:ht(),origin:k(0,0,0)},t.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},t.geometry={contentBounds:void 0,renderBounds:void 0},t.rBushNode={aabb:void 0},t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={anchor:Ki,opacity:Ki,fillOpacity:Ki,strokeOpacity:Ki,fill:Ki,stroke:Ki,transform:Ki,transformOrigin:Ki,visibility:Ki,pointerEvents:Ki,lineWidth:Ki,lineCap:Ki,lineJoin:Ki,increasedLineWidthForHitTesting:Ki,fontSize:Ki,fontFamily:Ki,fontStyle:Ki,fontWeight:Ki,fontVariant:Ki,textAlign:Ki,textBaseline:Ki,textTransform:Ki,zIndex:Ki,filter:Ki,shadowType:Ki},t.parsedStyle={},t.attributes={},t}s(t,i),t.isElement=function(t){return!!t.getAttribute};var e=t.prototype;return e.cloneNode=function(t){throw new Error(oi)},e.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return O.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Mo.relatedNode=this,t.dispatchEvent(Mo),t},e.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},e.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.removeChild=function(t){var e;return Oo.relatedNode=this,t.dispatchEvent(Oo),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),O.sceneGraphService.detach(t),t},e.removeChildren=function(){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)})},e.destroyChildren=function(){this.childNodes.slice().forEach(function(t){t.destroyChildren(),t.destroy()})},e.matches=function(t){return O.sceneGraphService.matches(t,this)},e.getElementById=function(t){return O.sceneGraphService.querySelector("#"+t,this)},e.getElementsByName=function(t){return O.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},e.getElementsByClassName=function(t){return O.sceneGraphService.querySelectorAll("."+t,this)},e.getElementsByTagName=function(t){return O.sceneGraphService.querySelectorAll(t,this)},e.querySelector=function(t){return O.sceneGraphService.querySelector(t,this)},e.querySelectorAll=function(t){return O.sceneGraphService.querySelectorAll(t,this)},e.closest=function(t){var e=this;do{if(O.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},e.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},e.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},e.after=function(){var r=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(t,e){var n;return null==(n=r.parentNode)?void 0:n.appendChild(t,i+e+1)})}},e.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,a)}},e.replaceWith=function(){this.after.apply(this,arguments),this.remove()},e.append=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach(function(t){return e.appendChild(t)})},e.prepend=function(){for(var n=this,t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t,e){return n.appendChild(t,e)})},e.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},e.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.destroy=function(){this.dispatchEvent(So),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.getGeometryBounds=function(){return O.sceneGraphService.getGeometryBounds(this)},e.getRenderBounds=function(){return O.sceneGraphService.getBounds(this,!0)},e.getBounds=function(){return O.sceneGraphService.getBounds(this)},e.getLocalBounds=function(){return O.sceneGraphService.getLocalBounds(this)},e.getBoundingClientRect=function(){return O.sceneGraphService.getBoundingClientRect(this)},e.getClientRects=function(){return[this.getBoundingClientRect()]},e.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.getAttributeNames=function(){return Object.keys(this.attributes)},e.getAttribute=function(t){var e;return"symbol"==typeof t||void 0===(e=this.attributes[t])&&(t=Kr(t),e=this.attributes[t],_(e))?null:e},e.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.hasAttributes=function(){return!!this.getAttributeNames().length},e.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.setAttribute=function(t,e,n){this.attributes[t]=e},e.getAttributeNS=function(t,e){throw new Error(oi)},e.getAttributeNode=function(t){throw new Error(oi)},e.getAttributeNodeNS=function(t,e){throw new Error(oi)},e.hasAttributeNS=function(t,e){throw new Error(oi)},e.removeAttributeNS=function(t,e){throw new Error(oi)},e.removeAttributeNode=function(t){throw new Error(oi)},e.setAttributeNS=function(t,e,n){throw new Error(oi)},e.setAttributeNode=function(t){throw new Error(oi)},e.setAttributeNodeNS=function(t){throw new Error(oi)},e.toggleAttribute=function(t,e){throw new Error(oi)},fi(t,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null}},{key:"previousSibling",get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null}}]),t}(xo),l=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).altKey=void 0,t.button=void 0,t.buttons=void 0,t.ctrlKey=void 0,t.metaKey=void 0,t.relatedTarget=void 0,t.shiftKey=void 0,t.client=new Wr,t.movement=new Wr,t.offset=new Wr,t.global=new Wr,t.screen=new Wr,t}s(t,i);var e=t.prototype;return e.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.initMouseEvent=function(){throw new Error(oi)},fi(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),t}(vo),Ao=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).pointerId=void 0,t.width=0,t.height=0,t.isPrimary=!1,t.pointerType=void 0,t.pressure=void 0,t.tangentialPressure=void 0,t.tiltX=void 0,t.tiltY=void 0,t.twist=void 0,t}s(t,i);var e=t.prototype;return e.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.clone=function(){return this.manager.clonePointerEvent(this)},t}(l),To=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).deltaMode=void 0,t.deltaX=void 0,t.deltaY=void 0,t.deltaZ=void 0,t.DOM_DELTA_LINE=0,t.DOM_DELTA_PAGE=1,t.DOM_DELTA_PIXEL=2,t}return s(t,i),t.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},t}(l);function Po(t){return null!=t&&t.nodeName}var Lo=new ko(w.ATTR_MODIFIED,null,null,null,null,ko.MODIFICATION,null,null),Co={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},No={anchor:[0,0],fill:Ji,stroke:Ji,transform:[],zIndex:0,filter:[],shadowType:"outer"},jo=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),Ro=function(i){function t(t){var r=i.call(this)||this;return r.config=void 0,r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=t,r.config.interactive=null!=(t=r.config.capture)?t:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||E.GROUP,r.config.style=di({},r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,No,r.config.initialParsedStyle),Object.assign(r.attributes,Co),r.initAttributes(r.config.style),r.style=new Proxy({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}}),O.displayObjectPool.add(r.entity,yi(r)),r}s(t,i);var e=t.prototype;return e.destroy=function(){i.prototype.destroy.call(this),O.displayObjectPool.remove(this.entity),this.getAnimations().forEach(function(t){t.cancel()})},e.cloneNode=function(e,t){var n,r=di({},this.attributes);for(n in r){var i=r[n];Po(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},e.initAttributes=function(t){var e=this.renderable;O.styleValueRegistry.processProperties(this,t=void 0===t?{}:t,{forceUpdateGeometry:!0,usedAttributes:jo}),e.dirty=!0},e.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=Kr(t);mn(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),i.prototype.setAttribute.call(this,t,e))},e.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(O.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Lo.relatedNode=this,Lo.prevValue=i,Lo.newValue=e,Lo.attrName=t,Lo.prevParsedValue=a,Lo.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Lo):(Lo.target=this).ownerDocument.defaultView.dispatchEvent(Lo,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},e.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],e=e[1],t=t.getMax(),r=t[0],t=t[1];return new Hr(n,e,r-n,t-e)},e.setOrigin=function(t,e,n){return O.sceneGraphService.setOrigin(this,cs(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getOrigin=function(){return O.sceneGraphService.getOrigin(this)},e.setPosition=function(t,e,n){return O.sceneGraphService.setPosition(this,cs(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.setLocalPosition=function(t,e,n){return O.sceneGraphService.setLocalPosition(this,cs(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translate=function(t,e,n){return O.sceneGraphService.translate(this,cs(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translateLocal=function(t,e,n){return O.sceneGraphService.translateLocal(this,cs(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getPosition=function(){return O.sceneGraphService.getPosition(this)},e.getLocalPosition=function(){return O.sceneGraphService.getLocalPosition(this)},e.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=cs(t,e=e||t,n=n||t)),O.sceneGraphService.scaleLocal(this,t),this},e.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=cs(t,e=e||t,n=n||t)),O.sceneGraphService.setLocalScale(this,t),this},e.getLocalScale=function(){return O.sceneGraphService.getLocalScale(this)},e.getScale=function(){return O.sceneGraphService.getScale(this)},e.getEulerAngles=function(){return hs(fs(v(),O.sceneGraphService.getWorldTransform(this))[2])},e.getLocalEulerAngles=function(){return hs(fs(v(),O.sceneGraphService.getLocalRotation(this))[2])},e.setEulerAngles=function(t){return O.sceneGraphService.setEulerAngles(this,0,0,t),this},e.setLocalEulerAngles=function(t){return O.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.rotateLocal=function(t,e,n){return _(e)&&_(n)?O.sceneGraphService.rotateLocal(this,0,0,t):O.sceneGraphService.rotateLocal(this,t,e,n),this},e.rotate=function(t,e,n){return _(e)&&_(n)?O.sceneGraphService.rotate(this,0,0,t):O.sceneGraphService.rotate(this,t,e,n),this},e.setRotation=function(t,e,n,r){return O.sceneGraphService.setRotation(this,t,e,n,r),this},e.setLocalRotation=function(t,e,n,r){return O.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.setLocalSkew=function(t,e){return O.sceneGraphService.setLocalSkew(this,t,e),this},e.getRotation=function(){return O.sceneGraphService.getRotation(this)},e.getLocalRotation=function(){return O.sceneGraphService.getLocalRotation(this)},e.getLocalSkew=function(){return O.sceneGraphService.getLocalSkew(this)},e.getLocalTransform=function(){return O.sceneGraphService.getLocalTransform(this)},e.getWorldTransform=function(){return O.sceneGraphService.getWorldTransform(this)},e.setLocalTransform=function(t){return O.sceneGraphService.setLocalTransform(this,t),this},e.resetLocalTransform=function(){O.sceneGraphService.resetLocalTransform(this)},e.getAnimations=function(){return this.activeAnimations},e.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},e.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},e.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},e.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map(function(t){return Number(t.style.zIndex)}))+1),this},e.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map(function(t){return Number(t.style.zIndex)}))-1),this},e.getConfig=function(){return this.config},e.attr=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?on(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes},e.getMatrix=function(t){var t=t||this.getWorldTransform(),e=_t(v(),t),n=e[0],e=e[1],r=At(v(),t),i=r[0],r=r[1],t=Tt(re(),t),t=fs(v(),t),a=t[0],t=t[2],o=(a=a||t,t=n,n=e,e=i,i=r,r=Math.cos(a),a=Math.sin(a),e*r),s=i*a,l=0,e=-e*a,a=i*r,i=0,r=t,t=n,n=1,c=new lt(9);return c[0]=o,c[1]=s,c[2]=l,c[3]=e,c[4]=a,c[5]=i,c[6]=r,c[7]=t,c[8]=n,c},e.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.setMatrix=function(t){var t=ds(t),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},e.setLocalMatrix=function(t){var t=ds(t),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},e.show=function(){this.style.visibility="visible"},e.hide=function(){this.style.visibility="hidden"},e.getCount=function(){return this.childElementCount},e.getParent=function(){return this.parentElement},e.getChildren=function(){return this.children},e.getFirst=function(){return this.firstElementChild},e.getLast=function(){return this.lastElementChild},e.getChildByIndex=function(t){return this.children[t]||null},e.add=function(t,e){return this.appendChild(t,e)},e.setClip=function(t){this.style.clipPath=t},e.set=function(t,e){this.config[t]=e},e.get=function(t){return this.config[t]},e.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},e.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},e.setZIndex=function(t){return this.style.zIndex=t,this},fi(t,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),t}(_o),Fo=["style"],Bo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,Fo);return n.call(this,di({type:E.CIRCLE,style:di({cx:"",cy:"",r:""},e),initialParsedStyle:{anchor:[.5,.5]}},t))||this}return s(t,n),t}(Ro),Io=["style"],Do=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,Io),e=n.call(this,di({style:di({x:"",y:""},e)},t))||this;return e.isCustomElement=!0,e}return s(t,n),t}(Ro),zo={},Go=[],l=function(){function t(){}var e=t.prototype;return e.getByEntity=function(t){return zo[t]},e.getAll=function(){return Object.keys(zo).map(function(t){return zo[t]})},e.add=function(t,e){(zo[t]=e).nodeName===E.HTML&&Go.push(e)},e.remove=function(t){var e=zo[t];e&&(delete zo[t],e.nodeName===E.HTML)&&(t=Go.indexOf(e),Go.splice(t,1))},e.getHTMLs=function(){return Go},t}(),Wo=["style"],Ho=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,Wo);return n.call(this,di({type:E.ELLIPSE,style:di({cx:"",cy:"",rx:"",ry:""},e),initialParsedStyle:{anchor:[.5,.5]}},t))||this}return s(t,n),t}(Ro),Vo=["style"],Yo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,Vo);return n.call(this,di({type:E.GROUP,style:di({x:"",y:"",width:"",height:""},e)},t))||this}return s(t,n),t}(Ro),qo=["style"],Uo=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,qo),e=n.call(this,di({type:E.HTML,style:di({x:"",y:"",width:"auto",height:"auto",innerHTML:""},e)},t))||this;return e.cullable.enable=!1,e}s(t,n);var e=t.prototype;return e.getDomElement=function(){return this.parsedStyle.$el},e.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},e.getClientRects=function(){return[this.getBoundingClientRect()]},e.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null==(r=this.ownerDocument)||null==(r=r.defaultView)?void 0:r.getContextService().getBoundingClientRect();return r?(t=n.left-r.left,r=n.top-r.top,(e=new Dr).setMinMax(k(t,r,0),k(t+n.width,r+n.height,0)),e):null},e.getLocalBounds=function(){if(this.parentNode){var t,e=vt(ht(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Dr.isEmpty(n))return(t=new Dr).setFromTransformedAABB(n,e),t}return this.getBounds()},t}(Ro),Xo=["style"],$o=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,Xo);return n.call(this,di({type:E.IMAGE,style:di({x:"",y:"",img:"",width:"",height:""},e)},t))||this}return s(t,n),t}(Ro),Ko=["style"],Zo=function(r){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,Ko),e=r.call(this,di({type:E.LINE,style:di({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},e)},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),n=t.markerStart,t=t.markerEnd;return n&&Po(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Po(t)&&(e.markerEndAngle=t.getLocalEulerAngles(),e.appendChild(t)),e.transformMarker(!0),e.transformMarker(!1),e}s(t,r);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Po(r)&&(this.markerStartAngle=0,r.remove()),i&&Po(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Po(r)&&(this.markerEndAngle=0,r.remove()),i)&&Po(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&Po(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},e.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=sr.pointAt(r,i,a,o,t),i=r.x,a=r.y,o=$t(v(),k(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new Wr(o[0],o[1])},e.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.getTotalLength=function(){var t=this.parsedStyle,e=t.x1,n=t.y1,r=t.x2,t=t.y2;return sr.length(e,n,r,t)},t}(Ro),Jo=["style"],Qo=function(i){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,Jo),e=i.call(this,di({type:E.PATH,style:di({path:"",miterLimit:""},e)},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),n=t.markerStart,r=t.markerEnd,t=t.markerMid;return n&&Po(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Po(t)&&e.placeMarkerMid(t),r&&Po(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}s(t,i);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Po(r)&&(this.markerStartAngle=0,r.remove()),i&&Po(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Po(r)&&(this.markerEndAngle=0,r.remove()),i&&Po(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.defX,o=o.defY,s=t?s:l;s&&Po(s)&&(l=0,h=t?(i=(t=this.getStartTangent())[0],e=(t=t[1])[0]-h,n=t[1]-o,r=i[0]-t[0],i=i[1]-t[1],a=c||0,this.markerStartAngle):(c=(t=this.getEndTangent())[0],e=(t=t[1])[0]-h,n=t[1]-o,r=c[0]-t[0],i=c[1]-t[1],a=u||0,this.markerEndAngle),l=Math.atan2(i,r),s.setLocalEulerAngles(180*l/Math.PI+h),s.setLocalPosition(e+Math.cos(l)*a,n+Math.sin(l)*a))},e.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Po(t))for(var a=1;a<n.length-1;a++){var o=n[a].currentPoint,s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},e.getTotalLength=function(){return Vs(this)},e.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Ze(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=$t(v(),k(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Wr(n[0],n[1])},e.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Vs(this),e)},e.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},e.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i},t}(Ro),ts=["style"],es=function(i){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,ts),e=i.call(this,di({type:E.POLYGON,style:di({points:"",miterLimit:"",isClosed:!0},e)},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),n=t.markerStart,r=t.markerEnd,t=t.markerMid;return n&&Po(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Po(t)&&e.placeMarkerMid(t),r&&Po(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}s(t,i);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Po(r)&&(this.markerStartAngle=0,r.remove()),i&&Po(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Po(r)&&(this.markerEndAngle=0,r.remove()),i&&Po(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&Po(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.style.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},e.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Po(t))for(var a=1;a<(this.style.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}},t}(Ro),ns=["style"],rs=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,ns);return n.call(this,di({type:E.POLYLINE,style:di({points:"",miterLimit:"",isClosed:!1},e)},t))||this}s(t,n);var e=t.prototype;return e.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),sr.pointAt(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=$t(v(),k(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new Wr(a[0],a[1])},e.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},t}(es),is=["style"],as=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,is);return n.call(this,di({type:E.RECT,style:di({x:"",y:"",width:"",height:"",radius:""},e)},t))||this}return s(t,n),t}(Ro),os=["style"],ss=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=gi(t,os);return n.call(this,di({type:E.TEXT,style:di({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},e)},t))||this}s(t,n);var e=t.prototype;return e.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},e.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},e.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},t}(Ro);function ls(t){return void 0===t?0:360<t||t<-360?t%360:t}function cs(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),pn(t)?k(t,e,n):Array.isArray(t)&&3===t.length?It(t):k(t[0],t[1]||e,t[2]||n)}function us(t){return t*(Math.PI/180)}function hs(t){return t*(180/Math.PI)}function fs(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=At(v(),r))[0],l=c[1],c=c[2],(u=Math.asin(-r[2]/s))<o?-o<u?(i=Math.atan2(r[6]/l,r[10]/c),a=Math.atan2(r[1]/s,r[0]/s)):(a=0,i=-Math.atan2(r[4]/l,r[5]/l)):(a=0,i=Math.atan2(r[4]/l,r[5]/l)),n[0]=i,n[1]=u,n[2]=a,n):(o=t,s=(c=e)[0],r=c[1],l=c[2],c=c[3],.499995*(n=s*s+(i=r*r)+(u=l*l)+(a=c*c))<(t=s*c-r*l)?(o[0]=Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):t<-.499995*n?(o[0]=-Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):(o[0]=Math.asin(2*(s*l-c*r)),o[1]=Math.atan2(2*(s*c+r*l),1-2*(u+a)),o[2]=Math.atan2(2*(s*r+l*c),1-2*(i+u))),o);var n,r,i,a,o,s,l,c,u}function ds(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?a=-a:o=-o),a&&(e*=1/a,n*=1/a);r=hs(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var ps=ht(),gs=ht(),ys=ee(),d=[v(),v(),v()],vs=v();function ms(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var bs=ht();function xs(t,l){var c,u;return t&&t.length&&(u=c=0,l?(c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0,l.resetLocalTransform(),l.setLocalPosition(c,u)):l=new Ro({}),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?(o=t||[qi,qi],l.translateLocal(o[0].value,o[1].value,0)):"translatex"===s?(o=t||[qi],l.translateLocal(o[0].value,0,0)):"translatey"===s?(o=t||[qi],l.translateLocal(0,o[0].value,0)):"translatez"===s?(o=t||[qi],l.translateLocal(0,0,o[0].value)):"translate3d"===s?(o=t||[qi,qi,qi],l.translateLocal(o[0].value,o[1].value,o[2].value)):"rotate"===s?(o=t||[Ui],l.rotateLocal(0,0,o[0].value)):"rotatex"===s?(o=t||[Ui],l.rotateLocal(o[0].value,0,0)):"rotatey"===s?(o=t||[Ui],l.rotateLocal(0,o[0].value,0)):"rotatez"===s?(o=t||[Ui],l.rotateLocal(0,0,o[0].value)):"rotate3d"!==s&&("skew"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(us(o[0]),us(o[1]))):"skewx"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(us(o[0]),l.getLocalSkew()[1])):"skewy"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],us(o[0]))):"matrix"===s?(e=(o=t.map(function(t){return t.value}))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(pt(bs,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(pt.apply(Bt,[bs].concat(t.map(function(t){return t.value}))),bs[12]+=c,bs[13]+=u,l.setLocalTransform(bs)))})),l.getLocalTransform()}ws={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},ks="";var ws,ks,Es=function(t){return ks=t,Os()};function Ms(t){throw new Error(ks+": "+t)}function Os(){var t=Rs(Ss);return 0<ks.length&&Ms("Invalid input not EOF"),t}function Ss(){return _s("linear-gradient",ws.linearGradient,Ts)||_s("repeating-linear-gradient",ws.repeatingLinearGradient,Ts)||_s("radial-gradient",ws.radialGradient,Ps)||_s("repeating-radial-gradient",ws.repeatingRadialGradient,Ps)||_s("conic-gradient",ws.conicGradient,Ps)}function _s(n,t,r){return As(t,function(t){var e=r();return e&&!Ws(ws.comma)&&Ms("Missing comma before color stops"),{type:n,orientation:e,colorStops:Rs(Fs)}})}function As(t,e){t=Ws(t);if(t)return Ws(ws.startCall)||Ms("Missing ("),e=e(t),Ws(ws.endCall)||Ms("Missing )"),e}function Ts(){return Gs("directional",ws.sideOrCorner,1)||Gs("angular",ws.angleValue,1)}function Ps(){var t,e,n=Ls();return n&&((t=[]).push(n),e=ks,Ws(ws.comma))&&((n=Ls())?t.push(n):ks=e),t}function Ls(){var t,e=function(){var t=Gs("shape",/^(circle)/i,0);t&&(t.style=zs()||Cs());return t}()||function(){var t=Gs("shape",/^(ellipse)/i,0);t&&(t.style=Is()||Cs());return t}();return e?e.at=Ns():(t=Cs())?(e=t,(t=Ns())&&(e.at=t)):(t=js())&&(e={type:"default-radial",at:t}),e}function Cs(){return Gs("extent-keyword",ws.extentKeywords,1)}function Ns(){var t;if(Gs("position",/^at/,0))return(t=js())||Ms("Missing positioning value"),t}function js(){var t={x:Is(),y:Is()};if(t.x||t.y)return{type:"position",value:t}}function Rs(t){var e=t(),n=[];if(e)for(n.push(e);Ws(ws.comma);)(e=t())?n.push(e):Ms("One extra comma");return n}function Fs(){var t=Gs("hex",ws.hexColor,1)||As(ws.rgbaColor,function(){return{type:"rgba",value:Rs(Bs)}})||As(ws.rgbColor,function(){return{type:"rgb",value:Rs(Bs)}})||Gs("literal",ws.literalColor,0);return t||Ms("Expected color definition"),t.length=Is(),t}function Bs(){return Ws(ws.number)[1]}function Is(){return Gs("%",ws.percentageValue,1)||Ds()||zs()}function Ds(){return Gs("position-keyword",ws.positionKeywords,1)}function zs(){return Gs("px",ws.pixelValue,1)||Gs("em",ws.emValue,1)}function Gs(t,e,n){e=Ws(e);if(e)return{type:t,value:e[n]}}function Ws(t){var e=/^[\n\r\t\s]+/.exec(ks),e=(e&&Hs(e[0].length),t.exec(ks));return e&&Hs(e[0].length),e}function Hs(t){ks=ks.substring(t)}function Vs(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Ze(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Ys(t,e){return t[0]===e[0]&&t[1]===e[1]}function qs(t,e){var n,r=t.prePoint,i=t.currentPoint,t=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),o=Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2),r=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),r=Math.acos((a+o-r)/(2*Math.sqrt(a)*Math.sqrt(o)));return!r||0===Math.sin(r)||(void(a=0)===n&&(n=1e-5),Math.abs(r-a)<n)?{xExtra:0,yExtra:0}:(o=Math.abs(Math.atan2(t[1]-i[1],t[0]-i[0])),a=Math.abs(Math.atan2(t[0]-i[0],t[1]-i[1])),o=o>Math.PI/2?Math.PI-o:o,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(r/2-o)*(e/2*(1/Math.sin(r/2)))-e/2||0,yExtra:Math.cos(a-r/2)*(e/2*(1/Math.sin(r/2)))-e/2||0})}function Us(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Xs(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=us(r=gn(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=$s({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=$s(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0<o?o-=2*Math.PI:a&&o<0&&(o+=2*Math.PI),c=l+(o%=2*Math.PI)*s,u=e*Math.cos(c),i=n*Math.sin(c),{x:Math.cos(r)*u-Math.sin(r)*i+t.x,y:Math.sin(r)*u+Math.cos(r)*i+t.y,ellipticalArcStartAngle:l,ellipticalArcEndAngle:l+o,ellipticalArcAngle:c,ellipticalArcCenter:t,resultantRx:e,resultantRy:n})}var $s=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)};function Ks(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,i=void 0===i?0:i,a=r.ry,a=void 0===a?0:a,o=r.xRotation,s=r.arcFlag,r=r.sweepFlag,l=Xs({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Xs({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),a=i.x-l.x,o=i.y-l.y,s=Math.sqrt(a*a+o*o);return{x:-a/s,y:-o/s}}function Zs(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Js(t,e){return Zs(t)*Zs(e)?(t[0]*e[0]+t[1]*e[1])/(Zs(t)*Zs(e)):1}function Qs(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Js(t,e))}function tl(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function el(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d=[];switch(t.nodeName){case E.LINE:var p=t.parsedStyle,d=[["M",p.x1,p.y1],["L",p.x2,p.y2]];break;case E.CIRCLE:var p=t.parsedStyle,g=p.r;d=tl(g,g,p.cx,p.cy);break;case E.ELLIPSE:var g=t.parsedStyle;d=tl(g.rx,g.ry,g.cx,g.cy);break;case E.POLYLINE:case E.POLYGON:p=t.parsedStyle.points;g=p.points,p=t.nodeName===E.POLYGON,g=g.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),p&&g.push(["Z"]),d=g;break;case E.RECT:var y=t.parsedStyle,v=y.width,m=y.height,b=y.x,x=y.y,y=y.radius,w=y&&y.some(function(t){return 0!==t});n=v,r=m,b=b,x=x,d=(w=w&&y.map(function(t){return dn(t,0,Math.min(Math.abs(v)/2,Math.abs(m)/2))}))?(s=(y=0<n?1:-1)+(o=0<r?1:-1)!=0?1:0,[["M",y*(i=w[0])+b,x],["L",n-y*(a=w[1])+b,x],a?["A",a,a,0,0,s,n+b,o*a+x]:null,["L",n+b,r-o*(a=w[2])+x],a?["A",a,a,0,0,s,n+b-y*a,r+x]:null,["L",b+y*(a=w[3]),r+x],a?["A",a,a,0,0,s,b,r+x-o*a]:null,["L",b,o*i+x],i?["A",i,i,0,0,s,y*i+b,x]:null,["Z"]].filter(function(t){return t})):[["M",b,x],["L",b+n,x],["L",b+n,x+r],["L",b,x+r],["Z"]];break;case E.PATH:w=t.parsedStyle.path.absolutePath;d=[].concat(w)}if(d.length)return l=d,c=e,u=(e=(e=t).parsedStyle).defX,h=void 0===u?0:u,f=void 0===(u=e.defY)?0:u,l.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=k(e[1]-h,e[2]-f,0),c&&$t(n,n,c),a=""+e[0]+n[0]+","+n[1]):"Z"===e[0]?a=e[0]:"C"===e[0]?(n=k(e[1]-h,e[2]-f,0),r=k(e[3]-h,e[4]-f,0),i=k(e[5]-h,e[6]-f,0),c&&($t(n,n,c),$t(r,r,c),$t(i,i,c)),a=""+e[0]+n[0]+","+n[1]+","+r[0]+","+r[1]+","+i[0]+","+i[1]):"A"===e[0]?(n=k(e[6]-h,e[7]-f,0),c&&$t(n,n,c),a=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+n[0]+","+n[1]):"Q"===e[0]&&(r=k(e[1]-h,e[2]-f,0),i=k(e[3]-h,e[4]-f,0),c&&($t(r,r,c),$t(i,i,c)),a=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"),t+a},"")}function nl(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}function rl(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)}function il(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)}function al(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)}function ol(t){return yl.setup(this,t),yl.create(t)}function sl(t){return ml.setup(this,t),ml.create(t)}function ll(){throw new Error("tapAsync is not supported on a SyncHook")}function cl(){throw new Error("tapPromise is not supported on a SyncHook")}function ul(t){return xl.setup(this,t),xl.create(t)}function hl(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")}function fl(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")}function dl(t){return kl.setup(this,t),kl.create(t)}var pl=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=rl,this.call=rl,this._callAsync=il,this.callAsync=il,this._promise=al,this.promise=al,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e=mi(this.interceptors);!(n=e()).done;){var n=n.value;n.register&&void 0!==(n=n.register(t))&&(t=n)}return t},e.withOptions=function(e){function n(t){return Object.assign({},e,"string"==typeof t?{name:t}:t)}var r=this;return{name:this.name,tap:function(t,e){return r.tap(n(t),e)},tapAsync:function(t,e){return r.tapAsync(n(t),e)},tapPromise:function(t,e){return r.tapPromise(n(t),e)},isUsed:function(){return r.isUsed()},withOptions:function(t){return r.withOptions(n(t))}}},e.isUsed=function(){return 0<this.taps.length||0<this.interceptors.length},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));for(var e,n=0,r=("number"==typeof t.stage&&(n=t.stage),this.taps.length);0<r;){r--;var i=this.taps[r],a=(this.taps[r+1]=i).stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(0<e.size)continue}if(!(n<a)){r++;break}}this.taps[r]=t},t}(),gl=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="",i=(i+='"use strict";\n')+this.header()+"return new Promise((function(_resolve, _reject) {\n";n&&(i+="var _sync = true;\nfunction _error(_err) {\nif(_sync)\n_resolve(Promise.resolve().then((function() { throw _err; })));\nelse\n_reject(_err);\n};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=new Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map(function(t){return t.fn})},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var r=this;if(0<this.options.interceptors.length){for(var i=t.onError,a=t.onResult,n=t.onDone,e="",o=0;o<this.options.interceptors.length;o++){var s=this.options.interceptors[o];s.call&&(e+=this.getInterceptor(o)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return e+=this.content(Object.assign(t,{onError:i&&function(t){for(var e="",n=0;n<r.options.interceptors.length;n++)r.options.interceptors[n].error&&(e+=r.getInterceptor(n)+".error("+t+");\n");return e+=i(t)},onResult:a&&function(t){for(var e="",n=0;n<r.options.interceptors.length;n++)r.options.interceptors[n].result&&(e+=r.getInterceptor(n)+".result("+t+");\n");return e+=a(t)},onDone:n&&function(){for(var t="",e=0;e<r.options.interceptors.length;e++)r.options.interceptors[e].done&&(t+=r.getInterceptor(e)+".done();\n");return t+=n()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",0<this.options.interceptors.length&&(t+="var _taps = this.taps;\nvar _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=mi(this.options.taps);!(t=e()).done;)if(t.value.context)return!0;return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,a=e.rethrowIfPossible,o="",s=!1,l=0;l<this.options.interceptors.length;l++){var c=this.options.interceptors[l];c.tap&&(s||(o+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),o+=this.getInterceptor(l)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}o+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var u=this.options.taps[t];switch(u.type){case"sync":a||(o=o+"var _hasError"+t+" = false;\ntry {\n"),o+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:u.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:u.context?"_context":void 0})+");\n",a||(o=(o=(o=o+"} catch(_err) {\n_hasError"+t+" = true;\n")+n("_err"))+"}\nif(!_hasError"+t+") {\n"),r&&(o+=r("_result"+t)),i&&(o+=i()),a||(o+="}\n");break;case"async":var h=(h=(h="")+(r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n")+("if(_err"+t+") {\n"))+n("_err"+t)+"} else {\n";r&&(h+=r("_result"+t)),i&&(h+=i()),o+="_fn"+t+"("+this.args({before:u.context?"_context":void 0,after:h=h+"}\n"+"})"})+");\n";break;case"promise":o=(o=(o=(o+="var _hasResult"+t+" = false;\n")+("var _promise"+t+" = _fn"+t+"("+this.args({before:u.context?"_context":void 0})+");\n"))+("if (!_promise"+t+" || !_promise"+t+".then)\n")+(" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n"))+("_promise"+t+".then((function(_result"+t+") {\n")+("_hasResult"+t+" = true;\n"),r&&(o+=r("_result"+t)),i&&(o+=i()),o=(o=o+("}), function(_err"+t+") {\n")+("if(_hasResult"+t+") throw _err"+t+";\n"))+n("_err"+t)+"});\n"}return o},e.callTapsSeries=function(t){var a=this,o=t.onError,s=t.onResult,e=t.resultReturns,l=t.onDone,n=t.doneReturns,c=t.rethrowIfPossible;if(0===this.options.taps.length)return l();for(var u=this.options.taps.findIndex(function(t){return"sync"!==t.type}),h=e||n,f="",d=l,p=0,r=function(t){function e(t){return t?"":l()}var n=t,r=(d!==l&&("sync"!==a.options.taps[n].type||20<p++)&&(p=0,f=(f+="function _next"+n+"() {\n")+d()+"}\n",d=function(){return(h?"return ":"")+"_next"+n+"();\n"}),d),i=a.callTap(n,{onError:function(t){return o(n,t,r,e)},onResult:s&&function(t){return s(n,t,r,e)},onDone:!s&&r,rethrowIfPossible:c&&(u<0||n<u)});d=function(){return i}},i=this.options.taps.length-1;0<=i;i--)r(i);return f+=d()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,t=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var a=this.options.taps.every(function(t){return"sync"===t.type}),r="";a||(r+="var _looper = (function() {\nvar _loopAsync = false;\n");for(var r=(r+="var _loop;\n")+"do {\n"+"_loop = false;\n",i=0;i<this.options.interceptors.length;i++){var o=this.options.interceptors[i];o.loop&&(r+=this.getInterceptor(i)+".loop("+this.args({before:o.context?"_context":void 0})+");\n")}return r=r+this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var i=(i="")+("if("+e+" !== undefined) {\n")+"_loop = true;\n";return a||(i+="if(_loopAsync) _looper();\n"),i=(i=i+r(!0)+"} else {\n")+n()+"}\n"},onDone:n&&function(){var t="";return(t+="if(!_loop) {\n")+n()+"}\n"},rethrowIfPossible:t&&a})+"} while(_loop);\n",a||(r+="_loopAsync = true;\n});\n_looper();\n"),r},e.callTapsParallel=function(t){var e=this,a=t.onError,o=t.onResult,s=t.onDone,l=t.rethrowIfPossible,t=t.onTap,c=void 0===t?function(t,e){return e()}:t;if(this.options.taps.length<=1)return this.callTapsSeries({onError:a,onResult:o,onDone:s,rethrowIfPossible:l});for(var u="",n=(u=(u+="do {\n")+("var _counter = "+this.options.taps.length+";\n"),s&&(u=(u+="var _done = (function() {\n")+s()+"});\n"),function(n){function r(){return s?"if(--_counter === 0) _done();\n":"--_counter;"}function i(t){return t||!s?"_counter = 0;\n":"_counter = 0;\n_done();\n"}u=(u+="if(_counter <= 0) break;\n")+c(n,function(){return e.callTap(n,{onError:function(t){var e="";return(e+="if(_counter > 0) {\n")+a(n,t,r,i)+"}\n"},onResult:o&&function(t){var e="";return(e+="if(_counter > 0) {\n")+o(n,t,r,i)+"}\n"},onDone:!o&&r,rethrowIfPossible:l})},r,i)}),r=0;r<this.options.taps.length;r++)n(r);return u+="} while(false);\n"},e.args=function(t){var t=void 0===t?{}:t,e=t.before,t=t.after,n=this._args;return e&&(n=[e].concat(n)),0===(n=t?n.concat(t):n).length?"":n.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),yl=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var i=t.onError,t=t.onDone;return this.callTapsParallel({onError:function(t,e,n,r){return i(e)+r(!0)},onDone:t})},e}(gl)),vl=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).compile=ol,t._call=void 0,t.call=void 0,t}return s(t,n),t}(pl),ml=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var i=this,a=t.onError,e=t.onResult;return t.onDone,this.callTapsSeries({onError:function(t,e,n,r){return a(e)+r(!0)},onResult:function(t,e,n){var r="";return(r+="if("+e+" !== undefined) {\n")+(i._args[0]+" = "+e+";\n")+"}\n"+n()},onDone:function(){return e(i._args[0])}})},e}(gl)),bl=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).compile=sl,t._call=void 0,t.call=void 0,t}return s(t,n),t}(pl),xl=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var n=t.onError,e=t.onDone,t=t.rethrowIfPossible;return this.callTapsSeries({onError:function(t,e){return n(e)},onDone:e,rethrowIfPossible:t})},e}(gl)),wl=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).tapAsync=ll,t.tapPromise=cl,t.compile=ul,t}return s(t,n),t}(pl),kl=new(function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.content=function(t){var i=this,n=t.onError,e=t.onResult,r=t.resultReturns,t=t.rethrowIfPossible;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,e,n){var r="";return(r+="if("+e+" !== undefined) {\n")+(i._args[0]+" = "+e+";\n")+"}\n"+n()},onDone:function(){return e(i._args[0])},doneReturns:r,rethrowIfPossible:t})},e}(gl)),El=function(n){function t(t,e){return(t=n.call(this,t=void 0===t?[]:t,e=void 0===e?void 0:e)||this).tapAsync=hl,t.tapPromise=fl,t.compile=dl,t}return s(t,n),t}(wl),Ml=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ol=/([\"\'])[^\'\"]+\1/;function Sl(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-Il)?0:16-e,r=Nl();return Bl[r]=t,1<Object.keys(Bl).length||setTimeout(function(){Il=n;var e=Bl;Bl={},Object.keys(e).forEach(function(t){return e[t](Fl())})},e),r}function _l(t){delete Bl[t]}function Al(t){return"string"!=typeof t?Sl:""===t?jl.requestAnimationFrame:jl[t+"RequestAnimationFrame"]}var Tl,Pl,Ll,Cl=1,Nl=function(){return Cl++},jl="object"==typeof self&&self.self==self?self:"object"==typeof j&&j.global==j?j:{},Rl=Date.now(),Fl=function(){return jl.performance&&"function"==typeof jl.performance.now?jl.performance.now():Date.now()-Rl},Bl={},Il=Date.now(),pl=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],Al),Dl=Al(pl),zl="string"!=typeof(gl=pl)?_l:""===gl?jl.cancelAnimationFrame:jl[gl+"CancelAnimationFrame"]||jl[gl+"CancelRequestAnimationFrame"],Gl=(jl.requestAnimationFrame=Dl,jl.cancelAnimationFrame=zl,[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:i.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:i.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:i.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:i.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:i.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:i.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:i.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:i.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:i.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:i.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:i.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:i.FILTER},{n:"clipPath",syntax:i.DEFINED_PATH},{n:"textPath",syntax:i.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:i.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===E.CIRCLE||t===E.ELLIPSE?"center":t===E.TEXT?"text-anchor":"left top"},l:!0,syntax:i.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===E.CIRCLE||t===E.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:i.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:i.COORDINATE},{n:"cy",int:!0,d:"0",syntax:i.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:i.COORDINATE},{n:"y",int:!0,d:"0",syntax:i.COORDINATE},{n:"z",int:!0,d:"0",syntax:i.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:i.COORDINATE},{n:"y1",int:!0,l:!0,syntax:i.COORDINATE},{n:"z1",int:!0,l:!0,syntax:i.COORDINATE},{n:"x2",int:!0,l:!0,syntax:i.COORDINATE},{n:"y2",int:!0,l:!0,syntax:i.COORDINATE},{n:"z2",int:!0,l:!0,syntax:i.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:i.PATH,p:50},{n:"points",l:!0,syntax:i.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:i.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:i.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:i.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:i.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:i.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:i.NUMBER,d:function(t){return t===E.PATH||t===E.POLYGON||t===E.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:i.MARKER},{n:"markerEnd",syntax:i.MARKER},{n:"markerMid",syntax:i.MARKER},{n:"markerStartOffset",syntax:i.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:i.LENGTH,l:!0,int:!0,d:"0"}]),Wl={},Hl=new WeakMap,Vl=v(),Yl=v(),ql=v(),pl=function(){function t(){var e=this;Gl.forEach(function(t){e.registerMetadata(t)})}var e=t.prototype;return e.registerMetadata=function(e){[e.n].concat(e.a||[]).forEach(function(t){Wl[t]=e})},e.unregisterMetadata=function(t){delete Wl[t]},e.getPropertySyntax=function(t){return O.CSSPropertySyntaxFactory[t]},e.processProperties=function(n,r,t){var i=this,t=t=void 0===t?{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}:t,a=t.skipUpdateAttribute,e=t.skipParse,o=t.forceUpdateGeometry,t=t.usedAttributes,s=o,l=Object.keys(r);l.forEach(function(t){var e=Kr(t);a||(n.attributes[e]=r[t]),!s&&null!=(t=Wl[e])&&t.l&&(s=!0)}),e||l.forEach(function(t){n.computedStyle[t]=i.parseProperty(t,n.attributes[t],n)}),null!=t&&t.length&&(l=Array.from(new Set(l.concat(t)))),["path","points","text","textTransform","anchor","transform","transformOrigin"].forEach(function(t){var e=l.indexOf(t);-1<e&&(l.splice(e,1),l.push(t))}),l.forEach(function(t){t in n.computedStyle&&(n.parsedStyle[t]=i.computeProperty(t,n.computedStyle[t],n))}),s&&this.updateGeometry(n),l.forEach(function(t){t in n.parsedStyle&&i.postProcessProperty(t,n)}),n.children.length&&l.forEach(function(e){e in n.parsedStyle&&i.isPropertyInheritable(e)&&n.children.forEach(function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})})})},e.parseProperty=function(t,e,n){var r,t=Wl[t],i=e;return"unset"===(e=""!==e&&!_(e)?e:"unset")||"initial"===e||"inherit"===e?i=Gi(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Gi(e):t&&t.parser&&(i=t.parser(e,n))),i},e.computeProperty=function(t,e,n){var r=Wl[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof Ai){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))_(r)||(e=this.parseProperty(t,Xr(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),_(s)?void this.addUnresolveProperty(n,t):s}i=o&&this.getPropertySyntax(o);a=i&&i.calculator?(r=n.parsedStyle[t],i.calculator(t,r,e,n,this)):e instanceof Ai?e.value:e}return a},e.postProcessProperty=function(t,e){var t=Wl[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e)},e.addUnresolveProperty=function(t,e){var n=Hl.get(t);n||(Hl.set(t,[]),n=Hl.get(t)),-1===n.indexOf(e)&&n.push(e)},e.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=Hl.get(t);return!t||0===t.length||t.includes(e)}(t.parentElement,e)))return"unset"===(n=t.parentElement.parsedStyle[e])||"initial"===n||"inherit"===n?void 0:n},e.recalc=function(e){var n,t=Hl.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),Hl.delete(e))},e.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,y,v,m=O.geometryUpdaterFactory[t.nodeName];m&&((s=t.geometry).contentBounds||(s.contentBounds=new Dr),s.renderBounds||(s.renderBounds=new Dr),e=t.parsedStyle,d=(m=m.update(e,t)).width,f=m.height,p=void 0===(p=m.depth)?0:p,h=void 0===(h=m.offsetX)?0:h,v=void 0===(v=m.offsetY)?0:v,m=void 0===(m=m.offsetZ)?0:m,n=d<0,r=f<0,p=Gt(Vl,Math.abs(d)/2,Math.abs(f)/2,p/2),l=e.stroke,c=e.lineWidth,u=e.increasedLineWidthForHitTesting,y=e.shadowType,g=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,t.nodeName===E.TEXT&&delete e.anchor,d=Gt(Yl,(1-2*(o&&o[0]||0))*d/2+h,(1-2*(o&&o[1]||0))*f/2+v,(1-2*(o&&o[2]||0))*p[2]+m),s.contentBounds.update(d,p),h=t.nodeName===E.POLYLINE||t.nodeName===E.POLYGON||t.nodeName===E.PATH?Math.SQRT2:.5,l&&!l.isNone&&Wt(p,p,Gt(ql,f=((c||0)+(u||0))*h,f,0)),s.renderBounds.update(d,p),g&&y&&"inner"!==y&&(m=(v=s.renderBounds).min,l=v.max,c=e.shadowBlur||0,u=e.shadowOffsetX||0,h=e.shadowOffsetY||0,f=m[0]-c+u,d=l[0]+c+u,p=m[1]-c+h,g=l[1]+c+h,m[0]=Math.min(m[0],f),l[0]=Math.max(l[0],d),m[1]=Math.min(m[1],p),l[1]=Math.max(l[1],g),s.renderBounds.setMinMax(m,l)),i.forEach(function(t){var e,n,r,i,a,o=t.name,t=t.params;"blur"===o?(i=t[0].value,s.renderBounds.update(s.renderBounds.center,Wt(s.renderBounds.halfExtents,s.renderBounds.halfExtents,k(i,i,0)))):"drop-shadow"===o&&(i=t[0].value,o=t[1].value,t=t[2].value,e=(n=s.renderBounds).min,n=n.max,r=e[0]-t+i,i=n[0]+t+i,a=e[1]-t+o,t=n[1]+t+o,e[0]=Math.min(e[0],r),n[0]=Math.max(n[0],i),e[1]=Math.min(e[1],a),n[1]=Math.max(n[1],t),s.renderBounds.setMinMax(e,n))}),o=e.anchor,y=(n?-1:1)*xa(a[0],0,t),v=(r?-1:1)*xa(a[1],1,t),y-=(n?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,v-=(r?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(y,v),O.sceneGraphService.dirtifyToRoot(t))},e.isPropertyInheritable=function(t){t=Wl[t];return!!t&&t.inh},t}();(gl=Tl=Tl||{})[gl.ORBITING=0]="ORBITING",gl[gl.EXPLORING=1]="EXPLORING",gl[gl.TRACKING=2]="TRACKING",(gl=Pl=Pl||{})[gl.DEFAULT=0]="DEFAULT",gl[gl.ROTATIONAL=1]="ROTATIONAL",gl[gl.TRANSLATIONAL=2]="TRANSLATIONAL",gl[gl.CINEMATIC=3]="CINEMATIC",(gl=Ll=Ll||{})[gl.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",gl[gl.PERSPECTIVE=1]="PERSPECTIVE";var Ul,Xl="updated",gl=function(){function t(){this.canvas=void 0,this.eventEmitter=new Ir,this.matrix=ht(),this.right=k(1,0,0),this.up=k(0,1,0),this.forward=k(0,0,1),this.position=k(0,0,1),this.focalPoint=k(0,0,0),this.distanceVector=k(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=ht(),this.projectionMatrixInverse=ht(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=Tl.EXPLORING,this.trackingMode=Pl.DEFAULT,this.projectionMode=Ll.PERSPECTIVE,this.frustum=new Gr,this.orthoMatrix=ht()}var e=t.prototype;return e.isOrtho=function(){return this.projectionMode===Ll.ORTHOGRAPHIC},e.getProjectionMode=function(){return this.projectionMode},e.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.getFrustum=function(){return this.frustum},e.getPosition=function(){return this.position},e.getFocalPoint=function(){return this.focalPoint},e.getDollyingStep=function(){return this.dollyingStep},e.getNear=function(){return this.near},e.getFar=function(){return this.far},e.getZoom=function(){return this.zoom},e.getOrthoMatrix=function(){return this.orthoMatrix},e.getView=function(){return this.view},e.setEnableUpdate=function(t){this.enableUpdate=t},e.setType=function(t,e){return this.type=t,this.type===Tl.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Tl.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},e.setProjectionMode=function(t){return this.projectionMode=t,this},e.setTrackingMode=function(t){if(this.type!==Tl.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.getViewTransform=function(){return vt(ht(),this.matrix)},e.getWorldTransform=function(){return this.matrix},e.jitterProjectionMatrix=function(t,e){t=Mt(ht(),[t,e,0]);this.jitteredProjectionMatrix=bt(ht(),t,this.projectionMatrix)},e.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.setMatrix=function(t){return this.matrix=t,this._update(),this},e.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.setNear=function(t){return this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.setFar=function(t){return this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.setViewOffset=function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ll.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.setZoom=function(t){return this.zoom=t,this.projectionMode===Ll.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ll.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,n=n.y,i=this.roll,t=(this.rotate(0,0,-i),this.setPosition(r,n),this.setFocalPoint(r,n),this.setZoom(t),this.rotate(0,0,i),this.canvas.viewport2Canvas({x:e[0],y:e[1]})),i=k(t.x-r,t.y-n,0),e=qt(i,this.right)/Dt(this.right),r=qt(i,this.up)/Dt(this.up);return this.pan(-e,-r),this},e.setPerspective=function(t,e,n,r){this.projectionMode=Ll.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,n=this.near*Math.tan(us(.5*this.fov))/this.zoom,e=2*n,r=this.aspect*e,l=-.5*r;return null!=(i=this.view)&&i.enabled&&(i=this.view.fullWidth,a=this.view.fullHeight,l+=this.view.offsetX*r/i,n-=this.view.offsetY*e/a,r*=this.view.width/i,e*=this.view.height/a),i=this.projectionMatrix,l=(a=l)+r,n=(r=n)-e,e=this.far,o=2*t/(r-n),s=(l+a)/(l-a),r=(r+n)/(r-n),n=-(e+t)/(e-t),e=-2*e*t/(e-t),i[0]=2*t/(l-a),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=s,i[9]=r,i[10]=n,i[11]=-1,i[12]=0,i[13]=0,i[14]=e,i[15]=0,wt(this.projectionMatrix,this.projectionMatrix,k(1,-1,1)),vt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Ll.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var o,e=(this.rright-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.rright+this.left)/2,r=(this.top+this.bottom)/2,s=n-e,n=n+e,e=r+t,r=r-t;return null!=(t=this.view)&&t.enabled&&(t=(this.rright-this.left)/this.view.fullWidth/this.zoom,o=(this.top-this.bottom)/this.view.fullHeight/this.zoom,n=(s+=t*this.view.offsetX)+t*this.view.width,r=(e-=o*this.view.offsetY)-o*this.view.height),jt(this.projectionMatrix,s,n,r,e,i,a),wt(this.projectionMatrix,this.projectionMatrix,k(1,-1,1)),vt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.setPosition=function(t,e,n){t=cs(t,e=void 0===e?this.position[1]:e,n=void 0===n?this.position[2]:n);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=k(0,1,0);return this.focalPoint=cs(t,e,n),this.trackingMode===Pl.CINEMATIC&&(t=(r=Ht(v(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Dt(r),e=hs(Math.asin(e/r)),r=90+hs(Math.atan2(n,t)),Et(n=ht(),n,us(r)),kt(n,n,us(e)),i=$t(v(),[0,1,0],n)),vt(this.matrix,Rt(ht(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.getDistance=function(){return this.distance},e.getDistanceVector=function(){return this.distanceVector},e.setDistance=function(t){var e,n,r;return this.distance===t||t<0||(this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100,e=v(),t=this.distance,n=this.forward,r=this.focalPoint,e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate()),this},e.setMaxDistance=function(t){return this.maxDistance=t,this},e.setMinDistance=function(t){return this.minDistance=t,this},e.setAzimuth=function(t){return this.azimuth=ls(t),this.computeMatrix(),this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getAzimuth=function(){return this.azimuth},e.setElevation=function(t){return this.elevation=ls(t),this.computeMatrix(),this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getElevation=function(){return this.elevation},e.setRoll=function(t){return this.roll=ls(t),this.computeMatrix(),this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getRoll=function(){return this.roll},e._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.computeMatrix=function(){var t=ie(re(),[0,0,1],us(this.roll)),e=(gt(this.matrix),ie(re(),[1,0,0],us((this.rotateWorld&&this.type!==Tl.TRACKING||this.type===Tl.TRACKING?1:-1)*this.elevation))),n=ie(re(),[0,1,0],us((this.rotateWorld&&this.type!==Tl.TRACKING||this.type===Tl.TRACKING?1:-1)*this.azimuth)),n=ae(re(),n,e),n=ae(re(),n,t),e=Lt(ht(),n);this.type===Tl.ORBITING||this.type===Tl.EXPLORING?(xt(this.matrix,this.matrix,this.focalPoint),bt(this.matrix,this.matrix,e),xt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Tl.TRACKING&&(xt(this.matrix,this.matrix,this.position),bt(this.matrix,this.matrix,e))},e._setPosition=function(t,e,n){this.position=cs(t,e,n);t=this.matrix;t[12]=this.position[0],t[13]=this.position[1],t[14]=this.position[2],t[15]=1,this._getOrthoMatrix()},e._getAxes=function(){zt(this.right,cs(ne(ee(),[1,0,0,0],this.matrix))),zt(this.up,cs(ne(ee(),[0,1,0,0],this.matrix))),zt(this.forward,cs(ne(ee(),[0,0,1,0],this.matrix))),Yt(this.right,this.right),Yt(this.up,this.up),Yt(this.forward,this.forward)},e._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Dt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===Tl.TRACKING||this.rotateWorld?(this.elevation=hs(Math.asin(e/r)),this.azimuth=hs(Math.atan2(-t,-n))):(this.elevation=-hs(Math.asin(e/r)),this.azimuth=-hs(Math.atan2(-t,-n)))},e._getPosition=function(){zt(this.position,cs(ne(ee(),[0,0,0,1],this.matrix))),this._getDistance()},e._getFocalPoint=function(){var t,e;Kt(this.distanceVector,[0,0,-this.distance],(t=ct(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),Wt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e._getDistance=function(){this.distanceVector=Ht(v(),this.focalPoint,this.position),this.distance=Dt(this.distanceVector),this.dollyingStep=this.distance/100},e._getOrthoMatrix=function(){var t,e;this.projectionMode===Ll.ORTHOGRAPHIC&&(t=this.position,e=ie(re(),[0,0,1],-this.roll*Math.PI/180),Pt(this.orthoMatrix,e,k((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),k(this.zoom,this.zoom,1),t))},e.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=bt(ht(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(Xl))},e.rotate=function(t,e,n){throw new Error(oi)},e.pan=function(t,e){throw new Error(oi)},e.dolly=function(t){throw new Error(oi)},e.createLandmark=function(t,e){throw new Error(oi)},e.gotoLandmark=function(t,e){throw new Error(oi)},t}(),$l=function(){function t(){}return t.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}},t}(),Kl=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),c=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,t=t.y2,i=Math.min(e,r),e=Math.max(e,r),r=Math.min(n,t);return{width:e-i,height:Math.max(n,t)-r}},t}(),Zl=function(){function t(){}return t.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}},t}(),Jl=function(){function t(){}return t.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,t.map(function(t){return t[0]})),n=Math.max.apply(Math,t.map(function(t){return t[0]})),r=Math.min.apply(Math,t.map(function(t){return t[1]}));return{width:n-e,height:Math.max.apply(Math,t.map(function(t){return t[1]}))-r}},t}(),Ql=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,r=void 0===r?0:r,i=void 0===i?0:i;return n&&!fn(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}},t}(),tc=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,a=t.fontSize,o=t.fontStyle,s=t.fontWeight,l=t.fontVariant,t=t.lineWidth;return n&&a&&o&&s&&l&&r&&i&&!_(t)},e.update=function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,l=t.dx,c=t.dy,u=((null==e||null==(u=e.ownerDocument)||null==(u=u.defaultView)?void 0:u.getConfig())||{}).offscreenCanvas;return this.isReadyToMeasure(t,e)?(e=this.globalRuntime.textService.measureText(i,t,u),i=(t.metrics=e).width,u=e.height,n=e.lineHeight,e=e.fontProperties,i=[i/2,u/2,0],u=[0,1],r=0,"center"===a||"middle"===a?(r=o/2,u=[.5,1]):"right"!==a&&"end"!==a||(r=o,u=[1,1]),a=0,"middle"===s?a=i[1]:"top"===s||"hanging"===s?a=2*i[1]:"alphabetic"===s?a=n-e.ascent:"bottom"!==s&&"ideographic"!==s||(a=0),l&&(r+=l),c&&(a+=c),t.anchor=[u[0],u[1],0],{width:2*i[0],height:2*i[1],offsetX:r,offsetY:a}):(t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0})},t}(),ec=function(){function t(t,e){var f=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new Ir,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=ht(),this.tmpVec3=v(),this.onPointerDown=function(){var e=ui(M().mark(function t(e){var n,r;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.createPointerEvent(e);case 2:n=t.sent,f.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType?f.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(r=2===n.button,f.dispatchEvent(n,r?"rightdown":"mousedown")),f.trackingData(e.pointerId).pressTargetsByButton[e.button]=n.composedPath(),f.freeEvent(n);case 8:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerUp=function(){var e=ui(M().mark(function t(e){var n,r,i,a,o,s,l;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=performance.now(),t.next=3,f.createPointerEvent(e);case 3:if(r=t.sent,f.dispatchEvent(r,"pointerup"),"touch"===r.pointerType?f.dispatchEvent(r,"touchend"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||(i=2===r.button,f.dispatchEvent(r,i?"rightup":"mouseup")),i=f.trackingData(e.pointerId),s=f.findMountedTarget(i.pressTargetsByButton[e.button]),(l=s)&&!r.composedPath().includes(s)){for(a=s;a&&!r.composedPath().includes(a);)r.currentTarget=a,f.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?f.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||(o=2===r.button,f.notifyTarget(r,o?"rightupoutside":"mouseupoutside")),xo.isNode(a)&&(a=a.parentNode);delete i.pressTargetsByButton[e.button],l=a}l&&((s=f.clonePointerEvent(r,"click")).target=l,s.path=[],i.clicksByButton[e.button]||(i.clicksByButton[e.button]={clickCount:0,target:s.target,timeStamp:n}),(l=i.clicksByButton[e.button]).target===s.target&&n-l.timeStamp<200?++l.clickCount:l.clickCount=1,l.target=s.target,l.timeStamp=n,s.detail=l.clickCount,null!=(l=r.detail)&&l.preventClick||("mouse"!==s.pointerType&&"touch"!==s.pointerType||f.dispatchEvent(s,"click"),f.dispatchEvent(s,"pointertap")),f.freeEvent(s)),f.freeEvent(r);case 12:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerMove=function(){var e=ui(M().mark(function t(e){var n,r,i,a,o,s,l,c,u,h;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.createPointerEvent(e);case 2:if(n=t.sent,r="mouse"===n.pointerType||"pen"===n.pointerType,i=f.trackingData(e.pointerId),a=f.findMountedTarget(i.overTargets),i.overTargets&&a!==n.target)return l="mousemove"===e.type?"mouseout":"pointerout",t.next=10,f.createPointerEvent(e,l,a||void 0);t.next=21;break;case 10:if(o=t.sent,f.dispatchEvent(o,"pointerout"),r&&f.dispatchEvent(o,"mouseout"),n.composedPath().includes(a)){t.next=20;break}return t.next=16,f.createPointerEvent(e,"pointerleave",a||void 0);case 16:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&!n.composedPath().includes(s.target);)s.currentTarget=s.target,f.notifyTarget(s),r&&f.notifyTarget(s,"mouseleave"),xo.isNode(s.target)&&(s.target=s.target.parentNode);f.freeEvent(s);case 20:f.freeEvent(o);case 21:if(a===n.target){t.next=36;break}l="mousemove"===e.type?"mouseover":"pointerover",c=f.clonePointerEvent(n,l),f.dispatchEvent(c,"pointerover"),r&&f.dispatchEvent(c,"mouseover"),u=a&&xo.isNode(a)&&a.parentNode;case 27:if(u&&u!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode)){if(u===n.target)return t.abrupt("break",33);t.next=30}else t.next=33;break;case 30:u=u.parentNode,t.next=27;break;case 33:if(!u||u===(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode)){for((h=f.clonePointerEvent(n,"pointerenter")).eventPhase=h.AT_TARGET;h.target&&h.target!==a&&h.target!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode);)h.currentTarget=h.target,f.notifyTarget(h),r&&f.notifyTarget(h,"mouseenter"),xo.isNode(h.target)&&(h.target=h.target.parentNode);f.freeEvent(h)}f.freeEvent(c);case 36:f.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&f.dispatchEvent(n,"touchmove"),r&&(f.dispatchEvent(n,"mousemove"),f.cursor=f.getCursor(n.target)),i.overTargets=n.composedPath(),f.freeEvent(n);case 41:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerOut=function(){var e=ui(M().mark(function t(e){var n,r,i,a,o;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((n=f.trackingData(e.pointerId)).overTargets)return r="mouse"===e.pointerType||"pen"===e.pointerType,i=f.findMountedTarget(n.overTargets),t.next=6,f.createPointerEvent(e,"pointerout",i||void 0);t.next=17;break;case 6:return a=t.sent,f.dispatchEvent(a),r&&f.dispatchEvent(a,"mouseout"),t.next=11,f.createPointerEvent(e,"pointerleave",i||void 0);case 11:for((o=t.sent).eventPhase=o.AT_TARGET;o.target&&o.target!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode);)o.currentTarget=o.target,f.notifyTarget(o),r&&f.notifyTarget(o,"mouseleave"),xo.isNode(o.target)&&(o.target=o.target.parentNode);n.overTargets=null,f.freeEvent(a),f.freeEvent(o);case 17:f.cursor=null;case 18:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerOver=function(){var e=ui(M().mark(function t(e){var n,r,i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.trackingData(e.pointerId),t.next=3,f.createPointerEvent(e);case 3:for(r=t.sent,i="mouse"===r.pointerType||"pen"===r.pointerType,f.dispatchEvent(r,"pointerover"),i&&f.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(f.cursor=f.getCursor(r.target)),(a=f.clonePointerEvent(r,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(xo.isNode(f.rootTarget)&&f.rootTarget.parentNode);)a.currentTarget=a.target,f.notifyTarget(a),i&&f.notifyTarget(a,"mouseenter"),xo.isNode(a.target)&&(a.target=a.target.parentNode);n.overTargets=r.composedPath(),f.freeEvent(r),f.freeEvent(a);case 14:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var e=ui(M().mark(function t(e){var n,r,i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.trackingData(e.pointerId),r=f.findMountedTarget(n.pressTargetsByButton[e.button]),t.next=4,f.createPointerEvent(e);case 4:if(i=t.sent,r){for(a=r;a;)i.currentTarget=a,f.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||f.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),xo.isNode(a)&&(a=a.parentNode);delete n.pressTargetsByButton[e.button]}f.freeEvent(i);case 7:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.onWheel=function(){var e=ui(M().mark(function t(e){var n;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.createWheelEvent(e);case 2:n=t.sent,f.dispatchEvent(n),f.freeEvent(n);case 5:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Wr(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Wr(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=bt(this.tmpMatrix,n,a),a=Gt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return $t(a,a,n),new Wr(a[0],a[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=bt(this.tmpMatrix,n,e),e=Gt(this.tmpVec3,t.x,t.y,0),t=($t(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new Wr((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})},e.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},e.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)xo.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},e.hitTest=function(){var e=ui(M().mark(function t(e){var n,r,i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.viewportX,r=e.viewportY,a=this.context.config,i=a.width,a=a.height,n<0||r<0||i<n||a<r)return t.abrupt("return",null);t.next=4;break;case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e=mi(this.globalRuntime.displayObjectPool.getHTMLs());!(n=e()).done;){var n=n.value;if(-1<t.nativeEvent.composedPath().indexOf(n))return n}return null},e.pickTarget=function(){var e=ui(M().mark(function t(e){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.createPointerEvent=function(){var r=ui(M().mark(function t(e,n,r){var i,a;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i=this.allocateEvent(Ao),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,a=this.getExistedHTML(i),null==r?t.next=11:(t.t0=r,t.next=20);break;case 11:if(t.t1=a,t.t1)t.next=19;else{if(t.t2=this.isNativeEventFromCanvas(i),t.t2)return t.next=17,this.pickTarget(i);t.next=18}break;case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}},t,this)}));return function(t,e,n){return r.apply(this,arguments)}}(),e.createWheelEvent=function(){var e=ui(M().mark(function t(e){var n,r;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(To),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0)t.next=15;else{if(t.t1=this.isNativeEventFromCanvas(n),t.t1)return t.next=13,this.pickTarget(n);t.next=14}break;case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(To);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(Ao);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},e.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},e.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.notifyTarget=function(t,e){e=null!=(n=e)?n:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},e.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||xo.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=_o.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=xo.isNode(e)&&e.parentNode}},t}(),nc=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(!this.canvas){if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}this.canvas.width=10,this.canvas.height=10}return this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}(),rc=((ac=Ul=Ul||{})[ac.CAMERA_CHANGED=0]="CAMERA_CHANGED",ac[ac.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",ac[ac.NONE=2]="NONE",function(){function t(t,e){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new mo(w.RENDER_ORDER_CHANGED),this.hooks={init:new vl,dirtycheck:new El(["object"]),cull:new El(["object","camera"]),beginFrame:new wl([]),beforeRender:new wl(["objectToRender"]),render:new wl(["objectToRender"]),afterRender:new wl(["objectToRender"]),endFrame:new wl([]),destroy:new wl([]),pick:new bl(["result"]),pickSync:new El(["result"]),pointerDown:new wl(["event"]),pointerUp:new wl(["event"]),pointerMove:new wl(["event"]),pointerOut:new wl(["event"]),pointerOver:new wl(["event"]),pointerWheel:new wl(["event"]),pointerCancel:new wl(["event"])},this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){var t=ui(M().mark(function t(){var e;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=di({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach(function(t){t.apply(e,O)}),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),e.getStats=function(){return this.stats},e.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Ul.CAMERA_CHANGED)},e.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach(function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)}),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},e.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable),i=!1;a.dirty&&(a.sorted=t.childNodes.slice().sort(ti),a.dirty=!(i=!0)),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)}),i&&t.forEach(function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)})},e.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.dirtify=function(){this.context.renderingContext.renderReasons.add(Ul.DISPLAY_OBJECT_CHANGED)},t}()),ic=/\[\s*(.*)=(.*)\s*\]/,ac=function(){function t(){}var e=t.prototype;return e.selectOne=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.find(function(t){return-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.find(function(t){return t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.find(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):null):n.find(function(t){return n!==t&&t.nodeName===e})},e.selectAll=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.findAll(function(t){return n!==t&&-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.findAll(function(t){return n!==t&&t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.findAll(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):[]):n.findAll(function(t){return n!==t&&t.nodeName===e})},e.is=function(t,e){var n,r;return t.startsWith(".")?e.className===this.getIdOrClassname(t):t.startsWith("#")?e.id===this.getIdOrClassname(t):t.startsWith("[")?(n=(r=this.getAttribute(t)).name,r=r.value,"name"===n?e.name===r:this.attributeToString(e,n)===r):e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var t=t.match(ic),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},e.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!_(t))&&t.toString?t.toString():""},t}();function oc(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var sc,lc=function(){function t(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new mo(w.BOUNDS_CHANGED),this.rotate=(o=re(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(se(r=re(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),ce(o,a),oe(o,o),ae(r,o,r),ae(n.localRotation,r,i),he(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=re(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;se(i,e[0],e[1],e[2]),ue(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=re(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(se(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),ce(a,oe(re(),r)),ue(n.localRotation,n.localRotation,a),g.dirtifyLocal(t,n)):g.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Zt(e,v())||(i=r=e,a=n.localRotation,o=a[0],s=a[1],l=a[2],a=a[3],c=i[0],u=i[1],i=i[2],p=s*(d=o*u-s*c)-l*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,Wt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=ht(),s=v(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Zt(g.getPosition(t),s)||(zt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,dt(r,e.worldTransform),vt(r,r),$t(n.localPosition,s,r)):zt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=v(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Zt(n.localPosition,l)||(zt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=v(),u=v(),h=v(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Zt(e="number"==typeof e?Gt(u,e,n,r):e,c)||(Wt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=re();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=le(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),ce(o,n),oe(o,o),ae(a.localRotation,o,e),he(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=ht(),f=v(),d=le(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(Pt(t.localTransform,t.localRotation,t.localPosition,k(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=gt(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),bt(t.localTransform,t.localTransform,e)),e=Pt(n,d,f,t.localScale,t.origin),bt(t.localTransform,t.localTransform,e)):Pt(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)}),this.runtime=t}var e=t.prototype;return e.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},e.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},e.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},e.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,_(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);n=e.sortable,(null!=n&&null!=(e=n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(n.dirty=!0),e=t.transformable;e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t)},e.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(n=t.parentNode.sortable)&&null!=(r=n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(n.dirty=!0),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},e.getOrigin=function(t){return t.transformable.origin},e.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;Zt(e,n.origin)||((r=n.origin)[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n))},e.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=k(e,n,r));n=t.transformable;se(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},e.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=k(e[0],e[1],e[2]||1),n[0]=r[0]*e[0],n[1]=r[1]*e[1],n[2]=r[2]*e[2],this.dirtifyLocal(t,i)},e.setLocalScale=function(t,e){var n=t.transformable,e=k(e[0],e[1],e[2]||n.localScale[2]);Zt(e,n.localScale)||(zt(n.localScale,e),this.dirtifyLocal(t,n))},e.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=le(e,n,r,i));n=t.transformable;ce(n.localRotation,e),this.dirtifyLocal(t,n)},e.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=fe(e,n));var r,n=t.transformable;r=n.localSkew,e=e,r[0]=e[0],r[1]=e[1],this.dirtifyLocal(t,n)},e.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},e.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},e.triggerPendingEvents=function(){function r(t,e){t.isConnected&&!i.has(t.entity)&&(n.boundsChangedEvent.detail=e,(n.boundsChangedEvent.target=t).isMutationObserved?t.dispatchEvent(n.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0),i.add(t.entity))}var n=this,i=new Set;this.pendingEvents.forEach(function(t){var e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},e.clearPendingEvents=function(){this.pendingEvents=[]},e.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)oc(n),n=n.parentNode;e&&t.forEach(function(t){oc(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},e.updateDisplayObjectDependency=function(t,e,n,r){var i;e&&e!==n&&(e=this.displayObjectDependencyMap.get(e))&&e[t]&&(i=e[t].indexOf(r),e[t].splice(i,1)),n&&((e=this.displayObjectDependencyMap.get(n))||(this.displayObjectDependencyMap.set(n,{}),e=this.displayObjectDependencyMap.get(n)),e[t]||(e[t]=[]),e[t].push(r))},e.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){n.dirtifyToRoot(t,!0),t.dispatchEvent(new ko(w.ATTR_MODIFIED,t,n,n,e,ko.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},e.getPosition=function(t){var e=t.transformable;return _t(e.position,this.getWorldTransform(t,e))},e.getRotation=function(t){var e=t.transformable;return Tt(e.rotation,this.getWorldTransform(t,e))},e.getScale=function(t){var e=t.transformable;return At(e.scaling,this.getWorldTransform(t,e))},e.getWorldTransform=function(t,e){return((e=void 0===e?t.transformable:e).localDirtyFlag||e.dirtyFlag)&&(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e)),e.worldTransform},e.getLocalPosition=function(t){return t.transformable.localPosition},e.getLocalRotation=function(t){return t.transformable.localRotation},e.getLocalScale=function(t){return t.transformable.localScale},e.getLocalSkew=function(t){return t.transformable.localSkew},e.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},e.setLocalTransform=function(t,e){var n=_t(v(),e),r=Tt(re(),e),e=At(v(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},e.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},e.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return Dr.isEmpty(e)?null:((n=n||new Dr).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},e.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new Dr},e.getBounds=function(t,e){var n,r,i=this,a=(void 0===e&&(e=!1),t.renderable);return a.boundsDirty||e||!a.bounds?!a.renderBoundsDirty&&e&&a.renderBounds?a.renderBounds:(n=e?a.renderBounds:a.bounds,r=this.getTransformedGeometryBounds(t,e,n),t.childNodes.forEach(function(t){t=i.getBounds(t,e);t&&(r?r.add(t):(r=n||new Dr).update(t.center,t.halfExtents))}),e&&(t=ei(t))&&(t=t.style.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Dr)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},e.getLocalBounds=function(t){if(t.parentNode){var e,n=ht(),r=(t.parentNode.transformable&&(n=vt(ht(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Dr.isEmpty(r))return(e=new Dr).setFromTransformedAABB(r,n),e}return this.getBounds(t)},e.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Dr.isEmpty(i)||(r=new Dr).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(i=t.ownerDocument)||null==(t=i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=r.getMin())[0],t=t[1],n=(r=r.getMax())[0],r=r[1],new Hr(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Hr((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},e.dirtifyWorldInternal=function(t,e){var n=this;!e.dirtyFlag&&(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach(function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}),e=t.renderable)&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)},e.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},e.sync=function(t,e){var n;e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag&&(n=(t=t.parentNode)&&t.transformable,null!==t&&n?bt(e.worldTransform,n.worldTransform,e.localTransform):dt(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},e.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),cc={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},uc=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,hc=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),fc=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),dc=function(){function t(t){var n=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!fc.exec(e)&&!hc.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=[].concat(t),r=n[n.length-2];return r?(e=r[r.length-1],n[n.length-2]=r.slice(0,-1),n[n.length-1]=e+n[n.length-1],n):t},this.runtime=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];for(var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),e=this.runtime.offscreenCanvas.getOrCreateContext(e),i=(e.font=t,cc.MetricsString+cc.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(cc.BaselineSymbol).width),s=cc.HeightMultiplier*o,o=o*cc.BaselineMultiplier|0,l=(r.width=a,r.height=s,e.fillStyle="#f00",e.fillRect(0,0,a,s),e.font=t,e.textBaseline="alphabetic",e.fillStyle="#000",e.fillText(i,0,o),e.getImageData(0,0,a||1,s||1).data),r=l.length,c=4*a,u=0,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(var p=0;p<c;p+=4)if(255!==l[h+p]){f=!0;break}if(f)break;h-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,l=e.textAlign,c=e.letterSpacing,u=e.textPath,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=pn(e)&&e+"px"||"16px",a=fn(n)?n.split(","):[n],o=a.length-1;0<=o;o--){var s=a[o].trim();!Ol.test(s)&&Ml.indexOf(s)<0&&(s='"'+s+'"'),a[o]=s}return r+" "+i+" "+t+" "+e+" "+a.join(",")}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvas.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),v=0;if(!u){for(var m=0;m<g.length;m++){var b=p.measureText(g[m]).width+(g[m].length-1)*c;y[m]=b,v=Math.max(v,b)}var r=v+o,x=a||d.fontSize+o,i=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-i/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-i:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:r,height:i,lines:g,lineWidths:y,lineHeight:x+=h,maxLineWidth:v,fontProperties:d,lineMetrics:y.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new Hr(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var k=0;k<g.length;k++)p.measureText(g[k]).width,g[k].length},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){for(var r=this,i=e.wordWrapWidth,i=void 0===i?0:i,a=e.letterSpacing,o=e.maxLines,s=void 0===o?1/0:o,o=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),c=i+a,u="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},y=Array.from(u).reduce(function(t,e){return t+g(e)},0),v=Array.from(t),m=0;m<v.length;m++){var b=v[m],x=t[m-1],w=t[m+1],k=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+k){if(s<=f+1){if(e.isOverflowing=!0,0<y&&y<=c){for(var E=h[f].length,M=0,O=E,S=0;S<E;S++){var _=g(h[f][S]);if(c<M+_+y){O=S;break}M+=_}h[f]=(h[f]||"").slice(0,O)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=k,h[f]=(h[f]||"")+b}}return h.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&0<=cc.BreakingSpaces.indexOf(t.charCodeAt(0))},e.isNewline=function(t){return"string"==typeof t&&0<=cc.Newlines.indexOf(t.charCodeAt(0))},e.trimToBreakable=function(t){var e,t=[].concat(t),n=t[t.length-2],r=this.findBreakableIndex(n);return-1!==r&&n&&(e=n.slice(r,r+1),e=r+(this.isBreakingSpace(e)?0:1),t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,e)),t},e.canBreakInLastChar=function(t){return!t||!uc.test(t)},e.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(t,e){if(n[e])return t+n[e];throw Error("cannot count the word without cache")},0)},e.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!uc.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];return"number"!=typeof i&&(e=t.length*e,i=r.measureText(t).width+e,n[t]=i),i},t}(),O={},$l=(Ql=new Ql,Jl=new Jl,(Fw={})[E.CIRCLE]=new $l,Fw[E.ELLIPSE]=new Kl,Fw[E.RECT]=Ql,Fw[E.IMAGE]=Ql,Fw[E.GROUP]=Ql,Fw[E.LINE]=new c,Fw[E.TEXT]=new tc(O),Fw[E.POLYLINE]=Jl,Fw[E.POLYGON]=Jl,Fw[E.PATH]=new Zl,Fw[E.HTML]=null,Fw[E.MESH]=null,Fw),tc=(Kl=new r,Ql=new eo,(c={})[i.PERCENTAGE]=null,c[i.NUMBER]=new ao,c[i.ANGLE]=new n,c[i.DEFINED_PATH]=new e,c[i.PAINT]=Kl,c[i.COLOR]=Kl,c[i.FILTER]=new Ja,c[i.LENGTH]=Ql,c[i.LENGTH_PERCENTAGE]=Ql,c[i.LENGTH_PERCENTAGE_12]=new a,c[i.LENGTH_PERCENTAGE_14]=new no,c[i.COORDINATE]=new ro,c[i.OFFSET_DISTANCE]=new oo,c[i.OPACITY_VALUE]=new so,c[i.PATH]=new lo,c[i.LIST_OF_POINTS]=new co,c[i.SHADOW_BLUR]=new uo,c[i.TEXT]=new o,c[i.TEXT_TRANSFORM]=new ho,c[i.TRANSFORM]=new fo,c[i.TRANSFORM_ORIGIN]=new to,c[i.Z_INDEX]=new po,c[i.MARKER]=new io,c),Jl=(O.CameraContribution=gl,O.AnimationTimeline=null,O.EasingFunction=null,O.offscreenCanvas=new nc,O.displayObjectPool=new l,O.sceneGraphSelector=new ac,O.sceneGraphService=new lc(O),O.textService=new dc(O),O.geometryUpdaterFactory=$l,O.CSSPropertySyntaxFactory=tc,O.styleValueRegistry=new pl,O.layoutRegistry=null,O.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==j)return j;throw new Error("Unable to locate global `this`")}(),function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},t}()),Zl=function(){function t(t){this.plugins=[],this.config=void 0,this.config=di({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},e.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),pc=function(){function a(t){this.strategies=void 0,this.strategies=t}return a.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(a.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new mo(w.CULLED)),null))}),e.hooks.afterRender.tap(a.tag,function(t){t.cullable.visibilityPlaneMask=-1})},a}(),gc=(pc.tag="Culling",function(){function n(){}return n.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(n.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},n}()),yc=(gc.tag="DirtyCheck",function(){function e(){var a=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Ao(null),this.rootWheelEvent=new To(null),this.context=void 0,this.onPointerMove=function(t){var e,n=null==(e=a.context.renderingContext.root)||null==(e=e.ownerDocument)?void 0:e.defaultView;if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var r=mi(a.normalizeToPointerEvent(t,n));!(i=r()).done;){var i=i.value,i=a.bootstrapEvent(a.rootPointerEvent,i,n);a.context.eventService.mapEvent(i)}a.setCursor(a.context.eventService.cursor)}}}var t=e.prototype;return t.apply=function(t){var a=this,t=(this.context=t).renderingService,o=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(){var e=ui(M().mark(function t(e){var n;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0});case 2:return n=t.sent,n=n.picked,t.abrupt("return",n[0]||null);case 5:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()),t.hooks.pointerWheel.tap(e.tag,function(t){t=a.normalizeWheelEvent(t);a.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(e.tag,function(t){if(!o.supportsTouchEvents||"touch"!==t.pointerType){var e=a.normalizeToPointerEvent(t,o);!a.autoPreventDefault||!e[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();for(var n=mi(e);!(r=n()).done;){var r=r.value,r=a.bootstrapEvent(a.rootPointerEvent,r,o);a.context.eventService.mapEvent(r)}a.setCursor(a.context.eventService.cursor)}}),t.hooks.pointerUp.tap(e.tag,function(t){if(!o.supportsTouchEvents||"touch"!==t.pointerType){var e=a.context.contextService.getDomElement(),n="outside";try{n=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}for(var r=mi(a.normalizeToPointerEvent(t,o));!(i=r()).done;){var i=i.value,i=a.bootstrapEvent(a.rootPointerEvent,i,o);i.type+=n,a.context.eventService.mapEvent(i)}a.setCursor(a.context.eventService.cursor)}}),t.hooks.pointerMove.tap(e.tag,this.onPointerMove),t.hooks.pointerOver.tap(e.tag,this.onPointerMove),t.hooks.pointerOut.tap(e.tag,this.onPointerMove)},t.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||_(n)||_(r)?(e=(i=this.context.eventService.client2Viewport(new Wr(i,t))).x,i.y):(e=n,r),{x:e,y:t}},t.bootstrapEvent=function(t,e,n){t.view=n,t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.getViewportXY(e),r=n.x,n=n.y,r=(t.viewport.x=r,t.viewport.y=n,this.context.eventService.viewport2Canvas(t.viewport)),n=r.x,r=r.y;return t.canvas.x=n,t.canvas.y=r,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=li[t.type]||t.type),t},t.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,this.getViewportXY(t)),r=n.x,n=n.y,r=(e.viewport.x=r,e.viewport.y=n,this.context.eventService.viewport2Canvas(e.viewport)),n=r.x,r=r.y;return e.canvas.x=n,e.canvas.y=r,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];mn(i.button)&&(i.button=0),mn(i.buttons)&&(i.buttons=1),mn(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),mn(i.width)&&(i.width=i.radiusX||1),mn(i.height)&&(i.height=i.radiusY||1),mn(i.tiltX)&&(i.tiltX=0),mn(i.tiltY)&&(i.tiltY=0),mn(i.pointerType)&&(i.pointerType="touch"),mn(i.pointerId)&&(i.pointerId=i.identifier||0),mn(i.pressure)&&(i.pressure=i.force||.5),mn(i.twist)&&(i.twist=0),mn(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(mn((e=t).isPrimary)&&(e.isPrimary=!0),mn(e.width)&&(e.width=1),mn(e.height)&&(e.height=1),mn(e.tiltX)&&(e.tiltX=0),mn(e.tiltY)&&(e.tiltY=0),mn(e.pointerType)&&(e.pointerType="mouse"),mn(e.pointerId)&&(e.pointerId=1),mn(e.pressure)&&(e.pressure=.5),mn(e.twist)&&(e.twist=0),mn(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},e}()),vc=(yc.tag="Event",[E.CIRCLE,E.ELLIPSE,E.IMAGE,E.RECT,E.LINE,E.POLYLINE,E.POLYGON,E.TEXT,E.PATH,E.HTML]),mc=function(){function t(){}var e=t.prototype;return e.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Dr.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=e.parentNode)||null==(r=r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||Br.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Br.OUTSIDE,i.visible))},e.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Br.OUTSIDE||n===Br.INSIDE)return n;for(var i=Br.INSIDE,a=-1<vc.indexOf(t.nodeName),o=0,s=r.length;o<s;++o){var l=1<<o;if(0!=(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,c=c.distance;if(qt(u,e.getPositiveFarPoint(r[o]))+c<0)return Br.OUTSIDE;qt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},t}(),bc=function(){function c(){this.rBush=void 0,this.toSync=new Set}var t=c.prototype;return t.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,O.styleValueRegistry.recalc(t),O.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),O.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tapPromise(c.tag,ui(M().mark(function t(){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:l.addEventListener(w.MOUNTED,r),l.addEventListener(w.UNMOUNTED,i),l.addEventListener(w.ATTR_MODIFIED,e),l.addEventListener(w.BOUNDS_CHANGED,n);case 4:case"end":return t.stop()}},t)}))),o.hooks.destroy.tap(c.tag,function(){l.removeEventListener(w.MOUNTED,r),l.removeEventListener(w.UNMOUNTED,i),l.removeEventListener(w.ATTR_MODIFIED,e),l.removeEventListener(w.BOUNDS_CHANGED,n)}),o.hooks.endFrame.tap(c.tag,function(){a.syncRTree()})},t.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=a.getMin())[0],n=n[1],r=(a=a.getMax())[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.id=t.entity,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},c}(),xc=(bc.tag="Prepare",(Fw=sc=sc||{}).READY="ready",Fw.BEFORE_RENDER="beforerender",Fw.RERENDER="rerender",Fw.AFTER_RENDER="afterrender",Fw.BEFORE_DESTROY="beforedestroy",Fw.AFTER_DESTROY="afterdestroy",Fw.RESIZE="resize",Fw.DIRTY_RECTANGLE="dirtyrectangle",new mo(w.MOUNTED)),wc=new mo(w.UNMOUNTED),kc=new mo(sc.BEFORE_RENDER),Ec=new mo(sc.RERENDER),Mc=new mo(sc.AFTER_RENDER),Oc=function(k){function t(t){var e=k.call(this)||this,n=(e.document=void 0,e.customElements=void 0,e.requestAnimationFrame=void 0,e.cancelAnimationFrame=void 0,e.devicePixelRatio=void 0,e.supportsPointerEvents=void 0,e.supportsTouchEvents=void 0,e.isTouchEvent=void 0,e.isMouseEvent=void 0,e.Element=Ro,e.frameId=void 0,e.inited=!1,e.readyPromise=void 0,e.resolveReadyPromise=void 0,e.context={},e.document=new wo,e.document.defaultView=yi(e),e.customElements=new go,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,y=t.supportsTouchEvents,v=t.supportsCSSTransform,m=t.isTouchEvent,t=t.isMouseEvent,b=(b=n,x=yi(e),b&&(b="string"==typeof b?b:b.id||Jr++,Zr[b]&&Zr[b].destroy(),Zr[b]=x),a),x=o,w=s;return r&&(w=1<=(w=s||Qr&&window.devicePixelRatio||1)?Math.ceil(w):1,b=a||("auto"===(a=ni(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/w,x=o||("auto"===(a=ni(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/w),e.devicePixelRatio=w,e.requestAnimationFrame=null!=f?f:Dl.bind(O.globalThis),e.cancelAnimationFrame=null!=d?d:zl.bind(O.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in O.globalThis,e.supportsPointerEvents=null!=g?g:!!O.globalThis.PointerEvent,e.isTouchEvent=null!=m?m:function(t){return e.supportsTouchEvents&&t instanceof O.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!O.globalThis.MouseEvent||t instanceof O.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof O.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:b,height:x,renderer:l,offscreenCanvas:i,devicePixelRatio:w,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:v}),e.initDefaultCamera(b,x),ui(M().mark(function t(){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.initRenderer(l);case 2:e.dispatchEvent(new mo(sc.READY)),e.readyPromise&&e.resolveReadyPromise();case 4:case"end":return t.stop()}},t)}))(),e}s(t,k);var e=t.prototype;return e.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.initDefaultCamera=function(t,e){var n=this,r=new O.CameraContribution;r.setType(Tl.EXPLORING,Pl.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(Xl,function(){n.context.renderingContext.renderReasons.add(Ul.CAMERA_CHANGED)}),this.context.camera=r},e.getConfig=function(){return this.context.config},e.getRoot=function(){return this.document.documentElement},e.getCamera=function(){return this.context.camera},e.getContextService=function(){return this.context.contextService},e.getEventService=function(){return this.context.eventService},e.getRenderingService=function(){return this.context.renderingService},e.getRenderingContext=function(){return this.context.renderingContext},e.getStats=function(){return this.getRenderingService().getStats()},e.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new mo(sc.BEFORE_DESTROY)),this.frameId&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new mo(sc.AFTER_DESTROY))},e.changeSize=function(t,e){this.resize(t,e)},e.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===Ll.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new mo(sc.RESIZE,{width:t,height:e}))},e.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.removeChildren=function(){this.document.documentElement.removeChildren()},e.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.render=function(){var t=this;this.dispatchEvent(kc),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(Ec)}),this.dispatchEvent(Mc)},e.run=function(){var e=this;(function t(){e.render(),e.frameId=requestAnimationFrame(t)})()},e.initRenderer=function(){var e=ui(M().mark(function t(e){return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Z,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new yc,new bc,new gc,new pc([new mc])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(di({},O,this.context)),this.context.renderingService=new rc(O,this.context),this.context.eventService=new ec(O,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(O)})},e.setRenderer=function(){var e=ui(M().mark(function t(e){var n,r;return M().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer===e)return t.abrupt("return");t.next=3;break;case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach(function(t){t.destroy(O)}),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),e.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(wc):(wc.target=t,this.dispatchEvent(wc,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(xc):(xc.target=t,this.dispatchEvent(xc,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach(function(t){e.mountChildren(t)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},fi(t,[{key:"ready",get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),t}(bo);function Sc(t,e){return(Sc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}r=function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).landmarks=[],t.landmarkAnimationID=void 0,t}t=i,(n=e).prototype=Object.create(t.prototype),Sc(n.prototype.constructor=n,t);var n=e.prototype;return n.rotate=function(t,e,n){if(this.relElevation=ls(e),this.relAzimuth=ls(t),this.relRoll=ls(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Tl.EXPLORING){e=ie(re(),[1,0,0],us((this.rotateWorld?1:-1)*this.relElevation)),t=ie(re(),[0,1,0],us((this.rotateWorld?1:-1)*this.relAzimuth)),n=ie(re(),[0,0,1],us(this.relRoll)),t=ae(re(),t,e),t=ae(re(),t,n),e=Lt(ht(),t);xt(this.matrix,this.matrix,[0,0,-this.distance]),bt(this.matrix,this.matrix,e),xt(this.matrix,this.matrix,[0,0,this.distance])}else{if(90<Math.abs(this.elevation))return this;this.computeMatrix()}return this._getAxes(),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getPosition():this.type===Tl.TRACKING&&this._getFocalPoint(),this._update(),this},n.pan=function(t,e){t=cs(t,e,0),e=It(this.position);return Wt(e,e,Vt(v(),this.right,t[0])),Wt(e,e,Vt(v(),this.up,t[1])),this._setPosition(e),this.triggerUpdate(),this},n.dolly=function(t){var e=this.forward,n=It(this.position),t=(this.dollyingStep,this.distance+t*this.dollyingStep),t=Math.max(Math.min(t,this.maxDistance),this.minDistance)-this.distance;return n[0]+=t*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===Tl.ORBITING||this.type===Tl.EXPLORING?this._getDistance():this.type===Tl.TRACKING&&Wt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},n.createLandmark=function(t,e){var e=e=void 0===e?{}:e,n=e.position,n=void 0===n?this.position:n,r=e.focalPoint,r=void 0===r?this.focalPoint:r,i=e.roll,e=e.zoom,a=new O.CameraContribution,n=(a.setType(this.type,void 0),a.setPosition(n[0],n[1]||this.position[1],n[2]||this.position[2]),a.setFocalPoint(r[0],r[1]||this.focalPoint[1],r[2]||this.focalPoint[2]),a.setRoll(i||this.roll),a.setZoom(e||this.zoom),{name:t,matrix:ft(a.getWorldTransform()),right:It(a.right),up:It(a.up),forward:It(a.forward),position:It(a.getPosition()),focalPoint:It(a.getFocalPoint()),distanceVector:It(a.getDistanceVector()),distance:a.getDistance(),dollyingStep:a.getDollyingStep(),azimuth:a.getAzimuth(),elevation:a.getElevation(),roll:a.getRoll(),relAzimuth:a.relAzimuth,relElevation:a.relElevation,relRoll:a.relRoll,zoom:a.getZoom()});return this.landmarks.push(n),n},n.gotoLandmark=function(e,t){var n,s,r,i,l,c,u,h,f,d,p,g,y=this,a=(void 0===t&&(t={}),fn(e)?this.landmarks.find(function(t){return t.name===e}):e);a&&(n=void 0===(n=(t=pn(t)?{duration:t}:t).easing)?"linear":n,r=t.duration,s=void 0===r?100:r,r=void 0===(r=t.easingFunction)?void 0:r,t=t.onfinish,i=void 0===t?void 0:t,l=.01,0===s?(this.syncFromLandmark(a),i&&i()):(void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID),c=a.position,u=a.focalPoint,h=a.zoom,f=a.roll,d=r||O.EasingFunction(n),g=function(){y.setFocalPoint(u),y.setPosition(c),y.setRoll(f),y.setZoom(h),y.computeMatrix(),y.triggerUpdate(),i&&i()},this.canvas.requestAnimationFrame(function t(e){var n,r,i,a,o,e=e-(p=void 0===p?e:p);s<e||(n=d(e/s),r=v(),i=v(),a=1,o=0,Xt(r,y.focalPoint,u,n),Xt(i,y.position,c,n),o=y.roll*(1-n)+f*n,a=y.zoom*(1-n)+h*n,y.setFocalPoint(r),y.setPosition(i),y.setRoll(o),y.setZoom(a),Qt(r,u)+Qt(i,c)<=l)?g():(y.computeMatrix(),y.triggerUpdate(),e<s&&(y.landmarkAnimationID=y.canvas.requestAnimationFrame(t)))})))},n.syncFromLandmark=function(t){this.matrix=dt(this.matrix,t.matrix),this.right=zt(this.right,t.right),this.up=zt(this.up,t.up),this.forward=zt(this.forward,t.forward),this.position=zt(this.position,t.position),this.focalPoint=zt(this.focalPoint,t.focalPoint),this.distanceVector=zt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(gl);function _c(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(r.key),r)}}function Ac(t,e,n){e&&_c(t.prototype,e),n&&_c(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function Tc(t,e){return(Tc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}O.CameraContribution=r;function Pc(b,e,x,n){if(!(0<=b&&b<=1&&0<=x&&x<=1))throw new Error("bezier x values must be in [0, 1] range");if(b===e&&x===n)return function(t){return t};for(var w=new(tu?Float32Array:Array)(11),t=0;t<11;++t)w[t]=iu(.1*t,b,x);function r(t){for(var e=0,n=1;10!==n&&w[n]<=t;++n)e+=.1;var r=e+.1*((t-w[--n])/(w[n+1]-w[n])),i=au(r,b,x);if(.001<=i){for(var a=t,o=r,s=b,l=x,c=0;c<Zc;++c){var u=au(o,s,l);if(0===u)return o;o-=(iu(o,s,l)-a)/u}return o}if(0===i)return r;for(var h,f,d=t,p=e,g=e+.1,y=b,v=x,m=0;0<(h=iu(f=p+(g-p)/2,y,v)-d)?g=f:p=f,Math.abs(h)>Jc&&++m<Qc;);return f}return function(t){return 0===t||1===t?t:iu(r(t),e,n)}}function Lc(t){return Math.pow(t,2)}function Cc(t){return Math.pow(t,3)}function Nc(t){return Math.pow(t,4)}function jc(t){return Math.pow(t,5)}function Rc(t){return Math.pow(t,6)}function Fc(t){return 1-Math.cos(t*Math.PI/2)}function Bc(t){return 1-Math.sqrt(1-t*t)}function Ic(t){return t*t*(3*t-2)}function Dc(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}function zc(t,e){var n=(e=e=void 0===e?[]:e)[0],e=void 0===(e=e[1])?.5:e,n=dn(Number(void 0===n?1:n),1,10),e=dn(Number(e),.1,2);return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-e/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/e)}function Gc(t,e,n){var r=(e=e=void 0===e?[]:e)[0],i=void 0===(i=e[1])?100:i,a=void 0===(a=e[2])?10:a,e=void 0===(e=e[3])?0:e,r=dn(void 0===r?1:r,.1,1e3),i=dn(i,.1,1e3),a=dn(a,.1,1e3),e=dn(e,.1,1e3),o=Math.sqrt(i/r),i=(a=a/(2*Math.sqrt(i*r)))<1?o*Math.sqrt(1-a*a):0,r=a<1?(a*o-e)/i:-e+o,e=n?n*t/1e3:t,e=a<1?Math.exp(-e*a*o)*(+Math.cos(i*e)+r*Math.sin(i*e)):(1+r*e)*Math.exp(-e*o);return 0===t||1===t?t:1-e}function Wc(t,e){var e=e=void 0===e?[]:e,n=void 0===(n=e[0])?10:n;return("start"==e[1]?Math.ceil:Math.floor)(dn(t,0,1)*n)/n}function Hc(t,e){var n=(e=e=void 0===e?[]:e)[0],r=e[1],i=e[2],e=e[3];return Pc(n,r,i,e)(t)}function Vc(r){return function(t,e,n){return 1-r(1-t,e=void 0===e?[]:e,n)}}function Yc(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?r(2*t,e,n)/2:1-r(-2*t+2,e,n)/2}}function qc(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?(1-r(1-2*t,e,n))/2:(r(2*t-1,e,n)+1)/2}}function Uc(t){return t}var Xc=function(i){var t,e;function n(t,e,n,r){t=i.call(this,t)||this;return t.currentTime=void 0,t.timelineTime=void 0,t.currentTime=n,t.timelineTime=r,t.target=e,t.type="finish",t.bubbles=!1,t.currentTarget=e,t.defaultPrevented=!1,t.eventPhase=t.AT_TARGET,t.timeStamp=Date.now(),t.currentTime=n,t.timelineTime=r,t}return e=i,(t=n).prototype=Object.create(e.prototype),Tc(t.prototype.constructor=t,e),n}(vo),$c=0,Kc=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,((this.effect=t).animation=this).timeline=e,this.id=""+$c++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null==(t=this.effect)?void 0:t.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=0<this._playbackRate?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null==(t=this.effect)?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(0<=this.playbackRate)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},e.persist=function(){throw new Error(oi)},e.addEventListener=function(t,e,n){throw new Error(oi)},e.removeEventListener=function(t,e,n){throw new Error(oi)},e.dispatchEvent=function(t){throw new Error(oi)},e.commitStyles=function(){throw new Error(oi)},e.ensureAlive=function(){var t;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null==(t=this.effect)||!t.update(-1)):this._inEffect=!(null==(t=this.effect)||!t.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=0<this._playbackRate?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e,n=this;this._isFinished?this._finishedFlag||(this.onfinish&&(e=new Xc(null,this,this.currentTime,t),setTimeout(function(){n.onfinish&&n.onfinish(e)})),this._finishedFlag=!0):(this.onframe&&"running"===this.playState&&(t=new Xc(null,this,this.currentTime,t),this.onframe(t)),this._finishedFlag=!1)},Ac(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var n=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){n.resolveReadyPromise=function(){t(n)},n.rejectReadyPromise=function(){e(new Error)}}),this.pending)||this.resolveReadyPromise(),this.readyPromise}},{key:"finished",get:function(){var n=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){n.resolveFinishedPromise=function(){t(n)},n.rejectFinishedPromise=function(){e(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null==(e=this.timeline)?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))}},{key:"startTime",get:function(){return this._startTime},set:function(t){null!==t&&(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle||(this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()))}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){var e;t!==this._playbackRate&&(this.updatePromises(),e=this.currentTime,this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises())}},{key:"_isFinished",get:function(){return!this._idle&&(0<this._playbackRate&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}(),Zc=4,Jc=1e-7,Qc=10,tu="function"==typeof Float32Array,eu=function(t,e){return 1-3*e+3*t},nu=function(t,e){return 3*e-6*t},ru=function(t){return 3*t},iu=function(t,e,n){return((eu(e,n)*t+nu(e,n))*t+ru(e))*t},au=function(t,e,n){return 3*eu(e,n)*t*t+2*nu(e,n)*t+ru(e)},eo=Pc(.42,0,1,1),ou={steps:Wc,"step-start":function(t){return Wc(t,[1,"start"])},"step-end":function(t){return Wc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Hc,ease:function(t){return Hc(t,[.25,.1,.25,1])},in:eo,out:Vc(eo),"in-out":Yc(eo),"out-in":qc(eo),"in-quad":Lc,"out-quad":Vc(Lc),"in-out-quad":Yc(Lc),"out-in-quad":qc(Lc),"in-cubic":Cc,"out-cubic":Vc(Cc),"in-out-cubic":Yc(Cc),"out-in-cubic":qc(Cc),"in-quart":Nc,"out-quart":Vc(Nc),"in-out-quart":Yc(Nc),"out-in-quart":qc(Nc),"in-quint":jc,"out-quint":Vc(jc),"in-out-quint":Yc(jc),"out-in-quint":qc(jc),"in-expo":Rc,"out-expo":Vc(Rc),"in-out-expo":Yc(Rc),"out-in-expo":qc(Rc),"in-sine":Fc,"out-sine":Vc(Fc),"in-out-sine":Yc(Fc),"out-in-sine":qc(Fc),"in-circ":Bc,"out-circ":Vc(Bc),"in-out-circ":Yc(Bc),"out-in-circ":qc(Bc),"in-back":Ic,"out-back":Vc(Ic),"in-out-back":Yc(Ic),"out-in-back":qc(Ic),"in-bounce":Dc,"out-bounce":Vc(Dc),"in-out-bounce":Yc(Dc),"out-in-bounce":qc(Dc),"in-elastic":zc,"out-elastic":Vc(zc),"in-out-elastic":Yc(zc),"out-in-elastic":qc(zc),spring:Gc,"spring-in":Gc,"spring-out":Vc(Gc),"spring-in-out":Yc(Gc),"spring-out-in":qc(Gc)},su=function(t){return("-"===(t=(t=t).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()};function lu(n,r){return function(t){var e;return 1<=t?1:(t+=r*(e=1/n))-t%e}}var ao="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",cu=new RegExp("cubic-bezier\\("+ao+","+ao+","+ao+","+ao+"\\)"),uu=/steps\(\s*(\d+)\s*\)/,hu=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function fu(t){var e=cu.exec(t);return e?Pc.apply(void 0,e.slice(1).map(Number)):(e=uu.exec(t))?lu(Number(e[1]),0):(e=hu.exec(t))?lu(Number(e[1]),{start:1,middle:.5,end:0}[e[2]]):ou[su(t)]||ou.linear}function du(t){return Math.abs((0!==(e=t).duration&&0!==e.iterations?("auto"===e.duration?0:Number(e.duration))*(null!=(e=e.iterations)?e:1):0)/(t.playbackRate||1));var e}var pu=0,gu=1,yu=2,vu=3;function mu(t,e,n){c=t,i=n;var r,i,a,o,s,l=null===(l=e)?pu:(r=i.endTime,l<Math.min(i.delay,r)?gu:l>=Math.min(i.delay+c+i.endDelay,r)?yu:vu),c=function(t,e,n,r,i){switch(r){case gu:return"backwards"===e||"both"===e?0:null;case vu:return n-i;case yu:return"forwards"===e||"both"===e?t:null;case pu:return null}}(t,n.fill,e,l,n.delay);return null===c?null:(i="auto"===n.duration?0:n.duration,r=i,t=l,e=n.iterations,o=c,s=n.iterationStart,0===r?t!==gu&&(s+=e):s+=o/r,e=t=s,o=n.iterationStart,s=l,a=n.iterations,c=c,i=i,e=o=0!==(o=e===1/0?o%1:e%1)||s!==yu||0===a||0===c&&0!==i?o:1,s=n.iterations,a=e,c=t,i=l===yu&&s===1/0?1/0:1===a?Math.floor(c)-1:Math.floor(c),o=n.direction,t=i,l=e,a="normal"===(s="normal"!==(s=o)&&"reverse"!==o&&(t=t,"alternate-reverse"===o&&(t+=1),s="normal",t!==1/0)&&t%2!=0?"reverse":s)?l:1-l,n.currentIteration=i,n.progress=a,n.easingFunction(a))}function bu(t,e,n){var a=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r]){var a;xu(i)&&(a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:fu(t[r].easing)||e.easingFunction,value:t[r][i]},n[i]=n[i]||[],n[i].push(a))}return n}(t,e),o=function(t,e){var n,r=[];for(n in t)for(var i=t[n],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,h=c;0===a&&(u=-1/0,0===c)&&(s=o),a===i.length-2&&(h=1/0,1===l)&&(o=s),r.push({applyFrom:u,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:n,interpolation:function(t,e,n,r){var i=Wl[t];if(i&&i.syntax&&i.int){i=O.styleValueRegistry.getPropertySyntax(i.syntax);if(i){var a,o=O.styleValueRegistry.parseProperty(t,e,r),s=O.styleValueRegistry.parseProperty(t,n,r),o=O.styleValueRegistry.computeProperty(t,o,r),t=O.styleValueRegistry.computeProperty(t,s,r),s=i.mixer(o,t,r);if(s)return a=wu.apply(void 0,s),function(t){return 0===t?e:1===t?n:a(t)}}}return wu(!1,!0,function(t){return t?n:e})}(n,i[o].value,i[s].value,e)})}return r.sort(function(t,e){return t.startOffset-e.startOffset}),r}(a,n);return function(r,i){if(null!==i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(t){var e=i-t.startOffset,n=t.endOffset-t.startOffset,e=0==n?0:t.easingFunction(e/n);r.style[t.property]=t.interpolation(e)});else for(var t in a)xu(t)&&(r.style[t]=null)}}function xu(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var wu=function(e,n,r){return function(t){return r(function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)&&e.length===n.length){for(var i=[],a=0;a<e.length;a++)i.push(t(e[a],n[a],r));return i}throw new Error("Mismatched interpolation arguments "+e+":"+n)}(e,n,t))}};var ku=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Uc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return Ac(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=fu(t),this._easing=t}}]),t}();function Eu(t,i){if(null===t)return[];for(var e=(t=Array.isArray(t)?t:function(t){var e,n=[];for(e in t)if(!(e in["easing","offset","composite"]))for(var r,i=t[e],a=(i=Array.isArray(i)?i:[i]).length,o=0;o<a;o++)n[o]||(r={},"offset"in t&&(r.offset=Number(t.offset)),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),n[o]=r),void 0!==i[o]&&null!==i[o]&&(n[o][e]=i[o]);return n.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),n}(t)).map(function(t){var e,n={};for(e in null!=i&&i.composite&&(n.composite="auto"),t){var r=t[e];if("offset"===e){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||1<r)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===e&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error(r+" compositing is not supported");n[e]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==i?void 0:i.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),n=!0,r=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(_(o))n=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}if(e=e.filter(function(t){return 0<=Number(t.offset)&&Number(t.offset)<=1}),!n)for(var s=e.length,l=(e[s-1].computedOffset=Number(null!=(t=e[s-1].offset)?t:1),1<s&&(e[0].computedOffset=Number(null!=(t=e[0].offset)?t:0)),0),c=Number(e[0].computedOffset),u=1;u<s;u++){var h=e[u].computedOffset;if(!_(h)&&!_(c)){for(var f=1;f<u-l;f++)e[l+f].computedOffset=c+(Number(h)-c)*f/(u-l);l=u,c=Number(h)}}return e}var Mu="backwards|forwards|both|none".split("|"),Ou="reverse|alternate|alternate-reverse".split("|");function Su(t,e){var n,r,i;return t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=(r=t)?r:{duration:"auto"}),n=t,r=e,i=new ku,r&&(i.fill="both",i.duration="auto"),"number"!=typeof n||isNaN(n)?void 0!==n&&Object.keys(n).forEach(function(t){void 0===n[t]||null===n[t]||"auto"===n[t]||!("number"!=typeof i[t]&&"duration"!==t||"number"==typeof n[t]&&!isNaN(n[t]))||"fill"===t&&-1===Mu.indexOf(n[t])||"direction"===t&&-1===Ou.indexOf(n[t])||(i[t]=n[t])}):i.duration=n,i}var _u=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=Su(n,!1),(this.timing.effect=this).timing.activeDuration=du(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Eu(e,this.timing),this.interpolations=bu(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=mu(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Eu(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(t){n.timing[t]=e[t]})},t}();function Au(t,e){return Number(t.id)-Number(e.id)}n=function(){function t(t){var n=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],e<Number(n.currentTime)&&(e=Number(n.currentTime)),n.animations.sort(Au),n.animations=n.tick(e,!0,n.animations)[0],t.forEach(function(t){t[1](e)}),n.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t,e,n){t=new _u(t,e,n),e=new Kc(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;this.inTick||(t.markTarget(),(t=t.targetAnimations()).sort(Au),this.tick(Number(this.currentTime),!1,t.slice())[1].forEach(function(t){t=e.animations.indexOf(t);-1!==t&&e.animations.splice(t,1)}),this.applyPendingEffects())},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){null!=t&&t.applyInterpolations()}),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(e){var n=this;return this.rAF(function(t){n.updateAnimationsPromises(),e(t),n.updateAnimationsPromises()})},e.tick=function(n,r,t){var i=this,a=(this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=n,this.ticking=!1,[]),o=[],s=[],l=[];return t.forEach(function(t){t.tick(n,r),t._inEffect?(o.push(t.effect),t.markTarget()):(a.push(t.effect),t.unmarkTarget()),t._needsTick&&(i.ticking=!0);var e=t._inEffect||t._needsTick;((t._inTimeline=e)?s:l).push(t)}),(t=this.pendingEffects).push.apply(t,a),(t=this.pendingEffects).push.apply(t,o),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,l]},t}();function Tu(t,e){return(Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Pu(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function Lu(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(0,0,n,0,2*Math.PI))}function Cu(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,y=0,v=0;u&&Po(u)&&f&&(n=o-i,r=s-a,v=Math.atan2(r,n),d=Math.cos(v)*(f||0),p=Math.sin(v)*(f||0)),h&&Po(h)&&e&&(n=i-o,r=a-s,v=Math.atan2(r,n),g=Math.cos(v)*(e||0),y=Math.sin(v)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+y)}function Nu(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,e=e.path,u=e.absolutePath,h=e.segments,f=0,d=0,p=0,g=0,e=0;i&&Po(i)&&l&&(r=(i=i.parentNode.getStartTangent())[0],i=i[1],n=r[0]-i[0],r=r[1]-i[1],e=Math.atan2(r,n),f=Math.cos(e)*(l||0),d=Math.sin(e)*(l||0)),s&&Po(s)&&c&&(l=(i=s.parentNode.getEndTangent())[0],s=i[1],n=l[0]-s[0],r=l[1]-s[1],e=Math.atan2(r,n),p=Math.cos(e)*(c||0),g=Math.sin(e)*(c||0));for(var y=0;y<u.length;y++){var v=u[y],m=v[0],b=u[y+1],x=0===y&&(0!==f||0!==d),w=(y===u.length-1||b&&("M"===b[0]||"Z"===b[0]))&&0!==p&&0!==g;switch(m){case"M":x?(t.moveTo(v[1]-a+f,v[2]-o+d),t.lineTo(v[1]-a,v[2]-o)):t.moveTo(v[1]-a,v[2]-o);break;case"L":w?t.lineTo(v[1]-a+p,v[2]-o+g):t.lineTo(v[1]-a,v[2]-o);break;case"Q":t.quadraticCurveTo(v[1]-a,v[2]-o,v[3]-a,v[4]-o),w&&t.lineTo(v[3]-a+p,v[4]-o+g);break;case"C":t.bezierCurveTo(v[1]-a,v[2]-o,v[3]-a,v[4]-o,v[5]-a,v[6]-o),w&&t.lineTo(v[5]-a+p,v[6]-o+g);break;case"A":var k,E,M=h[y].arcParams,O=M.cx,S=M.cy,_=M.rx,A=M.ry,T=M.startAngle,P=M.endAngle,L=M.xRotation,M=M.sweepFlag;t.ellipse?t.ellipse(O-a,S-o,_,A,L,T,P,!!(1-M)):(k=A<_?_:A,E=A<_?1:_/A,A=A<_?A/_:1,t.translate(O-a,S-o),t.rotate(L),t.scale(E,A),t.arc(0,0,k,T,P,!!(1-M)),t.scale(1/E,1/A),t.rotate(-L),t.translate(-(O-a),-(S-o))),w&&t.lineTo(v[6]-a+p,v[7]-o+g);break;case"Z":t.closePath()}}}function ju(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,v=0,m=0,b=0;i&&Po(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&Po(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),v=Math.cos(b)*(c||0),m=Math.sin(b)*(c||0)),t.moveTo(e+(g||v),f+(y||m));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function Ru(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,v=0,m=0,b=0;i&&Po(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&Po(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),v=Math.cos(b)*(c||0),m=Math.sin(b)*(c||0)),t.moveTo(e+g,f+y);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+v,p+m)}function Fu(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=o.map(function(t){return dn(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}O.EasingFunction=fu,O.AnimationTimeline=n;var Bu=function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="canvas-path-generator",t}t=i,(n=e).prototype=Object.create(t.prototype),Tu(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){(t={})[E.CIRCLE]=Pu,t[E.ELLIPSE]=Lu,t[E.RECT]=Fu,t[E.LINE]=Cu,t[E.POLYLINE]=Ru,t[E.POLYGON]=ju,t[E.PATH]=Nu,t[E.TEXT]=void 0,t[E.GROUP]=void 0,t[E.IMAGE]=void 0,t[E.HTML]=void 0,t[E.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},n.destroy=function(){delete this.context.pathGeneratorFactory},e}(Jl);function Iu(){Iu=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Du(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function zu(t,e){return(zu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Gu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Wu(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?Gu(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gu(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var Hu=v(),Vu=v(),Yu=v(),qu=ht(),Uu=function(){function s(){var s=this;this.canvasConfig=void 0,this.pathGeneratorFactory=void 0,this.pointInPathPickerFactory=void 0,this.isHit=function(t,e,n,r,i){var a=s.pointInPathPickerFactory[t.nodeName];if(a){var n=vt(qu,n),e=$t(Vu,Gt(Yu,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,o=t.parsedStyle.anchor;if(e[0]+=(o&&o[0]||0)*n[0]*2,e[1]+=(o&&o[1]||0)*n[1]*2,a(t,new Wr(e[0],e[1]),r,s.isPointInPath,i))return!0}return!1},this.isPointInPath=function(t,e,n){var t=t.offscreenCanvas.getOrCreateContext(s.canvasConfig.offscreenCanvas),r=s.pathGeneratorFactory[e.nodeName];return r&&(t.beginPath(),r(t,e.parsedStyle),t.closePath()),t.isPointInPath(n.x,n.y)}}var t=s.prototype;return t.apply=function(t,n){var r=this,e=t.config,i=t.renderingService,a=t.renderingContext,o=t.pathGeneratorFactory,t=t.pointInPathPickerFactory,l=(this.canvasConfig=e,this.pathGeneratorFactory=o,this.pointInPathPickerFactory=t,null==(e=a.root)?void 0:e.ownerDocument);i.hooks.pick.tapPromise(s.tag,function(){s=Iu().mark(function t(e){return Iu().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",r.pick(l,e,n));case 1:case"end":return t.stop()}},t)});var s,e=function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Du(r,e,n,i,a,"next",t)}function a(t){Du(r,e,n,i,a,"throw",t)}i(void 0)})};return function(t){return e.apply(this,arguments)}}()),i.hooks.pickSync.tap(s.tag,function(t){return r.pick(l,t,n)})},t.pick=function(t,e,n){for(var r=e.topmost,i=e.position,a=i.x,i=i.y,o=Gt(Hu,a,i,0),s=[],l=Wu(t.elementsFromBBox(o[0],o[1],o[0],o[1]));!(c=l()).done;){var c=c.value,u=c.getWorldTransform();if(this.isHit(c,o,u,!1,n)){u=ei(c);if(u){u=u.parsedStyle.clipPath;if(this.isHit(u,o,u.getWorldTransform(),!0,n)){if(r)return e.picked=[c],e;s.push(c)}}else{if(r)return e.picked=[c],e;s.push(c)}}}return e.picked=s,e},s}();function Xu(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function $u(t,e){return Math.abs(t-e)<.001}function Ku(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function Zu(t){return(t+2*Math.PI)%(2*Math.PI)}Uu.tag="CanvasPicker";var Ju={box:function(t,e,n,r){return Ku([t,n],[e,r])},length:Xu,pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return o<0?Xu(t,e,i,a):(n-t)*(n-t)+(r-e)*(r-e)<o?Xu(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){n=[n-t,r-e];return xe(n,[0,0])?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(me(r=[-n[1],n[0]],r),Math.abs(be([i-t,a-e],r)))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Qu(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=Xu(l[0],l[1],p[0],p[1]);p<s&&(o=d,s=p)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(var s=1/0,g=0;g<32&&!(h<1e-4);g++){var y=o-h,v=o+h,m=[i.apply(void 0,t.concat([y])),i.apply(void 0,e.concat([y]))],m=Xu(l[0],l[1],m[0],m[1]);0<=y&&m<s?(o=y,s=m):(y=[i.apply(void 0,t.concat([v])),i.apply(void 0,e.concat([v]))],m=Xu(l[0],l[1],y[0],y[1]),v<=1&&m<s?(o=v,s=m):h*=.5)}return{x:i.apply(void 0,t.concat([o])),y:i.apply(void 0,e.concat([o]))}}function th(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function eh(t,e,n){n=t+n-2*e;return $u(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function nh(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function rh(t,e,n,r,i,a,o){var s=th(t,n,i,o),l=th(e,r,a,o),c=Ju.pointAt(t,e,n,r,o),n=Ju.pointAt(n,r,i,a,o);return[[t,e,c.x,c.y,s,l],[s,l,n.x,n.y,i,a]]}function ih(t,e,n,r,i,a,o){return 0===o?(Xu(t,e,n,r)+Xu(n,r,i,a)+Xu(t,e,i,a))/2:(e=(t=rh(t,e,n,r,i,a,.5))[0],n=t[1],e.push(o-1),n.push(o-1),ih.apply(void 0,e)+ih.apply(void 0,n))}var ah={box:function(t,e,n,r,i,a){var o=eh(t,n,i)[0],s=eh(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push(th(t,n,i,o)),void 0!==s&&c.push(th(e,r,a,s)),Ku(l,c)},length:function(t,e,n,r,i,a){return ih(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,a,o,s){return Qu([t,n,i],[e,r,a],o,s,th)},pointDistance:function(t,e,n,r,i,a,o,s){t=this.nearestPoint(t,e,n,r,i,a,o,s);return Xu(t.x,t.y,o,s)},interpolationAt:th,pointAt:function(t,e,n,r,i,a,o){return{x:th(t,n,i,o),y:th(e,r,a,o)}},divide:rh,tangentAngle:function(t,e,n,r,i,a,o){t=nh(t,n,i,o),n=nh(e,r,a,o);return Zu(Math.atan2(n,t))}};function oh(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function sh(t,e,n,r,i){var a=1-i;return 3*(a*a*(e-t)+2*a*i*(n-e)+i*i*(r-n))}function lh(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return $u(r,0)?$u(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):$u(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function ch(t,e,n,r,i,a,o,s,l){var c=oh(t,n,i,o,l),u=oh(e,r,a,s,l),h=Ju.pointAt(t,e,n,r,l),n=Ju.pointAt(n,r,i,a,l),r=Ju.pointAt(i,a,o,s,l),i=Ju.pointAt(h.x,h.y,n.x,n.y,l),a=Ju.pointAt(n.x,n.y,r.x,r.y,l);return[[t,e,h.x,h.y,i.x,i.y,c,u],[c,u,a.x,a.y,r.x,r.y,o,s]]}function uh(t,e,n,r,i,a,o,s,l){if(0===l){for(var c=[t,n,i,o],u=[e,r,a,s],h=0,f=c.length,d=0;d<f;d++)h+=Xu(c[d],u[d],c[(d+1)%f],u[(d+1)%f]);return h/2}t=ch(t,e,n,r,i,a,o,s,.5),e=[].concat(t[0],[l-1]),n=[].concat(t[1],[l-1]);return uh.apply(void 0,e)+uh.apply(void 0,n)}var hh={extrema:lh,box:function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=lh(t,n,i,o),h=lh(e,r,a,s),f=0;f<u.length;f++)l.push(oh(t,n,i,o,u[f]));for(var d=0;d<h.length;d++)c.push(oh(e,r,a,s,h[d]));return Ku(l,c)},length:function(t,e,n,r,i,a,o,s){return uh(t,e,n,r,i,a,o,s,3)},nearestPoint:function(t,e,n,r,i,a,o,s,l,c,u){return Qu([t,n,i,o],[e,r,a,s],l,c,oh,u)},pointDistance:function(t,e,n,r,i,a,o,s,l,c,u){t=this.nearestPoint(t,e,n,r,i,a,o,s,l,c,u);return Xu(t.x,t.y,l,c)},interpolationAt:oh,pointAt:function(t,e,n,r,i,a,o,s,l){return{x:oh(t,n,i,o,l),y:oh(e,r,a,s,l)}},divide:ch,tangentAngle:function(t,e,n,r,i,a,o,s,l){t=sh(t,n,i,o,l),n=sh(e,r,a,s,l);return Zu(Math.atan2(n,t))}};function fh(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function dh(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function ph(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return fh(t.x,t.y,o,s)<=a/2}function gh(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&Ju.pointToLine(t,e,n,r,a,o)<=i/2}function yh(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(gh(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(gh(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var vh=1e-6;function mh(t){return Math.abs(t)<vh?0:t<0?-1:1}function bh(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<mh(c[1]-n)!=0<mh(u[1]-n)&&mh(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function xh(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=bh(t[i],e,n));i++);return r}function wh(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=fh(r,r,e.x,e.y),e=nl(t,i,a),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function kh(t,e,n,r){return t/(n*n)+e/(r*r)}function Eh(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=nl(t,a,o),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?kh(s,l,r+t,i+t)<=1:a?kh(s,l,r,i)<=1:!!o&&1<=kh(s,l,r-t,i-t)&&kh(s,l,r+t,i+t)<=1}function Mh(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,u=t.defY;return!(!nl(t.pointerEvents,t.fill,t.stroke)[1]&&!n||!s)&&gh(r,i,a,o,(s||0)+(l||0),e.x+(void 0===c?0:c),e.y+(void 0===u?0:u))}function Oh(t,e,n,r,i){var a=t.parsedStyle,o=a.lineWidth,s=a.increasedLineWidthForHitTesting,l=a.stroke,c=a.fill,u=a.defX,u=void 0===u?0:u,h=a.defY,h=void 0===h?0:h,f=a.path,a=nl(a.pointerEvents,c,l),c=a[0],l=a[1],a=f.segments,d=f.hasArc,p=f.polylines,f=f.polygons,g=Vs(t),y=!1;return c||n?d?r(i,t,e):xh(f,e.x+u,e.y+h)||xh(p,e.x+u,e.y+h):l||n?function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||dh(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=gh(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=ah.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=hh.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=Ge(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var y=hh.pointDistance(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=y<=e/2)return!0}}}return a}(a,(o||0)+(s||0),e.x+u,e.y+h,g):y}function Sh(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=nl(t.pointerEvents,i,r),i=t[0],r=!1;return r=(r=t[1]||n?yh(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:bh(s.points,e.x+l,e.y+c)}function _h(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,s=t.defY;return!(!nl(t.pointerEvents,t.fill,t.stroke)[1]&&!n||!r)&&yh(a.points,(r||0)+(i||0),e.x+(void 0===o?0:o),e.y+(void 0===s?0:s),!1)}function Ah(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,y=p.fill,v=p.stroke,m=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=nl(p.pointerEvents,y,v),y=p[0],v=p[1],p=(m||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(m=!1,(v||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return dn(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,f=g[0],s=g[1],c=g[2],g=g[3],m=gh(b+f,h,b+l-s,h,d,a,o)||gh(b+l,h+s,b+l,h+u-c,d,a,o)||gh(b+l-c,h+u,b+g,h+u,d,a,o)||gh(b,h+u-g,b,h+f,d,a,o)||ph(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||ph(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||ph(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||ph(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),m||!y&&!n?m:r(i,t,e)):(s=p/2,y&&v||n?dh(0-s,0-s,x+s,w+s,e.x,e.y):y?dh(0,0,x,w,e.x,e.y):!!v&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,dh(l-(d=b/2),c-d,u,b,h,f)||dh(l+u-d,c-d,b,g,h,f)||dh(l+d,c+g-d,u,b,h,f)||dh(l-d,c+d,b,g,h,f)))}var Th=function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="canvas-picker",t}t=i,(n=e).prototype=Object.create(t.prototype),zu(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){function t(){return!0}(e={})[E.CIRCLE]=wh,e[E.ELLIPSE]=Eh,e[E.RECT]=Ah,e[E.LINE]=Mh,e[E.POLYLINE]=_h,e[E.POLYGON]=Sh,e[E.PATH]=Oh,e[E.TEXT]=t,e[E.GROUP]=null,e[E.IMAGE]=t,e[E.HTML]=null,e[E.MESH]=null;var e;this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new Uu)},n.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Jl);function Ph(){Ph=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Lh(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function Ch(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Lh(r,e,n,i,a,"next",t)}function a(t){Lh(r,e,n,i,a,"throw",t)}i(void 0)})}}function Nh(){return(Nh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function jh(t,e){return(jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Rh=function(){function r(t){this.canvasRendererPluginOptions=void 0,this.context=void 0,this.pathGeneratorFactory=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=ht(),this.dprMatrix=ht(),this.tmpMat4=ht(),this.vec3a=v(),this.vec3b=v(),this.vec3c=v(),this.vec3d=v(),this.canvasRendererPluginOptions=t}var t=r.prototype;return t.apply=function(t,c){function a(t){(t=t.target.rBushNode).aabb&&h.removedRBushNodeAABBs.push(t.aabb)}function o(t){(t=t.target.rBushNode).aabb&&h.removedRBushNodeAABBs.push(t.aabb)}function u(t,e){t.isVisible()&&!t.isCulled()&&(h.renderDisplayObject(t,e,h.context,h.restoreStack,c),h.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){u(t,e)})}var h=this,f=(this.context=t).config,d=t.camera,l=t.renderingService,p=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,g=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),y=p.root.ownerDocument.defaultView;l.hooks.init.tapPromise(r.tag,Ch(Ph().mark(function t(){var e,n,r,i;return Ph().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:y.addEventListener(w.UNMOUNTED,a),y.addEventListener(w.CULLED,o),e=g.getDPR(),n=f.width,r=f.height,i=g.getContext(),h.clearRect(i,0,0,n*e,r*e,f.background);case 6:case"end":return t.stop()}},t)}))),l.hooks.destroy.tap(r.tag,function(){y.removeEventListener(w.UNMOUNTED,a),y.removeEventListener(w.CULLED,o)}),l.hooks.beginFrame.tap(r.tag,function(){var t=g.getContext(),e=g.getDPR(),n=f.width,r=f.height,i=h.canvasRendererPluginOptions,a=i.dirtyObjectNumThreshold,i=i.dirtyObjectRatioThreshold,o=l.getStats(),s=o.total,o=o.rendered,s=o/s;h.clearFullScreen=l.disableDirtyRectangleRendering()||a<o&&i<s,t&&(t.resetTransform(),h.clearFullScreen)&&h.clearRect(t,0,0,n*e,r*e,f.background)});l.hooks.endFrame.tap(r.tag,function(){var e=g.getContext(),t=g.getDPR();if(Ot(h.dprMatrix,k(t,t,1)),bt(h.vpMatrix,h.dprMatrix,d.getOrthoMatrix()),h.clearFullScreen)u(p.root,e);else{t=h.safeMergeAABB.apply(h,[h.mergeDirtyAABBs(h.renderQueue)].concat(h.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Dr;return i.setMinMax(k(e,n,0),k(r,t,0)),i})));if(h.removedRBushNodeAABBs=[],Dr.isEmpty(t))return void(h.renderQueue=[]);var n=h.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=$t(h.vec3a,k(r,i,0),h.vpMatrix),s=$t(h.vec3b,k(r+a,i,0),h.vpMatrix),l=$t(h.vec3c,k(r,i+n,0),h.vpMatrix),r=$t(h.vec3d,k(r+a,i+n,0),h.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),h.clearRect(e,s,r,l,n,f.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(h.vpMatrix[0],h.vpMatrix[1],h.vpMatrix[4],h.vpMatrix[5],h.vpMatrix[12],h.vpMatrix[13]),f.renderer.getConfig().enableDirtyRectangleRenderingDebug&&y.dispatchEvent(new mo(sc.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),h.searchDirtyObjects(c,t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&h.renderDisplayObject(t,e,h.context,h.restoreStack,c)}),e.restore(),h.renderQueue.forEach(function(t){h.saveDirtyAABB(t)}),h.renderQueue=[]}h.restoreStack.forEach(function(){e.restore()}),h.restoreStack=[]}),l.hooks.render.tap(r.tag,function(t){h.clearFullScreen||h.renderQueue.push(t)})},t.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},t.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==E.LINE)&&t.nodeName!==E.PATH&&t.nodeName!==E.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},t.mergeDirtyAABBs=function(t){var n=new Dr;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},t.searchDirtyObjects=function(e,t){var n=t.getMin(),r=n[0],n=n[1],t=t.getMax(),i=t[0],t=t[1];return this.rBush.search({minX:r,minY:n,maxX:i,maxY:t}).map(function(t){t=t.id;return e.displayObjectPool.getByEntity(t)})},t.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Dr),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},t.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,a=n.opacity,o=n.lineDash,n=n.lineDashOffset;o&&t.setLineDash(o),_(n)||(t.lineDashOffset=n),_(a)||(t.globalAlpha*=a),_(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),_(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.getGeometryBounds())&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(dt(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,xt(this.tmpMat4,this.tmpMat4,this.vec3a),bt(this.tmpMat4,n,this.tmpMat4)):(dt(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,xt(this.tmpMat4,this.tmpMat4,this.vec3a)),bt(this.tmpMat4,this.vpMatrix,this.tmpMat4),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.safeMergeAABB=function(){for(var e=new Dr,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){e.add(t)}),e},r}(),Fh=(Rh.tag="CanvasRenderer",function(){function t(t){this.imagePool=void 0,this.imagePool=t}var e=t.prototype;return e.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,y=e.shadowColor,v=e.shadowBlur,m=e.filter,e=e.miterLimit,b=!_(o)&&!o.isNone,x=!_(u)&&!u.isNone&&0<f,w=0===o.alpha,m=!(!m||!m.length),y=!_(y)&&0<v,v=n.nodeName,g="inner"===g,v=x&&y&&(v===E.PATH||v===E.LINE||v===E.POLYLINE||w||g);b&&(t.globalAlpha=l*c,v||Bh(n,t,y),this.fill(t,n,o,s,r,i,a),v||this.clearShadowAndFilter(t,m,y)),x&&(t.globalAlpha=l*h,t.lineWidth=f,_(e)||(t.miterLimit=e),_(d)||(t.lineCap=d),_(p)||(t.lineJoin=p),v&&(g&&(t.globalCompositeOperation="source-atop"),Bh(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,m,!0)),this.stroke(t,n,u,r,i,a))},e.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!_(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},e.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),e.fill(r)}):(ua(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),e.fill(r))},e.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(ua(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},e.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvas.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvas.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},e.getColor=function(t,e,n){var r;return t.type!==Ei.LinearGradient&&t.type!==Ei.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(Nh({type:t.type},t.value,{width:r,height:e}),n)),r},t}());function Bh(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}var Ih=function(){function t(t){this.imagePool=void 0,this.imagePool=t}return t.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=fn(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){Bh(n,t,!_(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}},t}(),Dh=function(){function t(){}var e=t.prototype;return e.render=function(t,e,n){var r=e.lineWidth,i=e.textAlign,a=e.textBaseline,o=e.lineJoin,s=e.miterLimit,l=e.letterSpacing,c=e.stroke,u=e.fill,h=e.fillOpacity,f=e.strokeOpacity,d=e.opacity,p=e.metrics,g=e.dx,y=e.dy,v=e.shadowColor,e=e.shadowBlur,m=p.font,b=p.lines,x=p.height,w=p.lineHeight,k=p.lineMetrics,E=(t.font=m,t.lineWidth=r,t.textAlign="middle"===i?"center":i,t.textBaseline=a,t.lineJoin=o,_(s)||(t.miterLimit=s),0),M=("middle"===a?E=-x/2-w/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?E=-x:"top"!==a&&"hanging"!==a||(E=-w),g||0);E+=y||0,Bh(n,t,!_(v)&&0<e);for(var O=0;O<b.length;O++){var S=r/2+M;E+=w,_(c)||c.isNone||!r||this.drawLetterSpacing(t,b[O],k[O],i,S,E,l,h,f,d,!0),_(u)||this.drawLetterSpacing(t,b[O],k[O],i,S,E,l,h,f,d)}},e.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var y=d[g];u?this.strokeText(t,y,f,a,l):this.fillText(t,y,f,a,s,c),f+=p-(y=t.measureText(e.substring(g+1)).width)+o,p=y}t.textAlign=h}},e.fillText=function(t,e,n,r,i,a){var o,s=!_(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},e.strokeText=function(t,e,n,r,i){var a,o=!_(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)},t}(),zh=function(n){var t;function e(t){var e;return void 0===t&&(t={}),(e=n.call(this)||this).options=void 0,e.name="canvas-renderer",e.options=t,e}t=n,(r=e).prototype=Object.create(t.prototype),jh(r.prototype.constructor=r,t);var r=e.prototype;return r.init=function(){var t,e=Nh({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new Fh(n),n=((t={})[E.CIRCLE]=r,t[E.ELLIPSE]=r,t[E.RECT]=r,t[E.IMAGE]=new Ih(n),t[E.TEXT]=new Dh,t[E.LINE]=r,t[E.POLYLINE]=r,t[E.POLYGON]=r,t[E.PATH]=r,t[E.GROUP]=void 0,t[E.HTML]=void 0,t[E.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new Rh(e))},r.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Jl);function Gh(){Gh=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Wh(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function Hh(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Wh(r,e,n,i,a,"next",t)}function a(t){Wh(r,e,n,i,a,"throw",t)}i(void 0)})}}function Vh(t,e){return(Vh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Yh=function(){function r(){this.context=void 0}return r.prototype.apply=function(t,i){function a(t){e.hooks.pointerWheel.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=(this.context=t,n.root.ownerDocument.defaultView),l=function(t){e.hooks.pointerMove.call(t)},c=function(t){e.hooks.pointerUp.call(t)},u=function(t){e.hooks.pointerDown.call(t)},h=function(t){e.hooks.pointerOver.call(t)},f=function(t){e.hooks.pointerOut.call(t)},d=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tapPromise(r.tag,Hh(Gh().mark(function t(){var r;return Gh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=o.context.contextService.getDomElement(),i.globalThis.navigator.msPointerEnabled?(r.style.msContentZooming="none",r.style.msTouchAction="none"):s.supportsPointerEvents&&(r.style.touchAction="none"),s.supportsPointerEvents?(n=r,i.globalThis.document.addEventListener("pointermove",l,!0),n.addEventListener("pointerdown",u,!0),n.addEventListener("pointerleave",f,!0),n.addEventListener("pointerover",h,!0),i.globalThis.addEventListener("pointerup",c,!0)):(n=r,i.globalThis.document.addEventListener("mousemove",l,!0),n.addEventListener("mousedown",u,!0),n.addEventListener("mouseout",f,!0),n.addEventListener("mouseover",h,!0),i.globalThis.addEventListener("mouseup",c,!0)),s.supportsTouchEvents&&((e=r).addEventListener("touchstart",u,!0),e.addEventListener("touchend",c,!0),e.addEventListener("touchmove",l,!0),e.addEventListener("touchcancel",d,!0)),r.addEventListener("wheel",a,{passive:!0,capture:!0});case 5:case"end":return t.stop()}var e,n},t)}))),e.hooks.destroy.tap(r.tag,function(){var t,e,n=o.context.contextService.getDomElement();i.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):s.supportsPointerEvents&&(n.style.touchAction=""),s.supportsPointerEvents?(t=n,i.globalThis.document.removeEventListener("pointermove",l,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",f,!0),t.removeEventListener("pointerover",h,!0),i.globalThis.removeEventListener("pointerup",c,!0)):(t=n,i.globalThis.document.removeEventListener("mousemove",l,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",f,!0),t.removeEventListener("mouseover",h,!0),i.globalThis.removeEventListener("mouseup",c,!0)),s.supportsTouchEvents&&((e=n).removeEventListener("touchstart",u,!0),e.removeEventListener("touchend",c,!0),e.removeEventListener("touchmove",l,!0),e.removeEventListener("touchcancel",d,!0)),n.removeEventListener("wheel",a,!0)})},r}(),qh=(Yh.tag="DOMInteraction",function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="dom-interaction",t}t=i,(n=e).prototype=Object.create(t.prototype),Vh(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.addRenderingPlugin(new Yh)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(Jl));function Uh(){Uh=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function Xh(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function $h(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Xh(r,e,n,i,a,"next",t)}function a(t){Xh(r,e,n,i,a,"throw",t)}i(void 0)})}}function Kh(t,e){return(Kh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Zh=function(){function d(){this.context=void 0,this.$camera=void 0}var t=d.prototype;return t.joinTransformMatrix=function(t){return"matrix("+[t[0],t[1],t[4],t[5],t[12],t[13]].join(",")+")"},t.apply=function(t){function i(t,e){e.style.transform=s.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===E.HTML&&(s.$camera||(s.$camera=s.createCamera(l)),e=s.getOrCreateEl(r),s.$camera.appendChild(e),n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]}),Object.keys(r.attributes).forEach(function(t){s.updateAttribute(t,r)}),i(r,e))}function n(t){(t=t.target).nodeName===E.HTML&&s.$camera&&(t=s.getOrCreateEl(t))&&t.remove()}function r(t){var e=t.target;e.nodeName===E.HTML&&(t=t.attrName,s.updateAttribute(t,e))}function a(t){var e;(t=t.target).nodeName===E.HTML&&(e=s.getOrCreateEl(t),i(t,e))}function o(){var t,e;s.$camera&&(t=(e=s.context.config).width,e=e.height,s.$camera.style.width=(t||0)+"px",s.$camera.style.height=(e||0)+"px")}var s=this,l=t.camera,c=t.renderingContext,u=t.renderingService,h=t.displayObjectPool,f=(this.context=t,c.root.ownerDocument.defaultView);u.hooks.init.tapPromise(d.tag,$h(Uh().mark(function t(){return Uh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:h.getHTMLs().length&&(s.$camera=s.createCamera(l)),f.addEventListener(sc.RESIZE,o),f.addEventListener(w.MOUNTED,e),f.addEventListener(w.UNMOUNTED,n),f.addEventListener(w.ATTR_MODIFIED,r),f.addEventListener(w.BOUNDS_CHANGED,a);case 6:case"end":return t.stop()}},t)}))),u.hooks.endFrame.tap(d.tag,function(){s.$camera&&c.renderReasons.has(Ul.CAMERA_CHANGED)&&(s.$camera.style.transform=s.joinTransformMatrix(l.getOrthoMatrix()))}),u.hooks.destroy.tap(d.tag,function(){s.$camera&&s.$camera.remove(),f.removeEventListener(sc.RESIZE,o),f.removeEventListener(w.MOUNTED,e),f.removeEventListener(w.UNMOUNTED,n),f.removeEventListener(w.ATTR_MODIFIED,r),f.removeEventListener(w.BOUNDS_CHANGED,a)})},t.getId=function(t){return t.id||"g-html-"+t.entity},t.createCamera=function(t){var e,n,r=this.context.config,i=r.document,a=r.width,r=r.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=i=(i||document).createElement("div")).id=e,i.style.position="absolute",i.style.left=(o.offsetLeft||0)+"px",i.style.top=(o.offsetTop||0)+"px",i.style.transformOrigin="left top",i.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),i.style.overflow="hidden",i.style.pointerEvents="none",i.style.width=(a||0)+"px",i.style.height=(r||0)+"px",s.appendChild(i)),n):null},t.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),(t.parsedStyle.$el=r).id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},t.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;fn(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":r=e.parsedStyle.transformOrigin;n.style["transform-origin"]=r[0].value+" "+r[1].value;break;case"width":r=e.computedStyleMap().get("width");n.style.width=r.toString();break;case"height":r=e.computedStyleMap().get("height");n.style.height=r.toString();break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]=""+r;break;case"visibility":r=e.parsedStyle.visibility;n.style.visibility=r;break;case"pointerEvents":r=e.parsedStyle.pointerEvents;n.style.pointerEvents=r;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity=""+r;break;case"fill":var r=e.parsedStyle.fill,i="";ha(r)?i=r.isNone?"transparent":e.getAttribute("fill"):Array.isArray(r)?i=e.getAttribute("fill"):ua(r),n.style.background=i;break;case"stroke":r=e.parsedStyle.stroke,i="";ha(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):ua(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":r=e.parsedStyle.lineWidth;n.style["border-width"]=(r||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":i=e.style.filter;n.style.filter=i}},d}(),Jh=(Zh.tag="HTMLRendering",function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="html-renderer",t}t=i,(n=e).prototype=Object.create(t.prototype),Kh(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.addRenderingPlugin(new Zh)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(Jl));function Qh(){Qh=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function tf(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function ef(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){tf(r,e,n,i,a,"next",t)}function a(t){tf(r,e,n,i,a,"throw",t)}i(void 0)})}}function nf(t,e){return(nf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var rf="undefined"!=typeof Float32Array?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var af=function(){function t(t){this.canvasConfig=void 0,this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=t}var e=t.prototype;return e.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},e.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):Qr&&(n=new window.Image),n&&(n.onload=function(){t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r,a.imageCache[r]=n)}))},e.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(l=t.image,s=t.repetition,t=t.transform,a=!1,fn(l)?o=this.getImageSync(l,i):n?(o=n,a=!0):o=l,(i=o&&e.createPattern(o,s))&&(e=t?xs(Ia(t)):(n=new rf(16),rf!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,(l=n)[0]=1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l),a&&(s=o=e,n=(t=[1/r,1/r,1])[0],l=t[1],t=t[2],o[0]=s[0]*n,o[1]=s[1]*n,o[2]=s[2]*n,o[3]=s[3]*n,o[4]=s[4]*l,o[5]=s[5]*l,o[6]=s[6]*l,o[7]=s[7]*l,o[8]=s[8]*t,o[9]=s[9]*t,o[10]=s[10]*t,o[11]=s[11]*t,o[12]=s[12],o[13]=s[13],o[14]=s[14],o[15]=s[15]),i.setTransform({a:e[0],b:e[1],c:e[4],d:e[5],e:e[12],f:e[13]})),c&&i&&(this.patternCache[c]=i),i)},e.getOrCreateGradient=function(t,e){var r,n,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(r=null,l===Ei.LinearGradient?(n=u,i=h,f=us((f=f).value),a=0+n/2,o=0+i/2,n=Math.abs(n*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*n/2,y1:o-Math.sin(f)*n/2,x2:a+Math.cos(f)*n/2,y2:o+Math.sin(f)*n/2},r=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===Ei.RadialGradient&&(a=u,o=h,f=p,n=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(He([0,0],[l,u]),He([0,o],[l,u]),He([a,o],[l,u]),He([a,0],[l,u])),n&&(n instanceof Bi?i=n.value:n instanceof Ai&&("closest-side"===n.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===n.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===n.value&&(i=Math.min(He([0,0],[l,u]),He([0,o],[l,u]),He([a,o],[l,u]),He([a,0],[l,u]))))),r=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),r&&(c.forEach(function(t){var e,n=t.offset,t=t.color;n.unit===g.kPercentage&&null!=(e=r)&&e.addColorStop(n.value/100,t.toString())}),this.gradientCache[s]=r)),this.gradientCache[s]},e.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-"+e+"-"+((null==a?void 0:a.toString())||0)+"-"+((null==o?void 0:o.toString())||0)+"-"+((null==s?void 0:s.toString())||0)+"-"+((null==t?void 0:t.toString())||0)+"-"+n+"-"+r+"-"+i.map(function(t){return""+t.offset+t.color}).join("-")},e.generatePatternKey=function(t){var e=t.image,t=t.repetition;return fn(e)?"pattern-"+e+"-"+t:"rect"===e.nodeName?"pattern-"+e.entity+"-"+t:void 0},t}(),of=function(){function s(){}return s.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===E.IMAGE&&(t=n.img,fn(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===E.IMAGE&&"img"===n&&fn(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tapPromise(s.tag,ef(Qh().mark(function t(){return Qh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:o.addEventListener(w.MOUNTED,e),o.addEventListener(w.ATTR_MODIFIED,n);case 2:case"end":return t.stop()}},t)}))),r.hooks.destroy.tap(s.tag,function(){o.removeEventListener(w.MOUNTED,e),o.removeEventListener(w.ATTR_MODIFIED,n)})},s}(),sf=(of.tag="LoadImage",function(i){var t;function e(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="image-loader",t}t=i,(n=e).prototype=Object.create(t.prototype),nf(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.context.imagePool=new af(this.context.config),this.addRenderingPlugin(new of)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(Jl));function lf(){lf=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function cf(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function uf(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){cf(r,e,n,i,a,"next",t)}function a(t){cf(r,e,n,i,a,"throw",t)}i(void 0)})}}function hf(t,e){t.prototype=Object.create(e.prototype),ff(t.prototype.constructor=t,e)}function ff(t,e){return(ff=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var df=function(){function t(t){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0,this.renderingContext=void 0,this.renderingContext=t.renderingContext,this.canvasConfig=t.config}var e=t.prototype;return e.init=function(){var t=uf(lf().mark(function t(){var e,n;return lf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n=this.canvasConfig,e=n.container,(n=n.canvas)?(this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=fn(e)?document.getElementById(e):e,this.$container)&&(n=document.createElement("canvas"),this.$container.appendChild(n),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=n),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height);case 4:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),e.getContext=function(){return this.context},e.getDomElement=function(){return this.$canvas},e.getDPR=function(){return this.dpr},e.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},e.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},e.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||Qr&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,Qr)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(Ul.CAMERA_CHANGED)},e.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},e.toDataURL=function(){var e=uf(lf().mark(function t(e){var n,r;return lf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(r=e=void 0===e?{}:e).type,r=r.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 3:case"end":return t.stop()}},t,this)}));return function(t){return e.apply(this,arguments)}}(),t}(),pf=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).name="canvas-context-register",t}hf(t,i);var e=t.prototype;return e.init=function(){this.context.ContextService=df},e.destroy=function(){delete this.context.ContextService},t}(Jl),gf=function(e){function t(t){t=e.call(this,t)||this;return t.registerPlugin(new pf),t.registerPlugin(new sf),t.registerPlugin(new Bu),t.registerPlugin(new zh),t.registerPlugin(new qh),t.registerPlugin(new Th),t.registerPlugin(new Jh),t}return hf(t,e),t}(Zl);function yf(){yf=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof f?e:f,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return E()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===h)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var h={};function f(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(k([]))),y=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function m(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function k(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:E}}function E(){return{value:void 0,done:!0}}return c(y,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(y),t},o.awrap=function(t){return{__await:t}},v(m.prototype),a(m.prototype,n,function(){return this}),o.AsyncIterator=m,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new m(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(y),a(y,i,"Generator"),a(y,r,function(){return this}),a(y,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},o}function vf(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function mf(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){vf(r,e,n,i,a,"next",t)}function a(t){vf(r,e,n,i,a,"throw",t)}i(void 0)})}}function bf(){return(bf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function xf(t,e){return(xf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function wf(t){return _f(t,"Function")}function kf(t){return null==t}var Ef=function(){function i(t){this.dragndropPluginOptions=void 0,this.dragndropPluginOptions=t}return i.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,h=u===p,f=h&&d.dragndropPluginOptions.isDocumentDraggable?p:u.closest&&u.closest("[draggable=true]");f&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],e=function(){var e=mf(yf().mark(function t(e){var n,r,i;return yf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a)t.next=8;else{if(n=e.timeStamp-o,r=He([e.clientX,e.clientY],s),n<=d.dragndropPluginOptions.dragstartTimeThreshold||r<=d.dragndropPluginOptions.dragstartDistanceThreshold)return t.abrupt("return");t.next=5}break;case 5:e.type="dragstart",f.dispatchEvent(e),a=!0;case 8:if(e.type="drag",e.dx=e.clientX-c[0],e.dy=e.clientY-c[1],f.dispatchEvent(e),c=[e.clientX,e.clientY],h){t.next=21;break}return n="pointer"===d.dragndropPluginOptions.overlap?[e.canvasX,e.canvasY]:u.getBounds().center,t.next=17,p.elementsFromPoint(n[0],n[1]);case 17:r=t.sent,i=r[r.indexOf(u)+1],i=(null==i?void 0:i.closest("[droppable=true]"))||(d.dragndropPluginOptions.isDocumentDroppable?p:null),l!==i&&(l&&(e.type="dragleave",(e.target=l).dispatchEvent(e)),i&&(e.type="dragenter",(e.target=i).dispatchEvent(e)),l=i)&&(e.type="dragover",(e.target=l).dispatchEvent(e));case 21:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),r.addEventListener("pointermove",e),u.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),l&&(t.type="drop",(t.target=l).dispatchEvent(t)),t.type="dragend",f.dispatchEvent(t),a=!1),r.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var d=this,n=t.renderingService,p=t.renderingContext.root.ownerDocument,r=p.defaultView;n.hooks.init.tapPromise(i.tag,mf(yf().mark(function t(){return yf().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r.addEventListener("pointerdown",e);case 1:case"end":return t.stop()}},t)}))),n.hooks.destroy.tap(i.tag,function(){r.removeEventListener("pointerdown",e)})},i}(),Mf=(Ef.tag="Dragndrop",function(n){var t;function e(t){var e;return void 0===t&&(t={}),(e=n.call(this)||this).options=void 0,e.name="dragndrop",e.options=t,e}t=n,(r=e).prototype=Object.create(t.prototype),xf(r.prototype.constructor=r,t);var r=e.prototype;return r.init=function(){this.addRenderingPlugin(new Ef(bf({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},r.destroy=function(){this.removeAllRenderingPlugins()},r.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(Jl)),Of=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Sf={}.toString,_f=function(t,e){return Sf.call(t)==="[object "+e+"]"},Af=function(t){return Array.isArray?Array.isArray(t):_f(t,"Array")};function Tf(t){if(!Lf(t)||!_f(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Pf(t){return(t=Rf(t)).charAt(0).toLowerCase()+t.substring(1)}var Lf=function(t){return"object"==typeof t&&null!==t},Cf=function(t){return _f(t,"String")},Nf=function(t){return _f(t,"Number")},jf=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){wf(n)&&"prototype"===e||r.push(t)};if(e)if(Af(e))for(var a=0,o=e.length;a<o&&!1!==i(e[a],a);a++);else if(t=typeof e,null!==e&&"object"==t||"function"==t)for(var s in e)if(e.hasOwnProperty(s)&&!1===i(e[s],s))break;return r},Rf=function(t){return kf(t)?"":t.toString()},Ff=function(t){t=Rf(t);return t.charAt(0).toUpperCase()+t.substring(1)};var Bf=5;function If(t){return t}var Df,R=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||Bf,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Tf(o)?(Tf(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Af(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},zf=function(t,e){if(!Of(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},Gf=function(t,e){if(t===e)return!0;if(t&&e&&!Cf(t)&&!Cf(e)){if(Of(t)||Of(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=Gf(t[r],e[r]));r++);return n}if(Lf(t)||Lf(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=Gf(t[i[r]],e[i[r]]));r++);return n}}return!1},Wf=function(n,r,i){function a(){u=!1===i.leading?0:Date.now(),o=null,c=n.apply(s,l),o||(s=l=null)}function t(){var t=Date.now(),e=(u||!1!==i.leading||(u=t),r-(t-u));return s=this,l=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),u=t,c=n.apply(s,l),o||(s=l=null)):o||!1===i.trailing||(o=setTimeout(a,e)),c}var o,s,l,c,u=0;i=i||{};return t.cancel=function(){clearTimeout(o),u=0,o=s=l=null},t};function Hf(t){return kf(t)?0:(Of(t)?t:Object.keys(t)).length}!function(a,o){var s;if(wf(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map;throw new TypeError("Expected a function")}(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(Df=Df||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),Df.measureText(Cf(t)?t:"").width},function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}([t],jf(e=void 0===e?{}:e)).join("")});Yf.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},Yf.prototype.once=function(t,e){return this.on(t,e,!0)},Yf.prototype.emit=function(a){for(var o=this,s=[],t=1;t<arguments.length;t++)s[t-1]=arguments[t];function e(t){for(var e,n,r=t.length,i=0;i<r;i++)t[i]&&(n=(e=t[i]).callback,e.once&&(t.splice(i,1),0===t.length&&delete o._events[a],r--,i--),n.apply(o,s))}var n=this._events[a]||[],r=this._events["*"]||[];e(n),e(r)},Yf.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},Yf.prototype.getEvents=function(){return this._events};var Vf=Yf;function Yf(){this._events={}}const qf=()=>[["cartesian"]],Uf=(qf.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Xf=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Uf(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},$f=(Xf.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),Kf=($f.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Zf=(Kf.props={},()=>[["translate",.5,.5],["reflect"],["translate",-.5,-.5]]),Jf=(Zf.props={},()=>[["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Qf=(Jf.props={},()=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5]]),td=(Qf.props={},t=>{[t={}]=[t],e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};var{startAngle:e,endAngle:t,innerRadius:n,outerRadius:r}=Object.assign(Object.assign({},e),t);return[...Kf(),...Xf({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),ed=(td.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),nd=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=ed(t);return[["transpose"],...Zf(),...Xf({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},rd=(nd.props={},()=>[["parallel",0,1,0,1]]),id=(rd.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,isVisual:i=!1})=>[["fisheye",t,e,n,r,i]]),ad=(id.props={},({focusX:t=0,distortionX:e=2,isVisual:n=!1})=>[["fisheye.x",t,e,n]]),od=(ad.props={},({focusY:t=0,distortionY:e=2,isVisual:n=!1})=>[["fisheye.x",t,e,n]]),sd=(od.props={},({value:e})=>t=>t.map(()=>e)),ld=(sd.props={},({value:e})=>t=>t.map(e)),cd=(ld.props={},({value:e})=>t=>t.map(t=>t[e])),ud=(cd.props={},({value:t})=>()=>t);function hd(t,e){return t.parent===e.parent?1:2}function fd(t,e){return t+e.x}function dd(t,e){return Math.max(t,e.y)}function pd(){var s=hd,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(fd,0)/e.length,t.y=1+n.reduce(dd,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function gd(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function yd(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=md)):void 0===e&&(e=vd);for(var n,r,i,a,o,t=new wd(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new wd(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(xd)}function vd(t){return t.children}function md(t){return Array.isArray(t)?t[1]:null}function bd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function xd(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function wd(t){this.data=t,this.depth=this.height=0,this.parent=null}function kd(t){return null==t?null:Ed(t)}function Ed(t){if("function"!=typeof t)throw new Error;return t}function Md(){return 0}function Od(t){return function(){return t}}ud.props={},wd.prototype=yd.prototype={constructor:wd,count:function(){return this.eachAfter(gd)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i,a=[this],o=-1;n=a.pop();)if(t.call(e,n,++o,this),r=n.children)for(i=r.length-1;0<=i;--i)a.push(r[i]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;0<=--r;)e+=n[r].value;t.value=e})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n},copy:function(){return yd(this).eachBefore(bd)},[Symbol.iterator]:function*(){var t,e,n,r,i,a=[this];do{for(e=a.reverse(),a=[];t=e.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length)}};const Sd=4294967296;function _d(t,e){for(var n,r,i=0,a=(t=function(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(Array.from(t),e)).length,o=[];i<a;)n=t[i],r&&Td(r,n)?++i:(r=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return Ld(t[0],t[1]);case 3:return Cd(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(Pd(e,t))return[e];for(n=0;n<t.length;++n)if(Ad(e,t[n])&&Pd(Ld(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(Ad(Ld(t[n],t[r]),e)&&Ad(Ld(t[n],e),t[r])&&Ad(Ld(t[r],e),t[n])&&Pd(Cd(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function Ad(t,e){var n=t.r-e.r,r=e.x-t.x,e=e.y-t.y;return n<0||n*n<r*r+e*e}function Td(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Pd(t,e){for(var n=0;n<e.length;++n)if(!Td(t,e[n]))return;return 1}function Ld(t,e){var n=t.x,r=t.y,t=t.r,i=e.x,a=e.y,e=e.r,o=i-n,s=a-r,l=e-t,c=Math.sqrt(o*o+s*s);return{x:(n+i+o/c*l)/2,y:(r+a+s/c*l)/2,r:(c+t+e)/2}}function Cd(t,e,n){var r=t.x,i=t.y,t=t.r,a=e.x,o=e.y,e=e.r,s=n.x,l=n.y,n=n.r,c=r-a,u=r-s,h=i-o,f=i-l,d=e-t,p=n-t,g=r*r+i*i-t*t,a=g-a*a-o*o+e*e,o=g-s*s-l*l+n*n,e=u*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function Nd(t,e,n){var r,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+n.r,o=t.r+n.r,(o*=o)<(i*=i)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*l,n.y=t.y-r*l+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*l,n.y=e.y+r*l+a*s)):(n.x=e.x+n.r,n.y=e.y)}function jd(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function Rd(t){var e=t._,t=t.next._,n=e.r+t.r,r=(e.x*t.r+t.x*e.r)/n,t=(e.y*t.r+t.y*e.r)/n;return r*r+t*t}function Fd(t){this._=t,this.next=null,this.previous=null}function Bd(t,e){if(!(a=(t="object"==typeof(n=t)&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,a,o,s,l,c,u,h,f,d=t[0];if(d.x=0,d.y=0,!(1<a))return d.r;if(r=t[1],d.x=-r.r,r.x=d.r,r.y=0,!(2<a))return d.r+r.r;Nd(r,d,i=t[2]),d=new Fd(d),r=new Fd(r),i=new Fd(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){Nd(d._,r._,i=t[l]),i=new Fd(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(jd(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(jd(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=Rd(d);(i=i.next)!==r;)(s=Rd(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=_d(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function Id(t){return Math.sqrt(t.value)}function Dd(){var n=null,r=1,i=1,a=Md;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Sd)/Sd}();return t.x=r/2,t.y=i/2,n?t.eachBefore(zd(n)).eachAfter(Gd(a,.5,e)).eachBefore(Wd(1)):t.eachBefore(zd(Id)).eachAfter(Gd(Md,1,e)).eachAfter(Gd(a,t.r/Math.min(r,i),e)).eachBefore(Wd(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=kd(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:Od(+t),e):a},e}function zd(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Gd(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n<i;++n)e[n].r+=a;if(r=Bd(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function Wd(n){return function(t){var e=t.parent;t.r*=n,e&&(t.x=e.x+n*t.x,t.y=e.y+n*t.y)}}function Hd(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Vd(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(r-e)/t.value;++s<l;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var Yd={depth:-1},qd={},Ud={};function Xd(t){return t.id}function $d(t){return t.parentId}function Kd(){var y,v=Xd,m=$d;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=v,h=m,f=new Map;if(null!=y){const p=c.map((t,e)=>{t=y(t,e,n),e=(t=""+t).length;return"/"===(t=Jd(t,e-1)&&!Jd(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(Zd);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(Zd(r)),c.push(Ud));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new wd(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?qd:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===qd)throw new Error("ambiguous: "+s);a.children?a.children.push(o):a.children=[o],o.parent=a}else{if(i)throw new Error("multiple roots");i=o}if(!i)throw new Error("no root");if(null!=y){for(;i.data===Ud&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===Ud;--t)o.data=null}if(i.parent=Yd,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(xd),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(v=kd(t),e):v},e.parentId=function(t){return arguments.length?(m=kd(t),e):m},e.path=function(t){return arguments.length?(y=kd(t),e):y},e}function Zd(t){let e=t.length;if(e<2)return"";for(;1<--e&&!Jd(t,e););return t.slice(0,e)}function Jd(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function Qd(t,e){return t.parent===e.parent?1:2}function tp(t){var e=t.children;return e?e[0]:t.t}function ep(t){var e=t.children;return e?e[e.length-1]:t.t}function np(t,e){this._=t,this.parent=null,this.children=null,this.A=null,(this.a=this).z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function rp(){var f=Qd,l=1,c=1,u=null;function e(t){var e,n,r,i,a,o,s=function(t){for(var e,n,r,i,a,o=[t=new np(t,0)];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;0<=i;--i)o.push(n=e.children[i]=new np(r[i],i)),n.parent=e;return(t.parent=new np(null,0)).children=[t],t}(t);return s.eachAfter(h),s.parent.m=-s.z,s.eachBefore(d),u?t.eachBefore(p):((r=n=e=t).eachBefore(function(t){t.x<e.x&&(e=t),t.x>n.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:f(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function h(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,h=s.m;o=ep(o),i=tp(i),o&&i;)s=tp(s),(a=ep(a)).a=t,0<(r=o.z+u-i.z-l+f(o._,i._))&&(function(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}(function(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,h+=s.m,c+=a.m;o&&!ep(a)&&(a.t=o,a.m+=u-c),i&&!tp(s)&&(s.t=i,s.m+=l-h,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(f=t,e):f},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function ip(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}np.prototype=Object.create(wd.prototype);e=(1+Math.sqrt(5))/2;function ap(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,y,v=[],m=e.children,b=0,x=0,w=m.length,k=e.value;b<w;){for(l=i-n,c=a-r;!(u=m[x++].value)&&x<w;);for(y=(h=f=u)*u*(g=Math.max(c/l,l/c)/(k*t)),p=Math.max(f/y,y/h);x<w;++x){if(u+=s=m[x].value,s<h&&(h=s),f<s&&(f=s),y=u*u*g,p<(d=Math.max(f/y,y/h))){u-=s;break}p=d}v.push(o={value:u,dice:l<c,children:m.slice(b,x)}),o.dice?Vd(o,n,r,i,k?r+=c*u/k:a):ip(o,n,r,k?n+=l*u/k:i,a),k-=u,b=x}return v}var op=function e(a){function t(t,e,n,r,i){ap(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(e);function sp(t,e,n,r,i){var a,o,g=t.children,s=g.length,y=new Array(s+1);for(y[0]=o=a=0;a<s;++a)y[a+1]=o+=g[a].value;!function t(e,n,r,i,a,o,s){if(n-1<=e)return(l=g[e]).x0=i,l.y0=a,l.x1=o,void(l.y1=s);var l=y[e],c=r/2+l,u=e+1,h=n-1;for(;u<h;){var f=u+h>>>1;y[f]<c?u=1+f:h=f}c-y[u-1]<y[u]-c&&e+1<u&&--u;var l=y[u]-l,d=r-l;{var p;s-a<o-i?(t(e,u,l,i,a,p=r?(i*d+o*l)/r:o,s),t(u,n,d,p,a,o,s)):(t(e,u,l,i,a,o,p=r?(a*d+s*l)/r:s),t(u,n,d,i,p,o,s))}}(0,s,t.value,e,n,r,i)}function lp(t,e,n,r,i){(1&t.depth?ip:Vd)(t,e,n,r,i)}var cp=function e(d){function t(t,e,n,r,i){if((a=t._squarify)&&a.ratio===d)for(var a,o,s,l,c,u=-1,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?Vd(o,e,n,r,f?n+=(i-n)*o.value/f:i):ip(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=ap(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(e);function up(t={}){t=t.shapes;return[{name:"color"},{name:"opacity"},{name:"shape",range:t},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function hp(t={}){return[...up(t),{name:"title",scale:"identity"},{name:"tooltip",scale:"identity",independent:!0}]}function fp(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function dp(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function pp(t={}){return up(t)}function gp(){return[{type:"maybeKey"}]}function yp(t,e){return t.getBandWidth(t.invert(e))}function vp(t,e,n={}){const{x:a,y:o,series:s}=e,{x:l,y:c,series:u}=t,{style:{bandOffset:r=u?0:.5,bandOffsetX:h=r,bandOffsetY:f=r}={}}=n,d=!(null===l||void 0===l||!l.getBandWidth),p=!(null===c||void 0===c||!c.getBandWidth),g=!(null===u||void 0===u||!u.getBandWidth);return d||p?(t,e)=>{const n=d?yp(l,a[e]):0;var r=p?yp(c,o[e]):0,e=g&&s?(yp(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function mp(t){return parseFloat(t)/100}function bp(t,e,n,r){const{x:i,y:a}=n,{width:o,height:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?mp(e)*o:+e,"string"==typeof t?mp(t)*s:+t]]})]}function xp(e){return"function"==typeof e?e:t=>t[e]}function wp(t,e){return Array.from(t,xp(e))}function kp(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=wp(t,e),o=wp(t,n),s=wp(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}function Ep(t,e){return t.getBandWidth(t.invert(e))}const Mp=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=Ep(c,a[t]),n=e*(u?Ep(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};Mp.props={defaultShape:"rect",defaultLabelShape:"label",channels:[...hp({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...gp(),...dp()],interaction:{shareTooltip:!0}};const Op=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};function Sp(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function _p(n){let a,o,i;function s(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<0?n=1+i:r=i}while(n<r)}return n}return i=2!==n.length?(a=Sp,o=(t,e)=>Sp(n(t),e),(t,e)=>n(t)-e):(a=n===Sp||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:Ap,o=n),{left:s,center:function(t,e,n=0,r=t.length){return r=s(t,e,n,r-1),n<r&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<=0?n=1+i:r=i}while(n<r)}return n}}}function Ap(){return 0}function*Tp(e,n){if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}Op.props={defaultShape:"rect",defaultLabelShape:"label",channels:[...hp({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeZeroY1"}],postInference:[...gp(),...dp()],interaction:{shareTooltip:!0}};Kl=_p(Sp);const Pp=Kl.right,Lp=Kl.left,Cp=_p(function(t){return null===t?NaN:+t}).center;function Np(e,n){let r=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function jp(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1<r)return o/(r-1)}(t,e);return t&&Math.sqrt(t)}function Rp(e,n){let r,i;if(void 0===n)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(void 0===r?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}return[r,i]}class Fp{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){var n=this._partials;let r=0;for(let t=0;t<this._n&&t<32;t++){var i=n[t],a=e+i,i=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);i&&(n[r++]=i),e=a}return n[r]=e,this._n=r+1,this}valueOf(){var t=this._partials;let e=this._n,n,r,i,a=0;if(0<e){for(a=t[--e];0<e&&(n=a,r=t[--e],a=n+r,!(i=r-(a-n))););0<e&&(i<0&&t[e-1]<0||0<i&&0<t[e-1])&&(r=2*i,n=a+r,r==n-a)&&(a=n)}return a}}class Bp extends Map{constructor(t,e=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Ip(this,t))}has(t){return super.has(Ip(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):(t.set(e,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){e=e(n);t.has(e)&&(n=t.get(e),t.delete(e));return n}(this,t))}}function Ip({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function Dp(t){return t}function zp(t,...e){return Hp(t,Dp,Dp,e)}function Gp(t,e,...n){return Hp(t,Dp,e,n)}function Wp(t,e,...n){return Hp(t,Array.from,e,n)}function Hp(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Bp,i=f[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function Vp(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1<i.length?(t=Uint32Array.from(e,(t,e)=>e),1<i.length?(i=i.map(t=>e.map(t)),t.sort((t,e)=>{for(const r of i){var n=qp(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>qp(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(Yp(n))}function Yp(r=Sp){if(r===Sp)return qp;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function qp(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var Up=Array.prototype.slice;function Xp(t){return()=>t}const $p=Math.sqrt(50),Kp=Math.sqrt(10),Zp=Math.sqrt(2);function Jp(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),r=r/Math.pow(10,i),r=r>=$p?10:r>=Kp?5:r>=Zp?2:1;let a,o,s;return i<0?(s=Math.pow(10,-i)/r,a=Math.round(t*s),o=Math.round(e*s),a/s<t&&++a,o/s>e&&--o,s=-s):(s=Math.pow(10,i)*r,a=Math.round(t/s),o=Math.round(e/s),a*s<t&&++a,o*s>e&&--o),o<a&&.5<=n&&n<2?Jp(t,e,2*n):[a,o,s]}function Qp(t,e,n){return Jp(t=+t,e=+e,n=+n)[2]}function t0(t){return Math.ceil(Math.log(Np(t))/Math.LN2)+1}function e0(){var v=Dp,m=Rp,b=t0;function e(t){for(var e,n,r=(t=Array.isArray(t)?t:Array.from(t)).length,i=new Array(r),a=0;a<r;++a)i[a]=v(t[a],a,t);var o=m(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(m===Rp&&([s,l]=function(t,e,n){let r;for(;;){var i=Qp(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];0<i?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(s,l,u)),(c=function(t,e,n){if(!(0<(n=+n)))return[];if((t=+t)===(e=+e))return[t];var r=e<t,[i,a,o]=r?Jp(e,t,n):Jp(t,e,n);if(!(i<=a))return[];var s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(i+t)/-o;else for(let t=0;t<s;++t)l[t]=(i+t)*o;return l}(s,l,u))[0]<=s&&(n=Qp(s,l,u)),c[c.length-1]>=l)if(l<=o&&m===Rp){const n=Qp(s,l,u);isFinite(n)&&(0<n?l=(Math.floor(l/n)+1)*n:n<0&&(l=(Math.ceil(l*-n)+1)/-n))}else c.pop()}for(var h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,y=new Array(h+1);for(a=0;a<=h;++a)(p=y[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Math.min(h,Math.floor((e-s)/n))].push(t[a]);else if(n<0)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&(g=Math.floor((s-e)*n),y[Math.min(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Pp(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(v="function"==typeof t?t:Xp(t),e):v},e.domain=function(t){return arguments.length?(m="function"==typeof t?t:Xp([t[0],t[1]]),e):m},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:Xp(Array.isArray(t)?Up.call(t):t),e):b},e}function n0(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function r0(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function i0(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function a0(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function o0(n,r,i=0,a=1/0,o){if(r=Math.floor(r),i=Math.floor(Math.max(0,i)),a=Math.floor(Math.min(n.length-1,a)),i<=r&&r<=a)for(o=void 0===o?qp:Yp(o);i<a;){600<a-i&&(s=a-i+1,l=r-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),u=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),o0(n,r,Math.max(i,Math.floor(r-l*c/s+u)),Math.min(a,Math.floor(r+(s-l)*c/s+u)),o));var s,l,c,u,h=n[r];let t=i,e=a;for(s0(n,i,r),0<o(n[a],h)&&s0(n,i,a);t<e;){for(s0(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?s0(n,i,e):s0(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function s0(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function l0(t,e,n){var r;if((n=(t=Float64Array.from(Tp(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?i0(t):1<=e?n0(t):(n=(n-1)*e,(r=n0(o0(t,e=Math.floor(n)).subarray(0,e+1)))+(i0(t.subarray(e+1))-r)*(n-e))}function c0(r,t,i){if((i=(r=Float64Array.from(Tp(r,i))).length)&&!isNaN(t=+t)){if(t<=0||i<2)return a0(r);if(1<=t)return r0(r);t=Math.floor((i-1)*t),i=o0(Uint32Array.from(r,(t,e)=>e),t,0,i-1,(t,e)=>qp(r[t],r[e]));{var i=i.subarray(0,t+1),a=t=>r[t];let e,n=!1;if(1===a.length){let t;for(const s of i){var o=a(s);(n?0<Sp(o,t):0===Sp(o,o))&&(e=s,t=o,n=!0)}}else for(const l of i)(n?0<a(l,e):0===a(l,l))&&(e=l,n=!0);return e}}}function u0(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function h0(t,e){return l0(t,.5,e)}function f0(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function d0(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function p0(e,n){let r=0;if(void 0===n)for(var t of e)(t=+t)&&(r+=t);else{let t=-1;for(var i of e)(i=+n(i,++t,e))&&(r+=i)}return r}function g0(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function y0(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function v0(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function m0(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function b0(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function x0(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function w0(t){return m0(t)||y0(t)}function k0(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function E0(t){var t=t.getOptions()["transformations"],[,t,e]=t.find(t=>"polar"===t[0]);return[180*+t/Math.PI,180*+e/Math.PI]}const M0=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(zp(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},O0=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t<n.length;t+=2)r.push([n[t],n[t+1]]);return r})]},S0=()=>(t,e,n,r)=>{return(b0(r)?O0:M0)(t,e,n,r)};S0.props={defaultShape:"line",defaultLabelShape:"label",channels:[...hp({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[{type:"maybeSeries"},{type:"maybeGradient"}],postInference:[...gp(),...dp(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const _0=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=vp(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/h,r=r/f,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};_0.props={defaultShape:"hollow",defaultLabelShape:"label",channels:[...hp({shapes:["hollow","hollowDiamond","hollowHexagon","hollowSquare","hollowTriangleDown","hollowTriangle","hollowBowtie","point","plus","diamond","square","triangle","hexagon","cross","bowtie","hyphen","line","tick","triangleDown"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",scale:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...gp(),{type:"maybeSize"},...fp()]};const A0=s=>{const{cartesian:l=!1}=s;return l?bp:(t,e,n,r)=>{if(l)return bp(t,0,n,r);const{x:i,y:a}=n,o=vp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};A0.props={defaultShape:"text",defaultLabelShape:"label",channels:[...hp({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...gp(),...fp()]};const T0=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};T0.props={defaultShape:"cell",defaultLabelShape:"label",channels:[...hp({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...gp(),...fp()]};const P0=()=>(t,e,n,a)=>{const{x:o,y:s,y1:l,series:r}=n;n=r?Array.from(zp(t,t=>r[t]).values()):[t];return[n.map(t=>t[0]),Array.from(n,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t<e.length;t++){var i=e[t];r[t]=a.map([+o[i],+s[i]]),r[n+t]=a.map([+o[i],+l[i]])}return r}),n]};P0.props={defaultShape:"area",defaultLabelShape:"label",channels:[...hp({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[...gp(),...dp()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const L0=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=vp(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};L0.props={defaultShape:"link",defaultLabelShape:"label",channels:[...hp({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...gp(),...fp()]};const C0=s=>{var t=s["cartesian"];return t?bp:(t,e,n,r)=>{const{x:i,y:a}=n,o=vp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};C0.props={defaultShape:"image",defaultLabelShape:"label",channels:[...hp({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...gp(),...fp()]};const N0=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t<o.length;t++){var r=o[t][e];if(void 0===r)break;var i=s[t][e];n.push(a.map([+r,+i]))}return n});return[t,n]};N0.props={defaultShape:"polygon",defaultLabelShape:"label",channels:[...hp({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[],postInference:[...gp(),...fp()]};const j0=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,y4:d,series:p}=n,g=e.x,y=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(y?y.getBandWidth(y.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+h[t],+f[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]},R0=(j0.props={defaultShape:"box",defaultLabelShape:"label",channels:[...hp({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[{type:"maybeZeroX"}],postInference:[...gp(),...dp()],interaction:{shareTooltip:!0}},()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]});R0.props={defaultShape:"vector",defaultLabelShape:"label",channels:[...hp({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[],postInference:[...gp(),...fp()]};const F0=()=>(t,e,n,r)=>{const i=n["y"];return[t,Array.from(t,t=>{return[[0,i[t]],[1,i[t]]].map(t=>r.map(t))})]};F0.props={defaultShape:"line",defaultLabelShape:"label",channels:[...pp({shapes:["line"]}),{name:"y",required:!0}],preInference:[{type:"maybeTupleY"}],postInference:[...gp()]};const B0=()=>(t,e,n,r)=>{const i=n["x"];return[t,Array.from(t,t=>{return[[i[t],1],[i[t],0]].map(t=>r.map(t))})]};B0.props={defaultShape:"line",defaultLabelShape:"label",channels:[...pp({shapes:["line"]}),{name:"x",required:!0}],preInference:[{type:"maybeTupleX"}],postInference:[...gp()]};const I0=(...t)=>L0(...t);function D0(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function z0(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=D0("x",r,n,e.x),o=D0("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}I0.props={defaultShape:"connector",defaultLabelShape:"label",channels:[...pp({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[],postInference:[...gp()]};const G0=()=>z0();G0.props={defaultShape:"range",defaultLabelShape:"label",channels:[...pp({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[],postInference:[...gp()]};const W0=()=>z0({extendY:!0});W0.props={defaultShape:"range",defaultLabelShape:"label",channels:[...pp({shapes:["range"]}),{name:"x",required:!0}],preInference:[],postInference:[...gp()]};const H0=()=>z0({extendX:!0});function V0(t){return t.target.depth}function Y0(t,e){return t.sourceLinks.length?t.depth:e-1}function q0(t){return function(){return t}}function U0(t,e){return $0(t.source,e.source)||t.index-e.index}function X0(t,e){return $0(t.target,e.target)||t.index-e.index}function $0(t,e){return t.y0-e.y0}function K0(t){return t.value}function Z0(t){return t.index}function J0(t){return t.nodes}function Q0(t){return t.links}function tg(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function eg({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function ng(){let x=0,w=0,k=1,E=1,M=24,O=8,S,_=Z0,A=Y0,T,P,L,C=J0,N=Q0,j=6;function e(e){e={nodes:C(e),links:N(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[_(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=tg(g,n)),"object"!=typeof r&&(r=t.target=tg(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=L)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(L),r.sort(L)}t=e.nodes;for(const y of t)y.value=void 0===y.fixedValue?Math.max(p0(y.sourceLinks,K0),p0(y.targetLinks,K0)):y.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(T){var s,l=Math.max(n0(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.call(null,s,l)}}{var c=(i=e.nodes).length;let t=new Set(i),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(n0(t,t=>t.depth)+1,0),n=(k-x-M)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(A.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+M,r[i]?r[i].push(a):r[i]=[a]}if(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(O,(E-w)/(n0(u,t=>t.length)-1)),u),h=i0(t,t=>(E-w-(t.length-1)*S)/p0(t,K0));for(const v of t){let e=w;for(const m of v){m.y0=e,m.y1=e+m.value*h,e=m.y1+S;for(const b of m.sourceLinks)b.width=b.value*h}e=(E-e+S)/(v.length+1);for(let t=0;t<v.length;++t){var f=v[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===L)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(X0),n.sort(U0)}(v)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!function(n,r,i){for(let t=n.length,e=t-2;0<=e;--e){var a,o=n[e];for(const c of o){let t=0,e=0;for(var{target:s,value:l}of c.sourceLinks){l=l*(s.layer-c.layer);t+=function(t,e){let n=e.y0-(e.targetLinks.length-1)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}for(var{target:a,width:o}of t.sourceLinks){if(a===e)break;n-=o}return n}(c,s)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,F(c))}void 0===P&&o.sort($0),o.length&&R(o,i)}}(u,d,p),!function(n,r,i){for(let t=1,e=n.length;t<e;++t){var a,o=n[t];for(const c of o){let t=0,e=0;for(var{source:s,value:l}of c.targetLinks){l=l*(c.layer-s.layer);t+=function(t,e){let n=t.y0-(t.sourceLinks.length-1)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}for(var{source:a,width:o}of e.targetLinks){if(a===t)break;n-=o}return n}(s,c)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,F(c))}void 0===P&&o.sort($0),o.length&&R(o,i)}}(u,d,p)}return eg(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,1+n,e),a(t,E,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;n<t.length;++n){var i=t[n],a=(e-i.y0)*r;1e-6<a&&(i.y0+=a,i.y1+=a),e=i.y1+S}}function a(t,e,n,r){for(;0<=n;--n){var i=t[n],a=(i.y1-e)*r;1e-6<a&&(i.y0-=a,i.y1-=a),e=i.y0-S}}function F({sourceLinks:t,targetLinks:e}){if(void 0===L){for(const{source:{sourceLinks:t}}of e)t.sort(X0);for(const{target:{targetLinks:e}}of t)e.sort(U0)}}return e.update=function(t){return eg(t),t},e.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:q0(t),e):_},e.nodeAlign=function(t){return arguments.length?(A="function"==typeof t?t:q0(t),e):A},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(M=+t,e):M},e.nodePadding=function(t){return arguments.length?(O=S=+t,e):O},e.nodes=function(t){return arguments.length?(C="function"==typeof t?t:q0(t),e):C},e.links=function(t){return arguments.length?(N="function"==typeof t?t:q0(t),e):N},e.linkSort=function(t){return arguments.length?(L=t,e):L},e.size=function(t){return arguments.length?(x=w=0,k=+t[0],E=+t[1],e):[k-x,E-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],k=+t[1][0],w=+t[0][1],E=+t[1][1],e):[[x,w],[k,E]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}H0.props={defaultShape:"range",defaultLabelShape:"label",channels:[...pp({shapes:["range"]}),{name:"y",required:!0}],preInference:[],postInference:[...gp()]};const rg={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},ig={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?i0(t.sourceLinks,V0)-1:0},justify:Y0};const ag=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},rg,h),l=ng().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?ig[n]||Y0:"function"==c?n:Y0).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}};function og(t){return t}function sg(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function lg(t=""){throw new Error(t)}function cg(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function ug(t){return null!=t&&!Number.isNaN(t)}function Q(t,e){return hg(t,e)||{}}function hg(t,n){t=Object.entries(t).filter(([t])=>t.startsWith(n)).map(([t,e])=>[Pf(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function fg(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function dg(t){return"object"==typeof t&&!(t instanceof Date)&&null!==t}ag.props={};const pg=y=>{const v={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},m={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},b={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:null}},x={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10};return()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={}}=y,{links:t,nodes:l}=kp(t,e),c=Q(e,"node"),e=Q(e,"link"),{key:u=t=>t.key,color:h=u}=c,{links:i,nodes:t}=ag(Object.assign(Object.assign(Object.assign({},v),{nodeId:xp(u)}),i))({links:t,nodes:l});const f=Q(r,"label"),{text:d=u,spacing:p=5}=f,g=J(f,["text","spacing"]);return[R({},m,{data:t,encode:Object.assign(Object.assign({},c),{color:h}),scale:n,style:Q(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},x),{text:d,dx:t=>t.x[0]<.5?p:-p}),g),...a],animate:"object"==typeof s?Q(s,"node"):s,axis:!1}),R({},b,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa"},Q(r,"link")),animate:"object"==typeof s?Q(s,"link"):s})]}},gg=(pg.props={composite:!0},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);gg.props={defaultShape:"path",defaultLabelShape:"label",channels:[...hp({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[],postInference:[...gp()]};const yg=t=>t?parseInt(t):0;function vg(t,e,n,r){var i;return e?(e=t,t=getComputedStyle(e),i=e.clientWidth||yg(t.width),e=e.clientHeight||yg(t.height),{width:(i={width:i-(yg(t.paddingLeft)+yg(t.paddingRight)),height:e-(yg(t.paddingTop)+yg(t.paddingBottom))}).width,height:i.height}):{width:n,height:r}}function mg(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t;return{width:e-r-i-s-l-h-f,height:t-a-n-c-o-d-u}}function bg(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:sp,treemapDice:Vd,treemapSlice:ip,treemapSliceDice:lp,treemapSquarify:op,treemapResquarify:cp};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?Kd().path(p):Kd():yd)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(Hd),t}function y(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;i<n&&(n=i=(n+i)/2),a<r&&(r=a=(r+a)/2),t.x0=n,t.y0=r,t.x1=i,t.y1=a,t.children&&(e=l[t.depth+1]=c(t)/2,n+=d(t)-e,r+=u(t)-e,(i-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:t[r]).sort(e.sort):p.count(),o=op,i=!1,s=a=1,l=[0],d=f=h=u=c=Md,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=Ed(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:Od(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:Od(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:Od(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:Od(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:Od(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}const xg=u=>t=>{var{width:t,height:e}=mg(t),{data:n,encode:r={},scale:i,style:a={},layout:o={},labels:s=[]}=u,l=J(u,["data","encode","scale","style","layout","labels"]),c={tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0},t={type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"}},e=bg(n,R({},c,o),r),n=Q(a,"label");return[R({},t,Object.assign(Object.assign({data:e,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0}),n),...s]},l),{axis:!1}))]},wg=(xg.props={composite:!0},u=>t=>{var{width:t,height:e}=mg(t),{data:n,encode:r={},scale:i={},style:a={},layout:o={},labels:s=[]}=u,l=J(u,["data","encode","scale","style","layout","labels"]),c={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:r.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:r.color?void 0:t=>0===t.height?"":"#000"}},n=((t,e,n)=>{const r=n["value"];n=(Af(t)?Kd().path(e.path):yd)(t);return r?n.sum(t=>t[r]).sort(e.sort):n.count(),Dd().size(e.size).padding(e.padding)(n),n.descendants()})(n,R({},{size:[t,e],padding:0,sort:(t,e)=>e.value-t.value},o),R({},c.encode,r)),t=Q(a,"label");return[R({},c,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),t),...s]},l),{axis:!1}))]});function kg(t,e){return i0(t,t=>e[t])}function Eg(t,e){return n0(t,t=>e[t])}function Mg(t,e){const n=2.5*Og(t,e)-1.5*_g(t,e);return i0(t,t=>e[t]>=n?e[t]:NaN)}function Og(t,e){return l0(t,.25,t=>e[t])}function Sg(t,e){return l0(t,.5,t=>e[t])}function _g(t,e){return l0(t,.75,t=>e[t])}function Ag(t,e){const n=2.5*_g(t,e)-1.5*Og(t,e);return n0(t,t=>e[t]<=n?e[t]:NaN)}function Tg(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(zp(t,t=>a[+t]).values()).flatMap(t=>{const e=Mg(t,i),n=Ag(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}wg.props={composite:!0};const Pg=s=>()=>{var{data:t,encode:e,style:n={}}=s,r=J(s,["data","encode","style"]),{extend:i=!1}=n,n=J(n,["extend"]),a=e["y"],a={y:a,y1:a,y2:a,y3:a,y4:a},o={y1:Og,y2:Sg,y3:_g};return i?[Object.assign({type:"box",data:t,transform:[Object.assign(Object.assign({type:"groupX",y:kg},o),{y4:Eg})],encode:Object.assign(Object.assign({},e),a),style:n},r)]:(i=Q(n,"box"),n=Q(n,"point"),[Object.assign({type:"box",data:t,transform:[Object.assign(Object.assign({type:"groupX",y:Mg},o),{y4:Ag})],encode:Object.assign(Object.assign({},e),a),style:i},r),{type:"point",data:t,transform:[{type:Tg}],encode:e,style:Object.assign({},n)}])},Lg=(Pg.props={composite:!0},s=>{var t=s["cartesian"];return t?bp:(t,e,n,r)=>{const{x:i,y:a}=n,o=vp(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function Cg(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,m=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+v)/2))?g=a:v=a,(u=n>=(o=(y+m)/2))?y=o:m=o,!(d=(i=d)[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+v)/2))?g=a:v=a,(u=n>=(o=(y+m)/2))?y=o:m=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function Ng(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function jg(t){return t[0]}function Rg(t){return t[1]}function Fg(t,e,n){e=new Bg(null==e?jg:e,null==n?Rg:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function Bg(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Ig(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}Lg.props={defaultShape:"shape",defaultLabelShape:"label",channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};Ja=Fg.prototype=Bg.prototype;function Dg(t){return function(){return t}}function zg(t){return 1e-6*(t()-.5)}function Gg(t){return t.index}function Wg(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function Hg(c){var u,h,a,o,f,d,s=Gg,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=Dg(30),p=1;function e(t){for(var e=0,n=c.length;e<p;++e)for(var r,i,a,o,s,l=0;l<n;++l)r=(i=c[l]).source,a=(i=i.target).x+i.vx-r.x-r.vx||zg(d),o=i.y+i.vy-r.y-r.vy||zg(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[l]),i.vy-=o*s,r.vx+=a*(s=1-s),r.vy+=o*s}function i(){if(a){var t,e=a.length,n=c.length,r=new Map(a.map((t,e)=>[s(t,e,a),t])),i=0;for(o=new Array(e);i<n;++i)(t=c[i]).index=i,"object"!=typeof t.source&&(t.source=Wg(r,t.source)),"object"!=typeof t.target&&(t.target=Wg(r,t.target)),o[t.source.index]=(o[t.source.index]||0)+1,o[t.target.index]=(o[t.target.index]||0)+1;for(i=0,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=new Array(n),g()}}function l(){if(a)for(var t=0,e=c.length;t<e;++t)u[t]=+n(c[t],t,c)}function g(){if(a)for(var t=0,e=c.length;t<e;++t)h[t]=+r(c[t],t,c)}return null==c&&(c=[]),e.initialize=function(t,e){a=t,d=e,i()},e.links=function(t){return arguments.length?(c=t,i(),e):c},e.id=function(t){return arguments.length?(s=t,e):s},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(n="function"==typeof t?t:Dg(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:Dg(+t),g(),e):r},e}Ja.copy=function(){var t,e,n=new Bg(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(r)if(r.length)for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Ig(e));else n._root=Ig(r);return n},Ja.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return Cg(this.cover(e,n),e,n,t)},Ja.addAll=function(t){for(var e,n,r=t.length,i=new Array(r),a=new Array(r),o=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<r;++u)isNaN(e=+this._x.call(null,n=t[u]))||isNaN(n=+this._y.call(null,n))||((i[u]=e)<o&&(o=e),l<e&&(l=e),(a[u]=n)<s&&(s=n),c<n&&(c=n));if(!(l<o||c<s))for(this.cover(o,s).cover(l,c),u=0;u<r;++u)Cg(this,i[u],a[u],t[u]);return this},Ja.cover=function(t,e){if(!isNaN(t=+t)&&!isNaN(e=+e)){var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;t<n||i<=t||e<r||a<=e;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}this._x0=n,this._y0=r,this._x1=i,this._y1=a}return this},Ja.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},Ja.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},Ja.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],y=this._root;for(y&&g.push(new Ng(y,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(y=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<h||(i=r.y1)<f||(y.length?(g.push(new Ng(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new Ng(y[2],s,c,a,i),new Ng(y[1],a,l,o,c),new Ng(y[0],s,l,a,c)),(i=(c<=e)<<1|a<=t)&&(r=g[g.length-1],g[g.length-1]=g[g.length-1-i],g[g.length-1-i]=r)):(l=(o=t-+this._x.call(null,y.data))*o+(s=e-+this._y.call(null,y.data))*s)<n&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=y.data));return u},Ja.remove=function(t){if(!isNaN(a=+this._x.call(null,t))&&!isNaN(o=+this._y.call(null,t))){var e,n,r,i,a,o,s,l,c,u,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,y=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+y)/2))?p=s:y=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},Ja.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Ja.root=function(){return this._root},Ja.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},Ja.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new Ng(c,this._x0,this._y0,this._x1,this._y1));a=l.pop();)!t(c=a.node,n=a.x0,r=a.y0,i=a.x1,a=a.y1)&&c.length&&(o=(n+i)/2,s=(r+a)/2,(e=c[3])&&l.push(new Ng(e,o,s,i,a)),(e=c[2])&&l.push(new Ng(e,n,s,o,a)),(e=c[1])&&l.push(new Ng(e,o,r,i,s)),e=c[0])&&l.push(new Ng(e,n,r,o,s));return this},Ja.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new Ng(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new Ng(i,a,o,c,u)),(i=h[1])&&n.push(new Ng(i,c,o,s,u)),(i=h[2])&&n.push(new Ng(i,a,u,c,l)),i=h[3])&&n.push(new Ng(i,c,u,s,l)),r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},Ja.x=function(t){return arguments.length?(this._x=t,this):this._x},Ja.y=function(t){return arguments.length?(this._y=t,this):this._y};var Vg={value:()=>{}};function Yg(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new qg(r)}function qg(t){this._=t}function Ug(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Vg,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}qg.prototype=Yg.prototype={constructor:qg,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(0<=n&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=Ug(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Ug(i[n],t.name,null);return this}for(;++o<s;)if(n=(n=(t=a[o]).type)&&function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(i[n],t.name))return n},copy:function(){var t,e={},n=this._;for(t in n)e[t]=n[t].slice();return new qg(e)},call:function(t,e){if(0<(n=arguments.length-2))for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var Xg,$g,Kg=0,Zg=0,Jg=0,Qg=1e3,ty=0,ey=0,ny=0,ry="object"==typeof performance&&performance.now?performance:Date,iy="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ay(){return ey||(iy(oy),ey=ry.now()+ny)}function oy(){ey=0}function sy(){this._call=this._time=this._next=null}function ly(t,e,n){var r=new sy;return r.restart(t,e,n),r}function cy(){ey=(ty=ry.now())+ny,Kg=Zg=0;try{ay(),++Kg;for(var t,e=Xg;e;)0<=(t=ey-e._time)&&e._call.call(void 0,t),e=e._next;--Kg}finally{for(var n,r,i=Xg,a=1/(Kg=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:Xg=r);$g=n,hy(a),ey=0}}function uy(){var t=ry.now(),e=t-ty;Qg<e&&(ny-=e,ty=t)}function hy(t){Kg||(Zg=Zg&&clearTimeout(Zg),24<t-ey?(t<1/0&&(Zg=setTimeout(cy,t-ry.now()-ny)),Jg=Jg&&clearInterval(Jg)):(Jg||(ty=ry.now(),Jg=setInterval(uy,Qg)),Kg=1,iy(cy)))}sy.prototype=ly.prototype={constructor:sy,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?ay():+n)+(null==e?0:+e),this._next||$g===this||($g?$g._next=this:Xg=this,$g=this),this._call=t,this._time=n,hy()},stop:function(){this._call&&(this._call=null,this._time=1/0,hy())}};const fy=4294967296;function dy(t){return t.x}function py(t){return t.y}var gy=10,yy=Math.PI*(3-Math.sqrt(5));function vy(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=ly(i),n=Yg("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%fy)/fy}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.forEach(function(t){t(o)}),e=0;e<r;++e)null==(n=l[e]).fx?n.x+=n.vx*=u:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=u:(n.y=n.fy,n.vy=0);return a}function d(){for(var t,e,n,r=0,i=l.length;r<i;++r)(n=l[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),(isNaN(n.x)||isNaN(n.y))&&(t=gy*Math.sqrt(.5+r),e=r*yy,n.x=t*Math.cos(e),n.y=t*Math.sin(e)),(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}function p(t){return t.initialize&&t.initialize(l,r),t}return null==l&&(l=[]),d(),a={tick:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.forEach(p),a):l},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(e=+t,a):e},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(c=+t,a):c},velocityDecay:function(t){return arguments.length?(u=1-t,a):1-u},randomSource:function(t){return arguments.length?(r=t,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.get(t)},find:function(t,e,n){var r,i,a,o=0,s=l.length;for(null==n?n=1/0:n*=n,o=0;o<s;++o)(r=(r=t-(i=l[o]).x)*r+(r=e-i.y)*r)<n&&(a=i,n=r);return a},on:function(t,e){return 1<arguments.length?(n.on(t,e),a):n.on(t)}}}function my(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,F=(r=Dg(-30),d=(f=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,B()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:Dg(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=Fg(i,dy,py).visitAfter(I);for(u=t,e=0;e<n;++e)l=i[e],r.visit(D)}function B(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function I(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else for((e=t).x=e.data.x,e.y=e.data.y;o+=h[e.data.index],e=e.next;);t.value=o}function D(t,e,n,r){if(!t.value)return!0;var i=t.x-l.x,a=t.y-l.y,o=r-e,s=i*i+a*a;if(o*o/p<s)return s<d&&(0===i&&(s+=(i=zg(c))*i),0===a&&(s+=(a=zg(c))*a),s<f&&(s=Math.sqrt(f*s)),l.vx+=i*t.value*u/s,l.vy+=a*t.value*u/s),!0;if(!(t.length||d<=s))for((t.data!==l||t.next)&&(0===i&&(s+=(i=zg(c))*i),0===a&&(s+=(a=zg(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var y,v,m,b,x,w,k,E,M,O,S,_,A,T,n=Hg(a).id(xp(n)),P=("function"==typeof o&&F.strength(o),"function"==typeof s&&n.strength(s),vy(t).force("link",n).force("charge",F));function L(t){for(var e,n=0,r=v.length;n<r;++n)(e=v[n]).vy+=(b[n]-e.y)*m[n]*t}function C(){if(v){var t,e=v.length;for(m=new Array(e),b=new Array(e),t=0;t<e;++t)m[t]=isNaN(b[t]=+y(v[t],t,v))?0:+x(v[t],t,v)}}function N(t){for(var e,n=0,r=k.length;n<r;++n)(e=k[n]).vx+=(M[n]-e.x)*E[n]*t}function j(){if(k){var t,e=k.length;for(E=new Array(e),M=new Array(e),t=0;t<e;++t)E[t]=isNaN(M[t]=+w(k[t],t,k))?0:+O(k[t],t,k)}}function R(){for(var t,e=A.length,n=0,r=0,i=0;i<e;++i)n+=(t=A[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-_)*T,i=0;i<e;++i)(t=A[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==_&&(_=0),R.initialize=function(t){A=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(_=+t,R):_},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(O=Dg(.1),"function"!=typeof w&&(w=Dg(null==w?0:+w)),N.initialize=function(t){k=t,j()},N.strength=function(t){return arguments.length?(O="function"==typeof t?t:Dg(+t),j(),N):O},N.x=function(t){return arguments.length?(w="function"==typeof t?t:Dg(+t),j(),N):w},N)).force("y",(x=Dg(.1),"function"!=typeof y&&(y=Dg(null==y?0:+y)),L.initialize=function(t){v=t,C()},L.strength=function(t){return arguments.length?(x="function"==typeof t?t:Dg(+t),C(),L):x},L.y=function(t){return arguments.length?(y="function"==typeof t?t:Dg(+t),C(),L):y},L)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const by=h=>()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={}}=h,l=Q(e,"node"),c=Q(e,"link"),{links:t,nodes:u}=kp(t,e),{nodesData:t,linksData:u}=my({links:t,nodes:u},R({},{joint:!0},i),e);return[R({},{type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},{data:u,encode:c,labels:o,style:Q(r,"link"),animate:"object"==typeof s?Q(s,"link"):s}),R({},{type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},{data:t,encode:Object.assign({},l),scale:n,style:Q(r,"node"),labels:[Object.assign(Object.assign({},{text:""}),Q(r,"label")),...a],animate:"object"==typeof s?Q(s,"node"):s})]},xy=(by.props={composite:!0},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=yd(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),wy=t=>xy(pd)(t),ky=(wy.props={},t=>xy(rp)(t)),Ey=(ky.props={},c=>{const u={sortBy:(t,e)=>e.value-t.value},h={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},f={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},d={text:"",fontSize:10};return()=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={}}=c,l=null==e?void 0:e.value,{nodes:i,edges:l}=ky(Object.assign(Object.assign(Object.assign({},u),i),{field:l}))(t);return[R({},f,{data:l,encode:Q(e,"link"),scale:Q(n,"link"),labels:o,style:Object.assign({stroke:"#999"},Q(r,"link")),animate:"object"==typeof s?Q(s,"link"):s}),R({},h,{data:i,scale:Q(n,"node"),encode:Q(e,"node"),labels:[Object.assign(Object.assign({},d),Q(r,"label")),...a],style:Object.assign({},Q(r,"node")),animate:"object"==typeof s?Q(s,"node"):s})]}});Ey.props={composite:!0};var My={},Oy={},Sy=34,_y=10,Ay=13;function Ty(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function Py(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function Ly(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function Cy(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Ly(-e,6):9999<e?"+"+Ly(e,6):Ly(e,4))+"-"+Ly(t.getUTCMonth()+1,2)+"-"+Ly(t.getUTCDate(),2)+(a?"T"+Ly(n,2)+":"+Ly(r,2)+":"+Ly(i,2)+"."+Ly(a,3)+"Z":i?"T"+Ly(n,2)+":"+Ly(r,2)+":"+Ly(i,2)+"Z":r||n?"T"+Ly(n,2)+":"+Ly(r,2)+"Z":"")}function Ny(r){var e=new RegExp('["'+r+"\n\r]"),h=r.charCodeAt(0);function n(r,t){var e,n=[],i=r.length,a=0,o=0,s=i<=0,l=!1;function c(){if(s)return Oy;if(l)return l=!1,My;var t,e,n=a;if(r.charCodeAt(n)===Sy){for(;a++<i&&r.charCodeAt(a)!==Sy||r.charCodeAt(++a)===Sy;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===_y?l=!0:e===Ay&&(l=!0,r.charCodeAt(a)===_y)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===_y)l=!0;else if(e===Ay)l=!0,r.charCodeAt(a)===_y&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===_y&&--i,r.charCodeAt(i-1)===Ay&&--i;(e=c())!==Oy;){for(var u=[];e!==My&&e!==Oy;)u.push(e),e=c();t&&null==(u=t(u,o++))||n.push(u)}return n}function i(t,n){return t.map(function(e){return n.map(function(t){return o(e[t])}).join(r)})}function a(t){return t.map(o).join(r)}function o(t){return null==t?"":t instanceof Date?Cy(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,a){var o,s;return(t=n(t,function(t,e){if(o)return o(t,e-1);var n,r,i;s=t,o=a?(r=a,i=Ty(n=t),function(t,e){return r(i(t),e,n)}):Ty(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?Py(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?Py(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function jy(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;Ry&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const Ry=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),Fy=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>Oe(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),Ny(i).parse(t,a?jy:og);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};Fy.props={};const By=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};By.props={};const Iy=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},Dy=(Iy.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});Dy.props={};const zy=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};zy.props={};const Gy=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};Gy.props={};const Wy=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]<i[e]?-1:+(r[e]!==i[e]):r[e]>i[e]?-1:+(r[e]!==i[e]),0))}},Hy=(Wy.props={},t=>{const e=t["value"];return()=>e}),Vy=(Hy.props={},t=>{const{callback:e=og}=t;return t=>e(t)}),Yy=(Vy.props={},t=>{const{callback:e=og}=t;return t=>Array.isArray(t)?t.map(e):t});Yy.props={};var qy=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const Uy={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function Xy(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:y,targetWeight:v,sortBy:m}=Object.assign(Object.assign({},Uy),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=y(t),t.targetWeight=v(t)});const i=zp(r,t=>t.source),a=zp(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=p0(e,t=>t.sourceWeight)+p0(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof m?m:qy[m])&&r.sort(n),!(n=(r=e).length))throw lg("Invalid nodes: it's empty!");if(h){const o=f/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-f),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!h)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=zp(e,t=>t.source),l=zp(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const $y=e=>t=>Xy(e)(t),Ky=($y.props={},Math.PI/180),Zy=64,Jy=2048;function Qy(t){return t.text}function t1(){return"serif"}function e1(){return"normal"}function n1(t){return t.value}function r1(){return 90*~~(2*Math.random())}function i1(){return 1}function a1(){}function o1(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(Zy<<5)/c,Jy/c);let i=0,a=0,n=0;var u,h,f,d,e=r.length;for(--s;++s<e;){o=r[s],l.save(),l.font=o.style+" "+o.weight+" "+~~((o.size+1)/c)+"px "+o.font;let t=l.measureText(o.text+"m").width*c,e=o.size<<1;if(o.rotate?(d=Math.sin(o.rotate*Ky),f=Math.cos(o.rotate*Ky),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=Zy<<5&&(i=0,a+=n,n=0),a+e>=Jy)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*Ky),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(Zy<<5)/c,Jy/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var y=o.width,v=y>>5;let n=o.y1-o.y0;for(let t=0;t<n*v;t++)g[t]=0;if(null==(i=o.xoff))return;a=o.yoff;let r=0,t=-1;for(let e=0;e<n;e++){for(let t=0;t<y;t++){var m=v*e+(t>>5),b=p[(a+e)*(Zy<<5)+(i+t)<<2]?1<<31-t%32:0;g[m]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*v)}}}function s1(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function l1(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function c1(){return document.createElement("canvas")}function u1(t){return"function"==typeof t?t:function(){return t}}const h1={archimedean:s1,rectangular:function(t){const n=4*t[0]/t[1];let r=0,i=0;return function(t){var e=t<0?-1:1;switch(Math.sqrt(1+4*e*t)-e&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};function f1(){let b=[256,256],r=Qy,i=t1,p=n1,g=e1,y=r1,v=i1,x=s1,w=Math.random,m=a1,k=[],E=null,M=1/0;const O=e1,S=c1,_={};return _.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(Zy<<5)/e,t.height=Jy/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=_.board||l1((b[0]>>5)*b[1]),c=k.length,u=[],h=k.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=O.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=y.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=v.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=_.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<M&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,o1(s,i,h,f),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e<l;e++){for(let t=u=0;t<=a;t++)if((u<<s|(t<a?(u=i[e*a+t])>>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}(t,e))){var f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),y=127&g,v=32-y,m=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<m;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<v|(t<d?(n=f[e*d+t])>>>y:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(m.call(null,"word",{cloud:_,word:i}),u.push(i),d?_.hasImage||(t=d,e=i,n=void 0,n=t[0],t=t[1],e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}_._tags=u,_._bounds=d,f>=c&&(_.stop(),m.call(null,"end",{cloud:_,words:u,bounds:d}))}return E&&clearInterval(E),E=setInterval(n,0),n(),_},_.stop=function(){return E&&(clearInterval(E),E=null),_},_.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=l1((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e<r;e++)for(let t=0;t<n;t++){var s=i*e+(t>>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}_.board=a,_.hasImage=!0}},_.timeInterval=function(t){M=null==t?1/0:t},_.words=function(t){k=t},_.size=function(t=[]){b=[+t[0],+t[1]]},_.text=function(t){r=u1(t)},_.font=function(t){i=u1(t)},_.fontWeight=function(t){g=u1(t)},_.rotate=function(t){y=u1(t)},_.spiral=function(t){x=h1[t]||t},_.fontSize=function(t){p=u1(t)},_.padding=function(t){v=u1(t)},_.random=function(t){w=u1(t)},_.on=function(t){m=u1(t)},_}const d1={size:[500,500],fontSize:[14,28]};function p1(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const g1=f=>h=>Oe(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},d1,f),e=f1(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return Oe(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=h.map(t=>t.value),n=t,t=[i0(e),n0(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",p1,e.createMask),e.words([...h]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=J(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function y1(e){return"string"==typeof e?t=>t[e]:e}g1.props={};const v1=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=y1(r),l=y1(t),c=Gp(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},m1=(v1.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});m1.props={};const b1=u=>c=>Oe(void 0,void 0,void 0,function*(){var{width:t,height:e}=mg(c),{data:n,encode:r={},scale:i,style:a={},layout:o={}}=u,s=J(u,["data","encode","scale","style","layout"]),l={size:[t,e]},t={axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},e=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(n,r),n=yield g1(Object.assign(Object.assign({},l),o))(e);return[R({},t,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a},s),{axis:!1}))]}),x1=(b1.props={composite:!0},()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"]),w1=(x1.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),k1=(w1.props={},()=>["#95F0FF","#78D3F8","#5AB8DB","#3A9DBF","#0A82A4","#00698A","#005170","#003958","#002440"]),E1=(k1.props={},()=>["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"]),M1=(E1.props={},()=>["#9DF5CA","#61DDAA","#42C090","#19A576","#008A5D","#006F45","#00562F","#003E19","#002800"]),O1=(M1.props={},()=>["#8CF4F2","#6FD8D6","#52BCBA","#31A09F","#008685","#006C6C","#005354","#003B3D","#002627"]),S1=(O1.props={},()=>["#D0E4FF","#B4C8ED","#99ADD1","#7E92B5","#65789B","#4C6080","#334867","#1B324F","#021D38"]),_1=(S1.props={},()=>["#FFC771","#FFAB57","#F6903D","#D77622","#B85C00","#9B4300","#7D2A00","#601000","#450000"]),A1=(_1.props={},()=>["#FFC2EC","#FFA6D0","#F08BB4","#D37099","#B65680","#9A3C67","#7E214F","#630038","#490022"]),T1=(A1.props={},()=>["#FFBB95","#FF9E7B","#FF8362","#E8684A","#C84D32","#AA311C","#8C1104","#6F0000","#510000"]),P1=(T1.props={},()=>["#FFD83B","#F6BD16","#D7A100","#B98700","#9C6E00","#7F5600","#633F00","#482900","#2F1400"]),L1=(P1.props={},()=>["#FFCCFF","#EBB0FF","#CE95F5","#B27AD8","#9661BC","#7B48A1","#613086","#48186C","#2E0054"]),C1=(L1.props={},()=>["#FDEDBE","#FFDF80","#FFCB33","#FFB200","#FF8C00","#FF6500","#E6450F","#B22C00","#661900"]),N1=(C1.props={},()=>["#FFEBB0","#FFDF80","#FACA3E","#E6B80B","#B5AC23","#6A9A48","#20876B","#06746B","#044E48"]),j1=(N1.props={},()=>["#FFEBB0","#FFDF80","#FACA3E","#E6B80B","#B5AC23","#6A9A48","#20876B","#06746B","#044E48"]),R1=(j1.props={},()=>["#D2EDC8","#A9DACC","#75C6D1","#42B3D5","#3993C2","#3073AE","#27539B","#1E3388","#171E6D"]),F1=(R1.props={},()=>["#003F7F","#004C99","#0059B2","#0072E5","#1A8CFF","#4DA6FF","#80BFFF","#B3D9FF","#EAE9EB","#FFD5B1","#FFC08C","#FFAB66","#FF963E","#F17F0B","#D16A0C","#A45411","#794012"]),B1=(F1.props={},()=>["#661900","#B22C00","#E6450F","#FF6500","#FF8C00","#FFB200","#FFCB33","#FFDF80","#E0F2EB","#66D8FF","#1AC5FF","#007FFF","#0059FF","#0040FF","#002CB2","#FFDF80","#001F7F"]),I1=(B1.props={},()=>["#014c63","#10686c","#168575","#16a37e","#0bc286","#65cf9b","#96dcb0","#c1e8c5","#F2EAEA","#FFC5AC","#FFA884","#FF895D","#FF6836","#F3470D","#D13808","#A4300C","#7A270E"]),D1=(I1.props={},()=>["#661900","#B22C00","#E6450F","#FF6500","#FF8C00","#FFB200","#FFCB33","#FFDF80","#FFE2DC","#EAACFF","#DD78FF","#C53FFF","#A700FF","#8500FF","#620BE1","#3607C2","#27029A"]);function z1(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function G1(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function W1(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);a<o;){var l=Math.floor((a+o)/2);s(t[l])>e?o=l:a=l+1}return a}D1.props={};const H1=Math.sqrt(50),V1=Math.sqrt(10),Y1=Math.sqrt(2);function q1(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=H1?10:n>=V1?5:n>=Y1?2:1)*10**t:-(10**-t)/(n>=H1?10:n>=V1?5:n>=Y1?2:1)}function U1(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=H1?r*=10:n>=V1?r*=5:n>=Y1&&(r*=2),e<t?-r:r}const X1=(t,e,n=5)=>{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o<a&&([a,o]=[o,a],[r,i]=[i,r]),0<(s=q1(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=q1(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=q1(a,o,n)),0<s?(t[r]=Math.floor(a/s)*s,t[i]=Math.ceil(o/s)*s):s<0&&(t[r]=Math.ceil(a*s)/s,t[i]=Math.floor(o*s)/s),t},$1=36e5,K1=864e5,Z1=7*K1;K1,K1;function J1(t,n,s,r){const i=(t,e)=>{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}Ql=J1(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),a=J1(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),no=J1(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),ro=J1($1,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+$1*e)},t=>t.getHours()),oo=J1(K1,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+K1*e)},t=>t.getDate()-1);const Q1=J1(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());so=J1(Z1,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Z1*e)},t=>{var e=Q1.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Z1)}),lo=J1(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const tv={millisecond:Ql,second:a,minute:no,hour:ro,day:oo,week:so,month:Q1,year:lo};co=J1(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),uo=J1(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),o=J1(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),ho=J1($1,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+$1*e)},t=>t.getUTCHours()),fo=J1(K1,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+K1*e)},t=>t.getUTCDate()-1);const ev=J1(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());po=J1(Z1,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Z1*e)},t=>{var e=ev.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Z1)}),io=J1(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const nv={millisecond:co,second:uo,minute:o,hour:ho,day:fo,week:po,month:ev,year:io};function rv(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?nv:tv;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=W1(i,l,0,c,s);let h;return h=u===c?[a,U1(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1])<s(i[u])/l?i[u-1]:i[u],[c,r?Math.ceil(r/c.duration):a]):[o,Math.max(U1(t,e,n),1)]}const iv=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=rv(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function av(t){return null!=t&&!Number.isNaN(t)}const ov=e=>t=>-e(-t),sv=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:t=>Math.log(t)/n;return e?ov(t):t},lv=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?ov(n):n},cv=(t,e,n,r)=>{var i=t<0,a=sv(r,i),r=lv(r,i),i=e<t,o=i?t:e,e=[r(Math.floor(a(i?e:t))),r(Math.ceil(a(o)))];return i?e.reverse():e};function uv(e,o){return t=>{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return Nf(t)?Math.round(t):t}):i;this.output=z1(a,r,e,t)},t.prototype.invert=void 0}}var hv,c={exports:{}},nc={exports:{}},fv=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},dv=Array.prototype.concat,pv=Array.prototype.slice,gv=nc.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];fv(i)?e=dv.call(e,pv.call(i)):e.push(i)}return e},yv=(gv.wrap=function(t){return function(){return t(gv(arguments))}},{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),vv=nc.exports,mv=Object.hasOwnProperty,bv=Object.create(null);for(hv in yv)mv.call(yv,hv)&&(bv[yv[hv]]=hv);var xv=c.exports={to:{},get:{}};function wv(t,e,n){return Math.min(Math.max(e,t),n)}function kv(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}xv.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=xv.get.hsl(t),n="hsl";break;case"hwb":e=xv.get.hwb(t),n="hwb";break;default:e=xv.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},xv.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(e.slice(a,2+a),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:mv.call(yv,e[1])?((i=yv[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]))}e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=wv(i[n],0,255);return i[3]=wv(i[3],0,1),i},xv.get.hsl=function(t){var e;return(t=t&&t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,wv(parseFloat(t[2]),0,100),wv(parseFloat(t[3]),0,100),wv(isNaN(e)?1:e,0,1)]):null},xv.get.hwb=function(t){var e;return(t=t&&t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,wv(parseFloat(t[2]),0,100),wv(parseFloat(t[3]),0,100),wv(isNaN(e)?1:e,0,1)]):null},xv.to.hex=function(){var t=vv(arguments);return"#"+kv(t[0])+kv(t[1])+kv(t[2])+(t[3]<1?kv(Math.round(255*t[3])):"")},xv.to.rgb=function(){var t=vv(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},xv.to.rgb.percent=function(){var t=vv(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},xv.to.hsl=function(){var t=vv(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},xv.to.hwb=function(){var t=vv(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},xv.to.keyword=function(t){return bv[t.slice(0,3)]};var Ev=c.exports;function Mv(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Ov(t){var e,n,r,t=Ev.get(t);return t?({model:t,value:e}=t,"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*Mv(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*Mv(n,r,e),255*Mv(n,r,e-1/3),t]):null):null}const Sv=(e,n)=>t=>e*(1-t)+n*t,_v=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return Sv(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=Ov(n),c=Ov(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},Av=(t,e)=>{const n=Sv(t,e);return t=>Math.round(n(t))};function Tv({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function Pv(t){return"object"==typeof t?t.valueOf():t}class Lv extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Pv,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(Tv({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Tv({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class Cv{constructor(t){this.options=R({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=R({},this.options,t),this.rescale(t)}rescale(t){}}const Nv=Symbol("defaultUnknown");function jv(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function Rv(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==Nv)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function Fv(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Bv extends Cv{constructor(t){super(t)}getDefaultOptions(){return{domain:[],range:[],unknown:Nv}}map(t){return 0===this.domainIndexMap.size&&jv(this.domainIndexMap,this.getDomain(),this.domainKey),Rv({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&jv(this.rangeIndexMap,this.getRange(),this.rangeKey),Rv({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=Fv(e),this.rangeKey=Fv(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new Bv(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function Iv(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new Lv(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new Lv(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let y=o?Math.round(t):t;var v=new Array(l);for(let t=0;t<l;t+=1){v[t]=(m=y,Math.round(1e12*m)/1e12);var m=e[t];y+=g.get(m)}return{valueBandWidth:c,valueStep:g,adjustedRange:v}}class Dv extends Bv{constructor(t){super(t)}getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Nv,flex:[]}}clone(){return new Dv(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t["domain"];if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!(null==(n=t.flex)||!n.length))return Iv(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:a}=t;let o,s,l=n[0];return n=n[1]-l,o=n/Math.max(1,2*t+(e-r)),i&&(o=Math.floor(o)),l+=(n-o*(e-r))*a,s=o*(1-r),i&&(l=Math.round(l),s=Math.round(s)),t=new Array(e).fill(0).map((t,e)=>l+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const zv=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=q1(a,o,n);if(0===s||!Number.isFinite(s))return[];if(0<s){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i};function Gv(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Wv=[1,5,2,2.5,4,3],Hv=100*Number.EPSILON;const Vv=(n,r,t=5,i=!0,a=Wv,o=[.25,.2,.5,.05])=>{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,h,f,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let y=1;for(;y<1/0;){for(let t=0;t<a.length;t+=1){var v=a[t],m=(h=v,f=a,d=y,p=void 0,p=Hf(f),1-zf(f,h)/(p-1)-d+1);if(o[0]*m+o[1]+o[2]+o[3]<g.score){y=1/0;break}let e=2;for(;e<1/0;){x=e;var b=(u=s)<=x?2-(x-1)/(u-1):1;if(o[0]*m+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/y/v;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=y*v*10**t,k=(M=r,k=w*(e-1),(M-=n)<k?1-((k-M)/2)**2/(.1*M)**2:1);if(o[0]*m+o[1]*k+o[2]*b+o[3]<g.score)break;var E=Math.floor(r/w)*y-(e-1)*y,M=Math.ceil(n/w)*y;if(E<=M){var O=M-E;for(let t=0;t<=O;t+=1){var S=(E+t)*(w/y),_=S+w*(e-1),A=w,T=function(t,e,n,r,i,a){var o=Hf(e),e=zf(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<Hv||a-t<Hv)&&r<=0&&0<=i?1:s)}(v,a,y,S,_,A),P=1-.5*((r-_)**2+(n-S)**2)/(.1*(r-n))**2,L=(l=e,L=n,l=(l-1)/(_-(C=S)),c=((c=s)-1)/(Math.max(_,r)-Math.min(L,C)),2-Math.max(l/c,c/l)),C=o[0]*T+o[1]*P+o[2]*L+ +o[3];g.score<C&&(!i||S<=n&&r<=_)&&(g.lmin=S,g.lmax=_,g.lstep=A,g.score=C)}}t+=1}e+=1}}y+=1}var t=Gv(g.lmax),e=Gv(g.lmin),N=Gv(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=Gv(e);for(let t=1;t<j;t+=1)R[t]=Gv(R[t-1]+N);return R};class Yv extends Cv{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Vv}}map(t){return av(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Yv(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Nf(t)&&Nf(r)?n(t,r,e):[]}}const qv=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return z1(o=t<r?(a=G1(t,r),n(e,i)):(a=G1(r,t),n(i,e)),a)},Uv=(r,t,e)=>{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t<i;t+=1)a[t]=G1(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=W1(r,t,1,i)-1,n=a[e];return z1(o[e],n)(t)}},Xv=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?Uv:qv)(t,e,r?Av:n)};class $v extends Cv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Sv,tickCount:5}}map(t){return av(t)?this.output(t):this.options.unknown}invert(t){return av(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options["tickMethod"],[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return X1}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,t=this.options.domain.map(t),n=Math.min(t.length,n.length);if(e){e=t[0],t=t[n-1];const r=t<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return If}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=Xv(n.map(t),r,a,i);this.output=z1(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=Xv(i,r.map(t),Sv);this.input=z1(e,n,i)}}class Kv extends $v{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:_v,tickMethod:zv,tickCount:5}}chooseTransforms(){return[If,If]}clone(){return new Kv(this.options)}}class Zv extends Dv{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Nv,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Zv(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Jv=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class Qv extends $v{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:_v,tickMethod:zv,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[If,If]:(t=.5===r?Jv:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new Qv(this.options)}}class tm extends Qv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:_v,tickMethod:zv,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new tm(this.options)}}class em extends Cv{constructor(t){super(t)}getDefaultOptions(){return{domain:[.5],range:[0,1]}}map(t){return av(t)?(t=W1(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new em(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const nm=(t,e,n,r=10)=>{var i=t<0,a=lv(r,i),o=sv(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var y=g*t;if(c<y)break;l<=y&&f.push(y)}}2*f.length<n&&(f=zv(l,c,n))}else f=zv(u,h,Math.min(h-u,n)).map(a);return s?f.reverse():f};class rm extends $v{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:_v,tickMethod:nm,tickCount:5}}chooseNice(){return cv}getTickMethodOptions(){var{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){var{base:t,domain:e}=this.options,e=e[0]<0;return[sv(t,e),lv(t,e)]}clone(){return new rm(this.options)}}class im extends em{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Vv}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=X1(n,t,e))}getTicks(){var t=this.options["tickMethod"],[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();var{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){var[t,e]=super.invert(t),[n,r]=this.options.domain;return void 0===t&&void 0===e?[t,e]:[t||n,e||r]}getThresholds(){return this.thresholds}clone(){return new im(this.options)}}function am(t,e,n=!1){var r=t,i=(n||r.sort((t,e)=>t-e),[]);for(let t=1;t<e;t+=1)i.push(function(t,e){var n,r=t.length;if(r)return r<2?t[r-1]:(r=(r-1)*e,(n=t[e=Math.floor(r)])+(t[e+1]-n)*(r-e))}(r,t/e));return i}class om extends em{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Vv}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=am(t,this.n+1,!1)}invert(t){var[t,e]=super.invert(t),n=this.options["domain"],r=n[0],n=n[n.length-1];return void 0===t&&void 0===e?[t,e]:[t||r,e||n]}getThresholds(){return this.thresholds}clone(){return new om(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var sm=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,lm=/\[([^]*?)\]/gm;function cm(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function um(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a,o=i[r];for(a in o)t[a]=o[a]}return t}function hm(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var fm,l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ac=["January","February","March","April","May","June","July","August","September","October","November","December"],lc=cm(ac,3),dm=um({},{dayNamesShort:cm(l,3),dayNames:l,monthNamesShort:lc,monthNames:ac,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),pm={D:function(t){return String(t.getDate())},DD:function(t){return hm(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return hm(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return hm(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return hm(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return hm(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return hm(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return hm(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return hm(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return hm(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return hm(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return hm(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return(t.getHours()<12?e.amPm[0]:e.amPm[1]).toUpperCase()},ZZ:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+hm(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+hm(Math.floor(Math.abs(t)/60),2)+":"+hm(Math.abs(t)%60,2)}},gm={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const ym=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=rv(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function vm(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class mm extends $v{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:ym,interpolate:Sv,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return iv}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?nv:tv,s=t?vm:If;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t)<t?".SSS":n.floor(t)<t?":ss":r.floor(t)<t?"hh:mm":i.floor(t)<t?"hh A":o.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":s.floor(t)<t?"MMMM":"YYYY"}(t,o),n=void 0;if(void 0===t&&(t=gm.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var r=[],i=(t=(t=gm[t]||t).replace(lm,function(t,e){return r.push(e),"@@@"}),um(um({},dm),n));return(t=t.replace(sm,function(t){return pm[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new mm(this.options)}}var bm;let xm=fm=class extends Kv{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:If,tickMethod:zv,tickCount:5}}constructor(t){super(t)}clone(){return new fm(this.options)}};xm=fm=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([uv(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return z1(Sv(0,1),G1(t,e))})],xm);let wm=bm=class extends Kv{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:If,tickMethod:zv,tickCount:5}}constructor(t){super(t)}clone(){return new bm(this.options)}};wm=bm=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([uv(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=z1(Sv(0,.5),G1(e,n)),a=z1(Sv(.5,1),G1(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],wm);const km=t=>new Dv(t),Em=(km.props={},t=>new Kv(t)),Mm=(Em.props={},t=>new Bv(t)),Om=(Mm.props={},t=>new Yv(t)),Sm=(Om.props={},t=>new Zv(t)),_m=(Sm.props={},t=>new mm(t)),Am=(_m.props={},t=>new rm(t)),Tm=(Am.props={},t=>new Qv(t)),Pm=(Tm.props={},t=>new em(t)),Lm=(Pm.props={},t=>new om(t)),Cm=(Lm.props={},t=>new im(t)),Nm=(Cm.props={},t=>new tm(t)),jm=(Nm.props={},t=>new xm(t));function Rm(t){return function(){return t}}jm.props={};const Fm=Math.abs,Bm=Math.atan2,Im=Math.cos,Dm=Math.max,zm=Math.min,Gm=Math.sin,Wm=Math.sqrt,Hm=1e-12,Vm=Math.PI,Ym=Vm/2,qm=2*Vm;function Um(t){return 1<=t?Ym:t<=-1?-Ym:Math.asin(t)}const Xm=Math.PI,$m=2*Xm,Km=1e-6,Zm=$m-Km;function Jm(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class Qm{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Jm:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return Jm;const r=10**e;return function(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=Math.round(arguments[t]*r)/r+n[t]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: "+i);var a,o,s=this._x1,l=this._y1,c=n-t,u=r-e,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>Km&&(Math.abs(f*c-u*h)>Km&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((Xm-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>Km&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*n)},${this._x1=t+r*c},${this._y1=e+r*u}`):this._append`L${this._x1=t},${this._y1=e}`)}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error("negative radius: "+n);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>Km||Math.abs(this._y1-c)>Km)&&this._append`L${l},${c}`,n&&((h=h<0?h%$m+$m:h)>Zm?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>Km&&this._append`A${n},${n},0,${+(h>=Xm)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function tb(){return new Qm}function eb(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new Qm(r)}function nb(t){return t.innerRadius}function rb(t){return t.outerRadius}function ib(t){return t.startAngle}function ab(t){return t.endAngle}function ob(t){return t&&t.padAngle}function sb(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/Wm(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*Wm(Dm(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function lb(){var A=nb,T=rb,P=Rm(0),L=null,C=ib,N=ab,j=ob,R=null,F=eb(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,v,m,b,x,w,k=+A.apply(this,arguments),E=+T.apply(this,arguments),M=C.apply(this,arguments)-Ym,O=N.apply(this,arguments)-Ym,S=Fm(O-M),_=M<O;if(R=R||(t=F()),E<k&&(e=E,E=k,k=e),E>Hm?S>qm-Hm?(R.moveTo(E*Im(M),E*Gm(M)),R.arc(0,0,E,M,O,!_),k>Hm&&(R.moveTo(k*Im(O),k*Gm(O)),R.arc(0,0,k,O,M,_))):(r=e=M,i=n=O,o=a=S,f=(u=j.apply(this,arguments)/2)>Hm&&(L?+L.apply(this,arguments):Wm(k*k+E*E)),w=x=s=zm(Fm(E-k)/2,+P.apply(this,arguments)),f>Hm&&(h=Um(f/k*Gm(u)),f=Um(f/E*Gm(u)),(a-=2*h)>Hm?(r+=h*=_?1:-1,i-=h):(a=0,r=i=(M+O)/2),(o-=2*f)>Hm?(e+=f*=_?1:-1,n-=f):(o=0,e=n=(M+O)/2)),u=E*Im(e),h=E*Gm(e),f=k*Im(i),M=k*Gm(i),s>Hm&&(d=E*Im(n),p=E*Gm(n),g=k*Im(r),y=k*Gm(r),S<Vm)&&((O=function(t,e,n,r,i,a,o,s){var l=(s=s-a)*(n=n-t)-(o=o-i)*(r=r-e);if(!(l*l<Hm))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,M))?(S=u-O[0],m=h-O[1],b=d-O[0],v=p-O[1],m=1/Gm((1<(S=(S*b+m*v)/(Wm(S*S+m*m)*Wm(b*b+v*v)))?0:S<-1?Vm:Math.acos(S))/2),b=Wm(O[0]*O[0]+O[1]*O[1]),x=zm(s,(k-b)/(m-1)),w=zm(s,(E-b)/(1+m))):x=w=0),o>Hm?w>Hm?(l=sb(g,y,u,h,E,w,_),c=sb(d,p,f,M,E,w,_),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,Bm(l.y01,l.x01),Bm(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,w,Bm(l.y01,l.x01),Bm(l.y11,l.x11),!_),R.arc(0,0,E,Bm(l.cy+l.y11,l.cx+l.x11),Bm(c.cy+c.y11,c.cx+c.x11),!_),R.arc(c.cx,c.cy,w,Bm(c.y11,c.x11),Bm(c.y01,c.x01),!_))):(R.moveTo(u,h),R.arc(0,0,E,e,n,!_)):R.moveTo(u,h),k>Hm&&a>Hm?x>Hm?(l=sb(f,M,d,p,k,-x,_),c=sb(u,h,g,y,k,-x,_),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,Bm(l.y01,l.x01),Bm(c.y01,c.x01),!_):(R.arc(l.cx,l.cy,x,Bm(l.y01,l.x01),Bm(l.y11,l.x11),!_),R.arc(0,0,k,Bm(l.cy+l.y11,l.cx+l.x11),Bm(c.cy+c.y11,c.cx+c.x11),_),R.arc(c.cx,c.cy,x,Bm(c.y11,c.x11),Bm(c.y01,c.x01),!_))):R.arc(0,0,k,i,r,_):R.lineTo(f,M)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+A.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+C.apply(this,arguments)+ +N.apply(this,arguments))/2-Vm/2;return[Im(e)*t,Gm(e)*t]},e.innerRadius=function(t){return arguments.length?(A="function"==typeof t?t:Rm(+t),e):A},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:Rm(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:Rm(+t),e):P},e.padRadius=function(t){return arguments.length?(L=null==t?null:"function"==typeof t?t:Rm(+t),e):L},e.startAngle=function(t){return arguments.length?(C="function"==typeof t?t:Rm(+t),e):C},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:Rm(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:Rm(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function cb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ub(t){this._context=t}function hb(t){return new ub(t)}function fb(t){return t[0]}function db(t){return t[1]}function pb(o,s){var l=Rm(!0),c=null,u=hb,h=null,f=eb(e);function e(t){var e,n,r,i=(t=cb(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?fb:Rm(o),s="function"==typeof s?s:void 0===s?db:Rm(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:Rm(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:Rm(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:Rm(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function gb(u,h,f){var d=null,p=Rm(!0),g=null,y=hb,v=null,m=eb(e);function e(t){var e,n,r,i,a,o=(t=cb(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(v=y(a=m())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,v.areaStart(),v.lineStart();else{for(v.lineEnd(),v.lineStart(),r=e-1;n<=r;--r)v.point(l[r],c[r]);v.lineEnd(),v.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),v.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return v=null,a+""||null}function t(){return pb().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?fb:Rm(+u),h="function"==typeof h?h:Rm(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?db:Rm(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:Rm(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:Rm(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:Rm(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:Rm(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:Rm(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:Rm(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:Rm(!!t),e):p},e.curve=function(t){return arguments.length?(y=t,null!=g&&(v=y(g)),e):y},e.context=function(t){return arguments.length?(null==t?g=v=null:v=y(g=t),e):g},e}tb.prototype=Qm.prototype,ub.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var yb=mb(hb);function vb(t){this._curve=t}function mb(e){function t(t){return new vb(e(t))}return t._curve=e,t}function bb(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(mb(t)):e()._curve},t}function xb(){}function wb(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function kb(t,e){this._context=t,this._k=(1-e)/6}function Eb(t,e){this._context=t,this._k=(1-e)/6}function Mb(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>Hm&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>Hm&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function Ob(t,e){this._context=t,this._alpha=e}vb.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},kb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:wb(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:wb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new kb(t,n)}return t.tension=function(t){return e(+t)},t}(0),Eb.prototype={areaStart:xb,areaEnd:xb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:wb(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new Eb(t,n)}return t.tension=function(t){return e(+t)},t}(0),Ob.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Mb(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Sb=function e(n){function t(t){return n?new Ob(t,n):new kb(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function _b(t,e){this._context=t,this._alpha=e}_b.prototype={areaStart:xb,areaEnd:xb,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Mb(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Ab=function e(n){function t(t){return n?new _b(t,n):new Eb(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function Tb(t){this._context=t}function Pb(t){return new Tb(t)}function Lb(t,e){this._context=t,this._t=e}function Cb(t){return new Lb(t,.5)}function Nb(t){return new Lb(t,0)}function jb(t){return new Lb(t,1)}function tt(t){return new Rb([t],null,t,t.ownerDocument)}Tb.prototype={areaStart:xb,areaEnd:xb,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},Lb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),0<=this._line&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:var n;this._t<=0?(this._context.lineTo(this._x,e),this._context.lineTo(t,e)):(n=this._x*(1-this._t)+t*this._t,this._context.lineTo(n,this._y),this._context.lineTo(n,e))}this._x=t,this._y=e}};class Rb{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}selectAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Rb(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Rb(this._elements,null,this._parent,this._document,void 0,void 0,t)}select(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Rb([t],null,t,this._document)}append(t){var e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){var r=this._data[t],[r,i]=Array.isArray(r)?r:[r,null],a=e(r,t);a.__data__=r,null!==i&&(a.__fromElements__=i),this._parent.appendChild(a),n.push(a)}return new Rb(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){var o=this._elements[t],s=e(o.__data__,t);o.appendChild(s),n.push(s)}return new Rb(n,null,n[0],this._document)}maybeAppend(t,e){var n=this._elements[0],r=n.getElementById(t);return r||((r="string"==typeof e?this.createElement(e):e()).id=t,n.appendChild(r)),new Rb([r],null,this._parent,this._document)}data(e,n=t=>t,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),h=zp(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const zp=h.get(d);s.push([f,zp]);for(const y of zp)o.delete(y);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new Rb([],i,this._parent,this._document),new Rb(a,null,this._parent,this._document),new Rb(o,null,this._parent,this._document),new Rb([],s,this._parent,this._document),new Rb(l,null,this._parent,this._document)];return new Rb(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new Rb(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=Rb.registry[t])?new e:lg("Unknown node type: "+t)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;t<this._elements.length;t++){const n=this._elements[t];var e=this._transitions[t];e?(Array.isArray(e)?e:[e]).map(t=>t.finished.then(()=>n.remove())):n.remove()}return new Rb([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;t<this._elements.length;t++){var n=this._elements[t],r=n.__data__;e.call(n,r,t)}return this}attr(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function Fb([t,e],[n,r]){return[t-n,e-r]}function Bb([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Ib([t,e]){return Math.atan2(e,t)}function Db([t,e]){return Ib([t,e])+Math.PI/2}function zb(t,e){t=Ib(t),e=Ib(e);return t<e?e-t:2*Math.PI-(t-e)}function Gb(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(var[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);var t=n-e,s=i-r;return[e,r,t,s]}function Wb([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Hb(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function Vb(t){return t.map((t,e)=>e)}function Yb(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function qb(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)qb(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function Ub(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(...qb(e,t));return n}function A(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function Xb(t,e,n){var n=n["arrowSize"],n="string"==typeof n?+parseFloat(n)/100*Bb(t,e):n,r=Math.PI/6,t=Math.atan2(e[1]-t[1],e[0]-t[0]),i=Math.PI/2-t-r,t=t-r;return[[e[0]-n*Math.sin(i),e[1]-n*Math.cos(i)],[e[0]-n*Math.cos(t),e[1]-n*Math.sin(t)]]}function $b(t,e,n,r,i){e=Ib(Fb(r,e))+Math.PI,n=Ib(Fb(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function Kb(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=Vb(a),[r,o]=Rp(t,t=>a[t]);const s=new Kv({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function Zb(t){var[t,e,n,r]=t;return[r,t,e,n]}function Jb(t,e,n){var[e,r,,i]=g0(t)?Zb(e):e,[n,a]=n,t=t.getCenter(),o=Db(Fb(e,t)),r=Db(Fb(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:Bb(i,t),outerRadius:Bb(e,t)}}function Qb(t,e,n,r){var i=t["defaultColor"],t=t[e]||{},e=t[n]||t[r];return Object.assign({defaultColor:i},e)}function t2(t){var{opacityAttribute:t="fill"}=t;return t+"Opacity"}function e2(t,e){return y0(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function n2(t,e,n,r={}){var{inset:i=0,radius:a=0,insetLeft:o=i,insetTop:s=i,insetRight:l=i,insetBottom:c=i,radiusBottomLeft:u=a,radiusBottomRight:h=a,radiusTopLeft:f=a,radiusTopRight:d=a}=r,r=J(r,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight"]);if(!y0(n)&&!m0(n)){var[p,,g]=!!g0(n)?Zb(t):t;const[x,m]=p;var[g,p]=Fb(g,p),y=(0<g?x:x+g)+o,v=(0<p?m:m+p)+s,g=Math.abs(g)-(o+l),o=Math.abs(p)-(s+c);return tt(new as({})).style("x",y).style("y",v).style("width",g).style("height",o).style("radius",[f,d,h,u]).call(A,r).node()}const{y:m,y1:b}=e;l=n.getCenter(),p=Jb(n,t,[m,b]),s=lb().cornerRadius(a).padAngle(i*Math.PI/180);return tt(new Qo({})).style("path",s(p)).style("transform",`translate(${l[0]}, ${l[1]})`).call(A,r).node()}Rb.registry={g:Yo,rect:as,circle:Bo,path:Qo,text:ss,ellipse:Ho,image:$o,line:Zo,polygon:es,polyline:rs,html:Uo};const r2=E=>{const{colorAttribute:M,first:O=!0,last:S=!0}=E,_=J(E,["colorAttribute","opacityAttribute","first","last"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),{defaultColor:i,radius:a=0}=r,o=J(r,["defaultColor","radius"]),r=o.lineWidth||1,{stroke:s,radius:a=a,radiusTopLeft:l=a,radiusTopRight:c=a,radiusBottomRight:u=a,radiusBottomLeft:h=a,innerRadius:f=0,innerRadiusTopLeft:d=f,innerRadiusTopRight:p=f,innerRadiusBottomRight:g=f,innerRadiusBottomLeft:f=f,lineWidth:r="stroke"===M||s?r:0,inset:y=0,insetLeft:v=y,insetRight:m=y,insetBottom:b=y,insetTop:x=y}=_,w=J(_,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop"]),{color:i=i,opacity:k}=e;return tt(n2(t,e,n,{radius:a,radiusTopLeft:O?l:d,radiusTopRight:O?c:p,radiusBottomRight:S?u:g,radiusBottomLeft:S?h:f,inset:y,insetLeft:v,insetRight:m,insetBottom:b,insetTop:x})).call(A,Object.assign(Object.assign({},o),w)).style(t2(E),k).style(M,i).style("lineWidth",r).style("stroke",void 0===s?i:s).node()}},i2=(r2.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>r2(Object.assign({colorAttribute:"fill"},t))),a2=(i2.props=Object.assign({},r2.props),t=>r2(Object.assign({colorAttribute:"stroke"},t)));a2.props=Object.assign({},r2.props);const o2=t=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(g0(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,l=J(t,["adjustPoints"]);return(t,e,n,r,i,...a)=>{var o=e["index"],o=i[o+1],t=s(t,o,n);return r2(Object.assign({colorAttribute:"fill"},l))(t,e,n,r,i,...a)}};function s2(t,e,n){var[t,r,i,a]=t;if(g0(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}o2.props=Object.assign({},r2.props);const l2=t=>o2(Object.assign({adjustPoints:s2},t));function c2(t){const e="function"==typeof t?t:t.render;return class extends Do{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}l2.props=Object.assign({},r2.props);const u2=c2(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;tt(t).maybeAppend("line",()=>new Qo({})).style("d",e).call(A,r),tt(t).maybeAppend("line1",()=>new Qo({})).style("d",n).call(A,i)});const h2=t=>{const{curve:h,gradient:f=!1,gradientColor:d="between",defined:p=t=>!Number.isNaN(t)&&null!=t,connectNulls:g=!1}=t,y=J(t,["curve","gradient","gradientColor","defined","connectNulls"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=J(r,["defaultColor","lineWidth"]),{color:r=i,size:i=a,seriesColor:a,seriesX:s,seriesY:l}=e,a=f&&a?Kb(a,s,l,f,d):r,s=e2(n,e),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),a&&{stroke:a}),i&&{lineWidth:i}),s&&{transform:s}),y);let c;if(y0(n)){const u=n.getCenter();c=n=>bb(pb().curve(yb)).angle((t,e)=>Db(Fb(n[e],u))).radius((t,e)=>Bb(n[e],u)).defined(([t,e])=>p(t)&&p(e)).curve(h)(n)}else c=pb().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>p(t)&&p(e)).curve(h);var[r,e]=function(t,e){var n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,p),o=Q(l,"connect"),a=!!e.length;return(!a||g&&!Object.keys(o).length?tt(new Qo({})).style("d",c(r)).call(A,l):a&&!g?tt(new Qo({})).style("d",c(t)).call(A,l):tt(new u2).style("style1",Object.assign(Object.assign({},l),o)).style("style2",l).style("d1",e.map(c).join(",")).style("d2",c(t))).node()}},f2=(h2.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=y0(n)?Pb:hb;return h2(Object.assign({curve:i},a))(t,e,n,r)}),d2=(f2.props=Object.assign({},h2.props),t=>{const{alpha:a=.5}=t,o=J(t,["alpha"]);return(t,e,n,r)=>{var i=y0(n)?Ab:Sb;return h2(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),p2=(d2.props=Object.assign({},h2.props),t=>h2(Object.assign({curve:jb},t))),g2=(p2.props=Object.assign({},h2.props),t=>h2(Object.assign({curve:Nb},t))),y2=(g2.props=Object.assign({},h2.props),t=>h2(Object.assign({curve:Cb},t)));function v2(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]}y2.props=Object.assign({},h2.props);var m2,b2=Object.freeze({__proto__:null,point:v2,square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]},triangleDown:function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]},hexagon:function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]},bowtie:function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]},line:function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},cross:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]},tick:function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]},plus:function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]},hyphen:function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}});const u=f=>{const{colorAttribute:d,symbol:t,mode:p="auto"}=f,g=J(f,["colorAttribute","symbol","mode"]),y=b2[t]||v2;return(t,e,n,r)=>{var i,{mark:a,shape:o,defaultShape:s}=e,r=Qb(r,a,o,s),{defaultColor:a,lineWidth:o}=r,s=J(r,["defaultColor","lineWidth"]),r=g.stroke?o||1:o,{color:o=a,transform:a,opacity:l}=e,[c,u]=1===(c=t).length?c[0]:([[c,h],[u,i]]=c,[(c+u)/2,(h+i)/2]),h=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||x0(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(p,t,e,n)||g.r||s.r;return tt(new Qo).call(A,s).style("d",y(c,u,h)).style("lineWidth",r).style("transform",a).style("stroke",o).style(t2(f),l).style(d,o).call(A,g).node()}},x2=(u.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>u(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t))),w2=(x2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"cross"},t))),k2=(w2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"fill",symbol:"diamond"},t))),E2=(k2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t))),M2=(E2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t))),O2=(M2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t))),S2=(O2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t))),_2=(S2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"point"},t))),A2=(_2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"square"},t))),T2=(A2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t))),P2=(T2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t))),L2=(P2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t))),C2=(L2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"line"},t))),N2=(C2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"plus"},t))),j2=(N2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"fill",symbol:"point"},t))),R2=(j2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"fill",symbol:"square"},t))),F2=(R2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"stroke",symbol:"tick"},t))),B2=(F2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"fill",symbol:"triangle"},t))),I2=(B2.props=Object.assign({},u.props),t=>u(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t))),D2=(I2.props=Object.assign({},u.props),t=>{const{arrowSize:u="40%"}=t,h=J(t,["arrowSize"]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=Qb(r,e,i,a),e=r["defaultColor"],i=J(r,["defaultColor"]),[a,r]=t,[t,l]=Xb(a,r,{arrowSize:u}),c=tb();return c.moveTo(...a),c.lineTo(...r),c.moveTo(...r),c.lineTo(...t),c.moveTo(...r),c.lineTo(...l),tt(new Qo).call(A,i).style("d",c.toString()).style("stroke",o||e).style("fill",o||e).style("transform",s).call(A,h).node()}});function z2(t,e,n,r){this.message=t,this.expected=e,this.found=n,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,z2)}function G2(){this.constructor=m2}D2.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},m2=z2,dc=Error,G2.prototype=dc.prototype,m2.prototype=new G2,z2.buildMessage=function(t,e){var a={literal:function(t){return'"'+r(t.text)+'"'},class:function(t){for(var e="",n=0;n<t.parts.length;n++)e+=t.parts[n]instanceof Array?i(t.parts[n][0])+"-"+i(t.parts[n][1]):i(t.parts[n]);return"["+(t.inverted?"^":"")+e+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function r(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+n(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+n(t)})}function i(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+n(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+n(t)})}return"Expected "+function(t){for(var e,n,r=new Array(t.length),i=0;i<t.length;i++)r[i]=(n=t[i],a[n.type](n));if(r.sort(),0<r.length){for(e=i=1;i<r.length;i++)r[i-1]!==r[i]&&(r[e]=r[i],e++);r.length=e}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}(t)+" but "+((t=e)?'"'+r(t)+'"':"end of input")+" found."};var W2;function H2(t,e,n,r){var i,a,o,s=V2(r=void 0===r?"...":r,n),l=fn(t)?t:_(i=t)?"":i.toString(),c=e,u=[];if(V2(t,n)<=e)return t;for(;;){if(a=l.substr(0,16),c<(o=V2(a,n))+s)break;if(u.push(a),c-=o,!(l=l.substr(16)))return u.join("")}for(;;){if(a=l.substr(0,1),c<(o=V2(a,n))+s)break;if(u.push(a),c-=o,!(l=l.substr(1)))return u.join("")}return"".concat(u.join("")).concat(r)}var V2=Mn(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(W2=W2||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(n,"px"),r].join(" "),W2.measureText(fn(t)?t:"").width},function(t,e){return b([t],x(yn(e=void 0===e?{}:e)),!1).join("")});function Y2(t,e){return"string"==typeof t?V2(t,e):t}function q2(t,e){return"capitalize"===e?t.toLowerCase().replace(/( |^)[a-z]/g,function(t){return t.toUpperCase()}):"lowercase"===e?t.toLowerCase():"uppercase"===e?t.toUpperCase():t}function U2(t,e){e=Math.pow(10,e);return~~(t*e)/e}function X2(t){if(pn(t))return[t,t,t,t];if(an(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}var $2=["default","active","selected","disabled","inactive"];function K2(t){var r=m({},t),i=new RegExp(/^(f|[\S]+F)(ilter|iltrate)$/),a={},o={iltrate:"ilter",ilter:"iltrate"};return Object.entries(t).forEach(function(t){var t=x(t,2),e=t[0],t=t[1];i.test(e)&&(a[e]=t)}),Object.keys(a).forEach(function(t){delete r[t]}),Object.keys(a).forEach(function(t){var e,n;(t.endsWith("iltrate")&&"function"!=typeof a[t]||t.endsWith("ilter")&&"function"==typeof a[t])&&(n=t.replace(i,function(t,e,n){return"".concat(e).concat(o[n])}),Object.assign(r,((e={})[n]=a[t],e)))}),r}var Z2={fontSize:"16px",fontFamily:"sans-serif",fontWeight:"normal",fontVariant:"normal",fontStyle:"normal",textAlign:"start",textBaseline:"alphabetic"};function J2(t){var e;return t?null==t?void 0:t.default:(e=En(t)||{},$2.forEach(function(t){t in e&&delete e[t]}),e)}function Q2(t,e,n){return void 0===n&&(n=!1),e?(e=_n(t,e),n?Pn({},J2(t),e):e):J2(t)||{}}function tx(t,r,i,e){void 0===i&&(i=!1);var a=(e=void 0===e?!0:e)?K2(t):t;return Object.keys(a).reduce(function(t,e){var n;return n=e,new RegExp("^".concat(r,"[A-Z].*")).test(n)!==i&&(i?t[e]=a[e]:t[(n=e.slice(r.length)).charAt(0).toLowerCase()+n.slice(1)]=a[e]),t},{})}function ex(t,r){var i=t,t=Object.keys(t).reduce(function(t,e,n){return n>=r.length||(n=r[n],t.push(tx(i,n)),i=tx(i,n,!0)),t},[]);return t.push(i),t}function nx(r,i){return Object.keys(r).reduce(function(t,e){var n;return t["".concat(i).concat((n=e).charAt(0).toUpperCase()+n.slice(1))]=r[e],t},{})}function rx(t,n){void 0===n&&(n=["x","y","class"]);var r=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},a={};return Object.entries(t).forEach(function(t){var t=x(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function ix(t){var e=t.canvas,n=t.touches,r=t.offsetX,t=t.offsetY;return e?[e.x,e.y]:n?[(e=n[0]).clientX,e.clientY]:r&&t?[r,t]:[0,0]}S.prototype.selectAll=function(t){return new S("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},S.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new S(this._elements,null,this._parent,this._document,void 0,void 0,t)},S.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new S([t],null,t,this._document)},S.prototype.append=function(t){var e=this,n="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var i=0;i<this._data.length;i++){var a=this._data[i],a=x(Array.isArray(a)?a:[a,null],2),o=a[0],a=a[1];(l=n(o,i)).__data__=o,null!==a&&(l.__fromElements__=a),this._parent.appendChild(l),r.push(l)}return new S(r,null,this._parent,this._document)}for(i=0;i<this._elements.length;i++){var s=this._elements[i],l=n(o=s.__data__,i);s.appendChild(l),r.push(l)}return new S(r,null,r[0],this._document)},S.prototype.maybeAppend=function(t,e){e=_e(this,ax,"m",ox).call(this,t.startsWith("#")?t:"#".concat(t),e);return e.attr("id",t),e},S.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=_e(this,ax,"m",ox).call(this,t.startsWith(".")?t:".".concat(t),e);return e.addClassName(t),e},S.prototype.maybeAppendByName=function(t,e){e=_e(this,ax,"m",ox).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},S.prototype.addClassName=function(r){var e,t;try{for(var n=Se(this._elements),i=n.next();!i.done;i=n.next())!function(t){var e=t.attr("class")||void 0,n=new Set((null==e?void 0:e.split(" "))||[]);r.split(" ").forEach(function(t){return n.add(t)}),t.attr("class",Array.from(n).join(" "))}(i.value)}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return this},S.prototype.data=function(t,n,e){void 0===n&&(n=function(t){return t}),void 0===e&&(e=function(){return null});for(var r,i,a=[],o=[],s=new Set(this._elements),l=[],c=new Set,u=new Map(this._elements.map(function(t,e){return[n(t.__data__,e),t]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=zp(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),y=e(p,d);if(u.has(g))(x=u.get(g)).__data__=p,x.__facet__=!1,o.push(x),s.delete(x),u.delete(g);else if(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var v=f.get(g);l.push([p,v]);try{r=void 0;for(var m=Se(v),b=m.next();!b.done;b=m.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}f.delete(g)}else u.has(y)?((x=u.get(y)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new S([],a,this._parent,this._document),new S(o,null,this._parent,this._document),new S(s,null,this._parent,this._document),new S([],l,this._parent,this._document),new S(c,null,this._parent,this._document)];return new S(this._elements,null,this._parent,this._document,w)},S.prototype.merge=function(t){var e=b(b([],x(this._elements),!1),x(t._elements),!1),t=b(b([],x(this._transitions),!1),x(t._transitions),!1);return new S(e,null,this._parent,this._document,void 0,t)},S.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=S.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},S.prototype.join=function(t,e,n,r,i){void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});t=(t=void 0===t?function(t){return t}:t)(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)},S.prototype.remove=function(){for(var n=this,t=0;t<this._elements.length;t++)!function(t){var e=n._elements[t],t=n._transitions[t];t?t.then(function(){return e.remove()}):e.remove()}(t);return new S([],null,this._parent,this._document,void 0,this._transitions)},S.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},S.prototype.attr=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})},S.prototype.style=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})},S.prototype.styles=function(e){return this.each(function(i,a){var o=this,t=Object.entries(e).reduce(function(t,e){var e=x(e,2),n=e[0],r=e[1],e="function"!=typeof r?function(){return r}:r;return void 0!==r&&(t[n]=e.call(o,i,a)),t},{});this.attr(t)})},S.prototype.update=function(n){var r="function"!=typeof n?function(){return n}:n;return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},S.prototype.transition=function(t){var n="function"!=typeof t?function(){return t}:t,r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},S.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},S.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,b([this._parent,this],x(e),!1)),this},S.prototype.node=function(){return this._elements[0]},S.prototype.nodes=function(){return this._elements},S.prototype.transitions=function(){return this._transitions},S.prototype.parent=function(){return this._parent},ax=new WeakSet,ox=function(t,e){var n=this._elements[0],t=n.querySelector(t);return t||(t="string"==typeof e?this.createElement(e):e(),n.appendChild(t)),new S([t],null,this._parent,this._document)},S.registry={g:Yo,rect:as,circle:Bo,path:Qo,text:ss,ellipse:Ho,image:$o,line:Zo,polygon:es,polyline:rs,html:Uo};var ax,ox,sx=S;function S(t,e,n,r,i,a,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===o&&(o=[]),ax.add(this),this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}function T(t){return new sx([t],null,t,t.ownerDocument)}function lx(t,e,n){return t.querySelector(e)?T(t).select(e):T(t).append(n)}function cx(t){var e,t=t&&t.getRenderBounds();return t?(e=t.getMax(),t=t.getMin(),{width:e[0]-t[0],height:e[1]-t[1]}):{width:0,height:0}}function ux(t){var t=t.getLocalBounds(),t=x([t.min,t.max],2),e=x(t[0],2),n=e[0],e=e[1],t=x(t[1],2),r=t[0],t=t[1];return{x:n,y:e,width:r-n,height:t-e,left:n,bottom:t,top:e,right:r}}function hx(t,e){var t=x(t,2),n=t[0],t=t[1],e=x(e,2),n=e[0]-n,e=e[1]-t;return Math.sqrt(n*n+e*e)}function fx(t){var e,n;return"string"==typeof t?(e=t,(n=document.createElement("div")).innerHTML=e,n.firstChild):t}function dx(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)gx(t,e[r]);return t}var px=5,gx=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=px),Object.entries(i).forEach(function(t){var t=x(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?cn(t)?(cn(r[e])||(n[e]={}),a<o?gx(r[e],t,a+1,o):n[e]=i[e]):an(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})};function yx(t,e,n,r,i,a){return(t===e||Math.min(t,e)<=i&&i<=Math.max(t,e))&&(n===r||Math.min(n,r)<=a&&a<=Math.max(n,r))}function vx(t,e,n){var r=t;(!t.length||e<t[0]||e===t[0]&&n<t[1])&&(r[0]=e,r[1]=n)}function mx(t,e){var t=x(t,2),n=t[0],t=t[1],e=x(e,2),r=e[0],e=e[1];return Math.pow(Math.pow(n-r,2)+Math.pow(t-e,2),.5)}function bx(a,o){return void 0===a&&(a=0),void 0===o&&(o=!1),function(t,e,n){var r,i=n.value;"function"==typeof i&&(n.value=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(t=this,o&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},a))})}}var xx,wx=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)};function kx(t){return fn(t)||pn(t)?new ss({style:{text:String(t)}}):t}function Ex(t){return t*Math.PI/180}function Mx(t){return Number((180*t/Math.PI).toPrecision(5))}function Ox(t,e){var t=(t instanceof Ro?t:t.node()).computedStyleMap().get("transform");return!t||"unset"===t.value||null==(t=null==t?void 0:t.find(function(t){return t.t===e}))?void 0:t.d.map(function(t){return t.value})}function Sx(t,e){if(e)try{var o=t instanceof Ro?t:t.node(),n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(t,e,n){return"translate(".concat((e=e,n=n,i=(r=((r=o)instanceof Ro?r:r.node()).getBBox()).width,a=r.height,[(r=x([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null==(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))?void 0:n[0])||"0")/100*(0===e?i:a):t}),2))[0],r[1]]),")");var r,i,a});o.attr("transform",n)}catch(t){}}function _x(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}function Ax(t,e){return en(t)?t.apply(void 0,b([],x(e),!1)):t}function Tx(t,e,n,r,i){void 0===r&&(r=!0),void 0===i&&(i=function(t){t instanceof sx?t.node().removeChildren():t instanceof Ro?t.removeChildren():t instanceof HTMLElement&&(t.innerHTML="")}),t?n(e):r&&i(e)}function Px(){return null!==xx&&xx.apply(this,arguments)||this}function Lx(e,n){return Me(t,r=Do),t.prototype.connectedCallback=function(){var t,e;null!=(t=(e=this.descriptor).render)&&t.call(e,this.attributes,this),null!=(e=(t=this.descriptor).bindEvents)&&e.call(t,this.attributes,this)},t.prototype.update=function(t){var e;this.attr(Pn({},this.attributes,t=void 0===t?{}:t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)},t.prototype.attributeChangedCallback=function(){var t,e;null!=(e=null==(t=this.descriptor)?void 0:t.render)&&e.call(t,this.attributes,this)},t;function t(t){t=r.call(this,dx({},{style:n},t))||this;return t.descriptor=e,t}var r}Me(Px,xx=Do);function Cx(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=x(t,2),e=t[0],t=t[1],n=r(t);return[e,{name:n,class:".".concat(n),id:"#".concat(n),toString:function(){return n}}]})),Object.assign(t,{prefix:r}),t}function Nx(t){return t.charAt(0).toUpperCase()+t.slice(1)}function jx(t,e,n){void 0===n&&(n="...");t=t instanceof ss?t:t.node();"text"===t.nodeName&&t.attr({wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}Object.defineProperty(Fx.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(Fx.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(Fx.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(Fx.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),Fx.fromRect=function(t){return new Fx(t.x,t.y,t.width,t.height)},Fx.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}};var Rx=Fx;function Fx(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}function Bx(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,l=o.y,o=x([s+o.width,l+o.height],2),c=o[0],o=o[1];s<e&&(e=s),l<n&&(n=l),r<c&&(r=c),i<o&&(i=o)}return new Rx(e,n,r-e,i-n)}function Ix(n,t,e){function r(t){var e=x(u?["height",a]:["width",i],2),n=e[0],r=e[1];switch(c){case"flex-start":return 0;case"flex-end":return r-t[n];case"center":return r/2-t[n]/2;default:return 0}}var i=n.width,a=n.height,o=void 0===(o=e.flexDirection)?"row":o,s=(e.flexWrap,e.justifyContent),l=void 0===s?"flex-start":s;e.alignContent;var c=void 0===(s=e.alignItems)?"flex-start":s,u="row"===o,e="row"===o||"column"===o,h=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],f=(s=x([0,0],2))[0],d=s[1],e=Bx(o=t.map(function(t){var e=t.width,t=t.height,n=x([f,d],2),r=n[0],n=n[1],i=x([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new Rx(r,n,e,t)})),p={"flex-start":0,"flex-end":u?i-e.width:a-e.height,center:u?(i-e.width)/2:(a-e.height)/2};return Bx(s=o.map(function(t){var e=t.x,n=t.y,t=Rx.fromRect(t);return t.x=u?e+p[l]:e,t.y=u?n:n+p[l],t})),s.map(function(t){var e=t.x,n=t.y,t=Rx.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=Rx.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function Dx(t,e,n){return[]}function zx(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,r=r.height,e=e/Math.max(i,r);n&&t.scale(e)}function Gx(r,t,e,n,i){function a(){return"update"in r?r.update(t):r.attr(t),Promise.resolve()}void 0===e&&(e={}),void 0===n&&(n=!0),void 0===i&&(i=50);var o={},s={},l=["x","y","width","height","opacity","radius"];Object.entries(t).forEach(function(t){var t=x(t,2),e=t[0],t=t[1],n=r.attr(e);l.includes(e)&&!_(t)&&!_(n)&&n!==t&&Math.abs(+n-+t)>=i&&(o[e]=n,s[e]=t)});return n?0<Object.keys(o).length?(null==(n=r.animate([o,s],m({fill:"both"},e)))?void 0:n.finished.then(a))||Promise.resolve():void Promise.resolve():a()}Me(Hx,Wx=Do),Hx.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},Hx.prototype.update=function(t){this.attr(dx({},this.attributes,t=void 0===t?{}:t)),null!=(t=this.render)&&t.call(this,this.attributes,this)},Hx.prototype.clear=function(){this.removeChildren()},Hx.prototype.destroy=function(){this.removeAllEventListeners(),this.removeChildren(),this.remove()},Hx.prototype.attributeChangedCallback=function(){},Hx.prototype.bindEvents=function(t,e){};var Wx,$l=Hx;function Hx(t){return Wx.call(this,t)||this}function Vx(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]}function Yx(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function qx(t,e,n){return[["M",t-n,e],["L",t+n,e]]}tc=Vx,pl=qx;function Ux(t){n="default",on(e=t)&&e instanceof Image?n="image":en(e)?n="symbol":fn(e)&&(r=new RegExp("data:(image|text)"),n=e.match(r)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?"url":"symbol");var e,n,r=n;return["base64","url","image"].includes(r)?"image":t&&"symbol"===r?"path":null}Me(Kx,Xx=$l),Kx.prototype.render=function(t,e){var r=t.x,i=t.y,a=t.symbol,n=t.size,o=void 0===n?16:n,s=(t.class,J(t,["x","y","symbol","size","class"])),l=Ux(a);Tx(!!l,T(e),function(t){t.maybeAppendByClassName("marker",l).addClassName("".concat(l,"-marker")).call(function(t){var e,n;"image"===l?t.styles({img:a,width:e=2*o,height:e,x:-o,y:-o}):(e=o/2,n=en(a)?a:Kx.getSymbol(a),t.styles(m({path:null==n?void 0:n(r,i,e)},s)))})})},Kx.MARKER_SYMBOL_MAP=new Map,Kx.registerSymbol=function(t,e){Kx.MARKER_SYMBOL_MAP.set(t,e)},Kx.getSymbol=function(t){return Kx.MARKER_SYMBOL_MAP.get(t)};var Xx,$x=Kx;function Kx(){return null!==Xx&&Xx.apply(this,arguments)||this}$x.registerSymbol("cross",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]}),$x.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),$x.registerSymbol("line",Yx),$x.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),$x.registerSymbol("tick",function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]}),$x.registerSymbol("circle",Vx),$x.registerSymbol("point",tc),$x.registerSymbol("bowtie",function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),$x.registerSymbol("hexagon",function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),$x.registerSymbol("square",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]}),$x.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),$x.registerSymbol("triangle",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),$x.registerSymbol("triangle-down",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),$x.registerSymbol("line",Yx),$x.registerSymbol("dot",qx),$x.registerSymbol("dash",pl),$x.registerSymbol("smooth",function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}),$x.registerSymbol("hv",function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]}),$x.registerSymbol("vh",function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]}),$x.registerSymbol("hvh",function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]}),$x.registerSymbol("vhv",function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]});Me(Qx,Zx=$l),Qx.prototype.render=function(t,e){var n,r,i=t.padding,a=t.marker,o=t.text,s=t.textStyle,l=t.radius,c=t.backgroundStyle,u=t.spacing,h=t.align,t=t.verticalAlign,i=x(X2(void 0===i?0:i),4),f=i[0],d=i[1],p=i[2],i=i[3],g=lx(e,".tag-content","g").attr("className","tag-content").node(),y=lx(g,".tag-marker",function(){return new $x({})}).attr("className","tag-marker").call(function(t){t.node().clear(),t.node().update(a||{symbol:"triangle",size:0,x:0})}).node(),u=(u=u,{x:(v=(y=y).getLocalBounds()).halfExtents[0]?v.max[0]+(u||0):y.style.x,y:v.halfExtents[1]?(v.min[1]+v.max[1])/2:y.style.y}),v=u.x,y=u.y,y=(T(g).maybeAppendByClassName("tag-text","text").styles(m(m({fontFamily:"sans-serif",fontSize:12,text:_(o)?"":"".concat(o),x:v,y:y},s),{textBaseline:"middle"})).call(function(t){o||t.remove()}),u=i,v=f,y=h||"start",s=t||"top",t=(h=g).getLocalBounds(),r=n=0,"start"===y&&(n=u),"center"===y&&(n=-t.halfExtents[0]),"end"===y&&(n=-u-2*t.halfExtents[0]),"top"===s&&(r=v+t.halfExtents[1]),"middle"===s&&(r=0),"bottom"===s&&(r=v-2*t.halfExtents[1]),h.setLocalPosition([n,r]),g.getLocalBounds());T(e).maybeAppendByClassName("tag-background","rect").styles(m({zIndex:(g.style.zIndex||0)-1,y:y.min[1]-f,x:y.min[0]-i,width:null!==c?i+d+2*y.halfExtents[0]:0,height:null!==c?f+p+2*y.halfExtents[1]:0,radius:null!=l?l:2,fill:"#fafafa",stroke:"#d9d9d9",lineWidth:1},c))},Qx.tag="tag",Qx.defaultOptions={style:{padding:4,spacing:4}};var Zx,Jx=Qx;function Qx(t){return Zx.call(this,Pn({},Qx.defaultOptions,t))||this}var tw,ew,nw={small:{textStyle:{fontSize:10},buttonStyle:{width:40,height:20},markerStyle:{size:8}},middle:{textStyle:{fontSize:12},buttonStyle:{width:60,height:30},markerStyle:{size:12}},large:{textStyle:{fontSize:16},buttonStyle:{width:80,height:40},markerStyle:{size:16}}},rw={primary:{textStyle:{default:{fill:"#fff"},active:{}},buttonStyle:{default:{fill:"#1890ff",lineWidth:0},active:{fill:"#40a9ff"}},markerStyle:{default:{fill:"#1890ff"},active:{fill:"#40a9ff"}}},dashed:{textStyle:{default:{},active:{}},buttonStyle:{default:{fill:"transparent",stroke:"#bbb",lineDash:[5,5]},active:{}},markerStyle:{}},link:{textStyle:{default:{fill:"#1890ff"},active:{}},buttonStyle:{default:{fill:"transparent",lineWidth:0},active:{}},markerStyle:{default:{fill:"#1890ff"}}},text:{textStyle:{default:{fill:"#000"},active:{}},buttonStyle:{default:{fill:"transparent",lineWidth:0},active:{}},markerStyle:{default:{stroke:"#000"}}},default:{textStyle:{default:{fill:"#000"},active:{fill:"#1890ff"}},buttonStyle:{default:{fill:"transparent",stroke:"#bbb"},active:{stroke:"#1890ff"}},markerStyle:{default:{stroke:"#bbb",lineWidth:1},active:{stroke:"#1890ff"}}}},iw={strict:{textStyle:{fill:"#b8b8b8"},buttonStyle:{},markerStyle:{}},textStyle:{},buttonStyle:{stroke:"#d9d9d9",fill:"#f5f5f5"},markerStyle:{stroke:"#d9d9d9"}};function aw(t){var n=tw.call(this,dx({},aw.defaultOptions,t))||this;return n.state="default",n.clickEvents=function(){var t=n.attributes,e=t.onClick;"disabled"!==t.state&&null!=e&&e.call(n,n)},n.mouseenterEvent=function(){"disabled"!==n.attributes.state&&(n.state="active",n.render(n.attributes,n))},n.mouseleaveEvent=function(){var t=n.attributes.state;n.state=void 0===t?"default":t,n.render(n.attributes,n)},n}function ow(t){return ew.call(this,Pn({},ow.defaultOptions,t))||this}Me(aw,tw=$l),Object.defineProperty(aw.prototype,"markerSize",{get:function(){var t=this.attributes.marker,e=this.getStyle("markerStyle");return t?(null==e?void 0:e.size)||2:0},enumerable:!1,configurable:!0}),Object.defineProperty(aw.prototype,"text",{get:function(){var t,e=this.attributes.text;return""===e?e:(t=this.textAvailableWidth,H2(e,t))},enumerable:!1,configurable:!0}),Object.defineProperty(aw.prototype,"textAvailableWidth",{get:function(){var t=this.attributes,e=t.marker,n=t.padding,r=t.ellipsis,i=t.width,t=t.markerSpacing;return r?(r=mn(i)?this.getStyle("buttonStyle").width:i,e?r-2*n-t-this.markerSize:r-2*n):1/0},enumerable:!1,configurable:!0}),Object.defineProperty(aw.prototype,"buttonHeight",{get:function(){var t=this.attributes.height;return t||this.getStyle("buttonStyle").height},enumerable:!1,configurable:!0}),aw.prototype.getStyle=function(e){var t=this.attributes,n=t.size,t=t.type,r=this.state,i=Pn({},_n(nw,[n,e]),Q2(_n(rw,[t,e]),r),Q2(_n(this.attributes,e),r,!0));return"disabled"===r&&(Object.keys(i).forEach(function(t){t in iw[e]&&(i[t]=_n(iw,[e,t]))}),Object.keys(iw.strict[e]).forEach(function(t){i[t]=_n(iw,["strict",e,t])}),Pn(i,Q2(_n(this.attributes,e),"disabled"))),i},aw.prototype.render=function(t,e){var n=t.padding,n=void 0===n?0:n,r=t.marker,t=t.markerSpacing,t=void 0===t?0:t,n=(e.attr("cursor","disabled"===this.state?"not-allowed":"pointer"),x(X2(n),4)),i=(n[0],n[1]),a=(n[2],n[3]),o=this.buttonHeight,s=this.getStyle("markerStyle"),l=this.markerSize,n=lx(e,".marker",function(){return new $x({className:"marker",style:{symbol:"circle"}})}).call(function(t){t.node().update(m(m({},s),{symbol:r,x:a+l/2,y:o/2,size:l}))}).node().getLocalBounds(),c=this.text,c=void 0===c?"":c,u=this.getStyle("textStyle"),n=(this.textShape=lx(e,".text","text").attr("className","text").styles(m({x:l?n.max[0]+t:a,y:o/2,text:c,textAlign:"left",textBaseline:"middle"},u)).node(),this.textShape.getLocalBounds()),c=this.getStyle("buttonStyle");T(e).maybeAppendByClassName(".background","rect").styles(m(m({zIndex:-1},c),{height:o,width:a+(l?l+t:0)+2*n.halfExtents[0]+i}))},aw.prototype.update=function(t){this.attr(Pn({},this.attributes,t=void 0===t?{}:t));t=this.attributes.state;this.state=void 0===t?"default":t,this.render(this.attributes,this)},aw.prototype.setState=function(t){this.update({state:t})},aw.prototype.hide=function(){this.style.visibility="hidden"},aw.prototype.show=function(){this.style.visibility="visible"},aw.prototype.bindEvents=function(){this.addEventListener("click",this.clickEvents),this.addEventListener("mouseenter",this.mouseenterEvent),this.addEventListener("mouseleave",this.mouseleaveEvent)},aw.tag="button",aw.defaultOptions={style:{cursor:"pointer",padding:10,size:"middle",type:"default",text:"",markerAlign:"left",markerSpacing:5,textStyle:{default:{},active:{}},buttonStyle:{default:{lineWidth:1,radius:5},active:{}},markerStyle:{default:{}}}},Me(ow,ew=$l),ow.prototype.render=function(t,e){for(var n=t.x,r=t.y,s=t.items,l=t.textStyle,i=t.padding,c=t.width,u=t.separator,t=x(X2(void 0===i?0:i),3),i=t[0],h=t[1],t=t[2],f=lx(e,".container","g").styles({className:"container",x:n+t,y:r+i}),d=0,p=0,g=(f.node().removeChildren(),this),a=0;a<s.length;a++)!function(t){var e,n=s[t],r=new Jx({className:"breadcrumb-item",style:m(m({x:d,y:p,text:_(n.text)?n.id:n.text,textStyle:l},An(n,["marker"])),{padding:0,backgroundStyle:null})}),i=(f.append(function(){return r}),r.getLocalBounds()),a=2*i.halfExtents[0],i=2*i.halfExtents[1],a=(d+=a,_(c)||c-h<d&&(r.attr({x:0,y:p+i}),d=a,p+=i),g.bindInnerEvents(r,n),u||{}),n=a.spacing,n=void 0===n?0:n,o=a.text,o=void 0===o?"/":o,a=a.style;t!==s.length-1&&(e=new ss({className:"".concat(ow.tag,"-separator"),id:"".concat(ow.tag,"-separator-").concat(t),style:m(m(m(m({},Z2),{x:d+n,y:p+i/2}),a),{text:o,textAlign:"end",textBaseline:"middle"})}),f.append(function(){return e}),t=e.getLocalBounds(),d+=2*t.halfExtents[0]+n)}(a)},ow.prototype.update=function(t){this.attr(Pn({},this.attributes,t)),this.render(this.attributes,this)},ow.prototype.bindInnerEvents=function(t,e){var n=this.attributes,r=n.items,i=n.onClick;i&&t.addEventListener("click",function(){i.call(t,e.id,e,r)})},ow.tag="breadcrumb",ow.defaultOptions={style:{separator:{text:"/",style:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},spacing:8},textStyle:{default:m(m({},Z2),{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"}),active:{fill:"#5468ff",cursor:"pointer"}},padding:[8,8,8,8]}};Me(cw,sw=Ro),cw.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.createLines(e),t&&this.createAreas(t)},cw.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},cw.prototype.update=function(t){var e=t.lines,t=t.areas;this.clear(),e&&this.setAttribute("lines",e),t&&this.setAttribute("areas",t),this.render()},cw.prototype.createLines=function(t){T(this.linesGroup).selectAll("line").data(t).join(function(t){return t.append("path").each(function(t){T(this).styles(t)})},function(t){return t.each(function(t){T(this).styles(t)})},function(t){return t.remove()})},cw.prototype.createAreas=function(t){T(this.linesGroup).selectAll("area").data(t).join(function(t){return t.append("path").each(function(t){T(this).styles(t)})},function(t){return t.each(function(t){T(this).styles(t)})},function(t){return t.remove()})};var sw,lw=cw;function cw(t){var e=this,n=t.style,t=J(t,["style"]);return(e=sw.call(this,Pn({},{type:"lines",style:{width:0,height:0}},m({style:n},t)))||this).linesGroup=e.appendChild(new Yo({name:"lines"})),e.areasGroup=e.appendChild(new Yo({name:"areas"})),e.render(),e}Me(fw,uw=Ro),fw.prototype.render=function(){var t=this.attributes.columns;T(this.columnsGroup).selectAll("column-group").data(t.flat()).join(function(t){return t.append("rect").each(function(t){T(this).styles(t)})},function(t){return t.each(function(t){T(this).styles(t)})},function(t){return t.remove()})},fw.prototype.update=function(t){this.attr(Pn({},this.attributes,t)),t.columns&&(this.clear(),this.render())},fw.prototype.clear=function(){this.removeChildren()};var uw,hw=fw;function fw(t){var e=this,n=t.style,t=J(t,["style"]);return(e=uw.call(this,Pn({},{type:"column",style:{width:0,height:0}},m({style:n},t)))||this).columnsGroup=new Yo({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}function dw(t){return 0===t.length?[0,0]:[hn(function(t,e){if(an(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=en(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return hn(t)||0})),un(function(t,e){if(an(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=en(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return un(t)||0}))]}function pw(t){for(var e=En(t),n=e[0].length,t=x([Array(n).fill(0),Array(n).fill(0)],2),r=t[0],i=t[1],a=0;a<e.length;a+=1)for(var o=e[a],s=0;s<n;s+=1)0<=o[s]?(o[s]+=r[s],r[s]=o[s]):(o[s]+=i[s],i[s]=o[s]);return e}function gw(t,e,n){void 0===n&&(n=[[0,0],[1,1]]);for(var e=!!(e=void 0===e?!1:e),r=[],i=0,a=t.length;i<a;i+=2)r.push([t[i],t[i+1]]);for(var o,s,l,c=function(t,e,n,r){var i,a=[],o=!!r;if(o){c=r[0],u=r[1];for(var s=0,l=t.length;s<l;s+=1)var c=pe([0,0],c,x=t[s]),u=ge([0,0],u,x)}for(var s=0,h=t.length;s<h;s+=1){var f,d,p,g,y,v,m,b,x=t[s];0!==s||n?s!==h-1||n?(f=t[[s?s-1:h-1,s-1][n?0:1]],d=t[n?(s+1)%h:s+1],v=ye(v=we([0,0],d,f),v,e),0!==(y=(p=ve(x,f))+(g=ve(x,d)))&&(p/=y,g/=y),y=ye([0,0],v,-p),v=ye([0,0],v,g),m=de([0,0],x,y),b=pe([0,0],b=de([0,0],x,v),ge([0,0],d,x)),b=ge([0,0],b,pe([0,0],d,x)),m=pe([0,0],m=de([0,0],x,y=ye([0,0],y=we([0,0],b,x),-p/g)),ge([0,0],f,x)),m=ge([0,0],m,pe([0,0],f,x)),b=de([0,0],x,v=ye([0,0],v=we([0,0],x,m),g/p)),o&&(m=pe([0,0],m=ge([0,0],m,c),u),b=pe([0,0],b=ge([0,0],b,c),u)),a.push(i),a.push(m),i=b):(m=x,a.push(i),a.push(m)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[i+1])[0],l[1]]);return e&&(o=c[u],s=c[u+1],h.push(["C",o[0],o[1],s[0],s[1],(l=r[0])[0],l[1]])),h}function yw(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return b([e===n?"M":"L"],x(t),!1)});return e?t.reverse():t}function vw(t,e){if(void 0===e&&(e=!1),t.length<=2)return yw(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];Ln(a,n.slice(-2))||n.push.apply(n,b([],x(a),!1))}var o=gw(n,!1);return e?o.unshift(b(["M"],x(t[r-1]),!1)):o.unshift(b(["M"],x(t[0]),!1)),o}function mw(t,e,n){t=En(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}Me(ww,bw=$l),Object.defineProperty(ww.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=En(t),pn(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(ww.prototype,"data",{get:function(){return this.attributes.isStack?pw(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(ww.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(ww.prototype,"baseline",{get:function(){var t=this.scales.y,e=x(t.getOptions().domain||[0,0],2),n=e[0],e=e[1];return e<0?t.map(e):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(ww.prototype,"containerCfg",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(ww.prototype,"linesCfg",{get:function(){var n=this;if("line"!==this.attributes.type)throw new Error("linesCfg can only be used in line type");var t,r,i,a,o,e,s,l,c,u=this.attributes,h=u.isStack,f=u.smooth,d=tx(this.attributes,"area"),p=tx(this.attributes,"line"),u=this.containerCfg.width,g=this.data;return 0===g[0].length?{lines:[],areas:[]}:(t=this.scales,e=t.x,t=t.y,g=g,r=(e={type:"line",x:e,y:t}).x,i=e.y,a=(e=x(i.getOptions().range||[0,0],2))[0],o=e[1],a<o&&(e=x([a,o],2),o=e[0],a=e[1]),t=g.map(function(t){return t.map(function(t,e){return[r.map(e),dn(i.map(t),o,a)]})}),e=[],d&&(g=this.baseline,e=h?(f?function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=t[i],s=vw(o),l=void 0,l=0===i?mw(s,e,n):(a=vw(t[i-1],!0),o=o[0],a[0][0]="L",b(b(b([],x(s),!1),x(a),!1),[b(["M"],x(o),!1),["Z"]],!1));r.push(l)}return r}:function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=yw(t[i]),s=void 0,s=0===i?mw(o,e,n):((a=yw(t[i-1],!0))[0][0]="L",b(b(b([],x(o),!1),x(a),!1),[["Z"]],!1));r.push(s)}return r})(t,u,g):(s=f,l=u,c=g,t.map(function(t){return mw((s?vw:yw)(t),l,c)}))),{lines:t.map(function(t,e){return m({stroke:n.getColor(e),path:(f?vw:yw)(t)},p)}),areas:e.map(function(t,e){return m({path:t,fill:n.getColor(e)},d)})})},enumerable:!1,configurable:!0}),Object.defineProperty(ww.prototype,"columnsCfg",{get:function(){var i=this;if("column"!==this.attributes.type)throw new Error("columnsCfg can only be used in column type");var a=tx(this.attributes,"column"),o=this.attributes.isStack,t=this.containerCfg.height,s=this.rawData;if(!s)return{columns:[]};o&&(s=pw(s));var e=this.createScales(s),l=e.x,c=e.y,e=x(dw(s),2),n=e[0],e=e[1],u=new Kv({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return m(m({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[r][e])}:{x:l.map(e)+n*r,y:0<=t?c.map(t):c.map(0),width:n,height:u.map(Math.abs(t))})})})}},enumerable:!1,configurable:!0}),ww.prototype.render=function(t,e){this.containerShape=lx(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesCfg:this.columnsCfg;this.sparkShape=lx(e,".".concat(r),function(){return new("line"===n?lw:hw)({className:r,style:i})}).styles(i).node()},ww.prototype.update=function(t){this.attr(Pn({},this.attributes,t)),this.render(this.attributes,this)},ww.prototype.clear=function(){this.removeChild(this.sparkShape),this.sparkShape.clear(),this.sparkShape.destroy()},ww.prototype.getColor=function(t){var e=this.attributes.color;return an(e)?e[t%e.length]:en(e)?e.call(null,t):e},ww.prototype.createScales=function(t){var e,n=this.attributes,r=n.type,n=n.range,n=void 0===n?[]:n,i=this.containerCfg,a=i.width,i=i.height,o=x(dw(t),2),s=o[0],o=o[1],s=new Kv({domain:[null!=(e=n[0])?e:s,null!=(e=n[1])?e:o],range:[i,0]});return"line"===r?{type:r,x:new Kv({domain:[0,t[0].length-1],range:[0,a]}),y:s}:(e=(n=this.attributes).isGroup,o=n.spacing,{type:r,x:new Dv({domain:t[0].map(function(t,e){return e}),range:[0,a],paddingInner:e?o:0}),y:s})},ww.tag="sparkline",ww.defaultOptions={style:{type:"line",width:200,height:20,isStack:!1,nice:!0,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",columnPadding:.1}};var bw,xw=ww;function ww(t){return bw.call(this,Pn({},ww.defaultOptions,t))||this}var kw,Ew={fill:"#fff",stroke:"#bfbfbf",lineWidth:1,size:10,radius:2,strokeOpacity:1},Mw={fontSize:12,fill:"#000",fillOpacity:.45,textAlign:"center",textBaseline:"middle"},Ow={orient:"horizontal",type:"start",showLabel:!0},Sw=Cx({labelGroup:"label-group",label:"label",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),_w=Lx({render:function(t,e){var n=t.size,n=void 0===n?10:n,r=t.radius,r=void 0===r?n/4:r,i=t.orient,t=(t.class,J(t,["size","radius","orient","class"])),a=2.4*n,r=T(e).maybeAppendByClassName(Sw.iconRect,"rect").styles(m(m({},t),{width:n,height:a,radius:r,x:-n/2,y:-a/2})),o=1/3*n,s=2/3*n,l=.25*a,c=.75*a;r.maybeAppendByClassName("".concat(Sw.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(Sw.iconLine,"-2"),"line").styles(m({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)}}),Aw=(Me(Tw,kw=$l),Tw.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=x(rx(tx(this.attributes,"label"),[]),2),i=r[0],r=r[1];Tx(!!n,T(t).maybeAppendByClassName(Sw.labelGroup,"g").styles(r),function(t){e.label=t.maybeAppendByClassName(Sw.label,"text").styles(m(m({},Mw),i)),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},Tw.prototype.renderIcon=function(t){var e=this.attributes,n=e.iconShape,n=void 0===n?function(){return new _w({style:r})}:n,e=e.orient,r=m(m({orient:e},Ew),tx(this.attributes,"icon"));this.icon=T(t).maybeAppendByClassName(Sw.icon,n).update(r)},Tw.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},Tw);function Tw(t){return kw.call(this,dx({},{style:Ow},t))||this}Me(Cw,Pw=$l),Object.defineProperty(Cw.prototype,"values",{get:function(){return this.getAttribute("values")},set:function(t){this.setAttribute("values",this.clampValues(t))},enumerable:!1,configurable:!0}),Object.defineProperty(Cw.prototype,"sparklineShapeCfg",{get:function(){var t,e,n,r,i,a,o,s;return"horizontal"!==this.attributes.orient?null:(i=(t=tx(this.attributes,"sparkline")).padding,t=J(t,["padding"]),e=(i=x(X2(i),4))[0],n=i[1],r=i[2],i=i[3],a=(o=this.availableSpace).width,o=o.height,s=this.attributes.trackLineWidth,m(m({x:(s=+(void 0===s?0:s))/2+i,y:s/2+e},t),{zIndex:0,width:a-s-i-n,height:o-s-e-r}))},enumerable:!1,configurable:!0}),Object.defineProperty(Cw.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=x(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(Cw.prototype,"availableSpace",{get:function(){var t=x(X2(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],t=t[3],i=this.shape;return{x:t,y:e,width:i.width-(t+n),height:i.height-(e+r)}},enumerable:!1,configurable:!0}),Cw.prototype.getValues=function(){return this.values},Cw.prototype.setValues=function(t,e){void 0===e&&(e=!1),this.attr("values",t=void 0===t?[0,0]:t),Gx(this.selectionShape.node(),this.selectionCfg,this.animation,e),Gx(this.startHandle.node(),this.getHandleShapeCfg("start"),this.animation,e),Gx(this.endHandle.node(),this.getHandleShapeCfg("end"),this.animation,e)},Cw.prototype.innerSetValues=function(t,e){void 0===e&&(e=!1);var n=this.values,t=this.clampValues(t=void 0===t?[0,0]:t);this.update({values:t}),e&&this.onValueChange(n)},Cw.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=tx(this.attributes,"track");this.trackShape=T(t).maybeAppendByClassName("slider-track","rect").styles(m(m(m({},this.shape),n),{cursor:e?"crosshair":"default"}))},Cw.prototype.renderSparkline=function(t){var n=this;Tx("horizontal"===this.attributes.orient,T(t).maybeAppendByClassName("slider-sparkline-group","g"),function(t){var e=n.sparklineShapeCfg;t.maybeAppendByClassName("slider-sparkline",function(){return new xw({style:e})}).call(function(t){t.node().update(e)})})},Object.defineProperty(Cw.prototype,"selectionCfg",{get:function(){var t=tx(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),Cw.prototype.renderSelection=function(t){function e(t){var e="".concat(t,"-handle"),n=r.getHandleShapeCfg(t);return r.foregroundGroup.maybeAppendByClassName(e,function(){return new Aw({style:n})}).style("type",t).update(n)}var r=this;this.foregroundGroup=T(t).maybeAppendByClassName("slider-foreground","g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName("slider-selection","rect").styles(this.selectionCfg);this.startHandle=e("start"),this.endHandle=e("end")},Cw.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},Cw.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=x(this.range,2),r=n[0],n=n[1],i=x(this.getValues().map(function(t){return U2(t,e)}),2),a=i[0],i=i[1],t=x((t||[a,i]).map(function(t){return U2(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=x([t,o],2))[0],t=s[1]),t-o);return n-r<s?[r,n]:o<r?a===r&&i===t?[r,t]:[r,s+r]:n<t?i===n&&a===o?[o,n]:[n-s,n]:[o,t]},Cw.prototype.calcMask=function(t){var t=x(this.clampValues(t),2),e=t[0],t=t[1],n=this.availableSpace,r=n.x,i=n.y,a=n.width,n=n.height;return this.getOrientVal([{y:i,height:n,x:e*a+r,width:(t-e)*a},{x:r,width:a,y:e*n+i,height:(t-e)*n}])},Cw.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.width,e=e.height,r=x(this.clampValues(),2),i=r[0],r=r[1],t=("start"===t?i:r)*this.getOrientVal([n,e]);return{x:this.getOrientVal([t,n/2]),y:this.getOrientVal([e/2,t])}},Cw.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.orient,n=n.formatter,i=tx(this.attributes,"handle"),a=tx(i,"label"),i=i.spacing,o=this.getHandleSize(),s=this.clampValues(),l=this.availableSpace,c=l.width,l=l.height,u=this.calcMask(),h=u.x,f=u.y,d=u.width,u=u.height,n=n("start"===t?s[0]:s[1]),s=this.appendChild(new ss({style:m(m(m({visibility:"hidden"},Z2),a),{text:n})})),a=s.getBBox(),p=a.width,a=a.height,s=(s.destroy(),0),g=0;return"horizontal"===r?(e=(r=i+o)+p/2,s="start"===t?0<h-r-p?-e:e:p<c-h-d-r?e:-e):(e=i+o,g="start"===t?a<f-o?-e:e:a<l-f-u-o?e:-e),{x:s,y:g,text:n}},Cw.prototype.getHandleLabelShapeCfg=function(t){var e;return this.attributes.showLabel?(e=tx(this.attributes,"handleLabel"),m(m({},e),this.calcHandleText(t))):{}},Cw.prototype.getHandleIconShapeCfg=function(){var t=this.attributes,e=t.orient,t=t.handleIconShape,n=tx(this.attributes,"handleIcon"),r=this.getOrientVal(["ew-resize","ns-resize"]),i=this.getHandleSize();return m(m({},n),{shape:t,orient:e,cursor:r,size:i})},Cw.prototype.getHandleShapeCfg=function(t){var e=this.attributes,n=e.showHandle,e=e.showLabel,r=this.calcHandlePosition(t),i=r.x,r=r.y,a=this.calcHandleText(t);return m(m(m({zIndex:3,showLabel:e,visibility:n?"visible":"hidden"},nx(this.getHandleIconShapeCfg(),"icon")),nx(m(m({},this.getHandleLabelShapeCfg(t)),a),"label")),{x:i,y:r})},Cw.prototype.getHandleSize=function(){var t,e=this.attributes.handleIconSize;return e||(t=(e=this.attributes).width,e=e.height,Math.floor((this.getOrientVal([+e,+t])+4)/2.4))},Cw.prototype.getOrientVal=function(t){var t=x(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orient?e:t},Cw.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=x(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},Cw.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},Cw.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new mo(n,{detail:t}))})},Cw.prototype.bindEvents=function(){var n=this,t=this.selectionShape,t=(this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick"),[this.startHandle,this.endHandle].forEach(function(t){var e=t.node().attr("type");t.on("mousedown",function(t){n.onDragStart(e)(t)}),t.on("touchstart",function(t){n.onDragStart(e)(t)})}),this.trackShape);this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(t,"mouseleave","trackMouseleave"),t.on("mousedown",this.onDragStart("track")),t.on("touchstart",this.onDragStart("track"))},Cw.prototype.onScroll=function(t){var e;this.attributes.scrollable&&(e=t.deltaX,t=t.deltaY,t=this.getRatio(t||e),this.setValuesOffset(t,t,!0))},Cw.tag="slider",Cw.defaultOptions={style:m(m(m({values:[0,1],trackLength:200,trackSize:20,slidable:!0,brushable:!0,scrollable:!0,orient:"horizontal",trackZIndex:-1,trackFill:"#416180",trackOpacity:.05,selectionCursor:"move",selectionZIndex:2,selectionFill:"#5B8FF9",selectionFillOpacity:.45,sparklinePadding:1,padding:0,showHandle:!0,showLabel:!0,handleSpacing:2,formatter:function(t){return t}},nx(Ow,"handle")),nx(Ew,"handleIcon")),nx(Mw,"handleLabel"))};var Pw,Lw=Cw;function Cw(t){var a=Pw.call(this,Pn({},Cw.defaultOptions,t))||this;return a.range=[0,1],a.animation={duration:100,fill:"both"},a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(ix(t));var t=a.availableSpace,e=t.x,t=t.y,n=a.attributes,r=n.x,n=n.y;a.selectionStartPos=a.getRatio(a.prevPos-a.getOrientVal([e,t])-a.getOrientVal([+r,+n])),a.selectionWidth=0,document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd)}},a.onDragging=function(t){var e=a.attributes,n=e.slidable,r=e.brushable,e=(t.stopPropagation(),a.getOrientVal(ix(t))),t=e-a.prevPos;if(t){var i=a.getRatio(t);switch(a.target){case"start":n&&a.setValuesOffset(i);break;case"end":n&&a.setValuesOffset(0,i);break;case"selection":n&&a.setValuesOffset(i,i);break;case"track":if(!r)return;a.selectionWidth+=i,a.innerSetValues([a.selectionStartPos,a.selectionStartPos+a.selectionWidth].sort(),!0)}a.prevPos=e}},a.onDragEnd=function(){document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a.onValueChange=function(t){t=new mo("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}Me(Rw,Nw=$l),Object.defineProperty(Rw.prototype,"padding",{get:function(){return X2(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(Rw.prototype,"value",{get:function(){var t=this.attributes.value,e=x(this.range,2),n=e[0],e=e[1];return dn(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(Rw.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,t=t.trackLength;return void 0===t?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(Rw.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=x(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=x(this.getOrientVal([[e,t],[t,e]]),2);return{x:n,y:r,width:+t[0]-(n+i),height:+t[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(Rw.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,t=t.trackSize;return e?t/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(Rw.prototype,"thumbRadius",{get:function(){var t,e;return this.attributes.isRound?(t=(e=this.availableSpace).width,e=e.height,this.attributes.thumbRadius||this.getOrientVal([e,t])/2):0},enumerable:!1,configurable:!0}),Rw.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=x(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},Rw.prototype.getValue=function(){return this.value},Rw.prototype.renderSlider=function(t){var e=this.attributes,n=e.orient,r=e.trackSize,i=e.padding,e=e.slidable,a=x(ex(this.attributes,["track","thumb"]),2),o=a[0],a=a[1],s=m(m({orient:n,padding:i,slidable:e,trackSize:r,brushable:!1,showHandle:!1,values:this.getValues(),trackLength:this.trackLength,trackRadius:this.trackRadius,selectionRadius:this.thumbRadius},nx(o,"track")),nx(a,"selection"));this.slider=T(t).maybeAppendByClassName("scrollbar",function(){return new Lw({style:s})}).update(s).node()},Rw.prototype.render=function(t,e){this.renderSlider(e)},Rw.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.style.value,r=x(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(dn(t,i,r)),e),this.onValueChange(n)},Rw.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},Rw.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orient?t[0]:t[1]},Rw.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},Rw.tag="scrollbar",Rw.defaultOptions={style:{value:0,trackSize:10,isRound:!0,slidable:!0,scrollable:!0,orient:"vertical",padding:[2,2,2,2]}};var Nw,jw=Rw;function Rw(t){var a=Nw.call(this,Pn({},Rw.defaultOptions,t))||this;return a.range=[0,1],a.onValueChange=function(t){var e=a.style.value;t!==e&&(a.dispatchEvent(new mo("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new mo("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=x(a.getLocalPosition(),2))[0],e=e[1],n=(i=x(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(ix(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new mo("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new mo("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new mo("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new mo("trackMouseleave",{detail:t.detail}))},a}var Fw={style:{data:[],dataThreshold:100,showTitle:!0,titlePosition:"lb",titleFill:"black",titleFontSize:12,titleTextAlign:"center",titleSpacing:0,titleTextBaseline:"middle",showLine:!0,lineLineWidth:1,lineStroke:"black",lineArrow:new Qo({style:{path:"M 10,10 L -10,0 L 10,-10 L0,0 L10,10Z",anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}}),lineArrowOffset:15,lineArrowSize:10,showTick:!0,tickDirection:"positive",tickStroke:"black",tickLength:5,tickLineWidth:1,tickStrokeOpacity:.65,showLabel:!0,labelSpacing:0,labelDirection:"positive",labelAlign:"parallel",labelTransforms:[],showGrid:!0,gridType:"segment",gridConnect:"line",gridDirection:"positive",gridLength:0,gridControlAngles:[]}},Bw=(Pn({},Fw,{style:{type:"arc"}}),Pn({},Fw,{style:{}}),Cx({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"));function Iw(t,e,n,r){var i=n[e].data,n=n.map(function(t){return t.data}),i="function"==typeof r?r.call(null,i,e,n):r;t.attr(i||{})}function Dw(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=x(t,2);return[t[0],Ax(t[1],e)]}))}function zw(t,e){return e&&en(e)?t.filter(e):t}function Gw(t){return t.reduce(function(t,e,n){return"".concat(t).concat(0===n?"M":" L").concat(e[0],",").concat(e[1])},"")}function Ww(t,e,n){var r,i,a,o;return"surround"===e.type?(r=t,n=n,o=(e=e).connect,e=e.center,"line"===(void 0===o?"line":o)?Gw(r):e?(i=hx(r[0],e),a=n?0:1,r.reduce(function(t,e,n){var e=x(e,2),r=e[0],e=e[1];return(0===n?"M":"".concat(t,"A").concat(i,",").concat(i,",0,0,").concat(a,",")).concat(r,",").concat(e)},"")):""):Gw(t)}function Hw(t,e,n){function r(t,e){return"".concat(l," ").concat(t," ").concat(c," ").concat(e," ").concat(s)}var i=n.type,a=n.connect,o=n.center,s=n.closed?" Z":"",n=x([Ww(t,n),Ww(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=x([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r("L".concat(e.join()),"L".concat(t.join()));if(o)return a=(n=x([hx(e,o),hx(t,o)],2))[0],i=n[1],r("A".concat(a,",").concat(a,",0,0,1,").concat(e.join(" ")," L").concat(e.join()),"A".concat(i,",").concat(i,",0,0,0,").concat(t.join(" ")));throw new Error("Arc grid need to specified center")}function Vw(t,e,n){n.type,n.center;var r=n.connect,i=n.areaFill;if(n.closed,!(e.length<2)&&i&&r){for(var a=Array.isArray(i)?i:[i,"transparent"],o=[],s=0;s<e.length-1;s++){var l=x([e[s].points,e[s+1].points],2),l=Hw(l[0],l[1],n);o.push({path:l,fill:a[s%a.length]})}T(t).selectAll(".grid-region").data(o,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){Iw(this,e,o,t)}).attr("className","grid-region")},function(t){return t.each(function(t,e){Iw(this,e,o,t)})},function(t){return t.remove()})}}Me(Uw,Yw=$l),Uw.prototype.render=function(t,e){t.className;var n,r,i,a,o=t.items,o=void 0===o?[]:o,s=(t.type,t.center,t.areaFill,t.closed,J(t,["className","items","type","center","areaFill","closed"])),o=(o=o,t.closed?o.map(function(t){var e=t.points,n=x(e),r=n[0];return n.slice(1),m(m({},t),{points:b(b([],x(e),!1),[r],!1)})}):o);n=e,r=t,i=s,a=o.map(function(t,e){return{id:t.id||"grid-line-".concat(e),path:Ww(t.points,r)}}),T(n).selectAll(".grid-line").data(a,function(t){return t.id}).join(function(t){return t.append("path").styles({stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]}).each(function(t,e){t=t.path;Iw(this,e,a,m({path:t},i))}).attr("className","grid-line")},function(t){return t.each(function(t,e){Iw(this,e,a,t)})},function(t){return t.remove()}),Vw(e,o,t)};var Yw,qw=Uw;function Uw(){return null!==Yw&&Yw.apply(this,arguments)||this}var Xw=Mn(function(t,e){var e=x(e.angleRange,2),n=e[0];return(e[1]-n)*t+n},function(t,e){return b([t],x(e.angleRange),!1).join()}),$w=Mn(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=x(e.startPos,2))[0],n=n[1],i=x(e.endPos,2),me([0,0],[(r=x([i[0]-r,i[1]-n],2))[0],r[1]])):(i=Ex(Xw(t,e)),[-Math.sin(i),Math.cos(i)])},function(t,e){var n="linear"===(n=e).type?b(b([],x(n.startPos),!1),x(n.endPos),!1):b(b(b([],x(n.angleRange),!1),x(n.center),!1),[n.radius],!1);return"arc"===e.type&&n.push(t),n.join()});function Kw(t,e,n){var t=$w(t,n);return n=[],t=t,"positive"!==e?(n[0]=t[1],n[1]=-1*t[0]):(n[0]=-1*t[1],n[1]=t[0]),n}var Zw=Mn(function(t,e){var n=x(e.startPos,2),r=n[0],n=n[1],e=x(e.endPos,2),e=x([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return b(b([t],x(e.startPos),!1),x(e.endPos),!1).join()}),Jw=Mn(function(t,e){var n=e.radius,r=x(e.center,2),i=r[0],r=r[1],t=Ex(Xw(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return b(b(b([t],x(e.angleRange),!1),[e.radius],!1),x(e.center),!1).join()});function Qw(t,e){return("linear"===e.type?Zw:Jw)(t,e)}function tk(a,t,o){function e(t,e){var e=x(e,2),n=(r=x(e[0],2))[0],r=r[1],i=(e=x(e[1],2))[0],e=e[1];a.maybeAppendByClassName(t,"line").attr("className","".concat(Bw.line.name," ").concat(t)).styles(m(m({},o),{x1:n,y1:r,x2:i,y2:e}))}var n,r,i,s=t.startPos,l=t.endPos,c=t.truncRange,u=t.lineExtension,h=x([s,l],2),f=x(h[0],2),d=f[0],f=f[1],h=x(h[1],2),p=h[0],h=h[1],l=x(u?(s=x([s=s,l=l,u=void 0===(u=u)?[0,0]:u],3),u=(l=x(s[0],2))[0],l=l[1],g=(n=x(s[1],2))[0],n=n[1],y=(s=x(s[2],2))[0],s=s[1],u=(g=x([g-u,n-l],2))[0],n=g[1],l=Math.sqrt(Math.pow(u,2)+Math.pow(n,2)),y=(g=x([-y/l,s/l],2))[0],s=g[1],[y*u,y*n,s*u,s*n]):new Array(4).fill(0),4),g=l[0],y=l[1],u=l[2],s=l[3];a.node().removeChildren();c?(l=(n=x(c,2))[0],c=n[1],i=(l=x([d+(p-d)*l,f+(h-f)*l],2))[0],l=l[1],r=(c=x([d+(p-d)*c,f+(h-f)*c],2))[0],c=c[1],e(Bw.lineFirst.name,[[d+g,f+y],[i,l]]),e(Bw.lineSecond.name,[[r,c],[p+u,h+s]]),i=a,t.truncRange,t.truncShape,t.lineExtension,i.select(Bw.lineFirst.class).node(),i.select(Bw.lineSecond.class).node()):e("axis-line",[[d+g,f+y],[p+u,h+s]])}function ek(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g,y=e.type;"linear"===y?tk(t,e,n):(r=t,a=n,u=(c=x((i=e).angleRange,2))[0],c=c[1],o=(s=x(i.center,2))[0],s=s[1],i=i.radius,console.assert(u<c,"end angle should be greater than start angle"),360==(l=c-u)?r.maybeAppendByClassName(Bw.line,"circle").styles(m({cx:o,cy:s,r:i},a)):(d=(p=x([i,i],2))[0],p=p[1],h=(g=x([u*Math.PI/180,c*Math.PI/180],2))[0],g=g[1],f=(h=x([o+i*Math.cos(h),s+i*Math.sin(h)],2))[0],h=h[1],s=(o=x([o+i*Math.cos(g),s+i*Math.sin(g)],2))[0],i=o[1],g=180<l?1:0,o=c<u?0:1,l="M".concat(f,",").concat(h,",A").concat(d,",").concat(p,",0,").concat(g,",").concat(o,",").concat(s,",").concat(i),r.maybeAppendByClassName(Bw.line,"path").styles(m({path:l},a)))),c=t,u=y,f=n,d=(h=e).lineArrow,p=e.truncRange,g=void 0===(g=e.lineArrowOffset)?0:g,h=e.lineArrowSize,d&&((d=kx(d)).attr(f),zx(d,h,!0),("arc"!==u&&p?c.select(Bw.lineSecond.class):c.select(Bw.line.class)).style("markerEnd",d).style("markerEndOffset",-g))}function nk(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function rk(t,r){var e=r.gridLength,i=void 0===e?0:e;return t.map(function(t){var t=t.value,e=x(Qw(t,r),2),n=e[0],e=e[1],t=x(ye([0,0],Kw(t,r.gridDirection,r),i),2);return{points:[[n,e],[n+t[0],e+t[1]]]}})}function ik(t,e,n,r){var i=r.type,a=r.closed,o=r.areaFill,s=r.connect,l=nk(n),c=zw(e,n.gridFilter),e="segment"===i?rk(c,n):function(t,a,e){var o,s,l=e.controlAngles;if(!(e=nk(a)))throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(l&&0!==l.length)return e=x(e,2),o=e[0],s=e[1],t.map(function(t){var t=x(Qw(t.value,a),2),e=t[0],t=t[1],e=x([e-o,t-s],2),n=e[0],r=e[1],i=[];return l.forEach(function(t){var t=Ex(t),t=x([Math.cos(t),Math.sin(t)],2),e=t[0],t=t[1];i.push([n*e-r*t+o,n*t+r*e+s])}),{points:i}});throw new Error("Invalid gridControlAngles")}(c,n,r);t.maybeAppendByClassName(Bw.grid,function(){return new qw({})}).update(m(m({type:i,connect:s,closed:a,center:l},r),{items:e,areaFill:en(o)?c.map(function(t,e){return Ax(o,[t,e,c])}):o}))}Object.defineProperty(ok.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(ok.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(ok.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(ok.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(ok.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(ok.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),ok.prototype.clear=function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},ok.prototype.empty=function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},ok.prototype.add=function(t,e){return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},ok.prototype.rotate=function(t,e,n){t=this.rotatedPoints(t,e,n);return this.clear().add(t[0],t[1]).add(t[2],t[3]).add(t[4],t[5]).add(t[6],t[7])},ok.prototype.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),t=Math.sin(t),l=e-e*s+n*t,e=n-e*t-n*s;return[[s*r-t*i+l,t*r+s*i+e],[s*r-t*o+l,t*r+s*o+e],[s*a-t*o+l,t*a+s*o+e],[s*a-t*i+l,t*a+s*i+e]].flat(1)},ok.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},ok.prototype.intersects=function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)},ok.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var ak=ok;function ok(t){var t=t||{},e=t.left,n=t.top,r=t.right,t=t.bottom;this.x1=null!=e?e:+Number.MAX_VALUE,this.x2=null!=r?r:-Number.MAX_VALUE,this.y1=null!=n?n:+Number.MAX_VALUE,this.y2=null!=t?t:-Number.MAX_VALUE}function sk(t,c){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(function(t){return t=t,n=(e=x(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=x(t,4))[0],o=t[1],i-=n,e-=r,s=t[2]-a,t=t[3]-o,0!=(l=i*t-s*e)&&(o=i*(i=r-o)-e*(r=n-a))<0!=(e=0<l)&&(n=s*i-t*r)<0!=e&&l<o!=e&&l<n!=e;var e,n,r,i,a,o,s,l})}function lk(t,e,n){void 0===n&&(n=[0,0,0,0]);var r=e.getEulerAngles()||0,i=(e.setEulerAngles(0),e.getLocalBounds()),a=i.min,o=i.max,i=i.halfExtents,s=a[0],l=2*i[0],i=2*i[1],a=a[1],c=o[0],o=o[1],u=0,h=0,f=s,d=a,p=("text"===e.tagName&&(i-=1.5,p=e.style.textAlign,g=e.style.textBaseline,u=+e.style.dx,h=+e.style.dy,"center"===p?f=(s+c)/2:"right"!==p&&"end"!==p||(f=c),"middle"===g?d=(a+o)/2:"bottom"!==g&&"baseline"!==g||(d=o)),x(n,4)),c=p[0],g=void 0===c?0:c,o=p[1],n=void 0===o?0:o,c=p[2],o=p[3];return t.set((u+=s)-(void 0===o?n:o),(h+=a)-g,u+l+n,h+i+(void 0===c?g:c)),e.setEulerAngles(r),t.rotatedPoints(Ex(r),f,d)}function ck(t,a){var o;return b([],x(t.reduce(function(t,e,n){return n&&o&&(n=o,r=e,i=a,n=lk(new ak,n,i),sk(r=lk(new ak,r,i),[n[0],n[1],n[2],n[3]])||sk(r,[n[0],n[1],n[4],n[5]])||sk(r,[n[4],n[5],n[6],n[7]])||sk(r,[n[2],n[3],n[6],n[7]]))?(t.add(o),t.add(e)):o=e,t;var r,i},new Set)),!1)}var uk=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(t.style.visibility="hidden"))})};var hk=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,l,c,u=uk,h=2,f=t.slice(),d=t.slice(),p=Date.now(),g=Math.min.apply(Math,b([1],x(t.map(function(t){return t.getBBox().width})),!1));for("linear"!==n.type||0!==$w(0,n)[1]&&0!==$w(0,n)[0]||(n=ux(t[0]).left,t=ux(t[i-1]).right,t=Math.abs(t-n)||1,h=Math.max(Math.floor(i*g/t),h)),a&&(s=f.splice(0,1)[0]),o&&(l=f.splice(-1,1)[0],f.reverse());ck((l?b(b([l],x(d),!1),[s],!1):b([s],x(d),!1)).filter(function(t){return wx(t)}),null==e?void 0:e.margin).length;)if((l&&!s&&h%2==0||l&&s)&&f.splice(0,1).forEach(r.hide),d=u(((c=f).forEach(r.show),c),{seq:h}),h++,200<Date.now()-p)return}}],["rotate",function(t,e,n,r){function i(){return ck(t,s).length<1}function a(n){t.forEach(function(t,e){e=an(n)?n[e]:n;_(e)||r.rotate(t,e)})}var o=void 0===(l=e.optionalAngles)?[0,45,90]:l,s=e.margin,e=void 0===(l=e.recoverWhenFailed)||l,l=t.map(function(t){return+(Ox(t,"rotate")||0)});if(!i()){for(var c=0;c<o.length;c++)if(a(o[c]),i())return;e&&a(l)}}],["ellipsis",function(t,e,n,r){if(!(t.length<=1))for(var i,a,o=void 0===(s=e.suffix)?"...":s,s=e.minLength,l=e.maxLength,c=e.step,u=void 0===(e=e.margin)?[0,0,0,0]:e,e=(e=r.getTextShape(t[0]),d=e.style.fontFamily||"sans-serif",y=e.style.fontWeight||"normal",i=e.style.fontStyle||"normal",a=e.style.fontVariant,{fontSize:"object"==typeof(e=e.style.fontSize)?e.value:e,fontFamily:d,fontWeight:y,fontStyle:i,fontVariant:a}),h=Y2(c,e)||1,f=Y2(s,e)||1,d=Y2(l,e),p=(!_(d)&&d!==1/0||(d=Math.max.apply(null,t.map(function(t){return t.getBBox().width}))),Date.now()),g=t.slice(),y=x(u,4),v=(y[0],y[1],y[2],y[3],d);f+h<v;v-=h){var m=function(e){return g.forEach(function(t){r.ellipsis(r.getTextShape(t),e,o)}),(g=ck(t,u)).length<1||300<Date.now()-p?{value:void 0}:void 0}(v);if("object"==typeof m)return m.value}}]]);function fk(i,a,o){var t=a.labelTransforms,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e,n=t.type,r=hk.get(n);e=i,n=n,a.labelTransforms&&("ellipsis"!==n||1<e.map(function(t){return t.querySelector("text")}).length)&&null!=r&&r(i,t,a,o)})}function dk(t){for(var e=t;e<0;)e+=360;return e%360}var pk=Mn(function(t,e){var t=x(t,2),n=t[0],t=t[1],e=x(e,2),r=e[0],e=e[1],n=x([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return b(b([],x(t),!1),x(e),!1).join()});function gk(t,e){return Kw(t,e.labelDirection,e)}function yk(t,e,n){var r,i=n.labelAlign,e=Ox(e,"rotate");return e?+e%180:(e=0,r=gk(t.value,n),t=$w(t.value,n),"horizontal"===i?0:(e="perpendicular"===i?pk([1,0],r):pk([t[0]<0?-1:1,0],t),_x(n=((n=Mx(e))+360)%180,-90,90)||(n+=180),n))}function vk(t,e,n){e.setLocalEulerAngles(+t);t=function(t,e,n){var r=n.type,i=n.labelAlign,t=gk(t,n),n=dk(e),e=dk(Mx(pk([1,0],t)));if([90,270].includes(e)&&!n)return"middle";if(!(e%180)&&[90,270].includes(n))return"middle";if("linear"!==r)return"parallel"===i?"middle":_x(n,90,270)?_x(e,90,270)?"start":"end":_x(e,90,270)?"end":"start";if(0===e){if(_x(n,0,90,!1,!0))return"start";if(_x(n,0,90)||_x(n,270,360))return"start"}if(90===e){if(_x(n,0,90,!1,!0))return"start";if(_x(n,90,180)||_x(n,270,360))return"end"}if(270===e){if(_x(n,0,90,!1,!0))return"end";if(_x(n,90,180)||_x(n,270,360))return"start"}if(180===e){if(90===n)return"start";if(_x(n,0,90)||_x(n,270,360))return"end"}return"start"}(e.__data__.value,t,n),n=e.querySelector(".axis-label-item");"text"===(null==n?void 0:n.nodeName)&&T(n).style("textAlign",t)}function mk(t,e,n,r){var i=r.showTick,a=r.tickLength,o=r.tickDirection,s=r.labelDirection,l=Ax(r.labelSpacing,[t,e,n]),s=x([gk(t.value,r),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*("positive"===e?-1:1)},1)}(s,o)],2),o=x(de([0,0],ye([0,0],s[0],l+(1===s[1]?Ax(i?a:0,[t,e,n]):0)),Qw(t.value,r)),2);return{x:o[0],y:o[1]}}function bk(t,e,n,r,i){var a=i.labelFormatter,o=gk(e.value,i),i=function(){return kx(e.label||"")};return fn(a)?i=function(){return kx(a)}:en(a)&&(i=function(){return kx(Ax(a,[e,n,r,o]))}),t.append(i).attr("className",Bw.labelItem.name)}function xk(t,e,n,r,i,a){var o=null==(o=r.getElementsByClassName(Bw.labelItem.toString()))?void 0:o[0],a=x(rx(Dw(a,[t,e,n])),2),s=a[0],a=a[1],l=a.transform,a=J(a,["transform"]);"text"===(null==o?void 0:o.nodeName)&&o.attr(m({fontSize:12,fontFamily:"sans-serif",fontWeight:"normal",textBaseline:"middle"},s)),r.attr(m(m({},mk(t,e,n,i)),a)),Sx(r,l),vk(yk(t,r,i),r,i)}function wk(n){fk(this.node().childNodes,n,{hide:function(t){t.style.visibility="hidden"},show:function(t){t.style.visibility="visible"},rotate:function(t,e){vk(+e,t,n)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&jx(t,e,n)},getTextShape:function(t){return t.querySelector("text")}})}function kk(t,e){return Kw(t,e.tickDirection,e)}var Ek=Mn(function(t,e){t=x(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return b(b([],x(t),!1),[e],!1).join()});function Mk(t,e,n,r,i){var a=i.tickFormatter,o=kk(e.value,i),i="line";return a instanceof Ro?i=function(){return a}:en(a)&&(i=function(){return Ax(a,[e,n,r,o])}),t.append(i).attr("className",Bw.tickItem.name)}function Ok(t,e,n,r,i,a,o){var s=kk(t.value,a),l=(u=t,h=e,f=n,s=s,l=(a=a).tickLength,c=(a=x(Qw(u.value,a),2))[0],a=a[1],s=x(Ek(s,Ax(l,[u,h,f])),2),u=(l=x(s[0],2))[0],h=l[1],f=x(s[1],2),{x:c,y:a,x1:u,x2:f[0],y1:h,y2:f[1]}),s=l.x1,c=l.x2,a=l.y1,u=l.y2,h=l.x,f=l.y,l=x(rx(Dw(o,[t,e,n])),2),o=l[0],t=l[1];"line"===r.node().nodeName&&r.styles(m({x1:s,x2:c,y1:a,y2:u},o)),i.attr(m({x:h,y:f},t)),r.styles(o)}var Sk={text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"},_k=Cx({text:"text"},"title");function Ak(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function Tk(r,t){t=Object.entries(t).reduce(function(t,e){var e=x(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}Me(Ck,Pk=$l),Ck.prototype.getAvailableSpace=function(){var t=this.attributes,r=t.width,i=t.height,e=t.position,n=t.spacing,t=t.inset,a=this.querySelector(_k.text.class);if(!a)return new Rx(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=x(X2(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=x([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=Ak(e);if(a.includes("i"))return new Rx(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=x(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=x([+r-o-h],1),p=n[0]),"b"===t&&(n=x([+i-s-l],1),g=n[0]),"l"===t&&(n=x(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=x(X2(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=x([n+a,e+t],2),t=a[0],a=a[1];return new Rx(f+n,d+e,p-t,g-a)},Ck.prototype.getBBox=function(){return this.title?this.title.getBBox():new Rx(0,0,0,0)},Ck.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,t.class,J(t,["width","height","position","spacing","class"])),u=x(rx(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=x([+h/2,+r/2],2),a=(i=x([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=Ak(t)).includes("l")&&(a=(n=x([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=x([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=x([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=x([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),f=h.x,d=h.y,p=h.textAlign,g=h.textBaseline;Tx(!!c.text,e,function(t){l.title=T(t).maybeAppendByClassName(_k.text,"text").styles(u).call(Tk,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var Pk,Lk=Ck;function Ck(t){return Pk.call(this,dx({},{style:Sk},t=void 0===t?{}:t))||this}function Nk(t,e,n){var r,i,a,o,s,l,c,u,t=t.select(Bw.mainGroup.class);return t=t,e=e,i=void 0===(i=(n=n).titlePosition)?"lb":i,a=void 0===(a=n.titleSpacing)?0:a,o=Ak(i),s=(l=t.node().getBBox()).x,l=l.y,c=(t=x(t.node().getBounds().halfExtents,2))[0],t=t[1],u=(e=x(e.node().getBounds().halfExtents,2))[0],e=e[1],s=x([s+c,l+t],2),s=(l=x([s[0],s[1]],2))[0],l=l[1],["start","end"].includes(i)&&"linear"===n.type?(r=n.startPos,n=n.endPos,n=(i=x("start"===i?[r,n]:[n,r],2))[0],r=(i=x(ye([0,0],me([0,0],[-(r=i[1])[0]+n[0],-r[1]+n[1]]),a),2))[0],i=i[1],{x:n[0]+r,y:n[1]+i}):(o.includes("l")&&(s-=c+u+a),o.includes("r")&&(s+=c+u+a),o.includes("t")&&(l-=t+e+a),o.includes("b")&&(l+=t+e+a),{x:s,y:l})}function jk(t,e,n,r){var i,a,o,s;n.title&&(a=(t=x((t=t,i=(a=n).title,a=t.maybeAppendByClassName(Bw.title,function(){return kx(i)}),[t,a]),2))[0],t=t[1],a=a,e=e,n=n,o=(r=x(rx(r=r),2))[0],r=r[1],s=void 0===(s=r.transform)?"":s,r=J(r,["transform"]),t.styles(o),e=(o=Nk(e,a,n)).x,n=o.y,a.styles(r),a.node().setPosition(e,n),Sx(t,s))}var Rk,Fk=Lx({render:function(n,e){var t=K2(n),r=t.type,i=t.data,a=(t.class,t.dataThreshold),a=void 0===a?100:a,o=(t.crossSize,t.animation,t.title,t.showTitle),s=(t.titleSpacing,t.truncRange),l=(t.truncShape,t.showLine),c=(t.lineExtension,t.lineArrow,t.lineArrowOffset,t.lineArrowSize,t.showTick),u=(t.tickDirection,t.tickLength,t.tickFilter,t.tickFormatter,t.showLabel),h=(t.labelAlign,t.labelDirection,t.labelSpacing,t.labelFilter,t.labelFormatter,t.labelTransforms,t.showGrid),t=(t.gridFilter,t.gridLength,J(t,["type","data","class","dataThreshold","crossSize","animation","title","showTitle","titleSpacing","truncRange","truncShape","showLine","lineExtension","lineArrow","lineArrowOffset","lineArrowSize","showTick","tickDirection","tickLength","tickFilter","tickFormatter","showLabel","labelAlign","labelDirection","labelSpacing","labelFilter","labelFormatter","labelTransforms","showGrid","gridFilter","gridLength"])),r=x(ex("linear"===r?(t.startPos,t.endPos,J(t,["startPos","endPos"])):(t.angleRange,t.radius,t.center,J(t,["angleRange","radius","center"])),["title","line","tick","label","grid"]),5),f=r[0],d=r[1],p=r[2],g=r[3],y=r[4],v=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(i,a).filter(function(t){t=t.value;return!(s&&t>s[0]&&t<s[1])}),t=(Tx(h,T(e).maybeAppendByClassName(Bw.gridGroup,"g"),function(t){ik(t,v,n,y)}),T(e).maybeAppendByClassName(Bw.mainGroup,"g")),r=(Tx(l,t.maybeAppendByClassName(Bw.lineGroup,"g"),function(t){ek(t,n,d)}),t.maybeAppendByClassName(Bw.tickGroup,"g")),i=(Tx(c,r,function(t){var r,i,a;t=t,i=p,a=zw(v,(r=n).tickFilter),t.selectAll(".axis-tick").data(a).join(function(t){return t.append("g").attr("className",Bw.tick.name).each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Mk.apply(void 0,b(b([T(this)],x(t),!1),[a,r],!1));Ok.apply(void 0,b(b([],x(t),!1),[a,n,this,r,i],!1))})},function(t){return t.each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.removeChildren();var n=Mk.apply(void 0,b(b([T(this)],x(t),!1),[a,r],!1));Ok.apply(void 0,b(b([],x(t),!1),[a,n,this,r,i],!1))})},function(t){return t.remove()})}),t.maybeAppendByClassName(Bw.labelGroup,"g")),a=(Tx(u,i,function(t){var e,r,i,a;e=t,i=g,a=zw(v,(r=n).labelFilter),e.selectAll(Bw.label.class).data(a).join(function(t){return t.append("g").attr("className",Bw.label.name).each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];bk.apply(void 0,b(b([T(this)],x(t),!1),[a,r],!1)),xk.apply(void 0,b(b([],x(t),!1),[a,this,r,i],!1))}).call(function(){wk.call(e,r)})},function(t){return t.each(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=T(this);n.node().removeChildren(),bk.apply(void 0,b(b([n],x(t),!1),[a,r],!1)),xk.apply(void 0,b(b([],x(t),!1),[a,this,r,i],!1))}).call(function(){wk.call(e,r)})},function(t){return t.remove()})}),T(e).maybeAppendByClassName(Bw.titleGroup,"g"));Tx(o,a,function(t){jk(t,T(e),n,f)})}},m({},Fw.style)),Bk={effect:"linear",duration:200,orient:"horizontal",initPage:0,loop:!1,buttonPath:[["M",(bo=0)-(gl=6),(r=0)-gl],["L",bo+gl,r],["L",bo-gl,r+gl],["Z"]],buttonFill:"black",buttonSize:12,buttonCursor:"pointer",formatter:function(t,e){return"".concat(t,"/").concat(e)},pageNumFontSize:12,pageNumFill:"black",pageNumTextAlign:"start",pageNumTextBaseline:"middle",controllerPadding:5,controllerSpacing:5},Ik=Cx({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Dk=(Me(zk,Rk=$l),Object.defineProperty(zk.prototype,"defaultPage",{get:function(){var t=this.attributes.initPage;return dn(void 0===t?0:t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(zk.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(zk.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(zk.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=x((n=t.map(function(t){t=t.getBBox();return[t.width,t.height]}),((null==(t=n[0])?void 0:t.map(function(t,e){return n.map(function(t){return t[e]})}))||[]).map(function(t){return Math.max.apply(Math,b([],x(t),!1))})),2),e=t[0],t=t[1],r=this.attributes,i=r.pageWidth,r=r.pageHeight;return{pageWidth:void 0===i?e:i,pageHeight:void 0===r?t:r}},enumerable:!1,configurable:!0}),zk.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(zk.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(zk.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),Object.defineProperty(zk.prototype,"finished",{get:function(){var t,e=this;return this.finishedPromise||(this.finishedPromise=new Promise(function(t){e.resolveFinishedPromise=function(){e.finishedPromise=null,t(e.currPage)}})),"idle"===this.playState&&null!=(t=this.resolveFinishedPromise)&&t.call(this),this.finishedPromise},enumerable:!1,configurable:!0}),zk.prototype.getBBox=function(){var t=Rk.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new Rx(e,t,i+n.width,r)},zk.prototype.goTo=function(e){var n=this,t=this.attributes,r=t.duration,t=t.effect,i=this.currPage,a=this.playState,o=(this.finished,this.playWindow),s=this.pageViews;return"idle"!==a||e<0||s.length<=0||e>=s.length||(s[i].setLocalPosition(0,0),this.prepareFollowingPage(e),a={duration:r,easing:t,fill:"both"},i=(s=x(this.getFollowingPageDiff(e),2))[0],r=s[1],this.playState="running",Promise.all([o.animate([{transform:"translate(0, 0)"},{transform:"translate(".concat(-i,", ").concat(-r,")")}],a)].map(function(t){return null==t?void 0:t.finished})).then(function(){var t;n.innerCurrPage=e,n.playState="idle",n.setVisiblePages([e]),n.updatePageInfo(),null!=(t=n.resolveFinishedPromise)&&t.call(n)})),{finished:this.finished}},zk.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?{finished:this.finished}:(t=t?(n-1+e)%e:dn(n-1,0,e),this.goTo(t))},zk.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?{finished:this.finished}:(t=t?(n+1)%e:dn(n+1,0,e),this.goTo(t))},zk.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;this.clipPath=t.maybeAppendByClassName(Ik.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())},zk.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){n.includes(e)?t.attr("visibility","visible"):t.attr("visibility","hidden")})},zk.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orient,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,x("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=x(i.offset,3),o=x(a[0],2),s=o[0],c=o[1],l=x(a[1],2),r=l[0],o=l[1],l=x(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},zk.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(Ik.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},zk.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orient,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t<i?-1:1,"horizontal"===e?[t*n,0]:[0,t*r])},zk.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=x(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},zk.prototype.renderController=function(t){var e,n,r,i,a,o=this,s=this.attributes.controllerSpacing,l=this.pageShape,c=l.pageWidth,l=l.pageHeight,u=2<=this.pageViews.length,t=t.maybeAppendByClassName(Ik.controller,"g").style("visibility",u?"visible":"hidden");u&&(i=(u=x(ex(this.attributes,["button","pageNum"]),2))[0],u=u[1],r=(i=x(rx(i),2))[0],i=i[1],e=r.size,n=J(r,["size"]),r=t.maybeAppendByClassName(Ik.prevBtnGroup,"g").styles(i),this.prevBtnGroup=r.node(),a=r.maybeAppendByClassName(Ik.prevBtn,"path"),i=t.maybeAppendByClassName(Ik.nextBtnGroup,"g").styles(i),this.nextBtnGroup=i.node(),[a,i.maybeAppendByClassName(Ik.nextBtn,"path")].forEach(function(t){t.styles(m(m({},n),{transformOrigin:"center"})),zx(t.node(),e,!0)}),a=t.maybeAppendByClassName(Ik.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(Ik.pageInfo,"text").styles(m(m({},Z2),u)),this.updatePageInfo(),t.node().setLocalPosition(c+s,l/2),r.on("click",function(){o.prev()}),i.on("click",function(){o.next()}))},zk.prototype.render=function(t,e){e=T(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},zk.prototype.bindEvents=function(){function t(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}var r,i,a,o,e=this;r=function(){return e.render(e.attributes,e)},i=50;this.playWindow.addEventListener(w.INSERTED,t),this.playWindow.addEventListener(w.REMOVED,t)},zk);function zk(t){t=Rk.call(this,dx({},{style:Bk},t))||this;return t.finishedPromise=null,t.resolveFinishedPromise=null,t.playState="idle",t.contentGroup=t.appendChild(new Yo({class:Ik.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new Yo({class:Ik.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function Gk(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}$x.registerSymbol("hiddenHandle",function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]}),$x.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+(n=n/6)],["L",t+r-2,e+n],["M",a,e-n],["L",t+r-2,e-n]]}),$x.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-(n=n/6),a],["L",t-n,e+r-2],["M",t+n,a],["L",t+n,e+r-2]]});var Wk,Hk=Cx({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),Vk={span:[1,1],marker:function(){return new Bo({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelFontFamily:"sans-serif",valueFontFamily:"sans-serif",labelTextAlign:"start",valueTextAlign:"start",labelTextBaseline:"middle",valueTextBaseline:"middle"},Yk=(Me(qk,Wk=$l),Object.defineProperty(qk.prototype,"showValue",{get:function(){var t=this.attributes.value;return!!t&&(fn(t)||pn(t)?""!==t:""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(qk.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,n=void 0===n?0:n,t=t.node().getBBox(),r=t.width,t=t.height,e=e.node().getBBox(),i=e.width,e=e.height;return{markerWidth:n,labelWidth:r,valueWidth:i,height:Math.max(n,t,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(qk.prototype,"span",{get:function(){var t,e=this.attributes;return"span"in e?(t=(e=x(X2(e.span),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(qk.prototype,"shape",{get:function(){var t=this.attributes,e=t.markerSize,t=t.width,n=this.actualSpace,r=n.markerWidth,n=n.height,i=this.actualSpace,a=i.labelWidth,i=i.valueWidth,o=x(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=x(this.span,2),a=(e=x([e[0]*t,e[1]*t],2))[0],i=e[1]),{width:r+a+i+s+o,height:n,markerWidth:r,labelWidth:a,valueWidth:i}},enumerable:!1,configurable:!0}),Object.defineProperty(qk.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=x(X2(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(qk.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=x(this.spacing,2),o=a[0];return{height:t,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+o,e+n+o+a[1]]}},enumerable:!1,configurable:!0}),qk.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.marker,i=n.markerSize,a=tx(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Hk.markerGroup,"g"),Tx(!!r,this.markerGroup,function(){e.markerGroup.maybeAppendByClassName(Hk.marker,r).styles(a),zx(e.markerGroup.node(),i,!0)})},qk.prototype.renderLabel=function(t){var e=this.attributes.label,n=tx(this.attributes,"label");this.labelGroup=t.maybeAppendByClassName(Hk.labelGroup,"g"),this.labelGroup.maybeAppendByClassName(Hk.label,function(){return kx(e)}).styles(n)},qk.prototype.renderValue=function(t){var e=this,n=this.attributes.value,r=tx(this.attributes,"value");this.valueGroup=t.maybeAppendByClassName(Hk.valueGroup,"g"),Tx(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(Hk.value,function(){return kx(n)}).styles(r)})},qk.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=tx(this.attributes,"background");this.background=t.maybeAppendByClassName(Hk.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Hk.background,"rect").styles(m({width:n,height:e},r))},qk.prototype.adjustLayout=function(){var t=this.layout,e=(t.markerWidth,t.labelWidth),n=t.valueWidth,r=(t.width,t.height),t=x(t.position,3),i=t[0],a=t[1],t=t[2],r=r/2;this.markerGroup.styles({x:i,y:r}),this.labelGroup.styles({x:a,y:r}),jx(this.labelGroup.select(Hk.label.class),e),this.showValue&&(this.valueGroup.styles({x:t,y:r}),jx(this.valueGroup.select(Hk.value.class),n))},qk.prototype.render=function(t,e){e=T(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()},qk);function qk(t){return Wk.call(this,dx({},{style:Vk},t))||this}function Uk(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var Xk,$k=Cx({page:"item-page",navigator:"navigator",item:"item"},"items"),Kk={data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orient:"horizontal",click:Tn,mouseenter:Tn,mouseleave:Tn},Zk=(Me(Jk,Xk=$l),Object.defineProperty(Jk.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(Jk.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,t=t.data;if(e||n)return e&&n?[e,n]:e?[e,t.length]:[t.length,n];throw new Error("gridRow and gridCol can not be set null at the same time")},enumerable:!1,configurable:!0}),Object.defineProperty(Jk.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=tx(this.attributes,"item");return a.map(function(e,n){var t=e.id,r=e.label,i=e.value;return{id:"".concat(void 0===t?n:t),index:n,style:m({layout:o,label:r,value:i},Object.fromEntries(Object.entries(s).map(function(t){t=x(t,2);return[t[0],Ax(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),Jk.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orient,f=t.width,d=t.rowPadding,p=t.colPadding,g=x(this.navigatorShape,1)[0],t=x(this.grid,2),y=t[0],v=t[1],m=v*y,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/m),i=e%m,a=u.ifHorizontal(v,y),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),x(a,2)),o=a[0],a=a[1],s=(f-g-(v-1)*p)/v,t=t.getBBox().height,l=x([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=x([b,o*(t+d)],2))[0],l=n[1],a===v-1?0:b+s+p):(c=(n=x([a*(s+p),b],2))[0],l=n[1],o===y-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},Jk.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=x(this.navigatorShape,1)[0],r=x(this.grid,2),s=r[0],l=r[1],r=x([e-t,n],2),c=r[0],u=r[1],e=x([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],y=e[5],v=e[6],m=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===v?0:o,i=v+r+n;return i<=c&&Uk(g,function(t){return t<l})?(r=x([v+r,m,i],3),h=r[0],f=r[1],v=r[2]):(i=x([y+1,0,0,m+t+a],4),y=i[0],g=i[1],v=i[2],(m=i[3])+a+t<=u&&Uk(y,function(t){return t<s})?(r=x([v,m,n],3),h=r[0],f=r[1],v=r[2]):(i=x([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],v=i[2],m=i[3],d=i[4],p=i[5],y=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:y,col:g++}})},Object.defineProperty(Jk.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return 0<e.slice(-1)[0].page?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),Jk.prototype.ifHorizontal=function(t,e){return Gk(this.attributes.orient,t,e)},Jk.prototype.flattenPage=function(e){e.querySelectorAll($k.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll($k.page.class).forEach(function(t){e.removeChild(t).destroy()})},Jk.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=(this.flattenPage(t),this.dispatchCustomEvent.bind(this));T(t).selectAll($k.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new Yk({style:t})}).attr("className",$k.item.name).on("click",function(){null!=n&&n(this),a("itemClick",{item:this})}).on("mouseenter",function(){null!=r&&r(this),a("itemMouseenter",{item:this})}).on("mouseleave",function(){null!=i&&i(this),a("itemMouseleave",{item:this})})},function(t){return t.each(function(t){t=t.style;this.update(t)})},function(t){return t.remove()})},Jk.prototype.relayoutNavigator=function(){var t=this.attributes,e=t.layout,t=t.width,n=(null==(n=this.pageViews.children[0])?void 0:n.getBBox().height)||0,r=x(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update(m({},"grid"===e?{pageWidth:t-i,pageHeight:n-r}:{}))},Jk.prototype.adjustLayout=function(){var n,e=this,t=Object.entries((t=this.itemsLayout,n="page",t.reduce(function(t,e){return(t[e[n]]=t[e[n]]||[]).push(e),t},{}))).map(function(t){t=x(t,2);return{page:t[0],layouts:t[1]}}),u=b([],x(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new Yo({className:$k.page.name}));t.forEach(function(t){var n,r,i,e=t.x,a=t.y,o=t.index,s=t.width,l=t.height,o=u[o];c.appendChild(o),n=t,r=o,(i=fn(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(on(r[t])||(r[t]=pn(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},Jk.prototype.renderNavigator=function(t){var e=this.attributes.orient,n=tx(this.attributes,"nav"),n=m(m({},n),{orient:e});return this.navigator=t.maybeAppendByClassName($k.navigator,function(){return new Dk({})}).update(n).node(),this.navigator},Jk.prototype.getBBox=function(){return this.navigator.getBBox()},Jk.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(T(e)),this.renderItems(n.getContainer()),this.adjustLayout())},Jk.prototype.dispatchCustomEvent=function(t,e){t=new mo(t,{detail:e});this.dispatchEvent(t)},Jk);function Jk(t){t=Xk.call(this,dx({},{style:Kk},t))||this;return t.navigatorShape=[0,0],t}var Qk,t5=Cx({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),e5=m(m({},nx(Z2,"label")),{markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orient:"vertical",spacing:0,showLabel:!0,formatter:function(t){return t.toString()}}),n5=(Me(r5,Qk=$l),r5.prototype.render=function(t,e){var n=T(e).maybeAppendByClassName(t5.markerGroup,"g"),n=(this.renderMarker(n),T(e).maybeAppendByClassName(t5.labelGroup,"g"));this.renderLabel(n)},r5.prototype.attributeChangedCallback=function(){this.render(this.attributes,this)},r5.prototype.renderMarker=function(t){var n=this,e=this.attributes,r=e.orient,e=e.markerSymbol,i=void 0===e?Gk(r,"horizontalHandle","verticalHandle"):e;Tx(!!i,t,function(t){var e=tx(n.attributes,"marker"),e=m({symbol:i},e);n.marker=t.maybeAppendByClassName(t5.marker,function(){return new $x({})}).update(e)})},r5.prototype.renderLabel=function(t){var s=this,e=this.attributes,l=e.orient,n=e.spacing,c=void 0===n?0:n,n=e.showLabel,u=e.formatter;Tx(n,t,function(t){var e=tx(s.attributes,"label"),n=e.text,e=J(e,["text"]),r=(null==(r=t.select(t5.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=x(Gk(l,[0,(void 0===r?0:r)+c,"center","top"],[(void 0===i?0:i)+c,0,"start","middle"]),4),i=r[0],a=r[1],o=r[2],r=r[3];t.maybeAppendByClassName(t5.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},r5);function r5(t){return Qk.call(this,dx({},{style:e5},t))||this}var i5,vo={style:{padding:0,orient:"horizontal",backgroundFill:"transparent",titleText:"",showTitle:!0,titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12}},a5=Pn({},vo,{style:{type:"category",items:[],maxCols:void 0,maxRows:void 0,spacing:[8,2],itemBackground:{padding:0,style:{fill:"transparent",active:{cursor:"pointer"}}},reverse:!1}}),o5=Pn({},vo,nx(e5,"handle"),{style:{type:"continuous",color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],slidable:!0,showHandle:!0,showLabel:!0,showIndicator:!0,labelSpacing:5,labelAlign:"value",labelDirection:"positive",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorBackgroundFill:"#262626"}}),s5=Cx({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),l5=(Me(c5,i5=$l),c5.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=x(rx(tx(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(s5.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(s5.title,function(){return new Lk({style:s})}).update(s)},c5.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=x(ex(this.attributes,["title"]),2),a=x(rx(a[1]),2),o=a[0],a=a[1],o=m(m({},o),{width:i,height:e});this.itemsGroup=t.maybeAppendByClassName(s5.itemsGroup,"g").styles(m({x:n,y:r},a)),this.items=this.itemsGroup.maybeAppendByClassName(s5.items,function(){return new Zk({style:{data:[]}})}),this.items.node().update(o)},c5.prototype.adjustLayout=function(){var t,e;this.attributes.showTitle&&(t=(e=this.title.node().getAvailableSpace()).x,e=e.y,this.itemsGroup.node().setLocalPosition(t,e))},Object.defineProperty(c5.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new Rx(0,0,n,t)},enumerable:!1,configurable:!0}),c5.prototype.getBBox=function(){return t=this.title.node(),e=this.items.node(),n=(i=t.attributes).position,r=i.spacing,i=i.inset,a=t.getBBox(),o=e.getBBox(),n=Ak(n),r=(t=x(X2(t.attributes.text?r:0),4))[0],s=t[1],l=t[2],t=t[3],c=(i=x(X2(i),4))[0],u=i[1],h=i[2],i=i[3],s=(t=x([t+s,r+l],2))[0],r=t[1],t=(l=x([i+u,c+h],2))[0],i=l[1],"l"===n[0]?new Rx(a.x,a.y,o.width+a.width+s+t,Math.max(o.height+i,a.height)):"t"===n[0]?new Rx(a.x,a.y,Math.max(o.width+t,a.width),o.height+a.height+r+i):(c=(u=x([e.attributes.width||o.width,e.attributes.height||o.height],2))[0],h=u[1],new Rx(o.x,o.y,c+a.width+s+t,h+a.height+r+i));var t,e,n,r,i,a,o,s,l,c,u,h},c5.prototype.render=function(t,e){var n=t.width,t=t.height,e=T(e);this.renderTitle(e,n,t),this.renderItems(e,this.availableSpace),this.adjustLayout()},c5);function c5(t){return i5.call(this,dx({},a5,t))||this}var u5,h5={formatter:function(t){return t},padding:[2,4],position:"right",labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",backgroundZIndex:-1,backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333"},f5=Cx({background:"background",labelGroup:"label-group",label:"label"},"indicator"),d5=(Me(p5,u5=$l),p5.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.style).position,o=(i=x(X2(i.padding),4))[0],e=i[1],n=i[2],i=i[3],a=(r=this.label.node().getLocalBounds()).min,r=r.max,i=[[a[0]-i,a[1]-o],[r[0]+e,r[1]+n]],a=this.getPath(t,i),o=tx(this.attributes,"background"),this.background=T(this.group).maybeAppendByClassName(f5.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},p5.prototype.renderLabel=function(){var t=this.attributes,e=t.value,n=t.formatter,t=x(rx(tx(this.attributes,"label")),2),r=t[0],t=t[1];this.label=T(this.group).maybeAppendByClassName(f5.labelGroup,"g").styles(t),e&&this.label.maybeAppendByClassName(f5.label,function(){return kx(n(e))}).style("text",n(e).toString()).selectAll("text").styles(m(m({},Z2),r))},p5.prototype.adjustLayout=function(){var t=x(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},p5.prototype.getPath=function(n,t){var r=this,t=x(t,2),e=x(t[0],2),i=e[0],e=e[1],t=x(t[1],2),a=t[0],t=t[1],o={top:"bottom",right:"left",bottom:"top",left:"right"},a=Object.entries({top:[[i,e],[a,e]],right:[[a,e],[a,t]],bottom:[[a,t],[i,t]],left:[[i,t],[i,e]]}).map(function(t){var t=x(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[b(["M"],x(t[0]),!1),b(["L"],x(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},p5.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=x(t,2))[0],t=t[1],r=(e=x(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,b([],x(t),!1)),t=x(t,2),r=x(t[0],2),i=r[0],r=r[1],t=x(t[1],2),a=t[0],t=t[1],a=x(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=x(a[1],2),o=a[0],a=a[1],s=t/2,e=e*(t/Math.abs(t)),t=e/2,e=e*Math.sqrt(3)/2*.8,o=x([o,o+s-t,o+s,o+s+t,a],5),s=o[0],t=o[1],a=o[2],l=o[3],o=o[4];return n?(this.point=[a,r-e],[["M",s,r],["L",t,r],["L",a,r-e],["L",l,r],["L",o,r]]):(this.point=[i+e,a],[["M",i,s],["L",i,t],["L",i+e,a],["L",i,l],["L",i,o]])},p5.prototype.bindEvents=function(){this.label.on(w.BOUNDS_CHANGED,this.renderBackground)},p5.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},p5);function p5(t){t=u5.call(this,dx({},{style:m({visibility:"hidden"},h5)},t))||this;return t.point=[0,0],t.group=t.appendChild(new Yo({})),t.isMutationObserved=!0,t}function g5(t,e){var t=x(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(r<=e&&e<=i)return[r,i]}return[e,e]}(t,e),2),n=t[0],t=t[1];return{tick:(n+t)/2<e?t:n,range:[n,t]}}var y5=Cx({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function v5(t){var e=t.orient,n=t.size,t=t.len;return Gk(e,[t,n],[n,t])}function m5(t){var e=t.type,t=x(v5(t),2),n=t[0],t=t[1];return"size"===e?[["M",0,t],["L",0+n,0],["L",0+n,t],["Z"]]:[["M",0,t],["L",0,0],["L",0+n,0],["L",0+n,t],["Z"]]}function b5(t){var e,i,a,o,n=t.orient,r=t.color,s=t.block,t=t.partition,l=(e=en(r)?new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))}):r).length;return l?1===l?e[0]:s?(i=t,s=e,t=n,a=Array.from(s),o=i.length,new Array(o).fill(0).reduce(function(t,e,n){var r=a[n%a.length];return t+" ".concat(i[n],":").concat(r).concat(n<o-1?" ".concat(i[n+1],":").concat(r):"")},"l(".concat("horizontal"===t?"0":"270",")"))):e.reduce(function(t,e,n){return t+" ".concat(n/(l-1),":").concat(fa(e))},"l(".concat(Gk(n,"0","270"),")")):""}function x5(t,e,n){var r,i,a,o=b5(e),t=t.maybeAppendByClassName(y5.selection,"path").styles(m({path:m5(e),fill:o},n)),n=t.maybeAppendByClassName(y5.clipPath,"path").styles({path:(n=(o=e).orient,(e=o.range)?(i=(o=x(v5(o),2))[0],o=o[1],r=(e=x(e,2))[0],e=e[1],a=Gk(n,r*i,0),r=Gk(n,0,r*o),i=Gk(n,e*i,i),[["M",a,r],["L",a,a=Gk(n,o,e*o)],["L",i,a],["L",i,r],["Z"]]):[])}).node();t.style("clip-path",n)}var w5,k5,E5,M5,O5=Lx({render:function(t,e){var n,r=x(ex(t,["selection","track"]),2),i=r[0],r=r[1],a=T(e).maybeAppendByClassName(y5.trackGroup,"g");n=t,r=r,a.maybeAppendByClassName(y5.track,"path").styles(m({path:m5(n)},r)),x5(T(e).maybeAppendByClassName(y5.selectionGroup,"g"),t,i)}},m({},{type:"color",orient:"horizontal",size:30,range:[0,1],len:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})),S5=Mn(function(t){return{min:Math.min.apply(Math,b([],x(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,b([],x(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),_5=(Me(h,w5=$l),Object.defineProperty(h.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.7,.9)},enumerable:!1,configurable:!0}),h.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new Rx(0,0,e,t)},h.prototype.render=function(t,e){var n=this,r=(this.renderTitle(T(e)),this.title.node().getAvailableSpace()),i=r.x,r=r.y,t=t.showLabel,e=T(e).maybeAppendByClassName(s5.contentGroup,"g").styles({x:i,y:r}),i=(Tx(!!t,e.maybeAppendByClassName(s5.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(s5.ribbonGroup,"g"));this.handlesGroup=e.maybeAppendByClassName(s5.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(h.prototype,"range",{get:function(){var t=this.attributes.data;return S5(t)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,t=t.max;return this.innerRibbonScale.update({domain:[e,t],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"ribbonRange",{get:function(){var t=x(this.selection,2),e=t[0],t=t[1],n=this.ribbonScale;return[n.map(e),n.map(t)]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=x(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),h.prototype.ifHorizontal=function(t,e){return Gk(this.style.orient,"function"==typeof t?t():t,"function"==typeof e?e():e)},h.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,r=void 0===r?"":r,i=e.width,e=e.height,a=tx(this.attributes,"title"),o=m(m({width:i,height:e},a),{text:n?r:""});this.title=t.maybeAppendByClassName(s5.title,function(){return new Lk({style:o})}).update(o)},Object.defineProperty(h.prototype,"labelFixedSpacing",{get:function(){return this.attributes.labelShowTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orient,t=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][t]},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=this.label.select(Bw.labelGroup.class).node().children.slice(-1)[0].getBBox()).width,e=e.height,this.cacheLabelBBox=new Rx(0,0,t,e)),this.cacheLabelBBox):new Rx(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"labelShape",{get:function(){var t,e=this.attributes,n=e.showLabel,e=e.labelSpacing,e=void 0===e?0:e;return n?{width:t=(n=this.labelBBox).width,height:n=n.height,size:this.ifHorizontal(n,t)+e+this.labelFixedSpacing,len:this.ifHorizontal(t,n)}:{width:0,height:0,size:0,len:0}},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"ribbonBBox",{get:function(){var t=this.attributes.showHandle,e=this.title.node().getAvailableSpace(),n=e.width,e=e.height,r=this.labelShape,i=r.size,r=r.len,n=x(this.ifHorizontal([e,n],[n,e]),2),e=n[0],n=n[1],t=t?this.handleShape:{size:0,len:0},a=t.size,t=t.len,o=this.handleOffsetRatio,s=0,l=this.labelPosition,s=["bottom","right"].includes(l)?Math.min(e-i,(e-a)/o):a<e*(1-o)?Math.max(e-i,0):Math.max((e-i-a)/o,0),e=Math.max(t,r),a=n-e,o=x(this.ifHorizontal([a,s],[s,a]),2),t=o[0],r=o[1],n=["top","left"].includes(l)?i:0,s=x(this.ifHorizontal([e/2,n],[n,e/2]),2),a=s[0],o=s[1];return new Rx(a,o,t,r)},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,t=t.height;return this.ifHorizontal({size:t,len:e},{size:e,len:t})},enumerable:!1,configurable:!0}),h.prototype.renderRibbon=function(t){var e=this.attributes,n=e.type,r=e.orient,i=e.color,a=e.block,e=e.data,o=tx(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,h=this.ribbonShape,f=h.len,h=h.size;this.ribbon=t.maybeAppendByClassName(s5.ribbon,function(){return new O5({})}).update(m({x:u,y:s,len:f,size:h,type:n,orient:r,color:i,block:a,partition:e.map(function(t){return(t.value-l)/(c-l)}),range:this.ribbonRange},o))},h.prototype.getHandleClassName=function(t){return"".concat(s5.prefix("".concat(t,"-handle")))},h.prototype.renderHandles=function(){var e=this,t=this.attributes,n=t.showHandle,t=t.orient,r=tx(this.attributes,"handle"),r=(r.formatter,J(r,["formatter"])),i=x(this.selection,2),a=i[0],i=i[1],o=m({orient:t},r),s=this;this.handlesGroup.selectAll(s5.handle.class).data(n?[{value:a,type:"start"},{value:i,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new n5({})}).attr("className",function(t){return"".concat(s5.handle," ").concat(e.getHandleClassName(t.type))}).styles(o).style("labelText",function(t){return t.value}).each(function(t){var e=T(this);"start"===t.type?s.startHandle=e:s.endHandle=e})},function(t){return t.styles(o).style("labelText",function(t){return t.value})},function(t){return t.remove()})},h.prototype.adjustHandles=function(){var t=x(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},Object.defineProperty(h.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new Rx(0,0,0,0);var t=this.startHandle.node().getBBox(),e=t.width,t=t.height,n=this.endHandle.node().getBBox(),r=n.width,n=n.height,e=x([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new Rx(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=x(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],len:n[1]}},enumerable:!1,configurable:!0}),h.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,r=r.y,a=this.ribbonShape.size,e=this.getOffset(e),i=x(this.ifHorizontal([i+e,r+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,r+e]),2),a=i[0],r=i[1],e=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null!=e&&e.attr("formatter",n),null!=e&&e.setLocalPosition(a,r)},h.prototype.renderIndicator=function(t){var e=tx(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(s5.indicator,function(){return new d5({style:e})}).update(e)},Object.defineProperty(h.prototype,"labelData",{get:function(){var s=this;return this.attributes.data.reduce(function(t,e,n,r){var i,a,o=null!=(o=null==e?void 0:e.id)?o:n.toString();return t.push(m(m({},e),{id:o,index:n,type:"value",label:null!=(i=null==e?void 0:e.label)?i:e.value.toString(),value:s.ribbonScale.map(e.value)})),n<r.length-1&&(i=r[n+1],a=((i=(r=x([e.value,i.value],2))[0])+(r=r[1]))/2,t.push(m(m({},e),{id:o,index:n,type:"range",range:[i,r],label:[i,r].join("~"),value:s.ribbonScale.map(a)}))),t},[])},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"labelStyle",{get:function(){var t=x(["center","middle"],2),e=t[0],t=t[1],n=this.labelPosition;return"top"===n?t="bottom":"bottom"===n?t="top":"left"===n?e="end":"right"===n&&(e="start"),{labelTextAlign:e,labelTextBaseline:t}},enumerable:!1,configurable:!0}),h.prototype.renderLabel=function(t){var e=tx(this.attributes,"label"),n=e.formatter,r=e.filtrate,i=(e.filter,e.align),a=e.labelDirection,o=(e.tickLength,e.showTick),o=void 0!==o&&o,e=x(ex(J(e,["formatter","filtrate","filter","align","labelDirection","tickLength","showTick"]),["tick"]),2),s=e[0],e=e[1],l=m(m(m({type:"linear",startPos:[0,0],endPos:[0,0],data:this.labelData,showLine:!1,showGrid:!1,showTick:o,tickDirection:a,labelTransform:"rotate(0)"},this.labelStyle),Object.fromEntries(Object.entries(s).map(function(t){var t=x(t,2),e=t[0],t=t[1];return["tick".concat(Nx(e)),t]}))),Object.fromEntries(Object.entries(e).map(function(t){var t=x(t,2),e=t[0],t=t[1];return["label".concat(Nx(e)),t]})));this.label=t.maybeAppendByClassName(s5.label,function(){return new Fk({style:l})}).styles(l),this.label.node().attr({tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!r||r(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===i&&(!r||r(t,t.index,n.filter(function(t){return t.type===i})))},labelFormatter:n})},Object.defineProperty(h.prototype,"labelAxisCfg",{get:function(){var t=this.attributes,e=t.labelDirection,n=t.labelShowTick,t=t.labelSpacing,r=this.ribbonShape.size,i=this.labelPosition,a=this.labelFixedSpacing,o=x([0,0,0],3),s=o[0],l=o[1],o=o[2],c=r+t;return n?(o=c,l=a,"positive"===e?"right"===i?o=s=c:"bottom"===i&&(s=o):"negative"!==e||"top"!==i&&"left"!==i||(s=r)):"positive"===e?"right"===i?l=c:"bottom"===i&&(s=r+a,l=t):"negative"!==e||"left"!==i&&"top"!==i||(l=t),{offset:s,spacing:l,tickLength:o}},enumerable:!1,configurable:!0}),h.prototype.adjustLabel=function(){var t,e,n,r,i,a,o;this.attributes.showLabel&&(o=(a=this.ribbonBBox).x,t=a.y,i=a.width,a=a.height,e=(r=this.labelAxisCfg).offset,n=r.spacing,r=r.tickLength,a=(i=x(this.ifHorizontal([[o,t+e],[o+i,t+e]],[[o+e,t+a],[o+e,t]]),2))[0],o=i[1],this.label.styles({startPos:a,endPos:o,tickLength:r,labelSpacing:n}))},h.prototype.bindEvents=function(){var n=this,t=new Map;t.set("ribbon",this.ribbon),t.set("start",this.startHandle),t.set("end",this.endHandle),t.forEach(function(t,e){null!=t&&t.on("mousedown",n.onDragStart(e)),null!=t&&t.on("touchstart",n.onDragStart(e))}),null!=(t=this.startHandle)&&t.on("mouseover",function(){return n.updateMouse()}),null!=(t=this.endHandle)&&t.on("mouseover",function(){return n.updateMouse()}),this.ribbon.on("mousemove",this.onHovering),this.addEventListener("mouseout",this.hideIndicator)},h.prototype.showIndicator=function(t,e){var n,r,i,a;void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t?(i=(a=this.range).min,a=a.max,n=(r=this.ribbonBBox).x,r=r.y,t=dn(t,i,a),i=this.getOffset(t),a=this.ifHorizontal([i+n,r],[n,i+r]),this.indicator.update({visibility:"visible",position:this.ifHorizontal("top","left"),value:e}),(t=this.indicator.node()).setLocalPosition.apply(t,b([],x(a),!1))):this.hideIndicator()},h.prototype.hideIndicator=function(){var t;null!=(t=this.indicator)&&t.style("visibility","hidden")},h.prototype.updateMouse=function(){this.style.slidable&&(this.style.cursor="grabbing")},h.prototype.setSelection=function(t,e){this.updateSelection(t,e)},h.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=x(this.selection,2),c=l[0],l=l[1],t=x([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=x((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=x(n,2))[0],n=n[1],a=(c=x(c,2))[0],c=c[1],o=(l=x(l,2))[0],l=l[1],c=(a=x([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=x([a,c],2))[0],a=u[1]),n-i<s?[i,n]:c<i?o===i&&l===a?[i,a]:[i,s+i]:n<a?l===n&&o===c?[c,n]:[n-s,n]:[U2(c,r),U2(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(h.prototype,"step",{get:function(){var t=this.attributes.step,t=void 0===t?1:t,e=this.range,n=e.min,e=e.max;return mn(t)?U2(.01*(e-n),0):t},enumerable:!1,configurable:!0}),h.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?g5(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},h.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=x(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,b([],x(ix(t)),!1));return dn(this.getOffset(i-a,!0),r,n)},h.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,n=n.max,i=this.ribbonShape.len,a=this.eventToOffsetScale;return a.update({domain:[r,n],range:[0,i]}),e?a.invert(t):a.map(t)},h.prototype.dispatchSelection=function(){var t=new mo("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},h.prototype.dispatchIndicated=function(t,e){t=new mo("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},t([bx(100)],h.prototype,"dispatchSelection",null),t([bx(100)],h.prototype,"dispatchIndicated",null),h);function h(t){var a=w5.call(this,dx({},o5,t))||this;return a.eventToOffsetScale=new Kv({}),a.innerRibbonScale=new Kv({}),a.cacheLabelBBox=null,a.cacheHandleBBox=null,a.onHovering=function(t){var e=a.attributes,n=e.data,e=e.block,t=(t.stopPropagation(),a.getValueByCanvasPoint(t));e?(e=g5(n.map(function(t){return t.value}),t).range,a.showIndicator((e[0]+e[1])/2,"".concat(e[0],"-").concat(e[1])),a.dispatchIndicated(t,e)):(n=a.getTickValue(t),a.showIndicator(n),a.dispatchIndicated(n))},a.onDragStart=function(e){return function(t){t.stopPropagation(),a.attributes.slidable&&(a.target=e,a.prevValue=a.getTickValue(a.getValueByCanvasPoint(t)),document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseleave",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd))}},a.onDragging=function(t){var e=a.target,n=(a.updateMouse(),x(a.selection,2)),r=n[0],n=n[1],t=a.getTickValue(a.getValueByCanvasPoint(t)),i=t-a.prevValue;"start"===e?r!==t&&a.updateSelection(t,n):"end"===e?n!==t&&a.updateSelection(r,t):"ribbon"===e&&0!=i&&(a.prevValue=t,a.updateSelection(i,i,!0))},a.onDragEnd=function(){a.style.cursor="default",document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("touchmove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a}function A5(t){k5||(k5=document.createElement("table"),M5=document.createElement("tr"),E5=/^\s*<(\w+|!)[^>]*>/,M5={tr:document.createElement("tbody"),tbody:k5,thead:k5,tfoot:k5,td:M5,th:M5,"*":document.createElement("div")});var e=E5.test(t)&&RegExp.$1,e=(e&&e in M5||(e="*"),M5[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}var T5,eo="tooltip",P5="tooltip-title",L5="tooltip-list",ao="tooltip-list-item",n="tooltip-list-item-name",Zl="tooltip-list-item-marker",Jl="tooltip-list-item-name-label",e="tooltip-list-item-value",Kl="tooltip-crosshair-x",Ja="tooltip-crosshair-y",Ql={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"},no=((a={})[".".concat(eo)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},a[".".concat(P5)]={color:"rgba(0, 0, 0, 0.45)"},a[".".concat(L5)]={margin:"0px","list-style-type":"none",padding:"0px"},a[".".concat(ao)]={"list-style-type":"none","margin-top":"12px",display:"flex","line-height":"1em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},a[".".concat(Zl)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},a[".".concat(n)]={display:"flex","align-items":"center","max-width":"216px"},a[".".concat(Jl)]=m({flex:1},Ql),a[".".concat(e)]=m({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Ql),a[".".concat(Kl)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},a[".".concat(Ja)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},a),C5=(Me(N5,T5=$l),Object.defineProperty(N5.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),N5.prototype.getContainer=function(){return this.element},Object.defineProperty(N5.prototype,"position",{set:function(t){var t=x(t,2),e=t[0],t=t[1];this.attr({x:e,y:t}),this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(N5.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(N5.prototype,"items",{get:function(){return this.attributes.items.map(function(t,e){var n=t.name,n=void 0===n?"":n,r=t.value,i=t.color,i=void 0===i?"black":i,a=t.index,t=J(t,["name","value","color","index"]);return m({name:n,value:r,color:i,index:null!=a?a:e},t)})},enumerable:!1,configurable:!0}),Object.defineProperty(N5.prototype,"HTMLTooltipItemsElements",{get:function(){var r=this.attributes.template,i=[];return this.items.forEach(function(t){var e,n;i.push(A5((e=r.item,n=t,e&&n?e.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):e)))}),i},enumerable:!1,configurable:!0}),Object.defineProperty(N5.prototype,"customContent",{get:function(){var t=this.attributes.customContent;return fn(t)?fx(t):bn(t)?t:void 0},enumerable:!1,configurable:!0}),N5.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},N5.prototype.update=function(t){this.attr(Pn({},this.attributes,t)),this.render(this.attributes,this)},N5.prototype.clear=function(){this.element.innerHTML=""},N5.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),null!=(t=this.customContent)&&t.remove()},N5.prototype.show=function(){this.visibility="visible",this.element.style.visibility="visible"},N5.prototype.hide=function(){this.visibility="hidden",this.element.style.visibility="hidden"},N5.prototype.initShape=function(){var t=this.attributes.template;this.element=A5(t.container),this.id&&this.element.setAttribute("id",this.id)},N5.prototype.renderHTMLTooltipElement=function(){var e,r,t=this.attributes,n=t.title,t=t.enterable,i=this.element,a=this.customContent,a=(this.element.style.pointerEvents=t?"auto":"none",this.clear(),a?i.appendChild(a):(t=this.attributes.template,n?(i.innerHTML=t.title,i.getElementsByClassName(P5)[0].innerHTML=n):null!=(t=null==(a=i.getElementsByClassName(P5))?void 0:a[0])&&t.remove(),n=this.HTMLTooltipItemsElements,(e=document.createElement("ul")).className=L5,n.forEach(function(t){e.appendChild(t)}),this.element.appendChild(e)),this.attributes.style);r=i,Object.entries(a).forEach(function(t){var t=x(t,2),e=t[0],n=t[1];b([r],x(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})}),this.element.style.visibility=this.visibility},N5.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=x(l,2),n=e[0],e=e[1],t=x(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},N5.prototype.setOffsetPosition=function(t){var t=x(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat((void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(i+n+t,"px")},N5.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},N5.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=x(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.autoPosition,c=c.bounding;return f?(e=(f=this.element).offsetWidth,f=f.offsetHeight,h=(u=x([u+l,h+t],2))[0],u=u[1],n=this.attributes.position,r={left:"right",right:"left",top:"bottom",bottom:"top"},s=c.x,i=c.y,a={left:h<s,right:s+c.width<h+e,top:u<i,bottom:i+c.height<u+f},o=[],n.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},N5.tag="tooltip",N5.defaultOptions={style:{x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],follow:!0,enterable:!1,autoPosition:!0,items:[],container:{x:0,y:0},bounding:{x:0,y:0,width:0,height:0},template:{container:'<div class="'.concat(eo,'"></div>'),title:'<div class="'.concat(P5,'"></div>'),item:'<li class="'.concat(ao,'" data-index={index}>\n <span class="').concat(n,'">\n <span class="').concat(Zl,'" style="background:{color}"></span>\n <span class="').concat(Jl,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(e,'" title="{value}">{value}</span>\n </li>')},style:no}},t([bx(100)],N5.prototype,"updatePosition",null),N5);function N5(t){t=T5.call(this,Pn({},N5.defaultOptions,t))||this;return t.visibility="visible",t.initShape(),t.render(t.attributes,t),t}var j5,R5={default:{sizeStyle:{width:44,height:22,radius:11},tagStyle:{textStyle:{fontSize:12,lineHeight:16,fill:"#fff"},padding:0},markerStyle:{size:11}},small:{sizeStyle:{width:28,height:16,radius:8},tagStyle:{textStyle:{fontSize:10,lineHeight:14,fill:"#fff"},padding:0},markerStyle:{size:8}},mini:{sizeStyle:{width:20,height:14,radius:7},tagStyle:{textStyle:{fontSize:7,lineHeight:10,fill:"#fff"},padding:0},markerStyle:{size:7}}};function F5(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!0);var r=Number(t.style.height)-2*e;return{x:n?Number(t.style.width)+Number(t.style.x)-e-r:Number(t.style.x)+e,y:Number(t.style.y)+e,width:r,height:r,radius:r/2}}function B5(t){return j5.call(this,Pn({},B5.defaultOptions,t))||this}Me(B5,j5=$l),B5.prototype.render=function(t,e){var i=this,n=t.size,n=void 0===n?"default":n,a=t.spacing,r=t.disabled,o=t.checked,s=t.unCheckedChildren,t=t.checkedChildren,e=T(e).maybeAppendByClassName("switch-content","g").node(),l=e.getLocalBounds(),n=_n(R5,n,R5.default),c=n.sizeStyle,u=n.tagStyle,h=r?"no-drop":"pointer",n=o?"#1890FF":"#00000040",f=c,d=o?t:s,p=((t||s)&&T(e).maybeAppendByClassName("switch-tag",function(){return new Jx({})}).call(function(t){var e,t=t.node(),n=(t.update(Pn({cursor:h,backgroundStyle:null,text:!1,marker:!1},u,d)),null==t?void 0:t.getLocalBounds()),r=n.max,n=n.min,i=r[0]-n[0]+c.radius,r=r[1]-n[1],n=Math.max(i+c.height+2,c.width);f=m(m({},c),{width:n}),t.update((t={x:l.min[0],y:l.min[1],width:n,height:f.height},n={width:i,height:r},i=f.radius,r=o,e=n.width,n=n.height,void 0===i&&(i=0),{x:(r=void 0===o?!0:r)?Number(t.x)+i:Number(t.width)+Number(t.x)-e,y:Number(t.y)+(Number(t.height)-n)/2}))}),T(e).maybeAppendByClassName("switch-background","rect").styles(m({zIndex:(e.style.zIndex||0)-1,x:l.min[0],y:l.min[1],fill:n,cursor:h,fillOpacity:r?.4:1},f)).node()),g=T(e).maybeAppendByClassName("switch-background-stroke","rect").styles(m({zIndex:(e.style.zIndex||0)-2,x:l.min[0],y:l.min[1],stroke:n,lineWidth:0},f)).node();T(e).maybeAppendByClassName("switch-handle","rect").styles({fill:"#fff",cursor:h}).call(function(t){var e,t=t.node(),n=F5(p,a,o),r=F5(p,a,!o);t.attr("x")&&!Ln(n,r)&&i.checked!==o?(t.attr(r),null!=(e=t.getAnimations()[0])&&e.cancel(),null!=(e=g.getAnimations()[0])&&e.cancel(),t.animate([{x:r.x},{x:n.x}],{duration:120,fill:"both"}),g.animate([{lineWidth:0,strokeOpacity:.5},{lineWidth:14,strokeOpacity:0}],{duration:400,easing:"ease-on"})):t.attr(n)}),this.checked=!!o},B5.tag="switch",B5.defaultOptions={style:{x:0,y:0,spacing:2,checked:!0,disabled:!1}};var I5,D5,z5,G5,ro={tagText:"",lineStroke:"#416180",lineStrokeOpacity:.45,lineLineWidth:1,lineLineDash:[5,5]},oo=dx({},ro,{type:"line",tagPosition:"start",tagAlign:"center",tagVerticalAlign:"bottom"}),so=dx({},ro,{type:"circle",defaultRadius:0}),lo=dx({},ro,{type:"polygon",defaultRadius:0,startAngle:0}),co=(Me(W5,I5=$l),Object.defineProperty(W5.prototype,"localPointer",{get:function(){var t=x(this.getPosition(),2),e=t[0],t=t[1],n=x(this.pointer,2);return[n[0]-e,n[1]-t]},enumerable:!1,configurable:!0}),Object.defineProperty(W5.prototype,"tagCfg",{get:function(){var t=tx(this.attributes,"tag");return t.position,J(t,["position"])},enumerable:!1,configurable:!0}),Object.defineProperty(W5.prototype,"crosshairCfg",{get:function(){var t=tx(this.attributes,"line");return m(m({},t),{path:this.crosshairPath})},enumerable:!1,configurable:!0}),W5.prototype.render=function(t,e){var n=this,e=T(e).maybeAppendByClassName(".crosshair-group","g").node();this.shapesGroup=e,this.tagShape=T(e).maybeAppend(".crosshair-tag",function(){return new Jx({className:"crosshair-tag",style:n.tagCfg})}).node(),this.crosshairShape=T(e).maybeAppendByClassName(".crosshair-path","path").node().attr(this.crosshairCfg),this.adjustLayout()},W5.prototype.update=function(t){this.attr(Pn({},this.attributes,t=void 0===t?{}:t)),this.render(this.attributes,this)},W5.prototype.setPointer=function(t){this.pointer=t},W5.tag="crosshair-base",W5.defaultOptions={style:ro},W5);function W5(t){return I5.call(this,Pn({},W5.defaultOptions,t))||this}function H5(t){return D5.call(this,dx({},H5.defaultOptions,t))||this}function V5(t){return z5.call(this,dx({},V5.defaultOptions,t))||this}function Y5(t){return G5.call(this,dx({},Y5.defaultOptions,t))||this}Me(H5,D5=co),Object.defineProperty(H5.prototype,"crosshairPath",{get:function(){var t=this.attributes,e=x(t.startPos,2),n=e[0],e=e[1],t=x(t.endPos,2);return[["M",0,0],["L",t[0]-n,t[1]-e],["Z"]]},enumerable:!1,configurable:!0}),Object.defineProperty(H5.prototype,"localPointer",{get:function(){var t,e,n;return this.pointer?(t=(e=x(this.getPosition(),2))[0],e=e[1],[(n=x(this.pointer,2))[0]-t,n[1]-e]):this.attributes.startPos},enumerable:!1,configurable:!0}),Object.defineProperty(H5.prototype,"isVertical",{get:function(){var t=this.attributes,e=x(t.startPos,2),n=e[0],e=e[1],t=x(t.endPos,2),r=t[0],t=t[1];return n===r&&e!==t},enumerable:!1,configurable:!0}),Object.defineProperty(H5.prototype,"tagShapeSpace",{get:function(){var t=cx(this.tagShape);return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),H5.prototype.update=function(t){D5.prototype.update.call(this,t)},H5.prototype.setPointer=function(t){D5.prototype.setPointer.call(this,t),this.adjustPosition()},H5.prototype.setText=function(t){this.tagShape.update({text:t}),this.adjustTag()},H5.prototype.adjustLayout=function(){this.adjustPosition(),this.adjustTag()},H5.prototype.adjustPosition=function(){var t=x(this.localPointer,2),e=t[0],t=t[1],n=x(this.attributes.startPos,2),r=n[0],n=n[1],r=this.getOrientVal([r,t],[e,n]);this.shapesGroup.setLocalPosition(r)},H5.prototype.adjustTag=function(){var t,e=this.attributes,n=e.tagText,r=e.tagPosition,i=x(e.startPos,2),a=i[0],i=i[1],e=x(e.endPos,2),o=e[0],e=e[1];n&&""!==n?(this.tagShape.show(),t=(n=this.tagShapeSpace).width,n=n.height,a=(o=x(this.getOrientVal({start:[-t/2,n/2],end:[o-a+t/2,n/2]},{start:[0,0],end:[0,e-i+n]})[r],2))[0],t=o[1],this.tagShape.setLocalPosition(a,t)):this.tagShape.hide()},H5.prototype.getOrientVal=function(t,e){return this.isVertical?e:t},H5.tag="line-crosshair",H5.defaultOptions={style:oo},t([bx(20)],H5.prototype,"setPointer",null),Me(V5,z5=co),Object.defineProperty(V5.prototype,"crosshairPath",{get:function(){return this.createCirclePath()},enumerable:!1,configurable:!0}),V5.prototype.update=function(t){z5.prototype.update.call(this,t)},V5.prototype.setPointer=function(t){var t=x(t,2),e=t[0],t=t[1],e=(z5.prototype.setPointer.call(this,[e,t]),x(this.localPointer,2)),t=e[0],e=e[1],n=x(this.attributes.center,2),r=n[0],n=n[1],t=this.createCirclePath(Math.pow(Math.pow(t-r,2)+Math.pow(e-n,2),.5));this.crosshairShape.attr({path:t})},V5.prototype.adjustLayout=function(){this.tagShape.hide()},V5.prototype.createCirclePath=function(t){var e=this.attributes,n=x(e.center,2),r=n[0],n=n[1],e=e.defaultRadius;return Vx(r,n,t||e)},V5.tag="circle-crosshair",V5.defaultOptions={style:so},t([bx(20)],V5.prototype,"setPointer",null),Me(Y5,G5=co),Object.defineProperty(Y5.prototype,"crosshairPath",{get:function(){return this.createPolygonPath()},enumerable:!1,configurable:!0}),Y5.prototype.update=function(t){G5.prototype.update.call(this,t)},Object.defineProperty(Y5.prototype,"points",{get:function(){for(var t,e,n,r,i,a,o=this.attributes,s=o.startAngle,l=o.sides,c=2*Math.PI/l,u=[1,0],h=[],f=0;f<l;f+=1)h.push((t=[0,0],e=u,n=[0,0],r=s/180*Math.PI+c*f,a=i=void 0,i=e[0]-n[0],e=e[1]-n[1],a=Math.sin(r),r=Math.cos(r),t[0]=i*r-e*a+n[0],t[1]=i*a+e*r+n[1],t));return h},enumerable:!1,configurable:!0}),Y5.prototype.setPointer=function(t){var t=x(t,2),e=t[0],t=t[1],e=(G5.prototype.setPointer.call(this,[e,t]),x(this.localPointer,2)),t=e[0],e=e[1],n=this.attributes.center,r=x(this.intersection([t,e]),2),i=r[0],r=r[1];i&&r&&(t=mx(n,[t,e])/mx(n,[i,r]),e=this.createPolygonPath(t),this.crosshairShape.attr({path:e}))},Y5.prototype.adjustLayout=function(){this.tagShape.hide()},Y5.prototype.createPolygonPath=function(r){var t=this.attributes,i=t.defaultRadius,t=x(t.center,2),a=t[0],o=t[1],t=this.points.map(function(t,e){var t=x(t,2),t=x(ye([0,0],[t[0],t[1]],r||i),2),n=t[0],t=t[1];return[0===e?"M":"L",a+n,o+t]});return t.push(["Z"]),t},Y5.prototype.intersection=function(t){for(var e,n,r,i,a,o,s,l,t=x(t,2),c=t[0],u=t[1],h=this.points,t=x(this.attributes.center,2),f=t[0],d=t[1],p=1;p<=h.length;p+=1){var g=x(h[p-1],2),y=g[0],g=g[1],v=x(h[p%h.length],2),m=v[0],v=v[1],y=(i=[f,d],y=[y+f,g+d],g=[m+f,v+d],l=s=o=a=v=m=void 0,v=(r=x(r=[c,u],2))[0],r=r[1],a=(i=x(i,2))[0],i=i[1],o=(y=x(y,2))[0],y=y[1],s=(g=x(g,2))[0],g=g[1],l=[],(g-y)*(a-v)==(i-r)*(s-o)?(i-r)*(o-v)==(y-r)*(a-v)&&(yx(v,a,r,i,o,y)&&vx(l,o,y),yx(v,a,r,i,s,g)&&vx(l,s,g),yx(o,s,y,g,v,r)&&vx(l,v,r),yx(o,s,y,g,a,i))&&vx(l,a,i):(m=(v*(i-r)+y*(a-v)-r*(a-v)-o*(i-r))/((s-o)*(i-r)-(a-v)*(g-y)),0<=(g=(o*(g-y)+r*(s-o)-y*(s-o)-v*(g-y))/((a-v)*(g-y)-(s-o)*(i-r)))&&g<=1&&0<=m&&m<=1&&(l[0]=v+g*(a-v),l[1]=r+g*(i-r))),l);0!==y.length&&(e=(s=x(y,2))[0],n=s[1])}return[e,n]},Y5.tag="polygon-crosshair",Y5.defaultOptions={style:lo},t([bx(20)],Y5.prototype,"setPointer",null);Me($5,q5=Ro),Object.defineProperty($5.prototype,"decorationType",{get:function(){var t=this.attributes.type;return t&&"none"!==t&&an(t)?t.map(function(t){return an(t)?t:[t,"solid"]}):"none"},enumerable:!1,configurable:!0}),Object.defineProperty($5.prototype,"doubleSpacing",{get:function(){return 2*this.attributes.style.lineWidth},enumerable:!1,configurable:!0}),Object.defineProperty($5.prototype,"hangingRate",{get:function(){return this.attributes.hangingRate},enumerable:!1,configurable:!0}),Object.defineProperty($5.prototype,"dashedCfg",{get:function(){var t=this.attributes.style.lineWidth;return{lineDash:[2*t,t]}},enumerable:!1,configurable:!0}),Object.defineProperty($5.prototype,"dottedCfg",{get:function(){var t=this.attributes.style.lineWidth;return{lineDash:[t,t]}},enumerable:!1,configurable:!0}),Object.defineProperty($5.prototype,"solidCfg",{get:function(){return{lineDash:[0,0]}},enumerable:!1,configurable:!0}),Object.defineProperty($5.prototype,"decorationCfg",{get:function(){var r=this,i=this.attributes.style,t=this.decorationType;return"none"===t?[]:t.map(function(t){var e,t=x(t,2),n=t[0],t=t[1];return"wavy"===t?m({path:r.getWavyPath(n)},i):"double"===t?m({path:r.getDoubleLinePath(n)},i):(e={solid:r.solidCfg,dashed:r.dashedCfg,dotted:r.dottedCfg},m(m({path:r.getLinePath(n)},i),e[t]))})},enumerable:!1,configurable:!0}),$5.prototype.update=function(t){var e=this;this.attr(dx({},this.attributes,t)),this.clear(),this.decorationCfg.forEach(function(t){e.appendChild(new Qo({style:t}))})},$5.prototype.clear=function(){this.removeChildren()},$5.prototype.getLinePos=function(t){var e=x(this.hangingRate,3),n=e[0],r=e[1],e=e[2],i=this.attributes,a=i.height,i=i.fontSize,o=x([0,0],2),s=o[0],o=o[1],o=("overline"===t?(s=(n=x([0,a*n-i/2],2))[0],n):"line-through"===t?(s=(n=x([0,a*r],2))[0],n):(s=(t=x([0,a*e+i/2],2))[0],t))[1];return[s,o]},$5.prototype.getLinePath=function(t){var e=this.attributes.width,t=x(this.getLinePos(t),2),n=t[0],t=t[1];return[["M",n,t],["L",n+e,t]]},$5.prototype.getDoubleLinePath=function(t){var e,n=this.doubleSpacing,r=this.attributes.width,i=x(this.getLinePos(t),2),a=i[0],i=i[1],o=x([0,0],2),s=o[0],o=o[1];return"line-through"===t&&(s=(e=x([-.5,.5],2))[0],o=e[1]),"underline"===t?(s=(e=x([0,1],2))[0],o=e[1]):"overline"===t&&(s=(e=x([1,0],2))[0],o=e[1]),[["M",a,i+n*s],["L",a+r,i+n*s],["M",a,i+n*o],["L",a+r,i+n*o]]},$5.prototype.getWavyPath=function(t){return[]},$5.tag="decoration",$5.defaultOptions={style:{width:0,height:0,type:"none",hangingRate:[.5,.55,.5],style:{lineWidth:1,stroke:"#000"}}};var q5,U5,X5=$5;function $5(t){t=q5.call(this,dx({},$5.defaultOptions,t))||this;return t.update({}),t}function K5(t){t=U5.call(this,dx({},K5.defaultOptions,t))||this;return t.init(),t}Me(K5,U5=$l),Object.defineProperty(K5.prototype,"textWidth",{get:function(){var e=this;return un(this.renderText.split("\n").map(function(t){return V2(t,e.font)}))||0},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"textHeight",{get:function(){return cx(this.textShape).height},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"width",{get:function(){var t=this.attributes.width;return"auto"===t||void 0===t||0===t?this.textWidth:t},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"height",{get:function(){var t=this.attributes.height;return pn(t)&&0!==t?t:cx(this.textShape).height},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"lineHeight",{get:function(){var t=this.attributes,e=t.lineHeight,t=t.fontSize;return e&&0!==e?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"capitalizeWord",{get:function(){return this.attributes.text.split("\n").map(function(t){return t.split(" ").map(function(t){return q2(t,"capitalize")}).join(" ")}).join("\n")},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"text",{get:function(){var t=this.attributes,e=t.transform,t=t.text;return"capitalize"===e?this.capitalizeWord:q2(t,e)},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"ellipsisText",{get:function(){var e=this,t=this.text,n=this.attributes,r=n.width,n=n.overflow,i="ellipsis"===n?"...":n;return t.split("\n").map(function(t){return H2(t,pn(r)?r:1/0,e.font,i)}).join("\n")},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"renderText",{get:function(){var t=this.attributes.width,e=this.attributes.overflow;return e&&!["none","clip","wrap"].includes(e)&&pn(t)?this.ellipsisText:this.text},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"verticalAlign",{get:function(){return this.attributes.verticalAlign},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"font",{get:function(){return An(this.attributes,["fontSize","fontFamily","fontWeight","fontStyle","fontVariant","letterSpacing","leading"])},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"fontColor",{get:function(){return this.attributes.fontColor},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"wordWrap",{get:function(){return"wrap"===this.attributes.overflow},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"wordWrapWidth",{get:function(){var t=this.width;return this.wordWrap?t:1/0},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"textCfg",{get:function(){var t=this.renderText,e=this.lineHeight,n=this.wordWrap,r=this.wordWrapWidth,i=this.fontColor;return m(m(m({},Z2),this.font),{fill:i,wordWrap:n,lineHeight:e,wordWrapWidth:r,text:t,textAlign:"start",textBaseline:"middle"})},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"backgroundCfg",{get:function(){var t=this.width,e=this.height,n=this.attributes.backgroundStyle;return m({x:0,y:0,width:t,height:e},n)},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"decorationLineWidth",{get:function(){var t=this.attributes.fontSize;return Math.floor(2*Math.log10(t))},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"decorationCfg",{get:function(){var t=this.attributes,e=t.decoration,n=t.fontSize,r=this.decorationLineWidth,i=this.fontColor;return this.textShape.getLineBoundingRects().map(function(t){return dx({},{fontSize:n,style:{stroke:i,lineWidth:r}},e,t)})},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"clipRectCfg",{get:function(){var t=this.height;return{width:this.attributes.width,height:t}},enumerable:!1,configurable:!0}),K5.prototype.init=function(){this.initShape(),this.update({})},K5.prototype.update=function(t){this.attr(dx({},this.attributes,t)),this.render()},K5.prototype.render=function(){var e=this;this.clear(),this.backgroundShape.attr(this.backgroundCfg),this.textShape.attr(this.textCfg),this.layout(),this.decorationGroup.removeChildren(),this.decorationCfg.forEach(function(t){e.decorationGroup.appendChild(new X5({style:t}))})},K5.prototype.clear=function(){var t;(this.backgroundShape.style.clipPath=null)!=(t=this.clipRect)&&t.destroy()},K5.prototype.initShape=function(){this.backgroundShape=new as({name:"background",style:{width:0,height:0}}),this.decorationGroup=new Yo({name:"decoration-group"}),this.textShape=new ss({name:"text",style:this.textCfg}),this.textShape.appendChild(this.decorationGroup),this.backgroundShape.appendChild(this.textShape),this.appendChild(this.backgroundShape)},K5.prototype.overflow=function(){var t=this.wordWrap,e=this.attributes,n=e.width,e=e.overflow;e&&"none"!==e&&!t&&pn(n)&&"clip"===e&&(this.clipRect=new as({name:"clip-rect",style:this.clipRectCfg}),this.backgroundShape.style.clipPath=this.clipRect,this.backgroundShape.appendChild(this.clipRect))},K5.prototype.adjustTextAlign=function(){var t=this.textWidth,e=this.attributes,n=e.width,e=e.textAlign;pn(n)&&(n=0,n="start"===e?0:"center"===e?(this.width-t)/2:this.width-t,this.textShape.attr({x:n}))},K5.prototype.adjustVerticalAlign=function(){var t=this.verticalAlign,e=this.textHeight,n=0,n="top"===t?e/2:"middle"===t?this.height/2:this.height-e/2;this.textShape.attr({y:n})},K5.prototype.layout=function(){this.adjustTextAlign(),this.adjustVerticalAlign(),this.overflow()},K5.tag="paragraph",K5.defaultOptions={style:{text:"",fontColor:"#000",fontFamily:"sans-serif",fontSize:12,fontWeight:"normal",fontVariant:"normal",letterSpacing:0,leading:0,fontStyle:"normal",decoration:{type:"none",style:{}},overflow:"none",backgroundStyle:{},transform:"none",tooltip:!1,tooltipWait:300}};var Z5,uo=m(m({},Z2),{fill:"rgba(0,0,0,0.45)",fontSize:10,textAlign:"start",textBaseline:"middle",overflow:"clip"}),J5={default:{width:12,height:12,radius:2,stroke:"#dadada",lineWidth:1,fill:"#ffffff",cursor:"pointer"},selected:{width:12,height:12,radius:2,stroke:"#3471F9",lineWidth:1,fill:"#3471F9",cursor:"pointer"}},Q5={path:[["M",3,6],["L","5","8.5"],["L","8.5","4"]],lineWidth:1,cursor:"pointer"};function tE(t){return Z5.call(this,Pn({},tE.defaultOptions,t))||this}Me(tE,Z5=$l),tE.prototype.render=function(t,e){var n=t.label,r=t.boxStyle,i=t.checkedStyle,a=t.checked,t=t.spacing,a=(this.checked=!!a,lx(e,".checkbox-content","g").attr("className","checkbox-content").node()),e=wn({},this.checked?J5.selected:J5.default,r),r=wn({},Q5,i),t=(this.checkboxBoxShape=lx(a,".checkbox-box","rect").styles(m({className:"checkbox-box",zIndex:(a.style.zIndex||0)-1},e)).node(),lx(this.checkboxBoxShape,".checkbox-checked","path").styles(m({className:"checkbox-box-checked",stroke:"#fff"},r)),i=this.checkboxBoxShape,e=Number(t),{x:(r=i.getLocalBounds()).halfExtents[0]?r.max[0]+(e||0):i.style.x,y:r.halfExtents[1]?(r.min[1]+r.max[1])/2:i.style.y}),e=t.x,r=t.y;lx(a,".checkbox-label","text").styles(m({className:"checkbox-label",x:e,y:r},n))},tE.tag="checkbox",tE.defaultOptions={style:{x:0,y:0,label:m({text:""},uo),spacing:4,checked:!1}};var eE="gui-poptip",nE="gui-poptip-arrow",rE="gui-poptip-text",iE=((o={})[".".concat(eE)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},o[".".concat(rE)]={"text-align":"center"},o[".".concat(eE,"[data-position='top']")]={transform:"translate(-50%, -100%)"},o[".".concat(eE,"[data-position='left']")]={transform:"translate(-100%, -50%)"},o[".".concat(eE,"[data-position='right']")]={transform:"translate(0, -50%)"},o[".".concat(eE,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},o[".".concat(eE,"[data-position='top-left']")]={transform:"translate(0,-100%)"},o[".".concat(eE,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},o[".".concat(eE,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},o[".".concat(eE,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},o[".".concat(eE,"[data-position='right-top']")]={transform:"translate(0, 0)"},o[".".concat(eE,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},o[".".concat(eE,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},o[".".concat(eE,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},o[".".concat(nE)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},o[".".concat(eE,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},o["[data-position='top'] .".concat(nE)]={bottom:"-2px"},o[".".concat(eE,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},o["[data-position='left'] .".concat(nE)]={right:"-2px"},o[".".concat(eE,"[data-position='right']")]={transform:"translate(5px, -50%)"},o["[data-position='right'] .".concat(nE)]={left:"-2px"},o[".".concat(eE,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},o["[data-position='bottom'] .".concat(nE)]={top:"-2px"},o[".".concat(eE,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},o["[data-position='top-left'] .".concat(nE)]={left:"10px",bottom:"-2px"},o[".".concat(eE,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},o["[data-position='top-right'] .".concat(nE)]={right:"10px",bottom:"-2px"},o[".".concat(eE,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},o["[data-position='left-top'] .".concat(nE)]={right:"-2px",top:"8px"},o[".".concat(eE,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},o["[data-position='left-bottom'] .".concat(nE)]={right:"-2px",bottom:"8px"},o[".".concat(eE,"[data-position='right-top']")]={transform:"translate(5px, 0)"},o["[data-position='right-top'] .".concat(nE)]={left:"-2px",top:"8px"},o[".".concat(eE,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},o["[data-position='right-bottom'] .".concat(nE)]={left:"-2px",bottom:"8px"},o[".".concat(eE,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},o["[data-position='bottom-left'] .".concat(nE)]={top:"-2px",left:"8px"},o[".".concat(eE,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},o["[data-position='bottom-right'] .".concat(nE)]={top:"-2px",right:"8px"},o),aE=void 0;var oE;function sE(t){var e=t&&document.getElementById(t);return e||((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),e}function lE(t){var n,r;return n=sE,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r=r||n.apply(aE,t)}(t)}function cE(t){t=oE.call(this,Pn({style:{id:"gui-poptip"}},cE.defaultOptions,t))||this;return t.visibility="visible",t.map=new Map,t.domStyles="",t.initShape(),t.render(t.attributes,t),t}Me(cE,oE=$l),Object.defineProperty(cE.prototype,"visible",{get:function(){return"visible"===this.visibility},enumerable:!1,configurable:!0}),cE.prototype.render=function(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()},cE.prototype.update=function(t){this.attr(Pn({},this.style,t)),this.render(this.attributes,this)},cE.prototype.bind=function(s,l){var c,t,e,u=this;s&&(c=this.style.text,e=function(){u.hideTip()},s.addEventListener("mousemove",t=function(t){var e=s,n=u.style,r=c,i=(l&&(o=(i="function"==typeof l?l.call(null,t):l).html,a=i.target,i=J(i,["html","target"]),n=wn({},u.style,i),!a&&!1!==a||(e=a),"string"==typeof o)&&(r=o),n.position),a=n.arrowPointAtCenter,o=n.follow,n=n.offset;e?(e=(t=x(function(t,e,n,r,i,a){if(void 0===i&&(i=!1),a=void 0===a?!1:a)return[t,e];var o=(a=n.getBoundingClientRect()).x,s=a.y,l=a.width,c=a.height;switch(r){case"top":return i?[o+l/2,s]:[t,s];case"left":return i?[o,s+c/2]:[o,e];case"bottom":return i?[o+l/2,s+c]:[t,s+c];case"right":return i?[o+l,s+c/2]:[o+l,e];case"top-right":case"right-top":return[o+l,s];case"left-bottom":case"bottom-left":return[o,s+c];case"right-bottom":case"bottom-right":return[o+l,s+c];default:return[o,s]}}(t.clientX,t.clientY,e,i,a,o),2))[0],a=t[1],u.showTip(e,a,{text:r,position:i,offset:n})):u.hideTip()}),s.addEventListener("mouseleave",e),this.map.set(s,[t,e]))},cE.prototype.unbind=function(t){var e,n;this.map.has(t)&&(e=(n=x(this.map.get(t)||[],2))[0],n=n[1],e&&t.removeEventListener("mousemove",e),n&&t.removeEventListener("mouseleave",n),this.map.delete(t))},cE.prototype.clear=function(){this.container.innerHTML=""},cE.prototype.destroy=function(){var t,e=this;b([],x(this.map.keys()),!1).forEach(function(t){return e.unbind(t)}),null!=(t=this.container)&&t.remove()},cE.prototype.showTip=function(t,e,n){var r,i=_n(n,"text");i&&"string"!=typeof i||(this.applyStyles(),t&&e&&n&&(r=n.offset,(n=n.position)&&this.container.setAttribute("data-position",n),this.setOffsetPosition(t,e,r),"string"==typeof i&&(n=this.container.querySelector(".".concat(rE)))&&(n.innerHTML=i),this.visibility="visible",this.container.style.visibility="visible"))},cE.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},cE.prototype.getContainer=function(){return this.container},cE.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(eE).concat(t?" ".concat(t):"")},cE.prototype.initShape=function(){var t=this,e=this.style.id;this.container=lE(e),this.container.setAttribute("class",this.getClassName()),this.container.addEventListener("mousemove",function(){return t.showTip()}),this.container.addEventListener("mouseleave",function(){return t.hideTip()})},cE.prototype.updatePoptipElement=function(){var t=this.container,e=(this.clear(),this.style),n=e.id,r=e.template,e=e.text,n=(this.container.setAttribute("id",n),this.container.setAttribute("class",this.getClassName()),'<span class="'.concat(nE,'"></span>'));t.innerHTML=n,fn(r)?t.innerHTML+=r:r&&bn(r)&&t.appendChild(r),e&&(t.getElementsByClassName(rE)[0].textContent=e),this.applyStyles(),this.container.style.visibility=this.visibility},cE.prototype.applyStyles=function(){var t,e=dx({},iE,this.style.domStyles),e=Object.entries(e).reduce(function(t,e){var e=x(e,2),n=e[0],e=e[1],e=Object.entries(e).reduce(function(t,e){var e=x(e,2),n=e[0],e=e[1];return"".concat(t).concat(n,": ").concat(e,";")},"");return"".concat(t).concat(n,"{").concat(e,"}")},"");this.domStyles!==e&&(this.domStyles=e,(t=this.container.querySelector("style"))&&this.container.removeChild(t),(t=document.createElement("style")).innerHTML=e,this.container.appendChild(t))},cE.prototype.setOffsetPosition=function(t,e,n){var n=x(n=void 0===n?this.style.offset:n,2),r=n[0],n=n[1],n=void 0===n?0:n;this.container.style.left="".concat(t+(void 0===r?0:r),"px"),this.container.style.top="".concat(e+n,"px")},cE.tag="poptip",cE.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:iE,template:'<div class="'.concat(rE,'"></div>')}};Me(hE,uE=Yo),Object.defineProperty(hE.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=X2(t)},enumerable:!1,configurable:!0}),Object.defineProperty(hE.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=X2(t)},enumerable:!1,configurable:!0}),hE.prototype.getBBox=function(){var t=this.attributes,e=t.x,e=void 0===e?0:e,n=t.y,n=void 0===n?0:n,r=t.width,t=t.height,i=x(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new Rx(e-i,n-a,r+i+o,t+a+s)},hE.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,uE.prototype.appendChild.call(this,t,e),t},hE.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=x(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=x(this.$margin,4),s=o[0],o=o[3];return new Rx(n+o,r+s,e-n-i,t-r-a)},hE.prototype.layout=function(){var t,e,n,r;if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{t=this.getAvailableSpace(),e=this.children.map(function(t){return t.getBBox()}),n=this.attributes;var i=0!==e.length&&(null==(r=n.display in(r={flex:Ix,grid:Dx})?r[n.display]:null)?void 0:r.call(null,t,e,n))||[];this.children.forEach(function(t,e){var e=i[e],n=e.x,e=e.y;t.attr({x:n,y:e})})}catch(t){}},hE.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},hE.prototype.destroy=function(){this.removeAllEventListeners()},hE.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=e:"padding"===t&&(this.padding=e),this.layout()};var uE,ho=hE;function hE(t){var e=uE.call(this,t)||this,t=(e.layoutEvents=[w.BOUNDS_CHANGED,w.INSERTED,w.REMOVED],e.$margin=X2(0),e.$padding=X2(0),t.style||{}),n=t.margin,t=t.padding,t=void 0===t?0:t;return e.margin=void 0===n?0:n,e.padding=t,e.isMutationObserved=!0,e.bindEvents(),e}function fE(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0<t&&(i=t),n<0&&(i=n),0<e&&(a=e),r<0&&(a=r),[i,a]}(r);if(t===a&&i===o)return pb()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[0,0]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=Bb(l,t),t=Bb(t,i),i=Bb(i,l),0<(Math.pow(e,2)+Math.pow(t,2)-Math.pow(i,2))/(2*e*t)&&(a=(()=>{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]<c[0]?Math.min(e[0],n):Math.max(t[0],n)})(),s.splice(1,1,[a,0])),pb()(s)}const dE=c2(t=>{var e=t.attributes,{x:n,y:r,x0:i=n,y0:a=r,background:o,connector:s,startMarker:l,endMarker:c,coordCenter:u}=e,e=J(e,["class","transform","rotate","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]),h=Q(e,"background"),f=h["padding"],h=J(h,["padding"]),d=Q(e,"connector"),{points:p=[]}=d,d=J(d,["points"]),i=[[+i,+a],[+n,+r]],a=tt(t).maybeAppend("text","text").call(A,e).node(),n=fE(tt(t).maybeAppend("background","rect").style("zIndex",-1).call(A,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(a,f)).call(A,o?h:{}).node(),i,p,u),r=l&&new $x({id:"startMarker",style:Object.assign({x:0,y:0},Q(e,"startMarker"))}),a=c&&new $x({id:"endMarker",style:Object.assign({x:0,y:0},Q(e,"endMarker"))});tt(t).maybeAppend("connector","path").style("path",n).style("markerStart",r).style("markerEnd",a).call(A,s?d:{})}),pE=t=>{const l=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=J(Qb(r,i,a,o),[]),{color:i,text:a="",fontSize:o,rotate:e=0,transform:s=""}=e,a={text:String(a),stroke:i,fill:i,fontSize:o},[[i,o]]=t;return tt(new dE).style("x",i).style("y",o).call(A,r).style("transform",s+`rotate(${+e}deg)`).style("coordCenter",n.getCenter()).call(A,a).call(A,l).node()}};pE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gE=c2(t=>{var e=J(t.attributes,["class","x","y"]);const n=Q(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(tt(t).maybeAppend("marker",()=>new $x({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());tt(t).maybeAppend("text","text").style("x",i).style("y",a).call(A,e)}),yE=t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o,text:r=""}=e,e={text:String(r),stroke:o||i,fill:o||i},[[r,o]]=t;return tt(new gE).call(A,a).style("x",r).style("y",o).call(A,e).call(A,s).node()}},vE=(yE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},c2(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;tt(t).maybeAppend("connect-path",()=>new Qo({})).style("d",n).call(A,i),tt(t).maybeAppend("area-path",()=>new Qo({})).style("d",e).call(A,r)}));const mE=t=>{const{curve:u,gradient:l=!1,defined:h=t=>!Number.isNaN(t)&&null!=t,connectNulls:f=!1}=t,d=J(t,["curve","gradient","defined","connectNulls"]);return(t,e,c,n)=>{var{mark:r,shape:i,defaultShape:a}=e,n=Qb(n,r,i,a),r=n["defaultColor"],i=J(n,["defaultColor"]),{color:a=r,seriesColor:n,seriesX:r,seriesY:o}=e,e=e2(c,e),n=l&&n?Kb(n,r,o,l):a;const s=Object.assign(Object.assign(Object.assign(Object.assign({},i),{stroke:n,fill:n}),e&&{transform:e}),d);var[r,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t<l;t++){var c,u,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,h),a=Q(s,"connect"),i=!!o.length,n=t=>tt(new Qo({})).style("d",t).call(A,s).node();return y0(c)?(e=t=>{const n=c.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=gb().curve(yb),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return bb(a())},delete t.lineX0,t.lineEndAngle=function(){return bb(o())},delete t.lineX1,t.lineInnerRadius=function(){return bb(s())},delete t.lineY0,t.lineOuterRadius=function(){return bb(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(mb(t)):e()._curve},t.angle((t,e)=>Db(Fb(r[e],n))).outerRadius((t,e)=>Bb(r[e],n)).innerRadius((t,e)=>Bb(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(h)).curve(u)(i);var e,a,o,s,l},!i||f&&!Object.keys(a).length?n(e(r)):i&&!f?n(e(t)):tt(new vE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(g0(c)?gb().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(h)):gb().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(h))).curve(u)(n)},!i||f&&!Object.keys(a).length?n(e(r)):i&&!f?n(e(t)):tt(new vE).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},bE=(mE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=y0(n)?Pb:hb;return mE(Object.assign({curve:i},a))(t,e,n,r)}),xE=(bE.props=Object.assign({},mE.props),t=>{const{alpha:a=.5}=t,o=J(t,["alpha"]);return(t,e,n,r)=>{var i=y0(n)?Ab:Sb;return mE(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),wE=(xE.props=Object.assign({},mE.props),i=>(t,e,n,r)=>mE(Object.assign({curve:Cb},i))(t,e,n,r)),kE=(wE.props=Object.assign({},mE.props),i=>(t,e,n,r)=>mE(Object.assign({curve:Nb},i))(t,e,n,r)),EE=(kE.props=Object.assign({},mE.props),i=>(t,e,n,r)=>mE(Object.assign({curve:jb},i))(t,e,n,r)),ME=(EE.props=Object.assign({},mE.props),t=>{const l=t["arrowSize"],c=J(t,["arrowSize"]);return(t,e,n,r)=>{var i,{mark:a,shape:o,defaultShape:s}=e,r=Qb(r,a,o,s),a=r["defaultColor"],o=J(r,["defaultColor"]),{color:s=a,transform:r}=e,[e,a]=t,t=tb();return t.moveTo(...e),t.lineTo(...a),l&&([e,i]=Xb(e,a,{arrowSize:l}),t.moveTo(...a),t.lineTo(...e),t.moveTo(...a),t.lineTo(...i)),tt(new Qo).call(A,o).style("d",t.toString()).style("stroke",s).style("transform",r).call(A,c).node()}}),OE=(ME.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=tb();return t.moveTo(e[0],e[1]),t.bezierCurveTo(e[0]/2+i[0]/2,e[1],e[0]/2+i[0]/2,i[1],i[0],i[1]),tt(new Qo).call(A,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(A,s).node()}});OE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const SE=t=>{const{cornerRatio:u=1/3}=t,h=J(t,["cornerRatio"]);return(t,e,n,r)=>{var i,a,{mark:o,shape:s,defaultShape:l}=e,r=Qb(r,o,s,l),o=r["defaultColor"],s=J(r,["defaultColor"]),{color:l=o,transform:r}=e,[e,o]=t,c=(t=e,e=o,o=n,n=u,a=tb(),y0(o)?(i=Bb(t,c=o.getCenter()),i=(Bb(e,c)-i)*n+i,a.moveTo(t[0],t[1]),$b(a,t,e,c,i)):g0(o)?(a.moveTo(t[0],t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,e[1])):(a.moveTo(t[0],t[1]),a.lineTo(t[0],t[1]+(e[1]-t[1])*n),a.lineTo(e[0],t[1]+(e[1]-t[1])*n)),a.lineTo(e[0],e[1]),a);return tt(new Qo).call(A,s).style("d",c.toString()).style("stroke",l).style("transform",r).call(A,h).node()}},_E=(SE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=tb();return t.moveTo(e[0],e[1]),y0(n)?(n=n.getCenter(),t.quadraticCurveTo(n[0],n[1],i[0],i[1])):$b(t,e,i,Wb(e,i),Bb(e,i)/2),tt(new Qo).call(A,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(A,s).node()}}),AE=(_E.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const u=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),i=r["defaultColor"],a=J(r,["defaultColor"]),{color:o=i,src:r="",size:e=32,transform:i=""}=e,{width:s=e,height:l=e}=u,[[t,c]]=t,t=t-Number(s)/2,s=c-Number(l)/2;return tt(new $o).call(A,a).style("x",t).style("y",s).style("width",e).style("height",e).style("img",r).style("stroke",o).style("transform",i).call(A,u).node()}});AE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const TE=t=>{const l=J(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=Qb(r,e,i,a),e=r["defaultColor"],i=J(r,["defaultColor"]),a=function(i,t){const a=tb();if(y0(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>Bb(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?$b(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,n);return tt(new Qo).call(A,i).style("d",a.toString()).style("stroke",o||e).style("fill",o||e).style("transform",s).call(A,l).node()}};TE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const PE=t=>{const l=J(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=Qb(r,e,i,a),e=r["defaultColor"],i=J(r,["defaultColor"]),a=function(t,e){var n,[t,r,i,a]=t,o=tb();return y0(e)?(n=Bb(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),$b(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),$b(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(t[0],t[1]),o.closePath()),o}(t,n);return tt(new Qo).call(A,i).style("d",a.toString()).style("fill",o||e).style("stroke",o||e).style("transform",s).call(A,l).node()}};PE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const LE=t=>{const y=J(t,[]);return(t,e,n,r)=>{var i,a,o,s,l,c,u,{mark:e,shape:h,defaultShape:f,color:d,transform:p}=e,r=Qb(r,e,h,f),{defaultColor:e,fill:h=e,stroke:f=e}=r,e=J(r,["defaultColor","fill","stroke"]),g=(r=t,t=n,n=tb(),y0(t)?([i,a]=t=t.getCenter(),o=Ib(Fb(r[0],t)),s=Ib(Fb(r[1],t)),g=Bb(t,r[2]),l=Bb(t,r[3]),c=Bb(t,r[8]),u=Bb(t,r[10]),t=Bb(t,r[11]),n.moveTo(...r[0]),n.arc(i,a,g,o,s),n.arc(i,a,g,s,o,!0),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.arc(i,a,l,o,s),n.lineTo(...r[6]),n.arc(i,a,u,s,o,!0),n.closePath(),n.moveTo(...r[8]),n.arc(i,a,c,o,s),n.arc(i,a,c,s,o,!0),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.arc(i,a,t,o,s),n.arc(i,a,t,s,o,!0)):(n.moveTo(...r[0]),n.lineTo(...r[1]),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.lineTo(...r[5]),n.lineTo(...r[6]),n.lineTo(...r[7]),n.closePath(),n.moveTo(...r[8]),n.lineTo(...r[9]),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.lineTo(...r[13])),n);return tt(new Qo).call(A,e).style("d",g.toString()).style("stroke",f).style("fill",d||h).style("transform",p).call(A,y).node()}};LE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CE=t=>{const s=J(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=J(r,["defaultColor","lineWidth"]),{color:r=i,size:i=a}=e,t=(a=t,y0(t=n)?(t=t.getCenter(),lb()({startAngle:0,endAngle:2*Math.PI,outerRadius:Bb(a[0],t),innerRadius:Bb(a[1],t)})):pb().x(t=>t[0]).y(t=>t[1])(a)),a=(a=n,n=e.transform,y0(a)?([a,e]=a.getCenter(),`translate(${a}, ${e}) `+(n||"")):n);return tt(new Qo({})).call(A,o).style("d",t).style("stroke",r).style("lineWidth",i).style("transform",a).call(A,s).node()}};function NE(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}CE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jE=c2(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=J(e,["points","class","endMarker","direction"]),i=Q(e,"endMarker"),n=(n=n,pb().x(t=>t[0]).y(t=>t[1])(n));tt(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new $x({className:"marker",style:Object.assign(Object.assign({},i),{symbol:NE})}):null).call(A,e)});const RE=t=>{const{offset:s=0,connectLength1:l}=t,c=J(t,["offset","connectLength1"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=Qb(r,i,a,o),{defaultColor:i,connectLength1:a=l}=r,o=J(r,["defaultColor","connectLength1"]),{color:r,transform:e}=e,n=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(g0(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(n,t,s,a);return tt(new jE).call(A,o).style("points",n).style("stroke",r||i).style("transform",e).call(A,c).node()}};function FE(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=fg(a.x,c),i=fg(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function BE(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:h}=Jb(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=DE(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?IE(s,f,n):Wb(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function IE(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function DE(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function zE(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Jb(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:DE(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=IE(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function GE(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function WE(t,e,n,r){var i=n["bounds"];return 1===i.length?GE(0,0,n):(v0(r)?BE:w0(r)?zE:FE)(t,e,n,r)}function HE(t,e,n){var{innerRadius:n,outerRadius:t}=Jb(n,t,[e.y,e.y1]);return n+(t-n)}function VE(t,e,n){var{startAngle:n,endAngle:t}=Jb(n,t,[e.y,e.y1]);return(n+t)/2}function YE(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,h=r.getCenter(),f=VE(e,n,r),d=0<Math.sin(f)?1:-1,i=DE(f,i,a),a={textAlign:0<d||v0(r)?"start":"end",textBaseline:"middle",rotate:i},i=HE(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=IE(t,e,n),[t,r]=IE(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}RE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var qE=Object.freeze({__proto__:null,area:function(t,e,n,r){var i=e.length/2;const a=e.slice(0,i),o=e.slice(i);var e=r0(a,(t,e)=>Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=Ib(Fb(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l}deg)`,textAlign:"center",textBaseline:"middle"}},bottom:WE,bottomLeft:WE,bottomRight:WE,inside:WE,left:WE,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?GE(0,0,n):(v0(r)?BE:w0(r)?YE:FE)(t,e,n,r)},right:WE,spider:function(t,e,n,r){var i,a,o,s,l,c;return w0(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=J(YE(0,e,n,r),[]),s=r.getCenter(),l=HE(e,n,r),e=VE(e,n,r),n=l+c+i,r=0<Math.sin(e)?1:-1,l=o["x"],c=s[0]+(n+ +a)*r-l,o.x+=c,o.connectorPoints[0][0]-=c,o):{}},surround:function(t,e,n,r){var i,a,o,s,l;return w0(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=J(YE(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(w0(t)){var[e,n]=t.getSize(),t=t.getOptions().transformations.find(t=>"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=Db([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=IE(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:WE,topLeft:WE,topRight:WE});function UE(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:w0(o)?"inside":g0(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=qE[a.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const XE=o=>(t,e,n,r)=>{var i=e["text"],a=J(e,["text","x","y"]),t=UE(t,e,n,r,o),{rotate:e=0,transform:r=""}=t,t=J(t,["rotate","transform"]);return tt(new dE).call(A,t).style("text",""+i).style("transform",r+`rotate(${+e}deg)`).style("coordCenter",n.getCenter()).call(A,a).node()},$E=(XE.props={},t=>{const s=t["colorAttribute"],l=J(t,["arrow","colorAttribute"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=J(Qb(r,i,a,o),["stroke"]),{d:i,color:a}=e;return tt(new Qo).call(A,r).style("d",i).style(s,a).call(A,l).node()}}),KE=($E.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>$E(Object.assign({colorAttribute:"fill"},t))),ZE=(KE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>$E(Object.assign({fill:"none",colorAttribute:"stroke"},t))),JE=(ZE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const a=t["render"],o=J(t,["render"]);return(t,e,n,r)=>{var[[t,i]]=t;return a(Object.assign(Object.assign({},o),{x:t,y:i}))}}),QE=(JE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),tM=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:QE.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:QE.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:QE.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:QE.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:QE.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:QE.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:QE.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:QE.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:QE.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:QE.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:QE.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:QE.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{titleFill:QE.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,lineStroke:QE.BLACK,lineStrokeOpacity:.45,lineLineWidth:.5,lineArrow:null,tickStroke:QE.BLACK,tickStrokeOpacity:.25,tickLineWidth:1,tickLength:4,labelFill:QE.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,labelAlign:"horizontal",gridStroke:QE.BLACK,gridStrokeOpacity:.05,gridLineWidth:.5,gridLineDash:[0,0],titleTransformOrigin:"center"},axisTop:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:8,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisBottom:{titleSpacing:10,titleTextBaseline:"bottom",labelSpacing:12,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisLeft:{titleTextBaseline:"middle",titleSpacing:10,titlePosition:"left",titleTransformOrigin:"center",titleTransform:"translate(50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"positive",labelAutoRotate:!1,tickDirection:"positive",gridDirection:"negative"},axisRight:{titleTextBaseline:"top",titleSpacing:0,titlePosition:"right",titleTransformOrigin:"center",titleTransform:"translate(-50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisLinear:{titlePosition:"top",titleSpacing:0,gridDirection:"negative",gridConnect:"arc",gridType:"surround",girdClosed:!0},axisRadar:{titlePosition:"start",showTick:!1,showLabel:!1,gridType:"surround",girdClosed:!0,gridStrokeOpacity:.3},legend:{padding:8,showTitle:!1,titleFill:QE.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemLabelFill:QE.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemValueFill:QE.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",itemBackgroundFill:"transparent",navButtonFill:QE.BLACK,navButtonFillOpacity:.65,navPageNumFill:QE.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,backgroundFill:"transparent"},continuousLegend:{labelFill:QE.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal",handleWidth:10,handleHeight:12,handleMarkerFill:QE.BLACK,handleMarkerFillOpacity:.6,handleMarkerStroke:QE.BLACK,handleMarkerStrokeOpacity:.25,handleMarkerLineWidth:1,handleLabelFill:QE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",labelShowTick:!0,labelSpacing:8},label:{fill:QE.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:null,offset:12,connectorStroke:QE.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:QE.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:null,offset:0},slider:{trackSize:16,backgroundFill:QE.STROKE,backgroundFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:QE.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:QE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,trackStroke:"none",thumbFill:"#000",thumbFillOpacity:.15,thumbStroke:"none",thumbHighlightedFillOpacity:.2},title:{titleFill:QE.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:QE.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},eM=(tM.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),nM=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:eM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:eM.BLACK,lineWidth:1}},text:{text:{fill:eM.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:eM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:eM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:eM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:eM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:eM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:eM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:eM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:eM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:eM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:eM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{titleFill:eM.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,lineStroke:eM.BLACK,lineStrokeOpacity:.45,lineLineWidth:.5,lineArrow:null,tickStroke:eM.BLACK,tickStrokeOpacity:.25,tickLineWidth:1,tickLength:4,labelFill:eM.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,labelAlign:"horizontal",gridStroke:eM.BLACK,gridStrokeOpacity:.05,gridLineWidth:.5,gridLineDash:[0,0],titleTransformOrigin:"center"},axisTop:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:8,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisBottom:{titleSpacing:10,titleTextBaseline:"bottom",labelSpacing:12,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisLeft:{titleTextBaseline:"middle",titleSpacing:10,titlePosition:"left",titleTransformOrigin:"center",titleTransform:"translate(50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"positive",labelAutoRotate:!1,tickDirection:"positive",gridDirection:"negative"},axisRight:{titleTextBaseline:"top",titleSpacing:0,titlePosition:"right",titleTransformOrigin:"center",titleTransform:"translate(-50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisLinear:{titlePosition:"top",titleTextBaseline:"bottom",gridDirection:"negative",gridConnect:"arc",gridType:"surround",girdClosed:!0},axisRadar:{titlePosition:"start",showTick:!1,showLabel:!1,gridType:"surround",girdClosed:!0,gridStrokeOpacity:.3},legend:{padding:8,showTitle:!1,titleFill:eM.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemLabelFill:eM.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemValueFill:eM.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",itemBackgroundFill:"transparent",navButtonFill:eM.BLACK,navButtonFillOpacity:.45,navPageNumFill:eM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,backgroundFill:"transparent"},continuousLegend:{labelFill:eM.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal",handleWidth:10,handleHeight:12,handleMarkerFill:eM.BLACK,handleMarkerFillOpacity:.6,handleMarkerStroke:eM.BLACK,handleMarkerStrokeOpacity:.25,handleMarkerLineWidth:1,handleLabelFill:eM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},label:{fill:eM.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:null,offset:12,connectorStroke:eM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:eM.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:null,offset:0},slider:{trackSize:16,backgroundFill:eM.STROKE,backgroundFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:eM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:eM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:eM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:eM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},rM=(nM.props={},nM.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),iM=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:rM.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0,connectFill:rM.BLACK,connectFillOpacity:.1}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:rM.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:rM.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:rM.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:rM.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:rM.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:rM.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:rM.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:rM.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:rM.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:rM.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{titleFill:rM.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,line:!0,lineStroke:"#888",lineStrokeOpacity:1,lineLineWidth:1,lineArrow:null,tickStroke:rM.STROKE,tickStrokeOpacity:1,tickLineWidth:1,tickLength:5,labelFill:rM.BLACK,labelFillOpacity:1,labelFontSize:10,labelAutoRotate:!1,labelFontWeight:"normal",labelSpacing:4,labelAlign:"horizontal",gridStroke:"#ddd",gridStrokeOpacity:1,gridLineWidth:1,gridLineDash:[0,0],titleTransformOrigin:"center"},axisTop:{titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisBottom:{titleSpacing:4,titleTextBaseline:"bottom",labelSpacing:8,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisLeft:{titleTextBaseline:"middle",titleSpacing:4,titlePosition:"left",titleTransformOrigin:"center",titleTransform:"translate(50%, 0) rotate(-90) translate(0, -50%)",labelSpacing:4,labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"},axisRight:{titleTextBaseline:"top",titleSpacing:0,titlePosition:"right",titleTransformOrigin:"center",titleTransform:"translate(-50%, 0) rotate(-90)",labelSpacing:4,labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"},axisLinear:{titlePosition:"top",titleTextBaseline:"bottom",gridDirection:"negative",gridConnect:"arc",gridType:"surround",girdClosed:!0},axisRadar:{titlePosition:"start",showTick:!1,showLabel:!1,gridType:"surround",girdClosed:!0,gridStrokeOpacity:.3},legend:{padding:8,showTitle:!1,titleFill:rM.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemLabelFill:rM.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemValueFill:rM.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",itemBackgroundFill:"transparent",navButtonFill:rM.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:rM.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,backgroundFill:"transparent"},continuousLegend:{showTitle:!1,labelFill:rM.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",handleWidth:10,handleHeight:12,handleMarkerFill:rM.BLACK,handleMarkerFillOpacity:.6,handleMarkerStroke:rM.BLACK,handleMarkerStrokeOpacity:.25,handleMarkerLineWidth:1,handleLabelFill:rM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},label:{fill:rM.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:null,offset:12,connectorStroke:rM.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:rM.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:null,offset:0},slider:{trackSize:16,backgroundFill:rM.STROKE,backgroundFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:rM.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:rM.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:rM.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:rM.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function aM(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}iM.props={};var oM,sM=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lM(t){var e;if(e=sM.exec(t))return new cM({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});throw new Error("invalid format: "+t)}function cM(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function uM(t,e){var n,e=aM(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}lM.prototype=cM.prototype,cM.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var hM={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>uM(100*t,e),r:uM,s:function(t,e){var n,r,i=aM(t,e);return i?(n=i[0],(i=(i=i[1])-(oM=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+aM(t,Math.max(0,e+i-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fM(t){return t}var dM,pM=Array.prototype.map,gM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yM(t){var e,s,l,k=void 0===t.grouping||void 0===t.thousands?fM:(s=pM.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0<n&&0<a&&(e<o+a+1&&(a=Math.max(1,e-o)),r.push(t.substring(n-=a,n+a)),!((o+=a+1)>e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",E=void 0===t.decimal?".":t.decimal+"",M=void 0===t.numerals?fM:(e=pM.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",O=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=lM(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,y=t.trim,v=t.type,m=("n"===v?(p=!0,v="g"):hM[v]||(void 0===g&&(g=12),y=!0,v="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(v)?"0"+v.toLowerCase():""),b="$"===e?i:/[%p]/.test(v)?a:"",x=hM[v],w=/[defgprs%]/.test(v);function n(t){var e,n,r,i=m,a=b;if("c"===v)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S:x(Math.abs(t),g),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;0<i&&(i=0)}return 0<i?t.slice(0,i)+t.slice(e+1):t}(t)),i=((o=o&&0==+t&&"+"!==h?!1:o)?"("===h?h:O:"-"===h||"("===h?"":h)+i,a=("s"===v?gM[8+oM/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?E+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!f&&(t=k(t,1/0));var s=i.length+t.length+a.length,l=s<d?new Array(d-s+1).join(c):"";switch(p&&f&&(t=k(l+t,l.length?d-a.length:1/0),l=""),u){case"<":t=i+t+a+l;break;case"=":t=i+l+t+a;break;case"^":t=l.slice(0,s=l.length>>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return M(t)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=lM(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=aM(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=gM[8+e/3];return function(t){return n(r*t)+i}}}}function vM(t,e,n){return t.querySelector(e)?tt(t).select(e):tt(t).append(n)}function mM(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function bM(t,e){var n={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};if(e)return Object.assign(Object.assign({},n),e);let{flexDirection:r,justifyContent:i,alignItems:a}=n;e={top:["row","center","center"],bottom:["row","center","center"],left:["colunm","center","center"],right:["colunm","center","center"],center:["column","center","center"]};return t in e&&([r,i,a]=e[t]),{display:"flex",flexDirection:r,justifyContent:i,alignItems:a}}fo=yM({thousands:",",grouping:[3],currency:["$",""]}),dM=fo.format,fo.formatPrefix;class xM extends ho{update(t){var e;this.attr(t),null!=(e=null==(e=this.children)?void 0:e[0])&&e.update(t)}}function wM(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function kM(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function EM(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=Rp(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=(null==(l=a.getFormatter)?void 0:l.call(a))||n,h=function(t,e){var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new Kv({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),f=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return x0(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new Kv({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new Kv({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return y0(s)||g0(s)?(i=c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=h(a.map(t)+i);return{value:g0(s)&&null!=(r=a.getTicks)&&r.call(a)?1-i:i,label:u(t,e,n),id:String(e)}}),v0(s)&&"center"===o?i.map(t=>{var e=t["value"],t=J(t,["value"]);return Object.assign({value:1-e},t)}):i):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0;return{value:f(h(a.map(t)+r)),label:""+u("number"!=typeof(r=t)||Math.abs(r)<1e-15?r:parseFloat(r.toFixed(15)),e,n),id:String(e)}})}function MM(t,e,n){var r;return!(y0(r=e)&&g0(r)||b0(e))&&(void 0===t?!!n.getTicks:t)}function OM(t,e,n,r,i,a){n=function(t,e){var n=t.axis;let r=t.axisLinear;return["top","right","bottom","left"].includes(e)&&(r=t["axis"+sg(e)]),Object.assign({},n,r)}(n,i);return"bottom"===i?Object.assign(Object.assign({},n),{titlePosition:t.getTicks?"right-bottom":"bottom",titleTransformOrigin:"center",titleTransform:t.getTicks?"translate(-100%, 0)":void 0}):"center"===i?Object.assign(Object.assign({},n),{labelDirection:"right"===r?"negative":"positive",labelTransform:"center"===r?"translate(50%, 0)":"",tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:"vertical"===(t=a)||t===-Math.PI/2?10:0,tick:"center"!==r&&void 0}):n}var SM,po=r=>t=>{var{labelFormatter:e=t=>""+t}=t,e="string"==typeof e?dM(e):e;const n=Object.assign(Object.assign({},t),{labelFormatter:e});return(...t)=>r(n)(...t)};const _M=po(t=>{const{position:h,orientation:f,title:d,labelFormatter:p=t=>""+t,direction:g="left",tickCount:y,tickFilter:v,tickMethod:m,important:b={}}=t,x=J(t,["order","size","transform","position","orientation","title","labelFormatter","direction","tickCount","tickFilter","tickMethod","important"]);return([t],e,n,r)=>{var e=e["bbox"],i=t.getOptions()["domain"],i=EM(t,i,y,p,v,m,h,n),r=OM(t,0,r,g,h,f),{labelAutoRotate:a=!0,labelAutoHide:o=!1,label:s=!0,tick:l=!0,line:c=!1,grid:u}=Object.assign({},r,x),u=MM(u,n,t),t=function(t,e){var[e,n]=kM(e);return t.includes("bottom")||t.includes("top")?n:e}(h,n),e=function(t,e,n,r){var{x:n,y:i,width:a,height:o}=n;if("bottom"===t)return{startPos:[n,i],endPos:[n+a,i]};if("left"===t)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("right"===t)return{endPos:[n,i+o],startPos:[n,i]};if("top"===t)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("center"===t){if("vertical"===e)return{startPos:[n+a,i],endPos:[n+a,i+o],showLine:!0};if("horizontal"===e)return{startPos:[n,i+o],endPos:[n+a,i+o],showLine:!0};if("number"==typeof e){var[t,a]=r.getCenter(),[s,l]=k0(r);const[u,h]=E0(r);var r=o/2,o=s*r,s=l*r,[l,r]=[t+n,a+i],[e,c]=[Math.cos(e),Math.sin(e)];return{startPos:[l+s*e,r+s*c],endPos:[l+o*e,r+o*c],gridClosed:h-u==360,gridCenter:[t+n,i+a],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>90+u+(h-u)/(n.length-1)*e)}}}return{}}(h,f,e,n),{showLine:n=c}=e,c=J(e,["showLine"]),i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),{type:"linear",data:i,title:mM(d),showLabel:s,labelTransforms:(e=a,r=[],o&&r.push({type:"hide"}),e&&r.push({type:"rotate",optionalAngles:[0,30,45,60,90]}),r),showGrid:u,showTick:l,gridLength:t}),x),{showLine:!0}),n?null:{lineOpacity:0}),c),b);return new Fk({className:"axis",style:i})}}),AM=po(t=>{const{position:o,labelFormatter:s=t=>""+t,tickFilter:l,tickCount:c,tickMethod:u,title:h,grid:f=!1,important:d={}}=t,p=J(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","title","grid","important"]);return([t],e,n,r)=>{var e=e["bbox"],i=t.getOptions()["domain"],t=EM(t,i,c,s,l,u,o,n),[i,a]=k0(n),e=function(t,e,n,r,i){var{x:e,y:a,width:o,height:s}=e,e=[e+o/2,a+s/2],a=Math.min(o,s)/2,[o,s]=E0(i),[l,c]=kM(i),e={center:e,radius:a,angleRange:[o,s],titleFillOpacity:0,titlePosition:"inner",showLine:!1,showTick:!0,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?(kM(i),Object.assign(Object.assign({},e),{labelAlign:"perpendicular",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},e),{labelAlign:"parallel",labelDirection:"negative",labelSpacing:8,tickDirection:"negative",gridDirection:"positive"})}(o,e,i,a,n),i=r["axis"];return new Fk({style:R({},i,e,Object.assign(Object.assign({type:"arc",data:t,title:mM(h),showGrid:f},p),d))})}}),TM=(_M.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},AM.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},t=>_M(t)),PM=(TM.props=Object.assign(Object.assign({},_M.props),{defaultPosition:"bottom"}),t=>_M(t));PM.props=Object.assign(Object.assign({},_M.props),{defaultPosition:"left"});const LM=a=>{const{important:o={}}=a,s=J(a,["important"]);return(t,e,n,r)=>{return _M(Object.assign(Object.assign(Object.assign({},s),(i=a.orientation,(i%=2*Math.PI)==Math.PI/2?{titleTransform:"translate(0, 50%)"}:i>-Math.PI/2&&i<Math.PI/2?{titleTransform:"translate(50%, 0)"}:i>Math.PI/2&&i<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{})),{important:Object.assign(Object.assign({},function(t,e,n,r){const i=t["radar"];var[{name:t}]=r["scales"];const[a,o]=E0(n);var{axisRadar:r={}}=e;return Object.assign(Object.assign({},r),{showGrid:"position"===t,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>{var n=(o-a)/i.count;return a+n*e+90})})}(a,r,n,e)),o)}))(t,e,n,r);var i}};function CM(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||lg("Unknown Component: "+t)};return[t=>{var e=t["type"],t=J(t,["type"]);return r(e)(Object.assign({},t))},r]}function NM(t,e,n,r,i={}){const[a]=CM("shape",e);return()=>a({type:"point."+t})([[0,0],[0,0]],Object.assign({size:6},i),n,r)}function jM(t,e,n,r,i){var{labelFormatter:a=t=>""+t}=e,e={itemMarker:function(t,e,n,r,i){t=wM(t,"shape");const a=e["itemMarker"];if(!t||a)return"function"==typeof a?a:(t,e)=>NM(a||"point",n,r,i,{color:t.color});{const o=t.getOptions()["range"];return(t,e)=>NM(o[e],n,r,i,{color:t.color})}}(t,e,n,r,i),itemMarkerOpacity:function(t){if(t=wM(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(t)};const o="string"==typeof a?dM(a):a,s=wM(t,"color");return Object.assign(Object.assign({},e),{data:s.getOptions().domain.map(t=>({id:t,label:o(t),color:s.map(t)}))})}LM.props=Object.assign(Object.assign({},_M.props),{defaultPosition:"center"});const RM=h=>{const{position:f,dx:d=0,dy:p=0,title:g,gridCol:y,gridRow:v}=h,m=J(h,["order","size","position","orientation","itemMarker","labelFormatter","dx","dy","title","gridCol","gridRow","layout"]);return(t,e,n,r)=>{var{library:i,bbox:a}=e,{x:a,y:o,width:s,height:l}=a,e=bM(f,null==(e=null==(e=null==(e=e.scales)?void 0:e[0])?void 0:e.guide)?void 0:e.layout),[c,u]=function(t,e,n){var[r,i]=[e||100,n||100];switch(t){case"top":case"bottom":case"top-left":case"top-right":case"bottom-left":case"bottom-right":return[1,i];case"left":case"right":return[r,1];default:return[e,n]}}(f,v,y),u=Object.assign({orient:["right","left","center"].includes(f)?"vertical":"horizontal",width:s,height:l,gridCol:null!==y&&void 0!==y?y:u,gridRow:null!==v&&void 0!==v?v:c,rowPadding:0,colPadding:8,titleText:mM(g)},jM(t,h,i,n,r)),{legend:c={}}=r,t=new xM({style:Object.assign({x:a+d,y:o+p,width:s,height:l},e)});return t.appendChild(new l5({className:"legend-category",style:Object.assign({},c,u,m)})),t}};RM.props={defaultPosition:"top",defaultOrder:1,defaultSize:40};const FM=l=>{const{title:c,dx:u=0,dy:h=0,position:f,labelFormatter:d}=l,p=J(l,["title","dx","dy","position","layout","labelFormatter"]);return(t,e,n,r)=>{var i=e["bbox"],{x:i,y:a,width:o,height:s}=i,e=bM(f,null==(e=null==(e=null==(e=e.scales)?void 0:e[0])?void 0:e.guide)?void 0:e.layout),o=new xM({style:Object.assign({x:i+u,y:a+h,width:o,height:s},e)}),{continuousLegend:s={}}=r;return o.appendChild(new _5({style:Object.assign({},s,Object.assign(Object.assign({x:i,y:a,titleText:mM(c),titleFontSize:12,showHandle:!1,showIndicator:!1,labelAlign:"value",labelFormatter:"string"==typeof d?t=>dM(d)(t.label):d},function(t){var{position:t="top",size:e,length:n=FM.props.defaultLength}=t,[n,e,t]={left:["vertical",e,n],right:["vertical",e,n],top:["horizontal",n,e],bottom:["horizontal",n,e]}[t];return{orient:n,width:e,height:t}}(l)),function(t,e){const r=wM(t,"color");var{domain:n,range:i}=r.getOptions();const{length:a=FM.props.defaultLength}=e,[o,s]=[n[0],n.slice(-1)[0]];if(r instanceof em){e=r.thresholds;if(r instanceof im||r instanceof om)return{data:[o,...e,s].map((t,e)=>({value:t/s,label:t})),color:i};const c=[-1/0,...e,1/0].map((t,e)=>({value:e,label:t}));return{data:c,color:i,labelFilter:(t,e)=>0<e&&e<c.length-1}}const l=wM(t,"opacity");return{data:r.getTicks().map(t=>({value:t})),color:new Array(a).fill(0).map((t,e)=>{var e=(s-o)/(a-1)*e+o,n=r.map(e);const i=l?l.map(e):1;return n.replace(/rgb[a]*\(([\d]{1,3}), ([\d]{1,3}), ([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${i})`)})}}(t,l)),p)})),o}},BM=(FM.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200},e=>(...t)=>FM(Object.assign({},{block:!0},e))(...t)),IM=(BM.props=Object.assign(Object.assign({},FM.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>FM(Object.assign({},{type:"size",block:!0,labelShowTick:!1},t))),DM=(IM.props=Object.assign(Object.assign({},FM.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>FM(Object.assign({},{type:"size",labelShowTick:!1,labelFilter:(t,e,n)=>0===e||e===n.length-1},t)));function zM(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}DM.props=Object.assign(Object.assign({},FM.props),{defaultPosition:"top",defaultOrientation:"horizontal"});SM={render(t,e){const{y:n,width:r,title:i,subtitle:a,spacing:o=2,align:s="left"}=t,l=J(t,["x","y","width","title","subtitle","spacing","align"]);t=Q(l,"title");const c=Q(l,"subtitle"),u=vM(e,".title","text").attr("className","title").call(A,Object.assign(Object.assign(Object.assign({},zM(0,n,r,s)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();vM(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},zM(0,u.max[1]+o,r,s)),{fontSize:12,textBaseline:"top",text:a}),c))})}};const GM=class extends Do{constructor(t){super(t),this.descriptor=SM}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(R({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},WM=s=>(t,e,n,r)=>{var{x:e,y:i,width:a,height:o}=e.bbox;return new GM({style:R({},{style:r.title},Object.assign({x:e,y:i,width:a,height:o},s))})};function HM(t){return t.getBandWidth}function VM(t,e,n){if(!HM(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=Lp(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function YM(t,e){var n,r;return HM(t)?(t=t.getOptions()["domain"],[n,r]=e,n=t.indexOf(n),r=t.indexOf(r),t.slice(n,r+1)):Vp(e)}WM.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const qM=t=>{const{orient:u,labelFormatter:h}=t,f=J(t,["orient","labelFormatter","size"]);return([e],t,n,r)=>{var i,t=t["bbox"],{x:t,y:a,width:o,height:s}=t,{slider:r={}}=r;const l=(null==(i=e.getFormatter)?void 0:i.call(e))||(t=>t),c="string"==typeof h?dM(h):h;return new Lw({className:"slider",style:Object.assign({},r,Object.assign({x:t,y:a,trackLength:"horizontal"===u?o:s,orient:u,formatter:t=>{return(c||l)(VM(e,t,!0))}},f))})}},UM=(qM.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>qM(Object.assign(Object.assign({},t),{orient:"horizontal"}))),XM=(UM.props=Object.assign(Object.assign({},qM.props),{defaultPosition:"bottom"}),t=>qM(Object.assign(Object.assign({},t),{orient:"vertical"}))),$M=(XM.props=Object.assign(Object.assign({},qM.props),{defaultPosition:"left"}),t=>{const s=t["orient"],l=J(t,["orient","labelFormatter"]);return(t,e,n,r)=>{var e=e["bbox"],{x:e,y:i,width:a,height:o}=e,{scrollbar:r={}}=r;return new jw({className:"scrollbar",style:Object.assign({},r,Object.assign(Object.assign({x:e,y:i,trackLength:"horizontal"===s?a:o},l),{orient:s,value:0,contentLength:1500,viewportLength:"horizontal"===s?a:o}))})}}),KM=($M.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>$M(Object.assign(Object.assign({},t),{orient:"horizontal"}))),ZM=(KM.props=Object.assign(Object.assign({},$M.props),{defaultPosition:"bottom"}),t=>$M(Object.assign(Object.assign({},t),{orient:"vertical"})));ZM.props=Object.assign(Object.assign({},$M.props),{defaultPosition:"left"});class JM{constructor(t){this.$value=t}static of(t){return new JM(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}function QM(t,e,n){return JM.of({}).call(tO,t).call(tO,e).call(tO,n).value()}function tO(t,e){for(var[n,r]of Object.entries(e))void 0!==r&&(t[n]=e[n]);return t}function eO(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}const nO=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"],rO=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=g0(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,QM(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},iO=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=g0(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,QM(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},aO=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=g0(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,QM(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},oO=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o,fillOpacity:s,strokeOpacity:l,opacity:c}=a.style,[r,t]=g0(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,QM(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},sO=l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a,strokeOpacity:o,opacity:s}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}],QM(i,n,l))},lO=(sO.props={},l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a,strokeOpacity:o,opacity:s}=t.style;return t.animate([{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}],QM(i,n,l))});function cO(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function uO(t,e){var[n,r,i,t]=cO(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0<c;){var u=Math.min(c,a),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
2
2
  M ${t} ${e}
3
3
  L ${t+n} ${e}
4
4
  L ${t+n} ${e+r}
5
5
  L ${t} ${e+r}
6
6
  Z
7
- `}([f,d,h,s]))}c-=u,l+=1}return o}function MM(t,e){t.__data__=e.__data__,t.className=e.className,e.parentNode.replaceChild(t,e)}function OM(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=nl(e),y=nl(n);return d===p&&"path"!==d||(void 0===g||void 0===y)?(p=n,d=r,[o,l,s,f]=kM(i=e),[c,u,h,a]=(MM(p,i),kM(p)),o=[Object.assign({transform:`translate(${o-c}, ${l-u}) scale(${s/h}, ${f/a})`},pM(i,gM)),Object.assign({transform:"translate(0, 0) scale(1, 1)"},pM(p,gM))],p.animate(o,d)):(c=g,s="path"===(u=(l=t)["nodeName"])?l:(MM(u=new ts({style:Object.assign(Object.assign({},pM(l,gM)),{d:c})}),l),u),h=[Object.assign({path:g},pM(e,gM)),Object.assign({path:y},pM(n,gM))],f=s.animate(h,r),s.style.transform="scale(1, 1)",s.style.transform="none",f)}wM.props={};const SM=g=>(t,e,n,r,i)=>{[a="pack"]=[g.split];var a="function"==typeof a?a:EM,i=fM(i,n,g),n=t["length"],o=e["length"];if(1===n&&1===o||1<n&&1<o)return[s]=t,[c]=e,OM(s,s,c,i);if(1===n&&1<o){var[s]=t;{var l=s,c=e,u=i,s=a;l.style.visibility="hidden";const d=s(l,c.length);return c.map((t,e)=>{return OM(t,new ts({style:Object.assign({path:d[e]},pM(l,gM))}),t,u)})}}if(1<n&&1===o){var[n]=e;{var o=t,h=n,f=i;const p=(e=a)(h,o.length);var{fillOpacity:e,strokeOpacity:t,opacity:n}=h.style,e=h.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:n}],f);return[...o.map((t,e)=>{return OM(t,t,new ts({style:{path:p[e],fill:h.style.fill}}),f)}),e]}}return null},_M=(SM.props={},b=>{return Xi({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:i.NUMBER}),(t,e,n,r,i)=>{const[a]=t;if(!a0(r))return yM(b)(t,e,n,r,i);const o=r.getCenter();var{__data__:t,style:e}=a,{radius:s=0,inset:l=0,fillOpacity:c,strokeOpacity:u,opacity:h}=e,{points:e,y:t,y1:f}=(J(e,["radius","inset","fillOpacity","strokeOpacity","opacity"]),t);const d=$v().cornerRadius(s).padAngle(l*Math.PI/180),p=Rb(r,e,[t,f]),{startAngle:g,endAngle:y}=p,m=new ts({}),v=t=>{m.attr({d:d(t),transform:`translate(${o[0]}, ${o[1]})`});t=nl(m);return m.style.transform="none",t};s=[{waveInArcAngle:g+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:g+1e-4,fillOpacity:c,strokeOpacity:u,opacity:h,offset:.01},{waveInArcAngle:y,fillOpacity:c,strokeOpacity:u,opacity:h}],l=a.animate(s,fM(i,n,b));return l.onframe=function(){a.style.path=v(Object.assign(Object.assign({},p),{endAngle:Number(a.style.waveInArcAngle)}))},l.onfinish=function(){a.style.path=v(Object.assign(Object.assign({},p),{endAngle:y}))},l}}),AM=(_M.props={},c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t,fillOpacity:o,strokeOpacity:s,opacity:l}=a.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l}],{width:o,height:s}=a.getBoundingClientRect(),l=(a.setOrigin([o/2,s/2]),a.animate(t,fM(i,n,c)));return l.finished.then(()=>a.setOrigin(0,0)),l}}),TM=c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t,fillOpacity:o,strokeOpacity:s,opacity:l}=a.style,o=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:s,height:l}=a.getBoundingClientRect(),t=(a.setOrigin([s/2,l/2]),a.animate(o,fM(i,n,c)));return t.finished.then(()=>a.setOrigin(0,0)),t}},PM=o=>(t,e,n,r,i)=>{var[t]=t,a=(null==(a=t.getTotalLength)?void 0:a.call(t))||0;return t.animate([{lineDash:[0,a]},{lineDash:[a,0]}],fM(i,n,o))},LM=(PM.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new ts({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=yM(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o}),CM=(LM.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new ts({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=vM(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o});function NM(t){return tt(t).selectAll("."+nt).nodes()}function jM(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key).flatMap(({container:t})=>NM(t))}function RM(t){return tt(t).select("."+rt).node()}function FM(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getBounds();return e<t||i<e||(n<r||a<n)?null:[e-t,n-r]}function IM(t,e){var{offsetX:e,offsetY:n}=e,[t,r,i,a]=function(t){var t=t.getRenderBounds(),{min:[t,e],max:[n,r]}=t;return[t,e,n,r]}(t);return[Math.min(i,Math.max(t,e))-t,Math.min(a,Math.max(r,n))-r]}function BM(t){return t&&0!==Object.keys(t).length?t:{highlightedLineWidth:1,highlightedStroke:"#000"}}function DM(){return t=>t.__data__.color}function zM(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function GM(t){t=Array.from(t.markState.keys());const n=new Map(t.map(t=>[t.key,t.data]));return t=>{var{index:t,markKey:e}=t.__data__;return n.get(e)[t]}}function WM(o,s=(t,e)=>t,l=(t,e,n)=>t.setAttribute(e,n)){const c="__states__",u="__ordinal__",i=t=>{var{[c]:e=[],[u]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),Q(o,e)),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){var a=t.getAttribute(r),i=s(i,t);l(t,r,i),r in n||(n[r]=a)}t[u]=n}},a=t=>{t[c]||(t[c]=[])};return{setState:(t,...e)=>{a(t),t[c]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[c].indexOf(r);-1!==r&&t[c].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[c].indexOf(e))}}function YM(r,i){const a=new Map(r.map((t,e)=>[t,e]));return(t,e)=>{var n;return"function"!=typeof t?t:(n=a.get(e),t(i?i(e):e,n,i?r.map(i):r))}}function VM(l,t){var{valueof:c=(t,e)=>t}=t,u=J(t,["valueof"]);const h="element-link";return[(t,e)=>{if(!(t.length<=1)){var n=t.map(t=>[t,t.getBBox()]);n.sort(([,t],[,e])=>{var{x:t,y:n}=t,{x:e,y:r}=e;return t-e==0?n-r:t-e});for(let t=1;t<n.length;t++){var r=Gv();const[o,s]=n[t-1];var[,i]=n[t],i=(r.moveTo(s.x+s.width,s.y),r.lineTo(i.x,i.y),r.lineTo(i.x,i.y+i.height),r.lineTo(s.x+s.width,s.y+s.height),r.closePath(),Tb(u,t=>c(t,o))),{fill:a=o.getAttribute("fill")}=i,i=J(i,["fill"]),r=new ts({className:h+(e?" "+e:""),style:Object.assign({d:r.toString(),fill:a},i)});l.appendChild(r)}}},t=>{t=t||h;for(const e of l.getElementsByClassName(t)||[])e.remove()}]}function HM(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function qM(t,e){var{elements:n,datum:r,groupKey:i=t=>t,link:a=!1}=e,e=J(e,["elements","datum","groupKey","link"]);const o=n(t),s=new Set(o),l=Np(o,i);n=YM(o,r);const[c,u]=VM(t,Object.assign({elements:o,valueof:n},Q(e,"link"))),{setState:h,removeState:f}=WM(e,n),d=t=>{t=t.target;if(s.has(t)){var t=i(t),t=l.get(t),e=new Set(t);for(const n of o)e.has(n)?h(n,"highlighted"):h(n,"unhighlighted");a&&c(t)}},p=t=>{t=t.target;if(s.has(t)){for(const e of o)f(e,"unhighlighted","highlighted");a&&u()}};return t.addEventListener("pointerover",d),t.addEventListener("pointerout",p),()=>{t.removeEventListener("pointerover",d),t.removeEventListener("pointerout",p),u()}}function UM(n){return t=>{var{container:t,view:e}=t;return qM(t,Object.assign(Object.assign({},BM(n)),{elements:NM,datum:GM(e)}))}}function XM(n={selectedLineWidth:1,selectedColor:"black"}){return t=>{var{container:t,view:e}=t;return qM(t,Object.assign(Object.assign({},BM(n)),{elements:NM,datum:GM(e),groupKey:zM(e)}))}}function $M(n){return t=>{var{container:t,view:e}=t;return qM(t,Object.assign(Object.assign(Object.assign({},n),BM(n)),{elements:NM,datum:GM(e),groupKey:DM()}))}}function KM(t,e){var{elements:n,datum:r,groupKey:l=t=>t,link:c=!1,single:u=!1}=e,e=J(e,["elements","datum","groupKey","link","single"]);const h=n(t),f=new Set(h),d=Np(h,l);n=YM(h,r);const[p,g]=VM(t,Object.assign({elements:h,valueof:n},Q(e,"link"))),{setState:y,removeState:i,hasState:m}=WM(e,n),v=()=>{for(const t of h)i(t,"selected","unselected");c&&g()},a=t=>{t=t.target;if(!f.has(t))return v();if(u){var e=t;if(m(e,"selected"))v();else{var e=l(e),e=d.get(e),n=new Set(e);for(const i of h)n.has(i)?y(i,"selected"):y(i,"unselected");c&&(g(),p(e))}}else{e=t;var t=l(e),r=d.get(t);const a=new Set(r);if(m(e,"selected")){if(!h.some(t=>!a.has(t)&&m(t,"selected")))return v();for(const o of r)y(o,"unselected");c&&g(t)}else{e=r.some(t=>m(t,"selected"));for(const s of h)a.has(s)?y(s,"selected"):m(s,"selected")||y(s,"unselected");!e&&c&&p(r,t)}}};return t.addEventListener("click",a),()=>{t.removeEventListener("click",a),g()}}function ZM(n){return t=>{var{container:t,view:e}=t;return KM(t,Object.assign(Object.assign({},BM(n)),{elements:NM,datum:GM(e)}))}}function JM(n){return t=>{var{container:t,view:e}=t;return KM(t,Object.assign(Object.assign({},BM(n)),{elements:NM,datum:GM(e),groupKey:zM(e)}))}}function QM(n){return t=>{var{container:t,view:e}=t;return KM(t,Object.assign(Object.assign({},BM(n)),{elements:NM,datum:GM(e),groupKey:DM()}))}}function tO(t){var{wait:M=20,leading:O,trailing:S=!1,labelFormatter:_=t=>""+t}=t,A=J(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:e,view:n,container:r,update:i}=t,{markState:a,scale:o,coordinate:s}=n;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(a,"line",["x","y","series"]);if(!t)return;const{y:f,x:d,series:l=[]}=t;t=f.map((t,e)=>e);const c=Ip(t.map(t=>d[t])),u=R({},e),h=u.marks.find(t=>"line"===t.type);t=Xp(jp(t,t=>Xp(t,t=>+f[t])/Kp(t,t=>+f[t]),t=>l[t]).values());R(h,{scale:{y:{domain:[1/t,t]}}});const p=RM(r),g=r.getElementsByClassName(nt);const y=Np(r.getElementsByClassName(at),t=>t.__data__.key.split("-")[0]),m=new Jo({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},Q(A,"rule"))}),v=new ls({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},Q(A,"label"))}),b=(m.append(v),p.appendChild(m),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[Op(c,n)]}),x=(t,e)=>{m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0]),v.setAttribute("text",_(e))};let w;var k;const E=zf(t=>{t=FM(p,t);if(t){var{scale:e,coordinate:n}=w,{x:e,y:r}=e,i=b(n,e,t);x(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[wp(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),y.get(o)||[]);for(const h of s)h.setAttribute("dy",c)}}},M,{leading:O,trailing:S});return k=[0,0],Oe(this,void 0,void 0,function*(){var t=o["x"];const n=b(s,t,k);x(k,n);t=function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(h);t.groupBy="color",t.basis=(t,e)=>{return e[t[wp(t=>d[+t]).center(t,n)]]};for(const e of u.marks)e.animate=!1;t=yield i(u);w=t.view}),p.addEventListener("pointerenter",E),p.addEventListener("pointermove",E),p.addEventListener("pointerleave",E),()=>{m.remove(),p.removeEventListener("pointerenter",E),p.removeEventListener("pointermove",E),p.removeEventListener("pointerleave",E)}}}function eO({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:e,update:r,container:n}=t,i=RM(n),a=R({},e);for(const s of a.marks)s.animate=!1;const o=zf(t=>{var e,n,t=FM(i,t);t&&([t,e]=t,(n=function(t){var{coordinates:e=[]}=t,n=e.find(t=>"fisheye"===t.type);return n||(e.push(n={type:"fisheye"}),t.coordinates=e,n)}(a)).focusX=t,n.focusY=e,n.isVisual=!0,r(a))},l,{leading:c,trailing:u});return i.addEventListener("pointerenter",o),i.addEventListener("pointermove",o),i.addEventListener("pointerleave",o),()=>{i.removeEventListener("pointerenter",o),i.removeEventListener("pointermove",o),i.removeEventListener("pointerleave",o)}}}function nO(t,e,n,r){var{tooltipElement:i=function(t,e,n){var{min:[r,i],max:[a,o]}=t.getBounds(),e=new o5({className:"tooltip",style:{x:e,y:n,container:{x:0,y:0},items:[],bounding:{x:r,y:i,width:a-r,height:o-i},title:" ",position:"bottom-right",offset:[10,10],style:{".tooltip":{},".tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}});return t.getRootNode().defaultView.getConfig().container.appendChild(e.HTMLTooltipElement),e}(t,n,r)}=t,{items:e,title:a}=e;i.show(),i.position=[n,r],i.update({items:e,title:a}),t.tooltipElement=i}function rO(t){t=t.tooltipElement;t&&t.hide()}function iO(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function aO(t){return Object.fromEntries(Object.entries(t).filter(([,t])=>Z0(t)))}function oO(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e||n}=t;return t}function sO(t){return tg(t)?t:{value:void 0===t?t:""+t}}function lO(n,s,l,t=n.map(t=>t.__data__)){e=t.map(t=>t.title),e=new Map(e.map(t=>[t instanceof Date?+t:t,t]));var e=Array.from(e.values()).filter(Z0),t=t.flatMap((a,t)=>{var t=n[t],e=J(a,["title"]);const o=oO(t);return Object.entries(e).filter(([t])=>t.startsWith("tooltip")).map(([t,e])=>{var{field:n,title:n=n}=l[t].getOptions(),e=sO(e),{field:r=void 0,color:i=o,name:r=function(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Cm);return i(t)?t.invert(e):i(n)?n.invert(r):null}(l,a)||r||n,value:n}=e,e=J(e,["field","color","name","value"]);return Object.assign(Object.assign(Object.assign({},e),{name:r,color:i,value:n}),aO(s({channel:t,value:n})))}).filter(({value:t})=>void 0!==t)});return Object.assign(Object.assign({},0<e.length&&{title:e.join(",")}),{items:t})}function cO(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function uO(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function hO(t,e){return void 0===t?e:t}function fO(h,t){var{elements:e,wait:n=50,leading:r=!0,trailing:i=!1,scale:f,coordinate:d,crosshairs:p,item:g,startX:y=0,startY:m=0}=t,t=J(t,["elements","wait","leading","trailing","scale","coordinate","crosshairs","item","startX","startY"]),e=e(h);const[,v]=function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return[n-t,r-e]}(h),b=[],x=[];for(const l of e){var a=l["__data__"],a=a["seriesX"];(a?b:x).push(l)}const w=new Map(b.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[Ip(n.map((t,e)=>e),t=>n[+t]),n]]}));e=x.map((t,e)=>e);const k=x.map(t=>{t=t.__data__;return t.x}),E=Ip(e,t=>k[t]),M=Q(t,"crosshairs");e=f.x;const O=null!=e&&e.getBandWidth?e.getBandWidth()/2:0,o=zf(t=>{t=FM(h,t);if(t){var e=h.getBounds(),n=e.min[0],e=e.min[1];const o=[t[0]-y,t[1]-m];o;var r=((t,e,n)=>{var r=e.length;if(0===r)return[];var[t]=d.invert(t),t=t-O,i=(0,wp(t=>n[+t]).center)(e,t);let a=i,o=i;for(;0<a-1&&n[e[a-1]]==n[e[i]];)a--;for(;o+1<r&&n[e[o+1]]===n[e[i]];)o++;return n0(a,o+1).map(t=>e[t])})(o,E,k).map(t=>x[t]),i=b.map(t=>{var[e,n]=w.get(t),t=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")).map(([t,e])=>{e=e[n];return[Pf(t.replace("series","")),e]}))})(t,((t,e,n)=>{var[t]=d.invert(t);return e[(0,wp(t=>n[+t]).center)(e,t-O)]})(o,e,n)),{x:e,y:n}=t;return[t,d.map([e+O,n])]}),a=[...i.map(t=>t[0]),...r.map(t=>t.__data__)],r=lO([...b,...r],g,f,a);if(nO(h,r,t[0]+n,t[1]+e),p){a=i.map(t=>t[1]);{var r=h,n=a,{height:e,startX:i,startY:a}=t=Object.assign(Object.assign({},M),{height:v,startX:y,startY:m}),t=J(t,["height","startX","startY"]);const s=(n=Qp(n.map(t=>t[0])))+i,l=n+i,c=a,u=e-a;(i=r.ruleY||(n=new Jo({style:Object.assign({x1:s,x2:l,y1:c,y2:u,lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},t)}),r.appendChild(n),n)).style.x1=s,i.style.x2=l,i.style.y1=c,i.style.y2=u,r.ruleY=i}}}},n,{leading:r,trailing:i}),s=()=>{rO(h),p&&cO(h)};return h.addEventListener("pointerenter",o),h.addEventListener("pointermove",o),h.addEventListener("pointerleave",s),()=>{h.removeEventListener("pointerover",o),h.removeEventListener("pointerout",o),h.removeEventListener("pointerleave",s),iO(h),p&&cO(h)}}function dO(r,{elements:t,scale:i,wait:e=50,leading:n=!0,trailing:a=!1,groupKey:o=t=>t,item:s}){t=t(r);const l=new Set(t),c=Np(t,o),u=zf(t=>{var e,n=t["target"];l.has(n)&&(n=o(n),n=1===(n=c.get(n)).length?function(t,a,o){var e=(n=t["__data__"])["title"],n=J(n,["title"]);const s=oO(t);return t=Object.entries(n).filter(([t])=>t.startsWith("tooltip")).map(([t,e])=>{var{field:n,title:n=n}=o[t].getOptions(),e=sO(e),{field:r=void 0,color:i=s,name:r=r||n,value:n}=e,e=J(e,["field","color","name","value"]);return Object.assign(Object.assign(Object.assign({},e),{color:i,name:r,value:n}),aO(a({channel:t,value:n})))}).filter(({value:t})=>void 0!==t),Object.assign(Object.assign({},e&&{title:e}),{items:t})}(n[0],s,i):lO(n,s,i),{offsetX:t,offsetY:e}=t,nO(r,n,t,e))},e,{leading:n,trailing:a}),h=t=>{t=t.target;l.has(t)&&rO(r)};return r.addEventListener("pointerover",u),r.addEventListener("pointermove",u),r.addEventListener("pointerout",h),()=>{r.removeEventListener("pointerover",u),r.removeEventListener("pointermove",u),r.removeEventListener("pointerout",h),iO(r)}}function pO(t){const{shared:u,crosshairs:h,series:f,item:d=()=>({}),facet:p=!1}=t,g=J(t,["shared","crosshairs","series","name","item","facet"]);return(e,t)=>{var{container:n,view:r}=e;const{scale:i,markState:a,coordinate:o}=r;var s=uO(a,"seriesTooltip"),l=uO(a,"crosshairs"),n=RM(n),s=hO(f,s);if(s&&!p)return fO(n,Object.assign(Object.assign({},g),{elements:NM,scale:i,coordinate:o,crosshairs:hO(h,l),item:d}));if(s&&p){s=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const c=jM(e,t),i=s[0].view.scale;t=n.getBounds(),s=t.min[0],t=t.min[1];return fO(n.parentNode.parentNode,Object.assign(Object.assign({},g),{elements:()=>c,scale:i,coordinate:o,crosshairs:hO(h,l),item:d,startX:s,startY:t}))}return dO(n,Object.assign(Object.assign({},g),{elements:NM,scale:i,coordinate:o,groupKey:u?zM(r):void 0,item:d}))}}CM.props={};const gO="legend-category";function yO(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function mO(t){return t.getElementsByClassName("legend-category-item-label")[0]}function vO(t){return t.getElementsByClassName("items-item")}function bO(t,e){var{legends:n,marker:i,label:a,datum:o,filter:r,setAttribute:s}=e,e=J(e,["legends","marker","label","datum","filter","setAttribute"]);const l=new Map,c=new Map,u=new Map;var e=0===Object.keys(e).length?{labelUnselectedFill:"#aaa",markerUnselectedFill:"#aaa"}:e,h=Q(e,"marker"),e=Q(e,"label");const{setState:f,removeState:d}=WM(h,void 0,s),{setState:p,removeState:g}=WM(e,void 0,s),y=Array.from(n(t)),m=y.map(o),v=()=>{for(const r of y){var t=o(r),e=i(r),n=a(r);(m.includes(t)?(d(e,"unselected"),g):(f(e,"unselected"),p))(n,"unselected")}};for(const k of y){var b=()=>{HM(t,"pointer")},x=()=>{HM(t,"default")},w=()=>Oe(this,void 0,void 0,function*(){var t=o(k),e=m.indexOf(t);-1===e?m.push(t):m.splice(e,1),0===m.length&&m.push(...y.map(o)),yield r(m),v()});k.addEventListener("click",w),k.addEventListener("pointerenter",b),k.addEventListener("pointerout",x),l.set(k,w),c.set(k,b),u.set(k,x)}return()=>{for(const t of y)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",c.get(t)),t.removeEventListener("pointerout",u.get(t))}}function xO(t){var s=t["channel"],r=J(t,["channel"]);return t=>{const{container:e,view:i,options:a,update:o}=t;var t=e.getElementsByClassName(gO),t=s?t.find(t=>{t=t.parentNode.__data__;return t.scale.name===s}):t[0],[t,n]=t?function(t){const e=t.attributes["data"];return[t=(t=t.parentNode.__data__).scale.name,{legends:vO,marker:yO,label:mO,datum:t=>{t=t.__data__,t=t.index;return e[t].label}}]}(t):[null,{}];return t&&(s=t),bO(e,Object.assign(Object.assign(Object.assign({},n),{filter:r=>Oe(this,void 0,void 0,function*(){var t=i["scale"];const{[s]:n}=t;t=a.marks,t=t.map(t=>{var{transform:e=[]}=t,e=[{type:"filter",[s]:r},...e];return R({},t,{transform:e,scale:{[s]:{domain:n.getOptions().domain}}})}),t=Object.assign(Object.assign({},a),{marks:t});return o(t)})}),r))}}function wO(a,t){var{brushed:i=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(a),brushRegion:l=(t,e,n,r,i)=>[t,e,n,r],reverse:c=!1,fill:n="#777",fillOpacity:r="0.3",stroke:u="#fff"}=t,h=J(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke"]);let f=null,d=null,p=null,g=null,y=null,m=!1;const[v,b,x,w]=s,k=(HM(a,"crosshair"),a.style.draggable=!0,()=>{y=new ts({style:Object.assign(Object.assign({},h),{fill:n,fillOpacity:r,stroke:u,pointerEvents:"none"})}),g=new os({style:{draggable:!0,fill:"transparent"},className:"mask"}),a.appendChild(y),a.appendChild(g)}),E=()=>{g=new os({style:Object.assign(Object.assign({},h),{fill:n,fillOpacity:r,stroke:u,draggable:!0}),className:"mask"}),a.appendChild(g)},M=()=>{g&&g.remove(),y&&y.remove(),f=null,d=null,p=null,m=!1,g=null,y=null,e()},O=(t,e)=>{var[t,e,n,r]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,n,r]=l(t,e,n,r,s);return(c?_:S)(t,e,n,r),i(t,e,n,r),[t,e,n,r]},S=(t,e,n,r)=>{g.style.x=t,g.style.y=e,g.style.width=n-t,g.style.height=r-e},_=(t,e,n,r)=>{y.style.d=`
8
- M${v},${b}L${x},${b}L${x},${w}L${v},${w}Z
7
+ `}([f,d,h,s]))}c-=u,l+=1}return o}function hO(t,e){t.__data__=e.__data__,t.className=e.className,e.parentNode.replaceChild(t,e)}function fO(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function dO(t){var e,t=el(t);if(t&&(fO(e=t,"m")&&fO(e,"M")))return t}function pO(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=dO(e),y=dO(n);return d===p&&"path"!==d||(void 0===g||void 0===y)?(p=n,d=r,[o,l,s,f]=cO(i=e),[c,u,h,a]=(hO(p,i),cO(p)),o=[Object.assign({transform:`translate(${o-c}, ${l-u}) scale(${s/h}, ${f/a})`},eO(i,nO)),Object.assign({transform:"translate(0, 0) scale(1, 1)"},eO(p,nO))],p.animate(o,d)):(c=g,s="path"===(u=(l=t)["nodeName"])?l:(hO(u=new Qo({style:Object.assign(Object.assign({},eO(l,nO)),{d:c})}),l),u),h=[Object.assign({path:g},eO(e,nO)),Object.assign({path:y},eO(n,nO))],f=s.animate(h,r),s.style.transform="scale(1, 1)",s.style.transform="none",f)}lO.props={};const gO=g=>(t,e,n,r,i)=>{[a="pack"]=[g.split];var a="function"==typeof a?a:uO,i=QM(i,n,g),n=t["length"],o=e["length"];if(1===n&&1===o||1<n&&1<o)return[s]=t,[c]=e,pO(s,s,c,i);if(1===n&&1<o){var[s]=t;{var l=s,c=e,u=i,s=a;l.style.visibility="hidden";const d=s(l,c.length);return c.map((t,e)=>{return pO(t,new Qo({style:Object.assign({path:d[e]},eO(l,nO))}),t,u)})}}if(1<n&&1===o){var[n]=e;{var o=t,h=n,f=i;const p=(e=a)(h,o.length);var{fillOpacity:e,strokeOpacity:t,opacity:n}=h.style,e=h.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:n}],f);return[...o.map((t,e)=>{return pO(t,t,new Qo({style:{path:p[e],fill:h.style.fill}}),f)}),e]}}return null},yO=(gO.props={},b=>{return $i({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:i.NUMBER}),(t,e,n,r,i)=>{const[a]=t;if(!y0(r))return rO(b)(t,e,n,r,i);const o=r.getCenter();var{__data__:t,style:e}=a,{radius:s=0,inset:l=0,fillOpacity:c,strokeOpacity:u,opacity:h}=e,{points:e,y:t,y1:f}=(J(e,["radius","inset","fillOpacity","strokeOpacity","opacity"]),t);const d=lb().cornerRadius(s).padAngle(l*Math.PI/180),p=Jb(r,e,[t,f]),{startAngle:g,endAngle:y}=p,v=new Qo({}),m=t=>{v.attr({d:d(t),transform:`translate(${o[0]}, ${o[1]})`});t=el(v);return v.style.transform="none",t};s=[{waveInArcAngle:g+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:g+1e-4,fillOpacity:c,strokeOpacity:u,opacity:h,offset:.01},{waveInArcAngle:y,fillOpacity:c,strokeOpacity:u,opacity:h}],l=a.animate(s,QM(i,n,b));return l.onframe=function(){a.style.path=m(Object.assign(Object.assign({},p),{endAngle:Number(a.style.waveInArcAngle)}))},l.onfinish=function(){a.style.path=m(Object.assign(Object.assign({},p),{endAngle:y}))},l}}),vO=(yO.props={},c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t,fillOpacity:o,strokeOpacity:s,opacity:l}=a.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l}],{width:o,height:s}=a.getBoundingClientRect(),l=(a.setOrigin([o/2,s/2]),a.animate(t,QM(i,n,c)));return l.finished.then(()=>a.setOrigin(0,0)),l}}),mO=c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t,fillOpacity:o,strokeOpacity:s,opacity:l}=a.style,o=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:s,height:l}=a.getBoundingClientRect(),t=(a.setOrigin([s/2,l/2]),a.animate(o,QM(i,n,c)));return t.finished.then(()=>a.setOrigin(0,0)),t}},bO=o=>(t,e,n,r,i)=>{var[t]=t,a=(null==(a=t.getTotalLength)?void 0:a.call(t))||0;return t.animate([{lineDash:[0,a]},{lineDash:[a,0]}],QM(i,n,o))},xO=(bO.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new Qo({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=rO(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o}),wO=(xO.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new Qo({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=aO(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o});function kO(t){return tt(t).selectAll("."+nt).nodes()}function EO(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key).flatMap(({container:t})=>kO(t))}function MO(t){return tt(t).select("."+rt).node()}function OO(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getBounds();return e<t||i<e||(n<r||a<n)?null:[e-t,n-r]}function SO(t,e){var{offsetX:e,offsetY:n}=e,[t,r,i,a]=function(t){var t=t.getRenderBounds(),{min:[t,e],max:[n,r]}=t;return[t,e,n,r]}(t);return[Math.min(i,Math.max(t,e))-t,Math.min(a,Math.max(r,n))-r]}function _O(t){return t&&0!==Object.keys(t).length?t:{highlightedLineWidth:1,highlightedStroke:"#000"}}function AO(){return t=>t.__data__.color}function TO(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function PO(t){t=Array.from(t.markState.keys());const n=new Map(t.map(t=>[t.key,t.data]));return t=>{var{index:t,markKey:e}=t.__data__;return n.get(e)[t]}}function LO(o,s=(t,e)=>t,l=(t,e,n)=>t.setAttribute(e,n)){const c="__states__",u="__ordinal__",i=t=>{var{[c]:e=[],[u]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),Q(o,e)),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){var a=t.getAttribute(r),i=s(i,t);l(t,r,i),r in n||(n[r]=a)}t[u]=n}},a=t=>{t[c]||(t[c]=[])};return{setState:(t,...e)=>{a(t),t[c]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[c].indexOf(r);-1!==r&&t[c].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[c].indexOf(e))}}function CO(r,i){const a=new Map(r.map((t,e)=>[t,e]));return(t,e)=>{var n;return"function"!=typeof t?t:(n=a.get(e),t(i?i(e):e,n,i?r.map(i):r))}}function NO(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=J(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=Vp(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=tb();const s=e[t-1];var r=e[t],[r,i,a,o]=((t,e)=>{var[,t,n]=t,[e,,,r]=e;return[t,e,r,n]})(u(s),u(r)),r=(n.moveTo(...r),n.lineTo(...i),n.lineTo(...a),n.lineTo(...o),n.closePath(),Hb(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=J(r,["fill"]),o=new Qo({className:"element-link",style:Object.assign({d:n.toString(),fill:i,zIndex:-2},a)});null!=(r=s.link)&&r.remove(),s.parentNode.appendChild(o),s.link=o}}},t=>{var e;null!=(e=t.link)&&e.remove(),t.link=null}]}function jO(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return y0(e)?(a=n.__data__["points"],[a,i]=g0(e)?Zb(a):a,r=Fb(a,a=e.getCenter()),i=Fb(i,a),a=Ib(r)+zb(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):g0(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function RO(t){var{background:e,scale:a,coordinate:s,valueof:o,padding:r=.001}=t,l=J(t,["background","scale","coordinate","valueof","padding"]);const c="element-background";if(!e)return[()=>{},()=>{}];const n=(t,e)=>{var n=t.invert(e),e=e+t.getBandWidth(n)/2,t=t.getStep(n)/2,n=t*r;return[e-t+n,e+t-n]},u=t=>{var e=a["x"];return HM(e)?(t=t["__data__"],t=t["x"],[e,t]=n(e,t),[e,t]):[0,1]},h=t=>{var e=a["y"];return HM(e)?(t=t["__data__"],t=t["y"],[e,t]=n(e,t),[e,t]):[0,1]},f=(t,e)=>{var[n,r]=u(t),[i,a]=h(t),t=t["__data__"],{y:t,y1:o}=t;return n2([[n,i],[r,i],[r,a],[n,a]].map(t=>s.map(t)),{y:t,y1:o},s,e)},d=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=J(e,["transform","transformOrigin","stroke"]),i=Object.assign({transform:i,transformOrigin:a,stroke:o},e),s=t.cloneNode(!0);for([n,r]of Object.entries(i))s.style[n]=r;return s};return[e=>{e.background&&e.background.remove();var t=Hb(l,t=>o(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2}=t,t=J(t,["fill","fillOpacity","zIndex"]),t=Object.assign(Object.assign({},t),{fill:n,fillOpacity:r,zIndex:i}),n=((()=>{var{x:t,y:e}=a;return[t,e].some(HM)})()?f:d)(e,t);n.className=c,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===c]}function FO(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function BO(e,t){var{elements:n,datum:r,groupKey:i=t=>t,link:a=!1,background:o=!1,delay:s=60,scale:l,coordinate:c,offset:u=0}=t,t=J(t,["elements","datum","groupKey","link","background","delay","scale","coordinate","offset"]);const h=n(e),f=new Set(h),d=zp(h,i);n=CO(h,r);const[p,g]=NO(Object.assign({elements:h,valueof:n,link:a,coordinate:c},Q(t,"link"))),[y,v,m]=RO(Object.assign({scale:l,coordinate:c,background:o,valueof:n},Q(t,"background"))),{setState:b,removeState:x,hasState:w}=LO(Object.assign(Object.assign({},0!==u&&{highlightedTransform:(t,e)=>jO(h[e],u,c)}),t),n);let k;const E=t=>{var e=t["target"];if(f.has(e)){k&&clearTimeout(k);var t=i(e),t=d.get(t),n=new Set(t);for(const r of h)n.has(r)?w(r,"highlighted")||b(r,"highlighted"):(b(r,"unhighlighted"),g(r)),r!==e&&v(r);y(e),p(t)}},M=()=>{for(const t of h)x(t,"unhighlighted","highlighted"),v(t),g(t)},O=t=>{t=t.target;o&&!m(t)||(o||f.has(t))&&(0<s?(k&&clearTimeout(k),k=setTimeout(()=>{M(),k=null},s)):M())},S=()=>{M()};return e.addEventListener("pointerover",E),e.addEventListener("pointerout",O),e.addEventListener("pointerleave",S),()=>{e.removeEventListener("pointerover",E),e.removeEventListener("pointerout",O),e.removeEventListener("pointerleave",S);for(const t of h)v(t),g(t)}}function IO(t){var i=t["delay"],a=J(t,["delay"]);return t=>{var{container:t,view:e}=t,{scale:n,coordinate:r}=e;return BO(MO(t),Object.assign(Object.assign({},_O(a)),{elements:kO,datum:PO(e),scale:n,coordinate:r,delay:i}))}}function DO(t){var i=t["delay"],a=J(t,["delay"]);return t=>{var{container:t,view:e}=t,{scale:n,coordinate:r}=e;return BO(MO(t),Object.assign(Object.assign({},_O(a)),{elements:kO,datum:PO(e),groupKey:TO(e),scale:n,coordinate:r,delay:i}))}}function zO(t){var i=t["delay"],a=J(t,["delay"]);return t=>{var{container:t,view:e}=t,{scale:n,coordinate:r}=e;return BO(MO(t),Object.assign(Object.assign({},_O(a)),{elements:kO,datum:PO(e),groupKey:AO(),scale:n,coordinate:r,delay:i}))}}function GO(e,t){var{elements:n,datum:r,groupKey:c=t=>t,link:u=!1,single:h=!1,coordinate:i,background:a=!1,offset:o=0,scale:s}=t,t=J(t,["elements","datum","groupKey","link","single","coordinate","background","offset","scale"]);const f=n(e),d=new Set(f),p=zp(f,c);n=CO(f,r);const[g,y]=NO(Object.assign({link:u,elements:f,valueof:n,coordinate:i},Q(t,"link"))),[v,m]=RO(Object.assign({background:a,coordinate:i,scale:s,valueof:n},Q(t,"background"))),{setState:b,removeState:l,hasState:x}=LO(Object.assign(Object.assign({},0!==o&&{selectedTransform:(t,e)=>jO(f[e],o,i)}),t),n),w=()=>{for(const t of f)l(t,"selected","unselected"),y(t),m(t)},k=t=>{t=t.target;if(!d.has(t))return w();if(h){var e=t;if(x(e,"selected"))w();else{var n=c(e),n=p.get(n),r=new Set(n);for(const a of f)r.has(a)?b(a,"selected"):(b(a,"unselected"),y(a)),a!==e&&m(a);g(n),v(e)}}else{n=t;t=c(n),t=p.get(t);const o=new Set(t);if(x(n,"selected")){if(!f.some(t=>!o.has(t)&&x(t,"selected")))return w();for(const s of t)b(s,"unselected"),y(s),m(s)}else{var i=t.some(t=>x(t,"selected"));for(const l of f)o.has(l)?b(l,"selected"):x(l,"selected")||b(l,"unselected");!i&&u&&g(t),v(n)}}};return e.addEventListener("click",k),()=>{e.removeEventListener("click",k);for(const t of f)y(t)}}function WO(i){return t=>{var{container:t,view:e}=t,{coordinate:n,scale:r}=e;return GO(MO(t),Object.assign(Object.assign(Object.assign({},i),_O(i)),{elements:kO,datum:PO(e),coordinate:n,scale:r}))}}function HO(n){return t=>{var{container:t,view:e}=t;return GO(MO(t),Object.assign(Object.assign(Object.assign({},n),_O(n)),{elements:kO,datum:PO(e),groupKey:TO(e)}))}}function VO(n){return t=>{var{container:t,view:e}=t;return GO(MO(t),Object.assign(Object.assign(Object.assign({},n),_O(n)),{elements:kO,datum:PO(e),groupKey:AO()}))}}function YO(t){var{wait:M=20,leading:O,trailing:S=!1,labelFormatter:_=t=>""+t}=t,A=J(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:e,view:n,container:r,update:i}=t,{markState:a,scale:o,coordinate:s}=n;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(a,"line",["x","y","series"]);if(!t)return;const{y:f,x:d,series:l=[]}=t;t=f.map((t,e)=>e);const c=Vp(t.map(t=>d[t])),u=R({},e),h=u.marks.find(t=>"line"===t.type);t=n0(Gp(t,t=>n0(t,t=>+f[t])/i0(t,t=>+f[t]),t=>l[t]).values());R(h,{scale:{y:{domain:[1/t,t]}}});const p=MO(r),g=r.getElementsByClassName(nt);const y=zp(r.getElementsByClassName(at),t=>t.__data__.key.split("-")[0]),v=new Zo({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},Q(A,"rule"))}),m=new ss({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},Q(A,"label"))}),b=(v.append(m),p.appendChild(v),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[Cp(c,n)]}),x=(t,e)=>{v.setAttribute("x1",t[0]),v.setAttribute("x2",t[0]),m.setAttribute("text",_(e))};let w;var k;const E=Wf(t=>{t=OO(p,t);if(t){var{scale:e,coordinate:n}=w,{x:e,y:r}=e,i=b(n,e,t);x(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[_p(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),y.get(o)||[]);for(const h of s)h.setAttribute("dy",c)}}},M,{leading:O,trailing:S});return k=[0,0],Oe(this,void 0,void 0,function*(){var t=o["x"];const n=b(s,t,k);x(k,n);t=function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(h);t.groupBy="color",t.basis=(t,e)=>{return e[t[_p(t=>d[+t]).center(t,n)]]};for(const e of u.marks)e.animate=!1;t=yield i(u);w=t.view}),p.addEventListener("pointerenter",E),p.addEventListener("pointermove",E),p.addEventListener("pointerleave",E),()=>{v.remove(),p.removeEventListener("pointerenter",E),p.removeEventListener("pointermove",E),p.removeEventListener("pointerleave",E)}}}function qO({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:e,update:r,container:n}=t,i=MO(n),a=R({},e);for(const s of a.marks)s.animate=!1;const o=Wf(t=>{var e,n,t=OO(i,t);t&&([t,e]=t,(n=function(t){var{coordinates:e=[]}=t,n=e.find(t=>"fisheye"===t.type);return n||(e.push(n={type:"fisheye"}),t.coordinates=e,n)}(a)).focusX=t,n.focusY=e,n.isVisual=!0,r(a))},l,{leading:c,trailing:u});return i.addEventListener("pointerenter",o),i.addEventListener("pointermove",o),i.addEventListener("pointerleave",o),()=>{i.removeEventListener("pointerenter",o),i.removeEventListener("pointermove",o),i.removeEventListener("pointerleave",o)}}}function UO(t,e,n,r){var{tooltipElement:i=function(t,e,n){var{min:[r,i],max:[a,o]}=t.getBounds(),e=new C5({className:"tooltip",style:{x:e,y:n,container:{x:0,y:0},items:[],bounding:{x:r,y:i,width:a-r,height:o-i},title:" ",position:"bottom-right",offset:[10,10],style:{".tooltip":{},".tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}});return t.getRootNode().defaultView.getConfig().container.appendChild(e.HTMLTooltipElement),e}(t,n,r)}=t,{items:e,title:a}=e;i.show(),i.position=[n,r],i.update({items:e,title:a}),t.tooltipElement=i}function XO(t){t=t.tooltipElement;t&&t.hide()}function $O(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function KO(t){return Object.fromEntries(Object.entries(t).filter(([,t])=>ug(t)))}function ZO(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e||n}=t;return t}function JO(t){return dg(t)?t:{value:void 0===t?t:""+t}}function QO(n,s,l,t=n.map(t=>t.__data__)){e=t.map(t=>t.title),e=new Map(e.map(t=>[t instanceof Date?+t:t,t]));var e=Array.from(e.values()).filter(ug),t=t.flatMap((a,t)=>{var t=n[t],e=J(a,["title"]);const o=ZO(t);return Object.entries(e).filter(([t])=>t.startsWith("tooltip")).map(([t,e])=>{var{field:n,title:n=n}=l[t].getOptions(),e=JO(e),{field:r=void 0,color:i=o,name:r=function(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Yv);return i(t)?t.invert(e):i(n)?n.invert(r):null}(l,a)||r||n,value:n}=e,e=J(e,["field","color","name","value"]);return Object.assign(Object.assign(Object.assign({},e),{name:r,color:i,value:n}),KO(s({channel:t,value:n})))}).filter(({value:t})=>void 0!==t)});return Object.assign(Object.assign({},0<e.length&&{title:e.join(",")}),{items:t})}function t3(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function e3(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function n3(t,e){return void 0===t?e:t}function r3(h,t){var{elements:e,wait:n=50,leading:r=!0,trailing:i=!1,scale:f,coordinate:d,crosshairs:p,item:g,startX:y=0,startY:v=0}=t,t=J(t,["elements","wait","leading","trailing","scale","coordinate","crosshairs","item","startX","startY"]),e=e(h);const[,m]=function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return[n-t,r-e]}(h),b=[],x=[];for(const l of e){var a=l["__data__"],a=a["seriesX"];(a?b:x).push(l)}const w=new Map(b.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[Vp(n.map((t,e)=>e),t=>n[+t]),n]]}));e=x.map((t,e)=>e);const k=x.map(t=>{t=t.__data__;return t.x}),E=Vp(e,t=>k[t]),M=Q(t,"crosshairs");e=f.x;const O=null!=e&&e.getBandWidth?e.getBandWidth()/2:0,o=Wf(t=>{t=OO(h,t);if(t){var e=h.getBounds(),n=e.min[0],e=e.min[1];const o=[t[0]-y,t[1]-v];o;var r=((t,e,n)=>{var r=e.length;if(0===r)return[];var[t]=d.invert(t),t=t-O,i=(0,_p(t=>n[+t]).center)(e,t);let a=i,o=i;for(;0<a-1&&n[e[a-1]]==n[e[i]];)a--;for(;o+1<r&&n[e[o+1]]===n[e[i]];)o++;return d0(a,o+1).map(t=>e[t])})(o,E,k).map(t=>x[t]),i=b.map(t=>{var[e,n]=w.get(t),t=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")).map(([t,e])=>{e=e[n];return[Pf(t.replace("series","")),e]}))})(t,((t,e,n)=>{var[t]=d.invert(t);return e[(0,_p(t=>n[+t]).center)(e,t-O)]})(o,e,n)),{x:e,y:n}=t;return[t,d.map([e+O,n])]}),a=[...i.map(t=>t[0]),...r.map(t=>t.__data__)],r=QO([...b,...r],g,f,a);if(UO(h,r,t[0]+n,t[1]+e),p){a=i.map(t=>t[1]);{var r=h,n=a,{height:e,startX:i,startY:a}=t=Object.assign(Object.assign({},M),{height:m,startX:y,startY:v}),t=J(t,["height","startX","startY"]);const s=(n=u0(n.map(t=>t[0])))+i,l=n+i,c=a,u=e-a;(i=r.ruleY||(n=new Zo({style:Object.assign({x1:s,x2:l,y1:c,y2:u,lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},t)}),r.appendChild(n),n)).style.x1=s,i.style.x2=l,i.style.y1=c,i.style.y2=u,r.ruleY=i}}}},n,{leading:r,trailing:i}),s=()=>{XO(h),p&&t3(h)};return h.addEventListener("pointerenter",o),h.addEventListener("pointermove",o),h.addEventListener("pointerleave",s),()=>{h.removeEventListener("pointerover",o),h.removeEventListener("pointerout",o),h.removeEventListener("pointerleave",s),$O(h),p&&t3(h)}}function i3(r,{elements:t,scale:i,wait:e=50,leading:n=!0,trailing:a=!1,groupKey:o=t=>t,item:s}){t=t(r);const l=new Set(t),c=zp(t,o),u=Wf(t=>{var e,n=t["target"];l.has(n)&&(n=o(n),n=1===(n=c.get(n)).length?function(t,a,o){var e=(n=t["__data__"])["title"],n=J(n,["title"]);const s=ZO(t);return t=Object.entries(n).filter(([t])=>t.startsWith("tooltip")).map(([t,e])=>{var{field:n,title:n=n}=o[t].getOptions(),e=JO(e),{field:r=void 0,color:i=s,name:r=r||n,value:n}=e,e=J(e,["field","color","name","value"]);return Object.assign(Object.assign(Object.assign({},e),{color:i,name:r,value:n}),KO(a({channel:t,value:n})))}).filter(({value:t})=>void 0!==t),Object.assign(Object.assign({},e&&{title:e}),{items:t})}(n[0],s,i):QO(n,s,i),{offsetX:t,offsetY:e}=t,UO(r,n,t,e))},e,{leading:n,trailing:a}),h=t=>{t=t.target;l.has(t)&&XO(r)};return r.addEventListener("pointerover",u),r.addEventListener("pointermove",u),r.addEventListener("pointerout",h),()=>{r.removeEventListener("pointerover",u),r.removeEventListener("pointermove",u),r.removeEventListener("pointerout",h),$O(r)}}function a3(t){const{shared:u,crosshairs:h,series:f,item:d=()=>({}),facet:p=!1}=t,g=J(t,["shared","crosshairs","series","name","item","facet"]);return(e,t)=>{var{container:n,view:r}=e;const{scale:i,markState:a,coordinate:o}=r;var s=e3(a,"seriesTooltip"),l=e3(a,"crosshairs"),n=MO(n),s=n3(f,s);if(s&&!p)return r3(n,Object.assign(Object.assign({},g),{elements:kO,scale:i,coordinate:o,crosshairs:n3(h,l),item:d}));if(s&&p){s=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const c=EO(e,t),i=s[0].view.scale;t=n.getBounds(),s=t.min[0],t=t.min[1];return r3(n.parentNode.parentNode,Object.assign(Object.assign({},g),{elements:()=>c,scale:i,coordinate:o,crosshairs:n3(h,l),item:d,startX:s,startY:t}))}return i3(n,Object.assign(Object.assign({},g),{elements:kO,scale:i,coordinate:o,groupKey:u?TO(r):void 0,item:d}))}}wO.props={};const o3="legend-category",s3="items-item",l3="legend-category-item-marker",c3="legend-category-item-label";function u3(t){return t.getElementsByClassName(l3)[0]}function h3(t){return t.getElementsByClassName(c3)[0]}function f3(t){return t.getElementsByClassName(s3)}function d3(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function p3(t){const e=function(t){let e=t;for(;e&&!e.attr("class").startsWith("legend");)e=e.children[0];return e.attributes}(t)["data"];t=d3(t).scales[0].name;return[t,{legends:f3,marker:u3,label:h3,datum:t=>{t=t.__data__,t=t.index;return e[t].label}}]}function g3(t,e){var{legends:n,marker:i,label:a,datum:o,filter:r,setAttribute:s}=e,e=J(e,["legends","marker","label","datum","filter","setAttribute"]);const l=new Map,c=new Map,u=new Map;var e=0===Object.keys(e).length?{labelUnselectedFill:"#aaa",markerUnselectedFill:"#aaa",markerUnselectedStroke:"#aaa"}:e,h=Q(e,"marker"),e=Q(e,"label");const{setState:f,removeState:d}=LO(h,void 0,s),{setState:p,removeState:g}=LO(e,void 0,s),y=Array.from(n(t)),v=y.map(o),m=()=>{for(const r of y){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(d(e,"unselected"),g):(f(e,"unselected"),p))(n,"unselected")}};for(const k of y){var b=()=>{FO(t,"pointer")},x=()=>{FO(t,"default")},w=()=>Oe(this,void 0,void 0,function*(){var t=o(k),e=v.indexOf(t);-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...y.map(o)),yield r(v),m()});k.addEventListener("click",w),k.addEventListener("pointerenter",b),k.addEventListener("pointerout",x),l.set(k,w),c.set(k,b),u.set(k,x)}return()=>{for(const t of y)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",c.get(t)),t.removeEventListener("pointerout",u.get(t))}}function y3(t){var s=t["channel"],r=J(t,["channel"]);return t=>{const{container:e,view:i,options:a,update:o}=t;var t=e.getElementsByClassName(o3),t=s?t.find(t=>{t=t.parentNode.__data__;return t.scale.name===s}):t[0],[t,n]=t?p3(t):[null,{}];return t&&(s=t),g3(e,Object.assign(Object.assign(Object.assign({},n),{filter:r=>Oe(this,void 0,void 0,function*(){var t=i["scale"];const{[s]:n}=t;t=a.marks,t=t.map(t=>{var{transform:e=[]}=t,e=[{type:"filter",[s]:r},...e];return R({},t,{transform:e,scale:{[s]:{domain:n.getOptions().domain}}})}),t=Object.assign(Object.assign({},a),{marks:t});return o(t)})}),r))}}function v3(t){var E=J(t,["channel"]);return t=>{const{container:e,view:n}=t;t=e.getElementsByClassName(o3);const r=kO(e);for(const s of t){const l=t=>{var e=s.attributes["data"],t=t["__data__"],t=t["index"];return e[t].label},c=d3(s).scales[0].name,u=f3(s),h=(t=>{var{scale:{[t]:t}}=n;return t})(c),f=zp(r,t=>h.invert(t.__data__[c])),{setState:d,removeState:p}=LO(E);var i=Q(E,"marker"),a=Q(E,"label");const{setState:g,removeState:y}=LO(i),{setState:v,removeState:m}=LO(a),b=t=>{for(const r of u){var e=u3(r),n=h3(r);(r===t||null===t?(y(e,"unhighlighted"),m):(g(e,"unhighlighted"),v))(n,"unhighlighted")}},x=new Map;for(const k of u){var o=()=>{var t=l(k),e=new Set(f.get(t));for(const n of r)e.has(n)?d(n,"highlighted"):d(n,"unhighlighted");b(k)};k.addEventListener("pointerover",o),x.set(k,o)}const w=()=>{for(const t of r)p(t,"unhighlighted","highlighted");b(null)};return s.addEventListener("pointerleave",w),()=>{s.removeEventListener(w);for(var[t,e]of x)t.removeEventListener(e)}}}}function m3(a,t){var{brushed:i=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(a),brushRegion:l=(t,e,n,r,i)=>[t,e,n,r],reverse:c=!1,fill:n="#777",fillOpacity:r="0.3",stroke:u="#fff"}=t,h=J(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke"]);let f=null,d=null,p=null,g=null,y=null,v=!1;const[m,b,x,w]=s,k=(FO(a,"crosshair"),a.style.draggable=!0,()=>{y=new Qo({style:Object.assign(Object.assign({},h),{fill:n,fillOpacity:r,stroke:u,pointerEvents:"none"})}),g=new as({style:{draggable:!0,fill:"transparent"},className:"mask"}),a.appendChild(y),a.appendChild(g)}),E=()=>{g=new as({style:Object.assign(Object.assign({},h),{fill:n,fillOpacity:r,stroke:u,draggable:!0}),className:"mask"}),a.appendChild(g)},M=()=>{g&&g.remove(),y&&y.remove(),f=null,d=null,p=null,v=!1,g=null,y=null,e()},O=(t,e)=>{var[t,e,n,r]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,n,r]=l(t,e,n,r,s);return(c?_:S)(t,e,n,r),i(t,e,n,r),[t,e,n,r]},S=(t,e,n,r)=>{g.style.x=t,g.style.y=e,g.style.width=n-t,g.style.height=r-e},_=(t,e,n,r)=>{y.style.d=`
8
+ M${m},${b}L${x},${b}L${x},${w}L${m},${w}Z
9
9
  M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z
10
- `,g.style.x=t,g.style.y=e,g.style.width=n-t,g.style.height=r-e},A=t=>{var e=t["target"],[t,n]=IM(a,t);e===g?p=[t,n]:(((t,e)=>{if(g&&g.remove(),y&&y.remove(),f=[t,e],c)return k();E()})(t,n),m=!0)},T=t=>{var e,n,r,t=IM(a,t);f&&(p?(n=(t,e,n,r,i)=>t+e<r?r-e:i<t+n?i-n:t,r=(e=t)[0]-p[0],e=e[1]-p[1],r=n(r,f[0],d[0],v,x),n=n(e,f[1],d[1],b,w),e=[f[0]+r,f[1]+n],r=[d[0]+r,d[1]+n],O(e,r)):O(f,t))},P=t=>{var e,n,r,i;p?(p=null,{x:e,y:r,width:n,height:i}=g.style,f=[e,r],d=[e+n,r+i]):(d=IM(a,t),[e,n,r,i]=O(f,d),m=!1,o(e,n,r,i))},L=t=>{t=t.target;g&&t!==g&&M()},C=t=>{t=t.target;t!==g||m?HM(a,"crosshair"):HM(a,"move")},N=()=>{HM(a,"default")};return a.addEventListener("dragstart",A),a.addEventListener("drag",T),a.addEventListener("dragend",P),a.addEventListener("click",L),a.addEventListener("pointermove",C),a.addEventListener("pointerleave",N),{mask:g,remove(){g&&M()},destroy(){g&&M(),a.removeEventListener("dragstart",A),a.removeEventListener("drag",T),a.removeEventListener("dragend",P),a.removeEventListener("click",L),a.removeEventListener("pointermove",C),a.removeEventListener("pointerleave",N)}}}function kO(t,e){var{elements:n,siblings:r=t=>[],datum:i,brushRegion:a,extent:o,reverse:s,series:l=!1,key:d=t=>t,bboxOf:c=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}}}=e,e=J(e,["elements","siblings","datum","brushRegion","extent","reverse","series","key","bboxOf"]);const p=n(t),g=r(t),y=g.flatMap(n);r=YM(p,i),n=Q(e,"mask");const{setState:m,removeState:u}=WM(e,r),h=new Map,{width:f,height:v,x:b,y:x}=c(t);i=o||[0,0,f,v];return wO(t,Object.assign(Object.assign({},n),{extent:i,brushRegion:a,reverse:s,brushended:l?()=>{for(const t of p)u(t,"unhighlighted");for(const e of h.values())e.remove();h.clear()}:()=>{for(const t of[...p,...y])u(t,"highlighted","unhighlighted")},brushed:l?(t,e,n,r)=>{var i;for(const o of p){var a=h.get(o)||(a=o,i=void 0,i=a.cloneNode(),a.parentNode.appendChild(i),h.set(a,i),i);a.style.clipPath=new os({style:{x:t+b,y:e+x,width:n-t,height:r-e}}),m(o,"unhighlighted"),m(a,"highlighted")}}:(t,e,n,r)=>{var i;for(const u of g)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of p){var{min:o,max:s}=h.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r<e||o<t||i<a||s<n)}([o,l,s,c],[t,e,n,r])?m(h,"unhighlighted"):(m(h,"highlighted"),a.add(d(h)))}for(const f of y)a.has(d(f))?m(f,"highlighted"):m(f,"unhighlighted")}}))}function EO(t){var{facet:u,brushKey:h}=t,f=J(t,["facet","brushKey"]);return(t,r)=>{var e,n,i,a,{container:o,view:s}=t,o=RM(o),l={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1};if(u)return e=(a=o.getBounds()).min[0],n=a.min[1],i=a.max[0],a=a.max[1],kO(o.parentNode.parentNode,Object.assign(Object.assign({elements:()=>jM(t,r),datum:GM(s),brushRegion:(t,e,n,r)=>[t,e,n,r],maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,extent:[e,n,i,a]},l),f));const c=kO(o,Object.assign(Object.assign({elements:NM,key:t=>t.__data__.key,siblings:()=>{return e=t,n=h,r.filter(t=>{return t!==e&&({interactions:t=[]}=t.options,t.find(t=>t.brushKey===n))}).map(t=>RM(t.container));var e,n},datum:GM(s),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0},l),f));return o.brush=c,()=>c.destroy()}}function MO(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function OO(t){return EO(Object.assign(Object.assign({},t),{brushRegion:MO}))}function SO(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function _O(t){return EO(Object.assign(Object.assign({},t),{brushRegion:SO}))}const AO="axis",TO="axis-hot-area";function PO(t){return t.getElementsByClassName(AO)}function LO(t){return t.getElementsByClassName("axis-line")[0]}function CO(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function NO(t,e){var{cross:n,offsetX:i}=e,e=J(e,["cross","offsetX","offsetY"]),r=CO(t),[t]=LO(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:SO,hotZone:new os({className:TO,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function jO(t,e){var{offsetY:i,cross:n=!1}=e,e=J(e,["offsetY","offsetX","cross"]),r=CO(t),[,t]=LO(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:MO,hotZone:new os({className:TO,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function RO(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:l,reverse:c=!1}=e,e=J(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse"]);const u=r(t);r=n(t);const h=WM(e,YM(u,o))["setState"],f=new Map;var d=Q(e,"mask");const p=()=>{for(const t of u)(t=>Array.from(f.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(t))?h(t,"highlighted"):h(t,"unhighlighted")};var g=r.some(a)&&r.some(t=>!a(t));for(const y of r){const{hotZone:m,brushRegion:v,extent:b}=(a(y)?jO:NO)(y,{offsetY:s,offsetX:l,cross:g,zIndex:999,fill:"transparent"});y.parentNode.appendChild(m),wO(m,Object.assign(Object.assign({},d),{reverse:c,brushRegion:v,brushended(){f.delete(y),p()},brushed(t,e,n,r){f.set(y,b(t,e,n,r)),p()}}))}}function FO(i){return t=>{var{container:t,view:e}=t,{x:n,y:r}=RM(t).getBBox();return RO(t,Object.assign({elements:NM,axes:PO,offsetY:r,offsetX:n,points:t=>t.__data__.points,horizontal:t=>t.attributes.horizontal,datum:GM(e),unhighlightedOpacity:.5},i))}}function IO(t,e){var{filter:i,reset:n,brushRegion:r,extent:a,reverse:o}=e,e=Q(J(e,["filter","reset","brushRegion","extent","reverse","series"]),"mask"),{width:s,height:l}=t.getBBox(),a=a||[0,0,s,l];const c=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),u=wO(t,Object.assign(Object.assign({},e),{extent:a,brushRegion:r,reverse:o,brushcreated:function(t,e,n,r){i(t,e,n,r),u.remove()}}));function h(t){c(t)&&n()}return t.addEventListener("click",h),()=>{u.destroy(),t.removeEventListener("dblclick",h)}}function BO(t){var{hideX:y=!0,hideY:m=!0}=t,i=J(t,["hideX","hideY"]);return(t,e)=>{const{container:n,view:r,options:h,update:f}=t;t=RM(n);let d=!1,p=!1,g=r;return IO(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],filter:(s,l,c,u)=>Oe(this,void 0,void 0,function*(){if(!p){p=!0;const{scale:e,coordinate:r}=g,{x:i,y:a}=e;var t=(t,e)=>{var[t,n]=r.invert(t);return[rM(i,t,e),rM(a,n,e)]};const n=t([s,l],!0),o=t([c,u],!1);t=h["marks"],t=t.map(t=>R({axis:Object.assign(Object.assign({},y&&{x:{labelTransforms:[{type:"hide"}]}}),m&&{y:{labelTransforms:[{type:"hide"}]}})},t,{scale:{x:{domain:iM(i,[n[0],o[0]])},y:{domain:iM(a,[n[1],o[1]])}}})),t=Object.assign(Object.assign({},h),{marks:t,clip:!0}),t=yield f(t);g=t.view,p=!1,d=!0}}),reset:()=>{!p&&d&&(d=!1,g=r,f(h))},extent:void 0},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),i))}}function DO(t){return BO(Object.assign(Object.assign({hideX:!0},t),{brushRegion:MO}))}function zO(t){return BO(Object.assign(Object.assign({hideY:!0},t),{brushRegion:SO}))}const GO="slider";function WO({wait:p=50,leading:g=!0,trailing:y=!1}){return t=>{const{container:e,view:n,options:l,update:c}=t;t=e.getElementsByClassName(GO);if(t.length){let s=!1;const u=n["scale"];var{x:r,y:i}=u;const o=new Map,h={x:r.getOptions().domain,y:i.getOptions().domain};for(const f of t){const d=f.attributes["orient"];var a=zf(o=>Oe(this,void 0,void 0,function*(){var t,e,n,r,i,a=o.detail["value"];s||(s=!0,i="vertical"===d?"y":"x",a=function(t,e){var[t,n]=t;return iM(e,[rM(e,t,!0),rM(e,n,!1)])}(a,u[i]),h[i]=a,t="vertical"===d?"x":"y",e=h[t],n=l,r={[i]:{domain:a},[t]:{domain:e}},i=(i=n["marks"]).map(t=>R({axis:{x:{labelTransforms:[{type:"hide"}]},y:{labelTransforms:[{type:"hide"}]}}},t,{scale:r,slider:Object.assign(Object.assign({},t.slider.x&&{x:{preserve:!0}}),t.slider.y&&{y:{preserve:!0}}),animate:!1})),a=Object.assign(Object.assign({},n),{marks:i,clip:!0,animate:!1}),yield c(a),s=!1)}),p,{leading:g,trailing:y});f.addEventListener("valuechange",a),o.set(f,a)}return()=>{for(var[t,e]of o)t.removeEventListener("valuechange",e)}}}}function YO(n){return(t,...e)=>R({},n(t,...e),t)}function VO(n){return(t,...e)=>R({},t,n(t,...e))}function HO(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=J(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const qO=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map(t=>{var e=t["data"],t=J(t,["data"]);return Object.assign(Object.assign({},t),{data:HO(e,o),x:n,y:r,width:i,height:a})})},UO=(qO.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],y=g["data"],g=J(g,["data"]),y=HO(y,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:y},g)),p+=f[t]+i}return d}),XO=(UO.props={},()=>t=>{var e=t["children"],t=J(t,["children"]);if(!Array.isArray(e))return[];const{data:a,scale:o={},axis:s={},legend:l={}}=t,n=J(t,["data","scale","axis","legend"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={}}=t,t=J(t,["data","scale","axis","legend"]);return Object.assign({data:HO(e,a),scale:R({},o,n),axis:!(!r||!s)&&R({},s,r),legend:!(!i||!l)&&R({},l,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),$O=(XO.props={},()=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,data:v,coordinates:b,theme:x,component:w,interactions:k,x:E,y:M,key:O,frame:S,title:_,labelTransform:A,parentKey:T,clip:P}=t,t=J(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinates","theme","component","interactions","x","y","key","frame","title","labelTransform","parentKey","clip"]);return[{type:"standardView",x:E,y:M,key:O,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinates:b,component:w,interactions:k,frame:S,title:_,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:T,clip:P,marks:[Object.assign(Object.assign({},t),{key:O+"-0",data:v})]}]}),KO=($O.props={},YO(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=Np(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}})),ZO=YO(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:u,encode:h={},scale:n={},legend:f={}}=r.shift();var s=h["color"],l=n["color"],c=f["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(u)&&r.push(...u)}return{encode:{color:i},scale:{color:R({},a,{domain:void 0!==(t=null==(t=null===n||void 0===n?void 0:n.color)?void 0:t.domain)?t:void 0!==i?Array.from(new Set(e.map(t=>t[i]))):void 0,type:"ordinal"})},legend:{color:R({title:i},o)}}}),JO=YO(()=>({animate:{enterType:"fadeIn"}})),QO=VO(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),t3=VO(()=>({type:"cell"})),e3=VO(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),n3=VO((t,c=function(t){t=t.points;return _b(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?r3(a,e):(t=e.length?void 0:null,R({title:r===i-1&&void 0,grid:t},a))}},k=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?r3(r,e):(n=e.length?void 0:null,R({title:0===t&&void 0,grid:n},r))}},E={})=>{const{data:e,encode:n,children:u,scale:r,x:M=0,y:O=0,shareData:h=!1,key:S}=t,_=e["value"],{x:A,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:m}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=Pb(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[A]:t,[T]:e}=t,t=void 0===A||t===n,e=void 0===T||e===r;return t&&e}).map(t=>_.filter(t)),v=h?Xp(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:A,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=J(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:A?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:_,l={color:{domain:P}},o={x:i3(o,w)(p,r),y:i3(a,k)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+M,y:h+m+O,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:R(s,e,l),axis:R({},i,o),legend:!1},t),E)})})}}});function r3(t,e){return e.length?R({title:!1,tick:null,label:null},t):R({title:!1,tick:null,label:null,grid:null},t)}function i3(t,e){return"function"==typeof t?t:null===t?()=>null:e(t)}const a3=()=>t=>{return[hM.of(t).call(t3).call(ZO).call(JO).call(KO).call(QO).call(e3).call(n3).value()]},o3=(a3.props={},YO(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),s3=VO(t=>{const{data:w,children:c,x:k=0,y:E=0,key:M}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=Pb(t);const s=t.map(({points:t})=>_b(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],[p,g]=l[c],y=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=J(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return r3(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return r3(n,e)})(y,w)};return Object.assign({data:w,parentKey:M,key:i+"-"+c,x:u+m+k,y:h+v+E,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:R({x:{facet:!1},y:{facet:!1}},e),axis:R({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:R({},a,{x:p,y:g})},t)})})}}}),l3=VO(t=>{var e=t["encode"],t=J(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=J(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const c3=()=>t=>{return[hM.of(t).call(t3).call(ZO).call(s3).call(l3).call(JO).call(QO).call(o3).value()]},u3=YO(t=>({scale:{x:{guide:{type:"axisX"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),h3=YO(t=>({coordinates:[{type:"polar"}]})),f3=t=>{var e=t["encode"],t=J(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function d3(t){return t=>null}function p3(t){var t=t["points"],[t,e,n,r]=t,i=Mb(t,r),t=Eb(t,r),r=Eb(e,n),r=(e=r,r=Ob(r=t),e=Ob(e),r<e?e-r:2*Math.PI-(r-e)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=Sb(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const g3=()=>t=>{return[hM.of(t).call(t3).call(f3).call(ZO).call(h3).call(e3).call(n3,p3,d3,d3,{frame:!1}).call(JO).call(QO).call(u3).value()]};const y3=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],h=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=R({enterDuration:e,updateDuration:e,exitDuration:e,updateEasing:n,updateType:"morphing",updateFill:"both",exitType:"fadeOut"},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t<l;){n=c,a=t,o=u,s=void 0,s=[0,o],o=[1-o,1];var[n,r]="normal"===n?s:"reverse"===n?o:"alternate"===n?a%2==0?s:o:"reverse-alternate"===n?a%2==0?o:s:void 0;for(let t=n;t<r;t+=1){var i=Math.abs(t);e!==i&&(yield h[i]),e=i}t++}var a,o,s}};function m3(t,e){if(null!==t)return{type:"column",value:t,field:e}}function v3(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function b3(t,e){var n=[];for(const r of t)n[r]=e;return n}function x3(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function w3(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=x3(t,i);if(null!==n)return[n,r]}return[null,null]}function k3(t){return!(t instanceof Date)&&"object"==typeof t}y3.props={};const E3=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,R({},e,{encode:{y1:m3(b3(t,0))}})]};function M3(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=x3(r,t))?void 0:t[0]]}).filter(([,t])=>Z0(t));return Array.from(Np(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function O3(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:xp(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>C3(t=>r(e[t]))):"series"===t?A3:"value"===t?T3:"sum"===t?P3:"maxIndex"===t?L3:()=>null}function S3(t,e){for(const n of t)n.sort(e)}function _3(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function A3(t,e,n){return C3(t=>n[t])}function T3(t,e,n){return C3(t=>e[t])}function P3(t,n,e){t=Pb(t),t=Array.from(Np(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return C3(t=>r.get(e[t]))}function L3(t,n,e){t=Pb(t),t=Array.from(Np(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,$p(e,t=>n[t])]));return C3(t=>r.get(e[t]))}function C3(n){return(t,e)=>xp(n(t),n(e))}E3.props={};const N3=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:L=!1,y:C="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=x3(r,"y"),[s,l]=x3(r,"y1"),[r]=j?w3(r,"series","color"):x3(r,"color"),c=M3(T,t,e),n=O3(P)(n,a,r),u=(n&&S3(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const O of c){L&&O.reverse();var g=s?+s[O[0]]:0,y=[],m=[];for(const S of O){var v=f[S]=+a[S]-g;v<0?m.push(S):0<=v&&y.push(S)}var b=0<y.length?y:m,x=0<m.length?m:y;let t=y.length-1,e=0;for(;0<t&&0===a[b[t]];)t--;for(;e<x.length-1&&0===a[x[e]];)e++;d.push(b[t]),p.push(x[e]);let n=g;for(const _ of m.reverse()){var w=f[_];n=u[_]=(h[_]=n)+w}let r=g;for(const A of y){var k=f[A];0<k?r=u[A]=(h[A]=r)+k:u[A]=h[A]=r}}const E=new Set(d),M=new Set(p);r="y"===C?u:h,n="y"===N?u:h;return[t,R({},e,{encode:{y:m3(r,o),y1:m3(n,l)},style:Object.assign({first:(t,e)=>E.has(e),last:(t,e)=>M.has(e)},i)})]}};function j3(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}N3.props={};const R3=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(j3)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",N3({groupBy:r})(t,e,n))},F3=(R3.props={},(t={})=>{const{channel:i="x"}=t;return(t,e)=>{var n=e["encode"],r=n["title"];return void 0!==r?[t,e]:([r,n]=x3(n,i),[t,R({},e,{encode:{title:m3(r,n)}})])}}),I3=(F3.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,R({},e,{encode:{x:m3(b3(t,0))},scale:{x:{guide:null}}})]}),B3=(I3.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,R({},e,{encode:{y:m3(b3(t,0))},scale:{y:{guide:null}}})]}),D3=(B3.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,R({},e,{encode:{size:v3(b3(t,3))}})]}),z3=(D3.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=J(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,R({},e,{encode:{key:m3(r)}})]}),G3=(z3.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=x3(n,"color"),[t,R({},e,{encode:{series:m3(r,i)}})])}),W3=(G3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(k3)?[t,e]:[t,R({},e,{encode:{y:m3(n)}})]}),Y3=(W3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(k3)?[t,e]:[t,R({},e,{encode:{x:m3(n)}})]}),V3=(Y3.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=x3(n,"y"),[t,R({},e,{encode:{y1:m3([...r])}})])}),H3=(V3.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=x3(n,"x"),[t,R({},e,{encode:{x1:m3([...r])}})])}),q3=(H3.props={},t=>{const r=t["channel"];return(t,e)=>{const i=e["encode"];var n=i["tooltip"];if(void 0!==n)return[t,e];n=Array.isArray(r)?r:[r];let a=0;n=n.flatMap(e=>Object.entries(i).filter(([t])=>t.startsWith(e)).flatMap(([t])=>{const[e,n]=x3(i,t);var r,t=[[t,m3(e)]];return e&&null!==n&&(r=e.map(t=>({value:t,field:n})),t.push(["tooltip"+(0===a?"":a),m3(r,n)]),a++),t}));return[t,R({},e,{encode:Object.fromEntries(n)})]}}),U3=(q3.props={},()=>(t,e)=>[t,R({scale:{x:{padding:0},y:{padding:0}}},e)]),X3=(U3.props={},()=>(t,e)=>{var{style:n={}}=e,r=J(e,["data","style"]),{x:i,y:a}=n,n=J(n,["x","y"]);return null==i||null==a?[t,e]:[[0],R({},r,{data:[0],cartesian:!0,encode:{x:m3([i||0]),y:m3([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),$3=(X3.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,R({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),K3=($3.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(k3)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,R({},e,{encode:{x:m3(n),y:m3(r)}})])}),Z3=(K3.props={},()=>(t,e)=>{var{style:n={}}=e,n=n["gradient"];return n?[t,R({},e,{encode:{series:v3(b3(t,void 0))}})]:[t,e]}),J3=(Z3.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return J(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=x3(r,"y"),[r]=w3(r,"series","color"),o=_3(r,i),i=M3(c,t,e),n=O3(h)(n,a,r),s=(n&&S3(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t<l.length;t++)s[l[t]]=o[t]}return[t,R({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:m3(s)}})]}}),Q3=(J3.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:y=null,reverse:m=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,x3(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,h]of r){var a=[];for(const n of i){var o=Array.from(Np(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=x3(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[b3(n,r)]:w3(e,"enterDuration",b3(n,r));var[l]=w3(e,"enterDelay",b3(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=Xp(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,R({},t,{encode:{enterDuration:v3(s),enterDelay:v3(c)}})]}});Q3.props={};const tS=(t={})=>{const{groupBy:d="x",basis:p="max"}=t;return(e,t)=>{const n=t["encode"];var r,i=J(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,x3(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=M3(d,e,t),l="function"==typeof(r=p)?r:{min:(t,e)=>Kp(t,t=>e[+t]),max:(t,e)=>Xp(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>Qp(t,t=>e[+t]),median:(t,e)=>t0(t,t=>e[+t]),sum:(t,e)=>r0(t,t=>e[+t]),deviation:(t,e)=>_p(t,t=>e[+t])}[r]||Xp;for(const e of i){var c=l(e,o);for(const f of e)for(let t=0;t<a.length;t++){var[,u]=a[t],[,h]=s[t];h[f]=+u[f]/c}}return[e,R({},t,{encode:Object.fromEntries(s.map(([t,e])=>[t,m3(e,x3(n,t)[1])]))})]}};function eS(t,e,n){return null===t?[-.5,.5]:(t=_3(t,e),[-(e=new Sm({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function nS(t,e,n){return e*(1-t)+n*t}tS.props={};const rS=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=x3(n,"x"),[n]=x3(n,"y");const o=eS(a,r,l),s=eS(n,i,c);a=t.map(()=>nS(u(),...s)),r=t.map(()=>nS(u(),...o));return[t,R({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:m3(a),dx:m3(r)}})]}},iS=(rS.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=x3(n,"x");const i=eS(n,r,a);n=t.map(()=>nS(o(),...i));return[t,R({scale:{x:{padding:.5}}},e,{encode:{dx:m3(n)}})]}}),aS=(iS.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=J(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,x3(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=M3(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Ap(e.flatMap(e=>i.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t<o.length;t++){var h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,R({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,m3(e,x3(n,t)[1])]))})]}}),oS=(aS.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=x3(n,"y");var[,i]=x3(n,"y1"),n=(h?w3(n,"series","color"):x3(n,"color"),M3(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;n<c.length;n++){var s=c[n],l=Math.max(...o.filter((t,e)=>e!==n));a[s]=r[s]>l?l:r[s]}}return[t,R({},e,{encode:{y1:m3(a,i)}})]}});function sS(t,e){return[t[0]]}function lS(t,e){return[t[t.length-1]]}function cS(t,e){return[t[$p(t,t=>e[t])]]}function uS(t,e){return[t[function(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}(t,t=>e[t])]]}oS.props={};const hS=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=M3(a,t,e);const[r]=x3(n,o),i="function"==typeof(n=s)?n:{first:sS,last:lS,max:cS,min:uS}[n]||sS;return[t.flatMap(t=>i(t,r)),e]}},fS=(hS.props={},(t={})=>{var e=t["selector"],t=J(t,["selector"]);return hS(Object.assign({channel:"x",selector:e},t))}),dS=(fS.props={},(t={})=>{var e=t["selector"],t=J(t,["selector"]);return hS(Object.assign({channel:"y",selector:e},t))});function pS(e){return t=>null===t?e:e+" of "+t}function gS(){return[(t,e)=>Qp(t,t=>+e[t]),pS("mean")]}function yS(){return[(t,e)=>t0(t,t=>+e[t]),pS("median")]}function mS(){return[(t,e)=>Xp(t,t=>+e[t]),pS("max")]}function vS(){return[(t,e)=>Kp(t,t=>+e[t]),pS("min")]}function bS(){return[(t,e)=>t.length,pS("count")]}function xS(){return[(t,e)=>r0(t,t=>+e[t]),pS("sum")]}function wS(){return[(t,e)=>e[t[0]],pS("first")]}function kS(){return[(t,e)=>e[t[t.length-1]],pS("last")]}dS.props={};const ES=(t={})=>{const a=t["groupBy"],c=J(t,["groupBy"]);return(t,e)=>{const{data:o,encode:s}=e,l=a(t,e);var n,r,i;return l?(n=Object.entries(c).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:gS,max:mS,count:bS,first:wS,last:kS,sum:xS,min:vS,median:yS}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=x3(s,t);return[t,m3(l.map(t=>n(t,null!==i&&void 0!==i?i:o)),(null==r?void 0:r(a))||a)]}),r=Object.keys(s).map(t=>{const[e,n]=x3(s,t);return[t,m3(l.map(t=>e[t[0]]),n)]}),i=l.map(t=>o[t[0]]),[Pb(l),R({},e,{data:i,encode:Object.fromEntries([...r,...n])})]):[t,e]}},MS=(ES.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=J(t,["channels"]);return ES(Object.assign(Object.assign({},e),{groupBy:(t,e)=>M3(n,t,e)}))}),OS=(MS.props={},(t={})=>MS(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),SS=(OS.props={},(t={})=>MS(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),_S=(SS.props={},(t={})=>MS(Object.assign(Object.assign({},t),{channels:["color"]})));function AS(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=J(n,["reverse","slice","channel"]),o=e["encode"];const[s]=x3(o,a);var l,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=x3(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>Xp(t,t=>+a[t]);if("min"===i)return t=>Kp(t,t=>+a[t]);if("sum"===i)return t=>r0(t,t=>+a[t]);if("median"===i)return t=>t0(t,t=>+a[t]);if("mean"===i)return t=>Qp(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),n=(o=t,c=t=>s[t],(2!==(l=n).length?Ip(jp(o,l,c),([t,e],[n,r])=>xp(e,r)||xp(t,n)):Ip(Np(o,c),([t,e],[n,r])=>l(e,r)||xp(t,n))).map(([t])=>t)),o=(r&&n.reverse(),"number"==typeof i?[0,i]:i),c=i?n.slice(...o):n;return[t,R(e,{scale:{[a]:{domain:c}}})]}_S.props={};const TS=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=J(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return AS(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=x3(i,r);return i=Ip(t,t=>a[t]),n&&i.reverse(),[i,e]}}},PS=(TS.props={},(t={})=>TS(Object.assign(Object.assign({},t),{channel:"x"}))),LS=(PS.props={},(t={})=>TS(Object.assign(Object.assign({},t),{channel:"color"}))),CS=(LS.props={},(t={})=>TS(Object.assign(Object.assign({},t),{channel:"y"})));CS.props={};const NS=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=x3(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):x3(r,s)[0],r=Rp(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>r0(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,R({},e,{scale:{x:{flex:r}}})]}};function jS(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const h=a-u*c,f=u<=1?0:h/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=_b(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}NS.props={};const RS=()=>(t,e)=>[t,R({},e,{modifier:jS,axis:!1})],FS=(RS.props={},"thresholds");function IS(t){var[e,n]=Ap(t);return Math.min(200,(t=t,Math.ceil((n-e)*Math.cbrt(Sp(t))/(3.49*_p(t)))))}const BS=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=J(t,["groupChannels","binChannels"]),u={};return ES(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(FS)))),Object.fromEntries(l.flatMap(e=>[[e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",([t])=>+u[e].get(t).split(",")[1]]]))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=x3(n,t);return t}),a=Q(c,FS),o=t.filter(e=>i.every(t=>Z0(t[e]))),r=[...s.map(t=>{var[t]=x3(n,t);return t}).filter(Z0).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||IS(n),e=Up().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(Np(o,e=>r.map(t=>t(e)).join("-")).values())}}))},DS=(BS.props={},(t={})=>{var e=t["thresholds"];return BS(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});DS.props={};const zS=(t={})=>{const{groupBy:n,thresholds:o=2e3}=t,e=J(t,["groupBy","thresholds"]);return ES(Object.assign(Object.assign({},e),{groupBy:(t,e)=>{t=M3(n,t,e);return t.every(t=>t.length<=o)?null:t.flatMap(e=>{{var n=e,r=Math.max(1,Math.floor(e.length/o)),i=n.length,a=[];let t=0;for(;t<i;)a.push(n.slice(t,t+=r));return a}})}}))},GS=(zS.props={},(s={})=>(t,e)=>{const i=e["encode"],n=Object.entries(s).map(([t,e])=>{const[n]=x3(i,t);if(!n)return null;if("function"==typeof e)return t=>e(n[t]);const r=Array.isArray(e)?e:[e];return 0===r.length?null:t=>r.includes(n[t])}).filter(Z0);if(0===n.length)return[t,e];const r=t.filter(e=>n.every(t=>t(e))),a=r.map((t,e)=>e);var o=Object.entries(i).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:a.map(t=>e.value[r[t]])})]);return[t,R({},e,{encode:Object.fromEntries(o)})]});function WS(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function YS(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}GS.props={};const VS=t=>{const r=t["priority"];return(t,e)=>{const n=[];return r&&t.sort(r),t.forEach(t=>{t.attr("visibility","visible");const i=t.getLocalBounds();n.some(t=>{var e=WS(i),t=WS(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]<r[0]&&n[0]>t[0]&&e[1]<r[1]&&n[1]>t[1]})?t.attr("visibility","hidden"):n.push(t)}),t}};function HS(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const qS=t=>{const{maxIterations:k=10,maxError:E=.1,padding:M=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=HS(),[m,v]=HS();var a,o,s,l,[c,t]=HS(),[u,n]=HS();for(const b of i){var{min:r,max:h}=function(t){Z0(t.style.stroke)||(t.style.stroke="");var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,h]=h;y(b,g),v(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<k;t++){i.sort((t,e)=>xp(m(t),m(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=m(f);var d=c(f),p=m(e),d=p-(g+d);d<M&&(d=(M-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<E)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function US(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function XS(t,e,n){return.2126*US(t)+.7152*US(e)+.0722*US(n)}function $S(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=XS(t,n,r),n=XS(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function KS(e,t){return t[$p(t,t=>{return $S(e,"object"==typeof(t=t)?t:ha(t))})]}const ZS=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return(t,e)=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;$S(t.parsedStyle.fill,e)<n&&t.attr("fill",KS(e,r))}),t)},JS=t=>(t,e)=>(t.forEach(t=>{t.attr("visibility","visible");var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(YS(t,e)&&YS(n,e))}(WS(t.getLocalBounds()),e)||t.attr("visibility","hidden")}),t);var P=1e-6,QS=1e-12,T=Math.PI,t4=T/2,e4=T/4,n4=2*T,r4=180/T,i4=T/180,a4=Math.abs,o4=Math.atan,s4=Math.atan2,L=Math.cos,l4=Math.ceil,c4=Math.exp,u4=Math.log,h4=Math.pow,C=Math.sin,f4=Math.sign||function(t){return 0<t?1:t<0?-1:0},d4=Math.sqrt,p4=Math.tan;function g4(t){return 1<t?0:t<-1?T:Math.acos(t)}function y4(t){return 1<t?t4:t<-1?-t4:Math.asin(t)}function m4(){}function v4(t,e){t&&x4.hasOwnProperty(t.type)&&x4[t.type](t,e)}var b4={Feature:function(t,e){v4(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)v4(n[r].geometry,e)}},x4={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){w4(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)w4(n[r],e,0)},Polygon:function(t,e){k4(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)k4(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)v4(n[r],e)}};function w4(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function k4(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)w4(t[n],e,1);e.polygonEnd()}function E4(t,e){t&&b4.hasOwnProperty(t.type)?b4[t.type](t,e):v4(t,e)}function M4(t){return[s4(t[1],t[0]),y4(t[2])]}function O4(t){var e=t[0],t=t[1],n=L(t);return[n*L(e),n*C(e),C(t)]}function S4(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _4(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function A4(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function T4(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function P4(t){var e=d4(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function L4(n,r){function t(t,e){return t=n(t,e),r(t[0],t[1])}return n.invert&&r.invert&&(t.invert=function(t,e){return(t=r.invert(t,e))&&n.invert(t[0],t[1])}),t}function C4(t,e){return a4(t)>T&&(t-=Math.round(t/n4)*n4),[t,e]}function N4(t,e,n){return(t%=n4)?e||n?L4(R4(t),F4(e,n)):R4(t):e||n?F4(e,n):C4}function j4(n){return function(t,e){return a4(t+=n)>T&&(t-=Math.round(t/n4)*n4),[t,e]}}function R4(t){var e=j4(t);return e.invert=j4(-t),e}function F4(t,e){var i=L(t),a=C(t),o=L(e),s=C(e);function n(t,e){var n=L(e),r=L(t)*n,t=C(t)*n,n=C(e),e=n*i+r*a;return[s4(t*o-e*s,r*i-n*a),y4(e*o+t*s)]}return n.invert=function(t,e){var n=L(e),r=L(t)*n,t=C(t)*n,n=C(e),e=n*o-t*s;return[s4(t*o+n*s,r*i+e*a),y4(e*i-r*a)]},n}function I4(t,e){(e=O4(e))[0]-=t,P4(e);t=g4(-e[1]);return((-e[2]<0?-t:t)+n4-P)%n4}function B4(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:m4,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function D4(t,e){return a4(t[0]-e[0])<P&&a4(t[1]-e[1])<P}function z4(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function G4(t,e,n,r,a){var o,i,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],i=t[e];if(D4(r,i)){if(!r[2]&&!i[2]){for(a.lineStart(),o=0;o<e;++o)a.point((r=t[o])[0],r[1]);return void a.lineEnd()}i[0]+=2*P}s.push(n=new z4(r,t,null,!0)),l.push(n.o=new z4(r,null,n,!1)),s.push(n=new z4(i,t,null,!1)),l.push(n.o=new z4(i,null,n,!0))}}),s.length){for(l.sort(e),W4(s),W4(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function W4(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function Y4(t){return a4(t[0])<=T?t[0]:f4(t[0])*((a4(t[0])+T)%n4-T)}function V4(y,m,v,b){return function(s){var l,c,u,n=m(s),h=B4(),f=m(h),d=!1,e={point:r,lineStart:i,lineEnd:a,polygonStart:function(){e.point=p,e.lineStart=o,e.lineEnd=g,c=[],l=[]},polygonEnd:function(){e.point=r,e.lineStart=i,e.lineEnd=a,c=e0(c);var t=function(t,e){var n=Y4(e),r=e[1],e=C(r),i=[C(n),-L(n),0],a=0,o=0,s=new Tp;1===e?r=t4+P:-1===e&&(r=-t4-P);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=Y4(f),p=f[1]/2+e4,g=C(p),y=L(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=Y4(v),x=v[1]/2+e4,w=C(x),x=L(x),k=b-d,E=0<=k?1:-1,M=E*k,O=T<M,S=g*w;s.add(s4(S*E*C(M),y*x+S*L(M))),a+=O?k+E*n4:k,O^n<=d^n<=b&&(P4(S=_4(O4(f),O4(v))),P4(M=_4(i,S)),(E=(O^0<=k?-1:1)*y4(M[2]))<r||r===E&&(S[0]||S[1]))&&(o+=O^0<=k?1:-1)}return(a<-P||a<P&&s<-QS)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),G4(c,q4,t,v,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),v(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),v(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function r(t,e){y(t,e)&&s.point(t,e)}function t(t,e){n.point(t,e)}function i(){e.point=t,n.lineStart()}function a(){e.point=r,n.lineEnd()}function p(t,e){u.push([t,e]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.result(),o=a.length;if(u.pop(),l.push(u),u=null,o)if(1&i){if(0<(e=(n=a[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart(),t=0;t<e;++t)s.point((r=n[t])[0],r[1]);s.lineEnd()}}else 1<o&&2&i&&a.push(a.pop().concat(a.shift())),c.push(a.filter(H4))}return e}}function H4(t){return 1<t.length}function q4(t,e){return((t=t.x)[0]<0?t[1]-t4-P:t4-t[1])-((e=e.x)[0]<0?e[1]-t4-P:t4-e[1])}C4.invert=C4;var U4=V4(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?T:-T,l=a4(t-h);a4(l-T)<P?(c.point(h,f=0<(f+e)/2?t4:-t4),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&T<=l&&(a4(h-d)<P&&(h-=d*P),a4(t-s)<P&&(t-=s*P),l=f,i=e,o=C((n=h)-(r=t)),f=a4(o)>P?o4((C(l)*(a=L(i))*C(r)-C(i)*(r=L(l))*C(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*t4,r.point(-T,i),r.point(0,i),r.point(T,i),r.point(T,0),r.point(T,-i),r.point(0,-i),r.point(-T,-i),r.point(-T,0),r.point(-T,i)):a4(t[0]-e[0])>P?(t=t[0]<e[0]?T:-T,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-T,-t4]);function X4(d){var g=L(d),p=6*i4,h=0<g,f=a4(g)>P;function y(t,e){return L(t)*L(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=_4(O4(t),O4(e)),f=S4(h,h),d=h[0],p=f-d*d;return p?(r=_4(u,h),A4(u=T4(u,g*f/p),T4(h,-g*d/p)),(p=(h=S4(u,f=r))*h-(d=S4(f,f))*(S4(u,u)-1))<0?void 0:(A4(p=T4(f,(-h-(r=d4(p)))/d),u),p=M4(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=a4((s=a-i)-T)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(a4(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:T<s^(i<=p[0]&&p[0]<=a))?(A4(c=T4(f,(-h+r)/d),u),[p,M4(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:T-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return V4(y,function(a){var o,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(t,e){var n,r=[t,e],i=y(t,e),t=h?i?0:v(t,e):i?v(t+(t<0?T:-T),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!D4(o,n)&&!D4(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=m(r,o),a.point(n[0],n[1])):(n=m(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=m(r,o,!0))||(u=0,h?(a.lineStart(),a.point(e[0][0],e[0][1]),a.point(e[1][0],e[1][1]),a.lineEnd()):(a.point(e[1][0],e[1][1]),a.lineEnd(),a.lineStart(),a.point(e[0][0],e[0][1],3)))),!i||o&&D4(o,r)||a.point(r[0],r[1]),o=r,l=i,s=t},lineEnd:function(){l&&a.lineEnd(),o=null},clean:function(){return u|(c&&l)<<1}}},function(t,e,n,r){var i=r,r=d,a=p,o=n,n=t,s=e;if(a){var l=L(r),c=C(r),u=o*a;null==n?(n=r+o*n4,s=r-u/2):(n=I4(l,n),s=I4(l,s),(0<o?n<s:s<n)&&(n+=o*n4));for(var h,f=n;0<o?s<f:f<s;f-=u)h=M4([l,-c*L(f),-c*C(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-T,d-T])}var $4=1e9,K4=-$4;function Z4(m,v,b,x){function w(t,e){return m<=t&&t<=b&&v<=e&&e<=x}function k(t,e,n,r){var i=0,a=0;if(null==t||(i=o(t,n))!==(a=o(e,n))||s(t,e)<0^0<n)for(;r.point(0===i||3===i?m:b,1<i?x:v),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return a4(t[0]-m)<P?0<e?0:3:a4(t[0]-b)<P?0<e?2:1:a4(t[1]-v)<P?0<e?1:0:0<e?3:2}function E(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(r){var i,h,a,o,s,l,c,u,f,d,p,g=r,t=B4(),e={point:n,lineStart:function(){e.point=y,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(y(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[e],o=1,s=a.length,l=a[0],c=l[0],u=l[1];o<s;++o)r=c,i=u,l=a[o],c=l[0],u=l[1],i<=x?x<u&&(u-i)*(m-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(m-r)&&--t;return t}(),e=p&&t,n=(i=e0(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),k(null,null,1,r),r.lineEnd()),n&&G4(i,E,t,k,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function y(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?g.point(t,e):!function(t,e,n,r,i,a){var o=t[0],s=t[1],l=0,c=1,u=e[0]-o,h=e[1]-s,n=n-o;if(u||!(0<n)){if(n/=u,u<0){if(n<l)return;n<c&&(c=n)}else if(0<u){if(c<n)return;l<n&&(l=n)}if(n=i-o,u||!(n<0)){if(n/=u,u<0){if(c<n)return;l<n&&(l=n)}else if(0<u){if(n<l)return;n<c&&(c=n)}if(n=r-s,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(K4,Math.min($4,c)),u=Math.max(K4,Math.min($4,u))],r=[t=Math.max(K4,Math.min($4,t)),e=Math.max(K4,Math.min($4,e))],m,v,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function J4(t,e,n){var r=n0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function Q4(t,e,n){var r=n0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function t_(){return g=p=10,y=90,m=360,v=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],i<a&&(t=a,a=i,i=t),l<c&&(t=c,c=l,l=t),e.precision(v)):[[a,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],n<r&&(t=r,r=n,n=t),o<s&&(t=s,s=o,o=t),e.precision(v)):[[r,s],[n,o]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(y=+t[0],m=+t[1],e):[y,m]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(v=+t,u=J4(s,o,90),h=Q4(r,n,v),f=J4(c,l,90),d=Q4(a,i,v),e):v},e.extentMajor([[-180,-90+P],[180,90-P]]).extentMinor([[-180,-80-P],[180,80+P]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return n0(l4(a/y)*y,i,y).map(f).concat(n0(l4(c/m)*m,l,m).map(d)).concat(n0(l4(r/p)*p,n,p).filter(function(t){return a4(t%y)>P}).map(u)).concat(n0(l4(s/g)*g,o,g).filter(function(t){return a4(t%m)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var e_,n_,r_,i_,a_=t=>t,o_=new Tp,s_=new Tp,l_={point:m4,lineStart:m4,lineEnd:m4,polygonStart:function(){l_.lineStart=c_,l_.lineEnd=f_},polygonEnd:function(){l_.lineStart=l_.lineEnd=l_.point=m4,o_.add(a4(s_)),s_=new Tp},result:function(){var t=o_/2;return o_=new Tp,t}};function c_(){l_.point=u_}function u_(t,e){l_.point=h_,e_=r_=t,n_=i_=e}function h_(t,e){s_.add(i_*t-r_*e),r_=t,i_=e}function f_(){h_(e_,n_)}var d_=l_,p_=1/0,g_=p_,y_=-p_,m_=y_;var v_,b_,x_,w_,k_={point:function(t,e){t<p_&&(p_=t);y_<t&&(y_=t);e<g_&&(g_=e);m_<e&&(m_=e)},lineStart:m4,lineEnd:m4,polygonStart:m4,polygonEnd:m4,result:function(){var t=[[p_,g_],[y_,m_]];return y_=m_=-(g_=p_=1/0),t}},E_=0,M_=0,O_=0,S_=0,__=0,A_=0,T_=0,P_=0,L_=0,C_={point:N_,lineStart:j_,lineEnd:I_,polygonStart:function(){C_.lineStart=B_,C_.lineEnd=D_},polygonEnd:function(){C_.point=N_,C_.lineStart=j_,C_.lineEnd=I_},result:function(){var t=L_?[T_/L_,P_/L_]:A_?[S_/A_,__/A_]:O_?[E_/O_,M_/O_]:[NaN,NaN];return E_=M_=O_=S_=__=A_=T_=P_=L_=0,t}};function N_(t,e){E_+=t,M_+=e,++O_}function j_(){C_.point=R_}function R_(t,e){C_.point=F_,N_(x_=t,w_=e)}function F_(t,e){var n=t-x_,r=e-w_,n=d4(n*n+r*r);S_+=n*(x_+t)/2,__+=n*(w_+e)/2,A_+=n,N_(x_=t,w_=e)}function I_(){C_.point=N_}function B_(){C_.point=z_}function D_(){G_(v_,b_)}function z_(t,e){C_.point=G_,N_(v_=x_=t,b_=w_=e)}function G_(t,e){var n=t-x_,r=e-w_,n=d4(n*n+r*r);S_+=n*(x_+t)/2,__+=n*(w_+e)/2,A_+=n,T_+=(n=w_*t-x_*e)*(x_+t),P_+=n*(w_+e),L_+=3*n,N_(x_=t,w_=e)}var W_=C_;function Y_(t){this._context=t}Y_.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,n4)}},result:m4};var V_,H_,q_,U_,X_,$_=new Tp,K_={point:m4,lineStart:function(){K_.point=Z_},lineEnd:function(){V_&&J_(H_,q_),K_.point=m4},polygonStart:function(){V_=!0},polygonEnd:function(){V_=null},result:function(){var t=+$_;return $_=new Tp,t}};function Z_(t,e){K_.point=J_,H_=U_=t,q_=X_=e}function J_(t,e){U_-=t,X_-=e,$_.add(d4(U_*U_+X_*X_)),U_=t,X_=e}var Q_=K_;let tA,eA,nA,rA;class iA{constructor(t){this._append=null==t?aA:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return aA;if(e!==tA){const r=10**e;tA=e,eA=function(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}return eA}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:var n,r;this._append`M${t},${e}`,this._radius===nA&&this._append===eA||(n=this._radius,r=this._,this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,nA=n,eA=this._append,rA=this._,this._=r),this._+=rA}}result(){var t=this._;return this._="",t.length?t:null}}function aA(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function oA(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),E4(t,a(o))),o.result()}return s.area=function(t){return E4(t,a(d_)),d_.result()},s.measure=function(t){return E4(t,a(Q_)),Q_.result()},s.bounds=function(t){return E4(t,a(k_)),k_.result()},s.centroid=function(t){return E4(t,a(W_)),W_.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,a_):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new iA(r)):new Y_(n=t),"function"!=typeof i&&o.pointRadius(i),s):n},s.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(o.pointRadius(+t),+t),s):i},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return null===n&&(o=new iA(r)),s},s.projection(e).digits(r).context(n)}function sA(r){return function(t){var e,n=new lA;for(e in r)n[e]=r[e];return n.stream=t,n}}function lA(){}function cA(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),E4(n,t.stream(k_)),e(k_.result()),null!=r&&t.clipExtent(r),t}function uA(i,a,t){return cA(i,function(t){var e=a[1][0]-a[0][0],n=a[1][1]-a[0][1],r=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),e=+a[0][0]+(e-r*(t[1][0]+t[0][0]))/2,n=+a[0][1]+(n-r*(t[1][1]+t[0][1]))/2;i.scale(150*r).translate([e,n])},t)}function hA(t,e,n){return uA(t,[[0,0],e],n)}function fA(r,i,t){return cA(r,function(t){var e=+i,n=e/(t[1][0]-t[0][0]),e=(e-n*(t[1][0]+t[0][0]))/2,t=-n*t[0][1];r.scale(150*n).translate([e,t])},t)}function dA(i,a,t){return cA(i,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),r=-n*t[0][0],e=(e-n*(t[1][1]+t[0][1]))/2;i.scale(150*n).translate([r,e])},t)}lA.prototype={constructor:lA,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var pA=16,gA=L(30*i4);function yA(t,e){return+e?(_=t,A=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:m,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=_(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=O4([t,e]),e=_(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],pA,r),r.point(u,h)}function m(){g.point=t,r.lineEnd()}function v(){e(),g.point=b,g.lineEnd=x}function b(t,e){y(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=y}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,pA,r),g.lineEnd=m,m()}return g}):(n=t,sA({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,_,A;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,y,m,v,b,x,w,k,E,M=o-t,O=s-e,S=M*M+O*O;4*A<S&&f--&&(y=a+h,x=y4(y/=m=d4((p=r+c)*p+(g=i+u)*g+y*y)),v=a4(a4(y)-1)<P||a4(n-l)<P?(n+l)/2:s4(g,p),b=(x=_(v,x))[0],x=x[1],A<(E=O*(w=b-t)-M*(k=x-e))*E/S||.3<a4((M*w+O*k)/S-.5)||r*c+i*u+a*h<gA)&&(T(t,e,n,r,i,a,b,x,v,p/=m,g/=m,y,f,d),d.point(b,x),T(b,x,v,p,g,y,o,s,l,c,u,h,f,d))}}var mA=sA({point:function(t,e){this.stream.point(t*i4,e*i4)}});function vA(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=L(e),e=C(e),f=h*t,d=e*t,p=h/t,g=e/t,y=(e*r-h*n)/t,m=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+y),a*(m-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,v.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},v);function v(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function bA(t){return xA(function(){return t})()}function xA(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,y=0,m=0,v=0,b=0,x=1,w=1,k=null,E=U4,M=null,O=a_,S=.5;function _(t){return l(t[0]*i4,t[1]*i4)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*r4,t[1]*r4]}function T(){var t=vA(h,0,0,x,w,b).apply(null,e(p,g)),t=vA(h,f-t[0],d-t[1],x,w,b);return r=N4(y,m,v),s=L4(e,t),l=L4(r,s),o=yA(s,S),P()}function P(){return c=u=null,_}return _.stream=function(t){return c&&u===t?c:c=mA((n=r,sA({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(E(o(O(u=t))))));var n},_.preclip=function(t){return arguments.length?(E=t,k=void 0,P()):E},_.postclip=function(t){return arguments.length?(O=t,M=n=i=a=null,P()):O},_.clipAngle=function(t){return arguments.length?(E=+t?X4(k=t*i4):(k=null,U4),P()):k*r4},_.clipExtent=function(t){return arguments.length?(O=null==t?(M=n=i=a=null,a_):Z4(M=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==M?null:[[M,n],[i,a]]},_.scale=function(t){return arguments.length?(h=+t,T()):h},_.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},_.center=function(t){return arguments.length?(p=t[0]%360*i4,g=t[1]%360*i4,T()):[p*r4,g*r4]},_.rotate=function(t){return arguments.length?(y=t[0]%360*i4,m=t[1]%360*i4,v=2<t.length?t[2]%360*i4:0,T()):[y*r4,m*r4,v*r4]},_.angle=function(t){return arguments.length?(b=t%360*i4,T()):b*r4},_.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},_.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},_.precision=function(t){return arguments.length?(o=yA(s,S=t*t),P()):d4(S)},_.fitExtent=function(t,e){return uA(_,t,e)},_.fitSize=function(t,e){return hA(_,t,e)},_.fitWidth=function(t,e){return fA(_,t,e)},_.fitHeight=function(t,e){return dA(_,t,e)},function(){return e=t.apply(this,arguments),_.invert=e.invert&&A,T()}}function wA(t){var e=0,n=T/3,r=xA(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*i4,n=t[1]*i4):[e*r4,n*r4]},t}function kA(t,e){var n,r,i,a=C(t),o=(a+C(e))/2;return a4(o)<P?(n=L(t),s.invert=function(t,e){return[t/n,y4(e*n)]},s):(i=d4(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=s4(t,a4(e))*f4(e);return e*o<0&&(n-=T*f4(t)*f4(e)),[n/o,y4((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,C(e)/n]}function l(t,e){e=d4(r-2*o*C(e))/o;return[e*C(t*=o),i-e*L(t)]}}function EA(){return wA(kA).scale(155.424).center([0,33.6442])}function MA(){return EA().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function OA(i){return function(t,e){var n=L(t),r=L(e),n=i(n*r);return n===1/0?[2,0]:[n*r*C(t),n*C(e)]}}function SA(a){return function(t,e){var n=d4(t*t+e*e),r=a(n),i=C(r),r=L(r);return[s4(t*i,n*r),y4(n&&e*i/n)]}}var _A=OA(function(t){return d4(2/(1+t))});_A.invert=SA(function(t){return 2*y4(t/2)});var AA=OA(function(t){return(t=g4(t))&&t/C(t)});function TA(t,e){return[t,u4(p4((t4+e)/2))]}function PA(r){var i,a,o,s=bA(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=T*l(),n=s((e=N4((e=s.rotate())[0]*i4,e[1]*i4,2<e.length?e[2]*i4:0),function(t){return(t=e.invert(t[0]*i4,t[1]*i4))[0]*=r4,t[1]*=r4,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===TA?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),o]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):e)()},s.clipExtent=function(t){return arguments.length?(null==t?u=i=a=o=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],o=+t[1][1]),h()):null==u?null:[[u,i],[a,o]]},h()}function LA(t){return p4((t4+t)/2)}function CA(t,e){var n=L(t),i=t===e?C(t):u4(n/L(e))/u4(LA(e)/LA(t)),a=n*h4(LA(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=f4(i)*d4(t*t+e*e),r=s4(t,a4(e))*f4(e);return e*i<0&&(r-=T*f4(t)*f4(e)),[r/i,2*o4(h4(a/n,1/i))-t4]},r):TA;function r(t,e){0<a?e<-t4+P&&(e=-t4+P):t4-P<e&&(e=t4-P);e=a/h4(LA(e),i);return[e*C(i*t),a-e*L(i*t)]}}function NA(t,e){return[t,e]}function jA(t,e){var n=L(t),r=t===e?C(t):(n-L(e))/(e-t),i=n/r+t;return a4(r)<P?NA:(a.invert=function(t,e){var e=i-e,n=s4(t,a4(e))*f4(e);return e*r<0&&(n-=T*f4(t)*f4(e)),[n/r,i-f4(r)*d4(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*C(t),i-e*L(t)]}}AA.invert=SA(function(t){return t}),TA.invert=function(t,e){return[t,2*o4(c4(e))-t4]},NA.invert=NA;var RA=1.340264,FA=-.081106,IA=893e-6,BA=.003796,DA=d4(3)/2;function zA(t,e){var e=y4(DA*C(e)),n=e*e,r=n*n*n;return[t*L(e)/(DA*(RA+3*FA*n+r*(7*IA+9*BA*n))),e*(RA+FA*n+r*(IA+BA*n))]}function GA(t,e){var n=L(e),r=L(t)*n;return[n*C(t)/r,C(e)/r]}function WA(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function YA(t,e){return[L(e)*C(t),C(e)]}function VA(t,e){var n=L(e),r=1+L(t)*n;return[n*C(t)/r,C(e)/r]}function HA(t,e){return[u4(p4((t4+e)/2)),-t]}zA.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(RA+FA*i+a*(IA+BA*i))-e)/(RA+3*FA*i+a*(7*IA+9*BA*i)))*r)*i*i,!(a4(n)<QS));++o);return[DA*t*(RA+3*FA*i+a*(7*IA+9*BA*i))/L(r),y4(C(r)/DA)]},GA.invert=SA(o4),WA.invert=function(t,e){var n=e,r=25;do{var i=n*n,a=i*i}while(n-=a=(n*(1.007226+i*(.015085+a*(.028874*i-.044475-.005916*a)))-e)/(1.007226+i*(.045255+a*(.259866*i-.311325-.005916*11*a))),a4(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},YA.invert=SA(y4),VA.invert=SA(function(t){return 2*o4(t)}),HA.invert=function(t,e){return[-e,2*o4(c4(t))-t4]};var qA=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=MA(),l=EA().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=EA().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function f(){return e=n=null,h}return h.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},h.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){var e,n,r;return arguments.length?(e=s.scale(),n=+t[0],r=+t[1],i=s.translate(t).clipExtent([[n-.455*e,r-.238*e],[n+.455*e,r+.238*e]]).stream(u),a=l.translate([n-.307*e,r+.201*e]).clipExtent([[n-.425*e+P,r+.12*e+P],[n-.214*e-P,r+.234*e-P]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+P,r+.166*e+P],[n-.115*e-P,r+.234*e-P]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return uA(h,t,e)},h.fitSize=function(t,e){return hA(h,t,e)},h.fitWidth=function(t,e){return fA(h,t,e)},h.fitHeight=function(t,e){return dA(h,t,e)},h.scale(1070)},geoAlbers:MA,geoAzimuthalEqualArea:function(){return bA(_A).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:_A,geoAzimuthalEquidistant:function(){return bA(AA).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:AA,geoConicConformal:function(){return wA(CA).scale(109.5).parallels([30,30])},geoConicConformalRaw:CA,geoConicEqualArea:EA,geoConicEqualAreaRaw:kA,geoConicEquidistant:function(){return wA(jA).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:jA,geoEqualEarth:function(){return bA(zA).scale(177.158)},geoEqualEarthRaw:zA,geoEquirectangular:function(){return bA(NA).scale(152.63)},geoEquirectangularRaw:NA,geoGnomonic:function(){return bA(GA).scale(144.049).clipAngle(60)},geoGnomonicRaw:GA,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,y=1,m=sA({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=a_;function b(){return g=l*h,y=l*f,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*y;return d&&(e=t*r-n*i,n=n*r+t*i,t=e),[n+c,t+u]}return x.invert=function(t){var e,n=t[0]-c,t=t[1]-u;return d&&(e=t*r+n*i,n=n*r-t*i,t=e),[n/g,t/y]},x.stream=function(t){return o&&s===t?o:o=m(v(s=t))},x.postclip=function(t){return arguments.length?(v=t,p=e=n=a=null,b()):v},x.clipExtent=function(t){return arguments.length?(v=null==t?(p=e=n=a=null,a_):Z4(p=+t[0][0],e=+t[0][1],n=+t[1][0],a=+t[1][1]),b()):null==p?null:[[p,e],[n,a]]},x.scale=function(t){return arguments.length?(l=+t,b()):l},x.translate=function(t){return arguments.length?(c=+t[0],u=+t[1],b()):[c,u]},x.angle=function(t){return arguments.length?(i=C(d=t%360*i4),r=L(d),b()):d*r4},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return uA(x,t,e)},x.fitSize=function(t,e){return hA(x,t,e)},x.fitWidth=function(t,e){return fA(x,t,e)},x.fitHeight=function(t,e){return dA(x,t,e)},x},geoProjection:bA,geoProjectionMutator:xA,geoMercator:function(){return PA(TA).scale(961/n4)},geoMercatorRaw:TA,geoNaturalEarth1:function(){return bA(WA).scale(175.295)},geoNaturalEarth1Raw:WA,geoOrthographic:function(){return bA(YA).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:YA,geoStereographic:function(){return bA(VA).scale(250).clipAngle(142)},geoStereographicRaw:VA,geoTransverseMercator:function(){var t=PA(HA),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:HA});function UA(t){return{type:"FeatureCollection",features:t.flatMap(t=>function(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function XA(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(KA),e.find(t=>t.sphere)?{type:"Sphere"}:UA(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=oA(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function $A(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[t_()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function KA(t){return"geoPath"===t.type}var ZA,fo=()=>t=>{var{children:e,projection:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=J(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Rf(t);if(e=qA[e])return e;throw new Error("Unknown projection: "+t)}(r),p=e.map($A);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinates:[{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(XA(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=oA(i);const u=new Im({domain:[t,t+n]}),h=new Im({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}}],children:p.flatMap(t=>{return KA(t)?(e=t.style,Object.assign(Object.assign({},t),{type:"path",style:Object.assign(Object.assign({},e),{d:t=>g(t)})})):t;var e})})]},po=(fo.props={},()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o}=t,t=J(t,["type","data","scale","encode","style","animate","key"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a}]})]});po.props={};const JA={"composition.geoView":fo,"composition.geoPath":po};function QA(){return Object.assign({"data.fetch":E1,"data.inline":P1,"data.sortBy":T1,"data.sort":S1,"data.filter":O1,"data.pick":_1,"data.rename":A1,"data.fold":M1,"data.slice":ay,"data.custom":L1,"data.map":C1,"data.cluster":l1,"data.tree":c1,"data.sankey":q0,"data.arc":F1,"data.wordCloud":ny,"data.join":iy,"transform.maybeZeroY1":E3,"transform.maybeZeroX":I3,"transform.maybeStackY":R3,"transform.maybeTitle":F3,"transform.maybeSeries":G3,"transform.maybeZeroPadding":U3,"transform.stackY":N3,"transform.binX":DS,"transform.bin":BS,"transform.dodgeX":J3,"transform.jitter":rS,"transform.jitterX":iS,"transform.symmetryY":aS,"transform.diffY":oS,"transform.stackEnter":Q3,"transform.normalizeY":tS,"transform.select":hS,"transform.selectX":fS,"transform.selectY":dS,"transform.groupX":OS,"transform.groupY":SS,"transform.groupColor":_S,"transform.group":MS,"transform.maybeSize":D3,"transform.maybeZeroY":B3,"transform.maybeKey":z3,"transform.sortX":PS,"transform.sortY":CS,"transform.sortColor":LS,"transform.flexX":NS,"transform.maybeTupleY":W3,"transform.maybeTupleX":Y3,"transform.maybeIdentityY":V3,"transform.maybeIdentityX":H3,"transform.maybeTuple":K3,"transform.maybeVisualPosition":X3,"transform.maybeFunctionAttribute":$3,"transform.maybeGradient":Z3,"transform.maybeTooltip":q3,"transform.pack":RS,"transform.sample":zS,"transform.filter":GS,"coordinate.cartesian":Wf,"coordinate.polar":Yf,"coordinate.helix":Vf,"coordinate.transpose":Hf,"coordinate.theta":$f,"coordinate.reflect":qf,"coordinate.reflectX":Uf,"coordinate.reflectY":Xf,"coordinate.parallel":Zf,"coordinate.fisheye":Jf,"coordinate.fisheyeX":Qf,"coordinate.fisheyeY":td,"coordinate.radial":Kf,"encode.constant":ed,"encode.field":rd,"encode.transform":nd,"encode.column":id,"mark.interval":vp,"mark.rect":bp,"mark.line":d0,"mark.point":p0,"mark.text":g0,"mark.cell":y0,"mark.area":m0,"mark.link":v0,"mark.image":b0,"mark.polygon":x0,"mark.box":w0,"mark.vector":k0,"mark.lineX":M0,"mark.lineY":E0,"mark.connector":O0,"mark.range":A0,"mark.rangeX":T0,"mark.rangeY":P0,"mark.sankey":eg,"mark.path":ng,"mark.treemap":sg,"mark.pack":lg,"mark.boxplot":mg,"mark.shape":vg,"mark.forceGraph":o1,"mark.tree":u1,"mark.wordCloud":oy,"palette.category10":sy,"palette.category20":ly,"palette.sequentialBlue":cy,"palette.sequentialDarkBlue":uy,"palette.sequentialGreen":hy,"palette.sequentialDarkGreen":fy,"palette.sequentialGrey":dy,"palette.sequentialOrange":py,"palette.sequentialPink":gy,"palette.sequentialRed":yy,"palette.sequentialYellow":my,"palette.sequentialPurple":vy,"palette.sequentialYellowOrange":by,"palette.sequentialYellowGreen":xy,"palette.sequentialPinkPurple":wy,"palette.sequentialGreenBlue":ky,"palette.divergingGreenYellow":Ey,"palette.divergingRedBlue":My,"palette.divergingGreenRed":Oy,"palette.divergingRedPurple":Sy,"scale.linear":uv,"scale.ordinal":hv,"scale.band":cv,"scale.identity":fv,"scale.point":dv,"scale.time":pv,"scale.log":gv,"scale.pow":yv,"scale.sqrt":xv,"scale.threshold":mv,"scale.quantile":vv,"scale.quantize":bv,"scale.sequential":wv,"shape.interval.rect":zb,"shape.interval.hollow":Gb,"shape.interval.funnel":Wb,"shape.interval.pyramid":Vb,"shape.rect.rect":zb,"shape.rect.hollow":Gb,"shape.cell.cell":zb,"shape.cell.hollow":Gb,"shape.line.line":Xb,"shape.line.hv":Kb,"shape.line.vh":Zb,"shape.line.hvh":Jb,"shape.line.smooth":$b,"shape.point.bowtie":n2,"shape.point.cross":r2,"shape.point.diamond":i2,"shape.point.hexagon":a2,"shape.point.hollowBowtie":o2,"shape.point.hollowDiamond":s2,"shape.point.hollowHexagon":l2,"shape.point.hollow":c2,"shape.point.hollowSquare":u2,"shape.point.hollowTriangle":h2,"shape.point.hollowTriangleDown":f2,"shape.point.hyphen":d2,"shape.point.line":p2,"shape.point.plus":g2,"shape.point.point":y2,"shape.point.square":m2,"shape.point.tick":v2,"shape.point.triangle":b2,"shape.point.triangleDown":x2,"shape.text.text":z5,"shape.area.area":H5,"shape.area.smooth":q5,"shape.area.step":U5,"shape.link.smooth":$5,"shape.link.vhv":K5,"shape.link.arc":Z5,"shape.link.link":X5,"shape.image.image":J5,"shape.polygon.polygon":Q5,"shape.polygon.ribbon":tE,"shape.box.box":eE,"shape.vector.vector":w2,"shape.label.label":vE,"shape.text.badge":W5,"shape.lineX.line":nE,"shape.lineY.line":nE,"shape.shape.shape":kE,"shape.connector.connector":aE,"shape.range.range":zb,"shape.rangeX.range":zb,"shape.rangeY.range":zb,"shape.path.path":xE,"shape.path.hollow":wE,"theme.light":ME,"theme.dark":OE,"theme.academy":_E,"component.axisX":$E,"component.axisY":KE,"component.legendCategory":ZE,"component.legendContinuous":JE,"component.title":eM,"component.sliderX":oM,"component.sliderY":sM,"component.scrollbarX":cM,"component.scrollbarY":uM,"animation.scaleInX":yM,"animation.scaleOutX":mM,"animation.scaleInY":vM,"animation.scaleOutY":bM,"animation.waveIn":_M,"animation.fadeIn":xM,"animation.fadeOut":wM,"animation.zoomIn":AM,"animation.zoomOut":TM,"animation.pathIn":PM,"animation.morphing":SM,"animation.growInX":LM,"animation.growInY":CM,"interaction.elementHighlight":UM,"interaction.elementHighlightByX":XM,"interaction.elementHighlightByColor":$M,"interaction.elementSelect":ZM,"interaction.elementSelectByX":JM,"interaction.elementSelectByColor":QM,"interaction.fisheye":eO,"interaction.chartIndex":tO,"interaction.tooltip":pO,"interaction.legendFilter":xO,"interaction.brushHighlight":EO,"interaction.brushXHighlight":OO,"interaction.brushYHighlight":_O,"interaction.brushAxisHighlight":FO,"interaction.brushFilter":BO,"interaction.brushXFilter":DO,"interaction.brushYFilter":zO,"interaction.sliderFilter":WO,"composition.spaceLayer":qO,"composition.spaceFlex":UO,"composition.mark":$O,"composition.view":XO,"composition.facetRect":a3,"composition.repeatMatrix":c3,"composition.facetCircle":g3,"composition.timingKeyframe":y3,"labelTransform.overlapHide":VS,"labelTransform.overlapDodgeY":qS,"labelTransform.overflowHide":JS,"labelTransform.contrastReverse":ZS},JA)}function t6(t,e,...n){t&&(t[e]||[]).forEach(t=>{t.apply(this,n)})}function e6(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}(io=ZA=ZA||{}).BEFORE_RENDER="beforerender",io.AFTER_RENDER="afterrender",io.BEFORE_PAINT="beforepaint",io.AFTER_PAINT="afterpaint",io.BEFORE_CHANGE_DATA="beforechangedata",io.AFTER_CHANGE_DATA="afterchangedata",io.BEFORE_CLEAR="beforeclear",io.AFTER_CLEAR="afterclear",io.BEFORE_DESTROY="beforedestroy",io.AFTER_DESTROY="afterdestroy",io.BEFORE_CHANGE_SIZE="beforechangesize",io.AFTER_CHANGE_SIZE="afterchangesize";function n6(t,e,n,r,i){var a=t[0],t=t[1],o=ct();return a=[a,t],(t=o)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}function r6(t,e,n,r,i){var a=new Im({range:[e,e+r]}),o=new Im({range:[n,n+i]});return{transform:function(t){var e=t[0],t=t[1];return[a.map(e),o.map(t)]},untransform:function(t){var e=t[0],t=t[1];return[a.invert(e),o.invert(t)]}}}function i6(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function a6(t,e,n,r,i){return t[0]}function o6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new Im({range:[s,t]}),c=new Im({range:[a,o]}),u=1<(s=i/r)?1:s,h=1<s?1/s:1;return{transform:function(t){var e=t[0],t=t[1],e=c.map(e),t=l.map(t);return[.5*(t*Math.cos(e)*u)+.5,.5*(t*Math.sin(e)*h)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=e6(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function s6(t,e,n,r,i){return{transform:function(t){var e=t[0];return[t[1],e]},untransform:function(t){var e=t[0];return[t[1],e]}}}function l6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return p6.apply(void 0,g6([[-1,-1]],e,!1))}function c6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return p6.apply(void 0,g6([[-1,1]],e,!1))}function u6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return p6.apply(void 0,g6([[1,-1]],e,!1))}function h6(t,e,n,r,i){var a,t=t[0],o=ct();return o=o,t=t,a=Math.sin(t),t=Math.cos(t),o[0]=t,o[1]=a,o[2]=0,o[3]=-a,o[4]=t,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o}function f6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=(t[3]-s)/(+o/(2*Math.PI)+1),c=l/(2*Math.PI),u=new Im({range:[s,s+.99*l]}),h=new Im({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=e6(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function d6(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new Im({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new Bm({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[s,l]}),i=0;i<n;i++){var a=t[i],o=r.map(i),a=c.map(a);e.push(o,a)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(c.invert(r))}return e}}}var p6=function(t,e,n,r,i){var a=t[0],t=t[1],o=ct();return a=[a,t],(t=o)[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},g6=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function y6(t){return 1/Math.tan(t)}function m6(t,e,n,r,i){var a=y6(t[0]);return{transform:function(t){var e=t[0],t=t[1];return[e+t*a,t]},untransform:function(t){var e=t[0],t=t[1];return[e-t*a,t]}}}function v6(t,e,n,r,i){var a=y6(t[0]);return{transform:function(t){var e=t[0];return[e,t[1]+e*a]},untransform:function(t){var e=t[0];return[e,t[1]-e*a]}}}function b6(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r,r=a?-1:1;return r*i*(n+1)/(n+i/((t-e)*r))+e}function x6(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r;return i/(i*(n+1)/(t-e)-n*(a?-1:1))+e}function w6(t,e,n){return n?new Im({range:[0,1],domain:[0,e]}).map(t):t}function k6(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=w6(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[b6(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[x6(e,s,o,0,1),t]}}}function E6(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=w6(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],b6(t[1],s,o,0,1)]},untransform:function(t){return[t[0],x6(t[1],s,o,0,1)]}}}function M6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=w6(a,r,t=void 0!==t&&t),u=w6(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[b6(e,c,s,0,1),b6(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[x6(e,c,s,0,1),x6(t,u,l,0,1)]}}}function O6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=void 0!==(t=t[4])&&t,c=new Im({range:[0,r]}),u=new Im({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=b6(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=x6(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var S6=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},_6=(A6.prototype.update=function(t){this.options=R({},this.options,t),this.recoordinate()},A6.prototype.clone=function(){return new A6(this.options)},A6.prototype.getOptions=function(){return this.options},A6.prototype.clear=function(){this.update({transformations:[]})},A6.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},A6.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},A6.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:S6(S6([],n,!0),[S6([],t,!0)],!1)}),this},A6.prototype.map=function(t){return this.output(t)},A6.prototype.invert=function(t){return this.input(t)},A6.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},A6.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?S6([],this.options.transformations,!0).reverse():this.options.transformations,n=t?function(t){return t.untransform}:function(t){return t.transform},r=[],a=[],i=function(t,e){return a.push((e=void 0===e?!0:e)?(i=t,function(t){for(var e=[],n=0;n<t.length-1;n+=2){var r=[t[n],t[n+1]],r=i(r);e.push.apply(e,r)}return e}):t);var i},o=0,s=e;o<s.length;o++){var l,c,u,h,f=s[o],d=f[0],f=f.slice(1),p=this.transformers[d];p&&(l=(h=this.options).x,c=h.y,u=h.width,h=h.height,p=p(S6([],f,!0),l,c,u,h),(f=p)instanceof Float32Array||f instanceof Array?r.push(p):(r.length&&(i(this.createMatrixTransform(r,t)),r.splice(0,r.length)),i(n(p)||If,"parallel"!==d)))}return r.length&&i(this.createMatrixTransform(r,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(e,n){return function(t){return n(e(t))}},t):If}.apply(void 0,a)},A6.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=ct();return e&&t.reverse(),t.forEach(function(t){return ut(p,p,t)}),e&&(e=t=p,(d=new lt(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=(e=e[8])*a-o*l,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Kt(t,t,p),[t[0],t[1]]}},A6);function A6(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:r6,translate:n6,custom:i6,matrix:a6,polar:o6,transpose:s6,scale:p6,"shear.x":m6,"shear.y":v6,reflect:l6,"reflect.x":c6,"reflect.y":u6,rotate:h6,helix:f6,parallel:d6,fisheye:M6,"fisheye.x":k6,"fisheye.y":E6,"fisheye.circular":O6},this.update(t)}function T6(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||$0("Unknown Component: "+t)};return[t=>{var e=t["type"],t=J(t,["type"]);return r(e)(Object.assign({},t))},r]}function P6(t){return void 0!==t.find(t=>"polar"===t.type)}function L6(t){return void 0!==t.find(t=>"helix"===t.type)}function C6(t){return t.filter(({type:t})=>"transpose"===t).length%2==1}function N6(t){return void 0!==t.find(t=>"theta"===t.type)}function j6(t){return void 0!==t.find(t=>"radial"===t.type)}function h(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}nc=h("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Kl=h("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Ao=h("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),lc=h("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),ac=h("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),dc=h("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),tc=h("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),gl=h("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),fw=h("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),bo=h("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function R6(t,e,n){(t.prototype=e.prototype=n).constructor=t}function F6(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function I6(){}var B6=1/.7,r="\\s*([+-]?\\d+)\\s*",o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",D6=/^#([0-9a-f]{3,8})$/,z6=new RegExp(`^rgb\\(${r},${r},${r}\\)$`),G6=new RegExp(`^rgb\\(${mo},${mo},${mo}\\)$`),W6=new RegExp(`^rgba\\(${r},${r},${r},${o}\\)$`),Y6=new RegExp(`^rgba\\(${mo},${mo},${mo},${o}\\)$`),V6=new RegExp(`^hsl\\(${o},${mo},${mo}\\)$`),H6=new RegExp(`^hsla\\(${o},${mo},${mo},${o}\\)$`),q6={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function U6(){return this.rgb().formatHex()}function X6(){return this.rgb().formatRgb()}function $6(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=D6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?K6(e):3===n?new tT(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Z6(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Z6(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=z6.exec(t))?new tT(e[1],e[2],e[3],1):(e=G6.exec(t))?new tT(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=W6.exec(t))?Z6(e[1],e[2],e[3],e[4]):(e=Y6.exec(t))?Z6(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=V6.exec(t))?oT(e[1],e[2]/100,e[3]/100,1):(e=H6.exec(t))?oT(e[1],e[2]/100,e[3]/100,e[4]):q6.hasOwnProperty(t)?K6(q6[t]):"transparent"===t?new tT(NaN,NaN,NaN,0):null}function K6(t){return new tT(t>>16&255,t>>8&255,255&t,1)}function Z6(t,e,n,r){return new tT(t=r<=0?e=n=NaN:t,e,n,r)}function J6(t){return(t=t instanceof I6?t:$6(t))?new tT((t=t.rgb()).r,t.g,t.b,t.opacity):new tT}function Q6(t,e,n,r){return 1===arguments.length?J6(t):new tT(t,e,n,null==r?1:r)}function tT(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function eT(){return"#"+aT(this.r)+aT(this.g)+aT(this.b)}function nT(){var t=rT(this.opacity);return(1===t?"rgb(":"rgba(")+iT(this.r)+`, ${iT(this.g)}, `+iT(this.b)+(1===t?")":`, ${t})`)}function rT(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function iT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function aT(t){return((t=iT(t))<16?"0":"")+t.toString(16)}function oT(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new lT(t,e,n,r)}function sT(t){var e,n,r,i,a,o,s,l;return t instanceof lT?new lT(t.h,t.s,t.l,t.opacity):(t=t instanceof I6?t:$6(t))?t instanceof lT?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new lT(o,s,l,t.opacity)):new lT}function lT(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function cT(t){return(t=(t||0)%360)<0?t+360:t}function uT(t){return Math.max(0,Math.min(1,t||0))}function hT(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}R6(I6,$6,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:U6,formatHex:U6,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return sT(this).formatHsl()},formatRgb:X6,toString:X6}),R6(tT,Q6,F6(I6,{brighter(t){return t=null==t?B6:Math.pow(B6,t),new tT(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new tT(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new tT(iT(this.r),iT(this.g),iT(this.b),rT(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eT,formatHex:eT,formatHex8:function(){return"#"+aT(this.r)+aT(this.g)+aT(this.b)+aT(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:nT,toString:nT})),R6(lT,function(t,e,n,r){return 1===arguments.length?sT(t):new lT(t,e,n,null==r?1:r)},F6(I6,{brighter(t){return t=null==t?B6:Math.pow(B6,t),new lT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new lT(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new tT(hT(240<=t?t-240:120+t,n,e),hT(t,n,e),hT(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new lT(cT(this.h),uT(this.s),uT(this.l),rT(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){var t=rT(this.opacity);return(1===t?"hsl(":"hsla(")+cT(this.h)+`, ${100*uT(this.s)}%, ${100*uT(this.l)}%`+(1===t?")":`, ${t})`)}}));const fT=Math.PI/180,dT=180/Math.PI;var pT=1.78277,gT=-.29227,yT=-.90649,mT=1.97294,vT=mT*yT,bT=mT*pT,xT=pT*gT- -.14861*yT;function wT(t,e,n,r){return 1===arguments.length?(i=t)instanceof kT?new kT(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof tT?i:J6(i)).r/255,o=i.g/255,l=i.b/255,l=(mT*(o-(a=(xT*l+vT*a-bT*o)/(xT+vT-bT)))-gT*(o=l-a))/yT,new kT((l=(s=Math.sqrt(l*l+o*o)/(mT*a*(1-a)))?Math.atan2(l,o)*dT-120:NaN)<0?l+360:l,s,a,i.opacity)):new kT(t,e,n,null==r?1:r);var i,a,o,s,l}function kT(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}R6(kT,wT,F6(I6,{brighter(t){return t=null==t?B6:Math.pow(B6,t),new kT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new kT(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*fT,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new tT(255*(e+n*(-.14861*r+pT*t)),255*(e+n*(gT*r+yT*t)),255*(e+mT*r*n),this.opacity)}}));var ET=t=>()=>t;function MT(e,n){return function(t){return e+t*n}}function OT(a){return 1==(a=+a)?ST:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):ET(isNaN(t)?e:t);var n,r,i}}function ST(t,e){var n=e-t;return n?MT(t,n):ET(isNaN(t)?e:t)}!function t(e){var o=OT(e);function n(e,t){var n=o((e=Q6(e)).r,(t=Q6(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=ST(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);_T=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0<n?s[n-1]:2*r-i,o=n<l-1?s[n+2]:2*i-r;return((1-3*(t=(t-n/l)*l)+3*(n=t*t)-(e=n*t))*a+(4-6*n+3*e)*r+(1+3*t+3*n-3*e)*i+e*o)/6}};var _T,AT=function(t){for(var e,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o=0;o<n;++o)e=Q6(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=_T(r),i=_T(i),a=_T(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function TT(s){return function t(o){function e(e,t){var n=s((e=wT(e)).h,(t=wT(t)).h),r=ST(e.s,t.s),i=ST(e.l,t.l),a=ST(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=r(t),e.l=i(Math.pow(t,o)),e.opacity=a(t),e+""}}return o=+o,e.gamma=t,e}(1)}TT(function(t,e){var n=e-t;return n?MT(t,180<n||n<-180?n-360*Math.round(n/360):n):ET(isNaN(t)?e:t)});var Ql=TT(ST),l=t=>AT(t[t.length-1]),Za=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(h),eo=l(Za),to=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(h),ao=l(to),n=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(h),Zl=l(n),Jl=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(h),e=l(Jl),no=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(h),ro=l(no),oo=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(h),so=l(oo),co=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(h),lo=l(co),uo=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(h),a=l(uo),$l=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(h),ho=l($l),fo=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(h),po=l(fo),io=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(h),r=l(io),mo=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(h),o=l(mo),PT=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(h),LT=l(PT),CT=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(h),NT=l(CT),jT=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(h),RT=l(jT),FT=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(h),IT=l(FT),BT=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(h),DT=l(BT),zT=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(h),GT=l(zT),WT=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(h),YT=l(WT),VT=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(h),HT=l(VT),qT=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(h),UT=l(qT),XT=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(h),$T=l(XT),KT=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(h),ZT=l(KT),JT=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(h),QT=l(JT),tP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(h),eP=l(tP),nP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(h),rP=l(nP),iP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(h),l=l(iP);var aP=Ql(wT(300,.5,0),wT(-240,.5,1)),oP=Ql(wT(-100,.75,.35),wT(80,1.5,.8)),Ql=Ql(wT(260,.75,.35),wT(80,1.5,.8)),sP=wT();var lP=Q6(),cP=Math.PI/3,uP=2*Math.PI/3;function hP(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var fP=hP(h("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),dP=hP(h("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),pP=hP(h("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),gP=hP(h("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),yP=Object.freeze({__proto__:null,schemeCategory10:nc,schemeAccent:Kl,schemeDark2:Ao,schemePaired:lc,schemePastel1:ac,schemePastel2:dc,schemeSet1:tc,schemeSet2:gl,schemeSet3:fw,schemeTableau10:bo,interpolateBrBG:eo,schemeBrBG:Za,interpolatePRGn:ao,schemePRGn:to,interpolatePiYG:Zl,schemePiYG:n,interpolatePuOr:e,schemePuOr:Jl,interpolateRdBu:ro,schemeRdBu:no,interpolateRdGy:so,schemeRdGy:oo,interpolateRdYlBu:lo,schemeRdYlBu:co,interpolateRdYlGn:a,schemeRdYlGn:uo,interpolateSpectral:ho,schemeSpectral:$l,interpolateBuGn:po,schemeBuGn:fo,interpolateBuPu:r,schemeBuPu:io,interpolateGnBu:o,schemeGnBu:mo,interpolateOrRd:LT,schemeOrRd:PT,interpolatePuBuGn:NT,schemePuBuGn:CT,interpolatePuBu:RT,schemePuBu:jT,interpolatePuRd:IT,schemePuRd:FT,interpolateRdPu:DT,schemeRdPu:BT,interpolateYlGnBu:GT,schemeYlGnBu:zT,interpolateYlGn:YT,schemeYlGn:WT,interpolateYlOrBr:HT,schemeYlOrBr:VT,interpolateYlOrRd:UT,schemeYlOrRd:qT,interpolateBlues:$T,schemeBlues:XT,interpolateGreens:ZT,schemeGreens:KT,interpolateGreys:QT,schemeGreys:JT,interpolatePurples:eP,schemePurples:tP,interpolateReds:rP,schemeReds:nP,interpolateOranges:l,schemeOranges:iP,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:aP,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return sP.h=360*t-100,sP.s=1.5-1.5*e,sP.l=.8-.9*e,sP+""},interpolateWarm:oP,interpolateCool:Ql,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,lP.r=255*(e=Math.sin(t))*e,lP.g=255*(e=Math.sin(t+cP))*e,lP.b=255*(e=Math.sin(t+uP))*e,lP+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:fP,interpolateMagma:dP,interpolateInferno:pP,interpolatePlasma:gP});function mP(t,e,n,r,i,a){var o,{guide:s={}}=n,l=function(t,e,n){var{type:n,domain:r,range:i}=n;return void 0!==n?n:function(t){return AP(t,tg)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?EP(t):void 0===r?SP(e)?EP(t):_P(e)?"time":MP(t,i):SP([r])?EP(t):_P(e)?"time":MP(t,i)}(t,e,n);return"string"!=typeof l?n:(o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;var{domainMax:i,domainMin:a}=n;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":var[o,s]=function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)Z0(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n);return[a||o,i||s];case"band":case"ordinal":case"point":return OP(e);case"quantile":return function(t){return OP(t).sort()}(e);case"sequential":var[o,s]=function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)Z0(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e);return[a||o,i||s];default:return[]}}(l,e,n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=pm,nice:n=!1,tickCount:r=10}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e?0:"band"!==t?"point"===t?.5:0:N6(n)?0:.1}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Rf(e),i=yP["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(l,t,n,r)),{domain:o,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"sqrt":var u=kP(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],function(t){return t[t.length-1]}(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||0,c||1];case"ordinal":return kP(n,r,i,a,o);case"sequential":return;default:return[]}}(l,t,e,n,o,i,a),guide:s,name:t,type:l}))}function vP(t,e){var[e]=T6("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[U0,U0];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function bP(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(xP)?Ap(e):t.every(wP)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function xP(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function wP(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function kP(t,e,n,r,i){var[i]=T6("palette",i),{defaultCategory10:r,defaultCategory20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Rf(t),i=yP["scheme"+e],a=yP["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function EP(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function MP(t,e){return"color"!==t||e?"linear":"sequential"}function OP(t){return Array.from(new Set(t.flat()))}function SP(t){return AP(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function _P(t){return AP(t,t=>t instanceof Date)}function AP(t,e){for(const n of t)if(n.some(e))return!0;return!1}function TP(t,e,n){var{component:r=[],coordinates:i=[],title:a}=e,[,o]=T6("component",n),s=t.filter(({guide:t})=>null!==t),e=function(t,e,n){const[,o]=T6("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?C6(i)?t+"Y":t+"X":"y"===e?C6(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,size:i,order:a,type:e},r),{scale:n})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n),l=[...r,...e];a&&(t=o("title")["props"],{defaultPosition:n,defaultOrder:r,defaultSize:e}=t,l.push(Object.assign({type:"title",position:n,order:r,size:e},"string"==typeof a?{title:a}:a)));for(const b of s){var c=function(t,e){var{name:t,guide:n,type:r}=t,n=n["type"];if(void 0!==n)return n;if("color"===t)switch(r){case"ordinal":return"legendCategory";case"linear":return"legendContinuous";default:return null}return C6(e)&&P6(e)||L6(e)||N6(e)?null:t.startsWith("x")?C6(e)?"axisY":"axisX":t.startsWith("y")?C6(e)?"axisX":"axisY":t.startsWith("position")&&!P6(e)?"axisY":null}(b,i);if(null!==c){var u=o(c)["props"],{defaultPosition:h,defaultSize:f,defaultOrder:d}=u,{guide:u,name:p,field:g}=b;for(const x of Array.isArray(u)?u:[u]){var y=function(t,e,n,r,i){n=["left","right","top","bottom","centerVertical","center"].includes(r.position)?r.position:n;{if("axisY"===e&&function(t){return void 0!==t.find(t=>"parallel"===t.type)}(i))return null===(t=/position(\d*)/g.exec(t))?n:(t=+t[1],C6(i)?0==t?"top":"centerHorizontal":0==t?n:"centerVertical");if("axisX"===e&&P6(i)&&!C6(i)||"axisY"===e&&P6(i)&&C6(i)||"axisY"===e&&N6(i)||"axisY"===e&&L6(i)||"axisY"===e&&j6(i))return"bottom"===r.position?"arcInner":"arc";if(P6(i)&&("axisX"===e||"axisY"===e))return"arcY";if(j6(i)&&"axisX"===e)return"arcY";if("axisX"===e&&function(t){return void 0!==t.find(t=>"reflect"===t.type)}(i)||"axisX"===e&&function(t){return void 0!==t.find(t=>"reflectY"===t.type)}(i))return"top";if("string"==typeof e&&e.startsWith("legend")&&P6(i)&&"center"===r.position)return"arcCenter"}return n}(p,c,h,x,i),{size:m=f,order:v=d}=x;l.push(Object.assign(Object.assign({title:g},x),{position:y,order:v,size:m,type:c,scale:b}))}}}return l}function PP(t,e,n,r){var[i]=T6("component",r),{scale:a,bbox:o}=t,t=J(t,["scale","bbox"]),r=a?vP(a,r):null,{field:a,domain:s}=a||{},a={field:a,domain:s,bbox:o};return i(t)(r,a,e,n)}function LP(t,e){var t=function(t,e){var n=Np(t,t=>t.position),{padding:t,paddingLeft:e=t,paddingRight:r=t,paddingBottom:i=t,paddingTop:t=t}=e,a={paddingBottom:i,paddingLeft:e,paddingTop:t,paddingRight:r};for(const l of["left","right","top","bottom"]){var o="padding"+X0(l);if(void 0===a[o])if(n.has(l)){const t=n.get(l);var s=t.reduce((t,{size:e})=>t+e,0);a[o]=s}else a[o]=30}return a}(t,e),{paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a}=t,{width:e,height:o,x:s=0,y:l=0,inset:c=0,insetLeft:u=c,insetTop:h=c,insetBottom:f=c,insetRight:c=c,margin:d=0,marginLeft:p=d,marginBottom:g=d,marginTop:y=d,marginRight:d=d}=e;return Object.assign(Object.assign({},t),{width:e,height:o,insetLeft:u,insetTop:h,insetBottom:f,insetRight:c,innerWidth:e-n-r-p-d,innerHeight:o-i-a-y-g,marginLeft:p,marginBottom:g,marginTop:y,marginRight:d,x:s,y:l})}function CP(t,e,n){var F=Np(t,t=>t.position),{paddingLeft:t,paddingRight:n,paddingTop:r,paddingBottom:I,marginLeft:i,marginTop:a,marginBottom:B,marginRight:D,innerHeight:o,innerWidth:s,height:z,width:G}=n,t=t+i,i=r+a,r=n+D,a=I+B,W={top:[t,0,s,i,0,!0,xp],right:[G-r,i,r,o,1,!1,xp],bottom:[t,z-a,s,a,0,!1,xp],left:[0,i,t,o,1,!0,xp],centerVertical:[t,i,s,o,-1,null,null],centerHorizontal:[t,i,s,o,-1,null,null],arc:[t,i,s,o,-1,null,null],arcY:[t,i,s,o,-1,null,null],arcInner:[t,i,s,o,-1,null,null],center:[t,i,s,o,-1,null,null],arcCenter:[t,i,s,o,-1,null,null]};for(const[R,t]of F.entries()){var l=W[R];if("centerVertical"===R)!function(e,t,n){const[r,i,,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let t=0;t<e.length;t++){var c=e[t];const r=l[t];var u=l[t+1]-r;c.bbox={x:r,y:i,width:u,height:a}}}(t,e,l);else if("centerHorizontal"===R)!function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;t<e.length;t++){var c=e[t];const i=l[t];var u=l[t+1]-i;c.bbox={x:r,y:i,width:a,height:u}}}(t,e,l);else if("arc"===R){p=d=f=h=u=c=void 0;var c=t,u=l,[h,f,d,p]=u;for(let t=0;t<c.length;t++)c[t].bbox={x:h,y:f,width:d,height:p}}else if("arcY"===R){E=k=w=x=b=m=y=v=u=g=void 0;var g=t,u=e,[y,m,,v]=v=l,[b,x]=u.getCenter(),[u,w]=NP(u),k=x-w*(v=v/2),E=(w-u)*v;for(let t=0;t<g.length;t++)g[t].bbox={x:b+y,y:k+m,width:0,height:E}}else if("arcInner"===R){P=T=A=_=v=S=O=w=x=M=void 0;var M=t,x=e,[O,S,,w]=w=l,[v,_]=x.getCenter(),[x]=NP(x),A=x*(w=w/2),T=v-A,P=_-A;for(let t=0;t<M.length;t++)M[t].bbox={x:O+T,y:S+P,width:2*A,height:2*A}}else if("arcCenter"===R){q=H=j=N=V=Y=C=_=L=void 0;var L=t,_=e,[C,Y,V,N]=C=l,[_]=NP(_),j=N/2*_/Math.sqrt(2),H=C+V/2,q=Y+N/2;for(let t=0;t<L.length;t++)L[t].bbox={x:H-j,y:q-j,width:2*j,height:2*j}}else!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,y]=0===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],m=(n.sort((t,e)=>l(t.order,e.order)),s?u+p:u);for(let t=0,e=m;t<n.length;t++){var v=n[t],b=v["size"];v.bbox={[c]:s?e-b:e,[h]:f,[d]:b,[g]:y},e+=b*(s?-1:1)}}(t,l)}}function NP(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[t,e]}function jP(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=J(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function RP(t,i,a){return Oe(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=T6("data",t),n=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};var{type:e="inline"}=t,t=J(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>Oe(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),U0)}([J(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?Pb(n):[],Object.assign(Object.assign({},i),{data:n})]})}function FP(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t<a.length;t++)o[""+i+(0===t?"":t)]=a[t];else o[i]=a;return[t,Object.assign(Object.assign({},e),{encode:o})]}function IP(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Tb(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return Z0(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function BP(t,e,n){var r=e["encode"];return r?(r=Tb(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{visual:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function DP(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=T6("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=Tb(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function zP(l,t,e){var n,r=t["encode"],i=J(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=J(t,["value"]);for(let e=0;e<i.length;e++){var o=i[e];if(Array.isArray(o))for(let t=0;t<o.length;t++){var s=r[t]||[""+n+t,new Array(l).fill(void 0)];s[1][e]=o[t],r[t]=s}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function GP(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return R(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>[t,{guide:s(r,t),slider:s(a,t),scrollbar:s(o,t)}]))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")}})}),[t,e]}function WP(t,e,n){var r=e["animate"];return r||void 0===r||R(e,{animate:{enterType:null,exitType:null,updateType:null}}),[t,e]}function YP(s,l,c){return Oe(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return Oe(this,void 0,void 0,function*(){var t=c["library"],[t]=T6("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[jP,RP,FP,IP,BP,DP,zP,WP,GP,...e.map(t),...r.map(t),...n.map(t)];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(s,l,{library:c});const{encode:n,scale:u,data:r}=e;if(!1===Array.isArray(r))return null;const i=l["channels"],a=Rp(Object.entries(n).filter(([,t])=>Z0(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=i.find(t=>t.name===e);return null!=n&&n.independent?t:e});var o=i.filter(t=>{const{name:e,required:n}=t;if(a.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:s,scaleKey:l,range:c}=t;return a.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=u[t]||{},{independent:a=!1,key:o=l||t,type:r=r?"identity":s}=i,i=J(i,["independent","key","type"]);return{name:t,values:e,scaleKey:a?Symbol("independent"):o,scale:Object.assign({type:r,range:c},i)}})});return[e,Object.assign(Object.assign({},l),{index:t,channels:o})]})}function VP(D,z,G,W){return Oe(this,void 0,void 0,function*(){const[n]=T6("composition",G);var[t]=T6("interaction",G);const e=new Set(Object.keys(G).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(Z0)),r=t=>{t=t.type;return"string"==typeof t&&e.has(t)?"mark":t};const i=t=>"standardView"===r(t);var a=t=>{var e;return i(t)?[t]:(e=r(t),n({type:e})(t))},o=[];const s=new Map;for(var l=new Map,c=[D],u=[];c.length;){var h=c.shift();if(i(h)){var f=l.get(h),[f,d]=f?XP(f,h,G):yield qP(h,G),p=(s.set(f,h),o.push(f),d.flatMap(a));if(c.push(...p),p.every(i)){var g=yield Promise.all(p.map(t=>UP(t,G)));bP(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),bP(f,"y");for(let t=0;t<p.length;t++){var y=p[t],m=g[t];l.set(y,m)}}}else{d="mark"===r(h)?h:yield e8(h,G),f=a(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}var v=D["on"];t6(v,ZA.BEFORE_PAINT);const b=new Map,x=new Map,w=[];z.selectAll(a8(Y)).data(o,t=>t.key).join(t=>t.append("g").attr("className",Y).attr("id",t=>t.key).call(HP).each(function(t){$P(t,tt(this),w,G),b.set(t,this)}),t=>t.call(HP).each(function(t){$P(t,tt(this),w,G),x.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var k=t=>Array.from(t.entries()).map(([t,e])=>({view:t,container:e,options:s.get(t),update:function(i,a,o){return r=>Oe(this,void 0,void 0,function*(){var[t,e]=yield qP(r,a);$P(t,i,[],a);for(const n of e)VP(n,i,a,o);return{options:r,view:t}})}(tt(e),G,W)})),E=k(b);for(const P of E){const D=P["options"];var M=new Map;P.container.nameInteraction=M;for(const L of t8(D)){var O=t(L)(P,E);M.set(L.type,{destroy:O})}}var S=k(x);for(const C of S){const{options:D,container:N}=C;var _=N.nameInteraction;for(const j of t8(D)){var A=_.get(j.type);A&&A.destroy();A=t(j)(C,S);_.set(D.type,{destroy:A})}}const{width:F,height:I}=D;var T=[];for(const R of u){var B=new Promise(e=>Oe(this,void 0,void 0,function*(){for(const t of R)yield VP(Object.assign({width:F,height:I},t),z,G,W);e()}));T.push(B)}W.animations=w,t6(v,ZA.AFTER_PAINT);k=w.filter(Z0).map(JP).map(t=>t.finished);return Promise.all([...k,...T])})}function HP(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function qP(t,e){return Oe(this,void 0,void 0,function*(){return XP(yield UP(t,e),t,e)})}function UP(v,b){return Oe(this,void 0,void 0,function*(){var[t]=T6("theme",b);const[i,a]=T6("mark",b);var{theme:e,marks:n,coordinates:r=[]}=v,o=t(QP(e)),s=new Map,l=[];for(const p of n){var c=yield e8(p,b);l.push(c)}for(const g of yield Promise.all(l.map(r=>Oe(this,void 0,void 0,function*(){const{type:t=$0("G2Mark type is required."),key:n}=r;var e=a(t)["props"],{composite:e=!1}=e;return e?(yield i(r)(v)).map((t,e)=>Object.assign({key:n+"-"+e},t)):r}))).then(t=>t.flat())){var u,h=g["type"],h=a(h)["props"],h=yield YP(g,h,b);h&&([h,u]=h,s.set(h,u))}for(const y of Np(Array.from(s.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var f=y.reduce((t,{scale:e})=>R(t,e),{}),d=y[0]["values"],d=Array.from(new Set(d.map(t=>t.field).filter(Z0)));const v=R({guide:{title:0===d.length?void 0:d},field:d[0]},f);d=y[0]["name"];const m=mP(d,y.flatMap(({values:t})=>t.map(t=>t.value)),v,r,o,b);y.forEach(t=>t.scale=m)}return s})}function XP(t,e,n){var r,i,[a]=T6("mark",n),[o]=T6("theme",n),{key:s,frame:l=!1,theme:c,clip:u,style:h={}}=e,o=o(QP(c)),c=Array.from(t.values()),c=Array.from(new Set(c.flatMap(t=>t.channels.map(t=>t.scale)))),c=TP(Array.from(c),e,n),f=LP(c,e),d=function(t,e,n){var[n]=T6("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new _6(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(f,e,n),e=l?R({mainLineWidth:1,mainStroke:"#000"},h):h,p=(CP(c,d,f),{}),g=[];for([r,i]of t.entries()){const{children:b,dataDomain:x,modifier:w,key:k}=r;var{index:y,channels:m}=i,v=Tb(Object.fromEntries(m.map(({name:t,scale:e})=>[t,e])),t=>vP(t,n));Object.assign(p,v);const E=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(m,v),[M,O,S]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;t<e.length;t++){var a=e[t],o=n[t];o.every(([t,e])=>Z0(t)&&Z0(e))&&(r.push(a),i.push(o))}return[r,i]}(a(r)(y,v,E,d));m=x||M.length;const _=w?w(O,m,f):[];y=M.map((t,e)=>{var n={points:O[e],transform:_[e],index:t,markKey:k};for(const[r,i]of Object.entries(E))n[r]=i[t],S&&(n["series"+Rf(r)]=S[e].map(t=>i[t]));return S&&(n.seriesIndex=S[e]),n}),m=(i.data=y,i.index=M,null==b?void 0:b(y,v,f));g.push(...m||[])}return[{layout:f,theme:o,coordinate:d,components:c,markState:t,key:s,clip:u,scale:p,style:e},g]}function $P(X,$,K,Z){Oe(this,void 0,void 0,function*(){const{components:F,theme:n,layout:t,markState:e,coordinate:r,key:i,style:I,clip:a}=X,{width:B,height:D}=t,z=J(t,["x","y","width","height"]),o=["view","plot","main","content"];var s,l,c,u=o.map((t,e)=>e);const h=o.map(t=>J0(Object.assign({},n,I),t)),G=["a","margin","padding","inset"].map(t=>Q(z,t)),f=t=>t.style("x",t=>m[t].x).style("y",t=>m[t].y).style("width",t=>m[t].width).style("height",t=>m[t].height).each(function(t){var e,n,r=tt(this),t=h[t];for([e,n]of Object.entries(t))r.style(e,n)});let d=0,p=0,g=B,y=D;const m=u.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=G[t];return d+=t,p+=e,g-=t+r,y-=e+n,{x:d,y:p,width:g,height:y}}),v=($.selectAll(a8(ot)).data(u.filter(t=>Z0(h[t])),t=>o[t]).join(t=>t.append("rect").attr("className",ot).style("zIndex",-2).call(f),t=>t.call(f),t=>t.remove()),$.selectAll(a8(it)).data(F,(t,e)=>t.type+"-"+e).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",it).append(t=>PP(t,r,n,Z)),t=>t.each(function(t){var{preserve:e=!1}=t;e||(e=PP(t,r,n,Z)["attributes"],[t]=this.childNodes,t.update(Object.assign({},e)))})),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{updateType:a,updateDuration:o=300,updateDelay:s=0,enterType:l,enterDuration:c=300,enterDelay:u=0,exitType:h,exitDuration:f=300,exitDelay:d=0}=r;for(const E of i){var{updateType:p=a,updateDuration:g=o,updateDelay:y=s,enterType:m=l,enterDuration:v=c,enterDelay:b=u,exitDuration:x=f,exitDelay:w=d,exitType:k=h}=E;void 0!==p&&!p||(e=Math.max(e,g+y),n=Math.min(n,y)),void 0!==k&&!k||(e=Math.max(e,x+w),n=Math.min(n,w)),void 0!==m&&!m||(e=Math.max(e,v+b),n=Math.min(n,b))}}return e===-1/0?null:[n,e-n]}(e)),b=$.selectAll(a8(rt)).data([t],()=>i).join(t=>t.append("rect").style("fill","transparent").attr("className",rt).call(n8).call(i8,Array.from(e.keys())).call(o8,a),t=>t.call(i8,Array.from(e.keys())).call(t=>{if(!v)return n8(t);{const[l,c]=v;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(o8,a)).transitions();K.push(...b.flat());for([s,l]of e.entries()){var W=l["data"];const{key:i,class:S}=s,_=function(l,t,e,n){const[c]=T6("shape",n),u=l["data"],{defaultShape:h,data:r}=t,f=r.map(t=>t.points),{theme:d,coordinate:p}=e,{type:g,style:y={}}=l;return(t,e)=>{var{shape:n=h}=y,{shape:n=n,points:r,seriesIndex:i,index:a}=t,t=J(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{shape:n,mark:g,defaultShape:h,index:e});const o=i?i.map(t=>u[t]):u[a],s=i||a;e=Tb(y,t=>KP(t,o,s,u));return c(Object.assign(Object.assign({},e),{type:r8(l,n)}))(r,t,p,d,f)}}(s,l,X,Z),A=(x=s,c=l,ZP("enter",x,c,X,Z)),T=(x=s,c=l,ZP("update",x,c,X,Z)),P=(x=s,c=l,ZP("exit",x,c,X,Z));var x=function(t,e,n){t=t.node().parentElement;return t.findAll(t=>t.style.facet===e).flatMap(t=>t.getElementsByClassName(n))}($,S,"element");const b=$.select("#"+i).selectAll(a8(nt)).selectFacetAll(x).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(_).attr("className",nt).transition(function(t){return A(t,[this])}),e=>e.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});e.transition(function(t,e){n=this,r=l,i=c,n.__facet__&&(a=n.parentNode.parentNode,s=r.parentNode,[a,o]=i(a),[i,s]=i(s),a=`translate(${a-i}, ${o-s})`,i=n.style.transform,n.style.transform=(("none"===i?"":i)+" "+a).trimStart(),r.append(n));var n,r,i,a,o=_(t,e),s=T(t,[this],[o]);return null===s&&K0(this,o),s})}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return P(t,[this])}).remove(),t=>t.append(_).attr("className",nt).transition(function(t){var e=this["__fromElements__"],t=T(t,e,[this]);return new kb(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new kb([],this.__toData__,this.parentNode).append(_).attr("className",nt).nodes();return T(t,[this],e)}).remove()).transitions();K.push(...b.flat())}{var w=X,k=$,E=Z,M,O;const[Y]=T6("labelTransform",E),{markState:V,labelTransform:L}=w,H=k.select(a8(et)).node(),C=new Map,N=new Map,q=Array.from(V.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r){const[s]=T6("shape",r),l=t["data"],{data:i,defaultLabelShape:c}=e,u=i.map(t=>t.points),{theme:h,coordinate:f}=n;return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t}=t,t=Tb(J(t,["formatter"]),t=>KP(t,r,e,l)),{shape:a=c,text:o}=t,t=J(t,["shape","text"]),i="string"==typeof i?FE(i):i,i=Object.assign(Object.assign({},t),{text:i(o)});return s(Object.assign({type:"label."+a},t))(n,i,f,h,u)}}(t,e,w,E),a=k.select("#"+r).selectAll(a8(nt)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=J(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{C.set(t,i),N.set(t,e)}),t})})}),j=tt(H).selectAll(a8(at)).data(q,t=>t.key).join(t=>t.append(t=>C.get(t)(t)).attr("className",at),t=>t.each(function(t){K0(this,C.get(t)(t))}),t=>t.remove()).nodes(),U=Np(j,t=>N.get(t.__data__)),R=w["coordinate"];for([M,O]of U){var{transform:M=[]}=M;(function(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),U0)})(M.map(Y))(O,R)}L&&L(j,R)}})}function KP(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function ZP(o,t,e,n,r){var[,i]=T6("shape",r);const[s]=T6("animation",r);r=e.defaultShape;const{theme:a,coordinate:l}=n;e=`default${Rf(o)}Animation`;const{[e]:c}=i(r8(t,r)).props,{[o]:u={}}=a,h=Q(t.animate||{},o);return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||c},h);return t.type?(t=s(t)(e,n,{delay:r,duration:i,easing:a},l,u),Array.isArray(t)?t:[t]):null}}function JP(t){return t.finished.then(()=>{t.cancel()}),t}function QP(t={type:"light"}){var{type:e="light"}=t;return Object.assign(Object.assign({},t),{type:e})}function t8(t){var{interactions:t=[]}=t;return t}function e8(r,i){return Oe(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=J(r,["data"]);return null==e?r:([,{data:e}]=yield RP(0,{data:e},t),Object.assign({data:e},n))})}function n8(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function r8(t,e){t=t.type;return t+"."+e}function i8(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(a8(y)).data(e,t=>t.key).join(t=>t.append("g").attr("className",y).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(a8(et)).node())||t.append("g").attr("className",et)}function a8(...t){return t.map(t=>"."+t).join("")}function o8(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new os({style:{x:e,y:t,width:n,height:r}})):null})}function s8(t){for(var t=R({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t<s.length;t++){var l=s[t];e.set(l,o),n.set(l,t),r.push(l)}}return t}function l8(t,e={},n){const{width:r=640,height:i=480,on:a}=t,o=s8(t),{canvas:s=(t=r,c=i,u=new gf,u.registerPlugin(new Of),new Oc({width:t,height:c,container:document.createElement("div"),renderer:u})),library:l=QA()}=e;var c,u;e.canvas=s,e.library=l,s.resize(r,i),t6(a,ZA.BEFORE_RENDER);const h=tt(s.document.documentElement);return s.ready.then(()=>VP(Object.assign(Object.assign({},o),{width:r,height:i}),h,l,e)).then(n).then(()=>t6(a,ZA.AFTER_RENDER)),"string"==typeof(t=s.getConfig().container)?document.getElementById(t):t}function c8(t,e={}){var n,t=t["on"],e=e["canvas"];e&&e.destroy(),(e=t)&&(n?delete e[n]:e={})}function u8(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function h8(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function f8(t,{name:e,key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length?this.attr(r,t):((n=this.attr(r)||{})[t]=e,this.attr(r,n))}}function d8(t,{name:e,key:i=e}){t.prototype[e]=function(t,e){var n,r=this.attr(i)||{};return 0===arguments.length?r:1===arguments.length?r[t]:((n=r[t])?Af(e)?n.concat(e):n.push(e):r[t]=Af(e)?e:[e],this.attr(i,r))}}function f(r){return t=>{for(const n of r){var e=n["type"];"value"===e?u8(t,n):"array"===e?h8(t,n):"object"===e?f8(t,n):"node"===e?function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.append(n)}}(t,n):"container"===e?function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,n):"event"===e&&d8(t,n)}return t}}function p8(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function g8(t,e){for(var n=[t];n.length;){var r=n.pop(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class y8{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],t.parentNode=this,t.index=this.children.length,this.children.push(t),t}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return g8(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return g8(this,t=>{e===t.type&&n.push(t)}),n}call(t,...e){return t(this.map(),...e),this}root(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}nc=[{name:"encode",type:"object"},{name:"scale",type:"object"},{name:"data",type:"value"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"animate",type:"object"},{name:"label",type:"array",key:"labels"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"slider",type:"object"},{name:"scrollbar",type:"object"}];class m8 extends y8{changeData(t){var e=this.root();e&&(this.attr("data",t),null!=e)&&e.render()}getMark(){}getScale(){}getGroup(){}}let v8=class extends m8{constructor(){super({},"interval")}},b8=(v8=t([f(nc)],v8),class extends m8{constructor(){super({},"rect")}}),x8=(b8=t([f(nc)],b8),class extends m8{constructor(){super({},"point")}}),w8=(x8=t([f(nc)],x8),class extends m8{constructor(){super({},"area")}}),k8=(w8=t([f(nc)],w8),class extends m8{constructor(){super({},"line")}}),E8=(k8=t([f(nc)],k8),class extends m8{constructor(){super({},"cell")}}),M8=(E8=t([f(nc)],E8),class extends m8{constructor(){super({},"vector")}}),O8=(M8=t([f(nc)],M8),class extends m8{constructor(){super({},"link")}}),S8=(O8=t([f(nc)],O8),class extends m8{constructor(){super({},"polygon")}});S8=t([f(nc)],S8);Kl=t([f(nc)],class extends m8{constructor(){super({},"image")}});let _8=class extends m8{constructor(){super({},"text")}},A8=(_8=t([f(nc)],_8),class extends m8{constructor(){super({},"box")}}),T8=(A8=t([f(nc)],A8),class extends m8{constructor(){super({},"lineX")}}),P8=(T8=t([f(nc)],T8),class extends m8{constructor(){super({},"lineY")}}),L8=(P8=t([f(nc)],P8),class extends m8{constructor(){super({},"range")}}),C8=(L8=t([f(nc)],L8),class extends m8{constructor(){super({},"rangeX")}}),N8=(C8=t([f(nc)],C8),class extends m8{constructor(){super({},"rangeY")}}),j8=(N8=t([f(nc)],N8),class extends m8{constructor(){super({},"connector")}}),R8=(j8=t([f(nc)],j8),class extends m8{constructor(){super({},"shape")}}),F8=(R8=t([f(nc)],R8),class extends m8{constructor(){super({},"sankey")}}),I8=(F8=t([f([...nc,{name:"layout",type:"value"}])],F8),class extends m8{constructor(){super({},"treemap")}}),B8=(I8=t([f([...nc,{name:"layout",type:"value"}])],I8),class extends m8{constructor(){super({},"boxplot")}}),D8=(B8=t([f(nc)],B8),class extends m8{constructor(){super({},"pack")}}),z8=(D8=t([f([...nc,{name:"layout",type:"value"}])],D8),class extends m8{constructor(){super({},"forceGraph")}}),G8=(z8=t([f([...nc,{name:"layout",type:"value"}])],z8),class extends m8{constructor(){super({},"tree")}}),W8=(G8=t([f([...nc,{name:"layout",type:"value"}])],G8),class extends m8{constructor(){super({},"wordCloud")}});W8=t([f([...nc,{name:"layout",type:"object"}])],W8);Ao={interval:v8,rect:b8,point:x8,area:w8,line:k8,cell:E8,vector:M8,link:O8,polygon:S8,image:Kl,text:_8,box:A8,lineX:T8,lineY:P8,range:L8,rangeX:C8,rangeY:N8,connector:j8,sankey:F8,treemap:I8,boxplot:B8,shape:R8,pack:D8,forceGraph:z8,tree:G8,wordCloud:W8};let Y8=class extends y8{getView(){}},V8=class extends(Y8=t([f([{name:"on",type:"event"}])],Y8)){constructor(t={},e="view"){super(t,e)}},H8=(V8=t([f([{type:"value",name:"data"},{type:"array",name:"coordinate",key:"coordinates"},{type:"array",name:"interaction",key:"interactions"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"axis"},{type:"object",name:"legend"},...p8(Ao)])],V8),class extends Y8{constructor(){super({},"spaceLayer")}}),q8=(H8=t([f([{type:"value",name:"data"},...p8(Ao)])],H8),class extends Y8{constructor(){super({},"spaceFlex")}}),U8=(q8=t([f([{type:"value",name:"data"},...p8(Ao)])],q8),class extends Y8{constructor(){super({},"facetRect")}}),X8=(U8=t([f([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...p8(Ao)])],U8),class extends Y8{constructor(){super({},"facetCircle")}}),$8=(X8=t([f([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...p8(Ao)])],X8),class extends Y8{constructor(){super({},"repeatMatrix")}}),K8=($8=t([f([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...p8(Ao)])],$8),class extends Y8{constructor(){super({},"timingKeyframe")}}),Z8=(K8=t([f([...p8(Ao)])],K8),class extends Y8{constructor(){super({},"geoView")}}),J8=(Z8=t([f([{type:"value",name:"data"},{type:"value",name:"projection"},{type:"array",name:"coordinate",key:"coordinates"},{type:"array",name:"interaction",key:"interactions"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"legend"},...p8(Ao)])],Z8),class extends Y8{constructor(){super({},"geoPath")}});J8=t([f([{type:"value",name:"data"},{type:"value",name:"projection"},{type:"array",name:"coordinate",key:"coordinates"},{type:"array",name:"interaction",key:"interactions"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},...p8(Ao)])],J8);var Q8={view:V8,spaceLayer:H8,spaceFlex:q8,facetRect:U8,facetCircle:X8,repeatMatrix:$8,timingKeyframe:K8,geoView:Z8,geoPath:J8};for(const nL of Object.values(Q8))f(p8(Q8))(nL);const tL=QA();function eL(t){return Object.assign(Object.assign({},t.value),{type:t.type})}lc=[{name:"data",type:"value"},{name:"width",type:"value"},{name:"height",type:"value"},{name:"coordinate",type:"array",key:"coordinates"},{name:"interaction",type:"array",key:"interactions"},{name:"theme",type:"object"},{name:"title",type:"value"},{name:"key",type:"value"},{name:"transform",type:"array"},{name:"theme",type:"object"},{name:"on",type:"event"},{name:"scale",type:"object"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"style",type:"object"},...p8(Ao),...Object.entries(Q8).map(([t,e])=>({type:"container",name:t,ctor:e}))];p.Chart=class extends V8{constructor(t={}){var r,i,a,o,e=t["container"];super(J(t,["container"]),"view"),this.onResize=(r=()=>{this.forceFit()},i=300,function(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}),this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._context={library:tL},this.bindAutoFit()}render(){var t,e,n,r,i,a,o;return this._context.canvas||({width:i=640,height:o=480,renderer:t,plugins:e,autoFit:n}=this.options(),{width:n,height:r}=ig(this._container,n,i,o),this.width(n),this.height(r),this._context.canvas=([n,r,i,a=new gf,o=[]]=[this._container,i,o,t,e],o.push(new Of),o.forEach(t=>a.registerPlugin(t)),new Oc({container:n,width:r,height:i,renderer:a}))),l8(this.options(),this._context),this}options(){var t,e=this,e=null!==(e=e).type?e:((t=e.children[e.children.length-1]).attr("width",e.attr("width")),t.attr("height",e.attr("height")),t.attr("paddingLeft",e.attr("paddingLeft")),t.attr("paddingTop",e.attr("paddingTop")),t.attr("paddingBottom",e.attr("paddingBottom")),t.attr("paddingRight",e.attr("paddingRight")),t.attr("insetLeft",e.attr("insetLeft")),t.attr("insetRight",e.attr("insetRight")),t.attr("insetBottom",e.attr("insetBottom")),t.attr("insetTop",e.attr("insetTop")),t.attr("marginLeft",e.attr("marginLeft")),t.attr("marginBottom",e.attr("marginBottom")),t.attr("marginTop",e.attr("marginTop")),t.attr("marginRight",e.attr("marginRight")),t.attr("autoFit",e.attr("autoFit")),t.attr("padding",e.attr("padding")),t.attr("margin",e.attr("margin")),t.attr("inset",e.attr("inset")),t),n=[e],r=new Map;for(r.set(e,eL(e));n.length;){const e=n.pop();var i=r.get(e);for(const s of e.children){var a=eL(s),{children:o=[]}=i;o.push(a),n.push(s),r.set(s,a),i.children=o}}return r.get(e)}node(){return this._container}context(){return this._context}destroy(){var t,e=this.options(),n=e["on"];t6(n,ZA.BEFORE_DESTROY),this.unbindAutoFit(),c8(e,this._context),e=this._container,(t=e.parentNode)&&t.removeChild(e),t6(n,ZA.AFTER_DESTROY)}clear(){var t=this.options(),e=t["on"];t6(e,ZA.BEFORE_CLEAR),c8(t,this._context),t6(e,ZA.AFTER_CLEAR)}forceFit(){var{width:t,height:e,autoFit:n}=this.options(),{width:n,height:t}=ig(this._container,n,t,e);t&&n&&this.changeSize(n,t)}changeSize(t,e){var{width:n,height:r,on:i}=this.options();if(n===t&&r===e)return this;t6(i,ZA.BEFORE_CHANGE_SIZE),this.width(t),this.height(e),this.render(),t6(i,ZA.AFTER_CHANGE_SIZE)}bindAutoFit(){var t=this.options()["autoFit"];t&&window.addEventListener("resize",this.onResize)}unbindAutoFit(){var t=this.options()["autoFit"];t&&window.removeEventListener("resize",this.onResize)}},p.Chart=t([f(lc)],p.Chart),p.AREA_CLASS_NAME=ot,p.COMPONENT_CLASS_NAME=it,p.ELEMENT_CLASS_NAME=nt,p.LABEL_CLASS_NAME=at,p.LABEL_LAYER_CLASS_NAME=et,p.MAIN_LAYER_CLASS_NAME=y,p.PLOT_CLASS_NAME=rt,p.VIEW_CLASS_NAME=Y,p.createLibrary=QA,p.destroy=c8,p.register=function(t,e){Object.assign(tL,{[t]:e})},p.render=l8,p.renderToMountedElement=function(t,e={},n){const{width:r=640,height:i=480,on:a}=t;var o,t=s8(t),{library:s=QA(),group:l=new qo}=e;if(null!=l&&l.parentElement)return o=tt(l),e.group=l,e.library=s,t6(a,ZA.BEFORE_RENDER),VP(Object.assign(Object.assign({},t),{width:r,height:i}),o,s,e).then(n).then(()=>t6(a,ZA.AFTER_RENDER)),l;throw new Error("renderToMountedElement can't render chart to unmounted group.")},Object.defineProperty(p,"__esModule",{value:!0})});
10
+ `,g.style.x=t,g.style.y=e,g.style.width=n-t,g.style.height=r-e},A=t=>{var e=t["target"],[t,n]=SO(a,t);e===g?p=[t,n]:(((t,e)=>{if(g&&g.remove(),y&&y.remove(),f=[t,e],c)return k();E()})(t,n),v=!0)},T=t=>{var e,n,r,t=SO(a,t);f&&(p?(n=(t,e,n,r,i)=>t+e<r?r-e:i<t+n?i-n:t,r=(e=t)[0]-p[0],e=e[1]-p[1],r=n(r,f[0],d[0],m,x),n=n(e,f[1],d[1],b,w),e=[f[0]+r,f[1]+n],r=[d[0]+r,d[1]+n],O(e,r)):O(f,t))},P=t=>{var e,n,r,i;p?(p=null,{x:e,y:r,width:n,height:i}=g.style,f=[e,r],d=[e+n,r+i]):(d=SO(a,t),[e,n,r,i]=O(f,d),v=!1,o(e,n,r,i))},L=t=>{t=t.target;g&&t!==g&&M()},C=t=>{t=t.target;t!==g||v?FO(a,"crosshair"):FO(a,"move")},N=()=>{FO(a,"default")};return a.addEventListener("dragstart",A),a.addEventListener("drag",T),a.addEventListener("dragend",P),a.addEventListener("click",L),a.addEventListener("pointermove",C),a.addEventListener("pointerleave",N),{mask:g,remove(){g&&M()},destroy(){g&&M(),a.removeEventListener("dragstart",A),a.removeEventListener("drag",T),a.removeEventListener("dragend",P),a.removeEventListener("click",L),a.removeEventListener("pointermove",C),a.removeEventListener("pointerleave",N)}}}function b3(t,e){var{elements:n,siblings:r=t=>[],datum:i,brushRegion:a,extent:o,reverse:s,series:l=!1,key:d=t=>t,bboxOf:c=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}}}=e,e=J(e,["elements","siblings","datum","brushRegion","extent","reverse","series","key","bboxOf"]);const p=n(t),g=r(t),y=g.flatMap(n);r=CO(p,i),n=Q(e,"mask");const{setState:v,removeState:u}=LO(e,r),h=new Map,{width:f,height:m,x:b,y:x}=c(t);i=o||[0,0,f,m];return m3(t,Object.assign(Object.assign({},n),{extent:i,brushRegion:a,reverse:s,brushended:l?()=>{for(const t of p)u(t,"unhighlighted");for(const e of h.values())e.remove();h.clear()}:()=>{for(const t of[...p,...y])u(t,"highlighted","unhighlighted")},brushed:l?(t,e,n,r)=>{var i;for(const o of p){var a=h.get(o)||(a=o,i=void 0,i=a.cloneNode(),a.parentNode.appendChild(i),h.set(a,i),i);a.style.clipPath=new as({style:{x:t+b,y:e+x,width:n-t,height:r-e}}),v(o,"unhighlighted"),v(a,"highlighted")}}:(t,e,n,r)=>{var i;for(const u of g)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of p){var{min:o,max:s}=h.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r<e||o<t||i<a||s<n)}([o,l,s,c],[t,e,n,r])?v(h,"unhighlighted"):(v(h,"highlighted"),a.add(d(h)))}for(const f of y)a.has(d(f))?v(f,"highlighted"):v(f,"unhighlighted")}}))}function x3(t){var{facet:u,brushKey:h}=t,f=J(t,["facet","brushKey"]);return(t,r)=>{var e,n,i,a,{container:o,view:s}=t,o=MO(o),l={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1};if(u)return e=(a=o.getBounds()).min[0],n=a.min[1],i=a.max[0],a=a.max[1],b3(o.parentNode.parentNode,Object.assign(Object.assign({elements:()=>EO(t,r),datum:PO(s),brushRegion:(t,e,n,r)=>[t,e,n,r],maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,extent:[e,n,i,a]},l),f));const c=b3(o,Object.assign(Object.assign({elements:kO,key:t=>t.__data__.key,siblings:()=>{return e=t,n=h,r.filter(t=>{return t!==e&&({interactions:t=[]}=t.options,t.find(t=>t.brushKey===n))}).map(t=>MO(t.container));var e,n},datum:PO(s),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0},l),f));return o.brush=c,()=>c.destroy()}}function w3(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function k3(t){return x3(Object.assign(Object.assign({},t),{brushRegion:w3}))}function E3(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function M3(t){return x3(Object.assign(Object.assign({},t),{brushRegion:E3}))}const O3="axis",S3="axis-hot-area";function _3(t){return t.getElementsByClassName(O3)}function A3(t){return t.getElementsByClassName("axis-line")[0]}function T3(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function P3(t,e){var{cross:n,offsetX:i}=e,e=J(e,["cross","offsetX","offsetY"]),r=T3(t),[t]=A3(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:E3,hotZone:new as({className:S3,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function L3(t,e){var{offsetY:i,cross:n=!1}=e,e=J(e,["offsetY","offsetX","cross"]),r=T3(t),[,t]=A3(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:w3,hotZone:new as({className:S3,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function C3(t,e){var{axes:n,elements:r,points:i,horizontal:a,datum:o,offsetY:s,offsetX:l,reverse:c=!1}=e,e=J(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse"]);const u=r(t);r=n(t);const h=LO(e,CO(u,o))["setState"],f=new Map;var d=Q(e,"mask");const p=()=>{for(const t of u)(t=>Array.from(f.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(t))?h(t,"highlighted"):h(t,"unhighlighted")};var g=r.some(a)&&r.some(t=>!a(t));for(const y of r){const{hotZone:v,brushRegion:m,extent:b}=(a(y)?L3:P3)(y,{offsetY:s,offsetX:l,cross:g,zIndex:999,fill:"transparent"});y.parentNode.appendChild(v),m3(v,Object.assign(Object.assign({},d),{reverse:c,brushRegion:m,brushended(){f.delete(y),p()},brushed(t,e,n,r){f.set(y,b(t,e,n,r)),p()}}))}}function N3(i){return t=>{var{container:t,view:e}=t,{x:n,y:r}=MO(t).getBBox();return C3(t,Object.assign({elements:kO,axes:_3,offsetY:r,offsetX:n,points:t=>t.__data__.points,horizontal:t=>{var{startPos:[t,e],endPos:[n,r]}=t.attributes;return t!==n&&e===r},datum:PO(e),unhighlightedOpacity:.5},i))}}function j3(t,e){var{filter:i,reset:n,brushRegion:r,extent:a,reverse:o}=e,e=Q(J(e,["filter","reset","brushRegion","extent","reverse","series"]),"mask"),{width:s,height:l}=t.getBBox(),a=a||[0,0,s,l];const c=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),u=m3(t,Object.assign(Object.assign({},e),{extent:a,brushRegion:r,reverse:o,brushcreated:function(t,e,n,r){i(t,e,n,r),u.remove()}}));function h(t){c(t)&&n()}return t.addEventListener("click",h),()=>{u.destroy(),t.removeEventListener("click",h)}}function R3(t){var{hideX:y=!0,hideY:v=!0}=t,i=J(t,["hideX","hideY"]);return(t,e)=>{const{container:n,view:r,options:h,update:f}=t;t=MO(n);let d=!1,p=!1,g=r;return j3(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],filter:(s,l,c,u)=>Oe(this,void 0,void 0,function*(){if(!p){p=!0;const{scale:e,coordinate:r}=g,{x:i,y:a}=e;var t=(t,e)=>{var[t,n]=r.invert(t);return[VM(i,t,e),VM(a,n,e)]};const n=t([s,l],!0),o=t([c,u],!1);t=h["marks"],t=t.map(t=>R({axis:Object.assign(Object.assign({},y&&{x:{labelTransforms:[{type:"hide"}]}}),v&&{y:{labelTransforms:[{type:"hide"}]}})},t,{scale:{x:{domain:YM(i,[n[0],o[0]])},y:{domain:YM(a,[n[1],o[1]])}}})),t=Object.assign(Object.assign({},h),{marks:t,clip:!0}),t=yield f(t);g=t.view,p=!1,d=!0}}),reset:()=>{!p&&d&&(d=!1,g=r,f(h))},extent:void 0},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),i))}}function F3(t){return R3(Object.assign(Object.assign({hideX:!0},t),{brushRegion:w3}))}function B3(t){return R3(Object.assign(Object.assign({hideY:!0},t),{brushRegion:E3}))}const I3="slider";function D3({wait:p=50,leading:g=!0,trailing:y=!1}){return t=>{const{container:e,view:n,options:l,update:c}=t;t=e.getElementsByClassName(I3);if(t.length){let s=!1;const u=n["scale"];var{x:r,y:i}=u;const o=new Map,h={x:r.getOptions().domain,y:i.getOptions().domain};for(const f of t){const d=f.attributes["orient"];var a=Wf(o=>Oe(this,void 0,void 0,function*(){var t,e,n,r,i,a=o.detail["value"];s||(s=!0,i="vertical"===d?"y":"x",a=function(t,e){var[t,n]=t;return YM(e,[VM(e,t,!0),VM(e,n,!1)])}(a,u[i]),h[i]=a,t="vertical"===d?"x":"y",e=h[t],n=l,r={[i]:{domain:a},[t]:{domain:e}},i=(i=n["marks"]).map(t=>R({axis:{x:{labelTransforms:[{type:"hide"}]},y:{labelTransforms:[{type:"hide"}]}}},t,{scale:r,slider:Object.assign(Object.assign({},t.slider.x&&{x:{preserve:!0}}),t.slider.y&&{y:{preserve:!0}}),animate:!1})),a=Object.assign(Object.assign({},n),{marks:i,clip:!0,animate:!1}),yield c(a),s=!1)}),p,{leading:g,trailing:y});f.addEventListener("valuechange",a),o.set(f,a)}return()=>{for(var[t,e]of o)t.removeEventListener("valuechange",e)}}}}const z3={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function G3(t){return"text"===t.nodeName&&!!t.isOverflowing()}function W3(t){var{offsetX:f=8,offsetY:d=8}=t,r=J(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=Q(r,"tip"),h=new Set,e=t=>{var e,n,r,i,a,o=t["target"];G3(o)?({offsetX:e,offsetY:n}=t,e=e+f-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new Uo({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},z3),u),`<${r} style="${Object.entries(a).map(([t,e])=>t.replace(/([A-Z])/g,"-$1").toLowerCase()+":"+e).join(";")}">${i}</${r}>`),x:e,y:n}}),s.appendChild(a),o.tip=a,h.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];G3(e)?e.tip&&(e.tip.remove(),e.tip=null,h.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),h.forEach(t=>t.remove())}}}function H3(n){return(t,...e)=>R({},n(t,...e),t)}function V3(n){return(t,...e)=>R({},t,n(t,...e))}function Y3(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=J(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const q3=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:a,data:o}=t;return e.map(t=>{var e=t["data"],t=J(t,["data"]);return Object.assign(Object.assign({},t),{data:Y3(e,o),x:n,y:r,width:i,height:a})})},U3=(q3.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],y=g["data"],g=J(g,["data"]),y=Y3(y,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:y},g)),p+=f[t]+i}return d}),X3=(U3.props={},()=>t=>{var e=t["children"],t=J(t,["children"]);if(!Array.isArray(e))return[];const{data:a,scale:o={},axis:s={},legend:l={}}=t,n=J(t,["data","scale","axis","legend"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={}}=t,t=J(t,["data","scale","axis","legend"]);return Object.assign({data:Y3(e,a),scale:R({},o,n),axis:!(!r||!s)&&R({},s,r),legend:!(!i||!l)&&R({},l,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),$3=(X3.props={},()=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:v,data:m,coordinates:b,theme:x,component:w,interactions:k,x:E,y:M,key:O,frame:S,title:_,labelTransform:A,parentKey:T,clip:P}=t,t=J(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinates","theme","component","interactions","x","y","key","frame","title","labelTransform","parentKey","clip"]);return[{type:"standardView",x:E,y:M,key:O,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinates:b,component:w,interactions:k,frame:S,title:_,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:v,parentKey:T,clip:P,marks:[Object.assign(Object.assign({},t),{key:O+"-0",data:m})]}]}),K3=($3.props={},H3(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=zp(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}})),Z3=H3(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:u,encode:h={},scale:n={},legend:f={}}=r.shift();var s=h["color"],l=n["color"],c=f["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(u)&&r.push(...u)}return{encode:{color:i},scale:{color:R({},a,{domain:void 0!==(t=null==(t=null===n||void 0===n?void 0:n.color)?void 0:t.domain)?t:void 0!==i?Array.from(new Set(e.map(t=>t[i]))):void 0,type:"ordinal"})},legend:{color:R({title:i},o)}}}),J3=H3(()=>({animate:{enterType:"fadeIn"}})),Q3=V3(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),tS=V3(()=>({type:"cell"})),eS=V3(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),nS=V3((t,c=function(t){t=t.points;return Gb(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?rS(a,e):(t=e.length?void 0:null,R({title:r===i-1&&void 0,grid:t},a))}},k=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?rS(r,e):(n=e.length?void 0:null,R({title:0===t&&void 0,grid:n},r))}},E={})=>{const{data:e,encode:n,children:u,scale:r,x:M=0,y:O=0,shareData:h=!1,key:S}=t,_=e["value"],{x:A,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=Vb(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[A]:t,[T]:e}=t,t=void 0===A||t===n,e=void 0===T||e===r;return t&&e}).map(t=>_.filter(t)),m=h?n0(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:A,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=J(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:A?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:_,l={color:{domain:P}},o={x:iS(o,w)(p,r),y:iS(a,k)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+M,y:h+v+O,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:m,scale:R(s,e,l),axis:R({},i,o),legend:!1},t),E)})})}}});function rS(t,e){return e.length?R({title:!1,tick:null,label:null},t):R({title:!1,tick:null,label:null,grid:null},t)}function iS(t,e){return"function"==typeof t?t:null===t?()=>null:e(t)}const aS=()=>t=>{return[JM.of(t).call(tS).call(Z3).call(J3).call(K3).call(Q3).call(eS).call(nS).value()]},oS=(aS.props={},H3(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),sS=V3(t=>{const{data:w,children:c,x:k=0,y:E=0,key:M}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:v,paddingTop:m}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=Vb(t);const s=t.map(({points:t})=>Gb(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,h,f,d]=s[c],[p,g]=l[c],y=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=J(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return rS(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return rS(n,e)})(y,w)};return Object.assign({data:w,parentKey:M,key:i+"-"+c,x:u+v+k,y:h+m+E,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:R({x:{facet:!1},y:{facet:!1}},e),axis:R({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:R({},a,{x:p,y:g})},t)})})}}}),lS=V3(t=>{var e=t["encode"],t=J(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=J(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const cS=()=>t=>{return[JM.of(t).call(tS).call(Z3).call(sS).call(lS).call(J3).call(Q3).call(oS).value()]},uS=H3(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),hS=H3(t=>({coordinates:[{type:"polar"}]})),fS=t=>{var e=t["encode"],t=J(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function dS(t){return t=>null}function pS(t){var t=t["points"],[t,e,n,r]=t,i=Bb(t,r),t=Fb(t,r),r=zb(t,Fb(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=Db(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const gS=()=>t=>{return[JM.of(t).call(tS).call(fS).call(Z3).call(hS).call(eS).call(nS,pS,dS,dS,{frame:!1}).call(J3).call(Q3).call(uS).value()]};const yS=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],h=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=R({enterDuration:e,updateDuration:e,exitDuration:e,updateEasing:n,updateType:"morphing",updateFill:"both",exitType:"fadeOut"},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t<l;){n=c,a=t,o=u,s=void 0,s=[0,o],o=[1-o,1];var[n,r]="normal"===n?s:"reverse"===n?o:"alternate"===n?a%2==0?s:o:"reverse-alternate"===n?a%2==0?o:s:void 0;for(let t=n;t<r;t+=1){var i=Math.abs(t);e!==i&&(yield h[i]),e=i}t++}var a,o,s}};function vS(t,e){if(null!==t)return{type:"column",value:t,field:e}}function mS(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function bS(t,e){var n=[];for(const r of t)n[r]=e;return n}function xS(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function wS(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=xS(t,i);if(null!==n)return[n,r]}return[null,null]}function kS(t){return!(t instanceof Date)&&"object"==typeof t}yS.props={};const ES=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,R({},e,{encode:{y1:vS(bS(t,0))}})]};function MS(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=xS(r,t))?void 0:t[0]]}).filter(([,t])=>ug(t));return Array.from(zp(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function OS(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:Sp(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>CS(t=>r(e[t]))):"series"===t?AS:"value"===t?TS:"sum"===t?PS:"maxIndex"===t?LS:()=>null}function SS(t,e){for(const n of t)n.sort(e)}function _S(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function AS(t,e,n){return CS(t=>n[t])}function TS(t,e,n){return CS(t=>e[t])}function PS(t,n,e){t=Vb(t),t=Array.from(zp(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return CS(t=>r.get(e[t]))}function LS(t,n,e){t=Vb(t),t=Array.from(zp(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,r0(e,t=>n[t])]));return CS(t=>r.get(e[t]))}function CS(n){return(t,e)=>Sp(n(t),n(e))}ES.props={};const NS=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:L=!1,y:C="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=xS(r,"y"),[s,l]=xS(r,"y1"),[r]=j?wS(r,"series","color"):xS(r,"color"),c=MS(T,t,e),n=OS(P)(n,a,r),u=(n&&SS(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const O of c){L&&O.reverse();var g=s?+s[O[0]]:0,y=[],v=[];for(const S of O){var m=f[S]=+a[S]-g;m<0?v.push(S):0<=m&&y.push(S)}var b=0<y.length?y:v,x=0<v.length?v:y;let t=y.length-1,e=0;for(;0<t&&0===a[b[t]];)t--;for(;e<x.length-1&&0===a[x[e]];)e++;d.push(b[t]),p.push(x[e]);let n=g;for(const _ of v.reverse()){var w=f[_];n=u[_]=(h[_]=n)+w}let r=g;for(const A of y){var k=f[A];0<k?r=u[A]=(h[A]=r)+k:u[A]=h[A]=r}}const E=new Set(d),M=new Set(p);r="y"===C?u:h,n="y"===N?u:h;return[t,R({},e,{encode:{y:vS(r,o),y1:vS(n,l)},style:Object.assign({first:(t,e)=>E.has(e),last:(t,e)=>M.has(e)},i)})]}};function jS(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}NS.props={};const RS=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(jS)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",NS({groupBy:r})(t,e,n))},FS=(RS.props={},(t={})=>{const{channel:i="x"}=t;return(t,e)=>{var n=e["encode"],r=n["title"];return void 0!==r?[t,e]:([r,n]=xS(n,i),[t,R({},e,{encode:{title:vS(r,n)}})])}}),BS=(FS.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,R({},e,{encode:{x:vS(bS(t,0))},scale:{x:{guide:null}}})]}),IS=(BS.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,R({},e,{encode:{y:vS(bS(t,0))},scale:{y:{guide:null}}})]}),DS=(IS.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,R({},e,{encode:{size:mS(bS(t,3))}})]}),zS=(DS.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=J(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,R({},e,{encode:{key:vS(r)}})]}),GS=(zS.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=xS(n,"color"),[t,R({},e,{encode:{series:vS(r,i)}})])}),WS=(GS.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(kS)?[t,e]:[t,R({},e,{encode:{y:vS(n)}})]}),HS=(WS.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(kS)?[t,e]:[t,R({},e,{encode:{x:vS(n)}})]}),VS=(HS.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=xS(n,"y"),[t,R({},e,{encode:{y1:vS([...r])}})])}),YS=(VS.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=xS(n,"x"),[t,R({},e,{encode:{x1:vS([...r])}})])}),qS=(YS.props={},t=>{const r=t["channel"];return(t,e)=>{const i=e["encode"];var n=i["tooltip"];if(void 0!==n)return[t,e];n=Array.isArray(r)?r:[r];let a=0;n=n.flatMap(e=>Object.entries(i).filter(([t])=>t.startsWith(e)).flatMap(([t])=>{const[e,n]=xS(i,t);var r,t=[[t,vS(e)]];return e&&null!==n&&(r=e.map(t=>({value:t,field:n})),t.push(["tooltip"+(0===a?"":a),vS(r,n)]),a++),t}));return[t,R({},e,{encode:Object.fromEntries(n)})]}}),US=(qS.props={},()=>(t,e)=>[t,R({scale:{x:{padding:0},y:{padding:0}}},e)]),XS=(US.props={},()=>(t,e)=>{var{style:n={}}=e,r=J(e,["data","style"]),{x:i,y:a}=n,n=J(n,["x","y"]);return null==i||null==a?[t,e]:[[0],R({},r,{data:[0],cartesian:!0,encode:{x:vS([i||0]),y:vS([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),$S=(XS.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,R({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),KS=($S.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(kS)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,R({},e,{encode:{x:vS(n),y:vS(r)}})])}),ZS=(KS.props={},()=>(t,e)=>{var{style:n={}}=e,n=n["gradient"];return n?[t,R({},e,{encode:{series:mS(bS(t,void 0))}})]:[t,e]}),JS=(ZS.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return J(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=xS(r,"y"),[r]=wS(r,"series","color"),o=_S(r,i),i=MS(c,t,e),n=OS(h)(n,a,r),s=(n&&SS(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t<l.length;t++)s[l[t]]=o[t]}return[t,R({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:vS(s)}})]}}),QS=(JS.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:y=null,reverse:v=!1,duration:m}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,xS(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,h]of r){var a=[];for(const n of i){var o=Array.from(zp(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=xS(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),v&&i.reverse()}r=(m||3e3)/i.length;const[s]=m?[bS(n,r)]:wS(e,"enterDuration",bS(n,r));var[l]=wS(e,"enterDelay",bS(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=n0(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,R({},t,{encode:{enterDuration:mS(s),enterDelay:mS(c)}})]}});QS.props={};const t_=(t={})=>{const{groupBy:d="x",basis:p="max"}=t;return(e,t)=>{const n=t["encode"];var r,i=J(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,xS(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=MS(d,e,t),l="function"==typeof(r=p)?r:{min:(t,e)=>i0(t,t=>e[+t]),max:(t,e)=>n0(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>u0(t,t=>e[+t]),median:(t,e)=>h0(t,t=>e[+t]),sum:(t,e)=>p0(t,t=>e[+t]),deviation:(t,e)=>jp(t,t=>e[+t])}[r]||n0;for(const e of i){var c=l(e,o);for(const f of e)for(let t=0;t<a.length;t++){var[,u]=a[t],[,h]=s[t];h[f]=+u[f]/c}}return[e,R({},t,{encode:Object.fromEntries(s.map(([t,e])=>[t,vS(e,xS(n,t)[1])]))})]}};function e_(t,e,n){return null===t?[-.5,.5]:(t=_S(t,e),[-(e=new Dv({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function n_(t,e,n){return e*(1-t)+n*t}t_.props={};const r_=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=xS(n,"x"),[n]=xS(n,"y");const o=e_(a,r,l),s=e_(n,i,c);a=t.map(()=>n_(u(),...s)),r=t.map(()=>n_(u(),...o));return[t,R({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:vS(a),dx:vS(r)}})]}},i_=(r_.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=xS(n,"x");const i=e_(n,r,a);n=t.map(()=>n_(o(),...i));return[t,R({scale:{x:{padding:.5}}},e,{encode:{dx:vS(n)}})]}}),a_=(i_.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=J(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,xS(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=MS(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Rp(e.flatMap(e=>i.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t<o.length;t++){var h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,R({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,vS(e,xS(n,t)[1])]))})]}}),o_=(a_.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=xS(n,"y");var[,i]=xS(n,"y1"),n=(h?wS(n,"series","color"):xS(n,"color"),MS(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;n<c.length;n++){var s=c[n],l=Math.max(...o.filter((t,e)=>e!==n));a[s]=r[s]>l?l:r[s]}}return[t,R({},e,{encode:{y1:vS(a,i)}})]}});function s_(t,e){return[t[0]]}function l_(t,e){return[t[t.length-1]]}function c_(t,e){return[t[r0(t,t=>e[t])]]}function u_(t,e){return[t[a0(t,t=>e[t])]]}o_.props={};const h_=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=MS(a,t,e);const[r]=xS(n,o),i="function"==typeof(n=s)?n:{first:s_,last:l_,max:c_,min:u_}[n]||s_;return[t.flatMap(t=>i(t,r)),e]}},f_=(h_.props={},(t={})=>{var e=t["selector"],t=J(t,["selector"]);return h_(Object.assign({channel:"x",selector:e},t))}),d_=(f_.props={},(t={})=>{var e=t["selector"],t=J(t,["selector"]);return h_(Object.assign({channel:"y",selector:e},t))});function p_(e){return t=>null===t?e:e+" of "+t}function g_(){return[(t,e)=>u0(t,t=>+e[t]),p_("mean")]}function y_(){return[(t,e)=>h0(t,t=>+e[t]),p_("median")]}function v_(){return[(t,e)=>n0(t,t=>+e[t]),p_("max")]}function m_(){return[(t,e)=>i0(t,t=>+e[t]),p_("min")]}function b_(){return[(t,e)=>t.length,p_("count")]}function x_(){return[(t,e)=>p0(t,t=>+e[t]),p_("sum")]}function w_(){return[(t,e)=>e[t[0]],p_("first")]}function k_(){return[(t,e)=>e[t[t.length-1]],p_("last")]}d_.props={};const E_=(t={})=>{const a=t["groupBy"],c=J(t,["groupBy"]);return(t,e)=>{const{data:o,encode:s}=e,l=a(t,e);var n,r,i;return l?(n=Object.entries(c).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:g_,max:v_,count:b_,first:w_,last:k_,sum:x_,min:m_,median:y_}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=xS(s,t);return[t,vS(l.map(t=>n(t,null!==i&&void 0!==i?i:o)),(null==r?void 0:r(a))||a)]}),r=Object.keys(s).map(t=>{const[e,n]=xS(s,t);return[t,vS(l.map(t=>e[t[0]]),n)]}),i=l.map(t=>o[t[0]]),[Vb(l),R({},e,{data:i,encode:Object.fromEntries([...r,...n])})]):[t,e]}},M_=(E_.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=J(t,["channels"]);return E_(Object.assign(Object.assign({},e),{groupBy:(t,e)=>MS(n,t,e)}))}),O_=(M_.props={},(t={})=>M_(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),S_=(O_.props={},(t={})=>M_(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),__=(S_.props={},(t={})=>M_(Object.assign(Object.assign({},t),{channels:["color"]})));function A_(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=J(n,["reverse","slice","channel"]),o=e["encode"];const[s]=xS(o,a);var l,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=xS(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>n0(t,t=>+a[t]);if("min"===i)return t=>i0(t,t=>+a[t]);if("sum"===i)return t=>p0(t,t=>+a[t]);if("median"===i)return t=>h0(t,t=>+a[t]);if("mean"===i)return t=>u0(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),n=(o=t,c=t=>s[t],(2!==(l=n).length?Vp(Gp(o,l,c),([t,e],[n,r])=>Sp(e,r)||Sp(t,n)):Vp(zp(o,c),([t,e],[n,r])=>l(e,r)||Sp(t,n))).map(([t])=>t)),o=(r&&n.reverse(),"number"==typeof i?[0,i]:i),c=i?n.slice(...o):n;return[t,R(e,{scale:{[a]:{domain:c}}})]}__.props={};const T_=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=J(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return A_(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=xS(i,r);return i=Vp(t,t=>a[t]),n&&i.reverse(),[i,e]}}},P_=(T_.props={},(t={})=>T_(Object.assign(Object.assign({},t),{channel:"x"}))),L_=(P_.props={},(t={})=>T_(Object.assign(Object.assign({},t),{channel:"color"}))),C_=(L_.props={},(t={})=>T_(Object.assign(Object.assign({},t),{channel:"y"})));C_.props={};const N_=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=xS(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):xS(r,s)[0],r=Wp(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>p0(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,R({},e,{scale:{x:{flex:r}}})]}};function j_(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const h=a-u*c,f=u<=1?0:h/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=Gb(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}N_.props={};const R_=()=>(t,e)=>[t,R({},e,{modifier:j_,axis:!1})],F_=(R_.props={},"thresholds");function B_(t){var[e,n]=Rp(t);return Math.min(200,(t=t,Math.ceil((n-e)*Math.cbrt(Np(t))/(3.49*jp(t)))))}const I_=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=J(t,["groupChannels","binChannels"]),u={};return E_(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(F_)))),Object.fromEntries(l.flatMap(e=>[[e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",([t])=>+u[e].get(t).split(",")[1]]]))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=xS(n,t);return t}),a=Q(c,F_),o=t.filter(e=>i.every(t=>ug(t[e]))),r=[...s.map(t=>{var[t]=xS(n,t);return t}).filter(ug).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||B_(n),e=e0().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(zp(o,e=>r.map(t=>t(e)).join("-")).values())}}))},D_=(I_.props={},(t={})=>{var e=t["thresholds"];return I_(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function z_(e,n,r,t){var a=e.length;if(a<=t||0===t)return e;var o,s=t=>+n[e[t]],l=t=>+r[e[t]],c=[],u=(a-2)/(t-2);let h=0,f,d;c.push(h);for(let i=0;i<t-2;i++){let t=0,e=0,n=Math.floor((i+1)*u)+1;for(var p=Math.floor((i+2)*u)+1,g=(p=Math.min(p,a))-n;n<p;n++)t+=s(n),e+=l(n);t/=g,e/=g;let r=Math.floor((i+0)*u)+1;var y=Math.floor((i+1)*u)+1,v=[s(h),l(h)];for(f=-1;r<y;r++)(o=.5*Math.abs((v[0]-t)*(s(r)-v[1])-(v[0]-l(r))*(e-v[0])))>f&&(f=o,d=r);c.push(d),h=d}return c.push(a-1),c.map(t=>e[t])}function G_(t){if("function"==typeof t)return t;if("lttb"===t)return z_;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[a0(t,t=>n[t])]],max:(t,e,n)=>[t[r0(t,t=>n[t])]],median:(t,e,n)=>{return[t[c0(t,.5,t=>n[t])]]}};const i=e[t]||e.median;return(t,e,n,r)=>{return function(t,e){var n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/r))).flatMap(t=>i(t,e,n))}}D_.props={};const W_=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o="series"}=t,s=G_(e);return(t,e)=>{var n=e["encode"],t=MS(o,t,e);const[r]=xS(n,"x"),[i]=xS(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},H_=(W_.props={},(s={})=>(t,e)=>{const i=e["encode"],n=Object.entries(s).map(([t,e])=>{const[n]=xS(i,t);if(!n)return null;if("function"==typeof e)return t=>e(n[t]);const r=Array.isArray(e)?e:[e];return 0===r.length?null:t=>r.includes(n[t])}).filter(ug);if(0===n.length)return[t,e];const r=t.filter(e=>n.every(t=>t(e))),a=r.map((t,e)=>e);var o=Object.entries(i).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:a.map(t=>e.value[r[t]])})]);return[t,R({},e,{encode:Object.fromEntries(o)})]});function V_(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function Y_(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}H_.props={};const q_=t=>{const r=t["priority"];return(t,e)=>{const n=[];return r&&t.sort(r),t.forEach(t=>{t.attr("visibility","visible");const i=t.getLocalBounds();n.some(t=>{var e=V_(i),t=V_(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]<r[0]&&n[0]>t[0]&&e[1]<r[1]&&n[1]>t[1]})?t.attr("visibility","hidden"):n.push(t)}),t}};function U_(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const X_=t=>{const{maxIterations:k=10,maxError:E=.1,padding:M=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=U_(),[v,m]=U_();var a,o,s,l,[c,t]=U_(),[u,n]=U_();for(const b of i){var{min:r,max:h}=function(t){var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,h]=h;y(b,g),m(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<k;t++){i.sort((t,e)=>Sp(v(t),v(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=v(f);var d=c(f),p=v(e),d=p-(g+d);d<M&&(d=(M-d)/2,r=Math.max(r,d),m(f,g-d),m(e,p+d))}}if(r<E)break}for(const w of i)w.style.y+=v(w)-g(w)}return i}};function $_(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function K_(t,e,n){return.2126*$_(t)+.7152*$_(e)+.0722*$_(n)}function Z_(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=K_(t,n,r),n=K_(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function J_(e,t){return t[r0(t,t=>{return Z_(e,"object"==typeof(t=t)?t:fa(t))})]}const Q_=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return(t,e)=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;Z_(t.parsedStyle.fill,e)<n&&t.attr("fill",J_(e,r))}),t)},tA=t=>(t,e)=>(t.forEach(t=>{t.attr("visibility","visible");var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(Y_(t,e)&&Y_(n,e))}(V_(t.getLocalBounds()),e)||t.attr("visibility","hidden")}),t);var P=1e-6,eA=1e-12,L=Math.PI,nA=L/2,rA=L/4,iA=2*L,aA=180/L,oA=L/180,sA=Math.abs,lA=Math.atan,cA=Math.atan2,C=Math.cos,uA=Math.ceil,hA=Math.exp,fA=Math.log,dA=Math.pow,N=Math.sin,pA=Math.sign||function(t){return 0<t?1:t<0?-1:0},gA=Math.sqrt,yA=Math.tan;function vA(t){return 1<t?0:t<-1?L:Math.acos(t)}function mA(t){return 1<t?nA:t<-1?-nA:Math.asin(t)}function bA(){}function xA(t,e){t&&kA.hasOwnProperty(t.type)&&kA[t.type](t,e)}var wA={Feature:function(t,e){xA(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)xA(n[r].geometry,e)}},kA={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){EA(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)EA(n[r],e,0)},Polygon:function(t,e){MA(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)MA(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)xA(n[r],e)}};function EA(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function MA(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)EA(t[n],e,1);e.polygonEnd()}function OA(t,e){t&&wA.hasOwnProperty(t.type)?wA[t.type](t,e):xA(t,e)}function SA(t){return[cA(t[1],t[0]),mA(t[2])]}function _A(t){var e=t[0],t=t[1],n=C(t);return[n*C(e),n*N(e),N(t)]}function AA(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function TA(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function PA(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function LA(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function CA(t){var e=gA(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function NA(n,r){function t(t,e){return t=n(t,e),r(t[0],t[1])}return n.invert&&r.invert&&(t.invert=function(t,e){return(t=r.invert(t,e))&&n.invert(t[0],t[1])}),t}function jA(t,e){return sA(t)>L&&(t-=Math.round(t/iA)*iA),[t,e]}function RA(t,e,n){return(t%=iA)?e||n?NA(BA(t),IA(e,n)):BA(t):e||n?IA(e,n):jA}function FA(n){return function(t,e){return sA(t+=n)>L&&(t-=Math.round(t/iA)*iA),[t,e]}}function BA(t){var e=FA(t);return e.invert=FA(-t),e}function IA(t,e){var i=C(t),a=N(t),o=C(e),s=N(e);function n(t,e){var n=C(e),r=C(t)*n,t=N(t)*n,n=N(e),e=n*i+r*a;return[cA(t*o-e*s,r*i-n*a),mA(e*o+t*s)]}return n.invert=function(t,e){var n=C(e),r=C(t)*n,t=N(t)*n,n=N(e),e=n*o-t*s;return[cA(t*o+n*s,r*i+e*a),mA(e*i-r*a)]},n}function DA(t,e){(e=_A(e))[0]-=t,CA(e);t=vA(-e[1]);return((-e[2]<0?-t:t)+iA-P)%iA}function zA(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:bA,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function GA(t,e){return sA(t[0]-e[0])<P&&sA(t[1]-e[1])<P}function WA(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function HA(t,e,n,r,a){var o,i,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],i=t[e];if(GA(r,i)){if(!r[2]&&!i[2]){for(a.lineStart(),o=0;o<e;++o)a.point((r=t[o])[0],r[1]);return void a.lineEnd()}i[0]+=2*P}s.push(n=new WA(r,t,null,!0)),l.push(n.o=new WA(r,null,n,!1)),s.push(n=new WA(i,t,null,!1)),l.push(n.o=new WA(i,null,n,!0))}}),s.length){for(l.sort(e),VA(s),VA(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function VA(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function YA(t){return sA(t[0])<=L?t[0]:pA(t[0])*((sA(t[0])+L)%iA-L)}function qA(y,v,m,b){return function(s){var l,c,u,n=v(s),h=zA(),f=v(h),d=!1,e={point:r,lineStart:i,lineEnd:a,polygonStart:function(){e.point=p,e.lineStart=o,e.lineEnd=g,c=[],l=[]},polygonEnd:function(){e.point=r,e.lineStart=i,e.lineEnd=a,c=f0(c);var t=function(t,e){var n=YA(e),r=e[1],e=N(r),i=[N(n),-C(n),0],a=0,o=0,s=new Fp;1===e?r=nA+P:-1===e&&(r=-nA-P);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=YA(f),p=f[1]/2+rA,g=N(p),y=C(p),v=0;v<h;++v,d=b,g=w,y=x,f=m){var m=u[v],b=YA(m),x=m[1]/2+rA,w=N(x),x=C(x),k=b-d,E=0<=k?1:-1,M=E*k,O=L<M,S=g*w;s.add(cA(S*E*N(M),y*x+S*C(M))),a+=O?k+E*iA:k,O^n<=d^n<=b&&(CA(S=TA(_A(f),_A(m))),CA(M=TA(i,S)),(E=(O^0<=k?-1:1)*mA(M[2]))<r||r===E&&(S[0]||S[1]))&&(o+=O^0<=k?1:-1)}return(a<-P||a<P&&s<-eA)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),HA(c,XA,t,m,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),m(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),m(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function r(t,e){y(t,e)&&s.point(t,e)}function t(t,e){n.point(t,e)}function i(){e.point=t,n.lineStart()}function a(){e.point=r,n.lineEnd()}function p(t,e){u.push([t,e]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.result(),o=a.length;if(u.pop(),l.push(u),u=null,o)if(1&i){if(0<(e=(n=a[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart(),t=0;t<e;++t)s.point((r=n[t])[0],r[1]);s.lineEnd()}}else 1<o&&2&i&&a.push(a.pop().concat(a.shift())),c.push(a.filter(UA))}return e}}function UA(t){return 1<t.length}function XA(t,e){return((t=t.x)[0]<0?t[1]-nA-P:nA-t[1])-((e=e.x)[0]<0?e[1]-nA-P:nA-e[1])}jA.invert=jA;var $A=qA(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?L:-L,l=sA(t-h);sA(l-L)<P?(c.point(h,f=0<(f+e)/2?nA:-nA),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&L<=l&&(sA(h-d)<P&&(h-=d*P),sA(t-s)<P&&(t-=s*P),l=f,i=e,o=N((n=h)-(r=t)),f=sA(o)>P?lA((N(l)*(a=C(i))*N(r)-N(i)*(r=C(l))*N(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*nA,r.point(-L,i),r.point(0,i),r.point(L,i),r.point(L,0),r.point(L,-i),r.point(0,-i),r.point(-L,-i),r.point(-L,0),r.point(-L,i)):sA(t[0]-e[0])>P?(t=t[0]<e[0]?L:-L,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-L,-nA]);function KA(d){var g=C(d),p=6*oA,h=0<g,f=sA(g)>P;function y(t,e){return C(t)*C(e)>g}function v(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=TA(_A(t),_A(e)),f=AA(h,h),d=h[0],p=f-d*d;return p?(r=TA(u,h),PA(u=LA(u,g*f/p),LA(h,-g*d/p)),(p=(h=AA(u,f=r))*h-(d=AA(f,f))*(AA(u,u)-1))<0?void 0:(PA(p=LA(f,(-h-(r=gA(p)))/d),u),p=SA(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=sA((s=a-i)-L)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(sA(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:L<s^(i<=p[0]&&p[0]<=a))?(PA(c=LA(f,(-h+r)/d),u),[p,SA(c)]):void 0):p)):!n&&t}function m(t,e){var n=h?d:L-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return qA(y,function(a){var o,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(t,e){var n,r=[t,e],i=y(t,e),t=h?i?0:m(t,e):i?m(t+(t<0?L:-L),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=v(o,r))&&!GA(o,n)&&!GA(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=v(r,o),a.point(n[0],n[1])):(n=v(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=v(r,o,!0))||(u=0,h?(a.lineStart(),a.point(e[0][0],e[0][1]),a.point(e[1][0],e[1][1]),a.lineEnd()):(a.point(e[1][0],e[1][1]),a.lineEnd(),a.lineStart(),a.point(e[0][0],e[0][1],3)))),!i||o&&GA(o,r)||a.point(r[0],r[1]),o=r,l=i,s=t},lineEnd:function(){l&&a.lineEnd(),o=null},clean:function(){return u|(c&&l)<<1}}},function(t,e,n,r){var i=r,r=d,a=p,o=n,n=t,s=e;if(a){var l=C(r),c=N(r),u=o*a;null==n?(n=r+o*iA,s=r-u/2):(n=DA(l,n),s=DA(l,s),(0<o?n<s:s<n)&&(n+=o*iA));for(var h,f=n;0<o?s<f:f<s;f-=u)h=SA([l,-c*C(f),-c*N(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-L,d-L])}var ZA=1e9,JA=-ZA;function QA(v,m,b,x){function w(t,e){return v<=t&&t<=b&&m<=e&&e<=x}function k(t,e,n,r){var i=0,a=0;if(null==t||(i=o(t,n))!==(a=o(e,n))||s(t,e)<0^0<n)for(;r.point(0===i||3===i?v:b,1<i?x:m),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return sA(t[0]-v)<P?0<e?0:3:sA(t[0]-b)<P?0<e?2:1:sA(t[1]-m)<P?0<e?1:0:0<e?3:2}function E(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(r){var i,h,a,o,s,l,c,u,f,d,p,g=r,t=zA(),e={point:n,lineStart:function(){e.point=y,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(y(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[e],o=1,s=a.length,l=a[0],c=l[0],u=l[1];o<s;++o)r=c,i=u,l=a[o],c=l[0],u=l[1],i<=x?x<u&&(u-i)*(v-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(v-r)&&--t;return t}(),e=p&&t,n=(i=f0(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),k(null,null,1,r),r.lineEnd()),n&&HA(i,E,t,k,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function y(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?g.point(t,e):!function(t,e,n,r,i,a){var o=t[0],s=t[1],l=0,c=1,u=e[0]-o,h=e[1]-s,n=n-o;if(u||!(0<n)){if(n/=u,u<0){if(n<l)return;n<c&&(c=n)}else if(0<u){if(c<n)return;l<n&&(l=n)}if(n=i-o,u||!(n<0)){if(n/=u,u<0){if(c<n)return;l<n&&(l=n)}else if(0<u){if(n<l)return;n<c&&(c=n)}if(n=r-s,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(JA,Math.min(ZA,c)),u=Math.max(JA,Math.min(ZA,u))],r=[t=Math.max(JA,Math.min(ZA,t)),e=Math.max(JA,Math.min(ZA,e))],v,m,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function t4(t,e,n){var r=d0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function e4(t,e,n){var r=d0(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function n4(){return g=p=10,y=90,v=360,m=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],i<a&&(t=a,a=i,i=t),l<c&&(t=c,c=l,l=t),e.precision(m)):[[a,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],n<r&&(t=r,r=n,n=t),o<s&&(t=s,s=o,o=t),e.precision(m)):[[r,s],[n,o]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(y=+t[0],v=+t[1],e):[y,v]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(m=+t,u=t4(s,o,90),h=e4(r,n,m),f=t4(c,l,90),d=e4(a,i,m),e):m},e.extentMajor([[-180,-90+P],[180,90-P]]).extentMinor([[-180,-80-P],[180,80+P]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return d0(uA(a/y)*y,i,y).map(f).concat(d0(uA(c/v)*v,l,v).map(d)).concat(d0(uA(r/p)*p,n,p).filter(function(t){return sA(t%y)>P}).map(u)).concat(d0(uA(s/g)*g,o,g).filter(function(t){return sA(t%v)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,v,m}var r4,i4,a4,o4,s4=t=>t,l4=new Fp,c4=new Fp,u4={point:bA,lineStart:bA,lineEnd:bA,polygonStart:function(){u4.lineStart=h4,u4.lineEnd=p4},polygonEnd:function(){u4.lineStart=u4.lineEnd=u4.point=bA,l4.add(sA(c4)),c4=new Fp},result:function(){var t=l4/2;return l4=new Fp,t}};function h4(){u4.point=f4}function f4(t,e){u4.point=d4,r4=a4=t,i4=o4=e}function d4(t,e){c4.add(o4*t-a4*e),a4=t,o4=e}function p4(){d4(r4,i4)}var g4=u4,y4=1/0,v4=y4,m4=-y4,b4=m4;var x4,w4,k4,E4,M4={point:function(t,e){t<y4&&(y4=t);m4<t&&(m4=t);e<v4&&(v4=e);b4<e&&(b4=e)},lineStart:bA,lineEnd:bA,polygonStart:bA,polygonEnd:bA,result:function(){var t=[[y4,v4],[m4,b4]];return m4=b4=-(v4=y4=1/0),t}},O4=0,S4=0,_4=0,A4=0,T4=0,P4=0,L4=0,C4=0,N4=0,j4={point:R4,lineStart:F4,lineEnd:D4,polygonStart:function(){j4.lineStart=z4,j4.lineEnd=G4},polygonEnd:function(){j4.point=R4,j4.lineStart=F4,j4.lineEnd=D4},result:function(){var t=N4?[L4/N4,C4/N4]:P4?[A4/P4,T4/P4]:_4?[O4/_4,S4/_4]:[NaN,NaN];return O4=S4=_4=A4=T4=P4=L4=C4=N4=0,t}};function R4(t,e){O4+=t,S4+=e,++_4}function F4(){j4.point=B4}function B4(t,e){j4.point=I4,R4(k4=t,E4=e)}function I4(t,e){var n=t-k4,r=e-E4,n=gA(n*n+r*r);A4+=n*(k4+t)/2,T4+=n*(E4+e)/2,P4+=n,R4(k4=t,E4=e)}function D4(){j4.point=R4}function z4(){j4.point=W4}function G4(){H4(x4,w4)}function W4(t,e){j4.point=H4,R4(x4=k4=t,w4=E4=e)}function H4(t,e){var n=t-k4,r=e-E4,n=gA(n*n+r*r);A4+=n*(k4+t)/2,T4+=n*(E4+e)/2,P4+=n,L4+=(n=E4*t-k4*e)*(k4+t),C4+=n*(E4+e),N4+=3*n,R4(k4=t,E4=e)}var V4=j4;function Y4(t){this._context=t}Y4.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,iA)}},result:bA};var q4,U4,X4,$4,K4,Z4=new Fp,J4={point:bA,lineStart:function(){J4.point=Q4},lineEnd:function(){q4&&tT(U4,X4),J4.point=bA},polygonStart:function(){q4=!0},polygonEnd:function(){q4=null},result:function(){var t=+Z4;return Z4=new Fp,t}};function Q4(t,e){J4.point=tT,U4=$4=t,X4=K4=e}function tT(t,e){$4-=t,K4-=e,Z4.add(gA($4*$4+K4*K4)),$4=t,K4=e}var eT=J4;let nT,rT,iT,aT;class oT{constructor(t){this._append=null==t?sT:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return sT;if(e!==nT){const r=10**e;nT=e,rT=function(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}return rT}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:var n,r;this._append`M${t},${e}`,this._radius===iT&&this._append===rT||(n=this._radius,r=this._,this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,iT=n,rT=this._append,aT=this._,this._=r),this._+=aT}}result(){var t=this._;return this._="",t.length?t:null}}function sT(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function lT(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),OA(t,a(o))),o.result()}return s.area=function(t){return OA(t,a(g4)),g4.result()},s.measure=function(t){return OA(t,a(eT)),eT.result()},s.bounds=function(t){return OA(t,a(M4)),M4.result()},s.centroid=function(t){return OA(t,a(V4)),V4.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,s4):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new oT(r)):new Y4(n=t),"function"!=typeof i&&o.pointRadius(i),s):n},s.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(o.pointRadius(+t),+t),s):i},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return null===n&&(o=new oT(r)),s},s.projection(e).digits(r).context(n)}function cT(r){return function(t){var e,n=new uT;for(e in r)n[e]=r[e];return n.stream=t,n}}function uT(){}function hT(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),OA(n,t.stream(M4)),e(M4.result()),null!=r&&t.clipExtent(r),t}function fT(i,a,t){return hT(i,function(t){var e=a[1][0]-a[0][0],n=a[1][1]-a[0][1],r=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),e=+a[0][0]+(e-r*(t[1][0]+t[0][0]))/2,n=+a[0][1]+(n-r*(t[1][1]+t[0][1]))/2;i.scale(150*r).translate([e,n])},t)}function dT(t,e,n){return fT(t,[[0,0],e],n)}function pT(r,i,t){return hT(r,function(t){var e=+i,n=e/(t[1][0]-t[0][0]),e=(e-n*(t[1][0]+t[0][0]))/2,t=-n*t[0][1];r.scale(150*n).translate([e,t])},t)}function gT(i,a,t){return hT(i,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),r=-n*t[0][0],e=(e-n*(t[1][1]+t[0][1]))/2;i.scale(150*n).translate([r,e])},t)}uT.prototype={constructor:uT,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var yT=16,vT=C(30*oA);function mT(t,e){return+e?(_=t,A=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:v,polygonStart:function(){r.polygonStart(),g.lineStart=m},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=_(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=_A([t,e]),e=_(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],yT,r),r.point(u,h)}function v(){g.point=t,r.lineEnd()}function m(){e(),g.point=b,g.lineEnd=x}function b(t,e){y(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=y}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,yT,r),g.lineEnd=v,v()}return g}):(n=t,cT({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,_,A;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,y,v,m,b,x,w,k,E,M=o-t,O=s-e,S=M*M+O*O;4*A<S&&f--&&(y=a+h,x=mA(y/=v=gA((p=r+c)*p+(g=i+u)*g+y*y)),m=sA(sA(y)-1)<P||sA(n-l)<P?(n+l)/2:cA(g,p),b=(x=_(m,x))[0],x=x[1],A<(E=O*(w=b-t)-M*(k=x-e))*E/S||.3<sA((M*w+O*k)/S-.5)||r*c+i*u+a*h<vT)&&(T(t,e,n,r,i,a,b,x,m,p/=v,g/=v,y,f,d),d.point(b,x),T(b,x,m,p,g,y,o,s,l,c,u,h,f,d))}}var bT=cT({point:function(t,e){this.stream.point(t*oA,e*oA)}});function xT(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,v;return e?(h=C(e),e=N(e),f=h*t,d=e*t,p=h/t,g=e/t,y=(e*r-h*n)/t,v=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+y),a*(v-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,m.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},m);function m(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function wT(t){return kT(function(){return t})()}function kT(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,y=0,v=0,m=0,b=0,x=1,w=1,k=null,E=$A,M=null,O=s4,S=.5;function _(t){return l(t[0]*oA,t[1]*oA)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*aA,t[1]*aA]}function T(){var t=xT(h,0,0,x,w,b).apply(null,e(p,g)),t=xT(h,f-t[0],d-t[1],x,w,b);return r=RA(y,v,m),s=NA(e,t),l=NA(r,s),o=mT(s,S),P()}function P(){return c=u=null,_}return _.stream=function(t){return c&&u===t?c:c=bT((n=r,cT({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(E(o(O(u=t))))));var n},_.preclip=function(t){return arguments.length?(E=t,k=void 0,P()):E},_.postclip=function(t){return arguments.length?(O=t,M=n=i=a=null,P()):O},_.clipAngle=function(t){return arguments.length?(E=+t?KA(k=t*oA):(k=null,$A),P()):k*aA},_.clipExtent=function(t){return arguments.length?(O=null==t?(M=n=i=a=null,s4):QA(M=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==M?null:[[M,n],[i,a]]},_.scale=function(t){return arguments.length?(h=+t,T()):h},_.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},_.center=function(t){return arguments.length?(p=t[0]%360*oA,g=t[1]%360*oA,T()):[p*aA,g*aA]},_.rotate=function(t){return arguments.length?(y=t[0]%360*oA,v=t[1]%360*oA,m=2<t.length?t[2]%360*oA:0,T()):[y*aA,v*aA,m*aA]},_.angle=function(t){return arguments.length?(b=t%360*oA,T()):b*aA},_.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},_.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},_.precision=function(t){return arguments.length?(o=mT(s,S=t*t),P()):gA(S)},_.fitExtent=function(t,e){return fT(_,t,e)},_.fitSize=function(t,e){return dT(_,t,e)},_.fitWidth=function(t,e){return pT(_,t,e)},_.fitHeight=function(t,e){return gT(_,t,e)},function(){return e=t.apply(this,arguments),_.invert=e.invert&&A,T()}}function ET(t){var e=0,n=L/3,r=kT(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*oA,n=t[1]*oA):[e*aA,n*aA]},t}function MT(t,e){var n,r,i,a=N(t),o=(a+N(e))/2;return sA(o)<P?(n=C(t),s.invert=function(t,e){return[t/n,mA(e*n)]},s):(i=gA(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=cA(t,sA(e))*pA(e);return e*o<0&&(n-=L*pA(t)*pA(e)),[n/o,mA((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,N(e)/n]}function l(t,e){e=gA(r-2*o*N(e))/o;return[e*N(t*=o),i-e*C(t)]}}function OT(){return ET(MT).scale(155.424).center([0,33.6442])}function ST(){return OT().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function _T(i){return function(t,e){var n=C(t),r=C(e),n=i(n*r);return n===1/0?[2,0]:[n*r*N(t),n*N(e)]}}function AT(a){return function(t,e){var n=gA(t*t+e*e),r=a(n),i=N(r),r=C(r);return[cA(t*i,n*r),mA(n&&e*i/n)]}}var TT=_T(function(t){return gA(2/(1+t))});TT.invert=AT(function(t){return 2*mA(t/2)});var PT=_T(function(t){return(t=vA(t))&&t/N(t)});function LT(t,e){return[t,fA(yA((nA+e)/2))]}function CT(r){var i,a,o,s=wT(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=L*l(),n=s((e=RA((e=s.rotate())[0]*oA,e[1]*oA,2<e.length?e[2]*oA:0),function(t){return(t=e.invert(t[0]*oA,t[1]*oA))[0]*=aA,t[1]*=aA,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===LT?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),o]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):e)()},s.clipExtent=function(t){return arguments.length?(null==t?u=i=a=o=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],o=+t[1][1]),h()):null==u?null:[[u,i],[a,o]]},h()}function NT(t){return yA((nA+t)/2)}function jT(t,e){var n=C(t),i=t===e?N(t):fA(n/C(e))/fA(NT(e)/NT(t)),a=n*dA(NT(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=pA(i)*gA(t*t+e*e),r=cA(t,sA(e))*pA(e);return e*i<0&&(r-=L*pA(t)*pA(e)),[r/i,2*lA(dA(a/n,1/i))-nA]},r):LT;function r(t,e){0<a?e<-nA+P&&(e=-nA+P):nA-P<e&&(e=nA-P);e=a/dA(NT(e),i);return[e*N(i*t),a-e*C(i*t)]}}function RT(t,e){return[t,e]}function FT(t,e){var n=C(t),r=t===e?N(t):(n-C(e))/(e-t),i=n/r+t;return sA(r)<P?RT:(a.invert=function(t,e){var e=i-e,n=cA(t,sA(e))*pA(e);return e*r<0&&(n-=L*pA(t)*pA(e)),[n/r,i-pA(r)*gA(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*N(t),i-e*C(t)]}}PT.invert=AT(function(t){return t}),LT.invert=function(t,e){return[t,2*lA(hA(e))-nA]},RT.invert=RT;var BT=1.340264,IT=-.081106,DT=893e-6,zT=.003796,GT=gA(3)/2;function WT(t,e){var e=mA(GT*N(e)),n=e*e,r=n*n*n;return[t*C(e)/(GT*(BT+3*IT*n+r*(7*DT+9*zT*n))),e*(BT+IT*n+r*(DT+zT*n))]}function HT(t,e){var n=C(e),r=C(t)*n;return[n*N(t)/r,N(e)/r]}function VT(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function YT(t,e){return[C(e)*N(t),N(e)]}function qT(t,e){var n=C(e),r=1+C(t)*n;return[n*N(t)/r,N(e)/r]}function UT(t,e){return[fA(yA((nA+e)/2)),-t]}WT.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(BT+IT*i+a*(DT+zT*i))-e)/(BT+3*IT*i+a*(7*DT+9*zT*i)))*r)*i*i,!(sA(n)<eA));++o);return[GT*t*(BT+3*IT*i+a*(7*DT+9*zT*i))/C(r),mA(N(r)/GT)]},HT.invert=AT(lA),VT.invert=function(t,e){var n=e,r=25;do{var i=n*n,a=i*i}while(n-=a=(n*(1.007226+i*(.015085+a*(.028874*i-.044475-.005916*a)))-e)/(1.007226+i*(.045255+a*(.259866*i-.311325-.005916*11*a))),sA(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},YT.invert=AT(mA),qT.invert=AT(function(t){return 2*lA(t)}),UT.invert=function(t,e){return[-e,2*lA(hA(t))-nA]};var XT=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=ST(),l=OT().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=OT().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function f(){return e=n=null,h}return h.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},h.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.translate=function(t){var e,n,r;return arguments.length?(e=s.scale(),n=+t[0],r=+t[1],i=s.translate(t).clipExtent([[n-.455*e,r-.238*e],[n+.455*e,r+.238*e]]).stream(u),a=l.translate([n-.307*e,r+.201*e]).clipExtent([[n-.425*e+P,r+.12*e+P],[n-.214*e-P,r+.234*e-P]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+P,r+.166*e+P],[n-.115*e-P,r+.234*e-P]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return fT(h,t,e)},h.fitSize=function(t,e){return dT(h,t,e)},h.fitWidth=function(t,e){return pT(h,t,e)},h.fitHeight=function(t,e){return gT(h,t,e)},h.scale(1070)},geoAlbers:ST,geoAzimuthalEqualArea:function(){return wT(TT).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:TT,geoAzimuthalEquidistant:function(){return wT(PT).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:PT,geoConicConformal:function(){return ET(jT).scale(109.5).parallels([30,30])},geoConicConformalRaw:jT,geoConicEqualArea:OT,geoConicEqualAreaRaw:MT,geoConicEquidistant:function(){return ET(FT).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:FT,geoEqualEarth:function(){return wT(WT).scale(177.158)},geoEqualEarthRaw:WT,geoEquirectangular:function(){return wT(RT).scale(152.63)},geoEquirectangularRaw:RT,geoGnomonic:function(){return wT(HT).scale(144.049).clipAngle(60)},geoGnomonicRaw:HT,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,y=1,v=cT({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),m=s4;function b(){return g=l*h,y=l*f,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*y;return d&&(e=t*r-n*i,n=n*r+t*i,t=e),[n+c,t+u]}return x.invert=function(t){var e,n=t[0]-c,t=t[1]-u;return d&&(e=t*r+n*i,n=n*r-t*i,t=e),[n/g,t/y]},x.stream=function(t){return o&&s===t?o:o=v(m(s=t))},x.postclip=function(t){return arguments.length?(m=t,p=e=n=a=null,b()):m},x.clipExtent=function(t){return arguments.length?(m=null==t?(p=e=n=a=null,s4):QA(p=+t[0][0],e=+t[0][1],n=+t[1][0],a=+t[1][1]),b()):null==p?null:[[p,e],[n,a]]},x.scale=function(t){return arguments.length?(l=+t,b()):l},x.translate=function(t){return arguments.length?(c=+t[0],u=+t[1],b()):[c,u]},x.angle=function(t){return arguments.length?(i=N(d=t%360*oA),r=C(d),b()):d*aA},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return fT(x,t,e)},x.fitSize=function(t,e){return dT(x,t,e)},x.fitWidth=function(t,e){return pT(x,t,e)},x.fitHeight=function(t,e){return gT(x,t,e)},x},geoProjection:wT,geoProjectionMutator:kT,geoMercator:function(){return CT(LT).scale(961/iA)},geoMercatorRaw:LT,geoNaturalEarth1:function(){return wT(VT).scale(175.295)},geoNaturalEarth1Raw:VT,geoOrthographic:function(){return wT(YT).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:YT,geoStereographic:function(){return wT(qT).scale(250).clipAngle(142)},geoStereographicRaw:qT,geoTransverseMercator:function(){var t=CT(UT),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:UT});function $T(t){return{type:"FeatureCollection",features:t.flatMap(t=>function(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function KT(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(JT),e.find(t=>t.sphere)?{type:"Sphere"}:$T(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=lT(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function ZT(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[n4()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function JT(t){return"geoPath"===t.type}var QT,io=()=>t=>{var{children:e,projection:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=J(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Ff(t);if(e=XT[e])return e;throw new Error("Unknown projection: "+t)}(r),p=e.map(ZT);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinates:[{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(KT(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=lT(i);const u=new Kv({domain:[t,t+n]}),h=new Kv({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}}],children:p.flatMap(t=>{return JT(t)?(e=t.style,Object.assign(Object.assign({},t),{type:"path",style:Object.assign(Object.assign({},e),{d:t=>g(t)})})):t;var e})})]},nc=(io.props={},()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o}=t,t=J(t,["type","data","scale","encode","style","animate","key"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a}]})]});nc.props={};const t6={"composition.geoView":io,"composition.geoPath":nc};function e6(){return Object.assign({"data.fetch":Fy,"data.inline":Hy,"data.sortBy":Wy,"data.sort":Dy,"data.filter":Iy,"data.pick":zy,"data.rename":Gy,"data.fold":By,"data.slice":m1,"data.custom":Vy,"data.map":Yy,"data.cluster":wy,"data.tree":ky,"data.sankey":ag,"data.arc":$y,"data.wordCloud":g1,"data.join":v1,"transform.maybeZeroY1":ES,"transform.maybeZeroX":BS,"transform.maybeStackY":RS,"transform.maybeTitle":FS,"transform.maybeSeries":GS,"transform.maybeZeroPadding":US,"transform.stackY":NS,"transform.binX":D_,"transform.bin":I_,"transform.dodgeX":JS,"transform.jitter":r_,"transform.jitterX":i_,"transform.symmetryY":a_,"transform.diffY":o_,"transform.stackEnter":QS,"transform.normalizeY":t_,"transform.select":h_,"transform.selectX":f_,"transform.selectY":d_,"transform.groupX":O_,"transform.groupY":S_,"transform.groupColor":__,"transform.group":M_,"transform.maybeSize":DS,"transform.maybeZeroY":IS,"transform.maybeKey":zS,"transform.sortX":P_,"transform.sortY":C_,"transform.sortColor":L_,"transform.flexX":N_,"transform.maybeTupleY":WS,"transform.maybeTupleX":HS,"transform.maybeIdentityY":VS,"transform.maybeIdentityX":YS,"transform.maybeTuple":KS,"transform.maybeVisualPosition":XS,"transform.maybeFunctionAttribute":$S,"transform.maybeGradient":ZS,"transform.maybeTooltip":qS,"transform.pack":R_,"transform.sample":W_,"transform.filter":H_,"coordinate.cartesian":qf,"coordinate.polar":Xf,"coordinate.helix":$f,"coordinate.transpose":Kf,"coordinate.theta":td,"coordinate.reflect":Zf,"coordinate.reflectX":Jf,"coordinate.reflectY":Qf,"coordinate.parallel":rd,"coordinate.fisheye":id,"coordinate.fisheyeX":ad,"coordinate.fisheyeY":od,"coordinate.radial":nd,"encode.constant":sd,"encode.field":cd,"encode.transform":ld,"encode.column":ud,"mark.interval":Mp,"mark.rect":Op,"mark.line":S0,"mark.point":_0,"mark.text":A0,"mark.cell":T0,"mark.area":P0,"mark.link":L0,"mark.image":C0,"mark.polygon":N0,"mark.box":j0,"mark.vector":R0,"mark.lineX":B0,"mark.lineY":F0,"mark.connector":I0,"mark.range":G0,"mark.rangeX":W0,"mark.rangeY":H0,"mark.sankey":pg,"mark.path":gg,"mark.treemap":xg,"mark.pack":wg,"mark.boxplot":Pg,"mark.shape":Lg,"mark.forceGraph":by,"mark.tree":Ey,"mark.wordCloud":b1,"palette.category10":x1,"palette.category20":w1,"palette.sequentialBlue":k1,"palette.sequentialDarkBlue":E1,"palette.sequentialGreen":M1,"palette.sequentialDarkGreen":O1,"palette.sequentialGrey":S1,"palette.sequentialOrange":_1,"palette.sequentialPink":A1,"palette.sequentialRed":T1,"palette.sequentialYellow":P1,"palette.sequentialPurple":L1,"palette.sequentialYellowOrange":C1,"palette.sequentialYellowGreen":N1,"palette.sequentialPinkPurple":j1,"palette.sequentialGreenBlue":R1,"palette.divergingGreenYellow":F1,"palette.divergingRedBlue":B1,"palette.divergingGreenRed":I1,"palette.divergingRedPurple":D1,"scale.linear":Em,"scale.ordinal":Mm,"scale.band":km,"scale.identity":Om,"scale.point":Sm,"scale.time":_m,"scale.log":Am,"scale.pow":Tm,"scale.sqrt":Nm,"scale.threshold":Pm,"scale.quantile":Lm,"scale.quantize":Cm,"scale.sequential":jm,"shape.interval.rect":i2,"shape.interval.hollow":a2,"shape.interval.funnel":o2,"shape.interval.pyramid":l2,"shape.rect.rect":i2,"shape.rect.hollow":a2,"shape.cell.cell":i2,"shape.cell.hollow":a2,"shape.line.line":f2,"shape.line.hv":p2,"shape.line.vh":g2,"shape.line.hvh":y2,"shape.line.smooth":d2,"shape.point.bowtie":x2,"shape.point.cross":w2,"shape.point.diamond":k2,"shape.point.hexagon":E2,"shape.point.hollowBowtie":M2,"shape.point.hollowDiamond":O2,"shape.point.hollowHexagon":S2,"shape.point.hollow":_2,"shape.point.hollowSquare":A2,"shape.point.hollowTriangle":T2,"shape.point.hollowTriangleDown":P2,"shape.point.hyphen":L2,"shape.point.line":C2,"shape.point.plus":N2,"shape.point.point":j2,"shape.point.square":R2,"shape.point.tick":F2,"shape.point.triangle":B2,"shape.point.triangleDown":I2,"shape.text.text":pE,"shape.area.area":bE,"shape.area.smooth":xE,"shape.area.hvh":wE,"shape.area.vh":kE,"shape.area.hv":EE,"shape.link.smooth":OE,"shape.link.vhv":SE,"shape.link.arc":_E,"shape.link.link":ME,"shape.image.image":AE,"shape.polygon.polygon":TE,"shape.polygon.ribbon":PE,"shape.box.box":LE,"shape.vector.vector":D2,"shape.label.label":XE,"shape.text.badge":yE,"shape.lineX.line":CE,"shape.lineY.line":CE,"shape.shape.shape":JE,"shape.connector.connector":RE,"shape.range.range":i2,"shape.rangeX.range":i2,"shape.rangeY.range":i2,"shape.path.path":KE,"shape.path.hollow":ZE,"theme.light":tM,"theme.dark":nM,"theme.academy":iM,"component.axisX":TM,"component.axisY":PM,"component.axisRadar":LM,"component.axisLinear":_M,"component.axisArc":AM,"component.legendCategory":RM,"component.legendContinuous":FM,"component.legendContinuousBlock":BM,"component.legendContinuousBlockSize":IM,"component.legendContinuousSize":DM,"component.title":WM,"component.sliderX":UM,"component.sliderY":XM,"component.scrollbarX":KM,"component.scrollbarY":ZM,"animation.scaleInX":rO,"animation.scaleOutX":iO,"animation.scaleInY":aO,"animation.scaleOutY":oO,"animation.waveIn":yO,"animation.fadeIn":sO,"animation.fadeOut":lO,"animation.zoomIn":vO,"animation.zoomOut":mO,"animation.pathIn":bO,"animation.morphing":gO,"animation.growInX":xO,"animation.growInY":wO,"interaction.elementHighlight":IO,"interaction.elementHighlightByX":DO,"interaction.elementHighlightByColor":zO,"interaction.elementSelect":WO,"interaction.elementSelectByX":HO,"interaction.elementSelectByColor":VO,"interaction.fisheye":qO,"interaction.chartIndex":YO,"interaction.tooltip":a3,"interaction.legendFilter":y3,"interaction.legendHighlight":v3,"interaction.brushHighlight":x3,"interaction.brushXHighlight":k3,"interaction.brushYHighlight":M3,"interaction.brushAxisHighlight":N3,"interaction.brushFilter":R3,"interaction.brushXFilter":F3,"interaction.brushYFilter":B3,"interaction.sliderFilter":D3,"interaction.poptip":W3,"composition.spaceLayer":q3,"composition.spaceFlex":U3,"composition.mark":$3,"composition.view":X3,"composition.facetRect":aS,"composition.repeatMatrix":cS,"composition.facetCircle":gS,"composition.timingKeyframe":yS,"labelTransform.overlapHide":q_,"labelTransform.overlapDodgeY":X_,"labelTransform.overflowHide":tA,"labelTransform.contrastReverse":Q_},t6)}function n6(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}(c=QT=QT||{}).BEFORE_RENDER="beforerender",c.AFTER_RENDER="afterrender",c.BEFORE_PAINT="beforepaint",c.AFTER_PAINT="afterpaint",c.BEFORE_CHANGE_DATA="beforechangedata",c.AFTER_CHANGE_DATA="afterchangedata",c.BEFORE_CLEAR="beforeclear",c.AFTER_CLEAR="afterclear",c.BEFORE_DESTROY="beforedestroy",c.AFTER_DESTROY="afterdestroy",c.BEFORE_CHANGE_SIZE="beforechangesize",c.AFTER_CHANGE_SIZE="afterchangesize";function r6(t,e,n,r,i){var a=t[0],t=t[1],o=ct();return a=[a,t],(t=o)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}function i6(t,e,n,r,i){var a=new Kv({range:[e,e+r]}),o=new Kv({range:[n,n+i]});return{transform:function(t){var e=t[0],t=t[1];return[a.map(e),o.map(t)]},untransform:function(t){var e=t[0],t=t[1];return[a.invert(e),o.invert(t)]}}}function a6(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function o6(t,e,n,r,i){return t[0]}function s6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new Kv({range:[s,t]}),c=new Kv({range:[a,o]}),u=1<(s=i/r)?1:s,h=1<s?1/s:1;return{transform:function(t){var e=t[0],t=t[1],e=c.map(e),t=l.map(t);return[.5*(t*Math.cos(e)*u)+.5,.5*(t*Math.sin(e)*h)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=n6(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function l6(t,e,n,r,i){return{transform:function(t){var e=t[0];return[t[1],e]},untransform:function(t){var e=t[0];return[t[1],e]}}}function c6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return g6.apply(void 0,y6([[-1,-1]],e,!1))}function u6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return g6.apply(void 0,y6([[-1,1]],e,!1))}function h6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return g6.apply(void 0,y6([[1,-1]],e,!1))}function f6(t,e,n,r,i){var a,t=t[0],o=ct();return o=o,t=t,a=Math.sin(t),t=Math.cos(t),o[0]=t,o[1]=a,o[2]=0,o[3]=-a,o[4]=t,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o}function d6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=(t[3]-s)/(+o/(2*Math.PI)+1),c=l/(2*Math.PI),u=new Kv({range:[s,s+.99*l]}),h=new Kv({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=n6(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function p6(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new Kv({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new Zv({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[s,l]}),i=0;i<n;i++){var a=t[i],o=r.map(i),a=c.map(a);e.push(o,a)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(c.invert(r))}return e}}}var g6=function(t,e,n,r,i){var a=t[0],t=t[1],o=ct();return a=[a,t],(t=o)[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},y6=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function v6(t){return 1/Math.tan(t)}function m6(t,e,n,r,i){var a=v6(t[0]);return{transform:function(t){var e=t[0],t=t[1];return[e+t*a,t]},untransform:function(t){var e=t[0],t=t[1];return[e-t*a,t]}}}function b6(t,e,n,r,i){var a=v6(t[0]);return{transform:function(t){var e=t[0];return[e,t[1]+e*a]},untransform:function(t){var e=t[0];return[e,t[1]-e*a]}}}function x6(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r,r=a?-1:1;return r*i*(n+1)/(n+i/((t-e)*r))+e}function w6(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r;return i/(i*(n+1)/(t-e)-n*(a?-1:1))+e}function k6(t,e,n){return n?new Kv({range:[0,1],domain:[0,e]}).map(t):t}function E6(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=k6(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[x6(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[w6(e,s,o,0,1),t]}}}function M6(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=k6(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],x6(t[1],s,o,0,1)]},untransform:function(t){return[t[0],w6(t[1],s,o,0,1)]}}}function O6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=k6(a,r,t=void 0!==t&&t),u=k6(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[x6(e,c,s,0,1),x6(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[w6(e,c,s,0,1),w6(t,u,l,0,1)]}}}function S6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=void 0!==(t=t[4])&&t,c=new Kv({range:[0,r]}),u=new Kv({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=x6(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=w6(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var _6=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},A6=(T6.prototype.update=function(t){this.options=R({},this.options,t),this.recoordinate()},T6.prototype.clone=function(){return new T6(this.options)},T6.prototype.getOptions=function(){return this.options},T6.prototype.clear=function(){this.update({transformations:[]})},T6.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},T6.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},T6.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:_6(_6([],n,!0),[_6([],t,!0)],!1)}),this},T6.prototype.map=function(t){return this.output(t)},T6.prototype.invert=function(t){return this.input(t)},T6.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},T6.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?_6([],this.options.transformations,!0).reverse():this.options.transformations,n=t?function(t){return t.untransform}:function(t){return t.transform},r=[],a=[],i=function(t,e){return a.push((e=void 0===e?!0:e)?(i=t,function(t){for(var e=[],n=0;n<t.length-1;n+=2){var r=[t[n],t[n+1]],r=i(r);e.push.apply(e,r)}return e}):t);var i},o=0,s=e;o<s.length;o++){var l,c,u,h,f=s[o],d=f[0],f=f.slice(1),p=this.transformers[d];p&&(l=(h=this.options).x,c=h.y,u=h.width,h=h.height,p=p(_6([],f,!0),l,c,u,h),(f=p)instanceof Float32Array||f instanceof Array?r.push(p):(r.length&&(i(this.createMatrixTransform(r,t)),r.splice(0,r.length)),i(n(p)||If,"parallel"!==d)))}return r.length&&i(this.createMatrixTransform(r,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(e,n){return function(t){return n(e(t))}},t):If}.apply(void 0,a)},T6.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=ct();return e&&t.reverse(),t.forEach(function(t){return ut(p,p,t)}),e&&(e=t=p,(d=new lt(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=(e=e[8])*a-o*l,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Kt(t,t,p),[t[0],t[1]]}},T6);function T6(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:i6,translate:r6,custom:a6,matrix:o6,polar:s6,transpose:l6,scale:g6,"shear.x":m6,"shear.y":b6,reflect:c6,"reflect.x":u6,"reflect.y":h6,rotate:f6,helix:d6,parallel:p6,fisheye:O6,"fisheye.x":E6,"fisheye.y":M6,"fisheye.circular":S6},this.update(t)}function P6(t,e){return t.filter(t=>t.type===e)}function L6(t){return 0<P6(t,"polar").length}function C6(t){return P6(t,"transpose").length%2==1}function N6(t){return 0<P6(t,"parallel").length}function j6(t){return 0<P6(t,"theta").length}function R6(t){return 0<P6(t,"radial").length}function f(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}l=f("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),lc=f("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),ac=f("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),dc=f("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),tc=f("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),pl=f("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Fw=f("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),bo=f("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),r=f("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),gl=f("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function F6(t,e,n){(t.prototype=e.prototype=n).constructor=t}function B6(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function I6(){}var D6=1/.7,vo="\\s*([+-]?\\d+)\\s*",Ql="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",z6=/^#([0-9a-f]{3,8})$/,G6=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),W6=new RegExp(`^rgb\\(${Kl},${Kl},${Kl}\\)$`),H6=new RegExp(`^rgba\\(${vo},${vo},${vo},${Ql}\\)$`),V6=new RegExp(`^rgba\\(${Kl},${Kl},${Kl},${Ql}\\)$`),Y6=new RegExp(`^hsl\\(${Ql},${Kl},${Kl}\\)$`),q6=new RegExp(`^hsla\\(${Ql},${Kl},${Kl},${Ql}\\)$`),U6={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function X6(){return this.rgb().formatHex()}function $6(){return this.rgb().formatRgb()}function K6(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=z6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Z6(e):3===n?new eP(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?J6(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?J6(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=G6.exec(t))?new eP(e[1],e[2],e[3],1):(e=W6.exec(t))?new eP(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=H6.exec(t))?J6(e[1],e[2],e[3],e[4]):(e=V6.exec(t))?J6(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Y6.exec(t))?sP(e[1],e[2]/100,e[3]/100,1):(e=q6.exec(t))?sP(e[1],e[2]/100,e[3]/100,e[4]):U6.hasOwnProperty(t)?Z6(U6[t]):"transparent"===t?new eP(NaN,NaN,NaN,0):null}function Z6(t){return new eP(t>>16&255,t>>8&255,255&t,1)}function J6(t,e,n,r){return new eP(t=r<=0?e=n=NaN:t,e,n,r)}function Q6(t){return(t=t instanceof I6?t:K6(t))?new eP((t=t.rgb()).r,t.g,t.b,t.opacity):new eP}function tP(t,e,n,r){return 1===arguments.length?Q6(t):new eP(t,e,n,null==r?1:r)}function eP(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function nP(){return"#"+oP(this.r)+oP(this.g)+oP(this.b)}function rP(){var t=iP(this.opacity);return(1===t?"rgb(":"rgba(")+aP(this.r)+`, ${aP(this.g)}, `+aP(this.b)+(1===t?")":`, ${t})`)}function iP(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function aP(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function oP(t){return((t=aP(t))<16?"0":"")+t.toString(16)}function sP(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new cP(t,e,n,r)}function lP(t){var e,n,r,i,a,o,s,l;return t instanceof cP?new cP(t.h,t.s,t.l,t.opacity):(t=t instanceof I6?t:K6(t))?t instanceof cP?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new cP(o,s,l,t.opacity)):new cP}function cP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function uP(t){return(t=(t||0)%360)<0?t+360:t}function hP(t){return Math.max(0,Math.min(1,t||0))}function fP(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}F6(I6,K6,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:X6,formatHex:X6,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return lP(this).formatHsl()},formatRgb:$6,toString:$6}),F6(eP,tP,B6(I6,{brighter(t){return t=null==t?D6:Math.pow(D6,t),new eP(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new eP(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new eP(aP(this.r),aP(this.g),aP(this.b),iP(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:nP,formatHex:nP,formatHex8:function(){return"#"+oP(this.r)+oP(this.g)+oP(this.b)+oP(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:rP,toString:rP})),F6(cP,function(t,e,n,r){return 1===arguments.length?lP(t):new cP(t,e,n,null==r?1:r)},B6(I6,{brighter(t){return t=null==t?D6:Math.pow(D6,t),new cP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new cP(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new eP(fP(240<=t?t-240:120+t,n,e),fP(t,n,e),fP(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new cP(uP(this.h),hP(this.s),hP(this.l),iP(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){var t=iP(this.opacity);return(1===t?"hsl(":"hsla(")+uP(this.h)+`, ${100*hP(this.s)}%, ${100*hP(this.l)}%`+(1===t?")":`, ${t})`)}}));const dP=Math.PI/180,pP=180/Math.PI;var gP=1.78277,yP=-.29227,vP=-.90649,mP=1.97294,bP=mP*vP,xP=mP*gP,wP=gP*yP- -.14861*vP;function kP(t,e,n,r){return 1===arguments.length?(i=t)instanceof EP?new EP(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof eP?i:Q6(i)).r/255,o=i.g/255,l=i.b/255,l=(mP*(o-(a=(wP*l+bP*a-xP*o)/(wP+bP-xP)))-yP*(o=l-a))/vP,new EP((l=(s=Math.sqrt(l*l+o*o)/(mP*a*(1-a)))?Math.atan2(l,o)*pP-120:NaN)<0?l+360:l,s,a,i.opacity)):new EP(t,e,n,null==r?1:r);var i,a,o,s,l}function EP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}F6(EP,kP,B6(I6,{brighter(t){return t=null==t?D6:Math.pow(D6,t),new EP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new EP(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*dP,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new eP(255*(e+n*(-.14861*r+gP*t)),255*(e+n*(yP*r+vP*t)),255*(e+mP*r*n),this.opacity)}}));var MP=t=>()=>t;function OP(e,n){return function(t){return e+t*n}}function SP(a){return 1==(a=+a)?_P:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):MP(isNaN(t)?e:t);var n,r,i}}function _P(t,e){var n=e-t;return n?OP(t,n):MP(isNaN(t)?e:t)}!function t(e){var o=SP(e);function n(e,t){var n=o((e=tP(e)).r,(t=tP(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=_P(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);AP=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0<n?s[n-1]:2*r-i,o=n<l-1?s[n+2]:2*i-r;return((1-3*(t=(t-n/l)*l)+3*(n=t*t)-(e=n*t))*a+(4-6*n+3*e)*r+(1+3*t+3*n-3*e)*i+e*o)/6}};var AP,TP=function(t){for(var e,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o=0;o<n;++o)e=tP(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=AP(r),i=AP(i),a=AP(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function PP(s){return function t(o){function e(e,t){var n=s((e=kP(e)).h,(t=kP(t)).h),r=_P(e.s,t.s),i=_P(e.l,t.l),a=_P(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=r(t),e.l=i(Math.pow(t,o)),e.opacity=a(t),e+""}}return o=+o,e.gamma=t,e}(1)}PP(function(t,e){var n=e-t;return n?OP(t,180<n||n<-180?n-360*Math.round(n/360):n):MP(isNaN(t)?e:t)});var Ja=PP(_P),a=t=>TP(t[t.length-1]),eo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(f),ao=a(eo),n=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(f),Zl=a(n),Jl=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(f),e=a(Jl),no=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(f),ro=a(no),oo=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(f),so=a(oo),co=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(f),lo=a(co),uo=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(f),o=a(uo),$l=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(f),fo=a($l),ho=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(f),po=a(ho),io=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(f),nc=a(io),c=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(f),vo=a(c),Kl=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(f),Ql=a(Kl),LP=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(f),CP=a(LP),NP=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(f),jP=a(NP),RP=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(f),FP=a(RP),BP=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(f),IP=a(BP),DP=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(f),zP=a(DP),GP=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(f),WP=a(GP),HP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(f),VP=a(HP),YP=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(f),qP=a(YP),UP=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(f),XP=a(UP),$P=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(f),KP=a($P),ZP=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(f),JP=a(ZP),QP=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(f),t8=a(QP),e8=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(f),n8=a(e8),r8=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(f),i8=a(r8),a8=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(f),a=a(a8);var o8=Ja(kP(300,.5,0),kP(-240,.5,1)),s8=Ja(kP(-100,.75,.35),kP(80,1.5,.8)),Ja=Ja(kP(260,.75,.35),kP(80,1.5,.8)),l8=kP();var c8=tP(),u8=Math.PI/3,h8=2*Math.PI/3;function f8(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var d8=f8(f("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),p8=f8(f("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),g8=f8(f("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),y8=f8(f("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),v8=Object.freeze({__proto__:null,schemeCategory10:l,schemeAccent:lc,schemeDark2:ac,schemePaired:dc,schemePastel1:tc,schemePastel2:pl,schemeSet1:Fw,schemeSet2:bo,schemeSet3:r,schemeTableau10:gl,interpolateBrBG:ao,schemeBrBG:eo,interpolatePRGn:Zl,schemePRGn:n,interpolatePiYG:e,schemePiYG:Jl,interpolatePuOr:ro,schemePuOr:no,interpolateRdBu:so,schemeRdBu:oo,interpolateRdGy:lo,schemeRdGy:co,interpolateRdYlBu:o,schemeRdYlBu:uo,interpolateRdYlGn:fo,schemeRdYlGn:$l,interpolateSpectral:po,schemeSpectral:ho,interpolateBuGn:nc,schemeBuGn:io,interpolateBuPu:vo,schemeBuPu:c,interpolateGnBu:Ql,schemeGnBu:Kl,interpolateOrRd:CP,schemeOrRd:LP,interpolatePuBuGn:jP,schemePuBuGn:NP,interpolatePuBu:FP,schemePuBu:RP,interpolatePuRd:IP,schemePuRd:BP,interpolateRdPu:zP,schemeRdPu:DP,interpolateYlGnBu:WP,schemeYlGnBu:GP,interpolateYlGn:VP,schemeYlGn:HP,interpolateYlOrBr:qP,schemeYlOrBr:YP,interpolateYlOrRd:XP,schemeYlOrRd:UP,interpolateBlues:KP,schemeBlues:$P,interpolateGreens:JP,schemeGreens:ZP,interpolateGreys:t8,schemeGreys:QP,interpolatePurples:n8,schemePurples:e8,interpolateReds:i8,schemeReds:r8,interpolateOranges:a,schemeOranges:a8,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:o8,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return l8.h=360*t-100,l8.s=1.5-1.5*e,l8.l=.8-.9*e,l8+""},interpolateWarm:s8,interpolateCool:Ja,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,c8.r=255*(e=Math.sin(t))*e,c8.g=255*(e=Math.sin(t+u8))*e,c8.b=255*(e=Math.sin(t+h8))*e,c8+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:d8,interpolateMagma:p8,interpolateInferno:g8,interpolatePlasma:y8});function m8(t,e,n,r,i,a){var o,{guide:s={}}=n,l=function(t,e,n){var{type:n,domain:r,range:i}=n;return void 0!==n?n:function(t){return T8(t,dg)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?M8(t):void 0===r?_8(e)?M8(t):A8(e)?"time":O8(t,i):_8([r])?M8(t):A8(e)?"time":O8(t,i)}(t,e,n);return"string"!=typeof l?n:(o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;var{domainMax:i,domainMin:a}=n;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":var[o,s]=function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)ug(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n);return[a||o,i||s];case"band":case"ordinal":case"point":return S8(e);case"quantile":return function(t){return S8(t).sort()}(e);case"sequential":var[o,s]=function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)ug(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e);return[a||o,i||s];default:return[]}}(l,e,n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=_v,nice:n=!1,tickCount:r=10}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e?0:"band"!==t?"point"===t?.5:0:j6(n)?0:.1}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Ff(e),i=v8["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(l,t,n,r)),{domain:o,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":var u=E8(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],function(t){return t[t.length-1]}(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||0,c||1];case"ordinal":return E8(n,r,i,a,o);case"sequential":return;default:return[]}}(l,t,e,n,o,i,a),guide:s,name:t,type:l}))}function b8(t,e){var[e]=CM("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[og,og];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function x8(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(w8)?Rp(e):t.every(k8)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function w8(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function k8(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function E8(t,e,n,r,i){var[i]=CM("palette",i),{defaultCategory10:r,defaultCategory20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Ff(t),i=v8["scheme"+e],a=v8["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function M8(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function O8(t,e){return"color"!==t||e?"linear":"sequential"}function S8(t){return Array.from(new Set(t.flat()))}function _8(t){return T8(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function A8(t){return T8(t,t=>t instanceof Date)}function T8(t,e){for(const n of t)if(n.some(e))return!0;return!1}const P8={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},L8={threshold:"threshold",quantize:"quantize",quantile:"quantile"},C8={ordinal:"ordinal",band:"band",point:"point"};function N8(t,e,n){const{component:r=[],coordinates:d=[],title:i}=e,[,p]=CM("component",n),g=t.filter(({guide:t})=>null!==t);var a,e=function(t,e,n){const[,o]=CM("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?C6(i)?t+"Y":t+"X":"y"===e?C6(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,size:i,order:a,type:e},r),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);const y=[...r,...e];return i&&(t=p("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:a}=t,y.push(Object.assign({type:"title",position:n,orientation:e,order:t,size:a},"string"==typeof i?{title:i}:i))),function(t,e){t=t.filter(t=>{return!!((t=t)&&t.type&&("function"==typeof t.type||({type:t,domain:n,range:r,interpolator:e}=t,n=n&&0<n.length,r=r&&0<r.length,["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(t)&&n&&r)||["sequential"].includes(t)&&n&&(r||e)||["constant","identity"].includes(t)&&r));var e,n,r});return[...function(t){const e=zp(t,t=>t.field||t.name),n=(t,e)=>{t=Ub(t);return t.forEach(t=>t.unshift(e)),t.push([e]),t.sort((t,e)=>e.length-t.length)},s=[["legendCategory",n([["shape","discrete"],["size","discrete"],["opacity","discrete"]],["color","discrete"])],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",n([["opacity","continuous"]],["color","distribution"])],["legendContinuous",n([["opacity","continuous"]],["color","continuous"])]];t=Array.from(e).map(([,t])=>{var e,n,r=Ub(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>{return[t.name,"string"!=typeof(t=(t=t).type)?null:t in P8?"continuous":t in C8?"discrete":t in L8?"distribution":null]})}));const i=t=>t.sort((t,e)=>t[0].localeCompare(e[0]));for([e,n]of s)for(const{option:a,combination:o}of r)if(n.some(t=>Gf(i(t),i(a))))return[e,o];return null}).filter(ug);return t}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<P6(n,"helix").length||j6(n))&&(!C6(n)||!L6(n)&&!R6(n))){if(e.startsWith("x"))return L6(n)?["axisArc",[t]]:R6(n)?["axisLinear",[t]]:[C6(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return L6(n)?["axisLinear",[t]]:R6(n)?["axisArc",[t]]:[C6(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(N6(e=n)&&L6(e))return["axisRadar",[t]];if(!L6(n))return["axisY",[t]]}}return null}).filter(ug)}(t,e)]}(g,d).forEach(([t,e])=>{var n=p(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o}=n,{guide:n,field:s}=Object.assign({},...e);for(const f of Array.isArray(n)?n:[n]){var l,c,[u,h]=function(t,e,n,r,i,a,o){var[s]=R8(o),e=[r.position||e,null!=s?s:n];if("string"==typeof t&&t.startsWith("axis"))return function(t,e,n,r,i){n=n[0].name;{var a,o;if("axisRadar"===t)return r=r.filter(t=>t.name.startsWith("position")),a=F8(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=R8(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&N6(i))return null===(s=F8(n))?e:C6(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=R8(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(L6(i))return["center",null];if(R6(i))return["center",null];if("axisX"===t&&function(t){return 0<P6(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<P6(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&L6(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,f,e,g,d);(u||h)&&({size:l=a,order:c=o}=f,y.push(Object.assign(Object.assign({title:s},f),{position:u,orientation:h,order:c,size:l,type:t,scales:e})))}}),y}function j8(t,e,n,r){var[i]=CM("component",r),{scales:a=[],bbox:o}=t,t=J(t,["scales","bbox"]),s=a.map(t=>b8(t,r)),o={bbox:o,scales:a,library:r};return i(t)(s,o,e,n)}function R8(t){var e,n=P6(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=Uf(n),[n,e]):(n=P6(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=ed(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function F8(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function B8(t,e){var t=function(t,e){var n=zp(t,t=>t.position),{padding:t,paddingLeft:e=t,paddingRight:r=t,paddingBottom:i=t,paddingTop:t=t}=e,a={paddingBottom:i,paddingLeft:e,paddingTop:t,paddingRight:r};for(const l of["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]){var o="padding"+sg(l);if(void 0===a[o])if(n.has(l)){const t=n.get(l);var s=t.reduce((t,{size:e})=>t+e,0);a[o]=s}else a[o]=30}return a}(t,e),{paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:a}=t,{width:e,height:o,x:s=0,y:l=0,inset:c=0,insetLeft:u=c,insetTop:h=c,insetBottom:f=c,insetRight:c=c,margin:d=0,marginLeft:p=d,marginBottom:g=d,marginTop:y=d,marginRight:d=d}=e;return Object.assign(Object.assign({},t),{width:e,height:o,insetLeft:u,insetTop:h,insetBottom:f,insetRight:c,innerWidth:e-n-r-p-d,innerHeight:o-i-a-y-g,marginLeft:p,marginBottom:g,marginTop:y,marginRight:d,x:s,y:l})}function I8(t,F,e){var B=zp(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:I,marginLeft:r,marginTop:i,marginBottom:D,marginRight:z,innerHeight:a,innerWidth:o,height:s,width:G}=e,t=t+r,r=n+i,n=e+z,i=I+D,W={top:[t,0,o,r,"vertical",!0,Sp],right:[G-n,r,n,a,"horizontal",!1,Sp],bottom:[t,s-i,o,i,"vertical",!1,Sp],left:[0,r,t,a,"horizontal",!0,Sp],"top-left":[t,0,o,r,"vertical",!0,Sp],"top-right":[t,0,o,r,"vertical",!0,Sp],"bottom-left":[t,s-i,o,i,"vertical",!1,Sp],"bottom-right":[t,s-i,o,i,"vertical",!1,Sp],center:[t,r,o,a,"center",null,null],inner:[t,r,o,a,"center",null,null],outer:[t,r,o,a,"center",null,null]};for(const[j,t]of B.entries()){var l=W[j],[c,H]=Yb(t,t=>"string"==typeof t.type&&("center"===j||!(!t.type.startsWith("axis")||!["inner","outer"].includes(j))));if(c.length){p=d=f=h=u=void 0;var u=c,h=F,f=l,d=j,[u,p]=Yb(u,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),c=(v=y=g=c=void 0,u),g=h,y=f,v=d;if("center"===v)if(!function(t){return b0(t)&&y0(t)}(g)){if(y0(g)){u=void 0;d=void 0;m=void 0;b=void 0;x=void 0;w=void 0;u=c;d=y;var[m,b,x,w]=d;for(const tt of u)tt.bbox={x:m,y:b,width:x,height:w}}else if(b0(g)){d=void 0;u=void 0;k=void 0;E=void 0;d=c;u=g;var k=y;var E=c[0].orientation;"horizontal"===E?function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;t<e.length;t++){var c=e[t];const i=l[t];var u=l[t+1]-i;c.bbox={x:r,y:i,width:a,height:u}}}(d,u,k):"vertical"===E&&function(e,t,n){const[r,i,,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let t=0;t<e.length;t++){var c=e[t];const r=l[t];var u=l[t+1]-r;c.bbox={x:r,y:i,width:u,height:a}}}(d,u,k)}}else{M=void 0;E=void 0;O=void 0;S=void 0;_=void 0;A=void 0;var M=c;E=y;var[O,S,_,A]=E;for(const R of M)R.bbox={x:O,y:S,width:_,height:A},R.radar={index:M.indexOf(R),count:M.length}}else if("inner"===v){T=void 0;d=void 0;u=void 0;V=void 0;Y=void 0;k=void 0;P=void 0;L=void 0;q=void 0;U=void 0;var T=c;d=g;u=y;var[V,Y,,u]=u,[k,P]=d.getCenter(),[d]=k0(d),u=u/2,L=d*u,q=k-L,U=P-L;for(let t=0;t<T.length;t++)T[t].bbox={x:V+q,y:Y+U,width:2*L,height:2*L}}else if("outer"===v){g=void 0;d=void 0;X=void 0;$=void 0;K=void 0;Z=void 0;g=c;d=y;var[X,$,K,Z]=d;for(const et of g)et.bbox={x:X,y:$,width:K,height:Z}}Q=J=N=y=c=v=P=u=C=void 0;var C=p,u=h,P=f;if(0!==C.length){var[P,v,c,y]=P,[u]=k0(u),N=y/2*u/Math.sqrt(2),J=P+c/2,Q=v+y/2;for(let t=0;t<C.length;t++)C[t].bbox={x:J-N,y:Q-N,width:2*N,height:2*N}}}H.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,y]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],v=(n.sort((t,e)=>null===l||void 0===l?void 0:l(t.order,e.order)),s?u+p:u);for(let t=0,e=v;t<n.length;t++){var m=n[t],b=m["size"];m.bbox={[c]:s?e-b:e,[h]:f,[d]:b,[g]:y},e+=b*(s?-1:1)}}(t,l)}}function D8(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=J(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function z8(t,i,a){return Oe(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=CM("data",t),n=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};var{type:e="inline"}=t,t=J(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>Oe(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),og)}([J(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?Vb(n):[],Object.assign(Object.assign({},i),{data:n})]})}function G8(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t<a.length;t++)o[""+i+(0===t?"":t)]=a[t];else o[i]=a;return[t,Object.assign(Object.assign({},e),{encode:o})]}function W8(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=Hb(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return ug(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function H8(t,e,n){var r=e["encode"];return r?(r=Hb(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{visual:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function V8(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=CM("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=Hb(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function Y8(l,t,e){var n,r=t["encode"],i=J(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=J(t,["value"]);for(let e=0;e<i.length;e++){var o=i[e];if(Array.isArray(o))for(let t=0;t<o.length;t++){var s=r[t]||[""+n+t,new Array(l).fill(void 0)];s[1][e]=o[t],r[t]=s}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function q8(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return R(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>[t,{guide:s(r,t),slider:s(a,t),scrollbar:s(o,t)}]))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")}})}),[t,e]}function U8(t,e,n){var r=e["animate"];return r||void 0===r||R(e,{animate:{enterType:null,exitType:null,updateType:null}}),[t,e]}function X8(s,l,c){return Oe(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return Oe(this,void 0,void 0,function*(){var t=c["library"],[t]=CM("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[D8,z8,G8,W8,H8,V8,Y8,U8,q8,...e.map(t),...r.map(t),...n.map(t)];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(s,l,{library:c});const{encode:n,scale:u,data:r}=e;if(!1===Array.isArray(r))return null;const i=l["channels"],a=Wp(Object.entries(n).filter(([,t])=>ug(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=i.find(t=>t.name===e);return null!=n&&n.independent?t:e});var o=i.filter(t=>{const{name:e,required:n}=t;if(a.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:s,scaleKey:l,range:c}=t;return a.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=u[t]||{},{independent:a=!1,key:o=l||t,type:r=r?"identity":s}=i,i=J(i,["independent","key","type"]);return{name:t,values:e,scaleKey:a?Symbol("independent"):o,scale:Object.assign({type:r,range:c},i)}})});return[e,Object.assign(Object.assign({},l),{index:t,channels:o})]})}function $8(I,D,z,G){return Oe(this,void 0,void 0,function*(){const[n]=CM("composition",z);var[t]=CM("interaction",z);const e=new Set(Object.keys(z).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(ug)),r=t=>{t=t.type;return"string"==typeof t&&e.has(t)?"mark":t};const i=t=>"standardView"===r(t);var a=t=>{var e;return i(t)?[t]:(e=r(t),n({type:e})(t))},o=[];const s=new Map;for(var l=new Map,c=[I],u=[];c.length;){var h=c.shift();if(i(h)){var f=l.get(h),[f,d]=f?Q8(f,h,z):yield Z8(h,z),p=(s.set(f,h),o.push(f),d.flatMap(a));if(c.push(...p),p.every(i)){var g=yield Promise.all(p.map(t=>J8(t,z)));x8(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),x8(f,"y");for(let t=0;t<p.length;t++){var y=p[t],v=g[t];l.set(y,v)}}}else{d="mark"===r(h)?h:yield oL(h,z),f=a(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}G.emitter.emit(QT.BEFORE_PAINT);const m=new Map,b=new Map,x=[];D.selectAll(uL(W)).data(o,t=>t.key).join(t=>t.append("g").attr("className",W).attr("id",t=>t.key).call(K8).each(function(t){tL(t,tt(this),x,z),m.set(t,this)}),t=>t.call(K8).each(function(t){tL(t,tt(this),x,z),b.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var w=t=>Array.from(t.entries()).map(([t,e])=>({view:t,container:e,options:s.get(t),update:function(i,a,o){return r=>Oe(this,void 0,void 0,function*(){var[t,e]=yield Z8(r,a);tL(t,i,[],a);for(const n of e)$8(n,i,a,o);return{options:r,view:t}})}(tt(e),z,G)})),k=w(m);for(const P of k){const I=P["options"];var E=new Map;P.container.nameInteraction=E;for(const L of aL(I)){var M=t(L)(P,k);E.set(L.type,{destroy:M})}}var O=w(b);for(const C of O){const{options:I,container:N}=C;var S=N.nameInteraction;for(const j of aL(I)){var _=S.get(j.type);_&&_.destroy();_=t(j)(C,O);S.set(I.type,{destroy:_})}}const{width:A,height:F}=I;var T=[];for(const R of u){var B=new Promise(e=>Oe(this,void 0,void 0,function*(){for(const t of R)yield $8(Object.assign({width:A,height:F},t),D,z,G);e()}));T.push(B)}G.views=o,G.animations=x,G.emitter.emit(QT.AFTER_PAINT);w=x.filter(ug).map(rL).map(t=>t.finished);return Promise.all([...w,...T])})}function K8(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function Z8(t,e){return Oe(this,void 0,void 0,function*(){return Q8(yield J8(t,e),t,e)})}function J8(m,b){return Oe(this,void 0,void 0,function*(){var[t]=CM("theme",b);const[i,a]=CM("mark",b);var{theme:e,marks:n,coordinates:r=[]}=m,o=t(iL(e)),s=new Map,l=[];for(const p of n){var c=yield oL(p,b);l.push(c)}for(const g of yield Promise.all(l.map(r=>Oe(this,void 0,void 0,function*(){const{type:t=lg("G2Mark type is required."),key:n}=r;var e=a(t)["props"],{composite:e=!1}=e;return e?(yield i(r)(m)).map((t,e)=>Object.assign({key:n+"-"+e},t)):r}))).then(t=>t.flat())){var u,h=g["type"],h=a(h)["props"],h=yield X8(g,h,b);h&&([h,u]=h,s.set(h,u))}for(const y of zp(Array.from(s.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var f=y.reduce((t,{scale:e})=>R(t,e),{}),d=y[0]["values"],d=Array.from(new Set(d.map(t=>t.field).filter(ug)));const m=R({guide:{title:0===d.length?void 0:d},field:d[0]},f);d=y[0]["name"];const v=m8(d,y.flatMap(({values:t})=>t.map(t=>t.value)),m,r,o,b);y.forEach(t=>t.scale=v)}return s})}function Q8(t,e,n){var r,i,[a]=CM("mark",n),[o]=CM("theme",n),{key:s,frame:l=!1,theme:c,clip:u,style:h={}}=e,o=o(iL(c)),c=Array.from(t.values()),c=Array.from(new Set(c.flatMap(t=>t.channels.map(t=>t.scale)))),c=N8(Array.from(c),e,n),f=B8(c,e),d=function(t,e,n){var[n]=CM("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new A6(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(f,e,n),e=l?R({mainLineWidth:1,mainStroke:"#000"},h):h,p=(I8(c,d,f),{}),g=[];for([r,i]of t.entries()){const{children:b,dataDomain:x,modifier:w,key:k}=r;var{index:y,channels:v}=i,m=Hb(Object.fromEntries(v.map(({name:t,scale:e})=>[t,e])),t=>b8(t,n));Object.assign(p,m);const E=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(v,m),[M,O,S]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;t<e.length;t++){var a=e[t],o=n[t];o.every(([t,e])=>ug(t)&&ug(e))&&(r.push(a),i.push(o))}return[r,i]}(a(r)(y,m,E,d));v=x||M.length;const _=w?w(O,v,f):[];y=M.map((t,e)=>{var n={points:O[e],transform:_[e],index:t,markKey:k};for(const[r,i]of Object.entries(E))n[r]=i[t],S&&(n["series"+Ff(r)]=S[e].map(t=>i[t]));return S&&(n.seriesIndex=S[e]),n}),v=(i.data=y,i.index=M,null==b?void 0:b(y,m,f));g.push(...v||[])}return[{layout:f,theme:o,coordinate:d,components:c,markState:t,key:s,clip:u,scale:p,style:e},g]}function tL(X,$,K,Z){Oe(this,void 0,void 0,function*(){const{components:F,theme:n,layout:t,markState:e,coordinate:r,key:i,style:B,clip:a}=X,{width:I,height:D}=t,z=J(t,["x","y","width","height"]),o=["view","plot","main","content"];var s,l,c,u=o.map((t,e)=>e);const h=o.map(t=>hg(Object.assign({},n,B),t)),G=["a","margin","padding","inset"].map(t=>Q(z,t)),f=t=>t.style("x",t=>v[t].x).style("y",t=>v[t].y).style("width",t=>v[t].width).style("height",t=>v[t].height).each(function(t){var e,n,r=tt(this),t=h[t];for([e,n]of Object.entries(t))r.style(e,n)});let d=0,p=0,g=I,y=D;const v=u.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=G[t];return d+=t,p+=e,g-=t+r,y-=e+n,{x:d,y:p,width:g,height:y}}),m=($.selectAll(uL(ot)).data(u.filter(t=>ug(h[t])),t=>o[t]).join(t=>t.append("rect").attr("className",ot).style("zIndex",-2).call(f),t=>t.call(f),t=>t.remove()),$.selectAll(uL(it)).data(F,(t,e)=>t.type+"-"+e).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",it).append(t=>j8(t,r,n,Z)),t=>t.each(function(t){var{preserve:e=!1}=t;e||(e=j8(t,r,n,Z)["attributes"],[t]=this.childNodes,t.update(Object.assign({},e)))})),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{updateType:a,updateDuration:o=300,updateDelay:s=0,enterType:l,enterDuration:c=300,enterDelay:u=0,exitType:h,exitDuration:f=300,exitDelay:d=0}=r;for(const E of i){var{updateType:p=a,updateDuration:g=o,updateDelay:y=s,enterType:v=l,enterDuration:m=c,enterDelay:b=u,exitDuration:x=f,exitDelay:w=d,exitType:k=h}=E;void 0!==p&&!p||(e=Math.max(e,g+y),n=Math.min(n,y)),void 0!==k&&!k||(e=Math.max(e,x+w),n=Math.min(n,w)),void 0!==v&&!v||(e=Math.max(e,m+b),n=Math.min(n,b))}}return e===-1/0?null:[n,e-n]}(e)),b=$.selectAll(uL(rt)).data([t],()=>i).join(t=>t.append("rect").style("fill","transparent").attr("className",rt).call(sL).call(cL,Array.from(e.keys())).call(hL,a),t=>t.call(cL,Array.from(e.keys())).call(t=>{if(!m)return sL(t);{const[l,c]=m;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(hL,a)).transitions();K.push(...b.flat());for([s,l]of e.entries()){var W=l["data"];const{key:i,class:S}=s,_=function(l,t,e,n){const[c]=CM("shape",n),u=l["data"],{defaultShape:h,data:r}=t,f=r.map(t=>t.points),{theme:d,coordinate:p}=e,{type:g,style:y={}}=l;return(t,e)=>{var{shape:n=h}=y,{shape:n=n,points:r,seriesIndex:i,index:a}=t,t=J(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{shape:n,mark:g,defaultShape:h,index:e});const o=i?i.map(t=>u[t]):u[a],s=i||a;e=Hb(y,t=>eL(t,o,s,u));return c(Object.assign(Object.assign({},e),{type:lL(l,n)}))(r,t,p,d,f)}}(s,l,X,Z),A=(x=s,c=l,nL("enter",x,c,X,Z)),T=(x=s,c=l,nL("update",x,c,X,Z)),P=(x=s,c=l,nL("exit",x,c,X,Z));var x=function(t,e,n){t=t.node().parentElement;return t.findAll(t=>t.style.facet===e).flatMap(t=>t.getElementsByClassName(n))}($,S,"element");const b=$.select("#"+i).selectAll(uL(nt)).selectFacetAll(x).data(W,t=>t.key,t=>t.groupKey).join(t=>t.append(_).attr("className",nt).transition(function(t){return A(t,[this])}),e=>e.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});e.transition(function(t,e){n=this,r=l,i=c,n.__facet__&&(a=n.parentNode.parentNode,s=r.parentNode,[a,o]=i(a),[i,s]=i(s),a=`translate(${a-i}, ${o-s})`,i=n.style.transform,n.style.transform=(("none"===i?"":i)+" "+a).trimStart(),r.append(n));var n,r,i,a,o=_(t,e),s=T(t,[this],[o]);return null===s&&cg(this,o),s})}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return P(t,[this])}).remove(),t=>t.append(_).attr("className",nt).transition(function(t){var e=this["__fromElements__"],t=T(t,e,[this]);return new Rb(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new Rb([],this.__toData__,this.parentNode).append(_).attr("className",nt).nodes();return T(t,[this],e)}).remove()).transitions();K.push(...b.flat())}{var w=X,k=$,E=Z,M,O;const[H]=CM("labelTransform",E),{markState:V,labelTransform:L}=w,Y=k.select(uL(et)).node(),C=new Map,N=new Map,q=Array.from(V.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r){const[s]=CM("shape",r),l=t["data"],{data:i,defaultLabelShape:c}=e,u=i.map(t=>t.points),{theme:h,coordinate:f}=n;return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t}=t,t=Hb(J(t,["formatter"]),t=>eL(t,r,e,l)),{shape:a=c,text:o}=t,t=J(t,["shape","text"]),i="string"==typeof i?dM(i):i,i=Object.assign(Object.assign({},t),{text:i(o)});return s(Object.assign({type:"label."+a},t))(n,i,f,h,u)}}(t,e,w,E),a=k.select("#"+r).selectAll(uL(nt)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=J(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{C.set(t,i),N.set(t,e)}),t})})}),j=tt(Y).selectAll(uL(at)).data(q,t=>t.key).join(t=>t.append(t=>C.get(t)(t)).attr("className",at),t=>t.each(function(t){cg(this,C.get(t)(t))}),t=>t.remove()).nodes(),U=zp(j,t=>N.get(t.__data__)),R=w["coordinate"];for([M,O]of U){var{transform:M=[]}=M;(function(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),og)})(M.map(H))(O,R)}L&&L(j,R)}})}function eL(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function nL(o,t,e,n,r){var[,i]=CM("shape",r);const[s]=CM("animation",r);r=e.defaultShape;const{theme:a,coordinate:l}=n;e=`default${Ff(o)}Animation`;const{[e]:c}=i(lL(t,r)).props,{[o]:u={}}=a,h=Q(t.animate||{},o);return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||c},h);return t.type?(t=s(t)(e,n,{delay:r,duration:i,easing:a},l,u),Array.isArray(t)?t:[t]):null}}function rL(t){return t.finished.then(()=>{t.cancel()}),t}function iL(t={type:"light"}){var{type:e="light"}=t;return Object.assign(Object.assign({},t),{type:e})}function aL(t){var{interactions:t=[]}=t;return t}function oL(r,i){return Oe(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=J(r,["data"]);return null==e?r:([,{data:e}]=yield z8(0,{data:e},t),Object.assign({data:e},n))})}function sL(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function lL(t,e){t=t.type;return t+"."+e}function cL(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(uL(y)).data(e,t=>t.key).join(t=>t.append("g").attr("className",y).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(uL(et)).node())||t.append("g").attr("className",et)}function uL(...t){return t.map(t=>"."+t).join("")}function hL(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new as({style:{x:e,y:t,width:n,height:r}})):null})}function fL(t){for(var t=R({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t<s.length;t++){var l=s[t];e.set(l,o),n.set(l,t),r.push(l)}}return t}function dL(t,e={},n){const{width:r=640,height:i=480}=t,a=fL(t),{canvas:o=(t=r,c=i,u=new gf,u.registerPlugin(new Mf),new Oc({width:t,height:c,container:document.createElement("div"),renderer:u})),library:s=e6(),emitter:l=new Vf}=e;var c,u;e.canvas=o,e.library=s,e.emitter=l,o.resize(r,i),l.emit(QT.BEFORE_RENDER);const h=tt(o.document.documentElement);return o.ready.then(()=>$8(Object.assign(Object.assign({},a),{width:r,height:i}),h,s,e)).then(()=>{l.emit(QT.AFTER_RENDER),null!=n&&n()}),"string"==typeof(t=o.getConfig().container)?document.getElementById(t):t}function pL(t,e={}){var{canvas:e,emitter:n}=e;e&&e.destroy(),n.off()}function gL(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function yL(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function vL(t,{name:e,key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length?this.attr(r,t):((n=this.attr(r)||{})[t]=e,this.attr(r,n))}}function mL(r){return t=>{for(const n of r){var e=n["type"];"value"===e?gL(t,n):"array"===e?yL(t,n):"object"===e?vL(t,n):"node"===e?function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.append(n)}}(t,n):"container"===e&&function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,n)}return t}}function bL(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function xL(t,e){for(var n=[t];n.length;){var r=n.pop(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class wL{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],t.parentNode=this,t.index=this.children.length,this.children.push(t),t}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return xL(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return xL(this,t=>{e===t.type&&n.push(t)}),n}call(t,...e){return t(this.map(),...e),this}root(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}class kL extends wL{changeData(t){var e=this.root();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t,e=null==(e=this.root())?void 0:e.getView();if(e)return e=e["markState"],t=Array.from(e.keys()).find(t=>t.key===this.attr("key")),e.get(t)}getScale(){var t=null==(t=this.root())?void 0:t.getView();return!t||null==t?void 0:t.scale}getScaleByChannel(t){var e=null==(e=this.root())?void 0:e.getView();return!e||null==(e=null==e?void 0:e.scale)?void 0:e[t]}getGroup(){var t=this.attr("key");if(t)return this.root().context().canvas.getRoot().getElementById(t)}}l=[{name:"encode",type:"object"},{name:"scale",type:"object"},{name:"data",type:"value"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"animate",type:"object"},{name:"label",type:"array",key:"labels"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"slider",type:"object"},{name:"scrollbar",type:"object"}];let EL=class extends kL{constructor(){super({},"interval")}},ML=(EL=t([mL(l)],EL),class extends kL{constructor(){super({},"rect")}}),OL=(ML=t([mL(l)],ML),class extends kL{constructor(){super({},"point")}}),SL=(OL=t([mL(l)],OL),class extends kL{constructor(){super({},"area")}}),_L=(SL=t([mL(l)],SL),class extends kL{constructor(){super({},"line")}}),AL=(_L=t([mL(l)],_L),class extends kL{constructor(){super({},"cell")}}),TL=(AL=t([mL(l)],AL),class extends kL{constructor(){super({},"vector")}}),PL=(TL=t([mL(l)],TL),class extends kL{constructor(){super({},"link")}}),LL=(PL=t([mL(l)],PL),class extends kL{constructor(){super({},"polygon")}});LL=t([mL(l)],LL);lc=t([mL(l)],class extends kL{constructor(){super({},"image")}});let CL=class extends kL{constructor(){super({},"text")}},NL=(CL=t([mL(l)],CL),class extends kL{constructor(){super({},"box")}}),jL=(NL=t([mL(l)],NL),class extends kL{constructor(){super({},"lineX")}}),RL=(jL=t([mL(l)],jL),class extends kL{constructor(){super({},"lineY")}}),FL=(RL=t([mL(l)],RL),class extends kL{constructor(){super({},"range")}}),BL=(FL=t([mL(l)],FL),class extends kL{constructor(){super({},"rangeX")}}),IL=(BL=t([mL(l)],BL),class extends kL{constructor(){super({},"rangeY")}}),DL=(IL=t([mL(l)],IL),class extends kL{constructor(){super({},"connector")}}),zL=(DL=t([mL(l)],DL),class extends kL{constructor(){super({},"shape")}}),GL=(zL=t([mL(l)],zL),class extends kL{constructor(){super({},"sankey")}}),WL=(GL=t([mL([...l,{name:"layout",type:"value"}])],GL),class extends kL{constructor(){super({},"treemap")}}),HL=(WL=t([mL([...l,{name:"layout",type:"value"}])],WL),class extends kL{constructor(){super({},"boxplot")}}),VL=(HL=t([mL(l)],HL),class extends kL{constructor(){super({},"pack")}}),YL=(VL=t([mL([...l,{name:"layout",type:"value"}])],VL),class extends kL{constructor(){super({},"forceGraph")}}),qL=(YL=t([mL([...l,{name:"layout",type:"value"}])],YL),class extends kL{constructor(){super({},"tree")}}),UL=(qL=t([mL([...l,{name:"layout",type:"value"}])],qL),class extends kL{constructor(){super({},"wordCloud")}});UL=t([mL([...l,{name:"layout",type:"object"}])],UL);ac={interval:EL,rect:ML,point:OL,area:SL,line:_L,cell:AL,vector:TL,link:PL,polygon:LL,image:lc,text:CL,box:NL,lineX:jL,lineY:RL,range:FL,rangeX:BL,rangeY:IL,connector:DL,sankey:GL,treemap:WL,boxplot:HL,shape:zL,pack:VL,forceGraph:YL,tree:qL,wordCloud:UL};let XL=class extends wL{getView(){var t=this.root().context()["views"];if(null!=t&&t.length)return t.find(t=>t.key===this.attr("key"))}getCoordinate(){var t;return null==(t=this.getView())?void 0:t.coordinate}getTheme(){var t;return null==(t=this.getView())?void 0:t.theme}getGroup(){var t=this.attr("key");if(t)return this.root().context().canvas.getRoot().getElementById(t)}show(){var t=this.getGroup();t&&!t.isVisible()&&t.setAttribute("visibility","visible")}hide(){var t=this.getGroup();t&&t.isVisible()&&t.setAttribute("visibility","hidden")}},$L=class extends(XL=t([mL([{name:"on",type:"event"}])],XL)){constructor(t={},e="view"){super(t,e)}},KL=($L=t([mL([{type:"value",name:"data"},{type:"array",name:"coordinate",key:"coordinates"},{type:"array",name:"interaction",key:"interactions"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"axis"},{type:"object",name:"legend"},...bL(ac)])],$L),class extends XL{constructor(){super({},"spaceLayer")}}),ZL=(KL=t([mL([{type:"value",name:"data"},...bL(ac)])],KL),class extends XL{constructor(){super({},"spaceFlex")}}),JL=(ZL=t([mL([{type:"value",name:"data"},...bL(ac)])],ZL),class extends XL{constructor(){super({},"facetRect")}}),QL=(JL=t([mL([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...bL(ac)])],JL),class extends XL{constructor(){super({},"facetCircle")}}),t7=(QL=t([mL([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...bL(ac)])],QL),class extends XL{constructor(){super({},"repeatMatrix")}}),e7=(t7=t([mL([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...bL(ac)])],t7),class extends XL{constructor(){super({},"timingKeyframe")}}),n7=(e7=t([mL([...bL(ac)])],e7),class extends XL{constructor(){super({},"geoView")}}),r7=(n7=t([mL([{type:"value",name:"data"},{type:"value",name:"projection"},{type:"array",name:"coordinate",key:"coordinates"},{type:"array",name:"interaction",key:"interactions"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"legend"},...bL(ac)])],n7),class extends XL{constructor(){super({},"geoPath")}});r7=t([mL([{type:"value",name:"data"},{type:"value",name:"projection"},{type:"array",name:"coordinate",key:"coordinates"},{type:"array",name:"interaction",key:"interactions"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},...bL(ac)])],r7);var i7={view:$L,spaceLayer:KL,spaceFlex:ZL,facetRect:JL,facetCircle:QL,repeatMatrix:t7,timingKeyframe:e7,geoView:n7,geoPath:r7};for(const s7 of Object.values(i7))mL(bL(i7))(s7);const a7=e6();function o7(t){return Object.assign(Object.assign({},t.value),{type:t.type})}dc=[{name:"data",type:"value"},{name:"width",type:"value"},{name:"height",type:"value"},{name:"coordinate",type:"array",key:"coordinates"},{name:"interaction",type:"array",key:"interactions"},{name:"theme",type:"object"},{name:"title",type:"value"},{name:"key",type:"value"},{name:"transform",type:"array"},{name:"theme",type:"object"},{name:"scale",type:"object"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"style",type:"object"},...bL(ac),...Object.entries(i7).map(([t,e])=>({type:"container",name:t,ctor:e}))];p.Chart=class extends $L{constructor(t={}){var r,i,a,o,{container:e,canvas:n}=t;super(J(t,["container","canvas"]),"view"),this.onResize=(r=()=>{this.forceFit()},i=300,function(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}),this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new Vf,this._context={library:a7,emitter:this._emitter,canvas:n},this.bindAutoFit()}render(){var t,e,n,r,i,a,o;return this._context.canvas||({width:i=640,height:o=480,renderer:t,plugins:e,autoFit:n}=this.options(),{width:n,height:r}=vg(this._container,n,i,o),this.width(n),this.height(r),this._context.canvas=([n,r,i,a=new gf,o=[]]=[this._container,i,o,t,e],o.push(new Mf),o.forEach(t=>a.registerPlugin(t)),new Oc({container:n,width:r,height:i,renderer:a}))),new Promise(t=>{dL(this.options(),this._context,()=>t(this))})}options(){var t,e=this,e=null!==(e=e).type?e:((t=e.children[e.children.length-1]).attr("width",e.attr("width")),t.attr("height",e.attr("height")),t.attr("paddingLeft",e.attr("paddingLeft")),t.attr("paddingTop",e.attr("paddingTop")),t.attr("paddingBottom",e.attr("paddingBottom")),t.attr("paddingRight",e.attr("paddingRight")),t.attr("insetLeft",e.attr("insetLeft")),t.attr("insetRight",e.attr("insetRight")),t.attr("insetBottom",e.attr("insetBottom")),t.attr("insetTop",e.attr("insetTop")),t.attr("marginLeft",e.attr("marginLeft")),t.attr("marginBottom",e.attr("marginBottom")),t.attr("marginTop",e.attr("marginTop")),t.attr("marginRight",e.attr("marginRight")),t.attr("autoFit",e.attr("autoFit")),t.attr("padding",e.attr("padding")),t.attr("margin",e.attr("margin")),t.attr("inset",e.attr("inset")),t),n=[e],r=new Map;for(r.set(e,o7(e));n.length;){const e=n.pop();var i=r.get(e);for(const s of e.children){var a=o7(s),{children:o=[]}=i;o.push(a),n.push(s),r.set(s,a),i.children=o}}return r.get(e)}node(){return this._container}context(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}destroy(){var t,e;this.options();this.emit(QT.BEFORE_DESTROY),this.unbindAutoFit(),pL(0,this._context),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(QT.AFTER_DESTROY)}clear(){this.options();this.emit(QT.BEFORE_CLEAR),pL(0,this._context),this.emit(QT.AFTER_CLEAR)}forceFit(){var{width:t,height:e,autoFit:n}=this.options(),{width:n,height:t}=vg(this._container,n,t,e);t&&n&&this.changeSize(n,t)}changeSize(t,e){var{width:n,height:r}=this.options();if(n===t&&r===e)return Promise.resolve(this);this.emit(QT.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);n=this.render();return n.then(()=>{this.emit(QT.AFTER_CHANGE_SIZE)}),n}bindAutoFit(){var t=this.options()["autoFit"];t&&window.addEventListener("resize",this.onResize)}unbindAutoFit(){var t=this.options()["autoFit"];t&&window.removeEventListener("resize",this.onResize)}},p.Chart=t([mL(dc)],p.Chart),p.AREA_CLASS_NAME=ot,p.COMPONENT_CLASS_NAME=it,p.ELEMENT_CLASS_NAME=nt,p.LABEL_CLASS_NAME=at,p.LABEL_LAYER_CLASS_NAME=et,p.MAIN_LAYER_CLASS_NAME=y,p.PLOT_CLASS_NAME=rt,p.VIEW_CLASS_NAME=W,p.createLibrary=e6,p.destroy=pL,p.register=function(t,e){Object.assign(a7,{[t]:e})},p.render=dL,p.renderToMountedElement=function(t,e={},n){var r,{width:i=640,height:a=480}=t,t=fL(t);const{library:o=e6(),group:s=new Yo,emitter:l=new Vf}=e;if(null!=s&&s.parentElement)return r=tt(s),e.group=s,e.library=o,(e.emitter=l).emit(QT.BEFORE_RENDER),$8(Object.assign(Object.assign({},t),{width:i,height:a}),r,o,e).then(()=>{l.emit(QT.AFTER_RENDER),null!=n&&n()}),s;throw new Error("renderToMountedElement can't render chart to unmounted group.")},Object.defineProperty(p,"__esModule",{value:!0})});