@awc-ui/core 1.0.0-beta.2 → 1.0.0-beta.3

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 (698) hide show
  1. package/README.md +18 -0
  2. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  3. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  4. package/dist/cjs/engine.wasm-9JtXME10.js +12 -0
  5. package/dist/cjs/engine.wasm-9JtXME10.js.map +1 -0
  6. package/dist/cjs/{index-DlQ_5_Mv.js → index-Bm07YAg9.js} +4 -15
  7. package/dist/cjs/index-Bm07YAg9.js.map +1 -0
  8. package/dist/cjs/loader.cjs.js +3 -2
  9. package/dist/cjs/loader.cjs.js.map +1 -1
  10. package/dist/cjs/md-accordion-item.cjs.entry.js +1 -1
  11. package/dist/cjs/md-accordion.cjs.entry.js +1 -1
  12. package/dist/cjs/md-app-bar.cjs.entry.js +1 -1
  13. package/dist/cjs/md-area-chart.cjs.entry.js +1 -1
  14. package/dist/cjs/md-autocomplete.cjs.entry.js +2 -2
  15. package/dist/cjs/md-avatar_2.cjs.entry.js +1 -1
  16. package/dist/cjs/md-badge.cjs.entry.js +1 -1
  17. package/dist/cjs/md-bar-chart.cjs.entry.js +1 -1
  18. package/dist/cjs/md-bottom-sheet.cjs.entry.js +1 -1
  19. package/dist/cjs/md-breadcrumb-item.cjs.entry.js +1 -1
  20. package/dist/cjs/md-breadcrumbs.cjs.entry.js +1 -1
  21. package/dist/cjs/md-button-group.cjs.entry.js +1 -1
  22. package/dist/cjs/md-button_7.cjs.entry.js +1 -1
  23. package/dist/cjs/md-checkbox.cjs.entry.js +1 -1
  24. package/dist/cjs/md-chip.cjs.entry.js +1 -1
  25. package/dist/cjs/md-color-picker.cjs.entry.js +1 -1
  26. package/dist/cjs/md-date-picker.cjs.entry.js +1 -1
  27. package/dist/cjs/md-dialog.cjs.entry.js +1 -1
  28. package/dist/cjs/md-divider.cjs.entry.js +1 -1
  29. package/dist/cjs/md-fab-menu-item.cjs.entry.js +1 -1
  30. package/dist/cjs/md-fab-menu.cjs.entry.js +1 -1
  31. package/dist/cjs/md-fab.cjs.entry.js +1 -1
  32. package/dist/cjs/md-line-chart.cjs.entry.js +1 -1
  33. package/dist/cjs/md-list-item.cjs.entry.js +1 -1
  34. package/dist/cjs/md-list.cjs.entry.js +1 -1
  35. package/dist/cjs/md-menu-item-group.cjs.entry.js +1 -1
  36. package/dist/cjs/md-menu_2.cjs.entry.js +1 -1
  37. package/dist/cjs/md-meter.cjs.entry.js +1 -1
  38. package/dist/cjs/md-multi-select.cjs.entry.js +2 -2
  39. package/dist/cjs/md-navigation-bar.cjs.entry.js +1 -1
  40. package/dist/cjs/md-navigation-rail-tab.cjs.entry.js +1 -1
  41. package/dist/cjs/md-navigation-rail.cjs.entry.js +1 -1
  42. package/dist/cjs/md-navigation-tab.cjs.entry.js +1 -1
  43. package/dist/cjs/md-number-field.cjs.entry.js +1 -1
  44. package/dist/cjs/md-organization-chart.cjs.entry.js +1 -1
  45. package/dist/cjs/md-otp-field.cjs.entry.js +1 -1
  46. package/dist/cjs/md-pie-chart.cjs.entry.js +1 -1
  47. package/dist/cjs/md-progress-indicator.cjs.entry.js +1 -1
  48. package/dist/cjs/md-rating.cjs.entry.js +1 -1
  49. package/dist/cjs/md-search.cjs.entry.js +1 -1
  50. package/dist/cjs/md-segmented-button-set.cjs.entry.js +1 -1
  51. package/dist/cjs/md-segmented-button.cjs.entry.js +1 -1
  52. package/dist/cjs/md-select-option.cjs.entry.js +1 -1
  53. package/dist/cjs/md-select.cjs.entry.js +2 -2
  54. package/dist/cjs/md-side-sheet.cjs.entry.js +1 -1
  55. package/dist/cjs/md-skeleton.cjs.entry.js +1 -1
  56. package/dist/cjs/md-slider.cjs.entry.js +1 -1
  57. package/dist/cjs/md-sparkline.cjs.entry.js +1 -1
  58. package/dist/cjs/md-split-button.cjs.entry.js +1 -1
  59. package/dist/cjs/md-status-dot.cjs.entry.js +1 -1
  60. package/dist/cjs/md-step.cjs.entry.js +1 -1
  61. package/dist/cjs/md-stepper.cjs.entry.js +1 -1
  62. package/dist/cjs/md-sub-menu-item.cjs.entry.js +1 -1
  63. package/dist/cjs/md-switch.cjs.entry.js +1 -1
  64. package/dist/cjs/md-tab-panel.cjs.entry.js +1 -1
  65. package/dist/cjs/md-tab-panels.cjs.entry.js +1 -1
  66. package/dist/cjs/md-tab.cjs.entry.js +1 -1
  67. package/dist/cjs/md-table-body.cjs.entry.js +1 -1
  68. package/dist/cjs/md-table-cell.cjs.entry.js +1 -1
  69. package/dist/cjs/md-table-container.cjs.entry.js +1 -1
  70. package/dist/cjs/md-table-expand-toggle.cjs.entry.js +1 -1
  71. package/dist/cjs/md-table-foot.cjs.entry.js +1 -1
  72. package/dist/cjs/md-table-head.cjs.entry.js +1 -1
  73. package/dist/cjs/md-table-pagination.cjs.entry.js +1 -1
  74. package/dist/cjs/md-table-row.cjs.entry.js +1 -1
  75. package/dist/cjs/md-table-sort-label.cjs.entry.js +1 -1
  76. package/dist/cjs/md-table-toolbar.cjs.entry.js +1 -1
  77. package/dist/cjs/md-table.cjs.entry.js +1 -1
  78. package/dist/cjs/md-tabs.cjs.entry.js +1 -1
  79. package/dist/cjs/md-text-field.cjs.entry.js +1 -1
  80. package/dist/cjs/md-time-picker.cjs.entry.js +1 -1
  81. package/dist/cjs/md-toolbar.cjs.entry.js +1 -1
  82. package/dist/cjs/md-transfer-list.cjs.entry.js +1 -1
  83. package/dist/cjs/md3.cjs.js +3 -2
  84. package/dist/cjs/md3.cjs.js.map +1 -1
  85. package/dist/cjs/{virtual-select-controller-CqriaZgm.js → virtual-select-controller-C5cSoKfB.js} +10 -9
  86. package/dist/cjs/virtual-select-controller-C5cSoKfB.js.map +1 -0
  87. package/dist/collection/wasm/engine-abi.js +8 -2
  88. package/dist/collection/wasm/engine-abi.js.map +1 -1
  89. package/dist/components/index.js +1 -1
  90. package/dist/components/md-accordion-item.js +1 -1
  91. package/dist/components/md-accordion.js +1 -1
  92. package/dist/components/md-app-bar.js +1 -1
  93. package/dist/components/md-area-chart.js +1 -1
  94. package/dist/components/md-area-chart.js.map +1 -1
  95. package/dist/components/md-autocomplete.js +1 -1
  96. package/dist/components/md-avatar.js +1 -1
  97. package/dist/components/md-badge.js +1 -1
  98. package/dist/components/md-bar-chart.js +1 -1
  99. package/dist/components/md-bottom-sheet.js +1 -1
  100. package/dist/components/md-breadcrumb-item.js +1 -1
  101. package/dist/components/md-breadcrumbs.js +1 -1
  102. package/dist/components/md-button-group.js +1 -1
  103. package/dist/components/md-button.js +1 -1
  104. package/dist/components/md-card.js +1 -1
  105. package/dist/components/md-checkbox.js +1 -1
  106. package/dist/components/md-chip.js +1 -1
  107. package/dist/components/md-color-picker.js +1 -1
  108. package/dist/components/md-date-picker.js +1 -1
  109. package/dist/components/md-dialog.js +1 -1
  110. package/dist/components/md-divider.js +1 -1
  111. package/dist/components/md-fab-menu-item.js +1 -1
  112. package/dist/components/md-fab-menu.js +1 -1
  113. package/dist/components/md-fab.js +1 -1
  114. package/dist/components/md-icon-button.js +1 -1
  115. package/dist/components/md-line-chart.js +1 -1
  116. package/dist/components/md-list-item.js +1 -1
  117. package/dist/components/md-list.js +1 -1
  118. package/dist/components/md-loading-indicator.js +1 -1
  119. package/dist/components/md-menu-item-group.js +1 -1
  120. package/dist/components/md-menu-item.js +1 -1
  121. package/dist/components/md-menu.js +1 -1
  122. package/dist/components/md-meter.js +1 -1
  123. package/dist/components/md-multi-select.js +1 -1
  124. package/dist/components/md-navigation-bar.js +1 -1
  125. package/dist/components/md-navigation-rail-tab.js +1 -1
  126. package/dist/components/md-navigation-rail.js +1 -1
  127. package/dist/components/md-navigation-tab.js +1 -1
  128. package/dist/components/md-number-field.js +1 -1
  129. package/dist/components/md-organization-chart.js +1 -1
  130. package/dist/components/md-otp-field.js +1 -1
  131. package/dist/components/md-pie-chart.js +1 -1
  132. package/dist/components/md-progress-indicator.js +1 -1
  133. package/dist/components/md-radio.js +1 -1
  134. package/dist/components/md-rating.js +1 -1
  135. package/dist/components/md-ripple.js +1 -1
  136. package/dist/components/md-search.js +1 -1
  137. package/dist/components/md-segmented-button-set.js +1 -1
  138. package/dist/components/md-segmented-button.js +1 -1
  139. package/dist/components/md-select-option.js +1 -1
  140. package/dist/components/md-select.js +1 -1
  141. package/dist/components/md-side-sheet.js +1 -1
  142. package/dist/components/md-skeleton.js +1 -1
  143. package/dist/components/md-slider.js +1 -1
  144. package/dist/components/md-snackbar.js +1 -1
  145. package/dist/components/md-sparkline.js +1 -1
  146. package/dist/components/md-split-button.js +1 -1
  147. package/dist/components/md-status-dot.js +1 -1
  148. package/dist/components/md-step.js +1 -1
  149. package/dist/components/md-stepper.js +1 -1
  150. package/dist/components/md-sub-menu-item.js +1 -1
  151. package/dist/components/md-switch.js +1 -1
  152. package/dist/components/md-tab-panel.js +1 -1
  153. package/dist/components/md-tab-panels.js +1 -1
  154. package/dist/components/md-tab.js +1 -1
  155. package/dist/components/md-table-body.js +1 -1
  156. package/dist/components/md-table-cell.js +1 -1
  157. package/dist/components/md-table-container.js +1 -1
  158. package/dist/components/md-table-expand-toggle.js +1 -1
  159. package/dist/components/md-table-foot.js +1 -1
  160. package/dist/components/md-table-head.js +1 -1
  161. package/dist/components/md-table-pagination.js +1 -1
  162. package/dist/components/md-table-row.js +1 -1
  163. package/dist/components/md-table-sort-label.js +1 -1
  164. package/dist/components/md-table-toolbar.js +1 -1
  165. package/dist/components/md-table.js +1 -1
  166. package/dist/components/md-tabs.js +1 -1
  167. package/dist/components/md-text-field.js +1 -1
  168. package/dist/components/md-time-picker.js +1 -1
  169. package/dist/components/md-toolbar.js +1 -1
  170. package/dist/components/md-tooltip.js +1 -1
  171. package/dist/components/md-transfer-list.js +1 -1
  172. package/dist/components/p-B-JfuA2g.js +2 -0
  173. package/dist/components/p-B-JfuA2g.js.map +1 -0
  174. package/dist/components/p-B-iHDK5h.js +2 -0
  175. package/dist/components/p-B-iHDK5h.js.map +1 -0
  176. package/dist/components/p-BA2v4IuG.js +2 -0
  177. package/dist/components/p-BA2v4IuG.js.map +1 -0
  178. package/dist/components/p-BADA63mI.js +2 -0
  179. package/dist/components/p-BADA63mI.js.map +1 -0
  180. package/dist/components/p-BR6gfOQH.js +2 -0
  181. package/dist/components/p-BR6gfOQH.js.map +1 -0
  182. package/dist/components/p-Bz-JaJcA.js +2 -0
  183. package/dist/components/p-Bz-JaJcA.js.map +1 -0
  184. package/dist/components/p-CCMritCA.js +2 -0
  185. package/dist/components/p-CCMritCA.js.map +1 -0
  186. package/dist/components/p-CTC8XAB6.js +2 -0
  187. package/dist/components/p-CTC8XAB6.js.map +1 -0
  188. package/dist/components/p-CfBPnYW7.js +2 -0
  189. package/dist/components/p-CfBPnYW7.js.map +1 -0
  190. package/dist/components/p-CtVItLby.js +2 -0
  191. package/dist/components/p-CtVItLby.js.map +1 -0
  192. package/dist/components/p-D8oM1Kr3.js +2 -0
  193. package/dist/components/p-D8oM1Kr3.js.map +1 -0
  194. package/dist/components/{p-Ddiw2Kjw.js → p-DEzb9xsY.js} +2 -2
  195. package/dist/components/p-DEzb9xsY.js.map +1 -0
  196. package/dist/components/p-DYL-8C5C.js +2 -0
  197. package/dist/components/p-DYL-8C5C.js.map +1 -0
  198. package/dist/components/p-DfU4xY2F.js +2 -0
  199. package/dist/components/p-DfU4xY2F.js.map +1 -0
  200. package/dist/components/p-Eb44PPZa.js +2 -0
  201. package/dist/components/p-Eb44PPZa.js.map +1 -0
  202. package/dist/components/{p-UdGDg2oJ.js → p-Lsoo1B-2.js} +2 -2
  203. package/dist/components/p-Lsoo1B-2.js.map +1 -0
  204. package/dist/components/p-tSoecrcz.js +2 -0
  205. package/dist/components/p-tSoecrcz.js.map +1 -0
  206. package/dist/components-csr/index.js +2 -0
  207. package/dist/components-csr/index.js.map +1 -0
  208. package/dist/components-csr/md-accordion-item.js +2 -0
  209. package/dist/components-csr/md-accordion-item.js.map +1 -0
  210. package/dist/components-csr/md-accordion.js +2 -0
  211. package/dist/components-csr/md-accordion.js.map +1 -0
  212. package/dist/components-csr/md-app-bar.js +2 -0
  213. package/dist/components-csr/md-app-bar.js.map +1 -0
  214. package/dist/components-csr/md-area-chart.js +2 -0
  215. package/dist/components-csr/md-area-chart.js.map +1 -0
  216. package/dist/components-csr/md-autocomplete.js +2 -0
  217. package/dist/components-csr/md-autocomplete.js.map +1 -0
  218. package/dist/components-csr/md-avatar.js +2 -0
  219. package/dist/components-csr/md-avatar.js.map +1 -0
  220. package/dist/components-csr/md-badge.js +2 -0
  221. package/dist/components-csr/md-badge.js.map +1 -0
  222. package/dist/components-csr/md-bar-chart.js +2 -0
  223. package/dist/components-csr/md-bar-chart.js.map +1 -0
  224. package/dist/components-csr/md-bottom-sheet.js +2 -0
  225. package/dist/components-csr/md-bottom-sheet.js.map +1 -0
  226. package/dist/components-csr/md-breadcrumb-item.js +2 -0
  227. package/dist/components-csr/md-breadcrumb-item.js.map +1 -0
  228. package/dist/components-csr/md-breadcrumbs.js +2 -0
  229. package/dist/components-csr/md-breadcrumbs.js.map +1 -0
  230. package/dist/components-csr/md-button-group.js +2 -0
  231. package/dist/components-csr/md-button-group.js.map +1 -0
  232. package/dist/components-csr/md-button.js +2 -0
  233. package/dist/components-csr/md-button.js.map +1 -0
  234. package/dist/components-csr/md-card.js +2 -0
  235. package/dist/components-csr/md-card.js.map +1 -0
  236. package/dist/components-csr/md-checkbox.js +2 -0
  237. package/dist/components-csr/md-checkbox.js.map +1 -0
  238. package/dist/components-csr/md-chip.js +2 -0
  239. package/dist/components-csr/md-chip.js.map +1 -0
  240. package/dist/components-csr/md-color-picker.js +2 -0
  241. package/dist/components-csr/md-color-picker.js.map +1 -0
  242. package/dist/components-csr/md-date-picker.js +2 -0
  243. package/dist/components-csr/md-date-picker.js.map +1 -0
  244. package/dist/components-csr/md-dialog.js +2 -0
  245. package/dist/components-csr/md-dialog.js.map +1 -0
  246. package/dist/components-csr/md-divider.js +2 -0
  247. package/dist/components-csr/md-divider.js.map +1 -0
  248. package/dist/components-csr/md-fab-menu-item.js +2 -0
  249. package/dist/components-csr/md-fab-menu-item.js.map +1 -0
  250. package/dist/components-csr/md-fab-menu.js +2 -0
  251. package/dist/components-csr/md-fab-menu.js.map +1 -0
  252. package/dist/components-csr/md-fab.js +2 -0
  253. package/dist/components-csr/md-fab.js.map +1 -0
  254. package/dist/components-csr/md-icon-button.js +2 -0
  255. package/dist/components-csr/md-icon-button.js.map +1 -0
  256. package/dist/components-csr/md-line-chart.js +2 -0
  257. package/dist/components-csr/md-line-chart.js.map +1 -0
  258. package/dist/components-csr/md-list-item.js +2 -0
  259. package/dist/components-csr/md-list-item.js.map +1 -0
  260. package/dist/components-csr/md-list.js +2 -0
  261. package/dist/components-csr/md-list.js.map +1 -0
  262. package/dist/components-csr/md-loading-indicator.js +2 -0
  263. package/dist/components-csr/md-loading-indicator.js.map +1 -0
  264. package/dist/components-csr/md-menu-item-group.js +2 -0
  265. package/dist/components-csr/md-menu-item-group.js.map +1 -0
  266. package/dist/components-csr/md-menu-item.js +2 -0
  267. package/dist/components-csr/md-menu-item.js.map +1 -0
  268. package/dist/components-csr/md-menu.js +2 -0
  269. package/dist/components-csr/md-menu.js.map +1 -0
  270. package/dist/components-csr/md-meter.js +2 -0
  271. package/dist/components-csr/md-meter.js.map +1 -0
  272. package/dist/components-csr/md-multi-select.js +2 -0
  273. package/dist/components-csr/md-multi-select.js.map +1 -0
  274. package/dist/components-csr/md-navigation-bar.js +2 -0
  275. package/dist/components-csr/md-navigation-bar.js.map +1 -0
  276. package/dist/components-csr/md-navigation-rail-tab.js +2 -0
  277. package/dist/components-csr/md-navigation-rail-tab.js.map +1 -0
  278. package/dist/components-csr/md-navigation-rail.js +2 -0
  279. package/dist/components-csr/md-navigation-rail.js.map +1 -0
  280. package/dist/components-csr/md-navigation-tab.js +2 -0
  281. package/dist/components-csr/md-navigation-tab.js.map +1 -0
  282. package/dist/components-csr/md-number-field.js +2 -0
  283. package/dist/components-csr/md-number-field.js.map +1 -0
  284. package/dist/components-csr/md-organization-chart.js +2 -0
  285. package/dist/components-csr/md-organization-chart.js.map +1 -0
  286. package/dist/components-csr/md-otp-field.js +2 -0
  287. package/dist/components-csr/md-otp-field.js.map +1 -0
  288. package/dist/components-csr/md-pie-chart.js +2 -0
  289. package/dist/components-csr/md-pie-chart.js.map +1 -0
  290. package/dist/components-csr/md-progress-indicator.js +2 -0
  291. package/dist/components-csr/md-progress-indicator.js.map +1 -0
  292. package/dist/components-csr/md-radio.js +2 -0
  293. package/dist/components-csr/md-radio.js.map +1 -0
  294. package/dist/components-csr/md-rating.js +2 -0
  295. package/dist/components-csr/md-rating.js.map +1 -0
  296. package/dist/components-csr/md-ripple.js +2 -0
  297. package/dist/components-csr/md-ripple.js.map +1 -0
  298. package/dist/components-csr/md-search.js +2 -0
  299. package/dist/components-csr/md-search.js.map +1 -0
  300. package/dist/components-csr/md-segmented-button-set.js +2 -0
  301. package/dist/components-csr/md-segmented-button-set.js.map +1 -0
  302. package/dist/components-csr/md-segmented-button.js +2 -0
  303. package/dist/components-csr/md-segmented-button.js.map +1 -0
  304. package/dist/components-csr/md-select-option.js +2 -0
  305. package/dist/components-csr/md-select-option.js.map +1 -0
  306. package/dist/components-csr/md-select.js +2 -0
  307. package/dist/components-csr/md-select.js.map +1 -0
  308. package/dist/components-csr/md-side-sheet.js +2 -0
  309. package/dist/components-csr/md-side-sheet.js.map +1 -0
  310. package/dist/components-csr/md-skeleton.js +2 -0
  311. package/dist/components-csr/md-skeleton.js.map +1 -0
  312. package/dist/components-csr/md-slider.js +2 -0
  313. package/dist/components-csr/md-slider.js.map +1 -0
  314. package/dist/components-csr/md-snackbar.js +2 -0
  315. package/dist/components-csr/md-snackbar.js.map +1 -0
  316. package/dist/components-csr/md-sparkline.js +2 -0
  317. package/dist/components-csr/md-sparkline.js.map +1 -0
  318. package/dist/components-csr/md-split-button.js +2 -0
  319. package/dist/components-csr/md-split-button.js.map +1 -0
  320. package/dist/components-csr/md-status-dot.js +2 -0
  321. package/dist/components-csr/md-status-dot.js.map +1 -0
  322. package/dist/components-csr/md-step.js +2 -0
  323. package/dist/components-csr/md-step.js.map +1 -0
  324. package/dist/components-csr/md-stepper.js +2 -0
  325. package/dist/components-csr/md-stepper.js.map +1 -0
  326. package/dist/components-csr/md-sub-menu-item.js +2 -0
  327. package/dist/components-csr/md-sub-menu-item.js.map +1 -0
  328. package/dist/components-csr/md-switch.js +2 -0
  329. package/dist/components-csr/md-switch.js.map +1 -0
  330. package/dist/components-csr/md-tab-panel.js +2 -0
  331. package/dist/components-csr/md-tab-panel.js.map +1 -0
  332. package/dist/components-csr/md-tab-panels.js +2 -0
  333. package/dist/components-csr/md-tab-panels.js.map +1 -0
  334. package/dist/components-csr/md-tab.js +2 -0
  335. package/dist/components-csr/md-tab.js.map +1 -0
  336. package/dist/components-csr/md-table-body.js +2 -0
  337. package/dist/components-csr/md-table-body.js.map +1 -0
  338. package/dist/components-csr/md-table-cell.js +2 -0
  339. package/dist/components-csr/md-table-cell.js.map +1 -0
  340. package/dist/components-csr/md-table-container.js +2 -0
  341. package/dist/components-csr/md-table-container.js.map +1 -0
  342. package/dist/components-csr/md-table-expand-toggle.js +2 -0
  343. package/dist/components-csr/md-table-expand-toggle.js.map +1 -0
  344. package/dist/components-csr/md-table-foot.js +2 -0
  345. package/dist/components-csr/md-table-foot.js.map +1 -0
  346. package/dist/components-csr/md-table-head.js +2 -0
  347. package/dist/components-csr/md-table-head.js.map +1 -0
  348. package/dist/components-csr/md-table-pagination.js +2 -0
  349. package/dist/components-csr/md-table-pagination.js.map +1 -0
  350. package/dist/components-csr/md-table-row.js +2 -0
  351. package/dist/components-csr/md-table-row.js.map +1 -0
  352. package/dist/components-csr/md-table-sort-label.js +2 -0
  353. package/dist/components-csr/md-table-sort-label.js.map +1 -0
  354. package/dist/components-csr/md-table-toolbar.js +2 -0
  355. package/dist/components-csr/md-table-toolbar.js.map +1 -0
  356. package/dist/components-csr/md-table.js +2 -0
  357. package/dist/components-csr/md-table.js.map +1 -0
  358. package/dist/components-csr/md-tabs.js +2 -0
  359. package/dist/components-csr/md-tabs.js.map +1 -0
  360. package/dist/components-csr/md-text-field.js +2 -0
  361. package/dist/components-csr/md-text-field.js.map +1 -0
  362. package/dist/components-csr/md-time-picker.js +2 -0
  363. package/dist/components-csr/md-time-picker.js.map +1 -0
  364. package/dist/components-csr/md-toolbar.js +2 -0
  365. package/dist/components-csr/md-toolbar.js.map +1 -0
  366. package/dist/components-csr/md-tooltip.js +2 -0
  367. package/dist/components-csr/md-tooltip.js.map +1 -0
  368. package/dist/components-csr/md-transfer-list.js +2 -0
  369. package/dist/components-csr/md-transfer-list.js.map +1 -0
  370. package/dist/{components/p-DXXUoRSH.js → components-csr/p--OUYjgKN.js} +2 -2
  371. package/dist/{components/p-Dp-w93ot.js → components-csr/p--TCJgZnE.js} +2 -2
  372. package/dist/components-csr/p-BdEoSBtL.js +2 -0
  373. package/dist/components-csr/p-BdEoSBtL.js.map +1 -0
  374. package/dist/components-csr/p-Bmu7RqHM.js +2 -0
  375. package/dist/components-csr/p-Bx6--dQF.js +2 -0
  376. package/dist/components-csr/p-Bx6--dQF.js.map +1 -0
  377. package/dist/components-csr/p-Bz-JaJcA.js +2 -0
  378. package/dist/components-csr/p-Bz-JaJcA.js.map +1 -0
  379. package/dist/{components/p-uTEkf0sE.js → components-csr/p-C0DlKmRg.js} +2 -2
  380. package/dist/{components/p-Ch2-tttM.js → components-csr/p-C4_7YnHT.js} +2 -2
  381. package/dist/{components/p-BwXpiUsu.js → components-csr/p-CG6FaRlt.js} +2 -2
  382. package/dist/{components/p-B0Opn6dK.js → components-csr/p-CSrxeWwL.js} +2 -2
  383. package/dist/components-csr/p-C_ogF68H.js +2 -0
  384. package/dist/components-csr/p-C_ogF68H.js.map +1 -0
  385. package/dist/components-csr/p-Cch_V1vi.js +2 -0
  386. package/dist/components-csr/p-Cch_V1vi.js.map +1 -0
  387. package/dist/components-csr/p-CfBPnYW7.js +2 -0
  388. package/dist/components-csr/p-CfBPnYW7.js.map +1 -0
  389. package/dist/{components/p-B3MWYEEJ.js → components-csr/p-CrbzXk64.js} +2 -2
  390. package/dist/components-csr/p-CxhZdOPw.js +2 -0
  391. package/dist/components-csr/p-CxhZdOPw.js.map +1 -0
  392. package/dist/{components/p-7fN_yCXW.js → components-csr/p-DF19mmLl.js} +2 -2
  393. package/dist/components-csr/p-DWxN44zD.js +2 -0
  394. package/dist/components-csr/p-DWxN44zD.js.map +1 -0
  395. package/dist/components-csr/p-DYBUr7K_.js +2 -0
  396. package/dist/components-csr/p-DYBUr7K_.js.map +1 -0
  397. package/dist/{components/p-e2HRV63Y.js → components-csr/p-DfcpeJAu.js} +2 -2
  398. package/dist/components-csr/p-DvOKnoqK.js +2 -0
  399. package/dist/components-csr/p-DvOKnoqK.js.map +1 -0
  400. package/dist/{components/p-C8EP4S21.js → components-csr/p-DvXQXhgu.js} +2 -2
  401. package/dist/components-csr/p-DzPKu-Ma.js +2 -0
  402. package/dist/components-csr/p-DzPKu-Ma.js.map +1 -0
  403. package/dist/{components/p-stybaFzj.js → components-csr/p-Hm3X1iai.js} +2 -2
  404. package/dist/{components/p-6wZSqm_2.js → components-csr/p-IWA0yIjJ.js} +2 -2
  405. package/dist/components-csr/p-RLxbNqRv.js +2 -0
  406. package/dist/components-csr/p-RLxbNqRv.js.map +1 -0
  407. package/dist/components-csr/p-bSpXNc5J.js +2 -0
  408. package/dist/components-csr/p-bSpXNc5J.js.map +1 -0
  409. package/dist/components-csr/p-uZbtHo-A.js +2 -0
  410. package/dist/components-csr/package.json +3 -0
  411. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  412. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  413. package/dist/esm/engine.wasm-CfBPnYW7.js +10 -0
  414. package/dist/esm/engine.wasm-CfBPnYW7.js.map +1 -0
  415. package/dist/esm/{index-DTaX19_O.js → index-WmvQpZnM.js} +5 -15
  416. package/dist/esm/index-WmvQpZnM.js.map +1 -0
  417. package/dist/esm/loader.js +3 -2
  418. package/dist/esm/loader.js.map +1 -1
  419. package/dist/esm/md-accordion-item.entry.js +1 -1
  420. package/dist/esm/md-accordion.entry.js +1 -1
  421. package/dist/esm/md-app-bar.entry.js +1 -1
  422. package/dist/esm/md-area-chart.entry.js +1 -1
  423. package/dist/esm/md-autocomplete.entry.js +2 -2
  424. package/dist/esm/md-avatar_2.entry.js +1 -1
  425. package/dist/esm/md-badge.entry.js +1 -1
  426. package/dist/esm/md-bar-chart.entry.js +1 -1
  427. package/dist/esm/md-bottom-sheet.entry.js +1 -1
  428. package/dist/esm/md-breadcrumb-item.entry.js +1 -1
  429. package/dist/esm/md-breadcrumbs.entry.js +1 -1
  430. package/dist/esm/md-button-group.entry.js +1 -1
  431. package/dist/esm/md-button_7.entry.js +1 -1
  432. package/dist/esm/md-checkbox.entry.js +1 -1
  433. package/dist/esm/md-chip.entry.js +1 -1
  434. package/dist/esm/md-color-picker.entry.js +1 -1
  435. package/dist/esm/md-date-picker.entry.js +1 -1
  436. package/dist/esm/md-dialog.entry.js +1 -1
  437. package/dist/esm/md-divider.entry.js +1 -1
  438. package/dist/esm/md-fab-menu-item.entry.js +1 -1
  439. package/dist/esm/md-fab-menu.entry.js +1 -1
  440. package/dist/esm/md-fab.entry.js +1 -1
  441. package/dist/esm/md-line-chart.entry.js +1 -1
  442. package/dist/esm/md-list-item.entry.js +1 -1
  443. package/dist/esm/md-list.entry.js +1 -1
  444. package/dist/esm/md-menu-item-group.entry.js +1 -1
  445. package/dist/esm/md-menu_2.entry.js +1 -1
  446. package/dist/esm/md-meter.entry.js +1 -1
  447. package/dist/esm/md-multi-select.entry.js +2 -2
  448. package/dist/esm/md-navigation-bar.entry.js +1 -1
  449. package/dist/esm/md-navigation-rail-tab.entry.js +1 -1
  450. package/dist/esm/md-navigation-rail.entry.js +1 -1
  451. package/dist/esm/md-navigation-tab.entry.js +1 -1
  452. package/dist/esm/md-number-field.entry.js +1 -1
  453. package/dist/esm/md-organization-chart.entry.js +1 -1
  454. package/dist/esm/md-otp-field.entry.js +1 -1
  455. package/dist/esm/md-pie-chart.entry.js +1 -1
  456. package/dist/esm/md-progress-indicator.entry.js +1 -1
  457. package/dist/esm/md-rating.entry.js +1 -1
  458. package/dist/esm/md-search.entry.js +1 -1
  459. package/dist/esm/md-segmented-button-set.entry.js +1 -1
  460. package/dist/esm/md-segmented-button.entry.js +1 -1
  461. package/dist/esm/md-select-option.entry.js +1 -1
  462. package/dist/esm/md-select.entry.js +2 -2
  463. package/dist/esm/md-side-sheet.entry.js +1 -1
  464. package/dist/esm/md-skeleton.entry.js +1 -1
  465. package/dist/esm/md-slider.entry.js +1 -1
  466. package/dist/esm/md-sparkline.entry.js +1 -1
  467. package/dist/esm/md-split-button.entry.js +1 -1
  468. package/dist/esm/md-status-dot.entry.js +1 -1
  469. package/dist/esm/md-step.entry.js +1 -1
  470. package/dist/esm/md-stepper.entry.js +1 -1
  471. package/dist/esm/md-sub-menu-item.entry.js +1 -1
  472. package/dist/esm/md-switch.entry.js +1 -1
  473. package/dist/esm/md-tab-panel.entry.js +1 -1
  474. package/dist/esm/md-tab-panels.entry.js +1 -1
  475. package/dist/esm/md-tab.entry.js +1 -1
  476. package/dist/esm/md-table-body.entry.js +1 -1
  477. package/dist/esm/md-table-cell.entry.js +1 -1
  478. package/dist/esm/md-table-container.entry.js +1 -1
  479. package/dist/esm/md-table-expand-toggle.entry.js +1 -1
  480. package/dist/esm/md-table-foot.entry.js +1 -1
  481. package/dist/esm/md-table-head.entry.js +1 -1
  482. package/dist/esm/md-table-pagination.entry.js +1 -1
  483. package/dist/esm/md-table-row.entry.js +1 -1
  484. package/dist/esm/md-table-sort-label.entry.js +1 -1
  485. package/dist/esm/md-table-toolbar.entry.js +1 -1
  486. package/dist/esm/md-table.entry.js +1 -1
  487. package/dist/esm/md-tabs.entry.js +1 -1
  488. package/dist/esm/md-text-field.entry.js +1 -1
  489. package/dist/esm/md-time-picker.entry.js +1 -1
  490. package/dist/esm/md-toolbar.entry.js +1 -1
  491. package/dist/esm/md-transfer-list.entry.js +1 -1
  492. package/dist/esm/md3.js +3 -2
  493. package/dist/esm/md3.js.map +1 -1
  494. package/dist/esm/{virtual-select-controller-BEWIC0pC.js → virtual-select-controller-CR60w6DO.js} +10 -9
  495. package/dist/esm/virtual-select-controller-CR60w6DO.js.map +1 -0
  496. package/dist/md3/md3.css +1 -1
  497. package/dist/md3/md3.esm.js +1 -1
  498. package/dist/md3/md3.esm.js.map +1 -1
  499. package/dist/md3/{p-2e9503d7.entry.js → p-0a599351.entry.js} +2 -2
  500. package/dist/md3/p-1d7e0203.entry.js +2 -0
  501. package/dist/md3/{p-fb61868c.entry.js.map → p-1d7e0203.entry.js.map} +1 -1
  502. package/dist/md3/p-1e85b8a8.entry.js +2 -0
  503. package/dist/md3/{p-aaec2698.entry.js.map → p-1e85b8a8.entry.js.map} +1 -1
  504. package/dist/md3/{p-396089fd.entry.js → p-1edb5a0d.entry.js} +2 -2
  505. package/dist/md3/{p-c00f7514.entry.js → p-21c89d1d.entry.js} +2 -2
  506. package/dist/md3/p-22633b2d.entry.js +2 -0
  507. package/dist/md3/{p-6b2871a0.entry.js.map → p-22633b2d.entry.js.map} +1 -1
  508. package/dist/md3/{p-2e09a7b7.entry.js → p-27135a6b.entry.js} +2 -2
  509. package/dist/md3/{p-c063c823.entry.js → p-2befc42c.entry.js} +2 -2
  510. package/dist/md3/p-2dda08b2.entry.js +2 -0
  511. package/dist/md3/{p-21772851.entry.js.map → p-2dda08b2.entry.js.map} +1 -1
  512. package/dist/md3/p-3508d0e0.entry.js +2 -0
  513. package/dist/md3/{p-f31ab454.entry.js.map → p-3508d0e0.entry.js.map} +1 -1
  514. package/dist/md3/{p-b34d385b.entry.js → p-35b05b45.entry.js} +2 -2
  515. package/dist/md3/{p-c2dd8c8c.entry.js → p-38e9a583.entry.js} +2 -2
  516. package/dist/md3/{p-3cce1de3.entry.js → p-38f82d34.entry.js} +2 -2
  517. package/dist/md3/p-3a4bd4eb.entry.js +2 -0
  518. package/dist/md3/{p-72457a85.entry.js.map → p-3a4bd4eb.entry.js.map} +1 -1
  519. package/dist/md3/{p-be02624e.entry.js → p-3c0469aa.entry.js} +2 -2
  520. package/dist/md3/{p-63b8c8d1.entry.js → p-408ee4be.entry.js} +2 -2
  521. package/dist/md3/{p-3015c7e3.entry.js → p-4770b534.entry.js} +2 -2
  522. package/dist/md3/p-4aed552f.entry.js +2 -0
  523. package/dist/md3/{p-6c44cf13.entry.js.map → p-4aed552f.entry.js.map} +1 -1
  524. package/dist/md3/{p-c5af701b.entry.js → p-4ba3623e.entry.js} +2 -2
  525. package/dist/md3/{p-7b463fbe.entry.js → p-4f2e82cb.entry.js} +2 -2
  526. package/dist/md3/{p-be412e3f.entry.js → p-501bf161.entry.js} +2 -2
  527. package/dist/md3/{p-81843ff7.entry.js → p-5929e59c.entry.js} +2 -2
  528. package/dist/md3/{p-32bdd439.entry.js → p-5c35f916.entry.js} +2 -2
  529. package/dist/md3/{p-ac35ac5f.entry.js → p-5db87a9d.entry.js} +2 -2
  530. package/dist/md3/{p-6038b907.entry.js → p-5f39b49d.entry.js} +2 -2
  531. package/dist/md3/p-637baee1.entry.js +2 -0
  532. package/dist/md3/{p-47af9819.entry.js.map → p-637baee1.entry.js.map} +1 -1
  533. package/dist/md3/{p-05ae91b6.entry.js → p-6bf632c7.entry.js} +2 -2
  534. package/dist/md3/{p-4e3d6e40.entry.js → p-6ea7117d.entry.js} +2 -2
  535. package/dist/md3/{p-9ddbf247.entry.js → p-7112374d.entry.js} +2 -2
  536. package/dist/md3/{p-1a8ec5bc.entry.js → p-7858833e.entry.js} +2 -2
  537. package/dist/md3/p-7c8842bf.entry.js +2 -0
  538. package/dist/md3/{p-ba2ebde1.entry.js.map → p-7c8842bf.entry.js.map} +1 -1
  539. package/dist/md3/{p-4d82132d.entry.js → p-7f53a423.entry.js} +2 -2
  540. package/dist/md3/{p-b0431a5c.entry.js → p-8135c606.entry.js} +2 -2
  541. package/dist/md3/{p-4dda4cb0.entry.js → p-845ca9cc.entry.js} +2 -2
  542. package/dist/md3/{p-5b74694e.entry.js → p-89d47130.entry.js} +2 -2
  543. package/dist/md3/p-8a6fed13.entry.js +2 -0
  544. package/dist/md3/{p-a803da99.entry.js.map → p-8a6fed13.entry.js.map} +1 -1
  545. package/dist/md3/{p-e3124e1e.entry.js → p-8b1ea5dc.entry.js} +2 -2
  546. package/dist/md3/{p-c10a33c2.entry.js → p-8e7df348.entry.js} +2 -2
  547. package/dist/md3/{p-65195996.entry.js → p-925768ac.entry.js} +2 -2
  548. package/dist/md3/p-944e69e0.entry.js +2 -0
  549. package/dist/md3/{p-a3308c40.entry.js.map → p-944e69e0.entry.js.map} +1 -1
  550. package/dist/md3/{p-ac8762e5.entry.js → p-96c06b24.entry.js} +2 -2
  551. package/dist/md3/p-9b9677cc.entry.js +2 -0
  552. package/dist/md3/{p-e7dc5a32.entry.js.map → p-9b9677cc.entry.js.map} +1 -1
  553. package/dist/md3/p-Bz-JaJcA.js +2 -0
  554. package/dist/md3/p-Bz-JaJcA.js.map +1 -0
  555. package/dist/md3/p-CfBPnYW7.js +2 -0
  556. package/dist/md3/p-CfBPnYW7.js.map +1 -0
  557. package/dist/md3/p-DQuL1Twl.js +2 -0
  558. package/dist/md3/p-DQuL1Twl.js.map +1 -0
  559. package/dist/md3/p-WmvQpZnM.js +3 -0
  560. package/dist/md3/p-WmvQpZnM.js.map +1 -0
  561. package/dist/md3/p-a3623653.entry.js +2 -0
  562. package/dist/md3/{p-19ee9c33.entry.js.map → p-a3623653.entry.js.map} +1 -1
  563. package/dist/md3/{p-a5fee424.entry.js → p-a49df43d.entry.js} +2 -2
  564. package/dist/md3/{p-da4e27d4.entry.js → p-a4d4cfed.entry.js} +2 -2
  565. package/dist/md3/{p-5394254f.entry.js → p-a976498b.entry.js} +2 -2
  566. package/dist/md3/{p-bf7842f8.entry.js → p-adf8a415.entry.js} +2 -2
  567. package/dist/md3/{p-c861d774.entry.js → p-ae360663.entry.js} +2 -2
  568. package/dist/md3/{p-8eb0b6a4.entry.js → p-b243284b.entry.js} +2 -2
  569. package/dist/md3/{p-45280bf4.entry.js → p-b2d88292.entry.js} +2 -2
  570. package/dist/md3/{p-796f79f8.entry.js → p-b3b5247b.entry.js} +2 -2
  571. package/dist/md3/{p-5b799707.entry.js → p-b4266f6b.entry.js} +2 -2
  572. package/dist/md3/p-b5586b66.entry.js +2 -0
  573. package/dist/md3/{p-04e97f5d.entry.js.map → p-b5586b66.entry.js.map} +1 -1
  574. package/dist/md3/{p-a7ffb779.entry.js → p-b7602557.entry.js} +2 -2
  575. package/dist/md3/{p-6ba63c73.entry.js → p-bc24f0c9.entry.js} +2 -2
  576. package/dist/md3/{p-edb34a6d.entry.js → p-bed8dfec.entry.js} +2 -2
  577. package/dist/md3/{p-50555bb7.entry.js → p-c0476406.entry.js} +2 -2
  578. package/dist/md3/{p-0c2e824d.entry.js → p-c20fbb9e.entry.js} +2 -2
  579. package/dist/md3/{p-4e45b2ff.entry.js → p-c58c68d0.entry.js} +2 -2
  580. package/dist/md3/{p-fc0b325d.entry.js → p-cdcea99f.entry.js} +2 -2
  581. package/dist/md3/{p-0f764a1e.entry.js → p-d2e39c6e.entry.js} +2 -2
  582. package/dist/md3/p-d7e99f9e.entry.js +2 -0
  583. package/dist/md3/{p-cf07e761.entry.js.map → p-d7e99f9e.entry.js.map} +1 -1
  584. package/dist/md3/{p-c1ca6f6c.entry.js → p-da0c36d9.entry.js} +2 -2
  585. package/dist/md3/{p-77a01bcc.entry.js → p-e3c37222.entry.js} +2 -2
  586. package/dist/md3/{p-39cb7c24.entry.js → p-e6b09e71.entry.js} +2 -2
  587. package/dist/md3/{p-b4631a55.entry.js → p-eddae19a.entry.js} +2 -2
  588. package/dist/md3/{p-c6a12344.entry.js → p-ef7b1826.entry.js} +2 -2
  589. package/dist/md3/p-f1b69181.entry.js +2 -0
  590. package/dist/md3/{p-a986fd24.entry.js.map → p-f1b69181.entry.js.map} +1 -1
  591. package/dist/md3/{p-e6d7f0ff.entry.js → p-f403ad20.entry.js} +2 -2
  592. package/dist/md3/{p-708a9313.entry.js → p-f5fd9a0b.entry.js} +2 -2
  593. package/dist/md3/{p-aa0e7d4d.entry.js → p-f71af38f.entry.js} +2 -2
  594. package/dist/md3/{p-757e3aaf.entry.js → p-fac6da4c.entry.js} +2 -2
  595. package/dist/md3/{p-134b670a.entry.js → p-fc864f96.entry.js} +2 -2
  596. package/dist/types/wasm/engine-abi.d.ts +14 -0
  597. package/hydrate/index.js +19 -7
  598. package/hydrate/index.mjs +19 -7
  599. package/package.json +14 -3
  600. package/dist/cjs/index-DlQ_5_Mv.js.map +0 -1
  601. package/dist/cjs/virtual-select-controller-CqriaZgm.js.map +0 -1
  602. package/dist/components/p-BEWIC0pC.js +0 -2
  603. package/dist/components/p-BEWIC0pC.js.map +0 -1
  604. package/dist/components/p-MWBNn6Lj.js +0 -2
  605. package/dist/components/p-MWBNn6Lj.js.map +0 -1
  606. package/dist/esm/index-DTaX19_O.js.map +0 -1
  607. package/dist/esm/virtual-select-controller-BEWIC0pC.js.map +0 -1
  608. package/dist/md3/p-04e97f5d.entry.js +0 -2
  609. package/dist/md3/p-19ee9c33.entry.js +0 -2
  610. package/dist/md3/p-21772851.entry.js +0 -2
  611. package/dist/md3/p-47af9819.entry.js +0 -2
  612. package/dist/md3/p-6b2871a0.entry.js +0 -2
  613. package/dist/md3/p-6c44cf13.entry.js +0 -2
  614. package/dist/md3/p-72457a85.entry.js +0 -2
  615. package/dist/md3/p-BEWIC0pC.js +0 -2
  616. package/dist/md3/p-BEWIC0pC.js.map +0 -1
  617. package/dist/md3/p-DTaX19_O.js +0 -3
  618. package/dist/md3/p-DTaX19_O.js.map +0 -1
  619. package/dist/md3/p-a3308c40.entry.js +0 -2
  620. package/dist/md3/p-a803da99.entry.js +0 -2
  621. package/dist/md3/p-a986fd24.entry.js +0 -2
  622. package/dist/md3/p-aaec2698.entry.js +0 -2
  623. package/dist/md3/p-ba2ebde1.entry.js +0 -2
  624. package/dist/md3/p-cf07e761.entry.js +0 -2
  625. package/dist/md3/p-e7dc5a32.entry.js +0 -2
  626. package/dist/md3/p-f31ab454.entry.js +0 -2
  627. package/dist/md3/p-fb61868c.entry.js +0 -2
  628. /package/dist/{components/p-DXXUoRSH.js.map → components-csr/p--OUYjgKN.js.map} +0 -0
  629. /package/dist/{components/p-Dp-w93ot.js.map → components-csr/p--TCJgZnE.js.map} +0 -0
  630. /package/dist/{components/p-UdGDg2oJ.js.map → components-csr/p-Bmu7RqHM.js.map} +0 -0
  631. /package/dist/{components/p-uTEkf0sE.js.map → components-csr/p-C0DlKmRg.js.map} +0 -0
  632. /package/dist/{components/p-Ch2-tttM.js.map → components-csr/p-C4_7YnHT.js.map} +0 -0
  633. /package/dist/{components/p-BwXpiUsu.js.map → components-csr/p-CG6FaRlt.js.map} +0 -0
  634. /package/dist/{components/p-B0Opn6dK.js.map → components-csr/p-CSrxeWwL.js.map} +0 -0
  635. /package/dist/{components/p-B3MWYEEJ.js.map → components-csr/p-CrbzXk64.js.map} +0 -0
  636. /package/dist/{components/p-7fN_yCXW.js.map → components-csr/p-DF19mmLl.js.map} +0 -0
  637. /package/dist/{components/p-e2HRV63Y.js.map → components-csr/p-DfcpeJAu.js.map} +0 -0
  638. /package/dist/{components/p-C8EP4S21.js.map → components-csr/p-DvXQXhgu.js.map} +0 -0
  639. /package/dist/{components/p-stybaFzj.js.map → components-csr/p-Hm3X1iai.js.map} +0 -0
  640. /package/dist/{components/p-6wZSqm_2.js.map → components-csr/p-IWA0yIjJ.js.map} +0 -0
  641. /package/dist/{components/p-Ddiw2Kjw.js.map → components-csr/p-uZbtHo-A.js.map} +0 -0
  642. /package/dist/md3/{p-2e9503d7.entry.js.map → p-0a599351.entry.js.map} +0 -0
  643. /package/dist/md3/{p-396089fd.entry.js.map → p-1edb5a0d.entry.js.map} +0 -0
  644. /package/dist/md3/{p-c00f7514.entry.js.map → p-21c89d1d.entry.js.map} +0 -0
  645. /package/dist/md3/{p-2e09a7b7.entry.js.map → p-27135a6b.entry.js.map} +0 -0
  646. /package/dist/md3/{p-c063c823.entry.js.map → p-2befc42c.entry.js.map} +0 -0
  647. /package/dist/md3/{p-b34d385b.entry.js.map → p-35b05b45.entry.js.map} +0 -0
  648. /package/dist/md3/{p-c2dd8c8c.entry.js.map → p-38e9a583.entry.js.map} +0 -0
  649. /package/dist/md3/{p-3cce1de3.entry.js.map → p-38f82d34.entry.js.map} +0 -0
  650. /package/dist/md3/{p-be02624e.entry.js.map → p-3c0469aa.entry.js.map} +0 -0
  651. /package/dist/md3/{p-63b8c8d1.entry.js.map → p-408ee4be.entry.js.map} +0 -0
  652. /package/dist/md3/{p-3015c7e3.entry.js.map → p-4770b534.entry.js.map} +0 -0
  653. /package/dist/md3/{p-c5af701b.entry.js.map → p-4ba3623e.entry.js.map} +0 -0
  654. /package/dist/md3/{p-7b463fbe.entry.js.map → p-4f2e82cb.entry.js.map} +0 -0
  655. /package/dist/md3/{p-be412e3f.entry.js.map → p-501bf161.entry.js.map} +0 -0
  656. /package/dist/md3/{p-81843ff7.entry.js.map → p-5929e59c.entry.js.map} +0 -0
  657. /package/dist/md3/{p-32bdd439.entry.js.map → p-5c35f916.entry.js.map} +0 -0
  658. /package/dist/md3/{p-ac35ac5f.entry.js.map → p-5db87a9d.entry.js.map} +0 -0
  659. /package/dist/md3/{p-6038b907.entry.js.map → p-5f39b49d.entry.js.map} +0 -0
  660. /package/dist/md3/{p-05ae91b6.entry.js.map → p-6bf632c7.entry.js.map} +0 -0
  661. /package/dist/md3/{p-4e3d6e40.entry.js.map → p-6ea7117d.entry.js.map} +0 -0
  662. /package/dist/md3/{p-9ddbf247.entry.js.map → p-7112374d.entry.js.map} +0 -0
  663. /package/dist/md3/{p-1a8ec5bc.entry.js.map → p-7858833e.entry.js.map} +0 -0
  664. /package/dist/md3/{p-4d82132d.entry.js.map → p-7f53a423.entry.js.map} +0 -0
  665. /package/dist/md3/{p-b0431a5c.entry.js.map → p-8135c606.entry.js.map} +0 -0
  666. /package/dist/md3/{p-4dda4cb0.entry.js.map → p-845ca9cc.entry.js.map} +0 -0
  667. /package/dist/md3/{p-5b74694e.entry.js.map → p-89d47130.entry.js.map} +0 -0
  668. /package/dist/md3/{p-e3124e1e.entry.js.map → p-8b1ea5dc.entry.js.map} +0 -0
  669. /package/dist/md3/{p-c10a33c2.entry.js.map → p-8e7df348.entry.js.map} +0 -0
  670. /package/dist/md3/{p-65195996.entry.js.map → p-925768ac.entry.js.map} +0 -0
  671. /package/dist/md3/{p-ac8762e5.entry.js.map → p-96c06b24.entry.js.map} +0 -0
  672. /package/dist/md3/{p-a5fee424.entry.js.map → p-a49df43d.entry.js.map} +0 -0
  673. /package/dist/md3/{p-da4e27d4.entry.js.map → p-a4d4cfed.entry.js.map} +0 -0
  674. /package/dist/md3/{p-5394254f.entry.js.map → p-a976498b.entry.js.map} +0 -0
  675. /package/dist/md3/{p-bf7842f8.entry.js.map → p-adf8a415.entry.js.map} +0 -0
  676. /package/dist/md3/{p-c861d774.entry.js.map → p-ae360663.entry.js.map} +0 -0
  677. /package/dist/md3/{p-8eb0b6a4.entry.js.map → p-b243284b.entry.js.map} +0 -0
  678. /package/dist/md3/{p-45280bf4.entry.js.map → p-b2d88292.entry.js.map} +0 -0
  679. /package/dist/md3/{p-796f79f8.entry.js.map → p-b3b5247b.entry.js.map} +0 -0
  680. /package/dist/md3/{p-5b799707.entry.js.map → p-b4266f6b.entry.js.map} +0 -0
  681. /package/dist/md3/{p-a7ffb779.entry.js.map → p-b7602557.entry.js.map} +0 -0
  682. /package/dist/md3/{p-6ba63c73.entry.js.map → p-bc24f0c9.entry.js.map} +0 -0
  683. /package/dist/md3/{p-edb34a6d.entry.js.map → p-bed8dfec.entry.js.map} +0 -0
  684. /package/dist/md3/{p-50555bb7.entry.js.map → p-c0476406.entry.js.map} +0 -0
  685. /package/dist/md3/{p-0c2e824d.entry.js.map → p-c20fbb9e.entry.js.map} +0 -0
  686. /package/dist/md3/{p-4e45b2ff.entry.js.map → p-c58c68d0.entry.js.map} +0 -0
  687. /package/dist/md3/{p-fc0b325d.entry.js.map → p-cdcea99f.entry.js.map} +0 -0
  688. /package/dist/md3/{p-0f764a1e.entry.js.map → p-d2e39c6e.entry.js.map} +0 -0
  689. /package/dist/md3/{p-c1ca6f6c.entry.js.map → p-da0c36d9.entry.js.map} +0 -0
  690. /package/dist/md3/{p-77a01bcc.entry.js.map → p-e3c37222.entry.js.map} +0 -0
  691. /package/dist/md3/{p-39cb7c24.entry.js.map → p-e6b09e71.entry.js.map} +0 -0
  692. /package/dist/md3/{p-b4631a55.entry.js.map → p-eddae19a.entry.js.map} +0 -0
  693. /package/dist/md3/{p-c6a12344.entry.js.map → p-ef7b1826.entry.js.map} +0 -0
  694. /package/dist/md3/{p-e6d7f0ff.entry.js.map → p-f403ad20.entry.js.map} +0 -0
  695. /package/dist/md3/{p-708a9313.entry.js.map → p-f5fd9a0b.entry.js.map} +0 -0
  696. /package/dist/md3/{p-aa0e7d4d.entry.js.map → p-f71af38f.entry.js.map} +0 -0
  697. /package/dist/md3/{p-757e3aaf.entry.js.map → p-fac6da4c.entry.js.map} +0 -0
  698. /package/dist/md3/{p-134b670a.entry.js.map → p-fc864f96.entry.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{p as t,H as e,c as s,h as i,d as n,t as o}from"./p-bSpXNc5J.js";import{N as a,B as r,O as h,P as c,w as l,f as d,g as p,h as u,s as f,l as m,n as y,Q as g,x as b,R as x,S as v,T as M,U as A,a as _,V as k,W as C,b as w,p as P}from"./p-DvOKnoqK.js";import{d as z}from"./p-DfcpeJAu.js";import{b as F,a as R}from"./p-C_ogF68H.js";function S(t,e){return{from:a(t,e.surface,.3),to:t}}function L(t,e,s){const i=t+e;const n=Math.min(t,i);const o=Math.max(t,i);const a=[];const r=[];for(const t of[n,o]){for(const e of[1,s]){a.push(Math.cos(t)*e);r.push(Math.sin(t)*e)}}const h=Math.PI/2;for(let t=Math.ceil(n/h);t*h<=o;t++){a.push(Math.cos(t*h));r.push(Math.sin(t*h))}return{x0:Math.min(...a),x1:Math.max(...a),y0:Math.min(...r),y1:Math.max(...r)}}function $(t,e,s){return I(t,e,s)||I(t,s,e)}function I(t,e,s){let i=s;let n=0;while(i>=0&&n++<32){if(i===e)return true;i=t[i]?.parent??-1}return false}function D(t,e,s){const i=e.labelMode??s;const n=e.valueFormatter(t.value);if(i==="name")return t.label;if(i==="both")return`${t.label} · ${n}`;return n}const E=12;const q=.52;const j=1.45;const H=.12;const B=.02;const T=7;const V=3;const N=T+V;const O=3;const U=.45;const W=Math.PI/180;function K(t,e){return t.length*e*.58}function J(t){const[e,s,i]=h(t);const n=.299*e+.587*s+.114*i;return n>.62?"rgba(0, 0, 0, 0.82)":"#ffffff"}function G(t,e){if(typeof t==="number")return Number.isFinite(t)&&t>=0?t:0;const s=t.trim();const i=parseFloat(s);if(!Number.isFinite(i)||i<0)return 0;return s.endsWith("%")?i/100*e:i}function Q(t,e,s,i){const n=t.data.map(((t,e)=>({d:t,i:e}))).filter((t=>!t.d.hidden&&t.d.value>0&&(t.d.level??0)===0));const o=n.reduce(((t,e)=>t+e.d.value),0);const h=t.data.reduce(((t,e)=>Math.max(t,(e.level??0)+1)),1);const l=t.title?e.titleSize+12+(t.subtitle?e.labelSize+4:0):0;const d=t.legend&&t.legend!=="none"&&t.data.length>1?t.legend:null;const p=d?Math.max(0,...t.data.map((t=>K(t.label,e.labelSize)))):0;let u=8;let f=8;let m=8+l;let y=8;if(d){const i=d==="left"||d==="right";if(i){const e=t.legendExtent!=null?t.legendExtent+16:p+30;const i=Math.min(e,s*c);if(d==="left")u+=i;else f+=i}else{let i=t.legendExtent!=null?t.legendExtent+8:0;if(t.legendExtent==null){const n=Math.max(60,s*.86);let o=1;let a=0;for(const s of t.data){const t=K(s.label,e.labelSize)+28;if(a>0&&a+t>n){o++;a=t}else a+=t}i=o*(e.labelSize+8)+6}if(d.startsWith("bottom"))y+=i;else m+=i}}const g={x:u,y:m,width:Math.max(1,s-u-f),height:Math.max(1,i-m-y)};const b=-t.startAngleDeg*W;const x=-(t.endAngleDeg-t.startAngleDeg)*W;const v=(()=>{const e=G(t.innerRadius,100);const s=G(t.outerRadius,100);return s>0?Math.max(0,Math.min(.95,e/s)):0})();const M=Math.abs(x)<Math.PI*2-.02;const A=M?L(b,x,v):{x0:-1,x1:1,y0:-1,y1:1};const _=Math.max(1,Math.min(g.width/Math.max(.01,A.x1-A.x0),g.height/Math.max(.01,A.y1-A.y0)));const k=g.x+g.width/2-(A.x0+A.x1)/2*_;const C=g.y+g.height/2-(A.y0+A.y1)/2*_;const w=(()=>{if(!t.showLabels||d)return 6;const s=n.reduce(((e,s)=>Math.max(e,D(s.d,t,"both").length)),0);const i=G(t.outerRadius,_);const o=12+s*e.labelSize*q;const a=Math.max(.05,i/Math.max(1,_));return Math.max(6,Math.min(_*.45,(i+o-_)/a))})();const P=Math.max(8,_-w);const z=Math.max(1,Math.min(G(t.outerRadius,P),P));const F=Math.max(0,Math.min(G(t.innerRadius,P),z-2));const R=Array.from({length:h},((e,s)=>{const i=t.ringWidths?.[s];return Number.isFinite(i)&&i>0?i:s<h-1?j:1}));const I=R.reduce(((t,e)=>t+e),0)||1;const Q=z-F;const X=h>1?Math.min(O,Q/h*.3):0;const Y=Math.max(1,Q-X*(h-1));const Z=t=>Y*R[t]/I;const tt=(()=>{const t=[];let e=F;for(let s=0;s<h;s++){t.push(e);e+=Z(s)+(s<h-1?X:0)}return t})();const et=t=>tt[t]??F;const st=t=>et(t)+Z(t);const it=new Map;const nt=new Set;for(const e of t.data)if(e.parent!=null&&e.parent>=0)nt.add(e.parent);const ot=(e,s)=>{const i=nt.has(s)?st(e):z;const n=t.data[s]?.radius;if(n==null)return i;const o=et(e);return o+(i-o)*Math.max(.15,Math.min(1,n))};const at=x>=0?1:-1;const rt=n.length?Math.min(t.paddingAngleDeg*W*n.length,Math.abs(x)*.9):0;const ht=n.length?rt/n.length:0;const ct=x-at*rt;const lt=[];const dt=[];const pt=[];const ut=[];let ft=b;const mt=t.sliceStroke??e.surface;const yt=n.length>1?t.sliceStrokeWidth??1:0;const gt=(()=>{if(F>0||yt<=0||n.length<2)return 0;const e=yt/2;const s=n.reduce(((t,e)=>t+Math.max(0,e.d.value)),0)||1;const i=Math.abs(-(t.endAngleDeg-t.startAngleDeg)*W);let o=0;for(const t of n){const n=Math.max(0,t.d.value)/s*i;if(n>.001)o=Math.max(o,e/Math.sin(Math.min(n,Math.PI)/2))}return Math.min(o,z*.04,4)})();const bt=[];const xt=(t,e,s,i,n,o)=>{const a=T*Mt;const r=V*Mt;const h=s+r+a/2;const c=(h>0?a/2/h:0)*vt;bt.push({cx:t,cy:e,innerR:s+r,outerR:s+r+a,startAngle:i+c,endAngle:n-c,color:o,dataIndex:-1,pill:true})};const vt=at;const Mt=Math.max(0,Math.min(1,t.highlightT??1));const At=t.highlight!=="none"&&t.highlightIndex!=null&&t.highlightIndex>=0;const _t=[];{let t=0;for(const{d:e}of n){const s=o>0?e.value/o:0;_t.push(t+s/2);t+=s}}const kt=n.findIndex((e=>e.i===t.highlightIndex));const Ct=At?t.data[t.highlightIndex??-1]?.level??0:Infinity;const wt=t=>{if(kt<0)return Mt;const e=Math.abs(_t[t]-_t[kt]);const s=Math.min(e,1-e)*2;const i=s*U;return Math.max(0,Math.min(1,(Mt-i)/(1-i||1)))};const Pt=new Map;n.forEach((({d:s,i},n)=>{const r=wt(n);const c=o>0?s.value/o:0;const l=ct*c;const p=ft+at*ht/2;const u=p+l;ft=u+at*ht/2;const f=(p+u)/2;const m=At&&(t.highlightIndex===i||t.highlight==="series");const y=At&&$(t.data,i,t.highlightIndex??-1);const g=(s.selectT??(s.selected?1:0))*E;const b=k+Math.cos(f)*g;const x=C+Math.sin(f)*g;Pt.set(i,{x:b-k,y:x-C});const v=At&&!m&&!y&&r>0?a(s.color,e.surface,.62*r):s.color;if(m&&Mt>0)xt(b,x,ot(0,i),p,u,s.color);lt.push({cx:b,cy:x,innerR:Math.max(et(0),gt),outerR:ot(0,i),startAngle:p,endAngle:u,color:v,dataIndex:i,cornerRadius:t.cornerRadius,gap:yt,gapColor:mt,gradient:t.gradient?S(s.color,e):undefined});it.set(i,{a0:p,a1:u});const M=!!d||h>1;if(t.showLabels&&Math.abs(l)>(M?H:B)){if(M){const n=et(0);const o=ot(0,i);const a=n>0?(n+o)/2:o*.62;dt.push({x:b+Math.cos(f)*a,y:x+Math.sin(f)*a,text:D(s,t,h>1?"name":"value"),color:J(v),fontSize:e.labelSize,align:"center",baseline:"middle",key:`pl-${i}`})}else{ut.push({key:`pl-${i}`,text:D(s,t,"both"),x1:b+Math.cos(f)*ot(0,i),y1:x+Math.sin(f)*ot(0,i),x:b+Math.cos(f)*(z+12),y:x+Math.sin(f)*(z+12),right:Math.cos(f)>=0})}}}));for(let s=1;s<h;s++){const i=t.data.map(((t,e)=>({d:t,i:e}))).filter((t=>(t.d.level??0)===s&&!t.d.hidden));const n=new Map;for(const t of i){const e=t.d.parent??-1;if(!n.has(e))n.set(e,[]);n.get(e).push(t)}for(const[i,o]of n){const n=it.get(i);if(!n)continue;const r=o.reduce(((t,e)=>t+Math.max(0,e.d.value)),0);if(r<=0)continue;const c=n.a1-n.a0;let l=n.a0;for(const{d:n,i:d}of o){const o=l;const p=o+c*(Math.max(0,n.value)/r);l=p;it.set(d,{a0:o,a1:p});const u=s>Ct?N*Mt:0;const f=et(s)+u;const m=ot(s,d)+u;const y=kt<0||t.highlightIndex===d||$(t.data,d,t.highlightIndex??-1);const g=(n.selectT??(n.selected?1:0))*E;const b=(o+p)/2;const x=Pt.get(i)??{x:0,y:0};const v=x.x+Math.cos(b)*g;const M=x.y+Math.sin(b)*g;Pt.set(d,{x:v,y:M});lt.push({cx:k+v,cy:C+M,innerR:f,outerR:m,startAngle:o,endAngle:p,color:At&&!y&&Mt>0?a(n.color,e.surface,.62*Mt):n.color,dataIndex:d,cornerRadius:t.cornerRadius,gap:yt,gapColor:mt,gradient:t.gradient?S(n.color,e):undefined});if(At&&t.highlightIndex===d&&Mt>0){xt(k+v,C+M,m,o,p,n.color)}const A=(o+p)/2;if(t.showLabels&&Math.abs(p-o)>B&&s===h-1){ut.push({key:`pl-${d}`,text:D(n,t,"both"),x1:k+v+Math.cos(A)*m,y1:C+M+Math.sin(A)*m,x:k+v+Math.cos(A)*(m+12),y:C+M+Math.sin(A)*(m+12),right:Math.cos(A)>=0})}}}}if(ut.length){const t=e.labelSize*1.45;for(const e of[true,false]){const s=ut.filter((t=>t.right===e)).sort(((t,e)=>t.y-e.y));if(!s.length)continue;for(let e=1;e<s.length;e++){if(s[e].y-s[e-1].y<t)s[e].y=s[e-1].y+t}const n=s[s.length-1].y-(i-t/2);if(n>0)for(const t of s)t.y-=n;const o=t/2-s[0].y;if(o>0)for(const t of s)t.y+=o}for(const t of ut){const i=t.right?s-6-t.x:t.x-6;const n=Math.max(3,Math.floor(i/(e.labelSize*q)));const o=t.text.length>n?`${t.text.slice(0,n-1)}…`:t.text;pt.push({x1:t.x1,y1:t.y1,x2:t.x,y2:t.y,color:e.gridLineColor,width:1});dt.push({x:t.x+(t.right?3:-3),y:t.y,text:o,color:e.textColorMuted,fontSize:e.labelSize,align:t.right?"start":"end",baseline:"middle",key:t.key})}}lt.push(...bt);if(t.title){const i=r(t.titleAlign,12,s-24);dt.push({x:i.x,y:6,text:t.title,color:e.textColor,fontSize:e.titleSize,fontWeight:600,align:i.align,baseline:"top",key:"title"});if(t.subtitle){dt.push({x:i.x,y:6+e.titleSize+4,text:t.subtitle,color:e.textColorMuted,fontSize:e.labelSize,align:i.align,baseline:"top",key:"subtitle"})}}const zt=d?t.data.map(((t,e)=>({label:t.label,color:t.color,seriesIndex:e,hidden:!!t.hidden,x:0,y:0}))):[];return{width:s,height:i,plot:g,background:e.background==="transparent"?undefined:e.background,gridlines:pt,axisLines:[],areas:[],bars:[],slices:lt,lines:[],markers:[],texts:dt,legend:zt,legendPosition:d??undefined,pieCenter:{x:k,y:C},...(()=>{const t=M?L(b,x,0):{x0:-1,x1:1,y0:-1,y1:1};const e=F/Math.SQRT2;return{pieHoleSize:F>0?(t.x1-t.x0)*e:0,pieHoleHeight:F>0?(t.y1-t.y0)*e:0,pieCenterSlot:{x:k+(t.x0+t.x1)/2*e,y:C+(t.y0+t.y1)/2*e}}})(),xPositions:[],xValues:[],xLabels:[],hoverPoints:[]}}const X=260;const Y=520;const Z=450;const tt=.16;const et=300;const st=.8;class it{constructor(t){this.container=t;this.ctx=null;this.spec=null;this.theme=null;this.scene=null;this.cb={};this.hoverRaf=0;this.hoverIndex=-1;this.hasRendered=false;this.introRaf=0;this.pendingDrill=null;this.drillRun=null;this.ripple=null;this.rippleRaf=0;this.dpr=1;this.selectRaf=0;this.lastW=0;this.lastH=0;this.dprWatch=l((()=>this.render()));this.hoverT=0;this.hoverTweenRaf=0;this.handlePointerMove=t=>{if(!this.scene)return;const e=this.canvas.getBoundingClientRect();const s=t.clientX-e.left;const i=t.clientY-e.top;if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.hoverRaf=requestAnimationFrame((()=>{this.hoverRaf=0;const t=this.sliceAt(s,i);const e=t?t.dataIndex:-1;this.canvas.style.cursor=t?"pointer":"";if(e!==this.hoverIndex){this.hoverIndex=e;this.tweenHover();this.cb.onHover?.(e)}this.renderTooltip(e,s,i)}))};this.handlePointerLeave=()=>{if(this.hoverRaf){cancelAnimationFrame(this.hoverRaf);this.hoverRaf=0}this.hoverLayer.textContent="";if(this.hoverIndex!==-1){this.hoverIndex=-1;this.canvas.style.cursor="";this.tweenHover();this.cb.onHover?.(-1)}};this.handlePointerDown=t=>{const e=this.canvas.getBoundingClientRect();const s=t.clientX-e.left;const i=t.clientY-e.top;const n=this.sliceAt(s,i);if(n)this.startRipple(s,i,n)};this.handleClick=t=>{const e=this.canvas.getBoundingClientRect();const s=this.sliceAt(t.clientX-e.left,t.clientY-e.top);if(!s)return;this.cb.onPointClick?.(0,s.dataIndex,t);this.toggleSelected(s.dataIndex)};this.onLegendToggle=t=>{if(this.spec){const e=this.spec.data[t.seriesIndex];if(e){e.hidden=!e.hidden;this.hasRendered=false;this.render();this.cb.onLegendClick?.({...t,hidden:!!e.hidden});return}}this.cb.onLegendClick?.(t)};if(getComputedStyle(t).position==="static")t.style.position="relative";this.canvas=document.createElement("canvas");this.canvas.style.cssText="position:absolute;inset:0;width:100%;height:100%;display:block";this.canvas.setAttribute("part","plot-canvas");this.overlay=document.createElement("div");this.overlay.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";this.legendLayer=document.createElement("div");this.legendLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:visible";this.hoverLayer=document.createElement("div");this.hoverLayer.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden";t.append(this.canvas,this.overlay,this.legendLayer,this.hoverLayer);this.ctx=this.canvas.getContext("2d");this.canvas.addEventListener("pointermove",this.handlePointerMove);this.canvas.addEventListener("pointerleave",this.handlePointerLeave);this.canvas.addEventListener("click",this.handleClick);this.canvas.addEventListener("pointerdown",this.handlePointerDown)}getScene(){return this.scene}getHoleBox(){return{width:this.scene?.pieHoleSize??0,height:this.scene?.pieHoleHeight??0}}getCenter(){if(!this.scene)return null;const t=this.scene.pieCenterSlot;if(t)return{x:t.x,y:t.y};return{x:this.scene.plot.x+this.scene.plot.width/2,y:this.scene.plot.y+this.scene.plot.height/2}}setTooltip(t){this.tooltipRender=t.render}setSpec(t,e,s={}){const i=this.spec?.data;const n=!i||i.length!==t.data.length||i.some(((e,s)=>e.label!==t.data[s]?.label||e.value!==t.data[s]?.value));this.spec=t;this.theme=e;this.cb=s;if(n&&this.hoverIndex!==-1){this.hoverIndex=-1;this.spec.highlightIndex=-1;d(this.hoverLayer)}this.render()}resize(){const t=this.container.getBoundingClientRect();if(Math.round(t.width)===this.lastW&&Math.round(t.height)===this.lastH)return;this.render()}toDataURL(t="image/png"){return this.canvas.toDataURL(t)}dispose(){if(this.hoverRaf)cancelAnimationFrame(this.hoverRaf);this.stopIntro();cancelAnimationFrame(this.hoverTweenRaf);cancelAnimationFrame(this.rippleRaf);cancelAnimationFrame(this.selectRaf);cancelAnimationFrame(this.selectRaf);this.canvas.removeEventListener("pointermove",this.handlePointerMove);this.canvas.removeEventListener("pointerleave",this.handlePointerLeave);this.canvas.removeEventListener("click",this.handleClick);this.canvas.removeEventListener("pointerdown",this.handlePointerDown);this.dprWatch.dispose();this.canvas.remove();this.overlay.remove();this.hoverLayer.remove();this.spec=null;this.scene=null;this.drillRun=null}render(){if(!this.spec||!this.theme)return;this.dprWatch.update();const t=this.container.getBoundingClientRect();const e=Math.round(t.width);const s=Math.round(t.height);if(e<2||s<2)return;this.lastW=e;this.lastH=s;const i=Math.min(window.devicePixelRatio||1,4);this.dpr=i;this.canvas.width=e*i;this.canvas.height=s*i;this.spec.highlightIndex=this.hoverIndex;this.spec.highlightT=this.hoverT;this.layoutAndOverlay(e,s);const n=this.overlay.querySelector('[part="legend"]');if(n&&this.spec.legend&&this.spec.legend!=="none"){const t=this.spec.legend==="left"||this.spec.legend==="right";const i=t?n.offsetWidth:n.offsetHeight;if(i>0&&Math.abs((this.spec.legendExtent??-1)-i)>2){this.spec.legendExtent=i;this.layoutAndOverlay(e,s)}}if(!this.scene)return;const{variant:o,duration:a}=u(this.spec);const r=this.pendingDrill;this.pendingDrill=null;if(r?.leaving&&o!=="none"&&!p()){this.hasRendered=true;this.playDrill(i,r.index,r.up,r.leaving);return}if(this.drillRun){this.hasRendered=true;this.clearIntroOpacity();this.drillFrame(i);return}const h=!this.hasRendered&&o!=="none"&&!p();const c=this.scene.slices.length>0;if(h){this.hasRendered=c;this.playIntro(i,o,a);return}this.hasRendered=this.hasRendered||c;this.stopIntro();this.drawGeometry(this.scene,i)}clearIntroOpacity(){this.canvas.style.opacity="";for(const t of Array.from(this.overlay.querySelectorAll('[data-key^="pl-"]'))){t.style.transition="";t.style.opacity=""}}stopIntro(){cancelAnimationFrame(this.introRaf);this.introRaf=0;this.clearIntroOpacity()}drill(t,e="down"){this.pendingDrill=this.scene?{index:t,up:e==="up",leaving:this.scene}:null}replay(){this.hasRendered=false;this.render()}layoutAndOverlay(t,e){if(!this.spec||!this.theme)return;this.scene=Q(this.spec,this.theme,t,e);f(this.overlay,this.scene,this.theme.fontFamily,{onLegendClick:this.onLegendToggle},false,this.legendLayer)}drawGeometry(t,e){if(this.ctx){this.ctx.setTransform(e,0,0,e,0,0);m(this.ctx,t)}}paceLabels(t){for(const e of Array.from(this.overlay.querySelectorAll('[data-key^="pl-"]'))){e.style.transition="opacity 180ms ease";e.style.opacity=t>=st?"":"0"}}playIntro(t,e,s){const i=this.scene;if(!i)return;this.stopIntro();const n=t=>{this.canvas.style.opacity=t<1?String(t):""};n(y(e,i,0).alpha);this.paceLabels(0);let o=0;const a=r=>{if(!o)o=r;const h=(r-o)/s;if(h>=1){n(1);this.paceLabels(1);this.drawGeometry(i,t);return}this.paceLabels(h);const{scene:c,alpha:l}=y(e,i,h);n(l);this.drawGeometry(c,t);this.introRaf=requestAnimationFrame(a)};this.introRaf=requestAnimationFrame(a)}playDrill(t,e,s,i){if(!this.scene)return;this.stopIntro();this.drillRun={index:e,up:s,frozen:i,start:performance.now()};const n=()=>{if(!this.drillRun)return;if(this.drillFrame(t))return;this.introRaf=requestAnimationFrame(n)};n()}drillFrame(t){const e=this.drillRun;const s=this.scene;if(!e||!s)return true;const i=(performance.now()-e.start)/Y;if(i>=1){this.drillRun=null;this.paceLabels(1);this.drawGeometry(s,t);return true}this.paceLabels(i);const n=t=>{const e=t.slices?.find((t=>t.dataIndex>=0))??t.slices?.[0];return e?{x:e.cx,y:e.cy}:null};const o=(t,e,s)=>!e&&!s?t:{...t,slices:(t.slices??[]).map((t=>({...t,cx:t.cx+e,cy:t.cy+s})))};const a=n(s);const r=n(e.frozen);const h=a&&r?o(e.frozen,a.x-r.x,a.y-r.y):e.frozen;const c=e.up?s:h;const l=e.up?h:s;const d=A(i);const p=g(c,l,e.index,e.up?1-d:d);if(!p)return true;if(!this.ctx)return false;this.ctx.setTransform(t,0,0,t,0,0);m(this.ctx,this.withRipple(p.base));this.ctx.globalAlpha=p.overAlpha;m(this.ctx,p.over,false);this.ctx.globalAlpha=1;return false}sliceAt(t,e){if(!this.scene)return null;for(const s of this.scene.slices){if(nt(t,e,s,s.cx,s.cy))return s}return null}focusIndex(t){if(!this.scene)return;if(t<0){this.hoverLayer.textContent="";if(this.hoverIndex!==-1){this.hoverIndex=-1;this.tweenHover()}return}const e=this.scene.slices.find((e=>e.dataIndex===t));if(!e)return;if(this.hoverIndex!==t){this.hoverIndex=t;this.tweenHover()}const s=(e.startAngle+e.endAngle)/2;const i=(e.innerR+e.outerR)/2;this.renderTooltip(t,e.cx+Math.cos(s)*i,e.cy+Math.sin(s)*i)}tweenHover(){const t=this.hoverIndex>=0?1:0;if(p()){this.hoverT=t;this.render();return}cancelAnimationFrame(this.hoverTweenRaf);const e=this.hoverT;if(e===t){this.render();return}const s=performance.now();const i=n=>{const o=Math.min(1,(n-s)/X);this.hoverT=e+(t-e)*M(o);this.render();if(o<1)this.hoverTweenRaf=requestAnimationFrame(i)};this.hoverTweenRaf=requestAnimationFrame(i)}activate(t){const e=this.scene?.slices.find((e=>!e.pill&&e.dataIndex===t));if(!e)return;const s=(e.startAngle+e.endAngle)/2;const i=(e.innerR+e.outerR)/2;this.startRipple(e.cx+Math.cos(s)*i,e.cy+Math.sin(s)*i,e);this.toggleSelected(t)}startRipple(t,e,s){if(p())return;const i=[s.startAngle,s.endAngle].flatMap((i=>[s.innerR,s.outerR].map((n=>Math.hypot(s.cx+Math.cos(i)*n-t,s.cy+Math.sin(i)*n-e)))));this.ripple={dataIndex:s.dataIndex,x:t,y:e,max:Math.max(...i,1),color:b(s.color),start:performance.now()};cancelAnimationFrame(this.rippleRaf);const n=()=>{if(!this.ripple)return;if((performance.now()-this.ripple.start)/Z>=1){this.ripple=null;if(!this.drillRun&&this.scene)this.drawGeometry(this.scene,this.dpr);return}if(!this.drillRun&&this.scene)this.drawGeometry(this.withRipple(this.scene),this.dpr);this.rippleRaf=requestAnimationFrame(n)};this.rippleRaf=requestAnimationFrame(n)}withRipple(t){const e=this.ripple;if(!e)return t;const s=Math.min(1,(performance.now()-e.start)/Z);return{...t,ripple:{dataIndex:e.dataIndex,x:e.x,y:e.y,radius:e.max*x(s),color:e.color,alpha:tt*(1-Math.max(0,(s-.35)/.65))}}}toggleSelected(t){const e=this.spec?.data;if(!e?.[t])return;const s=e.map((t=>t.selectT??(t.selected?1:0)));const i=!!e[t].selected;e.forEach(((e,s)=>{e.selected=s===t&&!i}));const n=e.map((t=>t.selected?1:0));if(s.every(((t,e)=>t===n[e])))return;if(p()){e.forEach(((t,e)=>t.selectT=n[e]));this.render();return}cancelAnimationFrame(this.selectRaf);const o=performance.now();const a=t=>{const i=Math.min(1,(t-o)/et);const r=M(i);e.forEach(((t,e)=>{t.selectT=s[e]+(n[e]-s[e])*r}));this.render();if(i<1)this.selectRaf=requestAnimationFrame(a)};this.selectRaf=requestAnimationFrame(a)}renderTooltip(t,e,s){this.hoverLayer.textContent="";if(t<0||!this.spec||!this.theme||!this.scene)return;const i=this.spec.data[t];if(!i)return;const n=this.spec.data.reduce(((t,e)=>e.hidden||e.level!==i.level||e.parent!==i.parent?t:t+e.value),0);const o=n>0?i.value/n*100:0;const a=document.createElement("div");a.setAttribute("part","tooltip");a.style.cssText=["position:absolute","pointer-events:none","background:var(--md-sys-color-surface-container-high, #ECE6F0)","color:var(--md-sys-color-on-surface, #1C1B1F)","border-radius:8px","padding:8px 10px","box-shadow:0 2px 6px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.2)",`font:400 ${this.theme.labelSize}px ${this.theme.fontFamily}`,"white-space:nowrap","z-index:2"].join(";");if(this.tooltipRender){const o=n;const r=this.tooltipRender({dataIndex:t,axisValue:i.label,axisLabel:i.label,focusedSeriesIndex:t,missing:[],series:this.spec.data.map(((e,s)=>({seriesIndex:s,label:e.label,color:e.color,value:e.value,formattedValue:this.spec.valueFormatter(e.value),percent:o>0?e.value/o*100:0,focused:s===t,missing:false})))});if(r!=null){v(a,r);this.hoverLayer.appendChild(a);this.placeTooltip(a,e,s)}return}const r=document.createElement("div");r.style.cssText="display:flex;align-items:center;gap:8px;line-height:1.5";const h=document.createElement("span");h.style.cssText=`width:10px;height:10px;border-radius:3px;background:${i.color};flex:none`;const c=document.createElement("span");c.textContent=i.label;c.style.cssText="flex:1";const l=document.createElement("strong");l.textContent=`${this.spec.valueFormatter(i.value)} (${o.toFixed(1)}%)`;r.append(h,c,l);a.appendChild(r);this.hoverLayer.appendChild(a);this.placeTooltip(a,e,s)}placeTooltip(t,e,s){if(!this.scene)return;const i=t.offsetWidth||120;const n=t.offsetHeight||40;let o=e+14;if(o+i>this.scene.width-4)o=e-i-14;const a=Math.max(4,Math.min(s-n/2,this.scene.height-n-4));t.style.left=`${Math.max(4,o)}px`;t.style.top=`${a}px`}}function nt(t,e,s,i,n){const o=t-i;const a=e-n;const r=Math.hypot(o,a);if(r<s.innerR||r>s.outerR)return false;const h=Math.min(s.startAngle,s.endAngle);const c=Math.max(s.startAngle,s.endAngle);const l=Math.PI*2;let d=(Math.atan2(a,o)-h)%l;if(d<0)d+=l;return d<=c-h}const ot=()=>`:host{--_block-size:var(--md-pie-chart-block-size, auto);--_min-block-size:var(--md-pie-chart-min-block-size, max(140px, calc(200px + var(--md-sys-density-scale, 0) * 12px)));--_aspect-ratio:var(--md-pie-chart-aspect-ratio, 1 / 1);--_background:var(--md-pie-chart-background, var(--md-sys-color-surface-container-low, #F7F2FA));--_padding:var(--md-pie-chart-padding, max(8px, calc(16px + var(--md-sys-density-scale, 0) * 2px)));--_shape:var(--md-pie-chart-shape, max(8px, calc(16px + var(--md-sys-density-scale, 0) * 2px)));--_empty-color:var(--md-pie-chart-empty-color, var(--md-sys-color-on-surface-variant, #49454F));--_empty-background:var(--md-pie-chart-empty-background, var(--_background));--_empty-font:var(--md-pie-chart-empty-font, var(--md-sys-typescale-body-medium-font-family, Roboto, sans-serif));--_empty-font-size:var(--md-pie-chart-empty-font-size, var(--md-sys-typescale-body-medium-font-size, 14px));--_empty-icon-size:var(--md-pie-chart-empty-icon-size, 40px);--_center-color:var(--md-pie-chart-center-color, var(--md-sys-color-on-surface, #1C1B1F));display:block;position:relative;inline-size:100%;block-size:var(--_block-size);min-block-size:var(--_min-block-size);background:var(--_background);padding:var(--_padding);border-radius:var(--_shape);box-sizing:border-box;aspect-ratio:var(--_aspect-ratio)}.md-pie-chart__header,.md-pie-chart__footer{display:contents}.md-pie-chart__header>slot[name='header']::slotted(*),.md-pie-chart__footer>slot[name='footer']::slotted(*){display:block;margin-block:8px}.md-pie-chart__canvas{position:absolute;inset:var(--_padding);min-block-size:0;min-inline-size:0}.md-pie-chart__center{position:absolute;top:var(--_pie-center-y, 50%);left:var(--_pie-center-x, 50%);transform:translate(-50%, -50%);pointer-events:none;color:var(--_center-color);text-align:center;font-family:var(--md-sys-typescale-headline-small-font-family, Roboto, system-ui, sans-serif);font-variant-numeric:tabular-nums;display:flex;align-items:center;justify-content:center;max-width:var(--md-pie-center-max-width, var(--_pie-hole, none));max-height:var(--md-pie-center-max-height, var(--_pie-hole-h, none))}.md-pie-chart__center>slot[name='center']::slotted(*){pointer-events:auto}.md-pie-chart__empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;box-sizing:border-box;padding:24px;background:var(--_empty-background);border-radius:var(--_shape);color:var(--_empty-color);font-family:var(--_empty-font);font-size:var(--_empty-font-size);line-height:var(--md-sys-typescale-body-medium-line-height, 20px);pointer-events:none;text-align:center}.md-pie-chart__empty ::slotted(.material-symbols-outlined),.md-pie-chart__empty ::slotted(.material-symbols-rounded),.md-pie-chart__empty ::slotted(.material-symbols-sharp),.md-pie-chart__empty ::slotted(.material-icons){font-size:var(--_empty-icon-size) !important;line-height:1;opacity:0.55}.md-pie-chart__a11y-table{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}@media (forced-colors: active){:host{forced-color-adjust:auto}}.md-pie-chart__loading{position:absolute;inset:0;z-index:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;box-sizing:border-box;padding:24px;background:var(--_empty-background, var(--_background));border-radius:var(--_shape);color:var(--_empty-color);text-align:center}.md-pie-chart__spinner{inline-size:40px;block-size:40px}.md-pie-chart__canvas:focus-visible{outline:3px solid var(--md-sys-color-secondary, #625B71);outline-offset:-3px;border-radius:4px}.md-pie-chart__live{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}[part='legend'] button:focus-visible{outline:3px solid var(--md-sys-color-secondary, #625B71);outline-offset:2px;border-radius:6px}:host([density='-1']){--md-sys-density-scale:-1}:host([density='-2']){--md-sys-density-scale:-2}:host([density='-3']){--md-sys-density-scale:-3}:host([density='-4']){--md-sys-density-scale:-4}`;function at(t,e){if(t.includes(e))return t;for(const s of t){if(s.children?.length){const t=at(s.children,e);if(t)return t}}return null}const rt=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.__attachShadow();this.mdSliceClick=s(this,"mdSliceClick",7);this.mdLegendClick=s(this,"mdLegendClick",7);this.mdReady=s(this,"mdReady",7);this.label="";this.titleAlign="start";this.data=[];this.innerRadius="0%";this.outerRadius="75%";this.startAngle=90;this.endAngle=-270;this.paddingAngle=0;this.cornerRadius=4;this.showLabels=true;this.gradient=false;this.highlight="slice";this.legend="right";this.tooltip="item";this.locale="";this.summary="";this.labelEmpty="No data to display";this.loading=false;this.loadingLabel="Loading chart…";this.labelPlot="Chart data. Use the arrow keys to move between slices, Home and End for the first and last, Escape to leave.";this.labelPoint="%label%: %value% (%percent%)";this.noAnimation=false;this.animation="expressive";this.density=0;this.mounted=false;this.kbIndex=-1;this.announcement="";this.engine=null;this.ro=null;this.legendHidden=new Map;this.bindChartHost=t=>{this.chartHost=t};this.bindA11yTableHost=t=>{this.a11yTableHost=t};this.onPlotKeyDown=t=>{const e=this.flatDatums().length-1;if(e<0)return;const s=typeof getComputedStyle==="function"&&getComputedStyle(this.el).direction==="rtl";const i=s?"ArrowLeft":"ArrowRight";const n=s?"ArrowRight":"ArrowLeft";let o=this.kbIndex;switch(t.key){case i:case"ArrowDown":o=this.kbIndex<0?0:Math.min(e,this.kbIndex+1);break;case n:case"ArrowUp":o=this.kbIndex<0?e:Math.max(0,this.kbIndex-1);break;case"Home":o=0;break;case"End":o=e;break;case"Escape":if(this.kbIndex<0)return;o=-1;break;case"Enter":case" ":if(this.kbIndex<0)return;t.preventDefault();this.emitSliceClick(this.kbIndex,t);this.engine?.activate(this.kbIndex);return;default:return}t.preventDefault();this.moveKeyboardCursor(o)};this.onPlotBlur=()=>{if(this.kbIndex>=0)this.moveKeyboardCursor(-1)}}datumKeys(){const t=new Map;return this.flatDatums().map(((e,s)=>{const i=e.id!=null?`id:${e.id}`:e.label!=null?`label:${e.label}`:`pos:${s}`;const n=t.get(i)??0;t.set(i,n+1);return n===0?i:`${i}#${n}`}))}componentDidLoad(){this.initChart();if(typeof window!=="undefined"&&window.matchMedia){this.themeMql=window.matchMedia("(prefers-color-scheme: dark)");this.themeListener=()=>this.applyEngine();this.themeMql.addEventListener?.("change",this.themeListener)}}disconnectedCallback(){this.ro?.disconnect();this.ro=null;this.engine?.dispose();this.engine=null;if(this.themeMql&&this.themeListener){this.themeMql.removeEventListener?.("change",this.themeListener);this.themeListener=undefined;this.themeMql=undefined}}onAnyPropChange(){this.applyEngine();this.rebuildA11yTable()}async resize(){this.engine?.resize()}async replay(){this.engine?.replay()}async drill(t,e="down"){this.engine?.drill(t,e)}async toDataURL(){return this.engine?.toDataURL("image/png")??""}async getInstance(){return this.engine}initChart(){this.makeEngine();this.applyEngine();this.rebuildA11yTable();this.mounted=true;this.mdReady.emit()}makeEngine(){if(!this.chartHost)return;this.ro?.disconnect();this.ro=null;this.engine?.dispose();try{this.engine=new it(this.chartHost)}catch{this.engine=null}if(this.engine&&typeof ResizeObserver!=="undefined"){this.ro=new ResizeObserver((()=>{this.engine?.resize();this.updateCenterVars()}));this.ro.observe(this.chartHost)}}buildEngineTheme(t){return{background:t.background,textColor:t.textColor,textColorMuted:t.textColorMuted,axisLineColor:t.axisLineColor,gridLineColor:t.gridColor,surface:t.surface,fontFamily:t.fontFamily,labelSize:t.labelSize,titleSize:t.titleSize}}flatten(t,e){const s=this.datumKeys();const i=[];const n=this.monochrome!=null?_(this.el,this.monochrome||"primary",t.palette[0]):null;const o=(r,h,c,l)=>{r.forEach(((d,p)=>{const u=l!=null?a(l,t.surface,.18+p/Math.max(1,r.length)*.42):n!=null?a(n,t.surface,p/Math.max(1,r.length)*.7):e[p]??P(t.palette,p);const f=_(this.el,d.color,u);const m=i.length;i.push({label:d.label,value:d.value,color:f,selected:d.selected,radius:d.radius,hidden:d.hidden??this.legendHidden.get(s[m])??false,level:h,parent:c});if(d.children?.length)o(d.children,h+1,m,f)}))};o(this.data??[],0,undefined);return i}flatDatums(){const t=[];const e=s=>{for(const i of s){t.push(i);if(i.children?.length)e(i.children)}};e(this.data??[]);return t}buildSpec(t){const e=typeof getComputedStyle==="function"&&getComputedStyle(this.el).direction==="rtl";const s=k(t.palette.slice(0,3),this.data.length,{light:t.surface,dark:t.textColor});return{data:this.flatten(t,s),title:this.label||undefined,subtitle:this.subtitle||undefined,titleAlign:this.titleAlign,innerRadius:this.innerRadius,outerRadius:this.outerRadius,startAngleDeg:this.startAngle,endAngleDeg:this.endAngle,paddingAngleDeg:this.paddingAngle,cornerRadius:this.cornerRadius,showLabels:this.showLabels,labelMode:this.labelMode,gradient:this.gradient,highlight:this.highlight,legend:e?C(this.legend):this.legend,ringWidths:this.ringWidths,valueFormatter:t=>this.formatValue(t),animation:this.noAnimation?"none":this.animation,animationDuration:this.animationDuration}}applyEngine(){if(!this.engine)return;const t=w(this.el);this.engine.setSpec(this.buildSpec(t),this.buildEngineTheme(t),{onLegendClick:t=>{const e=this.datumKeys()[t.seriesIndex];if(e!=null)this.legendHidden.set(e,!!t.hidden);this.mdLegendClick.emit({dataIndex:t.seriesIndex,selected:!t.hidden})},onPointClick:(t,e,s)=>this.emitSliceClick(e,s)});this.engine.setTooltip({render:this.tooltipRenderer});this.updateCenterVars()}updateCenterVars(){const t=this.engine?.getCenter();if(!t||!this.chartHost)return;const e=this.el.getBoundingClientRect();const s=this.chartHost.getBoundingClientRect();const i=s.left-e.left;const n=s.top-e.top;this.el.style.setProperty("--_pie-center-x",`${t.x+i}px`);this.el.style.setProperty("--_pie-center-y",`${t.y+n}px`);const o=this.engine?.getHoleBox();this.el.style.setProperty("--_pie-hole",o&&o.width>0?`${o.width}px`:"none");this.el.style.setProperty("--_pie-hole-h",o&&o.height>0?`${o.height}px`:"none")}rebuildA11yTable(){if(!this.a11yTableHost)return;const t=this.data.reduce(((t,e)=>t+e.value),0);const e=this.tableLabels??{};this.a11yTableHost.innerHTML=F({title:this.label,xAxisLabel:e.category??"Category",xAxisData:this.data.map((t=>t.label)),locale:this.locale,series:[{label:e.value??"Value",data:this.data.map((t=>t.value))},{label:e.share??"Share",data:this.data.map((e=>t>0?e.value/t*100:0))}],valueFormatter:t=>t==null?"—":this.formatValue(t)})}formatValue(t){return this.valueFormatter?this.valueFormatter(t):t.toLocaleString(this.locale||undefined)}emitSliceClick(t,e){const s=this.flatDatums()[t];if(!s)return;this.mdSliceClick.emit({seriesIndex:0,seriesId:s.id,dataIndex:t,value:s.value,nativeEvent:e,series:s})}moveKeyboardCursor(t){this.kbIndex=t;this.engine?.focusIndex(t);if(t<0){this.announcement="";return}const e=this.flatDatums();const s=e[t];if(!s)return;const i=this.data?.some((t=>t.children?.length))?at(this.data??[],s)??e:e;const n=i.reduce(((t,e)=>t+e.value),0);const o=n>0?s.value/n*100:0;this.announcement=this.labelPoint.replace("%label%",s.label).replace("%value%",this.formatValue(s.value)).replace("%percent%",`${o.toLocaleString(this.locale||undefined,{maximumFractionDigits:1})}%`)}render(){const t=this.data.length===0&&!this.loading;const e=this.summary||R({title:this.label,chartType:"pie",seriesCount:this.data.length,locale:this.locale});return i(n,{key:"646c418ad237c02a37b63a44e726f63038d764e3",class:{"md-pie-chart":true,"md-pie-chart--empty":t,"md-pie-chart--mounted":this.mounted,"md-pie-chart--donut":this.innerRadius!=="0%"&&this.innerRadius!==0},role:"figure","aria-label":e,"aria-busy":this.loading?"true":null,style:this.heightProp?{blockSize:this.heightProp}:undefined},i("header",{key:"91000eccea90b4f6f497eeb4fd24460fddb50fdf",class:"md-pie-chart__header",part:"header"},i("slot",{key:"4d95064f71c77b468df419b12ac818879547fdf8",name:"header"})),i("div",{key:"4700981a7e3035ae20a298de3b23ad0641583c00",class:"md-pie-chart__canvas",part:"canvas",ref:t=>this.bindChartHost(t),tabindex:t?undefined:"0",role:t?undefined:"application","aria-label":t?undefined:this.labelPlot,onKeyDown:this.onPlotKeyDown,onBlur:this.onPlotBlur}),i("div",{key:"4473fc6e379d32f4b097843f671e9d441d1d9407",class:"md-pie-chart__center",part:"center","aria-hidden":"true"},i("slot",{key:"b2fe4b06cf819bda51e7a33ac0ed8a361c66ce9b",name:"center"})),t&&i("div",{key:"07a20ca893b2ec888a608bdd6bd076753d6e28c5",class:"md-pie-chart__empty",part:"empty"},i("slot",{key:"cd3680b45b20580207a1cd9f7d0a92a9bb43737f",name:"empty"},this.labelEmpty)),this.loading&&i("div",{key:"5134c562360df1c4fc3048d9ceef642f08691fca",class:"md-pie-chart__loading",part:"loading",role:"status"},i("slot",{key:"b88653bc760d8b875ee939abae33e15f7207aa22",name:"loader"},i("slot",{key:"53e75485d2faaa84352f4f41cbd83756dbb02ca1",name:"loading"},i("md-progress-indicator",{key:"3bba3041bcb3f638e3fe8a0b9cab9acd644cc25a",class:"md-pie-chart__spinner",variant:"circular",indeterminate:true,label:this.loadingLabel}),i("span",{key:"64301c1275be0b73d9e3700075604e865e926f14",class:"md-pie-chart__loading-text"},this.loadingLabel)))),i("footer",{key:"4b0dd15de96b8ae57708a831ab39a648c24790f7",class:"md-pie-chart__footer",part:"footer"},i("slot",{key:"2d044f72638d5e7807729f875eedc56e6599e7aa",name:"footer"})),i("div",{key:"99f0f11c5878aa648eedd6c3d6f88ad8230f4ea5",class:"md-pie-chart__a11y-table",ref:t=>this.bindA11yTableHost(t)}),i("div",{key:"0911b766e69fea66d8f99dbd41af32a1869c7f35",class:"md-pie-chart__live",role:"status","aria-live":"polite","aria-atomic":"true"},this.announcement))}get el(){return this}static get watchers(){return{data:[{onAnyPropChange:0}],innerRadius:[{onAnyPropChange:0}],outerRadius:[{onAnyPropChange:0}],startAngle:[{onAnyPropChange:0}],endAngle:[{onAnyPropChange:0}],paddingAngle:[{onAnyPropChange:0}],cornerRadius:[{onAnyPropChange:0}],showLabels:[{onAnyPropChange:0}],labelMode:[{onAnyPropChange:0}],monochrome:[{onAnyPropChange:0}],gradient:[{onAnyPropChange:0}],highlight:[{onAnyPropChange:0}],legend:[{onAnyPropChange:0}],tooltip:[{onAnyPropChange:0}],label:[{onAnyPropChange:0}],titleAlign:[{onAnyPropChange:0}],animation:[{onAnyPropChange:0}],animationDuration:[{onAnyPropChange:0}],ringWidths:[{onAnyPropChange:0}],locale:[{onAnyPropChange:0}],subtitle:[{onAnyPropChange:0}],loading:[{onAnyPropChange:0}],valueFormatter:[{onAnyPropChange:0}]}}static get style(){return ot()}},[257,"md-pie-chart",{label:[1],titleAlign:[1,"title-align"],data:[16],innerRadius:[8,"inner-radius"],outerRadius:[8,"outer-radius"],startAngle:[2,"start-angle"],endAngle:[2,"end-angle"],paddingAngle:[2,"padding-angle"],cornerRadius:[2,"corner-radius"],showLabels:[4,"show-labels"],labelMode:[1,"label-mode"],monochrome:[1],gradient:[4],highlight:[1],legend:[513],tooltip:[1],locale:[1],subtitle:[1],summary:[1],tableLabels:[16],labelEmpty:[1,"label-empty"],loading:[4],loadingLabel:[1,"loading-label"],labelPlot:[1,"label-plot"],labelPoint:[1,"label-point"],tooltipRenderer:[16],valueFormatter:[16],ringWidths:[16],heightProp:[1,"height"],noAnimation:[4,"no-animation"],animation:[1],animationDuration:[2,"animation-duration"],density:[514],mounted:[32],kbIndex:[32],announcement:[32],resize:[64],replay:[64],drill:[64],toDataURL:[64],getInstance:[64]},undefined,{data:[{onAnyPropChange:0}],innerRadius:[{onAnyPropChange:0}],outerRadius:[{onAnyPropChange:0}],startAngle:[{onAnyPropChange:0}],endAngle:[{onAnyPropChange:0}],paddingAngle:[{onAnyPropChange:0}],cornerRadius:[{onAnyPropChange:0}],showLabels:[{onAnyPropChange:0}],labelMode:[{onAnyPropChange:0}],monochrome:[{onAnyPropChange:0}],gradient:[{onAnyPropChange:0}],highlight:[{onAnyPropChange:0}],legend:[{onAnyPropChange:0}],tooltip:[{onAnyPropChange:0}],label:[{onAnyPropChange:0}],titleAlign:[{onAnyPropChange:0}],animation:[{onAnyPropChange:0}],animationDuration:[{onAnyPropChange:0}],ringWidths:[{onAnyPropChange:0}],locale:[{onAnyPropChange:0}],subtitle:[{onAnyPropChange:0}],loading:[{onAnyPropChange:0}],valueFormatter:[{onAnyPropChange:0}]}]);function ht(){if(typeof customElements==="undefined"){return}const t=["md-pie-chart","md-progress-indicator"];t.forEach((t=>{switch(t){case"md-pie-chart":if(!customElements.get(o(t))){customElements.define(o(t),rt)}break;case"md-progress-indicator":if(!customElements.get(o(t))){z()}break}}))}ht();const ct=rt;const lt=ht;export{ct as MdPieChart,lt as defineCustomElement};
2
+ //# sourceMappingURL=md-pie-chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["gradientFor","color","theme","from","mixColor","surface","to","sectorBox","a0","sweep","holeFrac","a1","lo","Math","min","hi","max","xs","ys","a","r","push","cos","sin","q","PI","k","ceil","x0","x1","y0","y1","sameFamily","data","b","isAncestor","idx","of","cur","guard","parent","sliceLabel","d","spec","fallback","mode","labelMode","value","valueFormatter","label","SELECT_OFFSET","LABEL_CHAR_W","INNER_RING_WEIGHT","LABEL_MIN_SWEEP_INSIDE","LABEL_MIN_SWEEP_LEADER","HOVER_RIM","HOVER_GAP","RIM_ROOM","LEVEL_GAP","FADE_STAGGER","DEG","approxWidth","text","fontSize","length","labelColorFor","fill","g","parseColor","lum","resolveRadius","baseR","Number","isFinite","s","trim","n","parseFloat","endsWith","computePieLayout","width","height","visible","map","i","filter","x","hidden","level","total","reduce","sum","depth","m","titleH","title","titleSize","subtitle","labelSize","legendPos","legend","maxLegendW","padL","padR","padT","padB","side","want","legendExtent","w","LEGEND_SIDE_MAX_FRACTION","band","availW","rows","rowW","iw","startsWith","plot","y","startRad","startAngleDeg","sweepTotal","endAngleDeg","inner","innerRadius","outer","outerRadius","partial","abs","box","cx","cy","labelRoom","showLabels","longest","v","textW","f","ringR","outerR","innerR","ringWeights","Array","_","ringWidths","weightSum","bandSpan","levelGap","bandable","bandAt","ringStarts","out","acc","ringInner","ringOuter","span","Map","hasKids","Set","add","outerFor","full","has","radius","base","sign","totalPad","paddingAngleDeg","perPad","availSweep","slices","texts","leaders","outside","cursor","sepColor","sliceStroke","sepWidth","sliceStrokeWidth","hubCut","fullSweep","worst","sw","hoverBands","pushBand","bx","by","rOut","rimH","gap","midR","dArc","sweepSign","startAngle","endAngle","dataIndex","pill","highlightT","hovering","highlight","highlightIndex","midFrac","frac","hoveredPos","findIndex","hoveredLevel","Infinity","fadeFor","pos","diff","dist","lag","offOf","forEach","fade","sliceSweep","mid","isHovered","litByFamily","ex","selectT","selected","scx","scy","set","cornerRadius","gapColor","gradient","undefined","inside","r0","r1","labelR","align","baseline","key","right","here","byParent","p","get","parentIdx","kids","pSpan","sweepAll","shove","rIn","related","kex","kmid","pOff","ox","oy","lineH","col","l","sort","over","under","room","fits","floor","slice","x2","y2","gridLineColor","textColorMuted","tt","titlePlacement","titleAlign","textColor","fontWeight","seriesIndex","background","gridlines","axisLines","areas","bars","lines","markers","legendPosition","pieCenter","h","SQRT2","pieHoleSize","pieHoleHeight","pieCenterSlot","xPositions","xValues","xLabels","hoverPoints","HOVER_TWEEN_MS","DRILL_MS","RIPPLE_MS","RIPPLE_ALPHA","SELECT_MS","LABEL_ARRIVES_AT","PieChartEngine","constructor","container","this","ctx","scene","cb","hoverRaf","hoverIndex","hasRendered","introRaf","pendingDrill","drillRun","ripple","rippleRaf","dpr","selectRaf","lastW","lastH","dprWatch","watchDevicePixelRatio","render","hoverT","hoverTweenRaf","handlePointerMove","e","rect","canvas","getBoundingClientRect","px","clientX","left","py","clientY","top","cancelAnimationFrame","requestAnimationFrame","sliceAt","style","tweenHover","onHover","renderTooltip","handlePointerLeave","hoverLayer","textContent","handlePointerDown","startRipple","handleClick","onPointClick","toggleSelected","onLegendToggle","item","datum","onLegendClick","getComputedStyle","position","document","createElement","cssText","setAttribute","overlay","legendLayer","append","getContext","addEventListener","getScene","getHoleBox","getCenter","slot","setTooltip","opts","tooltipRender","setSpec","before","changed","some","clearHover","resize","round","toDataURL","type","dispose","stopIntro","removeEventListener","remove","update","window","devicePixelRatio","layoutAndOverlay","legendEl","querySelector","extent","offsetWidth","offsetHeight","variant","duration","resolveIntro","drill","leaving","prefersReducedMotion","playDrill","index","up","clearIntroOpacity","drillFrame","animate","hasContent","playIntro","drawGeometry","opacity","el","querySelectorAll","transition","direction","replay","syncOverlay","fontFamily","setTransform","drawSceneCanvas","paceLabels","t","target","setOpacity","String","stepAnimation","alpha","start","frame","now","tRaw","frozen","performance","step","run","centreOf","sc","sl","find","shiftScene","dx","dy","liveC","frozenC","eased","easeInOutCubic","split","splitScene","withRipple","globalAlpha","overAlpha","pointInSlice","focusIndex","t0","expressiveEase","activate","corners","flatMap","hypot","onColorFor","easeOutCubic","wasOut","every","percent","tip","join","total2","content","axisValue","axisLabel","focusedSeriesIndex","missing","series","formattedValue","focused","appendTooltipContent","appendChild","placeTooltip","row","lbl","val","toFixed","tw","th","twoPi","atan2","mdPieChartCss","findSiblings","items","includes","children","found","MdPieChart","__stencil_proxyCustomElement","HTMLElement","registerHost","paddingAngle","tooltip","locale","summary","labelEmpty","loading","loadingLabel","labelPlot","labelPoint","noAnimation","animation","density","mounted","kbIndex","announcement","engine","ro","legendHidden","bindChartHost","chartHost","bindA11yTableHost","a11yTableHost","onPlotKeyDown","last","flatDatums","rtl","forward","back","next","preventDefault","emitSliceClick","moveKeyboardCursor","onPlotBlur","datumKeys","seen","id","componentDidLoad","initChart","matchMedia","themeMql","themeListener","applyEngine","disconnectedCallback","disconnect","onAnyPropChange","rebuildA11yTable","getInstance","makeEngine","mdReady","emit","ResizeObserver","updateCenterVars","observe","buildEngineTheme","axisLineColor","gridColor","flatten","palette","keys","monoBase","monochrome","resolveSeriesColor","walk","parentColor","pickPaletteColor","at","buildSpec","harmonicPalette","light","dark","mirrorLegend","formatValue","animationDuration","readMdChartTheme","mdLegendClick","_si","di","tooltipRenderer","c","host","setProperty","hole","lb","tableLabels","innerHTML","buildDataTableHtml","xAxisLabel","category","xAxisData","share","toLocaleString","nativeEvent","mdSliceClick","seriesId","flat","siblings","pct","replace","maximumFractionDigits","empty","buildChartSummary","chartType","seriesCount","Host","class","role","heightProp","blockSize","part","name","ref","tabindex","onKeyDown","onBlur","indeterminate"],"sources":["src/utils/charts/engine/pie-layout.ts","src/utils/charts/engine/pie-chart.ts","src/components/md-pie-chart/md-pie-chart.css?tag=md-pie-chart&encapsulation=shadow","src/components/md-pie-chart/md-pie-chart.tsx"],"sourcesContent":["/*\n * Chart engine — pie layout (spec → RenderScene)\n * ===========================================================\n * The polar sibling of layout.ts / bar-layout.ts. Turns a pie/donut\n * spec + theme + size into a RenderScene of annular-sector `slices`,\n * plus outside labels + leader lines, a legend, and (optionally) an\n * exploded hovered slice. Angles follow the component's convention\n * (90° = 12-o'clock, positive = counter-clockwise) and are converted\n * to screen radians (y-down) here. Pure — no DOM.\n * ===========================================================\n */\n\nimport type { MdChartAnimation, MdChartLegendPosition, MdChartTitleAlign } from '../types';\nimport { parseColor, mixColor, withAlpha } from './color';\nimport { LEGEND_SIDE_MAX_FRACTION } from './scene';\nimport type { LegendItem, RenderScene, SceneSegment, SceneSlice, TextItem } from './scene';\nimport { titlePlacement, type EngineTheme } from './layout';\n\nexport interface PieDatum {\n label: string;\n value: number;\n color: string;\n hidden?: boolean;\n /** Exploded outward (selected slice). */\n selected?: boolean;\n /**\n * How far out the slice currently sits, 0..1 of the full offset — the tween\n * behind `selected`, so a slice being picked slides out rather than jumping.\n * Absent falls back to `selected`, which is what a consumer sets.\n */\n selectT?: number;\n /** Fraction of the outer radius this slice reaches (a second dimension). */\n radius?: number;\n /**\n * Ring this slice belongs to: 0 is innermost. The tree is FLATTENED before it\n * reaches the layout so that `data` stays a plain indexable list — tooltips,\n * legend toggles, click events and the screen-reader table all address slices\n * by index, and a nested shape would have broken every one of them.\n */\n level?: number;\n /** Index of this slice's parent in the same array, for levels above 0. */\n parent?: number;\n}\n\n/** A slice's decorative gradient: lighter at the centre, its own colour at the rim. */\nfunction gradientFor(color: string, theme: EngineTheme): { from: string; to: string } {\n return { from: mixColor(color, theme.surface, 0.3), to: color };\n}\n\n/**\n * The bounding box, in units of the outer radius, of an annular sector spanning\n * `[a0, a0 + sweep]` with a hole of `holeFrac`.\n *\n * A pie that sweeps less than a full turn paints only part of its circle, so\n * sizing it as if it were a whole one wastes the rest of the box: a half-donut\n * ends up half the size it could be, floating in the middle with empty space\n * under it. Fitting the SECTOR instead lets it fill the width.\n *\n * The extent is the arc's two ends, plus the inner corners (the hole's own ends,\n * or the centre when there is no hole), plus each axis-crossing (0 / 90 / 180 /\n * 270°) that falls inside the span — those are where the arc reaches furthest\n * and they are not endpoints, so sampling only the ends would clip them.\n */\nfunction sectorBox(a0: number, sweep: number, holeFrac: number) {\n const a1 = a0 + sweep;\n const lo = Math.min(a0, a1);\n const hi = Math.max(a0, a1);\n const xs: number[] = [];\n const ys: number[] = [];\n for (const a of [lo, hi]) {\n for (const r of [1, holeFrac]) {\n xs.push(Math.cos(a) * r);\n ys.push(Math.sin(a) * r);\n }\n }\n // Quadrant extremes inside the span. `k` walks the quarter-turns at or after\n // `lo`; each contributes ±1 on one axis.\n const q = Math.PI / 2;\n for (let k = Math.ceil(lo / q); k * q <= hi; k++) {\n xs.push(Math.cos(k * q));\n ys.push(Math.sin(k * q));\n }\n return { x0: Math.min(...xs), x1: Math.max(...xs), y0: Math.min(...ys), y1: Math.max(...ys) };\n}\n\n/**\n * Are these two slices in the same family — one the other's ancestor, or the\n * same slice?\n *\n * Both directions. A browser and one of its versions are the same answer to\n * the same question whichever of them the pointer is on, so dimming one when\n * the other is hovered tells the reader they are unrelated. Asking it in one\n * direction only lit a hovered child's parent while a hovered parent's children\n * went grey.\n */\nfunction sameFamily(data: PieDatum[], a: number, b: number): boolean {\n return isAncestor(data, a, b) || isAncestor(data, b, a);\n}\n\n/** Is `idx` an ancestor of `of` (or the same slice)? */\nfunction isAncestor(data: PieDatum[], idx: number, of: number): boolean {\n let cur = of;\n let guard = 0;\n while (cur >= 0 && guard++ < 32) {\n if (cur === idx) return true;\n cur = data[cur]?.parent ?? -1;\n }\n return false;\n}\n\n/** A slice's label text, honouring `labelMode` over the placement default. */\nfunction sliceLabel(d: PieDatum, spec: PieChartSpec, fallback: 'value' | 'both' | 'name'): string {\n const mode = spec.labelMode ?? fallback;\n const value = spec.valueFormatter(d.value);\n if (mode === 'name') return d.label;\n if (mode === 'both') return `${d.label} · ${value}`;\n return value;\n}\n\n/** How far the hovered slice's band extends, in px. */\n/** How far a picked slice sits out from the ring, in px. */\nexport const SELECT_OFFSET = 12;\n\n/**\n * Rough width of one label character, as a fraction of the font size.\n *\n * The layout has no text metrics — measuring in the DOM here would mean a\n * reflow per frame — so the room reserved for a label and the point at which it\n * has to be shortened are both estimated from its length. ONE constant for\n * both: reserving with one number and shortening against another leaves labels\n * cut off in charts that gave up radius precisely so they would fit.\n */\nconst LABEL_CHAR_W = 0.52;\n\n/**\n * Default width of a ring that labels inside itself, relative to the outermost\n * one (which labels on leaders and needs only its arc).\n */\nconst INNER_RING_WEIGHT = 1.45;\n\n/** Narrowest slice (radians) that can hold a label INSIDE itself. */\nconst LABEL_MIN_SWEEP_INSIDE = 0.12;\n\n/** …and on a leader line, where only a hairline slice has nothing to point at. */\nconst LABEL_MIN_SWEEP_LEADER = 0.02;\n\nconst HOVER_RIM = 7;\n\n/** Clear background left between the slice and its band, in px. */\nconst HOVER_GAP = 3;\n\n/** How far the rings outside an emphasised one step out to clear its rim. */\nconst RIM_ROOM = HOVER_RIM + HOVER_GAP;\n\n/**\n * Clear background between one ring of a nested chart and the next, in px.\n * Enough to read as a division, not so much that the rings stop looking like\n * one chart.\n */\nconst LEVEL_GAP = 3;\n\n/**\n * How much of the tween the far side of the ring lags behind the hovered\n * slice's neighbours. Small: it should read as the fade travelling, not as the\n * chart taking noticeably longer to settle.\n */\nconst FADE_STAGGER = 0.45;\n\n\nexport interface PieChartSpec {\n data: PieDatum[];\n title?: string;\n /** Sub-title, drawn under the title in the muted text colour. */\n subtitle?: string;\n /** Horizontal alignment of the title over the chart. Default 'start'. */\n titleAlign?: MdChartTitleAlign;\n innerRadius: string | number;\n outerRadius: string | number;\n startAngleDeg: number;\n endAngleDeg: number;\n paddingAngleDeg: number;\n cornerRadius: number;\n showLabels: boolean;\n highlight: 'slice' | 'series' | 'none';\n legend?: MdChartLegendPosition | 'none';\n valueFormatter: (v: number) => string;\n /** Data index of the hovered slice, or -1. */\n highlightIndex?: number;\n /**\n * How far the hover treatment is applied, 0..1. The engine tweens it so the\n * rim grows and the other slices fade rather than snapping — MD3 asks for\n * motion on a state change, and an instant jump on a shape this large reads\n * as a glitch. Omitted → 1 (fully applied).\n */\n highlightT?: number;\n /** Fill slices with a gradient running outward, for depth. Decorative. */\n gradient?: boolean;\n /**\n * What a slice's label says: its `value` (the default inside the ring, where\n * a legend already names the slices), its `name`, or `both`. Outside labels\n * default to `both`, since there is no legend to name them.\n */\n labelMode?: 'value' | 'name' | 'both';\n /** Hairline between adjacent slices. Omitted → the theme surface. */\n sliceStroke?: string;\n /** Hairline width in px. Default 1.5. */\n sliceStrokeWidth?: number;\n /**\n * How the radial band is divided between the levels of a nested chart —\n * relative weights, innermost first. `[2, 1]` gives the inner ring twice the\n * width of the outer. Short arrays fall back to the default per level.\n */\n ringWidths?: number[];\n /**\n * Measured legend extent in px (height for top/bottom, width for left/right).\n * The engine fills this in on a second pass so the ring never overlaps a\n * legend whose real (wrapped) size can't be predicted from text length.\n */\n legendExtent?: number;\n /** Entry-animation variant played on first render. Default 'expressive'. */\n animation?: MdChartAnimation;\n /** Entry-animation duration override (ms); ≤ 0 disables. */\n animationDuration?: number;\n /** Legacy on/off flag (pre-variant). `false` → no animation. */\n animate?: boolean;\n}\n\nconst DEG = Math.PI / 180;\n\nfunction approxWidth(text: string, fontSize: number): number {\n return text.length * fontSize * 0.58;\n}\n\n/** Black or white label, whichever contrasts better with the slice fill. */\nfunction labelColorFor(fill: string): string {\n const [r, g, b] = parseColor(fill);\n const lum = 0.299 * r + 0.587 * g + 0.114 * b;\n return lum > 0.62 ? 'rgba(0, 0, 0, 0.82)' : '#ffffff';\n}\n\nfunction resolveRadius(r: string | number, baseR: number): number {\n if (typeof r === 'number') return Number.isFinite(r) && r >= 0 ? r : 0;\n const s = r.trim();\n const n = parseFloat(s);\n if (!Number.isFinite(n) || n < 0) return 0;\n return s.endsWith('%') ? (n / 100) * baseR : n;\n}\n\nexport function computePieLayout(spec: PieChartSpec, theme: EngineTheme, width: number, height: number): RenderScene {\n // Only the innermost ring drives the ring's own proportions; deeper levels\n // subdivide their parent's arc.\n const visible = spec.data\n .map((d, i) => ({ d, i }))\n .filter((x) => !x.d.hidden && x.d.value > 0 && (x.d.level ?? 0) === 0);\n const total = visible.reduce((sum, x) => sum + x.d.value, 0);\n const depth = spec.data.reduce((m, d) => Math.max(m, (d.level ?? 0) + 1), 1);\n\n // ── gutters (title + legend) ──\n const titleH = spec.title ? theme.titleSize + 12 + (spec.subtitle ? theme.labelSize + 4 : 0) : 0;\n // Only reserve legend space for >1 slice — the overlay suppresses a 1-entry\n // legend, so reserving a gutter for it would shrink/off-centre the ring.\n const legendPos = spec.legend && spec.legend !== 'none' && spec.data.length > 1 ? spec.legend : null;\n const maxLegendW = legendPos ? Math.max(0, ...spec.data.map((d) => approxWidth(d.label, theme.labelSize))) : 0;\n\n let padL = 8;\n let padR = 8;\n let padT = 8 + titleH;\n let padB = 8;\n if (legendPos) {\n const side = legendPos === 'left' || legendPos === 'right';\n if (side) {\n // Prefer the engine-measured width; else estimate from the widest label.\n // Capped at a third of the box. A side legend takes its width from the\n // longest label, so the same chart in a language with longer words gets a\n // visibly smaller ring — an Arabic \"التواصل الاجتماعي المدفوع\" runs three\n // times its English label, and unbounded it took the whole box and left\n // the chart a speck. Past the cap the chips ellipsise, which costs the\n // tail of a name rather than the chart.\n const want = spec.legendExtent != null ? spec.legendExtent + 16 : maxLegendW + 30;\n const w = Math.min(want, width * LEGEND_SIDE_MAX_FRACTION);\n if (legendPos === 'left') padL += w;\n else padR += w;\n } else {\n // Prefer the engine-measured height; else greedily pack rows as a first\n // guess (refined to the real wrapped height on the reflow pass).\n let band = spec.legendExtent != null ? spec.legendExtent + 8 : 0;\n if (spec.legendExtent == null) {\n const availW = Math.max(60, width * 0.86);\n let rows = 1;\n let rowW = 0;\n for (const d of spec.data) {\n const iw = approxWidth(d.label, theme.labelSize) + 28;\n if (rowW > 0 && rowW + iw > availW) { rows++; rowW = iw; } else rowW += iw;\n }\n band = rows * (theme.labelSize + 8) + 6;\n }\n if (legendPos.startsWith('bottom')) padB += band;\n else padT += band;\n }\n }\n\n const plot = {\n x: padL,\n y: padT,\n width: Math.max(1, width - padL - padR),\n height: Math.max(1, height - padT - padB),\n };\n\n // Angles first: a partial sweep changes how much room the ring needs.\n const startRad = -spec.startAngleDeg * DEG;\n const sweepTotal = -(spec.endAngleDeg - spec.startAngleDeg) * DEG;\n // inner/outer as a ratio. Both resolve against the same base, so the base\n // cancels — which matters because the base is what we are about to compute.\n const holeFrac = (() => {\n const inner = resolveRadius(spec.innerRadius, 100);\n const outer = resolveRadius(spec.outerRadius, 100);\n return outer > 0 ? Math.max(0, Math.min(0.95, inner / outer)) : 0;\n })();\n // A near-full sweep keeps the plain inscribed-circle fit — the sector box is\n // the full circle anyway, and going through it would only add rounding noise.\n const partial = Math.abs(sweepTotal) < Math.PI * 2 - 0.02;\n const box = partial ? sectorBox(startRad, sweepTotal, holeFrac) : { x0: -1, x1: 1, y0: -1, y1: 1 };\n const baseR = Math.max(\n 1,\n Math.min(plot.width / Math.max(0.01, box.x1 - box.x0), plot.height / Math.max(0.01, box.y1 - box.y0)),\n );\n // Centre the SECTOR in the plot, then place the ring centre relative to it.\n const cx = plot.x + plot.width / 2 - ((box.x0 + box.x1) / 2) * baseR;\n const cy = plot.y + plot.height / 2 - ((box.y0 + box.y1) / 2) * baseR;\n /**\n * Room reserved outside the ring for the labels.\n *\n * An outside label is a whole word (or two) sitting beyond the rim, so a flat\n * margin is the wrong reservation: it is right for \"80\" and far too small for\n * \"Organic search · 240\", which then ran off the edge of the card and was\n * clipped mid-word. Sized from the longest label the chart will actually\n * draw, estimated from its length — the layout has no text metrics, and\n * measuring in the DOM here would mean a reflow per frame. Capped at half the\n * radius, since past that the ring has given up more than the labels are\n * worth. Inside labels (the legend case) need none of it.\n */\n const labelRoom = (() => {\n if (!spec.showLabels || legendPos) return 6;\n const longest = visible.reduce((m, v) => Math.max(m, sliceLabel(v.d, spec, 'both').length), 0);\n // Only what OVERFLOWS. The ring usually asks for less than the full radius\n // (80% by default), which often leaves enough room for the labels already —\n // reserving the label's width unconditionally shrank charts that had no\n // problem, for nothing.\n const want = resolveRadius(spec.outerRadius, baseR);\n const textW = 12 + longest * theme.labelSize * LABEL_CHAR_W;\n // Solved, not guessed: the ring shrinks WITH the room given up, so taking\n // the raw overflow back reserves too little and the label still runs off.\n // With `f` the fraction of the radius the ring asks for, room r has to\n // satisfy f·(baseR − r) + textW ≤ baseR.\n const f = Math.max(0.05, want / Math.max(1, baseR));\n return Math.max(6, Math.min(baseR * 0.45, (want + textW - baseR) / f));\n })();\n // What is left for the ring after that. BOTH radii resolve against it, so a\n // chart that gives up room to its labels keeps its proportions: resolving the\n // hole against the full radius while the rim gave way collapsed a donut's\n // band to a hairline.\n const ringR = Math.max(8, baseR - labelRoom);\n const outerR = Math.max(1, Math.min(resolveRadius(spec.outerRadius, ringR), ringR));\n const innerR = Math.max(0, Math.min(resolveRadius(spec.innerRadius, ringR), outerR - 2));\n // Each level gets an equal share of the radial band, innermost first, with a\n // gap between them — flush, the levels merge into one thick ring and the\n // hierarchy the nesting exists to show is lost.\n /**\n * How the radial band is split between the levels — relative weights,\n * innermost first.\n *\n * An equal split is the wrong default for a nested chart, because the levels\n * do not carry the same thing. Every ring but the outermost labels INSIDE\n * itself, so its band has to hold a word; the outermost puts its labels on\n * leaders and needs no more than the arc. Splitting evenly left the inner\n * ring, the one with text in it, exactly as thin as the one without.\n */\n const ringWeights = Array.from({ length: depth }, (_, level) => {\n const w = spec.ringWidths?.[level];\n return Number.isFinite(w) && (w as number) > 0 ? (w as number) : level < depth - 1 ? INNER_RING_WEIGHT : 1;\n });\n const weightSum = ringWeights.reduce((a, w) => a + w, 0) || 1;\n const bandSpan = outerR - innerR;\n const levelGap = depth > 1 ? Math.min(LEVEL_GAP, (bandSpan / depth) * 0.3) : 0;\n const bandable = Math.max(1, bandSpan - levelGap * (depth - 1));\n const bandAt = (level: number) => (bandable * ringWeights[level]) / weightSum;\n // Cumulative, so the gaps sit BETWEEN the rings and the outermost still ends\n // exactly at the radius that was asked for.\n const ringStarts = (() => {\n const out: number[] = [];\n let acc = innerR;\n for (let level = 0; level < depth; level++) {\n out.push(acc);\n acc += bandAt(level) + (level < depth - 1 ? levelGap : 0);\n }\n return out;\n })();\n const ringInner = (level: number) => ringStarts[level] ?? innerR;\n // Only the gaps BETWEEN rings are taken; the outermost still reaches the\n // radius that was asked for.\n const ringOuter = (level: number) => ringInner(level) + bandAt(level);\n /** Angular span of each slice, by index — children read their parent's. */\n const span = new Map<number, { a0: number; a1: number }>();\n /** Indices that something else points at as its parent. */\n const hasKids = new Set<number>();\n for (const d of spec.data) if (d.parent != null && d.parent >= 0) hasKids.add(d.parent);\n /**\n * A slice with no breakdown of its own reaches the OUTER radius rather than\n * stopping at its own ring. Otherwise the outer ring is drawn with a hole\n * wherever a category has no children — the chart looks like it lost a slice\n * rather than like that slice simply has nothing inside it.\n */\n const outerFor = (level: number, i: number) => {\n const full = hasKids.has(i) ? ringOuter(level) : outerR;\n const r = spec.data[i]?.radius;\n if (r == null) return full;\n // Floor at 15%: a slice drawn at (or near) zero radius is indistinguishable\n // from missing data, and the angle it still occupies would look like a bug.\n const base = ringInner(level);\n return base + (full - base) * Math.max(0.15, Math.min(1, r));\n };\n\n // ── slice angles (screen radians; y-down flips the sign) ──\n const sign = sweepTotal >= 0 ? 1 : -1;\n // Cap the total inter-slice padding at 90% of the ring sweep so a large\n // paddingAngle collapses the slices to slivers rather than driving availSweep\n // negative (which would flip every slice's direction and scatter the arcs).\n const totalPad = visible.length ? Math.min(spec.paddingAngleDeg * DEG * visible.length, Math.abs(sweepTotal) * 0.9) : 0;\n const perPad = visible.length ? totalPad / visible.length : 0;\n const availSweep = sweepTotal - sign * totalPad;\n\n const slices: SceneSlice[] = [];\n const texts: TextItem[] = [];\n const leaders: SceneSegment[] = [];\n /** Outside labels, held back until they can be spread apart (see below). */\n const outside: { key: string; text: string; x1: number; y1: number; x: number; y: number; right: boolean }[] = [];\n\n let cursor = startRad;\n // A single slice has no neighbour to be separated from, and a full ring of\n // one would get a stray radial line at 12 o'clock.\n const sepColor = spec.sliceStroke ?? theme.surface;\n // 1px rather than something heavier: the gap is a constant width, so it also\n // fixes where the wedges have to stop — the hub is (gap/2) / sin(narrowest\n // sweep / 2), and every extra half-pixel of separation is nearly a whole one\n // of hub. A hairline reads as a division without opening a hole at the\n // centre. See `hubCut`.\n const sepWidth = visible.length > 1 ? spec.sliceStrokeWidth ?? 1 : 0;\n /**\n * Where a solid pie's wedges stop, short of the centre.\n *\n * The separation between two slices is a constant WIDTH, so it reads the same\n * at the hub as at the rim — which means each pair of inset edges closes on\n * itself at `g / sin(sweep/2)` and there is no wedge past that point. Running\n * them to the centre anyway would either pinch the gaps shut there (the\n * spacing stops matching) or fold each wedge through itself.\n *\n * So every slice stops on ONE small circle, sized by the slice that needs the\n * most room — the narrowest, whose edges converge soonest. A common radius\n * rather than each slice's own, because slices ending at five different radii\n * is exactly the ragged middle this is meant to avoid. Capped, so that a\n * sliver too narrow to hold a gap can't hollow out the whole chart.\n */\n const hubCut = (() => {\n if (innerR > 0 || sepWidth <= 0 || visible.length < 2) return 0;\n const g = sepWidth / 2;\n const total = visible.reduce((acc, v) => acc + Math.max(0, v.d.value), 0) || 1;\n const fullSweep = Math.abs(-(spec.endAngleDeg - spec.startAngleDeg) * DEG);\n let worst = 0;\n for (const v of visible) {\n const sw = (Math.max(0, v.d.value) / total) * fullSweep;\n if (sw > 0.001) worst = Math.max(worst, g / Math.sin(Math.min(sw, Math.PI) / 2));\n }\n // Kept small in absolute terms as well as relative: one very narrow slice\n // would otherwise set a hub big enough to read as a donut hole. A slice\n // whose gap closes above the cap simply comes to a point there instead.\n return Math.min(worst, outerR * 0.04, 4);\n })();\n /**\n * Hover bands, kept apart from the ring slices and appended at the very end.\n * A band drawn in ring order is painted BEFORE the ring outside it, which\n * then covers it — on a nested chart the highlight for an inner slice\n * disappeared under the next ring entirely.\n */\n const hoverBands: SceneSlice[] = [];\n const pushBand = (bx: number, by: number, rOut: number, a0: number, a1: number, color: string) => {\n const rimH = HOVER_RIM * hi;\n const gap = HOVER_GAP * hi;\n const midR = rOut + gap + rimH / 2;\n const dArc = (midR > 0 ? rimH / 2 / midR : 0) * sweepSign;\n hoverBands.push({\n cx: bx,\n cy: by,\n innerR: rOut + gap,\n outerR: rOut + gap + rimH,\n startAngle: a0 + dArc,\n endAngle: a1 - dArc,\n // OPAQUE. The band is painted last, so it is already on top — but a\n // translucent one takes the colour of whatever it covers, and over the\n // next ring out that reads as passing behind it rather than over it.\n // Against the background there is nothing to blend with, so the two cases\n // looked the same until a ring appeared underneath.\n color,\n dataIndex: -1,\n pill: true,\n });\n };\n /** +1 for a clockwise ring, -1 for anticlockwise — corner offsets follow it. */\n const sweepSign = sign;\n // Strength of the hover treatment this frame.\n const hi = Math.max(0, Math.min(1, spec.highlightT ?? 1));\n const hovering = spec.highlight !== 'none' && spec.highlightIndex != null && spec.highlightIndex >= 0;\n\n // Where each visible slice's middle sits as a fraction of the ring, so the\n // fade can travel AROUND it instead of switching every slice at once.\n const midFrac: number[] = [];\n {\n let acc = 0;\n for (const { d } of visible) {\n const frac = total > 0 ? d.value / total : 0;\n midFrac.push(acc + frac / 2);\n acc += frac;\n }\n }\n const hoveredPos = visible.findIndex((v) => v.i === spec.highlightIndex);\n /** Which ring the pointer is on — the ones outside it step out of its way. */\n const hoveredLevel = hovering ? spec.data[spec.highlightIndex ?? -1]?.level ?? 0 : Infinity;\n\n /**\n * How far this slice fades, given the tween.\n *\n * The dimming is staggered by distance around the RING from the slice under\n * the pointer: its neighbours start giving way immediately, the far side a\n * moment later. Switching every slice at the same instant reads as the chart\n * changing state; letting it travel reads as attention moving to one slice.\n * At rest (`hi` of 0 or 1) every slice still lands on the same value, so the\n * stagger only exists during the transition.\n */\n const fadeFor = (pos: number): number => {\n if (hoveredPos < 0) return hi;\n const diff = Math.abs(midFrac[pos] - midFrac[hoveredPos]);\n // Ring distance: 0 next to the hovered slice, 1 diametrically opposite.\n const dist = Math.min(diff, 1 - diff) * 2;\n const lag = dist * FADE_STAGGER;\n return Math.max(0, Math.min(1, (hi - lag) / (1 - lag || 1)));\n };\n\n // Each slice's cumulative EXPLODE offset (its own + every selected ancestor's),\n // so a picked parent carries its whole radial wedge — the outer child slices AND\n // their labels — out with it, instead of sliding out from under them.\n const offOf = new Map<number, { x: number; y: number }>();\n visible.forEach(({ d, i }, pos) => {\n const fade = fadeFor(pos);\n const frac = total > 0 ? d.value / total : 0;\n const sliceSweep = availSweep * frac;\n const a0 = cursor + (sign * perPad) / 2;\n const a1 = a0 + sliceSweep;\n cursor = a1 + (sign * perPad) / 2;\n\n const mid = (a0 + a1) / 2;\n // Hover does NOT displace the slice. Moving the thing under the pointer\n // makes the pointer leave it, and on a pie it also breaks the ring the eye\n // is reading proportions from. Instead the hovered slice gains a raised\n // outer ring and the others fade back, so the emphasis is unmistakable and\n // the geometry never moves. `selected` still explodes — that is a pinned\n // state a consumer sets, not a transient pointer one.\n const isHovered = hovering && (spec.highlightIndex === i || spec.highlight === 'series');\n // The BAND marks the slice the pointer is on; the fade spares its family\n // too. A version and the browser it belongs to are the same answer, so\n // dimming the parent would tell the reader they were unrelated.\n const litByFamily = hovering && sameFamily(spec.data, i, spec.highlightIndex ?? -1);\n const ex = (d.selectT ?? (d.selected ? 1 : 0)) * SELECT_OFFSET;\n const scx = cx + Math.cos(mid) * ex;\n const scy = cy + Math.sin(mid) * ex;\n offOf.set(i, { x: scx - cx, y: scy - cy });\n\n // Everything the pointer is not on fades toward the surface, so the hovered\n // slice reads as the answer without changing size. `hi > 0` so a fully\n // untweened frame hands back the ORIGINAL colour rather than an equal-but-\n // reserialised one. Held in a variable because the LABEL that sits on this\n // slice has to be contrasted against what is actually painted: read off\n // `d.color`, a white label stayed white while its slice faded to near the\n // surface, and every dimmed slice lost its number.\n const fill = hovering && !isHovered && !litByFamily && fade > 0 ? mixColor(d.color, theme.surface, 0.62 * fade) : d.color;\n\n // The ring goes in FIRST so the slice paints over its inner edge, leaving\n // only the band that extends past the radius — a lifted rim, not an outline.\n if (isHovered && hi > 0) pushBand(scx, scy, outerFor(0, i), a0, a1, d.color);\n slices.push({\n cx: scx,\n cy: scy,\n // Stops on the hub circle rather than at the centre — see `hubCut`.\n innerR: Math.max(ringInner(0), hubCut),\n outerR: outerFor(0, i),\n startAngle: a0,\n endAngle: a1,\n color: fill,\n dataIndex: i,\n cornerRadius: spec.cornerRadius,\n // The separation from the neighbouring wedges is part of THIS wedge's\n // shape, not a line drawn over the join afterwards. See `SceneSlice.gap`.\n gap: sepWidth,\n gapColor: sepColor,\n gradient: spec.gradient ? gradientFor(d.color, theme) : undefined,\n });\n span.set(i, { a0, a1 });\n\n // Two different questions of \"is there room\". An INSIDE label has to fit\n // within the wedge, so a thin one cannot carry it; an OUTSIDE label sits\n // clear of the chart on a leader line, and a leader can point at a sliver\n // as well as at anything else — holding both to the inside threshold left\n // the small slices unnamed for no reason.\n // Every level-0 slice of a nested chart names itself INSIDE its own band,\n // including one with no breakdown — whose wedge runs on to the outer radius\n // (see `outerFor`). Giving that one the outer ring's leader treatment\n // instead is defensible, since its wedge IS out there, but it reads as a\n // category that wandered out of the inner ring rather than one that simply\n // has nothing inside it.\n const inside = !!legendPos || depth > 1;\n if (spec.showLabels && Math.abs(sliceSweep) > (inside ? LABEL_MIN_SWEEP_INSIDE : LABEL_MIN_SWEEP_LEADER)) {\n // Inside when something else already names the slices (a legend), and\n // ALWAYS when there is a ring outside this one: an inner name placed\n // outside has to reach past the outer ring's own labels, and the two\n // collide into an unreadable stack.\n if (inside) {\n // A legend already names the slices → put a compact value label *inside*\n // the slice (never overflows), with a contrast-aware colour.\n const r0 = ringInner(0);\n const r1 = outerFor(0, i);\n const labelR = r0 > 0 ? (r0 + r1) / 2 : r1 * 0.62;\n texts.push({\n x: scx + Math.cos(mid) * labelR,\n y: scy + Math.sin(mid) * labelR,\n // A nested chart's inner ring is a category, not a quantity — the\n // outer ring carries the numbers, and repeating them inside just\n // crowds a band that is already the narrower of the two.\n text: sliceLabel(d, spec, depth > 1 ? 'name' : 'value'),\n color: labelColorFor(fill),\n fontSize: theme.labelSize,\n align: 'center',\n baseline: 'middle',\n key: `pl-${i}`,\n });\n } else {\n // No legend → outside `name · value` label with a leader line (there's\n // full horizontal room without a legend gutter).\n //\n // The leader leaves THIS slice's rim, not the chart's. On a chart where\n // the radius carries a second dimension the two are different for every\n // slice but the longest, and anchoring at the chart's left every short\n // one with a line starting out in open space, pointing back at a wedge\n // it never touched.\n // The leader LEAVES this slice's own rim but the label sits outside the\n // whole chart. Both halves matter where the radius carries a second\n // dimension: anchored at the chart's rim, a short slice's line starts\n // out in open space pointing back at a wedge it never touched; stopped\n // just past its own rim, the label lands on a taller neighbour.\n // Collected rather than emitted, so labels that land on each other can\n // be spread apart before any of them is placed.\n outside.push({\n key: `pl-${i}`,\n text: sliceLabel(d, spec, 'both'),\n x1: scx + Math.cos(mid) * outerFor(0, i),\n y1: scy + Math.sin(mid) * outerFor(0, i),\n x: scx + Math.cos(mid) * (outerR + 12),\n y: scy + Math.sin(mid) * (outerR + 12),\n right: Math.cos(mid) >= 0,\n });\n }\n }\n });\n\n // Outside leader labels (level-0 here, outer rings below) are spread + placed\n // together AFTER every ring has contributed — see `placeOutsideLabels` below.\n\n // ── outer rings ──────────────────────────────────────────────\n // Each deeper level subdivides its PARENT's arc, so a child ring can never\n // disagree with the ring inside it. Children are taken in proportion to each\n // other rather than to the parent's own value: a parent whose children fall\n // short would otherwise be redrawn smaller than the number it reports.\n for (let level = 1; level < depth; level++) {\n const here = spec.data.map((d, i) => ({ d, i })).filter((x) => (x.d.level ?? 0) === level && !x.d.hidden);\n const byParent = new Map<number, { d: PieDatum; i: number }[]>();\n for (const x of here) {\n const p = x.d.parent ?? -1;\n if (!byParent.has(p)) byParent.set(p, []);\n byParent.get(p)!.push(x);\n }\n for (const [parentIdx, kids] of byParent) {\n const pSpan = span.get(parentIdx);\n if (!pSpan) continue;\n const sum = kids.reduce((a, k) => a + Math.max(0, k.d.value), 0);\n if (sum <= 0) continue;\n const sweepAll = pSpan.a1 - pSpan.a0;\n let cur = pSpan.a0;\n for (const { d, i } of kids) {\n const a0 = cur;\n const a1 = a0 + sweepAll * (Math.max(0, d.value) / sum);\n cur = a1;\n span.set(i, { a0, a1 });\n // Rings OUTSIDE the emphasised one step outward to make room for its\n // rim, rather than having the rim laid over them. The rim is the answer\n // to \"which slice\", and a highlight that has to cover its neighbour to\n // be seen reads as damage to the neighbour.\n //\n // Taken from the margin that is already there rather than reserved up\n // front: the ring stops `labelRoom` (≥6px) short of the plot edge and\n // the plot itself is inset 8px, so stepping out ten costs nothing at\n // rest and still cannot reach the edge of the box.\n const shove = level > hoveredLevel ? RIM_ROOM * hi : 0;\n const rIn = ringInner(level) + shove;\n const rOut = outerFor(level, i) + shove;\n // Hovering a slice keeps its own family lit: a version and the browser\n // it belongs to are the same answer, so dimming one of them would be\n // telling the reader they are unrelated.\n const related = hoveredPos < 0 || spec.highlightIndex === i || sameFamily(spec.data, i, spec.highlightIndex ?? -1);\n // Picked slices slide out of their ring at every level, not just the\n // innermost — a chart you can pick a slice on should not stop\n // responding once you reach the ring the detail lives in.\n const kex = (d.selectT ?? (d.selected ? 1 : 0)) * SELECT_OFFSET;\n const kmid = (a0 + a1) / 2;\n // Inherit the whole selected ancestry's explode, then add this slice's own,\n // so a picked parent moves this child AND its label out as one rigid wedge\n // rather than sliding the parent out from under a ring that stayed put.\n const pOff = offOf.get(parentIdx) ?? { x: 0, y: 0 };\n const ox = pOff.x + Math.cos(kmid) * kex;\n const oy = pOff.y + Math.sin(kmid) * kex;\n offOf.set(i, { x: ox, y: oy });\n slices.push({\n cx: cx + ox,\n cy: cy + oy,\n innerR: rIn,\n outerR: rOut,\n startAngle: a0,\n endAngle: a1,\n color: hovering && !related && hi > 0 ? mixColor(d.color, theme.surface, 0.62 * hi) : d.color,\n dataIndex: i,\n cornerRadius: spec.cornerRadius,\n gap: sepWidth,\n gapColor: sepColor,\n gradient: spec.gradient ? gradientFor(d.color, theme) : undefined,\n });\n // From the slice's OWN centre, which is not the ring's once it (or an\n // ancestor) has been picked out of it — anchored at the ring's, the rim\n // stayed behind while the slice it belongs to slid away from under it.\n if (hovering && spec.highlightIndex === i && hi > 0) {\n pushBand(cx + ox, cy + oy, rOut, a0, a1, d.color);\n }\n // Outer-ring labels go OUTSIDE with a leader line: the band is a\n // fraction of the radius by the time it is the third ring, and a name\n // inside it would not fit. They ride the wedge's offset too.\n const mid = (a0 + a1) / 2;\n if (spec.showLabels && Math.abs(a1 - a0) > LABEL_MIN_SWEEP_LEADER && level === depth - 1) {\n // Collected, not emitted, so outer labels that land on each other are\n // spread apart with the rest before any is placed (see `outside`).\n outside.push({\n key: `pl-${i}`,\n text: sliceLabel(d, spec, 'both'),\n x1: cx + ox + Math.cos(mid) * rOut,\n y1: cy + oy + Math.sin(mid) * rOut,\n x: cx + ox + Math.cos(mid) * (rOut + 12),\n y: cy + oy + Math.sin(mid) * (rOut + 12),\n right: Math.cos(mid) >= 0,\n });\n }\n }\n }\n }\n\n /**\n * placeOutsideLabels — spread every outside leader label apart, then place them.\n *\n * Two narrow slices side by side (an inner one AND its outer version) have\n * nearly the same mid-angle, so their labels land on the same spot and print\n * over each other — precisely on the small slices, the ones a label is most\n * needed for. Run over ALL rings' labels at once (level-0 + outer), it walks\n * each side top to bottom, pushes anything closer than a line-height down, then\n * shifts the whole column back if that ran it off an edge. The leader still\n * starts at its own slice's rim, so a label that moved is still tied to the\n * wedge it names.\n */\n if (outside.length) {\n const lineH = theme.labelSize * 1.45;\n for (const right of [true, false]) {\n const col = outside.filter((l) => l.right === right).sort((a, b) => a.y - b.y);\n if (!col.length) continue;\n for (let k = 1; k < col.length; k++) {\n if (col[k].y - col[k - 1].y < lineH) col[k].y = col[k - 1].y + lineH;\n }\n const over = col[col.length - 1].y - (height - lineH / 2);\n if (over > 0) for (const l of col) l.y -= over;\n const under = lineH / 2 - col[0].y;\n if (under > 0) for (const l of col) l.y += under;\n }\n for (const l of outside) {\n // What is left between the label's anchor and the edge of the chart. A\n // box can simply be too narrow for a long name beside a ring of any size,\n // and a label cut off mid-glyph by the edge reads as a rendering fault —\n // an ellipsis reads as a label that did not fit.\n const room = l.right ? width - 6 - l.x : l.x - 6;\n const fits = Math.max(3, Math.floor(room / (theme.labelSize * LABEL_CHAR_W)));\n const text = l.text.length > fits ? `${l.text.slice(0, fits - 1)}…` : l.text;\n leaders.push({ x1: l.x1, y1: l.y1, x2: l.x, y2: l.y, color: theme.gridLineColor, width: 1 });\n texts.push({\n x: l.x + (l.right ? 3 : -3),\n y: l.y,\n text,\n color: theme.textColorMuted,\n fontSize: theme.labelSize,\n align: l.right ? 'start' : 'end',\n baseline: 'middle',\n key: l.key,\n });\n }\n }\n\n // Bands go on TOP of every ring, never in ring order.\n slices.push(...hoverBands);\n\n if (spec.title) {\n // Title spans the full chart width (the ring is centred below it), so align\n // within a 12px-inset band rather than the ring's plot box.\n const tt = titlePlacement(spec.titleAlign, 12, width - 24);\n texts.push({ x: tt.x, y: 6, text: spec.title, color: theme.textColor, fontSize: theme.titleSize, fontWeight: 600, align: tt.align, baseline: 'top', key: 'title' });\n if (spec.subtitle) {\n texts.push({\n x: tt.x,\n y: 6 + theme.titleSize + 4,\n text: spec.subtitle,\n color: theme.textColorMuted,\n fontSize: theme.labelSize,\n align: tt.align,\n baseline: 'top',\n key: 'subtitle',\n });\n }\n }\n\n const legend: LegendItem[] = legendPos\n ? spec.data.map((d, i) => ({ label: d.label, color: d.color, seriesIndex: i, hidden: !!d.hidden, x: 0, y: 0 }))\n : [];\n\n return {\n width,\n height,\n plot,\n background: theme.background === 'transparent' ? undefined : theme.background,\n // Leader lines ride the gridlines channel (both backends draw it as segments).\n gridlines: leaders,\n axisLines: [],\n areas: [],\n bars: [],\n slices,\n lines: [],\n markers: [],\n texts,\n legend,\n legendPosition: legendPos ?? undefined,\n // Middle of the HOLE, not of the ring. On a full donut they are the same\n // point; on a half-donut the hole is a half-disc sitting above the ring\n // centre, and anchoring at the centre lays the caption across the arc.\n pieCenter: { x: cx, y: cy },\n ...(() => {\n // The usable box inside the hole is the largest RECTANGLE that fits it,\n // not the hole's bounding box: text laid out to the full diameter runs\n // past the arc near the top and bottom, where the circle has curved back\n // in. Scaling the hole's unit box by 1/√2 about the ring centre gives\n // exactly that rectangle — the inscribed square of a full circle, and the\n // max-area rectangle of a half-disc, which is just as wide but half as\n // tall and sits against the flat side.\n const h = partial ? sectorBox(startRad, sweepTotal, 0) : { x0: -1, x1: 1, y0: -1, y1: 1 };\n const k = innerR / Math.SQRT2;\n return {\n pieHoleSize: innerR > 0 ? (h.x1 - h.x0) * k : 0,\n pieHoleHeight: innerR > 0 ? (h.y1 - h.y0) * k : 0,\n pieCenterSlot: { x: cx + ((h.x0 + h.x1) / 2) * k, y: cy + ((h.y0 + h.y1) / 2) * k },\n };\n })(),\n xPositions: [],\n xValues: [],\n xLabels: [],\n hoverPoints: [],\n };\n}\n","/*\n * Chart engine — PieChartEngine\n * ===========================================================\n * The polar sibling of LineChartEngine / BarChartEngine. Same canvas\n * + DOM-overlay plumbing, but drives computePieLayout and\n * interacts in polar space: hover hit-tests the slice under the\n * pointer (radius + angle), explodes it, and shows a name/value/%\n * tooltip; clicks + the legend map to slice data indices.\n * ===========================================================\n */\n\nimport { computePieLayout, type PieChartSpec } from './pie-layout';\nimport type { EngineTheme } from './layout';\nimport { drawSceneCanvas } from './renderer-canvas';\nimport { syncOverlay } from './overlay';\nimport { watchDevicePixelRatio, type DprWatcher } from './dpr';\nimport { onColorFor } from './color';\nimport { resolveIntro, stepAnimation, prefersReducedMotion, expressiveEase, splitScene, easeInOutCubic, easeOutCubic } from './animate';\nimport type { MdChartAnimation } from '../types';\nimport { appendTooltipContent, clearHover } from './hover';\nimport type { MdChartTooltipContext, MdChartTooltipRenderer } from '../tooltip';\nimport type { EngineCallbacks } from './chart';\nimport type { LegendItem, RenderScene, SceneSlice } from './scene';\n\n/** Hover state-change duration. Short: it tracks a pointer, not a page load. */\nconst HOVER_TWEEN_MS = 260;\n\n/**\n * How long one drill step takes.\n *\n * Longer than the hover tween, because the whole ring is being replaced and the\n * viewer has to track a wedge becoming a chart; shorter than the intro, which\n * introduces a chart that was not there at all.\n */\nconst DRILL_MS = 520;\n\n/** How long a press ripple takes to reach the far edge of its slice and fade. */\nconst RIPPLE_MS = 450;\n\n/** Peak opacity of the ripple, matching the MD3 pressed state layer. */\nconst RIPPLE_ALPHA = 0.16;\n\n/** How long a slice takes to slide out (or back) when it is picked. */\nconst SELECT_MS = 300;\n\n/**\n * How far into a transition the slice labels arrive, as a fraction of it.\n *\n * They are placed for the SETTLED ring and live in the DOM overlay, so they\n * cannot be carried along with the wedges: shown from the start they sit off\n * their own slices — printed on the background during the intro, where the\n * wedge has not reached them yet, and off by a whole ring during a drill.\n * Waiting costs nothing, since there is no reading to take mid-flight.\n */\nconst LABEL_ARRIVES_AT = 0.8;\n\n\nexport class PieChartEngine {\n private canvas: HTMLCanvasElement;\n private overlay: HTMLDivElement;\n /** Legend lives here: same box, but NOT clipped, so a focus ring keeps its\n * outer pixels where the legend hugs the plot edge. */\n private legendLayer: HTMLDivElement;\n private hoverLayer: HTMLDivElement;\n private ctx: CanvasRenderingContext2D | null = null;\n private spec: PieChartSpec | null = null;\n private theme: EngineTheme | null = null;\n private scene: RenderScene | null = null;\n private cb: EngineCallbacks = {};\n private hoverRaf = 0;\n private hoverIndex = -1;\n private hasRendered = false;\n private introRaf = 0;\n /**\n * A drill queued for the NEXT render. Both levels have to be on screen at\n * once for the pivot wedge to be seen opening into its contents, so this\n * holds the scene being LEFT — after the data lands, the engine only has the\n * one being entered.\n */\n private pendingDrill: { index: number; up: boolean; leaving: RenderScene | null } | null = null;\n /**\n * A drill currently playing. Anything else that re-renders mid-flight — the\n * hover tween runs one every frame for 260ms, and the pointer is still on the\n * slice that was just clicked — would otherwise cancel the drill's rAF and\n * paint the settled ring. Keeping the window AND the start time lets a render\n * hand the transition back rather than end it, so the move continues against\n * whatever the new frame's colours are.\n */\n private drillRun: { index: number; up: boolean; frozen: RenderScene; start: number } | null = null;\n /** A press ripple in flight, and the device ratio to redraw it at. */\n private ripple: { dataIndex: number; x: number; y: number; max: number; color: string; start: number } | null = null;\n private rippleRaf = 0;\n private dpr = 1;\n private selectRaf = 0;\n private lastW = 0;\n private lastH = 0;\n private dprWatch: DprWatcher = watchDevicePixelRatio(() => this.render());\n private tooltipRender?: MdChartTooltipRenderer;\n /** Current strength of the hover treatment, tweened toward 0 or 1. */\n private hoverT = 0;\n private hoverTweenRaf = 0;\n\n constructor(private container: HTMLElement) {\n if (getComputedStyle(container).position === 'static') container.style.position = 'relative';\n\n this.canvas = document.createElement('canvas');\n this.canvas.style.cssText = 'position:absolute;inset:0;width:100%;height:100%;display:block';\n this.canvas.setAttribute('part', 'plot-canvas');\n\n this.overlay = document.createElement('div');\n this.overlay.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n this.legendLayer = document.createElement('div');\n this.legendLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:visible';\n\n this.hoverLayer = document.createElement('div');\n this.hoverLayer.style.cssText = 'position:absolute;inset:0;pointer-events:none;overflow:hidden';\n\n container.append(this.canvas, this.overlay, this.legendLayer, this.hoverLayer);\n this.ctx = this.canvas.getContext('2d');\n\n this.canvas.addEventListener('pointermove', this.handlePointerMove);\n this.canvas.addEventListener('pointerleave', this.handlePointerLeave);\n this.canvas.addEventListener('click', this.handleClick);\n this.canvas.addEventListener('pointerdown', this.handlePointerDown);\n }\n\n getScene(): RenderScene | null {\n return this.scene;\n }\n\n /** Pixel centre of the ring (for aligning a donut centre slot). */\n /** The largest rectangle that fits inside the donut hole, in CSS px\n * (zero-sized for a solid pie). */\n getHoleBox(): { width: number; height: number } {\n return { width: this.scene?.pieHoleSize ?? 0, height: this.scene?.pieHoleHeight ?? 0 };\n }\n\n getCenter(): { x: number; y: number } | null {\n if (!this.scene) return null;\n const slot = this.scene.pieCenterSlot;\n if (slot) return { x: slot.x, y: slot.y };\n return { x: this.scene.plot.x + this.scene.plot.width / 2, y: this.scene.plot.y + this.scene.plot.height / 2 };\n }\n\n\n\n /**\n * Replace the tooltip's CONTENT. The card chrome (surface, radius, shadow,\n * placement) stays, so a consumer who only wants different rows doesn't have\n * to rebuild the box — the same bargain the line/area tooltips offer.\n */\n setTooltip(opts: { render?: MdChartTooltipRenderer }): void {\n this.tooltipRender = opts.render;\n }\n\n setSpec(spec: PieChartSpec, theme: EngineTheme, cb: EngineCallbacks = {}): void {\n // A hover reading belongs to the data it was taken from. Swap the data —\n // a drill-down hands over a whole new level — and the card is still naming\n // the slice the pointer WAS over, so the chart shows the child level while\n // the tooltip reports the parent, with the old highlight arc drawn over\n // slices it no longer describes. Drop the hover state whenever the slices\n // change; a genuine hover re-arrives on the next pointermove.\n const before = this.spec?.data;\n const changed =\n !before ||\n before.length !== spec.data.length ||\n before.some((d, i) => d.label !== spec.data[i]?.label || d.value !== spec.data[i]?.value);\n\n this.spec = spec;\n this.theme = theme;\n this.cb = cb;\n\n if (changed && this.hoverIndex !== -1) {\n this.hoverIndex = -1;\n this.spec.highlightIndex = -1;\n clearHover(this.hoverLayer);\n }\n\n this.render();\n }\n\n resize(): void {\n // Skip the ResizeObserver's initial same-size callback so it can't cancel\n // the intro animation (see LineChartEngine.resize for the full rationale).\n const rect = this.container.getBoundingClientRect();\n if (Math.round(rect.width) === this.lastW && Math.round(rect.height) === this.lastH) return;\n this.render();\n }\n\n toDataURL(type = 'image/png'): string {\n return this.canvas.toDataURL(type);\n }\n\n dispose(): void {\n if (this.hoverRaf) cancelAnimationFrame(this.hoverRaf);\n // stopIntro rather than a bare cancel. Nothing depends on the clear here —\n // dispose() removes the canvas a few lines down — but routing EVERY cancel\n // of introRaf through stopIntro is what makes the invariant hold: the\n // inline opacity is only ever non-empty while the entrance loop is live.\n // The bug this fixes was one cancel site that forgot the clear.\n this.stopIntro();\n cancelAnimationFrame(this.hoverTweenRaf);\n cancelAnimationFrame(this.rippleRaf);\n cancelAnimationFrame(this.selectRaf);\n cancelAnimationFrame(this.selectRaf);\n this.canvas.removeEventListener('pointermove', this.handlePointerMove);\n this.canvas.removeEventListener('pointerleave', this.handlePointerLeave);\n this.canvas.removeEventListener('click', this.handleClick);\n this.canvas.removeEventListener('pointerdown', this.handlePointerDown);\n this.dprWatch.dispose();\n this.canvas.remove();\n this.overlay.remove();\n this.hoverLayer.remove();\n this.spec = null;\n this.scene = null;\n this.drillRun = null;\n }\n\n private render(): void {\n if (!this.spec || !this.theme) return;\n this.dprWatch.update();\n const rect = this.container.getBoundingClientRect();\n const w = Math.round(rect.width);\n const h = Math.round(rect.height);\n if (w < 2 || h < 2) return;\n this.lastW = w;\n this.lastH = h;\n\n const dpr = Math.min(window.devicePixelRatio || 1, 4);\n this.dpr = dpr;\n this.canvas.width = w * dpr;\n this.canvas.height = h * dpr;\n this.spec.highlightIndex = this.hoverIndex;\n this.spec.highlightT = this.hoverT;\n\n // Settle the layout + overlay first (the legend-reflow pass measures the DOM\n // legend), THEN draw/animate the geometry once so there's no double-paint.\n this.layoutAndOverlay(w, h);\n const legendEl = this.overlay.querySelector('[part=\"legend\"]') as HTMLElement | null;\n if (legendEl && this.spec.legend && this.spec.legend !== 'none') {\n const side = this.spec.legend === 'left' || this.spec.legend === 'right';\n const extent = side ? legendEl.offsetWidth : legendEl.offsetHeight;\n if (extent > 0 && Math.abs((this.spec.legendExtent ?? -1) - extent) > 2) {\n this.spec.legendExtent = extent;\n this.layoutAndOverlay(w, h);\n }\n }\n\n if (!this.scene) return;\n const { variant, duration } = resolveIntro(this.spec);\n const drill = this.pendingDrill;\n this.pendingDrill = null;\n if (drill?.leaving && variant !== 'none' && !prefersReducedMotion()) {\n this.hasRendered = true;\n this.playDrill(dpr, drill.index, drill.up, drill.leaving);\n return;\n }\n if (this.drillRun) {\n // Draw this render's frame of the move directly. Re-entering playDrill\n // would cancel and re-schedule its rAF, and with the hover tween\n // rendering on every tick the frame would be cancelled before it ever\n // ran — leaving a canvas that render() had just resized (and so cleared).\n // Clear (don't stop) the entrance fade: the drill loop's rAF lives in\n // `introRaf` too, so cancelling here would kill the move — but a drill\n // that interrupted the entrance must still undo its `opacity: 0`.\n this.hasRendered = true;\n this.clearIntroOpacity();\n this.drillFrame(dpr);\n return;\n }\n const animate = !this.hasRendered && variant !== 'none' && !prefersReducedMotion();\n // An EMPTY scene is not a chart that has been shown: a host that hydrates\n // before its data lands renders once with no slices, and treating that as\n // the first render spent the entrance on nothing. The first render with\n // geometry owns the entrance.\n const hasContent = this.scene.slices.length > 0;\n if (animate) {\n this.hasRendered = hasContent;\n this.playIntro(dpr, variant, duration);\n return;\n }\n this.hasRendered = this.hasRendered || hasContent;\n this.stopIntro();\n this.drawGeometry(this.scene, dpr);\n }\n\n /**\n * Clear what the entrance faded: the canvas' inline opacity and the slice\n * labels held back by {@link paceLabels}.\n *\n * The entrance is their only writer and its terminal frame their only\n * restorer, so every path that ends it early has to undo it here — otherwise\n * the ring is drawn into a canvas pinned at `opacity: 0` and never repainted.\n */\n private clearIntroOpacity(): void {\n this.canvas.style.opacity = '';\n // Clear the label props directly rather than via paceLabels(1). This runs\n // on every static render, and paceLabels stamps `transition: opacity 180ms`\n // on every slice label — inert while opacity is '', but it would silently\n // animate any later opacity change that used to be instant. The entrance's\n // own fade is unaffected: its completing frame calls paceLabels(1) itself.\n for (const el of Array.from(\n this.overlay.querySelectorAll<HTMLElement>('[data-key^=\"pl-\"]'),\n )) {\n el.style.transition = '';\n el.style.opacity = '';\n }\n }\n\n /** End the entrance loop AND undo the fade it applied. Use this instead of a\n * bare `cancelAnimationFrame(this.introRaf)` outside the loop itself — but\n * NOT while a drill owns `introRaf` (see render). */\n private stopIntro(): void {\n cancelAnimationFrame(this.introRaf);\n this.introRaf = 0;\n this.clearIntroOpacity();\n }\n\n /**\n * Animate the next data change as a drill through slice `index`.\n *\n * `down` captures that wedge from what is on screen NOW, so it must be called\n * before the new data lands; `up` names the wedge in the level being returned\n * TO, which only exists once that level has been laid out. Either way the new\n * ring unfurls out of the wedge that connects the two levels, so descending\n * and coming back are mirror images of one motion.\n */\n drill(index: number, direction: 'down' | 'up' = 'down'): void {\n this.pendingDrill = this.scene ? { index, up: direction === 'up', leaving: this.scene } : null;\n }\n\n /** Replay the entry animation from the start (uses the current spec's variant). */\n replay(): void {\n this.hasRendered = false;\n this.render();\n }\n\n private layoutAndOverlay(w: number, h: number): void {\n if (!this.spec || !this.theme) return;\n this.scene = computePieLayout(this.spec, this.theme, w, h);\n syncOverlay(this.overlay, this.scene, this.theme.fontFamily, { onLegendClick: this.onLegendToggle }, false, this.legendLayer);\n }\n\n private drawGeometry(scene: RenderScene, dpr: number): void {\n if (this.ctx) {\n this.ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawSceneCanvas(this.ctx, scene);\n }\n }\n\n /**\n * Hold the slice labels back until `t` reaches `LABEL_ARRIVES_AT`, then fade\n * them in. Re-read every frame: a render rebuilds the overlay, so the spans\n * hidden on the last pass are gone and their replacements are visible.\n */\n private paceLabels(t: number): void {\n for (const el of Array.from(this.overlay.querySelectorAll<HTMLElement>('[data-key^=\"pl-\"]'))) {\n el.style.transition = 'opacity 180ms ease';\n el.style.opacity = t >= LABEL_ARRIVES_AT ? '' : '0';\n }\n }\n\n private playIntro(dpr: number, variant: MdChartAnimation, duration: number): void {\n const target = this.scene;\n if (!target) return;\n this.stopIntro();\n // Grow + fade share one layer opacity: `alpha` < 1 fades the canvas in; an\n // empty string restores the stylesheet default once the entrance settles.\n // (Labels fade in on their own timeline via paceLabels.)\n const setOpacity = (a: number): void => {\n this.canvas.style.opacity = a < 1 ? String(a) : '';\n };\n setOpacity(stepAnimation(variant, target, 0).alpha);\n this.paceLabels(0);\n let start = 0;\n const frame = (now: number): void => {\n if (!start) start = now;\n const tRaw = (now - start) / duration;\n if (tRaw >= 1) {\n setOpacity(1);\n this.paceLabels(1);\n this.drawGeometry(target, dpr);\n return;\n }\n this.paceLabels(tRaw);\n const { scene, alpha } = stepAnimation(variant, target, tRaw);\n setOpacity(alpha);\n this.drawGeometry(scene, dpr);\n this.introRaf = requestAnimationFrame(frame);\n };\n this.introRaf = requestAnimationFrame(frame);\n }\n\n /** Start a drill between `frozen` (the level being left) and the current one. */\n private playDrill(dpr: number, index: number, up: boolean, frozen: RenderScene): void {\n if (!this.scene) return;\n // stopIntro, not a bare cancel: a drill armed while the entrance was still\n // fading in would otherwise inherit its `opacity: 0` and never clear it.\n this.stopIntro();\n this.drillRun = { index, up, frozen, start: performance.now() };\n const step = (): void => {\n if (!this.drillRun) return;\n if (this.drillFrame(dpr)) return; // settled\n this.introRaf = requestAnimationFrame(step);\n };\n // ONE loop. `step()` paints the opening frame and schedules its own\n // successor, so scheduling another here started a SECOND loop against the\n // same `drillRun`: two callbacks per frame, each advancing and painting the\n // transition, and only the later handle recorded in `introRaf` — so a\n // cancel stopped one and left the other running. The wedges were drawn\n // twice per frame from two different clocks, which is what made the two\n // levels look overlaid and jittery mid-drill.\n step();\n }\n\n /**\n * Paint one frame of the drill in flight. Returns true once it has settled.\n *\n * Reads `this.scene` rather than a captured target, so a render that lands\n * mid-move (a hover tween, a resize) is drawn at the move's current progress\n * instead of ending it — the transition carries on against the new frame's\n * colours.\n */\n private drillFrame(dpr: number): boolean {\n const run = this.drillRun;\n const target = this.scene;\n if (!run || !target) return true;\n const t = (performance.now() - run.start) / DRILL_MS;\n if (t >= 1) {\n this.drillRun = null;\n this.paceLabels(1);\n this.drawGeometry(target, dpr);\n return true;\n }\n this.paceLabels(t);\n // `outer` is the level that HAS the pivot's siblings — the parent, whichever\n // direction we are going. Only one of the two is live: the other was frozen\n // when the drill was armed, so the live one is read fresh each frame and\n // keeps up with whatever else re-rendered (a hover tween, a resize).\n // Re-centre the frozen level onto the live one before compositing. The two\n // levels rarely have the same number of legend entries — a drill swaps four\n // slices for two — so the legend gutter differs, the plot differs, and the\n // ring centre lands somewhere else. Drawn at their own centres the entering\n // ring sits visibly offset from the one it is supposed to be growing out of\n // (measured: 16px to the right on this demo). Aligning to the LIVE centre\n // means the move also settles exactly where it finishes, with no jump.\n const centreOf = (sc: RenderScene): { x: number; y: number } | null => {\n const sl = sc.slices?.find((x) => x.dataIndex >= 0) ?? sc.slices?.[0];\n return sl ? { x: sl.cx, y: sl.cy } : null;\n };\n const shiftScene = (sc: RenderScene, dx: number, dy: number): RenderScene =>\n !dx && !dy ? sc : { ...sc, slices: (sc.slices ?? []).map((sl) => ({ ...sl, cx: sl.cx + dx, cy: sl.cy + dy })) };\n\n const liveC = centreOf(target);\n const frozenC = centreOf(run.frozen);\n const frozen = liveC && frozenC ? shiftScene(run.frozen, liveC.x - frozenC.x, liveC.y - frozenC.y) : run.frozen;\n\n const outer = run.up ? target : frozen;\n const inner = run.up ? frozen : target;\n // Symmetric ease: a drill is a deliberate move between two states, not an\n // entrance, so it should not overshoot past the ring it is settling into.\n const eased = easeInOutCubic(t);\n const split = splitScene(outer, inner, run.index, run.up ? 1 - eased : eased);\n if (!split) return true;\n if (!this.ctx) return false;\n this.ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n drawSceneCanvas(this.ctx, this.withRipple(split.base));\n this.ctx.globalAlpha = split.overAlpha;\n drawSceneCanvas(this.ctx, split.over, false);\n this.ctx.globalAlpha = 1;\n return false;\n }\n\n private sliceAt(px: number, py: number): SceneSlice | null {\n if (!this.scene) return null;\n // Each slice is tested against ITS OWN centre, so a picked slice — which\n // sits out of the ring — is clickable where it is drawn rather than where\n // it used to be. (This once used one shared centre for everything, because\n // hover displaced the slice under the cursor and the moving hit region\n // flickered at its edges. Hover no longer moves anything: it raises a rim.\n // Being out of the ring is now a deliberate, held state, and a shape you\n // can see but not press is worse than any flicker.)\n //\n // Sharing a centre would also have to be the RING's, not the plot's: a\n // chart sweeping less than a full turn is fitted to the sector it paints,\n // which puts the centre on that sector's flat side. A half-donut's is at\n // the bottom of its box, so testing from the middle of the box put every\n // slice half a radius out and the tooltip only appeared where the two\n // regions happened to overlap.\n for (const s of this.scene.slices) {\n if (pointInSlice(px, py, s, s.cx, s.cy)) return s;\n }\n return null;\n }\n\n private handlePointerMove = (e: PointerEvent): void => {\n if (!this.scene) return;\n const rect = this.canvas.getBoundingClientRect();\n const px = e.clientX - rect.left;\n const py = e.clientY - rect.top;\n if (this.hoverRaf) cancelAnimationFrame(this.hoverRaf);\n this.hoverRaf = requestAnimationFrame(() => {\n this.hoverRaf = 0;\n const slice = this.sliceAt(px, py);\n const idx = slice ? slice.dataIndex : -1;\n // A slice does something when you click it — it picks, and it may drill —\n // so it should say so before the click, not after.\n this.canvas.style.cursor = slice ? 'pointer' : '';\n if (idx !== this.hoverIndex) {\n this.hoverIndex = idx;\n this.tweenHover();\n this.cb.onHover?.(idx);\n }\n this.renderTooltip(idx, px, py);\n });\n };\n\n /**\n * Move the highlight to a slice by index, as the pointer would — for keyboard\n * navigation. The tooltip is anchored at the slice's own mid-angle rather\n * than a cursor position, so it appears where the slice is instead of\n * wherever the mouse happens to have been left.\n *\n * `-1` clears, which is what leaving the plot does.\n */\n focusIndex(index: number): void {\n if (!this.scene) return;\n if (index < 0) {\n this.hoverLayer.textContent = '';\n if (this.hoverIndex !== -1) {\n this.hoverIndex = -1;\n this.tweenHover();\n }\n return;\n }\n const slice = this.scene.slices.find((s) => s.dataIndex === index);\n if (!slice) return;\n if (this.hoverIndex !== index) {\n this.hoverIndex = index;\n this.tweenHover();\n }\n // Anchor midway along the slice's arc, at the middle of its radial band.\n const mid = (slice.startAngle + slice.endAngle) / 2;\n const r = (slice.innerR + slice.outerR) / 2;\n this.renderTooltip(index, slice.cx + Math.cos(mid) * r, slice.cy + Math.sin(mid) * r);\n }\n\n /**\n * Ease the hover treatment toward its target instead of snapping.\n *\n * Only the highlight is tweened, never the layout: re-running the intro would\n * re-sweep the whole ring on every pointer move. Moving BETWEEN slices keeps\n * the strength where it is and just swaps which slice is lit, so the emphasis\n * travels rather than blinking off and on.\n */\n private tweenHover(): void {\n const target = this.hoverIndex >= 0 ? 1 : 0;\n if (prefersReducedMotion()) {\n this.hoverT = target;\n this.render();\n return;\n }\n cancelAnimationFrame(this.hoverTweenRaf);\n const from = this.hoverT;\n if (from === target) {\n this.render();\n return;\n }\n const t0 = performance.now();\n const step = (now: number) => {\n const p = Math.min(1, (now - t0) / HOVER_TWEEN_MS);\n // Expressive rather than a plain decelerate: it overshoots ~2% mid-way,\n // which is what gives the widening slice its slight push past the mark.\n this.hoverT = from + (target - from) * expressiveEase(p);\n this.render();\n if (p < 1) this.hoverTweenRaf = requestAnimationFrame(step);\n };\n this.hoverTweenRaf = requestAnimationFrame(step);\n }\n\n private handlePointerLeave = (): void => {\n if (this.hoverRaf) {\n cancelAnimationFrame(this.hoverRaf);\n this.hoverRaf = 0;\n }\n this.hoverLayer.textContent = '';\n if (this.hoverIndex !== -1) {\n this.hoverIndex = -1;\n this.canvas.style.cursor = '';\n this.tweenHover();\n this.cb.onHover?.(-1);\n }\n };\n\n /**\n * Start a ripple on the pressed slice.\n *\n * On POINTERDOWN, not click: the ripple is feedback that the press landed, so\n * it has to be there before whatever the click does. On a chart that drills,\n * a click-triggered one would be a few frames old by the time the level\n * changed out from under it.\n */\n private handlePointerDown = (e: PointerEvent): void => {\n const rect = this.canvas.getBoundingClientRect();\n const x = e.clientX - rect.left;\n const y = e.clientY - rect.top;\n const slice = this.sliceAt(x, y);\n if (slice) this.startRipple(x, y, slice);\n };\n\n /**\n * Activate a slice from the keyboard, as a click would.\n *\n * The ripple starts at the middle of the wedge's band rather than at a\n * pointer position, which is the closest thing to \"where the press landed\"\n * when there was no press.\n */\n activate(index: number): void {\n const slice = this.scene?.slices.find((s) => !s.pill && s.dataIndex === index);\n if (!slice) return;\n const mid = (slice.startAngle + slice.endAngle) / 2;\n const r = (slice.innerR + slice.outerR) / 2;\n this.startRipple(slice.cx + Math.cos(mid) * r, slice.cy + Math.sin(mid) * r, slice);\n this.toggleSelected(index);\n }\n\n private startRipple(x: number, y: number, slice: SceneSlice): void {\n if (prefersReducedMotion()) return;\n // Reach the FARTHEST corner of the wedge, so the ripple covers it however\n // off-centre the press was — a fixed radius leaves a slice half-lit.\n const corners = [slice.startAngle, slice.endAngle].flatMap((a) =>\n [slice.innerR, slice.outerR].map((r) => Math.hypot(slice.cx + Math.cos(a) * r - x, slice.cy + Math.sin(a) * r - y)),\n );\n this.ripple = {\n dataIndex: slice.dataIndex,\n x,\n y,\n max: Math.max(...corners, 1),\n color: onColorFor(slice.color),\n start: performance.now(),\n };\n cancelAnimationFrame(this.rippleRaf);\n const step = (): void => {\n if (!this.ripple) return;\n if ((performance.now() - this.ripple.start) / RIPPLE_MS >= 1) {\n this.ripple = null;\n // A drill paints every frame anyway; outside one, the last frame still\n // has the ripple on it and has to be replaced.\n if (!this.drillRun && this.scene) this.drawGeometry(this.scene, this.dpr);\n return;\n }\n // While a drill runs it owns the canvas and stamps the ripple itself;\n // driving a second redraw from here would fight it for the frame.\n if (!this.drillRun && this.scene) this.drawGeometry(this.withRipple(this.scene), this.dpr);\n this.rippleRaf = requestAnimationFrame(step);\n };\n this.rippleRaf = requestAnimationFrame(step);\n }\n\n /** The scene with the ripple's current frame on it, if one is in flight. */\n private withRipple(scene: RenderScene): RenderScene {\n const r = this.ripple;\n if (!r) return scene;\n const t = Math.min(1, (performance.now() - r.start) / RIPPLE_MS);\n return {\n ...scene,\n ripple: {\n dataIndex: r.dataIndex,\n x: r.x,\n y: r.y,\n // Decelerating outward, fading only over the tail — expanding and\n // fading at the same rate reads as a wash rather than as a touch.\n radius: r.max * easeOutCubic(t),\n color: r.color,\n alpha: RIPPLE_ALPHA * (1 - Math.max(0, (t - 0.35) / 0.65)),\n },\n };\n }\n\n private handleClick = (e: MouseEvent): void => {\n const rect = this.canvas.getBoundingClientRect();\n const slice = this.sliceAt(e.clientX - rect.left, e.clientY - rect.top);\n if (!slice) return;\n this.cb.onPointClick?.(0, slice.dataIndex, e as PointerEvent);\n this.toggleSelected(slice.dataIndex);\n };\n\n /**\n * Pick a slice, sliding it out of the ring — and put back whichever one was\n * out before.\n *\n * One at a time: the point of moving a slice is to say \"this one\", which two\n * of them cannot both do. Clicking the slice that is already out puts it back\n * and leaves none picked.\n *\n * A click that DRILLS replaces the data outright, which builds a fresh spec\n * and takes this with it, so a chart that navigates on click never ends up\n * with a slice stranded outside its ring.\n */\n private toggleSelected(index: number): void {\n const data = this.spec?.data;\n if (!data?.[index]) return;\n // Read the current offsets BEFORE the flags move, so the one going back in\n // starts from wherever it had got to rather than from fully out.\n const from = data.map((d) => d.selectT ?? (d.selected ? 1 : 0));\n const wasOut = !!data[index].selected;\n data.forEach((d, i) => {\n d.selected = i === index && !wasOut;\n });\n const to = data.map((d) => (d.selected ? 1 : 0));\n if (from.every((v, i) => v === to[i])) return;\n if (prefersReducedMotion()) {\n data.forEach((d, i) => (d.selectT = to[i]));\n this.render();\n return;\n }\n cancelAnimationFrame(this.selectRaf);\n const t0 = performance.now();\n const step = (now: number): void => {\n const p = Math.min(1, (now - t0) / SELECT_MS);\n // The same spring the hover rim uses, so a slice that is both hovered and\n // picked moves as one thing rather than on two different curves.\n const e = expressiveEase(p);\n data.forEach((d, i) => {\n d.selectT = from[i] + (to[i] - from[i]) * e;\n });\n this.render();\n if (p < 1) this.selectRaf = requestAnimationFrame(step);\n };\n this.selectRaf = requestAnimationFrame(step);\n }\n\n private renderTooltip(idx: number, px: number, py: number): void {\n this.hoverLayer.textContent = '';\n if (idx < 0 || !this.spec || !this.theme || !this.scene) return;\n const datum = this.spec.data[idx];\n if (!datum) return;\n // Against its OWN level. A nested chart's `data` holds every ring at once,\n // so summing all of it counts each parent and then its children again —\n // and a version came out as a share of roughly twice the chart.\n const total = this.spec.data.reduce(\n (sum, d) => (d.hidden || d.level !== datum.level || d.parent !== datum.parent ? sum : sum + d.value),\n 0,\n );\n const percent = total > 0 ? (datum.value / total) * 100 : 0;\n\n const tip = document.createElement('div');\n tip.setAttribute('part', 'tooltip');\n tip.style.cssText = [\n 'position:absolute',\n 'pointer-events:none',\n 'background:var(--md-sys-color-surface-container-high, #ECE6F0)',\n 'color:var(--md-sys-color-on-surface, #1C1B1F)',\n 'border-radius:8px',\n 'padding:8px 10px',\n 'box-shadow:0 2px 6px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.2)',\n `font:400 ${this.theme.labelSize}px ${this.theme.fontFamily}`,\n 'white-space:nowrap',\n 'z-index:2',\n ].join(';');\n if (this.tooltipRender) {\n const total2 = total;\n const content = this.tooltipRender({\n dataIndex: idx,\n axisValue: datum.label,\n axisLabel: datum.label,\n focusedSeriesIndex: idx,\n missing: [],\n series: this.spec.data.map((d, i) => ({\n seriesIndex: i,\n label: d.label,\n color: d.color,\n value: d.value,\n formattedValue: this.spec!.valueFormatter(d.value),\n // A pie's \"share\" is the reading most tooltips actually want.\n percent: total2 > 0 ? (d.value / total2) * 100 : 0,\n focused: i === idx,\n missing: false,\n })) as MdChartTooltipContext['series'],\n });\n if (content != null) {\n appendTooltipContent(tip, content);\n this.hoverLayer.appendChild(tip);\n this.placeTooltip(tip, px, py);\n }\n return;\n }\n\n const row = document.createElement('div');\n row.style.cssText = 'display:flex;align-items:center;gap:8px;line-height:1.5';\n const sw = document.createElement('span');\n sw.style.cssText = `width:10px;height:10px;border-radius:3px;background:${datum.color};flex:none`;\n const lbl = document.createElement('span');\n lbl.textContent = datum.label;\n lbl.style.cssText = 'flex:1';\n const val = document.createElement('strong');\n val.textContent = `${this.spec.valueFormatter(datum.value)} (${percent.toFixed(1)}%)`;\n row.append(sw, lbl, val);\n tip.appendChild(row);\n\n this.hoverLayer.appendChild(tip);\n this.placeTooltip(tip, px, py);\n }\n\n /** Keep the card on-screen: flip to the anchor's other side when it would\n * overflow, and clamp vertically. */\n private placeTooltip(tip: HTMLElement, px: number, py: number): void {\n if (!this.scene) return;\n const tw = tip.offsetWidth || 120;\n const th = tip.offsetHeight || 40;\n let left = px + 14;\n if (left + tw > this.scene.width - 4) left = px - tw - 14;\n const top = Math.max(4, Math.min(py - th / 2, this.scene.height - th - 4));\n tip.style.left = `${Math.max(4, left)}px`;\n tip.style.top = `${top}px`;\n }\n\n private onLegendToggle = (item: LegendItem): void => {\n if (this.spec) {\n const datum = this.spec.data[item.seriesIndex];\n if (datum) {\n datum.hidden = !datum.hidden;\n // Re-play the entry motion so the ring animates into its new\n // configuration (respects the variant + reduced-motion / 'none').\n this.hasRendered = false;\n this.render();\n this.cb.onLegendClick?.({ ...item, hidden: !!datum.hidden });\n return;\n }\n }\n this.cb.onLegendClick?.(item);\n };\n}\n\n/** Point-in-annular-sector test (radius band + angular span) about (cx, cy). */\nfunction pointInSlice(px: number, py: number, s: SceneSlice, cx: number, cy: number): boolean {\n const dx = px - cx;\n const dy = py - cy;\n const r = Math.hypot(dx, dy);\n if (r < s.innerR || r > s.outerR) return false;\n const lo = Math.min(s.startAngle, s.endAngle);\n const hi = Math.max(s.startAngle, s.endAngle);\n const twoPi = Math.PI * 2;\n // Reduce the offset from `lo` into [0, 2π) so the test works for ANY range —\n // including slices whose [lo,hi] lies entirely below −π (rotated pies/arcs),\n // which a one-directional `while (ang < lo)` fold would miss.\n let d = (Math.atan2(dy, dx) - lo) % twoPi;\n if (d < 0) d += twoPi;\n return d <= hi - lo;\n}\n","/* ==========================================================\n md-pie-chart — Material Design 3 pie / donut chart\n\n PUBLIC CSS CUSTOM PROPERTIES:\n --md-pie-chart-block-size Explicit chart height, overriding the aspect ratio (default: auto)\n --md-pie-chart-min-block-size Floor the chart height never drops below (density-aware)\n --md-pie-chart-aspect-ratio Width:height ratio when no block-size is set (default: 1 / 1, i.e. square)\n --md-pie-chart-background Chart surface fill (default: surface-container-low)\n --md-pie-chart-padding Inset between the host edge and the plot canvas (density-aware)\n --md-pie-chart-shape Corner radius of the chart surface (density-aware)\n --md-pie-chart-empty-color Empty-state text colour (default: on-surface-variant)\n --md-pie-chart-empty-background Empty-state overlay fill (defaults to the chart background)\n --md-pie-chart-empty-font Empty-state font family (default: body-medium)\n --md-pie-chart-empty-font-size Empty-state font size (default: body-medium, 14px)\n --md-pie-chart-empty-icon-size Size of an icon slotted into the empty state\n --md-pie-chart-center-color Text colour of the donut centre (the `center` slot)\n\n CSS PARTS:\n header Header row above the plot (hosts the `header` slot)\n canvas The plot surface the chart draws into\n center Donut centre overlay (hosts the `center` slot)\n empty Empty-state overlay, shown when there is no data\n loading Loading overlay, shown while `loading` is set\n footer Footer row below the plot (hosts the `footer` slot)\n tooltip The hover card, including one built by `tooltipRenderer`\n\n SLOTS:\n header Content for the header row, replacing the default title block\n center Centred in the donut hole — a KPI number, a label, an icon\n empty Replaces the empty-state message when there is no data\n loading Replaces the built-in spinner while `loading` is set\n footer Content for the footer row below the plot\n ========================================================== */\n\n:host {\n --_block-size: var(--md-pie-chart-block-size, auto);\n --_min-block-size: var(--md-pie-chart-min-block-size, max(140px, calc(200px + var(--md-sys-density-scale, 0) * 12px)));\n --_aspect-ratio: var(--md-pie-chart-aspect-ratio, 1 / 1);\n --_background: var(--md-pie-chart-background, var(--md-sys-color-surface-container-low, #F7F2FA));\n --_padding: var(--md-pie-chart-padding, max(8px, calc(16px + var(--md-sys-density-scale, 0) * 2px)));\n --_shape: var(--md-pie-chart-shape, max(8px, calc(16px + var(--md-sys-density-scale, 0) * 2px)));\n --_empty-color: var(--md-pie-chart-empty-color, var(--md-sys-color-on-surface-variant, #49454F));\n --_empty-background: var(--md-pie-chart-empty-background, var(--_background));\n --_empty-font: var(--md-pie-chart-empty-font, var(--md-sys-typescale-body-medium-font-family, Roboto, sans-serif));\n --_empty-font-size: var(--md-pie-chart-empty-font-size, var(--md-sys-typescale-body-medium-font-size, 14px));\n --_empty-icon-size: var(--md-pie-chart-empty-icon-size, 40px);\n --_center-color: var(--md-pie-chart-center-color, var(--md-sys-color-on-surface, #1C1B1F));\n\n display: block;\n position: relative;\n inline-size: 100%;\n block-size: var(--_block-size);\n min-block-size: var(--_min-block-size);\n background: var(--_background);\n padding: var(--_padding);\n border-radius: var(--_shape);\n box-sizing: border-box;\n aspect-ratio: var(--_aspect-ratio);\n}\n\n.md-pie-chart__header,\n.md-pie-chart__footer { display: contents; }\n\n.md-pie-chart__header > slot[name='header']::slotted(*),\n.md-pie-chart__footer > slot[name='footer']::slotted(*) {\n display: block;\n margin-block: 8px;\n}\n\n.md-pie-chart__canvas {\n position: absolute;\n inset: var(--_padding);\n min-block-size: 0;\n min-inline-size: 0;\n}\n\n/* Centre slot — only meaningful for donut variant. Sits\n absolutely positioned in the middle of the chart; pointer\n events are off so it doesn't intercept ECharts's hover\n detection on slices behind it. Authors can override\n `pointer-events: auto` on their slotted content if they\n want a clickable centre badge. */\n.md-pie-chart__center {\n position: absolute;\n /* Tracks the engine's computed ring centre (falls back to the box centre).\n PHYSICAL, not logical: the engine measures the ring on a canvas and hands\n back an offset from the host's top-left corner. `inset-inline-start`\n resolves to `right` under RTL, which took that same number as a distance\n from the other edge and pushed the centre content off the hole. */\n top: var(--_pie-center-y, 50%);\n left: var(--_pie-center-x, 50%);\n transform: translate(-50%, -50%);\n pointer-events: none;\n color: var(--_center-color);\n text-align: center;\n /* The `*-font` typescale tokens are full font SHORTHANDS (\"400 24px/32px\n Roboto\"), so assigning one to font-family is invalid and the declaration is\n dropped — the centre content silently fell back to the browser's serif.\n The `*-font-family` token is the family on its own. */\n font-family: var(--md-sys-typescale-headline-small-font-family, Roboto, system-ui, sans-serif);\n /* The centre of a race carries numbers that change every frame; equal-width\n digits stop the line reflowing under them. */\n font-variant-numeric: tabular-nums;\n display: flex;\n align-items: center;\n justify-content: center;\n /* Cap the content at the hole it sits in — a caption wider than the hole runs\n out over the ring and lands on the slices. `--_pie-hole` is published by the\n component from the engine's own geometry; the fallback keeps a solid pie\n (hole size 0) from collapsing the slot to nothing. */\n max-width: var(--md-pie-center-max-width, var(--_pie-hole, none));\n max-height: var(--md-pie-center-max-height, var(--_pie-hole-h, none));\n}\n\n.md-pie-chart__center > slot[name='center']::slotted(*) {\n pointer-events: auto;\n}\n\n.md-pie-chart__empty {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n box-sizing: border-box;\n padding: 24px;\n /* Mirrors the chart's own container — same surface and corner radius. The\n engine still draws a phantom 0-1 axis for an empty series, so an OPAQUE\n surface here masks that ghost grid instead of letting it show through\n behind the message. Column layout stacks a slotted icon above the text. */\n background: var(--_empty-background);\n border-radius: var(--_shape);\n color: var(--_empty-color);\n font-family: var(--_empty-font);\n font-size: var(--_empty-font-size);\n line-height: var(--md-sys-typescale-body-medium-line-height, 20px);\n pointer-events: none;\n text-align: center;\n}\n\n/* A slotted icon (e.g. a Material Symbols span) gets a sensible size and the\n muted empty-state colour without the consumer restyling it. */\n.md-pie-chart__empty ::slotted(.material-symbols-outlined),\n.md-pie-chart__empty ::slotted(.material-symbols-rounded),\n.md-pie-chart__empty ::slotted(.material-symbols-sharp),\n.md-pie-chart__empty ::slotted(.material-icons) {\n /* Document-level .material-symbols rules outrank ::slotted() in the cascade,\n so the size needs !important to win (same reason md-icon-button does it). */\n font-size: var(--_empty-icon-size) !important;\n line-height: 1;\n opacity: 0.55;\n}\n\n.md-pie-chart__a11y-table {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n@media (forced-colors: active) { :host { forced-color-adjust: auto; } }\n\n/* Loading state — an opaque overlay (the engine still draws a placeholder ring\n with no data), with the default indicator + label stacked in the middle. */\n.md-pie-chart__loading {\n position: absolute;\n inset: 0;\n z-index: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n box-sizing: border-box;\n padding: 24px;\n background: var(--_empty-background, var(--_background));\n border-radius: var(--_shape);\n color: var(--_empty-color);\n text-align: center;\n}\n\n.md-pie-chart__spinner {\n inline-size: 40px;\n block-size: 40px;\n}\n\n/* The plot takes focus for keyboard navigation, so it needs a visible ring.\n Same ring md-button uses, inset because the canvas fills its box. */\n.md-pie-chart__canvas:focus-visible {\n outline: 3px solid var(--md-sys-color-secondary, #625B71);\n outline-offset: -3px;\n border-radius: 4px;\n}\n\n/* Screen-reader-only live region: readable by AT, invisible on screen, and out\n of the layout. `display:none` would hide it from AT too. */\n.md-pie-chart__live {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n\n[part='legend'] button:focus-visible {\n /* Same ring md-button uses, so focus looks the same wherever it lands. The\n other charts already had this; without it the chips took the browser's\n default blue box, which belongs to no theme. */\n outline: 3px solid var(--md-sys-color-secondary, #625B71);\n outline-offset: 2px;\n border-radius: 6px;\n}\n\n/* ==========================================================\n DENSITY (local override)\n Maps the local `density` prop onto the same --md-sys-density-scale signal a\n global `data-density` ancestor sets. Declared on :host, so a local rung wins\n over the inherited global one. Every density-sensitive value in this file\n derives from that single signal by calc — never add a fixed per-rung ladder.\n ========================================================== */\n:host([density='-1']) { --md-sys-density-scale: -1; }\n:host([density='-2']) { --md-sys-density-scale: -2; }\n:host([density='-3']) { --md-sys-density-scale: -3; }\n:host([density='-4']) { --md-sys-density-scale: -4; }\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Event,\n EventEmitter,\n Element,\n Method,\n Watch,\n} from '@stencil/core';\nimport {\n buildChartSummary,\n buildDataTableHtml,\n harmonicPalette,\n mixColor,\n pickPaletteColor,\n readMdChartTheme,\n resolveSeriesColor,\n PieChartEngine,\n type EngineTheme,\n type PieChartSpec,\n type MdChartAnimation,\n type MdChartClickDetail,\n type MdChartLegendPosition,\n type MdChartTitleAlign,\n type MdChartTooltipRenderer,\n type MdChartTooltipTrigger,\n} from '../../utils/charts';\nimport { mirrorLegend } from '../../utils/charts/engine/rtl';\nimport type { MdPieDatum } from './md-pie-chart.types';\n\n/**\n * md-pie-chart — Material Design 3 pie / donut / semi-circle chart,\n * rendered by the in-house engine (Canvas2D + a DOM text overlay).\n * No ECharts.\n *\n * • `innerRadius` for donuts, `outerRadius` for footprint\n * • `startAngle` / `endAngle` for half-pies and arcs\n * • `paddingAngle` inter-slice gaps\n * • hover highlight (slice / series / none) + slice explode\n * • centred label slot (donut centre)\n * • role=\"figure\" + screen-reader-only data table\n */\n/** The list `d` belongs to, anywhere in the tree — its level, in other words. */\nfunction findSiblings(items: MdPieDatum[], d: MdPieDatum): MdPieDatum[] | null {\n if (items.includes(d)) return items;\n for (const item of items) {\n if (item.children?.length) {\n const found = findSiblings(item.children, d);\n if (found) return found;\n }\n }\n return null;\n}\n\n@Component({\n tag: 'md-pie-chart',\n styleUrl: 'md-pie-chart.css',\n shadow: true,\n})\nexport class MdPieChart {\n @Element() el!: HTMLElement;\n\n @Prop() label: string = '';\n /** Title alignment over the chart: `start` (left), `center`, or `end` (right). */\n @Prop({ attribute: 'title-align' }) titleAlign: MdChartTitleAlign = 'start';\n @Prop() data: MdPieDatum[] = [];\n\n /** Inner radius (`\"0%\"` = pie, `\"60%\"` = donut, or px number). */\n @Prop({ attribute: 'inner-radius' }) innerRadius: string | number = '0%';\n\n /** Outer radius. Defaults to `\"75%\"`. */\n @Prop({ attribute: 'outer-radius' }) outerRadius: string | number = '75%';\n\n /** Start angle in degrees (90 = 12-o'clock). */\n @Prop({ attribute: 'start-angle' }) startAngle: number = 90;\n\n /** End angle in degrees. */\n @Prop({ attribute: 'end-angle' }) endAngle: number = -270;\n\n /** Padding angle (degrees) between adjacent slices. */\n @Prop({ attribute: 'padding-angle' }) paddingAngle: number = 0;\n\n /** Border radius applied to each slice (reserved). */\n @Prop({ attribute: 'corner-radius' }) cornerRadius: number = 4;\n\n /** Show slice labels around the ring. */\n @Prop({ attribute: 'show-labels' }) showLabels: boolean = true;\n\n /**\n * What each slice's label says: its `value`, its `name`, or `both`. Defaults\n * to the value when a legend is present (it already names the slices) and to\n * both when there isn't one.\n */\n @Prop({ attribute: 'label-mode' }) labelMode?: 'value' | 'name' | 'both';\n\n /**\n * Render every slice as a shade of ONE colour instead of the categorical\n * palette — darkest first, lightening around the ring.\n *\n * Worth reaching for when the slices are ordered (a ranking, a funnel) rather\n * than merely different: a single hue stops the reader hunting for meaning in\n * colour that isn't there, and it survives most colour-vision deficiencies,\n * which a five-hue palette does not.\n *\n * Takes an MD3 role or any CSS colour. Present with no value (`monochrome`)\n * uses `primary`; absent means off — so an explicit empty string is the\n * \"on, with the default\" case rather than an accident.\n */\n @Prop({ attribute: 'monochrome' }) monochrome?: string;\n\n /**\n * Fill each slice with a gradient running outward from the centre, for depth.\n * Purely decorative — it changes nothing about what a slice means, which is\n * why it is off by default.\n */\n @Prop() gradient: boolean = false;\n\n /** Hover highlight scope: slice / series / none. */\n @Prop() highlight: 'slice' | 'series' | 'none' = 'slice';\n\n @Prop({ reflect: true }) legend: MdChartLegendPosition | 'none' = 'right';\n @Prop() tooltip: MdChartTooltipTrigger = 'item';\n /**\n * BCP-47 locale for the DEFAULT number formatting (tooltip values, the\n * screen-reader table). Empty follows the browser, which is the right default\n * only until the page has said otherwise; an explicit `valueFormatter` always\n * wins over it.\n */\n @Prop() locale: string = '';\n\n /** Sub-title, drawn under the title in the muted text colour. */\n @Prop() subtitle: string | undefined;\n\n /**\n * Replaces the generated `aria-label` outright. The default summary is\n * assembled in English; rather than translate it piecewise, hand over the\n * whole sentence built in your own language.\n */\n @Prop() summary: string = '';\n\n /** Translatable chrome for the screen-reader data table. */\n @Prop() tableLabels?: { category?: string; value?: string; share?: string };\n\n /** Message shown when `data` is empty. The `empty` slot overrides it. */\n @Prop({ attribute: 'label-empty' }) labelEmpty: string = 'No data to display';\n\n /** Show the loading overlay instead of the chart. */\n @Prop() loading: boolean = false;\n\n /** Text (and the spinner's accessible name) for the loading overlay. */\n @Prop({ attribute: 'loading-label' }) loadingLabel: string = 'Loading chart…';\n\n /**\n * Instructions announced when the plot receives keyboard focus. The plot is\n * focusable so a keyboard user can walk the slices; this is what tells them.\n */\n @Prop({ attribute: 'label-plot' }) labelPlot: string =\n 'Chart data. Use the arrow keys to move between slices, Home and End for the first and last, Escape to leave.';\n\n /** Template for the live announcement as focus moves. `%label%` is the slice\n * name, `%value%` its formatted value and `%percent%` its share. */\n @Prop({ attribute: 'label-point' }) labelPoint: string = '%label%: %value% (%percent%)';\n\n /** Replace the tooltip's content. See `md-line-chart`'s `tooltipRenderer`. */\n @Prop() tooltipRenderer?: MdChartTooltipRenderer;\n\n @Prop() valueFormatter?: (value: number) => string;\n\n /**\n * How the radial band is divided between the rings of a nested chart —\n * relative weights, innermost first. `[2, 1]` gives the inner ring twice the\n * width of the outer one.\n *\n * The default is not an even split: every ring but the outermost puts its\n * labels INSIDE its own band, so it has to be wide enough to hold a word,\n * while the outermost labels on leaders and needs no more than its arc.\n */\n @Prop() ringWidths?: number[];\n @Prop({ attribute: 'height' }) heightProp?: string;\n /** Disable all animation (shorthand for `animation=\"none\"`). */\n @Prop({ attribute: 'no-animation' }) noAnimation: boolean = false;\n /** Entry-animation variant: `expressive` (default), `grow`, `fade`, `draw`, or `none`. */\n @Prop() animation: MdChartAnimation = 'expressive';\n /** Entry-animation duration override in ms (≤ 0 disables). */\n @Prop({ attribute: 'animation-duration' }) animationDuration?: number;\n\n /**\n * Local density rung. Drives the same `--md-sys-density-scale` signal that a\n * global `data-density` ancestor sets, so a local value simply overrides the\n * inherited one. 0 = default, -4 = ultra-compact.\n */\n @Prop({ reflect: true }) density: 0 | -1 | -2 | -3 | -4 = 0;\n\n @Event() mdSliceClick!: EventEmitter<MdChartClickDetail<MdPieDatum>>;\n @Event() mdLegendClick!: EventEmitter<{ dataIndex: number; selected: boolean }>;\n @Event() mdReady!: EventEmitter<void>;\n\n @State() private mounted = false;\n\n /** Index the keyboard cursor sits on, or -1 when the plot isn't focused. */\n @State() private kbIndex = -1;\n\n /** Text for the aria-live region — what a screen reader speaks on move. */\n @State() private announcement = '';\n\n private engine: PieChartEngine | null = null;\n private ro: ResizeObserver | null = null;\n private chartHost?: HTMLDivElement;\n private a11yTableHost?: HTMLDivElement;\n private themeMql?: MediaQueryList;\n private themeListener?: () => void;\n\n /**\n * Legend toggles the USER made, kept across data updates.\n *\n * The engine self-toggles a slice on legend click, but that lives on the spec\n * — and the next `data` assignment rebuilds it from the prop and takes the\n * toggle with it. A chart re-fed live (a race, a poll) would un-hide whatever\n * the reader had just hidden. Keyed by the datum's identity so it survives the\n * refeed, while an explicit `data[i].hidden` still wins.\n */\n private legendHidden = new Map<string, boolean>();\n\n /** A stable key per datum — id, else label, else position. */\n private datumKeys(): string[] {\n const seen = new Map<string, number>();\n return this.flatDatums().map((d, i) => {\n const base = d.id != null ? `id:${d.id}` : d.label != null ? `label:${d.label}` : `pos:${i}`;\n const n = seen.get(base) ?? 0;\n seen.set(base, n + 1);\n return n === 0 ? base : `${base}#${n}`;\n });\n }\n\n componentDidLoad() {\n this.initChart();\n if (typeof window !== 'undefined' && window.matchMedia) {\n this.themeMql = window.matchMedia('(prefers-color-scheme: dark)');\n this.themeListener = () => this.applyEngine();\n this.themeMql.addEventListener?.('change', this.themeListener);\n }\n }\n disconnectedCallback() {\n this.ro?.disconnect();\n this.ro = null;\n this.engine?.dispose();\n this.engine = null;\n if (this.themeMql && this.themeListener) {\n this.themeMql.removeEventListener?.('change', this.themeListener);\n this.themeListener = undefined;\n this.themeMql = undefined;\n }\n }\n\n @Watch('data') @Watch('innerRadius') @Watch('outerRadius')\n @Watch('startAngle') @Watch('endAngle') @Watch('paddingAngle')\n @Watch('cornerRadius') @Watch('showLabels') @Watch('labelMode') @Watch('monochrome') @Watch('gradient') @Watch('highlight')\n @Watch('legend') @Watch('tooltip') @Watch('label') @Watch('titleAlign')\n @Watch('animation') @Watch('animationDuration')\n @Watch('ringWidths') @Watch('locale') @Watch('subtitle') @Watch('loading') @Watch('valueFormatter')\n onAnyPropChange() { this.applyEngine(); this.rebuildA11yTable(); }\n\n @Method()\n async resize(): Promise<void> {\n this.engine?.resize();\n }\n\n /** Replay the entry animation from the start (uses the current `animation`). */\n @Method()\n async replay(): Promise<void> {\n this.engine?.replay();\n }\n\n /**\n * Animate the next `data` change as a drill through one slice, so the levels\n * of a hierarchy read as connected rather than as unrelated charts.\n *\n * AWAIT it, then assign the new `data`. Like every Stencil `@Method` this one\n * resolves through a microtask, so a bare call lands AFTER a `data` assignment\n * on the next line — the swap renders un-animated and the drill arms itself\n * for whatever change comes after.\n *\n * ```ts\n * await chart.drill(e.detail.dataIndex); // descend into the clicked slice\n * chart.data = childrenOf(clicked);\n *\n * await chart.drill(indexOfChildInParent, 'up'); // …and back out of it\n * chart.data = parentLevel;\n * ```\n *\n * `down` names a slice of the data currently shown; `up` names a slice of the\n * data about to be shown — in both cases, the wedge that connects the two\n * levels. The new ring unfurls out of it, which run in reverse is what makes\n * coming back up read as zooming out of that same wedge. Falls back to a plain\n * swap when the index doesn't resolve, or under `prefers-reduced-motion`.\n */\n @Method()\n async drill(index: number, direction: 'down' | 'up' = 'down'): Promise<void> {\n this.engine?.drill(index, direction);\n }\n\n @Method()\n async toDataURL(): Promise<string> {\n return this.engine?.toDataURL('image/png') ?? '';\n }\n\n @Method()\n async getInstance(): Promise<PieChartEngine | null> {\n return this.engine;\n }\n\n private bindChartHost = (el?: HTMLDivElement) => { this.chartHost = el; };\n private bindA11yTableHost = (el?: HTMLDivElement) => { this.a11yTableHost = el; };\n\n private initChart() {\n this.makeEngine();\n this.applyEngine();\n this.rebuildA11yTable();\n this.mounted = true;\n this.mdReady.emit();\n }\n\n /** (Re)create the engine on the selected backend + wire its ResizeObserver. */\n private makeEngine() {\n if (!this.chartHost) return;\n this.ro?.disconnect();\n this.ro = null;\n this.engine?.dispose();\n try {\n this.engine = new PieChartEngine(this.chartHost);\n } catch {\n this.engine = null;\n }\n if (this.engine && typeof ResizeObserver !== 'undefined') {\n this.ro = new ResizeObserver(() => { this.engine?.resize(); this.updateCenterVars(); });\n this.ro.observe(this.chartHost);\n }\n }\n\n\n private buildEngineTheme(t: ReturnType<typeof readMdChartTheme>): EngineTheme {\n return {\n background: t.background,\n textColor: t.textColor,\n textColorMuted: t.textColorMuted,\n axisLineColor: t.axisLineColor,\n gridLineColor: t.gridColor,\n surface: t.surface,\n fontFamily: t.fontFamily,\n labelSize: t.labelSize,\n titleSize: t.titleSize,\n };\n }\n\n /**\n * Flatten the (possibly nested) data into the plain indexable list the engine\n * and every consumer-facing index address: tooltips, legend toggles, click\n * events and the screen-reader table all say \"slice N\", so the tree is\n * carried as `level` + `parent` rather than as nesting.\n *\n * A child with no colour of its own takes a lighter shade of its parent's, so\n * a family reads as one block of colour with its members as gradations —\n * cycling the palette again per child would make Chrome's versions look like\n * unrelated categories.\n */\n private flatten(t: ReturnType<typeof readMdChartTheme>, palette: string[]) {\n const keys = this.datumKeys();\n const out: {\n label: string;\n value: number;\n color: string;\n selected?: boolean;\n radius?: number;\n hidden: boolean;\n level: number;\n parent?: number;\n }[] = [];\n // One hue, stepped toward the surface. It stops short of the surface itself\n // so the palest slice is still a slice and not a hole in the chart.\n const monoBase =\n this.monochrome != null ? resolveSeriesColor(this.el, this.monochrome || 'primary', t.palette[0]) : null;\n const walk = (items: MdPieDatum[], level: number, parent: number | undefined, parentColor?: string) => {\n items.forEach((d, i) => {\n const base =\n parentColor != null\n ? mixColor(parentColor, t.surface, 0.18 + (i / Math.max(1, items.length)) * 0.42)\n : monoBase != null\n ? mixColor(monoBase, t.surface, (i / Math.max(1, items.length)) * 0.7)\n : palette[i] ?? pickPaletteColor(t.palette, i);\n const color = resolveSeriesColor(this.el, d.color, base);\n const at = out.length;\n out.push({\n label: d.label,\n value: d.value,\n color,\n selected: d.selected,\n radius: d.radius,\n hidden: d.hidden ?? this.legendHidden.get(keys[at]) ?? false,\n level,\n parent,\n });\n if (d.children?.length) walk(d.children, level + 1, at, color);\n });\n };\n walk(this.data ?? [], 0, undefined);\n return out;\n }\n\n /**\n * Every datum the chart draws, in the order the engine indexes them.\n *\n * `data` is a TREE — a nested chart's rings come from `children` — so walking\n * `data` alone reaches only the first level, and everything the keyboard did\n * with an index (move, announce, report) stopped at the inner ring while the\n * chart went on drawing the rest. Same depth-first walk as `flatten`, so the\n * positions line up with the engine's `dataIndex`.\n */\n private flatDatums(): MdPieDatum[] {\n const out: MdPieDatum[] = [];\n const walk = (items: MdPieDatum[]) => {\n for (const d of items) {\n out.push(d);\n if (d.children?.length) walk(d.children);\n }\n };\n walk(this.data ?? []);\n return out;\n }\n\n private buildSpec(t: ReturnType<typeof readMdChartTheme>): PieChartSpec {\n const rtl = typeof getComputedStyle === 'function' && getComputedStyle(this.el).direction === 'rtl';\n // `t.palette` is the role cycle: primary, tertiary, secondary, error, then\n // the containers. Take the three non-semantic accents off the front as the\n // ramp's anchors.\n const palette = harmonicPalette(t.palette.slice(0, 3), this.data.length, {\n light: t.surface,\n dark: t.textColor,\n });\n return {\n data: this.flatten(t, palette),\n title: this.label || undefined,\n subtitle: this.subtitle || undefined,\n titleAlign: this.titleAlign,\n innerRadius: this.innerRadius,\n outerRadius: this.outerRadius,\n startAngleDeg: this.startAngle,\n endAngleDeg: this.endAngle,\n paddingAngleDeg: this.paddingAngle,\n cornerRadius: this.cornerRadius,\n showLabels: this.showLabels,\n labelMode: this.labelMode,\n gradient: this.gradient,\n highlight: this.highlight,\n // Mirrored for an RTL chart: everything else about the layout already\n // turns round — the title anchors from the right, the chips run\n // right-to-left — so a legend that stayed on the same side would be the\n // one piece that did not. Applied to the SPEC so the gutter reserved for\n // it and the chips placed into it agree.\n legend: (rtl ? mirrorLegend(this.legend) : this.legend) as typeof this.legend,\n ringWidths: this.ringWidths,\n valueFormatter: (v: number) => this.formatValue(v),\n animation: this.noAnimation ? 'none' : this.animation,\n animationDuration: this.animationDuration,\n };\n }\n\n private applyEngine() {\n if (!this.engine) return;\n const t = readMdChartTheme(this.el);\n this.engine.setSpec(this.buildSpec(t), this.buildEngineTheme(t), {\n onLegendClick: (item) => {\n const key = this.datumKeys()[item.seriesIndex];\n if (key != null) this.legendHidden.set(key, !!item.hidden);\n this.mdLegendClick.emit({ dataIndex: item.seriesIndex, selected: !item.hidden });\n },\n onPointClick: (_si, di, e) => this.emitSliceClick(di, e),\n });\n this.engine.setTooltip({ render: this.tooltipRenderer });\n this.updateCenterVars();\n }\n\n /**\n * Align the donut centre slot with the engine's computed ring centre.\n *\n * `getCenter()` is CANVAS-relative, but the slot is positioned against the\n * HOST — so the chart's own padding has to be added back, or the centred\n * content sits exactly one padding up and to the left of the ring it is\n * supposed to be inside.\n */\n private updateCenterVars() {\n const c = this.engine?.getCenter();\n if (!c || !this.chartHost) return;\n const host = this.el.getBoundingClientRect();\n const canvas = this.chartHost.getBoundingClientRect();\n const dx = canvas.left - host.left;\n const dy = canvas.top - host.top;\n this.el.style.setProperty('--_pie-center-x', `${c.x + dx}px`);\n this.el.style.setProperty('--_pie-center-y', `${c.y + dy}px`);\n // Centre-slot content that is wider than the hole spills over the ring and\n // sits on top of the slices. Publishing the hole's size lets the slot cap\n // itself, so a long caption wraps inside the donut instead.\n const hole = this.engine?.getHoleBox();\n this.el.style.setProperty('--_pie-hole', hole && hole.width > 0 ? `${hole.width}px` : 'none');\n this.el.style.setProperty('--_pie-hole-h', hole && hole.height > 0 ? `${hole.height}px` : 'none');\n }\n\n /** Shared with the other charts, so the table's shape and its truncation\n * behaviour can't drift from theirs the way the hand-rolled one did. */\n private rebuildA11yTable() {\n if (!this.a11yTableHost) return;\n const total = this.data.reduce((acc, d) => acc + d.value, 0);\n const lb = this.tableLabels ?? {};\n this.a11yTableHost.innerHTML = buildDataTableHtml({\n title: this.label,\n xAxisLabel: lb.category ?? 'Category',\n xAxisData: this.data.map(d => d.label),\n locale: this.locale,\n // A pie's rows are its slices, so each \"series\" here is one column of the\n // table: the value, and the share it represents.\n series: [\n { label: lb.value ?? 'Value', data: this.data.map(d => d.value) },\n {\n label: lb.share ?? 'Share',\n data: this.data.map(d => (total > 0 ? (d.value / total) * 100 : 0)),\n },\n ],\n valueFormatter: v => (v == null ? '—' : this.formatValue(v)),\n });\n }\n\n /** A datum's value, through the consumer's formatter or the locale default. */\n private formatValue(v: number): string {\n return this.valueFormatter ? this.valueFormatter(v) : v.toLocaleString(this.locale || undefined);\n }\n\n /** Walk the slices with the keyboard. Without this the values are reachable\n * only by hovering, which no keyboard or screen-reader user can do. */\n private onPlotKeyDown = (e: KeyboardEvent) => {\n const last = this.flatDatums().length - 1;\n if (last < 0) return;\n const rtl = typeof getComputedStyle === 'function' && getComputedStyle(this.el).direction === 'rtl';\n // Slices run clockwise from `startAngle`, so \"next\" is the same key in both\n // directions on screen — but the READING direction still decides which\n // arrow means forward.\n const forward = rtl ? 'ArrowLeft' : 'ArrowRight';\n const back = rtl ? 'ArrowRight' : 'ArrowLeft';\n let next = this.kbIndex;\n switch (e.key) {\n case forward:\n case 'ArrowDown':\n next = this.kbIndex < 0 ? 0 : Math.min(last, this.kbIndex + 1);\n break;\n case back:\n case 'ArrowUp':\n next = this.kbIndex < 0 ? last : Math.max(0, this.kbIndex - 1);\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = last;\n break;\n case 'Escape':\n if (this.kbIndex < 0) return;\n next = -1;\n break;\n case 'Enter':\n case ' ':\n // Same outcome as clicking the slice: it reports, and it picks itself\n // out of the ring. Without this the keyboard could reach every slice\n // and do nothing with any of them.\n if (this.kbIndex < 0) return;\n e.preventDefault();\n this.emitSliceClick(this.kbIndex, e);\n this.engine?.activate(this.kbIndex);\n return;\n default:\n return;\n }\n e.preventDefault();\n this.moveKeyboardCursor(next);\n };\n\n /** One place both the pointer and the keyboard report a slice from, so the\n * two cannot describe the same event differently. */\n private emitSliceClick(index: number, nativeEvent: Event) {\n const datum = this.flatDatums()[index];\n if (!datum) return;\n this.mdSliceClick.emit({\n seriesIndex: 0,\n seriesId: datum.id,\n dataIndex: index,\n value: datum.value,\n nativeEvent: nativeEvent as PointerEvent,\n series: datum,\n });\n }\n\n private onPlotBlur = () => {\n if (this.kbIndex >= 0) this.moveKeyboardCursor(-1);\n };\n\n private moveKeyboardCursor(next: number) {\n this.kbIndex = next;\n this.engine?.focusIndex(next);\n if (next < 0) {\n this.announcement = '';\n return;\n }\n const flat = this.flatDatums();\n const d = flat[next];\n if (!d) return;\n // Against its OWN level, not the whole tree: a version is a share of its\n // browser, and reading it as a share of every slice on the chart — parents\n // and children together — would be a percentage of nothing.\n const siblings = this.data?.some((x) => x.children?.length)\n ? (findSiblings(this.data ?? [], d) ?? flat)\n : flat;\n const total = siblings.reduce((acc, x) => acc + x.value, 0);\n const pct = total > 0 ? (d.value / total) * 100 : 0;\n this.announcement = this.labelPoint\n .replace('%label%', d.label)\n .replace('%value%', this.formatValue(d.value))\n .replace('%percent%', `${pct.toLocaleString(this.locale || undefined, { maximumFractionDigits: 1 })}%`);\n }\n\n render() {\n // While loading, the loader owns the box — an empty-state message under it\n // would just be the wrong answer to \"where is my data?\".\n const empty = this.data.length === 0 && !this.loading;\n const summary =\n this.summary ||\n buildChartSummary({\n title: this.label,\n chartType: 'pie',\n seriesCount: this.data.length,\n locale: this.locale,\n });\n return (\n <Host\n class={{\n 'md-pie-chart': true,\n 'md-pie-chart--empty': empty,\n 'md-pie-chart--mounted': this.mounted,\n 'md-pie-chart--donut': this.innerRadius !== '0%' && this.innerRadius !== 0,\n }}\n role=\"figure\"\n aria-label={summary}\n aria-busy={this.loading ? 'true' : null}\n style={this.heightProp ? { blockSize: this.heightProp } : undefined}\n >\n <header class=\"md-pie-chart__header\" part=\"header\"><slot name=\"header\"></slot></header>\n <div\n class=\"md-pie-chart__canvas\"\n part=\"canvas\"\n ref={el => this.bindChartHost(el as HTMLDivElement)}\n tabindex={empty ? undefined : '0'}\n role={empty ? undefined : 'application'}\n aria-label={empty ? undefined : this.labelPlot}\n onKeyDown={this.onPlotKeyDown}\n onBlur={this.onPlotBlur}\n ></div>\n <div class=\"md-pie-chart__center\" part=\"center\" aria-hidden=\"true\">\n <slot name=\"center\"></slot>\n </div>\n {empty && (\n <div class=\"md-pie-chart__empty\" part=\"empty\">\n <slot name=\"empty\">{this.labelEmpty}</slot>\n </div>\n )}\n\n {/* Loader — an opaque overlay, because the engine still draws a\n placeholder ring when there is no data. */}\n {this.loading && (\n <div class=\"md-pie-chart__loading\" part=\"loading\" role=\"status\">\n {/* `loader` is the library-wide name for \"swap the loading affordance\";\n `loading` is kept as the older alias. Nesting them means either\n works — the outer slot falls back to the inner one, which falls\n back to the default below — and `loader` wins if both are given. */}\n <slot name=\"loader\">\n <slot name=\"loading\">\n <md-progress-indicator\n class=\"md-pie-chart__spinner\"\n variant=\"circular\"\n indeterminate\n label={this.loadingLabel}\n ></md-progress-indicator>\n <span class=\"md-pie-chart__loading-text\">{this.loadingLabel}</span>\n </slot>\n </slot>\n </div>\n )}\n <footer class=\"md-pie-chart__footer\" part=\"footer\"><slot name=\"footer\"></slot></footer>\n <div class=\"md-pie-chart__a11y-table\" ref={el => this.bindA11yTableHost(el as HTMLDivElement)}></div>\n\n {/* Narrates the keyboard cursor, politely. */}\n <div class=\"md-pie-chart__live\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {this.announcement}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"6UA6CA,SAASA,EAAYC,EAAeC,GAClC,MAAO,CAAEC,KAAMC,EAASH,EAAOC,EAAMG,QAAS,IAAMC,GAAIL,EAC1D,CAgBA,SAASM,EAAUC,EAAYC,EAAeC,GAC5C,MAAMC,EAAKH,EAAKC,EAChB,MAAMG,EAAKC,KAAKC,IAAIN,EAAIG,GACxB,MAAMI,EAAKF,KAAKG,IAAIR,EAAIG,GACxB,MAAMM,EAAe,GACrB,MAAMC,EAAe,GACrB,IAAK,MAAMC,IAAK,CAACP,EAAIG,GAAK,CACxB,IAAK,MAAMK,IAAK,CAAC,EAAGV,GAAW,CAC7BO,EAAGI,KAAKR,KAAKS,IAAIH,GAAKC,GACtBF,EAAGG,KAAKR,KAAKU,IAAIJ,GAAKC,E,EAK1B,MAAMI,EAAIX,KAAKY,GAAK,EACpB,IAAK,IAAIC,EAAIb,KAAKc,KAAKf,EAAKY,GAAIE,EAAIF,GAAKT,EAAIW,IAAK,CAChDT,EAAGI,KAAKR,KAAKS,IAAII,EAAIF,IACrBN,EAAGG,KAAKR,KAAKU,IAAIG,EAAIF,G,CAEvB,MAAO,CAAEI,GAAIf,KAAKC,OAAOG,GAAKY,GAAIhB,KAAKG,OAAOC,GAAKa,GAAIjB,KAAKC,OAAOI,GAAKa,GAAIlB,KAAKG,OAAOE,GAC1F,CAYA,SAASc,EAAWC,EAAkBd,EAAWe,GAC/C,OAAOC,EAAWF,EAAMd,EAAGe,IAAMC,EAAWF,EAAMC,EAAGf,EACvD,CAGA,SAASgB,EAAWF,EAAkBG,EAAaC,GACjD,IAAI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ement};
2
+ //# sourceMappingURL=md-progress-indicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":[],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{p as e,H as s,c as i,h as t,d as r,t as a}from"./p-bSpXNc5J.js";import{t as o}from"./p-DYBUr7K_.js";import{s as d,a as n,g as c,c as l,r as h}from"./p-DWxN44zD.js";import{d as m}from"./p-Hm3X1iai.js";const u=()=>`:host{--_icon-color:var(--md-radio-icon-color, var(--md-sys-color-on-surface-variant));--_selected-icon-color:var(--md-radio-selected-icon-color, var(--md-sys-color-primary));--_icon-size:var(--md-radio-icon-size, max(16px, calc(20px + var(--md-sys-density-scale, 0) * 1px)));--_inner-circle-size:var(--md-radio-inner-circle-size, max(8px, calc(10px + var(--md-sys-density-scale, 0) * 0.5px)));--_state-layer-size:max(24px, calc(var(--md-radio-state-layer-size, 40px) + var(--md-sys-density-scale, 0) * 4px));--_state-layer-color:var(--md-radio-state-layer-color, var(--md-sys-color-on-surface));--_selected-state-layer-color:var(--md-radio-selected-state-layer-color, var(--md-sys-color-primary));display:inline-flex;align-items:center;justify-content:center;position:relative;inline-size:max(32px, calc(48px + var(--md-sys-density-scale, 0) * 4px));block-size:max(32px, calc(48px + var(--md-sys-density-scale, 0) * 4px));cursor:pointer;border-radius:var(--md-sys-shape-corner-full, 50%);overflow:hidden;-webkit-tap-highlight-color:transparent;box-sizing:border-box;flex-shrink:0;vertical-align:middle;outline:none;color:var(--_state-layer-color)}:host(.md-radio--checked){color:var(--_selected-state-layer-color)}.md-radio__native{display:none}.md-radio__ripple-layer{position:absolute;inline-size:var(--_state-layer-size);block-size:var(--_state-layer-size);border-radius:var(--md-sys-shape-corner-full, 50%);overflow:hidden}:host(.md-radio--disabled) .md-radio__ripple-layer,:host([soft-disabled]) .md-radio__ripple-layer{display:none}.md-radio__state-layer{position:absolute;inline-size:var(--_state-layer-size);block-size:var(--_state-layer-size);border-radius:var(--md-sys-shape-corner-full, 50%);background-color:var(--_state-layer-color);opacity:0;transition:opacity var(--md-sys-motion-duration-short2, 100ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1));pointer-events:none}:host(.md-radio--unchecked:hover) .md-radio__state-layer{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}:host(.md-radio--unchecked:active) .md-radio__state-layer{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}:host(.md-radio--checked) .md-radio__state-layer{background-color:var(--_selected-state-layer-color)}:host(.md-radio--checked:hover) .md-radio__state-layer{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}:host(.md-radio--checked:active) .md-radio__state-layer{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}:host(:focus-visible)::after,:host(.md-radio--focus-ring)::after{content:'';position:absolute;inset:0;margin:auto;inline-size:var(--_state-layer-size);block-size:var(--_state-layer-size);border-radius:var(--md-sys-shape-corner-full, 50%);outline:3px solid var(--md-sys-color-secondary);outline-offset:0;pointer-events:none}.md-radio__container{position:relative;display:inline-flex;align-items:center;justify-content:center;inline-size:var(--_icon-size);block-size:var(--_icon-size);pointer-events:none;transition:transform var(--md-sys-motion-duration-medium4, 400ms) var(--md-sys-motion-easing-emphasized-decelerate, cubic-bezier(0.05, 0.7, 0.1, 1))}:host(.md-radio--pressed) .md-radio__container{transform:scale(0.82);transition:transform var(--md-sys-motion-duration-short4, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1))}.md-radio__outer{position:absolute;inset:0;border-radius:var(--md-sys-shape-corner-full, 50%);border:2px solid var(--_icon-color);box-sizing:border-box;transition:border-color var(--md-sys-motion-duration-short2, 100ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1))}:host(.md-radio--checked) .md-radio__outer{border-color:var(--_selected-icon-color)}.md-radio__inner{inline-size:var(--_inner-circle-size);block-size:var(--_inner-circle-size);border-radius:var(--md-sys-shape-corner-full, 50%);background-color:var(--_selected-icon-color);transform:scale(0);transition:transform var(--md-sys-motion-duration-medium4, 400ms) var(--md-sys-motion-easing-emphasized-decelerate, cubic-bezier(0.05, 0.7, 0.1, 1))}:host(.md-radio--checked) .md-radio__inner{transform:scale(1)}:host(.md-radio--disabled){cursor:default;pointer-events:none}:host(.md-radio--disabled.md-radio--unchecked) .md-radio__outer{border-color:color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity, 0.38) * 100%), transparent)}:host(.md-radio--disabled.md-radio--checked) .md-radio__outer{border-color:color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity, 0.38) * 100%), transparent)}:host(.md-radio--disabled.md-radio--checked) .md-radio__inner{background-color:color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity, 0.38) * 100%), transparent)}:host(.md-radio--disabled) .md-radio__state-layer{display:none}:host([soft-disabled]){cursor:default;pointer-events:auto}:host([soft-disabled].md-radio--unchecked) .md-radio__outer{border-color:color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity, 0.38) * 100%), transparent)}:host([soft-disabled].md-radio--checked) .md-radio__outer{border-color:color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity, 0.38) * 100%), transparent)}:host([soft-disabled].md-radio--checked) .md-radio__inner{background-color:color-mix(in srgb, var(--md-sys-color-on-surface) calc(var(--md-sys-state-disabled-content-opacity, 0.38) * 100%), transparent)}:host([soft-disabled]) .md-radio__state-layer{display:none}@media (prefers-reduced-motion: reduce){.md-radio__container,.md-radio__state-layer,.md-radio__outer,.md-radio__inner{transition:none}}@media (forced-colors: active){:host{forced-color-adjust:none}.md-radio__outer{border-color:ButtonText}:host(.md-radio--checked) .md-radio__outer{border-color:Highlight}:host(.md-radio--checked) .md-radio__inner{background-color:Highlight}:host(:focus-visible)::after,:host(.md-radio--focus-ring)::after{outline-color:Highlight}:host(.md-radio--disabled) .md-radio__outer{border-color:GrayText}:host(.md-radio--disabled.md-radio--checked) .md-radio__inner{background-color:GrayText}.md-radio__state-layer{display:none}}:host([density='-1']){--md-sys-density-scale:-1}:host([density='-2']){--md-sys-density-scale:-2}:host([density='-3']){--md-sys-density-scale:-3}:host([density='-4']){--md-sys-density-scale:-4}`;const y=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.__attachShadow();this.mdChange=i(this,"mdChange",7);this.mdFocus=i(this,"mdFocus",7);this.mdBlur=i(this,"mdBlur",7);this.mdValidityChange=i(this,"mdValidityChange",5);this.internals=this.attachInternals();this.valueMissingLabel="Please select one of these options.";this.customValidityMessage="";this.invalid=false;this.defaultChecked=false;this.checked=false;this.disabled=false;this.softDisabled=false;this.required=false;this.name="";this.value="";this.density=0;this.pressed=false;this.focused=false;this.programmaticFocus=false;this.managedTabIndex="0";this.parentLabel=null;this.lastValidityKey=null;this.handleLabelClick=e=>{if(!e.composedPath().includes(this.el)){this.handleClick()}};this.handleClick=()=>{if(this.isDisabled||this.checked)return;this.checked=true;this.mdChange.emit({checked:true,value:this.value})};this.handleKeyDown=e=>{if(this.isDisabled)return;if(e.key===" "){e.preventDefault();this.pressed=true;this.handleClick();o(this.el);setTimeout((()=>{this.pressed=false}),150);return}if(e.key==="ArrowDown"||e.key==="ArrowRight"){e.preventDefault();this.focusSibling(1)}else if(e.key==="ArrowUp"||e.key==="ArrowLeft"){e.preventDefault();this.focusSibling(-1)}};this.handleFocus=()=>{this.focused=true;this.mdFocus.emit()};this.handleBlur=()=>{this.focused=false;this.programmaticFocus=false;this.mdBlur.emit()};this.handlePointerDown=()=>{this.programmaticFocus=false;if(!this.isDisabled)this.pressed=true};this.handlePointerUp=()=>{this.pressed=false}}get isDisabled(){return this.disabled||this.softDisabled}connectedCallback(){this.parentLabel=this.el.closest("label");this.parentLabel?.addEventListener("click",this.handleLabelClick)}componentWillLoad(){this.defaultChecked=this.checked;this.syncFormValue()}componentDidLoad(){this.updateRovingTabIndex();this.syncGroupValidity()}disconnectedCallback(){this.parentLabel?.removeEventListener("click",this.handleLabelClick);this.parentLabel=null}onCheckedChange(e){if(e){this.uncheckOthers(this.el)}this.updateRovingTabIndex();this.syncFormValue();this.syncGroupValidity()}onValidityInputChange(){this.syncGroupValidity()}syncFormValue(){d(this.internals,this.checked?this.value||"on":null)}get groupHasSelection(){if(!this.name)return this.checked;const e=this.el.getRootNode();return Array.from(e.querySelectorAll(`md-radio[name="${this.name}"]`)).some((e=>{const s=e;return typeof s.checked==="boolean"?s.checked:e.hasAttribute("checked")}))}get groupIsRequired(){if(this.required)return true;if(!this.name)return false;const e=this.el.getRootNode();return Array.from(e.querySelectorAll(`md-radio[name="${this.name}"]`)).some((e=>e.hasAttribute("required")))}syncValidity(){this.invalid=this.customValidityMessage?true:this.groupIsRequired&&!this.groupHasSelection;n(this.internals,{missing:this.groupIsRequired&&!this.groupHasSelection,missingMessage:this.valueMissingLabel,customMessage:this.customValidityMessage});this.emitValidityChange()}syncGroupValidity(){this.syncValidity();if(!this.name)return;const e=this.el.getRootNode();e.querySelectorAll(`md-radio[name="${this.name}"]`).forEach((e=>{if(e!==this.el)e.syncValidityFromGroup?.()}))}async syncValidityFromGroup(){this.syncValidity()}formResetCallback(){this.checked=this.defaultChecked}async getValidity(){return c(this.internals)}emitValidityChange(){const e=c(this.internals);const s=`${e.valid}|${e.validationMessage}`;if(this.lastValidityKey===s)return;const i=this.lastValidityKey!==null;this.lastValidityKey=s;if(i)this.mdValidityChange.emit(e)}async checkValidity(){return l(this.internals)}async reportValidity(){return h(this.internals)}async setCustomValidity(e){this.customValidityMessage=e;this.syncValidity()}onDisabledChange(){this.updateRovingTabIndex()}async setFocus(){this.programmaticFocus=true;this.el.focus()}async setBlur(){this.el.blur()}async select(){if(this.isDisabled||this.checked)return;this.checked=true;this.mdChange.emit({checked:true,value:this.value})}updateRovingTabIndex(){if(this.disabled){this.managedTabIndex="-1";return}if(this.checked){this.managedTabIndex="0";return}if(!this.name){this.managedTabIndex="0";return}const e=this.el.getRootNode();const s=Array.from(e.querySelectorAll(`md-radio[name="${this.name}"]`));const i=s.some((e=>e!==this.el&&e.checked));if(i){this.managedTabIndex="-1";return}const t=s.find((e=>!e.disabled));this.managedTabIndex=t===this.el?"0":"-1"}uncheckOthers(e){if(!this.name)return;const s=this.el.getRootNode();const i=s.querySelectorAll(`md-radio[name="${this.name}"]`);i.forEach((s=>{if(s!==e&&s.hasAttribute("checked")){s.removeAttribute("checked")}}))}focusSibling(e){if(!this.name)return;const s=this.el.getRootNode();const i=Array.from(s.querySelectorAll(`md-radio[name="${this.name}"]`));const t=i.filter((e=>!e.hasAttribute("disabled")&&!e.hasAttribute("soft-disabled")));if(t.length===0)return;const r=t.indexOf(this.el);const a=(r+e+t.length)%t.length;const d=t[a];d.focus();d.setAttribute("checked","");o(d);d.dispatchEvent(new CustomEvent("mdChange",{detail:{checked:true,value:d.getAttribute("value")||""},bubbles:true,composed:true}))}render(){const e=this.isDisabled;return t(r,{key:"a423d9607194f4c390cbc948db8831ee8e6b9476",class:{"md-radio":true,"md-radio--checked":this.checked,"md-radio--unchecked":!this.checked,"md-radio--disabled":e,"md-radio--pressed":this.pressed,"md-radio--focused":this.focused,"md-radio--focus-ring":this.programmaticFocus},role:"radio","aria-invalid":this.invalid?"true":undefined,"aria-checked":String(this.checked),"aria-disabled":e?"true":undefined,"aria-required":this.required?"true":undefined,tabindex:this.managedTabIndex,onClick:this.handleClick,onKeyDown:this.handleKeyDown,onFocus:this.handleFocus,onBlur:this.handleBlur,onPointerDown:this.handlePointerDown,onPointerUp:this.handlePointerUp,onPointerLeave:this.handlePointerUp,onPointerCancel:this.handlePointerUp},t("span",{key:"c22bd6ccfa4d3a535fe80dcf1d3c31bcf215087b",class:"md-radio__ripple-layer","aria-hidden":"true"},t("md-ripple",{key:"3c100609ffabcf044653239ccda3ced354979368",disabled:e})),t("span",{key:"928cdd5130f486f2431a0521e64a1d574820421f",class:"md-radio__state-layer",part:"state-layer","aria-hidden":"true"}),t("span",{key:"a3eb375c03d15313343adc779e1256bac4e95cb5",class:"md-radio__container",part:"container","aria-hidden":"true"},t("span",{key:"20a32a470255aa8fd8218c0f629a6dfdcc726ebe",class:"md-radio__outer",part:"outer-circle"}),t("span",{key:"9b1234f873e067ae02ba0feedf18f08ce6f99326",class:"md-radio__inner",part:"inner-circle"})),t("input",{key:"5c957cc036da4fdd672cf0de970a1043fb51a9a2",type:"radio",class:"md-radio__native",checked:this.checked,disabled:this.disabled,required:this.required,name:this.name,value:this.value,"aria-hidden":"true",tabindex:"-1",onChange:()=>{}}))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{checked:[{onCheckedChange:0}],required:[{onValidityInputChange:0}],name:[{onValidityInputChange:0}],valueMissingLabel:[{onValidityInputChange:0}],disabled:[{onDisabledChange:0}]}}static get style(){return u()}},[65,"md-radio",{valueMissingLabel:[1,"value-missing-label"],checked:[1540],disabled:[516],softDisabled:[516,"soft-disabled"],required:[516],name:[513],value:[513],density:[514],invalid:[32],pressed:[32],focused:[32],programmaticFocus:[32],managedTabIndex:[32],syncValidityFromGroup:[64],getValidity:[64],checkValidity:[64],reportValidity:[64],setCustomValidity:[64],setFocus:[64],setBlur:[64],select:[64]},undefined,{checked:[{onCheckedChange:0}],required:[{onValidityInputChange:0}],name:[{onValidityInputChange:0}],valueMissingLabel:[{onValidityInputChange:0}],disabled:[{onDisabledChange:0}]}]);function f(){if(typeof customElements==="undefined"){return}const e=["md-radio","md-ripple"];e.forEach((e=>{switch(e){case"md-radio":if(!customElements.get(a(e))){customElements.define(a(e),y)}break;case"md-ripple":if(!customElements.get(a(e))){m()}break}}))}f();const p=y;const b=f;export{p as MdRadio,b as defineCustomElement};
2
+ //# sourceMappingURL=md-radio.js.map