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

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 (833) 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/lazy-loading-indicator-CoC-_DMs.js +69 -0
  9. package/dist/cjs/lazy-loading-indicator-CoC-_DMs.js.map +1 -0
  10. package/dist/cjs/loader.cjs.js +4 -3
  11. package/dist/cjs/loader.cjs.js.map +1 -1
  12. package/dist/cjs/md-accordion-item.cjs.entry.js +4 -4
  13. package/dist/cjs/md-accordion.cjs.entry.js +1 -1
  14. package/dist/cjs/md-app-bar.cjs.entry.js +2 -2
  15. package/dist/cjs/md-area-chart.cjs.entry.js +3 -3
  16. package/dist/cjs/md-autocomplete.cjs.entry.js +6 -5
  17. package/dist/cjs/md-autocomplete.cjs.entry.js.map +1 -1
  18. package/dist/cjs/md-avatar_2.cjs.entry.js +4 -4
  19. package/dist/cjs/md-badge.cjs.entry.js +3 -3
  20. package/dist/cjs/md-bar-chart.cjs.entry.js +3 -3
  21. package/dist/cjs/md-bottom-sheet.cjs.entry.js +5 -5
  22. package/dist/cjs/md-breadcrumb-item.cjs.entry.js +1 -1
  23. package/dist/cjs/md-breadcrumbs.cjs.entry.js +3 -3
  24. package/dist/cjs/md-button-group.cjs.entry.js +3 -3
  25. package/dist/cjs/{md-button_7.cjs.entry.js → md-button_6.cjs.entry.js} +14 -39
  26. package/dist/cjs/md-button_6.cjs.entry.js.map +1 -0
  27. package/dist/cjs/md-checkbox.cjs.entry.js +3 -3
  28. package/dist/cjs/md-chip.cjs.entry.js +3 -3
  29. package/dist/cjs/md-color-picker.cjs.entry.js +1 -1
  30. package/dist/cjs/md-date-picker.cjs.entry.js +2 -2
  31. package/dist/cjs/md-dialog.cjs.entry.js +3 -3
  32. package/dist/cjs/md-divider.cjs.entry.js +3 -3
  33. package/dist/cjs/md-fab-menu-item.cjs.entry.js +3 -3
  34. package/dist/cjs/md-fab-menu.cjs.entry.js +3 -3
  35. package/dist/cjs/md-fab.cjs.entry.js +3 -3
  36. package/dist/cjs/md-line-chart.cjs.entry.js +3 -3
  37. package/dist/cjs/md-list-item.cjs.entry.js +4 -4
  38. package/dist/cjs/md-list.cjs.entry.js +4 -4
  39. package/dist/cjs/md-loading-indicator-CmzdcYLR.js +33 -0
  40. package/dist/cjs/md-loading-indicator-CmzdcYLR.js.map +1 -0
  41. package/dist/cjs/md-loading-indicator.cjs.entry.js +11 -0
  42. package/dist/cjs/md-loading-indicator.cjs.entry.js.map +1 -0
  43. package/dist/cjs/md-menu-item-group.cjs.entry.js +1 -1
  44. package/dist/cjs/md-menu_2.cjs.entry.js +6 -6
  45. package/dist/cjs/md-meter.cjs.entry.js +1 -1
  46. package/dist/cjs/md-multi-select.cjs.entry.js +7 -6
  47. package/dist/cjs/md-multi-select.cjs.entry.js.map +1 -1
  48. package/dist/cjs/md-navigation-bar.cjs.entry.js +2 -2
  49. package/dist/cjs/md-navigation-rail-tab.cjs.entry.js +1 -1
  50. package/dist/cjs/md-navigation-rail.cjs.entry.js +1 -1
  51. package/dist/cjs/md-navigation-tab.cjs.entry.js +3 -3
  52. package/dist/cjs/md-number-field.cjs.entry.js +3 -3
  53. package/dist/cjs/md-organization-chart.cjs.entry.js +3 -3
  54. package/dist/cjs/md-otp-field.cjs.entry.js +4 -4
  55. package/dist/cjs/md-pie-chart.cjs.entry.js +1 -1
  56. package/dist/cjs/md-progress-indicator.cjs.entry.js +1 -1
  57. package/dist/cjs/md-rating.cjs.entry.js +1 -1
  58. package/dist/cjs/md-search.cjs.entry.js +8 -7
  59. package/dist/cjs/md-search.cjs.entry.js.map +1 -1
  60. package/dist/cjs/md-segmented-button-set.cjs.entry.js +1 -1
  61. package/dist/cjs/md-segmented-button.cjs.entry.js +1 -1
  62. package/dist/cjs/md-select-option.cjs.entry.js +2 -2
  63. package/dist/cjs/md-select.cjs.entry.js +7 -6
  64. package/dist/cjs/md-select.cjs.entry.js.map +1 -1
  65. package/dist/cjs/md-side-sheet.cjs.entry.js +1 -1
  66. package/dist/cjs/md-skeleton.cjs.entry.js +1 -1
  67. package/dist/cjs/md-slider.cjs.entry.js +3 -3
  68. package/dist/cjs/md-sparkline.cjs.entry.js +3 -3
  69. package/dist/cjs/md-split-button.cjs.entry.js +1 -1
  70. package/dist/cjs/md-status-dot.cjs.entry.js +2 -2
  71. package/dist/cjs/md-step.cjs.entry.js +1 -1
  72. package/dist/cjs/md-stepper.cjs.entry.js +1 -1
  73. package/dist/cjs/md-sub-menu-item.cjs.entry.js +1 -1
  74. package/dist/cjs/md-switch.cjs.entry.js +1 -1
  75. package/dist/cjs/md-tab-panel.cjs.entry.js +1 -1
  76. package/dist/cjs/md-tab-panels.cjs.entry.js +1 -1
  77. package/dist/cjs/md-tab.cjs.entry.js +1 -1
  78. package/dist/cjs/md-table-body.cjs.entry.js +1 -1
  79. package/dist/cjs/md-table-cell.cjs.entry.js +1 -1
  80. package/dist/cjs/md-table-container.cjs.entry.js +1 -1
  81. package/dist/cjs/md-table-expand-toggle.cjs.entry.js +1 -1
  82. package/dist/cjs/md-table-foot.cjs.entry.js +1 -1
  83. package/dist/cjs/md-table-head.cjs.entry.js +1 -1
  84. package/dist/cjs/md-table-pagination.cjs.entry.js +1 -1
  85. package/dist/cjs/md-table-row.cjs.entry.js +1 -1
  86. package/dist/cjs/md-table-sort-label.cjs.entry.js +1 -1
  87. package/dist/cjs/md-table-toolbar.cjs.entry.js +1 -1
  88. package/dist/cjs/md-table.cjs.entry.js +4 -4
  89. package/dist/cjs/md-tabs.cjs.entry.js +1 -1
  90. package/dist/cjs/md-text-field.cjs.entry.js +8 -8
  91. package/dist/cjs/md-time-picker.cjs.entry.js +2 -2
  92. package/dist/cjs/md-toolbar.cjs.entry.js +1 -1
  93. package/dist/cjs/md-transfer-list.cjs.entry.js +2 -2
  94. package/dist/cjs/md3.cjs.js +4 -3
  95. package/dist/cjs/md3.cjs.js.map +1 -1
  96. package/dist/cjs/{virtual-select-controller-CqriaZgm.js → virtual-select-controller-C5cSoKfB.js} +10 -9
  97. package/dist/cjs/virtual-select-controller-C5cSoKfB.js.map +1 -0
  98. package/dist/collection/collection-manifest.json +1 -1
  99. package/dist/collection/components/md-accordion-item/md-accordion-item.js +3 -3
  100. package/dist/collection/components/md-app-bar/md-app-bar.js +1 -1
  101. package/dist/collection/components/md-area-chart/md-area-chart.js +2 -2
  102. package/dist/collection/components/md-autocomplete/md-autocomplete.js +4 -3
  103. package/dist/collection/components/md-autocomplete/md-autocomplete.js.map +1 -1
  104. package/dist/collection/components/md-avatar/md-avatar.js +2 -2
  105. package/dist/collection/components/md-badge/md-badge.js +2 -2
  106. package/dist/collection/components/md-bar-chart/md-bar-chart.js +2 -2
  107. package/dist/collection/components/md-bottom-sheet/md-bottom-sheet.js +4 -4
  108. package/dist/collection/components/md-breadcrumbs/md-breadcrumbs.js +2 -2
  109. package/dist/collection/components/md-button/md-button.js +4 -3
  110. package/dist/collection/components/md-button/md-button.js.map +1 -1
  111. package/dist/collection/components/md-button-group/md-button-group.js +2 -2
  112. package/dist/collection/components/md-card/md-card.js +2 -2
  113. package/dist/collection/components/md-checkbox/md-checkbox.js +2 -2
  114. package/dist/collection/components/md-chip/md-chip.js +2 -2
  115. package/dist/collection/components/md-date-picker/md-date-picker.js +1 -1
  116. package/dist/collection/components/md-dialog/md-dialog.js +2 -2
  117. package/dist/collection/components/md-divider/md-divider.js +2 -2
  118. package/dist/collection/components/md-fab/md-fab.js +2 -2
  119. package/dist/collection/components/md-fab-menu/md-fab-menu.js +2 -2
  120. package/dist/collection/components/md-fab-menu-item/md-fab-menu-item.js +2 -2
  121. package/dist/collection/components/md-icon-button/md-icon-button.js +4 -4
  122. package/dist/collection/components/md-line-chart/md-line-chart.js +2 -2
  123. package/dist/collection/components/md-list/md-list.js +3 -3
  124. package/dist/collection/components/md-list-item/md-list-item.js +3 -3
  125. package/dist/collection/components/md-loading-indicator/md-loading-indicator.js +2 -2
  126. package/dist/collection/components/md-menu/md-menu.js +3 -3
  127. package/dist/collection/components/md-menu-item/md-menu-item.js +2 -2
  128. package/dist/collection/components/md-multi-select/md-multi-select.js +5 -4
  129. package/dist/collection/components/md-multi-select/md-multi-select.js.map +1 -1
  130. package/dist/collection/components/md-navigation-bar/md-navigation-bar.js +1 -1
  131. package/dist/collection/components/md-navigation-tab/md-navigation-tab.js +2 -2
  132. package/dist/collection/components/md-number-field/md-number-field.js +2 -2
  133. package/dist/collection/components/md-organization-chart/md-organization-chart.js +2 -2
  134. package/dist/collection/components/md-otp-field/md-otp-field.js +3 -3
  135. package/dist/collection/components/md-ripple/md-ripple.js +1 -1
  136. package/dist/collection/components/md-search/md-search.js +7 -6
  137. package/dist/collection/components/md-search/md-search.js.map +1 -1
  138. package/dist/collection/components/md-select/md-select.js +5 -4
  139. package/dist/collection/components/md-select/md-select.js.map +1 -1
  140. package/dist/collection/components/md-select-option/md-select-option.js +1 -1
  141. package/dist/collection/components/md-slider/md-slider.js +2 -2
  142. package/dist/collection/components/md-sparkline/md-sparkline.js +2 -2
  143. package/dist/collection/components/md-status-dot/md-status-dot.js +1 -1
  144. package/dist/collection/components/md-table/md-table.js +3 -3
  145. package/dist/collection/components/md-text-field/md-text-field.js +7 -7
  146. package/dist/collection/components/md-time-picker/md-time-picker.js +1 -1
  147. package/dist/collection/components/md-tooltip/md-tooltip.js +1 -1
  148. package/dist/collection/components/md-transfer-list/md-transfer-list.js +1 -1
  149. package/dist/collection/utils/lazy-loading-indicator.js +62 -0
  150. package/dist/collection/utils/lazy-loading-indicator.js.map +1 -0
  151. package/dist/collection/wasm/engine-abi.js +8 -2
  152. package/dist/collection/wasm/engine-abi.js.map +1 -1
  153. package/dist/components/index.js +1 -1
  154. package/dist/components/md-accordion-item.js +1 -1
  155. package/dist/components/md-accordion.js +1 -1
  156. package/dist/components/md-app-bar.js +1 -1
  157. package/dist/components/md-area-chart.js +1 -1
  158. package/dist/components/md-autocomplete.js +1 -1
  159. package/dist/components/md-autocomplete.js.map +1 -1
  160. package/dist/components/md-avatar.js +1 -1
  161. package/dist/components/md-badge.js +1 -1
  162. package/dist/components/md-bar-chart.js +1 -1
  163. package/dist/components/md-bottom-sheet.js +1 -1
  164. package/dist/components/md-breadcrumb-item.js +1 -1
  165. package/dist/components/md-breadcrumbs.js +1 -1
  166. package/dist/components/md-button-group.js +1 -1
  167. package/dist/components/md-button.js +1 -1
  168. package/dist/components/md-card.js +1 -1
  169. package/dist/components/md-checkbox.js +1 -1
  170. package/dist/components/md-chip.js +1 -1
  171. package/dist/components/md-color-picker.js +1 -1
  172. package/dist/components/md-date-picker.js +1 -1
  173. package/dist/components/md-date-picker.js.map +1 -1
  174. package/dist/components/md-dialog.js +1 -1
  175. package/dist/components/md-dialog.js.map +1 -1
  176. package/dist/components/md-divider.js +1 -1
  177. package/dist/components/md-divider.js.map +1 -1
  178. package/dist/components/md-fab-menu-item.js +1 -1
  179. package/dist/components/md-fab-menu.js +1 -1
  180. package/dist/components/md-fab.js +1 -1
  181. package/dist/components/md-icon-button.js +1 -1
  182. package/dist/components/md-line-chart.js +1 -1
  183. package/dist/components/md-line-chart.js.map +1 -1
  184. package/dist/components/md-list-item.js +1 -1
  185. package/dist/components/md-list.js +1 -1
  186. package/dist/components/md-loading-indicator.js +1 -1
  187. package/dist/components/md-menu-item-group.js +1 -1
  188. package/dist/components/md-menu-item.js +1 -1
  189. package/dist/components/md-menu.js +1 -1
  190. package/dist/components/md-meter.js +1 -1
  191. package/dist/components/md-multi-select.js +1 -1
  192. package/dist/components/md-multi-select.js.map +1 -1
  193. package/dist/components/md-navigation-bar.js +1 -1
  194. package/dist/components/md-navigation-rail-tab.js +1 -1
  195. package/dist/components/md-navigation-rail.js +1 -1
  196. package/dist/components/md-navigation-tab.js +1 -1
  197. package/dist/components/md-number-field.js +1 -1
  198. package/dist/components/md-organization-chart.js +1 -1
  199. package/dist/components/md-otp-field.js +1 -1
  200. package/dist/components/md-pie-chart.js +1 -1
  201. package/dist/components/md-progress-indicator.js +1 -1
  202. package/dist/components/md-radio.js +1 -1
  203. package/dist/components/md-rating.js +1 -1
  204. package/dist/components/md-ripple.js +1 -1
  205. package/dist/components/md-search.js +1 -1
  206. package/dist/components/md-search.js.map +1 -1
  207. package/dist/components/md-segmented-button-set.js +1 -1
  208. package/dist/components/md-segmented-button.js +1 -1
  209. package/dist/components/md-select-option.js +1 -1
  210. package/dist/components/md-select.js +1 -1
  211. package/dist/components/md-side-sheet.js +1 -1
  212. package/dist/components/md-skeleton.js +1 -1
  213. package/dist/components/md-slider.js +1 -1
  214. package/dist/components/md-snackbar.js +1 -1
  215. package/dist/components/md-snackbar.js.map +1 -1
  216. package/dist/components/md-sparkline.js +1 -1
  217. package/dist/components/md-split-button.js +1 -1
  218. package/dist/components/md-status-dot.js +1 -1
  219. package/dist/components/md-step.js +1 -1
  220. package/dist/components/md-step.js.map +1 -1
  221. package/dist/components/md-stepper.js +1 -1
  222. package/dist/components/md-stepper.js.map +1 -1
  223. package/dist/components/md-sub-menu-item.js +1 -1
  224. package/dist/components/md-switch.js +1 -1
  225. package/dist/components/md-tab-panel.js +1 -1
  226. package/dist/components/md-tab-panels.js +1 -1
  227. package/dist/components/md-tab.js +1 -1
  228. package/dist/components/md-table-body.js +1 -1
  229. package/dist/components/md-table-cell.js +1 -1
  230. package/dist/components/md-table-container.js +1 -1
  231. package/dist/components/md-table-expand-toggle.js +1 -1
  232. package/dist/components/md-table-foot.js +1 -1
  233. package/dist/components/md-table-head.js +1 -1
  234. package/dist/components/md-table-pagination.js +1 -1
  235. package/dist/components/md-table-pagination.js.map +1 -1
  236. package/dist/components/md-table-row.js +1 -1
  237. package/dist/components/md-table-sort-label.js +1 -1
  238. package/dist/components/md-table-toolbar.js +1 -1
  239. package/dist/components/md-table.js +1 -1
  240. package/dist/components/md-tabs.js +1 -1
  241. package/dist/components/md-text-field.js +1 -1
  242. package/dist/components/md-time-picker.js +1 -1
  243. package/dist/components/md-time-picker.js.map +1 -1
  244. package/dist/components/md-toolbar.js +1 -1
  245. package/dist/components/md-tooltip.js +1 -1
  246. package/dist/components/md-transfer-list.js +1 -1
  247. package/dist/components/p-1RSrsLOs.js +2 -0
  248. package/dist/components/p-1RSrsLOs.js.map +1 -0
  249. package/dist/components/p-2HV152w7.js +2 -0
  250. package/dist/components/p-2HV152w7.js.map +1 -0
  251. package/dist/components/p-6ZDAcEKN.js +2 -0
  252. package/dist/components/p-6ZDAcEKN.js.map +1 -0
  253. package/dist/components/p-B2fYoYe9.js +2 -0
  254. package/dist/components/p-B2fYoYe9.js.map +1 -0
  255. package/dist/components/p-BR6gfOQH.js +2 -0
  256. package/dist/components/p-BR6gfOQH.js.map +1 -0
  257. package/dist/components/p-Bz-JaJcA.js +2 -0
  258. package/dist/components/p-Bz-JaJcA.js.map +1 -0
  259. package/dist/components/p-C77M30dm.js +2 -0
  260. package/dist/components/p-C77M30dm.js.map +1 -0
  261. package/dist/components/p-CNgkGl_1.js +2 -0
  262. package/dist/components/p-CNgkGl_1.js.map +1 -0
  263. package/dist/components/p-CfBPnYW7.js +2 -0
  264. package/dist/components/p-CfBPnYW7.js.map +1 -0
  265. package/dist/components/p-D5Ht729E.js +2 -0
  266. package/dist/components/p-D5Ht729E.js.map +1 -0
  267. package/dist/components/p-DPqGg8C1.js +2 -0
  268. package/dist/components/p-DPqGg8C1.js.map +1 -0
  269. package/dist/components/p-De3E5Q8v.js +2 -0
  270. package/dist/components/p-De3E5Q8v.js.map +1 -0
  271. package/dist/components/p-Dm_7DA1f.js +2 -0
  272. package/dist/components/p-Dm_7DA1f.js.map +1 -0
  273. package/dist/components/p-Dz3R-2Wn.js +2 -0
  274. package/dist/components/p-Dz3R-2Wn.js.map +1 -0
  275. package/dist/components/p-Zjf9uhOr.js +2 -0
  276. package/dist/components/p-Zjf9uhOr.js.map +1 -0
  277. package/dist/components/p-ssLobpGS.js +2 -0
  278. package/dist/components/p-ssLobpGS.js.map +1 -0
  279. package/dist/components/p-tSoecrcz.js +2 -0
  280. package/dist/components/p-tSoecrcz.js.map +1 -0
  281. package/dist/components/p-zMR3UIR_.js +2 -0
  282. package/dist/components/p-zMR3UIR_.js.map +1 -0
  283. package/dist/components-csr/index.js +2 -0
  284. package/dist/components-csr/index.js.map +1 -0
  285. package/dist/components-csr/md-accordion-item.js +2 -0
  286. package/dist/components-csr/md-accordion-item.js.map +1 -0
  287. package/dist/components-csr/md-accordion.js +2 -0
  288. package/dist/components-csr/md-accordion.js.map +1 -0
  289. package/dist/components-csr/md-app-bar.js +2 -0
  290. package/dist/components-csr/md-app-bar.js.map +1 -0
  291. package/dist/components-csr/md-area-chart.js +2 -0
  292. package/dist/components-csr/md-area-chart.js.map +1 -0
  293. package/dist/components-csr/md-autocomplete.js +2 -0
  294. package/dist/components-csr/md-autocomplete.js.map +1 -0
  295. package/dist/components-csr/md-avatar.js +2 -0
  296. package/dist/components-csr/md-avatar.js.map +1 -0
  297. package/dist/components-csr/md-badge.js +2 -0
  298. package/dist/components-csr/md-badge.js.map +1 -0
  299. package/dist/components-csr/md-bar-chart.js +2 -0
  300. package/dist/components-csr/md-bar-chart.js.map +1 -0
  301. package/dist/components-csr/md-bottom-sheet.js +2 -0
  302. package/dist/components-csr/md-bottom-sheet.js.map +1 -0
  303. package/dist/components-csr/md-breadcrumb-item.js +2 -0
  304. package/dist/components-csr/md-breadcrumb-item.js.map +1 -0
  305. package/dist/components-csr/md-breadcrumbs.js +2 -0
  306. package/dist/components-csr/md-breadcrumbs.js.map +1 -0
  307. package/dist/components-csr/md-button-group.js +2 -0
  308. package/dist/components-csr/md-button-group.js.map +1 -0
  309. package/dist/components-csr/md-button.js +2 -0
  310. package/dist/components-csr/md-button.js.map +1 -0
  311. package/dist/components-csr/md-card.js +2 -0
  312. package/dist/components-csr/md-card.js.map +1 -0
  313. package/dist/components-csr/md-checkbox.js +2 -0
  314. package/dist/components-csr/md-checkbox.js.map +1 -0
  315. package/dist/components-csr/md-chip.js +2 -0
  316. package/dist/components-csr/md-chip.js.map +1 -0
  317. package/dist/components-csr/md-color-picker.js +2 -0
  318. package/dist/components-csr/md-color-picker.js.map +1 -0
  319. package/dist/components-csr/md-date-picker.js +2 -0
  320. package/dist/components-csr/md-date-picker.js.map +1 -0
  321. package/dist/components-csr/md-dialog.js +2 -0
  322. package/dist/components-csr/md-dialog.js.map +1 -0
  323. package/dist/components-csr/md-divider.js +2 -0
  324. package/dist/components-csr/md-divider.js.map +1 -0
  325. package/dist/components-csr/md-fab-menu-item.js +2 -0
  326. package/dist/components-csr/md-fab-menu-item.js.map +1 -0
  327. package/dist/components-csr/md-fab-menu.js +2 -0
  328. package/dist/components-csr/md-fab-menu.js.map +1 -0
  329. package/dist/components-csr/md-fab.js +2 -0
  330. package/dist/components-csr/md-fab.js.map +1 -0
  331. package/dist/components-csr/md-icon-button.js +2 -0
  332. package/dist/components-csr/md-icon-button.js.map +1 -0
  333. package/dist/components-csr/md-line-chart.js +2 -0
  334. package/dist/components-csr/md-line-chart.js.map +1 -0
  335. package/dist/components-csr/md-list-item.js +2 -0
  336. package/dist/components-csr/md-list-item.js.map +1 -0
  337. package/dist/components-csr/md-list.js +2 -0
  338. package/dist/components-csr/md-list.js.map +1 -0
  339. package/dist/components-csr/md-loading-indicator.js +2 -0
  340. package/dist/components-csr/md-loading-indicator.js.map +1 -0
  341. package/dist/components-csr/md-menu-item-group.js +2 -0
  342. package/dist/components-csr/md-menu-item-group.js.map +1 -0
  343. package/dist/components-csr/md-menu-item.js +2 -0
  344. package/dist/components-csr/md-menu-item.js.map +1 -0
  345. package/dist/components-csr/md-menu.js +2 -0
  346. package/dist/components-csr/md-menu.js.map +1 -0
  347. package/dist/components-csr/md-meter.js +2 -0
  348. package/dist/components-csr/md-meter.js.map +1 -0
  349. package/dist/components-csr/md-multi-select.js +2 -0
  350. package/dist/components-csr/md-multi-select.js.map +1 -0
  351. package/dist/components-csr/md-navigation-bar.js +2 -0
  352. package/dist/components-csr/md-navigation-bar.js.map +1 -0
  353. package/dist/components-csr/md-navigation-rail-tab.js +2 -0
  354. package/dist/components-csr/md-navigation-rail-tab.js.map +1 -0
  355. package/dist/components-csr/md-navigation-rail.js +2 -0
  356. package/dist/components-csr/md-navigation-rail.js.map +1 -0
  357. package/dist/components-csr/md-navigation-tab.js +2 -0
  358. package/dist/components-csr/md-navigation-tab.js.map +1 -0
  359. package/dist/components-csr/md-number-field.js +2 -0
  360. package/dist/components-csr/md-number-field.js.map +1 -0
  361. package/dist/components-csr/md-organization-chart.js +2 -0
  362. package/dist/components-csr/md-organization-chart.js.map +1 -0
  363. package/dist/components-csr/md-otp-field.js +2 -0
  364. package/dist/components-csr/md-otp-field.js.map +1 -0
  365. package/dist/components-csr/md-pie-chart.js +2 -0
  366. package/dist/components-csr/md-pie-chart.js.map +1 -0
  367. package/dist/components-csr/md-progress-indicator.js +2 -0
  368. package/dist/components-csr/md-progress-indicator.js.map +1 -0
  369. package/dist/components-csr/md-radio.js +2 -0
  370. package/dist/components-csr/md-radio.js.map +1 -0
  371. package/dist/components-csr/md-rating.js +2 -0
  372. package/dist/components-csr/md-rating.js.map +1 -0
  373. package/dist/components-csr/md-ripple.js +2 -0
  374. package/dist/components-csr/md-ripple.js.map +1 -0
  375. package/dist/components-csr/md-search.js +2 -0
  376. package/dist/components-csr/md-search.js.map +1 -0
  377. package/dist/components-csr/md-segmented-button-set.js +2 -0
  378. package/dist/components-csr/md-segmented-button-set.js.map +1 -0
  379. package/dist/components-csr/md-segmented-button.js +2 -0
  380. package/dist/components-csr/md-segmented-button.js.map +1 -0
  381. package/dist/components-csr/md-select-option.js +2 -0
  382. package/dist/components-csr/md-select-option.js.map +1 -0
  383. package/dist/components-csr/md-select.js +2 -0
  384. package/dist/components-csr/md-select.js.map +1 -0
  385. package/dist/components-csr/md-side-sheet.js +2 -0
  386. package/dist/components-csr/md-side-sheet.js.map +1 -0
  387. package/dist/components-csr/md-skeleton.js +2 -0
  388. package/dist/components-csr/md-skeleton.js.map +1 -0
  389. package/dist/components-csr/md-slider.js +2 -0
  390. package/dist/components-csr/md-slider.js.map +1 -0
  391. package/dist/components-csr/md-snackbar.js +2 -0
  392. package/dist/components-csr/md-snackbar.js.map +1 -0
  393. package/dist/components-csr/md-sparkline.js +2 -0
  394. package/dist/components-csr/md-sparkline.js.map +1 -0
  395. package/dist/components-csr/md-split-button.js +2 -0
  396. package/dist/components-csr/md-split-button.js.map +1 -0
  397. package/dist/components-csr/md-status-dot.js +2 -0
  398. package/dist/components-csr/md-status-dot.js.map +1 -0
  399. package/dist/components-csr/md-step.js +2 -0
  400. package/dist/components-csr/md-step.js.map +1 -0
  401. package/dist/components-csr/md-stepper.js +2 -0
  402. package/dist/components-csr/md-stepper.js.map +1 -0
  403. package/dist/components-csr/md-sub-menu-item.js +2 -0
  404. package/dist/components-csr/md-sub-menu-item.js.map +1 -0
  405. package/dist/components-csr/md-switch.js +2 -0
  406. package/dist/components-csr/md-switch.js.map +1 -0
  407. package/dist/components-csr/md-tab-panel.js +2 -0
  408. package/dist/components-csr/md-tab-panel.js.map +1 -0
  409. package/dist/components-csr/md-tab-panels.js +2 -0
  410. package/dist/components-csr/md-tab-panels.js.map +1 -0
  411. package/dist/components-csr/md-tab.js +2 -0
  412. package/dist/components-csr/md-tab.js.map +1 -0
  413. package/dist/components-csr/md-table-body.js +2 -0
  414. package/dist/components-csr/md-table-body.js.map +1 -0
  415. package/dist/components-csr/md-table-cell.js +2 -0
  416. package/dist/components-csr/md-table-cell.js.map +1 -0
  417. package/dist/components-csr/md-table-container.js +2 -0
  418. package/dist/components-csr/md-table-container.js.map +1 -0
  419. package/dist/components-csr/md-table-expand-toggle.js +2 -0
  420. package/dist/components-csr/md-table-expand-toggle.js.map +1 -0
  421. package/dist/components-csr/md-table-foot.js +2 -0
  422. package/dist/components-csr/md-table-foot.js.map +1 -0
  423. package/dist/components-csr/md-table-head.js +2 -0
  424. package/dist/components-csr/md-table-head.js.map +1 -0
  425. package/dist/components-csr/md-table-pagination.js +2 -0
  426. package/dist/components-csr/md-table-pagination.js.map +1 -0
  427. package/dist/components-csr/md-table-row.js +2 -0
  428. package/dist/components-csr/md-table-row.js.map +1 -0
  429. package/dist/components-csr/md-table-sort-label.js +2 -0
  430. package/dist/components-csr/md-table-sort-label.js.map +1 -0
  431. package/dist/components-csr/md-table-toolbar.js +2 -0
  432. package/dist/components-csr/md-table-toolbar.js.map +1 -0
  433. package/dist/components-csr/md-table.js +2 -0
  434. package/dist/components-csr/md-table.js.map +1 -0
  435. package/dist/components-csr/md-tabs.js +2 -0
  436. package/dist/components-csr/md-tabs.js.map +1 -0
  437. package/dist/components-csr/md-text-field.js +2 -0
  438. package/dist/components-csr/md-text-field.js.map +1 -0
  439. package/dist/components-csr/md-time-picker.js +2 -0
  440. package/dist/components-csr/md-time-picker.js.map +1 -0
  441. package/dist/components-csr/md-toolbar.js +2 -0
  442. package/dist/components-csr/md-toolbar.js.map +1 -0
  443. package/dist/components-csr/md-tooltip.js +2 -0
  444. package/dist/components-csr/md-tooltip.js.map +1 -0
  445. package/dist/components-csr/md-transfer-list.js +2 -0
  446. package/dist/components-csr/md-transfer-list.js.map +1 -0
  447. package/dist/components-csr/p-6WgHjhDg.js +2 -0
  448. package/dist/components-csr/p-6WgHjhDg.js.map +1 -0
  449. package/dist/{components/p-uTEkf0sE.js → components-csr/p-BEmwDSzw.js} +2 -2
  450. package/dist/{components/p-C8EP4S21.js → components-csr/p-BQKzjYcY.js} +2 -2
  451. package/dist/{components/p-BwXpiUsu.js → components-csr/p-BWMwewtY.js} +2 -2
  452. package/dist/{components/p-DXXUoRSH.js → components-csr/p-BZakoRau.js} +2 -2
  453. package/dist/components-csr/p-BZakoRau.js.map +1 -0
  454. package/dist/{md3/p-BjYKc1Ge.js → components-csr/p-BdEoSBtL.js} +2 -2
  455. package/dist/components-csr/p-BdEoSBtL.js.map +1 -0
  456. package/dist/{components/p-B0Opn6dK.js → components-csr/p-Bkt_X-6v.js} +2 -2
  457. package/dist/components-csr/p-Bx6--dQF.js.map +1 -0
  458. package/dist/components-csr/p-Bz-JaJcA.js +2 -0
  459. package/dist/components-csr/p-Bz-JaJcA.js.map +1 -0
  460. package/dist/{components/p-stybaFzj.js → components-csr/p-C3vB0Hd9.js} +2 -2
  461. package/dist/{components/p-B3MWYEEJ.js → components-csr/p-CF7mq5T7.js} +2 -2
  462. package/dist/{components/p-7fN_yCXW.js → components-csr/p-CVMM-tdC.js} +2 -2
  463. package/dist/components-csr/p-C_ogF68H.js.map +1 -0
  464. package/dist/components-csr/p-Cch_V1vi.js +2 -0
  465. package/dist/components-csr/p-Cch_V1vi.js.map +1 -0
  466. package/dist/components-csr/p-CfBPnYW7.js +2 -0
  467. package/dist/components-csr/p-CfBPnYW7.js.map +1 -0
  468. package/dist/components-csr/p-CxhZdOPw.js +2 -0
  469. package/dist/components-csr/p-CxhZdOPw.js.map +1 -0
  470. package/dist/{components/p-Ch2-tttM.js → components-csr/p-DMQ-6aj8.js} +2 -2
  471. package/dist/components-csr/p-DWxN44zD.js +2 -0
  472. package/dist/components-csr/p-DWxN44zD.js.map +1 -0
  473. package/dist/components-csr/p-DYBUr7K_.js +2 -0
  474. package/dist/components-csr/p-DYBUr7K_.js.map +1 -0
  475. package/dist/{components/p-e2HRV63Y.js → components-csr/p-DfcpeJAu.js} +2 -2
  476. package/dist/{components/p-Dp-w93ot.js → components-csr/p-DjKPc5EU.js} +2 -2
  477. package/dist/components-csr/p-DvOKnoqK.js.map +1 -0
  478. package/dist/components-csr/p-DzPKu-Ma.js.map +1 -0
  479. package/dist/{components/p-UdGDg2oJ.js → components-csr/p-If0JHsYV.js} +2 -2
  480. package/dist/components-csr/p-If0JHsYV.js.map +1 -0
  481. package/dist/components-csr/p-RLxbNqRv.js.map +1 -0
  482. package/dist/{components/p-6wZSqm_2.js → components-csr/p-R_guULjT.js} +2 -2
  483. package/dist/components-csr/p-bSpXNc5J.js +2 -0
  484. package/dist/components-csr/p-bSpXNc5J.js.map +1 -0
  485. package/dist/{components/p-Ddiw2Kjw.js → components-csr/p-uSMrgqAy.js} +2 -2
  486. package/dist/components-csr/package.json +3 -0
  487. package/dist/esm/{a11y-C6CRqodW.js → a11y-BckJ95d7.js} +3 -3
  488. package/dist/esm/{a11y-C6CRqodW.js.map → a11y-BckJ95d7.js.map} +1 -1
  489. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  490. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  491. package/dist/esm/{bar-chart-ZZrajEkM.js → bar-chart-BuTyuCbt.js} +4 -4
  492. package/dist/esm/{bar-chart-ZZrajEkM.js.map → bar-chart-BuTyuCbt.js.map} +1 -1
  493. package/dist/esm/{chart-32olae06.js → chart-ByIhkqsG.js} +4 -4
  494. package/dist/esm/{chart-32olae06.js.map → chart-ByIhkqsG.js.map} +1 -1
  495. package/dist/esm/engine.wasm-CfBPnYW7.js +10 -0
  496. package/dist/esm/engine.wasm-CfBPnYW7.js.map +1 -0
  497. package/dist/esm/{hit-test-DHldf5Lm.js → hit-test-c_hI-yCX.js} +3 -3
  498. package/dist/esm/{hit-test-DHldf5Lm.js.map → hit-test-c_hI-yCX.js.map} +1 -1
  499. package/dist/esm/{index-DTaX19_O.js → index-WmvQpZnM.js} +5 -15
  500. package/dist/esm/index-WmvQpZnM.js.map +1 -0
  501. package/dist/esm/lazy-loading-indicator-BWFcjJiK.js +67 -0
  502. package/dist/esm/lazy-loading-indicator-BWFcjJiK.js.map +1 -0
  503. package/dist/esm/loader.js +4 -3
  504. package/dist/esm/loader.js.map +1 -1
  505. package/dist/esm/md-accordion-item.entry.js +4 -4
  506. package/dist/esm/md-accordion.entry.js +1 -1
  507. package/dist/esm/md-app-bar.entry.js +2 -2
  508. package/dist/esm/md-area-chart.entry.js +7 -7
  509. package/dist/esm/md-autocomplete.entry.js +6 -5
  510. package/dist/esm/md-autocomplete.entry.js.map +1 -1
  511. package/dist/esm/md-avatar_2.entry.js +4 -4
  512. package/dist/esm/md-badge.entry.js +3 -3
  513. package/dist/esm/md-bar-chart.entry.js +7 -7
  514. package/dist/esm/md-bottom-sheet.entry.js +5 -5
  515. package/dist/esm/md-breadcrumb-item.entry.js +2 -2
  516. package/dist/esm/md-breadcrumbs.entry.js +3 -3
  517. package/dist/esm/md-button-group.entry.js +3 -3
  518. package/dist/esm/{md-button_7.entry.js → md-button_6.entry.js} +16 -40
  519. package/dist/esm/md-button_6.entry.js.map +1 -0
  520. package/dist/esm/md-checkbox.entry.js +3 -3
  521. package/dist/esm/md-chip.entry.js +3 -3
  522. package/dist/esm/md-color-picker.entry.js +1 -1
  523. package/dist/esm/md-date-picker.entry.js +2 -2
  524. package/dist/esm/md-dialog.entry.js +3 -3
  525. package/dist/esm/md-divider.entry.js +3 -3
  526. package/dist/esm/md-fab-menu-item.entry.js +3 -3
  527. package/dist/esm/md-fab-menu.entry.js +3 -3
  528. package/dist/esm/md-fab.entry.js +3 -3
  529. package/dist/esm/md-line-chart.entry.js +7 -7
  530. package/dist/esm/md-list-item.entry.js +5 -5
  531. package/dist/esm/md-list.entry.js +4 -4
  532. package/dist/esm/md-loading-indicator-Bf-Pt29l.js +31 -0
  533. package/dist/esm/md-loading-indicator-Bf-Pt29l.js.map +1 -0
  534. package/dist/esm/md-loading-indicator.entry.js +5 -0
  535. package/dist/esm/md-loading-indicator.entry.js.map +1 -0
  536. package/dist/esm/md-menu-item-group.entry.js +1 -1
  537. package/dist/esm/md-menu_2.entry.js +6 -6
  538. package/dist/esm/md-meter.entry.js +1 -1
  539. package/dist/esm/md-multi-select.entry.js +7 -6
  540. package/dist/esm/md-multi-select.entry.js.map +1 -1
  541. package/dist/esm/md-navigation-bar.entry.js +2 -2
  542. package/dist/esm/md-navigation-rail-tab.entry.js +2 -2
  543. package/dist/esm/md-navigation-rail.entry.js +1 -1
  544. package/dist/esm/md-navigation-tab.entry.js +4 -4
  545. package/dist/esm/md-number-field.entry.js +3 -3
  546. package/dist/esm/md-organization-chart.entry.js +3 -3
  547. package/dist/esm/md-otp-field.entry.js +4 -4
  548. package/dist/esm/md-pie-chart.entry.js +3 -3
  549. package/dist/esm/md-progress-indicator.entry.js +1 -1
  550. package/dist/esm/md-rating.entry.js +1 -1
  551. package/dist/esm/md-search.entry.js +8 -7
  552. package/dist/esm/md-search.entry.js.map +1 -1
  553. package/dist/esm/md-segmented-button-set.entry.js +1 -1
  554. package/dist/esm/md-segmented-button.entry.js +1 -1
  555. package/dist/esm/md-select-option.entry.js +2 -2
  556. package/dist/esm/md-select.entry.js +7 -6
  557. package/dist/esm/md-select.entry.js.map +1 -1
  558. package/dist/esm/md-side-sheet.entry.js +1 -1
  559. package/dist/esm/md-skeleton.entry.js +1 -1
  560. package/dist/esm/md-slider.entry.js +3 -3
  561. package/dist/esm/md-sparkline.entry.js +7 -7
  562. package/dist/esm/md-split-button.entry.js +1 -1
  563. package/dist/esm/md-status-dot.entry.js +2 -2
  564. package/dist/esm/md-step.entry.js +1 -1
  565. package/dist/esm/md-stepper.entry.js +1 -1
  566. package/dist/esm/md-sub-menu-item.entry.js +1 -1
  567. package/dist/esm/md-switch.entry.js +1 -1
  568. package/dist/esm/md-tab-panel.entry.js +1 -1
  569. package/dist/esm/md-tab-panels.entry.js +1 -1
  570. package/dist/esm/md-tab.entry.js +1 -1
  571. package/dist/esm/md-table-body.entry.js +1 -1
  572. package/dist/esm/md-table-cell.entry.js +1 -1
  573. package/dist/esm/md-table-container.entry.js +1 -1
  574. package/dist/esm/md-table-expand-toggle.entry.js +1 -1
  575. package/dist/esm/md-table-foot.entry.js +1 -1
  576. package/dist/esm/md-table-head.entry.js +1 -1
  577. package/dist/esm/md-table-pagination.entry.js +1 -1
  578. package/dist/esm/md-table-row.entry.js +1 -1
  579. package/dist/esm/md-table-sort-label.entry.js +1 -1
  580. package/dist/esm/md-table-toolbar.entry.js +1 -1
  581. package/dist/esm/md-table.entry.js +4 -4
  582. package/dist/esm/md-tabs.entry.js +1 -1
  583. package/dist/esm/md-text-field.entry.js +8 -8
  584. package/dist/esm/md-time-picker.entry.js +2 -2
  585. package/dist/esm/md-toolbar.entry.js +1 -1
  586. package/dist/esm/md-transfer-list.entry.js +2 -2
  587. package/dist/esm/md3.js +4 -3
  588. package/dist/esm/md3.js.map +1 -1
  589. package/dist/esm/{rtl-DvOKnoqK.js → rtl-CVFH1DkU.js} +3 -3
  590. package/dist/esm/{rtl-DvOKnoqK.js.map → rtl-CVFH1DkU.js.map} +1 -1
  591. package/dist/esm/{url-BjYKc1Ge.js → url-BdEoSBtL.js} +3 -3
  592. package/dist/esm/{url-BjYKc1Ge.js.map → url-BdEoSBtL.js.map} +1 -1
  593. package/dist/esm/{virtual-select-controller-BEWIC0pC.js → virtual-select-controller-CR60w6DO.js} +10 -9
  594. package/dist/esm/virtual-select-controller-CR60w6DO.js.map +1 -0
  595. package/dist/md3/md3.css +1 -1
  596. package/dist/md3/md3.esm.js +1 -1
  597. package/dist/md3/md3.esm.js.map +1 -1
  598. package/dist/md3/p-08f1c469.entry.js +2 -0
  599. package/dist/md3/{p-4d82132d.entry.js.map → p-08f1c469.entry.js.map} +1 -1
  600. package/dist/md3/{p-9ddbf247.entry.js → p-108f89d7.entry.js} +2 -2
  601. package/dist/md3/p-1112bffc.entry.js +2 -0
  602. package/dist/md3/{p-cf07e761.entry.js.map → p-1112bffc.entry.js.map} +1 -1
  603. package/dist/md3/{p-c6a12344.entry.js → p-114c270b.entry.js} +2 -2
  604. package/dist/md3/p-1835fe36.entry.js +2 -0
  605. package/dist/md3/{p-a3308c40.entry.js.map → p-1835fe36.entry.js.map} +1 -1
  606. package/dist/md3/{p-396089fd.entry.js → p-1edb5a0d.entry.js} +2 -2
  607. package/dist/md3/p-2ba2db3b.entry.js +2 -0
  608. package/dist/md3/{p-6b2871a0.entry.js.map → p-2ba2db3b.entry.js.map} +1 -1
  609. package/dist/md3/p-3508d0e0.entry.js +2 -0
  610. package/dist/md3/{p-f31ab454.entry.js.map → p-3508d0e0.entry.js.map} +1 -1
  611. package/dist/md3/{p-b34d385b.entry.js → p-35b05b45.entry.js} +2 -2
  612. package/dist/md3/{p-c2dd8c8c.entry.js → p-38e9a583.entry.js} +2 -2
  613. package/dist/md3/{p-be02624e.entry.js → p-3c0469aa.entry.js} +2 -2
  614. package/dist/md3/p-3f64a27d.entry.js +2 -0
  615. package/dist/md3/{p-fb61868c.entry.js.map → p-3f64a27d.entry.js.map} +1 -1
  616. package/dist/md3/{p-63b8c8d1.entry.js → p-408ee4be.entry.js} +2 -2
  617. package/dist/md3/{p-edb34a6d.entry.js → p-43c708ad.entry.js} +2 -2
  618. package/dist/md3/{p-3015c7e3.entry.js → p-4770b534.entry.js} +2 -2
  619. package/dist/md3/{p-c861d774.entry.js → p-4b7cf934.entry.js} +2 -2
  620. package/dist/md3/{p-2e09a7b7.entry.js → p-4f26bd60.entry.js} +2 -2
  621. package/dist/md3/{p-7b463fbe.entry.js → p-4f2e82cb.entry.js} +2 -2
  622. package/dist/md3/{p-be412e3f.entry.js → p-501bf161.entry.js} +2 -2
  623. package/dist/md3/{p-c063c823.entry.js → p-56c7c570.entry.js} +2 -2
  624. package/dist/md3/{p-2e9503d7.entry.js → p-56ca0c3c.entry.js} +2 -2
  625. package/dist/md3/{p-ac8762e5.entry.js → p-5b63149a.entry.js} +2 -2
  626. package/dist/md3/{p-c5af701b.entry.js → p-5f668b0a.entry.js} +2 -2
  627. package/dist/md3/p-6237ddac.entry.js +2 -0
  628. package/dist/md3/{p-e7dc5a32.entry.js.map → p-6237ddac.entry.js.map} +1 -1
  629. package/dist/md3/{p-8eb0b6a4.entry.js → p-6d65fc6a.entry.js} +2 -2
  630. package/dist/md3/{p-e3124e1e.entry.js → p-707b6d7c.entry.js} +2 -2
  631. package/dist/md3/{p-a5fee424.entry.js → p-71f1660b.entry.js} +2 -2
  632. package/dist/md3/{p-1a8ec5bc.entry.js → p-7501170f.entry.js} +2 -2
  633. package/dist/md3/p-7c8842bf.entry.js +2 -0
  634. package/dist/md3/{p-ba2ebde1.entry.js.map → p-7c8842bf.entry.js.map} +1 -1
  635. package/dist/md3/{p-4e3d6e40.entry.js → p-7d1686a7.entry.js} +2 -2
  636. package/dist/md3/p-7e7f0e45.entry.js +2 -0
  637. package/dist/md3/p-7e7f0e45.entry.js.map +1 -0
  638. package/dist/md3/p-80379565.entry.js +2 -0
  639. package/dist/md3/{p-6c44cf13.entry.js.map → p-80379565.entry.js.map} +1 -1
  640. package/dist/md3/p-830724e4.entry.js +2 -0
  641. package/dist/md3/p-830724e4.entry.js.map +1 -0
  642. package/dist/md3/{p-4dda4cb0.entry.js → p-845ca9cc.entry.js} +2 -2
  643. package/dist/md3/{p-77a01bcc.entry.js → p-87f88d62.entry.js} +2 -2
  644. package/dist/md3/{p-5b74694e.entry.js → p-89d47130.entry.js} +2 -2
  645. package/dist/md3/p-8a6fed13.entry.js +2 -0
  646. package/dist/md3/{p-a803da99.entry.js.map → p-8a6fed13.entry.js.map} +1 -1
  647. package/dist/md3/p-8a7e0297.entry.js +2 -0
  648. package/dist/md3/p-8a7e0297.entry.js.map +1 -0
  649. package/dist/md3/{p-b0431a5c.entry.js → p-8bdcda53.entry.js} +2 -2
  650. package/dist/md3/{p-c10a33c2.entry.js → p-8e7df348.entry.js} +2 -2
  651. package/dist/md3/p-9003a7d4.entry.js +2 -0
  652. package/dist/md3/p-9003a7d4.entry.js.map +1 -0
  653. package/dist/md3/{p-05ae91b6.entry.js → p-90ccf4c3.entry.js} +2 -2
  654. package/dist/md3/p-BdEoSBtL.js +2 -0
  655. package/dist/md3/{p-BjYKc1Ge.js.map → p-BdEoSBtL.js.map} +1 -1
  656. package/dist/md3/p-Bz-JaJcA.js +2 -0
  657. package/dist/md3/p-Bz-JaJcA.js.map +1 -0
  658. package/dist/md3/p-CGqeEMjY.js +2 -0
  659. package/dist/md3/{p-DzPKu-Ma.js.map → p-CGqeEMjY.js.map} +1 -1
  660. package/dist/md3/p-CVFH1DkU.js +2 -0
  661. package/dist/md3/{p-DvOKnoqK.js.map → p-CVFH1DkU.js.map} +1 -1
  662. package/dist/md3/p-Cch92tDM.js +2 -0
  663. package/dist/md3/{p-RLxbNqRv.js.map → p-Cch92tDM.js.map} +1 -1
  664. package/dist/md3/p-CfBPnYW7.js +2 -0
  665. package/dist/md3/p-CfBPnYW7.js.map +1 -0
  666. package/dist/md3/p-D17cVKxS.js +2 -0
  667. package/dist/md3/p-D17cVKxS.js.map +1 -0
  668. package/dist/md3/p-DGtztV3K.js +2 -0
  669. package/dist/md3/{p-Bx6--dQF.js.map → p-DGtztV3K.js.map} +1 -1
  670. package/dist/md3/p-DQuL1Twl.js +2 -0
  671. package/dist/md3/p-DQuL1Twl.js.map +1 -0
  672. package/dist/md3/p-DnKDoE8K.js +2 -0
  673. package/dist/md3/p-DnKDoE8K.js.map +1 -0
  674. package/dist/md3/p-WmvQpZnM.js +3 -0
  675. package/dist/md3/p-WmvQpZnM.js.map +1 -0
  676. package/dist/md3/p-a3623653.entry.js +2 -0
  677. package/dist/md3/{p-19ee9c33.entry.js.map → p-a3623653.entry.js.map} +1 -1
  678. package/dist/md3/{p-da4e27d4.entry.js → p-a4d4cfed.entry.js} +2 -2
  679. package/dist/md3/{p-5394254f.entry.js → p-a976498b.entry.js} +2 -2
  680. package/dist/md3/{p-6038b907.entry.js → p-ab568d1c.entry.js} +2 -2
  681. package/dist/md3/{p-bf7842f8.entry.js → p-adf8a415.entry.js} +2 -2
  682. package/dist/md3/p-ae30e899.entry.js +2 -0
  683. package/dist/md3/p-ae30e899.entry.js.map +1 -0
  684. package/dist/md3/{p-45280bf4.entry.js → p-b2d88292.entry.js} +2 -2
  685. package/dist/md3/{p-796f79f8.entry.js → p-b3b5247b.entry.js} +2 -2
  686. package/dist/md3/{p-5b799707.entry.js → p-b4266f6b.entry.js} +2 -2
  687. package/dist/md3/p-b54bbf88.entry.js +2 -0
  688. package/dist/md3/p-b54bbf88.entry.js.map +1 -0
  689. package/dist/md3/{p-c00f7514.entry.js → p-ba011453.entry.js} +2 -2
  690. package/dist/md3/{p-6ba63c73.entry.js → p-bc24f0c9.entry.js} +2 -2
  691. package/dist/md3/{p-0c2e824d.entry.js → p-c20fbb9e.entry.js} +2 -2
  692. package/dist/md3/{p-fc0b325d.entry.js → p-c2944c87.entry.js} +2 -2
  693. package/dist/md3/{p-4e45b2ff.entry.js → p-c58c68d0.entry.js} +2 -2
  694. package/dist/md3/p-cc6e8afd.entry.js +2 -0
  695. package/dist/md3/{p-72457a85.entry.js.map → p-cc6e8afd.entry.js.map} +1 -1
  696. package/dist/md3/{p-0f764a1e.entry.js → p-d2e39c6e.entry.js} +2 -2
  697. package/dist/md3/{p-50555bb7.entry.js → p-d8885f53.entry.js} +2 -2
  698. package/dist/md3/{p-c1ca6f6c.entry.js → p-db6fb4e1.entry.js} +2 -2
  699. package/dist/md3/{p-81843ff7.entry.js → p-dcba2857.entry.js} +2 -2
  700. package/dist/md3/{p-65195996.entry.js → p-e357e8ac.entry.js} +2 -2
  701. package/dist/md3/{p-39cb7c24.entry.js → p-e5c6795e.entry.js} +2 -2
  702. package/dist/md3/p-e871663b.entry.js +2 -0
  703. package/dist/md3/{p-aaec2698.entry.js.map → p-e871663b.entry.js.map} +1 -1
  704. package/dist/md3/p-f1b69181.entry.js +2 -0
  705. package/dist/md3/{p-a986fd24.entry.js.map → p-f1b69181.entry.js.map} +1 -1
  706. package/dist/md3/p-f297d786.entry.js +2 -0
  707. package/dist/md3/{p-3cce1de3.entry.js.map → p-f297d786.entry.js.map} +1 -1
  708. package/dist/md3/{p-e6d7f0ff.entry.js → p-f403ad20.entry.js} +2 -2
  709. package/dist/md3/p-f5399b73.entry.js +2 -0
  710. package/dist/md3/{p-04e97f5d.entry.js.map → p-f5399b73.entry.js.map} +1 -1
  711. package/dist/md3/{p-708a9313.entry.js → p-f5fd9a0b.entry.js} +2 -2
  712. package/dist/md3/{p-aa0e7d4d.entry.js → p-f71af38f.entry.js} +2 -2
  713. package/dist/md3/{p-757e3aaf.entry.js → p-fac6da4c.entry.js} +2 -2
  714. package/dist/md3/{p-134b670a.entry.js → p-fc864f96.entry.js} +2 -2
  715. package/dist/md3/{p-32bdd439.entry.js → p-fd686966.entry.js} +2 -2
  716. package/dist/md3/p-nhfFYWzy.js +2 -0
  717. package/dist/md3/{p-C_ogF68H.js.map → p-nhfFYWzy.js.map} +1 -1
  718. package/dist/types/utils/lazy-loading-indicator.d.ts +7 -0
  719. package/dist/types/wasm/engine-abi.d.ts +14 -0
  720. package/hydrate/index.js +191 -113
  721. package/hydrate/index.mjs +191 -113
  722. package/package.json +30 -5
  723. package/dist/cjs/index-DlQ_5_Mv.js.map +0 -1
  724. package/dist/cjs/md-button_7.cjs.entry.js.map +0 -1
  725. package/dist/cjs/virtual-select-controller-CqriaZgm.js.map +0 -1
  726. package/dist/components/p-BEWIC0pC.js +0 -2
  727. package/dist/components/p-BEWIC0pC.js.map +0 -1
  728. package/dist/components/p-DXXUoRSH.js.map +0 -1
  729. package/dist/components/p-MWBNn6Lj.js +0 -2
  730. package/dist/components/p-MWBNn6Lj.js.map +0 -1
  731. package/dist/components/p-UdGDg2oJ.js.map +0 -1
  732. package/dist/esm/index-DTaX19_O.js.map +0 -1
  733. package/dist/esm/md-button_7.entry.js.map +0 -1
  734. package/dist/esm/virtual-select-controller-BEWIC0pC.js.map +0 -1
  735. package/dist/md3/p-04e97f5d.entry.js +0 -2
  736. package/dist/md3/p-19ee9c33.entry.js +0 -2
  737. package/dist/md3/p-21772851.entry.js +0 -2
  738. package/dist/md3/p-21772851.entry.js.map +0 -1
  739. package/dist/md3/p-3cce1de3.entry.js +0 -2
  740. package/dist/md3/p-47af9819.entry.js +0 -2
  741. package/dist/md3/p-47af9819.entry.js.map +0 -1
  742. package/dist/md3/p-4d82132d.entry.js +0 -2
  743. package/dist/md3/p-6b2871a0.entry.js +0 -2
  744. package/dist/md3/p-6c44cf13.entry.js +0 -2
  745. package/dist/md3/p-72457a85.entry.js +0 -2
  746. package/dist/md3/p-BEWIC0pC.js +0 -2
  747. package/dist/md3/p-BEWIC0pC.js.map +0 -1
  748. package/dist/md3/p-DTaX19_O.js +0 -3
  749. package/dist/md3/p-DTaX19_O.js.map +0 -1
  750. package/dist/md3/p-a3308c40.entry.js +0 -2
  751. package/dist/md3/p-a7ffb779.entry.js +0 -2
  752. package/dist/md3/p-a7ffb779.entry.js.map +0 -1
  753. package/dist/md3/p-a803da99.entry.js +0 -2
  754. package/dist/md3/p-a986fd24.entry.js +0 -2
  755. package/dist/md3/p-aaec2698.entry.js +0 -2
  756. package/dist/md3/p-ac35ac5f.entry.js +0 -2
  757. package/dist/md3/p-ac35ac5f.entry.js.map +0 -1
  758. package/dist/md3/p-b4631a55.entry.js +0 -2
  759. package/dist/md3/p-b4631a55.entry.js.map +0 -1
  760. package/dist/md3/p-ba2ebde1.entry.js +0 -2
  761. package/dist/md3/p-cf07e761.entry.js +0 -2
  762. package/dist/md3/p-e7dc5a32.entry.js +0 -2
  763. package/dist/md3/p-f31ab454.entry.js +0 -2
  764. package/dist/md3/p-fb61868c.entry.js +0 -2
  765. /package/dist/{components/p-uTEkf0sE.js.map → components-csr/p-BEmwDSzw.js.map} +0 -0
  766. /package/dist/{components/p-C8EP4S21.js.map → components-csr/p-BQKzjYcY.js.map} +0 -0
  767. /package/dist/{components/p-BwXpiUsu.js.map → components-csr/p-BWMwewtY.js.map} +0 -0
  768. /package/dist/{components/p-B0Opn6dK.js.map → components-csr/p-Bkt_X-6v.js.map} +0 -0
  769. /package/dist/{md3 → components-csr}/p-Bx6--dQF.js +0 -0
  770. /package/dist/{components/p-stybaFzj.js.map → components-csr/p-C3vB0Hd9.js.map} +0 -0
  771. /package/dist/{components/p-B3MWYEEJ.js.map → components-csr/p-CF7mq5T7.js.map} +0 -0
  772. /package/dist/{components/p-7fN_yCXW.js.map → components-csr/p-CVMM-tdC.js.map} +0 -0
  773. /package/dist/{md3 → components-csr}/p-C_ogF68H.js +0 -0
  774. /package/dist/{components/p-Ch2-tttM.js.map → components-csr/p-DMQ-6aj8.js.map} +0 -0
  775. /package/dist/{components/p-e2HRV63Y.js.map → components-csr/p-DfcpeJAu.js.map} +0 -0
  776. /package/dist/{components/p-Dp-w93ot.js.map → components-csr/p-DjKPc5EU.js.map} +0 -0
  777. /package/dist/{md3 → components-csr}/p-DvOKnoqK.js +0 -0
  778. /package/dist/{md3 → components-csr}/p-DzPKu-Ma.js +0 -0
  779. /package/dist/{md3 → components-csr}/p-RLxbNqRv.js +0 -0
  780. /package/dist/{components/p-6wZSqm_2.js.map → components-csr/p-R_guULjT.js.map} +0 -0
  781. /package/dist/{components/p-Ddiw2Kjw.js.map → components-csr/p-uSMrgqAy.js.map} +0 -0
  782. /package/dist/md3/{p-9ddbf247.entry.js.map → p-108f89d7.entry.js.map} +0 -0
  783. /package/dist/md3/{p-c6a12344.entry.js.map → p-114c270b.entry.js.map} +0 -0
  784. /package/dist/md3/{p-396089fd.entry.js.map → p-1edb5a0d.entry.js.map} +0 -0
  785. /package/dist/md3/{p-b34d385b.entry.js.map → p-35b05b45.entry.js.map} +0 -0
  786. /package/dist/md3/{p-c2dd8c8c.entry.js.map → p-38e9a583.entry.js.map} +0 -0
  787. /package/dist/md3/{p-be02624e.entry.js.map → p-3c0469aa.entry.js.map} +0 -0
  788. /package/dist/md3/{p-63b8c8d1.entry.js.map → p-408ee4be.entry.js.map} +0 -0
  789. /package/dist/md3/{p-edb34a6d.entry.js.map → p-43c708ad.entry.js.map} +0 -0
  790. /package/dist/md3/{p-3015c7e3.entry.js.map → p-4770b534.entry.js.map} +0 -0
  791. /package/dist/md3/{p-c861d774.entry.js.map → p-4b7cf934.entry.js.map} +0 -0
  792. /package/dist/md3/{p-2e09a7b7.entry.js.map → p-4f26bd60.entry.js.map} +0 -0
  793. /package/dist/md3/{p-7b463fbe.entry.js.map → p-4f2e82cb.entry.js.map} +0 -0
  794. /package/dist/md3/{p-be412e3f.entry.js.map → p-501bf161.entry.js.map} +0 -0
  795. /package/dist/md3/{p-c063c823.entry.js.map → p-56c7c570.entry.js.map} +0 -0
  796. /package/dist/md3/{p-2e9503d7.entry.js.map → p-56ca0c3c.entry.js.map} +0 -0
  797. /package/dist/md3/{p-ac8762e5.entry.js.map → p-5b63149a.entry.js.map} +0 -0
  798. /package/dist/md3/{p-c5af701b.entry.js.map → p-5f668b0a.entry.js.map} +0 -0
  799. /package/dist/md3/{p-8eb0b6a4.entry.js.map → p-6d65fc6a.entry.js.map} +0 -0
  800. /package/dist/md3/{p-e3124e1e.entry.js.map → p-707b6d7c.entry.js.map} +0 -0
  801. /package/dist/md3/{p-a5fee424.entry.js.map → p-71f1660b.entry.js.map} +0 -0
  802. /package/dist/md3/{p-1a8ec5bc.entry.js.map → p-7501170f.entry.js.map} +0 -0
  803. /package/dist/md3/{p-4e3d6e40.entry.js.map → p-7d1686a7.entry.js.map} +0 -0
  804. /package/dist/md3/{p-4dda4cb0.entry.js.map → p-845ca9cc.entry.js.map} +0 -0
  805. /package/dist/md3/{p-77a01bcc.entry.js.map → p-87f88d62.entry.js.map} +0 -0
  806. /package/dist/md3/{p-5b74694e.entry.js.map → p-89d47130.entry.js.map} +0 -0
  807. /package/dist/md3/{p-b0431a5c.entry.js.map → p-8bdcda53.entry.js.map} +0 -0
  808. /package/dist/md3/{p-c10a33c2.entry.js.map → p-8e7df348.entry.js.map} +0 -0
  809. /package/dist/md3/{p-05ae91b6.entry.js.map → p-90ccf4c3.entry.js.map} +0 -0
  810. /package/dist/md3/{p-da4e27d4.entry.js.map → p-a4d4cfed.entry.js.map} +0 -0
  811. /package/dist/md3/{p-5394254f.entry.js.map → p-a976498b.entry.js.map} +0 -0
  812. /package/dist/md3/{p-6038b907.entry.js.map → p-ab568d1c.entry.js.map} +0 -0
  813. /package/dist/md3/{p-bf7842f8.entry.js.map → p-adf8a415.entry.js.map} +0 -0
  814. /package/dist/md3/{p-45280bf4.entry.js.map → p-b2d88292.entry.js.map} +0 -0
  815. /package/dist/md3/{p-796f79f8.entry.js.map → p-b3b5247b.entry.js.map} +0 -0
  816. /package/dist/md3/{p-5b799707.entry.js.map → p-b4266f6b.entry.js.map} +0 -0
  817. /package/dist/md3/{p-c00f7514.entry.js.map → p-ba011453.entry.js.map} +0 -0
  818. /package/dist/md3/{p-6ba63c73.entry.js.map → p-bc24f0c9.entry.js.map} +0 -0
  819. /package/dist/md3/{p-0c2e824d.entry.js.map → p-c20fbb9e.entry.js.map} +0 -0
  820. /package/dist/md3/{p-fc0b325d.entry.js.map → p-c2944c87.entry.js.map} +0 -0
  821. /package/dist/md3/{p-4e45b2ff.entry.js.map → p-c58c68d0.entry.js.map} +0 -0
  822. /package/dist/md3/{p-0f764a1e.entry.js.map → p-d2e39c6e.entry.js.map} +0 -0
  823. /package/dist/md3/{p-50555bb7.entry.js.map → p-d8885f53.entry.js.map} +0 -0
  824. /package/dist/md3/{p-c1ca6f6c.entry.js.map → p-db6fb4e1.entry.js.map} +0 -0
  825. /package/dist/md3/{p-81843ff7.entry.js.map → p-dcba2857.entry.js.map} +0 -0
  826. /package/dist/md3/{p-65195996.entry.js.map → p-e357e8ac.entry.js.map} +0 -0
  827. /package/dist/md3/{p-39cb7c24.entry.js.map → p-e5c6795e.entry.js.map} +0 -0
  828. /package/dist/md3/{p-e6d7f0ff.entry.js.map → p-f403ad20.entry.js.map} +0 -0
  829. /package/dist/md3/{p-708a9313.entry.js.map → p-f5fd9a0b.entry.js.map} +0 -0
  830. /package/dist/md3/{p-aa0e7d4d.entry.js.map → p-f71af38f.entry.js.map} +0 -0
  831. /package/dist/md3/{p-757e3aaf.entry.js.map → p-fac6da4c.entry.js.map} +0 -0
  832. /package/dist/md3/{p-134b670a.entry.js.map → p-fc864f96.entry.js.map} +0 -0
  833. /package/dist/md3/{p-32bdd439.entry.js.map → p-fd686966.entry.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"names":["mdSelectCss","selectIdCounter","VIRTUALIZE_THRESHOLD","SEARCH_DEBOUNCE_MS","MdSelect","constructor","hostRef","this","valueMissingLabel","reserveSupportingSpace","customValidityMessage","variant","label","placeholder","value","disabled","required","error","errorText","supportingText","density","clearable","matchTriggerWidth","placement","options","virtualize","filterable","filterMode","name","searchPlaceholder","filterLabel","noResultsText","noOptionsText","clearLabel","searchingLabel","loadingText","clearIcon","dropdownIcon","loading","fullWidth","open","optionsData","triggerId","vc","VirtualSelectController","queryItem","i","el","shadowRoot","querySelector","requestRender","forceUpdate","providerSet","selectedLabel","query","searching","queryText","defaultValue","lastValidityKey","_syncGuard","_lastEmit","toggleOpen","selectValue","val","mdChange","emit","fieldEl","focus","clearValue","e","stopPropagation","vpWired","handleMenuOpen","mdOpen","active","wireViewport","requestAnimationFrame","input","menuEl","setComboboxElement","handleMenuClose","mdClose","detachViewport","onSearchInput","q","target","clearTimeout","searchDebounce","setTimeout","setQuery","optionList","parseJsonArrayProp","show","close","focusTrigger","reset","loadOptions","source","isWasmSupported","normalizeInits","rowsToArray","setFixedRowHeight","rowHeight","setFilterMode","ok","load","updateSelectedLabel","syncSearchField","getLabels","values","Object","fromEntries","componentWillLoad","refreshOptions","preselected","find","o","selected","syncFormValue","setFormValue","internals","syncValidity","setValidityState","missing","missingMessage","customMessage","emitValidityChange","getValidity","getValidityOf","v","key","valid","validationMessage","primed","mdValidityChange","checkValidity","checkValidityOf","reportValidity","reportValidityOf","setCustomValidity","message","formResetCallback","data","collectOptions","shouldVirtualize","length","then","get","onOptionChange","syncMenu","autoFocus","handleKeyDown","preventDefault","vp","getScrollViewport","attachViewport","async","componentDidRender","setVirtualProvider","provider","disconnectedCallback","accessibleName","ariaLabel","getAttribute","trim","labelledby","root","getRootNode","text","split","map","id","getElementById","textContent","filter","Boolean","join","renderTrigger","display","labelFor","hasValue","showClear","fieldAriaLabel","undefined","h","ref","class","part","exportparts","readOnly","appearFocused","onClick","slot","LazyLoadingIndicator","size","icon","shapeMorph","groupTabindex","renderVirtualOptions","role","style","height","topPad","windowRows","row","filteredIndex","windowStart","index","presentation","type","headline","filteredLength","onMdClick","bottomPad","renderMenu","virtual","toLowerCase","listOptions","includes","emptyText","menuMaxHeight","maxHeight","anchor","listbox","onMdOpen","onMdClose","String","autocomplete","onInput","indeterminate","wave","opt","iconColor","color","render","Host","hidden","onSlotchange"],"sources":["src/components/md-select/md-select.css?tag=md-select&encapsulation=shadow","src/components/md-select/md-select.tsx"],"sourcesContent":["/* ==========================================================\n md-select — single-select dropdown\n\n The heavy lifting (field surface, label float, error state, menu\n motion + positioning + keyboard) is delegated to md-text-field and\n md-menu. This stylesheet only owns the host layout and the trailing\n caret / clear affordances rendered into the field's trailing slot.\n\n PUBLIC CSS CUSTOM PROPERTIES (select-owned):\n --md-select-width Host inline size (default 100%)\n --md-select-min-width Host minimum inline size (default 0)\n --md-select-caret-color Dropdown caret colour\n --md-select-caret-size Dropdown caret glyph size (default 24px)\n --md-select-clear-color Clear (✕) icon colour (default: caret colour)\n --md-select-trailing-gap Gap between clear + caret (default 2px)\n --md-select-option-icon-color Leading icon colour in option rows\n\n The composed field + menu expose their own --md-text-field-* / --md-menu-*\n / --md-menu-item-* tokens, which flow straight through when set on the host.\n\n PUBLIC PARTS:\n field, field-container, trailing, clear, caret, menu,\n option, option-selected, option-icon\n ========================================================== */\n\n:host {\n /* The text inset already includes the caret's 7px optical bearing (see\n md-text-field --_text-inset). Pull the TRAILING side back to the plain\n box inset so the caret's BOX sits 7px shallower and its INK lands on the\n same column as the text. */\n --md-text-field-padding-inline-end: var(--md-sys-spacing-inset-lg, 16px);\n display: inline-block;\n inline-size: var(--md-select-width, 100%);\n min-inline-size: var(--md-select-min-width, 0);\n box-sizing: border-box;\n font-family: var(--md-sys-typescale-body-large-font-family, Roboto, sans-serif);\n}\n\n.md-select__field {\n inline-size: 100%;\n cursor: pointer;\n --md-text-field-cursor: pointer;\n}\n\n/* Override the browser's default text cursor on the readonly input —\n the whole field behaves as a button, not an editable field. */\n.md-select__field::part(input) {\n cursor: pointer;\n}\n\n:host(.md-select--disabled) .md-select__field::part(input) {\n cursor: not-allowed;\n}\n\n/* ── Trailing cluster (clear + caret) ───────────────────── */\n\n/* The trailing slot holds a *cluster* (clear + caret), but md-text-field\n sizes any single slotted trailing icon to a fixed 24px box via\n `.md-text-field__icon ::slotted(*)` — which would squash the cluster and\n push the caret off the edge. Scoping under `.md-select__field` raises this\n rule's specificity above that ::slotted rule so the cluster sizes to its\n content across the shadow boundary. */\n.md-select__field .md-select__trailing {\n display: inline-flex;\n align-items: center;\n gap: var(--md-select-trailing-gap, 2px);\n width: auto;\n height: auto;\n}\n\n\n.md-select__caret {\n font-size: var(--md-select-caret-size, 24px);\n line-height: 1;\n color: var(--md-select-caret-color, var(--md-sys-color-on-surface-variant, #49454F));\n transition: transform var(--md-sys-motion-duration-short4, 200ms)\n var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1));\n}\n\n/* Flip the caret when open — works for any custom dropdown-icon, not just the\n default arrow (which then reads as \"up\"). */\n:host(.md-select--open) .md-select__caret {\n transform: rotate(180deg);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .md-select__caret {\n transition: none;\n }\n}\n\n/* Busy state: the spinner replaces the caret/clear cluster in the trigger. The\n default md-loading-indicator is 48px — shrink it to the trailing footprint. */\n.md-select__loader {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: 24px;\n block-size: 24px;\n --md-loading-indicator-size: var(--md-select-spinner-size, 22px);\n --md-loading-indicator-shape-size: var(--md-select-spinner-size, 22px);\n}\n\n/* Full-width: fill the parent's inline size as a block (overrides the default\n inline-block sizing). The dropdown follows via match-trigger-width. */\n:host([full-width]) {\n display: block;\n inline-size: 100%;\n}\n\n/* Busy state inside the menu: the wavy linear progress bar fills the surface\n width with comfortable padding (replaces the old \"Loading…\" text). */\n.md-select__loading {\n display: flex;\n align-items: center;\n padding-block: var(--md-sys-spacing-inset-lg, 16px);\n padding-inline: var(--md-sys-spacing-inset-lg, 16px);\n}\n\n.md-select__loading md-progress-indicator {\n inline-size: 100%;\n}\n\n/* Clear affordance is an md-icon-button (ripple + state layer for free).\n Compact it to the prior 24px footprint; defaults to the caret colour so it\n sits inline with the caret, but is independently overridable. */\n.md-select__field .md-select__clear {\n --_clear-color: var(--md-select-clear-color,\n var(--md-select-caret-color, var(--md-sys-color-on-surface-variant, #49454F)));\n --md-icon-button-container-width: 24px;\n --md-icon-button-container-height: 24px;\n --md-icon-button-icon-size: 18px;\n --md-icon-button-icon-color: var(--_clear-color);\n --md-icon-button-state-layer-color: var(--_clear-color);\n}\n\n/* ── Option leading icon (in the menu rows) ─────────────── */\n\n.md-select__option-icon {\n font-size: 20px;\n line-height: 1;\n color: var(--md-select-option-icon-color, var(--md-sys-color-on-surface-variant, #49454F));\n}\n\n/* ── Disabled ───────────────────────────────────────────── */\n\n:host(.md-select--disabled) {\n cursor: default;\n}\n\n:host(.md-select--disabled) .md-select__field {\n --md-text-field-cursor: not-allowed;\n}\n\n/* Material Symbols inside the shadow root. */\n.material-symbols-outlined {\n font-family: var(--md-sys-icon-font-family, 'Material Symbols Outlined', 'Material Icons');\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n overflow-wrap: normal;\n direction: ltr;\n font-feature-settings: 'liga';\n -webkit-font-smoothing: antialiased;\n}\n\n/* ── Virtualized list ──────────────────────────────────── */\n\n/* Spacers reserve the full scroll height above/below the rendered window so\n the menu scrolls as if every option were present. */\n.md-select__vspacer {\n display: block;\n flex: none;\n pointer-events: none;\n}\n\n/* Search field pinned in the menu header (filterable virtualized lists). */\n.md-select__search-wrap {\n position: relative;\n display: block;\n}\n\n.md-select__search {\n box-sizing: border-box;\n width: 100%;\n border: none;\n outline: none;\n /* Right padding reserves room for the search spinner. */\n padding: 12px 44px 12px 16px;\n font: inherit;\n color: var(--md-sys-color-on-surface, #1d1b20);\n background: var(--md-sys-color-surface-container, #f3edf7);\n border-bottom: 1px solid var(--md-sys-color-outline-variant, #cac4d0);\n}\n\n.md-select__search::placeholder {\n color: var(--md-sys-color-on-surface-variant, #49454f);\n}\n\n/* M3 shape-morph loading indicator shown while a debounced search is in flight.\n Motion + reduced-motion handling live inside md-loading-indicator. */\n.md-select__search-spinner {\n position: absolute;\n inset-block-start: 50%;\n inset-inline-end: 12px;\n margin-block-start: -12px;\n --md-loading-indicator-size: 24px;\n --md-loading-indicator-shape-size: 18px;\n pointer-events: none;\n}\n\n/* ==========================================================\n DENSITY (local override)\n This component FORWARDS `density` to the md-text-field it embeds, which\n handles the field box — but that forward says nothing about this host, so its\n OWN chrome (dropdown surface, chips, frame gaps) stayed at density-0 whenever\n density came from the local prop rather than a global ancestor. Mapping the\n prop onto the shared signal here fixes that asymmetry; the spacing-token half\n of the rung arrives from the [density=\"-N\"] selector in tokens.css.\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 { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Method, Prop, State, Watch, forceUpdate, h } from '@stencil/core';\nimport { LazyLoadingIndicator } from '../../utils/lazy-loading-indicator';\nimport {\n collectOptions,\n labelFor,\n normalizeInits,\n OptionRowSource,\n rowsToArray,\n SelectOptionData,\n SelectOptionInit,\n} from '../../utils/select-options';\nimport {\n setFormValue,\n setValidityState,\n checkValidityOf,\n reportValidityOf,\n getValidityOf,\n} from '../../utils/form';\nimport { VirtualSelectController } from '../../utils/virtual-select-controller';\nimport { isWasmSupported, FilterMode } from '../../utils/wasm-option-store';\nimport { VirtualMenuProvider } from '../../utils/types';\nimport { parseJsonArrayProp } from '../../utils/json-prop';\n\nlet selectIdCounter = 0;\n\n/** Above this many options, `virtualize=\"auto\"` switches to the WASM path. */\nconst VIRTUALIZE_THRESHOLD = 200;\n\n/** Idle time after a keystroke before the search query runs (debounce). */\nconst SEARCH_DEBOUNCE_MS = 180;\n\ntype VirtualMenuEl = HTMLElement & {\n show?: (opts?: { autoFocus?: boolean }) => Promise<void>;\n close?: () => Promise<void>;\n setVirtualProvider?: (p: VirtualMenuProvider | null) => Promise<void>;\n setComboboxElement?: (el: HTMLElement | null) => Promise<void>;\n getScrollViewport?: () => Promise<HTMLElement | null>;\n};\n\n/**\n * `md-select` — Material Design 3 single-select dropdown.\n *\n * Composes the library's own primitives instead of re-implementing them:\n * - `md-text-field` is the trigger surface, so the picker inherits the\n * full filled/outlined visuals, density scale, floating label, error\n * state, supporting text, and focus ring of every other input. It is\n * `readonly` (not editable) and `appear-focused` while the menu is open\n * so the field + menu read as one connected control.\n * - `md-menu` is the option surface, so the picker inherits open/close\n * motion, viewport-aware positioning, single-open coordination, roving\n * tabindex, type-ahead, and Escape/Home/End — for free.\n *\n * Options are authored either declaratively as slotted `<md-select-option>`\n * children (primary API) or via the programmatic `options` array. Each\n * becomes a `type=\"radio\"` `md-menu-item` so only one is ever selected.\n *\n * @slot - `md-select-option` children for the dropdown (primary authoring API).\n * @slot dropdown-icon - Replaces the caret glyph (e.g. a custom SVG). Rotates 180° when open.\n * @slot loader - Replaces the busy-state spinner shown in the trigger while `loading`.\n *\n * @part field - The inner `md-text-field` trigger surface.\n * @part field-container - The text-field's container box (border/fill).\n * @part trailing - The trailing cluster wrapping the clear + caret.\n * @part clear - The clear (✕) `md-icon-button`.\n * @part caret - The dropdown caret glyph.\n * @part loading-spinner - The busy-state spinner in the trigger (`loading`).\n * @part loading-bar - The busy-state container in the menu (`loading`).\n * @part loading-progress - The wavy progress indicator shown in the menu while `loading`.\n * @part menu - The `md-menu` option surface.\n * @part option - Each option row (`md-menu-item`).\n * @part option-selected - The currently selected option row.\n * @part option-icon - An option's leading icon.\n * @part search - The filter input (`filterable`).\n * @part search-spinner - The in-menu spinner shown while filtering.\n */\n@Component({\n tag: 'md-select',\n styleUrl: 'md-select.css',\n shadow: true,\n formAssociated: true,\n})\nexport class MdSelect {\n @Element() el!: HTMLElement;\n\n\n /**\n * Localized constraint-validation message shown when `required` is unmet.\n *\n * A prop rather than a hardcoded string, matching md-time-picker's\n * `value-missing-label`: components stay i18n-engine-agnostic and the\n * consumer localizes through its own dictionary. Native inputs get their\n * message from the browser's locale for free; a form-associated custom\n * element supplies its own, so leaving this hardcoded would ship an\n * English-only form to every locale.\n */\n @Prop({ attribute: 'value-missing-label' }) valueMissingLabel: string =\n 'Please select an item in the list.';\n\n\n /**\n * Always occupy the supporting-text line, even when there is no message, so a\n * validation error does not push the content below it down. Forwarded to the\n * embedded md-text-field. See that component for why it is opt-in.\n */\n @Prop({ attribute: 'reserve-supporting-space' }) reserveSupportingSpace: boolean = false;\n\n /** Message set via setCustomValidity(); non-empty wins over valueMissing. */\n private customValidityMessage = '';\n\n /**\n * Form-association handle. The select submits its `value` under the host's\n * `name` via `setFormValue`, so it participates in `<form>`/`FormData`\n * natively — a hidden `<input>` in the shadow root would be invisible to\n * `FormData`.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /** Visual variant — forwarded to the inner `md-text-field`. */\n @Prop({ reflect: true }) variant: 'filled' | 'outlined' = 'outlined';\n\n /** Floating label / accessible name. */\n @Prop() label: string = '';\n\n /** Placeholder shown when no value is selected. */\n @Prop() placeholder: string = '';\n\n /** Selected option value. Empty string = nothing selected. */\n @Prop({ mutable: true, reflect: true }) value: string = '';\n\n /** Disabled — non-interactive. */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** Required (form validation parity). */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Error state — forwarded to the inner field. */\n @Prop({ reflect: true }) error: boolean = false;\n\n /** Error text rendered in place of supporting text when `error` is set. */\n @Prop({ attribute: 'error-text' }) errorText: string = '';\n\n /** Supporting / helper text rendered below the field. */\n @Prop({ attribute: 'supporting-text' }) supportingText: string = '';\n\n /** Density forwarded to the inner field (0 = comfortable … -3 = compact). */\n @Prop({ reflect: true }) density: 0 | -1 | -2 | -3 | -4 = 0;\n\n /** Show a clear (✕) button in the trigger when a value is selected. */\n @Prop({ reflect: true }) clearable: boolean = false;\n\n /**\n * Match the dropdown width to the trigger width. When `false` the menu\n * sizes to its content (down to its own min-width). Maps to `md-menu`'s\n * `match-anchor-width`. Default `true` — the expected select behaviour.\n */\n @Prop({ attribute: 'match-trigger-width', reflect: true })\n matchTriggerWidth: boolean = true;\n\n /** Menu placement relative to the trigger — forwarded to `md-menu`. */\n @Prop() placement: 'bottom-start' | 'bottom-end' | 'top-start' | 'top-end' =\n 'bottom-start';\n\n /**\n * Cap the dropdown height. When the options exceed it the list scrolls\n * vertically with top/bottom edge shadows. A number is pixels; any CSS\n * length is passed through (e.g. `'50vh'`). Forwarded to `md-menu`'s\n * `max-height`.\n */\n @Prop({ attribute: 'max-height' }) maxHeight?: number | string;\n\n /** Programmatic options. Ignored when `<md-select-option>` children exist. */\n /**\n * Programmatic options. Slotted `md-select-option` children take precedence.\n *\n * Accepts the array (property) or a **JSON string** (attribute), so a\n * plain-HTML page can declare its data inline instead of reaching for a\n * script. Malformed JSON degrades to an empty list with a console warning.\n */\n @Prop() options: SelectOptionInit[] | string = [];\n\n /** `options` as an array, whether it arrived as one or as a JSON attribute. */\n private get optionList(): SelectOptionInit[] {\n return parseJsonArrayProp<SelectOptionInit>(this.options, 'md-select', 'options');\n }\n\n /**\n * Virtualization mode for large option lists (backed by a WASM data engine):\n * - `'auto'` (default): virtualize only above `VIRTUALIZE_THRESHOLD` rows.\n * - `'always'`: always virtualize the `options` / `loadOptions` dataset.\n * - `'never'`: keep the classic DOM rendering regardless of size.\n * Virtualized rows render label + selection only (no per-row icon /\n * supporting text) and assume a uniform row height.\n */\n @Prop() virtualize: 'auto' | 'always' | 'never' = 'auto';\n\n /**\n * Show a search field in the menu header.\n *\n * A plain list filters client-side on label / supporting text; a virtualized\n * one filters inside the WASM engine. Closing the menu clears the query.\n */\n @Prop() filterable: boolean = false;\n\n /** Filter strategy used by `filterable` / `setQuery`. */\n @Prop({ attribute: 'filter-mode' }) filterMode: FilterMode = 'substring';\n\n /** Fixed virtualized row height (px). Auto-measured from the first row if unset. */\n @Prop({ attribute: 'row-height' }) rowHeight?: number;\n\n /** Form field name. The selected value is submitted under this name. */\n @Prop({ reflect: true }) name: string = '';\n\n // ── Localizable UI strings ───────────────────────────────\n // Defaults are English; override per the page locale (see the date picker for\n // the same convention). Option labels themselves come from `options` data.\n\n /** Placeholder for the in-menu filter field (`filterable`). */\n @Prop({ attribute: 'search-placeholder' }) searchPlaceholder: string = 'Search…';\n /** Accessible name for the filter field. Falls back to `Filter <label>`. */\n @Prop({ attribute: 'filter-label' }) filterLabel: string = '';\n /** Empty-state text when a filter matches nothing. */\n @Prop({ attribute: 'no-results-text' }) noResultsText: string = 'No results';\n /** Empty-state text when there are no options at all. */\n @Prop({ attribute: 'no-options-text' }) noOptionsText: string = 'No options';\n /** Accessible label for the clear button (`clearable`). */\n @Prop({ attribute: 'clear-label' }) clearLabel: string = 'Clear selection';\n /** Accessible label for the in-menu loading spinner while filtering. */\n @Prop({ attribute: 'searching-label' }) searchingLabel: string = 'Searching';\n /** Text shown in the trigger / menu while `loading` is true. */\n @Prop({ attribute: 'loading-text' }) loadingText: string = 'Loading…';\n\n // ── Icon customization (Material Symbols names; or use the slots below) ──\n\n /** Icon (Material Symbols name) for the clear button (`clearable`). */\n @Prop({ attribute: 'clear-icon' }) clearIcon: string = 'close';\n /** Caret icon; rotates 180° when open. Slot `dropdown-icon` overrides it. */\n @Prop({ attribute: 'dropdown-icon' }) dropdownIcon: string = 'arrow_drop_down';\n\n /**\n * Show a busy state: the trigger shows a spinner instead of the caret and the\n * host is `aria-busy`. Use while an async dataset loads (e.g. before/around a\n * large `loadOptions`). Replace the spinner with the `loader` slot.\n */\n @Prop({ reflect: true }) loading: boolean = false;\n\n /**\n * Stretch the control to fill its parent's inline width (otherwise it sizes to\n * a sensible default). The dropdown follows when `match-trigger-width` is set.\n */\n @Prop({ attribute: 'full-width', reflect: true }) fullWidth: boolean = false;\n\n /** Open state of the dropdown. Reflected so `:host([open])` rules apply. */\n @Prop({ mutable: true, reflect: true }) open: boolean = false;\n\n /** Emits the newly selected value whenever the selection changes. */\n @Event() mdChange!: EventEmitter<string>;\n\n /** Emits when the dropdown opens. */\n @Event() mdOpen!: EventEmitter<void>;\n\n /** Emits when the dropdown closes. */\n @Event() mdClose!: EventEmitter<void>;\n\n @State() private optionsData: SelectOptionData[] = [];\n\n @State() private triggerId = `md-select-${++selectIdCounter}`;\n\n private fieldEl?: HTMLElement & { focus?: () => void };\n private menuEl?: VirtualMenuEl;\n\n /** Shared virtualization engine (WASM store + window math + provider glue). */\n private vc = new VirtualSelectController({\n queryItem: (i) =>\n (this.el.shadowRoot?.querySelector(\n `md-menu-item[data-vindex=\"${i}\"]`,\n ) as HTMLElement | null) ?? null,\n requestRender: () => forceUpdate(this),\n });\n private providerSet = false;\n /** Trigger label for the selected value while virtualized (off-window safe). */\n private selectedLabel = '';\n private searchDebounce?: ReturnType<typeof setTimeout>;\n /** Client-side filter query for `filterable` on a NON-virtualized list. The\n * virtualized path filters inside the WASM engine via `vc.setQuery`. */\n @State() private query = '';\n\n /** True between a keystroke and the debounced query resolving (drives the spinner). */\n private searching = false;\n\n // ── Public API ───────────────────────────────────────────\n\n /** Open the dropdown programmatically. */\n @Method()\n async show() {\n if (this.disabled) return;\n this.open = true;\n }\n\n /** Close the dropdown programmatically. */\n @Method()\n async close() {\n this.open = false;\n }\n\n /** Move focus to the trigger field. */\n @Method()\n async focusTrigger() {\n this.fieldEl?.focus?.();\n }\n\n /** Clear the selection. */\n @Method()\n async reset() {\n if (!this.value) return;\n this.value = '';\n this.mdChange.emit('');\n }\n\n /**\n * Load a large dataset into the WASM-backed virtualized list (the high-scale\n * entry point). Accepts a materialised `SelectOptionInit[]` or a row factory\n * (`{ count, getRow }`) — the factory streams rows into WASM one at a time, so\n * tens of millions of options never exist as JS objects at once. Falls back to\n * plain DOM rendering when `virtualize=\"never\"` or WebAssembly is unavailable.\n */\n @Method()\n async loadOptions(source: SelectOptionInit[] | OptionRowSource) {\n if (this.virtualize === 'never' || !isWasmSupported()) {\n this.vc.reset();\n this.optionsData = normalizeInits(rowsToArray(source));\n return;\n }\n this.optionsData = [];\n this.vc.setFixedRowHeight(this.rowHeight);\n this.vc.setFilterMode(this.filterMode);\n const ok = await this.vc.load(source);\n if (!ok) {\n // The store declines an empty set (and a WASM failure). Without dropping\n // whatever it still holds, `loadOptions([])` after a populated load left\n // the PREVIOUS rows active and rendering — so a consumer could not clear\n // the list by handing over an empty one.\n this.vc.reset();\n this.optionsData = normalizeInits(rowsToArray(source));\n } else {\n this.updateSelectedLabel();\n }\n forceUpdate(this);\n }\n\n /**\n * Filter the menu exactly as typing into the in-menu search field would.\n *\n * The field is uncontrolled, so the text is mirrored into it as well —\n * otherwise the list narrows while the box still reads empty, which looks\n * like the call did nothing. The menu may be closed (no field rendered yet),\n * so the text is stashed and applied on the next render.\n */\n @Method()\n async setQuery(query: string) {\n this.vc.setQuery(query);\n if (!this.vc.active) this.query = query;\n this.queryText = query;\n this.syncSearchField();\n forceUpdate(this);\n }\n\n /** Text pushed by `setQuery()`, pending mirroring into the search field. */\n private queryText: string | null = null;\n\n private syncSearchField() {\n if (this.queryText === null) return;\n const input = this.el.shadowRoot?.querySelector(\n '.md-select__search',\n ) as HTMLInputElement | null;\n if (!input) return;\n input.value = this.queryText;\n this.queryText = null;\n }\n\n /** Resolve labels for values that may be outside the current filter/window. */\n @Method()\n async getLabels(values: string[]): Promise<Record<string, string>> {\n return Object.fromEntries(this.vc.getLabels(values));\n }\n\n // ── Lifecycle / reactivity ───────────────────────────────\n\n /** Initial value, restored on form reset. */\n private defaultValue = '';\n\n componentWillLoad() {\n this.refreshOptions();\n // Adopt an option-declared `selected` hint when no value was provided.\n if (!this.value) {\n const preselected = this.optionsData.find((o) => o.selected && !o.disabled);\n if (preselected) this.value = preselected.value;\n }\n this.defaultValue = this.value;\n this.syncFormValue();\n }\n\n /** Keep the submitted form value in sync with the selection. */\n @Watch('value')\n syncFormValue() {\n setFormValue(this.internals, this.value || null);\n this.updateSelectedLabel();\n this.syncValidity();\n }\n\n /**\n * Publish `required` to the owning form. Without this the select is\n * form-associated (its value reaches FormData) yet ALWAYS reports valid, so an\n * empty required control lets the form submit — `required` renders as a visual\n * hint and nothing more. Kept in the same place as the value sync so the two\n * can never drift.\n */\n @Watch('required')\n @Watch('valueMissingLabel')\n private syncValidity() {\n setValidityState(this.internals, {\n missing: this.required && !this.value,\n missingMessage: this.valueMissingLabel,\n customMessage: this.customValidityMessage,\n });\n this.emitValidityChange();\n }\n\n /** Current validity: boolean, message and flags. Mirrors md-text-field. */\n @Method()\n async getValidity(): Promise<{\n valid: boolean;\n validationMessage: string;\n flags: Record<string, boolean>;\n }> {\n return getValidityOf(this.internals);\n }\n\n /**\n * Fires when this control's validity CHANGES — never on every keystroke, and\n * never for a re-publish that lands on the same state.\n *\n * `composed: false` is deliberate. Composites like md-select embed an\n * md-text-field, and a composed event escapes that inner shadow root, so a\n * listener on md-select would receive the inner field's event as well as the\n * host's — two events, different payloads, for one logical control. Keeping\n * it uncomposed means each component reports only for itself, while\n * `bubbles: true` still lets a <form> or app root hear every control.\n */\n @Event({ bubbles: true, composed: false }) mdValidityChange: EventEmitter<{\n valid: boolean;\n validationMessage: string;\n flags: Record<string, boolean>;\n }>;\n\n /** Last emitted validity, so a re-publish that changes nothing stays silent. */\n private lastValidityKey: string | null = null;\n\n /**\n * Emit mdValidityChange if validity actually moved.\n *\n * The FIRST call only primes the baseline. Initial state is not a change, and\n * emitting on mount would fire once per control on every page load — noise a\n * consumer would have to filter out, and misleading for anything logging\n * \"field became invalid\".\n */\n private emitValidityChange() {\n const v = getValidityOf(this.internals);\n const key = `${v.valid}|${v.validationMessage}`;\n if (this.lastValidityKey === key) return;\n const primed = this.lastValidityKey !== null;\n this.lastValidityKey = key;\n if (primed) this.mdValidityChange.emit(v);\n }\n\n /** Constraint-validation API, matching md-text-field and the native contract. */\n @Method()\n async checkValidity(): Promise<boolean> {\n return checkValidityOf(this.internals);\n }\n\n /** Like checkValidity(), but also shows the browser's validation message. */\n @Method()\n async reportValidity(): Promise<boolean> {\n return reportValidityOf(this.internals);\n }\n\n /** App/server-side validation: a non-empty message marks the control invalid\n * for its form until cleared with an empty string. */\n @Method()\n async setCustomValidity(message: string) {\n this.customValidityMessage = message;\n this.syncValidity();\n }\n\n /** Restore the initial selection when the owning form is reset. */\n formResetCallback() {\n this.value = this.defaultValue;\n }\n\n @Watch('options')\n refreshOptions() {\n const data = collectOptions(this.el, this.optionList);\n const shouldVirtualize =\n this.virtualize === 'always' ||\n (this.virtualize === 'auto' && data.length > VIRTUALIZE_THRESHOLD);\n\n if (shouldVirtualize && isWasmSupported() && data.length > 0) {\n this.optionsData = [];\n this.vc.setFixedRowHeight(this.rowHeight);\n this.vc.setFilterMode(this.filterMode);\n void this.vc.load(data).then((ok) => {\n if (!ok) {\n this.optionsData = data;\n forceUpdate(this);\n } else {\n this.updateSelectedLabel();\n }\n });\n } else {\n this.vc.reset();\n this.optionsData = data;\n }\n }\n\n /** Refresh the cached trigger label for the current value (virtual mode). */\n private updateSelectedLabel() {\n if (!this.value) {\n this.selectedLabel = '';\n } else if (this.vc.active) {\n this.selectedLabel = this.vc.getLabels([this.value]).get(this.value) ?? this.selectedLabel;\n }\n forceUpdate(this);\n }\n\n /** Slotted `<md-select-option>` mount/unmount/data change → re-read. */\n @Listen('mdSelectOptionChange')\n onOptionChange(e: Event) {\n e.stopPropagation();\n this.refreshOptions();\n }\n\n // Prevents @Watch re-entrancy when handleMenuClose syncs this.open back.\n private _syncGuard = false;\n // Deduplicates mdOpen/mdClose: only emit when the state actually flips.\n private _lastEmit: 'open' | 'close' | null = null;\n\n @Watch('open')\n syncMenu(open: boolean) {\n if (this._syncGuard || !this.menuEl) return;\n if (open) {\n // A filterable virtual menu focuses its search field, not the first row.\n this.menuEl.show?.({ autoFocus: !(this.filterable && this.vc.active) });\n } else {\n this.menuEl.close?.();\n }\n }\n\n // ── Keyboard (trigger) ───────────────────────────────────\n\n @Listen('keydown')\n handleKeyDown(e: KeyboardEvent) {\n if (this.disabled) return;\n if (!this.open && (e.key === 'ArrowDown' || e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n this.open = true;\n } else if (this.open && e.key === 'Escape') {\n e.preventDefault();\n this.open = false;\n this.fieldEl?.focus?.();\n }\n }\n\n // ── Handlers ─────────────────────────────────────────────\n\n private toggleOpen = () => {\n if (this.disabled) return;\n this.open = !this.open;\n };\n\n private selectValue = (val: string) => {\n if (this.value === val) {\n this.open = false;\n return;\n }\n this.value = val;\n this.mdChange.emit(val);\n this.open = false;\n this.fieldEl?.focus?.();\n };\n\n private clearValue = (e: MouseEvent) => {\n e.stopPropagation();\n if (this.disabled || !this.value) return;\n this.value = '';\n this.mdChange.emit('');\n };\n\n /** True once the vc is wired to the menu's live scroll viewport. */\n private vpWired = false;\n\n /** Wire the vc to the menu scroll viewport; a null resolve (viewport not\n * rendered yet — e.g. the menu opened while the dataset was packing and\n * showed the uncapped busy bar) just returns, and componentDidRender\n * retries until the wiring lands. */\n private wireViewport() {\n void (async () => {\n const vp = (await this.menuEl?.getScrollViewport?.()) ?? null;\n if (!vp || this.vpWired) return;\n this.vpWired = true;\n await this.vc.attachViewport(async () => vp);\n })();\n }\n\n private handleMenuOpen = () => {\n this._syncGuard = true;\n this.open = true;\n this._syncGuard = false;\n if (this._lastEmit !== 'open') {\n this._lastEmit = 'open';\n this.mdOpen.emit();\n }\n if (this.vc.active) {\n this.wireViewport();\n if (this.filterable) {\n requestAnimationFrame(() => {\n const input = this.el.shadowRoot?.querySelector('.md-select__search') as HTMLElement | null;\n input?.focus();\n // Register the search input as the combobox so md-menu drives the\n // listbox via aria-activedescendant on it (focus stays here while the\n // user arrows through / filters the virtualized options).\n void this.menuEl?.setComboboxElement?.(input);\n });\n }\n }\n };\n\n private handleMenuClose = () => {\n this._syncGuard = true;\n this.open = false;\n this._syncGuard = false;\n // Reopening shows the full list: the search field is uncontrolled and\n // unmounts with the menu, so a stale query would filter an empty-looking box.\n if (this.query) this.query = '';\n if (this._lastEmit !== 'close') {\n this._lastEmit = 'close';\n this.mdClose.emit();\n }\n void this.menuEl?.setComboboxElement?.(null);\n this.vc.detachViewport();\n this.vpWired = false;\n };\n\n private onSearchInput = (e: Event) => {\n const q = (e.target as HTMLInputElement).value;\n this.queryText = null; // typing supersedes a pending programmatic query\n if (!this.vc.active) {\n // Plain (non-virtual) list: filter the rendered options client-side. It is\n // cheap, so it runs synchronously per keystroke — no spinner, no debounce.\n this.query = q;\n return;\n }\n // Show the spinner immediately, debounce the actual (expensive) query, then\n // clear the spinner once results are in — a smooth, intentional transition.\n if (!this.searching) {\n this.searching = true;\n forceUpdate(this);\n }\n clearTimeout(this.searchDebounce);\n this.searchDebounce = setTimeout(() => {\n this.vc.setQuery(q);\n this.searching = false;\n forceUpdate(this);\n }, SEARCH_DEBOUNCE_MS);\n };\n\n /** Register/clear the virtual provider on the menu once it's rendered, and\n * (re)try viewport wiring for menus opened mid-pack. */\n componentDidRender() {\n this.syncSearchField();\n if (!this.menuEl) return;\n if (this.vc.active && !this.providerSet) {\n void this.menuEl.setVirtualProvider?.(this.vc.provider);\n this.providerSet = true;\n } else if (!this.vc.active && this.providerSet) {\n void this.menuEl.setVirtualProvider?.(null);\n this.providerSet = false;\n }\n if (this.open && this.vc.active && !this.vpWired) this.wireViewport();\n }\n\n disconnectedCallback() {\n clearTimeout(this.searchDebounce);\n this.vc.detachViewport();\n }\n\n // ── Render ───────────────────────────────────────────────\n\n /**\n * Resolved accessible name for the control.\n *\n * A consumer names the select one of two ways: the visible `label` prop, or\n * `aria-label` / `aria-labelledby` on the host — the latter used when there\n * is no floating label, e.g. `md-table-pagination`'s rows-per-page select,\n * which has a *separate* visible label element next to it. The host is\n * role-less (generic), so a name set there is invisible to assistive tech,\n * and an `aria-labelledby` IDREF can't cross the shadow boundary into the\n * field's inner input. Resolve the name here (visible `label` wins, then\n * `aria-label`, then the flattened text of `aria-labelledby` targets) so it\n * can be forwarded onto the inner input (the real focus/accessible-name\n * target) and used to name the popup listbox — instead of the input having\n * no accessible name at all.\n */\n private get accessibleName(): string {\n if (this.label) return this.label;\n const ariaLabel = this.el.getAttribute('aria-label');\n if (ariaLabel && ariaLabel.trim()) return ariaLabel.trim();\n const labelledby = this.el.getAttribute('aria-labelledby');\n if (labelledby) {\n const root = this.el.getRootNode() as Document | ShadowRoot;\n const text = labelledby\n .trim()\n .split(/\\s+/)\n .map((id) => root.getElementById?.(id)?.textContent?.trim() ?? '')\n .filter(Boolean)\n .join(' ');\n if (text) return text;\n }\n return '';\n }\n\n private renderTrigger() {\n const display = this.vc.active\n ? this.selectedLabel\n : labelFor(this.optionsData, this.value);\n const hasValue = !!this.value && !!display;\n const showClear = this.clearable && hasValue && !this.disabled;\n // When there's no visible `label`, forward the host's accessible name\n // (aria-label / aria-labelledby) onto the field so md-text-field mirrors it\n // as the inner input's accessible name. Skipped when `label` is set: the\n // `label` prop already names the input, and passing aria-label too would\n // both double-name and leave an aria-label on md-text-field's role-less host.\n const fieldAriaLabel = this.label ? undefined : this.accessibleName || undefined;\n\n return (\n <md-text-field\n ref={(el) => (this.fieldEl = el as HTMLElement)}\n id={this.triggerId}\n class=\"md-select__field\"\n part=\"field\"\n exportparts=\"container:field-container\"\n variant={this.variant}\n label={this.label}\n aria-label={fieldAriaLabel}\n placeholder={hasValue ? '' : this.placeholder}\n value={display}\n readOnly={true}\n disabled={this.disabled}\n required={this.required}\n error={this.error}\n errorText={this.errorText}\n reserveSupportingSpace={this.reserveSupportingSpace}\n supportingText={this.supportingText}\n density={this.density}\n appearFocused={this.open}\n onClick={this.toggleOpen}\n >\n <span\n slot=\"trailing-icon\"\n class=\"md-select__trailing\"\n part=\"trailing\"\n aria-hidden=\"true\"\n >\n {this.loading ? (\n // Busy state: a spinner replaces the caret/clear. Consumers can swap\n // the spinner via the `loader` slot; the default is md-loading-indicator.\n <span class=\"md-select__loader\" part=\"loading-spinner\">\n <slot name=\"loader\">\n <LazyLoadingIndicator label={this.loadingText}></LazyLoadingIndicator>\n </slot>\n </span>\n ) : (\n [\n showClear && (\n <md-icon-button\n class=\"md-select__clear\"\n part=\"clear\"\n size=\"xs\"\n icon={this.clearIcon}\n aria-label={this.clearLabel}\n shapeMorph={false}\n // Keep it out of the tab order: the cluster is aria-hidden and\n // the select trigger owns focus, matching the prior <button>.\n groupTabindex={-1}\n // Native click (not mdClick) so stopPropagation prevents the\n // field's toggle from also firing and opening the menu.\n onClick={this.clearValue}\n ></md-icon-button>\n ),\n <span class=\"md-select__caret material-symbols-outlined\" part=\"caret\">\n <slot name=\"dropdown-icon\">{this.dropdownIcon}</slot>\n </span>,\n ]\n )}\n </span>\n </md-text-field>\n );\n }\n\n private renderVirtualOptions() {\n // The listbox wrapper lives in md-select's shadow root (slotted into md-menu),\n // so the combobox input's aria-controls / aria-activedescendant IDREFs\n // resolve, and the listbox directly owns its role=\"option\" children (the\n // spacers are aria-hidden). This is the WAI-ARIA combobox/listbox structure.\n return (\n <div\n class=\"md-select__listbox\"\n role=\"listbox\"\n id={`${this.triggerId}-listbox`}\n aria-label={this.accessibleName || 'Options'}\n >\n <div\n class=\"md-select__vspacer\"\n style={{ height: `${this.vc.topPad}px` }}\n aria-hidden=\"true\"\n ></div>\n {this.vc.windowRows.map((row, i) => {\n const filteredIndex = this.vc.windowStart + i;\n const selected = row.value === this.value;\n return (\n <md-menu-item\n key={row.index}\n // Stable id so md-menu can point aria-activedescendant here. Lives in\n // md-select's shadow root alongside the combobox input, so the IDREF\n // resolves. Keyed on the filtered index (its position in the list).\n id={`${this.triggerId}-opt-${filteredIndex}`}\n data-vindex={filteredIndex}\n // Exposes the row as a listbox option (role=\"option\" + aria-selected)\n // rather than a menuitemradio — the WAI-ARIA select/combobox pattern.\n presentation=\"option\"\n type=\"radio\"\n check-position=\"start\"\n keep-open\n part={selected ? 'option option-selected' : 'option'}\n disabled={row.disabled}\n selected={selected}\n headline={row.label}\n supporting-text={row.supportingText || ''}\n aria-setsize={this.vc.filteredLength}\n aria-posinset={filteredIndex + 1}\n onMdClick={() => this.selectValue(row.value)}\n >\n {row.icon ? (\n <span\n slot=\"leading-icon\"\n part=\"option-icon\"\n // Per-option `iconColor` is not carried on the virtualized (WASM)\n // path — the byte-packed row store has no colour column — so\n // virtual rows fall back to --md-select-option-icon-color.\n class=\"material-symbols-outlined md-select__option-icon\"\n aria-hidden=\"true\"\n >\n {row.icon}\n </span>\n ) : null}\n {row.label}\n </md-menu-item>\n );\n })}\n <div\n class=\"md-select__vspacer\"\n style={{ height: `${this.vc.bottomPad}px` }}\n aria-hidden=\"true\"\n ></div>\n </div>\n );\n }\n\n private renderMenu() {\n const virtual = this.vc.active;\n // Non-virtual `filterable`: narrow the rendered options by label / supporting\n // text (case-insensitive). Virtual filtering runs in the WASM engine instead.\n const q = this.filterable && !virtual ? this.query.trim().toLowerCase() : '';\n const listOptions = q\n ? this.optionsData.filter(\n (o) =>\n o.label.toLowerCase().includes(q) ||\n (o.supportingText || '').toLowerCase().includes(q),\n )\n : this.optionsData;\n // While loading we show a wavy progress bar in the menu (below), not text.\n const emptyText = this.loading\n ? ''\n : virtual\n ? this.vc.filteredLength === 0\n ? this.noResultsText\n : ''\n : this.optionsData.length === 0\n ? this.noOptionsText\n : q && listOptions.length === 0\n ? this.noResultsText\n : '';\n // Virtualization needs a bounded viewport to scroll within.\n const menuMaxHeight = virtual ? (this.maxHeight ?? 320) : this.maxHeight;\n\n return (\n <md-menu\n ref={(el) => (this.menuEl = el as VirtualMenuEl)}\n anchor={this.triggerId}\n placement={this.placement}\n match-anchor-width={this.matchTriggerWidth || this.fullWidth}\n max-height={menuMaxHeight}\n empty-text={emptyText}\n // Present the popup as a WAI-ARIA listbox (not a menu) for every select,\n // virtual or not, and name it.\n listbox\n list-label={this.accessibleName || 'Options'}\n part=\"menu\"\n onMdOpen={this.handleMenuOpen}\n onMdClose={this.handleMenuClose}\n >\n {this.filterable && !this.loading && (\n <div slot=\"header\" class=\"md-select__search-wrap\" part=\"search-wrap\">\n <input\n class=\"md-select__search\"\n part=\"search\"\n type=\"text\"\n // WAI-ARIA combobox: this input owns focus while the listbox is\n // open; the active option is conveyed via aria-activedescendant\n // (set by md-menu). aria-controls points at the listbox wrapper,\n // which md-select renders in this same shadow root so the IDREF\n // resolves (the menu surface is only role=\"presentation\").\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={String(this.open)}\n aria-controls={`${this.triggerId}-listbox`}\n aria-autocomplete=\"list\"\n autocomplete=\"off\"\n placeholder={this.searchPlaceholder}\n aria-label={this.filterLabel || (this.label ? `Filter ${this.label}` : 'Filter options')}\n onInput={this.onSearchInput}\n onClick={(e: MouseEvent) => e.stopPropagation()}\n />\n {this.searching && (\n <LazyLoadingIndicator\n class=\"md-select__search-spinner\"\n part=\"search-spinner\"\n label={this.searchingLabel}\n aria-hidden=\"true\"\n ></LazyLoadingIndicator>\n )}\n </div>\n )}\n {this.loading ? (\n // Busy state inside the menu: a wavy (M3 Expressive) indeterminate\n // linear progress bar instead of \"Loading…\" text.\n <div\n class=\"md-select__loading\"\n part=\"loading-bar\"\n role=\"status\"\n aria-label={this.loadingText}\n >\n <md-progress-indicator\n variant=\"linear\"\n indeterminate\n wave\n part=\"loading-progress\"\n label={this.loadingText}\n ></md-progress-indicator>\n </div>\n ) : virtual ? (\n this.renderVirtualOptions()\n ) : (\n // Listbox wrapper in md-select's shadow root so aria-controls (from a\n // combobox consumer) resolves and the listbox directly owns its\n // role=\"option\" children — the WAI-ARIA select pattern, matching the\n // virtual path. Options carry aria-selected (presentation=\"option\")\n // rather than the menuitemradio/aria-checked of a menu.\n <div\n class=\"md-select__listbox\"\n role=\"listbox\"\n id={`${this.triggerId}-listbox`}\n aria-label={this.accessibleName || 'Options'}\n >\n {listOptions.map((opt) => (\n <md-menu-item\n key={opt.value}\n id={`${this.triggerId}-opt-${opt.value}`}\n presentation=\"option\"\n type=\"radio\"\n check-position=\"start\"\n keep-open\n part={opt.value === this.value ? 'option option-selected' : 'option'}\n disabled={opt.disabled}\n selected={opt.value === this.value}\n headline={opt.label}\n supporting-text={opt.supportingText || ''}\n onMdClick={() => this.selectValue(opt.value)}\n >\n {opt.icon ? (\n <span\n slot=\"leading-icon\"\n part=\"option-icon\"\n class=\"material-symbols-outlined md-select__option-icon\"\n style={opt.iconColor ? { color: opt.iconColor } : undefined}\n aria-hidden=\"true\"\n >\n {opt.icon}\n </span>\n ) : null}\n {/* No light-DOM label copy: md-menu-item renders `headline` in\n its shadow and has no default slot — the unslotted text\n still entered accname computation, doubling the option's\n accessible name (\"10 10\"). */}\n </md-menu-item>\n ))}\n </div>\n )}\n </md-menu>\n );\n }\n\n render() {\n return (\n <Host\n class={{\n 'md-select': true,\n [`md-select--${this.variant}`]: true,\n 'md-select--open': this.open,\n 'md-select--disabled': this.disabled,\n 'md-select--loading': this.loading,\n }}\n aria-haspopup=\"listbox\"\n // No aria-expanded on the host: it has no role, so a screen reader ignores\n // it there (axe flags it \"aria attribute may be ignored\"). The expanded\n // state lives where it works — the filterable search (role=combobox) — and\n // on open, focus moves into the menu (the search, or md-menu's active row).\n aria-busy={this.loading ? 'true' : undefined}\n >\n {this.renderTrigger()}\n {this.renderMenu()}\n {/* Keep the declarative options in the light DOM (hidden) so the\n slotchange/mutation reactivity has something to observe. */}\n <div class=\"md-select__options\" hidden>\n <slot onSlotchange={() => this.refreshOptions()} />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"sRAAA,MAAMA,EAAc,IAAM,84GCuB1B,IAAIC,EAAkB,EAGtB,MAAMC,EAAuB,IAG7B,MAAMC,EAAqB,I,MAoDdC,EAAQ,MANrB,WAAAC,CAAAC,G,gUAoB8CC,KAAAC,kBAC1C,qCAQ+CD,KAAAE,uBAAkC,MAG3EF,KAAA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MACT6J,GAAI,GAAGpK,KAAKmC,iBAAiB6L,EAAIzN,QACjCkM,aAAa,SACbC,KAAK,QAAO,iBACG,QAAO,iBAEtBtB,KAAM4C,EAAIzN,QAAUP,KAAKO,MAAQ,yBAA2B,SAC5DC,SAAUwN,EAAIxN,SACdsG,SAAUkH,EAAIzN,QAAUP,KAAKO,MAC7BoM,SAAUqB,EAAI3N,MAAK,kBACF2N,EAAIpN,gBAAkB,GACvCiM,UAAW,IAAM7M,KAAKuD,YAAYyK,EAAIzN,QAErCyN,EAAIpC,KACHX,EAAA,QACEQ,KAAK,eACLL,KAAK,cACLD,MAAM,mDACNc,MAAO+B,EAAIC,UAAY,CAAEC,MAAOF,EAAIC,WAAcjD,UAAS,cAC/C,QAEXgD,EAAIpC,MAEL,S,CAalB,MAAAuC,GACE,OACElD,EAACmD,EAAI,CAAAzG,IAAA,2CACHwD,MAAO,CACL,YAAa,KACb,CAAC,cAAcnL,KAAKI,WAAY,KAChC,kBAAmBJ,KAAKiC,KACxB,sBAAuBjC,KAAKQ,SAC5B,qBAAsBR,KAAK+B,SAC5B,gBACa,UAAS,YAKZ/B,KAAK+B,QAAU,OAASiJ,WAElChL,KAAK0K,gBACL1K,KAAK+M,aAGN9B,EAAA,OAAAtD,IAAA,2CAAKwD,MAAM,qBAAqBkD,OAAM,MACpCpD,EAAA,QAAAtD,IAAA,2CAAM2G,aAAc,IAAMtO,KAAK0G,oB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as t,c as i,h as e,H as a,a as s}from"./p-DTaX19_O.js";const r=()=>`:host{--_container-color:var( --md-navigation-bar-container-color, var(--md-sys-color-surface-container, #F3EDF7) );--_container-height:var(--md-navigation-bar-container-height, 64px);--_container-shape:var(--md-navigation-bar-container-shape, 0);--_container-elevation:var(--md-navigation-bar-container-elevation, none);--_divider-color:var(--md-navigation-bar-divider-color, transparent);--_divider-width:var(--md-navigation-bar-divider-width, 0);--_z-index:var(--md-navigation-bar-z-index, var(--md-sys-z-index-navigation, 200));display:block;inline-size:100%;box-sizing:border-box;background-color:var(--_container-color);border-radius:var(--_container-shape);border-block-start:var(--_divider-width) solid var(--_divider-color);box-shadow:var(--_container-elevation);color:var(--md-sys-color-on-surface, #1C1B1F);z-index:var(--_z-index);position:relative}.md-navigation-bar__container{display:flex;flex-direction:row;align-items:stretch;justify-content:space-around;inline-size:100%;min-block-size:max(48px, calc(var(--_container-height) + var(--md-sys-density-scale, 0) * 4px));block-size:max(48px, calc(var(--_container-height) + var(--md-sys-density-scale, 0) * 4px));box-sizing:border-box}::slotted(md-navigation-tab){flex:1 1 0;min-inline-size:64px}@media (forced-colors: active){:host{--_container-color:Canvas;--_divider-color:CanvasText;--_divider-width:1px}}: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 n=class{constructor(e){t(this,e);this.mdChange=i(this,"mdChange",7);this.activeIndex=0;this.labelBehavior="always";this.manualActivation=false;this.density=0;this.tabs=[];this.previousIndex=-1}componentDidLoad(){this.syncTabs();this.applyActiveState(this.activeIndex,false);this.previousIndex=this.activeIndex}disconnectedCallback(){this.slotObserver?.disconnect()}onActiveIndexChange(t,i){const e=this.clampToEnabled(t);if(e!==t){this.activeIndex=e;return}this.applyActiveState(e,true,i)}onLabelBehaviorChange(){this.tabs.forEach((t=>this.propagateLabelBehavior(t)))}async select(t){const i=this.clampToEnabled(t);if(i===this.activeIndex)return;this.activeIndex=i}async focusTab(t){const i=this.tabs[t];if(!i||this.isHardDisabled(i))return;i.focus()}syncTabs(){const t=this.el.shadowRoot;if(!t)return;const i=t.querySelector("slot");if(!i)return;this.tabs=i.assignedElements().filter((t=>t.tagName==="MD-NAVIGATION-TAB"));if(this.tabs.length>0){this.el.setAttribute("data-tab-count",String(this.tabs.length))}else{this.el.removeAttribute("data-tab-count")}this.tabs.forEach((t=>this.propagateLabelBehavior(t)));this.applyActiveState(this.activeIndex,false)}propagateLabelBehavior(t){if(!t.hasAttribute("label-behavior")){t.labelBehavior=this.labelBehavior;t.setAttribute("data-md-inherited-label-behavior",this.labelBehavior)}}isDisabled(t){return t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}isHardDisabled(t){return t.hasAttribute("disabled")}clampToEnabled(t){if(this.tabs.length===0)return-1;const i=Math.max(0,Math.min(t,this.tabs.length-1));if(!this.isDisabled(this.tabs[i]))return i;for(let t=i+1;t<this.tabs.length;t++){if(!this.isDisabled(this.tabs[t]))return t}for(let t=i-1;t>=0;t--){if(!this.isDisabled(this.tabs[t]))return t}return-1}applyActiveState(t,i,e){this.tabs.forEach(((i,e)=>{if(e===t){if(!i.hasAttribute("active"))i.setAttribute("active","");i.setAttribute("tabindex","0");i.setAttribute("aria-selected","true")}else{if(i.hasAttribute("active"))i.removeAttribute("active");i.setAttribute("tabindex","-1");i.setAttribute("aria-selected","false")}}));if(i){const i=e??this.previousIndex;this.previousIndex=t;this.mdChange.emit({index:t,previousIndex:i})}else{this.previousIndex=t}}handleTabClick(t){t.stopPropagation();const i=t.target;if(!i)return;if(this.isDisabled(i))return;const e=this.tabs.indexOf(i);if(e<0)return;if(e===this.activeIndex)return;this.activeIndex=e}handleKeyDown(t){if(this.tabs.length===0)return;const i=document.activeElement;const e=t.composedPath()[0]??i;const a=this.tabs.findIndex((t=>t===e||t.contains(e)));if(a===-1)return;let s=null;const r=getComputedStyle(this.el).direction==="rtl";const n=r?"ArrowLeft":"ArrowRight";const o=r?"ArrowRight":"ArrowLeft";switch(t.key){case n:t.preventDefault();s=this.nextEnabled(a,1);break;case o:t.preventDefault();s=this.nextEnabled(a,-1);break;case"Home":t.preventDefault();s=this.firstEnabled();break;case"End":t.preventDefault();s=this.lastEnabled();break}if(s===null||s===a)return;this.tabs[s].focus();if(!this.manualActivation&&!this.isDisabled(this.tabs[s])){this.activeIndex=s}}nextEnabled(t,i){const e=this.tabs.length;let a=t;for(let t=0;t<e;t++){a=(a+i+e)%e;if(!this.isHardDisabled(this.tabs[a]))return a}return t}firstEnabled(){for(let t=0;t<this.tabs.length;t++){if(!this.isHardDisabled(this.tabs[t]))return t}return 0}lastEnabled(){for(let t=this.tabs.length-1;t>=0;t--){if(!this.isHardDisabled(this.tabs[t]))return t}return this.tabs.length-1}render(){return e(a,{key:"325e851ac4a7042b130860220da50841a056e1c4",role:"navigation"},e("div",{key:"ad48829d543d990abc77b4fe0f4acbfcf4761690",class:"md-navigation-bar__container",part:"container",role:"tablist","aria-orientation":"horizontal"},e("slot",{key:"cd8ef24df338375bd3a40a24ad39cb7b92ab3a59",onSlotchange:()=>this.syncTabs()})))}get el(){return s(this)}static get watchers(){return{activeIndex:[{onActiveIndexChange:0}],labelBehavior:[{onLabelBehaviorChange:0}]}}};n.style=r();export{n as md_navigation_bar};
2
- //# sourceMappingURL=p-05ae91b6.entry.js.map
1
+ import{r as t,c as i,h as e,H as a,g as s}from"./p-WmvQpZnM.js";const n=()=>`:host{--_container-color:var( --md-navigation-bar-container-color, var(--md-sys-color-surface-container, #F3EDF7) );--_container-height:var(--md-navigation-bar-container-height, 64px);--_container-shape:var(--md-navigation-bar-container-shape, 0);--_container-elevation:var(--md-navigation-bar-container-elevation, none);--_divider-color:var(--md-navigation-bar-divider-color, transparent);--_divider-width:var(--md-navigation-bar-divider-width, 0);--_z-index:var(--md-navigation-bar-z-index, var(--md-sys-z-index-navigation, 200));display:block;inline-size:100%;box-sizing:border-box;background-color:var(--_container-color);border-radius:var(--_container-shape);border-block-start:var(--_divider-width) solid var(--_divider-color);box-shadow:var(--_container-elevation);color:var(--md-sys-color-on-surface, #1C1B1F);z-index:var(--_z-index);position:relative}.md-navigation-bar__container{display:flex;flex-direction:row;align-items:stretch;justify-content:space-around;inline-size:100%;min-block-size:max(48px, calc(var(--_container-height) + var(--md-sys-density-scale, 0) * 4px));block-size:max(48px, calc(var(--_container-height) + var(--md-sys-density-scale, 0) * 4px));box-sizing:border-box}::slotted(md-navigation-tab){flex:1 1 0;min-inline-size:64px}@media (forced-colors: active){:host{--_container-color:Canvas;--_divider-color:CanvasText;--_divider-width:1px}}: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 r=class{constructor(e){t(this,e);this.mdChange=i(this,"mdChange",7);this.activeIndex=0;this.labelBehavior="always";this.manualActivation=false;this.density=0;this.tabs=[];this.previousIndex=-1}componentDidLoad(){this.syncTabs();this.applyActiveState(this.activeIndex,false);this.previousIndex=this.activeIndex}disconnectedCallback(){this.slotObserver?.disconnect()}onActiveIndexChange(t,i){const e=this.clampToEnabled(t);if(e!==t){this.activeIndex=e;return}this.applyActiveState(e,true,i)}onLabelBehaviorChange(){this.tabs.forEach((t=>this.propagateLabelBehavior(t)))}async select(t){const i=this.clampToEnabled(t);if(i===this.activeIndex)return;this.activeIndex=i}async focusTab(t){const i=this.tabs[t];if(!i||this.isHardDisabled(i))return;i.focus()}syncTabs(){const t=this.el.shadowRoot;if(!t)return;const i=t.querySelector("slot");if(!i)return;this.tabs=i.assignedElements().filter((t=>t.tagName==="MD-NAVIGATION-TAB"));if(this.tabs.length>0){this.el.setAttribute("data-tab-count",String(this.tabs.length))}else{this.el.removeAttribute("data-tab-count")}this.tabs.forEach((t=>this.propagateLabelBehavior(t)));this.applyActiveState(this.activeIndex,false)}propagateLabelBehavior(t){if(!t.hasAttribute("label-behavior")){t.labelBehavior=this.labelBehavior;t.setAttribute("data-md-inherited-label-behavior",this.labelBehavior)}}isDisabled(t){return t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}isHardDisabled(t){return t.hasAttribute("disabled")}clampToEnabled(t){if(this.tabs.length===0)return-1;const i=Math.max(0,Math.min(t,this.tabs.length-1));if(!this.isDisabled(this.tabs[i]))return i;for(let t=i+1;t<this.tabs.length;t++){if(!this.isDisabled(this.tabs[t]))return t}for(let t=i-1;t>=0;t--){if(!this.isDisabled(this.tabs[t]))return t}return-1}applyActiveState(t,i,e){this.tabs.forEach(((i,e)=>{if(e===t){if(!i.hasAttribute("active"))i.setAttribute("active","");i.setAttribute("tabindex","0");i.setAttribute("aria-selected","true")}else{if(i.hasAttribute("active"))i.removeAttribute("active");i.setAttribute("tabindex","-1");i.setAttribute("aria-selected","false")}}));if(i){const i=e??this.previousIndex;this.previousIndex=t;this.mdChange.emit({index:t,previousIndex:i})}else{this.previousIndex=t}}handleTabClick(t){t.stopPropagation();const i=t.target;if(!i)return;if(this.isDisabled(i))return;const e=this.tabs.indexOf(i);if(e<0)return;if(e===this.activeIndex)return;this.activeIndex=e}handleKeyDown(t){if(this.tabs.length===0)return;const i=document.activeElement;const e=t.composedPath()[0]??i;const a=this.tabs.findIndex((t=>t===e||t.contains(e)));if(a===-1)return;let s=null;const n=getComputedStyle(this.el).direction==="rtl";const r=n?"ArrowLeft":"ArrowRight";const o=n?"ArrowRight":"ArrowLeft";switch(t.key){case r:t.preventDefault();s=this.nextEnabled(a,1);break;case o:t.preventDefault();s=this.nextEnabled(a,-1);break;case"Home":t.preventDefault();s=this.firstEnabled();break;case"End":t.preventDefault();s=this.lastEnabled();break}if(s===null||s===a)return;this.tabs[s].focus();if(!this.manualActivation&&!this.isDisabled(this.tabs[s])){this.activeIndex=s}}nextEnabled(t,i){const e=this.tabs.length;let a=t;for(let t=0;t<e;t++){a=(a+i+e)%e;if(!this.isHardDisabled(this.tabs[a]))return a}return t}firstEnabled(){for(let t=0;t<this.tabs.length;t++){if(!this.isHardDisabled(this.tabs[t]))return t}return 0}lastEnabled(){for(let t=this.tabs.length-1;t>=0;t--){if(!this.isHardDisabled(this.tabs[t]))return t}return this.tabs.length-1}render(){return e(a,{key:"cb22af9667abfc892a7f0d1d829bba39f17cdfd7",role:"navigation"},e("div",{key:"3f3b41e2f66fc7abe0d82425a685c64a0cf1e2dc",class:"md-navigation-bar__container",part:"container",role:"tablist","aria-orientation":"horizontal"},e("slot",{key:"ae3e561d42998fdd4f2489f6f50368d9de103f62",onSlotchange:()=>this.syncTabs()})))}get el(){return s(this)}static get watchers(){return{activeIndex:[{onActiveIndexChange:0}],labelBehavior:[{onLabelBehaviorChange:0}]}}};r.style=n();export{r as md_navigation_bar};
2
+ //# sourceMappingURL=p-90ccf4c3.entry.js.map
@@ -0,0 +1,2 @@
1
+ const n=["http:","https:","mailto:","tel:","sms:","ftp:"];function e(e){if(e==null)return undefined;const r=String(e).trim();if(!r)return undefined;const t=r.replace(/[^!-~]/g,"").toLowerCase();const o=t.indexOf(":");if(o===-1)return r;const s=t.search(/[/?#]/);if(s!==-1&&s<o)return r;return n.includes(t.slice(0,o+1))?r:undefined}const r="noopener,noreferrer";const t="noopener noreferrer";export{t as S,r as a,e as s};
2
+ //# sourceMappingURL=p-BdEoSBtL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"p-BjYKc1Ge.js","sources":["src/utils/url.ts"],"sourcesContent":["/**\n * URL safety for components that expose an `href` prop.\n *\n * Every `href` is consumer-supplied, and consumers routinely bind it to data\n * they didn't author (a CMS field, an API response, a row of user records).\n * A `javascript:` or `data:` URL in that position executes script the moment\n * the link is followed — in the consumer's origin, with their session. The\n * component is the last place that can stop it, because static analysis of\n * *this* repo never sees the untrusted value: it enters at the API boundary.\n *\n * Allowlist, not denylist. A denylist has to anticipate every dangerous\n * scheme (`javascript:`, `data:`, `vbscript:`, `blob:`, browser-specific\n * ones); an allowlist only has to name the handful that navigation needs.\n */\n\n/** Schemes a link is allowed to navigate to. Everything else is dropped. */\nconst SAFE_SCHEMES = ['http:', 'https:', 'mailto:', 'tel:', 'sms:', 'ftp:'];\n\n/**\n * Return `value` when it is safe to navigate to, otherwise `undefined`.\n *\n * Relative URLs (`/path`, `?q=1`, `#anchor`) and protocol-relative ones\n * (`//host/path`) pass through — they inherit the page's origin and scheme\n * and cannot introduce a new one.\n *\n * The returned string is the caller's original value (trimmed), never a\n * normalised or re-encoded one: rewriting a URL that was already safe risks\n * breaking query strings and fragments that consumers depend on.\n */\nexport function sanitizeHref(value: string | null | undefined): string | undefined {\n if (value == null) return undefined;\n\n const href = String(value).trim();\n if (!href) return undefined;\n\n /* Scheme detection runs on a stripped copy, because URL parsing drops ASCII\n whitespace and control characters that sit *inside* the scheme. Without\n this step a tab or newline spliced into \"javascript:\" reads as an unknown\n scheme here while still navigating in the browser.\n\n `[^!-~]` keeps only printable, non-space ASCII (0x21-0x7E) — which covers\n every character legal in a scheme — and drops spaces, tabs, newlines,\n control characters and non-ASCII alike. The stripped copy is used solely\n to decide; the original is what gets returned. */\n const probe = href.replace(/[^!-~]/g, '').toLowerCase();\n\n const colon = probe.indexOf(':');\n if (colon === -1) return href; // no scheme at all — relative\n\n /* A colon that appears after the first `/`, `?` or `#` belongs to the path,\n query or fragment, not to a scheme: `/a:b`, `?x=1:2` and `#a:b` are all\n relative URLs. */\n const separator = probe.search(/[/?#]/);\n if (separator !== -1 && separator < colon) return href;\n\n return SAFE_SCHEMES.includes(probe.slice(0, colon + 1)) ? href : undefined;\n}\n\n/**\n * `window.open` features that sever the opener relationship.\n *\n * Without `noopener` the opened page can reach back through `window.opener`\n * and navigate the page that opened it — reverse tabnabbing, which turns any\n * outbound link into a phishing vector. `noreferrer` implies `noopener` and\n * additionally withholds the `Referer` header; it is included because the\n * components that already opened links correctly used both, and a library\n * should not leak the embedding URL to third parties by default.\n *\n * `_self`, `_top` and `_parent` keep their meaning when these are set; every\n * other target name behaves as `_blank`.\n */\nexport const SAFE_WINDOW_FEATURES = 'noopener,noreferrer';\n\n/**\n * `rel` value for a rendered anchor that opens in a new browsing context.\n *\n * Modern browsers imply `noopener` for `target=\"_blank\"`, but the guarantee\n * only holds for that exact target — a named target (`target=\"preview\"`) still\n * hands over `window.opener`, so the attribute is set explicitly.\n */\nexport const SAFE_LINK_REL = 'noopener noreferrer';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;AAaG;AAEH;AACA,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;AAE3E;;;;;;;;;;AAUG;AACG,SAAU,YAAY,CAAC,KAAgC,EAAA;IAC3D,IAAI,KAAK,IAAI,IAAI;AAAE,QAAA,OAAO,SAAS;IAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;AACjC,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,SAAS;AAE3B;;;;;;;;AAQoD;AACpD,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;IAEvD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IAChC,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;AAE9B;;AAEoB;IACpB,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;AACvC,IAAA,IAAI,SAAS,KAAK,EAAE,IAAI,SAAS,GAAG,KAAK;AAAE,QAAA,OAAO,IAAI;IAEtD,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;AAC5E;AAEA;;;;;;;;;;;;AAYG;AACI,MAAM,oBAAoB,GAAG;AAEpC;;;;;;AAMG;AACI,MAAM,aAAa,GAAG;;;;"}
1
+ {"version":3,"file":"p-BdEoSBtL.js","sources":["src/utils/url.ts"],"sourcesContent":["/**\n * URL safety for components that expose an `href` prop.\n *\n * Every `href` is consumer-supplied, and consumers routinely bind it to data\n * they didn't author (a CMS field, an API response, a row of user records).\n * A `javascript:` or `data:` URL in that position executes script the moment\n * the link is followed — in the consumer's origin, with their session. The\n * component is the last place that can stop it, because static analysis of\n * *this* repo never sees the untrusted value: it enters at the API boundary.\n *\n * Allowlist, not denylist. A denylist has to anticipate every dangerous\n * scheme (`javascript:`, `data:`, `vbscript:`, `blob:`, browser-specific\n * ones); an allowlist only has to name the handful that navigation needs.\n */\n\n/** Schemes a link is allowed to navigate to. Everything else is dropped. */\nconst SAFE_SCHEMES = ['http:', 'https:', 'mailto:', 'tel:', 'sms:', 'ftp:'];\n\n/**\n * Return `value` when it is safe to navigate to, otherwise `undefined`.\n *\n * Relative URLs (`/path`, `?q=1`, `#anchor`) and protocol-relative ones\n * (`//host/path`) pass through — they inherit the page's origin and scheme\n * and cannot introduce a new one.\n *\n * The returned string is the caller's original value (trimmed), never a\n * normalised or re-encoded one: rewriting a URL that was already safe risks\n * breaking query strings and fragments that consumers depend on.\n */\nexport function sanitizeHref(value: string | null | undefined): string | undefined {\n if (value == null) return undefined;\n\n const href = String(value).trim();\n if (!href) return undefined;\n\n /* Scheme detection runs on a stripped copy, because URL parsing drops ASCII\n whitespace and control characters that sit *inside* the scheme. Without\n this step a tab or newline spliced into \"javascript:\" reads as an unknown\n scheme here while still navigating in the browser.\n\n `[^!-~]` keeps only printable, non-space ASCII (0x21-0x7E) — which covers\n every character legal in a scheme — and drops spaces, tabs, newlines,\n control characters and non-ASCII alike. The stripped copy is used solely\n to decide; the original is what gets returned. */\n const probe = href.replace(/[^!-~]/g, '').toLowerCase();\n\n const colon = probe.indexOf(':');\n if (colon === -1) return href; // no scheme at all — relative\n\n /* A colon that appears after the first `/`, `?` or `#` belongs to the path,\n query or fragment, not to a scheme: `/a:b`, `?x=1:2` and `#a:b` are all\n relative URLs. */\n const separator = probe.search(/[/?#]/);\n if (separator !== -1 && separator < colon) return href;\n\n return SAFE_SCHEMES.includes(probe.slice(0, colon + 1)) ? href : undefined;\n}\n\n/**\n * `window.open` features that sever the opener relationship.\n *\n * Without `noopener` the opened page can reach back through `window.opener`\n * and navigate the page that opened it — reverse tabnabbing, which turns any\n * outbound link into a phishing vector. `noreferrer` implies `noopener` and\n * additionally withholds the `Referer` header; it is included because the\n * components that already opened links correctly used both, and a library\n * should not leak the embedding URL to third parties by default.\n *\n * `_self`, `_top` and `_parent` keep their meaning when these are set; every\n * other target name behaves as `_blank`.\n */\nexport const SAFE_WINDOW_FEATURES = 'noopener,noreferrer';\n\n/**\n * `rel` value for a rendered anchor that opens in a new browsing context.\n *\n * Modern browsers imply `noopener` for `target=\"_blank\"`, but the guarantee\n * only holds for that exact target — a named target (`target=\"preview\"`) still\n * hands over `window.opener`, so the attribute is set explicitly.\n */\nexport const SAFE_LINK_REL = 'noopener noreferrer';\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;AAaG;AAEH;AACA,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;AAE3E;;;;;;;;;;AAUG;AACG,SAAU,YAAY,CAAC,KAAgC,EAAA;IAC3D,IAAI,KAAK,IAAI,IAAI;AAAE,QAAA,OAAO,SAAS;IAEnC,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;AACjC,IAAA,IAAI,CAAC,IAAI;AAAE,QAAA,OAAO,SAAS;AAE3B;;;;;;;;AAQoD;AACpD,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;IAEvD,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;IAChC,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;AAE9B;;AAEoB;IACpB,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;AACvC,IAAA,IAAI,SAAS,KAAK,EAAE,IAAI,SAAS,GAAG,KAAK;AAAE,QAAA,OAAO,IAAI;IAEtD,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS;AAC5E;AAEA;;;;;;;;;;;;AAYG;AACI,MAAM,oBAAoB,GAAG;AAEpC;;;;;;AAMG;AACI,MAAM,aAAa,GAAG;;;;"}
@@ -0,0 +1,2 @@
1
+ function t(t){const s=(t.label||t.getAttribute("label")||t.textContent||"").trim();return{value:t.value??t.getAttribute("value")??"",label:s,disabled:t.disabled??t.hasAttribute("disabled"),icon:t.icon||t.getAttribute("icon")||undefined,iconColor:t.iconColor||t.getAttribute("icon-color")||undefined,supportingText:t.supportingText||t.getAttribute("supporting-text")||undefined,selected:t.selected??t.hasAttribute("selected")}}function s(t){return{value:t.value,label:t.label??t.value,disabled:!!t.disabled,icon:t.icon,iconColor:t.iconColor,supportingText:t.supportingText,selected:!!t.selected}}function i(t){return!Array.isArray(t)}function n(t){if(!i(t))return t.slice();const s=new Array(t.count);for(let i=0;i<t.count;i++)s[i]=t.getRow(i);return s}function e(t){return t.map(s)}function h(i,n){const e=Array.from(i.children).filter((t=>t.tagName.toLowerCase()==="md-select-option"));if(e.length>0){return e.map(t)}return(n??[]).map(s)}function o(t,s){return t.find((t=>t.value===s))?.label??""}const r=15e5;function c(t,s,i,n,e,h=r,o=-1){if(n<=0||i<=0||s<=0){const t=n>0&&i>0?n*i:0;return{start:0,end:0,topPad:0,bottomPad:t,scrollHeight:t,scrollTop:0}}const c=n*i;const a=Math.ceil(s/i);if(c<=h){const h=Math.min(Math.max(0,t),Math.max(0,c-s));const o=Math.floor(h/i);const r=Math.min(n,Math.max(0,o-e));const u=Math.min(n,Math.max(r,o+a+e));return{start:r,end:u,topPad:r*i,bottomPad:Math.max(0,(n-u)*i),scrollHeight:c,scrollTop:h}}const u=h;const f=Math.max(1,u-s);const l=Math.max(0,n-a);if(o>=0){const t=Math.min(l,o);const s=Math.min(e,t);const h=t-s;const r=Math.min(n,t+a+e);const c=(r-h)*i;const d=s*i;const M=Math.round(t/Math.max(1,l)*f);const m=Math.max(d,Math.min(f,M));const b=m-s*i;const p=Math.max(0,u-b-c);return{start:h,end:r,topPad:b,bottomPad:p,scrollHeight:u,scrollTop:m}}const d=Math.min(Math.max(0,t),f);const M=Math.round(d/f*l);const m=Math.min(e,M,Math.floor(d/i));const b=M-m;const p=Math.min(n,M+a+e);const w=(p-b)*i;const y=Math.max(0,u-w);let A=d-m*i;if(A<0)A=0;else if(A>y)A=y;const g=Math.max(0,u-A-w);return{start:b,end:p,topPad:A,bottomPad:g,scrollHeight:u,scrollTop:d}}const a=0;function u(t){if(typeof atob==="function"){const s=atob(t);const i=new Uint8Array(s.length);for(let t=0;t<s.length;t++)i[t]=s.charCodeAt(t);return i}return Uint8Array.from(Buffer.from(t,"base64"))}let f;async function l(){f??(f=import("./p-CfBPnYW7.js").then((({WASM_BASE64:t})=>WebAssembly.compile(u(t)))));const t=await f;const s={env:{abort(){},trace(){},seed(){return Date.now()}}};const i=await WebAssembly.instantiate(t,s);return i.exports}const d={substring:0,prefix:1,fuzzy:2};const M=1;const m=6;const b=2048;const p=typeof performance!=="undefined"&&typeof performance.now==="function"?()=>performance.now():()=>Date.now();function w(){const t=globalThis.scheduler;if(t?.yield)return t.yield();return new Promise((t=>setTimeout(t,0)))}const y=12;async function A(t){if(typeof requestAnimationFrame==="function"&&p()-t.t>=y){await new Promise((t=>{requestAnimationFrame((()=>setTimeout(t,0)))}));t.t=p();return}await w()}function g(){return typeof WebAssembly!=="undefined"&&typeof WebAssembly.instantiate==="function"}function P(t){let s=0;for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(n<128){s+=1}else if(n<2048){s+=2}else if(n>=55296&&n<=56319){const n=t.charCodeAt(i+1);if(n>=56320&&n<=57343){s+=4;i++}else{s+=3}}else{s+=3}}return s}class x{constructor(){this.enc=new TextEncoder;this.dec=new TextDecoder;this._length=0;this._total=0;this.mode=a}ensureReady(){if(!this.ready){this.ready=g()?l().then((t=>{this.engine=t})):Promise.reject(new Error("WebAssembly is not available in this environment"))}return this.ready}get ready$(){return!!this.engine}get length(){return this._length}get total(){return this._total}setFilterMode(t){this.mode=d[t]??a}mem(){return new Uint8Array(this.engine.memory.buffer)}async load(t){await this.ensureReady();const s=this.engine;let n;let e;if(i(t)){n=t.count;e=t.getRow}else{n=t.length;e=s=>t[s]}const h={t:p()};let o=0;let r=0;let c=0;let a=0;for(let t=0;t<n;){const s=p();do{const s=Math.min(n,t+b);for(;t<s;t++){const s=e(t);o+=P(s.value);r+=P(s.label??s.value);if(s.icon)c+=P(s.icon);if(s.supportingText)a+=P(s.supportingText)}}while(t<n&&p()-s<m);if(t<n)await A(h)}s.reserve(n,o,r,c,a);for(let t=0;t<n;){const i=p();const o=this.mem();do{const i=Math.min(n,t+b);for(;t<i;t++){const i=e(t);const n=s.valueWritePtr();const h=this.enc.encodeInto(i.value,o.subarray(n));const r=s.labelWritePtr();const u=this.enc.encodeInto(i.label??i.value,o.subarray(r));const f=s.iconWritePtr();const l=c>0?this.enc.encodeInto(i.icon??"",o.subarray(f)):null;const d=s.supportWritePtr();const m=a>0?this.enc.encodeInto(i.supportingText??"",o.subarray(d)):null;s.appendRow(h.written??0,u.written??0,l?.written??0,m?.written??0,i.disabled?M:0)}}while(t<n&&p()-i<m);if(t<n)await A(h)}s.finalizeLoad();this._total=s.totalCount();this._length=s.filteredCount()}writeScratch(t){const s=this.engine;const i=s.queryCapacity();const n=s.queryPtr();const{written:e}=this.enc.encodeInto(t,this.mem().subarray(n,n+i));return e??0}setQuery(t){if(!this.engine)return 0;const s=this.writeScratch(t);this._length=this.engine.setQuery(s,this.mode);return this._length}decodeRow(t,s){const i=this.engine;const n=i.valuePtr(t);const e=i.valueLen(t);const h=i.labelPtr(t);const o=i.labelLen(t);const r=i.iconPtr(t);const c=i.iconLen(t);const a=i.supportPtr(t);const u=i.supportLen(t);return{index:t,value:this.dec.decode(s.subarray(n,n+e)),label:this.dec.decode(s.subarray(h,h+o)),disabled:(i.rowFlags(t)&M)!==0,icon:c>0?this.dec.decode(s.subarray(r,r+c)):"",supportingText:u>0?this.dec.decode(s.subarray(a,a+u)):""}}getWindow(t,s){if(!this.engine)return[];const i=this.engine;const n=this.mem();const e=[];const h=Math.max(0,t);const o=Math.min(this._length,t+s);for(let t=h;t<o;t++){const s=i.rowAt(t);if(s>=0)e.push(this.decodeRow(s,n))}return e}getRow(t){if(!this.engine)return null;const s=this.engine.rowAt(t);if(s<0)return null;return this.decodeRow(s,this.mem())}rowAt(t){return this.engine?this.engine.rowAt(t):-1}disabledAt(t){if(!this.engine)return false;const s=this.engine.rowAt(t);if(s<0)return false;return(this.engine.rowFlags(s)&M)!==0}labelAt(t){if(!this.engine)return"";const s=this.engine.rowAt(t);if(s<0)return"";const i=this.engine.labelPtr(s);const n=this.engine.labelLen(s);return this.dec.decode(this.mem().subarray(i,i+n))}getLabels(t){const s=new Map;if(!this.engine)return s;const i=this.engine;for(const n of t){const t=this.writeScratch(n);const e=i.indexOfValue(t);if(e>=0){const t=i.labelPtr(e);const h=i.labelLen(e);s.set(n,this.dec.decode(this.mem().subarray(t,t+h)))}}return s}has(t){if(!this.engine)return false;return this.engine.indexOfValue(this.writeScratch(t))>=0}findLabelPrefix(t,s){if(!this.engine)return-1;const i=this.writeScratch(t);return this.engine.findLabelPrefix(i,s)}reset(){this.engine?.reset();this._length=0;this._total=0}}const F=1e6;const T=8;const v=48;const W=320;const q=0;class H{constructor(t){this.host=t;this.store=new x;this.active=false;this.windowStart=0;this.windowRows=[];this.topPad=0;this.bottomPad=0;this.filteredLength=0;this.rowHeight=v;this.scrollRaf=0;this.browserMaxScroll=Infinity;this.intendedScrollHeight=0;this.detectRaf=0;this.detectRetries=0;this.navAnchorFirstRow=-1;this.usedScrollTop=0;this.onScroll=()=>{if(this.scrollRaf)return;this.scrollRaf=requestAnimationFrame((()=>{this.scrollRaf=0;const t=this.viewportEl;if(!t)return;if(this.navAnchorFirstRow>=0&&Math.abs(t.scrollTop-this.usedScrollTop)<=1){return}this.navAnchorFirstRow=-1;this.recompute(t.scrollTop)}))};this.provider={count:()=>this.filteredLength,labelAt:t=>this.store.labelAt(t),isDisabledAt:t=>this.store.disabledAt(t),ensureVisible:t=>this.ensureVisible(t),domItemForIndex:t=>this.host.queryItem(t),findPrefix:(t,s)=>this.store.findLabelPrefix(t,s)}}effectiveMaxScroll(){return Math.min(r,this.browserMaxScroll)}setFixedRowHeight(t){this.fixedRowHeight=t&&t>0?t:undefined;if(this.fixedRowHeight)this.rowHeight=this.fixedRowHeight}setFilterMode(t){this.store.setFilterMode(t)}async load(t){const s=i(t)?t.count:t.length;if(!g()||s===0)return false;try{await this.store.ensureReady()}catch{return false}await this.store.load(t);this.active=true;this.filteredLength=this.store.length;this.recompute(this.viewportEl?.scrollTop??0);return true}setQuery(t){if(!this.active)return;this.filteredLength=this.store.setQuery(t);this.navAnchorFirstRow=-1;if(this.viewportEl)this.viewportEl.scrollTop=0;this.recompute(0)}getLabels(t){return this.store.getLabels(t)}reset(){this.store.reset();this.active=false;this.windowRows=[];this.filteredLength=0;this.windowStart=0;this.topPad=0;this.bottomPad=0;this.navAnchorFirstRow=-1}async attachViewport(t){this.detachViewport();const s=await t();this.viewportEl=s??undefined;if(this.viewportEl){this.viewportEl.addEventListener("scroll",this.onScroll,{passive:true});this.measureRowHeight();this.recompute(this.viewportEl.scrollTop);this.detectRetries=60;this.detectScrollCap()}}detachViewport(){if(this.scrollRaf){cancelAnimationFrame(this.scrollRaf);this.scrollRaf=0}if(this.detectRaf){cancelAnimationFrame(this.detectRaf);this.detectRaf=0}this.viewportEl?.removeEventListener("scroll",this.onScroll);this.viewportEl=undefined}measureRowHeight(){if(this.fixedRowHeight){this.rowHeight=this.fixedRowHeight;return}const t=this.host.queryItem(this.windowStart);const s=t?.offsetHeight??0;if(s>0&&s!==this.rowHeight){this.rowHeight=s;if(this.viewportEl)this.recompute(this.viewportEl.scrollTop)}}recompute(t){const s=this.viewportEl?.clientHeight||W;const i=c(t,s,this.rowHeight,this.filteredLength,T,this.effectiveMaxScroll(),this.navAnchorFirstRow);this.windowStart=i.start;this.topPad=i.topPad;this.bottomPad=i.bottomPad;this.intendedScrollHeight=i.scrollHeight;this.usedScrollTop=i.scrollTop;this.windowRows=this.store.getWindow(i.start,i.end-i.start);this.host.requestRender()}detectScrollCap(){if(this.detectRaf)cancelAnimationFrame(this.detectRaf);this.detectRaf=requestAnimationFrame((()=>{this.detectRaf=requestAnimationFrame((()=>{this.detectRaf=0;const t=this.viewportEl;if(!t)return;const s=t.scrollHeight;if(s>0&&s+2<this.intendedScrollHeight&&s<this.browserMaxScroll){if(s<F){if(this.detectRetries-- >0)this.detectScrollCap();return}this.browserMaxScroll=s;this.recompute(t.scrollTop)}}))}))}async ensureVisible(t){const s=this.viewportEl;if(!s)return;const i=s.clientHeight||W;const n=this.filteredLength*this.rowHeight;if(n<=this.effectiveMaxScroll()){this.navAnchorFirstRow=-1;const n=t*this.rowHeight;const e=n+this.rowHeight;const h=Math.max(0,s.scrollHeight-i);if(n-q<s.scrollTop){s.scrollTop=Math.max(0,n-q)}else if(e+q>s.scrollTop+i){s.scrollTop=Math.min(h,e+q-i)}this.recompute(s.scrollTop)}else{const n=Math.max(1,Math.floor(i/this.rowHeight));const e=Math.ceil(i/this.rowHeight);const h=Math.max(0,this.filteredLength-e);const o=this.navAnchorFirstRow>=0?this.navAnchorFirstRow:this.windowStart+Math.max(0,Math.round((s.scrollTop-this.topPad)/this.rowHeight));const r=o+n-1;const c=Math.ceil(q/this.rowHeight);if(t<o+c||t>r-c){this.navAnchorFirstRow=Math.min(h,Math.max(0,t<o+c?t-c:t-n+1+c))}this.recompute(s.scrollTop);if(this.navAnchorFirstRow>=0){const t=Math.max(0,s.scrollHeight-i);const n=Math.min(Math.round(this.usedScrollTop),t);if(n!==Math.round(s.scrollTop)){s.scrollTop=n}this.usedScrollTop=s.scrollTop}}for(let s=0;s<8;s++){await new Promise((t=>requestAnimationFrame((()=>t()))));if(this.host.queryItem(t))return}}}export{H as V,h as c,g as i,o as l,e as n,n as r};
2
+ //# sourceMappingURL=p-Bz-JaJcA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p-Bz-JaJcA.js","sources":["src/utils/select-options.ts","src/utils/virtual-window.ts","src/wasm/engine-abi.ts","src/utils/wasm-option-store.ts","src/utils/virtual-select-controller.ts"],"sourcesContent":["/**\n * Shared option model + reader for `md-select` / `md-multi-select`.\n *\n * Both components accept options two ways (decided by the consumer):\n * 1. Declarative slotted `<md-select-option>` children (primary API —\n * framework-friendly, supports rich labels + per-option icons).\n * 2. A programmatic `options` array prop (data-driven lists).\n *\n * `collectOptions()` normalises either source into a single flat\n * `SelectOptionData[]` the pickers render into `md-menu-item`s. When\n * slotted children are present they take precedence; otherwise the\n * array prop is used. This keeps the result predictable (no silent\n * duplication when a consumer accidentally supplies both).\n */\n\n/** Normalised option the pickers render. */\nexport interface SelectOptionData {\n /** Stable identifier — emitted in the picker `value` and used for matching. */\n value: string;\n /** Visible label rendered in the menu, chips, and the trigger text. */\n label: string;\n /** Disabled options stay visible but cannot be selected. */\n disabled: boolean;\n /** Optional Material Symbols leading-icon glyph. */\n icon?: string;\n /** Optional CSS colour applied to the leading icon (e.g. a status/swatch hue).\n * Any CSS `<color>` — hex, `rgb()`, or a theme token like\n * `var(--md-sys-color-primary)`. Ignored when the option has no `icon`, and\n * not carried on the virtualized (WASM) path — huge datasets fall back to the\n * `--md-{multi-}select-option-icon-color` token. */\n iconColor?: string;\n /** Optional secondary text rendered under the label in the menu. */\n supportingText?: string;\n /** Initial-selected hint carried by the option element / array entry. */\n selected?: boolean;\n}\n\n/** Programmatic option entry accepted by the `options` array prop. */\nexport interface SelectOptionInit {\n value: string;\n label?: string;\n disabled?: boolean;\n icon?: string;\n iconColor?: string;\n supportingText?: string;\n selected?: boolean;\n}\n\n/** Element-side shape of a slotted `<md-select-option>`. */\ninterface SelectOptionEl extends HTMLElement {\n value?: string;\n label?: string;\n disabled?: boolean;\n icon?: string;\n iconColor?: string;\n supportingText?: string;\n selected?: boolean;\n}\n\nfunction fromElement(el: SelectOptionEl): SelectOptionData {\n const label = (el.label || el.getAttribute('label') || el.textContent || '').trim();\n return {\n value: el.value ?? el.getAttribute('value') ?? '',\n label,\n disabled: el.disabled ?? el.hasAttribute('disabled'),\n icon: el.icon || el.getAttribute('icon') || undefined,\n iconColor: el.iconColor || el.getAttribute('icon-color') || undefined,\n supportingText:\n el.supportingText || el.getAttribute('supporting-text') || undefined,\n selected: el.selected ?? el.hasAttribute('selected'),\n };\n}\n\nfunction fromInit(o: SelectOptionInit): SelectOptionData {\n return {\n value: o.value,\n label: o.label ?? o.value,\n disabled: !!o.disabled,\n icon: o.icon,\n iconColor: o.iconColor,\n supportingText: o.supportingText,\n selected: !!o.selected,\n };\n}\n\n/**\n * A dataset given as a row factory rather than a materialised array, so very\n * large option sets (tens of millions) can be streamed into the WASM store\n * without ever holding the whole array in JS at once.\n */\nexport interface OptionRowSource {\n count: number;\n getRow: (index: number) => SelectOptionInit;\n}\n\n/**\n * Type guard distinguishing a row factory from a materialised array.\n * (`Array.isArray` doesn't narrow a `readonly[]` union, so this is explicit.)\n */\nexport function isRowSource(\n source: ReadonlyArray<SelectOptionInit> | OptionRowSource,\n): source is OptionRowSource {\n return !Array.isArray(source);\n}\n\n/** Materialise a row source (array or factory) into a plain array. */\nexport function rowsToArray(\n source: ReadonlyArray<SelectOptionInit> | OptionRowSource,\n): SelectOptionInit[] {\n if (!isRowSource(source)) return source.slice();\n const out = new Array<SelectOptionInit>(source.count);\n for (let i = 0; i < source.count; i++) out[i] = source.getRow(i);\n return out;\n}\n\n/** Normalise a programmatic `options` array to `SelectOptionData[]`. */\nexport function normalizeInits(inits: ReadonlyArray<SelectOptionInit>): SelectOptionData[] {\n return inits.map(fromInit);\n}\n\n/**\n * Read the option set for a picker host. Slotted `<md-select-option>`\n * children win when present; otherwise the `options` array is used.\n */\nexport function collectOptions(\n host: HTMLElement,\n optionsProp?: SelectOptionInit[],\n): SelectOptionData[] {\n // Direct light-DOM children only (avoids `:scope`, which mock-doc/older\n // engines don't support, and avoids reaching into nested option groups).\n const slotted = Array.from(host.children).filter(\n (c) => c.tagName.toLowerCase() === 'md-select-option',\n ) as SelectOptionEl[];\n\n if (slotted.length > 0) {\n return slotted.map(fromElement);\n }\n return (optionsProp ?? []).map(fromInit);\n}\n\n/** Label for a single value, or '' if not found. */\nexport function labelFor(options: SelectOptionData[], value: string): string {\n return options.find((o) => o.value === value)?.label ?? '';\n}\n","/**\n * Fixed-row-height virtual windowing math, shared by the virtualized selects.\n *\n * Pure and DOM-free so it can be unit-tested directly. Given the scroll offset\n * and viewport size, it returns the slice of rows to render plus the spacer\n * heights that make the scroll container behave as if every row were present.\n *\n * Two regimes:\n * - Exact: when the full list height fits under `maxScrollHeight`, the spacers\n * reproduce the real height 1:1 and the offset maps to a row directly.\n * - Scaled: when the list is taller than a browser can lay out (millions of\n * rows × row height easily exceeds the ~16–33M px element-height cap), the\n * spacers reproduce a *capped* height and the scroll offset maps\n * proportionally onto the row range. The rendered block is always\n * positioned to cover the viewport, so the list never shows blank rows and\n * can be scrolled all the way to the end.\n */\nexport interface WindowCalc {\n /** First filtered index to render (inclusive), overscan applied. */\n start: number;\n /** One past the last filtered index to render (exclusive). */\n end: number;\n /** Spacer height (px) before the first rendered row. */\n topPad: number;\n /** Spacer height (px) after the last rendered row. */\n bottomPad: number;\n /** Total scrollable height the spacers reproduce (topPad + rows + bottomPad). */\n scrollHeight: number;\n /**\n * The scroll offset this window is laid out for. Equal to the input scrollTop\n * for mouse-driven windows; for an anchored (keyboard-nav) window it is the\n * offset the caller should apply so the anchor row lands at the viewport top.\n */\n scrollTop: number;\n}\n\n/**\n * Default ceiling on the scrollable height. Comfortably under every major\n * browser's maximum element height (Firefox ~17.9M, Chrome ~33.5M) so the\n * spacers always lay out, while still giving smooth scroll resolution for\n * millions of rows. The controller can lower this further at runtime if it\n * detects the browser clamping even shorter.\n */\nexport const DEFAULT_MAX_SCROLL_HEIGHT = 1_500_000;\n\nexport function computeWindow(\n scrollTop: number,\n viewportHeight: number,\n rowHeight: number,\n total: number,\n overscan: number,\n maxScrollHeight: number = DEFAULT_MAX_SCROLL_HEIGHT,\n // In the scaled regime, pin the first rendered row to this index instead of\n // deriving it from the scroll fraction. Keyboard nav uses this because integer\n // scrollTop is too coarse to address individual rows in a multi-million list.\n anchorFirstRow: number = -1,\n): WindowCalc {\n if (total <= 0 || rowHeight <= 0 || viewportHeight <= 0) {\n const realHeight = total > 0 && rowHeight > 0 ? total * rowHeight : 0;\n return { start: 0, end: 0, topPad: 0, bottomPad: realHeight, scrollHeight: realHeight, scrollTop: 0 };\n }\n\n const realHeight = total * rowHeight;\n const visibleCount = Math.ceil(viewportHeight / rowHeight);\n\n // ── Exact regime: the list fits, spacers mirror the real height. ──\n if (realHeight <= maxScrollHeight) {\n const clamped = Math.min(Math.max(0, scrollTop), Math.max(0, realHeight - viewportHeight));\n const firstVisible = Math.floor(clamped / rowHeight);\n const start = Math.min(total, Math.max(0, firstVisible - overscan));\n const end = Math.min(total, Math.max(start, firstVisible + visibleCount + overscan));\n return {\n start,\n end,\n topPad: start * rowHeight,\n bottomPad: Math.max(0, (total - end) * rowHeight),\n scrollHeight: realHeight,\n scrollTop: clamped,\n };\n }\n\n // ── Scaled regime: list taller than `maxScrollHeight`. ──\n const scrollHeight = maxScrollHeight;\n const maxScrollTop = Math.max(1, scrollHeight - viewportHeight);\n const maxFirstRow = Math.max(0, total - visibleCount);\n\n if (anchorFirstRow >= 0) {\n // Keyboard nav: position the anchor row at the viewport top and *derive* the\n // scroll offset to match. Integer scrollTop is too coarse to address single\n // rows near the ends of a multi-million-row list, so we treat the offset as\n // an output (the caller applies `scrollTop`) instead of an input. This is\n // what makes ArrowDown/ArrowUp keep advancing past the rendered window.\n const firstVisibleRow = Math.min(maxFirstRow, anchorFirstRow);\n const aboveRows = Math.min(overscan, firstVisibleRow);\n const start = firstVisibleRow - aboveRows;\n const end = Math.min(total, firstVisibleRow + visibleCount + overscan);\n const blockHeight = (end - start) * rowHeight;\n // Use the SAME proportional row↔offset mapping as the mouse-scroll branch\n // below, so a given offset uniquely identifies the anchor row and re-deriving\n // the window from `scrollTop` (when the anchor is dropped) lands on the same\n // row. We deliberately do NOT pull the offset up to bottom-align the block\n // near the end (an earlier `hi` clamp did): that collapsed many adjacent\n // anchors onto one integer offset, so a single stray scroll event would\n // re-map that offset proportionally and teleport the view thousands of rows\n // (ArrowUp \"jumping\" near the bottom of a huge list). `lo` still keeps\n // topPad ≥ 0 near the very top. The block may now extend a few hundred px\n // past the nominal cap at the very end; we clamp `bottomPad` to ≥ 0 and let\n // the real content height absorb the remainder — negligible against\n // `scrollHeight`, and the offset stays reachable.\n const lo = aboveRows * rowHeight;\n const proportional = Math.round((firstVisibleRow / Math.max(1, maxFirstRow)) * maxScrollTop);\n const usedScrollTop = Math.max(lo, Math.min(maxScrollTop, proportional));\n const topPad = usedScrollTop - aboveRows * rowHeight;\n const bottomPad = Math.max(0, scrollHeight - topPad - blockHeight);\n return { start, end, topPad, bottomPad, scrollHeight, scrollTop: usedScrollTop };\n }\n\n // Mouse scroll: the browser's scrollTop is authoritative; map it onto the row\n // range and seat the block so the first visible row lands at the viewport top\n // (overscan above limited to the room the offset leaves, so topPad stays ≥ 0).\n const clamped = Math.min(Math.max(0, scrollTop), maxScrollTop);\n const firstVisibleRow = Math.round((clamped / maxScrollTop) * maxFirstRow);\n const aboveRows = Math.min(overscan, firstVisibleRow, Math.floor(clamped / rowHeight));\n const start = firstVisibleRow - aboveRows;\n const end = Math.min(total, firstVisibleRow + visibleCount + overscan);\n const blockHeight = (end - start) * rowHeight;\n const maxTop = Math.max(0, scrollHeight - blockHeight);\n let topPad = clamped - aboveRows * rowHeight;\n if (topPad < 0) topPad = 0;\n else if (topPad > maxTop) topPad = maxTop;\n const bottomPad = Math.max(0, scrollHeight - topPad - blockHeight);\n\n return { start, end, topPad, bottomPad, scrollHeight, scrollTop: clamped };\n}\n","/**\n * Hand-written ABI surface for the WASM option engine.\n *\n * `engine.wasm.ts` (the base64 blob) is generated by scripts/build-wasm.mjs;\n * this file is the stable, committed wrapper the rest of the codebase imports.\n * Keep `EngineExports` in sync with the exports of `engine.ts`.\n *\n * The blob is imported DYNAMICALLY inside instantiateEngine() rather than at\n * module top level: the engine only ever instantiates above the virtualization\n * threshold (200+ options), but a static import made every consumer of\n * md-select/md-autocomplete/md-multi-select/md-table-pagination ship the\n * ~11 kB base64 string (5.6 kB gz) eagerly. As a dynamic import the bundler\n * emits it as its own async chunk, fetched only if virtualization engages.\n */\n\n/** Filter modes accepted by `setQuery` (mirrors engine.ts). */\nexport const FILTER_SUBSTRING = 0;\nexport const FILTER_PREFIX = 1;\nexport const FILTER_FUZZY = 2;\n\n/** The functions exported by the compiled WASM engine. */\nexport interface EngineExports {\n memory: WebAssembly.Memory;\n reserve(\n rows: number,\n valueBytesTotal: number,\n labelBytesTotal: number,\n iconBytesTotal: number,\n supportBytesTotal: number,\n ): void;\n valueWritePtr(): number;\n labelWritePtr(): number;\n iconWritePtr(): number;\n supportWritePtr(): number;\n appendRow(\n valueLen: number,\n labelLen: number,\n iconLen: number,\n supportLen: number,\n flags: number,\n ): number;\n finalizeLoad(): void;\n queryPtr(): number;\n queryCapacity(): number;\n setQuery(queryLen: number, mode: number): number;\n totalCount(): number;\n filteredCount(): number;\n rowAt(filteredIndex: number): number;\n valuePtr(absIndex: number): number;\n valueLen(absIndex: number): number;\n labelPtr(absIndex: number): number;\n labelLen(absIndex: number): number;\n iconPtr(absIndex: number): number;\n iconLen(absIndex: number): number;\n supportPtr(absIndex: number): number;\n supportLen(absIndex: number): number;\n rowFlags(absIndex: number): number;\n indexOfValue(queryLen: number): number;\n findLabelPrefix(queryLen: number, fromFilteredIndex: number): number;\n reset(): void;\n}\n\nfunction decodeBase64(b64: string): Uint8Array {\n if (typeof atob === 'function') {\n const bin = atob(b64);\n const out = new Uint8Array(bin.length);\n for (let i = 0; i < bin.length; i++) out[i] = bin.charCodeAt(i);\n return out;\n }\n // Node without a global atob (older runtimes / spec env).\n return Uint8Array.from(Buffer.from(b64, 'base64'));\n}\n\n/**\n * Compiled once per process — the module bytes never change, and every\n * consumer gets its own isolated instance (fresh memory) below. Without this\n * cache each component instance re-decoded and recompiled the same module.\n */\nlet modulePromise: Promise<WebAssembly.Module> | undefined;\n\n/**\n * Lazily instantiate the engine. The compiled module is a few KB; consumers\n * load their (potentially millions of) rows into its memory at runtime.\n */\nexport async function instantiateEngine(): Promise<EngineExports> {\n modulePromise ??= import('./engine.wasm').then(({ WASM_BASE64 }) =>\n WebAssembly.compile(decodeBase64(WASM_BASE64)),\n );\n const module = await modulePromise;\n const imports = {\n env: {\n abort() {},\n trace() {},\n seed() {\n return Date.now();\n },\n },\n };\n const instance = await WebAssembly.instantiate(module, imports);\n return instance.exports as unknown as EngineExports;\n}\n","/**\n * `WasmOptionStore` — the single integration point both `md-select` and\n * `md-multi-select` use for virtualized, WASM-backed option data.\n *\n * It hides the engine ABI entirely (see `wasm/engine-abi.ts`): the dataset is\n * packed into WASM linear memory at `load()` time and JS keeps no copy, so a\n * select can hold millions of options while only ever decoding the ~visible\n * window back out per render. Filtering/typeahead run inside WASM.\n *\n * One instance per component → one `WebAssembly.Instance` → isolated memory.\n */\nimport {\n EngineExports,\n FILTER_SUBSTRING,\n instantiateEngine,\n} from '../wasm/engine-abi';\nimport { isRowSource, OptionRowSource, SelectOptionInit } from './select-options';\n\n/** A row read back out of the store for rendering. */\nexport interface VirtualRow {\n /** Absolute row index in the dataset (stable across filtering). */\n index: number;\n value: string;\n label: string;\n disabled: boolean;\n /** Material Symbols leading-icon glyph, or '' when the dataset has no icons. */\n icon: string;\n /** Secondary line under the label, or '' when the dataset has no supporting text. */\n supportingText: string;\n}\n\n/** Filter strategy, mapped to the engine's `setQuery` mode. */\nexport type FilterMode = 'substring' | 'prefix' | 'fuzzy';\n\nconst FILTER_MODE: Record<FilterMode, number> = {\n substring: 0,\n prefix: 1,\n fuzzy: 2,\n};\n\nconst DISABLED_FLAG = 1;\n\n/**\n * Time budget (ms) for one main-thread slice while packing. Bounding every\n * slice to roughly a frame keeps busy animations (the loading indicator)\n * fluid during multi-million-row loads — a fixed row-count chunk (formerly\n * 250k rows) blocked 100ms+ per chunk and dropped the spinner to ~7fps.\n */\nconst LOAD_SLICE_BUDGET_MS = 6;\n\n/** Rows between clock reads inside a slice (amortises performance.now()).\n * Small enough that one stride stays well inside the slice budget even with\n * an expensive consumer getRow (~1.4µs/row measured → ~3ms per stride). */\nconst LOAD_STRIDE = 2_048;\n\n/** Millisecond clock that also works in non-DOM (spec) environments. */\nconst nowMs: () => number =\n typeof performance !== 'undefined' && typeof performance.now === 'function'\n ? () => performance.now()\n : () => Date.now();\n\n/** Yield to the event loop so the browser can handle input mid-load. NB:\n * scheduler.yield() continuations PREEMPT rendering, so this alone does not\n * produce paints — see yieldForPaint(). */\nfunction yieldToMain(): Promise<void> {\n const scheduler = (globalThis as { scheduler?: { yield?: () => Promise<void> } }).scheduler;\n if (scheduler?.yield) return scheduler.yield();\n return new Promise((resolve) => setTimeout(resolve, 0));\n}\n\n/**\n * Work window between paint yields. Deliberately UNDER a 60Hz frame (16.7ms):\n * we resume ~1ms after a paint, so a 16ms window would finish just past the\n * next vsync and miss it (measured: alternating 17/33ms gaps → 25ms average).\n * 12ms of work + up to a stride of overshoot still lands the rAF request\n * before the deadline, giving a consistent ~16.7ms cadence.\n */\nconst PAINT_INTERVAL_MS = 12;\n\n/**\n * Yield in a way that guarantees the browser can PAINT when a frame is due —\n * scheduler.yield continuations outprioritise rendering, which froze the\n * loading animation to ~10fps during multi-million-row packs. When a frame is\n * due, await requestAnimationFrame (a real rendering opportunity); otherwise\n * take the cheap yield.\n */\nasync function yieldForPaint(lastPaint: { t: number }): Promise<void> {\n if (\n typeof requestAnimationFrame === 'function' &&\n nowMs() - lastPaint.t >= PAINT_INTERVAL_MS\n ) {\n // Resume AFTER the paint, not inside the rAF callback: resolving in rAF\n // would continue the pack as a microtask still inside the rendering-steps\n // task — the paint would then wait behind the next 16ms of work (measured\n // as ~33ms frame gaps). rAF marks the frame; the nested macrotask lands\n // once rendering has actually flushed.\n await new Promise<void>((resolve) => {\n requestAnimationFrame(() => setTimeout(resolve, 0));\n });\n lastPaint.t = nowMs();\n return;\n }\n await yieldToMain();\n}\n\n/** True when this runtime can host the engine (false in non-WASM SSR/test envs). */\nexport function isWasmSupported(): boolean {\n return typeof WebAssembly !== 'undefined' && typeof WebAssembly.instantiate === 'function';\n}\n\n/**\n * UTF-8 byte length of a string, matching `TextEncoder` semantics (lone\n * surrogates count as the 3-byte U+FFFD replacement). Allocation-free, so the\n * load sizing pass over millions of rows stays cheap.\n */\nexport function utf8ByteLength(str: string): number {\n let bytes = 0;\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n bytes += 1;\n } else if (c < 0x800) {\n bytes += 2;\n } else if (c >= 0xd800 && c <= 0xdbff) {\n const next = str.charCodeAt(i + 1);\n if (next >= 0xdc00 && next <= 0xdfff) {\n bytes += 4;\n i++;\n } else {\n bytes += 3; // lone high surrogate → U+FFFD\n }\n } else {\n bytes += 3; // BMP ≥ 0x800, or lone low surrogate → U+FFFD\n }\n }\n return bytes;\n}\n\nexport class WasmOptionStore {\n private engine?: EngineExports;\n private ready?: Promise<void>;\n private enc = new TextEncoder();\n private dec = new TextDecoder();\n private _length = 0;\n private _total = 0;\n private mode: number = FILTER_SUBSTRING;\n\n /** Lazily instantiate the engine (memoized). */\n ensureReady(): Promise<void> {\n if (!this.ready) {\n this.ready = isWasmSupported()\n ? instantiateEngine().then((e) => {\n this.engine = e;\n })\n : Promise.reject(new Error('WebAssembly is not available in this environment'));\n }\n return this.ready;\n }\n\n get ready$(): boolean {\n return !!this.engine;\n }\n\n /** Current filtered row count. */\n get length(): number {\n return this._length;\n }\n\n /** Total rows loaded (ignores the active filter). */\n get total(): number {\n return this._total;\n }\n\n setFilterMode(mode: FilterMode): void {\n this.mode = FILTER_MODE[mode] ?? FILTER_SUBSTRING;\n }\n\n private mem(): Uint8Array {\n // Re-derived on every read batch: a prior `memory.grow` detaches the old\n // ArrayBuffer, so a cached view would throw.\n return new Uint8Array(this.engine!.memory.buffer);\n }\n\n /**\n * Load a dataset into WASM memory. Accepts either a materialised array or a\n * row factory (`{ count, getRow }`) — the factory path never holds more than\n * one row in JS at a time, so it scales to tens of millions of options. Two\n * passes over the input: size, then encode each row's UTF-8 directly into the\n * engine's buffers. JS references to the rows are not retained.\n */\n async load(source: ReadonlyArray<SelectOptionInit> | OptionRowSource): Promise<void> {\n await this.ensureReady();\n const e = this.engine!;\n\n let count: number;\n let at: (i: number) => SelectOptionInit;\n if (isRowSource(source)) {\n count = source.count;\n at = source.getRow;\n } else {\n count = source.length;\n at = (i) => source[i];\n }\n\n const lastPaint = { t: nowMs() };\n\n // Pass 1 — size the columns. TIME-SLICED with yields so a\n // multi-million-row load never blocks the main thread longer than about a\n // frame: the browser paints (fluid loading animation) and handles input\n // between slices. Icon / supporting-text totals stay 0 when the dataset\n // uses neither, so the engine skips those columns entirely.\n let valueBytesTotal = 0;\n let labelBytesTotal = 0;\n let iconBytesTotal = 0;\n let supportBytesTotal = 0;\n for (let i = 0; i < count; ) {\n const sliceStart = nowMs();\n do {\n const end = Math.min(count, i + LOAD_STRIDE);\n for (; i < end; i++) {\n const r = at(i);\n valueBytesTotal += utf8ByteLength(r.value);\n labelBytesTotal += utf8ByteLength(r.label ?? r.value);\n if (r.icon) iconBytesTotal += utf8ByteLength(r.icon);\n if (r.supportingText) supportBytesTotal += utf8ByteLength(r.supportingText);\n }\n } while (i < count && nowMs() - sliceStart < LOAD_SLICE_BUDGET_MS);\n if (i < count) await yieldForPaint(lastPaint);\n }\n\n e.reserve(count, valueBytesTotal, labelBytesTotal, iconBytesTotal, supportBytesTotal);\n\n // Pass 2 — encode each row's UTF-8 straight into the engine buffers, also\n // time-sliced + yielding. The memory view is re-derived per slice: appendRow\n // never grows memory, but a yield could let other work run in between. Read\n // all four write pointers before appendRow — it advances every cursor.\n for (let i = 0; i < count; ) {\n const sliceStart = nowMs();\n const mem = this.mem();\n do {\n const end = Math.min(count, i + LOAD_STRIDE);\n for (; i < end; i++) {\n const r = at(i);\n const vp = e.valueWritePtr();\n const v = this.enc.encodeInto(r.value, mem.subarray(vp));\n const lp = e.labelWritePtr();\n const l = this.enc.encodeInto(r.label ?? r.value, mem.subarray(lp));\n const ip = e.iconWritePtr();\n const ic =\n iconBytesTotal > 0 ? this.enc.encodeInto(r.icon ?? '', mem.subarray(ip)) : null;\n const sp = e.supportWritePtr();\n const sc =\n supportBytesTotal > 0\n ? this.enc.encodeInto(r.supportingText ?? '', mem.subarray(sp))\n : null;\n e.appendRow(\n v.written ?? 0,\n l.written ?? 0,\n ic?.written ?? 0,\n sc?.written ?? 0,\n r.disabled ? DISABLED_FLAG : 0,\n );\n }\n } while (i < count && nowMs() - sliceStart < LOAD_SLICE_BUDGET_MS);\n if (i < count) await yieldForPaint(lastPaint);\n }\n\n e.finalizeLoad(); // allocates the value index — may grow memory\n\n this._total = e.totalCount();\n this._length = e.filteredCount();\n }\n\n /** Write a string into the engine's scratch buffer; returns bytes written. */\n private writeScratch(s: string): number {\n const e = this.engine!;\n const cap = e.queryCapacity();\n const ptr = e.queryPtr();\n const { written } = this.enc.encodeInto(s, this.mem().subarray(ptr, ptr + cap));\n return written ?? 0;\n }\n\n /** Apply a filter query. Returns the new filtered length. */\n setQuery(query: string): number {\n if (!this.engine) return 0;\n const len = this.writeScratch(query);\n this._length = this.engine.setQuery(len, this.mode);\n return this._length;\n }\n\n private decodeRow(absIndex: number, mem: Uint8Array): VirtualRow {\n const e = this.engine!;\n const vp = e.valuePtr(absIndex);\n const vl = e.valueLen(absIndex);\n const lp = e.labelPtr(absIndex);\n const ll = e.labelLen(absIndex);\n // Icon / supporting-text columns return 0-length ranges when the dataset\n // didn't supply them, so these decode to '' at no extra packing cost.\n const ip = e.iconPtr(absIndex);\n const il = e.iconLen(absIndex);\n const sp = e.supportPtr(absIndex);\n const sl = e.supportLen(absIndex);\n return {\n index: absIndex,\n value: this.dec.decode(mem.subarray(vp, vp + vl)),\n label: this.dec.decode(mem.subarray(lp, lp + ll)),\n disabled: (e.rowFlags(absIndex) & DISABLED_FLAG) !== 0,\n icon: il > 0 ? this.dec.decode(mem.subarray(ip, ip + il)) : '',\n supportingText: sl > 0 ? this.dec.decode(mem.subarray(sp, sp + sl)) : '',\n };\n }\n\n /** Decode `count` rows starting at filtered position `start`. */\n getWindow(start: number, count: number): VirtualRow[] {\n if (!this.engine) return [];\n const e = this.engine;\n const mem = this.mem();\n const out: VirtualRow[] = [];\n const from = Math.max(0, start);\n const to = Math.min(this._length, start + count);\n for (let fi = from; fi < to; fi++) {\n const abs = e.rowAt(fi);\n if (abs >= 0) out.push(this.decodeRow(abs, mem));\n }\n return out;\n }\n\n /** Decode a single row at filtered position `filteredIndex`, or null. */\n getRow(filteredIndex: number): VirtualRow | null {\n if (!this.engine) return null;\n const abs = this.engine.rowAt(filteredIndex);\n if (abs < 0) return null;\n return this.decodeRow(abs, this.mem());\n }\n\n /** Map a filtered position to its absolute row index, or -1. */\n rowAt(filteredIndex: number): number {\n return this.engine ? this.engine.rowAt(filteredIndex) : -1;\n }\n\n /** Disabled flag for a filtered position — flag-only, no string decode. */\n disabledAt(filteredIndex: number): boolean {\n if (!this.engine) return false;\n const abs = this.engine.rowAt(filteredIndex);\n if (abs < 0) return false;\n return (this.engine.rowFlags(abs) & DISABLED_FLAG) !== 0;\n }\n\n /** Label for a filtered position — decodes a single label. */\n labelAt(filteredIndex: number): string {\n if (!this.engine) return '';\n const abs = this.engine.rowAt(filteredIndex);\n if (abs < 0) return '';\n const lp = this.engine.labelPtr(abs);\n const ll = this.engine.labelLen(abs);\n return this.dec.decode(this.mem().subarray(lp, lp + ll));\n }\n\n /**\n * Resolve labels for selected values that may be outside the current filter\n * (e.g. the trigger text / chips). O(1) per value via the engine's index.\n */\n getLabels(values: ReadonlyArray<string>): Map<string, string> {\n const result = new Map<string, string>();\n if (!this.engine) return result;\n const e = this.engine;\n for (const value of values) {\n const len = this.writeScratch(value);\n const abs = e.indexOfValue(len);\n if (abs >= 0) {\n const lp = e.labelPtr(abs);\n const ll = e.labelLen(abs);\n result.set(value, this.dec.decode(this.mem().subarray(lp, lp + ll)));\n }\n }\n return result;\n }\n\n /** Whether a value exists in the dataset. */\n has(value: string): boolean {\n if (!this.engine) return false;\n return this.engine.indexOfValue(this.writeScratch(value)) >= 0;\n }\n\n /**\n * Typeahead helper: first filtered position at/after `fromFilteredIndex`\n * whose label starts with `query` (wraps the filtered list). Returns a\n * filtered-list index, or -1.\n */\n findLabelPrefix(query: string, fromFilteredIndex: number): number {\n if (!this.engine) return -1;\n const len = this.writeScratch(query);\n return this.engine.findLabelPrefix(len, fromFilteredIndex);\n }\n\n /** Drop the dataset. */\n reset(): void {\n this.engine?.reset();\n this._length = 0;\n this._total = 0;\n }\n}\n","/**\n * `VirtualSelectController` — the shared virtualization engine for `md-select`\n * and `md-multi-select`, so neither component duplicates the window math,\n * scroll wiring, or the `VirtualMenuProvider` glue.\n *\n * It owns a `WasmOptionStore` (the dataset, packed in WASM memory) and the\n * current scroll window. The host component supplies a tiny adapter\n * (`queryItem` + `requestRender`) and reads the controller's public window\n * fields from its `render()`.\n */\nimport { computeWindow, DEFAULT_MAX_SCROLL_HEIGHT } from './virtual-window';\n\n/** Floor under which a measured scrollHeight cannot be a genuine browser\n * element-height clamp (real clamps are millions of px — Chrome ~33.5M,\n * Firefox ~17.8M) — it just means layout wasn't ready (see detectScrollCap). */\nconst MIN_PLAUSIBLE_SCROLL_CAP = 1_000_000;\nimport {\n FilterMode,\n isWasmSupported,\n VirtualRow,\n WasmOptionStore,\n} from './wasm-option-store';\nimport { isRowSource, OptionRowSource, SelectOptionInit } from './select-options';\nimport { VirtualMenuProvider } from './types';\n\n// Larger overscan than a typical virtual list: in the scaled regime a single\n// scroll frame can advance many rows, and render is async, so extra buffered\n// rows above/below the fold keep the body from flashing blank on fast scrolls.\nconst OVERSCAN = 8;\nconst DEFAULT_ROW_HEIGHT = 48;\nconst DEFAULT_VIEWPORT_HEIGHT = 320;\n// Extra px to keep a keyboard-revealed row clear of the viewport's top/bottom\n// edge. Historically 32px to clear md-scroll-shadow's edge fade; the scroll\n// shadow was removed, so a revealed row can sit flush against the edge (0). Kept\n// as a named knob in case a future edge treatment needs slack again.\nconst EDGE_SCRIM_PAD = 0;\n\nexport interface VirtualSelectHost {\n /** The rendered `md-menu-item` for a filtered index, from the host's shadow DOM. */\n queryItem(filteredIndex: number): HTMLElement | null;\n /** Re-render the host (it reads the controller's window fields). */\n requestRender(): void;\n}\n\nexport class VirtualSelectController {\n readonly store = new WasmOptionStore();\n\n /** True once a dataset is loaded and the component should render windowed. */\n active = false;\n /** First filtered index currently rendered. */\n windowStart = 0;\n /** The decoded rows in the current window. */\n windowRows: VirtualRow[] = [];\n /** Spacer heights (px) that preserve the full scroll height. */\n topPad = 0;\n bottomPad = 0;\n /** Current filtered row count. */\n filteredLength = 0;\n /** Effective fixed row height (measured or overridden). */\n rowHeight = DEFAULT_ROW_HEIGHT;\n\n private fixedRowHeight?: number;\n private viewportEl?: HTMLElement;\n private scrollRaf = 0;\n\n /**\n * The browser's observed maximum element height. Browsers clamp very tall\n * elements (a few-million-row list × row height blows past the ~16–33M px\n * cap), so the spacers can't reproduce the true height. We start optimistic\n * and shrink to the real clamp once we can measure it (see `detectScrollCap`).\n */\n private browserMaxScroll = Infinity;\n /** The scrollable height the last `recompute` asked the spacers to produce. */\n private intendedScrollHeight = 0;\n private detectRaf = 0;\n /** Retries left for detectScrollCap while layout isn't ready (see below). */\n private detectRetries = 0;\n\n /**\n * Scaled-regime keyboard nav: the first row to render, pinned independent of\n * the (too-coarse) integer scrollTop. -1 means the window is scroll-driven.\n */\n private navAnchorFirstRow = -1;\n /** The scroll offset the last `recompute` laid the window out for. */\n private usedScrollTop = 0;\n\n constructor(private host: VirtualSelectHost) {}\n\n /** Ceiling on the spacer height: our safe default, lowered by any real clamp. */\n private effectiveMaxScroll(): number {\n return Math.min(DEFAULT_MAX_SCROLL_HEIGHT, this.browserMaxScroll);\n }\n\n setFixedRowHeight(px?: number): void {\n this.fixedRowHeight = px && px > 0 ? px : undefined;\n if (this.fixedRowHeight) this.rowHeight = this.fixedRowHeight;\n }\n\n setFilterMode(mode: FilterMode): void {\n this.store.setFilterMode(mode);\n }\n\n /** Load a dataset into WASM memory. Returns false if WASM is unavailable. */\n async load(source: ReadonlyArray<SelectOptionInit> | OptionRowSource): Promise<boolean> {\n const count = isRowSource(source) ? source.count : source.length;\n if (!isWasmSupported() || count === 0) return false;\n try {\n await this.store.ensureReady();\n } catch {\n return false;\n }\n await this.store.load(source);\n this.active = true;\n this.filteredLength = this.store.length;\n this.recompute(this.viewportEl?.scrollTop ?? 0);\n return true;\n }\n\n /** Apply a filter query and reset the scroll to the top. */\n setQuery(query: string): void {\n if (!this.active) return;\n this.filteredLength = this.store.setQuery(query);\n this.navAnchorFirstRow = -1;\n if (this.viewportEl) this.viewportEl.scrollTop = 0;\n this.recompute(0);\n }\n\n getLabels(values: ReadonlyArray<string>): Map<string, string> {\n return this.store.getLabels(values);\n }\n\n reset(): void {\n this.store.reset();\n this.active = false;\n this.windowRows = [];\n this.filteredLength = 0;\n this.windowStart = 0;\n this.topPad = 0;\n this.bottomPad = 0;\n this.navAnchorFirstRow = -1;\n }\n\n // ── Viewport wiring (call when the menu opens / closes) ──────\n\n async attachViewport(getViewport: () => Promise<HTMLElement | null>): Promise<void> {\n this.detachViewport();\n const vp = await getViewport();\n this.viewportEl = vp ?? undefined;\n if (this.viewportEl) {\n this.viewportEl.addEventListener('scroll', this.onScroll, { passive: true });\n this.measureRowHeight();\n this.recompute(this.viewportEl.scrollTop);\n this.detectRetries = 60; // ~2s of rAF pairs — spacers may render late\n this.detectScrollCap();\n }\n }\n\n detachViewport(): void {\n if (this.scrollRaf) {\n cancelAnimationFrame(this.scrollRaf);\n this.scrollRaf = 0;\n }\n if (this.detectRaf) {\n cancelAnimationFrame(this.detectRaf);\n this.detectRaf = 0;\n }\n this.viewportEl?.removeEventListener('scroll', this.onScroll);\n this.viewportEl = undefined;\n }\n\n private onScroll = () => {\n if (this.scrollRaf) return;\n this.scrollRaf = requestAnimationFrame(() => {\n this.scrollRaf = 0;\n const vp = this.viewportEl;\n if (!vp) return;\n // Tell our own programmatic scroll (driving an anchored keyboard-nav\n // window) from a genuine user scroll by value: if the offset still matches\n // what the current window was laid out for, keep the anchor; otherwise the\n // user scrolled, so resume scroll-driven windowing. (A value check is\n // robust to event coalescing/ordering, unlike a one-shot flag.)\n if (this.navAnchorFirstRow >= 0 && Math.abs(vp.scrollTop - this.usedScrollTop) <= 1) {\n return;\n }\n this.navAnchorFirstRow = -1;\n this.recompute(vp.scrollTop);\n });\n };\n\n private measureRowHeight(): void {\n if (this.fixedRowHeight) {\n this.rowHeight = this.fixedRowHeight;\n return;\n }\n const first = this.host.queryItem(this.windowStart);\n const h = first?.offsetHeight ?? 0;\n if (h > 0 && h !== this.rowHeight) {\n this.rowHeight = h;\n if (this.viewportEl) this.recompute(this.viewportEl.scrollTop);\n }\n }\n\n private recompute(scrollTop: number): void {\n const vpH = this.viewportEl?.clientHeight || DEFAULT_VIEWPORT_HEIGHT;\n const calc = computeWindow(\n scrollTop,\n vpH,\n this.rowHeight,\n this.filteredLength,\n OVERSCAN,\n this.effectiveMaxScroll(),\n this.navAnchorFirstRow,\n );\n this.windowStart = calc.start;\n this.topPad = calc.topPad;\n this.bottomPad = calc.bottomPad;\n this.intendedScrollHeight = calc.scrollHeight;\n this.usedScrollTop = calc.scrollTop;\n this.windowRows = this.store.getWindow(calc.start, calc.end - calc.start);\n this.host.requestRender();\n }\n\n /**\n * Detect the browser's real maximum element height. After the spacers lay\n * out, if the viewport's `scrollHeight` came back shorter than we asked for,\n * the browser clamped it — and that clamp *is* the true maximum, so adopt it\n * and re-window against it. Runs a couple of frames after attach so the\n * (async) spacer render has committed; idempotent and only ever shrinks.\n */\n private detectScrollCap(): void {\n if (this.detectRaf) cancelAnimationFrame(this.detectRaf);\n this.detectRaf = requestAnimationFrame(() => {\n this.detectRaf = requestAnimationFrame(() => {\n this.detectRaf = 0;\n const vp = this.viewportEl;\n if (!vp) return;\n const measured = vp.scrollHeight;\n if (\n measured > 0 &&\n measured + 2 < this.intendedScrollHeight &&\n measured < this.browserMaxScroll\n ) {\n // A small reading is NOT a browser clamp — the spacers simply have\n // not been laid out yet (e.g. the menu opened during a dataset pack\n // and still showed the uncapped busy bar when we measured). Locking\n // it in would permanently collapse the scroll geometry (the cap\n // never grows back), so retry instead.\n if (measured < MIN_PLAUSIBLE_SCROLL_CAP) {\n if (this.detectRetries-- > 0) this.detectScrollCap();\n return;\n }\n this.browserMaxScroll = measured;\n this.recompute(vp.scrollTop);\n }\n });\n });\n }\n\n // ── VirtualMenuProvider (md-menu drives nav through this) ────\n\n readonly provider: VirtualMenuProvider = {\n count: () => this.filteredLength,\n labelAt: (i) => this.store.labelAt(i),\n isDisabledAt: (i) => this.store.disabledAt(i),\n ensureVisible: (i) => this.ensureVisible(i),\n domItemForIndex: (i) => this.host.queryItem(i),\n findPrefix: (buffer, from) => this.store.findLabelPrefix(buffer, from),\n };\n\n private async ensureVisible(filteredIndex: number): Promise<void> {\n const vp = this.viewportEl;\n if (!vp) return;\n const clientH = vp.clientHeight || DEFAULT_VIEWPORT_HEIGHT;\n const realHeight = this.filteredLength * this.rowHeight;\n\n if (realHeight <= this.effectiveMaxScroll()) {\n // Exact regime: pixel offset is the row index times the row height.\n this.navAnchorFirstRow = -1;\n const top = filteredIndex * this.rowHeight;\n const bottom = top + this.rowHeight;\n // Reveal with EDGE_SCRIM_PAD of slack so the row clears the edge fade.\n // Clamped to [0, maxScroll]: rows at the very top/bottom — where no scrim\n // shows — still seat flush.\n const maxScroll = Math.max(0, vp.scrollHeight - clientH);\n if (top - EDGE_SCRIM_PAD < vp.scrollTop) {\n vp.scrollTop = Math.max(0, top - EDGE_SCRIM_PAD);\n } else if (bottom + EDGE_SCRIM_PAD > vp.scrollTop + clientH) {\n vp.scrollTop = Math.min(maxScroll, bottom + EDGE_SCRIM_PAD - clientH);\n }\n this.recompute(vp.scrollTop);\n } else {\n // Scaled regime: integer scrollTop can't address single rows (millions of\n // rows compressed into a capped height — one pixel can be dozens of rows).\n // When the target row isn't already on screen, pin the window to an anchor\n // and let `computeWindow` choose the matching scroll offset, then apply it.\n const visibleRows = Math.max(1, Math.floor(clientH / this.rowHeight));\n const visibleCount = Math.ceil(clientH / this.rowHeight);\n const maxFirstRow = Math.max(0, this.filteredLength - visibleCount);\n // First visible row: take it exactly from the anchor when the window is\n // anchor-driven (deriving it from a fractional scrollTop drifts by a row);\n // fall back to the live geometry only when scroll-driven.\n const firstVisible =\n this.navAnchorFirstRow >= 0\n ? this.navAnchorFirstRow\n : this.windowStart +\n Math.max(0, Math.round((vp.scrollTop - this.topPad) / this.rowHeight));\n const lastVisible = firstVisible + visibleRows - 1;\n\n // Re-anchor when the focused row is outside the visible range OR within\n // `padRows` of either edge. The edge check matters even when the row is\n // already visible: navigating up one row at a time makes the focused row\n // the *first* visible row (flush against the top), which is never \"outside\"\n // the range — so without it the top scroll-shadow scrim would still cover\n // the focused row. Mirrors the exact-regime branch above.\n const padRows = Math.ceil(EDGE_SCRIM_PAD / this.rowHeight);\n if (\n filteredIndex < firstVisible + padRows ||\n filteredIndex > lastVisible - padRows\n ) {\n // Reveal `padRows` clear of the top (scrolling up) or bottom (scrolling\n // down) edge, clamped to [0, maxFirstRow] so the list ends — where no\n // scrim shows — still seat the row flush.\n this.navAnchorFirstRow = Math.min(\n maxFirstRow,\n Math.max(\n 0,\n filteredIndex < firstVisible + padRows\n ? filteredIndex - padRows\n : filteredIndex - visibleRows + 1 + padRows,\n ),\n );\n }\n this.recompute(vp.scrollTop);\n // Sync the browser scroll to the offset the (anchored) window was laid out\n // for. Clamp to the viewport's real max — the capped element can render a\n // hair shorter than we asked (scroll-shadow sentinels), and overshooting by\n // even a pixel near the end gets clamped by the browser — then adopt\n // whatever it actually applied, so the scroll guard and the next \"first\n // visible\" never drift out of sync and clear the anchor.\n if (this.navAnchorFirstRow >= 0) {\n const maxScroll = Math.max(0, vp.scrollHeight - clientH);\n const target = Math.min(Math.round(this.usedScrollTop), maxScroll);\n if (target !== Math.round(vp.scrollTop)) {\n vp.scrollTop = target;\n }\n this.usedScrollTop = vp.scrollTop;\n }\n }\n // Wait for the host to render the target row into the window so the menu\n // can move real focus onto it.\n for (let tries = 0; tries < 8; tries++) {\n await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));\n if (this.host.queryItem(filteredIndex)) return;\n }\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;AAaG;AA8CH,SAAS,WAAW,CAAC,EAAkB,EAAA;IACrC,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,EAAE;IACnF,OAAO;AACL,QAAA,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE;QACjD,KAAK;QACL,QAAQ,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC;AACpD,QAAA,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,SAAS;AACrD,QAAA,SAAS,EAAE,EAAE,CAAC,SAAS,IAAI,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,SAAS;AACrE,QAAA,cAAc,EACZ,EAAE,CAAC,cAAc,IAAI,EAAE,CAAC,YAAY,CAAC,iBAAiB,CAAC,IAAI,SAAS;QACtE,QAAQ,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC;KACrD;AACH;AAEA,SAAS,QAAQ,CAAC,CAAmB,EAAA;IACnC,OAAO;QACL,KAAK,EAAE,CAAC,CAAC,KAAK;AACd,QAAA,KAAK,EAAE,CAAC,C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ACX,IAAI,CAAC,GAAG,CACN,CAAC,EACD,aAAa,GAAG,YAAY,GAAG;sBAC3B,aAAa,GAAG;sBAChB,aAAa,GAAG,WAAW,GAAG,CAAC,GAAG,OAAO,CAC9C,CACF;;AAEH,YAAA,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC;;;;;;;AAO5B,YAAA,IAAI,IAAI,CAAC,iBAAiB,IAAI,CAAC,EAAE;AAC/B,gBAAA,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,GAAG,OAAO,CAAC;AACxD,gBAAA,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC;gBAClE,IAAI,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE;AACvC,oBAAA,EAAE,CAAC,SAAS,GAAG,MAAM;;AAEvB,gBAAA,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC,SAAS;;;;;AAKrC,QAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE;AACtC,YAAA,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,KAAK,qBAAqB,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;AAC5E,YAAA,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;gBAAE;;;AAG7C;;;;"}
@@ -0,0 +1,2 @@
1
+ import{q as t,u as n}from"./p-CVFH1DkU.js";const i=.22;const s=260;const e=4;function r(t,n,i){const s=t.length;if(!s)return Infinity;const e=t[0];const r=t[s-1];if(n<=e[0])return Math.hypot(e[0]-n,e[1]-i);if(n>=r[0])return Math.hypot(r[0]-n,r[1]-i);let o=0;let c=s-1;while(c-o>1){const i=o+c>>1;if(t[i][0]<=n)o=i;else c=i}const[f,u]=t[o];const[l,a]=t[c];const h=l===f?0:(n-f)/(l-f);return Math.abs(u+(a-u)*h-i)}function o(t,n,i=e){let s=-1;let r=Infinity;let o=Infinity;for(const i of t){if(i.seriesIndex===n)o=i.distance;if(i.distance<r){r=i.distance;s=i.seriesIndex}}if(n>=0&&r>o-i)return n;return s}const c=140;class f{constructor(t=e,n=c){this.stick=t;this.dwellMs=n;this.held=-1;this.candidate=-1;this.since=0}pick(t,n){const i=o(t,this.held,this.stick);if(i!==this.candidate){this.candidate=i;this.since=n}if(this.held<0){this.held=i}else if(i!==this.held&&n-this.since>=this.dwellMs){this.held=i}return this.held}reset(){this.held=-1;this.candidate=-1;this.since=0}}function u(n,s,e){if(s<0||e<=0)return n;const r=1-(1-i)*Math.min(1,e);const o=t=>t!=null&&t!==s;return{...n,lines:n.lines.map((n=>o(n.seriesIndex)?{...n,color:t(n.color,r)}:n)),areas:n.areas.map((n=>o(n.seriesIndex)?{...n,colorTop:t(n.colorTop,r),colorBottom:t(n.colorBottom,r)}:n)),markers:n.markers.map((n=>o(n.seriesIndex)?{...n,color:t(n.color,r)}:n))}}const l=26;const a=8;function h(t,n){if(!t.length)return-1;let i=0;let s=Infinity;for(let e=0;e<t.length;e++){const r=Math.abs(t[e]-n);if(r<s){s=r;i=e}}return i}function d(t){const i=!!t.inverted;return t.hoverPoints.map((t=>n(Object.keys(t.byIndex).map((n=>{const s=t.byIndex[Number(n)];return i?[s.y,s.x]:[s.x,s.y]})))))}function I(t,n){return t.hoverPoints.map((t=>({seriesIndex:t.seriesIndex,label:t.label,value:t.byIndex[n]?.value??null})))}function x(t,n,i){return n>=t.x&&n<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function M(t,n){const i=t.length;if(!i)return null;const s=i>1&&t[0].x>t[i-1].x?[...t].reverse():t;if(n<s[0].x||n>s[i-1].x)return null;if(i===1)return s[0].y;let e=0;let r=i-1;while(r-e>1){const t=e+r>>1;if(s[t].x<=n)e=t;else r=t}const o=s[e];const c=s[r];return c.x===o.x?o.y:o.y+(c.y-o.y)*(n-o.x)/(c.x-o.x)}function y(t,n,i){const s=M(t.points,n);if(s==null)return false;const e=(t.basePoints?M(t.basePoints,n):null)??t.baselineY;return i>=Math.min(s,e)&&i<=Math.max(s,e)}function k(t,n,i){if(!x(t.plot,n,i))return-1;let s=-1;let e=Infinity;for(const r of t.areas){if(r.seriesIndex==null||!y(r,n,i))continue;const t=M(r.points,n);const o=t==null?Infinity:Math.abs(i-t);if(o<e){e=o;s=r.seriesIndex}}return s}function m(t,n,i,s=d(t)){const e=!!t.inverted;const o=e?i:n;const c=e?n:i;const f=h(t.xPositions,o);if(f<0)return null;let u=-1;let I=Infinity;for(const s of t.hoverPoints){const t=s.byIndex[f];if(!t)continue;const e=Math.hypot(t.x-n,t.y-i);if(e<I){I=e;u=s.seriesIndex}}if(u>=0&&I<=l)return{kind:"mark",seriesIndex:u,dataIndex:f};if(!x(t.plot,n,i))return null;let k=-1;let m=Infinity;t.hoverPoints.forEach(((t,n)=>{const i=r(s[n]??[],o,c);if(i<m){m=i;k=t.seriesIndex}}));if(k>=0&&m<=a)return{kind:"line",seriesIndex:k,dataIndex:f};let p=-1;let b=Infinity;for(const s of t.areas){if(s.seriesIndex==null||!y(s,n,i))continue;const t=Math.abs(i-M(s.points,n));if(t<b){b=t;p=s.seriesIndex}}if(p>=0)return{kind:"area",seriesIndex:p,dataIndex:f};return{kind:"axis",dataIndex:f}}export{s as E,f as H,I as a,k as b,r as d,u as e,m as h,h as n,d as s};
2
+ //# sourceMappingURL=p-CGqeEMjY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"p-DzPKu-Ma.js","sources":["src/utils/charts/engine/emphasis.ts","src/utils/charts/engine/hit-test.ts"],"sourcesContent":["/*\n * Chart engine — hover emphasis\n * ===========================================================\n * When the pointer is near one series, that series stays vivid and\n * the others fade back so the focused line reads clearly. A pure\n * scene→scene transform (like animate.ts) so both renderer backends\n * dim identically; the engine animates the `t` factor over a short\n * MD3 transition and redraws emphasizeScene(scene, focus, t).\n * ===========================================================\n */\n\nimport { withAlpha } from './color';\nimport type { RenderScene } from './scene';\n\n/** How faded a non-focused series gets at full emphasis (alpha multiplier). */\nconst DIM = 0.22;\n/** Emphasis fade duration in ms. */\nexport const EMPHASIS_MS = 260;\n\n/**\n * How much nearer (px) a rival series must be before the emphasis leaves the\n * series it is on. Sized just under a typical \"close lines\" gap: enough of a\n * deadband to stop the two trading focus at their midpoint, small enough that\n * moving onto the other line still takes the focus with it.\n */\nexport const FOCUS_STICK = 4;\n\n/**\n * How far the cursor is (px) from a series' drawn line.\n *\n * `points` are that series' samples as `[main, value]` pixel pairs ordered\n * along the main axis (x for a normal chart, y for an inverted one). The line\n * is interpolated between the two samples bracketing the cursor, which is what\n * makes this work for series sampled at *different* x: with irregular data a\n * series usually has no sample exactly at the hovered position, and comparing\n * only exact samples hands the emphasis to whichever series happens to own\n * that slot. Past either end of the series the distance is measured to its\n * endpoint, so a line that has already finished reads as far away.\n */\nexport function distanceToLine(\n points: readonly (readonly [number, number])[],\n cursorMain: number,\n cursorValue: number,\n): number {\n const n = points.length;\n if (!n) return Infinity;\n const first = points[0];\n const last = points[n - 1];\n if (cursorMain <= first[0]) return Math.hypot(first[0] - cursorMain, first[1] - cursorValue);\n if (cursorMain >= last[0]) return Math.hypot(last[0] - cursorMain, last[1] - cursorValue);\n let lo = 0;\n let hi = n - 1;\n while (hi - lo > 1) {\n const mid = (lo + hi) >> 1;\n if (points[mid][0] <= cursorMain) lo = mid;\n else hi = mid;\n }\n const [aMain, aValue] = points[lo];\n const [bMain, bValue] = points[hi];\n const t = bMain === aMain ? 0 : (cursorMain - aMain) / (bMain - aMain);\n return Math.abs(aValue + (bValue - aValue) * t - cursorValue);\n}\n\n/**\n * Which series the hover should emphasise, given each candidate's distance to\n * the cursor and the one currently held (`-1` for none).\n *\n * Plain \"nearest wins\" flickers: between two lines a few pixels apart the\n * winner flips on every pointer move, and because the emphasis is already\n * fully faded in, each flip swaps vivid and dimmed instantly. Holding the\n * current series until a rival is clearly nearer turns the midpoint into a\n * deadband. A held series that isn't a candidate any more (it was hidden, or\n * the pointer left the plot) has no distance, so the focus moves on.\n */\nexport function pickFocusSeries(\n candidates: readonly { seriesIndex: number; distance: number }[],\n held: number,\n stick: number = FOCUS_STICK,\n): number {\n let best = -1;\n let bestD = Infinity;\n let heldD = Infinity;\n for (const c of candidates) {\n if (c.seriesIndex === held) heldD = c.distance;\n if (c.distance < bestD) {\n bestD = c.distance;\n best = c.seriesIndex;\n }\n }\n if (held >= 0 && bestD > heldD - stick) return held;\n return best;\n}\n\n/**\n * How long (ms) a rival has to stay the nearest before the emphasis moves to\n * it. The px deadband alone can't settle two lines running close together: a\n * hand held roughly still while the lines wander across the cursor makes the\n * nearest genuinely alternate, by the full gap each time. Requiring the rival\n * to *stay* nearest ignores that alternation while still following a\n * deliberate move onto the other line within a frame or three.\n */\nexport const FOCUS_DWELL_MS = 140;\n\n/**\n * Chooses the emphasised series over time: {@link pickFocusSeries} for the\n * geometry, plus a dwell so a contested choice has to settle before it moves.\n *\n * Owns the held series, so the engine just feeds it distances and a clock.\n */\nexport class HoverFocus {\n private held = -1;\n private candidate = -1;\n private since = 0;\n\n constructor(\n private readonly stick: number = FOCUS_STICK,\n private readonly dwellMs: number = FOCUS_DWELL_MS,\n ) {}\n\n /** The series to emphasise now, given each one's distance to the cursor. */\n pick(candidates: readonly { seriesIndex: number; distance: number }[], now: number): number {\n const wanted = pickFocusSeries(candidates, this.held, this.stick);\n if (wanted !== this.candidate) {\n this.candidate = wanted;\n this.since = now;\n }\n // Nothing focused yet (first hover, or after the pointer left): adopt\n // immediately, so arriving on a line reads as instant.\n if (this.held < 0) {\n this.held = wanted;\n } else if (wanted !== this.held && now - this.since >= this.dwellMs) {\n this.held = wanted;\n }\n return this.held;\n }\n\n /** Pointer left the plot, or the scene changed — drop the held series. */\n reset(): void {\n this.held = -1;\n this.candidate = -1;\n this.since = 0;\n }\n}\n\n/**\n * The scene with every series except `focusIndex` dimmed by progress `t`\n * (0 = no dimming, 1 = fully faded). Glyph markers and chrome are untouched.\n * Series without an index are treated as focused (never dimmed).\n */\nexport function emphasizeScene(scene: RenderScene, focusIndex: number, t: number): RenderScene {\n if (focusIndex < 0 || t <= 0) return scene;\n const factor = 1 - (1 - DIM) * Math.min(1, t);\n const dim = (si: number | undefined): boolean => si != null && si !== focusIndex;\n return {\n ...scene,\n lines: scene.lines.map((l) => (dim(l.seriesIndex) ? { ...l, color: withAlpha(l.color, factor) } : l)),\n areas: scene.areas.map((a) =>\n dim(a.seriesIndex) ? { ...a, colorTop: withAlpha(a.colorTop, factor), colorBottom: withAlpha(a.colorBottom, factor) } : a,\n ),\n markers: scene.markers.map((m) => (dim(m.seriesIndex) ? { ...m, color: withAlpha(m.color, factor) } : m)),\n };\n}\n","/*\n * Chart engine — click hit-testing\n * ===========================================================\n * Turns a pointer position over a rendered scene into the most\n * specific thing under it: a data mark, a series line, a filled\n * area, or the plot background (an \"axis\" click). Pure functions\n * over the RenderScene, so the precedence rule is unit-testable\n * without a canvas — the engine only maps the result onto its\n * callbacks.\n * ===========================================================\n */\n\nimport { distanceToLine } from './emphasis';\nimport type { Pt } from './geometry';\nimport { ascending } from './rtl';\nimport type { RenderScene, Rect, SceneArea } from './scene';\n\n/**\n * Max cursor→point distance (px) for a click to count as a mark click.\n * Deliberately generous: a mark is the thing consumers most want to catch, and\n * at this radius a click anywhere in a fingertip-sized region around the point\n * still lands on it.\n */\nexport const MARK_HIT_RADIUS = 26;\n\n/**\n * Max cursor→line distance (px) for a click to count as a line click.\n *\n * The stroke is 2.5px wide (±1.25px from the centreline), so this leaves ~6.75px\n * of pointer slop on either side — comfortable for an imprecise mouse without\n * reaching so far into the fill below that \"clicked the area just under the\n * line\" gets stolen by the line. It also absorbs the small error in\n * {@link distanceToLine}, which measures against the straight segment between\n * two samples while a `smooth` curve bows a little away from it.\n */\nexport const LINE_HIT_TOLERANCE = 8;\n\n/** What sits under the pointer, most specific first. */\nexport type SceneHit =\n | { kind: 'mark'; seriesIndex: number; dataIndex: number }\n | { kind: 'line'; seriesIndex: number; dataIndex: number }\n | { kind: 'area'; seriesIndex: number; dataIndex: number }\n | { kind: 'axis'; dataIndex: number }\n | null;\n\n/** One visible series' value at an x index — the rows the tooltip lists. */\nexport interface AxisSeriesValue {\n seriesIndex: number;\n label: string;\n /** Raw value there, or `null` when this series has no point at that x. */\n value: number | null;\n}\n\n/** Index of the xPosition nearest to `px` (or -1 if none). */\nexport function nearestIndex(positions: number[], px: number): number {\n if (!positions.length) return -1;\n let best = 0;\n let bestD = Infinity;\n for (let i = 0; i < positions.length; i++) {\n const d = Math.abs(positions[i] - px);\n if (d < bestD) {\n bestD = d;\n best = i;\n }\n }\n return best;\n}\n\n/**\n * Each visible series' samples as `[main, value]` pixel pairs ordered along the\n * main axis (x for a normal chart, y for an inverted one) — the input\n * {@link distanceToLine} expects. (Integer-keyed records enumerate in ascending\n * numeric order, so `byIndex` is already in main-axis order.)\n */\nexport function seriesSampleLines(scene: RenderScene): [number, number][][] {\n const inverted = !!scene.inverted;\n return scene.hoverPoints.map((hp) =>\n // `ascending`: an RTL scene is mirrored, so its samples descend in x — the\n // distance search bisects on that axis and needs them the other way round.\n ascending(\n Object.keys(hp.byIndex).map((k): [number, number] => {\n const p = hp.byIndex[Number(k)];\n return inverted ? [p.y, p.x] : [p.x, p.y];\n }),\n ),\n );\n}\n\n/** Every visible series' value at `index` — what an axis click reports. */\nexport function axisSeriesValues(scene: RenderScene, index: number): AxisSeriesValue[] {\n return scene.hoverPoints.map((hp) => ({\n seriesIndex: hp.seriesIndex,\n label: hp.label,\n value: hp.byIndex[index]?.value ?? null,\n }));\n}\n\n/** Is (px, py) inside the plot rect (i.e. not in the title / legend / gutters)? */\nexport function insidePlot(plot: Rect, px: number, py: number): boolean {\n return px >= plot.x && px <= plot.x + plot.width && py >= plot.y && py <= plot.y + plot.height;\n}\n\n/**\n * The polyline's y at `x`, linearly interpolated between the samples bracketing\n * it, or `null` when `x` is outside its span. Assumes points ascend in x, which\n * every drawn series polyline does.\n */\nfunction polylineY(input: readonly Pt[], x: number): number | null {\n const n = input.length;\n if (!n) return null;\n // A mirrored (RTL) area runs right-to-left; bisecting needs ascending x.\n const points = n > 1 && input[0].x > input[n - 1].x ? [...input].reverse() : input;\n if (x < points[0].x || x > points[n - 1].x) return null;\n if (n === 1) return points[0].y;\n let lo = 0;\n let hi = n - 1;\n while (hi - lo > 1) {\n const mid = (lo + hi) >> 1;\n if (points[mid].x <= x) lo = mid;\n else hi = mid;\n }\n const a = points[lo];\n const b = points[hi];\n return b.x === a.x ? a.y : a.y + ((b.y - a.y) * (x - a.x)) / (b.x - a.x);\n}\n\n/**\n * Is (px, py) inside this filled area — between its top edge and its base?\n *\n * A stacked layer fills only its own band, so its `basePoints` (not the global\n * baseline) are the bottom edge; an unstacked area fills down to `baselineY`.\n * `min`/`max` rather than `<`/`>` because a negative series fills *upward* to\n * the zero line.\n */\nfunction areaContains(area: SceneArea, px: number, py: number): boolean {\n const top = polylineY(area.points, px);\n if (top == null) return false;\n const base = (area.basePoints ? polylineY(area.basePoints, px) : null) ?? area.baselineY;\n return py >= Math.min(top, base) && py <= Math.max(top, base);\n}\n\n/**\n * Which series' filled band contains (px, py), or -1.\n *\n * This is what the eye reads on an area chart: the cursor sits INSIDE a band,\n * so the band it is in owns it — not whichever series' drawn line happens to\n * pass nearest, which on a thick stacked band is usually a different series\n * altogether. Where unstacked areas overlap and several contain the cursor,\n * the one whose own top edge is nearest wins.\n */\nexport function areaSeriesAt(scene: RenderScene, px: number, py: number): number {\n if (!insidePlot(scene.plot, px, py)) return -1;\n let best = -1;\n let bestD = Infinity;\n for (const a of scene.areas) {\n if (a.seriesIndex == null || !areaContains(a, px, py)) continue;\n const top = polylineY(a.points, px);\n const d = top == null ? Infinity : Math.abs(py - top);\n if (d < bestD) {\n bestD = d;\n best = a.seriesIndex;\n }\n }\n return best;\n}\n\n/**\n * What a click at (px, py) — canvas-relative pixels — landed on.\n *\n * Most specific first: a data **mark**, else a series **line**, else a filled\n * **area**, else the plot background (**axis**). So a click on a mark never\n * also reads as a click on that series' line, and one on the line never reads\n * as its area.\n *\n * Only the mark test reaches outside the plot rect (it always has: a click just\n * past the axis still counts as the point it is nearest). Line / area / axis\n * are plot-only, since the geometry is clipped to the plot and a click in the\n * title, legend or an axis gutter is not a click on the chart background.\n *\n * `lines` is {@link seriesSampleLines}, passed in so the engine can reuse its\n * per-scene cache.\n */\nexport function hitTestScene(\n scene: RenderScene,\n px: number,\n py: number,\n lines: [number, number][][] = seriesSampleLines(scene),\n): SceneHit {\n const inverted = !!scene.inverted;\n const cursorMain = inverted ? py : px;\n const cursorValue = inverted ? px : py;\n const dataIndex = nearestIndex(scene.xPositions, cursorMain);\n if (dataIndex < 0) return null;\n\n // ── 1. a data mark: the series whose point at this x is nearest (2D) ──\n let markSeries = -1;\n let markD = Infinity;\n for (const hp of scene.hoverPoints) {\n const p = hp.byIndex[dataIndex];\n if (!p) continue;\n const d = Math.hypot(p.x - px, p.y - py);\n if (d < markD) {\n markD = d;\n markSeries = hp.seriesIndex;\n }\n }\n if (markSeries >= 0 && markD <= MARK_HIT_RADIUS) return { kind: 'mark', seriesIndex: markSeries, dataIndex };\n\n if (!insidePlot(scene.plot, px, py)) return null;\n\n // ── 2. a series line: distance to the DRAWN line, not to the sample at this\n // x (series can be measured at different x and have no sample here) ──\n let lineSeries = -1;\n let lineD = Infinity;\n scene.hoverPoints.forEach((hp, i) => {\n const d = distanceToLine(lines[i] ?? [], cursorMain, cursorValue);\n if (d < lineD) {\n lineD = d;\n lineSeries = hp.seriesIndex;\n }\n });\n if (lineSeries >= 0 && lineD <= LINE_HIT_TOLERANCE) return { kind: 'line', seriesIndex: lineSeries, dataIndex };\n\n // ── 3. a filled area (only when the chart draws them). Where unstacked areas\n // overlap, the one whose own line is nearest above/below wins — that is\n // the band the click reads as being \"under\". ──\n let areaSeries = -1;\n let areaD = Infinity;\n for (const a of scene.areas) {\n if (a.seriesIndex == null || !areaContains(a, px, py)) continue;\n const d = Math.abs(py - (polylineY(a.points, px) as number));\n if (d < areaD) {\n areaD = d;\n areaSeries = a.seriesIndex;\n }\n }\n if (areaSeries >= 0) return { kind: 'area', seriesIndex: areaSeries, dataIndex };\n\n // ── 4. plot background ──\n return { kind: 'axis', dataIndex };\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;AASG;AAKH;AACA,MAAM,GAAG,GAAG,IAAI;AAChB;AACO,MAAM,WAAW,GAAG;AAE3B;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC;AAE5B;;;;;;;;;;;AAWG;SACa,cAAc,CAC5B,MAA8C,EAC9C,UAAkB,EAClB,WAAmB,EAAA;AAEnB,IAAA,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM;AACvB,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,QAAQ;AACvB,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;IACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1B,IAAA,IAAI,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;AAC5F,IAAA,IAAI,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;IACzF,IAAI,EAAE,GAAG,CAAC;AACV,IAAA,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC;AACd,IAAA,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;QAClB,MAAM,GAAG,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC;QAC1B,IAAI,M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OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE;AACpC;;;;"}
1
+ {"version":3,"file":"p-CGqeEMjY.js","sources":["src/utils/charts/engine/emphasis.ts","src/utils/charts/engine/hit-test.ts"],"sourcesContent":["/*\n * Chart engine — hover emphasis\n * ===========================================================\n * When the pointer is near one series, that series stays vivid and\n * the others fade back so the focused line reads clearly. A pure\n * scene→scene transform (like animate.ts) so both renderer backends\n * dim identically; the engine animates the `t` factor over a short\n * MD3 transition and redraws emphasizeScene(scene, focus, t).\n * ===========================================================\n */\n\nimport { withAlpha } from './color';\nimport type { RenderScene } from './scene';\n\n/** How faded a non-focused series gets at full emphasis (alpha multiplier). */\nconst DIM = 0.22;\n/** Emphasis fade duration in ms. */\nexport const EMPHASIS_MS = 260;\n\n/**\n * How much nearer (px) a rival series must be before the emphasis leaves the\n * series it is on. Sized just under a typical \"close lines\" gap: enough of a\n * deadband to stop the two trading focus at their midpoint, small enough that\n * moving onto the other line still takes the focus with it.\n */\nexport const FOCUS_STICK = 4;\n\n/**\n * How far the cursor is (px) from a series' drawn line.\n *\n * `points` are that series' samples as `[main, value]` pixel pairs ordered\n * along the main axis (x for a normal chart, y for an inverted one). The line\n * is interpolated between the two samples bracketing the cursor, which is what\n * makes this work for series sampled at *different* x: with irregular data a\n * series usually has no sample exactly at the hovered position, and comparing\n * only exact samples hands the emphasis to whichever series happens to own\n * that slot. Past either end of the series the distance is measured to its\n * endpoint, so a line that has already finished reads as far away.\n */\nexport function distanceToLine(\n points: readonly (readonly [number, number])[],\n cursorMain: number,\n cursorValue: number,\n): number {\n const n = points.length;\n if (!n) return Infinity;\n const first = points[0];\n const last = points[n - 1];\n if (cursorMain <= first[0]) return Math.hypot(first[0] - cursorMain, first[1] - cursorValue);\n if (cursorMain >= last[0]) return Math.hypot(last[0] - cursorMain, last[1] - cursorValue);\n let lo = 0;\n let hi = n - 1;\n while (hi - lo > 1) {\n const mid = (lo + hi) >> 1;\n if (points[mid][0] <= cursorMain) lo = mid;\n else hi = mid;\n }\n const [aMain, aValue] = points[lo];\n const [bMain, bValue] = points[hi];\n const t = bMain === aMain ? 0 : (cursorMain - aMain) / (bMain - aMain);\n return Math.abs(aValue + (bValue - aValue) * t - cursorValue);\n}\n\n/**\n * Which series the hover should emphasise, given each candidate's distance to\n * the cursor and the one currently held (`-1` for none).\n *\n * Plain \"nearest wins\" flickers: between two lines a few pixels apart the\n * winner flips on every pointer move, and because the emphasis is already\n * fully faded in, each flip swaps vivid and dimmed instantly. Holding the\n * current series until a rival is clearly nearer turns the midpoint into a\n * deadband. A held series that isn't a candidate any more (it was hidden, or\n * the pointer left the plot) has no distance, so the focus moves on.\n */\nexport function pickFocusSeries(\n candidates: readonly { seriesIndex: number; distance: number }[],\n held: number,\n stick: number = FOCUS_STICK,\n): number {\n let best = -1;\n let bestD = Infinity;\n let heldD = Infinity;\n for (const c of candidates) {\n if (c.seriesIndex === held) heldD = c.distance;\n if (c.distance < bestD) {\n bestD = c.distance;\n best = c.seriesIndex;\n }\n }\n if (held >= 0 && bestD > heldD - stick) return held;\n return best;\n}\n\n/**\n * How long (ms) a rival has to stay the nearest before the emphasis moves to\n * it. The px deadband alone can't settle two lines running close together: a\n * hand held roughly still while the lines wander across the cursor makes the\n * nearest genuinely alternate, by the full gap each time. Requiring the rival\n * to *stay* nearest ignores that alternation while still following a\n * deliberate move onto the other line within a frame or three.\n */\nexport const FOCUS_DWELL_MS = 140;\n\n/**\n * Chooses the emphasised series over time: {@link pickFocusSeries} for the\n * geometry, plus a dwell so a contested choice has to settle before it moves.\n *\n * Owns the held series, so the engine just feeds it distances and a clock.\n */\nexport class HoverFocus {\n private held = -1;\n private candidate = -1;\n private since = 0;\n\n constructor(\n private readonly stick: number = FOCUS_STICK,\n private readonly dwellMs: number = FOCUS_DWELL_MS,\n ) {}\n\n /** The series to emphasise now, given each one's distance to the cursor. */\n pick(candidates: readonly { seriesIndex: number; distance: number }[], now: number): number {\n const wanted = pickFocusSeries(candidates, this.held, this.stick);\n if (wanted !== this.candidate) {\n this.candidate = wanted;\n this.since = now;\n }\n // Nothing focused yet (first hover, or after the pointer left): adopt\n // immediately, so arriving on a line reads as instant.\n if (this.held < 0) {\n this.held = wanted;\n } else if (wanted !== this.held && now - this.since >= this.dwellMs) {\n this.held = wanted;\n }\n return this.held;\n }\n\n /** Pointer left the plot, or the scene changed — drop the held series. */\n reset(): void {\n this.held = -1;\n this.candidate = -1;\n this.since = 0;\n }\n}\n\n/**\n * The scene with every series except `focusIndex` dimmed by progress `t`\n * (0 = no dimming, 1 = fully faded). Glyph markers and chrome are untouched.\n * Series without an index are treated as focused (never dimmed).\n */\nexport function emphasizeScene(scene: RenderScene, focusIndex: number, t: number): RenderScene {\n if (focusIndex < 0 || t <= 0) return scene;\n const factor = 1 - (1 - DIM) * Math.min(1, t);\n const dim = (si: number | undefined): boolean => si != null && si !== focusIndex;\n return {\n ...scene,\n lines: scene.lines.map((l) => (dim(l.seriesIndex) ? { ...l, color: withAlpha(l.color, factor) } : l)),\n areas: scene.areas.map((a) =>\n dim(a.seriesIndex) ? { ...a, colorTop: withAlpha(a.colorTop, factor), colorBottom: withAlpha(a.colorBottom, factor) } : a,\n ),\n markers: scene.markers.map((m) => (dim(m.seriesIndex) ? { ...m, color: withAlpha(m.color, factor) } : m)),\n };\n}\n","/*\n * Chart engine — click hit-testing\n * ===========================================================\n * Turns a pointer position over a rendered scene into the most\n * specific thing under it: a data mark, a series line, a filled\n * area, or the plot background (an \"axis\" click). Pure functions\n * over the RenderScene, so the precedence rule is unit-testable\n * without a canvas — the engine only maps the result onto its\n * callbacks.\n * ===========================================================\n */\n\nimport { distanceToLine } from './emphasis';\nimport type { Pt } from './geometry';\nimport { ascending } from './rtl';\nimport type { RenderScene, Rect, SceneArea } from './scene';\n\n/**\n * Max cursor→point distance (px) for a click to count as a mark click.\n * Deliberately generous: a mark is the thing consumers most want to catch, and\n * at this radius a click anywhere in a fingertip-sized region around the point\n * still lands on it.\n */\nexport const MARK_HIT_RADIUS = 26;\n\n/**\n * Max cursor→line distance (px) for a click to count as a line click.\n *\n * The stroke is 2.5px wide (±1.25px from the centreline), so this leaves ~6.75px\n * of pointer slop on either side — comfortable for an imprecise mouse without\n * reaching so far into the fill below that \"clicked the area just under the\n * line\" gets stolen by the line. It also absorbs the small error in\n * {@link distanceToLine}, which measures against the straight segment between\n * two samples while a `smooth` curve bows a little away from it.\n */\nexport const LINE_HIT_TOLERANCE = 8;\n\n/** What sits under the pointer, most specific first. */\nexport type SceneHit =\n | { kind: 'mark'; seriesIndex: number; dataIndex: number }\n | { kind: 'line'; seriesIndex: number; dataIndex: number }\n | { kind: 'area'; seriesIndex: number; dataIndex: number }\n | { kind: 'axis'; dataIndex: number }\n | null;\n\n/** One visible series' value at an x index — the rows the tooltip lists. */\nexport interface AxisSeriesValue {\n seriesIndex: number;\n label: string;\n /** Raw value there, or `null` when this series has no point at that x. */\n value: number | null;\n}\n\n/** Index of the xPosition nearest to `px` (or -1 if none). */\nexport function nearestIndex(positions: number[], px: number): number {\n if (!positions.length) return -1;\n let best = 0;\n let bestD = Infinity;\n for (let i = 0; i < positions.length; i++) {\n const d = Math.abs(positions[i] - px);\n if (d < bestD) {\n bestD = d;\n best = i;\n }\n }\n return best;\n}\n\n/**\n * Each visible series' samples as `[main, value]` pixel pairs ordered along the\n * main axis (x for a normal chart, y for an inverted one) — the input\n * {@link distanceToLine} expects. (Integer-keyed records enumerate in ascending\n * numeric order, so `byIndex` is already in main-axis order.)\n */\nexport function seriesSampleLines(scene: RenderScene): [number, number][][] {\n const inverted = !!scene.inverted;\n return scene.hoverPoints.map((hp) =>\n // `ascending`: an RTL scene is mirrored, so its samples descend in x — the\n // distance search bisects on that axis and needs them the other way round.\n ascending(\n Object.keys(hp.byIndex).map((k): [number, number] => {\n const p = hp.byIndex[Number(k)];\n return inverted ? [p.y, p.x] : [p.x, p.y];\n }),\n ),\n );\n}\n\n/** Every visible series' value at `index` — what an axis click reports. */\nexport function axisSeriesValues(scene: RenderScene, index: number): AxisSeriesValue[] {\n return scene.hoverPoints.map((hp) => ({\n seriesIndex: hp.seriesIndex,\n label: hp.label,\n value: hp.byIndex[index]?.value ?? null,\n }));\n}\n\n/** Is (px, py) inside the plot rect (i.e. not in the title / legend / gutters)? */\nexport function insidePlot(plot: Rect, px: number, py: number): boolean {\n return px >= plot.x && px <= plot.x + plot.width && py >= plot.y && py <= plot.y + plot.height;\n}\n\n/**\n * The polyline's y at `x`, linearly interpolated between the samples bracketing\n * it, or `null` when `x` is outside its span. Assumes points ascend in x, which\n * every drawn series polyline does.\n */\nfunction polylineY(input: readonly Pt[], x: number): number | null {\n const n = input.length;\n if (!n) return null;\n // A mirrored (RTL) area runs right-to-left; bisecting needs ascending x.\n const points = n > 1 && input[0].x > input[n - 1].x ? [...input].reverse() : input;\n if (x < points[0].x || x > points[n - 1].x) return null;\n if (n === 1) return points[0].y;\n let lo = 0;\n let hi = n - 1;\n while (hi - lo > 1) {\n const mid = (lo + hi) >> 1;\n if (points[mid].x <= x) lo = mid;\n else hi = mid;\n }\n const a = points[lo];\n const b = points[hi];\n return b.x === a.x ? a.y : a.y + ((b.y - a.y) * (x - a.x)) / (b.x - a.x);\n}\n\n/**\n * Is (px, py) inside this filled area — between its top edge and its base?\n *\n * A stacked layer fills only its own band, so its `basePoints` (not the global\n * baseline) are the bottom edge; an unstacked area fills down to `baselineY`.\n * `min`/`max` rather than `<`/`>` because a negative series fills *upward* to\n * the zero line.\n */\nfunction areaContains(area: SceneArea, px: number, py: number): boolean {\n const top = polylineY(area.points, px);\n if (top == null) return false;\n const base = (area.basePoints ? polylineY(area.basePoints, px) : null) ?? area.baselineY;\n return py >= Math.min(top, base) && py <= Math.max(top, base);\n}\n\n/**\n * Which series' filled band contains (px, py), or -1.\n *\n * This is what the eye reads on an area chart: the cursor sits INSIDE a band,\n * so the band it is in owns it — not whichever series' drawn line happens to\n * pass nearest, which on a thick stacked band is usually a different series\n * altogether. Where unstacked areas overlap and several contain the cursor,\n * the one whose own top edge is nearest wins.\n */\nexport function areaSeriesAt(scene: RenderScene, px: number, py: number): number {\n if (!insidePlot(scene.plot, px, py)) return -1;\n let best = -1;\n let bestD = Infinity;\n for (const a of scene.areas) {\n if (a.seriesIndex == null || !areaContains(a, px, py)) continue;\n const top = polylineY(a.points, px);\n const d = top == null ? Infinity : Math.abs(py - top);\n if (d < bestD) {\n bestD = d;\n best = a.seriesIndex;\n }\n }\n return best;\n}\n\n/**\n * What a click at (px, py) — canvas-relative pixels — landed on.\n *\n * Most specific first: a data **mark**, else a series **line**, else a filled\n * **area**, else the plot background (**axis**). So a click on a mark never\n * also reads as a click on that series' line, and one on the line never reads\n * as its area.\n *\n * Only the mark test reaches outside the plot rect (it always has: a click just\n * past the axis still counts as the point it is nearest). Line / area / axis\n * are plot-only, since the geometry is clipped to the plot and a click in the\n * title, legend or an axis gutter is not a click on the chart background.\n *\n * `lines` is {@link seriesSampleLines}, passed in so the engine can reuse its\n * per-scene cache.\n */\nexport function hitTestScene(\n scene: RenderScene,\n px: number,\n py: number,\n lines: [number, number][][] = seriesSampleLines(scene),\n): SceneHit {\n const inverted = !!scene.inverted;\n const cursorMain = inverted ? py : px;\n const cursorValue = inverted ? px : py;\n const dataIndex = nearestIndex(scene.xPositions, cursorMain);\n if (dataIndex < 0) return null;\n\n // ── 1. a data mark: the series whose point at this x is nearest (2D) ──\n let markSeries = -1;\n let markD = Infinity;\n for (const hp of scene.hoverPoints) {\n const p = hp.byIndex[dataIndex];\n if (!p) continue;\n const d = Math.hypot(p.x - px, p.y - py);\n if (d < markD) {\n markD = d;\n markSeries = hp.seriesIndex;\n }\n }\n if (markSeries >= 0 && markD <= MARK_HIT_RADIUS) return { kind: 'mark', seriesIndex: markSeries, dataIndex };\n\n if (!insidePlot(scene.plot, px, py)) return null;\n\n // ── 2. a series line: distance to the DRAWN line, not to the sample at this\n // x (series can be measured at different x and have no sample here) ──\n let lineSeries = -1;\n let lineD = Infinity;\n scene.hoverPoints.forEach((hp, i) => {\n const d = distanceToLine(lines[i] ?? [], cursorMain, cursorValue);\n if (d < lineD) {\n lineD = d;\n lineSeries = hp.seriesIndex;\n }\n });\n if (lineSeries >= 0 && lineD <= LINE_HIT_TOLERANCE) return { kind: 'line', seriesIndex: lineSeries, dataIndex };\n\n // ── 3. a filled area (only when the chart draws them). Where unstacked areas\n // overlap, the one whose own line is nearest above/below wins — that is\n // the band the click reads as being \"under\". ──\n let areaSeries = -1;\n let areaD = Infinity;\n for (const a of scene.areas) {\n if (a.seriesIndex == null || !areaContains(a, px, py)) continue;\n const d = Math.abs(py - (polylineY(a.points, px) as number));\n if (d < areaD) {\n areaD = d;\n areaSeries = a.seriesIndex;\n }\n }\n if (areaSeries >= 0) return { kind: 'area', seriesIndex: areaSeries, dataIndex };\n\n // ── 4. plot background ──\n return { kind: 'axis', dataIndex };\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;AASG;AAKH;AACA,MAAM,GAAG,GAAG,IAAI;AAChB;AACO,MAAM,WAAW,GAAG;AAE3B;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC;AAE5B;;;;;;;;;;;AAWG;SACa,cAAc,CAC5B,MAA8C,EAC9C,UAAkB,EAClB,WAAmB,EAAA;AAEnB,IAAA,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM;AACvB,IAAA,IAAI,CAAC,CAAC;AAAE,QAAA,OAAO,QAAQ;AACvB,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;IACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;AAC1B,IAAA,IAAI,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;AAC5F,IAAA,IAAI,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC;AAAE,QAAA,OAAO,I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