@aceshooting/lyra-ui 26.0.0 → 27.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1475) hide show
  1. package/CHANGELOG.md +63 -675
  2. package/README.md +281 -1130
  3. package/design-tokens.json +1 -1
  4. package/dist/ai/types.d.ts +5 -5
  5. package/dist/autoloader.js +1 -1
  6. package/dist/cli/agent-registry.mjs +1 -0
  7. package/dist/cli/component-inventory.mjs +1 -1
  8. package/dist/cli/init-agents.mjs +40 -0
  9. package/dist/cli/is-main-module.mjs +1 -0
  10. package/dist/cli/lyra-rename-ledger.mjs +1 -1
  11. package/dist/cli/lyra-ui.mjs +11 -0
  12. package/dist/cli/migrate-wa.mjs +4 -2
  13. package/dist/cli/migration-contract.json +1 -1
  14. package/dist/cli/migration-renames.mjs +1 -1
  15. package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.d.ts +1 -1
  16. package/dist/components/agent-tools/agent-eval-dashboard/agent-eval-dashboard.class.js +2 -2
  17. package/dist/components/agent-tools/approval-queue/approval-queue.class.js +1 -1
  18. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.d.ts +2 -2
  19. package/dist/components/agent-tools/confirm-bar/confirm-bar.class.js +2 -2
  20. package/dist/components/agent-tools/connector-manager/connector-manager.class.d.ts +4 -2
  21. package/dist/components/agent-tools/connector-manager/connector-manager.class.js +6 -3
  22. package/dist/components/agent-tools/connector-manager/connector-manager.d.ts +1 -1
  23. package/dist/components/agent-tools/connector-manager/connector-manager.js +1 -1
  24. package/dist/components/agent-tools/connector-manager/connector-manager.styles.js +1 -1
  25. package/dist/components/agent-tools/context-inspector/context-inspector.class.d.ts +2 -2
  26. package/dist/components/agent-tools/context-inspector/context-inspector.class.js +6 -6
  27. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.d.ts +8 -33
  28. package/dist/components/agent-tools/eval-dataset/eval-dataset.class.js +27 -4
  29. package/dist/components/agent-tools/eval-dataset/eval-dataset.d.ts +1 -1
  30. package/dist/components/agent-tools/eval-dataset/eval-dataset.js +1 -1
  31. package/dist/components/agent-tools/eval-dataset/eval-dataset.styles.js +1 -1
  32. package/dist/components/agent-tools/evaluation-run/evaluation-run.class.js +1 -1
  33. package/dist/components/agent-tools/permission-grant/permission-grant.class.d.ts +4 -2
  34. package/dist/components/agent-tools/permission-grant/permission-grant.class.js +6 -3
  35. package/dist/components/agent-tools/permission-grant/permission-grant.d.ts +1 -1
  36. package/dist/components/agent-tools/permission-grant/permission-grant.js +1 -1
  37. package/dist/components/agent-tools/permission-grant/permission-grant.styles.js +1 -1
  38. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.d.ts +1 -1
  39. package/dist/components/agent-tools/prompt-studio/prompt-studio.class.js +2 -2
  40. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.d.ts +3 -1
  41. package/dist/components/agent-tools/schema-viewer/schema-viewer.class.js +1 -1
  42. package/dist/components/agent-tools/stack-trace/stack-trace.class.js +1 -1
  43. package/dist/components/agent-tools/task-list/task-list.class.d.ts +2 -2
  44. package/dist/components/agent-tools/task-list/task-list.class.js +2 -2
  45. package/dist/components/agent-tools/terminal/terminal.class.d.ts +1 -1
  46. package/dist/components/agent-tools/terminal/terminal.class.js +4 -4
  47. package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.class.d.ts +15 -9
  48. package/dist/components/agent-tools/tool-approval-dialog/tool-approval-dialog.class.js +1 -1
  49. package/dist/components/agent-tools/tool-call-block/tool-call-block.class.d.ts +2 -2
  50. package/dist/components/agent-tools/tool-call-block/tool-call-block.class.js +1 -1
  51. package/dist/components/agent-tools/tool-call-block/tool-call-block.styles.js +1 -1
  52. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.class.d.ts +2 -7
  53. package/dist/components/agent-tools/tool-call-chip/tool-call-chip.styles.js +1 -1
  54. package/dist/components/agent-tools/tool-param-form/tool-param-constraints.js +1 -1
  55. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.d.ts +3 -5
  56. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +1 -1
  57. package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.class.d.ts +2 -5
  58. package/dist/components/agent-tools/tool-result-dialog/tool-result-dialog.styles.js +1 -1
  59. package/dist/components/agent-tools/tool-result-view/registry.d.ts +4 -12
  60. package/dist/components/agent-tools/tool-result-view/tool-result-view.class.d.ts +2 -2
  61. package/dist/components/agent-tools/tool-result-view/tool-result-view.class.js +1 -1
  62. package/dist/components/agent-tools/tool-status.d.ts +7 -0
  63. package/dist/components/agent-tools/tool-status.styles.js +1 -0
  64. package/dist/components/agent-tools/tool-timeline/tool-timeline.class.js +1 -1
  65. package/dist/components/agent-tools/tool-timeline/tool-timeline.d.ts +1 -1
  66. package/dist/components/agent-tools/tool-timeline/tool-timeline.js +1 -1
  67. package/dist/components/agent-tools/trace-tree/trace-tree.class.js +2 -2
  68. package/dist/components/charts/chart/box-plot.class.d.ts +1 -1
  69. package/dist/components/charts/chart/box-plot.class.js +1 -1
  70. package/dist/components/charts/chart/box-plot.styles.js +1 -1
  71. package/dist/components/charts/chart/chart-surface-shared.js +1 -0
  72. package/dist/components/charts/chart/chart-surface.styles.js +1 -1
  73. package/dist/components/charts/chart/chart-table-sampling.js +1 -1
  74. package/dist/components/charts/chart/chart.class.d.ts +2 -2
  75. package/dist/components/charts/chart/chart.class.js +2 -2
  76. package/dist/components/charts/chart/chart.styles.js +1 -1
  77. package/dist/components/charts/chart/histogram.class.js +1 -1
  78. package/dist/components/charts/chart/lite-chart.class.d.ts +1 -1
  79. package/dist/components/charts/chart/lite-chart.class.js +4 -4
  80. package/dist/components/conversation/catalog-picker-element.d.ts +28 -13
  81. package/dist/components/conversation/catalog-picker-element.js +1 -1
  82. package/dist/components/conversation/catalog-picker-trigger.styles.js +1 -0
  83. package/dist/components/conversation/chat-message/chat-message.class.js +1 -1
  84. package/dist/components/conversation/chat-message/chat-message.styles.js +1 -1
  85. package/dist/components/conversation/chat-viewport/chat-viewport.class.d.ts +1 -1
  86. package/dist/components/conversation/chat-viewport/chat-viewport.class.js +1 -1
  87. package/dist/components/conversation/code-block/code-block-shared.js +1 -1
  88. package/dist/components/conversation/conversation-item/conversation-item.class.js +1 -1
  89. package/dist/components/conversation/generation-metrics/generation-metrics.class.js +2 -2
  90. package/dist/components/conversation/markdown/markdown-base.class.js +1 -1
  91. package/dist/components/conversation/markdown/markdown-code-header.js +1 -1
  92. package/dist/components/conversation/message-actions/message-actions.class.js +1 -1
  93. package/dist/components/conversation/model-select/model-select.class.d.ts +7 -34
  94. package/dist/components/conversation/model-select/model-select.class.js +3 -3
  95. package/dist/components/conversation/model-select/model-select.styles.js +1 -1
  96. package/dist/components/conversation/prompt-input/prompt-input.class.d.ts +7 -2
  97. package/dist/components/conversation/prompt-input/prompt-input.class.js +5 -2
  98. package/dist/components/conversation/prompt-queue/prompt-queue.class.js +1 -1
  99. package/dist/components/conversation/realtime-session/realtime-session.class.js +1 -1
  100. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +1 -1
  101. package/dist/components/conversation/stream-status/stream-status.class.js +1 -1
  102. package/dist/components/conversation/voice-picker/voice-picker.class.d.ts +10 -27
  103. package/dist/components/conversation/voice-picker/voice-picker.class.js +3 -3
  104. package/dist/components/conversation/voice-picker/voice-picker.styles.js +1 -1
  105. package/dist/components/data/condition-builder/condition-builder.class.js +1 -1
  106. package/dist/components/data/data-grid/data-grid.class.js +1 -1
  107. package/dist/components/data/document-library/document-library.class.d.ts +2 -2
  108. package/dist/components/data/document-library/document-library.class.js +2 -2
  109. package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +3 -3
  110. package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
  111. package/dist/components/data/heatmap/heatmap.class.js +2 -2
  112. package/dist/components/data/sequence-strip/sequence-strip.class.d.ts +1 -1
  113. package/dist/components/data/sequence-strip/sequence-strip.class.js +1 -1
  114. package/dist/components/data/table/table.class.d.ts +10 -195
  115. package/dist/components/data/table/table.class.js +2 -2
  116. package/dist/components/data/table/table.styles.js +1 -1
  117. package/dist/components/data/timeline/timeline.class.js +1 -1
  118. package/dist/components/data/tree/tree.class.js +1 -1
  119. package/dist/components/forms/button/button.class.d.ts +3 -3
  120. package/dist/components/forms/button/button.class.js +1 -1
  121. package/dist/components/forms/catalog-picker-base.js +1 -1
  122. package/dist/components/forms/checkbox/checkbox.class.d.ts +13 -34
  123. package/dist/components/forms/checkbox/checkbox.class.js +3 -3
  124. package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +3 -3
  125. package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
  126. package/dist/components/forms/code-editor/code-editor.class.js +1 -1
  127. package/dist/components/forms/color-picker/color-picker.class.js +1 -1
  128. package/dist/components/forms/combobox/combobox.class.d.ts +6 -6
  129. package/dist/components/forms/combobox/combobox.class.js +3 -2
  130. package/dist/components/forms/combobox/option.class.d.ts +3 -0
  131. package/dist/components/forms/combobox/option.class.js +2 -2
  132. package/dist/components/forms/date-picker/date-input.class.d.ts +10 -11
  133. package/dist/components/forms/date-picker/date-input.class.js +4 -3
  134. package/dist/components/forms/date-picker/date-input.styles.js +1 -1
  135. package/dist/components/forms/date-picker/date-picker.class.d.ts +6 -0
  136. package/dist/components/forms/date-picker/date-picker.class.js +1 -1
  137. package/dist/components/forms/date-picker/date-picker.styles.js +1 -1
  138. package/dist/components/forms/emoji-picker/emoji-data-loader.js +1 -1
  139. package/dist/components/forms/emoji-picker/emoji-picker.class.js +1 -1
  140. package/dist/components/forms/input/input.styles.js +1 -1
  141. package/dist/components/forms/input/time-input.class.d.ts +1 -1
  142. package/dist/components/forms/input/time-input.class.js +1 -1
  143. package/dist/components/forms/input/time-input.styles.js +1 -1
  144. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +5 -5
  145. package/dist/components/forms/locale-picker/locale-picker.class.js +1 -1
  146. package/dist/components/forms/otp-input/otp-input.class.js +1 -0
  147. package/dist/components/forms/phone-input/phone-input.class.d.ts +7 -9
  148. package/dist/components/forms/phone-input/phone-input.class.js +6 -5
  149. package/dist/components/forms/phone-input/phone-input.styles.js +1 -1
  150. package/dist/components/forms/radio/radio-group.class.d.ts +4 -4
  151. package/dist/components/forms/radio/radio-group.class.js +1 -1
  152. package/dist/components/forms/radio/radio.class.d.ts +11 -19
  153. package/dist/components/forms/radio/radio.class.js +2 -2
  154. package/dist/components/forms/rubric-form/rubric-form.class.d.ts +3 -5
  155. package/dist/components/forms/rubric-form/rubric-form.class.js +1 -1
  156. package/dist/components/forms/select/select.class.d.ts +5 -7
  157. package/dist/components/forms/select/select.class.js +3 -2
  158. package/dist/components/forms/slider/slider.class.d.ts +3 -3
  159. package/dist/components/forms/slider/slider.class.js +1 -1
  160. package/dist/components/forms/slider/slider.styles.js +1 -1
  161. package/dist/components/forms/swatch-picker/swatch-picker.class.js +1 -1
  162. package/dist/components/forms/switch/switch.class.d.ts +11 -36
  163. package/dist/components/forms/switch/switch.class.js +2 -2
  164. package/dist/components/forms/textarea/textarea.class.js +1 -0
  165. package/dist/components/forms/textarea/textarea.styles.js +1 -1
  166. package/dist/components/forms/time-range/time-range.class.d.ts +5 -3
  167. package/dist/components/forms/time-range/time-range.class.js +1 -1
  168. package/dist/components/forms/time-range/time-range.styles.js +1 -1
  169. package/dist/components/forms/toggle-group/toggle-group.class.d.ts +2 -2
  170. package/dist/components/forms/toggle-group/toggle-group.class.js +1 -1
  171. package/dist/components/forms/token-input/token-input.class.d.ts +3 -3
  172. package/dist/components/forms/token-input/token-input.class.js +1 -1
  173. package/dist/components/layout/app-rail/app-rail-item.class.js +1 -1
  174. package/dist/components/layout/app-rail/app-rail.class.d.ts +2 -2
  175. package/dist/components/layout/app-rail/app-rail.class.js +1 -1
  176. package/dist/components/layout/breadcrumb/breadcrumb-item.class.js +1 -1
  177. package/dist/components/layout/card/card.class.js +1 -1
  178. package/dist/components/layout/carousel/carousel.class.js +1 -1
  179. package/dist/components/layout/command-palette/command-palette.class.d.ts +6 -2
  180. package/dist/components/layout/command-palette/command-palette.class.js +1 -1
  181. package/dist/components/layout/dashboard-grid/dashboard-grid.class.js +1 -1
  182. package/dist/components/layout/details/accordion.class.js +1 -1
  183. package/dist/components/layout/dock-panel/dock-panel.class.d.ts +1 -1
  184. package/dist/components/layout/dock-panel/dock-panel.class.js +1 -1
  185. package/dist/components/layout/drilldown-panel/drilldown-panel.class.js +2 -2
  186. package/dist/components/layout/filter-bar/filter-bar.class.d.ts +3 -2
  187. package/dist/components/layout/filter-bar/filter-bar.class.js +18 -15
  188. package/dist/components/layout/filter-bar/filter-bar.styles.js +1 -1
  189. package/dist/components/layout/menu/menu.class.d.ts +1 -1
  190. package/dist/components/layout/menu/menu.class.js +1 -1
  191. package/dist/components/layout/multi-split/multi-split.class.d.ts +1 -1
  192. package/dist/components/layout/multi-split/multi-split.class.js +1 -1
  193. package/dist/components/layout/navigation-menu-item/navigation-menu-item.class.js +1 -1
  194. package/dist/components/layout/page/page.class.d.ts +1 -1
  195. package/dist/components/layout/page/page.class.js +1 -1
  196. package/dist/components/layout/responsive-panel/responsive-panel.class.d.ts +1 -1
  197. package/dist/components/layout/responsive-panel/responsive-panel.class.js +1 -1
  198. package/dist/components/layout/scroller/scroller.class.js +1 -1
  199. package/dist/components/layout/segmented/segmented.class.js +1 -1
  200. package/dist/components/layout/stepper/stepper.class.js +2 -2
  201. package/dist/components/layout/tab-group/tab-group.class.js +1 -1
  202. package/dist/components/layout/virtual-list/virtual-list.class.d.ts +1 -1
  203. package/dist/components/layout/virtual-list/virtual-list.class.js +1 -1
  204. package/dist/components/layout/widget/widget.class.d.ts +1 -1
  205. package/dist/components/layout/widget/widget.class.js +3 -3
  206. package/dist/components/media/drop-zone/drop-zone.class.d.ts +10 -0
  207. package/dist/components/media/drop-zone/drop-zone.class.js +2 -2
  208. package/dist/components/media/file-input/file-input.class.d.ts +3 -3
  209. package/dist/components/media/file-input/file-input.class.js +2 -2
  210. package/dist/components/media/file-input/file-intake.d.ts +5 -1
  211. package/dist/components/media/file-input/file-intake.js +1 -1
  212. package/dist/components/media/flag/flag.class.js +1 -1
  213. package/dist/components/media/image-viewer/image-viewer.styles.js +1 -1
  214. package/dist/components/media/lightbox/lightbox.class.js +1 -1
  215. package/dist/components/media/map/map.class.js +2 -2
  216. package/dist/components/media/qr-code/qr-code-loader.js +1 -1
  217. package/dist/components/media/qr-code/qr-code.class.js +1 -1
  218. package/dist/components/media/video/video.class.js +3 -3
  219. package/dist/components/media/video-playlist/video-playlist.class.js +1 -1
  220. package/dist/components/media/zoomable-frame/zoomable-frame.class.d.ts +2 -2
  221. package/dist/components/media/zoomable-frame/zoomable-frame.class.js +1 -1
  222. package/dist/components/overlays/alert/alert.class.d.ts +3 -3
  223. package/dist/components/overlays/alert/alert.class.js +1 -1
  224. package/dist/components/overlays/badge/badge.class.d.ts +2 -2
  225. package/dist/components/overlays/badge/badge.class.js +1 -1
  226. package/dist/components/overlays/badge/tag.class.d.ts +3 -1
  227. package/dist/components/overlays/badge/tag.class.js +3 -2
  228. package/dist/components/overlays/badge/tag.styles.js +1 -1
  229. package/dist/components/overlays/callout/callout.class.d.ts +2 -2
  230. package/dist/components/overlays/callout/callout.class.js +1 -1
  231. package/dist/components/overlays/chip/chip.class.d.ts +4 -2
  232. package/dist/components/overlays/chip/chip.class.js +2 -2
  233. package/dist/components/overlays/dialog/dialog.class.d.ts +1 -1
  234. package/dist/components/overlays/dialog/dialog.class.js +1 -1
  235. package/dist/components/overlays/overlay/overlay-shared.d.ts +9 -0
  236. package/dist/components/overlays/overlay/overlay-shared.js +1 -1
  237. package/dist/components/overlays/overlay/popover.class.d.ts +2 -2
  238. package/dist/components/overlays/overlay/popover.class.js +1 -1
  239. package/dist/components/overlays/overlay/tooltip.class.d.ts +1 -1
  240. package/dist/components/overlays/overlay/tooltip.class.js +1 -1
  241. package/dist/components/overlays/progress/progress-bar.class.d.ts +5 -22
  242. package/dist/components/overlays/progress/progress-bar.class.js +4 -4
  243. package/dist/components/overlays/progress/progress-base.d.ts +25 -0
  244. package/dist/components/overlays/progress/progress-base.js +1 -0
  245. package/dist/components/overlays/progress/progress-ring.class.d.ts +3 -24
  246. package/dist/components/overlays/progress/progress-ring.class.js +4 -4
  247. package/dist/components/overlays/rating/rating.class.d.ts +3 -3
  248. package/dist/components/overlays/rating/rating.class.js +1 -1
  249. package/dist/components/retrieval/chunk-inspector/chunk-inspector.class.d.ts +4 -2
  250. package/dist/components/retrieval/chunk-inspector/chunk-inspector.class.js +4 -4
  251. package/dist/components/retrieval/embedding-explorer/embedding-explorer.class.js +1 -1
  252. package/dist/components/retrieval/entity-dossier/entity-dossier.class.d.ts +1 -1
  253. package/dist/components/retrieval/graph/graph-canvas.js +1 -1
  254. package/dist/components/retrieval/graph/graph-model.js +1 -1
  255. package/dist/components/retrieval/graph/graph.class.d.ts +1 -3
  256. package/dist/components/retrieval/graph/graph.class.js +1 -1
  257. package/dist/components/retrieval/grounding-summary/grounding-summary.class.d.ts +1 -1
  258. package/dist/components/retrieval/grounding-summary/grounding-summary.class.js +2 -2
  259. package/dist/components/retrieval/knowledge-base/knowledge-base.class.d.ts +1 -1
  260. package/dist/components/retrieval/knowledge-base/knowledge-base.class.js +2 -2
  261. package/dist/components/retrieval/knowledge-base-admin/knowledge-base-admin.class.js +1 -1
  262. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.d.ts +1 -0
  263. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +2 -1
  264. package/dist/components/retrieval/memory-panel/memory-panel.class.d.ts +6 -2
  265. package/dist/components/retrieval/memory-panel/memory-panel.class.js +2 -2
  266. package/dist/components/retrieval/memory-panel/memory-panel.styles.js +1 -1
  267. package/dist/components/retrieval/node-palette/node-palette.class.js +1 -1
  268. package/dist/components/retrieval/path-strip/path-strip.class.js +1 -1
  269. package/dist/components/retrieval/provenance-panel/provenance-panel.class.d.ts +1 -1
  270. package/dist/components/retrieval/research-progress/research-progress.class.d.ts +5 -1
  271. package/dist/components/retrieval/research-progress/research-progress.class.js +3 -3
  272. package/dist/components/retrieval/research-progress/research-progress.d.ts +1 -1
  273. package/dist/components/retrieval/research-progress/research-progress.js +1 -1
  274. package/dist/components/retrieval/research-progress/research-progress.styles.js +1 -1
  275. package/dist/components/retrieval/retrieval-compare/retrieval-compare.class.d.ts +6 -2
  276. package/dist/components/retrieval/retrieval-compare/retrieval-compare.class.js +2 -2
  277. package/dist/components/retrieval/retrieval-compare/retrieval-compare.styles.js +1 -1
  278. package/dist/components/retrieval/retrieval-results/retrieval-results.class.d.ts +2 -2
  279. package/dist/components/retrieval/retrieval-results/retrieval-results.class.js +3 -2
  280. package/dist/components/retrieval/retrieval-search/retrieval-search.class.js +3 -3
  281. package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.d.ts +6 -2
  282. package/dist/components/retrieval/retrieval-trace/retrieval-trace.class.js +2 -2
  283. package/dist/components/retrieval/retrieval-trace/retrieval-trace.styles.js +1 -1
  284. package/dist/components/retrieval/source-picker/source-picker.class.js +1 -1
  285. package/dist/components/utility/copy-button/copy-button.class.js +1 -1
  286. package/dist/components/utility/diff-view/diff-view.class.js +1 -1
  287. package/dist/components/utility/export-button/export-button.class.d.ts +1 -1
  288. package/dist/components/utility/export-button/export-button.class.js +1 -1
  289. package/dist/components/utility/icon/dompurify-loader.js +1 -1
  290. package/dist/components/utility/json-viewer/json-viewer.class.js +2 -2
  291. package/dist/components/utility/known-date/known-date.class.js +1 -1
  292. package/dist/components/utility/mention-popover/mention-popover.class.js +1 -1
  293. package/dist/components/utility/mutation-observer/mutation-observer.class.js +1 -1
  294. package/dist/components/utility/random-content/random-content.class.d.ts +1 -1
  295. package/dist/components/utility/random-content/random-content.class.js +1 -1
  296. package/dist/components/utility/tour/tour.class.d.ts +1 -1
  297. package/dist/components/utility/tour/tour.class.js +1 -1
  298. package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
  299. package/dist/components/viewers/archive-viewer/archive-viewer.styles.js +1 -1
  300. package/dist/components/viewers/calendar-viewer/calendar-viewer.class.d.ts +3 -1
  301. package/dist/components/viewers/calendar-viewer/calendar-viewer.class.js +1 -1
  302. package/dist/components/viewers/contact-viewer/contact-viewer.class.d.ts +3 -1
  303. package/dist/components/viewers/contact-viewer/contact-viewer.class.js +1 -1
  304. package/dist/components/viewers/csv-viewer/csv-viewer.class.d.ts +2 -2
  305. package/dist/components/viewers/csv-viewer/csv-viewer.class.js +4 -18
  306. package/dist/components/viewers/csv-viewer/csv-viewer.styles.js +1 -1
  307. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.d.ts +2 -2
  308. package/dist/components/viewers/dataset-viewer/dataset-viewer.class.js +4 -18
  309. package/dist/components/viewers/dataset-viewer/dataset-viewer.styles.js +1 -1
  310. package/dist/components/viewers/document-preview/document-preview.class.d.ts +1 -1
  311. package/dist/components/viewers/document-preview/document-preview.class.js +3 -16
  312. package/dist/components/viewers/document-viewer/ooxml-part-guard.js +1 -0
  313. package/dist/components/viewers/docx-viewer/docx-loader.js +1 -1
  314. package/dist/components/viewers/docx-viewer/docx-resource-guard.js +1 -1
  315. package/dist/components/viewers/docx-viewer/docx-viewer.class.d.ts +3 -3
  316. package/dist/components/viewers/docx-viewer/docx-viewer.class.js +3 -3
  317. package/dist/components/viewers/ebook-viewer/ebook-loader.js +1 -1
  318. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.d.ts +1 -1
  319. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +2 -1
  320. package/dist/components/viewers/ebook-viewer/epub-resource-guard.js +1 -1
  321. package/dist/components/viewers/email-viewer/email-viewer.class.d.ts +1 -1
  322. package/dist/components/viewers/email-viewer/email-viewer.class.js +2 -2
  323. package/dist/components/viewers/geojson-view/geojson-viewer.class.d.ts +1 -4
  324. package/dist/components/viewers/geojson-view/geojson-viewer.class.js +1 -1
  325. package/dist/components/viewers/highlight-layer/highlight-layer.class.js +1 -1
  326. package/dist/components/viewers/html-viewer/html-viewer.class.d.ts +3 -1
  327. package/dist/components/viewers/html-viewer/html-viewer.class.js +1 -1
  328. package/dist/components/viewers/html-viewer/html-viewer.styles.js +1 -1
  329. package/dist/components/viewers/notebook-viewer/dompurify-loader.js +1 -1
  330. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +1 -1
  331. package/dist/components/viewers/page-rail/page-rail.class.js +2 -2
  332. package/dist/components/viewers/passive-markup.js +1 -1
  333. package/dist/components/viewers/pdf-viewer/pdf-loader.js +1 -1
  334. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.d.ts +2 -2
  335. package/dist/components/viewers/pdf-viewer/pdf-viewer.class.js +4 -4
  336. package/dist/components/viewers/pptx-viewer/pptx-loader.js +1 -1
  337. package/dist/components/viewers/pptx-viewer/pptx-resource-guard.js +1 -1
  338. package/dist/components/viewers/pptx-viewer/pptx-viewer.class.js +1 -1
  339. package/dist/components/viewers/region-highlight-layer.js +15 -2
  340. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.d.ts +2 -2
  341. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +4 -18
  342. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.styles.js +1 -1
  343. package/dist/components/viewers/svg-viewer/svg-viewer.class.d.ts +1 -1
  344. package/dist/components/viewers/svg-viewer/svg-viewer.class.js +2 -15
  345. package/dist/components/viewers/svg-viewer/svg-viewer.styles.js +1 -1
  346. package/dist/components/viewers/table-viewer-shared.js +15 -1
  347. package/dist/components/viewers/table-viewer-shared.styles.js +1 -0
  348. package/dist/events.d.ts +19 -18
  349. package/dist/framework-types.d.ts +1 -1
  350. package/dist/internal/accessibility-visibility.d.ts +3 -1
  351. package/dist/internal/accessibility-visibility.js +1 -1
  352. package/dist/internal/accessible-text-controller.js +1 -1
  353. package/dist/internal/active-element.d.ts +11 -0
  354. package/dist/internal/active-element.js +1 -1
  355. package/dist/internal/adjacent-runs.js +1 -1
  356. package/dist/internal/approval-wait-until.d.ts +7 -0
  357. package/dist/internal/approval-wait-until.js +1 -0
  358. package/dist/internal/aria-controls.js +1 -1
  359. package/dist/internal/catalog-picker.d.ts +2 -2
  360. package/dist/internal/catalog-picker.js +1 -1
  361. package/dist/internal/composed-tree.d.ts +18 -0
  362. package/dist/internal/composed-tree.js +1 -1
  363. package/dist/internal/copy-feedback.js +1 -0
  364. package/dist/internal/css-length.js +1 -1
  365. package/dist/internal/css-motion-time.js +1 -1
  366. package/dist/internal/css-number.js +1 -0
  367. package/dist/internal/default-strings.generated.js +1 -1
  368. package/dist/internal/deferred-focus-return.d.ts +33 -0
  369. package/dist/internal/deferred-focus-return.js +1 -1
  370. package/dist/internal/fixed-containing-block.js +1 -1
  371. package/dist/internal/form-associated.d.ts +38 -2
  372. package/dist/internal/form-associated.js +1 -1
  373. package/dist/internal/form-control-element.d.ts +13 -0
  374. package/dist/internal/form-control-element.js +1 -0
  375. package/dist/internal/form-control.styles.js +1 -1
  376. package/dist/internal/inherited-attribute-hub.js +1 -1
  377. package/dist/internal/locale-loaders.generated.js +1 -1
  378. package/dist/internal/localization-types.d.ts +1 -1
  379. package/dist/internal/localization.js +1 -1
  380. package/dist/internal/modal-surface-controller.js +1 -1
  381. package/dist/internal/object-guards.js +1 -1
  382. package/dist/internal/optional-peer-capabilities.d.ts +3 -1
  383. package/dist/internal/optional-peer-capabilities.js +1 -1
  384. package/dist/internal/orientation-breakpoint.js +1 -1
  385. package/dist/internal/overlay-manager.d.ts +6 -1
  386. package/dist/internal/overlay-manager.js +1 -1
  387. package/dist/internal/overlay-stack.d.ts +7 -3
  388. package/dist/internal/overlay-stack.js +1 -1
  389. package/dist/internal/package-metadata.js +1 -1
  390. package/dist/internal/persisted-restore.js +1 -1
  391. package/dist/internal/popup-controller.js +1 -0
  392. package/dist/internal/rendered-tree-traversal.d.ts +3 -1
  393. package/dist/internal/rendered-tree-traversal.js +1 -1
  394. package/dist/internal/retry-forwarder.js +1 -0
  395. package/dist/internal/roving-toolbar.js +1 -1
  396. package/dist/internal/scoped-definitions.generated.js +1 -1
  397. package/dist/internal/score-tiers.d.ts +4 -0
  398. package/dist/internal/score-tiers.js +1 -0
  399. package/dist/internal/semantic-variant.d.ts +7 -0
  400. package/dist/internal/semantic-variant.js +1 -0
  401. package/dist/internal/shared-unions.d.ts +1 -1
  402. package/dist/internal/viewer-search.js +1 -1
  403. package/dist/lyra.d.ts +1 -1
  404. package/dist/testing/happy-dom-shims.d.ts +18 -0
  405. package/dist/testing/happy-dom-shims.js +1 -1
  406. package/dist/testing/index.d.ts +1 -1
  407. package/dist/testing/index.js +1 -1
  408. package/llms/components/lr-accordion-item.md +1 -1
  409. package/llms/components/lr-accordion.md +1 -1
  410. package/llms/components/lr-alert.md +2 -2
  411. package/llms/components/lr-app-rail-group.md +1 -1
  412. package/llms/components/lr-app-rail-item.md +1 -1
  413. package/llms/components/lr-app-rail.md +1 -1
  414. package/llms/components/lr-attachment-chip.md +1 -10
  415. package/llms/components/lr-attachment-trigger.md +0 -10
  416. package/llms/components/lr-avatar.md +4 -8
  417. package/llms/components/lr-badge.md +16 -20
  418. package/llms/components/lr-box-plot.md +1 -1
  419. package/llms/components/lr-breadcrumb-item.md +1 -1
  420. package/llms/components/lr-breadcrumb.md +1 -1
  421. package/llms/components/lr-button-group.md +1 -1
  422. package/llms/components/lr-button.md +1 -1
  423. package/llms/components/lr-calendar.md +1 -1
  424. package/llms/components/lr-callout.md +3 -13
  425. package/llms/components/lr-card.md +1 -1
  426. package/llms/components/lr-carousel-item.md +1 -1
  427. package/llms/components/lr-carousel.md +1 -1
  428. package/llms/components/lr-chart.md +5 -7
  429. package/llms/components/lr-checkbox-group.md +1 -1
  430. package/llms/components/lr-checkbox.md +2 -1
  431. package/llms/components/lr-chip.md +3 -17
  432. package/llms/components/lr-chunk-inspector.md +2 -1
  433. package/llms/components/lr-citation-badge.md +2 -2
  434. package/llms/components/lr-code-block.md +0 -10
  435. package/llms/components/lr-code-editor.md +1 -1
  436. package/llms/components/lr-color-picker.md +1 -1
  437. package/llms/components/lr-combobox.md +6 -3
  438. package/llms/components/lr-command-palette.md +5 -2
  439. package/llms/components/lr-commit-card.md +1 -3
  440. package/llms/components/lr-condition-builder.md +1 -1
  441. package/llms/components/lr-confirm-bar.md +7 -13
  442. package/llms/components/lr-connector-manager.md +3 -1
  443. package/llms/components/lr-context-inspector.md +1 -1
  444. package/llms/components/lr-context-meter.md +1 -1
  445. package/llms/components/lr-control-group.md +1 -1
  446. package/llms/components/lr-copy-button.md +8 -10
  447. package/llms/components/lr-country-picker.md +1 -1
  448. package/llms/components/lr-currency-picker.md +1 -1
  449. package/llms/components/lr-dashboard-grid.md +1 -1
  450. package/llms/components/lr-data-grid.md +1 -1
  451. package/llms/components/lr-date-input.md +1 -1
  452. package/llms/components/lr-date-picker.md +11 -4
  453. package/llms/components/lr-details.md +1 -1
  454. package/llms/components/lr-dialog.md +8 -31
  455. package/llms/components/lr-diff-view.md +1 -1
  456. package/llms/components/lr-divider.md +1 -1
  457. package/llms/components/lr-dock-panel.md +1 -1
  458. package/llms/components/lr-document-library.md +1 -1
  459. package/llms/components/lr-drawer.md +1 -13
  460. package/llms/components/lr-drilldown-panel.md +1 -1
  461. package/llms/components/lr-drop-zone.md +4 -0
  462. package/llms/components/lr-dropdown-item.md +1 -1
  463. package/llms/components/lr-ebook-viewer.md +4 -3
  464. package/llms/components/lr-emoji-picker.md +1 -1
  465. package/llms/components/lr-entity-chip.md +2 -2
  466. package/llms/components/lr-env-list.md +1 -1
  467. package/llms/components/lr-eval-dataset.md +4 -19
  468. package/llms/components/lr-export-button.md +3 -3
  469. package/llms/components/lr-file-icon.md +0 -5
  470. package/llms/components/lr-file-input.md +3 -5
  471. package/llms/components/lr-file-tree.md +1 -1
  472. package/llms/components/lr-filter-bar.md +5 -1
  473. package/llms/components/lr-flag.md +1 -2
  474. package/llms/components/lr-flow-canvas.md +1 -1
  475. package/llms/components/lr-flow-controls.md +1 -1
  476. package/llms/components/lr-flow-minimap.md +2 -2
  477. package/llms/components/lr-flow-node.md +1 -1
  478. package/llms/components/lr-flow-run-status.md +1 -1
  479. package/llms/components/lr-format-bytes.md +2 -3
  480. package/llms/components/lr-format-date.md +2 -3
  481. package/llms/components/lr-format-number.md +1 -1
  482. package/llms/components/lr-funnel.md +1 -1
  483. package/llms/components/lr-gauge.md +1 -1
  484. package/llms/components/lr-generation-metrics.md +1 -1
  485. package/llms/components/lr-graph-query-builder.md +1 -1
  486. package/llms/components/lr-heatmap.md +1 -1
  487. package/llms/components/lr-icon-button.md +1 -1
  488. package/llms/components/lr-icon.md +1 -1
  489. package/llms/components/lr-input.md +1 -1
  490. package/llms/components/lr-intersection-observer.md +1 -1
  491. package/llms/components/lr-json-viewer.md +1 -1
  492. package/llms/components/lr-knowledge-graph-explorer.md +2 -2
  493. package/llms/components/lr-known-date.md +1 -1
  494. package/llms/components/lr-lite-chart.md +3 -4
  495. package/llms/components/lr-live-region.md +1 -1
  496. package/llms/components/lr-locale-picker.md +1 -1
  497. package/llms/components/lr-map.md +1 -3
  498. package/llms/components/lr-media-card.md +1 -10
  499. package/llms/components/lr-memory-panel.md +2 -0
  500. package/llms/components/lr-mention-popover.md +3 -3
  501. package/llms/components/lr-menu-item.md +1 -1
  502. package/llms/components/lr-menu-label.md +1 -1
  503. package/llms/components/lr-menu.md +1 -1
  504. package/llms/components/lr-menubar-item.md +1 -1
  505. package/llms/components/lr-menubar.md +1 -1
  506. package/llms/components/lr-message-actions.md +1 -11
  507. package/llms/components/lr-message-parts.md +3 -5
  508. package/llms/components/lr-model-select.md +2 -4
  509. package/llms/components/lr-multi-split.md +1 -1
  510. package/llms/components/lr-mutation-observer.md +2 -2
  511. package/llms/components/lr-native-time-input.md +1 -1
  512. package/llms/components/lr-navigation-menu-item.md +1 -1
  513. package/llms/components/lr-navigation-menu.md +1 -1
  514. package/llms/components/lr-number-input.md +1 -1
  515. package/llms/components/lr-option.md +1 -1
  516. package/llms/components/lr-otp-input.md +1 -1
  517. package/llms/components/lr-page.md +1 -1
  518. package/llms/components/lr-pagination.md +1 -1
  519. package/llms/components/lr-pan-zoom.md +1 -3
  520. package/llms/components/lr-permission-grant.md +3 -1
  521. package/llms/components/lr-phone-input.md +7 -5
  522. package/llms/components/lr-poll-status.md +1 -1
  523. package/llms/components/lr-popover.md +5 -9
  524. package/llms/components/lr-popup.md +1 -3
  525. package/llms/components/lr-progress-bar.md +2 -1
  526. package/llms/components/lr-progress-ring.md +4 -8
  527. package/llms/components/lr-prompt-input.md +3 -1
  528. package/llms/components/lr-prompt-studio.md +4 -4
  529. package/llms/components/lr-radio-button.md +2 -2
  530. package/llms/components/lr-radio-group.md +1 -1
  531. package/llms/components/lr-radio.md +3 -2
  532. package/llms/components/lr-random-content.md +1 -1
  533. package/llms/components/lr-rating.md +2 -3
  534. package/llms/components/lr-relative-time.md +2 -3
  535. package/llms/components/lr-reorder-item.md +1 -1
  536. package/llms/components/lr-reorder-list.md +1 -1
  537. package/llms/components/lr-research-progress.md +2 -0
  538. package/llms/components/lr-resize-observer.md +1 -1
  539. package/llms/components/lr-responsive-panel.md +1 -1
  540. package/llms/components/lr-retrieval-compare.md +2 -0
  541. package/llms/components/lr-retrieval-trace.md +2 -0
  542. package/llms/components/lr-rubric-form.md +1 -1
  543. package/llms/components/lr-scroller.md +1 -1
  544. package/llms/components/lr-segmented.md +1 -1
  545. package/llms/components/lr-select.md +1 -1
  546. package/llms/components/lr-sequence-playback.md +1 -2
  547. package/llms/components/lr-sequence-strip.md +1 -1
  548. package/llms/components/lr-signature-pad.md +1 -1
  549. package/llms/components/lr-skeleton.md +2 -4
  550. package/llms/components/lr-slider.md +1 -1
  551. package/llms/components/lr-sparkline.md +1 -1
  552. package/llms/components/lr-split-panel.md +1 -1
  553. package/llms/components/lr-stat.md +1 -1
  554. package/llms/components/lr-stepper.md +1 -1
  555. package/llms/components/lr-swatch-picker.md +1 -1
  556. package/llms/components/lr-switch.md +2 -1
  557. package/llms/components/lr-tab-group.md +1 -1
  558. package/llms/components/lr-tab-panel.md +1 -1
  559. package/llms/components/lr-tab.md +1 -1
  560. package/llms/components/lr-table.md +3 -3
  561. package/llms/components/lr-task-list.md +3 -3
  562. package/llms/components/lr-test-results.md +2 -4
  563. package/llms/components/lr-textarea.md +1 -1
  564. package/llms/components/lr-time-input.md +1 -1
  565. package/llms/components/lr-time-range.md +5 -4
  566. package/llms/components/lr-time-zone-picker.md +1 -1
  567. package/llms/components/lr-timeline-item.md +1 -1
  568. package/llms/components/lr-timeline.md +1 -1
  569. package/llms/components/lr-toggle-group.md +1 -1
  570. package/llms/components/lr-toggle.md +1 -1
  571. package/llms/components/lr-token-input.md +1 -1
  572. package/llms/components/lr-tool-approval-dialog.md +12 -10
  573. package/llms/components/lr-tool-call-block.md +1 -1
  574. package/llms/components/lr-tool-call-chip.md +1 -3
  575. package/llms/components/lr-tool-result-view.md +3 -3
  576. package/llms/components/lr-tool-timeline.md +2 -2
  577. package/llms/components/lr-tooltip.md +8 -11
  578. package/llms/components/lr-tour.md +2 -2
  579. package/llms/components/lr-tree-item.md +1 -1
  580. package/llms/components/lr-tree.md +1 -1
  581. package/llms/components/lr-unit-picker.md +1 -1
  582. package/llms/components/lr-usage-badge.md +1 -3
  583. package/llms/components/lr-video.md +1 -2
  584. package/llms/components/lr-virtual-list.md +1 -1
  585. package/llms/components/lr-visually-hidden.md +1 -1
  586. package/llms/components/lr-voice-picker.md +1 -1
  587. package/llms/components/lr-widget.md +1 -1
  588. package/llms/components/lr-word-cloud.md +1 -1
  589. package/llms/components/lr-zoomable-frame.md +1 -6
  590. package/llms/migration.md +96 -2
  591. package/llms/peers.md +3 -2
  592. package/llms/shared/ai-and-peers.md +2 -2
  593. package/llms/shared/events-and-types.md +4 -1
  594. package/llms/shared/imports-and-registration.md +2 -2
  595. package/llms/shared/localization-and-rtl.md +18 -18
  596. package/llms/shared/styles-and-tokens.md +1 -1
  597. package/llms/shared/testing-and-utilities.md +44 -43
  598. package/llms/shared.md +71 -67
  599. package/llms.txt +14 -12
  600. package/locales.json +1002 -1002
  601. package/package.json +16 -6879
  602. package/registrations.json +1 -1
  603. package/skills/compose-lyra-interfaces/SKILL.md +60 -0
  604. package/skills/compose-lyra-interfaces/agents/openai.yaml +4 -0
  605. package/skills/compose-lyra-interfaces/references/composition-patterns.md +77 -0
  606. package/skills/lyra-ui/SKILL.md +145 -0
  607. package/skills/lyra-ui/commands/frontend.md +37 -0
  608. package/skills/lyra-ui/commands/migrate.md +44 -0
  609. package/skills/lyra-ui/commands/new-component.md +19 -0
  610. package/skills/lyra-ui/commands/review.md +247 -0
  611. package/skills/lyra-ui/commands/update.md +30 -0
  612. package/skills/lyra-ui/reporting.md +137 -0
  613. package/custom-elements.json +0 -1
  614. package/dist/internal/side-effect-only.d.ts +0 -1
  615. package/dist/translations/am/agent-tools.js +0 -1
  616. package/dist/translations/am/charts.js +0 -1
  617. package/dist/translations/am/conversation.js +0 -1
  618. package/dist/translations/am/data.js +0 -1
  619. package/dist/translations/am/forms.js +0 -1
  620. package/dist/translations/am/layout.js +0 -1
  621. package/dist/translations/am/media.js +0 -1
  622. package/dist/translations/am/overlays.js +0 -1
  623. package/dist/translations/am/retrieval.js +0 -1
  624. package/dist/translations/am/shared.js +0 -1
  625. package/dist/translations/am/utility.js +0 -1
  626. package/dist/translations/am/viewers.js +0 -5
  627. package/dist/translations/am.js +0 -1
  628. package/dist/translations/ar/agent-tools.js +0 -1
  629. package/dist/translations/ar/charts.js +0 -1
  630. package/dist/translations/ar/conversation.js +0 -1
  631. package/dist/translations/ar/data.js +0 -1
  632. package/dist/translations/ar/forms.js +0 -1
  633. package/dist/translations/ar/layout.js +0 -1
  634. package/dist/translations/ar/media.js +0 -1
  635. package/dist/translations/ar/overlays.js +0 -1
  636. package/dist/translations/ar/retrieval.js +0 -1
  637. package/dist/translations/ar/shared.js +0 -1
  638. package/dist/translations/ar/utility.js +0 -1
  639. package/dist/translations/ar/viewers.js +0 -5
  640. package/dist/translations/ar.js +0 -1
  641. package/dist/translations/bho/agent-tools.js +0 -1
  642. package/dist/translations/bho/charts.js +0 -1
  643. package/dist/translations/bho/conversation.js +0 -1
  644. package/dist/translations/bho/data.js +0 -1
  645. package/dist/translations/bho/forms.js +0 -1
  646. package/dist/translations/bho/layout.js +0 -1
  647. package/dist/translations/bho/media.js +0 -1
  648. package/dist/translations/bho/overlays.js +0 -1
  649. package/dist/translations/bho/retrieval.js +0 -1
  650. package/dist/translations/bho/shared.js +0 -1
  651. package/dist/translations/bho/utility.js +0 -1
  652. package/dist/translations/bho/viewers.js +0 -5
  653. package/dist/translations/bho.js +0 -1
  654. package/dist/translations/bn/agent-tools.js +0 -1
  655. package/dist/translations/bn/charts.js +0 -1
  656. package/dist/translations/bn/conversation.js +0 -1
  657. package/dist/translations/bn/data.js +0 -1
  658. package/dist/translations/bn/forms.js +0 -1
  659. package/dist/translations/bn/layout.js +0 -1
  660. package/dist/translations/bn/media.js +0 -1
  661. package/dist/translations/bn/overlays.js +0 -1
  662. package/dist/translations/bn/retrieval.js +0 -1
  663. package/dist/translations/bn/shared.js +0 -1
  664. package/dist/translations/bn/utility.js +0 -1
  665. package/dist/translations/bn/viewers.js +0 -5
  666. package/dist/translations/bn.js +0 -1
  667. package/dist/translations/cs/agent-tools.js +0 -1
  668. package/dist/translations/cs/charts.js +0 -1
  669. package/dist/translations/cs/conversation.js +0 -1
  670. package/dist/translations/cs/data.js +0 -1
  671. package/dist/translations/cs/forms.js +0 -1
  672. package/dist/translations/cs/layout.js +0 -1
  673. package/dist/translations/cs/media.js +0 -1
  674. package/dist/translations/cs/overlays.js +0 -1
  675. package/dist/translations/cs/retrieval.js +0 -1
  676. package/dist/translations/cs/shared.js +0 -1
  677. package/dist/translations/cs/utility.js +0 -1
  678. package/dist/translations/cs/viewers.js +0 -5
  679. package/dist/translations/cs.js +0 -1
  680. package/dist/translations/da/agent-tools.js +0 -1
  681. package/dist/translations/da/charts.js +0 -1
  682. package/dist/translations/da/conversation.js +0 -1
  683. package/dist/translations/da/data.js +0 -1
  684. package/dist/translations/da/forms.js +0 -1
  685. package/dist/translations/da/layout.js +0 -1
  686. package/dist/translations/da/media.js +0 -1
  687. package/dist/translations/da/overlays.js +0 -1
  688. package/dist/translations/da/retrieval.js +0 -1
  689. package/dist/translations/da/shared.js +0 -1
  690. package/dist/translations/da/utility.js +0 -1
  691. package/dist/translations/da/viewers.js +0 -5
  692. package/dist/translations/da.js +0 -1
  693. package/dist/translations/de/agent-tools.js +0 -1
  694. package/dist/translations/de/charts.js +0 -1
  695. package/dist/translations/de/conversation.js +0 -1
  696. package/dist/translations/de/data.js +0 -1
  697. package/dist/translations/de/forms.js +0 -1
  698. package/dist/translations/de/layout.js +0 -1
  699. package/dist/translations/de/media.js +0 -1
  700. package/dist/translations/de/overlays.js +0 -1
  701. package/dist/translations/de/retrieval.js +0 -1
  702. package/dist/translations/de/shared.js +0 -1
  703. package/dist/translations/de/utility.js +0 -1
  704. package/dist/translations/de/viewers.js +0 -5
  705. package/dist/translations/de-CH/agent-tools.js +0 -1
  706. package/dist/translations/de-CH/charts.js +0 -1
  707. package/dist/translations/de-CH/conversation.js +0 -1
  708. package/dist/translations/de-CH/data.js +0 -1
  709. package/dist/translations/de-CH/forms.js +0 -1
  710. package/dist/translations/de-CH/layout.js +0 -1
  711. package/dist/translations/de-CH/media.js +0 -1
  712. package/dist/translations/de-CH/overlays.js +0 -1
  713. package/dist/translations/de-CH/retrieval.js +0 -1
  714. package/dist/translations/de-CH/shared.js +0 -1
  715. package/dist/translations/de-CH/utility.js +0 -1
  716. package/dist/translations/de-CH/viewers.js +0 -1
  717. package/dist/translations/de-CH.js +0 -1
  718. package/dist/translations/de.js +0 -1
  719. package/dist/translations/el/agent-tools.js +0 -1
  720. package/dist/translations/el/charts.js +0 -1
  721. package/dist/translations/el/conversation.js +0 -1
  722. package/dist/translations/el/data.js +0 -1
  723. package/dist/translations/el/forms.js +0 -1
  724. package/dist/translations/el/layout.js +0 -1
  725. package/dist/translations/el/media.js +0 -1
  726. package/dist/translations/el/overlays.js +0 -1
  727. package/dist/translations/el/retrieval.js +0 -1
  728. package/dist/translations/el/shared.js +0 -1
  729. package/dist/translations/el/utility.js +0 -1
  730. package/dist/translations/el/viewers.js +0 -5
  731. package/dist/translations/el.js +0 -1
  732. package/dist/translations/es/agent-tools.js +0 -1
  733. package/dist/translations/es/charts.js +0 -1
  734. package/dist/translations/es/conversation.js +0 -1
  735. package/dist/translations/es/data.js +0 -1
  736. package/dist/translations/es/forms.js +0 -1
  737. package/dist/translations/es/layout.js +0 -1
  738. package/dist/translations/es/media.js +0 -1
  739. package/dist/translations/es/overlays.js +0 -1
  740. package/dist/translations/es/retrieval.js +0 -1
  741. package/dist/translations/es/shared.js +0 -1
  742. package/dist/translations/es/utility.js +0 -1
  743. package/dist/translations/es/viewers.js +0 -5
  744. package/dist/translations/es.js +0 -1
  745. package/dist/translations/fa/agent-tools.js +0 -1
  746. package/dist/translations/fa/charts.js +0 -1
  747. package/dist/translations/fa/conversation.js +0 -1
  748. package/dist/translations/fa/data.js +0 -1
  749. package/dist/translations/fa/forms.js +0 -1
  750. package/dist/translations/fa/layout.js +0 -1
  751. package/dist/translations/fa/media.js +0 -1
  752. package/dist/translations/fa/overlays.js +0 -1
  753. package/dist/translations/fa/retrieval.js +0 -1
  754. package/dist/translations/fa/shared.js +0 -1
  755. package/dist/translations/fa/utility.js +0 -1
  756. package/dist/translations/fa/viewers.js +0 -5
  757. package/dist/translations/fa-AF/agent-tools.js +0 -1
  758. package/dist/translations/fa-AF/charts.js +0 -1
  759. package/dist/translations/fa-AF/conversation.js +0 -1
  760. package/dist/translations/fa-AF/data.js +0 -1
  761. package/dist/translations/fa-AF/forms.js +0 -1
  762. package/dist/translations/fa-AF/layout.js +0 -1
  763. package/dist/translations/fa-AF/media.js +0 -1
  764. package/dist/translations/fa-AF/overlays.js +0 -1
  765. package/dist/translations/fa-AF/retrieval.js +0 -1
  766. package/dist/translations/fa-AF/shared.js +0 -1
  767. package/dist/translations/fa-AF/utility.js +0 -1
  768. package/dist/translations/fa-AF/viewers.js +0 -5
  769. package/dist/translations/fa-AF.js +0 -1
  770. package/dist/translations/fa.js +0 -1
  771. package/dist/translations/fi/agent-tools.js +0 -1
  772. package/dist/translations/fi/charts.js +0 -1
  773. package/dist/translations/fi/conversation.js +0 -1
  774. package/dist/translations/fi/data.js +0 -1
  775. package/dist/translations/fi/forms.js +0 -1
  776. package/dist/translations/fi/layout.js +0 -1
  777. package/dist/translations/fi/media.js +0 -1
  778. package/dist/translations/fi/overlays.js +0 -1
  779. package/dist/translations/fi/retrieval.js +0 -1
  780. package/dist/translations/fi/shared.js +0 -1
  781. package/dist/translations/fi/utility.js +0 -1
  782. package/dist/translations/fi/viewers.js +0 -5
  783. package/dist/translations/fi.js +0 -1
  784. package/dist/translations/fr/agent-tools.js +0 -1
  785. package/dist/translations/fr/charts.js +0 -1
  786. package/dist/translations/fr/conversation.js +0 -1
  787. package/dist/translations/fr/data.js +0 -1
  788. package/dist/translations/fr/forms.js +0 -1
  789. package/dist/translations/fr/layout.js +0 -1
  790. package/dist/translations/fr/media.js +0 -1
  791. package/dist/translations/fr/overlays.js +0 -1
  792. package/dist/translations/fr/retrieval.js +0 -1
  793. package/dist/translations/fr/shared.js +0 -1
  794. package/dist/translations/fr/utility.js +0 -1
  795. package/dist/translations/fr/viewers.js +0 -5
  796. package/dist/translations/fr.js +0 -1
  797. package/dist/translations/gu/agent-tools.js +0 -1
  798. package/dist/translations/gu/charts.js +0 -1
  799. package/dist/translations/gu/conversation.js +0 -1
  800. package/dist/translations/gu/data.js +0 -1
  801. package/dist/translations/gu/forms.js +0 -1
  802. package/dist/translations/gu/layout.js +0 -1
  803. package/dist/translations/gu/media.js +0 -1
  804. package/dist/translations/gu/overlays.js +0 -1
  805. package/dist/translations/gu/retrieval.js +0 -1
  806. package/dist/translations/gu/shared.js +0 -1
  807. package/dist/translations/gu/utility.js +0 -1
  808. package/dist/translations/gu/viewers.js +0 -5
  809. package/dist/translations/gu.js +0 -1
  810. package/dist/translations/ha/agent-tools.js +0 -1
  811. package/dist/translations/ha/charts.js +0 -1
  812. package/dist/translations/ha/conversation.js +0 -1
  813. package/dist/translations/ha/data.js +0 -1
  814. package/dist/translations/ha/forms.js +0 -1
  815. package/dist/translations/ha/layout.js +0 -1
  816. package/dist/translations/ha/media.js +0 -1
  817. package/dist/translations/ha/overlays.js +0 -1
  818. package/dist/translations/ha/retrieval.js +0 -1
  819. package/dist/translations/ha/shared.js +0 -1
  820. package/dist/translations/ha/utility.js +0 -1
  821. package/dist/translations/ha/viewers.js +0 -5
  822. package/dist/translations/ha.js +0 -1
  823. package/dist/translations/he/agent-tools.js +0 -1
  824. package/dist/translations/he/charts.js +0 -1
  825. package/dist/translations/he/conversation.js +0 -1
  826. package/dist/translations/he/data.js +0 -1
  827. package/dist/translations/he/forms.js +0 -1
  828. package/dist/translations/he/layout.js +0 -1
  829. package/dist/translations/he/media.js +0 -1
  830. package/dist/translations/he/overlays.js +0 -1
  831. package/dist/translations/he/retrieval.js +0 -1
  832. package/dist/translations/he/shared.js +0 -1
  833. package/dist/translations/he/utility.js +0 -1
  834. package/dist/translations/he/viewers.js +0 -5
  835. package/dist/translations/he.js +0 -1
  836. package/dist/translations/hi/agent-tools.js +0 -1
  837. package/dist/translations/hi/charts.js +0 -1
  838. package/dist/translations/hi/conversation.js +0 -1
  839. package/dist/translations/hi/data.js +0 -1
  840. package/dist/translations/hi/forms.js +0 -1
  841. package/dist/translations/hi/layout.js +0 -1
  842. package/dist/translations/hi/media.js +0 -1
  843. package/dist/translations/hi/overlays.js +0 -1
  844. package/dist/translations/hi/retrieval.js +0 -1
  845. package/dist/translations/hi/shared.js +0 -1
  846. package/dist/translations/hi/utility.js +0 -1
  847. package/dist/translations/hi/viewers.js +0 -5
  848. package/dist/translations/hi.js +0 -1
  849. package/dist/translations/hr/agent-tools.js +0 -1
  850. package/dist/translations/hr/charts.js +0 -1
  851. package/dist/translations/hr/conversation.js +0 -1
  852. package/dist/translations/hr/data.js +0 -1
  853. package/dist/translations/hr/forms.js +0 -1
  854. package/dist/translations/hr/layout.js +0 -1
  855. package/dist/translations/hr/media.js +0 -1
  856. package/dist/translations/hr/overlays.js +0 -1
  857. package/dist/translations/hr/retrieval.js +0 -1
  858. package/dist/translations/hr/shared.js +0 -1
  859. package/dist/translations/hr/utility.js +0 -1
  860. package/dist/translations/hr/viewers.js +0 -5
  861. package/dist/translations/hr.js +0 -1
  862. package/dist/translations/hu/agent-tools.js +0 -1
  863. package/dist/translations/hu/charts.js +0 -1
  864. package/dist/translations/hu/conversation.js +0 -1
  865. package/dist/translations/hu/data.js +0 -1
  866. package/dist/translations/hu/forms.js +0 -1
  867. package/dist/translations/hu/layout.js +0 -1
  868. package/dist/translations/hu/media.js +0 -1
  869. package/dist/translations/hu/overlays.js +0 -1
  870. package/dist/translations/hu/retrieval.js +0 -1
  871. package/dist/translations/hu/shared.js +0 -1
  872. package/dist/translations/hu/utility.js +0 -1
  873. package/dist/translations/hu/viewers.js +0 -5
  874. package/dist/translations/hu.js +0 -1
  875. package/dist/translations/id/agent-tools.js +0 -1
  876. package/dist/translations/id/charts.js +0 -1
  877. package/dist/translations/id/conversation.js +0 -1
  878. package/dist/translations/id/data.js +0 -1
  879. package/dist/translations/id/forms.js +0 -1
  880. package/dist/translations/id/layout.js +0 -1
  881. package/dist/translations/id/media.js +0 -1
  882. package/dist/translations/id/overlays.js +0 -1
  883. package/dist/translations/id/retrieval.js +0 -1
  884. package/dist/translations/id/shared.js +0 -1
  885. package/dist/translations/id/utility.js +0 -1
  886. package/dist/translations/id/viewers.js +0 -5
  887. package/dist/translations/id.js +0 -1
  888. package/dist/translations/ig/agent-tools.js +0 -1
  889. package/dist/translations/ig/charts.js +0 -1
  890. package/dist/translations/ig/conversation.js +0 -1
  891. package/dist/translations/ig/data.js +0 -1
  892. package/dist/translations/ig/forms.js +0 -1
  893. package/dist/translations/ig/layout.js +0 -1
  894. package/dist/translations/ig/media.js +0 -1
  895. package/dist/translations/ig/overlays.js +0 -1
  896. package/dist/translations/ig/retrieval.js +0 -1
  897. package/dist/translations/ig/shared.js +0 -1
  898. package/dist/translations/ig/utility.js +0 -1
  899. package/dist/translations/ig/viewers.js +0 -5
  900. package/dist/translations/ig.js +0 -1
  901. package/dist/translations/it/agent-tools.js +0 -1
  902. package/dist/translations/it/charts.js +0 -1
  903. package/dist/translations/it/conversation.js +0 -1
  904. package/dist/translations/it/data.js +0 -1
  905. package/dist/translations/it/forms.js +0 -1
  906. package/dist/translations/it/layout.js +0 -1
  907. package/dist/translations/it/media.js +0 -1
  908. package/dist/translations/it/overlays.js +0 -1
  909. package/dist/translations/it/retrieval.js +0 -1
  910. package/dist/translations/it/shared.js +0 -1
  911. package/dist/translations/it/utility.js +0 -1
  912. package/dist/translations/it/viewers.js +0 -5
  913. package/dist/translations/it.js +0 -1
  914. package/dist/translations/ja/agent-tools.js +0 -1
  915. package/dist/translations/ja/charts.js +0 -1
  916. package/dist/translations/ja/conversation.js +0 -1
  917. package/dist/translations/ja/data.js +0 -1
  918. package/dist/translations/ja/forms.js +0 -1
  919. package/dist/translations/ja/layout.js +0 -1
  920. package/dist/translations/ja/media.js +0 -1
  921. package/dist/translations/ja/overlays.js +0 -1
  922. package/dist/translations/ja/retrieval.js +0 -1
  923. package/dist/translations/ja/shared.js +0 -1
  924. package/dist/translations/ja/utility.js +0 -1
  925. package/dist/translations/ja/viewers.js +0 -4
  926. package/dist/translations/ja.js +0 -1
  927. package/dist/translations/jv/agent-tools.js +0 -1
  928. package/dist/translations/jv/charts.js +0 -1
  929. package/dist/translations/jv/conversation.js +0 -1
  930. package/dist/translations/jv/data.js +0 -1
  931. package/dist/translations/jv/forms.js +0 -1
  932. package/dist/translations/jv/layout.js +0 -1
  933. package/dist/translations/jv/media.js +0 -1
  934. package/dist/translations/jv/overlays.js +0 -1
  935. package/dist/translations/jv/retrieval.js +0 -1
  936. package/dist/translations/jv/shared.js +0 -1
  937. package/dist/translations/jv/utility.js +0 -1
  938. package/dist/translations/jv/viewers.js +0 -5
  939. package/dist/translations/jv.js +0 -1
  940. package/dist/translations/kk/agent-tools.js +0 -1
  941. package/dist/translations/kk/charts.js +0 -1
  942. package/dist/translations/kk/conversation.js +0 -1
  943. package/dist/translations/kk/data.js +0 -1
  944. package/dist/translations/kk/forms.js +0 -1
  945. package/dist/translations/kk/layout.js +0 -1
  946. package/dist/translations/kk/media.js +0 -1
  947. package/dist/translations/kk/overlays.js +0 -1
  948. package/dist/translations/kk/retrieval.js +0 -1
  949. package/dist/translations/kk/shared.js +0 -1
  950. package/dist/translations/kk/utility.js +0 -1
  951. package/dist/translations/kk/viewers.js +0 -5
  952. package/dist/translations/kk.js +0 -1
  953. package/dist/translations/kn/agent-tools.js +0 -1
  954. package/dist/translations/kn/charts.js +0 -1
  955. package/dist/translations/kn/conversation.js +0 -1
  956. package/dist/translations/kn/data.js +0 -1
  957. package/dist/translations/kn/forms.js +0 -1
  958. package/dist/translations/kn/layout.js +0 -1
  959. package/dist/translations/kn/media.js +0 -1
  960. package/dist/translations/kn/overlays.js +0 -1
  961. package/dist/translations/kn/retrieval.js +0 -1
  962. package/dist/translations/kn/shared.js +0 -1
  963. package/dist/translations/kn/utility.js +0 -1
  964. package/dist/translations/kn/viewers.js +0 -5
  965. package/dist/translations/kn.js +0 -1
  966. package/dist/translations/ko/agent-tools.js +0 -1
  967. package/dist/translations/ko/charts.js +0 -1
  968. package/dist/translations/ko/conversation.js +0 -1
  969. package/dist/translations/ko/data.js +0 -1
  970. package/dist/translations/ko/forms.js +0 -1
  971. package/dist/translations/ko/layout.js +0 -1
  972. package/dist/translations/ko/media.js +0 -1
  973. package/dist/translations/ko/overlays.js +0 -1
  974. package/dist/translations/ko/retrieval.js +0 -1
  975. package/dist/translations/ko/shared.js +0 -1
  976. package/dist/translations/ko/utility.js +0 -1
  977. package/dist/translations/ko/viewers.js +0 -5
  978. package/dist/translations/ko.js +0 -1
  979. package/dist/translations/ln/agent-tools.js +0 -1
  980. package/dist/translations/ln/charts.js +0 -1
  981. package/dist/translations/ln/conversation.js +0 -1
  982. package/dist/translations/ln/data.js +0 -1
  983. package/dist/translations/ln/forms.js +0 -1
  984. package/dist/translations/ln/layout.js +0 -1
  985. package/dist/translations/ln/media.js +0 -1
  986. package/dist/translations/ln/overlays.js +0 -1
  987. package/dist/translations/ln/retrieval.js +0 -1
  988. package/dist/translations/ln/shared.js +0 -1
  989. package/dist/translations/ln/utility.js +0 -1
  990. package/dist/translations/ln/viewers.js +0 -5
  991. package/dist/translations/ln.js +0 -1
  992. package/dist/translations/ml/agent-tools.js +0 -1
  993. package/dist/translations/ml/charts.js +0 -1
  994. package/dist/translations/ml/conversation.js +0 -1
  995. package/dist/translations/ml/data.js +0 -1
  996. package/dist/translations/ml/forms.js +0 -1
  997. package/dist/translations/ml/layout.js +0 -1
  998. package/dist/translations/ml/media.js +0 -1
  999. package/dist/translations/ml/overlays.js +0 -1
  1000. package/dist/translations/ml/retrieval.js +0 -1
  1001. package/dist/translations/ml/shared.js +0 -1
  1002. package/dist/translations/ml/utility.js +0 -1
  1003. package/dist/translations/ml/viewers.js +0 -5
  1004. package/dist/translations/ml.js +0 -1
  1005. package/dist/translations/mr/agent-tools.js +0 -1
  1006. package/dist/translations/mr/charts.js +0 -1
  1007. package/dist/translations/mr/conversation.js +0 -1
  1008. package/dist/translations/mr/data.js +0 -1
  1009. package/dist/translations/mr/forms.js +0 -1
  1010. package/dist/translations/mr/layout.js +0 -1
  1011. package/dist/translations/mr/media.js +0 -1
  1012. package/dist/translations/mr/overlays.js +0 -1
  1013. package/dist/translations/mr/retrieval.js +0 -1
  1014. package/dist/translations/mr/shared.js +0 -1
  1015. package/dist/translations/mr/utility.js +0 -1
  1016. package/dist/translations/mr/viewers.js +0 -5
  1017. package/dist/translations/mr.js +0 -1
  1018. package/dist/translations/ms/agent-tools.js +0 -1
  1019. package/dist/translations/ms/charts.js +0 -1
  1020. package/dist/translations/ms/conversation.js +0 -1
  1021. package/dist/translations/ms/data.js +0 -1
  1022. package/dist/translations/ms/forms.js +0 -1
  1023. package/dist/translations/ms/layout.js +0 -1
  1024. package/dist/translations/ms/media.js +0 -1
  1025. package/dist/translations/ms/overlays.js +0 -1
  1026. package/dist/translations/ms/retrieval.js +0 -1
  1027. package/dist/translations/ms/shared.js +0 -1
  1028. package/dist/translations/ms/utility.js +0 -1
  1029. package/dist/translations/ms/viewers.js +0 -5
  1030. package/dist/translations/ms.js +0 -1
  1031. package/dist/translations/my/agent-tools.js +0 -1
  1032. package/dist/translations/my/charts.js +0 -1
  1033. package/dist/translations/my/conversation.js +0 -1
  1034. package/dist/translations/my/data.js +0 -1
  1035. package/dist/translations/my/forms.js +0 -1
  1036. package/dist/translations/my/layout.js +0 -1
  1037. package/dist/translations/my/media.js +0 -1
  1038. package/dist/translations/my/overlays.js +0 -1
  1039. package/dist/translations/my/retrieval.js +0 -1
  1040. package/dist/translations/my/shared.js +0 -1
  1041. package/dist/translations/my/utility.js +0 -1
  1042. package/dist/translations/my/viewers.js +0 -5
  1043. package/dist/translations/my.js +0 -1
  1044. package/dist/translations/nb/agent-tools.js +0 -1
  1045. package/dist/translations/nb/charts.js +0 -1
  1046. package/dist/translations/nb/conversation.js +0 -1
  1047. package/dist/translations/nb/data.js +0 -1
  1048. package/dist/translations/nb/forms.js +0 -1
  1049. package/dist/translations/nb/layout.js +0 -1
  1050. package/dist/translations/nb/media.js +0 -1
  1051. package/dist/translations/nb/overlays.js +0 -1
  1052. package/dist/translations/nb/retrieval.js +0 -1
  1053. package/dist/translations/nb/shared.js +0 -1
  1054. package/dist/translations/nb/utility.js +0 -1
  1055. package/dist/translations/nb/viewers.js +0 -5
  1056. package/dist/translations/nb.js +0 -1
  1057. package/dist/translations/ne/agent-tools.js +0 -1
  1058. package/dist/translations/ne/charts.js +0 -1
  1059. package/dist/translations/ne/conversation.js +0 -1
  1060. package/dist/translations/ne/data.js +0 -1
  1061. package/dist/translations/ne/forms.js +0 -1
  1062. package/dist/translations/ne/layout.js +0 -1
  1063. package/dist/translations/ne/media.js +0 -1
  1064. package/dist/translations/ne/overlays.js +0 -1
  1065. package/dist/translations/ne/retrieval.js +0 -1
  1066. package/dist/translations/ne/shared.js +0 -1
  1067. package/dist/translations/ne/utility.js +0 -1
  1068. package/dist/translations/ne/viewers.js +0 -5
  1069. package/dist/translations/ne.js +0 -1
  1070. package/dist/translations/nl/agent-tools.js +0 -1
  1071. package/dist/translations/nl/charts.js +0 -1
  1072. package/dist/translations/nl/conversation.js +0 -1
  1073. package/dist/translations/nl/data.js +0 -1
  1074. package/dist/translations/nl/forms.js +0 -1
  1075. package/dist/translations/nl/layout.js +0 -1
  1076. package/dist/translations/nl/media.js +0 -1
  1077. package/dist/translations/nl/overlays.js +0 -1
  1078. package/dist/translations/nl/retrieval.js +0 -1
  1079. package/dist/translations/nl/shared.js +0 -1
  1080. package/dist/translations/nl/utility.js +0 -1
  1081. package/dist/translations/nl/viewers.js +0 -5
  1082. package/dist/translations/nl.js +0 -1
  1083. package/dist/translations/nn/agent-tools.js +0 -1
  1084. package/dist/translations/nn/charts.js +0 -1
  1085. package/dist/translations/nn/conversation.js +0 -1
  1086. package/dist/translations/nn/data.js +0 -1
  1087. package/dist/translations/nn/forms.js +0 -1
  1088. package/dist/translations/nn/layout.js +0 -1
  1089. package/dist/translations/nn/media.js +0 -1
  1090. package/dist/translations/nn/overlays.js +0 -1
  1091. package/dist/translations/nn/retrieval.js +0 -1
  1092. package/dist/translations/nn/shared.js +0 -1
  1093. package/dist/translations/nn/utility.js +0 -1
  1094. package/dist/translations/nn/viewers.js +0 -5
  1095. package/dist/translations/nn.js +0 -1
  1096. package/dist/translations/om/agent-tools.js +0 -1
  1097. package/dist/translations/om/charts.js +0 -1
  1098. package/dist/translations/om/conversation.js +0 -1
  1099. package/dist/translations/om/data.js +0 -1
  1100. package/dist/translations/om/forms.js +0 -1
  1101. package/dist/translations/om/layout.js +0 -1
  1102. package/dist/translations/om/media.js +0 -1
  1103. package/dist/translations/om/overlays.js +0 -1
  1104. package/dist/translations/om/retrieval.js +0 -1
  1105. package/dist/translations/om/shared.js +0 -1
  1106. package/dist/translations/om/utility.js +0 -1
  1107. package/dist/translations/om/viewers.js +0 -5
  1108. package/dist/translations/om.js +0 -1
  1109. package/dist/translations/or/agent-tools.js +0 -1
  1110. package/dist/translations/or/charts.js +0 -1
  1111. package/dist/translations/or/conversation.js +0 -1
  1112. package/dist/translations/or/data.js +0 -1
  1113. package/dist/translations/or/forms.js +0 -1
  1114. package/dist/translations/or/layout.js +0 -1
  1115. package/dist/translations/or/media.js +0 -1
  1116. package/dist/translations/or/overlays.js +0 -1
  1117. package/dist/translations/or/retrieval.js +0 -1
  1118. package/dist/translations/or/shared.js +0 -1
  1119. package/dist/translations/or/utility.js +0 -1
  1120. package/dist/translations/or/viewers.js +0 -5
  1121. package/dist/translations/or.js +0 -1
  1122. package/dist/translations/pa/agent-tools.js +0 -1
  1123. package/dist/translations/pa/charts.js +0 -1
  1124. package/dist/translations/pa/conversation.js +0 -1
  1125. package/dist/translations/pa/data.js +0 -1
  1126. package/dist/translations/pa/forms.js +0 -1
  1127. package/dist/translations/pa/layout.js +0 -1
  1128. package/dist/translations/pa/media.js +0 -1
  1129. package/dist/translations/pa/overlays.js +0 -1
  1130. package/dist/translations/pa/retrieval.js +0 -1
  1131. package/dist/translations/pa/shared.js +0 -1
  1132. package/dist/translations/pa/utility.js +0 -1
  1133. package/dist/translations/pa/viewers.js +0 -5
  1134. package/dist/translations/pa.js +0 -1
  1135. package/dist/translations/pcm/agent-tools.js +0 -1
  1136. package/dist/translations/pcm/charts.js +0 -1
  1137. package/dist/translations/pcm/conversation.js +0 -1
  1138. package/dist/translations/pcm/data.js +0 -1
  1139. package/dist/translations/pcm/forms.js +0 -1
  1140. package/dist/translations/pcm/layout.js +0 -1
  1141. package/dist/translations/pcm/media.js +0 -1
  1142. package/dist/translations/pcm/overlays.js +0 -1
  1143. package/dist/translations/pcm/retrieval.js +0 -1
  1144. package/dist/translations/pcm/shared.js +0 -1
  1145. package/dist/translations/pcm/utility.js +0 -1
  1146. package/dist/translations/pcm/viewers.js +0 -5
  1147. package/dist/translations/pcm.js +0 -1
  1148. package/dist/translations/pl/agent-tools.js +0 -1
  1149. package/dist/translations/pl/charts.js +0 -1
  1150. package/dist/translations/pl/conversation.js +0 -1
  1151. package/dist/translations/pl/data.js +0 -1
  1152. package/dist/translations/pl/forms.js +0 -1
  1153. package/dist/translations/pl/layout.js +0 -1
  1154. package/dist/translations/pl/media.js +0 -1
  1155. package/dist/translations/pl/overlays.js +0 -1
  1156. package/dist/translations/pl/retrieval.js +0 -1
  1157. package/dist/translations/pl/shared.js +0 -1
  1158. package/dist/translations/pl/utility.js +0 -1
  1159. package/dist/translations/pl/viewers.js +0 -5
  1160. package/dist/translations/pl.js +0 -1
  1161. package/dist/translations/pnb/agent-tools.js +0 -1
  1162. package/dist/translations/pnb/charts.js +0 -1
  1163. package/dist/translations/pnb/conversation.js +0 -1
  1164. package/dist/translations/pnb/data.js +0 -1
  1165. package/dist/translations/pnb/forms.js +0 -1
  1166. package/dist/translations/pnb/layout.js +0 -1
  1167. package/dist/translations/pnb/media.js +0 -1
  1168. package/dist/translations/pnb/overlays.js +0 -1
  1169. package/dist/translations/pnb/retrieval.js +0 -1
  1170. package/dist/translations/pnb/shared.js +0 -1
  1171. package/dist/translations/pnb/utility.js +0 -1
  1172. package/dist/translations/pnb/viewers.js +0 -5
  1173. package/dist/translations/pnb.js +0 -1
  1174. package/dist/translations/ps/agent-tools.js +0 -1
  1175. package/dist/translations/ps/charts.js +0 -1
  1176. package/dist/translations/ps/conversation.js +0 -1
  1177. package/dist/translations/ps/data.js +0 -1
  1178. package/dist/translations/ps/forms.js +0 -1
  1179. package/dist/translations/ps/layout.js +0 -1
  1180. package/dist/translations/ps/media.js +0 -1
  1181. package/dist/translations/ps/overlays.js +0 -1
  1182. package/dist/translations/ps/retrieval.js +0 -1
  1183. package/dist/translations/ps/shared.js +0 -1
  1184. package/dist/translations/ps/utility.js +0 -1
  1185. package/dist/translations/ps/viewers.js +0 -5
  1186. package/dist/translations/ps.js +0 -1
  1187. package/dist/translations/pt-BR/agent-tools.js +0 -1
  1188. package/dist/translations/pt-BR/charts.js +0 -1
  1189. package/dist/translations/pt-BR/conversation.js +0 -1
  1190. package/dist/translations/pt-BR/data.js +0 -1
  1191. package/dist/translations/pt-BR/forms.js +0 -1
  1192. package/dist/translations/pt-BR/layout.js +0 -1
  1193. package/dist/translations/pt-BR/media.js +0 -1
  1194. package/dist/translations/pt-BR/overlays.js +0 -1
  1195. package/dist/translations/pt-BR/retrieval.js +0 -1
  1196. package/dist/translations/pt-BR/shared.js +0 -1
  1197. package/dist/translations/pt-BR/utility.js +0 -1
  1198. package/dist/translations/pt-BR/viewers.js +0 -5
  1199. package/dist/translations/pt-BR.js +0 -1
  1200. package/dist/translations/pt-PT/agent-tools.js +0 -1
  1201. package/dist/translations/pt-PT/charts.js +0 -1
  1202. package/dist/translations/pt-PT/conversation.js +0 -1
  1203. package/dist/translations/pt-PT/data.js +0 -1
  1204. package/dist/translations/pt-PT/forms.js +0 -1
  1205. package/dist/translations/pt-PT/layout.js +0 -1
  1206. package/dist/translations/pt-PT/media.js +0 -1
  1207. package/dist/translations/pt-PT/overlays.js +0 -1
  1208. package/dist/translations/pt-PT/retrieval.js +0 -1
  1209. package/dist/translations/pt-PT/shared.js +0 -1
  1210. package/dist/translations/pt-PT/utility.js +0 -1
  1211. package/dist/translations/pt-PT/viewers.js +0 -5
  1212. package/dist/translations/pt-PT.js +0 -1
  1213. package/dist/translations/ro/agent-tools.js +0 -1
  1214. package/dist/translations/ro/charts.js +0 -1
  1215. package/dist/translations/ro/conversation.js +0 -1
  1216. package/dist/translations/ro/data.js +0 -1
  1217. package/dist/translations/ro/forms.js +0 -1
  1218. package/dist/translations/ro/layout.js +0 -1
  1219. package/dist/translations/ro/media.js +0 -1
  1220. package/dist/translations/ro/overlays.js +0 -1
  1221. package/dist/translations/ro/retrieval.js +0 -1
  1222. package/dist/translations/ro/shared.js +0 -1
  1223. package/dist/translations/ro/utility.js +0 -1
  1224. package/dist/translations/ro/viewers.js +0 -5
  1225. package/dist/translations/ro.js +0 -1
  1226. package/dist/translations/ru/agent-tools.js +0 -1
  1227. package/dist/translations/ru/charts.js +0 -1
  1228. package/dist/translations/ru/conversation.js +0 -1
  1229. package/dist/translations/ru/data.js +0 -1
  1230. package/dist/translations/ru/forms.js +0 -1
  1231. package/dist/translations/ru/layout.js +0 -1
  1232. package/dist/translations/ru/media.js +0 -1
  1233. package/dist/translations/ru/overlays.js +0 -1
  1234. package/dist/translations/ru/retrieval.js +0 -1
  1235. package/dist/translations/ru/shared.js +0 -1
  1236. package/dist/translations/ru/utility.js +0 -1
  1237. package/dist/translations/ru/viewers.js +0 -5
  1238. package/dist/translations/ru.js +0 -1
  1239. package/dist/translations/sd/agent-tools.js +0 -1
  1240. package/dist/translations/sd/charts.js +0 -1
  1241. package/dist/translations/sd/conversation.js +0 -1
  1242. package/dist/translations/sd/data.js +0 -1
  1243. package/dist/translations/sd/forms.js +0 -1
  1244. package/dist/translations/sd/layout.js +0 -1
  1245. package/dist/translations/sd/media.js +0 -1
  1246. package/dist/translations/sd/overlays.js +0 -1
  1247. package/dist/translations/sd/retrieval.js +0 -1
  1248. package/dist/translations/sd/shared.js +0 -1
  1249. package/dist/translations/sd/utility.js +0 -1
  1250. package/dist/translations/sd/viewers.js +0 -5
  1251. package/dist/translations/sd.js +0 -1
  1252. package/dist/translations/sl/agent-tools.js +0 -1
  1253. package/dist/translations/sl/charts.js +0 -1
  1254. package/dist/translations/sl/conversation.js +0 -1
  1255. package/dist/translations/sl/data.js +0 -1
  1256. package/dist/translations/sl/forms.js +0 -1
  1257. package/dist/translations/sl/layout.js +0 -1
  1258. package/dist/translations/sl/media.js +0 -1
  1259. package/dist/translations/sl/overlays.js +0 -1
  1260. package/dist/translations/sl/retrieval.js +0 -1
  1261. package/dist/translations/sl/shared.js +0 -1
  1262. package/dist/translations/sl/utility.js +0 -1
  1263. package/dist/translations/sl/viewers.js +0 -5
  1264. package/dist/translations/sl.js +0 -1
  1265. package/dist/translations/su/agent-tools.js +0 -1
  1266. package/dist/translations/su/charts.js +0 -1
  1267. package/dist/translations/su/conversation.js +0 -1
  1268. package/dist/translations/su/data.js +0 -1
  1269. package/dist/translations/su/forms.js +0 -1
  1270. package/dist/translations/su/layout.js +0 -1
  1271. package/dist/translations/su/media.js +0 -1
  1272. package/dist/translations/su/overlays.js +0 -1
  1273. package/dist/translations/su/retrieval.js +0 -1
  1274. package/dist/translations/su/shared.js +0 -1
  1275. package/dist/translations/su/utility.js +0 -1
  1276. package/dist/translations/su/viewers.js +0 -5
  1277. package/dist/translations/su.js +0 -1
  1278. package/dist/translations/sv/agent-tools.js +0 -1
  1279. package/dist/translations/sv/charts.js +0 -1
  1280. package/dist/translations/sv/conversation.js +0 -1
  1281. package/dist/translations/sv/data.js +0 -1
  1282. package/dist/translations/sv/forms.js +0 -1
  1283. package/dist/translations/sv/layout.js +0 -1
  1284. package/dist/translations/sv/media.js +0 -1
  1285. package/dist/translations/sv/overlays.js +0 -1
  1286. package/dist/translations/sv/retrieval.js +0 -1
  1287. package/dist/translations/sv/shared.js +0 -1
  1288. package/dist/translations/sv/utility.js +0 -1
  1289. package/dist/translations/sv/viewers.js +0 -5
  1290. package/dist/translations/sv.js +0 -1
  1291. package/dist/translations/sw/agent-tools.js +0 -1
  1292. package/dist/translations/sw/charts.js +0 -1
  1293. package/dist/translations/sw/conversation.js +0 -1
  1294. package/dist/translations/sw/data.js +0 -1
  1295. package/dist/translations/sw/forms.js +0 -1
  1296. package/dist/translations/sw/layout.js +0 -1
  1297. package/dist/translations/sw/media.js +0 -1
  1298. package/dist/translations/sw/overlays.js +0 -1
  1299. package/dist/translations/sw/retrieval.js +0 -1
  1300. package/dist/translations/sw/shared.js +0 -1
  1301. package/dist/translations/sw/utility.js +0 -1
  1302. package/dist/translations/sw/viewers.js +0 -5
  1303. package/dist/translations/sw.js +0 -1
  1304. package/dist/translations/ta/agent-tools.js +0 -1
  1305. package/dist/translations/ta/charts.js +0 -1
  1306. package/dist/translations/ta/conversation.js +0 -1
  1307. package/dist/translations/ta/data.js +0 -1
  1308. package/dist/translations/ta/forms.js +0 -1
  1309. package/dist/translations/ta/layout.js +0 -1
  1310. package/dist/translations/ta/media.js +0 -1
  1311. package/dist/translations/ta/overlays.js +0 -1
  1312. package/dist/translations/ta/retrieval.js +0 -1
  1313. package/dist/translations/ta/shared.js +0 -1
  1314. package/dist/translations/ta/utility.js +0 -1
  1315. package/dist/translations/ta/viewers.js +0 -5
  1316. package/dist/translations/ta.js +0 -1
  1317. package/dist/translations/te/agent-tools.js +0 -1
  1318. package/dist/translations/te/charts.js +0 -1
  1319. package/dist/translations/te/conversation.js +0 -1
  1320. package/dist/translations/te/data.js +0 -1
  1321. package/dist/translations/te/forms.js +0 -1
  1322. package/dist/translations/te/layout.js +0 -1
  1323. package/dist/translations/te/media.js +0 -1
  1324. package/dist/translations/te/overlays.js +0 -1
  1325. package/dist/translations/te/retrieval.js +0 -1
  1326. package/dist/translations/te/shared.js +0 -1
  1327. package/dist/translations/te/utility.js +0 -1
  1328. package/dist/translations/te/viewers.js +0 -5
  1329. package/dist/translations/te.js +0 -1
  1330. package/dist/translations/th/agent-tools.js +0 -1
  1331. package/dist/translations/th/charts.js +0 -1
  1332. package/dist/translations/th/conversation.js +0 -1
  1333. package/dist/translations/th/data.js +0 -1
  1334. package/dist/translations/th/forms.js +0 -1
  1335. package/dist/translations/th/layout.js +0 -1
  1336. package/dist/translations/th/media.js +0 -1
  1337. package/dist/translations/th/overlays.js +0 -1
  1338. package/dist/translations/th/retrieval.js +0 -1
  1339. package/dist/translations/th/shared.js +0 -1
  1340. package/dist/translations/th/utility.js +0 -1
  1341. package/dist/translations/th/viewers.js +0 -5
  1342. package/dist/translations/th.js +0 -1
  1343. package/dist/translations/tl/agent-tools.js +0 -1
  1344. package/dist/translations/tl/charts.js +0 -1
  1345. package/dist/translations/tl/conversation.js +0 -1
  1346. package/dist/translations/tl/data.js +0 -1
  1347. package/dist/translations/tl/forms.js +0 -1
  1348. package/dist/translations/tl/layout.js +0 -1
  1349. package/dist/translations/tl/media.js +0 -1
  1350. package/dist/translations/tl/overlays.js +0 -1
  1351. package/dist/translations/tl/retrieval.js +0 -1
  1352. package/dist/translations/tl/shared.js +0 -1
  1353. package/dist/translations/tl/utility.js +0 -1
  1354. package/dist/translations/tl/viewers.js +0 -5
  1355. package/dist/translations/tl.js +0 -1
  1356. package/dist/translations/tr/agent-tools.js +0 -1
  1357. package/dist/translations/tr/charts.js +0 -1
  1358. package/dist/translations/tr/conversation.js +0 -1
  1359. package/dist/translations/tr/data.js +0 -1
  1360. package/dist/translations/tr/forms.js +0 -1
  1361. package/dist/translations/tr/layout.js +0 -1
  1362. package/dist/translations/tr/media.js +0 -1
  1363. package/dist/translations/tr/overlays.js +0 -1
  1364. package/dist/translations/tr/retrieval.js +0 -1
  1365. package/dist/translations/tr/shared.js +0 -1
  1366. package/dist/translations/tr/utility.js +0 -1
  1367. package/dist/translations/tr/viewers.js +0 -5
  1368. package/dist/translations/tr.js +0 -1
  1369. package/dist/translations/uk/agent-tools.js +0 -1
  1370. package/dist/translations/uk/charts.js +0 -1
  1371. package/dist/translations/uk/conversation.js +0 -1
  1372. package/dist/translations/uk/data.js +0 -1
  1373. package/dist/translations/uk/forms.js +0 -1
  1374. package/dist/translations/uk/layout.js +0 -1
  1375. package/dist/translations/uk/media.js +0 -1
  1376. package/dist/translations/uk/overlays.js +0 -1
  1377. package/dist/translations/uk/retrieval.js +0 -1
  1378. package/dist/translations/uk/shared.js +0 -1
  1379. package/dist/translations/uk/utility.js +0 -1
  1380. package/dist/translations/uk/viewers.js +0 -5
  1381. package/dist/translations/uk.js +0 -1
  1382. package/dist/translations/ur/agent-tools.js +0 -1
  1383. package/dist/translations/ur/charts.js +0 -1
  1384. package/dist/translations/ur/conversation.js +0 -1
  1385. package/dist/translations/ur/data.js +0 -1
  1386. package/dist/translations/ur/forms.js +0 -1
  1387. package/dist/translations/ur/layout.js +0 -1
  1388. package/dist/translations/ur/media.js +0 -1
  1389. package/dist/translations/ur/overlays.js +0 -1
  1390. package/dist/translations/ur/retrieval.js +0 -1
  1391. package/dist/translations/ur/shared.js +0 -1
  1392. package/dist/translations/ur/utility.js +0 -1
  1393. package/dist/translations/ur/viewers.js +0 -5
  1394. package/dist/translations/ur.js +0 -1
  1395. package/dist/translations/uz/agent-tools.js +0 -1
  1396. package/dist/translations/uz/charts.js +0 -1
  1397. package/dist/translations/uz/conversation.js +0 -1
  1398. package/dist/translations/uz/data.js +0 -1
  1399. package/dist/translations/uz/forms.js +0 -1
  1400. package/dist/translations/uz/layout.js +0 -1
  1401. package/dist/translations/uz/media.js +0 -1
  1402. package/dist/translations/uz/overlays.js +0 -1
  1403. package/dist/translations/uz/retrieval.js +0 -1
  1404. package/dist/translations/uz/shared.js +0 -1
  1405. package/dist/translations/uz/utility.js +0 -1
  1406. package/dist/translations/uz/viewers.js +0 -5
  1407. package/dist/translations/uz.js +0 -1
  1408. package/dist/translations/vi/agent-tools.js +0 -1
  1409. package/dist/translations/vi/charts.js +0 -1
  1410. package/dist/translations/vi/conversation.js +0 -1
  1411. package/dist/translations/vi/data.js +0 -1
  1412. package/dist/translations/vi/forms.js +0 -1
  1413. package/dist/translations/vi/layout.js +0 -1
  1414. package/dist/translations/vi/media.js +0 -1
  1415. package/dist/translations/vi/overlays.js +0 -1
  1416. package/dist/translations/vi/retrieval.js +0 -1
  1417. package/dist/translations/vi/shared.js +0 -1
  1418. package/dist/translations/vi/utility.js +0 -1
  1419. package/dist/translations/vi/viewers.js +0 -5
  1420. package/dist/translations/vi.js +0 -1
  1421. package/dist/translations/yo/agent-tools.js +0 -1
  1422. package/dist/translations/yo/charts.js +0 -1
  1423. package/dist/translations/yo/conversation.js +0 -1
  1424. package/dist/translations/yo/data.js +0 -1
  1425. package/dist/translations/yo/forms.js +0 -1
  1426. package/dist/translations/yo/layout.js +0 -1
  1427. package/dist/translations/yo/media.js +0 -1
  1428. package/dist/translations/yo/overlays.js +0 -1
  1429. package/dist/translations/yo/retrieval.js +0 -1
  1430. package/dist/translations/yo/shared.js +0 -1
  1431. package/dist/translations/yo/utility.js +0 -1
  1432. package/dist/translations/yo/viewers.js +0 -5
  1433. package/dist/translations/yo.js +0 -1
  1434. package/dist/translations/zh-CN/agent-tools.js +0 -1
  1435. package/dist/translations/zh-CN/charts.js +0 -1
  1436. package/dist/translations/zh-CN/conversation.js +0 -1
  1437. package/dist/translations/zh-CN/data.js +0 -1
  1438. package/dist/translations/zh-CN/forms.js +0 -1
  1439. package/dist/translations/zh-CN/layout.js +0 -1
  1440. package/dist/translations/zh-CN/media.js +0 -1
  1441. package/dist/translations/zh-CN/overlays.js +0 -1
  1442. package/dist/translations/zh-CN/retrieval.js +0 -1
  1443. package/dist/translations/zh-CN/shared.js +0 -1
  1444. package/dist/translations/zh-CN/utility.js +0 -1
  1445. package/dist/translations/zh-CN/viewers.js +0 -5
  1446. package/dist/translations/zh-CN.js +0 -1
  1447. package/dist/translations/zh-TW/agent-tools.js +0 -1
  1448. package/dist/translations/zh-TW/charts.js +0 -1
  1449. package/dist/translations/zh-TW/conversation.js +0 -1
  1450. package/dist/translations/zh-TW/data.js +0 -1
  1451. package/dist/translations/zh-TW/forms.js +0 -1
  1452. package/dist/translations/zh-TW/layout.js +0 -1
  1453. package/dist/translations/zh-TW/media.js +0 -1
  1454. package/dist/translations/zh-TW/overlays.js +0 -1
  1455. package/dist/translations/zh-TW/retrieval.js +0 -1
  1456. package/dist/translations/zh-TW/shared.js +0 -1
  1457. package/dist/translations/zh-TW/utility.js +0 -1
  1458. package/dist/translations/zh-TW/viewers.js +0 -5
  1459. package/dist/translations/zh-TW.js +0 -1
  1460. package/dist/translations/zu/agent-tools.js +0 -1
  1461. package/dist/translations/zu/charts.js +0 -1
  1462. package/dist/translations/zu/conversation.js +0 -1
  1463. package/dist/translations/zu/data.js +0 -1
  1464. package/dist/translations/zu/forms.js +0 -1
  1465. package/dist/translations/zu/layout.js +0 -1
  1466. package/dist/translations/zu/media.js +0 -1
  1467. package/dist/translations/zu/overlays.js +0 -1
  1468. package/dist/translations/zu/retrieval.js +0 -1
  1469. package/dist/translations/zu/shared.js +0 -1
  1470. package/dist/translations/zu/utility.js +0 -1
  1471. package/dist/translations/zu/viewers.js +0 -5
  1472. package/dist/translations/zu.js +0 -1
  1473. package/vscode-css-data.json +0 -1
  1474. package/vscode-html-data.json +0 -1
  1475. package/web-types.json +0 -1
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{eventCollectionSupport}from"../../../internal/collection-snapshot.js";import{html}from"lit";import{property,state}from"lit/decorators.js";import{applyComposedFocusRepair,captureComposedFocusRepair,collectComposedFocusTargets}from"../../../internal/focus-navigation.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{LyraElement}from"../../../internal/lyra-element.js";import{literalSetConverter}from"../../../internal/converters.js";import{tag}from"../../../internal/prefix.js";import{observeScrollOverflow,SCROLL_OVERFLOW_ATTRIBUTE}from"../../../internal/scroll-overflow.js";import{activeElementIn}from"../../../internal/active-element.js";import{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION,isTimelineClusterItemContract,timeValueChanged}from"./timeline-cluster.js";import{scrollOverflowFadeStyles}from"../../../internal/scroll-overflow.styles.js";import{styles}from"./timeline.styles.js";import{LYRA_DEFAULT_timeline,LYRA_DEFAULT_timelineClusterCount}from"../../../internal/default-strings.generated.js";const TIMELINE_ORIENTATION=literalSetConverter(["vertical","horizontal"],"vertical");function isUsableActiveElement(value){if(typeof value!="object"&&typeof value!="function"||value===null)return!1;try{const candidate=value;if(candidate.nodeType!==1)return!1;const NodeConstructor=candidate.ownerDocument?.defaultView?.Node??(typeof Node>"u"?void 0:Node);return NodeConstructor?(NodeConstructor.prototype.getRootNode.call(candidate),!0):!1}catch{return!1}}function safelyDeepActiveElement(root){const initial=activeElementIn(root);if(!isUsableActiveElement(initial))return null;let active=initial;for(;;){let shadowRoot;try{shadowRoot=active.shadowRoot}catch{return null}if(!shadowRoot)return active;const nested=activeElementIn(shadowRoot);if(nested===null)return active;if(!isUsableActiveElement(nested))return null;active=nested}}function safelyContainsActive(container,candidate){if(!isUsableActiveElement(candidate))return!1;try{return container.contains(candidate)}catch{return!1}}const TIMELINE_SCALE=literalSetConverter(["flow","time"],"flow"),TIMELINE_COLLISION=literalSetConverter(["overlap","stack","cluster"],"overlap"),EMPTY_TIMELINE_CLUSTERS=Object.freeze([]),CLUSTER_HIDDEN_ATTRIBUTE="data-lr-timeline-cluster-hidden",TIMELINE_COLLISION_THRESHOLD=.015;function timelineEpochMs(raw){if(raw==null)return null;const ms=(raw instanceof Date?raw:typeof raw=="number"?new Date(raw):new Date(String(raw))).getTime();return Number.isFinite(ms)?ms:null}function itemEpochMs(element){return timelineEpochMs(element.timestamp)}class LyraTimeline extends LyraElement{constructor(){super(...arguments),this._orientation="vertical",this._scale="flow",this._collision="overlap",this.slottedCount=0,this.collisionClusters=EMPTY_TIMELINE_CLUSTERS,this.managedClusterHiddenItems=new Set,this.managedClusterRepresentatives=new Set,this.clusterActivations=new Map,this.timestampObservedItems=new Set,this.focusRepairGeneration=0,this.scrollOverflow=observeScrollOverflow(this,()=>this.renderRoot.querySelector('[part="base"]'),()=>{this.scheduleTimeExtentMeasurement(),this.scale==="time"&&this.collision==="cluster"&&this.scheduleClusterMeasurement(),this.syncScrollTabStop()}),this.onSlotChange=e=>{this.updateBrowserDerivedState(()=>{this.slottedCount=this.countTimelineItems(e.target),this.applyTimeScale()})},this.onTimelineItemTimestampChange=()=>{this.isConnected&&this.scheduleAfterUpdate(()=>this.applyTimeScale(),"timeline-item-timestamps")}}static{this.defaultStrings={...super.defaultStrings,timeline:LYRA_DEFAULT_timeline,timelineClusterCount:LYRA_DEFAULT_timelineClusterCount}}static{this.collectionSupport=eventCollectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-cluster-activate"])}static{this.identityEventDetailProperties=Object.freeze({"lr-cluster-activate":Object.freeze(["items"])})}static{this.styles=[LyraElement.styles,scrollOverflowFadeStyles,styles]}get orientation(){return this._orientation}set orientation(value){const normalized=TIMELINE_ORIENTATION.normalizeReflected(this,"orientation",value),previous=this._orientation;previous!==normalized&&(this._orientation=normalized,this.requestUpdate("orientation",previous))}get scale(){return this._scale}set scale(value){const normalized=TIMELINE_SCALE.normalizeReflected(this,"scale",value),previous=this._scale;previous!==normalized&&(this._scale=normalized,this.requestUpdate("scale",previous))}get collision(){return this._collision}set collision(value){const normalized=TIMELINE_COLLISION.normalizeReflected(this,"collision",value),previous=this._collision;previous!==normalized&&(this._collision=normalized,this.requestUpdate("collision",previous))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.scheduleAfterUpdate(()=>this.applyTimeScale(),"timeline-clusters")}disconnectedCallback(){this.cancelClusterMeasurement(),this.cancelTimeExtentMeasurement(),this.focusRepairGeneration+=1,this.restoreClusterPresentation(),this.restoreClusterVisibility(),this.syncTimestampObservers([]),this.collisionClusters.length>0&&(this.collisionClusters=EMPTY_TIMELINE_CLUSTERS),super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed),this.hasUpdated||(this.slottedCount=Array.from(this.children).filter(element=>!element.getAttribute("slot")&&element.localName===tag("timeline-item")).length),this.hasUpdated?(changed.has("scale")||changed.has("collision")||changed.has("rangeStart")||changed.has("rangeEnd"))&&this.applyTimeScale():this.seedFirstRenderState(()=>this.applyTimeScale())}updated(changed){super.updated(changed),this.scrollOverflow.observeExtra(this.timelineItems()),this.syncScrollTabStop(),this.scheduleTimeExtentMeasurement(),(changed.has("collisionClusters")||changed.has("orientation"))&&this.collisionClusters.length>0&&this.scheduleAfterUpdate(()=>this.applyTimeScale(),"timeline-cluster-measurement"),this.collisionClusters.length>0&&this.syncClusterPresentations(this.collisionClusters)}syncScrollTabStop(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;const reachableOnlyByScrolling=this.orientation==="horizontal"&&base.hasAttribute(SCROLL_OVERFLOW_ATTRIBUTE);base.setAttribute("tabindex",reachableOnlyByScrolling?"0":"-1")}countTimelineItems(slot){return slot.assignedElements({flatten:!0}).filter(element=>element.localName===tag("timeline-item")).length}firstUpdated(changed){super.firstUpdated(changed),this.scheduleAfterUpdate(()=>this.updateBrowserDerivedState(()=>{const slot=this.shadowRoot.querySelector("slot");this.slottedCount=this.countTimelineItems(slot),this.applyTimeScale()}),"timeline-first-slot-reconciliation")}get itemCount(){return this.slottedCount}syncTimestampObservers(items){const current=new Set(items);for(const item of this.timestampObservedItems)current.has(item)||(isTimelineClusterItemContract(item)&&item[OBSERVE_TIMELINE_ITEM_TIMESTAMP](this.onTimelineItemTimestampChange,!1),this.timestampObservedItems.delete(item));for(const item of current)this.timestampObservedItems.has(item)||isTimelineClusterItemContract(item)&&(item[OBSERVE_TIMELINE_ITEM_TIMESTAMP](this.onTimelineItemTimestampChange,!0),this.timestampObservedItems.add(item))}timelineItems(){const slot=this.shadowRoot?.querySelector("slot");return(slot?slot.assignedElements({flatten:!0}):Array.from(this.children).filter(element=>!element.getAttribute("slot"))).filter(element=>element.localName===tag("timeline-item"))}timeRange(stamps){const pinnedStart=timelineEpochMs(this.rangeStart),pinnedEnd=timelineEpochMs(this.rangeEnd);if(pinnedStart!==null&&pinnedEnd!==null&&pinnedEnd>pinnedStart)return[pinnedStart,pinnedEnd];const finite=stamps.filter(value=>value!==null);if(finite.length<2)return null;const lo=Math.min(...finite),hi=Math.max(...finite);return hi>lo?[lo,hi]:null}applyTimeScale(){this.scheduleTimeExtentMeasurement();const items=this.timelineItems();if(this.syncTimestampObservers(items),this.scale!=="time"){for(const item of items)item.style.removeProperty("--_lr-timeline-item-offset"),item.style.removeProperty("--_lr-timeline-item-lane");this.applyCollisionClusters([]);return}const stamps=items.map(item=>itemEpochMs(item)),range=this.timeRange(stamps),lastIndex=Math.max(1,items.length-1),offsets=new Array(items.length).fill(0);items.forEach((item,index)=>{const stamp=stamps[index]??null,ratio=range&&stamp!==null?(stamp-range[0])/(range[1]-range[0]):this.collision==="cluster"&&stamp!==null?0:index/lastIndex,clamped=Math.min(1,Math.max(0,ratio));offsets[index]=clamped,item.style.setProperty("--_lr-timeline-item-offset",`${clamped*100}%`)}),this.applyCollisionLanes(items,offsets),this.applyCollisionClusters(this.collision==="cluster"?this.buildCollisionClusters(items,offsets,this.clusterCollisionThreshold()):[])}applyCollisionLanes(items,offsets){if(this.collision!=="stack"){for(const item of items)item.style.removeProperty("--_lr-timeline-item-lane");return}const order=items.map((_,index)=>index).sort((a,b)=>(offsets[a]??0)-(offsets[b]??0)),laneTails=[],lanes=new Array(items.length).fill(0);for(const index of order){const offset=offsets[index]??0;let lane=laneTails.findIndex(tail=>offset-tail>=TIMELINE_COLLISION_THRESHOLD);lane===-1&&(lane=laneTails.length),laneTails[lane]=offset,lanes[index]=lane}items.forEach((item,index)=>{item.style.setProperty("--_lr-timeline-item-lane",String(lanes[index]??0))})}buildCollisionClusters(items,offsets,threshold){const order=items.map((_,index)=>index).sort((a,b)=>(offsets[a]??0)-(offsets[b]??0)||a-b),clusters=[];let window=[],windowStart=0;const flush=()=>{if(window.length<2){window=[];return}const memberIndexes=[...window].sort((a,b)=>a-b);clusters.push({offset:windowStart,items:memberIndexes.map(index=>items[index])}),window=[]};for(const index of order){const offset=offsets[index]??0;window.length>0&&offset-windowStart>=threshold&&flush(),window.length===0&&(windowStart=offset),window.push(index)}return flush(),clusters}clusterCollisionThreshold(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return TIMELINE_COLLISION_THRESHOLD;const axisExtent=this.orientation==="horizontal"?base.clientWidth:base.clientHeight;if(!Number.isFinite(axisExtent)||axisExtent<=0)return TIMELINE_COLLISION_THRESHOLD;let markerExtent=0;for(const item of this.managedClusterRepresentatives){const marker=item.shadowRoot?.querySelector('[part="cluster"]');if(!marker)continue;const rect=marker.getBoundingClientRect();markerExtent=Math.max(markerExtent,this.orientation==="horizontal"?rect.width:rect.height)}return!Number.isFinite(markerExtent)||markerExtent<=0?TIMELINE_COLLISION_THRESHOLD:Math.max(TIMELINE_COLLISION_THRESHOLD,markerExtent/axisExtent)}scheduleTimeExtentMeasurement(){const view=this.ownerDocument?.defaultView;view&&(this.timeExtentFrame!==void 0&&this.timeExtentView===view||(this.cancelTimeExtentMeasurement(),this.timeExtentView=view,this.timeExtentFrame=view.requestAnimationFrame(()=>{if(this.timeExtentFrame=void 0,this.timeExtentView=void 0,!this.isConnected||this.ownerDocument.defaultView!==view)return;const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;let overhang=0;if(this.scale==="time"&&this.orientation!=="horizontal"){const bottom=base.getBoundingClientRect().bottom;for(const item of this.timelineItems())item.getClientRects().length&&(overhang=Math.max(overhang,item.getBoundingClientRect().bottom-bottom))}const trailing=`${Math.ceil(overhang)}px`;if(base.style.getPropertyValue("--_lr-timeline-trailing-extent")!==trailing&&base.style.setProperty("--_lr-timeline-trailing-extent",trailing),this.scale!=="time"||this.orientation!=="horizontal"||this.collision==="cluster"){base.style.removeProperty("--_lr-timeline-content-height");return}let extent=0;for(const item of this.timelineItems())item.getClientRects().length&&(extent=Math.max(extent,item.offsetTop+item.offsetHeight+1));const height=`${extent+Math.max(0,base.offsetHeight-base.clientHeight)}px`;base.style.getPropertyValue("--_lr-timeline-content-height")!==height&&base.style.setProperty("--_lr-timeline-content-height",height)})))}cancelTimeExtentMeasurement(){this.timeExtentFrame!==void 0&&this.timeExtentView&&this.timeExtentView.cancelAnimationFrame(this.timeExtentFrame),this.timeExtentFrame=void 0,this.timeExtentView=void 0}scheduleClusterMeasurement(){const view=this.ownerDocument.defaultView;view&&(this.clusterMeasurementFrame!==void 0&&this.clusterMeasurementView===view||(this.cancelClusterMeasurement(),this.clusterMeasurementView=view,this.clusterMeasurementFrame=view.requestAnimationFrame(()=>{this.clusterMeasurementFrame=void 0,this.clusterMeasurementView=void 0,this.isConnected&&this.ownerDocument.defaultView===view&&this.scale==="time"&&this.collision==="cluster"&&this.applyTimeScale()})))}cancelClusterMeasurement(){this.clusterMeasurementFrame!==void 0&&this.clusterMeasurementView&&this.clusterMeasurementView.cancelAnimationFrame(this.clusterMeasurementFrame),this.clusterMeasurementFrame=void 0,this.clusterMeasurementView=void 0}sameClusters(left,right){return left.length===right.length&&left.every((cluster,index)=>cluster.offset===right[index]?.offset&&cluster.items.length===right[index]?.items.length&&cluster.items.every((item,itemIndex)=>item===right[index]?.items[itemIndex]))}captureClusterFocusRepair(clusters){const active=safelyDeepActiveElement(this.ownerDocument);if(!active)return;const focusedItem=this.timelineItems().find(item=>item===active||safelyContainsActive(item,active)||safelyDeepActiveElement(item.shadowRoot)===active);if(!focusedItem)return;const wasRepresentative=this.managedClusterRepresentatives.has(focusedItem),nextCluster=clusters.find(cluster=>cluster.items.includes(focusedItem)),nextRepresentative=nextCluster?.items[0],mode=nextCluster?"cluster":"item";if(mode==="cluster"&&wasRepresentative&&nextRepresentative===focusedItem||mode==="item"&&!wasRepresentative)return;const base=this.renderRoot.querySelector('[part="base"]');let snapshot;try{snapshot=captureComposedFocusRepair(focusedItem,base)}catch{return}if(snapshot)return{item:mode==="cluster"?nextRepresentative:focusedItem,mode,snapshot}}scheduleClusterFocusRepair(repair){const generation=++this.focusRepairGeneration;repair&&repair.item.updateComplete.then(()=>{if(generation!==this.focusRepairGeneration||!this.isConnected)return;const base=this.renderRoot.querySelector('[part="base"]'),target=repair.mode==="cluster"?repair.item.shadowRoot?.querySelector('[part="cluster"]')??null:collectComposedFocusTargets(repair.item).elements[0]??base;try{applyComposedFocusRepair(repair.snapshot,target)}catch{}})}applyCollisionClusters(clusters){const frozen=Object.freeze(clusters.map(cluster=>Object.freeze({offset:cluster.offset,items:Object.freeze([...cluster.items])}))),changed=!this.sameClusters(this.collisionClusters,frozen),focusRepair=changed?this.captureClusterFocusRepair(frozen):void 0,representatives=new Set(frozen.map(cluster=>cluster.items[0])),hiddenItems=new Set(frozen.flatMap(cluster=>cluster.items.filter(item=>!representatives.has(item))));for(const item of this.managedClusterHiddenItems){if(hiddenItems.has(item)){item.hasAttribute(CLUSTER_HIDDEN_ATTRIBUTE)||item.setAttribute(CLUSTER_HIDDEN_ATTRIBUTE,"");continue}item.getAttribute(CLUSTER_HIDDEN_ATTRIBUTE)===""&&item.removeAttribute(CLUSTER_HIDDEN_ATTRIBUTE),this.managedClusterHiddenItems.delete(item)}for(const item of hiddenItems)this.managedClusterHiddenItems.has(item)||item.hasAttribute(CLUSTER_HIDDEN_ATTRIBUTE)||(item.setAttribute(CLUSTER_HIDDEN_ATTRIBUTE,""),this.managedClusterHiddenItems.add(item));if(changed){this.restoreClusterPresentation();for(const cluster of frozen){const representative=cluster.items[0];this.clusterActivations.set(representative,()=>this.activateCluster(cluster.items)),this.managedClusterRepresentatives.add(representative)}this.collisionClusters=frozen,this.syncClusterPresentations(frozen),this.scheduleClusterFocusRepair(focusRepair)}for(const cluster of frozen)cluster.items[0].style.setProperty("--_lr-timeline-item-offset",`${cluster.offset*100}%`)}syncClusterPresentations(clusters){for(const cluster of clusters){const representative=cluster.items[0],activate=this.clusterActivations.get(representative);if(!activate)continue;const countText=getNumberFormat(this.effectiveLocale).format(cluster.items.length);isTimelineClusterItemContract(representative)&&representative[SET_TIMELINE_CLUSTER_PRESENTATION]({accessibleLabel:this.localize("timelineClusterCount",void 0,{count:countText}),countText,activate})}}restoreClusterPresentation(){for(const item of this.managedClusterRepresentatives)isTimelineClusterItemContract(item)&&item[SET_TIMELINE_CLUSTER_PRESENTATION](void 0);this.managedClusterRepresentatives.clear(),this.clusterActivations.clear()}restoreClusterVisibility(){for(const item of this.managedClusterHiddenItems)item.getAttribute(CLUSTER_HIDDEN_ATTRIBUTE)===""&&item.removeAttribute(CLUSTER_HIDDEN_ATTRIBUTE);this.managedClusterHiddenItems.clear()}activateCluster(items){const snapshot=this.ownerDocument.defaultView?.Array.from(items)??[...items];this.emit("lr-cluster-activate",Object.freeze({items:Object.freeze(snapshot)}))}render(){return html`
1
+ import{__decorate}from"tslib";import{eventCollectionSupport}from"../../../internal/collection-snapshot.js";import{html}from"lit";import{property,state}from"lit/decorators.js";import{applyComposedFocusRepair,captureComposedFocusRepair,collectComposedFocusTargets}from"../../../internal/focus-navigation.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{LyraElement}from"../../../internal/lyra-element.js";import{literalSetConverter}from"../../../internal/converters.js";import{tag}from"../../../internal/prefix.js";import{observeScrollOverflow,SCROLL_OVERFLOW_ATTRIBUTE}from"../../../internal/scroll-overflow.js";import{isUsableActiveElement,safeDeepActiveElement}from"../../../internal/active-element.js";import{OBSERVE_TIMELINE_ITEM_TIMESTAMP,SET_TIMELINE_CLUSTER_PRESENTATION,isTimelineClusterItemContract,timeValueChanged}from"./timeline-cluster.js";import{scrollOverflowFadeStyles}from"../../../internal/scroll-overflow.styles.js";import{styles}from"./timeline.styles.js";import{LYRA_DEFAULT_timeline,LYRA_DEFAULT_timelineClusterCount}from"../../../internal/default-strings.generated.js";const TIMELINE_ORIENTATION=literalSetConverter(["vertical","horizontal"],"vertical");function safelyContainsActive(container,candidate){if(!isUsableActiveElement(candidate))return!1;try{return container.contains(candidate)}catch{return!1}}const TIMELINE_SCALE=literalSetConverter(["flow","time"],"flow"),TIMELINE_COLLISION=literalSetConverter(["overlap","stack","cluster"],"overlap"),EMPTY_TIMELINE_CLUSTERS=Object.freeze([]),CLUSTER_HIDDEN_ATTRIBUTE="data-lr-timeline-cluster-hidden",TIMELINE_COLLISION_THRESHOLD=.015;function timelineEpochMs(raw){if(raw==null)return null;const ms=(raw instanceof Date?raw:typeof raw=="number"?new Date(raw):new Date(String(raw))).getTime();return Number.isFinite(ms)?ms:null}function itemEpochMs(element){return timelineEpochMs(element.timestamp)}class LyraTimeline extends LyraElement{constructor(){super(...arguments),this._orientation="vertical",this._scale="flow",this._collision="overlap",this.slottedCount=0,this.collisionClusters=EMPTY_TIMELINE_CLUSTERS,this.managedClusterHiddenItems=new Set,this.managedClusterRepresentatives=new Set,this.clusterActivations=new Map,this.timestampObservedItems=new Set,this.focusRepairGeneration=0,this.scrollOverflow=observeScrollOverflow(this,()=>this.renderRoot.querySelector('[part="base"]'),()=>{this.scheduleTimeExtentMeasurement(),this.scale==="time"&&this.collision==="cluster"&&this.scheduleClusterMeasurement(),this.syncScrollTabStop()}),this.onSlotChange=e=>{this.updateBrowserDerivedState(()=>{this.slottedCount=this.countTimelineItems(e.target),this.applyTimeScale()})},this.onTimelineItemTimestampChange=()=>{this.isConnected&&this.scheduleAfterUpdate(()=>this.applyTimeScale(),"timeline-item-timestamps")}}static{this.defaultStrings={...super.defaultStrings,timeline:LYRA_DEFAULT_timeline,timelineClusterCount:LYRA_DEFAULT_timelineClusterCount}}static{this.collectionSupport=eventCollectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-cluster-activate"])}static{this.identityEventDetailProperties=Object.freeze({"lr-cluster-activate":Object.freeze(["items"])})}static{this.styles=[LyraElement.styles,scrollOverflowFadeStyles,styles]}get orientation(){return this._orientation}set orientation(value){const normalized=TIMELINE_ORIENTATION.normalizeReflected(this,"orientation",value),previous=this._orientation;previous!==normalized&&(this._orientation=normalized,this.requestUpdate("orientation",previous))}get scale(){return this._scale}set scale(value){const normalized=TIMELINE_SCALE.normalizeReflected(this,"scale",value),previous=this._scale;previous!==normalized&&(this._scale=normalized,this.requestUpdate("scale",previous))}get collision(){return this._collision}set collision(value){const normalized=TIMELINE_COLLISION.normalizeReflected(this,"collision",value),previous=this._collision;previous!==normalized&&(this._collision=normalized,this.requestUpdate("collision",previous))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.scheduleAfterUpdate(()=>this.applyTimeScale(),"timeline-clusters")}disconnectedCallback(){this.cancelClusterMeasurement(),this.cancelTimeExtentMeasurement(),this.focusRepairGeneration+=1,this.restoreClusterPresentation(),this.restoreClusterVisibility(),this.syncTimestampObservers([]),this.collisionClusters.length>0&&(this.collisionClusters=EMPTY_TIMELINE_CLUSTERS),super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed),this.hasUpdated||(this.slottedCount=Array.from(this.children).filter(element=>!element.getAttribute("slot")&&element.localName===tag("timeline-item")).length),this.hasUpdated?(changed.has("scale")||changed.has("collision")||changed.has("rangeStart")||changed.has("rangeEnd"))&&this.applyTimeScale():this.seedFirstRenderState(()=>this.applyTimeScale())}updated(changed){super.updated(changed),this.scrollOverflow.observeExtra(this.timelineItems()),this.syncScrollTabStop(),this.scheduleTimeExtentMeasurement(),(changed.has("collisionClusters")||changed.has("orientation"))&&this.collisionClusters.length>0&&this.scheduleAfterUpdate(()=>this.applyTimeScale(),"timeline-cluster-measurement"),this.collisionClusters.length>0&&this.syncClusterPresentations(this.collisionClusters)}syncScrollTabStop(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;const reachableOnlyByScrolling=this.orientation==="horizontal"&&base.hasAttribute(SCROLL_OVERFLOW_ATTRIBUTE);base.setAttribute("tabindex",reachableOnlyByScrolling?"0":"-1")}countTimelineItems(slot){return slot.assignedElements({flatten:!0}).filter(element=>element.localName===tag("timeline-item")).length}firstUpdated(changed){super.firstUpdated(changed),this.scheduleAfterUpdate(()=>this.updateBrowserDerivedState(()=>{const slot=this.shadowRoot.querySelector("slot");this.slottedCount=this.countTimelineItems(slot),this.applyTimeScale()}),"timeline-first-slot-reconciliation")}get itemCount(){return this.slottedCount}syncTimestampObservers(items){const current=new Set(items);for(const item of this.timestampObservedItems)current.has(item)||(isTimelineClusterItemContract(item)&&item[OBSERVE_TIMELINE_ITEM_TIMESTAMP](this.onTimelineItemTimestampChange,!1),this.timestampObservedItems.delete(item));for(const item of current)this.timestampObservedItems.has(item)||isTimelineClusterItemContract(item)&&(item[OBSERVE_TIMELINE_ITEM_TIMESTAMP](this.onTimelineItemTimestampChange,!0),this.timestampObservedItems.add(item))}timelineItems(){const slot=this.shadowRoot?.querySelector("slot");return(slot?slot.assignedElements({flatten:!0}):Array.from(this.children).filter(element=>!element.getAttribute("slot"))).filter(element=>element.localName===tag("timeline-item"))}timeRange(stamps){const pinnedStart=timelineEpochMs(this.rangeStart),pinnedEnd=timelineEpochMs(this.rangeEnd);if(pinnedStart!==null&&pinnedEnd!==null&&pinnedEnd>pinnedStart)return[pinnedStart,pinnedEnd];const finite=stamps.filter(value=>value!==null);if(finite.length<2)return null;const lo=Math.min(...finite),hi=Math.max(...finite);return hi>lo?[lo,hi]:null}applyTimeScale(){this.scheduleTimeExtentMeasurement();const items=this.timelineItems();if(this.syncTimestampObservers(items),this.scale!=="time"){for(const item of items)item.style.removeProperty("--_lr-timeline-item-offset"),item.style.removeProperty("--_lr-timeline-item-lane");this.applyCollisionClusters([]);return}const stamps=items.map(item=>itemEpochMs(item)),range=this.timeRange(stamps),lastIndex=Math.max(1,items.length-1),offsets=new Array(items.length).fill(0);items.forEach((item,index)=>{const stamp=stamps[index]??null,ratio=range&&stamp!==null?(stamp-range[0])/(range[1]-range[0]):this.collision==="cluster"&&stamp!==null?0:index/lastIndex,clamped=Math.min(1,Math.max(0,ratio));offsets[index]=clamped,item.style.setProperty("--_lr-timeline-item-offset",`${clamped*100}%`)}),this.applyCollisionLanes(items,offsets),this.applyCollisionClusters(this.collision==="cluster"?this.buildCollisionClusters(items,offsets,this.clusterCollisionThreshold()):[])}applyCollisionLanes(items,offsets){if(this.collision!=="stack"){for(const item of items)item.style.removeProperty("--_lr-timeline-item-lane");return}const order=items.map((_,index)=>index).sort((a,b)=>(offsets[a]??0)-(offsets[b]??0)),laneTails=[],lanes=new Array(items.length).fill(0);for(const index of order){const offset=offsets[index]??0;let lane=laneTails.findIndex(tail=>offset-tail>=TIMELINE_COLLISION_THRESHOLD);lane===-1&&(lane=laneTails.length),laneTails[lane]=offset,lanes[index]=lane}items.forEach((item,index)=>{item.style.setProperty("--_lr-timeline-item-lane",String(lanes[index]??0))})}buildCollisionClusters(items,offsets,threshold){const order=items.map((_,index)=>index).sort((a,b)=>(offsets[a]??0)-(offsets[b]??0)||a-b),clusters=[];let window=[],windowStart=0;const flush=()=>{if(window.length<2){window=[];return}const memberIndexes=[...window].sort((a,b)=>a-b);clusters.push({offset:windowStart,items:memberIndexes.map(index=>items[index])}),window=[]};for(const index of order){const offset=offsets[index]??0;window.length>0&&offset-windowStart>=threshold&&flush(),window.length===0&&(windowStart=offset),window.push(index)}return flush(),clusters}clusterCollisionThreshold(){const base=this.renderRoot.querySelector('[part="base"]');if(!base)return TIMELINE_COLLISION_THRESHOLD;const axisExtent=this.orientation==="horizontal"?base.clientWidth:base.clientHeight;if(!Number.isFinite(axisExtent)||axisExtent<=0)return TIMELINE_COLLISION_THRESHOLD;let markerExtent=0;for(const item of this.managedClusterRepresentatives){const marker=item.shadowRoot?.querySelector('[part="cluster"]');if(!marker)continue;const rect=marker.getBoundingClientRect();markerExtent=Math.max(markerExtent,this.orientation==="horizontal"?rect.width:rect.height)}return!Number.isFinite(markerExtent)||markerExtent<=0?TIMELINE_COLLISION_THRESHOLD:Math.max(TIMELINE_COLLISION_THRESHOLD,markerExtent/axisExtent)}scheduleTimeExtentMeasurement(){const view=this.ownerDocument?.defaultView;view&&(this.timeExtentFrame!==void 0&&this.timeExtentView===view||(this.cancelTimeExtentMeasurement(),this.timeExtentView=view,this.timeExtentFrame=view.requestAnimationFrame(()=>{if(this.timeExtentFrame=void 0,this.timeExtentView=void 0,!this.isConnected||this.ownerDocument.defaultView!==view)return;const base=this.renderRoot.querySelector('[part="base"]');if(!base)return;let overhang=0;if(this.scale==="time"&&this.orientation!=="horizontal"){const bottom=base.getBoundingClientRect().bottom;for(const item of this.timelineItems())item.getClientRects().length&&(overhang=Math.max(overhang,item.getBoundingClientRect().bottom-bottom))}const trailing=`${Math.ceil(overhang)}px`;if(base.style.getPropertyValue("--_lr-timeline-trailing-extent")!==trailing&&base.style.setProperty("--_lr-timeline-trailing-extent",trailing),this.scale!=="time"||this.orientation!=="horizontal"||this.collision==="cluster"){base.style.removeProperty("--_lr-timeline-content-height");return}let extent=0;for(const item of this.timelineItems())item.getClientRects().length&&(extent=Math.max(extent,item.offsetTop+item.offsetHeight+1));const height=`${extent+Math.max(0,base.offsetHeight-base.clientHeight)}px`;base.style.getPropertyValue("--_lr-timeline-content-height")!==height&&base.style.setProperty("--_lr-timeline-content-height",height)})))}cancelTimeExtentMeasurement(){this.timeExtentFrame!==void 0&&this.timeExtentView&&this.timeExtentView.cancelAnimationFrame(this.timeExtentFrame),this.timeExtentFrame=void 0,this.timeExtentView=void 0}scheduleClusterMeasurement(){const view=this.ownerDocument.defaultView;view&&(this.clusterMeasurementFrame!==void 0&&this.clusterMeasurementView===view||(this.cancelClusterMeasurement(),this.clusterMeasurementView=view,this.clusterMeasurementFrame=view.requestAnimationFrame(()=>{this.clusterMeasurementFrame=void 0,this.clusterMeasurementView=void 0,this.isConnected&&this.ownerDocument.defaultView===view&&this.scale==="time"&&this.collision==="cluster"&&this.applyTimeScale()})))}cancelClusterMeasurement(){this.clusterMeasurementFrame!==void 0&&this.clusterMeasurementView&&this.clusterMeasurementView.cancelAnimationFrame(this.clusterMeasurementFrame),this.clusterMeasurementFrame=void 0,this.clusterMeasurementView=void 0}sameClusters(left,right){return left.length===right.length&&left.every((cluster,index)=>cluster.offset===right[index]?.offset&&cluster.items.length===right[index]?.items.length&&cluster.items.every((item,itemIndex)=>item===right[index]?.items[itemIndex]))}captureClusterFocusRepair(clusters){const active=safeDeepActiveElement(this.ownerDocument);if(!active)return;const focusedItem=this.timelineItems().find(item=>item===active||safelyContainsActive(item,active)||safeDeepActiveElement(item.shadowRoot)===active);if(!focusedItem)return;const wasRepresentative=this.managedClusterRepresentatives.has(focusedItem),nextCluster=clusters.find(cluster=>cluster.items.includes(focusedItem)),nextRepresentative=nextCluster?.items[0],mode=nextCluster?"cluster":"item";if(mode==="cluster"&&wasRepresentative&&nextRepresentative===focusedItem||mode==="item"&&!wasRepresentative)return;const base=this.renderRoot.querySelector('[part="base"]');let snapshot;try{snapshot=captureComposedFocusRepair(focusedItem,base)}catch{return}if(snapshot)return{item:mode==="cluster"?nextRepresentative:focusedItem,mode,snapshot}}scheduleClusterFocusRepair(repair){const generation=++this.focusRepairGeneration;repair&&repair.item.updateComplete.then(()=>{if(generation!==this.focusRepairGeneration||!this.isConnected)return;const base=this.renderRoot.querySelector('[part="base"]'),target=repair.mode==="cluster"?repair.item.shadowRoot?.querySelector('[part="cluster"]')??null:collectComposedFocusTargets(repair.item).elements[0]??base;try{applyComposedFocusRepair(repair.snapshot,target)}catch{}})}applyCollisionClusters(clusters){const frozen=Object.freeze(clusters.map(cluster=>Object.freeze({offset:cluster.offset,items:Object.freeze([...cluster.items])}))),changed=!this.sameClusters(this.collisionClusters,frozen),focusRepair=changed?this.captureClusterFocusRepair(frozen):void 0,representatives=new Set(frozen.map(cluster=>cluster.items[0])),hiddenItems=new Set(frozen.flatMap(cluster=>cluster.items.filter(item=>!representatives.has(item))));for(const item of this.managedClusterHiddenItems){if(hiddenItems.has(item)){item.hasAttribute(CLUSTER_HIDDEN_ATTRIBUTE)||item.setAttribute(CLUSTER_HIDDEN_ATTRIBUTE,"");continue}item.getAttribute(CLUSTER_HIDDEN_ATTRIBUTE)===""&&item.removeAttribute(CLUSTER_HIDDEN_ATTRIBUTE),this.managedClusterHiddenItems.delete(item)}for(const item of hiddenItems)this.managedClusterHiddenItems.has(item)||item.hasAttribute(CLUSTER_HIDDEN_ATTRIBUTE)||(item.setAttribute(CLUSTER_HIDDEN_ATTRIBUTE,""),this.managedClusterHiddenItems.add(item));if(changed){this.restoreClusterPresentation();for(const cluster of frozen){const representative=cluster.items[0];this.clusterActivations.set(representative,()=>this.activateCluster(cluster.items)),this.managedClusterRepresentatives.add(representative)}this.collisionClusters=frozen,this.syncClusterPresentations(frozen),this.scheduleClusterFocusRepair(focusRepair)}for(const cluster of frozen)cluster.items[0].style.setProperty("--_lr-timeline-item-offset",`${cluster.offset*100}%`)}syncClusterPresentations(clusters){for(const cluster of clusters){const representative=cluster.items[0],activate=this.clusterActivations.get(representative);if(!activate)continue;const countText=getNumberFormat(this.effectiveLocale).format(cluster.items.length);isTimelineClusterItemContract(representative)&&representative[SET_TIMELINE_CLUSTER_PRESENTATION]({accessibleLabel:this.localize("timelineClusterCount",void 0,{count:countText}),countText,activate})}}restoreClusterPresentation(){for(const item of this.managedClusterRepresentatives)isTimelineClusterItemContract(item)&&item[SET_TIMELINE_CLUSTER_PRESENTATION](void 0);this.managedClusterRepresentatives.clear(),this.clusterActivations.clear()}restoreClusterVisibility(){for(const item of this.managedClusterHiddenItems)item.getAttribute(CLUSTER_HIDDEN_ATTRIBUTE)===""&&item.removeAttribute(CLUSTER_HIDDEN_ATTRIBUTE);this.managedClusterHiddenItems.clear()}activateCluster(items){const snapshot=this.ownerDocument.defaultView?.Array.from(items)??[...items];this.emit("lr-cluster-activate",Object.freeze({items:Object.freeze(snapshot)}))}render(){return html`
2
2
  <div part="base" role="list" tabindex="-1" aria-label=${this.accessibleLabel==null?this.localize("timeline"):this.accessibleLabel}>
3
3
  <slot @slotchange=${this.onSlotChange}></slot>
4
4
  </div>
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{eventCollectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{tag}from"../../../internal/prefix.js";import{isRtl}from"../../../internal/rtl.js";import{styles}from"./tree.styles.js";import{cascadeUpdateComplete}from"./update-cascade.js";import{configureTreeItemOwner,fromInteractiveDescendant,setTreeItemSelection,treeItemOwnerContext}from"./tree-owner-controller.js";import"./tree-item.class.js";import{TREE_MAX_RENDER_DEPTH,TREE_MAX_RENDER_NODES}from"./tree-types.js";import{composedParentElement,deepActiveElementIn}from"../../../internal/active-element.js";import{LYRA_DEFAULT_noData,LYRA_DEFAULT_treeLimit,LYRA_DEFAULT_treeNodeMoved}from"../../../internal/default-strings.generated.js";const TREE_SELECTIONS=new Set(["single","multiple","leaf","leaf-multiple"]),TREE_BADGE_LIMIT=100,TREE_MAX_INSPECTED_POSITIONS=1e4,EMPTY_TREE_DATA=Object.freeze([]);function ownValue(record,key){try{const descriptor=Object.getOwnPropertyDescriptor(record,key);return descriptor&&"value"in descriptor?descriptor.value:void 0}catch{return}}function arrayLength(value){if(!Array.isArray(value))return 0;try{return Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,Math.trunc(value.length)))}catch{return 0}}function normalizeBadges(value){if(!Array.isArray(value))return{truncated:value!==void 0};const badges=[],length=arrayLength(value);for(let index=0;index<Math.min(length,TREE_BADGE_LIMIT);index++){const raw=ownValue(value,String(index));if(!raw||typeof raw!="object"||Array.isArray(raw))continue;const text=ownValue(raw,"text");if(typeof text!="string")continue;const rawTone=ownValue(raw,"tone"),tone=rawTone==="brand"||rawTone==="success"||rawTone==="warning"||rawTone==="danger"?rawTone:"neutral",rawLabel=ownValue(raw,"label");badges.push(Object.freeze({text,tone,...typeof rawLabel=="string"?{label:rawLabel}:{}}))}return{badges:Object.freeze(badges),truncated:length>TREE_BADGE_LIMIT}}function sameIcon(left,right){if(Object.is(left,right))return!0;const a=left,b=right;if(!a||!b||typeof a!="object"||typeof b!="object"||a._$litType$===void 0||a._$litType$!==b._$litType$||a.strings!==b.strings)return!1;const leftValues=a.values??[],rightValues=b.values??[];return leftValues.length===rightValues.length&&leftValues.every((value,index)=>Object.is(value,rightValues[index]))}function sameBadges(left,right){return left===right?!0:!left||!right||left.length!==right.length?!1:left.every((badge,index)=>{const other=right[index];return badge.text===other.text&&badge.tone===other.tone&&badge.label===other.label})}function sameTreeNode(next,previous){if(next.id!==previous.id||next.label!==previous.label||next.selected!==previous.selected||next.disabled!==previous.disabled||next.lazy!==previous.lazy||next.description!==previous.description||next.accessibleLabel!==previous.accessibleLabel||!sameIcon(next.icon,previous.icon)||!sameBadges(next.badges,previous.badges))return!1;const children=next.children,previousChildren=previous.children;return!children||!previousChildren?children===void 0&&previousChildren===void 0:children.length===previousChildren.length&&children.every((child,index)=>child===previousChildren[index])}function indexTreeNodes(nodes){const byId=new Map,stack=[...nodes];for(;stack.length>0;){const node=stack.pop();byId.set(node.id,node),node.children&&stack.push(...node.children)}return byId}function normalizeTreeData(input,previous=EMPTY_TREE_DATA){if(!Array.isArray(input))return{data:EMPTY_TREE_DATA,declaredChildrenAtPath:new Map,declaredRootCount:0,truncated:input!=null,limitReached:!1};const root=[],declaredChildrenAtPath=new Map,created=[],rootLength=arrayLength(input);let truncated=!1,limitReached=!1,accepted=0,inspected=0;const seenIds=new Set,identityFilteredCollections=new Set,jobs=[{source:input,index:0,length:rootLength,target:root,parentPath:"",depth:0,ancestors:new Set}];for(;jobs.length>0;){const job=jobs[jobs.length-1];if(job.index>=job.length){jobs.pop();continue}if(accepted>=TREE_MAX_RENDER_NODES||inspected>=TREE_MAX_INSPECTED_POSITIONS){truncated=!0,limitReached=accepted>=TREE_MAX_RENDER_NODES;break}const raw=ownValue(job.source,String(job.index++));if(inspected++,inspected===TREE_MAX_INSPECTED_POSITIONS&&(truncated=!0),!raw||typeof raw!="object"||Array.isArray(raw)){truncated=!0,identityFilteredCollections.add(job.target);continue}const id=ownValue(raw,"id"),label=ownValue(raw,"label");if(typeof id!="string"||id.trim()===""||seenIds.has(id)||typeof label!="string"){truncated=!0,identityFilteredCollections.add(job.target);continue}seenIds.add(id);const node={id,label},selected=ownValue(raw,"selected"),disabled=ownValue(raw,"disabled"),lazy=ownValue(raw,"lazy");typeof selected=="boolean"&&(node.selected=selected),typeof disabled=="boolean"&&(node.disabled=disabled),typeof lazy=="boolean"&&(node.lazy=lazy);const icon=ownValue(raw,"icon");icon!==void 0&&(node.icon=icon);const description=ownValue(raw,"description");typeof description=="string"&&(node.description=description);const accessibleLabel=ownValue(raw,"accessibleLabel");typeof accessibleLabel=="string"&&(node.accessibleLabel=accessibleLabel);const normalizedBadges=normalizeBadges(ownValue(raw,"badges"));normalizedBadges.badges?.length&&(node.badges=normalizedBadges.badges),truncated||=normalizedBadges.truncated;const ownIndex=job.target.length,path=job.parentPath===""?String(ownIndex):`${job.parentPath}/${ownIndex}`;job.target.push(node),created.push(node),accepted++;const rawChildren=ownValue(raw,"children"),childCount=arrayLength(rawChildren);if(childCount===0)continue;if(declaredChildrenAtPath.set(path,childCount),job.depth>=TREE_MAX_RENDER_DEPTH||job.ancestors.has(raw)){truncated=!0;continue}const children=[];node.children=children;const ancestors=new Set(job.ancestors);ancestors.add(raw),jobs.push({source:rawChildren,index:0,length:childCount,target:children,parentPath:path,depth:job.depth+1,ancestors})}const previousById=previous.length>0?indexTreeNodes(previous):void 0,resolved=new Map,resolve=node=>resolved.get(node)??node;for(let index=created.length-1;index>=0;index--){const node=created[index];if(node.children){for(let child=0;child<node.children.length;child++)node.children[child]=resolve(node.children[child]);Object.freeze(node.children)}Object.freeze(node);const prior=previousById?.get(node.id);prior&&!(node.children&&identityFilteredCollections.has(node.children))&&sameTreeNode(node,prior)&&resolved.set(node,prior)}for(let index=0;index<root.length;index++)root[index]=resolve(root[index]);const normalizedJobs=root.map((node,index)=>({node,path:String(index)}));for(;normalizedJobs.length>0;){const{node,path}=normalizedJobs.pop(),children=node.children??[];identityFilteredCollections.has(children)&&declaredChildrenAtPath.set(path,children.length);for(let index=children.length-1;index>=0;index--)normalizedJobs.push({node:children[index],path:`${path}/${index}`})}return{data:Object.freeze(root),declaredChildrenAtPath,declaredRootCount:identityFilteredCollections.has(root)?root.length:rootLength,truncated,limitReached}}function isInertWithin(node,root){for(let current=node;current&&current!==root;current=current.parentElement)if(current.hasAttribute("inert"))return!0;return!1}class LyraTree extends LyraElement{constructor(){super(...arguments),this._data=EMPTY_TREE_DATA,this.lastDataInput=void 0,this.declaredChildrenAtPath=new Map,this.declaredRootCount=0,this._dataTruncated=!1,this._limitReached=!1,this.label="",this.reorderable=!1,this._selection="single",this.activeId=null,this.hasAuthoredItems=!1,this.pendingFocusId=null,this.generatedNodes=new WeakSet,this.dataIdOwnerPaths=new Map,this.dataIdCollisions=new Set,this.selectionSyncPending=!0,this.dataSyncPending=!1,this.inertMutationPending=!1,this.dirtyConfigureRoots=new Set,this.lastFocusedNodeId=null,this.onTreeFocusIn=e=>{const path=e.composedPath(),owner=path.find(target=>target.localName===tag("tree"));if(owner&&owner!==this)return;const item=path.find(target=>target.nodeType===1&&target.localName===tag("tree-item"));item&&this.onItemFocus(item)},this.onItemFocus=element=>{const item=element;this.isNavigable(item)&&(this.lastFocusedNodeId=item.nodeId,this.activeId=item.nodeId)},this.contextSyncPending=!0,this.bulkExpansions=0,this.syncRequested=!1,this.syncRunning=!1,this.requestContextSync=()=>{this.contextSyncPending=!0,this.scheduleTreeSync()},this.onChildrenChanged=()=>{const wasAuthored=this.hasAuthoredItems;this.refreshAuthoredItems(),wasAuthored&&!this.hasAuthoredItems&&(this.dataSyncPending=!0),this.selectionSyncPending=!0,this.requestUpdate()},this.childObserverGeneration=0,this.onChildMutations=allRecords=>{const records=allRecords.filter(record=>record.type!=="attributes"||record.oldValue!==null!==record.target.hasAttribute(record.attributeName??""));if(records.length!==0){if(records.some(record=>record.attributeName==="inert")&&(this.inertMutationPending=!0),records.every(record=>record.type==="attributes")){const itemTag=tag("tree-item");for(const record of records){const target=record.target;if(!(target instanceof Element)||target.localName!==itemTag)continue;const root=this.rootTreeItemAncestor(target);root&&this.dirtyConfigureRoots.add(root)}}else this.dirtyConfigureRoots.clear();this.onChildrenChanged()}},this.onNodeActivate=e=>{const node=this.eventNode(e);if(!node||node.isDisabled)return;this.selectionSyncPending=!0,this.requestUpdate();const expanded=e.detail?.expanded===!0;(this.focusIsWithin(node)||!expanded&&this.activeId!==node.nodeId&&this.subtreeHasId(node,this.activeId))&&(this.activeId=node.nodeId)},this.onNodeSelect=event=>{const node=this.eventNode(event);!node||node.isDisabled||(this.activeId=node.nodeId,this.updateSelectionFrom(node)&&this.emit("lr-selection-change",Object.freeze({selection:this.selectedItems})))},this.onTreeKeyDown=e=>{const itemTag=tag("tree-item");if(fromInteractiveDescendant(e,target=>target.localName===itemTag))return;const visible=this.visibleNodeElements();if(visible.length===0)return;const currentIndex=visible.findIndex(n=>n.nodeId===this.activeId),current=currentIndex>=0?visible[currentIndex]:visible[0];if(!current)return;if(this.reorderable&&(e.ctrlKey||e.metaKey)&&(e.key==="ArrowUp"||e.key==="ArrowDown")){e.preventDefault(),this.requestReorder(current,e.key==="ArrowDown"?1:-1);return}if(e.altKey)return;const rtl=isRtl(this),expandKey=rtl?"ArrowLeft":"ArrowRight",collapseKey=rtl?"ArrowRight":"ArrowLeft";switch(e.key){case"ArrowDown":e.preventDefault(),this.focusNode(visible[Math.min(visible.length-1,currentIndex+1)]);break;case"ArrowUp":e.preventDefault(),this.focusNode(visible[Math.max(0,currentIndex-1)]);break;case"Home":e.preventDefault(),this.focusNode(visible[0]);break;case"End":e.preventDefault(),this.focusNode(visible[visible.length-1]);break;case expandKey:if(e.preventDefault(),!current.hasChildren)break;if(!current.expanded)current.expand();else{const child=visible[currentIndex+1];child&&treeItemOwnerContext(child).depth>treeItemOwnerContext(current).depth&&this.focusNode(child)}break;case collapseKey:if(e.preventDefault(),current.hasChildren&&current.expanded)current.collapse();else for(let i=currentIndex-1;i>=0;i--){const sibling=visible[i];if(sibling&&treeItemOwnerContext(sibling).depth<treeItemOwnerContext(current).depth){this.focusNode(sibling);break}}break;case"Enter":case" ":e.preventDefault(),current.select();break;default:return}}}static{this.defaultStrings={...super.defaultStrings,noData:LYRA_DEFAULT_noData,treeLimit:LYRA_DEFAULT_treeLimit,treeNodeMoved:LYRA_DEFAULT_treeNodeMoved}}static{this.collectionSupport=eventCollectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-selection-change"])}static{this.identityEventDetailProperties=Object.freeze({"lr-selection-change":Object.freeze(["selection"])})}static{this.styles=[LyraElement.styles,styles]}get data(){return this._data}set data(value){if(value===this._data||value===this.lastDataInput)return;this.lastDataInput=value,this.hasUpdated&&this.selectionBeforeRefresh===void 0&&(this.selectionBeforeRefresh=this.selectedItems.map(item=>item.nodeId));const previous=this._data,normalized=normalizeTreeData(value,this._data);this._data=normalized.data,this.declaredChildrenAtPath=normalized.declaredChildrenAtPath,this.declaredRootCount=normalized.declaredRootCount,this._dataTruncated=normalized.truncated,this._limitReached=normalized.limitReached,this.requestUpdate("data",previous)}get dataTruncated(){return this._dataTruncated}get selection(){return this._selection}set selection(value){const old=this._selection,normalized=TREE_SELECTIONS.has(value)?value:"single";old!==normalized&&(this._selection=normalized,this.selectionSyncPending=!0,this.requestUpdate("selection",old))}get nodeElements(){return[...this.querySelectorAll(`:scope > ${tag("tree-item")}`)]}childrenOf(node){return node.childItems()}isNavigable(node){return!node.isDisabled&&!isInertWithin(node,this)}allNodeElements(){const result=[],seen=new Set,stack=this.nodeElements.map(node=>({node,depth:0})).reverse();for(;stack.length>0&&result.length<TREE_MAX_RENDER_NODES;){const{node,depth}=stack.pop();if(seen.has(node)||(seen.add(node),result.push(node),depth>=TREE_MAX_RENDER_DEPTH))continue;const children=this.childrenOf(node);for(let index=children.length-1;index>=0;index--)stack.push({node:children[index],depth:depth+1})}return result}get selectedItems(){return Object.freeze(this.allNodeElements().filter(node=>node.selected))}iconSource(name){return this.querySelector(`:scope > [slot="${name}"]`)}applyTreeContext(){const expandIcon=this.iconSource("expand-icon"),collapseIcon=this.iconSource("collapse-icon"),roots=this.nodeElements,rootCount=this.hasAuthoredItems?roots.length:this.declaredRootCount,stack=[];for(let index=roots.length-1;index>=0;index--)stack.push({node:roots[index],ancestry:[],depth:0,setSize:rootCount,posInSet:index+1,identity:this.hasAuthoredItems?void 0:this.treeIdentityAt(String(index))});const seen=new Set;for(;stack.length>0&&seen.size<TREE_MAX_RENDER_NODES;){const frame=stack.pop();if(seen.has(frame.node)||(seen.add(frame.node),configureTreeItemOwner(frame.node,{...treeItemOwnerContext(frame.node),activeId:this.activeId,ancestry:frame.ancestry,depth:frame.depth,setSize:frame.setSize,posInSet:frame.posInSet,selection:this.selection,ownsSelection:!0,identity:frame.identity,expandIcon,collapseIcon,syncOwner:this.requestContextSync,focusOwner:this.onItemFocus}),frame.depth>=TREE_MAX_RENDER_DEPTH))continue;const children=this.childrenOf(frame.node),declaredCount=frame.identity?.declaredChildrenAtPath.get(frame.identity.path)??frame.node.item?.children?.length??children.length,childAncestry=frame.node.item?[...frame.ancestry,frame.node.item]:frame.ancestry;for(let index=children.length-1;index>=0;index--){const identity=frame.identity?{path:`${frame.identity.path}/${index}`,ownerPaths:frame.identity.ownerPaths,collisionIds:frame.identity.collisionIds,declaredChildrenAtPath:frame.identity.declaredChildrenAtPath}:void 0;stack.push({node:children[index],ancestry:childAncestry,depth:frame.depth+1,setSize:declaredCount,posInSet:index+1,identity})}}}selectableInSingleMode(node){return!node.isDisabled&&(this.selection!=="leaf"||!node.hasChildren)}normalizeSingleSelection(){let kept=!1;for(const node of this.allNodeElements()){const selected=!kept&&node.selected&&this.selectableInSingleMode(node);this.setSelection(node,selected,!1),selected&&(kept=!0)}}setBranchSelection(node,selected,leavesOnly){const stack=[node],seen=new Set;for(;stack.length>0&&seen.size<TREE_MAX_RENDER_NODES;){const current=stack.pop();if(seen.has(current)||current.isDisabled)continue;seen.add(current);const children=this.childrenOf(current).filter(child=>!child.isDisabled);!leavesOnly||children.length===0?this.setSelection(current,leavesOnly&&current.hasChildren?!1:selected,!1):this.setSelection(current,!1,!1);for(let index=children.length-1;index>=0;index--)stack.push(children[index])}}deriveMultipleSelection(node,leavesOnly){const states=new Map,stack=[{item:node,visited:!1}],queued=new Set;for(;stack.length>0;){const entry=stack.pop();if(entry.visited){const current=entry.item;if(current.isDisabled){this.setSelection(current,!1,!1),states.set(current,"ignored");continue}const children2=this.childrenOf(current).filter(child=>!child.isDisabled);if(children2.length===0){leavesOnly&&current.hasChildren?(this.setSelection(current,!1,!1),states.set(current,"none")):(this.setSelection(current,current.selected,!1),states.set(current,current.selected?"all":"none"));continue}const childStates=children2.map(child=>states.get(child)??"ignored").filter(state2=>state2!=="ignored");if(childStates.length===0){this.setSelection(current,!1,!1),states.set(current,"none");continue}const all=childStates.every(state2=>state2==="all"),none=childStates.every(state2=>state2==="none");this.setSelection(current,all,!all&&!none),states.set(current,all?"all":none?"none":"some");continue}if(queued.size>=TREE_MAX_RENDER_NODES||queued.has(entry.item))continue;queued.add(entry.item),stack.push({item:entry.item,visited:!0});const children=this.childrenOf(entry.item);for(let index=children.length-1;index>=0;index--)queued.has(children[index])||stack.push({item:children[index],visited:!1})}return states.get(node)??"none"}normalizeMultipleSelection(){const leavesOnly=this.selection==="leaf-multiple";for(const node of this.allNodeElements())node.selected&&this.childrenOf(node).length>0&&this.setBranchSelection(node,!0,leavesOnly);for(const root of this.nodeElements)this.deriveMultipleSelection(root,leavesOnly)}normalizeSelection(){this.selection==="single"||this.selection==="leaf"?this.normalizeSingleSelection():this.normalizeMultipleSelection()}setSelection(node,selected,indeterminate){this.selectionBefore&&!this.selectionBefore.has(node)&&this.selectionBefore.set(node,[node.selected,node.indeterminate]),setTreeItemSelection(node,selected,indeterminate)}updateSelectionFrom(node){if(node.isDisabled||(this.selection==="single"||this.selection==="leaf")&&!this.selectableInSingleMode(node))return!1;const before=new Map;this.selectionBefore=before;try{if(this.selection==="single"||this.selection==="leaf")for(const candidate of this.allNodeElements())this.setSelection(candidate,candidate===node,!1);else{const select=node.indeterminate||!node.selected;this.setBranchSelection(node,select,this.selection==="leaf-multiple");for(const root of this.nodeElements)this.deriveMultipleSelection(root,this.selection==="leaf-multiple")}}finally{this.selectionBefore=void 0}for(const[candidate,[selected,indeterminate]]of before)if(candidate.selected!==selected||candidate.indeterminate!==indeterminate)return!0;return!1}refreshAuthoredItems(){const nodes=this.nodeElements;for(const node of nodes)node.hasAttribute("slot")&&node.removeAttribute("slot");const authored=nodes.some(node=>!this.generatedNodes.has(node));if(authored)for(const node of nodes)this.generatedNodes.has(node)&&node.remove();this.hasAuthoredItems=authored}visibleNodeElements(){const acc=[],seen=new Set,stack=this.nodeElements.map(node=>({node,depth:0})).reverse();for(;stack.length>0&&acc.length<TREE_MAX_RENDER_NODES;){const{node,depth}=stack.pop();if(seen.has(node)||(seen.add(node),!this.isNavigable(node))||(acc.push(node),!node.expanded||depth>=TREE_MAX_RENDER_DEPTH))continue;const children=this.childrenOf(node);for(let index=children.length-1;index>=0;index--)stack.push({node:children[index],depth:depth+1})}return acc}findItem(items,id){const stack=[...items].reverse(),seen=new Set;for(;stack.length>0;){const item=stack.pop();if(!seen.has(item)){if(seen.add(item),item.id===id)return item;if(item.children)for(let i=item.children.length-1;i>=0;i--){const child=item.children[i];child&&stack.push(child)}}}}isDuplicateDataPath(item,path){return this.dataIdCollisions.has(item.id)&&this.dataIdOwnerPaths.get(item.id)!==path}rebuildDataIdentity(){const ownerPaths=new Map,collisionIds=new Set,ancestry=new Set,stack=[{items:this.data,index:0,parentPath:"",depth:0}];for(;stack.length>0;){const frame=stack[stack.length-1];if(frame.index>=frame.items.length){frame.owner&&ancestry.delete(frame.owner),stack.pop();continue}const index=frame.index++,item=frame.items[index];if(!item)continue;const path=frame.parentPath===""?String(index):`${frame.parentPath}/${index}`;ownerPaths.has(item.id)?collisionIds.add(item.id):ownerPaths.set(item.id,path),!(frame.depth>=TREE_MAX_RENDER_DEPTH||ancestry.has(item)||!item.children?.length)&&(ancestry.add(item),stack.push({items:item.children,index:0,parentPath:path,depth:frame.depth+1,owner:item}))}this.dataIdOwnerPaths=ownerPaths,this.dataIdCollisions=collisionIds}treeIdentityAt(path){return{path,ownerPaths:this.dataIdOwnerPaths,collisionIds:this.dataIdCollisions,declaredChildrenAtPath:this.declaredChildrenAtPath}}firstEnabledId(items){for(let index=0;index<items.length;index++){const item=items[index];if(!(!item||item.disabled||this.isDuplicateDataPath(item,String(index))))return item.id}return null}isEnabledReachableId(items,id){const stack=items.map((item,index)=>({item,path:String(index)})).reverse(),seen=new Set;for(;stack.length>0;){const{item,path}=stack.pop();if(!seen.has(item)&&(seen.add(item),!(item.disabled||this.isDuplicateDataPath(item,path)))){if(item.id===id)return!0;if(item.children)for(let i=item.children.length-1;i>=0;i--){const child=item.children[i];child&&stack.push({item:child,path:`${path}/${i}`})}}}return!1}findRenderedSiblings(node){const root=node.getRootNode(),shadowHost="host"in root?root.host:null,shadowParent=shadowHost?.localName===tag("tree-item")?shadowHost:null,lightParent=node.parentElement?.localName===tag("tree-item")?node.parentElement:null,parentItem=shadowParent??lightParent,siblings=parentItem?parentItem.childItems():this.nodeElements,index=siblings.indexOf(node);if(!(index<0))return{parent:parentItem,siblings,index}}deepFocusedNode(){const active=deepActiveElementIn(this.ownerDocument);if(!active||active.localName!==tag("tree-item"))return null;const node=active;return this.visibleNodeElements().some(n=>n.nodeId===node.nodeId)?node:null}resolveActiveFromDom(){const inertMutation=this.inertMutationPending;this.inertMutationPending=!1;const visible=this.visibleNodeElements();if(visible.some(node=>node.nodeId===this.activeId))return;const displaced=this.activeId;if(this.activeId=visible[0]?.nodeId??null,!inertMutation||this.activeId==null||displaced==null||displaced!==this.lastFocusedNodeId)return;const ownerDocument=this.ownerDocument,active=deepActiveElementIn(ownerDocument),strandedOnDisplaced=active?.nodeType===1&&active.localName===tag("tree-item")&&active.nodeId===displaced;active!==null&&active!==ownerDocument.body&&!strandedOnDisplaced||(this.pendingFocusId=this.activeId)}willUpdate(changed){if(super.willUpdate(changed),this.refreshAuthoredItems(),(changed.has("data")||changed.has("selection"))&&(this.selectionSyncPending=!0),this.hasAuthoredItems){this.resolveActiveFromDom();return}if(changed.has("data")||this.dataSyncPending){this.dataSyncPending=!1;const focused=this.deepFocusedNode(),focusedId=focused?.nodeId??null;this.rebuildDataIdentity(),this.syncNodes();const activeItem=this.activeId?this.findItem(this.data,this.activeId):void 0;(!this.activeId||!activeItem||activeItem.disabled||!this.isEnabledReachableId(this.data,this.activeId))&&(this.activeId=this.firstEnabledId(this.data)),this.pendingFocusId=focused==null?null:focusedId!=null&&this.findItem(this.data,focusedId)?focusedId:this.activeId}this.inertMutationPending&&this.resolveActiveFromDom()}firstUpdated(changed){super.firstUpdated(changed),hostAriaLabel(this)==null&&!this.label&&devWarnOnce("lyra-tree-missing-accessible-name","<lr-tree> has no accessible name: set `label` or a host `aria-label`.")}updated(changed){super.updated(changed);const targeted=changed.size===0&&this.hasAuthoredItems&&this.dirtyConfigureRoots.size>0;if(targeted){const nodes=this.nodeElements,count=nodes.length;for(const node of this.dirtyConfigureRoots){const i=nodes.indexOf(node);i<0||configureTreeItemOwner(node,{...treeItemOwnerContext(node),activeId:this.activeId,ancestry:[],depth:0,setSize:count,posInSet:i+1,selection:this.selection,ownsSelection:!0,identity:void 0,expandIcon:this.iconSource("expand-icon"),collapseIcon:this.iconSource("collapse-icon"),syncOwner:this.requestContextSync,focusOwner:this.onItemFocus})}}else if(changed.has("activeId")||changed.has("data")||this.hasAuthoredItems){const nodes=this.nodeElements,count=this.hasAuthoredItems?nodes.length:this.declaredRootCount;nodes.forEach((node,i)=>{configureTreeItemOwner(node,{...treeItemOwnerContext(node),activeId:this.activeId,ancestry:[],depth:0,setSize:count,posInSet:i+1,selection:this.selection,ownsSelection:!0,identity:this.hasAuthoredItems?void 0:this.treeIdentityAt(String(i)),expandIcon:this.iconSource("expand-icon"),collapseIcon:this.iconSource("collapse-icon"),syncOwner:this.requestContextSync,focusOwner:this.onItemFocus})})}targeted||(this.contextSyncPending=!0),this.dirtyConfigureRoots.clear(),this.scheduleTreeSync()}scheduleTreeSync(){this.syncRequested=!0,!(this.syncRunning||this.bulkExpansions>0)&&(this.syncRunning=!0,this.syncTask=this.runTreeSync())}async runTreeSync(){try{for(;this.syncRequested;)this.syncRequested=!1,await super.getUpdateComplete(),await cascadeUpdateComplete(this.nodeElements),this.contextSyncPending&&(this.contextSyncPending=!1,this.applyTreeContext()),this.selectionSyncPending&&(this.selectionSyncPending=!1,this.normalizeSelection()),await cascadeUpdateComplete(this.nodeElements),this.reportRefreshSelectionChange(),this.confirmPendingReorder(),this.restorePendingFocus()}finally{this.syncRunning=!1}}rootTreeItemAncestor(node){const itemTag=tag("tree-item");let current=node;for(;current&&current.parentElement&&current.parentElement!==this;)current=current.parentElement;return current&&current.parentElement===this&&current.localName===itemTag?current:null}connectedCallback(){super.connectedCallback(),this.armChildObserver()}armChildObserver(){const ownerDocument=this.ownerDocument;if(!this.isConnected||this.childObserver&&this.childObserverDocument===ownerDocument)return;this.resetChildObserver();const MutationObserverCtor=ownerDocument.defaultView?.MutationObserver;if(!MutationObserverCtor)return;const generation=this.childObserverGeneration,observer=new MutationObserverCtor(records=>{this.childObserver!==observer||this.childObserverDocument!==ownerDocument||this.childObserverGeneration!==generation||!this.isConnected||this.ownerDocument!==ownerDocument||this.onChildMutations(records)});this.childObserver=observer,this.childObserverDocument=ownerDocument,observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["selected","disabled","inert","lazy"]})}disconnectedCallback(){super.disconnectedCallback(),this.pendingReorder=void 0,this.resetChildObserver()}adoptedCallback(){super.adoptedCallback(),this.resetChildObserver()}resetChildObserver(){this.childObserverGeneration+=1,this.childObserver?.disconnect(),this.childObserver=void 0,this.childObserverDocument=void 0}syncNodes(){const existingById=new Map;for(const node of this.nodeElements){if(!node.item)continue;const matches=existingById.get(node.item.id)??[];matches.push(node),existingById.set(node.item.id,matches)}let previousSibling=null;for(let index=0;index<this.data.length;index++){const item=this.data[index];let node=existingById.get(item.id)?.shift();node||(node=this.ownerDocument.createElement(tag("tree-item")),this.generatedNodes.add(node)),node.item=item,configureTreeItemOwner(node,{...treeItemOwnerContext(node),ancestry:[],depth:0,setSize:this.declaredRootCount,posInSet:index+1,selection:this.selection,ownsSelection:!0,identity:this.treeIdentityAt(String(index)),expandIcon:this.iconSource("expand-icon"),collapseIcon:this.iconSource("collapse-icon"),syncOwner:this.requestContextSync,focusOwner:this.onItemFocus});const targetPosition=previousSibling?previousSibling.nextElementSibling:this.firstElementChild;targetPosition!==node&&this.insertBefore(node,targetPosition),previousSibling=node}for(const nodes of existingById.values())for(const node of nodes)node.remove()}focusNode(node){node&&(this.activeId=node.nodeId,node.focus())}subtreeHasId(root,id){if(id==null)return!1;const stack=[...this.childrenOf(root)];for(let visited=0;stack.length>0&&visited<TREE_MAX_RENDER_NODES;visited++){const item=stack.pop();if(item.nodeId===id)return!0;stack.push(...this.childrenOf(item))}return!1}focusIsWithin(node){for(let current=deepActiveElementIn(this.ownerDocument);current;current=composedParentElement(current)){if(current===node)return!0;if(current===this)return!1}return!1}eventNode(e){const path=e.composedPath(),origin=path[0];if(origin?.nodeType===1&&origin.localName===tag("tree-item")){const treeTag=tag("tree");for(const target of path){if(target===this)return origin;if(target.localName===treeTag)return}return}const id=e.detail?.nodeId;return this.allNodeElements().find(candidate=>candidate.nodeId===id)}async getUpdateComplete(){let result=await super.getUpdateComplete();for(;this.syncRunning||this.isUpdatePending;)this.syncRunning&&await this.syncTask,result=await super.getUpdateComplete();return await cascadeUpdateComplete(this.nodeElements),result}reportRefreshSelectionChange(){const before=this.selectionBeforeRefresh;if(before===void 0||this.isUpdatePending)return;this.selectionBeforeRefresh=void 0;const selection=this.selectedItems;selection.length===before.length&&selection.every((item,index)=>item.nodeId===before[index])||this.emit("lr-selection-change",Object.freeze({selection}))}restorePendingFocus(){if(this.pendingFocusId==null)return;const id=this.pendingFocusId;this.pendingFocusId=null;const visible=this.visibleNodeElements();(visible.find(n=>n.nodeId===id)??visible.find(n=>n.nodeId===this.activeId))?.focus()}requestReorder(node,delta){const id=node.nodeId,found=this.findRenderedSiblings(node);if(!found)return;const{parent,siblings,index}=found,total=siblings.length,toIndex=index+delta;toIndex<0||toIndex>=total||(this.pendingReorder={node,parent,originalSiblings:[...siblings],targetSibling:siblings[toIndex],fromIndex:index,toIndex},this.emit("lr-reorder",{nodeId:id,parentNodeId:parent?.nodeId??null,fromIndex:index,toIndex}))}confirmPendingReorder(){const pending=this.pendingReorder;if(!pending)return;const found=this.findRenderedSiblings(pending.node);if(!found){this.pendingReorder=void 0;return}(found.siblings.length!==pending.originalSiblings.length||found.siblings.some((node,index)=>node!==pending.originalSiblings[index]))&&(this.pendingReorder=void 0,!(found.parent!==pending.parent||found.index!==pending.toIndex||found.siblings[pending.fromIndex]!==pending.targetSibling)&&this.liveRegion?.announce(this.localize("treeNodeMoved",void 0,{label:pending.node.nodeLabel,index:this.formatCount(found.index+1),total:this.formatCount(found.siblings.length)}),{force:!0}))}async expandAll(){const queue=this.nodeElements.map(node=>({node,depth:0})),seen=new Set;this.bulkExpansions+=1;try{for(let index=0;index<queue.length&&seen.size<TREE_MAX_RENDER_NODES;index++){const{node,depth}=queue[index];seen.has(node)||(seen.add(node),node.isDisabled?node.expanded=!1:node.hasChildren&&node.expand(),await node.updateComplete,depth<TREE_MAX_RENDER_DEPTH&&queue.push(...this.childrenOf(node).map(child=>({node:child,depth:depth+1}))))}}finally{this.bulkExpansions-=1}this.bulkExpansions===0&&this.syncRequested&&this.scheduleTreeSync(),await this.updateComplete}async collapseAll(){const focused=this.deepFocusedNode(),topLevel=this.nodeElements,nodes=this.allNodeElements();for(let index=nodes.length-1;index>=0;index--){const node=nodes[index];node.isDisabled?node.expanded=!1:node.collapse()}(this.hasAuthoredItems?topLevel.some(node=>this.isNavigable(node)&&node.nodeId===this.activeId):this.data.some(item=>!item.disabled&&item.id===this.activeId))||(this.activeId=this.hasAuthoredItems?topLevel.find(node=>this.isNavigable(node))?.nodeId??null:this.firstEnabledId(this.data)),focused&&(this.pendingFocusId=this.activeId),await cascadeUpdateComplete(topLevel)}render(){return html`
1
+ import{__decorate}from"tslib";import{eventCollectionSupport}from"../../../internal/collection-snapshot.js";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{getNumberFormat}from"../../../internal/intl-cache.js";import{hostAriaLabel}from"../../../internal/a11y.js";import{devWarnOnce}from"../../../internal/dev-mode-attribute-warning.js";import{tag}from"../../../internal/prefix.js";import{resolveListMove}from"../../../internal/list-navigation.js";import{styles}from"./tree.styles.js";import{cascadeUpdateComplete}from"./update-cascade.js";import{configureTreeItemOwner,fromInteractiveDescendant,setTreeItemSelection,treeItemOwnerContext}from"./tree-owner-controller.js";import"./tree-item.class.js";import{TREE_MAX_RENDER_DEPTH,TREE_MAX_RENDER_NODES}from"./tree-types.js";import{composedParentElement,deepActiveElementIn}from"../../../internal/active-element.js";import{LYRA_DEFAULT_noData,LYRA_DEFAULT_treeLimit,LYRA_DEFAULT_treeNodeMoved}from"../../../internal/default-strings.generated.js";const TREE_SELECTIONS=new Set(["single","multiple","leaf","leaf-multiple"]),TREE_BADGE_LIMIT=100,TREE_MAX_INSPECTED_POSITIONS=1e4,EMPTY_TREE_DATA=Object.freeze([]);function ownValue(record,key){try{const descriptor=Object.getOwnPropertyDescriptor(record,key);return descriptor&&"value"in descriptor?descriptor.value:void 0}catch{return}}function arrayLength(value){if(!Array.isArray(value))return 0;try{return Math.max(0,Math.min(Number.MAX_SAFE_INTEGER,Math.trunc(value.length)))}catch{return 0}}function normalizeBadges(value){if(!Array.isArray(value))return{truncated:value!==void 0};const badges=[],length=arrayLength(value);for(let index=0;index<Math.min(length,TREE_BADGE_LIMIT);index++){const raw=ownValue(value,String(index));if(!raw||typeof raw!="object"||Array.isArray(raw))continue;const text=ownValue(raw,"text");if(typeof text!="string")continue;const rawTone=ownValue(raw,"tone"),tone=rawTone==="brand"||rawTone==="success"||rawTone==="warning"||rawTone==="danger"?rawTone:"neutral",rawLabel=ownValue(raw,"label");badges.push(Object.freeze({text,tone,...typeof rawLabel=="string"?{label:rawLabel}:{}}))}return{badges:Object.freeze(badges),truncated:length>TREE_BADGE_LIMIT}}function sameIcon(left,right){if(Object.is(left,right))return!0;const a=left,b=right;if(!a||!b||typeof a!="object"||typeof b!="object"||a._$litType$===void 0||a._$litType$!==b._$litType$||a.strings!==b.strings)return!1;const leftValues=a.values??[],rightValues=b.values??[];return leftValues.length===rightValues.length&&leftValues.every((value,index)=>Object.is(value,rightValues[index]))}function sameBadges(left,right){return left===right?!0:!left||!right||left.length!==right.length?!1:left.every((badge,index)=>{const other=right[index];return badge.text===other.text&&badge.tone===other.tone&&badge.label===other.label})}function sameTreeNode(next,previous){if(next.id!==previous.id||next.label!==previous.label||next.selected!==previous.selected||next.disabled!==previous.disabled||next.lazy!==previous.lazy||next.description!==previous.description||next.accessibleLabel!==previous.accessibleLabel||!sameIcon(next.icon,previous.icon)||!sameBadges(next.badges,previous.badges))return!1;const children=next.children,previousChildren=previous.children;return!children||!previousChildren?children===void 0&&previousChildren===void 0:children.length===previousChildren.length&&children.every((child,index)=>child===previousChildren[index])}function indexTreeNodes(nodes){const byId=new Map,stack=[...nodes];for(;stack.length>0;){const node=stack.pop();byId.set(node.id,node),node.children&&stack.push(...node.children)}return byId}function normalizeTreeData(input,previous=EMPTY_TREE_DATA){if(!Array.isArray(input))return{data:EMPTY_TREE_DATA,declaredChildrenAtPath:new Map,declaredRootCount:0,truncated:input!=null,limitReached:!1};const root=[],declaredChildrenAtPath=new Map,created=[],rootLength=arrayLength(input);let truncated=!1,limitReached=!1,accepted=0,inspected=0;const seenIds=new Set,identityFilteredCollections=new Set,jobs=[{source:input,index:0,length:rootLength,target:root,parentPath:"",depth:0,ancestors:new Set}];for(;jobs.length>0;){const job=jobs[jobs.length-1];if(job.index>=job.length){jobs.pop();continue}if(accepted>=TREE_MAX_RENDER_NODES||inspected>=TREE_MAX_INSPECTED_POSITIONS){truncated=!0,limitReached=accepted>=TREE_MAX_RENDER_NODES;break}const raw=ownValue(job.source,String(job.index++));if(inspected++,inspected===TREE_MAX_INSPECTED_POSITIONS&&(truncated=!0),!raw||typeof raw!="object"||Array.isArray(raw)){truncated=!0,identityFilteredCollections.add(job.target);continue}const id=ownValue(raw,"id"),label=ownValue(raw,"label");if(typeof id!="string"||id.trim()===""||seenIds.has(id)||typeof label!="string"){truncated=!0,identityFilteredCollections.add(job.target);continue}seenIds.add(id);const node={id,label},selected=ownValue(raw,"selected"),disabled=ownValue(raw,"disabled"),lazy=ownValue(raw,"lazy");typeof selected=="boolean"&&(node.selected=selected),typeof disabled=="boolean"&&(node.disabled=disabled),typeof lazy=="boolean"&&(node.lazy=lazy);const icon=ownValue(raw,"icon");icon!==void 0&&(node.icon=icon);const description=ownValue(raw,"description");typeof description=="string"&&(node.description=description);const accessibleLabel=ownValue(raw,"accessibleLabel");typeof accessibleLabel=="string"&&(node.accessibleLabel=accessibleLabel);const normalizedBadges=normalizeBadges(ownValue(raw,"badges"));normalizedBadges.badges?.length&&(node.badges=normalizedBadges.badges),truncated||=normalizedBadges.truncated;const ownIndex=job.target.length,path=job.parentPath===""?String(ownIndex):`${job.parentPath}/${ownIndex}`;job.target.push(node),created.push(node),accepted++;const rawChildren=ownValue(raw,"children"),childCount=arrayLength(rawChildren);if(childCount===0)continue;if(declaredChildrenAtPath.set(path,childCount),job.depth>=TREE_MAX_RENDER_DEPTH||job.ancestors.has(raw)){truncated=!0;continue}const children=[];node.children=children;const ancestors=new Set(job.ancestors);ancestors.add(raw),jobs.push({source:rawChildren,index:0,length:childCount,target:children,parentPath:path,depth:job.depth+1,ancestors})}const previousById=previous.length>0?indexTreeNodes(previous):void 0,resolved=new Map,resolve=node=>resolved.get(node)??node;for(let index=created.length-1;index>=0;index--){const node=created[index];if(node.children){for(let child=0;child<node.children.length;child++)node.children[child]=resolve(node.children[child]);Object.freeze(node.children)}Object.freeze(node);const prior=previousById?.get(node.id);prior&&!(node.children&&identityFilteredCollections.has(node.children))&&sameTreeNode(node,prior)&&resolved.set(node,prior)}for(let index=0;index<root.length;index++)root[index]=resolve(root[index]);const normalizedJobs=root.map((node,index)=>({node,path:String(index)}));for(;normalizedJobs.length>0;){const{node,path}=normalizedJobs.pop(),children=node.children??[];identityFilteredCollections.has(children)&&declaredChildrenAtPath.set(path,children.length);for(let index=children.length-1;index>=0;index--)normalizedJobs.push({node:children[index],path:`${path}/${index}`})}return{data:Object.freeze(root),declaredChildrenAtPath,declaredRootCount:identityFilteredCollections.has(root)?root.length:rootLength,truncated,limitReached}}function isInertWithin(node,root){for(let current=node;current&&current!==root;current=current.parentElement)if(current.hasAttribute("inert"))return!0;return!1}class LyraTree extends LyraElement{constructor(){super(...arguments),this._data=EMPTY_TREE_DATA,this.lastDataInput=void 0,this.declaredChildrenAtPath=new Map,this.declaredRootCount=0,this._dataTruncated=!1,this._limitReached=!1,this.label="",this.reorderable=!1,this._selection="single",this.activeId=null,this.hasAuthoredItems=!1,this.pendingFocusId=null,this.generatedNodes=new WeakSet,this.dataIdOwnerPaths=new Map,this.dataIdCollisions=new Set,this.selectionSyncPending=!0,this.dataSyncPending=!1,this.inertMutationPending=!1,this.dirtyConfigureRoots=new Set,this.lastFocusedNodeId=null,this.onTreeFocusIn=e=>{const path=e.composedPath(),owner=path.find(target=>target.localName===tag("tree"));if(owner&&owner!==this)return;const item=path.find(target=>target.nodeType===1&&target.localName===tag("tree-item"));item&&this.onItemFocus(item)},this.onItemFocus=element=>{const item=element;this.isNavigable(item)&&(this.lastFocusedNodeId=item.nodeId,this.activeId=item.nodeId)},this.contextSyncPending=!0,this.bulkExpansions=0,this.syncRequested=!1,this.syncRunning=!1,this.requestContextSync=()=>{this.contextSyncPending=!0,this.scheduleTreeSync()},this.onChildrenChanged=()=>{const wasAuthored=this.hasAuthoredItems;this.refreshAuthoredItems(),wasAuthored&&!this.hasAuthoredItems&&(this.dataSyncPending=!0),this.selectionSyncPending=!0,this.requestUpdate()},this.childObserverGeneration=0,this.onChildMutations=allRecords=>{const records=allRecords.filter(record=>record.type!=="attributes"||record.oldValue!==null!==record.target.hasAttribute(record.attributeName??""));if(records.length!==0){if(records.some(record=>record.attributeName==="inert")&&(this.inertMutationPending=!0),records.every(record=>record.type==="attributes")){const itemTag=tag("tree-item");for(const record of records){const target=record.target;if(!(target instanceof Element)||target.localName!==itemTag)continue;const root=this.rootTreeItemAncestor(target);root&&this.dirtyConfigureRoots.add(root)}}else this.dirtyConfigureRoots.clear();this.onChildrenChanged()}},this.onNodeActivate=e=>{const node=this.eventNode(e);if(!node||node.isDisabled)return;this.selectionSyncPending=!0,this.requestUpdate();const expanded=e.detail?.expanded===!0;(this.focusIsWithin(node)||!expanded&&this.activeId!==node.nodeId&&this.subtreeHasId(node,this.activeId))&&(this.activeId=node.nodeId)},this.onNodeSelect=event=>{const node=this.eventNode(event);!node||node.isDisabled||(this.activeId=node.nodeId,this.updateSelectionFrom(node)&&this.emit("lr-selection-change",Object.freeze({selection:this.selectedItems})))},this.onTreeKeyDown=e=>{const itemTag=tag("tree-item");if(fromInteractiveDescendant(e,target=>target.localName===itemTag))return;const visible=this.visibleNodeElements();if(visible.length===0)return;const currentIndex=visible.findIndex(n=>n.nodeId===this.activeId),current=currentIndex>=0?visible[currentIndex]:visible[0];if(!current)return;if(this.reorderable&&(e.ctrlKey||e.metaKey)&&(e.key==="ArrowUp"||e.key==="ArrowDown")){e.preventDefault(),this.requestReorder(current,e.key==="ArrowDown"?1:-1);return}if(e.altKey)return;const rtl=this.effectiveDirection==="rtl",expandKey=rtl?"ArrowLeft":"ArrowRight",collapseKey=rtl?"ArrowRight":"ArrowLeft",moved=resolveListMove(e.key,{count:visible.length,current:Math.max(currentIndex,0),orientation:"vertical",wrap:!1,clamp:!0});if(moved!==null){e.preventDefault(),this.focusNode(visible[moved]);return}switch(e.key){case expandKey:if(e.preventDefault(),!current.hasChildren)break;if(!current.expanded)current.expand();else{const child=visible[currentIndex+1];child&&treeItemOwnerContext(child).depth>treeItemOwnerContext(current).depth&&this.focusNode(child)}break;case collapseKey:if(e.preventDefault(),current.hasChildren&&current.expanded)current.collapse();else for(let i=currentIndex-1;i>=0;i--){const sibling=visible[i];if(sibling&&treeItemOwnerContext(sibling).depth<treeItemOwnerContext(current).depth){this.focusNode(sibling);break}}break;case"Enter":case" ":e.preventDefault(),current.select();break;default:return}}}static{this.defaultStrings={...super.defaultStrings,noData:LYRA_DEFAULT_noData,treeLimit:LYRA_DEFAULT_treeLimit,treeNodeMoved:LYRA_DEFAULT_treeNodeMoved}}static{this.collectionSupport=eventCollectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-selection-change"])}static{this.identityEventDetailProperties=Object.freeze({"lr-selection-change":Object.freeze(["selection"])})}static{this.styles=[LyraElement.styles,styles]}get data(){return this._data}set data(value){if(value===this._data||value===this.lastDataInput)return;this.lastDataInput=value,this.hasUpdated&&this.selectionBeforeRefresh===void 0&&(this.selectionBeforeRefresh=this.selectedItems.map(item=>item.nodeId));const previous=this._data,normalized=normalizeTreeData(value,this._data);this._data=normalized.data,this.declaredChildrenAtPath=normalized.declaredChildrenAtPath,this.declaredRootCount=normalized.declaredRootCount,this._dataTruncated=normalized.truncated,this._limitReached=normalized.limitReached,this.requestUpdate("data",previous)}get dataTruncated(){return this._dataTruncated}get selection(){return this._selection}set selection(value){const old=this._selection,normalized=TREE_SELECTIONS.has(value)?value:"single";old!==normalized&&(this._selection=normalized,this.selectionSyncPending=!0,this.requestUpdate("selection",old))}get nodeElements(){return[...this.querySelectorAll(`:scope > ${tag("tree-item")}`)]}childrenOf(node){return node.childItems()}isNavigable(node){return!node.isDisabled&&!isInertWithin(node,this)}allNodeElements(){const result=[],seen=new Set,stack=this.nodeElements.map(node=>({node,depth:0})).reverse();for(;stack.length>0&&result.length<TREE_MAX_RENDER_NODES;){const{node,depth}=stack.pop();if(seen.has(node)||(seen.add(node),result.push(node),depth>=TREE_MAX_RENDER_DEPTH))continue;const children=this.childrenOf(node);for(let index=children.length-1;index>=0;index--)stack.push({node:children[index],depth:depth+1})}return result}get selectedItems(){return Object.freeze(this.allNodeElements().filter(node=>node.selected))}iconSource(name){return this.querySelector(`:scope > [slot="${name}"]`)}applyTreeContext(){const expandIcon=this.iconSource("expand-icon"),collapseIcon=this.iconSource("collapse-icon"),roots=this.nodeElements,rootCount=this.hasAuthoredItems?roots.length:this.declaredRootCount,stack=[];for(let index=roots.length-1;index>=0;index--)stack.push({node:roots[index],ancestry:[],depth:0,setSize:rootCount,posInSet:index+1,identity:this.hasAuthoredItems?void 0:this.treeIdentityAt(String(index))});const seen=new Set;for(;stack.length>0&&seen.size<TREE_MAX_RENDER_NODES;){const frame=stack.pop();if(seen.has(frame.node)||(seen.add(frame.node),configureTreeItemOwner(frame.node,{...treeItemOwnerContext(frame.node),activeId:this.activeId,ancestry:frame.ancestry,depth:frame.depth,setSize:frame.setSize,posInSet:frame.posInSet,selection:this.selection,ownsSelection:!0,identity:frame.identity,expandIcon,collapseIcon,syncOwner:this.requestContextSync,focusOwner:this.onItemFocus}),frame.depth>=TREE_MAX_RENDER_DEPTH))continue;const children=this.childrenOf(frame.node),declaredCount=frame.identity?.declaredChildrenAtPath.get(frame.identity.path)??frame.node.item?.children?.length??children.length,childAncestry=frame.node.item?[...frame.ancestry,frame.node.item]:frame.ancestry;for(let index=children.length-1;index>=0;index--){const identity=frame.identity?{path:`${frame.identity.path}/${index}`,ownerPaths:frame.identity.ownerPaths,collisionIds:frame.identity.collisionIds,declaredChildrenAtPath:frame.identity.declaredChildrenAtPath}:void 0;stack.push({node:children[index],ancestry:childAncestry,depth:frame.depth+1,setSize:declaredCount,posInSet:index+1,identity})}}}selectableInSingleMode(node){return!node.isDisabled&&(this.selection!=="leaf"||!node.hasChildren)}normalizeSingleSelection(){let kept=!1;for(const node of this.allNodeElements()){const selected=!kept&&node.selected&&this.selectableInSingleMode(node);this.setSelection(node,selected,!1),selected&&(kept=!0)}}setBranchSelection(node,selected,leavesOnly){const stack=[node],seen=new Set;for(;stack.length>0&&seen.size<TREE_MAX_RENDER_NODES;){const current=stack.pop();if(seen.has(current)||current.isDisabled)continue;seen.add(current);const children=this.childrenOf(current).filter(child=>!child.isDisabled);!leavesOnly||children.length===0?this.setSelection(current,leavesOnly&&current.hasChildren?!1:selected,!1):this.setSelection(current,!1,!1);for(let index=children.length-1;index>=0;index--)stack.push(children[index])}}deriveMultipleSelection(node,leavesOnly){const states=new Map,stack=[{item:node,visited:!1}],queued=new Set;for(;stack.length>0;){const entry=stack.pop();if(entry.visited){const current=entry.item;if(current.isDisabled){this.setSelection(current,!1,!1),states.set(current,"ignored");continue}const children2=this.childrenOf(current).filter(child=>!child.isDisabled);if(children2.length===0){leavesOnly&&current.hasChildren?(this.setSelection(current,!1,!1),states.set(current,"none")):(this.setSelection(current,current.selected,!1),states.set(current,current.selected?"all":"none"));continue}const childStates=children2.map(child=>states.get(child)??"ignored").filter(state2=>state2!=="ignored");if(childStates.length===0){this.setSelection(current,!1,!1),states.set(current,"none");continue}const all=childStates.every(state2=>state2==="all"),none=childStates.every(state2=>state2==="none");this.setSelection(current,all,!all&&!none),states.set(current,all?"all":none?"none":"some");continue}if(queued.size>=TREE_MAX_RENDER_NODES||queued.has(entry.item))continue;queued.add(entry.item),stack.push({item:entry.item,visited:!0});const children=this.childrenOf(entry.item);for(let index=children.length-1;index>=0;index--)queued.has(children[index])||stack.push({item:children[index],visited:!1})}return states.get(node)??"none"}normalizeMultipleSelection(){const leavesOnly=this.selection==="leaf-multiple";for(const node of this.allNodeElements())node.selected&&this.childrenOf(node).length>0&&this.setBranchSelection(node,!0,leavesOnly);for(const root of this.nodeElements)this.deriveMultipleSelection(root,leavesOnly)}normalizeSelection(){this.selection==="single"||this.selection==="leaf"?this.normalizeSingleSelection():this.normalizeMultipleSelection()}setSelection(node,selected,indeterminate){this.selectionBefore&&!this.selectionBefore.has(node)&&this.selectionBefore.set(node,[node.selected,node.indeterminate]),setTreeItemSelection(node,selected,indeterminate)}updateSelectionFrom(node){if(node.isDisabled||(this.selection==="single"||this.selection==="leaf")&&!this.selectableInSingleMode(node))return!1;const before=new Map;this.selectionBefore=before;try{if(this.selection==="single"||this.selection==="leaf")for(const candidate of this.allNodeElements())this.setSelection(candidate,candidate===node,!1);else{const select=node.indeterminate||!node.selected;this.setBranchSelection(node,select,this.selection==="leaf-multiple");for(const root of this.nodeElements)this.deriveMultipleSelection(root,this.selection==="leaf-multiple")}}finally{this.selectionBefore=void 0}for(const[candidate,[selected,indeterminate]]of before)if(candidate.selected!==selected||candidate.indeterminate!==indeterminate)return!0;return!1}refreshAuthoredItems(){const nodes=this.nodeElements;for(const node of nodes)node.hasAttribute("slot")&&node.removeAttribute("slot");const authored=nodes.some(node=>!this.generatedNodes.has(node));if(authored)for(const node of nodes)this.generatedNodes.has(node)&&node.remove();this.hasAuthoredItems=authored}visibleNodeElements(){const acc=[],seen=new Set,stack=this.nodeElements.map(node=>({node,depth:0})).reverse();for(;stack.length>0&&acc.length<TREE_MAX_RENDER_NODES;){const{node,depth}=stack.pop();if(seen.has(node)||(seen.add(node),!this.isNavigable(node))||(acc.push(node),!node.expanded||depth>=TREE_MAX_RENDER_DEPTH))continue;const children=this.childrenOf(node);for(let index=children.length-1;index>=0;index--)stack.push({node:children[index],depth:depth+1})}return acc}findItem(items,id){const stack=[...items].reverse(),seen=new Set;for(;stack.length>0;){const item=stack.pop();if(!seen.has(item)){if(seen.add(item),item.id===id)return item;if(item.children)for(let i=item.children.length-1;i>=0;i--){const child=item.children[i];child&&stack.push(child)}}}}isDuplicateDataPath(item,path){return this.dataIdCollisions.has(item.id)&&this.dataIdOwnerPaths.get(item.id)!==path}rebuildDataIdentity(){const ownerPaths=new Map,collisionIds=new Set,ancestry=new Set,stack=[{items:this.data,index:0,parentPath:"",depth:0}];for(;stack.length>0;){const frame=stack[stack.length-1];if(frame.index>=frame.items.length){frame.owner&&ancestry.delete(frame.owner),stack.pop();continue}const index=frame.index++,item=frame.items[index];if(!item)continue;const path=frame.parentPath===""?String(index):`${frame.parentPath}/${index}`;ownerPaths.has(item.id)?collisionIds.add(item.id):ownerPaths.set(item.id,path),!(frame.depth>=TREE_MAX_RENDER_DEPTH||ancestry.has(item)||!item.children?.length)&&(ancestry.add(item),stack.push({items:item.children,index:0,parentPath:path,depth:frame.depth+1,owner:item}))}this.dataIdOwnerPaths=ownerPaths,this.dataIdCollisions=collisionIds}treeIdentityAt(path){return{path,ownerPaths:this.dataIdOwnerPaths,collisionIds:this.dataIdCollisions,declaredChildrenAtPath:this.declaredChildrenAtPath}}firstEnabledId(items){for(let index=0;index<items.length;index++){const item=items[index];if(!(!item||item.disabled||this.isDuplicateDataPath(item,String(index))))return item.id}return null}isEnabledReachableId(items,id){const stack=items.map((item,index)=>({item,path:String(index)})).reverse(),seen=new Set;for(;stack.length>0;){const{item,path}=stack.pop();if(!seen.has(item)&&(seen.add(item),!(item.disabled||this.isDuplicateDataPath(item,path)))){if(item.id===id)return!0;if(item.children)for(let i=item.children.length-1;i>=0;i--){const child=item.children[i];child&&stack.push({item:child,path:`${path}/${i}`})}}}return!1}findRenderedSiblings(node){const root=node.getRootNode(),shadowHost="host"in root?root.host:null,shadowParent=shadowHost?.localName===tag("tree-item")?shadowHost:null,lightParent=node.parentElement?.localName===tag("tree-item")?node.parentElement:null,parentItem=shadowParent??lightParent,siblings=parentItem?parentItem.childItems():this.nodeElements,index=siblings.indexOf(node);if(!(index<0))return{parent:parentItem,siblings,index}}deepFocusedNode(){const active=deepActiveElementIn(this.ownerDocument);if(!active||active.localName!==tag("tree-item"))return null;const node=active;return this.visibleNodeElements().some(n=>n.nodeId===node.nodeId)?node:null}resolveActiveFromDom(){const inertMutation=this.inertMutationPending;this.inertMutationPending=!1;const visible=this.visibleNodeElements();if(visible.some(node=>node.nodeId===this.activeId))return;const displaced=this.activeId;if(this.activeId=visible[0]?.nodeId??null,!inertMutation||this.activeId==null||displaced==null||displaced!==this.lastFocusedNodeId)return;const ownerDocument=this.ownerDocument,active=deepActiveElementIn(ownerDocument),strandedOnDisplaced=active?.nodeType===1&&active.localName===tag("tree-item")&&active.nodeId===displaced;active!==null&&active!==ownerDocument.body&&!strandedOnDisplaced||(this.pendingFocusId=this.activeId)}willUpdate(changed){if(super.willUpdate(changed),this.refreshAuthoredItems(),(changed.has("data")||changed.has("selection"))&&(this.selectionSyncPending=!0),this.hasAuthoredItems){this.resolveActiveFromDom();return}if(changed.has("data")||this.dataSyncPending){this.dataSyncPending=!1;const focused=this.deepFocusedNode(),focusedId=focused?.nodeId??null;this.rebuildDataIdentity(),this.syncNodes();const activeItem=this.activeId?this.findItem(this.data,this.activeId):void 0;(!this.activeId||!activeItem||activeItem.disabled||!this.isEnabledReachableId(this.data,this.activeId))&&(this.activeId=this.firstEnabledId(this.data)),this.pendingFocusId=focused==null?null:focusedId!=null&&this.findItem(this.data,focusedId)?focusedId:this.activeId}this.inertMutationPending&&this.resolveActiveFromDom()}firstUpdated(changed){super.firstUpdated(changed),hostAriaLabel(this)==null&&!this.label&&devWarnOnce("lyra-tree-missing-accessible-name","<lr-tree> has no accessible name: set `label` or a host `aria-label`.")}updated(changed){super.updated(changed);const targeted=changed.size===0&&this.hasAuthoredItems&&this.dirtyConfigureRoots.size>0;if(targeted){const nodes=this.nodeElements,count=nodes.length;for(const node of this.dirtyConfigureRoots){const i=nodes.indexOf(node);i<0||configureTreeItemOwner(node,{...treeItemOwnerContext(node),activeId:this.activeId,ancestry:[],depth:0,setSize:count,posInSet:i+1,selection:this.selection,ownsSelection:!0,identity:void 0,expandIcon:this.iconSource("expand-icon"),collapseIcon:this.iconSource("collapse-icon"),syncOwner:this.requestContextSync,focusOwner:this.onItemFocus})}}else if(changed.has("activeId")||changed.has("data")||this.hasAuthoredItems){const nodes=this.nodeElements,count=this.hasAuthoredItems?nodes.length:this.declaredRootCount;nodes.forEach((node,i)=>{configureTreeItemOwner(node,{...treeItemOwnerContext(node),activeId:this.activeId,ancestry:[],depth:0,setSize:count,posInSet:i+1,selection:this.selection,ownsSelection:!0,identity:this.hasAuthoredItems?void 0:this.treeIdentityAt(String(i)),expandIcon:this.iconSource("expand-icon"),collapseIcon:this.iconSource("collapse-icon"),syncOwner:this.requestContextSync,focusOwner:this.onItemFocus})})}targeted||(this.contextSyncPending=!0),this.dirtyConfigureRoots.clear(),this.scheduleTreeSync()}scheduleTreeSync(){this.syncRequested=!0,!(this.syncRunning||this.bulkExpansions>0)&&(this.syncRunning=!0,this.syncTask=this.runTreeSync())}async runTreeSync(){try{for(;this.syncRequested;)this.syncRequested=!1,await super.getUpdateComplete(),await cascadeUpdateComplete(this.nodeElements),this.contextSyncPending&&(this.contextSyncPending=!1,this.applyTreeContext()),this.selectionSyncPending&&(this.selectionSyncPending=!1,this.normalizeSelection()),await cascadeUpdateComplete(this.nodeElements),this.reportRefreshSelectionChange(),this.confirmPendingReorder(),this.restorePendingFocus()}finally{this.syncRunning=!1}}rootTreeItemAncestor(node){const itemTag=tag("tree-item");let current=node;for(;current&&current.parentElement&&current.parentElement!==this;)current=current.parentElement;return current&&current.parentElement===this&&current.localName===itemTag?current:null}connectedCallback(){super.connectedCallback(),this.armChildObserver()}armChildObserver(){const ownerDocument=this.ownerDocument;if(!this.isConnected||this.childObserver&&this.childObserverDocument===ownerDocument)return;this.resetChildObserver();const MutationObserverCtor=ownerDocument.defaultView?.MutationObserver;if(!MutationObserverCtor)return;const generation=this.childObserverGeneration,observer=new MutationObserverCtor(records=>{this.childObserver!==observer||this.childObserverDocument!==ownerDocument||this.childObserverGeneration!==generation||!this.isConnected||this.ownerDocument!==ownerDocument||this.onChildMutations(records)});this.childObserver=observer,this.childObserverDocument=ownerDocument,observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["selected","disabled","inert","lazy"]})}disconnectedCallback(){super.disconnectedCallback(),this.pendingReorder=void 0,this.resetChildObserver()}adoptedCallback(){super.adoptedCallback(),this.resetChildObserver()}resetChildObserver(){this.childObserverGeneration+=1,this.childObserver?.disconnect(),this.childObserver=void 0,this.childObserverDocument=void 0}syncNodes(){const existingById=new Map;for(const node of this.nodeElements){if(!node.item)continue;const matches=existingById.get(node.item.id)??[];matches.push(node),existingById.set(node.item.id,matches)}let previousSibling=null;for(let index=0;index<this.data.length;index++){const item=this.data[index];let node=existingById.get(item.id)?.shift();node||(node=this.ownerDocument.createElement(tag("tree-item")),this.generatedNodes.add(node)),node.item=item,configureTreeItemOwner(node,{...treeItemOwnerContext(node),ancestry:[],depth:0,setSize:this.declaredRootCount,posInSet:index+1,selection:this.selection,ownsSelection:!0,identity:this.treeIdentityAt(String(index)),expandIcon:this.iconSource("expand-icon"),collapseIcon:this.iconSource("collapse-icon"),syncOwner:this.requestContextSync,focusOwner:this.onItemFocus});const targetPosition=previousSibling?previousSibling.nextElementSibling:this.firstElementChild;targetPosition!==node&&this.insertBefore(node,targetPosition),previousSibling=node}for(const nodes of existingById.values())for(const node of nodes)node.remove()}focusNode(node){node&&(this.activeId=node.nodeId,node.focus())}subtreeHasId(root,id){if(id==null)return!1;const stack=[...this.childrenOf(root)];for(let visited=0;stack.length>0&&visited<TREE_MAX_RENDER_NODES;visited++){const item=stack.pop();if(item.nodeId===id)return!0;stack.push(...this.childrenOf(item))}return!1}focusIsWithin(node){for(let current=deepActiveElementIn(this.ownerDocument);current;current=composedParentElement(current)){if(current===node)return!0;if(current===this)return!1}return!1}eventNode(e){const path=e.composedPath(),origin=path[0];if(origin?.nodeType===1&&origin.localName===tag("tree-item")){const treeTag=tag("tree");for(const target of path){if(target===this)return origin;if(target.localName===treeTag)return}return}const id=e.detail?.nodeId;return this.allNodeElements().find(candidate=>candidate.nodeId===id)}async getUpdateComplete(){let result=await super.getUpdateComplete();for(;this.syncRunning||this.isUpdatePending;)this.syncRunning&&await this.syncTask,result=await super.getUpdateComplete();return await cascadeUpdateComplete(this.nodeElements),result}reportRefreshSelectionChange(){const before=this.selectionBeforeRefresh;if(before===void 0||this.isUpdatePending)return;this.selectionBeforeRefresh=void 0;const selection=this.selectedItems;selection.length===before.length&&selection.every((item,index)=>item.nodeId===before[index])||this.emit("lr-selection-change",Object.freeze({selection}))}restorePendingFocus(){if(this.pendingFocusId==null)return;const id=this.pendingFocusId;this.pendingFocusId=null;const visible=this.visibleNodeElements();(visible.find(n=>n.nodeId===id)??visible.find(n=>n.nodeId===this.activeId))?.focus()}requestReorder(node,delta){const id=node.nodeId,found=this.findRenderedSiblings(node);if(!found)return;const{parent,siblings,index}=found,total=siblings.length,toIndex=index+delta;toIndex<0||toIndex>=total||(this.pendingReorder={node,parent,originalSiblings:[...siblings],targetSibling:siblings[toIndex],fromIndex:index,toIndex},this.emit("lr-reorder",{nodeId:id,parentNodeId:parent?.nodeId??null,fromIndex:index,toIndex}))}confirmPendingReorder(){const pending=this.pendingReorder;if(!pending)return;const found=this.findRenderedSiblings(pending.node);if(!found){this.pendingReorder=void 0;return}(found.siblings.length!==pending.originalSiblings.length||found.siblings.some((node,index)=>node!==pending.originalSiblings[index]))&&(this.pendingReorder=void 0,!(found.parent!==pending.parent||found.index!==pending.toIndex||found.siblings[pending.fromIndex]!==pending.targetSibling)&&this.liveRegion?.announce(this.localize("treeNodeMoved",void 0,{label:pending.node.nodeLabel,index:this.formatCount(found.index+1),total:this.formatCount(found.siblings.length)}),{force:!0}))}async expandAll(){const queue=this.nodeElements.map(node=>({node,depth:0})),seen=new Set;this.bulkExpansions+=1;try{for(let index=0;index<queue.length&&seen.size<TREE_MAX_RENDER_NODES;index++){const{node,depth}=queue[index];seen.has(node)||(seen.add(node),node.isDisabled?node.expanded=!1:node.hasChildren&&node.expand(),await node.updateComplete,depth<TREE_MAX_RENDER_DEPTH&&queue.push(...this.childrenOf(node).map(child=>({node:child,depth:depth+1}))))}}finally{this.bulkExpansions-=1}this.bulkExpansions===0&&this.syncRequested&&this.scheduleTreeSync(),await this.updateComplete}async collapseAll(){const focused=this.deepFocusedNode(),topLevel=this.nodeElements,nodes=this.allNodeElements();for(let index=nodes.length-1;index>=0;index--){const node=nodes[index];node.isDisabled?node.expanded=!1:node.collapse()}(this.hasAuthoredItems?topLevel.some(node=>this.isNavigable(node)&&node.nodeId===this.activeId):this.data.some(item=>!item.disabled&&item.id===this.activeId))||(this.activeId=this.hasAuthoredItems?topLevel.find(node=>this.isNavigable(node))?.nodeId??null:this.firstEnabledId(this.data)),focused&&(this.pendingFocusId=this.activeId),await cascadeUpdateComplete(topLevel)}render(){return html`
2
2
  <div
3
3
  part="base tree"
4
4
  role="tree"
@@ -1,4 +1,4 @@
1
- import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraAppearance,LyraSize,LyraVariant}from'../../../internal/variants.js';import{type FormOwnerValue}from'../../../internal/direct-form-associated.js';import{type LyraFormValidator}from'../form-validator.js';
1
+ import{type PropertyValues,type TemplateResult}from'lit';import{LyraFormControlElement}from'../../../internal/form-control-element.js';import type{LyraAppearance,LyraSize,LyraVariant}from'../../../internal/variants.js';import{type FormOwnerValue}from'../../../internal/direct-form-associated.js';import{type LyraFormValidator}from'../form-validator.js';
2
2
  /** Alias of the library's one semantic-tone vocabulary, kept as an exported name so existing
3
3
  * imports of `ButtonVariant` keep resolving while `internal/variants.ts` holds the only
4
4
  * definition. */
@@ -228,7 +228,7 @@ export type ButtonFormMethod='get'|'post'|'dialog';export interface LyraButtonEv
228
228
  * @status stable
229
229
  * @since 4.0.0
230
230
  */
231
- export declare class LyraButton extends LyraElement<LyraButtonEventMap>{
231
+ export declare class LyraButton extends LyraFormControlElement<LyraButtonEventMap>{
232
232
  /** Public WA-compatible intrinsic validator catalog. */
233
233
  static get validators():LyraFormValidator<LyraButton>[];static styles:import("lit").CSSResultGroup[];static formAssociated:boolean;static properties:{disabled:{type:BooleanConstructor;reflect:boolean;noAccessor:boolean;};name:{reflect:boolean;noAccessor:boolean;converter:import("lit").ComplexAttributeConverter<string,unknown>;};customError:{attribute:string;reflect:boolean;noAccessor:boolean;};};private _fieldsetDisabled;private _disabled;private _name;private _value;private _required;private _variant;private _type;private injectedHostTabIndex;private implicitForm;private readonly localDescriptionIds;private externalDescriptionLease?;private internals;private validityController;private customValidityMessage;private reflectingCustomError;
234
234
  /** Consumer-supplied validation message reflected through `custom-error`.
@@ -246,7 +246,7 @@ get name():string;set name(next:string|null);
246
246
  /** Whether the button is disabled explicitly or by an ancestor fieldset. */
247
247
  get effectiveDisabled():boolean;
248
248
  /** Browser-resolved form owner; assigning an ID, form element, or `null` updates `form`. */
249
- get form():HTMLFormElement|null;set form(owner:FormOwnerValue);getForm():HTMLFormElement|null;get labels():NodeList;get validity():ValidityState;get validationMessage():string;get willValidate():boolean;constructor();
249
+ get form():HTMLFormElement|null;set form(owner:FormOwnerValue);constructor();
250
250
  /** Accessible name forwarded to the internal native button or anchor. Bound to the host's
251
251
  * `aria-label` content attribute so changing or removing that attribute after mount keeps the
252
252
  * actual focused control synchronized. */
@@ -1,4 +1,4 @@
1
- var _a;import{__decorate}from"tslib";import{FormControlController,reflectFormName}from"../../../internal/form-control-controller.js";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{FORM_CONTROL_LABEL_FACTORY,LyraElement}from"../../../internal/lyra-element.js";import{installFormControlInternalsCapture}from"../../../internal/form-control-labels.js";import{chevronIcon,spinnerIcon}from"../../../internal/icons.js";import{hasIconOnlyDefaultContent,IconOnlyLabelObserver}from"../../../internal/icon-only-content.js";import{safeDownloadHref,safeLinkHref}from"../../../internal/safe-url.js";import{syncAriaControlsElements}from"../../../internal/aria-reflection.js";import{acquireNativeControlDescription}from"../../../internal/native-control-description.js";import{sizes}from"../../../internal/sizes.styles.js";import{variants}from"../../../internal/variants.styles.js";import{styles}from"./button.styles.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{getFormOwner,setFormOwner}from"../../../internal/direct-form-associated.js";import{VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState}from"../../../internal/custom-states.js";import{literalSetConverter,omittedEmptyStringConverter}from"../../../internal/converters.js";import{resolveGuardedRel}from"../../../internal/link-rel.js";import{currentValidityValidator}from"../form-validator.js";import{findDefaultButton,isImplicitSubmission,submitFormImplicitly}from"../../../internal/submit-on-enter.js";import{createButtonExternalLabelController}from"./button-external-label.js";import{LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";installFormControlInternalsCapture();const BUTTON_TYPE=literalSetConverter(["button","submit","reset"],"button"),IMPLICIT_SUBMIT_INPUT=/^(text|search|url|tel|email|password|date|month|week|time|datetime-local|number)$/;class LyraButton extends LyraElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired}}static get validators(){return[currentValidityValidator("required","disabled","loading","href","value")]}static{this.styles=[LyraElement.styles,sizes,variants,styles]}static{this.formAssociated=!0}static{this[_a]=createButtonExternalLabelController}static{this.properties={disabled:{type:Boolean,reflect:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0,converter:omittedEmptyStringConverter},customError:{attribute:"custom-error",reflect:!0,noAccessor:!0}}}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._fieldsetDisabled=this.validityController?.fieldsetDisabled(this._fieldsetDisabled)??this._fieldsetDisabled,this.requestUpdate("disabled",old),this.updateValidity(),this.syncButtonStates()}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",reflectFormName(this,this._name),this.requestUpdate("name",old)}get effectiveDisabled(){return this._disabled||this._fieldsetDisabled}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}constructor(){super(),this._fieldsetDisabled=!1,this._disabled=!1,this._name="",this._value="",this._required=!1,this._variant="neutral",this._type="button",this.injectedHostTabIndex=!1,this.implicitForm=null,this.localDescriptionIds="",this.customValidityMessage="",this.reflectingCustomError=!1,this.accessibleLabel=null,this.triggerHasPopup=null,this.triggerKeyShortcuts=null,this.triggerExpanded=null,this.triggerPressed=null,this.pressed=null,this.triggerCurrent=null,this.triggerControls=null,this.triggerDescribedBy=null,this.appearance="accent",this.size="m",this.pill=!1,this.circle=!1,this.outline=!1,this.withCaret=!1,this.withStart=!1,this.withEnd=!1,this.wrap=!1,this.formNoValidate=!1,this.loading=!1,this.hasStartSlot=!1,this.hasEndSlot=!1,this.isIconButton=!1,this.iconOnlyObserver=new IconOnlyLabelObserver(this,()=>this.labelEl,()=>this.isIconButton,next=>{this.isIconButton=next,this.syncButtonStates()}),this.onFormKeyDown=event=>{const field=event.target,form=this.implicitForm;!form||!isImplicitSubmission(event)||!(field instanceof HTMLInputElement)||!IMPLICIT_SUBMIT_INPUT.test(field.type)||field.form!==form||this.baseEl?.localName==="a"||findDefaultButton(form)!==this||(event.preventDefault(),submitFormImplicitly(form))},this.onClick=event=>{if(this.type!=="submit"&&this.type!=="reset")return;const ownerWindow=this.ownerDocument.defaultView;let settled=!1;const finish=()=>{settled||(settled=!0,ownerWindow?.removeEventListener("click",finishAtWindow),!(event.defaultPrevented||this.effectiveDisabled||this.loading)&&this.runClickDefaultAction())},finishAtWindow=candidate=>{candidate===event&&finish()};ownerWindow?.addEventListener("click",finishAtWindow),queueMicrotask(finish)},this.onFocusChange=event=>{relayNativeEvent(this,event)},this.onAdornmentSlotChange=()=>{this.syncAdornmentSlots()},this.onDefaultSlotChange=()=>{this.isIconButton=hasIconOnlyDefaultContent(this),this.syncButtonStates()},this.validityController=new FormControlController(this,{invalid:init=>this.emit("lr-invalid",null,init),customError:()=>this.customValidityMessage}),this.internals=this.validityController.formInternals,this.updateValidity(),this.syncButtonStates()}get variant(){return this._variant}set variant(next){next==="primary"?this._variant="brand":next==="default"||next==="text"?this._variant="neutral":this._variant=next,next==="text"&&(this.appearance="plain")}get caret(){return this.withCaret}set caret(next){this.withCaret=!!next}get type(){return this._type}set type(next){const old=this._type;this._type=BUTTON_TYPE.normalize(typeof next=="string"?next.toLowerCase():next),this.requestUpdate("type",old)}get value(){return this._value}set value(next){this._value=next??"",this.updateValidity()}get required(){return this._required}set required(next){this._required=!!next,this.updateValidity()}get resolvedRel(){return resolveGuardedRel(this.rel,this.target)}click(){this.effectiveDisabled||this.loading||this.baseEl?.click()}focus(options){!this.effectiveDisabled&&!this.loading&&this.baseEl?.focus(options)}blur(){this.baseEl?.blur()}[(_a=FORM_CONTROL_LABEL_FACTORY,VALIDITY_ANCHOR)](){return this.baseEl??null}checkValidity(){return this.validityController.checkValidity()}reportValidity(){return this.validityController.syncConstraints(),this.internals.reportValidity()}setCustomValidity(message){const old=this.customValidityMessage||null,next=message??"";if(this.customValidityMessage=next,this.validityController.setCustomValidity(this.isValidationBarred?"":next),!this.reflectingCustomError){this.reflectingCustomError=!0;try{next?this.setAttribute("custom-error",next):this.removeAttribute("custom-error")}finally{this.reflectingCustomError=!1}}this.requestUpdate("customError",old)}resetValidity(){this.customValidityMessage="",this.validityController.setCustomValidity(""),this.updateValidity()}formStateRestoreCallback(state2,reason){this.value=typeof state2=="string"?state2:""}syncImplicitSubmission(form=this.getForm()){const next=this.type==="submit"&&this.isConnected?form:null;next!==this.implicitForm&&(this.implicitForm?.removeEventListener("keydown",this.onFormKeyDown),this.implicitForm=next,next?.addEventListener("keydown",this.onFormKeyDown))}formAssociatedCallback(form){this.syncImplicitSubmission(form)}runClickDefaultAction(){if(this.type==="submit"){const form=this.getForm();if(!form)return;this.hasSubmitterOverrides?this.submitAsNamedSubmitter(form):form.requestSubmit()}else this.type==="reset"&&this.getForm()?.reset()}get hasSubmitterOverrides(){return!!(this.name||this.value||this.formNoValidate)||this.formAction!==void 0||this.formEnctype!==void 0||this.formMethod!==void 0||this.formTarget!==void 0}submitAsNamedSubmitter(form){const submitter=this.ownerDocument.createElement("button");submitter.type="submit",submitter.hidden=!0,submitter.tabIndex=-1,this.name&&(submitter.name=this.name,submitter.value=this.value),this.formAction!==void 0&&submitter.setAttribute("formaction",this.formAction),this.formEnctype!==void 0&&submitter.setAttribute("formenctype",this.formEnctype),this.formMethod!==void 0&&submitter.setAttribute("formmethod",this.formMethod),this.formNoValidate&&(submitter.formNoValidate=!0),this.formTarget!==void 0&&submitter.setAttribute("formtarget",this.formTarget),this.parentElement&&this.closest("form")===form?this.insertAdjacentElement("afterend",submitter):form.append(submitter);try{form.requestSubmit(submitter)}finally{submitter.remove()}}formDisabledCallback(disabled){if(this.validityController?.reflectingDisabled)return;const wasDisabled=this.effectiveDisabled;this._fieldsetDisabled=disabled,wasDisabled!==this.effectiveDisabled&&(this.updateValidity(),this.syncButtonStates(),this.requestUpdate())}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.syncDescribedByElements(),this.syncImplicitSubmission(),this.updateValidity(),this.syncButtonStates(),this.hasUpdated&&this.iconOnlyObserver.arm()}disconnectedCallback(){this.releaseExternalDescription(),this.syncImplicitSubmission(null),this.iconOnlyObserver.disarm(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.releaseExternalDescription(),this.isConnected&&this.hasUpdated&&this.syncDescribedByElements()}willUpdate(changed){super.willUpdate(changed),changed.has("loading")&&this.loading&&this.shadowRoot?.activeElement===this.baseEl&&(this.hasAttribute("tabindex")||(this.tabIndex=-1,this.injectedHostTabIndex=!0),HTMLElement.prototype.focus.call(this,{preventScroll:!0})),this.hasUpdated||this.seedFirstRenderState(()=>{this.syncAdornmentSlots(),this.isIconButton=hasIconOnlyDefaultContent(this)})}syncAdornmentSlots(){const collection=this.children,children=collection?Array.from(collection):[];this.hasStartSlot=children.some(element=>{const slot=element.getAttribute("slot");return slot==="start"||slot==="prefix"}),this.hasEndSlot=children.some(element=>{const slot=element.getAttribute("slot");return slot==="end"||slot==="suffix"})}get labelGrows(){return this.withCaret||this.hasEndSlot||this.withEnd}updated(changed){if(super.updated(changed),changed.has("type")&&this.syncImplicitSubmission(),changed.has("loading")&&!this.loading&&this.injectedHostTabIndex){const parked=this.ownerDocument.activeElement===this&&!this.shadowRoot?.activeElement;this.removeAttribute("tabindex"),this.injectedHostTabIndex=!1,parked&&this.baseEl?.focus({preventScroll:!0})}syncAriaControlsElements(this,this.baseEl,this.triggerControls),this.syncDescribedByElements(),this.iconOnlyObserver.arm(),this.updateValidity(),this.syncButtonStates()}updateValidity(){if(this.validityController){if(this.isValidationBarred){this.validityController.setCustomValidity(""),this.validityController.setValidity({});return}this.required&&!this.value?this.validityController.setValidity({valueMissing:!0},this.localize("fieldRequired")):this.validityController.setValidity({}),this.validityController.setCustomValidity(this.customValidityMessage)}}get isValidationBarred(){return this.effectiveDisabled||this.loading||this.baseEl?.localName==="a"}syncButtonStates(){this.internals&&(setCustomState(this.internals,"disabled",this.effectiveDisabled||this.loading),setCustomState(this.internals,"icon-button",this.isIconButton),setCustomState(this.internals,"link",this.baseEl?.localName==="a"),setCustomState(this.internals,"loading",this.loading))}syncDescribedByElements(){const target=this.isConnected?this.baseEl:void 0;if(!target){this.releaseExternalDescription();return}this.externalDescriptionLease?this.externalDescriptionLease.update(target):this.externalDescriptionLease=acquireNativeControlDescription(this,target,()=>this.localDescriptionIds)}releaseExternalDescription(){this.externalDescriptionLease?.release(),this.externalDescriptionLease=void 0}render(){const pressed=this.pressed==="mixed"?"mixed":typeof this.pressed=="boolean"?String(this.pressed):["true","false","mixed"].includes(this.triggerPressed??"")?this.triggerPressed:nothing,current=["page","step","location","date","time","true","false"].includes(this.triggerCurrent??"")?this.triggerCurrent:nothing,content=html`
1
+ var _a;import{__decorate}from"tslib";import{FormControlController,reflectFormName}from"../../../internal/form-control-controller.js";import{html,nothing}from"lit";import{property,query,state}from"lit/decorators.js";import{FORM_CONTROL_LABEL_FACTORY,LyraElement}from"../../../internal/lyra-element.js";import{LyraFormControlElement}from"../../../internal/form-control-element.js";import{installFormControlInternalsCapture}from"../../../internal/form-control-labels.js";import{chevronIcon,spinnerIcon}from"../../../internal/icons.js";import{hasIconOnlyDefaultContent,IconOnlyLabelObserver}from"../../../internal/icon-only-content.js";import{safeDownloadHref,safeLinkHref}from"../../../internal/safe-url.js";import{syncAriaControlsElements}from"../../../internal/aria-reflection.js";import{acquireNativeControlDescription}from"../../../internal/native-control-description.js";import{sizes}from"../../../internal/sizes.styles.js";import{variants}from"../../../internal/variants.styles.js";import{styles}from"./button.styles.js";import{relayNativeEvent}from"../../../internal/native-event-relay.js";import{getFormOwner,setFormOwner}from"../../../internal/direct-form-associated.js";import{VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState}from"../../../internal/custom-states.js";import{literalSetConverter,omittedEmptyStringConverter}from"../../../internal/converters.js";import{resolveGuardedRel}from"../../../internal/link-rel.js";import{currentValidityValidator}from"../form-validator.js";import{findDefaultButton,isImplicitSubmission,submitFormImplicitly}from"../../../internal/submit-on-enter.js";import{createButtonExternalLabelController}from"./button-external-label.js";import{shadowFocusTarget}from"../../../internal/active-element.js";import{LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";installFormControlInternalsCapture();const BUTTON_TYPE=literalSetConverter(["button","submit","reset"],"button"),IMPLICIT_SUBMIT_INPUT=/^(text|search|url|tel|email|password|date|month|week|time|datetime-local|number)$/;class LyraButton extends LyraFormControlElement{static{this.defaultStrings={...super.defaultStrings,fieldRequired:LYRA_DEFAULT_fieldRequired}}static get validators(){return[currentValidityValidator("required","disabled","loading","href","value")]}static{this.styles=[LyraElement.styles,sizes,variants,styles]}static{this.formAssociated=!0}static{this[_a]=createButtonExternalLabelController}static{this.properties={disabled:{type:Boolean,reflect:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0,converter:omittedEmptyStringConverter},customError:{attribute:"custom-error",reflect:!0,noAccessor:!0}}}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._fieldsetDisabled=this.validityController?.fieldsetDisabled(this._fieldsetDisabled)??this._fieldsetDisabled,this.requestUpdate("disabled",old),this.updateValidity(),this.syncButtonStates()}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",reflectFormName(this,this._name),this.requestUpdate("name",old)}get effectiveDisabled(){return this._disabled||this._fieldsetDisabled}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}constructor(){super(),this._fieldsetDisabled=!1,this._disabled=!1,this._name="",this._value="",this._required=!1,this._variant="neutral",this._type="button",this.injectedHostTabIndex=!1,this.implicitForm=null,this.localDescriptionIds="",this.customValidityMessage="",this.reflectingCustomError=!1,this.accessibleLabel=null,this.triggerHasPopup=null,this.triggerKeyShortcuts=null,this.triggerExpanded=null,this.triggerPressed=null,this.pressed=null,this.triggerCurrent=null,this.triggerControls=null,this.triggerDescribedBy=null,this.appearance="accent",this.size="m",this.pill=!1,this.circle=!1,this.outline=!1,this.withCaret=!1,this.withStart=!1,this.withEnd=!1,this.wrap=!1,this.formNoValidate=!1,this.loading=!1,this.hasStartSlot=!1,this.hasEndSlot=!1,this.isIconButton=!1,this.iconOnlyObserver=new IconOnlyLabelObserver(this,()=>this.labelEl,()=>this.isIconButton,next=>{this.isIconButton=next,this.syncButtonStates()}),this.onFormKeyDown=event=>{const field=event.target,form=this.implicitForm;!form||!isImplicitSubmission(event)||!(field instanceof HTMLInputElement)||!IMPLICIT_SUBMIT_INPUT.test(field.type)||field.form!==form||this.baseEl?.localName==="a"||findDefaultButton(form)!==this||(event.preventDefault(),submitFormImplicitly(form))},this.onClick=event=>{if(this.type!=="submit"&&this.type!=="reset")return;const ownerWindow=this.ownerDocument.defaultView;let settled=!1;const finish=()=>{settled||(settled=!0,ownerWindow?.removeEventListener("click",finishAtWindow),!(event.defaultPrevented||this.effectiveDisabled||this.loading)&&this.runClickDefaultAction())},finishAtWindow=candidate=>{candidate===event&&finish()};ownerWindow?.addEventListener("click",finishAtWindow),queueMicrotask(finish)},this.onFocusChange=event=>{relayNativeEvent(this,event)},this.onAdornmentSlotChange=()=>{this.syncAdornmentSlots()},this.onDefaultSlotChange=()=>{this.isIconButton=hasIconOnlyDefaultContent(this),this.syncButtonStates()},this.validityController=new FormControlController(this,{invalid:init=>this.emit("lr-invalid",null,init),customError:()=>this.customValidityMessage}),this.internals=this.validityController.formInternals,this.updateValidity(),this.syncButtonStates()}get variant(){return this._variant}set variant(next){next==="primary"?this._variant="brand":next==="default"||next==="text"?this._variant="neutral":this._variant=next,next==="text"&&(this.appearance="plain")}get caret(){return this.withCaret}set caret(next){this.withCaret=!!next}get type(){return this._type}set type(next){const old=this._type;this._type=BUTTON_TYPE.normalize(typeof next=="string"?next.toLowerCase():next),this.requestUpdate("type",old)}get value(){return this._value}set value(next){this._value=next??"",this.updateValidity()}get required(){return this._required}set required(next){this._required=!!next,this.updateValidity()}get resolvedRel(){return resolveGuardedRel(this.rel,this.target)}click(){this.effectiveDisabled||this.loading||this.baseEl?.click()}focus(options){!this.effectiveDisabled&&!this.loading&&this.baseEl?.focus(options)}blur(){this.baseEl?.blur()}[(_a=FORM_CONTROL_LABEL_FACTORY,VALIDITY_ANCHOR)](){return this.baseEl??null}checkValidity(){return this.validityController.checkValidity()}reportValidity(){return this.validityController.syncConstraints(),this.internals.reportValidity()}setCustomValidity(message){const old=this.customValidityMessage||null,next=message??"";if(this.customValidityMessage=next,this.validityController.setCustomValidity(this.isValidationBarred?"":next),!this.reflectingCustomError){this.reflectingCustomError=!0;try{next?this.setAttribute("custom-error",next):this.removeAttribute("custom-error")}finally{this.reflectingCustomError=!1}}this.requestUpdate("customError",old)}resetValidity(){this.customValidityMessage="",this.validityController.setCustomValidity(""),this.updateValidity()}formStateRestoreCallback(state2,reason){this.value=typeof state2=="string"?state2:""}syncImplicitSubmission(form=this.getForm()){const next=this.type==="submit"&&this.isConnected?form:null;next!==this.implicitForm&&(this.implicitForm?.removeEventListener("keydown",this.onFormKeyDown),this.implicitForm=next,next?.addEventListener("keydown",this.onFormKeyDown))}formAssociatedCallback(form){this.syncImplicitSubmission(form)}runClickDefaultAction(){if(this.type==="submit"){const form=this.getForm();if(!form)return;this.hasSubmitterOverrides?this.submitAsNamedSubmitter(form):form.requestSubmit()}else this.type==="reset"&&this.getForm()?.reset()}get hasSubmitterOverrides(){return!!(this.name||this.value||this.formNoValidate)||this.formAction!==void 0||this.formEnctype!==void 0||this.formMethod!==void 0||this.formTarget!==void 0}submitAsNamedSubmitter(form){const submitter=this.ownerDocument.createElement("button");submitter.type="submit",submitter.hidden=!0,submitter.tabIndex=-1,this.name&&(submitter.name=this.name,submitter.value=this.value),this.formAction!==void 0&&submitter.setAttribute("formaction",this.formAction),this.formEnctype!==void 0&&submitter.setAttribute("formenctype",this.formEnctype),this.formMethod!==void 0&&submitter.setAttribute("formmethod",this.formMethod),this.formNoValidate&&(submitter.formNoValidate=!0),this.formTarget!==void 0&&submitter.setAttribute("formtarget",this.formTarget),this.parentElement&&this.closest("form")===form?this.insertAdjacentElement("afterend",submitter):form.append(submitter);try{form.requestSubmit(submitter)}finally{submitter.remove()}}formDisabledCallback(disabled){if(this.validityController?.reflectingDisabled)return;const wasDisabled=this.effectiveDisabled;this._fieldsetDisabled=disabled,wasDisabled!==this.effectiveDisabled&&(this.updateValidity(),this.syncButtonStates(),this.requestUpdate())}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.syncDescribedByElements(),this.syncImplicitSubmission(),this.updateValidity(),this.syncButtonStates(),this.hasUpdated&&this.iconOnlyObserver.arm()}disconnectedCallback(){this.releaseExternalDescription(),this.syncImplicitSubmission(null),this.iconOnlyObserver.disarm(),super.disconnectedCallback()}adoptedCallback(){super.adoptedCallback(),this.releaseExternalDescription(),this.isConnected&&this.hasUpdated&&this.syncDescribedByElements()}willUpdate(changed){super.willUpdate(changed);const focusedControl=shadowFocusTarget(this);changed.has("loading")&&this.loading&&focusedControl!==null&&focusedControl===this.baseEl&&(this.hasAttribute("tabindex")||(this.tabIndex=-1,this.injectedHostTabIndex=!0),HTMLElement.prototype.focus.call(this,{preventScroll:!0})),this.hasUpdated||this.seedFirstRenderState(()=>{this.syncAdornmentSlots(),this.isIconButton=hasIconOnlyDefaultContent(this)})}syncAdornmentSlots(){const collection=this.children,children=collection?Array.from(collection):[];this.hasStartSlot=children.some(element=>{const slot=element.getAttribute("slot");return slot==="start"||slot==="prefix"}),this.hasEndSlot=children.some(element=>{const slot=element.getAttribute("slot");return slot==="end"||slot==="suffix"})}get labelGrows(){return this.withCaret||this.hasEndSlot||this.withEnd}updated(changed){if(super.updated(changed),changed.has("type")&&this.syncImplicitSubmission(),changed.has("loading")&&!this.loading&&this.injectedHostTabIndex){const parked=this.ownerDocument.activeElement===this&&!shadowFocusTarget(this);this.removeAttribute("tabindex"),this.injectedHostTabIndex=!1,parked&&this.baseEl?.focus({preventScroll:!0})}syncAriaControlsElements(this,this.baseEl,this.triggerControls),this.syncDescribedByElements(),this.iconOnlyObserver.arm(),this.updateValidity(),this.syncButtonStates()}updateValidity(){if(this.validityController){if(this.isValidationBarred){this.validityController.setCustomValidity(""),this.validityController.setValidity({});return}this.required&&!this.value?this.validityController.setValidity({valueMissing:!0},this.localize("fieldRequired")):this.validityController.setValidity({}),this.validityController.setCustomValidity(this.customValidityMessage)}}get isValidationBarred(){return this.effectiveDisabled||this.loading||this.baseEl?.localName==="a"}syncButtonStates(){this.internals&&(setCustomState(this.internals,"disabled",this.effectiveDisabled||this.loading),setCustomState(this.internals,"icon-button",this.isIconButton),setCustomState(this.internals,"link",this.baseEl?.localName==="a"),setCustomState(this.internals,"loading",this.loading))}syncDescribedByElements(){const target=this.isConnected?this.baseEl:void 0;if(!target){this.releaseExternalDescription();return}this.externalDescriptionLease?this.externalDescriptionLease.update(target):this.externalDescriptionLease=acquireNativeControlDescription(this,target,()=>this.localDescriptionIds)}releaseExternalDescription(){this.externalDescriptionLease?.release(),this.externalDescriptionLease=void 0}render(){const pressed=this.pressed==="mixed"?"mixed":typeof this.pressed=="boolean"?String(this.pressed):["true","false","mixed"].includes(this.triggerPressed??"")?this.triggerPressed:nothing,current=["page","step","location","date","time","true","false"].includes(this.triggerCurrent??"")?this.triggerCurrent:nothing,content=html`
2
2
  <span
3
3
  part="start prefix"
4
4
  ?hidden=${!(this.hasStartSlot||this.withStart)}
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{noChange,nothing}from"lit";import{html,unsafeStatic}from"lit/static-html.js";import{property}from"lit/decorators.js";import{LyraElement}from"../../internal/lyra-element.js";import{FormAssociated,isBarredFromValidation}from"../../internal/form-associated.js";import{resolveValidityAnchor,SET_ANCHORED_VALIDITY,VALIDITY_ANCHOR}from"../../internal/anchored-validity.js";import{acquireResolvedAriaRelationship}from"../../internal/aria-controls.js";import{collectionSupport}from"../../internal/collection-snapshot.js";import{autocorrectConverter,spellcheckConverter}from"../../internal/converters.js";import{dispatchNativeEvent,relayNativeEvent}from"../../internal/native-event-relay.js";import{activeElementIn,deepActiveElementIn}from"../../internal/active-element.js";import{submitOnEnter}from"../../internal/submit-on-enter.js";import{SlotPresenceController}from"../../internal/slot-presence-controller.js";import{tag}from"../../internal/prefix.js";import{resolveEffectivePositioningStrategy}from"../../internal/positioning-strategy.js";import{hasCustomState}from"../../internal/custom-states.js";import{normalizeSelectionValue}from"../../internal/selection-catalog.js";import{styles}from"./catalog-picker-base.styles.js";class CatalogPickerElement extends LyraElement{}const resolvedRows=new WeakMap,pickerSpellcheckConverter={...spellcheckConverter,fromAttribute:value=>value===null?!1:spellcheckConverter.fromAttribute(value,Boolean)};class LyraCatalogPickerBase extends FormAssociated(CatalogPickerElement){static{this.styles=[LyraElement.styles,styles]}static{this.collectionSupport=collectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-input","lr-change"])}get autocorrect(){return this.autocorrectValue}set autocorrect(next){this.autocorrectValue=!!next,this.requestUpdate()}normalizeValue(value){return normalizeSelectionValue(value)}renderAdornment(_row){return nothing}optionDisplay(row){return{label:row.label,sub:[row.code,row.symbol].filter(text=>!!text&&text!==row.label).join(" · ")}}renderStart(row){const content=this.renderAdornment(row);return content===nothing?nothing:html`<span slot="start">${content}</span>`}get value(){return super.value}set value(next){super.value=this.normalizeValue(next)}get defaultValue(){return super.defaultValue}set defaultValue(next){super.defaultValue=next===null?null:this.normalizeValue(next)}get input(){return this.searchable?this.combobox?.input??null:null}get control(){return this.renderRoot?.querySelector(`${tag("select")},${tag("combobox")}`)??void 0}get combobox(){return this.renderRoot?.querySelector(tag("combobox"))??void 0}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}get rows(){const entries=this.entries,locale=this.effectiveLocale;let byLocale=resolvedRows.get(entries);byLocale||resolvedRows.set(entries,byLocale=new Map);let rows=byLocale.get(locale);return rows||byLocale.set(locale,rows=this.resolveRows()),rows}constructor(){super(),this.label="",this.hint="",this.errorText="",this.accessibleLabel=null,this.size="m",this.clearable=!1,this.searchable=!1,this.topLayer=!1,this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.spellcheck=!1,this.autocapitalize="",this.autocorrectValue=!0,this.slots=new SlotPresenceController(this),this.projectionToken=0,this.restoreFocus=!1,this.validationController={hostUpdated:()=>this.projectValidation()},this.onControlEvent=event=>{const child=this.control;if(!child||event.target!==child||(event.stopPropagation(),event.type!=="lr-change"))return;const raw=event.detail.value,next=raw===null?"":raw;if(this.liveDisabled||typeof next!="string"||next&&!this.entries.some(row=>row.code===next&&!row.disabled)){this.syncChildValue(child);return}if(next===this.value)return;const previousValue=this.value;this.value=next;const detail={value:this.value,previousValue};dispatchNativeEvent(this,"input"),this.emit("lr-input",detail),dispatchNativeEvent(this,"change"),this.emit("lr-change",detail)},this.onControlFocus=event=>{event.target===this.control&&(event.stopPropagation(),this.replacingControl||relayNativeEvent(this,event))},this.onControlFocusOut=event=>{event.target===this.replacingControl&&event.stopPropagation()},this.onControlKeyDown=event=>{!this.liveDisabled&&this.searchable&&event.target===this.control&&event.composedPath()[0]===this.input&&submitOnEnter(this,event)},this.usingCombobox=!1,this.addEventListener("invalid",()=>this.projectValidation())}updateValidity(){this.internals&&(isBarredFromValidation(this,this.internals)?this[SET_ANCHORED_VALIDITY]({}):this.value&&!this.entries.some(row=>row.code===this.value&&!row.disabled)?this[SET_ANCHORED_VALIDITY]({customError:!0},this.localize("notInCatalog")):this.required&&!this.value?this[SET_ANCHORED_VALIDITY]({valueMissing:!0},this.localize("fieldRequired")):this[SET_ANCHORED_VALIDITY]({}))}[VALIDITY_ANCHOR](){return resolveValidityAnchor(this.control)??null}focus(options){this.liveDisabled||this.control?.focus(options)}blur(){this.control?.blur()}click(){this.liveDisabled||this.control?.click()}syncChildValue(child){child.value="inputValue"in child?this.value||null:this.value}clearTransientState(){const child=this.control;child&&(child.open=!1,child.formResetCallback(),this.syncChildValue(child))}projectValidation(){const child=this.validationChild;!child||!this.isConnected||child!==this.control||this.validationDocument!==this.ownerDocument||resolveValidityAnchor(child)?.setAttribute("aria-invalid",hasCustomState(this.internals,"user-invalid")?"true":"false")}syncRelationships(){const anchor=this[VALIDITY_ANCHOR]();this.descriptionLease?this.descriptionLease.update(anchor):this.descriptionLease=acquireResolvedAriaRelationship(this,anchor,"aria-describedby"),this.accessibleLabel!==null?(this.labelLease?.release(),this.labelLease=void 0):this.labelLease?this.labelLease.update(anchor):this.labelLease=acquireResolvedAriaRelationship(this,anchor,"aria-labelledby"),anchor&&this.projectedAnchor!==anchor&&(this.projectedAnchor=anchor,this.requestUpdate())}get comboboxDefined(){return globalThis.customElements?.get(tag("combobox"))!==void 0}async getUpdateComplete(){const done=await super.getUpdateComplete(),load=this.comboboxLoad;return load?(await load,this.getUpdateComplete()):done}willUpdate(changed){if(super.willUpdate(changed),this.searchable&&!this.comboboxDefined&&!this.comboboxLoad){const load=import("./combobox/combobox-catalog.js").then(()=>this.requestUpdate(),()=>{});this.comboboxLoad=load,load.then(()=>{this.comboboxLoad===load&&(this.comboboxLoad=void 0)})}const child=this.control,combobox=this.searchable&&this.comboboxDefined;combobox!==this.usingCombobox&&child&&(this.replacingControl=child,this.restoreFocus=activeElementIn(this.shadowRoot)===child||this.focusReplacement===child,this.focusReplacement=void 0,this.clearTransientState()),this.usingCombobox=combobox}updated(changed){super.updated(changed);const child=this.control;this.restoreFocus&&(this.focusReplacement=child),this.restoreFocus=!1,this.replacingControl=void 0,(this.validationChild!==child||this.validationDocument!==this.ownerDocument)&&(this.validationChild?.removeController(this.validationController),this.validationChild=child,this.validationDocument=this.ownerDocument,child?.addController(this.validationController)),this.projectValidation();const token=++this.projectionToken,document=this.ownerDocument;child&&child.updateComplete.then(()=>{if(!(token!==this.projectionToken||!this.isConnected||this.ownerDocument!==document||child!==this.control)&&(this.syncRelationships(),this.focusReplacement===child)){this.focusReplacement=void 0;const active=deepActiveElementIn(document);!this.liveDisabled&&(!active||active===document.body||active===this||active===child)&&(child.focus({preventScroll:!0}),child.hide())}})}connectedCallback(){super.connectedCallback(),this.requestUpdate()}adoptedCallback(){super.adoptedCallback(),this.requestUpdate()}formResetCallback(){super.formResetCallback(),this.clearTransientState(),this.projectValidation()}formStateRestoreCallback(state,reason){super.formStateRestoreCallback(state,reason),this.clearTransientState(),this.projectValidation()}disconnectedCallback(){++this.projectionToken,this.clearTransientState(),this.restoreFocus=!1,this.focusReplacement=void 0,this.replacingControl=void 0,this.validationChild?.removeController(this.validationController),this.validationChild=void 0,this.validationDocument=void 0,this.projectedAnchor=void 0,this.labelLease?.release(),this.labelLease=void 0,this.descriptionLease?.release(),this.descriptionLease=void 0,super.disconnectedCallback()}render(){const controlTag=unsafeStatic(tag(this.usingCombobox?"combobox":"select")),optionTag=unsafeStatic(tag("option")),hasLabel=!!this.label||this.slots.has("label"),current=this.rows.find(row=>row.code===this.value),exportParts=["form-control,form-control-label",this.usingCombobox?"combobox:select-trigger,combobox-input:select-display-input":"trigger:select-trigger,display-input:select-display-input","listbox:select-listbox,option:select-option,option-sub:select-option-sub,group-label:select-group-label,clear-button:select-clear-button,flag,hint,error"].join(",");return html`<${controlTag}
1
+ import{__decorate}from"tslib";import{noChange,nothing}from"lit";import{html,unsafeStatic}from"lit/static-html.js";import{property}from"lit/decorators.js";import{LyraElement}from"../../internal/lyra-element.js";import{FormAssociated,isBarredFromValidation}from"../../internal/form-associated.js";import{resolveValidityAnchor,SET_ANCHORED_VALIDITY,VALIDITY_ANCHOR}from"../../internal/anchored-validity.js";import{acquireResolvedAriaRelationship}from"../../internal/aria-controls.js";import{collectionSupport}from"../../internal/collection-snapshot.js";import{autocorrectConverter,spellcheckConverter}from"../../internal/converters.js";import{dispatchNativeEvent,relayNativeEvent}from"../../internal/native-event-relay.js";import{deepActiveElementIn,shadowFocusTarget}from"../../internal/active-element.js";import{submitOnEnter}from"../../internal/submit-on-enter.js";import{SlotPresenceController}from"../../internal/slot-presence-controller.js";import{tag}from"../../internal/prefix.js";import{resolveEffectivePositioningStrategy}from"../../internal/positioning-strategy.js";import{hasCustomState}from"../../internal/custom-states.js";import{normalizeSelectionValue}from"../../internal/selection-catalog.js";import{styles}from"./catalog-picker-base.styles.js";class CatalogPickerElement extends LyraElement{}const resolvedRows=new WeakMap,pickerSpellcheckConverter={...spellcheckConverter,fromAttribute:value=>value===null?!1:spellcheckConverter.fromAttribute(value,Boolean)};class LyraCatalogPickerBase extends FormAssociated(CatalogPickerElement){static{this.styles=[LyraElement.styles,styles]}static{this.collectionSupport=collectionSupport}static{this.immutableEventDetails=Object.freeze(["lr-input","lr-change"])}get autocorrect(){return this.autocorrectValue}set autocorrect(next){this.autocorrectValue=!!next,this.requestUpdate()}normalizeValue(value){return normalizeSelectionValue(value)}renderAdornment(_row){return nothing}optionDisplay(row){return{label:row.label,sub:[row.code,row.symbol].filter(text=>!!text&&text!==row.label).join(" · ")}}renderStart(row){const content=this.renderAdornment(row);return content===nothing?nothing:html`<span slot="start">${content}</span>`}get value(){return super.value}set value(next){super.value=this.normalizeValue(next)}get defaultValue(){return super.defaultValue}set defaultValue(next){super.defaultValue=next===null?null:this.normalizeValue(next)}get input(){return this.searchable?this.combobox?.input??null:null}get control(){return this.renderRoot?.querySelector(`${tag("select")},${tag("combobox")}`)??void 0}get combobox(){return this.renderRoot?.querySelector(tag("combobox"))??void 0}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}get rows(){const entries=this.entries,locale=this.effectiveLocale;let byLocale=resolvedRows.get(entries);byLocale||resolvedRows.set(entries,byLocale=new Map);let rows=byLocale.get(locale);return rows||byLocale.set(locale,rows=this.resolveRows()),rows}constructor(){super(),this.label="",this.hint="",this.errorText="",this.accessibleLabel=null,this.size="m",this.clearable=!1,this.searchable=!1,this.topLayer=!1,this.autocomplete="off",this.inputMode="",this.enterKeyHint="",this.spellcheck=!1,this.autocapitalize="",this.autocorrectValue=!0,this.slots=new SlotPresenceController(this),this.projectionToken=0,this.restoreFocus=!1,this.validationController={hostUpdated:()=>this.projectValidation()},this.onControlEvent=event=>{const child=this.control;if(!child||event.target!==child||(event.stopPropagation(),event.type!=="lr-change"))return;const raw=event.detail.value,next=raw===null?"":raw;if(this.liveDisabled||typeof next!="string"||next&&!this.entries.some(row=>row.code===next&&!row.disabled)){this.syncChildValue(child);return}if(next===this.value)return;const previousValue=this.value;this.value=next;const detail={value:this.value,previousValue};dispatchNativeEvent(this,"input"),this.emit("lr-input",detail),dispatchNativeEvent(this,"change"),this.emit("lr-change",detail)},this.onControlFocus=event=>{event.target===this.control&&(event.stopPropagation(),this.replacingControl||relayNativeEvent(this,event))},this.onControlFocusOut=event=>{event.target===this.replacingControl&&event.stopPropagation()},this.onControlKeyDown=event=>{!this.liveDisabled&&this.searchable&&event.target===this.control&&event.composedPath()[0]===this.input&&submitOnEnter(this,event)},this.usingCombobox=!1,this.addEventListener("invalid",()=>this.projectValidation())}updateValidity(){this.internals&&(isBarredFromValidation(this,this.internals)?this[SET_ANCHORED_VALIDITY]({}):this.value&&!this.entries.some(row=>row.code===this.value&&!row.disabled)?this[SET_ANCHORED_VALIDITY]({customError:!0},this.localize("notInCatalog")):this.required&&!this.value?this[SET_ANCHORED_VALIDITY]({valueMissing:!0},this.localize("fieldRequired")):this[SET_ANCHORED_VALIDITY]({}))}[VALIDITY_ANCHOR](){return resolveValidityAnchor(this.control)??null}focus(options){this.liveDisabled||this.control?.focus(options)}blur(){this.control?.blur()}click(){this.liveDisabled||this.control?.click()}syncChildValue(child){child.value="inputValue"in child?this.value||null:this.value}clearTransientState(){const child=this.control;child&&(child.open=!1,child.formResetCallback(),this.syncChildValue(child))}projectValidation(){const child=this.validationChild;!child||!this.isConnected||child!==this.control||this.validationDocument!==this.ownerDocument||resolveValidityAnchor(child)?.setAttribute("aria-invalid",hasCustomState(this.internals,"user-invalid")?"true":"false")}syncRelationships(){const anchor=this[VALIDITY_ANCHOR]();this.descriptionLease?this.descriptionLease.update(anchor):this.descriptionLease=acquireResolvedAriaRelationship(this,anchor,"aria-describedby"),this.accessibleLabel!==null?(this.labelLease?.release(),this.labelLease=void 0):this.labelLease?this.labelLease.update(anchor):this.labelLease=acquireResolvedAriaRelationship(this,anchor,"aria-labelledby"),anchor&&this.projectedAnchor!==anchor&&(this.projectedAnchor=anchor,this.requestUpdate())}get comboboxDefined(){return globalThis.customElements?.get(tag("combobox"))!==void 0}async getUpdateComplete(){const done=await super.getUpdateComplete(),load=this.comboboxLoad;return load?(await load,this.getUpdateComplete()):done}willUpdate(changed){if(super.willUpdate(changed),this.searchable&&!this.comboboxDefined&&!this.comboboxLoad){const load=import("./combobox/combobox-catalog.js").then(()=>this.requestUpdate(),()=>{});this.comboboxLoad=load,load.then(()=>{this.comboboxLoad===load&&(this.comboboxLoad=void 0)})}const child=this.control,combobox=this.searchable&&this.comboboxDefined;combobox!==this.usingCombobox&&child&&(this.replacingControl=child,this.restoreFocus=shadowFocusTarget(this)===child||this.focusReplacement===child,this.focusReplacement=void 0,this.clearTransientState()),this.usingCombobox=combobox}updated(changed){super.updated(changed);const child=this.control;this.restoreFocus&&(this.focusReplacement=child),this.restoreFocus=!1,this.replacingControl=void 0,(this.validationChild!==child||this.validationDocument!==this.ownerDocument)&&(this.validationChild?.removeController(this.validationController),this.validationChild=child,this.validationDocument=this.ownerDocument,child?.addController(this.validationController)),this.projectValidation();const token=++this.projectionToken,document=this.ownerDocument;child&&child.updateComplete.then(()=>{if(!(token!==this.projectionToken||!this.isConnected||this.ownerDocument!==document||child!==this.control)&&(this.syncRelationships(),this.focusReplacement===child)){this.focusReplacement=void 0;const active=deepActiveElementIn(document);!this.liveDisabled&&(!active||active===document.body||active===this||active===child)&&(child.focus({preventScroll:!0}),child.hide())}})}connectedCallback(){super.connectedCallback(),this.requestUpdate()}adoptedCallback(){super.adoptedCallback(),this.requestUpdate()}formResetCallback(){super.formResetCallback(),this.clearTransientState(),this.projectValidation()}formStateRestoreCallback(state,reason){super.formStateRestoreCallback(state,reason),this.clearTransientState(),this.projectValidation()}disconnectedCallback(){++this.projectionToken,this.clearTransientState(),this.restoreFocus=!1,this.focusReplacement=void 0,this.replacingControl=void 0,this.validationChild?.removeController(this.validationController),this.validationChild=void 0,this.validationDocument=void 0,this.projectedAnchor=void 0,this.labelLease?.release(),this.labelLease=void 0,this.descriptionLease?.release(),this.descriptionLease=void 0,super.disconnectedCallback()}render(){const controlTag=unsafeStatic(tag(this.usingCombobox?"combobox":"select")),optionTag=unsafeStatic(tag("option")),hasLabel=!!this.label||this.slots.has("label"),current=this.rows.find(row=>row.code===this.value),exportParts=["form-control,form-control-label",this.usingCombobox?"combobox:select-trigger,combobox-input:select-display-input":"trigger:select-trigger,display-input:select-display-input","listbox:select-listbox,option:select-option,option-sub:select-option-sub,group-label:select-group-label,clear-button:select-clear-button,flag,hint,error"].join(",");return html`<${controlTag}
2
2
  exportparts=${exportParts}
3
3
  .positioningStrategy=${this.ownerDocument?resolveEffectivePositioningStrategy(this,this.positioningStrategy,"absolute"):this.positioningStrategy}
4
4
  .strings=${this.strings} .customError=${this.validity.valid?null:this.validationMessage}
@@ -1,4 +1,4 @@
1
- import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraSize}from'../../../internal/variants.js';import{type FormOwnerValue}from'../../../internal/form-associated.js';import{type LyraFormValidator}from'../form-validator.js';export interface LyraCheckboxEventMap{input:Event;change:Event;'lr-input':CustomEvent<{checked:boolean;value:string;}>;'lr-change':CustomEvent<{checked:boolean;value:string;}>;focus:FocusEvent;blur:FocusEvent;'lr-invalid':CustomEvent<null>;'lr-checkbox-toggle-request':CustomEvent<{checked:boolean;value:string;}>;}
1
+ import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import type{LyraSize}from'../../../internal/variants.js';import{type LyraFormValidator}from'../form-validator.js';export interface LyraCheckboxEventMap{input:Event;change:Event;'lr-input':CustomEvent<{checked:boolean;value:string;}>;'lr-change':CustomEvent<{checked:boolean;value:string;}>;focus:FocusEvent;blur:FocusEvent;'lr-invalid':CustomEvent<null>;'lr-checkbox-toggle-request':CustomEvent<{checked:boolean;value:string;}>;}declare class LyraCheckboxBase extends LyraElement<LyraCheckboxEventMap>{}declare const LyraCheckbox_base:typeof LyraCheckboxBase&(new(...args:any[])=>import("../../../lyra.js").FormAssociatedInterface<string> &import("../../../internal/form-associated.js").FormAssociatedSubclassInterface<string> &import("../../../lyra.js").CheckedFormAssociatedInterface&import("../../../internal/form-associated.js").CheckedFormAssociatedSubclassInterface);
2
2
  /**
3
3
  * `<lr-checkbox>` — a boolean form control. Structurally the same idea as
4
4
  * `<lr-switch>` (form-associated via `ElementInternals`, click and
@@ -6,10 +6,9 @@ import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from
6
6
  * an `aria-checked` that can also be `"mixed"`, and a visual box/checkmark
7
7
  * instead of a track/thumb.
8
8
  *
9
- * `checked` is not a plain string, so this attaches `ElementInternals`
10
- * directly and implements its own `updateValidity()` rather than using the
11
- * `FormAssociated` mixin — see `<lr-combobox>` for the same
12
- * direct-`ElementInternals` shape with a non-string value.
9
+ * Form association, dirty/default `checked` tracking, reset, state restore and the validity
10
+ * states come from the shared `CheckedFormAssociated` mixin, the same one `<lr-switch>` and
11
+ * `<lr-radio>` use; this class adds the mixed state, the group hooks and its own rendering.
13
12
  *
14
13
  * Supporting text is optional through either Web Awesome's `hint` spelling or Shoelace's
15
14
  * `help-text` spelling. `errorText` and the `error` slot provide the matching owned error surface;
@@ -131,9 +130,9 @@ import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from
131
130
  * @status stable
132
131
  * @since 4.0.0
133
132
  */
134
- export declare class LyraCheckbox extends LyraElement<LyraCheckboxEventMap>{
133
+ export declare class LyraCheckbox extends LyraCheckbox_base{
135
134
  /** Public WA-compatible intrinsic validator catalog. */
136
- static get validators():LyraFormValidator<LyraCheckbox>[];static styles:import("lit").CSSResultGroup[];static formAssociated:boolean;static properties:{customError:{attribute:string;reflect:boolean;noAccessor:boolean;};checked:{attribute:boolean;noAccessor:boolean;};defaultChecked:{attribute:string;type:BooleanConstructor;reflect:boolean;useDefault:boolean;noAccessor:boolean;};indeterminate:{type:BooleanConstructor;reflect:boolean;noAccessor:boolean;};disabled:{type:BooleanConstructor;reflect:boolean;noAccessor:boolean;};name:{reflect:boolean;noAccessor:boolean;converter:import("lit").ComplexAttributeConverter<string,unknown>;};required:{type:BooleanConstructor;reflect:boolean;noAccessor:boolean;};size:{reflect:boolean;};value:{reflect:boolean;noAccessor:boolean;};};
135
+ static get validators():LyraFormValidator<LyraCheckbox>[];static styles:import("lit").CSSResultGroup[];static properties:{indeterminate:{type:BooleanConstructor;reflect:boolean;noAccessor:boolean;};size:{reflect:boolean;};};
137
136
  /**
138
137
  * Control size, on the library's shared ladder. Accepts both spellings of every tier —
139
138
  * `2xs`/`xs`/`s`/`m`/`l`/`xl` and Web Awesome's `small`/`medium`/`large` — so migrating either way
@@ -150,32 +149,12 @@ helpText:string;
150
149
  /** WA SSR slot-presence hint used before light-DOM assignment can be inspected. */
151
150
  withHint:boolean;
152
151
  /** Error text associated with the inner checkbox; custom markup can use the `error` slot. */
153
- errorText:string;private hasLabelSlot;private readonly slotPresence;private get hasHintSlot();private get hasHelpTextSlot();private get hasErrorSlot();private hasInteracted;private internals;private validityController;
154
- /** Consumer-supplied validation message reflected through `custom-error`. */
155
- customError:string|null;private readonly labelTextObserver;private externalDescriptionLease?;private _defaultChecked;private _checkedDirty;private settingDefaultChecked;private reflectingDefaultChecked;private _fieldsetDisabled;private _groupDisabled;private _name;private _checked;private _indeterminate;private _disabled;private _required;private _value;private toggleGuard;
156
- /** Whether the control is disabled explicitly, by an ancestor fieldset, or by an owning `<lr-checkbox-group>`. */
157
- get effectiveDisabled():boolean;private get liveDisabled();get checked():boolean;set checked(next:boolean);
158
- /** Reflected current reset default; changing it never overwrites dirty live `checked` state. */
159
- get defaultChecked():boolean;set defaultChecked(next:boolean);get indeterminate():boolean;set indeterminate(next:boolean);private notifyOwningGroup;get disabled():boolean;set disabled(next:boolean);
160
- /** The form submission key, reflected synchronously for native form APIs. */
161
- get name():string;set name(next:string|null);get required():boolean;set required(next:boolean);get value():string;set value(next:string|null);constructor();get form():HTMLFormElement|null;set form(owner:FormOwnerValue);getForm():HTMLFormElement|null;get labels():NodeList;get validity():ValidityState;get validationMessage():string;get willValidate():boolean;connectedCallback():void;adoptedCallback():void;disconnectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private syncExternalDescription;private releaseExternalDescription;private get barredFromValidation();private updateValidity;private reflectInvalid;private syncFormState;formResetCallback():void;formStateRestoreCallback(state:string|File|FormData|null,reason:'autocomplete'|'restore'):void;private restoreCheckedFromDefault;formDisabledCallback(disabled:boolean):void;private markInteracted;checkValidity():boolean;reportValidity():boolean;
162
- /**
163
- * Sets or clears a consumer-supplied validation error — the standard channel for a server-side
164
- * rejection ("those terms have been superseded") that no client-side constraint can express. A
165
- * non-empty `message` raises `customError` and becomes `validationMessage`, so the control fails
166
- * `checkValidity()`, blocks form submission, and matches `:state(invalid)`; `''` clears it.
167
- *
168
- * Clearing restores the control's own computed validity rather than forcing it valid: a
169
- * required-and-unchecked checkbox whose custom error is cleared stays `valueMissing`. The custom
170
- * error also survives every intrinsic recomputation in between (each toggle re-runs
171
- * `updateValidity()`) and a form reset, exactly like a native control — only another
172
- * `setCustomValidity('')` clears it.
173
- *
174
- * The message is caller-supplied content, so it is used verbatim and never localized here.
175
- */
176
- setCustomValidity(message:string):void;
177
- /** Clears consumer-supplied validity and restores the current required/checked constraint. */
178
- resetValidity():void;
152
+ errorText:string;private hasLabelSlot;private readonly slotPresence;private get hasHintSlot();private get hasHelpTextSlot();private get hasErrorSlot();private readonly labelTextObserver;private externalDescriptionLease?;private _groupDisabled;private _indeterminate;private toggleGuard;
153
+ /** Group-driven disablement, on top of the control's own and its fieldset's. */
154
+ protected isDisabledByOwner():boolean;
155
+ /** Unconditional, including a write of the value already held: the guard tracks that a write
156
+ * happened, not that a value differs. See {@link toggleGuard}. */
157
+ protected checkedWritten(previous:boolean):void;protected valueWritten(previous:string):void;protected requiredMessage():string;protected commitFormValue(value:string):void;protected publishCustomStates():void;formStateRestoreCallback(state:string|File|FormData|null,reason:'autocomplete'|'restore'):void;private get liveDisabled();get indeterminate():boolean;set indeterminate(next:boolean);private notifyOwningGroup;connectedCallback():void;adoptedCallback():void;disconnectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private syncExternalDescription;private releaseExternalDescription;
179
158
  /** Activates the internal checkbox control (toggling it), mirroring `<lr-button>`'s host
180
159
  * `click()` forwarding -- `HTMLElement.prototype.click()` is otherwise a no-op on a custom
181
160
  * element with no native click semantics of its own. */
@@ -183,4 +162,4 @@ click():void;
183
162
  /** Moves focus to the internal checkbox control. */
184
163
  focus(options?:FocusOptions):void;
185
164
  /** Removes focus from the internal checkbox control. */
186
- blur():void;private toggle;private onClick;private onKeyDown;private onSlotChange;private isDefaultLabelNode;private labelForwardingSlots;private handleLabelSlotChange;private onLabelSlotChange;private recomputeHasLabelSlot;private onBlur;private onFocus;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-checkbox':LyraCheckbox;}}
165
+ blur():void;private toggle;private onClick;private onKeyDown;private onSlotChange;private isDefaultLabelNode;private labelForwardingSlots;private handleLabelSlotChange;private onLabelSlotChange;private recomputeHasLabelSlot;private onBlur;private onFocus;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-checkbox':LyraCheckbox;}}export{};
@@ -1,4 +1,4 @@
1
- import{__decorate}from"tslib";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{installFormControlLabelSupport}from"../../../internal/form-control-labels.js";import{FormControlController,reflectFormName}from"../../../internal/form-control-controller.js";import{html,svg,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{AccessibleTextController}from"../../../internal/accessible-text-controller.js";import{tag}from"../../../internal/prefix.js";import{VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState,syncValidityStates}from"../../../internal/custom-states.js";import{acquireResolvedAriaRelationship}from"../../../internal/aria-controls.js";import{sizes}from"../../../internal/sizes.styles.js";import{styles}from"./checkbox.styles.js";import{dispatchNativeEvent,relayNativeEvent}from"../../../internal/native-event-relay.js";import{requestThenCommit}from"../../../internal/request-commit.js";import{markVetoGuardWrite,VetoWriteGuard}from"../../../internal/veto-write-guard.js";import{omittedEmptyStringConverter}from"../../../internal/converters.js";import{hasRealContent}from"../../../internal/a11y.js";import{isActionableElement}from"../../../internal/focus-navigation.js";import{getFormOwner,isBarredFromValidation,setFormOwner}from"../../../internal/form-associated.js";import{currentValidityValidator}from"../form-validator.js";import{LYRA_DEFAULT_checkboxRequired,LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";installFormControlLabelSupport();const GLYPH_VIEW_BOX="0 0 24 24",GLYPH_STROKE_WIDTH="1.75";function checkmarkGlyph(){return svg`
1
+ import{__decorate}from"tslib";import{SlotPresenceController}from"../../../internal/slot-presence-controller.js";import{installFormControlLabelSupport}from"../../../internal/form-control-labels.js";import{html,svg,nothing}from"lit";import{property,state}from"lit/decorators.js";import{LyraElement}from"../../../internal/lyra-element.js";import{AccessibleTextController}from"../../../internal/accessible-text-controller.js";import{tag}from"../../../internal/prefix.js";import{VALIDITY_ANCHOR}from"../../../internal/anchored-validity.js";import{setCustomState}from"../../../internal/custom-states.js";import{acquireResolvedAriaRelationship}from"../../../internal/aria-controls.js";import{sizes}from"../../../internal/sizes.styles.js";import{styles}from"./checkbox.styles.js";import{dispatchNativeEvent,relayNativeEvent}from"../../../internal/native-event-relay.js";import{requestThenCommit}from"../../../internal/request-commit.js";import{markVetoGuardWrite,VetoWriteGuard}from"../../../internal/veto-write-guard.js";import{hasRealContent}from"../../../internal/a11y.js";import{isActionableElement}from"../../../internal/focus-navigation.js";import{CheckedFormAssociated}from"../../../internal/form-associated.js";import{currentValidityValidator}from"../form-validator.js";import{LYRA_DEFAULT_checkboxRequired,LYRA_DEFAULT_fieldRequired}from"../../../internal/default-strings.generated.js";installFormControlLabelSupport();const GLYPH_VIEW_BOX="0 0 24 24",GLYPH_STROKE_WIDTH="1.75";function checkmarkGlyph(){return svg`
2
2
  <svg
3
3
  part="checkmark checked-icon"
4
4
  width="1em"
@@ -26,7 +26,7 @@ import{__decorate}from"tslib";import{SlotPresenceController}from"../../../intern
26
26
  aria-hidden="true"
27
27
  focusable="false"
28
28
  ><line x1="5" y1="12" x2="19" y2="12"></line></svg>
29
- `}class LyraCheckbox extends LyraElement{static{this.defaultStrings={...super.defaultStrings,checkboxRequired:LYRA_DEFAULT_checkboxRequired,fieldRequired:LYRA_DEFAULT_fieldRequired}}static get validators(){return[currentValidityValidator("required","disabled","checked")]}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.formAssociated=!0}static{this.properties={customError:{attribute:"custom-error",reflect:!0,noAccessor:!0},checked:{attribute:!1,noAccessor:!0},defaultChecked:{attribute:"checked",type:Boolean,reflect:!0,useDefault:!0,noAccessor:!0},indeterminate:{type:Boolean,reflect:!0,noAccessor:!0},disabled:{type:Boolean,reflect:!0,noAccessor:!0},name:{reflect:!0,noAccessor:!0,converter:omittedEmptyStringConverter},required:{type:Boolean,reflect:!0,noAccessor:!0},size:{reflect:!0},value:{reflect:!0,noAccessor:!0}}}get hasHintSlot(){return this.slotPresence.has("hint")}get hasHelpTextSlot(){return this.slotPresence.has("help-text")}get hasErrorSlot(){return this.slotPresence.has("error")}get effectiveDisabled(){return this.disabled||this._fieldsetDisabled||this._groupDisabled}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}get checked(){return this._checked}set checked(next){const old=this._checked;this.settingDefaultChecked||(this._checkedDirty=!0),this._checked=!!next,markVetoGuardWrite(this.toggleGuard),this.syncFormState(),this.notifyOwningGroup(),this.requestUpdate("checked",old)}get defaultChecked(){return this._defaultChecked}set defaultChecked(next){if(this.reflectingDefaultChecked)return;const old=this._defaultChecked;this._defaultChecked=!!next,this.reflectingDefaultChecked=!0;try{this.toggleAttribute("checked",this._defaultChecked)}finally{this.reflectingDefaultChecked=!1}this._checkedDirty||this.restoreCheckedFromDefault(),this.requestUpdate("defaultChecked",old)}get indeterminate(){return this._indeterminate}set indeterminate(next){const old=this._indeterminate;this._indeterminate=!!next,this.syncFormState(),this.notifyOwningGroup(),this.requestUpdate("indeterminate",old)}notifyOwningGroup(){this.closest?.(tag("checkbox-group"))?.notifyCheckboxStateChange?.(this)}get disabled(){return this._disabled}set disabled(next){const old=this._disabled;this._disabled=!!next,this.toggleAttribute("disabled",this._disabled),this._fieldsetDisabled=this.validityController?.fieldsetDisabled(this._fieldsetDisabled)??this._fieldsetDisabled,this.updateValidity(),this.requestUpdate("disabled",old)}get name(){return this._name}set name(next){const old=this._name;this._name=next??"",reflectFormName(this,this._name),this.requestUpdate("name",old)}get required(){return this._required}set required(next){const old=this._required;this._required=!!next,this.toggleAttribute("required",this._required),this.updateValidity(),this.requestUpdate("required",old)}get value(){return this._value}set value(next){const old=this._value;this._value=next??"on",next==null?this.hasAttribute("value")&&this.removeAttribute("value"):this.getAttribute("value")!==this._value&&this.setAttribute("value",this._value),this.syncFormState(),this.notifyOwningGroup(),this.requestUpdate("value",old,{reflect:!1})}constructor(){super(),this.size="m",this.hint="",this.helpText="",this.withHint=!1,this.errorText="",this.hasLabelSlot=!1,this.slotPresence=new SlotPresenceController(this),this.hasInteracted=!1,this.labelTextObserver=new AccessibleTextController(this,[],()=>this.recomputeHasLabelSlot(),["slot"]),this._defaultChecked=!1,this._checkedDirty=!1,this.settingDefaultChecked=!1,this.reflectingDefaultChecked=!1,this._fieldsetDisabled=!1,this._groupDisabled=!1,this._name="",this._checked=!1,this._indeterminate=!1,this._disabled=!1,this._required=!1,this._value="on",this.toggleGuard=new VetoWriteGuard,this.markInteracted=()=>{this.hasInteracted||(this.hasInteracted=!0,this.reflectInvalid())},this.onClick=event=>{const owner=this[VALIDITY_ANCHOR]();for(const target of event.composedPath()){if(target===event.currentTarget)break;if(target&&typeof target=="object"&&target.nodeType===1&&target!==owner&&isActionableElement(target))return}this.toggle()},this.onKeyDown=e=>{this.liveDisabled||e.repeat||(e.key===" "||e.key==="Spacebar")&&(e.preventDefault(),this.toggle())},this.onSlotChange=event=>this.handleLabelSlotChange(event),this.onLabelSlotChange=event=>this.handleLabelSlotChange(event),this.onBlur=event=>{this.liveDisabled||(this.hasInteracted=!0,this.reflectInvalid()),relayNativeEvent(this,event)},this.onFocus=event=>{if(this.liveDisabled){event.stopPropagation();return}relayNativeEvent(this,event)},this.validityController=new FormControlController(this,{invalid:init=>this.emit("lr-invalid",null,init),interacted:this.markInteracted,customError:()=>this.validityController.customValidityMessage}),this.internals=this.validityController.formInternals,this.syncFormState()}get form(){return getFormOwner(this.internals)}set form(owner){setFormOwner(this,owner)}getForm(){return getFormOwner(this.internals)}get labels(){return this.internals.labels}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}get willValidate(){return this.internals.willValidate}[VALIDITY_ANCHOR](){return this.renderRoot?.querySelector(".checkbox-owner")??null}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.syncExternalDescription(),this.updateValidity(),this.addEventListener("slotchange",this.onLabelSlotChange),this.hasUpdated?this.recomputeHasLabelSlot():this.seedFirstRenderState(()=>{this.recomputeHasLabelSlot()})}adoptedCallback(){super.adoptedCallback(),this.labelTextObserver.adopted(),this.releaseExternalDescription(),this.hasUpdated&&this.syncExternalDescription()}disconnectedCallback(){this.releaseExternalDescription(),this.removeEventListener("slotchange",this.onLabelSlotChange),super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed)}updated(changed){super.updated(changed),this.syncExternalDescription()}syncExternalDescription(){if(!this.isConnected)return;const target=this[VALIDITY_ANCHOR]();target&&(this.externalDescriptionLease?this.externalDescriptionLease.update(target):this.externalDescriptionLease=acquireResolvedAriaRelationship(this,target,"aria-describedby"))}releaseExternalDescription(){this.externalDescriptionLease?.release(),this.externalDescriptionLease=void 0}get barredFromValidation(){return isBarredFromValidation(this,this.internals)}updateValidity(){this.barredFromValidation?this.validityController.setValidity({}):this.required&&!this.checked?this.validityController.setValidity({valueMissing:!0},this.localize("checkboxRequired")):this.validityController.setValidity({}),this.reflectInvalid()}reflectInvalid(){const barred=this.barredFromValidation;this.toggleAttribute("data-invalid",!barred&&this.hasInteracted&&!this.internals.validity.valid),syncValidityStates(this.internals,{required:this.required,hasInteracted:this.hasInteracted,barred}),setCustomState(this.internals,"checked",this.checked),setCustomState(this.internals,"indeterminate",this.indeterminate),setCustomState(this.internals,"disabled",this.effectiveDisabled)}syncFormState(){const state2=`${this.checked?"checked":"unchecked"}${this.indeterminate?"/indeterminate":""}`;this.internals.setFormValue(this.checked?this.value:null,state2),this.updateValidity()}formResetCallback(){this.restoreCheckedFromDefault(),this.hasInteracted=!1,this.reflectInvalid()}formStateRestoreCallback(state2,reason){const oldChecked=this._checked,oldIndeterminate=this._indeterminate;this._checked=state2==="checked"||state2==="checked/indeterminate",this._checkedDirty=!0,this._indeterminate=state2==="checked/indeterminate"||state2==="unchecked/indeterminate",this.syncFormState(),this.requestUpdate("checked",oldChecked),this.requestUpdate("indeterminate",oldIndeterminate)}resetFromGroup(){this.restoreCheckedFromDefault()}restoreCheckedFromDefault(){this.settingDefaultChecked=!0;try{this.checked=this._defaultChecked}finally{this.settingDefaultChecked=!1}this._checkedDirty=!1}formDisabledCallback(disabled){if(this.validityController?.reflectingDisabled)return;const wasDisabled=this.effectiveDisabled;this._fieldsetDisabled=disabled,wasDisabled!==this.effectiveDisabled&&(this.updateValidity(),this.requestUpdate())}setGroupDisabled(value){this._groupDisabled!==value&&(this._groupDisabled=value,this.updateValidity(),this.requestUpdate())}checkValidity(){return this.validityController.checkValidity(()=>this.updateValidity())}reportValidity(){return this.validityController.syncConstraints(),this.updateValidity(),this.hasInteracted=!0,this.reflectInvalid(),this.internals.reportValidity()}setCustomValidity(message){this.validityController.setCustomValidity(message??""),this.reflectInvalid(),this.requestUpdate()}resetValidity(){this.setCustomValidity("")}click(){this.liveDisabled||this[VALIDITY_ANCHOR]()?.click()}focus(options){this.liveDisabled||this[VALIDITY_ANCHOR]()?.focus(options)}blur(){this[VALIDITY_ANCHOR]()?.blur()}toggle(){if(this.liveDisabled)return;const proposed=!this.checked;requestThenCommit({requestDetail:{checked:proposed,value:this.value},emitRequest:(detail,init)=>this.emit("lr-checkbox-toggle-request",detail,init),guard:this.toggleGuard,commit:()=>{this.hasInteracted=!0,this.checked=proposed,this.indeterminate=!1,dispatchNativeEvent(this,"input"),this.emit("lr-input",{checked:this.checked,value:this.value}),dispatchNativeEvent(this,"change"),this.emit("lr-change",{checked:this.checked,value:this.value})}})}isDefaultLabelNode(node){if(node.nodeType!==1)return!0;const slotName=node.getAttribute("slot");return slotName===null||slotName===""}labelForwardingSlots(){return Array.from(this.querySelectorAll("slot")).filter(slot=>{let top=slot;for(;top.parentNode&&top.parentNode!==this;)top=top.parentNode;return top.parentNode===this&&this.isDefaultLabelNode(top)})}handleLabelSlotChange(event){const target=event.target;target?.nodeType!==1||target.localName!=="slot"||target.getRootNode()!==this.renderRoot&&!this.labelForwardingSlots().includes(target)||(this.labelTextObserver.bind(),this.recomputeHasLabelSlot())}recomputeHasLabelSlot(){const renderRoot=this.renderRoot,childNodes=this.childNodes;if(!renderRoot||!childNodes)return;const slot=renderRoot.querySelector("slot:not([name])"),nodes=slot?slot.assignedNodes({flatten:!0}):Array.from(childNodes).filter(node=>this.isDefaultLabelNode(node)).flatMap(node=>{if(node.nodeType!==1||node.localName!=="slot")return[node];const forwardingSlot=node;return forwardingSlot.assignedNodes().length>0?forwardingSlot.assignedNodes({flatten:!0}):Array.from(forwardingSlot.childNodes)});this.hasLabelSlot=hasRealContent(nodes)}render(){const mixed=this.indeterminate,hasHint=this.withHint||this.hasHintSlot||this.hasHelpTextSlot||!!(this.hint||this.helpText),hasError=this.hasErrorSlot||(this.errorText??"").length>0,controlParts=["box","control",this.checked?"checked control--checked":"",mixed?"indeterminate control--indeterminate":""].filter(Boolean).join(" "),describedBy=[hasError?"checkbox-error":"",hasHint?"checkbox-hint":""].filter(Boolean).join(" "),invalid=hasError||this.hasInteracted&&!this.internals.validity.valid;return html`
29
+ `}class LyraCheckboxBase extends LyraElement{}class LyraCheckbox extends CheckedFormAssociated(LyraCheckboxBase){constructor(){super(...arguments),this.size="m",this.hint="",this.helpText="",this.withHint=!1,this.errorText="",this.hasLabelSlot=!1,this.slotPresence=new SlotPresenceController(this),this.labelTextObserver=new AccessibleTextController(this,[],()=>this.recomputeHasLabelSlot(),["slot"]),this._groupDisabled=!1,this._indeterminate=!1,this.toggleGuard=new VetoWriteGuard,this.onClick=event=>{const owner=this[VALIDITY_ANCHOR]();for(const target of event.composedPath()){if(target===event.currentTarget)break;if(target&&typeof target=="object"&&target.nodeType===1&&target!==owner&&isActionableElement(target))return}this.toggle()},this.onKeyDown=e=>{this.liveDisabled||e.repeat||(e.key===" "||e.key==="Spacebar")&&(e.preventDefault(),this.toggle())},this.onSlotChange=event=>this.handleLabelSlotChange(event),this.onLabelSlotChange=event=>this.handleLabelSlotChange(event),this.onBlur=event=>{this.liveDisabled||this.setInteracted(!0),relayNativeEvent(this,event)},this.onFocus=event=>{if(this.liveDisabled){event.stopPropagation();return}relayNativeEvent(this,event)}}static{this.defaultStrings={...super.defaultStrings,checkboxRequired:LYRA_DEFAULT_checkboxRequired,fieldRequired:LYRA_DEFAULT_fieldRequired}}static get validators(){return[currentValidityValidator("required","disabled","checked")]}static{this.styles=[LyraElement.styles,sizes,styles]}static{this.properties={indeterminate:{type:Boolean,reflect:!0,noAccessor:!0},size:{reflect:!0}}}get hasHintSlot(){return this.slotPresence.has("hint")}get hasHelpTextSlot(){return this.slotPresence.has("help-text")}get hasErrorSlot(){return this.slotPresence.has("error")}isDisabledByOwner(){return this._groupDisabled}checkedWritten(previous){markVetoGuardWrite(this.toggleGuard),this.notifyOwningGroup()}valueWritten(previous){this.notifyOwningGroup()}requiredMessage(){return this.localize("checkboxRequired")}commitFormValue(value){const state2=`${this.checked?"checked":"unchecked"}${this.indeterminate?"/indeterminate":""}`;this.internals.setFormValue(this.checked?value:null,state2)}publishCustomStates(){super.publishCustomStates();const barred=this.isBarredFromValidation();this.toggleAttribute("data-invalid",!barred&&this.hasInteracted&&!this.internals.validity.valid),setCustomState(this.internals,"indeterminate",!!this.indeterminate)}formStateRestoreCallback(state2,reason){this.checked=state2==="checked"||state2==="checked/indeterminate",this.indeterminate=state2==="checked/indeterminate"||state2==="unchecked/indeterminate"}get liveDisabled(){return this.effectiveDisabled||this.matches(":disabled")}get indeterminate(){return this._indeterminate}set indeterminate(next){const old=this._indeterminate;this._indeterminate=!!next,this.commitFormValue(this.value),this.updateValidity(),this.notifyOwningGroup(),this.requestUpdate("indeterminate",old)}notifyOwningGroup(){this.closest?.(tag("checkbox-group"))?.notifyCheckboxStateChange?.(this)}[VALIDITY_ANCHOR](){return this.renderRoot?.querySelector(".checkbox-owner")??null}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.syncExternalDescription(),this.addEventListener("slotchange",this.onLabelSlotChange),this.hasUpdated?this.recomputeHasLabelSlot():this.seedFirstRenderState(()=>{this.recomputeHasLabelSlot()})}adoptedCallback(){super.adoptedCallback(),this.labelTextObserver.adopted(),this.releaseExternalDescription(),this.hasUpdated&&this.syncExternalDescription()}disconnectedCallback(){this.releaseExternalDescription(),this.removeEventListener("slotchange",this.onLabelSlotChange),super.disconnectedCallback()}willUpdate(changed){super.willUpdate(changed)}updated(changed){super.updated(changed),this.syncExternalDescription()}syncExternalDescription(){if(!this.isConnected)return;const target=this[VALIDITY_ANCHOR]();target&&(this.externalDescriptionLease?this.externalDescriptionLease.update(target):this.externalDescriptionLease=acquireResolvedAriaRelationship(this,target,"aria-describedby"))}releaseExternalDescription(){this.externalDescriptionLease?.release(),this.externalDescriptionLease=void 0}resetFromGroup(){this.restoreCheckedFromDefault()}setGroupDisabled(value){this._groupDisabled!==value&&(this._groupDisabled=value,this.updateValidity(),this.requestUpdate())}click(){this.liveDisabled||this[VALIDITY_ANCHOR]()?.click()}focus(options){this.liveDisabled||this[VALIDITY_ANCHOR]()?.focus(options)}blur(){this[VALIDITY_ANCHOR]()?.blur()}toggle(){if(this.liveDisabled)return;const proposed=!this.checked;requestThenCommit({requestDetail:{checked:proposed,value:this.value},emitRequest:(detail,init)=>this.emit("lr-checkbox-toggle-request",detail,init),guard:this.toggleGuard,commit:()=>{this.setInteracted(!0),this.checked=proposed,this.indeterminate=!1,dispatchNativeEvent(this,"input"),this.emit("lr-input",{checked:this.checked,value:this.value}),dispatchNativeEvent(this,"change"),this.emit("lr-change",{checked:this.checked,value:this.value})}})}isDefaultLabelNode(node){if(node.nodeType!==1)return!0;const slotName=node.getAttribute("slot");return slotName===null||slotName===""}labelForwardingSlots(){return Array.from(this.querySelectorAll("slot")).filter(slot=>{let top=slot;for(;top.parentNode&&top.parentNode!==this;)top=top.parentNode;return top.parentNode===this&&this.isDefaultLabelNode(top)})}handleLabelSlotChange(event){const target=event.target;target?.nodeType!==1||target.localName!=="slot"||target.getRootNode()!==this.renderRoot&&!this.labelForwardingSlots().includes(target)||(this.labelTextObserver.bind(),this.recomputeHasLabelSlot())}recomputeHasLabelSlot(){const renderRoot=this.renderRoot,childNodes=this.childNodes;if(!renderRoot||!childNodes)return;const slot=renderRoot.querySelector("slot:not([name])"),nodes=slot?slot.assignedNodes({flatten:!0}):Array.from(childNodes).filter(node=>this.isDefaultLabelNode(node)).flatMap(node=>{if(node.nodeType!==1||node.localName!=="slot")return[node];const forwardingSlot=node;return forwardingSlot.assignedNodes().length>0?forwardingSlot.assignedNodes({flatten:!0}):Array.from(forwardingSlot.childNodes)});this.hasLabelSlot=hasRealContent(nodes)}render(){const mixed=this.indeterminate,hasHint=this.withHint||this.hasHintSlot||this.hasHelpTextSlot||!!(this.hint||this.helpText),hasError=this.hasErrorSlot||(this.errorText??"").length>0,controlParts=["box","control",this.checked?"checked control--checked":"",mixed?"indeterminate control--indeterminate":""].filter(Boolean).join(" "),describedBy=[hasError?"checkbox-error":"",hasHint?"checkbox-hint":""].filter(Boolean).join(" "),invalid=hasError||this.hasInteracted&&!this.internals.validity.valid;return html`
30
30
  <div part="form-control">
31
31
  <span class="checkbox-layout" part="row" @click=${this.onClick}>
32
32
  <span
@@ -61,4 +61,4 @@ import{__decorate}from"tslib";import{SlotPresenceController}from"../../../intern
61
61
  ><slot name="help-text"></slot>
62
62
  </div>
63
63
  </div>
64
- `}}__decorate([property()],LyraCheckbox.prototype,"hint",void 0),__decorate([property({attribute:"help-text"})],LyraCheckbox.prototype,"helpText",void 0),__decorate([property({type:Boolean,attribute:"with-hint"})],LyraCheckbox.prototype,"withHint",void 0),__decorate([property({attribute:"error-text"})],LyraCheckbox.prototype,"errorText",void 0),__decorate([state()],LyraCheckbox.prototype,"hasLabelSlot",void 0),__decorate([state()],LyraCheckbox.prototype,"hasInteracted",void 0);export{LyraCheckbox};
64
+ `}}__decorate([property()],LyraCheckbox.prototype,"hint",void 0),__decorate([property({attribute:"help-text"})],LyraCheckbox.prototype,"helpText",void 0),__decorate([property({type:Boolean,attribute:"with-hint"})],LyraCheckbox.prototype,"withHint",void 0),__decorate([property({attribute:"error-text"})],LyraCheckbox.prototype,"errorText",void 0),__decorate([state()],LyraCheckbox.prototype,"hasLabelSlot",void 0);export{LyraCheckbox};